PageSourceSearch

https://jbizhu.ru/wa-data/public/shop/themes/megashop2/js/megashop.shop.min.js?v=1.3.7.1790418061

js jbizhu.ru collected 2026-09-26 10:21:49 UTC 125,340 bytes, 1 lines download raw bytes

1!function(e){var t=window.megashop,n=t.config,i=t.shop||{},a=t.translate,o=t.Update,r=t.ComponentRegistry,c=t.ModalUtil,s=t.QueryUtil,l=t.ScrollUtil,d=t.FlyUtil,u=t.HistoryUtil,p=t.PluralUtil,f=t.InfoPanelUtil,_=t.ResponsiveUtil,g=t.TouchLockUtil,h=t.CookieSet,m=t.MatchMedia,v=t.LinkUtil,b=t.ViewportControl,w=t.PageSeparatorBuilder,C=t.Counter,y=i.CurrencyUtil={format:function(e,t,n){var i=t.frac_digits,a=t.decimal_point,o=t.thousands_sep;i=Math.abs(i),isNaN(i)&&(i=2),void 0===a&&(a=","),void 0===o&&(o="."),e=(+e||0).toFixed(i);var r=parseInt(e)+"",c=r.length,s=0;c>3&&(s=c%3);var l,d="";return s&&(d+=r.substr(0,s)+o),d+=r.substr(s).replace(/(\d{3})(?=\d)/g,"$1"+o),i&&e-r&&(d+=a+Math.abs(e-r).toFixed(i).slice(2)),l=n?t.sign:t.sign_html,t.sign_position?d+t.sign_delim+l:l+t.sign_delim+d},parse:function(e,t,n){var i=t.frac_digits;i=Math.abs(i),isNaN(i)&&(i=2);var a,o=t.decimal_point;void 0===o&&(o=","),a=n?t.sign:t.sign_html;var r="0",c=e=t.sign_position?e.substr(0,e.length-(t.sign_delim.length+a.length)):e.substr(-(t.sign_delim.length+a.length));e.substr(-i-1,1)===o&&(r=e.substr(-i),c=e.substr(0,e.length-i-1));var s=1;"-"===c.charAt(0)&&(s=-1,c=c.substr(1));var l=c.length,d=0;l>4&&(d=l%4);var u=c.substr(0,d);return u+=c.substr(0===d?0:d+1).replace(/.(?=\d\d\d)/,""),(parseFloat(u)+parseFloat("0."+r))*s}},k=i.CartUtil={addByData:function(t){var i=e.ajax({url:n.shop.cart_add_url,method:"post",data:t,dataType:"json"});return i.then(function(){e(document).trigger("shop_cart_add@megashop:global",arguments)}),i},addProductBySkuId:function(t,n,i){var a=k.addByData(e.extend({sku_id:t,quantity:n,html:!0},k.formatServices(i)));return a.then(function(){e(document).trigger("shop_cart_add_product@megashop:global",arguments)}),a},addProduct:function(t,n,i){var a=k.addByData(e.extend({product_id:t,quantity:n,html:!0},k.formatServices(i)));return a.then(function(){e(document).trigger("shop_cart_add_product@megashop:global",arguments)}),a},addProductByFeatures:function(t,n,i,a){var o=k.addByData(e.extend({product_id:t,features:n,quantity:i,html:!0},k.formatServices(a)));return o.then(function(){e(document).trigger("shop_cart_add_product@megashop:global",arguments)}),o},addService:function(t,n,i){var a=k.addByData({parent_id:t,service_id:n,service_variant_id:i,html:!0});return a.then(function(){e(document).trigger("shop_cart_add_service@megashop:global",arguments)}),a},updateItem:function(t,i){var a=e.ajax({url:n.shop.cart_save_url,method:"post",data:{id:t,quantity:i,html:!0},dataType:"json"});return a.then(function(){e(document).trigger("shop_cart_update@megashop:global",arguments)}),a},updateService:function(t,i){var a=e.ajax({url:n.shop.cart_save_url,method:"post",data:{id:t,service_variant_id:i,html:!0},dataType:"json"});return a.then(function(){e(document).trigger("shop_cart_update@megashop:global",arguments)}),a},deleteItem:function(t){var i=e.ajax({url:n.shop.cart_delete_url,method:"post",data:{id:t,html:!0},dataType:"json"});return i.then(function(){e(document).trigger("shop_cart_delete@megashop:global",arguments)}),i},clear:function(){var t=e.ajax({url:n.shop.cart_url+"?clear=1",method:"post",dataType:"json"});return t.then(function(){e(document).trigger("shop_cart_clear@megashop:global",arguments)}),t},formatServices:function(e){e=e||[];var t={};return t.services=e.map(function(e){return e.id}),t.service_variants=e.reduce(function(e,t){return e[t.id]=t.variant_id,e},{}),t}},x=(i.ProductCompare=r.register(function(e){return e.select(".c-product-compare")},function(t,n){e.extend(n,{initEventListeners:function(){t.on("click",function(){var t=e(this),n=t.data("product_id");n?t.hasClass("c-product-compare_active")?$.remove(n):$.add(n):console.error("product_id undefined")}),e(document).on("shop_update_compare@megashop:global",function(){n.updateState()})},updateState:function(){var e=t.data("product_id");e?t.toggleClass("c-product-compare_active",$.has(e)):console.error("product_id undefined")}}),n.initEventListeners(),n.updateState()}),i.ProductFavorite=r.register(function(e){return e.select(".c-product-favorite")},function(t,n){e.extend(n,{initEventListeners:function(){t.on("click",function(){var t=e(this),n=t.data("product_id");n?t.hasClass("c-product-favorite_active")?N.remove(n):N.add(n):console.error("product_id undefined")}),e(document).on("shop_update_favorite@megashop:global",function(){n.updateState()})},updateState:function(){var e=t.data("product_id");e?t.toggleClass("c-product-favorite_active",N.has(e)):console.error("product_id undefined")}}),n.initEventListeners(),n.updateState()}),i.Products=r.register(function(e){return e.select(".c-products")},function(t,i){e.extend(i,{page:null,pages_count:null,products_count:null,current_xhr:null,initEventListeners:function(){t.on("change","select.c-products__sorting-select",function(e){i.replaceProducts(e.target.value,1)}),t.on("click",".c-products-view-types__item",function(){var t=e(this).find(".c-products-view-type").data("view_type");e.cookie("shop_products-view-type",t,{path:n.commons.wa_url}),i.refreshProducts()}),t.on("click",".c-products__pagination a.c-pagination-item",function(n){n.preventDefault();var a=e(this).attr("href");s.parse(a).length?(e(".c-category-page__description").hide(),e(".c-category-page__additional-description").hide()):(e(".c-category-page__description").show(),e(".c-category-page__additional-description").show()),i.replaceProducts(n.target.href),setTimeout(function(){l.
1scrollToTop(t.offset().top)},100)}),t.on("click",".c-products__lazy-load-button",function(){t.addClass("c-products_lazy-load_process"),i.getViewportControl().watch()}),t.on("click",".c-products__reset-filters",function(){i.resetFilters(),t.find(".c-products__filters").remove()}),t.on("click",".c-products__filters-button",function(){var n=e(this),a={};n.data("type")&&(a.type=n.data("type")),n.data("code")&&(a.code=n.data("code")),n.data("value")&&(a.value=n.data("value")),n.remove(),0===t.find(".c-products__filters-button").length&&t.find(".c-products__filters").remove(),i.disableFilter(a)}),t.on("click",".c-products__delete-list-button",function(){i.delete()}),t.on("click",".c-products__recovery-list-button",function(){i.recovery()}),t.on("pre_view view",function(){if(i.page===i.pages_count)return t.removeClass("c-products_lazy-load_process"),void t.addClass("c-products_lazy-load_done");i.getViewportControl().unwatch(),i.loadNextPage().then(function(){i.getViewportControl().watch()})}),t.on("delete",".c-product",function(n){n.stopImmediatePropagation(),t.trigger("delete_product",[e(this)])}),t.on("recovery",".c-product",function(n){n.stopImmediatePropagation(),t.trigger("recovery_product",[e(this)])})},resetFilters:function(){e(".c-filters").each(function(){E(e(this)).reset()})},disableFilter:function(t){e(".c-filters").each(function(){E(e(this)).disableFilter(t)})},getViewportControl:function(){return b(t.find(".c-products__lazy-load"))},replaceProducts:function(n,a){a&&(i.page=a),t.addClass("c-products_loading");var r=i.fetchProducts(n,a);return r.then(function(n){var a=e(n).find(".c-products");0!==a.length?(i.page=a.data("page"),i.pages_count=a.data("pages_count"),i.products_count=a.data("products_count"),t.html(a.contents()),t.removeClass("c-products_lazy-load_process"),t.removeClass("c-products_lazy-load_done"),o(t),i.updateProductsCount(),t.removeClass("c-products_loading")):window.location.reload()},function(e,n){"abort"!==n&&t.removeClass("c-products_loading")}),u.replaceState({},"",n),r},updateProductsCount:function(){e(".c-filters .c-filters__submit-button").attr("data-products-count",i.products_count)},loadNextPage:function(){i.page++;var n=i.page,a=i.pages_count,r=window.location.toString(),c=i.fetchProducts(r,n),l=s.parse(r),d=l;n&&(l=l.filter(function(e){return"page"!==e.name}),n>1&&l.push({name:"page",value:n}));var p=document.createElement("a");if(p.href=r,p.search=s.serialize(l),2===n){var f=document.createElement("a");f.href=r,f.search=s.serialize(d)}return c.then(function(i){var r=e(i).find(".c-products");if(0!==r.length){u.replaceState({},"",p);var c=w.create("Страница "+n+" из "+a);t.find(".c-products__list").append(c),c.attr("data-page-url",p.href);c.waypoint({handler:function(t){var n=this.element,i=e(n).data("page-url"),a=this.previous(),o=f;if(a){var r=a.element;o=e(r).data("page-url")}var c=i;"up"===t&&(c=o),u.replaceState({},"",c)},offset:"50%"});t.find(".c-products__list").append(r.find(".c-products__list").contents()),t.find(".c-products__pagination").html(r.find(".c-products__pagination").contents()),o(t)}else window.location.reload()}),c},refreshProducts:function(){i.replaceProducts(window.location)},fetchProducts:function(t,n){i.current_xhr&&(i.current_xhr.abort(),i.current_xhr=null);var a=s.parse(t);a.push({name:"_",value:Date.now()}),n&&(a=a.filter(function(e){return"page"!==e.name}),n>1&&a.push({name:"page",value:n}));var o=document.createElement("a");return o.href=t,o.search=s.serialize(a),e.ajax({url:o.href,method:"get",beforeSend:function(e){i.current_xhr=e},complete:function(){i.current_xhr=null}})},getProducts:function(){return t.find(".c-product")},delete:function(){i.getProducts().each(function(){j(e(this)).delete()}),t.trigger("delete"),t.addClass("c-products_delete")},recovery:function(){i.getProducts().each(function(){j(e(this)).recovery()}),t.trigger("recovery"),t.removeClass("c-products_delete")}}),i.page=+t.data("page"),i.pages_count=+t.data("pages_count"),i.products_count=+t.data("products_count"),i.initEventListeners()})),S=i.CatalogReviews=r.register(function(e){return e.select(".c-catalogreviews")},function(t,n){e.extend(n,{page:null,pages_count:null,current_xhr:null,initEventListeners:function(){t.on("change","select.c-catalogreviews__sorting-select",function(e){n.replaceReviews(e.target.value,1)}),t.on("click",".c-catalogreviews__pagination a.c-pagination-item",function(e){e.preventDefault(),n.replaceReviews(e.target.href),setTimeout(function(){l.
1scrollToTop(t.offset().top)},100)}),t.on("click",".c-catalogreviews__lazy-load-button",function(){t.addClass("c-catalogreviews_lazy-load_process"),n.getViewportControl().watch()}),t.on("click",".c-catalogreviews__reset-filters",function(){n.resetFilters(),t.find(".c-catalogreviews__filters").remove()}),t.on("click",".c-catalogreviews__filters-button",function(){var i=e(this),a={};i.data("type")&&(a.type=i.data("type")),i.data("code")&&(a.code=i.data("code")),i.data("value")&&(a.value=i.data("value")),i.remove(),0===t.find(".c-catalogreviews__filters-button").length&&t.find(".c-catalogreviews__filters").remove(),n.disableFilter(a)}),t.on("pre_view view",function(){if(n.page===n.pages_count)return t.removeClass("c-catalogreviews_lazy-load_process"),void t.addClass("c-catalogreviews_lazy-load_done");n.getViewportControl().unwatch(),n.loadNextPage().then(function(){n.getViewportControl().watch()})})},resetFilters:function(){e(".c-filters").each(function(){E(e(this)).reset()})},disableFilter:function(t){e(".c-filters").each(function(){E(e(this)).disableFilter(t)})},getViewportControl:function(){return b(t.find(".c-catalogreviews__lazy-load"))},replaceReviews:function(i,a){a&&(n.page=a),t.addClass("c-catalogreviews_loading");var r=n.fetchReviews(i,a);return r.then(function(i){var a=e(i).find(".c-catalogreviews");0!==a.length?(n.page=a.data("page"),n.pages_count=a.data("pages_count"),t.html(a.contents()),t.removeClass("c-catalogreviews_lazy-load_process"),t.removeClass("c-catalogreviews_lazy-load_done"),o(t),t.removeClass("c-catalogreviews_loading")):window.location.reload()},function(e,n){"abort"!==n&&t.removeClass("c-catalogreviews_loading")}),u.replaceState({},"",i),r},loadNextPage:function(){n.page++;var i=n.page,a=n.pages_count,r=window.location.toString(),c=n.fetchReviews(r,i),l=s.parse(r),d=l;i&&(l=l.filter(function(e){return"page"!==e.name}),i>1&&l.push({name:"page",value:i}));var p=document.createElement("a");if(p.href=r,p.search=s.serialize(l),2===i){var f=document.createElement("a");f.href=r,f.search=s.serialize(d)}return c.then(function(n){var r=e(n).find(".c-catalogreviews");if(0!==r.length){u.replaceState({},"",p);var c=w.create("Страница "+i+" из "+a);t.find(".c-catalogreviews__list").append(c),c.attr("data-page-url",p.href);c.waypoint({handler:function(t){var n=this.element,i=e(n).data("page-url"),a=this.previous(),o=f;if(a){var r=a.element;o=e(r).data("page-url")}var c=i;"up"===t&&(c=o),u.replaceState({},"",c)},offset:"50%"});t.find(".c-catalogreviews__list").append(r.find(".c-catalogreviews__list").contents()),t.find(".c-catalogreviews__pagination").html(r.find(".c-catalogreviews__pagination").contents()),o(t)}else window.location.reload()}),c},refreshReviews:function(){n.replaceReviews(window.location)},fetchReviews:function(t,i){n.current_xhr&&(n.current_xhr.abort(),n.current_xhr=null);var a=s.parse(t);a.push({name:"_",value:Date.now()}),i&&(a=a.filter(function(e){return"page"!==e.name}),i>1&&a.push({name:"page",value:i}));var o=document.createElement("a");return o.href=t,o.search=s.serialize(a),e.ajax({url:o.href,method:"get",beforeSend:function(e){n.current_xhr=e},complete:function(){n.current_xhr=null}})},getReviews:function(){return t.find(".c-product")},delete:function(){n.getReviews().each(function(){j(e(this)).delete()}),t.trigger("delete"),t.addClass("c-catalogreviews_delete")},recovery:function(){n.getReviews().each(function(){j(e(this)).recovery()}),t.trigger("recovery"),t.removeClass("c-catalogreviews_delete")}}),n.page=+t.data("page"),n.pages_count=+t.data("pages_count"),n.initEventListeners()}),E=(i.ProductPage=r.register(function(e){return e.select(".c-product-page")},function(e,n){t.RecentlySet.touch(e.data("product_id"))}),i.Filters=r.register(function(e){return e.select(".c-filters")},function(t,n){e.extend(n,{timeout_id:null,hint_timeout_id:null,$hint_target:e(),initEventListeners:function(){n.getForm().on("submit",function(e){e.preventDefault(),Waypoint.destroyAll(),clearTimeout(n.timeout_id),n.updateProducts(),n.updateReviews()}),n.getForm().on("change",function(t){t.preventDefault(),Waypoint.destroyAll(),n.$hint_target=e(t.target),clearTimeout(n.timeout_id),n.timeout_id=setTimeout(function(){n.updateProducts(),n.updateReviews()},500)}),t.find(".c-filters__submit-button").on("click",function(){return n.getForm().trigger("submit"),e(document).trigger("filters_header@megashop:global"),!1}),t.find(".c-filters__reset-button").on("click",function(){n.reset()})},setHint:function(i){t.find(".c-filters__hint").each(function(){var a=e(this);a.text(i);var o=n.$hint_target.closest(".c-filter__value, .c-filters__footer");0===o.length&&(o=n.$hint_target),n.$hint_target=e(),o.is(":visible")&&(a.css("top",o.offset().top-t.offset().top+o.height()/2+"px"),a.get(0).offsetTop,a.addClass("c-filters__hint_show"),clearTimeout(n.hint_timeout_id),n.hint_timeout_id=setTimeout(function(){a.removeClass("c-filters__hint_show")},2e3))})},getForm:function(){return t.find(".c-filters__form")},updateProducts:function(){var t=n.getForm();e(".c-products").each(function(){var i=x(e(this));i&&i.replaceProducts("?"+t.serialize(),1).then(function(t){var a=p.plural(i.products_count,["Найден "+i.products_count+" товар","Найдено "+i.products_count+" товара","Найдено "+i.products_count+" товаров"]);n.setHint(a),e(document).trigger("filters_filtration_complete@megashop:global",[e(t)])})})},updateReviews:function(){var t=n.getForm();e(".c-catalogreviews").each(function(){var n=S(e(this));n&&n.replaceReviews("?"+t.serialize(),1).then(function(t){e(document).trigger("filters_filtration_complete@megashop:global",[e(t)])})})},reset:function(){t.find(".c-filters__filter").each(function(){L(e(this),n).reset()}),n.getForm().trigger("submit")},disableFilter:function(t){var i=n.getForm().get(0);"checkbox"===t.type?e(i.elements[t.code+"[]"]).filter('[value="'+t.value+'"]').prop("checked",!1).trigger("change"):"radio"===t.type?e(i.elements[t.code]).filter('[value=""]').prop("checked",!0).trigger("change"):"range"===t.type?(e(i.elements[t.code+"[min]"]).val("").trigger("change"),e(i.elements[t.code+"[max]"]).val("").trigger("change")):"price"===t.type&&(e(i.elements.price_min).val("").trigger("change"),e(i.elements.price_max).val("").trigger("change"))}}),n.initEventListeners()})),L=(i.CategoryPage=r.register(function(e){return e.find(".c-category-page")},function(t,n){var i=function(e){return e.find(".c-category-page__subcategories-wrapper")};e.extend(n,{initEventListeners:function(){e(document).on("filters_filtration_complete@megashop:global",function(e,t){var a=n.get
1SubcategoriesWrapper();if(a.length>0){var o=i(t);a.html(o.html())}}),e(document).on("click",".description-block__more-btn",function(){var t=e(this).closest(".description-block").find(".description-block__content-wrapper");n.showFullDescription(t),e(this).find("span").toggle()})},getSubcategoriesWrapper:function(){return i(t)},showFullDescription:function(e){e.toggleClass("description-block__content-wrapper--show")},checkDescriptionsHeight:function(t){t.find(".description-block").each(function(){var t=e(this).find(".description-block__content-wrapper"),n=e(this).find(".description-block__more"),i=t.height(),a=t.find("> *"),o=0;a.each(function(){o+=e(this).height()}),o<=i&&void 0!==n?n.hide():n.show()})}}),n.initEventListeners(),n.checkDescriptionsHeight(t)}),i.BrandPage=r.register(function(e){return e.find(".c-brand-page")},function(t,n){var i=function(e){return e.find(".c-brand-page__categories-container-wrapper")};e.extend(n,{initEventListeners:function(){e(document).on("filters_filtration_complete@megashop:global",function(e,t){var a=n.getCategoriesWrapper();if(a.length>0){var o=i(t);a.html(o.html())}})},getCategoriesWrapper:function(){return i(t)}}),n.initEventListeners()}),i.Filter=r.register(function(e){return e.select(".c-filter")},function(t,n){e.extend(n,{initEventListeners:function(){n.isCheckboxType()&&(t.on("change",".c-filter__values",function(t){var i=e(t.target);i.closest(".c-filter__value").toggleClass("c-filter__value_selected",i.is(":checked")),n.refreshFooter()}),t.on("toggle",".c-filter__content",function(){n.refreshHidden(),n.refreshFooter()}))},isCheckboxType:function(){return t.is(".c-filter_type_checkbox")},disableValue:function(e){e.addClass("c-filter__value_disabled"),e.find(".c-checkbox__control").prop("disabled",!0)},enableValue:function(e){e.removeClass("c-filter__value_disabled"),e.find(".c-checkbox__control").prop("disabled",!1)},getValues:function(){return t.find(".c-filter__value")},getSelectedValues:function(){return n.getValues().filter(".c-filter__value_selected")},getHiddenValues:function(){var i=e(),a=n.getValues(),o=t.data("values_limit");return o=Math.max(0,o-n.getSelectedValues().length),a.each(function(){var t=e(this);t.is(".c-filter__value_selected")||(0===o?i=i.add(t):o-=1)}),i},getFooter:function(){return t.find(".c-filter__footer")},refreshFooter:function(){if(n.isCheckboxType()){var e=n.getHiddenValues().length>0;n.getFooter().toggleClass("c-filter__footer_hidden",!e)}},refreshHidden:function(){n.isCheckboxType()&&(n.getValues().removeClass("c-filter__value_hidden"),n.getHiddenValues().addClass("c-filter__value_hidden"))},reset:function(){t.find(".c-filter__reset-input").each(function(){var t=e(this);""!==t.val()&&t.val("").trigger("change")}),t.find(".c-filter__reset-checkbox").each(function(){var t=e(this);t.prop("checked")&&t.prop("checked",!1).trigger("change")}),t.find(".c-filter__reset-radio").each(function(){var t=e(this);t.is(".c-filter__reset-radio_default")&&!t.prop("checked")&&t.prop("checked",!0).trigger("change")})}}),n.initEventListeners(),t.data("megashop_shop_filter",n)})),P=(i.ProductImages=r.register(function(e){return e.select(".c-review-images")},function(n,i){var a=e(".c-content-tabs").length>0||e(".c-responsive-tabs").length>0,o=n.find(".c-review-images__slider"),r=o.length>0;e.extend(i,{initPopUp:function(){n.find(".c-product-review__images-link").on("click",function(t){t.preventDefault();var i=n.data("gallery");n.data("initial_slide",e(this).data("index")),c.openContent(i)})},initSwiper:function(){if(r){var e=o.find(".c-review-images__slide").length,t=4*e;new Swiper(o.get(0),{wrapperClass:"c-review-images__wrapper",slideClass:"c-review-images__slide",spaceBetween:10,slidesPerView:"auto",watchSlidesVisibility:!0,watchSlidesProgress:!0,direction:"horizontal",slidesOffsetAfter:e>5?t:0,navigation:{prevEl:n.find(".c-review-images__arrow_prev").get(0),nextEl:n.find(".c-review-images__arrow_next").get(0),disabledClass:"c-review-images__arrow_disabled"}})}},observeReviewsBlock:function(){a&&r?e('.c-content-tabs__content[data-slug="reviews"], .c-responsive-tabs__tab-container[data-slug="reviews"]').each(function(){var n=e(this),a=n.attr("class").split(" ")[0],o=a+"_selected";n.hasClass(o)?i.initSwiper():t.ObserverUtil.observeClass(a,function(){n.hasClass(o)&&i.initSwiper()})}):i.initSwiper()}}),i.initPopUp(),i.observeReviewsBlock()}),i.ProductGallery=r.register(function(e){return e.select(".c-review-gallery")},function(t,n){e.extend(n,{initSwiper:function(){var n=t.data("review-gallery-id"),i=e('.c-review-images[data-review-gallery-id="'+n+'"]').data("initial_slide")||0,a=t.find(".c-review-gallery__images");a.addClass("c-review-gallery__images_swiper-init"),new Swiper(a.get(0),{wrapperClass:"c-review-gallery__images-wrapper",slideClass:"c-review-gallery__image",initialSlide:i,navigation:{prevEl:t.find(".c-review-gallery__arrow_prev").get(0),nextEl:t.find(".c-review-gallery__arrow_next").get(0),disabledClass:"c-review-gallery__arrow_disabled"}})}}),n.initSwiper()}),i.ProductImages=r.register(function(e){return e.select(".c-product-images")},function(t,n){e.extend(n,{initSwiper:function(){var n=0,i=t.find(".c-product-images__image_sku-selected");i.length>0?n=i.data("index"):t.hasClass("c-product-images_has-video")&&(n=1);var a=t.find(".c-product-images__thumbs"),o=null;if(0!==a.length){a.addClass("c-product-images__thumbs_swiper-init");var r="horizontal";t.hasClass("c-product-images_thumbs-position_left")&&(r="vertical");var s=0;a.find(".c-product-images__thumb").each(function(){var t=e(this);s=s+t.width()+10}),o=new Swiper(a.get(0),{wrapperClass:"c-product-images__thumbs-wrapper",slideClass:"c-product-images__thumb",spaceBetween:10,slidesPerView:4,watchSlidesVisibility:!0,watchSlidesProgress:!0,direction:r,navigation:{prevEl:t.find(".c-product-images__arrow_prev").get(0),nextEl:t.find(".c-product-images__arrow_next").get(0),disabledClass:"c-product-images__arrow_disabled"}});var l=e(o.$wrapperEl);s<l.width()&&l.css({width:s-10,margin:"0 auto"})}var d=t.find(".c-product-images__images");d.addClass("c-product-images__images_swiper-init");var u=new Swiper(d.get(0),{wrapperClass:"c-product-images__images-wrapper",slideClass:"c-product-images__image",initialSlide:n,thumbs:{swiper:o}});d.find(".c-product-images__image").on("click",function(n){n.preventDefault();var i=D(t.closest(".c-product-cart-form")).getProductData(),a=e(i.gallary);a.data("initial_slide",u.realIndex),c.openContent(a)})},initZoom:function(){var n=t.find(".c-product-images__images"),i=t.find(".c-product-images__zoom-container"),a=".c-product-images__image:not(.c-product-images__image_dummy)",o=function(e){e.zoom({$container:i})};n.find(a).each(function(){var t=e(this).find("img");t.length&&o(t)}),e(document).on("lazy_image_completed@megashop:global",function(e,t){t.closest(n).length&&t.closest(a).length&&o(t)})},selectImage:function(n){var i=t.find(".c-product-images__images"),a=i.get(0).swiper;a&&e(a.slides).each(function(t){n==e(this).data("image_id")&&i.get(0).swiper.slideTo(t)})}}),n.initSwiper(),_.isDesktopMin()&&t.data("is_enabled_zoom")&&n.initZoom()})),D=(i.ProductGallery=r.register(function(e){return e.select(".c-product-gallery")},function(t,i){e.extend(i,{initEventListeners:function(){var i=!1;t.on("submit",".c-product-gallery__add-to-cart-form",function(a){if
1(a.preventDefault(),t.hasClass("c-product-gallery_has-multi-skus")){var o=t.data("url");c.openAjax(o+"?cart=1")}else if(!i){i=!0;var r=e(this).serializeArray();r.push({name:"html",value:!0}),k.addByData(r).then(function(a){if(i=!1,e(document).trigger("shop_cart_add_product@megashop:global",arguments),"fly"===n.shop.add_to_cart_effect){var o=e(".c-cart-counter:visible:first");if(1===o.length){var r=t.find(".c-product-gallery__image.swiper-slide-active");d.flyImage(r,o)}}},function(){i=!1})}})},initSwiper:function(){var e=t.data("initial_slide")||0,n=t.find(".c-product-gallery__thumbs"),i=null;0!==n.length&&(n.addClass("c-product-gallery__thumbs_swiper-init"),i=new Swiper(n.get(0),{wrapperClass:"c-product-gallery__thumbs-wrapper",slideClass:"c-product-gallery__thumb",spaceBetween:10,slidesPerView:4,watchSlidesVisibility:!0,watchSlidesProgress:!0,navigation:{prevEl:t.find(".c-product-gallery__thumb-arrow_prev").get(0),nextEl:t.find(".c-product-gallery__thumb-arrow_next").get(0),disabledClass:"c-product-gallery__thumb-arrow_disabled"}}));var a=t.find(".c-product-gallery__images");a.addClass("c-product-gallery__images_swiper-init");var o={};_.isDesktopMin()&&(o={swiper:i}),new Swiper(a.get(0),{wrapperClass:"c-product-gallery__images-wrapper",slideClass:"c-product-gallery__image",initialSlide:e,thumbs:o,navigation:{prevEl:t.find(".c-product-gallery__arrow_prev").get(0),nextEl:t.find(".c-product-gallery__arrow_next").get(0),disabledClass:"c-product-gallery__arrow_disabled"}})}}),i.initSwiper(),i.initEventListeners()}),i.ProductCartForm=r.register(function(e){return e.select(".c-product-cart-form")},function(t,a){var o={product_url:t.data("product_url"),initGlobalEventListeners:function(){e(document).on("shop-dp-city-select-save",o.handleDpSelect)},destroyGlobalEventListeners:function(){e(document).off("shop-dp-city-select-save",o.handleDpSelect)},handleDpSelect:function(){var n=t.select(".c-product-cart-form__dp-container");throw n.addClass("c-product-cart-form__dp-container_loading"),e.ajax({url:o.product_url}).done(function(t){n.replaceWith(e(t).select(".c-product-cart-form__dp-container")),window.shop_dp.loader.assets.product.initAsyncCalculation()}),window.shop_dp_dialog("close"),e("#dp-dialog-city-select").remove(),new Error}};return e.extend(a,{initEventListeners:function(){t.on("submit",function(i){i.preventDefault();var a=t.serializeArray();a.push({name:"html",value:!0}),k.addByData(a).then(function(i){if((e(document).trigger("shop_cart_add_product@megashop:global",arguments),"ok"===i.status)&&"fly"===n.shop.add_to_cart_effect){var a,o=e(".c-cart-counter:visible:first"),r=e(".c-order-page .c-header_h2");if(o.length?a=o.eq(0):r.length&&(a=r.eq(0)),a){var c=t.find(".c-product-images__image.swiper-slide-active");d.flyImage(c,a,{zIndex:100})}}})}),t.on("change",function(){a.updateServices(),a.updateSkuStocks(),a.updatePrices(),a.updateImage(),a.updateButton(),a.updateSku()})},updateServices:function(){var n=a.getServicesData(),i=a.getProductData();i&&n&&t.find(".c-service").each(function(){var t=e(this),a=F(t),o=a.getServiceId(),r=n[o],c="object"==typeof r,s=!1===r;a.isDisabled()&&(s||a.enable()),c?a.updateVariants(r,i.currency):s?a.disable():a.updatePrice(r,i.currency)})},updateSkuStocks:function(){var e=a.getSkuData(),n=t.find(".c-product-skus-stocks"),i=T(n);if(e){var o=e.id;i.selectSkuStocks(o)}else i.selectNoSkuStocks()},updatePrices:function(){a.updatePrice(),a.updateComparePrice()},updatePrice:function(){var e=a.getSkuData();if(e){var n=a.getProductData(),i=e.price+a.getServicesPrice(),o=t.find(".c-product-add-to-cart");V(o).updatePrice(i,n.currency)}},updateComparePrice:function(){var e=a.getSkuData();if(e){var n=a.getProductData(),i=e.compare_price;0!==i&&(i+=a.getServicesPrice());var o=t.find(".c-product-add-to-cart");V(o).updateComparePrice(i,n.currency)}},updateImage:function(){var e=a.getSkuData();if(e){var n=e.image_id,i=t.find(".c-product-images");if(0!==i.length)P(i).selectImage(n)}},updateButton:function(){var e=t.find(".c-product-add-to-cart"),n=V(e);a.isAvailable()?n.enableButtons():n.disableButtons()},updateSku:function(){var e=a.getSkuData();if(e){var n=t.find(".c-product-cart-form__sku-value"),i=e.sku;n.text(i),t.toggleClass("c-product-cart-form_has-sku",!!i)}},isAvailable:function(){var e=a.getSkuData();return!!e&&e.available},getButton:function(){return t.find(".c-product-cart-form__button")},getServicesPrice:function(){var n=0;return t.find(".c-service").each(function(){var t=e(this),i=F(t);n+=a.getServicePrice(i)}),n},getServicePrice:function(e){var t=a.getServicesData()[e.getServiceId()],n="object"==typeof t,i=!1===t;if(e.isChecked())if(n){var o=t[e.getServiceVariantId()];if(o)return+o[1]}else if(!i)return+t;return 0},getServicesData:function(){var e=a.getProductData(),t=a.getSkuId();return e&&t?e.services[t]:null},getProductId:function(){return a.getFormData().reduce(function(e,t){return"product_id"===t.name?t.value:e},null)},getProductData:function(){return i.product_data[a.getProductId()]},getSkuId:function(){var e=a.getFormData().reduce(function(e,t){return"sku_id"===t.name?t.value:e},null);if(null===e){var t=a.getProductData();if(t&&t.features){var n=a.getFeaturesValuesKey(),i=t.features;if(n in i)e=i[n].id}}return e},getSkuData:function(){var e=a.getSkuId(),t=a.getProductData();if(t){if(!e){var n=a.getFeaturesValuesKey();t.features[n]&&(e=t.features[n].id)}if(e)return t.skus[e]}return null},selectFeatureSku:function(t){var n=e(".c-product-feature-select");t.split(";").forEach(function(t){if(t){var i=t.split(":"),a=i[0],o=i[1],r=n.filter('[data-id="'+a+'"]').find(".c-product-feature-select__value, .c-product-feature-select__color");r.length&&r.each(function(){var t=e(this),n=t.hasClass("c-product-feature-select__color");t.removeClass(n?"c-product-feature-select__color_selected":"c-product-feature-select__value_selected"),t.data("value")==o&&(t.removeClass(n?"c-product-feature-select__color_disabled":"c-product-feature-select__value_disabled"),t.addClass(n?"c-product-feature-select__color_selected":"c-product-feature-select__value_selected"))})}})},getFeaturesValues:function(){var e=a.getFormData(),t=/^features\[\d+]$/,n=/^features\[(\d+)]$/;return e.filter(function(e){return t.test(e.name)}
1,null).map(function(e){return{feature_id:e.name.match(n)[1],value_id:e.value}})},getFeaturesValuesKey:function(){return a.getFeaturesValues().map(function(e){return e.feature_id+":"+e.value_id+";"}).join("")},getFeaturesValuesSpecificKey:function(e,t){return a.getFeaturesValues().map(function(n){return n.feature_id==e?e+":"+t+";":n.feature_id+":"+n.value_id+";"}).join("")},filterFeatureSelectAvailability:function(){var t=this,n=t.getProductData();t.getSkuData();!+n.hide_unavailable_feature_skus||e(".c-product-feature-select").each(function(){var i=e(this),a=i.data("id");i.find(".c-product-feature-select__value, .c-product-feature-select__color").each(function(){var i=e(this),o=i.data("value"),r=i.hasClass("c-product-feature-select__color")?"c-product-feature-select__color_disabled":"c-product-feature-select__value_disabled",c=t.getFeaturesValuesSpecificKey(a,o);if(c in n.features){var s=!n.features[c].available;i.toggleClass(r,s)}})})},getFormData:function(){return t.serializeArray()}}),a.initEventListeners(),a.updateServices(),a.filterFeatureSelectAvailability(),o.initGlobalEventListeners(),function(){o.destroyGlobalEventListeners()}})),T=i.ProductSkusStocks=r.register(function(e){return e.select(".c-product-skus-stocks")},function(t,n){e.extend(n,{selectSkuStocks:function(n){var i=t.find(".c-product-skus-stocks__sku-stocks");i.removeClass("c-product-skus-stocks__sku-stocks_selected"),i.each(function(){var t=e(this);+t.data("sku_id")===n&&t.addClass("c-product-skus-stocks__sku-stocks_selected")})},selectNoSkuStocks:function(){var e=t.find(".c-product-skus-stocks__sku-stocks");e.removeClass("c-product-skus-stocks__sku-stocks_selected"),e.filter(".c-product-skus-stocks__sku-stocks_no-sku").addClass("c-product-skus-stocks__sku-stocks_selected")}})}),V=i.ProductAddToCart=r.register(function(e){return e.select(".c-product-add-to-cart")},function(t,n){var i={initArrived:function(){var n=t.find(".c-product-add-to-cart__arrived .plugin_arrived-button a");t.find(".c-product-add-to-cart__arrived-button").on("click",function(){n.trigger("click"),e(".plugin_arrived-overlay").remove();var t=e(".plugin_arrived-popup");i.initPopup(t)})},initPopup:function(t){var n=e('<div class="c-arrived-decorator"></div>');n.append(t),c.openContent(n)}};e.extend(n,{updatePrice:function(e,n){t.find(".c-product-add-to-cart__price").html(y.format(e,n,!1))},updateComparePrice:function(e,n){t.find(".c-product-add-to-cart__compare-price").html(y.format(e,n,!1)),t.toggleClass("c-product-add-to-cart_has-compare-price",0!==e)},enableButtons:function(){t.removeClass("c-product-add-to-cart_disabled"),t.find(".c-product-add-to-cart__button").prop("disabled",!1)},disableButtons:function(){t.addClass("c-product-add-to-cart_disabled"),t.find(".c-product-add-to-cart__button").prop("disabled",!0)}}),i.initArrived()}),F=(i.ProductThumb=r.register(function(e){return e.select(".c-product-thumb")},function(n,i){var a={initArrived:function(){var t=n.find(".c-product-thumb__arrived .plugin_arrived-button a");n.find(".c-product-thumb__arrived-button").on("click",function(){t.trigger("click"),e(".plugin_arrived-overlay").remove();var n=e(".plugin_arrived-popup");a.initPopup(n)})},initPopup:function(n){var i=e('<div class="c-arrived-decorator"></div>');i.append(n),c.openContent(i),t.Select.create(i.find("select"),null,!0)},initEventListeners:function(){n.find(".c-quantity").on("set_value@megashop:c-quantity",function(){var t=z(e(this));n.find(".c-product-thumb__quantity-value").val(t.getValue())})}};e.extend(i,{initSwiper:function(){var t=n.find(".c-product-thumb__image-box_gallery");if(t.length>0){var i=!1,a=!1;if(n.hasClass("c-product-thumb_mobile")){var o=t.find(".c-swiper-lazy");m("(max-width: 560px)")&&o.each(function(){var t=e(this),n=t.data("src"),i=t.data("srcset");t.attr("data-src",n.replace(/^(.*\/[0-9]+\.)(.*)(\..*)$/,"$1100$3")),t.attr("data-srcset",i.replace(/^(.*\/[0-9]+\.)(.*)(\..*)$/,"$1200$3"))})}_.isMobileMax()&&(a=!0),_.isTabletMax()&&(i=!0),t.addClass("c-product-thumb__image-box_swiper-init"),new Swiper(t.get(0),{wrapperClass:"c-product-thumb__gallery-wrapper",slideClass:"c-product-thumb__image-slide",slidesPerView:1,loop:i,pagination:{el:".c-product-gallery-pagination",bulletClass:"c-product-gallery-pagination__bullet",bulletActiveClass:"c-product-gallery-pagination__bullet_active",dynamicBullets:a,dynamicMainBullets:5,clickable:!0},lazy:{loadPrevNext:!0,elementClass:"c-swiper-lazy"}})}},initDesktopSlider:function(){var t=n.find(".c-product-thumb__image-box_gallery-container"),i=t.find(".c-product-thumb__gallery-d");if(i.length>0){var a=i.find(".l-image-box"),o=i.next(".c-product-thumb__gallery-pagination"),r=o.find(".c-product-gallery-pagination__bullet"),c=i.find(".c-product-thumb__gallery-field-pagination").find(".c-product-thumb__gallery-field-item");r.on("click",function(){var t=e(this),n=t.data("index");a.hide(),e(a[n]).show(),r.removeClass("c-product-gallery-pagination__bullet_active"),t.addClass("c-product-gallery-pagination__bullet_active")}),c.on("mouseover",function(){var t=e(this).data("index");o.find('[data-index="'+t+'"]').trigger("click")}),t.on("mouseleave",function(e){o.find('[data-index="0"]').trigger("click")})}},initSlider:function(){n.parent().hasClass("c-products-thumbs-slider__item")||i.initSwiper(),i.initDesktopSlider()}}),a.initArrived(),a.initEventListeners(),i.initSlider()}),i.ProductExtend=r.register(function(e){return e.select(".c-product-extend")},function(n,i){var a={initArrived:function(){var t=n.find(".c-product-extend__arrived .plugin_arrived-button a:eq(0)");n.find(".c-product-extend__arrived-button").on("click",function(){t.trigger("click"),e(".plugin_arrived-overlay").remove();var n=e(".plugin_arrived-popup");a.initPopup(n)})},initPopup:function(n){var i=e('<div class="c-arrived-decorator"></div>');i.append(n),c.openContent(i),t.Select.create(i.find("select"),null,!0)},initEventListeners:function(){n.find(".c-quantity").on("set_value@megashop:c-quantity",function(){var t=z(e(this));n.find(".c-product-extend__quantity-value").val(t.getValue())})}};e.extend(i,{initSwiper:function(){var t=n.find(".c-product-extend__image-box_gallery");if(t.length>0){var i=!1,a=!1;_.isTabletMax()&&(a=!0),_.isTabletMax()&&(i=!0),t.each(function(){var t=e(this);t.addClass("c-product-extend__image-box_swiper-init"),new Swiper(t.get(0),{wrapperClass:"c-product-extend__gallery-wrapper",slideClass:"c-product-extend__image-slide",slidesPerView:1,loop:i,pagination:{el:".c-product-gallery-pagination",bulletClass:"c-product-gallery-pagination__bullet",bulletActiveClass:"c-product-gallery-pagination__bullet_active",dynamicBullets:a,dynamicMainBullets:5,clickable:!0},lazy:{loadPrevNext:!0,elementClass:"c-swiper-lazy"}})})}},initDesktopSlider:function(){var t=n.find(".c-product-extend__image-box_gallery"),i=t.find(".c-product-extend__gallery-d");if(i.length>0){var a=i.find(".l-image-box"),o=i.next(".c-product-extend__gallery-pagination"),r=o.find(".c-product-gallery-pagination__bullet"),c=i.find(".c-product-extend__gallery-field-pagination").find(".c-product-extend__gallery-field-item");r.on("click",function(){var t=e(this),n=t.data("index");a.hide(),e(a[n]).show(),r.removeClass("c-product-gallery-pagination__bullet_active"),t.addClass("c-product-gallery-pagination__bullet_active")}),c.on("mouseover",function(){var t=e(this).data("index");o.find('[data-index="'+t+'"]').trigger("click")}),t.on("mouseleave",function(e){o.find('[data-index="0"]').trigger("click")})}},initSlider:function(){n.find(".c-product-extend__gallery-d").length>0?i.initDesktopSlider():i.initSwiper()}}),a.initArrived(),a.initEventListeners(),i.initSlider()}),i.ProductCompact=r.register(function(e){return e.select(".c-product-compact")},function(n){var i={initArrived:function(){var t=n.find(".c-product-compact__arrived .plugin_arrived-button a");n.find(".c-product-compact__arrived-button").on("click",function(){t.trigger("click"),e(".plugin_arrived-overlay").remove();var n=e(".plugin_arrived-popup");i.initPopup(n)})},initPopup:function(n){var i=e('<div class="c-arrived-decorator"></div>');i.append(n),c.openContent(i),t.Select.create(i.find("select"),null,!0)},initEventListeners:function(){n.find(".c-quantity").on("set_value@megashop:c-quantity",function(){var t=z(e(this));n.find(".c-product-compact__quantity-value").val(t.getValue())})}};i.initArrived(),i.initEventListeners()}),i.ProductFeatureSelect=r.register(function(e){return e.select(".c-product-feature-select")},function(t,n){var i=D(t.closest(".c-product-cart-form"));e.extend(n,{selectHandler:function(){i.filterFeatureSelectAvailability(),i.updateServices()},initEventListeners:function(){t.on("click",".c-product-feature-select__value",function(){var i=n.getInput(),a=t.find(".c-product-feature-select__value"),o=e(this),r=o.data("value");a.removeClass("c-product-feature-select__value_selected"),o.addClass("c-product-feature-select__value_selected"),i.val(r),i.trigger("change"),n.selectHandler()}),t.on("click",".c-product-feature-select__color",function(){var i=n.getInput(),a=t.find(".c-product-feature-select__color"),o=e(this),r=o.data("value");a.removeClass("c-product-feature-select__color_selected"),o.addClass("c-product-feature-select__color_selected"),i.val(r),i.trigger("change"),n.selectHandler()})},getInput:function(){return t.find(".c-product-feature-select__input")}}),n.initEventListeners()}),i.Service=r.register(function(e){return e.select(".c-service")},function(t,n){e.extend(n,{initEventListeners:function(){t.on("change","input.c-service__checkbox",function(){n.refreshSelectVariants(),n.isChecked()?t.trigger("check@megashop:c-service"):t.trigger("uncheck@megashop:c-service")}),t.on("change","select.c-service__select-variants",function(){t.trigger("change@megashop:c-service")}),t.on("click",".c-service__select-variants",function(){n.isDisabled()||n.isChecked()||n.getCheckbox().prop("checked",!0).trigger("change")})},isHideUnavailableVariants:function(){return t.find(".c-service__variants_hide_unavailable").length>0},getServiceId:function(){return+n.getCheckbox().val()},getServiceVariantId:function(){return n.hasVariants()?+n.getSelectVariants().val():+n.getInputVariant().val()},refreshSelectVariants:function(){var e=n.getCheckbox().prop("checked");n.getSelectVariants().prop("disabled",!e)},updatePrice:function(e,n){t.find(".c-service__price").html(y.format(e,n,!1))}
1,updateVariants:function(t,i){var a=n.getSelectVariants(),o=n.getVariants(),r=a.val(),c=!0;o.each(function(){var a=e(this),o=a.val(),s=t[o];if(s){var l=s[0],d=s[1],u=l+" (+"+y.format(d,i,!0)+")";n.enableVariant(a),a.data("price",d),a.text(u)}else o===r&&(c=!1),n.disableVariant(a)}),c||o.filter(":enabled:first").prop("selected",!0)},getVariants:function(){return t.find(".c-service__variant")},getCheckbox:function(){return t.find("input.c-service__checkbox")},getSelectVariants:function(){return t.find("select.c-service__select-variants")},getInputVariant:function(){return t.find(".c-service__input-variant")},hasVariants:function(){return n.getSelectVariants().length>0},isDisabled:function(){return n.getCheckbox().prop("disabled")},isChecked:function(){return n.getCheckbox().prop("checked")},enable:function(){n.getCheckbox().prop("disabled",!1)},disable:function(){n.getCheckbox().prop("disabled",!0).prop("checked",!1)},enableVariant:function(e){e.prop("disabled",!1),n.isHideUnavailableVariants()&&e.show()},disableVariant:function(e){e.prop("disabled",!0),n.isHideUnavailableVariants()&&e.hide()}}),n.initEventListeners()})),z=i.Quantity=r.register(function(e){return e.select(".c-quantity")},function(t,n){e.extend(n,{timeout_id:null,initEventListeners:function(){t.on("click",".c-quantity__minus-button",function(){if(!0===n.getInput().prop("disabled"))return!1;n.setValue(n.getValue()-1),n.startTimeoutChange()}),t.on("click",".c-quantity__plus-button",function(){if(!0===n.getInput().prop("disabled"))return!1;n.setValue(n.getValue()+1),n.startTimeoutChange()}),t.on("change",".c-quantity__input",function(e){if(!0===n.getInput().prop("disabled"))return!1;e.stopPropagation(),n.refreshValue(),t.trigger("change")})},getInput:function(){return t.find(".c-quantity__input")},getValue:function(){return n.handleValue(n.getInput().val())},setValue:function(e){n.getInput().val(n.handleValue(e)),t.trigger("set_value@megashop:c-quantity")},startTimeoutChange:function(){clearTimeout(n.timeout_id),n.timeout_id=setTimeout(function(){n.getInput().trigger("change")},500)},handleValue:function(e){return e=parseInt(e),isNaN(e)&&(e=1),Math.max(1,e)},refreshValue:function(){n.setValue(n.getValue())}}),n.initEventListeners()}),A=(i.ComparePage=r.register(function(e){return e.select(".c-compare-page")},function(t,i){var a={product_ids:t.data("product_ids"),selected_type:t.data("selected_type"),rows_by_index:[],initRows:function(){t.find(".c-compare-page__row_feature, .c-compare-page__row_divider, .c-compare-page__row_feature-value, .c-compare-page__row_divider-value").each(function(){var t=e(this),n=t.index();a.rows_by_index[n]||(a.rows_by_index[n]=e()),a.rows_by_index[n]=a.rows_by_index[n].add(t)})},initSwiper:function(){if(!(a.product_ids.length<=4)){var e=t.find(".c-compare-page__products_header"),n=new Swiper(e.get(0),{wrapperClass:"c-compare-page__products-wrapper",slideClass:"c-compare-page__product",spaceBetween:0,slidesPerView:4,watchSlidesVisibility:!0,watchSlidesProgress:!0,loopFillGroupWithBlank:!0,navigation:{prevEl:t.find(".c-compare-page__prev-arrow").get(0),nextEl:t.find(".c-compare-page__next-arrow").get(0)}}),i=t.find(".c-compare-page__products_features"),o=new Swiper(i.get(0),{wrapperClass:"c-compare-page__products-wrapper",slideClass:"c-compare-page__product",spaceBetween:0,slidesPerView:4,watchSlidesVisibility:!0,watchSlidesProgress:!0,loopFillGroupWithBlank:!0,navignation:{}});o.controller.control=n,n.controller.control=o}},initEventListeners:function(){t.on("change_view",".c-compare-control",function(e,t){"hide_same"===t.view?i.hideSame():i.showSame()}),t.on("change_type",".c-compare-control",function(e,t){i.replace(t.url)}),t.on("delete",".c-compare-product",function(e,t){var o=t.product_id;if($.remove(o),"all"===a.selected_type)i.replace("");else{var r=a.product_ids.filter(function(e){return e!==o});if(0===r.length)i.replace(n.shop.compare_url);else{var c=n.shop.compare_id_url.replace("{$id}",r.join(","));i.replace(c)}}}),t.on("click",".c-compare-control__delete-list-button",function(){a.product_ids.forEach(function(e){$.remove(e)}
1),i.replace(n.shop.compare_url)}),e(window).on("scroll",a.handleScroll)},handleScroll:function(){i.updateFixedState()}};e.extend(i,{destruct:function(){e(window).off("scroll",a.handleScroll)},updateFixedState:function(){var e=t.find(".c-compare-page__header");if(0!==e.length&&0!==a.product_ids.length){var n=e.offset().top===window.scrollY;t.toggleClass("c-compare-page_fixed",n)}},updateRowsHeight:function(){t.find(".c-compare-page__row_feature, .c-compare-page__row_divider").each(function(){var t=e(this),n=a.rows_by_index[t.index()]||e(),i=0;n.height("auto"),n.each(function(){var t=e(this);i=Math.max(i,t.outerHeight())}),n.outerHeight(i)})},showSame:function(){return t.removeClass("c-compare-page_hide-same")},hideSame:function(){return t.addClass("c-compare-page_hide-same")},replace:function(n){t.addClass("c-compare-page_loading"),e.ajax({url:n}).then(function(i){var a=e(i).find(".c-compare-page");t.replaceWith(a),u.replaceState({},"",n),o(a.parent())},function(){t.removeClass("c-compare-page_loading")})}}),a.initEventListeners(),a.initRows(),a.initSwiper(),i.updateRowsHeight()}),i.CompareProduct=r.register(function(e){return e.select(".c-compare-product")},function(e){var t={product_id:e.data("product_id"),initEventListeners:function(){e.on("click",".c-compare-product__delete-button",function(){e.trigger("delete",{product_id:t.product_id})})}};t.initEventListeners()}),i.CompareControl=r.register(function(e){return e.select(".c-compare-control")},function(t){(function(){t.find("input.c-compare-control__view").on("change",function(){t.trigger("change_view",{view:e(this).val()})}),t.find("select.c-compare-control__type").on("change",function(){t.trigger("change_type",{url:e(this).val()})})})()}),i.CartPage=r.register(function(e){return e.select(".c-cart-page")},function(t,i){var a={isBuy1step:function(){return t.find(".c-cart-summary").hasClass("c-cart-summary_buy1step")},initEventListeners:function(){t.find(".c-cart-page__form").on("success@megashop:c-ajax-form",function(n,i){var a=e(i),r=a.find(".c-cart-page__container-summary");t.find(".c-cart-page__container-summary").replaceWith(r),o(r),e(".c-cart-item__error").remove(),e(".c-quantity__input").prop("disabled",!1),e(".c-cart-item__container-quantity .c-quantity_error").removeClass("c-quantity_error");var c=a.find(".c-cart-item__error");c.length&&c.each(function(){var t=e(this),n=t.closest(".c-cart-item").data("item_id"),i=e(".c-cart-item").filter('[data-item_id="'+n+'"]');i.find(".c-cart-item__error").length||i.append(t)});var s=a.find(".c-cart-item__no-available");s.length&&s.each(function(){var t=e(this),n=t.closest(".c-cart-item").data("item_id"),i=e(".c-cart-item").filter('[data-item_id="'+n+'"]');i.find(".c-cart-item__container-quantity .c-cart-item__no-available").length||i.find(".c-cart-item__container-quantity").append(t),i.find(".c-cart-item__responsive-quantity-container .c-cart-item__no-available").length||i.find(".c-cart-item__responsive-quantity-container").append(t),i.find(".c-quantity__input").prop("disabled",!0)});var l=a.find(".c-cart-item__container-quantity .c-quantity_error");l.length&&l.each(function(){var t=e(this).closest(".c-cart-item").data("item_id");e(".c-cart-item").filter('[data-item_id="'+t+'"]').find(".c-quantity").addClass("c-quantity_error")})}),t.find(".c-cart-page__clear-button").on("click",function(){k.clear().then(function(){var t=null;a.isBuy1step()&&(t=function(){e(".buy1step-page__checkout-box").remove()}),i.refresh(t)})}),t.on("change",".c-cart-summary",function(e){e.stopPropagation(),t.find(".c-cart-page__form").trigger("submit")}),e(document).on("shop_cart_add@megashop:global shop_cart_update@megashop:global shop_cart_delete@megashop:global",a.handleCart),e(document).on("shop_cart_add_product@megashop:global",a.handleCartAddProduct),e(document).on("change",".c-cart-item",a.handleChangeCartItem),a.isBuy1step()&&e(document).on("click",".c-cart-summary__button",function(t){t.preventDefault(),t.stopPropagation(),l.scrollTo(e(".buy1step-page__checkout-box").offset().top-15)})},handleChangeCartItem:function(n){0===e(n.target).closest(t).length&&i.refresh()},handleCartAddProduct:function(){i.refresh()},handleCart:function(e,a){var o=0,r=new RegExp("^"+n.shop.add_affiliate_bonus_string+"$");try{o=a.data.add_affiliate_bonus.match(r)[1]||0}catch(e){}i.setAddAffiliateBonus(o);var c=n.shop.currency_info[n.shop.currency],s=a.data.affiliate_discount&&y.parse(a.data.affiliate_discount,c,!1);s=s||0;var l=y.parse(a.data.discount,c,!1),d=y.parse(a.data.total,c,!1)+l;i.isUseAffiliate()&&(d+=s),i.setAffiliateDiscount(a.data.affiliate_discount),i.setDiscount(a.data.discount),i.setTotal(a.data.total),i.setSubtotal(d),0==+a.data.count?i.refresh():t.data("is_enabled_refresh_shapes")&&i.refreshShapes()},getSummary:function(){return A(t.find(".c-cart-summary"))},refresh:function(){var t=e.Deferred();return e.ajax({url:""}).then(function(n){var i=e(n),a=i.find(".c-cart-page").add(i.filter(".c-cart-page"));t.resolve(a)},t.reject),t},touchCartItems:function(n){var i=t.find(".c-cart-item"),a=n.find(".c-cart-item");i.each(function(){var t=e(this),n=t.data("item_id"),i=a.filter('[data-item_id="'+n+'"]');if(t.toggleClass("c-cart-item_removed",0===i.length),i.length){[".c-cart-item__responsive-total-container .c-cart-item__total-price",".c-cart-item__responsive-total-container .c-cart-item__total-compare-price",".c-cart-item__responsive-total-container .c-cart-item__sub-total",".c-cart-item__container-total .c-cart-item__total-price",".c-cart-item__container-total .c-cart-item__total-compare-price",".c-cart-item__container-total .c-cart-item__sub-total"].forEach(function(e){t.find(e).replaceWith(i.find(e))}),t.find(".c-quantity__input").val(i.find(".c-quantity__input").val())}o(t)})}};e.extend(i,{isUseAffiliate:function(){return a.getSummary().isUseAffiliate()},destruct:function(){e(document).off("shop:cart_add megashop:shop:cart_update megashop:shop:cart_delete",a.handleCart),e(document).off("shop_cart_add_product@megashop:global",a.handleCartAddProduct),e(document).off("
1change",".c-cart-item",a.handleChangeCartItem)},refresh:function(e){a.refresh().then(function(n){t.replaceWith(n),"function"==typeof e&&e(),o(n.parent())})},refreshShapes:function(){var e=t.find(".c-cart-items-container");e.addClass("c-cart-items-container_loading"),a.refresh().then(function(t){a.touchCartItems(t),e.removeClass("c-cart-items-container_loading")})},setTotal:function(e){a.getSummary().setTotal(e)},setDiscount:function(e){a.getSummary().setDiscount(e)},setAffiliateDiscount:function(e){a.getSummary().setAffiliateDiscount(e)},setAddAffiliateBonus:function(e){a.getSummary().setAddAffiliateBonus(e)},setSubtotal:function(e){a.getSummary().setSubtotal(e)}}),a.initEventListeners()}),i.CartSummary=r.register(function(e){return e.select(".c-cart-summary")},function(i,a){var r={use_affiliate:!!i.data("use_affiliate"),initEventListeners:function(){i.find("input.c-cart-summary__use-affiliate-input").on("change",function(){i.trigger("change")})}};e.extend(a,{isUseAffiliate:function(){return r.use_affiliate},setTotal:function(e){i.find(".c-cart-summary__total").html(e)},setDiscount:function(e){i.find(".c-cart-summary__discount").html(e)},setAffiliateDiscount:function(e){i.find(".c-cart-summary__affiliate-discount").html(e)},setAddAffiliateBonus:function(e){i.find(".c-cart-summary__add-affiliate-bonus").html(e+" б.")},setSubtotal:function(e){var a=t.RowValue(i.find(".c-cart-summary__sub-total_sub-total").find(".c-row-value")),o=n.shop.currency_info[n.shop.currency];a.setValue(y.format(e,o,!1))},refresh:function(){e.ajax({url:""}).then(function(t){var n=e(t).find(".c-cart-summary");i.replaceWith(n),o(n.parent())})}}),r.initEventListeners()}));i.CartItem=r.register(function(e){return e.select(".c-cart-item")},function(t,n){var i={initEventListeners:function(){t.on("change",".c-quantity",function(a){a.stopPropagation();var o=z(e(this));k.updateItem(n.getId(),o.getValue(),!0).then(function(e){if(e.data.error)return i.setQuantityValue(o.getValue()),void f.showMessage(e.data.error);t.find(".c-cart-item__quantity").text(o.getValue()),i.setQuantityValue(o.getValue()),n.setTotal(e.data.item_total),t.trigger("change"),t.trigger("change@megashop:c-cart-item")})}),t.on("click",".c-cart-item__delete-button",function(){k.deleteItem(n.getId()).then(function(){t.trigger("delete@megashop:c-cart-item"),t.remove()})}),t.on("check@megashop:c-service",".c-service",function(){var i=e(this),a=F(i);k.addService(n.getId(),a.getServiceId(),a.getServiceVariantId()).then(function(e){n.setTotal(e.data.item_total),i.data("item_id",e.data.id),t.trigger("change"),t.trigger("change@megashop:c-cart-item")})}),t.on("uncheck@megashop:c-service",".c-service",function(){var i=e(this);k.deleteItem(i.data("item_id")).then(function(e){n.setTotal(e.data.item_total),i.removeData("item_id"),t.trigger("change"),t.trigger("change@megashop:c-cart-item")})}),t.on("change@megashop:c-service",".c-service",function(){var i=e(this),a=F(i);k.updateService(i.data("item_id"),a.getServiceVariantId()).then(function(e){n.setTotal(e.data.item_total),t.trigger("change"),t.trigger("change@megashop:c-cart-item")})})},setQuantityValue:function(n){t.find(".c-quantity").each(function(){z(e(this)).setValue(n)})}};e.extend(n,{getId:function(){return t.data("item_id")},setTotal:function(e){t.find(".c-cart-item__total-price").html(e)}}),i.initEventListeners()});i.CartItems=r.register(function(e){return e.select(".c-cart-items")},function(t){var n={initEventListeners:function(){t.on("delete@megashop:c-cart-item",".c-cart-item",function(){e(this).closest(".c-cart-items__item").remove(),n.isBuy1step()&&0===t.find(".c-cart-item").length&&e(".buy1step-page__checkout-box").remove()})},isBuy1step:function(){return e(".c-cart-summary").hasClass("c-cart-summary_buy1step")}};n.initEventListeners()});i.CartItemModal=r.register(function(e){return e.select(".c-cart-item-modal")},function(t,n){var i={initEventListeners:function(){t.find(".c-cart-item-modal__continue-button").on("click",function(){c.close()}),e(document).on("shop_cart_add@megashop:global",i.handleCartChange),e(document).on("shop_cart_update@megashop:global",i.handleCartChange),e(document).on("shop_cart_delete@megashop:global",i.handleCartChange),e(document).on("shop_cart_clear@megashop:global",i.handleCartClean)},handleCartChange:function(e,t){n.changeCount(t.data.count),n.changeTotal(t.data.total)},handleCartClean:function(){n.changeCount(0),n.changeTotal(0)}};e.extend(n,{destruct:function(){e(document).off("shop_cart_add@megashop:global",i.handleCartChange),e(document).off("shop_cart_update@megashop:global",i.handleCartChange),e(document).off("shop_cart_delete@megashop:global",i.handleCartChange),e(document).off("shop_cart_clear@megashop:global",i.handleCartClean)},changeCount:function(e){t.find(".c-cart-item-modal__count").text(e+" "+p.plural(e,["товар","товара","товаров"]))},changeTotal:function(e){t.find(".c-cart-item-modal__total").html(e)}}),i.initEventListeners()}),i.CheckoutPage=r.register(function(e){return e.select(".c-checkout-page")},function(t,n){e.extend(n,{initEventListeners:function(){t.find(".c-checkout-page__back-button").on("click",function(){window.location=e(this).data("href")}),t.on("click",".c-checkout-page__responsive-step",function(){var t=e(this);window.location=t.data("step_href")})},preventDoubleCheckout:function(){var e=t.find(".c-checkout-page__step-container"),n=e.find(".c-checkout-page__form_last");if(n){var i=!1;n.on("submit",function(t){return!i&&(i=!0,n.find("button").attr("disabled","disabled"),e.addClass("c-checkout-page__step-container_loading"),!0)})}}}),n.initEventListeners(),n.preventDoubleCheckout()});i.CheckoutSummary=r.register(function(e){return e.select(".c-checkout-summary")}
1,function(a,o){var r={total:a.data("total"),initGlobalEventListeners:function(){e(document).on("check@megashop:c-checkout-shipping-method update_rate@megashop:c-checkout-shipping-method",".c-checkout-shipping-method",function(){r.updateTotal()})},updateTotal:function(){e(".c-checkout-shipping-method").each(function(){var t=i.CheckoutShippingMethod(e(this));if(t.isChecked()){var n=t.getRate(),a=n?parseFloat(n.rate_raw):0,c=t.isFree();o.setShipping(a,c),o.setTotal(r.total+(c?0:a))}})},destroyGlobalEventListeners:function(){}};e.extend(o,{setShipping:function(e,i){var o=a.find(".c-checkout-summary__sub-total_shipping"),r=t.RowValue(o.find(".c-row-value")),c=i?"Бесплатно":y.format(e,n.shop.currency_info[n.shop.currency]);r.setValue(c),a.toggleClass("c-checkout-summary_has-shipping",!!e||i)},setTotal:function(e){var t=y.format(e,n.shop.currency_info[n.shop.currency]);a.find(".c-checkout-summary__total").html(t)}}),r.initGlobalEventListeners(),r.updateTotal()});i.CheckoutSteps=r.register(function(e){return e.select(".c-checkout-steps")},function(t,n){e.extend(n,{initEventListeners:function(){t.find(".c-checkout-steps__step").on("click",function(){var t=e(this);window.location=t.data("step_href")})}}),n.initEventListeners()}),i.CheckoutContactinfo=r.register(function(e){return e.select(".c-checkout-contactinfo")},function(t,n){e.extend(n,{initEventListeners:function(){t.find(".c-checkout-contactinfo__billing-matches-shipping-button").on("click",function(){t.removeClass("c-checkout-contactinfo_billing-matches-shipping"),t.find(".c-checkout-contactinfo__billing-matches-shipping").remove()})}}),n.initEventListeners()}),i.CheckoutMethod=r.register(function(e){return e.select(".c-checkout-method")},function(t,n){e.extend(n,{initEventListeners:function(){t.find(".c-checkout-method__control").on("change",function(){e(document).trigger("shop:checkout_method_change")}),e(document).on("shop:checkout_method_change",function(){n.updateState()}),n.updateState()},getControl:function(){return t.find("input.c-checkout-method__control")},updateState:function(){t.toggleClass("c-checkout-method_checked",n.isChecked())},enable:function(){t.removeClass("c-checkout-method_disabled")},disable:function(){t.addClass("c-checkout-method_disabled"),n.getControl().prop("checked",!1),n.updateState()},isChecked:function(){return n.getControl().prop("checked")}}),n.initEventListeners()}),i.CheckoutSignup=r.register(function(e){return e.select(".c-checkout-signup")},function(t,n){e.extend(n,{initEventListeners:function(){n.getControl().on("change",function(){n.updateState()}),n.updateState()},updateState:function(){t.toggleClass("c-checkout-signup_active",n.isActive())},isActive:function(){return n.getControl().prop("checked")},getControl:function(){return t.find("input.c-checkout-signup__control")}}),n.initEventListeners()});var I=i.CheckoutShippingMethod=r.register(function(e){return e.select(".c-checkout-shipping-method")},function(t,i){var a={shipping_id:t.data("shipping_id"),shipping_rates:t.data("shipping_rates"),initEventListeners:function(){var n=t.find(".c-checkout-shipping-method__control");n.on("change",function(){i.updateState()}),t.find("select.c-checkout-shipping-method__rates").on("change",function(){i.updateRate()}),t.on("click",function(t){i.isChecked()||e(t.target).closest(".c-checkout-shipping-method__label, .c-checkout-shipping-method__content-container").length>0||n.trigger("click")}),t.on("change",".c-checkout-shipping-method__content-container",function(){i.send().then(function(){i.updateRates()})}),e(document).on("check@megashop:c-checkout-shipping-method",".c-checkout-shipping-method",a.handleCheck)},handleCheck:function(){i.updateState()},setRate:function(e){t.find(".c-checkout-shipping-method__price-container").html(e||""),t.find(".c-checkout-shipping-method__responsive-price-container").html(e||"")},setComment:function(e){var n=t.find(".c-checkout-shipping-method__comment-container");n.html(e),n.toggleClass("c-checkout-shipping-method__comment-container_empty",!e)},setError:function(e){var n=t.find(".c-checkout-shipping-method__error-container");n.html(e),n.toggleClass("c-checkout-shipping-method__error-container_empty",!e)},setEstDelivery:function(e){var n=t.find(".c-checkout-shipping-method__est-delivery-container");n.find(".c-checkout-shipping-method__est-delivery").html(e),n.toggleClass("c-checkout-shipping-method__est-delivery-container_empty",!e)},getRate:function(){var e=t.find("select.c-checkout-shipping-method__rates");if(!a.shipping_rates)return null;var n=a.shipping_rates.find(function(t){return t.id==e.val()});return n||null},handleShippingRates:function(e){e.forEach(function(e){null!==e.rate?isNaN(e.rate)&&e.currency?e.rate_raw=y.parse(e.rate,n.shop.currency_info[n.shop.currency],!0):e.rate_raw=e.rate:e.rate_raw=0})}};
1e.extend(i,{destruct:function(){e(document).off("check",".c-checkout-shipping-method",a.handleCheck)},updateState:function(){var e=t.find(".c-checkout-shipping-method__control");!t.hasClass("c-checkout-shipping-method_checked")&&e.prop("checked")?i.check():t.hasClass("c-checkout-shipping-method_checked")&&!e.prop("checked")&&i.uncheck()},isChecked:function(){return i.updateState(),t.hasClass("c-checkout-shipping-method_checked")},isLoaded:function(){return void 0!==a.shipping_rates},isFree:function(){var e=a.getRate();return 0===(e?parseFloat(e.rate_raw):0)||this.isFreedelivery()},isFreedelivery:function(){return!!t.find(".freedelivery-new-price").length},load:function(){var t=e.Deferred();return e.ajax({url:n.shop.data_shipping_url,data:{shipping_id:[a.shipping_id],html:!0}}).then(function(e){if("string"==typeof e.data[a.shipping_id])return a.setError(e.data[a.shipping_id]),void t.reject(e);a.setError(""),a.shipping_rates=e.data[a.shipping_id],a.handleShippingRates(a.shipping_rates),t.resolve(e)},t.reject),t},send:function(){var i=t.closest("form"),o=e.Deferred();return e.ajax({url:n.shop.data_shipping_url,method:"post",data:i.serialize()}).then(function(e){if("string"==typeof e.data)return a.setError(e.data),void o.reject(e);a.setError(""),a.shipping_rates=e.data,a.handleShippingRates(a.shipping_rates),o.resolve(e)},o.reject),o},check:function(){t.addClass("c-checkout-shipping-method_checked"),t.trigger("check@megashop:c-checkout-shipping-method"),t.get(0).offsetParent,_.isDesktopMin()||l.scrollTo(t.offset().top-60-15)},trigger:function(){t.find(".c-checkout-shipping-method__control").trigger("change")},uncheck:function(){t.removeClass("c-checkout-shipping-method_checked"),t.trigger("uncheck@megashop:c-checkout-shipping-method")},updateRates:function(){var n=t.find("select.c-checkout-shipping-method__rates");
1n.empty(),a.shipping_rates.forEach(function(t){var i=e("<option></option>");i.val(t.id),i.text(t.name+" ("+t.rate+")"),n.append(i)}),t.find(".c-checkout-shipping-method__rates-container").toggleClass("c-checkout-shipping-method__rates-container_multi",a.shipping_rates.length>1),i.updateRate()},updateRate:function(){var e=a.getRate();e&&(a.setRate(e.rate_html),a.setComment(e.comment),a.setEstDelivery(e.est_delivery),t.trigger("update_rate@megashop:c-checkout-shipping-method"))},getRate:function(){return a.getRate()}}),a.initEventListeners(),i.isLoaded()||i.load().then(function(){i.updateRates(),t.removeClass("c-checkout-shipping-method_loading")},function(){t.removeClass("c-checkout-shipping-method_loading")})});i.CheckoutShipping=r.register(function(e){return e.select(".c-checkout-shipping")},function(e){var t=function(){var t=e.find(".c-checkout-shipping-method_checked");return I(t)};e.data("is_shipping_changed")&&t().trigger()});i.CheckoutPaymentMethod=r.register(function(e){return e.select(".c-checkout-payment-method")},function(t,n){var i={initEventListeners:function(){var a=t.find(".c-checkout-payment-method__control");a.on("change",function(){n.updateState()}),t.on("click",function(t){e(t.target).closest(".c-checkout-payment-method__label, .c-checkout-payment-method__content-container").length>0||a.trigger("click")}),e(document).on("check",".c-checkout-payment-method",i.handleCheck)},handleCheck:function(){n.updateState()}};e.extend(n,{destruct:function(){e(document).off("check",".c-checkout-payment-method",i.handleCheck)},updateState:function(){var e=t.find(".c-checkout-payment-method__control");!n.isChecked()&&e.prop("checked")?n.check():n.isChecked()&&!e.prop("checked")&&n.uncheck()},isChecked:function(){return t.hasClass("c-checkout-payment-method_checked")},check:function(){t.addClass("c-checkout-payment-method_checked"),t.trigger("check")},uncheck:function(){t.removeClass("c-checkout-payment-method_checked"),t.trigger("uncheck")}}),i.initEventListeners()}),i.CheckoutInfo=r.register(function(e){return e.select(".c-checkout-info")},function(t,n){e.extend(n,{updateList:function(){var e=t.find(".c-checkout-info__line").not(".c-checkout-info__line_empty");t.find(".c-checkout-info__list").toggleClass("c-checkout-info__list_empty",0===e.length)},setDiscount:function(e){var i=t.find(".c-checkout-info__line_discount");i.find(".c-checkout-info__line-value").html(e),i.toggleClass("c-checkout-info__line_empty",!e),n.updateList()},setAffiliateDiscount:function(e){var i=t.find(".c-checkout-info__line_affiliate-discount");i.find(".c-checkout-info__line-value").html("− "+e),i.toggleClass("c-checkout-info__line_empty",!e),n.updateList()},setTotal:function(e){t.find(".c-checkout-info__total").find(".c-checkout-info__total-value").html(e)}})}),i.ReviewsThumbsSlider=r.register(function(e){return e.select(".c-reviews-thumbs-slider")},function(t){var i={initGlobalEventListeners:function(){e(document).on("slide_prev@megashop:c-slider-block",".c-slider-block",i.handleSlidePrev),e(document).on("slide_next@megashop:c-slider-block",".c-slider-block",i.handleSlideNext)},destroyGlobalEventListeners:function(){e(document).off("slide_prev@megashop:c-slider-block",".c-slider-block",i.handleSlidePrev),e(document).off("slide_next@megashop:c-slider-block",".c-slider-block",i.handleSlideNext)},initSwiper:function(){t.addClass("c-reviews-thumbs-slider_swiper");var e=new Swiper(t.get(0),{wrapperClass:"c-reviews-thumbs-slider__wrapper",slideClass:"c-reviews-thumbs-slider__item",spaceBetween:30,slidesPerView:"auto",watchSlidesVisibility:!0,watchSlidesProgress:!0,breakpoints:n.shop.slider_breakpoints.reviews_thumbs});t.trigger("init@megashop:swiper",e)},handleSlidePrev:function(){0!==t.closest(e(this)).length&&t.get(0).swiper.slidePrev()},handleSlideNext:function(){0!==t.closest(e(this)).length&&t.get(0).swiper.slideNext()}};return i.initSwiper(),i.initGlobalEventListeners(),function(){i.destroyGlobalEventListeners()}}),i.BrandsThumbsSlider=r.register(function(e){return e.select(".c-brands-thumbs-slider")},function(t){var i={initGlobalEventListeners:function(){e(document).on("slide_prev@megashop:c-slider-block",".c-slider-block",i.handleSlidePrev),e(document).on("slide_next@megashop:c-slider-block",".c-slider-block",i.handleSlideNext)},destroyGlobalEventListeners:function(){e(document).off("slide_prev@megashop:c-slider-block",".c-slider-block",i.handleSlidePrev),e(document).off("slide_next@megashop:c-slider-block",".c-slider-block",i.handleSlideNext)},initSwiper:function(){t.addClass("c-brands-thumbs-slider_swiper");var e=new Swiper(t.get(0),{wrapperClass:"c-brands-thumbs-slider__wrapper",slideClass:"c-brands-thumbs-slider__item",spaceBetween:30,slidesPerView:"auto",watchSlidesVisibility:!0,watchSlidesProgress:!0,breakpoints:n.shop.slider_breakpoints.brands_thumbs});t.trigger("init@megashop:swiper",e)},handleSlidePrev:function(){0!==t.closest(e(this)).length&&t.get(0).swiper.slidePrev()},handleSlideNext:function(){0!==t.closest(e(this)).length&&t.get(0).swiper.slideNext()}};return i.initSwiper(),i.initGlobalEventListeners(),function(){i.destroyGlobalEventListeners()}}),i.PostsThumbsSlider=r.register(function(e){return e.select(".c-posts-thumbs-slider")},function(t){var i={initGlobalEventListeners:function(){e(document).on("slide_prev@megashop:c-slider-block",".c-slider-block",i.handleSlidePrev),e(document).on("slide_next@megashop:c-slider-block",".c-slider-block",i.handleSlideNext)},destroyGlobalEventListeners:function(){e(document).off("slide_prev@megashop:c-slider-block",".c-slider-block",i.handleSlidePrev),e(document).off("slide_next@megashop:c-slider-block",".c-slider-block",i.handleSlideNext)},initSwiper:function(){var e=new Swiper(t.get(0),{wrapperClass:"c-posts-thumbs-slider__wrapper",slideClass:"c-posts-thumbs-slider__item",spaceBetween:30,slidesPerView:"auto",watchSlidesVisibility:!0,watchSlidesProgress:!0,breakpoints:n.shop.slider_breakpoints.posts_thumbs});t.trigger("megashop:init.megashop:swiper",e)},handleSlidePrev:function(){0!==t.closest(e(this)).length&&t.get(0).swiper.slidePrev()},handleSlideNext:function(){0!==t.closest(e(this)).length&&t.get(0).swiper.slideNext()}};return i.initSwiper(),i.initGlobalEventListeners(),function(){i.destroyGlobalEventListeners()}});i.ProductsThumbsSliderDecorator=r.register(function(e){return e.select(".c-products-thumbs-slider-decorator")},function(t){var n=t.find(".c-products-thumbs");(function(){n.removeClass("c-products-thumbs"),n.addClass("c-products-thumbs-slider swiper-container");var t=e('<div class="c-products-thumbs-slider__wrapper swiper-wrapper"/>');n.prepend(t),n.find(".c-products-thumbs__item").each(function(){e(this).removeClass("c-products-thumbs__item"),e(this).addClass("c-products-thumbs-slider__item swiper-slide"),t.append(e(this))})})(),o(t)});i.ProductsThumbsSlider=r.register(function(e){return e.select(".c-products-thumbs-slider")},function(t){var i={initGlobalEventListeners:function(){e(document).on("slide_prev@megashop:c-slider-block",".c-slider-block",i.handleSlidePrev),e(document).on("slide_next@megashop:c-slider-block",".c-slider-block",i.handleSlideNext)},destroyGlobalEventListeners:function(){e(document).off("slide_prev@megashop:c-slider-block",".c-slider-block",i.handleSlidePrev),e(document).off("slide_next@megashop:c-slider-block",".c-slider-block",i.handleSlideNext)},initSwiper:function(){t.addClass("c-products-thumbs-slider_swiper");
1var e=t.attr("data-space"),a=t.attr("data-slides-per-view"),o=t.hasClass("c-products-thumbs-slider_cols"),r=t.hasClass("c-products-thumbs-slider_compact"),c=n.shop.slider_breakpoints.products_thumbs;o&&(c=n.shop.slider_breakpoints.products_thumbs_cols),r&&(c=n.shop.slider_breakpoints.products_thumbs_compact);var s=new Swiper(t.get(0),{spaceBetween:e?parseInt(e):30,slidesPerView:a?parseInt(a):"auto",watchSlidesVisibility:!0,watchSlidesProgress:!0,breakpoints:c});t.trigger("init@megashop:swiper",s),i.initProductsImagesGalleries()},handleSlidePrev:function(){0!==t.closest(e(this)).length&&t.get(0).swiper.slidePrev()},handleSlideNext:function(){0!==t.closest(e(this)).length&&t.get(0).swiper.slideNext()},initProductsImagesGalleries:function(){var n=t.find(".c-product-thumb__image-box_gallery");if(n.length>0){var i=!1,a=!1;_.isMobileMax()&&(a=!0),_.isTabletMax()&&(i=!0),n.each(function(){var n=e(this);if(t.hasClass("c-products-thumbs-slider_cols")){var o=n.find(".c-swiper-lazy");m("(max-width: 560px)")&&o.each(function(){var t=e(this),n=t.data("src"),i=t.data("srcset");t.attr("data-src",n.replace(/^(.*\/[0-9]+\.)(.*)(\..*)$/,"$1100$3")),t.attr("data-srcset",i.replace(/^(.*\/[0-9]+\.)(.*)(\..*)$/,"$1200$3"))})}n.addClass("c-product-thumb__image-box_swiper-init"),new Swiper(n.get(0),{wrapperClass:"c-product-thumb__gallery-wrapper",slideClass:"c-product-thumb__image-slide",slidesPerView:1,loop:i,nested:!0,pagination:{el:".c-product-gallery-pagination",bulletClass:"c-product-gallery-pagination__bullet",bulletActiveClass:"c-product-gallery-pagination__bullet_active",dynamicBullets:a,dynamicMainBullets:5,clickable:!0},lazy:{loadPrevNext:!0,elementClass:"c-swiper-lazy"}})})}}};return i.initSwiper(),i.initGlobalEventListeners(),function(){i.destroyGlobalEventListeners()}});var j=i.Product=r.register(function(e){return e.select(".c-product")},function(t,i){e.extend(i,{initEventListeners:function(){t.on("click",".c-product__delete-button",function(){i.delete()}),t.on("click",".c-product__recovery-button",function(){i.recovery()}),t.on("click",".c-product__quick-view",function(){var e=t.data("url");c.openAjax(e+"?cart=1")});var a=!1;t.on("submit",".c-product__add-to-cart-form",function(i){if(i.preventDefault(),t.hasClass("c-product_has-multi-skus")||t.hasClass("c-product_no-add")){var o=t.data("url");t.hasClass("c-product_has-multi-skus")?(_.isTabletMax()&&e.cookie("mobile_modal","1",{path:"/"}),c.openAjax(o+"?cart=1"),e.removeCookie("mobile_modal",{path:"/"})):window.location=o}else if(!a){a=!0;var r=e(this).serializeArray();r.push({name:"html",value:!0}),k.addByData(r).then(function(i){if((a=!1,"disabled"===t.attr("data-add-to-cart-effects")?e(document).trigger("shop_cart_add_product_effects_off@megashop:global",arguments):e(document).trigger("shop_cart_add_product@megashop:global",arguments),"ok"===i.status)&&"fly"===n.shop.add_to_cart_effect){var o=e(".c-cart-counter:visible:first");if(1===o.length){var r=t.find(".c-product__image:visible");d.flyImage(r,o,{zIndex:100})}}},function(){a=!1})}})},getProductId:function(){return t.data("product_id")},isDelete:function(){return t.hasClass("c-product_delete")},delete:function(){i.isDelete()||(t.addClass("c-product_delete"),t.trigger("delete"))},recovery:function(){i.isDelete()&&(t.removeClass("c-product_delete"),t.trigger("recovery"))}}),i.initEventListeners()}),B=(i.FavoritePage=r.register(function(e){return e.select(".c-favorite-page")},function(t,n){e.extend(n,{pageSet:t.hasClass("c-favorite-page_recently-viewed")?H:N,initEventListeners:function(){t.find(".c-favorite-page__r-categories").on("change",function(){window.location=e(this).val()});var i=t.find(".c-favorite-page__products");t.find(".c-favorite-page__r-clear-button").on("click",function(){n.deleteAll()}),t.find(".c-favorite-page__r-recovery-button").on("click",function(){n.recoveryAll()}),i.on("delete",function(){n.deleteAll()}),i.on("recovery",function(){n.recoveryAll()}),i.on("delete_product",function(e,t){var i=t.data("product_id");n.pageSet.remove(i)}),i.on("recovery_product",function(e,t){var i=t.data("product_id");n.pageSet.add(i)}),e(document).on("shop_update_favorite@megashop:global",function(){i.find(".c-product-thumb").each(function(){var t=j(e(this));N.has(t.getProductId())?t.recovery():t.delete()})}),e(document).on("shop_update_recently@megashop:global",function(){i.find(".c-product-thumb").each(function(){var t=j(e(this));H.has(t.getProductId())?t.recovery():t.delete()})})},deleteAll:function(){t.data("product_ids").forEach(function(e){n.pageSet.remove(e)}),t.addClass("c-favorite-page_delete")},recoveryAll:function(){t.data("product_ids").forEach(function(e){n.pageSet.add(e)}),t.removeClass("c-favorite-page_delete")}}),n.initEventListeners()}),i.AddImageSection=r.register(function(e){return e.select(".c-add-images-section")},function(t,n){e.extend(n,{$file_field:t.find(".js-file-field"),$files_wrapper:t.find(".js-attached-files-section"),$errors_wrapper:t.find(".js-errors-section"),max_post_size:t.data("max_post_size"),max_file_size:t.data("max_file_size"),max_files:t.data("max_files"),templates:{file:t.data("template_file"),error:t.data("template_error")}
1,patterns:{file:"images[%index%]",desc:"images_data[%index%][description]"},locales:{files_limit:"Вы можете загрузить макисмум "+t.data("max_files")+" изображений.",file_type:"Неподдерживаемый тип изображения. Разрешается только PNG, GIF и JPEG.",post_size:"Общий вес изображений не может быть больше чем "+Math.floor(10*t.data("max_post_size")/1024)/10+"KB.",file_size:"Вес одного изображения не может быть больше чем "+Math.floor(10*t.data("max_file_size")/1024)/10+"KB."},post_size:0,id_counter:0,files_data:{},images_count:0,initEventListeners:function(){var i=n,a=e(document);t.data("controller",n),i.$file_field.on("change",function(){s(this.files),i.$file_field.val("")}),t.on("click",".js-show-textarea",function(t){t.preventDefault(),e(this).closest(".c-description-wrapper").addClass("is-extended")}),t.on("click",".js-delete-file",function(t){t.preventDefault();var n=e(this).closest(".c-file-wrapper"),a=""+n.data("file-id");if(a&&i.files_data[a]){var o=i.files_data[a];i.post_size-=o.file.size,delete i.files_data[a],i.images_count-=1}n.remove(),i.renderErrors()}),t.on("keyup change",".js-textarea",function(t){var n=e(this),a=""+n.closest(".s-file-wrapper").data("file-id");a&&i.files_data[a]&&(i.files_data[a].desc=n.val())});var o=null,r=!1;function c(e){e?i.addClass("is-highlighted"):i.removeClass("is-highlighted")}function s(t){var n=[],a=[];e.each(t,function(e,t){var o=i.addFile(t);if(o.error){var r=o.error;n.indexOf(r.type)<0&&(n.push(r.type),a.push(r))}}),i.renderErrors(a)}a.on("dragover",function n(i){var s=e.contains(document,t);s?function(e){e.preventDefault(),o?clearTimeout(o):r||(r=!0,c(!0));o=setTimeout(function(){o=null,r=!1,c(!1)},100)}(i):a.off("dragover",n)}),a.on("drop",function n(i){var o=e.contains(document,t);o?function(e){e.preventDefault(),s(e.originalEvent.dataTransfer.files),c(!1)}(i):a.off("drop",n)}),a.on("reset clear",function n(o){var r=e.contains(document,t);r?i.reset():a.off("reset clear",n)})},addFile:function(t){var n=this,i=t.size;if(t.type.match(/^image\/(png|jpe?g|gif)$/)){if(n.images_count>=n.max_files)return{error:{text:n.locales.files_limit,type:"files_limit"}};if(i>=n.max_file_size)return{error:{text:n.locales.file_size,type:"file_size"}};if(n.post_size+i>=n.max_file_size)return{error:{text:n.locales.post_size,type:"post_size"}};n.post_size+=i;var a=n.id_counter,o={id:a,file:t,desc:""};return n.files_data[a]=o,n.id_counter++,n.images_count+=1,function(){var i=e(n.templates.file),o=i.find(".c-image-wrapper");i.attr("data-file-id",a),(r=e.Deferred(),c=new FileReader,c.onload=function(e){r.resolve(e.target.result)},c.readAsDataURL(t),r.promise()).then(function(e){o.css("background-image","url("+e+")")}),n.$files_wrapper.append(i);var r,c}(),o}return{error:{text:n.locales.file_type,type:"file_type"}}},reset:function(){this.post_size=0,this.id_counter=0,this.files_data={},this.$files_wrapper.html(""),this.$errors_wrapper.html("")},getSerializedArray:function(){var t=this,n=[],i=0;return e.each(t.files_data,function(e,a){var o=t.patterns.file.replace("%index%",i),r=t.patterns.desc.replace("%index%",i);n.push({name:o,value:a.file}),n.push({name:r,value:a.desc}),i++}),n},renderErrors:function(t){var n=this,i=[];return n.$errors_wrapper.html(""),t&&t.length&&e.each(t,function(t,a){if(a.text){var o=e(n.templates.error.replace("%text%",a.text));o.appendTo(n.$errors_wrapper),i.push(o)}}),i}}),n.initEventListeners()}),i.ProductReview=r.register(function(e){return e.select(".c-product-review")},function(t,n){var a=!1,r=t.data("review_id");e.extend(n,{initEventListeners:function(){t.find(".c-product-review__reply-button:first").on("click",function(){if(!a){a=!0;var c=t.children(".c-product-review__replies"),s=e('<div class="c-product-review__reply"></div>'),l=e(i.product_review_reply_form);l.data("parent_id",r),l.on("close",function(){s.remove(),a=!1,n.updateHasReplies()}),l.on("reply_added",function(e,t){a=!1,s.html(t.html),c.append(s),o(s)}),l.appendTo(s),c.prepend(s),n.updateHasReplies(),o(t)}})},updateHasReplies:function(){var e=t.children(".c-product-review__replies").children();t.toggleClass("c-product-review_has-replies",e.length>0)}}),n.initEventListeners()}),i.ProductReviewReplyForm=r.register(function(e){return e.select(".c-product-review-reply-form")},function(t,n){e.extend(n,{initForm:function(){t.find(".c-product-review-reply-form__parent-id").val(t.data("parent_id"))},initEventListeners:function(){t.on("success@megashop:c-ajax-form",function(e,n){"ok"===n.status&&t.trigger("reply_added",n.data)}),t.find(".c-product-review-reply-form__close-button").on("click",function(){t.trigger("close")}),t.on("click",".c-product-review-reply-form__responsive-close-button",function(){t.trigger("close")})}}),n.initForm(),n.initEventListeners()}),i.ProductReviewForm=r.register(function(e){return e.select(".c-product-review-form")},function(t,n){e.extend(n,{initEventListeners:function(){t.on("success@megashop:c-ajax-form",function(n,i){"ok"===i.status&&(e(n.target).find('input[name="moderate"]').length>0?(t.find("form").remove(),t.find(".c-product-review-form__notice").show()):(t.trigger("review_added",i.data),c.close()))})}}),n.initEventListeners()}),i.ProductReviewAddButton=r.register(function(e){return e.select(".c-product-review-add-button")},function(t,n){e.extend(n,{initEventListeners:function(){t.on("click",function(){c.openContent(i.product_review_form)})}}),n.initEventListeners()}),i.ProductReviews=r.register(function(e){return e.select(".c-product-reviews")},function(t,n){var i=null,a=null;e.extend(n,{initEventListeners:function(){e(document).on("review_added",n.handleReviewAdd),t.on("filter",".c-product-reviews-overview",function(e,t){n.filterByRate(t)}),t.on("reset",".c-product-reviews-overview",function(){n.resetFilter()})},destruct:function(){e(document).off("review_added",n.handleReviewAdd)},handleReviewAdd:function(i,a){var r=e('<div class="c-product-reviews__review"></div>');r.append(a.html),t.find(".c-product-reviews__reviews").prepend(r),n.updateCount(),n.updateInfo(),n.updateFilter(),o(t)},filterByRate:function(e){i=e,n.setHeader("Отзывы с оценкой "+e),n.updateFilter()},resetFilter:function(){i=null,n.resetHeader(),n.updateFilter()},updateFilter:function(){(t.find(".c-product-review").not(".c-product-review_reply").closest(".c-product-reviews__review").removeClass("c-product-reviews__review_filtered"),i)&&t.find(".c-product-review:not(.c-product-review_reply):not(.c-product-review_rate_"+i+")").closest(".c-product-reviews__review").addClass("c-product-reviews__review_filtered");n.updateHidden()},updateHidden:function(){var e=t.find(".c-product-review").not(".c-product-review_reply").closest(".c-product-reviews__review");e.removeClass("c-product-reviews__review_hidden");var n=e.not(".c-product-reviews__review_filtered").slice(5);n.addClass("c-product-reviews__review_hidden"),t.toggleClass("c-product-reviews_has-hidden",n.length>0)},updateInfo:function(){e.ajax({url:""}).then(function(n){t.find(".c-product-reviews__summary-container").replaceWith(e(n).find(".c-product-reviews__summary-container").eq(0)),o(t)})},updateCount:function(){var e=t.find(".c-product-reviews__review").length;t.toggleClass("c-product-reviews_empty",0===e),t.find(".c-product-reviews__count").text(e)},setHeader:function(e){var n=t.find(".c-product-reviews__header");a||(a=n.html()),n.html(e)},resetHeader:function(){var e=t.find(".c-product-reviews__header");a&&(e.html(a),a=null,n.updateCount())}}),n.initEventListeners()}),i.ProductReviewsOverview=r.register(function(e){return e.select(".c-product-reviews-overview")},function(t,n){e.extend(n,{initEventListeners:function(){t.find(".c-product-reviews-overview__rate-button").on("click",function(){var n=e(this).data("rate");t.trigger("filter",[n]),t.addClass("c-product-reviews-overview_has-filter")}),t.find(".c-product-reviews-overview__reset-button").on("click",function(){t.trigger("reset"),t.removeClass("c-product-reviews-overview_has-filter")})}}),n.initEventListeners()}),i.FavoriteCounter=r.register(function(e){return e.select(".c-favorite-counter")},function(t,n){e.extend(n,{initEventListeners:function(){var n=C(t);e(document).on("shop_update_favorite@megashop:global",function(){var e=N.count();n.changeCount(e)})}}),n.initEventListeners()}),i.RecentlyViewedCounter=r.register(function(e){return e.select(".c-recently-viewed-counter")},function(t,n){e.extend(n,{initEventListeners:function(){var n=C(t);e(document).on("shop_update_recently@megashop:global",function(){var e=H.count();n.changeCount(e)})}}),n.initEventListeners()}),i.CompareCounter=r.register(function(e){return e.select(".c-compare-counter")},function(t,n){e.extend(n,{initEventListeners:function(){var n=C(t);e(document).on("shop_update_compare@megashop:global",function(){var e=$.count();n.changeCount(e)})}}),n.initEventListeners()}),i.CartCounter=r.register(function(e){return e.select(".c-cart-counter")},function(t,n){e.extend(n,{initEventListeners:function(){var n=C(t);e(document).on("shop_cart_add@megashop:global",function(e,t){"ok"===t.status&&n.changeCount(t.data.count)}),e(document).on("shop_cart_update@megashop:global",function(e,t){n.changeCount(t.data.count)}),e(document).on("shop_cart_delete@megashop:global",function(e,t){n.changeCount(t.data.count)}),e(document).on("shop_cart_clear@megashop:global",function(){n.changeCount(0)})}}),n.initEventListeners()}),i.CompareLink=r.register(function(e){return e.select(".c-compare-link")},function(t,i){var a=function(e){t.attr("href",e)};e.extend(i,{initEventListeners:function(){e(document).on("shop_update_compare@megashop:global",function(){var e=n.shop.c
1ompare_id_url.replace("{$id}",$.list().join(","));a(e)})}}),"ids"===n.shop.compare_url_variant&&i.initEventListeners()}),i.HeaderBottomBarAltSearch=r.register(function(e){return e.select(".c-header-bottom-bar-alt-search")},function(t,i){var a={autocomplete:t.data("autocomplete"),initAutocomplete:function(){a.autocomplete&&t.find(".c-header-bottom-bar-alt-search__input").searchAutocomplete({source:function(t,i){e.ajax({url:n.shop.search_url,data:{query:t.term,json:"1"},dataType:"json"}).then(function(e){e.products.forEach(function(e){e.label=e.name}),i(e.products.slice(0,5))})},select:function(e,t){e.preventDefault(),window.location=t.item.url}})}};e.extend(i,{initEventListeners:function(){t.find(".c-header-bottom-bar-alt-search__button").on("click",function(e){t.hasClass("c-header-bottom-bar-alt-search_open")?t.find(".searchpro__field-button").trigger("click"):(e.preventDefault(),t.addClass("c-header-bottom-bar-alt-search_open"),t.runCssAnimation("c-header-bottom-bar-alt-search_open-animation"),setTimeout(function(){t.find(".c-header-bottom-bar-alt-search__input").trigger("focus")},200))}),t.cssAnimation("c-header-bottom-bar-alt-search_animated"),t.find(".c-header-bottom-bar-alt-search__close-button").on("click",function(){t.removeClass("c-header-bottom-bar-alt-search_open"),t.runCssAnimation("c-header-bottom-bar-alt-search_close-animation")})}}),a.initAutocomplete(),i.initEventListeners()}),i.HeaderMiddleBarShopCart=r.register(function(e){return e.select(".js-searchpro__field")},function(t,i){e.extend(i,{insertData:function(){n.shop.search_query&&t.find("input.searchpro__field-input").val(n.shop.search_query);n.shop.path.length>0&&n.shop.path.forEach(function(e){var n=t.find('li.js-searchpro__field-category[data-id="'+e+'"]');if(n.length)return n.trigger("click"),!1})}}),i.insertData()}),i.HeaderMiddleBarShopCart=r.register(function(e){return e.select(".c-header-middle-bar-shop-cart")},function(t,n){e.extend(n,{initEventListeners:function(){e(document).on("shop_cart_add@megashop:global",function(e,t){"ok"===t.status&&(n.changeCount(t.data.count),n.changeTotal(t.data.total))}),e(document).on("shop_cart_update@megashop:global",function(e,t){n.changeCount(t.data.count),n.changeTotal(t.data.total)}),e(document).on("shop_cart_delete@megashop:global",function(e,t){n.changeCount(t.data.count),n.changeTotal(t.data.total)}),e(document).on("shop_cart_clear@megashop:global",function(){n.changeCount(0),n.changeTotal(0)})},changeCount:function(e){t.find(".c-cart-counter").text(e),t.toggleClass("c-header-middle-bar-shop-cart_empty",0===e)},changeTotal:function(e){t.find(".c-header-middle-bar-shop-cart__total").html(e)}}),n.initEventListeners()}),i.CatalogDropdownButton=r.register(function(e){return e.select(".c-catalog-dropdown-button")},function(t){var n={trigger_type:t.data("trigger_type"),initGlobalEventListeners:function(){e(document).on("click",n.handleDocumentClick),e(document).on("open@megashop:c-catalog-dropdown",n.handleOpenDropdown),e(document).on("close@megashop:c-catalog-dropdown",n.handleCloseDropdown)},destroyGlobalEventListeners:function(){e(document).off("click",n.handleDocumentClick),e(document).off("open@megashop:c-catalog-dropdown",n.handleOpenDropdown),e(document).off("close@megashop:c-catalog-dropdown",n.handleCloseDropdown)},initEventListeners:function(){var i=e(".l-header__dropdown-bar").find(".c-catalog-dropdown");"click"===n.trigger_type?t.on("click",function(){i.each(function(){var t=B(e(this));t.isOpen()?t.close(!0):t.open()})}):"hover"===n.trigger_type&&(t.on("mouseenter",function(){i.each(function(){B(e(this)).open()})}),t.on("mouseleave",function(){i.each(function(){B(e(this)).leave()})}))},handleDocumentClick:function(n){0===e(n.target).closest(t).length&&e(".l-header__dropdown-bar").find(".c-catalog-dropdown").each(function(){B(e(this)).close()})},handleOpenDropdown:function(){t.addClass("c-button_active")},handleCloseDropdown:function(){t.removeClass("c-button_active")}};return n.initEventListeners(),n.initGlobalEventListeners(),function(){n.destroyGlobalEventListeners()}}),i.CatalogDropdown=r.register(function(e){return e.select(".c-catalog-dropdown")},function(t,i){var a={trigger_type:t.data("trigger_type"),leave_timeout_id:null,force_closing:!1,initEventListeners:function(){t.on("click",function(e){e.stopPropagation()}),t.on("mouseenter",function(){i.open()}),"click"!==a.trigger_type&&"4"!=n.commons.header_variant&&t.on("mouseleave",function(){i.leave()}),t.onAnimationEnd(function(){t.removeClass("c-catalog-dropdown_animated"),a.force_closing=!1})},initOffsets:function(){var i=t.find(".c-catalog-extend__list-container, .c-catalog-tree_fixed-width");i.length>0&&i.each(function(){var i,a=e(this),o=a.outerWidth();t.closest(".c-header-floating__dropdown").length>0?i=e(".c-header-floating__search").offset().left-e(".c-header-floating__inner").offset().left:t.parent().hasClass("c-header-dropdown-bar__container")&&"4"==n.commons.header_variant&&(i=e(".c-header-middle-bar-shop__search-container").offset().left-e(".c-header-middle-bar__container").offset().left),a.css("margin-left",i-o)})}};e.extend(i,{isOpen:function(){return t.hasClass("c-catalog-dropdown_open")},open:function(){clearTimeout(a.leave_timeout_id),i.isOpen()||t.hasClass("c-catalog-dropdown_animated")&&a.force_closing||(t.addClass("c-catalog-dropdown_open c-catalog-dropdown_animated"),t.trigger("open@megashop:c-catalog-dropdown"),a.initOffsets())},leave:function(){clearTimeout(a.leave_timeout_id),a.leave_timeout_id=setTimeout(function(){i.close()},n.commons.catalog_onleave_timeout)},close:function(e){void 0===e&&(e=!1),clearTimeout(a.leave_timeout_id),i.isOpen()&&(a.force_closing=e,t.removeClass("c-catalog-dropdown_open"),t.addClass("c-catalog-dropdown_animated"),t.trigger("close@megashop:c-catalog-dropdown"))}}),a.initEventListeners()})),R=i.HorizontalCatalog=r.register(function(e){return e.select(".c-horizontal-catalog")},function(t,i){var a={enter_timeout_id:null,leave_timeout_id:null,initEventListeners:function(){t.on("mouseenter",function(){clearTimeout(a.leave_timeout_id),t.trigger("enter@megashop:c-horizontal-catalog")}),t.on("mouseleave",function(){i.leave()})}};e.extend(i,{isOpen:function(){return t.hasClass("c-horizontal-catalog_open")},openCategory:function(n){var a=t.find(".c-horizontal-catalog__category").filter(function(){return e(this).data("category_id")===n});0!==a.length&&(t.find(".c-horizontal-catalog__category_active").each(function(){var n=e(this);n.removeClass("c-horizontal-catalog__category_active"),t.trigger("close_category@megashop:c-horizontal-catalog",n.data("category_id"))}),a.addClass("c-horizontal-catalog__category_active"),i.open(),t.trigger("open_category@megashop:c-horizontal-catalog",n))},open:function(){clearTimeout(a.leave_timeout_id),clearTimeout(a.enter_timeout_id),i.isOpen()||(a.enter_timeout_id=setTimeout(function(){t.removeClass("c-horizontal-catalog_close"),t.offset(),t.addClass("c-horizontal-catalog_open"),t.trigger("open@megashop:c-horizontal-catalog")},n.commons.catalog_onenter_timeout))},leave:function(){clearTimeout(a.leave_timeout_id),clearTimeout(a.enter_timeout_id),i.isOpen()||i.close(!0),a.leave_timeout_id=setTimeout(function(){i.close()},n.commons.catalog_onleave_timeout)},close:function(n){n=n||!1,clearTimeout(a.leave_timeout_id),(i.isOpen()||n)&&(t.find(".c-horizontal-catalog__category_active").each(function(){var n=e(this);t.trigger("close_category@megashop:c-horizontal-catalog",n.data("category_id"))}),t.removeClass("c-horizontal-catalog_open"),t.offset(),t.addClass("c-horizontal-catalog_close"),t.trigger("close@megashop:c-horizontal-catalog"))}}),a.initEventListeners()});i.CatalogCategoryButton=r.register(function(e){return e.select(".c-catalog-category-button")},function(t){var n={showCatalog:function(t){e(".c-horizontal-catalog").each(function(){R(e(this)).openCategory(t)})},leaveCatalog:function(){e(".c-horizontal-catalog").each(function(){R(e(this)).leave()})},handleMouseEnter:function(){this.showCatalog(t.data("category_id"))},handleMouseLeave:function(){this.leaveCatalog()},initEventListeners:function(){t.on("mouseenter",this.handleMouseEnter.bind(this)),t.on("mouseleave",this.handleMouseLeave.bind(this))},initGlobalEventListeners:function(){e(document).on("open_category@megashop:c-horizontal-catalog",".c-horizontal-catalog",n.handleOpenCategory),e(document).on("close_category@megashop:c-horizontal-catalog",".c-horizontal-catalog",n.handleCloseCategory)},destroyGlobalEventListeners:function(){e(document).off("open_category@megashop:c-horizontal-catalog",".c-horizontal-catalog",n.handleOpenCategory),e(document).off("
1close_category@megashop:c-horizontal-catalog",".c-horizontal-catalog",n.handleCloseCategory)},handleOpenCategory:function(e,n){n===t.data("category_id")&&(t.addClass("c-button_active"),t.trigger("open_category@megashop:c-catalog-category-button"))},handleCloseCategory:function(e,n){n===t.data("category_id")&&(t.removeClass("c-button_active"),t.trigger("close_category@megashop:c-catalog-category-button"))}};return n.initEventListeners(),n.initGlobalEventListeners(),function(){n.destroyGlobalEventListeners()}});t.HeaderFloating=r.register(function(e){return e.select(".c-header-floating")},function(t){var n={startY:e(".l-index__header").height(),init:function(){t.toggleClass("c-header-floating_visible",window.pageYOffset>this.startY);var n=e(".c-catalog-extend_fixed-width").get(0);void 0===n&&(n=e(".c-catalog-tree_fixed-width").get(0));var i=e(n).clone();t.find(".c-header-floating__dropdown .c-catalog-dropdown").append(i),o(t.find(".c-catalog-extend")),o(t.find(".c-catalog-list"))},initGlobalEventsListeners:function(){var n=this,i=t.find(".c-header-floating__dropdown-btn");e(window).on("scroll",function(){t.toggleClass("c-header-floating_visible",window.pageYOffset>n.startY);var e=B(t.find(".c-catalog-dropdown"));e.isOpen()&&e.close(!0)}),e(document).on("click",function(n){0===e(n.target).closest(i).length&&t.find(".c-catalog-dropdown").each(function(){B(e(this)).close(),i.find(".c-burger-icon").removeClass("c-burger-icon_active")})})},initEventListeners:function(){var n=t.find(".c-header-floating__dropdown-btn"),i=t.find(".c-catalog-dropdown"),a=t.find(".c-header-dropdown-bar"),o=n.data("trigger_type");"click"===o?n.on("click",function(){i.each(function(){var t=B(e(this));t.isOpen()?(t.close(!0),n.find(".c-burger-icon").removeClass("c-burger-icon_active")):(t.open(),n.find(".c-burger-icon").addClass("c-burger-icon_active"))})}):"hover"===o&&n.on("mouseenter",function(){i.each(function(){B(e(this)).open()})}),a.on("mouseleave",function(){i.each(function(){B(e(this)).leave(),n.find(".c-burger-icon").removeClass("c-burger-icon_active")})})}};_.isDesktopMin()&&(n.init(),n.initGlobalEventsListeners(),n.initEventListeners())});i.InputSearch=r.register(function(e){return e.select(".c-input-search")},function(t){var i={autocomplete:t.data("autocomplete"),initAutocomplete:function(){i.autocomplete&&t.find(".c-input-search__input").searchAutocomplete({source:function(t,i){e.ajax({url:n.shop.search_url,data:{query:t.term,json:"1"},dataType:"json"}).then(function(e){e.products.forEach(function(e){e.label=e.name}),i(e.products.slice(0,5))})},select:function(e,t){e.preventDefault(),window.location=t.item.url},appendTo:e(".l-header")})}};i.initAutocomplete()}),i.CartPopup=r.register(function(e){return e.select(".c-cart-popup")},function(t,i){var a=function(){t.find(".c-cart-popup__items-container").get(0)},r=function(){t.on("delete",".c-cart-popup-item",function(){i.refresh()}),t.find(".c-cart-popup__close").on("click",function(){t.trigger("close")})};e.extend(i,{refresh:function(){e.ajax({url:n.shop.cart_url+"?popup=1"}).then(function(n){var i=e(n),a=i.find(".c-cart-popup").add(i.filter(".c-cart-popup"));t.replaceWith(a),o(a.parent())})}}),a(),r()}),i.CartPopupItem=r.register(function(e){return e.select(".c-cart-popup-item")},function(e){var t={item_id:e.data("item_id"),initEventListeners:function(){e.find(".c-cart-popup-item__delete-button").on("click",function(){k.deleteItem(t.item_id).then(function(){e.trigger("delete")})})}};t.initEventListeners()}),i.CartPopupContainer=r.register(function(e){return e.select(".c-cart-popup-container")},function(t,i){var a={loaded:!1,isOpen:function(){return t.hasClass("c-cart-popup-container_open")},initEventListeners:function(){var o=null,r=null;t.on("mouseenter",function(){clearTimeout(o),clearTimeout(r),a.loaded||(r=setTimeout(function(){i.load().then(function(){clearTimeout(o),clearTimeout(r),i.open()})},n.commons.cart_onenter_timeout))}),t.on("mouseleave",function(){clearTimeout(o),clearTimeout(r),o=setTimeout(function(){i.close()},n.commons.cart_onleave_timeout)}),t.on("close",".c-cart-popup",function(){i.close()}),e(document).on("click",a.handleDocumentClick)},handleDocumentClick:function(n){0===e(n.target).closest(t).length&&i.close()}};
1e.extend(i,{destruct:function(){e(document).off("click",a.handleDocumentClick)},load:function(){a.loaded=!0;var i=e.ajax({url:n.shop.cart_url+"?popup=1"});return i.then(function(n){var i=e(n).select(".c-cart-popup");t.find(".c-cart-popup-container__popup").html(i),o(t)}),i},open:function(){t.removeClass("c-cart-popup-container_close"),t.offset(),t.addClass("c-cart-popup-container_open")},close:function(){a.loaded=!1,t.removeClass("c-cart-popup-container_open"),t.offset(),t.addClass("c-cart-popup-container_close")}}),a.initEventListeners()}),i.BrandReviewsContainer=r.register(function(e){return e.select(".c-brand-reviews-container")},function(t){(function(){t.find(".c-brand-reviews-container__review-button").on("click",function(){c.openContent(e(i.brand_review_form))})})()}),i.BrandReviewForm=r.register(function(e){return e.select(".c-brand-review-form")},function(e){(function(){e.on("success@megashop:c-ajax-form",function(e,t){if("ok"===t.status)c.close(),f.showMessage(t.data.msg);else{var n=Object.keys(t.errors).map(function(e){return t.errors[e]}).join(" ");alert(n)}})})()}),i.BrandReviews=r.register(function(e){return e.select(".c-brand-reviews")},function(e){(function(){e.find(".c-brand-reviews__more-button").on("click",function(){e.addClass("c-brand-reviews_show-all")})})()}),i.Buy1stepDecorator=r.register(function(e){return e.select(".c-buy1step-decorator")},function(t,n){var a={getForm:function(){return window.shop_buy1step_jquery(t.find(".buy1step-form").get(0)).data("buy1step")},getContactinfoStep:function(){return window.shop_buy1step_jquery(t.find(".buy1step-step_contactinfo").get(0)).data("buy1step")},patchContactinfoStep:function(){var e=this.getContactinfoStep();if(e){if(!e.suggestions.dadata)return;var n=e.suggestions.dadata.setCity;e.suggestions.dadata.setCity=function(){n.apply(e,arguments),t.find('select[name$="[address.shipping][region]"]').trigger("refresh")}.bind(e)}},patchForm:function(){var e=a.getForm();if(e){var n=e.renderInfoBlock;e.renderInfoBlock=function(){n.apply(e,arguments),a.decorateInfoBlock(),a.decorateInfoWrapper()}.bind(e);var i=e.renderSteps;e.renderSteps=function(){i.apply(e,arguments),a.decorateInfoWrapper()}.bind(e),new MutationObserver(function(){_.isTabletMax()&&e.sticky.refresh()}).observe(t.find(".buy1step-form__steps-box").get(0),{childList:!0,attributes:!0,subtree:!0})}},decorateBlock:function(){var n=e('<div class="c-block"></div>'),i=e('<div class="c-block__header"></div>'),a=e('<div class="c-block__content"></div>');n.append(i),n.append(a),i.append(t.find(".buy1step-page__header_h1")),a.append(t.find(".buy1step-page").contents()),n.appendTo(t.find(".buy1step-page"))},decorateHeaders:function(){t.find(".buy1step-page__header_h1").replaceWith(e(i.buy1step_checkout_page_header_html)),t.find(".buy1step-page__header_h2").addClass("c-header c-header_h1"),t.find(".buy1step-heading").removeClass("buy1step-heading").addClass("c-header c-header_h2")},decorateComment:function(){t.find(".buy1step-step_comment .buy1step-comment-field__textarea").addClass("c-textarea c-textarea_fill").attr("placeholder","Комментарий")},decorateInfoBlock:function(){t.find(".buy1step-form__step .buy1step-submit-button").attr("class","").addClass("c-button c-button_size_l c-button_wide");var e=t.find(".buy1step-info");e.find(".buy1step-heading").removeClass("buy1step-heading").addClass("c-header c-header_h2"),e.find(".buy1step-info__policy-box").addClass("c-link-decorator"),e.find(".buy1step-items-list__show-hidden-button, .buy1step-items-list__hide-hidden-button").wrapInner('<span class="c-pseudo-link"></span>'),e.find(".buy1step-submit-button").attr("class","").addClass("c-button c-button_size_l c-button_fill")},decorateInfoWrapper:function(){if(_.isTabletMax()){var e=a.getForm();t.find(".c-checkout-confirmation__buy1step-info-wrapper").length&&t.find(".c-checkout-confirmation__buy1step-info-wrapper").remove();var n=t.find(".buy1step-info").clone();if(n.length>0)n.find(".buy1step-info__submit-box, .buy1step-info__policy-box").remove(),n.addClass("c-checkout-confirmation__buy1step-info-wrapper"),t.find(".c-checkout-confirmation__comment-container").after(n.first());e&&e.sticky.sticky&&e.sticky.sticky.destroy()}}};e.extend(n,{decorate:function(){a.decorateBlock(),a.decorateHeaders(),a.decorateComment(),a.decorateInfoBlock(),a.decorateInfoWrapper()}}),n.decorate(),e(function(){setTimeout(function(){a.patchForm(),a.patchContactinfoStep()})}),t.addClass("c-buy1step-decorator_js-is-init")});i.FooterCurrencySelect=r.register(function(e){return e.select(".c-footer-currency-select")},function(t){var i={initEventListeners:function(){t.on("change",function(){e.ajax({url:n.shop.home_url+"?currency="+i.getValue(),crossDomain:!0}).then(function(){window.location.reload()})})},getValue:function(){return t.val()}};i.initEventListeners()});var O=i.CatalogExtend=r.register(function(e){return e.select(".c-catalog-extend")},function(t,n){var i={initEventListeners:function(){t.on("open_category@megashop:c-catalog-list",".c-catalog-list",function(e,t){i.openCategory(t)}),t.on("close@megashop:c-catalog-list",".c-catalog-list",function(){n.close()});
1var a=t.find(".c-catalog-extend__columns-container");a.on("mouseenter",function(){var n=e(this).find(".c-catalog-extend__columns_active").data("category_id");t.find(".c-catalog-list").each(function(){G(e(this)).openCategory(n)})}),a.on("mouseleave",function(){t.find(".c-catalog-list").each(function(){G(e(this)).leave()})}),t.onAnimationEnd(".c-catalog-extend__columns-container",function(){t.removeClass("c-catalog-extend_animated")})},openCategory:function(i){var a=t.find(".c-catalog-extend__columns"),o=t.find(".c-catalog-extend__columns").filter(function(){return e(this).data("category_id")===i});0!==o.length?(a.removeClass("c-catalog-extend__columns_active"),n.open(),o.addClass("c-catalog-extend__columns_active")):n.close()}};e.extend(n,{isOpen:function(){return t.hasClass("c-catalog-extend_open")},open:function(){n.isOpen()||(t.addClass("c-catalog-extend_open c-catalog-extend_animated"),t.trigger("open@megashop:c-catalog-extend"))},close:function(){n.isOpen()&&(t.removeClass("c-catalog-extend_open"),t.addClass("c-catalog-extend_animated"),t.trigger("close@megashop:c-catalog-extend"))}}),i.initEventListeners()}),q=i.CatalogTree=r.register(function(e){return e.select(".c-catalog-tree")},function(t,n){var i={request_id:null,timeout_id:null,initEventListeners:function(){t.children(".c-catalog-list").on("open_category@megashop:c-catalog-list",function(){cancelAnimationFrame(i.request_id),clearTimeout(i.timeout_id),n.open()}),t.children(".c-catalog-list").on("close@megashop:c-catalog-list",function(){i.request_id=requestAnimationFrame(function(){n.close()})}),t.children(".c-catalog-list").on("close_category@megashop:c-catalog-list",function(){i.timeout_id=setTimeout(function(){n.close()},500)})}};e.extend(n,{isOpen:function(){return t.hasClass("c-catalog-tree_open")},open:function(){n.isOpen()||(t.addClass("c-catalog-tree_open"),t.trigger("open@megashop:c-catalog-tree"))},close:function(){n.isOpen()&&(t.removeClass("c-catalog-tree_open"),t.trigger("close@megashop:c-catalog-tree"))}}),i.initEventListeners()}),G=i.CatalogList=r.register(function(e){return e.select(".c-catalog-list")},function(t,i){var a={leave_timeout_id:null,initEventListeners:function(){var n=t.children(".c-catalog-list__item");n.on("mouseenter",function(){var t=e(this);i.openCategory(t.data("category_id"))}),n.on("open_category@megashop:c-catalog-list",function(e){e.stopPropagation()}),n.on("close_category@megashop:c-catalog-list",function(e){e.stopPropagation()}),n.on("close@megashop:c-catalog-list",function(e){e.stopPropagation()}),t.on("mouseleave",function(){i.leave()}),e(document).on("open@megashop:c-catalog-dropdown",".c-catalog-dropdown",function(){t.data("show_first")&&i.openCategory(t.children(".c-catalog-list__item:first-child").data("category_id"))}),n.find("> .c-catalog-list__children-container").cssAnimation("c-catalog-list__children-container_animated")}};e.extend(i,{openCategory:function(n){clearTimeout(a.leave_timeout_id);var i=t.children(".c-catalog-list__item").filter(function(){return e(this).data("category_id")===n}),o=t.find("> .c-catalog-list__item_active").not(i);(o.removeClass("c-catalog-list__item_active"),o.find("> .c-catalog-list__children-container").runCssAnimation("c-catalog-list__children-container_close-animation"),o.filter(".c-catalog-list__item_has-children").each(function(){t.trigger("close_category@megashop:c-catalog-list",e(this).data("category_id"))}),i.hasClass("c-catalog-list__item_active"))||(i.addClass("c-catalog-list__item_active"),i.hasClass("c-catalog-list__item_has-children")?(i.find("> .c-catalog-list__children-container").runCssAnimation("c-catalog-list__children-container_open-animation"),t.trigger("open_category@megashop:c-catalog-list",n)):e(".c-catalog-extend_open").removeClass("c-catalog-extend_open"))},leave:function(){clearTimeout(a.leave_timeout_id),a.leave_timeout_id=setTimeout(function(){i.close()},n.commons.catalog_onleave_timeout)},close:function(){clearTimeout(a.leave_timeout_id);var e=t.children(".c-catalog-list__item").filter(".c-catalog-list__item_active");e.removeClass("c-catalog-list__item_active"),e.find("> .c-catalog-list__children-container").runCssAnimation("c-catalog-list__children-container_
1close-animation"),t.trigger("close@megashop:c-catalog-list")}}),a.initEventListeners()}),M=i.BrandsDropdown=r.register(function(e){return e.select(".c-brands-dropdown")},function(t,i){var a={leave_timeout_id:null,initEventListeners:function(){t.on("mouseenter",function(){clearTimeout(a.leave_timeout_id)}),t.on("mouseleave",function(){i.leave()}),t.onAnimationEnd(function(){t.removeClass("c-brands-dropdown_animated")})}};e.extend(i,{isOpen:function(){return t.hasClass("c-brands-dropdown_open")},open:function(){clearTimeout(a.leave_timeout_id),i.isOpen()||(t.addClass("c-brands-dropdown_open c-brands-dropdown_animated"),t.trigger("open@megashop:c-brands-dropdown"))},leave:function(){clearTimeout(a.leave_timeout_id),a.leave_timeout_id=setTimeout(function(){i.close()},n.commons.catalog_onleave_timeout)},close:function(){clearTimeout(a.leave_timeout_id),i.isOpen()&&(t.removeClass("c-brands-dropdown_open"),t.addClass("c-brands-dropdown_animated"),t.trigger("close@megashop:c-brands-dropdown"))}}),a.initEventListeners()});i.BrandsDropdownButton=r.register(function(e){return e.select(".c-brands-dropdown-button")},function(t,n){var i={initEventListeners:function(){t.on("mouseenter",function(){e(".c-brands-dropdown").each(function(){M(e(this)).open()})}),t.on("mouseleave",function(){e(".c-brands-dropdown").each(function(){M(e(this)).leave()})})},initGlobalEventListeners:function(){e(document).on("open@megashop:c-brands-dropdown",".c-brands-dropdown",i.handleOpen),e(document).on("close@megashop:c-brands-dropdown",".c-brands-dropdown",i.handleClose)},destroyGlobalEventListeners:function(){e(document).off("open@megashop:c-brands-dropdown",".c-brands-dropdown",i.handleOpen),e(document).off("close@megashop:c-brands-dropdown",".c-brands-dropdown",i.handleClose)},handleOpen:function(){t.addClass("c-button_active"),t.trigger("open_dropdown@megashop:c-brands-dropdown-button")},handleClose:function(){t.removeClass("c-button_active"),t.trigger("close_dropdown@megashop:c-brands-dropdown-button")}};return e.extend(n,{closeDropdown:function(){e(".c-brands-dropdown").each(function(){M(e(this)).close()})}}),i.initEventListeners(),i.initGlobalEventListeners(),function(){i.destroyGlobalEventListeners()}}),i.SidebarCatalog=r.register(function(e){return e.select(".c-sidebar-catalog")},function(t,n){var i=function(){t.on("open@megashop:c-catalog-extend",".c-catalog-extend",function(){n.open()}),t.on("close@megashop:c-catalog-extend",".c-catalog-extend",function(){n.close()}),t.on("open@megashop:c-catalog-tree",".c-catalog-tree",function(){n.open()}),t.on("close@megashop:c-catalog-tree",".c-catalog-tree",function(){n.close()}),t.cssAnimation("c-sidebar-catalog_animated")},a=function(){return t.hasClass("c-sidebar-catalog_open")};e.extend(n,{open:function(){a()||(t.addClass("c-sidebar-catalog_open"),t.offset(),t.trigger("open@megashop:c-sidebar-catalog"))},close:function(){a()&&(t.find(".c-catalog-extend").each(function(){O(e(this)).close()}),t.find(".c-catalog-tree").each(function(){q(e(this)).close()}),t.removeClass("c-sidebar-catalog_open"),t.runCssAnimation("c-sidebar-catalog_close-animation"),t.trigger("close@megashop:c-sidebar-catalog"))}}),i()});e.widget("custom.searchAutocomplete",e.ui.autocomplete,{_renderItem:function(t,n){var i=e('<div class="c-input-search-item__image-container"></div>');i.append(n.image);var a=e('<div class="c-input-search-item__name-container"></div>');a.append(n.name);var o=e('<div class="c-input-search-item__price-container"></div>');o.append(n.price);var r=e('<div class="c-input-search-item__info-container"></div>');r.append(a),r.append(o);var c=e('<div class="c-input-search-item"></div>');return c.append(i),c.append(r),e("<li>").append(c).appendTo(t)}});var N=h("shop_favorite",function(t){e(document).trigger("shop_update_favorite@megashop:global",t)}),$=h("shop_compare",function(t){e(document).trigger("shop_update_compare@megashop:global",t)}),H=t.RecentlySet=h("shop_recently",function(t){e(document).trigger("shop_update_recently@megashop:global",t)});t.RecentlySet.touch=function(e){this.has(e)&&this.remove(e);var t=this.list();t.unshift(e),t=t.slice(0,50),this.store(t)},t.ResponsiveFilterAdapter=r.register(function(e){return e.select(".r-filters")},function(t,n){var i=t.find(".js-r-filters__toggle"),a=e(".c-filters__form"),o=e(".c-sidebar-filters"),r=e("body"),c=e(".c-sidebar-filters__header");e.extend(n,{initEventListeners:function(){i.on("click",function(e){e.preventDefault(),o.hasClass("c-sidebar-filters_opened")?n.close():n.open()}),c.on("click",function(){n.close()}),e(document).on("filters_header@megashop:global",function(){n.close()})},getFilterActiveParams:function(){return a.serializeArray()},open:function(){r.addClass("r-popup-opened"),o.addClass("c-sidebar-filters_opened")},close:function(){r.removeClass("r-popup-opened"),o.removeClass("c-sidebar-filters_opened")}}),g.lock(o.find(".c-filters__filters")),n.initEventListeners()}),i.ArrivedDecorator=r.register(function(e){return e.select(".c-arrived-decorator")},function(i){var a=function(){i.find(".plugin_arrived-box").wrapInner('<div class="c-modal"></div>');var t=i.find(".c-modal");t.addClass("c-modal_no-hidden");var a=e('<div class="c-modal__close"><span class="l-image-box">'+n.commons.svg.cross+"</span></div>");t.prepend(a),i.find(".plugin_arrived-header").addClass("c-modal__header").find("span").addClass("c-header c-header_h3"),i.find(".plugin_arrived-body").addClass("c-modal__content")},r=function(){i.find("input:text").each(function(){var t=e(this),n=t.closest(".plugin_arrived-field").find(".plugin_arrived-name"),i=n.hasClass("required");t.addClass("c-input-text").attr("placeholder",n.text()),i&&t.addClass("c-input-text_required")})},c=function(){i.find(":submit").addClass("c-button")},s=function(){t.Select.create(i.find("select"),null,!0)},l=function(){var e=i.find('[name="terms"]');if(e.length){var n=e.closest("label"),a=e.closest(".plugin_arrived-field");n.addClass("c-arrived-decorator__terms-label"),n.appendTo(a),n.find("a").addClass("c-pseudo-link"),t.Checkbox.create(e)}};(function(){i.find("a").addClass("c-link")})(),a(),r(),c(),s(),l(),o(i)}),i.OrderPage=r.register(function(e){return e.select(".c-order-page")},function(t){var n,i,o,r={initWaOrderClass:function(t,n){var i=e.Deferred();return window.waOrder&&window.waOrder[t]?i.resolve(window.waOrder[t]):n.on("wa_order_"+t+"_ready",function(e,t){i.resolve(t)}),i},initCart:function(){return this.initWaOrderClass("cart",e("#js-order-cart"))},initEventsListeners:function(){t.find(".c-order-page__clear-button").on("click",function(){k.clear().then(function(){window.location.reload()})})},initGlobalEventsListeners:function(){e(document).on("shop_cart_add_product_effects_off@megashop:global shop_cart_add_product@megashop:global",function(){e(document).trigger("wa_order_product_added")})},initForm:function(){return this.initWaOrderClass("form",e("#js-order-checkout"))},initScope:function(){var t=e.Deferred();return r.initCart().then(function(a){n=a,i=window.waOrder.ui,r.initForm().then(function(i){[{scope:n,storage:o={}},{scope:i,storage:{}}
1].forEach(function(t){t.scope.urls&&e.each(t.scope.urls,function(e,n){var i=v.create(n).toString();t.storage[e]=i})}),t.resolve()})}),t},initXhrEventListener:function(){e(document).ajaxSuccess(function(e,t,n){var i=v.create(n.url).toString();r.handleXhrRequest(i,t)})},handleXhrRequest:function(e,t){e===o.save&&this.handleXhrCartSave(t),e===o.add&&console.log("add")},handleXhrCartSave:function(n){if(n.responseJSON&&t.data("is_enabled_refresh_shapes")){var o=t.find(".wa-products"),r=n.responseJSON.data.cart.items;e.each(r,function(e,t){if("product"===t.type){var n=t,r=o.find('.wa-product[data-id="'+e+'"]');if(r.length)r.find(".js-product-price").html(i.formatPrice(n.price)+"/"+a("item"))}})}}};r.initEventsListeners(),r.initGlobalEventsListeners(),r.initScope().then(function(){r.initXhrEventListener()})}),i.OrderDialogDecorator=r.register(function(e){return e.select(".c-order-dialog-decorator")},function(e){e.find(".wa-dialog-header").addClass("c-modal__header"),e.find(".wa-close-wrapper").addClass("c-modal__close"),e.find(".wa-header").addClass("c-header c-header_h3"),e.find("a").addClass("c-link")}),i.OrderConfirmModal=r.register(function(e){return e.select(".c-order-confirm-modal")},function(e){e.find(".wa-button").addClass("c-button"),e.find(".wa-button.blue").addClass("c-button_style_inverse")}),i.OrderProductEditModal=r.register(function(e){return e.select(".c-order-product-edit-modal")},function(i){i.find(".wa-product-description").wrapInner('<div class="c-content-decorator"></div>');var a=i.find(".wa-cart-section form"),r=e('<div class="wa-product-details"></div>').append(i.find(".wa-cart-section form").contents().not(".wa-product-image"));a.append(r),t.Label.create(i.find("label")),t.Radio.create(i.find(":radio")),t.Checkbox.create(i.find(":checkbox")),t.Select.create(i.find("select"),null,!0),i.find(".wa-button.large").addClass("c-button c-button_size_l"),i.find(".stock-critical, .stock-low, .stock-high").each(function(){e(this).find(".wa-icon").append(e(n.commons.svg.available))}),i.find(".stock-none").each(function(){e(this).find(".wa-icon").append(e(n.commons.svg.no_available))}),i.find(".wa-stock .wa-text").each(function(){var t=e('<div class="l-icon-box"><div class="l-icon-box__icon"></div><div class="l-icon-box__content"></div></div>');t.find(".l-icon-box__icon").append(e(this).find(".wa-icon")),t.find(".l-icon-box__content").append(e(this).contents()),e(this).append(t)}),o(i)}),i.ResponsiveComparePage=r.register(function(e){return e.select(".r-compare-page")},function(t){var i={product_ids:t.data("product_ids"),selected_type:t.data("selected_type"),initSwiper:function(){t.find(".r-compare-page__products-slider-container").each(function(){var n=e(this),i=e(this).data("index");n.addClass("r-compare-page__products-slider-container_swiper");var a=new Swiper(n.get(0),{init:!1,wrapperClass:"r-compare-page__products-slider",slideClass:"r-compare-page__product",spaceBetween:0,slidesPerView:1,watchSlidesVisibility:!0,watchSlidesProgress:!0,initialSlide:i,runCallbacksOnInit:!0});a.on("slideChange",function(){var n=a.slides[a.activeIndex],o=e(n).data("features");t.find(".r-compare-page__feature-value_index_"+i).each(function(){var t=e(this).data("feature_code");e(this).html(o[t])}),t.find(".r-compare-page__slider-index_index_"+i).each(function(){e(this).text(a.activeIndex+1+"/"+a.slides.length)})}),a.init(),n.trigger("init@megashop:swiper",a)})},updateFixedState:function(){var e=t.find(".r-compare-page__products-container");if(0!==e.length){var n=e.offset().top<=window.scrollY+60;t.toggleClass("r-compare-page_fixed",n)}},handleScroll:function(){i.updateFixedState()},initEventListeners:function(){t.find(".r-compare-page__mode-control").on("change",function(){t.toggleClass("r-compare-page_same",e(this).prop("checked"))}),t.on("change",".r-compare-control__type",function(e,t){i.replace(e.target.value)}),t.on("click",".r-compare-page__product-delete-button-container",function(t){var a=e(this).data("product_id");if($.remove(a),"all"===i.selected_type)i.replace("");else{var o=i.product_ids.filter(function(e){return e!==a});
1if(0===o.length)i.replace(n.shop.compare_url);else{var r=n.shop.compare_id_url.replace("{$id}",o.join(","));i.replace(r)}}}),t.on("click",".r-compare-page__delete-button",function(){i.product_ids.forEach(function(e){$.remove(e)}),i.replace(n.shop.compare_url)})},initGlobalEventListeners:function(){e(window).on("scroll",i.handleScroll)},destroyGlobalEventListeners:function(){e(window).off("scroll",i.handleScroll)},replace:function(n){t.addClass("r-compare-page_loading"),e.ajax({url:n}).then(function(i){var a=e(i).find(".r-compare-page");t.replaceWith(a),u.replaceState({},"",n),o(a.parent())},function(){t.removeClass("r-compare-page_loading")})}};return i.initGlobalEventListeners(),i.initEventListeners(),i.initSwiper(),function(){i.destroyGlobalEventListeners()}}),i.SpecpriceDecorator=r.register(function(e){return e.select(".c-page_specprice")},function(n){(function(){var i=n.find(".specprice-modal-form"),a=i.find(":checkbox");t.Checkbox.create(a),i.find(".specprice-popup-right").find('input:text, input[type="tel"], input[type="email"]').each(function(){var t=e(this),n=t.closest(".specprice-field-div");t.hasClass("required")&&(n.removeClass("required-div"),t.removeClass("required"),t.addClass("c-input-text_required"))}),i.find("#specprice-submit").closest(".text-center").removeClass("text-center")})(),o(n)}),i.SmartfiltersDecorator=r.register(function(e){return e.select(".c-smartfilters-decorator")},function(n){var i={prepareObserverUtil:function(){t.ObserverUtil.watchTag("LABEL")},handleObserveNode:function(e){var t=e.hasClass("sf-label-disabled"),n=e.closest(".c-filter");if(n.length){var i=e.closest(".c-filter__value");if(i.length){var a=n.data("megashop_shop_filter");t?a.disableValue(i):a.enableValue(i)}}},observeDisabledFilters:function(){t.ObserverUtil.observeClass("sf-label-disabled",i.handleObserveNode)},fakeObserveNode:function(){var t=e(".sf-label-disabled");t.length&&t.each(function(){i.handleObserveNode(e(this))})}};i.prepareObserverUtil(),i.observeDisabledFilters(),i.fakeObserveNode(),o(n)}),i.SizetableDecorator=r.register(function(e){return e.select(".c-page_sizetable")},function(t){var i=t.find("#size-table-button"),a=t.find("#size-table-data");if(i.length&&a.length){var r={getContent:function(){return a.html()},getModal:function(){var t=e('<div class="c-modal c-modal_sizetable"/>'),i=e('<div class="c-modal__content"/>');i.html(this.getContent()),i.appendTo(t);var a=i.find("h1");if(a.length){var o=e('<div class="c-modal__header"/>');o.append(e('<div class="c-header c-header_h3"/>').html(a.html())),o.prependTo(t),a.remove()}var r=e('<div class="c-modal__close"><span class="l-image-box">'+n.commons.svg.cross+"</span></div>");return t.prepend(r),t}};i.off("click").on("click",function(e){c.openContent(r.getModal()),e.stopImmediatePropagation(),e.preventDefault()}),o(t)}}),i.Discount4reviewDecorator=r.register(function(e){return e.select(".c-discount4review-decorator")},function(i){var a={decorateForm:function(t){t.hasClass("c-discount4review-decorator__form_js-is-init")||(t.addClass("c-discount4review-decorator__form"),e(":submit",t).addClass("c-button"),e("textarea",t).addClass("c-textarea"),e(":text",t).addClass("c-input-text").removeClass("bold"),a.decorateFormPhoto(t),a.decorateFormRating(t),t.addClass("c-discount4review-decorator__form_js-is-init"))},decorateFormPhoto:function(t){var n=e(".userpic",t);if(n.length){var i=n.parent();i.is("td")||i.addClass("c-discount4review-decorator__form-photo-box")}
1},decorateFormRating:function(t){var n=e(".review-rate",t),i=e(".input-rate",t),a=e(".rate-clear",t);if(n.length&&i.length){a.length&&a.remove(),n.hide();var r=e('<div class="c-rating-select"><div class="c-rating-select__stars-container"><span class="c-rating-select__stars"><span class="c-rating-select__star" data-text="Ужасный" data-value="1"></span><span class="c-rating-select__star" data-text="Плохой" data-value="2"></span><span class="c-rating-select__star" data-text="Обычный" data-value="3"></span><span class="c-rating-select__star" data-text="Хороший" data-value="4"></span><span class="c-rating-select__star" data-text="Отличный" data-value="5"></span></span></div><div class="c-rating-select__value-container"><span class="c-rating-select__hover-value"></span><span class="c-rating-select__active-value"></span></div></div>');i.addClass("c-rating-select__input"),r.append(i),n.after(r),o(t)}},decorateButtons:function(){i.find(".discount4review-write-review-button").addClass("c-link")},decoratePopover:function(t){if(!t.hasClass("c-discount4review-decorator__popover_js-is-init")){t.addClass("c-discount4review-decorator__popover");var i=t.find(".close"),a=e('<div class="c-modal__close"><span class="l-image-box">'+n.commons.svg.cross+"</span></div>");i.hide().after(a),a.on("click",function(){i.trigger("click")}),t.addClass("c-discount4review-decorator__popover_js-is-init")}},observePopover:function(){t.ObserverUtil.observe("webui-popover",function(e){var t=e.find("form");t.length&&(a.decorateForm(t),a.decoratePopover(e))})},decorate:function(){$element.find("a").addClass("c-link")}};a.decorateButtons(),a.observePopover(),o(i)}),e(document).on("shop_seofilter.pre_init",function(e,t){t.keep_page_number_param=!0}),e(document).ajaxSuccess(function(t,i,a){v.create(a.url).toString()===v.create(n.shop.data_regions_url).toString()&&e(document).trigger("shop:data_regions_success",arguments)}),e(document).ajaxSend(function(t,i,a){v.create(a.url).toString()===v.create(n.shop.data_regions_url).toString()&&e(document).trigger("shop:data_regions_send",arguments)}),e(document).on("shop_cart_add_product@megashop:global",function(e,t){if("ok"===t.status){var i=n.shop.add_to_cart_effect;"info_panel"===i?f.showMessage("Товар добавлен в корзину"):"modal"===i||"modal_cross"===i?c.openAjax(n.shop.cart_url+"?item_id="+t.data.item_id):"redirect"===i&&(window.location=n.shop.cart_url)}else f.showMessage(t.errors)}),e(document).on("shop_update_favorite@megashop:global",function(t,i){"add"===i.action&&e.ajax({url:n.shop.search_url+"?list=favorite&product_id="+i.value}).then(function(t){var n=e(t),i=n.find(".c-favorite-info-panel").add(n.filter(".c-favorite-info-panel"));f.open(i)})}),e(document).on("shop_update_compare@megashop:global",function(t,i){"add"===i.action&&e.ajax({url:n.shop.compare_url+"?product_id="+i.value}).then(function(t){var n=e(t).select(".c-compare-info-panel");f.open(n)})}),e(document).on("shop_cart_add@megashop:global",function(){t.Analytics.reachGoal("add_to_cart")})}(jQuery);

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.