@plurix/ecom-components 1.14.1-COM-1442.2 → 1.14.1-bugfix-1891.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 (53) hide show
  1. package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +45 -0
  2. package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +34 -0
  3. package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +29 -0
  4. package/dist/packages/Carousel/Carousel.js +1 -1
  5. package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
  6. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +1 -12
  7. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +67 -78
  8. package/dist/packages/ChangeOrderModal/api/getOrderForm.js +15 -6
  9. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +4 -7
  10. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +21 -22
  11. package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +1 -6
  12. package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +17 -11
  13. package/dist/packages/Coupons/Coupons.d.ts +1 -4
  14. package/dist/packages/Coupons/Coupons.js +57 -67
  15. package/dist/packages/Coupons/components/CouponCard.d.ts +1 -3
  16. package/dist/packages/Coupons/components/CouponCard.js +83 -94
  17. package/dist/packages/Coupons/views/CouponsView.d.ts +1 -3
  18. package/dist/packages/Coupons/views/CouponsView.js +78 -87
  19. package/dist/packages/Coupons/views/LoadingView.js +6 -6
  20. package/dist/packages/Modal/Modal.js +1 -1
  21. package/dist/packages/Onboarding/Onboarding.js +1 -1
  22. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +10 -13
  23. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +2 -3
  24. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +31 -15
  25. package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +1 -1
  26. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +2 -17
  27. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +1 -1
  28. package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +6 -6
  29. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +30 -31
  30. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +1 -8
  31. package/dist/packages/ProductCard/ProductCardPrice/index.js +31 -27
  32. package/dist/packages/ProductCard/ProductCardVertical/index.js +15 -16
  33. package/dist/packages/ProductCard/index.js +1 -1
  34. package/dist/packages/ProductCardSeeMore/ProductCardSeeMore.js +1 -1
  35. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  36. package/dist/packages/Regionalization/Regionalization.js +13 -15
  37. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  38. package/dist/packages/Regionalization/context/RegionalizationContext.js +29 -31
  39. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +0 -1
  40. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  41. package/dist/packages/Regionalization/views/InitialView.js +26 -24
  42. package/dist/packages/Tour/Tour.js +1 -1
  43. package/dist/styles/product-card.global.css +1 -1
  44. package/dist/styles/regionalization.global.css +1 -1
  45. package/dist/types/ProductCard.d.ts +12 -13
  46. package/dist/utils/changerOrderModal.js +16 -13
  47. package/package.json +71 -69
  48. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.d.ts +0 -18
  49. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.js +0 -80
  50. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.d.ts +0 -10
  51. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.js +0 -61
  52. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.d.ts +0 -8
  53. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.js +0 -44
