@shophost/react 2.0.37 → 2.0.39
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 +290 -289
- package/package.json +6 -3
- package/react.css +1 -1
package/admin-client.js
CHANGED
|
@@ -8,7 +8,7 @@ import Q, { Toaster as ls } from "react-hot-toast";
|
|
|
8
8
|
import { inferAdditionalFields as _r, organizationClient as Gr } from "better-auth/client/plugins";
|
|
9
9
|
import { createAuthClient as $r } from "better-auth/react";
|
|
10
10
|
import { useFormContext as Kr, useFormState as tt, useForm as se, FormProvider as Ve, useFieldArray as Tt } from "react-hook-form";
|
|
11
|
-
import { Search as Jt, ChevronDown as
|
|
11
|
+
import { Search as Jt, ChevronDown as ta, Check as Aa, MailIcon as os, XIcon as rt, CloudUpload as Ga, Loader2 as ds, Phone as Xr, X as Ca, LanguagesIcon as Yr, ChevronLeft as Sa, ShoppingBasketIcon as ei, UserIcon as $a, LayoutDashboardIcon as cs, ShoppingBagIcon as oa, CalendarDaysIcon as Ye, LogOutIcon as ms, ArrowRightIcon as us, PartyPopperIcon as ps, CopyIcon as hs, AtSign as gs, PlusCircleIcon as fs, XCircleIcon as ys, PlusIcon as Me, CheckCircle as it, ArrowRight as bs, CheckIcon as nt, EyeOffIcon as ai, PencilIcon as ti, Trash2 as Ot, TrashIcon as xs, BookCopyIcon as vr, HomeIcon as ri, RadioIcon as ii, LogsIcon as ni, CalendarCheckIcon as si, PackageIcon as li, BoxesIcon as oi, FactoryIcon as di, UserCircleIcon as ws, ExternalLinkIcon as ks } from "lucide-react";
|
|
12
12
|
import { upload as ci } from "@vercel/blob/client";
|
|
13
13
|
import xe from "next/image.js";
|
|
14
14
|
import { useDebounce as Ze } from "use-debounce";
|
|
@@ -17,7 +17,7 @@ import { withMask as vs } from "use-mask-input";
|
|
|
17
17
|
import { Transition as mi, Dialog as Ns, TransitionChild as Nr, DialogPanel as As } from "@headlessui/react";
|
|
18
18
|
import E from "next/link.js";
|
|
19
19
|
import { RiCloseLine as ui, RiLoader2Fill as pi, RiSearchLine as Lt, RiEyeFill as hi, RiEyeOffFill as gi, RiGoogleFill as st, RiArrowLeftDoubleLine as fi, RiArrowLeftSLine as yi, RiArrowRightSLine as lt, RiArrowRightDoubleLine as bi, RiCalendar2Fill as Cs, RiSubtractFill as Ss, RiRefreshLine as Is, RiMoneyDollarCircleLine as Es, RiShoppingBag3Line as zs, RiCalendarCheckLine as Ds, RiGroupLine as Fs, RiArrowUpSLine as Rs, RiArrowDownSLine as Bs, RiCheckLine as xi, RiRadioButtonFill as Ms, RiCheckboxBlankCircleLine as Ps, RiMoreFill as ot, RiSettings5Line as wi, RiMenuLine as Qs, RiExpandUpDownLine as ki, RiSunLine as Ts, RiMoonLine as Js, RiComputerLine as Os, RiMore2Fill as Ls } from "@remixicon/react";
|
|
20
|
-
import { useRouter as G, useSearchParams as pe, usePathname as da, useParams as vi, notFound as
|
|
20
|
+
import { useRouter as G, useSearchParams as pe, usePathname as da, useParams as vi, notFound as Ke } from "next/navigation.js";
|
|
21
21
|
import { zodResolver as le } from "@hookform/resolvers/zod";
|
|
22
22
|
import { isValid as jt, format as H, addYears as Qa, subDays as Ar, endOfDay as js, startOfDay as Vs } from "date-fns";
|
|
23
23
|
import { initClient as Zs } from "@shophost/client";
|
|
@@ -81,11 +81,11 @@ function dl(a) {
|
|
|
81
81
|
const t = a.replace(/\/$/, "");
|
|
82
82
|
return { home: t, signIn: `${t}/auth/sign-in`, signUp: `${t}/auth/sign-up`, organizations: `${t}/organizations`, dashboard: (r) => `${t}/${r}/dashboard`, liveOrders: (r) => `${t}/${r}/live-orders`, orders: (r) => `${t}/${r}/orders`, reservations: (r) => `${t}/${r}/reservations`, products: (r) => `${t}/${r}/products`, productCreate: (r) => `${t}/${r}/products/create`, productEdit: (r, n) => `${t}/${r}/products/${n}`, productCategories: (r) => `${t}/${r}/product-categories`, productCategoryCreate: (r) => `${t}/${r}/product-categories/create`, productCategoryEdit: (r, n) => `${t}/${r}/product-categories/${n}`, manufacturers: (r) => `${t}/${r}/manufacturers`, manufacturerCreate: (r) => `${t}/${r}/manufacturers/create`, manufacturerEdit: (r, n) => `${t}/${r}/manufacturers/${n}`, settings: (r) => `${t}/${r}/settings`, settingsOpeningTimes: (r) => `${t}/${r}/settings/opening-times`, settingsShippingMethods: (r) => `${t}/${r}/settings/shipping-methods`, settingsShippingMethodCreate: (r) => `${t}/${r}/settings/shipping-methods/create`, settingsShippingMethodEdit: (r, n) => `${t}/${r}/settings/shipping-methods/${n}`, settingsAccess: (r) => `${t}/${r}/settings/access`, settingsAccessInvite: (r) => `${t}/${r}/settings/access/invite`, settingsAccessMemberEdit: (r, n) => `${t}/${r}/settings/access/${n}` };
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function cu({ config: a, children: t }) {
|
|
85
85
|
const r = ke(() => ol(a.apiBaseUrl), [a.apiBaseUrl]), n = ke(() => dl(a.basePath), [a.basePath]);
|
|
86
86
|
return i(Ur, { client: te, children: [e(is, { defaultTheme: "light", attribute: "class", children: e(Ei, { baseUrl: a.apiBaseUrl, children: e(il, { client: r, children: e(nl, { config: a, children: e(sl, { routes: n, children: t }) }) }) }) }), e(ls, {})] });
|
|
87
87
|
}
|
|
88
|
-
const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModalOpen: !1, selectedProduct: null, onModalAddToCart: void 0, totalAmount: 0, itemCount: 0, removedItemsAlert: !1 },
|
|
88
|
+
const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModalOpen: !1, selectedProduct: null, onModalAddToCart: void 0, totalAmount: 0, itemCount: 0, removedItemsAlert: !1 }, mu = (a, t) => a.reduce((r, n) => {
|
|
89
89
|
const s = t(n.productId);
|
|
90
90
|
if (!s) return r;
|
|
91
91
|
const l = n.quantity || 1;
|
|
@@ -101,7 +101,7 @@ const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModa
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
}), r + o;
|
|
104
|
-
}, 0), ye = (a, t = "USD", r = "en-US") => new Intl.NumberFormat(r, { style: "currency", currency: t }).format(a),
|
|
104
|
+
}, 0), ye = (a, t = "USD", r = "en-US") => new Intl.NumberFormat(r, { style: "currency", currency: t }).format(a), uu = (a, t, r = "en-US") => {
|
|
105
105
|
const n = t(a.productId);
|
|
106
106
|
return !n || !a.modifierGroups || a.modifierGroups.length === 0 ? "" : a.modifierGroups.filter((s) => s && s.modifiers).map((s) => {
|
|
107
107
|
var p, m, h, u;
|
|
@@ -115,7 +115,7 @@ const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModa
|
|
|
115
115
|
}).filter(Boolean).join(", ");
|
|
116
116
|
return o ? `${o}: ${d}` : d;
|
|
117
117
|
}).filter(Boolean).join(" | ");
|
|
118
|
-
},
|
|
118
|
+
}, pu = (a, t, r) => a.find((n) => n.productId !== t ? !1 : !r || r.length === 0 ? !n.modifierGroups || n.modifierGroups.length === 0 : !n.modifierGroups || n.modifierGroups.length === 0 ? !1 : Ft(n.modifierGroups, r)), Ft = (a, t) => {
|
|
119
119
|
if (a.length !== t.length) return !1;
|
|
120
120
|
const r = [...t];
|
|
121
121
|
return a.every((n) => {
|
|
@@ -129,7 +129,7 @@ const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModa
|
|
|
129
129
|
});
|
|
130
130
|
return s >= 0 ? (r.splice(s, 1), !0) : !1;
|
|
131
131
|
});
|
|
132
|
-
},
|
|
132
|
+
}, hu = (a) => !a.modifierGroups || a.modifierGroups.length === 0 ? !1 : a.modifierGroups.some((t) => t.selectMin > 0), ml = (a, t) => {
|
|
133
133
|
var r, n, s, l, o;
|
|
134
134
|
if (!a.modifierGroups || a.modifierGroups.length === 0) return { valid: !0 };
|
|
135
135
|
for (const d of a.modifierGroups) {
|
|
@@ -144,7 +144,7 @@ const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModa
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
return { valid: !0 };
|
|
147
|
-
},
|
|
147
|
+
}, ra = (a) => a.reduce((t, r) => t + (r.quantity || 1), 0), ul = (a, t) => a.findIndex((r) => {
|
|
148
148
|
var n, s, l, o, d;
|
|
149
149
|
return r.productId !== t.productId ? !1 : !((n = r.modifierGroups) != null && n.length) && !((s = t.modifierGroups) != null && s.length) ? !0 : (((l = r.modifierGroups) == null ? void 0 : l.length) || 0) !== (((o = t.modifierGroups) == null ? void 0 : o.length) || 0) ? !1 : ((d = r.modifierGroups) == null ? void 0 : d.every((p) => {
|
|
150
150
|
var h;
|
|
@@ -162,7 +162,7 @@ const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModa
|
|
|
162
162
|
switch (t.type) {
|
|
163
163
|
case "INITIALIZE_CART": {
|
|
164
164
|
const r = t.payload;
|
|
165
|
-
return { ...a, items: r, itemCount:
|
|
165
|
+
return { ...a, items: r, itemCount: ra(r) };
|
|
166
166
|
}
|
|
167
167
|
case "SET_INITIALIZED":
|
|
168
168
|
return { ...a, isInitialized: t.payload };
|
|
@@ -174,7 +174,7 @@ const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModa
|
|
|
174
174
|
const l = s[n];
|
|
175
175
|
s[n] = { ...l, quantity: (l.quantity || 1) + (r.quantity || 1) };
|
|
176
176
|
} else s = [...a.items, r];
|
|
177
|
-
return { ...a, items: s, itemCount:
|
|
177
|
+
return { ...a, items: s, itemCount: ra(s) };
|
|
178
178
|
}
|
|
179
179
|
case "UPDATE_ITEM_QUANTITY": {
|
|
180
180
|
const { productId: r, quantity: n, modifierGroups: s } = t.payload;
|
|
@@ -186,12 +186,12 @@ const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModa
|
|
|
186
186
|
} else if (!s && o.modifierGroups && o.modifierGroups.length > 0) return o;
|
|
187
187
|
return { ...o, quantity: n };
|
|
188
188
|
});
|
|
189
|
-
return { ...a, items: l, itemCount:
|
|
189
|
+
return { ...a, items: l, itemCount: ra(l) };
|
|
190
190
|
}
|
|
191
191
|
case "REMOVE_ITEM": {
|
|
192
192
|
const { productId: r, modifierGroups: n } = t.payload;
|
|
193
193
|
let s;
|
|
194
|
-
return !n || n.length === 0 ? s = a.items.filter((l) => l.productId !== r ? !0 : l.modifierGroups && l.modifierGroups.length > 0) : s = a.items.filter((l) => l.productId !== r ? !0 : l.modifierGroups && l.modifierGroups.length > 0 ? !Ft(l.modifierGroups, n) : !0), { ...a, items: s, itemCount:
|
|
194
|
+
return !n || n.length === 0 ? s = a.items.filter((l) => l.productId !== r ? !0 : l.modifierGroups && l.modifierGroups.length > 0) : s = a.items.filter((l) => l.productId !== r ? !0 : l.modifierGroups && l.modifierGroups.length > 0 ? !Ft(l.modifierGroups, n) : !0), { ...a, items: s, itemCount: ra(s) };
|
|
195
195
|
}
|
|
196
196
|
case "CLEAR_CART":
|
|
197
197
|
return { ...a, items: [], itemCount: 0, totalAmount: 0 };
|
|
@@ -213,11 +213,11 @@ const zr = "shophost-cart", cl = { items: [], isInitialized: !1, isModifiersModa
|
|
|
213
213
|
const p = r[d.productId];
|
|
214
214
|
return p ? pl(d, p) : !1;
|
|
215
215
|
}), o = l.length < s;
|
|
216
|
-
return { ...a, items: l, itemCount:
|
|
216
|
+
return { ...a, items: l, itemCount: ra(l), removedItemsAlert: !!(n && o) };
|
|
217
217
|
}
|
|
218
218
|
case "REMOVE_INVALID_PRODUCTS": {
|
|
219
219
|
const { invalidProductIds: r } = t.payload, n = a.items.filter((s) => !r.includes(s.productId));
|
|
220
|
-
return { ...a, items: n, itemCount:
|
|
220
|
+
return { ...a, items: n, itemCount: ra(n) };
|
|
221
221
|
}
|
|
222
222
|
default:
|
|
223
223
|
return a;
|
|
@@ -374,7 +374,7 @@ const Pi = Ne(void 0), hl = ({ children: a, initialOrganization: t, organization
|
|
|
374
374
|
const { itemCount: b, total: f, locale: w } = qt(), { organization: y } = we(), x = (y == null ? void 0 : y.configuration.defaultCurrency) ?? "USD", v = ye(f, x, w), N = { checkoutHref: a, checkoutLabel: t, close: o ?? (() => {
|
|
375
375
|
}), formattedTotal: v, itemCount: b, total: f };
|
|
376
376
|
return i("div", { className: n, children: [u ? u({ onClose: o, showCloseButton: d, title: r }) : i("div", { className: l, children: [e("h3", { className: "text-lg font-black font-red-hat-display text-white", children: r }), d && o && e("button", { onClick: o, className: "text-white p-1 rounded-full hover:bg-teal-400 transition-colors", "aria-label": "Close cart", type: "button", children: e(ui, { className: "h-5 w-5" }) })] }), e("div", { className: s, children: e(bl, { renderItem: (C) => g(C), loadingComponent: m, emptyCartComponent: p }) }), b > 0 && (h ? h(N) : i("div", { className: "flex items-center px-4 py-4 border-t border-t-slate-200 mt-auto w-full", children: [e("div", { className: "w-[125px] font-medium h-[45px] rounded-lg flex items-center text-sm justify-center border border-slate-200 whitespace-nowrap mr-2", children: v }), e(E, { href: a, className: "btn text-sm text-white bg-teal-500 hover:bg-teal-400 rounded-lg w-full", onClick: o, children: t })] }))] });
|
|
377
|
-
},
|
|
377
|
+
}, gu = ({ isOpen: a, onClose: t, checkoutHref: r = "/checkout/customer-details", checkoutLabel: n = "Checkout", title: s = "Shopping bag", className: l, contentClassName: o, emptyCartComponent: d, loadingComponent: p, renderFooter: m, renderItem: h }) => {
|
|
378
378
|
const u = qr(null), [g, b] = F(null), [f, w] = F(null), y = 50, x = (C) => {
|
|
379
379
|
w(null), b(C.targetTouches[0].clientY);
|
|
380
380
|
}, v = (C) => {
|
|
@@ -434,7 +434,7 @@ ao.partial().openapi("UpdateCustomer");
|
|
|
434
434
|
const $t = c.object({ email: c.string().min(1, "Email is required").email("Invalid email").openapi({ example: "user@example.com", description: "User's email address" }), password: c.string().min(1, "Password is required").min(8, "Password must be more than 8 characters").max(32, "Password must be less than 32 characters").openapi({ example: "password123", description: "User's password" }), firstname: c.string().min(1, "First name is required").max(32, "First name must be less than 32 characters").openapi({ example: "John", description: "User's first name" }), lastname: c.string().min(1, "Last name is required").max(32, "Last name must be less than 32 characters").openapi({ example: "Doe", description: "User's last name" }) }).openapi("SignUp"), Ki = $t.pick({ email: !0, password: !0 }).openapi("SignIn"), to = c.object({ organizationId: c.string().cuid().min(1, "organizationId is required").openapi({ example: "ckel0e8qw00004n5p5w6fznym", description: "The organization ID" }) }).openapi("OrganizationParams");
|
|
435
435
|
to.extend({ id: c.string().cuid().min(1, "id is required").openapi({ example: "ckel0e8qw00004n5p5w6fznym", description: "The organization ID" }) }).openapi("OrganizationWithIdParams"), c.object({ placeId: c.string().openapi({ example: "ChIJN1t_tKlj4AR4GeTYWZ7frY", description: "The Google Place ID for the address" }), text: c.string().openapi({ example: "123 Main Street, New York, USA", description: "The description of the place" }), addressLineOne: c.string().openapi({ example: "123 Main Street", description: "The first line of the address" }), addressLineTwo: c.string().optional().openapi({ example: "Suite 100", description: "The second line of the address" }), latitude: c.number().optional().openapi({ example: 40.712776, description: "The latitude of the coordinate" }), longitude: c.number().optional().openapi({ example: -74.005974, description: "The longitude of the coordinate" }) }).openapi("Place"), c.object({ addressLineOne: c.string().openapi({ example: "123 Main Street", description: "The first line of the address" }), zipCode: c.string().optional().openapi({ example: "12345", description: "The postal code of the address" }), city: c.string().openapi({ example: "New York", description: "The city of the address" }), country: c.string().openapi({ example: "USA", description: "The ISO 3166-1 alpha-2 country code" }) }).openapi("PlaceDetails");
|
|
436
436
|
const ro = c.object({ id: c.string().openapi({ description: "Unique identifier for the order", example: "clj1234567890abcdef" }), firstname: c.string().openapi({ description: "Customer's first name", example: "John" }), lastname: c.string().openapi({ description: "Customer's last name", example: "Doe" }), guests: Ya, phone: c.string().openapi({ description: "Customer's phone number", example: "+1234567890" }), date: c.coerce.date().openapi({ description: "Reservation date and time", example: "2023-06-14T16:20:00Z" }), referenceId: c.string().openapi({ description: "External reference ID for the order", example: "ORD-12345" }), acceptedAt: c.date().nullable().optional().openapi({ description: "Date when the order was accepted", example: "2023-06-15T14:30:00Z" }), cancelledAt: c.date().nullable().optional().openapi({ description: "Date when the order was cancelled", example: "2023-06-14T16:20:00Z" }), createdAt: c.date().nullable().optional().openapi({ description: "Date when the order was created", example: "2023-06-14T16:20:00Z" }) }).openapi("Reservation"), io = ro.pick({ firstname: !0, lastname: !0, guests: !0, phone: !0, date: !0 }).openapi("CreateReservation");
|
|
437
|
-
function
|
|
437
|
+
function aa(...a) {
|
|
438
438
|
return Ai(Ni(...a));
|
|
439
439
|
}
|
|
440
440
|
const Xi = ["focus:ring-2", "focus:ring-blue-200 dark:focus:ring-blue-700/30", "focus:border-blue-500 dark:focus:border-blue-700"], pa = ["outline outline-offset-2 outline-0 focus-visible:outline-2", "outline-blue-500 dark:outline-blue-500"], no = ["ring-2", "border-red-500 dark:border-red-700", "ring-red-200 dark:ring-red-700/30"], so = Te({ base: ["relative inline-flex items-center justify-center whitespace-nowrap rounded-lg border px-3 py-2 text-center text-sm font-medium shadow-2xs transition-all duration-100 ease-in-out cursor-pointer", "disabled:pointer-events-none disabled:shadow-none disabled:cursor-not-allowed", pa], variants: { variant: { primary: ["border-transparent", "text-white dark:text-white", "bg-teal-500 dark:bg-teal-500", "hover:bg-teal-600 dark:hover:bg-teal-600", "disabled:bg-teal-100 disabled:text-gray-400", "dark:disabled:bg-teal-800 dark:disabled:text-teal-400"], secondary: ["border-gray-200 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"], light: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-gray-200 dark:bg-gray-900", "hover:bg-gray-300/70 dark:hover:bg-gray-800/80", "disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:bg-gray-800 dark:disabled:text-gray-600"], ghost: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800/80", "disabled:text-gray-400", "dark:disabled:text-gray-600"], destructive: ["text-white", "border-transparent", "bg-red-600 dark:bg-red-700", "hover:bg-red-700 dark:hover:bg-red-600", "disabled:bg-red-300 disabled:text-white", "dark:disabled:bg-red-950 dark:disabled:text-red-400"] } }, defaultVariants: { variant: "primary" } }), W = z.forwardRef(({ asChild: a, isLoading: t = !1, loadingText: r, className: n, disabled: s, variant: l, children: o, ...d }, p) => e(a ? Vt : "button", { ref: p, className: k(so({ variant: l }), n), disabled: s || t, ...d, children: t ? i("span", { className: "pointer-events-none flex shrink-0 items-center justify-center gap-1.5", children: [e(pi, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }), e("span", { className: "sr-only", children: r || "Loading" }), r || "Loading"] }) : o }));
|
|
@@ -461,7 +461,7 @@ const mo = ({ className: a, ...t }) => e("div", { className: k("flex flex-col-re
|
|
|
461
461
|
mo.displayName = "DialogFooter";
|
|
462
462
|
const yt = A.forwardRef(({ className: a, ...t }, r) => e(J, { ref: r, className: k("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", a), ...t }));
|
|
463
463
|
yt.displayName = J.displayName;
|
|
464
|
-
const
|
|
464
|
+
const fu = ({ children: a, ...t }) => e(gt, { ...t, children: e(ft, { className: "overflow-hidden p-0", children: e(yt, { 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: a }) }) }), Xt = A.forwardRef(({ className: a, ...t }, r) => i("div", { className: "flex items-center border-b pl-3", "cmdk-input-wrapper": "", children: [e(Jt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), e(J.Input, { ref: r, className: k("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", a), ...t })] }));
|
|
465
465
|
Xt.displayName = J.Input.displayName;
|
|
466
466
|
const Yt = A.forwardRef(({ className: a, ...t }, r) => e(J.List, { ref: r, className: k("max-h-[300px] overflow-y-auto overflow-x-hidden", a), ...t }));
|
|
467
467
|
Yt.displayName = J.List.displayName;
|
|
@@ -483,13 +483,13 @@ const ho = A.forwardRef((a, t) => e(U.Anchor, { ref: t, ...a }));
|
|
|
483
483
|
ho.displayName = "PopoverAnchor";
|
|
484
484
|
const go = A.forwardRef((a, t) => e(U.Close, { ref: t, ...a }));
|
|
485
485
|
go.displayName = "PopoverClose";
|
|
486
|
-
const Da = A.forwardRef(({ className: a, sideOffset: t = 10, side: r = "bottom", align: n = "center", collisionPadding: s, ...l }, o) => e(U.Portal, { children: e(U.Content, { ref: o, sideOffset: t, side: r, align: n, collisionPadding: s, avoidCollisions: !0, className:
|
|
486
|
+
const Da = A.forwardRef(({ className: a, sideOffset: t = 10, side: r = "bottom", align: n = "center", collisionPadding: s, ...l }, o) => e(U.Portal, { children: e(U.Content, { ref: o, sideOffset: t, side: r, align: n, collisionPadding: s, avoidCollisions: !0, className: aa("max-h-[var(--radix-popper-available-height)] min-w-60 overflow-hidden rounded-md border p-2.5 text-sm shadow-md", "border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[state=open]:data-[side=bottom]:animate-slideDownAndFade data-[state=open]:data-[side=left]:animate-slideLeftAndFade data-[state=open]:data-[side=right]:animate-slideRightAndFade data-[state=open]:data-[side=top]:animate-slideUpAndFade", a), onWheel: (d) => {
|
|
487
487
|
d.stopPropagation(), d.deltaY > 0 ? d.currentTarget.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowDown" })) : d.currentTarget.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowUp" }));
|
|
488
488
|
}, ...l }) }));
|
|
489
489
|
Da.displayName = "PopoverContent";
|
|
490
490
|
const fo = ({ value: a, onChange: t, disabled: r }) => {
|
|
491
491
|
const n = ze(), [s, l] = F(!1), o = Br.map((d) => d.items.find((p) => p.value === a)).filter(Boolean)[0];
|
|
492
|
-
return e("div", { className: "mt-2", children: i(Ea, { open: r ? !1 : s, onOpenChange: r ? void 0 : l, children: [e(za, { asChild: !0, children: i(W, { id: n, role: "combobox", disabled: r, "aria-expanded": s, variant: "secondary", className: "w-full justify-between shadow-2xs! bg-background px-3 py-2.5 font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20 disabled:opacity-50 disabled:cursor-not-allowed", children: [a ? i("span", { className: "flex min-w-0 items-center gap-2 mr-auto", children: [e("span", { className: "text-lg leading-none", children: o == null ? void 0 : o.flag }), e("span", { className: "truncate", children: o == null ? void 0 : o.label })] }) : e("span", { className: "text-muted-foreground", children: "Select country" }), e(
|
|
492
|
+
return e("div", { className: "mt-2", children: i(Ea, { open: r ? !1 : s, onOpenChange: r ? void 0 : l, children: [e(za, { asChild: !0, children: i(W, { id: n, role: "combobox", disabled: r, "aria-expanded": s, variant: "secondary", className: "w-full justify-between shadow-2xs! bg-background px-3 py-2.5 font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20 disabled:opacity-50 disabled:cursor-not-allowed", children: [a ? i("span", { className: "flex min-w-0 items-center gap-2 mr-auto", children: [e("span", { className: "text-lg leading-none", children: o == null ? void 0 : o.flag }), e("span", { className: "truncate", children: o == null ? void 0 : o.label })] }) : e("span", { className: "text-muted-foreground", children: "Select country" }), e(ta, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(Da, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50", align: "start", children: i(yt, { className: "p-0", children: [e(Xt, { className: "w-full border-none", style: { boxShadow: "none" }, placeholder: "Search country..." }), i(Yt, { children: [e(er, { children: "No country found." }), Br.map((d) => e(la, { children: e(ar, { heading: d.continent, children: d.items.map((p) => i(tr, { value: p.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => {
|
|
493
493
|
t(p.value ?? ""), l(!1);
|
|
494
494
|
}, children: [e("span", { className: "text-lg leading-none", children: p.flag }), " ", p.label, a === p.value && e(Aa, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, p.value)) }) }, d.continent))] })] }) })] }) });
|
|
495
495
|
}, yo = Te({ base: ["relative block w-full rounded-lg border px-2.5 py-2.5 shadow-2xs outline-hidden transition sm:text-sm", "border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "bg-white dark:bg-gray-950", "disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-700 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", Xi], variants: { hasError: { true: no }, enableStepper: { false: "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none" }, multiline: { true: "resize-y min-h-[100px]", false: "truncate appearance-none" } } }), Ee = z.forwardRef(({ className: a, inputClassName: t, hasError: r, enableStepper: n = !0, type: s, multiline: l = !1, prefix: o, suffix: d, ...p }, m) => {
|
|
@@ -555,12 +555,12 @@ const bo = ({ ...a }) => {
|
|
|
555
555
|
};
|
|
556
556
|
return X(() => {
|
|
557
557
|
l && u.current && u.current.focus();
|
|
558
|
-
}, [l]), i("div", { className: "mt-2 relative", children: [i(Ea, { open: l, onOpenChange: o, children: [e(za, { asChild: !0, children: i(W, { id: s, role: "combobox", "aria-expanded": l, variant: "secondary", className: "w-full shadow-2xs! bg-background px-2! py-1 min-h-[41.6px] font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20", onClick: () => o(!l), children: [a ? e("span", { className: "px-1 text-sm truncate mr-auto", children: a }) : e("span", { className: "px-1 text-sm text-gray-400 mr-auto", children: r }), e(
|
|
558
|
+
}, [l]), i("div", { className: "mt-2 relative", children: [i(Ea, { open: l, onOpenChange: o, children: [e(za, { asChild: !0, children: i(W, { id: s, role: "combobox", "aria-expanded": l, variant: "secondary", className: "w-full shadow-2xs! bg-background px-2! py-1 min-h-[41.6px] font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20", onClick: () => o(!l), children: [a ? e("span", { className: "px-1 text-sm truncate mr-auto", children: a }) : e("span", { className: "px-1 text-sm text-gray-400 mr-auto", children: r }), e(ta, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), i(Da, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: [i("div", { className: "flex items-center border-b px-3 py-2", children: [e(Jt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), e("input", { ref: u, placeholder: "Search places...", 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", value: d, onChange: (x) => {
|
|
559
559
|
p(x.target.value), x.target.value.length >= 2 && o(!0);
|
|
560
560
|
} })] }), i("div", { className: "max-h-[300px] overflow-y-auto", children: [w && i("div", { className: "py-6 text-center", children: [e(ds, { className: "h-4 w-4 animate-spin mx-auto" }), e("p", { className: "text-sm text-muted-foreground mt-2", children: "Searching places..." })] }), !w && d.length < 2 && e("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "Type at least 2 characters to search" }), !w && d.length >= 2 && b.length === 0 && e("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No places found" }), !w && d.length >= 2 && b.length > 0 && i("div", { className: "py-1", children: [i("div", { className: "px-2 py-1 text-xs text-muted-foreground", children: ["Found ", b.length, " results"] }), b.map((x, v) => i("div", { 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", onClick: () => y(x), children: [i("div", { className: "flex flex-col grow", children: [e("span", { children: x.addressLineOne || x.text }), x.addressLineTwo && e("span", { className: "text-xs text-muted-foreground", children: x.addressLineTwo })] }), (m == null ? void 0 : m.placeId) === x.placeId && e(Aa, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, `${x.placeId || "place"}-${v}`))] })] })] })] }), f && i("p", { className: "text-xs text-red-500 mt-1", children: ["Error fetching results: ", f.message] })] });
|
|
561
561
|
}, tn = Wr(({ ...a }, t) => e(Ee, { ...a, inputClassName: "border-l-0 rounded-l-none", ref: t, className: "" }));
|
|
562
562
|
tn.displayName = "PhoneInput";
|
|
563
|
-
const wo = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { className: "relative inline-flex items-center self-stretch rounded-s-lg border border-gray-200 dark:border-gray-800 bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-hidden focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-disabled:pointer-events-none has-disabled:opacity-50", children: [i("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [e(rn, { country: t, countryName: t, "aria-hidden": "true" }), e("span", { className: "text-muted-foreground/80", children: e(
|
|
563
|
+
const wo = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { className: "relative inline-flex items-center self-stretch rounded-s-lg border border-gray-200 dark:border-gray-800 bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-hidden focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-disabled:pointer-events-none has-disabled:opacity-50", children: [i("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [e(rn, { country: t, countryName: t, "aria-hidden": "true" }), e("span", { className: "text-muted-foreground/80", children: e(ta, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })] }), i("select", { disabled: a, value: t, onChange: (s) => {
|
|
564
564
|
r(s.target.value);
|
|
565
565
|
}, className: "absolute inset-0 text-sm opacity-0", "aria-label": "Select country", children: [e("option", { value: "", children: "Select a country" }, "default"), n.filter((s) => s.value).map((s, l) => i("option", { value: s.value, children: [s.label, " ", s.value && `+${dt.getCountryCallingCode(s.value)}`] }, s.value ?? `empty-${l}`))] })] }), rn = ({ country: a, countryName: t }) => {
|
|
566
566
|
const r = Ci[a];
|
|
@@ -586,19 +586,19 @@ const wo = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { cl
|
|
|
586
586
|
return g ? i("span", { className: "animate-fadeIn relative inline-flex cursor-default items-center rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-secondary-foreground transition-all hover:bg-background disabled:cursor-not-allowed disabled:opacity-50", children: [g.label, e(Ca, { size: 12, onClick: (b) => {
|
|
587
587
|
b.preventDefault(), m(u);
|
|
588
588
|
}, className: "cursor-pointer ml-1" })] }, u) : null;
|
|
589
|
-
}) : e("span", { className: "px-1 text-sm", children: (h = a.find((u) => u.value === t)) == null ? void 0 : h.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(
|
|
589
|
+
}) : e("span", { className: "px-1 text-sm", children: (h = a.find((u) => u.value === t)) == null ? void 0 : h.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(ta, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(Da, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: i(yt, { className: "p-0", children: [e(Xt, { className: "w-full border-none pl-0", style: { boxShadow: "none" }, placeholder: "Search..." }), i(Yt, { children: [e(er, { children: "No options found." }), e(ar, { children: a.map((u) => i(tr, { value: u.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => p(u.value), children: [u.label, (n ? t.includes(u.value) : t === u.value) && e(Aa, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, u.value)) })] })] }) })] }) });
|
|
590
590
|
}, No = Te({ slots: { root: ["group relative isolate inline-flex shrink-0 cursor-pointer items-center rounded-full p-0.5 shadow-inner outline-hidden ring-1 ring-inset transition-all", "bg-gray-200 dark:bg-gray-950", "ring-black/5 dark:ring-gray-800", "data-[state=checked]:bg-blue-600 dark:data-[state=checked]:bg-blue-600", "data-disabled:cursor-default", "data-disabled:data-[state=checked]:bg-blue-200", "data-disabled:data-[state=checked]:ring-gray-300", "dark:data-disabled:data-[state=checked]:ring-gray-900", "dark:data-disabled:data-[state=checked]:bg-blue-900", "data-disabled:data-[state=unchecked]:ring-gray-300", "data-disabled:data-[state=unchecked]:bg-gray-100", "dark:data-disabled:data-[state=unchecked]:ring-gray-700", "dark:data-disabled:data-[state=unchecked]:bg-gray-800", pa], thumb: ["pointer-events-none relative inline-block transform appearance-none rounded-full border-none shadow-lg outline-hidden transition-all duration-150 ease-in-out focus:border-none focus:outline-hidden focus:outline-transparent", "bg-white dark:bg-gray-50", "group-data-disabled:shadow-none", "group-data-disabled:bg-gray-50 dark:group-data-disabled:bg-gray-500"] }, variants: { size: { default: { root: "h-7 w-14", thumb: "h-4 w-4 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0" }, small: { root: "h-4 w-7", thumb: "h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0" } } }, defaultVariants: { size: "default" } }), nn = z.forwardRef(({ className: a, size: t, ...r }, n) => {
|
|
591
591
|
const { root: s, thumb: l } = No({ size: t });
|
|
592
592
|
return e(Ka.Root, { ref: n, className: k(s(), a), ...r, children: e(Ka.Thumb, { className: k(l()) }) });
|
|
593
593
|
});
|
|
594
594
|
nn.displayName = "Switch";
|
|
595
|
-
const sn = z.forwardRef(({ className: a, type: t, ...r }, n) => e("input", { type: t, className:
|
|
595
|
+
const sn = z.forwardRef(({ className: a, type: t, ...r }, n) => e("input", { type: t, className: aa("flex h-10 w-full rounded-md border border-gray-200 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-50 dark:placeholder:text-gray-500", a), ref: n, ...r }));
|
|
596
596
|
sn.displayName = "TextInput";
|
|
597
597
|
function ln({ className: a, ...t }) {
|
|
598
598
|
const r = ze();
|
|
599
599
|
return e(sn, { id: r, placeholder: "00:00", className: k(a, "mt-2"), ref: vs("99:99", { placeholder: "-", showMaskOnHover: !1 }), ...t });
|
|
600
600
|
}
|
|
601
|
-
const Se = A.forwardRef(({ className: a, disabled: t, ...r }, n) => e(Si.Root, { ref: n, className:
|
|
601
|
+
const Se = A.forwardRef(({ className: a, disabled: t, ...r }, n) => e(Si.Root, { ref: n, className: aa("text-sm leading-none font-medium", "text-gray-900 dark:text-gray-50", { "text-gray-400 dark:text-gray-600": t }, a), "aria-disabled": t, ...r }));
|
|
602
602
|
Se.displayName = "Label";
|
|
603
603
|
const Ao = ({ value: a, onChange: t, disabled: r }) => {
|
|
604
604
|
const n = () => {
|
|
@@ -696,11 +696,11 @@ const Bo = A.forwardRef(({ className: a, type: t = "button", label: r, action: n
|
|
|
696
696
|
};
|
|
697
697
|
}, [n, s, l]), e("span", { className: k("flex items-center gap-x-2 rounded-lg bg-gray-900 p-1 text-base font-medium text-gray-50 outline-hidden transition focus:z-10 sm:text-sm", "sm:last-of-type:-mr-1", a), children: i("button", { ref: d, type: t, onClick: n, disabled: l, className: k("flex items-center gap-x-2 rounded-md px-1 py-1 hover:bg-gray-800", "focus-visible:bg-gray-800 focus-visible:hover:bg-gray-800", "disabled:text-gray-500", pa), ...o, children: [e("span", { children: r }), e("span", { className: Eo, children: s.label ? s.label.toUpperCase() : s.shortcut.toUpperCase() })] }) })));
|
|
698
698
|
Bo.displayName = "CommandBar.Command";
|
|
699
|
-
const Bt = A.forwardRef(({ className: a, ...t }, r) => e(Zt.Root, { ref: r, className:
|
|
699
|
+
const Bt = A.forwardRef(({ className: a, ...t }, r) => e(Zt.Root, { ref: r, className: aa("grid gap-2", a), ...t }));
|
|
700
700
|
Bt.displayName = "RadioCardGroup";
|
|
701
|
-
const Mt = A.forwardRef(({ className: a, ...t }, r) => e("div", { className:
|
|
701
|
+
const Mt = A.forwardRef(({ className: a, ...t }, r) => e("div", { className: aa("relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-full border shadow-2xs outline-hidden", "border-gray-300 dark:border-gray-800", "bg-white dark:bg-gray-950", "group-data-[state=checked]:border-0 group-data-[state=checked]:border-transparent group-data-[state=checked]:bg-blue-600", "group-data-disabled:border", "group-data-disabled:border-gray-300 group-data-disabled:bg-gray-100 group-data-disabled:text-gray-400", "dark:group-data-disabled:border-gray-700 dark:group-data-disabled:bg-gray-800", pa, a), children: e(Zt.Indicator, { ref: r, className: "flex items-center justify-center", ...t, children: e("div", { className: aa("size size-1.5 shrink-0 rounded-full", "bg-white", "group-data-disabled:bg-gray-400 dark:group-data-disabled:bg-gray-500") }) }) }));
|
|
702
702
|
Mt.displayName = "RadioCardGroupIndicator";
|
|
703
|
-
const Pt = A.forwardRef(({ className: a, children: t, ...r }, n) => e(Zt.Item, { ref: n, className:
|
|
703
|
+
const Pt = A.forwardRef(({ className: a, children: t, ...r }, n) => e(Zt.Item, { ref: n, className: aa("group relative w-full rounded-lg border p-4 text-left shadow-2xs transition-all focus:outline-hidden", "bg-white dark:bg-gray-950", "border-gray-200 dark:border-gray-800", "data-[state=checked]:border-blue-600 dark:data-[state=checked]:border-blue-600", Xi, a), ...r, children: t }));
|
|
704
704
|
Pt.displayName = "RadioCardItem";
|
|
705
705
|
const Mo = Te({ base: k("inline-flex items-center gap-x-1 whitespace-nowrap rounded-sm px-1.5 py-0.5 text-xs font-semibold ring-1"), variants: { variant: { default: ["bg-blue-50 text-blue-800 ring-blue-500/30", "dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30"], neutral: ["bg-gray-50 text-gray-700 ring-gray-500/30", "dark:bg-gray-400/10 dark:text-gray-300 dark:ring-gray-400/20"], success: ["bg-emerald-50 text-emerald-800 ring-emerald-600/30", "dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/20"], error: ["bg-red-50 text-red-800 ring-red-600/20", "dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/20"], warning: ["bg-yellow-50 text-yellow-800 ring-yellow-600/30", "dark:bg-yellow-400/10 dark:text-yellow-500 dark:ring-yellow-400/20"] } }, defaultVariants: { variant: "default" } }), ka = z.forwardRef(({ className: a, variant: t, ...r }, n) => e("span", { ref: n, className: k(Mo({ variant: t }), a), ...r }));
|
|
706
706
|
ka.displayName = "Badge";
|
|
@@ -786,7 +786,7 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
786
786
|
}, l = async () => {
|
|
787
787
|
await r(), a.push("/account/sign-in");
|
|
788
788
|
};
|
|
789
|
-
return e("div", { className: "hidden md:block", children: i(Ea, { children: [e(za, { className: "flex items-center focus:outline-hidden group", children: n != null && n.user ? e("div", { className: "w-8 h-8 rounded-full overflow-hidden flex items-center justify-center bg-blue-500 text-white relative transition-transform duration-200 group-hover:scale-110 group-hover:ring-2 group-hover:ring-white/50 group-hover:ring-offset-1 group-hover:cursor-pointer", children: n.user.image ? e("img", { src: n.user.image, alt: n.user.name || "User", className: "w-full h-full object-cover" }) : e("span", { className: "font-medium text-sm", children: s() }) }) : i("div", { className: "flex items-center text-white group-hover:text-blue-300 transition-colors duration-200", children: [e($a, { className: "w-5 h-5 mr-1 group-hover:scale-110 transition-transform duration-200" }), e("span", { children: "Guest" })] }) }), e(Da, { className: "w-52 min-w-52 p-0 py-1 data-[state=open]:animate-slideDownAndFade z-50", align: "end", sideOffset: 5, forceMount: !0, children: n != null && n.user ? i(S, { children: [i(E, { href: "/account", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(cs, { className: "h-4 w-4" }), "My account"] }), i(E, { href: "/account/orders", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(oa, { className: "h-4 w-4" }), "Orders"] }), i(E, { href: "/account/reservations", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(
|
|
789
|
+
return e("div", { className: "hidden md:block", children: i(Ea, { children: [e(za, { className: "flex items-center focus:outline-hidden group", children: n != null && n.user ? e("div", { className: "w-8 h-8 rounded-full overflow-hidden flex items-center justify-center bg-blue-500 text-white relative transition-transform duration-200 group-hover:scale-110 group-hover:ring-2 group-hover:ring-white/50 group-hover:ring-offset-1 group-hover:cursor-pointer", children: n.user.image ? e("img", { src: n.user.image, alt: n.user.name || "User", className: "w-full h-full object-cover" }) : e("span", { className: "font-medium text-sm", children: s() }) }) : i("div", { className: "flex items-center text-white group-hover:text-blue-300 transition-colors duration-200", children: [e($a, { className: "w-5 h-5 mr-1 group-hover:scale-110 transition-transform duration-200" }), e("span", { children: "Guest" })] }) }), e(Da, { className: "w-52 min-w-52 p-0 py-1 data-[state=open]:animate-slideDownAndFade z-50", align: "end", sideOffset: 5, forceMount: !0, children: n != null && n.user ? i(S, { children: [i(E, { href: "/account", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(cs, { className: "h-4 w-4" }), "My account"] }), i(E, { href: "/account/orders", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(oa, { className: "h-4 w-4" }), "Orders"] }), i(E, { href: "/account/reservations", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(Ye, { className: "h-4 w-4" }), "Reservations"] }), i("button", { onClick: l, className: "flex w-full items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(ms, { className: "h-4 w-4" }), "Logout"] })] }) : i(E, { href: "/account/sign-in", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e($a, { className: "h-4 w-4" }), "Sign in"] }) })] }) });
|
|
790
790
|
}, Fa = ({ summary: a }) => {
|
|
791
791
|
const { organization: t, loading: r } = we(), [n, s] = F(!1);
|
|
792
792
|
if (r) return e(Zo, {});
|
|
@@ -797,7 +797,7 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
797
797
|
return X(() => {
|
|
798
798
|
if (!s && n) return r.push("/checkout/customer-details");
|
|
799
799
|
}, [n, s, r]), s ? e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900", children: e("div", { className: "mb-4", children: e("div", { className: "animate-spin rounded-full h-18 w-18 border-b-2 border-teal-500" }) }) }) : e(dn, { children: a });
|
|
800
|
-
},
|
|
800
|
+
}, $e = ({ children: a }) => {
|
|
801
801
|
const { useSession: t } = De(), r = G(), { data: n, isPending: s } = t();
|
|
802
802
|
return X(() => {
|
|
803
803
|
if (!s && !n) return r.push("/account/sign-in");
|
|
@@ -858,8 +858,8 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
858
858
|
if (!(s != null && s.user)) return null;
|
|
859
859
|
if (l.isLoading || o.isLoading) return e(nr, { title: "Your account" });
|
|
860
860
|
const d = ((u = l.data) == null ? void 0 : u.list) ?? [], p = ((g = o.data) == null ? void 0 : g.list) ?? [], m = [...p].filter((f) => !f.cancelledAt && !!f.date && new Date(f.date).getTime() > Date.now()).sort((f, w) => new Date(f.date ?? 0).getTime() - new Date(w.date ?? 0).getTime())[0], h = s.user.firstname ?? ((b = s.user.name) == null ? void 0 : b.split(" ").filter(Boolean)[0]) ?? "there";
|
|
861
|
-
return i(bt, { eyebrow: "My account", title: `Welcome back, ${h}`, description: "Track recent orders, revisit reservation history, and jump straight into the parts of your account you use most.", actions: i(S, { children: [e(W, { asChild: !0, variant: "secondary", children: e(E, { href: "/account/orders", children: "View orders" }) }), e(W, { asChild: !0, children: e(E, { href: "/account/reservations", children: "Reservation history" }) })] }), children: [i("div", { className: "grid gap-6 lg:grid-cols-[1.25fr_0.95fr]", children: [e(sa, { title: "Recent orders", description: "A quick look at what you ordered most recently.", action: e(at, { href: "/account/orders", label: "See all" }), children: l.isError ? e(je, { icon: oa, title: "Orders unavailable", description: "We couldn't load your recent orders just now. Please refresh and try again." }) : d.length === 0 ? e(je, { icon: oa, title: "Your order history will appear here", description: "Once you place an order, you'll be able to track its progress and reopen the details from this account page.", actionHref: "/", actionLabel: "Browse the menu" }) : e("div", { className: "space-y-4", children: d.map((f) => e(E, { href: `/account/orders/${f.id}`, className: "group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:border-teal-300 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Wo(f) }), e(et, { tone: mn(f.status), children: cn(f.status) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", f.referenceId, " • ", f.items.length, " item", f.items.length === 1 ? "" : "s", " •", " ", f.fulfilmentMethod === "delivery" ? "Delivery" : "Pickup"] })] }), i("div", { className: "text-left sm:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: ye(f.payment.total, f.currency) }), e("p", { className: "mt-1 text-sm text-stone-500", children: Le(f.createdAt, "Recently") })] })] }) }, f.id)) }) }), i("div", { className: "grid gap-6", children: [e(sa, { title: "Jump into your history", description: "The two most useful places for signed-in guests.", children: i("div", { className: "grid gap-4", children: [e(Qr, { href: "/account/orders", icon: oa, title: "Orders list", description: "Review every purchase, total paid, fulfilment method, and live order status." }), e(Qr, { href: "/account/reservations", icon:
|
|
862
|
-
}, fu = () => e(na, { children: e(_o, {}) }), Go = { common: { cart: "Cart", checkout: "Checkout", products: "Products", home: "Home", search: "Search", loading: "Loading...", add: "Add", remove: "Remove", close: "Close", back: "Back", next: "Next", continue: "Continue", submit: "Submit", cancel: "Cancel", apply: "Apply", save: "Save", aboutUs: "About Us", ourStory: "Our Story", menu: "Menu", reservations: "Reservations", orderOnline: "Order Online", checkOurMenu: "Check Our Menu", privacyPolicy: "Privacy Policy", termsAndConditions: "Terms and Conditions", orderNow: "Order Now", makeReservation: "Make a Reservation" }, product: { addToCart: "Add to cart", outOfStock: "Out of stock", quantity: "Quantity", price: "Price", total: "Total", description: "Description", options: "Options", modifiers: "Modifiers" }, checkout: { yourOrder: "Your Order", orderSummary: "Order Summary", delivery: "Delivery", address: "Address", payment: "Payment", confirmation: "Confirmation", deliveryDetails: "Delivery Details", paymentMethod: "Payment Method", placeOrder: "Place Order", subtotal: "Subtotal", total: "Total" }, ourStory: { title: "Our Story", subtitle: "From the shores of South India to the heart of Poland – authentic flavors, unforgettable experiences", by: "By", paragraph1: "When Madras Bistro opened its doors in 2018, it marked a historic moment as Poland's first authentic South Indian restaurant. Our journey began with a simple yet profound vision: to introduce the rich, vibrant flavors of South India to the Polish culinary landscape.", paragraph2: "Our founders, inspired by their deep roots in Tamil Nadu, embarked on this venture after noticing that while North Indian cuisine had found its place in Poland, the diverse and distinctive flavors of South India remained undiscovered territory. They dreamed of creating a space where the aromatic spices, coconut-infused curries, and delicate dosas of their homeland could be experienced in their authentic form.", paragraph3: "The path wasn't always easy. Sourcing traditional ingredients, perfecting recipes that stayed true to their South Indian origins while appealing to Polish palates, and educating diners about a cuisine so different from what they knew – these were challenges we embraced with passion. Our chefs, trained in the time-honored techniques of South Indian cooking, worked tirelessly to ensure every dish that left our kitchen carried the essence of the regions they represented.", paragraph4: "Today, Madras Bistro stands as a cultural bridge between Poland and South India. We take pride in having introduced countless Polish diners to the joy of breaking a crispy dosa, savoring the complex flavors of a well-prepared sambar, and experiencing the unique combination of spices that makes South Indian cuisine so distinctive.", paragraph5: "Our story continues to unfold with each meal we serve, as we remain committed to our founding vision: bringing the authentic taste of South India to Poland, one delicious dish at a time.", paragraph6: "I warmly invite you to join us on this culinary adventure and discover the distinctive tastes of South India – a cuisine still new to many in Poland but certain to delight your palate with its rich traditions and bold flavors.", signature: "- Chef Victor", description: "Learn about Madras Bistro's journey in Krakow, bringing authentic South Indian cuisine with passion and tradition. Discover our story and culinary roots!" }, menuSection: { title: "Discover our menu", description: "Our menu is a collection of the most popular dishes from south india." }, orderOnline: { title: "Order Online", description: "Craving South Indian food? Order online from Madras Bistro in Krakow for delicious dosas, curries, and more. Fast, fresh, and authentic, delivered to you!" }, hero: { title: "Discover South Indian Cuisine that's Beyond Delicious", subtitle: "Embark on a flavorful journey rich in tradition and vibrant spices." }, introSection: { title: "Madras Bistro: Five Regions, One Extraordinary Table", paragraph1: "Step into a world where spices whisper ancient secrets and aromas tell tales of distant shores. At Madras Bistro, the diverse culinary heritage of South India comes alive on your plate—a gastronomic tapestry woven from the traditions of Tamil Nadu, Kerala, Andhra Pradesh, Karnataka, and Sri Lanka. Our kitchen celebrates this rich mosaic of regional cuisines, where coastal treasures meet inland specialties in a harmonious expression of flavor.", paragraph2: "In this tropical paradise, the climate nurtures abundant coconut groves and rice fields, giving birth to a culinary tradition that celebrates fresh ingredients and complex flavors. Unlike the heavy, cream-based dishes familiar to many, South Indian cuisine is a delicate dance of spices, featuring iconic dishes like crispy dosas, soft idlis, and tangy sambars that speak to centuries of culinary innovation. Each bite tells a story of coastal markets, family traditions, and a deep connection to the land." }, reservationSection: { title: "Reserve Your Table", description: "Experience authentic South Indian cuisine in a warm, inviting atmosphere. Make a reservation for a memorable dining experience." }, testimonialsSection: { title: "Google Reviews", description: "See what our customers are saying about us", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "A bistro worth visiting for fans of Indian flavors. They serve Indian cuisine and from the north of Sri Lanka. I ate delicious milk chicken with aromatic jeera rice. The bistro is small (3 tables) and modest, but you can listen to Indian music hits." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "My husband and I chanced upon this restaurant last Thursday whilst on a short break to Krakow from the UK. This small eatery with just 2 or 3 tables is run by the very friendly and obliging owner/chef and is conveniently located facing Ghetto Heroes Square. The Masala Uttapam, Masala Dosa, Kerala Chicken Curry, Chicken Roast and Masala Chai that we had were absolutely delicious. I highly recommend this restaurant to any lovers of South Indian food." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutely mouthwatering food! The owner (also the chef) is extremely passionate about the customers experience, and you can feel his expertise in every bite. Highly recommend the ghee dosa (he made it extra crispy for us on request). It tastes like home, is SO authentic. The only downside is that I'll miss the food terribly when I leave Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "If you're looking for a place that serves real Malabar food, this is definitely the spot. Highly recommended for anyone craving a taste of home!" }] }, orderTracking: { orderPlaced: "Order Placed", orderPlacedDesc: "Your order has been received and is waiting to be accepted", orderAccepted: "Order Accepted", orderAcceptedDesc: "Your order has been accepted and is being processed", readyForDispatch: "Ready for Dispatch", readyForDispatchDesc: "Your order is packed and ready to be shipped", orderDispatched: "Order Dispatched", orderDispatchedDesc: "Your order is on its way to you", orderDelivered: "Order Delivered", orderDeliveredDesc: "Your order has been delivered", orderCancelled: "Order Cancelled", orderCancelledDesc: "Your order has been cancelled", price: "Price", quantity: "Quantity", subtotal: "Subtotal", total: "Total", poweredBy: "Powered by", reference: "Reference", status: "Status" }, reservation: { reservationDetails: "Reservation Details", name: "Name", phone: "Phone", guests: "Guests", date: "Date", reference: "Reference", status: "Status", notSpecified: "Not specified", invalidDate: "Invalid date", requestSent: "Reservation Request Sent", requestSentDesc: "Your reservation request has been received and is waiting to be confirmed by the restaurant", confirmed: "Reservation Confirmed", confirmedDesc: "Your reservation has been confirmed", cancelled: "Reservation Cancelled", cancelledDesc: "Your reservation has been cancelled", pendingStatus: "Pending", confirmedStatus: "Confirmed", cancelledStatus: "Cancelled", poweredBy: "Powered by" }, homepage: { description: "Discover Madras Bistro, Krakow's first South Indian restaurant. Savor authentic flavors, vibrant spices, and traditional dishes in a cozy setting. Visit us today!" }, menu: { description: "Explore the Madras Bistro menu featuring authentic South Indian dishes like dosas, curries, and biryanis. Fresh ingredients, bold flavors in Krakow!" }, privacyPolicy: { description: "Read Madras Bistro's Privacy Policy to understand how we protect your data and ensure a secure experience while enjoying our South Indian cuisine in Krakow." }, termsAndConditions: { description: "Review the Terms and Conditions for using Madras Bistro's website and services in Krakow. Learn about our policies for online orders and dining." } }, $o = { common: { cart: "Koszyk", checkout: "Zamówienie", products: "Produkty", home: "Strona główna", search: "Szukaj", loading: "Ładowanie...", add: "Dodaj", remove: "Usuń", close: "Zamknij", back: "Wstecz", next: "Dalej", continue: "Kontynuuj", submit: "Wyślij", cancel: "Anuluj", apply: "Zastosuj", save: "Zapisz", aboutUs: "O nas", ourStory: "O Nas", menu: "Menu", reservations: "Rezerwacje", orderOnline: "Zamów online", checkOurMenu: "Sprawdź nasze menu", privacyPolicy: "Polityka prywatności", termsAndConditions: "Warunki korzystania", orderNow: "Zamów teraz", makeReservation: "Zarezerwuj stolik" }, product: { addToCart: "Dodaj do koszyka", outOfStock: "Brak w magazynie", quantity: "Ilość", price: "Cena", total: "Razem", description: "Opis", options: "Opcje", modifiers: "Modyfikatory" }, checkout: { yourOrder: "Twoje zamówienie", orderSummary: "Podsumowanie zamówienia", delivery: "Dostawa", address: "Adres", payment: "Płatność", confirmation: "Potwierdzenie", deliveryDetails: "Szczegóły dostawy", paymentMethod: "Metoda płatności", placeOrder: "Złóż zamówienie", subtotal: "Suma częściowa", total: "Razem" }, ourStory: { title: "Nasza historia", subtitle: "Z wybrzeży Południowych Indii do serca Polski – autentyczne smaki, niezapomniane doświadczenia", by: "Autor", paragraph1: "Kiedy Madras Bistro otworzyło swoje drzwi w 2018 roku, był to historyczny moment jako pierwsza autentyczna restauracja południowoindyjska w Polsce. Nasza podróż rozpoczęła się od prostej, ale głębokiej wizji: wprowadzenia bogatych, żywych smaków Południowych Indii do polskiego krajobrazu kulinarnego.", paragraph2: "Nasi założyciele, zainspirowani swoimi głębokimi korzeniami w Tamil Nadu, rozpoczęli tę przygodę po zauważeniu, że podczas gdy kuchnia północnoindyjska znalazła swoje miejsce w Polsce, różnorodne i charakterystyczne smaki Południowych Indii pozostały nieodkrytym terytorium. Marzyli o stworzeniu miejsca, gdzie aromatyczne przyprawy, curry nasycone kokosem i delikatne dosa z ich ojczyzny mogłyby być doświadczane w autentycznej formie.", paragraph3: "Droga nie zawsze była łatwa. Pozyskiwanie tradycyjnych składników, doskonalenie przepisów, które pozostały wierne południowoindyjskim korzeniom, a jednocześnie trafiały w gusta polskich podniebień, oraz edukowanie gości o kuchni tak różnej od tego, co znali – to były wyzwania, które przyjęliśmy z pasją. Nasi szefowie kuchni, wyszkoleni w tradycyjnych technikach gotowania południowoindyjskiego, pracowali niestrudzenie, aby zapewnić, że każde danie opuszczające naszą kuchnię niosło w sobie esencję regionów, które reprezentowali.", paragraph4: "Dziś Madras Bistro stoi jako kulturowy most między Polską a Południowymi Indiami. Jesteśmy dumni z tego, że wprowadziliśmy niezliczonych polskich gości w radość przełamywania chrupiącej dosy, smakowania złożonych smaków dobrze przygotowanego sambaru i doświadczania unikalnej kombinacji przypraw, która sprawia, że kuchnia południowoindyjska jest tak wyjątkowa.", paragraph5: "Nasza historia nadal rozwija się z każdym posiłkiem, który serwujemy, ponieważ pozostajemy wierni naszej wizji założycielskiej: przywiezienia autentycznego smaku Południowych Indii do Polski, jedno pyszne danie na raz.", paragraph6: "Serdecznie zapraszam do przyłączenia się do tej kulinarnej przygody i odkrycia charakterystycznych smaków Południowych Indii – kuchni nadal nowej dla wielu w Polsce, ale z pewnością zachwycającej podniebienie bogatymi tradycjami i wyrazistymi smakami.", signature: "- Szef kuchni Victor", description: "Poznaj historię Madras Bistro w Krakowie, które wprowadza autentyczną kuchnię południowoindyjską z pasją i tradycją. Odkryj naszą historię i kulinarne korzenie!" }, menuSection: { title: "Odkryj nasze menu", description: "Nasze menu to kolekcja najpopularniejszych dań z południowych Indii." }, orderOnline: { title: "Zamów online", description: "Masz ochotę na południowoindyjskie jedzenie? Zamów online z Madras Bistro w Krakowie pyszne dosa, curry i więcej. Szybkie, świeże i autentyczne, dostarczone prosto do Ciebie!" }, hero: { title: "Odkryj przepyszną południowo indyjską kuchnie", subtitle: "Wyrusz w pełną smaków podróż bogatą w tradycję i wyraziste przyprawy." }, introSection: { title: "Madras Bistro: Pięć regionów, jeden wyjątkowy stół", paragraph1: "Wejdź do świata, gdzie przyprawy szepczą dawne sekrety, a aromaty opowiadają historie z dalekich brzegów. W Madras Bistro różnorodne dziedzictwo kulinarne Południowych Indii ożywa na Twoim talerzu — gastronomiczna tkanina utkana z tradycji Tamil Nadu, Kerali, Andhra Pradesh, Karnataki i Sri Lanki. Nasza kuchnia celebruje tę bogatą mozaikę regionalnych kuchni, gdzie nadmorskie skarby spotykają się z wewnątrznymi specjałami w harmonijnym wyrażeniu smaku.", paragraph2: "W tym tropikalnym raju klimat sprzyja obfitym palmom kokosowym i polom ryżowym, dając początek tradycji kulinarnej, która celebruje świeże składniki i złożone smaki. W przeciwieństwie do ciężkich, kremowych dań znanych wielu osobom, kuchnia południowoindyjska to delikatny taniec przypraw, z takimi ikonicznymi daniami jak chrupiące dosy, miękkie idli i pikantne sambary, które mówią o wiekach kulinarnych innowacji. Każdy kęs opowiada historię nadmorskich targów, rodzinnych tradycji i głębokiego związku z ziemią." }, reservationSection: { title: "Zarezerwuj stolik", description: "Doświadcz autentycznej kuchni południowoindyjskiej w ciepłej, przyjaznej atmosferze. Dokonaj rezerwacji na niezapomniane doświadczenie kulinarne." }, testimonialsSection: { title: "Opinie Google", description: "Zobacz, co mówią o nas nasi klienci", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "Bistro warte odwiedzenia dla fanów indyjskich smaków. Serwują kuchnię indyjską i z północy Sri Lanki. Zjadłem pysznego kurczaka w mleku z aromatycznym ryżem jeera. Bistro jest małe (3 stoliki) i skromne, ale można posłuchać indyjskich hitów muzycznych." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "Ja i mój mąż przypadkowo trafiliśmy do tej restauracji w zeszły czwartek podczas krótkiego pobytu w Krakowie z Wielkiej Brytanii. Ta mała jadłodajnia z zaledwie 2 lub 3 stolikami jest prowadzona przez bardzo przyjaznego i uczynnego właściciela/szefa kuchni i jest dogodnie zlokalizowana naprzeciwko Placu Bohaterów Getta. Masala Uttapam, Masala Dosa, Curry z Kurczakiem Kerala, Kurczak Pieczony i Masala Chai, które jedliśmy, były absolutnie pyszne. Gorąco polecam tę restaurację wszystkim miłośnikom południowo-indyjskiej kuchni." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutnie pyszne jedzenie! Właściciel (również szef kuchni) jest niezwykle zaangażowany w doświadczenia klientów i można poczuć jego doświadczenie w każdym kęsie. Gorąco polecam ghee dosa (zrobił je dla nas ekstra chrupiące na prośbę). Smakuje jak w domu, jest BARDZO autentyczne. Jedynym minusem jest to, że będę tęsknić za tym jedzeniem, gdy opuszczę Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "Jeśli szukasz miejsca, które serwuje prawdziwe jedzenie Malabar, to zdecydowanie jest to odpowiednie miejsce. Gorąco polecane dla każdego, kto tęskni za smakiem domu!" }] }, orderTracking: { orderPlaced: "Zamówienie złożone", orderPlacedDesc: "Twoje zamówienie zostało odebrane i czeka na akceptację", orderAccepted: "Zamówienie zaakceptowane", orderAcceptedDesc: "Twoje zamówienie zostało zaakceptowane i jest przetwarzane", readyForDispatch: "Gotowe do wysyłki", readyForDispatchDesc: "Twoje zamówienie jest spakowane i gotowe do wysyłki", orderDispatched: "Zamówienie wysłane", orderDispatchedDesc: "Twoje zamówienie jest w drodze do Ciebie", orderDelivered: "Zamówienie dostarczone", orderDeliveredDesc: "Twoje zamówienie zostało dostarczone", orderCancelled: "Zamówienie anulowane", orderCancelledDesc: "Twoje zamówienie zostało anulowane", price: "Cena", quantity: "Ilość", subtotal: "Suma częściowa", total: "Razem", poweredBy: "Wspierane przez", reference: "Numer referencyjny", status: "Status" }, reservation: { reservationDetails: "Szczegóły rezerwacji", name: "Imię i nazwisko", phone: "Telefon", guests: "Liczba gości", date: "Data", reference: "Numer referencyjny", status: "Status", notSpecified: "Nie określono", invalidDate: "Nieprawidłowa data", requestSent: "Prośba o rezerwację wysłana", requestSentDesc: "Twoja prośba o rezerwację została odebrana i czeka na potwierdzenie przez restaurację", confirmed: "Rezerwacja potwierdzona", confirmedDesc: "Twoja rezerwacja została potwierdzona", cancelled: "Rezerwacja anulowana", cancelledDesc: "Twoja rezerwacja została anulowana", pendingStatus: "Oczekujące", confirmedStatus: "Potwierdzone", cancelledStatus: "Anulowane", poweredBy: "Wspierane przez" }, homepage: { description: "Odkryj Madras Bistro, pierwszą restaurację południowoindyjską w Krakowie. Skosztuj autentycznych smaków, żywych przypraw i tradycyjnych dań w przytulnym otoczeniu. Odwiedź nas już dziś!" }, menu: { description: "Zapoznaj się z menu Madras Bistro oferującym autentyczne południowoindyjskie dania jak dosa, curry i biryani. Świeże składniki, wyraziste smaki w Krakowie!" }, privacyPolicy: { description: "Przeczytaj Politykę Prywatności Madras Bistro, aby zrozumieć, jak chronimy Twoje dane i zapewniamy bezpieczne doświadczenie podczas delektowania się naszą południowoindyjską kuchnią w Krakowie." }, termsAndConditions: { description: "Zapoznaj się z Warunkami korzystania ze strony internetowej i usług Madras Bistro w Krakowie. Dowiedz się o naszych zasadach dotyczących zamówień online i dań w restauracji." } }, Tr = { en: Go, pl: $o }, hn = Ne(void 0), Ko = ({ children: a, locale: t }) => {
|
|
861
|
+
return i(bt, { eyebrow: "My account", title: `Welcome back, ${h}`, description: "Track recent orders, revisit reservation history, and jump straight into the parts of your account you use most.", actions: i(S, { children: [e(W, { asChild: !0, variant: "secondary", children: e(E, { href: "/account/orders", children: "View orders" }) }), e(W, { asChild: !0, children: e(E, { href: "/account/reservations", children: "Reservation history" }) })] }), children: [i("div", { className: "grid gap-6 lg:grid-cols-[1.25fr_0.95fr]", children: [e(sa, { title: "Recent orders", description: "A quick look at what you ordered most recently.", action: e(at, { href: "/account/orders", label: "See all" }), children: l.isError ? e(je, { icon: oa, title: "Orders unavailable", description: "We couldn't load your recent orders just now. Please refresh and try again." }) : d.length === 0 ? e(je, { icon: oa, title: "Your order history will appear here", description: "Once you place an order, you'll be able to track its progress and reopen the details from this account page.", actionHref: "/", actionLabel: "Browse the menu" }) : e("div", { className: "space-y-4", children: d.map((f) => e(E, { href: `/account/orders/${f.id}`, className: "group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:border-teal-300 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Wo(f) }), e(et, { tone: mn(f.status), children: cn(f.status) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", f.referenceId, " • ", f.items.length, " item", f.items.length === 1 ? "" : "s", " •", " ", f.fulfilmentMethod === "delivery" ? "Delivery" : "Pickup"] })] }), i("div", { className: "text-left sm:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: ye(f.payment.total, f.currency) }), e("p", { className: "mt-1 text-sm text-stone-500", children: Le(f.createdAt, "Recently") })] })] }) }, f.id)) }) }), i("div", { className: "grid gap-6", children: [e(sa, { title: "Jump into your history", description: "The two most useful places for signed-in guests.", children: i("div", { className: "grid gap-4", children: [e(Qr, { href: "/account/orders", icon: oa, title: "Orders list", description: "Review every purchase, total paid, fulfilment method, and live order status." }), e(Qr, { href: "/account/reservations", icon: Ye, title: "Reservation history", description: "See confirmed, pending, and cancelled bookings in one place." })] }) }), e(sa, { title: "Profile snapshot", description: "A quick summary of the details tied to this account.", children: i("div", { className: "rounded-[24px] border border-stone-200 bg-white p-5", children: [i("div", { className: "flex items-center gap-4", children: [e("div", { className: "flex h-14 w-14 items-center justify-center rounded-2xl bg-stone-900 text-lg font-black text-white", children: qo(s.user.name) }), i("div", { children: [e("p", { className: "font-red-hat-display text-lg font-black text-stone-950", children: s.user.name }), e("p", { className: "text-sm text-stone-500", children: s.user.email })] })] }), i("div", { className: "mt-5 grid gap-3 rounded-[20px] bg-stone-50 p-4 text-sm text-stone-600", children: [i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e($a, { className: "h-4 w-4" }), "First name"] }), e("span", { className: "font-semibold text-stone-900", children: s.user.firstname })] }), i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e($a, { className: "h-4 w-4" }), "Last name"] }), e("span", { className: "font-semibold text-stone-900", children: s.user.lastname })] }), i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e(Ye, { className: "h-4 w-4" }), "Upcoming reservation"] }), e("span", { className: "font-semibold text-stone-900", children: m ? Le(m.date, "Not scheduled", "MMM d, yyyy") : "Nothing booked" })] })] }), e("div", { className: "mt-5", children: e(W, { asChild: !0, variant: "secondary", children: e(E, { href: "/account/reservations/book", children: "Book a table" }) }) })] }) })] })] }), e("div", { className: "mt-6", children: e(sa, { title: "Reservation activity", description: "Your most recent table bookings and their current status.", action: i("div", { className: "flex flex-wrap gap-3", children: [e(W, { asChild: !0, variant: "secondary", children: e(E, { href: "/account/reservations/book", children: "Book a table" }) }), e(at, { href: "/account/reservations", label: "Open history" })] }), children: o.isError ? e(je, { icon: Ye, title: "Reservations unavailable", description: "We couldn't load your reservation history just now. Please refresh and try again." }) : p.length === 0 ? e(je, { icon: Ye, title: "No reservations yet", description: "When you reserve a table, the details and status updates will show up here.", actionHref: "/account/reservations/book", actionLabel: "Book a table" }) : e("div", { className: "grid gap-4 md:grid-cols-2", children: p.map((f) => e(E, { href: `/account/reservations/${f.id}`, className: "group rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:border-teal-300 hover:shadow-lg", children: i("div", { className: "flex items-start justify-between gap-3", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Le(f.date, "Date pending", "MMM d, yyyy") }), e(et, { tone: pn(f), children: un(f) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", f.referenceId, " • ", f.guests, " ", "guest", f.guests === 1 ? "" : "s"] })] }), e("p", { className: "text-sm font-medium text-stone-500", children: Le(f.date, "Awaiting confirmation", "h:mm a") })] }) }, f.id)) }) }) })] });
|
|
862
|
+
}, Go = () => e($e, { children: e(_o, {}) }), $o = { common: { cart: "Cart", checkout: "Checkout", products: "Products", home: "Home", search: "Search", loading: "Loading...", add: "Add", remove: "Remove", close: "Close", back: "Back", next: "Next", continue: "Continue", submit: "Submit", cancel: "Cancel", apply: "Apply", save: "Save", aboutUs: "About Us", ourStory: "Our Story", menu: "Menu", reservations: "Reservations", orderOnline: "Order Online", checkOurMenu: "Check Our Menu", privacyPolicy: "Privacy Policy", termsAndConditions: "Terms and Conditions", orderNow: "Order Now", makeReservation: "Make a Reservation" }, product: { addToCart: "Add to cart", outOfStock: "Out of stock", quantity: "Quantity", price: "Price", total: "Total", description: "Description", options: "Options", modifiers: "Modifiers" }, checkout: { yourOrder: "Your Order", orderSummary: "Order Summary", delivery: "Delivery", address: "Address", payment: "Payment", confirmation: "Confirmation", deliveryDetails: "Delivery Details", paymentMethod: "Payment Method", placeOrder: "Place Order", subtotal: "Subtotal", total: "Total" }, ourStory: { title: "Our Story", subtitle: "From the shores of South India to the heart of Poland – authentic flavors, unforgettable experiences", by: "By", paragraph1: "When Madras Bistro opened its doors in 2018, it marked a historic moment as Poland's first authentic South Indian restaurant. Our journey began with a simple yet profound vision: to introduce the rich, vibrant flavors of South India to the Polish culinary landscape.", paragraph2: "Our founders, inspired by their deep roots in Tamil Nadu, embarked on this venture after noticing that while North Indian cuisine had found its place in Poland, the diverse and distinctive flavors of South India remained undiscovered territory. They dreamed of creating a space where the aromatic spices, coconut-infused curries, and delicate dosas of their homeland could be experienced in their authentic form.", paragraph3: "The path wasn't always easy. Sourcing traditional ingredients, perfecting recipes that stayed true to their South Indian origins while appealing to Polish palates, and educating diners about a cuisine so different from what they knew – these were challenges we embraced with passion. Our chefs, trained in the time-honored techniques of South Indian cooking, worked tirelessly to ensure every dish that left our kitchen carried the essence of the regions they represented.", paragraph4: "Today, Madras Bistro stands as a cultural bridge between Poland and South India. We take pride in having introduced countless Polish diners to the joy of breaking a crispy dosa, savoring the complex flavors of a well-prepared sambar, and experiencing the unique combination of spices that makes South Indian cuisine so distinctive.", paragraph5: "Our story continues to unfold with each meal we serve, as we remain committed to our founding vision: bringing the authentic taste of South India to Poland, one delicious dish at a time.", paragraph6: "I warmly invite you to join us on this culinary adventure and discover the distinctive tastes of South India – a cuisine still new to many in Poland but certain to delight your palate with its rich traditions and bold flavors.", signature: "- Chef Victor", description: "Learn about Madras Bistro's journey in Krakow, bringing authentic South Indian cuisine with passion and tradition. Discover our story and culinary roots!" }, menuSection: { title: "Discover our menu", description: "Our menu is a collection of the most popular dishes from south india." }, orderOnline: { title: "Order Online", description: "Craving South Indian food? Order online from Madras Bistro in Krakow for delicious dosas, curries, and more. Fast, fresh, and authentic, delivered to you!" }, hero: { title: "Discover South Indian Cuisine that's Beyond Delicious", subtitle: "Embark on a flavorful journey rich in tradition and vibrant spices." }, introSection: { title: "Madras Bistro: Five Regions, One Extraordinary Table", paragraph1: "Step into a world where spices whisper ancient secrets and aromas tell tales of distant shores. At Madras Bistro, the diverse culinary heritage of South India comes alive on your plate—a gastronomic tapestry woven from the traditions of Tamil Nadu, Kerala, Andhra Pradesh, Karnataka, and Sri Lanka. Our kitchen celebrates this rich mosaic of regional cuisines, where coastal treasures meet inland specialties in a harmonious expression of flavor.", paragraph2: "In this tropical paradise, the climate nurtures abundant coconut groves and rice fields, giving birth to a culinary tradition that celebrates fresh ingredients and complex flavors. Unlike the heavy, cream-based dishes familiar to many, South Indian cuisine is a delicate dance of spices, featuring iconic dishes like crispy dosas, soft idlis, and tangy sambars that speak to centuries of culinary innovation. Each bite tells a story of coastal markets, family traditions, and a deep connection to the land." }, reservationSection: { title: "Reserve Your Table", description: "Experience authentic South Indian cuisine in a warm, inviting atmosphere. Make a reservation for a memorable dining experience." }, testimonialsSection: { title: "Google Reviews", description: "See what our customers are saying about us", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "A bistro worth visiting for fans of Indian flavors. They serve Indian cuisine and from the north of Sri Lanka. I ate delicious milk chicken with aromatic jeera rice. The bistro is small (3 tables) and modest, but you can listen to Indian music hits." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "My husband and I chanced upon this restaurant last Thursday whilst on a short break to Krakow from the UK. This small eatery with just 2 or 3 tables is run by the very friendly and obliging owner/chef and is conveniently located facing Ghetto Heroes Square. The Masala Uttapam, Masala Dosa, Kerala Chicken Curry, Chicken Roast and Masala Chai that we had were absolutely delicious. I highly recommend this restaurant to any lovers of South Indian food." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutely mouthwatering food! The owner (also the chef) is extremely passionate about the customers experience, and you can feel his expertise in every bite. Highly recommend the ghee dosa (he made it extra crispy for us on request). It tastes like home, is SO authentic. The only downside is that I'll miss the food terribly when I leave Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "If you're looking for a place that serves real Malabar food, this is definitely the spot. Highly recommended for anyone craving a taste of home!" }] }, orderTracking: { orderPlaced: "Order Placed", orderPlacedDesc: "Your order has been received and is waiting to be accepted", orderAccepted: "Order Accepted", orderAcceptedDesc: "Your order has been accepted and is being processed", readyForDispatch: "Ready for Dispatch", readyForDispatchDesc: "Your order is packed and ready to be shipped", orderDispatched: "Order Dispatched", orderDispatchedDesc: "Your order is on its way to you", orderDelivered: "Order Delivered", orderDeliveredDesc: "Your order has been delivered", orderCancelled: "Order Cancelled", orderCancelledDesc: "Your order has been cancelled", price: "Price", quantity: "Quantity", subtotal: "Subtotal", total: "Total", poweredBy: "Powered by", reference: "Reference", status: "Status" }, reservation: { reservationDetails: "Reservation Details", name: "Name", phone: "Phone", guests: "Guests", date: "Date", reference: "Reference", status: "Status", notSpecified: "Not specified", invalidDate: "Invalid date", requestSent: "Reservation Request Sent", requestSentDesc: "Your reservation request has been received and is waiting to be confirmed by the restaurant", confirmed: "Reservation Confirmed", confirmedDesc: "Your reservation has been confirmed", cancelled: "Reservation Cancelled", cancelledDesc: "Your reservation has been cancelled", pendingStatus: "Pending", confirmedStatus: "Confirmed", cancelledStatus: "Cancelled", poweredBy: "Powered by" }, homepage: { description: "Discover Madras Bistro, Krakow's first South Indian restaurant. Savor authentic flavors, vibrant spices, and traditional dishes in a cozy setting. Visit us today!" }, menu: { description: "Explore the Madras Bistro menu featuring authentic South Indian dishes like dosas, curries, and biryanis. Fresh ingredients, bold flavors in Krakow!" }, privacyPolicy: { description: "Read Madras Bistro's Privacy Policy to understand how we protect your data and ensure a secure experience while enjoying our South Indian cuisine in Krakow." }, termsAndConditions: { description: "Review the Terms and Conditions for using Madras Bistro's website and services in Krakow. Learn about our policies for online orders and dining." } }, Ko = { common: { cart: "Koszyk", checkout: "Zamówienie", products: "Produkty", home: "Strona główna", search: "Szukaj", loading: "Ładowanie...", add: "Dodaj", remove: "Usuń", close: "Zamknij", back: "Wstecz", next: "Dalej", continue: "Kontynuuj", submit: "Wyślij", cancel: "Anuluj", apply: "Zastosuj", save: "Zapisz", aboutUs: "O nas", ourStory: "O Nas", menu: "Menu", reservations: "Rezerwacje", orderOnline: "Zamów online", checkOurMenu: "Sprawdź nasze menu", privacyPolicy: "Polityka prywatności", termsAndConditions: "Warunki korzystania", orderNow: "Zamów teraz", makeReservation: "Zarezerwuj stolik" }, product: { addToCart: "Dodaj do koszyka", outOfStock: "Brak w magazynie", quantity: "Ilość", price: "Cena", total: "Razem", description: "Opis", options: "Opcje", modifiers: "Modyfikatory" }, checkout: { yourOrder: "Twoje zamówienie", orderSummary: "Podsumowanie zamówienia", delivery: "Dostawa", address: "Adres", payment: "Płatność", confirmation: "Potwierdzenie", deliveryDetails: "Szczegóły dostawy", paymentMethod: "Metoda płatności", placeOrder: "Złóż zamówienie", subtotal: "Suma częściowa", total: "Razem" }, ourStory: { title: "Nasza historia", subtitle: "Z wybrzeży Południowych Indii do serca Polski – autentyczne smaki, niezapomniane doświadczenia", by: "Autor", paragraph1: "Kiedy Madras Bistro otworzyło swoje drzwi w 2018 roku, był to historyczny moment jako pierwsza autentyczna restauracja południowoindyjska w Polsce. Nasza podróż rozpoczęła się od prostej, ale głębokiej wizji: wprowadzenia bogatych, żywych smaków Południowych Indii do polskiego krajobrazu kulinarnego.", paragraph2: "Nasi założyciele, zainspirowani swoimi głębokimi korzeniami w Tamil Nadu, rozpoczęli tę przygodę po zauważeniu, że podczas gdy kuchnia północnoindyjska znalazła swoje miejsce w Polsce, różnorodne i charakterystyczne smaki Południowych Indii pozostały nieodkrytym terytorium. Marzyli o stworzeniu miejsca, gdzie aromatyczne przyprawy, curry nasycone kokosem i delikatne dosa z ich ojczyzny mogłyby być doświadczane w autentycznej formie.", paragraph3: "Droga nie zawsze była łatwa. Pozyskiwanie tradycyjnych składników, doskonalenie przepisów, które pozostały wierne południowoindyjskim korzeniom, a jednocześnie trafiały w gusta polskich podniebień, oraz edukowanie gości o kuchni tak różnej od tego, co znali – to były wyzwania, które przyjęliśmy z pasją. Nasi szefowie kuchni, wyszkoleni w tradycyjnych technikach gotowania południowoindyjskiego, pracowali niestrudzenie, aby zapewnić, że każde danie opuszczające naszą kuchnię niosło w sobie esencję regionów, które reprezentowali.", paragraph4: "Dziś Madras Bistro stoi jako kulturowy most między Polską a Południowymi Indiami. Jesteśmy dumni z tego, że wprowadziliśmy niezliczonych polskich gości w radość przełamywania chrupiącej dosy, smakowania złożonych smaków dobrze przygotowanego sambaru i doświadczania unikalnej kombinacji przypraw, która sprawia, że kuchnia południowoindyjska jest tak wyjątkowa.", paragraph5: "Nasza historia nadal rozwija się z każdym posiłkiem, który serwujemy, ponieważ pozostajemy wierni naszej wizji założycielskiej: przywiezienia autentycznego smaku Południowych Indii do Polski, jedno pyszne danie na raz.", paragraph6: "Serdecznie zapraszam do przyłączenia się do tej kulinarnej przygody i odkrycia charakterystycznych smaków Południowych Indii – kuchni nadal nowej dla wielu w Polsce, ale z pewnością zachwycającej podniebienie bogatymi tradycjami i wyrazistymi smakami.", signature: "- Szef kuchni Victor", description: "Poznaj historię Madras Bistro w Krakowie, które wprowadza autentyczną kuchnię południowoindyjską z pasją i tradycją. Odkryj naszą historię i kulinarne korzenie!" }, menuSection: { title: "Odkryj nasze menu", description: "Nasze menu to kolekcja najpopularniejszych dań z południowych Indii." }, orderOnline: { title: "Zamów online", description: "Masz ochotę na południowoindyjskie jedzenie? Zamów online z Madras Bistro w Krakowie pyszne dosa, curry i więcej. Szybkie, świeże i autentyczne, dostarczone prosto do Ciebie!" }, hero: { title: "Odkryj przepyszną południowo indyjską kuchnie", subtitle: "Wyrusz w pełną smaków podróż bogatą w tradycję i wyraziste przyprawy." }, introSection: { title: "Madras Bistro: Pięć regionów, jeden wyjątkowy stół", paragraph1: "Wejdź do świata, gdzie przyprawy szepczą dawne sekrety, a aromaty opowiadają historie z dalekich brzegów. W Madras Bistro różnorodne dziedzictwo kulinarne Południowych Indii ożywa na Twoim talerzu — gastronomiczna tkanina utkana z tradycji Tamil Nadu, Kerali, Andhra Pradesh, Karnataki i Sri Lanki. Nasza kuchnia celebruje tę bogatą mozaikę regionalnych kuchni, gdzie nadmorskie skarby spotykają się z wewnątrznymi specjałami w harmonijnym wyrażeniu smaku.", paragraph2: "W tym tropikalnym raju klimat sprzyja obfitym palmom kokosowym i polom ryżowym, dając początek tradycji kulinarnej, która celebruje świeże składniki i złożone smaki. W przeciwieństwie do ciężkich, kremowych dań znanych wielu osobom, kuchnia południowoindyjska to delikatny taniec przypraw, z takimi ikonicznymi daniami jak chrupiące dosy, miękkie idli i pikantne sambary, które mówią o wiekach kulinarnych innowacji. Każdy kęs opowiada historię nadmorskich targów, rodzinnych tradycji i głębokiego związku z ziemią." }, reservationSection: { title: "Zarezerwuj stolik", description: "Doświadcz autentycznej kuchni południowoindyjskiej w ciepłej, przyjaznej atmosferze. Dokonaj rezerwacji na niezapomniane doświadczenie kulinarne." }, testimonialsSection: { title: "Opinie Google", description: "Zobacz, co mówią o nas nasi klienci", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "Bistro warte odwiedzenia dla fanów indyjskich smaków. Serwują kuchnię indyjską i z północy Sri Lanki. Zjadłem pysznego kurczaka w mleku z aromatycznym ryżem jeera. Bistro jest małe (3 stoliki) i skromne, ale można posłuchać indyjskich hitów muzycznych." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "Ja i mój mąż przypadkowo trafiliśmy do tej restauracji w zeszły czwartek podczas krótkiego pobytu w Krakowie z Wielkiej Brytanii. Ta mała jadłodajnia z zaledwie 2 lub 3 stolikami jest prowadzona przez bardzo przyjaznego i uczynnego właściciela/szefa kuchni i jest dogodnie zlokalizowana naprzeciwko Placu Bohaterów Getta. Masala Uttapam, Masala Dosa, Curry z Kurczakiem Kerala, Kurczak Pieczony i Masala Chai, które jedliśmy, były absolutnie pyszne. Gorąco polecam tę restaurację wszystkim miłośnikom południowo-indyjskiej kuchni." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutnie pyszne jedzenie! Właściciel (również szef kuchni) jest niezwykle zaangażowany w doświadczenia klientów i można poczuć jego doświadczenie w każdym kęsie. Gorąco polecam ghee dosa (zrobił je dla nas ekstra chrupiące na prośbę). Smakuje jak w domu, jest BARDZO autentyczne. Jedynym minusem jest to, że będę tęsknić za tym jedzeniem, gdy opuszczę Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "Jeśli szukasz miejsca, które serwuje prawdziwe jedzenie Malabar, to zdecydowanie jest to odpowiednie miejsce. Gorąco polecane dla każdego, kto tęskni za smakiem domu!" }] }, orderTracking: { orderPlaced: "Zamówienie złożone", orderPlacedDesc: "Twoje zamówienie zostało odebrane i czeka na akceptację", orderAccepted: "Zamówienie zaakceptowane", orderAcceptedDesc: "Twoje zamówienie zostało zaakceptowane i jest przetwarzane", readyForDispatch: "Gotowe do wysyłki", readyForDispatchDesc: "Twoje zamówienie jest spakowane i gotowe do wysyłki", orderDispatched: "Zamówienie wysłane", orderDispatchedDesc: "Twoje zamówienie jest w drodze do Ciebie", orderDelivered: "Zamówienie dostarczone", orderDeliveredDesc: "Twoje zamówienie zostało dostarczone", orderCancelled: "Zamówienie anulowane", orderCancelledDesc: "Twoje zamówienie zostało anulowane", price: "Cena", quantity: "Ilość", subtotal: "Suma częściowa", total: "Razem", poweredBy: "Wspierane przez", reference: "Numer referencyjny", status: "Status" }, reservation: { reservationDetails: "Szczegóły rezerwacji", name: "Imię i nazwisko", phone: "Telefon", guests: "Liczba gości", date: "Data", reference: "Numer referencyjny", status: "Status", notSpecified: "Nie określono", invalidDate: "Nieprawidłowa data", requestSent: "Prośba o rezerwację wysłana", requestSentDesc: "Twoja prośba o rezerwację została odebrana i czeka na potwierdzenie przez restaurację", confirmed: "Rezerwacja potwierdzona", confirmedDesc: "Twoja rezerwacja została potwierdzona", cancelled: "Rezerwacja anulowana", cancelledDesc: "Twoja rezerwacja została anulowana", pendingStatus: "Oczekujące", confirmedStatus: "Potwierdzone", cancelledStatus: "Anulowane", poweredBy: "Wspierane przez" }, homepage: { description: "Odkryj Madras Bistro, pierwszą restaurację południowoindyjską w Krakowie. Skosztuj autentycznych smaków, żywych przypraw i tradycyjnych dań w przytulnym otoczeniu. Odwiedź nas już dziś!" }, menu: { description: "Zapoznaj się z menu Madras Bistro oferującym autentyczne południowoindyjskie dania jak dosa, curry i biryani. Świeże składniki, wyraziste smaki w Krakowie!" }, privacyPolicy: { description: "Przeczytaj Politykę Prywatności Madras Bistro, aby zrozumieć, jak chronimy Twoje dane i zapewniamy bezpieczne doświadczenie podczas delektowania się naszą południowoindyjską kuchnią w Krakowie." }, termsAndConditions: { description: "Zapoznaj się z Warunkami korzystania ze strony internetowej i usług Madras Bistro w Krakowie. Dowiedz się o naszych zasadach dotyczących zamówień online i dań w restauracji." } }, Tr = { en: $o, pl: Ko }, hn = Ne(void 0), Xo = ({ children: a, locale: t }) => {
|
|
863
863
|
const r = V((s) => {
|
|
864
864
|
const l = s.split(".");
|
|
865
865
|
let o = Tr[t];
|
|
@@ -872,14 +872,14 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
872
872
|
const a = ue(hn);
|
|
873
873
|
if (a === void 0) throw new Error("useTranslation must be used within a TranslationProvider");
|
|
874
874
|
return a;
|
|
875
|
-
}, fn = () => e(S, { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [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: e("div", { className: "w-96 animate-fade", children: e("div", { className: "pl-6", children: i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [[1, 2].map((a) => i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:w-32 h-10 sm:h-24 overflow-hidden rounded-lg bg-gray-700 animate-pulse" }), i("div", { className: "pl-3 md:pl-5 w-full", children: [e("div", { className: "h-4 bg-gray-700 rounded-sm w-3/4 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-1/2 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-1/4 animate-pulse" })] })] }, a)), e("hr", { className: "opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-3 bg-gray-700 rounded-sm w-20 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 ml-auto animate-pulse" })] }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 ml-auto animate-pulse" })] }), e("hr", { className: "opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("div", { className: "h-5 bg-gray-700 rounded-sm w-16 animate-pulse" }), e("div", { className: "h-5 bg-gray-700 rounded-sm w-20 animate-pulse" })] })] }) }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px]", children: [e("div", { className: "h-8 bg-gray-200 rounded-sm w-64 mb-4 animate-pulse" }), i("div", { className: "mb-8", children: [e("div", { className: "h-4 bg-gray-200 rounded-sm w-48 mb-2 animate-pulse" }), e("div", { className: "h-4 bg-gray-200 rounded-sm w-40 animate-pulse" })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 h-full w-0.5 bg-gray-200" }), [1, 2, 3, 4, 5].map((a) => i("div", { className: "ml-9 mb-8 relative", children: [e("div", { className: "absolute -left-9 mt-1.5", children: e("div", { className: "h-8 w-8 rounded-full bg-gray-200 animate-pulse" }) }), e("div", { className: "h-5 bg-gray-200 rounded-sm w-40 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-200 rounded-sm w-64 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-200 rounded-sm w-24 animate-pulse" })] }, a))] }) })] }) })] }) }),
|
|
875
|
+
}, fn = () => e(S, { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [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: e("div", { className: "w-96 animate-fade", children: e("div", { className: "pl-6", children: i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [[1, 2].map((a) => i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:w-32 h-10 sm:h-24 overflow-hidden rounded-lg bg-gray-700 animate-pulse" }), i("div", { className: "pl-3 md:pl-5 w-full", children: [e("div", { className: "h-4 bg-gray-700 rounded-sm w-3/4 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-1/2 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-1/4 animate-pulse" })] })] }, a)), e("hr", { className: "opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-3 bg-gray-700 rounded-sm w-20 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 ml-auto animate-pulse" })] }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 ml-auto animate-pulse" })] }), e("hr", { className: "opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("div", { className: "h-5 bg-gray-700 rounded-sm w-16 animate-pulse" }), e("div", { className: "h-5 bg-gray-700 rounded-sm w-20 animate-pulse" })] })] }) }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px]", children: [e("div", { className: "h-8 bg-gray-200 rounded-sm w-64 mb-4 animate-pulse" }), i("div", { className: "mb-8", children: [e("div", { className: "h-4 bg-gray-200 rounded-sm w-48 mb-2 animate-pulse" }), e("div", { className: "h-4 bg-gray-200 rounded-sm w-40 animate-pulse" })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 h-full w-0.5 bg-gray-200" }), [1, 2, 3, 4, 5].map((a) => i("div", { className: "ml-9 mb-8 relative", children: [e("div", { className: "absolute -left-9 mt-1.5", children: e("div", { className: "h-8 w-8 rounded-full bg-gray-200 animate-pulse" }) }), e("div", { className: "h-5 bg-gray-200 rounded-sm w-40 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-200 rounded-sm w-64 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-200 rounded-sm w-24 animate-pulse" })] }, a))] }) })] }) })] }) }), Yo = ({ className: a }) => e("svg", { className: a, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), ed = ({ className: a }) => e("svg", { className: a, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" }) }), ad = ({ className: a }) => i("svg", { "aria-hidden": "true", className: a, viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), yn = ({ title: a, description: t, active: r, date: n, cancelled: s = !1, showConfetti: l = !1 }) => {
|
|
876
876
|
const o = (m) => {
|
|
877
877
|
if (!m) return null;
|
|
878
878
|
const h = new Date(m);
|
|
879
879
|
return jt(h) ? H(h, "MMM d, yyyy - h:mm a") : null;
|
|
880
880
|
}, d = !!n, p = r && !n;
|
|
881
|
-
return i("div", { className: "relative flex items-start gap-4 pb-8", children: [e("div", { className: "flex items-center justify-center w-8 h-8 rounded-full shrink-0", children: i("div", { className: k("w-8 h-8 rounded-full flex items-center justify-center", { "bg-green-100 border-green-500 border-[3px]": d && !l, "bg-violet-100 border-violet-500 border-[3px]": d && l, "bg-white": !n, "border-gray-200 border-[3px]": !n && !r, "bg-red-100 border-red-500 border-[3px]": s }), children: [n && !l && !s && e(
|
|
882
|
-
},
|
|
881
|
+
return i("div", { className: "relative flex items-start gap-4 pb-8", children: [e("div", { className: "flex items-center justify-center w-8 h-8 rounded-full shrink-0", children: i("div", { className: k("w-8 h-8 rounded-full flex items-center justify-center", { "bg-green-100 border-green-500 border-[3px]": d && !l, "bg-violet-100 border-violet-500 border-[3px]": d && l, "bg-white": !n, "border-gray-200 border-[3px]": !n && !r, "bg-red-100 border-red-500 border-[3px]": s }), children: [n && !l && !s && e(Yo, { className: "w-4 h-4 text-green-500" }), d && l && e(ps, { className: "w-4 h-4 text-violet-500" }), s && e(ed, { className: "w-4 h-4 text-red-500" }), p && e(ad, { className: "text-gray-200 animate-spin dark:text-gray-600 fill-blue-600 w-full" })] }) }), i("div", { className: "flex-1", children: [e("h3", { className: k("font-black font-red-hat-display", { "text-red-500": s, "text-gray-900": d, "text-gray-500": !s && !d }), children: a }), e("p", { className: k("text-sm font-medium", { "text-red-500": s, "text-gray-600": d, "text-gray-400": !s && !d }), children: t }), o(n) && e("p", { className: "text-xs text-gray-400 mt-1", children: o(n) })] })] });
|
|
882
|
+
}, td = ({ orderId: a }) => {
|
|
883
883
|
const { client: t } = I(), { organization: r, organizationId: n } = we(), s = pe(), l = G(), o = da(), { t: d } = gn(), p = r == null ? void 0 : r.configuration.defaultCurrency;
|
|
884
884
|
X(() => {
|
|
885
885
|
if ((s == null ? void 0 : s.get("clearCart")) === "true" && o) {
|
|
@@ -901,13 +901,13 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
901
901
|
if (!m || h) return e(fn, {});
|
|
902
902
|
const { status: b } = m, f = [{ title: d("orderTracking.orderPlaced"), description: d("orderTracking.orderPlacedDesc"), date: new Date(m.expiresAt), active: !1 }, { title: d("orderTracking.orderAccepted"), description: d("orderTracking.orderAcceptedDesc"), date: m.acceptedAt, active: !m.acceptedAt }, { title: d("orderTracking.readyForDispatch"), description: d("orderTracking.readyForDispatchDesc"), date: m.readyForDispatchAt, active: b === "accepted" }, { title: d("orderTracking.orderDispatched"), description: d("orderTracking.orderDispatchedDesc"), date: m.dispatchedAt, active: b === "ready-for-dispatch" }, { title: d("orderTracking.orderDelivered"), description: d("orderTracking.orderDeliveredDesc"), date: m.completedAt, active: b === "dispatched", showConfetti: !0 }];
|
|
903
903
|
return m.status === "cancelled" && f.push({ title: d("orderTracking.orderCancelled"), description: d("orderTracking.orderCancelledDesc"), date: m.cancelledAt, active: !!m.cancelledAt, cancelled: !0 }), i(S, { children: [e(Fa, { summary: { total: m.payment.total, subtotal: m.payment.subtotal, shipping: m.payment.shipping, items: g } }), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [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: e("div", { className: "w-96 animate-fade", children: i("div", { className: "pl-6", children: [e(ir, { items: g, total: m.payment.total, subtotal: m.payment.subtotal, shipping: m.payment.shipping, currency: p ?? "USD" }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: [d("orderTracking.poweredBy"), " ", e("a", { href: "https://shophost.io", className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", children: "shophost.io" })] })] }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px] pt-14 sm:pt-0", children: [e("h1", { className: "h3 mb-1 font-red-hat-display", children: d("checkout.yourOrder") }), i("div", { className: "mb-8", children: [i("p", { className: "text-sm font-medium text-gray-500", children: [d("orderTracking.reference"), ": ", m.referenceId] }), i("p", { className: "text-sm font-medium text-gray-500", children: [d("orderTracking.status"), ":", " ", e("span", { className: `capitalize font-semibold ${m.status === "cancelled" ? "text-red-600" : "text-green-600"}`, children: m.status })] })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 w-0.5 bg-gray-200", style: { height: `calc(100% - ${f.length > 1 ? "4rem" : "0rem"})` } }), f.map((w, y) => e(yn, { ...w }, y))] }) })] }) })] }) })] });
|
|
904
|
-
},
|
|
904
|
+
}, rd = (a) => {
|
|
905
905
|
const t = a.items.map((r) => {
|
|
906
906
|
var n;
|
|
907
907
|
return (n = r.translations[0]) == null ? void 0 : n.title;
|
|
908
908
|
}).filter(Boolean);
|
|
909
909
|
return t.length === 0 ? "Order placed" : t.length === 1 ? t[0] : `${t[0]} +${t.length - 1} more`;
|
|
910
|
-
},
|
|
910
|
+
}, id = () => {
|
|
911
911
|
var o;
|
|
912
912
|
const { client: a } = I(), { useSession: t } = De(), { organizationId: r } = we(), { data: n } = t(), s = M({ queryKey: ["account", "orders", "history", r], enabled: !!r && !!(n != null && n.user), queryFn: async () => {
|
|
913
913
|
const { body: d, status: p } = await a.order.getMyOrders({ params: { organizationId: r }, query: { limit: 20, page: 1 } });
|
|
@@ -917,11 +917,11 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
917
917
|
if (!(n != null && n.user)) return null;
|
|
918
918
|
if (s.isLoading) return e(nr, { title: "Your orders", description: "Loading your order history." });
|
|
919
919
|
const l = ((o = s.data) == null ? void 0 : o.list) ?? [];
|
|
920
|
-
return e(bt, { eyebrow: "My account", title: "Your orders", description: "Everything you've ordered lives here, including totals, fulfilment details, and live status updates.", actions: i(S, { children: [e(W, { asChild: !0, variant: "secondary", children: e(E, { href: "/account", children: "Back to account" }) }), e(W, { asChild: !0, children: e(E, { href: "/account/reservations", children: "Reservation history" }) })] }), children: e("div", { children: e(sa, { title: "Order history", description: "Open any order to review the full tracker and line items.", action: e(at, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(je, { icon: oa, title: "We couldn't load your orders", description: "Please refresh the page and try again. Your order tracker will be back as soon as the connection recovers." }) : l.length === 0 ? e(je, { icon: oa, title: "No orders yet", description: "Once you buy something, this page becomes your personal record of what you ordered and how each order progressed.", actionHref: "/", actionLabel: "Start shopping" }) : e("div", { className: "space-y-4", children: l.map((d) => e(E, { href: `/account/orders/${d.id}`, className: "group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:border-teal-300 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [i("div", { className: "min-w-0", children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children:
|
|
920
|
+
return e(bt, { eyebrow: "My account", title: "Your orders", description: "Everything you've ordered lives here, including totals, fulfilment details, and live status updates.", actions: i(S, { children: [e(W, { asChild: !0, variant: "secondary", children: e(E, { href: "/account", children: "Back to account" }) }), e(W, { asChild: !0, children: e(E, { href: "/account/reservations", children: "Reservation history" }) })] }), children: e("div", { children: e(sa, { title: "Order history", description: "Open any order to review the full tracker and line items.", action: e(at, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(je, { icon: oa, title: "We couldn't load your orders", description: "Please refresh the page and try again. Your order tracker will be back as soon as the connection recovers." }) : l.length === 0 ? e(je, { icon: oa, title: "No orders yet", description: "Once you buy something, this page becomes your personal record of what you ordered and how each order progressed.", actionHref: "/", actionLabel: "Start shopping" }) : e("div", { className: "space-y-4", children: l.map((d) => e(E, { href: `/account/orders/${d.id}`, className: "group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:border-teal-300 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [i("div", { className: "min-w-0", children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: rd(d) }), e(et, { tone: mn(d.status), children: cn(d.status) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", d.referenceId, " • ", d.items.length, " item", d.items.length === 1 ? "" : "s", " •", " ", d.fulfilmentMethod === "delivery" ? "Delivery" : "Pickup"] }), e("div", { className: "mt-4 flex flex-wrap gap-2", children: d.items.slice(0, 3).map((p, m) => {
|
|
921
921
|
var h;
|
|
922
922
|
return e("span", { className: "rounded-full border border-stone-200 bg-stone-50 px-3 py-1 text-xs font-medium text-stone-600", children: ((h = p.translations[0]) == null ? void 0 : h.title) ?? "Item" }, `${d.id}-${m}`);
|
|
923
923
|
}) })] }), i("div", { className: "shrink-0 text-left lg:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: ye(d.payment.total, d.currency) }), e("p", { className: "mt-1 text-sm text-stone-500", children: Le(d.createdAt, "Recently") }), e("p", { className: "mt-3 text-sm font-semibold text-stone-700 transition group-hover:text-stone-950", children: "View details" })] })] }) }, d.id)) }) }) }) });
|
|
924
|
-
},
|
|
924
|
+
}, nd = ({ initialData: a }) => {
|
|
925
925
|
const { client: t } = I(), { organizationId: r } = we(), n = G(), s = se({ resolver: le(io), reValidateMode: "onChange", defaultValues: { firstname: a.firstname, lastname: a.lastname } }), l = T({ mutationFn: async (o) => {
|
|
926
926
|
const { status: d, body: p } = await t.reservation.createReservation({ body: o, params: { organizationId: r } });
|
|
927
927
|
if (d !== 201) throw new Error("Failed to create shipping address");
|
|
@@ -930,14 +930,14 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
930
930
|
n.push(`/account/reservations/${o.id}`);
|
|
931
931
|
} });
|
|
932
932
|
return e("div", { className: "flex flex-col gap-4", children: e(Ve, { ...s, children: i("form", { onSubmit: s.handleSubmit((o) => l.mutate(o)), children: [i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [e(fe, { name: "firstname", label: "First Name", type: "text", className: "col-span-2", placeholder: "e.g. John" }), e(fe, { name: "lastname", label: "Last Name", type: "text", className: "col-span-2", placeholder: "e.g. Doe" }), e(fe, { name: "phone", label: "Phone", type: "phone-number", className: "col-span-4", placeholder: "e.g. +48 123 456 789" }), e(fe, { name: "guests", label: "Number of Guests", type: "number", className: "col-span-4", placeholder: "e.g. 2" }), e(fe, { name: "date", type: "week-time", className: "col-span-4 -mt-4" })] }), i("div", { className: "grid grid-cols-2 gap-x-2 w-full mt-8", children: [e(W, { variant: "secondary", className: "shadow-none", type: "button", onClick: () => n.push("/"), children: "Back" }), e(W, { type: "submit", className: "shadow-none bg-teal-500 hover:bg-teal-400 text-white", isLoading: l.isPending, loadingText: "Saving...", children: "Send Request" })] })] }) }) });
|
|
933
|
-
},
|
|
933
|
+
}, sd = () => {
|
|
934
934
|
const { useSession: a } = De(), { data: t } = a();
|
|
935
|
-
return t != null && t.user ? e(dn, { title: "Book a table", description: "Enter your details to book a table at Madras Bistro", children: e(
|
|
935
|
+
return t != null && t.user ? e(dn, { title: "Book a table", description: "Enter your details to book a table at Madras Bistro", children: e(nd, { initialData: { firstname: t.user.firstname, lastname: t.user.lastname } }) }) : null;
|
|
936
936
|
}, Jr = (a, t) => {
|
|
937
937
|
if (!a) return t("reservation.notSpecified");
|
|
938
938
|
const r = new Date(a);
|
|
939
939
|
return jt(r) ? H(r, "MMM d, yyyy - h:mm a") : t("reservation.invalidDate");
|
|
940
|
-
},
|
|
940
|
+
}, ld = ({ reservationId: a }) => {
|
|
941
941
|
const { client: t } = I(), { organizationId: r } = we(), { t: n } = gn(), { data: s, isLoading: l } = M({ queryKey: ["reservation", a], queryFn: async () => {
|
|
942
942
|
const { status: p, body: m } = await t.reservation.getReservation({ params: { reservationId: a, organizationId: r } });
|
|
943
943
|
if (p !== 200) throw new Error("Failed to fetch reservation");
|
|
@@ -951,7 +951,7 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
951
951
|
s.cancelledAt && o.push({ title: n("reservation.cancelled"), description: n("reservation.cancelledDesc"), date: s.cancelledAt, active: !1, cancelled: !0 });
|
|
952
952
|
const d = () => s.cancelledAt ? n("reservation.cancelledStatus") : s.acceptedAt ? n("reservation.confirmedStatus") : n("reservation.pendingStatus");
|
|
953
953
|
return i(S, { children: [e(Fa, {}), i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [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: e("div", { className: "w-96 animate-fade", children: i("div", { className: "pl-6", children: [i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [e("div", { className: "my-3 sm:my-6 sm:pb-1", children: i("div", { className: "flex flex-col w-full mb-5 sm:mb-3", children: [e("h2", { className: "text-xl font-bold text-white mb-2", children: n("reservation.reservationDetails") }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.name"), ":"] }), " ", s.firstname, " ", s.lastname] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.phone"), ":"] }), " ", s.phone] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.guests"), ":"] }), " ", s.guests] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.date"), ":"] }), " ", Jr(s.date, n)] })] }) }), e("hr", { className: "opacity-10 my-4 sm:my-4" }), e("div", { className: "mt-4", children: i("div", { className: "flex items-center", children: [e("h2", { className: "text-sm xl:text-lg text-white font-black font-red-hat-display", children: n("common.makeReservation") }), e("span", { className: `ml-auto py-1 px-3 rounded-full text-sm font-semibold ${s.cancelledAt ? "bg-red-100 text-red-800" : s.acceptedAt ? "bg-green-100 text-green-800" : "bg-yellow-100 text-yellow-800"}`, children: d() })] }) })] }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: [n("reservation.poweredBy"), " ", e("a", { href: "https://shophost.io", className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", children: "shophost.io" })] })] }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative animate-fade-in", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px] pt-14 sm:pt-0", children: [e("h1", { className: "h3 mb-1 font-red-hat-display", children: n("common.makeReservation") }), i("div", { className: "mb-8", children: [i("p", { className: "text-sm font-medium text-gray-500", children: [n("reservation.reference"), ": ", s.referenceId] }), i("p", { className: "text-sm font-medium text-gray-500", children: [n("reservation.status"), ":", " ", e("span", { className: `capitalize font-semibold ${s.cancelledAt ? "text-red-600" : s.acceptedAt ? "text-green-600" : "text-yellow-600"}`, children: d() })] }), i("div", { className: "mt-10 border-b pb-6 md:hidden", children: [e("div", { className: "flex items-center", children: e("h2", { className: "text-lg font-black font-red-hat-display text-gray-900", children: n("reservation.reservationDetails") }) }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.name"), ":"] }), " ", s.firstname, " ", s.lastname] }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.phone"), ":"] }), " ", s.phone] }), i("p", { className: "text-sm text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.guests"), ":"] }), " ", s.guests] }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.date"), ":"] }), " ", Jr(s.date, n)] })] })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 w-0.5 bg-gray-200", style: { height: `calc(100% - ${o.length > 1 ? "4rem" : "0rem"})` } }), o.map((p, m) => e(yn, { ...p }, m))] }) })] }) })] })] });
|
|
954
|
-
},
|
|
954
|
+
}, od = () => {
|
|
955
955
|
var o;
|
|
956
956
|
const { client: a } = I(), { useSession: t } = De(), { organizationId: r } = we(), { data: n } = t(), s = M({ queryKey: ["account", "reservations", "history", r], enabled: !!r && !!(n != null && n.user), queryFn: async () => {
|
|
957
957
|
const { body: d, status: p } = await a.reservation.getMyReservations({ params: { organizationId: r }, query: { limit: 20, page: 1 } });
|
|
@@ -961,41 +961,42 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
961
961
|
if (!(n != null && n.user)) return null;
|
|
962
962
|
if (s.isLoading) return e(nr, { title: "Reservation history", description: "Loading your reservations." });
|
|
963
963
|
const l = ((o = s.data) == null ? void 0 : o.list) ?? [];
|
|
964
|
-
return e(bt, { eyebrow: "My account", title: "Reservation history", description: "Keep track of upcoming tables, past visits, and every booking status change in one place.", actions: i(S, { children: [e(W, { asChild: !0, variant: "secondary", children: e(E, { href: "/account", children: "Back to account" }) }), e(W, { asChild: !0, children: e(E, { href: "/account/reservations/book", children: "Book a table" }) })] }), children: e("div", { children: e(sa, { title: "Your bookings", description: "Open any reservation to review the confirmation timeline and details.", action: e(at, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(je, { icon:
|
|
965
|
-
},
|
|
964
|
+
return e(bt, { eyebrow: "My account", title: "Reservation history", description: "Keep track of upcoming tables, past visits, and every booking status change in one place.", actions: i(S, { children: [e(W, { asChild: !0, variant: "secondary", children: e(E, { href: "/account", children: "Back to account" }) }), e(W, { asChild: !0, children: e(E, { href: "/account/reservations/book", children: "Book a table" }) })] }), children: e("div", { children: e(sa, { title: "Your bookings", description: "Open any reservation to review the confirmation timeline and details.", action: e(at, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(je, { icon: Ye, title: "We couldn't load your reservations", description: "Please refresh the page and try again. Your booking history will return as soon as the connection is restored." }) : l.length === 0 ? e(je, { icon: Ye, title: "No reservations yet", description: "Once you book a table, this page will keep the full history of confirmed, pending, and cancelled reservations.", actionHref: "/account/reservations/book", actionLabel: "Book a table" }) : e("div", { className: "space-y-4", children: l.map((d) => e(E, { href: `/account/reservations/${d.id}`, className: "group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:border-teal-300 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [i("div", { className: "min-w-0", children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Le(d.date, "Date pending", "EEEE, MMM d") }), e(et, { tone: pn(d), children: un(d) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", d.referenceId, " • ", d.guests, " ", "guest", d.guests === 1 ? "" : "s"] }), i("div", { className: "mt-4 inline-flex rounded-full border border-stone-200 bg-stone-50 px-3 py-1 text-xs font-medium text-stone-600", children: ["Reserved under ", d.firstname, " ", d.lastname] })] }), i("div", { className: "shrink-0 text-left lg:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: Le(d.date, "Awaiting time", "h:mm a") }), i("p", { className: "mt-1 text-sm text-stone-500", children: ["Created", " ", Le(d.createdAt, "Recently")] }), e("p", { className: "mt-3 text-sm font-semibold text-stone-700 transition group-hover:text-stone-950", children: "View details" })] })] }) }, d.id)) }) }) }) });
|
|
965
|
+
}, dd = () => {
|
|
966
966
|
const a = pe(), { signIn: t } = De(), { baseUrl: r } = I(), n = (a == null ? void 0 : a.get("redirect")) ?? "/checkout/customer-details", { register: s, handleSubmit: l, formState: { errors: o, isSubmitting: d } } = se({ resolver: le(Ki), shouldFocusError: !0 }), p = async (h) => {
|
|
967
967
|
await t.email({ email: h.email, password: h.password, callbackURL: `${r}${n}` });
|
|
968
968
|
}, m = async (h) => {
|
|
969
969
|
h.preventDefault(), await t.social({ provider: "google", callbackURL: `${r}${n}` });
|
|
970
970
|
};
|
|
971
971
|
return i("div", { className: "flex w-full flex-col items-start sm:max-w-sm", children: [i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "h4 font-black font-red-hat-display", children: "Log in" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Login or create an account to continue. Don’t have an account?", " ", e(E, { className: "text-teal-500 hover:text-teal-600 dark:text-teal-500 dark:hover:text-teal-400", href: `/account/sign-up?redirect=${n}`, children: "Sign up" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: i(W, { variant: "secondary", type: "button", className: "mt-2 w-full sm:mt-0 shadow-none inline-flex items-center gap-2", onClick: m, children: [e(st, { className: "size-4", "aria-hidden": "true" }), "Login with Google"] }) }), e(va, { className: "my-6", children: "or" }), i("form", { onSubmit: l(p), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(Se, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(Ee, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...s("email") }), o.email && e("span", { className: "text-sm text-red-500", children: o.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(Se, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(Ee, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...s("password") }), o.password && e("span", { className: "text-sm text-red-500", children: o.password.message })] })] }), e(W, { type: "submit", className: "shadow-none", isLoading: d, children: d ? "Submitting..." : "Continue" })] })] }), e(va, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "text-teal-500 hover:text-teal-600 dark:text-teal-500 dark:hover:text-teal-400", href: "#", children: "Reset password" })] })] });
|
|
972
|
-
},
|
|
972
|
+
}, cd = () => e(dd, {}), md = () => {
|
|
973
973
|
const a = pe(), { signUp: t, signIn: r } = De(), { baseUrl: n } = I(), s = (a == null ? void 0 : a.get("redirect")) ?? "/checkout/customer-details", { register: l, handleSubmit: o, formState: { errors: d } } = se({ resolver: le($t), shouldFocusError: !0 }), { isPending: p, isError: m, mutate: h } = T({ onMutate: async (u) => t.email({ email: u.email, password: u.password, name: `${u.firstname} ${u.lastname}`, firstname: u.firstname, lastname: u.lastname, callbackURL: `${n}${s}` }) });
|
|
974
974
|
return e(S, { children: i("div", { className: "flex w-full flex-col items-start md:max-w-sm", children: [i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "h4 font-black font-red-hat-display", children: "Create an account" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Already have an account?", " ", e(E, { className: "text-teal-500 hover:text-teal-600 dark:text-teal-500 dark:hover:text-teal-400", href: "/account/sign-in", children: "Sign in" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: i(W, { variant: "secondary", type: "button", className: "mt-2 w-full sm:mt-0 inline-flex items-center gap-2 shadow-none", onClick: async (u) => (u.preventDefault(), r.social({ provider: "google", callbackURL: `${n}${s}` })), children: [e(st, { className: "size-4", "aria-hidden": "true" }), "Signin with Google"] }) }), e(va, { className: "my-6", children: "or" }), i("form", { onSubmit: o((u) => h(u)), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(Se, { htmlFor: "email-form-item", className: "font-medium", children: "First Name" }), e(Ee, { type: "text", id: "email-form-item", placeholder: "Emily", ...l("firstname") }), d.firstname && e("span", { className: "text-sm text-red-500", children: d.firstname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(Se, { htmlFor: "email-form-item", className: "font-medium", children: "Last Name" }), e(Ee, { type: "text", id: "email-form-item", placeholder: "Emily", ...l("lastname") }), d.lastname && e("span", { className: "text-sm text-red-500", children: d.lastname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(Se, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(Ee, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...l("email") }), d.email && e("span", { className: "text-sm text-red-500", children: d.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(Se, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(Ee, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...l("password") }), d.password && e("span", { className: "text-sm text-red-500", children: d.password.message })] })] }), m && e("span", { className: "text-sm text-red-500", children: "An error occurred, please try again." }), e(W, { type: "submit", isLoading: p, children: p ? "Submitting..." : "Continue" })] })] }), e(va, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "text-teal-500 hover:text-teal-600 dark:text-teal-500 dark:hover:text-teal-400", href: "#", children: "Reset password" })] })] }) });
|
|
975
|
-
},
|
|
976
|
-
const { segments: a } = vi(), [t, ...r] = a;
|
|
975
|
+
}, ud = () => e(md, {}), yu = () => {
|
|
976
|
+
const { segments: a } = vi(), [t, ...r] = a ?? [];
|
|
977
|
+
if (!t) return e($e, { children: e(Go, {}) });
|
|
977
978
|
switch (t) {
|
|
978
979
|
case "sign-in":
|
|
979
|
-
return r.length !== 0 ?
|
|
980
|
+
return r.length !== 0 ? Ke() : e(Pr, { children: e(cd, {}) });
|
|
980
981
|
case "sign-up":
|
|
981
|
-
return r.length !== 0 ?
|
|
982
|
+
return r.length !== 0 ? Ke() : e(Pr, { children: e(ud, {}) });
|
|
982
983
|
case "orders":
|
|
983
|
-
return r.length > 1 ?
|
|
984
|
+
return r.length > 1 ? Ke() : r.length === 0 ? e($e, { children: e(id, {}) }) : e($e, { children: e(td, { orderId: r[0] }) });
|
|
984
985
|
case "reservations":
|
|
985
|
-
return r.length > 1 ?
|
|
986
|
+
return r.length > 1 ? Ke() : r.length === 0 ? e($e, { children: e(od, {}) }) : r[0] === "book" ? e($e, { children: e(sd, {}) }) : e($e, { children: e(ld, { reservationId: r[0] }) });
|
|
986
987
|
default:
|
|
987
|
-
return
|
|
988
|
+
return Ke();
|
|
988
989
|
}
|
|
989
|
-
},
|
|
990
|
+
}, pd = (a) => {
|
|
990
991
|
if (a[0] === "reservation" && a.length === 1) return e(Mr, {});
|
|
991
|
-
if (a.length !== 1) return
|
|
992
|
+
if (a.length !== 1) return Ke();
|
|
992
993
|
switch (a[0]) {
|
|
993
994
|
case "customer-details":
|
|
994
995
|
return e(Mr, {});
|
|
995
996
|
case "shipping-and-payment":
|
|
996
997
|
return e(Oo, {});
|
|
997
998
|
default:
|
|
998
|
-
return
|
|
999
|
+
return Ke();
|
|
999
1000
|
}
|
|
1000
1001
|
}, bu = () => {
|
|
1001
1002
|
const a = vi(), { useSession: t } = De(), r = G(), { data: n, isPending: s } = t(), { loading: l, formattedCartItems: o, total: d, subtotal: p, shipping: m } = Ut(), { organization: h, loading: u } = we(), g = (a == null ? void 0 : a.segments) || [];
|
|
@@ -1007,24 +1008,24 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1007
1008
|
const b = [h.phone, h.email].filter((f) => !!f);
|
|
1008
1009
|
return e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900 text-center animate-fade-in", children: h.configuration.isOpen ? i("div", { className: "relative z-10 max-w-[800px] px-10", children: [e("h1", { className: "text-2xl sm:text-3xl font-black font-red-hat-display text-white", children: "Unfortunately, We're currently not accepting online orders." }), i("p", { className: "text-gray-100 font-medium mt-3 text-lg mt-", children: ["Please contact us directly for any inquiries.", b.map((f) => i(z.Fragment, { children: [e("br", {}), f] }, f))] }), e(E, { className: "btn-sm mt-6 text-white bg-teal-500 hover:bg-teal-400 rounded-lg shrink-0", href: "/", children: "Back to Homepage" })] }) : i("div", { className: "relative z-10", children: [e("h1", { className: "text-2xl sm:text-3xl font-black font-red-hat-display text-white", children: "Sorry, we're currently closed" }), i("p", { className: "text-gray-100 font-medium mt-3 text-lg mt-", children: ["Please contact us directly for any inquiries.", b.map((f) => i(z.Fragment, { children: [e("br", {}), f] }, f))] }), e(E, { className: "btn-sm mt-6 text-white bg-teal-500 hover:bg-teal-400 rounded-lg shrink-0", href: "/", children: "Back to Homepage" })] }) });
|
|
1009
1010
|
}
|
|
1010
|
-
return i(S, { children: [e(Fa, { summary: { total: d, subtotal: p, shipping: m, items: o } }), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [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: i("div", { className: "w-96 animate-fade", children: [e("div", { className: "pl-6", children: e(ir, { items: o, total: d, subtotal: p, shipping: m, currency: h.configuration.defaultCurrency || "USD" }) }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: ["Powered by", " ", e("a", { href: "https://shophost.io", className: "text-teal-500 hover:text-teal-600 dark:text-blue-500 dark:hover:text-blue-400", children: "shophost.io" })] })] }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: e("div", { className: "py-10 xl:py-24 md:my-auto animate-fade w-full md:max-w-[432px]", children:
|
|
1011
|
-
},
|
|
1011
|
+
return i(S, { children: [e(Fa, { summary: { total: d, subtotal: p, shipping: m, items: o } }), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [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: i("div", { className: "w-96 animate-fade", children: [e("div", { className: "pl-6", children: e(ir, { items: o, total: d, subtotal: p, shipping: m, currency: h.configuration.defaultCurrency || "USD" }) }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: ["Powered by", " ", e("a", { href: "https://shophost.io", className: "text-teal-500 hover:text-teal-600 dark:text-blue-500 dark:hover:text-blue-400", children: "shophost.io" })] })] }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: e("div", { className: "py-10 xl:py-24 md:my-auto animate-fade w-full md:max-w-[432px]", children: pd(g) }) })] }) })] });
|
|
1012
|
+
}, hd = ({ children: a }) => {
|
|
1012
1013
|
const { isOpen: t, onClose: r, product: n, modifierGroups: s, hasModifiers: l, productName: o, quantity: d, handleIncrement: p, handleDecrement: m, handleAddToCart: h, validationError: u } = ct();
|
|
1013
1014
|
if (!n) return null;
|
|
1014
1015
|
const g = d <= 1;
|
|
1015
1016
|
return a({ modifierGroups: s, hasModifiers: l, product: n, isOpen: t, onClose: r, productName: o, quantity: d, onIncrement: p, onDecrement: m, isDecrementDisabled: g, onAddToCart: h, validationError: u });
|
|
1016
|
-
},
|
|
1017
|
+
}, gd = ({ children: a, group: t, renderOptions: r }) => {
|
|
1017
1018
|
const { getModifierGroupName: n } = ct(), s = n(t), l = t.selectMin > 0;
|
|
1018
1019
|
let o = null;
|
|
1019
1020
|
return t.selectMin > 0 && t.selectMax > 0 && (o = t.selectMin === t.selectMax ? `${t.selectMin} option` : `${t.selectMin}-${t.selectMax}`), a({ group: t, groupName: s, isRequired: l, selectionRequirements: o, renderOptions: r });
|
|
1020
|
-
},
|
|
1021
|
+
}, fd = ({ children: a, modifier: t, groupId: r }) => {
|
|
1021
1022
|
const { isModifierSelected: n, isMultiSelect: s, toggleModifier: l, selectModifier: o, formatModifierPrice: d, product: p, locale: m } = ct(), h = n(r, t.id), u = s(p.modifierGroups.find((b) => b.id === r)), g = d(t, p.currency);
|
|
1022
1023
|
return a({ modifier: t, isSelected: h, onSelect: () => {
|
|
1023
1024
|
u ? l(r, t.id) : o(r, t.id);
|
|
1024
1025
|
}, isMultiSelect: u, formattedPrice: g });
|
|
1025
|
-
},
|
|
1026
|
+
}, yd = e("div", { className: "p-4 text-center text-gray-500", children: "This product has no modifiers." }), xu = ({ addToCartLabel: a = "Add to Cart", emptyState: t = yd, panelClassName: r, renderFooter: n, renderGroup: s, renderHeader: l, renderOption: o }) => e(hd, { children: ({ isOpen: d, onClose: p, product: m, modifierGroups: h, quantity: u, onIncrement: g, onDecrement: b, isDecrementDisabled: f, onAddToCart: w, validationError: y }) => e(gt, { open: d, onOpenChange: (x) => {
|
|
1026
1027
|
x || p();
|
|
1027
|
-
}, children: i(ft, { className: k("w-full sm:max-w-md max-h-[75vh] sm:max-h-[90vh] overflow-auto p-0", "top-auto left-0 right-0 bottom-0 translate-x-0 translate-y-0 rounded-t-xl rounded-b-none border-none", "sm:top-1/2 sm:left-1/2 sm:right-auto sm:bottom-auto sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl sm:border", r), children: [l ? l({ onClose: p, product: m }) : i("div", { className: "flex justify-between items-start p-4", children: [e("div", { className: "absolute left-1/2 -translate-x-1/2 top-2 w-12 h-1.5 bg-gray-300 rounded-full sm:hidden" }), i("div", { className: "mt-4 sm:mt-0", children: [e(Kt, { className: "text-2xl font-black font-red-hat-display", children: m.title }), e("p", { className: "text-sm text-gray-500", children: m.description })] }), e("button", { type: "button", onClick: p, className: "cursor-pointer text-gray-500 hover:text-gray-700 text-2xl leading-none mt-4 sm:mt-0", "aria-label": "Close modal", children: "×" })] }), h.length > 0 ? e("div", { className: "px-4", children: h.map((x) => e(
|
|
1028
|
+
}, children: i(ft, { className: k("w-full sm:max-w-md max-h-[75vh] sm:max-h-[90vh] overflow-auto p-0", "top-auto left-0 right-0 bottom-0 translate-x-0 translate-y-0 rounded-t-xl rounded-b-none border-none", "sm:top-1/2 sm:left-1/2 sm:right-auto sm:bottom-auto sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl sm:border", r), children: [l ? l({ onClose: p, product: m }) : i("div", { className: "flex justify-between items-start p-4", children: [e("div", { className: "absolute left-1/2 -translate-x-1/2 top-2 w-12 h-1.5 bg-gray-300 rounded-full sm:hidden" }), i("div", { className: "mt-4 sm:mt-0", children: [e(Kt, { className: "text-2xl font-black font-red-hat-display", children: m.title }), e("p", { className: "text-sm text-gray-500", children: m.description })] }), e("button", { type: "button", onClick: p, className: "cursor-pointer text-gray-500 hover:text-gray-700 text-2xl leading-none mt-4 sm:mt-0", "aria-label": "Close modal", children: "×" })] }), h.length > 0 ? e("div", { className: "px-4", children: h.map((x) => e(gd, { group: x, renderOptions: () => x.modifiers.map((v) => e(fd, { modifier: v, groupId: x.id, children: (N) => o ? o(N) : i("div", { className: k("flex items-center py-2.5 px-3 border rounded-lg cursor-pointer text-sm font-medium text-gray-600 dark:text-gray-400 mb-2", N.isSelected ? "border-blue-500 bg-blue-50" : "border-gray-200"), onClick: N.onSelect, children: [e("input", { type: N.isMultiSelect ? "checkbox" : "radio", checked: N.isSelected, className: "mr-2", onChange: (C) => C.preventDefault() }), i("span", { children: [N.modifier.title, N.formattedPrice] })] }) }, v.id)), children: (v) => s ? s(v) : i("div", { className: "mb-4", children: [i("div", { className: "font-medium mb-2", children: [i("div", { className: "flex items-center font-black font-red-hat-display text-lg", children: [v.groupName, v.isRequired && e("span", { className: "text-red-500 ml-1", children: "*" })] }), v.selectionRequirements && i("span", { className: "text-sm text-gray-600 dark:text-gray-400", children: ["Select ", v.selectionRequirements] })] }), e("div", { children: v.renderOptions() })] }) }, x.id)) }) : t, n ? n({ isDecrementDisabled: f, onAddToCart: w, onDecrement: b, onIncrement: g, quantity: u, validationError: y }) : i(S, { children: [i("div", { className: "p-4 flex items-center justify-center border-t mt-8", children: [e("button", { type: "button", onClick: b, className: k("w-8 h-8 flex items-center justify-center border rounded-lg", f ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), "aria-label": "Decrease quantity", disabled: f, children: "-" }), e("span", { className: "w-12 text-center", children: u }), e("button", { type: "button", onClick: g, className: "w-8 h-8 flex items-center justify-center border rounded-lg cursor-pointer", "aria-label": "Increase quantity", children: "+" })] }), i("div", { className: "p-4 border-t", children: [y && e("div", { className: "text-red-500 mb-2", children: y }), e("button", { type: "button", onClick: w, className: "btn text-sm text-white bg-teal-500 hover:bg-teal-400 rounded-lg w-full", children: a })] })] })] }) }) }), wu = ({ children: a, minQuantity: t = 1 }) => {
|
|
1028
1029
|
const { quantity: r, handleIncrement: n, handleDecrement: s } = ct(), l = r <= t;
|
|
1029
1030
|
return a({ quantity: r, onIncrement: n, onDecrement: s, isDecrementDisabled: l });
|
|
1030
1031
|
}, ku = ({ children: a, locale: t = "en" }) => e(Ti, { locale: t, children: a }), vu = (a, t = []) => {
|
|
@@ -1061,27 +1062,27 @@ const Po = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1061
1062
|
};
|
|
1062
1063
|
a.length > 0 ? m() : (n({}), l(!1));
|
|
1063
1064
|
}, [p, t]), { products: r, getProduct: (m) => r[m] || null, loading: s, error: o };
|
|
1064
|
-
}, Au = [{ id: "product-1", slug: "classic-burger", sku: "BURGER-001", basePrice: 12.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-1", url: "https://images.unsplash.com/photo-1568901346375-23c9450c58cd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 65783, filename: "classic-burger.jpeg" }], modifierGroups: [], categories: [{ id: "cat-1", slug: "burgers", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Burgers", description: "" }, { locale: "pl", title: "Burgery", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Classic Burger", description: "A juicy beef patty with lettuce, tomato, onion, and our special sauce on a toasted bun." }, { locale: "pl", title: "Klasyczny Burger", description: "Soczysta wołowina z sałatą, pomidorem, cebulą i naszym specjalnym sosem na opiekanej bułce." }] }, { id: "product-2", slug: "custom-pizza", sku: "PIZZA-001", basePrice: 14.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-2", url: "https://images.unsplash.com/photo-1513104890138-7c749659a591?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 75783, filename: "custom-pizza.jpeg" }], modifierGroups: [{ id: "mod-group-1", selectMin: 1, selectMax: 1, modifiers: [{ id: "mod-1-1", title: "Thin Crust", sku: null, price: 0 }, { id: "mod-1-2", title: "Regular Crust", sku: null, price: 0 }, { id: "mod-1-3", title: "Thick Crust", sku: null, price: 2 }], translations: [{ locale: "en", title: "Crust Type" }, { locale: "pl", title: "Rodzaj Ciasta" }] }, { id: "mod-group-2", selectMin: 1, selectMax: 1, modifiers: [{ id: "mod-2-1", title: "Tomato Sauce", sku: null, price: 0 }, { id: "mod-2-2", title: "White Sauce", sku: null, price: 0 }, { id: "mod-2-3", title: "BBQ Sauce", sku: null, price: 0 }], translations: [{ locale: "en", title: "Sauce" }, { locale: "pl", title: "Sos" }] }], categories: [{ id: "cat-2", slug: "pizza", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Pizza", description: "" }, { locale: "pl", title: "Pizza", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Custom Pizza", description: "Build your own pizza with your choice of crust and sauce. Comes with cheese and tomatoes." }, { locale: "pl", title: "Pizza Własna", description: "Zbuduj własną pizzę z wybranym rodzajem ciasta i sosu. Zawiera ser i pomidory." }] }, { id: "product-3", slug: "build-your-salad", sku: "SALAD-001", basePrice: 9.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-3", url: "https://images.unsplash.com/photo-1512621776951-a57141f2eefd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 55783, filename: "build-your-salad.jpeg" }], modifierGroups: [{ id: "mod-group-3", selectMin: 0, selectMax: 5, modifiers: [{ id: "mod-3-1", title: "Grilled Chicken", sku: null, price: 2.5 }, { id: "mod-3-2", title: "Bacon", sku: null, price: 1.5 }, { id: "mod-3-3", title: "Avocado", sku: null, price: 2 }, { id: "mod-3-4", title: "Feta Cheese", sku: null, price: 1 }, { id: "mod-3-5", title: "Boiled Egg", sku: null, price: 1 }], translations: [{ locale: "en", title: "Toppings" }, { locale: "pl", title: "Dodatki" }] }, { id: "mod-group-4", selectMin: 0, selectMax: 1, modifiers: [{ id: "mod-4-1", title: "Ranch", sku: null, price: 0 }, { id: "mod-4-2", title: "Balsamic Vinaigrette", sku: null, price: 0 }, { id: "mod-4-3", title: "Caesar", sku: null, price: 0 }, { id: "mod-4-4", title: "Olive Oil & Lemon", sku: null, price: 0 }], translations: [{ locale: "en", title: "Dressing" }, { locale: "pl", title: "Dressing" }] }], categories: [{ id: "cat-3", slug: "salads", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Salads", description: "" }, { locale: "pl", title: "Sałatki", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Build Your Salad", description: "Fresh mixed greens with cherry tomatoes, cucumber, and red onion. Add your favorite toppings and dressing." }, { locale: "pl", title: "Skomponuj Swoją Sałatkę", description: "Świeże mieszane sałaty z pomidorkami koktajlowymi, ogórkiem i czerwoną cebulą. Dodaj ulubione dodatki i dressing." }] }],
|
|
1065
|
+
}, Au = [{ id: "product-1", slug: "classic-burger", sku: "BURGER-001", basePrice: 12.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-1", url: "https://images.unsplash.com/photo-1568901346375-23c9450c58cd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 65783, filename: "classic-burger.jpeg" }], modifierGroups: [], categories: [{ id: "cat-1", slug: "burgers", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Burgers", description: "" }, { locale: "pl", title: "Burgery", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Classic Burger", description: "A juicy beef patty with lettuce, tomato, onion, and our special sauce on a toasted bun." }, { locale: "pl", title: "Klasyczny Burger", description: "Soczysta wołowina z sałatą, pomidorem, cebulą i naszym specjalnym sosem na opiekanej bułce." }] }, { id: "product-2", slug: "custom-pizza", sku: "PIZZA-001", basePrice: 14.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-2", url: "https://images.unsplash.com/photo-1513104890138-7c749659a591?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 75783, filename: "custom-pizza.jpeg" }], modifierGroups: [{ id: "mod-group-1", selectMin: 1, selectMax: 1, modifiers: [{ id: "mod-1-1", title: "Thin Crust", sku: null, price: 0 }, { id: "mod-1-2", title: "Regular Crust", sku: null, price: 0 }, { id: "mod-1-3", title: "Thick Crust", sku: null, price: 2 }], translations: [{ locale: "en", title: "Crust Type" }, { locale: "pl", title: "Rodzaj Ciasta" }] }, { id: "mod-group-2", selectMin: 1, selectMax: 1, modifiers: [{ id: "mod-2-1", title: "Tomato Sauce", sku: null, price: 0 }, { id: "mod-2-2", title: "White Sauce", sku: null, price: 0 }, { id: "mod-2-3", title: "BBQ Sauce", sku: null, price: 0 }], translations: [{ locale: "en", title: "Sauce" }, { locale: "pl", title: "Sos" }] }], categories: [{ id: "cat-2", slug: "pizza", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Pizza", description: "" }, { locale: "pl", title: "Pizza", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Custom Pizza", description: "Build your own pizza with your choice of crust and sauce. Comes with cheese and tomatoes." }, { locale: "pl", title: "Pizza Własna", description: "Zbuduj własną pizzę z wybranym rodzajem ciasta i sosu. Zawiera ser i pomidory." }] }, { id: "product-3", slug: "build-your-salad", sku: "SALAD-001", basePrice: 9.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-3", url: "https://images.unsplash.com/photo-1512621776951-a57141f2eefd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 55783, filename: "build-your-salad.jpeg" }], modifierGroups: [{ id: "mod-group-3", selectMin: 0, selectMax: 5, modifiers: [{ id: "mod-3-1", title: "Grilled Chicken", sku: null, price: 2.5 }, { id: "mod-3-2", title: "Bacon", sku: null, price: 1.5 }, { id: "mod-3-3", title: "Avocado", sku: null, price: 2 }, { id: "mod-3-4", title: "Feta Cheese", sku: null, price: 1 }, { id: "mod-3-5", title: "Boiled Egg", sku: null, price: 1 }], translations: [{ locale: "en", title: "Toppings" }, { locale: "pl", title: "Dodatki" }] }, { id: "mod-group-4", selectMin: 0, selectMax: 1, modifiers: [{ id: "mod-4-1", title: "Ranch", sku: null, price: 0 }, { id: "mod-4-2", title: "Balsamic Vinaigrette", sku: null, price: 0 }, { id: "mod-4-3", title: "Caesar", sku: null, price: 0 }, { id: "mod-4-4", title: "Olive Oil & Lemon", sku: null, price: 0 }], translations: [{ locale: "en", title: "Dressing" }, { locale: "pl", title: "Dressing" }] }], categories: [{ id: "cat-3", slug: "salads", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Salads", description: "" }, { locale: "pl", title: "Sałatki", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Build Your Salad", description: "Fresh mixed greens with cherry tomatoes, cucumber, and red onion. Add your favorite toppings and dressing." }, { locale: "pl", title: "Skomponuj Swoją Sałatkę", description: "Świeże mieszane sałaty z pomidorkami koktajlowymi, ogórkiem i czerwoną cebulą. Dodaj ulubione dodatki i dressing." }] }], bd = new Hr({ defaultOptions: { queries: { retry: !1, refetchInterval: !1, refetchOnWindowFocus: !1 } } }), Cu = ({ baseUrl: a, children: t, initialOrganization: r, locale: n = "en", modifiersModal: s, organizationId: l }) => e(Xo, { locale: n, children: e(jo, { baseURL: a, children: e(Ei, { baseUrl: a, children: e(Ur, { client: bd, children: e(hl, { initialOrganization: r, organizationId: l, children: e(gl, { locale: n, organizationId: l, children: i(Ti, { locale: n, children: [t, s] }) }) }) }) }) }) });
|
|
1065
1066
|
function _(...a) {
|
|
1066
1067
|
return Ai(Ni(...a));
|
|
1067
1068
|
}
|
|
1068
|
-
const Ra = ["focus:ring-2", "focus:ring-blue-200 dark:focus:ring-blue-700/30", "focus:border-blue-500 dark:focus:border-blue-700"], he = ["outline outline-offset-2 outline-0 focus-visible:outline-2", "outline-blue-500 dark:outline-blue-500"], sr = ["ring-2", "border-red-500 dark:border-red-700", "ring-red-200 dark:ring-red-700/30"],
|
|
1069
|
+
const Ra = ["focus:ring-2", "focus:ring-blue-200 dark:focus:ring-blue-700/30", "focus:border-blue-500 dark:focus:border-blue-700"], he = ["outline outline-offset-2 outline-0 focus-visible:outline-2", "outline-blue-500 dark:outline-blue-500"], sr = ["ring-2", "border-red-500 dark:border-red-700", "ring-red-200 dark:ring-red-700/30"], xd = (a, t = 0) => Intl.NumberFormat("us", { minimumFractionDigits: t, maximumFractionDigits: t }).format(Number(a)).toString(), ae = { currency: (a, t = "USD") => new Intl.NumberFormat("en-US", { style: "currency", currency: t }).format(a), unit: (a) => `${xd(a)}` }, wd = Te({ base: ["relative inline-flex items-center justify-center whitespace-nowrap rounded-lg border px-3 py-2 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out", "disabled:pointer-events-none disabled:shadow-none", he], variants: { variant: { primary: ["border-transparent", "text-white dark:text-white", "bg-blue-600 dark:bg-blue-500", "shadow-[0_16px_8px_rgba(31,31,31,0.01),0_12px_6px_rgba(31,31,31,0.04),0_4px_4px_rgba(31,31,31,0.07),0_1.5px_3px_rgba(31,31,31,0.08),0_0_0_1px_#2563eb,inset_0_1px_2px_hsla(0,0%,100%,0.12)] dark:outline-0 outline outline-2 outline-transparent outline-offset-2", "hover:bg-blue-500 dark:hover:bg-blue-600", "disabled:bg-blue-100 disabled:text-gray-400", "dark:disabled:bg-blue-800 dark:disabled:text-blue-400"], secondary: ["border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", "shadow-[0_1px_1px_0.5px_rgba(51,51,51,.04),0_3px_3px_-1.5px_rgba(51,51,51,.02),0_6px_6px_-3px_rgba(51,51,51,.04),0_12px_12px_-6px_rgba(51,51,51,.04),0_24px_24px_-12px_rgba(51,51,51,.04),0_48px_48px_-24px_rgba(51,51,51,.04),0_0_0_1px_rgba(51,51,51,.1),inset_0_-1px_1px_-0.5px_rgba(51,51,51,.06)] outline outline-2 dark:outline-0 outline-transparent outline-offset-2", "hover:bg-gray-50 dark:hover:bg-gray-900/60", "disabled:text-gray-400", "dark:disabled:text-gray-600"], light: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-gray-200 dark:bg-gray-900", "hover:bg-gray-300/70 dark:hover:bg-gray-800/80", "disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:bg-gray-800 dark:disabled:text-gray-600"], ghost: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800/80", "disabled:text-gray-400", "dark:disabled:text-gray-600"], destructive: ["text-white", "border-transparent", "bg-red-600 dark:bg-red-700", "hover:bg-red-700 dark:hover:bg-red-600", "disabled:bg-red-300 disabled:text-white", "dark:disabled:bg-red-950 dark:disabled:text-red-400"] } }, defaultVariants: { variant: "primary" } }), D = z.forwardRef(({ asChild: a, isLoading: t = !1, loadingText: r, className: n, disabled: s, variant: l, children: o, ...d }, p) => e(a ? Vt : "button", { ref: p, className: k(wd({ variant: l }), n), disabled: s || t, ...d, children: t ? i("span", { className: "pointer-events-none flex shrink-0 items-center justify-center gap-1.5", children: [e(pi, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }), e("span", { className: "sr-only", children: r || "Loading" }), r || "Loading"] }) : o }));
|
|
1069
1070
|
D.displayName = "Button";
|
|
1070
1071
|
function bn({ onReset: a }) {
|
|
1071
1072
|
return e("div", { className: "flex flex-col items-center gap-4 h-screen justify-center", children: e("div", { className: "py-8 px-4 mx-auto max-w-(--breakpoint-xl) pb-64 lg:px-6", children: i("div", { className: "mx-auto max-w-(--breakpoint-sm) text-center", children: [e("h1", { className: "mb-4 text-7xl tracking-tight font-extrabold lg:text-9xl text-red-500 dark:text-primary-500", children: "500" }), e("p", { className: "mb-3 text-3xl tracking-tight font-bold text-gray-800 md:text-4xl dark:text-white", children: "Something went wrong" }), i("p", { className: "mb-4 text-lg text-gray-500 dark:text-gray-400", children: ["We are sorry, but there was an unexpected error. ", e("br", {}), "Please try reloading the page."] }), a && e(D, { className: "mt-3", onClick: a, children: "Reload Page" })] }) }) });
|
|
1072
1073
|
}
|
|
1073
|
-
const
|
|
1074
|
-
function
|
|
1074
|
+
const kd = "redirect";
|
|
1075
|
+
function vd(a) {
|
|
1075
1076
|
return a.startsWith("/") && !a.startsWith("//");
|
|
1076
1077
|
}
|
|
1077
|
-
function
|
|
1078
|
+
function Nd(a, t) {
|
|
1078
1079
|
return a === t || a.startsWith(`${t}/`);
|
|
1079
1080
|
}
|
|
1080
1081
|
function xt(a, t) {
|
|
1081
|
-
return !a || !
|
|
1082
|
+
return !a || !vd(a) || !Nd(a, t.home) || a === t.signIn || a === t.signUp ? t.home : a;
|
|
1082
1083
|
}
|
|
1083
1084
|
function lr(a, t) {
|
|
1084
|
-
const r = new URLSearchParams({ [
|
|
1085
|
+
const r = new URLSearchParams({ [kd]: t });
|
|
1085
1086
|
return `${a}?${r.toString()}`;
|
|
1086
1087
|
}
|
|
1087
1088
|
function xn(a, t, r) {
|
|
@@ -1089,10 +1090,10 @@ function xn(a, t, r) {
|
|
|
1089
1090
|
return new URL(n, a).toString();
|
|
1090
1091
|
}
|
|
1091
1092
|
const wt = Ne({});
|
|
1092
|
-
function
|
|
1093
|
+
function Ad({ children: a, organizationId: t, id: r }) {
|
|
1093
1094
|
return e(wt.Provider, { value: { organizationId: t, id: r }, children: a });
|
|
1094
1095
|
}
|
|
1095
|
-
function
|
|
1096
|
+
function Cd() {
|
|
1096
1097
|
return ue(wt);
|
|
1097
1098
|
}
|
|
1098
1099
|
function O() {
|
|
@@ -1105,12 +1106,12 @@ function Ba() {
|
|
|
1105
1106
|
if (!a) throw new Error("useRouteId called outside a detail route");
|
|
1106
1107
|
return a;
|
|
1107
1108
|
}
|
|
1108
|
-
const
|
|
1109
|
+
const Sd = Ne(void 0), Id = ({ children: a, initialState: t = !1 }) => {
|
|
1109
1110
|
const [r, n] = F(t);
|
|
1110
|
-
return e(
|
|
1111
|
+
return e(Sd.Provider, { value: { flyoutOpen: r, setFlyoutOpen: n }, children: a });
|
|
1111
1112
|
}, ie = ({ className: a, ...t }) => i("svg", { "aria-hidden": "true", className: k("text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", a), viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t, children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), wn = Ne(null), Or = ({ children: a }) => {
|
|
1112
1113
|
var p, m, h, u, g;
|
|
1113
|
-
const { client: t } = I(), { organizationId: r } =
|
|
1114
|
+
const { client: t } = I(), { organizationId: r } = Cd(), n = M({ queryKey: ["organizations"], queryFn: async () => {
|
|
1114
1115
|
const { body: b, status: f } = await t.organization.getOrganizations();
|
|
1115
1116
|
if (f !== 200) throw f !== 401 && Q.error("Failed to update organizations list. Please refresh the page or try again later."), new Error("Failed to fetch organizations");
|
|
1116
1117
|
return b;
|
|
@@ -1157,20 +1158,20 @@ const kn = (a) => {
|
|
|
1157
1158
|
return e(Oa, { ...v });
|
|
1158
1159
|
};
|
|
1159
1160
|
kn.displayName = "Calendar";
|
|
1160
|
-
const
|
|
1161
|
+
const Ed = () => {
|
|
1161
1162
|
const a = typeof window < "u" ? window.navigator.language : "en-US", t = new Intl.DateTimeFormat(a, { hour: "numeric" }).format();
|
|
1162
1163
|
return Number.isInteger(Number(t));
|
|
1163
|
-
},
|
|
1164
|
+
}, zd = ({ segment: a, state: t }) => {
|
|
1164
1165
|
const r = A.useRef(null), { segmentProps: n } = $s(a, t, r), s = a.type === "literal" && a.text === ":", l = a.type === "literal" && a.text === " ";
|
|
1165
1166
|
return i("div", { ...n, ref: r, className: _("relative block w-full appearance-none rounded-md border px-2.5 py-1.5 text-left uppercase tabular-nums shadow-xs outline-hidden transition sm:text-sm", "border-gray-300 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", Ra, "invalid:border-red-500 invalid:ring-2 invalid:ring-red-200 group-aria-invalid/time-input:border-red-500 group-aria-invalid/time-input:ring-2 group-aria-invalid/time-input:ring-red-200 dark:group-aria-invalid/time-input:ring-red-400/20", { "w-fit! border-none bg-transparent px-0 text-gray-400 shadow-none": s || l, hidden: l, "border-gray-300 bg-gray-100 text-gray-400 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-500": t.isDisabled, "bg-transparent! text-gray-400!": !a.isEditable }), children: [e("span", { "aria-hidden": "true", className: _("pointer-events-none block w-full text-left text-gray-700 sm:text-sm", { hidden: !a.isPlaceholder, "h-0": !a.isPlaceholder }), children: a.placeholder }), a.isPlaceholder ? " " : a.text] });
|
|
1166
1167
|
}, Qt = A.forwardRef(({ hourCycle: a, ...t }, r) => {
|
|
1167
1168
|
const n = A.useRef(null);
|
|
1168
1169
|
A.useImperativeHandle(r, () => n == null ? void 0 : n.current);
|
|
1169
1170
|
const s = window !== void 0 ? window.navigator.language : "en-US", l = Ks({ hourCycle: a, locale: s, shouldForceLeadingZeros: !0, autoFocus: !0, ...t }), { fieldProps: o } = Gs({ ...t, hourCycle: a, shouldForceLeadingZeros: !0 }, l, n);
|
|
1170
|
-
return e("div", { ...o, ref: n, className: "group/time-input inline-flex w-full gap-x-2", children: l.segments.map((d, p) => e(
|
|
1171
|
+
return e("div", { ...o, ref: n, className: "group/time-input inline-flex w-full gap-x-2", children: l.segments.map((d, p) => e(zd, { segment: d, state: l }, p)) });
|
|
1171
1172
|
});
|
|
1172
1173
|
Qt.displayName = "TimeInput";
|
|
1173
|
-
const
|
|
1174
|
+
const Dd = Te({ base: ["peer flex w-full cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 py-2 shadow-xs outline-hidden transition-all sm:text-sm", "bg-white dark:bg-gray-950", "border-gray-300 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "hover:bg-gray-50 dark:hover:bg-gray-950/50", "disabled:pointer-events-none", "disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-800 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", Ra], variants: { hasError: { true: sr } } }), vn = A.forwardRef(({ className: a, children: t, placeholder: r, hasError: n, ...s }, l) => e(U.Trigger, { asChild: !0, children: i("button", { ref: l, className: _(Dd({ hasError: n }), a), ...s, children: [e(Cs, { className: "size-5 shrink-0 text-gray-400 dark:text-gray-600" }), e("span", { className: "flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900 dark:text-gray-50", children: t || (r ? e("span", { className: "text-gray-400 dark:text-gray-600", children: r }) : null) })] }) }));
|
|
1174
1175
|
vn.displayName = "DatePicker.Trigger";
|
|
1175
1176
|
const Nn = A.forwardRef(({ align: a, className: t, children: r, ...n }, s) => e(U.Portal, { children: e(U.Content, { ref: s, sideOffset: 10, side: "bottom", align: a, avoidCollisions: !0, onOpenAutoFocus: (l) => l.preventDefault(), className: _("relative z-50 w-fit rounded-md border text-sm shadow-xl shadow-black/[2.5%]", "min-w-[calc(var(--radix-select-trigger-width)-2px)] max-w-[95vw]", "border-gray-200 dark:border-gray-800", "bg-white dark:bg-gray-950", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[state=open]:data-[side=bottom]:animate-slideDownAndFade data-[state=open]:data-[side=left]:animate-slideLeftAndFade data-[state=open]:data-[side=right]:animate-slideRightAndFade data-[state=open]:data-[side=top]:animate-slideUpAndFade", t), ...n, children: r }) }));
|
|
1176
1177
|
Nn.displayName = "DatePicker.CalendarPopover";
|
|
@@ -1198,10 +1199,10 @@ const An = ({ presets: a, onSelect: t, currentValue: r }) => {
|
|
|
1198
1199
|
};
|
|
1199
1200
|
An.displayName = "DatePicker.PresetContainer";
|
|
1200
1201
|
const jr = (a, t, r) => {
|
|
1201
|
-
const n = !
|
|
1202
|
+
const n = !Ed();
|
|
1202
1203
|
let s;
|
|
1203
1204
|
return r ? s = n ? H(a, "dd MMM, yyyy h:mm a", { locale: t }) : H(a, "dd MMM, yyyy HH:mm", { locale: t }) : s = H(a, "dd MMM, yyyy", { locale: t }), s;
|
|
1204
|
-
},
|
|
1205
|
+
}, Fd = ({ defaultValue: a, value: t, onChange: r, presets: n, disabled: s, disableNavigation: l, disabledDays: o, enableYearNavigation: d = !1, locale: p = Xs, showTimePicker: m, placeholder: h = "Select date range", hasError: u, translations: g, align: b = "center", className: f, ...w }) => {
|
|
1205
1206
|
const [y, x] = A.useState(!1), [v, N] = A.useState(t ?? a ?? void 0), [C, K] = A.useState(v == null ? void 0 : v.from), [oe, de] = A.useState(t != null && t.from ? new Y(t.from.getHours(), t.from.getMinutes()) : a != null && a.from ? new Y(a.from.getHours(), a.from.getMinutes()) : new Y(0, 0)), [ne, ee] = A.useState(t != null && t.to ? new Y(t.to.getHours(), t.to.getMinutes()) : a != null && a.to ? new Y(a.to.getHours(), a.to.getMinutes()) : new Y(0, 0)), B = A.useMemo(() => v, [y]);
|
|
1206
1207
|
A.useEffect(() => {
|
|
1207
1208
|
N(t ?? a ?? void 0);
|
|
@@ -1246,7 +1247,7 @@ const jr = (a, t, r) => {
|
|
|
1246
1247
|
x(!1), r == null || r(v);
|
|
1247
1248
|
};
|
|
1248
1249
|
return i(U.Root, { "tremor-id": "tremor-raw", open: y, onOpenChange: Ma, children: [e(vn, { placeholder: h, disabled: s, className: f, hasError: u, "aria-required": w.required || w["aria-required"], "aria-invalid": w["aria-invalid"], "aria-label": w["aria-label"], "aria-labelledby": w["aria-labelledby"], children: Pa }), e(Nn, { align: b, children: e("div", { className: "flex", children: i("div", { className: "flex flex-col overflow-x-auto sm:flex-row sm:items-start", children: [n && n.length > 0 && e("div", { className: _("relative flex h-16 w-full items-center sm:h-full sm:w-40", "border-b border-gray-200 sm:border-b-0 sm:border-r dark:border-gray-800", "overflow-auto"), children: e("div", { className: "absolute px-3 sm:inset-0 sm:left-0 sm:p-2", children: e(An, { currentValue: v, presets: n, onSelect: _e }) }) }), i("div", { className: "overflow-x-auto", children: [e(kn, { mode: "range", selected: v, onSelect: _e, month: C, onMonthChange: K, numberOfMonths: 2, disabled: o, disableNavigation: l, enableYearNavigation: d, locale: p, initialFocus: !0, classNames: { months: "flex flex-row divide-x divide-gray-200 dark:divide-gray-800 overflow-x-auto" }, ...w }), m && i("div", { className: "flex items-center justify-evenly gap-x-3 border-t border-gray-200 p-3 dark:border-gray-800", children: [i("div", { className: "flex flex-1 items-center gap-x-2", children: [i("span", { className: "dark:text-gray-30 text-gray-700", children: [(g == null ? void 0 : g.start) ?? "Start", ":"] }), e(Qt, { value: oe, onChange: (P) => ba(P, "start"), "aria-label": "Start date time", isDisabled: !(v != null && v.from), isRequired: w.required })] }), e(Ss, { className: "size-4 shrink-0 text-gray-400" }), i("div", { className: "flex flex-1 items-center gap-x-2", children: [i("span", { className: "dark:text-gray-30 text-gray-700", children: [(g == null ? void 0 : g.end) ?? "End", ":"] }), e(Qt, { value: ne, onChange: (P) => ba(P, "end"), "aria-label": "End date time", isDisabled: !(v != null && v.to), isRequired: w.required })] })] }), i("div", { className: "border-t border-gray-200 p-3 sm:flex sm:items-center sm:justify-between dark:border-gray-800", children: [i("p", { className: "tabular-nums text-gray-900 dark:text-gray-50", children: [i("span", { className: "text-gray-700 dark:text-gray-300", children: [(g == null ? void 0 : g.range) ?? "Range", ":"] }), " ", e("span", { className: "font-medium", children: Pa })] }), i("div", { className: "mt-2 flex items-center gap-x-2 sm:mt-0", children: [e(D, { variant: "secondary", className: "h-8 w-full sm:w-fit", type: "button", onClick: ya, children: (g == null ? void 0 : g.cancel) ?? "Cancel" }), e(D, { variant: "primary", className: "h-8 w-full sm:w-fit", type: "button", onClick: j, children: (g == null ? void 0 : g.apply) ?? "Apply" })] })] })] })] }) }) })] });
|
|
1249
|
-
},
|
|
1250
|
+
}, Rd = (a, t) => {
|
|
1250
1251
|
const { toYear: r, fromYear: n, fromMonth: s, toMonth: l, fromDay: o, toDay: d } = t;
|
|
1251
1252
|
if (a && a.length > 0) {
|
|
1252
1253
|
const p = n, m = r;
|
|
@@ -1284,10 +1285,10 @@ const jr = (a, t, r) => {
|
|
|
1284
1285
|
}
|
|
1285
1286
|
});
|
|
1286
1287
|
}
|
|
1287
|
-
}, Cn = ({ presets: a, ...t }) => (a &&
|
|
1288
|
+
}, Cn = ({ presets: a, ...t }) => (a && Rd(a, t), e(Fd, { presets: a, ...t }));
|
|
1288
1289
|
Cn.displayName = "DateRangePicker";
|
|
1289
|
-
const
|
|
1290
|
-
function
|
|
1290
|
+
const Bd = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }), Md = { bank_transfer: "Bank transfer", blik: "BLIK", card: "Card", cash_on_delivery: "Cash on delivery", paypal: "PayPal" }, Pd = { delivery: "Delivery", pickup: "Pickup" }, La = ["#0f766e", "#fb923c"], ja = (a) => typeof a == "number" ? a : typeof a == "string" ? Number(a) : Array.isArray(a) && a.length > 0 ? Number(a[0]) : 0;
|
|
1291
|
+
function Qd() {
|
|
1291
1292
|
const { client: a } = I(), t = O(), r = z.useMemo(() => /* @__PURE__ */ new Date(), []), [n, s] = z.useState({ from: Ar(r, 29), to: r }), l = z.useMemo(() => {
|
|
1292
1293
|
const y = (n == null ? void 0 : n.from) ?? Ar(r, 29), x = (n == null ? void 0 : n.to) ?? (n == null ? void 0 : n.from) ?? r;
|
|
1293
1294
|
return { from: Vs(y), to: js(x) };
|
|
@@ -1295,8 +1296,8 @@ function Pd() {
|
|
|
1295
1296
|
const { body: y, status: x } = await a.analytics.getOverview({ params: { organizationId: t }, query: { from: l.from.toISOString(), to: l.to.toISOString() } });
|
|
1296
1297
|
if (x !== 200 || !y) throw new Error("Failed to fetch dashboard overview");
|
|
1297
1298
|
return y;
|
|
1298
|
-
}, placeholderData: me }), g = (o == null ? void 0 : o.summary.currency) ?? "USD", b = ((o == null ? void 0 : o.paymentMethods) ?? []).map((y) => ({ ...y, label:
|
|
1299
|
-
return i("section", { "aria-labelledby": "dashboard-overview", children: [i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between", children: [i("div", { children: [e("h1", { id: "dashboard-overview", className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Overview" }), e("p", { className: "mt-1 text-sm text-gray-600 dark:text-gray-400", children: "Live store performance across orders, reservations, and payment behaviour." })] }), i("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center", children: [h ? e("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Updating…" }) : null, e(Cn, { value: n, onChange: s, className: "w-full sm:w-fit", toDate: r, align: "end" })] })] }), p && !o ? e(ha, { className: "mt-8 border-red-200 dark:border-red-950", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [i("div", { children: [e("h2", { className: "text-base font-semibold text-gray-900 dark:text-gray-50", children: "Dashboard data unavailable" }), e("p", { className: "mt-1 text-sm text-gray-600 dark:text-gray-400", children: d instanceof Error ? d.message : "We could not load the dashboard metrics for this range." })] }), i(D, { onClick: () => u(), className: "gap-2", children: [e(Is, { className: "size-4", "aria-hidden": "true" }), "Retry"] })] }) }) : null, e("div", { className: "mt-8 grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4", children: m && !o ? Array.from({ length: 4 }).map((y, x) => e(xa, { className: "h-[148px]" }, x)) : o ? i(S, { children: [e(Va, { icon: Es, title: "Paid sales", value: ae.currency(o.summary.totalSales, g), description: "Successful payments in the selected range" }), e(Va, { icon: zs, title: "Paid orders", value: ae.unit(o.summary.paidOrders), description: `Average order value ${ae.currency(o.summary.averageOrderValue, g)}` }), e(Va, { icon: Ds, title: "Reservations", value: ae.unit(o.summary.reservations), description: "Scheduled reservations in the selected range" }), e(Va, { icon: Fs, title: "Reserved guests", value: ae.unit(o.summary.guests), description: "Total covers booked from reservations" })] }) : null }), e("div", { className: "mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2", children: m && !o ? i(S, { children: [e(xa, { className: "h-[360px]" }), e(xa, { className: "h-[360px]" })] }) : o ? i(S, { children: [e(Za, { title: "Paid sales by day", value: ae.currency(o.summary.totalSales, g), description: "Gross paid revenue recognised on each order day.", children: e(Ta, { width: "100%", height: "100%", children: i(Hs, { data: o.salesByDay, children: [e("defs", { children: i("linearGradient", { id: "salesGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [e("stop", { offset: "5%", stopColor: "#0f766e", stopOpacity: 0.28 }), e("stop", { offset: "95%", stopColor: "#0f766e", stopOpacity: 0.02 })] }) }), e(It, { strokeDasharray: "3 3", stroke: "#e5e7eb", vertical: !1 }), e(Et, { dataKey: "label", axisLine: !1, tickLine: !1, tick: { fill: "#6b7280", fontSize: 12 } }), e(zt, { axisLine: !1, tickLine: !1, width: 48, tickFormatter: (y) =>
|
|
1299
|
+
}, placeholderData: me }), g = (o == null ? void 0 : o.summary.currency) ?? "USD", b = ((o == null ? void 0 : o.paymentMethods) ?? []).map((y) => ({ ...y, label: Md[y.method] ?? y.method })), f = ((o == null ? void 0 : o.fulfilmentMethods) ?? []).map((y) => ({ ...y, label: Pd[y.method] ?? y.method })), w = f.reduce((y, x) => y + x.count, 0);
|
|
1300
|
+
return i("section", { "aria-labelledby": "dashboard-overview", children: [i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between", children: [i("div", { children: [e("h1", { id: "dashboard-overview", className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Overview" }), e("p", { className: "mt-1 text-sm text-gray-600 dark:text-gray-400", children: "Live store performance across orders, reservations, and payment behaviour." })] }), i("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center", children: [h ? e("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Updating…" }) : null, e(Cn, { value: n, onChange: s, className: "w-full sm:w-fit", toDate: r, align: "end" })] })] }), p && !o ? e(ha, { className: "mt-8 border-red-200 dark:border-red-950", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [i("div", { children: [e("h2", { className: "text-base font-semibold text-gray-900 dark:text-gray-50", children: "Dashboard data unavailable" }), e("p", { className: "mt-1 text-sm text-gray-600 dark:text-gray-400", children: d instanceof Error ? d.message : "We could not load the dashboard metrics for this range." })] }), i(D, { onClick: () => u(), className: "gap-2", children: [e(Is, { className: "size-4", "aria-hidden": "true" }), "Retry"] })] }) }) : null, e("div", { className: "mt-8 grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4", children: m && !o ? Array.from({ length: 4 }).map((y, x) => e(xa, { className: "h-[148px]" }, x)) : o ? i(S, { children: [e(Va, { icon: Es, title: "Paid sales", value: ae.currency(o.summary.totalSales, g), description: "Successful payments in the selected range" }), e(Va, { icon: zs, title: "Paid orders", value: ae.unit(o.summary.paidOrders), description: `Average order value ${ae.currency(o.summary.averageOrderValue, g)}` }), e(Va, { icon: Ds, title: "Reservations", value: ae.unit(o.summary.reservations), description: "Scheduled reservations in the selected range" }), e(Va, { icon: Fs, title: "Reserved guests", value: ae.unit(o.summary.guests), description: "Total covers booked from reservations" })] }) : null }), e("div", { className: "mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2", children: m && !o ? i(S, { children: [e(xa, { className: "h-[360px]" }), e(xa, { className: "h-[360px]" })] }) : o ? i(S, { children: [e(Za, { title: "Paid sales by day", value: ae.currency(o.summary.totalSales, g), description: "Gross paid revenue recognised on each order day.", children: e(Ta, { width: "100%", height: "100%", children: i(Hs, { data: o.salesByDay, children: [e("defs", { children: i("linearGradient", { id: "salesGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [e("stop", { offset: "5%", stopColor: "#0f766e", stopOpacity: 0.28 }), e("stop", { offset: "95%", stopColor: "#0f766e", stopOpacity: 0.02 })] }) }), e(It, { strokeDasharray: "3 3", stroke: "#e5e7eb", vertical: !1 }), e(Et, { dataKey: "label", axisLine: !1, tickLine: !1, tick: { fill: "#6b7280", fontSize: 12 } }), e(zt, { axisLine: !1, tickLine: !1, width: 48, tickFormatter: (y) => Bd.format(y), tick: { fill: "#6b7280", fontSize: 12 } }), e(Ja, { formatter: (y, x) => {
|
|
1300
1301
|
const v = ja(y);
|
|
1301
1302
|
return [String(x) === "totalSales" ? ae.currency(v, g) : ae.unit(v), String(x) === "totalSales" ? "Sales" : "Paid orders"];
|
|
1302
1303
|
}, contentStyle: Ha, labelStyle: Ua }), e(Us, { type: "monotone", dataKey: "totalSales", stroke: "#0f766e", strokeWidth: 2.5, fill: "url(#salesGradient)", name: "totalSales" })] }) }) }), e(Za, { title: "Reservations per day", value: ae.unit(o.summary.reservations), description: "Bookings are grouped by reservation date, not submission time.", children: e(Ta, { width: "100%", height: "100%", children: i(Cr, { data: o.reservationsByDay, children: [e(It, { strokeDasharray: "3 3", stroke: "#e5e7eb", vertical: !1 }), e(Et, { dataKey: "label", axisLine: !1, tickLine: !1, tick: { fill: "#6b7280", fontSize: 12 } }), e(zt, { allowDecimals: !1, axisLine: !1, tickLine: !1, width: 36, tick: { fill: "#6b7280", fontSize: 12 } }), e(Ja, { formatter: (y, x) => [ae.unit(ja(y)), String(x) === "guests" ? "Guests" : "Reservations"], contentStyle: Ha, labelStyle: Ua }), e(Sr, { dataKey: "reservations", name: "reservations", fill: "#fb923c", radius: [8, 8, 0, 0] })] }) }) })] }) : null }), e("div", { className: "mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2", children: m && !o ? i(S, { children: [e(xa, { className: "h-[320px]" }), e(xa, { className: "h-[320px]" })] }) : o ? i(S, { children: [e(Za, { title: "Payment methods", value: ae.unit(b.reduce((y, x) => y + x.count, 0)), description: "Successful orders grouped by how guests paid.", children: b.length > 0 ? e(Ta, { width: "100%", height: "100%", children: i(Cr, { data: b, layout: "vertical", margin: { left: 12, right: 12 }, children: [e(It, { strokeDasharray: "3 3", stroke: "#e5e7eb", horizontal: !1 }), e(Et, { type: "number", allowDecimals: !1, axisLine: !1, tickLine: !1, tick: { fill: "#6b7280", fontSize: 12 } }), e(zt, { dataKey: "label", type: "category", axisLine: !1, tickLine: !1, width: 110, tick: { fill: "#374151", fontSize: 12 } }), e(Ja, { formatter: (y, x, v) => {
|
|
@@ -1359,28 +1360,28 @@ const mr = A.forwardRef((a, t) => e(J.Empty, { ref: t, className: "py-6 text-cen
|
|
|
1359
1360
|
mr.displayName = J.Empty.displayName;
|
|
1360
1361
|
const ur = A.forwardRef(({ className: a, ...t }, r) => e(J.Group, { ref: r, className: k("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", a), ...t }));
|
|
1361
1362
|
ur.displayName = J.Group.displayName;
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1363
|
+
const Td = A.forwardRef(({ className: a, ...t }, r) => e(J.Separator, { ref: r, className: k("-mx-1 h-px bg-border", a), ...t }));
|
|
1364
|
+
Td.displayName = J.Separator.displayName;
|
|
1364
1365
|
const pr = A.forwardRef(({ className: a, ...t }, r) => e(J.Item, { ref: r, className: k("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", a), ...t }));
|
|
1365
1366
|
pr.displayName = J.Item.displayName;
|
|
1366
1367
|
const hr = (a) => e(U.Root, { ...a });
|
|
1367
1368
|
hr.displayName = "Popover";
|
|
1368
1369
|
const gr = A.forwardRef((a, t) => e(U.Trigger, { ref: t, ...a }));
|
|
1369
1370
|
gr.displayName = "PopoverTrigger";
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1371
|
+
const Jd = A.forwardRef((a, t) => e(U.Anchor, { ref: t, ...a }));
|
|
1372
|
+
Jd.displayName = "PopoverAnchor";
|
|
1373
|
+
const Od = A.forwardRef((a, t) => e(U.Close, { ref: t, ...a }));
|
|
1374
|
+
Od.displayName = "PopoverClose";
|
|
1374
1375
|
const fr = A.forwardRef(({ className: a, sideOffset: t = 10, side: r = "bottom", align: n = "center", collisionPadding: s, ...l }, o) => e(U.Portal, { children: e(U.Content, { ref: o, sideOffset: t, side: r, align: n, collisionPadding: s, avoidCollisions: !0, className: _("max-h-[var(--radix-popper-available-height)] min-w-60 overflow-hidden rounded-md border p-2.5 text-sm shadow-md", "border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[state=open]:data-[side=bottom]:animate-slideDownAndFade data-[state=open]:data-[side=left]:animate-slideLeftAndFade data-[state=open]:data-[side=right]:animate-slideRightAndFade data-[state=open]:data-[side=top]:animate-slideUpAndFade", a), onWheel: (d) => {
|
|
1375
1376
|
d.stopPropagation(), d.deltaY > 0 ? d.currentTarget.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowDown" })) : d.currentTarget.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowUp" }));
|
|
1376
1377
|
}, ...l }) }));
|
|
1377
1378
|
fr.displayName = "PopoverContent";
|
|
1378
|
-
const
|
|
1379
|
+
const Ld = ({ value: a, onChange: t }) => {
|
|
1379
1380
|
const r = ze(), [n, s] = F(!1), l = Zr.map((o) => o.items.find((d) => d.value === a)).filter(Boolean)[0];
|
|
1380
|
-
return e("div", { className: "mt-2", children: i(hr, { open: n, onOpenChange: s, children: [e(gr, { asChild: !0, children: i(D, { id: r, role: "combobox", "aria-expanded": n, variant: "secondary", className: "w-full justify-between shadow-xs! bg-background px-3 py-2.5 font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20", children: [a ? i("span", { className: "flex min-w-0 items-center gap-2", children: [e("span", { className: "text-lg leading-none", children: l == null ? void 0 : l.flag }), e("span", { className: "truncate", children: l == null ? void 0 : l.label })] }) : e("span", { className: "text-muted-foreground", children: "Select country" }), e(
|
|
1381
|
+
return e("div", { className: "mt-2", children: i(hr, { open: n, onOpenChange: s, children: [e(gr, { asChild: !0, children: i(D, { id: r, role: "combobox", "aria-expanded": n, variant: "secondary", className: "w-full justify-between shadow-xs! bg-background px-3 py-2.5 font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20", children: [a ? i("span", { className: "flex min-w-0 items-center gap-2", children: [e("span", { className: "text-lg leading-none", children: l == null ? void 0 : l.flag }), e("span", { className: "truncate", children: l == null ? void 0 : l.label })] }) : e("span", { className: "text-muted-foreground", children: "Select country" }), e(ta, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(fr, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50", align: "start", children: i(or, { className: "p-0", children: [e(dr, { className: "w-full border-none", style: { boxShadow: "none" }, placeholder: "Search country..." }), i(cr, { children: [e(mr, { children: "No country found." }), Zr.map((o) => e(la, { children: e(ur, { heading: o.continent, children: o.items.map((d) => i(pr, { value: d.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => {
|
|
1381
1382
|
t(d.value ?? ""), s(!1);
|
|
1382
1383
|
}, children: [e("span", { className: "text-lg leading-none", children: d.flag }), " ", d.label, a === d.value && e(Aa, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, d.value)) }) }, o.continent))] })] }) })] }) });
|
|
1383
|
-
},
|
|
1384
|
+
}, jd = Te({ base: ["relative block w-full rounded-lg border px-2.5 py-2.5 shadow-xs outline-hidden transition sm:text-sm", "border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "bg-white dark:bg-gray-950", "disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-700 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", Ra], variants: { hasError: { true: sr }, enableStepper: { false: "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none" }, multiline: { true: "resize-y min-h-[100px]", false: "truncate appearance-none" } } }), ce = z.forwardRef(({ className: a, inputClassName: t, hasError: r, enableStepper: n = !0, type: s, multiline: l = !1, prefix: o, suffix: d, copyValue: p, copySuccessMessage: m = "Copied to clipboard.", copyErrorMessage: h = "Failed to copy to clipboard. Please try again.", ...u }, g) => {
|
|
1384
1385
|
const [b, f] = z.useState(s), [w, y] = z.useState(!1), x = s === "password" && !l, v = s === "search" && !l, N = !!p, C = s === "textarea" ? "textarea" : "input", K = async () => {
|
|
1385
1386
|
if (p) try {
|
|
1386
1387
|
y(!0), await navigator.clipboard.writeText(p), Q.success(m);
|
|
@@ -1390,13 +1391,13 @@ const Od = ({ value: a, onChange: t }) => {
|
|
|
1390
1391
|
y(!1);
|
|
1391
1392
|
}
|
|
1392
1393
|
};
|
|
1393
|
-
return i("div", { className: k("relative w-full", a), children: [o && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: o }), e(C, { ref: g, type: x ? b : s, className: k(
|
|
1394
|
+
return i("div", { className: k("relative w-full", a), children: [o && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: o }), e(C, { ref: g, type: x ? b : s, className: k(jd({ hasError: r, enableStepper: l ? !1 : n, multiline: l }), { "pl-16": o, "pl-8": !o && v, "pr-24": N, "pr-10": !N && (d || !d && x) }, t), ...u }), !o && v && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2 text-gray-400 dark:text-gray-600", children: e(Lt, { className: "size-[1.125rem]" }) }), N && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-1.5", children: i(D, { type: "button", variant: "ghost", onClick: K, isLoading: w, loadingText: "Copying...", className: "h-8 cursor-pointer px-2 text-xs hover:text-gray-600 dark:hover:bg-gray-800", children: [e(hs, { className: "size-4", "aria-hidden": "true" }), e("span", { className: "sr-only", children: "Copy value" })] }) }), !N && d && e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400 dark:text-gray-600", children: d }), !N && !d && x && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: e("button", { onClick: () => f(b === "password" ? "text" : "password"), className: k(he, "text-gray-400 hover:text-gray-500 dark:text-gray-600"), children: b === "password" ? e(hi, { className: "size-5" }) : e(gi, { className: "size-5" }) }) })] });
|
|
1394
1395
|
});
|
|
1395
1396
|
ce.displayName = "Input";
|
|
1396
|
-
const
|
|
1397
|
+
const Vd = ({ ...a }) => {
|
|
1397
1398
|
const t = ze();
|
|
1398
1399
|
return e("div", { className: "mt-2", children: i("div", { className: "relative", children: [e(ce, { id: t, type: "email", inputClassName: "peer ps-9", ...a }), e("div", { className: "pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-muted-foreground/80 peer-disabled:opacity-50", children: e(gs, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })] }) });
|
|
1399
|
-
},
|
|
1400
|
+
}, Zd = (a) => {
|
|
1400
1401
|
const { client: t } = I(), [r, n] = F(!1), [s, l] = F(0), o = async (m) => {
|
|
1401
1402
|
const { body: h, status: u } = await t.file.createTemporaryFile({ body: { filename: m.name, mimeType: m.type, size: m.size, organizationId: a.organizationId } });
|
|
1402
1403
|
if (u !== 201) throw new Error("Failed to create temporary file");
|
|
@@ -1436,15 +1437,15 @@ const jd = ({ ...a }) => {
|
|
|
1436
1437
|
})() });
|
|
1437
1438
|
}, Fn = Wr(({ ...a }, t) => e(ce, { ...a, inputClassName: "border-l-0 rounded-l-none", ref: t, className: "" }));
|
|
1438
1439
|
Fn.displayName = "PhoneInput";
|
|
1439
|
-
const
|
|
1440
|
+
const Hd = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { className: "relative inline-flex items-center self-stretch rounded-s-lg border border-gray-200 dark:border-gray-800 bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-hidden focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-disabled:pointer-events-none has-disabled:opacity-50", children: [i("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [e(Rn, { country: t, countryName: t, "aria-hidden": "true" }), e("span", { className: "text-muted-foreground/80", children: e(ta, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })] }), i("select", { disabled: a, value: t, onChange: (s) => {
|
|
1440
1441
|
r(s.target.value);
|
|
1441
1442
|
}, className: "absolute inset-0 text-sm opacity-0", "aria-label": "Select country", children: [e("option", { value: "", children: "Select a country" }, "default"), n.filter((s) => s.value).map((s, l) => i("option", { value: s.value, children: [s.label, " ", s.value && `+${dt.getCountryCallingCode(s.value)}`] }, s.value ?? `empty-${l}`))] })] }), Rn = ({ country: a, countryName: t }) => {
|
|
1442
1443
|
const r = Ci[a];
|
|
1443
1444
|
return e("span", { className: "w-5 overflow-hidden rounded-sm", children: r ? e(r, { title: t }) : e(Xr, { size: 16, "aria-hidden": "true" }) });
|
|
1444
|
-
},
|
|
1445
|
+
}, Ud = ({ value: a, onChange: t, onBlur: r }) => {
|
|
1445
1446
|
const n = ze();
|
|
1446
|
-
return e("div", { className: "mt-2", children: e(dt.default, { id: n, className: "flex rounded-lg shadow-xs shadow-black/5", international: !0, flagComponent: Rn, countrySelectComponent:
|
|
1447
|
-
},
|
|
1447
|
+
return e("div", { className: "mt-2", children: e(dt.default, { id: n, className: "flex rounded-lg shadow-xs shadow-black/5", international: !0, flagComponent: Rn, countrySelectComponent: Hd, inputComponent: Fn, placeholder: "Enter phone number", value: a, onChange: (s) => t(s ?? ""), onBlur: r }) });
|
|
1448
|
+
}, qd = ({ options: a, value: t, onChange: r, multiple: n = !1, placeholder: s }) => {
|
|
1448
1449
|
var h;
|
|
1449
1450
|
const l = ze(), [o, d] = F(!1), p = (u) => {
|
|
1450
1451
|
if (n) {
|
|
@@ -1462,27 +1463,27 @@ const Zd = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { cl
|
|
|
1462
1463
|
return g ? i("span", { className: "animate-fadeIn relative inline-flex cursor-default items-center rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-secondary-foreground transition-all hover:bg-background disabled:cursor-not-allowed disabled:opacity-50", children: [g.label, e(Ca, { size: 12, onClick: (b) => {
|
|
1463
1464
|
b.preventDefault(), m(u);
|
|
1464
1465
|
}, className: "cursor-pointer ml-1" })] }, u) : null;
|
|
1465
|
-
}) : e("span", { className: "px-1 text-sm", children: (h = a.find((u) => u.value === t)) == null ? void 0 : h.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(
|
|
1466
|
-
},
|
|
1467
|
-
const { root: s, thumb: l } =
|
|
1466
|
+
}) : e("span", { className: "px-1 text-sm", children: (h = a.find((u) => u.value === t)) == null ? void 0 : h.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(ta, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(fr, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: i(or, { className: "p-0", children: [e(dr, { className: "w-full border-none pl-0", style: { boxShadow: "none" }, placeholder: "Search..." }), i(cr, { children: [e(mr, { children: "No options found." }), e(ur, { children: a.map((u) => i(pr, { value: u.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => p(u.value), children: [u.label, (n ? t.includes(u.value) : t === u.value) && e(Aa, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, u.value)) })] })] }) })] }) });
|
|
1467
|
+
}, Wd = Te({ slots: { root: ["group relative isolate inline-flex shrink-0 cursor-pointer items-center rounded-full p-0.5 shadow-inner outline-hidden ring-1 ring-inset transition-all", "bg-gray-200 dark:bg-gray-950", "ring-black/5 dark:ring-gray-800", "data-[state=checked]:bg-blue-600 dark:data-[state=checked]:bg-blue-600", "data-disabled:cursor-default", "data-disabled:data-[state=checked]:bg-blue-200", "data-disabled:data-[state=checked]:ring-gray-300", "dark:data-disabled:data-[state=checked]:ring-gray-900", "dark:data-disabled:data-[state=checked]:bg-blue-900", "data-disabled:data-[state=unchecked]:ring-gray-300", "data-disabled:data-[state=unchecked]:bg-gray-100", "dark:data-disabled:data-[state=unchecked]:ring-gray-700", "dark:data-disabled:data-[state=unchecked]:bg-gray-800", he], thumb: ["pointer-events-none relative inline-block transform appearance-none rounded-full border-none shadow-lg outline-hidden transition-all duration-150 ease-in-out focus:border-none focus:outline-hidden focus:outline-transparent", "bg-white dark:bg-gray-50", "group-data-disabled:shadow-none", "group-data-disabled:bg-gray-50 dark:group-data-disabled:bg-gray-500"] }, variants: { size: { default: { root: "h-7 w-14", thumb: "h-4 w-4 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0" }, small: { root: "h-4 w-7", thumb: "h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0" } } }, defaultVariants: { size: "default" } }), Bn = z.forwardRef(({ className: a, size: t, ...r }, n) => {
|
|
1468
|
+
const { root: s, thumb: l } = Wd({ size: t });
|
|
1468
1469
|
return e(Ka.Root, { ref: n, className: k(s(), a), ...r, children: e(Ka.Thumb, { className: k(l()) }) });
|
|
1469
1470
|
});
|
|
1470
1471
|
Bn.displayName = "Switch";
|
|
1471
|
-
const
|
|
1472
|
+
const _d = ({ name: a, type: t, placeholder: r, multiple: n, options: s, prefix: l }) => {
|
|
1472
1473
|
const { watch: o, register: d, setFocus: p, setValue: m } = Kr();
|
|
1473
1474
|
switch (t) {
|
|
1474
1475
|
case "email":
|
|
1475
|
-
return e(
|
|
1476
|
+
return e(Vd, { ...d(a), placeholder: r });
|
|
1476
1477
|
case "file":
|
|
1477
|
-
return e(
|
|
1478
|
+
return e(Zd, { value: o(a), multiple: n, onChange: (h) => m(a, h) });
|
|
1478
1479
|
case "phone-number":
|
|
1479
|
-
return e(
|
|
1480
|
+
return e(Ud, { value: o("phone"), onChange: (h) => m("phone", h), onBlur: () => p("phone") });
|
|
1480
1481
|
case "country":
|
|
1481
|
-
return e(
|
|
1482
|
+
return e(Ld, { value: o(a), onChange: (h) => m(a, h) });
|
|
1482
1483
|
case "select": {
|
|
1483
1484
|
const h = n ? o(a) || [] : o(a) || "";
|
|
1484
1485
|
if (!s) throw new Error("Options are required for select input");
|
|
1485
|
-
return e(
|
|
1486
|
+
return e(qd, { options: s, value: h, onChange: (u) => m(a, u), placeholder: r, multiple: n });
|
|
1486
1487
|
}
|
|
1487
1488
|
case "switch":
|
|
1488
1489
|
return e(Bn, { size: "default", className: "mr-2", checked: o(a), onCheckedChange: (h) => m(a, h) });
|
|
@@ -1493,24 +1494,24 @@ const Wd = ({ name: a, type: t, placeholder: r, multiple: n, options: s, prefix:
|
|
|
1493
1494
|
}
|
|
1494
1495
|
}, be = A.forwardRef(({ className: a, disabled: t, ...r }, n) => e(Si.Root, { ref: n, className: _("text-sm leading-none", "text-gray-900 dark:text-gray-50", { "text-gray-400 dark:text-gray-600": t }, a), "aria-disabled": t, ...r }));
|
|
1495
1496
|
be.displayName = "Label";
|
|
1496
|
-
const
|
|
1497
|
+
const Gd = (a, t) => !a || typeof a != "object" ? void 0 : t ? t.replace(/\[/g, ".").replace(/\]/g, "").split(".").filter(Boolean).reduce((r, n) => {
|
|
1497
1498
|
if (r != null) return r[n];
|
|
1498
1499
|
}, a) : a, Ce = ({ type: a = "text", name: t, label: r, className: n, locale: s, placeholder: l, multiple: o, options: d, localizable: p, prefix: m }) => {
|
|
1499
|
-
const { errors: h } = tt(), u =
|
|
1500
|
-
return i("div", { className: k("w-full", { "flex items-center flex-row-reverse justify-end": a === "switch" }, n), children: [typeof r == "string" && i(be, { htmlFor: t, className: "font-medium flex items-center justify-between", children: [i("span", { className: "flex items-center", children: [r, p && e(Yr, { className: "w-4 h-4 ml-1 text-gray-500" })] }), s && p && i("span", { className: "flex items-center text-xs text-gray-500 ml-1 bg-gray-100 px-1 py-0.5 rounded", children: [ut.get(s), " (", s, ")"] })] }), e(
|
|
1501
|
-
},
|
|
1500
|
+
const { errors: h } = tt(), u = Gd(h, t);
|
|
1501
|
+
return i("div", { className: k("w-full", { "flex items-center flex-row-reverse justify-end": a === "switch" }, n), children: [typeof r == "string" && i(be, { htmlFor: t, className: "font-medium flex items-center justify-between", children: [i("span", { className: "flex items-center", children: [r, p && e(Yr, { className: "w-4 h-4 ml-1 text-gray-500" })] }), s && p && i("span", { className: "flex items-center text-xs text-gray-500 ml-1 bg-gray-100 px-1 py-0.5 rounded", children: [ut.get(s), " (", s, ")"] })] }), e(_d, { type: a, name: t, placeholder: l, options: d, multiple: o, prefix: m }), (u == null ? void 0 : u.message) && e("p", { className: "mt-1 text-sm text-red-500", children: u.message })] });
|
|
1502
|
+
}, $d = ({ form: a, config: t, columns: r = 2 }) => {
|
|
1502
1503
|
var p;
|
|
1503
1504
|
const { errors: n } = tt(), s = Sn(n, t.name), { fields: l, append: o, remove: d } = Tt({ control: a.control, name: t.name });
|
|
1504
1505
|
return (p = t.fields) != null && p.length ? e(S, { children: i("div", { className: "w-full col-span-full", children: [t.label && e("h4", { className: "text-2xl flex items-center justify-between font-semibold", children: t.label }), t.description && e("p", { className: "text-sm text-gray-500", children: t.description }), l.map((m, h) => {
|
|
1505
1506
|
var u;
|
|
1506
1507
|
return i(S, { children: [e("div", { className: k("grid gap-5 w-full border-l-[8px] border-blue-500 pl-5 py-3 mt-6", { "grid-cols-1": r === 1, "grid-cols-2": r === 2, "grid-cols-3": r === 3, "grid-cols-4": r === 4 }), children: (u = t.fields) == null ? void 0 : u.map(({ name: g, label: b, type: f, colspan: w, localizable: y, multiple: x, options: v, placeholder: N, prefix: C }) => e(Ce, { name: `${t.name}[${h}].${g}`, label: b, type: f ?? "text", localizable: y, className: k({ "col-span-1": w === 1, "col-span-2": w === 2, "col-span-3": w === 3, "col-span-4": w === 4 }), placeholder: N, multiple: x, options: v, prefix: C }, t.name + g)) }, m.id), h < l.length - 1 && e(L, {})] });
|
|
1507
1508
|
}), i("div", { className: "flex justify-end space-x-3", children: [i("button", { type: "button", 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", onClick: () => o({}), children: [e(fs, { className: "w-4 h-4 text-blue-500" }), "Add New"] }), l.length > 1 && i("button", { type: "button", 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", onClick: () => d(l.length - 1), children: [e(ys, { className: "w-4 h-4 text-red-500" }), "Remove"] })] }), (s == null ? void 0 : s.message) && e("p", { className: "mt-1 text-sm text-red-500", children: s.message })] }) }) : null;
|
|
1508
|
-
},
|
|
1509
|
+
}, Kd = ({ config: a, columns: t = 2 }) => {
|
|
1509
1510
|
var s;
|
|
1510
1511
|
const { errors: r } = tt(), n = Sn(r, a.name);
|
|
1511
1512
|
return (s = a.fields) != null && s.length ? i("div", { className: "w-full col-span-full", children: [a.label && e("h4", { className: "text-2xl font-semibold mb-2", children: a.label }), a.description && e("p", { className: "text-sm text-gray-500 mb-3", children: a.description }), e("div", { className: k("grid gap-5", { "grid-cols-1": t === 1, "grid-cols-2": t === 2, "grid-cols-3": t === 3, "grid-cols-4": t === 4 }), children: a.fields.map(({ name: l, label: o, type: d, colspan: p, localizable: m, multiple: h, options: u, placeholder: g, prefix: b }) => e(Ce, { name: `${a.name}.${l}`, label: o, type: d ?? "text", localizable: m, className: k({ "col-span-1": p === 1, "col-span-2": p === 2, "col-span-3": p === 3, "col-span-4": p === 4 }), placeholder: g, multiple: h, options: u, prefix: b }, `${a.name}.${l}`)) }), (n == null ? void 0 : n.message) && e("p", { className: "mt-1 text-sm text-red-500", children: n.message })] }) : null;
|
|
1512
1513
|
};
|
|
1513
|
-
function
|
|
1514
|
+
function Xd(a, t) {
|
|
1514
1515
|
const { asChild: r, children: n } = a;
|
|
1515
1516
|
if (!r) return typeof t == "function" ? t(n) : t;
|
|
1516
1517
|
const s = z.Children.only(n);
|
|
@@ -1519,7 +1520,7 @@ function Kd(a, t) {
|
|
|
1519
1520
|
const yr = z.forwardRef(({ className: a, children: t, ...r }, n) => e(Xa.Root, { ref: n, ...r, asChild: !1, children: e(Xa.List, { className: k("flex items-center justify-start whitespace-nowrap border-b [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", "border-gray-200 dark:border-gray-800", a), children: t }) }));
|
|
1520
1521
|
yr.displayName = "TabNavigation";
|
|
1521
1522
|
const br = z.forwardRef(({ asChild: a, disabled: t, className: r, children: n, ...s }, l) => e(Xa.Item, { className: "flex", "aria-disabled": t, children: e(Xa.Link, { "aria-disabled": t, className: k("group relative flex shrink-0 select-none items-center justify-center", t ? "pointer-events-none" : ""), ref: l, onSelect: () => {
|
|
1522
|
-
}, asChild: a, ...s, children:
|
|
1523
|
+
}, asChild: a, ...s, children: Xd({ asChild: a, children: n }, (o) => e("span", { className: k("-mb-px flex items-center justify-center whitespace-nowrap border-b-2 border-transparent px-3 pb-2 text-sm font-medium transition-all", "text-gray-500 dark:text-gray-500", "group-hover:text-gray-700 dark:group-hover:text-gray-400", "group-hover:border-gray-300 dark:group-hover:border-gray-400", "group-data-active:border-blue-600 group-data-active:text-blue-600", "dark:group-data-active:border-blue-500 dark:group-data-active:text-blue-500", t ? "pointer-events-none text-gray-300 dark:text-gray-700" : "", he, r), children: o })) }) }));
|
|
1523
1524
|
br.displayName = "TabNavigationLink";
|
|
1524
1525
|
const Ie = ({ form: a, okText: t, config: r, loading: n, onCancel: s, cancelText: l, columns: o = 2, onSubmit: d }) => {
|
|
1525
1526
|
const p = a.watch("translations"), { organization: m, defaultLocale: h, supportedLocales: u } = ge(), [g, b] = F(), f = ke(() => r.some((y) => y.localizable), [r]);
|
|
@@ -1533,10 +1534,10 @@ const Ie = ({ form: a, okText: t, config: r, loading: n, onCancel: s, cancelText
|
|
|
1533
1534
|
return e(br, { active: y === g, onClick: () => b(y), className: "cursor-pointer", children: i(S, { children: [ut.get(y), " ", x && "(Default)"] }) }, y);
|
|
1534
1535
|
}) }) }), r.map((y) => {
|
|
1535
1536
|
const { name: x, label: v, type: N, colspan: C, localizable: K, multiple: oe, options: de, placeholder: ne, prefix: ee } = y, B = !K || !g ? x : `translations[${u == null ? void 0 : u.indexOf(g)}].${x}`;
|
|
1536
|
-
return N === "object" ? e(
|
|
1537
|
+
return N === "object" ? e(Kd, { config: y }, x) : N === "array" ? e($d, { form: a, config: y }, x) : e(Ce, { name: B, label: v, type: N ?? "text", localizable: K, className: _({ "col-span-1": C === 1, "col-span-2": C === 2, "col-span-3": C === 3, "col-span-4": C === 4 }), placeholder: ne, multiple: oe, options: de, locale: g, prefix: ee }, B);
|
|
1537
1538
|
}), d && i("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6 col-span-full border-t pt-7", children: [s && e(D, { type: "button", className: "w-full sm:w-fit", variant: "secondary", onClick: s, children: l ?? "Cancel" }), e(D, { type: "submit", className: "w-full sm:w-fit", isLoading: n, loadingText: "Saving...", children: t ?? "Save Data" })] })] });
|
|
1538
1539
|
return d ? e(Ve, { ...a, children: e("form", { onSubmit: a.handleSubmit((y) => d(y)), children: w }) }) : e("div", { className: "w-full", children: w });
|
|
1539
|
-
},
|
|
1540
|
+
}, Yd = [{ name: "name", label: "Manufacturer Name", type: "text", placeholder: "Acme Inc.", colspan: 2 }, { name: "about", label: "About", type: "textarea", placeholder: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", colspan: 2, localizable: !0 }, { name: "logo", label: "Logo", type: "file" }], Mn = ({ initialData: a }) => {
|
|
1540
1541
|
const { client: t } = I(), r = G(), n = $(), s = O(), { defaultLocale: l, supportedLocales: o } = ge(), d = se({ resolver: le(a ? Yl : Xl), defaultValues: a ? { defaultLocale: l, name: a.name, logo: a.logo, translations: a.translations } : { defaultLocale: l, translations: o.map((u) => ({ locale: u })) } }), p = T({ mutationFn: async (u) => {
|
|
1541
1542
|
var f;
|
|
1542
1543
|
const g = { name: u.name, defaultLocale: u.defaultLocale, translations: u.translations, logoId: (f = u.logo) == null ? void 0 : f.id }, { status: b } = await t.manufacturer.createManufacturer({ params: { organizationId: s }, body: g });
|
|
@@ -1548,14 +1549,14 @@ const Ie = ({ form: a, okText: t, config: r, loading: n, onCancel: s, cancelText
|
|
|
1548
1549
|
} }), h = async () => {
|
|
1549
1550
|
Q.success("Manufacturer saved successfully"), r.push(n.manufacturers(s)), await te.invalidateQueries({ queryKey: ["manufacturers"] });
|
|
1550
1551
|
};
|
|
1551
|
-
return e(Ie, { form: d, config:
|
|
1552
|
+
return e(Ie, { form: d, config: Yd, onSubmit: (u) => {
|
|
1552
1553
|
a ? m.mutate(u, { onSuccess: h }) : p.mutate(u, { onSuccess: h });
|
|
1553
1554
|
}, loading: p.isPending || m.isPending, cancelText: "Go back", okText: a ? "Update Manufacturer" : "Create Manufacturer" });
|
|
1554
1555
|
};
|
|
1555
|
-
function
|
|
1556
|
+
function ec() {
|
|
1556
1557
|
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Manufacturer" }), e(L, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "manufacturer-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "manufacturer-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Manufacturer Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the manufacturer." })] }), e("div", { className: "md:col-span-2", children: e(Mn, {}) })] }) }) }) })] });
|
|
1557
1558
|
}
|
|
1558
|
-
function
|
|
1559
|
+
function ac() {
|
|
1559
1560
|
const a = O(), t = Ba(), { client: r } = I(), { isLoading: n, data: s } = M({ queryKey: ["manufacturers", a, t], queryFn: async () => {
|
|
1560
1561
|
const { status: l, body: o } = await r.manufacturer.getManufacturer({ params: { id: t, organizationId: a } });
|
|
1561
1562
|
if (l !== 200) throw Q.error("Failed to fetch manufacturer. Please refresh or try again later."), new Error("Failed to fetch manufacturer");
|
|
@@ -1563,25 +1564,25 @@ function ec() {
|
|
|
1563
1564
|
}, throwOnError: !0, placeholderData: me });
|
|
1564
1565
|
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Manufacturer" }), e(L, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "manufacturer-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "manufacturer-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Manufacturer Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the manufacturer." })] }), e("div", { className: "md:col-span-2", children: n || !s ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(ie, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(Mn, { initialData: s }) })] }) }) }) })] });
|
|
1565
1566
|
}
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1567
|
+
const tc = z.forwardRef(({ className: a, children: t, ...r }, n) => e("div", { ref: n, children: e("div", { className: _("w-full overflow-auto whitespace-nowrap", a), ...r, children: t }) }));
|
|
1568
|
+
tc.displayName = "TableRoot";
|
|
1568
1569
|
const xr = z.forwardRef(({ className: a, ...t }, r) => e("table", { ref: r, className: _("w-full caption-bottom border-b", "border-gray-200 dark:border-gray-800", a), ...t }));
|
|
1569
1570
|
xr.displayName = "Table";
|
|
1570
1571
|
const wr = z.forwardRef(({ className: a, ...t }, r) => e("thead", { ref: r, className: _(a), ...t }));
|
|
1571
1572
|
wr.displayName = "TableHead";
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1573
|
+
const Xe = z.forwardRef(({ className: a, ...t }, r) => e("th", { ref: r, className: _("border-b px-4 py-3.5 text-left text-sm font-semibold", "text-gray-900 dark:text-gray-50", "border-gray-200 dark:border-gray-800", a), ...t }));
|
|
1574
|
+
Xe.displayName = "TableHeaderCell";
|
|
1574
1575
|
const kr = z.forwardRef(({ className: a, ...t }, r) => e("tbody", { ref: r, className: _("divide-y", "divide-gray-200 dark:divide-gray-800", a), ...t }));
|
|
1575
1576
|
kr.displayName = "TableBody";
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1577
|
+
const ea = z.forwardRef(({ className: a, ...t }, r) => e("tr", { ref: r, className: _("[&_td:last-child]:pr-4 [&_th:last-child]:pr-4", "[&_td:first-child]:pl-4 [&_th:first-child]:pl-4", a), ...t }));
|
|
1578
|
+
ea.displayName = "TableRow";
|
|
1578
1579
|
const Be = z.forwardRef(({ className: a, ...t }, r) => e("td", { ref: r, className: _("p-4 text-sm", "text-gray-600 dark:text-gray-400", a), ...t }));
|
|
1579
1580
|
Be.displayName = "TableCell";
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
const
|
|
1581
|
+
const rc = z.forwardRef(({ className: a, ...t }, r) => e("tfoot", { ref: r, className: _("border-t text-left font-medium", "text-gray-900 dark:text-gray-50", "border-gray-200 dark:border-gray-800", a), ...t }));
|
|
1582
|
+
rc.displayName = "TableFoot";
|
|
1583
|
+
const ic = z.forwardRef(({ className: a, ...t }, r) => e("caption", { ref: r, className: _("mt-3 px-3 text-center text-sm", "text-gray-500 dark:text-gray-500", a), ...t }));
|
|
1584
|
+
ic.displayName = "TableCaption";
|
|
1585
|
+
const nc = k("hidden h-6 select-none items-center justify-center rounded-md bg-gray-800 px-2 font-mono text-xs text-gray-400 ring-1 ring-inset ring-gray-700 transition sm:flex"), Pn = ({ open: a = !1, onOpenChange: t, defaultOpen: r = !1, disableAutoFocus: n = !0, children: s }) => i(U.Root, { open: a, onOpenChange: t, defaultOpen: r, children: [e(U.Anchor, { className: k("fixed inset-x-0 bottom-8 mx-auto flex w-fit items-center") }), e(U.Portal, { children: e(U.Content, { side: "top", sideOffset: 0, onOpenAutoFocus: (l) => {
|
|
1585
1586
|
n && l.preventDefault();
|
|
1586
1587
|
}, className: k("z-50", "data-[state=closed]:animate-hide", "data-[side=top]:animate-slideUpAndFade"), children: s }) })] });
|
|
1587
1588
|
Pn.displayName = "CommandBar";
|
|
@@ -1598,9 +1599,9 @@ const Wa = A.forwardRef(({ className: a, type: t = "button", label: r, action: n
|
|
|
1598
1599
|
return l || document.addEventListener("keydown", p), () => {
|
|
1599
1600
|
document.removeEventListener("keydown", p);
|
|
1600
1601
|
};
|
|
1601
|
-
}, [n, s, l]), e("span", { className: k("flex items-center gap-x-2 rounded-lg bg-gray-900 p-1 text-base font-medium text-gray-50 outline-hidden transition focus:z-10 sm:text-sm", "sm:last-of-type:-mr-1", a), children: i("button", { ref: d, type: t, onClick: n, disabled: l, className: k("flex items-center gap-x-2 rounded-md px-1 py-1 hover:bg-gray-800", "focus-visible:bg-gray-800 focus-visible:hover:bg-gray-800", "disabled:text-gray-500", he), ...o, children: [e("span", { children: r }), e("span", { className:
|
|
1602
|
+
}, [n, s, l]), e("span", { className: k("flex items-center gap-x-2 rounded-lg bg-gray-900 p-1 text-base font-medium text-gray-50 outline-hidden transition focus:z-10 sm:text-sm", "sm:last-of-type:-mr-1", a), children: i("button", { ref: d, type: t, onClick: n, disabled: l, className: k("flex items-center gap-x-2 rounded-md px-1 py-1 hover:bg-gray-800", "focus-visible:bg-gray-800 focus-visible:hover:bg-gray-800", "disabled:text-gray-500", he), ...o, children: [e("span", { children: r }), e("span", { className: nc, children: s.label ? s.label.toUpperCase() : s.shortcut.toUpperCase() })] }) })));
|
|
1602
1603
|
Wa.displayName = "CommandBar.Command";
|
|
1603
|
-
function
|
|
1604
|
+
function sc({ table: a, rowSelection: t }) {
|
|
1604
1605
|
const r = Object.keys(t).length > 0;
|
|
1605
1606
|
return e(Pn, { open: r, children: i(Tn, { children: [i(Qn, { children: [Object.keys(t).length, " selected"] }), e(qa, {}), e(Wa, { label: "Edit", action: () => {
|
|
1606
1607
|
console.log("Edit");
|
|
@@ -1610,7 +1611,7 @@ function nc({ table: a, rowSelection: t }) {
|
|
|
1610
1611
|
a.resetRowSelection();
|
|
1611
1612
|
}, shortcut: { shortcut: "Escape", label: "esc" } })] }) });
|
|
1612
1613
|
}
|
|
1613
|
-
function
|
|
1614
|
+
function lc({ meta: a, table: t }) {
|
|
1614
1615
|
const r = pe(), n = G(), s = da(), l = Number((r == null ? void 0 : r.get("page")) || "1"), o = (g, b) => {
|
|
1615
1616
|
const f = new URLSearchParams(r == null ? void 0 : r.toString());
|
|
1616
1617
|
return f.set(g, b), f.toString();
|
|
@@ -1624,15 +1625,15 @@ function sc({ meta: a, table: t }) {
|
|
|
1624
1625
|
function ga({ meta: a, columns: t, error: r, data: n, loading: s, className: l, refetch: o }) {
|
|
1625
1626
|
var g, b;
|
|
1626
1627
|
const d = O(), p = $(), [m, h] = A.useState({}), u = el({ data: n, columns: t, state: { rowSelection: m }, enableRowSelection: !0, getFilteredRowModel: rl(), onRowSelectionChange: h, getCoreRowModel: tl(), getSortedRowModel: al(), manualPagination: !0, meta: { ...a, organizationId: d, refetch: o, routes: p } });
|
|
1627
|
-
return e(S, { children: i("div", { className: k("space-y-6 relative", l), children: [i("div", { className: "relative overflow-hidden overflow-x-auto", children: [s && !n ? e("div", { className: "flex items-center justify-center h-48", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(ie, { className: "w-10 h-10" }), e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })] }) }) : i(S, { children: [i(xr, { children: [e(wr, { children: u.getHeaderGroups().map((f) => e(
|
|
1628
|
+
return e(S, { children: i("div", { className: k("space-y-6 relative", l), children: [i("div", { className: "relative overflow-hidden overflow-x-auto", children: [s && !n ? e("div", { className: "flex items-center justify-center h-48", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(ie, { className: "w-10 h-10" }), e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })] }) }) : i(S, { children: [i(xr, { children: [e(wr, { children: u.getHeaderGroups().map((f) => e(ea, { className: "border-y border-gray-200 dark:border-gray-800 back", children: f.headers.map((w) => {
|
|
1628
1629
|
var y;
|
|
1629
|
-
return e(
|
|
1630
|
-
}) }, f.id)) }), i(kr, { children: [r && e(
|
|
1630
|
+
return e(Xe, { className: k("whitespace-nowrap py-1 text-sm sm:text-xs", (y = w.column.columnDef.meta) == null ? void 0 : y.className), children: Ir(w.column.columnDef.header, w.getContext()) }, w.id);
|
|
1631
|
+
}) }, f.id)) }), i(kr, { children: [r && e(ea, { children: e(Be, { colSpan: t.length, className: "h-24 text-center text-red-500", children: "An error occurred while fetching data. Please refresh the site and try again." }) }), ((g = u.getRowModel().rows) == null ? void 0 : g.length) > 0 && u.getRowModel().rows.map((f) => e(ea, { className: "group select-none hover:bg-gray-50 dark:hover:bg-gray-900", children: f.getVisibleCells().map((w, y) => {
|
|
1631
1632
|
var x;
|
|
1632
1633
|
return i(Be, { className: k(f.getIsSelected() ? "bg-gray-50 dark:bg-gray-900" : "", "relative whitespace-nowrap py-1 text-gray-600 first:w-10 dark:text-gray-400", (x = w.column.columnDef.meta) == null ? void 0 : x.className), children: [y === 0 && f.getIsSelected() && e("div", { className: "absolute inset-y-0 left-0 w-0.5 bg-blue-600 dark:bg-blue-500" }), Ir(w.column.columnDef.cell, w.getContext())] }, w.id);
|
|
1633
|
-
}) }, f.id)), ((b = u.getRowModel().rows) == null ? void 0 : b.length) === 0 && !s && e(
|
|
1634
|
+
}) }, f.id)), ((b = u.getRowModel().rows) == null ? void 0 : b.length) === 0 && !s && e(ea, { children: e(Be, { colSpan: t.length, className: "h-24 text-center", children: "No results." }) })] })] }), s && n && 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: i("div", { className: "flex flex-col items-center gap-2", children: [e(ie, { className: "w-10 h-10" }), e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })] }) })] }), e(sc, { table: u, rowSelection: m })] }), a && e(lc, { meta: a, table: u })] }) });
|
|
1634
1635
|
}
|
|
1635
|
-
const
|
|
1636
|
+
const oc = Te({ base: ["relative block w-full appearance-none rounded-md border px-2.5 py-1.5 outline-hidden transition sm:text-sm", "border-transparent dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "bg-gray-100 dark:bg-gray-950", "disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-700 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", Ra, "[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"], variants: { hasError: { true: sr }, enableStepper: { true: "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none" } } }), fa = A.forwardRef(({ className: a, inputClassName: t, hasError: r, enableStepper: n, type: s = "search", ...l }, o) => i("div", { className: k("relative w-full", a), children: [e("input", { ref: o, type: s, className: k(oc({ hasError: r, enableStepper: n }), "pl-8", t), ...l }), e("div", { className: k("pointer-events-none absolute bottom-0 left-2 flex h-full items-center justify-center", "text-gray-400 dark:text-gray-600"), children: e(Lt, { className: "size-[1.125rem] shrink-0", "aria-hidden": "true" }) })] }));
|
|
1636
1637
|
fa.displayName = "Searchbar";
|
|
1637
1638
|
const Qe = z.forwardRef(({ className: a, checked: t, ...r }, n) => e(Er.Root, { ref: n, ...r, checked: t, className: k("relative inline-flex size-4 shrink-0 appearance-none items-center justify-center rounded shadow-xs outline-hidden ring-1 ring-inset transition duration-100 enabled:cursor-pointer", "text-white dark:text-gray-50", "bg-white dark:bg-gray-950", "ring-gray-300 dark:ring-gray-800", "data-disabled:bg-gray-100 data-disabled:text-gray-400 data-disabled:ring-gray-300", "dark:data-disabled:bg-gray-800 dark:data-disabled:text-gray-500 dark:data-disabled:ring-gray-700", "enabled:data-[state=checked]:bg-blue-600 enabled:data-[state=checked]:ring-0 enabled:data-[state=checked]:ring-transparent", "enabled:data-[state=indeterminate]:bg-blue-600 enabled:data-[state=indeterminate]:ring-0 enabled:data-[state=indeterminate]:ring-transparent", he, a), children: e(Er.Indicator, { asChild: !0, className: "flex size-full items-center justify-center", children: t === "indeterminate" ? e("svg", { "aria-hidden": "true", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e("line", { stroke: "currentColor", strokeLinecap: "round", strokeWidth: "2", x1: "4", x2: "12", y1: "8", y2: "8" }) }) : e("svg", { "aria-hidden": "true", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M11.2 5.59998L6.79999 9.99998L4.79999 7.99998", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2" }) }) }) }));
|
|
1638
1639
|
Qe.displayName = "Checkbox";
|
|
@@ -1657,40 +1658,40 @@ const We = A.forwardRef(({ className: a, sideOffset: t = 8, collisionPadding: r
|
|
|
1657
1658
|
We.displayName = "DropdownMenuContent";
|
|
1658
1659
|
const ve = A.forwardRef(({ className: a, shortcut: t, hint: r, children: n, ...s }, l) => i(re.Item, { ref: l, className: k("group/DropdownMenuItem relative flex cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-1 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), ...s, children: [n, r && e("span", { className: k("ml-auto pl-2 text-sm text-gray-400 dark:text-gray-600"), children: r }), t && e("span", { className: k("ml-auto pl-2 text-sm text-gray-400 dark:text-gray-600"), children: t })] }));
|
|
1659
1660
|
ve.displayName = "DropdownMenuItem";
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1661
|
+
const dc = A.forwardRef(({ className: a, hint: t, shortcut: r, children: n, checked: s, ...l }, o) => i(re.CheckboxItem, { ref: o, className: k("relative flex cursor-pointer select-none items-center gap-x-2 rounded py-1.5 pl-8 pr-1 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), checked: s, ...l, children: [e("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: e(re.ItemIndicator, { children: e(xi, { "aria-hidden": "true", className: "size-full shrink-0 text-gray-800 dark:text-gray-200" }) }) }), n, t && e("span", { className: k("ml-auto text-sm font-normal text-gray-400 dark:text-gray-600"), children: t }), r && e("span", { className: k("ml-auto text-sm font-normal tracking-widest text-gray-400 dark:border-gray-800 dark:text-gray-600"), children: r })] }));
|
|
1662
|
+
dc.displayName = "DropdownMenuCheckboxItem";
|
|
1662
1663
|
const _a = A.forwardRef(({ className: a, hint: t, shortcut: r, children: n, iconType: s = "radio", ...l }, o) => i(re.RadioItem, { ref: o, className: k("group/DropdownMenuRadioItem relative flex cursor-pointer select-none items-center gap-x-2 rounded py-1.5 pl-8 pr-1 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), ...l, children: [s === "radio" ? i("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: [e(Ms, { "aria-hidden": "true", className: "size-full shrink-0 text-blue-500 group-data-[state=checked]/DropdownMenuRadioItem:flex group-data-[state=unchecked]/DropdownMenuRadioItem:hidden dark:text-blue-500" }), e(Ps, { "aria-hidden": "true", className: "size-full shrink-0 text-gray-300 group-data-[state=unchecked]/DropdownMenuRadioItem:flex group-data-[state=checked]/DropdownMenuRadioItem:hidden dark:text-gray-700" })] }) : s === "check" ? e("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: e(xi, { "aria-hidden": "true", className: "size-full shrink-0 text-gray-800 group-data-[state=checked]/DropdownMenuRadioItem:flex group-data-[state=unchecked]/DropdownMenuRadioItem:hidden dark:text-gray-200" }) }) : null, n, t && e("span", { className: k("ml-auto text-sm font-normal text-gray-400 dark:text-gray-600"), children: t }), r && e("span", { className: k("ml-auto text-sm font-normal tracking-widest text-gray-400 dark:border-gray-800 dark:text-gray-600"), children: r })] }));
|
|
1663
1664
|
_a.displayName = "DropdownMenuRadioItem";
|
|
1664
1665
|
const St = A.forwardRef(({ className: a, ...t }, r) => e(re.Label, { ref: r, className: k("px-2 py-2 text-xs font-medium tracking-wide", "text-gray-500 dark:text-gray-500", a), ...t }));
|
|
1665
1666
|
St.displayName = "DropdownMenuLabel";
|
|
1666
|
-
const
|
|
1667
|
-
|
|
1668
|
-
const
|
|
1667
|
+
const cc = A.forwardRef(({ className: a, ...t }, r) => e(re.Separator, { ref: r, className: k("-mx-1 my-1 h-px border-t border-gray-200 dark:border-gray-800", a), ...t }));
|
|
1668
|
+
cc.displayName = "DropdownMenuSeparator";
|
|
1669
|
+
const ia = ca(), mc = [ia.display({ id: "select", header: ({ table: a }) => e(Qe, { checked: a.getIsAllPageRowsSelected() ? !0 : a.getIsSomeRowsSelected() ? "indeterminate" : !1, onCheckedChange: () => a.toggleAllPageRowsSelected(), className: "translate-y-0.5", "aria-label": "Select all" }), cell: ({ row: a }) => e(Qe, { checked: a.getIsSelected(), onCheckedChange: () => a.toggleSelected(), className: "translate-y-0.5", "aria-label": "Select row" }), enableSorting: !1, enableHiding: !1, meta: { displayName: "Select" } }), ia.accessor("id", { header: ({ column: a }) => e(R, { column: a, title: "Id" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a, table: t }) => {
|
|
1669
1670
|
var n, s, l;
|
|
1670
1671
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
1671
1672
|
return e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.manufacturerEdit(r, a.getValue("id"))) ?? `/admin/${r}/manufacturers/${a.getValue("id")}`, className: "text-blue-500", children: a.getValue("id") });
|
|
1672
|
-
} }),
|
|
1673
|
+
} }), ia.accessor("name", { header: ({ column: a }) => e(R, { column: a, title: "Name" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Owner" } }), ia.accessor("translations", { header: ({ column: a }) => e(R, { column: a, title: "About" }), enableSorting: !1, meta: { className: "text-left", displayName: "Status" }, cell: ({ row: a }) => {
|
|
1673
1674
|
var t;
|
|
1674
1675
|
return ((t = a.getValue("translations").find((r) => r.about)) == null ? void 0 : t.about) || "-";
|
|
1675
|
-
} }),
|
|
1676
|
+
} }), ia.accessor("createdAt", { header: ({ column: a }) => e(R, { column: a, title: "Created At" }), enableSorting: !1, meta: { className: "text-left", displayName: "Status" }, cell: ({ row: a }) => {
|
|
1676
1677
|
const t = a.getValue("createdAt");
|
|
1677
1678
|
return new Date(t).toLocaleDateString();
|
|
1678
|
-
} }),
|
|
1679
|
+
} }), ia.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => {
|
|
1679
1680
|
var n, s, l;
|
|
1680
1681
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
1681
1682
|
return i(Ue, { children: [e(qe, { asChild: !0, children: e(D, { variant: "ghost", 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", children: e(ot, { 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", "aria-hidden": "true" }) }) }), i(We, { align: "end", className: "min-w-40", children: [e(ve, { children: e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.manufacturerEdit(r, a.getValue("id"))) ?? `/admin/${r}/manufacturers/${a.getValue("id")}`, className: "block", children: "Edit" }) }), e(ve, { className: "text-red-600 dark:text-red-500", children: "Delete" })] })] });
|
|
1682
|
-
} })],
|
|
1683
|
+
} })], uc = () => {
|
|
1683
1684
|
const { client: a } = I(), t = $(), r = O(), n = pe(), [s, l] = F(""), [o] = Ze(s, 300), d = Number((n == null ? void 0 : n.get("page")) || "1"), { isLoading: p, isRefetching: m, isError: h, data: u } = M({ queryKey: ["manufacturers", r, d, o], queryFn: async () => {
|
|
1684
1685
|
const { body: g, status: b } = await a.manufacturer.getManufacturers({ params: { organizationId: r }, query: { page: d, limit: 10, search: o } });
|
|
1685
1686
|
if (b !== 200) throw new Error("Failed to fetch organizations");
|
|
1686
1687
|
return g;
|
|
1687
1688
|
}, placeholderData: me });
|
|
1688
|
-
return i(S, { children: [i("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: [e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search by manufaturer...", value: s, onChange: (g) => l(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }), e("div", { className: "flex items-center gap-2", children: e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.manufacturerCreate(r), children: ["Create Manufacturer", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ga, { error: h, loading: p || m, meta: u != null && u.meta ? { ...u == null ? void 0 : u.meta, currentPage: d } : void 0, data: (u == null ? void 0 : u.list) || [], columns:
|
|
1689
|
+
return i(S, { children: [i("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: [e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search by manufaturer...", value: s, onChange: (g) => l(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }), e("div", { className: "flex items-center gap-2", children: e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.manufacturerCreate(r), children: ["Create Manufacturer", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ga, { error: h, loading: p || m, meta: u != null && u.meta ? { ...u == null ? void 0 : u.meta, currentPage: d } : void 0, data: (u == null ? void 0 : u.list) || [], columns: mc, className: "mt-8" })] });
|
|
1689
1690
|
};
|
|
1690
|
-
function
|
|
1691
|
-
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Manufacturers List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(
|
|
1691
|
+
function pc() {
|
|
1692
|
+
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Manufacturers List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(uc, {}) })] });
|
|
1692
1693
|
}
|
|
1693
|
-
const
|
|
1694
|
+
const hc = ({ organizationId: a, id: t, status: r, refetch: n }) => {
|
|
1694
1695
|
var u;
|
|
1695
1696
|
const { client: s } = I(), l = T({ mutationFn: async ({ operation: g }) => {
|
|
1696
1697
|
if ((await s.order.updateStatus({ params: { id: t, organizationId: a, operation: g } })).status !== 200) throw new Error("Failed to update order status");
|
|
@@ -1732,7 +1733,7 @@ const pc = ({ organizationId: a, id: t, status: r, refetch: n }) => {
|
|
|
1732
1733
|
l.mutate({ operation: "cancelled" });
|
|
1733
1734
|
}, m = l.isPending, h = (u = l.variables) == null ? void 0 : u.operation;
|
|
1734
1735
|
return i("div", { className: "flex items-center gap-2 min-w-28", children: [i("button", { onClick: p, disabled: m || r === "cancelled" || r === "completed", 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", "tremor-id": "tremor-raw", children: [m && h === "cancelled" ? "Loading..." : "Cancel", e(Ca, { className: "w-4 h-4 text-red-600 dark:text-red-500" })] }), r !== "completed" && r !== "cancelled" && i("button", { onClick: d, disabled: m, 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", "tremor-id": "tremor-raw", children: [m && h !== "cancelled" ? "Loading..." : o, e(it, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" })] })] });
|
|
1735
|
-
},
|
|
1736
|
+
}, gc = ({ open: a, onOpenChange: t, order: r }) => {
|
|
1736
1737
|
var l, o, d, p, m, h, u;
|
|
1737
1738
|
if (!r) return null;
|
|
1738
1739
|
const n = (g) => new Intl.NumberFormat("en-US", { style: "currency", currency: r.currency || "PLN" }).format(g), s = (g) => {
|
|
@@ -1757,14 +1758,14 @@ const pc = ({ organizationId: a, id: t, status: r, refetch: n }) => {
|
|
|
1757
1758
|
const f = g.translations.find((w) => w.locale === "en") || g.translations[0];
|
|
1758
1759
|
return i("div", { className: "py-3 flex justify-between items-center", children: [i("div", { className: "flex items-center gap-4", children: [g.image && e("div", { className: "h-16 w-16 rounded overflow-hidden shrink-0", children: e("img", { src: g.image.url, alt: (f == null ? void 0 : f.title) || "Product", className: "h-full w-full object-cover" }) }), i("div", { children: [e("h4", { className: "font-medium", children: (f == null ? void 0 : f.title) || "Product" }), (f == null ? void 0 : f.subtitle) && e("p", { className: "text-sm text-gray-500", children: f.subtitle }), i("p", { className: "text-sm mt-1", children: [n(g.unitPrice), " × ", g.quantity] })] })] }), e("div", { className: "font-medium", children: n(g.totalPrice) })] }, b);
|
|
1759
1760
|
}) }), e("div", { className: "mt-4 pt-4 border-t border-gray-200 dark:border-gray-800", children: i("div", { className: "flex justify-between items-center", children: [e("span", { className: "font-medium", children: "Total" }), e("span", { className: "font-bold text-lg", children: n(Number((u = r.payment) == null ? void 0 : u.total) || 0) })] }) })] })] }) });
|
|
1760
|
-
},
|
|
1761
|
+
}, fc = ({ order: a }) => {
|
|
1761
1762
|
const [t, r] = F(!1);
|
|
1762
|
-
return i(S, { children: [e("button", { onClick: () => r(!0), className: "text-blue-500 hover:underline", children: String(a.id).slice(-5) }), e(
|
|
1763
|
-
},
|
|
1763
|
+
return i(S, { children: [e("button", { onClick: () => r(!0), className: "text-blue-500 hover:underline", children: String(a.id).slice(-5) }), e(gc, { open: t, onOpenChange: r, order: a })] });
|
|
1764
|
+
}, yc = ({ order: a, table: t }) => {
|
|
1764
1765
|
const r = t.options.meta, n = (r == null ? void 0 : r.organizationId) || "", s = typeof (r == null ? void 0 : r.refetch) == "function" ? r.refetch : () => {
|
|
1765
1766
|
};
|
|
1766
|
-
return e(
|
|
1767
|
-
}, Je = ca(),
|
|
1767
|
+
return e(hc, { organizationId: n, id: a.id, status: a.status, refetch: s });
|
|
1768
|
+
}, Je = ca(), bc = [Je.accessor("id", { header: ({ column: a }) => e(R, { column: a, title: "ID" }), meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a }) => e(fc, { order: a.original }), enableSorting: !0, enableHiding: !1 }), Je.accessor("referenceId", { header: ({ column: a }) => e(R, { column: a, title: "Reference ID" }), cell: ({ row: a }) => e("div", { className: "w-[100px]", children: a.getValue("referenceId") }), meta: { className: "text-left", displayName: "ID" }, enableSorting: !1, enableHiding: !1 }), Je.display({ id: "customer", meta: { className: "text-left", displayName: "ID" }, header: ({ column: a }) => e(R, { column: a, title: "Customer" }), cell: ({ row: a }) => {
|
|
1768
1769
|
var n, s;
|
|
1769
1770
|
const t = ((n = a.original.shippingAddress) == null ? void 0 : n.firstname) || "", r = ((s = a.original.shippingAddress) == null ? void 0 : s.lastname) || "";
|
|
1770
1771
|
return e("div", { children: `${t} ${r}`.trim() || "N/A" });
|
|
@@ -1782,16 +1783,16 @@ const pc = ({ organizationId: a, id: t, status: r, refetch: n }) => {
|
|
|
1782
1783
|
var l, o, d, p;
|
|
1783
1784
|
const t = ((l = a.original.shippingAddress) == null ? void 0 : l.addressLineOne) || "", r = ((o = a.original.shippingAddress) == null ? void 0 : o.city) || "", n = ((d = a.original.shippingAddress) == null ? void 0 : d.doorNumber) || "", s = ((p = a.original.shippingAddress) == null ? void 0 : p.zipCode) || "";
|
|
1784
1785
|
return i("div", { children: [i("div", { children: [t, " ", n ? ` / ${n}` : ""] }), i("div", { children: [s ? `${s}, ` : "", r] })] });
|
|
1785
|
-
} }), Je.display({ id: "status", header: ({ column: a }) => e(R, { column: a, title: "Actions" }), cell: ({ row: a, table: t }) => e(
|
|
1786
|
+
} }), Je.display({ id: "status", header: ({ column: a }) => e(R, { column: a, title: "Actions" }), cell: ({ row: a, table: t }) => e(yc, { order: a.original, table: t }) })], xc = () => {
|
|
1786
1787
|
const { client: a } = I(), t = O(), r = pe(), [n, s] = F(""), [l] = Ze(n, 300), o = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: p, isError: m, data: h, refetch: u } = M({ queryKey: ["orders", t, o, l], queryFn: async () => {
|
|
1787
1788
|
const { body: g, status: b } = await a.order.getOrders({ params: { organizationId: t }, query: { page: o, limit: 10, search: l } });
|
|
1788
1789
|
if (b !== 200) throw new Error("Failed to fetch orders");
|
|
1789
1790
|
return g;
|
|
1790
1791
|
}, placeholderData: me });
|
|
1791
|
-
return i(S, { children: [e("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search by order reference...", value: n, onChange: (g) => s(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }) }), e(ga, { error: m, loading: d || p, meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: o } : void 0, data: (h == null ? void 0 : h.list) || [], columns:
|
|
1792
|
+
return i(S, { children: [e("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search by order reference...", value: n, onChange: (g) => s(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }) }), e(ga, { error: m, loading: d || p, meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: o } : void 0, data: (h == null ? void 0 : h.list) || [], columns: bc, className: "mt-8", refetch: u })] });
|
|
1792
1793
|
};
|
|
1793
|
-
function
|
|
1794
|
-
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Orders List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(
|
|
1794
|
+
function wc() {
|
|
1795
|
+
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Orders List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(xc, {}) })] });
|
|
1795
1796
|
}
|
|
1796
1797
|
const Vn = ({ onClose: a, initialData: t }) => {
|
|
1797
1798
|
var m;
|
|
@@ -1822,7 +1823,7 @@ const Vn = ({ onClose: a, initialData: t }) => {
|
|
|
1822
1823
|
return e("div", { className: "mt-6", children: e(Ve, { ...n, children: i("form", { onSubmit: n.handleSubmit((h) => p(h)), className: "grid gap-5 grid-cols-4", children: [t && i("div", { className: "col-span-2", children: [e(be, { htmlFor: "organization-id", className: "font-medium flex items-center justify-between", children: "Organization ID" }), e("div", { className: "relative mt-2", children: e(ce, { id: "organization-id", value: t.id, disabled: !0, readOnly: !0, className: "w-full", copyValue: t.id, copySuccessMessage: "Organization ID copied to clipboard.", copyErrorMessage: "Failed to copy organization ID. Please try again." }) })] }), e(Ce, { name: "name", label: "Organization Name", placeholder: "Acme Inc.", className: "col-span-2" }), e(Ce, { name: "email", type: "email", label: "Support Email", placeholder: "john.doe@example.com", className: "col-span-2" }), e(Ce, { name: "phone", type: "phone-number", label: "Phone Number", placeholder: "Enter phone number", className: "col-span-2" }), i("div", { className: "col-span-4 text-sm text-gray-500", children: [e(be, { htmlFor: "address.addressLineOne", className: "font-medium flex items-center justify-between", children: "Street / Address Line 1" }), e(rr, { onChange: (h) => {
|
|
1823
1824
|
n.setValue("address.addressLineOne", h.addressLineOne, { shouldValidate: !0 }), n.setValue("address.placeId", h.placeId, { shouldValidate: !0 });
|
|
1824
1825
|
}, value: l ?? "" }), ((m = n.formState.errors.address) == null ? void 0 : m.addressLineOne) && e("p", { className: "mt-1 text-sm text-red-500", children: n.formState.errors.address.addressLineOne.message })] }), e(Ce, { name: "address.addressLineTwo", label: "Door / Address Line 2", placeholder: "Apt 123", className: "col-span-2" }), e(Ce, { name: "address.zipCode", label: "Postal Code", placeholder: "12345", className: "col-span-2" }), e(Ce, { name: "address.city", label: "City", placeholder: "New York", className: "col-span-2" }), e(Ce, { name: "address.country", label: "Country", placeholder: "United States", className: "col-span-2", type: "country" }), e(Ce, { name: "logoFile", label: "Logo", type: "file", className: "col-span-2" }), i("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-5 col-span-full border-t pt-7", children: [a && e(D, { type: "button", className: "w-full sm:w-fit", variant: "secondary", onClick: a, children: "Cancel" }), e(D, { type: "submit", className: "w-full sm:w-fit", isLoading: o.isPending || d.isPending, loadingText: "Saving...", children: t ? "Update Data" : "Create Organization" })] })] }) }) });
|
|
1825
|
-
},
|
|
1826
|
+
}, kc = ({ invitation: a }) => {
|
|
1826
1827
|
var n;
|
|
1827
1828
|
const { client: t } = I(), r = T({ mutationFn: async () => {
|
|
1828
1829
|
const { status: s } = await t.access.acceptInvitation({ params: { invitationId: a.id } });
|
|
@@ -1833,21 +1834,21 @@ const Vn = ({ onClose: a, initialData: t }) => {
|
|
|
1833
1834
|
Q.error((s == null ? void 0 : s.message) || "Failed to accept invitation");
|
|
1834
1835
|
} });
|
|
1835
1836
|
return i("div", { className: "relative flex items-center rounded-md border border-dashed border-emerald-300 bg-emerald-50/50 px-4 py-3 shadow-xs dark:border-emerald-700 dark:bg-emerald-950/20", children: [e("span", { className: "absolute inset-x-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-md bg-emerald-500 dark:bg-emerald-500", "aria-hidden": "true" }), e("div", { className: "rounded-full ml-2", children: i("div", { className: "rounded-full h-14 w-14 bg-emerald-500 text-white text-xl flex items-center justify-center", children: [a.organization.name.charAt(0).toUpperCase(), (n = a.organization.name.charAt(1)) == null ? void 0 : n.toUpperCase()] }) }), i("div", { className: "border-l border-emerald-200 dark:border-emerald-800 ml-6 pl-6 flex justify-between items-center w-full", children: [i("div", { children: [i("p", { className: "flex items-center gap-2", children: [e("span", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: a.organization.name }), e("span", { className: "inline-flex items-center rounded-md bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:bg-emerald-900 dark:text-emerald-300", children: "Invited" })] }), e("p", { className: "flex items-center gap-2", children: i("span", { className: "text-sm text-gray-500 dark:text-gray-500", children: ["You have been invited as", " ", e("span", { className: "font-medium", children: a.role ?? "member" })] }) })] }), e("div", { children: e("button", { onClick: () => r.mutate(), disabled: r.isPending, className: "block rounded-full text-emerald-500 p-2 hover:bg-emerald-500 hover:text-white hover:translate-y-[-2px] hover:shadow-lg transition mr-2 border border-emerald-200 dark:border-emerald-700/60 hover:border-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-none", children: e(nt, { className: "w-5 h-5" }) }) })] })] });
|
|
1836
|
-
},
|
|
1837
|
+
}, vc = () => {
|
|
1837
1838
|
const [a, t] = F(!1), r = $(), { client: n } = I(), { organizations: s } = ge(), { data: l } = M({ queryKey: ["user-invitations"], queryFn: async () => {
|
|
1838
1839
|
const { body: d, status: p } = await n.access.getUserInvitations();
|
|
1839
1840
|
return p !== 200 ? [] : d;
|
|
1840
1841
|
} }), o = () => t(!1);
|
|
1841
|
-
return i(S, { children: [i("div", { className: "max-w-4xl mx-auto py-8 px-4", children: [i("div", { className: "flex justify-between items-center", children: [i("div", { children: [e("h1", { className: "text-2xl font-semibold text-gray-900 dark:text-gray-50", children: "Organizations" }), e("p", { className: "text-gray-500 sm:text-sm/6 dark:text-gray-500", children: "Select a organization to get started." })] }), e("div", { className: "w-min h-min", children: i(D, { onClick: () => t(!0), variant: "primary", children: [e(Me, { className: "w-4 h-4 mr-1" }), " Add New"] }) })] }), s.loading ? e("div", { className: "flex justify-center items-center h-32 mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [i("svg", { "aria-hidden": "true", className: "w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), e("p", { className: "text-gray-500 text-sm mt-2", children: "Loading organizations..." })] }) }) : i("div", { className: "grid grid-cols-1 gap-y-3 gap-x-4 animate-fade-in mt-5", children: [l == null ? void 0 : l.map((d) => e(
|
|
1842
|
+
return i(S, { children: [i("div", { className: "max-w-4xl mx-auto py-8 px-4", children: [i("div", { className: "flex justify-between items-center", children: [i("div", { children: [e("h1", { className: "text-2xl font-semibold text-gray-900 dark:text-gray-50", children: "Organizations" }), e("p", { className: "text-gray-500 sm:text-sm/6 dark:text-gray-500", children: "Select a organization to get started." })] }), e("div", { className: "w-min h-min", children: i(D, { onClick: () => t(!0), variant: "primary", children: [e(Me, { className: "w-4 h-4 mr-1" }), " Add New"] }) })] }), s.loading ? e("div", { className: "flex justify-center items-center h-32 mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [i("svg", { "aria-hidden": "true", className: "w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), e("p", { className: "text-gray-500 text-sm mt-2", children: "Loading organizations..." })] }) }) : i("div", { className: "grid grid-cols-1 gap-y-3 gap-x-4 animate-fade-in mt-5", children: [l == null ? void 0 : l.map((d) => e(kc, { invitation: d }, d.id)), s.data.map((d) => {
|
|
1842
1843
|
var p, m;
|
|
1843
1844
|
return i("div", { className: "relative flex items-center rounded-md border border-gray-200 bg-white px-4 py-3 shadow-xs dark:border-gray-800 dark:bg-gray-900", children: [e("span", { className: "absolute inset-x-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-md bg-blue-500 dark:bg-blue-500", "aria-hidden": "true" }), d.logoFile ? e(xe, { src: d.logoFile.url, alt: d.name, width: 100, height: 100, className: "rounded-lg ml-2 h-16 w-16 object-cover" }) : e("div", { className: "rounded-full ml-2", children: i("div", { className: "rounded-full h-14 w-14 bg-blue-500 text-white text-xl flex items-center justify-center", children: [d.name.charAt(0).toUpperCase(), d.name.charAt(1).toUpperCase()] }) }), i("div", { className: "border-l ml-6 pl-6 flex justify-between items-center w-full", children: [i("div", { children: [e("p", { className: "flex items-center justify-between gap-2", children: e("span", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: d.name }) }), e("p", { className: "flex items-center justify-between gap-2", children: i("span", { className: "text-sm text-gray-500 dark:text-gray-500", children: [(p = d.address) == null ? void 0 : p.addressLineOne, ",", " ", (m = d.address) == null ? void 0 : m.city] }) })] }), e("div", { children: e(E, { className: "block rounded-full text-blue-500 p-2 hover:bg-blue-500 hover:text-white hover:translate-y-[-2px] hover:shadow-lg transition mr-2 border border-gray-200 dark:border-gray-700/60 hover:border-blue-500", href: r.dashboard(d.id), children: e(bs, { className: "w-5 h-5" }) }) })] })] }, d.id);
|
|
1844
1845
|
})] })] }), i(kt, { onOpenChange: o, open: a, children: [e(In, { className: "w-full text-left" }), i(vt, { className: "sm:max-w-xl", children: [i(Nt, { children: [e(At, { children: "Create a Organization" }), e(Ct, { className: "mt-1 text-sm leading-6", children: "Fill in the details below to create a new organization" })] }), e(Vn, { onClose: o })] })] })] });
|
|
1845
1846
|
};
|
|
1846
|
-
function
|
|
1847
|
+
function Nc() {
|
|
1847
1848
|
const { appearance: a } = Fi(), t = a == null ? void 0 : a.organizationImage;
|
|
1848
|
-
return i("div", { className: "flex w-full min-h-screen", children: [t && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(xe, { src: t, alt: "Organization Visual", width: 4e3, height: 2250, className: "w-full h-full object-cover min-h-screen" }) }), e("div", { className: `w-full ${t ? "lg:w-1/2" : ""} flex items-center justify-center p-8`, children: e("div", { className: "w-full max-w-md space-y-8", children: e(
|
|
1849
|
+
return i("div", { className: "flex w-full min-h-screen", children: [t && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(xe, { src: t, alt: "Organization Visual", width: 4e3, height: 2250, className: "w-full h-full object-cover min-h-screen" }) }), e("div", { className: `w-full ${t ? "lg:w-1/2" : ""} flex items-center justify-center p-8`, children: e("div", { className: "w-full max-w-md space-y-8", children: e(vc, {}) }) })] });
|
|
1849
1850
|
}
|
|
1850
|
-
const Ge = ca(),
|
|
1851
|
+
const Ge = ca(), Ac = ({ row: a, table: t }) => {
|
|
1851
1852
|
var p, m;
|
|
1852
1853
|
const { client: r } = I(), n = a.getValue("publishedAt"), s = (p = t.options.meta) == null ? void 0 : p.organizationId, l = (m = t.options.meta) == null ? void 0 : m.refetch, o = T({ mutationFn: async () => {
|
|
1853
1854
|
if ((await r.productCategory.updateStatus({ params: { id: a.getValue("id"), organizationId: s, operation: n ? "unpublish" : "publish" } })).status !== 200) throw new Error("Failed to update product category status");
|
|
@@ -1856,7 +1857,7 @@ const Ge = ca(), Nc = ({ row: a, table: t }) => {
|
|
|
1856
1857
|
o.mutate();
|
|
1857
1858
|
};
|
|
1858
1859
|
return o.isPending ? e("div", { className: "min-w-28", children: i("button", { 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", "tremor-id": "tremor-raw", disabled: !0, children: [e(ie, { className: "w-4 h-4" }), " Saving..."] }) }) : e("div", { className: "min-w-28", children: i("button", { onClick: d, 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", "tremor-id": "tremor-raw", children: [n ? e(it, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" }) : e(ai, { className: "w-4 h-4 text-red-600 dark:text-red-500" }), n ? "Published" : "Draft"] }) });
|
|
1859
|
-
},
|
|
1860
|
+
}, Cc = ({ row: a, table: t }) => {
|
|
1860
1861
|
var d, p, m, h;
|
|
1861
1862
|
const { client: r } = I(), n = (d = t.options.meta) == null ? void 0 : d.organizationId, s = (p = t.options.meta) == null ? void 0 : p.refetch, l = T({ mutationFn: async () => {
|
|
1862
1863
|
if ((await r.productCategory.deleteProductCategory({ params: { id: a.getValue("id"), organizationId: n } })).status !== 204) throw new Error("Failed to delete product category");
|
|
@@ -1865,25 +1866,25 @@ const Ge = ca(), Nc = ({ row: a, table: t }) => {
|
|
|
1865
1866
|
window.confirm("Are you sure you want to delete this product category? This action cannot be undone.") && l.mutate();
|
|
1866
1867
|
};
|
|
1867
1868
|
return i(Ue, { children: [e(qe, { asChild: !0, children: e(D, { variant: "ghost", 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", disabled: l.isPending, children: l.isPending ? e(ie, { className: "size-4 shrink-0" }) : e(ot, { 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", "aria-hidden": "true" }) }) }), i(We, { align: "end", className: "min-w-40", children: [e(ve, { children: i(E, { href: ((h = (m = t.options.meta) == null ? void 0 : m.routes) == null ? void 0 : h.productCategoryEdit(n, a.getValue("id"))) ?? `/admin/${n}/product-categories/${a.getValue("id")}`, className: "block flex items-center gap-2", children: [e(ti, { className: "w-4 h-4" }), "Edit"] }) }), e(ve, { className: "text-red-600 dark:text-red-500 cursor-pointer", onClick: o, disabled: l.isPending, children: i("div", { className: "flex items-center gap-2", children: [l.isPending ? e(ie, { className: "w-4 h-4" }) : e(Ot, { className: "w-4 h-4" }), l.isPending ? "Deleting..." : "Delete"] }) })] })] });
|
|
1868
|
-
},
|
|
1869
|
+
}, Sc = [Ge.display({ id: "select", header: ({ table: a }) => e(Qe, { checked: a.getIsAllPageRowsSelected() ? !0 : a.getIsSomeRowsSelected() ? "indeterminate" : !1, onCheckedChange: () => a.toggleAllPageRowsSelected(), className: "translate-y-0.5", "aria-label": "Select all" }), cell: ({ row: a }) => e(Qe, { checked: a.getIsSelected(), onCheckedChange: () => a.toggleSelected(), className: "translate-y-0.5", "aria-label": "Select row" }), enableSorting: !1, enableHiding: !1, meta: { displayName: "Select" } }), Ge.accessor("id", { header: ({ column: a }) => e(R, { column: a, title: "Id" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a, table: t }) => {
|
|
1869
1870
|
var n, s, l;
|
|
1870
1871
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
1871
1872
|
return e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.productCategoryEdit(r, a.getValue("id"))) ?? `/admin/${r}/product-categories/${a.getValue("id")}`, className: "text-blue-500", children: a.getValue("id") });
|
|
1872
|
-
} }), Ge.accessor("slug", { header: ({ column: a }) => e(R, { column: a, title: "Slug" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" } }), Ge.accessor("title", { header: ({ column: a }) => e(R, { column: a, title: "Title" }), enableSorting: !1, meta: { className: "text-left", displayName: "Name" } }), Ge.accessor("publishedAt", { header: ({ column: a }) => e(R, { column: a, title: "Status" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Status" }, cell: ({ row: a, table: t }) => e(
|
|
1873
|
+
} }), Ge.accessor("slug", { header: ({ column: a }) => e(R, { column: a, title: "Slug" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" } }), Ge.accessor("title", { header: ({ column: a }) => e(R, { column: a, title: "Title" }), enableSorting: !1, meta: { className: "text-left", displayName: "Name" } }), Ge.accessor("publishedAt", { header: ({ column: a }) => e(R, { column: a, title: "Status" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Status" }, cell: ({ row: a, table: t }) => e(Ac, { row: a, table: t }) }), Ge.accessor("createdAt", { header: ({ column: a }) => e(R, { column: a, title: "Created At" }), enableSorting: !1, meta: { className: "text-left", displayName: "Created At" }, cell: ({ row: a }) => {
|
|
1873
1874
|
const t = a.getValue("createdAt");
|
|
1874
1875
|
return new Date(t).toLocaleDateString();
|
|
1875
|
-
} }), Ge.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(
|
|
1876
|
+
} }), Ge.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(Cc, { row: a, table: t }) })], Ic = () => {
|
|
1876
1877
|
const { client: a } = I(), t = $(), { defaultLocale: r } = ge(), n = O(), s = pe(), [l, o] = F(""), d = Number((s == null ? void 0 : s.get("page")) || "1"), [p] = Ze(l, 300), { isLoading: m, isRefetching: h, isError: u, data: g, refetch: b } = M({ queryKey: ["productCategories", n, d, p, r], queryFn: async () => {
|
|
1877
1878
|
const { body: f, status: w } = await a.productCategory.getProductCategories({ params: { organizationId: n }, query: { page: d, limit: 10, search: p, locale: r } });
|
|
1878
1879
|
if (w !== 200) throw new Error("Failed to fetch product categories");
|
|
1879
1880
|
return f;
|
|
1880
1881
|
}, placeholderData: me });
|
|
1881
|
-
return i(S, { children: [i("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: [e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search by product category...", value: l, onChange: (f) => o(f.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }), e("div", { className: "flex items-center gap-2", children: e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.productCategoryCreate(n), children: ["Create Product Category", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ga, { error: u, loading: m || h, meta: g == null ? void 0 : g.meta, data: (g == null ? void 0 : g.list) || [], columns:
|
|
1882
|
+
return i(S, { children: [i("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: [e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search by product category...", value: l, onChange: (f) => o(f.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }), e("div", { className: "flex items-center gap-2", children: e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.productCategoryCreate(n), children: ["Create Product Category", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ga, { error: u, loading: m || h, meta: g == null ? void 0 : g.meta, data: (g == null ? void 0 : g.list) || [], columns: Sc, className: "mt-8", refetch: b })] });
|
|
1882
1883
|
};
|
|
1883
|
-
function
|
|
1884
|
-
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Product Categories List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(
|
|
1884
|
+
function Ec() {
|
|
1885
|
+
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Product Categories List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(Ic, {}) })] });
|
|
1885
1886
|
}
|
|
1886
|
-
const
|
|
1887
|
+
const zc = [{ name: "slug", label: "Slug", type: "text", placeholder: "electronics", colspan: 2 }, { name: "title", label: "Title", type: "text", placeholder: "Electronics", colspan: 2, localizable: !0 }, { name: "description", label: "Description", type: "textarea", placeholder: "All electronic devices and accessories.", colspan: 2, localizable: !0 }, { name: "image", label: "Image", type: "file" }], Zn = ({ initialData: a }) => {
|
|
1887
1888
|
const { client: t } = I(), r = G(), n = $(), s = O(), { defaultLocale: l, supportedLocales: o } = ge(), d = se({ resolver: le(a ? Tl : Ql), defaultValues: a ? { defaultLocale: l, slug: a.slug, image: a.image, translations: a.translations } : { defaultLocale: l, translations: o.map((u) => ({ locale: u })) } }), p = T({ mutationFn: async (u) => {
|
|
1888
1889
|
var f;
|
|
1889
1890
|
const g = { slug: u.slug, defaultLocale: u.defaultLocale, translations: u.translations, imageId: (f = u.image) == null ? void 0 : f.id }, { status: b } = await t.productCategory.createProductCategory({ params: { organizationId: s }, body: g });
|
|
@@ -1895,14 +1896,14 @@ const Ec = [{ name: "slug", label: "Slug", type: "text", placeholder: "electroni
|
|
|
1895
1896
|
} }), h = async () => {
|
|
1896
1897
|
Q.success("Product category saved successfully"), r.push(n.productCategories(s)), await te.invalidateQueries({ queryKey: ["productCategories"] });
|
|
1897
1898
|
};
|
|
1898
|
-
return e(Ie, { form: d, config:
|
|
1899
|
+
return e(Ie, { form: d, config: zc, onSubmit: (u) => {
|
|
1899
1900
|
a ? m.mutate(u, { onSuccess: h }) : p.mutate(u, { onSuccess: h });
|
|
1900
1901
|
}, loading: p.isPending || m.isPending, cancelText: "Go back", okText: a ? "Update Product Category" : "Create Product Category" });
|
|
1901
1902
|
};
|
|
1902
|
-
function
|
|
1903
|
+
function Dc() {
|
|
1903
1904
|
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Product Category" }), e(L, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "product-category-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-category-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Category Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the product category." })] }), e("div", { className: "md:col-span-2", children: e(Zn, {}) })] }) }) }) })] });
|
|
1904
1905
|
}
|
|
1905
|
-
function
|
|
1906
|
+
function Fc() {
|
|
1906
1907
|
const a = O(), t = Ba(), { client: r } = I(), { isLoading: n, data: s } = M({ queryKey: ["productCategories", a, t], queryFn: async () => {
|
|
1907
1908
|
const { status: l, body: o } = await r.productCategory.getProductCategory({ params: { id: t, organizationId: a } });
|
|
1908
1909
|
if (l !== 200) throw Q.error("Failed to fetch product category. Please refresh or try again later."), new Error("Failed to fetch product category");
|
|
@@ -1910,7 +1911,7 @@ function Dc() {
|
|
|
1910
1911
|
}, throwOnError: !0, placeholderData: me });
|
|
1911
1912
|
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Product Category" }), e(L, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "product-category-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-category-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Category Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the product category." })] }), e("div", { className: "md:col-span-2", children: n || !s ? e("div", { className: "flex justify-center items-center h-[500px] mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(ie, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(Zn, { initialData: s }) })] }) }) }) })] });
|
|
1912
1913
|
}
|
|
1913
|
-
const
|
|
1914
|
+
const Rc = ({ form: a }) => {
|
|
1914
1915
|
const { client: t } = I(), r = O(), { data: n } = M({ queryKey: ["product-categories", r], queryFn: async () => {
|
|
1915
1916
|
const l = await t.productCategory.getProductCategories({ params: { organizationId: r }, query: { limit: 100 } });
|
|
1916
1917
|
if (l.status !== 200) throw new Error("Failed to fetch product categories");
|
|
@@ -1921,7 +1922,7 @@ const Fc = ({ form: a }) => {
|
|
|
1921
1922
|
return l.body.list.map((o) => ({ label: o.name, value: o.id }));
|
|
1922
1923
|
}, throwOnError: !0 });
|
|
1923
1924
|
return e("section", { "aria-labelledby": "product-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Basic Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the basic information of your product, including the name, description, base price, and other essential details." })] }), e("div", { className: "md:col-span-2", children: e(Ie, { form: a, config: [{ name: "title", label: "Title", type: "text", placeholder: "Enter product name", colspan: 2, localizable: !0 }, { name: "description", label: "Description", type: "textarea", placeholder: "Enter product description", colspan: 2, localizable: !0 }, { name: "slug", label: "Slug", type: "text", placeholder: "Enter a URL-friendly slug" }, { name: "sku", label: "SKU (Stock Keeping Unit)", type: "text", placeholder: "Enter SKU" }, { name: "categories", label: "Categories", type: "select", options: n || [], multiple: !0 }, { name: "manufacturerId", label: "Manufacturer", type: "select", options: s || [] }, { name: "images", label: "Images", type: "file", multiple: !0, colspan: 2 }] }) })] }) });
|
|
1924
|
-
},
|
|
1925
|
+
}, Bc = ({ form: a }) => {
|
|
1925
1926
|
const [t, r] = z.useState([]);
|
|
1926
1927
|
z.useEffect(() => {
|
|
1927
1928
|
const d = a.getValues("metadata") || {}, p = Object.entries(d);
|
|
@@ -1943,12 +1944,12 @@ const Fc = ({ form: a }) => {
|
|
|
1943
1944
|
h[d][p] = m, r(h), n(h);
|
|
1944
1945
|
};
|
|
1945
1946
|
return e("section", { "aria-labelledby": "product-metadata", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-metadata", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Metadata" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Add custom key-value pairs to store additional information about your product. Keys must start with a letter and contain only letters, numbers, underscores, or dashes." })] }), e("div", { className: "md:col-span-2", children: i("div", { className: "space-y-4", children: [t.map((d, p) => i("div", { className: "flex gap-4 items-start", children: [i("div", { className: "flex-1", children: [e(be, { htmlFor: `metadata-key-${p}`, className: "font-medium", children: "Key" }), e(ce, { id: `metadata-key-${p}`, type: "text", value: d.key, onChange: (m) => o(p, "key", m.target.value), placeholder: "e.g., color, size, weight", className: "mt-2" })] }), i("div", { className: "flex-1", children: [e(be, { htmlFor: `metadata-value-${p}`, className: "font-medium", children: "Value" }), e(ce, { id: `metadata-value-${p}`, type: "text", value: d.value, onChange: (m) => o(p, "value", m.target.value), placeholder: "e.g., red, large, 2.5kg", className: "mt-2" })] }), e(D, { type: "button", variant: "destructive", className: "mt-8 min-w-[42px] h-[42px] p-0", onClick: () => l(p), children: e(xs, { className: "w-4 h-4" }) })] }, d.id)), t.length === 0 && e("p", { className: "text-sm text-gray-500 italic", children: "No metadata added yet. Click the button below to add key-value pairs." }), i(D, { type: "button", variant: "secondary", onClick: s, className: "w-full shadow-none mt-2", children: [e(Me, { className: "w-4 h-4 mr-2" }), "Add Row"] })] }) })] }) });
|
|
1946
|
-
},
|
|
1947
|
+
}, Mc = ({ open: a, onClose: t, initialData: r, onSubmit: n }) => {
|
|
1947
1948
|
const { defaultLocale: s, supportedLocales: l } = ge(), o = se({ resolver: le(ji), defaultValues: r ? { ...r, defaultLocale: s } : { defaultLocale: s, translations: l.map((u) => ({ locale: u, title: "" })), modifiers: [{ title: "", price: 0 }] } }), { fields: d, append: p, remove: m } = Tt({ control: o.control, name: "modifiers" }), h = (u) => {
|
|
1948
1949
|
n(u), t(), o.reset({ defaultLocale: s, translations: l.map((g) => ({ locale: g, title: "" })), modifiers: [{ title: "", price: 0 }] });
|
|
1949
1950
|
};
|
|
1950
1951
|
return e(kt, { open: a, onOpenChange: t, children: i(vt, { className: "max-w-[710px]", children: [i(Nt, { children: [e(At, { children: "New Modifier Group" }), e(Ct, { 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." })] }), i(Ve, { ...o, children: [e(Ie, { form: o, config: [{ name: "title", label: "Group Title", type: "text", placeholder: 'For example: "Spice Level" or "Select toppings".', colspan: 2, localizable: !0 }, { name: "selectMin", label: "Select Min", type: "number", placeholder: "Minimum selections", colspan: 1 }, { name: "selectMax", label: "Select Max", type: "number", placeholder: "Maximum selections", colspan: 1 }] }), e("h3", { className: "text-lg font-semibold mt-6", children: "Modifier Options" }), e("p", { className: "text-sm text-gray-500 mb-6 mt-1", children: "Add options to this modifier group. Modifier options are the different variants of the product. The price adds to the base price of the product. Leave the price as 0 if it's free." }), d.map((u, g) => i("div", { className: "mb-4 flex", children: [e(Ie, { form: o, columns: 2, config: [{ name: `modifiers.${g}.title`, label: "Title", type: "text", placeholder: 'eg: "Mild" or "Pepperoni"', colspan: 1 }, { name: `modifiers.${g}.price`, label: "Price", type: "number", placeholder: "Price for this modifier", colspan: 1, prefix: "USD" }] }), d.length > 1 && e(D, { type: "button", variant: "destructive", className: "mt-auto ml-4 min-w-[42px] h-[42px] p-0! shadow-none!", onClick: () => m(g), children: e(rt, { className: "w-4 h-4" }) })] }, u.id)), e(D, { type: "button", variant: "secondary", className: "mb-4 mt-4 ml-auto w-full shadow-none", onClick: () => p({ title: "", price: 0 }), children: "Add Another Option" }), e(L, { className: "mt-8 mb-6" }), i("div", { className: "flex justify-end space-x-3 mt-6 col-span-full", children: [e(D, { type: "button", className: "w-full sm:w-fit", variant: "secondary", onClick: t, children: "Cancel" }), e(D, { type: "button", className: "w-full sm:w-fit", onClick: o.handleSubmit(h), children: r ? "Save Modifier Group" : "Create Modifier Group" })] })] })] }) });
|
|
1951
|
-
},
|
|
1952
|
+
}, Pc = ({ form: a }) => {
|
|
1952
1953
|
const { control: t } = a, { defaultLocale: r } = ge(), { fields: n, append: s, remove: l, update: o } = Tt({ control: t, name: "modifierGroups" }), [d, p] = F(!1), [m, h] = F(null), u = () => crypto.randomUUID(), g = (x) => {
|
|
1953
1954
|
var v;
|
|
1954
1955
|
return { ...x, id: x.id ?? u(), defaultLocale: x.defaultLocale ?? r, modifiers: ((v = x.modifiers) == null ? void 0 : v.map((N) => ({ ...N, id: N.id ?? u() }))) ?? [] };
|
|
@@ -1968,10 +1969,10 @@ const Fc = ({ form: a }) => {
|
|
|
1968
1969
|
return i("section", { "aria-labelledby": "product-modifiers", className: "min-h-[200px]", children: [i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-modifiers", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Modifiers (Optional)" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Modifiers allow you to create different variants of the same product. Create or choose existing modifiers for your product." })] }), e("div", { className: "md:col-span-2", children: n.length === 0 ? i("div", { className: "text-center flex-col justify-center items-center", children: [e("h3", { className: "text-lg font-semibold", children: "No Modifier Groups" }), e("p", { className: "text-gray-500 max-w-[500px] mx-auto mt-1", children: "If your product has different options or variants, you can add modifier groups to manage them." }), i("div", { className: "flex space-x-3 mx-auto w-min mt-6", children: [i(D, { type: "button", variant: "secondary", className: "shadow-none", onClick: y, children: [e(vr, { className: "w-4 h-4 mr-2" }), " Add From Template"] }), i(D, { type: "button", variant: "secondary", className: "shadow-none", onClick: b, children: [e(Me, { className: "w-4 h-4 mr-2" }), " Create Modifier Group"] })] })] }) : i("div", { className: "space-y-10", children: [i("div", { className: "flex justify-end space-x-3", children: [i(D, { type: "button", variant: "secondary", className: "shadow-none", onClick: y, children: [e(vr, { className: "w-4 h-4 mr-2" }), " Add From Template"] }), i(D, { type: "button", variant: "secondary", className: "shadow-none", onClick: b, children: [e(Me, { className: "w-4 h-4 mr-2" }), " Create Modifier Group"] })] }), e("div", { className: "space-y-4", children: n.map((x, v) => {
|
|
1969
1970
|
var N;
|
|
1970
1971
|
return i("div", { className: "p-4 border rounded-md", children: [i("div", { className: "flex justify-between items-center", children: [e("h3", { className: "text-lg font-semibold", children: x.translations[0].title || "Unnamed Group" }), i("div", { children: [e("button", { type: "button", onClick: () => f(v), className: "text-blue-500 font-medium hover:underline text-sm mr-4", children: "Edit" }), e("button", { type: "button", onClick: () => l(v), className: "text-red-500 font-medium hover:underline text-sm p-0!", children: "Remove" })] })] }), i("p", { className: "text-sm text-gray-500 mt-3", children: ["Min: ", x.selectMin, " | Max: ", x.selectMax] }), i("p", { className: "text-sm text-gray-500 mt-1", children: ["Available Options:", " ", (N = x.modifiers) == null ? void 0 : N.map((C) => C == null ? void 0 : C.title).join(",")] })] }, x.id);
|
|
1971
|
-
}) })] }) })] }), e(
|
|
1972
|
+
}) })] }) })] }), e(Mc, { open: d, initialData: m === null ? null : n[m], onSubmit: w, onClose: () => {
|
|
1972
1973
|
p(!1), h(null);
|
|
1973
1974
|
} }, m)] });
|
|
1974
|
-
},
|
|
1975
|
+
}, Qc = ({ form: a, loading: t }) => {
|
|
1975
1976
|
const { defaultCurrency: r } = ge();
|
|
1976
1977
|
return e("section", { "aria-labelledby": "product-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Pricing" }), 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." })] }), e("div", { className: "md:col-span-2", children: e(Ie, { form: a, config: [{ name: "basePrice", label: "Base Price", type: "number", placeholder: "Enter base price", prefix: r }, { name: "discountedBasePrice", label: "Discounted Price", type: "number", placeholder: "Enter discounted price", prefix: r }], loading: t }) })] }) });
|
|
1977
1978
|
}, Hn = ({ initialData: a }) => {
|
|
@@ -1987,12 +1988,12 @@ const Fc = ({ form: a }) => {
|
|
|
1987
1988
|
}, b = (y) => {
|
|
1988
1989
|
a ? u.mutate(y, { onSuccess: g }) : h.mutate(y, { onSuccess: g });
|
|
1989
1990
|
};
|
|
1990
|
-
return e(Ve, { ...m, children: i("form", { onSubmit: m.handleSubmit((y) => b(y)), className: "space-y-14", children: [e(
|
|
1991
|
+
return e(Ve, { ...m, children: i("form", { onSubmit: m.handleSubmit((y) => b(y)), className: "space-y-14", children: [e(Rc, { form: m }), e(L, {}), e(Qc, { form: m }), e(L, {}), e(Pc, { form: m }), e(L, {}), e(Bc, { form: m }), e(L, {}), i("div", { className: "flex justify-end space-x-3", children: [i(D, { type: "button", variant: "secondary", onClick: () => r.push(n.products(s)), children: [e(Sa, { className: "w-4 h-4 mr-2" }), " Cancel"] }), i(D, { type: "submit", isLoading: h.isPending || u.isPending, loadingText: "Saving...", children: [e(nt, { className: "w-4 h-4 mr-2" }), " ", a ? "Save Product" : "Create Product"] })] })] }) });
|
|
1991
1992
|
};
|
|
1992
|
-
function
|
|
1993
|
+
function Tc() {
|
|
1993
1994
|
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Product" }), e(L, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(Hn, {}) }) })] });
|
|
1994
1995
|
}
|
|
1995
|
-
function
|
|
1996
|
+
function Jc() {
|
|
1996
1997
|
const a = O(), t = Ba(), { client: r } = I(), { data: n, isLoading: s } = M({ queryKey: ["product", a, t], queryFn: async () => {
|
|
1997
1998
|
const { status: l, body: o } = await r.product.getProduct({ params: { organizationId: a, id: t } });
|
|
1998
1999
|
if (l !== 200) throw Q.error("Failed to load product"), new Error("Failed to fetch product");
|
|
@@ -2000,7 +2001,7 @@ function Tc() {
|
|
|
2000
2001
|
} });
|
|
2001
2002
|
return i("div", { className: "space-y-6", children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Edit Product" }), e(L, {}), s ? e("div", { className: "flex justify-center py-8", children: e(ie, { className: "w-8 h-8" }) }) : e("div", { className: "pt-6", children: e(Hn, { initialData: n }) })] });
|
|
2002
2003
|
}
|
|
2003
|
-
const Fe = ca(),
|
|
2004
|
+
const Fe = ca(), Oc = ({ row: a, table: t }) => {
|
|
2004
2005
|
var p;
|
|
2005
2006
|
const { client: r } = I(), n = a.getValue("publishedAt"), s = (p = t.options.meta) == null ? void 0 : p.organizationId, l = t.options.meta.refetch, o = T({ mutationFn: async () => {
|
|
2006
2007
|
if ((await r.product.updateStatus({ params: { id: a.getValue("id"), organizationId: s, operation: n ? "unpublish" : "publish" } })).status !== 200) throw new Error("Failed to update product status");
|
|
@@ -2009,7 +2010,7 @@ const Fe = ca(), Jc = ({ row: a, table: t }) => {
|
|
|
2009
2010
|
o.mutate();
|
|
2010
2011
|
};
|
|
2011
2012
|
return o.isPending ? e("div", { className: "min-w-28", children: i("button", { 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", "tremor-id": "tremor-raw", disabled: !0, children: [e(ie, { className: "w-4 h-4" }), " Saving..."] }) }) : e("div", { className: "min-w-28", children: i("button", { onClick: d, 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", "tremor-id": "tremor-raw", children: [n ? e(it, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" }) : e(ai, { className: "w-4 h-4 text-red-600 dark:text-red-500" }), n ? "Published" : "Draft"] }) });
|
|
2012
|
-
},
|
|
2013
|
+
}, Lc = ({ row: a, table: t }) => {
|
|
2013
2014
|
var d, p, m;
|
|
2014
2015
|
const { client: r } = I(), n = (d = t.options.meta) == null ? void 0 : d.organizationId, s = t.options.meta.refetch, l = T({ mutationFn: async () => {
|
|
2015
2016
|
if ((await r.product.deleteProduct({ params: { id: a.getValue("id"), organizationId: n } })).status !== 204) throw new Error("Failed to delete product");
|
|
@@ -2018,28 +2019,28 @@ const Fe = ca(), Jc = ({ row: a, table: t }) => {
|
|
|
2018
2019
|
window.confirm("Are you sure you want to delete this product? This action cannot be undone.") && l.mutate();
|
|
2019
2020
|
};
|
|
2020
2021
|
return i(Ue, { children: [e(qe, { asChild: !0, children: e(D, { variant: "ghost", 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", disabled: l.isPending, children: l.isPending ? e(ie, { className: "size-4 shrink-0" }) : e(ot, { 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", "aria-hidden": "true" }) }) }), i(We, { align: "end", className: "min-w-40", children: [e(ve, { children: i(E, { href: ((m = (p = t.options.meta) == null ? void 0 : p.routes) == null ? void 0 : m.productEdit(n, a.getValue("id"))) ?? `/admin/${n}/products/${a.getValue("id")}`, className: "block flex items-center gap-2", children: [e(ti, { className: "w-4 h-4" }), "Edit"] }) }), e(ve, { className: "text-red-600 dark:text-red-500 cursor-pointer", onClick: o, disabled: l.isPending, children: i("div", { className: "flex items-center gap-2", children: [l.isPending ? e(ie, { className: "w-4 h-4" }) : e(Ot, { className: "w-4 h-4" }), l.isPending ? "Deleting..." : "Delete"] }) })] })] });
|
|
2021
|
-
},
|
|
2022
|
+
}, jc = [Fe.display({ id: "select", header: ({ table: a }) => e(Qe, { checked: a.getIsAllPageRowsSelected() ? !0 : a.getIsSomeRowsSelected() ? "indeterminate" : !1, onCheckedChange: () => a.toggleAllPageRowsSelected(), className: "translate-y-0.5", "aria-label": "Select all" }), cell: ({ row: a }) => e(Qe, { checked: a.getIsSelected(), onCheckedChange: () => a.toggleSelected(), className: "translate-y-0.5", "aria-label": "Select row" }), enableSorting: !1, enableHiding: !1, meta: { displayName: "Select" } }), Fe.accessor("id", { header: ({ column: a }) => e(R, { column: a, title: "Id" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a, table: t }) => {
|
|
2022
2023
|
var n, s, l;
|
|
2023
2024
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
2024
2025
|
return e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.productEdit(r, a.getValue("id"))) ?? `/admin/${r}/products/${a.getValue("id")}`, className: "text-blue-500", children: a.getValue("id") });
|
|
2025
2026
|
} }), Fe.accessor("title", { header: ({ column: a }) => e(R, { column: a, title: "Title" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" } }), Fe.accessor("sku", { header: ({ column: a }) => e(R, { column: a, title: "SKU" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "SKU" }, cell: ({ row: a }) => a.getValue("sku") || "-" }), Fe.accessor("basePrice", { header: ({ column: a }) => e(R, { column: a, title: "Base Price" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Base Price" }, cell: ({ row: a }) => `$${a.getValue("basePrice").toFixed(2)}` }), Fe.accessor("discountedBasePrice", { header: ({ column: a }) => e(R, { column: a, title: "Discounted Price" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Discounted Price" }, cell: ({ row: a }) => {
|
|
2026
2027
|
const t = a.getValue("discountedBasePrice");
|
|
2027
2028
|
return t ? `$${t.toFixed(2)}` : "-";
|
|
2028
|
-
} }), Fe.accessor("publishedAt", { header: ({ column: a }) => e(R, { column: a, title: "Status" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" }, cell: ({ row: a, table: t }) => e(
|
|
2029
|
+
} }), Fe.accessor("publishedAt", { header: ({ column: a }) => e(R, { column: a, title: "Status" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" }, cell: ({ row: a, table: t }) => e(Oc, { row: a, table: t }) }), Fe.accessor("createdAt", { header: ({ column: a }) => e(R, { column: a, title: "Created At" }), enableSorting: !1, meta: { className: "text-left", displayName: "Created At" }, cell: ({ row: a }) => {
|
|
2029
2030
|
const t = a.getValue("createdAt");
|
|
2030
2031
|
return new Date(t).toLocaleDateString();
|
|
2031
|
-
} }), Fe.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(
|
|
2032
|
+
} }), Fe.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(Lc, { row: a, table: t }) })], Vc = () => {
|
|
2032
2033
|
const { client: a } = I(), t = $(), { defaultLocale: r } = ge(), n = O(), s = pe(), [l, o] = F(""), [d] = Ze(l, 300), p = Number((s == null ? void 0 : s.get("page")) || "1"), { isLoading: m, isRefetching: h, isError: u, data: g, refetch: b } = M({ queryKey: ["products", n, p, d, r], queryFn: async () => {
|
|
2033
2034
|
const { body: f, status: w } = await a.product.getProducts({ params: { organizationId: n }, query: { page: p, limit: 10, search: d, locale: r } });
|
|
2034
2035
|
if (w !== 200) throw new Error("Failed to fetch products");
|
|
2035
2036
|
return f;
|
|
2036
2037
|
}, placeholderData: me });
|
|
2037
|
-
return i(S, { children: [i("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: [e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search products...", value: l, onChange: (f) => o(f.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }), e("div", { className: "flex items-center gap-2", children: e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.productCreate(n), children: ["Create Product", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ga, { error: u, loading: m || h, meta: g != null && g.meta ? { ...g == null ? void 0 : g.meta, currentPage: p } : void 0, data: (g == null ? void 0 : g.list) || [], columns:
|
|
2038
|
+
return i(S, { children: [i("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: [e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search products...", value: l, onChange: (f) => o(f.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }), e("div", { className: "flex items-center gap-2", children: e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.productCreate(n), children: ["Create Product", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ga, { error: u, loading: m || h, meta: g != null && g.meta ? { ...g == null ? void 0 : g.meta, currentPage: p } : void 0, data: (g == null ? void 0 : g.list) || [], columns: jc, className: "mt-8", refetch: b })] });
|
|
2038
2039
|
};
|
|
2039
|
-
function
|
|
2040
|
-
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Products List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(
|
|
2040
|
+
function Zc() {
|
|
2041
|
+
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Products List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(Vc, {}) })] });
|
|
2041
2042
|
}
|
|
2042
|
-
const
|
|
2043
|
+
const Hc = ({ organizationId: a, id: t, acceptedAt: r, cancelledAt: n, refetch: s }) => {
|
|
2043
2044
|
var u;
|
|
2044
2045
|
const { client: l } = I(), o = T({ mutationFn: async ({ operation: g }) => {
|
|
2045
2046
|
if ((await l.reservation.updateReservationStatus({ params: { organizationId: a, reservationId: t, operation: g }, body: {} })).status !== 200) throw new Error("Failed to update reservation status");
|
|
@@ -2050,14 +2051,14 @@ const Zc = ({ organizationId: a, id: t, acceptedAt: r, cancelledAt: n, refetch:
|
|
|
2050
2051
|
o.mutate({ operation: "cancel" });
|
|
2051
2052
|
}, m = o.isPending, h = (u = o.variables) == null ? void 0 : u.operation;
|
|
2052
2053
|
return i("div", { className: "flex items-center gap-2 min-w-28 min-h-[45px]", children: [!n && i("button", { onClick: p, disabled: m, 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", children: [m && h === "cancel" ? "Loading..." : "Cancel", e(Ca, { className: "w-4 h-4 text-red-600 dark:text-red-500" })] }), !r && !n && i("button", { onClick: d, disabled: m, 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", children: [m && h === "accept" ? "Loading..." : "Accept", e(it, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" })] })] });
|
|
2053
|
-
},
|
|
2054
|
+
}, Uc = ({ open: a, onOpenChange: t, reservation: r }) => e(gt, { open: a, onOpenChange: t, children: i(ft, { className: "sm:max-w-[500px] overflow-y-auto max-h-[85vh]", children: [e(an, { children: e(Kt, { children: "Reservation Details" }) }), i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 py-4", children: [i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Reference ID" }), e("p", { className: "text-sm font-medium", children: r.referenceId })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Status" }), e("p", { className: "text-sm font-medium", children: r.cancelledAt ? "Cancelled" : r.acceptedAt ? "Accepted" : "Pending" })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Customer Name" }), e("p", { className: "text-sm font-medium", children: `${r.firstname} ${r.lastname}` })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Phone" }), e("p", { className: "text-sm font-medium", children: r.phone || "N/A" })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Number of Guests" }), e("p", { className: "text-sm font-medium", children: r.guests })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Reservation Date" }), e("p", { className: "text-sm font-medium", children: r.date ? H(new Date(r.date), "PPpp") : "N/A" })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Created At" }), e("p", { className: "text-sm font-medium", children: r.createdAt ? H(new Date(r.createdAt), "PPpp") : "N/A" })] }), r.acceptedAt && i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Accepted At" }), e("p", { className: "text-sm font-medium", children: H(new Date(r.acceptedAt), "PPpp") })] }), r.cancelledAt && i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Cancelled At" }), e("p", { className: "text-sm font-medium", children: H(new Date(r.cancelledAt), "PPpp") })] })] })] }) }), qc = ({ reservation: a }) => {
|
|
2054
2055
|
const [t, r] = F(!1);
|
|
2055
|
-
return i(S, { children: [e("button", { onClick: () => r(!0), className: "text-blue-500 hover:underline", children: String(a.id).slice(-5) }), e(
|
|
2056
|
-
},
|
|
2056
|
+
return i(S, { children: [e("button", { onClick: () => r(!0), className: "text-blue-500 hover:underline", children: String(a.id).slice(-5) }), e(Uc, { open: t, onOpenChange: r, reservation: a })] });
|
|
2057
|
+
}, Wc = ({ reservation: a, table: t }) => {
|
|
2057
2058
|
const r = t.options.meta, n = (r == null ? void 0 : r.organizationId) || "", s = typeof (r == null ? void 0 : r.refetch) == "function" ? r.refetch : () => {
|
|
2058
2059
|
};
|
|
2059
|
-
return e(
|
|
2060
|
-
}, Re = ca(),
|
|
2060
|
+
return e(Hc, { organizationId: n, id: a.id, acceptedAt: a.acceptedAt, cancelledAt: a.cancelledAt, refetch: s });
|
|
2061
|
+
}, Re = ca(), _c = [Re.accessor("id", { header: ({ column: a }) => e(R, { column: a, title: "ID" }), meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a }) => e(qc, { reservation: a.original }), enableSorting: !0, enableHiding: !1 }), Re.accessor("referenceId", { header: ({ column: a }) => e(R, { column: a, title: "Reference ID" }), cell: ({ row: a }) => e("div", { className: "w-[100px]", children: a.getValue("referenceId") }), meta: { className: "text-left", displayName: "Reference ID" }, enableSorting: !1, enableHiding: !1 }), Re.display({ id: "customer", meta: { className: "text-left", displayName: "Customer" }, header: ({ column: a }) => e(R, { column: a, title: "Customer" }), cell: ({ row: a }) => {
|
|
2061
2062
|
const t = a.original.firstname || "", r = a.original.lastname || "";
|
|
2062
2063
|
return e("div", { children: `${t} ${r}`.trim() || "N/A" });
|
|
2063
2064
|
} }), Re.accessor("guests", { meta: { className: "text-left", displayName: "Guests" }, enableSorting: !0, enableHiding: !1, header: ({ column: a }) => e(R, { column: a, title: "Guests" }), cell: ({ row: a }) => e("div", { className: "font-medium", children: a.original.guests }) }), Re.accessor("phone", { meta: { className: "text-left", displayName: "Phone" }, enableSorting: !1, enableHiding: !1, header: ({ column: a }) => e(R, { column: a, title: "Phone" }), cell: ({ row: a }) => e("div", { children: a.original.phone || "N/A" }) }), Re.accessor("date", { meta: { className: "text-left", displayName: "Reservation Date" }, enableSorting: !0, enableHiding: !1, header: ({ column: a }) => e(R, { column: a, title: "Reservation Date" }), cell: ({ row: a }) => {
|
|
@@ -2069,18 +2070,18 @@ const Zc = ({ organizationId: a, id: t, acceptedAt: r, cancelledAt: n, refetch:
|
|
|
2069
2070
|
} }), Re.display({ id: "status", meta: { className: "text-left", displayName: "Status" }, header: ({ column: a }) => e(R, { column: a, title: "Status" }), cell: ({ row: a }) => {
|
|
2070
2071
|
const t = a.original.acceptedAt;
|
|
2071
2072
|
return a.original.cancelledAt ? e("div", { className: "text-red-600 font-medium", children: "Cancelled" }) : t ? e("div", { className: "text-green-600 font-medium", children: "Accepted" }) : e("div", { className: "text-yellow-600 font-medium", children: "Pending" });
|
|
2072
|
-
} }), Re.display({ id: "actions", header: ({ column: a }) => e(R, { column: a, title: "Actions" }), cell: ({ row: a, table: t }) => e(
|
|
2073
|
+
} }), Re.display({ id: "actions", header: ({ column: a }) => e(R, { column: a, title: "Actions" }), cell: ({ row: a, table: t }) => e(Wc, { reservation: a.original, table: t }) })], Gc = () => {
|
|
2073
2074
|
const { client: a } = I(), t = O(), r = pe(), [n, s] = F(""), [l] = Ze(n, 300), o = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: p, isError: m, data: h, refetch: u } = M({ queryKey: ["reservations", t, o, l], queryFn: async () => {
|
|
2074
2075
|
const { body: g, status: b } = await a.reservation.getReservations({ params: { organizationId: t }, query: { page: o, limit: 10, search: l } });
|
|
2075
2076
|
if (b !== 200) throw new Error("Failed to fetch reservations");
|
|
2076
2077
|
return g;
|
|
2077
2078
|
}, placeholderData: me });
|
|
2078
|
-
return i(S, { children: [e("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search by name or reference...", value: n, onChange: (g) => s(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }) }), e(ga, { error: m, loading: d || p, meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: o } : void 0, data: (h == null ? void 0 : h.list) || [], columns:
|
|
2079
|
+
return i(S, { children: [e("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(fa, { type: "search", placeholder: "Search by name or reference...", value: n, onChange: (g) => s(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }) }), e(ga, { error: m, loading: d || p, meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: o } : void 0, data: (h == null ? void 0 : h.list) || [], columns: _c, className: "mt-8", refetch: u })] });
|
|
2079
2080
|
};
|
|
2080
|
-
function
|
|
2081
|
-
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Reservations List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(
|
|
2081
|
+
function $c() {
|
|
2082
|
+
return i(S, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Reservations List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-10", children: e(Gc, {}) })] });
|
|
2082
2083
|
}
|
|
2083
|
-
const $c = () => i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 451, zoomAndPan: "magnify", viewBox: "0 0 338.25 101.249998", height: 135, preserveAspectRatio: "xMidYMid meet", className: "h-auto w-3/4 mr-5 text-[#15203a] dark:text-white", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "e96f145012", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("g", {}), e("clipPath", { id: "2854c0f5ba", children: e("path", { d: "M 280.070312 29.789062 L 335.910156 29.789062 L 335.910156 85.628906 L 280.070312 85.628906 Z M 280.070312 29.789062 ", clipRule: "nonzero" }) }), e("clipPath", { id: "a2b4eafd05", children: e("path", { d: "M 312.023438 83.421875 L 333.382812 62.0625 C 335.910156 59.535156 335.910156 55.460938 333.382812 52.933594 L 312.285156 31.835938 C 310.859375 30.410156 308.949219 29.632812 306.941406 29.632812 L 280.46875 29.632812 L 303.773438 52.933594 C 306.296875 55.460938 306.296875 59.535156 303.773438 62.0625 L 280.210938 85.621094 L 306.683594 85.621094 C 308.691406 85.621094 310.601562 84.8125 312.023438 83.421875 Z M 312.023438 83.421875 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAdElEQVRoge3PMQqEQBAAwXVB//9kEwMD9eAwKrthYGBgoJZx3xxjrMdsp/1qft3f+PHvfc4HJFNIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFIppFJIpZBKIZU+gdwB24gBccg7AIAAAAAASUVORK5CYII=", id: "c594f9d06d", height: 57, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "1f1a4971c6", children: e("g", { filter: "url(#e96f145012)", children: e("g", { children: e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAdElEQVRoge3PMQqEQBAAwXVB//9kEwMD9eAwKrthYGBgoJZx3xxjrMdsp/1qft3f+PHvfc4HJFNIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFIppFJIpZBKIZU+gdwB24gBccg7AIAAAAAASUVORK5CYII=", height: 57, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "d584d4a10b", children: e("rect", { x: 0, width: 57, y: 0, height: 57 }) }), e("pattern", { id: "ca59399d09", patternUnits: "userSpaceOnUse", width: 57, patternTransform: "matrix(0.992647, 0, 0, -0.992647, 279.805145, 86.320587)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 57 57", height: 57, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#d584d4a10b)", children: e("g", { mask: "url(#1f1a4971c6)", children: e("rect", { x: "-356.844005", width: "490.68801", fill: "#8c52ff", height: "146.88", y: "-37.48", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "058149a1c1", children: e("path", { d: "M 271.277344 20.996094 L 327 20.996094 L 327 76.832031 L 271.277344 76.832031 Z M 271.277344 20.996094 ", clipRule: "nonzero" }) }), e("clipPath", { id: "3a8b0dae6b", children: e("path", { d: "M 303.230469 74.625 L 324.589844 53.265625 C 327.113281 50.742188 327.113281 46.664062 324.589844 44.140625 L 303.488281 23.039062 C 302.0625 21.613281 300.15625 20.839844 298.148438 20.839844 L 271.675781 20.839844 L 294.976562 44.140625 C 297.5 46.664062 297.5 50.742188 294.976562 53.265625 L 271.414062 76.824219 L 297.890625 76.824219 C 299.894531 76.824219 301.804688 76.015625 303.230469 74.625 Z M 303.230469 74.625 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAbklEQVRoge3PwQmAAAwEwaho/yVbgfrQ17gLeR0EZpnrlpk5Zma/ubf7Fz+e9m29QTKFVAqpFFIppFJIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFLpF8gT2vQBcSod/NEAAAAASUVORK5CYII=", id: "85d98eb3ed", height: 57, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "712d9ec0cc", children: e("g", { filter: "url(#e96f145012)", children: e("g", { children: e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAbklEQVRoge3PwQmAAAwEwaho/yVbgfrQ17gLeR0EZpnrlpk5Zma/ubf7Fz+e9m29QTKFVAqpFFIppFJIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFLpF8gT2vQBcSod/NEAAAAASUVORK5CYII=", height: 57, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "66291c0f48", children: e("rect", { x: 0, width: 57, y: 0, height: 57 }) }), e("pattern", { id: "82194e6edc", patternUnits: "userSpaceOnUse", width: 57, patternTransform: "matrix(0.992647, 0, 0, -0.992647, 270.871322, 77.386763)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 57 57", height: 57, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#66291c0f48)", children: e("g", { mask: "url(#712d9ec0cc)", children: e("rect", { x: "-347.844005", width: "490.68801", fill: "#8c52ff", height: "146.88", y: "-46.48", fillOpacity: 1 }) }) }) }) })] }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(19.705917, 70.793676)", children: e("g", { children: e("path", { d: "M 16.359375 0.0625 C 13.921875 0.0625 11.773438 -0.289062 9.921875 -1 C 8.441406 -1.59375 6.925781 -2.570312 5.375 -3.9375 C 3.601562 -5.5625 2.476562 -7.578125 2 -9.984375 C 1.8125 -10.753906 1.71875 -11.53125 1.71875 -12.3125 C 1.675781 -12.570312 1.675781 -12.832031 1.71875 -13.09375 L 1.71875 -13.46875 L 9.3125 -13.359375 L 9.3125 -13.421875 C 9.3125 -12.054688 9.609375 -10.925781 10.203125 -10.03125 C 11.304688 -8.375 13.359375 -7.546875 16.359375 -7.546875 C 21.160156 -7.546875 23.5625 -8.671875 23.5625 -10.921875 C 23.5625 -13.109375 21.085938 -14.476562 16.140625 -15.03125 C 13.285156 -15.363281 10.84375 -15.953125 8.8125 -16.796875 C 6.925781 -17.578125 5.394531 -18.613281 4.21875 -19.90625 C 2.550781 -21.757812 1.71875 -23.90625 1.71875 -26.34375 C 1.71875 -27.851562 1.992188 -29.273438 2.546875 -30.609375 C 2.953125 -31.609375 3.507812 -32.515625 4.21875 -33.328125 C 6.800781 -36.242188 10.90625 -37.703125 16.53125 -37.703125 C 19.894531 -37.703125 22.738281 -37.039062 25.0625 -35.71875 C 26.832031 -34.71875 28.273438 -33.382812 29.390625 -31.71875 C 30.203125 -30.457031 30.773438 -29.015625 31.109375 -27.390625 C 31.222656 -26.835938 31.296875 -26.285156 31.328125 -25.734375 C 31.367188 -25.546875 31.390625 -25.359375 31.390625 -25.171875 L 31.390625 -24.84375 L 23.796875 -24.84375 L 23.796875 -24.78125 C 23.828125 -25.894531 23.546875 -26.835938 22.953125 -27.609375 C 21.773438 -29.273438 19.632812 -30.109375 16.53125 -30.109375 C 14.644531 -30.109375 13.085938 -29.867188 11.859375 -29.390625 C 10.347656 -28.796875 9.59375 -27.945312 9.59375 -26.84375 C 9.59375 -24.550781 12.050781 -23.125 16.96875 -22.5625 C 22.507812 -21.9375 26.503906 -20.21875 28.953125 -17.40625 C 30.578125 -15.488281 31.390625 -13.328125 31.390625 -10.921875 L 31.390625 -10.421875 C 31.390625 -10.203125 31.367188 -9.984375 31.328125 -9.765625 C 31.296875 -9.171875 31.222656 -8.613281 31.109375 -8.09375 C 30.734375 -6.613281 30.03125 -5.300781 29 -4.15625 C 27.78125 -2.789062 26.132812 -1.738281 24.0625 -1 C 22 -0.289062 19.429688 0.0625 16.359375 0.0625 Z M 16.359375 0.0625 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(52.748732, 70.793676)", children: e("g", { children: e("path", { d: "M 30.78125 0 L 23.5625 0 L 23.5625 -14.078125 L 23.515625 -14.078125 L 23.515625 -14.25 C 23.515625 -16.175781 22.828125 -17.820312 21.453125 -19.1875 C 20.085938 -20.550781 18.425781 -21.234375 16.46875 -21.234375 C 14.550781 -21.234375 12.890625 -20.53125 11.484375 -19.125 C 10.078125 -17.726562 9.410156 -16.066406 9.484375 -14.140625 L 9.484375 -14.078125 L 9.421875 -14.078125 L 9.421875 0 L 1.65625 0 L 1.65625 -36.046875 L 9.421875 -36.046875 L 9.421875 -24.953125 C 11.160156 -27.023438 13.492188 -28.191406 16.421875 -28.453125 C 20.484375 -28.785156 23.84375 -27.726562 26.5 -25.28125 C 29.351562 -22.65625 30.78125 -18.976562 30.78125 -14.25 Z M 30.78125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(85.181699, 70.793676)", children: e("g", { children: e("path", { d: "M 14.8125 -28.5625 C 18.757812 -28.59375 22.117188 -27.222656 24.890625 -24.453125 C 27.703125 -21.640625 29.109375 -18.273438 29.109375 -14.359375 C 29.148438 -10.398438 27.785156 -7.035156 25.015625 -4.265625 C 22.234375 -1.460938 18.882812 -0.0390625 14.96875 0 C 11.007812 0.0390625 7.628906 -1.328125 4.828125 -4.109375 C 2.015625 -6.878906 0.609375 -10.242188 0.609375 -14.203125 C 0.566406 -18.148438 1.9375 -21.507812 4.71875 -24.28125 C 7.488281 -27.09375 10.851562 -28.519531 14.8125 -28.5625 Z M 19.859375 -9.3125 C 21.222656 -10.6875 21.90625 -12.351562 21.90625 -14.3125 C 21.90625 -16.226562 21.203125 -17.890625 19.796875 -19.296875 C 18.390625 -20.628906 16.726562 -21.296875 14.8125 -21.296875 C 12.882812 -21.296875 11.238281 -20.613281 9.875 -19.25 C 8.5 -17.800781 7.8125 -16.132812 7.8125 -14.25 C 7.8125 -12.332031 8.515625 -10.671875 9.921875 -9.265625 C 11.296875 -7.890625 12.960938 -7.203125 14.921875 -7.203125 C 16.910156 -7.273438 18.554688 -7.976562 19.859375 -9.3125 Z M 19.859375 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(114.89805, 70.793676)", children: e("g", { children: e("path", { d: "M 16.53125 -28.5625 C 20.445312 -28.59375 23.8125 -27.222656 26.625 -24.453125 C 29.425781 -21.679688 30.847656 -18.316406 30.890625 -14.359375 C 30.921875 -10.441406 29.550781 -7.078125 26.78125 -4.265625 C 24.007812 -1.460938 20.644531 -0.0390625 16.6875 0 C 13.46875 0 11.046875 -1.015625 9.421875 -3.046875 L 9.421875 10.640625 L 1.65625 10.640625 L 1.65625 -28.5 L 9.421875 -28.5 L 9.421875 -25.515625 C 10.941406 -27.472656 13.3125 -28.488281 16.53125 -28.5625 Z M 21.625 -9.3125 C 23.03125 -10.71875 23.695312 -12.382812 23.625 -14.3125 C 23.625 -16.269531 22.941406 -17.929688 21.578125 -19.296875 C 20.171875 -20.628906 18.503906 -21.296875 16.578125 -21.296875 C 14.617188 -21.296875 12.957031 -20.613281 11.59375 -19.25 C 10.21875 -17.800781 9.53125 -16.132812 9.53125 -14.25 C 9.613281 -12.25 10.316406 -10.585938 11.640625 -9.265625 C 13.015625 -7.890625 14.679688 -7.203125 16.640625 -7.203125 C 18.628906 -7.273438 20.289062 -7.976562 21.625 -9.3125 Z M 21.625 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(146.665722, 70.793676)", children: e("g", { children: e("path", { d: "M 30.78125 0 L 23.5625 0 L 23.5625 -14.078125 L 23.515625 -14.078125 L 23.515625 -14.25 C 23.515625 -16.175781 22.828125 -17.820312 21.453125 -19.1875 C 20.085938 -20.550781 18.425781 -21.234375 16.46875 -21.234375 C 14.550781 -21.234375 12.890625 -20.53125 11.484375 -19.125 C 10.078125 -17.726562 9.410156 -16.066406 9.484375 -14.140625 L 9.484375 -14.078125 L 9.421875 -14.078125 L 9.421875 0 L 1.65625 0 L 1.65625 -36.046875 L 9.421875 -36.046875 L 9.421875 -24.953125 C 11.160156 -27.023438 13.492188 -28.191406 16.421875 -28.453125 C 20.484375 -28.785156 23.84375 -27.726562 26.5 -25.28125 C 29.351562 -22.65625 30.78125 -18.976562 30.78125 -14.25 Z M 30.78125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(179.09869, 70.793676)", children: e("g", { children: e("path", { d: "M 14.8125 -28.5625 C 18.757812 -28.59375 22.117188 -27.222656 24.890625 -24.453125 C 27.703125 -21.640625 29.109375 -18.273438 29.109375 -14.359375 C 29.148438 -10.398438 27.785156 -7.035156 25.015625 -4.265625 C 22.234375 -1.460938 18.882812 -0.0390625 14.96875 0 C 11.007812 0.0390625 7.628906 -1.328125 4.828125 -4.109375 C 2.015625 -6.878906 0.609375 -10.242188 0.609375 -14.203125 C 0.566406 -18.148438 1.9375 -21.507812 4.71875 -24.28125 C 7.488281 -27.09375 10.851562 -28.519531 14.8125 -28.5625 Z M 19.859375 -9.3125 C 21.222656 -10.6875 21.90625 -12.351562 21.90625 -14.3125 C 21.90625 -16.226562 21.203125 -17.890625 19.796875 -19.296875 C 18.390625 -20.628906 16.726562 -21.296875 14.8125 -21.296875 C 12.882812 -21.296875 11.238281 -20.613281 9.875 -19.25 C 8.5 -17.800781 7.8125 -16.132812 7.8125 -14.25 C 7.8125 -12.332031 8.515625 -10.671875 9.921875 -9.265625 C 11.296875 -7.890625 12.960938 -7.203125 14.921875 -7.203125 C 16.910156 -7.273438 18.554688 -7.976562 19.859375 -9.3125 Z M 19.859375 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(208.81504, 70.793676)", children: e("g", { children: e("path", { d: "M 13.203125 0 C 11.273438 0 9.59375 -0.296875 8.15625 -0.890625 C 7.007812 -1.296875 5.828125 -2.050781 4.609375 -3.15625 C 2.492188 -5.113281 1.53125 -7.59375 1.71875 -10.59375 L 1.71875 -11.203125 L 7.9375 -11.09375 L 8.421875 -11.09375 L 8.421875 -10.640625 C 8.460938 -9.722656 8.664062 -8.96875 9.03125 -8.375 C 9.664062 -7.300781 11.054688 -6.765625 13.203125 -6.765625 C 14.972656 -6.765625 16.25 -6.96875 17.03125 -7.375 C 17.4375 -7.5625 17.710938 -7.800781 17.859375 -8.09375 C 17.929688 -8.207031 17.96875 -8.316406 17.96875 -8.421875 L 18.015625 -8.703125 C 18.015625 -9.484375 17.40625 -10.113281 16.1875 -10.59375 C 15.707031 -10.78125 15.15625 -10.925781 14.53125 -11.03125 C 14.050781 -11.144531 13.515625 -11.238281 12.921875 -11.3125 C 10.703125 -11.53125 8.851562 -11.972656 7.375 -12.640625 C 5.894531 -13.234375 4.675781 -14.046875 3.71875 -15.078125 C 2.382812 -16.597656 1.71875 -18.335938 1.71875 -20.296875 C 1.71875 -21.515625 1.941406 -22.640625 2.390625 -23.671875 C 2.722656 -24.484375 3.164062 -25.207031 3.71875 -25.84375 C 5.707031 -28.132812 8.90625 -29.28125 13.3125 -29.28125 C 15.9375 -29.28125 18.15625 -28.757812 19.96875 -27.71875 C 21.375 -26.945312 22.5 -25.894531 23.34375 -24.5625 C 24.007812 -23.5625 24.472656 -22.398438 24.734375 -21.078125 C 24.804688 -20.628906 24.859375 -20.203125 24.890625 -19.796875 L 24.890625 -18.625 L 18.1875 -18.625 L 18.1875 -19.46875 C 18.15625 -19.613281 18.140625 -19.757812 18.140625 -19.90625 C 18.023438 -20.3125 17.875 -20.644531 17.6875 -20.90625 C 16.875 -22.007812 15.414062 -22.5625 13.3125 -22.5625 C 10.207031 -22.5625 8.65625 -21.914062 8.65625 -20.625 C 8.65625 -19.957031 9.023438 -19.421875 9.765625 -19.015625 C 10.535156 -18.535156 11.847656 -18.1875 13.703125 -17.96875 C 17.953125 -17.519531 21.035156 -16.171875 22.953125 -13.921875 C 24.242188 -12.398438 24.890625 -10.660156 24.890625 -8.703125 L 24.890625 -8.3125 L 24.84375 -7.8125 C 24.84375 -7.332031 24.785156 -6.890625 24.671875 -6.484375 C 24.378906 -5.304688 23.828125 -4.253906 23.015625 -3.328125 C 22.085938 -2.210938 20.789062 -1.378906 19.125 -0.828125 C 17.46875 -0.273438 15.492188 0 13.203125 0 Z M 13.203125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(235.371259, 70.793676)", children: e("g", { children: e("path", { d: "M 22.234375 -28.5625 L 22.234375 -20.796875 L 15.859375 -20.796875 L 15.859375 0 L 8.09375 0 L 8.09375 -20.796875 L 1.65625 -20.796875 L 1.65625 -28.5625 L 8.09375 -28.5625 L 8.09375 -38.546875 L 15.859375 -38.546875 L 15.859375 -28.5625 Z M 22.234375 -28.5625 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(259.266309, 70.793676)", children: e("g", { children: e("path", { d: "M 9.421875 0 L 1.65625 0 L 1.65625 -7.765625 L 9.421875 -7.765625 Z M 9.421875 0 " }) }) }) }), e("g", { clipPath: "url(#2854c0f5ba)", children: e("g", { clipPath: "url(#a2b4eafd05)", children: e("path", { fill: "url(#ca59399d09)", d: "M 335.910156 85.621094 L 280.214844 85.621094 L 280.214844 29.789062 L 335.910156 29.789062 Z M 335.910156 85.621094 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#058149a1c1)", children: e("g", { clipPath: "url(#3a8b0dae6b)", children: e("path", { fill: "url(#82194e6edc)", d: "M 327.113281 76.824219 L 271.417969 76.824219 L 271.417969 20.992188 L 327.113281 20.992188 Z M 327.113281 76.824219 ", fillRule: "nonzero" }) }) })] }), Un = (a) => e(Z.Root, { ...a });
|
|
2084
|
+
const Kc = () => i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 451, zoomAndPan: "magnify", viewBox: "0 0 338.25 101.249998", height: 135, preserveAspectRatio: "xMidYMid meet", className: "h-auto w-3/4 mr-5 text-[#15203a] dark:text-white", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "e96f145012", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("g", {}), e("clipPath", { id: "2854c0f5ba", children: e("path", { d: "M 280.070312 29.789062 L 335.910156 29.789062 L 335.910156 85.628906 L 280.070312 85.628906 Z M 280.070312 29.789062 ", clipRule: "nonzero" }) }), e("clipPath", { id: "a2b4eafd05", children: e("path", { d: "M 312.023438 83.421875 L 333.382812 62.0625 C 335.910156 59.535156 335.910156 55.460938 333.382812 52.933594 L 312.285156 31.835938 C 310.859375 30.410156 308.949219 29.632812 306.941406 29.632812 L 280.46875 29.632812 L 303.773438 52.933594 C 306.296875 55.460938 306.296875 59.535156 303.773438 62.0625 L 280.210938 85.621094 L 306.683594 85.621094 C 308.691406 85.621094 310.601562 84.8125 312.023438 83.421875 Z M 312.023438 83.421875 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAdElEQVRoge3PMQqEQBAAwXVB//9kEwMD9eAwKrthYGBgoJZx3xxjrMdsp/1qft3f+PHvfc4HJFNIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFIppFJIpZBKIZU+gdwB24gBccg7AIAAAAAASUVORK5CYII=", id: "c594f9d06d", height: 57, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "1f1a4971c6", children: e("g", { filter: "url(#e96f145012)", children: e("g", { children: e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAdElEQVRoge3PMQqEQBAAwXVB//9kEwMD9eAwKrthYGBgoJZx3xxjrMdsp/1qft3f+PHvfc4HJFNIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFIppFJIpZBKIZU+gdwB24gBccg7AIAAAAAASUVORK5CYII=", height: 57, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "d584d4a10b", children: e("rect", { x: 0, width: 57, y: 0, height: 57 }) }), e("pattern", { id: "ca59399d09", patternUnits: "userSpaceOnUse", width: 57, patternTransform: "matrix(0.992647, 0, 0, -0.992647, 279.805145, 86.320587)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 57 57", height: 57, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#d584d4a10b)", children: e("g", { mask: "url(#1f1a4971c6)", children: e("rect", { x: "-356.844005", width: "490.68801", fill: "#8c52ff", height: "146.88", y: "-37.48", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "058149a1c1", children: e("path", { d: "M 271.277344 20.996094 L 327 20.996094 L 327 76.832031 L 271.277344 76.832031 Z M 271.277344 20.996094 ", clipRule: "nonzero" }) }), e("clipPath", { id: "3a8b0dae6b", children: e("path", { d: "M 303.230469 74.625 L 324.589844 53.265625 C 327.113281 50.742188 327.113281 46.664062 324.589844 44.140625 L 303.488281 23.039062 C 302.0625 21.613281 300.15625 20.839844 298.148438 20.839844 L 271.675781 20.839844 L 294.976562 44.140625 C 297.5 46.664062 297.5 50.742188 294.976562 53.265625 L 271.414062 76.824219 L 297.890625 76.824219 C 299.894531 76.824219 301.804688 76.015625 303.230469 74.625 Z M 303.230469 74.625 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAbklEQVRoge3PwQmAAAwEwaho/yVbgfrQ17gLeR0EZpnrlpk5Zma/ubf7Fz+e9m29QTKFVAqpFFIppFJIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFLpF8gT2vQBcSod/NEAAAAASUVORK5CYII=", id: "85d98eb3ed", height: 57, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "712d9ec0cc", children: e("g", { filter: "url(#e96f145012)", children: e("g", { children: e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAbklEQVRoge3PwQmAAAwEwaho/yVbgfrQ17gLeR0EZpnrlpk5Zma/ubf7Fz+e9m29QTKFVAqpFFIppFJIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFLpF8gT2vQBcSod/NEAAAAASUVORK5CYII=", height: 57, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "66291c0f48", children: e("rect", { x: 0, width: 57, y: 0, height: 57 }) }), e("pattern", { id: "82194e6edc", patternUnits: "userSpaceOnUse", width: 57, patternTransform: "matrix(0.992647, 0, 0, -0.992647, 270.871322, 77.386763)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 57 57", height: 57, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#66291c0f48)", children: e("g", { mask: "url(#712d9ec0cc)", children: e("rect", { x: "-347.844005", width: "490.68801", fill: "#8c52ff", height: "146.88", y: "-46.48", fillOpacity: 1 }) }) }) }) })] }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(19.705917, 70.793676)", children: e("g", { children: e("path", { d: "M 16.359375 0.0625 C 13.921875 0.0625 11.773438 -0.289062 9.921875 -1 C 8.441406 -1.59375 6.925781 -2.570312 5.375 -3.9375 C 3.601562 -5.5625 2.476562 -7.578125 2 -9.984375 C 1.8125 -10.753906 1.71875 -11.53125 1.71875 -12.3125 C 1.675781 -12.570312 1.675781 -12.832031 1.71875 -13.09375 L 1.71875 -13.46875 L 9.3125 -13.359375 L 9.3125 -13.421875 C 9.3125 -12.054688 9.609375 -10.925781 10.203125 -10.03125 C 11.304688 -8.375 13.359375 -7.546875 16.359375 -7.546875 C 21.160156 -7.546875 23.5625 -8.671875 23.5625 -10.921875 C 23.5625 -13.109375 21.085938 -14.476562 16.140625 -15.03125 C 13.285156 -15.363281 10.84375 -15.953125 8.8125 -16.796875 C 6.925781 -17.578125 5.394531 -18.613281 4.21875 -19.90625 C 2.550781 -21.757812 1.71875 -23.90625 1.71875 -26.34375 C 1.71875 -27.851562 1.992188 -29.273438 2.546875 -30.609375 C 2.953125 -31.609375 3.507812 -32.515625 4.21875 -33.328125 C 6.800781 -36.242188 10.90625 -37.703125 16.53125 -37.703125 C 19.894531 -37.703125 22.738281 -37.039062 25.0625 -35.71875 C 26.832031 -34.71875 28.273438 -33.382812 29.390625 -31.71875 C 30.203125 -30.457031 30.773438 -29.015625 31.109375 -27.390625 C 31.222656 -26.835938 31.296875 -26.285156 31.328125 -25.734375 C 31.367188 -25.546875 31.390625 -25.359375 31.390625 -25.171875 L 31.390625 -24.84375 L 23.796875 -24.84375 L 23.796875 -24.78125 C 23.828125 -25.894531 23.546875 -26.835938 22.953125 -27.609375 C 21.773438 -29.273438 19.632812 -30.109375 16.53125 -30.109375 C 14.644531 -30.109375 13.085938 -29.867188 11.859375 -29.390625 C 10.347656 -28.796875 9.59375 -27.945312 9.59375 -26.84375 C 9.59375 -24.550781 12.050781 -23.125 16.96875 -22.5625 C 22.507812 -21.9375 26.503906 -20.21875 28.953125 -17.40625 C 30.578125 -15.488281 31.390625 -13.328125 31.390625 -10.921875 L 31.390625 -10.421875 C 31.390625 -10.203125 31.367188 -9.984375 31.328125 -9.765625 C 31.296875 -9.171875 31.222656 -8.613281 31.109375 -8.09375 C 30.734375 -6.613281 30.03125 -5.300781 29 -4.15625 C 27.78125 -2.789062 26.132812 -1.738281 24.0625 -1 C 22 -0.289062 19.429688 0.0625 16.359375 0.0625 Z M 16.359375 0.0625 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(52.748732, 70.793676)", children: e("g", { children: e("path", { d: "M 30.78125 0 L 23.5625 0 L 23.5625 -14.078125 L 23.515625 -14.078125 L 23.515625 -14.25 C 23.515625 -16.175781 22.828125 -17.820312 21.453125 -19.1875 C 20.085938 -20.550781 18.425781 -21.234375 16.46875 -21.234375 C 14.550781 -21.234375 12.890625 -20.53125 11.484375 -19.125 C 10.078125 -17.726562 9.410156 -16.066406 9.484375 -14.140625 L 9.484375 -14.078125 L 9.421875 -14.078125 L 9.421875 0 L 1.65625 0 L 1.65625 -36.046875 L 9.421875 -36.046875 L 9.421875 -24.953125 C 11.160156 -27.023438 13.492188 -28.191406 16.421875 -28.453125 C 20.484375 -28.785156 23.84375 -27.726562 26.5 -25.28125 C 29.351562 -22.65625 30.78125 -18.976562 30.78125 -14.25 Z M 30.78125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(85.181699, 70.793676)", children: e("g", { children: e("path", { d: "M 14.8125 -28.5625 C 18.757812 -28.59375 22.117188 -27.222656 24.890625 -24.453125 C 27.703125 -21.640625 29.109375 -18.273438 29.109375 -14.359375 C 29.148438 -10.398438 27.785156 -7.035156 25.015625 -4.265625 C 22.234375 -1.460938 18.882812 -0.0390625 14.96875 0 C 11.007812 0.0390625 7.628906 -1.328125 4.828125 -4.109375 C 2.015625 -6.878906 0.609375 -10.242188 0.609375 -14.203125 C 0.566406 -18.148438 1.9375 -21.507812 4.71875 -24.28125 C 7.488281 -27.09375 10.851562 -28.519531 14.8125 -28.5625 Z M 19.859375 -9.3125 C 21.222656 -10.6875 21.90625 -12.351562 21.90625 -14.3125 C 21.90625 -16.226562 21.203125 -17.890625 19.796875 -19.296875 C 18.390625 -20.628906 16.726562 -21.296875 14.8125 -21.296875 C 12.882812 -21.296875 11.238281 -20.613281 9.875 -19.25 C 8.5 -17.800781 7.8125 -16.132812 7.8125 -14.25 C 7.8125 -12.332031 8.515625 -10.671875 9.921875 -9.265625 C 11.296875 -7.890625 12.960938 -7.203125 14.921875 -7.203125 C 16.910156 -7.273438 18.554688 -7.976562 19.859375 -9.3125 Z M 19.859375 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(114.89805, 70.793676)", children: e("g", { children: e("path", { d: "M 16.53125 -28.5625 C 20.445312 -28.59375 23.8125 -27.222656 26.625 -24.453125 C 29.425781 -21.679688 30.847656 -18.316406 30.890625 -14.359375 C 30.921875 -10.441406 29.550781 -7.078125 26.78125 -4.265625 C 24.007812 -1.460938 20.644531 -0.0390625 16.6875 0 C 13.46875 0 11.046875 -1.015625 9.421875 -3.046875 L 9.421875 10.640625 L 1.65625 10.640625 L 1.65625 -28.5 L 9.421875 -28.5 L 9.421875 -25.515625 C 10.941406 -27.472656 13.3125 -28.488281 16.53125 -28.5625 Z M 21.625 -9.3125 C 23.03125 -10.71875 23.695312 -12.382812 23.625 -14.3125 C 23.625 -16.269531 22.941406 -17.929688 21.578125 -19.296875 C 20.171875 -20.628906 18.503906 -21.296875 16.578125 -21.296875 C 14.617188 -21.296875 12.957031 -20.613281 11.59375 -19.25 C 10.21875 -17.800781 9.53125 -16.132812 9.53125 -14.25 C 9.613281 -12.25 10.316406 -10.585938 11.640625 -9.265625 C 13.015625 -7.890625 14.679688 -7.203125 16.640625 -7.203125 C 18.628906 -7.273438 20.289062 -7.976562 21.625 -9.3125 Z M 21.625 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(146.665722, 70.793676)", children: e("g", { children: e("path", { d: "M 30.78125 0 L 23.5625 0 L 23.5625 -14.078125 L 23.515625 -14.078125 L 23.515625 -14.25 C 23.515625 -16.175781 22.828125 -17.820312 21.453125 -19.1875 C 20.085938 -20.550781 18.425781 -21.234375 16.46875 -21.234375 C 14.550781 -21.234375 12.890625 -20.53125 11.484375 -19.125 C 10.078125 -17.726562 9.410156 -16.066406 9.484375 -14.140625 L 9.484375 -14.078125 L 9.421875 -14.078125 L 9.421875 0 L 1.65625 0 L 1.65625 -36.046875 L 9.421875 -36.046875 L 9.421875 -24.953125 C 11.160156 -27.023438 13.492188 -28.191406 16.421875 -28.453125 C 20.484375 -28.785156 23.84375 -27.726562 26.5 -25.28125 C 29.351562 -22.65625 30.78125 -18.976562 30.78125 -14.25 Z M 30.78125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(179.09869, 70.793676)", children: e("g", { children: e("path", { d: "M 14.8125 -28.5625 C 18.757812 -28.59375 22.117188 -27.222656 24.890625 -24.453125 C 27.703125 -21.640625 29.109375 -18.273438 29.109375 -14.359375 C 29.148438 -10.398438 27.785156 -7.035156 25.015625 -4.265625 C 22.234375 -1.460938 18.882812 -0.0390625 14.96875 0 C 11.007812 0.0390625 7.628906 -1.328125 4.828125 -4.109375 C 2.015625 -6.878906 0.609375 -10.242188 0.609375 -14.203125 C 0.566406 -18.148438 1.9375 -21.507812 4.71875 -24.28125 C 7.488281 -27.09375 10.851562 -28.519531 14.8125 -28.5625 Z M 19.859375 -9.3125 C 21.222656 -10.6875 21.90625 -12.351562 21.90625 -14.3125 C 21.90625 -16.226562 21.203125 -17.890625 19.796875 -19.296875 C 18.390625 -20.628906 16.726562 -21.296875 14.8125 -21.296875 C 12.882812 -21.296875 11.238281 -20.613281 9.875 -19.25 C 8.5 -17.800781 7.8125 -16.132812 7.8125 -14.25 C 7.8125 -12.332031 8.515625 -10.671875 9.921875 -9.265625 C 11.296875 -7.890625 12.960938 -7.203125 14.921875 -7.203125 C 16.910156 -7.273438 18.554688 -7.976562 19.859375 -9.3125 Z M 19.859375 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(208.81504, 70.793676)", children: e("g", { children: e("path", { d: "M 13.203125 0 C 11.273438 0 9.59375 -0.296875 8.15625 -0.890625 C 7.007812 -1.296875 5.828125 -2.050781 4.609375 -3.15625 C 2.492188 -5.113281 1.53125 -7.59375 1.71875 -10.59375 L 1.71875 -11.203125 L 7.9375 -11.09375 L 8.421875 -11.09375 L 8.421875 -10.640625 C 8.460938 -9.722656 8.664062 -8.96875 9.03125 -8.375 C 9.664062 -7.300781 11.054688 -6.765625 13.203125 -6.765625 C 14.972656 -6.765625 16.25 -6.96875 17.03125 -7.375 C 17.4375 -7.5625 17.710938 -7.800781 17.859375 -8.09375 C 17.929688 -8.207031 17.96875 -8.316406 17.96875 -8.421875 L 18.015625 -8.703125 C 18.015625 -9.484375 17.40625 -10.113281 16.1875 -10.59375 C 15.707031 -10.78125 15.15625 -10.925781 14.53125 -11.03125 C 14.050781 -11.144531 13.515625 -11.238281 12.921875 -11.3125 C 10.703125 -11.53125 8.851562 -11.972656 7.375 -12.640625 C 5.894531 -13.234375 4.675781 -14.046875 3.71875 -15.078125 C 2.382812 -16.597656 1.71875 -18.335938 1.71875 -20.296875 C 1.71875 -21.515625 1.941406 -22.640625 2.390625 -23.671875 C 2.722656 -24.484375 3.164062 -25.207031 3.71875 -25.84375 C 5.707031 -28.132812 8.90625 -29.28125 13.3125 -29.28125 C 15.9375 -29.28125 18.15625 -28.757812 19.96875 -27.71875 C 21.375 -26.945312 22.5 -25.894531 23.34375 -24.5625 C 24.007812 -23.5625 24.472656 -22.398438 24.734375 -21.078125 C 24.804688 -20.628906 24.859375 -20.203125 24.890625 -19.796875 L 24.890625 -18.625 L 18.1875 -18.625 L 18.1875 -19.46875 C 18.15625 -19.613281 18.140625 -19.757812 18.140625 -19.90625 C 18.023438 -20.3125 17.875 -20.644531 17.6875 -20.90625 C 16.875 -22.007812 15.414062 -22.5625 13.3125 -22.5625 C 10.207031 -22.5625 8.65625 -21.914062 8.65625 -20.625 C 8.65625 -19.957031 9.023438 -19.421875 9.765625 -19.015625 C 10.535156 -18.535156 11.847656 -18.1875 13.703125 -17.96875 C 17.953125 -17.519531 21.035156 -16.171875 22.953125 -13.921875 C 24.242188 -12.398438 24.890625 -10.660156 24.890625 -8.703125 L 24.890625 -8.3125 L 24.84375 -7.8125 C 24.84375 -7.332031 24.785156 -6.890625 24.671875 -6.484375 C 24.378906 -5.304688 23.828125 -4.253906 23.015625 -3.328125 C 22.085938 -2.210938 20.789062 -1.378906 19.125 -0.828125 C 17.46875 -0.273438 15.492188 0 13.203125 0 Z M 13.203125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(235.371259, 70.793676)", children: e("g", { children: e("path", { d: "M 22.234375 -28.5625 L 22.234375 -20.796875 L 15.859375 -20.796875 L 15.859375 0 L 8.09375 0 L 8.09375 -20.796875 L 1.65625 -20.796875 L 1.65625 -28.5625 L 8.09375 -28.5625 L 8.09375 -38.546875 L 15.859375 -38.546875 L 15.859375 -28.5625 Z M 22.234375 -28.5625 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(259.266309, 70.793676)", children: e("g", { children: e("path", { d: "M 9.421875 0 L 1.65625 0 L 1.65625 -7.765625 L 9.421875 -7.765625 Z M 9.421875 0 " }) }) }) }), e("g", { clipPath: "url(#2854c0f5ba)", children: e("g", { clipPath: "url(#a2b4eafd05)", children: e("path", { fill: "url(#ca59399d09)", d: "M 335.910156 85.621094 L 280.214844 85.621094 L 280.214844 29.789062 L 335.910156 29.789062 Z M 335.910156 85.621094 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#058149a1c1)", children: e("g", { clipPath: "url(#3a8b0dae6b)", children: e("path", { fill: "url(#82194e6edc)", d: "M 327.113281 76.824219 L 271.417969 76.824219 L 271.417969 20.992188 L 327.113281 20.992188 Z M 327.113281 76.824219 ", fillRule: "nonzero" }) }) })] }), Un = (a) => e(Z.Root, { ...a });
|
|
2084
2085
|
Un.displayName = "Drawer";
|
|
2085
2086
|
const qn = A.forwardRef(({ className: a, ...t }, r) => e(Z.Trigger, { ref: r, className: k(a), ...t }));
|
|
2086
2087
|
qn.displayName = "Drawer.Trigger";
|
|
@@ -2098,15 +2099,15 @@ const Xn = A.forwardRef(({ className: a, ...t }, r) => e(Z.Title, { ref: r, clas
|
|
|
2098
2099
|
Xn.displayName = "DrawerTitle";
|
|
2099
2100
|
const Yn = A.forwardRef(({ className: a, ...t }, r) => e("div", { ref: r, className: k("flex-1 py-4", a), ...t }));
|
|
2100
2101
|
Yn.displayName = "Drawer.Body";
|
|
2101
|
-
const
|
|
2102
|
-
|
|
2103
|
-
function
|
|
2102
|
+
const Xc = A.forwardRef(({ className: a, ...t }, r) => e(Z.Description, { ref: r, className: k("text-gray-500 dark:text-gray-500", a), ...t }));
|
|
2103
|
+
Xc.displayName = "DrawerDescription";
|
|
2104
|
+
function Yc() {
|
|
2104
2105
|
const a = da(), t = O(), r = $();
|
|
2105
2106
|
if (!t) return null;
|
|
2106
2107
|
const n = [{ name: "Dashboard", href: r.dashboard(t), icon: ri }, { name: "Live Orders", href: r.liveOrders(t), icon: ii }, { name: "Orders", href: r.orders(t), icon: ni }, { name: "Reservations", href: r.reservations(t), icon: si }, { name: "Products", href: r.products(t), icon: li }, { name: "Categories", href: r.productCategories(t), icon: oi }, { name: "Manufacturers", href: r.manufacturers(t), icon: di }, { name: "Settings", href: r.settings(t), icon: wi }];
|
|
2107
2108
|
return i(Un, { children: [e(qn, { asChild: !0, children: e(D, { variant: "ghost", "aria-label": "open sidebar", className: "group flex items-center rounded-md p-2 text-sm font-medium hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10", children: e(Qs, { className: "size-6 shrink-0 sm:size-5", "aria-hidden": "true" }) }) }), i($n, { className: "sm:max-w-lg", children: [e(Kn, { children: e(Xn, { children: "Navigation" }) }), e(Yn, { children: e("nav", { "aria-label": "mobile navigation links", className: "flex flex-1 flex-col space-y-10", children: e("ul", { role: "list", className: "space-y-1.5", children: n.map((s) => e("li", { children: e(Wn, { asChild: !0, children: i(E, { href: s.href, className: _(a === s.href || a != null && a.startsWith(s.href) ? "text-blue-600 dark:text-blue-400" : "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50", "flex items-center gap-x-2.5 rounded-md px-2 py-1.5 text-base font-medium transition hover:bg-gray-100 sm:text-sm dark:hover:bg-gray-900", he), children: [e(s.icon, { className: "size-5 shrink-0", "aria-hidden": "true" }), s.name] }) }) }, s.name)) }) }) })] })] });
|
|
2108
2109
|
}
|
|
2109
|
-
const
|
|
2110
|
+
const em = () => {
|
|
2110
2111
|
var d;
|
|
2111
2112
|
const [a, t] = z.useState(!1), r = z.useRef(null), { organizations: n, organization: s } = ge(), l = G(), o = $();
|
|
2112
2113
|
return e(S, { children: i(Ue, { open: a, onOpenChange: t, modal: !1, children: [e(qe, { asChild: !0, children: s.data && i("button", { className: k("flex w-full items-center gap-x-2.5 rounded-md border border-gray-300 bg-white p-2 text-sm shadow-xs transition-all hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-950 dark:hover:bg-gray-900", Ra), children: [s.data.logoFile ? e(xe, { src: s.data.logoFile.url, alt: s.data.name, width: 40, height: 40, className: "flex aspect-square size-8 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-8 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [s.data.name[0], s.data.name[1]] }), i("div", { className: "flex w-full items-center justify-between gap-x-4 truncate", children: [i("div", { className: "truncate text-left", children: [e("p", { className: "truncate whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-50", children: s.data.name }), e("p", { className: "whitespace-nowrap text-left text-xs text-gray-700 dark:text-gray-300", children: (d = s.data.address) == null ? void 0 : d.addressLineOne })] }), e(ki, { className: "size-5 shrink-0 text-gray-500", "aria-hidden": "true" })] })] }) }), e(We, { hidden: !1, onCloseAutoFocus: (p) => {
|
|
@@ -2115,7 +2116,7 @@ const Yc = () => {
|
|
|
2115
2116
|
var m;
|
|
2116
2117
|
return e(ve, { onClick: () => l.push(o.dashboard(p.id)), children: i("div", { className: "flex w-full items-center gap-x-2.5", children: [p.logoFile ? e(xe, { src: p.logoFile.url, alt: p.name, width: 40, height: 40, className: "flex aspect-square size-8 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-8 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [p.name[0], p.name[1]] }), i("div", { children: [e("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: p.name }), e("p", { className: "text-xs text-gray-700 dark:text-gray-400", children: (m = p.address) == null ? void 0 : m.addressLineOne })] })] }) }, p.id);
|
|
2117
2118
|
})] }) })] }) });
|
|
2118
|
-
},
|
|
2119
|
+
}, am = () => {
|
|
2119
2120
|
const [a, t] = z.useState(!1), r = z.useRef(null), { organizations: n, organization: s } = ge(), l = G(), o = $();
|
|
2120
2121
|
return i(Ue, { open: a, onOpenChange: t, modal: !1, children: [e(qe, { asChild: !0, children: s.data && i("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: [s.data.logoFile ? e(xe, { src: s.data.logoFile.url, alt: s.data.name, width: 28, height: 28, className: "flex aspect-square size-7 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-7 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [s.data.name[0], s.data.name[1]] }), e(lt, { className: "size-4 shrink-0 text-gray-500", "aria-hidden": "true" }), i("div", { className: "flex w-full items-center justify-between gap-x-3 truncate", children: [e("p", { className: "truncate whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-50", children: s.data.name }), e(ki, { className: "size-4 shrink-0 text-gray-500", "aria-hidden": "true" })] })] }) }), e(We, { className: "min-w-72!", onCloseAutoFocus: (d) => {
|
|
2121
2122
|
r.current && (r.current.focus(), r.current = null, d.preventDefault());
|
|
@@ -2135,19 +2136,19 @@ function es({ children: a, align: t = "start" }) {
|
|
|
2135
2136
|
o(b);
|
|
2136
2137
|
}, children: [i(_a, { "aria-label": "Switch to Light Mode", value: "light", iconType: "check", children: [e(Ts, { className: "size-4 shrink-0", "aria-hidden": "true" }), "Light"] }), i(_a, { "aria-label": "Switch to Dark Mode", value: "dark", iconType: "check", children: [e(Js, { className: "size-4 shrink-0", "aria-hidden": "true" }), "Dark"] }), i(_a, { "aria-label": "Switch to System Mode", value: "system", iconType: "check", children: [e(Os, { className: "size-4 shrink-0", "aria-hidden": "true" }), "System"] })] }) }), e(Na, { children: e(ve, { onClick: h, className: "text-red-500", children: "Sign out" }) })] }) })] })] }) }) : null;
|
|
2137
2138
|
}
|
|
2138
|
-
const
|
|
2139
|
+
const tm = () => {
|
|
2139
2140
|
var n;
|
|
2140
2141
|
const a = Ia().useSession(), { firstname: t, lastname: r } = ((n = a.data) == null ? void 0 : n.user) || {};
|
|
2141
2142
|
return e(es, { children: i(D, { "aria-label": "User settings", variant: "ghost", className: _(he, "group flex w-full items-center justify-between rounded-md p-2 text-sm font-medium text-gray-900 hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10"), children: [i("span", { className: "flex items-center gap-3", children: [i("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs text-gray-700 dark:border-gray-800 dark:bg-gray-950 dark:text-gray-300", "aria-hidden": "true", children: [t == null ? void 0 : t.charAt(0), r == null ? void 0 : r.charAt(0)] }), i("span", { children: [t, " ", r] })] }), e(Ls, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-400", "aria-hidden": "true" })] }) });
|
|
2142
|
-
},
|
|
2143
|
-
function
|
|
2143
|
+
}, rm = () => e(es, { align: "end", children: e(D, { "aria-label": "User settings", variant: "ghost", className: _("group flex items-center rounded-md p-1 text-sm font-medium text-gray-900 hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10"), children: e("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs text-gray-700 dark:border-gray-800 dark:bg-gray-950 dark:text-gray-300", "aria-hidden": "true", children: "ES" }) }) });
|
|
2144
|
+
function im() {
|
|
2144
2145
|
const a = da(), t = O(), r = $(), n = [{ name: "Home", href: r.dashboard(t), icon: ri }, { name: "Live Orders", href: r.liveOrders(t), icon: ii }, { name: "Orders List", href: r.orders(t), icon: ni }, { name: "Reservations", href: r.reservations(t), icon: si }, { name: "Products", href: r.products(t), icon: li }, { name: "Product Categories", href: r.productCategories(t), icon: oi }, { name: "Manufacturers", href: r.manufacturers(t), icon: di }, { name: "Customers", href: `${r.dashboard(t)}/customers`, icon: ws }, { name: "Settings", href: r.settings(t), icon: wi }], s = (l) => a === l || (a == null ? void 0 : a.startsWith(l));
|
|
2145
|
-
return i(S, { children: [e("nav", { className: "hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col", children: i("aside", { className: "flex grow flex-col gap-y-6 overflow-y-auto border-r border-gray-200 bg-slate-50 p-4 dark:border-gray-800 dark:bg-gray-950", children: [e(E, { href: r.home, className: "-ml-2", children: e(
|
|
2146
|
+
return i(S, { children: [e("nav", { className: "hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col", children: i("aside", { className: "flex grow flex-col gap-y-6 overflow-y-auto border-r border-gray-200 bg-slate-50 p-4 dark:border-gray-800 dark:bg-gray-950", children: [e(E, { href: r.home, className: "-ml-2", children: e(Kc, {}) }), e("hr", { className: "block border-t border-gray-200 dark:border-gray-800 -mt-3 mb-1" }), e(em, {}), e("nav", { "aria-label": "core navigation links", className: "flex flex-1 flex-col space-y-10", children: e("ul", { role: "list", className: "space-y-0.5", children: n.map((l) => e("li", { children: i(E, { href: l.href, className: k(s(l.href) ? "text-blue-600 dark:text-blue-400" : "text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50", "flex items-center gap-x-2.5 rounded-md px-2 py-1.5 text-sm font-medium transition hover:bg-gray-100 dark:hover:bg-gray-900", he), children: [e(l.icon, { className: "size-4 shrink-0", "aria-hidden": "true" }), l.name] }) }, l.name)) }) }), e("div", { className: "mt-auto", children: e(tm, {}) })] }) }), i("div", { className: "sticky top-0 z-40 flex h-16 shrink-0 items-center justify-between border-b border-gray-200 bg-white px-2 shadow-xs sm:gap-x-6 sm:px-4 lg:hidden dark:border-gray-800 dark:bg-gray-950", children: [e(am, {}), i("div", { className: "flex items-center gap-1 sm:gap-2", children: [e(rm, {}), e(Yc, {})] })] })] });
|
|
2146
2147
|
}
|
|
2147
|
-
function
|
|
2148
|
-
return i(S, { children: [e("div", { className: "bg-slate-50 dark:hidden w-1/2 absolute top-0 left-0 h-screen" }), i("div", { className: "mx-auto max-w-(--breakpoint-2xl)", children: [e(
|
|
2148
|
+
function nm({ children: a }) {
|
|
2149
|
+
return i(S, { children: [e("div", { className: "bg-slate-50 dark:hidden w-1/2 absolute top-0 left-0 h-screen" }), i("div", { className: "mx-auto max-w-(--breakpoint-2xl)", children: [e(im, {}), e("main", { className: "lg:pl-72 bg-white dark:bg-gray-950 z-10 relative min-h-screen", children: e("div", { className: "relative", children: e("div", { className: "p-4 sm:px-6 sm:pb-10 sm:pt-10 lg:px-10 lg:pt-[34px]", children: a }) }) })] })] });
|
|
2149
2150
|
}
|
|
2150
|
-
const
|
|
2151
|
+
const sm = [{ name: "configuration.openingTimes.monday", label: "Monday", type: "time" }, { name: "configuration.closingTimes.monday", label: "", type: "time" }, { name: "configuration.openingTimes.tuesday", label: "Tuesday", type: "time" }, { name: "configuration.closingTimes.tuesday", label: "", type: "time" }, { name: "configuration.openingTimes.wednesday", label: "Wednesday", type: "time" }, { name: "configuration.closingTimes.wednesday", label: "", type: "time" }, { name: "configuration.openingTimes.thursday", label: "Thursday", type: "time" }, { name: "configuration.closingTimes.thursday", label: "", type: "time" }, { name: "configuration.openingTimes.friday", label: "Friday", type: "time" }, { name: "configuration.closingTimes.friday", label: "", type: "time" }, { name: "configuration.openingTimes.saturday", label: "Saturday", type: "time" }, { name: "configuration.closingTimes.saturday", label: "", type: "time" }, { name: "configuration.openingTimes.sunday", label: "Sunday", type: "time" }, { name: "configuration.closingTimes.sunday", label: "", type: "time" }, { name: "configuration.isAcceptingOrders", label: "Accepting Orders", type: "switch" }], lm = ({ onClose: a, initialData: t }) => {
|
|
2151
2152
|
var o, d, p, m, h, u;
|
|
2152
2153
|
const { client: r } = I(), n = se({ resolver: le(Gt), defaultValues: { configuration: { defaultLocale: (o = t == null ? void 0 : t.configuration) == null ? void 0 : o.defaultLocale, supportedLocales: (d = t == null ? void 0 : t.configuration) == null ? void 0 : d.supportedLocales, defaultCurrency: (p = t == null ? void 0 : t.configuration) == null ? void 0 : p.defaultCurrency, openingTimes: (m = t == null ? void 0 : t.configuration) == null ? void 0 : m.openingTimes, closingTimes: (h = t == null ? void 0 : t.configuration) == null ? void 0 : h.closingTimes, isAcceptingOrders: (u = t == null ? void 0 : t.configuration) == null ? void 0 : u.isAcceptingOrders } } });
|
|
2153
2154
|
console.log(n.watch());
|
|
@@ -2156,26 +2157,26 @@ const nm = [{ name: "configuration.openingTimes.monday", label: "Monday", type:
|
|
|
2156
2157
|
if (b !== 200) throw Q.error("Failed to update organization. Please try again later."), new Error("Failed to update organization");
|
|
2157
2158
|
return await te.invalidateQueries({ queryKey: ["organizations"] }), a && a();
|
|
2158
2159
|
} });
|
|
2159
|
-
return e(Ie, { form: n, config:
|
|
2160
|
+
return e(Ie, { form: n, config: sm, onSubmit: (g) => l(g), onCancel: a, loading: s, cancelText: "Go back", okText: "Save Schedule" });
|
|
2160
2161
|
};
|
|
2161
|
-
function
|
|
2162
|
+
function om() {
|
|
2162
2163
|
const { organization: a } = ge();
|
|
2163
|
-
return a.data ? e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "opening-times", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "opening-times", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Opening and Closing Times" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set the opening and closing times for your organization" })] }), e("div", { className: "md:col-span-2", children: e(
|
|
2164
|
+
return a.data ? e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "opening-times", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "opening-times", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Opening and Closing Times" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set the opening and closing times for your organization" })] }), e("div", { className: "md:col-span-2", children: e(lm, { initialData: a.data }) })] }) }) }) : e("div", { children: "Loading..." });
|
|
2164
2165
|
}
|
|
2165
2166
|
function Oe({ children: a }) {
|
|
2166
2167
|
const t = da(), r = O(), n = $(), s = [{ name: "General", href: n.settings(r) }, { name: "Shipping Methods", href: n.settingsShippingMethods(r) }, { name: "Opening Times", href: n.settingsOpeningTimes(r) }, { name: "Access", href: n.settingsAccess(r) }, { name: "API Keys", href: `${n.settings(r)}/api-keys` }];
|
|
2167
2168
|
return t != null && t.match(/\/settings\/shipping-methods\/[^/]+$/) || t != null && t.match(/\/settings\/access\/[^/]+$/) ? e("div", { children: a }) : i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Settings" }), e(yr, { className: "mt-4 sm:mt-6 lg:mt-10", children: s.map((l) => e(br, { asChild: !0, active: t === l.href, children: e(E, { href: l.href, children: l.name }) }, l.name)) }), e("div", { className: "pt-6", children: a })] });
|
|
2168
2169
|
}
|
|
2169
|
-
const
|
|
2170
|
+
const dm = [{ name: "configuration.defaultLocale", label: "Default Locale", type: "select", placeholder: "", options: Dr }, { name: "configuration.supportedLocales", label: "Supported Locales", type: "select", placeholder: "Select locales", multiple: !0, options: Dr }, { name: "configuration.defaultCurrency", label: "Currency", type: "select", placeholder: "Acme Inc.", options: Al }], cm = ({ onClose: a, initialData: t }) => {
|
|
2170
2171
|
var o, d, p;
|
|
2171
2172
|
const { client: r } = I(), n = se({ resolver: le(Gt), defaultValues: { configuration: { defaultLocale: (o = t == null ? void 0 : t.configuration) == null ? void 0 : o.defaultLocale, supportedLocales: (d = t == null ? void 0 : t.configuration) == null ? void 0 : d.supportedLocales, defaultCurrency: (p = t == null ? void 0 : t.configuration) == null ? void 0 : p.defaultCurrency } } }), { isPending: s, mutate: l } = T({ mutationFn: async ({ configuration: m }) => {
|
|
2172
2173
|
const { status: h } = await r.organization.updateOrganization({ params: { organizationId: t == null ? void 0 : t.id }, body: { configuration: m } });
|
|
2173
2174
|
if (h !== 200) throw Q.error("Failed to update organization. Please try again later."), new Error("Failed to update organization");
|
|
2174
2175
|
return await te.invalidateQueries({ queryKey: ["organizations"] }), a && a();
|
|
2175
2176
|
} });
|
|
2176
|
-
return e(Ie, { form: n, config:
|
|
2177
|
+
return e(Ie, { form: n, config: dm, onSubmit: (m) => l(m), onCancel: a, loading: s, cancelText: "Go back", okText: "Save Settings" });
|
|
2177
2178
|
};
|
|
2178
|
-
function
|
|
2179
|
+
function mm() {
|
|
2179
2180
|
const { organization: a } = ge(), { client: t } = I(), r = O(), n = G(), s = $(), l = T({ mutationFn: async () => {
|
|
2180
2181
|
const { status: o } = await t.access.leaveOrganization({ params: { organizationId: r } });
|
|
2181
2182
|
if (o !== 204) throw new Error("Failed to leave organization");
|
|
@@ -2184,9 +2185,9 @@ function cm() {
|
|
|
2184
2185
|
}, onError: (o) => {
|
|
2185
2186
|
Q.error((o == null ? void 0 : o.message) || "Failed to leave organization");
|
|
2186
2187
|
} });
|
|
2187
|
-
return a.data ? i("div", { className: "space-y-10", children: [e("section", { "aria-labelledby": "org-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "org-information", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Organization Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Manage your organization information." })] }), e("div", { className: "md:col-span-2", children: e(Vn, { initialData: a.data }) })] }) }), e(L, {}), e("section", { "aria-labelledby": "locale-settings", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "locale-settings", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Currency and Locale" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set the currency and languages you support" })] }), e("div", { className: "md:col-span-2", children: e(
|
|
2188
|
+
return a.data ? i("div", { className: "space-y-10", children: [e("section", { "aria-labelledby": "org-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "org-information", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Organization Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Manage your organization information." })] }), e("div", { className: "md:col-span-2", children: e(Vn, { initialData: a.data }) })] }) }), e(L, {}), e("section", { "aria-labelledby": "locale-settings", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "locale-settings", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Currency and Locale" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set the currency and languages you support" })] }), e("div", { className: "md:col-span-2", children: e(cm, { initialData: a.data }) })] }) }), e(L, {}), e("section", { "aria-labelledby": "danger-zone", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "danger-zone", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Danger zone" }), i("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: ["Manage general workspace. Contact system admin for more information.", " ", i("a", { href: "#", className: "inline-flex items-center gap-1 text-indigo-600 hover:underline hover:underline-offset-4 dark:text-indigo-400", children: ["Learn more", e(ks, { className: "size-4 shrink-0", "aria-hidden": "true" })] })] })] }), e("div", { className: "space-y-6 md:col-span-2", children: e(ha, { className: "p-4", children: i("div", { className: "flex items-start justify-between gap-10", children: [i("div", { children: [e("h4", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: "Leave workspace" }), e("p", { className: "mt-2 text-sm leading-6 text-gray-500", children: "Revoke your access to this team. Other people you have added to the workspace will remain." })] }), e(D, { variant: "secondary", className: "text-red-600 dark:text-red-500", onClick: () => l.mutate(), isLoading: l.isPending, loadingText: "Leaving...", children: "Leave" })] }) }) })] }) })] }) : e("div", { children: "Loading..." });
|
|
2188
2189
|
}
|
|
2189
|
-
const
|
|
2190
|
+
const um = () => {
|
|
2190
2191
|
var h;
|
|
2191
2192
|
const { client: a } = I(), t = O(), r = $(), n = pe(), [s] = F(""), [l] = Ze(s, 300), o = Number((n == null ? void 0 : n.get("page")) || "1"), d = T({ mutationFn: async (u) => {
|
|
2192
2193
|
const { status: g } = await a.access.deleteMember({ params: { organizationId: t, memberId: u } });
|
|
@@ -2204,7 +2205,7 @@ const mm = () => {
|
|
|
2204
2205
|
const g = u.user.firstname.charAt(0).toUpperCase() + u.user.lastname.charAt(0).toUpperCase();
|
|
2205
2206
|
return i("li", { className: "flex items-center justify-between gap-x-6 py-2.5", children: [i("div", { className: "flex items-center gap-x-4 truncate", children: [e("span", { className: "hidden size-9 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs text-gray-700 sm:flex dark:border-gray-800 dark:bg-gray-950 dark:text-gray-300", "aria-hidden": "true", children: g }), i("div", { className: "truncate", children: [i("p", { className: "truncate text-sm font-medium text-gray-900 dark:text-gray-50", children: [u.user.firstname, " ", u.user.lastname] }), e("p", { className: "truncate text-xs text-gray-500", children: u.user.email })] })] }), i("div", { className: "flex items-center gap-x-4", children: [e("span", { className: "inline-flex items-center rounded-md bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-gray-800 dark:text-gray-400", children: u.role.charAt(0).toUpperCase() + u.role.slice(1) }), e(E, { href: r.settingsAccessMemberEdit(t, u.id), className: "text-sm font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300", children: "Edit" }), e("button", { onClick: () => d.mutate(u.id), disabled: d.isPending, className: "text-sm font-medium text-red-600 hover:text-red-500 dark:text-red-400 dark:hover:text-red-300 disabled:opacity-50", children: "Delete" })] })] }, u.id);
|
|
2206
2207
|
}) }) : e("p", { className: "text-sm text-gray-500 py-4 mt-4", children: "No members found." });
|
|
2207
|
-
},
|
|
2208
|
+
}, pm = () => {
|
|
2208
2209
|
const { client: a } = I(), t = O(), { isLoading: r, data: n } = M({ queryKey: ["access-invitations", t], queryFn: async () => {
|
|
2209
2210
|
const { body: l, status: o } = await a.access.getInvitations({ params: { organizationId: t } });
|
|
2210
2211
|
if (o !== 200) throw new Error("Failed to fetch invitations");
|
|
@@ -2217,13 +2218,13 @@ const mm = () => {
|
|
|
2217
2218
|
}, onError: (l) => {
|
|
2218
2219
|
Q.error((l == null ? void 0 : l.message) || "Failed to revoke invitation");
|
|
2219
2220
|
} });
|
|
2220
|
-
return r ? e("div", { className: "flex items-center justify-center h-24", children: e(ie, { className: "w-6 h-6" }) }) : !n || n.length === 0 ? e("p", { className: "text-sm text-gray-500 py-4", children: "No pending invitations." }) : e("div", { className: "relative overflow-hidden overflow-x-auto", children: i(xr, { children: [e(wr, { children: i(
|
|
2221
|
+
return r ? e("div", { className: "flex items-center justify-center h-24", children: e(ie, { className: "w-6 h-6" }) }) : !n || n.length === 0 ? e("p", { className: "text-sm text-gray-500 py-4", children: "No pending invitations." }) : e("div", { className: "relative overflow-hidden overflow-x-auto", children: i(xr, { children: [e(wr, { children: i(ea, { className: "border-y border-gray-200 dark:border-gray-800", children: [e(Xe, { className: "whitespace-nowrap py-1 text-sm sm:text-xs", children: "Email" }), e(Xe, { className: "whitespace-nowrap py-1 text-sm sm:text-xs", children: "Role" }), e(Xe, { className: "whitespace-nowrap py-1 text-sm sm:text-xs", children: "Status" }), e(Xe, { className: "whitespace-nowrap py-1 text-sm sm:text-xs", children: "Expires" }), e(Xe, { className: "whitespace-nowrap py-1 text-sm sm:text-xs text-right", children: "Actions" })] }) }), e(kr, { children: n.map((l) => i(ea, { className: "group select-none hover:bg-gray-50 dark:hover:bg-gray-900", children: [e(Be, { className: "whitespace-nowrap py-1 text-gray-600 dark:text-gray-400", children: l.email }), e(Be, { className: "whitespace-nowrap py-1 text-gray-600 dark:text-gray-400", children: e("span", { className: "inline-flex items-center rounded-md bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-gray-800 dark:text-gray-400", children: l.role ? l.role.charAt(0).toUpperCase() + l.role.slice(1) : "-" }) }), e(Be, { className: "whitespace-nowrap py-1 text-gray-600 dark:text-gray-400", children: e("span", { className: "inline-flex items-center rounded-md bg-yellow-50 px-2 py-0.5 text-xs font-medium text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400", children: l.status.charAt(0).toUpperCase() + l.status.slice(1) }) }), e(Be, { className: "whitespace-nowrap py-1 text-gray-600 dark:text-gray-400", children: new Date(l.expiresAt).toLocaleDateString() }), e(Be, { className: "whitespace-nowrap py-1 text-right", children: e("button", { onClick: () => s.mutate(l.id), disabled: s.isPending, className: "inline-flex items-center rounded-md p-1 text-gray-400 hover:text-red-600 hover:bg-red-50 dark:hover:text-red-400 dark:hover:bg-red-900/20 transition disabled:opacity-50", children: e(Ot, { className: "w-4 h-4" }) }) })] }, l.id)) })] }) });
|
|
2221
2222
|
};
|
|
2222
|
-
function
|
|
2223
|
+
function hm() {
|
|
2223
2224
|
const a = O(), t = $();
|
|
2224
|
-
return i(S, { children: [i("div", { className: "sm:flex sm:items-center sm:justify-between", children: [i("div", { children: [e("h3", { className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Members" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Manage team members and their roles within your organization." })] }), e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.settingsAccessInvite(a), children: ["Invite User", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) })] }), e(
|
|
2225
|
+
return i(S, { children: [i("div", { className: "sm:flex sm:items-center sm:justify-between", children: [i("div", { children: [e("h3", { className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Members" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Manage team members and their roles within your organization." })] }), e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.settingsAccessInvite(a), children: ["Invite User", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) })] }), e(um, {}), i("div", { className: "mt-12", children: [e("h3", { className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Pending Invitations" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Invitations that have been sent but not yet accepted." }), e("div", { className: "mt-4", children: e(pm, {}) })] })] });
|
|
2225
2226
|
}
|
|
2226
|
-
const
|
|
2227
|
+
const gm = [{ label: "Owner", value: "owner" }, { label: "Admin", value: "admin" }, { label: "Member", value: "member" }], as = ({ initialData: a }) => {
|
|
2227
2228
|
const { client: t } = I(), r = G(), n = $(), s = O(), l = !!a, o = se({ resolver: le(l ? Bl : Rl), defaultValues: l ? { role: a.role } : { email: "", role: "member" } }), d = T({ mutationFn: async (u) => {
|
|
2228
2229
|
const { status: g } = await t.access.createInvitation({ params: { organizationId: s }, body: u });
|
|
2229
2230
|
if (g !== 201) throw new Error("Failed to create invitation");
|
|
@@ -2235,12 +2236,12 @@ const hm = [{ label: "Owner", value: "owner" }, { label: "Admin", value: "admin"
|
|
|
2235
2236
|
}, h = (u) => {
|
|
2236
2237
|
l ? p.mutate({ role: u.role }, { onSuccess: m }) : d.mutate(u, { onSuccess: m });
|
|
2237
2238
|
};
|
|
2238
|
-
return e(Ve, { ...o, children: i("form", { onSubmit: o.handleSubmit((u) => h(u)), className: "space-y-14", children: [e("section", { "aria-labelledby": "access-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "access-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: l ? "Edit Member Role" : "Invite User" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: l ? `Update the role for ${a.user.firstname} ${a.user.lastname}` : "Send an invitation to a new team member" })] }), i("div", { className: "md:col-span-2", children: [l && i("div", { className: "mb-5", children: [e(be, { htmlFor: "member-email", className: "font-medium", children: "Email" }), e(ce, { id: "member-email", value: a.user.email, disabled: !0, readOnly: !0, className: "w-full mt-2" })] }), e(Ie, { form: o, config: [...l ? [] : [{ name: "email", label: "Email", type: "email", placeholder: "user@example.com", colspan: 2 }], { name: "role", label: "Role", type: "select", options:
|
|
2239
|
+
return e(Ve, { ...o, children: i("form", { onSubmit: o.handleSubmit((u) => h(u)), className: "space-y-14", children: [e("section", { "aria-labelledby": "access-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "access-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: l ? "Edit Member Role" : "Invite User" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: l ? `Update the role for ${a.user.firstname} ${a.user.lastname}` : "Send an invitation to a new team member" })] }), i("div", { className: "md:col-span-2", children: [l && i("div", { className: "mb-5", children: [e(be, { htmlFor: "member-email", className: "font-medium", children: "Email" }), e(ce, { id: "member-email", value: a.user.email, disabled: !0, readOnly: !0, className: "w-full mt-2" })] }), e(Ie, { form: o, config: [...l ? [] : [{ name: "email", label: "Email", type: "email", placeholder: "user@example.com", colspan: 2 }], { name: "role", label: "Role", type: "select", options: gm, colspan: 2 }] })] })] }) }), e(L, {}), i("div", { className: "flex justify-end space-x-3", children: [i(D, { type: "button", variant: "secondary", onClick: () => r.push(n.settingsAccess(s)), children: [e(Sa, { className: "w-4 h-4 mr-2" }), " Cancel"] }), i(D, { type: "submit", isLoading: d.isPending || p.isPending, loadingText: "Saving...", children: [e(nt, { className: "w-4 h-4 mr-2" }), " ", l ? "Save Role" : "Send Invitation"] })] })] }) });
|
|
2239
2240
|
};
|
|
2240
|
-
function
|
|
2241
|
+
function fm() {
|
|
2241
2242
|
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Invite User" }), e(L, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(as, {}) }) })] });
|
|
2242
2243
|
}
|
|
2243
|
-
function
|
|
2244
|
+
function ym() {
|
|
2244
2245
|
const a = O(), t = Ba(), { client: r } = I(), { isLoading: n, data: s } = M({ queryKey: ["access-members", a, t], queryFn: async () => {
|
|
2245
2246
|
const { status: l, body: o } = await r.access.getMember({ params: { organizationId: a, memberId: t } });
|
|
2246
2247
|
if (l !== 200) throw Q.error("Failed to fetch member. Please refresh or try again later."), new Error("Failed to fetch member");
|
|
@@ -2263,10 +2264,10 @@ const ts = ({ initialData: a }) => {
|
|
|
2263
2264
|
};
|
|
2264
2265
|
return e(Ve, { ...l, children: i("form", { onSubmit: l.handleSubmit((u) => m(u)), className: "space-y-14", children: [e("section", { "aria-labelledby": "Basic Information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Basic Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about your shipping method including title, shipping provider's name and logo" })] }), e("div", { className: "md:col-span-2", children: e(Ie, { form: l, config: [{ name: "title", label: "Title", type: "text", placeholder: "Standard Shipping", colspan: 2 }, { name: "providerName", label: "Provider Name", type: "text", placeholder: "FedEx", colspan: 2 }, { name: "providerLogoId", label: "Provider Logo", type: "file" }, { name: "requireDateOfDelivery", label: "Require Date of Delivery?", type: "switch", colspan: 2 }] }) })] }) }), e(L, {}), e("section", { "aria-labelledby": "product-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Shipping Zones" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set pricing and minimum order based on delivery zones" })] }), e("div", { className: "md:col-span-2", children: e(Ie, { form: l, config: [{ name: "shippingZones", type: "array", fields: [{ name: "title", label: "Title", type: "text", placeholder: "Zone 1" }, { name: "distanceUpto", label: "Distance To (km)", type: "number", placeholder: "10" }, { name: "price", label: "Shipping Price", type: "number", placeholder: "5.99", prefix: "USD" }, { name: "minimumOrderAmount", label: "Minimum Order Amount", type: "number", placeholder: "50", prefix: "USD" }, { name: "eta", label: "Estimated Time of Arrival", type: "text", placeholder: "2-3 days" }] }] }) })] }) }), e(L, {}), i("div", { className: "flex justify-end space-x-3", children: [i(D, { type: "button", variant: "secondary", onClick: () => r.push(n.settingsShippingMethods(s)), children: [e(Sa, { className: "w-4 h-4 mr-2" }), " Cancel"] }), i(D, { type: "submit", isLoading: o.isPending || d.isPending, loadingText: "Saving...", children: [e(nt, { className: "w-4 h-4 mr-2" }), " ", a ? "Save Product" : "Create Shipping Method"] })] })] }) });
|
|
2265
2266
|
};
|
|
2266
|
-
function
|
|
2267
|
+
function bm() {
|
|
2267
2268
|
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Shipping Method" }), e(L, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(ts, {}) }) })] });
|
|
2268
2269
|
}
|
|
2269
|
-
function
|
|
2270
|
+
function xm() {
|
|
2270
2271
|
const a = O(), t = Ba(), { client: r } = I(), { isLoading: n, data: s } = M({ queryKey: ["shipping-and-payment", a, t], queryFn: async () => {
|
|
2271
2272
|
const { status: l, body: o } = await r.shippingMethod.getShippingMethod({ params: { id: t, organizationId: a } });
|
|
2272
2273
|
if (l !== 200) throw Q.error("Failed to fetch shipping method. Please refresh or try again later."), new Error("Failed to fetch shipping method");
|
|
@@ -2274,27 +2275,27 @@ function bm() {
|
|
|
2274
2275
|
}, throwOnError: !0, placeholderData: me });
|
|
2275
2276
|
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Shipping Method" }), e(L, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: n || !s ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(ie, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(ts, { initialData: s }) }) })] });
|
|
2276
2277
|
}
|
|
2277
|
-
const
|
|
2278
|
+
const na = ca(), wm = [na.display({ id: "select", header: ({ table: a }) => e(Qe, { checked: a.getIsAllPageRowsSelected() ? !0 : a.getIsSomeRowsSelected() ? "indeterminate" : !1, onCheckedChange: () => a.toggleAllPageRowsSelected(), className: "translate-y-0.5", "aria-label": "Select all" }), cell: ({ row: a }) => e(Qe, { checked: a.getIsSelected(), onCheckedChange: () => a.toggleSelected(), className: "translate-y-0.5", "aria-label": "Select row" }), enableSorting: !1, enableHiding: !1, meta: { displayName: "Select" } }), na.accessor("id", { header: ({ column: a }) => e(R, { column: a, title: "Id" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a, table: t }) => {
|
|
2278
2279
|
var n, s, l;
|
|
2279
2280
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
2280
2281
|
return e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.settingsShippingMethodEdit(r, a.getValue("id"))) ?? `/admin/${r}/settings/shipping-methods/${a.getValue("id")}`, className: "text-blue-500", children: a.getValue("id") });
|
|
2281
|
-
} }),
|
|
2282
|
+
} }), na.accessor("title", { header: ({ column: a }) => e(R, { column: a, title: "Title" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Title" } }), na.accessor("providerName", { header: ({ column: a }) => e(R, { column: a, title: "Provider Name" }), enableSorting: !0, meta: { className: "text-left", displayName: "Provider Name" } }), na.accessor("shippingZones", { header: ({ column: a }) => e(R, { column: a, title: "Shipping Zones" }), enableSorting: !1, meta: { className: "text-left", displayName: "Shipping Zones" }, cell: ({ row: a }) => a.getValue("shippingZones").map((t) => t.title).join(", ") || "-" }), na.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => {
|
|
2282
2283
|
var n, s, l;
|
|
2283
2284
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
2284
2285
|
return i(Ue, { children: [e(qe, { asChild: !0, children: e(D, { variant: "ghost", 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", children: e(ot, { 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", "aria-hidden": "true" }) }) }), i(We, { align: "end", className: "min-w-40", children: [e(ve, { children: e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.settingsShippingMethodEdit(r, a.getValue("id"))) ?? `/admin/${r}/settings/shipping-methods/${a.getValue("id")}`, className: "block", children: "Edit" }) }), e(ve, { className: "text-red-600 dark:text-red-500", children: "Delete" })] })] });
|
|
2285
|
-
} })],
|
|
2286
|
+
} })], km = () => {
|
|
2286
2287
|
const { client: a } = I(), t = O(), r = pe(), [n] = F(""), [s] = Ze(n, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: o, isRefetching: d, isError: p, data: m } = M({ queryKey: ["shipping-and-payment", t, l, s], queryFn: async () => {
|
|
2287
2288
|
const { body: h, status: u } = await a.shippingMethod.getShippingMethods({ params: { organizationId: t }, query: { page: l, limit: 10, search: s } });
|
|
2288
2289
|
if (u !== 200) throw new Error("Failed to fetch shipping methods");
|
|
2289
2290
|
return h;
|
|
2290
2291
|
}, placeholderData: me });
|
|
2291
|
-
return e("div", { children: e(ga, { error: p, loading: o || d, meta: m != null && m.meta ? { ...m == null ? void 0 : m.meta, currentPage: l } : void 0, data: (m == null ? void 0 : m.list) || [], columns:
|
|
2292
|
+
return e("div", { children: e(ga, { error: p, loading: o || d, meta: m != null && m.meta ? { ...m == null ? void 0 : m.meta, currentPage: l } : void 0, data: (m == null ? void 0 : m.list) || [], columns: wm, className: "mt-8" }) });
|
|
2292
2293
|
};
|
|
2293
|
-
function
|
|
2294
|
+
function vm() {
|
|
2294
2295
|
const a = O(), t = $();
|
|
2295
|
-
return i(S, { children: [i("div", { className: "sm:flex sm:items-center sm:justify-between", children: [i("div", { children: [e("h3", { id: "existing-users", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Shipping Methods" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Set up delivery zones, pricing based on distance, and manage shipping methods and providers for your organization." })] }), e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.settingsShippingMethodCreate(a), children: ["Create Shipping Method", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) })] }), e(
|
|
2296
|
+
return i(S, { children: [i("div", { className: "sm:flex sm:items-center sm:justify-between", children: [i("div", { children: [e("h3", { id: "existing-users", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Shipping Methods" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Set up delivery zones, pricing based on distance, and manage shipping methods and providers for your organization." })] }), e(D, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.settingsShippingMethodCreate(a), children: ["Create Shipping Method", e(Me, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) })] }), e(km, {})] });
|
|
2296
2297
|
}
|
|
2297
|
-
const
|
|
2298
|
+
const Nm = () => {
|
|
2298
2299
|
const a = G(), t = pe(), r = Ia(), n = $(), s = r.signIn, l = xt(t == null ? void 0 : t.get("redirect"), n), { register: o, handleSubmit: d, formState: { errors: p, isSubmitting: m } } = se({ resolver: le(Ki), shouldFocusError: !0 }), h = () => a.push(l), u = async (b) => {
|
|
2299
2300
|
await s.email({ email: b.email, password: b.password, fetchOptions: { onSuccess: h } });
|
|
2300
2301
|
}, g = async () => {
|
|
@@ -2306,17 +2307,17 @@ function rs({ children: a }) {
|
|
|
2306
2307
|
const { appearance: t } = Fi(), r = t == null ? void 0 : t.loginImage;
|
|
2307
2308
|
return i("div", { className: "flex w-full min-h-screen", children: [r && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(xe, { src: r, alt: "Login Visual", width: 4e3, height: 2250, className: "w-full h-full object-cover min-h-screen" }) }), e("div", { className: `w-full ${r ? "lg:w-1/2" : ""} flex items-center justify-center p-8`, children: e("div", { className: "w-full max-w-md space-y-8", children: a }) })] });
|
|
2308
2309
|
}
|
|
2309
|
-
function
|
|
2310
|
-
return e(rs, { children: e(
|
|
2310
|
+
function Am() {
|
|
2311
|
+
return e(rs, { children: e(Nm, {}) });
|
|
2311
2312
|
}
|
|
2312
|
-
const
|
|
2313
|
+
const Cm = () => {
|
|
2313
2314
|
const a = G(), t = pe(), r = Ia(), n = $(), { signIn: s, signUp: l } = r, o = xt(t == null ? void 0 : t.get("redirect"), n), { register: d, handleSubmit: p, formState: { errors: m } } = se({ resolver: le($t), shouldFocusError: !0 }), h = () => a.push(o), { isPending: u, isError: g, mutate: b } = T({ onMutate: async (w) => l.email({ email: w.email, password: w.password, name: `${w.firstname} ${w.lastname}`, firstname: w.firstname, lastname: w.lastname, fetchOptions: { onSuccess: h } }) }), f = async () => s.social({ provider: "google", callbackURL: xn(window.location.origin, o, n) });
|
|
2314
2315
|
return e(S, { children: i("div", { className: "flex w-full flex-col items-start sm:max-w-sm", children: [e("div", { className: "relative flex items-center justify-center rounded-lg bg-white p-3 shadow-lg ring-1 ring-black/5", children: i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 481, zoomAndPan: "magnify", viewBox: "0 0 360.75 362.250002", height: 483, preserveAspectRatio: "xMidYMid meet", className: "size-8 text-blue-500 dark:text-blue-500", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "2330832e18", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("clipPath", { id: "5855bcb1c8", children: e("path", { d: "M 49 49.945312 L 357 49.945312 L 357 361.257812 L 49 361.257812 Z M 49 49.945312 ", clipRule: "nonzero" }) }), e("clipPath", { id: "2af377de26", children: e("path", { d: "M 226.65625 348.957031 L 345.746094 229.867188 C 359.820312 215.792969 359.820312 193.058594 345.746094 178.984375 L 228.101562 61.339844 C 220.160156 53.398438 209.515625 49.070312 198.328125 49.070312 L 50.730469 49.070312 L 180.644531 178.984375 C 194.71875 193.058594 194.71875 215.792969 180.644531 229.867188 L 49.285156 361.226562 L 196.882812 361.226562 C 208.070312 361.226562 218.71875 356.714844 226.65625 348.957031 Z M 226.65625 348.957031 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", id: "dfad2cd726", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "161eaca8d9", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "5d3dc395e3", children: e("rect", { x: 0, width: 313, y: 0, height: 313 }) }), e("pattern", { id: "2569dd48be", patternUnits: "userSpaceOnUse", width: 313, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 48.148759, 361.331903)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 313 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#5d3dc395e3)", children: e("g", { mask: "url(#161eaca8d9)", children: e("rect", { x: "-127.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-80.78", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "2302aeb2c7", children: e("path", { d: "M 0.246094 0.90625 L 308 0.90625 L 308 312.21875 L 0.246094 312.21875 Z M 0.246094 0.90625 ", clipRule: "nonzero" }) }), e("clipPath", { id: "d6b3633872", children: e("path", { d: "M 177.617188 299.917969 L 296.707031 180.828125 C 310.78125 166.753906 310.78125 144.019531 296.707031 129.945312 L 179.0625 12.300781 C 171.121094 4.363281 160.476562 0.03125 149.289062 0.03125 L 1.691406 0.03125 L 131.605469 129.945312 C 145.679688 144.019531 145.679688 166.753906 131.605469 180.828125 L 0.246094 312.1875 L 147.84375 312.1875 C 159.03125 312.1875 169.679688 307.675781 177.617188 299.917969 Z M 177.617188 299.917969 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", id: "f9fee20a49", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "8bb974956b", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "4f6b6cd058", children: e("rect", { x: 0, width: 312, y: 0, height: 313 }) }), e("pattern", { id: "80e461df2c", patternUnits: "userSpaceOnUse", width: 312, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 0.247933, 312.433143)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 312 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#4f6b6cd058)", children: e("g", { mask: "url(#8bb974956b)", children: e("rect", { x: "-79.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-129.78", fillOpacity: 1 }) }) }) }) })] }), e("g", { clipPath: "url(#5855bcb1c8)", children: e("g", { clipPath: "url(#2af377de26)", children: e("path", { fill: "url(#2569dd48be)", d: "M 359.820312 361.226562 L 49.289062 361.226562 L 49.289062 49.945312 L 359.820312 49.945312 Z M 359.820312 361.226562 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#2302aeb2c7)", children: e("g", { clipPath: "url(#d6b3633872)", children: e("path", { fill: "url(#80e461df2c)", d: "M 310.78125 312.1875 L 0.25 312.1875 L 0.25 0.90625 L 310.78125 0.90625 Z M 310.78125 312.1875 ", fillRule: "nonzero" }) }) })] }) }), i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Log in to Shophost" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Already have an account?", " ", e(E, { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: lr(n.signIn, o), children: "Sign in" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: e(D, { asChild: !0, variant: "secondary", className: "mt-2 w-full sm:mt-0", children: i("button", { className: "inline-flex items-center gap-2", onClick: f, children: [e(st, { className: "size-4", "aria-hidden": "true" }), "Signin with Google"] }) }) }), e(L, { className: "my-6", children: "or" }), i("form", { onSubmit: p((w) => b(w)), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(be, { htmlFor: "email-form-item", className: "font-medium", children: "First Name" }), e(ce, { type: "text", id: "email-form-item", placeholder: "Emily", ...d("firstname") }), m.firstname && e("span", { className: "text-sm text-red-500", children: m.firstname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(be, { htmlFor: "email-form-item", className: "font-medium", children: "Last Name" }), e(ce, { type: "text", id: "email-form-item", placeholder: "Emily", ...d("lastname") }), m.lastname && e("span", { className: "text-sm text-red-500", children: m.lastname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(be, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(ce, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...d("email") }), m.email && e("span", { className: "text-sm text-red-500", children: m.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(be, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(ce, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...d("password") }), m.password && e("span", { className: "text-sm text-red-500", children: m.password.message })] })] }), g && e("span", { className: "text-sm text-red-500", children: "An error occurred, please try again." }), e(D, { type: "submit", isLoading: u, children: u ? "Submitting..." : "Continue" })] })] }), e(L, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: "#", children: "Reset password" })] })] }) });
|
|
2315
2316
|
};
|
|
2316
|
-
function
|
|
2317
|
-
return e(rs, { children: e(
|
|
2317
|
+
function Sm() {
|
|
2318
|
+
return e(rs, { children: e(Cm, {}) });
|
|
2318
2319
|
}
|
|
2319
|
-
function
|
|
2320
|
+
function Im(a) {
|
|
2320
2321
|
if (a.length === 0) return { type: "home" };
|
|
2321
2322
|
const [t, r, n, s, l] = a;
|
|
2322
2323
|
if (t === "auth") return r === "sign-in" ? { type: "sign-in" } : r === "sign-up" ? { type: "sign-up" } : { type: "not-found" };
|
|
@@ -2325,7 +2326,7 @@ function Sm(a) {
|
|
|
2325
2326
|
return r ? r === "dashboard" ? { type: "dashboard", orgId: o } : r === "orders" ? { type: "orders", orgId: o } : r === "reservations" ? { type: "reservations", orgId: o } : r === "products" ? n ? n === "create" ? { type: "product-create", orgId: o } : { type: "product-edit", orgId: o, id: n } : { type: "products-list", orgId: o } : r === "product-categories" ? n ? n === "create" ? { type: "product-category-create", orgId: o } : { type: "product-category-edit", orgId: o, id: n } : { type: "product-categories-list", orgId: o } : r === "manufacturers" ? n ? n === "create" ? { type: "manufacturer-create", orgId: o } : { type: "manufacturer-edit", orgId: o, id: n } : { type: "manufacturers-list", orgId: o } : r === "settings" ? n ? n === "opening-times" ? { type: "settings-opening-times", orgId: o } : n === "shipping-methods" ? s ? s === "create" ? { type: "shipping-method-create", orgId: o } : { type: "shipping-method-edit", orgId: o, id: s } : { type: "shipping-methods-list", orgId: o } : n === "access" ? s ? s === "invite" ? { type: "access-invite", orgId: o } : { type: "access-member-edit", orgId: o, id: s } : { type: "access-list", orgId: o } : { type: "settings", orgId: o } : { type: "settings", orgId: o } : { type: "not-found" } : { type: "not-found" };
|
|
2326
2327
|
}
|
|
2327
2328
|
function Su({ segments: a }) {
|
|
2328
|
-
const t = Ia(), r = $(), n = G(), s = da(), l = pe(), { data: o, isPending: d } = t.useSession(), p =
|
|
2329
|
+
const t = Ia(), r = $(), n = G(), s = da(), l = pe(), { data: o, isPending: d } = t.useSession(), p = Im(a), m = p.type === "sign-in" || p.type === "sign-up", h = p.type === "home" || p.type === "organizations", u = l == null ? void 0 : l.get("redirect"), g = l == null ? void 0 : l.toString(), b = s ? `${s}${g ? `?${g}` : ""}` : r.home, f = m ? xt(u, r) : b;
|
|
2329
2330
|
if (X(() => {
|
|
2330
2331
|
if (!d) {
|
|
2331
2332
|
if (!o && !m) {
|
|
@@ -2336,67 +2337,67 @@ function Su({ segments: a }) {
|
|
|
2336
2337
|
}
|
|
2337
2338
|
}, [o, d, m, n, r.signIn, f]), d) return e("div", { className: "flex justify-center items-center h-screen", children: e("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600" }) });
|
|
2338
2339
|
if (m) {
|
|
2339
|
-
if (p.type === "sign-in") return e(
|
|
2340
|
-
if (p.type === "sign-up") return e(
|
|
2340
|
+
if (p.type === "sign-in") return e(Am, {});
|
|
2341
|
+
if (p.type === "sign-up") return e(Sm, {});
|
|
2341
2342
|
}
|
|
2342
2343
|
if (!o) return null;
|
|
2343
|
-
if (h) return e(Or, { children: e(
|
|
2344
|
+
if (h) return e(Or, { children: e(Nc, {}) });
|
|
2344
2345
|
if (p.type === "not-found") return e(bn, {});
|
|
2345
2346
|
const w = "orgId" in p ? p.orgId : void 0, y = "id" in p ? p.id : void 0;
|
|
2346
|
-
return e(
|
|
2347
|
+
return e(Ad, { organizationId: w, id: y, children: e(Or, { children: e(Id, { children: e(nm, { children: Em(p) }) }) }) });
|
|
2347
2348
|
}
|
|
2348
|
-
function
|
|
2349
|
+
function Em(a) {
|
|
2349
2350
|
switch (a.type) {
|
|
2350
2351
|
case "dashboard":
|
|
2351
|
-
return e(
|
|
2352
|
+
return e(Qd, {});
|
|
2352
2353
|
case "orders":
|
|
2353
|
-
return e(
|
|
2354
|
+
return e(wc, {});
|
|
2354
2355
|
case "reservations":
|
|
2355
|
-
return e(
|
|
2356
|
+
return e($c, {});
|
|
2356
2357
|
case "products-list":
|
|
2357
|
-
return e(
|
|
2358
|
+
return e(Zc, {});
|
|
2358
2359
|
case "product-create":
|
|
2359
|
-
return e(Qc, {});
|
|
2360
|
-
case "product-edit":
|
|
2361
2360
|
return e(Tc, {});
|
|
2361
|
+
case "product-edit":
|
|
2362
|
+
return e(Jc, {});
|
|
2362
2363
|
case "product-categories-list":
|
|
2363
|
-
return e(
|
|
2364
|
+
return e(Ec, {});
|
|
2364
2365
|
case "product-category-create":
|
|
2365
|
-
return e(zc, {});
|
|
2366
|
-
case "product-category-edit":
|
|
2367
2366
|
return e(Dc, {});
|
|
2367
|
+
case "product-category-edit":
|
|
2368
|
+
return e(Fc, {});
|
|
2368
2369
|
case "manufacturers-list":
|
|
2369
|
-
return e(
|
|
2370
|
+
return e(pc, {});
|
|
2370
2371
|
case "manufacturer-create":
|
|
2371
|
-
return e(Yd, {});
|
|
2372
|
-
case "manufacturer-edit":
|
|
2373
2372
|
return e(ec, {});
|
|
2373
|
+
case "manufacturer-edit":
|
|
2374
|
+
return e(ac, {});
|
|
2374
2375
|
case "settings":
|
|
2375
|
-
return e(Oe, { children: e(
|
|
2376
|
+
return e(Oe, { children: e(mm, {}) });
|
|
2376
2377
|
case "settings-opening-times":
|
|
2377
|
-
return e(Oe, { children: e(
|
|
2378
|
+
return e(Oe, { children: e(om, {}) });
|
|
2378
2379
|
case "shipping-methods-list":
|
|
2379
|
-
return e(Oe, { children: e(
|
|
2380
|
+
return e(Oe, { children: e(vm, {}) });
|
|
2380
2381
|
case "shipping-method-create":
|
|
2381
|
-
return e(Oe, { children: e(ym, {}) });
|
|
2382
|
-
case "shipping-method-edit":
|
|
2383
2382
|
return e(Oe, { children: e(bm, {}) });
|
|
2383
|
+
case "shipping-method-edit":
|
|
2384
|
+
return e(Oe, { children: e(xm, {}) });
|
|
2384
2385
|
case "access-list":
|
|
2385
|
-
return e(Oe, { children: e(
|
|
2386
|
+
return e(Oe, { children: e(hm, {}) });
|
|
2386
2387
|
case "access-invite":
|
|
2387
|
-
return e(Oe, { children: e(gm, {}) });
|
|
2388
|
-
case "access-member-edit":
|
|
2389
2388
|
return e(Oe, { children: e(fm, {}) });
|
|
2389
|
+
case "access-member-edit":
|
|
2390
|
+
return e(Oe, { children: e(ym, {}) });
|
|
2390
2391
|
default:
|
|
2391
2392
|
return e(bn, {});
|
|
2392
2393
|
}
|
|
2393
2394
|
}
|
|
2394
2395
|
export {
|
|
2395
2396
|
fe as $,
|
|
2396
|
-
|
|
2397
|
-
|
|
2397
|
+
cu as A,
|
|
2398
|
+
pu as B,
|
|
2398
2399
|
gl as C,
|
|
2399
|
-
|
|
2400
|
+
hu as D,
|
|
2400
2401
|
bn as E,
|
|
2401
2402
|
Au as F,
|
|
2402
2403
|
Cu as G,
|
|
@@ -2422,7 +2423,7 @@ export {
|
|
|
2422
2423
|
So as _,
|
|
2423
2424
|
Su as a,
|
|
2424
2425
|
yt as a0,
|
|
2425
|
-
|
|
2426
|
+
fu as a1,
|
|
2426
2427
|
Xt as a2,
|
|
2427
2428
|
Yt as a3,
|
|
2428
2429
|
er as a4,
|
|
@@ -2462,22 +2463,22 @@ export {
|
|
|
2462
2463
|
bl as f,
|
|
2463
2464
|
ol as g,
|
|
2464
2465
|
Nl as h,
|
|
2465
|
-
|
|
2466
|
+
gu as i,
|
|
2466
2467
|
xl as j,
|
|
2467
2468
|
Mr as k,
|
|
2468
|
-
|
|
2469
|
+
Go as l,
|
|
2469
2470
|
yu as m,
|
|
2470
2471
|
bu as n,
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2472
|
+
hd as o,
|
|
2473
|
+
gd as p,
|
|
2474
|
+
fd as q,
|
|
2474
2475
|
ku as r,
|
|
2475
2476
|
vu as s,
|
|
2476
2477
|
Nu as t,
|
|
2477
2478
|
qt as u,
|
|
2478
2479
|
yl as v,
|
|
2479
2480
|
fl as w,
|
|
2480
|
-
|
|
2481
|
+
mu as x,
|
|
2481
2482
|
ye as y,
|
|
2482
|
-
|
|
2483
|
+
uu as z
|
|
2483
2484
|
};
|