@storepecker/storefront-core 2.3.6 → 2.4.0

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/api/index.cjs +28 -24
  2. package/dist/api/index.d.cts +8 -5
  3. package/dist/api/index.d.ts +8 -5
  4. package/dist/api/index.js +1 -1
  5. package/dist/{booking-CG6tul9l.d.ts → booking-BVWe8HHh.d.ts} +1 -1
  6. package/dist/{booking-DNVf5ZAS.d.cts → booking-DX9SU_qm.d.cts} +1 -1
  7. package/dist/cart-kJoawc_Z.d.cts +126 -0
  8. package/dist/cart-y-7RPmnQ.d.ts +126 -0
  9. package/dist/checkout/index.cjs +22 -22
  10. package/dist/checkout/index.d.cts +3 -1
  11. package/dist/checkout/index.d.ts +3 -1
  12. package/dist/checkout/index.js +2 -2
  13. package/dist/{chunk-BTT3XQ32.cjs → chunk-33TWVRZE.cjs} +6 -6
  14. package/dist/chunk-3YRSHPM6.cjs +34 -0
  15. package/dist/{chunk-ILVGYHNI.js → chunk-6Q7QMPOQ.js} +2 -1
  16. package/dist/{chunk-HTFVROIV.cjs → chunk-7UK3E7SL.cjs} +6 -0
  17. package/dist/chunk-B3BXKMQA.cjs +271 -0
  18. package/dist/chunk-BTR3HLL4.js +14 -0
  19. package/dist/chunk-EGFOTJPC.js +22 -0
  20. package/dist/{chunk-YUPBTD4M.js → chunk-F45S7UWC.js} +1 -139
  21. package/dist/chunk-HAQWCNDY.cjs +24 -0
  22. package/dist/{chunk-Y4NGR42Z.js → chunk-HUIT4JCR.js} +1 -1
  23. package/dist/{chunk-TF2KMTB6.js → chunk-JRYWZMNT.js} +1 -1
  24. package/dist/{chunk-JCOOINQF.cjs → chunk-KLNKIQQM.cjs} +4 -3
  25. package/dist/chunk-L43KF3AC.js +269 -0
  26. package/dist/chunk-LHF5BSWO.cjs +16 -0
  27. package/dist/chunk-LJUGNSQQ.cjs +149 -0
  28. package/dist/chunk-NA5GT4D3.js +75 -0
  29. package/dist/chunk-OSM73ETC.js +139 -0
  30. package/dist/{chunk-4CVKE6CC.cjs → chunk-OTMTHA5C.cjs} +0 -147
  31. package/dist/{chunk-JH4JJBXE.cjs → chunk-TTIQRDHX.cjs} +2 -2
  32. package/dist/chunk-U7EXLQCT.js +32 -0
  33. package/dist/{chunk-LW3V53WJ.js → chunk-UVU7H4E6.js} +6 -1
  34. package/dist/chunk-V447PVRV.cjs +308 -0
  35. package/dist/chunk-VWQR3A7V.cjs +81 -0
  36. package/dist/chunk-YK4M3SFP.js +301 -0
  37. package/dist/{collections-Bz9KD7Na.d.cts → collections-BDSVfRNo.d.ts} +1 -1
  38. package/dist/{collections-CkEUi3BR.d.ts → collections-WzvTO0OQ.d.cts} +1 -1
  39. package/dist/components/address-form.cjs +17 -0
  40. package/dist/components/address-form.css +329 -0
  41. package/dist/components/address-form.d.cts +33 -0
  42. package/dist/components/address-form.d.ts +33 -0
  43. package/dist/components/address-form.js +11 -0
  44. package/dist/components/digital-product-download-modal.cjs +8 -0
  45. package/dist/components/digital-product-download-modal.d.cts +15 -0
  46. package/dist/components/digital-product-download-modal.d.ts +15 -0
  47. package/dist/components/digital-product-download-modal.js +2 -0
  48. package/dist/components/index.cjs +35 -695
  49. package/dist/components/index.d.cts +14 -87
  50. package/dist/components/index.d.ts +14 -87
  51. package/dist/components/index.js +11 -688
  52. package/dist/components/search-dropdown.cjs +7 -0
  53. package/dist/components/search-dropdown.css +200 -0
  54. package/dist/components/search-dropdown.d.cts +28 -0
  55. package/dist/components/search-dropdown.d.ts +28 -0
  56. package/dist/components/search-dropdown.js +1 -0
  57. package/dist/components/share-button.cjs +9 -0
  58. package/dist/components/share-button.d.cts +11 -0
  59. package/dist/components/share-button.d.ts +11 -0
  60. package/dist/components/share-button.js +3 -0
  61. package/dist/components/share-icon.cjs +7 -0
  62. package/dist/components/share-icon.d.cts +9 -0
  63. package/dist/components/share-icon.d.ts +9 -0
  64. package/dist/components/share-icon.js +1 -0
  65. package/dist/components/theme-data-initializer.cjs +8 -0
  66. package/dist/components/theme-data-initializer.d.cts +12 -0
  67. package/dist/components/theme-data-initializer.d.ts +12 -0
  68. package/dist/components/theme-data-initializer.js +2 -0
  69. package/dist/hooks/index.cjs +18 -17
  70. package/dist/hooks/index.d.cts +4 -2
  71. package/dist/hooks/index.d.ts +4 -2
  72. package/dist/hooks/index.js +6 -5
  73. package/dist/models/index.d.cts +6 -4
  74. package/dist/models/index.d.ts +6 -4
  75. package/dist/orders-CjNmCY5I.d.cts +144 -0
  76. package/dist/orders-L_8eIkUS.d.ts +144 -0
  77. package/dist/{pixelEvents-OVIkPw-J.d.ts → pixelEvents-Bo-VjAx8.d.ts} +4 -2
  78. package/dist/{pixelEvents-DYkiTkb2.d.cts → pixelEvents-C1rFPOwb.d.cts} +4 -2
  79. package/dist/{orders-fIdANHSl.d.ts → product-DJMdi4D4.d.cts} +1 -265
  80. package/dist/{orders-fIdANHSl.d.cts → product-DJMdi4D4.d.ts} +1 -265
  81. package/dist/store/index.cjs +5 -5
  82. package/dist/store/index.d.cts +6 -4
  83. package/dist/store/index.d.ts +6 -4
  84. package/dist/store/index.js +2 -2
  85. package/dist/utils/index.cjs +44 -43
  86. package/dist/utils/index.d.cts +7 -5
  87. package/dist/utils/index.d.ts +7 -5
  88. package/dist/utils/index.js +3 -2
  89. package/dist/{wishlist-stNzfvIP.d.cts → wishlist-CUuCTSVJ.d.cts} +1 -1
  90. package/dist/{wishlist-_bd4gLyQ.d.ts → wishlist-DKYFZR0s.d.ts} +1 -1
  91. package/package.json +49 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkXFOUNOKO_cjs = require('./chunk-XFOUNOKO.cjs');
