@kolserdav/swiper 4.3.2 → 4.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Swiper.js CHANGED
@@ -1,1122 +1,2 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("react"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["react"], factory);
6
- else if(typeof exports === 'object')
7
- exports["ReactSwiper"] = factory(require("react"));
8
- else
9
- root["ReactSwiper"] = factory(root["react"]);
10
- })(this, (__WEBPACK_EXTERNAL_MODULE_react__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ "./src/Swiper.module.css":
16
- /*!*******************************!*\
17
- !*** ./src/Swiper.module.css ***!
18
- \*******************************/
19
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
20
-
21
- __webpack_require__.r(__webpack_exports__);
22
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23
- /* harmony export */ active: () => (/* binding */ active),
24
- /* harmony export */ back: () => (/* binding */ back),
25
- /* harmony export */ button: () => (/* binding */ button),
26
- /* harmony export */ button__next: () => (/* binding */ button__next),
27
- /* harmony export */ button__prev: () => (/* binding */ button__prev),
28
- /* harmony export */ card: () => (/* binding */ card),
29
- /* harmony export */ card__stop: () => (/* binding */ card__stop),
30
- /* harmony export */ container: () => (/* binding */ container),
31
- /* harmony export */ content: () => (/* binding */ content),
32
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
33
- /* harmony export */ dot: () => (/* binding */ dot),
34
- /* harmony export */ dots: () => (/* binding */ dots),
35
- /* harmony export */ go: () => (/* binding */ go),
36
- /* harmony export */ icon__button: () => (/* binding */ icon__button),
37
- /* harmony export */ next: () => (/* binding */ next),
38
- /* harmony export */ paper: () => (/* binding */ paper),
39
- /* harmony export */ pipe: () => (/* binding */ pipe),
40
- /* harmony export */ prev: () => (/* binding */ prev)
41
- /* harmony export */ });
42
- /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
43
- /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
44
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
45
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
46
- // Imports
47
-
48
-
49
- var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
50
- // Module
51
- ___CSS_LOADER_EXPORT___.push([module.id, `._E0DSvpd_pOhPwEcOESk {
52
- position: relative;
53
- overflow: hidden;
54
- min-width: 320px;
55
- width: 100%;
56
- height: 100%;
57
- min-height: 20vh;
58
- max-width: 100vw;
59
- display: flex;
60
- align-items: center;
61
- justify-content: center;
62
- }
63
-
64
- .MNKZLOwtKAYuGRPioWg5 {
65
- background-color: #fff;
66
- border-radius: 1rem;
67
- }
68
-
69
- .fZGJ3LJ3vksT7z_W2Xbj {
70
- position: relative;
71
- width: 100%;
72
- height: 100%;
73
- }
74
-
75
- .PZLGxXxVQxNBPdUxCzZF {
76
- position: absolute;
77
- max-width: inherit;
78
- top: 0;
79
- left: 0;
80
- display: flex;
81
- align-items: center;
82
- justify-content: center;
83
- flex-direction: column;
84
- }
85
- .fdHrMcOmTUvG2ylUYYCo {
86
- left: -100%;
87
- }
88
- .yHDVaCXbXJXsAleBINaZ {
89
- left: 100%;
90
- }
91
- .P07Z5eTTJ3p2fjOfBFbZ {
92
- transition: left 0.4s ease-in 0s;
93
- }
94
- .okENlLNDDujMLgzN2KUI {
95
- transition: left 0.4s ease-out 0s;
96
- }
97
-
98
- .xqRTwQcqLpSHYzXUn7Qo {
99
- width: 100%;
100
- height: 100%;
101
- position: relative;
102
- }
103
-
104
- .Ypi0iAw66HoFXrF10npO {
105
- border-radius: 2px;
106
- position: relative;
107
- width: calc(100% - 48px);
108
- height: calc(100% - 48px);
109
- -webkit-box-shadow: 0px 0px 5px 1px rgba(34, 60, 80, 0.14);
110
- -moz-box-shadow: 0px 0px 5px 1px rgba(34, 60, 80, 0.14);
111
- box-shadow: 0px 0px 5px 1px rgba(34, 60, 80, 0.14);
112
- }
113
-
114
- .BFZzBGGo1DZSlo_VO3S6 {
115
- cursor: pointer;
116
- position: absolute;
117
- width: auto;
118
- height: auto;
119
- display: flex;
120
- align-items: center;
121
- z-index: 12;
122
- }
123
-
124
- .I78h4QcRoZnFJkvhRspX {
125
- right: 0;
126
- }
127
-
128
- .nlzCTOpb1QyxySkPPncw {
129
- left: 0;
130
- transform: rotate(180deg);
131
- }
132
-
133
- .D2v6zUbfWAotXYTbrWUW {
134
- display: -webkit-inline-box;
135
- display: -webkit-inline-flex;
136
- display: -ms-inline-flexbox;
137
- display: inline-flex;
138
- align-items: center;
139
- justify-content: center;
140
- position: relative;
141
- box-sizing: border-box;
142
- background-color: transparent;
143
- outline: 0;
144
- border: 0;
145
- margin: 0;
146
- border-radius: 0;
147
- padding: 0;
148
- cursor: pointer;
149
- user-select: none;
150
- vertical-align: middle;
151
- text-decoration: none;
152
- color: inherit;
153
- text-align: center;
154
- flex: 0 0 auto;
155
- font-size: 1.5rem;
156
- padding: 8px;
157
- border-radius: 50%;
158
- overflow: visible;
159
- color: rgba(0, 0, 0, 0.54);
160
- transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
161
- }
162
- .D2v6zUbfWAotXYTbrWUW:hover {
163
- background-color: rgba(0, 0, 0, 0.054);
164
- }
165
- .D2v6zUbfWAotXYTbrWUW:active {
166
- background-color: rgba(0, 0, 0, 0.007);
167
- }
168
-
169
- .Zxb5JskRkhBuUYyMGjU2 {
170
- position: absolute;
171
- display: flex;
172
- flex-direction: row;
173
- bottom: 0;
174
- }
175
-
176
- .CEsncB7BTaSWKBlqUDJt {
177
- cursor: pointer;
178
- position: relative;
179
- width: 8px;
180
- height: 8px;
181
- margin: 2px;
182
- border: 1px solid gray;
183
- border-radius: 50%;
184
- }
185
-
186
- .CEsncB7BTaSWKBlqUDJt.KZrnFwcKg0Ux8MF4udTr {
187
- cursor: default;
188
- background-color: gray;
189
- }`, "",{"version":3,"sources":["webpack://./src/Swiper.module.css"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,WAAW;EACX,YAAY;EACZ,gBAAgB;EAChB,gBAAgB;EAChB,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,sBAAsB;EACtB,mBAAmB;AACrB;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,sBAAsB;AACxB;AACA;EACE,WAAW;AACb;AACA;EACE,UAAU;AACZ;AACA;EACE,gCAAgC;AAClC;AACA;EACE,iCAAiC;AACnC;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,wBAAwB;EACxB,yBAAyB;EACzB,0DAA0D;EAC1D,uDAAuD;EACvD,kDAAkD;AACpD;;AAEA;EACE,eAAe;EACf,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,WAAW;AACb;;AAEA;EACE,QAAQ;AACV;;AAEA;EACE,OAAO;EACP,yBAAyB;AAC3B;;AAEA;EACE,2BAA2B;EAC3B,4BAA4B;EAC5B,2BAA2B;EAC3B,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;EAClB,sBAAsB;EACtB,6BAA6B;EAC7B,UAAU;EACV,SAAS;EACT,SAAS;EACT,gBAAgB;EAChB,UAAU;EACV,eAAe;EACf,iBAAiB;EACjB,sBAAsB;EACtB,qBAAqB;EACrB,cAAc;EACd,kBAAkB;EAClB,cAAc;EACd,iBAAiB;EACjB,YAAY;EACZ,kBAAkB;EAClB,iBAAiB;EACjB,0BAA0B;EAC1B,mEAAmE;AACrE;AACA;EACE,sCAAsC;AACxC;AACA;EACE,sCAAsC;AACxC;;AAEA;EACE,kBAAkB;EAClB,aAAa;EACb,mBAAmB;EACnB,SAAS;AACX;;AAEA;EACE,eAAe;EACf,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,WAAW;EACX,sBAAsB;EACtB,kBAAkB;AACpB;;AAEA;EACE,eAAe;EACf,sBAAsB;AACxB","sourcesContent":[".container {\n position: relative;\n overflow: hidden;\n min-width: 320px;\n width: 100%;\n height: 100%;\n min-height: 20vh;\n max-width: 100vw;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.paper {\n background-color: #fff;\n border-radius: 1rem;\n}\n\n.pipe {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.card {\n position: absolute;\n max-width: inherit;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.prev {\n left: -100%;\n}\n.next {\n left: 100%;\n}\n.back {\n transition: left 0.4s ease-in 0s;\n}\n.go {\n transition: left 0.4s ease-out 0s;\n}\n\n.card__stop {\n width: 100%;\n height: 100%;\n position: relative;\n}\n\n.content {\n border-radius: 2px;\n position: relative;\n width: calc(100% - 48px);\n height: calc(100% - 48px);\n -webkit-box-shadow: 0px 0px 5px 1px rgba(34, 60, 80, 0.14);\n -moz-box-shadow: 0px 0px 5px 1px rgba(34, 60, 80, 0.14);\n box-shadow: 0px 0px 5px 1px rgba(34, 60, 80, 0.14);\n}\n\n.button {\n cursor: pointer;\n position: absolute;\n width: auto;\n height: auto;\n display: flex;\n align-items: center;\n z-index: 12;\n}\n\n.button__next {\n right: 0;\n}\n\n.button__prev {\n left: 0;\n transform: rotate(180deg);\n}\n\n.icon__button {\n display: -webkit-inline-box;\n display: -webkit-inline-flex;\n display: -ms-inline-flexbox;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n background-color: transparent;\n outline: 0;\n border: 0;\n margin: 0;\n border-radius: 0;\n padding: 0;\n cursor: pointer;\n user-select: none;\n vertical-align: middle;\n text-decoration: none;\n color: inherit;\n text-align: center;\n flex: 0 0 auto;\n font-size: 1.5rem;\n padding: 8px;\n border-radius: 50%;\n overflow: visible;\n color: rgba(0, 0, 0, 0.54);\n transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}\n.icon__button:hover {\n background-color: rgba(0, 0, 0, 0.054);\n}\n.icon__button:active {\n background-color: rgba(0, 0, 0, 0.007);\n}\n\n.dots {\n position: absolute;\n display: flex;\n flex-direction: row;\n bottom: 0;\n}\n\n.dot {\n cursor: pointer;\n position: relative;\n width: 8px;\n height: 8px;\n margin: 2px;\n border: 1px solid gray;\n border-radius: 50%;\n}\n\n.dot.active {\n cursor: default;\n background-color: gray;\n}"],"sourceRoot":""}]);
190
- // Exports
191
- var container = `_E0DSvpd_pOhPwEcOESk`;
192
- var paper = `MNKZLOwtKAYuGRPioWg5`;
193
- var pipe = `fZGJ3LJ3vksT7z_W2Xbj`;
194
- var card = `PZLGxXxVQxNBPdUxCzZF`;
195
- var prev = `fdHrMcOmTUvG2ylUYYCo`;
196
- var next = `yHDVaCXbXJXsAleBINaZ`;
197
- var back = `P07Z5eTTJ3p2fjOfBFbZ`;
198
- var go = `okENlLNDDujMLgzN2KUI`;
199
- var card__stop = `xqRTwQcqLpSHYzXUn7Qo`;
200
- var content = `Ypi0iAw66HoFXrF10npO`;
201
- var button = `BFZzBGGo1DZSlo_VO3S6`;
202
- var button__next = `I78h4QcRoZnFJkvhRspX`;
203
- var button__prev = `nlzCTOpb1QyxySkPPncw`;
204
- var icon__button = `D2v6zUbfWAotXYTbrWUW`;
205
- var dots = `Zxb5JskRkhBuUYyMGjU2`;
206
- var dot = `CEsncB7BTaSWKBlqUDJt`;
207
- var active = `KZrnFwcKg0Ux8MF4udTr`;
208
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
209
-
210
-
211
- /***/ }),
212
-
213
- /***/ "./node_modules/css-loader/dist/runtime/api.js":
214
- /*!*****************************************************!*\
215
- !*** ./node_modules/css-loader/dist/runtime/api.js ***!
216
- \*****************************************************/
217
- /***/ ((module) => {
218
-
219
-
220
-
221
- /*
222
- MIT License http://www.opensource.org/licenses/mit-license.php
223
- Author Tobias Koppers @sokra
224
- */
225
- module.exports = function (cssWithMappingToString) {
226
- var list = [];
227
-
228
- // return the list of modules as css string
229
- list.toString = function toString() {
230
- return this.map(function (item) {
231
- var content = "";
232
- var needLayer = typeof item[5] !== "undefined";
233
- if (item[4]) {
234
- content += "@supports (".concat(item[4], ") {");
235
- }
236
- if (item[2]) {
237
- content += "@media ".concat(item[2], " {");
238
- }
239
- if (needLayer) {
240
- content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
241
- }
242
- content += cssWithMappingToString(item);
243
- if (needLayer) {
244
- content += "}";
245
- }
246
- if (item[2]) {
247
- content += "}";
248
- }
249
- if (item[4]) {
250
- content += "}";
251
- }
252
- return content;
253
- }).join("");
254
- };
255
-
256
- // import a list of modules into the list
257
- list.i = function i(modules, media, dedupe, supports, layer) {
258
- if (typeof modules === "string") {
259
- modules = [[null, modules, undefined]];
260
- }
261
- var alreadyImportedModules = {};
262
- if (dedupe) {
263
- for (var k = 0; k < this.length; k++) {
264
- var id = this[k][0];
265
- if (id != null) {
266
- alreadyImportedModules[id] = true;
267
- }
268
- }
269
- }
270
- for (var _k = 0; _k < modules.length; _k++) {
271
- var item = [].concat(modules[_k]);
272
- if (dedupe && alreadyImportedModules[item[0]]) {
273
- continue;
274
- }
275
- if (typeof layer !== "undefined") {
276
- if (typeof item[5] === "undefined") {
277
- item[5] = layer;
278
- } else {
279
- item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
280
- item[5] = layer;
281
- }
282
- }
283
- if (media) {
284
- if (!item[2]) {
285
- item[2] = media;
286
- } else {
287
- item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
288
- item[2] = media;
289
- }
290
- }
291
- if (supports) {
292
- if (!item[4]) {
293
- item[4] = "".concat(supports);
294
- } else {
295
- item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
296
- item[4] = supports;
297
- }
298
- }
299
- list.push(item);
300
- }
301
- };
302
- return list;
303
- };
304
-
305
- /***/ }),
306
-
307
- /***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js":
308
- /*!************************************************************!*\
309
- !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***!
310
- \************************************************************/
311
- /***/ ((module) => {
312
-
313
-
314
-
315
- module.exports = function (item) {
316
- var content = item[1];
317
- var cssMapping = item[3];
318
- if (!cssMapping) {
319
- return content;
320
- }
321
- if (typeof btoa === "function") {
322
- var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
323
- var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
324
- var sourceMapping = "/*# ".concat(data, " */");
325
- return [content].concat([sourceMapping]).join("\n");
326
- }
327
- return [content].join("\n");
328
- };
329
-
330
- /***/ }),
331
-
332
- /***/ "react":
333
- /*!************************!*\
334
- !*** external "react" ***!
335
- \************************/
336
- /***/ ((module) => {
337
-
338
- module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
339
-
340
- /***/ }),
341
-
342
- /***/ "./node_modules/clsx/dist/clsx.mjs":
343
- /*!*****************************************!*\
344
- !*** ./node_modules/clsx/dist/clsx.mjs ***!
345
- \*****************************************/
346
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
347
-
348
- __webpack_require__.r(__webpack_exports__);
349
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
350
- /* harmony export */ clsx: () => (/* binding */ clsx),
351
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
352
- /* harmony export */ });
353
- function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clsx);
354
-
355
- /***/ })
356
-
357
- /******/ });
358
- /************************************************************************/
359
- /******/ // The module cache
360
- /******/ var __webpack_module_cache__ = {};
361
- /******/
362
- /******/ // The require function
363
- /******/ function __webpack_require__(moduleId) {
364
- /******/ // Check if module is in cache
365
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
366
- /******/ if (cachedModule !== undefined) {
367
- /******/ return cachedModule.exports;
368
- /******/ }
369
- /******/ // Create a new module (and put it into the cache)
370
- /******/ var module = __webpack_module_cache__[moduleId] = {
371
- /******/ id: moduleId,
372
- /******/ // no module.loaded needed
373
- /******/ exports: {}
374
- /******/ };
375
- /******/
376
- /******/ // Execute the module function
377
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
378
- /******/
379
- /******/ // Return the exports of the module
380
- /******/ return module.exports;
381
- /******/ }
382
- /******/
383
- /************************************************************************/
384
- /******/ /* webpack/runtime/compat get default export */
385
- /******/ (() => {
386
- /******/ // getDefaultExport function for compatibility with non-harmony modules
387
- /******/ __webpack_require__.n = (module) => {
388
- /******/ var getter = module && module.__esModule ?
389
- /******/ () => (module['default']) :
390
- /******/ () => (module);
391
- /******/ __webpack_require__.d(getter, { a: getter });
392
- /******/ return getter;
393
- /******/ };
394
- /******/ })();
395
- /******/
396
- /******/ /* webpack/runtime/define property getters */
397
- /******/ (() => {
398
- /******/ // define getter functions for harmony exports
399
- /******/ __webpack_require__.d = (exports, definition) => {
400
- /******/ for(var key in definition) {
401
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
402
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
403
- /******/ }
404
- /******/ }
405
- /******/ };
406
- /******/ })();
407
- /******/
408
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
409
- /******/ (() => {
410
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
411
- /******/ })();
412
- /******/
413
- /******/ /* webpack/runtime/make namespace object */
414
- /******/ (() => {
415
- /******/ // define __esModule on exports
416
- /******/ __webpack_require__.r = (exports) => {
417
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
418
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
419
- /******/ }
420
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
421
- /******/ };
422
- /******/ })();
423
- /******/
424
- /************************************************************************/
425
- var __webpack_exports__ = {};
426
- /*!************************!*\
427
- !*** ./src/Swiper.tsx ***!
428
- \************************/
429
- __webpack_require__.r(__webpack_exports__);
430
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
431
- /* harmony export */ SWIPE_ON_EVENT_SPEED: () => (/* binding */ SWIPE_ON_EVENT_SPEED),
432
- /* harmony export */ SWIPE_TRANSITION_TIMEOUT: () => (/* binding */ SWIPE_TRANSITION_TIMEOUT),
433
- /* harmony export */ "default": () => (/* binding */ ReactSwiper)
434
- /* harmony export */ });
435
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
436
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
437
- /* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
438
- /* harmony import */ var _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Swiper.module.css */ "./src/Swiper.module.css");
439
- var __assign = (undefined && undefined.__assign) || function () {
440
- __assign = Object.assign || function(t) {
441
- for (var s, i = 1, n = arguments.length; i < n; i++) {
442
- s = arguments[i];
443
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
444
- t[p] = s[p];
445
- }
446
- return t;
447
- };
448
- return __assign.apply(this, arguments);
449
- };
450
- var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
451
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
452
- return new (P || (P = Promise))(function (resolve, reject) {
453
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
454
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
455
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
456
- step((generator = generator.apply(thisArg, _arguments || [])).next());
457
- });
458
- };
459
- var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
460
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
461
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
462
- function verb(n) { return function (v) { return step([n, v]); }; }
463
- function step(op) {
464
- if (f) throw new TypeError("Generator is already executing.");
465
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
466
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
467
- if (y = 0, t) op = [op[0] & 2, t.value];
468
- switch (op[0]) {
469
- case 0: case 1: t = op; break;
470
- case 4: _.label++; return { value: op[1], done: false };
471
- case 5: _.label++; y = op[1]; op = [0]; continue;
472
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
473
- default:
474
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
475
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
476
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
477
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
478
- if (t[2]) _.ops.pop();
479
- _.trys.pop(); continue;
480
- }
481
- op = body.call(thisArg, _);
482
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
483
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
484
- }
485
- };
486
- /******************************************************************************************
487
- * Repository: https://github.com/kolserdav/react-swiper.git
488
- * File name: Swiper.tsx
489
- * Author: Sergey Kolmiller
490
- * Email: <kolserdav@conhos.ru>
491
- * License: MIT
492
- * License text: The code is distributed as is. There are no guarantees regarding the functionality of the code or parts of it.
493
- * Copyright: kolserdav, All rights reserved (c)
494
- * Create Date: Fri Sep 06 2024 18:44:44 GMT+0700 (Krasnoyarsk Standard Time)
495
- ******************************************************************************************/
496
-
497
-
498
-
499
- /**
500
- * Time to miliseconds of change animation by card left value
501
- */
502
- var SWIPE_TRANSITION_TIMEOUT = 400;
503
- /**
504
- * Minimum swipe speed regardless of distance
505
- */
506
- var SWIPE_ON_EVENT_SPEED = 0.7;
507
- /**
508
- * Create swipe list from values
509
- */
510
- var getSwipes = function (prev, current, next, swipes) {
511
- if (((prev === null || prev === void 0 ? void 0 : prev.id) === (current === null || current === void 0 ? void 0 : current.id) || (current === null || current === void 0 ? void 0 : current.id) === (next === null || next === void 0 ? void 0 : next.id) || (next === null || next === void 0 ? void 0 : next.id) === (prev === null || prev === void 0 ? void 0 : prev.id)) &&
512
- swipes.length) {
513
- return swipes;
514
- }
515
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
516
- var result = [1, 2, 3].map(function (id) {
517
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
518
- var item = id === 1 ? __assign({}, prev) : id === 2 ? current : __assign({}, next);
519
- item.type = id === 1 ? 'prev' : id === 2 ? 'current' : 'next';
520
- return item;
521
- });
522
- return result;
523
- };
524
- /**
525
- * Get default swipe with random id
526
- */
527
- var getDefaultSwipe = function () { return ({
528
- id: Math.ceil(Math.random() * 1000),
529
- children: react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null),
530
- }); };
531
- var refs = {};
532
- var startClientX;
533
- var startClientY;
534
- var lastLeft;
535
- var animated = false;
536
- var _defaultCurrent;
537
- var oldSwipes = [];
538
- var startTime = new Date().getTime();
539
- /**
540
- * Swiper component
541
- */
542
- function ReactSwiper(props) {
543
- var _this = this;
544
- var defaultCurrent = props.defaultCurrent, getNext = props.getNext, getPrev = props.getPrev, onSwipe = props.onSwipe, className = props.className, invitationAnimation = props.invitationAnimation, durationAnimation = props.durationAnimation, blockSwipe = props.blockSwipe, dots = props.dots;
545
- var _a = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(), current = _a[0], setCurrent = _a[1];
546
- var _b = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(), prev = _b[0], setPrev = _b[1];
547
- var _c = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(), next = _c[0], setNext = _c[1];
548
- var _d = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(), prePrev = _d[0], setPrePrev = _d[1];
549
- var _e = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(), postNext = _e[0], setPostNext = _e[1];
550
- var _f = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), windowWidth = _f[0], setWindowWidth = _f[1];
551
- var _g = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), height = _g[0], setHeight = _g[1];
552
- var _h = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), width = _h[0], setWidth = _h[1];
553
- var _j = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), _left = _j[0], _setLeft = _j[1];
554
- var _k = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), left = _k[0], setLeft = _k[1];
555
- var _l = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(), isMobile = _l[0], setIsMobile = _l[1];
556
- var _m = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false), load = _m[0], setLoad = _m[1];
557
- var containerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
558
- if (typeof _defaultCurrent === 'undefined') {
559
- _defaultCurrent = defaultCurrent;
560
- }
561
- /**
562
- * Create memoized swipes
563
- */
564
- var swipes = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
565
- return getSwipes(prev || getDefaultSwipe(), current || defaultCurrent, next || getDefaultSwipe(), oldSwipes);
566
- }, [next, prev, current]);
567
- oldSwipes = swipes;
568
- /**
569
- * Get new or exists ref by id
570
- */
571
- var getRef = function (id) {
572
- refs[id] = refs[id] ? refs[id] : (0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)();
573
- return refs[id];
574
- };
575
- /**
576
- * Set to cards classes for in animation
577
- */
578
- var setGoClassHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
579
- return function (_next, _prev) {
580
- var _a, _b, _c;
581
- (_a = getRef((_next === null || _next === void 0 ? void 0 : _next.id) || (next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _a === void 0 ? void 0 : _a.classList.add(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].go);
582
- (_b = getRef((_prev === null || _prev === void 0 ? void 0 : _prev.id) || (prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _b === void 0 ? void 0 : _b.classList.add(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].go);
583
- (_c = getRef((current === null || current === void 0 ? void 0 : current.id) || 0).current) === null || _c === void 0 ? void 0 : _c.classList.add(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].go);
584
- setTimeout(function () {
585
- var _a, _b, _c;
586
- (_a = getRef((_next === null || _next === void 0 ? void 0 : _next.id) || (next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _a === void 0 ? void 0 : _a.classList.remove(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].go);
587
- (_b = getRef((_prev === null || _prev === void 0 ? void 0 : _prev.id) || (prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _b === void 0 ? void 0 : _b.classList.remove(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].go);
588
- (_c = getRef((current === null || current === void 0 ? void 0 : current.id) || 0).current) === null || _c === void 0 ? void 0 : _c.classList.remove(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].go);
589
- }, SWIPE_TRANSITION_TIMEOUT);
590
- };
591
- }, [current === null || current === void 0 ? void 0 : current.id, next === null || next === void 0 ? void 0 : next.id, prev === null || prev === void 0 ? void 0 : prev.id]);
592
- /**
593
- * Set to cards classes for out animation
594
- */
595
- var setBackClassHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () { return function () {
596
- var _a, _b, _c;
597
- (_a = getRef((next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _a === void 0 ? void 0 : _a.classList.add(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].back);
598
- (_b = getRef((prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _b === void 0 ? void 0 : _b.classList.add(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].back);
599
- (_c = getRef((current === null || current === void 0 ? void 0 : current.id) || 0).current) === null || _c === void 0 ? void 0 : _c.classList.add(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].back);
600
- setTimeout(function () {
601
- var _a, _b, _c;
602
- (_a = getRef((next === null || next === void 0 ? void 0 : next.id) || 0).current) === null || _a === void 0 ? void 0 : _a.classList.remove(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].back);
603
- (_b = getRef((prev === null || prev === void 0 ? void 0 : prev.id) || 0).current) === null || _b === void 0 ? void 0 : _b.classList.remove(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].back);
604
- (_c = getRef((current === null || current === void 0 ? void 0 : current.id) || 0).current) === null || _c === void 0 ? void 0 : _c.classList.remove(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].back);
605
- }, SWIPE_TRANSITION_TIMEOUT);
606
- }; }, [current === null || current === void 0 ? void 0 : current.id, next === null || next === void 0 ? void 0 : next.id, prev === null || prev === void 0 ? void 0 : prev.id]);
607
- /**
608
- * Wait helper
609
- */
610
- var wait = function (miliseconds) { return __awaiter(_this, void 0, void 0, function () {
611
- return __generator(this, function (_a) {
612
- switch (_a.label) {
613
- case 0: return [4 /*yield*/, new Promise(function (resolve) {
614
- setTimeout(function () {
615
- resolve(0);
616
- }, miliseconds);
617
- })];
618
- case 1:
619
- _a.sent();
620
- return [2 /*return*/];
621
- }
622
- });
623
- }); };
624
- /**
625
- * Set pre previos or post next values
626
- */
627
- var setPreValues = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
628
- return function (_p, _n) {
629
- if (_p) {
630
- getPrev((_p === null || _p === void 0 ? void 0 : _p.id) || 0).then(function (d) {
631
- setPrePrev(d);
632
- });
633
- }
634
- if (_n) {
635
- getNext((_n === null || _n === void 0 ? void 0 : _n.id) || 0).then(function (d) {
636
- setPostNext(d);
637
- });
638
- }
639
- };
640
- }, [getNext, getPrev]);
641
- var goSwipeBack = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () { return function () {
642
- setBackClassHandler();
643
- setLeft(0);
644
- setLoad(false);
645
- }; }, [setBackClassHandler, setLeft, setLoad]);
646
- var startSwipe = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () { return function (_next, _prev, _left) {
647
- setGoClassHandler(_next, _prev);
648
- setLeft(_left);
649
- }; }, [setGoClassHandler]);
650
- var endSwipe = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
651
- return function (_a) {
652
- var _prev = _a._prev, _current = _a._current, _next = _a._next;
653
- setLeft(0);
654
- setPrev(_prev);
655
- setCurrent(_current);
656
- setNext(_next);
657
- };
658
- }, []);
659
- var goSwipe = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
660
- return function (_a, _next_1, _prev_1) { return __awaiter(_this, [_a, _next_1, _prev_1], void 0, function (_b, _next, _prev) {
661
- var newNext = _b.newNext, newPrev = _b.newPrev, coeff = _b.coeff;
662
- return __generator(this, function (_c) {
663
- switch (_c.label) {
664
- case 0:
665
- if ((_next === null || _next === void 0 ? void 0 : _next.id) === null || (_prev === null || _prev === void 0 ? void 0 : _prev.id) === null) {
666
- goSwipeBack();
667
- return [2 /*return*/, 1];
668
- }
669
- if (onSwipe !== undefined) {
670
- onSwipe((_next === null || _next === void 0 ? void 0 : _next.id) || (_prev === null || _prev === void 0 ? void 0 : _prev.id));
671
- }
672
- startSwipe(_next, _prev, windowWidth * coeff);
673
- return [4 /*yield*/, wait(SWIPE_TRANSITION_TIMEOUT)];
674
- case 1:
675
- _c.sent();
676
- endSwipe({ _prev: newPrev, _current: _next || _prev, _next: newNext });
677
- return [2 /*return*/, 0];
678
- }
679
- });
680
- }); };
681
- }, [endSwipe, goSwipeBack, onSwipe, startSwipe, windowWidth]);
682
- /**
683
- * Run swipe animation
684
- */
685
- var swipe = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
686
- return function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
687
- var _lastLeft = _b._lastLeft, _next = _b._next, _prev = _b._prev, speed = _b.speed;
688
- return __generator(this, function (_c) {
689
- switch (_c.label) {
690
- case 0:
691
- setLoad(true);
692
- if (!(Math.abs(_lastLeft) > width / 3 ||
693
- (speed !== undefined && speed > SWIPE_ON_EVENT_SPEED))) return [3 /*break*/, 5];
694
- if (!(_lastLeft < 0)) return [3 /*break*/, 2];
695
- return [4 /*yield*/, goSwipe({ newPrev: current, newNext: postNext, coeff: -1 }, _next, undefined)];
696
- case 1:
697
- _c.sent();
698
- return [3 /*break*/, 4];
699
- case 2: return [4 /*yield*/, goSwipe({ newPrev: prePrev, newNext: current, coeff: 1 }, undefined, _prev)];
700
- case 3:
701
- _c.sent();
702
- _c.label = 4;
703
- case 4: return [3 /*break*/, 6];
704
- case 5:
705
- goSwipeBack();
706
- _c.label = 6;
707
- case 6:
708
- setLoad(false);
709
- return [2 /*return*/, 0];
710
- }
711
- });
712
- }); };
713
- }, [current, goSwipeBack, width, prePrev, postNext, goSwipe]);
714
- /**
715
- * Touch event handler
716
- */
717
- var onTouchHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
718
- return function (name, e) { return __awaiter(_this, void 0, void 0, function () {
719
- var touches, clientX, clientY, absX, absY, _a;
720
- var _b, _c;
721
- return __generator(this, function (_d) {
722
- switch (_d.label) {
723
- case 0:
724
- touches = e.touches;
725
- clientX = (_b = touches[0]) === null || _b === void 0 ? void 0 : _b.clientX;
726
- clientY = (_c = touches[0]) === null || _c === void 0 ? void 0 : _c.clientY;
727
- startClientX = startClientX || 0;
728
- startClientY = startClientY || 0;
729
- absX = 0;
730
- absY = 0;
731
- _a = name;
732
- switch (_a) {
733
- case 'onTouchStart': return [3 /*break*/, 1];
734
- case 'onTouchMove': return [3 /*break*/, 2];
735
- case 'onTouchEnd': return [3 /*break*/, 3];
736
- }
737
- return [3 /*break*/, 6];
738
- case 1:
739
- startClientX = clientX;
740
- startClientY = clientY;
741
- lastLeft = _left;
742
- startTime = new Date().getTime();
743
- return [3 /*break*/, 6];
744
- case 2:
745
- if (!blockSwipe) {
746
- absY = Math.abs(startClientY - clientY);
747
- absX = Math.abs(startClientX - clientX);
748
- if (absX > absY) {
749
- lastLeft = _left - (startClientX - clientX);
750
- setLeft(lastLeft);
751
- }
752
- }
753
- return [3 /*break*/, 6];
754
- case 3:
755
- if (!!blockSwipe) return [3 /*break*/, 5];
756
- return [4 /*yield*/, swipe({
757
- _lastLeft: lastLeft,
758
- speed: Math.abs(lastLeft / (new Date().getTime() - startTime)),
759
- _next: next,
760
- _prev: prev,
761
- })];
762
- case 4:
763
- _d.sent();
764
- _d.label = 5;
765
- case 5: return [3 /*break*/, 6];
766
- case 6: return [2 /*return*/];
767
- }
768
- });
769
- }); };
770
- }, [_left, blockSwipe, swipe, next, prev]);
771
- /**
772
- * Touch event wrapper
773
- */
774
- var onTouchWrapper = function (name) {
775
- return function (e) {
776
- onTouchHandler(name, e);
777
- };
778
- };
779
- /**
780
- * On next or previous button click handler
781
- */
782
- var clickHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
783
- return function (origin) {
784
- var isNext = origin === 'next';
785
- return function () { return __awaiter(_this, void 0, void 0, function () {
786
- var coeff, leftVal;
787
- return __generator(this, function (_a) {
788
- switch (_a.label) {
789
- case 0:
790
- coeff = isNext ? -1 : 1;
791
- leftVal = width * coeff;
792
- if (isNext) {
793
- setGoClassHandler();
794
- }
795
- else {
796
- setBackClassHandler();
797
- }
798
- return [4 /*yield*/, wait(SWIPE_TRANSITION_TIMEOUT)];
799
- case 1:
800
- _a.sent();
801
- return [4 /*yield*/, swipe({
802
- _lastLeft: leftVal,
803
- _next: next,
804
- _prev: prev,
805
- })];
806
- case 2:
807
- _a.sent();
808
- return [2 /*return*/, 0];
809
- }
810
- });
811
- }); };
812
- };
813
- }, [setBackClassHandler, setGoClassHandler, swipe, width, next, prev]);
814
- /**
815
- * Wrapper for next button click handler
816
- */
817
- var clickNextHandler = clickHandler('next');
818
- /**
819
- * Wrapper for previous button click handler
820
- */
821
- var clickPrevHandler = clickHandler('prev');
822
- /**
823
- * optional animation handler
824
- */
825
- var infitationAnimationHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
826
- return function (shift) { return __awaiter(_this, void 0, void 0, function () {
827
- return __generator(this, function (_a) {
828
- switch (_a.label) {
829
- case 0:
830
- if (shift < 0) {
831
- setGoClassHandler();
832
- }
833
- else {
834
- setBackClassHandler();
835
- }
836
- setLeft(shift);
837
- return [4 /*yield*/, wait(SWIPE_TRANSITION_TIMEOUT)];
838
- case 1:
839
- _a.sent();
840
- if (shift < 0) {
841
- setBackClassHandler();
842
- }
843
- else {
844
- setGoClassHandler();
845
- }
846
- setLeft(0);
847
- return [4 /*yield*/, wait(SWIPE_TRANSITION_TIMEOUT)];
848
- case 2:
849
- _a.sent();
850
- return [2 /*return*/];
851
- }
852
- });
853
- }); };
854
- }, [setBackClassHandler, setGoClassHandler]);
855
- /**
856
- * Initial start cards
857
- */
858
- var setStartCards = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () { return function () { return __awaiter(_this, void 0, void 0, function () {
859
- var _n, _p;
860
- return __generator(this, function (_a) {
861
- switch (_a.label) {
862
- case 0: return [4 /*yield*/, getNext(defaultCurrent.id || 0)];
863
- case 1:
864
- _n = _a.sent();
865
- return [4 /*yield*/, getPrev(defaultCurrent.id || 0)];
866
- case 2:
867
- _p = _a.sent();
868
- setCurrent(defaultCurrent);
869
- setPrev(_p);
870
- setNext(_n);
871
- _defaultCurrent = defaultCurrent;
872
- setLoad(false);
873
- return [2 /*return*/];
874
- }
875
- });
876
- }); }; }, [defaultCurrent, getNext, getPrev]);
877
- /**
878
- * Invitation animation
879
- */
880
- var startInvitationAnimation = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
881
- return function (prev, next) { return __awaiter(_this, void 0, void 0, function () {
882
- return __generator(this, function (_a) {
883
- switch (_a.label) {
884
- case 0:
885
- if (!prev.id) return [3 /*break*/, 2];
886
- return [4 /*yield*/, infitationAnimationHandler(windowWidth / 5.5)];
887
- case 1:
888
- _a.sent();
889
- _a.label = 2;
890
- case 2:
891
- if (!next.id) return [3 /*break*/, 4];
892
- return [4 /*yield*/, infitationAnimationHandler((windowWidth / 5.5) * -1)];
893
- case 3:
894
- _a.sent();
895
- _a.label = 4;
896
- case 4: return [2 /*return*/];
897
- }
898
- });
899
- }); };
900
- }, [infitationAnimationHandler, windowWidth]);
901
- /**
902
- * Handler on click by dot
903
- */
904
- var clickDotHandler = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () { return function (e) { return __awaiter(_this, void 0, void 0, function () {
905
- var target, tabindex, active, currentId, newCurrent, newPrev, newNext;
906
- return __generator(this, function (_a) {
907
- switch (_a.label) {
908
- case 0:
909
- target = e.target;
910
- tabindex = target === null || target === void 0 ? void 0 : target.getAttribute('tabindex');
911
- active = parseInt(tabindex, 10);
912
- currentId = (current === null || current === void 0 ? void 0 : current.id) || 0;
913
- if (!(currentId === (next === null || next === void 0 ? void 0 : next.id))) return [3 /*break*/, 1];
914
- newCurrent = next;
915
- newNext = postNext;
916
- newPrev = current;
917
- return [3 /*break*/, 10];
918
- case 1:
919
- if (!(currentId === (prev === null || prev === void 0 ? void 0 : prev.id))) return [3 /*break*/, 2];
920
- newCurrent = prev;
921
- newNext = current;
922
- newPrev = prePrev;
923
- return [3 /*break*/, 10];
924
- case 2:
925
- if (!(currentId === (prePrev === null || prePrev === void 0 ? void 0 : prePrev.id))) return [3 /*break*/, 4];
926
- newCurrent = prePrev;
927
- newNext = prev;
928
- return [4 /*yield*/, getPrev(prePrev === null || prePrev === void 0 ? void 0 : prePrev.id)];
929
- case 3:
930
- newPrev = _a.sent();
931
- return [3 /*break*/, 10];
932
- case 4:
933
- if (!(currentId === (postNext === null || postNext === void 0 ? void 0 : postNext.id))) return [3 /*break*/, 6];
934
- newCurrent = postNext;
935
- newPrev = next;
936
- return [4 /*yield*/, getPrev(postNext === null || postNext === void 0 ? void 0 : postNext.id)];
937
- case 5:
938
- newNext = _a.sent();
939
- return [3 /*break*/, 10];
940
- case 6: return [4 /*yield*/, getNext(active - 1)];
941
- case 7:
942
- newCurrent = _a.sent();
943
- return [4 /*yield*/, getNext((newCurrent === null || newCurrent === void 0 ? void 0 : newCurrent.id) || 0)];
944
- case 8:
945
- newNext = _a.sent();
946
- return [4 /*yield*/, getPrev((newCurrent === null || newCurrent === void 0 ? void 0 : newCurrent.id) || 0)];
947
- case 9:
948
- newPrev = _a.sent();
949
- _a.label = 10;
950
- case 10:
951
- if (!(currentId < active)) return [3 /*break*/, 12];
952
- return [4 /*yield*/, goSwipe({ newPrev: newPrev, newNext: newNext, coeff: -1 }, newCurrent, undefined)];
953
- case 11:
954
- _a.sent();
955
- return [3 /*break*/, 14];
956
- case 12: return [4 /*yield*/, goSwipe({ newPrev: newPrev, newNext: newNext, coeff: 1 }, undefined, newCurrent)];
957
- case 13:
958
- _a.sent();
959
- _a.label = 14;
960
- case 14: return [2 /*return*/];
961
- }
962
- });
963
- }); }; }, [getNext, getPrev, goSwipe, current, next, postNext, prePrev, prev]);
964
- /**
965
- * Set button listeners
966
- */
967
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
968
- var _a, _b;
969
- var buttonNext = (_a = current === null || current === void 0 ? void 0 : current.nextRef) === null || _a === void 0 ? void 0 : _a.current;
970
- var buttonClose = (_b = current === null || current === void 0 ? void 0 : current.closeRef) === null || _b === void 0 ? void 0 : _b.current;
971
- buttonNext === null || buttonNext === void 0 ? void 0 : buttonNext.addEventListener('click', clickNextHandler);
972
- buttonClose === null || buttonClose === void 0 ? void 0 : buttonClose.addEventListener('click', clickNextHandler);
973
- return function () {
974
- buttonNext === null || buttonNext === void 0 ? void 0 : buttonNext.removeEventListener('click', clickNextHandler);
975
- buttonClose === null || buttonClose === void 0 ? void 0 : buttonClose.removeEventListener('click', clickNextHandler);
976
- };
977
- }, [clickNextHandler, current]);
978
- /**
979
- * Set width and height
980
- */
981
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
982
- var _a, _b, _c, _d, _e, _f;
983
- var _width = (_c = (_b = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) === null || _c === void 0 ? void 0 : _c.width;
984
- var _height = (_f = (_e = (_d = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _d === void 0 ? void 0 : _d.parentElement) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect()) === null || _f === void 0 ? void 0 : _f.height;
985
- if (_width && !width && _height && !height) {
986
- setWidth(_width);
987
- setHeight(_height);
988
- }
989
- }, [containerRef, width, height]);
990
- /**
991
- * Save container left
992
- */
993
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
994
- var _a, _b, _c;
995
- var __left = (_c = (_b = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) === null || _c === void 0 ? void 0 : _c.left;
996
- if (__left && !left) {
997
- _setLeft(__left);
998
- }
999
- }, [containerRef, left]);
1000
- /**
1001
- * Auto slide
1002
- */
1003
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1004
- var clearAnimate;
1005
- if (durationAnimation) {
1006
- clearAnimate = setInterval(function () {
1007
- clickNextHandler();
1008
- }, durationAnimation);
1009
- }
1010
- return function () {
1011
- if (clearAnimate) {
1012
- clearInterval(clearAnimate);
1013
- }
1014
- };
1015
- }, [durationAnimation, clickNextHandler]);
1016
- /**
1017
- * Set start cards
1018
- */
1019
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1020
- if (!current || !prev || !next || _defaultCurrent !== defaultCurrent) {
1021
- setStartCards();
1022
- }
1023
- }, [current, next, prev, defaultCurrent, setStartCards]);
1024
- /**
1025
- * Save window width
1026
- */
1027
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1028
- var _windowWidth = document.body.clientWidth;
1029
- if (!windowWidth && _windowWidth) {
1030
- setWindowWidth(_windowWidth);
1031
- }
1032
- }, [windowWidth]);
1033
- /**
1034
- * Run invitation animation
1035
- */
1036
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1037
- if (invitationAnimation && width && !animated) {
1038
- if (prev && next) {
1039
- animated = true;
1040
- startInvitationAnimation(prev, next);
1041
- }
1042
- }
1043
- }, [invitationAnimation, next, prev, startInvitationAnimation, width]);
1044
- /**
1045
- * Listen resize
1046
- */
1047
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1048
- var resizeHandler = function () {
1049
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1050
- var _width = (_c = (_b = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) === null || _c === void 0 ? void 0 : _c.width;
1051
- var _height = (_f = (_e = (_d = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _d === void 0 ? void 0 : _d.parentElement) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect()) === null || _f === void 0 ? void 0 : _f.height;
1052
- var __left = (_j = (_h = (_g = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _g === void 0 ? void 0 : _g.parentElement) === null || _h === void 0 ? void 0 : _h.getBoundingClientRect()) === null || _j === void 0 ? void 0 : _j.left;
1053
- var _windowWidth = document.body.clientWidth;
1054
- if (_width && _height) {
1055
- setWidth(_width);
1056
- setHeight(_height);
1057
- }
1058
- if (__left) {
1059
- setLeft(__left);
1060
- }
1061
- if (_windowWidth) {
1062
- setWindowWidth(_windowWidth);
1063
- }
1064
- };
1065
- window.addEventListener('resize', resizeHandler);
1066
- return function () {
1067
- window.removeEventListener('resize', resizeHandler);
1068
- };
1069
- }, []);
1070
- /**
1071
- * Set is mobile
1072
- */
1073
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1074
- if (typeof isMobile === 'undefined') {
1075
- // @ts-ignore
1076
- setIsMobile('ontouchstart' in window || typeof (navigator === null || navigator === void 0 ? void 0 : navigator.msMaxTouchPoints) !== 'undefined');
1077
- }
1078
- }, [isMobile]);
1079
- /**
1080
- * Set pre values
1081
- */
1082
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1083
- setPreValues(prev, next);
1084
- }, [prev, next, setPreValues]);
1085
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].container, ref: containerRef },
1086
- swipes.map(function (item) {
1087
- var _a;
1088
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, { key: item.id },
1089
- item.id !== null && item.children !== null && width && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { onTouchMove: onTouchWrapper('onTouchMove'), onTouchStart: onTouchWrapper('onTouchStart'), onTouchEnd: onTouchWrapper('onTouchEnd'), id: (_a = item.id) === null || _a === void 0 ? void 0 : _a.toString(), style: item.type === 'current'
1090
- ? { width: width, height: height, left: left }
1091
- : item.type === 'prev'
1092
- ? { width: width, height: height, left: left - window.innerWidth }
1093
- : { width: width, height: height, left: left + window.innerWidth }, className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].card, item.type === 'prev' ? _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].prev : item.type === 'next' ? _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].next : ''), ref: getRef(item.id) },
1094
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].content, className) }, item.children))),
1095
- item.id === null && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { style: item.type === 'current'
1096
- ? { width: width, height: height, left: left }
1097
- : item.type === 'prev'
1098
- ? { width: width, height: height, left: left - windowWidth }
1099
- : { width: width, height: height, left: left + windowWidth }, className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].card, item.type === 'prev' ? _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].prev : item.type === 'next' ? _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].next : '') },
1100
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000" },
1101
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
1102
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z" }))))));
1103
- }),
1104
- typeof isMobile !== 'undefined' && !isMobile && (prev === null || prev === void 0 ? void 0 : prev.id) !== null && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].button, _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].button__prev) },
1105
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].icon__button, type: "button", disabled: load || isMobile, onClick: clickPrevHandler },
1106
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000" },
1107
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
1108
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M10.02 6L8.61 7.41 13.19 12l-4.58 4.59L10.02 18l6-6-6-6z" }))))),
1109
- typeof isMobile !== 'undefined' && !isMobile && (next === null || next === void 0 ? void 0 : next.id) !== null && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].button, _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].button__next) },
1110
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].icon__button, type: "button", disabled: load || isMobile, onClick: clickNextHandler },
1111
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000" },
1112
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
1113
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M10.02 6L8.61 7.41 13.19 12l-4.58 4.59L10.02 18l6-6-6-6z" }))))),
1114
- dots && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].dots }, dots.list.map(function (item) { return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { role: "button", onClick: clickDotHandler, tabIndex: item, key: item, className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])(_Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].dot, (current === null || current === void 0 ? void 0 : current.id) === item ? _Swiper_module_css__WEBPACK_IMPORTED_MODULE_2__["default"].active : '') })); })))));
1115
- }
1116
- ;
1117
-
1118
- /******/ return __webpack_exports__;
1119
- /******/ })()
1120
- ;
1121
- });
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactSwiper=t(require("react")):e.ReactSwiper=t(e.react)}(this,(e=>(()=>{"use strict";var t={155:t=>{t.exports=e}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var u=n[e]={exports:{}};return t[e](u,u.exports,i),u.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};i.r(r),i.d(r,{SWIPE_ON_EVENT_SPEED:()=>b,SWIPE_TRANSITION_TIMEOUT:()=>w,default:()=>_});var u={};i.r(u);var o=i(155),l=i.n(o);function c(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=c(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}const d=function(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=c(e))&&(i&&(i+=" "),i+=t);return i};var a,s,v,f,h=function(){return h=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},h.apply(this,arguments)},p=function(e,t,n,i){return new(n||(n=Promise))((function(r,u){function o(e){try{c(i.next(e))}catch(e){u(e)}}function l(e){try{c(i.throw(e))}catch(e){u(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}c((i=i.apply(e,t||[])).next())}))},m=function(e,t){var n,i,r,u,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return u={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&l[0]?i.return:l[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;switch(i=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,i=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){o.label=l[1];break}if(6===l[0]&&o.label<r[1]){o.label=r[1],r=l;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(l);break}r[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],i=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}},w=400,b=.7,g=function(e,t,n,i){return(null==e?void 0:e.id)!==(null==t?void 0:t.id)&&(null==t?void 0:t.id)!==(null==n?void 0:n.id)&&(null==n?void 0:n.id)!==(null==e?void 0:e.id)||!i.length?[1,2,3].map((function(i){var r=1===i?h({},e):2===i?t:h({},n);return r.type=1===i?"prev":2===i?"current":"next",r})):i},E=function(){return{id:Math.ceil(1e3*Math.random()),children:l().createElement("div",null)}},y={},x=!1,M=[],S=(new Date).getTime();function _(e){var t=this,n=e.defaultCurrent,i=e.getNext,r=e.getPrev,c=e.onSwipe,h=e.className,_=e.invitationAnimation,L=e.durationAnimation,T=e.blockSwipe,N=e.dots,k=(0,o.useState)(),P=k[0],C=k[1],R=(0,o.useState)(),O=R[0],j=R[1],z=(0,o.useState)(),B=z[0],I=z[1],A=(0,o.useState)(),W=A[0],D=A[1],V=(0,o.useState)(),H=V[0],q=V[1],F=(0,o.useState)(0),G=F[0],U=F[1],X=(0,o.useState)(0),Y=X[0],J=X[1],K=(0,o.useState)(0),Q=K[0],Z=K[1],$=(0,o.useState)(0),ee=$[0],te=$[1],ne=(0,o.useState)(0),ie=ne[0],re=ne[1],ue=(0,o.useState)(),oe=ue[0],le=ue[1],ce=(0,o.useState)(!1),de=ce[0],ae=ce[1],se=(0,o.useRef)(null);void 0===f&&(f=n);var ve=(0,o.useMemo)((function(){return g(O||E(),P||n,B||E(),M)}),[B,O,P]);M=ve;var fe=function(e){return y[e]=y[e]?y[e]:(0,o.createRef)(),y[e]},he=(0,o.useMemo)((function(){return function(e,t){var n,i,r;null===(n=fe((null==e?void 0:e.id)||(null==B?void 0:B.id)||0).current)||void 0===n||n.classList.add(u.default.go),null===(i=fe((null==t?void 0:t.id)||(null==O?void 0:O.id)||0).current)||void 0===i||i.classList.add(u.default.go),null===(r=fe((null==P?void 0:P.id)||0).current)||void 0===r||r.classList.add(u.default.go),setTimeout((function(){var n,i,r;null===(n=fe((null==e?void 0:e.id)||(null==B?void 0:B.id)||0).current)||void 0===n||n.classList.remove(u.default.go),null===(i=fe((null==t?void 0:t.id)||(null==O?void 0:O.id)||0).current)||void 0===i||i.classList.remove(u.default.go),null===(r=fe((null==P?void 0:P.id)||0).current)||void 0===r||r.classList.remove(u.default.go)}),w)}}),[null==P?void 0:P.id,null==B?void 0:B.id,null==O?void 0:O.id]),pe=(0,o.useMemo)((function(){return function(){var e,t,n;null===(e=fe((null==B?void 0:B.id)||0).current)||void 0===e||e.classList.add(u.default.back),null===(t=fe((null==O?void 0:O.id)||0).current)||void 0===t||t.classList.add(u.default.back),null===(n=fe((null==P?void 0:P.id)||0).current)||void 0===n||n.classList.add(u.default.back),setTimeout((function(){var e,t,n;null===(e=fe((null==B?void 0:B.id)||0).current)||void 0===e||e.classList.remove(u.default.back),null===(t=fe((null==O?void 0:O.id)||0).current)||void 0===t||t.classList.remove(u.default.back),null===(n=fe((null==P?void 0:P.id)||0).current)||void 0===n||n.classList.remove(u.default.back)}),w)}}),[null==P?void 0:P.id,null==B?void 0:B.id,null==O?void 0:O.id]),me=function(e){return p(t,void 0,void 0,(function(){return m(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t){setTimeout((function(){t(0)}),e)}))];case 1:return t.sent(),[2]}}))}))},we=(0,o.useMemo)((function(){return function(e,t){e&&r((null==e?void 0:e.id)||0).then((function(e){D(e)})),t&&i((null==t?void 0:t.id)||0).then((function(e){q(e)}))}}),[i,r]),be=(0,o.useMemo)((function(){return function(){pe(),re(0),ae(!1)}}),[pe,re,ae]),ge=(0,o.useMemo)((function(){return function(e,t,n){he(e,t),re(n)}}),[he]),Ee=(0,o.useMemo)((function(){return function(e){var t=e._prev,n=e._current,i=e._next;re(0),j(t),C(n),I(i)}}),[]),ye=(0,o.useMemo)((function(){return function(e,n,i){return p(t,[e,n,i],void 0,(function(e,t,n){var i=e.newNext,r=e.newPrev,u=e.coeff;return m(this,(function(e){switch(e.label){case 0:return null===(null==t?void 0:t.id)||null===(null==n?void 0:n.id)?(be(),[2,1]):(void 0!==c&&c((null==t?void 0:t.id)||(null==n?void 0:n.id)),ge(t,n,G*u),[4,me(w)]);case 1:return e.sent(),Ee({_prev:r,_current:t||n,_next:i}),[2,0]}}))}))}}),[Ee,be,c,ge,G]),xe=(0,o.useMemo)((function(){return function(e){return p(t,[e],void 0,(function(e){var t=e._lastLeft,n=e._next,i=e._prev,r=e.speed;return m(this,(function(e){switch(e.label){case 0:return ae(!0),Math.abs(t)>Q/3||void 0!==r&&r>b?t<0?[4,ye({newPrev:P,newNext:H,coeff:-1},n,void 0)]:[3,2]:[3,5];case 1:return e.sent(),[3,4];case 2:return[4,ye({newPrev:W,newNext:P,coeff:1},void 0,i)];case 3:e.sent(),e.label=4;case 4:return[3,6];case 5:be(),e.label=6;case 6:return ae(!1),[2,0]}}))}))}}),[P,be,Q,W,H,ye]),Me=(0,o.useMemo)((function(){return function(e,n){return p(t,void 0,void 0,(function(){var t,i,r,u,o,l;return m(this,(function(c){switch(c.label){case 0:switch(t=n.touches,i=null===(o=t[0])||void 0===o?void 0:o.clientX,r=null===(l=t[0])||void 0===l?void 0:l.clientY,a=a||0,s=s||0,u=0,e){case"onTouchStart":return[3,1];case"onTouchMove":return[3,2];case"onTouchEnd":return[3,3]}return[3,6];case 1:return a=i,s=r,v=ee,S=(new Date).getTime(),[3,6];case 2:return T||(u=Math.abs(s-r),Math.abs(a-i)>u&&re(v=ee-(a-i))),[3,6];case 3:return T?[3,5]:[4,xe({_lastLeft:v,speed:Math.abs(v/((new Date).getTime()-S)),_next:B,_prev:O})];case 4:c.sent(),c.label=5;case 5:return[3,6];case 6:return[2]}}))}))}}),[ee,T,xe,B,O]),Se=function(e){return function(t){Me(e,t)}},_e=(0,o.useMemo)((function(){return function(e){var n="next"===e;return function(){return p(t,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return e=Q*(n?-1:1),n?he():pe(),[4,me(w)];case 1:return t.sent(),[4,xe({_lastLeft:e,_next:B,_prev:O})];case 2:return t.sent(),[2,0]}}))}))}}}),[pe,he,xe,Q,B,O]),Le=_e("next"),Te=_e("prev"),Ne=(0,o.useMemo)((function(){return function(e){return p(t,void 0,void 0,(function(){return m(this,(function(t){switch(t.label){case 0:return e<0?he():pe(),re(e),[4,me(w)];case 1:return t.sent(),e<0?pe():he(),re(0),[4,me(w)];case 2:return t.sent(),[2]}}))}))}}),[pe,he]),ke=(0,o.useMemo)((function(){return function(){return p(t,void 0,void 0,(function(){var e,t;return m(this,(function(u){switch(u.label){case 0:return[4,i(n.id||0)];case 1:return e=u.sent(),[4,r(n.id||0)];case 2:return t=u.sent(),C(n),j(t),I(e),f=n,ae(!1),[2]}}))}))}}),[n,i,r]),Pe=(0,o.useMemo)((function(){return function(e,n){return p(t,void 0,void 0,(function(){return m(this,(function(t){switch(t.label){case 0:return e.id?[4,Ne(G/5.5)]:[3,2];case 1:t.sent(),t.label=2;case 2:return n.id?[4,Ne(G/5.5*-1)]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))}}),[Ne,G]),Ce=(0,o.useMemo)((function(){return function(e){return p(t,void 0,void 0,(function(){var t,n,u,o,l,c,d;return m(this,(function(a){switch(a.label){case 0:return t=e.target,n=null==t?void 0:t.getAttribute("tabindex"),u=parseInt(n,10),(o=(null==P?void 0:P.id)||0)!==(null==B?void 0:B.id)?[3,1]:(l=B,d=H,c=P,[3,10]);case 1:return o!==(null==O?void 0:O.id)?[3,2]:(l=O,d=P,c=W,[3,10]);case 2:return o!==(null==W?void 0:W.id)?[3,4]:(l=W,d=O,[4,r(null==W?void 0:W.id)]);case 3:return c=a.sent(),[3,10];case 4:return o!==(null==H?void 0:H.id)?[3,6]:(l=H,c=B,[4,r(null==H?void 0:H.id)]);case 5:return d=a.sent(),[3,10];case 6:return[4,i(u-1)];case 7:return l=a.sent(),[4,i((null==l?void 0:l.id)||0)];case 8:return d=a.sent(),[4,r((null==l?void 0:l.id)||0)];case 9:c=a.sent(),a.label=10;case 10:return o<u?[4,ye({newPrev:c,newNext:d,coeff:-1},l,void 0)]:[3,12];case 11:return a.sent(),[3,14];case 12:return[4,ye({newPrev:c,newNext:d,coeff:1},void 0,l)];case 13:a.sent(),a.label=14;case 14:return[2]}}))}))}}),[i,r,ye,P,B,H,W,O]);return(0,o.useEffect)((function(){var e,t,n=null===(e=null==P?void 0:P.nextRef)||void 0===e?void 0:e.current,i=null===(t=null==P?void 0:P.closeRef)||void 0===t?void 0:t.current;return null==n||n.addEventListener("click",Le),null==i||i.addEventListener("click",Le),function(){null==n||n.removeEventListener("click",Le),null==i||i.removeEventListener("click",Le)}}),[Le,P]),(0,o.useEffect)((function(){var e,t,n,i,r,u,o=null===(n=null===(t=null===(e=null==se?void 0:se.current)||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.getBoundingClientRect())||void 0===n?void 0:n.width,l=null===(u=null===(r=null===(i=null==se?void 0:se.current)||void 0===i?void 0:i.parentElement)||void 0===r?void 0:r.getBoundingClientRect())||void 0===u?void 0:u.height;o&&!Q&&l&&!Y&&(Z(o),J(l))}),[se,Q,Y]),(0,o.useEffect)((function(){var e,t,n,i=null===(n=null===(t=null===(e=null==se?void 0:se.current)||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.getBoundingClientRect())||void 0===n?void 0:n.left;i&&!ie&&te(i)}),[se,ie]),(0,o.useEffect)((function(){var e;return L&&(e=setInterval((function(){Le()}),L)),function(){e&&clearInterval(e)}}),[L,Le]),(0,o.useEffect)((function(){P&&O&&B&&f===n||ke()}),[P,B,O,n,ke]),(0,o.useEffect)((function(){var e=document.body.clientWidth;!G&&e&&U(e)}),[G]),(0,o.useEffect)((function(){_&&Q&&!x&&O&&B&&(x=!0,Pe(O,B))}),[_,B,O,Pe,Q]),(0,o.useEffect)((function(){var e=function(){var e,t,n,i,r,u,o,l,c,d=null===(n=null===(t=null===(e=null==se?void 0:se.current)||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.getBoundingClientRect())||void 0===n?void 0:n.width,a=null===(u=null===(r=null===(i=null==se?void 0:se.current)||void 0===i?void 0:i.parentElement)||void 0===r?void 0:r.getBoundingClientRect())||void 0===u?void 0:u.height,s=null===(c=null===(l=null===(o=null==se?void 0:se.current)||void 0===o?void 0:o.parentElement)||void 0===l?void 0:l.getBoundingClientRect())||void 0===c?void 0:c.left,v=document.body.clientWidth;d&&a&&(Z(d),J(a)),s&&re(s),v&&U(v)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),(0,o.useEffect)((function(){void 0===oe&&le("ontouchstart"in window||void 0!==(null===navigator||void 0===navigator?void 0:navigator.msMaxTouchPoints))}),[oe]),(0,o.useEffect)((function(){we(O,B)}),[O,B,we]),l().createElement("div",{className:u.default.container,ref:se},ve.map((function(e){var t;return l().createElement(o.Fragment,{key:e.id},null!==e.id&&null!==e.children&&Q&&l().createElement("div",{onTouchMove:Se("onTouchMove"),onTouchStart:Se("onTouchStart"),onTouchEnd:Se("onTouchEnd"),id:null===(t=e.id)||void 0===t?void 0:t.toString(),style:"current"===e.type?{width:Q,height:Y,left:ie}:"prev"===e.type?{width:Q,height:Y,left:ie-window.innerWidth}:{width:Q,height:Y,left:ie+window.innerWidth},className:d(u.default.card,"prev"===e.type?u.default.prev:"next"===e.type?u.default.next:""),ref:fe(e.id)},l().createElement("div",{className:d(u.default.content,h)},e.children)),null===e.id&&l().createElement("div",{style:"current"===e.type?{width:Q,height:Y,left:ie}:"prev"===e.type?{width:Q,height:Y,left:ie-G}:{width:Q,height:Y,left:ie+G},className:d(u.default.card,"prev"===e.type?u.default.prev:"next"===e.type?u.default.next:"")},l().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},l().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l().createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}))))})),void 0!==oe&&!oe&&null!==(null==O?void 0:O.id)&&l().createElement("div",{className:d(u.default.button,u.default.button__prev)},l().createElement("button",{className:u.default.icon__button,type:"button",disabled:de||oe,onClick:Te},l().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},l().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l().createElement("path",{d:"M10.02 6L8.61 7.41 13.19 12l-4.58 4.59L10.02 18l6-6-6-6z"})))),void 0!==oe&&!oe&&null!==(null==B?void 0:B.id)&&l().createElement("div",{className:d(u.default.button,u.default.button__next)},l().createElement("button",{className:u.default.icon__button,type:"button",disabled:de||oe,onClick:Le},l().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},l().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l().createElement("path",{d:"M10.02 6L8.61 7.41 13.19 12l-4.58 4.59L10.02 18l6-6-6-6z"})))),N&&l().createElement("div",{className:u.default.dots},N.list.map((function(e){return l().createElement("div",{role:"button",onClick:Ce,tabIndex:e,key:e,className:d(u.default.dot,(null==P?void 0:P.id)===e?u.default.active:"")})}))))}return r})()));
1122
2
  //# sourceMappingURL=Swiper.js.map