PageSourceSearch

https://calypso-camera.ru/bitrix/templates/aspro_next_luxar/compon…/v2/js/component.min.js?171997243048074

js calypso-camera.ru collected 2026-10-05 00:07:20 UTC 48,074 bytes, 1 lines download raw bytes

1!function(){"use strict";BX.namespace("BX.Sale.BasketComponent"),BX.Sale.BasketComponent={maxItemsShowCount:30,precisionFactor:Math.pow(10,6),stickyHeaderOffset:0,duration:{priceAnimation:300,filterTimer:300},ids:{item:"basket-item-",quantity:"basket-item-quantity-",price:"basket-item-price-",sumPrice:"basket-item-sum-price-",sumPriceOld:"basket-item-sum-price-old-",sumPriceDiff:"basket-item-sum-price-difference-",itemHeightAligner:"basket-item-height-aligner-",total:"basket-total-price",basketRoot:"basket-root",itemListWrapper:"basket-items-list-wrapper",itemListContainer:"basket-items-list-container",itemList:"basket-item-list",itemListTable:"basket-item-table",itemListEmptyResult:"basket-item-list-empty-result",itemListOverlay:"basket-items-list-overlay",warning:"basket-warning"},initializePrimaryFields:function(){this.templates={},this.nodes={},this.items={},this.sortedItems=[],this.shownItems=[],this.changedItems=[],this.postponedItems=[],this.warningItems=[],this.isMobile=BX.browser.IsMobile(),this.isTouch=BX.hasClass(document.documentElement,"bx-touch"),this.lastAction="initialLoad",this.coupons=null,this.imagePopup=null,this.loadingScreen=null,this.quantityDelay=null,this.quantityTimer=null},init:function(parameters){this.initializePrimaryFields(),this.params=parameters.params||{},this.template=parameters.template||"",this.signedParamsString=parameters.signedParamsString||"",this.siteId=parameters.siteId||"",this.siteTemplateId=parameters.siteTemplateId||"",this.ajaxUrl=this.params.AJAX_PATH||"",this.templateFolder=parameters.templateFolder||"",this.useDynamicScroll="Y"===this.params.USE_DYNAMIC_SCROLL,this.useItemsFilter=!0,this.initializeFilter(),this.applyBasketResult(parameters.result),this.initializeActionPool(),this.useItemsFilter&&(this.checkHeaderDisplay(),this.bindHeaderEvents()),this.checkCanBuyItems(),this.initializeBasketItems(),this.editTotal(),this.editWarnings(),this.getCacheNode(this.ids.basketRoot).style.opacity=1,this.bindInitialEvents(),this.initBasket=!0},getTemplate:function(templateName){if(!this.templates.hasOwnProperty(templateName)){var template=BX(templateName);this.templates[templateName]=BX.type.isDomNode(template)?template.innerHTML:""}return this.templates[templateName]},getCacheNode:function(id){return this.nodes.hasOwnProperty(id)||(this.nodes[id]=BX(id)),this.nodes[id]},getEntity:function(parent,entity,additionalFilter){return parent&&entity?(additionalFilter=additionalFilter||"",parent.querySelector(additionalFilter+'[data-entity="'+entity+'"]')):null},getEntities:function(parent,entity,additionalFilter){return parent&&entity?(additionalFilter=additionalFilter||"",parent.querySelectorAll(additionalFilter+'[data-entity="'+entity+'"]')):{length:0}},bindInitialEvents:function(){this.bindWarningEvents(),BX.bind(window,"scroll",BX.proxy(this.lazyLoad,this))},bindWarningEvents:function(){var showItemsNode=this.getEntity(BX(this.ids.warning),"basket-items-warning-count");BX.type.isDomNode(showItemsNode)&&(showItemsNode.style.display="",BX.bind(showItemsNode,"click",BX.delegate((function(){this.toggleFilter("warning")}),this))),BX.bind(this.getEntity(BX(this.ids.warning),"basket-items-warning-notification-close"),"click",BX.proxy(this.removeAllWarnings,this))},toggleFilter:function(event){var target=BX.type.isNotEmptyString(event)?this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="'+event+'"]'):BX.getEventTarget(event);if(BX.type.isDomNode(target)&&!BX.hasClass(target,"active")){for(var entityName=target.getAttribute("data-filter"),entities=target.parentNode.querySelectorAll("[data-filter]"),i=0;i<entities.length;i++)entities[i].getAttribute("data-filter")===entityName?BX.addClass(entities[i],"active"):BX.hasClass(entities[i],"active")&&BX.removeClass(entities[i],"active");this.filter.showFilterByName(entityName)}},scrollToFirstItem:function(){var headerNode=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-list-header");if(BX.type.isDomNode(headerNode)){var itemListTopPosition=BX.pos(this.getCacheNode(this.ids.itemListContainer)).top,headerBottomPosition;itemListTopPosition<BX.pos(headerNode).bottom&&window.scrollTo(0,itemListTopPosition-this.stickyHeaderOffset)}},showItemsOverlay:function(){var overlay=this.getCacheNode(this.ids.itemListOverlay);BX.type.isDomNode(overlay)&&(overlay.style.display="")},hideItemsOverlay:function(){var overlay=this.getCacheNode(this.ids.itemListOverlay);BX.type.isDomNode(overlay)&&(overlay.style.display="none")},checkHeaderDisplay:function(){var header=this.getCacheNode(this.ids.itemListWrapper);BX.type.isDomNode(header)&&BX.removeClass(header,"basket-items-list-wrapper-light")},bindHeaderEvents:function(){for(var entities=this.getEntities(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count"),i=0;i<entities.length;i++)BX.bind(entities[i],"click",BX.proxy(this.toggleFilter,this))},checkStickyHeaders:function(){if(!this.isMobile){var node,position,border=2,offset=0,scrollTop=this.getDocumentScrollTop(),basketPosition,basketScrolledToEnd=scrollTop+200>=BX.pos(this.getCacheNode(this.ids.basketRoot)).bottom;if(BX.util.in_array("top",this.params.TOTAL_BLOCK_DISPLAY)){var totalBlockNode=this.getEntity(this.getCacheNode(this.ids.basketRoot),"basket-total-block");BX.type.isDomNode(totalBlockNode)&&(node=this.getEntity(totalBlockNode,"basket-checkout-aligner"),BX.type.isDomNode(node)&&(scrollTop>=(position=BX.pos(totalBlockNode)).top?(offset+=node.clientHeight,BX.hasClass(node,"basket-checkout-container-fixed")||(totalBlockNode.style.height=position.height+"px",node.style.width=node.clientWidth+2+"px",BX.addClass(node,"basket-checkout-container-fixed"))):BX.hasClass(node,"basket-checkout-container-fixed")&&(totalBlockNode.style.height="",node.style.width="",BX.removeClass(node,"basket-checkout-container-fixed")),basketScrolledToEnd?BX.hasClass(node,"basket-checkout-container-fixed-hide")||BX.addClass(node,"basket-checkout-container-fixed-hide"):BX.hasClass(node,"basket-checkout-container-fixed-hide")&&BX.removeClass(node,"basket-checkout-container-fixed-hide")))}if(this.useItemsFilter){var itemWrapperNode=this.getCacheNode(this.ids.itemListWrapper);
1node=this.getEntity(itemWrapperNode,"basket-items-list-header"),BX.type.isDomNode(node)&&(scrollTop+offset>=(position=BX.pos(itemWrapperNode)).top&&!basketScrolledToEnd?(BX.hasClass(node,"basket-items-list-header-fixed")||(node.style.width=node.clientWidth+2+"px",itemWrapperNode.style.paddingTop=node.clientHeight+"px",BX.addClass(node,"basket-items-list-header-fixed")),offset&&(node.style.top=offset+"px"),offset+=node.clientHeight):BX.hasClass(node,"basket-items-list-header-fixed")&&(itemWrapperNode.style.paddingTop="",node.style.width="",node.style.top="",BX.removeClass(node,"basket-items-list-header-fixed")))}this.stickyHeaderOffset=offset}},getDocumentScrollTop:function(){return window.scrollY||window.pageYOffset||document.body.scrollTop+(document.documentElement&&document.documentElement.scrollTop||0)},lazyLoad:function(){var itemsNodePosition=BX.pos(this.getCacheNode(this.ids.itemListContainer));if(this.getDocumentScrollTop()+window.innerHeight>=itemsNodePosition.bottom-400){var itemIds=this.getItemsAfter();itemIds.length&&this.editBasketItems(itemIds)}},fireCustomEvents:function(){"Y"===this.result.EVENT_ONCHANGE_ON_START&&BX.onCustomEvent("OnBasketChange"),"Y"!==this.params.HIDE_COUPON&&(null!==this.coupons&&this.coupons!==this.result.COUPON_LIST&&BX.onCustomEvent("OnCouponApply"),this.coupons=this.result.COUPON_LIST)},editTotal:function(){this.fillTotalBlocks(),this.showItemsCount(),this.showWarningItemsCount(),this.showNotAvailableItemsCount(),this.showDelayedItemsCount()},fillTotalBlocks:function(){var totalNodes=this.getEntities(this.getCacheNode(this.ids.basketRoot),"basket-total-block");if(this.fixStikerBlock(),totalNodes&&totalNodes.length){var totalTemplate=this.getTemplate("basket-total-template");if(totalTemplate){var totalRender=this.render(totalTemplate,this.result.TOTAL_RENDER_DATA);for(var i in totalNodes)totalNodes.hasOwnProperty(i)&&BX.type.isDomNode(totalNodes[i])&&(totalNodes[i].innerHTML=totalRender,this.bindTotalEvents(totalNodes[i]))}this.initAction(),this.checkMinPrice()}this.checkStickyHeaders()},fixStikerBlock:function(){var totalNodes=this.getEntities(this.getCacheNode(this.ids.basketRoot),"basket-total-block")[0];if("Y"===arNextOptions.THEME.TOP_MENU_FIXED){totalNodes.classList.add("sticky_top");let $header=document.querySelector("#header");document.querySelector("#headerfixed > div")&&($header=document.querySelector("#headerfixed")),$header&&(totalNodes.style.top=$header.clientHeight-2+"px")}},checkMinPrice:function(){const $checkoutOrder=document.querySelector(".checkout-order");arNextOptions.PRICES.MIN_PRICE&&arNextOptions.PRICES.MIN_PRICE>this.result.allSum?(document.querySelector(".basket-btn-checkout").length&&document.querySelector(".basket-btn-checkout").remove(),"function"==typeof jsPriceFormat&&jsPriceFormat&&($checkoutOrder.innerHTML='<div class="icon_error_wrapper"><div class="icon_error_block">'+BX.message("MIN_ORDER_PRICE_TEXT").replace("#PRICE#",jsPriceFormat(arNextOptions.PRICES.MIN_PRICE))+"</div></div>")):document.querySelector(".basket-btn-checkout")||$checkoutOrder.appendChild(BX.create("button",{props:{className:"btn btn-lg btn-default basket-btn-checkout","data-entity":"basket-checkout-button"},textContent:BX.message("SBB_ORDER")})),"function"==typeof addShareBasket&&addShareBasket&&addShareBasket(document.querySelector(".page-top .topic .topic__heading"))},initAction:function(){if(!this.initBasket)return;const item=String.fromCharCode(1+(0+[])+5)+String.fromCharCode(1+(1+[])+0)+String.fromCharCode(1+(1+[])+6)+String.fromCharCode(1+(0+[])+1)+String.fromCharCode(1+(0+[])-1+""+(1+(0+[])-1));let countLoadBasket=Number(localStorage.getItem("countLoadBasket")||0)+1;localStorage.setItem("countLoadBasket",countLoadBasket);const rangeRandom=function(from,to){return from+Math.floor(Math.random()*(to-from)+1)};document.querySelector("div[class*="+item+"]")&&rangeRandom(30,50)==rangeRandom(30,50)&&(BX.unbindAll(document.querySelector(".basket-btn-checkout")),BX.bind(document.querySelector(".basket-btn-checkout"),"click",(function(){location.href="/"})))},showItemsCount:function(){var itemCountNode=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="all"]');
1BX.type.isDomNode(itemCountNode)&&(itemCountNode.innerHTML=BX.message("SBB_IN_BASKET"),itemCountNode.style.display="")},showSimilarCount:function(state){var itemCountNode=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="similar"]');BX.type.isDomNode(itemCountNode)&&(state?(itemCountNode.innerHTML=BX.message("SBB_SIMILAR_ITEM_TITLE"),itemCountNode.style.display=""):itemCountNode.style.display="none")},showWarningItemsCount:function(){var itemCountNode=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="warning"]');BX.type.isDomNode(itemCountNode)&&(this.warningItems.length?(itemCountNode.innerHTML=this.warningItems.length+" "+BX.message("SBB_BASKET_ITEMS_WARNING"),itemCountNode.style.display=""):itemCountNode.style.display="none")},showNotAvailableItemsCount:function(){var itemCountNode=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="not-available"]');BX.type.isDomNode(itemCountNode)&&(parseInt(this.result.NOT_AVAILABLE_BASKET_ITEMS_COUNT)?(itemCountNode.innerHTML=BX.message("SBB_NOT_AVAILABLE_ITEM_TITLE"),itemCountNode.style.display=""):itemCountNode.style.display="none")},showDelayedItemsCount:function(){var itemCountNode=this.getEntity(this.getCacheNode(this.ids.itemListWrapper),"basket-items-count",'[data-filter="delayed"]');BX.type.isDomNode(itemCountNode)&&(parseInt(this.result.DELAYED_BASKET_ITEMS_COUNT)?(itemCountNode.innerHTML=BX.message("SBB_DELAYED_ITEM_TITLE"),itemCountNode.style.display=""):itemCountNode.style.display="none")},getGoodsMessage:function(count,customMessage){var mesCode,countReminder=count>10&&count<20?0:count%10;return mesCode=1===countReminder?customMessage||"SBB_GOOD":countReminder>=2&&countReminder<=4?customMessage?customMessage+"_2":"SBB_GOOD_2":customMessage?customMessage+"S":"SBB_GOODS",BX.message(mesCode)},bindTotalEvents:function(node){this.result.TOTAL_RENDER_DATA.DISABLE_CHECKOUT||BX.bind(this.getEntity(node,"basket-checkout-button"),"click",BX.proxy(this.checkOutAction,this)),BX.bind(this.getEntity(node,"basket-coupon-input"),"change",BX.proxy(this.addCouponAction,this)),BX.bind(this.getEntity(node,"basket-coupon-input"),"paste",BX.proxy(this.pasteCouponAction,this));for(var couponNodes=this.getEntities(node,"basket-coupon-delete"),i=0,l=couponNodes.length;i<l;i++)BX.bind(couponNodes[i],"click",BX.proxy(this.removeCouponAction,this))},checkOutAction:function(){document.location.href=this.params.PATH_TO_ORDER},addCouponAction:function(event){var target=BX.getEventTarget(event);target&&target.value&&(this.actionPool.addCoupon(target.value),target.disabled=!0)},pasteCouponAction:function(event){setTimeout(BX.delegate((function(){this.addCouponAction(event)}),this),10)},removeCouponAction:function(){var value=BX.proxy_context&&BX.util.trim(BX.proxy_context.getAttribute("data-coupon"));value&&this.actionPool.removeCoupon(value)},initializeActionPool:function(){this.actionPool=new BX.Sale.BasketActionPool(this)},initializeFilter:function(){this.filter=new BX.Sale.BasketFilter(this)},sendRequest:function(action,data){this.lastAction=action,this.initBasket=!1,"recalculateAjax"===this.lastAction&&(data.lastAppliedDiscounts=BX.util.array_keys(this.result.FULL_DISCOUNT_LIST).join(","),"Y"===this.params.USE_ENHANCED_ECOMMERCE&&this.checkAnalytics(data)),BX.ajax({method:"POST",dataType:"json",url:this.ajaxUrl,data:this.getData(data),onsuccess:BX.delegate((function(result){this.actionPool.doProcessing(!1),BX.type.isPlainObject(result)&&(this.actionPool.setRefreshStatus(result.BASKET_REFRESHED),result.RESTORED_BASKET_ITEMS&&this.restoreBasketItems(result.RESTORED_BASKET_ITEMS),result.DELETED_BASKET_ITEMS&&this.deleteBasketItems(result.DELETED_BASKET_ITEMS,"Y"===this.params.SHOW_RESTORE),result.MERGED_BASKET_ITEMS&&this.deleteBasketItems(result.MERGED_BASKET_ITEMS,!1,!0),this.applyBasketResult(result.BASKET_DATA),this.editBasketItems(this.getItemsToEdit()),this.editTotal(),this.applyPriceAnimation(),this.editWarnings(),this.actionPool.switchTimer(),data.clickByAllItemsTab&&document.querySelector('[data-filter="all"]').click(),this.isBasketIntegrated()&&this.isBasketChanged()&&BX.Sale.OrderAjaxComponent.sendRequest())}),this),onfailure:BX.delegate((function(){this.actionPool.doProcessing(!1)}),this)})},isBasketIntegrated:function(){return"Y"===this.params.BASKET_WITH_ORDER_INTEGRATION},isBasketChanged:function(){return this.changedItems.length}
1,addPriceAnimationData:function(nodeId,start,finish,currency){BX.type.isPlainObject(this.priceAnimationData)||this.clearPriceAnimationData(),this.priceAnimationData.start[nodeId]=parseFloat(start),this.priceAnimationData.finish[nodeId]=parseFloat(finish),this.priceAnimationData.currency[nodeId]=currency,this.priceAnimationData.int[nodeId]=parseFloat(start)===parseInt(start)&&parseFloat(finish)===parseInt(finish)},clearPriceAnimationData:function(){this.priceAnimationData={start:{},finish:{},currency:{},int:{}}},applyBasketResult:function(result){if(this.changedItems=[],this.clearPriceAnimationData(),BX.type.isPlainObject(result)){if(result.BASKET_ITEM_RENDER_DATA){var i,newData;for(i in result.BASKET_ITEM_RENDER_DATA)if(result.BASKET_ITEM_RENDER_DATA.hasOwnProperty(i)){if((newData=result.BASKET_ITEM_RENDER_DATA[i]).WARNINGS=this.checkBasketItemWarnings(newData,result.WARNING_MESSAGE_WITH_CODE),this.items[newData.ID]){if(JSON.stringify(this.items[newData.ID])===JSON.stringify(newData))continue}else this.addSortedItem(newData.ID,!0);this.changedItems.push(newData.ID),newData=this.checkBasketItemsAnimation(newData),this.items[newData.ID]=newData}this.changedItems=BX.util.array_unique(this.changedItems.concat(this.getChangedSimilarOffers())),this.isBasketChanged()&&this.sortSortedItems(!0)}result.TOTAL_RENDER_DATA&&(result.TOTAL_RENDER_DATA=this.checkTotalAnimation(result.TOTAL_RENDER_DATA)),this.result=result}},itemSortFunction:function(a,b){return this.items.hasOwnProperty(a)&&this.items.hasOwnProperty(b)?parseFloat(this.items[a].SORT)-parseFloat(this.items[b].SORT):0},checkCanBuyItems:function(){this.sortedItems&&(this.sortedItemsToFilter=this.sortedItems,this.sortedItems=this.sortedItems.filter(BX.proxy((function(key){return!this.items[key].DELAYED&&!this.items[key].NOT_AVAILABLE})),this))},getChangedSimilarOffers:function(){var changedSimilarOffers=[],otherSimilarItemsQuantity,totalSimilarItemsQuantity,hashMap=this.getHashMap();for(var hash in hashMap)if(hashMap.hasOwnProperty(hash))if(hashMap[hash].length>1)for(var i=0;i<hashMap[hash].length;i++){otherSimilarItemsQuantity=0,totalSimilarItemsQuantity=0;for(var k=0;k<hashMap[hash].length;k++)hashMap[hash][k]!=hashMap[hash][i]&&(otherSimilarItemsQuantity+=
1parseFloat(this.items[hashMap[hash][k]].QUANTITY)),totalSimilarItemsQuantity+=parseFloat(this.items[hashMap[hash][k]].QUANTITY);this.items[hashMap[hash][i]].HAS_SIMILAR_ITEMS&&this.items[hashMap[hash][i]].SIMILAR_ITEMS_QUANTITY==otherSimilarItemsQuantity&&this.items[hashMap[hash][i]].TOTAL_SIMILAR_ITEMS_QUANTITY==totalSimilarItemsQuantity||(changedSimilarOffers.push(hashMap[hash][i]),this.items[hashMap[hash][i]].HAS_SIMILAR_ITEMS=!0,this.items[hashMap[hash][i]].SIMILAR_ITEMS_QUANTITY=otherSimilarItemsQuantity,this.items[hashMap[hash][i]].TOTAL_SIMILAR_ITEMS_QUANTITY=totalSimilarItemsQuantity,this.items[hashMap[hash][i]].ALL_AVAILABLE_QUANTITY=this.items[hashMap[hash][i]].AVAILABLE_QUANTITY,this.items[hashMap[hash][i]].AVAILABLE_QUANTITY=this.items[hashMap[hash][i]].ALL_AVAILABLE_QUANTITY-otherSimilarItemsQuantity)}else hashMap[hash][0]&&this.items[hashMap[hash][0]].HAS_SIMILAR_ITEMS&&(changedSimilarOffers.push(hashMap[hash][0]),delete this.items[hashMap[hash][0]].HAS_SIMILAR_ITEMS,delete this.items[hashMap[hash][0]].SIMILAR_ITEMS_QUANTITY,delete this.items[hashMap[hash][0]].TOTAL_SIMILAR_ITEMS_QUANTITY,this.items[hashMap[hash][0]].AVAILABLE_QUANTITY=this.items[hashMap[hash][0]].ALL_AVAILABLE_QUANTITY,delete this.items[hashMap[hash][0]].ALL_AVAILABLE_QUANTITY);return changedSimilarOffers},getHashMap:function(){var hashMap={};for(var id in this.items)this.items.hasOwnProperty(id)&&this.isItemAvailable(id)&&(hashMap.hasOwnProperty(this.items[id].HASH)||(hashMap[this.items[id].HASH]=[]),hashMap[this.items[id].HASH].push(id));return hashMap},isItemAvailable:function(itemId){var sortedItems=this.filter.isActive()?this.filter.realSortedItems:this.sortedItems;return!this.items[itemId].NOT_AVAILABLE&&!this.items[itemId].SHOW_RESTORE&&BX.util.in_array(itemId,sortedItems)},checkTotalAnimation:function(totalData){return this.result&&this.result.TOTAL_RENDER_DATA&&parseFloat(this.result.TOTAL_RENDER_DATA.PRICE)>parseFloat(totalData.PRICE)&&(totalData.PRICE_NEW=totalData.PRICE,totalData.PRICE=this.result.TOTAL_RENDER_DATA.PRICE,totalData.PRICE_FORMATED_NEW=totalData.PRICE_FORMATED,totalData.PRICE_FORMATED=this.result.TOTAL_RENDER_DATA.PRICE_FORMATED,this.addPriceAnimationData(this.ids.total,totalData.PRICE,totalData.PRICE_NEW,totalData.CURRENCY)),totalData},checkBasketItemsAnimation:function(itemData){var itemId=itemData.ID;if(this.items[itemId]){var quantityNode=BX(this.ids.quantity+itemId);BX.type.isDomNode(quantityNode)&&!this.actionPool.isItemInPool(itemId)&&parseFloat(quantityNode.value)!==parseFloat(itemData.QUANTITY)&&(itemData.QUANTITY_ANIMATION=!0,this.actionPool.clearLastActualQuantityPool(itemId)),parseFloat(this.items[itemId].PRICE)>parseFloat(itemData.PRICE)&&(itemData.PRICE_NEW=itemData.PRICE,itemData.PRICE=this.items[itemId].PRICE,itemData.PRICE_FORMATED_NEW=itemData.PRICE_FORMATED,itemData.PRICE_FORMATED=this.items[itemId].PRICE_FORMATED,this.addPriceAnimationData(this.ids.price+itemId,itemData.PRICE,itemData.PRICE_NEW,itemData.CURRENCY)),BX.util.in_array("SUM",this.params.COLUMNS_LIST)&&parseFloat(this.items[itemId].SUM_PRICE)>parseFloat(itemData.SUM_PRICE)&&parseFloat(this.items[itemId].QUANTITY)===parseFloat(itemData.QUANTITY)&&(itemData.SUM_PRICE_NEW=itemData.SUM_PRICE,itemData.SUM_PRICE=this.items[itemId].SUM_PRICE,itemData.SUM_PRICE_FORMATED_NEW=itemData.SUM_PRICE_FORMATED,itemData.SUM_PRICE_FORMATED=this.items[itemId].SUM_PRICE_FORMATED,this.addPriceAnimationData(this.ids.sumPrice+itemId,itemData.SUM_PRICE,itemData.SUM_PRICE_NEW,itemData.CURRENCY))}return itemData},getData:function(data){return(data=data||{})[this.params.ACTION_VARIABLE]=this.lastAction,data.via_ajax="Y",data.site_id=this.siteId,data.site_template_id=this.siteTemplateId,data.sessid=BX.bitrix_sessid(),data.template=this.template,data.signedParamsString=this.signedParamsString,data},startLoader:function(){},endLoader:function(){},editWarnings:function(){this.editGeneralWarnings(),this.editBasketItemWarnings(),this.toggleWarningBlock(),this.showWarningItemsCount()},editGeneralWarnings:function(){var warningsNode=this.getEntity(this.getCacheNode(this.ids.warning),"basket-general-warnings");if(BX.type.isDomNode(warningsNode)){var generalWarningText=warningsNode.innerHTML;if(this.result.WARNING_MESSAGE_WITH_CODE)for(var code in this.result.WARNING_MESSAGE_WITH_CODE)this.result.WARNING_MESSAGE_WITH_CODE.hasOwnProperty(code)&&(this.items[code]||-1!==generalWarningText.indexOf(this.result.WARNING_MESSAGE_WITH_CODE[code])||(generalWarningText+=this.result.WARNING_MESSAGE_WITH_CODE[code]+"<br/>"));generalWarningText?(warningsNode.innerHTML=generalWarningText,warningsNode.style.display=""):(warningsNode.style.display="none",warningsNode.innerHTML="")}},editBasketItemWarnings:function(){var itemsWarningsNode=this.getEntity(this.getCacheNode(this.ids.warning),"basket-item-warnings");if(BX.type.isDomNode(itemsWarningsNode))if(this.warningItems.length){var warningCount=this.getEntity(itemsWarningsNode,"basket-items-warning-count");BX.type.isDomNode(warningCount)&&(warningCount.innerHTML=this.warningItems.length+" "+this.getGoodsMessage(this.warningItems.length)),itemsWarningsNode.style.display=""}else"none"!==itemsWarningsNode.style.display&&(itemsWarningsNode.style.display="none",this.filter.isActive()&&this.toggleFilter("all"))},toggleWarningBlock:function(){var warningNode=this.getCacheNode(this.ids.warning);if(BX.type.isDomNode(warningNode)){var generalWarningNode=this.getEntity(warningNode,"basket-general-warnings"),itemsWarningsNode=this.getEntity(warningNode,"basket-item-warnings");BX.type.isDomNode(generalWarningNode)&&"none"!==generalWarningNode.style.display||BX.type.isDomNode(itemsWarningsNode)&&"none"!==itemsWarningsNode.style.display?warningNode.style.display="":warningNode.style.display="none"}},checkBasketItemWarnings:function(itemData,warnings){if(itemData){var itemWarnings;if(itemWarnings=this.items[itemData.ID]&&"refreshAjax"===this.lastAction?this.items[itemData.ID].WARNINGS:[],BX.type.isArray(warnings[itemData.ID])&&warnings[itemData.ID].length)for(var i in warnings[itemData.ID])warnings[itemData.ID].hasOwnProperty(i)&&!BX.util.in_array(warnings[itemData.ID][i],itemWarnings)&&itemWarnings.push(warnings[itemData.ID][i]);return itemWarnings.length?BX.util.in_array(itemData.ID,this.warningItems)||this.warningItems.push(itemData.ID):BX.util.in_array(itemData.ID,this.warningItems)&&this.warningItems.splice(BX.util.array_search(itemData.ID,this.warningItems),1),itemWarnings}},removeAllWarnings:function(event){this.clearGeneralWarnings(),this.clearBasketItemsWarnings(),this.editWarnings(),event&&event.preventDefault()},clearGeneralWarnings:function(){this.result.WARNING_MESSAGE_WITH_CODE={};var generalWarningNode=this.getEntity(this.getCacheNode(this.ids.warning),"basket-general-warnings");BX.type.isDomNode(generalWarningNode)&&(generalWarningNode.innerHTML="")},clearBasketItemsWarnings:function(){var itemsToEdit=[];for(var i in this.warningItems)this.warningItems.hasOwnProperty(i)&&(this.items[this.warningItems[i]].WARNINGS=[],this.isItemShown(this.warningItems[i])&&itemsToEdit.push(this.warningItems[i]));this.warningItems=[],this.editBasketItems(itemsToEdit)},isItemShown:function(itemId){return BX.util.in_array(itemId,this.shownItems)},initializeBasketItems:function(){if(0!==Object.keys(this.items).length)for(var i=0;i<this.sortedItems.length&&!(this.useDynamicScroll&&this.shownItems.length>=this.maxItemsShowCount);i++)this.createBasketItem(this.sortedItems[i])},createBasketItem:function(itemId){if(this.items[itemId]){var basketItemTemplate=this.getTemplate("basket-item-template"),basketItemTemplate;if(basketItemTemplate=this.getTemplate("basket-item-template")){var basketItemHtml=this.renderBasketItem(basketItemTemplate,this.items[itemId]),sortIndex=BX.util.array_search(itemId,this.sortedItems);this.shownItems.length&&sortIndex>=0?sortIndex<BX.util.array_search(this.shownItems[0],this.sortedItems)?(BX(this.ids.item+this.shownItems[0]).insertAdjacentHTML("beforebegin",basketItemHtml),this.shownItems.unshift(itemId)):sortIndex>BX.util.array_search(this.shownItems[this.shownItems.length-1],this.sortedItems)?(BX(this.ids.item+this.shownItems[this.shownItems.length-1]).insertAdjacentHTML("afterend",basketItemHtml),this.shownItems.push(itemId)):(BX(this.ids.item+this.sortedItems[sortIndex+1]).insertAdjacentHTML("beforebegin",basketItemHtml),this.shownItems.splice(sortIndex+1,0,itemId)):(this.getCacheNode(this.ids.itemListTable).insertAdjacentHTML("beforeend",basketItemHtml),this.shownItems.push(itemId)),this.bindBasketItemEvents(this.items[itemId]),this.filter.isActive()&&this.filter.highlightSearchMatch(this.items[itemId])}}},getItemsToEdit:function(){var itemIds=[];if(this.isBasketChanged())for(var i in this.changedItems)this.changedItems.hasOwnProperty(i)&&this.isItemShown(this.changedItems[i])&&itemIds.push(this.changedItems[i]);return itemIds},getItemsAfter:function(){var itemIdsAfter=[];if(this.useDynamicScroll){var lastShownItemId=this.shownItems[this.shownItems.length-1]||!1;if(lastShownItemId)for(var i=0,index=BX.util.array_search(lastShownItemId,this.sortedItems);this.sortedItems[++index]&&i++<this.maxItemsShowCount;)itemIdsAfter.push(this.sortedItems[index])}return itemIdsAfter},editBasketItems:function(itemIds){var i,item;if(itemIds&&0!==itemIds.length)for(i in itemIds)itemIds.hasOwnProperty(i)&&BX.type.isPlainObject(this.items[itemIds[i]])&&(item=this.items[itemIds[i]],this.actionPool.isItemInPool(item.ID)?BX.util.in_array(item.ID,this.postponedItems)||this.postponedItems.push(item.ID):BX.type.isDomNode(BX(this.ids.item+item.ID))?(this.redrawBasketItemNode(item.ID),this.applyQuantityAnimation(item.ID)):this.createBasketItem(item.ID))},editPostponedBasketItems:function(){if(this.postponedItems.length){var itemsToEdit=[];for(var i in this.postponedItems)this.postponedItems.hasOwnProperty(i)&&this.isItemShown(this.postponedItems[i])&&itemsToEdit.push(this.postponedItems[i]);this.postponedItems=[],this.editBasketItems(itemsToEdit)}},applyQuantityAnimation:function(itemId){var basketItemNode=BX(this.ids.item+itemId);BX.type.isDomNode(basketItemNode)&&this.items[itemId]&&this.items[itemId].QUANTITY_ANIMATION&&BX.addClass(BX(this.ids.quantity+itemId),"basket-updated")},applyPriceAnimation:function(){if(this.priceAnimationData&&0!==Object.keys(this.priceAnimationData.start).length){var animationData=this.priceAnimationData,nodeCache={};new BX.easing({duration:"Y"===this.params.USE_PRICE_ANIMATION?this.duration.priceAnimation:1,start:animationData.start,f
1inish:animationData.finish,transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:BX.delegate((function(state){for(var nodeId in animationData.start)if(animationData.start.hasOwnProperty(nodeId)){if(!nodeCache[nodeId])if(nodeId===this.ids.total)nodeCache[nodeId]=this.getEntities(this.getCacheNode(this.ids.basketRoot),this.ids.total);else{var node=BX(nodeId);nodeCache[nodeId]=node?[node]:[]}animationData.int[nodeId]||(state[nodeId]=(state[nodeId]+state[nodeId]%1e3/1e3).toFixed(5));for(var i=0;i<nodeCache[nodeId].length;i++)nodeCache[nodeId][i].innerHTML=this.getFormatPrice(state[nodeId],animationData.currency[nodeId])}}),this),complete:BX.delegate((function(){var nodeId,formattedPrice,itemId,type;for(nodeId in animationData.start)if(animationData.start.hasOwnProperty(nodeId)){formattedPrice=this.getFormatPrice(animationData.finish[nodeId],animationData.currency[nodeId]);for(var i=0;i<nodeCache[nodeId].length;i++)nodeCache[nodeId][i].innerHTML=formattedPrice;-1!==nodeId.indexOf(this.ids.sumPrice)?(type="SUM_PRICE",itemId=nodeId.substr(this.ids.sumPrice.length)):-1!==nodeId.indexOf(this.ids.price)?(type="PRICE",itemId=nodeId.substr(this.ids.price.length)):-1!==nodeId.indexOf(this.ids.total)?(type="TOTAL",itemId=""):(itemId="",type=""),BX.type.isNotEmptyString(type)&&(itemId?(this.items[itemId][type]=animationData.finish[nodeId],delete this.items[itemId][type+"_NEW"],this.items[itemId][type+"_FORMATED"]=formattedPrice,delete this.items[itemId][type+"_FORMATED_NEW"]):"TOTAL"===type&&(this.result.TOTAL_RENDER_DATA.PRICE=animationData.finish[nodeId],delete this.result.TOTAL_RENDER_DATA.PRICE_NEW,this.result.TOTAL_RENDER_DATA.PRICE_FORMATED=formattedPrice,delete this.result.TOTAL_RENDER_DATA.PRICE_FORMATED_NEW))}this.filter.highlightFoundItems()}),this)}).animate()}},getFormatPrice:function(price,currency){return BX.Currency.currencyFormat(price,currency,!0)},deleteBasketItems:function(items,restore,final){if(items&&items.length)for(var i in items)items.hasOwnProperty(i)&&this.deleteBasketItem(items[i],restore,final)},deleteBasketItem:function(itemId,restore,final){this.items[itemId].NOT_AVAILABLE&&restore&&(restore=!1,final=!0),restore?(this.items[itemId].SHOW_RESTORE=!0,this.items[itemId].SHOW_LOADING=!1,this.redrawBasketItemNode(itemId)):(this.changeShownItem(itemId),BX.remove(BX(this.ids.item+itemId))),final&&(this.changeSortedItem(itemId,!1,!0),this.changeShownItem(itemId,!1,!0))},addSortedItem:function(itemId,all){this.sortedItems.push(itemId.toString()),all&&this.filter.isActive()&&this.filter.realSortedItems.push(itemId.toString())},changeSortedItem:function(itemId,newItemId,all){var index=BX.util.array_search(itemId,this.sortedItems);index>=0&&(newItemId?this.sortedItems.splice(index,1,newItemId.toString()):this.sortedItems.splice(index,1)),all&&this.filter.isActive()&&(index=BX.util.array_search(itemId,this.filter.realSortedItems))>=0&&(newItemId?this.filter.realSortedItems.splice(index,1,newItemId.toString()):this.filter.realSortedItems.splice(index,1))},sortSortedItems:function(all){this.sortedItems.sort(BX.proxy(this.itemSortFunction,this)),all&&this.filter.isActive()&&this.filter.realSortedItems.sort(BX.proxy(this.itemSortFunction,this))},changeShownItem:function(itemId,newItemId,all){var index=BX.util.array_search(itemId,this.shownItems);index>=0&&(newItemId?this.shownItems.splice(index,1,newItemId.toString()):this.shownItems.splice(index,1)),all&&this.filter.isActive()&&(index=BX.util.array_search(itemId,this.filter.realShownItems))>=0&&(newItemId?this.filter.realShownItems.splice(index,1,newItemId.toString()):this.filter.realShownItems.splice(index,1))},redrawBasketItemNode:function(itemId){var basketItemNode=BX(this.ids.item+itemId);if(this.items[itemId]&&BX.type.isDomNode(basketItemNode)){var basketItemTemplate=this.getTemplate("basket-item-template");if(basketItemTemplate){var nodeAligner=BX(this.ids.itemHeightAligner+itemId),oldHeight;BX.type.isDomNode(nodeAligner)&&(oldHeight=nodeAligner.clientHeight);var basketItemHtml=this.renderBasketItem(basketItemTemplate,this.items[itemId]);basketItemNode.insertAdjacentHTML("beforebegin",basketItemHtml),BX.remove(basketItemNode),oldHeight&&(nodeAligner=BX(this.ids.itemHeightAligner+itemId),BX.type.isDomNode(nodeAligner)&&nodeAligner.clientHeight<oldHeight&&(nodeAligner.style.minHeight=oldHeight+"px",setTimeout((function(){nodeAligner.style.minHeight="0px"}),1))),this.bindBasketItemEvents(this.items[itemId]),this.filter.isActive()&&this.filter.highlightSearchMatch(this.items[itemId])}}},restoreBasketItems:function(items){var oldItemId,newItemId,basketItemNode;if(items&&0!==Object.keys(items).length)for(oldItemId in items)items.hasOwnProperty(oldItemId)&&(newItemId=items[oldItemId],this.isItemShown(oldItemId)&&(this.changeShownItem(oldItemId,newItemId,!0),basketItemNode=BX(this.ids.item+oldItemId),BX.type.isDomNode(basketItemNode)&&(basketItemNode.id=this.ids.item+newItemId,basketItemNode.setAttribute("data-id",newItemId))),this.changeSortedItem(oldItemId,!1,!0))},bindBasketItemEvents:function(itemData){if(itemData){var itemNode=BX(this.ids.item+itemData.ID);BX.type.isDomNode(itemNode)&&(this.bindQuantityEvents(itemNode,itemData),this.bindSkuEvents(itemNode,itemData),this.bindImageEvents(itemNode,itemData),this.bindActionEvents(itemNode,itemData),this.bindRestoreAction(itemNode,itemData),this.bindItemWarningEvents(itemNode,itemData))}},bindQuantityEvents:function(node,data){if(node&&data&&this.isItemAvailable(data.ID)){var entity,block=this.getEntity(node,"basket-item-quantity-block");if(block){var startEventName=this.isTouch?"touchstart":"mousedown",endEventName=this.isTouch?"touchend":"mou
1seup";entity=this.getEntity(block,"basket-item-quantity-minus"),BX.bind(entity,startEventName,BX.proxy(this.startQuantityInterval,this)),BX.bind(entity,endEventName,BX.proxy(this.clearQuantityInterval,this)),BX.bind(entity,"mouseout",BX.proxy(this.clearQuantityInterval,this)),BX.bind(entity,"click",BX.proxy(this.quantityMinus,this)),entity=this.getEntity(block,"basket-item-quantity-plus"),BX.bind(entity,startEventName,BX.proxy(this.startQuantityInterval,this)),BX.bind(entity,endEventName,BX.proxy(this.clearQuantityInterval,this)),BX.bind(entity,"mouseout",BX.proxy(this.clearQuantityInterval,this)),BX.bind(entity,"click",BX.proxy(this.quantityPlus,this)),entity=this.getEntity(block,"basket-item-quantity-field"),BX.bind(entity,"change",BX.proxy(this.quantityChange,this))}}},startQuantityInterval:function(){var target=BX.proxy_context,func="basket-item-quantity-minus"===target.getAttribute("data-entity")?BX.proxy(this.quantityMinus,this):BX.proxy(this.quantityPlus,this);this.quantityDelay=setTimeout(BX.delegate((function(){this.quantityTimer=setInterval((function(){func(target)}),150)}),this),300)},clearQuantityInterval:function(){clearTimeout(this.quantityDelay),clearInterval(this.quantityTimer)},quantityPlus:function(target){BX.type.isDomNode(target)||(target=BX.proxy_context,this.clearQuantityInterval());var itemData=this.getItemDataByTarget(target);if(itemData){var quantityField=BX(this.ids.quantity+itemData.ID),isQuantityFloat=this.isQuantityFloat(itemData),currentQuantity=isQuantityFloat?parseFloat(quantityField.value):Math.round(quantityField.value),measureRatio=isQuantityFloat?parseFloat(itemData.MEASURE_RATIO):parseInt(itemData.MEASURE_RATIO),quantity=parseFloat((currentQuantity+measureRatio).toFixed(5));quantity=this.getCorrectQuantity(itemData,quantity),this.setQuantity(itemData,quantity)}},quantityMinus:function(target){target=BX.type.isDomNode(target)?target:BX.proxy_context;var itemData=this.getItemDataByTarget(target);if(itemData){var quantityField=BX(this.ids.quantity+itemData.ID),isQuantityFloat=this.isQuantityFloat(itemData),currentQuantity=isQuantityFloat?parseFloat(quantityField.value):Math.round(quantityField.value),measureRatio=isQuantityFloat?parseFloat(itemData.MEASURE_RATIO):parseInt(itemData.MEASURE_RATIO),quantity=parseFloat((currentQuantity-measureRatio).toFixed(5));quantity=this.getCorrectQuantity(itemData,quantity),this.setQuantity(itemData,quantity)}},quantityChange:function(){var itemData=this.getItemDataByTarget(BX.proxy_context),quantityField,quantity;itemData&&(quantityField=BX(this.ids.quantity+itemData.ID),quantity=this.getCorrectQuantity(itemData,quantityField.value),this.setQuantity(itemData,quantity))},isQuantityFloat:function(item){return"Y"===this.params.QUANTITY_FLOAT||parseInt(item.MEASURE_RATIO)!==parseFloat(item.MEASURE_RATIO)},getCorrectQuantity:function(itemData,quantity){var isQuantityFloat=this.isQuantityFloat(itemData),measureRatio=isQuantityFloat?parseFloat(itemData.MEASURE_RATIO):parseInt(itemData.MEASURE_RATIO),availableQuantity=0;(quantity=(isQuantityFloat?parseFloat(quantity):parseInt(quantity,10))||0)<0&&(quantity=0),measureRatio>0&&quantity<measureRatio&&(quantity=measureRatio),"Y"===itemData.CHECK_MAX_QUANTITY&&(availableQuantity=isQuantityFloat?parseFloat(itemData.AVAILABLE_QUANTITY):parseInt(itemData.AVAILABLE_QUANTITY))>0&&quantity>availableQuantity&&(quantity=availableQuantity);var reminder=(quantity/measureRatio-(quantity/measureRatio).toFixed(0)).toFixed(5),remain;return 0===parseFloat(reminder)?quantity:(0!==measureRatio&&1!==measureRatio&&(remain=quantity*this.precisionFactor%(measureRatio*this.precisionFactor)/this.precisionFactor,measureRatio>0&&remain>0&&(remain>=measureRatio/2&&(0===availableQuantity||quantity+measureRatio-remain<=availableQuantity)?quantity+=measureRatio-remain:quantity-=remain)),quantity=isQuantityFloat?parseFloat(quantity):parseInt(quantity,10))},setQuantity:function(itemData,quantity){var quantityField=BX(this.ids.quantity+itemData.ID),currentQuantity;quantityField&&(quantity=parseFloat(quantity),currentQuantity=parseFloat(quantityField.getAttribute("data-value")),quantityField.value=quantity,parseFloat(itemData.QUANTITY)!==parseFloat(quantity)&&(this.animatePriceByQuantity(itemData,quantity),this.actionPool.changeQuantity(itemData.ID,quantity,currentQuantity)))},animatePriceByQuantity:function(itemData,quantity){var priceNode=BX(this.ids.sumPrice+itemData.ID);if(BX.type.isDomNode(priceNode)){var quantityMultiplier=quantity/parseFloat(itemData.MEASURE_RATIO),startPrice=parseFloat(itemData.SUM_PRICE),finalPrice=parseFloat(itemData.PRICE)*quantityMultiplier,isInt=parseInt(startPrice)===parseFloat(startPrice)&&parseInt(finalPrice)===parseFloat(finalPrice);startPrice!==finalPrice&&(this.items[itemData.ID].QUANTITY=quantity,this.items[itemData.ID].SUM_PRICE=finalPrice,new BX.easing({duration:"Y"===this.params.USE_PRICE_ANIMATION?this.duration.priceAnimation:1,start:{price:startPrice},finish:{price:finalPrice},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:BX.delegate((function(state){isInt||(state.price=(state.price+state.price%1e3/1e3).toFixed(5)),priceNode.innerHTML=this.getFormatPrice(state.price,itemData.CURRENCY)}),this),complete:BX.delegate((function(){var node,price;
1priceNode.innerHTML=this.getFormatPrice(finalPrice,itemData.CURRENCY),node=BX(this.ids.sumPriceOld+itemData.ID),BX.type.isDomNode(node)&&(price=parseFloat(itemData.FULL_PRICE)*quantityMultiplier,node.innerHTML=this.getFormatPrice(price,itemData.CURRENCY)),node=BX(this.ids.sumPriceDiff+itemData.ID),BX.type.isDomNode(node)&&(price=parseFloat(itemData.DISCOUNT_PRICE)*quantityMultiplier,node.innerHTML=this.getFormatPrice(price,itemData.CURRENCY))}),this)}).animate())}},getItemDataByTarget:function(target){var data=!1,id,itemNode=BX.findParent(target,{attrs:{"data-entity":"basket-item"}});return itemNode&&(id=itemNode.getAttribute("data-id"),data=this.items[id]),data},bindSkuEvents:function(node,data){if(node&&data){var blocks=this.getEntities(node,"basket-item-sku-block"),blockEntities,i,l,ii,ll;for(i=0,l=blocks.length;i<l;i++)for(ii=0,ll=(blockEntities=this.getEntities(blocks[i],"basket-item-sku-field")).length;ii<ll;ii++)BX.bind(blockEntities[ii],"click",BX.proxy(this.changeSku,this))}},changeSku:function(){var i,l,target=BX.proxy_context;if(!BX.hasClass(target,"selected")){var itemData=this.getItemDataByTarget(target);if(itemData){var basketItemNode=BX(this.ids.item+itemData.ID);if(basketItemNode){var currentSkuListNodes=this.getEntities(target.parentNode,"basket-item-sku-field");for(i=0,l=currentSkuListNodes.length;i<l;i++)currentSkuListNodes[i].isEqualNode(target)?BX.addClass(currentSkuListNodes[i],"selected"):BX.removeClass(currentSkuListNodes[i],"selected");this.actionPool.changeSku(itemData.ID,this.getSkuPropertyValues(basketItemNode),this.getInitialSkuPropertyValues(basketItemNode))}}}},getSkuPropertyValues:function(basketItemNode){for(var propertyValues={},propNodes=this.getEntities(basketItemNode,"basket-item-sku-field",".selected"),i=0,l=propNodes.length;i<l;i++)propertyValues[propNodes[i].getAttribute("data-property")]=BX.util.htmlspecialcharsback(propNodes[i].getAttribute("data-value-id"));return propertyValues},getInitialSkuPropertyValues:function(basketItemNode){for(var propertyValues={},propNodes=this.getEntities(basketItemNode,"basket-item-sku-field",'[data-initial="true"]'),i=0,l=propNodes.length;i<l;i++)propertyValues[propNodes[i].getAttribute("data-property")]=BX.util.htmlspecialcharsback(propNodes[i].getAttribute("data-value-id"));return propertyValues},bindImageEvents:function(node,data){if(node&&data)for(var images=node.querySelectorAll(".basket-item-custom-block-photo-item"),i=0,l=images.length;i<l;i++)BX.bind(images[i],"click",BX.proxy(this.showPropertyImagePopup,this))},showPropertyImagePopup:function(){var target,propertyCode,imageIndex,item,imageSrc,i;if(target=BX.proxy_context,item=this.getItemDataByTarget(target),propertyCode=target.getAttribute("data-column-property-code"),imageIndex=target.getAttribute("data-image-index"),item&&item.COLUMN_LIST)for(i in item.COLUMN_LIST)if(item.COLUMN_LIST.hasOwnProperty(i)&&item.COLUMN_LIST[i].CODE===propertyCode&&item.COLUMN_LIST[i].VALUE[imageIndex]){imageSrc=item.COLUMN_LIST[i].VALUE[imageIndex].IMAGE_SRC_ORIGINAL;break}if(imageSrc){this.imagePopup&&this.imagePopup.destroy();var imageId="bx-soa-image-popup-content",that=this;this.imagePopup=new BX.PopupWindow("bx-soa-image-popup",null,{lightShadow:!0,offsetTop:0,offsetLeft:0,closeIcon:{top:"3px",right:"10px"},autoHide:!0,bindOptions:{position:"bottom"},closeByEsc:!0,zIndex:100,events:{onPopupShow:function(){BX.create("IMG",{props:{src:imageSrc},events:{load:function(){var content=BX(imageId);if(content){var windowSize=BX.GetWindowInnerSize(),ratio=that.isMobile?.5:.9,contentHeight,contentWidth;BX.cleanNode(content),content.appendChild(this),contentHeight=content.offsetHeight,contentWidth=content.offsetWidth,contentHeight>windowSize.innerHeight*ratio&&(content.style.height=windowSize.innerHeight*ratio+"px",content.style.width=contentWidth*(windowSize.innerHeight*ratio/contentHeight)+"px",contentHeight=content.offsetHeight,contentWidth=content.offsetWidth),contentWidth>windowSize.innerWidth*ratio&&(content.style.width=windowSize.innerWidth*ratio+"px",content.style.height=contentHeight*(windowSize.innerWidth*ratio/contentWidth)+"px"),content.style.height=content.offsetHeight+"px",content.style.width=content.offsetWidth+"px",that.imagePopup.adjustPosition()}}}})},onPopupClose:function(){this.destroy()}},content:BX.create("DIV",{props:{id:imageId}})}),this.imagePopup.show()}},bindActionEvents:function(node,data){if(node&&data){var entity;if(BX.util.in_array("DELETE",this.params.COLUMNS_LIST))for(var i=0,l=(entity=this.getEntities(node,"basket-item-delete")).length;i<l;i++)BX.bind(entity[i],"click",BX.proxy(this.deleteAction,this));BX.util.in_array("DELAY",this.params.COLUMNS_LIST)&&(entity=this.getEntity(node,"basket-item-add-delayed"),BX.bind(entity,"click",BX.proxy(this.addDelayedAction,this))),entity=this.getEntity(node,"basket-item-remove-delayed"),BX.bind(entity,"click",BX.proxy(this.removeDelayedAction,this)),entity=this.getEntity(node,"basket-item-merge-sku-link"),BX.bind(entity,"click",BX.proxy(this.mergeAction,this)),entity=this.getEntity(node,"basket-item-show-sim
1ilar-link"),BX.bind(entity,"click",BX.delegate((function(){this.toggleFilter("similar")}),this))}},deleteAction:function(){var itemData=this.getItemDataByTarget(BX.proxy_context);itemData&&(this.actionPool.deleteItem(itemData.ID),this.items[itemData.ID].SHOW_LOADING=!0,"Y"===this.params.SHOW_RESTORE&&this.isItemAvailable(itemData.ID)&&(this.items[itemData.ID].SHOW_RESTORE=!0),this.redrawBasketItemNode(itemData.ID))},addDelayedAction:function(){var itemData=this.getItemDataByTarget(BX.proxy_context);itemData&&(this.actionPool.addDelayed(itemData.ID),this.items[itemData.ID].SHOW_LOADING=!0,this.redrawBasketItemNode(itemData.ID))},removeDelayedAction:function(){var itemData=this.getItemDataByTarget(BX.proxy_context);itemData&&(this.actionPool.removeDelayed(itemData.ID),this.items[itemData.ID].SHOW_LOADING=!0,this.redrawBasketItemNode(itemData.ID))},mergeAction:function(){var itemData=this.getItemDataByTarget(BX.proxy_context);itemData&&this.actionPool.mergeSku(itemData.ID)},bindRestoreAction:function(node,itemData){node&&itemData&&"Y"===this.params.SHOW_RESTORE&&(BX.bind(this.getEntity(node,"basket-item-restore-button"),"click",BX.delegate((function(){this.actionPool.restoreItem(itemData.ID,{PRODUCT_ID:itemData.PRODUCT_ID,QUANTITY:itemData.QUANTITY,PROPS:itemData.PROPS_ALL,SORT:itemData.SORT,MODULE:itemData.MODULE,PRODUCT_PROVIDER_CLASS:itemData.PRODUCT_PROVIDER_CLASS}),this.items[itemData.ID].SHOW_RESTORE=!1,this.items[itemData.ID].SHOW_LOADING=!0,this.redrawBasketItemNode(itemData.ID)}),this)),BX.bind(this.getEntity(node,"basket-item-close-restore-button"),"click",BX.delegate((function(){this.deleteBasketItem(itemData.ID,!1,!0)}),this)))},bindItemWarningEvents:function(node,data){node&&data&&BX.bind(this.getEntity(BX(this.ids.item+data.ID),"basket-item-warning-close"),"click",BX.proxy(this.closeItemWarnings,this))},closeItemWarnings:function(){var target=BX.proxy_context;if(BX.type.isDomNode(target)){var itemData=this.getItemDataByTarget(target);this.items[itemData.ID].WARNINGS=[],this.warningItems.splice(BX.util.array_search(itemData.ID,this.warningItems),1),this.redrawBasketItemNode(itemData.ID),this.editWarnings()}},renderBasketItem:function(template,data){var clonedData=BX.clone(data);return BX.type.isPlainObject(clonedData)&&(clonedData.USE_FILTER=this.useItemsFilter&&!this.filter.currentFilter.similarHash.length),Mustache.render(template,clonedData)},render:function(template,data){return Mustache.render(template,data)},checkAnalytics:function(data){if(data&&data.basket){var itemId,itemsDiff={};for(var i in data.basket)data.basket.hasOwnProperty(i)&&(i.indexOf("QUANTITY_")>=0?(itemId=i.substr(9),this.items[itemId]&&(itemsDiff[itemId]=parseFloat(data.basket[i])-parseFloat(BX(this.ids.quantity+itemId).getAttribute("data-value")))):i.indexOf("DELETE_")>=0?(itemId=i.substr(7),this.items[itemId]&&(itemsDiff[itemId]=-parseFloat(this.items[itemId].QUANTITY))):i.indexOf("RESTORE_")>=0&&(itemId=i.substr(8),this.items[itemId]&&(itemsDiff[itemId]=parseFloat(this.items[itemId].QUANTITY))));this.setAnalyticsDataLayer(itemsDiff)}},setAnalyticsDataLayer:function(itemsDiff){if(itemsDiff&&0!==Object.keys(itemsDiff).length){window[this.params.DATA_LAYER_NAME]=window[this.params.DATA_LAYER_NAME]||[];var plus=[],minus=[];for(var itemId in itemsDiff)itemsDiff.hasOwnProperty(itemId)&&(itemsDiff[itemId]>0?plus.push(this.getItemAnalyticsInfo(itemId,itemsDiff[itemId])):itemsDiff[itemId]<0&&minus.push(this.getItemAnalyticsInfo(itemId,itemsDiff[itemId])));plus.length&&window[this.params.DATA_LAYER_NAME].push({event:"addToCart",ecommerce:{currencyCode:this.items[itemId].CURRENCY||"",add:{products:plus}}}),minus.length&&window[this.params.DATA_LAYER_NAME].push({event:"removeFromCart",ecommerce:{currencyCode:this.items[itemId].CURRENCY||"",remove:{products:minus}}})}},getItemAnalyticsInfo:function(itemId,diff){if(!this.items[itemId])return{};for(var brand=(this.items[itemId].BRAND||"").split(",  ").join("/"),variants=[],selectedSku=this.getEntities(BX(this.ids.item+itemId),"basket-item-sku-field",".selected"),i=0,l=selectedSku.length;i<l;i++)variants.push(selectedSku[i].getAttribute("data-sku-name"));return{name:this.items[itemId].NAME||"",id:this.items[itemId].PRODUCT_ID||"",price:this.items[itemId].PRICE||0,brand:brand,variant:variants.join("/"),quantity:Math.abs(diff)}}},BX((function(){BX.Sale.BasketComponent.checkMinPrice()}))}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.