@storepecker/storefront-core 2.3.1 → 2.3.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.
- package/dist/api/index.cjs +17 -17
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/{cart-XumsY-y0.d.cts → cart-B13IUuwP.d.cts} +3 -0
- package/dist/{cart-CfsntcpS.d.ts → cart-DOy6dICN.d.ts} +3 -0
- package/dist/checkout/index.cjs +17 -13
- package/dist/checkout/index.d.cts +7 -2
- package/dist/checkout/index.d.ts +7 -2
- package/dist/checkout/index.js +1 -1
- package/dist/{chunk-B7FOXIZN.js → chunk-ELP23UGF.js} +27 -2
- package/dist/{chunk-AFM4IJVE.js → chunk-ILVGYHNI.js} +1 -1
- package/dist/{chunk-665CNTEX.cjs → chunk-JCOOINQF.cjs} +5 -5
- package/dist/{chunk-Z4DBCDAH.cjs → chunk-NKJ4DF4D.cjs} +6 -6
- package/dist/{chunk-47XTPPII.cjs → chunk-TB72NPRM.cjs} +27 -1
- package/dist/{chunk-YEJZYH55.js → chunk-U25T7M6S.js} +2 -1
- package/dist/{chunk-X35IATPX.js → chunk-VJCAOV74.js} +1 -1
- package/dist/{chunk-6BVTMDR2.cjs → chunk-Y2CPMT34.cjs} +2 -1
- package/dist/components/index.cjs +3 -3
- package/dist/components/index.js +2 -2
- package/dist/hooks/index.cjs +15 -15
- package/dist/hooks/index.d.cts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +4 -4
- package/dist/models/index.d.cts +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/store/index.cjs +7 -7
- package/dist/store/index.d.cts +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.js +2 -2
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/api/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkY46EHRJQ_cjs = require('../chunk-Y46EHRJQ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkY2CPMT34_cjs = require('../chunk-Y2CPMT34.cjs');
|
|
5
5
|
require('../chunk-SMHJRNCR.cjs');
|
|
6
6
|
var chunkCV6DWPYF_cjs = require('../chunk-CV6DWPYF.cjs');
|
|
7
7
|
var chunkRDUT4W3B_cjs = require('../chunk-RDUT4W3B.cjs');
|
|
@@ -151,67 +151,67 @@ Object.defineProperty(exports, "updateUserDetails", {
|
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "addToCart", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkY2CPMT34_cjs.addToCart; }
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "addWishlist", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkY2CPMT34_cjs.addWishlist; }
|
|
159
159
|
});
|
|
160
160
|
Object.defineProperty(exports, "getCart", {
|
|
161
161
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkY2CPMT34_cjs.getCart; }
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "getCategories", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkY2CPMT34_cjs.getCategories; }
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "getDigitalProductDownloadLink", {
|
|
169
169
|
enumerable: true,
|
|
170
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunkY2CPMT34_cjs.getDigitalProductDownloadLink; }
|
|
171
171
|
});
|
|
172
172
|
Object.defineProperty(exports, "getProductCategories", {
|
|
173
173
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkY2CPMT34_cjs.getProductCategories; }
|
|
175
175
|
});
|
|
176
176
|
Object.defineProperty(exports, "getProductDetail", {
|
|
177
177
|
enumerable: true,
|
|
178
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunkY2CPMT34_cjs.getProductDetail; }
|
|
179
179
|
});
|
|
180
180
|
Object.defineProperty(exports, "getProductDetailBySlug", {
|
|
181
181
|
enumerable: true,
|
|
182
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunkY2CPMT34_cjs.getProductDetailBySlug; }
|
|
183
183
|
});
|
|
184
184
|
Object.defineProperty(exports, "getProductList", {
|
|
185
185
|
enumerable: true,
|
|
186
|
-
get: function () { return
|
|
186
|
+
get: function () { return chunkY2CPMT34_cjs.getProductList; }
|
|
187
187
|
});
|
|
188
188
|
Object.defineProperty(exports, "getProducts", {
|
|
189
189
|
enumerable: true,
|
|
190
|
-
get: function () { return
|
|
190
|
+
get: function () { return chunkY2CPMT34_cjs.getProducts; }
|
|
191
191
|
});
|
|
192
192
|
Object.defineProperty(exports, "getWishlist", {
|
|
193
193
|
enumerable: true,
|
|
194
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunkY2CPMT34_cjs.getWishlist; }
|
|
195
195
|
});
|
|
196
196
|
Object.defineProperty(exports, "notifyProductStock", {
|
|
197
197
|
enumerable: true,
|
|
198
|
-
get: function () { return
|
|
198
|
+
get: function () { return chunkY2CPMT34_cjs.notifyProductStock; }
|
|
199
199
|
});
|
|
200
200
|
Object.defineProperty(exports, "removeFromCart", {
|
|
201
201
|
enumerable: true,
|
|
202
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkY2CPMT34_cjs.removeFromCart; }
|
|
203
203
|
});
|
|
204
204
|
Object.defineProperty(exports, "removeFromWishlist", {
|
|
205
205
|
enumerable: true,
|
|
206
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkY2CPMT34_cjs.removeFromWishlist; }
|
|
207
207
|
});
|
|
208
208
|
Object.defineProperty(exports, "updateCart", {
|
|
209
209
|
enumerable: true,
|
|
210
|
-
get: function () { return
|
|
210
|
+
get: function () { return chunkY2CPMT34_cjs.updateCart; }
|
|
211
211
|
});
|
|
212
212
|
Object.defineProperty(exports, "updateDigitalProductDownloadLinkCount", {
|
|
213
213
|
enumerable: true,
|
|
214
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkY2CPMT34_cjs.updateDigitalProductDownloadLinkCount; }
|
|
215
215
|
});
|
|
216
216
|
Object.defineProperty(exports, "applyCoupon", {
|
|
217
217
|
enumerable: true,
|
package/dist/api/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as axios from 'axios';
|
|
2
2
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
3
3
|
import { A as Address } from '../address-DwBZHzbI.cjs';
|
|
4
|
-
import { U as User, C as Cart, d as CouponResponse, c as Coupon, b as Category } from '../cart-
|
|
4
|
+
import { U as User, C as Cart, d as CouponResponse, c as Coupon, b as Category } from '../cart-B13IUuwP.cjs';
|
|
5
5
|
import { d as Product, f as ProductDetail } from '../product-Daxj09p9.cjs';
|
|
6
6
|
import { O as Order } from '../orders-Dm5Dq02y.cjs';
|
|
7
7
|
import { W as Wishlist } from '../wishlist-Cow1wVqf.cjs';
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as axios from 'axios';
|
|
2
2
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
3
3
|
import { A as Address } from '../address-DwBZHzbI.js';
|
|
4
|
-
import { U as User, C as Cart, d as CouponResponse, c as Coupon, b as Category } from '../cart-
|
|
4
|
+
import { U as User, C as Cart, d as CouponResponse, c as Coupon, b as Category } from '../cart-DOy6dICN.js';
|
|
5
5
|
import { d as Product, f as ProductDetail } from '../product-Daxj09p9.js';
|
|
6
6
|
import { O as Order } from '../orders-CvCa7XWm.js';
|
|
7
7
|
import { W as Wishlist } from '../wishlist-gamNg0T1.js';
|
package/dist/api/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { getUserDetails, updateUserDetails } from '../chunk-WYXT5AAG.js';
|
|
2
|
-
export { addToCart, addWishlist, getCart, getCategories, getDigitalProductDownloadLink, getProductCategories, getProductDetail, getProductDetailBySlug, getProductList, getProducts, getWishlist, notifyProductStock, removeFromCart, removeFromWishlist, updateCart, updateDigitalProductDownloadLinkCount } from '../chunk-
|
|
2
|
+
export { addToCart, addWishlist, getCart, getCategories, getDigitalProductDownloadLink, getProductCategories, getProductDetail, getProductDetailBySlug, getProductList, getProducts, getWishlist, notifyProductStock, removeFromCart, removeFromWishlist, updateCart, updateDigitalProductDownloadLinkCount } from '../chunk-U25T7M6S.js';
|
|
3
3
|
import '../chunk-QAC72HKO.js';
|
|
4
4
|
export { applyCoupon, checkPhonepePaymentStatus, getAppliedCoupon, getCoupons, getOrderDetails, getOrderDetailsByNumber, getOrders, getPublicOrderDetailsByNumber, getStripePaymentStatus, getStripePaymentStatusPublic, makeCODOrder, phonepeOrderSuccess, phonepePublicOrderSuccess, placeOrder, publicMakeCODOrder, publicPlaceOrder, razorpayOrderFail, razorpayOrderSuccess, razorpayPublicOrderSuccess, removeCoupon, stripeOrderFail, stripeOrderSuccess, stripePublicOrderSuccess, updateOrder, updateOrderCustomization, uploadCustomizationImage, verifyTabbyPayment } from '../chunk-VWFZZFZL.js';
|
|
5
5
|
export { addAddress, deleteAddress, getAddresses, getCountries, getSubdivisions, updateAddress } from '../chunk-ZGMLOLTC.js';
|
package/dist/checkout/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunk65Z7I5UP_cjs = require('../chunk-65Z7I5UP.cjs');
|
|
4
4
|
var chunkCV6DWPYF_cjs = require('../chunk-CV6DWPYF.cjs');
|
|
5
5
|
var chunkK44JZ5NL_cjs = require('../chunk-K44JZ5NL.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkTB72NPRM_cjs = require('../chunk-TB72NPRM.cjs');
|
|
7
7
|
require('../chunk-ECHV2JSY.cjs');
|
|
8
8
|
require('../chunk-BBRXE57K.cjs');
|
|
9
9
|
require('../chunk-NE3ZHELZ.cjs');
|
|
@@ -176,51 +176,55 @@ Object.defineProperty(exports, "removeCheckoutCoupon", {
|
|
|
176
176
|
});
|
|
177
177
|
Object.defineProperty(exports, "IP_API_CACHE_KEY", {
|
|
178
178
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunkTB72NPRM_cjs.IP_API_CACHE_KEY; }
|
|
180
180
|
});
|
|
181
181
|
Object.defineProperty(exports, "addressFormInitialValues", {
|
|
182
182
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunkTB72NPRM_cjs.addressFormInitialValues; }
|
|
184
184
|
});
|
|
185
185
|
Object.defineProperty(exports, "addressValidationSchema", {
|
|
186
186
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunkTB72NPRM_cjs.addressValidationSchema; }
|
|
188
188
|
});
|
|
189
189
|
Object.defineProperty(exports, "buildAddressPayload", {
|
|
190
190
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunkTB72NPRM_cjs.buildAddressPayload; }
|
|
192
192
|
});
|
|
193
193
|
Object.defineProperty(exports, "buildSubmitPayload", {
|
|
194
194
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
195
|
+
get: function () { return chunkTB72NPRM_cjs.buildSubmitPayload; }
|
|
196
196
|
});
|
|
197
197
|
Object.defineProperty(exports, "clearAddressFormSession", {
|
|
198
198
|
enumerable: true,
|
|
199
|
-
get: function () { return
|
|
199
|
+
get: function () { return chunkTB72NPRM_cjs.clearAddressFormSession; }
|
|
200
200
|
});
|
|
201
201
|
Object.defineProperty(exports, "decodeAddress", {
|
|
202
202
|
enumerable: true,
|
|
203
|
-
get: function () { return
|
|
203
|
+
get: function () { return chunkTB72NPRM_cjs.decodeAddress; }
|
|
204
204
|
});
|
|
205
205
|
Object.defineProperty(exports, "encodeAddress", {
|
|
206
206
|
enumerable: true,
|
|
207
|
-
get: function () { return
|
|
207
|
+
get: function () { return chunkTB72NPRM_cjs.encodeAddress; }
|
|
208
208
|
});
|
|
209
209
|
Object.defineProperty(exports, "isValidPhoneNumber", {
|
|
210
210
|
enumerable: true,
|
|
211
|
-
get: function () { return
|
|
211
|
+
get: function () { return chunkTB72NPRM_cjs.isValidPhoneNumber; }
|
|
212
212
|
});
|
|
213
213
|
Object.defineProperty(exports, "loadAddressFormFromSession", {
|
|
214
214
|
enumerable: true,
|
|
215
|
-
get: function () { return
|
|
215
|
+
get: function () { return chunkTB72NPRM_cjs.loadAddressFormFromSession; }
|
|
216
216
|
});
|
|
217
217
|
Object.defineProperty(exports, "parseEditAddress", {
|
|
218
218
|
enumerable: true,
|
|
219
|
-
get: function () { return
|
|
219
|
+
get: function () { return chunkTB72NPRM_cjs.parseEditAddress; }
|
|
220
|
+
});
|
|
221
|
+
Object.defineProperty(exports, "sanitizePhoneNumber", {
|
|
222
|
+
enumerable: true,
|
|
223
|
+
get: function () { return chunkTB72NPRM_cjs.sanitizePhoneNumber; }
|
|
220
224
|
});
|
|
221
225
|
Object.defineProperty(exports, "saveAddressFormToSession", {
|
|
222
226
|
enumerable: true,
|
|
223
|
-
get: function () { return
|
|
227
|
+
get: function () { return chunkTB72NPRM_cjs.saveAddressFormToSession; }
|
|
224
228
|
});
|
|
225
229
|
exports.calculateCartTotals = calculateCartTotals;
|
|
226
230
|
exports.checkPhonepeReturnStatus = checkPhonepeReturnStatus;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Yup from 'yup';
|
|
2
|
-
import { C as Cart, c as Coupon } from '../cart-
|
|
2
|
+
import { C as Cart, c as Coupon } from '../cart-B13IUuwP.cjs';
|
|
3
3
|
import { O as Order } from '../orders-Dm5Dq02y.cjs';
|
|
4
4
|
import '../product-Daxj09p9.cjs';
|
|
5
5
|
import 'react-toastify';
|
|
@@ -21,6 +21,11 @@ interface AddressFormValues {
|
|
|
21
21
|
customer_email: string;
|
|
22
22
|
}
|
|
23
23
|
declare const addressFormInitialValues: AddressFormValues;
|
|
24
|
+
/**
|
|
25
|
+
* Strip country calling code prefix and trim whitespace from a phone number.
|
|
26
|
+
* E.g. "+919876543210" with countryCode "IN" → "9876543210"
|
|
27
|
+
*/
|
|
28
|
+
declare function sanitizePhoneNumber(input: string, countryCode: string): string;
|
|
24
29
|
/**
|
|
25
30
|
* Validates a phone number using libphonenumber-js
|
|
26
31
|
*/
|
|
@@ -248,4 +253,4 @@ declare function checkStripeReturnStatus(sessionId: string, orderNumber: number,
|
|
|
248
253
|
*/
|
|
249
254
|
declare function checkTabbyReturnStatus(orderNumber: number, callbacks: PaymentStatusCallbacks): Promise<void>;
|
|
250
255
|
|
|
251
|
-
export { type AddressFormValues, type CartTotals, type CouponCallbacks, IP_API_CACHE_KEY, type PaymentCallbacks, type PaymentStatusCallbacks, addressFormInitialValues, addressValidationSchema, applyCheckoutCoupon, buildAddressPayload, buildSubmitPayload, calculateCartTotals, checkPhonepeReturnStatus, checkPhonepeReturnStatusWithOrder, checkStripeReturnStatus, checkTabbyReturnStatus, clearAddressFormSession, decodeAddress, encodeAddress, fetchAppliedCoupon, fetchAvailableCoupons, handleCODPayment, handlePhonepePayment, handleRazorpayFail, handleRazorpaySuccess, handleStripePayment, handleStripeSuccess, handleTabbyPayment, isValidPhoneNumber, loadAddressFormFromSession, openRazorpayCheckout, parseEditAddress, processPayment, removeCheckoutCoupon, saveAddressFormToSession };
|
|
256
|
+
export { type AddressFormValues, type CartTotals, type CouponCallbacks, IP_API_CACHE_KEY, type PaymentCallbacks, type PaymentStatusCallbacks, addressFormInitialValues, addressValidationSchema, applyCheckoutCoupon, buildAddressPayload, buildSubmitPayload, calculateCartTotals, checkPhonepeReturnStatus, checkPhonepeReturnStatusWithOrder, checkStripeReturnStatus, checkTabbyReturnStatus, clearAddressFormSession, decodeAddress, encodeAddress, fetchAppliedCoupon, fetchAvailableCoupons, handleCODPayment, handlePhonepePayment, handleRazorpayFail, handleRazorpaySuccess, handleStripePayment, handleStripeSuccess, handleTabbyPayment, isValidPhoneNumber, loadAddressFormFromSession, openRazorpayCheckout, parseEditAddress, processPayment, removeCheckoutCoupon, sanitizePhoneNumber, saveAddressFormToSession };
|
package/dist/checkout/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Yup from 'yup';
|
|
2
|
-
import { C as Cart, c as Coupon } from '../cart-
|
|
2
|
+
import { C as Cart, c as Coupon } from '../cart-DOy6dICN.js';
|
|
3
3
|
import { O as Order } from '../orders-CvCa7XWm.js';
|
|
4
4
|
import '../product-Daxj09p9.js';
|
|
5
5
|
import 'react-toastify';
|
|
@@ -21,6 +21,11 @@ interface AddressFormValues {
|
|
|
21
21
|
customer_email: string;
|
|
22
22
|
}
|
|
23
23
|
declare const addressFormInitialValues: AddressFormValues;
|
|
24
|
+
/**
|
|
25
|
+
* Strip country calling code prefix and trim whitespace from a phone number.
|
|
26
|
+
* E.g. "+919876543210" with countryCode "IN" → "9876543210"
|
|
27
|
+
*/
|
|
28
|
+
declare function sanitizePhoneNumber(input: string, countryCode: string): string;
|
|
24
29
|
/**
|
|
25
30
|
* Validates a phone number using libphonenumber-js
|
|
26
31
|
*/
|
|
@@ -248,4 +253,4 @@ declare function checkStripeReturnStatus(sessionId: string, orderNumber: number,
|
|
|
248
253
|
*/
|
|
249
254
|
declare function checkTabbyReturnStatus(orderNumber: number, callbacks: PaymentStatusCallbacks): Promise<void>;
|
|
250
255
|
|
|
251
|
-
export { type AddressFormValues, type CartTotals, type CouponCallbacks, IP_API_CACHE_KEY, type PaymentCallbacks, type PaymentStatusCallbacks, addressFormInitialValues, addressValidationSchema, applyCheckoutCoupon, buildAddressPayload, buildSubmitPayload, calculateCartTotals, checkPhonepeReturnStatus, checkPhonepeReturnStatusWithOrder, checkStripeReturnStatus, checkTabbyReturnStatus, clearAddressFormSession, decodeAddress, encodeAddress, fetchAppliedCoupon, fetchAvailableCoupons, handleCODPayment, handlePhonepePayment, handleRazorpayFail, handleRazorpaySuccess, handleStripePayment, handleStripeSuccess, handleTabbyPayment, isValidPhoneNumber, loadAddressFormFromSession, openRazorpayCheckout, parseEditAddress, processPayment, removeCheckoutCoupon, saveAddressFormToSession };
|
|
256
|
+
export { type AddressFormValues, type CartTotals, type CouponCallbacks, IP_API_CACHE_KEY, type PaymentCallbacks, type PaymentStatusCallbacks, addressFormInitialValues, addressValidationSchema, applyCheckoutCoupon, buildAddressPayload, buildSubmitPayload, calculateCartTotals, checkPhonepeReturnStatus, checkPhonepeReturnStatusWithOrder, checkStripeReturnStatus, checkTabbyReturnStatus, clearAddressFormSession, decodeAddress, encodeAddress, fetchAppliedCoupon, fetchAvailableCoupons, handleCODPayment, handlePhonepePayment, handleRazorpayFail, handleRazorpaySuccess, handleStripePayment, handleStripeSuccess, handleTabbyPayment, isValidPhoneNumber, loadAddressFormFromSession, openRazorpayCheckout, parseEditAddress, processPayment, removeCheckoutCoupon, sanitizePhoneNumber, saveAddressFormToSession };
|
package/dist/checkout/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { applyCheckoutCoupon, fetchAppliedCoupon, fetchAvailableCoupons, handleCODPayment, handlePhonepePayment, handleRazorpayFail, handleRazorpaySuccess, handleStripePayment, handleStripeSuccess, handleTabbyPayment, openRazorpayCheckout, processPayment, removeCheckoutCoupon } from '../chunk-27MTKBJL.js';
|
|
2
2
|
import { checkPhonepePaymentStatus, getOrderDetailsByNumber, getStripePaymentStatusPublic, getStripePaymentStatus, verifyTabbyPayment } from '../chunk-VWFZZFZL.js';
|
|
3
3
|
import { pixelEvents } from '../chunk-WFDKKOO7.js';
|
|
4
|
-
export { IP_API_CACHE_KEY, addressFormInitialValues, addressValidationSchema, buildAddressPayload, buildSubmitPayload, clearAddressFormSession, decodeAddress, encodeAddress, isValidPhoneNumber, loadAddressFormFromSession, parseEditAddress, saveAddressFormToSession } from '../chunk-
|
|
4
|
+
export { IP_API_CACHE_KEY, addressFormInitialValues, addressValidationSchema, buildAddressPayload, buildSubmitPayload, clearAddressFormSession, decodeAddress, encodeAddress, isValidPhoneNumber, loadAddressFormFromSession, parseEditAddress, sanitizePhoneNumber, saveAddressFormToSession } from '../chunk-ELP23UGF.js';
|
|
5
5
|
import '../chunk-3SYYP3XV.js';
|
|
6
6
|
import '../chunk-WEMNXIRS.js';
|
|
7
7
|
import '../chunk-BQ256JKN.js';
|
|
@@ -15,10 +15,30 @@ var addressFormInitialValues = {
|
|
|
15
15
|
city: "",
|
|
16
16
|
customer_email: ""
|
|
17
17
|
};
|
|
18
|
+
function sanitizePhoneNumber(input, countryCode) {
|
|
19
|
+
let cleaned = input.trim().replace(/\s+/g, "");
|
|
20
|
+
try {
|
|
21
|
+
const callingCode = getCountryCallingCode(countryCode);
|
|
22
|
+
const prefix = `+${callingCode}`;
|
|
23
|
+
if (cleaned.startsWith(prefix)) {
|
|
24
|
+
cleaned = cleaned.slice(prefix.length);
|
|
25
|
+
} else if (cleaned.startsWith(callingCode)) {
|
|
26
|
+
cleaned = cleaned.slice(callingCode.length);
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
if (cleaned.startsWith("+")) {
|
|
30
|
+
cleaned = cleaned.replace(/^\+\d{1,4}/, "");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
cleaned = cleaned.replace(/^0+/, "");
|
|
34
|
+
return cleaned;
|
|
35
|
+
}
|
|
18
36
|
function isValidPhoneNumber(input, countryCode) {
|
|
19
37
|
if (!input) return false;
|
|
20
38
|
const phone = parsePhoneNumberFromString(input, countryCode);
|
|
21
|
-
|
|
39
|
+
if (!phone?.isValid()) return false;
|
|
40
|
+
if (phone.country && phone.country !== countryCode) return false;
|
|
41
|
+
return true;
|
|
22
42
|
}
|
|
23
43
|
var addressValidationSchema = Yup.object({
|
|
24
44
|
customer_phone: Yup.string().required("Phone number required").test("is-valid", "Please enter a valid number", function(value) {
|
|
@@ -109,8 +129,13 @@ function buildSubmitPayload(values, country, states) {
|
|
|
109
129
|
customerCountryCode = values.customer_country_code;
|
|
110
130
|
}
|
|
111
131
|
}
|
|
132
|
+
const cleanPhone = sanitizePhoneNumber(
|
|
133
|
+
values.customer_phone,
|
|
134
|
+
values.customer_country_code
|
|
135
|
+
);
|
|
112
136
|
return {
|
|
113
137
|
...formValues,
|
|
138
|
+
customer_phone: cleanPhone,
|
|
114
139
|
country: country?.name || "india",
|
|
115
140
|
country_obj: country?.id || 105,
|
|
116
141
|
customer_country_code: customerCountryCode,
|
|
@@ -118,4 +143,4 @@ function buildSubmitPayload(values, country, states) {
|
|
|
118
143
|
};
|
|
119
144
|
}
|
|
120
145
|
|
|
121
|
-
export { IP_API_CACHE_KEY, addressFormInitialValues, addressValidationSchema, buildAddressPayload, buildSubmitPayload, clearAddressFormSession, decodeAddress, encodeAddress, isValidPhoneNumber, loadAddressFormFromSession, parseEditAddress, saveAddressFormToSession };
|
|
146
|
+
export { IP_API_CACHE_KEY, addressFormInitialValues, addressValidationSchema, buildAddressPayload, buildSubmitPayload, clearAddressFormSession, decodeAddress, encodeAddress, isValidPhoneNumber, loadAddressFormFromSession, parseEditAddress, sanitizePhoneNumber, saveAddressFormToSession };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { updateAddress, addAddress, getCountries, getSubdivisions } from './chunk-ZGMLOLTC.js';
|
|
2
2
|
import { getCache, getAddressMeta } from './chunk-YUPBTD4M.js';
|
|
3
|
-
import { addressFormInitialValues, IP_API_CACHE_KEY, addressValidationSchema, buildSubmitPayload } from './chunk-
|
|
3
|
+
import { addressFormInitialValues, IP_API_CACHE_KEY, addressValidationSchema, buildSubmitPayload } from './chunk-ELP23UGF.js';
|
|
4
4
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
5
5
|
import { useFormik } from 'formik';
|
|
6
6
|
import { isSupportedCountry, getCountryCallingCode } from 'libphonenumber-js';
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkRDUT4W3B_cjs = require('./chunk-RDUT4W3B.cjs');
|
|
4
4
|
var chunk4CVKE6CC_cjs = require('./chunk-4CVKE6CC.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkTB72NPRM_cjs = require('./chunk-TB72NPRM.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var formik = require('formik');
|
|
8
8
|
var libphonenumberJs = require('libphonenumber-js');
|
|
9
9
|
|
|
10
10
|
var defaultInitialValues = {
|
|
11
|
-
...
|
|
11
|
+
...chunkTB72NPRM_cjs.addressFormInitialValues,
|
|
12
12
|
is_default: false,
|
|
13
13
|
country_obj: "IN"
|
|
14
14
|
};
|
|
@@ -17,7 +17,7 @@ function useAddressForm(options = {}) {
|
|
|
17
17
|
address,
|
|
18
18
|
onSuccess,
|
|
19
19
|
onError,
|
|
20
|
-
locationCacheKey =
|
|
20
|
+
locationCacheKey = chunkTB72NPRM_cjs.IP_API_CACHE_KEY,
|
|
21
21
|
defaultCountryId = 105
|
|
22
22
|
} = options;
|
|
23
23
|
const isEditing = !!address;
|
|
@@ -28,11 +28,11 @@ function useAddressForm(options = {}) {
|
|
|
28
28
|
const [isSubmitting, setIsSubmitting] = react.useState(false);
|
|
29
29
|
const formik$1 = formik.useFormik({
|
|
30
30
|
initialValues: defaultInitialValues,
|
|
31
|
-
validationSchema:
|
|
31
|
+
validationSchema: chunkTB72NPRM_cjs.addressValidationSchema,
|
|
32
32
|
onSubmit: async (values) => {
|
|
33
33
|
try {
|
|
34
34
|
setIsSubmitting(true);
|
|
35
|
-
const payload =
|
|
35
|
+
const payload = chunkTB72NPRM_cjs.buildSubmitPayload(values, selectedCountry, states);
|
|
36
36
|
let response;
|
|
37
37
|
if (isEditing) {
|
|
38
38
|
response = await chunkRDUT4W3B_cjs.updateAddress({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkY2CPMT34_cjs = require('./chunk-Y2CPMT34.cjs');
|
|
4
4
|
var chunkSMHJRNCR_cjs = require('./chunk-SMHJRNCR.cjs');
|
|
5
5
|
var chunkBBRXE57K_cjs = require('./chunk-BBRXE57K.cjs');
|
|
6
6
|
var chunkNE3ZHELZ_cjs = require('./chunk-NE3ZHELZ.cjs');
|
|
@@ -22,7 +22,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
22
22
|
syncCart: async (addressId) => {
|
|
23
23
|
set({ status: "loading" /* LOADING */ });
|
|
24
24
|
try {
|
|
25
|
-
const response = await
|
|
25
|
+
const response = await chunkY2CPMT34_cjs.getCart("/customer/cart/", addressId);
|
|
26
26
|
if (response) {
|
|
27
27
|
set({ cart: response, status: "idle" /* IDLE */ });
|
|
28
28
|
}
|
|
@@ -33,7 +33,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
33
33
|
fetchCart: async (addressId) => {
|
|
34
34
|
set({ status: "loading" /* LOADING */ });
|
|
35
35
|
try {
|
|
36
|
-
const response = await
|
|
36
|
+
const response = await chunkY2CPMT34_cjs.getCart("/customer/cart/", addressId);
|
|
37
37
|
if (response) {
|
|
38
38
|
set({ cart: response, status: "idle" /* IDLE */ });
|
|
39
39
|
}
|
|
@@ -45,7 +45,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
45
45
|
set({ status: "loading" /* LOADING */ });
|
|
46
46
|
try {
|
|
47
47
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
48
|
-
await
|
|
48
|
+
await chunkY2CPMT34_cjs.addToCart(items, customizationInputs);
|
|
49
49
|
await useCartStore.getState().syncCart(addressId);
|
|
50
50
|
} else {
|
|
51
51
|
const cart = chunkSMHJRNCR_cjs.cart_default.get();
|
|
@@ -71,7 +71,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
71
71
|
set({ status: "loading" /* LOADING */ });
|
|
72
72
|
try {
|
|
73
73
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
74
|
-
await
|
|
74
|
+
await chunkY2CPMT34_cjs.removeFromCart(items);
|
|
75
75
|
await useCartStore.getState().syncCart(addressId);
|
|
76
76
|
} else {
|
|
77
77
|
const cart = chunkSMHJRNCR_cjs.cart_default.get();
|
|
@@ -99,7 +99,7 @@ var useCartStore = zustand.create((set) => ({
|
|
|
99
99
|
set({ status: "loading" /* LOADING */ });
|
|
100
100
|
try {
|
|
101
101
|
if (chunkBBRXE57K_cjs.auth_default.getUserDetails()) {
|
|
102
|
-
await
|
|
102
|
+
await chunkY2CPMT34_cjs.updateCart(items);
|
|
103
103
|
await useCartStore.getState().syncCart(addressId);
|
|
104
104
|
} else {
|
|
105
105
|
const cart = chunkSMHJRNCR_cjs.cart_default.get();
|
|
@@ -37,10 +37,30 @@ var addressFormInitialValues = {
|
|
|
37
37
|
city: "",
|
|
38
38
|
customer_email: ""
|
|
39
39
|
};
|
|
40
|
+
function sanitizePhoneNumber(input, countryCode) {
|
|
41
|
+
let cleaned = input.trim().replace(/\s+/g, "");
|
|
42
|
+
try {
|
|
43
|
+
const callingCode = libphonenumberJs.getCountryCallingCode(countryCode);
|
|
44
|
+
const prefix = `+${callingCode}`;
|
|
45
|
+
if (cleaned.startsWith(prefix)) {
|
|
46
|
+
cleaned = cleaned.slice(prefix.length);
|
|
47
|
+
} else if (cleaned.startsWith(callingCode)) {
|
|
48
|
+
cleaned = cleaned.slice(callingCode.length);
|
|
49
|
+
}
|
|
50
|
+
} catch {
|
|
51
|
+
if (cleaned.startsWith("+")) {
|
|
52
|
+
cleaned = cleaned.replace(/^\+\d{1,4}/, "");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
cleaned = cleaned.replace(/^0+/, "");
|
|
56
|
+
return cleaned;
|
|
57
|
+
}
|
|
40
58
|
function isValidPhoneNumber(input, countryCode) {
|
|
41
59
|
if (!input) return false;
|
|
42
60
|
const phone = libphonenumberJs.parsePhoneNumberFromString(input, countryCode);
|
|
43
|
-
|
|
61
|
+
if (!phone?.isValid()) return false;
|
|
62
|
+
if (phone.country && phone.country !== countryCode) return false;
|
|
63
|
+
return true;
|
|
44
64
|
}
|
|
45
65
|
var addressValidationSchema = Yup__namespace.object({
|
|
46
66
|
customer_phone: Yup__namespace.string().required("Phone number required").test("is-valid", "Please enter a valid number", function(value) {
|
|
@@ -131,8 +151,13 @@ function buildSubmitPayload(values, country, states) {
|
|
|
131
151
|
customerCountryCode = values.customer_country_code;
|
|
132
152
|
}
|
|
133
153
|
}
|
|
154
|
+
const cleanPhone = sanitizePhoneNumber(
|
|
155
|
+
values.customer_phone,
|
|
156
|
+
values.customer_country_code
|
|
157
|
+
);
|
|
134
158
|
return {
|
|
135
159
|
...formValues,
|
|
160
|
+
customer_phone: cleanPhone,
|
|
136
161
|
country: country?.name || "india",
|
|
137
162
|
country_obj: country?.id || 105,
|
|
138
163
|
customer_country_code: customerCountryCode,
|
|
@@ -151,4 +176,5 @@ exports.encodeAddress = encodeAddress;
|
|
|
151
176
|
exports.isValidPhoneNumber = isValidPhoneNumber;
|
|
152
177
|
exports.loadAddressFormFromSession = loadAddressFormFromSession;
|
|
153
178
|
exports.parseEditAddress = parseEditAddress;
|
|
179
|
+
exports.sanitizePhoneNumber = sanitizePhoneNumber;
|
|
154
180
|
exports.saveAddressFormToSession = saveAddressFormToSession;
|
|
@@ -11,7 +11,8 @@ async function getCart(url, addressId) {
|
|
|
11
11
|
total_quantity: 0,
|
|
12
12
|
products_quantity: {},
|
|
13
13
|
cart_count: 0,
|
|
14
|
-
missing_items:
|
|
14
|
+
missing_items: {},
|
|
15
|
+
missing_cart_items: {},
|
|
15
16
|
customization_inputs: [],
|
|
16
17
|
total_coupon_discount: 0,
|
|
17
18
|
variant_discounts: {},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { updateCart, removeFromCart, addToCart, getCart } from './chunk-
|
|
1
|
+
import { updateCart, removeFromCart, addToCart, getCart } from './chunk-U25T7M6S.js';
|
|
2
2
|
import { cart_default } from './chunk-QAC72HKO.js';
|
|
3
3
|
import { auth_default } from './chunk-WEMNXIRS.js';
|
|
4
4
|
import { USER_CRED_TOKEN, USER_CREDENTIALS } from './chunk-BQ256JKN.js';
|
|
@@ -13,7 +13,8 @@ async function getCart(url, addressId) {
|
|
|
13
13
|
total_quantity: 0,
|
|
14
14
|
products_quantity: {},
|
|
15
15
|
cart_count: 0,
|
|
16
|
-
missing_items:
|
|
16
|
+
missing_items: {},
|
|
17
|
+
missing_cart_items: {},
|
|
17
18
|
customization_inputs: [],
|
|
18
19
|
total_coupon_discount: 0,
|
|
19
20
|
variant_discounts: {},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkBBRB475I_cjs = require('../chunk-BBRB475I.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkJCOOINQF_cjs = require('../chunk-JCOOINQF.cjs');
|
|
5
5
|
require('../chunk-RDUT4W3B.cjs');
|
|
6
6
|
var chunk4CVKE6CC_cjs = require('../chunk-4CVKE6CC.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-TB72NPRM.cjs');
|
|
8
8
|
require('../chunk-ECHV2JSY.cjs');
|
|
9
9
|
require('../chunk-BBRXE57K.cjs');
|
|
10
10
|
require('../chunk-NE3ZHELZ.cjs');
|
|
@@ -343,7 +343,7 @@ var AddressForm = react.forwardRef(
|
|
|
343
343
|
handlePhoneChange,
|
|
344
344
|
isSubmitting,
|
|
345
345
|
isEditing
|
|
346
|
-
} =
|
|
346
|
+
} = chunkJCOOINQF_cjs.useAddressForm({
|
|
347
347
|
address,
|
|
348
348
|
onSuccess,
|
|
349
349
|
onError,
|
package/dist/components/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { timeFromNow, isExpired } from '../chunk-HSF2D56O.js';
|
|
2
|
-
import { useAddressForm } from '../chunk-
|
|
2
|
+
import { useAddressForm } from '../chunk-ILVGYHNI.js';
|
|
3
3
|
import '../chunk-ZGMLOLTC.js';
|
|
4
4
|
import { shareLink, convertToCurrency } from '../chunk-YUPBTD4M.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-ELP23UGF.js';
|
|
6
6
|
import '../chunk-3SYYP3XV.js';
|
|
7
7
|
import '../chunk-WEMNXIRS.js';
|
|
8
8
|
import '../chunk-BQ256JKN.js';
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkY46EHRJQ_cjs = require('../chunk-Y46EHRJQ.cjs');
|
|
4
4
|
var chunk2AHH3XBW_cjs = require('../chunk-2AHH3XBW.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkNKJ4DF4D_cjs = require('../chunk-NKJ4DF4D.cjs');
|
|
6
|
+
var chunkY2CPMT34_cjs = require('../chunk-Y2CPMT34.cjs');
|
|
7
7
|
var chunkSMHJRNCR_cjs = require('../chunk-SMHJRNCR.cjs');
|
|
8
8
|
var chunk65Z7I5UP_cjs = require('../chunk-65Z7I5UP.cjs');
|
|
9
9
|
var chunkCV6DWPYF_cjs = require('../chunk-CV6DWPYF.cjs');
|
|
10
10
|
require('../chunk-K44JZ5NL.cjs');
|
|
11
|
-
var
|
|
11
|
+
var chunkJCOOINQF_cjs = require('../chunk-JCOOINQF.cjs');
|
|
12
12
|
var chunkRDUT4W3B_cjs = require('../chunk-RDUT4W3B.cjs');
|
|
13
13
|
var chunk4CVKE6CC_cjs = require('../chunk-4CVKE6CC.cjs');
|
|
14
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-TB72NPRM.cjs');
|
|
15
15
|
require('../chunk-ECHV2JSY.cjs');
|
|
16
16
|
require('../chunk-BBRXE57K.cjs');
|
|
17
17
|
require('../chunk-NE3ZHELZ.cjs');
|
|
@@ -53,7 +53,7 @@ var useCart = (addressId) => {
|
|
|
53
53
|
async (addrId) => {
|
|
54
54
|
try {
|
|
55
55
|
setIsLoading(true);
|
|
56
|
-
const result = await
|
|
56
|
+
const result = await chunkY2CPMT34_cjs.getCart("/customer/cart/", addrId ?? addressId);
|
|
57
57
|
setData(result);
|
|
58
58
|
setError(null);
|
|
59
59
|
} catch (err) {
|
|
@@ -125,7 +125,7 @@ function useGetProducts(initialFilter, options) {
|
|
|
125
125
|
apiParams[key] = value;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
const result = await
|
|
128
|
+
const result = await chunkY2CPMT34_cjs.getProductList(endpoint, apiParams);
|
|
129
129
|
setData(result);
|
|
130
130
|
if (modeRef.current === "append" && isLoadMoreRef.current) {
|
|
131
131
|
setProducts((prev) => [...prev, ...result.results || []]);
|
|
@@ -193,7 +193,7 @@ var useGetProductDetails = (slug) => {
|
|
|
193
193
|
const fetchData = react.useCallback(async () => {
|
|
194
194
|
try {
|
|
195
195
|
setIsLoading(true);
|
|
196
|
-
const result = await
|
|
196
|
+
const result = await chunkY2CPMT34_cjs.getProductDetail("/inventory/products/", slug);
|
|
197
197
|
setData(result);
|
|
198
198
|
} catch (err) {
|
|
199
199
|
} finally {
|
|
@@ -216,7 +216,7 @@ var useGetProductCategories = () => {
|
|
|
216
216
|
const fetchData = async () => {
|
|
217
217
|
try {
|
|
218
218
|
setIsLoading(true);
|
|
219
|
-
const result = await
|
|
219
|
+
const result = await chunkY2CPMT34_cjs.getProductCategories("/store/categories");
|
|
220
220
|
setData(result || []);
|
|
221
221
|
} catch (err) {
|
|
222
222
|
setError(err);
|
|
@@ -261,7 +261,7 @@ var useWishlist = () => {
|
|
|
261
261
|
const fetchData = react.useCallback(async () => {
|
|
262
262
|
try {
|
|
263
263
|
setIsLoading(true);
|
|
264
|
-
const response = await
|
|
264
|
+
const response = await chunkY2CPMT34_cjs.getWishlist("/customer/wishlist/");
|
|
265
265
|
if (response.data) setData(response.data);
|
|
266
266
|
setError(null);
|
|
267
267
|
} catch (err) {
|
|
@@ -319,7 +319,7 @@ function useCheckoutPayment(options) {
|
|
|
319
319
|
const [isConfirmingPayment, setIsConfirmingPayment] = react.useState(false);
|
|
320
320
|
const [showSuccessModal, setShowSuccessModal] = react.useState(false);
|
|
321
321
|
const [showFailureModal, setShowFailureModal] = react.useState(false);
|
|
322
|
-
const resetCartCount =
|
|
322
|
+
const resetCartCount = chunkNKJ4DF4D_cjs.useCartStore((s) => s.resetCartCount);
|
|
323
323
|
const callbacks = {
|
|
324
324
|
onSuccess: (order) => {
|
|
325
325
|
setOrderSummary(order);
|
|
@@ -505,8 +505,8 @@ function useVariantSelector(options) {
|
|
|
505
505
|
}
|
|
506
506
|
function useShopCheckout(options) {
|
|
507
507
|
const { product, onNavigateToCart, onToast } = options;
|
|
508
|
-
const { addToCart, setCart } =
|
|
509
|
-
const isUserAuthenticated =
|
|
508
|
+
const { addToCart, setCart } = chunkNKJ4DF4D_cjs.useCartStore();
|
|
509
|
+
const isUserAuthenticated = chunkNKJ4DF4D_cjs.useAuthStore((s) => s.isAuthenticated);
|
|
510
510
|
const [isWishlisted, setIsWishlisted] = react.useState(product.is_wishlisted);
|
|
511
511
|
const [isAddedToCart, setIsAddedToCart] = react.useState(false);
|
|
512
512
|
const [loading, setLoading] = react.useState(false);
|
|
@@ -517,7 +517,7 @@ function useShopCheckout(options) {
|
|
|
517
517
|
react.useEffect(() => {
|
|
518
518
|
const fetchCategories = async () => {
|
|
519
519
|
try {
|
|
520
|
-
const response = await
|
|
520
|
+
const response = await chunkY2CPMT34_cjs.getCategories();
|
|
521
521
|
setCategories(response.data);
|
|
522
522
|
} catch (error) {
|
|
523
523
|
console.log(error);
|
|
@@ -631,7 +631,7 @@ function useShopCheckout(options) {
|
|
|
631
631
|
const handleNotifyMeFormSubmit = react.useCallback(
|
|
632
632
|
async (values) => {
|
|
633
633
|
try {
|
|
634
|
-
const response = await
|
|
634
|
+
const response = await chunkY2CPMT34_cjs.notifyProductStock({
|
|
635
635
|
...values,
|
|
636
636
|
variant_slug: product.slug
|
|
637
637
|
});
|
|
@@ -766,7 +766,7 @@ function useCoupon(options = {}) {
|
|
|
766
766
|
|
|
767
767
|
Object.defineProperty(exports, "useAddressForm", {
|
|
768
768
|
enumerable: true,
|
|
769
|
-
get: function () { return
|
|
769
|
+
get: function () { return chunkJCOOINQF_cjs.useAddressForm; }
|
|
770
770
|
});
|
|
771
771
|
exports.useAddress = useAddress;
|
|
772
772
|
exports.useCart = useCart;
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as Address } from '../address-DwBZHzbI.cjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-
|
|
3
|
+
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-B13IUuwP.cjs';
|
|
4
4
|
import { O as Order } from '../orders-Dm5Dq02y.cjs';
|
|
5
5
|
import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-Daxj09p9.cjs';
|
|
6
6
|
import { W as Wishlist } from '../wishlist-Cow1wVqf.cjs';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as Address } from '../address-DwBZHzbI.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-
|
|
3
|
+
import { C as Cart, b as Category, U as User, c as Coupon } from '../cart-DOy6dICN.js';
|
|
4
4
|
import { O as Order } from '../orders-CvCa7XWm.js';
|
|
5
5
|
import { d as Product, f as ProductDetail, e as ProductAttribute, A as Attributes } from '../product-Daxj09p9.js';
|
|
6
6
|
import { W as Wishlist } from '../wishlist-gamNg0T1.js';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { getUserDetails } from '../chunk-WYXT5AAG.js';
|
|
2
2
|
import { findMatchingVariant, findSimilarVariant, isVariantCombinationAvailable, isColorVariantType } from '../chunk-HEFA67WK.js';
|
|
3
|
-
import { useCartStore, useAuthStore } from '../chunk-
|
|
4
|
-
import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-
|
|
3
|
+
import { useCartStore, useAuthStore } from '../chunk-VJCAOV74.js';
|
|
4
|
+
import { getCart, getProductList, getProductDetail, getWishlist, notifyProductStock, getProductCategories, getCategories } from '../chunk-U25T7M6S.js';
|
|
5
5
|
import { cart_default } from '../chunk-QAC72HKO.js';
|
|
6
6
|
import { processPayment, fetchAvailableCoupons, applyCheckoutCoupon, removeCheckoutCoupon } from '../chunk-27MTKBJL.js';
|
|
7
7
|
import { getOrders, placeOrder, applyCoupon, removeCoupon, getCoupons, getAppliedCoupon } from '../chunk-VWFZZFZL.js';
|
|
8
8
|
import '../chunk-WFDKKOO7.js';
|
|
9
|
-
export { useAddressForm } from '../chunk-
|
|
9
|
+
export { useAddressForm } from '../chunk-ILVGYHNI.js';
|
|
10
10
|
import { getAddresses } from '../chunk-ZGMLOLTC.js';
|
|
11
11
|
import { shareLink, convertToCurrency } from '../chunk-YUPBTD4M.js';
|
|
12
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-ELP23UGF.js';
|
|
13
13
|
import '../chunk-3SYYP3XV.js';
|
|
14
14
|
import '../chunk-WEMNXIRS.js';
|
|
15
15
|
import '../chunk-BQ256JKN.js';
|
package/dist/models/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { A as Address } from '../address-DwBZHzbI.cjs';
|
|
2
2
|
export { A as Analytics, B as Booking, a as BookingDetails, R as Review } from '../booking-BGvxHd-t.cjs';
|
|
3
|
-
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, U as User, V as ValueType } from '../cart-
|
|
3
|
+
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, U as User, V as ValueType } from '../cart-B13IUuwP.cjs';
|
|
4
4
|
export { A as CollectionAttributes, C as CollectionResponse, s as singleCollection } from '../collections-dCr3VEJo.cjs';
|
|
5
5
|
export { O as Order } from '../orders-Dm5Dq02y.cjs';
|
|
6
6
|
export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-dWMLZel6.cjs';
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { A as Address } from '../address-DwBZHzbI.js';
|
|
2
2
|
export { A as Analytics, B as Booking, a as BookingDetails, R as Review } from '../booking-BSZ6NP-e.js';
|
|
3
|
-
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, U as User, V as ValueType } from '../cart-
|
|
3
|
+
export { A as ApplicableTarget, C as Cart, a as CartState, b as Category, c as Coupon, d as CouponResponse, e as CouponStatus, f as Coupons, D as DiscountType, U as User, V as ValueType } from '../cart-DOy6dICN.js';
|
|
4
4
|
export { A as CollectionAttributes, C as CollectionResponse, s as singleCollection } from '../collections-D4tvWcZp.js';
|
|
5
5
|
export { O as Order } from '../orders-CvCa7XWm.js';
|
|
6
6
|
export { D as Data, P as PaymentInstrument, a as PhonePe } from '../phonepe-dWMLZel6.js';
|
package/dist/store/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkNKJ4DF4D_cjs = require('../chunk-NKJ4DF4D.cjs');
|
|
4
|
+
var chunkY2CPMT34_cjs = require('../chunk-Y2CPMT34.cjs');
|
|
5
5
|
require('../chunk-SMHJRNCR.cjs');
|
|
6
6
|
require('../chunk-ECHV2JSY.cjs');
|
|
7
7
|
require('../chunk-BBRXE57K.cjs');
|
|
@@ -19,7 +19,7 @@ var useWishlistStore = zustand.create((set) => ({
|
|
|
19
19
|
resetWishlist: () => set(initialState),
|
|
20
20
|
syncWishlist: async () => {
|
|
21
21
|
try {
|
|
22
|
-
const response = await
|
|
22
|
+
const response = await chunkY2CPMT34_cjs.getWishlist("/customer/wishlist/");
|
|
23
23
|
if (response.data) {
|
|
24
24
|
set({
|
|
25
25
|
wishlist_count: response.data.wishlist_count,
|
|
@@ -47,7 +47,7 @@ var useProductStore = zustand.create((set, get) => ({
|
|
|
47
47
|
data: filter.page === 1 ? [] : state.data
|
|
48
48
|
}));
|
|
49
49
|
try {
|
|
50
|
-
const response = await
|
|
50
|
+
const response = await chunkY2CPMT34_cjs.getProducts({ ...filter });
|
|
51
51
|
if (response.data) {
|
|
52
52
|
const { results, ...meta } = response.data;
|
|
53
53
|
set((state) => ({
|
|
@@ -67,15 +67,15 @@ var useProductStore = zustand.create((set, get) => ({
|
|
|
67
67
|
|
|
68
68
|
Object.defineProperty(exports, "loginUser", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkNKJ4DF4D_cjs.loginUser; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "useAuthStore", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkNKJ4DF4D_cjs.useAuthStore; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "useCartStore", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkNKJ4DF4D_cjs.useCartStore; }
|
|
79
79
|
});
|
|
80
80
|
exports.useProductStore = useProductStore;
|
|
81
81
|
exports.useWishlistStore = useWishlistStore;
|
package/dist/store/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as zustand from 'zustand';
|
|
2
|
-
import { a as CartState, C as Cart, U as User } from '../cart-
|
|
2
|
+
import { a as CartState, C as Cart, U as User } from '../cart-B13IUuwP.cjs';
|
|
3
3
|
import { W as Wishlist } from '../wishlist-Cow1wVqf.cjs';
|
|
4
4
|
import { d as Product } from '../product-Daxj09p9.cjs';
|
|
5
5
|
import 'react-toastify';
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as zustand from 'zustand';
|
|
2
|
-
import { a as CartState, C as Cart, U as User } from '../cart-
|
|
2
|
+
import { a as CartState, C as Cart, U as User } from '../cart-DOy6dICN.js';
|
|
3
3
|
import { W as Wishlist } from '../wishlist-gamNg0T1.js';
|
|
4
4
|
import { d as Product } from '../product-Daxj09p9.js';
|
|
5
5
|
import 'react-toastify';
|
package/dist/store/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { loginUser, useAuthStore, useCartStore } from '../chunk-
|
|
2
|
-
import { getWishlist, getProducts } from '../chunk-
|
|
1
|
+
export { loginUser, useAuthStore, useCartStore } from '../chunk-VJCAOV74.js';
|
|
2
|
+
import { getWishlist, getProducts } from '../chunk-U25T7M6S.js';
|
|
3
3
|
import '../chunk-QAC72HKO.js';
|
|
4
4
|
import '../chunk-3SYYP3XV.js';
|
|
5
5
|
import '../chunk-WEMNXIRS.js';
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as ProductDetail, d as Product, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-Daxj09p9.cjs';
|
|
2
2
|
export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-Daxj09p9.cjs';
|
|
3
|
-
import { C as Cart, b as Category$1 } from '../cart-
|
|
3
|
+
import { C as Cart, b as Category$1 } from '../cart-B13IUuwP.cjs';
|
|
4
4
|
export { S as SnapstoreConfig, g as getApiEndpoint, a as getCloudFront, b as getConfig, c as getPhonePeApiEndpoint, d as getPublicApiEndpoint, e as getSecretKey, f as getStoreId, i as initConfig } from '../index-DTyIuLuI.cjs';
|
|
5
5
|
import { C as CollectionResponse } from '../collections-dCr3VEJo.cjs';
|
|
6
6
|
import { AxiosResponse } from 'axios';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as ProductDetail, d as Product, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-Daxj09p9.js';
|
|
2
2
|
export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-Daxj09p9.js';
|
|
3
|
-
import { C as Cart, b as Category$1 } from '../cart-
|
|
3
|
+
import { C as Cart, b as Category$1 } from '../cart-DOy6dICN.js';
|
|
4
4
|
export { S as SnapstoreConfig, g as getApiEndpoint, a as getCloudFront, b as getConfig, c as getPhonePeApiEndpoint, d as getPublicApiEndpoint, e as getSecretKey, f as getStoreId, i as initConfig } from '../index-DTyIuLuI.js';
|
|
5
5
|
import { C as CollectionResponse } from '../collections-D4tvWcZp.js';
|
|
6
6
|
import { AxiosResponse } from 'axios';
|