nextalys-carousel 0.0.54 → 0.0.55

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.
@@ -0,0 +1,9 @@
1
+ import { Directive } from "@angular/core";
2
+ export class NxsSwiperTemplateDirective {
3
+ }
4
+ NxsSwiperTemplateDirective.decorators = [
5
+ { type: Directive, args: [{
6
+ selector: '[nxsSwiperTemplate]',
7
+ },] }
8
+ ];
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpcGVyLWRpcmVjdGl2ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGliL254cy1jYXJvdXNlbC9zd2lwZXItZGlyZWN0aXZlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBSzFDLE1BQU0sT0FBTywwQkFBMEI7OztZQUh0QyxTQUFTLFNBQUM7Z0JBQ1AsUUFBUSxFQUFFLHFCQUFxQjthQUNsQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IERpcmVjdGl2ZSB9IGZyb20gXCJAYW5ndWxhci9jb3JlXCI7XG5cbkBEaXJlY3RpdmUoe1xuICAgIHNlbGVjdG9yOiAnW254c1N3aXBlclRlbXBsYXRlXScsXG59KVxuZXhwb3J0IGNsYXNzIE54c1N3aXBlclRlbXBsYXRlRGlyZWN0aXZlIHsgfVxuIl19
@@ -2,5 +2,6 @@
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
4
  export * from './public-api';
5
- export { NxsCarouselDialogComponent as ɵa } from './lib/nxs-carousel/nxs-carousel-dialog.component';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmV4dGFseXMtY2Fyb3VzZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbmV4dGFseXMtY2Fyb3VzZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQztBQUU3QixPQUFPLEVBQUMsMEJBQTBCLElBQUksRUFBRSxFQUFDLE1BQU0sa0RBQWtELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG5cbmV4cG9ydCB7TnhzQ2Fyb3VzZWxEaWFsb2dDb21wb25lbnQgYXMgybVhfSBmcm9tICcuL2xpYi9ueHMtY2Fyb3VzZWwvbnhzLWNhcm91c2VsLWRpYWxvZy5jb21wb25lbnQnOyJdfQ==
5
+ export { NxsCarouselDialogComponent as ɵb } from './lib/nxs-carousel/nxs-carousel-dialog.component';
6
+ export { NxsSwiperTemplateDirective as ɵa } from './lib/nxs-carousel/swiper-directives';
7
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmV4dGFseXMtY2Fyb3VzZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbmV4dGFseXMtY2Fyb3VzZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQztBQUU3QixPQUFPLEVBQUMsMEJBQTBCLElBQUksRUFBRSxFQUFDLE1BQU0sa0RBQWtELENBQUM7QUFDbEcsT0FBTyxFQUFDLDBCQUEwQixJQUFJLEVBQUUsRUFBQyxNQUFNLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuXG5leHBvcnQge054c0Nhcm91c2VsRGlhbG9nQ29tcG9uZW50IGFzIMm1Yn0gZnJvbSAnLi9saWIvbnhzLWNhcm91c2VsL254cy1jYXJvdXNlbC1kaWFsb2cuY29tcG9uZW50JztcbmV4cG9ydCB7TnhzU3dpcGVyVGVtcGxhdGVEaXJlY3RpdmUgYXMgybVhfSBmcm9tICcuL2xpYi9ueHMtY2Fyb3VzZWwvc3dpcGVyLWRpcmVjdGl2ZXMnOyJdfQ==
@@ -1,11 +1,11 @@
1
- import { __awaiter } from 'tslib';
2
- import { Component, ViewEncapsulation, Inject, EventEmitter, NgZone, PLATFORM_ID, Optional, Input, ViewChild, Output, NgModule } from '@angular/core';
1
+ import { Component, ViewEncapsulation, Inject, Directive, EventEmitter, NgZone, PLATFORM_ID, Optional, ContentChildren, TemplateRef, ViewChild, Input, Output, NgModule } from '@angular/core';
3
2
  import { MAT_DIALOG_DATA, MatDialogRef, MatDialog, MatDialogModule } from '@angular/material/dialog';
4
3
  import { isPlatformBrowser, CommonModule } from '@angular/common';
5
4
  import { EventsCollector } from 'nextalys-js-helpers/dist/events';
5
+ import SwiperCore, { Navigation, Pagination, Autoplay, Lazy, Thumbs } from 'swiper';
6
+ import { SwiperModule } from 'swiper/angular';
6
7
  import { MatButtonModule } from '@angular/material/button';
7
8
  import { MatIconModule } from '@angular/material/icon';
8
- import { ObserversModule } from '@angular/cdk/observers';
9
9
 
