@azzas/azzas-tracker-web 2.0.0-preview.13 → 2.0.0-preview.15

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/mod.cjs CHANGED
@@ -1094,18 +1094,18 @@ var PROD_DOMAINS = {
1094
1094
  }
1095
1095
  };
1096
1096
  async function getUserInfo(context) {
1097
- var _a, _b, _c, _d, _e;
1098
- const domain = (_a = PROD_DOMAINS[context.account || "animale"]) == null ? void 0 : _a[context.platform || "store"];
1099
- if (!domain) return { customer: { email: context.userEmail, id: context == null ? void 0 : context.userId }, address: null };
1097
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I;
1098
+ const domain = (_e = PROD_DOMAINS[(_b = (_a = context == null ? void 0 : context.meta) == null ? void 0 : _a.user_info) == null ? void 0 : _b.account]) == null ? void 0 : _e[(_d = (_c = context == null ? void 0 : context.meta) == null ? void 0 : _c.user_info) == null ? void 0 : _d.platform];
1099
+ if (!domain) return { customer: { email: (_g = (_f = context == null ? void 0 : context.meta) == null ? void 0 : _f.user_info) == null ? void 0 : _g.userEmail, id: (_i = (_h = context == null ? void 0 : context.meta) == null ? void 0 : _h.user_info) == null ? void 0 : _i.userId }, address: null };
1100
1100
  try {
1101
1101
  const api = `${domain}/_v/user-info`;
1102
1102
  const response = await fetch(api, {
1103
1103
  method: "POST",
1104
- body: JSON.stringify({ email: context.userEmail })
1104
+ body: JSON.stringify({ email: (_k = (_j = context == null ? void 0 : context.meta) == null ? void 0 : _j.user_info) == null ? void 0 : _k.userEmail })
1105
1105
  });
1106
1106
  if (response.status !== 200) {
1107
- if ((context == null ? void 0 : context.manuallyInfo) && ((_b = context.manuallyInfo) == null ? void 0 : _b.cpf)) {
1108
- const { cpf, birthDate, phone, firstName, lastName, email, email_optin } = context.manuallyInfo;
1107
+ if (((_m = (_l = context == null ? void 0 : context.meta) == null ? void 0 : _l.user_info) == null ? void 0 : _m.manuallyInfo) && ((_p = (_o = (_n = context == null ? void 0 : context.meta) == null ? void 0 : _n.user_info) == null ? void 0 : _o.manuallyInfo) == null ? void 0 : _p.cpf)) {
1108
+ const { cpf, birthDate, phone, firstName, lastName, email, email_optin } = (_r = (_q = context == null ? void 0 : context.meta) == null ? void 0 : _q.user_info) == null ? void 0 : _r.manuallyInfo;
1109
1109
  const document3 = cpf == null ? void 0 : cpf.replace(/\D/g, "");
1110
1110
  const hashedDocument2 = await documentToHash(document3);
1111
1111
  return {
@@ -1123,15 +1123,15 @@ async function getUserInfo(context) {
1123
1123
  }
1124
1124
  };
1125
1125
  }
1126
- return { customer: { email: context.userEmail, id: context == null ? void 0 : context.userId }, address: null };
1126
+ return { customer: { email: (_t = (_s = context == null ? void 0 : context.meta) == null ? void 0 : _s.user_info) == null ? void 0 : _t.userEmail, id: (_v = (_u = context == null ? void 0 : context.meta) == null ? void 0 : _u.user_info) == null ? void 0 : _v.userId }, address: null };
1127
1127
  }
1128
1128
  const res = await response.json();
1129
- const document2 = (_d = (_c = res == null ? void 0 : res.customer) == null ? void 0 : _c.document) == null ? void 0 : _d.replace(/\D/g, "");
1129
+ const document2 = (_x = (_w = res == null ? void 0 : res.customer) == null ? void 0 : _w.document) == null ? void 0 : _x.replace(/\D/g, "");
1130
1130
  const hashedDocument = await documentToHash(document2);
1131
1131
  return { ...res, customer: { ...res.customer, cpf: hashedDocument, document: document2 } };
1132
1132
  } catch (_) {
1133
- if ((context == null ? void 0 : context.manuallyInfo) && ((_e = context.manuallyInfo) == null ? void 0 : _e.cpf)) {
1134
- const { cpf, birthDate, phone, firstName, lastName, email, email_optin } = context.manuallyInfo;
1133
+ if (((_z = (_y = context == null ? void 0 : context.meta) == null ? void 0 : _y.user_info) == null ? void 0 : _z.manuallyInfo) && ((_C = (_B = (_A = context == null ? void 0 : context.meta) == null ? void 0 : _A.user_info) == null ? void 0 : _B.manuallyInfo) == null ? void 0 : _C.cpf)) {
1134
+ const { cpf, birthDate, phone, firstName, lastName, email, email_optin } = (_E = (_D = context == null ? void 0 : context.meta) == null ? void 0 : _D.user_info) == null ? void 0 : _E.manuallyInfo;
1135
1135
  const document2 = cpf == null ? void 0 : cpf.replace(/\D/g, "");
1136
1136
  const hashedDocument = await documentToHash(document2);
1137
1137
  return {
@@ -1149,7 +1149,7 @@ async function getUserInfo(context) {
1149
1149
  }
1150
1150
  };
1151
1151
  }
1152
- return { customer: { email: context.userEmail, id: context == null ? void 0 : context.userId }, address: null };
1152
+ return { customer: { email: (_G = (_F = context == null ? void 0 : context.meta) == null ? void 0 : _F.user_info) == null ? void 0 : _G.userEmail, id: (_I = (_H = context == null ? void 0 : context.meta) == null ? void 0 : _H.user_info) == null ? void 0 : _I.userId }, address: null };
1153
1153
  }
1154
1154
  }
1155
1155
 
@@ -1531,7 +1531,7 @@ var decoAdapter = {
1531
1531
  line_items: (context) => {
1532
1532
  if (context == null ? void 0 : context.line_items) return context.line_items;
1533
1533
  if (context == null ? void 0 : context.products) {
1534
- return context.products.map((item) => item == null ? void 0 : item.inProductGroupWithID).filter((id) => Boolean(id));
1534
+ return context.products.map((item) => item == null ? void 0 : item.inProductGroupWithID).filter((id) => Boolean(id)).join();
1535
1535
  }
1536
1536
  return null;
1537
1537
  },
@@ -1640,7 +1640,7 @@ var HeadlessPdpZone = {
1640
1640
  line_items: (context) => {
1641
1641
  if (context == null ? void 0 : context.line_items) return context.line_items;
1642
1642
  if (context == null ? void 0 : context.products) {
1643
- return context.products.map((item) => item.productId).filter((id) => Boolean(id));
1643
+ return context.products.map((item) => item.productId).filter((id) => Boolean(id)).join();
1644
1644
  }
1645
1645
  return null;
1646
1646
  },
@@ -1699,7 +1699,7 @@ var HeadlessPdcZone = {
1699
1699
  line_items: (context) => {
1700
1700
  if (context == null ? void 0 : context.line_items) return context.line_items;
1701
1701
  if (context == null ? void 0 : context.products) {
1702
- return context.products.map((item) => item.id).filter((id) => Boolean(id));
1702
+ return context.products.map((item) => item.id).filter((id) => Boolean(id)).join();
1703
1703
  }
1704
1704
  return null;
1705
1705
  },
@@ -1887,7 +1887,7 @@ var orderFormAdapter = {
1887
1887
  var _a;
1888
1888
  if (context == null ? void 0 : context.line_items) return context.line_items;
1889
1889
  if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
1890
- return getOrderFormItems(context.orderForm).map((item) => item == null ? void 0 : item.productId).filter((id) => Boolean(id));
1890
+ return getOrderFormItems(context.orderForm).map((item) => item == null ? void 0 : item.productId).filter((id) => Boolean(id)).join();
1891
1891
  },
1892
1892
  value: (context) => {
1893
1893
  var _a;