<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">; (function (ng) {
    'use strict';

    var ProductViewMarkersCtrl = function (toaster, $http, $scope, $rootScope) {
        var ctrl = this;

        ctrl.$onInit = function () {
            ctrl.Reload();
        };

        $rootScope.$on('lazyLoadComplete', function (event) {
            ctrl.Reload();
        });

        ctrl.Reload = function () {
            ctrl.mobile = ctrl.isMobile.toLowerCase() === 'true';

            var lpMainBlock = document.querySelector('.lp-main');
            ctrl.isLandingPage = lpMainBlock !== null &amp;&amp; lpMainBlock !== undefined;

            var MobileType = null;
            var IsButton = null;
            var DefaultCatalogProduct = null;

            if (ctrl.mobile) {
                var productViews = document.getElementsByClassName('prod-photo');

                if (productViews.length &lt; 1) {
                    productViews = document.getElementsByClassName('mobile-product-view-item-image-block');
                }

                if (productViews.length &gt; 0) {
                    var productUrls = [];
                    [].forEach.call(productViews, function (val) {
                        var hrefAttr = val.getAttribute('href');
                        var url = hrefAttr !== null ? hrefAttr.split('/') : [];
                        if (url.length &gt; 0) {
                            productUrls.push(url[url.length - 1]);
                        }
                    });
                    $http.post('amclient/GetPVMarkersMobile', { productUrls: productUrls }).then(function (response) {
                        ctrl.productViewMarkers = response.data.ProductMarker;
                        MobileType = response.data.MobileType;
                        IsButton = response.data.IsButtonChangeCatalog;
                        DefaultCatalogProduct = response.data.DefaultProductCatalog;
                        $scope.$watch(ctrl.productViewMarkers, function () {
                            setTimeout(function () {
                                ReLocate(true, MobileType, IsButton);
                            }, 1);
                        });
                    });
                }
            } else {
                if (ctrl.isLandingPage) {
                    productViews = document.querySelectorAll('[data-product-view-item]');
                }
                else {
                    productViews = document.getElementsByClassName('products-view-item');
                }

                if (productViews.length &gt; 0) {
                    var productIds = [];
                    [].forEach.call(productViews, function (val) { productIds.push(val.dataset.productId) });
                    $http.post('amclient/GetPVMarkers', { productIds: productIds }).then(function (response) {
                        ctrl.productViewMarkers = response.data;
                        $scope.$watch(ctrl.productViewMarkers, function () {
                            setTimeout(function () {
                                ReLocate(false, MobileType, IsButton);
                            }, 1);
                        });
                    })
                }
            }
        };

        function ReLocate(isMobile, MobileType, IsButton) {
            if (isMobile) {
                if (MobileType == "Modern") {
                    if (document.location.pathname == "/") {

                        var productViews = document.getElementsByClassName('mobile-product-view-item');
                        if (productViews.length &lt; 1) {

                            // productViews = document.getElementsByClassName('mobile-product-view-item-image-block');
                        }
                        [].forEach.call(productViews, function (pVal) {
                            pVal = pVal.parentElement;
                            var hrefAttr = pVal.getElementsByClassName('mobile-product-view-item-image-block')[0].href;

                            //pVal.getElementsByClassName('prod-name').chgetAttribute('href')
                            var url = hrefAttr !== null ? hrefAttr.split('/') : [];
                            if (url[url.length - 2].toLowerCase() == "products") {
                                var markers = document.querySelectorAll('[data-productview-purl="' + url[url.length - 1] + '"]');
                                if (markers.length &gt; 0) {
                                    var set = false;
                                    [].forEach.call(markers, function (val) {
                                        if (set || val.children.length == 0) {
                                            return;
                                        }
                                        set = true;
                                        if (pVal.getElementsByClassName('products-view-labels').length == 0) {


                                            var info = pVal.getElementsByClassName('prod-text');
                                            var pvl = document.createElement('div');
                                            pvl.className = "products-view-labels";
                                            info[0].after(pvl);
                                        }

                                        var markersGallery = pVal.getElementsByClassName('products-view-labels');

                                        while (val.children.length &gt; 0) {
                                            val.children[0].style.marginBottom = "0px";
                                            var labelMarker = val.getElementsByClassName('products-view-label-inner')[0];
                                            //labelMarker.style.fontSize = "8px";
                                            var labelMarker = val.getElementsByClassName('products-view-label-inner')[1];
                                            //labelMarker.style.fontSize = "8px";

                                            markersGallery[0].appendChild(val.children[0])
                                        }

                                        var delnode = pVal.getElementsByClassName('mobile-product-view-item-image-block');


                                        var sfd = delnode[0].getElementsByClassName('products-view-labels')


                                        var Plusclass = pVal.getElementsByClassName('mobile-product-view-item-image-block');
                                        markersGallery[0].style.position = "absolute";
                                        markersGallery[0].style.top = "-10px";
                                        Plusclass[0].appendChild(markersGallery[0]);
                                    });
                                }
                            }
                        });
                        return;
                    }
                    else {

                        if (IsButton) {
                            var MobileModernButton = document.querySelector('button[data-view-list-name="mobileModern"]');
                            if (MobileModernButton != null) {
                                MobileModernButton.addEventListener("click", function (e) {


                                    //products-view-mobile-modern-list
                                    //products-view-mobile-modern-single
                                    //products-view-mobile-modern-tile


                                    var MobileView = document.getElementsByClassName('products-view-mobile-modern-list');
                                    var status = 1;
                                    if (MobileView.length &lt; 1) {
                                        MobileView = document.getElementsByClassName('products-view-mobile-modern-single');
                                        status = 2;
                                    }
                                    if (MobileView.length &lt; 1) {
                                        status = 3;
                                        MobileView = document.getElementsByClassName('products-view-mobile-modern-tile');
                                    }

                                    var productViews = document.getElementsByClassName('mobile-product-view-item');
                                    if (productViews.length &lt; 1) {

                                        // productViews = document.getElementsByClassName('mobile-product-view-item-image-block');
                                    }
                                    [].forEach.call(productViews, function (pVal) {
                                        pVal = pVal.parentElement;
                                        var hrefAttr = pVal.getElementsByClassName('mobile-product-view-item-image-block')[0].href;
                                        //pVal.getElementsByClassName('prod-name').chgetAttribute('href')
                                        var url = hrefAttr !== null ? hrefAttr.split('/') : [];
                                        if (url[url.length - 2].toLowerCase() == "products") {
                                            var markers = document.querySelectorAll('[data-productview-purl="' + url[url.length - 1] + '"]');
                                            var markers = null;
                                            var r = pVal.getElementsByClassName('products-view-labels');



                                            var delnode = pVal.getElementsByClassName('mobile-product-view-item-image-block');

                                            var markeri = r;
                                            var sfd = delnode[0].getElementsByClassName('products-view-labels')
                                            if (sfd.length == 0) {
                                                delnode = pVal.getElementsByClassName('mobile-product-view-item__inner');
                                            }
                                            if (status == 1) {

                                                var Plusclass = pVal.getElementsByClassName('mobile-product-view-item-image-wrap');
                                                //markeri[0].style.position = "relative";

                                                Plusclass[0].appendChild(markeri[0]);



                                            }
                                            else {
                                                var Plusclass = pVal.getElementsByClassName('mobile-product-view-item-image-block');
                                                markeri[0].style.position = "absolute";
                                                Plusclass[0].appendChild(markeri[0]);
                                            }


                                            //if (r != null) {
                                            //    delnode[0].removeChild(r[0]);
                                            //    //alert(status);

                                            //}
                                        }
                                    });
                                    return;
                                });
                            }
                        }

                        var MobileView = document.getElementsByClassName('products-view-mobile-modern-list');
                        var status = 1;
                        if (MobileView.length &lt; 1) {
                            MobileView = document.getElementsByClassName('products-view-mobile-modern-single');
                            status = 2;
                        }
                        if (MobileView.length &lt; 1) {
                            status = 3;
                            MobileView = document.getElementsByClassName('products-view-mobile-modern-tile');
                        }

                        var productViews = document.getElementsByClassName('mobile-product-view-item');
                        if (productViews.length &lt; 1) {

                            // productViews = document.getElementsByClassName('mobile-product-view-item-image-block');
                        }
                        [].forEach.call(productViews, function (pVal) {
                            pVal = pVal.parentElement;
                            var hrefAttr = pVal.getElementsByClassName('mobile-product-view-item-image-block')[0].href;



                            //pVal.getElementsByClassName('prod-name').chgetAttribute('href')
                            var url = hrefAttr !== null ? hrefAttr.split('/') : [];
                            if (url[url.length - 2].toLowerCase() == "products") {
                                var markers = document.querySelectorAll('[data-productview-purl="' + url[url.length - 1] + '"]');
                                if (markers.length &gt; 0) {
                                    var set = false;
                                    [].forEach.call(markers, function (val) {
                                        if (set || val.children.length == 0) {
                                            return;
                                        }
                                        set = true;
                                        if (pVal.getElementsByClassName('products-view-labels').length == 0) {


                                            var info = pVal.getElementsByClassName('prod-text');
                                            var pvl = document.createElement('div');
                                            pvl.className = "products-view-labels";
                                            info[0].after(pvl);
                                        }

                                        var markersGallery = pVal.getElementsByClassName('products-view-labels');

                                        while (val.children.length &gt; 0) {
                                            markersGallery[0].appendChild(val.children[0])
                                        }

                                        var delnode = pVal.getElementsByClassName('mobile-product-view-item-image-block');


                                        var sfd = delnode[0].getElementsByClassName('products-view-labels')
                                        if (sfd.length == 0) {
                                            delnode = pVal.getElementsByClassName('mobile-product-view-item__inner');
                                        }
                                        if (status == 1) {

                                            var Plusclass = pVal.getElementsByClassName('mobile-product-view-item-image-wrap');
                                            //markersGallery[0].style.position = "relative";

                                            Plusclass[0].appendChild(markersGallery[0]);

                                        }
                                        else {
                                            var Plusclass = pVal.getElementsByClassName('mobile-product-view-item-image-block');
                                            markersGallery[0].style.position = "absolute";
                                            Plusclass[0].appendChild(markersGallery[0]);
                                        }


                                    });
                                }
                            }
                        });
                        return;

                    }

                }
                else {
                    var productViews = document.getElementsByClassName('prod-photo');
                    if (productViews.length &lt; 1) {
                        productViews = document.getElementsByClassName('mobile-product-view-item-image-block');
                    }
                    [].forEach.call(productViews, function (pVal) {
                        pVal = pVal.parentElement;
                        var hrefAttr = pVal.getElementsByClassName('prod-name')[0].href;
                        //pVal.getElementsByClassName('prod-name').chgetAttribute('href')
                        var url = hrefAttr !== null ? hrefAttr.split('/') : [];
                        if (url[url.length - 2].toLowerCase() == "products") {
                            var markers = document.querySelectorAll('[data-productview-purl="' + url[url.length - 1] + '"]');
                            if (markers.length &gt; 0) {
                                var set = false;
                                [].forEach.call(markers, function (val) {
                                    if (set || val.children.length == 0) {
                                        return;
                                    }
                                    set = true;
                                    if (pVal.getElementsByClassName('products-view-labels').length == 0) {
                                        var info = pVal.getElementsByClassName('prod-text');
                                        var pvl = document.createElement('div');
                                        pvl.className = "products-view-labels";
                                        info[0].after(pvl);
                                    }

                                    var markersGallery = pVal.getElementsByClassName('products-view-labels');

                                    while (val.children.length &gt; 0) {
                                        markersGallery[0].appendChild(val.children[0])
                                    }
                                });
                            }
                        }
                    });
                    return;

                }
            }

            var markersWrap = document.getElementById('markers-wrapper-pv');
            if (markersWrap !== null &amp;&amp; markersWrap.children.length &gt; 0) {
                [].forEach.call(markersWrap.children, function (val, index) {
                    var step = index;

                    var productViewSelector = ctrl.isLandingPage ? '[data-product-view-item][data-product-id="' + val.dataset.productviewPid + '"]' : '.products-view-item[data-product-id="' + val.dataset.productviewPid + '"]';
                    var elem = document.querySelectorAll(productViewSelector);

                    if (elem.length &gt; 0) {
                        [].forEach.call(elem, function (el) {
                            if (el.classList.contains('render-markers') || step &gt; index) {
                                return false;
                            } else {
                                el.classList.add('render-markers');
                            }

                            step++;

                            var productViewLabelsClassName = ctrl.isLandingPage ? 'products-view__labels' : 'products-view-labels';
                            if (el.getElementsByClassName(productViewLabelsClassName).length == 0) {
                                var productViewInfoClassName = ctrl.isLandingPage ? 'products-view__labels' : 'products-view-info';
                                var info = el.getElementsByClassName(productViewInfoClassName);
                                if (info.length &gt; 0) {
                                    var pvl = document.createElement('div');
                                    pvl.className = productViewLabelsClassName;
                                    pvl.style.position = 'absolute';
                                    pvl.style.top = '1px';
                                    pvl.style.right = '5px';
                                    info[0].after(pvl);
                                }
                            }

                            var markersGallery = el.getElementsByClassName(productViewLabelsClassName);
                            if (markersGallery.length &gt; 0) {
                                while (val.children.length &gt; 0) {
                                    markersGallery[0].appendChild(val.children[0]);
                                }
                            }
                        });  //
                    }
                });

                var elems = document.querySelectorAll('.render-markers');

                if (elems.length &gt; 0) {
                    [].forEach.call(elems, function (el) {
                        el.classList.remove('render-markers');
                    });
                };
                //markersWrap.parentNode.removeChild(markersWrap);
            };
        }
    }
    ProductViewMarkersCtrl.$inject = ['toaster', '$http', '$scope', '$rootScope'];

    ng.module('productViewMarker', [])
        .controller('ProductViewMarkersCtrl', ProductViewMarkersCtrl)
        .component('productViewMarker', {
            templateUrl: 'modules/additionalmarkers/content/scripts/product-view-markers/product-view-markers.html',
            controller: 'ProductViewMarkersCtrl',
            bindings: {
                isMobile: '@'
            }
        });

})(window.angular);</pre></body></html>