@burdenoff/microfe-kadaikodi 2026.1124.1 → 2026.1126.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/kadaikodi/components/AppointmentSettingsSection.d.ts +13 -0
  2. package/dist/kadaikodi/components/AppointmentSettingsSection.js +206 -0
  3. package/dist/kadaikodi/components/AppointmentSettingsSection.js.map +1 -0
  4. package/dist/kadaikodi/components/AppointmentSlotPicker.d.ts +19 -0
  5. package/dist/kadaikodi/components/AppointmentSlotPicker.js +106 -0
  6. package/dist/kadaikodi/components/AppointmentSlotPicker.js.map +1 -0
  7. package/dist/kadaikodi/components/ProviderAppointmentQueue.d.ts +15 -0
  8. package/dist/kadaikodi/components/ProviderAppointmentQueue.js +179 -0
  9. package/dist/kadaikodi/components/ProviderAppointmentQueue.js.map +1 -0
  10. package/dist/kadaikodi/hooks/useAppointmentsApi.d.ts +122 -0
  11. package/dist/kadaikodi/hooks/useAppointmentsApi.js +186 -0
  12. package/dist/kadaikodi/hooks/useAppointmentsApi.js.map +1 -0
  13. package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts +3 -0
  14. package/dist/kadaikodi/hooks/useKadaikodiApi.js +5 -4
  15. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  16. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +97 -94
  17. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  18. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +172 -170
  19. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  20. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +250 -241
  21. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
  22. package/dist/kadaikodi/pages/customer/BookingDetailsPage.d.ts +3 -1
  23. package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +317 -178
  24. package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
  25. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.d.ts +3 -3
  26. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +307 -338
  27. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
  28. package/package.json +1 -1
@@ -2,253 +2,220 @@ import { PageLayout as e } from "../../components/PageLayout.js";
2
2
  import { EmptyState as t } from "../../components/EmptyState.js";
3
3
  import "../../components/viz/index.js";
4
4
  import { useKadaikodi as n } from "../../context/KadaikodiContext.js";