10
10
  class NxsCarouselModuleConfig {
11
11
  constructor() {
@@ -44,6 +44,16 @@ NxsCarouselDialogComponent.ctorParameters = () => [
44
44
  { type: MatDialogRef }
45
45
  ];
46
46
 
47
+ class NxsSwiperTemplateDirective {
48
+ }
49
+ NxsSwiperTemplateDirective.decorators = [
50
+ { type: Directive, args: [{
51
+ selector: '[nxsSwiperTemplate]',
52
+ },] }
53
+ ];
54
+
55
+ // install Swiper modules
56
+ SwiperCore.use([Navigation, Pagination, Autoplay, Lazy, Thumbs]);
47
57
  class NxsCarouselComponent {
48
58
  constructor(matDialog, zone, platformId, config) {
49
59
  this.matDialog = matDialog;
@@ -51,10 +61,9 @@ class NxsCarouselComponent {
51
61
  this.platformId = platformId;
52
62
  this.config = config;
53
63
  this.lazy = true;
54
- this.mutationObserver = null;
55
- this.recreateSliderSubscribed = false;
56
64
  this.eventsCollector = new EventsCollector();
57
- this.options = {};
65
+ this.options = null;
66
+ this.thumbnailsOptions = null;
58
67
  this.hasHtmlContent = false;
59
68
  this.slidesCount = 0;
60
69
  this.slideChange = new EventEmitter();
@@ -69,133 +78,27 @@ class NxsCarouselComponent {
69
78
  }
70
79
  set setOptions(val) {
71
80
  this.options = this.setDefaultOptions(val, false);
72
- }
73
- set setImages(val) {
74
- this.images = val;
75
- this.initSlides();
76
- this.createSlider(true);
81
+ this.setThumbnailsOptions();
77
82
  }
78
83
  log(...args) {
79
84
  if (!this.config.debug)
80
85
  return;
81
86
  console.log('[NxsCarousel]', ...args);
82
87
  }
83
- onContentChange(changes) {
84
- // console.log("Log: NxsCarouselComponent -> onContentChange -> changes", changes);
85
- // changes.forEach(change => console.log(change.target));
86
- }
87
- initSlides() {
88
- if (!this.isBrowser) {
89
- this.log('prevent initSlides on platform server');
90
- return;
91
- }
92
- if (!this.nxsSlidesWrapper) {
93
- this.log('can not initSlides : nxsSlidesWrapper is not defined !');
94
- return;
95
- }
96
- this.log('initSlides begins');
97
- this.zone.runOutsideAngular(() => {
98
- if (!this.hasHtmlContent && this.images) {
99
- this.nxsSlidesWrapper.nativeElement.innerHTML = '';
100
- for (const cImage of this.images) {
101
- const div = document.createElement('div');
102
- div.className = 'swiper-slide';
103
- if (this.lazy) {
104
- div.dataset.background = cImage.src;
105
- div.className += ' swiper-lazy';
106
- }
107
- else {
108
- div.style.backgroundImage = 'url(' + cImage.src + ')';
109
- }
110
- if (this.options.nxsCarouselImageBackgroundSize)
111
- div.style.backgroundSize = this.options.nxsCarouselImageBackgroundSize;
112
- this.nxsSlidesWrapper.nativeElement.appendChild(div);
113
- }
114
- this.slidesCount = this.images.length;
115
- if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {
116
- this.nxsThumbnailsSlidesWrapper.nativeElement.innerHTML = '';
117
- for (const cImage of this.images) {
118
- const div = document.createElement('div');
119
- div.className = 'swiper-slide';
120
- if (this.lazy) {
121
- div.dataset.background = cImage.src;
122
- div.className += ' swiper-lazy';
123
- }
124
- else {
125
- div.style.backgroundImage = 'url(' + cImage.src + ')';
126
- }
127
- this.nxsThumbnailsSlidesWrapper.nativeElement.appendChild(div);
128
- }
129
- }
130
- this.log('initSlides - images are defined - slides count => ', this.slidesCount);
131
- }
132
- else if (this.hasHtmlContent) {
133
- this.log('initSlides - html content - slides length => ', this.nxsSlidesWrapper.nativeElement.children.length);
134
- // eslint-disable-next-line @typescript-eslint/prefer-for-of
135
- for (let i = 0; i < this.nxsSlidesWrapper.nativeElement.children.length; i++) {
136
- const child = this.nxsSlidesWrapper.nativeElement.children[i];
137
- if (!child.className)
138
- child.className = 'swiper-slide';
139
- else if (child.className.indexOf('swiper-slide') === -1) {
140
- child.className += ' swiper-slide';
141
- }
142
- }
143
- this.slidesCount = this.nxsSlidesWrapper.nativeElement.children.length;
144
- this.log('initSlides - html content - slides count => ', this.slidesCount);
145
- }
146
- });
147
- }
148
88
  destroy() {
149
- var _a, _b, _c;
89
+ var _a;
150
90
  if (!this.isBrowser) {
151
91
  return;
152
92
  }
153
93
  (_a = this.eventsCollector) === null || _a === void 0 ? void 0 : _a.unsubscribeAll();
154
- (_b = this.mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
155
- (_c = this.sliderInstance) === null || _c === void 0 ? void 0 : _c.destroy();
156
94
  }
157
95
  ngOnDestroy() {
158
96
  this.destroy();
159
97
  }
160
- subscribeToSlideChanged() {
161
- if (!this.hasHtmlContent) {
162
- this.log('subscribeToSlideChanged cannot be subscribed : has no html content');
163
- return;
164
- }
165
- if (!this.nxsSlidesWrapper || !this.nxsSlidesWrapper.nativeElement) {
166
- this.log('subscribeToSlideChanged error : nxsSlidesWrapper is not defined');
167
- return;
168
- }
169
- if (typeof MutationObserver === 'undefined') {
170
- this.log('cannot use mutation observer');
171
- return;
172
- }
173
- if (this.mutationObserver)
174
- this.mutationObserver.disconnect();
175
- this.log('subscribe to mutation observer');
176
- this.mutationObserver = new MutationObserver((mutationsList) => {
177
- // console.log("Log: NxsCarouselComponent -> subscribeToSlideChanged -> mutationsList", mutationsList);
178
- // console.log("Log: NxsCarouselComponent -> subscribeToSlideChanged -> MutationObserver");
179
- this.log('mutation observer - html content has changed');
180
- if (mutationsList.length === 0)
181
- return;
182
- let mustUpdate = false;
183
- for (const mutation of mutationsList) {
184
- if (mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0) {
185
- mustUpdate = true;
186
- break;
187
- }
188
- }
189
- if (mustUpdate) {
190
- this.initSlides();
191
- this.createSlider(true);
192
- }
193
- });
194
- this.mutationObserver.observe(this.nxsSlidesWrapper.nativeElement, { childList: true, attributes: false, });
195
- }
196
98
  ngAfterViewInit() {
197
- this.initSlides();
198
- this.createSlider(true);
99
+ // console.log('thi.contents', this.contents);
100
+ // this.initSlides();
101
+ // this.createSlider(true);
199
102
  }
200
103
  getMainSliderHeight() {
201
104
  if (!this.options)
@@ -213,10 +116,18 @@ class NxsCarouselComponent {
213
116
  setDefaultOptions(options, forDialog) {
214
117
  var _a;
215
118
  if (!options && forDialog) {
216
- options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true };
119
+ options = {
120
+ nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true,
121
+ lazy: true,
122
+ };
123
+ }
124
+ else if (!options) {
125
+ options = {
126
+ nxsShowNavigationBullets: true, loop: true,
127
+ nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {},
128
+ lazy: true,
129
+ };
217
130
  }
218
- else if (!options)
219
- options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {} };
220
131
  if (options.nxsCarouselDialogOptions) {
221
132
  if (typeof options.nxsCarouselDialogOptions.nxsThumbnails === 'undefined')
222
133
  options.nxsCarouselDialogOptions.nxsThumbnails = { show: false };
@@ -252,8 +163,37 @@ class NxsCarouselComponent {
252
163
  options.nxsfullscreenOnClick = false;
253
164
  if (options.nxsThumbnails.onMainSlider)
254
165
  options.nxsShowNavigationBullets = false;
166
+ if (typeof options.lazy === 'undefined')
167
+ options.lazy = true;
168
+ if (typeof options.navigation === 'undefined')
169
+ options.navigation = true;
170
+ if (typeof options.pagination === 'undefined')
171
+ options.pagination = { clickable: true };
172
+ // console.log("Log ~ file: nxs-carousel.component.ts ~ line 272 ~ NxsCarouselComponent ~ setDefaultOptions ~ options", options);
255
173
  return options;
256
174
  }
175
+ setThumbnailsOptions() {
176
+ var _a, _b;
177
+ if (!!((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.nxsThumbnails) === null || _b === void 0 ? void 0 : _b.show)) {
178
+ this.thumbnailsOptions = {
179
+ slidesPerView: this.options.nxsThumbnails.perView,
180
+ loop: false,
181
+ freeMode: true,
182
+ // watchSlidesVisibility: true,
183
+ watchSlidesProgress: true,
184
+ breakpoints: this.options.nxsThumbnails.breakpoints,
185
+ // spaceBetween: 10,
186
+ };
187
+ if (this.lazy) {
188
+ // Disable preloading of all images
189
+ this.thumbnailsOptions.preloadImages = false;
190
+ // Enable lazy loading
191
+ this.thumbnailsOptions.lazy = true;
192
+ }
193
+ // this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);
194
+ // this.options.thumbs = { swiper: this.thumbnailsSliderInstance };
195
+ }
196
+ }
257
197
  showFullScreenCarousel(images, wrapperClass) {
258
198
  this.options.nxsCarouselDialogOptions = this.setDefaultOptions(this.options.nxsCarouselDialogOptions, true);
259
199
  const data = { images, wrapperClass, options: this.options.nxsCarouselDialogOptions };
@@ -265,110 +205,72 @@ class NxsCarouselComponent {
265
205
  disableClose: !this.options.nxsCarouselDialogExitable,
266
206
  });
267
207
  }
268
- createSlider(forceRecreate) {
269
- if (!this.isBrowser) {
270
- this.log('prevent createSlider : platform is server');
271
- return;
272
- }
273
- if (!this.nxsSliderContainer) {
274
- this.log('can not createSlider : nxsSliderContainer is not defined !');
275
- return;
276
- }
277
- this.log('createSlider', this.nxsSliderContainer.nativeElement);
278
- if (this.slidesCount === 0) {
279
- this.log('can not createSlider : slidesCount === 0');
280
- this.subscribeToSlideChanged();
281
- return;
282
- }
283
- if (this.sliderInstance && !forceRecreate) {
284
- this.log('can re create slider => slider is already created.');
285
- return;
286
- }
287
- this.zone.runOutsideAngular(() => __awaiter(this, void 0, void 0, function* () {
288
- this.destroy();
289
- this.options.pagination = {
290
- el: '.nxs-carousel-pagination',
291
- clickable: true,
292
- type: 'bullets',
293
- };
294
- this.options.navigation = {
295
- nextEl: '.nxs-carousel-button-next',
296
- prevEl: '.nxs-carousel-button-prev',
297
- };
298
- if (!this.swiperLibrary)
299
- this.swiperLibrary = yield import('swiper');
300
- const Swiper = this.swiperLibrary.default;
301
- if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {
302
- const thumbnailsOptions = {
303
- slidesPerView: this.options.nxsThumbnails.perView,
304
- loop: false,
305
- freeMode: true,
306
- watchSlidesVisibility: true,
307
- watchSlidesProgress: true,
308
- breakpoints: this.options.nxsThumbnails.breakpoints,
309
- // spaceBetween: 10,
310
- };
311
- if (this.lazy) {
312
- // Disable preloading of all images
313
- thumbnailsOptions.preloadImages = false;
314
- // Enable lazy loading
315
- thumbnailsOptions.lazy = true;
316
- }
317
- this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);
318
- this.options.thumbs = { swiper: this.thumbnailsSliderInstance };
319
- }
320
- if (this.lazy) {
321
- // Disable preloading of all images
322
- this.options.preloadImages = false;
323
- // Enable lazy loading
324
- this.options.lazy = true;
325
- }
326
- // console.log("Log ~ file: nxs-carousel.component.ts ~ line 323 ~ NxsCarouselComponent ~ this.zone.runOutsideAngular ~ this.options", this.options);
327
- this.sliderInstance = new Swiper(this.nxsSliderContainer.nativeElement, this.options);
328
- this.log('sliderInstance has been created', this.sliderInstance);
329
- this.sliderInstance.on('slideChange', () => {
330
- this.zone.run(() => {
331
- this.currentSlide = this.sliderInstance.realIndex;
332
- this.log("slideChange", this.currentSlide);
333
- this.slideChange.next(this.currentSlide);
334
- });
335
- });
336
- this.sliderInstance.on('click', (evt) => {
337
- const target = evt.target;
338
- if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)
339
- return;
340
- this.zone.run(() => {
341
- this.slideClick.next(evt);
342
- if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {
343
- this.showFullScreenCarousel(this.images, 'fullscreen-carousel');
344
- }
345
- });
346
- });
347
- this.subscribeToSlideChanged();
348
- }));
349
- }
350
208
  goToSlide(index, speed) {
351
- if (!this.sliderInstance)
352
- return;
353
- this.sliderInstance.slideTo(index, speed);
209
+ var _a;
210
+ (_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.slideTo(index, speed);
354
211
  }
355
212
  next() {
356
- if (!this.sliderInstance)
357
- return;
358
- this.sliderInstance.slideNext();
213
+ var _a;
214
+ (_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.slideNext();
359
215
  }
360
216
  previous() {
361
- if (!this.sliderInstance)
362
- return;
363
- this.sliderInstance.slidePrev();
217
+ var _a;
218
+ (_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.slidePrev();
219
+ }
220
+ onSwiperThumbnails(instance) {
221
+ var _a, _b;
222
+ if ((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.nxsThumbnails) === null || _b === void 0 ? void 0 : _b.show)
223
+ this.thumbnailsSwiperInstance = instance;
224
+ else
225
+ this.thumbnailsSwiperInstance = null;
226
+ // if (this.options?.nxsThumbnails?.show) {
227
+ // const optionsClone = MainHelpers.cloneObject(this.options);
228
+ // optionsClone.thumbs = { swiper: this.thumbnailsSwiperInstance };
229
+ // // this.options = optionsClone;
230
+ // // this.options = { ...this.options, thumbs: { swiper: this.thumbnailsSwiperInstance } };
231
+ // console.log("Log ~ file: nxs-carousel.component.ts ~ line 416 ~ NxsCarouselComponent ~ onSwiperThumbnails ~ this.options ", this.options);
232
+ // this.options.thumbs = { swiper: this.thumbnailsSwiperInstance };
233
+ // }
234
+ }
235
+ onSwiper(instance) {
236
+ this.log('swiper ready - instance', instance);
237
+ this.swiperInstance = instance;
238
+ this.swiperInstance.on('click', (swiperInstance, evt) => {
239
+ // console.log("Log ~ file: nxs-carousel.component.ts ~ line 392 ~ NxsCarouselComponent ~ this.swiperInstance.on ~ evt", evt);
240
+ const target = evt.target;
241
+ if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)
242
+ return;
243
+ this.runInZone(() => {
244
+ this.slideClick.next(evt);
245
+ if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {
246
+ this.showFullScreenCarousel(this.images, 'fullscreen-carousel');
247
+ }
248
+ });
249
+ });
250
+ }
251
+ runInZone(callback, ...args) {
252
+ if (!this.zone) {
253
+ callback(args);
254
+ }
255
+ return this.zone.run(() => callback(args));
256
+ }
257
+ onSlideChange(instances) {
258
+ // this.swiperInstance = instance;
259
+ // this.log('slide change - instance', instance);
260
+ this.runInZone(() => {
261
+ var _a;
262
+ this.currentSlide = ((_a = this.swiperInstance) === null || _a === void 0 ? void 0 : _a.realIndex) || 0;
263
+ this.log('slide change - currentSlide', this.currentSlide);
264
+ this.slideChange.next(this.currentSlide);
265
+ });
364
266
  }
365
267
  }
366
268
  NxsCarouselComponent.decorators = [
367
269
  { type: Component, args: [{
368
270
  selector: 'nxs-carousel',
369
- template: "<div #nxsSliderContainer\n [ngClass]=\"{'swiper-container':true,'nxs-slider-with-thumbnails':!!options.nxsThumbnails && options.nxsThumbnails.show}\"\n [style.height]=\"getMainSliderHeight()\">\n <div class=\"swiper-wrapper\" #nxsSlidesWrapper>\n <ng-content>\n\n </ng-content>\n </div>\n <!-- (cdkObserveContent)=\"onContentChange($event)\" -->\n <!-- If we need pagination -->\n <div class=\"swiper-pagination nxs-carousel-pagination\"\n [style.display]=\"slidesCount>0 && options && options.nxsShowNavigationBullets ? '':'none'\"></div>\n\n <!-- If we need navigation buttons -->\n <ng-container *ngIf=\"options.nxsShowNavigationArrows\">\n <div class=\"nxs-carousel-button-prev swiper-button-prev\"></div>\n <div class=\"nxs-carousel-button-next swiper-button-next\"></div>\n </ng-container>\n\n <ng-container *ngIf=\"images && options.nxsShowImagesCount\">\n <div class=\"nxs-image-counter\">\n {{currentSlide+1}} / {{images.length}}\n </div>\n </ng-container>\n\n</div>\n\n<div #nxsThumbnailsSliderContainer\n [style.display]=\"(images && !!options.nxsThumbnails && options.nxsThumbnails.show) ?'':'none'\"\n [style.height]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight) ? (options.nxsThumbnails.percentHeight + '%'):''\"\n [style.top]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight && options.nxsThumbnails.onMainSlider) ? ('-' + (options.nxsThumbnails.percentHeight) + '%'):''\"\n [ngClass]=\"{'swiper-container':true, 'nxs-slider-thumbnails-container':true,'nxs-slider-thumbnails-on-main-slider':options.nxsThumbnails && options.nxsThumbnails.onMainSlider}\">\n <div class=\"swiper-wrapper\" #nxsThumbnailsSlidesWrapper>\n\n </div>\n\n</div>",
271
+ template: "<div *ngIf=\"options\"\n [ngClass]=\"{'swiper-container':true,'nxs-slider-with-thumbnails':!!options.nxsThumbnails && options.nxsThumbnails.show}\"\n [style.height]=\"getMainSliderHeight()\">\n <swiper [config]=\"options\" (swiper)=\"onSwiper($event)\" (slideChange)=\"onSlideChange($event)\"\n [thumbs]=\"{ swiper: thumbnailsSwiperInstance }\">\n <ng-container *ngIf=\"hasHtmlContent\">\n <ng-template *ngFor=\"let slide of contents\" swiperSlide>\n <ng-template [ngTemplateOutlet]=\"slide\" [ngTemplateOutletContext]=\"{\n $implicit: slide\n }\"></ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!hasHtmlContent && images?.length\">\n <ng-template swiperSlide *ngFor=\"let slideImage of images\">\n <img class=\"nxs-image-slide swiper-lazy\" [attr.data-src]=\"slideImage.src\" />\n <div class=\"swiper-lazy-preloader swiper-lazy-preloader-black\"></div>\n </ng-template>\n </ng-container>\n </swiper>\n <ng-container *ngIf=\"images && options.nxsShowImagesCount\">\n <div class=\"nxs-image-counter\">\n {{currentSlide+1}} / {{images.length}}\n </div>\n </ng-container>\n</div>\n\n<div *ngIf=\"thumbnailsOptions && images?.length\"\n [style.height]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight) ? (options.nxsThumbnails.percentHeight + '%'):''\"\n [style.top]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight && options.nxsThumbnails.onMainSlider) ? ('-' + (options.nxsThumbnails.percentHeight) + '%'):''\"\n [ngClass]=\"{'swiper-container':true, 'nxs-slider-thumbnails-container':true,'nxs-slider-thumbnails-on-main-slider':options.nxsThumbnails && options.nxsThumbnails.onMainSlider}\">\n <swiper [config]=\"thumbnailsOptions\" (swiper)=\"onSwiperThumbnails($event)\">\n <ng-template swiperSlide *ngFor=\"let slideImage of images\">\n <img class=\"nxs-image-slide swiper-lazy\" [attr.data-src]=\"slideImage.src\" />\n <div class=\"swiper-lazy-preloader swiper-lazy-preloader-black\"></div>\n </ng-template>\n </swiper>\n</div>",
370
272
  encapsulation: ViewEncapsulation.None,
371
- styles: ["nxs-carousel{display:block;height:100%;position:relative;--swiper-navigation-color:#fff;--swiper-theme-color:#fff}nxs-carousel .swiper-container{width:100%;display:block;position:relative;height:100%}nxs-carousel .swiper-container .swiper-wrapper .swiper-slide{height:100%;position:relative;width:100%;min-height:50px;background-size:cover;background-position:50%;background-repeat:no-repeat}nxs-carousel .swiper-container.nxs-slider-with-thumbnails{height:80%}nxs-carousel .swiper-container.nxs-slider-thumbnails-container{height:20%;background:transparent;padding:6px 0}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide{cursor:pointer;border-radius:6px;margin:0 6px;border:2px solid transparent}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide.swiper-slide-thumb-active{border:2px solid #add8e6}nxs-carousel .swiper-container.nxs-slider-thumbnails-on-main-slider{top:-20%}nxs-carousel .nxs-image-counter{position:absolute;top:0;right:0;color:#fff;padding:4px;font-weight:700;z-index:10}"]
273
+ styles: ["@import \"~swiper/swiper.min.css\";@import \"~swiper/modules/navigation/navigation.min.css\";@import \"~swiper/modules/pagination/pagination.min.css\";@import \"~swiper/modules/lazy/lazy.min.css\";nxs-carousel{display:block;height:100%;position:relative;--swiper-navigation-color:#fff;--swiper-pagination-color:#fff;--swiper-theme-color:#fff}nxs-carousel .swiper-container{width:100%;height:100%;display:block;position:relative}nxs-carousel .swiper-container swiper{height:100%}nxs-carousel .swiper-container .swiper-wrapper .swiper-slide{height:100%;position:relative;width:100%;min-height:50px;background-size:cover;background-position:50%;background-repeat:no-repeat}nxs-carousel .swiper-container .nxs-image-slide{height:100%;-o-object-fit:cover;object-fit:cover;width:100%;-o-object-position:center;object-position:center}nxs-carousel .swiper-container.nxs-slider-with-thumbnails{height:80%}nxs-carousel .swiper-container.nxs-slider-thumbnails-container{height:20%;background:transparent;padding:6px 0}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide{cursor:pointer;border-radius:6px;margin:0 6px;border:2px solid transparent}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide.swiper-slide-thumb-active{border:2px solid #add8e6}nxs-carousel .swiper-container.nxs-slider-thumbnails-on-main-slider{top:-20%}nxs-carousel .nxs-image-counter{position:absolute;top:0;right:0;color:#fff;padding:4px;font-weight:700;z-index:10}"]
372
274
  },] }
373
275
  ];
374
276
  NxsCarouselComponent.ctorParameters = () => [
@@ -378,13 +280,11 @@ NxsCarouselComponent.ctorParameters = () => [
378
280
  { type: NxsCarouselModuleConfig, decorators: [{ type: Optional }] }
379
281
  ];
380
282
  NxsCarouselComponent.propDecorators = {
283
+ contents: [{ type: ContentChildren, args: [NxsSwiperTemplateDirective, { read: TemplateRef },] }],
284
+ swiperComponent: [{ type: ViewChild, args: ['swiper', { static: false },] }],
381
285
  lazy: [{ type: Input }],
382
- nxsSliderContainer: [{ type: ViewChild, args: ['nxsSliderContainer', { static: true },] }],
383
- nxsSlidesWrapper: [{ type: ViewChild, args: ['nxsSlidesWrapper', { static: true },] }],
384
- nxsThumbnailsSliderContainer: [{ type: ViewChild, args: ['nxsThumbnailsSliderContainer', { static: true },] }],
385
- nxsThumbnailsSlidesWrapper: [{ type: ViewChild, args: ['nxsThumbnailsSlidesWrapper', { static: true },] }],
286
+ images: [{ type: Input }],
386
287
  setOptions: [{ type: Input, args: ['options',] }],
387
- setImages: [{ type: Input, args: ['images',] }],
388
288
  hasHtmlContent: [{ type: Input }],
389
289
  slideChange: [{ type: Output }],
390
290
  slideClick: [{ type: Output }]
@@ -405,16 +305,18 @@ NxsCarouselModule.decorators = [
405
305
  declarations: [
406
306
  NxsCarouselComponent,
407
307
  NxsCarouselDialogComponent,
308
+ NxsSwiperTemplateDirective,
408
309
  ],
409
310
  imports: [
410
311
  CommonModule,
411
312
  MatIconModule,
412
313
  MatButtonModule,
413
314
  MatDialogModule,
414
- ObserversModule,
315
+ SwiperModule,
415
316
  ],
416
317
  exports: [
417
318
  NxsCarouselComponent,
319
+ NxsSwiperTemplateDirective,
418
320
  ],
419
321
  },] }
420
322
  ];
@@ -423,5 +325,5 @@ NxsCarouselModule.decorators = [
423
325
  * Generated bundle index. Do not edit.
424
326
  */
425
327
 
426
- export { NxsCarouselComponent, NxsCarouselModule, NxsCarouselModuleConfig, NxsCarouselDialogComponent as ɵa };
328
+ export { NxsCarouselComponent, NxsCarouselModule, NxsCarouselModuleConfig, NxsSwiperTemplateDirective as ɵa, NxsCarouselDialogComponent as ɵb };
427
329
  //# sourceMappingURL=nextalys-carousel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nextalys-carousel.js","sources":["../../src/lib/nxs-carousel/nxs-carousel-types.ts","../../src/lib/nxs-carousel/nxs-carousel-dialog.component.ts","../../src/lib/nxs-carousel/nxs-carousel.component.ts","../../src/lib/nxs-carousel/nxs-carousel.module.ts","../../src/nextalys-carousel.ts"],"sourcesContent":["export interface NxsCarouselImage {\n alt?: string;\n src: string;\n}\nexport interface SwiperInstance {\n realIndex: number;\n activeIndex: number;\n on: (evt: 'slideChange' | 'click', cb: (data: any) => void) => void;\n destroy: (deleteInstance?: boolean, cleanStyles?: boolean) => void;\n slideTo: (index: number, speed?: number, runCallbacks?: boolean) => void;\n slideNext: (speed?: number, runCallbacks?: boolean) => void;\n slidePrev: (speed?: number, runCallbacks?: boolean) => void;\n}\nexport interface NxsCarouselOptions {\n watchSlidesVisibility?: boolean;\n watchSlidesProgress?: boolean;\n freeMode?: boolean;\n effect?: \"slide\" | \"fade\" | \"cube\" | \"coverflow\" | \"flip\";\n autoplay?: { delay: number; stopOnLastSlide?: boolean; disableOnInteraction?: boolean; reverseDirection?: boolean; waitForTransition?: boolean };\n roundLengths?: boolean;\n init?: boolean;\n initialSlide?: number;\n updateOnWindowResize?: boolean;\n direction?: 'horizontal' | 'vertical';\n slidesPerView?: number | 'auto';\n centeredSlides?: boolean;\n centeredSlidesBounds?: boolean;\n loop?: boolean;\n coverflowEffect?: {\n rotate: number;\n stretch: number;\n depth?: number;\n modifier?: number;\n slideShadows?: boolean;\n };\n // Disable preloading of all images\n preloadImages?: boolean;\n // Enable lazy loading\n lazy?: boolean;\n pagination?: {\n el: string;\n clickable: boolean;\n type?: \"bullets\" | \"fraction\" | \"progressbar\" | \"custom\";\n };\n navigation?: {\n nextEl: string;\n prevEl: string;\n };\n spaceBetween?: number;\n breakpoints?: {\n [size: number]: {\n spaceBetween?: number;\n slidesPerView: number | 'auto';\n };\n };\n thumbs?: { swiper: SwiperInstance };\n nxsShowNavigationBullets?: boolean;\n nxsShowNavigationArrows?: boolean;\n nxsThumbnails?: {\n show: boolean; onMainSlider?: boolean; percentHeight?: number; perView?: number; breakpoints?: {\n [size: number]: {\n spaceBetween?: number;\n slidesPerView: number | 'auto';\n };\n };\n };\n nxsShowImagesCount?: boolean;\n nxsfullscreenOnClick?: boolean;\n /**\n * background mode : cover, contain, auto, etc...\n * default => cover\n */\n nxsCarouselImageBackgroundSize?: string;\n nxsCarouselDialogOptions?: NxsCarouselOptions;\n nxsCarouselDialogExitable?: boolean;\n nxsCarouselDialogSize?: { width: string; height: string; };\n}\nexport class NxsCarouselModuleConfig {\n debug?: boolean = false;\n}","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { NxsCarouselImage, NxsCarouselOptions } from './nxs-carousel-types';\n\nexport interface NxsCarouselDialogData {\n images: NxsCarouselImage[];\n options?: NxsCarouselOptions;\n wrapperClass?: string;\n}\n@Component({\n selector: 'nxs-carousel-dialog',\n template: `\n <div class=\"nxs-carousel-dialog-flex-wrapper\">\n <div class=\"nxs-carousel-dialog-header\">\n <button (click)=\"dialogRef.close()\" mat-icon-button><mat-icon>close</mat-icon></button>\n </div>\n <div [class]=\"wrapperClass\">\n <nxs-carousel [options]=\"data.options\" [images]=\"data.images\"></nxs-carousel>\n </div>\n</div>\n `,\n styleUrls: ['./nxs-carousel-dialog.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class NxsCarouselDialogComponent {\n public wrapperClass: string = 'nxs-carousel-wrapper';\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: NxsCarouselDialogData,\n public dialogRef: MatDialogRef<NxsCarouselDialogComponent>,\n ) {\n if (data.wrapperClass)\n this.wrapperClass += ' ' + data.wrapperClass;\n }\n\n}\n","import { Component, ViewEncapsulation, Input, ViewChild, ElementRef, Output, EventEmitter, PLATFORM_ID, Inject, Optional, NgZone, SimpleChanges } from '@angular/core';\nimport { NxsCarouselOptions, NxsCarouselImage, SwiperInstance, NxsCarouselModuleConfig } from './nxs-carousel-types';\nimport { NxsCarouselDialogData, NxsCarouselDialogComponent } from './nxs-carousel-dialog.component';\nimport { MatDialog } from '@angular/material/dialog';\nimport { isPlatformBrowser } from '@angular/common';\nimport { EventsCollector } from 'nextalys-js-helpers/dist/events';\n@Component({\n selector: 'nxs-carousel',\n templateUrl: './nxs-carousel.component.html',\n styleUrls: ['./nxs-carousel.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class NxsCarouselComponent {\n @Input()\n lazy = true;\n private mutationObserver: MutationObserver | null = null;\n recreateSliderSubscribed = false;\n private eventsCollector = new EventsCollector();\n public images: NxsCarouselImage[];\n\n @ViewChild('nxsSliderContainer', { static: true })\n nxsSliderContainer: ElementRef<HTMLDivElement>;\n\n @ViewChild('nxsSlidesWrapper', { static: true })\n nxsSlidesWrapper: ElementRef<HTMLDivElement>;\n\n //thumbnails\n @ViewChild('nxsThumbnailsSliderContainer', { static: true })\n nxsThumbnailsSliderContainer: ElementRef<HTMLDivElement>;\n @ViewChild('nxsThumbnailsSlidesWrapper', { static: true })\n nxsThumbnailsSlidesWrapper: ElementRef<HTMLDivElement>;\n options: NxsCarouselOptions = {};\n @Input('options')\n set setOptions(val: NxsCarouselOptions) {\n this.options = this.setDefaultOptions(val, false);\n }\n @Input('images')\n set setImages(val: NxsCarouselImage[]) {\n this.images = val;\n this.initSlides();\n this.createSlider(true);\n }\n @Input()\n hasHtmlContent = false;\n slidesCount: number = 0;\n public sliderInstance: SwiperInstance;\n public thumbnailsSliderInstance: SwiperInstance;\n\n @Output()\n slideChange = new EventEmitter<number>();\n public currentSlide = 0;\n @Output()\n slideClick = new EventEmitter<MouseEvent>();\n isBrowser = false;\n private swiperLibrary: any;\n\n constructor(\n private matDialog: MatDialog,\n private zone: NgZone,\n @Inject(PLATFORM_ID) private platformId: any,\n @Optional() private config?: NxsCarouselModuleConfig,\n ) {\n if (!this.config)\n this.config = { debug: false };\n this.isBrowser = isPlatformBrowser(this.platformId);\n this.log('constructor - isBrowser', this.isBrowser);\n this.options = this.setDefaultOptions(undefined, false);\n }\n private log(...args: any[]) {\n if (!this.config.debug)\n return;\n console.log('[NxsCarousel]', ...args);\n }\n\n onContentChange(changes: MutationRecord[]) {\n // console.log(\"Log: NxsCarouselComponent -> onContentChange -> changes\", changes);\n // changes.forEach(change => console.log(change.target));\n }\n initSlides() {\n if (!this.isBrowser) {\n this.log('prevent initSlides on platform server');\n return;\n }\n if (!this.nxsSlidesWrapper) {\n this.log('can not initSlides : nxsSlidesWrapper is not defined !');\n return;\n }\n this.log('initSlides begins');\n this.zone.runOutsideAngular(() => {\n if (!this.hasHtmlContent && this.images) {\n this.nxsSlidesWrapper.nativeElement.innerHTML = '';\n\n for (const cImage of this.images) {\n const div = document.createElement('div');\n div.className = 'swiper-slide';\n if (this.lazy) {\n div.dataset.background = cImage.src;\n div.className += ' swiper-lazy';\n } else {\n div.style.backgroundImage = 'url(' + cImage.src + ')';\n }\n if (this.options.nxsCarouselImageBackgroundSize)\n div.style.backgroundSize = this.options.nxsCarouselImageBackgroundSize;\n this.nxsSlidesWrapper.nativeElement.appendChild(div);\n }\n this.slidesCount = this.images.length;\n if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {\n this.nxsThumbnailsSlidesWrapper.nativeElement.innerHTML = '';\n for (const cImage of this.images) {\n const div = document.createElement('div');\n div.className = 'swiper-slide';\n if (this.lazy) {\n div.dataset.background = cImage.src;\n div.className += ' swiper-lazy';\n } else {\n div.style.backgroundImage = 'url(' + cImage.src + ')';\n }\n this.nxsThumbnailsSlidesWrapper.nativeElement.appendChild(div);\n }\n }\n this.log('initSlides - images are defined - slides count => ', this.slidesCount);\n }\n else if (this.hasHtmlContent) {\n this.log('initSlides - html content - slides length => ', this.nxsSlidesWrapper.nativeElement.children.length);\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < this.nxsSlidesWrapper.nativeElement.children.length; i++) {\n const child = this.nxsSlidesWrapper.nativeElement.children[i];\n if (!child.className)\n child.className = 'swiper-slide';\n else if (child.className.indexOf('swiper-slide') === -1) {\n child.className += ' swiper-slide';\n }\n }\n this.slidesCount = this.nxsSlidesWrapper.nativeElement.children.length;\n this.log('initSlides - html content - slides count => ', this.slidesCount);\n }\n });\n\n }\n\n private destroy() {\n if (!this.isBrowser) {\n return;\n }\n this.eventsCollector?.unsubscribeAll();\n this.mutationObserver?.disconnect();\n this.sliderInstance?.destroy();\n }\n ngOnDestroy(): void {\n this.destroy();\n }\n private subscribeToSlideChanged() {\n if (!this.hasHtmlContent) {\n this.log('subscribeToSlideChanged cannot be subscribed : has no html content');\n return;\n }\n if (!this.nxsSlidesWrapper || !this.nxsSlidesWrapper.nativeElement) {\n this.log('subscribeToSlideChanged error : nxsSlidesWrapper is not defined');\n return;\n }\n if (typeof MutationObserver === 'undefined') {\n this.log('cannot use mutation observer');\n return;\n }\n\n if (this.mutationObserver)\n this.mutationObserver.disconnect();\n\n this.log('subscribe to mutation observer');\n this.mutationObserver = new MutationObserver((mutationsList) => {\n // console.log(\"Log: NxsCarouselComponent -> subscribeToSlideChanged -> mutationsList\", mutationsList);\n // console.log(\"Log: NxsCarouselComponent -> subscribeToSlideChanged -> MutationObserver\");\n this.log('mutation observer - html content has changed');\n if (mutationsList.length === 0)\n return;\n let mustUpdate = false;\n for (const mutation of mutationsList) {\n if (mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0) {\n mustUpdate = true;\n break;\n }\n }\n if (mustUpdate) {\n this.initSlides();\n this.createSlider(true);\n }\n\n });\n this.mutationObserver.observe(this.nxsSlidesWrapper.nativeElement, { childList: true, attributes: false, });\n }\n ngAfterViewInit(): void {\n this.initSlides();\n this.createSlider(true);\n }\n getMainSliderHeight() {\n if (!this.options)\n return '';\n if (this.options.nxsThumbnails && this.options.nxsThumbnails.show) {\n if (this.options.nxsThumbnails.onMainSlider) {\n return '100%';\n }\n else if (this.options.nxsThumbnails.percentHeight) {\n return (100 - this.options.nxsThumbnails.percentHeight) + '%';\n }\n }\n return '';\n }\n private setDefaultOptions(options: NxsCarouselOptions, forDialog: boolean) {\n if (!options && forDialog) {\n options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true };\n }\n else if (!options)\n options = { nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {} };\n if (options.nxsCarouselDialogOptions) {\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails = { show: false };\n if (typeof options.nxsCarouselDialogOptions.effect === 'undefined')\n options.nxsCarouselDialogOptions.effect = 'slide';\n if (typeof options.nxsCarouselDialogOptions.nxsShowNavigationArrows === 'undefined')\n options.nxsCarouselDialogOptions.nxsShowNavigationArrows = true;\n\n if (!!options.nxsCarouselDialogOptions.nxsThumbnails?.show) {\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight = 20;\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.perView === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails.perView = 10;\n options.nxsCarouselDialogOptions.nxsThumbnails.breakpoints = {\n 640: {\n slidesPerView: 5,\n },\n 768: {\n slidesPerView: 7,\n },\n 1024: {\n slidesPerView: 8,\n },\n };\n }\n }\n if (!options.nxsThumbnails)\n options.nxsThumbnails = { show: false };\n\n if (options.nxsThumbnails.show && typeof options.nxsThumbnails.percentHeight === 'undefined')\n options.nxsThumbnails.percentHeight = 20;\n\n if (options.nxsThumbnails.show && typeof options.nxsThumbnails.perView === 'undefined')\n options.nxsThumbnails.perView = 10;\n\n\n if (forDialog)\n options.nxsfullscreenOnClick = false;\n if (options.nxsThumbnails.onMainSlider)\n options.nxsShowNavigationBullets = false;\n return options;\n }\n public showFullScreenCarousel(images: NxsCarouselImage[], wrapperClass?: string) {\n this.options.nxsCarouselDialogOptions = this.setDefaultOptions(this.options.nxsCarouselDialogOptions, true);\n const data: NxsCarouselDialogData = { images, wrapperClass, options: this.options.nxsCarouselDialogOptions };\n this.matDialog.open(NxsCarouselDialogComponent, {\n data,\n panelClass: 'nxs-carousel-dialog',\n width: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.width : undefined,\n height: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.height : undefined,\n disableClose: !this.options.nxsCarouselDialogExitable,\n });\n }\n private createSlider(forceRecreate: boolean) {\n if (!this.isBrowser) {\n this.log('prevent createSlider : platform is server');\n return;\n }\n if (!this.nxsSliderContainer) {\n this.log('can not createSlider : nxsSliderContainer is not defined !');\n return;\n }\n this.log('createSlider', this.nxsSliderContainer.nativeElement);\n if (this.slidesCount === 0) {\n this.log('can not createSlider : slidesCount === 0');\n this.subscribeToSlideChanged();\n return;\n }\n if (this.sliderInstance && !forceRecreate) {\n this.log('can re create slider => slider is already created.');\n return;\n }\n this.zone.runOutsideAngular(async () => {\n this.destroy();\n this.options.pagination = {\n el: '.nxs-carousel-pagination',\n clickable: true,\n type: 'bullets',\n };\n this.options.navigation = {\n nextEl: '.nxs-carousel-button-next',\n prevEl: '.nxs-carousel-button-prev',\n };\n if (!this.swiperLibrary)\n this.swiperLibrary = await import(\"swiper\");\n const Swiper = this.swiperLibrary.default;\n if (!!this.options.nxsThumbnails && this.options.nxsThumbnails.show) {\n const thumbnailsOptions: NxsCarouselOptions = {\n slidesPerView: this.options.nxsThumbnails.perView,\n loop: false,\n freeMode: true,\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n breakpoints: this.options.nxsThumbnails.breakpoints,\n // spaceBetween: 10,\n };\n if (this.lazy) {\n // Disable preloading of all images\n thumbnailsOptions.preloadImages = false;\n // Enable lazy loading\n thumbnailsOptions.lazy = true;\n }\n this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);\n this.options.thumbs = { swiper: this.thumbnailsSliderInstance };\n }\n\n if (this.lazy) {\n // Disable preloading of all images\n this.options.preloadImages = false;\n // Enable lazy loading\n this.options.lazy = true;\n }\n // console.log(\"Log ~ file: nxs-carousel.component.ts ~ line 323 ~ NxsCarouselComponent ~ this.zone.runOutsideAngular ~ this.options\", this.options);\n this.sliderInstance = new Swiper(this.nxsSliderContainer.nativeElement, this.options);\n this.log('sliderInstance has been created', this.sliderInstance);\n this.sliderInstance.on('slideChange', () => {\n this.zone.run(() => {\n this.currentSlide = this.sliderInstance.realIndex;\n this.log(\"slideChange\", this.currentSlide);\n this.slideChange.next(this.currentSlide);\n });\n });\n this.sliderInstance.on('click', (evt: MouseEvent) => {\n const target = evt.target as HTMLElement;\n if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)\n return;\n this.zone.run(() => {\n this.slideClick.next(evt);\n if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {\n this.showFullScreenCarousel(this.images, 'fullscreen-carousel');\n }\n });\n\n });\n this.subscribeToSlideChanged();\n });\n }\n\n goToSlide(index: number, speed?: number) {\n if (!this.sliderInstance)\n return;\n this.sliderInstance.slideTo(index, speed);\n }\n next() {\n if (!this.sliderInstance)\n return;\n this.sliderInstance.slideNext();\n }\n previous() {\n if (!this.sliderInstance)\n return;\n this.sliderInstance.slidePrev();\n }\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NxsCarouselDialogComponent } from './nxs-carousel-dialog.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { NxsCarouselComponent } from './nxs-carousel.component';\nimport { NxsCarouselModuleConfig } from './nxs-carousel-types';\nimport { ObserversModule } from '@angular/cdk/observers';\n\n@NgModule({\n declarations: [\n NxsCarouselComponent,\n NxsCarouselDialogComponent,\n ],\n imports: [\n CommonModule,\n MatIconModule,\n MatButtonModule,\n MatDialogModule,\n ObserversModule,\n ],\n exports: [\n NxsCarouselComponent,\n ],\n})\nexport class NxsCarouselModule {\n public static forRoot(config?: NxsCarouselModuleConfig): ModuleWithProviders<NxsCarouselModule> {\n return {\n ngModule: NxsCarouselModule,\n providers: [\n { provide: NxsCarouselModuleConfig, useValue: config },\n ]\n };\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {NxsCarouselDialogComponent as ɵa} from './lib/nxs-carousel/nxs-carousel-dialog.component';"],"names":[],"mappings":";;;;;;;;;MA6Ea,uBAAuB;IAApC;QACI,UAAK,GAAa,KAAK,CAAC;KAC3B;;;MCvDY,0BAA0B;IAEnC,YACoC,IAA2B,EACpD,SAAmD;QAD1B,SAAI,GAAJ,IAAI,CAAuB;QACpD,cAAS,GAAT,SAAS,CAA0C;QAHvD,iBAAY,GAAW,sBAAsB,CAAC;QAKjD,IAAI,IAAI,CAAC,YAAY;YACjB,IAAI,CAAC,YAAY,IAAI,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC;KACpD;;;YAvBJ,SAAS,SAAC;gBACP,QAAQ,EAAE,qBAAqB;gBAC/B,QAAQ,EAAE;;;;;;;;;KAST;gBAED,aAAa,EAAE,iBAAiB,CAAC,IAAI;;aACxC;;;4CAIQ,MAAM,SAAC,eAAe;YA1BL,YAAY;;;MCWzB,oBAAoB;IA4C7B,YACY,SAAoB,EACpB,IAAY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B;iBAC7B;gBACD,OAAO,EAAE;oBACL,YAAY;oBACZ,aAAa;oBACb,eAAe;oBACf,eAAe;oBACf,eAAe;iBAClB;gBACD,OAAO,EAAE;oBACL,oBAAoB;iBACvB;aACJ;;;ACzBD;;;;;;"}
1
+ {"version":3,"file":"nextalys-carousel.js","sources":["../../src/lib/nxs-carousel/nxs-carousel-types.ts","../../src/lib/nxs-carousel/nxs-carousel-dialog.component.ts","../../src/lib/nxs-carousel/swiper-directives.ts","../../src/lib/nxs-carousel/nxs-carousel.component.ts","../../src/lib/nxs-carousel/nxs-carousel.module.ts","../../src/nextalys-carousel.ts"],"sourcesContent":["import { SwiperOptions } from \"swiper\";\n\nexport interface NxsCarouselImage {\n alt?: string;\n src: string;\n}\nexport interface NxsCarouselOptions extends SwiperOptions {\n nxsShowNavigationBullets?: boolean;\n nxsShowNavigationArrows?: boolean;\n nxsThumbnails?: {\n show: boolean; onMainSlider?: boolean; percentHeight?: number; perView?: number; breakpoints?: {\n [size: number]: {\n spaceBetween?: number;\n slidesPerView: number | 'auto';\n };\n };\n };\n nxsShowImagesCount?: boolean;\n nxsfullscreenOnClick?: boolean;\n /**\n * background mode : cover, contain, auto, etc...\n * default => cover\n */\n nxsCarouselImageBackgroundSize?: string;\n nxsCarouselDialogOptions?: NxsCarouselOptions;\n nxsCarouselDialogExitable?: boolean;\n nxsCarouselDialogSize?: { width: string; height: string; };\n}\nexport class NxsCarouselModuleConfig {\n debug?: boolean = false;\n}","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { NxsCarouselImage, NxsCarouselOptions } from './nxs-carousel-types';\n\nexport interface NxsCarouselDialogData {\n images: NxsCarouselImage[];\n options?: NxsCarouselOptions;\n wrapperClass?: string;\n}\n@Component({\n selector: 'nxs-carousel-dialog',\n template: `\n <div class=\"nxs-carousel-dialog-flex-wrapper\">\n <div class=\"nxs-carousel-dialog-header\">\n <button (click)=\"dialogRef.close()\" mat-icon-button><mat-icon>close</mat-icon></button>\n </div>\n <div [class]=\"wrapperClass\">\n <nxs-carousel [options]=\"data.options\" [images]=\"data.images\"></nxs-carousel>\n </div>\n</div>\n `,\n styleUrls: ['./nxs-carousel-dialog.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class NxsCarouselDialogComponent {\n public wrapperClass: string = 'nxs-carousel-wrapper';\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: NxsCarouselDialogData,\n public dialogRef: MatDialogRef<NxsCarouselDialogComponent>,\n ) {\n if (data.wrapperClass)\n this.wrapperClass += ' ' + data.wrapperClass;\n }\n\n}\n","import { Directive } from \"@angular/core\";\n\n@Directive({\n selector: '[nxsSwiperTemplate]',\n})\nexport class NxsSwiperTemplateDirective { }\n","import { Component, ViewEncapsulation, Input, ViewChild, Output, EventEmitter, PLATFORM_ID, Inject, Optional, NgZone, ContentChildren, TemplateRef } from '@angular/core';\nimport { NxsCarouselOptions, NxsCarouselImage, NxsCarouselModuleConfig } from './nxs-carousel-types';\nimport { NxsCarouselDialogData, NxsCarouselDialogComponent } from './nxs-carousel-dialog.component';\nimport { MatDialog } from '@angular/material/dialog';\nimport { isPlatformBrowser } from '@angular/common';\nimport { EventsCollector } from 'nextalys-js-helpers/dist/events';\n// import Swiper core and required modules\nimport SwiperCore, { Navigation, Pagination, Autoplay, Lazy, Swiper, SwiperOptions, Thumbs } from 'swiper';\n//Virtual,Scrollbar,A11y\nimport { SwiperComponent } from 'swiper/angular';\nimport { NxsSwiperTemplateDirective } from './swiper-directives';\n\n// install Swiper modules\nSwiperCore.use([Navigation, Pagination, Autoplay, Lazy, Thumbs]);\n@Component({\n selector: 'nxs-carousel',\n templateUrl: './nxs-carousel.component.html',\n styleUrls: ['./nxs-carousel.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class NxsCarouselComponent {\n @ContentChildren(NxsSwiperTemplateDirective, { read: TemplateRef })\n contents!: TemplateRef<HTMLElement>;\n @ViewChild('swiper', { static: false })\n swiperComponent?: SwiperComponent;\n @Input()\n lazy = true;\n private eventsCollector = new EventsCollector();\n\n @Input()\n public images: NxsCarouselImage[];\n options: NxsCarouselOptions = null;\n thumbnailsOptions: SwiperOptions = null;\n @Input('options')\n set setOptions(val: NxsCarouselOptions) {\n this.options = this.setDefaultOptions(val, false);\n this.setThumbnailsOptions();\n }\n @Input()\n hasHtmlContent = false;\n slidesCount: number = 0;\n private swiperInstance: Swiper;\n thumbnailsSwiperInstance: Swiper;\n\n @Output()\n slideChange = new EventEmitter<number>();\n public currentSlide = 0;\n @Output()\n slideClick = new EventEmitter<MouseEvent | TouchEvent | PointerEvent>();\n isBrowser = false;\n\n constructor(\n private matDialog: MatDialog,\n private zone: NgZone,\n @Inject(PLATFORM_ID) private platformId: any,\n @Optional() private config?: NxsCarouselModuleConfig,\n ) {\n if (!this.config)\n this.config = { debug: false };\n this.isBrowser = isPlatformBrowser(this.platformId);\n this.log('constructor - isBrowser', this.isBrowser);\n this.options = this.setDefaultOptions(undefined, false);\n }\n private log(...args: any[]) {\n if (!this.config.debug)\n return;\n console.log('[NxsCarousel]', ...args);\n }\n private destroy() {\n if (!this.isBrowser) {\n return;\n }\n this.eventsCollector?.unsubscribeAll();\n }\n ngOnDestroy(): void {\n this.destroy();\n }\n ngAfterViewInit(): void {\n // console.log('thi.contents', this.contents);\n // this.initSlides();\n // this.createSlider(true);\n }\n getMainSliderHeight() {\n if (!this.options)\n return '';\n if (this.options.nxsThumbnails && this.options.nxsThumbnails.show) {\n if (this.options.nxsThumbnails.onMainSlider) {\n return '100%';\n }\n else if (this.options.nxsThumbnails.percentHeight) {\n return (100 - this.options.nxsThumbnails.percentHeight) + '%';\n }\n }\n return '';\n }\n private setDefaultOptions(options: NxsCarouselOptions, forDialog: boolean) {\n if (!options && forDialog) {\n options = {\n nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true,\n lazy: true,\n };\n }\n else if (!options) {\n options = {\n nxsShowNavigationBullets: true, loop: true,\n nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {},\n lazy: true,\n };\n }\n if (options.nxsCarouselDialogOptions) {\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails = { show: false };\n if (typeof options.nxsCarouselDialogOptions.effect === 'undefined')\n options.nxsCarouselDialogOptions.effect = 'slide';\n if (typeof options.nxsCarouselDialogOptions.nxsShowNavigationArrows === 'undefined')\n options.nxsCarouselDialogOptions.nxsShowNavigationArrows = true;\n\n if (!!options.nxsCarouselDialogOptions.nxsThumbnails?.show) {\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight = 20;\n if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.perView === 'undefined')\n options.nxsCarouselDialogOptions.nxsThumbnails.perView = 10;\n options.nxsCarouselDialogOptions.nxsThumbnails.breakpoints = {\n 640: {\n slidesPerView: 5,\n },\n 768: {\n slidesPerView: 7,\n },\n 1024: {\n slidesPerView: 8,\n },\n };\n }\n }\n if (!options.nxsThumbnails)\n options.nxsThumbnails = { show: false };\n\n if (options.nxsThumbnails.show && typeof options.nxsThumbnails.percentHeight === 'undefined')\n options.nxsThumbnails.percentHeight = 20;\n\n if (options.nxsThumbnails.show && typeof options.nxsThumbnails.perView === 'undefined')\n options.nxsThumbnails.perView = 10;\n\n\n if (forDialog)\n options.nxsfullscreenOnClick = false;\n if (options.nxsThumbnails.onMainSlider)\n options.nxsShowNavigationBullets = false;\n\n if (typeof options.lazy === 'undefined')\n options.lazy = true;\n\n if (typeof options.navigation === 'undefined')\n options.navigation = true;\n if (typeof options.pagination === 'undefined')\n options.pagination = { clickable: true };\n // console.log(\"Log ~ file: nxs-carousel.component.ts ~ line 272 ~ NxsCarouselComponent ~ setDefaultOptions ~ options\", options);\n\n return options;\n }\n\n private setThumbnailsOptions() {\n if (!!this.options?.nxsThumbnails?.show) {\n this.thumbnailsOptions = {\n slidesPerView: this.options.nxsThumbnails.perView,\n loop: false,\n freeMode: true,\n // watchSlidesVisibility: true,\n watchSlidesProgress: true,\n breakpoints: this.options.nxsThumbnails.breakpoints,\n // spaceBetween: 10,\n };\n if (this.lazy) {\n // Disable preloading of all images\n this.thumbnailsOptions.preloadImages = false;\n // Enable lazy loading\n this.thumbnailsOptions.lazy = true;\n }\n // this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);\n // this.options.thumbs = { swiper: this.thumbnailsSliderInstance };\n }\n }\n public showFullScreenCarousel(images: NxsCarouselImage[], wrapperClass?: string) {\n this.options.nxsCarouselDialogOptions = this.setDefaultOptions(this.options.nxsCarouselDialogOptions, true);\n const data: NxsCarouselDialogData = { images, wrapperClass, options: this.options.nxsCarouselDialogOptions };\n this.matDialog.open(NxsCarouselDialogComponent, {\n data,\n panelClass: 'nxs-carousel-dialog',\n width: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.width : undefined,\n height: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.height : undefined,\n disableClose: !this.options.nxsCarouselDialogExitable,\n });\n }\n goToSlide(index: number, speed?: number) {\n this.swiperInstance?.slideTo(index, speed);\n }\n next() {\n this.swiperInstance?.slideNext();\n }\n previous() {\n this.swiperInstance?.slidePrev();\n }\n onSwiperThumbnails(instance: Swiper) {\n if (this.options?.nxsThumbnails?.show)\n this.thumbnailsSwiperInstance = instance;\n else\n this.thumbnailsSwiperInstance = null;\n\n // if (this.options?.nxsThumbnails?.show) {\n // const optionsClone = MainHelpers.cloneObject(this.options);\n // optionsClone.thumbs = { swiper: this.thumbnailsSwiperInstance };\n // // this.options = optionsClone;\n // // this.options = { ...this.options, thumbs: { swiper: this.thumbnailsSwiperInstance } };\n // console.log(\"Log ~ file: nxs-carousel.component.ts ~ line 416 ~ NxsCarouselComponent ~ onSwiperThumbnails ~ this.options \", this.options);\n // this.options.thumbs = { swiper: this.thumbnailsSwiperInstance };\n // }\n }\n onSwiper(instance: Swiper) {\n this.log('swiper ready - instance', instance);\n this.swiperInstance = instance;\n this.swiperInstance.on('click', (swiperInstance, evt) => {\n // console.log(\"Log ~ file: nxs-carousel.component.ts ~ line 392 ~ NxsCarouselComponent ~ this.swiperInstance.on ~ evt\", evt);\n const target = evt.target as HTMLElement;\n if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)\n return;\n this.runInZone(() => {\n this.slideClick.next(evt);\n if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {\n this.showFullScreenCarousel(this.images, 'fullscreen-carousel');\n }\n });\n\n });\n }\n private runInZone<T extends (...args: any[]) => void>(callback: T, ...args: any[]) {\n if (!this.zone) {\n callback(args);\n }\n return this.zone.run(() => callback(args));\n }\n\n onSlideChange(instances: Swiper[]) {\n // this.swiperInstance = instance;\n // this.log('slide change - instance', instance);\n this.runInZone(() => {\n this.currentSlide = this.swiperInstance?.realIndex || 0;\n this.log('slide change - currentSlide', this.currentSlide);\n this.slideChange.next(this.currentSlide);\n });\n }\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NxsCarouselDialogComponent } from './nxs-carousel-dialog.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { NxsCarouselComponent } from './nxs-carousel.component';\nimport { NxsCarouselModuleConfig } from './nxs-carousel-types';\nimport { SwiperModule } from 'swiper/angular';\nimport { NxsSwiperTemplateDirective } from './swiper-directives';\n\n@NgModule({\n declarations: [\n NxsCarouselComponent,\n NxsCarouselDialogComponent,\n NxsSwiperTemplateDirective,\n ],\n imports: [\n CommonModule,\n MatIconModule,\n MatButtonModule,\n MatDialogModule,\n SwiperModule,\n ],\n exports: [\n NxsCarouselComponent,\n NxsSwiperTemplateDirective,\n ],\n})\nexport class NxsCarouselModule {\n public static forRoot(config?: NxsCarouselModuleConfig): ModuleWithProviders<NxsCarouselModule> {\n return {\n ngModule: NxsCarouselModule,\n providers: [\n { provide: NxsCarouselModuleConfig, useValue: config },\n ]\n };\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {NxsCarouselDialogComponent as ɵb} from './lib/nxs-carousel/nxs-carousel-dialog.component';\nexport {NxsSwiperTemplateDirective as ɵa} from './lib/nxs-carousel/swiper-directives';"],"names":[],"mappings":";;;;;;;;;MA4Ba,uBAAuB;IAApC;QACI,UAAK,GAAa,KAAK,CAAC;KAC3B;;;MCNY,0BAA0B;IAEnC,YACoC,IAA2B,EACpD,SAAmD;QAD1B,SAAI,GAAJ,IAAI,CAAuB;QACpD,cAAS,GAAT,SAAS,CAA0C;QAHvD,iBAAY,GAAW,sBAAsB,CAAC;QAKjD,IAAI,IAAI,CAAC,YAAY;YACjB,IAAI,CAAC,YAAY,IAAI,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC;KACpD;;;YAvBJ,SAAS,SAAC;gBACP,QAAQ,EAAE,qBAAqB;gBAC/B,QAAQ,EAAE;;;;;;;;;KAST;gBAED,aAAa,EAAE,iBAAiB,CAAC,IAAI;;aACxC;;;4CAIQ,MAAM,SAAC,eAAe;YA1BL,YAAY;;;MCIzB,0BAA0B;;;YAHtC,SAAS,SAAC;gBACP,QAAQ,EAAE,qBAAqB;aAClC;;;ACQD;AACA,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;MAOpD,oBAAoB;IA+B7B,YACY,SAAoB,EACpB,IAAY,EACS,UAAe,EACxB,MAAgC;QAH5C,cAAS,GAAT,SAAS,CAAW;QACpB,SAAI,GAAJ,IAAI,CAAQ;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