PageSourceSearch

https://www.waportal.ru/bitrix/cache/js/s1/aspro_max/template_da0e…3d68890773a441f1cee6_v1.js?1787906919574730

js waportal.ru collected 2026-10-09 21:36:57 UTC 574,730 bytes, 9,902 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:61:"/local/modules/axi.engine/js/axi.main/script.js?1776221772771";s:6:"source";s:47:"/local/modules/axi.engine/js/axi.main/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3BX.namespace("BX.Axi.Main");
4
5BX.Axi.Main = {
6    test: (a) => {
7        console.log(a);
8    },
9    testController: () => {
10        BX.ajax.runAction('axi:engine.test.testI', {
11            data: {
12                a: 123,
13                b: 345,
14                i: 999,
15            }
16        })
17            .then(function (response) {
18                console.log(response);
19            })
20            .catch(function (response) {
21                console.error(response);
22            });
23    },
24    formController: (arFields, action = null, method = 'form.submit') => {
25        const controller = 'axi:engine.' + method;
26        return BX.ajax.runAction(controller, {
27            data: {
28                arFields,
29                action
30            }
31        });
32    },
33};
34
35/* End */
36;
37; /* Start:"a:4:{s:4:"full";s:61:"/local/modules/axi.engine/js/axi.sku/script.js?17879031292490";s:6:"source";s:46:"/local/modules/axi.engine/js/axi.sku/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
38BX.namespace("BX.Axi.Sku");
39
40BX.Axi.Sku = {
41	inCart: [],
42
43	init: function () {
44		BX.addCustomEvent('onFinalActionSKUInfo', function (eventdata) {
45			if (!eventdata) {
46				return;
47			}
48
49			BX.Axi.Sku.onChangeExt(eventdata);
50		});
51
52		console.log('BX.Axi.Sku Init');
53	},
54
55	onChangeExt: function (eventdata) {
56		const wrapper = eventdata.wrapper;
57		const obOffer = eventdata.offer;
58		const isDetail = wrapper.hasClass('product-main');
59
60		if (!isDetail) {
61			return;
62		}
63
64		BX.Axi.Sku.adjustAskForm(obOffer);
65		BX.Axi.Sku.updateCustomTabs(obOffer);
66		BX.Axi.Sku.setFakeQuantity(obOffer, wrapper);
67		BX.Axi.Sku.setH1(obOffer);
68	},
69
70	updateCustomTabs: function (obOffer) {
71		if (!obOffer.CONFIG.CUSTOM_PROPS) {
72			return;
73		}
74		obOffer.CONFIG.CUSTOM_PROPS.forEach((propCode) => {
75			if (obOffer?.CUSTOM_PROPERTIES?.[propCode]?.DISPLAY_VALUE) {
76				$(`#propcustom_${propCode}`).html(obOffer.CUSTOM_PROPERTIES[propCode].DISPLAY_VALUE);
77			} else {
78				$(`#propcustom_${propCode}`).html("");
79			}
80		});
81	},
82
83	adjustAskForm: function (obOffer) {
84		const $askOperatorBtn = $('.js-ask-form');
85		const curStore = $askOperatorBtn.data("store");
86		$askOperatorBtn.attr("data-autoload-PRODUCT_NAME", `${obOffer.NAME} (${curStore})`);
87	},
88
89	setFakeQuantity: function (obOffer, $wrapper) {
90		const $notAvailableText = $wrapper.find('.notavailable-text');
91		const $notAvailableFakeText = $wrapper.find('.notavailable-fake-text');
92		const $availableText = $wrapper.find('.available-text');
93		const totalCount = Number(obOffer['TOTAL_COUNT']);
94
95		$availableText.hide();
96		$notAvailableFakeText.hide();
97		$notAvailableText.hide();
98
99		//notAvailableText.html(`Срок готовности к отгрузке: ${obOffer["NOT_AVAILABLE_TEXT"]}`).hide();
100		if (totalCount === 0) {
101			$notAvailableText.show();
102		} else if (obOffer['IS_FAKE_QUANTITY'] === true) {
103			$notAvailableFakeText.addClass('is-active').show();
104		} else {
105			$notAvailableFakeText.removeClass('is-active');
106			$availableText.show();
107		}
108	},
109
110	setH1: function (obOffer) {
111		const text = obOffer?.PREVIEW_TEXT;
112		const parser = new DOMParser();
113		const textDom = parser.parseFromString(text, 'text/html');
114		const title = textDom.querySelector('h3 span')?.textContent;
115		if (title) {
116			setTimeout(function () {
117				const h1 = document.querySelector('h1');
118				h1.textContent = title;
119			}, 500);
120		}
121	}
122};
123
124BX.ready(function () {
125	BX.Axi.Sku.init();
126});
127
128/* End */
129;
130; /* Start:"a:4:{s:4:"full";s:65:"/local/modules/axi.engine/js/axi.basket/script.js?177622177216558";s:6:"source";s:49:"/local/modules/axi.engine/js/axi.basket/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
131BX.namespace("BX.Axi.Basket");
132
133BX.Axi.Basket = {
134	init: function () {
135		BX.Axi.Basket.setAddHandler();
136
137		console.log('BX.Axi.Basket Init');
138	},
139
140	setAddHandler: function () {
141		$(document).off("click", ".to-cart:not(.read_more), .basket_item_add");
142		$(document).on("click", ".to-cart:not(.read_more), .basket_item_add", function (e) {
143			e.preventDefault();
144			var th = $(this);
145			if (!th.hasClass("clicked")) {
146				th.addClass("clicked");
147				var val = $(this).attr("data-quantity");
148				var tmp_props = $(this).data("props"),
149					props = "",
150					part_props = "",
151					add_props = "N",
152					fill_prop = {},
153					iblockid = $(this).data("iblockid"),
154					offer = $(this).data("offers"),
155					rid = "",
156					bBannerAction = false,
157					basket_props = "",
158					item = $(this).attr("data-item"),
159					itemId = $(this).attr("data-item-id");
160
161				if (!itemId) {
162					itemId = item;
163				}
164
165				if (th.closest(".but-cell").length) {
166					if ($('.counter_block[data-item="' + item + '"]').length)
167						val = $('.counter_block[data-item="' + item + '"] input').val();
168				}
169
170				if (th.closest(".banner_buttons.with_actions").length) {
171					//banner action
172					var wrapper_btns = th.closest(".wraps_buttons");
173					item = itemId = wrapper_btns.data("id");
174					bBannerAction = true;
175				}
176
177				if (!val) val = 1;
178				if (offer != "Y") {
179					offer = "N";
180				} else {
181					basket_props = $(this).closest(".prices_tab").find(".bx_sku_props input").val();
182				}
183				if (tmp_props) {
184					props = tmp_props.split(";");
185				}
186				if ($(this).data("part_props")) {
187					part_props = $(this).data("part_props");
188				}
189				if ($(this).data("add_props")) {
190					add_props = $(this).data("add_props");
191				}
192				if ($(".rid_item").length) {
193					rid = $(".rid_item").data("rid");
194				} else if ($(this).data("rid")) {
195					rid = $(this).data("rid");
196				}
197
198				fill_prop = fillBasketPropsExt(th, "prop", th.data("bakset_div"));
199
200				fill_prop.quantity = val;
201				fill_prop.add_item = "Y";
202				fill_prop.rid = rid;
203				fill_prop.offers = offer;
204				fill_prop.iblockID = iblockid;
205				fill_prop.part_props = part_props;
206				fill_prop.add_props = add_props;
207				fill_prop.props = JSON.stringify(props);
208				fill_prop.item = itemId;
209				fill_prop.basket_props = basket_props;
210
211				var isDetail = th.closest(".product-action").length || th.closest("#headerfixed.with-product");
212				var isSku2 = th.closest(".list-offers").length;
213				var bIsService = th.closest(".buy_services_wrap").length;
214
215				if (!bIsService && (isDetail || isSku2)) {
216					var allServicesOn = [];
217					if (isSku2) {
218						allServicesOn = th
219							.closest(".product-container")
220							.find('.buy_services_wrap .services-item [name="buy_switch_services"]:checked');
221					} else {
222						allServicesOn = $(".product-container").find(
223							'.buy_services_wrap[data-parent_product="' + item + '"] .services-item [name="buy_switch_services"]:checked'
224						);
225					}
226					var servicesNeedAdd = [];
227					allServicesOn.each(function () {
228						var _this = $(this);
229						var buttonCart = _this.closest(".services-item").find(".to-cart");
230						servicesNeedAdd[buttonCart.data("item")] = {};
231						servicesNeedAdd[buttonCart.data("item")]["id"] = buttonCart.data("item");
232						servicesNeedAdd[buttonCart.data("item")]["quantity"] = buttonCart.attr("data-quantity");
233						servicesNeedAdd[buttonCart.data("item")]["iblock_id"] = buttonCart.data("iblockid");
234					});
235					servicesNeedAdd = array_values_js(servicesNeedAdd);
236					fill_prop.services = servicesNeedAdd;
237				}
238
239				var servicesWrap = $(this).closest(".buy_services_wrap");
240				if (bIsService) {
241					var parent_product = servicesWrap.attr("data-parent_product");
242					fill_prop["prop[BUY_PRODUCT_PROP]"] = parent_product;
243					fill_prop["prop[ASPRO_BUY_PRODUCT_ID]"] = parent_product;
244				}
245
246				// доработка для разделения корзины по складам
247				var store = th.data('store');
248				if (store) {
249					fill_prop["prop[STORE]"] = store;
250				}
251
252				if (bBannerAction) {
253					if (th.hasClass("added")) {
254						location.href = th.data("href");
255						return false;
256					} else {
257						th.attr("title", th.data("title2"));
258						th.toggleClass("added");
259					}
260
261					if (wrapper_btns.find(".wish_item_add").length) wrapper_btns.find(".wish_item_add").removeClass("added");
262				}
263
264				if (th.data("empty_props") == "N" /* && fill_prop.part_props != 'Y'*/) {
265					var basket_popup_html = $("#" + th.data("bakset_div")).html();
266					if (!basket_popup_html && th.closest(".item").find(".basket_props_block").length)
267						basket_popup_html = th.closest(".item").find(".basket_props_block").html();
268
269					showBasketError(basket_popup_html, BX.message("ERROR_BASKET_PROP_TITLE"), "Y", th);
270					BX.addCustomEvent("onCompleteAction", function (e) {
271						if (!e.ignoreSelf) {
272							var eventdata = {action: "loadForm", ignoreSelf: true};
273							BX.onCustomEvent("onCompleteAction", [eventdata, th[0]]);
274						}
275					});
276				} else {
277					$.ajax({
278						type: "POST",
279						url: arAsproOptions["SITE_DIR"] + "ajax/item-custom.php",
280						data: fill_prop,
281						dataType: "json",
282						success: function (data) {
283							getActualBasket(fill_prop.iblockID);
284
285							var eventdata = {action: "loadForm"};
286							BX.onCustomEvent("onCompleteAction", [eventdata, th[0]]);
287							arStatusBasketAspro = {};
288
289							if (data !== null) {
290								if ("STATUS" in data) {
291									if (data.MESSAGE_EXT === null) data.MESSAGE_EXT = "";
292									if (data.STATUS === "OK") {
293										// th.hide();
294										$(".to-cart[data-item=" + item + "]").hide();
295										$(".to-cart[data-item=" + item + "]")
296											.closest(".counter_wrapp")
297											.find(".counter_block_inner")
298											.hide();
299										$(".to-cart[data-item=" + item + "]")
300											.closest(".counter_wrapp")
301											.find(".counter_block")
302											.hide();
303										$(".to-cart[data-item=" + item + "]")
304											.parents("tr")
305											.find(".counter_block_wr .counter_block")
306											.hide();
307										$(".to-cart[data-item=" + item + "]")
308											.closest(".button_block")
309											.addClass("wide");
310										// th.parent().find('.in-cart').show();
311										$(".in-cart[data-item=" + item + "]").show();
312
313										addBasketCounter(item);
314										//$('.wish_item[data-item='+item+']').removeClass("added");
315										$(".wish_item[data-item=" + item + "]")
316											.find(".value")
317											.show();
318										$(".wish_item[data-item=" + item + "]")
319											.find(".value.added")
320											.hide();
321										$(".wish_item.to[data-item=" + item + "]").show();
322										$(".wish_item.in[data-item=" + item + "]").hide();
323
324										//js notice
325										$bDontOpenBasket = false;
326										if (typeof JNoticeSurface !== "undefined") {
327											JNoticeSurface.get().onAdd2cart([th[0]]);
328											$bDontOpenBasket = true;
329										}
330										//
331
332										if ($("#ajax_basket").length) reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y");
333
334										if ($("#basket_line .basket_fly").length) {
335											if (th.closest(".services_in_basket").length && !window.matchMedia("(max-width: 767px)").matches) {
336												basketFly("open", "SHOW"); //need for buy services in basket_fly
337											} else if (
338												th.closest(".fast_view_frame").length ||
339												window.matchMedia("(max-width: 767px)").matches ||
340												$("#basket_line .basket_fly.loaded").length
341											)
342												basketFly("open", "N");
343											else {
344												if ($bDontOpenBasket) basketFly("open", "N");
345												else basketFly("open");
346											}
347										}
348
349										//need for services on basket_page
350										if (th.closest(".services_in_basket_page").length) {
351											BX.Sale.BasketComponent.sendRequest("refreshAjax", {
352												fullRecalculation: "Y",
353												otherParams: {
354													param: "N",
355												},
356											});
357										}
358
359										if ($(".top_basket").length) {
360											basketTop($bDontOpenBasket ? "" : "open", $(".top_basket").find(".basket_hover_block"));
361										}
362
363										if (
364											$("#headerfixed .wproducts .ajax_load .btn").length &&
365											th.closest(".product-action").length &&
366											!th.closest('.js-item-analog').length &&
367											th.next(".in-cart").length
368										) {
369											var buttonHtml =
370												//'<span class="buy_block"><span class="btn btn-default btn-sm slide_offer more type_block">' +
371												'<span class="buy_block"><span class="btn btn-default btn-sm more type_block">' +
372												th.next(".in-cart").html() +
373												"</span></span>";
374											$("#headerfixed .wproducts .ajax_load .item-buttons .but-cell").html(buttonHtml);
375										}
376									} else {
377										showBasketError(BX.message(data.MESSAGE) + " <br/>" + data.MESSAGE_EXT);
378									}
379								} else {
380									showBasketError(BX.message("CATALOG_PARTIAL_BASKET_PROPERTIES_ERROR"));
381								}
382							} else {
383								// th.hide();
384								$(".to-cart[data-item=" + item + "]").hide();
385								$(".to-cart[data-item=" + item + "]")
386									.closest(".counter_wrapp")
387									.find(".counter_block_inner")
388									.hide();
389								$(".to-cart[data-item=" + item + "]")
390									.closest(".counter_wrapp")
391									.find(".counter_block")
392									.hide();
393								$(".to-cart[data-item=" + item + "]")
394									.parents("tr")
395									.find(".counter_block_wr .counter_block")
396									.hide();
397								$(".to-cart[data-item=" + item + "]")
398									.closest(".button_block")
399									.addClass("wide");
400								// th.parent().find('.in-cart').show();
401								$(".in-cart[data-item=" + item + "]").show();
402
403								addBasketCounter(item);
404								//$('.wish_item[data-item='+item+']').removeClass("added");
405								$(".wish_item[data-item=" + item + "]")
406									.find(".value")
407									.show();
408								$(".wish_item[data-item=" + item + "]")
409									.find(".value.added")
410									.hide();
411
412								if ($("#ajax_basket").length) reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y");
413
414								if ($("#basket_line .basket_fly").length) {
415									if (
416										th.closest(".fast_view_frame").length ||
417										window.matchMedia("(max-width: 767px)").matches ||
418										$("#basket_line .basket_fly.loaded").length
419									)
420										basketFly("open", "N");
421									else basketFly("open");
422								}
423							}
424						},
425					});
426				}
427			}
428		});
429	},
430};
431
432BX.ready(function () {
433	BX.Axi.Basket.init();
434});
435
436if (!funcDefined("basketActions")) {
437	function basketActions() {
438		if (arAsproOptions["PAGES"]["BASKET_PAGE"]) {
439			checkMinPrice();
440
441			//remove4Cart
442			if (typeof BX.Sale !== "undefined" && typeof BX.Sale === "object") {
443				if (typeof BX.Sale.BasketComponent !== "undefined" && typeof BX.Sale.BasketComponent === "object") {
444					$(document).on("click", ".basket-item-actions-remove", function () {
445						var basketID = $(this).closest(".basket-items-list-item-container").data("id");
446						if (BX.Sale.BasketComponent.items && BX.Sale.BasketComponent.items[basketID]) {
447							delFromBasketCounter(BX.Sale.BasketComponent.items[basketID].PRODUCT_ID);
448						}
449					});
450				}
451			}
452
453			if (location.hash) {
454				var hash = location.hash.substring(1);
455				if ($("#basket_toolbar_button_" + hash).length) $("#basket_toolbar_button_" + hash).trigger("click");
456
457				if ($('.basket-items-list-header-filter a[data-filter="' + hash + '"]').length)
458					$('.basket-items-list-header-filter a[data-filter="' + hash + '"]')[0].click();
459			}
460			var svg_cross =
461				'<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path id="Rounded_Rectangle_568_copy_13" data-name="Rounded Rectangle 568 copy 13" class="cls-1" d="M1615.4,589l2.32,2.315a0.987,0.987,0,0,1,0,1.4,1,1,0,0,1-1.41,0L1614,590.4l-2.31,2.315a1,1,0,0,1-1.41,0,0.987,0.987,0,0,1,0-1.4L1612.6,589l-2.32-2.314a0.989,0.989,0,0,1,0-1.4,1,1,0,0,1,1.41,0l2.31,2.315,2.31-2.315a1,1,0,0,1,1.41,0,0.989,0.989,0,0,1,0,1.4Z" transform="translate(-1610 -585)"/></svg>';
462
463			$(".bx_sort_container").append(
464				'<div class="top_control basket_action"><span style="opacity:0;
464" class="delete_all colored_theme_hover_text remove_all_basket">' +
465				svg_cross +
466				BX.message("BASKET_CLEAR_ALL_BUTTON") +
467				"</span></div>"
468			);
469			if ($(".basket-items-list-header-filter").length) {
470				var $storeWrappers = $('.basket-items-list-wrapper');
471				$storeWrappers.each(function (i, storeBlock) {
472					var store = storeBlock.dataset['store'];
473					$(storeBlock).find(".basket-items-list-header-filter").append(
474						'<div class="top_control basket_action"><span style="opacity:1;" class="delete_all colored_theme_hover_text remove_all_basket" data-store="' + store + '">' +
475						svg_cross +
476						BX.message("BASKET_CLEAR_ALL_BUTTON") +
477						"</span></div>"
478					);
479				});
480
481				var cur_index = $(".basket-items-list-header-filter > a.active").index();
482				//fix delayed
483				if (cur_index == 3) cur_index = 2;
484
485				if ($(".basket-items-list-header-filter > a.active").data("filter") == "all") cur_index = "all";
486
487				$(".basket-items-list-header-filter .top_control .delete_all").data("type", cur_index);
488
489				$(".basket-items-list-header-filter > a").on("click", function () {
490					var index = $(this).index();
491
492					//fix delayed
493					if (index == 3) index = 2;
494
495					if ($(this).data("filter") == "all") index = "all";
496
497					$(".basket-items-list-header-filter .top_control .delete_all").data("type", index);
498				});
499			} else {
500				var cur_index = $(".bx_sort_container a.current").index();
501				$(".bx_sort_container .top_control .delete_all").data("type", cur_index);
502				if ($(".bx_ordercart > div:eq(" + cur_index + ") table tbody tr td.item").length)
503					$(".bx_sort_container .top_control .delete_all").css("opacity", 1);
504
505				$(".bx_ordercart .bx_ordercart_coupon #coupon").wrap('<div class="input"></div>');
506
507				$(".bx_sort_container > a").on("click", function () {
508					var index = $(this).index();
509					$(".bx_sort_container .top_control .delete_all").data("type", index);
510
511					if ($(".bx_ordercart > div:eq(" + index + ") table tbody tr td.item").length)
512						$(".bx_sort_container .top_control .delete_all").css("opacity", 1);
513					else $(".bx_sort_container .top_control .delete_all").css("opacity", 0);
514				});
515			}
516
517			$(".basket_print").on("click", function () {
518				// window.open(location.pathname+"?print=Y",'_blank');
519				window.print();
520			});
521
522			$(document).on("click", ".delete_all", function () {
523				var store = $(this).data("store");
524				if (!store) {
525					console.log('store missed');
526					return;
527				}
528
529				if (arAsproOptions["COUNTERS"]["USE_BASKET_GOALS"] !== "N") {
530				  var eventdata = { goal: "goal_basket_store_clear", params: { type: $(this).data("store") } };
531				  BX.onCustomEvent("onCounterGoals", [eventdata]);
532				}
533				$.post(
534				  arAsproOptions["SITE_DIR"] + "ajax/action_basket-custom.php",
535				  "&MODE=CLEAR_BASKET_STORE&STORE=" + store,
536				  $.proxy(function (data) {
537				    location.reload();
538				  })
539				);
540			});
541
542			$(".bx_item_list_section .bx_catalog_item").sliceHeight({ row: ".bx_item_list_slide", item: ".bx_catalog_item" });
543
544			BX.addCustomEvent("onAjaxSuccess", function (e) {
545				checkMinPrice();
546
547				var errorText = $.trim($("#warning_message").text());
548				$("#basket_items_list .error_text").detach();
549				if (errorText != "") {
550					$("#warning_message").hide().text("");
551					$("#basket_items_list").prepend('<div class="error_text">' + errorText + "</div>");
552				}
553
554				if (typeof e === "object" && e && "BASKET_DATA" in e) {
555					if ($("#ajax_basket").length) {
556						reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y");
557					}
558					if ($("#basket_line .basket_fly").length) {
559						basketFly("open", "N");
560					}
561				}
562				if (checkCounters("google")) {
563					BX.unbindAll(
564						BX.Sale.BasketComponent.getEntity(
565							BX.Sale.BasketComponent.getCacheNode(BX.Sale.BasketComponent.ids.basketRoot),
566							"basket-checkout-button"
567						)
568					);
569				}
570			});
571			if (checkCounters("google")) {
572				BX.unbindAll(
573					BX.Sale.BasketComponent.getEntity(
574						BX.Sale.BasketComponent.getCacheNode(BX.Sale.BasketComponent.ids.basketRoot),
575						"basket-checkout-button"
576					)
577				);
578			}
579			$(document).on(
580				"click",
581				".bx_ordercart_order_pay_center .checkout, .basket-checkout-section-inner .basket-btn-checkout",
582				function () {
583					if (checkCounters("google")) {
584						var gotoOrder = function () {
585							BX.Sale.BasketComponent.checkOutAction();
586						};
587						checkoutCounter(1, "start order", gotoOrder);
588					}
589				}
590			);
591		}
592	};
593}
594/* End */
595;
596; /* Start:"a:4:{s:4:"full";s:70:"/local/modules/axi.engine/js/axi.autocomplete/script.js?17762217725293";s:6:"source";s:55:"/local/modules/axi.engine/js/axi.autocomplete/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
597function autocomplete(inp, arr) {
598	/*функция автозаполнения принимает два аргумента,
599	  элемент текстового поля и массив возможных значений автозаполнения:*/
600	var currentFocus;
601	/*выполните функцию, когда кто-то пишет в текстовом поле:*/
602	inp.addEventListener("input", function(e) {
603		var a, b, i, val = this.value;
604		/*закройте все уже открытые списки значений автозаполнения*/
605		closeAllLists();
606		if (!val) { return false;}
607		currentFocus = -1;
608		/*создайте элемент DIV, который будет содержать элементы (значения):*/
609		a = document.createElement("DIV");
610		a.setAttribute("id", this.id + "autocomplete-list");
611		a.setAttribute("class", "autocomplete-items");
612		/*добавьте элемент DIV в качестве дочернего элемента контейнера автозаполнения:*/
613		this.parentNode.appendChild(a);
614		/*для каждого элемента массива...*/
615		for (i = 0; i < arr.length; i++) {
616			/*проверьте, начинается ли элемент с тех же букв, что и значение текстового поля:*/
617			if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
618				/*создайте элемент DIV для каждого соответствующего элемента:*/
619				b = document.createElement("DIV");
620				/*сделайте соответствующие буквы жирными:*/
621				b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
622				b.innerHTML += arr[i].substr(val.length);
623				/*вставьте поле ввода, которое будет содержать значение текущего элемента массива:*/
624				b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
625				/*выполните функцию, когда кто-то нажимает на значение элемента (DIV элемент):*/
626				b.addEventListener("click", function(e) {
627					/*вставьте значение для текстового поля автозаполнения:*/
628					inp.value = this.getElementsByTagName("input")[0].value;
629					/*закройте список значений автозаполнения,
630					(или любые другие открытые списки значений автозаполнения:*/
631					closeAllLists();
632				});
633				a.appendChild(b);
634			}
635		}
636	});
637	/*выполнение функции нажатие клавиши на клавиатуре:*/
638	inp.addEventListener("keydown", function(e) {
639		var x = document.getElementById(this.id + "autocomplete-list");
640		if (x) x = x.getElementsByTagName("div");
641		if (e.keyCode == 40) {
642			/*Если нажата клавиша со стрелкой вниз,
643			  увеличьте текущую переменную фокуса:*/
644			currentFocus++;
645			/*и сделать текущий элемент более заметным:*/
646			addActive(x);
647		} else if (e.keyCode == 38) { //вверх
648			/*Если нажата клавиша со стрелкой вверх,
649			  уменьшите текущую переменную фокуса:*/
650			currentFocus--;
651			/*и сделать текущий элемент более заметным:*/
652			addActive(x);
653		} else if (e.keyCode == 13) {
654			/*Если нажата клавиша ENTER, не допускайте отправки формы,*/
655			e.preventDefault();
656			if (currentFocus > -1) {
657				/*и имитировать щелчок по "активному" пункту:*/
658				if (x) x[currentFocus].click();
659			}
660		}
661	});
662	function addActive(x) {
663		/*функция для классификации элемента как " активного":*/
664		if (!x) return false;
665		/*начните с удаления "активного" класса на всех элементах:*/
666		removeActive(x);
667		if (currentFocus >= x.length) currentFocus = 0;
668		if (currentFocus < 0) currentFocus = (x.length - 1);
669		/*добавить класс "autocomplete-active":*/
670		x[currentFocus].classList.add("autocomplete-active");
671	}
672	function removeActive(x) {
673		/*функция для удаления класса "active" из всех элементов автозаполнения:*/
674		for (var i = 0; i < x.length; i++) {
675			x[i].classList.remove("autocomplete-active");
676		}
677	}
678	function closeAllLists(elmnt) {
679		/*закройте все списки автозаполнения в документе,
680		за исключением того, что было передано в качестве аргумента:*/
681		var x = document.getElementsByClassName("autocomplete-items");
682		for (var i = 0; i < x.length; i++) {
683			if (elmnt != x[i] && elmnt != inp) {
684				x[i].parentNode.removeChild(x[i]);
685			}
686		}
687	}
688	/*выполните функцию, когда кто-то щелкает в документе:*/
689	document.addEventListener("click", function (e) {
690		closeAllLists(e.target);
691	});
692}
693/* End */
694;
695; /* Start:"a:4:{s:4:"full";s:66:"/local/modules/axi.engine/js/axi.select2/script.js?177622177273164";s:6:"source";s:50:"/local/modules/axi.engine/js/axi.select2/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
696/*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
697!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(t){var e,n,s,p,r,o,h,f,g,m,y,v,i,a,_,s=((u=t&&t.fn&&t.fn.select2&&t.fn.select2.amd?t.fn.select2.amd:u)&&u.requirejs||(u?n=u:u={},g={},m={},y={},v={},i=Object.prototype.hasOwnProperty,a=[].slice,_=/\.js$/,h=function(e,t){var n,s,i=c(e),r=i[0],t=t[1];return e=i[1],r&&(n=x(r=l(r,t))),r?e=n&&n.normalize?n.normalize(e,(s=t,function(e){return l(e,s)})):l(e,t):(r=(i=c(e=l(e,t)))[0],e=i[1],r&&(n=x(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},f={require:function(e){return w(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:(t=e,function(){return y&&y.config&&y.c
697onfig[t]||{}})};var t}},r=function(e,t,n,s){var i,r,o,a,l,c=[],u=typeof n,d=A(s=s||e);if("undefined"==u||"function"==u){for(t=!t.length&&n.length?["require","exports","module"]:t,a=0;a<t.length;a+=1)if("require"===(r=(o=h(t[a],d)).f))c[a]=f.require(e);else if("exports"===r)c[a]=f.exports(e),l=!0;else if("module"===r)i=c[a]=f.module(e);else if(b(g,r)||b(m,r)||b(v,r))c[a]=x(r);else{if(!o.p)throw new Error(e+" missing "+r);o.p.load(o.n,w(s,!0),function(t){return function(e){g[t]=e}}(r),{}),c[a]=g[r]}u=n?n.apply(g[e],c):void 0,e&&(i&&i.exports!==p&&i.exports!==g[e]?g[e]=i.exports:u===p&&l||(g[e]=u))}else e&&(g[e]=n)},e=n=o=function(e,t,n,s,i){if("string"==typeof e)return f[e]?f[e](t):x(h(e,A(t)).f);if(!e.splice){if((y=e).deps&&o(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=p}return t=t||function(){},"function"==typeof n&&(n=s,s=i),s?r(p,e,t,n):setTimeout(function(){r(p,e,t,n)},4),o},o.config=function(e){return o(e)},e._defined=g,(s=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),b(g,e)||b(m,e)||(m[e]=[e,t,n])}).amd={jQuery:!0},u.requirejs=e,u.require=n,u.define=s),u.define("almond",function(){}),u.define("jquery",[],function(){var e=t||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),u.define("select2/utils",["jquery"],function(r){var s={};function c(e){var t,n=e.prototype,s=[];for(t in n)"function"==typeof n[t]&&"constructor"!==t&&s.push(t);return s}s.Extend=function(e,t){var n,s={}.hasOwnProperty;function i(){this.constructor=e}for(n in t)s.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},s.Decorate=function(s,i){var e=c(i),t=c(s);function r(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=s.prototype.constructor;0<t&&(e.call(arguments,s.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=s.displayName,r.prototype=new function(){this.constructor=r};for(var n=0;n<t.length;n++){var o=t[n];r.prototype[o]=s.prototype[o]}for(var a=0;a<e.length;a++){var l=e[a];r.prototype[l]=function(e){var t=function(){};e in r.prototype&&(t=r.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}(l)}return r};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},0===(n=null==n?[]:n).length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,s=e.length;n<s;n++)e[n].apply(this,t)},s.Observable=e,s.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},s.bind=function(e,t){return function(){e.apply(t,arguments)}},s._convertData=function(e){for(var t in e){var n=t.split("-"),s=e;if(1!==n.length){for(var i=0;i<n.length;i++){var r=n[i];(r=r.substring(0,1).toLowerCase()+r.substring(1))in s||(s[r]={}),i==n.length-1&&(s[r]=e[t]),s=s[r]}delete e[t]}}return e},s.hasScroll=function(e,t){var n=r(t),s=t.style.overflowX,i=t.style.overflowY;return(s!==i||"hidden"!==i&&"visible"!==i)&&("scroll"===s||"scroll"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},s.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},s.__cache={};var n=0;return s.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null!=t||(t=e.id?"select2-data-"+e.id:"select2-data-"+(++n).toString()+"-"+s.generateChars(4),e.setAttribute("data-select2-id",t)),t},s.StoreData=function(e,t,n){e=s.GetUniqueElementId(e);
697s.__cache[e]||(s.__cache[e]={}),s.__cache[e][t]=n},s.GetData=function(e,t){var n=s.GetUniqueElementId(e);return t?s.__cache[n]&&null!=s.__cache[n][t]?s.__cache[n][t]:r(e).data(t):s.__cache[n]},s.RemoveData=function(e){var t=s.GetUniqueElementId(e);null!=s.__cache[t]&&delete s.__cache[t],e.removeAttribute("data-select2-id")},s.copyNonInternalCssClasses=function(e,t){var n=(n=e.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0===e.indexOf("select2-")}),t=(t=t.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0!==e.indexOf("select2-")}),t=n.concat(t);e.setAttribute("class",t.join(" "))},s}),u.define("select2/results",["jquery","./utils"],function(d,p){function s(e,t,n){this.$element=e,this.data=n,this.options=t,s.__super__.constructor.call(this)}return p.Extend(s,p.Observable),s.prototype.render=function(){var e=d('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},s.prototype.clear=function(){this.$results.empty()},s.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=d('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),s=this.options.get("translations").get(e.message);n.append(t(s(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},s.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},s.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var s=e.results[n],s=this.option(s);t.push(s)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},s.prototype.position=function(e,t){t.find(".select2-results").append(e)},s.prototype.sort=function(e){return this.options.get("sorter")(e)},s.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option--selectable"),t=e.filter(".select2-results__option--selected");(0<t.length?t:e).first().trigger("mouseenter"),this.ensureHighlightVisible()},s.prototype.setClasses=function(){var t=this;this.data.current(function(e){var s=e.map(function(e){return e.id.toString()});t.$results.find(".select2-results__option--selectable").each(function(){var e=d(this),t=p.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<s.indexOf(n)?(this.classList.add("select2-results__option--selected"),e.attr("aria-selected","true")):(this.classList.remove("select2-results__option--selected"),e.attr("aria-selected","false"))})})},s.prototype.showLoading=function(e){this.hideLoading();e={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},e=this.option(e);e.className+=" loading-results",this.$results.prepend(e)},s.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},s.prototype.option=function(e){var t=document.createElement("li");t.classList.add("select2-results__option"),t.classList.add("select2-results__option--selectable");var n,s={role:"option"},i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(n in(null!=e.element&&i.call(e.element,":disabled")||null==e.element&&e.disabled)&&(s["aria-disabled"]="true",t.classList.remove("select2-results__option--selectable"),t.classList.add("select2-results__option--disabled")),null==e.id&&t.classList.remove("select2-results__option--selectable"),null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(s.role="group",s["aria-label"]=e.text,t.classList.remove("select2-results__option--selectable"),t.classList.add("select2-results__option--group")),s){var r=s[n];t.setAttribute(n,r)}if(e.children){var o=d(t),a=document.createElement("strong");a.className="select2-results__group",this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],u=this.option(u);l.push(u)}i=d("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"none"});i.append(l),o.append(a),o.append(i)}else this.template(e,t);return p.StoreData(t,"data",e),t},s.prototype.bind=function(t,e){var i=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}
vendor: 4,998 bytes, line 697
697),t.on("select",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e,t=i.getHighlightedResults();0!==t.length&&(e=p.GetData(t[0],"data"),t.hasClass("select2-results__option--selected")?i.trigger("close",{}):i.trigger("select",{data:e}))}),t.on("results:previous",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t);s<=0||(e=s-1,0===t.length&&(e=0),(s=n.eq(e)).trigger("mouseenter"),t=i.$results.offset().top,n=s.offset().top,s=i.$results.scrollTop()+(n-t),0===e?i.$results.scrollTop(0):n-t<0&&i.$results.scrollTop(s))}),t.on("results:next",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t)+1;s>=n.length||((e=n.eq(s)).trigger("mouseenter"),t=i.$results.offset().top+i.$results.outerHeight(!1),n=e.offset().top+e.outerHeight(!1),e=i.$results.scrollTop()+n-t,0===s?i.$results.scrollTop(0):t<n&&i.$results.scrollTop(e))}),t.on("results:focus",function(e){e.element[0].classList.add("select2-results__option--highlighted"),e.element[0].setAttribute("aria-selected","true")}),t.on("results:message",function(e){i.displayMessage(e)}),d.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,t=0<e.deltaY&&t-e.deltaY<=0,n=e.deltaY<0&&n<=i.$results.height();t?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):n&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option--selectable",function(e){var t=d(this),n=p.GetData(this,"data");t.hasClass("select2-results__option--selected")?i.options.get("multiple")?i.trigger("unselect",{originalEvent:e,data:n}):i.trigger("close",{}):i.trigger("select",{originalEvent:e,data:n})}),this.$results.on("mouseenter",".select2-results__option--selectable",function(e){var t=p.GetData(this,"data");i.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),i.trigger("results:focus",{data:t,element:d(this)})})},s.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},s.prototype.destroy=function(){this.$results.remove()},s.prototype.ensureHighlightVisible=function(){var e,t,n,s,i=this.getHighlightedResults();0!==i.length&&(e=this.$results.find(".select2-results__option--selectable").index(i),s=this.$results.offset().top,t=i.offset().top,n=this.$results.scrollTop()+(t-s),s=t-s,n-=2*i.outerHeight(!1),e<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(n))},s.prototype.template=function(e,t){var n=this.options.get("templateResult"),s=this.options.get("escapeMarkup"),e=n(e,t);null==e?t.style.display="none":"string"==typeof e?t.innerHTML=s(e):d(t).append(e)},s}),u.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),u.define("select2/selection/base",["jquery","../utils","../keys"],function(n,s,i){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return s.Extend(r,s.Observable),r.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=s.GetData(this.$element[0],"old-tabindex")?this._tabindex=s.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},r.prototype.bind=function(e,t){var n=this,s=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",s),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","fal
697se"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},r.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},r.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&s.GetData(this,"element").select2("close")})})},r.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},r.prototype.position=function(e,t){t.find(".selection").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get("disabled")},r}),u.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,s){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var s=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",s),this.$selection.attr("aria-controls",s),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){var t,n;0!==e.length?(n=e[0],t=this.$selection.find(".select2-selection__rendered"),e=this.display(n,t),t.empty().append(e),(n=n.title||n.text)?t.attr("title",n):t.removeAttr("title")):this.clear()},i}),u.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,c){function r(e,t){r.__super__.constructor.apply(this,arguments)}return c.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var s=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){var t;n.isDisabled()||(t=i(this).parent(),t=c.GetData(t[0],"data"),n.trigger("unselect",{originalEvent:e,data:t}))}),this.$selection.on("keydown",".select2-selection__choice__remove",function(e){n.isDisabled()||e.stopPropagation()})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">&times;</span></button><span class="select2-selection__choice__display"></span></li>')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(".select2-selection__rendered").attr("id")+"-choice-",s=0;s<e.length;s++){var i=e[s],r=this.selectionContainer(),o=this.display(i,r),a=n+c.generateChars(4)+"-";
697i.id?a+=i.id:a+=c.generateChars(4),r.find(".select2-selection__choice__display").append(o).attr("id",a);var l=i.title||i.text;l&&r.attr("title",l);o=this.options.get("translations").get("removeItem"),l=r.find(".select2-selection__choice__remove");l.attr("title",o()),l.attr("aria-label",o()),l.attr("aria-describedby",a),c.StoreData(r[0],"data",i),t.push(r)}this.$selection.find(".select2-selection__rendered").append(t)}},r}),u.define("select2/selection/placeholder",[],function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();n.html(this.display(t)),n[0].classList.add("select2-selection__placeholder"),n[0].classList.remove("select2-selection__choice");t=t.title||t.text||n.text();return this.$selection.find(".select2-selection__rendered").attr("title",t),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();t=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(t)},e}),u.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,s,a){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){s._handleClear(e)}),t.on("keypress",function(e){s._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var s=a.GetData(n[0],"data"),i=this.$element.val();this.$element.val(this.placeholder.id);var r={data:s};if(this.trigger("clear",r),r.prevented)this.$element.val(i);else{for(var o=0;o<s.length;o++)if(r={data:s[o]},this.trigger("unselect",r),r.prevented)return void this.$element.val(i);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=s.DELETE&&t.which!=s.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){var n,s;e.call(this,t),this.$selection.find(".select2-selection__clear").remove(),this.$selection[0].classList.remove("select2-selection--clearable"),0<this.$selection.find(".select2-selection__placeholder").length||0===t.length||(n=this.$selection.find(".select2-selection__rendered").attr("id"),s=this.options.get("translations").get("removeAllItems"),(e=i('<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">&times;</span></button>')).attr("title",s()),e.attr("aria-label",s()),e.attr("aria-describedby",n),a.StoreData(e[0],"data",t),this.$selection.prepend(e),this.$selection[0].classList.add("select2-selection--clearable"))},e}),u.define("select2/selection/search",["jquery","../utils","../keys"],function(s,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=this.options.get("translations").get("search"),n=s('<span class="select2-search select2-search--inline"><textarea class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" ></textarea></span>');this.$searchContainer=n,this.$search=n.find("textarea"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",t());e=e.call(this);return this._transferTabIndex(),e.append(this.$searchContainer),e},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results",r=t.id+"-container";e.call(this,t,n),s.$search.attr("aria-describedby",r),t.on("open",function(){s.$search.attr("aria-controls",i),s.$search.trigger("focus")}),t.on("close",function(){s.$search.val(""),s.resizeSearch(),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.trigger("focus")}),t.on("enable",function(){s.$search.prop("disabled",!1),s._transferTabIndex()}),t.on("disable",function(){s.$search.prop("disabled",!0)}),t.on("focus",function(e){s.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){s.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){s._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){var t;
697e.stopPropagation(),s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which!==l.BACKSPACE||""!==s.$search.val()||0<(t=s.$selection.find(".select2-selection__choice").last()).length&&(t=a.GetData(t[0],"data"),s.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on("click",".select2-search--inline",function(e){s.$search.val()&&e.stopPropagation()});var t=document.documentMode,o=t&&t<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){o?s.$selection.off("input.search input.searchcheck"):s.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){var t;o&&"input"===e.type?s.$selection.off("input.search input.searchcheck"):(t=e.which)!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&s.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger("query",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="100%";""===this.$search.attr("placeholder")&&(e=.75*(this.$search.val().length+1)+"em"),this.$search.css("width",e)},e}),u.define("select2/selection/selectionCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get("selectionCssClass")||"";return-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define("select2/selection/eventRelay",["jquery"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var s=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],r=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){var n;-1!==i.indexOf(e)&&(t=t||{},n=o.Event("select2:"+e,{params:t}),s.$element.trigger(n),-1!==r.indexOf(e)&&(t.prevented=n.isDefaultPrevented()))})},e}),u.define("select2/translation",["jquery","require"],function(t,n){function s(e){this.dict=e||{}}return s.prototype.all=function(){return this.dict},s.prototype.get=function(e){return this.dict[e]},s.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},s._cache={},s.loadPath=function(e){var t;
697return e in s._cache||(t=n(e),s._cache[e]=t),new s(s._cache[e])},s}),u.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"
697c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),u.define("select2/data/base",["../utils"],function(n){function s(e,t){s.__super__.constructor.call(this)}return n.Extend(s,n.Observable),s.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},s.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},s.prototype.bind=function(e,t){},s.prototype.destroy=function(){},s.prototype.generateResultId=function(e,t){e=e.id+"-result-";return e+=n.generateChars(4),null!=t.id?e+="-"+t.id.toString():e+="-"+n.generateChars(4),e},s}),u.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),function(e){return t.item(l(e))}))},n.prototype.select=function(i){var e,r=this;if(i.selected=!0,null!=i.element&&"option"===i.element.tagName.toLowerCase())return i.element.selected=!0,void this.$element.trigger("input").trigger("change");this.$element.prop("multiple")?this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var s=i[n].id;-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger("input").trigger("change")}):(e=i.id,this.$element.val(e),this.$element.trigger("input").trigger("change"))},n.prototype.unselect=function(i){var r=this;if(this.$element.prop("multiple")){if(i.selected=!1,null!=i.element&&"option"===i.element.tagName.toLowerCase())return i.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var s=e[n].id;s!==i.id&&-1===t.indexOf(s)&&t.push(s)}r.$element.val(t),r.$element.trigger("input").trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(t,e){var n=[],s=this;this.$element.children().each(function(){var e;"option"!==this.tagName.toLowerCase()&&"optgroup"!==this.tagName.toLowerCase()||(e=l(this),e=s.item(e),null!==(e=s.matches(t,e))&&n.push(e))}),e({results:n})},n.prototype.addOptions=function(e){this.$element.append(e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);e=this._normalizeItem(e);return e.element=t,a.StoreData(t,"data",e),l(t)},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;var n=e[0];if("option"===n.tagName.toLowerCase())t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if("optgroup"===n.tagName.toLowerCase()){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var s=e.children("option"),i=[],r=0;r<s.length;r++){var o=l(s[r]),o=this.item(o);i.push(o)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),u.define("select2/data/array",["./select","../utils","jquery"],function(e,t,c){function s(e,t){this._dataToConvert=t.get("data")||[],s.__super__.constructor.call(this,e,t)}return t.Extend(s,e),s.prototype.bind=function(e,t){s.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},s.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),s.__super__.select.call(this,n)},s.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),s=n.map(function(){return t.item(c(this)).id}).get(),i=[];for(var r=0;r<e.length;r++){var o,a,l=this._normalizeItem(e[r]);0<=s.indexOf(l.id)?(o=n.filter(function(e){return function(){return c(this).val()==e.id}}(l)),a=this.item(o),a=c.extend(!0,{},l,a),a=this.option(a),o.replaceWith(a)):(a=this.option(l),l.children&&(l=this.convertToOptions(l.children),a.append(l)),i.push(a))}return i},s}),u.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,r){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return r.extend({},e,{q:e.term})},transport:function(e,t,n){e=r.ajax(e);return e.then(t),e.fail(n),e}};return r.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(t,n){var s=this;null!=this._request&&("function"==typeof this._request.abort&&this._request.abort(),this._request=null);var i=r.extend({type:"GET"},this.ajaxOptions);function e(){var e=i.transport(i,function(e){e=s.processResults(e,t);s.options.get("debug")&&window.console&&console.error&&(e&&e.results&&Array.isArray(e.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),n(e)},function(){"status"in e&&(0===e.status||"0"===e.status)||s.trigger("results:message",{message:"errorLoading"})});s._request=e}"function"==typeof i.url&&(i.url=i.url.call(this.$element,t)),"function"==typeof i.data&&(i.data=i.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),u.define("select2/data/tags",["jquery"],function(t){function e(e,t,n){var s=n.get("tags"),i=n.get("createTag");void 0!==i&&(this.createTag=i);i=n.get("insertTag");if(void 0!==i&&(this.insertTag=i),e.call(this,t,n),Array.isArray(s))for(var r=0;r<s.length;r++){var o=s[r],o=this._normalizeItem(o),o=this.option(o);this.$element.append(o)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var s=t.results,i=0;i<s.length;i++){var r=s[i],o=null!=r.children&&!e({results:r.children},!0);if((r.text||"").toUpperCase()===(c.term||"").toUpperCase()||o)return!n&&(t.data=s,void u(t))}if(n)return!0;var a,l=d.createTag(c);null!=l&&((a=d.option(l)).attr("data-select2-tag","true"),d.addOptions([a]),d.insertTag(s,l)),t.results=s,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){if(null==t.term)return null;t=t.term.trim();return""===t?null:{id:t,text:t}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||t(this).remove()})},e}),u.define("select2/data/tokenizer",["jquery"],function(c){function e(e,t,n){var s=n.get("tokenizer");void 0!==s&&(this.tokenizer=s),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var s=this;t.term=t.term||"";var i=this.tokenizer(t,this.options,function(e){var t,n=s._normalizeItem(e);s.$element.find("option").filter(function(){return c(this).val()===n.id}).length||((t=s.option(n)).attr("data-select2-tag",!0),s._removeOldTags(),s.addOptions([t])),t=n,s.trigger("select",{data:t})});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.trigger("focus")),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,s){for(var i=n.get("tokenSeparators")||[],r=t.term,o=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};o<r.length;){var l=r[o];-1!==i.indexOf(l)?(l=r.substr(0,o),null!=(l=a(c.extend({},t,{term:l})))?(s(l),r=r.substr(o+1)||"",o=0):o++):o++}return{term:r}},e}),u.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(){s._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var s=this;this._checkIfMaximumSelected(function(){e.call(s,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0<n.maximumSelectionLength&&e>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),u.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),u.define("select2/dropdown/search",["jquery"],function(r){function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("translations").get("search"),e=r('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=e,this.$search=e.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",n()),t.prepend(e),t},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){s.trigger("keypress",e),s._
vendor: 4,579 bytes, line 697
697keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){r(this).off("keyup")}),this.$search.on("keyup input",function(e){s.handleSearch(e)}),t.on("open",function(){s.$search.attr("tabindex",0),s.$search.attr("aria-controls",i),s.$search.trigger("focus"),window.setTimeout(function(){s.$search.trigger("focus")},0)}),t.on("close",function(){s.$search.attr("tabindex",-1),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.val(""),s.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||s.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(s.showSearch(e)?s.$searchContainer[0].classList.remove("select2-search--hide"):s.$searchContainer[0].classList.add("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")})},e.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger("query",{term:t})),this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),u.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,s){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,s)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),s=t.length-1;0<=s;s--){var i=t[s];this.placeholder.id===i.id&&n.splice(s,1)}return n},e}),u.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,s){this.lastParams={},e.call(this,t,n,s),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("query",function(e){s.lastParams=e,s.loading=!0}),t.on("query:append",function(e){s.lastParams=e,s.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50&&this.loadMore())},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),u.define("select2/dropdown/attachBody",["jquery","../utils"],function(u,o){function e(e,t,n){this.$dropdownParent=u(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("open",function(){s._showDropdown(),s._attachPositioningHandler(t),s._bindContainerResultHandlers(t)}),t.on("close",function(){s._hideDropdown(),s._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t[0].classList.remove("select2"),t[0].classList.add("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u("<span></span>"),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,s="scroll.
697select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id,t=this.$container.parents().filter(o.hasScroll);t.each(function(){o.StoreData(this,"select2-scroll-position",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),t.on(s,function(e){var t=o.GetData(this,"select2-scroll-position");u(this).scrollTop(t.y)}),u(window).on(s+" "+i+" "+r,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,s="resize.select2."+t.id,t="orientationchange.select2."+t.id;this.$container.parents().filter(o.hasScroll).off(n),u(window).off(n+" "+s+" "+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown[0].classList.contains("select2-dropdown--above"),n=this.$dropdown[0].classList.contains("select2-dropdown--below"),s=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=i.top,r.bottom=i.top+r.height;var o=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-o,e=l>i.bottom+o,a={left:i.left,top:r.bottom},l=this.$dropdownParent;"static"===l.css("position")&&(l=l.offsetParent());i={top:0,left:0};(u.contains(document.body,l[0])||l[0].isConnected)&&(i=l.offset()),a.top-=i.top,a.left-=i.left,t||n||(s="below"),e||!c||t?!c&&e&&t&&(s="below"):s="above",("above"==s||t&&"below"!==s)&&(a.top=r.top-i.top-o),null!=s&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+s),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+s)),this.$dropdownContainer.css(a)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),u.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,s){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,s)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,s=0;s<t.length;s++){var i=t[s];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),u.define("select2/dropdown/selectOnClose",["../utils"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("close",function(e){s._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}n=this.getHighlightedResults();n.length<1||(null!=(n=s.GetData(n[0],"data")).element&&n.element.selected||null==n.element&&n.selected||this.trigger("select",{data:n}))},e}),u.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(e){s._selectTriggered(e)}),t.on("unselect",function(e){s._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),u.define("select2/dropdown/dropdownCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get("dropdownCssClass")||"";return-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define("select2/dropdown/tagsSearchHighlight",["../utils"],function(s){function e(){}return e.prototype.highlightFirstItem=function(e){var t=this.$results.find(".select2-results__option--selectable:not(.select2-results__option--selected)");if(0<t.length){var n=t.first(),t=s.GetData(n[0],"data").element;if(t&&t.getAttribute&&"true"===t.getAttribute("data-select2-tag"))return void n.trigger("mouseenter")}e.call(this)},e}),u.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,e="Please delete "+t+" character";return 1!=t&&(e+="s"),e},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"},removeItem:function(){return"Remove item"},search:function(){return"Search"}}}),u.define("select2/defaults",["jquery","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/selectionCss","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./dropdown/dropdownCss","./dropdown/tagsSearchHighlight","./i18n/en"],function(l,r,o,a,c,u,d,p,h,f,g,t,m,y,v,_,b,$,w,x,A,D,S,E,O,C,L,T,q,I,e){function n(){this.reset()}return n.prototype.apply=function(e){var t;null==(e=l.extend(!0,{},this.defaults,e)).dataAdapter&&(null!=e.ajax?e.dataAdapter=v:null!=e.data?e.dataAdapter=y:e.dataAdapter=m,0<e.minimumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,$)),0<e.maximumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,w)),0<e.maximumSelectionLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,x)),e.tags&&(e.dataAdapter=f.Decorate(e.dataAdapter,_)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=f.Decorate(e.dataAdapter,b))),null==e.resultsAdapter&&(e.resultsAdapter=r,
vendor: 1,369 bytes, line 697
697null!=e.ajax&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,E)),null!=e.placeholder&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,S)),e.selectOnClose&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,L)),e.tags&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter&&(e.multiple?e.dropdownAdapter=A:(t=f.Decorate(A,D),e.dropdownAdapter=t),0!==e.minimumResultsForSearch&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,C)),e.closeOnSelect&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,T)),null!=e.dropdownCssClass&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,q)),e.dropdownAdapter=f.Decorate(e.dropdownAdapter,O)),null==e.selectionAdapter&&(e.multiple?e.selectionAdapter=a:e.selectionAdapter=o,null!=e.placeholder&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,c)),e.allowClear&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,u)),e.multiple&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,d)),null!=e.selectionCssClass&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,p)),e.selectionAdapter=f.Decorate(e.selectionAdapter,h)),e.language=this._resolveLanguage(e.language),e.language.push("en");for(var n=[],s=0;s<e.language.length;s++){var i=e.language[s];-1===n.indexOf(i)&&n.push(i)}return e.language=n,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u
6970000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdLanguageBase:"./i18n/",autocomplete:"off",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:f.escapeMarkup,language:{},matcher:function e(t,n){if(null==t.term||""===t.term.trim())return n;if(n.children&&0<n.children.length){for(var s=l.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&s.children.splice(i,1);return 0<s.children.length?s:e(t,s)}var r=a(n.text).toUpperCase(),o=a(t.term).toUpperCase();return-1<r.indexOf(o)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,s=this.defaults.language,i=t.prop("lang"),t=t.closest("[lang]").prop("lang"),t=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(s),this._resolveLanguage(t));return e.language=t,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(l.isEmptyObject(e))return[];if(l.isPlainObject(e))return[e];for(var t,n=Array.isArray(e)?e:[e],s=[],i=0;i<n.length;i++)s.push(n[i]),"string"==typeof n[i]&&0<n[i].indexOf("-")&&(t=n[i].split("-")[0],s.push(t));return s},n.prototype._processTranslations=function(e,t){for(var n=new g,s=0;s<e.length;s++){var i=new g,r=e[s];if("string"==typeof r)try{i=g.loadPath(r)}catch(e){try{r=this.defaults.amdLanguageBase+r,i=g.loadPath(r)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+r+'" could not be automatically loaded. A fallback will be used instead.')}}else i=l.isPlainObject(r)?new g(r):r;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[l.camelCase(e)]=t;n=f._convertData(n);l.extend(!0,this.defaults,n)},new n}),u.define("select2/options",["jquery","./defaults","./utils"],function(c,n,u){function e(e,t){this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=n.applyFromElement(this.options,t)),this.options=n.apply(this.options)}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.autocomplete&&e.prop("autocomplete")&&(this.options.autocomplete=e.prop("autocomplete")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),u.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),u.StoreData(e[0],"data",u.GetData(e[0],"select2Tags")),u.StoreData(e[0],"tags",!0)),u.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",u.GetData(e[0],"ajaxUrl")),u.StoreData(e[0],"ajax-Url",u.GetData(e[0],"ajaxUrl")));var n={};function s(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var r=e[0].attributes[i].name,o="data-";r.substr(0,o.length)==o&&(r=r.substring(o.length),o=u.GetData(e[0],r),n[r.replace(/-([a-z])/g,s)]=o)}c.fn.jquery&&"1."==c.fn.jquery.substr(0,2)&&e[0].dataset&&(n=c.extend(!0,{},e[0].dataset,n));var a,l=c.extend(!0,{},u.GetData(e[0]),n);for(a in l=u._convertData(l))-1<t.indexOf(a)||(c.isPlainObject(this.options[a])?c.extend(this.options[a],l[a]):this.options[a]=l[a]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),u.define("select2/core",["jquery","./options","./utils","./keys"],function(t,i,r,s){var o=function(e,t){null!=r.GetData(e[0],"select2")&&r.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new i(t,e),o.__super__.constructor.call(this);var n=e.attr("tabindex")||0;r.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");t=this.options.get("dataAdapter");this.dataAdapter=new t(e,this.options);n=this.render();this._placeContainer(n);t=this.options.get("selectionAdapter");this.selection=new t(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,n);t=this.options.get("dropdownAdapter");this.dropdown=new t(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,n);n=this.options.get("resultsAdapter");this.results=new n(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var s=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){s.trigger("selection:update",{data:e})}),e[0].classList.add("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),r.StoreData(e[0],"select2",this),e.data("select2",this)};return r.Extend(o,r.Observable),o.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+r.generateChars(2):r.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var s=this._resolveWidth(e,"style");return null!=s?s:this._resolveWidth(e,"element")}if("element"==t){s=e.outerWidth(!1);return s<=0?"auto":s+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;e=e.attr("style");if("string"!=typeof e)return null;for(var i=e.split(";"),r=0,o=i.length;r<o;r+=1){var a=i[r].replace(/\s/g,"").match(n);if(null!==a&&1<=a.length)return a[1]}return null},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=r.bind(this._syncAttributes,this),this._syncS=r.bind(this._syncSubtree,this),this._observer=new window.MutationObserver(function(e){t._syncA(),t._syncS(e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},o.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerSelectionEvents=function(){var n=this,s=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===s.indexOf(e)&&n.trigger(e,t)})},o.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},o.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container[0].classList.add("select2-container--open")}),this.on("close",function(){n.$container[0].classList.remove("select2-container--open")}),this.on("enable",function(){n.$container[0].classList.remove("select2-container--disabled")}),this.on("disable",function(){n.$container[0].classList.add("select2-container--disabled")}),this.on("blur",function(){n.$container[0].classList.remove("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===s.ESC||t===s.UP&&e.altKey?(n.close(e),e.preventDefault()):t===s.ENTER||t===s.TAB?(n.trigger("results:select",{}),e.preventDefault()):t===s.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===s.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===s.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===s.ENTER||t===s.SPACE||t===s.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype._isChangeMutation=function(e){var t=this;if(e.addedNodes&&0<e.addedNodes.length){for(var n=0;n<e.addedNodes.length;n++)if(e.addedNodes[n].selected)return!0}else{if(e.removedNodes&&0<e.removedNodes.length)return!0;
697if(Array.isArray(e))return e.some(function(e){return t._isChangeMutation(e)})}return!1},o.prototype._syncSubtree=function(e){var e=this._isChangeMutation(e),t=this;e&&this.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,s={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in s){var i=s[e],s={prevented:!1,name:e,args:t};if(n.call(this,i,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},o.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o.prototype.isOpen=function(){return this.$container[0].classList.contains("select2-container--open")},o.prototype.hasFocus=function(){return this.$container[0].classList.contains("select2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container[0].classList.add("select2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.');e=!(e=null==e||0===e.length?[!0]:e)[0];this.$element.prop("disabled",e)},o.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},o.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();e=e[0];Array.isArray(e)&&(e=e.map(function(e){return e.toString()})),this.$element.val(e).trigger("input").trigger("change")},o.prototype.destroy=function(){r.RemoveData(this.$container[0]),this.$container.remove(),this._observer.disconnect(),this._observer=null,this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",r.GetData(this.$element[0],"old-tabindex")),this.$element[0].classList.remove("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),r.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var e=t('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),r.StoreData(e[0],"element",this.$element),e},o}),u.define("jquery-mousewheel",["jquery"],function(e){return e}),u.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,r,t,o){var a;return null==i.fn.select2&&(a=["open","close","destroy"],i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new r(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,s)}),-1<a.indexOf(t)?this:n}),null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),r}),{define:u.define,require:u.require});function b(e,t){return i.call(e,t)}function l(e,t){var n,s,i,r,o,a,l,c,u,d,p=t&&t.split("/"),h=y.map,f=h&&h["*"]||{};if(e){for(t=(e=e.split("/")).length-1,y.nodeIdCompat&&_.test(e[t])&&(e[t]=e[t].replace(_,"")),"."===e[0].charAt(0)&&p&&(e=p.slice(0,p.length-1).concat(e)),c=0;c<e.length;
697c++)"."===(d=e[c])?(e.splice(c,1),--c):".."===d&&(0===c||1===c&&".."===e[2]||".."===e[c-1]||0<c&&(e.splice(c-1,2),c-=2));e=e.join("/")}if((p||f)&&h){for(c=(n=e.split("/")).length;0<c;--c){if(s=n.slice(0,c).join("/"),p)for(u=p.length;0<u;--u)if(i=h[p.slice(0,u).join("/")],i=i&&i[s]){r=i,o=c;break}if(r)break;!a&&f&&f[s]&&(a=f[s],l=c)}!r&&a&&(r=a,o=l),r&&(n.splice(0,o,r),e=n.join("/"))}return e}function w(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),o.apply(p,e.concat([t,n]))}}function x(e){var t;if(b(m,e)&&(t=m[e],delete m[e],v[e]=!0,r.apply(p,t)),!b(g,e)&&!b(v,e))throw new Error("No "+e);return g[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function A(e){return e?c(e):[]}var u=s.require("jquery.select2");return t.fn.select2.amd=s,u});
698/* End */
699;
700; /* Start:"a:4:{s:4:"full";s:66:"/bitrix/templates/aspro_max/vendor/js/bootstrap.js?177622177827908";s:6:"source";s:50:"/bitrix/templates/aspro_max/vendor/js/bootstrap.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
701/*!
702 * Bootstrap v3.0.0
703 *
704 * Copyright 2013 Twitter, Inc
705 * Licensed under the Apache License v2.0
706 * http://www.apache.org/licenses/LICENSE-2.0
707 *
708 * Designed and built with all the love in the world @twitter by @mdo and @fat.
709 */
710
711+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function f(){e.trigger("closed.bs.alert").remove()}var c=a(this),d=c.attr("data-target");d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));var e=a(d);b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger(b=a.Event("close.bs.alert"));if(b.isDefaultPrevented())return;e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.one(a.support.transition.end,f).emulateTransitionEnd(150):f()};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");b.prop("type")==="radio"&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f=typeof c=="object"&&c;e||d.data("bs.button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".
711item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();if(b>this.$items.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){if(this.sliding)return;return this.slide("next")},b.prototype.prev=function(){if(this.sliding)return;return this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(e.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")}));if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(j);if(j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{this.$element.trigger(j);if(j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),typeof c=="object"&&c),g=typeof c=="string"?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),typeof c=="number"?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),c.data()),g=c.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=c.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){function e(){a(b).remove(),a(c).each(function(b){var c=f(a(this));if(!c.hasClass("open"))return;c.trigger(b=a.Event("hide.bs.dropdown"));if(b.isDefaultPrevented())return;c.removeClass("open").trigger("hidden.bs.dropdown")})}function f(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}"use strict";var b=".dropdown-backdrop",c="[data-toggle=dropdown]",d=function(b){var c=a(b).on("click.bs.dropdown",this.toggle)};d.prototype.toggle=function(b){var c=a(this);if(c.is(".disabled, :disabled"))return;var d=f(c),g=d.hasClass("open");e();if(!g){"ontouchstart"in document.documentElement&&!d.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",e),d.trigger(b=a.Event("show.bs.dropdown"));if(b.isDefaultPrevented())return;d.toggleClass("open").trigger("shown.bs.dropdown"),c.focus()}return!1},d.prototype.keydown=function(b){if(!/(38|40|27)/.test(b.keyCode))return;var d=a(this);b.preventDefault(),b.stopPropagation();if(d.is(".disabled, :disabled"))return;var e=f(d),g=e.hasClass("open");if(!g||g&&b.keyCode==27)return b.which==27&&e.find(c).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",e);if(!h.length)return;var i=h.index(h.filter(":focus"));b.keyCode==38&&i>0&&i--,b.keyCode==40&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),e=c.data("dropdown");e||c.data("dropdown",e=new d(this)),typeof b=="string"&&e[b].call(c)})},a.fn.dropdown.Constructor=d,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",c,d.prototype.toggle).on("keydown.bs.dropdown.data-api",c+", [role=menu]",d.prototype.keydown)}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d);if(this.isShown||d.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show(),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});
711d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)})},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b);if(!this.isShown||b.isDefaultPrevented())return;this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]!==a.target&&!this.$element.has(a.target).length&&this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){a.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){if(a.target!==a.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!b)return;e?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),typeof c=="object"&&c);f||e.data("bs.modal",f=new b(this,g)),typeof c=="string"?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);var e=this.options.trigger.split(" ");for(var f=e.length;f--;){var g=e[f];if(g=="click")this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if(g!="manual"){var h=g=="hover"?"mouseenter":"focus",i=g=="hover"?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(c.timeout),c.hoverState="in";if(!c.options.delay||!c.options.delay.show)return c.show();c.timeout=setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show)},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(c.timeout),c.hoverState="out";if(!c.options.delay||!c.options.delay.hide)return c.hide();c.timeout=setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide)},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);if(b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d=typeof this.options.placement=="function"?this.options.placement.call(this,c[
7110],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m=this.options.container=="body"?window.innerWidth:j.outerWidth(),n=this.options.container=="body"?window.innerHeight:j.outerHeight(),o=this.options.container=="body"?0:j.offset().left;d=d=="bottom"&&g.top+g.height+i-l>n?"top":d=="top"&&g.top-l-i<0?"bottom":d=="right"&&g.right+h>m?"left":d=="left"&&g.left-h<o?"right":d,c.removeClass(k).addClass(d)}var p=this.getCalculatedOffset(d,g,h,i);this.applyPlacement(p,d),this.$element.trigger("shown.bs."+this.type)}},b.prototype.applyPlacement=function(a,b){var c,d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),a.top=a.top+g,a.left=a.left+h,d.offset(a).addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;b=="top"&&j!=f&&(c=!0,a.top=a.top+f-j);if(/bottom|top/.test(b)){var k=0;a.left<0&&(k=a.left*-2,a.left=0,d.offset(a),i=d[0].offsetWidth,j=d[0].offsetHeight),this.replaceArrow(k-e+i,i,"left")}else this.replaceArrow(j-f,j,"top");c&&d.offset(a)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function e(){b.hoverState!="in"&&c.detach()}var b=this,c=this.tip(),d=a.Event("hide.bs."+this.type);this.$element.trigger(d);if(d.isDefaultPrevented())return;return c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?c.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),this.$element.trigger("hidden.bs."+this.type),this},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},typeof b.getBoundingClientRect=="function"?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return a=="bottom"?{top:b.top+b.height,left:b.left+b.width/2-c/2}:a=="top"?{top:b.top-d,left:b.left+b.width/2-c/2}:a=="left"?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f=typeof c=="object"&&c;e||d.data("bs.tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||(typeof b.content=="function"?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f=typeof c=="object"&&c;e||d.data("bs.popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});b.trigger(f);if(f.isDefaultPrevented())return;var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})},b.prototype.activate=function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g).emulateTransitionEnd(150):g(),e.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;typeof f!="object"&&(h=g=f),typeof g=="function"&&(g=f.top()),typeof h=="function"&&(h=f.bottom());var i=this.unpin!=null&&d+this.unpin<=e.top?!1:h!=null&&e.top+this.$element.height()>=c-h?"bottom":g!=null&&d<=g?"top":!1;if(this.affixed===i)return;this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin=i=="bottom"?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),i=="bottom"&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()})};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f=typeof c=="object"&&c;
711e||d.data("bs.affix",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(this.transitioning||this.$element.hasClass("in"))return;var b=a.Event("show.bs.collapse");this.$element.trigger(b);if(b.isDefaultPrevented())return;var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])},b.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("in"))return;var b=a.Event("hide.bs.collapse");this.$element.trigger(b);if(b.isDefaultPrevented())return;var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};if(!a.support.transition)return d.call(this);this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350)},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),typeof c=="object"&&c);e||d.data("bs.collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":c.data(),i=c.attr("data-parent"),j=i&&a(i);if(!g||!g.transitioning)j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(c).addClass("collapsed"),c[f.hasClass("in")?"addClass":"removeClass"]("collapsed");f.collapse(h)})}(window.jQuery),+function(a){function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}"use strict",b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this,d=this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,c=b-this.$scrollElement.height(),d=this.offsets,e=this.targets,f=this.activeTarget,g;if(a>=c)return f!=(g=e.last()[0])&&this.activate(g);for(g=d.length;g--;)f!=e[g]&&a>=d[g]&&(!d[g+1]||a<=d[g+1])&&this.activate(e[g])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f=typeof c=="object"&&c;e||d.data("bs.scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(a.style[c]!==undefined)return{end:b[c]}}"use strict",a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery)
712/* End */
713;
714; /* Start:"a:4:{s:4:"full";
714s:66:"/bitrix/templates/aspro_max/js/jquery.actual.min.js?17762217781251";s:6:"source";s:51:"/bitrix/templates/aspro_max/js/jquery.actual.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
715/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
716 * Licensed under the MIT License (LICENSE.txt).
717 *
718 * Version: 1.0.18
719 *
720 * Requires: jQuery >= 1.2.3
721 */
722(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a);
723}else{a(jQuery);}}(function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf;a.fn.extend({actual:function(b,l){if(!this[b]){throw'$.actual => The jQuery method "'+b+'" you called does not exist';
724}var f={absolute:false,clone:false,includeMargin:false,display:"block"};var i=a.extend(f,l);var e=this.eq(0);var h,j;if(i.clone===true){h=function(){var m="position: absolute !important; top: -1000 !important; ";
725e=e.clone().attr("style",m).appendTo("body");};j=function(){e.remove();};}else{var g=[];var d="";var c;h=function(){c=e.parents().addBack().filter(":hidden");
726d+="visibility: hidden !important; display: "+i.display+" !important; ";if(i.absolute===true){d+="position: absolute !important; ";}c.each(function(){var m=a(this);
727var n=m.attr("style");g.push(n);m.attr("style",n?n+";"+d:d);});};j=function(){c.each(function(m){var o=a(this);var n=g[m];if(n===undefined){o.removeAttr("style");
728}else{o.attr("style",n);}});};}h();var k=/(outer)/.test(b)?e[b](i.includeMargin):e[b]();j();return k;}});}));
729/* End */
730;
731; /* Start:"a:4:{s:4:"full";s:66:"/bitrix/templates/aspro_max/vendor/js/ripple.min.js?17762217781624";s:6:"source";s:47:"/bitrix/templates/aspro_max/vendor/js/ripple.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
732!function(m,i,h){m.ripple=function(t,e){var c=this,f=c.log=function(){c.defaults.debug&&console&&console.log&&console.log.apply(console,arguments)};c.selector=t,c.defaults={debug:!1,on:"mousedown",opacity:.4,color:"auto",multi:!1,duration:.7,rate:function(t){return t},easing:"linear"},c.defaults=m.extend({},c.defaults,e);m(i).on(c.defaults.on,c.selector,function(t){var e,i,o=m(this);if(o.addClass("has-ripple"),(i=m.extend({},c.defaults,o.data())).multi||!i.multi&&0===o.find(".ripple").length){if((e=m("<span></span>").addClass("ripple")).appendTo(o),f("Create: Ripple"),!e.height()&&!e.width()){var n=h.max(o.outerWidth(),o.outerHeight());e.css({height:n,width:n}),f("Set: Ripple size")}if(i.rate&&"function"==typeof i.rate){var a=h.round(e.width()/i.duration),l=i.rate(a),p=e.width()/l;i.duration.toFixed(2)!==p.toFixed(2)&&(f("Update: Ripple Duration",{from:i.duration,to:p}),i.duration=p)}var d="auto"==i.color?o.css("color"):i.color,r={animationDuration:i.duration.toString()+"s",animationTimingFunction:i.easing,background:d,opacity:i.opacity};f("Set: Ripple CSS",r),e.css(r)}i.multi||(f("Set: Ripple Element"),e=o.find(".ripple")),f("Destroy: Ripple Animation"),e.removeClass("ripple-animate");var s=t.pageX-o.offset().left-e.width()/2,u=t.pageY-o.offset().top-e.height()/2;i.multi&&(f("Set: Ripple animationend event"),e.one("animationend webkitAnimationEnd oanimationend MSAnimationEnd",function(){f("Note: Ripple animation ended"),f("Destroy: Ripple"),m(this).remove()})),f("Set: Ripple location"),f("Set: Ripple animation"),e.css({top:u+"px",left:s+"px"}).addClass("ripple-animate")})}}(jQuery,document,Math);
733/* End */
734;
735; /* Start:"a:4:{s:4:"full";s:59:"/bitrix/templates/aspro_max/js/browser.min.js?1776221778662";s:6:"source";s:41:"/bitrix/templates/aspro_max/js/browser.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
736var matched,browser;jQuery.uaMatch=function(e){e=e.toLowerCase();var r=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie)[\s?]([\w.]+)/.exec(e)||/(trident)(?:.*? rv:([\w.]+)|)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:r[1]||"",version:r[2]||"0"}},matched=jQuery.uaMatch(navigator.userAgent),matched.browser="trident"==matched.browser?"msie":matched.browser,browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),jQuery.browser=browser;
vendor: 6,071 bytes, lines 737-740
737/* End */
738;
739; /* Start:"a:4:{s:4:"full";s:67:"/bitrix/templates/aspro_max/js/jquery.uniform.min.js?17762217788308";s:6:"source";s:52:"/bitrix/templates/aspro_max/js/jquery.uniform.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
740(function(e,t){"use strict";function n(e){var t=Array.prototype.slice.call(arguments,1);return e.prop?e.prop.apply(e,t):e.attr.apply(e,t)}function s(e,t,n){var s,a;for(s in n)n.hasOwnProperty(s)&&(a=s.replace(/ |$/g,t.eventNamespace),e.bind(a,n[s]))}function a(e,t,n){s(e,n,{focus:function(){t.addClass(n.focusClass)},blur:function(){t.removeClass(n.focusClass),t.removeClass(n.activeClass)},mouseenter:function(){t.addClass(n.hoverClass)},mouseleave:function(){t.removeClass(n.hoverClass),t.removeClass(n.activeClass)},"mousedown touchbegin":function(){e.is(":disabled")||t.addClass(n.activeClass)},"mouseup touchend":function(){t.removeClass(n.activeClass)}})}function i(e,t){e.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass)}function r(e,t,n){n?e.addClass(t):e.removeClass(t)}function l(e,t,n){var s="checked",a=t.is(":"+s);t.prop?t.prop(s,a):a?t.attr(s,s):t.removeAttr(s),r(e,n.checkedClass,a)}function u(e,t,n){r(e,n.disabledClass,t.is(":disabled"))}function o(e,t,n){switch(n){case"after":return e.after(t),e.next();case"before":return e.before(t),e.prev();case"wrap":return e.wrap(t),e.parent()}return null}function c(t,s,a){var i,r,l;return a||(a={}),a=e.extend({bind:{},divClass:null,divWrap:"wrap",spanClass:null,spanHtml:null,spanWrap:"wrap"},a),i=e("<div />"),r=e("<span />"),s.autoHide&&t.is(":hidden")&&"none"===t.css("display")&&i.hide(),a.divClass&&i.addClass(a.divClass),s.wrapperClass&&i.addClass(s.wrapperClass),a.spanClass&&r.addClass(a.spanClass),l=n(t,"id"),s.useID&&l&&n(i,"id",s.idPrefix+"-"+l),a.spanHtml&&r.html(a.spanHtml),i=o(t,i,a.divWrap),r=o(t,r,a.spanWrap),u(i,t,s),{div:i,span:r}}function d(t,n){var s;return n.wrapperClass?(s=e("<span />").addClass(n.wrapperClass),s=o(t,s,"wrap")):null}function f(){var t,n,s,a;return a="rgb(120,2,153)",n=e('<div style="width:0;height:0;color:'+a+'">'),e("body").append(n),s=n.get(0),t=window.getComputedStyle?window.getComputedStyle(s,"").color:(s.currentStyle||s.style||{}).color,n.remove(),t.replace(/ /g,"")!==a}function p(t){return t?e("<span />").text(t).html():""}function m(){return navigator.cpuClass&&!navigator.product}function v(){return window.XMLHttpRequest!==void 0?!0:!1}function h(e){var t;return e[0].multiple?!0:(t=n(e,"size"),!t||1>=t?!1:!0)}function C(){return!1}function w(e,t){var n="none";s(e,t,{"selectstart dragstart mousedown":C}),e.css({MozUserSelect:n,msUserSelect:n,webkitUserSelect:n,userSelect:n})}function b(e,t,n){var s=e.val();""===s?s=n.fileDefaultHtml:(s=s.split(/[\/\\]+/),s=s[s.length-1]),t.text(s)}function y(e,t,n){var s,a;for(s=[],e.each(function(){var e;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s.push({el:this,name:e,old:this.style[e]}),this.style[e]=t[e])}),n();s.length;)a=s.pop(),a.el.style[a.name]=a.old}function g(e,t){var n;n=e.parents(),n.push(e[0]),n=n.not(":visible"),y(n,{visibility:"hidden",display:"block",position:"absolute"},t)}function k(e,t){return function(){e.unwrap().unwrap().unbind(t.eventNamespace)}}var H=!0,x=!1,A=[{match:function(e){return e.is("a, button, :submit, :reset, input[type='button']")},apply:function(e,t){var r,l,o,d,f;return l=t.submitDefaultHtml,e.is(":reset")&&(l=t.resetDefaultHtml),d=e.is("a, button")?function(){return e.html()||l}:function(){return p(n(e,"value"))||l},o=c(e,t,{divClass:t.buttonClass,spanHtml:d()}),r=o.div,a(e,r,t),f=!1,s(r,t,{"click touchend":function(){var t,s,a,i;f||e.is(":disabled")||(f=!0,e[0].dispatchEvent?(t=document.createEvent("MouseEvents"),t.initEvent("click",!0,!0),s=e[0].dispatchEvent(t),e.is("a")&&s&&(a=n(e,"target"),i=n(e,"href"),a&&"_self"!==a?window.open(i,a):document.location.href=i)):e.click(),f=!1)}}),w(r,t),{remove:function(){return r.after(e),r.remove(),e.unbind(t.eventNamespace),e},update:function(){i(r,t),u(r,e,t),e.detach(),o.span.html(d()).append(e)}}}},{match:function(e){return e.is(":checkbox")},apply:function(e,t){var n,r,o;return n=c(e,t,{divClass:t.checkboxClass}),r=n.div,o=n.span,a(e,r,t),s(e,t,{"click touchend":function(){l(o,e,t)}}),l(o,e,t),{remove:k(e,t),update:function(){i(r,t),o.removeClass(t.checkedClass),l(o,e,t),u(r,e,t)}}}},{match:function(e){return e.is(":file")},apply:function(t,r){function l(){b(t,p,r)}var d,f,p,v;return d=c(t,r,{divClass:r.fileClass,spanClass:r.fileButtonClass,spanHtml:r.fileButtonHtml,spanWrap:"after"}),f=d.div,v=d.span,p=e("<span />").html(r.fileDefaultHtml),p.addClass(r.filenameClass),p=o(t,p,"after"),n(t,"size")||n(t,"size",f.width()/10),a(t,f,r),l(),m()?s(t,r,{click:function(){t.trigger("change"),setTimeout(l,0)}}):s(t,r,{change:l}),w(p,r),w(v,r),{remove:function(){return p.remove(),v.remove(),t.unwrap().unbind(r.eventNamespace)},update:function(){i(f,r),b(t,p,r),u(f,t,r)}}}},{match:function(e){if(e.is("input")){var t=(" "+n(e,"type")+" ").toLowerCase(),s=" color date datetime datetime-local email month number password search tel text time url week ";return s.indexOf(t)>=0}return!1},apply:function(e,t){var s,i;return s=n(e,"type"),e.addClass(t.inputClass),i=d(e,t),a(e,e,t),t.inputAddTypeAsClass&&e.addClass(s),{remove:function(){e.removeClass(t.inputClass),t.inputAddTypeAsClass&&e.removeClass(s),i&&e.unwrap()},update:C}}},{match:function(e){return e.is(":radio")},apply:function(t,r){var o,d,f;return o=c(t,r,{divClass:r.radioClass}),d=o.div,f=o.span,a(t,d,r),s(t,r,{"click touchend":function(){e.uniform.update(e(':radio[name="'+n(t,"name")+'"]'))}}),l(f,t,r),{remove:k(t,r),update:function(){i(d,r),l(f,t,r),u(d,t,r)}}}},{match:function(e){return e.is("select")&&!h(e)?!0:!1},apply:function(t,n){var r,l,o,d;return n.selectAutoWidth&&g(t,function(){d=t.width()}),r=c(t,n,{divClass:n.selectClass,spanHtml:(t.find(":selected:first")||t.find("option:first")).html(),spanWrap:"before"}),l=r.div,o=r.span,n.selectAutoWidth?g(t,function(){y(e([o[0],l[0]]),{display:"block"},function(){var e;e=o.outerWidth()-o.width(),l.width(d+e),o.width(d)})}
740):l.addClass("fixedWidth"),a(t,l,n),s(t,n,{change:function(){o.html(t.find(":selected").html()),l.removeClass(n.activeClass)},"click touchend":function(){var e=t.find(":selected").html();o.html()!==e&&t.trigger("change")},keyup:function(){o.html(t.find(":selected").html())}}),w(o,n),{remove:function(){return o.remove(),t.unwrap().unbind(n.eventNamespace),t},update:function(){n.selectAutoWidth?(e.uniform.restore(t),t.uniform(n)):(i(l,n),o.html(t.find(":selected").html()),u(l,t,n))}}}},{match:function(e){return e.is("select")&&h(e)?!0:!1},apply:function(e,t){var n;return e.addClass(t.selectMultiClass),n=d(e,t),a(e,e,t),{remove:function(){e.removeClass(t.selectMultiClass),n&&e.unwrap()},update:C}}},{match:function(e){return e.is("textarea")},apply:function(e,t){var n;return e.addClass(t.textareaClass),n=d(e,t),a(e,e,t),{remove:function(){e.removeClass(t.textareaClass),n&&e.unwrap()},update:C}}}];m()&&!v()&&(H=!1),e.uniform={defaults:{activeClass:"active",autoHide:!0,buttonClass:"button",checkboxClass:"checker",checkedClass:"checked",disabledClass:"disabled",eventNamespace:".uniform",fileButtonClass:"action",fileButtonHtml:"Choose File",fileClass:"uploader",fileDefaultHtml:"No file selected",filenameClass:"filename",focusClass:"focus",hoverClass:"hover",idPrefix:"uniform",inputAddTypeAsClass:!0,inputClass:"uniform-input",radioClass:"radio",resetDefaultHtml:"Reset",resetSelector:!1,selectAutoWidth:!0,selectClass:"selector",selectMultiClass:"uniform-multiselect",submitDefaultHtml:"Submit",textareaClass:"uniform",useID:!0,wrapperClass:null},elements:[]},e.fn.uniform=function(t){var n=this;return t=e.extend({},e.uniform.defaults,t),x||(x=!0,f()&&(H=!1)),H?(t.resetSelector&&e(t.resetSelector).mouseup(function(){window.setTimeout(function(){e.uniform.update(n)},10)}),this.each(function(){var n,s,a,i=e(this);if(i.data("uniformed"))return e.uniform.update(i),void 0;for(n=0;A.length>n;n+=1)if(s=A[n],s.match(i,t))return a=s.apply(i,t),i.data("uniformed",a),e.uniform.elements.push(i.get(0)),void 0})):this},e.uniform.restore=e.fn.uniform.restore=function(n){n===t&&(n=e.uniform.elements),e(n).each(function(){var t,n,s=e(this);n=s.data("uniformed"),n&&(n.remove(),t=e.inArray(this,e.uniform.elements),t>=0&&e.uniform.elements.splice(t,1),s.removeData("uniformed"))})},e.uniform.update=e.fn.uniform.update=function(n){n===t&&(n=e.uniform.elements),e(n).each(function(){var t,n=e(this);t=n.data("uniformed"),t&&t.update(n,t.options)})}})(jQuery);
741/* End */
742;
743; /* Start:"a:4:{s:4:"full";s:75:"/bitrix/templates/aspro_max/vendor/js/sticky-sidebar.min.js?177622177811755";s:6:"source";s:55:"/bitrix/templates/aspro_max/vendor/js/sticky-sidebar.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
744!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.StickySidebar={})}(this,function(t){"use strict";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e,i,n=(function(t,e){(function(t){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0});var c,s,e=(s={topSpacing:0,bottomSpacing:0,containerSelector:!(c=".stickySidebar"),innerWrapperSelector:".inner-wrapper-sticky",stickyClass:"is-affixed",resizeSensor:!0,minWidth:!1},function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}(l,[{key:"initialize",value:function(){var i=this;if(this._setSupportFeatures(),this.options.innerWrapperSelector&&(this.sidebarInner=this.sidebar.querySelector(this.options.innerWrapperSelector),null===this.sidebarInner&&(this.sidebarInner=!1)),!this.sidebarInner){var t=document.createElement("div");for(t.setAttribute("class","inner-wrapper-sticky"),this.sidebar.appendChild(t);this.sidebar.firstChild!=t;)t.appendChild(this.sidebar.firstChild);this.sidebarInner=this.sidebar.querySelector(".inner-wrapper-sticky")}if(this.options.containerSelector){var e=document.querySelectorAll(this.options.containerSelector);
744if((e=Array.prototype.slice.call(e)).forEach(function(t,e){t.contains(i.sidebar)&&(i.container=t)}),!e.length)throw new Error("The container does not contains on the sidebar.")}"function"!=typeof this.options.topSpacing&&(this.options.topSpacing=parseInt(this.options.topSpacing)||0),"function"!=typeof this.options.bottomSpacing&&(this.options.bottomSpacing=parseInt(this.options.bottomSpacing)||0),this._widthBreakpoint(),this.calcDimensions(),this.stickyPosition(),this.bindEvents(),this._initialized=!0}},{key:"bindEvents",value:function(){window.addEventListener("resize",this,{passive:!0,capture:!1}),window.addEventListener("scroll",this,{passive:!0,capture:!1}),this.sidebar.addEventListener("update"+c,this),this.options.resizeSensor&&"undefined"!=typeof ResizeSensor&&(new ResizeSensor(this.sidebarInner,this.handleEvent),new ResizeSensor(this.container,this.handleEvent))}},{key:"handleEvent",value:function(t){this.updateSticky(t)}},{key:"calcDimensions",value:function(){if(!this._breakpoint){var t=this.dimensions;t.containerTop=l.offsetRelative(this.container).top,t.containerHeight=this.container.clientHeight,t.containerBottom=t.containerTop+t.containerHeight,t.sidebarHeight=this.sidebarInner.offsetHeight,t.sidebarWidth=this.sidebarInner.offsetWidth,t.viewportHeight=window.innerHeight,t.maxTranslateY=t.containerHeight-t.sidebarHeight,this._calcDimensionsWithScroll()}}},{key:"_calcDimensionsWithScroll",value:function(){var t=this.dimensions;t.sidebarLeft=l.offsetRelative(this.sidebar).left,t.viewportTop=document.documentElement.scrollTop||document.body.scrollTop,t.viewportBottom=t.viewportTop+t.viewportHeight,t.viewportLeft=document.documentElement.scrollLeft||document.body.scrollLeft,t.topSpacing=this.options.topSpacing,t.bottomSpacing=this.options.bottomSpacing,"function"==typeof t.topSpacing&&(t.topSpacing=parseInt(t.topSpacing(this.sidebar))||0),"function"==typeof t.bottomSpacing&&(t.bottomSpacing=parseInt(t.bottomSpacing(this.sidebar))||0),"VIEWPORT-TOP"===this.affixedType?t.topSpacing<t.lastTopSpacing&&(t.translateY+=t.lastTopSpacing-t.topSpacing,this._reStyle=!0):"VIEWPORT-BOTTOM"===this.affixedType&&t.bottomSpacing<t.lastBottomSpacing&&(t.translateY+=t.lastBottomSpacing-t.bottomSpacing,this._reStyle=!0),t.lastTopSpacing=t.topSpacing,t.lastBottomSpacing=t.bottomSpacing}},{key:"isSidebarFitsViewport",value:function(){var t=this.dimensions,e="down"===this.scrollDirection?t.lastBottomSpacing:t.lastTopSpacing;return this.dimensions.sidebarHeight+e<this.dimensions.viewportHeight}},{key:"observeScrollDir",value:function(){var t=this.dimensions;if(t.lastViewportTop!==t.viewportTop){var e="down"===this.direction?Math.min:Math.max;t.viewportTop===e(t.viewportTop,t.lastViewportTop)&&(this.direction="down"===this.direction?"up":"down")}}},{key:"getAffixType",value:function(){this._calcDimensionsWithScroll();var t=this.dimensions,e=t.viewportTop+t.topSpacing,i=this.affixedType;return i=e<=t.containerTop||t.containerHeight<t.sidebarHeight?(t.translateY=0,"STATIC"):"up"===this.direction?this._getAffixTypeScrollingUp():this._getAffixTypeScrollingDown(),t.translateY=Math.max(0,t.translateY),t.translateY=Math.min(t.containerHeight,t.translateY),t.translateY=Math.round(t.translateY),t.lastViewportTop=t.viewportTop,i}},{key:"_getAffixTypeScrollingDown",value:function(){this.dimensions.containerHeight!=this.container.clientHeight&&this.calcDimensions();var t=this.dimensions,e=t.sidebarHeight+t.containerTop,i=t.viewportTop+t.topSpacing,n=t.viewportBottom-t.bottomSpacing,s=this.affixedType;return this.isSidebarFitsViewport()?t.sidebarHeight+i>=t.containerBottom?(t.translateY=t.containerBottom-e,s="CONTAINER-BOTTOM"):i>=t.containerTop&&(t.translateY=i-t.containerTop,s="VIEWPORT-TOP"):t.containerBottom<=n?(t.translateY=t.containerBottom-e,s="CONTAINER-BOTTOM"):e+t.translateY<=n?(t.translateY=n-e,s="VIEWPORT-BOTTOM"):t.containerTop+t.translateY<=i&&0!==t.translateY&&t.maxTranslateY!==t.translateY&&(s="VIEWPORT-UNBOTTOM"),s}},{key:"_getAffixTypeScrollingUp",value:function(){var t=this.dimensions,e=t.sidebarHeight+t.containerTop,i=t.viewportTop+t.topSpacing,n=t.viewportBottom-t.bottomSpacing,s=this.affixedType;return i<=t.translateY+t.containerTop?(t.translateY=i-t.containerTop,s="VIEWPORT-TOP"):t.containerBottom<=n?(t.translateY=t.containerBottom-e,s="CONTAINER-BOTTOM"):this.isSidebarFitsViewport()||t.containerTop<=i&&0!==t.translateY&&t.maxTranslateY
744!==t.translateY&&(s="VIEWPORT-UNBOTTOM"),s}},{key:"_getStyle",value:function(t){if(void 0!==t){var e={inner:{},outer:{}},i=this.dimensions;switch(t){case"VIEWPORT-TOP":e.inner={position:"fixed",top:i.topSpacing,left:i.sidebarLeft-i.viewportLeft,width:i.sidebarWidth};break;case"VIEWPORT-BOTTOM":e.inner={position:"fixed",top:"auto",left:i.sidebarLeft,bottom:i.bottomSpacing,width:i.sidebarWidth};break;case"CONTAINER-BOTTOM":case"VIEWPORT-UNBOTTOM":var n=this._getTranslate(0,i.translateY+"px");e.inner=n?{transform:n}:{position:"absolute",top:i.translateY,width:i.sidebarWidth}}switch(t){case"VIEWPORT-TOP":case"VIEWPORT-BOTTOM":case"VIEWPORT-UNBOTTOM":case"CONTAINER-BOTTOM":e.outer={height:i.sidebarHeight,position:"relative"}}return e.outer=l.extend({height:"",position:""},e.outer),e.inner=l.extend({position:"relative",top:"",left:"",bottom:"",width:"",transform:""},e.inner),e}}},{key:"stickyPosition",value:function(t){if(!this._breakpoint){t=this._reStyle||t||!1,this.options.topSpacing,this.options.bottomSpacing,this.sidebarInner.offsetHeight>this.dimensions.sidebarHeight&&(this.dimensions.sidebarHeight=this.sidebarInner.offsetHeight);var e=this.getAffixType(),i=this._getStyle(e);if((this.affixedType!=e||t)&&e){var n="affix."+e.toLowerCase().replace("viewport-","")+c;for(var s in l.eventTrigger(this.sidebar,n),"STATIC"===e?l.removeClass(this.sidebar,this.options.stickyClass):l.addClass(this.sidebar,this.options.stickyClass),i.outer){var o="number"==typeof i.outer[s]?"px":"";this.sidebar.style[s]=i.outer[s]+o}for(var r in i.inner){var a="number"==typeof i.inner[r]?"px":"";this.sidebarInner.style[r]=i.inner[r]+a}var p="affixed."+e.toLowerCase().replace("viewport-","")+c;l.eventTrigger(this.sidebar,p)}else this._initialized&&(this.sidebarInner.style.left=i.inner.left);this.affixedType=e}}},{key:"_widthBreakpoint",value:function(){window.innerWidth<=this.options.minWidth?(this._breakpoint=!0,this.affixedType="STATIC",this.sidebar.removeAttribute("style"),l.removeClass(this.sidebar,this.options.stickyClass),this.sidebarInner.removeAttribute("style")):this._breakpoint=!1}},{key:"updateSticky",value:function(t){var e,i=this,n=0<arguments.length&&void 0!==t?t:{};this._running||(this._running=!0,e=n.type,requestAnimationFrame(function(){switch(e){case"scroll":i._calcDimensionsWithScroll(),i.observeScrollDir(),i.stickyPosition();break;case"resize":default:i._widthBreakpoint(),i.calcDimensions(),i.stickyPosition(!0)}i._running=!1}))}},{key:"_setSupportFeatures",value:function(){var t=this.support;t.transform=l.supportTransform(),t.transform3d=l.supportTransform(!0)}},{key:"_getTranslate",value:function(t,e,i){var n=0<arguments.length&&void 0!==t?t:0,s=1<arguments.length&&void 0!==e?e:0,o=2<arguments.length&&void 0!==i?i:0;return this.support.transform3d?"translate3d("+n+", "+s+", "+o+")":!!this.support.translate&&"translate("+n+", "+s+")"}},{key:"destroy",value:function(){window.removeEventListener("resize",this,{capture:!1}),window.removeEventListener("scroll",this,{capture:!1}),this.sidebar.classList.remove(this.options.stickyClass),this.sidebar.style.minHeight="",this.sidebar.removeEventListener("update"+c,this);var t={inner:{},outer:{}};for(var e in t.inner={position:"",top:"",left:"",bottom:"",width:"",transform:""},t.outer={height:"",position:""},t.outer)this.sidebar.style[e]=t.outer[e];for(var i in t.inner)this.sidebarInner.style[i]=t.inner[i];this.options.resizeSensor&&"undefined"!=typeof ResizeSensor&&(ResizeSensor.detach(this.sidebarInner,this.handleEvent),ResizeSensor.detach(this.container,this.handleEvent))}}],[{key:"supportTransform",value:function(t){var i=!1,e=t?"perspective":"transform",n=e.charAt(0).toUpperCase()+e.slice(1),s=document.createElement("support").style;return(e+" "+["Webkit","Moz","O","ms"].join(n+" ")+n).split(" ").forEach(function(t,e){if(void 0!==s[t])return i=t,!1}),i}},{key:"eventTrigger",value:function(t,e,i){try{var n=new CustomEvent(e,{detail:i})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i)}t.dispatchEvent(n)}},{key:"extend",value:function(t,e){var i={};for(var n in t)void 0!==e[n]?i[n]=e[n]:i[n]=t[n];return i}},{key:"offsetRelative",value:function(t){var e={left:0,top:0};do{var i=t.offsetTop,n=t.offsetLeft;isNaN(i)||(e.top+=i),isNaN(n)||(e.left+=n),t="BODY"===t.tagName?t.parentElement:t.offsetParent}while(t);return e}},{key:"addClass",value:function(t,e){l.hasClass(t,e)||(t.classList?t.classList.add(e):t.className+=" "+e)}},{key:"removeClass",value:function(t,e){l.hasClass(t,e)&&(t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}},{key:"defaults",get:function(){return s}}]),l);function l(t){var e=this,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this.options=l.extend(s,i),this.sidebar="string"==typeof t?document.querySelector(t):t,void 0===this.sidebar)throw new Error("There is no specific sidebar element.");this.sidebarInner=!1,this.container=this.sidebar.parentElement,this.affixedType="STATIC",this.direction="down",this.support={transform:!1,transform3d:!1},this._initialized=!1,this._reStyle=!1,this._breakpoint=!1,this.dimensions={translateY:0,maxTranslateY:0,topSpacing:0,lastTopSpacing:0,bottomSpacing:0,lastBottomSpacing:0,sidebarHeight:0,sidebarWidth:0,containerTop:0,containerHeight:0,viewportHe
744ight:0,viewportTop:0,lastViewportTop:0},["handleEvent"].forEach(function(t){e[t]=e[t].bind(e)}),this.initialize()}t.default=e,window.StickySidebar=e})(e)}(e={exports:{}},e.exports),e.exports),s=(i=n)&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;t.default=s,t.__moduleExports=n,Object.defineProperty(t,"__esModule",{value:!0})});
745/* End */
746;
747; /* Start:"a:4:{s:4:"full";s:69:"/bitrix/templates/aspro_max/js/jquery.validate.min.js?177622177822257";s:6:"source";s:53:"/bitrix/templates/aspro_max/js/jquery.validate.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
748/*! jQuery Validation Plugin - v1.13.1 - 10/14/2014
749 * http://jqueryvalidation.org/
750 * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
751!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d,e;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element
751(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)}
751,hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled], [readonly]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");
751g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\])/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);
751return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){/*return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())*/ /*customized!!!*/ var check = false,re=new RegExp((typeof(VALIDATE_DATE_MASK)!=='undefined'?VALIDATE_DATE_MASK:'^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}$')),adata,gg,mm,aaaa,xdata;if(re.test(a)){adata=a.split('.');if(adata.length===1){adata=a.split('-');if(adata.length===1){adata=a.split(' ');
751if(adata.length===1){adata=a.split('/');if(adata.length===1){adata=a.split(':');}}}}gg=parseInt(adata[0],10);mm=parseInt(adata[1],10);aaaa=parseInt(adata[2],10);xdata=new Date(aaaa,mm-1,gg,12,0,0,0);if((xdata.getUTCFullYear()===aaaa)&&(xdata.getUTCMonth()===mm-1)&&(xdata.getUTCDate()===gg)){check = true;}else{check = false;}}else{check = false;}return this.optional(b)||check;},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});
752/* End */
753;
754; /* Start:"a:4:{s:4:"full";s:71:"/bitrix/templates/aspro_max/js/jquery.alphanumeric.min.js?1776221778942";s:6:"source";s:53:"/bitrix/templates/aspro_max/js/jquery.alphanumeric.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
755!function(n){n.fn.alphanumeric=function(r){var a,e,c=n(this),t="abcdefghijklmnopqrstuvwxyz",i=n.extend({ichars:"!@#$%^&*()+=[]\\';,/{}|\":<>?~`.- _",nchars:"",allow:""},r),h=i.allow.split(""),l=0;for(l;l<h.length;l++)-1!=i.ichars.indexOf(h[l])&&(h[l]="\\"+h[l]);return i.nocaps&&(i.nchars+=t.toUpperCase()),i.allcaps&&(i.nchars+=t),i.allow=h.join("|"),e=new RegExp(i.allow,"gi"),a=(i.ichars+i.nchars).replace(e,""),c.keypress(function(n){var r=String.fromCharCode(n.charCode?n.charCode:n.which);-1==a.indexOf(r)||n.ctrlKey||n.preventDefault()}),c.blur(function(){var n=c.val(),r=0;for(r;r<n.length;r++)if(-1!=a.indexOf(n[r]))return c.val(""),!1;return!1}),c},n.fn.numeric=function(r){var a="abcdefghijklmnopqrstuvwxyz",e=a.toUpperCase();return this.each(function(){n(this).alphanumeric(n.extend({nchars:a+e},r))})}
755,n.fn.alpha=function(r){var a="1234567890";return this.each(function(){n(this).alphanumeric(n.extend({nchars:a},r))})}}(jQuery);
756/* End */
757;
758; /* Start:"a:4:{s:4:"full";s:66:"/bitrix/templates/aspro_max/js/jquery.cookie.min.js?17762217783066";s:6:"source";s:47:"/bitrix/templates/aspro_max/js/jquery.cookie.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
759/*!
760 * jQuery Cookie Plugin v1.4.0
761 * https://github.com/carhartl/jquery-cookie
762 *
763 * Copyright 2013 Klaus Hartl
764 * Released under the MIT license
765 */
766(function (factory) {
767	if (typeof define === 'function' && define.amd) {
768		// AMD. Register as anonymous module.
769		define(['jquery'], factory);
770	} else {
771		// Browser globals.
772		factory(jQuery);
773	}
774}(function ($) {
775
776	var pluses = /\+/g;
777
778	function encode(s) {
779		return config.raw ? s : encodeURIComponent(s);
780	}
781
782	function decode(s) {
783		return config.raw ? s : decodeURIComponent(s);
784	}
785
786	function stringifyCookieValue(value) {
787		return encode(config.json ? JSON.stringify(value) : String(value));
788	}
789
790	function parseCookieValue(s) {
791		if (s.indexOf('"') === 0) {
792			// This is a quoted cookie as according to RFC2068, unescape...
793			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
794		}
795
796		try {
797			// Replace server-side written pluses with spaces.
798			// If we can't decode the cookie, ignore it, it's unusable.
799			// If we can't parse the cookie, ignore it, it's unusable.
800			s = decodeURIComponent(s.replace(pluses, ' '));
801			return config.json ? JSON.parse(s) : s;
802		} catch(e) {}
803	}
804
805	function read(s, converter) {
806		var value = config.raw ? s : parseCookieValue(s);
807		return $.isFunction(converter) ? converter(value) : value;
808	}
809
810	var config = $.cookie = function (key, value, options) {
811
812		// Write
813
814		if (value !== undefined && !$.isFunction(value)) {
815			options = $.extend({}, config.defaults, options);
816
817			if (typeof options.expires === 'number') {
818				var days = options.expires, t = options.expires = new Date();
819				t.setTime(+t + days * 864e+5);
820			}
821
822			return (document.cookie = [
823				encode(key), '=', stringifyCookieValue(value),
824				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
825				options.path    ? '; path=' + options.path : '',
826				options.domain  ? '; domain=' + options.domain : '',
827				options.secure  ? '; secure' : ''
828			].join(''));
829		}
830
831		// Read
832
833		var result = key ? undefined : {};
834
835		// To prevent the for loop in the first place assign an empty array
836		// in case there are no cookies at all. Also prevents odd result when
837		// calling $.cookie().
838		var cookies = document.cookie ? document.cookie.split('; ') : [];
839
840		for (var i = 0, l = cookies.length; i < l; i++) {
841			var parts = cookies[i].split('=');
842			var name = decode(parts.shift());
843			var cookie = parts.join('=');
844
845			if (key && key === name) {
846				// If second argument (value) is a function it's a converter...
847				result = read(cookie, value);
848				break;
849			}
850
851			// Prevent storing a cookie that we couldn't decode.
852			if (!key && (cookie = read(cookie)) !== undefined) {
853				result[name] = cookie;
854			}
855		}
856
857		return result;
858	};
859
860	config.defaults = {};
861
862	$.removeCookie = function (key, options) {
863		if ($.cookie(key) === undefined) {
864			return false;
865		}
866
867		// Must not alter options, thus extending a fresh object...
868		$.cookie(key, '', $.extend({}, options, { expires: -1 }));
869		return !$.cookie(key);
870	};
871
872}));
873
874/* End */
875;
876; /* Start:"a:4:{s:4:"full";s:60:"/bitrix/templates/aspro_max/js/mobile.min.js?177622177818101";s:6:"source";s:40:"/bitrix/templates/aspro_max/js/mobile.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
877$(document).ready((function(){var $mobileMenu=$("#mobilemenu");if($mobileMenu.length){if($mobileMenu.isLeftSide=$mobileMenu.hasClass("leftside"),$mobileMenu.isOpen=$mobileMenu.hasClass("show"),$mobileMenu.isDowndrop=$mobileMenu.find(">.scroller").hasClass("downdrop"),$mobileMenuNlo=$mobileMenu.find("[data-nlo]"),$("#mobileheader .burger").click((function(){SwipeMobileMenu(),"object"==typeof jsControlMobile&&jsControlMobile&&"onFocusLost"in jsControlMobile&&jsControlMobile.onFocusLost()})),$mobileMenu.isLeftSide){$mobileMenu.parent().append('<div id="mobilemenu-overlay"></div>');var $mobileMenuOverlay=$("#mobilemenu-overlay");$mobileMenuOverlay.click((function(){$mobileMenu.isOpen&&(CloseMobileMenu(),$mobileMenu.find(".expanded").removeClass("expanded"))})),BX.loadScript(arAsproOptions.SITE_TEMPLATE_PATH+"/js/jquery.mobile.custom.touch.min.js",(function(){$(document).swiperight((function(e){if(!$(e.target).closest(".flexslider").length&&!$(e.target).closest(".swipeignore").length&&!$(e.target).closest(".
877jqmWindow.popup").length){var partWindowWidth=document.documentElement.clientWidth/3,swipeStart;e.swipestart.coords[0]<=partWindowWidth&&OpenMobileMenu()}})),$(document).swipeleft((function(e){$(e.target).closest(".flexslider").length||$(e.target).closest(".swipeignore").length||$(e.target).closest(".jqmWindow.popup").length||CloseMobileMenu()}))}))}else $(document).on("click","#mobileheader",(function(e){$(e.target).closest("#mobilemenu").length||$(e.target).closest(".burger").length||!$mobileMenu.isOpen||CloseMobileMenu()}));function OpenMobileMenu(){if(CloseMobilePhone(),!$mobileMenu.isOpen){if($(".style-switcher").hasClass("active")&&$(".style-switcher .switch").trigger("click"),$(".style-switcher .switch").hide(),$mobileMenu.isLeftSide?setTimeout((function(){$mobileMenuOverlay.fadeIn("fast")}),100):($("body").scrollTop(0).css({position:"fixed"}),$mobileMenu.css({top:+($("#mobileheader").height()+$("#mobileheader").offset().top)+"px"}),$("#mobileheader .burger").addClass("c")),$mobileMenu.addClass("show"),$mobileMenu.isOpen=!0,!$mobileMenu.isDowndrop){var $wrap=$mobileMenu.find(".wrap").first(),params=$wrap.data("params");void 0===params&&(params={depth:0,scroll:{},height:{}}),$wrap.data("params",params)}$mobileMenuNlo.length&&($mobileMenuNlo.hasClass("nlo-loadings")||($mobileMenuNlo.addClass("nlo-loadings"),setTimeout((function(){$.ajax({data:{nlo:$mobileMenuNlo.attr("data-nlo")},success:function(response){$mobileMenuNlo[0].insertAdjacentHTML("beforebegin",$.trim(response)),$mobileMenuNlo.remove()},error:function(){$mobileMenuNlo.removeClass("nlo-loadings")}})}),300)))}}function CloseMobileMenu(){$mobileMenu.isOpen&&($mobileMenu.removeClass("show"),$mobileMenu.isOpen=!1,$(".style-switcher .switch").show(),$mobileMenu.isLeftSide?setTimeout((function(){$mobileMenuOverlay.fadeOut("fast")}),100):($("#mobileheader .burger").removeClass("c"),$("body").css({position:""})),$mobileMenu.isDowndrop||setTimeout((function(){var $scroller=$mobileMenu.find(".scroller").first(),$wrap=$mobileMenu.find(".wrap").first(),params=$wrap.data("params");params.depth=0,$wrap.data("params",params).attr("style",""),$mobileMenu.scrollTop(0),$scroller.css("height","")}),400))}function SwipeMobileMenu(){$mobileMenu.isOpen?CloseMobileMenu():OpenMobileMenu()}function MoveMobileMenuWrapNext(){if(!$mobileMenu.isDowndrop){var $scroller=$mobileMenu.find(".scroller").first(),$wrap=$mobileMenu.find(".wrap").first();if($wrap.length){var params=$wrap.data("params"),$dropdownNext=$mobileMenu.find(".expanded>.dropdown").eq(params.depth);if($dropdownNext.length){var bMobileRegions=$dropdownNext.closest(".mobile_regions").length;if(bMobileRegions)var $fixedCities=$dropdownNext.find(".menu-item-fixed");params.scroll[params.depth]=parseInt($mobileMenu.scrollTop()),params.height[params.depth+1]=Math.max($dropdownNext.height(),params.depth?$mobileMenu.find(".expanded>.dropdown").eq(params.depth-1).height():$wrap.height()),$scroller.css("height",params.height[params.depth+1]+"px"),++params.depth,$wrap.css("transform","translateX("+-100*params.depth+"%)"),setTimeout((function(){$mobileMenu.animate({scrollTop:0},200)}),100),bMobileRegions&&$fixedCities.css("height",$mobileMenu.height()-$fixedCities.position().top+"px");var h=$dropdownNext.height();setTimeout((function(){h?$scroller.css("height",h+"px"):$scroller.css("height",""),bMobileRegions&&(setTimeout((function(){$fixedCities.css("overflow","")}),200),initMobileRegions())}),200)}$wrap.data("params",params)}}}function MoveMobileMenuWrapPrev(){if(!$mobileMenu.isDowndrop){var $scroller=$mobileMenu.find(".scroller").first(),$wrap=$mobileMenu.find(".wrap").first();if($wrap.length){var params=$wrap.data("params");if(params.depth>0){var $dropdown=$mobileMenu.find(".expanded>.dropdown").eq(params.depth-1);if($dropdown.length){$scroller.css("height",params.height[params.depth]+"px"),--params.depth,$wrap.css("transform","translateX("+-100*params.depth+"%)"),setTimeout((function(){$mobileMenu.animate({scrollTop:params.scroll[params.depth]},200)}),100),$dropdown.closest(".mobile_regions").length&&($dropdown.find(".menu-item-fixed").css("overflow","hidden"),setTimeout((function(){$dropdown.find(".menu-item-fixed").animate({scrollTop:0},200)}),100));var h=!!params.depth&&$mobileMenu.find(".expanded>.dropdown").eq(params.depth-1).height();setTimeout((function(){h?$scroller.css("height",h+"px"):$scroller.css("height","")}),200)}}$wrap.data("params",params)}}}function initMobileRegions(){initMobileRegions.inited||(initMobileRegions.inited=!0,$(".mobile_regions .dropdown .loadings").length&&getMainCities(),BX.loadScript(arAsproOptions.SITE_TEMPLATE_PATH+"/js/jquery-ui.min.js",autocompleteMobileRegionsHandler))}function autocompleteMobileRegionsHandler(){$("#mobile-region-search").autocomplete({minLength:2,appendTo:$(".mobile_regions .dropdown .mobile-cities").closest(".menu-item-fixed"),source:function(request,callback){let componentAction="searchCities",componentName="aspro:regionality.list.max",sessid=BX.message("bitrix_sessid"),lang=BX.message("LANGUAGE_ID"),siteId=BX.message("S
877ITE_ID"),url=location.pathname+location.search;BX.ajax({url:"/bitrix/services/main/ajax.php?mode=ajax&c="+encodeURIComponent(componentName)+"&action=searchCities&sessid="+sessid+"&SITE_ID="+siteId+"&siteId="+siteId+"&url="+encodeURIComponent(url)+"&term="+encodeURIComponent(request.term)+"&lang="+lang,method:"POST",async:!0,processData:!0,scriptsRunFirst:!0,emulateOnload:!0,start:!0,cache:!1,dataType:"json",onsuccess:function(response){"object"==typeof response&&response&&"object"==typeof response.data&&response.data&&(Object.values(response.data.cities).length?callback(response.data.cities):$(".mobile_regions .dropdown .mobile-cities").hide().siblings().empty().show())},onfailure:function(){}})},select:function(event,ui){let regionId=ui.item.ID;if(regionId){setCookieOnDomains("current_region",regionId);let locationId=ui.item.LOCATION_ID;locationId?setCookieOnDomains("current_location",locationId):setCookieOnDomains("current_location","",{expires:-1})}return $("#mobile-region-search").val(ui.item.label),!1},open:function(event,ui){$(".mobile_regions .dropdown .mobile-cities").hide().siblings().show()},close:function(event,ui){$(".mobile_regions .dropdown .mobile-cities").siblings().show()}}).data("ui-autocomplete")._renderItem=function(ul,item){let html='\n          <li class="mobile-city">\n            <a href="'+item.URL+'" data-id="'+item.ID+'" data-locid="'+(item.LOCATION_ID?item.LOCATION_ID:"")+'" class="dark-color"><span>'+item.NAME+"</span>"+(item.PATH?'<div class="muted">'+item.PATH+"</div>":"")+"</a>\n          </li>\n        ";return $(html).appendTo(ul)}}function getMainCities(){let componentAction="getMainCities",componentName="aspro:regionality.list.max",sessid=BX.message("bitrix_sessid"),lang=BX.message("LANGUAGE_ID"),siteId=BX.message("SITE_ID"),url=location.pathname+location.search,lastId=getMainCities.lastId,$loadings=$(".mobile_regions .dropdown .loadings").closest("li");BX.ajax({url:"/bitrix/services/main/ajax.php?mode=ajax&c="+encodeURIComponent(componentName)+"&action=getMainCities&sessid="+sessid+"&SITE_ID="+siteId+"&siteId="+siteId+"&url="+encodeURIComponent(url)+"&lastId="+lastId+"&lang="+lang,method:"POST",async:!0,processData:!0,scriptsRunFirst:!0,emulateOnload:!0,start:!0,cache:!1,dataType:"json",onsuccess:function(response){if("object"==typeof response&&response&&"object"==typeof response.data&&response.data&&(void 0!==response.data.lastId&&(getMainCities.lastId=response.data.lastId),response.data.cities&&Object.values(response.data.cities).length)){let itemsHtml="";for(let i in response.data.cities){let item=response.data.cities[i],bCurrent;itemsHtml+='\n\t\t\t\t\t\t\t\t\t<li class="mobile-city main-city'+(1==item.CURRENT?" selected":"")+'">\n\t\t\t\t\t\t\t\t\t\t<a href="'+item.URL+'" data-id="'+item.ID+'" data-locid="'+(item.LOCATION_ID?item.LOCATION_ID:"")+'" class="dark-color"><span>'+item.NAME+"</span>"+(item.PATH?'<div class="muted">'+item.PATH+"</div>":"")+"</a>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t"}$(itemsHtml).insertBefore($loadings),response.data.more?getMainCities.observer.observe($loadings[0]):$loadings.remove()}},onfailure:function(){$loadings.remove()}})}$(document).on("click","#mobilemenu .menu a,#mobilemenu .social-icons a",(function(e){var $this=$(this);if($this.hasClass("parent"))e.preventDefault(),$mobileMenu.isDowndrop?($this.closest("li").hasClass("expanded")?$this.closest("li").removeClass("expanded"):$this.closest("li").addClass("expanded"),initMobileRegions()):($this.closest("li").addClass("expanded"),MoveMobileMenuWrapNext());else{if($this.closest("li").hasClass("counters")){var href=$this.attr("href");if(void 0!==href){if("javascript:void(0)"===href)return;window.location.href=href,window.location.reload()}}$this.closest(".menu_back").length||CloseMobileMenu()}})),$(document).on("click","#mobilemenu .dropdown .menu_back",(function(e){e.preventDefault();var $this=$(this);MoveMobileMenuWrapPrev(),setTimeout((function(){$this.closest(".expanded").removeClass("expanded")}),400)})),$(document).on("click","#mobilemenu .menu.mobile_regions .menu_autocomplete .clean_icon",(function(e){$(this).closest(".wrapper").find("input[type=text]").val("").trigger("change"),$(this).hide()})),$(document).on("keyup change paste","#mobilemenu .menu.mobile_regions .menu_autocomplete input[type=text]",(function(e){let $btn=$(this).closest(".wrapper").find(".clean_icon");$(this).val().length?$btn.show():($btn.hide(),$(this).closest(".dropdown").find(".mobile-cities").show().siblings().hide().empty())})),$(document).on("click",".mobile_regions .mobile-city a",(function(e){e.preventDefault();let $this=$(this),regionId=$this.data("id");if(regionId){setCookieOnDomains("current_region",regionId);let locationId=$this.data("locid");locationId?setCookieOnDomains("current_location",locationId):setCookieOnDomains("current_location","",{expires:-1});let href=$this.attr("href");location.href=href}})),initMobileRegions.inited=!1,getMainCities.lastId=0,getMainCities.observer=new IntersectionObserver((entries,observer)=>
877{entries.forEach(entry=>{entry.isIntersecting&&(getMainCities.observer.unobserve(entry.target),getMainCities())})},{root:null,rootMargin:"0px",threshold:.5})}var $mobileHeader=$("#mobileheader"),$simpleHeader=$("body.simple_basket_mode #header"),$mobilePhone=$("#mobilePhone");$mobilePhone.isOpen=!1,$mobilePhone.length&&($mobilePhone.isOpen=$mobilePhone.hasClass("show"),$(document).on("click",".wrap_phones .svg-inline-phone",(function(e){SwipeMobilePhone(),e.stopPropagation()})),$(document).on("click",".wrap_phones .svg-inline-close",(function(e){CloseMobilePhone(),e.stopPropagation()}))),SwipeMobilePhone=function(){$mobilePhone.isOpen?CloseMobilePhone():OpenMobilePhone()},OpenMobilePhone=function(){if(!$mobilePhone.isOpen){CloseMobileMenu();var isSimple,positionOffset=Boolean($simpleHeader.length)?$simpleHeader[0].getBoundingClientRect():$mobileHeader[0].getBoundingClientRect(),position=positionOffset.top+positionOffset.height+pageYOffset;$('<div class="jqmOverlay mobp" style="top:'+position+'px;position:absolute"></div>').appendTo("body"),setTimeout((function(){$mobilePhone.slideDown("fast",(function(){$mobilePhone.addClass("show"),$mobilePhone.isOpen=!0}))}),100)}},CloseMobilePhone=function(){$mobilePhone.isOpen&&setTimeout((function(){$mobilePhone.slideUp("fast",(function(){$mobilePhone.removeClass("show"),$mobilePhone.isOpen=!1,$(".jqmOverlay.mobp").remove()}))}),100)},checkMobilePhone=function(){window.matchMedia("(max-width: 991px)").matches||CloseMobilePhone()},$(document).on("click","body.simple_basket_mode .back-mobile-arrow .arrow-back",(function(){document.referrer&&document.referrer!=location.href?window.history.back():location.href="/"}));var $mobilefilter=$("#mobilefilter");if($mobilefilter.length){$mobilefilter.isOpen=$mobileMenu.hasClass("show"),$mobilefilter.isAppendLeft=!1,$mobilefilter.isWrapFilter=!1,$mobilefilter.isHorizontalOrCompact=$(".filter_horizontal").length||$(".bx_filter_vertical.compact").length,$mobilefilter.close='<i class="svg svg-close close-icons"></i>',$(document).on("click",".bx-filter-title",(function(){OpenMobileFilter()})),$(document).on("click","#mobilefilter .svg-close.close-icons",(function(){CloseMobileFilter()})),$(document).on("click",".bx_filter_select_block",(function(e){var bx_filter_select_container=$(e.target).parents(".bx_filter_select_container");if(bx_filter_select_container.length){var prop_id=bx_filter_select_container.closest(".bx_filter_parameters_box").attr("data-property_id");$("#smartFilterDropDown"+prop_id).length&&$("#smartFilterDropDown"+prop_id).css({"max-width":bx_filter_select_container.width(),"z-index":"3020"})}})),$(document).on("mouseup",".bx_filter_section",(function(e){$(e.target).hasClass("bx_filter_search_button")&&CloseMobileFilter()})),$(document).on("mouseup",".bx_filter_parameters_box_title",(function(e){$("[id^='smartFilterDropDown']").hide(),$(e.target).hasClass("close-icons")&&CloseMobileFilter()})),$mobilefilter.parent().append('<div id="mobilefilter-overlay"></div>');var $mobilefilterOverlay=$("#mobilefilter-overlay");$mobilefilterOverlay.click((function(){$mobilefilter.isOpen&&CloseMobileFilter()})),mobileFilterNum=function(num,def){if(def)$(".bx_filter_search_button").text(num.data("f"));else{var str="",$prosLeng=$(".bx_filter_parameters_box > span");str+=$prosLeng.data("f")+" "+num+" "+declOfNumFilter(num,[$prosLeng.data("fi"),$prosLeng.data("fr"),$prosLeng.data("frm")]),$(".bx_filter_search_button").text(str)}},declOfNumFilter=function(number,titles){return cases=[2,0,1,1,1,2],titles[number%100>4&&number%100<20?2:cases[number%10<5?number%10:5]]},OpenMobileFilter=function(){if(!$mobilefilter.isOpen){if($("body").addClass("jqm-initied wf"),$(".bx_filter_vertical .slide-block__head.filter_title").removeClass("closed"),$(".bx_filter_vertical .slide-block__head.filter_title + .slide-block__body").show(),!$mobilefilter.isAppendLeft){$mobilefilter.isWrapFilter||($(".bx_filter").wrap("<div id='wrapInlineFilter'></div>"),$mobilefilter.isWrapFilter=!0),$(".bx_filter").appendTo($("#mobilefilter"));var helper=$("#filter-helper");helper.length&&helper.prependTo($("#mobilefilter .bx_filter_parameters")),$mobilefilter.isAppendLeft=!0}var init;"function"==typeof checkFilterLandgings&&checkFilterLandgings(),$("#mobilefilter .bx_filter_parameters").addClass("scrollbar scrollblock"),$("#mobilefilter .slide-block .filter_title").addClass("ignore"),$("#mobilefilter .bx_filter_parameters .bx_filter_parameters_box_title").addClass("colored_theme_hover_bg-block"),$(".bx_filter_button_box.ajax-btns").addClass("colored_theme_bg"),$(".bx_filter_button_box.ajax-btns .filter-bnt-wrapper").removeClass("hidden"),InitCustomScrollBar(),setTimeout((function(){$mobilefilterOverlay.fadeIn("fast")}),100),$("body").css({overflow:"hidden",height:"100vh"}),$mobilefilter.addClass("show"),$mobilefilter.find(".bx_filter").css({display:"block"}),$mobilefilter.isOpen=!0,$("#mobilefilter .bx_filter_button_box.btns.ajax-btns").removeClass("hidden"),void 0===$mobilefilter.data("init")&&($mobilefilter.scroll((function(){$(".bx_filter_section .bx_filter_select_container").each((function(){var prop_id=$(this).closest(".bx_filter_parameters_box").attr("data-property_id");$("#smartFilterDropDown"+prop_id).length&&$("#smartFilterDropDown"+prop_id).hide()}))})),$mobilefilter.data("init","Y"))}},CloseMobileFilter=function(append){if($mobilefilter.find(".bx_filter_parameters").removeClass("scrollbar"),$("#mobilefilter .bx_filter_parameters").length&&$("body").removeClass("jqm-initied wf"),$("#mobilefilter .bx_filter_parameters .bx_filter_parameters_box_title").removeClass("colored_theme_hover_bg-block"),$(".slide-block .filter_title").removeClass("ignore"),$(".bx_filter_button_box.ajax-btns").removeClass("colored_theme_bg"),$(".bx_filter:not(.n-ajax) .bx_filter_button_box.ajax-btns .filter-bnt-wrapper").addClass("hidden"),$mobilefilter.isOpen&&($mobilefilter.find(".bx_filter_parameters").scrollTop(0),$("body").css({overflow:"",height:""}),setTimeout((function(){$mobilefilterOverlay.fadeOut("fast")}),100),$mobilefilter.removeClass("show"),$mobilefilter.isOpen=!1),append&&$mobilefilter.isAppendLeft){$(".bx_filter").appendTo($("#wrapInlineFilter")).show();var helper=$("#filter-helper");helper.length&&helper.appendTo($("#filter-helper-wrapper")),$mobilefilter.isAppendLeft=!1,$mobilefilter.removeData("init"),mobileFilterNum($("#modef_num_mobile"),!0)}},checkMobileFilter=function(){(!window.matchMedia("(max-width: 991px)").matches&&!$mobilefilter.isHorizontalOrCompact||!window.matchMedia("(max-width: 767px)").matches&&$mobilefilter.isHorizontalOrCompact)&&CloseMobileFilter(!0)}}else checkTopFilter(),$(document).on("click",".bx-filter-title",(function(){$(this).toggleClass("opened"),$(".visible_mobile_filter").length?($(".visible_mobile_filter").show(),$(".bx_filter_vertical, .bx_filter").slideToggle(333)):($(".bx_filter_vertical").closest("div[id^=bx_incl]").show(),$(".bx_filter_vertical, .bx_filter").slideToggle(333))}))}));
878/* End */
879;
880; /* Start:"a:4:{s:4:"full";s:59:"/bitrix/templates/aspro_max/js/main.min.js?1776221778326910";s:6:"source";s:38:"/bitrix/templates/aspro_max/js/main.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
881var basketTimeoutSlide;
882var resizeEventTimer;
883
884var clicked_tab = 0;
885
886if (typeof arAsproOptions === "undefined") {
887  var arAsproOptions = {
888    SITE_DIR: "/",
889  };
890  if ($("body").data("site") !== undefined) arAsproOptions["SITE_DIR"] = $("body").data("site");
891}
892
893function readyDOM(callback) {
894  if (document.readyState !== "loading") callback();
895  else document.addEventListener("DOMContentLoaded", callback);
896}
897
898var typeofExt = function (item) {
899  const _toString = Object.prototype.toString;
900  return _toString.call(item).slice(8, -1).toLowerCase();
901};
902
903function loadScripts(scripts, cb) {
904  function addVersionToScripts(scripts) {
905    const version = '?v=' + arAsproOptions['MODULE_VERSION'];
906    if (Array.isArray(scripts)) {
907      scripts.forEach(function (item, i, arr) {
908        arr[i] += version;
909      });
910    } else if (typeof scripts === 'string') {
911      scripts += version
912    }
913    return scripts
914  }
915
916  scripts = addVersionToScripts(scripts)
917  BX.loadScript(scripts, function () {
918    if (typeof cb === "function") {
919      cb();
920    }
921  });
922}
923
924function loadJQM(cb) {
925  if (typeof $.fn.jqm === "function") {
926    cb();
927  } else {
928    BX.loadScript(arAsproOptions["SITE_TEMPLATE_PATH"] + "/js/jqModal.js?v=2.2.5", () => cb());
929  }
930}
931
932var InitLazyLoad = function () {};
933
934$(document).on("change", ".uploader input[type=file]", function () {
935  if (!$(this).next().length || !$(this).next().hasClass("resetfile")) {
936    $(
937      '<span class="resetfile"><svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11"><path d="M1345.19,376.484l4.66,4.659a0.492,0.492,0,0,1,0,.707,0.5,0.5,0,0,1-.71,0l-4.66-4.659-4.65,4.659a0.5,0.5,0,0,1-.71,0,0.492,0.492,0,0,1,0-.707l4.66-4.659-4.66-4.659a0.492,0.492,0,0,1,0-.707,0.5,0.5,0,0,1,.71,0l4.65,4.659,4.66-4.659a0.5,0.5,0,0,1,.71,0,0.492,0.492,0,0,1,0,.707Z" transform="translate(-1339 -371)"/></svg></span>'
938    ).insertAfter($(this));
939  }
940});
941
942$(document).on("click", ".uploader.files_add input[type=file] + .resetfile", function () {
943  var $input = $(this).prev();
944  $input.val("");
945  $.uniform.update($input);
946  $(this).remove();
947});
948
949$(document).on("click", ".top_block h3", function () {
950  if (window.matchMedia("(max-width: 550px)").matches) {
951    var $this = $(this);
952    var a = $this.siblings("a");
953    if (a.length) {
954      a[0].click();
955    }
956  }
957});
958
959$(document).on("click", ".bx-yandex-view-layout .yandex-map__mobile-opener", function () {
960  if ($(this).hasClass("closer")) {
961    closeYandexMap();
962  } else {
963    openYandexMap(this);
964  }
965});
966
967function openYandexMap(element) {
968  var $this = $(element);
969  if ($this.hasClass("closer")) return;
970  var currentMap = $this.parents(".bx-yandex-view-layout");
971  var mapId = currentMap.find(".bx-yandex-map").attr("id");
972  window.openedYandexMapFrame = mapId;
973  var mapContainer = $('<div data-mapId="' + mapId + '"></div>');
974  if (!$("div[data-mapId=" + mapId + "]").length) {
975    currentMap.after(mapContainer);
976  }
977  var yandexMapFrame = $('<div class="yandex-map__frame"></div>');
978  $("body .wrapper1").append(yandexMapFrame);
979  currentMap.appendTo(yandexMapFrame);
980  currentMap.find(".yandex-map__mobile-opener").addClass("closer");
981  window.map.container.fitToViewport();
982}
983
984function closeYandexMap() {
985  var yandexMapFrame = $(".yandex-map__frame");
986  if (yandexMapFrame.length) {
987    var currentMap = yandexMapFrame.find(".bx-yandex-view-layout");
988    var yandexMapContainer = $("div[data-mapId=" + window.openedYandexMapFrame + "]");
989
990    currentMap.appendTo(yandexMapContainer);
991    yandexMapFrame.remove();
992    currentMap.find(".yandex-map__mobile-opener").removeClass("closer");
993    if (window.map) {
994      window.map.container.fitToViewport();
995    }
996  }
997}
998
999function throttle(f, t) {
1000  let throttled, saveThis, saveArgs;
1001  const wrapper = function () {
1002    if (throttled) {
1003      saveThis = this;
1004      saveArgs = arguments;
1005      return;
1006    }
1007    throttled = true;
1008    f.apply(this, arguments);
1009    setTimeout(function () {
1010      throttled = false;
1011      if (saveArgs) {
1012        wrapper.apply(saveThis, saveArgs);
1013        saveThis = saveArgs = null;
1014      }
1015    }, t);
1016  };
1017  return wrapper;
1018}
1019
1020function debounce(f, t) {
1021  return function (args) {
1022    var previousCall = this.lastCall;
1023    this.lastCall = Date.now();
1024    if (previousCall && this.lastCall - previousCall <= t) {
1025      clearTimeout(this.lastCallTimer);
1026    }
1027    this.lastCallTimer = setTimeout(function () {
1028      f(args);
1029    }, t);
1030  };
1031}
1032
1033$.fn.iAppear = function (callback, options) {
1034  if (typeof $.fn.iAppear.useObserver === "undefined") {
1035    $.fn.iAppear.useObserver = typeof window["IntersectionObserver"] === "function";
1036
1037    if (!$.fn.iAppear.useObserver && typeof $.fn.appear !== "function") {
1038      $.fn.iAppear.queue = [];
1039      BX.loadScript(arAsproOptions.SITE_TEMPLATE_PATH + "/vendor/js/jquery.appear.js", function () {
1040        if (typeof $.fn.iAppear.queue === "object") {
1041          $.fn.iAppear.queue.forEach(function (queueItem) {
1042            $(queueItem.items).iAppear(queueItem.callback, queueItem.options);
1043          });
1044        }
1045      });
1046
1047      return;
1048    }
1049  }
1050
1051  if ($.fn.iAppear.useObserver) {
1052    var options = $.extend(
1053      {
1054        root: null,
1055        rootMargin: "150px 0px 150px 0px",
1056        threshold: 0.0,
1057      },
1058      options
1059    );
1060
1061    $(this).each(function (i, appearBlock) {
1062      var observer = new IntersectionObserver(function (entries, observer) {
1063        entries.forEach(function (element) {
1064          if (element.intersectionRatio > 0 && !element.target.dataset.iAppeared) {
1065            element.target.dataset.iAppeared = true;
1066
1067            if (typeof callback === "function") {
1068              callback.call(element.target);
1069            }
1070          }
1071        });
1072      }, options);
1073
1074      observer.observe(appearBlock);
1075    });
1076  } else {
1077    if (typeof $.fn.appear !== "function") {
1078      if ($(this).length) {
1079        $.fn.iAppear.queue.push({
1080          items: this,
1081          callback: callback,
1082          options: options,
1083        });
1084      }
1085
1086      return;
1087    } else {
1088      if ($(this).length) {
1089        $(this).each(function (i, appearBlock) {
1090          $(appearBlock).appear(function () {
1091            if (typeof callback === "function") {
1092              callback.call(appearBlock);
1093            }
1094          }, options);
1095        });
1096      }
1097    }
1098  }
1099};
1100
1101$(document).on("click", ".flex-control-nav.flex-control-js-click li a:not(.flex-active)", function (e) {
1102  var _this = $(this);
1103  var itemIndex = _this.data("index") ? _this.data("index") : _this.closest("li").index();
1104
1105  var block = "";
1106  var blocks = _this.closest(".items").find("> .item");
1107  var activeBlock = _this.closest(".items").find(".item.active");
1108
1109  var activeLi = _this.closest(".flex-control-nav").find(".flex-active");
1110
1111  activeBlock.fadeOut(function () {
1112    activeBlock.removeClass("active");
1113
1114    block = blocks.eq(itemIndex);
1115    if (block.length) {
1116      block.fadeIn(function () {
1117        block.addClass("active");
1118      });
1119    }
1120
1121    _this.addClass("flex-active");
1122    activeLi.removeClass("flex-active");
1123  });
1124
1125  e.preventDefault();
1126});
1127
1128$(document).on("mouseenter", "#headerfixed .menu-item.wide_menu", function () {
1129  var _this = $(this);
1130  setTimeout(function () {
1131    var dropdownMenu = _this.find(".wrap > .dropdown-menu");
1132    var menuOffset = dropdownMenu[0].getBoundingClientRect();
1133    var headerOffset = document.getElementById("headerfixed").getBoundingClientRect();
1134    var windowHeight = document.documentElement.clientHeight;
1135
1136    if (menuOffset.height + headerOffset.height > windowHeight) {
1137      var maxHeight = windowHeight - headerOffset.height;
1138      dropdownMenu.css({
1139        "max-height": maxHeight,
1140      });
1141      dropdownMenu.find(".menu-navigation").css({ "max-height": maxHeight });
1142      dropdownMenu.find(".customScrollbar").css({ "max-height": maxHeight });
1143      dropdownMenu.find(".menu-wrapper.menu-type-4 > li").css({ "min-height": "auto" });
1144    } else {
1145      dropdownMenu.css({
1146        "max-height": "",
1147      });
1148      dropdownMenu.find(".menu-navigation").css({ "max-height": "" });
1149      dropdownMenu.find(".customScrollbar").css({ "max-height": "" });
1150      dropdownMenu.find(".menu-wrapper.menu-type-4 > li").css({ "min-height": "" });
1151    }
1152  }, 300);
1153});
1154
1155BX.addCustomEvent("onAjaxSuccess", function (data) {
1156  if (typeof data === "object" && data !== null) {
1157    if (
1158      typeof data.BASKET_REFRESHED !== undefined &&
1159      data.BASKET_REFRESHED === true &&
1160      typeof data.BASKET_DATA === "object" &&
1161      data.BASKET_DATA
1162    ) {
1163      var basketCounts = data.BASKET_DATA.BASKET_ITEMS_COUNT;
1164      reloadBasketCounters(basketCounts);
1165    }
1166  }
1167});
1168
1169BX.addCustomEvent("onHeaderProgressBarChange", function (data) {
1170  if (typeof updateProgressBar === "function") {
1171    updateProgressBar();
1172  }
1173});
1174
1175if (!funcDefined("parseUrlQuery")) {
1176  parseUrlQuery = function () {
1177    var data = {};
1178    if (location.search) {
1179      var pair = location.search.substr(1).split("&");
1180      for (var i = 0; i < pair.length; i++) {
1181        var param = pair[i].split("=");
1182        data[param[0]] = param[1];
1183      }
1184    }
1185    return data;
1186  };
1187}
1188
1189if (!funcDefined("setLocationSKU")) {
1190  function setLocationSKU(ID, urlParam) {
1191   //if (urlParam === undefined) urlParam = "oid";
1192
1193    // var objUrl = parseUrlQuery(),
1194    //   j = 0,
1195    //   prefix = "",
1196    //   query_string = "",
1197    //   url = "";
1198
1199    // objUrl[urlParam] = ID;
1200
1201    // for (var i in objUrl) {
1202    //   if (parseInt(j) > 0) prefix = "&";
1203    //   query_string = query_string + prefix + i + "=" + objUrl[i];
1204    //   j++;
1205    // }
1206    // if (query_string) {
1207    //   url = location.pathname + "?" + query_string + location.hash;
1208    // }
1209    // try {
1210    //   //history.pushState(null, null, url);
1211    //   history.replaceState(null, null, url);
1212    //   return;
1213    // } catch (e) {}
1214    // location.hash = "#" + url.substr(1);
1215        url = ID;
1216    try {
1217      //history.pushState(null, null, url);
1218      history.replaceState(null, null, url);
1219      return;
1220    } catch (e) {}
1221    location = url;
1222  }
1223}
1224
1225if (!funcDefined("ShowOverlay")) {
1226  ShowOverlay = function () {
1227    $('<div class="jqmOverlay waiting"></div>').appendTo("body");
1228  };
1229}
1230
1231if (!funcDefined("HideOverlay")) {
1232  HideOverlay = function () {
1233    $(".jqmOverlay").detach();
1234  };
1235}
1236
1237if (!funcDefined("trimPrice")) {
1238  var trimPrice = function trimPrice(s) {
1239    s = s.split(" ").join("");
1240    s = s.split("&nbsp;").join("");
1241    return s;
1242  };
1243}
1244
1245if (!funcDefined("pauseYmObserver")) {
1246  // pause ya metrika webvisor MutationObserver callback (DOM indexer)
1247  // use before insert html with some animation
1248  pauseYmObserver = function () {
1249    if (
1250      typeof MutationObserver === "function" &&
1251      typeof MutationObserver.observers === "object" &&
1252      typeof MutationObserver.observers.ym === "object"
1253    ) {
1254      if (typeof pauseYmObserver.cnt === "undefined") {
1255        pauseYmObserver.cnt = 0;
1256      }
1257
1258      ++pauseYmObserver.cnt;
1259
1260      if (!MutationObserver.observers.ym.paused) {
1261        MutationObserver.observers.ym.pause();
1262      }
1263    }
1264  };
1265}
1266
1267if (!funcDefined("resumeYmObserver")) {
1268  // resume ya metrika webvisor MutationObserver callback
1269  // use when animation finished
1270  resumeYmObserver = function () {
1271    if (
1272      typeof MutationObserver === "function" &&
1273      typeof MutationObserver.observers === "object" &&
1274      typeof MutationObserver.observers.ym === "object"
1275    ) {
1276      if (typeof pauseYmObserver.cnt === "undefined") {
1277        pauseYmObserver.cnt = 1;
1278      }
1279
1280      pauseYmObserver.cnt -= pauseYmObserver.cnt > 0 ? 1 : 0;
1281
1282      if (!pauseYmObserver.cnt && MutationObserver.observers.ym.paused) {
1283        MutationObserver.observers.ym.resume();
1284      }
1285    }
1286  };
1287}
1288
1289if (!funcDefined("markProductRemoveBasket")) {
1290  var markProductRemoveBasket = function markProductRemoveBasket(id) {
1291    $(".in-cart[data-item=" + id + "]").hide();
1292    $(".to-cart[data-item=" + id + "]").show();
1293    if (
1294      $(".to-cart[data-item=" + id + "]")
1295        .closest(".counter_wrapp")
1296        .find(".counter_block").length
1297    ) {
1298      $(".to-cart[data-item=" + id + "]")
1299        .closest(".button_block")
1300        .removeClass("wide");
1301    }
1302    $(".to-cart[data-item=" + id + "]")
1303      .closest(".counter_wrapp")
1304      .find(".counter_block")
1305      .show();
1306    $(".counter_block[data-item=" + id + "]")
1307      .closest(".counter_block_inner")
1308      .show();
1309    $(".counter_block[data-item=" + id + "]").show();
1310    $(".in-subscribe[data-item=" + id + "]").hide();
1311    $(".to-subscribe[data-item=" + id + "]").show();
1312
1313    $(".banner_buttons.with_actions .wraps_buttons[data-id=" + id + "] .basket_item_add").removeClass("added");
1314
1315    if ($("#headerfixed .but-cell .type_block").length) {
1316      $("#headerfixed .but-cell .type_block span").text(BX.message("MORE_INFO_SKU"));
1317      $("#headerfixed .but-cell .type_block .svg-inline-fw").remove();
1318    }
1319  };
1320}
1321
1322if (!funcDefined("markProductAddBasket")) {
1323  var markProductAddBasket = function markProductAddBasket(id) {
1324    $(".to-cart[data-item=" + id + "]").hide();
1325    $(".to-cart[data-item=" + id + "]")
1326      .closest(".counter_wrapp")
1327      .find(".counter_block_inner")
1328      .hide();
1329    $(".to-cart[data-item=" + id + "]")
1330      .closest(".counter_wrapp")
1331      .find(".counter_block")
1332      .hide();
1333    $(".to-cart[data-item=" + id + "]")
1334      .closest(".button_block")
1335      .addClass("wide");
1336    $(".in-cart[data-item=" + id + "]").show();
1337
1338    $(".banner_buttons.with_actions .wraps_buttons[data-id=" + id + "] .basket_item_add").addClass("added");
1339
1340    if ($("#headerfixed .but-cell .type_block").length) {
1341      $("#headerfixed .but-cell .type_block").html($(".in-cart[data-item=" + id + "]").html());
1342    }
1343  };
1344}
1345
1346if (!funcDefined("markProductDelay")) {
1347  var markProductDelay = function markProductDelay(id) {
1348    $(".in-cart[data-item=" + id + "]").hide();
1349    $(".to-cart[data-item=" + id + "]").show();
1350    $(".to-cart[data-item=" + id + "]")
1351      .closest(".counter_wrapp")
1352      .find(".counter_block_inner")
1353      .show();
1354    $(".to-cart[data-item=" + id + "]")
1355      .closest(".counter_wrapp")
1356      .find(".counter_block")
1357      .show();
1358    if (
1359      $(".to-cart[data-item=" + id + "]")
1360        .closest(".counter_wrapp")
1361        .find(".counter_block").length
1362    ) {
1363      $(".to-cart[data-item=" + id + "]")
1364        .closest(".button_block")
1365        .removeClass("wide");
1366    }
1367
1368    if ($("#headerfixed .but-cell .type_block").length) {
1369      $("#headerfixed .but-cell .type_block span").text(BX.message("MORE_INFO_SKU"));
1370      $("#headerfixed .but-cell .type_block .svg-inline-fw").remove();
1371    }
1372  };
1373}
1374
1375if (!funcDefined("markProductSubscribe")) {
1376  var markProductSubscribe = function markProductSubscribe(id) {
1377    $(".to-subscribe[data-item=" + id + "]").hide();
1378    $(".in-subscribe[data-item=" + id + "]").css("display", "block");
1379  };
1380}
1381
1382if (!funcDefined("updateBottomIconsPanel")) {
1383  var updateBottomIconsPanel = function updateBottomIconsPanel(options) {
1384    if (options && $(".bottom-icons-panel").length) {
1385      var bBasketUpdate = "READY" in options || "BASKET_COUNT" in options;
1386      var basketCount = "READY" in options ? options.READY.COUNT : "BASKET_COUNT" in options ? options.BASKET_COUNT : 0;
1387      var basketTitle =
1388        "READY" in options ? options.READY.TITLE : "BASKET_SUMM_TITLE" in options ? options.BASKET_SUMM_TITLE : "";
1389      var bDelayUpdate = "DELAY" in options || "DELAY_COUNT" in options;
1390      var delayCount = "FAVORITE" in options ? options.FAVORITE.COUNT : 0;
1391      var delayTitle =
1392        "DELAY" in options ? options.DELAY.TITLE : "DELAY_SUMM_TITLE" in options ? options.DELAY_SUMM_TITLE : "";
1393      var bCompareUpdate = "COMPARE" in options;
1394      var compareCount =
1395        "COMPARE" in options
1396          ? typeof options.COMPARE === "object" && "COUNT" in options.COMPARE
1397            ? options.COMPARE.COUNT
1398            : Object.keys(options.COMPARE).length
1399          : 0;
1400
1401      //basket
1402      if (bBasketUpdate) {
1403        if (+basketCount > 0) {
1404          $(".bottom-icons-panel .basket.counter-state").removeClass("counter-state--empty");
1405        } else {
1406          $(".bottom-icons-panel .basket.counter-state").addClass("counter-state--empty");
1407        }
1408        $(".bottom-icons-panel .basket .counter-state__content-item-value").text(basketCount);
1409        $(".bottom-icons-panel .basket")
1410          .closest(".bottom-icons-panel__content-link")
1411          .attr("title", $("<div/>").html(basketTitle).text());
1412      }
1413      //
1414
1415      //delay
1416      if (bDelayUpdate && bBasketUpdate) {
1417        if (+delayCount > 0) {
1418          $(".bottom-icons-panel .delay.counter-state").removeClass("counter-state--empty");
1419        } else {
1420          $(".bottom-icons-panel .delay.counter-state").addClass("counter-state--empty");
1421        }
1422        $(".bottom-icons-panel .delay .counter-state__content-item-value").text(delayCount);
1423      }
1424      //
1425
1426      //compare
1427      if (bCompareUpdate) {
1428        if (compareCount > 0) {
1429          $(".bottom-icons-panel .compare.counter-state").removeClass("counter-state--empty");
1430        } else {
1431          $(".bottom-icons-panel .compare.counter-state").addClass("counter-state--empty");
1432        }
1433        $(".bottom-icons-panel .compare .counter-state__content-item-value").text(compareCount);
1434      }
1435    }
1436  };
1437}
1438if (!funcDefined("basketFly")) {
1439  var basketFly = function basketFly(action, opener) {
1440    if (typeof obMaxPredictions === "object") {
1441      obMaxPredictions.updateAll();
1442    }
1443
1444    $.post(
1445      arAsproOptions["SITE_DIR"] + "ajax/basket_fly.php",
1446      "PARAMS=" + $("#basket_form").find("input#fly_basket_params").val(),
1447      $.proxy(function (data) {
1448        var small = $(".opener .basket_count").hasClass("small"),
1449          basket_count = $(data).find(".basket_count").find(".items div").text();
1450        $("#basket_line .basket_fly").addClass("loaded").html(data);
1451
1452        if (action == "refresh") $("li[data-type=AnDelCanBuy]").trigger("click");
1453
1454        if (typeof opener == "undefined" || $("#basket_line .basket_fly").hasClass("loading")) {
1455          if (window.matchMedia("(min-width: 769px)").matches) {
1456            if (action == "open") {
1457              if (small) {
1458                if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") {
1459                  $(".opener .basket_count").click();
1460                }
1461              } else {
1462                $(".opener .basket_count").removeClass("small");
1463                $('.tabs_content.basket li[item-section="AnDelCanBuy"]').addClass("cur");
1464                $('#basket_line ul.tabs li[item-section="AnDelCanBuy"]').addClass("cur");
1465
1466                $("#basket_line .basket_fly .opener > div:eq(0)").addClass("cur");
1467              }
1468            } else {
1469              if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") {
1470                $(".opener .basket_count").click();
1471              }
1472            }
1473          }
1474        } else if (opener === "SHOW") {
1475          if (window.matchMedia("(min-width: 769px)").matches) {
1476            $(".opener .basket_count").removeClass("small");
1477            $('.tabs_content.basket li[item-section="AnDelCanBuy"]').addClass("cur");
1478            $('#basket_line ul.tabs li[item-section="AnDelCanBuy"]').addClass("cur");
1479            $("#basket_line .basket_fly .opener > div:eq(0)").addClass("cur");
1480          }
1481        }
1482      })
1483    );
1484  };
1485}
1486
1487if (!funcDefined("basketTop")) {
1488  var basketTop = function basketTop(action, hoverBlock) {
1489    if (action == "reload") {
1490      if ($(".basket_hover_block:hover").length) {
1491        hoverBlock = $(".basket_hover_block:hover");
1492      }
1493    }
1494
1495    if (action == "open") {
1496      if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") {
1497        if ($("#headerfixed").hasClass("fixed")) {
1498          hoverBlock = $("#headerfixed .basket_hover_block");
1499        } else {
1500          hoverBlock = $(".top_basket .basket_hover_block");
1501        }
1502      }
1503    }
1504
1505    if (hoverBlock === undefined) {
1506      console.log("Undefined hoverBlock");
1507      console.trace();
1508      return false;
1509    }
1510
1511    if (action == "close") {
1512      if (hoverBlock.length) {
1513        hoverBlock.css({
1514          opacity: "",
1515          visibility: "",
1516        });
1517        return true;
1518      }
1519    }
1520
1521    hoverBlock.removeClass("loaded");
1522    var firstTime = hoverBlock.find("div").length ? "false" : "true";
1523    var params = $("#basket_form").find("input#fly_basket_params").val();
1524    var postData = {
1525      firstTime: firstTime,
1526    };
1527    if (params !== undefined) {
1528      postData.PARAMS = params;
1529    }
1530
1531    $.post(
1532      arAsproOptions["SITE_DIR"] + "ajax/showBasketHover.php",
1533      postData,
1534      $.proxy(function (data) {
1535        var ob = BX.processHTML(data);
1536        // inject
1537        $("#headerfixed .basket_hover_block, .top_basket .basket_hover_block").html(ob.HTML);
1538        BX.ajax.processScripts(ob.SCRIPT);
1539        if (window.matchMedia("(min-width: 992px)").matches) {
1540          hoverBlock.addClass("loaded");
1541
1542          if (action == "open") {
1543            if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") {
1544              if ($("#headerfixed").hasClass("fixed")) {
1545                hoverBlock = $("#headerfixed .basket_hover_block");
1546              } else {
1547                hoverBlock = $(".top_basket .basket_hover_block");
1548              }
1549
1550              hoverBlock.css({
1551                opacity: "1",
1552                visibility: "visible",
1553              });
1554
1555              setTimeout(function () {
1556                hoverBlock.css({
1557                  opacity: "",
1558                  visibility: "",
1559                });
1560              }, 2000);
1561            }
1562          }
1563        }
1564      })
1565    );
1566  };
1567}
1568
1569$(document).on("click", "#basket_toolbar_button", function () {
1570  if (lastHash) location.hash = "cart";
1571});
1572$(document).on("click", "#basket_toolbar_button_delayed", function () {
1573  if (lastHash) location.hash = "delayed";
1574});
1575if (location.hash) {
1576  var hash = location.hash;
1577}
1578//work with hash end
1579
1580$(document).on("click", "#basket_line .basket_fly .opener > div.clicked", function () {
1581  if (arAsproOptions["PAGES"]["BASKET_PAGE"]) return;
1582  function onOpenFlyBasket(_this) {
1583    $("#basket_line .basket_fly .tabs li").removeClass("cur");
1584    $("#basket_line .basket_fly .tabs_content li").removeClass("cur");
1585    // $("#basket_line .basket_fly .remove_all_basket").removeClass("cur");
1586    if (!$(_this).is(".wish_count.empty")) {
1587      $("#basket_line .basket_fly .tabs_content li[item-section=" + $(_this).data("type") + "]").addClass("cur");
1588      $("#basket_line .basket_fly .tabs li:eq(" + $(_this).index() + ")").addClass("cur");
1589      // $("#basket_line .basket_fly .remove_all_basket."+$(_this).data("type")).addClass("cur");
1590    } else {
1591      $("#basket_line .basket_fly .tabs li").first().addClass("cur").siblings().removeClass("cur");
1592      $("#basket_line .basket_fly .tabs_content li").first().addClass("cur").siblings().removeClass("cur");
1593      // $("#basket_line .basket_fly .remove_all_basket").first().addClass("cur");
1594    }
1595    $("#basket_line .basket_fly .opener > div.clicked").removeClass("small");
1596
1597    $("#basket_line .basket_fly .opener > div").siblings().removeClass("cur");
1598    $("#basket_line .basket_fly .opener > div:eq(" + $(_this).index() + ")").addClass("cur");
1599  }
1600
1601  if (window.matchMedia("(min-width: 769px)").matches) {
1602    var _this = this;
1603
1604    $(_this).siblings().removeClass("cur");
1605    $(_this).addClass("cur");
1606
1607    if (parseInt($("#basket_line .basket_fly").css("right")) < 0) {
1608      $("#basket_line .basket_fly")
1609        .stop()
1610        .addClass("loading")
1611        .animate({ right: "0" }, 333, function () {
1612          if ($(_this).closest(".basket_fly.loaded").length) {
1613            onOpenFlyBasket(_this);
1614          } else {
1615            $.ajax({
1616              url: arAsproOptions["SITE_DIR"] + "ajax/basket_fly.php",
1617              type: "post",
1618              success: function (html) {
1619                $("#basket_line .basket_fly").removeClass("loading").addClass("loaded").html(html);
1620                onOpenFlyBasket(_this);
1621              },
1622            });
1623          }
1624        });
1625      $("#basket_line .basket_fly").addClass("swiped");
1626    } else if (
1627      $(this).is(".wish_count:not(.empty)") &&
1628      !$("#basket_line .basket_fly .basket_sort ul.tabs li.cur").is("[item-section=DelDelCanBuy]")
1629    ) {
1630      $("#basket_line .basket_fly .tabs li").removeClass("cur");
1631      $("#basket_line .basket_fly .tabs_content li").removeClass("cur");
1632      // $("#basket_line .basket_fly .remove_all_basket").removeClass("cur");
1633      $("#basket_line .basket_fly .tabs_content li[item-section=" + $(this).data("type") + "]").addClass("cur");
1634      $("#basket_line  .basket_fly .tabs li:eq(" + $(this).index() + ")")
1635        .first()
1636        .addClass("cur");
1637      // $("#basket_line .basket_fly .remove_all_basket."+$(this).data("type")).first().addClass("cur");
1638    } else if (
1639      $(this).is(".basket_count") &&
1640      $("#basket_line .basket_fly .basket_sort ul.tabs li.cur").length &&
1641      !$("#basket_line .basket_fly .basket_sort ul.tabs li.cur").is("[item-section=AnDelCanBuy]")
1642    ) {
1643      $("#basket_line .basket_fly .tabs li").removeClass("cur");
1644      $("#basket_line .basket_fly .tabs_content li").removeClass("cur");
1645      // $("#basket_line .basket_fly .remove_all_basket").removeClass("cur");
1646      $("#basket_line  .basket_fly .tabs_content li:eq(" + $(this).index() + ")").addClass("cur");
1647      $("#basket_line  .basket_fly .tabs li:eq(" + $(this).index() + ")")
1648        .first()
1649        .addClass("cur");
1650      // $("#basket_line .basket_fly .remove_all_basket."+$(this).data("type")).first().addClass("cur");
1651    } else {
1652      $("#basket_line .basket_fly")
1653        .stop()
1654        .animate({ right: -$("#basket_line .basket_fly").outerWidth() }, 150);
1655      $("#basket_line .basket_fly .opener > div.clicked").addClass("small");
1656      $("#basket_line .basket_fly").removeClass("swiped");
1657      $("#basket_line .basket_fly .opener > div").removeClass("cur");
1658    }
1659  }
1660});
1661
1662if (!funcDefined("clearViewedProduct")) {
1663  function clearViewedProduct() {
1664    try {
1665      var siteID = arAsproOptions.SITE_ID;
1666      var localKey = "MAX_VIEWED_ITEMS_" + siteID;
1667      var cookieParams = { path: "/", expires: 30 };
1668      if (typeof BX.localStorage !== "undefined") {
1669        // remove local storage
1670        BX.localStorage.set(localKey, {}, 0);
1671      }
1672      // remove cookie
1673      $.removeCookie(localKey, cookieParams);
1674    } catch (e) {
1675      console.error(e);
1676    }
1677  }
1678}
1679
1680if (!funcDefined("setViewedProduct")) {
1681  function setViewedProduct(id, arData) {
1682    try {
1683      // save $.cookie option
1684      var bCookieJson = $.cookie.json;
1685      $.cookie.json = true;
1686
1687      var siteID = arAsproOptions.SITE_ID;
1688      var localKey = "MAX_VIEWED_ITEMS_" + siteID;
1689      var cookieParams = { path: "/", expires: 30 };
1690
1691      if (typeof BX.localStorage !== "undefined" && typeof id !== "undefined" && typeof arData !== "undefined") {
1692        var PRODUCT_ID = typeof arData.PRODUCT_ID !== "undefined" ? arData.PRODUCT_ID : id;
1693        var arViewedLocal = BX.localStorage.get(localKey) ? BX.localStorage.get(localKey) : {};
1694        var arViewedCookie = $.cookie(localKey) ? $.cookie(localKey) : {};
1695        var count = 0;
1696
1697        // delete some items (sync cookie & local storage)
1698        for (var _id in arViewedLocal) {
1699          arViewedLocal[_id].IS_LAST = false;
1700          if (typeof arViewedCookie[_id] === "undefined") {
1701            delete arViewedLocal[_id];
1702          }
1703        }
1704        for (var _id in arViewedCookie) {
1705          if (typeof arViewedLocal[_id] === "undefined") {
1706            delete arViewedCookie[_id];
1707          }
1708        }
1709
1710        for (var _id in arViewedCookie) {
1711          count++;
1712        }
1713
1714        // delete item if other item (offer) of that PRODUCT_ID is exists
1715        if (typeof arViewedLocal[PRODUCT_ID] !== "undefined") {
1716          if (arViewedLocal[PRODUCT_ID].ID != id) {
1717            delete arViewedLocal[PRODUCT_ID];
1718            delete arViewedCookie[PRODUCT_ID];
1719          }
1720        }
1721
1722        var time = new Date().getTime();
1723        arData.ID = id;
1724        arData.ACTIVE_FROM = time;
1725        arData.IS_LAST = true;
1726        arViewedLocal[PRODUCT_ID] = arData;
1727        arViewedCookie[PRODUCT_ID] = [time.toString(), arData.PICTURE_ID];
1728
1729        $.cookie(localKey, arViewedCookie, cookieParams);
1730        BX.localStorage.set(localKey, arViewedLocal, 2592000); // 30 days
1731      }
1732    } catch (e) {
1733      console.error(e);
1734    } finally {
1735      // restore $.cookie option
1736      $.cookie.json = bCookieJson;
1737    }
1738  }
1739}
1740
1741if (!funcDefined("initSelects")) {
1742  function initSelects(target) {
1743    if (!$.fn.ikSelect) return;
1744    var iOS = navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false;
1745    if (iOS && !$(".wrapper1.iks-on-ios").length) return;
1746    if ($("#bx-soa-order").length || $("#bx-soa-order-main").length) return;
1747
1748    if (!$(".wrapper1.iks-ignore").length) {
1749      const $target = $(target).find(
1750        ".wrapper1 select:visible:not(.iks-ignore), .jqmWindow select:visible:not(.iks-ignore)"
1751      );
1752
1753      if ($target.length) {
1754        // SELECT STYLING
1755        $target.ikSelect({
1756          syntax:
1757            '<div class="ik_select_link"> \
1758              <span class="ik_select_link_text"></span> \
1759              <div class="trigger"></div> \
1760            </div> \
1761            <div class="ik_select_dropdown"> \
1762              <div class="ik_select_list"> \
1763              </div> \
1764            </div>',
1765          dynamicWidth: true,
1766          ddMaxHeight: 112,
1767          customClass: "common_select",
1768          //equalWidths: true,
1769          onShow: function (inst) {
1770            inst.$dropdown.css("top", parseFloat(inst.$dropdown.css("top")) - 5 + "px");
1771            if (inst.$dropdown.outerWidth() < inst.$link.outerWidth()) {
1772              inst.$dropdown.css("width", inst.$link.outerWidth());
1773            }
1774            if (inst.$dropdown.outerWidth() > inst.$link.outerWidth()) {
1775              inst.$dropdown.css("width", inst.$link.outerWidth());
1776            }
1777            var count = 0,
1778              client_height = 0;
1779            inst.$dropdown.css("left", inst.$link.offset().left);
1780            $(inst.$listInnerUl)
1781              .find("li")
1782              .each(function () {
1783                if (!$(this).hasClass("ik_select_option_disabled")) {
1784                  ++count;
1785                  client_height += $(this).outerHeight();
1786                }
1787              });
1788            if (client_height < 112) {
1789              inst.$listInner.css("height", "auto");
1790            } else {
1791              inst.$listInner.css("height", "112px");
1792            }
1793            inst.$link.addClass("opened");
1794            inst.$listInner.addClass("scroller scrollblock");
1795            if ($(".confirm_region").length) $(".confirm_region").remove();
1796          },
1797          onHide: function (inst) {
1798            inst.$link.removeClass("opened");
1799          },
1800        });
1801        // END OF SELECT STYLING
1802
1803        var timeout;
1804        $(window).on("resize", function () {
1805          ignoreResize.push(true);
1806          clearTimeout(timeout);
1807          timeout = setTimeout(function () {
1808            //$('select:visible').ikSelect('redraw');
1809            var inst = "";
1810            if ((inst = $(".common_select-link.opened + select").ikSelect().data("plugin_ikSelect"))) {
1811              inst.$dropdown.css("left", inst.$link.offset().left + "px");
1812            }
1813          }, 20);
1814          ignoreResize.pop();
1815        });
1816      }
1817    }
1818  }
1819}
1820
1821if (!funcDefined("CheckTopMenuFullCatalogSubmenu")) {
1822  CheckTopMenuFullCatalogSubmenu = function () {
1823    if (window.matchMedia("(max-width: 991px)").matches) return;
1824
1825    if (arAsproOptions["THEME"] && arAsproOptions["THEME"]["MENU_TYPE_VIEW"] != "HOVER") return;
1826
1827    var $menu = $(".left_block .menu_top_block");
1828    if ($menu.length) {
1829      var $wrapmenu = $menu.parents(".wrap_menu");
1830
1831      var wrapMenuWidth = $menu.closest(".wrapper_inner").actual("width");
1832      if (!wrapMenuWidth) wrapMenuWidth = $menu.closest(".wraps").actual("width");
1833
1834      var bCatalogFirst = $menu.hasClass("catalogfirst");
1835      var findMenuLi = $(".left_block .menu_top_block:visible li.full");
1836      var parentSubmenuWidth = $menu.actual("outerWidth");
1837      var wrapMenuLeft = 0;
1838      var wrapMenuRight = 0;
1839
1840      if ($wrapmenu.length) {
1841        wrapMenuWidth = $wrapmenu.actual("outerWidth");
1842        wrapMenuLeft = $wrapmenu.offset().left;
1843        wrapMenuRight = wrapMenuLeft + wrapMenuWidth;
1844      }
1845
1846      if ($(".left_block .catalog_block.menu_top_block").length) {
1847        if ($(".left_block .catalog_block.menu_top_block").is(":visible"))
1848          findMenuLi = $(".left_block .menu_top_block.catalog_block li.full");
1849      }
1850      findMenuLi.each(function () {
1851        var $this = $(this);
1852        var $submenu = $this.find(">.dropdown");
1853
1854        if ($submenu.length) {
1855          // $submenu.css({left: parentSubmenuWidth + 'px', width: (wrapMenuWidth - parentSubmenuWidth) + 'px', 'padding-left': '0px', 'padding-right': '0px', 'opacity': 1});
1856          //$submenu.css({ width: wrapMenuWidth - parentSubmenuWidth + "px" });
1857
1858          if (!isOnceInited && arAsproOptions["THEME"]["MENU_POSITION"] == "TOP") {
1859            $this.on("mouseenter", function () {
1860              $submenu.css("min-height", $this.closest(".dropdown").actual("outerHeight") + "px");
1861            });
1862          }
1863        }
1864      });
1865    }
1866  };
1867}
1868
1869$.fn.getMaxHeights = function (outer, classNull, minHeight) {
1870  var maxHeight = this.map(function (i, e) {
1871    var calc_height = 0;
1872    $(e).css("height", "");
1873
1874    if (outer == true) calc_height = $(e).actual("outerHeight");
1875    else calc_height = $(e).actual("height");
1876
1877    return calc_height;
1878  }).get();
1879  for (var i = 0, c = maxHeight.length; i < c; ++i) {
1880    if (maxHeight[i] % 2) --maxHeight[i];
1881  }
1882  return Math.max.apply(this, maxHeight);
1883};
1884
1885$.fn.equalizeHeights = function (outer, classNull, options) {
1886  var maxHeight = [];
1887  var items = [];
1888
1889  for (var i = 0, itemKey = 0; i < this.length; itemKey++) {
1890    var item = this[itemKey],
1891      _item = $(item),
1892      minus_height = 0,
1893      calc_height = 0;
1894
1895    i++;
1896
1897    if (options.blockNull !== undefined) {
1898      if (options.blockNull.class !== undefined) {
1899        if (_item.hasClass(options.blockNull.class) || _item.closest("." + options.blockNull.class).length) {
1900          continue;
1901        }
1902      }
1903    }
1904
1905    items.push(this[itemKey]);
1906
1907    if (classNull !== false) {
1908      if (!isMobile) {
1909        var nulled = _item.find(classNull);
1910        if (nulled.length) {
1911          minus_height = parseInt(nulled[0].offsetHeight);
1912          //minus_height=parseInt(_item.find(classNull).outerHeight(false));
1913          //minus_height=parseInt(_item.find(classNull).actual('outerHeight'));
1914        }
1915      }
1916    }
1917
1918    if (minus_height) minus_height += 12;
1919
1920    _item.css("height", "");
1921
1922    calc_height = item.offsetHeight - minus_height;
1923
1924    if (options.minHeight !== false) {
1925      if (calc_height < options.minHeight) calc_height += options.minHeight - calc_height;
1926
1927      if (window.matchMedia("(max-width: 520px)").matches) calc_height = 300;
1928
1929      if (window.matchMedia("(max-width: 400px)").matches) calc_height = 200;
1930    }
1931
1932    if (!calc_height) calc_height = 0;
1933
1934    maxHeight.push(calc_height);
1935  }
1936
1937  for (var i = 0, c = maxHeight.length; i < c; ++i) {
1938    if (maxHeight[i] % 2) {
1939      --maxHeight[i];
1940    }
1941  }
1942
1943  var result = $(items).height(Math.max.apply(this, maxHeight));
1944
1945  return result;
1946};
1947
1948$.fn.getFloatWidth = function () {
1949  var width = 0;
1950  if ($(this).length) {
1951    var rect = $(this)[0].getBoundingClientRect();
1952    if (!(width = rect.width)) width = rect.right - rect.left;
1953  }
1954
1955  $(this).data("floatWidth", width);
1956
1957  return width;
1958};
1959
1960function extendDepthObject(target, FromObj) {
1961  var to = Object.assign({}, target);
1962  for (var key in FromObj) {
1963    if (typeof FromObj[key] == "object") {
1964      to[key] = extendDepthObject(to[key], FromObj[key]);
1965    } else {
1966      to[key] = FromObj[key];
1967    }
1968  }
1969
1970  return to;
1971}
1972
1973$.fn.sliceHeight = function (options) {
1974  function _slice(el) {
1975    var arBreakpoints = Object.keys(options.breakpoint);
1976    var resizeOptionsTmp = {};
1977    if (arBreakpoints.length) {
1978      for (var key in arBreakpoints) {
1979        if (window.matchMedia(arBreakpoints[key].toString()).matches) {
1980          resizeOptionsTmp = options.breakpoint[arBreakpoints[key]];
1981        }
1982      }
1983    }
1984
1985    var resizeOptions = extendDepthObject(options, resizeOptionsTmp);
1986
1987    var blockNullClass =
1988      resizeOptions.blockNull !== undefined && resizeOptions.blockNull.class !== undefined
1989        ? resizeOptions.blockNull.class
1990        : false;
1991    var parent =
1992      typeof resizeOptions.row !== "undefined" && resizeOptions.row.length
1993        ? el.first().parents(resizeOptions.row)
1994        : el.first().parents(".items");
1995    var item = "";
1996
1997    if (typeof resizeOptions.item !== "undefined" && resizeOptions.item.length) {
1998      if (blockNullClass) {
1999        $(resizeOptions.item).each(function (i, element) {
2000          _element = $(element);
2001          if (!_element.hasClass(blockNullClass)) {
2002            item = _element;
2003          }
2004        });
2005        if (!item)
2006          // if only ignored blocks
2007          return false;
2008      } else {
2009        item = $(resizeOptions.item).first();
2010      }
2011    } else {
2012      if (el.first().hasClass("item")) {
2013        item = el.first();
2014      } else {
2015        item = el.first().parents(".item");
2016      }
2017    }
2018
2019    if (typeof resizeOptions.autoslicecount == "undefined" || resizeOptions.autoslicecount !== false) {
2020      var elsw = parent.getFloatWidth(),
2021        elw = item.getFloatWidth();
2022      if (!elsw) {
2023        elsw = el.first().parents(".row").getFloatWidth();
2024      }
2025      if (!elw) {
2026        if (typeof resizeOptions.item !== "undefined" && resizeOptions.item.length)
2027          elw = $(resizeOptions.item + ":eq(1)").getFloatWidth()
2028            ? $(resizeOptions.item + ":eq(1)").getFloatWidth()
2029            : $(resizeOptions.item + ":eq(2)").getFloatWidth();
2030        else elw = $(el[1]).getFloatWidth() ? $(el[1]).getFloatWidth() : $(el[2]).getFloatWidth();
2031      }
2032      if (elw && resizeOptions.fixWidth) elw -= resizeOptions.fixWidth;
2033
2034      elw = parseInt(elw * 100) / 100;
2035
2036      if (elsw && elw) {
2037        resizeOptions.slice = Math.floor(elsw / elw);
2038      }
2039    }
2040
2041    if (resizeOptions.customSlice) {
2042      //manual slice count
2043      var bSliceNext = false;
2044      if (resizeOptions.length) {
2045        elw =
2046          typeof resizeOptions.item !== "undefined" && resizeOptions.item.length
2047            ? $(resizeOptions.item).last().getFloatWidth()
2048            : el.last().hasClass("item")
2049            ? el.last().getFloatWidth()
2050            : el.last().parents(".item").getFloatWidth();
2051        if (elw) resizeOptions.sliceNext = Math.floor(elsw / elw);
2052
2053        bSliceNext = true;
2054      }
2055    }
2056
2057    elements = [];
2058    if (resizeOptions.classes !== undefined && resizeOptions.classes.length) {
2059      for (var i = 0; i < resizeOptions.classes.length; i++) {
2060        var items = $(resizeOptions.item).find(resizeOptions.classes[i]);
2061        elements.push(items);
2062      }
2063    }
2064    var elIndex = elements.push(el) - 1;
2065
2066    if (resizeOptions.mobile == true) {
2067      if (window.matchMedia("(max-width: 500px)").matches) {
2068        for (var block = 0; block < elements.length; block++) {
2069          var items = $(elements[block]);
2070          items.css({
2071            "line-height": "",
2072            height: "",
2073          });
2074        }
2075        return;
2076      }
2077    }
2078
2079    if (typeof resizeOptions.typeResize == "undefined" || resizeOptions.typeResize == false) {
2080      if (resizeOptions.slice) {
2081        for (var block = 0; block < elements.length; block++) {
2082          if (resizeOptions.currentRow) {
2083            var itemNumber = el.index(resizeOptions.currentItem);
2084            var rowCount = resizeOptions.slice;
2085            var rowNumber = Math.floor(itemNumber / rowCount);
2086
2087            var items = $(elements[block].slice(rowNumber * rowCount, rowNumber * rowCount + rowCount));
2088            var classNull = block == elIndex ? resizeOptions.classNull : false;
2089            items.css({
2090              "line-height": "",
2091              height: "",
2092            });
2093            items.equalizeHeights(resizeOptions.outer, classNull, resizeOptions);
2094          } else {
2095            for (var i = 0; i < elements[block].length; ) {
2096              if (resizeOptions.customSlice && resizeOptions.sliceNext && bSliceNext && i)
2097                //manual slice count
2098                resizeOptions.slice = resizeOptions.sliceNext;
2099
2100              var slice = resizeOptions.slice;
2101              var items = $(elements[block].slice(i, i + slice));
2102              if (resizeOptions.blockNull !== undefined) {
2103                if (resizeOptions.blockNull.class !== undefined) {
2104                  var counts = 0;
2105                  items.each(function (i, item) {
2106                    var _item = $(item);
2107                    if (
2108                      _item.hasClass(resizeOptions.blockNull.class) ||
2109                      _item.closest("." + resizeOptions.blockNull.class).length
2110                    ) {
2111                      counts++;
2112                    }
2113                  });
2114                }
2115              }
2116              if (counts) {
2117                slice -= (resizeOptions.blockNull.width - 1) * counts;
2118              }
2119
2120              items = $(elements[block].slice(i, i + slice));
2121              if (items) {
2122                var classNull = block == elIndex ? resizeOptions.classNull : false;
2123
2124                items.css({
2125                  "line-height": "",
2126                  height: "",
2127                });
2128                items.equalizeHeights(resizeOptions.outer, classNull, resizeOptions);
2129              }
2130              i += slice || 1;
2131            }
2132          }
2133        }
2134      }
2135      if (resizeOptions.lineheight) {
2136        var lineheightAdd = parseInt(resizeOptions.lineheight);
2137        if (isNaN(lineheightAdd)) {
2138          lineheightAdd = 0;
2139        }
2140        el.each(function () {
2141          $(this).css("line-height", $(this).actual("height") + lineheightAdd + "px");
2142        });
2143      }
2144    }
2145  }
2146  var options = $.extend(
2147    {
2148      slice: null,
2149      sliceNext: null,
2150      outer: false,
2151      lineheight: false,
2152      autoslicecount: true,
2153      classNull: false,
2154      minHeight: false,
2155      row: false,
2156      item: false,
2157      typeResize: false,
2158      typeValue: false,
2159      fixWidth: 0,
2160      resize: true,
2161      mobile: false,
2162      customSlice: false,
2163      breakpoint: {},
2164      classes: [],
2165    },
2166    options
2167  );
2168
2169  var el = $(this);
2170
2171  ignoreResize.push(true);
2172  _slice(el);
2173  ignoreResize.pop();
2174
2175  if (options.resize) {
2176    BX.addCustomEvent("onWindowResize", function (eventdata) {
2177      try {
2178        ignoreResize.push(true);
2179        _slice(el);
2180      } catch (e) {
2181      } finally {
2182        ignoreResize.pop();
2183      }
2184    });
2185  } else {
2186    if (!ignoreResize.length) {
2187      // ignoreResize.push(true);
2188      _slice(el);
2189      // ignoreResize.pop();
2190    }
2191  }
2192};
2193
2194$.fn.sliceHeightNoResize = function (options) {
2195  function _slice(el) {
2196    el.each(function () {
2197      $(this).css("line-height", "");
2198      $(this).css("height", "");
2199    });
2200    if (options.mobile == true) {
2201      if (window.matchMedia("(max-width: 550px)").matches) return;
2202    }
2203    if (typeof options.autoslicecount == "undefined" || options.autoslicecount !== false) {
2204      var elsw =
2205          typeof options.row !== "undefined" && options.row.length
2206            ? el.first().parents(options.row).getFloatWidth()
2207            : el.first().parents(".items").getFloatWidth(),
2208        elw =
2209          typeof options.item !== "undefined" && options.item.length
2210            ? $(options.item).first().getFloatWidth()
2211            : el.first().hasClass("item")
2212            ? el.first().getFloatWidth()
2213            : el.first().parents(".item").getFloatWidth();
2214
2215      if (!elsw) {
2216        elsw = el.first().parents(".row").getFloatWidth();
2217      }
2218      if (elw && options.fixWidth) elw -= options.fixWidth;
2219
2220      if (elsw && elw) {
2221        options.slice = Math.floor(elsw / elw);
2222      }
2223    }
2224    if (options.customSlice) {
2225      //manual slice count
2226      var arBreakpoints = Object.keys(options.breakpoint),
2227        bSliceNext = false;
2228      if (arBreakpoints.length) {
2229        elw =
2230          typeof options.item !== "undefined" && options.item.length
2231            ? $(options.item).last().getFloatWidth()
2232            : el.last().hasClass("item")
2233            ? el.last().getFloatWidth()
2234            : el.last().parents(".item").getFloatWidth();
2235        if (elw) options.sliceNext = Math.floor(elsw / elw);
2236        for (var key in arBreakpoints) {
2237          if (window.matchMedia(arBreakpoints[key].toString()).matches) {
2238            bSliceNext = true;
2239            options.slice = options.breakpoint[arBreakpoints[key]];
2240          }
2241        }
2242      }
2243    }
2244    if (typeof options.typeResize == "undefined" || options.typeResize == false) {
2245      if (options.slice) {
2246        for (var i = 0; i < el.length; i += options.slice) {
2247          if (options.customSlice && options.sliceNext && bSliceNext && i)
2248            //manual slice count
2249            options.slice = options.sliceNext;
2250          $(el.slice(i, i + options.slice)).equalizeHeights(
2251            options.outer,
2252            options.classNull,
2253            options.minHeight,
2254            options.typeResize,
2255            options.typeValue
2256          );
2257        }
2258      }
2259      if (options.lineheight) {
2260        var lineheightAdd = parseInt(options.lineheight);
2261        if (isNaN(lineheightAdd)) {
2262          lineheightAdd = 0;
2263        }
2264        el.each(function () {
2265          $(this).css("line-height", $(this).actual("height") + lineheightAdd + "px");
2266        });
2267      }
2268    }
2269  }
2270  var options = $.extend(
2271    {
2272      slice: null,
2273      sliceNext: null,
2274      outer: false,
2275      lineheight: false,
2276      autoslicecount: true,
2277      classNull: false,
2278      minHeight: false,
2279      row: false,
2280      item: false,
2281      typeResize: false,
2282      typeValue: false,
2283      fixWidth: 0,
2284      resize: true,
2285      mobile: false,
2286      customSlice: false,
2287      breakpoint: {},
2288    },
2289    options
2290  );
2291
2292  var el = $(this);
2293
2294  ignoreResize.push(true);
2295  _slice(el);
2296  ignoreResize.pop();
2297};
2298
2299if (!funcDefined("initHoverBlock")) {
2300  function initHoverBlock(target) {
2301  }
2302}
2303if (!funcDefined("setStatusButton")) {
2304  function setStatusButton() {
2305    if (!funcDefined("setItemButtonStatus")) {
2306      setItemButtonStatus = function (data) {
2307        if (data.BASKET) {
2308          for (var i in data.BASKET) {
2309            var id = data.BASKET[i];
2310            if (typeof id === "number" || typeof id === "string") {
2311              $(".to-cart[data-item=" + id + "]").hide();
2312              $(".counter_block[data-item=" + id + "]")
2313                .closest(".counter_block_inner")
2314                .hide();
2315              $(".counter_block[data-item=" + id + "]").hide();
2316              $(".in-cart[data-item=" + id + "]").show();
2317              $(".in-cart[data-item=" + id + "]")
2318                .closest(".button_block")
2319                .addClass("wide");
2320            }
2321          }
2322        }
2323        if (data.SUBSCRIBE) {
2324          for (var i in data.SUBSCRIBE) {
2325            var id = data.SUBSCRIBE[i];
2326            if (typeof id === "number" || typeof id === "string") {
2327              $(".to-subscribe[data-item=" + id + "]").hide();
2328              $(".in-subscribe[data-item=" + id + "]").show();
2329            }
2330          }
2331        }
2332        if (data.COMPARE) {
2333          for (var i in data.COMPARE) {
2334            var id = data.COMPARE[i];
2335            if (typeof id === "number" || typeof id === "string") {
2336              $(".compare_item.to[data-item=" + id + "]").hide();
2337              $(".compare_item.in[data-item=" + id + "]").show();
2338              if ($(".compare_item[data-item=" + id + "]").find(".value.added").length) {
2339                $(".compare_item[data-item=" + id + "]")
2340                  .find(".value")
2341                  .hide();
2342                $(".compare_item[data-item=" + id + "]")
2343                  .find(".value.added")
2344                  .show();
2345              }
2346            }
2347          }
2348        }
2349
2350        BX.onCustomEvent("onSetItemButtonStatus", []);
2351      };
2352    }
2353    if (!Object.keys(arStatusBasketAspro).length) {
2354      if (typeof arAsproOptions === "undefined") {
2355        var arAsproOptions = {
2356          SITE_DIR: "/",
2357        };
2358        if ($("body").data("site") !== undefined) arAsproOptions["SITE_DIR"] = $("body").data("site");
2359      }
2360      $.ajax({
2361        url: arAsproOptions["SITE_DIR"] + "ajax/getAjaxBasket.php",
2362        type: "POST",
2363        success: function (data) {
2364          arStatusBasketAspro = data;
2365          setItemButtonStatus(arStatusBasketAspro);
2366        },
2367      });
2368    } else setItemButtonStatus(arStatusBasketAspro);
2369  }
2370}
2371
2372if (!funcDefined("onLoadjqm")) {
2373  var onLoadjqm = function (name, hash, requestData, selector, requestTitle, isButton, thButton) {
2374    hash.w.attr('data-jqm-loaded', '1');
2375
2376    if (hash.c.noOverlay === undefined || (hash.c.noOverlay !== undefined && !hash.c.noOverlay)) {
2377      $("body").addClass("jqm-initied");
2378    }
2379    if (window.matchMedia("(min-width: 768px)").matches) {
2380      $("body").addClass("swipeignore");
2381    }
2382
2383    //show password eye
2384    if (hash.w.hasClass("auth_frame")) {
2385      hash.w.find(".form-control:not(.eye-password-ignore) [type=password]").each(function (item) {
2386        $(this).closest(".form-control").addClass("eye-password");
2387      });
2388    }
2389
2390    $.each($(hash.t).get(0).attributes, function (index, attr) {
2391      if (/^data\-autoload\-(.+)$/.test(attr.nodeName)) {
2392        var key = attr.nodeName.match(/^data\-autoload\-(.+)$/)[1];
2393        var el = $('input[data-sid="' + key.toUpperCase() + '"]');
2394        var value = $(hash.t).data("autoload-" + key);
2395        value = String(value).replace(/%99/g, "\\"); // replace symbol \
2396        el.val(BX.util.htmlspecialcharsback(value)).attr("readonly", "readonly");
2397        el.closest(".form-group").addClass("input-filed");
2398        el.attr("title", el.val());
2399      }
2400    });
2401
2402    //show gift block
2403    if (hash.w.hasClass("send_gift_frame")) {
2404      var imgHtml = (priceHtml = propsHtml = "");
2405      if ($(".offers_img a").length) imgHtml = $(".offers_img a").html();
2406      else if ($(".product-detail-gallery__container .first_sku_picture").length)
2407        imgHtml = "<img src=" + $(".product-detail-gallery__container link.first_sku_picture").attr("href") + " />";
2408      else if ($(".product-detail-gallery__container").length)
2409        imgHtml = "<img src=" + $('.product-detail-gallery__container link[itemprop="image"]').attr("href") + " />";
2410
2411      if ($('.product-container *[itemprop="offers"]').length) {
2412        //show price
2413        if ($(".sku-view").length) {
2414          if ($(".prices_block .price").length)
2415            priceHtml = $(".prices_block .cost.prices").html().replace("id", "data-id");
2416        } else {
2417          var mainContainer = $(hash.t).closest(".product-main");
2418          if (mainContainer.find(".prices_block .js_price_wrapper").length) {
2419            if (mainContainer.find(".prices_block .js_price_wrapper .with_matrix").length) {
2420              priceHtml =
2421                '<div class="with_matrix">' +
2422                mainContainer.find(".prices_block .js_price_wrapper .with_matrix").html() +
2423                "</div>";
2424            } else if (mainContainer.find(".prices_block .with_matrix:visible").length) {
2425              priceHtml =
2426                '<div class="with_matrix">' + mainContainer.find(".prices_block .with_matrix").html() + "</div>";
2427            } else if (mainContainer.find(".prices_block .price_group.min").length) {
2428              priceHtml =
2429                '<div class="with_matrix">' + mainContainer.find(".prices_block .price_group.min").html() + "</div>";
2430            } else {
2431              priceHtml =
2432                '<div class="with_matrix">' + mainContainer.find(".prices_block .js_price_wrapper").html() + "</div>";
2433            }
2434          } else if (mainContainer.find(".prices_block .with_matrix").length)
2435            priceHtml =
2436              '<div class="with_matrix">' + mainContainer.find(".prices_block .with_matrix").html() + "</div>";
2437          else if (mainContainer.find(".prices_block .price_group.min").length)
2438            priceHtml = mainContainer.find(".prices_block .price_group.min").html();
2439          else if (mainContainer.find(".prices_block .price_matrix_wrapper").length)
2440            priceHtml = mainContainer.find(".prices_block .price_matrix_wrapper").html();
2441        }
2442      }
2443
2444      if ($(".buy_block .sku_props").length) {
2445        propsHtml = '<div class="props_item">';
2446        $(".buy_block .sku_props .bx_catalog_item_scu > div").each(function () {
2447          var title = $(this).find(".bx_item_section_name > span").html();
2448          var props = "";
2449          var ikSelect = $(this).find(".ik_select_link_text");
2450          if (ikSelect.length) {
2451            props = ikSelect.text();
2452          } else {
2453            var activeSku = $(this).find("ul li.active");
2454            var isPicture = activeSku.find(" > i");
2455            if (isPicture.length && isPicture.attr("title")) {
2456              var propTitle = isPicture.attr("title").split(":");
2457              if (propTitle.length) {
2458                propTitle = propTitle[1].trim();
2459              } else {
2460                propTitle = isPicture.attr("title");
2461              }
2462              props = propTitle;
2463            } else {
2464              props = activeSku.find(" > span").text();
2465            }
2466          }
2467
2468          propsHtml +=
2469            '<div class="prop_item">' +
2470            "<span>" +
2471            title +
2472            // '<span class="val">
2472' +
2473            // props +
2474            // "</span>" +
2475            "</span>" +
2476            "</div>";
2477        });
2478        propsHtml += "</div>";
2479      }
2480      $(
2481        '<div class="custom_block">' +
2482          '<div class="title">' +
2483          BX.message("POPUP_GIFT_TEXT") +
2484          "</div>" +
2485          '<div class="item_block">' +
2486          '<table class="item_list"><tr>' +
2487          '<td class="image">' +
2488          "<div>" +
2489          imgHtml +
2490          "</div>" +
2491          "</td>" +
2492          '<td class="text">' +
2493          '<div class="name">' +
2494          $("h1").text() +
2495          "</div>" +
2496          priceHtml +
2497          propsHtml +
2498          "</td>" +
2499          "</tr></table>" +
2500          "</div>" +
2501          "</div>"
2502      ).prependTo(hash.w.find(".form_body"));
2503    }
2504
2505    if (
2506      arAsproOptions["THEME"]["REGIONALITY_SEARCH_ROW"] == "Y" &&
2507      (hash.w.hasClass("city_chooser_frame") || hash.w.hasClass("city_chooser_small_frame"))
2508    ) {
2509      hash.w.addClass("small_popup_regions");
2510      hash.w.addClass("no_scroll");
2511    }
2512
2513    if (name == "fast_view" && $(".smart-filter-filter").length) {
2514      var navButtons =
2515        '<div class="navigation-wrapper-fast-view">' +
2516        '<div class="fast-view-nav prev colored_theme_hover_bg" data-fast-nav="prev">' +
2517        '<i class="svg left">' +
2518        '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6.969" viewBox="0 0 12 6.969"><path id="Rounded_Rectangle_702_copy_24" data-name="Rounded Rectangle 702 copy 24" class="cls-1" d="M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z" transform="translate(-350 -395.031)"/></svg>' +
2519        "</i>" +
2520        "</div>" +
2521        '<div class="fast-view-nav next colored_theme_hover_bg" data-fast-nav="next">' +
2522        '<i class="svg right">' +
2523        '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6.969" viewBox="0 0 12 6.969"><path id="Rounded_Rectangle_702_copy_24" data-name="Rounded Rectangle 702 copy 24" class="cls-1" d="M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z" transform="translate(-350 -395.031)"/></svg>' +
2524        "</i>" +
2525        "</div>" +
2526        "</div>";
2527
2528      hash.w.closest("#popup_iframe_wrapper").append(navButtons);
2529    }
2530
2531    hash.w.addClass("scrollblock");
2532    hash.w.addClass("show").css({
2533      // 'top': (($(window).height() > hash.w.height()) ? Math.floor(($(window).height() - hash.w.height()) / 2) : 0) + 'px',
2534      // 'margin-left': ($(window).width() > hash.w.outerWidth() ? '-' + hash.w.outerWidth() / 2 + 'px' : '-' + $(window).width() / 2 + 'px'),
2535      opacity: 1,
2536    });
2537
2538    if (hash.c.noOverlay === undefined || (hash.c.noOverlay !== undefined && !hash.c.noOverlay)) {
2539      let scrollbarWidth = window.innerWidth - document.documentElement.clientWidth + 'px';
2540      $("body").css({ "padding-right": scrollbarWidth, overflow: "hidden", height: "100vh" });
2541      hash.w.closest("#popup_iframe_wrapper").css({ "z-index": 3000, display: "flex" });
2542    }
2543
2544    if (hash.c.noOverlay !== undefined && hash.c.noOverlay) {
2545      hash.w.closest("#body_iframe_wrapper").css({ "z-index": 2999, display: "flex" });
2546    }
2547
2548    var eventdata = { action: "loadForm" };
2549    let _this = $(hash.t)[0];
2550    if (thButton) {
2551      _this = thButton;
2552    }
2553    BX.onCustomEvent("onCompleteAction", [eventdata, _this]);
2554
2555    if (typeof requestData == "undefined") {
2556      requestData = "";
2557    }
2558    if (typeof selector == "undefined") {
2559      selector = false;
2560    }
2561
2562    // var width = $("." + name + "_frame").width();
2563    //$('.'+name+'_frame').css('margin-left', '-'+width/2+'px');
2564
2565    if (name == "order-popup-call") {
2566    } else if (name == "order-button") {
2567      $(".order-button_frame")
2568        .find("div[product_name]")
2569        .find("input")
2570        .val(hash.t.title)
2571        .attr("readonly", "readonly")
2572        .css({ overflow: "hidden", "text-overflow": "ellipsis" });
2573    } else if (name == "basket_error") {
2574      $(".basket_error_frame .pop-up-title").text(requestTitle);
2575      $(".basket_error_frame .ajax_text").html(requestData);
2576
2577      if (window.matchMedia("(max-width: 991px)").matches) {
2578        $("body").addClass("all_viewed");
2579      }
2580
2581      initSelects(document);
2582      if (isButton == "Y" && thButton)
2583        $(
2584          "<div class='popup_button_basket_wr'>
2584<span class='popup_button_basket big_btn button' data-item=" +
2585            thButton.data("item") +
2586            "><span class='btn btn-default'>" +
2587            BX.message("ERROR_BASKET_BUTTON") +
2588            "</span></span></div>"
2589        ).insertAfter($(".basket_error_frame .ajax_text"));
2590    } else if (name === "fast_view") {
2591      initSelects(document);
2592    }
2593
2594    $("." + name + "_frame").show();
2595  };
2596}
2597
2598if (!funcDefined("onHidejqm")) {
2599  var onHidejqm = function (name, hash) {
2600    if (hash.w.find(".one_click_buy_result_success").is(":visible") && name == "one_click_buy_basket") {
2601      window.location.href = window.location.href;
2602    }
2603
2604    if ($(".xzoom-source").length) $(".xzoom-source").remove();
2605    if ($(".xzoom-preview").length) $(".xzoom-preview").remove();
2606
2607    // hash.w.css('opacity', 0).hide();
2608    hash.w.animate({ opacity: 0 }, 200, function () {
2609      hash.w.hide();
2610      hash.w.empty();
2611      hash.o.remove();
2612      hash.w.removeClass("show");
2613
2614
2615      if (!hash.w.closest("#popup_iframe_wrapper").find(".jqmOverlay").length) {
2616        $("body").css({ "padding-right": "", overflow: "", height: "" });
2617        hash.w.closest("#popup_iframe_wrapper").css({ "z-index": "", display: "" });
2618      }
2619
2620      if (!hash.w.closest("#body_iframe_wrapper").find(".jqmWindow.show").length) {
2621        hash.w.closest("#body_iframe_wrapper").css({ "z-index": "", display: "" });
2622      }
2623
2624      if (window.matchMedia("(max-width: 991px)").matches) {
2625        $("body").removeClass("all_viewed");
2626      }
2627      if (!$(".jqmOverlay:not(.mobp)").length || $(".jqmOverlay.waiting").length) {
2628        $("body").removeClass("jqm-initied");
2629      }
2630
2631      if (window.matchMedia("(min-width: 768px)").matches) {
2632        $("body").removeClass("swipeignore");
2633      }
2634
2635      if (name == "fast_view") {
2636        $(".fast_view_popup").remove();
2637
2638        var navButtons = hash.w.closest("#popup_iframe_wrapper").find(".navigation-wrapper-fast-view");
2639        navButtons.remove();
2640      }
2641    });
2642
2643    window.b24form = false;
2644
2645    // hide bx calc
2646    let items = document.querySelectorAll(".bx-calendar");
2647    if (items) {
2648      items.forEach(item => {
2649        item.closest(".popup-window").style.display = "none";
2650      });
2651    }
2652  };
2653}
2654
2655$.fn.jqmEx = function () {
2656  // $(this).each(function(){
2657  var _this = $(this);
2658  var name = _this.data("name");
2659
2660  if (name.length && _this.attr("disabled") != "disabled") {
2661    var extClass = "",
2662      paramsStr = "",
2663      trigger = "";
2664
2665    // call counter
2666    if (typeof $.fn.jqmEx.counter === "undefined") {
2667      $.fn.jqmEx.counter = 0;
2668    } else {
2669      ++$.fn.jqmEx.counter;
2670    }
2671
2672    // trigger attrs and params
2673    $.each(_this.get(0).attributes, function (index, attr) {
2674      var attrName = attr.nodeName;
2675      var attrValue = _this.attr(attrName);
2676      if (attrName !== "onclick") {
2677        trigger += "[" + attrName + '="' + attrValue + '"]';
2678      }
2679      if (/^data\-param\-(.+)$/.test(attrName)) {
2680        var key = attrName.match(/^data\-param\-(.+)$/)[1];
2681        paramsStr += key + "=" + attrValue + "&";
2682      }
2683    });
2684
2685    // popup url
2686    var script = arAsproOptions["SITE_DIR"] + "ajax/form.php";
2687    if (name == "auth") {
2688      script += "?" + paramsStr + "auth=Y";
2689    } else {
2690      script += "?" + paramsStr;
2691    }
2692
2693    // ext frame class
2694    if (_this.closest("#fast_view_item").length) {
2695      extClass = "fast_view_popup";
2696    }
2697
2698    // use overlay?
2699    var noOverlay = _this.data("noOverlay") == "Y";
2700
2701    // unique frame to each trigger
2702    if (noOverlay) {
2703      var frame = $(
2704        '<div class="' +
2705          name +
2706          "_frame " +
2707          extClass +
2708          ' jqmWindow popup" data-popup="' +
2709          $.fn.jqmEx.counter +
2710          '"></div>'
2711      ).appendTo("#body_iframe_wrapper");
2712    } else {
2713      var frame = $(
2714        '<div class="' +
2715          name +
2716          "_frame " +
2717          extClass +
2718          ' jqmWindow popup" data-popup="' +
2719          $.fn.jqmEx.counter +
2720          '"></div>'
2721      ).appendTo("#popup_iframe_wrapper");
2722    }
2723
2724    let overlayClass = 'jqmOverlay';
2725    if (_this.data("jqm-overlay-class")) {
2726      overlayClass += " " + _this.data("jqm-overlay-class");
2727    }
2728
2729    loadJQM(() => {
2730      if (frame.attr('data-jqm-loaded') === '1') {
2731        return;
2732      }
2733      frame.jqm({
2734        ajax: script,
2735        trigger: trigger,
2736        noOverlay: noOverlay,
2737        overlayClass: overlayClass,
2738        onLoad: function (hash) {
2739          onLoadjqm(name, hash);
2740        },
2741        onHide: function (hash) {
2742          if (hash.w.hasClass('jqm-lock-close')) {
2743            return false;
2744          }
2745          onHidejqm(name, hash);
2746        },
2747      });
2748      _this.trigger("click");
2749    });
2750  }
2751  // });
2752};
2753
2754window.addEventListener("keydown", function (e) {
2755  if (e.keyCode == 27) {
2756    let jqmPopup = $(".jqm-init.show").last();
2757    if (!jqmPopup.hasClass('jqm-lock-close')) {
2758      jqmPopup.jqmHide();
2759    }
2760
2761    // hide fixed search panel with overlay
2762    if ($(".inline-search-block.show").length) {
2763      $(".inline-search-block").toggleClass("show");
2764      $(".jqmOverlay.search").detach();
2765    }
2766
2767    // hide already visible search results
2768    $(".title-search-result").hide();
2769
2770    // unfocus title.search input
2771    $(".search .search-input").trigger("blur");
2772
2773    $(".mega_fixed_menu").fadeOut(animationTime);
2774  }
2775});
2776
2777if (!funcDefined("scroll_block")) {
2778  function scroll_block(block, clickedItem) {
2779    if (block.length) {
2780      if (clickedItem !== undefined && clickedItem.length) {
2781        clickedItem.trigger("click");
2782      } else {
2783        $(".prices_tab").addClass("active").siblings().removeClass("active");
2784        if ($(".prices_tab .opener").length && !$(".prices_tab .opener .opened").length) {
2785          let item = $(".prices_tab .opener").first();
2786          item.find(".opener_icon").addClass("opened");
2787          item.parents("tr").addClass("nb");
2788          item.parents("tr").next(".offer_stores").find(".stores_block_wrap").slideDown(200);
2789        }
2790      }
2791      let topPos = block.offset().top,
2792        headerOffsetTop = $("#headerfixed").lenght ? $("#headerfixed").outerHeight(true, true) : 0;
2793
2794      let $tabFixed = document.querySelector(".product-item-detail-tabs-container-fixed");
2795      if ($tabFixed) {
2796        topPos -= $tabFixed.offsetHeight;
2797      }
2798      $("html,body").animate({ scrollTop: topPos - headerOffsetTop }, 150);
2799    }
2800  }
2801}
2802
2803if (!funcDefined("jqmEd")) {
2804  var jqmEd = function (name, form_id, open_trigger, requestData, selector, requestTitle, isButton, thButton) {
2805    if (typeof requestData == "undefined") {
2806      requestData = "";
2807    }
2808    if (typeof selector == "undefined") {
2809      selector = false;
2810    }
2811    $("body #popup_iframe_wrapper")
2812      .find("." + name + "_frame")
2813      .remove();
2814    $("body #popup_iframe_wrapper").append('<div class="' + name + '_frame jqmWindow popup"></div>');
2815
2816    loadJQM(() => {
2817      if (typeof open_trigger == "undefined") {
2818        $("." + name + "_frame").jqm({
2819          trigger: "." + name + "_frame.popup",
2820          onHide: function (hash) {
2821            onHidejqm(name, hash);
2822          },
2823          onLoad: function (hash) {
2824            onLoadjqm(name, hash, requestData, selector);
2825          },
2826          ajax:
2827            arAsproOptions["SITE_DIR"] +
2828            "ajax/form.php?form_id=" +
2829            form_id +
2830            (requestData.length ? "&" + requestData : ""),
2831        });
2832      } else {
2833        if (name == "enter") {
2834          $("." + name + "_frame").jqm({
2835            trigger: open_trigger,
2836            onHide: function (hash) {
2837              onHidejqm(name, hash);
2838            },
2839            onLoad: function (hash) {
2840              onLoadjqm(name, hash, requestData, selector);
2841            },
2842            ajax: arAsproOptions["SITE_DIR"] + "ajax/auth.php",
2843          });
2844        } else if (name == "basket_error") {
2845          $("." + name + "_frame").jqm({
2846            trigger: open_trigger,
2847            onHide: function (hash) {
2848              onHidejqm(name, hash);
2849            },
2850            onLoad: function (hash) {
2851              onLoadjqm(name, hash, requestData, selector, requestTitle, isButton, thButton);
2852            },
2853            ajax: arAsproOptions["SITE_DIR"] + "ajax/basket_error.php",
2854          });
2855        } else {
2856          $("." + name + "_frame").jqm({
2857            trigger: open_trigger,
2858            onHide: function (hash) {
2859              onHidejqm(name, hash);
2860            },
2861            onLoad: function (hash) {
2862              onLoadjqm(name, hash, requestData, selector);
2863            },
2864            ajax:
2865              arAsproOptions["SITE_DIR"] +
2866              "ajax/form.php?form_id=" +
2867              form_id +
2868              (requestData.length ? "&" + requestData : ""),
2869          });
2870        }
2871        $(open_trigger).dblclick(function () {
2872          return false;
2873        });
2874      }
2875
2876      $(open_trigger).click();
2877      $(open_trigger).remove();
2878    });
2879    return true;
2880  };
2881}
2882
2883if (!funcDefined("replaceBasketPopup")) {
2884  function replaceBasketPopup(hash) {
2885    if (typeof hash != "undefined") {
2886      hash.w.hide();
2887      hash.o.hide();
2888    }
2889  }
2890}
2891
2892if (!funcDefined("waitLayer")) {
2893  function waitLayer(delay, callback) {
2894    if (typeof dataLayer !== "undefined" && typeof callback === "function") {
2895      callback();
2896    } else {
2897      setTimeout(function () {
2898        waitLayer(delay, callback);
2899      }, delay);
2900    }
2901  }
2902}
2903
2904if (!funcDefined("checkCounters")) {
2905  function checkCounters(name) {
2906    if (typeof name !== "undefined") {
2907      if (
2908        name == "google" &&
2909        arAsproOptions["COUNTERS"]["GOOGLE_ECOMERCE"] == "Y" &&
2910        arAsproOptions["COUNTERS"]["GOOGLE_COUNTER"] > 0
2911      ) {
2912        return true;
2913      } else if (
2914        name == "yandex" &&
2915        arAsproOptions["COUNTERS"]["YANDEX_ECOMERCE"] == "Y" &&
2916        arAsproOptions["COUNTERS"]["YANDEX_COUNTER"] > 0
2917      ) {
2918        return true;
2919      } else {
2920        return false;
2921      }
2922    } else if (
2923      (arAsproOptions["COUNTERS"]["YANDEX_ECOMERCE"] == "Y" && arAsproOptions["COUNTERS"]["YANDEX_COUNTER"] > 0) ||
2924      (arAsproOptions["COUNTERS"]["GOOGLE_ECOMERCE"] == "Y" && arAsproOptions["COUNTERS"]["GOOGLE_COUNTER"] > 0)
2925    ) {
2926      return true;
2927    } else {
2928      return false;
2929    }
2930  }
2931}
2932
2933if (!funcDefined("addBasketCounter")) {
2934  function addBasketCounter(id) {
2935    if (arAsproOptions["COUNTERS"]["USE_BASKET_GOALS"] !== "N") {
2936      var eventdata = { goal: "goal_basket_add", params: { id: id } };
2937      BX.onCustomEvent("onCounterGoals", [eventdata]);
2938    }
2939    if (checkCounters()) {
2940      $.ajax({
2941        url: arAsproOptions["SITE_DIR"] + "ajax/goals.php",
2942        dataType: "json",
2943        type: "POST",
2944        data: { ID: id },
2945        success: function (item) {
2946          if (!!item && !!item.ID) {
2947            let ecommerce = {
2948              items: [
2949                {
2950                  item_name: item.NAME, // Name or ID is required.
2951                  item_id: item.ID,
2952                  price: parseFloat(item.PRICE),
2953                  item_brand: item.BRAND,
2954                  item_category: item.CATEGORY,
2955                  item_list_name: "List Results",
2956                  item_list_id: item.IBLOCK_SECTION_ID,
2957                  affiliation: item.SHOP_NAME,
2958                  index: 1,
2959                  quantity: parseFloat(item.QUANTITY),
2960                },
2961              ],
2962            };
2963            if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") {
2964              ecommerce = {
2965                currencyCode: item.CURRENCY,
2966                add: {
2967                  products: [
2968                    {
2969                      id: item.ID,
2970                      name: item.NAME,
2971                      price: parseFloat(item.PRICE),
2972                      brand: item.BRAND,
2973                      category: item.CATEGORY,
2974                      quantity: parseFloat(item.QUANTITY),
2975                    },
2976                  ],
2977                },
2978              };
2979            }
2980            waitLayer(100, function () {
2981              dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
2982              dataLayer.push({
2983                // event: 'add_to_cart',
2984                event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["ADD2BASKET"],
2985                currency: item.CURRENCY,
2986                value: parseFloat(item.PRICE),
2987                ecommerce: ecommerce,
2988              });
2989            });
2990          }
2991        },
2992      });
2993    }
2994  }
2995}
2996
2997if (!funcDefined("purchaseCounter")) {
2998  function purchaseCounter(order_id, type, callback) {
2999    if (checkCounters()) {
3000      $.ajax({
3001        url: arAsproOptions["SITE_DIR"] + "ajax/goals.php",
3002        dataType: "json",
3003        type: "POST",
3004        data: { ORDER_ID: order_id, TYPE: type },
3005        success: function (order) {
3006          var products = [];
3007          const items = [];
3008          if (order.ITEMS) {
3009            for (var i in order.ITEMS) {
3010              products.push({
3011                id: order.ITEMS[i].ID,
3012                sku: order.ITEMS[i].ID,
3013                name: order.ITEMS[i].NAME,
3014                price: order.ITEMS[i].PRICE,
3015                brand: order.ITEMS[i].BRAND,
3016                category: order.ITEMS[i].CATEGORY,
3017                quantity: order.ITEMS[i].QUANTITY,
3018              });
3019              items.push({
3020                item_id: order.ITEMS[i].ID,
3021                item_name: order.ITEMS[i].NAME,
3022                price: parseFloat(order.ITEMS[i].PRICE),
3023                item_brand: order.ITEMS[i].BRAND,
3024                item_category: order.ITEMS[i].CATEGORY,
3025                affiliation: order.SHOP_NAME,
3026                quantity: parseFloat(order.ITEMS[i].QUANTITY),
3027              });
3028            }
3029          }
3030          if (order.ID) {
3031            let ecommerce = {
3032              transaction_id: order.ACCOUNT_NUMBER,
3033              affiliation: order.SHOP_NAME,
3034              value: order.PRICE,
3035              tax: order.TAX_VALUE,
3036              shipping: order.PRICE_DELIVERY,
3037              currency: order.CURRENCY,
3038              items: items,
3039            };
3040            if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") {
3041              ecommerce = {
3042                purchase: {
3043                  actionField: {
3044                    id: order.ACCOUNT_NUMBER,
3045                    shipping: order.PRICE_DELIVERY,
3046                    tax: order.TAX_VALUE,
3047                    list: type,
3048                    revenue: order.PRICE,
3049                  },
3050                  products: products,
3051                },
3052              };
3053            }
3054            waitLayer(100, function () {
3055              dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
3056              dataLayer.push({
3057                event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["PURCHASE"],
3058                ecommerce: ecommerce,
3059              });
3060
3061              if (typeof callback !== "undefined") {
3062                callback(ecommerce);
3063              }
3064            });
3065          } else {
3066            if (typeof callback !== "undefined") {
3067              callback();
3068            }
3069          }
3070        },
3071        error: function () {
3072          if (typeof callback !== "undefined") {
3073            callback();
3074          }
3075        },
3076      });
3077    }
3078  }
3079}
3080
3081if (!funcDefined("viewItemCounter")) {
3082  function viewItemCounter(id, price_id) {
3083    if (checkCounters()) {
3084      $.ajax({
3085        url: arAsproOptions["SITE_DIR"] + "ajax/goals.php",
3086        dataType: "json",
3087        type: "POST",
3088        data: { PRODUCT_ID: id, PRICE_ID: price_id },
3089        success: function (item) {
3090          if (item.ID) {
3091            let ecommerce = {
3092              items: [
3093                {
3094                  item_name: item.NAME, // Name or ID is required.
3095                  item_id: item.ID,
3096                  price: parseFloat(item.PRICE),
3097                  item_brand: item.BRAND,
3098                  item_category: item.CATEGORY,
3099                  item_list_name: "List Results",
3100                  item_list_id: item.IBLOCK_SECTION_ID,
3101                  affiliation: item.SHOP_NAME,
3102                  index: 1,
3103                  quantity: parseFloat(item.QUANTITY),
3104                },
3105              ],
3106            };
3107            if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") {
3108              ecommerce = {
3109                detail: {
3110                  products: [
3111                    {
3112                      id: item.ID,
3113                      name: item.NAME,
3114                      price: parseFloat(item.PRICE),
3115                      brand: item.BRAND,
3116                      category: item.CATEGORY,
3117                    },
3118                  ],
3119                },
3120              };
3121            }
3122            waitLayer(100, function () {
3123              dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
3124              dataLayer.push({
3125                event: "view_item",
3126                currency: item.CURRENCY,
3127                value: parseFloat(item.PRICE),
3128                ecommerce: ecommerce,
3129              });
3130            });
3131          }
3132        },
3133      });
3134    }
3135  }
3136}
3137
3138if (!funcDefined("checkoutCounter")) {
3139  function checkoutCounter(step, option, callback) {
3140    if (checkCounters("google")) {
3141      $.ajax({
3142        url: arAsproOptions["SITE_DIR"] + "ajax/goals.php",
3143        dataType: "json",
3144        type: "POST",
3145        data: { BASKET: "Y" },
3146        success: function (basket) {
3147          var products = [];
3148          const items = [];
3149          let summ = 0;
3150          let currency = "RUB";
3151          if (basket.ITEMS) {
3152            for (var i in basket.ITEMS) {
3153              products.push({
3154                id: basket.ITEMS[i].ID,
3155                name: basket.ITEMS[i].NAME,
3156                price: basket.ITEMS[i].PRICE,
3157                brand: basket.ITEMS[i].BRAND,
3158                category: basket.ITEMS[i].CATEGORY,
3159                quantity: basket.ITEMS[i].QUANTITY,
3160              });
3161              items.push({
3162                item_id: basket.ITEMS[i].ID,
3163                item_name: basket.ITEMS[i].NAME,
3164                price: parseFloat(basket.ITEMS[i].PRICE),
3165                item_brand: basket.ITEMS[i].BRAND,
3166                item_category: basket.ITEMS[i].CATEGORY,
3167                affiliation: basket.SHOP_NAME,
3168                quantity: parseFloat(basket.ITEMS[i].QUANTITY),
3169              });
3170              summ += basket.ITEMS[i].PRICE;
3171              currency = basket.ITEMS[i].CURRENCY;
3172            }
3173          }
3174          if (products) {
3175            let ecommerce = {
3176              items: items,
3177            };
3178            if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") {
3179              ecommerce = {
3180                checkout: {
3181                  actionField: {
3182                    step: step,
3183                    option: option,
3184                  },
3185                  products: products,
3186                },
3187              };
3188            }
3189            waitLayer(100, function () {
3190              dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
3191              dataLayer.push({
3192                event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["CHECKOUT_ORDER"],
3193                currency: currency,
3194                value: parseFloat(summ),
3195                ecommerce: ecommerce,
3196              });
3197              if (typeof callback !== "undefined" && typeof callback === "function") {
3198                callback();
3199              }
3200            });
3201          }
3202        },
3203      });
3204    }
3205  }
3206}
3207
3208if (!funcDefined("delFromBasketCounter")) {
3209  function delFromBasketCounter(id, callback) {
3210    if (checkCounters()) {
3211      $.ajax({
3212        url: arAsproOptions["SITE_DIR"] + "ajax/goals.php",
3213        dataType: "json",
3214        type: "POST",
3215        data: { ID: id },
3216        success: function (item) {
3217          if (item.ID) {
3218            let ecommerce = {
3219              items: [
3220                {
3221                  item_name: item.NAME, // Name or ID is required.
3222                  item_id: item.ID,
3223                  price: parseFloat(item.PRICE),
3224                  item_brand: item.BRAND,
3225                  item_category: item.CATEGORY,
3226                  affiliation: item.SHOP_NAME,
3227                  item_list_name: "List Results",
3228                },
3229              ],
3230            };
3231            if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") {
3232              ecommerce = {
3233                remove: {
3234                  products: [
3235                    {
3236                      id: item.ID,
3237                      name: item.NAME,
3238                      category: item.CATEGORY,
3239                    },
3240                  ],
3241                },
3242              };
3243            }
3244            waitLayer(100, function () {
3245              dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
3246              dataLayer.push({
3247                event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["REMOVE_BASKET"],
3248                currency: item.CURRENCY,
3249                value: parseFloat(item.PRICE),
3250                ecommerce: ecommerce,
3251              });
3252              if (typeof callback == "function") {
3253                callback();
3254              }
3255            });
3256          }
3257        },
3258      });
3259    }
3260  }
3261}
3262
3263if (!funcDefined("setHeightCompany")) {
3264  function setHeightCompany() {
3265    $(".md-50.img").height($(".md-50.big").outerHeight() - 35);
3266  }
3267}
3268
3269if (!funcDefined("initSly")) {
3270  function initSly() {
3271  }
3272}
3273
3274if (!funcDefined("createTableCompare")) {
3275  function createTableCompare(originalTable, appendDiv, cloneTable) {
3276    try {
3277      var clone = originalTable.clone().removeAttr("id").addClass("clone");
3278      if (cloneTable.length) {
3279        cloneTable.remove();
3280        appendDiv.html("");
3281        appendDiv.html(clone);
3282      } else {
3283        appendDiv.append(clone);
3284      }
3285    } catch (e) {
3286    } finally {
3287    }
3288  }
3289}
3290
3291if (!funcDefined("fillBasketPropsExt")) {
3292  fillBasketPropsExt = function (that, prop_code, basket_prop_div) {
3293    var i = 0,
3294      propCollection = null,
3295      foundValues = false,
3296      basketParams = {},
3297      obBasketProps = null;
3298
3299    obBasketProps = BX(basket_prop_div);
3300    if (!obBasketProps && that.closest(".item").find(".basket_props_block").length && that.data("offers") !== "Y")
3301      obBasketProps = that.closest(".item").find(".basket_props_block")[0];
3302
3303    if (!!obBasketProps) {
3304      propCollection = obBasketProps.getElementsByTagName("select");
3305      if (!!propCollection && !!propCollection.length) {
3306        for (i = 0; i < propCollection.length; i++) {
3307          if (!propCollection[i].disabled) {
3308            switch (propCollection[i].type.toLowerCase()) {
3309              case "select-one":
3310                basketParams[propCollection[i].name] = propCollection[i].value;
3311                foundValues = true;
3312                break;
3313              default:
3314                break;
3315            }
3316          }
3317        }
3318      }
3319      propCollection = obBasketProps.getElementsByTagName("input");
3320      if (!!propCollection && !!propCollection.length) {
3321        for (i = 0; i < propCollection.length; i++) {
3322          if (!propCollection[i].disabled) {
3323            switch (propCollection[i].type.toLowerCase()) {
3324              case "hidden":
3325                basketParams[propCollection[i].name] = propCollection[i].value;
3326                foundValues = true;
3327                break;
3328              case "radio":
3329                if (propCollection[i].checked) {
3330                  basketParams[propCollection[i].name] = propCollection[i].value;
3331                  foundValues = true;
3332                }
3333                break;
3334              default:
3335                break;
3336            }
3337          }
3338        }
3339      }
3340    }
3341    if (!foundValues) {
3342      basketParams[prop_code] = [];
3343      basketParams[prop_code][0] = 0;
3344    }
3345    return basketParams;
3346  };
3347}
3348if (!funcDefined("showBasketError")) {
3349  showBasketError = function (mess, title, addButton, th, callback) {
3350    var title_set = title ? title : BX.message("ERROR_BASKET_TITLE"),
3351      isButton = "N",
3352      thButton = "";
3353    if (typeof addButton !== undefined) {
3354      isButton = "Y";
3355    }
3356    if (typeof th !== undefined) {
3357      thButton = th;
3358    }
3359    $("body").append("<span class='add-error-bakset' style='display:none;'></span>");
3360    jqmEd("basket_error", "error-bakset", ".add-error-bakset", mess, this, title_set, isButton, thButton);
3361
3362    if (typeof callback === "function") {
3363      callback();
3364    }
3365  };
3366}
3367
3368CheckTopVisibleMenu = function (that) {
3369  var dropdownMenu = $(".dropdown-menu:visible");
3370  if (that !== undefined) {
3371    dropdownMenu.push(that);
3372  }
3373
3374  if (dropdownMenu.length) {
3375    dropdownMenu.each(function (i, el) {
3376      var dropdownMenuCurrent = $(el);
3377      dropdownMenuCurrent.find("a").css("white-space", "");
3378      dropdownMenuCurrent.css("left", "");
3379      dropdownMenuCurrent.css("right", "");
3380      dropdownMenuCurrent.removeClass("toright");
3381
3382      var dropdownMenuCurrent_left = dropdownMenuCurrent.offset().left;
3383
3384      if (typeof dropdownMenuCurrent_left != "undefined") {
3385        var menu = dropdownMenuCurrent.parents(".mega-menu");
3386        if (!menu.length) menu = dropdownMenuCurrent.closest(".logo-row");
3387        var menu_width = menu.outerWidth();
3388        var menu_left = menu.offset().left;
3389        var menu_right = menu_left + menu_width;
3390        var isToRight = dropdownMenuCurrent.parents(".toright").length > 0;
3391        var parentsdropdownMenuCurrents = dropdownMenuCurrent.parents(".dropdown-menu");
3392        var isHasParentdropdownMenuCurrent = parentsdropdownMenuCurrents.length > 0;
3393        if (isHasParentdropdownMenuCurrent) {
3394          var parentdropdownMenuCurrent_width = parentsdropdownMenuCurrents.first().outerWidth();
3395          var parentdropdownMenuCurrent_left = parentsdropdownMenuCurrents.first().offset().left;
3396          var parentdropdownMenuCurrent_right = parentdropdownMenuCurrent_width + parentdropdownMenuCurrent_left;
3397        }
3398
3399        if (parentdropdownMenuCurrent_right + dropdownMenuCurrent.outerWidth() > menu_right) {
3400          dropdownMenuCurrent.find("a").css("white-space", "normal");
3401        }
3402
3403        var dropdownMenuCurrent_width = dropdownMenuCurrent.outerWidth();
3404        var dropdownMenuCurrent_right = dropdownMenuCurrent_left + dropdownMenuCurrent_width;
3405
3406        if (dropdownMenuCurrent_right > menu_right || isToRight) {
3407          var addleft = 0;
3408          addleft = menu_right - dropdownMenuCurrent_right;
3409          if (isHasParentdropdownMenuCurrent || isToRight) {
3410            dropdownMenuCurrent.css("left", "auto");
3411            dropdownMenuCurrent.css("right", "100%");
3412            dropdownMenuCurrent.addClass("toright");
3413          } else {
3414            var dropdownMenuCurrent_curLeft = parseInt(dropdownMenuCurrent.css("left"));
3415            dropdownMenuCurrent.css("left", dropdownMenuCurrent_curLeft + addleft + "px");
3416          }
3417        }
3418      }
3419    });
3420  }
3421};
3422
3423if (!funcDefined("isRealValue")) {
3424  function isRealValue(obj) {
3425    return obj && obj !== "null" && obj !== "undefined";
3426  }
3427}
3428
3429if (!funcDefined("rightScroll")) {
3430  function rightScroll(prop, id) {
3431    var el = BX("prop_" + prop + "_" + id);
3432    if (el) {
3433      var curVal = parseInt(el.style.marginLeft);
3434      if (curVal >= 0) el.style.marginLeft = curVal - 20 + "%";
3435    }
3436  }
3437}
3438
3439if (!funcDefined("leftScroll")) {
3440  function leftScroll(prop, id) {
3441    var el = BX("prop_" + prop + "_" + id);
3442    if (el) {
3443      var curVal = parseInt(el.style.marginLeft);
3444      if (curVal < 0) el.style.marginLeft = curVal + 20 + "%";
3445    }
3446  }
3447}
3448
3449if (!funcDefined("InitOrderCustom")) {
3450  InitOrderCustom = function () {
3451    $(".ps_logo img").wrap('<div class="image"></div>');
3452
3453    $("#bx-soa-order .radio-inline").each(function () {
3454      if ($(this).find("input").attr("checked") == "checked") {
3455        $(this).addClass("checked");
3456      }
3457    });
3458
3459    $("#bx-soa-order .checkbox input[type=checkbox]").each(function () {
3460      if ($(this).attr("checked") == "checked") $(this).parent().addClass("checked");
3461    });
3462
3463    $("#bx-soa-order .bx-authform-starrequired").each(function () {
3464      var html = $(this).html();
3465      $(this)
3466        .closest("label")
3467        .append('<span class="bx-authform-starrequired"> ' + html + "</span>");
3468      $(this).detach();
3469    });
3470    $(".bx_ordercart_coupon").each(function () {
3471      if ($(this).find(".bad").length) $(this).addClass("bad");
3472      else if ($(this).find(".good").length) $(this).addClass("good");
3473    });
3474  };
3475}
3476
3477if (!funcDefined("InitLabelAnimation")) {
3478  InitLabelAnimation = function (className) {
3479    // Fix order labels
3480    if (!$(className).length) {
3481      return;
3482    }
3483    $(className)
3484      .find(".form-group")
3485      .each(function () {
3486        if (
3487          $(this).find("input[type=text], textarea").length &&
3488          !$(this).find(".dropdown-block").length &&
3489          $(this).find("input[type=text], textarea").val() != ""
3490        ) {
3491          $(this).addClass("value_y");
3492        }
3493      });
3494
3495    $(document).on("click", className + " .form-group:not(.bx-soa-pp-field) label", function () {
3496      $(this).parent().find("input, textarea").focus();
3497    });
3498
3499    $(document).on(
3500      "focusout",
3501      className +
3502        " .form-group:not(.bx-soa-pp-field) input, " +
3503        className +
3504        " .form-group:not(.bx-soa-pp-field) textarea",
3505      function () {
3506        var value = $(this).val();
3507        if (
3508          value != "" &&
3509          !$(this).closest(".form-group").find(".dropdown-block").length &&
3510          !$(this).closest(".form-group").find("#profile_change").length
3511        ) {
3512          $(this).closest(".form-group").addClass("value_y");
3513        } else {
3514          $(this).closest(".form-group").removeClass("value_y");
3515        }
3516      }
3517    );
3518
3519    $(document).on(
3520      "focus",
3521      className +
3522        " .form-group:not(.bx-soa-pp-field) input, " +
3523        className +
3524        " .form-group:not(.bx-soa-pp-field) textarea",
3525      function () {
3526        if (
3527          !$(this).closest(".form-group").find(".dropdown-block").length &&
3528          !$(this).closest(".form-group").find("#profile_change").length &&
3529          !$(this).closest(".form-group").find("[name=PERSON_TYPE_OLD]").length
3530        ) {
3531          $(this).closest(".form-group").addClass("value_y");
3532        }
3533      }
3534    );
3535  };
3536}
3537
3538function loadScrollTabs(selector, callback) {
3539  $(selector).iAppear(() => {
3540    BX.loadScript([arAsproOptions["SITE_TEMPLATE_PATH"] + "/js/scrollTabs.js?v=1"], function () {
3541      callback();
3542    });
3543  });
3544}
3545
3546checkCaptchaWidth = function () {
3547  $(".captcha-row").each(function () {
3548    var width = $(this).actual("width");
3549    if ($(this).hasClass("b")) {
3550      if (width > 320) {
3551        $(this).removeClass("b");
3552      }
3553    } else {
3554      if (width <= 320) {
3555        $(this).addClass("b");
3556      }
3557    }
3558  });
3559};
3560
3561checkFormWidth = function () {
3562  $(".form .form_left").each(function () {
3563    var form = $(this).parents(".form");
3564    var width = form.actual("width");
3565    if (form.hasClass("b")) {
3566      if (width > 417) {
3567        form.removeClass("b");
3568      }
3569    } else {
3570      if (width <= 417) {
3571        form.addClass("b");
3572      }
3573    }
3574  });
3575};
3576
3577checkFormControlWidth = function () {
3578  $(".form-control").each(function () {
3579    var width = $(this).actual("width");
3580    var labelWidth = $(this).find("label:not(.error) > span").actual("width");
3581    var errorWidth = $(this).find("label.error").actual("width");
3582    if (errorWidth > 0) {
3583      if ($(this).hasClass("h")) {
3584        if (width > labelWidth + errorWidth + 5) {
3585          $(this).removeClass("h");
3586        }
3587      } else {
3588        if (width <= labelWidth + errorWidth + 5) {
3589          $(this).addClass("h");
3590        }
3591      }
3592    } else {
3593      $(this).removeClass("h");
3594    }
3595  });
3596};
3597
3598scrollToTop = function () {
3599  if (arAsproOptions["THEME"]["SCROLLTOTOP_TYPE"] !== "NONE") {
3600    var _isScrolling = false;
3601    // Append Button
3602    $("body").append(
3603      $("<a />")
3604        .addClass(
3605          "scroll-to-top " +
3606            arAsproOptions["THEME"]["SCROLLTOTOP_TYPE"] +
3607            " " +
3608            arAsproOptions["THEME"]["SCROLLTOTOP_POSITION"]
3609        )
3610        .attr({ href: "#", id: "scrollToTop" })
3611    );
3612
3613    if (arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_BOTTOM"]) {
3614      $("#scrollToTop").css("bottom", +arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_BOTTOM"] + "px");
3615    }
3616
3617    if (arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_RIGHT"]) {
3618      $("#scrollToTop").css("right", +arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_RIGHT"] + "px");
3619    }
3620
3621    $("#scrollToTop").click(function (e) {
3622      e.preventDefault();
3623      $("body, html").animate({ scrollTop: 0 }, 500);
3624      return false;
3625    });
3626    // Show/Hide Button on Window Scroll event.
3627    $(window).scroll(function () {
3628      if (!_isScrolling) {
3629        _isScrolling = true;
3630        if (documentScrollTopLast > 150) {
3631          $("#scrollToTop").stop(true, true).addClass("visible");
3632          _isScrolling = false;
3633        } else {
3634          $("#scrollToTop").stop(true, true).removeClass("visible");
3635          _isScrolling = false;
3636        }
3637        checkScrollToTop();
3638      }
3639    });
3640  }
3641};
3642
3643checkScrollToTop = function () {
3644  if (arAsproOptions["THEME"] && arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_BOTTOM"])
3645    var bottom = +arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_BOTTOM"];
3646  else var bottom = 55;
3647
3648  var scrollVal = documentScrollTopLast,
3649    windowHeight = document.documentElement.offsetHeight,
3650    footerOffset = 0;
3651  if ($("footer").length) footerOffset = $("footer .footer-inner").offset().top;
3652
3653  if (arAsproOptions["THEME"] && arAsproOptions["THEME"]["SCROLLTOTOP_POSITION"] == "CONTENT") {
3654    warpperWidth = $("body > .wrapper > .wrapper_inner").width();
3655    $("#scrollToTop").css("margin-left", Math.ceil(warpperWidth / 2) + 23);
3656  }
3657
3658  if (scrollVal + windowHeight > footerOffset) {
3659    $("#scrollToTop").css("bottom", Math.round(bottom + scrollVal + windowHeight - footerOffset) + "px");
3660  } else if (parseInt($("#scrollToTop").css("bottom")) > bottom) {
3661    $("#scrollToTop").css("bottom", Math.round(bottom));
3662  }
3663};
3664
3665CheckObjectsSizes = function () {
3666  $(".container iframe,.container object,.container video").each(function () {
3667    var height_attr = $(this).attr("height");
3668    var width_attr = $(this).attr("width");
3669    if (height_attr && width_attr) {
3670      $(this).css("height", ($(this).outerWidth() * height_attr) / width_attr);
3671    }
3672  });
3673};
3674
3675if (!funcDefined("reloadTopBasket")) {
3676  var reloadTopBasket = function reloadTopBasket(action, basketWindow, speed, delay, slideDown, item, sync) {
3677    var obj = {
3678      PARAMS: $("#top_basket_params").val(),
3679      ACTION: action,
3680    };
3681    if (typeof item !== "undefined" && item) {
3682      obj.delete_top_item = "Y";
3683      obj.delete_top_item_id = item.data("id");
3684    }
3685    // $.post( arAsproOptions['SITE_DIR']+"ajax/show_basket_popup.php", obj, $.proxy(function( data ){
3686    $.post(
3687      arAsproOptions["SITE_DIR"] + "ajax/show_basket_actual.php",
3688      obj,
3689      $.proxy(function (data) {
3690        $(basketWindow).html(data);
3691
3692        //getActualBasket('', '', sync);
3693
3694        getActualBasket("", "Compare", sync); //need for actual compare count when do opt action
3695
3696        var eventdata = { action: "loadBasket" };
3697        BX.onCustomEvent("onCompleteAction", [eventdata]);
3698      })
3699    );
3700  };
3701}
3702
3703CheckTabActive = function () {
3704  if (typeof clicked_tab && clicked_tab) {
3705    if (window.matchMedia("(min-width: 768px)").matches) {
3706      clicked_tab--;
3707      $(".nav.nav-tabs li").each(function () {
3708        if ($(this).index() == clicked_tab) $(this).addClass("active");
3709      });
3710      // $('.nav.nav-tabs li:eq('+clicked_tab+')').addClass('active');
3711      $(".catalog_detail .tab-content .tab-pane:eq(" + clicked_tab + ")").addClass("active");
3712      $(".catalog_detail .tab-content .tab-pane .title-tab-heading").next().removeAttr("style");
3713      clicked_tab = 0;
3714    }
3715  }
3716};
3717
3718/* countdown start */
3719if (!funcDefined("initCountdown")) {
3720  var initCountdown = function initCountdown() {
3721    if (typeof $.fn.countdown !== 'function')
3722      return;
3723    if ($(".view_sale_block").length) {
3724      $(".view_sale_block").each(function () {
3725        var _this = $(this);
3726        if (_this.hasClass("init-if-visible") && !_this.is(":visible")) return;
3727
3728        var activeTo = _this.find(".active_to").text(),
3729          dateTo = new Date(activeTo.replace(/(\d+)\.(\d+)\.(\d+)/, "$3/$2/$1"));
3730        if (_this.hasClass("compact"))
3731          _this.find(".countdown").countdown(
3732            {
3733              until: dateTo,
3734              format: "dHMS",
3735              compact: true,
3736              padZeroes: true,
3737              layout:
3738                '{d<}<span class="days item">{dn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hn}<div class="text">{hl}</div></span> <span class="minutes item">{mn}<div class="text">{ml}</div></span> <span class="sec item">{sn}<div class="text">{sl}</div></span>',
3739            },
3740            $.countdown.regionalOptions["ru"]
3741          );
3742        else
3743          _this.find(".countdown").countdown(
3744            {
3745              until: dateTo,
3746              format: "dHMS",
3747              padZeroes: true,
3748              layout:
3749                '{d<}<span class="days item">{dnn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hnn}<div class="text">{hl}</div></span> <span class="minutes item">{mnn}<div class="text">{ml}</div></span> <span class="sec item">{snn}<div class="text">{sl}</div></span>',
3750            },
3751            $.countdown.regionalOptions["ru"]
3752          );
3753      });
3754    }
3755  };
3756}
3757
3758if (!funcDefined("initCountdownTime")) {
3759  var initCountdownTime = function initCountdownTime(block, time) {
3760    if (typeof $.fn.countdown !== 'function')
3761      return;
3762    if (time) {
3763      var dateTo = new Date(time.replace(/(\d+)\.(\d+)\.(\d+)/, "$3/$2/$1"));
3764      block.find(".countdown").countdown("destroy");
3765      if (block.hasClass("compact"))
3766        block.find(".countdown").countdown(
3767          {
3768            until: dateTo,
3769            format: "dHM",
3770            compact: true,
3771            padZeroes: true,
3772            layout:
3773              '{d<}<span class="days item">{dn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hn}<div class="text">{hl}</div></span> <span class="minutes item">{mn}<div class="text">{ml}</div></span> <span class="sec item">{sn}<div class="text">{sl}</div></span>',
3774          },
3775          $.countdown.regionalOptions["ru"]
3776        );
3777      else
3778        block.find(".countdown").countdown(
3779          {
3780            until: dateTo,
3781            format: "dHMS",
3782            padZeroes: true,
3783            layout:
3784              '{d<}<span class="days item">{dnn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hnn}<div class="text">{hl}</div></span> <span class="minutes item">{mnn}<div class="text">{ml}</div></span> <span class="sec item">{snn}<div class="text">{sl}</div></span>',
3785          },
3786          $.countdown.regionalOptions["ru"]
3787        );
3788      block.find(".view_sale_block").show();
3789    } else {
3790      block.find(".view_sale_block").hide();
3791    }
3792  };
3793}
3794/* countdown end */
3795
3796waitCounter = function (idCounter, delay, callback) {
3797  var obCounter = window["yaCounter" + idCounter];
3798  if (typeof obCounter == "object") {
3799    if (typeof callback == "function") callback();
3800  } else {
3801    setTimeout(function () {
3802      waitCounter(idCounter, delay, callback);
3803    }, delay);
3804  }
3805};
3806
3807var isOnceInited = (insertFilter = false);
3808var animationTime = 200;
3809var delayTime = 200;
3810var topMenuEnterTimer = false;
3811var previewMode = window != window.top;
3812var isMobile = window.matchMedia("(max-width:991px)").matches;
3813if (isMobile) document.documentElement.className += " mobile";
3814if (previewMode) document.documentElement.className += " previewMode";
3815
3816if (navigator.userAgent.indexOf("Edge") != -1) document.documentElement.className += " bx-ie-edge";
3817
3818/* filter start */
3819if (!funcDefined("checkVerticalMobileFilter")) {
3820  var checkVerticalMobileFilter = function checkVerticalMobileFilter() {
3821  };
3822}
3823/* filter end */
3824
3825// ONE CLICK
3826if (!funcDefined("oneClickBuy")) {
3827  var oneClickBuy = function (elementID, iblockID, that) {
3828    var name = "one_click_buy";
3829    var elementQuantity = 1;
3830    var offerProps = false;
3831    var buy_btn = $(that).closest(".buy_block").find(".to-cart");
3832    var buy_btn2 = $(that).closest("tr").find(".to-cart");
3833    var buy_btn3 = $(that).closest(".item").find(".to-cart");
3834
3835    if (typeof that !== "undefined") {
3836      elementQuantity = $(that).attr("data-quantity");
3837      offerProps = $(that).attr("data-props");
3838    }
3839
3840    if (elementQuantity < 0) {
3841      elementQuantity = 1;
3842    }
3843
3844    var tmp_props = buy_btn.data("props") || buy_btn2.data("props") || buy_btn3.data("props"),
3845      props = "",
3846      part_props = "",
3847      add_props = "N",
3848      fill_prop = {},
3849      iblockid = buy_btn.data("iblockid"),
3850      item = buy_btn.attr("data-item");
3851
3852    if (tmp_props) {
3853      props = tmp_props.split(";");
3854    }
3855    if (buy_btn.data("part_props")) {
3856      part_props = buy_btn.data("part_props");
3857    }
3858    if (buy_btn.data("add_props")) {
3859      add_props = buy_btn.data("add_props");
3860    }
3861
3862    fill_prop = fillBasketPropsExt(buy_btn, "prop", buy_btn.data("bakset_div"));
3863    fill_prop.iblockID = iblockid;
3864    fill_prop.part_props = part_props;
3865    fill_prop.add_props = add_props;
3866    fill_prop.props = JSON.stringify(props);
3867    fill_prop.item = item;
3868    fill_prop.ocb_item = "Y";
3869
3870    // if (!isMobile) {
3871    if (!$(that).hasClass("clicked")) {
3872      $(that).addClass("clicked");
3873      $("body")
3874        .find("." + name + "_frame")
3875        .remove();
3876      $("body")
3877        .find("." + name + "_trigger")
3878        .remove();
3879      $("body #popup_iframe_wrapper").append('<div class="' + name + '_frame popup"></div>');
3880      $("body #popup_iframe_wrapper").append('<div class="' + name + '_trigger"></div>');
3881
3882      loadJQM(() => {
3883        $("." + name + "_frame").jqm({
3884          trigger: "." + name + "_trigger",
3885          onHide: function (hash) {
3886            onHidejqm(name, hash);
3887          },
3888          toTop: false,
3889          onLoad: function (hash) {
3890            onLoadjqm(name, hash, "", false, false, false, that);
3891          },
3892          ajax:
3893            arAsproOptions["SITE_DIR"] +
3894            "ajax/one_click_buy.php?ELEMENT_ID=" +
3895            elementID +
3896            "&IBLOCK_ID=" +
3897            iblockID +
3898            "&ELEMENT_QUANTITY=" +
3899            elementQuantity +
3900            "&OFFER_PROPS=" +
3901            fill_prop.props,
3902        });
3903
3904        $("." + name + "_trigger").click();
3905      });
3906    }
3907  };
3908}
3909
3910if (!funcDefined("oneClickBuyBasket")) {
3911  var oneClickBuyBasket = function () {
3912    const name = "one_click_buy_basket";
3913    if (!$(".fast_order").hasClass("clicked")) {
3914      $(".fast_order").addClass("clicked");
3915      $("body ." + name + "_frame").remove();
3916      $("body ." + name + "_trigger").remove();
3917      $("body #popup_iframe_wrapper").append(
3918        '<div class="' + name + '_frame popup"></div>',
3919        '<div class="' + name + '_trigger"></div>'
3920      );
3921
3922      loadJQM(() => {
3923        $("." + name + "_frame").jqm({
3924          trigger: "." + name + "_trigger",
3925          onHide: function (hash) {
3926            onHidejqm(name, hash);
3927          },
3928          onLoad: function (hash) {
3929            onLoadjqm(name, hash);
3930          },
3931          ajax: arAsproOptions["SITE_DIR"] + "ajax/one_click_buy_basket.php",
3932        });
3933
3934        $("." + name + "_trigger").click();
3935      });
3936    }
3937  };
3938}
3939
3940// TOP MENU ANIMATION
3941$(document).on("click", ".menu_top_block>li .more a", function () {
3942  $this = $(this);
3943  $this.parents(".dropdown").first().find(">.hidden").removeClass("hidden");
3944  $this.parent().addClass("hidden");
3945  setTimeout(function () {
3946    $this.parent().remove();
3947  }, 500);
3948});
3949
3950$(document).on("mouseenter", ".menu_top_block.catalogfirst>li>.dropdown>li.full", function () {
3951  var $submenu = $(this).find(">.dropdown");
3952
3953  if ($submenu.length) {
3954    if (topMenuEnterTimer) {
3955      clearTimeout(topMenuEnterTimer);
3956      topMenuEnterTimer = false;
3957    }
3958  }
3959});
3960
3961$(document).on("mouseenter", ".menu_top_block>li:not(.full)", function () {
3962  var $submenu = $(this).find(">.dropdown");
3963
3964  if ($submenu.length && !$submenu.hasClass("visible")) {
3965    var $menu = $(this).parents(".menu");
3966    var $wrapmenu = $menu.parents(".wrap_menu");
3967    var wrapMenuWidth = $wrapmenu.actual("outerWidth");
3968    var wrapMenuLeft = $wrapmenu.offset().left;
3969    var wrapMenuRight = wrapMenuLeft + wrapMenuWidth;
3970    var left = wrapMenuRight - ($(this).offset().left + $submenu.actual("outerWidth"));
3971    if (
3972      window.matchMedia("(min-width: 951px)").matches &&
3973      $(this).hasClass("catalog") &&
3974      ($(".banner_auto").hasClass("catalog_page") || $(".banner_auto").hasClass("front_page"))
3975    ) {
3976      return;
3977    }
3978    if (left < 0) {
3979      $submenu.css({ left: left + "px" });
3980    }
3981    $submenu.stop().slideDown(animationTime, function () {
3982      $submenu.css({ height: "", overflow: "visible" });
3983    });
3984
3985    $(this).on("mouseleave", function () {
3986      var leaveTimer = setTimeout(function () {
3987        $submenu.stop().slideUp(animationTime, function () {
3988          $submenu.css({ left: "" });
3989        });
3990      }, delayTime);
3991
3992      $(this).on("mouseenter", function () {
3993        if (leaveTimer) {
3994          clearTimeout(leaveTimer);
3995          leaveTimer = false;
3996        }
3997      });
3998    });
3999  }
4000});
4001
4002$(document).on("mouseenter", ".menu_top_block>li .dropdown>li", function () {
4003  var $this = $(this);
4004  var $submenu = $this.find(">.dropdown");
4005
4006  if (
4007    $submenu.length &&
4008    ((!$this.parents(".full").length && !$this.hasClass("full")) || $this.parents(".more").length)
4009  ) {
4010    var $menu = $this.parents(".menu");
4011    var $wrapmenu = $menu.parents(".wrap_menu");
4012    var arParentSubmenuForOpacity = [];
4013    topMenuEnterTimer = setTimeout(function () {
4014      var wrapMenuWidth = $wrapmenu.actual("outerWidth");
4015      var wrapMenuLeft = $wrapmenu.offset().left;
4016      var wrapMenuRight = wrapMenuLeft + wrapMenuWidth;
4017      var $parentSubmenu = $this.parent();
4018      var bToLeft = $parentSubmenu.hasClass("toleft") ? true : false;
4019      if (!bToLeft) {
4020        bToLeft = $this.offset().left + $this.actual("outerWidth") + $submenu.actual("outerWidth") > wrapMenuRight;
4021      } else {
4022        bToLeft = $this.offset().left + $this.actual("outerWidth") - $submenu.actual("outerWidth") < wrapMenuLeft;
4023      }
4024
4025      if (bToLeft) {
4026        $this.find(">.dropdown").addClass("toleft").show();
4027      } else {
4028        $this.find(">.dropdown").removeClass("toleft").show();
4029      }
4030      var submenuLeft = $submenu.offset().left;
4031      var submenuRight = submenuLeft + $submenu.actual("outerWidth");
4032
4033      $this.parents(".dropdown").each(function () {
4034        var $this = $(this);
4035        var leftOffset = $this.offset().left;
4036        var rightOffset = leftOffset + $this.actual("outerWidth");
4037        if (
4038          (leftOffset >= submenuLeft && leftOffset < submenuRight - 1) ||
4039          (rightOffset > submenuLeft + 1 && rightOffset <= submenuRight)
4040        ) {
4041          arParentSubmenuForOpacity.push($this);
4042          $this.find(">li>a").css({ opacity: "0.1" });
4043        }
4044      });
4045    }, delayTime);
4046
4047    $this.unbind("mouseleave");
4048    $this.on("mouseleave", function () {
4049      var leaveTimer = setTimeout(function () {
4050        $this.find(".dropdown").removeClass("toleft").hide();
4051        if (arParentSubmenuForOpacity.length) {
4052          for (i in arParentSubmenuForOpacity) {
4053            arParentSubmenuForOpacity[i].find(">li>a").css({ opacity: "" });
4054          }
4055        }
4056      }, delayTime);
4057
4058      $this.unbind("mouseenter");
4059      $this.on("mouseenter", function () {
4060        if (leaveTimer) {
4061          clearTimeout(leaveTimer);
4062          leaveTimer = false;
4063        }
4064      });
4065    });
4066  }
4067});
4068CheckFlexSlider = function () {};
4069
4070InitScrollBar = function (el, initOptions) {};
4071InitCustomScrollBar = function (el) {};
4072
4073/* slider gallery for fancybox */
4074const InitFancyboxThumbnailsGallery = function (instance) {
4075  if (
4076    $(".fancybox-thumbs") &&
4077    $(".fancybox-thumbs__list a").length > 1 &&
4078    !$(".fancybox-thumbs .swiper").length &&
4079    typeof initSwiperSlider === "function"
4080  ) {
4081    // update preview when lazyloaded
4082
4083    instance.Thumbs.$grid.find(".fancybox-thumbs__list a").each(function (i, el) {
4084      const path = instance.group[i].thumb || instance.group[i].src;
4085
4086      $(el).css("background-image", "url('" + encodeURI(path) + "')");
4087    });
4088    const SLIDER_RESIZE_BREAKPOINT = 600;
4089    const $swiperSlides = $(".fancybox-thumbs__list a");
4090    const $swiperWrapper = $(".fancybox-thumbs__list");
4091    const sliderDirection = window.innerWidth >= SLIDER_RESIZE_BREAKPOINT ? "vertical" : "horizontal";
4092
4093    const options = {
4094      centerInsufficientSlides: true,
4095      direction: sliderDirection,
4096      mousewheelControl: true,
4097      setWrapperSize: true,
4098      slidesPerView: 3,
4099      spaceBetween: 16,
4100      breakpoints: {
4101        400: {
4102          slidesPerView: 5,
4103        },
4104      },
4105    };
4106
4107    if ($swiperSlides.length > 5) {
4108      options.navigation = {
4109        nextEl: ".fancybox-thumbs__wrapper .swiper-button-next",
4110        prevEl: ".fancybox-thumbs__wrapper .swiper-button-prev",
4111      };
4112    }
4113
4114    $(".fancybox-thumbs").wrapInner(
4115      "<div class='fancybox-thumbs__wrapper'><div class='swiper' data-plugin-options='" +
4116        JSON.stringify(options) +
4117        "' /></div>"
4118    );
4119    const $swiperContainerWrapper = $(".fancybox-thumbs__wrapper");
4120
4121    if ($swiperSlides.length > 5) {
4122      $swiperContainerWrapper.append(
4123        "<div class='swiper-button-next'><i class='svg right'><svg xmlns='http://www.w3.org/2000/svg' width='12' height='6.969' viewBox='0 0 12 6.969'><path id='Rounded_Rectangle_702_copy_24' data-name='Rounded Rectangle 702 copy 24' class='cls-1' d='M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z' transform='translate(-350 -395.031)'></path></svg></i></div>"
4124      );
4125      $swiperContainerWrapper.prepend(
4126        "<div class='swiper-button-prev'><i class='svg left'><svg xmlns='http://www.w3.org/2000/svg' width='12' height='6.969' viewBox='0 0 12 6.969'><path id='Rounded_Rectangle_702_copy_24' data-name='Rounded Rectangle 702 copy 24' class='cls-1' d='M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z' transform='translate(-350 -395.031)'></path></svg></i></div>"
4127      );
4128    }
4129    $swiperWrapper.addClass("swiper-wrapper");
4130    $swiperSlides.addClass("swiper-slide");
4131
4132    initSwiperSlider(".fancybox-thumbs .swiper");
4133
4134    const swiper = $(".fancybox-thumbs .swiper").data("swiper");
4135
4136    swiper.slideTo(instance.curPos, 10);
4137    swiper.on("resize", function () {
4138      if (window.innerWidth >= SLIDER_RESIZE_BREAKPOINT && options.direction === "horizontal") {
4139        options.direction = "vertical";
4140        swiper.changeDirection(options.direction, false);
4141        $swiperWrapper.css("width", "auto");
4142        swiper.update();
4143      } else if (window.innerWidth < SLIDER_RESIZE_BREAKPOINT && options.direction === "vertical") {
4144        options.direction = "horizontal";
4145        swiper.changeDirection(options.direction, false);
4146        $swiperWrapper.css("height", "auto");
4147        swiper.update();
4148      }
4149    });
4150  }
4151};
4152
4153fancyBoxOpts = {
4154  padding: [40, 40, 64, 40],
4155  openEffect: "fade",
4156  closeEffect: "fade",
4157  nextEffect: "fade",
4158  prevEffect: "fade",
4159  opacity: true,
4160  tpl: {
4161    closeBtn:
4162      '<span title="' +
4163      BX.message("FANCY_CLOSE") +
4164      '" class="fancybox-item fancybox-close inline svg"><svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 24L24 2M2 2L24 24" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg></span>',
4165    next:
4166      '<a title="' +
4167      BX.message("FANCY_NEXT") +
4168      '" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
4169    prev:
4170      '<a title="' +
4171      BX.message("FANCY_PREV") +
4172      '" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>',
4173  },
4174  btnTpl: {
4175    close:
4176      '<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' +
4177      '<i class="svg"><svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M2 24L24 2M2 2L24 24" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></svg></i>' +
4178      "</button>",
4179
4180    arrowLeft:
4181      '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' +
4182      '<div><i class="svg left"><svg width="16" height="26" viewBox="0 0 15 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 13L0.585787 14.4142C-0.195262 13.6332 -0.195262 12.3668 0.585787 11.5858L2 13ZM11.5858 0.585786C12.3668 -0.195262 13.6332 -0.195262 14.4142 0.585786C15.1953 1.36683 15.1953 2.63317 14.4142 3.41421L11.5858 0.585786ZM14.4142 22.5858C15.1953 23.3668 15.1953 24.6332 14.4142 25.4142C13.6332 26.1953 12.3668 26.1953 11.5858 25.4142L14.4142 22.5858ZM0.585787 11.5858L11.5858 0.585786L14.4142 3.41421L3.41421 14.4142L0.585787 11.5858ZM3.41421 11.5858L14.4142 22.5858L11.5858 25.4142L0.585787 14.4142L3.41421 11.5858Z" fill="#999999"/></svg></i></div>' +
4183      "</button>",
4184
4185    arrowRight:
4186      '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' +
4187      '<div><i class="svg right"><svg width="16" height="26" viewBox="0 0 15 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 13L14.4142 14.4142C15.1953 13.6332 15.1953 12.3668 14.4142 11.5858L13 13ZM3.41421 0.585786C2.63317 -0.195262 1.36683 -0.195262 0.585786 0.585786C-0.195262 1.36683 -0.195262 2.63317 0.585786 3.41421L3.41421 0.585786ZM0.585786 22.5858C-0.195262 23.3668 -0.195262 24.6332 0.585786 25.4142C1.36683 26.1953 2.63317 26.1953 3.41421 25.4142L0.585786 22.5858ZM14.4142 11.5858L3.41421 0.585786L0.585786 3.41421L11.5858 14.4142L14.4142 11.5858ZM11.5858 11.5858L0.585786 22.5858L3.41421 25.4142L14.4142 14.4142L11.5858 11.5858Z" fill="white"/></svg></i></div>' +
4188      "</button>",
4189  },
4190  touch: "enabled",
4191  buttons: ["close"],
4192  thumbs: {
4193    autoStart: true,
4194  },
4195  backFocus: false,
4196  onActivate: function (instance) {
4197    InitFancyboxThumbnailsGallery(instance);
4198  },
4199  beforeShow: function (instance, current) {
4200    if ($(".fancybox-thumbs .swiper").length) {
4201      const swiper = $(".fancybox-thumbs .swiper").data("swiper");
4202
4203      swiper.slideTo(current.index);
4204    }
4205    let bCurrentSrc = typeof current !== "undefined" && current.contentType == "html" && $(current.src).length;
4206
4207    if (bCurrentSrc) {
4208      let $companyBlock = current.src.closest(".company-block");
4209      if ($companyBlock.length) {
4210        var $video_block = $companyBlock.find(".video")[0];
4211        if ($video_block && !$video_block.nextElementSibling) {
4212          $videoContent = $video_block.content.cloneNode(true);
4213          $source = $videoContent.querySelector(".video-block");
4214          $source.setAttribute("src", $source.dataset["src"]);
4215          $video_block.parentNode.insertBefore($videoContent, $video_block.nextSibling);
4216        }
4217
4218        var video_block_frame = $companyBlock.find(".video-block__iframe");
4219        if (video_block_frame.length) {
4220          var data_src_iframe = video_block_frame.attr("data-src");
4221          video_block_frame.attr("src", data_src_iframe);
4222          video_block_frame.attr("allow", "autoplay");
4223        }
4224      }
4225    }
4226  },
4227  afterShow: function (instance, current) {
4228    if ($(".fancybox-overlay").css("opacity") == 0) {
4229      setTimeout(function () {
4230        $(".fancybox-overlay").css("opacity", 1);
4231        $("html").addClass("overflow_html");
4232      }, 200);
4233    }
4234
4235    $(".fancybox-nav").css("opacity", 0);
4236    setTimeout(function () {
4237      $(".fancybox-nav").css("opacity", 1);
4238    }, 150);
4239
4240    if ($(".fancybox-inner .video-block").length) {
4241      // var fancyHeight = $('.fancybox-wrap').height();
4242      // $('.fancybox-inner').height(fancyHeight);
4243      setTimeout(function () {
4244        $(".fancybox-wrap video").resize();
4245        setTimeout(function () {
4246          $(".fancybox-wrap").addClass("show_video");
4247          document.getElementById("company_video").currentTime = 0;
4248          document.getElementById("company_video").play();
4249        }, 300);
4250      }, 150);
4251    } else if ($(".fancybox-wrap iframe").length) {
4252      $(".fancybox-inner").height("100%");
4253    }
4254  },
4255  beforeClose: function () {
4256    $(".fancybox-overlay").fadeOut();
4257    $("html").removeClass("overflow_html");
4258
4259    if ($("#company_video").length) {
4260      document.getElementById("company_video").currentTime = 0;
4261    }
4262
4263    var video_block_frame = $(".company-block .video-block");
4264    if (video_block_frame.length) {
4265      $(".video-block__iframe").attr("src", "");
4266    }
4267  },
4268  onClosed: function () {
4269    if ($(".fancybox-wrap #company_video").length) {
4270      document.getElementById("company_video").pause();
4271    }
4272  },
4273};
4274
4275InitFancyBox = function () {
4276  if (typeof $.fn.fancybox !== "function") {
4277    return;
4278  }
4279
4280  if (!$(".fancy").length) {
4281    return;
4282  }
4283
4284  $(".fancy").fancybox(fancyBoxOpts);
4285};
4286
4287InitFancyBoxVideo = function () {
4288  if (typeof $.fn.fancybox !== "function") {
4289    return;
4290  }
4291
4292  if (!$(".video_link").length) {
4293    return;
4294  }
4295  $(".video_link").fancybox({
4296    type: "iframe",
4297    iframe: {
4298      preload: false
4299    },
4300    maxWidth: 800,
4301    maxHeight: 600,
4302    fitToView: false,
4303    width: "70%",
4304    height: "70%",
4305    autoSize: false,
4306    closeClick: false,
4307    opacity: true,
4308    tpl: {
4309      closeBtn:
4310        '<span title="' +
4311        BX.message("FANCY_CLOSE") +
4312        '" class="fancybox-item fancybox-close inline svg"><svg class="svg svg-close" width="14" height="14" viewBox="0 0 14 14"><path data-name="Rounded Rectangle 568 copy 16" d="M1009.4,953l5.32,5.315a0.987,0.987,0,0,1,0,1.4,1,1,0,0,1-1.41,0L1008,954.4l-5.32,5.315a0.991,0.991,0,0,1-1.4-1.4L1006.6,953l-5.32-5.315a0.991,0.991,0,0,1,1.4-1.4l5.32,5.315,5.31-5.315a1,1,0,0,1,1.41,0,0.987,0.987,0,0,1,0,1.4Z" transform="translate(-1001 -946)"></path></svg></span>',
4313      next:
4314        '<a title="' +
4315        BX.message("FANCY_NEXT") +
4316        '" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
4317      prev:
4318        '<a title="' +
4319        BX.message("FANCY_PREV") +
4320        '" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>',
4321    },
4322    afterShow: function () {
4323      if ($(".fancybox-overlay").css("opacity") == 0) {
4324        setTimeout(function () {
4325          $(".fancybox-overlay").css("opacity", 1);
4326          $("html").addClass("overflow_html");
4327        }, 200);
4328      }
4329
4330      $(".fancybox-nav").css("opacity", 0);
4331      setTimeout(function () {
4332        $(".fancybox-nav").css("opacity", 1);
4333      }, 150);
4334      if ($(".fancybox-wrap iframe").length) {
4335        $(".fancybox-inner").height("100%");
4336      }
4337    },
4338    beforeClose: function () {
4339      $(".fancybox-overlay").fadeOut();
4340      $("html").removeClass("overflow_html");
4341    },
4342  });
4343};
4344
4345InitStickySideBar = function (el, container_el) {
4346  var block = ".sticky-sidebar",
4347    container_catalog = ".wraps .wrapper_inner .container_inner .main-catalog-wrapper",
4348    container = ".wraps .wrapper_inner .container_inner";
4349  if (typeof el !== "undefined") block = el;
4350
4351  if ($(container_catalog).length) container = container_catalog;
4352
4353  if (typeof container_el !== "undefined") container = container_el;
4354
4355  if ($(block).length && arAsproOptions["THEME"]["STICKY_SIDEBAR"] != "N") {
4356    if (typeof window["stickySidebar"] !== "undefined") {
4357      window["stickySidebar"].destroy();
4358    }
4359
4360    window["stickySidebar"] = new StickySidebar(block, {
4361      topSpacing: 60,
4362      bottomSpacing: 20,
4363      containerSelector: container,
4364      resizeSensor: true,
4365      innerWrapperSelector: ".sticky-sidebar__inner",
4366    });
4367
4368    if ($(".sticky-sidebar .sticky-sidebar__inner .banner img").length) {
4369      $(".sticky-sidebar .sticky-sidebar__inner .banner img")[0].onload = function () {
4370        if (typeof window["stickySidebar"] !== "undefined") {
4371          window["stickySidebar"].updateSticky();
4372        }
4373      };
4374    }
4375  }
4376};
4377
4378InitOwlSlider = function () {
4379  if (typeof $.fn.owlCarousel !== "function") {
4380    return;
4381  }
4382  $(".owl-carousel:not(.owl-loaded):not(.appear-block)").each(function () {
4383    var slider = $(this);
4384    var options;
4385    var svg =
4386      '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6.969" viewBox="0 0 12 6.969"><path id="Rounded_Rectangle_702_copy_24" data-name="Rounded Rectangle 702 copy 24" class="cls-1" d="M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z" transform="translate(-350 -395.031)"/></svg>';
4387    var defaults = {
4388      navText: [
4389        '<i class="svg left colored_theme_hover_text">' + svg + "</i>",
4390        '<i class="svg right colored_theme_hover_text">' + svg + "</i>",
4391      ],
4392    };
4393    var config = $.extend({}, defaults, options, slider.data("plugin-options"));
4394
4395    slider.on("initialized.owl.carousel", function (event) {
4396      var eventdata = { slider: event };
4397      BX.onCustomEvent("onSliderInitialized", [eventdata]);
4398      BX.onCustomEvent("onSlide", [eventdata]);
4399
4400      $(event.target).removeClass("loading-state");
4401      $(event.target).find(".owl-item:first").addClass("current");
4402
4403      if ($(event.target).hasClass("catalog_block")) {
4404        if (typeof sliceItemBlockSlide === "function") {
4405          sliceItemBlockSlide();
4406        }
4407      }
4408
4409      if (typeof window["stickySidebar"] !== "undefined") {
4410        window["stickySidebar"].updateSticky();
4411      }
4412    });
4413    // if slider was inited on animated scrolling to block, than need rescroll
4414    if ($("body.scrolling-state").length) {
4415      slider.on("initialized.owl.carousel", function (event) {
4416        setTimeout(function () {
4417          scrollToBlock.rescroll();
4418        }, 100);
4419      });
4420    }
4421
4422    slider.on("change.owl.carousel", function (event) {
4423      // var eventdata = {slider: $(event.target)};
4424      // BX.onCustomEvent('onSlide', [eventdata]);
4425    });
4426
4427    slider.owlCarousel(config);
4428
4429    slider.on("resized.owl.carousel", function (event) {
4430      if (typeof sliceItemBlockSlide === "function") {
4431        sliceItemBlockSlide({ resize: false });
4432      }
4433    });
4434
4435    slider.on("changed.owl.carousel", function (event) {
4436      var $slider = $(event.target);
4437      var sliderData = $slider.data("owl.carousel");
4438      var pluginOptions = $slider.data("pluginOptions");
4439
4440      var eventdata = { slider: $slider, data: event };
4441      BX.onCustomEvent("onSlide", [eventdata]);
4442
4443      if (pluginOptions) {
4444        // click .ajax_load_btn
4445        if ($slider.parent().find(".ajax_load_btn").length) {
4446          if (sliderData._current + 1 + sliderData.settings.items >= sliderData._items.length) {
4447            $slider.parent().find(".ajax_load_btn").trigger("click");
4448          }
4449        }
4450        if (typeofExt(pluginOptions) === "object") {
4451          if ("index" in pluginOptions) {
4452            if ($(".gallery-view_switch").length) {
4453              $(".gallery-view_switch__count-wrapper--big .gallery-view_switch__count-value").text(
4454                event.item.index + 1 + "/" + event.item.count
4455              );
4456            }
4457          }
4458
4459        if ("relatedTo" in $(event.target).data("pluginOptions")) {
4460          var relatedClass = $(event.target).data("pluginOptions").relatedTo,
4461            relatedBlock = $(relatedClass);
4462
4463          if (relatedBlock.length && $(event.target).data("owl.carousel")) {
4464            if (!$(event.target).data("owl.carousel").loop) {
4465              var current = event.item.index;
4466            } else {
4467              var count = event.item.count - 1;
4468              var current = Math.round(event.item.index - event.item.count / 2 - 0.5);
4469
4470              if (current < 0) current = count;
4471
4472              if (current > count) current = 0;
4473            }
4474
4475            relatedBlock.find(".owl-item").removeClass("current").eq(current).addClass("current");
4476
4477              var onscreen = relatedBlock.find(".owl-item.active").length - 1;
4478              var start = relatedBlock.find(".owl-item.active").first().index();
4479              var end = relatedBlock.find(".owl-item.active").last().index();
4480
4481              if (current > end) relatedBlock.data("owl.carousel").to(current, 100, true);
4482
4483              if (current < start) relatedBlock.data("owl.carousel").to(current - onscreen, 100, true);
4484              // $(".owl-slider-"+id).trigger('to.owl.carousel', [itemCarousel])
4485            }
4486          }
4487        }
4488      }
4489    });
4490
4491    slider.on("translated.owl.carousel", function (event) {});
4492
4493    if ("clickTo" in config) {
4494      var relatedClass = config.clickTo,
4495        magnifier = "magnifier" in config;
4496
4497      slider.on("click", ".owl-item", function (e) {
4498        e.preventDefault();
4499        var _this = $(this),
4500          number = _this.index();
4501
4502        if (magnifier) {
4503          if ($(relatedClass).closest(".product-container").find(".zoom_picture").length) {
4504            $(relatedClass)
4505              .closest(".product-container")
4506              .find(".zoom_picture")
4507              .attr("data-large", _this.find(".product-detail-gallery__item").data("big"));
4508            $(relatedClass)
4509              .closest(".product-container")
4510              .find(".zoom_picture")
4511              .attr("xoriginal", _this.find(".product-detail-gallery__item").data("big"));
4512            $(relatedClass)
4513              .closest(".product-container")
4514              .find(".zoom_picture")
4515              .attr("src", _this.find(".product-detail-gallery__item img").attr("src"));
4516          }
4517          _this.siblings("").removeClass("current");
4518          _this.addClass("current");
4519        } else {
4520          $(relatedClass).data("owl.carousel").to(number, 300, true);
4521        }
4522      });
4523    }
4524  });
4525};
4526
4527InitFlexSlider = function () {
4528  //todo need remove
4529};
4530
4531inIframe = function () {
4532  try {
4533    return window.self !== window.top;
4534  } catch (e) {
4535    return true;
4536  }
4537};
4538
4539InitZoomPict = function (el) {
4540  const zoomer = typeof el !== "undefined" ? el : $(".zoom_picture");
4541
4542  if (zoomer.length) {
4543    var options;
4544    const defaults = {
4545      title: false,
4546      scroll: false,
4547      Xoffset: 15,
4548      tint: "#333",
4549      defaultScale: -1,
4550    };
4551
4552    const config = $.extend({}, defaults, options, zoomer.data("plugin-options"));
4553    zoomer.xzoom(config);
4554
4555    // checks if zoomer doesn't have the event listenners
4556    const zoomerEventsListeners = $._data(zoomer.get(0), "events");
4557
4558    if (!zoomerEventsListeners.mouseout && !zoomerEventsListeners.load) {
4559      zoomer.on("mouseleave", function () {
4560        zoomer.data("xzoom").movezoom;
4561        let mObjWidth = parseInt(zoomer.attr("data-xoriginalwidth"));
4562        let mObHeight = parseInt(zoomer.attr("data-xoriginalheight"));
4563        let imgObjWidth = Math.round(zoomer.width());
4564        let imgObjheight = Math.round(zoomer.height());
4565        if (mObjWidth === imgObjWidth && imgObjheight === mObHeight) {
4566          $(".xzoom-preview").addClass("hidden");
4567          $(".xzoom-source > div").addClass("hidden");
4568        } else {
4569          $(".xzoom-preview").removeClass("hidden");
4570          $(".xzoom-source > div").removeClass("hidden");
4571        }
4572      });
4573
4574      zoomer.on("load", function () {
4575        const zoomerParentWidth = Math.round(zoomer.parent().width());
4576        const zoomerHeight = Math.round(zoomer.height());
4577        const zoomerWidth = Math.round(zoomer.width());
4578        const sizeMultiplier = 1.5;
4579
4580        const zoomWidth =
4581          zoomerWidth < zoomerParentWidth / 2 && zoomerHeight > zoomerWidth ? zoomerWidth * sizeMultiplier : "auto";
4582
4583        zoomer.data("xzoom").destroy();
4584        zoomer.removeData("xzoom");
4585        zoomer.width("auto");
4586
4587        config.zoomWidth = zoomWidth;
4588        zoomer.xzoom(config);
4589      });
4590    }
4591  }
4592};
4593
4594var arBasketAsproCounters = (arStatusBasketAspro = arBasketPrices = {});
4595SetActualBasketFlyCounters = function (sync) {
4596  if (arBasketAsproCounters.DEFAULT == true) {
4597    $.ajax({
4598      url: arAsproOptions["SITE_DIR"] + "ajax/basket_fly.php",
4599      type: "post",
4600      success: function (html) {
4601        $("#basket_line .basket_fly").removeClass("loaded").html(html);
4602
4603        if (typeof sync !== "undefined") {
4604          $.ajax({
4605            type: "GET",
4606            url: arAsproOptions["SITE_DIR"] + "ajax/actualBasket.php",
4607            // data:data,
4608            success: function (data) {
4609              if (!$(".js_ajax").length) $("body").append('<div class="js_ajax"></div>');
4610              $(".js_ajax").html(data);
4611
4612              setBasketStatusBtn(true);
4613            },
4614          });
4615        }
4616      },
4617    });
4618  } else {
4619    // insert currency &#8381; by this hack!: $('<div/>').html(arBasketAsproCounters.READY.TITLE).text()
4620    $(".basket_fly .opener .basket_count .count")
4621      .attr("class", "count" + (arBasketAsproCounters.READY.COUNT > 0 ? "" : " empty_items"))
4622      .find(".items span")
4623      .text(arBasketAsproCounters.READY.COUNT);
4624    $(".basket_fly .opener .basket_count + a").attr("href", arBasketAsproCounters["READY"]["HREF"]);
4625    $(".basket_fly .opener .basket_count")
4626      .attr("title", $("<div/>").html(arBasketAsproCounters.READY.TITLE).text())
4627      .attr(
4628        "class",
4629        "colored_theme_hover_text basket_count small clicked" + (arBasketAsproCounters.READY.COUNT > 0 ? "" : " empty")
4630      );
4631
4632    $(".basket_fly .opener .wish_count .count").find(".items span").text(arBasketAsproCounters.FAVORITE.COUNT);
4633
4634    $(".basket_fly .opener .compare_count .wraps_icon_block").attr(
4635      "class",
4636      "wraps_icon_block compare" + (arBasketAsproCounters.COMPARE.COUNT > 0 ? "" : " empty_block")
4637    );
4638    $(".basket_fly .opener .compare_count .count")
4639      .attr("class", "count" + (arBasketAsproCounters.COMPARE.COUNT > 0 ? "" : " empty_items"))
4640      .find(".items span")
4641      .text(arBasketAsproCounters.COMPARE.COUNT);
4642    $(".basket_fly .opener .compare_count + a").attr("href", arBasketAsproCounters.COMPARE.HREF);
4643
4644    updateBottomIconsPanel(arBasketAsproCounters);
4645  }
4646};
4647
4648CheckHeaderFixed = function () {
4649  var header = $("header, body.simple_basket_mode #header").first(),
4650    header_fixed = $("#headerfixed, body.simple_basket_mode #header"),
4651    header_simple = $("body.simple_basket_mode #header");
4652
4653  if (header_fixed.length) {
4654    if (header.length) {
4655      var isHeaderFixed = false,
4656        isTabsFixed = false,
4657        headerCanFix = true,
4658        headerFixedHeight = header_fixed.actual("outerHeight"),
4659        headerNormalHeight = header.actual("outerHeight"),
4660        headerDiffHeight = headerNormalHeight - headerFixedHeight,
4661        mobileBtnMenu = $(".btn.btn-responsive-nav"),
4662        headerTop = $("#panel:visible").actual("outerHeight"),
4663        topBlock = $(".TOP_HEADER").first(),
4664        $headerFixedNlo = header_fixed.find("[data-nlo]"),
4665        isNloLoaded = !$headerFixedNlo.length,
4666        OnHeaderFixedScrollHandler;
4667
4668      if (headerDiffHeight <= 0) headerDiffHeight = 0;
4669
4670      if (topBlock.length) headerTop += topBlock.actual("outerHeight");
4671
4672      $(window).scroll(
4673        (OnHeaderFixedScrollHandler = function () {
4674          var tabs_fixed = $(".product-item-detail-tabs-container-fixed");
4675
4676          if (window.matchMedia("(min-width:992px)").matches) {
4677            var scrollTop = documentScrollTopLast,
4678              current_is = $(".search-wrapper .search-input:visible"),
4679              tabs = $(".ordered-block .nav.nav-tabs"),
4680              headerCanFix = !mobileBtnMenu.is(":visible");
4681
4682            if (!isHeaderFixed) {
4683              if (headerCanFix && scrollTop > headerNormalHeight + headerTop) {
4684                if (!isNloLoaded) {
4685                  if (!$headerFixedNlo.hasClass("nlo-loadings")) {
4686                    $headerFixedNlo.addClass("nlo-loadings");
4687                    setTimeout(function () {
4688                      $.ajax({
4689                        data: { nlo: $headerFixedNlo.attr("data-nlo") },
4690                        success: function (response) {
4691                          // stop ya metrika webvisor DOM indexer
4692                          pauseYmObserver();
4693
4694                          isNloLoaded = true;
4695                          $headerFixedNlo[0].insertAdjacentHTML("beforebegin", $.trim(response));
4696                          $headerFixedNlo.remove();
4697
4698                          InitMenuNavigationAim();
4699                          OnHeaderFixedScrollHandler();
4700
4701                          // resume ya metrika webvisor
4702                          // (300ms transition) + (100ms scroll handler)
4703                          setTimeout(resumeYmObserver, 400);
4704                        },
4705                        error: function () {
4706                          $headerFixedNlo.removeClass("nlo-loadings");
4707                        },
4708                      });
4709                    }, 300);
4710                  }
4711                } else {
4712                  isHeaderFixed = true;
4713                  if (header_simple.length) {
4714                    headerSimpleHeight = header_simple.actual("outerHeight");
4715                    header_simple.closest(".header_wrap").css({ "margin-top": headerSimpleHeight });
4716                  }
4717                  header_fixed.addClass("fixed");
4718
4719                  $("nav.mega-menu.sliced.initied").removeClass("initied");
4720                  CheckTopMenuDotted();
4721                }
4722              }
4723            }
4724            if (isHeaderFixed || !headerCanFix) {
4725              if (!headerCanFix || scrollTop <= headerDiffHeight + headerTop) {
4726                isHeaderFixed = false;
4727                header_fixed.removeClass("fixed");
4728                if (header_simple.length) {
4729                  header_simple.closest(".header_wrap").css({ "margin-top": "" });
4730                }
4731              }
4732            }
4733
4734            //fixed tabs
4735            if (tabs_fixed.length && tabs.length) {
4736              var tabs_offset = $(".ordered-block .nav.nav-tabs").offset();
4737              if (scrollTop + headerFixedHeight > tabs_offset.top) {
4738                tabs_fixed.css({ top: header_fixed.actual("outerHeight") });
4739                tabs_fixed.addClass("fixed");
4740
4741                header_fixed.addClass("tabs-fixed");
4742              } else if (tabs_fixed.hasClass("fixed")) {
4743                tabs_fixed.removeAttr("style");
4744                tabs_fixed.removeClass("fixed");
4745
4746                header_fixed.removeClass("tabs-fixed");
4747              }
4748            }
4749          }
4750        })
4751      );
4752    }
4753  }
4754
4755  //mobile fixed
4756  var headerSimple = $("body.simple_basket_mode .wrapper1.mfixed_Y #header");
4757  var mfixed = headerSimple.length ? headerSimple : $(".wrapper1.mfixed_Y #mobileheader");
4758  if (mfixed.length && isMobile) {
4759    var isMHeaderFixed = false,
4760      mheaderCanFix = true,
4761      mheaderFixedHeight = mfixed.actual("outerHeight"),
4762      // mheaderFixedHeight = 0,
4763      mheaderTop = $("#panel:visible").actual("outerHeight"),
4764      mHeaderScrollTop = $(".wrapper1").hasClass("mfixed_view_scroll_top");
4765    $(window).scroll(function () {
4766      var scrollTop = documentScrollTopLast;
4767      if (window.matchMedia("(max-width:991px)").matches) {
4768        if (mHeaderScrollTop) {
4769          if (scrollTop > startScroll) {
4770            if (!$("#mobilePhone.show").length) {
4771              mfixed.removeClass("fixed");
4772              if (headerSimple.length) {
4773                headerSimple.closest(".header_wrap").css({ "margin-top": "" });
4774              }
4775            }
4776          } else if (scrollTop > mheaderFixedHeight + mheaderTop) {
4777            mfixed.addClass("fixed");
4778            if (headerSimple.length) {
4779              headerSimple.closest(".header_wrap").css({ "margin-top": mheaderFixedHeight });
4780            }
4781          } else if (scrollTop <= mheaderFixedHeight + mheaderTop) {
4782            mfixed.removeClass("fixed");
4783            if (headerSimple.length) {
4784              headerSimple.closest(".header_wrap").css({ "margin-top": "" });
4785            }
4786          }
4787          startScroll = scrollTop;
4788        } else {
4789          if (!isMHeaderFixed) {
4790            if (scrollTop > mheaderFixedHeight + mheaderTop) {
4791              isMHeaderFixed = true;
4792              mfixed.addClass("fixed");
4793              if (headerSimple.length) {
4794                headerSimple.closest(".header_wrap").css({ "margin-top": mheaderFixedHeight });
4795              }
4796            }
4797          } else if (isMHeaderFixed) {
4798            if (scrollTop <= mheaderFixedHeight + mheaderTop) {
4799              isMHeaderFixed = false;
4800              mfixed.removeClass("fixed");
4801              if (headerSimple.length) {
4802                headerSimple.closest(".header_wrap").css({ "margin-top": "" });
4803              }
4804            }
4805          }
4806        }
4807      } else {
4808        mfixed.removeClass("fixed");
4809        if (headerSimple.length) {
4810          headerSimple.closest(".header_wrap").css({ "margin-top": "" });
4811        }
4812      }
4813    });
4814  }
4815};
4816
4817CheckHeaderFixedMenu = function () {
4818  if (
4819    arAsproOptions["THEME"] &&
4820    arAsproOptions["THEME"]["HEADER_FIXED"] == 2 &&
4821    $("#headerfixed .js-nav").length &&
4822    window.matchMedia("(min-width: 992px)").matches
4823  ) {
4824    $("#headerfixed .js-nav").css("width", "0");
4825    var all_width = 0,
4826      cont_width = $("#headerfixed .maxwidth-theme").actual("width"),
4827      padding_menu =
4828        $("#headerfixed .logo-row.v2 .menu-block").actual("outerWidth") -
4829        $("#headerfixed .logo-row.v2 .menu-block").actual("width");
4830    $("#headerfixed .logo-row.v2 > .inner-table-block").each(function () {
4831      if (!$(this).hasClass("menu-block")) all_width += $(this).actual("outerWidth");
4832    });
4833    $("#headerfixed .js-nav").width(cont_width - all_width - padding_menu);
4834  }
4835};
4836
4837CheckSearchWidth = function () {
4838  if ($(".logo_and_menu-row .search_wrap").length) {
4839    var searchPosition = $(".logo_and_menu-row .search_wrap").position().left,
4840      maxWidth = $(".logo_and_menu-row .maxwidth-theme").width() - 2;
4841    width = 0;
4842    if ($(".logo_and_menu-row .subtop .search_wrap").length) {
4843      maxWidth = $(".logo_and_menu-row .subtop").width() - 2;
4844      $(".logo_and_menu-row .subtop > .row >div >div")
4845        .each(function () {
4846          if (!$(this).hasClass("search_wrap")) {
4847            var elementWidth = $(this).outerWidth();
4848            if (!$(this).is(":visible") || !$(this).height()) elementWidth = 0;
4849            width = width ? width - elementWidth : maxWidth - elementWidth;
4850          }
4851        })
4852        .promise()
4853        .done(function () {
4854          if ($(".logo_and_menu-row .search_wrap.wide_search").length)
4855            $(".logo_and_menu-row .search_wrap .search-block").outerWidth(width);
4856          else $(".logo_and_menu-row .search_wrap").outerWidth(width);
4857          $(".logo_and_menu-row .search_wrap").css({ opacity: 1, visibility: "visible" });
4858        });
4859    } else {
4860      if ($(".logo_and_menu-row .subbottom .search_wrap").length) {
4861        maxWidth = $(".logo_and_menu-row .subbottom").width() - 2;
4862        $(".logo_and_menu-row .subbottom >div")
4863          .each(function () {
4864            if (!$(this).hasClass("search_wrap")) {
4865              var elementWidth = $(this).outerWidth();
4866              if (!$(this).is(":visible") || !$(this).height()) elementWidth = 0;
4867              width = width ? width - elementWidth : maxWidth - elementWidth;
4868            }
4869          })
4870          .promise()
4871          .done(function () {
4872            if ($(".logo_and_menu-row .search_wrap.wide_search").length)
4873              $(".logo_and_menu-row .search_wrap .search-block").outerWidth(width);
4874            else $(".logo_and_menu-row .search_wrap").outerWidth(width);
4875            $(".logo_and_menu-row .search_wrap").css({ opacity: 1, visibility: "visible" });
4876          });
4877      } else {
4878        $(".logo_and_menu-row .maxwidth-theme > .row >div >div")
4879          .each(function () {
4880            if (!$(this).hasClass("search_wrap")) {
4881              var elementWidth = $(this).outerWidth();
4882              if (!$(this).is(":visible") || !$(this).height()) elementWidth = 0;
4883              width = width ? width - elementWidth : maxWidth - elementWidth;
4884            }
4885          })
4886          .promise()
4887          .done(function () {
4888            if ($(".logo_and_menu-row .search_wrap.wide_search").length)
4889              $(".logo_and_menu-row .search_wrap .search-block").outerWidth(width);
4890            else $(".logo_and_menu-row .search_wrap").outerWidth(width);
4891            $(".logo_and_menu-row .search_wrap").css({ opacity: 1, visibility: "visible" });
4892          });
4893      }
4894    }
4895  }
4896};
4897
4898if (!funcDefined("showItemStoresAmount")) {
4899  var showItemStoresAmount = function () {
4900    let blocks = $(".item-stock .status-amount--stores:not(.status-amount--loaded)");
4901    if (blocks.length) {
4902      let stores = [];
4903      let ids = [];
4904
4905      for (let i = 0, cnt = blocks.length; i < cnt; ++i) {
4906        $(blocks[i]).addClass("status-amount--loaded");
4907
4908        var data = $(blocks[i]).data("param-amount");
4909        if (typeof data === "object" && data) {
4910          ids.push(data.ID);
4911          stores = data.STORES;
4912        }
4913      }
4914
4915      if (ids) {
4916        let data = {
4917          ids: ids,
4918          stores: stores,
4919        };
4920
4921        $.ajax({
4922          url: arAsproOptions.SITE_DIR + "ajax/amount.php",
4923          type: "POST",
4924          data: data,
4925          dataType: "json",
4926          success: function (result) {
4927            if (typeof result === "object" && result && result.success && result.amount) {
4928              for (let i = 0, cnt = blocks.length; i < cnt; ++i) {
4929                var data = $(blocks[i]).data("param-amount");
4930                if (typeof data === "object" && data) {
4931                  if (result.amount[data.ID]) {
4932                    $(blocks[i]).html(result.amount[data.ID]);
4933                  }
4934
4935                  $(blocks[i]).addClass("status-amount--visible");
4936                }
4937              }
4938            }
4939          },
4940        });
4941      }
4942    }
4943  };
4944}
4945
4946lazyLoadPagenBlock = function () {
4947  setTimeout(function () {
4948    if ($(".with-load-block .ajax_load_btn:not(.appear-block)").length) {
4949      $(".with-load-block .ajax_load_btn:not(.appear-block)").iAppear(
4950        function () {
4951          var $this = $(this);
4952          $this.addClass("appear-block").trigger("click");
4953        },
4954        { rootMargin: "200px 0px 200px 0px", accX: 0, accY: 200 }
4955      );
4956    }
4957  }, 200);
4958};
4959
4960scrollPreviewBlock = function () {
4961  if (typeof $.cookie("scroll_block") != "undefined" && $.cookie("scroll_block")) {
4962    var scroll_block = $($.cookie("scroll_block"));
4963    if (scroll_block.length) {
4964      let position = scroll_block.offset().top;
4965      let $fixedHeader = null;
4966      if (($fixedHeader = document.getElementById("headerfixed"))) {
4967        position -= $fixedHeader.clientHeight;
4968      }
4969      $("body, html").animate({ scrollTop: position }, 500);
4970    }
4971    $.cookie("scroll_block", null);
4972  }
4973};
4974
4975scrollToBlock = function (block) {
4976  if ($(block).length) {
4977    var offset = $(block).offset().top;
4978    if (typeof $(block).data("toggle") != "undefined") $(block).click();
4979
4980    if (typeof $(block).data("offset") != "undefined") offset += $(block).data("offset");
4981
4982    $("body, html").animate({ scrollTop: offset }, 500);
4983  }
4984};
4985
4986checkMenuLines = function () {
4987  if ($(".front_page .menu-row .left_border").length || $(".front_page .menu-row .right_border").length) {
4988    var positionMenu = $(".centered .menu-row .mega-menu table").length
4989        ? $(".centered .menu-row .mega-menu table").offset().left
4990        : 0,
4991      varFixLineWidth =
4992        $("body").hasClass("with_decorate") && window.matchMedia("(min-width: 1100px)").matches ? 126 : 7;
4993
4994    $(".menu-row .left_border, .menu-row .right_border").css("width", positionMenu - varFixLineWidth);
4995  }
4996};
4997
4998SetFixedAskBlock = function () {
4999  if ($(".ask_a_question_wrapper").length) {
5000    var offset = $(".ask_a_question_wrapper").offset(),
5001      footer_offset = 0,
5002      block = $(".ask_a_question_wrapper").find(".ask_a_question"),
5003      block_offset = BX.pos(block[0]),
5004      block_height = block_offset.bottom - block_offset.top,
5005      diff_top_scroll = $("#headerfixed").height() + 20;
5006
5007    if ($("footer").length) footer_offset = $("footer").offset().top;
5008
5009    if ($(".banner.CONTENT_BOTTOM").length) footer_offset = $(".banner.CONTENT_BOTTOM").offset().top;
5010
5011    if (block_height + diff_top_scroll + documentScrollTopLast + 130 > footer_offset) {
5012      block.removeClass("fixed").css({ top: "auto", width: "auto", bottom: 0 });
5013      block.parent().css("position", "static");
5014      block.parent().parent().css("position", "static");
5015    } else {
5016      block.parent().removeAttr("style");
5017      block.parent().parent().removeAttr("style");
5018
5019      if (documentScrollTopLast + diff_top_scroll > offset.top) {
5020        var fixed_width = $(".fixed_block_fix").width();
5021        block.addClass("fixed").css({ top: diff_top_scroll, bottom: "auto" });
5022        if (fixed_width) block.css({ width: $(".fixed_block_fix").width() });
5023      } else block.removeClass("fixed").css({ top: 0, width: "auto" });
5024    }
5025  }
5026};
5027
5028MegaMenuFixed = function () {
5029  var animationTime = 150,
5030    $megaFixedNlo = $(".mega_fixed_menu").find("[data-nlo]");
5031
5032  $("header .burger, #headerfixed .burger").on("click", function () {
5033    if ($megaFixedNlo.length) {
5034      if (!$megaFixedNlo.hasClass("nlo-loadings")) {
5035        $megaFixedNlo.addClass("nlo-loadings");
5036        setTimeout(function () {
5037          $.ajax({
5038            data: { nlo: $megaFixedNlo.attr("data-nlo") },
5039            success: function (response) {
5040              $megaFixedNlo[0].insertAdjacentHTML("beforebegin", $.trim(response));
5041              $megaFixedNlo.remove();
5042            },
5043            error: function () {
5044              $megaFixedNlo.removeClass("nlo-loadings");
5045            },
5046          });
5047        }, 300);
5048      }
5049    }
5050
5051    $(".mega_fixed_menu").fadeIn(animationTime);
5052  });
5053
5054  $(".mega_fixed_menu .svg.svg-close").on("click", function () {
5055    $(this).closest(".mega_fixed_menu").fadeOut(animationTime);
5056    //$('.header_wrap').toggleClass('zindexed');
5057  });
5058
5059  $(".mega_fixed_menu .dropdown-menu .arrow").on("click", function (e) {
5060    e.preventDefault();
5061    e.stopPropagation();
5062    $(this).closest(".dropdown-submenu").find(".dropdown-menu").slideToggle(animationTime);
5063    $(this).closest(".dropdown-submenu").addClass("opened");
5064  });
5065};
5066
5067CheckPopupTop = function () {};
5068
5069AjaxClickLink = function (e) {
5070  var _this = "",
5071    container = $(".js-load-wrapper"),
5072    container_inner = $(".js-load-wrapper").find(".ajax_load"),
5073    dopAction = "";
5074  url = "";
5075  if ("preventDefault" in e) {
5076    e.preventDefault();
5077    _this = $(e.target).hasClass("js-load-link") ? $(e.target) : $(e.target).closest(".js-load-link");
5078  } else {
5079    _this = $(e);
5080    dopAction = "Y";
5081  }
5082
5083  if (container.length) {
5084    var objUrl = parseUrlQuery(),
5085      obGetData = { ajax_get_filter: "Y", control_ajax: "Y" };
5086
5087    obGetData.bitrix_include_areas = "N";
5088
5089    if ("clear_cache" in objUrl) {
5090      if (objUrl.clear_cache == "Y") {
5091        obGetData.clear_cache = "Y";
5092      }
5093    }
5094
5095    if (container_inner.length) {
5096      container_inner.addClass("loading-state");
5097    } else {
5098      container.addClass("loading-state");
5099    }
5100
5101    if (_this.data("url")) {
5102      url = _this.data("url");
5103    }
5104
5105    if (_this.data("click_block") && $(_this.data("click_block")).length) {
5106      if ($(_this.data("click_block")).data("url")) {
5107        url = $(_this.data("click_block")).data("url");
5108      }
5109    }
5110
5111    if (dopAction) {
5112      BX.PopupWindowManager.getCurrentPopup().close();
5113      $(".bx_filter_select_popup ul li .sort_btn").removeClass("current");
5114      _this.addClass("current");
5115      _this.closest(".bx_filter_block").find(".bx_filter_select_text").text(_this.text());
5116    }
5117
5118    $(".bx_filter .bx_sort_filter .bx_filter_select_text").text(_this.text());
5119    $(".bx_filter .bx_sort_filter .bx_filter_select_popup ul li span.current").removeClass("current");
5120    $(".bx_filter .bx_sort_filter .bx_filter_select_popup ul li")
5121      .eq(_this.parent().index())
5122      .find("span")
5123      .addClass("current");
5124
5125    $.ajax({
5126      url: url,
5127      data: obGetData,
5128      success: function (html) {
5129        container.html(html);
5130
5131        if (container_inner.length) container_inner.removeClass("loading-state");
5132        else container.removeClass("loading-state");
5133
5134        initAnimateLoad();
5135
5136        var eventdata = { action: "jsLoadBlock" };
5137        BX.onCustomEvent("onCompleteAction", [eventdata, _this]);
5138
5139        BX.onCustomEvent("onHeaderProgressBarChange", [{}]);
5140
5141        initSelects(document);
5142        // InitCustomScrollBar();
5143        // InitScrollBar();
5144
5145        if (window.FilterHelper !== undefined) {
5146          FilterHelper.resultDiv = $("#filter-helper");
5147          FilterHelper.show();
5148        }
5149      },
5150    });
5151  }
5152};
5153
5154initCalculatePreview = function (removeAppearAttr) {
5155  $(".calculate-delivery.with_preview:not(.inited)").each(function () {
5156    if (removeAppearAttr) {
5157      $(this).attr("data-i-appeared", "");
5158    }
5159    var $this = $(this);
5160    var $calculateSpan = $this.find("span[data-event=jqm]");
5161    var $preview = $this.find(".calculate-delivery-preview");
5162
5163    $this.addClass("inited");
5164    $this.iAppear(
5165      function () {
5166        if ($calculateSpan.length) {
5167          if (typeof window["calculate-delivery-preview-index"] === "undefined") {
5168            window["calculate-delivery-preview-index"] = 1001;
5169          } else {
5170            ++window["calculate-delivery-preview-index"];
5171          }
5172
5173          var productId = $calculateSpan.attr("data-param-product_id") * 1;
5174          var quantity = $calculateSpan.attr("data-param-quantity") * 1;
5175
5176          if (productId > 0) {
5177            var areaIndexSended = window["calculate-delivery-preview-index"];
5178            $calculateSpan.data({ areaIndex: areaIndexSended });
5179
5180            $.ajax({
5181              url: arAsproOptions["SITE_DIR"] + "ajax/delivery.php",
5182              type: "POST",
5183              data: {
5184                is_preview: "Y",
5185                index: areaIndexSended,
5186                product_id: productId,
5187                quantity: quantity,
5188              },
5189              beforeSend: function () {
5190                $this.addClass("loadings");
5191              },
5192              success: function (response) {
5193                var areaIndex = $calculateSpan.data("areaIndex");
5194                if (typeof areaIndex !== "undefined" && areaIndex == areaIndexSended) {
5195                  $calculateSpan.hide();
5196                  $preview.html(response);
5197                  if (!$preview.find(".catalog-delivery-preview").length) {
5198                    $preview.empty();
5199                    $calculateSpan.show();
5200                  }
5201                }
5202              },
5203              error: function (xhr, ajaxOptions, thrownError) {},
5204              complete: function () {
5205                var areaIndex = $calculateSpan.data("areaIndex");
5206                if (typeof areaIndex !== "undefined" && areaIndex == areaIndexSended) {
5207                  $this.removeClass("loadings");
5208                }
5209              },
5210            });
5211          }
5212        }
5213      },
5214      { accX: 0, accY: 0 }
5215    );
5216  });
5217};
5218
5219/* set price item */
5220if (!funcDefined("setPriceItem")) {
5221  var setPriceItem = function setPriceItem(
5222    main_block,
5223    quantity,
5224    rewrite_price,
5225    check_quantity,
5226    is_sku,
5227    show_percent,
5228    percent
5229  ) {
5230    var old_quantity = main_block.find(".to-cart").attr("data-ratio"),
5231      value =
5232        typeof rewrite_price !== "undefined" && rewrite_price
5233          ? rewrite_price
5234          : main_block.find(".to-cart").attr("data-value"),
5235      currency = main_block.find(".to-cart").attr("data-currency"),
5236      total_block =
5237        '<div class="total_summ" style="display:none;"><div>' +
5238        BX.message("TOTAL_SUMM_ITEM") +
5239        "<span></span></div></div>",
5240      price_block = main_block.find(".cost.prices"),
5241      use_percent = typeof show_percent !== "undefined" && show_percent == "Y",
5242      percent_number = typeof percent !== "undefined" && percent,
5243      sku_checked = main_block.find(".has_offer_prop").length ? "Y" : "N",
5244      check = typeof check_quantity !== "undefined" && check_quantity;
5245
5246    if (main_block.find(".counter_wrapp + .wrapp-one-click").length) {
5247      if (!main_block.find(".wrapp-one-click .total_summ").length && !is_sku)
5248        $(total_block).appendTo(main_block.find(".counter_wrapp + .wrapp-one-click"));
5249    } else if (main_block.find(".buy_block").length) {
5250      if (!main_block.find(".buy_block .total_summ").length && !is_sku)
5251        $(total_block).appendTo(main_block.find(".buy_block"));
5252    } else if (main_block.find(".counter_wrapp").length) {
5253      if (!main_block.find(".counter_wrapp .total_summ").length && !is_sku)
5254        $(total_block).appendTo(main_block.find(".counter_wrapp:first"));
5255    }
5256    if (main_block.find(".total_summ").length) {
5257      if (value && currency) {
5258        if ((1 == quantity && old_quantity == quantity) || (typeof is_sku !== "undefined" && is_sku && !check)) {
5259          main_block.find(".total_summ").slideUp(50);
5260        } else {
5261          main_block.find(".total_summ span").html(BX.Currency.currencyFormat(value * quantity, currency, true));
5262          if (main_block.find(".total_summ").is(":hidden"))
5263            main_block.find(".total_summ").slideDown(100);
5264        }
5265      } else {
5266        main_block.find(".total_summ").slideUp(100);
5267      }
5268    }
5269  };
5270}
5271
5272if (!funcDefined("getCurrentPrice")) {
5273  var getCurrentPrice = function getCurrentPrice(price, currency, print_price) {
5274    var val = "";
5275    var format_value = BX.Currency.currencyFormat(price, currency);
5276    if (print_price.indexOf(format_value) >= 0) {
5277      val = print_price.replace(
5278        format_value,
5279        '<span class="price_value">' + format_value + '</span><span class="price_currency">'
5280      );
5281      val += "</span>";
5282    } else {
5283      val = print_price;
5284    }
5285
5286    return val;
5287  };
5288}
5289
5290if (!funcDefined("initAnimateLoad")) {
5291  var initAnimateLoad = function initAnimateLoad() {
5292    $(".animate-load").click(function () {
5293      if (!jQuery.browser.mobile) {
5294        $(this).parent().addClass("loadings");
5295      }
5296    });
5297  };
5298}
5299
5300if (!funcDefined("showBasketShareBtn")) {
5301  var showBasketShareBtn = function () {
5302    if (arAsproOptions["THEME"]["SHOW_SHARE_BASKET"] === "Y") {
5303      if (!document.querySelector(".basket-checkout-block-btns")) {
5304        var checkout = document.querySelector(".basket-checkout-section-inner");
5305        if (checkout) {
5306          var btns = BX.create({
5307            tag: "div",
5308            attrs: {
5309              class: "basket-checkout-block basket-checkout-block-btns",
5310            },
5311            html: '<div class="basket-checkout-block-btns-wrap"></div>',
5312          });
5313
5314          BX.insertAfter(btns, BX.lastChild(checkout));
5315          var btnsWrap = btns.querySelector(".basket-checkout-block-btns-wrap");
5316
5317          var btnCheckout = checkout.querySelector(".basket-checkout-block-btn");
5318          if (btnCheckout) {
5319            btnsWrap.appendChild(btnCheckout);
5320          }
5321
5322          var btnFastOrder = checkout.querySelector(".fastorder");
5323          if (btnFastOrder) {
5324            btnsWrap.appendChild(btnFastOrder);
5325          }
5326
5327          if ($(".basket-btn-checkout").length && !$(".basket-btn-checkout").hasClass("disabled")) {
5328            var btnShareBasket = BX.create({
5329              tag: "div",
5330              attrs: {
5331                class: "basket-checkout-block basket-checkout-block-share colored_theme_hover_bg-block",
5332                title: arAsproOptions["THEME"]["EXPRESSION_FOR_SHARE_BASKET"],
5333              },
5334              html:
5335                '<span class="animate-load" data-event="jqm" data-param-form_id="share_basket" data-name="share_basket"><i class="svg colored_theme_hover_bg-el-svg"><svg class="svg svg-share" xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path data-name="Ellipse 223 copy 8" d="M1613,203a2.967,2.967,0,0,1-1.86-.661l-3.22,2.01a2.689,2.689,0,0,1,0,1.3l3.22,2.01A2.961,2.961,0,0,1,1613,207a3,3,0,1,1-3,3,3.47,3.47,0,0,1,.07-0.651l-3.21-2.01a3,3,0,1,1,0-4.678l3.21-2.01A3.472,3.472,0,0,1,1610,200,3,3,0,1,1,1613,203Zm0,8a1,1,0,1,0-1-1A1,1,0,0,0,1613,211Zm-8-7a1,1,0,1,0,1,1A1,1,0,0,0,1605,204Zm8-5a1,1,0,1,0,1,1A1,1,0,0,0,1613,199Z" transform="translate(-1602 -197)" fill="#B8B8B8"></path></svg></i><span class="title">' +
5336                arAsproOptions["THEME"]["EXPRESSION_FOR_SHARE_BASKET"] +
5337                "</span></span>",
5338            });
5339
5340            btnsWrap.appendChild(btnShareBasket);
5341            initAnimateLoad();
5342          }
5343        }
5344      }
5345    }
5346  };
5347}
5348
5349if (!funcDefined("showBasketHeadingBtn")) {
5350  var showBasketHeadingBtn = function () {
5351    if (document.querySelector(".page-top h1")) {
5352      var topicHeading = document.querySelector(".page-top .topic .topic__heading");
5353      if (topicHeading) {
5354        if (arAsproOptions["THEME"]["SHOW_BASKET_PRINT"] === "Y") {
5355          if (!document.querySelector(".btn_basket_heading--print")) {
5356            var btnPrintBasket = BX.create({
5357              tag: "div",
5358              attrs: {
5359                class: "btn_basket_heading btn_basket_heading--print print-link colored_theme_hover_bg-block",
5360                title: arAsproOptions["THEME"]["EXPRESSION_FOR_PRINT_PAGE"],
5361              },
5362              html: '<i class="svg colored_theme_hover_bg-el-svg"><svg class="svg svg-print" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path id="Rectangle_665_copy_4" data-name="Rectangle 665 copy 4" class="cls-print" d="M1570,210h-2v3h-8v-3h-2a2,2,0,0,1-2-2v-5a2,2,0,0,1,2-2h2v-4h8v4h2a2,2,0,0,1,2,2v5A2,2,0,0,1,1570,210Zm-8,1h4v-4h-4v4Zm4-12h-4v2h4v-2Zm4,4h-12v5h2v-3h8v3h2v-5Z" transform="translate(-1556 -197)"></path></svg></i>',
5363            });
5364            BX.insertBefore(btnPrintBasket, topicHeading);
5365          }
5366        }
5367
5368        if ($(".basket-btn-checkout").length && !$(".basket-btn-checkout").hasClass("disabled")) {
5369          // if(arAsproOptions['THEME']['SHOW_SEND_BASKET_2EMAIL'] === 'Y'){
5370          // if(!document.querySelector('.btn_basket_heading--send2email')){
5371          // 	var btnSendBasket2Email = BX.create({
5372          // 		tag: 'div',
5373          // 		attrs: {
5374          // 			class: 'btn_basket_heading btn_basket_heading--with_title btn_basket_heading--send2email colored_theme_hover_bg-block',
5375          // 			title: arAsproOptions['THEME']["EXPRESSION_FOR_SEND_BASKET_2EMAIL"],
5376          // 		},
5377          // 		html: '<i class="svg colored_theme_hover_bg-el-svg">
5377<svg class="svg" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 0H4H12H13V1V3.125L15.06 4.4125C15.6448 4.77798 16 5.41892 16 6.1085V6.98162C16.0002 6.99325 16.0002 7.00488 16 7.01649V14C16 15.1046 15.1046 16 14 16H2C0.895429 16 -1.43918e-06 15.1046 -1.43918e-06 14V7.01644C-0.000202747 7.00486 -0.000203195 6.99327 -1.43918e-06 6.98167V6.1085C-1.43918e-06 5.41892 0.355238 4.77798 0.940001 4.4125L3 3.125V1V0ZM5 4.2335L5 2H11V7L11 8.23381L9.62943 9.05615L8.64018 8.23178C8.26934 7.92274 7.73066 7.92274 7.35981 8.23178L6.37057 9.05615L5 8.23381V4.2335ZM2 6.1085L3 5.4835V7.03381L2 6.43381V6.1085ZM14 6.1085L13 5.4835V7.03381L14 6.43381V6.1085ZM12.4379 14L8 10.3017L3.56205 14H12.4379ZM14 12.6983V8.76619L11.2567 10.4122L14 12.6983ZM2 8.76619V12.6983L4.74333 10.4122L2 8.76619Z" fill="#B8B8B8"/></svg></i><span class="title">' + arAsproOptions['THEME']["EXPRESSION_FOR_SEND_BASKET_2EMAIL"] + '</span>',
5378          // 	});
5379          // 	BX.insertBefore(btnSendBasket2Email, topicHeading);
5380          // }
5381          // }
5382
5383          if (arAsproOptions["THEME"]["SHOW_DOWNLOAD_BASKET"] === "Y") {
5384            if (!document.querySelector(".btn_basket_heading--download")) {
5385              var btnDownloadBasket = BX.create({
5386                tag: "div",
5387                attrs: {
5388                  class:
5389                    "btn_basket_heading btn_basket_heading--with_title btn_basket_heading--download colored_theme_hover_bg-block",
5390                  title: arAsproOptions["THEME"]["EXPRESSION_FOR_DOWNLOAD_BASKET"],
5391                },
5392                events: {
5393                  click: BX.proxy(function (e) {
5394                    if (!e) {
5395                      e = window.event;
5396                    }
5397
5398                    BX.PreventDefault(e);
5399
5400                    var button = e.target.closest(".btn_basket_heading");
5401                    if (button) {
5402                      if (BX.hasClass(button, "loadings")) {
5403                        return;
5404                      }
5405
5406                      BX.addClass(button, "loadings");
5407                      setTimeout(function () {
5408                        BX.removeClass(button, "loadings");
5409                      }, 2000);
5410                    }
5411
5412                    location.href =
5413                    arAsproOptions["SITE_DIR"] + "ajax/download_basket.php?params[type]=" +
5414                      arAsproOptions["THEME"]["BASKET_FILE_DOWNLOAD_TEMPLATE"];
5415                  }, this),
5416                },
5417                html:
5418                  '<i class="svg colored_theme_hover_bg-el-svg"><svg class="svg" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 14H14L14 6H11H10V5V2H5V6H7H9V8V10V12H7H5V14ZM13.6716 4L12 2.32843V4H13.6716ZM6 8H7V10H6H5H3H2V8H3H5H6ZM3 6H2H0V8V10V12H2H3V14V16H5H14H16V14V4.32843C16 3.79799 15.7893 3.28929 15.4142 2.91421L13.0858 0.585786C12.7107 0.210714 12.202 0 11.6716 0H5H3V2V6Z" fill="#B8B8B8"/></svg></i><span class="title">' +
5419                  arAsproOptions["THEME"]["EXPRESSION_FOR_DOWNLOAD_BASKET"] +
5420                  "</span>",
5421              });
5422              BX.insertBefore(btnDownloadBasket, topicHeading);
5423            }
5424          }
5425        } else {
5426          BX.remove(document.querySelector(".btn_basket_heading--send2email"));
5427          BX.remove(document.querySelector(".btn_basket_heading--download"));
5428        }
5429
5430        var eventdata = { parent: topicHeading };
5431        BX.onCustomEvent("onShowBasketHeadingBtn", [eventdata]);
5432      }
5433    }
5434  };
5435}
5436
5437$(window).on("load", function () {
5438  //check width for menu and search
5439  //CheckSearchWidth();
5440});
5441
5442$(document).ready(function () {
5443  MegaMenuFixed();
5444  // InitScrollBar();
5445
5446  /* ripple effect for buttons */
5447  $.ripple(".btn", {
5448    debug: false, // Turn Ripple.js logging on/off
5449    on: "mouseenter", // The event to trigger a ripple effect
5450
5451    opacity: 0.4, // The opacity of the ripple
5452    color: "auto", // Set the background color. If set to "auto", it will use the text color
5453    multi: true, // Allow multiple ripples per element
5454
5455    duration: 0.6, // The duration of the ripple
5456
5457    easing: "linear", // The CSS3 easing function of the ripple
5458  });
5459  /* ripple end */
5460
5461  //ecommerce order
5462  if (arAsproOptions["PAGES"]["ORDER_PAGE"]) {
5463    var arUrl = parseUrlQuery();
5464    if ("ORDER_ID" in arUrl) {
5465      var _id = arUrl["ORDER_ID"];
5466      if (arAsproOptions["COUNTERS"]["USE_FULLORDER_GOALS"] !== "N") {
5467        var eventdata = { goal: "goal_order_success", result: _id };
5468        BX.onCustomEvent("onCounterGoals", [eventdata]);
5469      }
5470      if (checkCounters()) {
5471        if (typeof localStorage !== "undefined") {
5472          var val = localStorage.getItem("gtm_e_" + _id),
5473            d = "";
5474          try {
5475            d = JSON.parse(val);
5476          } catch (e) {
5477            d = val;
5478          }
5479          if (typeof d === "object") {
5480            window.dataLayer = window.dataLayer || [];
5481            dataLayer.push({ event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["PURCHASE"], ecommerce: d });
5482          }
5483
5484          if (typeof localStorage !== "undefined") {
5485            localStorage.removeItem("gtm_e_" + _id);
5486          }
5487        }
5488      }
5489    }
5490  }
5491  var bSafary = false;
5492  if (typeof jQuery.browser == "object") bSafary = jQuery.browser.safari;
5493  else if (typeof browser == "object") bSafary = browser.safari;
5494  if (!bSafary) {
5495    CheckTopMenuDotted();
5496    CheckHeaderFixed();
5497    checkMenuLines();
5498  } else {
5499    setTimeout(function () {
5500      $(window).resize(); // need to check resize flexslider & menu
5501      setTimeout(function () {
5502        CheckTopMenuDotted();
5503        CheckHeaderFixed();
5504        checkMenuLines();
5505
5506        setTimeout(function () {
5507          $(window).scroll();
5508        }, 50);
5509      }, 50);
5510    }, 350);
5511  }
5512
5513  showItemStoresAmount();
5514  BX.onCustomEvent("onRenderCaptcha");
5515
5516  if (arAsproOptions["THEME"]["USE_DEBUG_GOALS"] === "Y") $.cookie("_ym_debug", 1, { path: "/" });
5517  else $.cookie("_ym_debug", null, { path: "/" });
5518
5519  /* change type2 menu for fixed */
5520  if ($("#headerfixed .js-nav").length) {
5521    setTimeout(function () {
5522      $("#headerfixed .js-nav").addClass("opacity1");
5523    }, 350);
5524  }
5525
5526  // -- scroll after apply option
5527  if ($(".instagram_ajax").length) {
5528    BX.addCustomEvent("onCompleteAction", function (eventdata) {
5529      if (eventdata.action === "instagrammLoaded") scrollPreviewBlock();
5530    });
5531  } else scrollPreviewBlock();
5532
5533  scrollToTop();
5534  checkVerticalMobileFilter();
5535
5536  $("[data-scroll-block]").click(function () {
5537    var _this = $(this);
5538    if (_this.data("scrollBlock")) {
5539      var target = $(_this.data("scrollBlock"));
5540      if (target.length) {
5541        scroll_block(target);
5542      }
5543    }
5544  });
5545
5546  $.extend($.validator.messages, {
5547    required: BX.message("JS_REQUIRED"),
5548    email: BX.message("JS_FORMAT"),
5549    equalTo: BX.message("JS_PASSWORD_COPY"),
5550    minlength: BX.message("JS_PASSWORD_LENGTH"),
5551    remote: BX.message("JS_ERROR"),
5552  });
5553
5554  $.validator.addMethod(
5555    "regexp",
5556    function (value, element, regexp) {
5557      var re = new RegExp(regexp);
5558      return this.optional(element) || re.test(value);
5559    },
5560    BX.message("JS_FORMAT")
5561  );
5562
5563  $.validator.addMethod(
5564    "filesize",
5565    function (value, element, param) {
5566      return this.optional(element) || element.files[0].size <= param;
5567    },
5568    BX.message("JS_FILE_SIZE")
5569  );
5570
5571  $.validator.addMethod(
5572    "date",
5573    function (value, element, param) {
5574      var status = false;
5575      if (!value || value.length <= 0) {
5576        status = false;
5577      } else {
5578        // html5 date allways yyyy-mm-dd
5579        var re = new RegExp("^([0-9]{4})(.)([0-9]{2})(.)([0-9]{2})$");
5580        var matches = re.exec(value);
5581        if (matches) {
5582          var composedDate = new Date(matches[1], matches[3] - 1, matches[5]);
5583          status =
5584            composedDate.getMonth() == matches[3] - 1 &&
5585            composedDate.getDate() == matches[5] &&
5586            composedDate.getFullYear() == matches[1];
5587        } else {
5588          // firefox
5589          var re = new RegExp("^([0-9]{2})(.)([0-9]{2})(.)([0-9]{4})$");
5590          var matches = re.exec(value);
5591          if (matches) {
5592            var composedDate = new Date(matches[5], matches[3] - 1, matches[1]);
5593            status =
5594              composedDate.getMonth() == matches[3] - 1 &&
5595              composedDate.getDate() == matches[1] &&
5596              composedDate.getFullYear() == matches[5];
5597          }
5598        }
5599      }
5600      return status;
5601    },
5602    BX.message("JS_DATE")
5603  );
5604
5605  $.validator.addMethod(
5606    "extension",
5607    function (value, element, param) {
5608      param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif";
5609      return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
5610    },
5611    BX.message("JS_FILE_EXT")
5612  );
5613
5614  $.validator.addMethod(
5615    "captcha",
5616    function (value, element, params) {
5617      return $.validator.methods.remote.call(this, value, element, {
5618        url: arAsproOptions["SITE_DIR"] + "ajax/check-captcha.php",
5619        type: "post",
5620        data: {
5621          captcha_word: value,
5622          captcha_sid: function () {
5623            return $(element).closest("form").find('input[name="captcha_sid"]').val();
5624          },
5625        },
5626      });
5627    },
5628    BX.message("JS_ERROR")
5629  );
5630
5631  $.validator.addMethod(
5632    "recaptcha",
5633    function (value, element, param) {
5634      var id = $(element).closest("form").find(".g-recaptcha").attr("data-widgetid");
5635      if (typeof id !== "undefined") {
5636        return grecaptcha.getResponse(id) != "";
5637      } else {
5638        return true;
5639      }
5640    },
5641    BX.message("JS_RECAPTCHA_ERROR")
5642  );
5643
5644  $.validator.addClassRules({
5645    confirm_password: {
5646      equalTo: 'input[name="REGISTER[PASSWORD]"]',
5647      minlength: 6,
5648    },
5649    password: {
5650      minlength: 6,
5651    },
5652    inputfile: {
5653      extension: arAsproOptions["THEME"]["VALIDATE_FILE_EXT"],
5654      filesize: 5000000,
5655    },
5656    captcha: {
5657      captcha: "",
5658    },
5659    recaptcha: {
5660      recaptcha: "",
5661    },
5662  });
5663
5664  // init calculate delivery with preview
5665  initCalculatePreview();
5666
5667  // fix calendar popup zIndex
5668  BX.addCustomEvent("onPopupShow", function (popup) {
5669    if (
5670      typeof popup !== "undefined" &&
5671      popup &&
5672      popup.zIndexComponent &&
5673      popup.popupContainer &&
5674      popup.popupContainer.querySelector(".bx-calendar")
5675    ) {
5676      popup.zIndexComponent.setZIndex(3000);
5677    }
5678  });
5679
5680  /* city */
5681  $("select.region").on("change", function () {
5682    var val = parseInt($(this).val());
5683    if ($("select.city").length) {
5684      if (val) {
5685        $("select.city option").hide();
5686        $("select.city option").prop("disabled", "disabled");
5687        $("select.city option[data-parent_section=" + val + "]").prop("disabled", "");
5688        $("select.city option:eq(0)").prop("disabled", "");
5689        $("select.city").ikSelect("reset");
5690        $("select.city option[data-parent_section=" + val + "]").show();
5691      } else $("select.city option").prop("disabled", "disabled");
5692      $("select.city option:eq(0)").prop("disabled", "");
5693      $("select.city").ikSelect("reset");
5694    }
5695  });
5696
5697  $("select.city, select.region").on("change", function () {
5698    var _this = $(this),
5699      val = parseInt(_this.val());
5700    if (_this.hasClass("region")) {
5701      $("select.city option:eq(0)").show();
5702      $("select.city").val(0);
5703    }
5704
5705    if ((_this.hasClass("region") && !val) || _this.hasClass("city")) {
5706      $.ajax({
5707        type: "POST",
5708        data: { ID: val },
5709        success: function (html) {
5710          var ob = BX.processHTML(html);
5711          $(".ajax_items")[0].innerHTML = ob.HTML;
5712          BX.ajax.processScripts(ob.SCRIPT);
5713        },
5714      });
5715    }
5716  });
5717
5718  $(document).on("mouseenter", ".section-gallery-wrapper .section-gallery-wrapper__item", function () {
5719    $(this).siblings().removeClass("_active");
5720    $(this).addClass("_active");
5721  });
5722
5723  $(document).on("mouseleave", ".image_wrapper_block", function () {
5724    const $elements = $(this).find(".section-gallery-wrapper .section-gallery-wrapper__item");
5725    if ($elements.length) {
5726      $elements.removeClass("_active");
5727      $($elements[0]).addClass("_active");
5728    }
5729  });
5730
5731  $(document).on("click", ".hint .icon", function (e) {
5732    var tooltipWrapp = $(this).closest(".hint");
5733
5734    if (tooltipWrapp.hasClass("active")) {
5735      tooltipWrapp.removeClass("active").find(".tooltip").slideUp(200);
5736    } else {
5737      tooltipWrapp.addClass("active");
5738      tooltipWrapp.find(".tooltip").slideDown(200);
5739      tooltipWrapp.find(".tooltip_close").click(function (e) {
5740        e.stopPropagation();
5741        tooltipWrapp.removeClass("active").find(".tooltip").slideUp(100);
5742      });
5743    }
5744    e.stopPropagation();
5745  });
5746
5747  /* toggle */
5748  var $this = this,
5749    previewParClosedHeight = 25;
5750
5751  $("section.toggle > label").prepend($("<i />").addClass("fa fa-plus"));
5752  $("section.toggle > label").prepend($("<i />").addClass("fa fa-minus"));
5753  $("section.toggle.active > p").addClass("preview-active");
5754  $("section.toggle.active > div.toggle-content").slideDown(350, function () {});
5755
5756  $("section.toggle > label").click(function (e) {
5757    var parentSection = $(this).parent(),
5758      parentWrapper = $(this).parents("div.toogle"),
5759      previewPar = false,
5760      isAccordion = parentWrapper.hasClass("toogle-accordion");
5761
5762    if (isAccordion && typeof e.originalEvent != "undefined") {
5763      parentWrapper.find("section.toggle.active > label").trigger("click");
5764    }
5765
5766    parentSection.toggleClass("active");
5767
5768    // Preview Paragraph
5769    if (parentSection.find("> p").get(0)) {
5770      previewPar = parentSection.find("> p");
5771      var previewParCurrentHeight = previewPar.css("height");
5772      previewPar.css("height", "auto");
5773      var previewParAnimateHeight = previewPar.css("height");
5774      previewPar.css("height", previewParCurrentHeight);
5775    }
5776
5777    // Content
5778    var toggleContent = parentSection.find("> div.toggle-content");
5779
5780    if (parentSection.hasClass("active")) {
5781      $(previewPar).animate(
5782        {
5783          height: previewParAnimateHeight,
5784        },
5785        350,
5786        function () {
5787          $(this).addClass("preview-active");
5788        }
5789      );
5790      toggleContent.slideDown(350, function () {});
5791    } else {
5792      $(previewPar).animate(
5793        {
5794          height: previewParClosedHeight,
5795        },
5796        350,
5797        function () {
5798          $(this).removeClass("preview-active");
5799        }
5800      );
5801      toggleContent.slideUp(350, function () {});
5802    }
5803  });
5804
5805  if (typeof $.fn.footable == "function") {
5806    $(".tables-responsive .responsive").footable(); //responsive table
5807  }
5808
5809  $("a[rel=tooltip]").tooltip();
5810  $("span[data-toggle=tooltip]").tooltip();
5811
5812  $(document).on("click", ".toggle .more_items", function () {
5813    $(this).closest(".toggle").find(".collapsed").removeClass("collapsed");
5814    $(this).remove();
5815    if (typeof $(this).data("resize") !== "undefined" && $(this).data("resize")) $(window).resize();
5816  });
5817  $(document).on("click", ".toggle_menu .more_items", function () {
5818    $(this).closest(".toggle_menu").find(".collapsed").addClass("clicked_exp");
5819    $(this).remove();
5820  });
5821
5822  /* search sync */
5823  $(document).on("keyup", ".search-input-div input", function (e) {
5824    var inputValue = $(this).val();
5825    $(".search-input-div input:not(:focus").val(inputValue);
5826
5827    if ($(this).closest("#headerfixed").length) {
5828      if (e.keyCode == 13) $(".search form").submit();
5829    }
5830  });
5831  $(document).on("click", ".search-button-div button", function (e) {
5832    if ($(this).closest("#headerfixed").length) $(".search form").submit();
5833  });
5834
5835  $(".inline-search-show, .inline-search-hide").on("click", function (e) {
5836    CloseMobilePhone();
5837    // Closing hint list of items after search input loses focus
5838    if (e.target.closest(".inline-search-hide")) {
5839      if (typeof jsControl === "object" && jsControl && "onFocusLost" in jsControl) {
5840        jsControl.onFocusLost();
5841      }
5842    }
5843    if (typeof $(this).data("type_search") != "undefined" && $(this).data("type_search") == "fixed")
5844      $(".inline-search-block").addClass("fixed");
5845
5846    if (arAsproOptions["THEME"]["TYPE_SEARCH"] == "fixed") {
5847      $(".inline-search-block.fixed.big .search-input").focus();
5848    }
5849    if (arAsproOptions["THEME"]["TYPE_SEARCH"] != "fixed") {
5850      $("#title-search-input").focus();
5851    }
5852
5853    $(".inline-search-block").toggleClass("show");
5854    if ($(".top-block").length) {
5855      if ($(".inline-search-block").hasClass("show"))
5856        $(".inline-search-block").css("background", $(".top-block").css("background-color"));
5857      else $(".inline-search-block").css("background", "#fff");
5858    }
5859    if (arAsproOptions["THEME"]["TYPE_SEARCH"] == "fixed") {
5860      if ($(".inline-search-block").hasClass("show")) $('<div class="jqmOverlay search"></div>').appendTo("body");
5861      else {
5862        $("#title-search-input").blur();
5863        $(".jqmOverlay").detach();
5864      }
5865    }
5866    // }
5867    // else
5868    // 	location.href = arAsproOptions['PAGES']['CATALOG_PAGE_URL']+'?q';
5869  });
5870
5871  /* close search block */
5872  $("html, body").on("mousedown", function (e) {
5873    if (typeof e.target.className == "string" && e.target.className.indexOf("adm") < 0) {
5874      e.stopPropagation();
5875
5876      var search_target = $(e.target).closest(".title-search-result");
5877      if (
5878        !$(e.target).closest("inline-search-block").length &&
5879        !$(e.target).closest(".dropdown-select.searchtype").length &&
5880        !$(e.target).hasClass("svg") &&
5881        !search_target.length
5882      ) {
5883        $(".inline-search-block").removeClass("show");
5884        $(".title-search-result").hide();
5885        if (arAsproOptions["THEME"]["TYPE_SEARCH"] == "fixed") $(".jqmOverlay.search").detach();
5886      }
5887
5888      if ($("#mobilePhone").length) {
5889        CloseMobilePhone();
5890      }
5891
5892      if ($("#basket_line .basket_fly").length && parseInt($("#basket_line .basket_fly").css("right")) >= 0) {
5893        if (!$(e.target).closest(".basket_wrapp").length) {
5894          $("#basket_line .basket_fly")
5895            .stop()
5896            .animate({ right: -$("#basket_line .basket_fly").outerWidth() }, 150);
5897          $("#basket_line .basket_fly .opener > div").removeClass("cur");
5898          $("#basket_line .basket_fly").removeClass("swiped");
5899        }
5900      }
5901
5902      if (isMobile) {
5903        if (search_target.length) location.href = search_target.attr("href");
5904      }
5905
5906      if (!$(e.target).closest(".js-info-block").length && !$(e.target).closest(".js-show-info-block").length) {
5907        $(".js-show-info-block").removeClass("opened");
5908        $(".js-info-block").fadeOut();
5909      }
5910
5911      if (!$(e.target).closest(".hint.active").length) {
5912        $(".hint.active .icon").trigger("click");
5913      }
5914
5915      var class_name = $(e.target).attr("class");
5916      if (typeof class_name == "undefined" || class_name.indexOf("tooltip") < 0)
5917        //tooltip link
5918        $(".tooltip-link").tooltip("hide");
5919    }
5920  });
5921  $(".inline-search-block")
5922    .find("*")
5923    .on("mousedown", function (e) {
5924      e.stopPropagation();
5925    });
5926
5927  initAnimateLoad();
5928
5929  /* check all opt table items */
5930  $(document).on("change", "input#select_all_items", function () {
5931    var _this = $(this);
5932    var notOfferCount = 0;
5933    var bComplect = _this.closest(".complect_main_wrap").length;
5934    if (bComplect) {
5935      notOfferCount = _this
5936        .closest(".complect_main_wrap")
5937        .find(".catalog-block-view__item .counter_wrapp:not(.ce_cmp_visible) .button_block .to-cart").length;
5938    } else {
5939      notOfferCount = $(
5940        ".table-view__item:not([data-product_type=3]), .table-view-offer-tree .table-view__item[data-product_type=3] .counter_wrapp:not(.ce_cmp_visible)"
5941      ).find(".button_block .to-cart").length;
5942    }
5943    var wishCount = $(
5944      ".table-view__item:not([data-product_type=3]), .table-view-offer-tree .table-view__item[data-product_type=3]"
5945    ).find(".item-icons .wish_item_button .wish_item.to").length;
5946    var allGoodsCount = $(".table-view__item").length;
5947
5948    if (_this.is(":checked")) {
5949      //buy && wish
5950      if (notOfferCount != 0) {
5951        $(".opt_action:not([data-action=compare])").removeClass("no-action");
5952      }
5953
5954      //compare
5955      $(".opt_action[data-action=compare]").removeClass("no-action");
5956
5957      $(".opt_action").addClass("animate-load");
5958      $(".opt_action .text").remove();
5959
5960      //buy
5961      $('<div class="text">(<span>' + notOfferCount + "</span>)</div>").appendTo($(".opt_action[data-action=buy]"));
5962
5963      //wish
5964      $('<div class="text muted">(<span>' + wishCount + "</span>)</div>").appendTo($(".opt_action[data-action=wish]"));
5965
5966      //compare
5967      $('<div class="text muted">(<span>' + allGoodsCount + "</span>)</div>").appendTo(
5968        $(".opt_action[data-action=compare]")
5969      );
5970
5971      $('input[name="chec_item"]').prop("checked", "checked");
5972    } else {
5973      $(".opt_action").addClass("no-action");
5974      $(".opt_action").removeClass("animate-load");
5975      $(".opt_action .text").remove();
5976
5977      $('input[name="chec_item"]').removeAttr("checked");
5978    }
5979
5980    if (_this.closest(".complect_header_block").length && typeof setNewPriceComplect === "function") {
5981      setNewPriceComplect();
5982    }
5983  });
5984
5985  /* check opt table item */
5986  $(document).on("change", "input[name='chec_item']", function () {
5987    var _this = $(this);
5988
5989    var canBuy =
5990      _this.closest(".table-view__item").find(".button_block .to-cart").length ||
5991      _this.closest(".catalog-block-view__item").find(".button_block .to-cart").length;
5992    var isOffer = _this.closest(".main_item_wrapper").attr("data-product_type") == "3" && !canBuy;
5993
5994    if (_this.is(":checked")) {
5995      $(".opt_action").each(function () {
5996        var _this = $(this);
5997
5998        var isBuyAction = _this.attr("data-action") == "buy";
5999        var isFavoriteAction = _this.attr("data-action") == "favorite";
6000
6001        if (isOffer && (isBuyAction || isFavoriteAction)) {
6002          return true;
6003        }
6004
6005        if (isBuyAction && !canBuy) {
6006          return true;
6007        }
6008
6009        if (_this.find(".text").length) {
6010          var count = parseInt(_this.find(".text span").text());
6011          _this.find(".text span").text(++count);
6012        } else {
6013          _this.removeClass("no-action");
6014          _this.addClass("animate-load");
6015          $('<div class="text muted">(<span>1</span>)</div>').appendTo(_this);
6016        }
6017      });
6018    } else {
6019      $(".opt_action").each(function () {
6020        var _this = $(this);
6021
6022        var isBuyAction = _this.attr("data-action") == "buy";
6023        var isFavoriteAction = _this.attr("data-action") == "favorite";
6024
6025        if (isOffer && (isBuyAction || isFavoriteAction)) {
6026          return true;
6027        }
6028
6029        if (isBuyAction && !canBuy) {
6030          return true;
6031        }
6032
6033        if (_this.find(".text").length) {
6034          var count = parseInt(_this.find(".text span").text());
6035          --count;
6036          _this.find(".text span").text(count);
6037
6038          if (!count) {
6039            _this.addClass("no-action");
6040            _this.removeClass("animate-load");
6041            _this.find(".text").remove();
6042          }
6043        }
6044      });
6045    }
6046  });
6047
6048  /* buy|wish|compare opt table items */
6049  $(document).on("click", ".opt_action", function (event) {
6050    var _this = $(this),
6051      action = _this.data("action"),
6052      itemsAll = [],
6053      basketParams = {
6054        type: "multiple",
6055        iblock_id: _this.data("iblock_id"),
6056        action: action,
6057        items: {},
6058      };
6059
6060    if (!_this.hasClass("no-action")) {
6061      $(".opt_action").addClass("no-action");
6062      _this.removeClass("no-action");
6063
6064      $(".table-view__item, .catalog-block-view__item").each(function () {
6065        var _this = $(this);
6066        var canBuy = _this.find(".button_block .to-cart").length;
6067        var add = _this.find('input[name="chec_item"]').is(":checked") && (canBuy || action != "buy");
6068        var addOffer = _this.data("product_type") == "3" && _this.find(".button_block .to-cart").length;
6069        if (add) {
6070          var itemId = addOffer ? _this.find(".button_block .to-cart").data("item") : _this.data("id");
6071          itemsAll.push(_this[0]);
6072          basketParams["items"][itemId] = {};
6073          basketParams["items"][itemId]["id"] = itemId;
6074          basketParams["items"][itemId]["product_type"] = _this.data("product_type");
6075          basketParams["items"][itemId]["quantity"] = _this.find('input[name="quantity"]').val();
6076          if (addOffer) {
6077            basketParams["items"][itemId]["add_offer"] = "Y";
6078          }
6079        }
6080      });
6081
6082      if (basketParams.action === "favorite") {
6083        let itemAction = JItemAction.factory(this, { bindEvents: false, changeState: false, fireGoals: false });
6084        itemAction.data = basketParams;
6085        itemAction.onCompleteEvent = () => {
6086          itemAction.showNotice(itemsAll);
6087        }
6088        itemAction.fireEvent(event);
6089
6090        $(".opt_action").removeClass("no-action");
6091
6092        return;
6093      }
6094
6095      $.ajax({
6096        type: "POST",
6097        url: arAsproOptions["SITE_DIR"] + "ajax/item.php",
6098        data: basketParams,
6099        dataType: "json",
6100        success: function (data) {
6101          if ("STATUS" in data) {
6102            if (data.STATUS !== "OK") {
6103              showBasketError(BX.message(data.MESSAGE) + " <br/>" + data.MESSAGE_EXT);
6104            }
6105
6106            //js notice
6107            if (typeof JNoticeSurface !== "undefined") {
6108              switch (action) {
6109                case "buy":
6110                  JNoticeSurface.get().onAdd2cart(itemsAll);
6111                  break;
6112                case "wish":
6113                  JNoticeSurface.get().onAdd2Delay(itemsAll);
6114                  break;
6115                case "compare":
6116                  JNoticeSurface.get().onAdd2Compare(itemsAll);
6117                  break;
6118                default:
6119                  console.log("nothing");
6120              }
6121            }
6122            //
6123
6124            if ($(".header-cart.fly").length) {
6125              arBasketAsproCounters.DEFAULT = true;
6126              SetActualBasketFlyCounters(true);
6127            } else {
6128              if ($("#ajax_basket").length) {
6129                reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "N", "", true);
6130              } else {
6131                reloadBasketCounters("", true);
6132              }
6133            }
6134          }
6135          _this.parent().removeClass("loadings");
6136          $(".opt_action").removeClass("no-action");
6137        },
6138      });
6139    }
6140  });
6141
6142  //fix opt checked for back in browser
6143  setTimeout(function () {
6144    if ($('.with-opt-buy input[name="chec_item"], .with-opt-buy input[name="select_all_items"]').length) {
6145      $('.with-opt-buy input[name="chec_item"], .with-opt-buy input[name="select_all_items"]').prop("checked", false);
6146    }
6147  }, 1);
6148
6149
6150  $(document).on("click", '*[data-event="jqm"]', function (e) {
6151    e.preventDefault();
6152    e.stopPropagation();
6153
6154    var _this = $(this);
6155    var name = _this.data("name");
6156    if (previewMode && ((name.length && name == "auth") || window.matchMedia("(max-width:400px)").matches)) {
6157      var script = arAsproOptions["SITE_DIR"] + "form/";
6158      var paramsStr = "";
6159      $.each(_this.get(0).attributes, function (index, attr) {
6160        var attrName = attr.nodeName;
6161        var attrValue = _this.attr(attrName);
6162        if (/^data\-param\-(.+)$/.test(attrName)) {
6163          var key = attrName.match(/^data\-param\-(.+)$/)[1];
6164          paramsStr += key + "=" + attrValue + "&";
6165        }
6166      });
6167
6168      script += "?name=" + name + "&" + paramsStr;
6169
6170      if (_this.attr("href") !== undefined) {
6171        script = _this.attr("href");
6172      }
6173
6174      location.href = script;
6175    } else {
6176      if (!$(this).hasClass("clicked")) {
6177        $(this).addClass("clicked");
6178        $(this).jqmEx();
6179        // $(this).trigger("click");
6180      }
6181    }
6182
6183    return false;
6184  });
6185  // }
6186
6187  BX.addCustomEvent("onCompleteAction", function (eventdata, _this) {
6188    try {
6189      if (eventdata.action === "loadForm") {
6190        $(_this).parent().removeClass("loadings");
6191        $(_this).removeClass("clicked");
6192
6193        if ($(_this).hasClass("one_click_buy_trigger")) {
6194          $(".wrapp_one_click > span").removeClass("clicked");
6195          $(".one_click").removeClass("clicked");
6196        } else if ($(_this).hasClass("one_click_buy_basket_trigger")) {
6197          $(".fast_order").removeClass("clicked");
6198        }
6199      } else if (eventdata.action === "loadBasket") {
6200        $(".basket-link.basket").attr("title", $("<div/>").html(arBasketPrices.BASKET_SUMM_TITLE).text());
6201
6202        if (arBasketPrices.BASKET_COUNT > 0) {
6203          $(".basket-link.basket").addClass("basket-count");
6204          $(".basket-link.basket .count").removeClass("empted");
6205          if ($(".basket-link.basket .prices").length)
6206            $(".basket-link.basket .prices").html(arBasketPrices.BASKET_SUMM);
6207        } else {
6208          $(".basket-link.basket").removeClass("basket-count");
6209          $(".basket-link.basket .count").addClass("empted");
6210          if ($(".basket-link.basket .prices").length)
6211            $(".basket-link.basket .prices").html(arBasketPrices.BASKET_SUMM_TITLE_SMALL);
6212        }
6213        $(".basket-link.basket .count").text(arBasketPrices.BASKET_COUNT);
6214
6215        updateBottomIconsPanel(arBasketPrices);
6216      } else if (eventdata.action === "loadActualBasketCompare") {
6217        var compare_count = Object.keys(arBasketAspro.COMPARE).length;
6218        if (compare_count > 0) {
6219          $(".basket-link.compare").addClass("basket-count");
6220          $(".basket-link.compare .count").removeClass("empted");
6221          if ($("#compare_fly").length) $("#compare_fly").removeClass("empty_block");
6222        } else {
6223          $(".basket-link.compare").removeClass("basket-count");
6224          $(".basket-link.compare .count").addClass("empted");
6225          if ($("#compare_fly").length) $("#compare_fly").addClass("empty_block");
6226        }
6227        $(".basket-link.compare .count").text(compare_count);
6228
6229        updateBottomIconsPanel(arBasketAspro);
6230      } else if (eventdata.action === "loadRSS") {
6231      } else if (eventdata.action === "ajaxContentLoaded") {
6232      } else if (eventdata.action === "jsLoadBlock") {
6233        // initCountdown();
6234        setStatusButton();
6235        setTimeout(function () {
6236          InitOwlSlider();
6237        }, 200);
6238        if (typeof initSwiperSlider === "function") {
6239          initSwiperSlider();
6240        }
6241        InitFancyBox();
6242
6243        checkLinkedArticles();
6244        checkLinkedBlocks(".linked-banners-list");
6245        lazyLoadPagenBlock();
6246
6247        if (typeof window["stickySidebar"] !== "undefined") {
6248          window["stickySidebar"].updateSticky();
6249        }
6250      }
6251    } catch (e) {
6252      console.error(e);
6253    }
6254  });
6255
6256  /* slices */
6257  if ($(".banners-small .item.normal-block").length) $(".banners-small .item.normal-block").sliceHeight();
6258  if ($(".teasers .item").length) $(".teasers .item").sliceHeight();
6259  if ($(".wrap-portfolio-front .row.items > div").length)
6260    $(".wrap-portfolio-front .row.items > div").sliceHeight({ row: ".row.items", item: ".item1" });
6261
6262  /* bug fix in ff */
6263  $("img").removeAttr("draggable");
6264
6265  $(".title-tab-heading").on("click", function () {
6266    var container = $(this).parent(),
6267      slide_block = $(this).next(),
6268      bReviewTab = container.hasClass("media_review");
6269
6270    clicked_tab = container.index() + 1;
6271
6272    container.siblings().removeClass("active");
6273
6274    $(".nav.nav-tabs li").removeClass("active");
6275
6276    if (container.hasClass("active")) {
6277      if (bReviewTab) {
6278        $("#reviews_content").slideUp(200, function () {
6279          container.removeClass("active");
6280        });
6281      } else {
6282        slide_block.slideUp(200, function () {
6283          container.removeClass("active");
6284        });
6285      }
6286    } else {
6287      container.addClass("active");
6288      if (bReviewTab) {
6289        $("#reviews_content").slideDown();
6290      } else {
6291        if ($(".tabs_section + #reviews_content").length) $(".tabs_section + #reviews_content").slideUp();
6292        slide_block.slideDown();
6293        if (typeof container.attr("id") !== "undefined" && container.attr("id") == "descr") {
6294          var $gallery = $(".galerys-block");
6295          if ($gallery.length) {
6296            var bTypeBig = $gallery.find(".big_slider").length;
6297            var $slider = bTypeBig ? $gallery.find(".big_slider") : $gallery.find(".small_slider");
6298            var interval = setInterval(function () {
6299              if ($slider.find(".slides .item").attr("style").indexOf("height") === -1) {
6300                $(window).resize();
6301              } else {
6302                clearInterval(interval);
6303              }
6304            }, 100);
6305          }
6306        }
6307      }
6308    }
6309  });
6310
6311  InitOwlSlider();
6312  InitStickySideBar();
6313  InitFancyBox();
6314  InitFancyBoxVideo();
6315
6316  setTimeout(function () {
6317    InitTopestMenuGummi();
6318    isOnceInited = true;
6319    $(".menu.topest").closest(".dotted-flex-1").addClass("dotted-complete");
6320  }, 50);
6321
6322  InitZoomPict();
6323
6324  $(document).on("click", ".captcha_reload", function (e) {
6325    var captcha = $(this).parents(".captcha-row");
6326    e.preventDefault();
6327    $.ajax({
6328      url: arAsproOptions["SITE_DIR"] + "ajax/captcha.php",
6329      success: function (text) {
6330        captcha.find("input[name=captcha_sid],input[name=captcha_code]").val(text);
6331        captcha.find("img").attr("src", "/bitrix/tools/captcha.php?captcha_sid=" + text);
6332        captcha.find("input[name=captcha_word]").val("").removeClass("error");
6333        captcha.find(".captcha_input").removeClass("error").find(".error").remove();
6334      },
6335    });
6336  });
6337
6338  /* show print */
6339  if (arAsproOptions["PAGES"]["BASKET_PAGE"]) {
6340    showBasketHeadingBtn();
6341  } else {
6342    if (arAsproOptions["THEME"]["PRINT_BUTTON"] === "Y") {
6343      setTimeout(function () {
6344        var topicHeading = document.querySelector(".period_wrapper.in-detail-news1 .period_wrapper_inner")
6345          ? document.querySelector(".detail-news1 .period_wrapper .period_wrapper_inner")
6346          : document.querySelector(".page-top .topic .topic__heading")
6347          ? document.querySelector(".page-top .topic .topic__heading")
6348          : null;
6349        if (topicHeading) {
6350          var btnPrint = BX.create({
6351            tag: "div",
6352            attrs: {
6353              class: "print-link colored_theme_hover_bg-block",
6354              title: arAsproOptions["THEME"]["EXPRESSION_FOR_PRINT_PAGE"],
6355            },
6356            html: '<i class="svg colored_theme_hover_bg-el-svg"><svg class="svg svg-print" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path id="Rectangle_665_copy_4" data-name="Rectangle 665 copy 4" class="cls-print" d="M1570,210h-2v3h-8v-3h-2a2,2,0,0,1-2-2v-5a2,2,0,0,1,2-2h2v-4h8v4h2a2,2,0,0,1,2,2v5A2,2,0,0,1,1570,210Zm-8,1h4v-4h-4v4Zm4-12h-4v2h4v-2Zm4,4h-12v5h2v-3h8v3h2v-5Z" transform="translate(-1556 -197)"></path></svg></i>',
6357          });
6358          BX.insertBefore(btnPrint, topicHeading);
6359        }
6360      }, 150);
6361    }
6362  }
6363
6364  $(document).on("click", ".print-link", function () {
6365    window.print();
6366  });
6367
6368  $(".head-block .item-link").on("click", function () {
6369    var _this = $(this);
6370    _this.siblings().removeClass("active");
6371    _this.addClass("active");
6372  });
6373
6374  $("table.table").each(function () {
6375    var _this = $(this),
6376      first_td = _this.find("thead tr th");
6377    if (!first_td.length) first_td = _this.find("thead tr td");
6378    if (first_td.length) {
6379      var j = 0;
6380      _this.find("tbody tr td").each(function (i) {
6381        if (j > first_td.length - 1) j = 0;
6382        $('<div class="th-mobile">' + first_td[j].textContent + "</div>").appendTo($(this));
6383        j++;
6384      });
6385    }
6386  });
6387
6388  if (window.matchMedia("(min-width: 768px)").matches) $(".wrapper_middle_menu.wrap_menu").removeClass("mobile");
6389
6390  if (window.matchMedia("(max-width: 767px)").matches) $(".wrapper_middle_menu.wrap_menu").addClass("mobile");
6391
6392  $(document).on("click", ".menu_top_block .v_bottom a", function (e) {
6393    if ($(e.target).hasClass("toggle_block")) e.preventDefault();
6394  });
6395  $(document).on("click", ".menu_top_block .v_bottom a .toggle_block", function (e) {
6396    var _this = $(this),
6397      menu = _this.closest(".has-child").find("> .dropdown"),
6398      bVisibleMeu = menu.is(":visible"),
6399      animate = bVisibleMeu ? "slideUp" : "slideDown";
6400
6401    if (!_this.hasClass("clicked")) {
6402      _this.addClass("clicked");
6403
6404      menu.stop().slideToggle({
6405        duration: 150,
6406        start: function () {
6407          _this.toggleClass("closed");
6408        },
6409        complete: function () {
6410          _this.removeClass("clicked");
6411
6412          if (typeof window["stickySidebar"] !== "undefined") {
6413            window["stickySidebar"].updateSticky();
6414          }
6415        },
6416      });
6417    }
6418
6419    $(this).closest(".has-child").toggleClass("opened");
6420  });
6421
6422  $(document).on("click", ".show_props", function () {
6423    $(this).prev().stop().slideToggle(333);
6424    $(this).find(".char_title").toggleClass("opened");
6425  });
6426
6427  $(".see_more").on("click", function (e) {
6428    e.preventDefault();
6429    var see_more = $(this).is(".see_more") ? $(this) : $(this).parents(".see_more").first();
6430    var see_moreText = see_more.find("> a").length ? see_more.find("> a") : see_more;
6431    var see_moreHiden = see_more.parent().find("> .d");
6432    if (see_more.hasClass("open")) {
6433      see_moreText.text(BX.message("CATALOG_VIEW_MORE"));
6434      see_more.removeClass("open");
6435      see_moreHiden.hide();
6436    } else {
6437      see_moreText.text(BX.message("CATALOG_VIEW_LESS"));
6438      see_more.addClass("open");
6439      see_moreHiden.show();
6440    }
6441    return false;
6442  });
6443
6444  $(".button.faq_button").click(function (e) {
6445    e.preventDefault();
6446    $(this).toggleClass("opened");
6447    $(".faq_ask .form").slideToggle();
6448  });
6449
6450  $(".staff.list .staff_section .staff_section_title a").click(function (e) {
6451    e.preventDefault();
6452    $(this).parents(".staff_section").toggleClass("opened");
6453    $(this).parents(".staff_section").find(".staff_section_items").stop().slideToggle(600);
6454    $(this).parents(".staff_section_title").find(".opener_icon").toggleClass("opened");
6455  });
6456
6457  $(".jobs_wrapp .item .name").click(function (e) {
6458    $(this).closest(".item").toggleClass("opened");
6459    $(this).closest(".item").find(".description_wrapp").stop().slideToggle(600);
6460    $(this).closest(".item").find(".opener_icon").toggleClass("opened");
6461  });
6462
6463  $(".faq.list .item .q a").on("click", function (e) {
6464    e.preventDefault();
6465    $(this).parents(".item").toggleClass("opened");
6466    $(this).parents(".item").find(".a").stop().slideToggle();
6467    $(this).parents(".item").find(".q .opener_icon").toggleClass("opened");
6468  });
6469
6470  $(".opener_icon").click(function (e) {
6471    e.preventDefault();
6472    $(this).parent().find("a").trigger("click");
6473  });
6474
6475  $(".more_block span").on("click", function () {
6476    var content_offset = $(".catalog_detail .tabs_section").offset();
6477    $("html, body").animate({ scrollTop: content_offset.top - 43 }, 400);
6478  });
6479
6480  $(document).on("click", ".counter_block:not(.basket) .plus", function () {
6481    if (!$(this).parents(".basket_wrapp").length || $(this).parents(".services_in_basket").length) {
6482      if ($(this).parent().data("offers") != "Y") {
6483        var isDetailSKU2 = $(this).parents(".counter_block_wr").length;
6484        input = $(this).parents(".counter_block").find("input[type=text]");
6485        (tmp_ratio = !isDetailSKU2
6486          ? $(this).parents(".counter_wrapp").find(".to-cart").data("ratio")
6487          : $(this).parents("tr").first().find("td.buy .to-cart").data("ratio")),
6488          (isDblQuantity = !isDetailSKU2
6489            ? $(this).parents(".counter_wrapp").find(".to-cart").data("float_ratio")
6490            : $(this).parents("tr").first().find("td.buy .to-cart").data("float_ratio")),
6491          (ratio = isDblQuantity ? parseFloat(tmp_ratio) : parseInt(tmp_ratio, 10)),
6492          (max_value = "");
6493        currentValue = input.val();
6494
6495        if (isDblQuantity)
6496          ratio =
6497            Math.round(ratio * arAsproOptions.JS_ITEM_CLICK.precisionFactor) /
6498            arAsproOptions.JS_ITEM_CLICK.precisionFactor;
6499
6500        curValue = isDblQuantity ? parseFloat(currentValue) : parseInt(currentValue, 10);
6501
6502        curValue += ratio;
6503        if (isDblQuantity) {
6504          curValue =
6505            Math.round(curValue * arAsproOptions.JS_ITEM_CLICK.precisionFactor) /
6506            arAsproOptions.JS_ITEM_CLICK.precisionFactor;
6507        }
6508
6509        if (parseFloat($(this).data("max")) > 0) {
6510          if (input.val() < $(this).data("max")) {
6511            if (curValue <= $(this).data("max")) input.val(curValue);
6512
6513            input.change();
6514          }
6515        } else {
6516          input.val(curValue);
6517          input.change();
6518        }
6519      }
6520    }
6521  });
6522  $(document).on("click", ".counter_block:not(.basket) .minus", function () {
6523    if (!$(this).parents(".basket_wrapp").length || $(this).parents(".services_in_basket").length) {
6524      if ($(this).parent().data("offers") != "Y") {
6525        var isDetailSKU2 = $(this).parents(".counter_block_wr").length;
6526        input = $(this).parents(".counter_block").find("input[type=text]");
6527        (tmp_ratio = !isDetailSKU2
6528          ? $(this).parents(".counter_wrapp").find(".to-cart").data("ratio")
6529          : $(this).parents("tr").first().find("td.buy .to-cart").data("ratio")),
6530          (isDblQuantity = !isDetailSKU2
6531            ? $(this).parents(".counter_wrapp").find(".to-cart").data("float_ratio")
6532            : $(this).parents("tr").first().find("td.buy .to-cart").data("float_ratio")),
6533          (ratio = isDblQuantity ? parseFloat(tmp_ratio) : parseInt(tmp_ratio, 10)),
6534          (max_value = "");
6535        currentValue = input.val();
6536
6537        if (isDblQuantity)
6538          ratio =
6539            Math.round(ratio * arAsproOptions.JS_ITEM_CLICK.precisionFactor) /
6540            arAsproOptions.JS_ITEM_CLICK.precisionFactor;
6541
6542        curValue = isDblQuantity ? parseFloat(currentValue) : parseInt(currentValue, 10);
6543
6544        curValue -= ratio;
6545        if (isDblQuantity) {
6546          curValue =
6547            Math.round(curValue * arAsproOptions.JS_ITEM_CLICK.precisionFactor) /
6548            arAsproOptions.JS_ITEM_CLICK.precisionFactor;
6549        }
6550        const minValue = parseFloat($(this).parents(".counter_block").find(".minus").data("min"));
6551        if (minValue) {
6552          ratio = minValue;
6553        }
6554
6555        if (parseFloat($(this).parents(".counter_block").find(".plus").data("max")) > 0) {
6556          if (currentValue > ratio) {
6557            if (curValue < ratio) {
6558              input.val(ratio);
6559            } else {
6560              input.val(curValue);
6561            }
6562            input.change();
6563          }
6564        } else {
6565          if (curValue > ratio) {
6566            input.val(curValue);
6567          } else {
6568            if (ratio) {
6569              input.val(ratio);
6570            } else if (currentValue > 1) {
6571              input.val(curValue);
6572            }
6573          }
6574          input.change();
6575        }
6576      }
6577    }
6578  });
6579
6580  $(".counter_block input[type=text]").numeric({ allow: "." });
6581
6582  $(document).on("focus", ".counter_block input[type=text]", function (e) {
6583    $(this).addClass("focus");
6584  });
6585
6586  $(document).on("blur", ".counter_block input[type=text]", function (e) {
6587    $(this).removeClass("focus");
6588  });
6589
6590  var timerInitCalculateDelivery = false;
6591  $(document).on("change", ".counter_block input[type=text]", function (e) {
6592    if (!$(this).parents(".basket_wrapp").length) {
6593      var val = $(this).val(),
6594        tmp_ratio = $(this).parents(".counter_wrapp").find(".to-cart").data("ratio")
6595          ? $(this).parents(".counter_wrapp").find(".to-cart").data("ratio")
6596          : $(this).parents("tr").first().find("td.buy .to-cart").data("ratio"),
6597        isDblQuantity = $(this).parents(".counter_wrapp").find(".to-cart").data("float_ratio")
6598          ? $(this).parents(".counter_wrapp").find(".to-cart").data("float_ratio")
6599          : $(this).parents("tr").first().find("td.buy .to-cart").data("float_ratio"),
6600        ratio = isDblQuantity ? parseFloat(tmp_ratio) : parseInt(tmp_ratio, 10),
6601        diff = val % ratio;
6602
6603      if (isDblQuantity) {
6604        ratio =
6605          Math.round(ratio * arAsproOptions.JS_ITEM_CLICK.precisionFactor) /
6606          arAsproOptions.JS_ITEM_CLICK.precisionFactor;
6607        if (
6608          Math.round(diff * arAsproOptions.JS_ITEM_CLICK.precisionFactor) /
6609            arAsproOptions.JS_ITEM_CLICK.precisionFactor ==
6610          ratio
6611        )
6612          diff = 0;
6613      }
6614
6615      if ($(this).hasClass("focus")) {
6616        intCount =
6617          Math.round(
6618            Math.round((val * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / ratio) /
6619              arAsproOptions.JS_ITEM_CLICK.precisionFactor
6620          ) || 1;
6621        val = intCount <= 1 ? ratio : intCount * ratio;
6622        // val -= diff;
6623        val =
6624          Math.round(val * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / arAsproOptions.JS_ITEM_CLICK.precisionFactor;
6625      }
6626
6627      if (parseFloat($(this).parents(".counter_block").find(".plus").data("max")) > 0) {
6628        if (val > parseFloat($(this).parents(".counter_block").find(".plus").data("max"))) {
6629          val = parseFloat($(this).parents(".counter_block").find(".plus").data("max"));
6630          // val -= (val % ratio);
6631        }
6632      }
6633      if (parseFloat($(this).parents(".counter_block").find(".minus").data("min")) > 0) {
6634        if (val < parseFloat($(this).parents(".counter_block").find(".minus").data("min"))) {
6635          val = parseFloat($(this).parents(".counter_block").find(".minus").data("min"));
6636          // val -= (val % ratio);
6637        }
6638      }
6639      if (val < ratio) {
6640        val = ratio;
6641      } else if (!parseFloat(val)) {
6642        val = 1;
6643      }
6644
6645      $(this).parents(".counter_block").parent().parent().find(".to-cart").attr("data-quantity", val);
6646      $(this).parents(".counter_block").parent().parent().parent().find(".one_click").attr("data-quantity", val);
6647      $(this)
6648        .parents(".counter_block")
6649        .parent()
6650        .parent()
6651        .parent()
6652        .parent()
6653        .find(".one_click")
6654        .attr("data-quantity", val); //for offers in list
6655      $(this).parents(".catalog_item_wrapp").find(".inner_wrap.TYPE_1 .one_click").attr("data-quantity", val); //for first type buttons in catalog_block
6656
6657      $(this).val(val);
6658
6659      var $calculate = $(this).closest(".item").length
6660        ? $(this).closest(".item").find(".calculate-delivery")
6661        : $(this).closest(".catalog_detail").find(".calculate-delivery");
6662      if ($calculate.length && !$(this).closest(".buy_services_wrap").length) {
6663        $calculate.each(function () {
6664          var $calculateSpan = $(this).find("span[data-event=jqm]").first();
6665
6666          if ($calculateSpan.length) {
6667            var $clone = $calculateSpan.clone();
6668            $clone.attr("data-param-quantity", val).removeClass("clicked");
6669            $clone.insertAfter($calculateSpan).on("click", function () {
6670              if (!jQuery.browser.mobile) {
6671                $(this).parent().addClass("loadings");
6672              }
6673            });
6674            $calculateSpan.remove();
6675          }
6676
6677          if ($(this).hasClass("with_preview")) {
6678            $(this).removeClass("inited");
6679
6680            if (timerInitCalculateDelivery) {
6681              clearTimeout(timerInitCalculateDelivery);
6682            }
6683
6684            timerInitCalculateDelivery = setTimeout(function () {
6685              initCalculatePreview(true);
6686              timerInitCalculateDelivery = false;
6687            }, 1000);
6688          }
6689        });
6690      }
6691
6692      var eventdata = { type: "change", params: { id: $(this), value: val } };
6693      BX.onCustomEvent("onCounterProductAction", [eventdata]);
6694
6695      if ($(this).closest(".complect-block").length && typeof setNewPriceComplect === "function") {
6696        setNewPriceComplect();
6697      }
6698    }
6699  });
6700
6701  BX.addCustomEvent("onCounterProductAction", function (eventdata) {
6702    if (typeof eventdata != "object") {
6703      eventdata = { type: "undefined" };
6704    }
6705    try {
6706      if (typeof eventdata.type != "undefined") {
6707        if (!eventdata.params.id.closest(".gifts").length) {
6708          // no gift
6709          var obProduct = eventdata.params.id.data("product");
6710          if (eventdata.params.id.closest(".has_offer_prop").length) {
6711            // type1 for offers in element list
6712            if (typeof window["obSkuQuantys"] === "undefined") window["obSkuQuantys"] = {};
6713
6714            window["obSkuQuantys"][eventdata.params.id.closest(".offer_buy_block").find(".to-cart").data("item")] =
6715              eventdata.params.value;
6716          }
6717
6718          if (typeof window[obProduct] == "object") {
6719            if (obProduct == "offersTree") {
6720              let curOffer = eventdata.params.id.closest(".offer_buy_block").find(".to-cart").data("item");
6721              if (curOffer && appAspro.sku.obOffers[curOffer]) {
6722                appAspro.sku.setPriceAction(appAspro.sku.obOffers[curOffer], "", "", appAspro.sku.obOffers[curOffer].item);
6723              }
6724            }
6725            else window[obProduct].setPriceAction("Y");
6726            if ($(".detail_page").length) {
6727              setNewHeader();
6728            }
6729          } else if (eventdata.params.id.length) {
6730            if (
6731              eventdata.params.id.closest(".main_item_wrapper").length &&
6732              !eventdata.params.id.closest(".services-item__buy").length &&
6733              arAsproOptions["THEME"]["SHOW_TOTAL_SUMM"] == "Y"
6734            ) {
6735              setPriceItem(eventdata.params.id.closest(".main_item_wrapper"), eventdata.params.value);
6736            }
6737          }
6738          BX.onCustomEvent("onCounterProductActionResize");
6739        }
6740      }
6741    } catch (e) {
6742      console.error(e);
6743    }
6744  });
6745
6746  /* show basket on hover */
6747  $(document).on("mouseenter", ".wrap_icon.top_basket, #headerfixed .basket-link.basket", function () {
6748    var _this = $(this);
6749    var parent = _this.closest("header, #headerfixed");
6750    var hover_block = parent.find(".basket_hover_block");
6751
6752    if (!hover_block.hasClass("loaded")) {
6753      basketTop("", hover_block);
6754    }
6755  });
6756
6757  /* show basket on click mobile */
6758  $(document).on("click", ".wrap_icon.wrap_basket.top_basket, #headerfixed .basket-link.basket", function (e) {
6759    var _this = $(this);
6760    if (isMobile) {
6761      if (!_this.hasClass("clicked")) {
6762        e.preventDefault();
6763        _this.addClass("clicked");
6764        setTimeout(function () {
6765          _this.removeClass("clicked");
6766        }, 3000);
6767      }
6768    }
6769  });
6770
6771  /* slide cart */
6772  $(document).on("mouseenter", "#basket_line .basket_normal:not(.empty_cart):not(.bcart) .basket_block ", function () {
6773    $(this).closest(".basket_normal").find(".popup").addClass("block");
6774    $(this).closest(".basket_normal").find(".basket_popup_wrapp").stop(true, true).slideDown(150);
6775  });
6776  $(document).on("mouseleave", "#basket_line .basket_normal .basket_block ", function () {
6777    var th = $(this);
6778    $(this)
6779      .closest(".basket_normal")
6780      .find(".basket_popup_wrapp")
6781      .stop(true, true)
6782      .slideUp(150, function () {
6783        th.closest(".basket_normal").find(".popup").removeClass("block");
6784      });
6785  });
6786
6787  $(document).on("click", ".popup_button_basket", function () {
6788    var th = $(".to-cart[data-item=" + $(this).data("item") + "]");
6789
6790    var val = th.attr("data-quantity");
6791
6792    if (!val) $val = 1;
6793
6794    var tmp_props = th.data("props"),
6795      props = "",
6796      part_props = "",
6797      add_props = "N",
6798      fill_prop = {},
6799      iblockid = th.data("iblockid"),
6800      offer = th.data("offers"),
6801      rid = "",
6802      basket_props = "",
6803      item = th.attr("data-item");
6804
6805    if (offer != "Y") {
6806      offer = "N";
6807    } else {
6808      basket_props = th.closest(".prices_tab").find(".bx_sku_props input").val();
6809    }
6810    if (tmp_props) {
6811      props = tmp_props.split(";");
6812    }
6813    if (th.data("part_props")) {
6814      part_props = th.data("part_props");
6815    }
6816    if (th.data("add_props")) {
6817      add_props = th.data("add_props");
6818    }
6819    if ($(".rid_item").length) {
6820      rid = $(".rid_item").data("rid");
6821    } else if (th.data("rid")) {
6822      rid = th.data("rid");
6823    }
6824
6825    fill_prop = fillBasketPropsExt(th, "prop", "bx_ajax_text");
6826
6827    fill_prop.quantity = val;
6828    fill_prop.add_item = "Y";
6829    fill_prop.rid = rid;
6830    fill_prop.offers = offer;
6831    fill_prop.iblockID = iblockid;
6832    fill_prop.part_props = part_props;
6833    fill_prop.add_props = add_props;
6834    fill_prop.props = JSON.stringify(props);
6835    fill_prop.item = item;
6836    fill_prop.basket_props = basket_props;
6837
6838    var isDetail = th.closest(".product-action").length || th.closest("#headerfixed.with-product");
6839    var isSku2 = th.closest(".list-offers").length;
6840    var bIsService = th.closest(".buy_services_wrap").length;
6841
6842    if (!bIsService && (isDetail || isSku2)) {
6843      //var allServicesOn = th.closest('.product-container').find('.buy_services_wrap .services-item [name="buy_switch_services"]:checked');
6844      var allServicesOn = [];
6845      if (isSku2) {
6846        allServicesOn = th
6847          .closest(".product-container")
6848          .find('.buy_services_wrap .services-item [name="buy_switch_services"]:checked');
6849      } else {
6850        allServicesOn = $(".product-container").find(
6851          '.buy_services_wrap[data-parent_product="' + item + '"] .services-item [name="buy_switch_services"]:checked'
6852        );
6853      }
6854      var servicesNeedAdd = [];
6855      allServicesOn.each(function () {
6856        var _this = $(this);
6857        var buttonCart = _this.closest(".services-item").find(".to-cart");
6858
6859        servicesNeedAdd[buttonCart.data("item")] = {};
6860        servicesNeedAdd[buttonCart.data("item")]["id"] = buttonCart.data("item");
6861        servicesNeedAdd[buttonCart.data("item")]["quantity"] = buttonCart.attr("data-quantity");
6862        servicesNeedAdd[buttonCart.data("item")]["iblock_id"] = buttonCart.data("iblockid");
6863      });
6864      servicesNeedAdd = array_values_js(servicesNeedAdd);
6865      fill_prop.services = servicesNeedAdd;
6866    }
6867
6868    $.ajax({
6869      type: "POST",
6870      url: arAsproOptions["SITE_DIR"] + "ajax/item.php",
6871      data: fill_prop,
6872      dataType: "json",
6873      success: function (data) {
6874        $(".basket_error_frame").jqmHide();
6875        if ("STATUS" in data) {
6876          getActualBasket(fill_prop.iblockID);
6877          if (data.STATUS === "OK") {
6878            th.hide();
6879            th.closest(".counter_wrapp").find(".counter_block_inner").hide();
6880            th.closest(".counter_wrapp").find(".counter_block").hide();
6881            th.parents("tr").find(".counter_block_wr .counter_block").hide();
6882            th.closest(".button_block").addClass("wide");
6883            th.parent().find(".in-cart").show();
6884
6885            addBasketCounter(item);
6886
6887            if ($("#ajax_basket").length) reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y");
6888
6889            if ($("#basket_line .basket_fly").length) {
6890              if (th.closest(".fast_view_frame").length || window.matchMedia("(max-width: 767px)").matches)
6891                basketFly("open", "N");
6892              else basketFly("open");
6893            }
6894          } else {
6895            showBasketError(BX.message(data.MESSAGE));
6896          }
6897        } else {
6898          showBasketError(BX.message("CATALOG_PARTIAL_BASKET_PROPERTIES_ERROR"));
6899        }
6900      },
6901    });
6902  });
6903
6904  $(document).on("click", ".to-cart:not(.read_more), .basket_item_add", function (e) {
6905    e.preventDefault();
6906    var th = $(this);
6907    if (!th.hasClass("clicked")) {
6908      th.addClass("clicked");
6909      var val = $(this).attr("data-quantity");
6910      var tmp_props = $(this).data("props"),
6911        props = "",
6912        part_props = "",
6913        add_props = "N",
6914        fill_prop = {},
6915        iblockid = $(this).data("iblockid"),
6916        offer = $(this).data("offers"),
6917        rid = "",
6918        bBannerAction = false,
6919        basket_props = "",
6920        item = $(this).attr("data-item");
6921      if (th.closest(".but-cell").length) {
6922        if ($('.counter_block[data-item="' + item + '"]').length)
6923          val = $('.counter_block[data-item="' + item + '"] input').val();
6924      }
6925
6926      if (th.closest(".banner_buttons.with_actions").length) {
6927        //banner action
6928        var wrapper_btns = th.closest(".wraps_buttons");
6929        item = wrapper_btns.data("id");
6930        bBannerAction = true;
6931      }
6932
6933      if (!val) val = 1;
6934      if (offer != "Y") {
6935        offer = "N";
6936      } else {
6937        basket_props = $(this).closest(".prices_tab").find(".bx_sku_props input").val();
6938      }
6939      if (tmp_props) {
6940        props = tmp_props.split(";");
6941      }
6942      if ($(this).data("part_props")) {
6943        part_props = $(this).data("part_props");
6944      }
6945      if ($(this).data("add_props")) {
6946        add_props = $(this).data("add_props");
6947      }
6948      if ($(".rid_item").length) {
6949        rid = $(".rid_item").data("rid");
6950      } else if ($(this).data("rid")) {
6951        rid = $(this).data("rid");
6952      }
6953
6954      fill_prop = fillBasketPropsExt(th, "prop", th.data("bakset_div"));
6955
6956      fill_prop.quantity = val;
6957      fill_prop.add_item = "Y";
6958      fill_prop.rid = rid;
6959      fill_prop.offers = offer;
6960      fill_prop.iblockID = iblockid;
6961      fill_prop.part_props = part_props;
6962      fill_prop.add_props = add_props;
6963      fill_prop.props = JSON.stringify(props);
6964      fill_prop.item = item;
6965      fill_prop.basket_props = basket_props;
6966
6967      var isDetail = th.closest(".product-action").length || th.closest("#headerfixed.with-product");
6968      var isSku2 = th.closest(".list-offers").length;
6969      var bIsService = th.closest(".buy_services_wrap").length;
6970
6971      if (!bIsService && (isDetail || isSku2)) {
6972        var allServicesOn = [];
6973        if (isSku2) {
6974          allServicesOn = th
6975            .closest(".product-container")
6976            .find('.buy_services_wrap .services-item [name="buy_switch_services"]:checked');
6977        } else {
6978          allServicesOn = $(".product-container").find(
6979            '.buy_services_wrap[data-parent_product="' + item + '"] .services-item [name="buy_switch_services"]:checked'
6980          );
6981        }
6982        var servicesNeedAdd = [];
6983        allServicesOn.each(function () {
6984          var _this = $(this);
6985          var buttonCart = _this.closest(".services-item").find(".to-cart");
6986          servicesNeedAdd[buttonCart.data("item")] = {};
6987          servicesNeedAdd[buttonCart.data("item")]["id"] = buttonCart.data("item");
6988          servicesNeedAdd[buttonCart.data("item")]["quantity"] = buttonCart.attr("data-quantity");
6989          servicesNeedAdd[buttonCart.data("item")]["iblock_id"] = buttonCart.data("iblockid");
6990        });
6991        servicesNeedAdd = array_values_js(servicesNeedAdd);
6992        fill_prop.services = servicesNeedAdd;
6993      }
6994
6995      var servicesWrap = $(this).closest(".buy_services_wrap");
6996      if (bIsService) {
6997        var parent_product = servicesWrap.attr("data-parent_product");
6998        fill_prop["prop[BUY_PRODUCT_PROP]"] = parent_product;
6999        fill_prop["prop[ASPRO_BUY_PRODUCT_ID]"] = parent_product;
7000      }
7001
7002      if (bBannerAction) {
7003        if (th.hasClass("added")) {
7004          location.href = th.data("href");
7005          return false;
7006        } else {
7007          th.attr("title", th.data("title2"));
7008          th.toggleClass("added");
7009        }
7010      }
7011
7012      if (th.data("empty_props") == "N") {
7013        var basket_popup_html = $("#" + th.data("bakset_div")).html();
7014        if (!basket_popup_html && th.closest(".item").find(".basket_props_block").length)
7015          basket_popup_html = th.closest(".item").find(".basket_props_block").html();
7016
7017        showBasketError(basket_popup_html, BX.message("ERROR_BASKET_PROP_TITLE"), "Y", th);
7018        BX.addCustomEvent("onCompleteAction", function (e) {
7019          if (!e.ignoreSelf) {
7020            var eventdata = { action: "loadForm", ignoreSelf: true };
7021            BX.onCustomEvent("onCompleteAction", [eventdata, th[0]]);
7022          }
7023        });
7024      } else {
7025        $.ajax({
7026          type: "POST",
7027          url: arAsproOptions["SITE_DIR"] + "ajax/item.php",
7028          data: fill_prop,
7029          dataType: "json",
7030          success: function (data) {
7031            getActualBasket(fill_prop.iblockID);
7032
7033            var eventdata = { action: "loadForm" };
7034            BX.onCustomEvent("onCompleteAction", [eventdata, th[0]]);
7035            arStatusBasketAspro = {};
7036
7037            if (data !== null) {
7038              if ("STATUS" in data) {
7039                if (data.MESSAGE_EXT === null) data.MESSAGE_EXT = "";
7040                if (data.STATUS === "OK") {
7041                  // th.hide();
7042                  $(".to-cart[data-item=" + item + "]").hide();
7043                  $(".to-cart[data-item=" + item + "]")
7044                    .closest(".counter_wrapp")
7045                    .find(".counter_block_inner")
7046                    .hide();
7047                  $(".to-cart[data-item=" + item + "]")
7048                    .closest(".counter_wrapp")
7049                    .find(".counter_block")
7050                    .hide();
7051                  $(".to-cart[data-item=" + item + "]")
7052                    .parents("tr")
7053                    .find(".counter_block_wr .counter_block")
7054                    .hide();
7055                  $(".to-cart[data-item=" + item + "]")
7056                    .closest(".button_block")
7057                    .addClass("wide");
7058                  // th.parent().find('.in-cart').show();
7059                  $(".in-cart[data-item=" + item + "]").show();
7060
7061                  addBasketCounter(item);
7062
7063                  //js notice
7064                  $bDontOpenBasket = false;
7065                  if (typeof JNoticeSurface !== "undefined") {
7066                    JNoticeSurface.get().onAdd2cart([th[0]]);
7067                    $bDontOpenBasket = true;
7068                  }
7069                  //
7070
7071                  if ($("#ajax_basket").length) reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y");
7072
7073                  if ($("#basket_line .basket_fly").length) {
7074                    if (th.closest(".services_in_basket").length && !window.matchMedia("(max-width: 767px)").matches) {
7075                      basketFly("open", "SHOW"); //need for buy services in basket_fly
7076                    } else if (
7077                      th.closest(".fast_view_frame").length ||
7078                      window.matchMedia("(max-width: 767px)").matches ||
7079                      $("#basket_line .basket_fly.loaded").length
7080                    )
7081                      basketFly("open", "N");
7082                    else {
7083                      if ($bDontOpenBasket) basketFly("open", "N");
7084                      else basketFly("open");
7085                    }
7086                  }
7087
7088                  //need for services on basket_page
7089                  if (th.closest(".services_in_basket_page").length) {
7090                    BX.Sale.BasketComponent.sendRequest("refreshAjax", {
7091                      fullRecalculation: "Y",
7092                      otherParams: {
7093                        param: "N",
7094                      },
7095                    });
7096                  }
7097
7098                  if ($(".top_basket").length) {
7099                    basketTop($bDontOpenBasket ? "" : "open", $(".top_basket").find(".basket_hover_block"));
7100                  }
7101
7102                  if (
7103                    $("#headerfixed .wproducts .ajax_load .btn").length &&
7104                    th.closest(".product-action").length &&
7105                    !th.closest(".js-item-analog").length &&
7106                    th.next(".in-cart").length
7107                  ) {
7108                    var buttonHtml =
7109                      //'<span class="buy_block"><span class="btn btn-default btn-sm slide_offer more type_block">' +
7110                      '<span class="buy_block"><span class="btn btn-default btn-sm more type_block">' +
7111                      th.next(".in-cart").html() +
7112                      "</span></span>";
7113                    $("#headerfixed .wproducts .ajax_load .item-buttons .but-cell").html(buttonHtml);
7114                  }
7115                } else {
7116                  showBasketError(BX.message(data.MESSAGE) + " <br/>" + data.MESSAGE_EXT);
7117                }
7118              } else {
7119                showBasketError(BX.message("CATALOG_PARTIAL_BASKET_PROPERTIES_ERROR"));
7120              }
7121            } else {
7122              // th.hide();
7123              $(".to-cart[data-item=" + item + "]").hide();
7124              $(".to-cart[data-item=" + item + "]")
7125                .closest(".counter_wrapp")
7126                .find(".counter_block_inner")
7127                .hide();
7128              $(".to-cart[data-item=" + item + "]")
7129                .closest(".counter_wrapp")
7130                .find(".counter_block")
7131                .hide();
7132              $(".to-cart[data-item=" + item + "]")
7133                .parents("tr")
7134                .find(".counter_block_wr .counter_block")
7135                .hide();
7136              $(".to-cart[data-item=" + item + "]")
7137                .closest(".button_block")
7138                .addClass("wide");
7139              // th.parent().find('.in-cart').show();
7140              $(".in-cart[data-item=" + item + "]").show();
7141
7142              addBasketCounter(item);
7143
7144              if ($("#ajax_basket").length) reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y");
7145
7146              if ($("#basket_line .basket_fly").length) {
7147                if (
7148                  th.closest(".fast_view_frame").length ||
7149                  window.matchMedia("(max-width: 767px)").matches ||
7150                  $("#basket_line .basket_fly.loaded").length
7151                )
7152                  basketFly("open", "N");
7153                else basketFly("open");
7154              }
7155            }
7156          },
7157        });
7158      }
7159    }
7160  });
7161
7162  $(document).on("click", ".to-subscribe", function (e) {
7163    e.preventDefault();
7164    var th = $(this);
7165    if (!th.hasClass("clicked")) {
7166      th.addClass("clicked");
7167      if ($(this).is(".auth")) {
7168        if ($(this).hasClass("nsubsc")) {
7169          $(this).jqmEx();
7170          // $(this).trigger("click");
7171        } else {
7172          location.href = arAsproOptions["SITE_DIR"] + "auth/?backurl=" + location.pathname;
7173        }
7174      } else {
7175        var item = $(this).attr("data-item"),
7176          iblockid = $(this).attr("data-iblockid");
7177        // $(this).hide();
7178        $(".to-subscribe[data-item=" + item + "]").hide();
7179        $(".to-subscribe[data-item=" + item + "]")
7180          .parent()
7181          .find(".in-subscribe")
7182          .show();
7183        $.get(
7184          arAsproOptions["SITE_DIR"] + "ajax/item.php?item=" + item + "&subscribe_item=Y",
7185          $.proxy(function (data) {
7186            arStatusBasketAspro = {};
7187            getActualBasket(iblockid);
7188          })
7189        );
7190        th.removeClass("clicked");
7191      }
7192    }
7193  });
7194
7195  $(document).on("click", ".in-subscribe", function (e) {
7196    e.preventDefault();
7197    var item = $(this).attr("data-item"),
7198      iblockid = $(this).attr("data-iblockid");
7199    // $(this).hide();
7200    $(".in-subscribe[data-item=" + item + "]").hide();
7201    $(".in-subscribe[data-item=" + item + "]")
7202      .parent()
7203      .find(".to-subscribe")
7204      .removeClass("clicked");
7205    $(".in-subscribe[data-item=" + item + "]")
7206      .parent()
7207      .find(".to-subscribe")
7208      .show();
7209    $.get(
7210      arAsproOptions["SITE_DIR"] + "ajax/item.php?item=" + item + "&subscribe_item=Y",
7211      $.proxy(function (data) {
7212        getActualBasket(iblockid);
7213        arStatusBasketAspro = {};
7214      })
7215    );
7216  });
7217
7218  $(document).on("click", ".item_main_info .item_slider .flex-direction-nav li span", function (e) {
7219    if ($(".inner_slider .slides_block").length) {
7220      if ($(this).parent().hasClass("flex-nav-next")) $(".inner_slider .slides_block li.current").next().click();
7221      else $(".inner_slider .slides_block li.current").prev().click();
7222    }
7223  });
7224
7225  $(document).on("click", ".compare_item, .compare_item_add", function (e) {
7226    e.preventDefault();
7227    var item = $(this).attr("data-item");
7228    var iblockID = $(this).attr("data-iblock"),
7229      bBannerAction = false,
7230      th = $(this);
7231
7232    if (th.closest(".banner_buttons.with_actions").length) {
7233      //banner action
7234      var wrapper_btns = th.closest(".wraps_buttons");
7235      item = wrapper_btns.data("id");
7236      iblockID = wrapper_btns.data("iblockid");
7237      bBannerAction = true;
7238
7239      th.toggleClass("added");
7240
7241      if (th.hasClass("added")) th.attr("title", th.data("title2"));
7242      else th.attr("title", th.data("title"));
7243    }
7244
7245    if (!th.hasClass("clicked")) {
7246      th.addClass("clicked");
7247      if (!$(this).hasClass("text")) {
7248        if ($(this).hasClass("added")) {
7249          if (!bBannerAction) {
7250            $(this).hide();
7251            $(this).closest(".compare_item_button").find(".to").show();
7252          }
7253
7254          /* sync other button */
7255          $(".like_icons").each(function () {
7256            if ($(this).find('.compare_item.text[data-item="' + item + '"]').length) {
7257              $(this)
7258                .find('.compare_item.text[data-item="' + item + '"]')
7259                .removeClass("added");
7260              $(this)
7261                .find('.compare_item.text[data-item="' + item + '"]')
7262                .find(".value")
7263                .show();
7264              $(this)
7265                .find('.compare_item.text[data-item="' + item + '"]')
7266                .find(".value.added")
7267                .hide();
7268            }
7269            if ($(this).find(".compare_item_button").length) {
7270              $(this)
7271                .find(".compare_item_button")
7272                .find('.compare_item[data-item="' + item + '"].in')
7273                .hide();
7274              $(this)
7275                .find(".compare_item_button")
7276                .find('.compare_item[data-item="' + item + '"].to')
7277                .show();
7278            }
7279          });
7280        } else {
7281          if (!bBannerAction) {
7282            $(this).hide();
7283            $(this).closest(".compare_item_button").find(".in").show();
7284          }
7285
7286          /* sync other button */
7287          $(".like_icons").each(function () {
7288            if ($(this).find('.compare_item.text[data-item="' + item + '"]').length) {
7289              $(this)
7290                .find('.compare_item.text[data-item="' + item + '"]')
7291                .addClass("added");
7292              $(this)
7293                .find('.compare_item.text[data-item="' + item + '"]')
7294                .find(".value")
7295                .hide();
7296              $(this)
7297                .find('.compare_item.text[data-item="' + item + '"]')
7298                .find(".value.added")
7299                .css({ display: "block" });
7300            }
7301            if ($(this).find(".compare_item_button").length) {
7302              $(this)
7303                .find(".compare_item_button")
7304                .find('.compare_item[data-item="' + item + '"].to')
7305                .hide();
7306              $(this)
7307                .find(".compare_item_button")
7308                .find('.compare_item[data-item="' + item + '"].in')
7309                .show();
7310            }
7311          });
7312        }
7313      } else {
7314        if (!$(this).hasClass("added")) {
7315          $(".compare_item[data-item=" + item + "]").addClass("added");
7316          $(".compare_item[data-item=" + item + "]")
7317            .find(".value")
7318            .hide();
7319          $(".compare_item[data-item=" + item + "]")
7320            .find(".value.added")
7321            .css("display", "block");
7322
7323          /* sync other button */
7324          $(".like_icons").each(function () {
7325            if ($(this).find(".compare_item_button").length) {
7326              $(this)
7327                .find(".compare_item_button")
7328                .find('.compare_item[data-item="' + item + '"]')
7329                .addClass("added");
7330              $(this)
7331                .find(".compare_item_button")
7332                .find('.compare_item[data-item="' + item + '"]')
7333                .find(".value.added")
7334                .show();
7335              $(this)
7336                .find(".compare_item_button")
7337                .find('.compare_item[data-item="' + item + '"]')
7338                .find(".value")
7339                .hide();
7340            }
7341          });
7342        } else {
7343          $(".compare_item[data-item=" + item + "]").removeClass("added");
7344          $(".compare_item[data-item=" + item + "]")
7345            .find(".value")
7346            .show();
7347          $(".compare_item[data-item=" + item + "]")
7348            .find(".value.added")
7349            .hide();
7350
7351          /* sync other button */
7352          $(".like_icons").each(function () {
7353            if ($(this).find(".compare_item_button").length) {
7354              $(this)
7355                .find(".compare_item_button")
7356                .find('.compare_item[data-item="' + item + '"]')
7357                .removeClass("added");
7358              $(this)
7359                .find(".compare_item_button")
7360                .find('.compare_item[data-item="' + item + '"]')
7361                .find(".value")
7362                .show();
7363              $(this)
7364                .find(".compare_item_button")
7365                .find('.compare_item[data-item="' + item + '"]')
7366                .find(".value.added")
7367                .hide();
7368            }
7369          });
7370        }
7371      }
7372
7373      $.get(
7374        arAsproOptions["SITE_DIR"] + "ajax/item.php?item=" + item + "&compare_item=Y&iblock_id=" + iblockID,
7375        $.proxy(function (data) {
7376          getActualBasket(iblockID, "Compare");
7377          arStatusBasketAspro = {};
7378
7379          // js notice
7380          if (
7381            typeof JNoticeSurface !== "undefined" &&
7382            ((!bBannerAction && !th.hasClass("added")) || (bBannerAction && th.hasClass("added")))
7383          ) {
7384            JNoticeSurface.get().onAdd2Compare([th[0]]);
7385          }
7386          //
7387
7388          if ($("#compare_fly").length) {
7389            jsAjaxUtil.InsertDataToNode(
7390              arAsproOptions["SITE_DIR"] + "ajax/show_compare_preview_fly.php",
7391              "compare_fly",
7392              false
7393            );
7394          }
7395          th.removeClass("clicked");
7396        })
7397      );
7398    }
7399  });
7400
7401  $(document).on("click", ".tabs>li", function () {
7402    var parent = $(this).parent();
7403    if (!$(this).hasClass("active")) {
7404      var sliderIndex = $(this).index(),
7405        curLiNav = $(this)
7406          .closest(".top_block")
7407          .find(".slider_navigation")
7408          .find(">li:eq(" + sliderIndex + ")"),
7409        curLi = $(this)
7410          .closest(".top_block")
7411          .siblings(".tabs_content")
7412          .find(">li:eq(" + sliderIndex + ")");
7413      $(this).addClass("active").addClass("cur").siblings().removeClass("active").removeClass("cur");
7414      curLi.addClass("cur").siblings().removeClass("cur");
7415      curLiNav.addClass("cur").siblings().removeClass("cur");
7416
7417      if (parent.hasClass("ajax")) {
7418        // front tabs
7419        if (!$(this).hasClass("clicked")) {
7420          $.ajax({
7421            url: arAsproOptions["SITE_DIR"] + "include/mainpage/comp_catalog_ajax.php",
7422            type: "POST",
7423            data: {
7424              AJAX_POST: "Y",
7425              FILTER_HIT_PROP: $(this).data("code"),
7426              AJAX_PARAMS: $(this).closest(".tab_slider_wrapp").find(".request-data").data("value"),
7427              GLOBAL_FILTER: curLi.data("filter"),
7428            },
7429            success: function (html) {
7430              curLi.find(".tabs_slider").html(html);
7431              var container = curLi.closest(".content_wrapper_block");
7432              if (container.length) {
7433                var bNav = curLi.find(".bottom_nav .module-pagination").length > 0;
7434                if (bNav) {
7435                  container.removeClass("without-border");
7436                } else {
7437                  container.addClass("without-borded");
7438                }
7439              }
7440              setTimeout(function () {
7441                curLi.addClass("opacity1");
7442              }, 100);
7443
7444              BX.onCustomEvent("onAjaxResponesTabs", [eventdata]);
7445            },
7446          });
7447          $(this).addClass("clicked");
7448        } else {
7449          var container = curLi.closest(".content_wrapper_block");
7450          if (container.length) {
7451            var bNav = curLi.find(".bottom_nav .module-pagination").length > 0;
7452            if (bNav) {
7453              container.removeClass("without-border");
7454            } else {
7455              container.addClass("without-borded");
7456            }
7457          }
7458        }
7459      }
7460
7461      var eventdata = { index: sliderIndex, target: $(this) };
7462      BX.onCustomEvent("clickedTabsLi", [eventdata]);
7463    }
7464  });
7465
7466  /* search click */
7467  $(".search_block .icon").on("click", function () {
7468    var th = $(this);
7469    if ($(this).hasClass("open")) {
7470      $(this).closest(".center_block").find(".search_middle_block").removeClass("active");
7471      $(this).removeClass("open");
7472      $(this).closest(".center_block").find(".search_middle_block").find(".noborder").hide();
7473    } else {
7474      setTimeout(function () {
7475        th.closest(".center_block").find(".search_middle_block").find(".noborder").show();
7476      }, 100);
7477      $(this).closest(".center_block").find(".search_middle_block").addClass("active");
7478      $(this).addClass("open");
7479    }
7480  });
7481
7482  $(document).on("click", ".no_goods .button", function () {
7483    $(".bx_filter .smartfilter .bx_filter_search_reset").trigger("click");
7484  });
7485
7486  $(document).on("click", ".js-load-link", function (e) {
7487    AjaxClickLink(e);
7488  });
7489
7490  $(document).on("click", ".svg-inline-bottom_nav-icon", function () {
7491    $(this).next().trigger("click");
7492  });
7493  $(document).on("click", ".ajax_load_btn", function () {
7494    var _this = $(this),
7495      url = _this.closest(".container").find(".module-pagination .flex-direction-nav .flex-next").attr("href"),
7496      th = _this.find(".more_text_ajax"),
7497      bottom_nav = _this.closest(".bottom_nav"),
7498      mobileBottomNav = bottom_nav.hasClass("mobile_slider"),
7499      bLoadingState = _this.closest(".animate-load-state").length;
7500
7501    if (!th.hasClass("loading")) {
7502      th.addClass("loading");
7503      if (mobileBottomNav) {
7504        var icon = bottom_nav.find(".svg-inline-bottom_nav-icon");
7505        icon.css("display", "none");
7506      }
7507      if (bLoadingState) _this.addClass("loadings");
7508
7509      var objUrl = parseUrlQuery(),
7510        add_url = "";
7511      obGetData = { ajax_get: "Y", AJAX_REQUEST: "Y" };
7512
7513      if (_this.closest(".wrapper_inner.front").length) {
7514        //index page
7515        var class_block = th.closest(".drag-block").data("class").replace("_drag", "");
7516        class_block = class_block.replace(/\s/g, "");
7517        obGetData.BLOCK = class_block;
7518      }
7519
7520      if (_this.closest(".tab").length) {
7521        //tabs block
7522        var parentTab = th.closest(".tab");
7523        obGetData.FILTER_HIT_PROP = parentTab.data("code");
7524        obGetData.GLOBAL_FILTER = parentTab.data("filter");
7525        url = _this.closest(".bottom_nav").find(".module-pagination .flex-direction-nav .flex-next").attr("href");
7526      }
7527
7528      if (_this.closest(".content_linked_goods").length) {
7529        //linked_goods block in content
7530        var filterSections = th.closest(".content_linked_goods").attr("data-sections-ids");
7531        obGetData.ajax_section_id = decodeURIComponent(filterSections);
7532
7533        url = _this.closest(".bottom_nav").find(".module-pagination .flex-direction-nav .flex-next").attr("href");
7534      }
7535
7536      if ("clear_cache" in objUrl) {
7537        if (objUrl.clear_cache == "Y") add_url = "&clear_cache=Y";
7538      }
7539      if (_this.hasClass("ajax")) obGetData.ajax = "y";
7540
7541      if (th.closest(".goods-block.ajax_load")) obGetData.bitrix_include_areas = "N";
7542
7543      if (_this.closest(".nav-data_block").length) {
7544        //need data-block
7545        obGetData.data_block = _this.closest(".nav-data_block").attr("data-block");
7546        obGetData.pagen_data_block = "Y";
7547        url = _this.closest(".bottom_nav").find(".module-pagination .flex-direction-nav .flex-next").attr("href");
7548      }
7549
7550      $.ajax({
7551        url: url + add_url,
7552        data: obGetData,
7553        success: function (html) {
7554          pasteAjaxPagination(html, th, bottom_nav, bLoadingState, _this);
7555        },
7556        error: function (html) {
7557          pasteAjaxPagination(html.responseText, th, bottom_nav, bLoadingState, _this);
7558        },
7559      });
7560    }
7561  });
7562
7563  function pasteAjaxPagination(html, th, bottom_nav, bLoadingState, _this) {
7564    var mobileBottomClicked = bottom_nav.hasClass("mobile_slider");
7565    var hasMobileBottomNav = $(html).find(".bottom_nav.mobile_slider");
7566    var bottomNav = hasMobileBottomNav.length ? hasMobileBottomNav : $(html).find(".bottom_nav");
7567    var bottomNavHtml = bottomNav.html();
7568    var bottomNavScrollClass = bottomNav.data("scroll-class");
7569    var hasBottomNav = $(html).find(".ajax_load_btn").length;
7570
7571    if (th.closest(".ajax_load").length && !mobileBottomClicked) {
7572      th.removeClass("loading");
7573      if (th.closest(".ajax_load").find(".js_append").length) {
7574        if (_this.closest(".catalog_in_content").length) {
7575          th.closest(".ajax_load").find(".js_append").append($(".inner_wrapper .js_wrapper_items>", html)); //need for brands & landings
7576        } else if (_this.closest(".catalog.search").length) {
7577          th.closest(".ajax_load").find(".js_append").append($(".js_append>", html));
7578        } else {
7579          th.closest(".ajax_load").find(".js_append").append(html);
7580        }
7581        th.closest(".ajax_load").find(".bottom_nav_wrapper").remove();
7582      } else {
7583        if ($(".display_list").length) {
7584          $(".display_list").append(html);
7585          th.closest(".display_list").find(".bottom_nav_wrapper").remove();
7586        } else if ($(".block_list").length) {
7587          $(".block_list").append(html);
7588          touchItemBlock(".catalog_item a");
7589          th.closest(".block_list").find(".bottom_nav_wrapper").remove();
7590        } else if ($(".module_products_list").length) {
7591          $(".module_products_list > tbody").append(html);
7592          th.closest(".module_products_list > tbody").find(".bottom_nav_wrapper").remove();
7593        }
7594      }
7595
7596      setStatusButton();
7597      checkLinkedArticles();
7598      checkLinkedBlocks(".linked-banners-list");
7599
7600      var eventdata = { action: "ajaxContentLoadedTab" };
7601      BX.onCustomEvent("onAjaxSuccess", [eventdata]);
7602      _this.closest(".bottom_nav").html(bottomNavHtml);
7603    } else {
7604      var eventdata = { action: "ajaxContentLoaded" };
7605
7606      if ($(".banners-small.front").length) {
7607        $(".banners-small .items.row").append(html);
7608        $(".bottom_nav").html($(".banners-small .items.row .bottom_nav").html());
7609        $(".banners-small .items.row .bottom_nav").remove();
7610        if (hasBottomNav) {
7611          $(".banners-small .items.row").addClass("has-bottom-nav");
7612        } else {
7613          $(".banners-small .items.row").removeClass("has-bottom-nav");
7614        }
7615      } else {
7616        if (bottom_nav.data("append") !== undefined && bottom_nav.data("parent") !== undefined) {
7617          var target = html;
7618          if (bottom_nav.data("target") !== undefined) {
7619            target = $(html).find(bottom_nav.data("target"));
7620          }
7621          if (mobileBottomClicked || hasMobileBottomNav.length) {
7622            var mobileSliderNav = th.closest(bottom_nav.data("parent")).find(".bottom_nav.mobile_slider");
7623            if (mobileSliderNav.length) {
7624              mobileSliderNav.before(target);
7625            } else {
7626              bottom_nav.before(target);
7627            }
7628          } else {
7629            th.closest(bottom_nav.data("parent")).find(bottom_nav.data("append")).append(target);
7630          }
7631          th.closest(bottom_nav.data("parent")).find(bottom_nav.data("append")).find(".bottom_nav_wrapper").remove();
7632
7633          if (hasBottomNav) {
7634            if (bottomNavScrollClass !== undefined) {
7635              th.closest(bottom_nav.data("parent")).find(bottomNavScrollClass).addClass("has-bottom-nav");
7636            }
7637            th.closest(bottom_nav.data("parent")).find(bottom_nav.data("append")).addClass("has-bottom-nav");
7638          } else {
7639            if (bottomNavScrollClass !== undefined) {
7640              th.closest(bottom_nav.data("parent")).find(bottomNavScrollClass).removeClass("has-bottom-nav");
7641            }
7642            th.closest(bottom_nav.data("parent")).find(bottom_nav.data("append")).removeClass("has-bottom-nav");
7643          }
7644
7645          bottom_nav = th.closest(bottom_nav.data("parent")).find(".bottom_nav");
7646          bottom_nav.html(bottomNavHtml);
7647          var icon = bottom_nav.find(".svg-inline-bottom_nav-icon");
7648          icon.css("display", "");
7649
7650          eventdata.container = th.closest(bottom_nav.data("parent"));
7651        } else {
7652          if (th.closest(".item-views").find(".items").length) {
7653            th.closest(".item-views").find(".items").append(html);
7654          } else {
7655            $(html).insertBefore($(".blog .bottom_nav"));
7656          }
7657
7658          bottom_nav.html($(".bottom_nav:hidden").html());
7659          if (hasBottomNav) {
7660            th.closest(".item-views").find(".items").addClass("has-bottom-nav");
7661          } else {
7662            th.closest(".item-views").find(".items").removeClass("has-bottom-nav");
7663          }
7664          _this.closest(".item-views").find(".bottom_nav:hidden").remove();
7665        }
7666      }
7667
7668      eventdata.content = html;
7669      eventdata.container = th;
7670      BX.onCustomEvent("onCompleteAction", [eventdata, th[0]]);
7671
7672      setTimeout(function () {
7673        $(".banners-small .item.normal-block").sliceHeight({ resize: false });
7674        if ($(".item.slice-item").length) {
7675          $(".item.slice-item .title").sliceHeight({ resize: false });
7676          $(".item.slice-item").sliceHeight({ resize: false });
7677        }
7678        th.removeClass("loading");
7679        if (bLoadingState) _this.removeClass("loadings");
7680      }, 100);
7681    }
7682    BX.onCustomEvent("onHeaderProgressBarChange", [{}]);
7683    // initCountdown();
7684  }
7685
7686  // form rating
7687  $(document).on("mouseenter", ".form .votes_block.with-text .item-rating", function () {
7688    var $this = $(this),
7689      index = $this.index(),
7690      ratingValue = $this.data("rating_value"),
7691      ratingMessage = $this.data("message");
7692
7693    $(this).addClass("filed");
7694    $this.siblings().each(function () {
7695      if ($(this).index() <= index) $(this).addClass("filed");
7696      else $(this).removeClass("filed");
7697    });
7698    $this.closest(".votes_block").find(".rating_message").text(ratingMessage);
7699  });
7700
7701  $(document).on("mouseleave", ".form .votes_block.with-text", function () {
7702    var $this = $(this),
7703      index = $this.data("rating"),
7704      ratingMessage = $this.closest(".votes_block").find(".rating_message").data("message");
7705
7706    $this.find(".item-rating").each(function () {
7707      if ($(this).index() < index && index !== undefined) $(this).addClass("filed");
7708      else $(this).removeClass("filed");
7709    });
7710    $this.closest(".votes_block").find(".rating_message").text(ratingMessage);
7711  });
7712
7713  $(document).on("click", ".form .votes_block.with-text .item-rating", function () {
7714    var $this = $(this),
7715      rating = $this.closest(".votes_block").data("rating"),
7716      index = $this.index() + 1,
7717      ratingMessage = $this.data("message");
7718
7719    $this.closest(".votes_block").data("rating", index);
7720    if ($this.closest(".form-control").find("input[name=RATING]").length) {
7721      $this.closest(".form-control").find("input[name=RATING]").val(index);
7722    } else {
7723      $this.closest(".form-control").find("input[data-sid=RATING]").val(index);
7724    }
7725    $this.closest(".votes_block").find(".rating_message").data("message", ratingMessage);
7726
7727    $this.closest(".form").find(".error").remove();
7728  });
7729
7730  $(document).on("paste, change, keyup", ".form.blog-comment-fields input[required]", function () {
7731    let value = $(this).val();
7732
7733    if (value.length) {
7734      $(this).closest(".form-group").find("label.error").remove();
7735    }
7736  });
7737
7738  //set cookie for basket link click
7739  $(document).on(
7740    "click",
7741    ".bx_ordercart_order_table_container .control > a, .basket-item-actions-remove, a[data-entity=basket-item-remove-delayed]",
7742    function (e) {
7743      $.removeCookie("click_basket", { path: "/" });
7744      $.cookie("click_basket", "Y", { path: "/" });
7745    }
7746  );
7747
7748  $(document).on("click", ".bx_compare .tabs-head li", function () {
7749    var url = $(this).find(".sortbutton").data("href");
7750    BX.showWait(BX("bx_catalog_compare_block"));
7751    $.ajax({
7752      url: url,
7753      data: { ajax_action: "Y" },
7754      success: function (html) {
7755        history.pushState(null, null, url);
7756        $("#bx_catalog_compare_block").html(html);
7757        BX.closeWait();
7758      },
7759    });
7760  });
7761  var hoveredTrs;
7762  $(document).on(
7763    {
7764      mouseover: function (e) {
7765        var _ = $(this);
7766        var tbodyIndex = _.closest("tbody").index() + 1; //+1 for nth-child
7767        var trIndex = _.index() + 1; // +1 for nth-child
7768        hoveredTrs = $(e.delegateTarget)
7769          .find(".data_table_props")
7770          .children(":nth-child(" + tbodyIndex + ")")
7771          .children(":nth-child(" + trIndex + ")")
7772          .addClass("hovered");
7773      },
7774      mouseleave: function (e) {
7775        if (hoveredTrs) hoveredTrs.removeClass("hovered");
7776      },
7777    },
7778    ".bx_compare .data_table_props tbody>tr"
7779  );
7780  $(document).on("click", ".fancy_zoom", function (e) {
7781    e.preventDefault();
7782    var arPict = [],
7783      index = 0;
7784    $(this)
7785      .closest(".product-detail-gallery__container")
7786      .find(".gallery-slider-thumb__container .gallery__item--thumb")
7787      .each(function () {
7788        var obImg = {};
7789        obImg = {
7790          src: $(this).data("big"),
7791          thumb: $(this).find("img").data("src") || $(this).find("img").attr("src"),
7792          // opts: {
7793          //   caption: $(this).find("img").attr("alt"),
7794          // },
7795        };
7796        if ($(this).hasClass("swiper-slide-thumb-active")) {
7797          index = $(this).index();
7798        }
7799        arPict.push(obImg);
7800      });
7801    if (!arPict.length) {
7802      arPict.push({
7803        src: $(this).closest(".product-detail-gallery__container").find(".zoom_picture").data("xoriginal"),
7804      });
7805    }
7806    if (typeof $.fn.fancybox !== "function") {
7807      return;
7808    }
7809    $.fancybox.open(
7810      arPict,
7811      {
7812        tpl: {
7813          closeBtn:
7814            '<span title="' +
7815            BX.message("FANCY_CLOSE") +
7816            '" class="fancybox-item fancybox-close inline svg"><svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 24L24 2M2 2L24 24" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg></span>',
7817          next:
7818            '<a title="' +
7819            BX.message("FANCY_NEXT") +
7820            '" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
7821          prev:
7822            '<a title="' +
7823            BX.message("FANCY_PREV") +
7824            '" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>',
7825        },
7826        btnTpl: {
7827          close:
7828            '<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' +
7829            '<i class="svg"><svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M2 24L24 2M2 2L24 24" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></svg></i>' +
7830            "</button>",
7831
7832          arrowLeft:
7833            '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' +
7834            '<div><i class="svg left"><svg width="16" height="26" viewBox="0 0 15 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 13L0.585787 14.4142C-0.195262 13.6332 -0.195262 12.3668 0.585787 11.5858L2 13ZM11.5858 0.585786C12.3668 -0.195262 13.6332 -0.195262 14.4142 0.585786C15.1953 1.36683 15.1953 2.63317 14.4142 3.41421L11.5858 0.585786ZM14.4142 22.5858C15.1953 23.3668 15.1953 24.6332 14.4142 25.4142C13.6332 26.1953 12.3668 26.1953 11.5858 25.4142L14.4142 22.5858ZM0.585787 11.5858L11.5858 0.585786L14.4142 3.41421L3.41421 14.4142L0.585787 11.5858ZM3.41421 11.5858L14.4142 22.5858L11.5858 25.4142L0.585787 14.4142L3.41421 11.5858Z" fill="#999999"/></svg></i></div>' +
7835            "</button>",
7836
7837          arrowRight:
7838            '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' +
7839            '<div><i class="svg right"><svg width="16" height="26" viewBox="0 0 15 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 13L14.4142 14.4142C15.1953 13.6332 15.1953 12.3668 14.4142 11.5858L13 13ZM3.41421 0.585786C2.63317 -0.195262 1.36683 -0.195262 0.585786 0.585786C-0.195262 1.36683 -0.195262 2.63317 0.585786 3.41421L3.41421 0.585786ZM0.585786 22.5858C-0.195262 23.3668 -0.195262 24.6332 0.585786 25.4142C1.36683 26.1953 2.63317 26.1953 3.41421 25.4142L0.585786 22.5858ZM14.4142 11.5858L3.41421 0.585786L0.585786 3.41421L11.5858 14.4142L14.4142 11.5858ZM11.5858 11.5858L0.585786 22.5858L3.41421 25.4142L14.4142 14.4142L11.5858 11.5858Z" fill="white"/></svg></i></div>' +
7840            "</button>",
7841        },
7842        touch: "enabled",
7843        loop: false,
7844        buttons: [
7845          // "zoom",
7846          //"share",
7847          // "slideShow",
7848          //"fullScreen",
7849          //"download",
7850          // "thumbs",
7851          "close",
7852        ],
7853        thumbs: {
7854          autoStart: true,
7855        },
7856        onActivate: function (instance) {
7857          InitFancyboxThumbnailsGallery(instance);
7858        },
7859        beforeShow: function (instance, current) {
7860          if ($(".fancybox-thumbs .swiper").length) {
7861            const swiper = $(".fancybox-thumbs .swiper").data("swiper");
7862            swiper.slideTo(current.index);
7863          }
7864        },
7865      },
7866      index
7867    );
7868  });
7869
7870  /* tabs */
7871  $(".tabs_section .tabs-head li").on("click", function () {
7872    if (!$(this).is(".current")) {
7873      $(".tabs_section .tabs-head li").removeClass("current");
7874      $(this).addClass("current");
7875      $(".tabs_section ul.tabs_content li").removeClass("current");
7876      if ($(this).attr("id") == "product_reviews_tab") {
7877        $(".shadow.common").hide();
7878        $("#reviews_content").show();
7879      } else {
7880        $(".shadow.common").show();
7881        $("#reviews_content").hide();
7882        $(".tabs_section ul.tabs_content > li:eq(" + $(this).index() + ")").addClass("current");
7883      }
7884    }
7885  });
7886
7887  /* open first section slide */
7888  setTimeout(function () {
7889    $(".jobs_wrapp .item:first .name tr").trigger("click");
7890  }, 300);
7891
7892  $(".choise").on("click", function () {
7893    var _this = $(this);
7894    if (typeof _this.attr("data-block") != "undefined") {
7895      if ($(_this.attr("data-block")).closest(".tab-pane").length) {
7896        $('.ordered-block a[href="#' + $(_this.attr("data-block")).closest(".tab-pane").attr("id") + '"]').click();
7897        _this.data("block", ".ordered-block.tabs-block");
7898        $(_this.data("block")).data("offset", -100);
7899      } else {
7900        $(_this.data("block")).data("offset", -100);
7901      }
7902      scrollToBlock(_this.data("block"));
7903    }
7904  });
7905
7906  $(document).on("click", ".buy_block .slide_offer", function () {
7907    scroll_block($(".js-offers-scroll"));
7908  });
7909  $(".share  > .share_wrapp .text").on("click", function () {
7910    var block = $(this).parent().find(".shares");
7911    if (!block.is(":visible") && !$(this).closest(".share.top").length) $("#content").css("z-index", 3);
7912    block.fadeToggle(100, function () {
7913      if (!block.is(":visible")) $("#content").css("z-index", 2);
7914    });
7915  });
7916  $("html, body").on("mousedown", function (e) {
7917    if (typeof e.target.className == "string" && e.target.className.indexOf("adm") < 0) {
7918      e.stopPropagation();
7919      $("div.shares").fadeOut(100, function () {
7920        $("#content").css("z-index", 2);
7921        $(".price_txt .share_wrapp").removeClass("opened");
7922      });
7923      $(".search_middle_block").removeClass("active_wide");
7924    }
7925  });
7926  $(".share_wrapp")
7927    .find("*")
7928    .on("mousedown", function (e) {
7929      e.stopPropagation();
7930    });
7931
7932  $(".price_txt .share_wrapp .text").click(function () {
7933    $(this).parent().toggleClass("opened");
7934    $(this).parent().find(".shares").fadeToggle();
7935  });
7936
7937  $(document).on("click", ".reviews-collapse-link", function () {
7938    $(".reviews-reply-form").slideToggle();
7939  });
7940
7941  /* accordion action*/
7942  $(".panel-collapse").on("hidden.bs.collapse", function () {
7943    $(this).parent().toggleClass("opened");
7944  });
7945  $(".panel-collapse").on("show.bs.collapse", function () {
7946    $(this).parent().toggleClass("opened");
7947  });
7948
7949  /* accordion */
7950  $(".accordion-head").on("click", function (e) {
7951    e.preventDefault();
7952    if (!$(this).next().hasClass("collapsing")) {
7953      $(this).toggleClass("accordion-open");
7954      $(this).toggleClass("accordion-close");
7955    }
7956  });
7957
7958  /* progress bar */
7959  $("[data-appear-progress-animation]").iAppear(
7960    function () {
7961      var $this = $(this);
7962      var delay = $this.attr("data-appear-animation-delay") ? $this.attr("data-appear-animation-delay") : 1;
7963      if (delay > 1) $this.css("animation-delay", delay + "ms");
7964      $this.addClass($this.attr("data-appear-animation"));
7965
7966      setTimeout(function () {
7967        $this.animate(
7968          {
7969            width: $this.attr("data-appear-progress-animation"),
7970          },
7971          1500,
7972          "easeOutQuad",
7973          function () {
7974            $this.find(".progress-bar-tooltip").animate(
7975              {
7976                opacity: 1,
7977              },
7978              500,
7979              "easeOutQuad"
7980            );
7981          }
7982        );
7983      }, delay);
7984    },
7985    {
7986      rootMargin: "-50px 0px -50px 0px",
7987      accX: 0,
7988      accY: -50,
7989    }
7990  );
7991
7992  // initCountdown();
7993
7994  /* portfolio item */
7995  if ($(".item.animated-block").length) {
7996    $(".item.animated-block").iAppear(
7997      function () {
7998        var $this = $(this);
7999
8000        $this.addClass($this.data("animation")).addClass("visible");
8001      },
8002      { accX: 0, accY: 150 }
8003    );
8004  }
8005
8006  /* flexslider appear */
8007  if ($(".appear-block").length) {
8008    $(".appear-block").iAppear(
8009      function () {
8010        var $this = $(this);
8011        $this.removeClass("appear-block");
8012        $this.find(".appear-block").removeClass("appear-block");
8013        InitOwlSlider();
8014        if (typeof initSwiperSlider === "function") {
8015          initSwiperSlider();
8016        }
8017      },
8018      {
8019        rootMargin: "150px 0px 150px 0px",
8020        accX: 0,
8021        accY: 150,
8022      }
8023    );
8024  }
8025
8026  /* js-load-block appear */
8027  if ($(".js-load-block").length) {
8028    var objUrl = parseUrlQuery();
8029    var bClearCache = false;
8030    if ("clear_cache" in objUrl) {
8031      if (objUrl.clear_cache == "Y") {
8032        bClearCache = true;
8033      }
8034    }
8035
8036    var items = [];
8037    var bIdle = true;
8038    var insertNextBlockContent = function () {
8039      if (bIdle && items.length) {
8040        bIdle = false;
8041        const item = items.pop();
8042
8043        // get content
8044        $.get(item.url).done(function (html) {
8045          item.content = html;
8046          item.content = $.trim(item.content);
8047
8048          // remove /bitrix/js/main/core/core_window.js if it was loaded already
8049          if (item.content.indexOf("/bitrix/js/main/core/core_window.") !== -1 && BX.WindowManager) {
8050            item.content = item.content.replace(
8051              /<script src="\/bitrix\/js\/main\/core\/core_window\.[^>]*><\/script>/gm,
8052              ""
8053            );
8054          }
8055
8056          // remove /bitrix/js/currency/core_currency.js if it was loaded already
8057          if (
8058            item.content.indexOf("/bitrix/js/currency/core_currency.") !== -1 &&
8059            typeof BX.Currency === "object" &&
8060            BX.Currency.defaultFormat
8061          ) {
8062            item.content = item.content.replace(
8063              /<script src="\/bitrix\/js\/currency\/core_currency\.[^>]*><\/script>/gm,
8064              ""
8065            );
8066          }
8067
8068          // remove /bitrix/js/main/pageobject/pageobject.js if it was loaded already
8069          if (item.content.indexOf("/bitrix/js/main/pageobject/pageobject.") !== -1 && BX.PageObject) {
8070            item.content = item.content.replace(
8071              /<script src="\/bitrix\/js\/main\/pageobject\/pageobject\.[^>]*><\/script>/gm,
8072              ""
8073            );
8074          }
8075
8076          // remove /bitrix/js/main/polyfill/promise/js/promise.js if it not need
8077          if (
8078            item.content.indexOf("/bitrix/js/main/polyfill/promise/js/promise.") !== -1 &&
8079            typeof window.Promise !== "undefined" &&
8080            window.Promise.toString().indexOf("[native code]") !== -1
8081          ) {
8082            item.content = item.content.replace(
8083              /<script src="\/bitrix\/js\/main\/polyfill\/promise\/js\/promise\.[^>]*><\/script>/gm,
8084              ""
8085            );
8086          }
8087
8088          if (
8089            typeof MutationObserver === "function" &&
8090            document.querySelector("body").classList.contains("detail_page")
8091          ) {
8092            const observer = new MutationObserver(function (list, observer) {
8093              const $curBlock = list[0].target;
8094              const curBlockBounds = $curBlock.getBoundingClientRect();
8095
8096              if ($curBlock.parentElement.classList.contains("complect-block")) {
8097                $curBlock.parentElement.classList.add("loaded");
8098              }
8099
8100              if (curBlockBounds.top < 0 && curBlockBounds.bottom >= 0) {
8101                const offsetTop = window.scrollY + Math.round($curBlock.offsetHeight) - 100;
8102                window.scrollTo(0, offsetTop);
8103              }
8104
8105              observer.disconnect();
8106            });
8107
8108            observer.observe(item.$context[0], {
8109              childList: true,
8110            });
8111          }
8112
8113          const ob = BX.processHTML(item.content);
8114
8115          // stop ya metrika webvisor DOM indexer
8116          pauseYmObserver();
8117
8118          item.$context.removeAttr("data-file").removeClass("loader_circle");
8119          item.$target.innerHTML = ob.HTML;
8120
8121          BX.ajax.processScripts(ob.SCRIPT);
8122
8123          var eventdata = { action: "jsLoadBlock" };
8124          BX.onCustomEvent("onCompleteAction", [eventdata, item.$context]);
8125
8126          BX.onCustomEvent("onHeaderProgressBarChange", [{}]);
8127
8128          // resume ya metrika webvisor
8129          // 500ms
8130          setTimeout(resumeYmObserver, 500);
8131
8132          bIdle = true;
8133          insertNextBlockContent();
8134        });
8135      }
8136    };
8137
8138    $(".js-load-block").iAppear(
8139      function () {
8140        var $this = $(this);
8141
8142        if ($this.data("file")) {
8143          const add_url = new URL(location.origin + $this.data("file"));
8144
8145          if (bClearCache) add_url.searchParams.set("clear_cache", "Y");
8146          if ($this.data("block")) add_url.searchParams.set("BLOCK", $this.data("block"));
8147          if ($this.data("show_all")) add_url.searchParams.set("SHOW_ALL", "Y");
8148
8149          const $target = $this.data("appendTo")
8150            ? $this.find($this.data("appendTo"))[0]
8151            : $this.find('> div[id*="bx_incl_"]').length
8152            ? $this.find('> div[id*="bx_incl_"]')[0]
8153            : $this[0];
8154
8155          items.unshift({
8156            $target: $target,
8157            $context: $this,
8158            url: add_url,
8159          });
8160          insertNextBlockContent();
8161        }
8162      },
8163      {
8164        rootMargin: isMobile ? "300px 0px 300px 0px" : "150px 0px 150px 0px",
8165        accX: 0,
8166        accY: isMobile ? 300 : 150,
8167      }
8168    );
8169  }
8170
8171  /* show ajax store amount product */
8172  $(document).on("click", ".js-show-info-block", function (e) {
8173    var $this = $(this);
8174
8175    //check on ".cost.prices" need for popup price in mobile
8176    if (window.matchMedia("(max-width: 500px)").matches && !$this.closest(".cost.prices").length) {
8177      return;
8178    }
8179
8180    e.stopPropagation();
8181    $(".js-info-block").fadeOut();
8182
8183    if ($this.hasClass("opened")) {
8184      $(".js-show-info-block").removeClass("opened");
8185    } else {
8186      $(".js-show-info-block").removeClass("opened");
8187      $this.addClass("opened");
8188    }
8189
8190    if (!$this.siblings(".js-info-block").length) {
8191      var dataFields = $this.closest(".sa_block").data("fields");
8192      dataFields = dataFields == "null" || dataFields === undefined ? "" : dataFields;
8193      var dataUserFields = $this.closest(".sa_block").data("user-fields");
8194      dataUserFields = dataUserFields == "null" || dataUserFields === undefined ? "" : dataUserFields;
8195      var objUrl = parseUrlQuery(),
8196        add_url = "";
8197      if ("clear_cache" in objUrl) {
8198        if (objUrl.clear_cache == "Y") add_url += "?clear_cache=Y";
8199      }
8200
8201      var obPostParams = {
8202        ajax: "Y",
8203        ELEMENT_ID: $this.data("id"),
8204        FIELDS: dataFields,
8205        USER_FIELDS: dataUserFields,
8206        STORES: $this.closest(".sa_block").data("stores") || "",
8207      };
8208
8209      $this.addClass("loadings");
8210      $.post(arAsproOptions["SITE_DIR"] + "ajax/productStoreAmountCompact.php" + add_url, obPostParams).done(function (
8211        html
8212      ) {
8213        $this.removeClass("loadings");
8214        $(html).appendTo($this.closest(".sa_block"));
8215
8216        $this
8217          .siblings(".js-info-block")
8218          .find(".more-btn a")
8219          .attr("href", $this.closest(".item_info").find("a").attr("href"));
8220        // InitScrollBar();
8221
8222        var eventdata = { action: "jsShowStores" };
8223        BX.onCustomEvent("onCompleteAction", [eventdata, $this]);
8224      });
8225    } else {
8226      if ($this.hasClass("opened")) {
8227        $this
8228          .siblings(".js-info-block")
8229          .find(".more-btn a")
8230          .attr("href", $this.closest(".item_info").find("a").attr("href"));
8231        $this.siblings(".js-info-block").fadeIn();
8232        // InitScrollBar();
8233      } else {
8234        $this.siblings(".js-info-block").fadeOut();
8235      }
8236    }
8237  });
8238  $(document).on("click", ".js-info-block .svg-inline-close", function () {
8239    $(".js-show-info-block").removeClass("opened");
8240    $(this).closest(".js-info-block").fadeOut();
8241  });
8242
8243  /* adaptive menu start */
8244  $(".menu.adaptive").on("click", function () {
8245    $(this).toggleClass("opened");
8246    if ($(this).hasClass("opened")) {
8247      $(".mobile_menu").toggleClass("opened").slideDown();
8248    } else {
8249      $(".mobile_menu").toggleClass("opened").slideUp();
8250    }
8251  });
8252  $(".mobile_menu .has-child >a").on("click", function (e) {
8253    var parentLi = $(this).parent();
8254    e.preventDefault();
8255    parentLi.toggleClass("opened");
8256    parentLi.find(".dropdown").slideToggle();
8257  });
8258
8259  $(".mobile_menu .search-input-div input").on("keyup", function (e) {
8260    var inputValue = $(this).val();
8261    $(".center_block .stitle_form input").val(inputValue);
8262    if (e.keyCode == 13) {
8263      $(".center_block .stitle_form form").submit();
8264    }
8265  });
8266
8267  $(".center_block .stitle_form input").on("keyup", function (e) {
8268    var inputValue = $(this).val();
8269    $(".mobile_menu .search-input-div input").val(inputValue);
8270    if (e.keyCode == 13) {
8271      $(".center_block .stitle_form form").submit();
8272    }
8273  });
8274
8275  $(".mobile_menu .search-button-div button").on("click", function (e) {
8276    e.preventDefault();
8277    var inputValue = $(this).parents().find("input").val();
8278    $(".center_block .stitle_form input").val(inputValue);
8279    $(".center_block .stitle_form form").submit();
8280  });
8281  /* adaptive menu end */
8282
8283  $(document).on("click", ".mega-menu .dropdown-menu", function (e) {
8284    e.stopPropagation();
8285  });
8286
8287  $(document).on("click", ".mega-menu .dropdown-toggle.more-items", function (e) {
8288    e.preventDefault();
8289  });
8290
8291  $(document).on("mouseenter", "#headerfixed .table-menu .dropdown-menu .dropdown-submenu", function () {
8292    setTimeout(function () {
8293      CheckTopVisibleMenu();
8294    }, 275);
8295  });
8296
8297  $(".mega-menu .search-item .search-icon, .menu-row #title-search .fa-close").on("click", function (e) {
8298    e.preventDefault();
8299    $(".menu-row #title-search").toggleClass("hide");
8300  });
8301
8302  $(".mega-menu ul.nav .search input").on("keyup", function (e) {
8303    var inputValue = $(this).val();
8304    $(".menu-row > .search input").val(inputValue);
8305    if (e.keyCode == 13) {
8306      $(".menu-row > .search form").submit();
8307    }
8308  });
8309
8310  $(".menu-row > .search input").on("keyup", function (e) {
8311    var inputValue = $(this).val();
8312    $(".mega-menu ul.nav .search input").val(inputValue);
8313    if (e.keyCode == 13) {
8314      $(".menu-row > .search form").submit();
8315    }
8316  });
8317
8318  $(".mega-menu ul.nav .search button").on("click", function (e) {
8319    e.preventDefault();
8320    var inputValue = $(this).parents(".search").find("input").val();
8321    $(".menu-and-search .search input").val(inputValue);
8322    $(".menu-row > .search form").submit();
8323  });
8324
8325  $(".btn.btn-add").on("click", function () {
8326    $.ajax({
8327      type: "GET",
8328      url: arAsproOptions["SITE_DIR"] + "ajax/clearBasket.php",
8329      success: function (data) {},
8330    });
8331  });
8332
8333  $(".sort_display a").on("click", function () {
8334    $(this).siblings().removeClass("current");
8335    $(this).addClass("current");
8336  });
8337
8338  /* detail order show payments */
8339  $(".sale-order-detail-payment-options-methods-info-change-link").on("click", function () {
8340    $(this).closest(".sale-order-detail-payment-options-methods-info").addClass("opened").siblings().addClass("opened");
8341  });
8342
8343  /* expand/hide filter values */
8344  $(document).on("click", ".expand_block", function () {
8345    togglePropBlock($(this));
8346  });
8347
8348  /* touch event */
8349  document.addEventListener(
8350    "touchend",
8351    function (event) {
8352      if (!$(event.target).closest(".menu-item").length && !$(event.target).hasClass("menu-item")) {
8353        $(".menu-row .dropdown-menu").css({ display: "none", opacity: 0 });
8354        $(".menu-item").removeClass("hover");
8355        $(".bx-breadcrumb-item.drop").removeClass("hover");
8356      }
8357      if (!$(event.target).closest(".menu.topest").length) {
8358        if (window.matchMedia("(max-width: 991px)").matches) {
8359          $(".menu.topest").css({ overflow: "hidden" });
8360        }
8361        $(".menu.topest > li").removeClass("hover");
8362      }
8363      if (!$(event.target).closest(".full.has-child").length) {
8364        $(".menu_top_block.catalog_block li").removeClass("hover");
8365      }
8366      if (!$(event.target).closest(".basket_block").length) {
8367        $(".basket_block .link").removeClass("hover");
8368        $(".basket_block .basket_popup_wrapp").slideUp();
8369      }
8370      if (!$(event.target).closest(".catalog_item").length) {
8371        var tabsContentUnhoverHover = $(".tab:visible").attr("data-unhover") * 1;
8372        $(".tab:visible").stop().animate({ height: tabsContentUnhoverHover }, 100);
8373        $(".tab:visible").find(".catalog_item").removeClass("hover");
8374        $(".tab:visible").find(".catalog_item .buttons_block").stop().fadeOut(233);
8375        if ($(".catalog_block").length) {
8376          $(".catalog_block").find(".catalog_item_wrapp").removeClass("hover");
8377          $(".catalog_block").find(".catalog_item").removeClass("hover");
8378        }
8379      }
8380      //togglePropBlock($(event.target));
8381    },
8382    false
8383  );
8384
8385  touchMenu(".menu-row .menu-item");
8386  touchTopMenu(".menu.topest li");
8387  touchLeftMenu(".menu_top_block:not(.in-search) li.full");
8388  touchBreadcrumbs(".bx-breadcrumb-item.drop");
8389
8390  $(document).on("keyup", ".coupon .input_coupon input", function () {
8391    if ($(this).val().length) {
8392      $(this).removeClass("error");
8393      $(this).closest(".input_coupon").find(".error").remove();
8394    } else {
8395      $(this).addClass("error");
8396      $("<label class='error'>" + BX.message("INPUT_COUPON") + "</label>").insertBefore($(this));
8397    }
8398  });
8399  // showPhoneMask("input[autocomplete=tel]");
8400  BX.addCustomEvent(window, "onAjaxSuccessFilter", function (e) {
8401    setBasketStatusBtn();
8402    checkLinkedArticles();
8403    checkLinkedBlocks(".linked-banners-list");
8404  });
8405
8406  $(document).on("click", ".block_container .items .item.initied", function () {
8407    var _this = $(this),
8408      itemID = _this.data("id"),
8409      animationTime = 200;
8410
8411    _this.closest(".items").fadeOut(animationTime, function () {
8412      _this.closest(".block_container").find(".detail_items").fadeIn(animationTime);
8413      _this
8414        .closest(".block_container")
8415        .find(".detail_items .item[data-id=" + itemID + "]")
8416        .fadeIn(animationTime);
8417
8418      var arCoordinates = _this.data("coordinates").split(",");
8419
8420      if (typeof map !== "undefined") map.setCenter([arCoordinates[0], arCoordinates[1]], 15);
8421    });
8422  });
8423
8424  $(document).on("click", ".block_container .top-close", function () {
8425    var _this = $(this).closest(".block_container").find(".detail_items .item:visible"),
8426      animationTime = 200;
8427    _this.fadeOut(animationTime);
8428    _this
8429      .closest(".block_container")
8430      .find(".detail_items")
8431      .fadeOut(animationTime, function () {
8432        _this.closest(".block_container").find(".items").fadeIn(animationTime);
8433
8434        if (typeof map !== "undefined" && typeof clusterer !== "undefined") {
8435          map.setBounds(clusterer.getBounds(), {
8436            zoomMargin: 40,
8437            // checkZoomRange: true
8438          });
8439        }
8440      });
8441  });
8442
8443  BX.addCustomEvent(window, "onAjaxSuccess", function (e) {
8444    if (e != "OK") {
8445      initSelects(document);
8446      InitOrderCustom();
8447      // showPhoneMask("input[autocomplete=tel]");
8448
8449      if (arAsproOptions["PAGES"]["CATALOG_PAGE"] && $(".catalog_detail").length && !$(".fast_view_frame").length) {
8450        const leftBlock = $(".main-catalog-wrapper > .left_block");
8451        const rightBlock = $(".right_block");
8452
8453        if (!leftBlock.length && rightBlock.hasClass("wide_N")) {
8454          rightBlock.removeClass("wide_N").addClass("wide_Y");
8455        } else if (leftBlock.length && rightBlock.hasClass("wide_Y")) {
8456          rightBlock.removeClass("wide_Y").addClass("wide_N");
8457        }
8458
8459        $(".bx_filter").remove();
8460        InitOwlSlider();
8461      }
8462
8463      if (arAsproOptions["PAGES"]["CATALOG_PAGE"]) {
8464        // initCountdown();
8465
8466        if (typeof window["stickySidebar"] !== "undefined") window["stickySidebar"].updateSticky();
8467      }
8468
8469      if (typeof orderActions === "function") {
8470        orderActions(e);
8471      }
8472
8473      if (e && typeof e === "object" && "action" in e && e.action === "ajaxContentLoadedTab") {
8474        lazyLoadPagenBlock();
8475      }
8476
8477      InitStickySideBar();
8478    }
8479  });
8480
8481  //event for default basket quantity change
8482  BX.addCustomEvent(window, "OnBasketChange", function (e) {
8483    if (arAsproOptions["PAGES"]["BASKET_PAGE"]) {
8484      var summ = 0,
8485        title = "";
8486
8487      if (typeof BX.Sale !== "undefined") {
8488        if (typeof BX.Sale.BasketComponent !== "undefined") {
8489          summ = BX.Sale.BasketComponent.result.allSum;
8490          title = BX.message("JS_BASKET_COUNT_TITLE").replace("SUMM", summ);
8491        }
8492      } else {
8493        summ = $("#allSum_FORMATED")
8494          .html()
8495          .replace(/&nbsp;/g, " ");
8496        title = BX.message("JS_BASKET_COUNT_TITLE").replace("SUMM", summ);
8497      }
8498
8499      if ($(".js-basket-block .wrap .prices").length) $(".js-basket-block .wrap .prices").html(summ);
8500      if ($("a.basket-link.basket").length) $("a.basket-link.basket").attr("title", title);
8501      if ($(".basket_fly .opener .basket_count").length) $(".basket_fly .opener .basket_count").attr("title", title);
8502    }
8503  });
8504});
8505
8506if (!funcDefined("setBasketStatusBtn")) {
8507  setBasketStatusBtn = function (type) {
8508    var bSync = typeof type !== undefined;
8509    if (typeof arBasketAspro !== "undefined") {
8510      if ("BASKET" in arBasketAspro) {
8511        // basket items
8512        if (arBasketAspro.BASKET) {
8513          for (var i in arBasketAspro.BASKET) {
8514            $(".to-cart[data-item=" + i + "]").hide();
8515            $(".counter_block[data-item=" + i + "]")
8516              .closest(".counter_block_inner")
8517              .hide();
8518            $(".counter_block[data-item=" + i + "]").hide();
8519            $(".in-cart[data-item=" + i + "]").show();
8520            $(".in-cart[data-item=" + i + "]")
8521              .closest(".button_block")
8522              .addClass("wide");
8523
8524            if ($(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .basket_item_add").length) {
8525              $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .basket_item_add").addClass("added");
8526              $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .basket_item_add").attr(
8527                "title",
8528                $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .basket_item_add").data("title2")
8529              );
8530            }
8531          }
8532        }
8533      }
8534
8535      /* services */
8536      if ("SERVICES" in arBasketAspro) {
8537        // services items
8538        $needFillServices = $(".buy_services_wrap[data-parent_product]").length;
8539        if (arBasketAspro.SERVICES && $needFillServices) {
8540          for (var i in arBasketAspro.SERVICES) {
8541            var serviceItem = $(
8542              ".buy_services_wrap[data-parent_product=" +
8543                arBasketAspro.SERVICES[i].link_id +
8544                "] .services-item[data-item_id=" +
8545                arBasketAspro.SERVICES[i].item_id +
8546                "]"
8547            );
8548            serviceItem.find('input[name="buy_switch_services"]').prop("checked", true);
8549            serviceItem.find('.counter_block input[name="quantity"]').val(arBasketAspro.SERVICES[i].quantity);
8550            serviceItem.addClass("services_on");
8551          }
8552        }
8553      }
8554
8555      if ("SUBSCRIBE" in arBasketAspro) {
8556        // subscribe items
8557        if (arBasketAspro.SUBSCRIBE) {
8558          for (var i in arBasketAspro.SUBSCRIBE) {
8559            $(".to-subscribe[data-item=" + i + "]").hide();
8560            $(".in-subscribe[data-item=" + i + "]").show();
8561          }
8562        }
8563      }
8564
8565      if ("COMPARE" in arBasketAspro) {
8566        // compare items
8567        if (arBasketAspro.COMPARE) {
8568          for (var i in arBasketAspro.COMPARE) {
8569            $(".compare_item.to[data-item=" + i + "]").hide();
8570            $(".compare_item.in[data-item=" + i + "]").show();
8571            if ($(".compare_item[data-item=" + i + "]").find(".value.added").length) {
8572              //$('.compare_item[data-item='+i+']').addClass("added");
8573              $(".compare_item[data-item=" + i + "]")
8574                .find(".value")
8575                .hide();
8576              $(".compare_item[data-item=" + i + "]")
8577                .find(".value.added")
8578                .css("display", "block");
8579            }
8580
8581            if ($(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .compare_item_add").length) {
8582              $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .compare_item_add").addClass("added");
8583              $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .compare_item_add").attr(
8584                "title",
8585                $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .compare_item_add").data("title2")
8586              );
8587            }
8588          }
8589        }
8590      }
8591    }
8592
8593    BX.onCustomEvent("onSetBasketStatusBtn", []);
8594  };
8595}
8596
8597if (!funcDefined("togglePropBlock")) {
8598  togglePropBlock = function (className) {
8599    var all_props_block = className.closest(".bx_filter_parameters_box_container").find(".hidden_values");
8600    if (all_props_block.length && (className.hasClass("inner_text") || className.hasClass("expand_block"))) {
8601      if (all_props_block.is(":visible")) {
8602        className.text(BX.message("FILTER_EXPAND_VALUES"));
8603        all_props_block.hide();
8604      } else {
8605        className.text(BX.message("FILTER_HIDE_VALUES"));
8606        all_props_block.show();
8607      }
8608    }
8609  };
8610}
8611
8612if (!funcDefined("showPhoneMask")) {
8613  showPhoneMask = function (className) {
8614    console.log('showPhoneMask');
8615    if (typeof appAspro === "object" && appAspro && appAspro.phone) {
8616      appAspro.phone.init($(className));
8617    }
8618    // $(className).inputmask("mask", { mask: arAsproOptions["THEME"]["PHONE_MASK"], showMaskOnHover: false });
8619  };
8620}
8621
8622if (!funcDefined("getActualBasket")) {
8623  getActualBasket = function (iblockID, type, sync) {
8624    var data = "";
8625    if (typeof iblockID !== "undefined" && iblockID) {
8626      data = { iblockID: iblockID };
8627    }
8628    $.ajax({
8629      type: "GET",
8630      url: arAsproOptions["SITE_DIR"] + "ajax/actualBasket.php",
8631      data: data,
8632      success: function (data) {
8633        if (!$(".js_ajax").length) $("body").append('<div class="js_ajax"></div>');
8634        $(".js_ajax").html(data);
8635
8636        if (typeof sync !== "undefined") {
8637          setBasketStatusBtn(true);
8638        }
8639
8640        if (typeof type !== undefined) {
8641          var eventdata = { action: "loadActualBasket" + type };
8642          BX.onCustomEvent("onCompleteAction", [eventdata]);
8643        }
8644      },
8645    });
8646  };
8647}
8648
8649if (!funcDefined("reloadBasketCounters")) {
8650  reloadBasketCounters = function (count, sync) {
8651    var data = "";
8652    if (count) {
8653      $(".basket-link.basket .count, .wraps_icon_block.basket .count .items > span").text(count);
8654    } else {
8655      $.ajax({
8656        type: "GET",
8657        url: arAsproOptions["SITE_DIR"] + "ajax/actualBasket.php",
8658        data: data,
8659        success: function (data) {
8660          if (!$(".js_ajax").length) $("body").append('<div class="js_ajax"></div>');
8661          $(".js_ajax").html(data);
8662          var countServices =
8663            typeof arBasketAspro.SERVICES !== "undefined" ? Object.keys(arBasketAspro.SERVICES).length : 0;
8664          $(".basket-link.basket .count, .wraps_icon_block.basket .count .items > span").text(
8665            Object.keys(arBasketAspro.BASKET).length + countServices
8666          );
8667          $(".basket-link.delay .count, .wraps_icon_block.delay .count .items > span").text(
8668            arBasketAspro.FAVORITE.COUNT
8669          );
8670          $(".basket-link.compare .count, .wraps_icon_block.compare .count .items > span").text(
8671            Object.keys(arBasketAspro.COMPARE).length
8672          );
8673
8674          if (typeof sync !== "undefined") {
8675            setBasketStatusBtn(true);
8676          }
8677        },
8678      });
8679    }
8680  };
8681}
8682
8683function touchMenu(selector) {
8684  if (isMobile) {
8685    if ($(selector).length) {
8686      $(selector).each(function () {
8687        var th = $(this);
8688        th.on("touchend", function (e) {
8689          var _th = $(e.target).closest(".menu-item");
8690
8691          $(".menu.topest > li").removeClass("hover");
8692          $(".menu_top_block.catalog_block li").removeClass("hover");
8693          $(".bx-breadcrumb-item.drop").removeClass("hover");
8694
8695          if (_th.find(".dropdown-menu").length && !_th.hasClass("hover")) {
8696            e.preventDefault();
8697            e.stopPropagation();
8698            _th.siblings().removeClass("hover");
8699            _th.addClass("hover");
8700            $(".menu-row .dropdown-menu").css({ display: "none", opacity: 0 });
8701            if (_th.hasClass("menu-item")) {
8702              _th.closest(".dropdown-menu").css({ display: "block", opacity: 1 });
8703            }
8704            if (_th.find("> .wrap > .dropdown-menu")) {
8705              _th.find("> .wrap > .dropdown-menu").css({ display: "block", opacity: 1 });
8706            } else if (_th.find("> .dropdown-menu")) {
8707              _th.find("> .dropdown-menu").css({ display: "block", opacity: 1 });
8708            }
8709            CheckTopVisibleMenu();
8710          } else {
8711            var href = $(e.target).attr("href") ? $(e.target).attr("href") : $(e.target).closest("a").attr("href");
8712            if (href && href !== "undefined") location.href = href;
8713          }
8714        });
8715      });
8716    }
8717  } else {
8718    $(selector).off();
8719  }
8720}
8721
8722function touchTopMenu(selector) {
8723  if (isMobile) {
8724    if ($(selector).length) {
8725      $(selector).each(function () {
8726        var th = $(this);
8727        th.on("touchend", function (e) {
8728          var _th = $(e.target).closest("li");
8729
8730          $(".menu-item").removeClass("hover");
8731          $(".menu_top_block.catalog_block li").removeClass("hover");
8732          $(".bx-breadcrumb-item.drop").removeClass("hover");
8733
8734          if (_th.hasClass("more") && !_th.hasClass("hover")) {
8735            e.preventDefault();
8736            e.stopPropagation();
8737            _th.siblings().removeClass("hover");
8738            _th.addClass("hover");
8739            $(".menu.topest").css({ overflow: "visible" });
8740          } else {
8741            var href = $(e.target).attr("href") ? $(e.target).attr("href") : $(e.target).closest("a").attr("href");
8742            if (href && href !== "undefined") location.href = href;
8743          }
8744        });
8745      });
8746    }
8747  } else {
8748    $(selector).off();
8749  }
8750}
8751
8752function touchLeftMenu(selector) {
8753  if (isMobile) {
8754    if ($(selector).length) {
8755      $(selector).each(function () {
8756        var th = $(this);
8757        th.on("touchend", function (e) {
8758          var _th = $(e.target).closest("li");
8759
8760          $(".menu-item").removeClass("hover");
8761          $(".bx-breadcrumb-item.drop").removeClass("hover");
8762          $(".menu.topest > li").removeClass("hover");
8763
8764          if (_th.hasClass("has-child") && !_th.hasClass("hover")) {
8765            e.preventDefault();
8766            e.stopPropagation();
8767            _th.siblings().removeClass("hover");
8768            _th.addClass("hover");
8769          } else {
8770            var href = $(e.target).attr("href") ? $(e.target).attr("href") : $(e.target).closest("a").attr("href");
8771            if (href && href !== "undefined") location.href = href;
8772          }
8773        });
8774      });
8775    }
8776  } else {
8777    $(selector).off();
8778  }
8779}
8780
8781function touchBreadcrumbs(selector) {
8782  if (isMobile) {
8783    if ($(selector).length) {
8784      $(selector).each(function () {
8785        var th = $(this);
8786        th.on("touchend", function (e) {
8787          var _th = $(e.target).closest(".bx-breadcrumb-item");
8788
8789          $(".menu-item").removeClass("hover");
8790          $(".menu.topest > li").removeClass("hover");
8791          $(".menu_top_block.catalog_block li").removeClass("hover");
8792
8793          if (!_th.hasClass("hover")) {
8794            e.preventDefault();
8795            e.stopPropagation();
8796            _th.siblings().removeClass("hover");
8797            _th.addClass("hover");
8798          } else {
8799            _th.removeClass("hover");
8800            var href = $(e.target).attr("href") ? $(e.target).attr("href") : $(e.target).closest("a").attr("href");
8801            if (href && href !== "undefined") location.href = href;
8802          }
8803        });
8804      });
8805    }
8806  } else {
8807    $(selector).off();
8808  }
8809}
8810
8811function touchItemBlock(selector) {}
8812function touchBasket(selector) {
8813  if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") {
8814    if ($(window).outerWidth() > 600) {
8815      $(document)
8816        .find(selector)
8817        .on("touchend", function (e) {
8818          if ($(this).parent().find(".basket_popup_wrapp").length && !$(this).hasClass("hover")) {
8819            e.preventDefault();
8820            e.stopPropagation();
8821            $(this).addClass("hover");
8822            $(this).parent().find(".basket_popup_wrapp").slideDown();
8823          }
8824        });
8825    } else {
8826      $(selector).off();
8827    }
8828  }
8829}
8830
8831function showTotalSummItem(popup) {
8832  //show total summ
8833  if (
8834    arAsproOptions["THEME"]["SHOW_TOTAL_SUMM_TYPE"] == "ALWAYS" &&
8835    arAsproOptions["THEME"]["SHOW_TOTAL_SUMM"] == "Y"
8836  ) {
8837    var parent = "body ";
8838    if (typeof popup === "string" && popup == "Y") parent = ".popup ";
8839    $(parent + ".counter_wrapp .counter_block input.text").each(function () {
8840      var _th = $(this);
8841      if (_th.data("product")) {
8842        var obProduct = _th.data("product");
8843        if (typeof window[obProduct] == "object") window[obProduct].setPriceAction("Y");
8844        else setPriceItem(_th.closest(".main_item_wrapper"), _th.val());
8845      } else setPriceItem(_th.closest(".main_item_wrapper"), _th.val());
8846    });
8847  }
8848}
8849
8850function initFull() {
8851  initSelects(document);
8852  initHoverBlock(document);
8853  touchItemBlock(".catalog_item a");
8854  InitOrderCustom();
8855  showTotalSummItem();
8856  basketActions();
8857
8858  if (typeof orderActions === "function") {
8859    orderActions();
8860  }
8861
8862  checkMobileRegion();
8863}
8864
8865checkMobileRegion = function () {
8866  if ($(".confirm_region").length) {
8867    if (!$(".top_mobile_region").length)
8868      $(
8869        '<div class="top_mobile_region"><div class="confirm_wrapper"><div class="confirm_region"></div></div></div>'
8870      ).insertBefore($("#mobileheader"));
8871    $(".top_mobile_region .confirm_region").html($(".confirm_region").html());
8872  }
8873};
8874
8875if (!funcDefined("basketActions")) {
8876  basketActions = function () {
8877    if (arAsproOptions["PAGES"]["BASKET_PAGE"]) {
8878      checkMinPrice();
8879
8880      //remove4Cart
8881      if (typeof BX.Sale !== "undefined" && typeof BX.Sale === "object") {
8882        if (typeof BX.Sale.BasketComponent !== "undefined" && typeof BX.Sale.BasketComponent === "object") {
8883          $(document).on("click", ".basket-item-actions-remove", function () {
8884            var basketID = $(this).closest(".basket-items-list-item-container").data("id");
8885            if (BX.Sale.BasketComponent.items && BX.Sale.BasketComponent.items[basketID]) {
8886              delFromBasketCounter(BX.Sale.BasketComponent.items[basketID].PRODUCT_ID);
8887            }
8888          });
8889        }
8890      }
8891
8892      if (location.hash) {
8893        var hash = location.hash.substring(1);
8894        if ($("#basket_toolbar_button_" + hash).length) $("#basket_toolbar_button_" + hash).trigger("click");
8895
8896        if ($('.basket-items-list-header-filter a[data-filter="' + hash + '"]').length)
8897          $('.basket-items-list-header-filter a[data-filter="' + hash + '"]')[0].click();
8898      }
8899      var svg_cross =
8900        '<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path id="Rounded_Rectangle_568_copy_13" data-name="Rounded Rectangle 568 copy 13" class="cls-1" d="M1615.4,589l2.32,2.315a0.987,0.987,0,0,1,0,1.4,1,1,0,0,1-1.41,0L1614,590.4l-2.31,2.315a1,1,0,0,1-1.41,0,0.987,0.987,0,0,1,0-1.4L1612.6,589l-2.32-2.314a0.989,0.989,0,0,1,0-1.4,1,1,0,0,1,1.41,0l2.31,2.315,2.31-2.315a1,1,0,0,1,1.41,0,0.989,0.989,0,0,1,0,1.4Z" transform="translate(-1610 -585)"/></svg>';
8901
8902      $(".bx_sort_container").append(
8903        '<div class="top_control basket_action"><span style="opacity:0;" class="delete_all colored_theme_hover_text remove_all_basket">' +
8904          svg_cross +
8905          BX.message("BASKET_CLEAR_ALL_BUTTON") +
8906          "</span></div>"
8907      );
8908      if ($(".basket-items-list-header-filter").length) {
8909        $(".basket-items-list-header-filter").append(
8910          '<div class="top_control basket_action"><span style="opacity:1;" class="delete_all colored_theme_hover_text remove_all_basket">' +
8911            svg_cross +
8912            BX.message("BASKET_CLEAR_ALL_BUTTON") +
8913            "</span></div>"
8914        );
8915
8916        var cur_index = $(".basket-items-list-header-filter > a.active").index();
8917        //fix delayed
8918        if (cur_index == 3) cur_index = 2;
8919
8920        if ($(".basket-items-list-header-filter > a.active").data("filter") == "all") cur_index = "all";
8921
8922        $(".basket-items-list-header-filter .top_control .delete_all").data("type", cur_index);
8923
8924        $(".basket-items-list-header-filter > a").on("click", function () {
8925          var index = $(this).index();
8926
8927          //fix delayed
8928          if (index == 3) index = 2;
8929
8930          if ($(this).data("filter") == "all") index = "all";
8931
8932          $(".basket-items-list-header-filter .top_control .delete_all").data("type", index);
8933        });
8934      } else {
8935        var cur_index = $(".bx_sort_container a.current").index();
8936        $(".bx_sort_container .top_control .delete_all").data("type", cur_index);
8937        if ($(".bx_ordercart > div:eq(" + cur_index + ") table tbody tr td.item").length)
8938          $(".bx_sort_container .top_control .delete_all").css("opacity", 1);
8939
8940        $(".bx_ordercart .bx_ordercart_coupon #coupon").wrap('<div class="input"></div>');
8941
8942        $(".bx_sort_container > a").on("click", function () {
8943          var index = $(this).index();
8944          $(".bx_sort_container .top_control .delete_all").data("type", index);
8945
8946          if ($(".bx_ordercart > div:eq(" + index + ") table tbody tr td.item").length)
8947            $(".bx_sort_container .top_control .delete_all").css("opacity", 1);
8948          else $(".bx_sort_container .top_control .delete_all").css("opacity", 0);
8949        });
8950      }
8951
8952      $(".basket_print").on("click", function () {
8953        // window.open(location.pathname+"?print=Y",'_blank');
8954        window.print();
8955      });
8956
8957      $(".delete_all").on("click", function () {
8958        if (arAsproOptions["COUNTERS"]["USE_BASKET_GOALS"] !== "N") {
8959          var eventdata = { goal: "goal_basket_clear", params: { type: $(this).data("type") } };
8960          BX.onCustomEvent("onCounterGoals", [eventdata]);
8961        }
8962        $.post(
8963          arAsproOptions["SITE_DIR"] + "ajax/action_basket.php",
8964          "TYPE=" + $(this).data("type") + "&CLEAR_ALL=Y",
8965          $.proxy(function (data) {
8966            location.reload();
8967          })
8968        );
8969      });
8970
8971      $(".bx_item_list_section .bx_catalog_item").sliceHeight({ row: ".bx_item_list_slide", item: ".bx_catalog_item" });
8972
8973      BX.addCustomEvent("onAjaxSuccess", function (e) {
8974        checkMinPrice();
8975
8976        var errorText = $.trim($("#warning_message").text());
8977        $("#basket_items_list .error_text").detach();
8978        if (errorText != "") {
8979          $("#warning_message").hide().text("");
8980          $("#basket_items_list").prepend('<div class="error_text">' + errorText + "</div>");
8981        }
8982
8983        if (typeof e === "object" && e && "BASKET_DATA" in e) {
8984          if ($("#ajax_basket").length) {
8985            reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y");
8986          }
8987          if ($("#basket_line .basket_fly").length) {
8988            basketFly("open", "N");
8989          }
8990        }
8991        if (checkCounters("google")) {
8992          BX.unbindAll(
8993            BX.Sale.BasketComponent.getEntity(
8994              BX.Sale.BasketComponent.getCacheNode(BX.Sale.BasketComponent.ids.basketRoot),
8995              "basket-checkout-button"
8996            )
8997          );
8998        }
8999      });
9000      if (checkCounters("google")) {
9001        BX.unbindAll(
9002          BX.Sale.BasketComponent.getEntity(
9003            BX.Sale.BasketComponent.getCacheNode(BX.Sale.BasketComponent.ids.basketRoot),
9004            "basket-checkout-button"
9005          )
9006        );
9007      }
9008      $(document).on(
9009        "click",
9010        ".bx_ordercart_order_pay_center .checkout, .basket-checkout-section-inner .basket-btn-checkout",
9011        function () {
9012          if (checkCounters("google")) {
9013            const gotoOrder = function () {
9014              BX.Sale.BasketComponent.checkOutAction();
9015            };
9016            checkoutCounter(1, "start order", gotoOrder);
9017          }
9018        }
9019      );
9020    }
9021  };
9022}
9023
9024if (!funcDefined("checkMinPrice")) {
9025  checkMinPrice = function () {
9026    if (arAsproOptions["PAGES"]["BASKET_PAGE"]) {
9027      var summ_raw = 0,
9028        summ = 0;
9029      if ($("#allSum_FORMATED").length) {
9030        summ_raw = $("#allSum_FORMATED")
9031          .text()
9032          .replace(/[^0-9\.,]/g, "");
9033        summ = parseFloat(summ_raw);
9034        if ($("#basket_items").length) {
9035          var summ = 0;
9036          $("#basket_items tr").each(function () {
9037            if (typeof $(this).data("item-price") !== "undefined" && $(this).data("item-price"))
9038              summ +=
9039                $(this).data("item-price") *
9040                $(this)
9041                  .find("#QUANTITY_INPUT_" + $(this).attr("id"))
9042                  .val();
9043          });
9044        }
9045        if (!$(".catalog_back").length)
9046          $(".bx_ordercart_order_pay_center").prepend(
9047            '<a href="' +
9048              arAsproOptions["PAGES"]["CATALOG_PAGE_URL"] +
9049              '" class="catalog_back btn btn-default btn-lg white grey">' +
9050              BX.message("BASKET_CONTINUE_BUTTON") +
9051              "</a>"
9052          );
9053      }
9054
9055      if (arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y")
9056        $(".basket-coupon-section").addClass("smallest");
9057
9058      if (typeof BX.Sale !== "undefined") {
9059        if (typeof BX.Sale.BasketComponent !== "undefined" && typeof BX.Sale.BasketComponent.result !== "undefined")
9060          summ = BX.Sale.BasketComponent.result.allSum;
9061      }
9062
9063      if (arAsproOptions["PRICES"]["MIN_PRICE"]) {
9064        if (arAsproOptions["PRICES"]["MIN_PRICE"] > summ) {
9065          var svgMinPrice =
9066            '<i class="svg  svg-inline-price colored_theme_svg" aria-hidden="true"><svg id="Group_278_copy" data-name="Group 278 copy" xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38"><path id="Ellipse_305_copy_2" data-name="Ellipse 305 copy 2" class="clswm-1" d="M1851,561a19,19,0,1,1,19-19A19,19,0,0,1,1851,561Zm0-36a17,17,0,1,0,17,17A17,17,0,0,0,1851,525Zm3.97,10.375-0.03.266c-0.01.062-.02,0.127-0.03,0.188l-0.94,7.515h0a2.988,2.988,0,0,1-5.94,0H1848l-0.91-7.525c-0.01-.041-0.01-0.086-0.02-0.128l-0.04-.316h0.01c-0.01-.
9066125-0.04-0.246-0.04-0.375a4,4,0,0,1,8,0c0,0.129-.03.25-0.04,0.375h0.01ZM1851,533a2,2,0,0,0-2,2,1.723,1.723,0,0,0,.06.456L1850,543a1,1,0,0,0,2,0l0.94-7.544A1.723,1.723,0,0,0,1853,535,2,2,0,0,0,1851,533Zm0,14a3,3,0,1,1-3,3A3,3,0,0,1,1851,547Zm0,4a1,1,0,1,0-1-1A1,1,0,0,0,1851,551Z" transform="translate(-1832 -523)"></path>  <path class="clswm-2 op-cls" d="M1853,543l-1,1h-2l-1-1-1-8,1-2,1-1h2l1,1,1,2Zm-1,5,1,1v2l-1,1h-2l-1-1v-2l1-1h2Z" transform="translate(-1832 -523)"></path></svg></i>';
9067          if ($(".oneclickbuy.fast_order").length) $(".oneclickbuy.fast_order").remove();
9068
9069          if ($(".basket-checkout-container").length) {
9070            if (!$(".icon_error_wrapper").length) {
9071              $(".basket-checkout-block.basket-checkout-block-btn").html(
9072                '<div class="icon_error_wrapper"><div class="icon_error_block">' +
9073                  svgMinPrice +
9074                  BX.message("MIN_ORDER_PRICE_TEXT").replace(
9075                    "#PRICE#",
9076                    jsPriceFormat(arAsproOptions["PRICES"]["MIN_PRICE"])
9077                  ) +
9078                  "</div></div>"
9079              );
9080            }
9081          } else {
9082            if (!$(".icon_error_wrapper").length && typeof jsPriceFormat !== "undefined") {
9083              $(".bx_ordercart_order_pay_center").prepend(
9084                '<div class="icon_error_wrapper"><div class="icon_error_block">' +
9085                  svgMinPrice +
9086                  BX.message("MIN_ORDER_PRICE_TEXT").replace(
9087                    "#PRICE#",
9088                    jsPriceFormat(arAsproOptions["PRICES"]["MIN_PRICE"])
9089                  ) +
9090                  "</div></div>"
9091              );
9092            }
9093            if ($(".bx_ordercart_order_pay .checkout").length) $(".bx_ordercart_order_pay .checkout").remove();
9094          }
9095        } else {
9096          if ($(".icon_error_wrapper").length) $(".icon_error_wrapper").remove();
9097
9098          if ($(".basket-checkout-container").length) {
9099            if (
9100              !$(".oneclickbuy.fast_order").length &&
9101              arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y" &&
9102              !$(".basket-btn-checkout.disabled").length
9103            )
9104              $(".basket-checkout-section-inner").append(
9105                '<div class="fastorder"><span class="oneclickbuy btn btn-lg fast_order btn-transparent-border-color" onclick="oneClickBuyBasket()">' +
9106                  BX.message("BASKET_QUICK_ORDER_BUTTON") +
9107                  "</span></div>"
9108              );
9109          } else {
9110            if ($(".bx_ordercart_order_pay .checkout").length)
9111              $(".bx_ordercart .bx_ordercart_order_pay .checkout").css("opacity", "1");
9112            else
9113              $(".bx_ordercart_order_pay_center").append(
9114                '<a href="javascript:void(0)" onclick="checkOut();" class="checkout" style="opacity: 1;">' +
9115                  BX.message("BASKET_ORDER_BUTTON") +
9116                  "</a>"
9117              );
9118            if (
9119              !$(".oneclickbuy.fast_order").length &&
9120              arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y"
9121            )
9122              $(".bx_ordercart_order_pay_center").append(
9123                '<span class="oneclickbuy btn btn-lg fast_order btn-transparent-border-color" onclick="oneClickBuyBasket()">' +
9124                  BX.message("BASKET_QUICK_ORDER_BUTTON") +
9125                  "</span>"
9126              );
9127          }
9128        }
9129      } else {
9130        if ($(".basket-checkout-container").length) {
9131          if (
9132            !$(".oneclickbuy.fast_order").length &&
9133            arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y" &&
9134            !$(".basket-btn-checkout.disabled").length
9135          )
9136            $(".basket-checkout-section-inner").append(
9137              '<div class="fastorder"><span class="oneclickbuy btn btn-lg fast_order btn-transparent-border-color" onclick="oneClickBuyBasket()">' +
9138                BX.message("BASKET_QUICK_ORDER_BUTTON") +
9139                "</span></div>"
9140            );
9141        } else {
9142          $(".bx_ordercart .bx_ordercart_order_pay .checkout").css("opacity", "1");
9143          if (!$(".oneclickbuy.fast_order").length && arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y")
9144            $(".bx_ordercart_order_pay_center").append(
9145              '<span class="oneclickbuy btn btn-lg fast_order btn-trans
9145parent-border-color" onclick="oneClickBuyBasket()">' +
9146                BX.message("BASKET_QUICK_ORDER_BUTTON") +
9147                "</span>"
9148            );
9149        }
9150      }
9151
9152      showBasketShareBtn();
9153      showBasketHeadingBtn();
9154
9155      $("#basket-root .basket-checkout-container .basket-checkout-section .basket-checkout-block .basket-btn-checkout");
9156      $("#basket-root .basket-checkout-container").addClass("visible");
9157    }
9158  };
9159}
9160
9161var isFrameDataReceived = false;
9162if (typeof window.frameCacheVars !== "undefined") {
9163  BX.addCustomEvent(window, "onFrameDataRequestFail", function (response) {
9164    console.log(response);
9165  });
9166
9167  BX.addCustomEvent("onFrameDataReceivedBefore", function () {
9168    // stop ya metrika webvisor DOM indexer
9169    pauseYmObserver();
9170  });
9171
9172  BX.addCustomEvent("onFrameDataReceived", function (json) {
9173    initFull();
9174
9175    CheckTopMenuDotted();
9176
9177    checkLinkedArticles();
9178    checkLinkedBlocks(".linked-banners-list");
9179
9180    if ($(".logo-row.v2").length) {
9181      $(window).resize(); // need to check resize flexslider & menu
9182      setTimeout(function () {
9183        CheckTopMenuDotted();
9184      }, 100);
9185    }
9186
9187    if (funcDefined("setNewHeader")) {
9188      if (typeof BX === "object" && (BX.message("TYPE_SKU") != "TYPE_1" || BX.message("HAS_SKU_PROPS") != "Y")) {
9189        setNewHeader();
9190      } else {
9191        var objNameWrapper = $(".bx_catalog_item_scu[id]");
9192        if (objNameWrapper.length) {
9193          var id = "ob" + objNameWrapper.attr("id").replace("_skudiv", "");
9194          if (id && window[id] !== undefined) {
9195            var obj = window[id].offers[window[id].offerNum];
9196            if (obj !== undefined) {
9197              setNewHeader(obj);
9198            }
9199          }
9200        }
9201      }
9202    }
9203
9204    // resume ya metrika webvisor
9205    // (100ms sliceHeight) + (200ms mCustomScroll) + (100ms lazyload)
9206    setTimeout(resumeYmObserver, 400);
9207
9208    isFrameDataReceived = true;
9209  });
9210} else {
9211  $(document).ready(initFull);
9212}
9213
9214if (!funcDefined("setHeightBlockSlider")) {
9215  setHeightBlockSlider = function () {
9216    /*$(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").equalize({ children: ".item-title" });
9217    $(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").equalize({ children: ".item_info" });
9218    $(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").equalize({ children: ".catalog_item" });
9219
9220    var sliderWidth = $(document).find(".specials.tab_slider_wrapp").outerWidth();
9221
9222    var iCountTabs = $(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").length;
9223
9224    if (iCountTabs <= 1) {
9225      $(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").css("height", "");
9226
9227      var itemsButtonsHeight = 0;
9228      if ($(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur .tabs_slider li .footer_button").length) {
9229        $(document)
9230          .find(".specials.tab_slider_wrapp .tabs_content .tab.cur .tabs_slider li .footer_button")
9231          .css("height", "auto");
9232        itemsButtonsHeight = $(document)
9233          .find(".specials.tab_slider_wrapp .tabs_content .tab.cur .tabs_slider li .footer_button")
9234          .height();
9235        $(document)
9236          .find(".specials.tab_slider_wrapp .tabs_content .tab.cur .tabs_slider li .footer_button")
9237          .css("height", "");
9238      }
9239      var tabsContentUnhover = $(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur").height() * 1;
9240      var tabsContentHover = tabsContentUnhover + itemsButtonsHeight + 50;
9241      $(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur").attr("data-unhover", tabsContentUnhover);
9242      $(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur").attr("data-hover", tabsContentHover);
9243      $(document).find(".specials.tab_slider_wrapp .tabs_content").height(tabsContentUnhover);
9244      $(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur .flex-viewport").height(tabsContentUnhover);
9245    } else {
9246      $(document)
9247        .find(".specials.tab_slider_wrapp .tabs_content > li.cur")
9248        .each(function () {
9249          var _th = $(this);
9250          _th.css("height", "");
9251
9252          var itemsButtonsHeight = 0;
9253          if (_th.find(".tabs_slider li .footer_button").length) {
9254            _th.find(".tabs_slider li .footer_button").css("height", "auto");
9255            itemsButtonsHeight = _th.find(".tabs_slider li .footer_button").height();
9256            _th.find(".tabs_slider li .footer_button").css("height", "");
9257          }
9258
9259          var tabsContentUnhover = _th.height() * 1;
9260          var tabsContentHover = tabsContentUnhover + itemsButtonsHeight + 50;
9261          _th.attr("data-unhover", tabsContentUnhover);
9262          _th.attr("data-hover", tabsContentHover);
9263          _th.parent().height(tabsContentUnhover);
9264          _th.find(".flex-viewport").height(tabsContentUnhover);
9265        });
9266    }*/
9267  };
9268}
9269
9270if (!funcDefined("checkTopFilter")) {
9271  checkTopFilter = function () {};
9272}
9273
9274if (!funcDefined("checkStickyFooter")) {
9275  checkStickyFooter = function () {};
9276}
9277
9278if (!funcDefined("checkLinkedArticles")) {
9279  checkLinkedArticles = function () {
9280    try {
9281      if ($(".linked-blog-list.content .item-views").length) {
9282        var mobileRow = $(".linked-blog-list").data("mobile_row"),
9283          desktopRow = $(".linked-blog-list").data("desktop_row"),
9284          parentBlock = $(".ajax_load .js_append"),
9285          widthRow = parentBlock.getFloatWidth(),
9286          elementWidthRow = parentBlock.find("> .item:eq(0)").getFloatWidth(),
9287          elementsCount = parentBlock.find("> .item").length,
9288          slice = Math.floor(widthRow / elementWidthRow),
9289          rowInsertCount = Math.floor(elementsCount / slice),
9290          bCalculateRows = false;
9291        if (window.matchMedia("(max-width: 767px)").matches) {
9292          if (!mobileRow && desktopRow) {
9293            mobileRow = desktopRow;
9294          }
9295          if (mobileRow && mobileRow <= rowInsertCount) {
9296            rowInsertCount = slice * mobileRow;
9297            bCalculateRows = true;
9298          }
9299        } else {
9300          if (desktopRow && desktopRow <= rowInsertCount) {
9301            rowInsertCount = slice * desktopRow;
9302            bCalculateRows = true;
9303          }
9304        }
9305        if (!bCalculateRows) {
9306          rowInsertCount = elementsCount;
9307        }
9308
9309        var linkedBlock = ".linked-blog-list";
9310        var blockInItems = parentBlock.find(linkedBlock);
9311        if (blockInItems.length) {
9312          $(blockInItems).insertAfter(parentBlock.find("> .item:eq(" + (rowInsertCount - 1) + ")"));
9313          setTimeout(function () {
9314            $(blockInItems).addClass("visible");
9315          }, 0);
9316        } else {
9317          var cloneBlock = $(linkedBlock).clone();
9318          var owlBlock = cloneBlock.find(".owl-carousel-wait");
9319          cloneBlock.insertAfter(parentBlock.find("> .item:eq(" + (rowInsertCount - 1) + ")"));
9320          owlBlock.removeClass("owl-carousel-wait").addClass("owl-carousel");
9321          setTimeout(function () {
9322            cloneBlock.addClass("visible");
9323            InitOwlSlider();
9324            owlBlock.removeClass("loader_circle");
9325          }, 1);
9326        }
9327      }
9328    } catch (e) {
9329      console.error(e);
9330    }
9331  };
9332}
9333
9334if (!funcDefined("checkLinkedBlocks")) {
9335  checkLinkedBlocks = function (linkedBlock) {
9336    if (!linkedBlock) linkedBlock = ".linked-banners-list";
9337
9338    try {
9339      if ($(linkedBlock + ".content" + " div").length) {
9340        var mobileRow = $(linkedBlock).data("mobile_row"),
9341          desktopRow = $(linkedBlock).data("desktop_row"),
9342          wrapperBlock = $(".ajax_load .js_wrapper_items"),
9343          parentBlock = $(".ajax_load .js_append"),
9344          widthRow = wrapperBlock.getFloatWidth(),
9345          elementWidthRow = parentBlock.find("> .item:eq(0)").getFloatWidth(),
9346          elementsCount = parentBlock.find("> .item").length,
9347          slice = Math.floor(widthRow / elementWidthRow),
9348          rowInsertCount = Math.floor(elementsCount / slice),
9349          bCalculateRows = false;
9350        if (window.matchMedia("(max-width: 767px)").matches) {
9351          if (!mobileRow && desktopRow) {
9352            mobileRow = desktopRow;
9353          }
9354          if (mobileRow && mobileRow <= rowInsertCount) {
9355            rowInsertCount = slice * mobileRow;
9356            bCalculateRows = true;
9357          }
9358        } else {
9359          if (desktopRow && desktopRow <= rowInsertCount) {
9360            rowInsertCount = slice * desktopRow;
9361            bCalculateRows = true;
9362          }
9363        }
9364        if (!bCalculateRows) {
9365          rowInsertCount = elementsCount;
9366        }
9367        var blockInItems = parentBlock.find(linkedBlock);
9368        if (blockInItems.length) {
9369          $(blockInItems).insertAfter(parentBlock.find("> .item:eq(" + (rowInsertCount - 1) + ")"));
9370          setTimeout(function () {
9371            $(blockInItems).addClass("visible");
9372          }, 0);
9373        } else {
9374          var cloneBlock = $(linkedBlock).clone();
9375          var owlBlock = cloneBlock.find(".owl-carousel-wait");
9376          cloneBlock.insertAfter(parentBlock.find("> .item:eq(" + (rowInsertCount - 1) + ")"));
9377          owlBlock.removeClass("owl-carousel-wait").addClass("owl-carousel");
9378          setTimeout(function () {
9379            cloneBlock.addClass("visible");
9380            InitOwlSlider();
9381            owlBlock.removeClass("loader_circle");
9382          }, 1);
9383        }
9384      }
9385    } catch (e) {
9386      console.error(e);
9387    }
9388  };
9389}
9390
9391/* EVENTS */
9392var timerResize = false,
9393  ignoreResize = [];
9394$(window).resize(function () {
9395  checkLinkedArticles();
9396  checkLinkedBlocks(".linked-banners-list");
9397
9398  // here immediate functions
9399  if (!ignoreResize.length) {
9400    if (timerResize) {
9401      clearTimeout(timerResize);
9402      timerResize = false;
9403    }
9404    timerResize = setTimeout(function () {
9405      // here delayed functions in event
9406      BX.onCustomEvent("onWindowResize", false);
9407    }, 50);
9408  }
9409});
9410
9411var timerScroll = false,
9412  ignoreScroll = [],
9413  documentScrollTopLast = window.pageYOffset,
9414  startScroll = 0;
9415$(window).scroll(function () {
9416  // here immediate functions
9417  documentScrollTopLast = window.pageYOffset;
9418  SetFixedAskBlock();
9419
9420  if (!ignoreScroll.length) {
9421    if (timerScroll) {
9422      clearTimeout(timerScroll);
9423      timerScroll = false;
9424    }
9425    timerScroll = setTimeout(function () {
9426      // here delayed functions in event
9427      BX.onCustomEvent("onWindowScroll", false);
9428    }, 50);
9429  }
9430});
9431
9432BX.addCustomEvent("onWindowResize", function (eventdata) {
9433  try {
9434    ignoreResize.push(true);
9435
9436    CheckTabActive();
9437    CheckTopMenuFullCatalogSubmenu();
9438
9439    if (window.matchMedia("(min-width:768px)").matches) {
9440      closeYandexMap();
9441    }
9442
9443    if ($("nav.mega-menu.sliced").length) $("nav.mega-menu.sliced").removeClass("initied");
9444    CheckTopMenuDotted();
9445
9446    CheckTopVisibleMenu();
9447
9448    checkScrollToTop();
9449    CheckObjectsSizes();
9450
9451    initSly();
9452
9453    // checkVerticalMobileFilter();
9454    if (typeof checkMobilePhone === "function") {
9455      checkMobilePhone();
9456    }
9457    checkTopFilter();
9458    if (typeof checkMobileFilter === "function") {
9459      checkMobileFilter();
9460    }
9461
9462    if (typeof window["stickySidebar"] !== "undefined") {
9463      if (window.matchMedia("(max-width: 991px)").matches) {
9464        window["stickySidebar"].destroy();
9465      } else {
9466        window["stickySidebar"].bindEvents();
9467      }
9468    }
9469
9470    if ($(".flexslider.wsmooth").length) {
9471      $(".flexslider.wsmooth").each(function () {
9472        $(this).data("flexslider").smoothHeight();
9473      });
9474    }
9475
9476    if (window.matchMedia("(min-width: 767px)").matches) $(".wrapper_middle_menu.wrap_menu").removeClass("mobile");
9477
9478    if (window.matchMedia("(max-width: 767px)").matches) $(".wrapper_middle_menu.wrap_menu").addClass("mobile");
9479
9480    if ($("#basket_form").length && $(window).outerWidth() <= 600) {
9481      $("#basket_form .tabs_content.basket > li.cur td").each(function () {
9482        $(this).css("width", "");
9483      });
9484    }
9485
9486    $(".bx_filter_section .bx_filter_select_container").each(function () {
9487      var prop_id = $(this).closest(".bx_filter_parameters_box").attr("property_id");
9488      if ($("#smartFilterDropDown" + prop_id).length) {
9489        $("#smartFilterDropDown" + prop_id).css("max-width", $(this).width());
9490      }
9491    });
9492  } catch (e) {
9493    console.log(e);
9494  } finally {
9495    ignoreResize.pop();
9496  }
9497});
9498
9499BX.addCustomEvent("onWindowScroll", function (eventdata) {
9500  try {
9501    ignoreScroll.push(true);
9502  } catch (e) {
9503  } finally {
9504    ignoreScroll.pop();
9505  }
9506});
9507
9508BX.addCustomEvent("onSlideInit", function (eventdata) {
9509  try {
9510    ignoreResize.push(true);
9511    if (eventdata) {
9512      var slider = eventdata.slider;
9513      if (slider) {
9514        if (slider.hasClass("small-gallery")) $(window).resize();
9515        // add classes .curent & .shown to slide
9516        slider.find(".item").removeClass("current");
9517        var curSlide = slider.find(".item.flex-active-slide"),
9518          curSlideId = curSlide.attr("id"),
9519          nav = slider.find(".flex-direction-nav");
9520
9521        curSlide.addClass("current");
9522
9523        slider.find(".visible").css("opacity", "1");
9524        slider.find(".height0").css("height", "auto");
9525
9526        if (curSlide.hasClass("shown")) {
9527          slider.find(".item.clone[id=" + curSlideId + "_clone]").addClass("shown");
9528        }
9529
9530        curSlide.addClass("shown");
9531      }
9532    }
9533  } catch (e) {
9534  } finally {
9535    ignoreResize.pop();
9536  }
9537});
9538
9539BX.addCustomEvent("onCounterGoals", function (eventdata) {
9540  if (arAsproOptions["THEME"]["YA_GOALS"] == "Y" && arAsproOptions["THEME"]["YA_COUNTER_ID"]) {
9541    var idCounter = arAsproOptions["THEME"]["YA_COUNTER_ID"];
9542    idCounter = parseInt(idCounter);
9543
9544    if (typeof eventdata != "object") eventdata = { goal: "undefined" };
9545
9546    if (typeof eventdata.goal != "string") eventdata.goal = "undefined";
9547
9548    if (idCounter) {
9549      try {
9550        waitCounter(idCounter, 50, function () {
9551          var obCounter = window["yaCounter" + idCounter];
9552          if (typeof obCounter == "object") {
9553            obCounter.reachGoal(eventdata.goal);
9554          }
9555        });
9556      } catch (e) {
9557        console.error(e);
9558      }
9559    } else {
9560      console.info("Bad counter id!", idCounter);
9561    }
9562  }
9563});
9564
9565var onCaptchaVerifyinvisible = function (response) {
9566  $(".g-recaptcha:last").each(function () {
9567    var id = $(this).attr("data-widgetid");
9568    if (typeof id !== "undefined" && response) {
9569      if (!$(this).closest("form").find(".g-recaptcha-response").val())
9570        $(this).closest("form").find(".g-recaptcha-response").val(response);
9571      if ($("iframe[src*=recaptcha]").length) {
9572        $("iframe[src*=recaptcha]").each(function () {
9573          var block = $(this).parent().parent();
9574          if (!block.hasClass("grecaptcha-badge")) block.css("width", "100%");
9575        });
9576      }
9577      $(this).closest("form").submit();
9578    }
9579  });
9580};
9581
9582var onCaptchaVerifynormal = function (response) {
9583  $(".g-recaptcha").each(function () {
9584    var id = $(this).attr("data-widgetid");
9585    if (typeof id !== "undefined") {
9586      if (grecaptcha.getResponse(id) != "") {
9587        $(this).closest("form").find(".recaptcha").valid();
9588      }
9589    }
9590  });
9591};
9592
9593BX.addCustomEvent("onSubmitForm", function (eventdata) {
9594  try {
9595    if (
9596      !window.renderRecaptchaById ||
9597      !window.asproRecaptcha ||
9598      !window.asproRecaptcha.key
9599    ) {
9600      eventdata.form.submit();
9601      $(eventdata.form).closest(".form").addClass("sending");
9602      return true;
9603    }
9604    if (
9605      window.asproRecaptcha.params.recaptchaSize == "invisible" &&
9606      $(eventdata.form).find(".g-recaptcha").length
9607    ) {
9608      if ($(eventdata.form).find(".g-recaptcha-response").val()) {
9609        eventdata.form.submit();
9610        $(eventdata.form).closest(".form").addClass("sending");
9611        return true;
9612      } else {
9613        if (typeof grecaptcha != "undefined") {
9614          grecaptcha.execute(
9615            $(eventdata.form).find(".g-recaptcha").data("widgetid")
9616          );
9617        } else {
9618          return false;
9619        }
9620      }
9621    } else if ($(eventdata.form).find(".g-recaptcha").length && window.asproRecaptcha.ver === "3" && typeof grecaptcha != "undefined") {
9622      grecaptcha
9623      .execute(window.asproRecaptcha.key, { action: "maxscore" })
9624      .then(function (token) {
9625        $(eventdata.form).find(".g-recaptcha-response").html(token);
9626        eventdata.form.submit();
9627        $(eventdata.form).closest(".form").addClass("sending");
9628
9629        return true;
9630      });
9631
9632    } else {
9633      eventdata.form.submit();
9634      $(eventdata.form).closest(".form").addClass("sending");
9635      return true;
9636    }
9637  } catch (e) {
9638    console.error(e);
9639    return true;
9640  }
9641});
9642
9643$(document).on("click", ".catalog_reviews_extended span.dropdown-select__list-link", function () {
9644  var _this = $(this);
9645  var ajaxData = _this.data("review_sort_ajax");
9646  var container = _this.closest(".blog-comments");
9647  containerId = container.attr("id");
9648  if (containerId !== undefined && containerId) {
9649    ajaxData.containerId = containerId;
9650  }
9651  if (ajaxData !== undefined) {
9652    container.addClass("blur");
9653    $.ajax({
9654      type: "post",
9655      data: ajaxData,
9656      success: function (html) {
9657        $("#reviews_sort_continer").html(html);
9658        container.removeClass("blur");
9659      },
9660    });
9661  }
9662});
9663
9664$(document).on("change", ".filter-panel__sort-form input", function () {
9665  const _this = $(this);
9666  const $form = _this.closest("form")[0];
9667  const $container = _this.closest(".blog-comments");
9668  const method = $form.method;
9669  const formData = new FormData($form);
9670
9671  if ($container.length) {
9672    $container.addClass("blur");
9673    formData.append("containerId", $container.attr("id"));
9674  }
9675
9676  $.ajax({
9677    data: formData,
9678    type: method,
9679    processData: false,
9680    contentType: false,
9681    success: function (html) {
9682      $("#reviews_sort_continer").html(html);
9683      $container.removeClass("blur");
9684    },
9685  });
9686});
9687
9688$(document).on("click", ".rating_vote:not(.disable)", function () {
9689  var _this = $(this);
9690  var action = _this.data("action");
9691  var parent = _this.closest(".rating-vote");
9692  var commentId = parent.data("comment_id");
9693  var userId = parent.data("user_id");
9694  var ajaxUrl = parent.data("ajax_url");
9695  $.ajax({
9696    url: ajaxUrl,
9697    dataType: "json",
9698    data: { commentId: commentId, action: action, userId: userId },
9699    success: function (data) {
9700      if (data.LIKE !== undefined) {
9701        _this.siblings(".rating-vote-result.like").text(data.LIKE);
9702      }
9703      if (data.DISLIKE !== undefined) {
9704        _this.siblings(".rating-vote-result.dislike").text(data.DISLIKE);
9705      }
9706      if (data.SET_ACTIVE_LIKE !== undefined) {
9707        parent.find(".rating_vote.plus").toggleClass("active");
9708      }
9709      if (data.SET_ACTIVE_DISLIKE !== undefined) {
9710        parent.find(".rating_vote.minus").toggleClass("active");
9711      }
9712    },
9713  });
9714});
9715
9716function fileInputInit(message, reviews = "N") {
9717  $('input[type=file]:not(".uniform-ignore")').uniform({
9718    fileButtonHtml: BX.message("JS_FILE_BUTTON_NAME"),
9719    fileDefaultHtml: message,
9720  });
9721  $(document).on("change", "input[type=file]", function () {
9722    if ($(this).val()) {
9723      $(this).closest(".uploader").addClass("files_add");
9724    } else {
9725      $(this).closest(".uploader").removeClass("files_add");
9726    }
9727  });
9728  $(".form .add_file").on("click", function () {
9729    var index = $(this).closest(".form-group").find("input[type=file]").length;
9730    let inputFormGroup = $(this).closest(".form-group").find(".input");
9731    if (reviews === "Y") {
9732      inputFormGroup.append(
9733        '<input type="file" class="form-control" tabindex="3" id="comment_images" name="comment_images[]" value=""  />'
9734      );
9735    } else {
9736      inputFormGroup.append(
9737        '<input type="file" id="POPUP_FILE' + index + '" name="FILE_n' + index + '"   class="inputfile" value="" />'
9738      );
9739    }
9740
9741    $('input[type=file]:not(".uniform-ignore")').uniform({
9742      fileButtonHtml: BX.message("JS_FILE_BUTTON_NAME"),
9743      fileDefaultHtml: message,
9744    });
9745  });
9746}
9747
9748function declOfNum(number, titles) {
9749  var cases = [2, 0, 1, 1, 1, 2];
9750  return number + " " + titles[number % 100 > 4 && number % 100 < 20 ? 2 : cases[Math.min(number % 10, 5)]];
9751}
9752
9753function array_values_js(input) {
9754  var tmp_arr = new Array(),
9755    cnt = 0;
9756  for (key in input) {
9757    tmp_arr[cnt] = input[key];
9758    cnt++;
9759  }
9760
9761  return tmp_arr;
9762}
9763
9764$(document).on("input", ".bx_filter_parameters_box_container input[type=text], .inputdecimal", function() {
9765  this.value = this.value.replace(/[^\d\.\-]/g, '');
9766})
9767/* End */
9768;
9769; /* Start:"a:4:{s:4:"full";s:66:"/bitrix/templates/aspro_max/js/blocks/blocks.min.js?17762217785019";s:6:"source";s:47:"/bitrix/templates/aspro_max/js/blocks/blocks.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9770function updateProgressBar(){let allProgressBar="nodelist"===typeofExt(window.asproAllProgressBar)&&window.asproAllProgressBar;if(allProgressBar&&allProgressBar.length){let scrollHeight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),scrollTop=window.pageYOffset||document.documentElement.scrollTop,clientHeight=document.documentElement.clientHeight,scrollProcent=Math.round(scrollTop/(scrollHeight-clientHeight)*100);if(allProgressBar.length)for(let item=0;item<allProgressBar.length;item++)allProgressBar[item].style.width=scrollProcent+"%"}}InitMenuNavigationAim=function(){var $block=$(".menu-navigation__sections-wrapper .menu-navigation__sections:not(.aim-init)");$block.length&&($block.addClass("aim-init"),loadScripts(arAsproOptions.SITE_TEMPLATE_PATH+"/vendor/js/jquery.menu-aim.js",(function(){$block.menuAim({firstActiveRow:!0,rowSelector:"> .menu-navigation__sections-item",activate:function activate(a){var _this=$(a),index=_this.index(),items=_this.closest(".menu-navigation__sections-wrapper").next(),link=_this.find("> a");_this.siblings().find("> a").addClass("dark_link"),link.addClass("colored_theme_text").removeClass("dark_link"),items.find(".parent-items").siblings().hide(),items.find(".parent-items").eq(index).show()},deactivate:function deactivate(a){var _this=$(a),index=_this.index(),items=_this.closest(".menu-navigation__sections-wrapper").next(),link;_this.find("> a").removeClass("colored_theme_text").addClass("dark_link"),items.find(".parent-items").siblings().hide()}})})))},readyDOM((function(){window.asproAllProgressBar=document.querySelectorAll(".header-progress-bar__inner")})),$(document).ready((function(){$(document).on("click",".dropdown-select .dropdown-select__title",(function(){var _this=$(this),menu;_this.parent().find("> .dropdown-select__list").stop().slideToggle(300),_this.toggleClass("dropdown-select__title--opened")})),$("html, body").on("mousedown",(function(e){"string"==typeof e.target.className&&e.target.className.indexOf("adm")<0&&(e.stopPropagation(),$(e.target).closest(".dropdown-select").length||BX.onCustomEvent("onCloseDropDown"))})),BX.addCustomEvent("onCloseDropDown",()=>{$(".dropdown-select .dropdown-select__title").removeClass("dropdown-select__title--opened"),$(".dropdown-select__list:visible").stop().slideUp()}),$(document).on("click",".slide-block .slide-block__head",(function(e){var _this=$(this),menu=_this.siblings(".slide-block__body"),bVisibleMeu=menu.is(":visible"),animate=bVisibleMeu?"slideUp":"slideDown";if(!_this.hasClass("clicked")&&menu.length&&!_this.hasClass("ignore")&&!$(e.target).attr("href")){var type=_this.data("id");_this.addClass("clicked"),bVisibleMeu?$.cookie(type+"_CLOSED","Y"):$.removeCookie(type+"_CLOSED"),menu.stop().slideToggle({duration:150,start:function(){_this.toggleClass("closed")},complete:function(){_this.removeClass("clicked"),void 0!==window.stickySidebar&&window.stickySidebar.updateSticky()}})}})),$(".switch-item-block .switch-item-block__icons").on("click",(function(){var $this=$(this),animationTime=200;$this.hasClass("switch-item-block__icons--small")&&!$this.hasClass("active")?($this.addClass("active"),$this.siblings(".switch-item-block__icons--big").removeClass("active"),$this.closest(".switch-item-block").find(".switch-item-block__count-wrapper--big").fadeOut(200,(function(){$this.closest(".switch-item-block").find(".switch-item-block__count-wrapper--small").fadeIn(200)})),$this.closest(".switch-item-block").siblings(".big-gallery-block").fadeOut(200,(function(){$this.closest(".switch-item-block").siblings(".small-gallery-block").fadeIn(200)}))):$this.hasClass("switch-item-block__icons--big")&&!$this.hasClass("active")&&($this.addClass("active"),$this.siblings(".switch-item-block__icons--small").removeClass("active"),$this.closest(".switch-item-block").find(".switch-item-block__count-wrapper--small").fadeOut(200,(function(){$this.closest(".switch-item-block").find(".switch-item-block__count-wrapper--big").fadeIn(200)})),$this.closest(".switch-item-block").siblings(".small-gallery-block").fadeOut(200,(function(){$this.closest(".switch-item-block").siblings(".big-gallery-block").fadeIn(200)}))),setTimeout((function(){InitLazyLoad()}),300)})),window.addEventListener("scroll",throttle(updateProgressBar,200)),$(".form-control:not(.eye-password-ignore) [type=password]").each((function(item){let passBlock=$(this).closest(".form-control"),labelBlock=passBlock.find(".label_block");labelBlock.length?labelBlock.addClass("eye-password"):passBlock.addClass("eye-password")})),$(document).on("click",".eye-password:not(.eye-password-ignore)",(function(event){let input=this.querySelector("input"),eyeWidth=56;this.clientWidth-56<event.offsetX&&("password"==input.type?(input.type="text",this.classList.add("password-show")):"text"==input.type&&(input.type="password",this.classList.remove("password-show")))}))}));
9771/* End */
9772;
9773; /* Start:"a:4:{s:4:"full";s:57:"/bitrix/templates/aspro_max/js/logo.min.js?17762217783490";s:6:"source";s:42:"/bitrix/templates/aspro_max/js/logo.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9774if(void 0===window.JLogo){let readyFunc;window.JLogo=function(node,params){var _private={inited:!1};Object.defineProperties(this,{inited:{get:function(){return _private.inited},set:function(value){value&&(_private.inited=!0)}},node:{get:function(){return node}},img:{get:function(){return node?node.querySelector("img"):null}},svg:{get:function(){return node?node.querySelector("svg"):null}}}),this.params=function(key){if("object"==typeof params&&void 0!==key&&Object.keys(params).indexOf(key)>-1)return params[key]},this.init()},window.JLogo.prototype={get src(){return this.img?this.img.getAttribute("src"):""},set src(value){this.img&&this.img.setAttribute("src",value)}
9774,get srcDark(){return arAsproOptions.THEME.LOGO_IMAGE},get srcLight(){return arAsproOptions.THEME.LOGO_IMAGE_LIGHT?arAsproOptions.THEME.LOGO_IMAGE_LIGHT:arAsproOptions.THEME.LOGO_IMAGE},get srcFixed(){return arAsproOptions.THEME.LOGO_IMAGE_FIXED},get color(){if(this.img){let src=this.src;return src===this.srcDark?"dark":src===this.srcLight?"light":""}return""},set color(value){this.canChangeColor&&this.color!==value&&(this.src="light"===value?this.srcLight:this.srcDark)},get isMainLogo(){return Boolean(this.node.closest("header"))},get isFixedLogo(){return Boolean(this.node.closest("#headerfixed"))},get canChangeColor(){let result=!1;if(this.img)if(this.isMainLogo)this.node.closest(".long_banner")||this.node.closest(".long_banner_contents")||(result=!0);else if(this.isFixedLogo){if(!this.srcFixed)return!0}else result=!0;return result},setColorOfBanner:function(banner){this.img&&banner&&void 0!==window.headerLogo&&(value=BX.data(banner,"text_color"),value=value||"dark",this.color!==value&&(this.src="light"===value?this.srcLight:this.srcDark))},get isPreferColor(){return BX.hasClass(document.body,"theme-default")},get preferColor(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},get themeColor(){return this.isPreferColor?this.preferColor:BX.hasClass(document.body,"theme-dark")?"dark":"light"},init:function(){this.inited||(this.inited=!0,this.img&&(this.color=this.getInvertedColor(this.themeColor),this.bindEvents()))},getInvertedColor:function(value){return"default"===value&&(value=this.preferColor),"light"===value?"dark":"dark"===value?"light":""},bindEvents:function(){"function"==typeof this.handlers.onChangePrefersColorScheme&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",BX.proxy(this.handlers.onChangePrefersColorScheme,this)),"function"==typeof this.handlers.onChangeThemeColor&&BX.addCustomEvent("onChangeThemeColor",BX.proxy(this.handlers.onChangeThemeColor,this))},unbindEvents:function(){},handlers:{onChangePrefersColorScheme:function(event){event||(event=window.event);let newColor=event.matches?"dark":"light";this.isPreferColor&&(this.color=this.getInvertedColor(newColor)),BX.setCookie("prefers-color-scheme",newColor)},onChangeThemeColor:function(eventdata){"object"==typeof eventdata&&eventdata&&"value"in eventdata&&(this.color=this.getInvertedColor(eventdata.value))}}},("function"==typeof readyDOM?readyDOM:BX.ready)((function(){window.headerLogo=new JLogo(document.querySelector("header .logo")),window.headerfixedLogo=new JLogo(document.querySelector("#headerfixed .logo")),window.megamenuLogo=new JLogo(document.querySelector(".mega_fixed_menu .logo")),window.mobileheaderLogo=new JLogo(document.querySelector("#mobileheader .logo")),BX.setCookie("prefers-color-scheme",window.headerLogo.preferColor)}))}
9775/* End */
9776;
9777; /* Start:"a:4:{s:4:"full";s:73:"/bitrix/templates/aspro_max/js/autoload/item-action.min.js?17762217788977";s:6:"source";s:54:"/bitrix/templates/aspro_max/js/autoload/item-action.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9778void 0===window.JItemAction&&(JItemAction=function(t,e){t="object"==typeof t&&t&&t instanceof Node?t:null,e="object"==typeof e&&e?e:{},this.node=t;var o={inited:!1,data:null,config:{bindEvents:!0,changeState:!0,fireGoals:!0}};let i=Object.assign({},o.config,e);Object.defineProperties(this,{inited:{get:function(){return o.inited},set:function(t){t&&(o.inited=!0)}},config:{get:function(){return i}},data:{get:function(){let t=null;return this.valid&&(t=this.node.dataset),o.data&&(t=o.data),Object.assign({},t)},set:function(t){o.data=t}}}),this.init()},JItemAction.prototype={constructor:JItemAction,busy:!1,parentNode:null,prevState:null,activeClass:"added in",get class(){return this.constructor.name},get action(){return""},get requestUrl(){return`aspro:max.ItemAction.${this.action}`},get valid(){return this.node&&this.action},get state(){return!this.config.changeState||this.valid&&BX.hasClass(this.node,this.activeClass)},set state(t){if(this.valid&&this.config.changeState&&(this.node.removeAttribute("style"),t!=this.state)){t?BX.addClass(this.node,this.activeClass):BX.removeClass(this.node,this.activeClass);let e=this.getStateTitle(t);this.node.setAttribute("title",e);let o=this.node.querySelector(".info-buttons__item-text");if(o&&o.setAttribute("title",e),BX.hasClass(this.node,"btn")){const t=this.node.querySelector(".like-text");t&&(t.textContent=e)}}},init:function(){this.inited||(this.inited=!0,this.valid&&(this.node.itemAction=this,this.parentNode=this.node.parentElement,"Y"===this.data.offers&&(this.data=this.node.dataset),this.config.bindEvents&&(this.unbindAllEvents(),this.bindEvents())))},bindEvents:function(){this.valid&&"function"==typeof this.handlers.onClickNode&&BX.bind(this.node,"click",BX.proxy(this.handlers.onClickNode,this))},unbindEvents:function(){this.valid&&"function"==typeof this.handlers.onClickNode&&BX.unbind(this.node,"click",BX.proxy(this.handlers.onClickNode,this))},unbindAllEvents:function(){this.valid&&BX.unbindAll(this.node,"click")},fireEvent:function(t){if(this.valid&&!this.busy&&"object"==typeof t&&t){let e=t.type;e&&"click"===e&&BX.proxy(this.handlers.onClickNode,this)(t)}},isStateChanged:function(){return null!==this.prevState&&this.prevState!=this.state},isItemChanged:function(){return null!==this.node&&this.node.dataset.item!=this.data.item},getStateTitle:function(t){return this.valid?t?this.node.getAttribute("data-title_added")||"":this.node.getAttribute("data-title")||"":""}
9778,getStateGoalCode:function(t){return"goal_"+this.action+(t?"_add":"_remove")},showStateNotice:function(t){this.showNotice([this.node],t)},showNotice:function(t,e=1){if(this.valid&&"function"==typeof JNoticeSurface){let o=JNoticeSurface.get(),i="onAdd2"+this.action.replace(/^\w/,(t=>t.toUpperCase()));i&&"function"==typeof o[i]&&o[i](t,e)}},updateState:function(){this.valid&&!this.busy&&(this.busy=!0,this.node.blur(),this.prevState=this.state,this.sendRequest())},collectRequestData:async function(){const t={fields:{}};return t.fields=this.data,t.fields.state=Number(this.state),t},sendRequest:function(){this.valid&&this.collectRequestData().then((t=>{BX.ajax.runAction(this.requestUrl,{data:t}).then((e=>{"function"==typeof this.onRequestSuccess&&this.onRequestSuccess(e),"function"==typeof this.onRequestComplete&&this.onRequestComplete(t)}),(e=>{"function"==typeof this.onRequestFailure&&this.onRequestFailure(e),"function"==typeof this.onRequestComplete&&this.onRequestComplete(t)}))})).catch((()=>{setTimeout((()=>{this.isStateChanged()&&(this.state=this.prevState,this.prevState=null),this.parentNode&&BX.removeClass(this.parentNode,"loadings"),this.busy=!1}),0)}))},onRequestComplete:function(t){setTimeout((()=>{this.parentNode&&BX.removeClass(this.parentNode,"loadings"),this.busy=!1}),0)},onRequestSuccess:function(t){if("success"===t.status){if(this.action&&t.data){let e=this.action.toUpperCase();"object"!=typeof arAsproCounters&&(arAsproCounters={}),"object"!=typeof arAsproCounters[e]&&(arAsproCounters[e]={});const o=t.data;"items"in o&&(arAsproCounters[e].ITEMS=o.items),"count"in o&&(arAsproCounters[e].COUNT=o.count),"title"in o&&(arAsproCounters[e].TITLE=o.title),this.class&&"function"==typeof window[this.class]&&"function"==typeof window[this.class].markBadges&&window[this.class].markBadges();let i=this.state;this.class&&"function"==typeof window[this.class]&&"function"==typeof window[this.class].markItems&&window[this.class].markItems(),this.isStateChanged()&&(this.showStateNotice(i),this.config.fireGoals&&BX.onCustomEvent("onCounterGoals",[{goal:this.getStateGoalCode(i),params:{id:this.node.getAttribute("data-item")}}])),this.onCompleteEvent()}}else if(console.error(t),this.isStateChanged()&&(this.state=this.prevState),"function"==typeof JNoticeSurface){let e=JNoticeSurface.get();t.error=this.getMessageFromErrors(t.errors),e.onResultError&&e.onResultError(t)}},onRequestFailure:function(t){if(this.isStateChanged()&&(this.state=this.prevState),"function"==typeof JNoticeSurface){let e=JNoticeSurface.get();t.statusText=this.getMessageFromErrors(t.errors),e.onRequestError&&e.onRequestError(t)}},getMessageFromErrors:function(t){let e=[];return t.length&&t.forEach((t=>{e.push(t.message)})),e.join("<br>")},onCompleteEvent:function(){},handlers:{onClickNode:function(t){if(this.valid&&!this.busy){t||(t=window.event);let e=t.target||t.srcElement;void 0!==e&&e&&(this.busy=!0,this.node.blur(),this.prevState=this.state,this.state=!this.state,this.sendRequest())}}}},JItemAction.checkItemAction=function(t){return t.itemAction&&t.itemAction instanceof JItemAction},JItemAction.getItemAction=function(t){return t.itemAction},JItemAction.factory=function(t,e){if("object"==typeof t&&t&&t instanceof Node){if(JItemAction.checkItemAction(t))return JItemAction.getItemAction(t);{let o=(t.getAttribute("data-action")||"").trim();if(o){let i="JItemAction"+o.replace(/^\w/,(t=>t.toUpperCase()));if("function"==typeof window[i])return new window[i](t,e)}}}return new window.JItemAction(t,e)},JItemActionFavorite=function(t,e){JItemAction.apply(this,arguments)},JItemActionFavorite.prototype=Object.create(JItemAction.prototype),JItemActionFavorite.prototype.constructor=JItemActionFavorite,Object.defineProperties(JItemActionFavorite.prototype,{action:{get:()=>"favorite"}}),JItemActionFavorite.prototype.getStateGoalCode=function(t){return"goal_wish"+(t?"_add":"_remove")},JItemActionFavorite.markBadges=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.FAVORITE&&arAsproCounters.FAVORITE&&void 0!==arAsproCounters.FAVORITE.COUNT){let t=Array.prototype.slice.call(document.querySelectorAll(".basket-link.delay .js-count"));if(t.length)for(let e in t)t[e].textContent=arAsproCounters.FAVORITE.COUNT,arAsproCounters.FAVORITE.COUNT>0?(BX.removeClass(t[e],"empted"),BX.addClass(t[e].closest(".basket-link.delay"),"basket-count"),BX.removeClass(t[e].closest(".basket-link.delay"),"counter-state--empty")):(BX.addClass(t[e],"empted"),BX.removeClass(t[e].closest(".basket-link.delay"),"basket-count"),BX.addClass(t[e].closest(".basket-link.delay"),"counter-state--empty"))}},JItemActionFavorite.markItems=function(){if("object"==typeof arAsproCounters&&arAsproCounters&&"object"==typeof arAsproCounters.FAVORITE&&arAsproCounters.FAVORITE&&"object"==typeof arAsproCounters.FAVORITE.ITEMS&&arAsproCounters.FAVORITE.ITEMS){let t=Array.prototype.slice.call(document.querySelectorAll('.js-item-action.added.in[data-action="favorite"]'));if(t.length)for(let e in t){let o=BX.data(t[e],"item");if(o&&(!arAsproCounters.FAVORITE.ITEMS[o]||"Y"===BX.data(t[e],"offers"))){let o=JItemAction.checkItemAction(t[e])?JItemAction.getItemAction(t[e]):"";"Y"===BX.data(t[e],"offers")&&o&&o.isItemChanged()&&(o=new this(t[e])),o||(o=new this(t[e])),o.state=!1}}if(arAsproCounters.FAVORITE.ITEMS)for(let t in arAsproCounters.FAVORITE.ITEMS){let e=arAsproCounters.FAVORITE.ITEMS[t],o=Array.prototype.slice.call(document.querySelectorAll('.js-item-action[data-action="favorite"][data-item="'+e+'"]:not(.added.in)'));if(o.length)for(let t in o){(JItemAction.checkItemAction(o[t])?JItemAction.getItemAction(o[t]):new this(o[t])).state=!0}}}},JItemAction.actual=function(){"function"==typeof JItemActionFavorite&&(JItemActionFavorite.markItems(),JItemActionFavorite.markBadges())},BX.bindDelegate(document,"click",{class:"js-item-action"},(function(t){t||(t=window.event),BX.PreventDefault(t);let e=t.target||t.srcElement;void 0!==e&&e&&(e.closest(".opt_action")||JItemAction.factory(this).fireEvent(t))})),BX.addCustomEvent("onCompleteAction",(function(t){try{"ajaxContentLoaded"===t.action&&JItemAction.actual()}catch(t){console.error(t)}})),BX.addCustomEvent("onSetBasketStatusBtn",(function(t){JItemAction.actual()})),BX.addCustomEvent("onSetItemButtonStatus",(function(t){JItemAction.actual()})),BX.addCustomEvent("onAjaxResponesTabs",(function(t){JItemAction.actual(),setBasketStatusBtn(!0)})),BX.addCustomEvent("onFinalActionSKUInfo",(function(t){JItemAction.actual()})));
9779/* End */
9780;
9781; /* Start:"a:4:{s:4:"full";s:78:"/bitrix/templates/aspro_max/js/autoload/select_offer_load.min.js?1776221778596";s:6:"source";
9781s:60:"/bitrix/templates/aspro_max/js/autoload/select_offer_load.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9782function useOfferSelect(){BX.ready(()=>{if(!("SelectOfferProp"in window)){const $catalogItems=$(".load-offer-js");$catalogItems.length&&$catalogItems.iAppear((function(e){loadScripts([arAsproOptions.SITE_TEMPLATE_PATH+"/js/select_offer.min.js",arAsproOptions.SITE_TEMPLATE_PATH+"/js/select_offer_func.min.js"])}),{accX:0,accY:100})}if(!("appAspro"in window&&window.appAspro.skuDetailJSLoad)){const $catalogDetail=$(".sku_in_detail");$catalogDetail.length&&$catalogDetail.iAppear((function(e){loadScripts(arAsproOptions.SITE_TEMPLATE_PATH+"/js/select_offer_detail.min.js")}),{accX:0,accY:100})}})}
9783/* End */
9784;
9785; /* Start:"a:4:{s:4:"full";s:67:"/bitrix/components/bitrix/search.title/script.min.js?17762217886443";s:6:"source";s:48:"/bitrix/components/bitrix/search.title/script.js";s:3:"min";s:52:"/bitrix/components/bitrix/search.title/script.min.js";s:3:"map";s:52:"/bitrix/components/bitrix/search.title/script.map.js";}"*/
9786function JCTitleSearch(t){var e=this;this.arParams={AJAX_PAGE:t.AJAX_PAGE,CONTAINER_ID:t.CONTAINER_ID,INPUT_ID:t.INPUT_ID,MIN_QUERY_LEN:parseInt(t.MIN_QUERY_LEN)};if(t.WAIT_IMAGE)this.arParams.WAIT_IMAGE=t.WAIT_IMAGE;if(t.MIN_QUERY_LEN<=0)t.MIN_QUERY_LEN=1;this.cache=[];this.cache_key=null;this.startText="";this.running=false;this.runningCall=false;this.currentRow=-1;this.RESULT=null;this.CONTAINER=null;this.INPUT=null;this.WAIT=null;this.ShowResult=function(t){if(BX.type.isString(t)){e.RESULT.innerHTML=t}e.RESULT.style.display=e.RESULT.innerHTML!==""?"block":"none";var s=e.adjustResultNode();var i;var n;var l=BX.findChild(e.RESULT,{tag:"table",class:"title-search-result"},true);if(l){n=BX.findChild(l,{tag:"th"},true)}if(n){var r=BX.pos(l);r.width=r.right-r.left;var a=BX.pos(n);a.width=a.right-a.left;n.style.width=a.width+"px";e.RESULT.style.width=s.width+a.width+"px";e.RESULT.style.left=s.left-a.width-1+"px";if(r.width-a.width>s.width)e.RESULT.style.width=s.width+a.width-1+"px";r=BX.pos(l);i=BX.pos(e.RESULT);if(i.right>r.right){e.RESULT.style.width=r.right-r.left+"px"}}var o;if(l)o=BX.findChild(e.RESULT,{class:"title-search-fader"},true);if(o&&n){i=BX.pos(e.RESULT);o.style.left=i.right-i.left-18+"px";o.style.width=18+"px";o.style.top=0+"px";o.style.height=i.bottom-i.top+"px";o.style.display="block"}};this.onKeyPress=function(t){var s=BX.findChild(e.RESULT,{tag:"table",class:"title-search-result"},true);if(!s)return false;var i;var n=s.rows.length;switch(t){case 27:e.RESULT.style.display="none";e.currentRow=-1;e.UnSelectAll();return true;case 40:if(e.RESULT.style.display=="none")e.RESULT.style.display="block";var l=-1;for(i=0;i<n;i++){if(!BX.findChild(s.rows[i],{class:"title-search-separator"},true)){if(l==-1)l=i;if(e.currentRow<i){e.currentRow=i;break}else if(s.rows[i].className=="title-search-selected"){s.rows[i].className=""}}}if(i==n&&e.currentRow!=i)e.currentRow=l;s.rows[e.currentRow].className="title-search-selected";return true;case 38:if(e.RESULT.style.display=="none")e.RESULT.style.display="block";var r=-1;for(i=n-1;i>=0;i--){if(!BX.findChild(s.rows[i],{class:"title-search-separator"},true)){if(r==-1)r=i;if(e.currentRow>i){e.currentRow=i;break}else if(s.rows[i].className=="title-search-selected"){s.rows[i].className=""}}}if(i<0&&e.currentRow!=i)e.currentRow=r;s.rows[e.currentRow].className="title-search-selected";return true;case 13:if(e.RESULT.style.display=="block"){for(i=0;i<n;i++){if(e.currentRow==i){if(!BX.findChild(s.rows[i],{class:"title-search-separator"},true)){var a=BX.findChild(s.rows[i],{tag:"a"},true);if(a){window.location=a.href;return true}}}}}return false}return false};this.onTimeout=function(){e.onChange(function(){setTimeout(e.onTimeout,500)})};this.onChange=function(t){if(e.running){e.runningCall=true;return}e.running=true;if(e.INPUT.value!=e.oldValue&&e.INPUT.value!=e.startText){e.oldValue=e.INPUT.value;if(e.INPUT.value.length>=e.arParams.MIN_QUERY_LEN){e.cache_key=e.arParams.INPUT_ID+"|"+e.INPUT.value;if(e.cache[e.cache_key]==null){if(e.WAIT){var s=BX.pos(e.INPUT);var i=s.bottom-s.top-2;e.WAIT.style.top=s.top+1+"px";e.WAIT.style.height=i+"px";e.WAIT.style.width=i+"px";e.WAIT.style.left=s.right-i+2+"px";e.WAIT.style.display="block"}
9786BX.ajax.post(e.arParams.AJAX_PAGE,{ajax_call:"y",INPUT_ID:e.arParams.INPUT_ID,q:e.INPUT.value,l:e.arParams.MIN_QUERY_LEN},function(s){e.cache[e.cache_key]=s;e.ShowResult(s);e.currentRow=-1;e.EnableMouseEvents();if(e.WAIT)e.WAIT.style.display="none";if(!!t)t();e.running=false;if(e.runningCall){e.runningCall=false;e.onChange()}});return}else{e.ShowResult(e.cache[e.cache_key]);e.currentRow=-1;e.EnableMouseEvents()}}else{e.RESULT.style.display="none";e.currentRow=-1;e.UnSelectAll()}}if(!!t)t();e.running=false};this.onScroll=function(){if(BX.type.isElementNode(e.RESULT)&&e.RESULT.style.display!=="none"&&e.RESULT.innerHTML!==""){e.adjustResultNode()}};this.UnSelectAll=function(){var t=BX.findChild(e.RESULT,{tag:"table",class:"title-search-result"},true);if(t){var s=t.rows.length;for(var i=0;i<s;i++)t.rows[i].className=""}};this.EnableMouseEvents=function(){var t=BX.findChild(e.RESULT,{tag:"table",class:"title-search-result"},true);if(t){var s=t.rows.length;for(var i=0;i<s;i++)if(!BX.findChild(t.rows[i],{class:"title-search-separator"},true)){t.rows[i].id="row_"+i;t.rows[i].onmouseover=function(t){if(e.currentRow!=this.id.substr(4)){e.UnSelectAll();this.className="title-search-selected";e.currentRow=this.id.substr(4)}};t.rows[i].onmouseout=function(t){this.className="";e.currentRow=-1}}}};this.onFocusLost=function(t){setTimeout(function(){e.RESULT.style.display="none"},250)};this.onFocusGain=function(){if(e.RESULT.innerHTML.length)e.ShowResult()};this.onKeyDown=function(t){if(!t)t=window.event;if(e.RESULT.style.display=="block"){if(e.onKeyPress(t.keyCode))return BX.PreventDefault(t)}};this.adjustResultNode=function(){if(!(BX.type.isElementNode(e.RESULT)&&BX.type.isElementNode(e.CONTAINER))){return{top:0,right:0,bottom:0,left:0,width:0,height:0}}var t=BX.pos(e.CONTAINER);e.RESULT.style.position="absolute";e.RESULT.style.top=t.bottom+2+"px";e.RESULT.style.left=t.left+"px";e.RESULT.style.width=t.width+"px";return t};this._onContainerLayoutChange=function(){if(BX.type.isElementNode(e.RESULT)&&e.RESULT.style.display!=="none"&&e.RESULT.innerHTML!==""){e.adjustResultNode()}};this.Init=function(){this.CONTAINER=document.getElementById(this.arParams.CONTAINER_ID);BX.addCustomEvent(this.CONTAINER,"OnNodeLayoutChange",this._onContainerLayoutChange);this.RESULT=document.body.appendChild(document.createElement("DIV"));this.RESULT.className="title-search-result";this.INPUT=document.getElementById(this.arParams.INPUT_ID);this.startText=this.oldValue=this.INPUT.value;BX.bind(this.INPUT,"focus",function(){e.onFocusGain()});BX.bind(this.INPUT,"blur",function(){e.onFocusLost()});this.INPUT.onkeydown=this.onKeyDown;if(this.arParams.WAIT_IMAGE){this.WAIT=document.body.appendChild(document.createElement("DIV"));this.WAIT.style.backgroundImage="url('"+this.arParams.WAIT_IMAGE+"')";if(!BX.browser.IsIE())this.WAIT.style.backgroundRepeat="none";this.WAIT.style.display="none";this.WAIT.style.position="absolute";this.WAIT.style.zIndex="1100"}BX.bind(this.INPUT,"bxchange",function(){e.onChange()});var t=BX.findParent(this.CONTAINER,BX.is_fixed);if(BX.type.isElementNode(t)){BX.bind(window,"scroll",BX.throttle(this.onScroll,100,this))}};BX.ready(function(){e.Init(t)})}
9787/* End */
9788;
9789; /* Start:"a:4:{s:4:"full";s:97:"/bitrix/templates/aspro_max/components/bitrix/search.title/mega_menu/script.min.js?17762217747630";s:6:"source";s:78:"/bitrix/templates/aspro_max/components/bitrix/search.title/mega_menu/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9790function JCTitleSearch3(arParams){var _this=this;this.arParams={AJAX_PAGE:arParams.AJAX_PAGE,CONTAINER_ID:arParams.CONTAINER_ID,INPUT_ID:arParams.INPUT_ID,MIN_QUERY_LEN:parseInt(arParams.MIN_QUERY_LEN)},arParams.WAIT_IMAGE&&(this.arParams.WAIT_IMAGE=arParams.WAIT_IMAGE),arParams.MIN_QUERY_LEN<=0&&(arParams.MIN_QUERY_LEN=1),this.cache=[],this.cache_key=null,this.startText="",this.running=!1,this.needRunAgain=!1,this.currentRow=-1,this.RESULT=null,this.CONTAINER=null,this.INPUT=null,this.TYPE=null,this.WAIT=null,this.ShowResult=function(result){BX.type.isString(result)&&(_this.RESULT.innerHTML=result),_this.RESULT.style.display=""!==_this.RESULT.innerHTML?"block":"none";var pos=_this.adjustResultNode(),res_pos,th,tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0),fade;if(tbl&&(th=BX.findChild(tbl,{tag:"th"},!0)),th){var tbl_pos=BX.pos(tbl);tbl_pos.width=tbl_pos.right-tbl_pos.left;var th_pos=BX.pos(th);th_pos.width=th_pos.right-th_pos.left,th.style.width=th_pos.width+"px",_this.RESULT.style.width=pos.width+th_pos.width+"px",_this.RESULT.style.left=pos.left-th_pos.width-1+"px",tbl_pos.width-th_pos.width>pos.width&&(_this.RESULT.style.width=pos.width+th_pos.width-1+"px"),tbl_pos=BX.pos(tbl),(res_pos=BX.pos(_this.RESULT)).right>tbl_pos.right&&(_this.RESULT.style.width=tbl_pos.right-tbl_pos.left+"px")}tbl&&(fade=BX.findChild(_this.RESULT,{class:"title-search-fader"},!0)),fade&&th&&(res_pos=BX.pos(_this.RESULT),fade.style.left=res_pos.right-res_pos.left-18+"px",fade.style.width="18px",fade.style.top="0px",fade.style.height=res_pos.bottom-res_pos.top+"px",fade.style.display="block")},this.onKeyPress=function(keyCode){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0),i;if(!tbl)return!1;var cnt=tbl.rows.length;switch(keyCode){case 27:return _this.RESULT.style.display="none",_this.currentRow=-1,_this.UnSelectAll(),!0;case 40:"none"==_this.RESULT.style.display&&(_this.RESULT.style.display="block");var first=-1;for(i=0;i<cnt;i++)if(!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){if(-1==first&&(first=i),_this.currentRow<i){_this.currentRow=i;break}"title-search-selected"==tbl.rows[i].className&&(tbl.rows[i].className="")}return i==cnt&&_this.currentRow!=i&&(_this.currentRow=first),tbl.rows[_this.currentRow].className="title-search-selected",!0;case 38:"none"==_this.RESULT.style.display&&(_this.RESULT.style.display="block");var last=-1;for(i=cnt-1;i>=0;i--)if(!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){if(-1==last&&(last=i),_this.currentRow>i){_this.currentRow=i;break}"title-search-selected"==tbl.rows[i].className&&(tbl.rows[i].className="")}return i<0&&_this.currentRow!=i&&(_this.currentRow=last),tbl.rows[_this.currentRow].className="title-search-selected",!0;case 13:if("block"==_this.RESULT.style.display)for(i=0;i<cnt;i++)if(_this.currentRow==i&&!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){var a=BX.findChild(tbl.rows[i],{tag:"a"},!0);if(a)return window.location=a.href,!0}return!1}return!1},this.onTimeout=function(){_this.onChange((function(){setTimeout(_this.onTimeout,500)}))},this.onChange=function(callback){if(_this.running)return void(_this.needRunAgain=!0);_this.running=!0;let type="catalog";if(this.TYPE&&(type=this.TYPE.value),_this.INPUT.value!=_this.oldValue&&_this.INPUT.value!=_this.startText||type!=_this.oldType)if(_this.oldValue=_this.INPUT.value,_this.oldType=type,_this.INPUT.value.length>=_this.arParams.MIN_QUERY_LEN){if(_this.cache_key=_this.arParams.INPUT_ID+"|"+_this.INPUT.value+"|"+type,null==_this.cache[_this.cache_key]){if
9790(_this.WAIT){var pos=BX.pos(_this.INPUT),height=pos.bottom-pos.top-2;_this.WAIT.style.top=pos.top+1+"px",_this.WAIT.style.height=height+"px",_this.WAIT.style.width=height+"px",_this.WAIT.style.left=pos.right-height+2+"px",_this.WAIT.style.display="block"}return void BX.ajax.post(_this.arParams.AJAX_PAGE,{ajax_call:"y",INPUT_ID:_this.arParams.INPUT_ID,q:_this.INPUT.value,l:_this.arParams.MIN_QUERY_LEN,type:type},(function(result){_this.cache[_this.cache_key]=result,_this.ShowResult(result),_this.currentRow=-1,_this.EnableMouseEvents(),_this.WAIT&&(_this.WAIT.style.display="none"),callback&&callback(),_this.running=!1,_this.needRunAgain&&(_this.needRunAgain=!1,_this.onChange(callback))}))}_this.ShowResult(_this.cache[_this.cache_key]),_this.currentRow=-1,_this.EnableMouseEvents()}else _this.RESULT.style.display="none",_this.currentRow=-1,_this.UnSelectAll();callback&&callback(),_this.running=!1},this.UnSelectAll=function(){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0);if(tbl)for(var cnt=tbl.rows.length,i=0;i<cnt;i++)tbl.rows[i].className=""},this.EnableMouseEvents=function(){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0);if(tbl)for(var cnt=tbl.rows.length,i=0;i<cnt;i++)BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)||(tbl.rows[i].id="row_"+i,tbl.rows[i].onmouseover=function(e){_this.currentRow!=this.id.substr(4)&&(_this.UnSelectAll(),this.className="title-search-selected",_this.currentRow=this.id.substr(4))},tbl.rows[i].onmouseout=function(e){this.className="",_this.currentRow=-1})},this.onFocusLost=function(hide){setTimeout((function(){_this.RESULT.style.display="none"}),250)},this.onFocusGain=function(){_this.RESULT.innerHTML.length&&_this.ShowResult()},this.onKeyDown=function(e){if(e||(e=window.event),"block"==_this.RESULT.style.display&&_this.onKeyPress(e.keyCode))return BX.PreventDefault(e);$(".title-search-result."+_this.arParams.INPUT_ID).removeClass("closed")},this.adjustResultNode=function(){var pos,pos_input,fixedParent=BX.findParent(_this.CONTAINER,BX.is_fixed);return _this.RESULT.style.position="absolute",pos=BX.pos(_this.CONTAINER,!0),pos_input=BX.pos(_this.INPUT),pos.width=pos.right-pos.left,_this.RESULT.style.top=pos.bottom+2+"px",_this.RESULT.style.left="0px",$(_this.INPUT).closest(".inline-search-block.with-close").length?_this.RESULT.style.width=pos_input.width+"px":_this.RESULT.style.width=pos.width+"px",pos},this._onContainerLayoutChange=function(){"none"!==_this.RESULT.style.display&&""!==_this.RESULT.innerHTML&&_this.adjustResultNode()},this.Init=function(){this.CONTAINER=document.getElementById(this.arParams.CONTAINER_ID),BX.addCustomEvent(this.CONTAINER,"OnNodeLayoutChange",this._onContainerLayoutChange),this.RESULT=this.CONTAINER.appendChild(document.createElement("DIV")),this.RESULT.className="title-search-result "+this.arParams.INPUT_ID,this.INPUT=document.getElementById(this.arParams.INPUT_ID),this.startText=this.oldValue=this.INPUT.value,BX.bind(this.INPUT,"focus",(function(){_this.onFocusGain()})),BX.bind(this.INPUT,"blur",(function(){window.matchMedia("(min-width: 993px)").matches&&setTimeout((function(){$(_this.INPUT).closest("form").find(".dropdown-select.searchtype .dropdown-select__title.opened").length||_this.onFocusLost()}),100)})),this.TYPE=this.CONTAINER?this.CONTAINER.querySelector('.dropdown-select.searchtype input[name="type"]'):null,BX.browser.IsSafari()||BX.browser.IsIE()?this.INPUT.onkeydown=this.onKeyDown:this.INPUT.onkeypress=this.onKeyDown,this.arParams.WAIT_IMAGE&&(this.WAIT=document.body.appendChild(document.createElement("DIV")),this.WAIT.style.backgroundImage="url('"+this.arParams.WAIT_IMAGE+"')",BX.browser.IsIE()||(this.WAIT.style.backgroundRepeat="none"),this.WAIT.style.display="none",this.WAIT.style.position="absolute",this.WAIT.style.zIndex="1100"),BX.bind(this.INPUT,"bxchange",(function(){_this.onChange()})),this.TYPE&&BX.bind(this.TYPE,"change",(function(){_this.onChange()}))},BX.ready((function(){_this.Init(arParams)}))}
9791/* End */
9792;
9793; /* Start:"a:4:{s:4:"full";s:64:"/bitrix/templates/aspro_max/js/searchtitle.min.js?17762217781121";s:6:"source";
9793s:45:"/bitrix/templates/aspro_max/js/searchtitle.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9794$(document).on("click",".dropdown-select.searchtype .dropdown-select__list-link:not(.dropdown-select__list-link--current)",(function(){let $this=$(this),type=$this.data("type"),name="all"===type?BX.message("SEARCH_IN_SITE"):BX.message("SEARCH_IN_CATALOG");BX.onCustomEvent("onCloseDropDown"),$.cookie("searchtitle_type",type),$this.closest(".dropdown-select").find("input[name=type]").val(type),$(".title-search-result").hide().empty(),BX.fireEvent($this.closest(".dropdown-select").find("input[name=type]")[0],"change"),$(".dropdown-select.searchtype").each((function(){$(this).closest("form").attr("action","all"===type?arAsproOptions.PAGES.SEARCH_PAGE_URL:arAsproOptions.PAGES.CATALOG_PAGE_URL),$(this).find(".dropdown-select__title>span").text(name),$(this).find("input[name=type]").val(type),$(this).find(".dropdown-select__list-link").removeClass("dropdown-select__list-link--current").addClass("darken"),$(this).find(".dropdown-select__list-link[data-type="+type+"]").addClass("dropdown-select__list-link--current").removeClass("darken")}));try{$this.closest("form").find("input[name=q]")[0].focus()}catch(e){}}));
9795/* End */
9796;
9797; /* Start:"a:4:{s:4:"full";s:92:"/bitrix/templates/aspro_max/components/bitrix/menu/menu_in_burger/script.min.js?177622177839";s:6:"source";s:75:"/bitrix/templates/aspro_max/components/bitrix/menu/menu_in_burger/script.js";s:3:"min";s:79:"/bitrix/templates/aspro_max/components/bitrix/menu/menu_in_burger/script.min.js";s:3:"map";s:83:"/bitrix/templates/aspro_max/components/bitrix/menu/menu_in_burger/script.min.js.map";}"*/
9798
9799/* End */
9800;
9801; /* Start:"a:4:{s:4:"full";s:79:"/local/templates/.default/components/bitrix/menu/top/script.min.js?177622177174";s:6:"source";s:62:"/local/templates/.default/components/bitrix/menu/top/script.js";s:3:"min";s:66:"/local/templates/.default/components/bitrix/menu/top/script.min.js";s:3:"map";s:70:"/local/templates/.default/components/bitrix/menu/top/script.min.js.map";}"*/
9802$(document).ready((function(){}));
9803/* End */
9804;
9805; /* Start:"a:4:{s:4:"full";
9805s:61:"/bitrix/templates/aspro_max/js/mega_menu.min.js?1776221778681";s:6:"source";s:43:"/bitrix/templates/aspro_max/js/mega_menu.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9806window.addEventListener("DOMContentLoaded",(function(){const $megaMenuWrapper=document.querySelectorAll(".menu-block, .menu-only");if($megaMenuWrapper.length)for(let i=0;i<$megaMenuWrapper.length;i++)$megaMenuWrapper[i].addEventListener("mouseover",(function(){$megaMenuWrapper[i].querySelector(".mega-menu").classList.add("visible"),CheckTopVisibleMenu(),InitMenuNavigationAim();const $bannerMenu=$megaMenuWrapper[i].querySelectorAll(".owl-carousel-hover");$bannerMenu.length&&$bannerMenu.forEach($el=>{$el.classList.remove("owl-carousel-hover"),$el.classList.add("owl-carousel"),setTimeout((function(){InitOwlSlider(),$el.classList.remove("loader_circle")}),1)})}),{once:!0})}));
9807/* End */
9808;
9809; /* Start:"a:4:{s:4:"full";s:85:"/bitrix/templates/aspro_max/components/bitrix/menu/bottom/script.min.js?1776221778649";s:6:"source";s:67:"/bitrix/templates/aspro_max/components/bitrix/menu/bottom/script.js";s:3:"min";s:71:"/bitrix/templates/aspro_max/components/bitrix/menu/bottom/script.min.js";s:3:"map";s:75:"/bitrix/templates/aspro_max/components/bitrix/menu/bottom/script.min.js.map";}"*/
9810function setClassMobile(){arAsproOptions.THEME&&"Y"==arAsproOptions.THEME.COMPACT_FOOTER_MOBILE&&(window.matchMedia("(max-width:767px)").matches?($("footer").addClass("mobile"),$(".bottom-menu .items>.wrap_compact_mobile").addClass("accordion-body collapse"),$(".bottom-menu .items>.item.childs").attr("data-toggle","collapse")):($("footer").removeClass("mobile"),$(".bottom-menu .items>.wrap_compact_mobile").removeClass("accordion-body collapse"),$(".bottom-menu .items>.item.childs").removeAttr("data-toggle")))}readyDOM((function(){setClassMobile()})),$(window).on("resize",(function(){setClassMobile()}));
9811/* End */
9812;
9813; /* Start:"a:4:{s:4:"full";s:93:"/bitrix/templates/aspro_max/components/bitrix/search.title/fixed/script.min.js?17762217747869";s:6:"source";s:74:"/bitrix/templates/aspro_max/components/bitrix/search.title/fixed/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9814function JCTitleSearch2(arParams){var _this=this;this.arParams={AJAX_PAGE:arParams.AJAX_PAGE,CONTAINER_ID:arParams.CONTAINER_ID,INPUT_ID:arParams.INPUT_ID,INPUT_ID_TMP:arParams.INPUT_ID_TMP,MIN_QUERY_LEN:parseInt(arParams.MIN_QUERY_LEN)},arParams.WAIT_IMAGE&&(this.arParams.WAIT_IMAGE=arParams.WAIT_IMAGE),arParams.MIN_QUERY_LEN<=0&&(arParams.MIN_QUERY_LEN=1),this.cache=[],this.cache_key=null,this.startText="",this.running=!1,this.needRunAgain=!1,this.currentRow=-1,this.RESULT=null,this.CONTAINER=null,this.INPUT=null,this.TYPE=null,this.WAIT=null,this.ShowResult=function(result){BX.type.isString(result)&&(_this.RESULT.innerHTML=result),_this.RESULT.style.display=""!==_this.RESULT.innerHTML?"block":"none";var pos=_this.adjustResultNode(),res_pos,th,tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0),fade;if(tbl&&(th=BX.findChild(tbl,{tag:"th"},!0)),th){var tbl_pos=BX.pos(tbl);tbl_pos.width=tbl_pos.right-tbl_pos.left;var th_pos=BX.pos(th);th_pos.width=th_pos.right-th_pos.left,th.style.width=th_pos.width+"px",_this.RESULT.style.width=pos.width+th_pos.width+"px",_this.RESULT.style.left=pos.left-th_pos.width-1+"px",tbl_pos.width-th_pos.width>pos.width&&(_this.RESULT.style.width=pos.width+th_pos.width-1+"px"),tbl_pos=BX.pos(tbl),(res_pos=BX.pos(_this.RESULT)).right>tbl_pos.right&&(_this.RESULT.style.width=tbl_pos.right-tbl_pos.left+"px")}tbl&&(fade=BX.findChild(_this.RESULT,{class:"title-search-fader"},!0)),fade&&th&&(res_pos=BX.pos(_this.RESULT),fade.style.left=res_pos.right-res_pos.left-18+"px",fade.style.width="18px",fade.style.top="0px",fade.style.height=res_pos.bottom-res_pos.top+"px",fade.style.display="block")},this.onKeyPress=function(keyCode){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0),i;if(!tbl)return!1;var cnt=tbl.rows.length;switch(keyCode){case 27:return _this.RESULT.style.display="none",_this.currentRow=-1,_this.UnSelectAll(),!0;case 40:"none"==_this.RESULT.style.display&&(_this.RESULT.style.display="block");var first=-1;for(i=0;i<cnt;i++)if(!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){if(-1==first&&(first=i),_this.currentRow<i){_this.currentRow=i;break}"title-search-selected"==tbl.rows[i].className&&(tbl.rows[i].className="")}return i==cnt&&_this.currentRow!=i&&(_this.currentRow=first),tbl.rows[_this.currentRow].className="title-search-selected",!0;case 38:"none"==_this.RESULT.style.display&&(_this.RESULT.style.display="block");var last=-1;for(i=cnt-1;i>=0;i--)if(!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){if(-1==last&&(last=i),_this.currentRow>i){_this.currentRow=i;break}"title-search-selected"==tbl.rows[i].className&&(tbl.rows[i].className="")}return i<0&&_this.currentRow!=i&&(_this.currentRow=last),tbl.rows[_this.currentRow].className="title-search-selected",!0;case 13:if("block"==_this.RESULT.style.display)for(i=0;i<cnt;i++)if(_this.currentRow==i&&!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){var a=BX.findChild(tbl.rows[i],{tag:"a"},!0);if(a)return window.location=a.href,!0}return!1}return!1},this.onTimeout=function(){_this.onChange((function(){setTimeout(_this.onTimeout,500)}))},this.onChange=function(callback){if(_this.running)return void(_this.needRunAgain=!0);_this.running=!0;let type="catalog";if(this.TYPE&&(type=this.TYPE.value),_this.INPUT.value!=_this.oldValue&&_this.INPUT.value!=_this.startText||type!=_this.oldType)if(_this.oldValue=_this.INPUT.value,_this.oldType=type,_this.INPUT.value.length>=_this.arParams.MIN_QUERY_LEN){if(_this.cache_key=_this.arParams.INPUT_ID+"|"+_this.INPUT.value+"|"+type,null==_this.cache[_this.cache_key]){if
9814(_this.WAIT){var pos=BX.pos(_this.INPUT),height=pos.bottom-pos.top-2;_this.WAIT.style.top=pos.top+1+"px",_this.WAIT.style.height=height+"px",_this.WAIT.style.width=height+"px",_this.WAIT.style.left=pos.right-height+2+"px",_this.WAIT.style.display="block"}return void BX.ajax.post(_this.arParams.AJAX_PAGE,{ajax_call:"y",INPUT_ID:_this.arParams.INPUT_ID_TMP,q:_this.INPUT.value,l:_this.arParams.MIN_QUERY_LEN,type:type},(function(result){_this.cache[_this.cache_key]=result,_this.ShowResult(result),_this.currentRow=-1,_this.EnableMouseEvents(),_this.WAIT&&(_this.WAIT.style.display="none"),callback&&callback(),_this.running=!1,_this.needRunAgain&&(_this.needRunAgain=!1,_this.onChange(callback))}))}_this.ShowResult(_this.cache[_this.cache_key]),_this.currentRow=-1,_this.EnableMouseEvents()}else _this.RESULT.style.display="none",_this.currentRow=-1,_this.UnSelectAll();callback&&callback(),_this.running=!1},this.UnSelectAll=function(){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0);if(tbl)for(var cnt=tbl.rows.length,i=0;i<cnt;i++)tbl.rows[i].className=""},this.EnableMouseEvents=function(){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0);if(tbl)for(var cnt=tbl.rows.length,i=0;i<cnt;i++)BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)||(tbl.rows[i].id="row_"+i,tbl.rows[i].onmouseover=function(e){_this.currentRow!=this.id.substr(4)&&(_this.UnSelectAll(),this.className="title-search-selected",_this.currentRow=this.id.substr(4))},tbl.rows[i].onmouseout=function(e){this.className="",_this.currentRow=-1})},this.onFocusLost=function(hide){setTimeout((function(){_this.RESULT.style.display="none"}),300)},this.onFocusGain=function(){_this.RESULT.innerHTML.length&&_this.ShowResult()},this.onKeyDown=function(e){if(e||(e=window.event),"block"==_this.RESULT.style.display&&_this.onKeyPress(e.keyCode))return BX.PreventDefault(e)},this.adjustResultNode=function(){var pos,pos_input,fixedParent=BX.findParent(_this.CONTAINER,BX.is_fixed);return fixedParent?(_this.RESULT.style.position="fixed",_this.RESULT.style.zIndex=BX.style(fixedParent,"z-index")+2,pos=BX.pos(_this.CONTAINER,!0)):(_this.RESULT.style.position="absolute",pos=BX.pos(_this.CONTAINER)),pos_input=BX.pos(_this.INPUT),pos.width=pos.right-pos.left,_this.RESULT.style.top=pos.bottom+2+"px",_this.RESULT.style.left=pos_input.left+"px",$(_this.INPUT).closest(".inline-search-block.with-close").length?_this.RESULT.style.width=pos_input.width+"px":_this.RESULT.style.width=pos.width+"px",pos},this._onContainerLayoutChange=function(){"none"!==_this.RESULT.style.display&&""!==_this.RESULT.innerHTML&&_this.adjustResultNode()},this.Init=function(){this.CONTAINER=document.getElementById(this.arParams.CONTAINER_ID),BX.addCustomEvent(this.CONTAINER,"OnNodeLayoutChange",this._onContainerLayoutChange),this.RESULT=document.body.appendChild(document.createElement("DIV")),this.RESULT.className="title-search-result "+this.arParams.INPUT_ID,"title-search-input_fixed"!=this.arParams.INPUT_ID&&(this.RESULT.className+=" "+arMaxOptions.THEME.TYPE_SEARCH+"_type"),this.INPUT=document.getElementById(this.arParams.INPUT_ID),this.startText=this.oldValue=this.INPUT.value,BX.bind(this.INPUT,"focus",(function(){_this.onFocusGain()})),BX.bind(this.INPUT,"blur",(function(){window.matchMedia("(min-width: 993px)").matches&&setTimeout((function(){$(_this.INPUT).closest("form").find(".dropdown-select.searchtype .dropdown-select__title.opened").length||_this.onFocusLost()}),100)})),this.TYPE=this.CONTAINER?this.CONTAINER.querySelector('.dropdown-select.searchtype input[name="type"]'):null,BX.browser.IsSafari()||BX.browser.IsIE()?this.INPUT.onkeydown=this.onKeyDown:this.INPUT.onkeypress=this.onKeyDown,this.arParams.WAIT_IMAGE&&(this.WAIT=document.body.appendChild(document.createElement("DIV")),this.WAIT.style.backgroundImage="url('"+this.arParams.WAIT_IMAGE+"')",BX.browser.IsIE()||(this.WAIT.style.backgroundRepeat="none"),this.WAIT.style.display="none",this.WAIT.style.position="absolute",this.WAIT.style.zIndex="1100"),BX.bind(this.INPUT,"bxchange",(function(){_this.onChange()})),this.TYPE&&BX.bind(this.TYPE,"change",(function(){_this.onChange()}))},BX.ready((function(){_this.Init(arParams)}))}
9815/* End */
9816;
9817; /* Start:"a:4:{s:4:"full";s:55:"/bitrix/templates/aspro_max/js/custom.js?17762217781678";s:6:"source";s:40:"/bitrix/templates/aspro_max/js/custom.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
9818/*
9819You can use this file with your scripts.
9820It will not be overwritten when you upgrade solution.
9821*/
9822
9823BX.ready(function () {
9824	$('.personal_wrapper input[name=LOGIN]').attr('readonly', true);
9825
9826	$('.basket_fly_forms.basket_fill_WHITE *[data-event="jqm"][data-param-form_id="ASK"]').click(function () {
9827		var eventdata = { goal: "goal_click_float_button_ASK" };
9828		BX.onCustomEvent("onCounterGoals", [eventdata]);
9829	})
9830
9831	$('a[href^="mailto"]').bind("copy", function () {
9832		var eventdata = { goal: "email_copy" };
9833		BX.onCustomEvent("onCounterGoals", [eventdata]);
9834	});
9835
9836	$('a[href^="tel"]').bind("copy", function () {
9837		var eventdata = { goal: "phone_copy" };
9838		BX.onCustomEvent("onCounterGoals", [eventdata]);
9839	});
9840
9841
9842	/* Если форма отправлена успешно при любом клике перезагружаем страницу, для обновления каптчи */
9843	// if ((window.location.indexOf('formresult=addok') == false) &&
9844	// 	($('.form_result.success').length > 0 || $('.form_result.success').length > 0)) {
9845	// 	document.addEventListener('click', function () {
9846	// 		window.location.reload();
9847	// 	}, true);
9848	// }
9849
9850});
9851
9852
9853
9854function CheckScroll() {
9855	const events = ['scroll', 'mouseenter', 'mousemove', 'mouseleave', 'mouseout', 'mouseover'];
9856	events.forEach((event) => {
9857		document.addEventListener(event, () => {
9858			const fixedHeader = document.querySelector('#headerfixed.fixed');
9859			if (typeof fixedHeader == 'undefined' || !fixedHeader) {
9860				return;
9861			}
9862			const scroll = window.scrollY;
9863			if (scroll < 10) {
9864				fixedHeader.classList.remove('fixed');
9865			}
9866		})
9867	})
9868}
9869
9870CheckScroll();
9871/* End */
9872;; /* /local/modules/axi.engine/js/axi.main/script.js?1776221772771*/
9873; /* /local/modules/axi.engine/js/axi.sku/script.js?17879031292490*/
9874; /* /local/modules/axi.engine/js/axi.basket/script.js?177622177216558*/
9875; /* /local/modules/axi.engine/js/axi.autocomplete/script.js?17762217725293*/
9876; /* /local/modules/axi.engine/js/axi.select2/script.js?177622177273164*/
9877; /* /bitrix/templates/aspro_max/vendor/js/bootstrap.js?177622177827908*/
9878; /* /bitrix/templates/aspro_max/js/jquery.actual.min.js?17762217781251*/
9879; /* /bitrix/templates/aspro_max/vendor/js/ripple.min.js?17762217781624*/
9880; /* /bitrix/templates/aspro_max/js/browser.min.js?1776221778662*/
9881; /* /bitrix/templates/aspro_max/js/jquery.uniform.min.js?17762217788308*/
9882; /* /bitrix/templates/aspro_max/vendor/js/sticky-sidebar.min.js?177622177811755*/
9883; /* /bitrix/templates/aspro_max/js/jquery.validate.min.js?177622177822257*/
9884; /* /bitrix/templates/aspro_max/js/jquery.alphanumeric.min.js?1776221778942*/
9885; /* /bitrix/templates/aspro_max/js/jquery.cookie.min.js?17762217783066*/
9886; /* /bitrix/templates/aspro_max/js/mobile.min.js?177622177818101*/
9887; /* /bitrix/templates/aspro_max/js/main.min.js?1776221778326910*/
9888; /* /bitrix/templates/aspro_max/js/blocks/blocks.min.js?17762217785019*/
9889; /* /bitrix/templates/aspro_max/js/logo.min.js?17762217783490*/
9890; /* /bitrix/templates/aspro_max/js/autoload/item-action.min.js?17762217788977*/
9891; /* /bitrix/templates/aspro_max/js/autoload/select_offer_load.min.js?1776221778596*/
9892; /* /bitrix/components/bitrix/search.title/script.min.js?17762217886443*/
9893; /* /bitrix/templates/aspro_max/components/bitrix/search.title/mega_menu/script.min.js?17762217747630*/
9894; /* /bitrix/templates/aspro_max/js/searchtitle.min.js?17762217781121*/
9895; /* /bitrix/templates/aspro_max/components/bitrix/menu/menu_in_burger/script.min.js?177622177839*/
9896; /* /local/templates/.default/components/bitrix/menu/top/script.min.js?177622177174*/
9897; /* /bitrix/templates/aspro_max/js/mega_menu.min.js?1776221778681*/
9898; /* /bitrix/templates/aspro_max/components/bitrix/menu/bottom/script.min.js?1776221778649*/
9899; /* /bitrix/templates/aspro_max/components/bitrix/search.title/fixed/script.min.js?17762217747869*/
9900; /* /bitrix/templates/aspro_max/js/custom.js?17762217781678*/
9901
9902//# sourceMappingURL=template_da0e40772e5e3d68890773a441f1cee6.map.js

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.