hey-pharmacist-ecommerce 1.1.25 → 1.1.26

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 (62) hide show
  1. package/dist/index.d.mts +1 -206
  2. package/dist/index.d.ts +1 -206
  3. package/dist/index.js +47 -233
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +47 -233
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/CartItem.tsx +0 -10
  9. package/src/components/ProductCard.tsx +4 -5
  10. package/src/lib/Apis/api.ts +0 -8
  11. package/src/lib/Apis/apis/product-variants-api.ts +0 -96
  12. package/src/lib/Apis/apis/products-api.ts +7 -15
  13. package/src/lib/Apis/apis/shipping-api.ts +12 -214
  14. package/src/lib/Apis/models/category-filters.ts +0 -6
  15. package/src/lib/Apis/models/create-variant-dto.ts +0 -6
  16. package/src/lib/Apis/models/discounts-insights-dto.ts +0 -6
  17. package/src/lib/Apis/models/index.ts +0 -29
  18. package/src/lib/Apis/models/orders-insights-dto.ts +0 -6
  19. package/src/lib/Apis/models/payment.ts +0 -7
  20. package/src/lib/Apis/models/product-variant.ts +0 -6
  21. package/src/lib/Apis/models/products-insights-dto.ts +0 -6
  22. package/src/lib/Apis/models/rate-dto.ts +0 -6
  23. package/src/lib/Apis/models/update-product-variant-dto.ts +0 -6
  24. package/src/providers/WishlistProvider.tsx +2 -3
  25. package/src/screens/CheckoutScreen.tsx +25 -73
  26. package/src/lib/Apis/apis/chats-api.ts +0 -1101
  27. package/src/lib/Apis/apis/drafts-api.ts +0 -448
  28. package/src/lib/Apis/apis/open-aiapi.ts +0 -513
  29. package/src/lib/Apis/apis/payment-methods-api.ts +0 -411
  30. package/src/lib/Apis/apis/product-attributes-api.ts +0 -538
  31. package/src/lib/Apis/apis/product-favorite-list-api.ts +0 -321
  32. package/src/lib/Apis/apis/roles-api.ts +0 -614
  33. package/src/lib/Apis/apis/statistics-api.ts +0 -234
  34. package/src/lib/Apis/models/add-message-dto.ts +0 -56
  35. package/src/lib/Apis/models/chat.ts +0 -33
  36. package/src/lib/Apis/models/create-chat-dto.ts +0 -39
  37. package/src/lib/Apis/models/create-draft-dto.ts +0 -67
  38. package/src/lib/Apis/models/create-product-attribute-dto.ts +0 -33
  39. package/src/lib/Apis/models/create-role-dto.ts +0 -57
  40. package/src/lib/Apis/models/create-zone-dto.ts +0 -82
  41. package/src/lib/Apis/models/default-payment-method-request-dto.ts +0 -27
  42. package/src/lib/Apis/models/draft.ts +0 -79
  43. package/src/lib/Apis/models/google-analytics-request-dto.ts +0 -55
  44. package/src/lib/Apis/models/google-analytics-response-dto.ts +0 -39
  45. package/src/lib/Apis/models/my-favorite-list-dto.ts +0 -52
  46. package/src/lib/Apis/models/open-api.ts +0 -33
  47. package/src/lib/Apis/models/payment-method-data.ts +0 -34
  48. package/src/lib/Apis/models/payment-method.ts +0 -51
  49. package/src/lib/Apis/models/populated-chat-dto.ts +0 -95
  50. package/src/lib/Apis/models/product-attribute.ts +0 -57
  51. package/src/lib/Apis/models/product.ts +0 -142
  52. package/src/lib/Apis/models/role.ts +0 -69
  53. package/src/lib/Apis/models/single-message-populated.ts +0 -59
  54. package/src/lib/Apis/models/single-suggest-attribute.ts +0 -33
  55. package/src/lib/Apis/models/statistic-dto.ts +0 -171
  56. package/src/lib/Apis/models/suggest-attributes.ts +0 -28
  57. package/src/lib/Apis/models/update-product-attribute-dto.ts +0 -33
  58. package/src/lib/Apis/models/update-role-dto.ts +0 -57
  59. package/src/lib/Apis/models/update-zone-dto.ts +0 -82
  60. package/src/lib/Apis/models/user.ts +0 -232
  61. package/src/lib/Apis/models/zone-single-size.ts +0 -51
  62. package/src/lib/Apis/models/zone.ts +0 -106