4
4
  var chunkK44JZ5NL_cjs = require('./chunk-K44JZ5NL.cjs');
5
- var chunkHTFVROIV_cjs = require('./chunk-HTFVROIV.cjs');
5
+ var chunk7UK3E7SL_cjs = require('./chunk-7UK3E7SL.cjs');
6
6
  var chunkN3CTXRFT_cjs = require('./chunk-N3CTXRFT.cjs');
7
7
  var axios = require('axios');
8
8
 
@@ -66,7 +66,7 @@ function openRazorpayCheckout(order, callbacks) {
66
66
  async function handleRazorpaySuccess(data, order, callbacks) {
67
67
  try {
68
68
  callbacks.onPaymentStart?.();
69
- await chunkHTFVROIV_cjs.razorpayOrderSuccess(data);
69
+ await chunk7UK3E7SL_cjs.razorpayOrderSuccess(data);
70
70
  chunkK44JZ5NL_cjs.pixelEvents.purchase(order);
71
71
  chunkK44JZ5NL_cjs.pixelEvents.checkoutCompleted(order);
72
72
  callbacks.onCartReset();
@@ -79,7 +79,7 @@ async function handleRazorpaySuccess(data, order, callbacks) {
79
79
  }
80
80
  async function handleRazorpayFail(order, callbacks) {
81
81
  try {
82
- await chunkHTFVROIV_cjs.razorpayOrderFail({
82
+ await chunk7UK3E7SL_cjs.razorpayOrderFail({
83
83
  order_id: order.id,
84
84
  razorpay_order_id: order.razorpay_order_id
85
85
  });
@@ -111,9 +111,9 @@ async function handleCODPayment(order, callbacks, options) {
111
111
  callbacks.onPaymentStart?.();
112
112
  chunkK44JZ5NL_cjs.pixelEvents.initiateCheckout(order, "cod");
113
113
  if (options?.isPublic) {
114
- await chunkHTFVROIV_cjs.publicMakeCODOrder(order.order_number);
114
+ await chunk7UK3E7SL_cjs.publicMakeCODOrder(order.order_number);
115
115
  } else {
116
- await chunkHTFVROIV_cjs.makeCODOrder(order.id);
116
+ await chunk7UK3E7SL_cjs.makeCODOrder(order.id);
117
117
  }
118
118
  chunkK44JZ5NL_cjs.pixelEvents.purchase(order);
119
119
  chunkK44JZ5NL_cjs.pixelEvents.checkoutCompleted(order);
@@ -141,7 +141,7 @@ function handleStripePayment(order, callbacks) {
141
141
  async function handleStripeSuccess(order, paymentIntentId, callbacks) {
142
142
  try {
143
143
  callbacks.onPaymentStart?.();
144
- await chunkHTFVROIV_cjs.stripeOrderSuccess({
144
+ await chunk7UK3E7SL_cjs.stripeOrderSuccess({
145
145
  order_id: order.id,
146
146
  payment_intent_id: paymentIntentId
147
147
  });
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ // src/components/icons/share.tsx
6
+ function ShareIcon({
7
+ width = 20,
8
+ height = 23,
9
+ className
10
+ }) {
11
+ return /* @__PURE__ */ jsxRuntime.jsx(
12
+ "svg",
13
+ {
14
+ width,
15
+ height,
16
+ viewBox: "0 0 20 23",
17
+ fill: "none",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ className,
20
+ children: /* @__PURE__ */ jsxRuntime.jsx(
21
+ "path",
22
+ {
23
+ d: "M5.0745 10.357C4.82568 9.90934 4.43524 9.55692 3.96446 9.35513C3.49369 9.15333 2.96923 9.11357 2.47341 9.24209C1.97759 9.37061 1.53848 9.66013 1.22501 10.0652C0.911539 10.4703 0.741455 10.968 0.741455 11.4802C0.741455 11.9924 0.911539 12.4901 1.22501 12.8952C1.53848 13.3003 1.97759 13.5898 2.47341 13.7183C2.96923 13.8469 3.49369 13.8071 3.96446 13.6053C4.43524 13.4035 4.82568 13.0511 5.0745 12.6034M5.0745 10.357C5.25947 10.69 5.36531 11.0723 5.36531 11.4802C5.36531 11.8882 5.25947 12.2715 5.0745 12.6034M5.0745 10.357L14.9045 4.89641M5.0745 12.6034L14.9045 18.064M14.9045 4.89641C15.0486 5.16783 15.2454 5.4078 15.4833 5.60229C15.7213 5.79678 15.9956 5.94187 16.2903 6.0291C16.585 6.11633 16.8941 6.14393 17.1996 6.1103C17.5051 6.07667 17.8008 5.98247 18.0694 5.83323C18.338 5.68398 18.5742 5.48267 18.7642 5.24108C18.9541 4.99948 19.094 4.72244 19.1756 4.42616C19.2572 4.12988 19.279 3.8203 19.2395 3.51552C19.2001 3.21074 19.1003 2.91687 18.946 2.65111C18.6419 2.12739 18.1445 1.74388 17.5606 1.58304C16.9768 1.4222 16.3531 1.49685 15.8237 1.79096C15.2943 2.08507 14.9014 2.57515 14.7295 3.15586C14.5577 3.73656 14.6205 4.36152 14.9045 4.89641ZM14.9045 18.064C14.757 18.3295 14.6632 18.6215 14.6286 18.9232C14.5939 19.225 14.619 19.5306 14.7025 19.8226C14.7859 20.1146 14.9261 20.3874 15.1149 20.6253C15.3038 20.8631 15.5376 21.0615 15.8031 21.209C16.0686 21.3565 16.3606 21.4502 16.6623 21.4849C16.9641 21.5196 17.2697 21.4944 17.5617 21.411C17.8537 21.3276 18.1265 21.1874 18.3644 20.9986C18.6022 20.8097 18.8006 20.5758 18.9481 20.3103C19.246 19.7741 19.3186 19.1415 19.1501 18.5517C18.9816 17.962 18.5857 17.4633 18.0494 17.1654C17.5132 16.8675 16.8806 16.7948 16.2908 16.9634C15.7011 17.1319 15.2024 17.5278 14.9045 18.064Z",
24
+ stroke: "currentColor",
25
+ strokeWidth: "1.5",
26
+ strokeLinecap: "round",
27
+ strokeLinejoin: "round"
28
+ }
29
+ )
30
+ }
31
+ );
32
+ }
33
+
34
+ exports.ShareIcon = ShareIcon;
@@ -1,5 +1,6 @@
1
1
  import { updateAddress, addAddress, getCountries, getSubdivisions } from './chunk-ZGMLOLTC.js';
2
- import { getCache, getAddressMeta } from './chunk-YUPBTD4M.js';
2
+ import { getCache } from './chunk-OSM73ETC.js';
3
+ import { getAddressMeta } from './chunk-F45S7UWC.js';
3
4
  import { addressFormInitialValues, IP_API_CACHE_KEY, addressValidationSchema, buildSubmitPayload } from './chunk-ELP23UGF.js';
4
5
  import { useState, useEffect, useMemo, useCallback } from 'react';
5
6
  import { useFormik } from 'formik';
@@ -17,6 +17,11 @@ async function getOrderDetailsByNumber(orderNumber) {
17
17
  params: { order_number: orderNumber }
18
18
  });
19
19
  }
20
+ async function getOrderDetailsByRef(orderRef) {
21
+ return chunkECHV2JSY_cjs.http_service_default.get("/customer/order-detail/", {
22
+ params: { order_ref: orderRef }
23
+ });
24
+ }
20
25
  async function getPublicOrderDetailsByNumber(orderNumber) {
21
26
  return chunkECHV2JSY_cjs.http_service_default.get("/customer/public_order/", {
22
27
  params: { order_number: orderNumber }
@@ -111,6 +116,7 @@ async function verifyTabbyPayment(orderNumber) {
111
116
  exports.checkPhonepePaymentStatus = checkPhonepePaymentStatus;
112
117
  exports.getOrderDetails = getOrderDetails;
113
118
  exports.getOrderDetailsByNumber = getOrderDetailsByNumber;
119
+ exports.getOrderDetailsByRef = getOrderDetailsByRef;
114
120
  exports.getOrders = getOrders;
115
121
  exports.getPublicOrderDetailsByNumber = getPublicOrderDetailsByNumber;
116
122
  exports.getStripePaymentStatus = getStripePaymentStatus;
@@ -0,0 +1,271 @@
1
+ 'use strict';
2
+
3
+ var chunkV447PVRV_cjs = require('./chunk-V447PVRV.cjs');
4
+ var chunkKLNKIQQM_cjs = require('./chunk-KLNKIQQM.cjs');
5
+ var react = require('react');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ // src/components/address-form/address-form.module.css
9
+ var address_form_default = {};
10
+ var AddressForm = react.forwardRef(
11
+ ({
12
+ address,
13
+ onSuccess,
14
+ onError,
15
+ locationCacheKey,
16
+ defaultCountryId,
17
+ renderButton,
18
+ onFormikReady,
19
+ onCancel,
20
+ showCancel = true,
21
+ showDefaultCheckbox = true,
22
+ className,
23
+ submitLabel = "Save"
24
+ }, ref) => {
25
+ const {
26
+ formik,
27
+ states,
28
+ supportedCountries,
29
+ selectedCountry,
30
+ countryCodeOptions,
31
+ addressMeta,
32
+ handlePhoneCountryChange,
33
+ handleCountryCodeChange,
34
+ handlePhoneChange,
35
+ isSubmitting,
36
+ isEditing
37
+ } = chunkKLNKIQQM_cjs.useAddressForm({
38
+ address,
39
+ onSuccess,
40
+ onError,
41
+ locationCacheKey,
42
+ defaultCountryId
43
+ });
44
+ react.useImperativeHandle(
45
+ ref,
46
+ () => ({
47
+ formik,
48
+ resetForm: () => formik.resetForm()
49
+ }),
50
+ [formik]
51
+ );
52
+ react.useEffect(() => {
53
+ onFormikReady?.(formik);
54
+ }, [formik, onFormikReady]);
55
+ return /* @__PURE__ */ jsxRuntime.jsxs(
56
+ "form",
57
+ {
58
+ name: "address-form",
59
+ className: `${address_form_default.addressForm} ${className || ""}`,
60
+ onSubmit: formik.handleSubmit,
61
+ children: [
62
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formBody, children: [
63
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
64
+ /* @__PURE__ */ jsxRuntime.jsx("label", { children: "Name *" }),
65
+ /* @__PURE__ */ jsxRuntime.jsx(
66
+ "input",
67
+ {
68
+ className: address_form_default.formControl,
69
+ type: "text",
70
+ placeholder: "Name",
71
+ "aria-label": "name",
72
+ autoFocus: true,
73
+ ...formik.getFieldProps("customer_name")
74
+ }
75
+ ),
76
+ formik.touched.customer_name && formik.errors.customer_name && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.customer_name })
77
+ ] }),
78
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
79
+ /* @__PURE__ */ jsxRuntime.jsx("label", { children: "Email *" }),
80
+ /* @__PURE__ */ jsxRuntime.jsx(
81
+ "input",
82
+ {
83
+ className: address_form_default.formControl,
84
+ type: "email",
85
+ placeholder: "Email",
86
+ "aria-label": "email",
87
+ ...formik.getFieldProps("customer_email")
88
+ }
89
+ ),
90
+ formik.touched.customer_email && formik.errors.customer_email && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.customer_email })
91
+ ] }),
92
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
93
+ /* @__PURE__ */ jsxRuntime.jsx("label", { children: "Phone *" }),
94
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.phoneRow, children: [
95
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.phoneCodeCol, children: /* @__PURE__ */ jsxRuntime.jsx(
96
+ chunkV447PVRV_cjs.search_dropdown_default,
97
+ {
98
+ options: countryCodeOptions,
99
+ value: formik.values.customer_country_code,
100
+ onChange: handlePhoneCountryChange,
101
+ placeholder: "Country",
102
+ searchPlaceholder: "Search country...",
103
+ maxHeight: "250px"
104
+ }
105
+ ) }),
106
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.phoneInputCol, children: /* @__PURE__ */ jsxRuntime.jsx(
107
+ "input",
108
+ {
109
+ className: address_form_default.formControl,
110
+ type: "tel",
111
+ placeholder: "Phone",
112
+ "aria-label": "phone",
113
+ name: "customer_phone",
114
+ value: formik.values.customer_phone,
115
+ onBlur: formik.handleBlur,
116
+ onChange: handlePhoneChange
117
+ }
118
+ ) })
119
+ ] }),
120
+ formik.touched.customer_phone && formik.errors.customer_phone && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.customer_phone })
121
+ ] }),
122
+ /* @__PURE__ */ jsxRuntime.jsx("hr", { className: address_form_default.divider }),
123
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
124
+ /* @__PURE__ */ jsxRuntime.jsx("label", { children: "Address (House No, Building, Street, Area) *" }),
125
+ /* @__PURE__ */ jsxRuntime.jsx(
126
+ "input",
127
+ {
128
+ className: address_form_default.formControl,
129
+ type: "text",
130
+ placeholder: "E.g. 1st Cross, 2nd Main, 3rd Stage",
131
+ "aria-label": "address",
132
+ ...formik.getFieldProps("address")
133
+ }
134
+ ),
135
+ formik.touched.address && formik.errors.address && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.address })
136
+ ] }),
137
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.row, children: [
138
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.col, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
139
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-capitalize", children: "Country *" }),
140
+ /* @__PURE__ */ jsxRuntime.jsx(
141
+ chunkV447PVRV_cjs.search_dropdown_default,
142
+ {
143
+ options: countryCodeOptions,
144
+ value: selectedCountry?.tld_code,
145
+ onChange: handleCountryCodeChange,
146
+ placeholder: "Select country",
147
+ searchPlaceholder: "Search country...",
148
+ maxHeight: "250px",
149
+ name: "country_obj"
150
+ }
151
+ )
152
+ ] }) }),
153
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.col, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
154
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { style: { textTransform: "capitalize" }, children: [
155
+ addressMeta?.regionLabel || "State",
156
+ " *"
157
+ ] }),
158
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.selectWrapper, children: [
159
+ /* @__PURE__ */ jsxRuntime.jsxs(
160
+ "select",
161
+ {
162
+ className: address_form_default.formControl,
163
+ "aria-label": "state",
164
+ "data-select": "",
165
+ ...formik.getFieldProps("state_obj"),
166
+ children: [
167
+ /* @__PURE__ */ jsxRuntime.jsxs("option", { value: "", children: [
168
+ "Select ",
169
+ addressMeta?.regionLabel || "State"
170
+ ] }),
171
+ states.map((state) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: state.id, children: state.name }, state.id))
172
+ ]
173
+ }
174
+ ),
175
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.selectArrow, children: /* @__PURE__ */ jsxRuntime.jsx(chunkV447PVRV_cjs.DownChevron, { width: 12, height: 12 }) })
176
+ ] }),
177
+ formik.touched.state_obj && formik.errors.state_obj && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.state_obj })
178
+ ] }) })
179
+ ] }),
180
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.row, children: [
181
+ addressMeta?.hasPostal && /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.col, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
182
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
183
+ addressMeta?.postalLabel || "Postal Code",
184
+ " *"
185
+ ] }),
186
+ /* @__PURE__ */ jsxRuntime.jsx(
187
+ "input",
188
+ {
189
+ className: address_form_default.formControl,
190
+ type: "tel",
191
+ placeholder: addressMeta?.postalLabel || "Postal Code",
192
+ "aria-label": "pincode",
193
+ ...formik.getFieldProps("pincode")
194
+ }
195
+ ),
196
+ formik.touched.pincode && formik.errors.pincode && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.pincode })
197
+ ] }) }),
198
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.col, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
199
+ /* @__PURE__ */ jsxRuntime.jsx("label", { children: "City/District *" }),
200
+ /* @__PURE__ */ jsxRuntime.jsx(
201
+ "input",
202
+ {
203
+ className: address_form_default.formControl,
204
+ type: "text",
205
+ placeholder: "E.g. Kochi, Bangalore",
206
+ "aria-label": "city",
207
+ ...formik.getFieldProps("city")
208
+ }
209
+ ),
210
+ formik.touched.city && formik.errors.city && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.city })
211
+ ] }) })
212
+ ] }),
213
+ /* @__PURE__ */ jsxRuntime.jsx("hr", { className: address_form_default.divider }),
214
+ showDefaultCheckbox && /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.formGroup, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: address_form_default.checkboxLabel, children: [
215
+ /* @__PURE__ */ jsxRuntime.jsx(
216
+ "input",
217
+ {
218
+ type: "checkbox",
219
+ className: address_form_default.checkboxInput,
220
+ checked: formik.values.is_default || false,
221
+ onChange: (e) => {
222
+ formik.setFieldValue("is_default", e.target.checked);
223
+ }
224
+ }
225
+ ),
226
+ "Make this your default address"
227
+ ] }) })
228
+ ] }),
229
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formFooter, children: [
230
+ showCancel && onCancel && /* @__PURE__ */ jsxRuntime.jsx(
231
+ "button",
232
+ {
233
+ type: "button",
234
+ className: address_form_default.cancelBtn,
235
+ onClick: onCancel,
236
+ children: "Cancel"
237
+ }
238
+ ),
239
+ renderButton ? renderButton({
240
+ type: "submit",
241
+ disabled: !formik.isValid || isSubmitting,
242
+ loading: isSubmitting,
243
+ children: isEditing ? submitLabel : submitLabel
244
+ }) : /* @__PURE__ */ jsxRuntime.jsx(
245
+ "button",
246
+ {
247
+ type: "submit",
248
+ disabled: !formik.isValid || isSubmitting,
249
+ className: address_form_default.formControl,
250
+ style: {
251
+ width: "auto",
252
+ cursor: !formik.isValid || isSubmitting ? "not-allowed" : "pointer",
253
+ backgroundColor: "var(--primary, #003d29)",
254
+ color: "var(--btn-text, #fff)",
255
+ border: "none",
256
+ padding: "0.5rem 1.5rem",
257
+ opacity: !formik.isValid || isSubmitting ? 0.6 : 1
258
+ },
259
+ children: isSubmitting ? "Saving..." : submitLabel
260
+ }
261
+ )
262
+ ] })
263
+ ]
264
+ }
265
+ );
266
+ }
267
+ );
268
+ AddressForm.displayName = "AddressForm";
269
+ var address_form_default2 = AddressForm;
270
+
271
+ exports.address_form_default = address_form_default2;
@@ -0,0 +1,14 @@
1
+ import { useThemeData } from './chunk-5NUDTIQ2.js';
2
+ import { useEffect } from 'react';
3
+
4
+ function ThemeDataInitializer({
5
+ themeData
6
+ }) {
7
+ const setThemeData = useThemeData((state) => state.setThemeData);
8
+ useEffect(() => {
9
+ setThemeData(themeData);
10
+ }, [themeData]);
11
+ return null;
12
+ }
13
+
14
+ export { ThemeDataInitializer };
@@ -0,0 +1,22 @@
1
+ import { ShareIcon } from './chunk-U7EXLQCT.js';
2
+ import { shareLink, convertToCurrency } from './chunk-F45S7UWC.js';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ var ShareButton = ({
6
+ product,
7
+ className = "flex space-x-2 items-center hover:text-textSecondary transition-all duration-100",
8
+ iconSize = 22
9
+ }) => {
10
+ const _handleShare = () => {
11
+ shareLink(
12
+ `Buy ${product.name} at ${convertToCurrency(
13
+ Number(product.selling_price)
14
+ )}`,
15
+ product.name
16
+ );
17
+ };
18
+ return /* @__PURE__ */ jsx("div", { className: "flex items-start gap-4", children: /* @__PURE__ */ jsx("button", { className, onClick: _handleShare, children: /* @__PURE__ */ jsx(ShareIcon, { width: iconSize, height: iconSize }) }) });
19
+ };
20
+ var share_button_default = ShareButton;
21
+
22
+ export { share_button_default };
@@ -1,141 +1,3 @@
1
- // src/utils/cache.ts
2
- var DEFAULT_EXPIRY_HOURS = 24;
3
- var CacheManager = class _CacheManager {
4
- constructor() {
5
- this.cache = /* @__PURE__ */ new Map();
6
- this.loadFromStorage();
7
- }
8
- static getInstance() {
9
- if (!_CacheManager.instance) {
10
- _CacheManager.instance = new _CacheManager();
11
- }
12
- return _CacheManager.instance;
13
- }
14
- loadFromStorage() {
15
- if (typeof window === "undefined") return;
16
- try {
17
- const stored = localStorage.getItem("app_cache");
18
- if (stored) {
19
- const parsed = JSON.parse(stored);
20
- this.cache = new Map(Object.entries(parsed));
21
- this.cleanExpired();
22
- }
23
- } catch (error) {
24
- console.warn("Failed to load cache from storage:", error);
25
- }
26
- }
27
- saveToStorage() {
28
- if (typeof window === "undefined") return;
29
- try {
30
- const cacheObject = Object.fromEntries(this.cache);
31
- localStorage.setItem("app_cache", JSON.stringify(cacheObject));
32
- } catch (error) {
33
- console.warn("Failed to save cache to storage:", error);
34
- }
35
- }
36
- cleanExpired() {
37
- const now = Date.now();
38
- const keysToDelete = [];
39
- this.cache.forEach((item, key) => {
40
- if (now > item.expiry) {
41
- keysToDelete.push(key);
42
- }
43
- });
44
- keysToDelete.forEach((key) => {
45
- this.cache.delete(key);
46
- });
47
- this.saveToStorage();
48
- }
49
- set(key, data, options = {}) {
50
- const expiryHours = options.expiryHours || DEFAULT_EXPIRY_HOURS;
51
- const now = Date.now();
52
- const expiry = now + expiryHours * 60 * 60 * 1e3;
53
- const cacheItem = {
54
- data,
55
- timestamp: now,
56
- expiry
57
- };
58
- this.cache.set(key, cacheItem);
59
- this.saveToStorage();
60
- }
61
- get(key) {
62
- this.cleanExpired();
63
- const item = this.cache.get(key);
64
- if (!item) return null;
65
- const now = Date.now();
66
- if (now > item.expiry) {
67
- this.cache.delete(key);
68
- this.saveToStorage();
69
- return null;
70
- }
71
- return item.data;
72
- }
73
- has(key) {
74
- this.cleanExpired();
75
- return this.cache.has(key);
76
- }
77
- delete(key) {
78
- this.cache.delete(key);
79
- this.saveToStorage();
80
- }
81
- clear() {
82
- this.cache.clear();
83
- if (typeof window !== "undefined") {
84
- localStorage.removeItem("app_cache");
85
- }
86
- }
87
- getCacheInfo() {
88
- this.cleanExpired();
89
- return {
90
- size: this.cache.size,
91
- keys: Array.from(this.cache.keys())
92
- };
93
- }
94
- invalidateCache(pattern) {
95
- this.cleanExpired();
96
- if (!pattern) {
97
- this.clear();
98
- return;
99
- }
100
- const keysToDelete = [];
101
- this.cache.forEach((item, key) => {
102
- if (key.includes(pattern)) {
103
- keysToDelete.push(key);
104
- }
105
- });
106
- keysToDelete.forEach((key) => {
107
- this.cache.delete(key);
108
- });
109
- this.saveToStorage();
110
- }
111
- };
112
- var cache = CacheManager.getInstance();
113
- function setCache(key, data, options = {}) {
114
- cache.set(key, data, options);
115
- }
116
- function getCache(key) {
117
- return cache.get(key);
118
- }
119
- function hasCache(key) {
120
- return cache.has(key);
121
- }
122
- function deleteCache(key) {
123
- cache.delete(key);
124
- }
125
- function clearCache() {
126
- cache.clear();
127
- }
128
- function invalidateCache(pattern) {
129
- cache.invalidateCache(pattern);
130
- }
131
- function generateCacheKey(endpoint, params) {
132
- const baseKey = endpoint.replace(/[^a-zA-Z0-9]/g, "_");
133
- if (!params) return baseKey;
134
- const paramString = JSON.stringify(params);
135
- const hash = btoa(paramString).replace(/[^a-zA-Z0-9]/g, "");
136
- return `${baseKey}_${hash}`;
137
- }
138
-
139
1
  // src/utils/misc.ts
