@azzas/azzas-tracker-web 2.0.1-preview.0 → 2.0.1-preview.1

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
@@ -1086,6 +1086,9 @@ var PROD_DOMAINS = {
1086
1086
  "store": "https://lojaoffpremium.myvtex.com",
1087
1087
  "checkout": "https://secure.offpremium.com.br"
1088
1088
  },
1089
+ "carolbassi": {
1090
+ "store": "https://carolbassi.myvtex.com"
1091
+ },
1089
1092
  "bynv": {
1090
1093
  "store": "https://bynv.myvtex.com"
1091
1094
  },
@@ -1594,31 +1597,29 @@ var reservaAdapter = {
1594
1597
  if (context == null ? void 0 : context.items) return context.items;
1595
1598
  if (context == null ? void 0 : context.products) {
1596
1599
  return context.products.map((item) => {
1597
- 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;
1598
- const COLOR_REGEX = /^[^_]+_/;
1600
+ 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;
1599
1601
  const listPrice = (_b = (_a = item == null ? void 0 : item.offers) == null ? void 0 : _a.offers) == null ? void 0 : _b[0].listPrice;
1600
- const refIdValue = (_e = (_d = (_c = item.additionalProperty) == null ? void 0 : _c.find((i) => i.name === "RefId")) == null ? void 0 : _d.value) == null ? void 0 : _e.replace(/_\d+$/, "");
1601
1602
  return {
1602
1603
  quantity: 1,
1603
- index: (_f = item == null ? void 0 : item.index) != null ? _f : 0,
1604
- item_brand: (_i = (_h = (_g = item.brand) == null ? void 0 : _g.name) == null ? void 0 : _h.toLowerCase()) != null ? _i : null,
1605
- item_name: (_j = item.isVariantOf.name) != null ? _j : null,
1606
- price: (_l = (_k = item.offers) == null ? void 0 : _k.lowPrice) != null ? _l : null,
1607
- discount: Math.round((Number(listPrice) - Number((_m = item == null ? void 0 : item.offers) == null ? void 0 : _m.lowPrice)) * 100) / 100,
1608
- item_variant: ((_o = (_n = item == null ? void 0 : item.name) == null ? void 0 : _n.split(" - ")[0]) == null ? void 0 : _o.replace(COLOR_REGEX, "").replace(/_/g, " ")) || null,
1604
+ index: (_c = item == null ? void 0 : item.index) != null ? _c : 0,
1605
+ item_brand: (_f = (_e = (_d = item.brand) == null ? void 0 : _d.name) == null ? void 0 : _e.toLowerCase()) != null ? _f : null,
1606
+ item_name: (_g = item.isVariantOf.name) != null ? _g : null,
1607
+ price: (_i = (_h = item.offers) == null ? void 0 : _h.lowPrice) != null ? _i : null,
1608
+ discount: Math.round((Number(listPrice) - Number((_j = item == null ? void 0 : item.offers) == null ? void 0 : _j.lowPrice)) * 100) / 100,
1609
+ item_variant: ((_l = (_k = item == null ? void 0 : item.name) == null ? void 0 : _k.split(" - ")[0]) == null ? void 0 : _l.replace(/^[^_]+_/, "").replace(/_/g, " ")) || null,
1609
1610
  // cor
1610
- item_variant2: (_q = (_p = item == null ? void 0 : item.name) == null ? void 0 : _p.split(" - ")[1]) != null ? _q : null,
1611
+ item_variant2: (_n = (_m = item == null ? void 0 : item.name) == null ? void 0 : _m.split(" - ")[1]) != null ? _n : null,
1611
1612
  // tamanho
1612
1613
  item_shipping_tier: "",
1613
- item_ref: refIdValue != null ? refIdValue : null,
1614
- item_category: (_r = getItemCategory5(item)) != null ? _r : null,
1615
- item_category2: (_s = getItemCategory23(item)) != null ? _s : null,
1616
- item_id: (_t = item == null ? void 0 : item.id) != null ? _t : null,
1617
- item_sku: (_u = item == null ? void 0 : item.sku) != null ? _u : null,
1618
- item_url: (_w = (_v = item == null ? void 0 : item.seo) == null ? void 0 : _v.canonical) != null ? _w : null,
1619
- image_url: (_y = resizeVtexImage2((_x = item == null ? void 0 : item.image) == null ? void 0 : _x[0].url)) != null ? _y : null,
1620
- seller_id: (_D = (_C = (_B = (_A = (_z = item.offers) == null ? void 0 : _z.offers) == null ? void 0 : _A[0]) == null ? void 0 : _B.seller) == null ? void 0 : _C.identifier) != null ? _D : null,
1621
- item_list_name: (_E = item == null ? void 0 : item.item_list_name) != null ? _E : null
1614
+ item_ref: (_o = item.groupRefId) != null ? _o : null,
1615
+ item_category: (_p = getItemCategory5(item)) != null ? _p : null,
1616
+ item_category2: (_q = getItemCategory23(item)) != null ? _q : null,
1617
+ item_id: (_r = item == null ? void 0 : item.id) != null ? _r : null,
1618
+ item_sku: (_s = item == null ? void 0 : item.sku) != null ? _s : null,
1619
+ item_url: (_u = (_t = item == null ? void 0 : item.seo) == null ? void 0 : _t.canonical) != null ? _u : null,
1620
+ image_url: (_w = resizeVtexImage2((_v = item == null ? void 0 : item.image) == null ? void 0 : _v[0].url)) != null ? _w : null,
1621
+ seller_id: (_B = (_A = (_z = (_y = (_x = item.offers) == null ? void 0 : _x.offers) == null ? void 0 : _y[0]) == null ? void 0 : _z.seller) == null ? void 0 : _A.identifier) != null ? _B : null,
1622
+ item_list_name: (_C = item == null ? void 0 : item.item_list_name) != null ? _C : null
1622
1623
  };
1623
1624
  });
1624
1625
  }
@@ -2022,13 +2023,10 @@ var orderFormAdapter = {
2022
2023
  total_discount: (context) => {
2023
2024
  var _a, _b, _c;
2024
2025
  if (context == null ? void 0 : context.total_discount) return context.total_discount;
2025
- const orderForm = context == null ? void 0 : context.orderForm;
2026
- const items = orderForm == null ? void 0 : orderForm.items;
2027
- if (!(items == null ? void 0 : items.length) || typeof (orderForm == null ? void 0 : orderForm.value) !== "number") return null;
2028
- const itemsFullValue = items.reduce((acc, item) => acc + item.listPrice * item.quantity, 0);
2029
- const shipping = (_c = (_b = (_a = orderForm == null ? void 0 : orderForm.totalizers) == null ? void 0 : _a.find((t) => t.id === "Shipping")) == null ? void 0 : _b.value) != null ? _c : 0;
2030
- const derived = itemsFullValue + shipping - orderForm.value;
2031
- return derived > 0 ? derived / 100 : null;
2026
+ if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
2027
+ const totalizers = (_b = context == null ? void 0 : context.orderForm) == null ? void 0 : _b.totalizers;
2028
+ const productDiscount = ((_c = totalizers.find((t) => t.id === "Discounts")) == null ? void 0 : _c.value) || 0;
2029
+ return Math.abs(productDiscount) / 100 || null;
2032
2030
  },
2033
2031
  subtotal: (context) => {
2034
2032
  var _a, _b;