@azzas/azzas-tracker-web 2.0.2-preview.5 → 2.0.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/mod.cjs CHANGED
@@ -1131,6 +1131,10 @@ var PROD_DOMAINS = {
1131
1131
  "lojafabula": {
1132
1132
  "store": "https://lojafabula.myvtex.com",
1133
1133
  "checkout": "https://secure.lojafabula.com.br"
1134
+ },
1135
+ "lojausereserva": {
1136
+ "store": "https://lojausereserva.myvtex.com",
1137
+ "checkout": "https://lojausereserva.myvtex.com"
1134
1138
  }
1135
1139
  };
1136
1140
  async function getUserInfo(context) {
@@ -1143,6 +1147,7 @@ async function getUserInfo(context) {
1143
1147
  method: "POST",
1144
1148
  body: JSON.stringify({ email: (_k = (_j = context == null ? void 0 : context.meta) == null ? void 0 : _j.user_info) == null ? void 0 : _k.userEmail })
1145
1149
  });
1150
+ console.log("[DT] status info: ", response.status);
1146
1151
  if (response.status !== 200) {
1147
1152
  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)) {
1148
1153
  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;
@@ -1973,7 +1978,7 @@ var getItemCategory7 = (item) => {
1973
1978
  };
1974
1979
  var getItemCategory25 = (item) => {
1975
1980
  var _a, _b;
1976
- const AVOID_CATEGORIES = /outlet|bazar|sale/i;
1981
+ const AVOID_CATEGORIES = /outlet|bazar|sale|coleção|promoção/i;
1977
1982
  const categories = Object.values((_a = item == null ? void 0 : item.productCategories) != null ? _a : {});
1978
1983
  const validHierarchy = categories.map((c) => c.trim()).filter((c) => c && !AVOID_CATEGORIES.test(c));
1979
1984
  const deepest = (_b = validHierarchy[validHierarchy.length - 1]) != null ? _b : "";
@@ -2012,28 +2017,28 @@ var orderFormAdapter = {
2012
2017
  if (context == null ? void 0 : context.items) return context.items;
2013
2018
  if ((context == null ? void 0 : context.orderForm) && (context == null ? void 0 : context.orderForm.items)) {
2014
2019
  return getOrderFormItems(context.orderForm).map((item, index) => {
2015
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
2020
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
2016
2021
  const color = context.brand === "carolbassi" ? null : (_c = (_b = (_a = item == null ? void 0 : item.skuName) == null ? void 0 : _a.split(" - ")[0]) == null ? void 0 : _b.split("_").pop()) == null ? void 0 : _c.trim();
2017
2022
  const size = context.brand === "carolbassi" ? item == null ? void 0 : item.skuName : (_e = (_d = item == null ? void 0 : item.skuName) == null ? void 0 : _d.split(" - ")[1]) == null ? void 0 : _e.trim();
2018
2023
  return {
2019
2024
  quantity: (_f = item == null ? void 0 : item.quantity) != null ? _f : 1,
2020
2025
  index: (_h = (_g = context == null ? void 0 : context.orderForm) == null ? void 0 : _g.index) != null ? _h : index + 1,
2021
- item_brand: (_j = (_i = item.additionalInfo) == null ? void 0 : _i.brandName) != null ? _j : null,
2022
- item_name: (_k = item == null ? void 0 : item.name.replace(item == null ? void 0 : item.skuName, "").trim()) != null ? _k : null,
2026
+ item_brand: (_k = (_j = (_i = item.additionalInfo) == null ? void 0 : _i.brandName) == null ? void 0 : _j.toLowerCase()) != null ? _k : null,
2027
+ item_name: (_l = item == null ? void 0 : item.name.replace(item == null ? void 0 : item.skuName, "").trim()) != null ? _l : null,
2023
2028
  price: (item == null ? void 0 : item.sellingPrice) / 100,
2024
2029
  discount: ((item == null ? void 0 : item.listPrice) - (item == null ? void 0 : item.sellingPrice)) / 100,
2025
2030
  item_variant: color != null ? color : null,
2026
2031
  item_variant2: size != null ? size : null,
2027
2032
  item_shipping_tier: getItemShippingTier2(context.orderForm, item),
2028
2033
  item_ref: (item == null ? void 0 : item.productRefId) || (item == null ? void 0 : item.refId.replace(/_\d+$/, "")) || null,
2029
- item_category: (_l = getItemCategory7(item)) != null ? _l : null,
2030
- item_category2: (_m = getItemCategory25(item)) != null ? _m : null,
2031
- item_id: (_n = item == null ? void 0 : item.productId) != null ? _n : null,
2032
- item_sku: (_o = item == null ? void 0 : item.id) != null ? _o : null,
2033
- item_url: (_p = item.detailUrl) != null ? _p : null,
2034
- image_url: (_q = resizeVtexImage2(item.imageUrl)) != null ? _q : null,
2035
- seller_id: (_r = item == null ? void 0 : item.seller) != null ? _r : null,
2036
- item_list_name: (_t = (_s = context == null ? void 0 : context.orderForm) == null ? void 0 : _s.item_list_name) != null ? _t : null
2034
+ item_category: (_m = getItemCategory7(item)) != null ? _m : null,
2035
+ item_category2: (_n = getItemCategory25(item)) != null ? _n : null,
2036
+ item_id: (_o = item == null ? void 0 : item.productId) != null ? _o : null,
2037
+ item_sku: (_p = item == null ? void 0 : item.id) != null ? _p : null,
2038
+ item_url: (_q = item.detailUrl) != null ? _q : null,
2039
+ image_url: (_r = resizeVtexImage2(item.imageUrl)) != null ? _r : null,
2040
+ seller_id: (_s = item == null ? void 0 : item.seller) != null ? _s : null,
2041
+ item_list_name: (_u = (_t = context == null ? void 0 : context.orderForm) == null ? void 0 : _t.item_list_name) != null ? _u : null
2037
2042
  };
2038
2043
  });
2039
2044
  }