5
- import { useOfferings as r, usePlaceOrder as i, useProvider as a } from "../../hooks/useKadaikodiApi.js";
6
- import { cn as o } from "../../utils/cn.js";
7
- import { StepProgress as ee } from "../../components/viz/StepProgress.js";
8
- import { SegmentedTabs as s } from "../../components/viz/SegmentedTabs.js";
9
- import { formatCurrency as c } from "../../utils/formatters.js";
10
- import { ProviderImage as te } from "./shared.js";
11
- import { useState as l } from "react";
12
- import { AlertCircle as u, ArrowLeft as d, ArrowRight as f, Calendar as p, CheckCircle2 as m, Clock as h, CreditCard as g, Home as _, Loader2 as v, MapPin as ne, Navigation as re, Phone as ie, Smartphone as y, Wallet as b } from "lucide-react";
13
- import { useParams as x } from "react-router";
14
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
15
- import { EmphasisPanel as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
5
+ import { useOfferings as r, useProvider as i } from "../../hooks/useKadaikodiApi.js";
6
+ import { formatAppointmentTime as a, useAppointmentSettings as ee, useBookAppointment as te } from "../../hooks/useAppointmentsApi.js";
7
+ import { StepProgress as ne } from "../../components/viz/StepProgress.js";
8
+ import { SegmentedTabs as o } from "../../components/viz/SegmentedTabs.js";
9
+ import { AppointmentSlotPicker as s } from "../../components/AppointmentSlotPicker.js";
10
+ import { cn as c } from "../../utils/cn.js";
11
+ import { formatCurrency as l } from "../../utils/formatters.js";
12
+ import { ProviderImage as re } from "./shared.js";
13
+ import { useMemo as ie, useState as u } from "react";
14
+ import { AlertCircle as ae, ArrowLeft as d, ArrowRight as oe, Calendar as f, CheckCircle2 as p, Clock as m, CreditCard as h, Home as g, Loader2 as _, MapPin as v, Navigation as se, Phone as ce, Smartphone as le, Wallet as ue } from "lucide-react";
15
+ import { useParams as de } from "react-router";
16
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
17
+ import { EmphasisPanel as fe, PagePurpose as pe } from "@burdenoff/fe-libs/ui";
16
18
  // src/kadaikodi/pages/customer/DirectServiceBookingPage.tsx
17
- var D = [
19
+ var S = [
18
20
  "location",
19
21
  "details",
20
22
  "payment",
21
23
  "confirmation"
22
- ], O = {
24
+ ], me = {
23
25
  location: "Location",
24
26
  details: "Details",
25
27
  payment: "Payment",
26
28
  confirmation: "Confirmation"
27
29
  };
28
- function k() {
29
- let e = [], t = /* @__PURE__ */ new Date();
30
- for (let n = 0; n < 4; n++) {
31
- let r = new Date(t.getTime() + n * 864e5), i = n === 0 ? "Today" : n === 1 ? "Tomorrow" : r.toLocaleDateString([], {
32
- weekday: "short",
33
- day: "numeric"
34
- });
35
- e.push({
36
- value: r.toISOString().slice(0, 10),
37
- label: i
38
- });
39
- }
40
- return e;
41
- }
42
- function ae() {
43
- let e = [], t = new Date((/* @__PURE__ */ new Date()).getTime() + 18e5);
44
- for (let n = 0; n < 8; n++) {
45
- let r = new Date(t.getTime() + n * 30 * 6e4), i = r.toTimeString().slice(0, 5), a = r.toLocaleTimeString([], {
46
- hour: "2-digit",
47
- minute: "2-digit"
48
- });
49
- e.push({
50
- value: i,
51
- label: a
52
- });
53
- }
54
- return e;
55
- }
56
- function A() {
57
- let { cartId: A } = x(), { navigateTo: j, currentUser: M } = n(), { data: N, isLoading: P } = a(A), { data: F = [] } = r(A), I = i(), L = F[0], [R, z] = l("location"), [B, V] = l(!1), [H, U] = l({
30
+ function C() {
31
+ let { cartId: C } = de(), { navigateTo: w } = n(), { data: T, isLoading: E } = i(C), { data: D = [] } = r(C), { data: O, isError: k, refetch: A, isFetching: j } = ee(C), M = te(), N = ie(() => D.filter((e) => e.kind === "SERVICE" && e.isAvailable), [D]), [P, F] = u(""), I = N.find((e) => e.id === P) ?? N[0], L = O?.timezone, [R, z] = u("location"), B = R === "payment" && !L, [V, H] = u(!1), [U, W] = u({
58
32
  address: "",
59
33
  landmark: "",
60
34
  instructions: "",
61
35
  phoneNumber: ""
62
- }), [W, G] = l({
36
+ }), [G, K] = u({
63
37
  preferredTime: "",
64
38
  specialInstructions: "",
65
39
  isUrgent: !1
66
- }), [K, oe] = l("schedule"), [q, se] = l(""), [J, ce] = l("upi"), [Y, X] = l(null), Z = L?.price ?? 0, Q = Math.round(Z * .2), $ = Z - Q, le = Z;
67
- if (P) return /* @__PURE__ */ C(e, {
40
+ }), [q, he] = u("schedule"), [J, ge] = u("upi"), [Y, X] = u(null), Z = I?.price ?? 0, Q = Math.round(Z * .2), $ = Z - Q, _e = Z;
41
+ if (E) return /* @__PURE__ */ b(e, {
68
42
  title: "Book Direct Service",
69
- children: /* @__PURE__ */ C("div", {
43
+ children: /* @__PURE__ */ b("div", {
70
44
  className: "flex items-center justify-center py-20",
71
- children: /* @__PURE__ */ C("div", { className: "h-12 w-12 animate-spin rounded-full border-b-2 border-foreground" })
45
+ children: /* @__PURE__ */ b("div", { className: "h-12 w-12 animate-spin rounded-full border-b-2 border-foreground" })
72
46
  })
73
47
  });
74
- if (!N) return /* @__PURE__ */ C(e, {
48
+ if (!T) return /* @__PURE__ */ b(e, {
75
49
  title: "Cart Not Found",
76
- children: /* @__PURE__ */ C(t, {
77
- icon: /* @__PURE__ */ C(_, { className: "h-12 w-12" }),
50
+ children: /* @__PURE__ */ b(t, {
51
+ icon: /* @__PURE__ */ b(g, { className: "h-12 w-12" }),
78
52
  title: "Service not available",
79
53
  description: "Direct service is not available for this cart.",
80
- action: /* @__PURE__ */ C("button", {
54
+ action: /* @__PURE__ */ b("button", {
81
55
  type: "button",
82
- onClick: () => j("/customer/discover"),
56
+ onClick: () => w("/customer/discover"),
83
57
  className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
84
58
  children: "Browse Carts"
85
59
  })
86
60
  })
87
61
  });
88
- let ue = ae(), de = D.indexOf(R), fe = () => {
62
+ let ve = S.indexOf(R), ye = () => {
89
63
  navigator.geolocation ? navigator.geolocation.getCurrentPosition(() => {
90
- U((e) => ({
64
+ W((e) => ({
91
65
  ...e,
92
66
  address: e.address || "Current location detected"
93
67
  })), alert("Location detected successfully!");
94
68
  }, () => {
95
69
  alert("Failed to get your location. Please enter address manually.");
96
70
  }) : alert("Geolocation is not supported by this browser.");
97
- }, pe = () => H.address.trim() ? H.phoneNumber.trim() ? !0 : (alert("Please enter your phone number."), !1) : (alert("Please enter your address."), !1), me = () => K === "schedule" && !W.preferredTime ? (alert("Please select a preferred time slot."), !1) : !0, he = () => {
98
- R === "location" && pe() ? z("details") : R === "details" && me() ? z("payment") : R === "payment" && _e();
99
- }, ge = () => {
71
+ }, be = () => U.address.trim() ? U.phoneNumber.trim() ? !0 : (alert("Please enter your phone number."), !1) : (alert("Please enter your address."), !1), xe = () => I ? q === "schedule" && !G.preferredTime ? (alert("Please select a preferred time slot."), !1) : !0 : (alert("This cart has no bookable service right now."), !1), Se = () => {
72
+ R === "location" && be() ? z("details") : R === "details" && xe() ? z("payment") : R === "payment" && we();
73
+ }, Ce = () => {
100
74
  R === "details" ? z("location") : R === "payment" && z("details");
101
- }, _e = () => {
102
- V(!0);
103
- let e = new Date(Date.now() + 18e5).toISOString();
104
- if (N && L && M?.id) {
105
- I.mutate({
106
- providerId: N.id,
107
- customerId: M.id,
108
- fulfillmentType: "delivery",
109
- paymentMethod: J,
110
- tax: 0,
111
- items: [{
112
- name: L.name,
113
- offeringId: L.id,
114
- quantity: 1,
115
- unitPrice: Z
116
- }],
117
- notes: [H.instructions, W.specialInstructions].filter(Boolean).join(" | ") || void 0,
118
- deliveryAddress: {
119
- street: H.address,
120
- landmark: H.landmark
121
- }
122
- }, {
123
- onSuccess: (t) => {
124
- X({
125
- bookingId: t.orderNumber || t.id,
126
- orderId: t.id,
127
- transactionId: `TXN-${t.id}`,
128
- estimatedArrival: e
129
- }), z("confirmation"), V(!1);
130
- },
131
- onError: () => {
132
- V(!1), alert("Could not place your booking. Please try again.");
133
- }
134
- });
135
- return;
136
- }
137
- let t = `BK-${Date.now()}`;
138
- X({
139
- bookingId: t,
140
- orderId: t,
141
- transactionId: t,
142
- estimatedArrival: e
143
- }), z("confirmation"), V(!1);
75
+ }, we = () => {
76
+ if (!I || !L) return;
77
+ H(!0);
78
+ let e = [
79
+ G.isUrgent ? "Urgent" : "",
80
+ U.instructions,
81
+ G.specialInstructions
82
+ ].map((e) => e.trim()).filter(Boolean).join(" | ");
83
+ M.mutate({
84
+ offeringId: I.id,
85
+ timing: q === "now" ? "COME_NOW" : "SCHEDULED",
86
+ scheduledAt: q === "schedule" ? G.preferredTime : void 0,
87
+ serviceAddress: {
88
+ street: U.address,
89
+ landmark: U.landmark || void 0,
90
+ instructions: U.instructions || void 0
91
+ },
92
+ contactPhone: U.phoneNumber.trim() || void 0,
93
+ notes: e || void 0,
94
+ paymentMethod: J
95
+ }, {
96
+ onSuccess: (e) => {
97
+ X({
98
+ bookingId: e.id,
99
+ orderId: e.orderId ?? "",
100
+ scheduledAt: e.scheduledAt,
101
+ status: e.status
102
+ }), z("confirmation"), H(!1);
103
+ },
104
+ onError: (e) => {
105
+ H(!1), alert(e.message || "Could not place your booking. Please try again."), K((e) => ({
106
+ ...e,
107
+ preferredTime: ""
108
+ })), z("details");
109
+ }
110
+ });
144
111
  };
145
- return /* @__PURE__ */ w(e, {
146
- title: /* @__PURE__ */ w("div", {
112
+ return /* @__PURE__ */ x(e, {
113
+ title: /* @__PURE__ */ x("div", {
147
114
  className: "flex items-center gap-3",
148
- children: [/* @__PURE__ */ C("button", {
115
+ children: [/* @__PURE__ */ b("button", {
149
116
  type: "button",
150
- onClick: () => j(`/customer/cart/${N.id}`),
117
+ onClick: () => w(`/customer/cart/${T.id}`),
151
118
  className: "rounded-md p-1 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
152
- children: /* @__PURE__ */ C(d, { className: "h-5 w-5" })
153
- }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", { children: "Book Direct Service" }), /* @__PURE__ */ C("p", {
119
+ children: /* @__PURE__ */ b(d, { className: "h-5 w-5" })
120
+ }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", { children: "Book Direct Service" }), /* @__PURE__ */ b("p", {
154
121
  className: "text-xs font-normal text-text-secondary",
155
- children: N.name
122
+ children: T.name
156
123
  })] })]
157
124
  }),
158
125
  children: [
159
- /* @__PURE__ */ C(E, {
126
+ /* @__PURE__ */ b(pe, {
160
127
  className: "mb-6",
161
128
  children: "Book a service directly from this cart in a few guided steps — tell us where and when you need it, add any details, then confirm. Follow the progress bar below to know what's left."
162
129
  }),
163
- /* @__PURE__ */ C(T, {
130
+ /* @__PURE__ */ b(fe, {
164
131
  className: "mb-6",
165
- children: /* @__PURE__ */ C(ee, {
166
- steps: D.map((e) => ({ label: O[e] })),
167
- current: de
132
+ children: /* @__PURE__ */ b(ne, {
133
+ steps: S.map((e) => ({ label: me[e] })),
134
+ current: ve
168
135
  })
169
136
  }),
170
- /* @__PURE__ */ w("div", {
137
+ /* @__PURE__ */ x("div", {
171
138
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
172
- children: [/* @__PURE__ */ w("div", {
139
+ children: [/* @__PURE__ */ x("div", {
173
140
  className: "lg:col-span-2",
174
141
  children: [
175
- R === "location" && /* @__PURE__ */ w("div", {
142
+ R === "location" && /* @__PURE__ */ x("div", {
176
143
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
177
144
  children: [
178
- /* @__PURE__ */ w("h2", {
145
+ /* @__PURE__ */ x("h2", {
179
146
  className: "text-base font-semibold text-text-primary mb-1 flex items-center gap-2",
180
- children: [/* @__PURE__ */ C(ne, { className: "h-4 w-4" }), "Service Location"]
147
+ children: [/* @__PURE__ */ b(v, { className: "h-4 w-4" }), "Service Location"]
181
148
  }),
182
- /* @__PURE__ */ C("p", {
149
+ /* @__PURE__ */ b("p", {
183
150
  className: "text-xs text-text-secondary mb-5",
184
151
  children: "Where should the cart come?"
185
152
  }),
186
- /* @__PURE__ */ w("div", {
153
+ /* @__PURE__ */ x("div", {
187
154
  className: "space-y-4",
188
155
  children: [
189
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
156
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("label", {
190
157
  className: "block text-sm font-medium text-text-primary mb-1.5",
191
- children: ["Your Address ", /* @__PURE__ */ C("span", {
158
+ children: ["Your Address ", /* @__PURE__ */ b("span", {
192
159
  className: "text-status-error-text",
193
160
  children: "*"
194
161
  })]
195
- }), /* @__PURE__ */ w("div", {
162
+ }), /* @__PURE__ */ x("div", {
196
163
  className: "flex gap-2",
197
- children: [/* @__PURE__ */ C("input", {
164
+ children: [/* @__PURE__ */ b("input", {
198
165
  type: "text",
199
166
  placeholder: "Enter your full address",
200
- value: H.address,
201
- onChange: (e) => U((t) => ({
167
+ value: U.address,
168
+ onChange: (e) => W((t) => ({
202
169
  ...t,
203
170
  address: e.target.value
204
171
  })),
205
172
  className: "flex-1 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
206
- }), /* @__PURE__ */ w("button", {
173
+ }), /* @__PURE__ */ x("button", {
207
174
  type: "button",
208
- onClick: fe,
175
+ onClick: ye,
209
176
  className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors whitespace-nowrap",
210
- children: [/* @__PURE__ */ C(re, { className: "h-3.5 w-3.5" }), "Use Current Location"]
177
+ children: [/* @__PURE__ */ b(se, { className: "h-3.5 w-3.5" }), "Use Current Location"]
211
178
  })]
212
179
  })] }),
213
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
180
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
214
181
  className: "block text-sm font-medium text-text-primary mb-1.5",
215
182
  children: "Nearby Landmark"
216
- }), /* @__PURE__ */ C("input", {
183
+ }), /* @__PURE__ */ b("input", {
217
184
  type: "text",
218
185
  placeholder: "e.g., Near Metro Station, Opposite Mall",
219
- value: H.landmark,
220
- onChange: (e) => U((t) => ({
186
+ value: U.landmark,
187
+ onChange: (e) => W((t) => ({
221
188
  ...t,
222
189
  landmark: e.target.value
223
190
  })),
224
191
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
225
192
  })] }),
226
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
193
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
227
194
  className: "block text-sm font-medium text-text-primary mb-1.5",
228
195
  children: "Instructions for Cart Owner"
229
- }), /* @__PURE__ */ C("textarea", {
196
+ }), /* @__PURE__ */ b("textarea", {
230
197
  rows: 3,
231
198
  placeholder: "Any specific instructions to help us find you...",
232
- value: H.instructions,
233
- onChange: (e) => U((t) => ({
199
+ value: U.instructions,
200
+ onChange: (e) => W((t) => ({
234
201
  ...t,
235
202
  instructions: e.target.value
236
203
  })),
237
204
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
238
205
  })] }),
239
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
206
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("label", {
240
207
  className: "block text-sm font-medium text-text-primary mb-1.5",
241
- children: ["Phone Number ", /* @__PURE__ */ C("span", {
208
+ children: ["Phone Number ", /* @__PURE__ */ b("span", {
242
209
  className: "text-status-error-text",
243
210
  children: "*"
244
211
  })]
245
- }), /* @__PURE__ */ w("div", {
212
+ }), /* @__PURE__ */ x("div", {
246
213
  className: "relative",
247
- children: [/* @__PURE__ */ C(ie, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ C("input", {
214
+ children: [/* @__PURE__ */ b(ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ b("input", {
248
215
  type: "tel",
249
216
  placeholder: "Enter your phone number",
250
- value: H.phoneNumber,
251
- onChange: (e) => U((t) => ({
217
+ value: U.phoneNumber,
218
+ onChange: (e) => W((t) => ({
252
219
  ...t,
253
220
  phoneNumber: e.target.value
254
221
  })),
@@ -259,26 +226,53 @@ function A() {
259
226
  })
260
227
  ]
261
228
  }),
262
- R === "details" && /* @__PURE__ */ w("div", {
229
+ R === "details" && /* @__PURE__ */ x("div", {
263
230
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
264
231
  children: [
265
- /* @__PURE__ */ w("h2", {
232
+ /* @__PURE__ */ x("h2", {
266
233
  className: "text-base font-semibold text-text-primary mb-1 flex items-center gap-2",
267
- children: [/* @__PURE__ */ C(p, { className: "h-4 w-4" }), "Booking Details"]
234
+ children: [/* @__PURE__ */ b(f, { className: "h-4 w-4" }), "Booking Details"]
268
235
  }),
269
- /* @__PURE__ */ C("p", {
236
+ /* @__PURE__ */ b("p", {
270
237
  className: "text-xs text-text-secondary mb-5",
271
238
  children: "Choose your preferred timing"
272
239
  }),
273
- /* @__PURE__ */ w("div", {
240
+ /* @__PURE__ */ x("div", {
274
241
  className: "space-y-4",
275
242
  children: [
276
- /* @__PURE__ */ w("div", { children: [
277
- /* @__PURE__ */ C("label", {
243
+ N.length === 0 ? /* @__PURE__ */ b("p", {
244
+ className: "rounded-lg bg-bg-sunken p-3 text-sm text-text-secondary",
245
+ children: "This cart has no bookable service right now."
246
+ }) : /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
247
+ htmlFor: "booking-service",
248
+ className: "block text-sm font-medium text-text-primary mb-1.5",
249
+ children: "Service"
250
+ }), /* @__PURE__ */ b("select", {
251
+ id: "booking-service",
252
+ value: I?.id ?? "",
253
+ onChange: (e) => {
254
+ F(e.target.value), K((e) => ({
255
+ ...e,
256
+ preferredTime: ""
257
+ }));
258
+ },
259
+ className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
260
+ children: N.map((e) => /* @__PURE__ */ x("option", {
261
+ value: e.id,
262
+ children: [
263
+ e.name,
264
+ e.durationMinutes ? ` · ${e.durationMinutes} min` : "",
265
+ " · ",
266
+ l(e.price, { minimumFractionDigits: 0 })
267
+ ]
268
+ }, e.id))
269
+ })] }),
270
+ /* @__PURE__ */ x("div", { children: [
271
+ /* @__PURE__ */ b("label", {
278
272
  className: "block text-sm font-medium text-text-primary mb-2",
279
273
  children: "When do you need it?"
280
274
  }),
281
- /* @__PURE__ */ C(s, {
275
+ /* @__PURE__ */ b(o, {
282
276
  fill: !0,
283
277
  "aria-label": "Timing",
284
278
  tabs: [{
@@ -288,67 +282,47 @@ function A() {
288
282
  id: "schedule",
289
283
  label: "Schedule"
290
284
  }],
291
- value: K,
292
- onChange: (e) => oe(e)
285
+ value: q,
286
+ onChange: (e) => he(e)
293
287
  }),
294
- K === "now" && /* @__PURE__ */ C("p", {
288
+ q === "now" && /* @__PURE__ */ b("p", {
295
289
  className: "mt-2 text-xs text-text-secondary",
296
- children: "The cart heads to you as soon as it accepts — no slot needed."
290
+ children: "The cart heads to you as soon as it accepts — no slot needed. Only available while the cart is open and free right now."
297
291
  })
298
292
  ] }),
299
- K === "schedule" && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
300
- className: "block text-sm font-medium text-text-primary mb-1.5",
301
- children: "Day"
302
- }), /* @__PURE__ */ C("div", {
303
- className: "grid grid-cols-4 gap-2",
304
- children: k().map((e) => /* @__PURE__ */ C("button", {
305
- type: "button",
306
- onClick: () => se(e.value),
307
- className: o("rounded-lg border py-2 px-2 text-xs font-medium transition-colors", q === e.value ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-accent-primary" : "border-border-subtle text-text-secondary hover:bg-accent hover:text-text-primary"),
308
- children: e.label
309
- }, e.value))
310
- })] }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
311
- className: "block text-sm font-medium text-text-primary mb-1.5",
312
- children: ["Preferred Time Slot ", /* @__PURE__ */ C("span", {
313
- className: "text-status-error-text",
314
- children: "*"
315
- })]
316
- }), /* @__PURE__ */ C("div", {
317
- className: "grid grid-cols-4 gap-2",
318
- children: ue.map((e) => /* @__PURE__ */ C("button", {
319
- type: "button",
320
- onClick: () => G((t) => ({
321
- ...t,
322
- preferredTime: e.value
323
- })),
324
- className: o("rounded-lg border py-2 px-2 text-xs font-medium transition-colors", W.preferredTime === e.value ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-accent-primary" : "border-border-subtle text-text-secondary hover:bg-accent hover:text-text-primary"),
325
- children: e.label
326
- }, e.value))
327
- })] })] }),
328
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
293
+ q === "schedule" && I && /* @__PURE__ */ b(s, {
294
+ providerId: T.id,
295
+ offeringId: I.id,
296
+ value: G.preferredTime,
297
+ onChange: (e) => K((t) => ({
298
+ ...t,
299
+ preferredTime: e
300
+ }))
301
+ }),
302
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
329
303
  className: "block text-sm font-medium text-text-primary mb-1.5",
330
304
  children: "Special Instructions"
331
- }), /* @__PURE__ */ C("textarea", {
305
+ }), /* @__PURE__ */ b("textarea", {
332
306
  rows: 3,
333
307
  placeholder: "Any special requests or dietary preferences...",
334
- value: W.specialInstructions,
335
- onChange: (e) => G((t) => ({
308
+ value: G.specialInstructions,
309
+ onChange: (e) => K((t) => ({
336
310
  ...t,
337
311
  specialInstructions: e.target.value
338
312
  })),
339
313
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
340
314
  })] }),
341
- /* @__PURE__ */ w("label", {
315
+ /* @__PURE__ */ x("label", {
342
316
  className: "flex items-center gap-2 cursor-pointer",
343
- children: [/* @__PURE__ */ C("input", {
317
+ children: [/* @__PURE__ */ b("input", {
344
318
  type: "checkbox",
345
- checked: W.isUrgent,
346
- onChange: (e) => G((t) => ({
319
+ checked: G.isUrgent,
320
+ onChange: (e) => K((t) => ({
347
321
  ...t,
348
322
  isUrgent: e.target.checked
349
323
  })),
350
324
  className: "h-4 w-4 rounded border-border-subtle"
351
- }), /* @__PURE__ */ C("span", {
325
+ }), /* @__PURE__ */ b("span", {
352
326
  className: "text-sm text-text-secondary",
353
327
  children: "This is urgent (additional charges may apply)"
354
328
  })]
@@ -357,110 +331,110 @@ function A() {
357
331
  })
358
332
  ]
359
333
  }),
360
- R === "payment" && /* @__PURE__ */ w("div", {
334
+ R === "payment" && /* @__PURE__ */ x("div", {
361
335
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
362
336
  children: [
363
- /* @__PURE__ */ w("h2", {
337
+ /* @__PURE__ */ x("h2", {
364
338
  className: "text-base font-semibold text-text-primary mb-1 flex items-center gap-2",
365
- children: [/* @__PURE__ */ C(g, { className: "h-4 w-4" }), "Advance Payment"]
339
+ children: [/* @__PURE__ */ b(h, { className: "h-4 w-4" }), "Advance Payment"]
366
340
  }),
367
- /* @__PURE__ */ C("p", {
341
+ /* @__PURE__ */ b("p", {
368
342
  className: "text-xs text-text-secondary mb-5",
369
343
  children: "Select your payment method"
370
344
  }),
371
- /* @__PURE__ */ w("div", {
345
+ /* @__PURE__ */ x("div", {
372
346
  className: "space-y-4",
373
347
  children: [
374
- /* @__PURE__ */ w("div", {
348
+ /* @__PURE__ */ x("div", {
375
349
  className: "flex items-start gap-2 rounded-lg border border-border-focus/20 bg-[var(--color-accent-soft)] p-3",
376
- children: [/* @__PURE__ */ C(u, { className: "h-4 w-4 text-text-primary shrink-0 mt-0.5" }), /* @__PURE__ */ w("p", {
350
+ children: [/* @__PURE__ */ b(ae, { className: "h-4 w-4 text-text-primary shrink-0 mt-0.5" }), /* @__PURE__ */ x("p", {
377
351
  className: "text-xs text-text-primary",
378
352
  children: [
379
353
  "You need to pay ",
380
- c(Q, { minimumFractionDigits: 0 }),
354
+ l(Q, { minimumFractionDigits: 0 }),
381
355
  " ",
382
356
  "in advance to confirm your booking. Pay the remaining when the cart arrives."
383
357
  ]
384
358
  })]
385
359
  }),
386
- /* @__PURE__ */ C("div", {
360
+ /* @__PURE__ */ b("div", {
387
361
  className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
388
362
  children: [
389
363
  {
390
364
  value: "upi",
391
365
  label: "UPI",
392
366
  sub: "Instant payment",
393
- Icon: y
367
+ Icon: le
394
368
  },
395
369
  {
396
370
  value: "card",
397
371
  label: "Card",
398
372
  sub: "Secure payment",
399
- Icon: g
373
+ Icon: h
400
374
  },
401
375
  {
402
376
  value: "wallet",
403
377
  label: "Wallet",
404
378
  sub: "Quick payment",
405
- Icon: b
379
+ Icon: ue
406
380
  }
407
- ].map(({ value: e, label: t, sub: n, Icon: r }) => /* @__PURE__ */ w("button", {
381
+ ].map(({ value: e, label: t, sub: n, Icon: r }) => /* @__PURE__ */ x("button", {
408
382
  type: "button",
409
- onClick: () => ce(e),
410
- className: o("rounded-lg border p-3 text-center transition-colors", J === e ? "border-foreground bg-accent" : "border-border-subtle hover:bg-accent"),
383
+ onClick: () => ge(e),
384
+ className: c("rounded-lg border p-3 text-center transition-colors", J === e ? "border-foreground bg-accent" : "border-border-subtle hover:bg-accent"),
411
385
  children: [
412
- /* @__PURE__ */ C(r, { className: "mx-auto h-5 w-5 text-text-secondary mb-1" }),
413
- /* @__PURE__ */ C("p", {
386
+ /* @__PURE__ */ b(r, { className: "mx-auto h-5 w-5 text-text-secondary mb-1" }),
387
+ /* @__PURE__ */ b("p", {
414
388
  className: "text-sm font-medium text-text-primary",
415
389
  children: t
416
390
  }),
417
- /* @__PURE__ */ C("p", {
391
+ /* @__PURE__ */ b("p", {
418
392
  className: "text-[10px] text-text-secondary",
419
393
  children: n
420
394
  })
421
395
  ]
422
396
  }, e))
423
397
  }),
424
- /* @__PURE__ */ w("div", {
398
+ /* @__PURE__ */ x("div", {
425
399
  className: "rounded-lg bg-bg-sunken p-4",
426
- children: [/* @__PURE__ */ C("h3", {
400
+ children: [/* @__PURE__ */ b("h3", {
427
401
  className: "text-sm font-medium text-text-primary mb-2",
428
402
  children: "Payment Summary"
429
- }), /* @__PURE__ */ w("div", {
403
+ }), /* @__PURE__ */ x("div", {
430
404
  className: "space-y-2 text-sm",
431
405
  children: [
432
- /* @__PURE__ */ w("div", {
406
+ /* @__PURE__ */ x("div", {
433
407
  className: "flex justify-between",
434
- children: [/* @__PURE__ */ C("span", {
408
+ children: [/* @__PURE__ */ b("span", {
435
409
  className: "text-text-secondary",
436
410
  children: "Advance Payment:"
437
- }), /* @__PURE__ */ C("span", {
411
+ }), /* @__PURE__ */ b("span", {
438
412
  className: "text-text-primary",
439
- children: c(Q, { minimumFractionDigits: 0 })
413
+ children: l(Q, { minimumFractionDigits: 0 })
440
414
  })]
441
415
  }),
442
- /* @__PURE__ */ w("div", {
416
+ /* @__PURE__ */ x("div", {
443
417
  className: "flex justify-between",
444
- children: [/* @__PURE__ */ C("span", {
418
+ children: [/* @__PURE__ */ b("span", {
445
419
  className: "text-text-secondary",
446
420
  children: "Service Fee:"
447
- }), /* @__PURE__ */ C("span", {
421
+ }), /* @__PURE__ */ b("span", {
448
422
  className: "text-text-primary",
449
- children: c(Z, { minimumFractionDigits: 0 })
423
+ children: l(Z, { minimumFractionDigits: 0 })
450
424
  })]
451
425
  }),
452
- /* @__PURE__ */ w("div", {
426
+ /* @__PURE__ */ x("div", {
453
427
  className: "flex justify-between text-text-secondary",
454
- children: [/* @__PURE__ */ C("span", { children: "Balance Payment (at arrival):" }), /* @__PURE__ */ C("span", { children: c($, { minimumFractionDigits: 0 }) })]
428
+ children: [/* @__PURE__ */ b("span", { children: "Balance Payment (at arrival):" }), /* @__PURE__ */ b("span", { children: l($, { minimumFractionDigits: 0 }) })]
455
429
  }),
456
- /* @__PURE__ */ w("div", {
430
+ /* @__PURE__ */ x("div", {
457
431
  className: "flex justify-between border-t border-border-subtle pt-2 font-semibold",
458
- children: [/* @__PURE__ */ C("span", {
432
+ children: [/* @__PURE__ */ b("span", {
459
433
  className: "text-text-primary",
460
434
  children: "Total Amount:"
461
- }), /* @__PURE__ */ C("span", {
435
+ }), /* @__PURE__ */ b("span", {
462
436
  className: "text-text-primary",
463
- children: c(le, { minimumFractionDigits: 0 })
437
+ children: l(_e, { minimumFractionDigits: 0 })
464
438
  })]
465
439
  })
466
440
  ]
@@ -470,140 +444,124 @@ function A() {
470
444
  })
471
445
  ]
472
446
  }),
473
- R === "confirmation" && Y && /* @__PURE__ */ w("div", {
447
+ R === "confirmation" && Y && /* @__PURE__ */ x("div", {
474
448
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
475
449
  children: [
476
- /* @__PURE__ */ w("div", {
450
+ /* @__PURE__ */ x("div", {
477
451
  className: "text-center mb-6",
478
452
  children: [
479
- /* @__PURE__ */ C("div", {
453
+ /* @__PURE__ */ b("div", {
480
454
  className: "mx-auto mb-3 flex h-14 w-14 items-center justify-center rounded-full bg-status-success-bg-subtle",
481
- children: /* @__PURE__ */ C(m, { className: "h-7 w-7 text-status-success-text" })
455
+ children: /* @__PURE__ */ b(p, { className: "h-7 w-7 text-status-success-text" })
482
456
  }),
483
- /* @__PURE__ */ C("h2", {
457
+ /* @__PURE__ */ b("h2", {
484
458
  className: "text-lg font-semibold text-text-primary mb-1",
485
- children: "Booking Confirmed!"
459
+ children: Y.status === "CONFIRMED" ? "Booking Confirmed!" : "Booking Requested!"
486
460
  }),
487
- /* @__PURE__ */ C("p", {
461
+ /* @__PURE__ */ b("p", {
488
462
  className: "text-sm text-text-secondary",
489
- children: "Your direct service booking has been confirmed and payment processed."
463
+ children: Y.status === "CONFIRMED" ? "Your appointment is confirmed by the cart." : "Your slot is reserved. The cart will confirm it shortly."
490
464
  })
491
465
  ]
492
466
  }),
493
- /* @__PURE__ */ w("div", {
467
+ /* @__PURE__ */ x("div", {
494
468
  className: "rounded-lg bg-bg-sunken p-4 mb-4",
495
- children: [/* @__PURE__ */ C("h3", {
469
+ children: [/* @__PURE__ */ b("h3", {
496
470
  className: "text-sm font-medium text-text-primary mb-3",
497
471
  children: "Booking Details"
498
- }), /* @__PURE__ */ w("div", {
472
+ }), /* @__PURE__ */ x("div", {
499
473
  className: "grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm",
500
474
  children: [
501
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", {
475
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", {
502
476
  className: "text-xs text-text-secondary",
503
477
  children: "Booking ID"
504
- }), /* @__PURE__ */ C("p", {
478
+ }), /* @__PURE__ */ b("p", {
505
479
  className: "font-mono text-xs text-text-primary",
506
480
  children: Y.bookingId
507
481
  })] }),
508
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", {
482
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", {
509
483
  className: "text-xs text-text-secondary",
510
- children: "Est. Arrival"
511
- }), /* @__PURE__ */ C("p", {
484
+ children: q === "now" ? "Requested For" : "Scheduled For"
485
+ }), /* @__PURE__ */ b("p", {
512
486
  className: "text-text-primary",
513
- children: new Date(Y.estimatedArrival).toLocaleTimeString([], {
514
- hour: "2-digit",
487
+ children: L ? a(Y.scheduledAt, L, {
488
+ weekday: "short",
489
+ day: "numeric",
490
+ month: "short",
491
+ hour: "numeric",
515
492
  minute: "2-digit"
516
- })
493
+ }) : null
517
494
  })] }),
518
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", {
495
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", {
519
496
  className: "text-xs text-text-secondary",
520
497
  children: "Location"
521
- }), /* @__PURE__ */ C("p", {
498
+ }), /* @__PURE__ */ b("p", {
522
499
  className: "text-text-primary truncate",
523
- children: H.address
500
+ children: U.address
524
501
  })] }),
525
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", {
502
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", {
526
503
  className: "text-xs text-text-secondary",
527
504
  children: "Phone"
528
- }), /* @__PURE__ */ C("p", {
505
+ }), /* @__PURE__ */ b("p", {
529
506
  className: "text-text-primary",
530
- children: H.phoneNumber
507
+ children: U.phoneNumber
531
508
  })] })
532
509
  ]
533
510
  })]
534
511
  }),
535
- /* @__PURE__ */ w("div", {
536
- className: "rounded-lg border border-status-success-text/20 bg-status-success-bg-subtle p-4 mb-4",
537
- children: [/* @__PURE__ */ w("h3", {
538
- className: "text-sm font-medium text-status-success-text mb-2 flex items-center gap-2",
539
- children: [/* @__PURE__ */ C(m, { className: "h-4 w-4" }), "Payment Processed"]
540
- }), /* @__PURE__ */ w("div", {
512
+ /* @__PURE__ */ x("div", {
513
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-4 mb-4",
514
+ children: [/* @__PURE__ */ x("h3", {
515
+ className: "text-sm font-medium text-text-primary mb-2 flex items-center gap-2",
516
+ children: [/* @__PURE__ */ b(h, { className: "h-4 w-4" }), "Payment"]
517
+ }), /* @__PURE__ */ x("div", {
541
518
  className: "grid grid-cols-2 gap-3 text-sm",
542
519
  children: [
543
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", {
544
- className: "text-xs text-text-secondary",
545
- children: "Transaction ID"
546
- }), /* @__PURE__ */ C("p", {
547
- className: "font-mono text-xs text-text-primary",
548
- children: Y.transactionId
549
- })] }),
550
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", {
520
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", {
551
521
  className: "text-xs text-text-secondary",
552
- children: "Advance Paid"
553
- }), /* @__PURE__ */ C("p", {
522
+ children: "Advance Due"
523
+ }), /* @__PURE__ */ b("p", {
554
524
  className: "font-medium text-text-primary",
555
- children: c(Q, { minimumFractionDigits: 0 })
525
+ children: l(Q, { minimumFractionDigits: 0 })
556
526
  })] }),
557
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", {
527
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", {
558
528
  className: "text-xs text-text-secondary",
559
529
  children: "Method"
560
- }), /* @__PURE__ */ C("p", {
530
+ }), /* @__PURE__ */ b("p", {
561
531
  className: "capitalize text-text-primary",
562
532
  children: J
563
533
  })] }),
564
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("span", {
534
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("span", {
565
535
  className: "text-xs text-text-secondary",
566
536
  children: "Status"
567
- }), /* @__PURE__ */ C("p", {
568
- className: "font-medium text-status-success-text",
569
- children: "Paid"
537
+ }), /* @__PURE__ */ b("p", {
538
+ className: "font-medium text-status-warning-text",
539
+ children: "Pending"
570
540
  })] })
571
541
  ]
572
542
  })]
573
543
  }),
574
- /* @__PURE__ */ w("div", {
544
+ /* @__PURE__ */ x("div", {
575
545
  className: "rounded-lg border border-border-focus/20 bg-[var(--color-accent-soft)] p-4 mb-6",
576
- children: [/* @__PURE__ */ C("h3", {
546
+ children: [/* @__PURE__ */ b("h3", {
577
547
  className: "text-sm font-medium text-text-primary mb-2",
578
548
  children: "Next Steps"
579
- }), /* @__PURE__ */ w("div", {
549
+ }), /* @__PURE__ */ x("div", {
580
550
  className: "space-y-2 text-xs text-text-primary",
581
551
  children: [
582
- /* @__PURE__ */ w("div", {
552
+ /* @__PURE__ */ x("div", {
583
553
  className: "flex items-start gap-2",
584
- children: [/* @__PURE__ */ C(m, { className: "h-3.5 w-3.5 text-status-success-text mt-0.5 shrink-0" }), /* @__PURE__ */ w("span", { children: [
585
- "Payment confirmed -",
586
- " ",
587
- c(Q, { minimumFractionDigits: 0 }),
588
- " paid"
589
- ] })]
554
+ children: [/* @__PURE__ */ b(m, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ x("span", { children: [q === "now" ? "Cart heads to you from " : "Cart arrives at ", L ? a(Y.scheduledAt, L) : null] })]
590
555
  }),
591
- /* @__PURE__ */ w("div", {
556
+ /* @__PURE__ */ x("div", {
592
557
  className: "flex items-start gap-2",
593
- children: [/* @__PURE__ */ C(h, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ w("span", { children: [
594
- "Cart will arrive around",
595
- " ",
596
- new Date(Y.estimatedArrival).toLocaleTimeString([], {
597
- hour: "2-digit",
598
- minute: "2-digit"
599
- })
600
- ] })]
558
+ children: [/* @__PURE__ */ b(f, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ b("span", { children: q === "now" ? "You can withdraw this request from the booking page until the cart confirms it" : O && O.cancellationCutoffHours > 0 ? `Reschedule or cancel from the booking page until ${O.cancellationCutoffHours} hour${O.cancellationCutoffHours === 1 ? "" : "s"} before the slot` : "Reschedule or cancel from the booking page until the slot starts" })]
601
559
  }),
602
- /* @__PURE__ */ w("div", {
560
+ /* @__PURE__ */ x("div", {
603
561
  className: "flex items-start gap-2",
604
- children: [/* @__PURE__ */ C(g, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ w("span", { children: [
562
+ children: [/* @__PURE__ */ b(h, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ x("span", { children: [
605
563
  "Pay remaining ",
606
- c($, { minimumFractionDigits: 0 }),
564
+ l($, { minimumFractionDigits: 0 }),
607
565
  " ",
608
566
  "when cart arrives"
609
567
  ] })]
@@ -611,90 +569,101 @@ function A() {
611
569
  ]
612
570
  })]
613
571
  }),
614
- /* @__PURE__ */ w("div", {
572
+ /* @__PURE__ */ x("div", {
615
573
  className: "flex gap-3",
616
- children: [/* @__PURE__ */ C("button", {
574
+ children: [/* @__PURE__ */ b("button", {
617
575
  type: "button",
618
- onClick: () => j(`/customer/booking/${Y.orderId}`),
576
+ disabled: !Y.orderId,
577
+ onClick: () => w(`/customer/booking/${Y.orderId}`),
619
578
  className: "flex-1 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background hover:opacity-90 transition-opacity",
620
579
  children: "View Booking"
621
- }), /* @__PURE__ */ C("button", {
580
+ }), /* @__PURE__ */ b("button", {
622
581
  type: "button",
623
- onClick: () => j("/customer/discover"),
582
+ onClick: () => w("/customer/discover"),
624
583
  className: "flex-1 rounded-lg border border-border-subtle px-4 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
625
584
  children: "Browse More"
626
585
  })]
627
586
  })
628
587
  ]
629
588
  }),
630
- R !== "confirmation" && /* @__PURE__ */ w("div", {
589
+ B && k && /* @__PURE__ */ x("div", {
590
+ className: "mt-5 flex flex-wrap items-center gap-3 text-sm text-status-error-text",
591
+ children: ["Could not load this cart's appointment settings, so the booking cannot be confirmed yet.", /* @__PURE__ */ b("button", {
592
+ type: "button",
593
+ onClick: () => void A(),
594
+ disabled: j,
595
+ className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent disabled:opacity-60 disabled:cursor-not-allowed",
596
+ children: "Retry"
597
+ })]
598
+ }),
599
+ R !== "confirmation" && /* @__PURE__ */ x("div", {
631
600
  className: "flex justify-between mt-5",
632
- children: [/* @__PURE__ */ w("button", {
601
+ children: [/* @__PURE__ */ x("button", {
633
602
  type: "button",
634
- onClick: ge,
603
+ onClick: Ce,
635
604
  disabled: R === "location",
636
- className: o("flex items-center gap-2 rounded-lg border border-border-subtle px-4 py-2.5 text-sm font-medium text-text-primary transition-colors", R === "location" ? "opacity-40 cursor-not-allowed" : "hover:bg-accent"),
637
- children: [/* @__PURE__ */ C(d, { className: "h-4 w-4" }), "Previous"]
638
- }), /* @__PURE__ */ C("button", {
605
+ className: c("flex items-center gap-2 rounded-lg border border-border-subtle px-4 py-2.5 text-sm font-medium text-text-primary transition-colors", R === "location" ? "opacity-40 cursor-not-allowed" : "hover:bg-accent"),
606
+ children: [/* @__PURE__ */ b(d, { className: "h-4 w-4" }), "Previous"]
607
+ }), /* @__PURE__ */ b("button", {
639
608
  type: "button",
640
- onClick: he,
641
- disabled: B,
642
- className: o("flex items-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background transition-opacity", B ? "opacity-60 cursor-not-allowed" : "hover:opacity-90"),
643
- children: B ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(v, { className: "h-4 w-4 animate-spin" }), R === "payment" ? "Processing Payment..." : "Processing..."] }) : /* @__PURE__ */ w(S, { children: [R === "payment" ? "Confirm & Pay" : "Next", /* @__PURE__ */ C(f, { className: "h-4 w-4" })] })
609
+ onClick: Se,
610
+ disabled: V || B,
611
+ className: c("flex items-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background transition-opacity", V || B ? "opacity-60 cursor-not-allowed" : "hover:opacity-90"),
612
+ children: V ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_, { className: "h-4 w-4 animate-spin" }), R === "payment" ? "Processing Payment..." : "Processing..."] }) : /* @__PURE__ */ x(y, { children: [R === "payment" ? "Confirm & Pay" : "Next", /* @__PURE__ */ b(oe, { className: "h-4 w-4" })] })
644
613
  })]
645
614
  })
646
615
  ]
647
- }), /* @__PURE__ */ C("div", {
616
+ }), /* @__PURE__ */ b("div", {
648
617
  className: "lg:col-span-1",
649
- children: /* @__PURE__ */ w("div", {
618
+ children: /* @__PURE__ */ x("div", {
650
619
  className: "sticky top-6 rounded-lg border border-border-subtle bg-bg-surface p-5",
651
620
  children: [
652
- /* @__PURE__ */ C("h3", {
621
+ /* @__PURE__ */ b("h3", {
653
622
  className: "text-base font-semibold text-text-primary mb-4",
654
623
  children: "Service Summary"
655
624
  }),
656
- /* @__PURE__ */ w("div", {
625
+ /* @__PURE__ */ x("div", {
657
626
  className: "flex items-center gap-3 mb-4",
658
- children: [/* @__PURE__ */ C("div", {
627
+ children: [/* @__PURE__ */ b("div", {
659
628
  className: "h-12 w-12 shrink-0 overflow-hidden rounded-lg",
660
- children: /* @__PURE__ */ C(te, {
661
- src: N.image,
662
- alt: N.name,
663
- seed: N.name
629
+ children: /* @__PURE__ */ b(re, {
630
+ src: T.image,
631
+ alt: T.name,
632
+ seed: T.name
664
633
  })
665
- }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
634
+ }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
666
635
  className: "text-sm font-medium text-text-primary",
667
- children: N.name
668
- }), /* @__PURE__ */ C("p", {
636
+ children: T.name
637
+ }), /* @__PURE__ */ b("p", {
669
638
  className: "text-xs text-text-secondary",
670
- children: N.category
639
+ children: T.category
671
640
  })] })]
672
641
  }),
673
- /* @__PURE__ */ w("div", {
642
+ /* @__PURE__ */ x("div", {
674
643
  className: "space-y-2 text-sm border-t border-border-subtle pt-3",
675
- children: [/* @__PURE__ */ w("div", {
644
+ children: [/* @__PURE__ */ x("div", {
676
645
  className: "flex justify-between",
677
- children: [/* @__PURE__ */ C("span", {
646
+ children: [/* @__PURE__ */ b("span", {
678
647
  className: "text-text-secondary",
679
648
  children: "Service Fee:"
680
- }), /* @__PURE__ */ C("span", {
649
+ }), /* @__PURE__ */ b("span", {
681
650
  className: "text-text-primary",
682
- children: c(Z, { minimumFractionDigits: 0 })
651
+ children: l(Z, { minimumFractionDigits: 0 })
683
652
  })]
684
- }), /* @__PURE__ */ w("div", {
653
+ }), /* @__PURE__ */ x("div", {
685
654
  className: "flex justify-between",
686
- children: [/* @__PURE__ */ C("span", {
655
+ children: [/* @__PURE__ */ b("span", {
687
656
  className: "text-text-secondary",
688
657
  children: "Advance Payment:"
689
- }), /* @__PURE__ */ C("span", {
658
+ }), /* @__PURE__ */ b("span", {
690
659
  className: "font-medium text-text-primary",
691
- children: c(Q, { minimumFractionDigits: 0 })
660
+ children: l(Q, { minimumFractionDigits: 0 })
692
661
  })]
693
662
  })]
694
663
  }),
695
- /* @__PURE__ */ w("div", {
664
+ /* @__PURE__ */ x("div", {
696
665
  className: "flex items-center gap-2 mt-3 pt-3 border-t border-border-subtle text-status-success-text",
697
- children: [/* @__PURE__ */ C(m, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ C("span", {
666
+ children: [/* @__PURE__ */ b(p, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ b("span", {
698
667
  className: "text-xs",
699
668
  children: "Pay remaining amount at cart"
700
669
  })]
@@ -706,6 +675,6 @@ function A() {
706
675
  ]
707
676
  });
708
677
  }
709
- export { A as DirectServiceBookingPage };
678
+ export { C as DirectServiceBookingPage };
710
679
 
711
680
  //# sourceMappingURL=DirectServiceBookingPage.js.map