swiper_angular.mjs 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326
  1. import * as i0 from '@angular/core';
  2. import { Directive, Input, EventEmitter, PLATFORM_ID, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Output, ViewChild, ContentChildren, HostBinding, NgModule } from '@angular/core';
  3. import * as i1 from '@angular/common';
  4. import { isPlatformBrowser, CommonModule } from '@angular/common';
  5. import Swiper from 'swiper';
  6. import { Subject, of } from 'rxjs';
  7. /* underscore in name -> watch for changes */
  8. const paramsList = [
  9. 'init',
  10. 'enabled',
  11. '_direction',
  12. 'touchEventsTarget',
  13. 'initialSlide',
  14. '_speed',
  15. 'cssMode',
  16. 'updateOnWindowResize',
  17. 'resizeObserver',
  18. 'nested',
  19. 'focusableElements',
  20. '_width',
  21. '_height',
  22. 'preventInteractionOnTransition',
  23. 'userAgent',
  24. 'url',
  25. '_edgeSwipeDetection',
  26. '_edgeSwipeThreshold',
  27. '_freeMode',
  28. '_autoHeight',
  29. 'setWrapperSize',
  30. 'virtualTranslate',
  31. '_effect',
  32. 'breakpoints',
  33. '_spaceBetween',
  34. '_slidesPerView',
  35. 'maxBackfaceHiddenSlides',
  36. '_grid',
  37. '_slidesPerGroup',
  38. '_slidesPerGroupSkip',
  39. '_slidesPerGroupAuto',
  40. '_centeredSlides',
  41. '_centeredSlidesBounds',
  42. '_slidesOffsetBefore',
  43. '_slidesOffsetAfter',
  44. 'normalizeSlideIndex',
  45. '_centerInsufficientSlides',
  46. '_watchOverflow',
  47. 'roundLengths',
  48. 'touchRatio',
  49. 'touchAngle',
  50. 'simulateTouch',
  51. '_shortSwipes',
  52. '_longSwipes',
  53. 'longSwipesRatio',
  54. 'longSwipesMs',
  55. '_followFinger',
  56. 'allowTouchMove',
  57. '_threshold',
  58. 'touchMoveStopPropagation',
  59. 'touchStartPreventDefault',
  60. 'touchStartForcePreventDefault',
  61. 'touchReleaseOnEdges',
  62. 'uniqueNavElements',
  63. '_resistance',
  64. '_resistanceRatio',
  65. '_watchSlidesProgress',
  66. '_grabCursor',
  67. 'preventClicks',
  68. 'preventClicksPropagation',
  69. '_slideToClickedSlide',
  70. '_preloadImages',
  71. 'updateOnImagesReady',
  72. '_loop',
  73. '_loopAdditionalSlides',
  74. '_loopedSlides',
  75. '_loopedSlidesLimit',
  76. '_loopFillGroupWithBlank',
  77. 'loopPreventsSlide',
  78. '_rewind',
  79. '_allowSlidePrev',
  80. '_allowSlideNext',
  81. '_swipeHandler',
  82. '_noSwiping',
  83. 'noSwipingClass',
  84. 'noSwipingSelector',
  85. 'passiveListeners',
  86. 'containerModifierClass',
  87. 'slideClass',
  88. 'slideBlankClass',
  89. 'slideActiveClass',
  90. 'slideDuplicateActiveClass',
  91. 'slideVisibleClass',
  92. 'slideDuplicateClass',
  93. 'slideNextClass',
  94. 'slideDuplicateNextClass',
  95. 'slidePrevClass',
  96. 'slideDuplicatePrevClass',
  97. 'wrapperClass',
  98. 'runCallbacksOnInit',
  99. 'observer',
  100. 'observeParents',
  101. 'observeSlideChildren',
  102. // modules
  103. 'a11y',
  104. 'autoplay',
  105. '_controller',
  106. 'coverflowEffect',
  107. 'cubeEffect',
  108. 'fadeEffect',
  109. 'flipEffect',
  110. 'creativeEffect',
  111. 'cardsEffect',
  112. 'hashNavigation',
  113. 'history',
  114. 'keyboard',
  115. 'lazy',
  116. 'mousewheel',
  117. '_navigation',
  118. '_pagination',
  119. 'parallax',
  120. '_scrollbar',
  121. '_thumbs',
  122. 'virtual',
  123. 'zoom',
  124. 'on',
  125. ];
  126. function isObject(o) {
  127. return (typeof o === 'object' &&
  128. o !== null &&
  129. o.constructor &&
  130. Object.prototype.toString.call(o).slice(8, -1) === 'Object');
  131. }
  132. function isEnabled(val) {
  133. return typeof val !== 'undefined' && typeof val !== 'boolean' && val.enabled === true;
  134. }
  135. function isShowEl(val, obj, el) {
  136. return ((coerceBooleanProperty(val) === true && obj && !obj.el) ||
  137. !(typeof obj !== 'boolean' &&
  138. obj.el !== el?.nativeElement &&
  139. (typeof obj.el === 'string' || typeof obj.el === 'object')));
  140. }
  141. function extend(target, src) {
  142. const noExtend = ['__proto__', 'constructor', 'prototype'];
  143. Object.keys(src)
  144. .filter((key) => noExtend.indexOf(key) < 0)
  145. .forEach((key) => {
  146. if (typeof target[key] === 'undefined') {
  147. target[key] = src[key];
  148. return;
  149. }
  150. if (target[key] && !src[key]) {
  151. return;
  152. }
  153. if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {
  154. if (src[key].__swiper__)
  155. target[key] = src[key];
  156. else
  157. extend(target[key], src[key]);
  158. }
  159. else {
  160. target[key] = src[key];
  161. }
  162. });
  163. }
  164. function coerceBooleanProperty(value) {
  165. return value != null && `${value}` !== 'false';
  166. }
  167. const ignoreNgOnChanges = ['pagination', 'navigation', 'scrollbar', 'virtual'];
  168. function setProperty(val, obj = {}) {
  169. if (isObject(val)) {
  170. return val;
  171. }
  172. if (coerceBooleanProperty(val) === true) {
  173. return obj;
  174. }
  175. return false;
  176. }
  177. // @ts-ignore
  178. const allowedParams = paramsList.map((key) => key.replace(/_/, ''));
  179. function getParams(obj = {}) {
  180. const params = {
  181. on: {},
  182. };
  183. // const events = {};
  184. const passedParams = {};
  185. extend(params, Swiper.defaults);
  186. extend(params, Swiper.extendedDefaults);
  187. params._emitClasses = true;
  188. params.init = false;
  189. const rest = {};
  190. const allowedParams = paramsList.map((key) => key.replace(/_/, ''));
  191. Object.keys(obj).forEach((key) => {
  192. const _key = key.replace(/^_/, '');
  193. if (allowedParams.indexOf(_key) >= 0) {
  194. if (isObject(obj[key])) {
  195. params[_key] = {};
  196. passedParams[_key] = {};
  197. extend(params[_key], obj[key]);
  198. extend(passedParams[_key], obj[key]);
  199. }
  200. else {
  201. params[_key] = obj[key];
  202. passedParams[_key] = obj[key];
  203. }
  204. }
  205. // else if (key.search(/on[A-Z]/) === 0 && typeof obj[key] === 'function') {
  206. // events[`${_key[2].toLowerCase()}${key.substr(3)}`] = obj[key];
  207. // }
  208. else {
  209. rest[_key] = obj[key];
  210. }
  211. });
  212. ['navigation', 'pagination', 'scrollbar'].forEach((key) => {
  213. if (params[key] === true)
  214. params[key] = {};
  215. if (params[key] === false)
  216. delete params[key];
  217. });
  218. return { params, passedParams, rest };
  219. }
  220. class SwiperSlideDirective {
  221. constructor(template) {
  222. this.template = template;
  223. this.class = '';
  224. this.autoplayDelay = null;
  225. this.slideData = {
  226. isActive: false,
  227. isPrev: false,
  228. isNext: false,
  229. isVisible: false,
  230. isDuplicate: false,
  231. };
  232. }
  233. set ngClass(val) {
  234. this.class = [this.class || '', val].join(' ');
  235. }
  236. set zoom(val) {
  237. this._zoom = coerceBooleanProperty(val);
  238. }
  239. get zoom() {
  240. return this._zoom;
  241. }
  242. get classNames() {
  243. return this._classNames;
  244. }
  245. set classNames(val) {
  246. if (this._classNames === val) {
  247. return;
  248. }
  249. this._classNames = val;
  250. this.slideData = {
  251. isActive: this._hasClass(['swiper-slide-active', 'swiper-slide-duplicate-active']),
  252. isVisible: this._hasClass(['swiper-slide-visible']),
  253. isDuplicate: this._hasClass(['swiper-slide-duplicate']),
  254. isPrev: this._hasClass(['swiper-slide-prev', 'swiper-slide-duplicate-prev']),
  255. isNext: this._hasClass(['swiper-slide-next', 'swiper-slide-duplicate-next']),
  256. };
  257. }
  258. _hasClass(classNames) {
  259. return classNames.some((className) => this._classNames.indexOf(className) >= 0);
  260. }
  261. }
  262. SwiperSlideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwiperSlideDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
  263. SwiperSlideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: SwiperSlideDirective, selector: "ng-template[swiperSlide]", inputs: { virtualIndex: "virtualIndex", class: "class", ngClass: "ngClass", autoplayDelay: ["data-swiper-autoplay", "autoplayDelay"], zoom: "zoom" }, ngImport: i0 });
  264. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwiperSlideDirective, decorators: [{
  265. type: Directive,
  266. args: [{
  267. selector: 'ng-template[swiperSlide]',
  268. }]
  269. }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { virtualIndex: [{
  270. type: Input
  271. }], class: [{
  272. type: Input
  273. }], ngClass: [{
  274. type: Input
  275. }], autoplayDelay: [{
  276. type: Input,
  277. args: ['data-swiper-autoplay']
  278. }], zoom: [{
  279. type: Input
  280. }] } });
  281. class SwiperComponent {
  282. constructor(_ngZone, elementRef, _changeDetectorRef, _platformId) {
  283. this._ngZone = _ngZone;
  284. this.elementRef = elementRef;
  285. this._changeDetectorRef = _changeDetectorRef;
  286. this._platformId = _platformId;
  287. this.slideClass = 'swiper-slide';
  288. this.wrapperClass = 'swiper-wrapper';
  289. this.showNavigation = true;
  290. this.showPagination = true;
  291. this.showScrollbar = true;
  292. this.s__beforeBreakpoint = new EventEmitter();
  293. this.s__containerClasses = new EventEmitter();
  294. this.s__slideClass = new EventEmitter();
  295. this.s__swiper = new EventEmitter();
  296. this.s_activeIndexChange = new EventEmitter();
  297. this.s_afterInit = new EventEmitter();
  298. this.s_autoplay = new EventEmitter();
  299. this.s_autoplayStart = new EventEmitter();
  300. this.s_autoplayStop = new EventEmitter();
  301. this.s_autoplayPause = new EventEmitter();
  302. this.s_autoplayResume = new EventEmitter();
  303. this.s_beforeDestroy = new EventEmitter();
  304. this.s_beforeInit = new EventEmitter();
  305. this.s_beforeLoopFix = new EventEmitter();
  306. this.s_beforeResize = new EventEmitter();
  307. this.s_beforeSlideChangeStart = new EventEmitter();
  308. this.s_beforeTransitionStart = new EventEmitter();
  309. this.s_breakpoint = new EventEmitter();
  310. this.s_changeDirection = new EventEmitter();
  311. this.s_click = new EventEmitter();
  312. this.s_doubleTap = new EventEmitter();
  313. this.s_doubleClick = new EventEmitter();
  314. this.s_destroy = new EventEmitter();
  315. this.s_fromEdge = new EventEmitter();
  316. this.s_hashChange = new EventEmitter();
  317. this.s_hashSet = new EventEmitter();
  318. this.s_imagesReady = new EventEmitter();
  319. this.s_init = new EventEmitter();
  320. this.s_keyPress = new EventEmitter();
  321. this.s_lazyImageLoad = new EventEmitter();
  322. this.s_lazyImageReady = new EventEmitter();
  323. this.s_loopFix = new EventEmitter();
  324. this.s_momentumBounce = new EventEmitter();
  325. this.s_navigationHide = new EventEmitter();
  326. this.s_navigationShow = new EventEmitter();
  327. this.s_navigationPrev = new EventEmitter();
  328. this.s_navigationNext = new EventEmitter();
  329. this.s_observerUpdate = new EventEmitter();
  330. this.s_orientationchange = new EventEmitter();
  331. this.s_paginationHide = new EventEmitter();
  332. this.s_paginationRender = new EventEmitter();
  333. this.s_paginationShow = new EventEmitter();
  334. this.s_paginationUpdate = new EventEmitter();
  335. this.s_progress = new EventEmitter();
  336. this.s_reachBeginning = new EventEmitter();
  337. this.s_reachEnd = new EventEmitter();
  338. this.s_realIndexChange = new EventEmitter();
  339. this.s_resize = new EventEmitter();
  340. this.s_scroll = new EventEmitter();
  341. this.s_scrollbarDragEnd = new EventEmitter();
  342. this.s_scrollbarDragMove = new EventEmitter();
  343. this.s_scrollbarDragStart = new EventEmitter();
  344. this.s_setTransition = new EventEmitter();
  345. this.s_setTranslate = new EventEmitter();
  346. this.s_slideChange = new EventEmitter();
  347. this.s_slideChangeTransitionEnd = new EventEmitter();
  348. this.s_slideChangeTransitionStart = new EventEmitter();
  349. this.s_slideNextTransitionEnd = new EventEmitter();
  350. this.s_slideNextTransitionStart = new EventEmitter();
  351. this.s_slidePrevTransitionEnd = new EventEmitter();
  352. this.s_slidePrevTransitionStart = new EventEmitter();
  353. this.s_slideResetTransitionStart = new EventEmitter();
  354. this.s_slideResetTransitionEnd = new EventEmitter();
  355. this.s_sliderMove = new EventEmitter();
  356. this.s_sliderFirstMove = new EventEmitter();
  357. this.s_slidesLengthChange = new EventEmitter();
  358. this.s_slidesGridLengthChange = new EventEmitter();
  359. this.s_snapGridLengthChange = new EventEmitter();
  360. this.s_snapIndexChange = new EventEmitter();
  361. this.s_tap = new EventEmitter();
  362. this.s_toEdge = new EventEmitter();
  363. this.s_touchEnd = new EventEmitter();
  364. this.s_touchMove = new EventEmitter();
  365. this.s_touchMoveOpposite = new EventEmitter();
  366. this.s_touchStart = new EventEmitter();
  367. this.s_transitionEnd = new EventEmitter();
  368. this.s_transitionStart = new EventEmitter();
  369. this.s_update = new EventEmitter();
  370. this.s_zoomChange = new EventEmitter();
  371. this.s_swiper = new EventEmitter();
  372. this.s_lock = new EventEmitter();
  373. this.s_unlock = new EventEmitter();
  374. this._activeSlides = new Subject();
  375. this.containerClasses = 'swiper';
  376. this.slidesChanges = (val) => {
  377. this.slides = val.map((slide, index) => {
  378. slide.slideIndex = index;
  379. slide.classNames = this.slideClass || '';
  380. return slide;
  381. });
  382. if (this.loop && !this.loopedSlides) {
  383. this.calcLoopedSlides();
  384. }
  385. if (!this.virtual) {
  386. if (this.loopedSlides) {
  387. this.prependSlides = of(this.slides.slice(this.slides.length - this.loopedSlides));
  388. this.appendSlides = of(this.slides.slice(0, this.loopedSlides));
  389. }
  390. }
  391. else if (this.swiperRef && this.swiperRef.virtual) {
  392. this._ngZone.runOutsideAngular(() => {
  393. this.swiperRef.virtual.slides = this.slides;
  394. this.swiperRef.virtual.update(true);
  395. });
  396. }
  397. this._changeDetectorRef.detectChanges();
  398. };
  399. this.style = null;
  400. this.updateVirtualSlides = (virtualData) => {
  401. // TODO: type virtualData
  402. if (!this.swiperRef ||
  403. (this.currentVirtualData &&
  404. this.currentVirtualData.from === virtualData.from &&
  405. this.currentVirtualData.to === virtualData.to &&
  406. this.currentVirtualData.offset === virtualData.offset)) {
  407. return;
  408. }
  409. this.style = this.swiperRef.isHorizontal()
  410. ? {
  411. [this.swiperRef.rtlTranslate ? 'right' : 'left']: `${virtualData.offset}px`,
  412. }
  413. : {
  414. top: `${virtualData.offset}px`,
  415. };
  416. this.currentVirtualData = virtualData;
  417. this._activeSlides.next(virtualData.slides);
  418. this._ngZone.run(() => {
  419. this._changeDetectorRef.detectChanges();
  420. });
  421. this._ngZone.runOutsideAngular(() => {
  422. this.swiperRef.updateSlides();
  423. this.swiperRef.updateProgress();
  424. this.swiperRef.updateSlidesClasses();
  425. if (isEnabled(this.swiperRef.params.lazy)) {
  426. this.swiperRef.lazy.load();
  427. }
  428. this.swiperRef.virtual.update(true);
  429. });
  430. return;
  431. };
  432. }
  433. set navigation(val) {
  434. const currentNext = typeof this._navigation !== 'boolean' && this._navigation !== ''
  435. ? this._navigation?.nextEl
  436. : null;
  437. const currentPrev = typeof this._navigation !== 'boolean' && this._navigation !== ''
  438. ? this._navigation?.prevEl
  439. : null;
  440. this._navigation = setProperty(val, {
  441. nextEl: currentNext || null,
  442. prevEl: currentPrev || null,
  443. });
  444. this.showNavigation = !(coerceBooleanProperty(val) !== true ||
  445. (this._navigation &&
  446. typeof this._navigation !== 'boolean' &&
  447. this._navigation.prevEl !== this._prevElRef?.nativeElement &&
  448. (this._navigation.prevEl !== null || this._navigation.nextEl !== null) &&
  449. (typeof this._navigation.nextEl === 'string' ||
  450. typeof this._navigation.prevEl === 'string' ||
  451. typeof this._navigation.nextEl === 'object' ||
  452. typeof this._navigation.prevEl === 'object')));
  453. }
  454. get navigation() {
  455. return this._navigation;
  456. }
  457. set pagination(val) {
  458. const current = typeof this._pagination !== 'boolean' && this._pagination !== ''
  459. ? this._pagination?.el
  460. : null;
  461. this._pagination = setProperty(val, {
  462. el: current || null,
  463. });
  464. this.showPagination = isShowEl(val, this._pagination, this._paginationElRef);
  465. }
  466. get pagination() {
  467. return this._pagination;
  468. }
  469. set scrollbar(val) {
  470. const current = typeof this._scrollbar !== 'boolean' && this._scrollbar !== '' ? this._scrollbar?.el : null;
  471. this._scrollbar = setProperty(val, {
  472. el: current || null,
  473. });
  474. this.showScrollbar = isShowEl(val, this._scrollbar, this._scrollbarElRef);
  475. }
  476. get scrollbar() {
  477. return this._scrollbar;
  478. }
  479. set virtual(val) {
  480. this._virtual = setProperty(val);
  481. }
  482. get virtual() {
  483. return this._virtual;
  484. }
  485. set config(val) {
  486. this.updateSwiper(val);
  487. const { params } = getParams(val);
  488. Object.assign(this, params);
  489. }
  490. set prevElRef(el) {
  491. this._prevElRef = el;
  492. this._setElement(el, this.navigation, 'navigation', 'prevEl');
  493. }
  494. set nextElRef(el) {
  495. this._nextElRef = el;
  496. this._setElement(el, this.navigation, 'navigation', 'nextEl');
  497. }
  498. set scrollbarElRef(el) {
  499. this._scrollbarElRef = el;
  500. this._setElement(el, this.scrollbar, 'scrollbar');
  501. }
  502. set paginationElRef(el) {
  503. this._paginationElRef = el;
  504. this._setElement(el, this.pagination, 'pagination');
  505. }
  506. get activeSlides() {
  507. if (this.virtual) {
  508. return this._activeSlides;
  509. }
  510. return of(this.slides);
  511. }
  512. get zoomContainerClass() {
  513. return this.zoom && typeof this.zoom !== 'boolean'
  514. ? this.zoom.containerClass
  515. : 'swiper-zoom-container';
  516. }
  517. _setElement(el, ref, update, key = 'el') {
  518. if (!ref || !el)
  519. return;
  520. if (el.nativeElement) {
  521. if (ref[key] === el.nativeElement) {
  522. return;
  523. }
  524. ref[key] = el.nativeElement;
  525. }
  526. const updateObj = {};
  527. updateObj[update] = true;
  528. this.updateInitSwiper(updateObj);
  529. }
  530. ngOnInit() {
  531. const { params } = getParams(this);
  532. Object.assign(this, params);
  533. }
  534. ngAfterViewInit() {
  535. this.childrenSlidesInit();
  536. this.initSwiper();
  537. this._changeDetectorRef.detectChanges();
  538. setTimeout(() => {
  539. this.s_swiper.emit(this.swiperRef);
  540. });
  541. }
  542. childrenSlidesInit() {
  543. this.slidesChanges(this.slidesEl);
  544. this.slidesEl.changes.subscribe(this.slidesChanges);
  545. }
  546. get isSwiperActive() {
  547. return this.swiperRef && !this.swiperRef.destroyed;
  548. }
  549. initSwiper() {
  550. const { params: swiperParams, passedParams } = getParams(this);
  551. Object.assign(this, swiperParams);
  552. this._ngZone.runOutsideAngular(() => {
  553. swiperParams.init = false;
  554. if (!swiperParams.virtual) {
  555. swiperParams.observer = true;
  556. }
  557. swiperParams.onAny = (eventName, ...args) => {
  558. const emitter = this[('s_' + eventName)];
  559. if (emitter) {
  560. emitter.emit([...args]);
  561. }
  562. };
  563. const _slideClasses = (_, updated) => {
  564. updated.forEach(({ slideEl, classNames }, index) => {
  565. const dataIndex = slideEl.getAttribute('data-swiper-slide-index');
  566. const slideIndex = dataIndex ? parseInt(dataIndex) : index;
  567. if (this.virtual) {
  568. const virtualSlide = this.slides.find((item) => {
  569. return item.virtualIndex && item.virtualIndex === slideIndex;
  570. });
  571. if (virtualSlide) {
  572. virtualSlide.classNames = classNames;
  573. return;
  574. }
  575. }
  576. if (this.slides[slideIndex]) {
  577. this.slides[slideIndex].classNames = classNames;
  578. }
  579. });
  580. this._changeDetectorRef.detectChanges();
  581. };
  582. const _containerClasses = (_, classes) => {
  583. setTimeout(() => {
  584. this.containerClasses = classes;
  585. });
  586. };
  587. Object.assign(swiperParams.on, {
  588. _containerClasses,
  589. _slideClasses,
  590. });
  591. const swiperRef = new Swiper(swiperParams);
  592. swiperRef.loopCreate = () => { };
  593. swiperRef.loopDestroy = () => { };
  594. if (swiperParams.loop) {
  595. swiperRef.loopedSlides = this.loopedSlides;
  596. }
  597. const isVirtualEnabled = isEnabled(swiperRef.params.virtual);
  598. if (swiperRef.virtual && isVirtualEnabled) {
  599. swiperRef.virtual.slides = this.slides;
  600. const extendWith = {
  601. cache: false,
  602. slides: this.slides,
  603. renderExternal: this.updateVirtualSlides,
  604. renderExternalUpdate: false,
  605. };
  606. extend(swiperRef.params.virtual, extendWith);
  607. extend(swiperRef.originalParams.virtual, extendWith);
  608. }
  609. if (isPlatformBrowser(this._platformId)) {
  610. this.swiperRef = swiperRef.init(this.elementRef.nativeElement);
  611. const isVirtualEnabled = isEnabled(this.swiperRef.params.virtual);
  612. if (this.swiperRef.virtual && isVirtualEnabled) {
  613. this.swiperRef.virtual.update(true);
  614. }
  615. this._changeDetectorRef.detectChanges();
  616. }
  617. });
  618. }
  619. ngOnChanges(changedParams) {
  620. this.updateSwiper(changedParams);
  621. this._changeDetectorRef.detectChanges();
  622. }
  623. updateInitSwiper(changedParams) {
  624. if (!(changedParams && this.swiperRef && !this.swiperRef.destroyed)) {
  625. return;
  626. }
  627. this._ngZone.runOutsideAngular(() => {
  628. const { params: currentParams, pagination, navigation, scrollbar, virtual, thumbs, } = this.swiperRef;
  629. if (changedParams.pagination) {
  630. if (this.pagination &&
  631. typeof this.pagination !== 'boolean' &&
  632. this.pagination.el &&
  633. pagination &&
  634. !pagination.el) {
  635. this.updateParameter('pagination', this.pagination);
  636. pagination.init();
  637. pagination.render();
  638. pagination.update();
  639. }
  640. else {
  641. pagination.destroy();
  642. pagination.el = null;
  643. }
  644. }
  645. if (changedParams.scrollbar) {
  646. if (this.scrollbar &&
  647. typeof this.scrollbar !== 'boolean' &&
  648. this.scrollbar.el &&
  649. scrollbar &&
  650. !scrollbar.el) {
  651. this.updateParameter('scrollbar', this.scrollbar);
  652. scrollbar.init();
  653. scrollbar.updateSize();
  654. scrollbar.setTranslate();
  655. }
  656. else {
  657. scrollbar.destroy();
  658. scrollbar.el = null;
  659. }
  660. }
  661. if (changedParams.navigation) {
  662. if (this.navigation &&
  663. typeof this.navigation !== 'boolean' &&
  664. this.navigation.prevEl &&
  665. this.navigation.nextEl &&
  666. navigation &&
  667. !navigation.prevEl &&
  668. !navigation.nextEl) {
  669. this.updateParameter('navigation', this.navigation);
  670. navigation.init();
  671. navigation.update();
  672. }
  673. else if (navigation.prevEl && navigation.nextEl) {
  674. navigation.destroy();
  675. navigation.nextEl = null;
  676. navigation.prevEl = null;
  677. }
  678. }
  679. if (changedParams.thumbs && this.thumbs && this.thumbs.swiper) {
  680. this.updateParameter('thumbs', this.thumbs);
  681. const initialized = thumbs.init();
  682. if (initialized)
  683. thumbs.update(true);
  684. }
  685. if (changedParams.controller && this.controller && this.controller.control) {
  686. this.swiperRef.controller.control = this.controller.control;
  687. }
  688. this.swiperRef.update();
  689. });
  690. }
  691. updateSwiper(changedParams) {
  692. this._ngZone.runOutsideAngular(() => {
  693. if (changedParams.config) {
  694. return;
  695. }
  696. if (!(changedParams && this.swiperRef && !this.swiperRef.destroyed)) {
  697. return;
  698. }
  699. for (const key in changedParams) {
  700. if (ignoreNgOnChanges.indexOf(key) >= 0) {
  701. continue;
  702. }
  703. const newValue = changedParams[key]?.currentValue ?? changedParams[key];
  704. this.updateParameter(key, newValue);
  705. }
  706. if (changedParams.allowSlideNext) {
  707. this.swiperRef.allowSlideNext = this.allowSlideNext;
  708. }
  709. if (changedParams.allowSlidePrev) {
  710. this.swiperRef.allowSlidePrev = this.allowSlidePrev;
  711. }
  712. if (changedParams.direction) {
  713. this.swiperRef.changeDirection(this.direction, false);
  714. }
  715. if (changedParams.breakpoints) {
  716. if (this.loop && !this.loopedSlides) {
  717. this.calcLoopedSlides();
  718. }
  719. this.swiperRef.currentBreakpoint = null;
  720. this.swiperRef.setBreakpoint();
  721. }
  722. if (changedParams.thumbs || changedParams.controller) {
  723. this.updateInitSwiper(changedParams);
  724. }
  725. this.swiperRef.update();
  726. });
  727. }
  728. calcLoopedSlides() {
  729. if (!this.loop) {
  730. return false;
  731. }
  732. let slidesPerViewParams = this.slidesPerView;
  733. if (this.breakpoints) {
  734. const breakpoint = Swiper.prototype.getBreakpoint(this.breakpoints);
  735. const breakpointOnlyParams = breakpoint in this.breakpoints ? this.breakpoints[breakpoint] : undefined;
  736. if (breakpointOnlyParams && breakpointOnlyParams.slidesPerView) {
  737. slidesPerViewParams = breakpointOnlyParams.slidesPerView;
  738. }
  739. }
  740. if (slidesPerViewParams === 'auto') {
  741. this.loopedSlides = this.slides.length;
  742. return this.slides.length;
  743. }
  744. let loopedSlides = this.loopedSlides || slidesPerViewParams;
  745. if (!loopedSlides) {
  746. // ?
  747. return false;
  748. }
  749. if (this.loopAdditionalSlides) {
  750. loopedSlides += this.loopAdditionalSlides;
  751. }
  752. if (loopedSlides > this.slides.length) {
  753. loopedSlides = this.slides.length;
  754. }
  755. this.loopedSlides = loopedSlides;
  756. return true;
  757. }
  758. updateParameter(key, value) {
  759. if (!(this.swiperRef && !this.swiperRef.destroyed)) {
  760. return;
  761. }
  762. const _key = key.replace(/^_/, '');
  763. const isCurrentParamObj = isObject(this.swiperRef.params[_key]);
  764. if (_key === 'enabled') {
  765. if (value === true) {
  766. this.swiperRef.enable();
  767. }
  768. else if (value === false) {
  769. this.swiperRef.disable();
  770. }
  771. return;
  772. }
  773. if (isCurrentParamObj && isObject(value)) {
  774. extend(this.swiperRef.params[_key], value);
  775. }
  776. else {
  777. this.swiperRef.params[_key] = value;
  778. }
  779. }
  780. ngOnDestroy() {
  781. this._ngZone.runOutsideAngular(() => {
  782. this.swiperRef?.destroy(true, false);
  783. });
  784. }
  785. }
  786. SwiperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwiperComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
  787. SwiperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: SwiperComponent, selector: "swiper, [swiper]", inputs: { enabled: "enabled", on: "on", direction: "direction", touchEventsTarget: "touchEventsTarget", initialSlide: "initialSlide", speed: "speed", cssMode: "cssMode", updateOnWindowResize: "updateOnWindowResize", resizeObserver: "resizeObserver", nested: "nested", focusableElements: "focusableElements", width: "width", height: "height", preventInteractionOnTransition: "preventInteractionOnTransition", userAgent: "userAgent", url: "url", edgeSwipeDetection: "edgeSwipeDetection", edgeSwipeThreshold: "edgeSwipeThreshold", freeMode: "freeMode", autoHeight: "autoHeight", setWrapperSize: "setWrapperSize", virtualTranslate: "virtualTranslate", effect: "effect", breakpoints: "breakpoints", spaceBetween: "spaceBetween", slidesPerView: "slidesPerView", maxBackfaceHiddenSlides: "maxBackfaceHiddenSlides", grid: "grid", slidesPerGroup: "slidesPerGroup", slidesPerGroupSkip: "slidesPerGroupSkip", centeredSlides: "centeredSlides", centeredSlidesBounds: "centeredSlidesBounds", slidesOffsetBefore: "slidesOffsetBefore", slidesOffsetAfter: "slidesOffsetAfter", normalizeSlideIndex: "normalizeSlideIndex", centerInsufficientSlides: "centerInsufficientSlides", watchOverflow: "watchOverflow", roundLengths: "roundLengths", touchRatio: "touchRatio", touchAngle: "touchAngle", simulateTouch: "simulateTouch", shortSwipes: "shortSwipes", longSwipes: "longSwipes", longSwipesRatio: "longSwipesRatio", longSwipesMs: "longSwipesMs", followFinger: "followFinger", allowTouchMove: "allowTouchMove", threshold: "threshold", touchMoveStopPropagation: "touchMoveStopPropagation", touchStartPreventDefault: "touchStartPreventDefault", touchStartForcePreventDefault: "touchStartForcePreventDefault", touchReleaseOnEdges: "touchReleaseOnEdges", uniqueNavElements: "uniqueNavElements", resistance: "resistance", resistanceRatio: "resistanceRatio", watchSlidesProgress: "watchSlidesProgress", grabCursor: "grabCursor", preventClicks: "preventClicks", preventClicksPropagation: "preventClicksPropagation", slideToClickedSlide: "slideToClickedSlide", preloadImages: "preloadImages", updateOnImagesReady: "updateOnImagesReady", loop: "loop", loopAdditionalSlides: "loopAdditionalSlides", loopedSlides: "loopedSlides", loopedSlidesLimit: "loopedSlidesLimit", loopFillGroupWithBlank: "loopFillGroupWithBlank", loopPreventsSlide: "loopPreventsSlide", rewind: "rewind", allowSlidePrev: "allowSlidePrev", allowSlideNext: "allowSlideNext", swipeHandler: "swipeHandler", noSwiping: "noSwiping", noSwipingClass: "noSwipingClass", noSwipingSelector: "noSwipingSelector", passiveListeners: "passiveListeners", containerModifierClass: "containerModifierClass", slideClass: "slideClass", slideBlankClass: "slideBlankClass", slideActiveClass: "slideActiveClass", slideDuplicateActiveClass: "slideDuplicateActiveClass", slideVisibleClass: "slideVisibleClass", slideDuplicateClass: "slideDuplicateClass", slideNextClass: "slideNextClass", slideDuplicateNextClass: "slideDuplicateNextClass", slidePrevClass: "slidePrevClass", slideDuplicatePrevClass: "slideDuplicatePrevClass", wrapperClass: "wrapperClass", runCallbacksOnInit: "runCallbacksOnInit", observeParents: "observeParents", observeSlideChildren: "observeSlideChildren", a11y: "a11y", autoplay: "autoplay", controller: "controller", coverflowEffect: "coverflowEffect", cubeEffect: "cubeEffect", fadeEffect: "fadeEffect", flipEffect: "flipEffect", creativeEffect: "creativeEffect", cardsEffect: "cardsEffect", hashNavigation: "hashNavigation", history: "history", keyboard: "keyboard", lazy: "lazy", mousewheel: "mousewheel", parallax: "parallax", thumbs: "thumbs", zoom: "zoom", slidesPerGroupAuto: "slidesPerGroupAuto", class: "class", id: "id", navigation: "navigation", pagination: "pagination", scrollbar: "scrollbar", virtual: "virtual", config: "config" }, outputs: { s__beforeBreakpoint: "_beforeBreakpoint", s__containerClasses: "_containerClasses", s__slideClass: "_slideClass", s__swiper: "_swiper", s_activeIndexChange: "activeIndexChange", s_afterInit: "afterInit", s_autoplay: "autoplay", s_autoplayStart: "autoplayStart", s_autoplayStop: "autoplayStop", s_autoplayPause: "autoplayPause", s_autoplayResume: "autoplayResume", s_beforeDestroy: "beforeDestroy", s_beforeInit: "beforeInit", s_beforeLoopFix: "beforeLoopFix", s_beforeResize: "beforeResize", s_beforeSlideChangeStart: "beforeSlideChangeStart", s_beforeTransitionStart: "beforeTransitionStart", s_breakpoint: "breakpoint", s_changeDirection: "changeDirection", s_click: "click", s_doubleTap: "doubleTap", s_doubleClick: "doubleClick", s_destroy: "destroy", s_fromEdge: "fromEdge", s_hashChange: "hashChange", s_hashSet: "hashSet", s_imagesReady: "imagesReady", s_init: "init", s_keyPress: "keyPress", s_lazyImageLoad: "lazyImageLoad", s_lazyImageReady: "lazyImageReady", s_loopFix: "loopFix", s_momentumBounce: "momentumBounce", s_navigationHide: "navigationHide", s_navigationShow: "navigationShow", s_navigationPrev: "navigationPrev", s_navigationNext: "navigationNext", s_observerUpdate: "observerUpdate", s_orientationchange: "orientationchange", s_paginationHide: "paginationHide", s_paginationRender: "paginationRender", s_paginationShow: "paginationShow", s_paginationUpdate: "paginationUpdate", s_progress: "progress", s_reachBeginning: "reachBeginning", s_reachEnd: "reachEnd", s_realIndexChange: "realIndexChange", s_resize: "resize", s_scroll: "scroll", s_scrollbarDragEnd: "scrollbarDragEnd", s_scrollbarDragMove: "scrollbarDragMove", s_scrollbarDragStart: "scrollbarDragStart", s_setTransition: "setTransition", s_setTranslate: "setTranslate", s_slideChange: "slideChange", s_slideChangeTransitionEnd: "slideChangeTransitionEnd", s_slideChangeTransitionStart: "slideChangeTransitionStart", s_slideNextTransitionEnd: "slideNextTransitionEnd", s_slideNextTransitionStart: "slideNextTransitionStart", s_slidePrevTransitionEnd: "slidePrevTransitionEnd", s_slidePrevTransitionStart: "slidePrevTransitionStart", s_slideResetTransitionStart: "slideResetTransitionStart", s_slideResetTransitionEnd: "slideResetTransitionEnd", s_sliderMove: "sliderMove", s_sliderFirstMove: "sliderFirstMove", s_slidesLengthChange: "slidesLengthChange", s_slidesGridLengthChange: "slidesGridLengthChange", s_snapGridLengthChange: "snapGridLengthChange", s_snapIndexChange: "snapIndexChange", s_tap: "tap", s_toEdge: "toEdge", s_touchEnd: "touchEnd", s_touchMove: "touchMove", s_touchMoveOpposite: "touchMoveOpposite", s_touchStart: "touchStart", s_transitionEnd: "transitionEnd", s_transitionStart: "transitionStart", s_update: "update", s_zoomChange: "zoomChange", s_swiper: "swiper", s_lock: "lock", s_unlock: "unlock" }, host: { properties: { "class": "this.containerClasses" } }, queries: [{ propertyName: "slidesEl", predicate: SwiperSlideDirective }], viewQueries: [{ propertyName: "prevElRef", first: true, predicate: ["prevElRef"], descendants: true }, { propertyName: "nextElRef", first: true, predicate: ["nextElRef"], descendants: true }, { propertyName: "scrollbarElRef", first: true, predicate: ["scrollbarElRef"], descendants: true }, { propertyName: "paginationElRef", first: true, predicate: ["paginationElRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-content select=\"[slot=container-start]\"></ng-content>\n<ng-container *ngIf=\"navigation && showNavigation\">\n <div class=\"swiper-button-prev\" #prevElRef></div>\n <div class=\"swiper-button-next\" #nextElRef></div>\n</ng-container>\n<div *ngIf=\"scrollbar && showScrollbar\" class=\"swiper-scrollbar\" #scrollbarElRef></div>\n<div *ngIf=\"pagination && showPagination\" class=\"swiper-pagination\" #paginationElRef></div>\n<div [ngClass]=\"wrapperClass\" [attr.id]=\"id\">\n <ng-content select=\"[slot=wrapper-start]\"></ng-content>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: prependSlides,\n key: 'prepend'\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: activeSlides,\n key: ''\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: appendSlides,\n key: 'append'\n }\n \"\n ></ng-template>\n <ng-content select=\"[slot=wrapper-end]\"></ng-content>\n</div>\n<ng-content select=\"[slot=container-end]\"></ng-content>\n\n<ng-template #slidesTemplate let-loopSlides=\"loopSlides\" let-slideKey=\"key\">\n <div\n *ngFor=\"let slide of loopSlides | async\"\n [ngClass]=\"\n (slide.class ? slide.class + ' ' : '') +\n slideClass +\n (slideKey !== '' ? ' ' + slideDuplicateClass : '')\n \"\n [attr.data-swiper-slide-index]=\"slide.virtualIndex ? slide.virtualIndex : slide.slideIndex\"\n [attr.data-swiper-autoplay]=\"slide.autoplayDelay\"\n [style]=\"style\"\n [ngSwitch]=\"slide.zoom\"\n >\n <div *ngSwitchCase=\"true\" [ngClass]=\"zoomContainerClass\">\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </div>\n <ng-container *ngSwitchDefault>\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </ng-container>\n </div>\n</ng-template>\n", styles: ["swiper{display:block}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  788. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwiperComponent, decorators: [{
  789. type: Component,
  790. args: [{ selector: 'swiper, [swiper]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [
  791. `
  792. swiper {
  793. display: block;
  794. }
  795. `,
  796. ], template: "<ng-content select=\"[slot=container-start]\"></ng-content>\n<ng-container *ngIf=\"navigation && showNavigation\">\n <div class=\"swiper-button-prev\" #prevElRef></div>\n <div class=\"swiper-button-next\" #nextElRef></div>\n</ng-container>\n<div *ngIf=\"scrollbar && showScrollbar\" class=\"swiper-scrollbar\" #scrollbarElRef></div>\n<div *ngIf=\"pagination && showPagination\" class=\"swiper-pagination\" #paginationElRef></div>\n<div [ngClass]=\"wrapperClass\" [attr.id]=\"id\">\n <ng-content select=\"[slot=wrapper-start]\"></ng-content>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: prependSlides,\n key: 'prepend'\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: activeSlides,\n key: ''\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: appendSlides,\n key: 'append'\n }\n \"\n ></ng-template>\n <ng-content select=\"[slot=wrapper-end]\"></ng-content>\n</div>\n<ng-content select=\"[slot=container-end]\"></ng-content>\n\n<ng-template #slidesTemplate let-loopSlides=\"loopSlides\" let-slideKey=\"key\">\n <div\n *ngFor=\"let slide of loopSlides | async\"\n [ngClass]=\"\n (slide.class ? slide.class + ' ' : '') +\n slideClass +\n (slideKey !== '' ? ' ' + slideDuplicateClass : '')\n \"\n [attr.data-swiper-slide-index]=\"slide.virtualIndex ? slide.virtualIndex : slide.slideIndex\"\n [attr.data-swiper-autoplay]=\"slide.autoplayDelay\"\n [style]=\"style\"\n [ngSwitch]=\"slide.zoom\"\n >\n <div *ngSwitchCase=\"true\" [ngClass]=\"zoomContainerClass\">\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </div>\n <ng-container *ngSwitchDefault>\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </ng-container>\n </div>\n</ng-template>\n" }]
  797. }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: Object, decorators: [{
  798. type: Inject,
  799. args: [PLATFORM_ID]
  800. }] }]; }, propDecorators: { enabled: [{
  801. type: Input
  802. }], on: [{
  803. type: Input
  804. }], direction: [{
  805. type: Input
  806. }], touchEventsTarget: [{
  807. type: Input
  808. }], initialSlide: [{
  809. type: Input
  810. }], speed: [{
  811. type: Input
  812. }], cssMode: [{
  813. type: Input
  814. }], updateOnWindowResize: [{
  815. type: Input
  816. }], resizeObserver: [{
  817. type: Input
  818. }], nested: [{
  819. type: Input
  820. }], focusableElements: [{
  821. type: Input
  822. }], width: [{
  823. type: Input
  824. }], height: [{
  825. type: Input
  826. }], preventInteractionOnTransition: [{
  827. type: Input
  828. }], userAgent: [{
  829. type: Input
  830. }], url: [{
  831. type: Input
  832. }], edgeSwipeDetection: [{
  833. type: Input
  834. }], edgeSwipeThreshold: [{
  835. type: Input
  836. }], freeMode: [{
  837. type: Input
  838. }], autoHeight: [{
  839. type: Input
  840. }], setWrapperSize: [{
  841. type: Input
  842. }], virtualTranslate: [{
  843. type: Input
  844. }], effect: [{
  845. type: Input
  846. }], breakpoints: [{
  847. type: Input
  848. }], spaceBetween: [{
  849. type: Input
  850. }], slidesPerView: [{
  851. type: Input
  852. }], maxBackfaceHiddenSlides: [{
  853. type: Input
  854. }], grid: [{
  855. type: Input
  856. }], slidesPerGroup: [{
  857. type: Input
  858. }], slidesPerGroupSkip: [{
  859. type: Input
  860. }], centeredSlides: [{
  861. type: Input
  862. }], centeredSlidesBounds: [{
  863. type: Input
  864. }], slidesOffsetBefore: [{
  865. type: Input
  866. }], slidesOffsetAfter: [{
  867. type: Input
  868. }], normalizeSlideIndex: [{
  869. type: Input
  870. }], centerInsufficientSlides: [{
  871. type: Input
  872. }], watchOverflow: [{
  873. type: Input
  874. }], roundLengths: [{
  875. type: Input
  876. }], touchRatio: [{
  877. type: Input
  878. }], touchAngle: [{
  879. type: Input
  880. }], simulateTouch: [{
  881. type: Input
  882. }], shortSwipes: [{
  883. type: Input
  884. }], longSwipes: [{
  885. type: Input
  886. }], longSwipesRatio: [{
  887. type: Input
  888. }], longSwipesMs: [{
  889. type: Input
  890. }], followFinger: [{
  891. type: Input
  892. }], allowTouchMove: [{
  893. type: Input
  894. }], threshold: [{
  895. type: Input
  896. }], touchMoveStopPropagation: [{
  897. type: Input
  898. }], touchStartPreventDefault: [{
  899. type: Input
  900. }], touchStartForcePreventDefault: [{
  901. type: Input
  902. }], touchReleaseOnEdges: [{
  903. type: Input
  904. }], uniqueNavElements: [{
  905. type: Input
  906. }], resistance: [{
  907. type: Input
  908. }], resistanceRatio: [{
  909. type: Input
  910. }], watchSlidesProgress: [{
  911. type: Input
  912. }], grabCursor: [{
  913. type: Input
  914. }], preventClicks: [{
  915. type: Input
  916. }], preventClicksPropagation: [{
  917. type: Input
  918. }], slideToClickedSlide: [{
  919. type: Input
  920. }], preloadImages: [{
  921. type: Input
  922. }], updateOnImagesReady: [{
  923. type: Input
  924. }], loop: [{
  925. type: Input
  926. }], loopAdditionalSlides: [{
  927. type: Input
  928. }], loopedSlides: [{
  929. type: Input
  930. }], loopedSlidesLimit: [{
  931. type: Input
  932. }], loopFillGroupWithBlank: [{
  933. type: Input
  934. }], loopPreventsSlide: [{
  935. type: Input
  936. }], rewind: [{
  937. type: Input
  938. }], allowSlidePrev: [{
  939. type: Input
  940. }], allowSlideNext: [{
  941. type: Input
  942. }], swipeHandler: [{
  943. type: Input
  944. }], noSwiping: [{
  945. type: Input
  946. }], noSwipingClass: [{
  947. type: Input
  948. }], noSwipingSelector: [{
  949. type: Input
  950. }], passiveListeners: [{
  951. type: Input
  952. }], containerModifierClass: [{
  953. type: Input
  954. }], slideClass: [{
  955. type: Input
  956. }], slideBlankClass: [{
  957. type: Input
  958. }], slideActiveClass: [{
  959. type: Input
  960. }], slideDuplicateActiveClass: [{
  961. type: Input
  962. }], slideVisibleClass: [{
  963. type: Input
  964. }], slideDuplicateClass: [{
  965. type: Input
  966. }], slideNextClass: [{
  967. type: Input
  968. }], slideDuplicateNextClass: [{
  969. type: Input
  970. }], slidePrevClass: [{
  971. type: Input
  972. }], slideDuplicatePrevClass: [{
  973. type: Input
  974. }], wrapperClass: [{
  975. type: Input
  976. }], runCallbacksOnInit: [{
  977. type: Input
  978. }], observeParents: [{
  979. type: Input
  980. }], observeSlideChildren: [{
  981. type: Input
  982. }], a11y: [{
  983. type: Input
  984. }], autoplay: [{
  985. type: Input
  986. }], controller: [{
  987. type: Input
  988. }], coverflowEffect: [{
  989. type: Input
  990. }], cubeEffect: [{
  991. type: Input
  992. }], fadeEffect: [{
  993. type: Input
  994. }], flipEffect: [{
  995. type: Input
  996. }], creativeEffect: [{
  997. type: Input
  998. }], cardsEffect: [{
  999. type: Input
  1000. }], hashNavigation: [{
  1001. type: Input
  1002. }], history: [{
  1003. type: Input
  1004. }], keyboard: [{
  1005. type: Input
  1006. }], lazy: [{
  1007. type: Input
  1008. }], mousewheel: [{
  1009. type: Input
  1010. }], parallax: [{
  1011. type: Input
  1012. }], thumbs: [{
  1013. type: Input
  1014. }], zoom: [{
  1015. type: Input
  1016. }], slidesPerGroupAuto: [{
  1017. type: Input
  1018. }], class: [{
  1019. type: Input
  1020. }], id: [{
  1021. type: Input
  1022. }], navigation: [{
  1023. type: Input
  1024. }], pagination: [{
  1025. type: Input
  1026. }], scrollbar: [{
  1027. type: Input
  1028. }], virtual: [{
  1029. type: Input
  1030. }], config: [{
  1031. type: Input
  1032. }], s__beforeBreakpoint: [{
  1033. type: Output,
  1034. args: ['_beforeBreakpoint']
  1035. }], s__containerClasses: [{
  1036. type: Output,
  1037. args: ['_containerClasses']
  1038. }], s__slideClass: [{
  1039. type: Output,
  1040. args: ['_slideClass']
  1041. }], s__swiper: [{
  1042. type: Output,
  1043. args: ['_swiper']
  1044. }], s_activeIndexChange: [{
  1045. type: Output,
  1046. args: ['activeIndexChange']
  1047. }], s_afterInit: [{
  1048. type: Output,
  1049. args: ['afterInit']
  1050. }], s_autoplay: [{
  1051. type: Output,
  1052. args: ['autoplay']
  1053. }], s_autoplayStart: [{
  1054. type: Output,
  1055. args: ['autoplayStart']
  1056. }], s_autoplayStop: [{
  1057. type: Output,
  1058. args: ['autoplayStop']
  1059. }], s_autoplayPause: [{
  1060. type: Output,
  1061. args: ['autoplayPause']
  1062. }], s_autoplayResume: [{
  1063. type: Output,
  1064. args: ['autoplayResume']
  1065. }], s_beforeDestroy: [{
  1066. type: Output,
  1067. args: ['beforeDestroy']
  1068. }], s_beforeInit: [{
  1069. type: Output,
  1070. args: ['beforeInit']
  1071. }], s_beforeLoopFix: [{
  1072. type: Output,
  1073. args: ['beforeLoopFix']
  1074. }], s_beforeResize: [{
  1075. type: Output,
  1076. args: ['beforeResize']
  1077. }], s_beforeSlideChangeStart: [{
  1078. type: Output,
  1079. args: ['beforeSlideChangeStart']
  1080. }], s_beforeTransitionStart: [{
  1081. type: Output,
  1082. args: ['beforeTransitionStart']
  1083. }], s_breakpoint: [{
  1084. type: Output,
  1085. args: ['breakpoint']
  1086. }], s_changeDirection: [{
  1087. type: Output,
  1088. args: ['changeDirection']
  1089. }], s_click: [{
  1090. type: Output,
  1091. args: ['click']
  1092. }], s_doubleTap: [{
  1093. type: Output,
  1094. args: ['doubleTap']
  1095. }], s_doubleClick: [{
  1096. type: Output,
  1097. args: ['doubleClick']
  1098. }], s_destroy: [{
  1099. type: Output,
  1100. args: ['destroy']
  1101. }], s_fromEdge: [{
  1102. type: Output,
  1103. args: ['fromEdge']
  1104. }], s_hashChange: [{
  1105. type: Output,
  1106. args: ['hashChange']
  1107. }], s_hashSet: [{
  1108. type: Output,
  1109. args: ['hashSet']
  1110. }], s_imagesReady: [{
  1111. type: Output,
  1112. args: ['imagesReady']
  1113. }], s_init: [{
  1114. type: Output,
  1115. args: ['init']
  1116. }], s_keyPress: [{
  1117. type: Output,
  1118. args: ['keyPress']
  1119. }], s_lazyImageLoad: [{
  1120. type: Output,
  1121. args: ['lazyImageLoad']
  1122. }], s_lazyImageReady: [{
  1123. type: Output,
  1124. args: ['lazyImageReady']
  1125. }], s_loopFix: [{
  1126. type: Output,
  1127. args: ['loopFix']
  1128. }], s_momentumBounce: [{
  1129. type: Output,
  1130. args: ['momentumBounce']
  1131. }], s_navigationHide: [{
  1132. type: Output,
  1133. args: ['navigationHide']
  1134. }], s_navigationShow: [{
  1135. type: Output,
  1136. args: ['navigationShow']
  1137. }], s_navigationPrev: [{
  1138. type: Output,
  1139. args: ['navigationPrev']
  1140. }], s_navigationNext: [{
  1141. type: Output,
  1142. args: ['navigationNext']
  1143. }], s_observerUpdate: [{
  1144. type: Output,
  1145. args: ['observerUpdate']
  1146. }], s_orientationchange: [{
  1147. type: Output,
  1148. args: ['orientationchange']
  1149. }], s_paginationHide: [{
  1150. type: Output,
  1151. args: ['paginationHide']
  1152. }], s_paginationRender: [{
  1153. type: Output,
  1154. args: ['paginationRender']
  1155. }], s_paginationShow: [{
  1156. type: Output,
  1157. args: ['paginationShow']
  1158. }], s_paginationUpdate: [{
  1159. type: Output,
  1160. args: ['paginationUpdate']
  1161. }], s_progress: [{
  1162. type: Output,
  1163. args: ['progress']
  1164. }], s_reachBeginning: [{
  1165. type: Output,
  1166. args: ['reachBeginning']
  1167. }], s_reachEnd: [{
  1168. type: Output,
  1169. args: ['reachEnd']
  1170. }], s_realIndexChange: [{
  1171. type: Output,
  1172. args: ['realIndexChange']
  1173. }], s_resize: [{
  1174. type: Output,
  1175. args: ['resize']
  1176. }], s_scroll: [{
  1177. type: Output,
  1178. args: ['scroll']
  1179. }], s_scrollbarDragEnd: [{
  1180. type: Output,
  1181. args: ['scrollbarDragEnd']
  1182. }], s_scrollbarDragMove: [{
  1183. type: Output,
  1184. args: ['scrollbarDragMove']
  1185. }], s_scrollbarDragStart: [{
  1186. type: Output,
  1187. args: ['scrollbarDragStart']
  1188. }], s_setTransition: [{
  1189. type: Output,
  1190. args: ['setTransition']
  1191. }], s_setTranslate: [{
  1192. type: Output,
  1193. args: ['setTranslate']
  1194. }], s_slideChange: [{
  1195. type: Output,
  1196. args: ['slideChange']
  1197. }], s_slideChangeTransitionEnd: [{
  1198. type: Output,
  1199. args: ['slideChangeTransitionEnd']
  1200. }], s_slideChangeTransitionStart: [{
  1201. type: Output,
  1202. args: ['slideChangeTransitionStart']
  1203. }], s_slideNextTransitionEnd: [{
  1204. type: Output,
  1205. args: ['slideNextTransitionEnd']
  1206. }], s_slideNextTransitionStart: [{
  1207. type: Output,
  1208. args: ['slideNextTransitionStart']
  1209. }], s_slidePrevTransitionEnd: [{
  1210. type: Output,
  1211. args: ['slidePrevTransitionEnd']
  1212. }], s_slidePrevTransitionStart: [{
  1213. type: Output,
  1214. args: ['slidePrevTransitionStart']
  1215. }], s_slideResetTransitionStart: [{
  1216. type: Output,
  1217. args: ['slideResetTransitionStart']
  1218. }], s_slideResetTransitionEnd: [{
  1219. type: Output,
  1220. args: ['slideResetTransitionEnd']
  1221. }], s_sliderMove: [{
  1222. type: Output,
  1223. args: ['sliderMove']
  1224. }], s_sliderFirstMove: [{
  1225. type: Output,
  1226. args: ['sliderFirstMove']
  1227. }], s_slidesLengthChange: [{
  1228. type: Output,
  1229. args: ['slidesLengthChange']
  1230. }], s_slidesGridLengthChange: [{
  1231. type: Output,
  1232. args: ['slidesGridLengthChange']
  1233. }], s_snapGridLengthChange: [{
  1234. type: Output,
  1235. args: ['snapGridLengthChange']
  1236. }], s_snapIndexChange: [{
  1237. type: Output,
  1238. args: ['snapIndexChange']
  1239. }], s_tap: [{
  1240. type: Output,
  1241. args: ['tap']
  1242. }], s_toEdge: [{
  1243. type: Output,
  1244. args: ['toEdge']
  1245. }], s_touchEnd: [{
  1246. type: Output,
  1247. args: ['touchEnd']
  1248. }], s_touchMove: [{
  1249. type: Output,
  1250. args: ['touchMove']
  1251. }], s_touchMoveOpposite: [{
  1252. type: Output,
  1253. args: ['touchMoveOpposite']
  1254. }], s_touchStart: [{
  1255. type: Output,
  1256. args: ['touchStart']
  1257. }], s_transitionEnd: [{
  1258. type: Output,
  1259. args: ['transitionEnd']
  1260. }], s_transitionStart: [{
  1261. type: Output,
  1262. args: ['transitionStart']
  1263. }], s_update: [{
  1264. type: Output,
  1265. args: ['update']
  1266. }], s_zoomChange: [{
  1267. type: Output,
  1268. args: ['zoomChange']
  1269. }], s_swiper: [{
  1270. type: Output,
  1271. args: ['swiper']
  1272. }], s_lock: [{
  1273. type: Output,
  1274. args: ['lock']
  1275. }], s_unlock: [{
  1276. type: Output,
  1277. args: ['unlock']
  1278. }], prevElRef: [{
  1279. type: ViewChild,
  1280. args: ['prevElRef', { static: false }]
  1281. }], nextElRef: [{
  1282. type: ViewChild,
  1283. args: ['nextElRef', { static: false }]
  1284. }], scrollbarElRef: [{
  1285. type: ViewChild,
  1286. args: ['scrollbarElRef', { static: false }]
  1287. }], paginationElRef: [{
  1288. type: ViewChild,
  1289. args: ['paginationElRef', { static: false }]
  1290. }], slidesEl: [{
  1291. type: ContentChildren,
  1292. args: [SwiperSlideDirective, { descendants: false, emitDistinctChangesOnly: true }]
  1293. }], containerClasses: [{
  1294. type: HostBinding,
  1295. args: ['class']
  1296. }] } });
  1297. class SwiperModule {
  1298. }
  1299. SwiperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwiperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
  1300. SwiperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwiperModule, declarations: [SwiperComponent, SwiperSlideDirective], imports: [CommonModule], exports: [SwiperComponent, SwiperSlideDirective] });
  1301. SwiperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwiperModule, imports: [[CommonModule]] });
  1302. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwiperModule, decorators: [{
  1303. type: NgModule,
  1304. args: [{
  1305. declarations: [SwiperComponent, SwiperSlideDirective],
  1306. exports: [SwiperComponent, SwiperSlideDirective],
  1307. imports: [CommonModule],
  1308. }]
  1309. }] });
  1310. /*
  1311. * Public API Surface of angular
  1312. */
  1313. /**
  1314. * Generated bundle index. Do not edit.
  1315. */
  1316. export { SwiperComponent, SwiperModule, SwiperSlideDirective };
  1317. //# sourceMappingURL=swiper_angular.mjs.map