1void 0===window.JItemAction&&(JItemAction=function(t,e){t="object"==typeof t&&t&&t instanceof Node?t:null,e="object"==typeof e&&e?e:{},this.node=t;var i={inited:!1};let o=JSON.stringify(e);Object.defineProperties(this,{inited:{get:function(){return i.inited},set:function(t){t&&(i.inited=!0)}},config:{get:function(){return JSON.parse(o)}}}),this.init()},JItemAction.prototype={constructor:JItemAction,busy:!1,parentNode:null,xhr:null,get class(){return this.constructor.name},get action(){return""},get requestUrl(){return arAsproOptions.SITE_DIR+"ajax/item.php"},get valid(){return this.node&&this.action},get idle(){return!1},activeStateClass:"active",get state(){return this.valid&&BX.hasClass(this.node,this.activeStateClass)},set state(t){if(this.valid&&t!=this.state){t?(BX.addClass(this.node,this.activeStateClass),this.parentNode&&BX.addClass(this.parentNode,this.activeStateClass)):(BX.removeClass(this.node,this.activeStateClass),this.parentNode&&BX.removeClass(this.parentNode,this.activeStateClass)),this.switch&&(this.switch.checked=t,BX.fireEvent(this.switch,"change"));let e=this.getStateTitle(t);this.node.setAttribute("title",e);let i=this.node.querySelector(".info-buttons__item-text");i&&i.setAttribute("title",e),this.isActionRequiresTextChange()&&(this.node.textContent=e)}},prevState:null,get data(){let t={};if(this.valid){let e="";if(e=this.node.classList.contains("js-external-button")?document.querySelector(".catalog-detail"):this.node.closest(".js-popup-block"),e){let i=e.querySelector("[data-item]");if(i&&(t="function"==typeof jQuery?jQuery(i).data("item"):BX.data(i,"item"),void 0!==t&&"object"!=typeof t&&t))try{t=JSON.parse(t.toString())}catch(e){t={}}}}return"object"==typeof t&&t?t:{}},_switch:null,get switch(){return this._switch||(this._switch=this.getSwitch()),this._switch},init:function(){this.inited||(this.inited=!0,this.valid&&(this.node.itemAction=this,this.parentNode=this.node.parentElement,this.bindEvents()))},bindEvents:function(){this.valid&&BX.Type.isFunction(this.handlers.onChangeSwitch)&&this.switch&&BX.bind(this.switch,"change",BX.proxy(this.handlers.onChangeSwitch,this))},unbindEvents:function(){this.valid&&BX.Type.isFunction(this.handlers.onChangeSwitch)&&this.switch&&BX.unbind(this.switch,"change",BX.proxy(this.handlers.onChangeSwitch,this))},fireEvent:function(t){if(this.valid&&!this.busy&&"object"==typeof t&&t){let e=t.type;e&&"click"===e&&BX.proxy(this.handlers.onClickNode,this)(t)}},isStateChanged:function(){return null!==this.prevState&&this.prevState!=this.state},getStateTitle:function(t){return this.valid?t?this.node.getAttribute("data-title_added")||"":this.node.getAttribute("data-title")||"":""},getStateGoalCode:function(t){return"goal_"+this.action+(t?"_add":"_remove")},showStateNotice:function(t,e){if(this.valid&&"function"==typeof JNoticeSurface){let i=JNoticeSurface.get(),o="onAdd2"+this.action.replace(/^\w/,(t=>t.toUpperCase()));o&&"function"==typeof i[o]&&i[o](t,e)}},mkStateNoticeItems:function(t){return[this.node]},getCustomEventName:function(t){if(this.action){return(t||"on")+("JItemAction"+this.action.replace(/^\w/,(t=>t.toUpperCase())))}return""},updateState:function(t){this.valid&&(this.xhr&&this.abortPrevRequest(),this.busy||(this.node.blur(),this.prevState=void 0!==t?t:this.state,this.idle?this.parentNode&&BX.removeClass(this.parentNode,"loadings"):(this.busy=!0,this.sendRequest())))},collectRequestData:async function(){let t=new FormData;t.set("is_ajax_post","Y"),t.set("sessid",BX.bitrix_sessid()),t.set("lang",BX.message("LANGUAGE_ID")),t.set("action",this.action),t.set("state",this.state?1:0),t.set("SITE_ID",BX.message("SITE_ID"));let e=this.data;return e&&(t.set("ID",e.ID),t.set("IBLOCK_ID",e.IBLOCK_ID)),t},makeRequestConfig:async function(){return this.collectRequestData().then(BX.proxy((function(t){let e=this.getCustomEventName("onCollectRequestData");return e&&BX.onCustomEvent(e,[{action:this.action,id:this.node.getAttribute("data-id"),data:t}]),{url:this.requestUrl,data:t,method:"POST",dataType:"json",async:!0,processData:!0,preparePost:!1,scriptsRunFirst:!0,emulateOnload:!0,start:!0,cache:!1}}),this)).catch((function(t){throw t}))},sendRequest:function(){this.valid&&this.makeRequestConfig().then(BX.proxy((function(t){t.onsuccess=BX.proxy((function(e){this.xhr&&this.xhr.status&&("function"==typeof this.onRequestSuccess&&this.onRequestSuccess(e),"function"==typeof this.onRequestComplete&&this.onRequestComplete(t))}),this),t.onfailure=BX.proxy((function(){"function"==typeof this.onRequestFailure&&this.onRequestFailure(),"function"==typeof this.onRequestComplete&&this.onRequestComplete(t)}),this),this.xhr=BX.ajax(t)}),this)).catch(BX.proxy((function(t){setTimeout(BX.proxy((function(){this.isStateChanged()&&(this.state=this.prevState,this.prevState=null),this.parentNode&&BX.removeClass(this.parentNode,"loadings"),this.busy=!1}),this),0)}),this))},onRequestComplete:function(t){setTimeout((()=>{this.parentNode&&BX.removeClass(this.parentNode,"loadings"),this.busy=!1,this.xhr=null}),0)},onRequestSuccess:function(t){let e="object"==typeof t&&t?t:{};if(e.success){if(this.action){let t=this.action.toUpperCase();"object"!=typeof arAsproCounters&&(arAsproCounters={}),"object"!=typeof arAsproCounters[t]&&(arAsproCounters[t]={}),"items"in e&&(arAsproCounters[t].ITEMS=e.items),"count"in e&&(arAsproCounters[t].COUNT=e.count),"title"in e&&(arAsproCounters[t].TITLE=e.title),this.class&&"function"==typeof window[this.class]&&"function"==typeof window[this.class].markBadges&&window[this.class].markBadges();let i=this.state;if(this.class&&"function"==typeof window[this.class]&&"function"==typeof window[this.class].markItems&&window[this.class].markItems(),this.isStateChanged()){let t=this.mkStateNoticeItems(e);void 0!==this.node.dataset.notice&&0==this.node.dataset.notice||this.showStateNotice(t,i),BX.onCustomEvent("onCounterGoals",[{goal:this.getStateGoalCode(i),params:{id:this.node.getAttribute("data-id")}}])}if("reload"in e)for(reloadAction in e.reload){let t=reloadAction.toUpperCase();"items"in e.reload[reloadAction]&&(arAsproCounters[t].ITEMS=e.reload[reloadAction].items),"count"in e.reload[reloadAction]&&(arAsproCounters[t].COUNT=e.reload[reloadAction].count),"title"in e.reload[reloadAction]&&(arAsproCounters[t].TITLE=e.reload[reloadAction].title);let i="JItemAction"+reloadAction.replace(/^\w/,(t=>t.toUpperCase()));"function"==typeof window[i]&&(this.class&&"function"==typeof window[i]&&"function"==typeof window[i].markBadges&&window[i].markBadges(),this.class&&"function"==typeof window[i]&&"function"==typeof window[i].markItems&&window[i].markItems())}}}else if(console.error(e.error),this.isStateChanged()&&(this.state=this.prevState),"function"==typeof JNoticeSurface){JNoticeSurface.get().onResultError(e)}this.finalRequestActions()},onRequestFailure:function(){if(this.isStateChanged()&&(this.state=this.prevState),"function"==typeof JNoticeSurface){JNoticeSurface.get().onRequestError(this.xhr)}},abortPrevRequest:function(){return this.xhr&&this.busy&&(this.xhr.abort(),this.busy=!1,this.xhr=null),this},finalRequestActions:function(){this.valid&&"subscribe"!==this.action&&this.updateDropdownBlocks(this.action)},updateDropdownBlocks:function(t){t||(t="basket");let e=Array.prototype.slice.call(document.querySelectorAll(`.${t}-dropdown`));if(e.length)for(let t in e)BX.removeClass(e[t],"loaded")},getSwitch:function(){let t=null;if(this.valid){let e=this.data;if(e){let i=e.ID;if(i){let e=this.node;for(;e&&!t;)t=e.querySelector('.js-item-action-switch[data-action="'+this.action+'"][data-id="'+i+'"]'),e=e.parentElement}}}return t},isActionRequiresTextChange:function(){return BX.hasClass(this.node,"btn")&&!BX.hasClass(this.node,"item-action__inner--only-icon")},handlers:{onClickNode:function(t){t||(t=window.event);let e=t.target||t.srcElement;void 0!==e&&e&&this.valid&&(this.busy||(this.busy=!0,this.node.blur(),this.prevState=this.state,this.state=!this.state,this.idle?(this.parentNode&&BX.removeClass(this.parentNode,"loadings"),this.busy=!1):this.sendRequest()))},onChangeSwitch:function(t){t||(t=window.event);let e=t.target||t.srcElement;void 0!==e&&e&&this.valid}}},JItemAction.factory=function(t,e){if("object"==typeof t&&t&&t instanceof Node){if(t.itemAction instanceof JItemAction)return t.itemAction;{let i=(t.getAttribute("data-action")||"").trim();if(i){let o="JItemAction"+i.replace(/^\w/,(t=>t.toUpperCase()));if("function"==typeof window[o])return new window[o](t,e)}}}return new window.JItemAction(t,e)},JItemAction.markItems=function(){JItemActionBasket.markItems(),JItemActionService.markItems(),JItemActionCompare.markItems(),JItemActionFavorite.markItems(),JItemActionSubscribe.markItems()},JItemAction.markBadges=function(){JItemActionBasket.markBadges(),JItemActionCompare.markBadges(),JItemActionFavorite.markBadges()},JItemAction.actual=function(){JItemAction.markBadges(),JItemAction.markItems()},JItemAction.reload=function(){BX.ajax({url:arAsproOptions.SITE_DIR+"ajax/actualBasket.php",data:{action:"reload",sessid:BX.bitrix_sessid()},method:"POST",dataType:"html",async:!0,processData:!0,preparePost:!0,scriptsRunFirst:!0,emulateOnload:!0,start:!0,cache:!1,onsuccess:function(t){BX.onCustomEvent("onReloadCounters",[{data:t}])}})},JItemActionCompare=function(t,e){JItemAction.apply(this,arguments)},JItemActionCompare.prototype=Object.create(JItemAction.prototype),JItemActionCompare.prototype.constructor=JItemActionCompare,Object.defineProperties(JItemActionCompare.prototype,{action:{get:()=>"compare"}}),JItemActionCompare.markItems=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.COMPARE&&arAsproCounters.COMPARE&&"object"==typeof arAsproCounters.COMPARE.ITEMS){let t=Array.prototype.slice.call(document.querySelectorAll('.js-item-action.active[data-action="compare"]'));if(t.length){let e=Object.values(arAsproCounters.COMPARE.ITEMS);for(let i in t){let o=BX.data(t[i],"id");if(o&&-1==e.indexOf(o)){(t[i].itemAction instanceof JItemAction?t[i].itemAction:new this(t[i])).state=!1}}}if(arAsproCounters.COMPARE.ITEMS)for(let t in arAsproCounters.COMPARE.ITEMS){let e=arAsproCounters.COMPARE.ITEMS[t],i=Array.prototype.slice.call(document.querySelectorAll('.js-item-action[data-action="compare"][data-id="'+e+'"]:not(.active)'));if(i.length)for(let t in i){(i[t].itemAction instanceof JItemAction?i[t].itemAction:new this(i[t])).state=!0}}}},JItemActionCompare.markBadges=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.COMPARE&&arAsproCounters.COMPARE&&void 0!==arAsproCounters.COMPARE.COUNT){let t=Array.prototype.slice.call(document.querySelectorAll(".js-compare-block"));if(t.length)if(arAsproCounters.COMPARE.COUNT>0)for(let e in t)BX.addClass(t[e],"icon-block-with-counter--count");else for(let e in t)BX.removeClass(t[e],"icon-block-with-counter--count");if(t=Array.prototype.slice.call(document.querySelectorAll(".js-compare-block .count")),t.length)for(let e in t)t[e].textContent=arAsproCounters.COMPARE.COUNT}},JItemActionFavorite=function(t,e){JItemAction.apply(this,arguments)},JItemActionFavorite.prototype=Object.create(JItemAction.prototype),JItemActionFavorite.prototype.constructor=JItemActionFavorite,Object.defineProperties(JItemActionFavorite.prototype,{action:{get:()=>"favorite"}}),JItemActionFavorite.prototype.getStateGoalCode=function(t){return"goal_wish"+(t?"_add":"_remove")},JItemActionFavorite.markBadges=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.FAVORITE&&arAsproCounters.FAVORITE&&void 0!==arAsproCounters.FAVORITE.COUNT){let t=Array.prototype.slice.call(document.querySelectorAll(".js-favorite-block"));if(t.length)if(arAsproCounters.FAVORITE.COUNT>0)for(let e in t)BX.addClass(t[e],"icon-block-with-counter--count");else for(let e in t)BX.removeClass(t[e],"icon-block-with-counter--count");if(t=Array.prototype.slice.call(document.querySelectorAll(".js-favorite-block .count")),t.length)for(let e in t)t[e].textContent=arAsproCounters.FAVORITE.COUNT}},JItemActionFavorite.markItems=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.FAVORITE&&arAsproCounters.FAVORITE&&"object"==typeof arAsproCounters.FAVORITE.ITEMS&&arAsproCounters.FAVORITE.ITEMS){let t=Array.prototype.slice.call(document.querySelectorAll('.js-item-action.active[data-action="favorite"]'));if(t.length){let e=Object.values(arAsproCounters.FAVORITE.ITEMS);for(let i in t){let o=BX.data(t[i],"id");if(o&&-1==e.indexOf(o)){(t[i].itemAction instanceof JItemAction?t[i].itemAction:new this(t[i])).state=!1}}}if(arAsproCounters.FAVORITE.ITEMS)for(let t in arAsproCounters.FAVORITE.ITEMS){let e=arAsproCounters.FAVORITE.ITEMS[t],i=Array.prototype.slice.call(document.querySelectorAll('.js-item-action[data-action="favorite"][data-id="'+e+'"]:not(.active)'));if(i.length)for(let t in i){(i[t].itemAction instanceof JItemAction?i[t].itemAction:new this(i[t])).state=!0}}}},JItemActionSubscribe=function(t,e){JItemAction.apply(this,arguments)},JItemActionSubscribe.prototype=Object.create(JItemAction.prototype),JItemActionSubscribe.prototype.constructor=JItemActionSubscribe,Object.defineProperties(JItemActionSubscribe.prototype,{action:{get:()=>"subscribe"}}),JItemActionSubscribe.markItems=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.SUBSCRIBE&&arAsproCounters.SUBSCRIBE&&"object"==typeof arAsproCounters.SUBSCRIBE.ITEMS){let t=Array.prototype.slice.call(document.querySelectorAll('.js-item-action.active[data-action="subscribe"]'));if(t.length){let e=Object.values(arAsproCounters.SUBSCRIBE.ITEMS);for(let i in t){let o=BX.data(t[i],"id");if(o&&-1==e.indexOf(o)){(t[i].itemAction instanceof JItemAction?t[i].itemAction:new this(t[i])).state=!1}}}if(arAsproCounters.SUBSCRIBE.ITEMS)for(let t in arAsproCounters.SUBSCRIBE.ITEMS){let e=arAsproCounters.SUBSCRIBE.ITEMS[t],i=Array.prototype.slice.call(document.querySelectorAll('.js-item-action[data-action="subscribe"][data-id="'+e+'"]:not(.active)'));if(i.length)for(let t in i){(i[t].itemAction instanceof JItemAction?i[t].itemAction:new this(i[t])).state=!0}}}},JItemActionBasket=function(t,e){JItemAction.apply(this,arguments)},JItemActionBasket.prototype=Object.create(JItemAction.prototype),JItemActionBasket.prototype.constructor=JItemActionBasket,JItemActionBasket.prototype.basketPropsNode=null,Object.defineProperties(JItemActionBasket.prototype,{action:{get:()=>"basket"},state:{get(){return this.valid&&BX.hasClass(this.node,this.activeStateClass)},set(t){if(this.valid&&t!=this.state){t?(BX.addClass(this.node,this.activeStateClass),this.parentNode&&BX.addClass(this.parentNode,this.activeStateClass)):(BX.removeClass(this.node,this.activeStateClass),this.parentNode&&BX.removeClass(this.parentNode,this.activeStateClass)),this.switch&&(this.switch.checked=t,BX.fireEvent(this.switch,"change"));let e=this.getStateTitle(t);this.node.setAttribute("title",e);let i=this.node.querySelector(".info-buttons__item-text");i&&i.setAttribute("title",e),this.isActionRequiresTextChange()&&(this.node.textContent=e)}}}
1,quantity:{get(){if(this.valid){let t=this.node.closest(".buy_block");if(t){let e=t.querySelector(".in_cart .counter__count");if(e)return e.value}}return 1},set(t){if(this.valid){this.node.setAttribute("data-quantity",t);let e=this.node.closest(".buy_block");if(e){let i=e.querySelector(".in_cart .counter__count");i&&(i.value=t)}}}},ratio:{get(){let t=1;return this.valid&&(t=this.node.getAttribute("data-ratio")||1),t<=0&&(t=1),t}},minQuantity:{get(){let t=this.ratio,e=t;if(this.valid){if(e=this.node.getAttribute("data-min"),null===e){let t=this.node.closest(".counter");if(t){let i=t.querySelector(".counter__action--minus");i&&(e=i.getAttribute("data-min"))}}e<t&&(e=t)}return e}},maxQuantity:{get(){if(this.valid&&(maxQuantity=this.node.getAttribute("data-max"),null===maxQuantity)){let t=this.node.closest(".counter");if(t){let e=t.querySelector(".counter__action--plus");e&&(maxQuantity=e.getAttribute("data-max"))}}return maxQuantity}}}),JItemActionBasket.prototype.resetQuantity=function(){this.valid&&(this.quantity=this.minQuantity||this.ratio)},JItemActionBasket.prototype.getBasketPropsNode=function(){let t=null;if(this.valid){let e=this.node.getAttribute("data-bakset_div")||"";e&&(t=BX(e)),!t&&"Y"!==this.node.getAttribute("data-offers")&&this.node.closest(".grid-list__item")&&(t=this.node.closest(".grid-list__item").querySelector(".basket_props_block"))}return t},JItemActionBasket.prototype.collectRequestData=async function(){return JItemAction.prototype.collectRequestData.call(this,arguments).then(BX.proxy((function(t){if(t.set("quantity",this.quantity),this.valid){let e="Y"===this.node.getAttribute("data-offers")?"Y":"N";t.set("offers",e);let o="Y"===this.node.getAttribute("data-add_props")?"Y":"N";t.set("add_props",o);let s="Y"===this.node.getAttribute("data-part_props")?"Y":"N";t.set("part_props",s);let n=this.node.getAttribute("data-props")||"";try{n=n.length?n.split(";"):[]}catch(t){n=[]}t.set("props",JSON.stringify(n));let r=document.querySelector(".rid_item"),a=r?r.getAttribute("rid"):this.node.getAttribute("rid")||!1;t.set("rid",a);let c=!1,l=this.getBasketPropsNode();if(l){let e=l.getElementsByTagName("select");if(e&&e.length)for(i=0;i<e.length;i++)if(!e[i].disabled)switch(e[i].type.toLowerCase()){case"select-one":t.set(e[i].name,e[i].value),c=!0;break;default:break}if(e=l.getElementsByTagName("input"),e&&e.length)for(i=0;i<e.length;i++)if(!e[i].disabled)switch(e[i].type.toLowerCase()){case"hidden":t.set(e[i].name,e[i].value),c=!0;break;case"radio":e[i].checked&&(t.set(e[i].name,e[i].value),c=!0);break;default:break}}if(c||t.set("prop[0]",0),this.isStateChanged()){if("N"===("Y"===this.node.getAttribute("data-empty_props")?"Y":"N"))return this.showBasketPropsForm().then(BX.proxy((function(e){if("object"==typeof e&&e&&e instanceof FormData)for(let i of e.keys())t.set(i,e.get(i));return t}),this)).catch((function(t){throw t}))}}return t}),this))},JItemActionBasket.prototype.showBasketPropsForm=async function(){let t=this;return new Promise(BX.proxy((function(e,o){let s=BX.create({tag:"div",attrs:{"data-event":"jqm","data-name":"message","data-param-form_id":"message","data-param-message_title":encodeURIComponent(BX.message("ADD_BASKET_PROPS_TITLE")),"data-param-message_button_title":encodeURIComponent(BX.message("ADD_BASKET_PROPS_BUTTON_TITLE"))}});BX.append(s,document.body),$(s).jqmEx(BX.proxy((function(t,o,s){let n=o.w[0],r=n.querySelector(".form-body"),a=n.querySelector('.form-footer input[type="submit"]'),c=this.getBasketPropsNode();c&&r&&(r.innerHTML=c.innerHTML),BX.bind(a,"click",BX.proxy((function(){let t=new FormData,o=n.getElementsByTagName("select");if(o&&o.length)for(i=0;i<o.length;i++)if(!o[i].disabled)switch(o[i].type.toLowerCase()){case"select-one":t.set(o[i].name,o[i].value);break;default:break}if(o=n.getElementsByTagName("input"),o&&o.length)for(i=0;i<o.length;i++)if(!o[i].disabled)switch(o[i].type.toLowerCase()){case"hidden":t.set(o[i].name,o[i].value);break;case"radio":o[i].checked&&t.set(o[i].name,o[i].value);break;default:break}e(t);let s=n.querySelector(".jqmClose");if(s)BX.fireEvent(s,"click");else{let t=n.parentElement.querySelector(".jqmOverlay");t?BX.fireEvent(t,"click"):n.innerHTML=""}}),this))}
1),t),BX.proxy((function(t,e,i){this.valid&&this.busy&&o()}),t)),BX.fireEvent(s,"click"),s.remove()})),t)},JItemActionBasket.prototype.onRequestSuccess=function(t){JItemAction.prototype.onRequestSuccess.call(this,t);let e=Array.prototype.slice.call(document.querySelectorAll(".basket-dropdown"));if(e.length)for(let t in e)BX.removeClass(e[t],"loaded")},JItemActionBasket.prototype.mkStateNoticeItems=function(t){let e=JItemAction.prototype.mkStateNoticeItems.call(this,t);if("changed_services"in t)for(i in t.changed_services){let o=t.changed_services[i],s=JItemActionService.get(o);s&&e.push(s.node)}return e},JItemActionBasket.markBadges=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.BASKET&&arAsproCounters.BASKET&&void 0!==arAsproCounters.BASKET.COUNT){let t=Array.prototype.slice.call(document.querySelectorAll(".js-basket-block"));if(t.length){if(arAsproCounters.BASKET.COUNT>0)for(let e in t){BX.addClass(t[e],"icon-block-with-counter--count"),BX.removeClass(t[e],"header-cart__inner--empty"),t[e].closest("a")&&t[e].closest("a").setAttribute("title",arAsproCounters.BASKET.TITLE)}else for(let e in t)BX.removeClass(t[e],"icon-block-with-counter--count"),BX.addClass(t[e],"header-cart__inner--empty");for(let e in t){let i=t[e].closest("a");i&&i.setAttribute("title",arAsproCounters.BASKET.TITLE)}}if(t=Array.prototype.slice.call(document.querySelectorAll(".js-basket-block .count")),t.length)for(let e in t)t[e].textContent=arAsproCounters.BASKET.COUNT}},JItemActionBasket.markItems=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.BASKET&&arAsproCounters.BASKET&&"object"==typeof arAsproCounters.BASKET.ITEMS&&arAsproCounters.BASKET.ITEMS){let t=Array.prototype.slice.call(document.querySelectorAll('.js-item-action.active[data-action="basket"]'));if(t.length){let e=Object.keys(arAsproCounters.BASKET.ITEMS);for(let i in t){let o=BX.data(t[i],"id");if(o&&-1==e.indexOf(o)){let e=t[i].itemAction instanceof JItemAction?t[i].itemAction:new this(t[i]);e.state=!1,e.resetQuantity()}}}if(arAsproCounters.BASKET.ITEMS)for(let e in arAsproCounters.BASKET.ITEMS){let i=e,o=arAsproCounters.BASKET.ITEMS[e];if(t=Array.prototype.slice.call(document.querySelectorAll('.js-item-action[data-action="basket"][data-id="'+i+'"].active')),t.length)for(let e in t){(t[e].itemAction instanceof JItemAction?t[e].itemAction:new this(t[e])).quantity=o}if(t=Array.prototype.slice.call(document.querySelectorAll('.js-item-action[data-action="basket"][data-id="'+i+'"]:not(.active)')),t.length)for(let e in t){let i=t[e].itemAction instanceof JItemAction?t[e].itemAction:new this(t[e]);i.state=!0,i.quantity=o}}}},JItemActionService=function(t,e){JItemAction.apply(this,arguments)},JItemActionService.prototype=Object.create(JItemAction.prototype),JItemActionService.prototype.constructor=JItemActionService,JItemActionService.prototype.basketPropsNode=null,Object.defineProperties(JItemActionService.prototype,{action:{get:()=>"service"},idle:{get(){if(this.valid){let t=this.productId;if(t){if(this.isInBasketPage)return!1;if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.BASKET&&arAsproCounters.BASKET&&"object"==typeof arAsproCounters.BASKET.ITEMS&&arAsproCounters.BASKET.ITEMS){let e=Object.keys(arAsproCounters.BASKET.ITEMS);return-1==e.indexOf(t)&&-1==e.indexOf(t.toString())}}}return!0}},state:{get(){return this.valid&&BX.hasClass(this.node,this.activeStateClass)},set(t){if(this.valid&&t!=this.state){t?(BX.addClass(this.node,this.activeStateClass),this.parentNode&&BX.addClass(this.parentNode,this.activeStateClass)):(BX.removeClass(this.node,this.activeStateClass),this.parentNode&&BX.removeClass(this.parentNode,this.activeStateClass)),this.switch&&(this.switch.checked=t);let e=this.getStateTitle(t);this.node.setAttribute("title",e);let i=this.node.querySelector(".info-buttons__item-text");i&&i.setAttribute("title",e),this.isActionRequiresTextChange()&&(this.node.textContent=e)}}},quantity:{get(){if(this.valid){let t=this.node.closest(".buy_block");if(t){let e=t.querySelector(".in_cart .counter__count");if(e)return e.value}}return 1},set(t){if(this.valid){this.node.setAttribute("data-quantity",t);let e=this.node.closest(".buy_block");if(e){let i=e.querySelector(".in_cart .counter__count");
1i&&(i.value=t)}}}},ratio:{get(){let t=1;return this.valid&&(t=this.node.getAttribute("data-ratio")||1),t<=0&&(t=1),t}},isInBasketPage:{get(){return this.node&&this.node.closest(".services_in_basket_page")}},productId:{get(){let t=0;if(this.valid){let e=this.node.closest(".services-buy-wrapper[data-product_id]");e&&(t=parseInt(e.getAttribute("data-product_id")))}return t>0?t:0}}}),JItemActionService.prototype.bindEvents=function(){if(JItemAction.prototype.bindEvents.call(this,arguments),BX.Type.isFunction(this.handlers.onCollectRequestDataJItemActionBasket)){let t=JItemActionBasket.prototype.getCustomEventName("onCollectRequestData");t&&BX.addCustomEvent(t,BX.proxy(this.handlers.onCollectRequestDataJItemActionBasket,this))}},JItemActionService.prototype.unbindEvents=function(){if(JItemAction.prototype.unbindEvents.call(this,arguments),BX.Type.isFunction(this.handlers.onCollectRequestDataJItemActionBasket)){let t=JItemActionBasket.prototype.getCustomEventName("onCollectRequestData");t&&BX.removeCustomEvent(t,BX.proxy(this.handlers.onCollectRequestDataJItemActionBasket,this))}},JItemActionService.prototype.resetQuantity=function(){this.valid&&(this.quantity=this.ratio)},JItemActionService.prototype.collectRequestData=async function(){return JItemAction.prototype.collectRequestData.call(this,arguments).then(BX.proxy((function(t){return t.set("quantity",this.quantity),t.set("product_id",this.productId),t}),this))},JItemActionService.prototype.onRequestSuccess=function(t){JItemAction.prototype.onRequestSuccess.call(this,t),this.isInBasketPage&&BX.Sale.BasketComponent.sendRequest("refreshAjax",{fullRecalculation:"Y",otherParams:{param:"N"}});let e=Array.prototype.slice.call(document.querySelectorAll(".basket-dropdown"));if(e.length)for(let t in e)BX.removeClass(e[t],"loaded")},JItemActionService.prototype.handlers.onChangeSwitch=function(t){t||(t=window.event);let e=t.target||t.srcElement;if(void 0!==e&&e&&this.valid){let t=this.node.closest(".services-item");if(t){e.checked?t.classList.add("services-item--selected"):t.classList.remove("services-item--selected")}}},JItemActionService.prototype.handlers.onCollectRequestDataJItemActionBasket=function(t){try{if(this.state&&"basket"===t.action&&(t.id==this.productId||-1!==JItemActionService.getDetailSku2Ids().indexOf(t.id))){let e=t.data;if(BX.Type.isObject(e)){let t=this.data;if(t){let i=0;for(;e.get("services["+i+"][ID]");)++i;e.set("services["+i+"][ID]",t.ID),e.set("services["+i+"][IBLOCK_ID]",t.IBLOCK_ID),e.set("services["+i+"][quantity]",this.quantity)}}}}catch(t){console.error(t)}},JItemActionService.markBadges=function(){"object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.SERVICES&&arAsproCounters.SERVICES&&arAsproCounters.SERVICES.COUNT},JItemActionService.markItems=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.SERVICE&&arAsproCounters.SERVICE&&"object"==typeof arAsproCounters.SERVICE.ITEMS&&arAsproCounters.SERVICE.ITEMS){let t=Array.prototype.slice.call(document.querySelectorAll('.js-item-action.active[data-action="service"]'));if(t.length){let e=Object.keys(arAsproCounters.SERVICE.ITEMS);for(let i in t){let o=BX.data(t[i],"id"),s=t[i].closest("[data-product_id]");if(o&&s&&-1==e.indexOf(JItemActionService.joinId(o,s))){let e=t[i].itemAction instanceof JItemAction?t[i].itemAction:new this(t[i]);e.state=!1,e.resetQuantity()}}}if(arAsproCounters.SERVICE.ITEMS)for(let e in arAsproCounters.SERVICE.ITEMS){let i=JItemActionService.splitId(e),o=i.id,s=i.productId,n=arAsproCounters.SERVICE.ITEMS[e];if(o&&s){if(t=Array.prototype.slice.call(document.querySelectorAll('.services-buy-wrapper[data-product_id="'+s+'"] .js-item-action[data-action="service"][data-id="'+o+'"].active')),t.length)for(let e in t){(t[e].itemAction instanceof JItemAction?t[e].itemAction:new this(t[e])).quantity=n}if(t=Array.prototype.slice.call(document.querySelectorAll('.services-buy-wrapper[data-product_id="'+s+'"] .js-item-action[data-action="service"][data-id="'+o+'"]:not(.active)')),t.length)for(let e in t){let i=t[e].itemAction instanceof JItemAction?t[e].itemAction:new this(t[e]);i.state=!0,i.quantity=n}}}}}
1,JItemActionService.joinId=function(t,e){return t+"_"+e},JItemActionService.splitId=function(t){let e=t.split("_");return{id:e[0]?e[0]:0,productId:e[1]?e[1]:0}},JItemActionService.getDetailSku2Ids=function(){let t=[];return document.querySelectorAll('.catalog-detail .detail-block.sku .js-item-action[data-action="basket"]').forEach((e=>{let i=JItemAction.factory(e);if(i){let e=i.data;e&&t.push(e.ID.toString())}})),t},JItemActionService.get=function(t){let e=null,i=JItemActionService.splitId(t);if(t=i.id,productId=i.productId,t>0&&productId>0){let i=document.querySelector('.services-buy-wrapper[data-product_id="'+productId+'"] .js-item-action[data-action="service"][data-id="'+t+'"]');i||-1!==JItemActionService.getDetailSku2Ids().indexOf(productId)&&(i=document.querySelector('.catalog-detail .services-buy .js-item-action[data-action="service"][data-id="'+t+'"]')),i&&(e=i.itemAction instanceof JItemAction?i.itemAction:new this(i))}return e},BX.Aspro.Utils.isFunction("reloadCounters")||(reloadCounters=function(){JItemAction.reload()}),BX.bindDelegate(document,"click",{class:"js-item-action"},(function(t){t||(t=window.event),BX.PreventDefault(t);let e=t.target||t.srcElement;void 0!==e&&e&&(e.closest(".opt_action")||JItemAction.factory(this).fireEvent(t))})),BX.bindDelegate(document,"change",{tag:"input",className:"js-item-action-switch",attrs:{type:"checkbox"}},(t=>{let e=(t=t||window.event).target,i=e.checked,o=null,s=(e.getAttribute("data-action")||"").trim();if(s){let t=e;for(;t&&!o;)o=t.querySelector('.js-item-action[data-action="'+s+'"]'),t=t.parentElement}if(o){let t=JItemAction.factory(o);t&&(t.prevState=!i,t.state=i,t.updateState(!i))}})),BX.addCustomEvent("onCompleteAction",(function(t){try{"ajaxContentLoaded"!==t.action&&"jsLoadBlock"!==t.action||JItemAction.markItems()}catch(t){console.error(t)}})),BX.addCustomEvent("onAjaxSuccess",(function(t){"object"==typeof t&&t&&t.BASKET_REFRESHED&&(JItemAction.markItems(),JItemAction.reload())})),readyDOM((function(){JItemAction.markItems()})));
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.