@@ -0,0 +1,45 @@
1
+ var R = Object.defineProperty;
2
+ var o = Object.getOwnPropertySymbols;
3
+ var b = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
4
+ var l = (e, a, t) => a in e ? R(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, p = (e, a) => {
5
+ for (var t in a || (a = {}))
6
+ b.call(a, t) && l(e, t, a[t]);
7
+ if (o)
8
+ for (var t of o(a))
9
+ m.call(a, t) && l(e, t, a[t]);
10
+ return e;
11
+ };
12
+ var c = (e, a) => {
13
+ var t = {};
14
+ for (var r in e)
15
+ b.call(e, r) && a.indexOf(r) < 0 && (t[r] = e[r]);
16
+ if (e != null && o)
17
+ for (var r of o(e))
18
+ a.indexOf(r) < 0 && m.call(e, r) && (t[r] = e[r]);
19
+ return t;
20
+ };
21
+ import n, { forwardRef as h } from "react";
22
+ import k from "../Loader/Loader.js";
23
+ const x = h(function(y, w) {
24
+ var s = y, { children: a, variant: t, inverse: r, size: i = "regular", testId: E = "fs-button", loading: f, loadingLabel: g, icon: u, iconPosition: d = "left", disabled: B } = s, v = c(s, ["children", "variant", "inverse", "size", "testId", "loading", "loadingLabel", "icon", "iconPosition", "disabled"]);
25
+ return n.createElement(
26
+ "button",
27
+ p({ ref: w, "data-fs-button": !0, "data-fs-button-inverse": r, "data-fs-button-size": i, "data-fs-button-loading": f, "data-fs-button-variant": t, disabled: B, "data-testid": E }, v),
28
+ n.createElement(
29
+ "div",
30
+ { "data-fs-button-wrapper": !0 },
31
+ f && n.createElement(
32
+ "p",
33
+ { "data-fs-button-loading-label": !0 },
34
+ g,
35
+ n.createElement(k, { variant: t === "primary" && !r ? "light" : "dark" })
36
+ ),
37
+ !!u && d === "left" && n.createElement("span", { "data-fs-button-icon": !0 }, u),
38
+ a && n.createElement("span", null, a),
39
+ !!u && d === "right" && n.createElement("span", { "data-fs-button-icon": !0 }, u)
40
+ )
41
+ );
42
+ }), j = x;
43
+ export {
44
+ j as default
45
+ };
@@ -0,0 +1,34 @@
1
+ var u = Object.defineProperty;
2
+ var d = Object.getOwnPropertySymbols;
3
+ var f = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
4
+ var s = (e, t, a) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, m = (e, t) => {
5
+ for (var a in t || (t = {}))
6
+ f.call(t, a) && s(e, a, t[a]);
7
+ if (d)
8
+ for (var a of d(t))
9
+ l.call(t, a) && s(e, a, t[a]);
10
+ return e;
11
+ };
12
+ var c = (e, t) => {
13
+ var a = {};
14
+ for (var r in e)
15
+ f.call(e, r) && t.indexOf(r) < 0 && (a[r] = e[r]);
16
+ if (e != null && d)
17
+ for (var r of d(e))
18
+ t.indexOf(r) < 0 && l.call(e, r) && (a[r] = e[r]);
19
+ return a;
20
+ };
21
+ import o, { forwardRef as p } from "react";
22
+ const E = p(function(L, i) {
23
+ var n = L, { testId: t = "fs-loader", variant: a = "dark" } = n, r = c(n, ["testId", "variant"]);
24
+ return o.createElement(
25
+ "span",
26
+ m({ ref: i, "data-fs-loader": !0, "data-fs-loader-variant": a, "data-testid": t }, r),
27
+ o.createElement("span", { "data-fs-loader-item": !0 }),
28
+ o.createElement("span", { "data-fs-loader-item": !0 }),
29
+ o.createElement("span", { "data-fs-loader-item": !0 })
30
+ );
31
+ }), v = E;
32
+ export {
33
+ v as default
34
+ };
@@ -0,0 +1,29 @@
1
+ var I = Object.defineProperty;
2
+ var r = Object.getOwnPropertySymbols;
3
+ var f = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
4
+ var c = (t, e, o) => e in t ? I(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, i = (t, e) => {
5
+ for (var o in e || (e = {}))
6
+ f.call(e, o) && c(t, o, e[o]);
7
+ if (r)
8
+ for (var o of r(e))
9
+ s.call(e, o) && c(t, o, e[o]);
10
+ return t;
11
+ };
12
+ var l = (t, e) => {
13
+ var o = {};
14
+ for (var n in t)
15
+ f.call(t, n) && e.indexOf(n) < 0 && (o[n] = t[n]);
16
+ if (t != null && r)
17
+ for (var n of r(t))
18
+ e.indexOf(n) < 0 && s.call(t, n) && (o[n] = t[n]);
19
+ return o;
20
+ };
21
+ import p, { forwardRef as R } from "react";
22
+ import g from "../../atoms/Button/Button.js";
23
+ const w = R(function(x, B) {
24
+ var a = x, { icon: e, children: o, testId: n = "fs-icon-button", "aria-label": b, size: d = "regular", variant: u } = a, m = l(a, ["icon", "children", "testId", "aria-label", "size", "variant"]);
25
+ return p.createElement(g, i({ ref: B, "data-fs-button": !0, "data-fs-icon-button": !0, variant: u != null ? u : "tertiary", icon: e, "aria-label": b, testId: n, size: d }, m), o);
26
+ }), $ = w;
27
+ export {
28
+ $ as default
29
+ };
@@ -15,7 +15,7 @@ import { Children as X, useState as m, useRef as D, useEffect as Y } from "react
15
15
  import Z from "./components/Bullets.js";
16
16
  import E from "./components/Arrows.js";
17
17
  import { DefaultProps as M } from "./utils/defaultProps.js";
18
- /* empty css */const rt = ({
18
+ /* empty css */const rt = ({
19
19
  children: s,
20
20
  id: r,
21
21
  bullet: t,
@@ -1,6 +1,6 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import { DiscountIcon as s } from "../../assets/svgs/DiscountIcon.js";
3
- /* empty css */const t = ({
3
+ /* empty css */const t = ({
4
4
  discount: a,
5
5
  participeLink: c,
6
6
  learnMoreLink: o,
@@ -1,8 +1,6 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  import { SelectedItemProps } from './components/ProductSelected';
3
3
  import { SimilarProducts as SimilarProductsProps } from '../../types/ChangeOrderModal';
4
- import { GetProductsSimilarsResponse } from './api/getProductsSimilars';
5
- import { PostChangeOrderMutationResponse } from './api/postChangeOrder';
6
4
 
7
5
  export interface ChangeOrderModalProps {
8
6
  postalCode: string;
@@ -13,17 +11,8 @@ export interface ChangeOrderModalProps {
13
11
  isClubClient?: boolean;
14
12
  orderFormId: string;
15
13
  saveSelectedSimilarProduct?: (similarProduct: SimilarProductsProps | undefined) => void;
16
- getOrderFormMutation?: (variables: {}) => Promise<CustomDataMutationResponse>;
17
- getProductsSimilarsMutation?: (variables: {}) => Promise<GetProductsSimilarsResponse>;
18
- postChangeOrderMutation?: (variables: {}) => Promise<PostChangeOrderMutationResponse>;
19
- }
20
- interface CustomDataMutationResponse {
21
- getOrderForm: {
22
- data: string;
23
- };
24
14
  }
25
15
  export interface idSubstitutionCriteriasProps {
26
16
  [key: string]: string;
27
17
  }
28
- export declare const ChangeOrderModal: ({ selectedItem, postalCode, orderFormId, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct, getOrderFormMutation, getProductsSimilarsMutation, postChangeOrderMutation }: ChangeOrderModalProps) => import("react/jsx-runtime").JSX.Element;
29
- export {};
18
+ export declare const ChangeOrderModal: ({ selectedItem, postalCode, orderFormId, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct }: ChangeOrderModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,116 +1,105 @@
1
- import { jsx as a, jsxs as E, Fragment as J } from "react/jsx-runtime";
2
- import { useState as f, useEffect as M } from "react";
3
- import { Modal as _ } from "../Modal/Modal.js";
4
- import { ProductSelected as v } from "./components/ProductSelected.js";
5
- import { SimilarProducts as L } from "./components/SimilarProducts.js";
6
- import { ModalFooter as T } from "./components/ModalFooter.js";
7
- /* empty css */import { getProductsSimilars as $ } from "./api/getProductsSimilars.js";
8
- import z from "../../hooks/useAnalitcsEvents.js";
9
- import { NoSimilarProduct as B } from "./components/NoSimilarProduct.js";
10
- import { getOrderForm as G } from "./api/getOrderForm.js";
11
- import { postChangeOrder as H } from "./api/postChangeOrder.js";
12
- import { Skeleton as K } from "../Skeleton/index.js";
13
- const ao = ({
1
+ import { jsx as n, jsxs as j, Fragment as q } from "react/jsx-runtime";
2
+ import { useState as e, useEffect as w } from "react";
3
+ import { Modal as M } from "../Modal/Modal.js";
4
+ import { ProductSelected as N } from "./components/ProductSelected.js";
5
+ import { SimilarProducts as k } from "./components/SimilarProducts.js";
6
+ import { ModalFooter as v } from "./components/ModalFooter.js";
7
+ /* empty css */import { Skeleton as A } from "@acctglobal/skeleton";
8
+ import { getProductsSimilars as E } from "./api/getProductsSimilars.js";
9
+ import _ from "../../hooks/useAnalitcsEvents.js";
10
+ import { NoSimilarProduct as J } from "./components/NoSimilarProduct.js";
11
+ import { getOrderForm as L } from "./api/getOrderForm.js";
12
+ import { postChangeOrder as T } from "./api/postChangeOrder.js";
13
+ const oo = ({
14
14
  selectedItem: o,
15
15
  postalCode: S,
16
- orderFormId: d,
17
- isClubClient: O,
16
+ orderFormId: f,
17
+ isClubClient: h,
18
18
  isOpen: y,
19
- environment: b,
20
- setIsOpen: p,
21
- saveSelectedSimilarProduct: c,
22
- getOrderFormMutation: l,
23
- getProductsSimilarsMutation: C,
24
- postChangeOrderMutation: F
19
+ environment: O,
20
+ setIsOpen: l,
21
+ saveSelectedSimilarProduct: m
25
22
  }) => {
26
- const [s, P] = f(), [x, m] = f(!1), r = b === "io", { genericTaggingEvent: N } = z(), [t, g] = f({ itemId: "" });
27
- M(() => {
23
+ const [u, b] = e(), [P, s] = e(!1), a = O === "io", { genericTaggingEvent: C } = _(), [r, p] = e({ itemId: "" });
24
+ return w(() => {
28
25
  (async () => {
29
- m(!0);
26
+ s(!0);
30
27
  try {
31
- const i = await $({
28
+ const t = await E({
32
29
  postalCode: S,
33
30
  selectedItem: o,
34
- isIO: r,
35
- getProductsSimilarsMutation: C
36
- }), u = (i == null ? void 0 : i.products) || [];
37
- P(u);
31
+ isIO: a
32
+ }), d = (t == null ? void 0 : t.products) || [];
33
+ b(d);
38
34
  } finally {
39
- m(!1);
35
+ s(!1);
40
36
  }
41
37
  })(), (async () => {
42
- var i, u;
43
- m(!0);
38
+ var t, d;
39
+ s(!0);
44
40
  try {
45
- const q = r && G(d, r), w = l && await l({
46
- input: {
47
- orderFormId: d
48
- }
49
- }) || { getOrderForm: { data: "" } }, e = r ? q : JSON.parse(w.getOrderForm.data), n = ((u = (i = e == null ? void 0 : e.customData) == null ? void 0 : i.customApps) == null ? void 0 : u.find(
50
- (A) => A.id === "janis"
41
+ const c = await L(f, a), i = ((d = (t = c == null ? void 0 : c.customData) == null ? void 0 : t.customApps) == null ? void 0 : d.find(
42
+ (x) => x.id === "janis"
51
43
  )) || null;
52
- let h = {};
53
- n != null && n.fields.idSubstitutionCriterias && (h = JSON.parse(
54
- n == null ? void 0 : n.fields.idSubstitutionCriterias
44
+ let g = {};
45
+ i != null && i.fields.idSubstitutionCriterias && (g = JSON.parse(
46
+ i == null ? void 0 : i.fields.idSubstitutionCriterias
55
47
  ));
56
- const k = o == null ? void 0 : o.productOriginId;
57
- g({
58
- itemId: `${h[k]}`
48
+ const F = o == null ? void 0 : o.productOriginId;
49
+ p({
50
+ itemId: `${g[F]}`
59
51
  });
60
52
  } finally {
61
- m(!1);
53
+ s(!1);
62
54
  }
63
55
  })();
64
- }, []);
65
- const j = () => {
66
- H(
67
- d,
68
- r,
69
- o.productOriginId,
70
- t.itemId,
71
- F
72
- ), t && (c == null || c(t), N("salvar_substituto", {
73
- name: o.name,
74
- replacement_item: t == null ? void 0 : t.name
75
- })), p(!1);
76
- };
77
- return /* @__PURE__ */ a(
78
- _,
56
+ }, []), /* @__PURE__ */ n(
57
+ M,
79
58
  {
80
59
  isOpen: y,
81
- setIsOpen: p,
60
+ setIsOpen: l,
82
61
  className: "change-order-modal",
83
62
  title: "Produto com estoque baixo",
84
- Footer: s && s.length > 0 && /* @__PURE__ */ a(
85
- T,
63
+ Footer: /* @__PURE__ */ n(
64
+ v,
86
65
  {
87
- saveSelectedSimilarProduct: j
66
+ saveSelectedSimilarProduct: () => {
67
+ T(
68
+ f,
69
+ a,
70
+ o.productOriginId,
71
+ r.itemId
72
+ ), r && (m == null || m(r), C("salvar_substituto", {
73
+ name: o.name,
74
+ replacement_item: r == null ? void 0 : r.name
75
+ })), l(!1);
76
+ }
88
77
  }
89
78
  ),
90
- children: x ? /* @__PURE__ */ a(
91
- K,
79
+ children: P ? /* @__PURE__ */ n(
80
+ A,
92
81
  {
93
- width: r ? "100%" : "90%",
94
- height: r ? 600 : 425,
82
+ width: a ? "100%" : "90%",
83
+ height: a ? 600 : 425,
95
84
  backgroundColor: "var(--color-grayScale-faded)",
96
85
  margin: "auto",
97
86
  animation: !0
98
87
  }
99
- ) : /* @__PURE__ */ E(J, { children: [
100
- o && /* @__PURE__ */ a(v, { selectedItem: o }),
101
- s && s.length > 0 ? /* @__PURE__ */ a(
102
- L,
88
+ ) : /* @__PURE__ */ j(q, { children: [
89
+ o && /* @__PURE__ */ n(N, { selectedItem: o }),
90
+ u && u.length > 0 ? /* @__PURE__ */ n(
91
+ k,
103
92
  {
104
- isClubClient: O,
105
- similarProductSelect: t,
106
- setSimilarProductSelect: g,
107
- products: s
93
+ isClubClient: h,
94
+ similarProductSelect: r,
95
+ setSimilarProductSelect: p,
96
+ products: u
108
97
  }
109
- ) : /* @__PURE__ */ a(B, {})
98
+ ) : /* @__PURE__ */ n(J, {})
110
99
  ] })
111
100
  }
112
101
  );
113
102
  };
114
103
  export {
115
- ao as ChangeOrderModal
104
+ oo as ChangeOrderModal
116
105
  };
@@ -1,12 +1,21 @@
1
- import e from "axios";
2
- const c = async (o, t) => {
1
+ import o from "axios";
2
+ const c = async (t, a) => {
3
3
  try {
4
- if (t) {
5
- const { data: r } = await e.post(
6
- `/api/checkout/pub/orderForm/${o}`
4
+ if (a) {
5
+ const { data: e } = await o.post(
6
+ `/api/checkout/pub/orderForm/${t}`
7
7
  );
8
- return r;
8
+ return e;
9
9
  }
10
+ const { data: r } = await o.post("/api/proxy", {
11
+ targetUrl: `/api/checkout/pub/orderForm/${t}`,
12
+ method: "GET",
13
+ headers: {
14
+ "Content-Type": "application/json",
15
+ Accept: "application/json"
16
+ }
17
+ });
18
+ return r;
10
19
  } catch (r) {
11
20
  console.error("Error in Change Order Modal", r);
12
21
  }
@@ -4,12 +4,9 @@ interface GetProductsSimilarsProps {
4
4
  postalCode: string;
5
5
  isIO: boolean;
6
6
  selectedItem: SelectedItemProps;
7
- getProductsSimilarsMutation?: (variables: {}) => Promise<GetProductsSimilarsResponse>;
8
7
  }
9
- export interface GetProductsSimilarsResponse {
10
- getProductsSimilars: {
11
- data: string;
12
- };
13
- }
14
- export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem, getProductsSimilarsMutation }: GetProductsSimilarsProps) => Promise<any>;
8
+ export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem }: GetProductsSimilarsProps) => Promise<{
9
+ productOrigin: string;
10
+ products: import('../../../main').SimilarProducts[];
11
+ } | undefined>;
15
12
  export {};
@@ -1,34 +1,33 @@
1
- import c from "axios";
2
- const P = async ({
3
- postalCode: n,
4
- isIO: u,
5
- selectedItem: r,
6
- getProductsSimilarsMutation: a
1
+ import n from "axios";
2
+ const O = async ({
3
+ postalCode: a,
4
+ isIO: p,
5
+ selectedItem: r
7
6
  }) => {
8
7
  try {
9
- if (u) {
10
- const { data: o } = await c.get(
11
- `/_v/commerce/products/productsSimilar?postalCode=${n}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
12
- ), { similarProducts: p } = o;
13
- return p.find(
14
- (s) => s.productOrigin === (r == null ? void 0 : r.productOriginId)
8
+ if (p) {
9
+ const { data: o } = await n.get(
10
+ `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
11
+ ), { similarProducts: u } = o;
12
+ return u.find(
13
+ (c) => c.productOrigin === (r == null ? void 0 : r.productOriginId)
15
14
  );
16
15
  }
17
- const i = a && await a({
18
- input: {
19
- postalCode: n,
20
- productOriginId: r == null ? void 0 : r.productOriginId
16
+ const { data: i } = await n.post("/api/proxy", {
17
+ targetUrl: `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`,
18
+ method: "GET",
19
+ headers: {
20
+ "Content-Type": "application/json",
21
+ Accept: "application/json"
21
22
  }
22
- });
23
- return i ? JSON.parse(
24
- i == null ? void 0 : i.getProductsSimilars.data
25
- ).similarProducts.find(
23
+ }), { similarProducts: s } = i;
24
+ return s.find(
26
25
  (o) => o.productOrigin === r.productOriginId
27
- ) : void 0;
26
+ );
28
27
  } catch (i) {
29
28
  console.error("Error in Change Order Modal", i);
30
29
  }
31
30
  };
32
31
  export {
33
- P as getProductsSimilars
32
+ O as getProductsSimilars
34
33
  };
@@ -1,6 +1 @@
1
- export interface PostChangeOrderMutationResponse {
2
- postChangeOrder: {
3
- data: string;
4
- };
5
- }
6
- export declare const postChangeOrder: (orderFormId: string, isIO: boolean, skuId: string, substitutionId: string, postChangeOrderMutation?: (variables: {}) => Promise<PostChangeOrderMutationResponse>) => Promise<any>;
1
+ export declare const postChangeOrder: (orderFormId: string, isIO: boolean, skuId: string, substitutionId: string) => Promise<any>;
@@ -1,26 +1,32 @@
1
- import s from "axios";
2
- const p = async (o, e, n, c, t) => {
1
+ import o from "axios";
2
+ const s = async (e, t, a, n) => {
3
3
  try {
4
4
  const r = {
5
- orderFormId: o,
6
- skuId: n,
7
- substitutionId: c
5
+ orderFormId: e,
6
+ skuId: a,
7
+ substitutionId: n
8
8
  };
9
- if (e) {
10
- const { data: d } = await s.post(
9
+ if (t) {
10
+ const { data: d } = await o.post(
11
11
  "/_v/commerce/orderform/changeOrder",
12
12
  r
13
13
  );
14
14
  return d;
15
15
  }
16
- const a = t && await t({
17
- input: r
16
+ const { data: c } = await o.post("/api/proxy", {
17
+ targetUrl: "/_v/commerce/orderform/changeOrder",
18
+ method: "POST",
19
+ headers: {
20
+ "Content-Type": "application/json",
21
+ Accept: "application/json"
22
+ },
23
+ body: r
18
24
  });
19
- return a ? JSON.parse(a == null ? void 0 : a.postChangeOrder.data) : void 0;
25
+ return c;
20
26
  } catch (r) {
21
27
  console.error("Error in Change Order Modal", r);
22
28
  }
23
29
  };
24
30
  export {
25
- p as postChangeOrder
31
+ s as postChangeOrder
26
32
  };
@@ -12,9 +12,6 @@ interface CouponsProps {
12
12
  disableFirstEmptyModal?: boolean;
13
13
  couponsList?: CouponType[];
14
14
  qtdCouponsView?: number;
15
- getCouponsMutation?: any;
16
- addCouponMutation?: any;
17
- removeCouponMutation?: any;
18
15
  }
19
- export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView, getCouponsMutation, addCouponMutation, removeCouponMutation }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
20
17
  export {};