@storepecker/storefront-core 2.9.1 → 2.10.1

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 (91) hide show
  1. package/dist/address-BdIB6IuI.d.cts +42 -0
  2. package/dist/address-BdIB6IuI.d.ts +42 -0
  3. package/dist/api/index.cjs +36 -32
  4. package/dist/api/index.d.cts +20 -17
  5. package/dist/api/index.d.ts +20 -17
  6. package/dist/api/index.js +4 -4
  7. package/dist/{buy-now-BqVWXyy8.d.cts → buy-now-CDug6LJ_.d.ts} +2 -2
  8. package/dist/{buy-now-DFdnuLjO.d.ts → buy-now-DrKY5_9R.d.cts} +2 -2
  9. package/dist/checkout/index.cjs +163 -76
  10. package/dist/checkout/index.d.cts +37 -26
  11. package/dist/checkout/index.d.ts +37 -26
  12. package/dist/checkout/index.js +50 -64
  13. package/dist/checkout-totals-CbmXM9L7.d.cts +220 -0
  14. package/dist/checkout-totals-DU8l-Wyb.d.ts +220 -0
  15. package/dist/{chunk-IG4BW3ZB.cjs → chunk-32X4SWN4.cjs} +3 -3
  16. package/dist/{chunk-NQZ5GUOG.cjs → chunk-3YPE6UPC.cjs} +24 -16
  17. package/dist/{chunk-RDUT4W3B.cjs → chunk-6APRQ2ED.cjs} +4 -1
  18. package/dist/{chunk-ICKTXS6B.js → chunk-6IXTFZFS.js} +3 -3
  19. package/dist/{chunk-7M5CVYZJ.js → chunk-A7EI7XLU.js} +8 -1
  20. package/dist/chunk-DZPK7GPG.js +601 -0
  21. package/dist/{chunk-TH7OAMGC.js → chunk-E4D4XOAE.js} +24 -16
  22. package/dist/{chunk-NRPK5GCJ.cjs → chunk-EFYAFXIS.cjs} +3 -3
  23. package/dist/{chunk-CBKJ3Y2I.js → chunk-EWZ7TGI7.js} +11 -1
  24. package/dist/{chunk-5XVHYPOC.js → chunk-FF5N7PTB.js} +1 -1
  25. package/dist/{chunk-NOT6VKXA.cjs → chunk-H6UZTS5O.cjs} +67 -23
  26. package/dist/{chunk-XFOUNOKO.cjs → chunk-KNG4OMS5.cjs} +8 -0
  27. package/dist/{chunk-ZAWZ3RB6.js → chunk-NNE42NMP.js} +1 -1
  28. package/dist/chunk-PN6KH5PX.cjs +661 -0
  29. package/dist/{chunk-QQHQTBAM.js → chunk-QSRVMOXT.js} +48 -6
  30. package/dist/{chunk-W6BDMNSU.js → chunk-QVO56X4E.js} +1 -1
  31. package/dist/{chunk-6LS5F4R3.cjs → chunk-SGJUMI3M.cjs} +11 -0
  32. package/dist/{chunk-YLLAP3H2.cjs → chunk-SGKLMS7W.cjs} +2 -2
  33. package/dist/{chunk-ZGMLOLTC.js → chunk-VRZRV2BR.js} +4 -1
  34. package/dist/{chunk-IVKJJLG7.cjs → chunk-WWJAPKRQ.cjs} +8 -8
  35. package/dist/{collections-CXgOv5_G.d.cts → collections-CKNFcE2d.d.cts} +1 -1
  36. package/dist/{collections-CNh2OGbl.d.ts → collections-CtRKsWVx.d.ts} +1 -1
  37. package/dist/components/address-form.cjs +6 -6
  38. package/dist/components/address-form.d.cts +10 -6
  39. package/dist/components/address-form.d.ts +10 -6
  40. package/dist/components/address-form.js +5 -5
  41. package/dist/components/digital-product-download-modal.d.cts +2 -2
  42. package/dist/components/digital-product-download-modal.d.ts +2 -2
  43. package/dist/components/index.cjs +8 -8
  44. package/dist/components/index.d.cts +6 -7
  45. package/dist/components/index.d.ts +6 -7
  46. package/dist/components/index.js +6 -6
  47. package/dist/components/search-dropdown.d.cts +4 -4
  48. package/dist/components/search-dropdown.d.ts +4 -4
  49. package/dist/components/share-button.cjs +3 -3
  50. package/dist/components/share-button.d.cts +1 -1
  51. package/dist/components/share-button.d.ts +1 -1
  52. package/dist/components/share-button.js +2 -2
  53. package/dist/components/theme-data-initializer.d.cts +4 -5
  54. package/dist/components/theme-data-initializer.d.ts +4 -5
  55. package/dist/hooks/index.cjs +672 -44
  56. package/dist/hooks/index.d.cts +239 -13
  57. package/dist/hooks/index.d.ts +239 -13
  58. package/dist/hooks/index.js +630 -11
  59. package/dist/{instagram-DalreBu6.d.cts → instagram-CSzrxk10.d.cts} +8 -2
  60. package/dist/{instagram-BADLnNQ3.d.ts → instagram-CagTLmyq.d.ts} +8 -2
  61. package/dist/models/index.d.cts +8 -8
  62. package/dist/models/index.d.ts +8 -8
  63. package/dist/orders-B6BmHCJN.d.ts +337 -0
  64. package/dist/orders-ZKP0lqRN.d.cts +337 -0
  65. package/dist/pincode-8u7yWLpQ.d.cts +29 -0
  66. package/dist/pincode-8u7yWLpQ.d.ts +29 -0
  67. package/dist/{pixelEvents-LsealscG.d.ts → pixelEvents-DqJ_CEEr.d.ts} +4 -4
  68. package/dist/{pixelEvents-BtEO5QAR.d.cts → pixelEvents-bahgVW4_.d.cts} +4 -4
  69. package/dist/{product-D9liEtl4.d.cts → product-D4kol-Z-.d.cts} +26 -2
  70. package/dist/{product-D9liEtl4.d.ts → product-D4kol-Z-.d.ts} +26 -2
  71. package/dist/store/index.cjs +20 -30
  72. package/dist/store/index.d.cts +21 -7
  73. package/dist/store/index.d.ts +21 -7
  74. package/dist/store/index.js +9 -26
  75. package/dist/{useAddressForm-DGbEn91-.d.cts → useAddressForm-fMOb5Z-a.d.ts} +6 -1
  76. package/dist/{useAddressForm-cO3Au33k.d.ts → useAddressForm-wleIo78M.d.cts} +6 -1
  77. package/dist/utils/index.cjs +60 -56
  78. package/dist/utils/index.d.cts +24 -9
  79. package/dist/utils/index.d.ts +24 -9
  80. package/dist/utils/index.js +4 -4
  81. package/dist/{wishlist-Cj0sQxiY.d.ts → wishlist-L3fM5-ie.d.ts} +1 -1
  82. package/dist/{wishlist-BakHvIFN.d.cts → wishlist-_0x0r1jt.d.cts} +1 -1
  83. package/package.json +1 -1
  84. package/dist/address-DwBZHzbI.d.cts +0 -19
  85. package/dist/address-DwBZHzbI.d.ts +0 -19
  86. package/dist/cart-DZq1ZEnE.d.ts +0 -153
  87. package/dist/cart-DwMFBmpC.d.cts +0 -153
  88. package/dist/chunk-34Y7Y5FU.cjs +0 -246
  89. package/dist/chunk-VPTN4YXD.js +0 -232
  90. package/dist/orders-B3G4CyhH.d.cts +0 -166
  91. package/dist/orders-Bl-Slh72.d.ts +0 -166
