1!function(t){"use strict";t.JCCatalogItem||(t.JCCatalogItem=function(t){if(this.productType=0,this.showQuantity=!0,this.showAbsent=!0,this.showOldPrice=!1,this.showMaxQuantity="N",this.relativeQuantityFactor=5,this.showPercent=!1,this.showSkuProps=!1,this.basketAction="ADD",this.showClosePopup=!1,this.useCompare=!1,this.showSubscription=!1,this.visual={ID:"",PICT_ID:"",SECOND_PICT_ID:"",PICT_SLIDER_ID:"",QUANTITY_ID:"",QUANTITY_UP_ID:"",QUANTITY_DOWN_ID:"",QUANTITY_BLOCK:"",PRICE_ID:"",PRICE_OLD_ID:"",DSC_PERC:"",SECOND_DSC_PERC:"",DISPLAY_PROP_DIV:"",BASKET_PROP_DIV:"",SUBSCRIBE_ID:""},this.product={checkQuantity:!1,maxQuantity:0,stepQuantity:1,isDblQuantity:!1,canBuy:!0,name:"",pict:{},id:0,addUrl:"",buyUrl:""},this.basketMode="",this.basketData={useProps:!1,emptyProps:!1,quantity:"quantity",props:"prop",basketUrl:"",sku_props:"",sku_props_var:"basket_props",add_url:"",buy_url:""},this.compareData={compareUrl:"",compareDeleteUrl:"",comparePath:""},this.defaultPict={pict:null},this.touch=null,this.quantityDelay=null,this.quantityTimer=null,this.checkQuantity=!1,this.maxQuantity=0,this.minQuantity=0,this.stepQuantity=1,this.isDblQuantity=!1,this.canBuy=!0,this.precision=6,this.precisionFactor=Math.pow(10,this.precision),this.bigData=!1,this.fullDisplayMode=!1,this.viewMode="",this.templateTheme="",this.currentPriceMode="",this.currentPrices=[],this.currentPriceSelected=0,this.currentQuantityRanges=[],this.currentQuantityRangeSelected=0,this.offers=[],this.offerNum=0,this.treeProps=[],this.selectedValues={},this.obProduct=null,this.blockNodes={},this.obQuantity=null,this.obQuantityUp=null,this.obQuantityDown=null,this.obQuantityLimit={},this.obPict=null,this.obPictSlider=null,this.obPrice=null,this.obTree=null,this.obBuyBtn=null,this.obNotAvail=null,this.obSubscribe=null,this.obDscPerc=null,this.obSkuProps=null,this.obFavorite=[],this.obCompare=[],this.basketUrl="",this.basketParams={},this.basketActionProps={},this.hoverTimer=null,this.hoverStateChangeForbidden=!1,this.mouseX=null,this.mouseY=null,this.useEnhancedEcommerce=!1,this.dataLayerName="dataLayer",this.brandProperty=!1,this.offersPopupOverlay=null,this.errorCode=0,this.debounceTimeout=null,this.isQuantityChanging=!1,this.sliders=new Map,this.isOffersPopupOpen=!1,this.isOffersPopupFirstOpen=!1,"object"==typeof t){switch(t.PRODUCT_TYPE&&(this.productType=parseInt(t.PRODUCT_TYPE,10)),this.componentId=t.COMPONENT_ID,this.showQuantity=t.SHOW_QUANTITY,this.showAbsent=t.SHOW_ABSENT,this.showOldPrice=t.SHOW_OLD_PRICE,this.showMaxQuantity=t.SHOW_MAX_QUANTITY,this.relativeQuantityFactor=parseInt(t.RELATIVE_QUANTITY_FACTOR),this.showPercent=t.SHOW_DISCOUNT_PERCENT,this.showSkuProps=t.SHOW_SKU_PROPS,this.showSubscription=t.USE_SUBSCRIBE,t.ADD_TO_BASKET_ACTION&&(this.basketAction=t.ADD_TO_BASKET_ACTION),this.showClosePopup=t.SHOW_CLOSE_POPUP,this.useCompare=t.DISPLAY_COMPARE,this.fullDisplayMode="Y"===t.PRODUCT_DISPLAY_MODE,this.bigData=t.BIG_DATA,this.viewMode=t.VIEW_MODE||"",this.templateTheme=t.TEMPLATE_THEME||"",this.useEnhancedEcommerce="Y"===t.USE_ENHANCED_ECOMMERCE,this.dataLayerName=t.DATA_LAYER_NAME,this.brandProperty=t.BRAND_PROPERTY,this.fillItemAllPrices="Y"===t.FILL_ITEM_ALL_PRICES||!0===t.FILL_ITEM_ALL_PRICES,this.scrollSliderOnHover="Y"===t.SCROLL_ON_HOVER,this.skuVariant=t.SKU_VARIANT,this.visual=t.VISUAL,this.productType){case 0:case 1:case 2:case 7:t.PRODUCT&&"object"==typeof t.PRODUCT?(this.currentPriceMode=t.PRODUCT.ITEM_PRICE_MODE,this.currentPrices=t.PRODUCT.ITEM_PRICES,this.allCurrentPrices=t.PRODUCT.ITEM_ALL_PRICES,this.currentPriceSelected=t.PRODUCT.ITEM_PRICE_SELECTED,this.currentQuantityRanges=t.PRODUCT.ITEM_QUANTITY_RANGES,this.currentQuantityRangeSelected=t.PRODUCT.ITEM_QUANTITY_RANGE_SELECTED,this.showQuantity&&(this.product.checkQuantity=t.PRODUCT.CHECK_QUANTITY,this.product.isDblQuantity=t.PRODUCT.QUANTITY_FLOAT,this.product.checkQuantity&&(this.product.maxQuantity=this.product.isDblQuantity?parseFloat(t.PRODUCT.MAX_QUANTITY):parseInt(t.PRODUCT.MAX_QUANTITY,10)),this.product.stepQuantity=this.product.isDblQuantity?parseFloat(t.PRODUCT.STEP_QUANTITY):parseInt(t.PRODUCT.STEP_QUANTITY,10),this.checkQuantity=this.product.checkQuantity,this.isDblQuantity=this.product.isDblQuantity,this.stepQuantity=this.product.stepQuantity,this.maxQuantity=this.product.maxQuantity,this.minQuantity="Q"===this.currentPriceMode?parseFloat(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity,this.isDblQuantity&&(this.stepQuantity=Math.round(this.stepQuantity*this.precisionFactor)/this.precisionFactor)),this.product.canBuy=t.PRODUCT.CAN_BUY,t.PRODUCT.MORE_PHOTO_COUNT&&(this.product.morePhotoCount=t.PRODUCT.MORE_PHOTO_COUNT,this.product.morePhoto=t.PRODUCT.MORE_PHOTO),t.PRODUCT.RCM_ID&&(this.product.rcmId=t.PRODUCT.RCM_ID),this.canBuy=this.product.canBuy,this.product.name=t.PRODUCT.NAME,this.product.pict=t.PRODUCT.PICT,this.product.id=t.PRODUCT.ID,this.product.DETAIL_PAGE_URL=t.PRODUCT.DETAIL_PAGE_URL,t.PRODUCT.ADD_URL&&(this.product.addUrl=t.PRODUCT.ADD_URL),t.PRODUCT.BUY_URL&&(this.product.buyUrl=t.PRODUCT.BUY_URL),t.BASKET&&"object"==typeof t.BASKET&&(this.basketData.useProps=t.BASKET.ADD_PROPS,this.basketData.emptyProps=t.BASKET.EMPTY_PROPS)):this.errorCode=-1;break;case 3:t.PRODUCT&&"object"==typeof t.PRODUCT&&(this.product.name=t.PRODUCT.NAME,this.product.id=t.PRODUCT.ID,this.product.DETAIL_PAGE_URL=t.PRODUCT.DETAIL_PAGE_URL,t.PRODUCT.RCM_ID&&(this.product.rcmId=t.PRODUCT.RCM_ID)),t.OFFERS&&BX.type.isArray(t.OF
1FERS)&&(this.offers=t.OFFERS,this.offerNum=0,t.OFFER_SELECTED&&(this.offerNum=parseInt(t.OFFER_SELECTED,10)),isNaN(this.offerNum)&&(this.offerNum=0),t.TREE_PROPS&&(this.treeProps=t.TREE_PROPS),t.TREE_PROPS_CODES&&(this.treePropsCodes=t.TREE_PROPS_CODES),t.DEFAULT_PICTURE&&(this.defaultPict.pict=t.DEFAULT_PICTURE.PICTURE),t.USE_SKU_TITLE&&(this.useSkuTitle=t.USE_SKU_TITLE),t.USE_SKU_DISTINCT_URL&&(this.useSkuDistinctUrl=t.USE_SKU_DISTINCT_URL),t.USE_SKU_SEO&&(this.useSkuSeo=t.USE_SKU_SEO));break;default:this.errorCode=-1}t.BASKET&&"object"==typeof t.BASKET&&(t.BASKET.QUANTITY&&(this.basketData.quantity=t.BASKET.QUANTITY),t.BASKET.PROPS&&(this.basketData.props=t.BASKET.PROPS),t.BASKET.BASKET_URL&&(this.basketData.basketUrl=t.BASKET.BASKET_URL),3===this.productType&&t.BASKET.SKU_PROPS&&(this.basketData.sku_props=t.BASKET.SKU_PROPS),t.BASKET.ADD_URL_TEMPLATE&&(this.basketData.add_url=t.BASKET.ADD_URL_TEMPLATE),t.BASKET.BUY_URL_TEMPLATE&&(this.basketData.buy_url=t.BASKET.BUY_URL_TEMPLATE),""===this.basketData.add_url&&""===this.basketData.buy_url&&(this.errorCode=-1024)),this.useCompare&&(t.COMPARE&&"object"==typeof t.COMPARE?(t.COMPARE.COMPARE_PATH&&(this.compareData.comparePath=t.COMPARE.COMPARE_PATH),t.COMPARE.COMPARE_URL_TEMPLATE?this.compareData.compareUrl=t.COMPARE.COMPARE_URL_TEMPLATE:this.useCompare=!1,t.COMPARE.COMPARE_DELETE_URL_TEMPLATE?this.compareData.compareDeleteUrl=t.COMPARE.COMPARE_DELETE_URL_TEMPLATE:this.useCompare=!1):this.useCompare=!1),this.isFacebookConversionCustomizeProductEventEnabled=t.IS_FACEBOOK_CONVERSION_CUSTOMIZE_PRODUCT_EVENT_ENABLED,this.priceTableTitle=t.PRICE_TABLE_TITLE,t.ALL_PRICES_NAMES&&(this.allItemsNames=t.ALL_PRICES_NAMES),this.usePriceRanges=t.USE_PRICE_COUNT,this.useRatioInRanges=t.USE_RATIO_IN_RANGES}0===this.errorCode?BX.ready(BX.delegate(this.init,this)):console.error(`Product card render error, code: ${this.errorCode}`)},t.JCCatalogItem.prototype={init:async function(){var t=0;if(this.obProduct=BX(this.visual.ID),this.obProduct||(this.errorCode=-1),this.obPictSlider=BX(this.visual.PICT_SLIDER_ID),this.obPict=BX(this.visual.PICT_ID),this.obPict||this.obPictSlider||(this.errorCode=-2),this.obPrice=this.obProduct.querySelectorAll('[data-entity="price"]'),this.obPriceOld=this.obProduct.querySelectorAll('[data-entity="price-old"]'),this.obPrice.length||(this.errorCode=-16),this.usePriceRanges&&(this.obPriceRanges=this.getEntities(this.obProduct,"price-table")),this.obOffersPopup=BX(this.visual.OFFERS_POPUP),this.obOffersPopupOpenButton=BX(this.visual.OFFERS_POPUP_OPEN_BUTTON),this.obOffersPopupCloseButton=BX(this.visual.OFFERS_POPUP_CLOSE_BUTTON),this.obOffersPopupPicture=BX(this.visual.OFFERS_POPUP_PICTURE),this.obOffersPopupSliderContainer=BX(this.visual.OFFERS_POPUP_SLIDER),this.obOffersPriceList=BX(this.visual.OFFERS_POPUP_PRICE_LIST),this.obOffersPopupCloseButton&&this.obOffersPopupCloseButton.addEventListener("click",this.closeOffersPopup.bind(this)),this.showQuantity&&this.visual.QUANTITY_ID&&(this.obQuantity=BX(this.visual.QUANTITY_ID),this.blockNodes.quantity=BX(this.visual.QUANTITY_BLOCK),this.visual.QUANTITY_UP_ID&&(this.obQuantityUp=BX(this.visual.QUANTITY_UP_ID)),this.visual.QUANTITY_DOWN_ID&&(this.obQuantityDown=BX(this.visual.QUANTITY_DOWN_ID))),this.visual.QUANTITY_LIMIT&&"N"!==this.showMaxQuantity&&(this.obQuantityLimit.all=this.getEntities(this.obProduct,this.visual.QUANTITY_LIMIT),this.obQuantityLimit.all.length&&(this.obQuantityLimit.value=this.getEntities(this.obProduct,"quantity-limit-value"),this.obQuantityLimit.value.length||(this.obQuantityLimit.all=null))),this.visual.BUY_ID&&(this.obBuyBtn=BX(this.visual.BUY_ID)),this.visual.TREE_ID&&(this.obTree=BX(this.visual.TREE_ID),this.obTree||(this.errorCode=-256)),this.visual.QUANTITY_MEASURE&&(this.obMeasure=BX(this.visual.QUANTITY_MEASURE)),this.obNotAvail=this.getEntities(this.obProduct,this.visual.NOT_AVAILABLE_MESS),this.showSubscription&&(this.obSubscribe=BX(this.visual.SUBSCRIBE_ID)),this.showPercent&&(this.obDscPerc=this.obProduct.querySelectorAll('[data-entity="price-discount-percent"]')),this.showSkuProps&&this.visual.DISPLAY_PROP_DIV&&(this.obSkuProps=this.getEntities(this.obProduct,this.visual.DISPLAY_PROP_DIV)),0===this.errorCode){if(this.bigData){var e=BX.findChildren(this.obProduct,{tag:"a"},!0);if(e)for(t in e)e.hasOwnProperty(t)&&e[t].getAttribute("href")==this.product.DETAIL_PAGE_URL&&BX.bind(e[t],"click",BX.proxy(this.rememberProductRecommendation,this))}this.showQuantity&&(this.obQuantityUp&&BX.bind(this.obQuantityUp,"click",BX.delegate(this.quantityUp,this)),this.obQuantityDown&&BX.bind(this.obQuantityDown,"click",BX.delegate(this.quantityDown,this)),this.obQuantity&&(BX.bind(this.obQuantity,"ke
1ydown",BX.delegate(this.quantityKeydown,this)),BX.bind(this.obQuantity,"change",BX.delegate(this.quantityChange,this)),BX.bind(this.obQuantity,"focus",BX.delegate(this.quantityInputFocus,this)))),setTimeout((()=>this.initFavorite()),0),this.initOneClick();switch((3===this.productType?parseInt(this.offers[this.offerNum]?.MORE_PHOTO_COUNT):parseInt(this.product.morePhotoCount))>1&&this.obPictSlider&&await this.initProductSlider(),this.productType){case 0:case 1:case 2:case 7:this.setPrice();break;case 3:if(this.offers.length>0){const t=BX.findChildren(this.obTree,{tagName:"li"},!0);if(t&&t.length)for(let e=0;e<t.length;e++)BX.bind(t[e],"click",BX.delegate(this.selectOfferProp,this));this.setCurrent()}}3===this.productType&&this.obOffersPopupOpenButton&&"PREVIEW"===this.skuVariant&&BX.bind(this.obOffersPopupOpenButton,"click",this.openOffersPopup.bind(this)),this.obBuyBtn&&("ADD"===this.basketAction?BX.bind(this.obBuyBtn,"click",(()=>this.quantityUp())):BX.bind(this.obBuyBtn,"click",(()=>this.basket()))),this.useCompare&&(this.obCompare=this.obProduct.querySelectorAll("[data-compared]"),this.obCompare.length&&this.obCompare.forEach((t=>{t.addEventListener("click",(()=>this.compare()))})),BX.addCustomEvent("onCatalogDeleteCompare",(t=>this.checkDeletedCompare(t))))}else-256===this.errorCode&&this.obBuyBtn&&(this.obBuyBtn.style.display="none"),console.error(`Product card render error, code: ${this.errorCode}`)},getEntity:function(t,e,s){return t&&e?(s=s||"",t.querySelector(s+'[data-entity="'+e+'"]')):null},getEntities:function(t,e,s){return t&&e?(s=s||"",t.querySelectorAll(s+'[data-entity="'+e+'"]')):{length:0}},openOffersPopup:function(){this.isOffersPopupFirstOpen||(this.isOffersPopupFirstOpen=!0),this.showOffersPopup(),this.sliders.get(this.obOffersPopupSliderContainer)?.update()},showOffersPopup:function(){this.offersPopupOverlay=BX.Sotbit.B2C.showOverlay(1e5),BX.Sotbit.B2C.fixBodyScroll(),BX.Sotbit.B2C.showElement(this.obOffersPopup,{callback:async t=>{parseInt(this.product.morePhotoCount)>1&&await this.initOffersPopupSlider(),document.addEventListener("click",(e=>{!e.composedPath().includes(t)&&this.isOffersPopupOpen&&this.closeOffersPopup()})),this.isOffersPopupOpen=!0}})},closeOffersPopup:function(){this.offersPopupOverlay?.hide(),BX.Sotbit.B2C.unfixBodyScroll(),BX.Sotbit.B2C.hideElement(this.obOffersPopup),this.isOffersPopupOpen=!1},initFavorite:function(){this.obFavorite=this.obProduct.querySelectorAll("[data-favorite]"),this.obFavorite.length&&(this.obFavorite.forEach((t=>{BX.bind(t,"click",BX.proxy(this.toggleFavorite,this))})),3===this.productType&&"true"===this.obFavorite[0].dataset.favorite&&(this.offers[this.offerNum].IS_FAVORITE=!0))},setFavorite:async function(){if(void 0===this.offers[this.offerNum].IS_FAVORITE){const t=await BX.ajax.runAction("sotbit:b2c.favorite.check",{data:{productId:this.offers[this.offerNum].ID,siteId:BX.message("SITE_ID")}});"success"===t.status?this.offers[this.offerNum].IS_FAVORITE=t.data:BX.Sotbit.B2C.showMessage(BX.message("TITLE_ERROR"),{icon:"error"})}this.offers[this.offerNum].IS_FAVORITE?this.obFavorite.length&&this.obFavorite.forEach((t=>{t.classList.add("active"),t.setAttribute("title",BX.message("IN_FAVORITE")),t.dataset.favorite=!0})):this.obFavorite.length&&this.obFavorite.forEach((t=>{t.classList.remove("active"),t.setAttribute("title",BX.message("TO_FAVORITE")),t.dataset.favorite=!1}))},toggleFavorite:function(t){t.preventDefault();"true"===this.obFavorite[0].dataset.favorite?this.removeFromFavorite():this.addToFavorite()},addToFavorite:function(){const t={productId:3===this.productType?this.offers[this.offerNum].ID:this.product.id.toString(),siteId:BX.message("SITE_ID")};if(3===this.productType){const e=[];for(const t in this.selectedValues)if(this.selectedValues.hasOwnProperty(t)){const s=t.slice(t.indexOf("_")+1),i=this.selectedValues[t],a=this.treeProps.find((t=>+t.ID==+s)).VALUES[i].NAME;e.push({NAME:this.treePropsCodes[s].NAME,CODE:this.treePropsCodes[s].CODE,VALUE:a})}t.options={PROPS:e}}BX.ajax.runAction("sotbit:b2c.favorite.add",{data:t}).then((t=>{"success"===t.status?(BX.Sotbit.B2C.showMessage(BX.message("TITLE_SUCCESSFUL_FAVORITE")),this.obFavorite.forEach((t=>{t.dataset.favorite="true",t.setAttribute("title",BX.message("IN_FAVORITE")),t.classList.add("active")})),3===this.productType&&(this.offers[this.offerNum].IS_FAVORITE=!0),BX.onCustomEvent("OnBasketChange"),BX.onCustomEvent(BX.Sotbit.B2C.yandex.eventName,{name:BX.Sotbit.B2C.yandex.goals.ADD_TO_FAVORITES,params:{product_name:this.product.name,product_url:this.product.DETAIL_PAGE_URL}})):BX.Sotbit.B2C.showMessage(BX.message("TITLE_ERROR"),{icon:"error"})}))},removeFromFavorite:function(){BX.ajax.runAction("sotbit:b2c.favorite.remove",{data:{productId:3===this.productType?this.offers[this.offerNum].ID:this.product.id.toString(),siteId:BX.message("S
1ITE_ID")}}).then((t=>{"success"===t.status?(BX.Sotbit.B2C.showMessage(BX.message("TITLE_SUCCESSFUL_FAVORITE_REMOVE")),this.obFavorite.forEach((t=>{t.dataset.favorite="false",t.setAttribute("title",BX.message("TO_FAVORITE")),t.classList.remove("active")})),3===this.productType&&(this.offers[this.offerNum].IS_FAVORITE=!1),BX.onCustomEvent("OnBasketChange")):BX.Sotbit.B2C.showMessage(BX.message("TITLE_ERROR"),{icon:"error"})}))},initOneClick:function(){this.obOneClick=this.obProduct.querySelectorAll("[data-oneclick]"),this.obOneClick.length&&this.obOneClick.forEach((t=>{BX.bind(t,"click",(()=>{BX.Sotbit.B2C.showOneClick({PRODUCT_ID:3===this.productType?this.offers[this.offerNum].ID:this.product.id.toString(),PRODUCT_MEASURE_RATIO:this.stepQuantity},"",{width:957}).then((()=>{BX.onCustomEvent(BX.Sotbit.B2C.yandex.eventName,{name:BX.Sotbit.B2C.yandex.goals.BUY_ONE_CLICK,params:{product_name:this.product.name,product_url:this.product.DETAIL_PAGE_URL}}),this.isOffersPopupOpen&&this.closeOffersPopup()}))}))}))},setAnalyticsDataLayer:function(e){if(this.useEnhancedEcommerce&&this.dataLayerName){var s,i,a,o,r,n,h={},u={},c=[];switch(this.productType){case 0:case 1:case 2:case 7:h={id:this.product.id,name:this.product.name,price:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].PRICE,brand:BX.type.isArray(this.brandProperty)?this.brandProperty.join("/"):this.brandProperty};break;case 3:for(s in this.offers[this.offerNum].TREE)if(this.offers[this.offerNum].TREE.hasOwnProperty(s))for(i in o=s.substring(5),r=this.offers[this.offerNum].TREE[s],this.treeProps)if(this.treeProps.hasOwnProperty(i)&&this.treeProps[i].ID==o)for(a in this.treeProps[i].VALUES)if((n=this.treeProps[i].VALUES[a]).ID==r){c.push(n.NAME);break}h={id:this.offers[this.offerNum].ID,name:this.offers[this.offerNum].NAME,price:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].PRICE,brand:BX.type.isArray(this.brandProperty)?this.brandProperty.join("/"):this.brandProperty,variant:c.join("/")}}if("addToCart"===e)u={ecommerce:{currencyCode:this.currentPrices[this.currentPriceSelected]&&this.currentPrices[this.currentPriceSelected].CURRENCY||"",add:{products:[{name:h.name||"",id:h.id||"",price:h.price||0,brand:h.brand||"",category:h.category||"",variant:h.variant||"",quantity:this.showQuantity&&this.obQuantity?this.obQuantity.value:1}]}}};t[this.dataLayerName]=t[this.dataLayerName]||[],t[this.dataLayerName].push(u)}},hoverOn:function(t){clearTimeout(this.hoverTimer),this.obProduct.style.height=getComputedStyle(this.obProduct).height,BX.addClass(this.obProduct,"hover"),BX.PreventDefault(t)},hoverOff:function(t){this.hoverStateChangeForbidden||(BX.removeClass(this.obProduct,"hover"),this.hoverTimer=setTimeout(BX.delegate((function(){this.obProduct.style.height="auto"}),this),300),BX.PreventDefault(t))},getCookie:function(t){var e=document.cookie.match(new RegExp("(?:^|; )"+t.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},rememberProductRecommendation:function(){var t,e=BX.cookie_prefix+"_RCM_PRODUCT_LOG",s=this.getCookie(e),i=!1,a=[];s&&(a=s.split("."));for(var o=a.length;o--;)(t=a[o].split("-"))[0]==this.product.id?((t=a[o].split("-"))[1]=this.product.rcmId,t[2]=BX.current_server_time,a[o]=t.join("-"),i=!0):BX.current_server_time-t[2]>2592e3&&a.splice(o,1);i||a.push([this.product.id,this.product.rcmId,BX.current_server_time].join("-"));var r=a.join("."),n=new Date((new Date).getTime()+31536e7).toUTCString();document.cookie=e+"="+r+"; path=/; expires="+n+"; domain="+BX.cookie_domain},getQuantityInputValue:function(){return this.isDblQuantity?parseFloat(this.obQuantity.value):Math.round(this.obQuantity.value)},quantityKeydown:function(t){1===t.key.length&&!1===/[0-9.,]/.test(t.key)&&t.preventDefault()},quantityUp:function(){if(0===this.errorCode&&this.showQuantity&&this.canBuy){let t=this.getQuantityInputValue();if(Number.isNaN(t))return;if(t+=this.stepQuantity,this.checkQuantity&&t>this.maxQuantity)return;this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t,this.updateBasketQuantity(),this.setPrice()}else console.error(`Product card render error, code: ${this.errorCode}, showQuantity = ${this.showQuantity}, canBuy = ${this.canBuy}`)},quantityDown:function(){if(0===this.errorCode&&this.showQuantity&&this.canBuy){let t=this.getQuantityInputValue();if(Number.isNaN(t))return;t-=this.stepQuantity,this.checkPriceRange(t),this.isDblQuantity&&(t=Math.round(t*this.precisionFactor)/this.precisionFactor),this.obQuantity.value=t,this.updateBasketQuantity(),0===t&&this.hideQuantityBlock(),this.setPrice()}else console.error(`Product card render error, code: ${this.errorCode}, showQuantity = ${this.showQuantity}, canBuy = ${this.canBuy}`)},quantityInputFocus:function(t){this.oldQuantity=t.target.value},quantityChange:function(){var t,e=0;0===this.errorCode&&this.showQuantity?(this.canBuy?(e=this.getQuantityInputValue(),isNaN(e)?this.obQuantity.value=this.minQuantity:(this.checkQuantity&&e>this.maxQuantity&&(e=this.maxQuantity),this.checkPriceRange(e),e=(t=Math.floor(Math.round(e*this.precisionFactor/this.stepQuantity)/this.precisionFactor)||1)<=1?this.stepQuantity:t*this.stepQuantity,(e=Math.round(e*this.precisionFactor)/this.precisionFactor)<this.minQuantity&&(e=this.minQuantity),this.obQuantity.value=e)):this.obQuantity.value=this.minQuantity,this.updateBasketQuantity(),this.setPrice()):console.error(`Product card render error, code: ${this.errorCode}, showQuantity = ${this.showQuantity}`)},quantitySet:function(t){var e,s,i=this.offers[t],a=this.offers[this.offerNum];
1if(0===this.errorCode){if(this.canBuy=i.CAN_BUY,this.currentPriceMode=i.ITEM_PRICE_MODE,this.currentPrices=i.ITEM_PRICES,this.currentPriceSelected=i.ITEM_PRICE_SELECTED,this.currentQuantityRanges=i.ITEM_QUANTITY_RANGES,this.currentQuantityRangeSelected=i.ITEM_QUANTITY_RANGE_SELECTED,this.canBuy?(this.blockNodes.quantity?parseFloat(i.currentBasketQuantity)?(this.blockNodes.quantity.style.display="",this.obBuyBtn&&(this.obBuyBtn.style.display="none",this.obBuyBtn.removeAttribute("disabled"))):(this.blockNodes.quantity.style.display="none",this.obBuyBtn&&(this.obBuyBtn.style.display="",this.obBuyBtn.removeAttribute("disabled"))):this.obBuyBtn&&(this.obBuyBtn.style.display="",this.obBuyBtn.removeAttribute("disabled")),this.obNotAvail.length&&this.obNotAvail.forEach((t=>t.style.display="none")),this.obSubscribe&&(this.obSubscribe.style.display="none"),this.obOneClick.length&&this.obOneClick.forEach((t=>{t.style.display="";const e=t.closest(".catalog-item-popup-bottom-oneclick");e?.closest(".catalog-item-popup-buttons").classList.remove("one-click")}))):(this.blockNodes.quantity&&(this.blockNodes.quantity.style.display="none"),this.obBuyBtn&&this.obBuyBtn.setAttribute("disabled","disabled"),this.obNotAvail.length&&this.obNotAvail.forEach((t=>t.style.display="")),this.obOneClick.length&&this.obOneClick.forEach((t=>{t.style.display="none";const e=t.closest(".catalog-item-popup-bottom-oneclick");e?.closest(".catalog-item-popup-buttons").classList.add("one-click")})),this.obSubscribe&&("Y"===i.CATALOG_SUBSCRIBE?(this.obSubscribe.style.display="",this.obBuyBtn.style.display="none"):this.obSubscribe.style.display="none")),this.isDblQuantity=i.QUANTITY_FLOAT,this.checkQuantity=i.CHECK_QUANTITY,this.isDblQuantity?(this.stepQuantity=Math.round(parseFloat(i.STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor,this.maxQuantity=parseFloat(i.MAX_QUANTITY),this.minQuantity="Q"===this.currentPriceMode?parseFloat(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity):(this.stepQuantity=parseInt(i.STEP_QUANTITY,10),this.maxQuantity=parseInt(i.MAX_QUANTITY,10),this.minQuantity="Q"===this.currentPriceMode?parseInt(this.currentPrices[this.currentPriceSelected].MIN_QUANTITY):this.stepQuantity),this.showQuantity){var o=a.ITEM_PRICES.length&&a.ITEM_PRICES[a.ITEM_PRICE_SELECTED]&&a.ITEM_PRICES[a.ITEM_PRICE_SELECTED].MIN_QUANTITY!=this.minQuantity;e=this.isDblQuantity?Math.round(parseFloat(a.STEP_QUANTITY)*this.precisionFactor)/this.precisionFactor!==this.stepQuantity||o||a.MEASURE!==i.MEASURE||this.checkQuantity&&parseFloat(a.MAX_QUANTITY)>this.maxQuantity&&parseFloat(this.obQuantity.value)>this.maxQuantity:parseInt(a.STEP_QUANTITY,10)!==this.stepQuantity||o||a.MEASURE!==i.MEASURE||this.checkQuantity&&parseInt(a.MAX_QUANTITY,10)>this.maxQuantity&&parseInt(this.obQuantity.value,10)>this.maxQuantity,this.obQuantity.disabled=!this.canBuy,e&&(this.obQuantity.value=this.minQuantity)}this.obQuantityLimit.all&&(this.checkQuantity&&0!=this.maxQuantity&&this.canBuy?("M"===this.showMaxQuantity?s=this.maxQuantity/this.stepQuantity>=this.relativeQuantityFactor?BX.message(`RELATIVE_QUANTITY_MANY_${this.componentId}`):BX.message(`RELATIVE_QUANTITY_FEW_${this.componentId}`):(s=this.maxQuantity,i.MEASURE&&(s+=" "+i.MEASURE)),this.obQuantityLimit.value.forEach((t=>{BX.adjust(t,{html:s})})),this.obQuantityLimit.all.forEach((t=>{BX.adjust(t,{style:{display:""}})}))):(this.obQuantityLimit.value.forEach((t=>{BX.adjust(t,{html:""})})),this.obQuantityLimit.all.forEach((t=>{BX.adjust(t,{style:{display:"none"}})})))),this.obMeasure&&(i.MEASURE?BX.adjust(this.obMeasure,{html:i.MEASURE}):BX.adjust(this.obMeasure,{html:""})),this.usePriceRanges&&this.obPriceRanges.length&&this.obPriceRanges.forEac
1h((t=>{const e=Object.keys(this.currentQuantityRanges).length>1,s=i.ITEM_ALL_PRICES&&Object.keys(i.ITEM_ALL_PRICES[0].PRICES).length>1;if(e||s){const s=this.getEntity(t,"price-table-header"),a=this.getEntity(t,"price-table-items");s.textContent=BX.message("PRICE_TABLE_RANGES_HEADER").replace("#TITLE#",this.priceTableTitle).replace("#RATIO#",`${this.stepQuantity||1} ${i.MEASURE}`),a.replaceChildren();const o=new DocumentFragment;if(e){if(i.ITEM_ALL_PRICES)for(const t of i.ITEM_ALL_PRICES){const e=BX.message("PRICE_TABLE_RANGE_FROM").replace("#FROM#",`${t.QUANTITY_FROM} ${i.MEASURE}`),s=t.QUANTITY_TO?BX.message("PRICE_TABLE_RANGE_TO").replace("#TO#",`${t.QUANTITY_TO} ${i.MEASURE}`):BX.message("PRICE_TABLE_RANGE_MORE"),a=BX.create("li",{text:`${e} ${s}`}),r=[];for(const e in t.PRICES)if(t.PRICES.hasOwnProperty(e)){const s=t.PRICES[e],i=this.useRatioInRanges?s.PRINT_RATIO_PRICE:s.PRINT_PRICE,a=BX.create("li",{html:`${this.allItemsNames[s.PRICE_TYPE_ID]} - <span>${i}</span>`});r.push(a)}o.appendChild(BX.create("li",{children:[BX.create("ul",{children:[a,...r]})]}))}else for(const t in i.ITEM_QUANTITY_RANGES)if(i.ITEM_QUANTITY_RANGES.hasOwnProperty(t)){const e=i.ITEM_QUANTITY_RANGES[t];if("ZERO-INF"!==e.HASH){const t=i.ITEM_PRICES.find((t=>t.QUANTITY_HASH===e.HASH));if(t){const s=BX.message("PRICE_TABLE_RANGE_FROM").replace("#FROM#",`${e.SORT_FROM} ${i.MEASURE}`),a=e.QUANTITY_TO?BX.message("PRICE_TABLE_RANGE_TO").replace("#TO#",`${e.SORT_TO} ${i.MEASURE}`):BX.message("PRICE_TABLE_RANGE_MORE"),r=BX.create("li",{html:`${s} ${a} - <span>${this.useRatioInRanges?t.PRINT_RATIO_PRICE:t.PRINT_PRICE}</span>`});o.appendChild(r)}}}}else for(const t in i.ITEM_ALL_PRICES[0].PRICES)if(i.ITEM_ALL_PRICES[0].PRICES.hasOwnProperty(t)){const e=i.ITEM_ALL_PRICES[0].PRICES[t],s=this.useRatioInRanges?e.PRINT_RATIO_PRICE:e.PRINT_PRICE,a=BX.create("li",{html:`${this.allItemsNames[e.PRICE_TYPE_ID]} - <span>${s}</span>`});o.appendChild(a)}a.appendChild(o),t.classList.remove("d-none")}else t.classList.add("d-none")}))}else console.error(`Product card render error, code: ${this.errorCode}`)},initSlider:async function(t,e={}){this.sliders.get(t)?.destroy?.();const s={pagination:{enabled:!0,element:t.closest('[data-entity="item"]').querySelector(".keen-slider__pagination")},defaultAnimation:{duration:2500},slides:{spacing:16},plugins:[t=>{const e=()=>t.update();BX.addCustomEvent("crosssellTabChange",e),t.on("destroyed",(()=>BX.removeCustomEvent("crosssellTabChange",e))),this.scrollSliderOnHover&&(t.on("created",(t=>this.updateSlidersOverlayPagination(t))),t.on("optionsChanged",(t=>this.updateSlidersOverlayPagination(t))))}]};t.style.display="",await BX.Sotbit.B2C.createSlider(t,{...s,...e},"KeenSlider").then((e=>this.sliders.set(t,e)))},initProductSlider:async function(){await this.initSlider(this.obPictSlider)},initOffersPopupSlider:async function(){await this.initSlider(this.obOffersPopupSliderContainer,{pagination:{enabled:!0,element:this.obProduct.querySelector(".catalog-item-popup__pagination")}})},changeSliderPictures:function(t,e,s){t.replaceChildren(...e.map(((t,i)=>BX.create("div",{props:{className:"catalog-item__image keen-slider__slide "+(0==i?" active":"")},children:[BX.Sotbit.B2C.loadLazy(e[i].SRC,this.offers[s].NAME||this.product.name,{className:"img-contain"})]}))))},updateSlidersOverlayPagination:function(t){const e=t.container.parentElement.querySelector(".overlay-pagination-container");e&&e.remove();const s=document.createElement("div");s.classList.add("overlay-pagination-container"),t.slides.forEach(((e,i)=>{const a=document.createElement("div");a.classList.add("overlay-pagination-slide"),s.appendChild(a),a.addEventListener("mouseenter",(()=>t.moveToIdx(i)))})),t.container.parentElement.appendChild(s)},selectOfferProp:function(){if(!this.isQuantityChanging){var t=0,e=[],s=null,i=BX.proxy_context;if(i&&i.hasAttribute("data-treevalue")){if(BX.hasClass(i,"selected"))return;if(e=i.getAttribute("data-treevalue").split("_"),this.searchOfferPropIndex(e[0],e[1])){if((s=BX.findChildren(i.parentNode,{tagName:"li"},!1))&&0<s.length)for(t=0;t<s.length;t++)s[t].getAttribute("data-onevalue")===e[1]?BX.addClass(s[t],"selected"):BX.removeClass(s[t],"selected");this.isFacebookConversionCustomizeProductEventEnabled&&BX.Type.isArrayFilled(this.offers)&&BX.Type.isObject(this.offers[this.offerNum])&&BX.ajax.runAction("sale.facebookconversion.customizeProduct",{data:{offerId:this.offers[this.offerNum].ID}})}}}},searchOfferPropIndex:function(t,e){var s,i,a="",o=!1,r=[],n=[],h=-1,u={},c=[];for(s=0;s<this.treeProps.length;s++)if(this.treeProps[s].ID===t){h=s;break}if(-1<h){for(s=0;s<h;s++)u[a="PROP_"+this.treeProps[s].ID]=this.selectedValues[a];if(a="PROP_"+this.treeProps[h].ID,!(o=this.getRowValues(u,a)))return!1;if(!BX.util.in_array(e,o))return!1;for(u[a]=e,s=h+1;s<this.treeProps.length;s++){if(a="PROP_"+this.treeProps[s].ID,!(o=this.getRowValues(u,a)))return!1;
1if(n=[],this.showAbsent)for(r=[],c=[],c=BX.clone(u,!0),i=0;i<o.length;i++)c[a]=o[i],n[n.length]=o[i],this.getCanBuy(c)&&(r[r.length]=o[i]);else r=o;this.selectedValues[a]&&BX.util.in_array(this.selectedValues[a],r)?u[a]=this.selectedValues[a]:this.showAbsent?u[a]=r.length>0?r[0]:n[0]:u[a]=r[0],this.updateRow(s,u[a],o,r)}this.selectedValues=u,this.changeInfo()}return!0},updateRow:function(t,e,s,i){var a=0,o="",r=!1,n=null,h=this.obTree.querySelectorAll('[data-entity="sku-line-block"]');if(t>-1&&t<h.length&&(n=BX.findChildren(h[t],{tagName:"li"},!1))&&0<n.length)for(a=0;a<n.length;a++)(r=(o=n[a].getAttribute("data-onevalue"))===e)?BX.addClass(n[a],"selected"):BX.removeClass(n[a],"selected"),BX.util.in_array(o,i)?BX.removeClass(n[a],"notallowed"):BX.addClass(n[a],"notallowed"),n[a].style.display=BX.util.in_array(o,s)?"":"none",r&&(h[t].style.display=0==o&&1==i.length?"none":"")},getRowValues:function(t,e){var s,i=0,a=[],o=!1,r=!0;if(0===t.length){for(i=0;i<this.offers.length;i++)BX.util.in_array(this.offers[i].TREE[e],a)||(a[a.length]=this.offers[i].TREE[e]);o=!0}else for(i=0;i<this.offers.length;i++){for(s in r=!0,t)if(t[s]!==this.offers[i].TREE[s]){r=!1;break}r&&(BX.util.in_array(this.offers[i].TREE[e],a)||(a[a.length]=this.offers[i].TREE[e]),o=!0)}return!!o&&a},getCanBuy:function(t){var e,s,i=!1,a=!0;for(e=0;e<this.offers.length;e++){for(s in a=!0,t)if(t[s]!==this.offers[e].TREE[s]){a=!1;break}if(a&&this.offers[e].CAN_BUY){i=!0;break}}return i},setCurrent:function(){var t,e=0,s=[],i="",a=!1,o={},r=[],n=this.offers[this.offerNum].TREE;for(t=0;t<this.treeProps.length&&(i="PROP_"+this.treeProps[t].ID,a=this.getRowValues(o,i));t++){if(BX.util.in_array(n[i],a)?o[i]=n[i]:(o[i]=a[0],this.offerNum=0),this.showAbsent)for(s=[],r=[],r=BX.clone(o,!0),e=0;e<a.length;e++)r[i]=a[e],this.getCanBuy(r)&&(s[s.length]=a[e]);else s=a;this.updateRow(t,o[i],a,s)}this.selectedValues=o,this.changeInfo()},changeInfo:async function(){var t,e,s=-1,i=!0;for(t=0;t<this.offers.length;t++){for(e in i=!0,this.selectedValues)if(this.selectedValues[e]!==this.offers[t].TREE[e]){i=!1;break}if(i){s=t;break}}if(s<=-1)return;if(parseInt(this.offers[s].MORE_PHOTO_COUNT)>1&&this.obPictSlider)this.obPict&&(this.obPict.style.display="none"),this.obPictSlider.style.display="",this.changeSliderPictures(this.obPictSlider,this.offers[s].MORE_PHOTO,s),await this.initProductSlider(),"PREVIEW"===this.skuVariant&&(this.obOffersPopupSliderContainer.style.display="",this.changeSliderPictures(this.obOffersPopupSliderContainer,this.offers[s].MORE_PHOTO,s),await this.initOffersPopupSlider());else{if(this.obPictSlider){this.obPictSlider.style.display="none";const t=this.sliders.get(this.obPictSlider);t&&(t.destroy(),this.sliders.delete(this.obPictSlider))}if(this.obOffersPopupSliderContainer){this.obOffersPopupSliderContainer.style.display="none";const t=this.sliders.get(this.obOffersPopupSliderContainer);t&&(t.destroy(),this.sliders.delete(this.obOffersPopupSliderContainer))}this.obPict&&(this.obPict.replaceChildren(BX.Sotbit.B2C.loadLazy(this.offers[s].PREVIEW_PICTURE?this.offers[s].PREVIEW_PICTURE.SRC:this.defaultPict.pict.SRC,this.offers[s].NAME||this.product.name,{className:"img-contain"})),this.obPict.style.display=""),this.obOffersPopupPicture&&(this.obOffersPopupPicture.replaceChildren(BX.Sotbit.B2C.loadLazy(this.offers[s].PREVIEW_PICTURE?this.offers[s].PREVIEW_PICTURE.SRC:this.defaultPict.pict.SRC,this.offers[s].NAME||this.product.name,{className:"img-contain"})),this.obOffersPopupPicture.style.display="")}this.showSkuProps&&this.obSkuProps.length&&this.obSkuProps.forEach((t=>{this.offers[s].DISPLAY_PROPERTIES.length?BX.adjust(t,{style:{display:""},html:this.offers[s].DISPLAY_PROPERTIES}):BX.adjust(t,{style:{display:"none"},html:""})})),this.quantitySet(s),this.setCompared(this.offers[s].COMPARED??!1);const a=this.offerNum;if(this.offerNum=s,this.setTitle(),this.setSkuUrl(),this.setName(),this.setFavorite(),this.showQuantity&&this.obQuantity&&(this.obQuantity.value=this.offers[this.offerNum].currentBasketQuantity?this.offers[this.offerNum].currentBasketQuantity:0),this.setPrice(),this.offerNum!==a){const t={needSubscribeCheck:!this.offers[this.offerNum].CAN_BUY,newId:this.offers[this.offerNum].ID};BX.onCustomEvent("onCatalogProductOfferChange",[t])}},setTitle:function(){this.getEntity(this.obProduct,this.visual.DETAIL_LINK).setAttribute("title",this.offers[this.offerNum].NAME),this.getEntity(this.obProduct,this.visual.PRODUCT_NAME).setAttribute("title",this.offers[this.offerNum].NAME)},setSkuUrl:function(){"Y"===this.useSkuDistinctUrl&&(this.getEntity(this.obProduct,this.visual.DETAIL_LINK).setAttribute("href",this.offers[this.offerNum].DETAIL_PAGE_URL),this.getEntity(this.obProduct,this.visual.PRODUCT_NAME).setAttribute("href",this.offers[this.offerNum].DETAIL_PAGE_URL))},setName:function(){"Y"===this.useSkuTitle&&this.getEntities(this.obProduct,this.visual.PRODUCT_NAME).forEac
1h((t=>{t.textContent=this.offers[this.offerNum].NAME?this.offers[this.offerNum].NAME:this.product.name}))},setOfferPopupTitle:function(){const t=this.offers[this.offerNum],e=this.obOffersPopup.querySelector('[data-entity="offers-popup-title"]');"Y"===this.useSkuTitle?e.textContent=t.NAME?t.NAME:this.product.name:e.textContent=this.product.name},checkPriceRange:function(t){if(void 0!==t&&"Q"==this.currentPriceMode){var e,s=!1;for(var i in this.currentQuantityRanges)if(this.currentQuantityRanges.hasOwnProperty(i)&&(e=this.currentQuantityRanges[i],parseInt(t)>=parseInt(e.SORT_FROM)&&("INF"==e.SORT_TO||parseInt(t)<=parseInt(e.SORT_TO)))){s=!0,this.currentQuantityRangeSelected=e.HASH;break}for(var a in!s&&(e=this.getMinPriceRange())&&(this.currentQuantityRangeSelected=e.HASH),this.currentPrices)if(this.currentPrices.hasOwnProperty(a)&&this.currentPrices[a].QUANTITY_HASH==this.currentQuantityRangeSelected){this.currentPriceSelected=a;break}}},getMinPriceRange:function(){var t;for(var e in this.currentQuantityRanges)this.currentQuantityRanges.hasOwnProperty(e)&&(!t||parseInt(this.currentQuantityRanges[e].SORT_FROM)<parseInt(t.SORT_FROM))&&(t=this.currentQuantityRanges[e]);return t},checkQuantityControls:function(){if(this.obQuantity){var t=this.checkQuantity&&parseFloat(this.obQuantity.value)+this.stepQuantity>this.maxQuantity,e=parseFloat(this.obQuantity.value)-this.stepQuantity<this.minQuantity;t?BX.addClass(this.obQuantityUp,"disabled"):BX.hasClass(this.obQuantityUp,"disabled")&&BX.removeClass(this.obQuantityUp,"disabled"),t&&e?this.obQuantity.setAttribute("disabled","disabled"):this.obQuantity.removeAttribute("disabled")}},setPrice:function(){var t,e,s=!1;if(3===this.productType){var i=this.offers[this.offerNum];i.ITEM_ALL_PRICES&&i.ITEM_ALL_PRICES.forEach((t=>{Object.keys(t.PRICES).length>1&&(s=!0)}))}else this.allCurrentPrices&&this.allCurrentPrices.forEach((t=>{Object.keys(t.PRICES).length>1&&(s=!0)}));this.obQuantity&&this.checkPriceRange(this.obQuantity.value),3===this.productType&&this.fillItemAllPrices,this.checkQuantityControls(),e=this.currentPrices[this.currentPriceSelected],this.obPrice.length&&(this.obPrice.forEach((t=>{e?BX.adjust(t,{html:(s?BX.message("PRICE_FROM")+" ":"")+e.PRINT_RATIO_PRICE}):BX.adjust(t,{html:""})})),this.showOldPrice&&this.obPriceOld.length&&this.obPriceOld.forEach((t=>{e&&e.RATIO_PRICE!==e.RATIO_BASE_PRICE?BX.adjust(t,{style:{display:""},html:e.PRINT_RATIO_BASE_PRICE}):BX.adjust(t,{style:{display:"none"},html:""})})),this.showPercent&&(t=e&&parseInt(e.PERCENT)>0?{style:{display:""},html:-e.PERCENT+"%"}:{style:{display:"none"},html:""},this.obDscPerc.length&&this.obDscPerc.forEach((e=>{BX.adjust(e,t)}))))},setAllPrices:function(){const t=this.offers[this.offerNum];if(1===t.ITEM_ALL_PRICES.length&&1===Object.keys(t.ITEM_ALL_PRICES[0].PRICES).length)return void(this.obOffersPriceList.style.display="none");const e={};this.obOffersPriceList.querySelectorAll("[data-entity]").forEach((t=>{const s=t.dataset.entity;s in e||(e[s]=t.cloneNode(!0))})),BX.cleanNode(this.obOffersPriceList),this.obOffersPriceList.appendChild(e["price-list-block"].cloneNode(!0))},compare:function(){this.obCompare.forEach((t=>{t.dataset.compared="true"===t.dataset.compared?"false":"true",t.setAttribute("title","true"===t.dataset.compared?BX.message("IN_COMPARE"):BX.message("TO_COMPARE"))}));const t="true"===this.obCompare[0].dataset.compared,e=3===this.productType?this.offers[this.offerNum].ID:this.product.id.toString();let s=t?this.compareData.compareUrl:this.compareData.compareDeleteUrl;s&&(this.setCompared(t),s=s.replace("#ID#",e),BX.ajax({method:"POST",dataType:t?"json":"html",url:s+(-1!==s.indexOf("?")?"&":"?")+"ajax_action=Y",onsuccess:s=>t?this.compareResult(s):this.compareDeleteResult(e)}))},compareResult:function(t){t&&(this.offers.length>0&&(this.offers[this.offerNum].COMPARED="OK"===t.STATUS),"OK"===t.STATUS?(BX.onCustomEvent("OnCompareChange"),BX.onCustomEvent("OnBasketChange"),BX.Sotbit.B2C.showMessage(BX.message("COMPARE_MESSAGE_OK"))):BX.Sotbit.B2C.showMessage(BX.message("COMPARE_UNKNOWN_ERROR"),{icon:"error"}))},compareDeleteResult:function(t){BX.onCustomEvent("OnCompareChange"),BX.onCustomEvent("onCatalogDeleteCompare",[t]),BX.Sotbit.B2C.showMessage(BX.message("COMPARE_MESSAGE_DELETE"))},setCompared:function(t){this.obCompare=this.obProduct.querySelectorAll("[data-compared]"),this.obCompare.length&&this.obCompare.forEach((e=>{e.dataset.compared=t,e.setAttribute("title","true"===e.dataset.compared?BX.message("IN_COMPARE"):BX.message("TO_COMPARE"))}))},setCompareInfo:function(t){if(Array.isArray(t))for(var e in this.offers)this.offers.hasOwnProperty(e)&&(this.offers[e].COMPARED=t.includes(Number(this.offers[e].ID)))},checkDeletedCompare:function(t){switch(this.productType){case 0:case 1:case 2:case 7:void 0!==t&&this.product.id!=t||this.setCompared(!1);break;case 3:for(var e=this.offers.length;e--;)if(void 0===t&&(t=this.offers[e].ID),this.offers[e].ID==t){this.offers[e].COMPARED=!1,this.setCompared(!1);break}}},initBasketUrl:function(){switch(this.basketUrl="ADD"===this.basketMode?this.basketData.add_url:this.basketData.buy_url,this.productType){case 1:case 2:case 7:this.basketUrl=this.basketUrl.replace("#ID#",this.product.id.toString());break;case 3:this.basketUrl=this.basketUrl.replace("#ID#",this.offers[this.offerNum].ID)}this.basketParams={ajax_basket:"Y"},this.showQuantity&&(this.basketParams[this.basketData.quantity]=this.basketActionItemQuantity),this.basketData.sku_props&&(this.basketParams[this.basketData.sku_props_var]=this.basketData.sku_props)},fillBasketProps:function(){if(this.visual.BASKET_PROP_DIV){var t=0,e=null,s=!1,i=null;if(this.basketData.useProps&&!this.basketData.emptyProps?this.obPopupProps&&(i=this.obPopupProps):i=BX(this.visual.BASKET_PROP_DIV),i){if((e
1=i.getElementsByTagName("select"))&&e.length)for(t=0;t<e.length;t++)if(!e[t].disabled&&"select-one"===e[t].type.toLowerCase())this.basketActionProps[e[t].name]=e[t].value,this.basketParams[e[t].name]=e[t].value,s=!0;if((e=i.getElementsByTagName("input"))&&e.length)for(t=0;t<e.length;t++)if(!e[t].disabled)switch(e[t].type.toLowerCase()){case"hidden":this.basketActionProps[e[t].name]=e[t].value,this.basketParams[e[t].name]=e[t].value,s=!0;break;case"radio":e[t].checked&&(this.basketActionProps[e[t].name]=e[t].value,this.basketParams[e[t].name]=e[t].value,s=!0)}}s||(this.basketActionProps={},this.basketParams[this.basketData.props]=[],this.basketParams[this.basketData.props][0]=0)}},doDebouncedAction:function(t){clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(t.bind(this),1e3)},doBasketAction:function(t){switch(t){case"ADD":this.basketMode="ADD",this.doDebouncedAction(this.basket);break;case"BUY":this.basketMode="BUY",this.basket();break;case"REMOVE":this.doDebouncedAction(this.removeFromBasket)}},showQuantityBlock:function(){this.obBuyBtn.style.display="none",this.blockNodes.quantity.style.display=""},hideQuantityBlock:function(){this.obBuyBtn.style.display="",this.blockNodes.quantity.style.display="none"},updateBasketQuantity(){this.doDebouncedAction((()=>{let t;switch(this.isQuantityChanging=!0,this.productType){case 1:case 2:case 7:t=this.product.id.toString();break;case 3:t=this.offers[this.offerNum].ID}this.fillBasketProps(),this.basketParams[this.basketData.quantity]=this.getQuantityInputValue(),BX.ajax.runAction("sotbit:b2c.basket.setQuantity",{data:{productData:{PRODUCT_ID:t,PROPS:this.basketParams[this.basketData.props]},siteId:BX.message("SITE_ID"),quantity:this.basketParams[this.basketData.quantity]}}).then((t=>this.basketResult(t)))}))},removeFromBasket:function(){let t;switch(this.productType){case 1:case 2:case 7:t=this.product.id.toString();break;case 3:t=this.offers[this.offerNum].ID}this.fillBasketProps(),BX.ajax.runAction("sotbit:b2c.basket.remove",{data:{productData:{PRODUCT_ID:t,PROPS:[]},siteId:BX.message("SITE_ID"),quantity:Math.abs(this.basketActionItemQuantity)}}).then((t=>{"success"===t.status?(BX.onCustomEvent("OnBasketChange"),BX.Sotbit.B2C.showMessage(BX.message("TITLE_SUCCESSFUL_REMOVE")),3===this.productType&&(this.offers[this.offerNum].currentBasketQuantity=parseFloat(this.offers[this.offerNum].currentBasketQuantity)-1)):BX.Sotbit.B2C.showMessage(BX.message("BASKET_UNKNOWN_ERROR"),{icon:"error"})})),this.basketActionItemQuantity=0},sendToBasket:function(){this.canBuy&&(this.product&&this.product.id&&this.bigData&&this.rememberProductRecommendation(),this.initBasketUrl(),this.fillBasketProps(),BX.ajax({method:"POST",dataType:"json",url:this.basketUrl,data:this.basketParams,onsuccess:BX.proxy(this.basketResult,this)}),this.basketActionItemQuantity=0)},showProductPropertiesPopup:async function(){const[t,e]=await BX.Sotbit.B2C.showPopup({title:BX.message("TITLE_BASKET_PROPS"),html:BX(this.visual.BASKET_PROP_DIV).innerHTML,confirmButtonText:BX.message("BTN_MESSAGE_SEND_PROPS"),width:"650px",useCustomScroll:!1,customClass:{confirmButton:"btn"},didOpen:t=>{t.querySelectorAll("select:not([class])").forEach((t=>BX.Sotbit.B2C.createCustomSelect(t)))}});this.obPopupProps=e.getHtmlContainer(),t.then((t=>{t.isConfirmed&&this.sendToBasket()}))},basket:function(){if(this.canBuy)switch(this.productType){case 1:case 2:case 7:this.basketData.useProps&&!this.basketData.emptyProps?this.showProductPropertiesPopup():this.sendToBasket();break;case 3:this.sendToBasket()}},basketResult:async function(t){const e="success"===t.status;if(e&&(this.setAnalyticsDataLayer("addToCart"),BX.onCustomEvent(BX.Sotbit.B2C.yandex.eventName,{name:BX.Sotbit.B2C.yandex.goals.ADD_TO_CART,params:{product_name:this.product.name,product_url:this.product.DETAIL_PAGE_URL}})),e&&"BUY"===this.basketAction)this.basketRedirect();else if(e){BX.onCustomEvent("OnBasketChange"),BX.findParent(this.obProduct,{className:"bx_sale_gift_main_products"},10)&&BX.onCustomEvent("onAddToBasketMainProduct",[this]),this.isQuantityChanging=!1;const e={};if(!0===BX.Sotbit.B2C.useMinOrderPrice){const t=await BX.ajax.runAction("sotbit:b2c.order.getRemainderPrice",{data:{siteId:BX.message("S
1ITE_ID")}});e.subMessage=t.data}const s="ADD"===t.data.ACTION?"TITLE_SUCCESSFUL":"TITLE_SUCCESSFUL_REMOVE";if(BX.Sotbit.B2C.showMessage(BX.message(s),e),this.showQuantity)if(t.data.QUANTITY?this.showQuantityBlock():this.hideQuantityBlock(),3===this.productType){this.offers[this.offerNum].currentBasketQuantity=t.data.QUANTITY}else parseFloat(this.obQuantity.value)===this.maxQuantity?this.obQuantityUp.classList.add("disabled"):this.obQuantityUp.classList.remove("disabled")}else BX.Sotbit.B2C.showMessage(arResult.MESSAGE||BX.message("BASKET_UNKNOWN_ERROR"),{icon:"error"})},basketRedirect:function(){location.href=this.basketData.basketUrl?this.basketData.basketUrl:BX.message("BASKET_URL")}})}(window); 2//# sourceMappingURL=script.min.js.map
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.