package/dist/index.mjs CHANGED
@@ -5027,7 +5027,6 @@ var ProductsApiAxiosParamCreator = function(configuration) {
5027
5027
  * @summary Get all products of a specific category
5028
5028
  * @param {string} categoryId Category ID
5029
5029
  * @param {string} [searchTerm] OpenAI Search Query
5030
- * @param {any} [attributes] Send any key-value pairs as query parameters (value is comma separated string)
5031
5030
  * @param {number} [maxPrice] highest price to filter with
5032
5031
  * @param {number} [minPrice] lowest price to filter with
5033
5032
  * @param {string} [brandFilter] brands to filter with (comma separated string)
@@ -5040,7 +5039,7 @@ var ProductsApiAxiosParamCreator = function(configuration) {
5040
5039
  * @param {*} [options] Override http request option.
5041
5040
  * @throws {RequiredError}
5042
5041
  */
5043
- getAllCategoryProducts: async (categoryId, searchTerm, attributes, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options = {}) => {
5042
+ getAllCategoryProducts: async (categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options = {}) => {
5044
5043
  if (categoryId === null || categoryId === void 0) {
5045
5044
  throw new RequiredError("categoryId", "Required parameter categoryId was null or undefined when calling getAllCategoryProducts.");
5046
5045
  }
@@ -5064,9 +5063,6 @@ var ProductsApiAxiosParamCreator = function(configuration) {
5064
5063
  if (searchTerm !== void 0) {
5065
5064
  localVarQueryParameter["searchTerm"] = searchTerm;
5066
5065
  }
5067
- if (attributes !== void 0) {
5068
- localVarQueryParameter["attributes"] = attributes;
5069
- }
5070
5066
  if (maxPrice !== void 0) {
5071
5067
  localVarQueryParameter["maxPrice"] = maxPrice;
5072
5068
  }
@@ -5638,7 +5634,6 @@ var ProductsApiFp = function(configuration) {
5638
5634
  * @summary Get all products of a specific category
5639
5635
  * @param {string} categoryId Category ID
5640
5636
  * @param {string} [searchTerm] OpenAI Search Query
5641
- * @param {any} [attributes] Send any key-value pairs as query parameters (value is comma separated string)
5642
5637
  * @param {number} [maxPrice] highest price to filter with
5643
5638
  * @param {number} [minPrice] lowest price to filter with
5644
5639
  * @param {string} [brandFilter] brands to filter with (comma separated string)
@@ -5651,8 +5646,8 @@ var ProductsApiFp = function(configuration) {
5651
5646
  * @param {*} [options] Override http request option.
5652
5647
  * @throws {RequiredError}
5653
5648
  */
5654
- async getAllCategoryProducts(categoryId, searchTerm, attributes, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options) {
5655
- const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllCategoryProducts(categoryId, searchTerm, attributes, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options);
5649
+ async getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options) {
5650
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options);
5656
5651
  return (axios = globalAxios4, basePath = BASE_PATH) => {
5657
5652
  const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
5658
5653
  return axios.request(axiosRequestArgs);
@@ -5847,7 +5842,6 @@ var ProductsApi = class extends BaseAPI {
5847
5842
  * @summary Get all products of a specific category
5848
5843
  * @param {string} categoryId Category ID
5849
5844
  * @param {string} [searchTerm] OpenAI Search Query
5850
- * @param {any} [attributes] Send any key-value pairs as query parameters (value is comma separated string)
5851
5845
  * @param {number} [maxPrice] highest price to filter with
5852
5846
  * @param {number} [minPrice] lowest price to filter with
5853
5847
  * @param {string} [brandFilter] brands to filter with (comma separated string)
@@ -5861,8 +5855,8 @@ var ProductsApi = class extends BaseAPI {
5861
5855
  * @throws {RequiredError}
5862
5856
  * @memberof ProductsApi
5863
5857
  */
5864
- async getAllCategoryProducts(categoryId, searchTerm, attributes, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options) {
5865
- return ProductsApiFp(this.configuration).getAllCategoryProducts(categoryId, searchTerm, attributes, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(this.axios, this.basePath));
5858
+ async getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options) {
5859
+ return ProductsApiFp(this.configuration).getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(this.axios, this.basePath));
5866
5860
  }
5867
5861
  /**
5868
5862
  *
@@ -5988,52 +5982,6 @@ var ProductsApi = class extends BaseAPI {
5988
5982
  };
5989
5983
  var ShippingApiAxiosParamCreator = function(configuration) {
5990
5984
  return {
5991
- /**
5992
- *
5993
- * @summary Create zone
5994
- * @param {CreateZoneDto} body
5995
- * @param {*} [options] Override http request option.
5996
- * @throws {RequiredError}
5997
- */
5998
- createZone: async (body, options = {}) => {
5999
- if (body === null || body === void 0) {
6000
- throw new RequiredError("body", "Required parameter body was null or undefined when calling createZone.");
6001
- }
6002
- const localVarPath = `/shipping/zones/create`;
6003
- const localVarUrlObj = new URL(localVarPath, "https://example.com");
6004
- let baseOptions;
6005
- if (configuration) {
6006
- baseOptions = configuration.baseOptions;
6007
- }
6008
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
6009
- const localVarHeaderParameter = {};
6010
- const localVarQueryParameter = {};
6011
- if (configuration && configuration.accessToken) {
6012
- const accessToken = typeof configuration.accessToken === "function" ? await configuration.accessToken() : await configuration.accessToken;
6013
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
6014
- }
6015
- if (configuration && configuration.apiKey) {
6016
- const localVarApiKeyValue = typeof configuration.apiKey === "function" ? await configuration.apiKey("x-store-key") : await configuration.apiKey;
6017
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
6018
- }
6019
- localVarHeaderParameter["Content-Type"] = "application/json";
6020
- const query = new URLSearchParams(localVarUrlObj.search);
6021
- for (const key in localVarQueryParameter) {
6022
- query.set(key, localVarQueryParameter[key]);
6023
- }
6024
- for (const key in options.params) {
6025
- query.set(key, options.params[key]);
6026
- }
6027
- localVarUrlObj.search = new URLSearchParams(query).toString();
6028
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
6029
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
6030
- const needsSerialization = typeof body !== "string" || (localVarRequestOptions.headers || (localVarRequestOptions.headers = {}))["Content-Type"] === "application/json";
6031
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== void 0 ? body : {}) : body || "";
6032
- return {
6033
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
6034
- options: localVarRequestOptions
6035
- };
6036
- },
6037
5985
  /**
6038
5986
  *
6039
5987
  * @summary Get all shipments
@@ -6207,12 +6155,12 @@ var ShippingApiAxiosParamCreator = function(configuration) {
6207
6155
  },
6208
6156
  /**
6209
6157
  *
6210
- * @summary Get zones
6158
+ * @summary Get store address
6211
6159
  * @param {*} [options] Override http request option.
6212
6160
  * @throws {RequiredError}
6213
6161
  */
6214
- getZones: async (options = {}) => {
6215
- const localVarPath = `/shipping/zones`;
6162
+ getStoreAddress: async (options = {}) => {
6163
+ const localVarPath = `/shipping/store/address`;
6216
6164
  const localVarUrlObj = new URL(localVarPath, "https://example.com");
6217
6165
  let baseOptions;
6218
6166
  if (configuration) {
@@ -6243,75 +6191,11 @@ var ShippingApiAxiosParamCreator = function(configuration) {
6243
6191
  url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
6244
6192
  options: localVarRequestOptions
6245
6193
  };
6246
- },
6247
- /**
6248
- *
6249
- * @summary Update zone
6250
- * @param {UpdateZoneDto} body
6251
- * @param {string} zoneId
6252
- * @param {*} [options] Override http request option.
6253
- * @throws {RequiredError}
6254
- */
6255
- updateZone: async (body, zoneId, options = {}) => {
6256
- if (body === null || body === void 0) {
6257
- throw new RequiredError("body", "Required parameter body was null or undefined when calling updateZone.");
6258
- }
6259
- if (zoneId === null || zoneId === void 0) {
6260
- throw new RequiredError("zoneId", "Required parameter zoneId was null or undefined when calling updateZone.");
6261
- }
6262
- const localVarPath = `/shipping/zones/{zoneId}`.replace(`{${"zoneId"}}`, encodeURIComponent(String(zoneId)));
6263
- const localVarUrlObj = new URL(localVarPath, "https://example.com");
6264
- let baseOptions;
6265
- if (configuration) {
6266
- baseOptions = configuration.baseOptions;
6267
- }
6268
- const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
6269
- const localVarHeaderParameter = {};
6270
- const localVarQueryParameter = {};
6271
- if (configuration && configuration.accessToken) {
6272
- const accessToken = typeof configuration.accessToken === "function" ? await configuration.accessToken() : await configuration.accessToken;
6273
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
6274
- }
6275
- if (configuration && configuration.apiKey) {
6276
- const localVarApiKeyValue = typeof configuration.apiKey === "function" ? await configuration.apiKey("x-store-key") : await configuration.apiKey;
6277
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
6278
- }
6279
- localVarHeaderParameter["Content-Type"] = "application/json";
6280
- const query = new URLSearchParams(localVarUrlObj.search);
6281
- for (const key in localVarQueryParameter) {
6282
- query.set(key, localVarQueryParameter[key]);
6283
- }
6284
- for (const key in options.params) {
6285
- query.set(key, options.params[key]);
6286
- }
6287
- localVarUrlObj.search = new URLSearchParams(query).toString();
6288
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
6289
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
6290
- const needsSerialization = typeof body !== "string" || (localVarRequestOptions.headers || (localVarRequestOptions.headers = {}))["Content-Type"] === "application/json";
6291
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== void 0 ? body : {}) : body || "";
6292
- return {
6293
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
6294
- options: localVarRequestOptions
6295
- };
6296
6194
  }
6297
6195
  };
6298
6196
  };
6299
6197
  var ShippingApiFp = function(configuration) {
6300
6198
  return {
6301
- /**
6302
- *
6303
- * @summary Create zone
6304
- * @param {CreateZoneDto} body
6305
- * @param {*} [options] Override http request option.
6306
- * @throws {RequiredError}
6307
- */
6308
- async createZone(body, options) {
6309
- const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).createZone(body, options);
6310
- return (axios = globalAxios4, basePath = BASE_PATH) => {
6311
- const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
6312
- return axios.request(axiosRequestArgs);
6313
- };
6314
- },
6315
6199
  /**
6316
6200
  *
6317
6201
  * @summary Get all shipments
@@ -6369,27 +6253,12 @@ var ShippingApiFp = function(configuration) {
6369
6253
  },
6370
6254
  /**
6371
6255
  *
6372
- * @summary Get zones
6373
- * @param {*} [options] Override http request option.
6374
- * @throws {RequiredError}
6375
- */
6376
- async getZones(options) {
6377
- const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).getZones(options);
6378
- return (axios = globalAxios4, basePath = BASE_PATH) => {
6379
- const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
6380
- return axios.request(axiosRequestArgs);
6381
- };
6382
- },
6383
- /**
6384
- *
6385
- * @summary Update zone
6386
- * @param {UpdateZoneDto} body
6387
- * @param {string} zoneId
6256
+ * @summary Get store address
6388
6257
  * @param {*} [options] Override http request option.
6389
6258
  * @throws {RequiredError}
6390
6259
  */
6391
- async updateZone(body, zoneId, options) {
6392
- const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).updateZone(body, zoneId, options);
6260
+ async getStoreAddress(options) {
6261
+ const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).getStoreAddress(options);
6393
6262
  return (axios = globalAxios4, basePath = BASE_PATH) => {
6394
6263
  const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
6395
6264
  return axios.request(axiosRequestArgs);
@@ -6398,17 +6267,6 @@ var ShippingApiFp = function(configuration) {
6398
6267
  };
6399
6268
  };
6400
6269
  var ShippingApi = class extends BaseAPI {
6401
- /**
6402
- *
6403
- * @summary Create zone
6404
- * @param {CreateZoneDto} body
6405
- * @param {*} [options] Override http request option.
6406
- * @throws {RequiredError}
6407
- * @memberof ShippingApi
6408
- */
6409
- async createZone(body, options) {
6410
- return ShippingApiFp(this.configuration).createZone(body, options).then((request) => request(this.axios, this.basePath));
6411
- }
6412
6270
  /**
6413
6271
  *
6414
6272
  * @summary Get all shipments
@@ -6454,25 +6312,13 @@ var ShippingApi = class extends BaseAPI {
6454
6312
  }
6455
6313
  /**
6456
6314
  *
6457
- * @summary Get zones
6458
- * @param {*} [options] Override http request option.
6459
- * @throws {RequiredError}
6460
- * @memberof ShippingApi
6461
- */
6462
- async getZones(options) {
6463
- return ShippingApiFp(this.configuration).getZones(options).then((request) => request(this.axios, this.basePath));
6464
- }
6465
- /**
6466
- *
6467
- * @summary Update zone
6468
- * @param {UpdateZoneDto} body
6469
- * @param {string} zoneId
6315
+ * @summary Get store address
6470
6316
  * @param {*} [options] Override http request option.
6471
6317
  * @throws {RequiredError}
6472
6318
  * @memberof ShippingApi
6473
6319
  */
6474
- async updateZone(body, zoneId, options) {
6475
- return ShippingApiFp(this.configuration).updateZone(body, zoneId, options).then((request) => request(this.axios, this.basePath));
6320
+ async getStoreAddress(options) {
6321
+ return ShippingApiFp(this.configuration).getStoreAddress(options).then((request) => request(this.axios, this.basePath));
6476
6322
  }
6477
6323
  };
6478
6324
  var WishlistApiAxiosParamCreator = function(configuration) {
@@ -7714,8 +7560,7 @@ function ProductCard({
7714
7560
  return product.productVariants.filter((variant) => variant.productMedia && variant.productMedia.length > 0).map((variant) => ({
7715
7561
  variantId: variant.id || variant._id,
7716
7562
  variantName: variant.name,
7717
- image: variant.productMedia[0].file,
7718
- color: variant.attribute?.color || variant.attribute?.Color || null
7563
+ image: variant.productMedia[0].file
7719
7564
  }));
7720
7565
  }, [product.productVariants]);
7721
7566
  const selectedVariant = useMemo(() => {
@@ -7850,12 +7695,12 @@ function ProductCard({
7850
7695
  setIsImageLoaded(false);
7851
7696
  },
7852
7697
  className: `relative w-8 h-8 rounded-full overflow-hidden border-2 transition-all ${selectedVariantId === variant.variantId ? "border-primary-500 ring-2 ring-primary-200" : "border-gray-200 hover:border-primary-300"}`,
7853
- "aria-label": `Select ${variant.color || "variant"} color`,
7698
+ "aria-label": `Select ${variant.variantName || "variant"}`,
7854
7699
  children: /* @__PURE__ */ jsx(
7855
7700
  Image4,
7856
7701
  {
7857
7702
  src: variant.image,
7858
- alt: variant.color || `Variant ${index + 1}`,
7703
+ alt: variant.variantName || `Variant ${index + 1}`,
7859
7704
  fill: true,
7860
7705
  className: "object-cover",
7861
7706
  sizes: "32px"
@@ -9651,15 +9496,6 @@ function CartItem({ item }) {
9651
9496
  };
9652
9497
  const itemTotal = item.productVariantData.finalPrice * item.quantity;
9653
9498
  const unitPrice = item.productVariantData.finalPrice;
9654
- const attributes = [];
9655
- if (item.productVariantData.attribute) {
9656
- if (item.productVariantData.attribute.color) {
9657
- attributes.push(`Color: ${item.productVariantData.attribute.color}`);
9658
- }
9659
- if (item.productVariantData.attribute.size) {
9660
- attributes.push(`Size: ${item.productVariantData.attribute.size}`);
9661
- }
9662
- }
9663
9499
  return /* @__PURE__ */ jsx(
9664
9500
  motion.div,
9665
9501
  {
@@ -10223,15 +10059,15 @@ var PAYMENT_METHODS = [
10223
10059
  description: "Pay with cash on delivery or at pickup",
10224
10060
  className: "border-amber-500 hover:bg-amber-50",
10225
10061
  activeClass: "bg-amber-50 border-amber-500 text-amber-700"
10226
- },
10227
- {
10228
- label: "Credit",
10229
- value: "Credit",
10230
- icon: /* @__PURE__ */ jsx(ShieldCheck, { className: "w-5 h-5" }),
10231
- description: "Use your account credit",
10232
- className: "border-emerald-500 hover:bg-emerald-50",
10233
- activeClass: "bg-emerald-50 border-emerald-500 text-emerald-700"
10234
10062
  }
10063
+ // {
10064
+ // label: 'Credit',
10065
+ // value: 'Credit',
10066
+ // icon: <ShieldCheck className="w-5 h-5" />,
10067
+ // description: 'Use your account credit',
10068
+ // className: 'border-emerald-500 hover:bg-emerald-50',
10069
+ // activeClass: 'bg-emerald-50 border-emerald-500 text-emerald-700',
10070
+ // },
10235
10071
  ];
10236
10072
  function CheckoutScreen() {
10237
10073
  const router = useRouter();
@@ -10243,7 +10079,6 @@ function CheckoutScreen() {
10243
10079
  const [paymentMethod, setPaymentMethod] = useState("Card");
10244
10080
  const [error, setError] = useState(null);
10245
10081
  const [selectedAddressId, setSelectedAddressId] = useState(null);
10246
- const [selectedStoreAddressId, setSelectedStoreAddressId] = useState(null);
10247
10082
  const [storeAddresses, setStoreAddresses] = useState([]);
10248
10083
  const [isAddressModalOpen, setIsAddressModalOpen] = useState(false);
10249
10084
  const [editingAddress, setEditingAddress] = useState(null);
@@ -10363,16 +10198,14 @@ function CheckoutScreen() {
10363
10198
  }, [isDelivery, selectedAddressId, cart]);
10364
10199
  useEffect(() => {
10365
10200
  if (!isDelivery) {
10366
- const stores = [
10367
- { id: "store1", name: "Main Pharmacy", street1: "123 Main St", city: "Seattle" },
10368
- { id: "store2", name: "Eastside Pickup", street1: "456 East Ave", city: "Bellevue" }
10369
- ];
10370
- setStoreAddresses(stores);
10371
- setSelectedStoreAddressId(stores[0].id);
10372
- setShippingPrice(0);
10373
- } else {
10374
- setStoreAddresses([]);
10375
- setSelectedStoreAddressId(null);
10201
+ (async () => {
10202
+ const api = new ShippingApi(AXIOS_CONFIG);
10203
+ const res = await api.getStoreAddress();
10204
+ if (res.data) {
10205
+ setStoreAddresses([res.data]);
10206
+ setShippingPrice(0);
10207
+ }
10208
+ })();
10376
10209
  }
10377
10210
  }, [isDelivery]);
10378
10211
  const onSubmit = async (data) => {
@@ -10410,10 +10243,6 @@ function CheckoutScreen() {
10410
10243
  }
10411
10244
  }
10412
10245
  } else {
10413
- if (!selectedStoreAddressId) {
10414
- setError("Please select a pickup location.");
10415
- return;
10416
- }
10417
10246
  if (storeAddresses.length === 0) {
10418
10247
  setError("Store pickup location is not available.");
10419
10248
  return;
@@ -10455,8 +10284,7 @@ function CheckoutScreen() {
10455
10284
  chargeTax: true,
10456
10285
  orderRemindingDates: [],
10457
10286
  shippingAddress: data.shipping,
10458
- billingAddress: sameAsShipping ? data.shipping : data.billing,
10459
- pickupStoreId: !isDelivery ? selectedStoreAddressId : void 0
10287
+ billingAddress: sameAsShipping ? data.shipping : data.billing
10460
10288
  };
10461
10289
  const api = new OrdersApi(AXIOS_CONFIG);
10462
10290
  const response = await api.createCheckout(
@@ -10672,27 +10500,23 @@ function CheckoutScreen() {
10672
10500
  ] }),
10673
10501
  !isDelivery && storeAddresses.length > 0 && /* @__PURE__ */ jsxs("div", { className: "md:col-span-2", children: [
10674
10502
  /* @__PURE__ */ jsx("label", { className: "block mb-2 font-semibold", children: "Select Pickup Location" }),
10675
- /* @__PURE__ */ jsx(
10676
- "select",
10677
- {
10678
- className: "w-full border rounded-sm p-2",
10679
- value: selectedStoreAddressId || "",
10680
- onChange: (e) => setSelectedStoreAddressId(e.target.value),
10681
- children: storeAddresses.map((addr) => /* @__PURE__ */ jsxs("option", { value: addr.id, children: [
10682
- addr.name,
10683
- " - ",
10684
- addr.street1,
10685
- ", ",
10686
- addr.city
10687
- ] }, addr.id))
10688
- }
10689
- )
10503
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: storeAddresses.map((addr) => /* @__PURE__ */ jsx("div", { className: "w-full border rounded-sm p-2", children: /* @__PURE__ */ jsxs("p", { children: [
10504
+ addr.name,
10505
+ " - ",
10506
+ addr.street1,
10507
+ ", ",
10508
+ addr.city,
10509
+ ", ",
10510
+ addr.state,
10511
+ " ",
10512
+ addr.zip
10513
+ ] }) }, addr.id)) })
10690
10514
  ] })
10691
10515
  ] })
10692
10516
  ] }),
10693
10517
  isDelivery && selectedAddressId && /* @__PURE__ */ jsxs("div", { className: "bg-white border-2 border-gray-100 rounded-[24px] p-8 text-[#2B4B7C]", children: [
10694
10518
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-xl font-semibold text-gray-900 pb-4 mb-8 border-b", children: [
10695
- /* @__PURE__ */ jsx(Truck, { className: "text-accent w-8 h-8 flex items-center justify-center text-[#2B4B7C]" }),
10519
+ /* @__PURE__ */ jsx(Truck, { className: "w-8 h-8 flex items-center justify-center text-[#2B4B7C]" }),
10696
10520
  /* @__PURE__ */ jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-[#2B4B7C] text-2xl", children: "Shipping Options" })
10697
10521
  ] }),
10698
10522
  shippingRatesLoading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center py-12", children: [
@@ -10705,7 +10529,6 @@ function CheckoutScreen() {
10705
10529
  ] }) : shippingRates && shippingRates.length > 0 ? /* @__PURE__ */ jsx("div", { className: "space-y-4", children: shippingRates.map((rate) => {
10706
10530
  const isSelected = !!selectedShippingRateId && selectedShippingRateId === rate.objectId;
10707
10531
  const isTest = rate.test;
10708
- const hasAttributes = rate.attributes && rate.attributes.length > 0;
10709
10532
  return /* @__PURE__ */ jsxs(
10710
10533
  "div",
10711
10534
  {
@@ -10740,14 +10563,6 @@ function CheckoutScreen() {
10740
10563
  ] }),
10741
10564
  isTest && /* @__PURE__ */ jsx("span", { className: "px-2 py-1 text-xs font-medium bg-primary-100 text-primary-800 rounded-full", children: "TEST" })
10742
10565
  ] }),
10743
- hasAttributes && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 mb-3", children: rate.attributes.map((attr) => /* @__PURE__ */ jsx(
10744
- "span",
10745
- {
10746
- className: `px-2 py-1 text-xs font-medium rounded-full ${attr === "FASTEST" ? "bg-green-100 text-green-800" : attr === "BESTVALUE" ? "bg-blue-100 text-blue-800" : attr === "CHEAPEST" ? "bg-purple-100 text-purple-800" : "bg-gray-100 text-gray-800"}`,
10747
- children: attr
10748
- },
10749
- attr
10750
- )) }),
10751
10566
  /* @__PURE__ */ jsxs("div", { className: "space-y-1 text-sm text-gray-600", children: [
10752
10567
  rate.durationTerms && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
10753
10568
  /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
@@ -10895,8 +10710,7 @@ function CheckoutScreen() {
10895
10710
  }) }),
10896
10711
  /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-500 mt-4", children: [
10897
10712
  paymentMethod === "Card" && "You will be redirected to a secure payment page.",
10898
- paymentMethod === "Cash" && "Pay with cash at the time of delivery or pickup.",
10899
- paymentMethod === "Credit" && "Use your available account credit for this order."
10713
+ paymentMethod === "Cash" && "Pay with cash at the time of delivery or pickup."
10900
10714
  ] })
10901
10715
  ] })
10902
10716
  ] })