@@ -0,0 +1,337 @@
1
+ import { g as SLICE_STATUS, d as Product, f as ProductDetail, P as Photos } from './product-D4kol-Z-.cjs';
2
+
3
+ declare namespace User {
4
+ interface Root {
5
+ customer_name: string;
6
+ phone: string;
7
+ email: string;
8
+ date_of_birth: string;
9
+ country_code: string;
10
+ gender: string;
11
+ }
12
+ interface UserState {
13
+ user: LoginUserData | null;
14
+ isAuthenticated: boolean;
15
+ status: SLICE_STATUS;
16
+ }
17
+ interface LoginUserData {
18
+ email: string;
19
+ first_name: string;
20
+ last_name: string;
21
+ access: string;
22
+ refresh: string;
23
+ user_id: number;
24
+ phone_number: string;
25
+ }
26
+ interface UserDetailsPayload {
27
+ customer_name: string;
28
+ gender: string;
29
+ date_of_birth: string;
30
+ }
31
+ type LoginMethod = "email_otp" | "phone_otp";
32
+ }
33
+
34
+ declare namespace Category {
35
+ interface Root {
36
+ id: number;
37
+ name: string;
38
+ photo: string;
39
+ slug: string;
40
+ description: string;
41
+ children?: Root[];
42
+ }
43
+ interface CategoriesState {
44
+ data: Root[];
45
+ status: SLICE_STATUS;
46
+ }
47
+ }
48
+
49
+ type DiscountType = "discount";
50
+ type ValueType = "percentage" | "fixed";
51
+ type ApplicableTarget = "product_category" | "product_variant" | "product_bundle" | "customer";
52
+ type CouponStatus = "active" | "inactive" | "expired";
53
+ interface Coupon {
54
+ id: number;
55
+ coupon_code: string;
56
+ name?: string;
57
+ description?: string | null;
58
+ discount_type: DiscountType;
59
+ value: string;
60
+ value_type: ValueType;
61
+ min_order_amount: string;
62
+ max_discount_amount: string;
63
+ start_date: string;
64
+ end_date: string;
65
+ status: CouponStatus;
66
+ is_deleted: boolean;
67
+ usage_limit: number;
68
+ usage_count: number;
69
+ applicable_target: ApplicableTarget;
70
+ applicable_product_variants: Product.ProductVariant[];
71
+ applicable_product_bundles: any[];
72
+ applicable_product_categories: Category.Root[];
73
+ applicable_customers: User.Root[];
74
+ auto_apply: boolean;
75
+ created_at: string;
76
+ updated_at: string;
77
+ is_cart_applicable: boolean;
78
+ coupon_message: string;
79
+ }
80
+ type Coupons = Coupon[];
81
+ interface CouponResponse {
82
+ coupon: Coupon;
83
+ }
84
+
85
+ interface CartState {
86
+ cart: Cart.Root | null;
87
+ total_quantity: number;
88
+ status: SLICE_STATUS;
89
+ }
90
+ declare namespace Cart {
91
+ interface Root {
92
+ product_variants: ProductDetail.Root[];
93
+ total_amount: number;
94
+ total_quantity: number;
95
+ products_quantity: ProductsQuantity;
96
+ cart_count: number;
97
+ missing_items: {
98
+ [key: number]: number;
99
+ };
100
+ missing_cart_items: {
101
+ [key: string]: number;
102
+ };
103
+ customization_inputs: Array<CustomizationInput>;
104
+ total_coupon_discount: number;
105
+ variant_discounts: {
106
+ [key: number]: number;
107
+ };
108
+ total_shipping: number;
109
+ total_tax_amount: number;
110
+ applied_coupon: Coupon | {};
111
+ shipping_options: ShippingOption[];
112
+ selected_shipping_option_id: number | null;
113
+ selected_address_id: number | null;
114
+ split_preview?: {
115
+ has_split: boolean;
116
+ regular_total: string;
117
+ preorder_total: string;
118
+ preorder_ship_days: number;
119
+ } | null;
120
+ }
121
+ interface CustomizationInput {
122
+ id: number;
123
+ product_variant: number;
124
+ customization_option: number;
125
+ customer_wishlist: null;
126
+ customer_order: null;
127
+ customer_cart: number;
128
+ customer_input: string;
129
+ customization_option_name: string;
130
+ customization_option_type: string;
131
+ is_mandatory: boolean;
132
+ additional_price?: number;
133
+ customization_price?: number;
134
+ effective_price?: number;
135
+ }
136
+ interface ProductsQuantity {
137
+ [key: number]: number;
138
+ }
139
+ interface ShippingOption {
140
+ id: number;
141
+ name: string;
142
+ description: string;
143
+ pricing_type: string;
144
+ base_price: string;
145
+ shipping_profile: number | null;
146
+ shipping_partner: string;
147
+ estimated_days_min: number;
148
+ estimated_days_max: number;
149
+ display_order: number;
150
+ is_active: boolean;
151
+ allowed_zones: any[];
152
+ price: string | null;
153
+ price_note: string | null;
154
+ estimated_delivery: string | null;
155
+ }
156
+ }
157
+
158
+ declare namespace Order {
159
+ interface Root {
160
+ id: number;
161
+ store: number;
162
+ customer: number;
163
+ total_amount: number;
164
+ paid_amount: number;
165
+ purchased_at: string;
166
+ purchased_products: PurchasedProduct[];
167
+ order_status: OrderStatus;
168
+ order_number: number;
169
+ order_ref: string;
170
+ payment_method: string | null;
171
+ cod_amount?: number;
172
+ shipping_address: string;
173
+ shipping_city: string;
174
+ shipping_state: string;
175
+ shipping_country: string;
176
+ shipping_zip: string;
177
+ tracking_id: string | null;
178
+ tracking_url: string | null;
179
+ delivery_date?: string;
180
+ delivered_at: string | null;
181
+ cancelled_at: string | null;
182
+ returned_at: string | null;
183
+ customer_details: CustomerDetails;
184
+ customer_name: string;
185
+ customer_phone: string;
186
+ linked_order: number;
187
+ linked_orders: {
188
+ id: number;
189
+ order_number: number;
190
+ is_preorder: boolean;
191
+ total_amount: number;
192
+ }[];
193
+ is_preorder: boolean;
194
+ selected_shipping_option_name: string;
195
+ shipping_amount: number;
196
+ is_cod: boolean;
197
+ currency_code: string;
198
+ payment_captured_mismatch: boolean;
199
+ payment_gateway_log: unknown[];
200
+ shipping_activity: unknown[];
201
+ }
202
+ interface OrderResponse {
203
+ current_page: number;
204
+ total_pages: number;
205
+ total_orders: number;
206
+ results: Root[];
207
+ }
208
+ interface VariantAttributes {
209
+ size: {
210
+ name: string;
211
+ value: string;
212
+ };
213
+ color?: {
214
+ name: string;
215
+ value: string;
216
+ };
217
+ Color?: {
218
+ name: string;
219
+ value: string;
220
+ };
221
+ }
222
+ interface CustomerDetails {
223
+ name: string;
224
+ phone: string;
225
+ }
226
+ type OrderStatus = "pending" | "confirmed" | "packed" | "shipped" | "delivered" | "cancelled" | "failed" | "paid" | "payment_pending" | "refunded" | "returned";
227
+ interface OrderSummary {
228
+ id: number;
229
+ store: number;
230
+ customer: number;
231
+ total_amount: number;
232
+ paid_amount: number;
233
+ purchased_at: string;
234
+ purchased_products: PurchasedProduct[];
235
+ order_status: string;
236
+ order_number: number;
237
+ order_ref: string;
238
+ payment_method: string | null;
239
+ shipping_address: string;
240
+ shipping_city: string;
241
+ shipping_state: string;
242
+ shipping_country: string;
243
+ shipping_zip: string;
244
+ tracking_id: string | null;
245
+ tracking_url: string | null;
246
+ delivery_date: string | null;
247
+ delivered_at: string | null;
248
+ cancelled_at: string | null;
249
+ returned_at: string | null;
250
+ customer_email: string;
251
+ customer_name: string;
252
+ customer_phone: string;
253
+ shipped_at: string | null;
254
+ confirmed_at: string | null;
255
+ refunded_at: string | null;
256
+ store_address: string;
257
+ store_city: string;
258
+ store_state: string;
259
+ store_country: string;
260
+ store_zip: string;
261
+ cart_count: number;
262
+ razorpay_public_token: string;
263
+ razorpay_order_id: string;
264
+ razorpay_order_status: string;
265
+ razorpay_order_amount: number;
266
+ razorpay_order_currency: string;
267
+ razorpay_payment_id: string;
268
+ razorpay_signature: string;
269
+ store_color_scheme: {
270
+ primary: string;
271
+ secondary: string;
272
+ };
273
+ store_logo: string;
274
+ store_name: string;
275
+ shipping_amount: number;
276
+ phonepe_redirect_url: string;
277
+ stripe_client_secret: string;
278
+ stripe_payment_intent_id: string;
279
+ stripe_publishable_key: string;
280
+ total_coupon_discount: number;
281
+ stripe_payment_link_url: string;
282
+ tabby_redirect_url?: string;
283
+ linked_order: number;
284
+ linked_orders: {
285
+ id: number;
286
+ order_number: number;
287
+ is_preorder: boolean;
288
+ total_amount: number;
289
+ }[];
290
+ is_preorder: boolean;
291
+ cod_amount: number;
292
+ customization_inputs: Cart.CustomizationInput[];
293
+ selected_shipping_option_name?: string;
294
+ fulfilment_time?: string;
295
+ }
296
+ interface PurchasedProduct {
297
+ product_id: number;
298
+ product_name: string;
299
+ product_variant_id: number;
300
+ product_variant_slug: string;
301
+ product_variant_name: string;
302
+ product_variant_sku: string;
303
+ quantity: number;
304
+ variant_price: number;
305
+ tax_percentage: number;
306
+ total_tax_price: number;
307
+ total_price: number;
308
+ variant_attributes: VariantAttributes;
309
+ product_variant_photo: Photos | null;
310
+ is_digital: boolean;
311
+ discount_amount: number;
312
+ }
313
+ interface StripePaymentStatus {
314
+ order_id: number;
315
+ order_status: string;
316
+ payment_link_id: string;
317
+ payment_link_url: string;
318
+ checkout_session_id: string;
319
+ status: string;
320
+ payment_status: string;
321
+ session_status: string;
322
+ amount_total: number;
323
+ currency: string;
324
+ customer_email: string | null;
325
+ payment_intent: string;
326
+ payment_link: string;
327
+ success?: boolean;
328
+ }
329
+ interface TabbyPaymentStatus {
330
+ order_status: string;
331
+ message: string;
332
+ status: string;
333
+ payment_id?: string;
334
+ }
335
+ }
336
+
337
+ export { type ApplicableTarget as A, Cart as C, type DiscountType as D, Order as O, User as U, type ValueType as V, type CartState as a, Category as b, type Coupon as c, type CouponResponse as d, type CouponStatus as e, type Coupons as f };
@@ -0,0 +1,29 @@
1
+ declare namespace Pincode {
2
+ /** One area sharing a postal code. `province` is the district for IN. */
3
+ interface Locality {
4
+ city: string;
5
+ state: string;
6
+ state_code: string;
7
+ province?: string;
8
+ }
9
+ /**
10
+ * `GET /utils/pincode/`. A pincode that isn't found is a 200 with
11
+ * `valid: false` and `error_code: "INVALID_PINCODE"`, not a 4xx. When the
12
+ * store hasn't opted in, `validation_enabled` is false and nothing else is set.
13
+ */
14
+ interface LookupResponse {
15
+ valid?: boolean;
16
+ validation_enabled?: boolean;
17
+ error_code?: string;
18
+ message?: string;
19
+ /** The district, e.g. "Kozhikode". */
20
+ province?: string;
21
+ /** A locality inside the district; smaller than `province`. */
22
+ city?: string;
23
+ state?: string;
24
+ state_code?: string;
25
+ localities?: Locality[];
26
+ }
27
+ }
28
+
29
+ export { Pincode as P };
@@ -0,0 +1,29 @@
1
+ declare namespace Pincode {
2
+ /** One area sharing a postal code. `province` is the district for IN. */
3
+ interface Locality {
4
+ city: string;
5
+ state: string;
6
+ state_code: string;
7
+ province?: string;
8
+ }
9
+ /**
10
+ * `GET /utils/pincode/`. A pincode that isn't found is a 200 with
11
+ * `valid: false` and `error_code: "INVALID_PINCODE"`, not a 4xx. When the
12
+ * store hasn't opted in, `validation_enabled` is false and nothing else is set.
13
+ */
14
+ interface LookupResponse {
15
+ valid?: boolean;
16
+ validation_enabled?: boolean;
17
+ error_code?: string;
18
+ message?: string;
19
+ /** The district, e.g. "Kozhikode". */
20
+ province?: string;
21
+ /** A locality inside the district; smaller than `province`. */
22
+ city?: string;
23
+ state?: string;
24
+ state_code?: string;
25
+ localities?: Locality[];
26
+ }
27
+ }
28
+
29
+ export { Pincode as P };
@@ -1,7 +1,6 @@
1
- import { b as Category$1, C as Cart } from './cart-DZq1ZEnE.js';
2
- import { C as CollectionResponse } from './collections-CNh2OGbl.js';
3
- import { O as Order } from './orders-Bl-Slh72.js';
4
- import { f as ProductDetail, d as Product } from './product-D9liEtl4.js';
1
+ import { b as Category$1, O as Order, C as Cart } from './orders-B6BmHCJN.js';
2
+ import { C as CollectionResponse } from './collections-CtRKsWVx.js';
3
+ import { f as ProductDetail, d as Product } from './product-D4kol-Z-.js';
5
4
 
