PageSourceSearch

https://cdn.infourok.ru/assets/core/controllers/pages/invitro-health/invitro-health_controller-YEwIf1-.js

js infourok.ru collected 2026-10-01 10:23:07 UTC 8,468 bytes, 228 lines download raw bytes

1/// <reference path="../../../../../../../../global.d.ts" />
2/// <reference path="../../../../../../../../iu.d.ts" />
3function _assert_this_initialized(self) {
4    if (self === void 0) {
5        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
6    }
7    return self;
8}
9function _class_call_check(instance, Constructor) {
10    if (!(instance instanceof Constructor)) {
11        throw new TypeError("Cannot call a class as a function");
12    }
13}
14function _defineProperties(target, props) {
15    for(var i = 0; i < props.length; i++){
16        var descriptor = props[i];
17        descriptor.enumerable = descriptor.enumerable || false;
18        descriptor.configurable = true;
19        if ("value" in descriptor) descriptor.writable = true;
20        Object.defineProperty(target, descriptor.key, descriptor);
21    }
22}
23function _create_class(Constructor, protoProps, staticProps) {
24    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
25    if (staticProps) _defineProperties(Constructor, staticProps);
26    return Constructor;
27}
28function _define_property(obj, key, value) {
29    if (key in obj) {
30        Object.defineProperty(obj, key, {
31            value: value,
32            enumerable: true,
33            configurable: true,
34            writable: true
35        });
36    } else {
37        obj[key] = value;
38    }
39    return obj;
40}
41function _get_prototype_of(o) {
42    _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
43        return o.__proto__ || Object.getPrototypeOf(o);
44    };
45    return _get_prototype_of(o);
46}
47function _inherits(subClass, superClass) {
48    if (typeof superClass !== "function" && superClass !== null) {
49        throw new TypeError("Super expression must either be null or a function");
50    }
51    subClass.prototype = Object.create(superClass && superClass.prototype, {
52        constructor: {
53            value: subClass,
54            writable: true,
55            configurable: true
56        }
57    });
58    if (superClass) _set_prototype_of(subClass, superClass);
59}
60function _possible_constructor_return(self, call) {
61    if (call && (_type_of(call) === "object" || typeof call === "function")) {
62        return call;
63    }
64    return _assert_this_initialized(self);
65}
66function _set_prototype_of(o, p) {
67    _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
68        o.__proto__ = p;
69        return o;
70    };
71    return _set_prototype_of(o, p);
72}
73function _type_of(obj) {
74    "@swc/helpers - typeof";
75    return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
76}
77function _is_native_reflect_construct() {
78    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
79    if (Reflect.construct.sham) return false;
80    if (typeof Proxy === "function") return true;
81    try {
82        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
83        return true;
84    } catch (e) {
85        return false;
86    }
87}
88function _create_super(Derived) {
89    var hasNativeReflectConstruct = _is_native_reflect_construct();
90    return function _createSuperInternal() {
91        var Super = _get_prototype_of(Derived), result;
92        if (hasNativeReflectConstruct) {
93            var NewTarget = _get_prototype_of(this).constructor;
94            result = Reflect.construct(Super, arguments, NewTarget);
95        } else {
96            result = Super.apply(this, arguments);
97        }
98        return _possible_constructor_return(this, result);
99    };
100}
101import { Controller } from "@hotwired/stimulus";
102import Swiper from "swiper";
103import { Navigation } from "swiper/modules";
104import "swiper/swiper-bundle.css";
105var _class = /*#__PURE__*/ function(Controller) {
106    "use strict";
107    _inherits(_class, Controller);
108    var _super = _create_super(_class);
109    function _class() {
110        _class_call_check(this, _class);
111        var _this;
112        _this = _super.apply(this, arguments);
113        _define_property(_assert_this_initialized(_this), "swiperInstances", []);
114        _define_property(_assert_this_initialized(_this), "linkHandlers", []);
115        return _this;
116    }
117    _create_class(_class, [
118        {
119            key: "connect",
120            value: function connect() {
121                var _this = this;
122                requestAnimationFrame(function() {
123                    _this.initSliders();
124                });
125                this.initSmoothScroll();
126            }
127        },
128        {
129            key: "initSliders",
130            value: function initSliders() {
131                var _this = this;
132                this.sliderTargets.forEach(function(slider) {
133                    var section = slider.closest("section");
134                    var prevBtn = _this.sliderPrevButtonTargets.find(function(button) {
135                        return button.closest("section") === section;
136                    });
137                    var nextBtn = _this.sliderNextButtonTargets.find(function(button) {
138                        return button.closest("section") === section;
139                    });
140                    var sliderId = section === null || section === void 0 ? void 0 : section.id;
141                    var options = sliderId === "webinar-banner" ? {
142                        loop: false,
143                        slidesPerView: 1,
144                        spaceBetween: 0,
145                        modules: [
146                            Navigation
147                        ],
148                        navigation: {
149                            nextEl: nextBtn,
150                            prevEl: prevBtn
151                        }
152                    } : {
153                        loop: false,
154                        slidesPerView: 3,
155                        spaceBetween: 16,
156                        modules: [
157                            Navigation
158                        ],
159                        navigation: {
160                            nextEl: nextBtn,
161                            prevEl: prevBtn
162                        },
163                        breakpoints: {
164                            1430: {
165                                slidesPerView: 3
166                            },
167                            524: {
168                                slidesPerView: 2,
169                                spaceBetween: 20
170                            },
171                            300: {
172                                slidesPerView: 1.29
173                            }
174                        }
175                    };
176                    _this.swiperInstances.push(new Swiper(slider, options));
177                });
178            }
179        },
180        {
181            key: "disconnect",
182            value: function disconnect() {
183                this.swiperInstances.forEach(function(instance) {
184                    return instance.destroy(true, true);
185                });
186                this.swiperInstances = [];
187                this.linkHandlers.forEach(function(param) {
188                    var element = param.element, handler = param.handler;
189                    element.removeEventListener("click", handler);
190                });
191                this.linkHandlers = [];
192            }
193        },
194        {
195            key: "initSmoothScroll",
196            value: function initSmoothScroll() {
197                var _this = this;
198                var links = this.element.querySelectorAll('a[href^="#"]');
199                links.forEach(function(link) {
200                    var handler = function(e) {
201                        var href = link.getAttribute("href");
202                        if (!href || href === "#") return;
203                        var target = document.querySelector(href);
204                        if (!target) return;
205                        e.preventDefault();
206                        var offsetTop = target.offsetTop;
207                        window.scrollTo({
208                            top: offsetTop,
209                            behavior: "smooth"
210                        });
211                    };
212                    link.addEventListener("click", handler);
213                    _this.linkHandlers.push({
214                        element: link,
215                        handler: handler
216                    });
217                });
218            }
219        }
220    ]);
221    return _class;
222}(Controller);
223_define_property(_class, "targets", [
224    "slider",
225    "sliderPrevButton",
226    "sliderNextButton"
227]);
228/* stimulusFetch: 'lazy' */ export { _class as default };

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.