140
2
  function convertObjectToParams(params) {
141
3
  const cleanedParams = Object.fromEntries(
@@ -286,4 +148,4 @@ async function getAddressMeta(countryCode) {
286
148
  };
287
149
  }
288
150
 
289
- export { CacheManager, cache, clearCache, constructFilter, convertObjectToParams, convertToCurrency, deleteCache, digestMessage, formatDateTime, formatPostalLabel, generateCacheKey, getAddressMeta, getCache, getDelayInMilliseconds, getParamsFromURL, getQueryParams, hasCache, invalidateCache, pluralize, pushParamsToURL, setCache, shareLink };
151
+ export { constructFilter, convertObjectToParams, convertToCurrency, digestMessage, formatDateTime, formatPostalLabel, getAddressMeta, getDelayInMilliseconds, getParamsFromURL, getQueryParams, pluralize, pushParamsToURL, shareLink };
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var chunk3YRSHPM6_cjs = require('./chunk-3YRSHPM6.cjs');
4
+ var chunkOTMTHA5C_cjs = require('./chunk-OTMTHA5C.cjs');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ var ShareButton = ({
8
+ product,
9
+ className = "flex space-x-2 items-center hover:text-textSecondary transition-all duration-100",
10
+ iconSize = 22
11
+ }) => {
12
+ const _handleShare = () => {
13
+ chunkOTMTHA5C_cjs.shareLink(
14
+ `Buy ${product.name} at ${chunkOTMTHA5C_cjs.convertToCurrency(
15
+ Number(product.selling_price)
16
+ )}`,
17
+ product.name
18
+ );
19
+ };
20
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-start gap-4", children: /* @__PURE__ */ jsxRuntime.jsx("button", { className, onClick: _handleShare, children: /* @__PURE__ */ jsxRuntime.jsx(chunk3YRSHPM6_cjs.ShareIcon, { width: iconSize, height: iconSize }) }) });
21
+ };
22
+ var share_button_default = ShareButton;
23
+
24
+ exports.share_button_default = share_button_default;
@@ -1,6 +1,6 @@
1
1
  import { getCoupons, getAppliedCoupon, applyCoupon, removeCoupon } from './chunk-7M5CVYZJ.js';
2
2
  import { pixelEvents } from './chunk-WFDKKOO7.js';
3
- import { razorpayOrderSuccess, razorpayOrderFail, publicMakeCODOrder, makeCODOrder, stripeOrderSuccess } from './chunk-LW3V53WJ.js';
3
+ import { razorpayOrderSuccess, razorpayOrderFail, publicMakeCODOrder, makeCODOrder, stripeOrderSuccess } from './chunk-UVU7H4E6.js';
4
4
  import { getCloudFront } from './chunk-JQMLHRWL.js';
5
5
  import { AxiosError } from 'axios';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { updateCart, removeFromCart, addToCart, getCart } from './chunk-U25T7M6S.js';
2
2
  import { cart_default } from './chunk-QAC72HKO.js';
3
- import { updateOrderCustomization } from './chunk-LW3V53WJ.js';
3
+ import { updateOrderCustomization } from './chunk-UVU7H4E6.js';
4
4
  import { auth_default } from './chunk-WEMNXIRS.js';
5
5
  import { USER_CRED_TOKEN, USER_CREDENTIALS } from './chunk-BQ256JKN.js';
6
6
  import { create } from 'zustand';
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkRDUT4W3B_cjs = require('./chunk-RDUT4W3B.cjs');
4
- var chunk4CVKE6CC_cjs = require('./chunk-4CVKE6CC.cjs');
4
+ var chunkLJUGNSQQ_cjs = require('./chunk-LJUGNSQQ.cjs');
5
+ var chunkOTMTHA5C_cjs = require('./chunk-OTMTHA5C.cjs');
5
6
  var chunkTB72NPRM_cjs = require('./chunk-TB72NPRM.cjs');
6
7
  var react = require('react');
7
8
  var formik = require('formik');
@@ -96,7 +97,7 @@ function useAddressForm(options = {}) {
96
97
  };
97
98
  const fetchAddressMeta = async () => {
98
99
  try {
99
- const response = await chunk4CVKE6CC_cjs.getAddressMeta(
100
+ const response = await chunkOTMTHA5C_cjs.getAddressMeta(
100
101
  selectedCountry.tld_code
101
102
  );
102
103
  setAddressMeta(response);
@@ -146,7 +147,7 @@ function useAddressForm(options = {}) {
146
147
  }
147
148
  formik$1.setValues(addressValues);
148
149
  } else {
149
- const locationData = chunk4CVKE6CC_cjs.getCache(locationCacheKey);
150
+ const locationData = chunkLJUGNSQQ_cjs.getCache(locationCacheKey);
150
151
  if (locationData) {
151
152
  const { country_code = "IN" } = locationData;
152
153
  const foundCountry = supportedCountries.find(