6
5
  interface PageProps {
7
6
  nav_bar: NavBar;
@@ -94,6 +93,7 @@ type PageHeaderProps = Pick<PagePropsFull, "navbar" | "logo" | "store_name" | "s
94
93
  popup_thank_you_message: string;
95
94
  public_checkout_enabled: boolean;
96
95
  buy_now_enabled: boolean;
96
+ pincode_validation_enabled?: boolean;
97
97
  booking_success_message: string;
98
98
  order_success_message: string;
99
99
  };
@@ -1,7 +1,6 @@
1
- import { b as Category$1, C as Cart } from './cart-DwMFBmpC.cjs';
2
- import { C as CollectionResponse } from './collections-CXgOv5_G.cjs';
3
- import { O as Order } from './orders-B3G4CyhH.cjs';
4
- import { f as ProductDetail, d as Product } from './product-D9liEtl4.cjs';
1
+ import { b as Category$1, O as Order, C as Cart } from './orders-ZKP0lqRN.cjs';
2
+ import { C as CollectionResponse } from './collections-CKNFcE2d.cjs';
3
+ import { f as ProductDetail, d as Product } from './product-D4kol-Z-.cjs';
5
4
 
6
5
  interface PageProps {
7
6
  nav_bar: NavBar;
@@ -94,6 +93,7 @@ type PageHeaderProps = Pick<PagePropsFull, "navbar" | "logo" | "store_name" | "s
94
93
  popup_thank_you_message: string;
95
94
  public_checkout_enabled: boolean;
96
95
  buy_now_enabled: boolean;
96
+ pincode_validation_enabled?: boolean;
97
97
  booking_success_message: string;
98
98
  order_success_message: string;
99
99
  };
