PageSourceSearch

https://www.mtt.ru/dist/prog/app.js?176830052819456

js mtt.ru collected 2026-09-24 09:54:02 UTC 19,456 bytes, 399 lines download raw bytes

1! function(t) {
2    var e = {};
3
4    function a(n) {
5        if (e[n]) return e[n].exports;
6        var o = e[n] = {
7            i: n,
8            l: !1,
9            exports: {}
10        };
11        return t[n].call(o.exports, o, o.exports, a), o.l = !0, o.exports
12    }
13    a.m = t, a.c = e, a.d = function(t, e, n) {
14        a.o(t, e) || Object.defineProperty(t, e, {
15            enumerable: !0,
16            get: n
17        })
18    }, a.r = function(t) {
19        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
20            value: "Module"
21        }), Object.defineProperty(t, "__esModule", {
22            value: !0
23        })
24    }, a.t = function(t, e) {
25        if (1 & e && (t = a(t)), 8 & e) return t;
26        if (4 & e && "object" == typeof t && t && t.__esModule) return t;
27        var n = Object.create(null);
28        if (a.r(n), Object.defineProperty(n, "default", {
29            enumerable: !0,
30            value: t
31        }), 2 & e && "string" != typeof t)
32            for (var o in t) a.d(n, o, function(e) {
33                return t[e]
34            }.bind(null, o));
35        return n
36    }, a.n = function(t) {
37        var e = t && t.__esModule ? function() {
38            return t.default
39        } : function() {
40            return t
41        };
42        return a.d(e, "a", e), e
43    }, a.o = function(t, e) {
44        return Object.prototype.hasOwnProperty.call(t, e)
45    }, a.p = "/dist/prog/", a(a.s = 3)
46}([, , , function(t, e, a) {
47    a(4), t.exports = a(8)
48}, function(t, e, a) {
49    window.UPLAB_LOAD_LIBS = !0, a.p = a.p || "/";
50    document.addEventListener("DOMContentLoaded", (function() {
51        "undefined" == typeof jQuery ? console.error("jQuery undefined") : (a(5), a(6), a(7), document.dispatchEvent(new CustomEvent("UPLAB.LibsLoaded")))
52    }))
53}, function(t, e) {
54    jQuery.fn.extend({
55        scrollTo: function(t, e, a) {
56            return e = e || 600, t = t || 0, "up" === $("html").data("direction") && 0 === t && (t = -$(".header__container").height()), window.ls ? window.ls.scrollTo(this.get(0), {
57                offset: t
58            }) : (a = a || this.offset().top + t) && $("html,body").animate({
59                scrollTop: a
60            }, e), this
61        }
62    })
63}, function(t, e) {
64    function a(t, e) {
65        for (var a = 0; a < e.length; a++) {
66            var n = e[a];
67            n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n)
68        }
69    }
70    var n = function() {
71        function t() {
72            ! function(t, e) {
73                if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
74            }(this, t), this.init()
75        }
76        var e, n, o;
77        return e = t, (n = [{
78            key: "ajaxReplaceContent",
79            value: function(t) {
80                var e, a = (t = t || {}).dataAttribute,
81                    n = t.html,
82                    o = t.res || {},
83                    r = !0 === t.isParseSelector;
84                $("[data-".concat(a, "]")).each((function(i, s) {
85                    var d = $(s),
86                        c = d.data(a),
87                        l = !1;
88                    if (e = !0 === t.isAppend && d.is('[data-ajax-append="true"]'), r) {
89                        var u = n.find("[data-".concat(a, "='").concat(c, "']"));
90                        u.length && (l = e ? u.html() : u.prop("outerHTML"))
91                    } else o.hasOwnProperty(c) && (l = o[c]);
92                    l && (e ? d.append($(l)) : d.replaceWith(l))
93                }))
94            }
95        }, {
96            key: "loadContent",
97            value: function(t) {
98                var e = this;
99                (t = t || {}).selector = t.selector || this.AJAX_CONTENT_SEL;
100                var a = $(t.selector);
101                a.length ? (t.isJson = !1 !== t.isJson, t.isParseSelector = !0 === t.isParseSelector, t.url = t.url || location.href, t.query = t.query || "", t.method = t.method || "get", t.onSuccess = "function" == typeof t.onSuccess && t.onSuccess, t.hasOwnProperty("isAppend") || (t.isAppend = !1), t.hasOwnProperty("isPrepend") || (t.isPrepend = !1), t.hasOwnProperty("isKeepHistory") || (t.isKeepHistory = !1), t.hasOwnProperty("isKeepT
101itle") || (t.isKeepTitle = !1), t.hasOwnProperty("isKeepH1") || (t.isKeepH1 = !1), t.hasOwnProperty("isScrollOnLoad") || (t.isScrollOnLoad = !1), $(window).trigger("preloader:show", a), $.ajax({
102                    url: t.url,
103                    data: t.query,
104                    dataType: t.isJson ? "json" : "html",
105                    method: t.method,
106                    success: function(n) {
107                        $(window).trigger("preloader:hide", a);
108                        var o, r = t.isJson ? n.html : n;
109                        t.isParseSelector && (r = (o = $("<div>").append(r)).find(t.selector).html()), r && (t.isPrepend ? a.prepend(r) : t.isAppend ? a.append(r) : a.html(r), t.isJson && (e.ajaxReplaceContent({
110                            dataAttribute: "ajax-replace-content",
111                            html: o || $(r),
112                            res: n,
113                            isParseSelector: t.isParseSelector,
114                            isAppend: t.isAppend
115                        }), t.isKeepHistory || history.replaceState({}, "", n.url), !t.isKeepH1 && n.hasOwnProperty("h1") && n.h1 && $("h1").html(n.h1), !t.isKeepTitle && n.hasOwnProperty("title") && n.title && (document.title = n.title)), $(window).trigger("init"), window.dispatchEvent(new CustomEvent("reinit")), t.isScrollOnLoad && a.scrollTo(), t.onSuccess && t.onSuccess(t, n))
116                    }
117                })) : console.error("no-ajax-container")
118            }
119        }, {
120            key: "initHandlers",
121            value: function() {
122                var t = this;
123                $(document).on("reset", "[data-ajax-form-to]", (function(e) {
124                    var a = $(this);
125                    t.loadContent({
126                        url: a.prop("action") || location.href,
127                        query: "",
128                        method: a.prop("method") || "post",
129                        selector: a.data("ajax-form-to"),
130                        isJson: a.data("json-content"),
131                        isParseSelector: a.data("parse-selector"),
132                        isAppend: a.data("append-content") || !1,
133                        isKeepHistory: a.data("keep-history") || !1,
134                        isScrollOnLoad: a.data("scroll-on-load") || !1
135                    })
136                })), $(document).on("submit", "[data-ajax-form-to]", (function(e) {
137                    e.preventDefault();
138                    var a = $(this);
139                    a.prop("disabled", !1), t.loadContent({
140                        url: a.data("action") || a.prop("action"),
141                        query: a.serializeArray(),
142                        method: a.prop("method") || "post",
143                        selector: a.data("ajax-form-to"),
144                        isJson: a.data("json-content"),
145                        isParseSelector: a.data("parse-selector"),
146                        isAppend: a.data("append-content") || !1,
147                        isKeepHistory: a.data("keep-history") || !1,
148                        isScrollOnLoad: a.data("scroll-on-load") || !1
149                    })
150                })), $(document).on("click", "[data-ajax-link-to]", (function(e) {
151                    e.preventDefault();
152                    var a = $(this);
153                    a.trigger("button:loadingStart"), t.loadContent({
154                        url: a.data("href") || this.href,
155                        query: a.data("query") || "",
156                        selector: a.data("ajax-link-to"),
157                        isJson: a.data("json-content"),
158                        isParseSelector: a.data("parse-selector"),
159                        isAppend: a.data("append-content") || !1,
160                        isKeepHistory: a.data("keep-history") || !1,
161                        isScrollOnLoad: a.data("scroll-on-load") || !1,
162                        onSuccess: function() {
163                            a.trigger("button:loadingEnd")
164                        }
165                    })
166                })), $(document).on("click", "[data-submit-form-on-click]", (function(t) {
167                    t.preventDefault();
168                    var e = $(this);
169                    $(e.data("submit-form-on-click")).trigger("submit", {
170                        query: e.data("query")
171                    })
172                })), $(window).on("init.ajax", (function() {
173                    $(window).trigger("scroll")
174                }))
175            }
176        }, {
177            key: "init",
178            value: function() {
179                this.initHandlers()
180            }
181        }]) && a(e.prototype, n), o && a(e, o), Object.defineProperty(e, "prototype", {
182            writable: !1
183        }), t
184    }();
185    $((function() {
186        window.__ajaxLoaderHandler = new n
187    }))
188}, function(t, e) {
189    BX.message({
190        BTN_IN_CART: "Добавлен"
191    }), BX.message({
192        BTN_BUY: "Подключить"
193    }), BX.message({
194        BTN_TITLE_DELETE: "Удалить из корзины"
195    }), BX.message({
196        BTN_TITLE_BUY: "Добавить в корзину"
197    }), setCounterValue = function(t) {
198        var e = $("[data-product-counter]");
199        if (e && e.length) {
200            var a = e.find(".header__button-counter");
201            t <= 0 ? (a.text(""), a.addClass("visually-hidden")) : (a.text(t), a.removeClass("visually-hidden"))
202        }
203    }, window.initBasketProductActions = function() {
204        window.initBasketProductActionsEvent && (clearTimeout(window.initBasketProductActionsEvent), window.initBasketProductActionsEvent = null), window.initBasketProductActionsEvent = setTimeout((function() {
205            var t = document.querySelectorAll("[data-basket]");
206            t && t.length > 0 && BX.ajax.runAction("mtt:local.controllers.basket.getData", {
207                data: {}
208            }).then((function(e) {
209                if ("success" === e.status) {
210                    var a = e.data && e.data.basketItems ? e.data.basketItems : [];
211                    t.forEach((function(t) {
212                        var e = t,
213                            n = $(e),
214                            o = parseInt(e.getAttribute("data-basket")),
215                            r = a.find((function(t) {
216                                return t.productId === o
217                            })),
218                            i = r || {
219                                action: "add"
220                            };
221                        BX.adjust(e, {
222                            attrs: {
223                                "data-basket-action": JSON.stringify(i)
224                            }
225                        });
226                        var s = e.dataset && e.dataset.classInCart ? e.dataset.classInCart : "button-circle--in-cart",
227                            d = e.getAttribute("data-text-buy") ? e.getAttribute("data-text-buy") : BX.message("BTN_BUY");
228                        r ? (BX.addClass(e, s), BX.adjust(e, {
229                            props: {
230                                title: BX.message("BTN_TITLE_DELETE")
231                            }
232                        }), n.find(".button-circle__text").text(BX.message("BTN_IN_CART"))) : (BX.removeClass(e, s), BX.adjust(e, {
233                            props: {
234                                title: BX.message("BTN_TITLE_BUY")
235                            }
236                        }), n.find(".button-circle__text").text(d))
237                    })), e.data && void 0 !== e.data.allCount && setCounterValue(e.data.allCount)
238                }
239            })).catch((function(t) {
240                BX.onCustomEvent("basket-getData:error", t)
241            }))
242        }), 450)
243    }, $((function() {
244        window.isIeBrowser = window.navigator.userAgent.indexOf("MSIE ") > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./);
245        var t = null;
246
247        function e(t) {
248            t.customBlockButtonDisabled = !0, BX.addClass(t, "is-loading"), BX.adjust(t, {
249                props: {
250                    disabled: !0
251                }
252            })
253        }
254
255        function a(t) {
256            BX.removeClass(t, "is-loading"), BX.adjust(t, {
257                props: {
258                    disabled: !1
259                }
260            }), t.customBlockButtonDisabled = !1
261        }
262        $(window).off("preloader:show").on("preloader:show", (function() {
263            null === t && (t = BX.showWait("wait"))
264        })), $(window).off("preloader:hide").on("preloader:hide", (function() {
265            BX.closeWait("wait", t), t = null
266        }));
267        var n = null,
268            o = function(t) {
269                n && (clearTimeout(n), n = null), n = setTimeout(function(t) {
270                    return function() {
271                        var e = $(t.currentTarget).closest("form");
272                        !0 !== e.prop("disabled") && (e.prop("disabled", !0), e.trigger("submit"))
273                    }
274                }(t), 600)
275            };
276        $(document).on("change", ["[data-auto-submit] select:not(.custom-select__select)", "[data-auto-submit] .custom-select__select.selectr-inited", "[data-auto-submit] input[type=checkbox]", "[data-auto-submit] input[type=radio]"].join(","), o), $(document).on(isIeBrowser ? "change" : "input keydown paste change", ["[data-auto-submit] input[type=text]", "[data-auto-submit] input[type=search]", "[data-auto-submit] input[type=number]", "[data-auto-submit] input[type=hidden]"].join(","), (function(t) {
277            var e = $(t.currentTarget),
278                a = e.val(),
279                n = e.prop("oldVal") || "";
280            if (e.prop("oldVal", a), a !== n)
281                if (n.length && 0 === a.length) o(t);
282                else {
283                    "city" == e.attr("name") ? $("#city_changed").val("Y") : $("#city_changed").val("N");
284                    var r = +e.data("submit-length-from");
285                    if (r) {
286                        if (e.val().length < r) return e.prop("crossed") && o(t), void e.prop("crossed", !1);
287                        e.prop("crossed", !0)
288                    }
289                    o(t)
290                }
291        })),
292
293        // $("[data-open-support-chat]").click((function() {
294        //     $("#chat21-launcher-button").click()
295        // })),
296
297
298        (function() {
299                function simulateClick(el) {
300                    if (!el) return false;
301                    const event = new MouseEvent('click', {
302                        view: window,
303                        bubbles: true,
304                        cancelable: true
305                    });
306                    el.dispatchEvent(event);
307                    return true;
308                }
309
310                document.addEventListener('click', function(e) {
311                    autofaq.open();
312                    if (e.target.closest('[data-open-support-chat]')) {
313                        e.preventDefault();
314                        e.stopImmediatePropagation();
315
316                        const launcher = document.getElementById('chat21-launcher-button');
317                        if (!simulateClick(launcher)) {
318                            console.warn('AutoFAQ launcher not found');
319                            return;
320                        }
321
322                        setTimeout(() => {
323                            const widgetItem = document.querySelector('.chat-21-channels-list-item[data-channel-type="Widget"]');
324                            if (!simulateClick(widgetItem)) {
325                                console.warn('Widget channel item not found — maybe already open?');
326                            }
327                        }, 700);
328                    }
329                }, true);
330            })();
331
332        BX.bindDelegate(document, "click", {
333            attribute: "data-basket"
334        },
335            (function(t) {
336            t.preventDefault(), t.stopImmediatePropagation(), t.stopPropagation();
337            var n = this,
338                o = $(n),
339                r = n.getAttribute("data-basket");
340            if (!r) return console.error("Empty product id", n), !1;
341            var i = n.getAttribute("data-basket-action");
342            if (!i) return console.error("Empty attrData", n), !1;
343            e(n);
344            var s = JSON.parse(i).action,
345                d = {
346                    productId: r,
347                    quantity: 1
348                },
349                c = n.getAttribute("data-basket-prop");
350            if (c) {
351                var l = o.closest(c).find("form");
352                if (l.length > 0) {
353                    var u = l.serializeArray();
354                    u && (d.options = u)
355                }
356            }
357            BX.ajax.runAction("mtt:local.controllers.basket." + s, {
358                data: d
359            }).then((function(t) {
360                if ("success" === t.status) {
361                    var e = t.data;
362                    if (window.dispatchEvent(new CustomEvent("basket:update")), a(n), e && void 0 !== e.allCount && (setCounterValue(e.allCount), delete e.allCount), e && e.errors) return console.log(e.errors), delete e.errors, alert("Ошибка добавления в корзину. Подробности в логе."), !1;
363                    BX.adjust(n, {
364                        attrs: {
365                            "data-basket-action": JSON.stringify(e)
366                        }
367                    });
368                    var r = n.dataset && n.dataset.classInCart ? n.dataset.classInCart : "button-circle--in-cart",
369                        i = n.getAttribute("data-text-buy") ? n.getAttribute("data-text-buy") : BX.message("BTN_BUY");
370                    if ("add" === s) {
371                        BX.addClass(n, r), BX.adjust(n, {
372                            props: {
373                                title: BX.message("BTN_TITLE_DELETE")
374                            }
375                        }), o.find(".button-circle__text").text(BX.message("BTN_IN_CART"))
376                    } else "delete" === s && (BX.removeClass(n, r), BX.adjust(n, {
377                        props: {
378                            title: BX.message("BTN_TITLE_BUY")
379                        }
380                    }), o.find(".button-circle__text").text(i))
381                }
382            })).catch((function(t) {
383                a(n)
384            }))
385        })), window.initBasketProductActions(), $(document).off("click.data-delete-item-cart").on("click.data-delete-item-cart", "[data-delete-item-cart]", (function(t) {
386            e(this), BX.ajax.runAction("mtt:local.controllers.basket.deleteCart", {
387                data: {
388                    productId: $(this).data("delete-item-cart")
389                }
390            }).then((function(t) {
391                var e = t.data;
392                if (e && void 0 !== e.allCount && (setCounterValue(e.allCount), delete e.allCount), e && void 0 !== e.cart) {
393                    var a = $("<div>" + e.cart + "</div>
393").find(".modal-basket").html();
394                    $(".modal-basket").html(a), $(window).trigger("init"), window.dispatchEvent(new CustomEvent("reinit")), window.initBasketProductActions()
395                }
396            }))
397        }))
398    }))
399}, function(t, e, a) {}]);

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.