@azzas/azzas-tracker-web 2.0.0-preview.21 → 2.0.0-preview.23
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 +18 -16
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.global.js +18 -16
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +18 -16
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +15 -13
- package/package.json +1 -1
package/dist/mod.vtex.global.js
CHANGED
|
@@ -2659,8 +2659,8 @@ var AzzasTracker = function() {
|
|
|
2659
2659
|
if (context === null || context === void 0 ? void 0 : context.items) return context.items;
|
|
2660
2660
|
if (context === null || context === void 0 ? void 0 : context.products) {
|
|
2661
2661
|
return context.products.map(function(item) {
|
|
2662
|
-
var _ref, _ref1,
|
|
2663
|
-
var _item_offers_offers, _item_offers, _item_additionalProperty_find_value, _item_additionalProperty_find, _item_additionalProperty, _item_brand_name, _item_brand, _item_offers1, _item_offers2, _item_name_split_,
|
|
2662
|
+
var _ref, _ref1, _item_isVariantOf_name, _ref2, _ref3, _getItemCategory5, _getItemCategory23, _ref4, _ref5, _ref6, _resizeVtexImage2, _ref7, _ref8;
|
|
2663
|
+
var _item_offers_offers, _item_offers, _item_additionalProperty_find_value, _item_additionalProperty_find, _item_additionalProperty, _item_brand_name, _item_brand, _item_offers1, _item_offers2, _item_name_split_, _item_name, _item_name1, _item_seo, _item_image, _item_offers_offers__seller, _item_offers_offers_, _item_offers_offers1, _item_offers3;
|
|
2664
2664
|
var COLOR_REGEX = /^[^_]+_/;
|
|
2665
2665
|
var listPrice = item === null || item === void 0 ? void 0 : (_item_offers = item.offers) === null || _item_offers === void 0 ? void 0 : (_item_offers_offers = _item_offers.offers) === null || _item_offers_offers === void 0 ? void 0 : _item_offers_offers[0].listPrice;
|
|
2666
2666
|
var refIdValue = (_item_additionalProperty = item.additionalProperty) === null || _item_additionalProperty === void 0 ? void 0 : (_item_additionalProperty_find = _item_additionalProperty.find(function(i) {
|
|
@@ -2670,12 +2670,12 @@ var AzzasTracker = function() {
|
|
|
2670
2670
|
quantity: 1,
|
|
2671
2671
|
index: (_ref = item === null || item === void 0 ? void 0 : item.index) !== null && _ref !== void 0 ? _ref : 0,
|
|
2672
2672
|
item_brand: (_ref1 = (_item_brand = item.brand) === null || _item_brand === void 0 ? void 0 : (_item_brand_name = _item_brand.name) === null || _item_brand_name === void 0 ? void 0 : _item_brand_name.toLowerCase()) !== null && _ref1 !== void 0 ? _ref1 : null,
|
|
2673
|
-
item_name: (
|
|
2673
|
+
item_name: (_item_isVariantOf_name = item.isVariantOf.name) !== null && _item_isVariantOf_name !== void 0 ? _item_isVariantOf_name : null,
|
|
2674
2674
|
price: (_ref2 = (_item_offers1 = item.offers) === null || _item_offers1 === void 0 ? void 0 : _item_offers1.lowPrice) !== null && _ref2 !== void 0 ? _ref2 : null,
|
|
2675
2675
|
discount: Math.round((Number(listPrice) - Number(item === null || item === void 0 ? void 0 : (_item_offers2 = item.offers) === null || _item_offers2 === void 0 ? void 0 : _item_offers2.lowPrice)) * 100) / 100,
|
|
2676
|
-
item_variant: (item === null || item === void 0 ? void 0 : (
|
|
2676
|
+
item_variant: (item === null || item === void 0 ? void 0 : (_item_name = item.name) === null || _item_name === void 0 ? void 0 : (_item_name_split_ = _item_name.split(" - ")[0]) === null || _item_name_split_ === void 0 ? void 0 : _item_name_split_.replace(COLOR_REGEX, "").replace(/_/g, " ")) || null,
|
|
2677
2677
|
// cor
|
|
2678
|
-
item_variant2: (_ref3 = item === null || item === void 0 ? void 0 : (
|
|
2678
|
+
item_variant2: (_ref3 = item === null || item === void 0 ? void 0 : (_item_name1 = item.name) === null || _item_name1 === void 0 ? void 0 : _item_name1.split(" - ")[1]) !== null && _ref3 !== void 0 ? _ref3 : null,
|
|
2679
2679
|
// tamanho
|
|
2680
2680
|
item_shipping_tier: "",
|
|
2681
2681
|
item_ref: refIdValue !== null && refIdValue !== void 0 ? refIdValue : null,
|
|
@@ -3088,8 +3088,10 @@ var AzzasTracker = function() {
|
|
|
3088
3088
|
if (context === null || context === void 0 ? void 0 : context.items) return context.items;
|
|
3089
3089
|
if ((context === null || context === void 0 ? void 0 : context.orderForm) && (context === null || context === void 0 ? void 0 : context.orderForm.items)) {
|
|
3090
3090
|
return getOrderFormItems(context.orderForm).map(function(item, index) {
|
|
3091
|
-
var _ref, _ref1, _ref2, _ref3,
|
|
3092
|
-
var
|
|
3091
|
+
var _ref, _ref1, _ref2, _ref3, _getItemCategory7, _getItemCategory25, _ref4, _ref5, _item_detailUrl, _resizeVtexImage2, _ref6, _ref7;
|
|
3092
|
+
var _item_skuName_split__split_pop, _item_skuName_split_, _item_skuName, _item_skuName_split_1, _item_skuName1, _context_orderForm, _item_additionalInfo, _context_orderForm1;
|
|
3093
|
+
var color = context.brand === "carolbassi" ? null : item === null || item === void 0 ? void 0 : (_item_skuName = item.skuName) === null || _item_skuName === void 0 ? void 0 : (_item_skuName_split_ = _item_skuName.split(" - ")[0]) === null || _item_skuName_split_ === void 0 ? void 0 : (_item_skuName_split__split_pop = _item_skuName_split_.split("_").pop()) === null || _item_skuName_split__split_pop === void 0 ? void 0 : _item_skuName_split__split_pop.trim();
|
|
3094
|
+
var size = context.brand === "carolbassi" ? item === null || item === void 0 ? void 0 : item.skuName : item === null || item === void 0 ? void 0 : (_item_skuName1 = item.skuName) === null || _item_skuName1 === void 0 ? void 0 : (_item_skuName_split_1 = _item_skuName1.split(" - ")[1]) === null || _item_skuName_split_1 === void 0 ? void 0 : _item_skuName_split_1.trim();
|
|
3093
3095
|
return {
|
|
3094
3096
|
quantity: (_ref = item === null || item === void 0 ? void 0 : item.quantity) !== null && _ref !== void 0 ? _ref : 1,
|
|
3095
3097
|
index: (_ref1 = context === null || context === void 0 ? void 0 : (_context_orderForm = context.orderForm) === null || _context_orderForm === void 0 ? void 0 : _context_orderForm.index) !== null && _ref1 !== void 0 ? _ref1 : index + 1,
|
|
@@ -3097,18 +3099,18 @@ var AzzasTracker = function() {
|
|
|
3097
3099
|
item_name: (_ref3 = item === null || item === void 0 ? void 0 : item.name.replace(item === null || item === void 0 ? void 0 : item.skuName, "").trim()) !== null && _ref3 !== void 0 ? _ref3 : null,
|
|
3098
3100
|
price: (item === null || item === void 0 ? void 0 : item.sellingPrice) / 100,
|
|
3099
3101
|
discount: ((item === null || item === void 0 ? void 0 : item.listPrice) - (item === null || item === void 0 ? void 0 : item.sellingPrice)) / 100,
|
|
3100
|
-
item_variant:
|
|
3101
|
-
item_variant2:
|
|
3102
|
+
item_variant: color !== null && color !== void 0 ? color : null,
|
|
3103
|
+
item_variant2: size !== null && size !== void 0 ? size : null,
|
|
3102
3104
|
item_shipping_tier: getItemShippingTier2(context.orderForm, item),
|
|
3103
3105
|
item_ref: (item === null || item === void 0 ? void 0 : item.productRefId) || (item === null || item === void 0 ? void 0 : item.refId.replace(/_\d+$/, "")) || null,
|
|
3104
3106
|
item_category: (_getItemCategory7 = getItemCategory7(item)) !== null && _getItemCategory7 !== void 0 ? _getItemCategory7 : null,
|
|
3105
3107
|
item_category2: (_getItemCategory25 = getItemCategory25(item)) !== null && _getItemCategory25 !== void 0 ? _getItemCategory25 : null,
|
|
3106
|
-
item_id: (
|
|
3107
|
-
item_sku: (
|
|
3108
|
+
item_id: (_ref4 = item === null || item === void 0 ? void 0 : item.productId) !== null && _ref4 !== void 0 ? _ref4 : null,
|
|
3109
|
+
item_sku: (_ref5 = item === null || item === void 0 ? void 0 : item.id) !== null && _ref5 !== void 0 ? _ref5 : null,
|
|
3108
3110
|
item_url: (_item_detailUrl = item.detailUrl) !== null && _item_detailUrl !== void 0 ? _item_detailUrl : null,
|
|
3109
3111
|
image_url: (_resizeVtexImage2 = resizeVtexImage2(item.imageUrl)) !== null && _resizeVtexImage2 !== void 0 ? _resizeVtexImage2 : null,
|
|
3110
|
-
seller_id: (
|
|
3111
|
-
item_list_name: (
|
|
3112
|
+
seller_id: (_ref6 = item === null || item === void 0 ? void 0 : item.seller) !== null && _ref6 !== void 0 ? _ref6 : null,
|
|
3113
|
+
item_list_name: (_ref7 = context === null || context === void 0 ? void 0 : (_context_orderForm1 = context.orderForm) === null || _context_orderForm1 === void 0 ? void 0 : _context_orderForm1.item_list_name) !== null && _ref7 !== void 0 ? _ref7 : null
|
|
3112
3114
|
};
|
|
3113
3115
|
});
|
|
3114
3116
|
}
|