@@ -40,11 +40,18 @@ declare namespace Product {
40
40
  customizations: Customization[];
41
41
  }
42
42
  interface Customization {
43
+ id: number;
43
44
  name: string;
44
45
  customization_type: string;
45
- customization_options?: Customization[];
46
+ customization_options?: {
47
+ options: string[];
48
+ };
46
49
  is_mandatory?: boolean;
47
50
  additional_price?: string;
51
+ product?: number;
52
+ photos?: unknown[];
53
+ input_limit?: number;
54
+ customization_order?: number;
48
55
  }
49
56
  interface ProductVariant {
50
57
  id: number;
@@ -150,6 +157,7 @@ declare namespace Product {
150
157
  page: number;
151
158
  page_size?: number;
152
159
  is_service?: boolean;
160
+ stock_status?: string;
153
161
  [key: string]: any;
154
162
  };
155
163
  interface Meta {
@@ -165,6 +173,14 @@ declare namespace Product {
165
173
  name: string;
166
174
  slug: string;
167
175
  }
176
+ interface StockStatus {
177
+ value: string;
178
+ name: string;
179
+ }
180
+ type FilterResponse = {
181
+ [key: string]: FilterContent[] | StockStatus[] | undefined;
182
+ stock_statuses?: StockStatus[];
183
+ };
168
184
  }
169
185
  interface Photos {
170
186
  image: string;
@@ -236,6 +252,7 @@ declare namespace ProductDetail {
236
252
  currency_code: string;
237
253
  total_price: string;
238
254
  total_tax_price: number;
255
+ is_tax_inclusive_price?: boolean;
239
256
  is_custom_product: boolean;
240
257
  booking_service?: BookingService;
241
258
  fulfillment_time: string;
@@ -261,11 +278,18 @@ declare namespace ProductDetail {
261
278
  customizations: Customization[];
262
279
  }
263
280
  interface Customization {
281
+ id: number;
264
282
  name: string;
265
283
  customization_type: string;
266
- customization_options?: Customization[];
284
+ customization_options?: {
285
+ options: string[];
286
+ };
267
287
  is_mandatory?: boolean;
268
288
  additional_price?: string;
289
+ product?: number;
290
+ photos?: unknown[];
291
+ input_limit?: number;
292
+ customization_order?: number;
269
293
  }
270
294
  interface Customization {
271
295
  name: string;
@@ -40,11 +40,18 @@ declare namespace Product {
40
40
  customizations: Customization[];
41
41
  }
42
42
  interface Customization {
43
+ id: number;
43
44
  name: string;
44
45
  customization_type: string;
45
- customization_options?: Customization[];
46
+ customization_options?: {
47
+ options: string[];
48
+ };
46
49
  is_mandatory?: boolean;
47
50
  additional_price?: string;
51
+ product?: number;
52
+ photos?: unknown[];
53
+ input_limit?: number;
54
+ customization_order?: number;
48
55
  }
49
56
  interface ProductVariant {
50
57
  id: number;
@@ -150,6 +157,7 @@ declare namespace Product {
150
157
  page: number;
151
158
  page_size?: number;
152
159
  is_service?: boolean;
160
+ stock_status?: string;
153
161
  [key: string]: any;
154
162
  };
155
163
  interface Meta {
@@ -165,6 +173,14 @@ declare namespace Product {
165
173
  name: string;
166
174
  slug: string;
167
175
  }
176
+ interface StockStatus {
177
+ value: string;
178
+ name: string;
179
+ }
180
+ type FilterResponse = {
181
+ [key: string]: FilterContent[] | StockStatus[] | undefined;
182
+ stock_statuses?: StockStatus[];
183
+ };
168
184
  }
169
185
  interface Photos {
170
186
  image: string;
@@ -236,6 +252,7 @@ declare namespace ProductDetail {
236
252
  currency_code: string;
237
253
  total_price: string;
238
254
  total_tax_price: number;
255
+ is_tax_inclusive_price?: boolean;
239
256
  is_custom_product: boolean;
240
257
  booking_service?: BookingService;
241
258
  fulfillment_time: string;
@@ -261,11 +278,18 @@ declare namespace ProductDetail {
261
278
  customizations: Customization[];
262
279
  }
263
280
  interface Customization {
281
+ id: number;
264
282
  name: string;
265
283
  customization_type: string;
266
- customization_options?: Customization[];
284
+ customization_options?: {
285
+ options: string[];
286
+ };
267
287
  is_mandatory?: boolean;
268
288
  additional_price?: string;
289
+ product?: number;
290
+ photos?: unknown[];
291
+ input_limit?: number;
292
+ customization_order?: number;
269
293
  }
270
294
  interface Customization {
271
295
  name: string;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkNOT6VKXA_cjs = require('../chunk-NOT6VKXA.cjs');
4
- var chunkNRPK5GCJ_cjs = require('../chunk-NRPK5GCJ.cjs');
5
- require('../chunk-NQZ5GUOG.cjs');
3
+ var chunkH6UZTS5O_cjs = require('../chunk-H6UZTS5O.cjs');
4
+ var chunkEFYAFXIS_cjs = require('../chunk-EFYAFXIS.cjs');
5
+ require('../chunk-3YPE6UPC.cjs');
6
6
  require('../chunk-H6FJYRO3.cjs');
7
7
  var chunkDODFO744_cjs = require('../chunk-DODFO744.cjs');
8
8
  require('../chunk-ECHV2JSY.cjs');
@@ -12,27 +12,6 @@ require('../chunk-N3CTXRFT.cjs');
12
12
  var zustand = require('zustand');
13
13
 
14
14
  var initialState = {
15
- wishlist_count: 0,
16
- product_variants: []
17
- };
18
- var useWishlistStore = zustand.create((set) => ({
19
- ...initialState,
20
- setWishlist: (wishlist) => set(wishlist),
21
- resetWishlist: () => set(initialState),
22
- syncWishlist: async () => {
23
- try {
24
- const response = await chunkNRPK5GCJ_cjs.getWishlist("/customer/wishlist/");
25
- if (response.data) {
26
- set({
27
- wishlist_count: response.data.wishlist_count,
28
- product_variants: response.data.product_variants
29
- });
30
- }
31
- } catch {
32
- }
33
- }
34
- }));
35
- var initialState2 = {
36
15
  data: [],
37
16
  status: "loading" /* LOADING */,
38
17
  hasMore: false,
@@ -41,15 +20,18 @@ var initialState2 = {
41
20
  page_size: 10
42
21
  }
43
22
  };
23
+ var latestProductRequest = 0;
44
24
  var useProductStore = zustand.create((set, get) => ({
45
- ...initialState2,
25
+ ...initialState,
46
26
  fetchProducts: async (filter) => {
27
+ const requestId = ++latestProductRequest;
47
28
  set((state) => ({
48
29
  status: "loading" /* LOADING */,
49
30
  data: filter.page === 1 ? [] : state.data
50
31
  }));
51
32
  try {
52
- const response = await chunkNRPK5GCJ_cjs.getProducts({ ...filter });
33
+ const response = await chunkEFYAFXIS_cjs.getProducts({ ...filter });
34
+ if (requestId !== latestProductRequest) return;
53
35
  if (response.data) {
54
36
  const { results, ...meta } = response.data;
55
37
  set((state) => ({
@@ -61,6 +43,7 @@ var useProductStore = zustand.create((set, get) => ({
61
43
  }));
62
44
  }
63
45
  } catch {
46
+ if (requestId !== latestProductRequest) return;
64
47
  set({ status: "idle" /* IDLE */ });
65
48
  }
66
49
  },
@@ -69,19 +52,26 @@ var useProductStore = zustand.create((set, get) => ({
69
52
 
70
53
  Object.defineProperty(exports, "loginUser", {
71
54
  enumerable: true,
72
- get: function () { return chunkNOT6VKXA_cjs.loginUser; }
55
+ get: function () { return chunkH6UZTS5O_cjs.loginUser; }
73
56
  });
74
57
  Object.defineProperty(exports, "useAuthStore", {
75
58
  enumerable: true,
76
- get: function () { return chunkNOT6VKXA_cjs.useAuthStore; }
59
+ get: function () { return chunkH6UZTS5O_cjs.useAuthStore; }
77
60
  });
78
61
  Object.defineProperty(exports, "useCartStore", {
79
62
  enumerable: true,
80
- get: function () { return chunkNOT6VKXA_cjs.useCartStore; }
63
+ get: function () { return chunkH6UZTS5O_cjs.useCartStore; }
64
+ });
65
+ Object.defineProperty(exports, "useIsWishlisted", {
66
+ enumerable: true,
67
+ get: function () { return chunkH6UZTS5O_cjs.useIsWishlisted; }
68
+ });
69
+ Object.defineProperty(exports, "useWishlistStore", {
70
+ enumerable: true,
71
+ get: function () { return chunkH6UZTS5O_cjs.useWishlistStore; }
81
72
  });
82
73
  Object.defineProperty(exports, "useThemeData", {
83
74
  enumerable: true,
84
75
  get: function () { return chunkDODFO744_cjs.useThemeData; }
85
76
  });
86
77
  exports.useProductStore = useProductStore;
87
- exports.useWishlistStore = useWishlistStore;