UNPKG

137 kBJavaScriptView Raw
1import { __decorate, __param, __awaiter } from 'tslib';
2import { HostListener, Injector, ElementRef, Directive, Inject, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, Optional, ChangeDetectorRef, Component, ChangeDetectionStrategy, InjectionToken, ApplicationRef, EventEmitter, ViewContainerRef, ComponentFactoryResolver, Attribute, SkipSelf, Output, ViewChild, ContentChild, TemplateRef, IterableDiffers, APP_INITIALIZER, NgModule } from '@angular/core';
3import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
4import { DOCUMENT, Location, LocationStrategy, CommonModule } from '@angular/common';
5import { NavigationStart, UrlSerializer, Router, PRIMARY_OUTLET, ActivatedRoute, ChildrenOutletContexts, RouterLink } from '@angular/router';
6import { isPlatform, getPlatforms, LIFECYCLE_WILL_ENTER, LIFECYCLE_DID_ENTER, LIFECYCLE_WILL_LEAVE, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_UNLOAD, actionSheetController, alertController, loadingController, menuController, pickerController, modalController, popoverController, toastController, createAnimation, getTimeGivenProgression, createGesture } from '@ionic/core';
7export { IonicSafeString, createAnimation, getPlatforms, iosTransitionAnimation, isPlatform, mdTransitionAnimation } from '@ionic/core';
8import { Subject, fromEvent, BehaviorSubject } from 'rxjs';
9import { filter, switchMap, distinctUntilChanged } from 'rxjs/operators';
10import { applyPolyfills, defineCustomElements } from '@ionic/core/loader';
11
12const raf = (h) => {
13 if (typeof __zone_symbol__requestAnimationFrame === 'function') {
14 return __zone_symbol__requestAnimationFrame(h);
15 }
16 if (typeof requestAnimationFrame === 'function') {
17 return requestAnimationFrame(h);
18 }
19 return setTimeout(h);
20};
21
22class ValueAccessor {
23 constructor(injector, el) {
24 this.injector = injector;
25 this.el = el;
26 this.onChange = () => { };
27 this.onTouched = () => { };
28 }
29 writeValue(value) {
30 /**
31 * TODO for Ionic 6:
32 * Change `value == null ? '' : value;`
33 * to `value`. This was a fix for IE9, but IE9
34 * is no longer supported; however, this change
35 * is potentially a breaking change
36 */
37 this.el.nativeElement.value = this.lastValue = value == null ? '' : value;
38 setIonicClasses(this.el);
39 }
40 handleChangeEvent(el, value) {
41 if (el === this.el.nativeElement) {
42 if (value !== this.lastValue) {
43 this.lastValue = value;
44 this.onChange(value);
45 }
46 setIonicClasses(this.el);
47 }
48 }
49 _handleBlurEvent(el) {
50 if (el === this.el.nativeElement) {
51 this.onTouched();
52 setIonicClasses(this.el);
53 }
54 }
55 registerOnChange(fn) {
56 this.onChange = fn;
57 }
58 registerOnTouched(fn) {
59 this.onTouched = fn;
60 }
61 setDisabledState(isDisabled) {
62 this.el.nativeElement.disabled = isDisabled;
63 }
64 ngOnDestroy() {
65 if (this.statusChanges) {
66 this.statusChanges.unsubscribe();
67 }
68 }
69 ngAfterViewInit() {
70 let ngControl;
71 try {
72 ngControl = this.injector.get(NgControl);
73 }
74 catch ( /* No FormControl or ngModel binding */_a) { /* No FormControl or ngModel binding */ }
75 if (!ngControl) {
76 return;
77 }
78 // Listen for changes in validity, disabled, or pending states
79 if (ngControl.statusChanges) {
80 this.statusChanges = ngControl.statusChanges.subscribe(() => setIonicClasses(this.el));
81 }
82 /**
83 * TODO Remove this in favor of https://github.com/angular/angular/issues/10887
84 * whenever it is implemented. Currently, Ionic's form status classes
85 * do not react to changes when developers manually call
86 * Angular form control methods such as markAsTouched.
87 * This results in Ionic's form status classes being out
88 * of sync with the ng form status classes.
89 * This patches the methods to manually sync
90 * the classes until this feature is implemented in Angular.
91 */
92 const formControl = ngControl.control;
93 if (formControl) {
94 const methodsToPatch = ['markAsTouched', 'markAllAsTouched', 'markAsUntouched', 'markAsDirty', 'markAsPristine'];
95 methodsToPatch.forEach(method => {
96 if (formControl[method]) {
97 const oldFn = formControl[method].bind(formControl);
98 formControl[method] = (...params) => {
99 oldFn(...params);
100 setIonicClasses(this.el);
101 };
102 }
103 });
104 }
105 }
106}
107__decorate([
108 HostListener('ionBlur', ['$event.target'])
109], ValueAccessor.prototype, "_handleBlurEvent", null);
110const setIonicClasses = (element) => {
111 raf(() => {
112 const input = element.nativeElement;
113 const classes = getClasses(input);
114 setClasses(input, classes);
115 const item = input.closest('ion-item');
116 if (item) {
117 setClasses(item, classes);
118 }
119 });
120};
121const getClasses = (element) => {
122 const classList = element.classList;
123 const classes = [];
124 for (let i = 0; i < classList.length; i++) {
125 const item = classList.item(i);
126 if (item !== null && startsWith(item, 'ng-')) {
127 classes.push(`ion-${item.substr(3)}`);
128 }
129 }
130 return classes;
131};
132const ɵ0 = getClasses;
133const setClasses = (element, classes) => {
134 const classList = element.classList;
135 [
136 'ion-valid',
137 'ion-invalid',
138 'ion-touched',
139 'ion-untouched',
140 'ion-dirty',
141 'ion-pristine'
142 ].forEach(c => classList.remove(c));
143 classes.forEach(c => classList.add(c));
144};
145const ɵ1 = setClasses;
146const startsWith = (input, search) => {
147 return input.substr(0, search.length) === search;
148};
149const ɵ2 = startsWith;
150
151var BooleanValueAccessor_1;
152let BooleanValueAccessor = BooleanValueAccessor_1 = class BooleanValueAccessor extends ValueAccessor {
153 constructor(injector, el) {
154 super(injector, el);
155 }
156 writeValue(value) {
157 this.el.nativeElement.checked = this.lastValue = value == null ? false : value;
158 setIonicClasses(this.el);
159 }
160 _handleIonChange(el) {
161 this.handleChangeEvent(el, el.checked);
162 }
163};
164BooleanValueAccessor.ctorParameters = () => [
165 { type: Injector },
166 { type: ElementRef }
167];
168__decorate([
169 HostListener('ionChange', ['$event.target'])
170], BooleanValueAccessor.prototype, "_handleIonChange", null);
171BooleanValueAccessor = BooleanValueAccessor_1 = __decorate([
172 Directive({
173 /* tslint:disable-next-line:directive-selector */
174 selector: 'ion-checkbox,ion-toggle',
175 providers: [
176 {
177 provide: NG_VALUE_ACCESSOR,
178 useExisting: BooleanValueAccessor_1,
179 multi: true
180 }
181 ]
182 })
183], BooleanValueAccessor);
184
185var NumericValueAccessor_1;
186let NumericValueAccessor = NumericValueAccessor_1 = class NumericValueAccessor extends ValueAccessor {
187 constructor(injector, el) {
188 super(injector, el);
189 }
190 _handleIonChange(el) {
191 this.handleChangeEvent(el, el.value);
192 }
193 registerOnChange(fn) {
194 super.registerOnChange(value => {
195 fn(value === '' ? null : parseFloat(value));
196 });
197 }
198};
199NumericValueAccessor.ctorParameters = () => [
200 { type: Injector },
201 { type: ElementRef }
202];
203__decorate([
204 HostListener('ionChange', ['$event.target'])
205], NumericValueAccessor.prototype, "_handleIonChange", null);
206NumericValueAccessor = NumericValueAccessor_1 = __decorate([
207 Directive({
208 /* tslint:disable-next-line:directive-selector */
209 selector: 'ion-input[type=number]',
210 providers: [
211 {
212 provide: NG_VALUE_ACCESSOR,
213 useExisting: NumericValueAccessor_1,
214 multi: true
215 }
216 ]
217 })
218], NumericValueAccessor);
219
220var RadioValueAccessor_1;
221let RadioValueAccessor = RadioValueAccessor_1 = class RadioValueAccessor extends ValueAccessor {
222 constructor(injector, el) {
223 super(injector, el);
224 }
225 _handleIonSelect(el) {
226 this.handleChangeEvent(el, el.checked);
227 }
228};
229RadioValueAccessor.ctorParameters = () => [
230 { type: Injector },
231 { type: ElementRef }
232];
233__decorate([
234 HostListener('ionSelect', ['$event.target'])
235], RadioValueAccessor.prototype, "_handleIonSelect", null);
236RadioValueAccessor = RadioValueAccessor_1 = __decorate([
237 Directive({
238 /* tslint:disable-next-line:directive-selector */
239 selector: 'ion-radio',
240 providers: [
241 {
242 provide: NG_VALUE_ACCESSOR,
243 useExisting: RadioValueAccessor_1,
244 multi: true
245 }
246 ]
247 })
248], RadioValueAccessor);
249
250var SelectValueAccessor_1;
251let SelectValueAccessor = SelectValueAccessor_1 = class SelectValueAccessor extends ValueAccessor {
252 constructor(injector, el) {
253 super(injector, el);
254 }
255 _handleChangeEvent(el) {
256 this.handleChangeEvent(el, el.value);
257 }
258};
259SelectValueAccessor.ctorParameters = () => [
260 { type: Injector },
261 { type: ElementRef }
262];
263__decorate([
264 HostListener('ionChange', ['$event.target'])
265], SelectValueAccessor.prototype, "_handleChangeEvent", null);
266SelectValueAccessor = SelectValueAccessor_1 = __decorate([
267 Directive({
268 /* tslint:disable-next-line:directive-selector */
269 selector: 'ion-range, ion-select, ion-radio-group, ion-segment, ion-datetime',
270 providers: [
271 {
272 provide: NG_VALUE_ACCESSOR,
273 useExisting: SelectValueAccessor_1,
274 multi: true
275 }
276 ]
277 })
278], SelectValueAccessor);
279
280var TextValueAccessor_1;
281let TextValueAccessor = TextValueAccessor_1 = class TextValueAccessor extends ValueAccessor {
282 constructor(injector, el) {
283 super(injector, el);
284 }
285 _handleInputEvent(el) {
286 this.handleChangeEvent(el, el.value);
287 }
288};
289TextValueAccessor.ctorParameters = () => [
290 { type: Injector },
291 { type: ElementRef }
292];
293__decorate([
294 HostListener('ionChange', ['$event.target'])
295], TextValueAccessor.prototype, "_handleInputEvent", null);
296TextValueAccessor = TextValueAccessor_1 = __decorate([
297 Directive({
298 /* tslint:disable-next-line:directive-selector */
299 selector: 'ion-input:not([type=number]),ion-textarea,ion-searchbar',
300 providers: [
301 {
302 provide: NG_VALUE_ACCESSOR,
303 useExisting: TextValueAccessor_1,
304 multi: true
305 }
306 ]
307 })
308], TextValueAccessor);
309
310let Platform = class Platform {
311 constructor(doc, zone) {
312 this.doc = doc;
313 /**
314 * @hidden
315 */
316 this.backButton = new Subject();
317 /**
318 * The keyboardDidShow event emits when the
319 * on-screen keyboard is presented.
320 */
321 this.keyboardDidShow = new Subject();
322 /**
323 * The keyboardDidHide event emits when the
324 * on-screen keyboard is hidden.
325 */
326 this.keyboardDidHide = new Subject();
327 /**
328 * The pause event emits when the native platform puts the application
329 * into the background, typically when the user switches to a different
330 * application. This event would emit when a Cordova app is put into
331 * the background, however, it would not fire on a standard web browser.
332 */
333 this.pause = new Subject();
334 /**
335 * The resume event emits when the native platform pulls the application
336 * out from the background. This event would emit when a Cordova app comes
337 * out from the background, however, it would not fire on a standard web browser.
338 */
339 this.resume = new Subject();
340 /**
341 * The resize event emits when the browser window has changed dimensions. This
342 * could be from a browser window being physically resized, or from a device
343 * changing orientation.
344 */
345 this.resize = new Subject();
346 zone.run(() => {
347 this.win = doc.defaultView;
348 this.backButton.subscribeWithPriority = function (priority, callback) {
349 return this.subscribe(ev => {
350 return ev.register(priority, processNextHandler => zone.run(() => callback(processNextHandler)));
351 });
352 };
353 proxyEvent(this.pause, doc, 'pause');
354 proxyEvent(this.resume, doc, 'resume');
355 proxyEvent(this.backButton, doc, 'ionBackButton');
356 proxyEvent(this.resize, this.win, 'resize');
357 proxyEvent(this.keyboardDidShow, this.win, 'ionKeyboardDidShow');
358 proxyEvent(this.keyboardDidHide, this.win, 'ionKeyboardDidHide');
359 let readyResolve;
360 this._readyPromise = new Promise(res => { readyResolve = res; });
361 if (this.win && this.win['cordova']) {
362 doc.addEventListener('deviceready', () => {
363 readyResolve('cordova');
364 }, { once: true });
365 }
366 else {
367 readyResolve('dom');
368 }
369 });
370 }
371 /**
372 * @returns returns true/false based on platform.
373 * @description
374 * Depending on the platform the user is on, `is(platformName)` will
375 * return `true` or `false`. Note that the same app can return `true`
376 * for more than one platform name. For example, an app running from
377 * an iPad would return `true` for the platform names: `mobile`,
378 * `ios`, `ipad`, and `tablet`. Additionally, if the app was running
379 * from Cordova then `cordova` would be true, and if it was running
380 * from a web browser on the iPad then `mobileweb` would be `true`.
381 *
382 * ```
383 * import { Platform } from 'ionic-angular';
384 *
385 * @Component({...})
386 * export MyPage {
387 * constructor(public platform: Platform) {
388 * if (this.platform.is('ios')) {
389 * // This will only print when on iOS
390 * console.log('I am an iOS device!');
391 * }
392 * }
393 * }
394 * ```
395 *
396 * | Platform Name | Description |
397 * |-----------------|------------------------------------|
398 * | android | on a device running Android. |
399 * | cordova | on a device running Cordova. |
400 * | ios | on a device running iOS. |
401 * | ipad | on an iPad device. |
402 * | iphone | on an iPhone device. |
403 * | phablet | on a phablet device. |
404 * | tablet | on a tablet device. |
405 * | electron | in Electron on a desktop device. |
406 * | pwa | as a PWA app. |
407 * | mobile | on a mobile device. |
408 * | mobileweb | on a mobile device in a browser. |
409 * | desktop | on a desktop device. |
410 * | hybrid | is a cordova or capacitor app. |
411 *
412 */
413 is(platformName) {
414 return isPlatform(this.win, platformName);
415 }
416 /**
417 * @returns the array of platforms
418 * @description
419 * Depending on what device you are on, `platforms` can return multiple values.
420 * Each possible value is a hierarchy of platforms. For example, on an iPhone,
421 * it would return `mobile`, `ios`, and `iphone`.
422 *
423 * ```
424 * import { Platform } from 'ionic-angular';
425 *
426 * @Component({...})
427 * export MyPage {
428 * constructor(public platform: Platform) {
429 * // This will print an array of the current platforms
430 * console.log(this.platform.platforms());
431 * }
432 * }
433 * ```
434 */
435 platforms() {
436 return getPlatforms(this.win);
437 }
438 /**
439 * Returns a promise when the platform is ready and native functionality
440 * can be called. If the app is running from within a web browser, then
441 * the promise will resolve when the DOM is ready. When the app is running
442 * from an application engine such as Cordova, then the promise will
443 * resolve when Cordova triggers the `deviceready` event.
444 *
445 * The resolved value is the `readySource`, which states which platform
446 * ready was used. For example, when Cordova is ready, the resolved ready
447 * source is `cordova`. The default ready source value will be `dom`. The
448 * `readySource` is useful if different logic should run depending on the
449 * platform the app is running from. For example, only Cordova can execute
450 * the status bar plugin, so the web should not run status bar plugin logic.
451 *
452 * ```
453 * import { Component } from '@angular/core';
454 * import { Platform } from 'ionic-angular';
455 *
456 * @Component({...})
457 * export MyApp {
458 * constructor(public platform: Platform) {
459 * this.platform.ready().then((readySource) => {
460 * console.log('Platform ready from', readySource);
461 * // Platform now ready, execute any required native code
462 * });
463 * }
464 * }
465 * ```
466 */
467 ready() {
468 return this._readyPromise;
469 }
470 /**
471 * Returns if this app is using right-to-left language direction or not.
472 * We recommend the app's `index.html` file already has the correct `dir`
473 * attribute value set, such as `<html dir="ltr">` or `<html dir="rtl">`.
474 * [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir)
475 */
476 get isRTL() {
477 return this.doc.dir === 'rtl';
478 }
479 /**
480 * Get the query string parameter
481 */
482 getQueryParam(key) {
483 return readQueryParam(this.win.location.href, key);
484 }
485 /**
486 * Returns `true` if the app is in landscape mode.
487 */
488 isLandscape() {
489 return !this.isPortrait();
490 }
491 /**
492 * Returns `true` if the app is in portait mode.
493 */
494 isPortrait() {
495 return this.win.matchMedia && this.win.matchMedia('(orientation: portrait)').matches;
496 }
497 testUserAgent(expression) {
498 const nav = this.win.navigator;
499 return !!(nav && nav.userAgent && nav.userAgent.indexOf(expression) >= 0);
500 }
501 /**
502 * Get the current url.
503 */
504 url() {
505 return this.win.location.href;
506 }
507 /**
508 * Gets the width of the platform's viewport using `window.innerWidth`.
509 */
510 width() {
511 return this.win.innerWidth;
512 }
513 /**
514 * Gets the height of the platform's viewport using `window.innerHeight`.
515 */
516 height() {
517 return this.win.innerHeight;
518 }
519};
520Platform.ctorParameters = () => [
521 { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
522 { type: NgZone }
523];
524Platform.ngInjectableDef = ɵɵdefineInjectable({ factory: function Platform_Factory() { return new Platform(ɵɵinject(DOCUMENT), ɵɵinject(NgZone)); }, token: Platform, providedIn: "root" });
525Platform = __decorate([
526 Injectable({
527 providedIn: 'root',
528 }),
529 __param(0, Inject(DOCUMENT))
530], Platform);
531const readQueryParam = (url, key) => {
532 key = key.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
533 const regex = new RegExp('[\\?&]' + key + '=([^&#]*)');
534 const results = regex.exec(url);
535 return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
536};
537const ɵ0$1 = readQueryParam;
538const proxyEvent = (emitter, el, eventName) => {
539 if (el) {
540 el.addEventListener(eventName, (ev) => {
541 // ?? cordova might emit "null" events
542 emitter.next(ev != null ? ev.detail : undefined);
543 });
544 }
545};
546const ɵ1$1 = proxyEvent;
547
548let NavController = class NavController {
549 constructor(platform, location, serializer, router) {
550 this.location = location;
551 this.serializer = serializer;
552 this.router = router;
553 this.direction = DEFAULT_DIRECTION;
554 this.animated = DEFAULT_ANIMATED;
555 this.guessDirection = 'forward';
556 this.lastNavId = -1;
557 // Subscribe to router events to detect direction
558 if (router) {
559 router.events.subscribe(ev => {
560 if (ev instanceof NavigationStart) {
561 const id = (ev.restoredState) ? ev.restoredState.navigationId : ev.id;
562 this.guessDirection = id < this.lastNavId ? 'back' : 'forward';
563 this.guessAnimation = !ev.restoredState ? this.guessDirection : undefined;
564 this.lastNavId = this.guessDirection === 'forward' ? ev.id : id;
565 }
566 });
567 }
568 // Subscribe to backButton events
569 platform.backButton.subscribeWithPriority(0, processNextHandler => {
570 this.pop();
571 processNextHandler();
572 });
573 }
574 /**
575 * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,
576 * it's equivalent to calling `this.router.navigateByUrl()`, but it's explicit about the **direction** of the transition.
577 *
578 * Going **forward** means that a new page is going to be pushed to the stack of the outlet (ion-router-outlet),
579 * and that it will show a "forward" animation by default.
580 *
581 * Navigating forward can also be triggered in a declarative manner by using the `[routerDirection]` directive:
582 *
583 * ```html
584 * <a routerLink="/path/to/page" routerDirection="forward">Link</a>
585 * ```
586 */
587 navigateForward(url, options = {}) {
588 this.setDirection('forward', options.animated, options.animationDirection, options.animation);
589 return this.navigate(url, options);
590 }
591 /**
592 * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,
593 * it's equivalent to calling:
594 *
595 * ```ts
596 * this.navController.setDirection('back');
597 * this.router.navigateByUrl(path);
598 * ```
599 *
600 * Going **back** means that all the pages in the stack until the navigated page is found will be popped,
601 * and that it will show a "back" animation by default.
602 *
603 * Navigating back can also be triggered in a declarative manner by using the `[routerDirection]` directive:
604 *
605 * ```html
606 * <a routerLink="/path/to/page" routerDirection="back">Link</a>
607 * ```
608 */
609 navigateBack(url, options = {}) {
610 this.setDirection('back', options.animated, options.animationDirection, options.animation);
611 return this.navigate(url, options);
612 }
613 /**
614 * This method uses Angular's [Router](https://angular.io/api/router/Router) under the hood,
615 * it's equivalent to calling:
616 *
617 * ```ts
618 * this.navController.setDirection('root');
619 * this.router.navigateByUrl(path);
620 * ```
621 *
622 * Going **root** means that all existing pages in the stack will be removed,
623 * and the navigated page will become the single page in the stack.
624 *
625 * Navigating root can also be triggered in a declarative manner by using the `[routerDirection]` directive:
626 *
627 * ```html
628 * <a routerLink="/path/to/page" routerDirection="root">Link</a>
629 * ```
630 */
631 navigateRoot(url, options = {}) {
632 this.setDirection('root', options.animated, options.animationDirection, options.animation);
633 return this.navigate(url, options);
634 }
635 /**
636 * Same as [Location](https://angular.io/api/common/Location)'s back() method.
637 * It will use the standard `window.history.back()` under the hood, but featuring a `back` animation
638 * by default.
639 */
640 back(options = { animated: true, animationDirection: 'back' }) {
641 this.setDirection('back', options.animated, options.animationDirection, options.animation);
642 return this.location.back();
643 }
644 /**
645 * This methods goes back in the context of Ionic's stack navigation.
646 *
647 * It recursively finds the top active `ion-router-outlet` and calls `pop()`.
648 * This is the recommended way to go back when you are using `ion-router-outlet`.
649 */
650 pop() {
651 return __awaiter(this, void 0, void 0, function* () {
652 let outlet = this.topOutlet;
653 while (outlet) {
654 if (yield outlet.pop()) {
655 break;
656 }
657 else {
658 outlet = outlet.parentOutlet;
659 }
660 }
661 });
662 }
663 /**
664 * This methods specifies the direction of the next navigation performed by the Angular router.
665 *
666 * `setDirection()` does not trigger any transition, it just sets some flags to be consumed by `ion-router-outlet`.
667 *
668 * It's recommended to use `navigateForward()`, `navigateBack()` and `navigateRoot()` instead of `setDirection()`.
669 */
670 setDirection(direction, animated, animationDirection, animationBuilder) {
671 this.direction = direction;
672 this.animated = getAnimation(direction, animated, animationDirection);
673 this.animationBuilder = animationBuilder;
674 }
675 /**
676 * @internal
677 */
678 setTopOutlet(outlet) {
679 this.topOutlet = outlet;
680 }
681 /**
682 * @internal
683 */
684 consumeTransition() {
685 let direction = 'root';
686 let animation;
687 const animationBuilder = this.animationBuilder;
688 if (this.direction === 'auto') {
689 direction = this.guessDirection;
690 animation = this.guessAnimation;
691 }
692 else {
693 animation = this.animated;
694 direction = this.direction;
695 }
696 this.direction = DEFAULT_DIRECTION;
697 this.animated = DEFAULT_ANIMATED;
698 this.animationBuilder = undefined;
699 return {
700 direction,
701 animation,
702 animationBuilder
703 };
704 }
705 navigate(url, options) {
706 if (Array.isArray(url)) {
707 return this.router.navigate(url, options);
708 }
709 else {
710 /**
711 * navigateByUrl ignores any properties that
712 * would change the url, so things like queryParams
713 * would be ignored unless we create a url tree
714 * More Info: https://github.com/angular/angular/issues/18798
715 */
716 const urlTree = this.serializer.parse(url.toString());
717 if (options.queryParams !== undefined) {
718 urlTree.queryParams = Object.assign({}, options.queryParams);
719 }
720 if (options.fragment !== undefined) {
721 urlTree.fragment = options.fragment;
722 }
723 /**
724 * `navigateByUrl` will still apply `NavigationExtras` properties
725 * that do not modify the url, such as `replaceUrl` which is why
726 * `options` is passed in here.
727 */
728 return this.router.navigateByUrl(urlTree, options);
729 }
730 }
731};
732NavController.ctorParameters = () => [
733 { type: Platform },
734 { type: Location },
735 { type: UrlSerializer },
736 { type: Router, decorators: [{ type: Optional }] }
737];
738NavController.ngInjectableDef = ɵɵdefineInjectable({ factory: function NavController_Factory() { return new NavController(ɵɵinject(Platform), ɵɵinject(Location), ɵɵinject(UrlSerializer), ɵɵinject(Router, 8)); }, token: NavController, providedIn: "root" });
739NavController = __decorate([
740 Injectable({
741 providedIn: 'root',
742 }),
743 __param(3, Optional())
744], NavController);
745const getAnimation = (direction, animated, animationDirection) => {
746 if (animated === false) {
747 return undefined;
748 }
749 if (animationDirection !== undefined) {
750 return animationDirection;
751 }
752 if (direction === 'forward' || direction === 'back') {
753 return direction;
754 }
755 else if (direction === 'root' && animated === true) {
756 return 'forward';
757 }
758 return undefined;
759};
760const ɵ0$2 = getAnimation;
761const DEFAULT_DIRECTION = 'auto';
762const DEFAULT_ANIMATED = undefined;
763
764/* eslint-disable */
765const proxyInputs = (Cmp, inputs) => {
766 const Prototype = Cmp.prototype;
767 inputs.forEach(item => {
768 Object.defineProperty(Prototype, item, {
769 get() {
770 return this.el[item];
771 },
772 set(val) {
773 this.z.runOutsideAngular(() => (this.el[item] = val));
774 }
775 });
776 });
777};
778const proxyMethods = (Cmp, methods) => {
779 const Prototype = Cmp.prototype;
780 methods.forEach(methodName => {
781 Prototype[methodName] = function () {
782 const args = arguments;
783 return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
784 };
785 });
786};
787const proxyOutputs = (instance, el, events) => {
788 events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
789};
790function ProxyCmp(opts) {
791 const decorator = function (cls) {
792 if (opts.inputs) {
793 proxyInputs(cls, opts.inputs);
794 }
795 if (opts.methods) {
796 proxyMethods(cls, opts.methods);
797 }
798 return cls;
799 };
800 return decorator;
801}
802
803let IonApp = class IonApp {
804 constructor(c, r, z) {
805 this.z = z;
806 c.detach();
807 this.el = r.nativeElement;
808 }
809};
810IonApp.ctorParameters = () => [
811 { type: ChangeDetectorRef },
812 { type: ElementRef },
813 { type: NgZone }
814];
815IonApp = __decorate([
816 Component({ selector: "ion-app", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>" })
817], IonApp);
818let IonAvatar = class IonAvatar {
819 constructor(c, r, z) {
820 this.z = z;
821 c.detach();
822 this.el = r.nativeElement;
823 }
824};
825IonAvatar.ctorParameters = () => [
826 { type: ChangeDetectorRef },
827 { type: ElementRef },
828 { type: NgZone }
829];
830IonAvatar = __decorate([
831 Component({ selector: "ion-avatar", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>" })
832], IonAvatar);
833let IonBackButton = class IonBackButton {
834 constructor(c, r, z) {
835 this.z = z;
836 c.detach();
837 this.el = r.nativeElement;
838 }
839};
840IonBackButton.ctorParameters = () => [
841 { type: ChangeDetectorRef },
842 { type: ElementRef },
843 { type: NgZone }
844];
845IonBackButton = __decorate([
846 ProxyCmp({ inputs: ["color", "defaultHref", "disabled", "icon", "mode", "routerAnimation", "text", "type"] }),
847 Component({ selector: "ion-back-button", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "defaultHref", "disabled", "icon", "mode", "routerAnimation", "text", "type"] })
848], IonBackButton);
849let IonBackdrop = class IonBackdrop {
850 constructor(c, r, z) {
851 this.z = z;
852 c.detach();
853 this.el = r.nativeElement;
854 proxyOutputs(this, this.el, ["ionBackdropTap"]);
855 }
856};
857IonBackdrop.ctorParameters = () => [
858 { type: ChangeDetectorRef },
859 { type: ElementRef },
860 { type: NgZone }
861];
862IonBackdrop = __decorate([
863 ProxyCmp({ inputs: ["stopPropagation", "tappable", "visible"] }),
864 Component({ selector: "ion-backdrop", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["stopPropagation", "tappable", "visible"] })
865], IonBackdrop);
866let IonBadge = class IonBadge {
867 constructor(c, r, z) {
868 this.z = z;
869 c.detach();
870 this.el = r.nativeElement;
871 }
872};
873IonBadge.ctorParameters = () => [
874 { type: ChangeDetectorRef },
875 { type: ElementRef },
876 { type: NgZone }
877];
878IonBadge = __decorate([
879 ProxyCmp({ inputs: ["color", "mode"] }),
880 Component({ selector: "ion-badge", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode"] })
881], IonBadge);
882let IonButton = class IonButton {
883 constructor(c, r, z) {
884 this.z = z;
885 c.detach();
886 this.el = r.nativeElement;
887 proxyOutputs(this, this.el, ["ionFocus", "ionBlur"]);
888 }
889};
890IonButton.ctorParameters = () => [
891 { type: ChangeDetectorRef },
892 { type: ElementRef },
893 { type: NgZone }
894];
895IonButton = __decorate([
896 ProxyCmp({ inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }),
897 Component({ selector: "ion-button", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] })
898], IonButton);
899let IonButtons = class IonButtons {
900 constructor(c, r, z) {
901 this.z = z;
902 c.detach();
903 this.el = r.nativeElement;
904 }
905};
906IonButtons.ctorParameters = () => [
907 { type: ChangeDetectorRef },
908 { type: ElementRef },
909 { type: NgZone }
910];
911IonButtons = __decorate([
912 ProxyCmp({ inputs: ["collapse"] }),
913 Component({ selector: "ion-buttons", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["collapse"] })
914], IonButtons);
915let IonCard = class IonCard {
916 constructor(c, r, z) {
917 this.z = z;
918 c.detach();
919 this.el = r.nativeElement;
920 }
921};
922IonCard.ctorParameters = () => [
923 { type: ChangeDetectorRef },
924 { type: ElementRef },
925 { type: NgZone }
926];
927IonCard = __decorate([
928 ProxyCmp({ inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }),
929 Component({ selector: "ion-card", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] })
930], IonCard);
931let IonCardContent = class IonCardContent {
932 constructor(c, r, z) {
933 this.z = z;
934 c.detach();
935 this.el = r.nativeElement;
936 }
937};
938IonCardContent.ctorParameters = () => [
939 { type: ChangeDetectorRef },
940 { type: ElementRef },
941 { type: NgZone }
942];
943IonCardContent = __decorate([
944 ProxyCmp({ inputs: ["mode"] }),
945 Component({ selector: "ion-card-content", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["mode"] })
946], IonCardContent);
947let IonCardHeader = class IonCardHeader {
948 constructor(c, r, z) {
949 this.z = z;
950 c.detach();
951 this.el = r.nativeElement;
952 }
953};
954IonCardHeader.ctorParameters = () => [
955 { type: ChangeDetectorRef },
956 { type: ElementRef },
957 { type: NgZone }
958];
959IonCardHeader = __decorate([
960 ProxyCmp({ inputs: ["color", "mode", "translucent"] }),
961 Component({ selector: "ion-card-header", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode", "translucent"] })
962], IonCardHeader);
963let IonCardSubtitle = class IonCardSubtitle {
964 constructor(c, r, z) {
965 this.z = z;
966 c.detach();
967 this.el = r.nativeElement;
968 }
969};
970IonCardSubtitle.ctorParameters = () => [
971 { type: ChangeDetectorRef },
972 { type: ElementRef },
973 { type: NgZone }
974];
975IonCardSubtitle = __decorate([
976 ProxyCmp({ inputs: ["color", "mode"] }),
977 Component({ selector: "ion-card-subtitle", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode"] })
978], IonCardSubtitle);
979let IonCardTitle = class IonCardTitle {
980 constructor(c, r, z) {
981 this.z = z;
982 c.detach();
983 this.el = r.nativeElement;
984 }
985};
986IonCardTitle.ctorParameters = () => [
987 { type: ChangeDetectorRef },
988 { type: ElementRef },
989 { type: NgZone }
990];
991IonCardTitle = __decorate([
992 ProxyCmp({ inputs: ["color", "mode"] }),
993 Component({ selector: "ion-card-title", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode"] })
994], IonCardTitle);
995let IonCheckbox = class IonCheckbox {
996 constructor(c, r, z) {
997 this.z = z;
998 c.detach();
999 this.el = r.nativeElement;
1000 proxyOutputs(this, this.el, ["ionChange", "ionFocus", "ionBlur"]);
1001 }
1002};
1003IonCheckbox.ctorParameters = () => [
1004 { type: ChangeDetectorRef },
1005 { type: ElementRef },
1006 { type: NgZone }
1007];
1008IonCheckbox = __decorate([
1009 ProxyCmp({ inputs: ["checked", "color", "disabled", "indeterminate", "mode", "name", "value"] }),
1010 Component({ selector: "ion-checkbox", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["checked", "color", "disabled", "indeterminate", "mode", "name", "value"] })
1011], IonCheckbox);
1012let IonChip = class IonChip {
1013 constructor(c, r, z) {
1014 this.z = z;
1015 c.detach();
1016 this.el = r.nativeElement;
1017 }
1018};
1019IonChip.ctorParameters = () => [
1020 { type: ChangeDetectorRef },
1021 { type: ElementRef },
1022 { type: NgZone }
1023];
1024IonChip = __decorate([
1025 ProxyCmp({ inputs: ["color", "mode", "outline"] }),
1026 Component({ selector: "ion-chip", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode", "outline"] })
1027], IonChip);
1028let IonCol = class IonCol {
1029 constructor(c, r, z) {
1030 this.z = z;
1031 c.detach();
1032 this.el = r.nativeElement;
1033 }
1034};
1035IonCol.ctorParameters = () => [
1036 { type: ChangeDetectorRef },
1037 { type: ElementRef },
1038 { type: NgZone }
1039];
1040IonCol = __decorate([
1041 ProxyCmp({ inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }),
1042 Component({ selector: "ion-col", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] })
1043], IonCol);
1044let IonContent = class IonContent {
1045 constructor(c, r, z) {
1046 this.z = z;
1047 c.detach();
1048 this.el = r.nativeElement;
1049 proxyOutputs(this, this.el, ["ionScrollStart", "ionScroll", "ionScrollEnd"]);
1050 }
1051};
1052IonContent.ctorParameters = () => [
1053 { type: ChangeDetectorRef },
1054 { type: ElementRef },
1055 { type: NgZone }
1056];
1057IonContent = __decorate([
1058 ProxyCmp({ inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"], "methods": ["getScrollElement", "scrollToTop", "scrollToBottom", "scrollByPoint", "scrollToPoint"] }),
1059 Component({ selector: "ion-content", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] })
1060], IonContent);
1061let IonDatetime = class IonDatetime {
1062 constructor(c, r, z) {
1063 this.z = z;
1064 c.detach();
1065 this.el = r.nativeElement;
1066 proxyOutputs(this, this.el, ["ionCancel", "ionChange", "ionFocus", "ionBlur"]);
1067 }
1068};
1069IonDatetime.ctorParameters = () => [
1070 { type: ChangeDetectorRef },
1071 { type: ElementRef },
1072 { type: NgZone }
1073];
1074IonDatetime = __decorate([
1075 ProxyCmp({ inputs: ["cancelText", "dayNames", "dayShortNames", "dayValues", "disabled", "displayFormat", "displayTimezone", "doneText", "hourValues", "max", "min", "minuteValues", "mode", "monthNames", "monthShortNames", "monthValues", "name", "pickerFormat", "pickerOptions", "placeholder", "readonly", "value", "yearValues"], "methods": ["open"] }),
1076 Component({ selector: "ion-datetime", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["cancelText", "dayNames", "dayShortNames", "dayValues", "disabled", "displayFormat", "displayTimezone", "doneText", "hourValues", "max", "min", "minuteValues", "mode", "monthNames", "monthShortNames", "monthValues", "name", "pickerFormat", "pickerOptions", "placeholder", "readonly", "value", "yearValues"] })
1077], IonDatetime);
1078let IonFab = class IonFab {
1079 constructor(c, r, z) {
1080 this.z = z;
1081 c.detach();
1082 this.el = r.nativeElement;
1083 }
1084};
1085IonFab.ctorParameters = () => [
1086 { type: ChangeDetectorRef },
1087 { type: ElementRef },
1088 { type: NgZone }
1089];
1090IonFab = __decorate([
1091 ProxyCmp({ inputs: ["activated", "edge", "horizontal", "vertical"], "methods": ["close"] }),
1092 Component({ selector: "ion-fab", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["activated", "edge", "horizontal", "vertical"] })
1093], IonFab);
1094let IonFabButton = class IonFabButton {
1095 constructor(c, r, z) {
1096 this.z = z;
1097 c.detach();
1098 this.el = r.nativeElement;
1099 proxyOutputs(this, this.el, ["ionFocus", "ionBlur"]);
1100 }
1101};
1102IonFabButton.ctorParameters = () => [
1103 { type: ChangeDetectorRef },
1104 { type: ElementRef },
1105 { type: NgZone }
1106];
1107IonFabButton = __decorate([
1108 ProxyCmp({ inputs: ["activated", "closeIcon", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "show", "size", "target", "translucent", "type"] }),
1109 Component({ selector: "ion-fab-button", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["activated", "closeIcon", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "show", "size", "target", "translucent", "type"] })
1110], IonFabButton);
1111let IonFabList = class IonFabList {
1112 constructor(c, r, z) {
1113 this.z = z;
1114 c.detach();
1115 this.el = r.nativeElement;
1116 }
1117};
1118IonFabList.ctorParameters = () => [
1119 { type: ChangeDetectorRef },
1120 { type: ElementRef },
1121 { type: NgZone }
1122];
1123IonFabList = __decorate([
1124 ProxyCmp({ inputs: ["activated", "side"] }),
1125 Component({ selector: "ion-fab-list", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["activated", "side"] })
1126], IonFabList);
1127let IonFooter = class IonFooter {
1128 constructor(c, r, z) {
1129 this.z = z;
1130 c.detach();
1131 this.el = r.nativeElement;
1132 }
1133};
1134IonFooter.ctorParameters = () => [
1135 { type: ChangeDetectorRef },
1136 { type: ElementRef },
1137 { type: NgZone }
1138];
1139IonFooter = __decorate([
1140 ProxyCmp({ inputs: ["mode", "translucent"] }),
1141 Component({ selector: "ion-footer", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["mode", "translucent"] })
1142], IonFooter);
1143let IonGrid = class IonGrid {
1144 constructor(c, r, z) {
1145 this.z = z;
1146 c.detach();
1147 this.el = r.nativeElement;
1148 }
1149};
1150IonGrid.ctorParameters = () => [
1151 { type: ChangeDetectorRef },
1152 { type: ElementRef },
1153 { type: NgZone }
1154];
1155IonGrid = __decorate([
1156 ProxyCmp({ inputs: ["fixed"] }),
1157 Component({ selector: "ion-grid", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["fixed"] })
1158], IonGrid);
1159let IonHeader = class IonHeader {
1160 constructor(c, r, z) {
1161 this.z = z;
1162 c.detach();
1163 this.el = r.nativeElement;
1164 }
1165};
1166IonHeader.ctorParameters = () => [
1167 { type: ChangeDetectorRef },
1168 { type: ElementRef },
1169 { type: NgZone }
1170];
1171IonHeader = __decorate([
1172 ProxyCmp({ inputs: ["collapse", "mode", "translucent"] }),
1173 Component({ selector: "ion-header", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["collapse", "mode", "translucent"] })
1174], IonHeader);
1175let IonIcon = class IonIcon {
1176 constructor(c, r, z) {
1177 this.z = z;
1178 c.detach();
1179 this.el = r.nativeElement;
1180 }
1181};
1182IonIcon.ctorParameters = () => [
1183 { type: ChangeDetectorRef },
1184 { type: ElementRef },
1185 { type: NgZone }
1186];
1187IonIcon = __decorate([
1188 ProxyCmp({ inputs: ["ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "size", "src"] }),
1189 Component({ selector: "ion-icon", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["ariaLabel", "color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "size", "src"] })
1190], IonIcon);
1191let IonImg = class IonImg {
1192 constructor(c, r, z) {
1193 this.z = z;
1194 c.detach();
1195 this.el = r.nativeElement;
1196 proxyOutputs(this, this.el, ["ionImgWillLoad", "ionImgDidLoad", "ionError"]);
1197 }
1198};
1199IonImg.ctorParameters = () => [
1200 { type: ChangeDetectorRef },
1201 { type: ElementRef },
1202 { type: NgZone }
1203];
1204IonImg = __decorate([
1205 ProxyCmp({ inputs: ["alt", "src"] }),
1206 Component({ selector: "ion-img", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["alt", "src"] })
1207], IonImg);
1208let IonInfiniteScroll = class IonInfiniteScroll {
1209 constructor(c, r, z) {
1210 this.z = z;
1211 c.detach();
1212 this.el = r.nativeElement;
1213 proxyOutputs(this, this.el, ["ionInfinite"]);
1214 }
1215};
1216IonInfiniteScroll.ctorParameters = () => [
1217 { type: ChangeDetectorRef },
1218 { type: ElementRef },
1219 { type: NgZone }
1220];
1221IonInfiniteScroll = __decorate([
1222 ProxyCmp({ inputs: ["disabled", "position", "threshold"], "methods": ["complete"] }),
1223 Component({ selector: "ion-infinite-scroll", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["disabled", "position", "threshold"] })
1224], IonInfiniteScroll);
1225let IonInfiniteScrollContent = class IonInfiniteScrollContent {
1226 constructor(c, r, z) {
1227 this.z = z;
1228 c.detach();
1229 this.el = r.nativeElement;
1230 }
1231};
1232IonInfiniteScrollContent.ctorParameters = () => [
1233 { type: ChangeDetectorRef },
1234 { type: ElementRef },
1235 { type: NgZone }
1236];
1237IonInfiniteScrollContent = __decorate([
1238 ProxyCmp({ inputs: ["loadingSpinner", "loadingText"] }),
1239 Component({ selector: "ion-infinite-scroll-content", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["loadingSpinner", "loadingText"] })
1240], IonInfiniteScrollContent);
1241let IonInput = class IonInput {
1242 constructor(c, r, z) {
1243 this.z = z;
1244 c.detach();
1245 this.el = r.nativeElement;
1246 proxyOutputs(this, this.el, ["ionInput", "ionChange", "ionBlur", "ionFocus"]);
1247 }
1248};
1249IonInput.ctorParameters = () => [
1250 { type: ChangeDetectorRef },
1251 { type: ElementRef },
1252 { type: NgZone }
1253];
1254IonInput = __decorate([
1255 ProxyCmp({ inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"], "methods": ["setFocus", "getInputElement"] }),
1256 Component({ selector: "ion-input", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"] })
1257], IonInput);
1258let IonItem = class IonItem {
1259 constructor(c, r, z) {
1260 this.z = z;
1261 c.detach();
1262 this.el = r.nativeElement;
1263 }
1264};
1265IonItem.ctorParameters = () => [
1266 { type: ChangeDetectorRef },
1267 { type: ElementRef },
1268 { type: NgZone }
1269];
1270IonItem = __decorate([
1271 ProxyCmp({ inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }),
1272 Component({ selector: "ion-item", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] })
1273], IonItem);
1274let IonItemDivider = class IonItemDivider {
1275 constructor(c, r, z) {
1276 this.z = z;
1277 c.detach();
1278 this.el = r.nativeElement;
1279 }
1280};
1281IonItemDivider.ctorParameters = () => [
1282 { type: ChangeDetectorRef },
1283 { type: ElementRef },
1284 { type: NgZone }
1285];
1286IonItemDivider = __decorate([
1287 ProxyCmp({ inputs: ["color", "mode", "sticky"] }),
1288 Component({ selector: "ion-item-divider", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode", "sticky"] })
1289], IonItemDivider);
1290let IonItemGroup = class IonItemGroup {
1291 constructor(c, r, z) {
1292 this.z = z;
1293 c.detach();
1294 this.el = r.nativeElement;
1295 }
1296};
1297IonItemGroup.ctorParameters = () => [
1298 { type: ChangeDetectorRef },
1299 { type: ElementRef },
1300 { type: NgZone }
1301];
1302IonItemGroup = __decorate([
1303 Component({ selector: "ion-item-group", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>" })
1304], IonItemGroup);
1305let IonItemOption = class IonItemOption {
1306 constructor(c, r, z) {
1307 this.z = z;
1308 c.detach();
1309 this.el = r.nativeElement;
1310 }
1311};
1312IonItemOption.ctorParameters = () => [
1313 { type: ChangeDetectorRef },
1314 { type: ElementRef },
1315 { type: NgZone }
1316];
1317IonItemOption = __decorate([
1318 ProxyCmp({ inputs: ["color", "disabled", "download", "expandable", "href", "mode", "rel", "target", "type"] }),
1319 Component({ selector: "ion-item-option", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "disabled", "download", "expandable", "href", "mode", "rel", "target", "type"] })
1320], IonItemOption);
1321let IonItemOptions = class IonItemOptions {
1322 constructor(c, r, z) {
1323 this.z = z;
1324 c.detach();
1325 this.el = r.nativeElement;
1326 proxyOutputs(this, this.el, ["ionSwipe"]);
1327 }
1328};
1329IonItemOptions.ctorParameters = () => [
1330 { type: ChangeDetectorRef },
1331 { type: ElementRef },
1332 { type: NgZone }
1333];
1334IonItemOptions = __decorate([
1335 ProxyCmp({ inputs: ["side"] }),
1336 Component({ selector: "ion-item-options", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["side"] })
1337], IonItemOptions);
1338let IonItemSliding = class IonItemSliding {
1339 constructor(c, r, z) {
1340 this.z = z;
1341 c.detach();
1342 this.el = r.nativeElement;
1343 proxyOutputs(this, this.el, ["ionDrag"]);
1344 }
1345};
1346IonItemSliding.ctorParameters = () => [
1347 { type: ChangeDetectorRef },
1348 { type: ElementRef },
1349 { type: NgZone }
1350];
1351IonItemSliding = __decorate([
1352 ProxyCmp({ inputs: ["disabled"], "methods": ["getOpenAmount", "getSlidingRatio", "open", "close", "closeOpened"] }),
1353 Component({ selector: "ion-item-sliding", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["disabled"] })
1354], IonItemSliding);
1355let IonLabel = class IonLabel {
1356 constructor(c, r, z) {
1357 this.z = z;
1358 c.detach();
1359 this.el = r.nativeElement;
1360 }
1361};
1362IonLabel.ctorParameters = () => [
1363 { type: ChangeDetectorRef },
1364 { type: ElementRef },
1365 { type: NgZone }
1366];
1367IonLabel = __decorate([
1368 ProxyCmp({ inputs: ["color", "mode", "position"] }),
1369 Component({ selector: "ion-label", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode", "position"] })
1370], IonLabel);
1371let IonList = class IonList {
1372 constructor(c, r, z) {
1373 this.z = z;
1374 c.detach();
1375 this.el = r.nativeElement;
1376 }
1377};
1378IonList.ctorParameters = () => [
1379 { type: ChangeDetectorRef },
1380 { type: ElementRef },
1381 { type: NgZone }
1382];
1383IonList = __decorate([
1384 ProxyCmp({ inputs: ["inset", "lines", "mode"], "methods": ["closeSlidingItems"] }),
1385 Component({ selector: "ion-list", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["inset", "lines", "mode"] })
1386], IonList);
1387let IonListHeader = class IonListHeader {
1388 constructor(c, r, z) {
1389 this.z = z;
1390 c.detach();
1391 this.el = r.nativeElement;
1392 }
1393};
1394IonListHeader.ctorParameters = () => [
1395 { type: ChangeDetectorRef },
1396 { type: ElementRef },
1397 { type: NgZone }
1398];
1399IonListHeader = __decorate([
1400 ProxyCmp({ inputs: ["color", "lines", "mode"] }),
1401 Component({ selector: "ion-list-header", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "lines", "mode"] })
1402], IonListHeader);
1403let IonMenu = class IonMenu {
1404 constructor(c, r, z) {
1405 this.z = z;
1406 c.detach();
1407 this.el = r.nativeElement;
1408 proxyOutputs(this, this.el, ["ionWillOpen", "ionWillClose", "ionDidOpen", "ionDidClose"]);
1409 }
1410};
1411IonMenu.ctorParameters = () => [
1412 { type: ChangeDetectorRef },
1413 { type: ElementRef },
1414 { type: NgZone }
1415];
1416IonMenu = __decorate([
1417 ProxyCmp({ inputs: ["contentId", "disabled", "maxEdgeStart", "menuId", "side", "swipeGesture", "type"], "methods": ["isOpen", "isActive", "open", "close", "toggle", "setOpen"] }),
1418 Component({ selector: "ion-menu", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["contentId", "disabled", "maxEdgeStart", "menuId", "side", "swipeGesture", "type"] })
1419], IonMenu);
1420let IonMenuButton = class IonMenuButton {
1421 constructor(c, r, z) {
1422 this.z = z;
1423 c.detach();
1424 this.el = r.nativeElement;
1425 }
1426};
1427IonMenuButton.ctorParameters = () => [
1428 { type: ChangeDetectorRef },
1429 { type: ElementRef },
1430 { type: NgZone }
1431];
1432IonMenuButton = __decorate([
1433 ProxyCmp({ inputs: ["autoHide", "color", "disabled", "menu", "mode", "type"] }),
1434 Component({ selector: "ion-menu-button", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["autoHide", "color", "disabled", "menu", "mode", "type"] })
1435], IonMenuButton);
1436let IonMenuToggle = class IonMenuToggle {
1437 constructor(c, r, z) {
1438 this.z = z;
1439 c.detach();
1440 this.el = r.nativeElement;
1441 }
1442};
1443IonMenuToggle.ctorParameters = () => [
1444 { type: ChangeDetectorRef },
1445 { type: ElementRef },
1446 { type: NgZone }
1447];
1448IonMenuToggle = __decorate([
1449 ProxyCmp({ inputs: ["autoHide", "menu"] }),
1450 Component({ selector: "ion-menu-toggle", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["autoHide", "menu"] })
1451], IonMenuToggle);
1452let IonNav = class IonNav {
1453 constructor(c, r, z) {
1454 this.z = z;
1455 c.detach();
1456 this.el = r.nativeElement;
1457 proxyOutputs(this, this.el, ["ionNavWillChange", "ionNavDidChange"]);
1458 }
1459};
1460IonNav.ctorParameters = () => [
1461 { type: ChangeDetectorRef },
1462 { type: ElementRef },
1463 { type: NgZone }
1464];
1465IonNav = __decorate([
1466 ProxyCmp({ inputs: ["animated", "animation", "root", "rootParams", "swipeGesture"], "methods": ["push", "insert", "insertPages", "pop", "popTo", "popToRoot", "removeIndex", "setRoot", "setPages", "getActive", "getByIndex", "canGoBack", "getPrevious"] }),
1467 Component({ selector: "ion-nav", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["animated", "animation", "root", "rootParams", "swipeGesture"] })
1468], IonNav);
1469let IonNavLink = class IonNavLink {
1470 constructor(c, r, z) {
1471 this.z = z;
1472 c.detach();
1473 this.el = r.nativeElement;
1474 }
1475};
1476IonNavLink.ctorParameters = () => [
1477 { type: ChangeDetectorRef },
1478 { type: ElementRef },
1479 { type: NgZone }
1480];
1481IonNavLink = __decorate([
1482 ProxyCmp({ inputs: ["component", "componentProps", "routerAnimation", "routerDirection"] }),
1483 Component({ selector: "ion-nav-link", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["component", "componentProps", "routerAnimation", "routerDirection"] })
1484], IonNavLink);
1485let IonNote = class IonNote {
1486 constructor(c, r, z) {
1487 this.z = z;
1488 c.detach();
1489 this.el = r.nativeElement;
1490 }
1491};
1492IonNote.ctorParameters = () => [
1493 { type: ChangeDetectorRef },
1494 { type: ElementRef },
1495 { type: NgZone }
1496];
1497IonNote = __decorate([
1498 ProxyCmp({ inputs: ["color", "mode"] }),
1499 Component({ selector: "ion-note", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode"] })
1500], IonNote);
1501let IonProgressBar = class IonProgressBar {
1502 constructor(c, r, z) {
1503 this.z = z;
1504 c.detach();
1505 this.el = r.nativeElement;
1506 }
1507};
1508IonProgressBar.ctorParameters = () => [
1509 { type: ChangeDetectorRef },
1510 { type: ElementRef },
1511 { type: NgZone }
1512];
1513IonProgressBar = __decorate([
1514 ProxyCmp({ inputs: ["buffer", "color", "mode", "reversed", "type", "value"] }),
1515 Component({ selector: "ion-progress-bar", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["buffer", "color", "mode", "reversed", "type", "value"] })
1516], IonProgressBar);
1517let IonRadio = class IonRadio {
1518 constructor(c, r, z) {
1519 this.z = z;
1520 c.detach();
1521 this.el = r.nativeElement;
1522 proxyOutputs(this, this.el, ["ionFocus", "ionBlur"]);
1523 }
1524};
1525IonRadio.ctorParameters = () => [
1526 { type: ChangeDetectorRef },
1527 { type: ElementRef },
1528 { type: NgZone }
1529];
1530IonRadio = __decorate([
1531 ProxyCmp({ inputs: ["color", "disabled", "mode", "name", "value"] }),
1532 Component({ selector: "ion-radio", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "disabled", "mode", "name", "value"] })
1533], IonRadio);
1534let IonRadioGroup = class IonRadioGroup {
1535 constructor(c, r, z) {
1536 this.z = z;
1537 c.detach();
1538 this.el = r.nativeElement;
1539 proxyOutputs(this, this.el, ["ionChange"]);
1540 }
1541};
1542IonRadioGroup.ctorParameters = () => [
1543 { type: ChangeDetectorRef },
1544 { type: ElementRef },
1545 { type: NgZone }
1546];
1547IonRadioGroup = __decorate([
1548 ProxyCmp({ inputs: ["allowEmptySelection", "name", "value"] }),
1549 Component({ selector: "ion-radio-group", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["allowEmptySelection", "name", "value"] })
1550], IonRadioGroup);
1551let IonRange = class IonRange {
1552 constructor(c, r, z) {
1553 this.z = z;
1554 c.detach();
1555 this.el = r.nativeElement;
1556 proxyOutputs(this, this.el, ["ionChange", "ionFocus", "ionBlur"]);
1557 }
1558};
1559IonRange.ctorParameters = () => [
1560 { type: ChangeDetectorRef },
1561 { type: ElementRef },
1562 { type: NgZone }
1563];
1564IonRange = __decorate([
1565 ProxyCmp({ inputs: ["color", "debounce", "disabled", "dualKnobs", "max", "min", "mode", "name", "pin", "snaps", "step", "ticks", "value"] }),
1566 Component({ selector: "ion-range", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "debounce", "disabled", "dualKnobs", "max", "min", "mode", "name", "pin", "snaps", "step", "ticks", "value"] })
1567], IonRange);
1568let IonRefresher = class IonRefresher {
1569 constructor(c, r, z) {
1570 this.z = z;
1571 c.detach();
1572 this.el = r.nativeElement;
1573 proxyOutputs(this, this.el, ["ionRefresh", "ionPull", "ionStart"]);
1574 }
1575};
1576IonRefresher.ctorParameters = () => [
1577 { type: ChangeDetectorRef },
1578 { type: ElementRef },
1579 { type: NgZone }
1580];
1581IonRefresher = __decorate([
1582 ProxyCmp({ inputs: ["closeDuration", "disabled", "pullFactor", "pullMax", "pullMin", "snapbackDuration"], "methods": ["complete", "cancel", "getProgress"] }),
1583 Component({ selector: "ion-refresher", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["closeDuration", "disabled", "pullFactor", "pullMax", "pullMin", "snapbackDuration"] })
1584], IonRefresher);
1585let IonRefresherContent = class IonRefresherContent {
1586 constructor(c, r, z) {
1587 this.z = z;
1588 c.detach();
1589 this.el = r.nativeElement;
1590 }
1591};
1592IonRefresherContent.ctorParameters = () => [
1593 { type: ChangeDetectorRef },
1594 { type: ElementRef },
1595 { type: NgZone }
1596];
1597IonRefresherContent = __decorate([
1598 ProxyCmp({ inputs: ["pullingIcon", "pullingText", "refreshingSpinner", "refreshingText"] }),
1599 Component({ selector: "ion-refresher-content", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["pullingIcon", "pullingText", "refreshingSpinner", "refreshingText"] })
1600], IonRefresherContent);
1601let IonReorder = class IonReorder {
1602 constructor(c, r, z) {
1603 this.z = z;
1604 c.detach();
1605 this.el = r.nativeElement;
1606 }
1607};
1608IonReorder.ctorParameters = () => [
1609 { type: ChangeDetectorRef },
1610 { type: ElementRef },
1611 { type: NgZone }
1612];
1613IonReorder = __decorate([
1614 Component({ selector: "ion-reorder", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>" })
1615], IonReorder);
1616let IonReorderGroup = class IonReorderGroup {
1617 constructor(c, r, z) {
1618 this.z = z;
1619 c.detach();
1620 this.el = r.nativeElement;
1621 proxyOutputs(this, this.el, ["ionItemReorder"]);
1622 }
1623};
1624IonReorderGroup.ctorParameters = () => [
1625 { type: ChangeDetectorRef },
1626 { type: ElementRef },
1627 { type: NgZone }
1628];
1629IonReorderGroup = __decorate([
1630 ProxyCmp({ inputs: ["disabled"], "methods": ["complete"] }),
1631 Component({ selector: "ion-reorder-group", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["disabled"] })
1632], IonReorderGroup);
1633let IonRippleEffect = class IonRippleEffect {
1634 constructor(c, r, z) {
1635 this.z = z;
1636 c.detach();
1637 this.el = r.nativeElement;
1638 }
1639};
1640IonRippleEffect.ctorParameters = () => [
1641 { type: ChangeDetectorRef },
1642 { type: ElementRef },
1643 { type: NgZone }
1644];
1645IonRippleEffect = __decorate([
1646 ProxyCmp({ inputs: ["type"], "methods": ["addRipple"] }),
1647 Component({ selector: "ion-ripple-effect", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["type"] })
1648], IonRippleEffect);
1649let IonRow = class IonRow {
1650 constructor(c, r, z) {
1651 this.z = z;
1652 c.detach();
1653 this.el = r.nativeElement;
1654 }
1655};
1656IonRow.ctorParameters = () => [
1657 { type: ChangeDetectorRef },
1658 { type: ElementRef },
1659 { type: NgZone }
1660];
1661IonRow = __decorate([
1662 Component({ selector: "ion-row", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>" })
1663], IonRow);
1664let IonSearchbar = class IonSearchbar {
1665 constructor(c, r, z) {
1666 this.z = z;
1667 c.detach();
1668 this.el = r.nativeElement;
1669 proxyOutputs(this, this.el, ["ionInput", "ionChange", "ionCancel", "ionClear", "ionBlur", "ionFocus"]);
1670 }
1671};
1672IonSearchbar.ctorParameters = () => [
1673 { type: ChangeDetectorRef },
1674 { type: ElementRef },
1675 { type: NgZone }
1676];
1677IonSearchbar = __decorate([
1678 ProxyCmp({ inputs: ["animated", "autocomplete", "autocorrect", "cancelButtonIcon", "cancelButtonText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "mode", "placeholder", "searchIcon", "showCancelButton", "spellcheck", "type", "value"], "methods": ["setFocus", "getInputElement"] }),
1679 Component({ selector: "ion-searchbar", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["animated", "autocomplete", "autocorrect", "cancelButtonIcon", "cancelButtonText", "clearIcon", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "mode", "placeholder", "searchIcon", "showCancelButton", "spellcheck", "type", "value"] })
1680], IonSearchbar);
1681let IonSegment = class IonSegment {
1682 constructor(c, r, z) {
1683 this.z = z;
1684 c.detach();
1685 this.el = r.nativeElement;
1686 proxyOutputs(this, this.el, ["ionChange"]);
1687 }
1688};
1689IonSegment.ctorParameters = () => [
1690 { type: ChangeDetectorRef },
1691 { type: ElementRef },
1692 { type: NgZone }
1693];
1694IonSegment = __decorate([
1695 ProxyCmp({ inputs: ["color", "disabled", "mode", "scrollable", "value"] }),
1696 Component({ selector: "ion-segment", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "disabled", "mode", "scrollable", "value"] })
1697], IonSegment);
1698let IonSegmentButton = class IonSegmentButton {
1699 constructor(c, r, z) {
1700 this.z = z;
1701 c.detach();
1702 this.el = r.nativeElement;
1703 }
1704};
1705IonSegmentButton.ctorParameters = () => [
1706 { type: ChangeDetectorRef },
1707 { type: ElementRef },
1708 { type: NgZone }
1709];
1710IonSegmentButton = __decorate([
1711 ProxyCmp({ inputs: ["disabled", "layout", "mode", "type", "value"] }),
1712 Component({ selector: "ion-segment-button", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["disabled", "layout", "mode", "type", "value"] })
1713], IonSegmentButton);
1714let IonSelect = class IonSelect {
1715 constructor(c, r, z) {
1716 this.z = z;
1717 c.detach();
1718 this.el = r.nativeElement;
1719 proxyOutputs(this, this.el, ["ionChange", "ionCancel", "ionFocus", "ionBlur"]);
1720 }
1721};
1722IonSelect.ctorParameters = () => [
1723 { type: ChangeDetectorRef },
1724 { type: ElementRef },
1725 { type: NgZone }
1726];
1727IonSelect = __decorate([
1728 ProxyCmp({ inputs: ["cancelText", "compareWith", "disabled", "interface", "interfaceOptions", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "value"], "methods": ["open"] }),
1729 Component({ selector: "ion-select", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["cancelText", "compareWith", "disabled", "interface", "interfaceOptions", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "value"] })
1730], IonSelect);
1731let IonSelectOption = class IonSelectOption {
1732 constructor(c, r, z) {
1733 this.z = z;
1734 c.detach();
1735 this.el = r.nativeElement;
1736 }
1737};
1738IonSelectOption.ctorParameters = () => [
1739 { type: ChangeDetectorRef },
1740 { type: ElementRef },
1741 { type: NgZone }
1742];
1743IonSelectOption = __decorate([
1744 ProxyCmp({ inputs: ["disabled", "value"] }),
1745 Component({ selector: "ion-select-option", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["disabled", "value"] })
1746], IonSelectOption);
1747let IonSkeletonText = class IonSkeletonText {
1748 constructor(c, r, z) {
1749 this.z = z;
1750 c.detach();
1751 this.el = r.nativeElement;
1752 }
1753};
1754IonSkeletonText.ctorParameters = () => [
1755 { type: ChangeDetectorRef },
1756 { type: ElementRef },
1757 { type: NgZone }
1758];
1759IonSkeletonText = __decorate([
1760 ProxyCmp({ inputs: ["animated"] }),
1761 Component({ selector: "ion-skeleton-text", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["animated"] })
1762], IonSkeletonText);
1763let IonSlide = class IonSlide {
1764 constructor(c, r, z) {
1765 this.z = z;
1766 c.detach();
1767 this.el = r.nativeElement;
1768 }
1769};
1770IonSlide.ctorParameters = () => [
1771 { type: ChangeDetectorRef },
1772 { type: ElementRef },
1773 { type: NgZone }
1774];
1775IonSlide = __decorate([
1776 Component({ selector: "ion-slide", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>" })
1777], IonSlide);
1778let IonSlides = class IonSlides {
1779 constructor(c, r, z) {
1780 this.z = z;
1781 c.detach();
1782 this.el = r.nativeElement;
1783 proxyOutputs(this, this.el, ["ionSlidesDidLoad", "ionSlideTap", "ionSlideDoubleTap", "ionSlideWillChange", "ionSlideDidChange", "ionSlideNextStart", "ionSlidePrevStart", "ionSlideNextEnd", "ionSlidePrevEnd", "ionSlideTransitionStart", "ionSlideTransitionEnd", "ionSlideDrag", "ionSlideReachStart", "ionSlideReachEnd", "ionSlideTouchStart", "ionSlideTouchEnd"]);
1784 }
1785};
1786IonSlides.ctorParameters = () => [
1787 { type: ChangeDetectorRef },
1788 { type: ElementRef },
1789 { type: NgZone }
1790];
1791IonSlides = __decorate([
1792 ProxyCmp({ inputs: ["mode", "options", "pager", "scrollbar"], "methods": ["update", "updateAutoHeight", "slideTo", "slideNext", "slidePrev", "getActiveIndex", "getPreviousIndex", "length", "isEnd", "isBeginning", "startAutoplay", "stopAutoplay", "lockSwipeToNext", "lockSwipeToPrev", "lockSwipes", "getSwiper"] }),
1793 Component({ selector: "ion-slides", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["mode", "options", "pager", "scrollbar"] })
1794], IonSlides);
1795let IonSpinner = class IonSpinner {
1796 constructor(c, r, z) {
1797 this.z = z;
1798 c.detach();
1799 this.el = r.nativeElement;
1800 }
1801};
1802IonSpinner.ctorParameters = () => [
1803 { type: ChangeDetectorRef },
1804 { type: ElementRef },
1805 { type: NgZone }
1806];
1807IonSpinner = __decorate([
1808 ProxyCmp({ inputs: ["color", "duration", "name", "paused"] }),
1809 Component({ selector: "ion-spinner", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "duration", "name", "paused"] })
1810], IonSpinner);
1811let IonSplitPane = class IonSplitPane {
1812 constructor(c, r, z) {
1813 this.z = z;
1814 c.detach();
1815 this.el = r.nativeElement;
1816 proxyOutputs(this, this.el, ["ionSplitPaneVisible"]);
1817 }
1818};
1819IonSplitPane.ctorParameters = () => [
1820 { type: ChangeDetectorRef },
1821 { type: ElementRef },
1822 { type: NgZone }
1823];
1824IonSplitPane = __decorate([
1825 ProxyCmp({ inputs: ["contentId", "disabled", "when"] }),
1826 Component({ selector: "ion-split-pane", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["contentId", "disabled", "when"] })
1827], IonSplitPane);
1828let IonTabBar = class IonTabBar {
1829 constructor(c, r, z) {
1830 this.z = z;
1831 c.detach();
1832 this.el = r.nativeElement;
1833 }
1834};
1835IonTabBar.ctorParameters = () => [
1836 { type: ChangeDetectorRef },
1837 { type: ElementRef },
1838 { type: NgZone }
1839];
1840IonTabBar = __decorate([
1841 ProxyCmp({ inputs: ["color", "mode", "selectedTab", "translucent"] }),
1842 Component({ selector: "ion-tab-bar", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode", "selectedTab", "translucent"] })
1843], IonTabBar);
1844let IonTabButton = class IonTabButton {
1845 constructor(c, r, z) {
1846 this.z = z;
1847 c.detach();
1848 this.el = r.nativeElement;
1849 }
1850};
1851IonTabButton.ctorParameters = () => [
1852 { type: ChangeDetectorRef },
1853 { type: ElementRef },
1854 { type: NgZone }
1855];
1856IonTabButton = __decorate([
1857 ProxyCmp({ inputs: ["disabled", "download", "href", "layout", "mode", "rel", "selected", "tab", "target"] }),
1858 Component({ selector: "ion-tab-button", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["disabled", "download", "href", "layout", "mode", "rel", "selected", "tab", "target"] })
1859], IonTabButton);
1860let IonText = class IonText {
1861 constructor(c, r, z) {
1862 this.z = z;
1863 c.detach();
1864 this.el = r.nativeElement;
1865 }
1866};
1867IonText.ctorParameters = () => [
1868 { type: ChangeDetectorRef },
1869 { type: ElementRef },
1870 { type: NgZone }
1871];
1872IonText = __decorate([
1873 ProxyCmp({ inputs: ["color", "mode"] }),
1874 Component({ selector: "ion-text", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode"] })
1875], IonText);
1876let IonTextarea = class IonTextarea {
1877 constructor(c, r, z) {
1878 this.z = z;
1879 c.detach();
1880 this.el = r.nativeElement;
1881 proxyOutputs(this, this.el, ["ionChange", "ionInput", "ionBlur", "ionFocus"]);
1882 }
1883};
1884IonTextarea.ctorParameters = () => [
1885 { type: ChangeDetectorRef },
1886 { type: ElementRef },
1887 { type: NgZone }
1888];
1889IonTextarea = __decorate([
1890 ProxyCmp({ inputs: ["autoGrow", "autocapitalize", "autofocus", "clearOnEdit", "color", "cols", "debounce", "disabled", "enterkeyhint", "inputmode", "maxlength", "minlength", "mode", "name", "placeholder", "readonly", "required", "rows", "spellcheck", "value", "wrap"], "methods": ["setFocus", "getInputElement"] }),
1891 Component({ selector: "ion-textarea", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["autoGrow", "autocapitalize", "autofocus", "clearOnEdit", "color", "cols", "debounce", "disabled", "enterkeyhint", "inputmode", "maxlength", "minlength", "mode", "name", "placeholder", "readonly", "required", "rows", "spellcheck", "value", "wrap"] })
1892], IonTextarea);
1893let IonThumbnail = class IonThumbnail {
1894 constructor(c, r, z) {
1895 this.z = z;
1896 c.detach();
1897 this.el = r.nativeElement;
1898 }
1899};
1900IonThumbnail.ctorParameters = () => [
1901 { type: ChangeDetectorRef },
1902 { type: ElementRef },
1903 { type: NgZone }
1904];
1905IonThumbnail = __decorate([
1906 Component({ selector: "ion-thumbnail", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>" })
1907], IonThumbnail);
1908let IonTitle = class IonTitle {
1909 constructor(c, r, z) {
1910 this.z = z;
1911 c.detach();
1912 this.el = r.nativeElement;
1913 }
1914};
1915IonTitle.ctorParameters = () => [
1916 { type: ChangeDetectorRef },
1917 { type: ElementRef },
1918 { type: NgZone }
1919];
1920IonTitle = __decorate([
1921 ProxyCmp({ inputs: ["color", "size"] }),
1922 Component({ selector: "ion-title", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "size"] })
1923], IonTitle);
1924let IonToggle = class IonToggle {
1925 constructor(c, r, z) {
1926 this.z = z;
1927 c.detach();
1928 this.el = r.nativeElement;
1929 proxyOutputs(this, this.el, ["ionChange", "ionFocus", "ionBlur"]);
1930 }
1931};
1932IonToggle.ctorParameters = () => [
1933 { type: ChangeDetectorRef },
1934 { type: ElementRef },
1935 { type: NgZone }
1936];
1937IonToggle = __decorate([
1938 ProxyCmp({ inputs: ["checked", "color", "disabled", "mode", "name", "value"] }),
1939 Component({ selector: "ion-toggle", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["checked", "color", "disabled", "mode", "name", "value"] })
1940], IonToggle);
1941let IonToolbar = class IonToolbar {
1942 constructor(c, r, z) {
1943 this.z = z;
1944 c.detach();
1945 this.el = r.nativeElement;
1946 }
1947};
1948IonToolbar.ctorParameters = () => [
1949 { type: ChangeDetectorRef },
1950 { type: ElementRef },
1951 { type: NgZone }
1952];
1953IonToolbar = __decorate([
1954 ProxyCmp({ inputs: ["color", "mode"] }),
1955 Component({ selector: "ion-toolbar", changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>", inputs: ["color", "mode"] })
1956], IonToolbar);
1957
1958let Config = class Config {
1959 get(key, fallback) {
1960 const c = getConfig();
1961 if (c) {
1962 return c.get(key, fallback);
1963 }
1964 return null;
1965 }
1966 getBoolean(key, fallback) {
1967 const c = getConfig();
1968 if (c) {
1969 return c.getBoolean(key, fallback);
1970 }
1971 return false;
1972 }
1973 getNumber(key, fallback) {
1974 const c = getConfig();
1975 if (c) {
1976 return c.getNumber(key, fallback);
1977 }
1978 return 0;
1979 }
1980 set(key, value) {
1981 console.warn(`[DEPRECATION][Config]: The Config.set() method is deprecated and will be removed in Ionic Framework 6.0. Please see https://ionicframework.com/docs/angular/config for alternatives.`);
1982 const c = getConfig();
1983 if (c) {
1984 c.set(key, value);
1985 }
1986 }
1987};
1988Config.ngInjectableDef = ɵɵdefineInjectable({ factory: function Config_Factory() { return new Config(); }, token: Config, providedIn: "root" });
1989Config = __decorate([
1990 Injectable({
1991 providedIn: 'root'
1992 })
1993], Config);
1994const ConfigToken = new InjectionToken('USERCONFIG');
1995const getConfig = () => {
1996 if (typeof window !== 'undefined') {
1997 const Ionic = window.Ionic;
1998 if (Ionic && Ionic.config) {
1999 return Ionic.config;
2000 }
2001 }
2002 return null;
2003};
2004const ɵ0$3 = getConfig;
2005
2006/**
2007 * @description
2008 * NavParams are an object that exists on a page and can contain data for that particular view.
2009 * Similar to how data was pass to a view in V1 with `$stateParams`, NavParams offer a much more flexible
2010 * option with a simple `get` method.
2011 *
2012 * @usage
2013 * ```ts
2014 * import { NavParams } from '@ionic/angular';
2015 *
2016 * export class MyClass{
2017 *
2018 * constructor(navParams: NavParams){
2019 * // userParams is an object we have in our nav-parameters
2020 * navParams.get('userParams');
2021 * }
2022 *
2023 * }
2024 * ```
2025 */
2026class NavParams {
2027 constructor(data = {}) {
2028 this.data = data;
2029 }
2030 /**
2031 * Get the value of a nav-parameter for the current view
2032 *
2033 * ```ts
2034 * import { NavParams } from 'ionic-angular';
2035 *
2036 * export class MyClass{
2037 * constructor(public navParams: NavParams){
2038 * // userParams is an object we have in our nav-parameters
2039 * this.navParams.get('userParams');
2040 * }
2041 * }
2042 * ```
2043 *
2044 * @param param Which param you want to look up
2045 */
2046 get(param) {
2047 return this.data[param];
2048 }
2049}
2050
2051let AngularDelegate = class AngularDelegate {
2052 constructor(zone, appRef) {
2053 this.zone = zone;
2054 this.appRef = appRef;
2055 }
2056 create(resolver, injector, location) {
2057 return new AngularFrameworkDelegate(resolver, injector, location, this.appRef, this.zone);
2058 }
2059};
2060AngularDelegate.ctorParameters = () => [
2061 { type: NgZone },
2062 { type: ApplicationRef }
2063];
2064AngularDelegate = __decorate([
2065 Injectable()
2066], AngularDelegate);
2067class AngularFrameworkDelegate {
2068 constructor(resolver, injector, location, appRef, zone) {
2069 this.resolver = resolver;
2070 this.injector = injector;
2071 this.location = location;
2072 this.appRef = appRef;
2073 this.zone = zone;
2074 this.elRefMap = new WeakMap();
2075 this.elEventsMap = new WeakMap();
2076 }
2077 attachViewToDom(container, component, params, cssClasses) {
2078 return this.zone.run(() => {
2079 return new Promise(resolve => {
2080 const el = attachView(this.zone, this.resolver, this.injector, this.location, this.appRef, this.elRefMap, this.elEventsMap, container, component, params, cssClasses);
2081 resolve(el);
2082 });
2083 });
2084 }
2085 removeViewFromDom(_container, component) {
2086 return this.zone.run(() => {
2087 return new Promise(resolve => {
2088 const componentRef = this.elRefMap.get(component);
2089 if (componentRef) {
2090 componentRef.destroy();
2091 this.elRefMap.delete(component);
2092 const unbindEvents = this.elEventsMap.get(component);
2093 if (unbindEvents) {
2094 unbindEvents();
2095 this.elEventsMap.delete(component);
2096 }
2097 }
2098 resolve();
2099 });
2100 });
2101 }
2102}
2103const attachView = (zone, resolver, injector, location, appRef, elRefMap, elEventsMap, container, component, params, cssClasses) => {
2104 const factory = resolver.resolveComponentFactory(component);
2105 const childInjector = Injector.create({
2106 providers: getProviders(params),
2107 parent: injector
2108 });
2109 const componentRef = (location)
2110 ? location.createComponent(factory, location.length, childInjector)
2111 : factory.create(childInjector);
2112 const instance = componentRef.instance;
2113 const hostElement = componentRef.location.nativeElement;
2114 if (params) {
2115 Object.assign(instance, params);
2116 }
2117 if (cssClasses) {
2118 for (const clazz of cssClasses) {
2119 hostElement.classList.add(clazz);
2120 }
2121 }
2122 const unbindEvents = bindLifecycleEvents(zone, instance, hostElement);
2123 container.appendChild(hostElement);
2124 if (!location) {
2125 appRef.attachView(componentRef.hostView);
2126 }
2127 componentRef.changeDetectorRef.reattach();
2128 elRefMap.set(hostElement, componentRef);
2129 elEventsMap.set(hostElement, unbindEvents);
2130 return hostElement;
2131};
2132const LIFECYCLES = [
2133 LIFECYCLE_WILL_ENTER,
2134 LIFECYCLE_DID_ENTER,
2135 LIFECYCLE_WILL_LEAVE,
2136 LIFECYCLE_DID_LEAVE,
2137 LIFECYCLE_WILL_UNLOAD
2138];
2139const bindLifecycleEvents = (zone, instance, element) => {
2140 return zone.run(() => {
2141 const unregisters = LIFECYCLES
2142 .filter(eventName => typeof instance[eventName] === 'function')
2143 .map(eventName => {
2144 const handler = (ev) => instance[eventName](ev.detail);
2145 element.addEventListener(eventName, handler);
2146 return () => element.removeEventListener(eventName, handler);
2147 });
2148 return () => unregisters.forEach(fn => fn());
2149 });
2150};
2151const NavParamsToken = new InjectionToken('NavParamsToken');
2152const getProviders = (params) => {
2153 return [
2154 {
2155 provide: NavParamsToken, useValue: params
2156 },
2157 {
2158 provide: NavParams, useFactory: provideNavParamsInjectable, deps: [NavParamsToken]
2159 }
2160 ];
2161};
2162const ɵ0$4 = getProviders;
2163const provideNavParamsInjectable = (params) => {
2164 return new NavParams(params);
2165};
2166const ɵ1$2 = provideNavParamsInjectable;
2167
2168const insertView = (views, view, direction) => {
2169 if (direction === 'root') {
2170 return setRoot(views, view);
2171 }
2172 else if (direction === 'forward') {
2173 return setForward(views, view);
2174 }
2175 else {
2176 return setBack(views, view);
2177 }
2178};
2179const setRoot = (views, view) => {
2180 views = views.filter(v => v.stackId !== view.stackId);
2181 views.push(view);
2182 return views;
2183};
2184const ɵ0$5 = setRoot;
2185const setForward = (views, view) => {
2186 const index = views.indexOf(view);
2187 if (index >= 0) {
2188 views = views.filter(v => v.stackId !== view.stackId || v.id <= view.id);
2189 }
2190 else {
2191 views.push(view);
2192 }
2193 return views;
2194};
2195const ɵ1$3 = setForward;
2196const setBack = (views, view) => {
2197 const index = views.indexOf(view);
2198 if (index >= 0) {
2199 return views.filter(v => v.stackId !== view.stackId || v.id <= view.id);
2200 }
2201 else {
2202 return setRoot(views, view);
2203 }
2204};
2205const ɵ2$1 = setBack;
2206const getUrl = (router, activatedRoute) => {
2207 const urlTree = router.createUrlTree(['.'], { relativeTo: activatedRoute });
2208 return router.serializeUrl(urlTree);
2209};
2210const isTabSwitch = (enteringView, leavingView) => {
2211 if (!leavingView) {
2212 return true;
2213 }
2214 return enteringView.stackId !== leavingView.stackId;
2215};
2216const computeStackId = (prefixUrl, url) => {
2217 if (!prefixUrl) {
2218 return undefined;
2219 }
2220 const segments = toSegments(url);
2221 for (let i = 0; i < segments.length; i++) {
2222 if (i >= prefixUrl.length) {
2223 return segments[i];
2224 }
2225 if (segments[i] !== prefixUrl[i]) {
2226 return undefined;
2227 }
2228 }
2229 return undefined;
2230};
2231const toSegments = (path) => {
2232 return path
2233 .split('/')
2234 .map(s => s.trim())
2235 .filter(s => s !== '');
2236};
2237const destroyView = (view) => {
2238 if (view) {
2239 // TODO lifecycle event
2240 view.ref.destroy();
2241 view.unlistenEvents();
2242 }
2243};
2244
2245class StackController {
2246 constructor(tabsPrefix, containerEl, router, navCtrl, zone, location) {
2247 this.containerEl = containerEl;
2248 this.router = router;
2249 this.navCtrl = navCtrl;
2250 this.zone = zone;
2251 this.location = location;
2252 this.views = [];
2253 this.skipTransition = false;
2254 this.nextId = 0;
2255 this.tabsPrefix = tabsPrefix !== undefined ? toSegments(tabsPrefix) : undefined;
2256 }
2257 createView(ref, activatedRoute) {
2258 const url = getUrl(this.router, activatedRoute);
2259 const element = (ref && ref.location && ref.location.nativeElement);
2260 const unlistenEvents = bindLifecycleEvents(this.zone, ref.instance, element);
2261 return {
2262 id: this.nextId++,
2263 stackId: computeStackId(this.tabsPrefix, url),
2264 unlistenEvents,
2265 element,
2266 ref,
2267 url,
2268 };
2269 }
2270 getExistingView(activatedRoute) {
2271 const activatedUrlKey = getUrl(this.router, activatedRoute);
2272 const view = this.views.find(vw => vw.url === activatedUrlKey);
2273 if (view) {
2274 view.ref.changeDetectorRef.reattach();
2275 }
2276 return view;
2277 }
2278 setActive(enteringView) {
2279 const consumeResult = this.navCtrl.consumeTransition();
2280 let { direction, animation, animationBuilder } = consumeResult;
2281 const leavingView = this.activeView;
2282 const tabSwitch = isTabSwitch(enteringView, leavingView);
2283 if (tabSwitch) {
2284 direction = 'back';
2285 animation = undefined;
2286 }
2287 const viewsSnapshot = this.views.slice();
2288 let currentNavigation;
2289 const router = this.router;
2290 // Angular >= 7.2.0
2291 if (router.getCurrentNavigation) {
2292 currentNavigation = router.getCurrentNavigation();
2293 // Angular < 7.2.0
2294 }
2295 else if (router.navigations &&
2296 router.navigations.value) {
2297 currentNavigation = router.navigations.value;
2298 }
2299 /**
2300 * If the navigation action
2301 * sets `replaceUrl: true`
2302 * then we need to make sure
2303 * we remove the last item
2304 * from our views stack
2305 */
2306 if (currentNavigation &&
2307 currentNavigation.extras &&
2308 currentNavigation.extras.replaceUrl) {
2309 if (this.views.length > 0) {
2310 this.views.splice(-1, 1);
2311 }
2312 }
2313 const reused = this.views.includes(enteringView);
2314 const views = this.insertView(enteringView, direction);
2315 // Trigger change detection before transition starts
2316 // This will call ngOnInit() the first time too, just after the view
2317 // was attached to the dom, but BEFORE the transition starts
2318 if (!reused) {
2319 enteringView.ref.changeDetectorRef.detectChanges();
2320 }
2321 /**
2322 * If we are going back from a page that
2323 * was presented using a custom animation
2324 * we should default to using that
2325 * unless the developer explicitly
2326 * provided another animation.
2327 */
2328 const customAnimation = enteringView.animationBuilder;
2329 if (animationBuilder === undefined &&
2330 direction === 'back' &&
2331 !tabSwitch &&
2332 customAnimation !== undefined) {
2333 animationBuilder = customAnimation;
2334 }
2335 /**
2336 * Save any custom animation so that navigating
2337 * back will use this custom animation by default.
2338 */
2339 if (leavingView) {
2340 leavingView.animationBuilder = animationBuilder;
2341 }
2342 // Wait until previous transitions finish
2343 return this.zone.runOutsideAngular(() => {
2344 return this.wait(() => {
2345 // disconnect leaving page from change detection to
2346 // reduce jank during the page transition
2347 if (leavingView) {
2348 leavingView.ref.changeDetectorRef.detach();
2349 }
2350 // In case the enteringView is the same as the leavingPage we need to reattach()
2351 enteringView.ref.changeDetectorRef.reattach();
2352 return this.transition(enteringView, leavingView, animation, this.canGoBack(1), false, animationBuilder)
2353 .then(() => cleanupAsync(enteringView, views, viewsSnapshot, this.location))
2354 .then(() => ({
2355 enteringView,
2356 direction,
2357 animation,
2358 tabSwitch
2359 }));
2360 });
2361 });
2362 }
2363 canGoBack(deep, stackId = this.getActiveStackId()) {
2364 return this.getStack(stackId).length > deep;
2365 }
2366 pop(deep, stackId = this.getActiveStackId()) {
2367 return this.zone.run(() => {
2368 const views = this.getStack(stackId);
2369 if (views.length <= deep) {
2370 return Promise.resolve(false);
2371 }
2372 const view = views[views.length - deep - 1];
2373 let url = view.url;
2374 const viewSavedData = view.savedData;
2375 if (viewSavedData) {
2376 const primaryOutlet = viewSavedData.get('primary');
2377 if (primaryOutlet &&
2378 primaryOutlet.route &&
2379 primaryOutlet.route._routerState &&
2380 primaryOutlet.route._routerState.snapshot &&
2381 primaryOutlet.route._routerState.snapshot.url) {
2382 url = primaryOutlet.route._routerState.snapshot.url;
2383 }
2384 }
2385 const { animationBuilder } = this.navCtrl.consumeTransition();
2386 return this.navCtrl.navigateBack(url, Object.assign({}, view.savedExtras, { animation: animationBuilder })).then(() => true);
2387 });
2388 }
2389 startBackTransition() {
2390 const leavingView = this.activeView;
2391 if (leavingView) {
2392 const views = this.getStack(leavingView.stackId);
2393 const enteringView = views[views.length - 2];
2394 const customAnimation = enteringView.animationBuilder;
2395 return this.wait(() => {
2396 return this.transition(enteringView, // entering view
2397 leavingView, // leaving view
2398 'back', this.canGoBack(2), true, customAnimation);
2399 });
2400 }
2401 return Promise.resolve();
2402 }
2403 endBackTransition(shouldComplete) {
2404 if (shouldComplete) {
2405 this.skipTransition = true;
2406 this.pop(1);
2407 }
2408 else if (this.activeView) {
2409 cleanup(this.activeView, this.views, this.views, this.location);
2410 }
2411 }
2412 getLastUrl(stackId) {
2413 const views = this.getStack(stackId);
2414 return views.length > 0 ? views[views.length - 1] : undefined;
2415 }
2416 /**
2417 * @internal
2418 */
2419 getRootUrl(stackId) {
2420 const views = this.getStack(stackId);
2421 return views.length > 0 ? views[0] : undefined;
2422 }
2423 getActiveStackId() {
2424 return this.activeView ? this.activeView.stackId : undefined;
2425 }
2426 destroy() {
2427 this.containerEl = undefined;
2428 this.views.forEach(destroyView);
2429 this.activeView = undefined;
2430 this.views = [];
2431 }
2432 getStack(stackId) {
2433 return this.views.filter(v => v.stackId === stackId);
2434 }
2435 insertView(enteringView, direction) {
2436 this.activeView = enteringView;
2437 this.views = insertView(this.views, enteringView, direction);
2438 return this.views.slice();
2439 }
2440 transition(enteringView, leavingView, direction, showGoBack, progressAnimation, animationBuilder) {
2441 if (this.skipTransition) {
2442 this.skipTransition = false;
2443 return Promise.resolve(false);
2444 }
2445 if (leavingView === enteringView) {
2446 return Promise.resolve(false);
2447 }
2448 const enteringEl = enteringView ? enteringView.element : undefined;
2449 const leavingEl = leavingView ? leavingView.element : undefined;
2450 const containerEl = this.containerEl;
2451 if (enteringEl && enteringEl !== leavingEl) {
2452 enteringEl.classList.add('ion-page');
2453 enteringEl.classList.add('ion-page-invisible');
2454 if (enteringEl.parentElement !== containerEl) {
2455 containerEl.appendChild(enteringEl);
2456 }
2457 if (containerEl.commit) {
2458 return containerEl.commit(enteringEl, leavingEl, {
2459 deepWait: true,
2460 duration: direction === undefined ? 0 : undefined,
2461 direction,
2462 showGoBack,
2463 progressAnimation,
2464 animationBuilder
2465 });
2466 }
2467 }
2468 return Promise.resolve(false);
2469 }
2470 wait(task) {
2471 return __awaiter(this, void 0, void 0, function* () {
2472 if (this.runningTask !== undefined) {
2473 yield this.runningTask;
2474 this.runningTask = undefined;
2475 }
2476 const promise = this.runningTask = task();
2477 return promise;
2478 });
2479 }
2480}
2481const cleanupAsync = (activeRoute, views, viewsSnapshot, location) => {
2482 if (typeof requestAnimationFrame === 'function') {
2483 return new Promise(resolve => {
2484 requestAnimationFrame(() => {
2485 cleanup(activeRoute, views, viewsSnapshot, location);
2486 resolve();
2487 });
2488 });
2489 }
2490 return Promise.resolve();
2491};
2492const ɵ0$6 = cleanupAsync;
2493const cleanup = (activeRoute, views, viewsSnapshot, location) => {
2494 viewsSnapshot
2495 .filter(view => !views.includes(view))
2496 .forEach(destroyView);
2497 views.forEach(view => {
2498 /**
2499 * In the event that a user navigated multiple
2500 * times in rapid succession, we want to make sure
2501 * we don't pre-emptively detach a view while
2502 * it is in mid-transition.
2503 *
2504 * In this instance we also do not care about query
2505 * params or fragments as it will be the same view regardless
2506 */
2507 const locationWithoutParams = location.path().split('?')[0];
2508 const locationWithoutFragment = locationWithoutParams.split('#')[0];
2509 if (view !== activeRoute && view.url !== locationWithoutFragment) {
2510 const element = view.element;
2511 element.setAttribute('aria-hidden', 'true');
2512 element.classList.add('ion-page-hidden');
2513 view.ref.changeDetectorRef.detach();
2514 }
2515 });
2516};
2517const ɵ1$4 = cleanup;
2518
2519let IonRouterOutlet = class IonRouterOutlet {
2520 constructor(parentContexts, location, resolver, name, tabs, config, navCtrl, commonLocation, elementRef, router, zone, activatedRoute, parentOutlet) {
2521 this.parentContexts = parentContexts;
2522 this.location = location;
2523 this.resolver = resolver;
2524 this.config = config;
2525 this.navCtrl = navCtrl;
2526 this.parentOutlet = parentOutlet;
2527 this.activated = null;
2528 this.activatedView = null;
2529 this._activatedRoute = null;
2530 // Maintain map of activated route proxies for each component instance
2531 this.proxyMap = new WeakMap();
2532 // Keep the latest activated route in a subject for the proxy routes to switch map to
2533 this.currentActivatedRoute$ = new BehaviorSubject(null);
2534 this.stackEvents = new EventEmitter();
2535 this.activateEvents = new EventEmitter();
2536 this.deactivateEvents = new EventEmitter();
2537 this.nativeEl = elementRef.nativeElement;
2538 this.name = name || PRIMARY_OUTLET;
2539 this.tabsPrefix = tabs === 'true' ? getUrl(router, activatedRoute) : undefined;
2540 this.stackCtrl = new StackController(this.tabsPrefix, this.nativeEl, router, navCtrl, zone, commonLocation);
2541 parentContexts.onChildOutletCreated(this.name, this);
2542 }
2543 set animation(animation) {
2544 this.nativeEl.animation = animation;
2545 }
2546 set animated(animated) {
2547 this.nativeEl.animated = animated;
2548 }
2549 set swipeGesture(swipe) {
2550 this._swipeGesture = swipe;
2551 this.nativeEl.swipeHandler = swipe ? {
2552 canStart: () => this.stackCtrl.canGoBack(1),
2553 onStart: () => this.stackCtrl.startBackTransition(),
2554 onEnd: shouldContinue => this.stackCtrl.endBackTransition(shouldContinue)
2555 } : undefined;
2556 }
2557 ngOnDestroy() {
2558 this.stackCtrl.destroy();
2559 }
2560 getContext() {
2561 return this.parentContexts.getContext(this.name);
2562 }
2563 ngOnInit() {
2564 if (!this.activated) {
2565 // If the outlet was not instantiated at the time the route got activated we need to populate
2566 // the outlet when it is initialized (ie inside a NgIf)
2567 const context = this.getContext();
2568 if (context && context.route) {
2569 this.activateWith(context.route, context.resolver || null);
2570 }
2571 }
2572 if (this.nativeEl.componentOnReady) {
2573 this.nativeEl.componentOnReady().then(() => {
2574 if (this._swipeGesture === undefined) {
2575 this.swipeGesture = this.config.getBoolean('swipeBackEnabled', this.nativeEl.mode === 'ios');
2576 }
2577 });
2578 }
2579 }
2580 get isActivated() {
2581 return !!this.activated;
2582 }
2583 get component() {
2584 if (!this.activated) {
2585 throw new Error('Outlet is not activated');
2586 }
2587 return this.activated.instance;
2588 }
2589 get activatedRoute() {
2590 if (!this.activated) {
2591 throw new Error('Outlet is not activated');
2592 }
2593 return this._activatedRoute;
2594 }
2595 get activatedRouteData() {
2596 if (this._activatedRoute) {
2597 return this._activatedRoute.snapshot.data;
2598 }
2599 return {};
2600 }
2601 /**
2602 * Called when the `RouteReuseStrategy` instructs to detach the subtree
2603 */
2604 detach() {
2605 throw new Error('incompatible reuse strategy');
2606 }
2607 /**
2608 * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree
2609 */
2610 attach(_ref, _activatedRoute) {
2611 throw new Error('incompatible reuse strategy');
2612 }
2613 deactivate() {
2614 if (this.activated) {
2615 if (this.activatedView) {
2616 this.activatedView.savedData = new Map(this.getContext().children['contexts']);
2617 /**
2618 * Ensure we are saving the NavigationExtras
2619 * data otherwise it will be lost
2620 */
2621 this.activatedView.savedExtras = {};
2622 const context = this.getContext();
2623 if (context.route) {
2624 const contextSnapshot = context.route.snapshot;
2625 this.activatedView.savedExtras.queryParams = contextSnapshot.queryParams;
2626 this.activatedView.savedExtras.fragment = contextSnapshot.fragment;
2627 }
2628 }
2629 const c = this.component;
2630 this.activatedView = null;
2631 this.activated = null;
2632 this._activatedRoute = null;
2633 this.deactivateEvents.emit(c);
2634 }
2635 }
2636 activateWith(activatedRoute, resolver) {
2637 if (this.isActivated) {
2638 throw new Error('Cannot activate an already activated outlet');
2639 }
2640 this._activatedRoute = activatedRoute;
2641 let cmpRef;
2642 let enteringView = this.stackCtrl.getExistingView(activatedRoute);
2643 if (enteringView) {
2644 cmpRef = this.activated = enteringView.ref;
2645 const saved = enteringView.savedData;
2646 if (saved) {
2647 // self-restore
2648 const context = this.getContext();
2649 context.children['contexts'] = saved;
2650 }
2651 // Updated activated route proxy for this component
2652 this.updateActivatedRouteProxy(cmpRef.instance, activatedRoute);
2653 }
2654 else {
2655 const snapshot = activatedRoute._futureSnapshot;
2656 const component = snapshot.routeConfig.component;
2657 resolver = resolver || this.resolver;
2658 const factory = resolver.resolveComponentFactory(component);
2659 const childContexts = this.parentContexts.getOrCreateContext(this.name).children;
2660 // We create an activated route proxy object that will maintain future updates for this component
2661 // over its lifecycle in the stack.
2662 const component$ = new BehaviorSubject(null);
2663 const activatedRouteProxy = this.createActivatedRouteProxy(component$, activatedRoute);
2664 const injector = new OutletInjector(activatedRouteProxy, childContexts, this.location.injector);
2665 cmpRef = this.activated = this.location.createComponent(factory, this.location.length, injector);
2666 // Once the component is created we can push it to our local subject supplied to the proxy
2667 component$.next(cmpRef.instance);
2668 // Calling `markForCheck` to make sure we will run the change detection when the
2669 // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.
2670 enteringView = this.stackCtrl.createView(this.activated, activatedRoute);
2671 // Store references to the proxy by component
2672 this.proxyMap.set(cmpRef.instance, activatedRouteProxy);
2673 this.currentActivatedRoute$.next({ component: cmpRef.instance, activatedRoute });
2674 }
2675 this.activatedView = enteringView;
2676 this.stackCtrl.setActive(enteringView).then(data => {
2677 this.navCtrl.setTopOutlet(this);
2678 this.activateEvents.emit(cmpRef.instance);
2679 this.stackEvents.emit(data);
2680 });
2681 }
2682 /**
2683 * Returns `true` if there are pages in the stack to go back.
2684 */
2685 canGoBack(deep = 1, stackId) {
2686 return this.stackCtrl.canGoBack(deep, stackId);
2687 }
2688 /**
2689 * Resolves to `true` if it the outlet was able to sucessfully pop the last N pages.
2690 */
2691 pop(deep = 1, stackId) {
2692 return this.stackCtrl.pop(deep, stackId);
2693 }
2694 /**
2695 * Returns the URL of the active page of each stack.
2696 */
2697 getLastUrl(stackId) {
2698 const active = this.stackCtrl.getLastUrl(stackId);
2699 return active ? active.url : undefined;
2700 }
2701 /**
2702 * Returns the RouteView of the active page of each stack.
2703 * @internal
2704 */
2705 getLastRouteView(stackId) {
2706 return this.stackCtrl.getLastUrl(stackId);
2707 }
2708 /**
2709 * Returns the root view in the tab stack.
2710 * @internal
2711 */
2712 getRootView(stackId) {
2713 return this.stackCtrl.getRootUrl(stackId);
2714 }
2715 /**
2716 * Returns the active stack ID. In the context of ion-tabs, it means the active tab.
2717 */
2718 getActiveStackId() {
2719 return this.stackCtrl.getActiveStackId();
2720 }
2721 /**
2722 * Since the activated route can change over the life time of a component in an ion router outlet, we create
2723 * a proxy so that we can update the values over time as a user navigates back to components already in the stack.
2724 */
2725 createActivatedRouteProxy(component$, activatedRoute) {
2726 const proxy = new ActivatedRoute();
2727 proxy._futureSnapshot = activatedRoute._futureSnapshot;
2728 proxy._routerState = activatedRoute._routerState;
2729 proxy.snapshot = activatedRoute.snapshot;
2730 proxy.outlet = activatedRoute.outlet;
2731 proxy.component = activatedRoute.component;
2732 // Setup wrappers for the observables so consumers don't have to worry about switching to new observables as the state updates
2733 proxy._paramMap = this.proxyObservable(component$, 'paramMap');
2734 proxy._queryParamMap = this.proxyObservable(component$, 'queryParamMap');
2735 proxy.url = this.proxyObservable(component$, 'url');
2736 proxy.params = this.proxyObservable(component$, 'params');
2737 proxy.queryParams = this.proxyObservable(component$, 'queryParams');
2738 proxy.fragment = this.proxyObservable(component$, 'fragment');
2739 proxy.data = this.proxyObservable(component$, 'data');
2740 return proxy;
2741 }
2742 /**
2743 * Create a wrapped observable that will switch to the latest activated route matched by the given component
2744 */
2745 proxyObservable(component$, path) {
2746 return component$.pipe(
2747 // First wait until the component instance is pushed
2748 filter(component => !!component), switchMap(component => this.currentActivatedRoute$.pipe(filter(current => current !== null && current.component === component), switchMap(current => current && current.activatedRoute[path]), distinctUntilChanged())));
2749 }
2750 /**
2751 * Updates the activated route proxy for the given component to the new incoming router state
2752 */
2753 updateActivatedRouteProxy(component, activatedRoute) {
2754 const proxy = this.proxyMap.get(component);
2755 if (!proxy) {
2756 throw new Error(`Could not find activated route proxy for view`);
2757 }
2758 proxy._futureSnapshot = activatedRoute._futureSnapshot;
2759 proxy._routerState = activatedRoute._routerState;
2760 proxy.snapshot = activatedRoute.snapshot;
2761 proxy.outlet = activatedRoute.outlet;
2762 proxy.component = activatedRoute.component;
2763 this.currentActivatedRoute$.next({ component, activatedRoute });
2764 }
2765};
2766IonRouterOutlet.ctorParameters = () => [
2767 { type: ChildrenOutletContexts },
2768 { type: ViewContainerRef },
2769 { type: ComponentFactoryResolver },
2770 { type: String, decorators: [{ type: Attribute, args: ['name',] }] },
2771 { type: String, decorators: [{ type: Optional }, { type: Attribute, args: ['tabs',] }] },
2772 { type: Config },
2773 { type: NavController },
2774 { type: Location },
2775 { type: ElementRef },
2776 { type: Router },
2777 { type: NgZone },
2778 { type: ActivatedRoute },
2779 { type: IonRouterOutlet, decorators: [{ type: SkipSelf }, { type: Optional }] }
2780];
2781__decorate([
2782 Output()
2783], IonRouterOutlet.prototype, "stackEvents", void 0);
2784__decorate([
2785 Output('activate')
2786], IonRouterOutlet.prototype, "activateEvents", void 0);
2787__decorate([
2788 Output('deactivate')
2789], IonRouterOutlet.prototype, "deactivateEvents", void 0);
2790IonRouterOutlet = __decorate([
2791 Directive({
2792 selector: 'ion-router-outlet',
2793 exportAs: 'outlet',
2794 inputs: ['animated', 'animation', 'swipeGesture']
2795 }),
2796 __param(3, Attribute('name')),
2797 __param(4, Optional()), __param(4, Attribute('tabs')),
2798 __param(12, SkipSelf()), __param(12, Optional())
2799], IonRouterOutlet);
2800class OutletInjector {
2801 constructor(route, childContexts, parent) {
2802 this.route = route;
2803 this.childContexts = childContexts;
2804 this.parent = parent;
2805 }
2806 get(token, notFoundValue) {
2807 if (token === ActivatedRoute) {
2808 return this.route;
2809 }
2810 if (token === ChildrenOutletContexts) {
2811 return this.childContexts;
2812 }
2813 // tslint:disable-next-line
2814 return this.parent.get(token, notFoundValue);
2815 }
2816}
2817
2818let IonTabs = class IonTabs {
2819 constructor(navCtrl) {
2820 this.navCtrl = navCtrl;
2821 this.ionTabsWillChange = new EventEmitter();
2822 this.ionTabsDidChange = new EventEmitter();
2823 }
2824 /**
2825 * @internal
2826 */
2827 onPageSelected(detail) {
2828 const stackId = detail.enteringView.stackId;
2829 if (detail.tabSwitch && stackId !== undefined) {
2830 if (this.tabBar) {
2831 this.tabBar.selectedTab = stackId;
2832 }
2833 this.ionTabsWillChange.emit({ tab: stackId });
2834 this.ionTabsDidChange.emit({ tab: stackId });
2835 }
2836 }
2837 /**
2838 * When a tab button is clicked, there are several scenarios:
2839 * 1. If the selected tab is currently active (the tab button has been clicked
2840 * again), then it should go to the root view for that tab.
2841 *
2842 * a. Get the saved root view from the router outlet. If the saved root view
2843 * matches the tabRootUrl, set the route view to this view including the
2844 * navigation extras.
2845 * b. If the saved root view from the router outlet does
2846 * not match, navigate to the tabRootUrl. No navigation extras are
2847 * included.
2848 *
2849 * 2. If the current tab tab is not currently selected, get the last route
2850 * view from the router outlet.
2851 *
2852 * a. If the last route view exists, navigate to that view including any
2853 * navigation extras
2854 * b. If the last route view doesn't exist, then navigate
2855 * to the default tabRootUrl
2856 */
2857 select(tab) {
2858 const alreadySelected = this.outlet.getActiveStackId() === tab;
2859 const tabRootUrl = `${this.outlet.tabsPrefix}/${tab}`;
2860 if (alreadySelected) {
2861 const activeStackId = this.outlet.getActiveStackId();
2862 const activeView = this.outlet.getLastRouteView(activeStackId);
2863 // If on root tab, do not navigate to root tab again
2864 if (activeView.url === tabRootUrl) {
2865 return;
2866 }
2867 const rootView = this.outlet.getRootView(tab);
2868 const navigationExtras = rootView && tabRootUrl === rootView.url && rootView.savedExtras;
2869 return this.navCtrl.navigateRoot(tabRootUrl, Object.assign({}, (navigationExtras), { animated: true, animationDirection: 'back' }));
2870 }
2871 else {
2872 const lastRoute = this.outlet.getLastRouteView(tab);
2873 /**
2874 * If there is a lastRoute, goto that, otherwise goto the fallback url of the
2875 * selected tab
2876 */
2877 const url = lastRoute && lastRoute.url || tabRootUrl;
2878 const navigationExtras = lastRoute && lastRoute.savedExtras;
2879 return this.navCtrl.navigateRoot(url, Object.assign({}, (navigationExtras), { animated: true, animationDirection: 'back' }));
2880 }
2881 }
2882 getSelected() {
2883 return this.outlet.getActiveStackId();
2884 }
2885};
2886IonTabs.ctorParameters = () => [
2887 { type: NavController }
2888];
2889__decorate([
2890 ViewChild('outlet', { read: IonRouterOutlet, static: false })
2891], IonTabs.prototype, "outlet", void 0);
2892__decorate([
2893 ContentChild(IonTabBar, { static: false })
2894], IonTabs.prototype, "tabBar", void 0);
2895__decorate([
2896 Output()
2897], IonTabs.prototype, "ionTabsWillChange", void 0);
2898__decorate([
2899 Output()
2900], IonTabs.prototype, "ionTabsDidChange", void 0);
2901__decorate([
2902 HostListener('ionTabButtonClick', ['$event.detail.tab'])
2903], IonTabs.prototype, "select", null);
2904IonTabs = __decorate([
2905 Component({
2906 selector: 'ion-tabs',
2907 template: `
2908 <ng-content select="[slot=top]"></ng-content>
2909 <div class="tabs-inner">
2910 <ion-router-outlet #outlet tabs="true" (stackEvents)="onPageSelected($event)"></ion-router-outlet>
2911 </div>
2912 <ng-content></ng-content>`,
2913 styles: [`
2914 :host {
2915 display: flex;
2916 position: absolute;
2917 top: 0;
2918 left: 0;
2919 right: 0;
2920 bottom: 0;
2921
2922 flex-direction: column;
2923
2924 width: 100%;
2925 height: 100%;
2926
2927 contain: layout size style;
2928 z-index: $z-index-page-container;
2929 }
2930 .tabs-inner {
2931 position: relative;
2932
2933 flex: 1;
2934
2935 contain: layout size style;
2936 }`]
2937 })
2938], IonTabs);
2939
2940let IonBackButtonDelegate = class IonBackButtonDelegate {
2941 constructor(routerOutlet, navCtrl, config) {
2942 this.routerOutlet = routerOutlet;
2943 this.navCtrl = navCtrl;
2944 this.config = config;
2945 }
2946 /**
2947 * @internal
2948 */
2949 onClick(ev) {
2950 const defaultHref = this.defaultHref || this.config.get('backButtonDefaultHref');
2951 if (this.routerOutlet && this.routerOutlet.canGoBack()) {
2952 this.navCtrl.setDirection('back', undefined, undefined, this.routerAnimation);
2953 this.routerOutlet.pop();
2954 ev.preventDefault();
2955 }
2956 else if (defaultHref != null) {
2957 this.navCtrl.navigateBack(defaultHref, { animation: this.routerAnimation });
2958 ev.preventDefault();
2959 }
2960 }
2961};
2962IonBackButtonDelegate.ctorParameters = () => [
2963 { type: IonRouterOutlet, decorators: [{ type: Optional }] },
2964 { type: NavController },
2965 { type: Config }
2966];
2967__decorate([
2968 HostListener('click', ['$event'])
2969], IonBackButtonDelegate.prototype, "onClick", null);
2970IonBackButtonDelegate = __decorate([
2971 Directive({
2972 selector: 'ion-back-button',
2973 inputs: ['defaultHref', 'routerAnimation'],
2974 }),
2975 __param(0, Optional())
2976], IonBackButtonDelegate);
2977
2978let NavDelegate = class NavDelegate {
2979 constructor(ref, resolver, injector, angularDelegate, location) {
2980 this.el = ref.nativeElement;
2981 ref.nativeElement.delegate = angularDelegate.create(resolver, injector, location);
2982 proxyOutputs(this, this.el, ['ionNavDidChange', 'ionNavWillChange']);
2983 }
2984};
2985NavDelegate.ctorParameters = () => [
2986 { type: ElementRef },
2987 { type: ComponentFactoryResolver },
2988 { type: Injector },
2989 { type: AngularDelegate },
2990 { type: ViewContainerRef }
2991];
2992NavDelegate = __decorate([
2993 ProxyCmp({
2994 inputs: ['animated', 'animation', 'root', 'rootParams', 'swipeGesture'],
2995 methods: ['push', 'insert', 'insertPages', 'pop', 'popTo', 'popToRoot', 'removeIndex', 'setRoot', 'setPages', 'getActive', 'getByIndex', 'canGoBack', 'getPrevious']
2996 }),
2997 Directive({
2998 selector: 'ion-nav'
2999 })
3000], NavDelegate);
3001
3002let RouterLinkDelegate = class RouterLinkDelegate {
3003 constructor(locationStrategy, navCtrl, elementRef, router, routerLink) {
3004 this.locationStrategy = locationStrategy;
3005 this.navCtrl = navCtrl;
3006 this.elementRef = elementRef;
3007 this.router = router;
3008 this.routerLink = routerLink;
3009 this.routerDirection = 'forward';
3010 }
3011 ngOnInit() {
3012 this.updateTargetUrlAndHref();
3013 }
3014 ngOnChanges() {
3015 this.updateTargetUrlAndHref();
3016 }
3017 ngOnDestroy() {
3018 if (this.subscription) {
3019 this.subscription.unsubscribe();
3020 }
3021 }
3022 updateTargetUrlAndHref() {
3023 if (this.routerLink) {
3024 const href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));
3025 this.elementRef.nativeElement.href = href;
3026 }
3027 }
3028 /**
3029 * @internal
3030 */
3031 onClick(ev) {
3032 this.navCtrl.setDirection(this.routerDirection, undefined, undefined, this.routerAnimation);
3033 ev.preventDefault();
3034 }
3035};
3036RouterLinkDelegate.ctorParameters = () => [
3037 { type: LocationStrategy },
3038 { type: NavController },
3039 { type: ElementRef },
3040 { type: Router },
3041 { type: RouterLink, decorators: [{ type: Optional }] }
3042];
3043__decorate([
3044 HostListener('click', ['$event'])
3045], RouterLinkDelegate.prototype, "onClick", null);
3046RouterLinkDelegate = __decorate([
3047 Directive({
3048 selector: '[routerLink]',
3049 inputs: ['routerDirection', 'routerAnimation']
3050 }),
3051 __param(4, Optional())
3052], RouterLinkDelegate);
3053
3054/**
3055 * @hidden
3056 */
3057let VirtualFooter = class VirtualFooter {
3058 constructor(templateRef) {
3059 this.templateRef = templateRef;
3060 }
3061};
3062VirtualFooter.ctorParameters = () => [
3063 { type: TemplateRef }
3064];
3065VirtualFooter = __decorate([
3066 Directive({ selector: '[virtualFooter]' })
3067], VirtualFooter);
3068
3069/**
3070 * @hidden
3071 */
3072let VirtualHeader = class VirtualHeader {
3073 constructor(templateRef) {
3074 this.templateRef = templateRef;
3075 }
3076};
3077VirtualHeader.ctorParameters = () => [
3078 { type: TemplateRef }
3079];
3080VirtualHeader = __decorate([
3081 Directive({ selector: '[virtualHeader]' })
3082], VirtualHeader);
3083
3084/**
3085 * @hidden
3086 */
3087let VirtualItem = class VirtualItem {
3088 constructor(templateRef, viewContainer) {
3089 this.templateRef = templateRef;
3090 this.viewContainer = viewContainer;
3091 }
3092};
3093VirtualItem.ctorParameters = () => [
3094 { type: TemplateRef },
3095 { type: ViewContainerRef }
3096];
3097VirtualItem = __decorate([
3098 Directive({ selector: '[virtualItem]' })
3099], VirtualItem);
3100
3101let IonVirtualScroll = class IonVirtualScroll {
3102 constructor(z, iterableDiffers, elementRef) {
3103 this.z = z;
3104 this.iterableDiffers = iterableDiffers;
3105 this.refMap = new WeakMap();
3106 this.el = elementRef.nativeElement;
3107 this.el.nodeRender = this.nodeRender.bind(this);
3108 }
3109 ngOnChanges(changes) {
3110 if (this.trackBy && 'items' in changes) {
3111 // React on virtualScroll changes only once all inputs have been initialized
3112 const value = changes['items'].currentValue;
3113 if (this.differ === undefined && value != null) {
3114 try {
3115 this.differ = this.iterableDiffers.find(value).create(this.trackBy);
3116 }
3117 catch (e) {
3118 throw new Error(`Cannot find a differ supporting object '${value}'. VirtualScroll only supports binding to Iterables such as Arrays.`);
3119 }
3120 }
3121 }
3122 }
3123 ngDoCheck() {
3124 // and if there actually are changes
3125 const changes = this.differ !== undefined && this.items ? this.differ.diff(this.items) : null;
3126 if (changes === null) {
3127 return;
3128 }
3129 // TODO: optimize
3130 this.checkRange(0);
3131 }
3132 nodeRender(el, cell, index) {
3133 return this.z.run(() => {
3134 let node;
3135 if (!el) {
3136 node = this.itmTmp.viewContainer.createEmbeddedView(this.getComponent(cell.type), { $implicit: cell.value, index }, index);
3137 el = getElement(node);
3138 this.refMap.set(el, node);
3139 }
3140 else {
3141 node = this.refMap.get(el);
3142 const ctx = node.context;
3143 ctx.$implicit = cell.value;
3144 ctx.index = cell.index;
3145 }
3146 // run sync change detections
3147 node.detectChanges();
3148 return el;
3149 });
3150 }
3151 getComponent(type) {
3152 switch (type) {
3153 case 'item': return this.itmTmp.templateRef;
3154 case 'header': return this.hdrTmp.templateRef;
3155 case 'footer': return this.ftrTmp.templateRef;
3156 }
3157 throw new Error('template for virtual item was not provided');
3158 }
3159};
3160IonVirtualScroll.ctorParameters = () => [
3161 { type: NgZone },
3162 { type: IterableDiffers },
3163 { type: ElementRef }
3164];
3165__decorate([
3166 ContentChild(VirtualItem, { static: false })
3167], IonVirtualScroll.prototype, "itmTmp", void 0);
3168__decorate([
3169 ContentChild(VirtualHeader, { static: false })
3170], IonVirtualScroll.prototype, "hdrTmp", void 0);
3171__decorate([
3172 ContentChild(VirtualFooter, { static: false })
3173], IonVirtualScroll.prototype, "ftrTmp", void 0);
3174IonVirtualScroll = __decorate([
3175 ProxyCmp({
3176 inputs: ['approxItemHeight', 'approxHeaderHeight', 'approxFooterHeight', 'headerFn', 'footerFn', 'items', 'itemHeight', 'headerHeight', 'footerHeight'],
3177 methods: ['checkEnd', 'checkRange', 'positionForItem']
3178 }),
3179 Component({
3180 selector: 'ion-virtual-scroll',
3181 template: '<ng-content></ng-content>',
3182 changeDetection: ChangeDetectionStrategy.OnPush,
3183 inputs: [
3184 'approxItemHeight',
3185 'approxHeaderHeight',
3186 'approxFooterHeight',
3187 'headerFn',
3188 'footerFn',
3189 'items',
3190 'itemHeight',
3191 'headerHeight',
3192 'footerHeight',
3193 'trackBy'
3194 ]
3195 })
3196], IonVirtualScroll);
3197const getElement = (view) => {
3198 const rootNodes = view.rootNodes;
3199 for (let i = 0; i < rootNodes.length; i++) {
3200 if (rootNodes[i].nodeType === 1) {
3201 return rootNodes[i];
3202 }
3203 }
3204 throw new Error('virtual element was not created');
3205};
3206const ɵ0$7 = getElement;
3207
3208class OverlayBaseController {
3209 constructor(ctrl) {
3210 this.ctrl = ctrl;
3211 }
3212 /**
3213 * Creates a new overlay
3214 */
3215 create(opts) {
3216 // TODO: next major release opts is not optional
3217 return this.ctrl.create((opts || {}));
3218 }
3219 /**
3220 * When `id` is not provided, it dismisses the top overlay.
3221 */
3222 dismiss(data, role, id) {
3223 return this.ctrl.dismiss(data, role, id);
3224 }
3225 /**
3226 * Returns the top overlay.
3227 */
3228 getTop() {
3229 return this.ctrl.getTop();
3230 }
3231}
3232
3233let ActionSheetController = class ActionSheetController extends OverlayBaseController {
3234 constructor() {
3235 super(actionSheetController);
3236 }
3237};
3238ActionSheetController.ngInjectableDef = ɵɵdefineInjectable({ factory: function ActionSheetController_Factory() { return new ActionSheetController(); }, token: ActionSheetController, providedIn: "root" });
3239ActionSheetController = __decorate([
3240 Injectable({
3241 providedIn: 'root',
3242 })
3243], ActionSheetController);
3244
3245let AlertController = class AlertController extends OverlayBaseController {
3246 constructor() {
3247 super(alertController);
3248 }
3249};
3250AlertController.ngInjectableDef = ɵɵdefineInjectable({ factory: function AlertController_Factory() { return new AlertController(); }, token: AlertController, providedIn: "root" });
3251AlertController = __decorate([
3252 Injectable({
3253 providedIn: 'root',
3254 })
3255], AlertController);
3256
3257let LoadingController = class LoadingController extends OverlayBaseController {
3258 constructor() {
3259 super(loadingController);
3260 }
3261};
3262LoadingController.ngInjectableDef = ɵɵdefineInjectable({ factory: function LoadingController_Factory() { return new LoadingController(); }, token: LoadingController, providedIn: "root" });
3263LoadingController = __decorate([
3264 Injectable({
3265 providedIn: 'root',
3266 })
3267], LoadingController);
3268
3269let MenuController = class MenuController {
3270 /**
3271 * Programmatically open the Menu.
3272 * @param [menuId] Optionally get the menu by its id, or side.
3273 * @return returns a promise when the menu is fully opened
3274 */
3275 open(menuId) {
3276 return menuController.open(menuId);
3277 }
3278 /**
3279 * Programmatically close the Menu. If no `menuId` is given as the first
3280 * argument then it'll close any menu which is open. If a `menuId`
3281 * is given then it'll close that exact menu.
3282 * @param [menuId] Optionally get the menu by its id, or side.
3283 * @return returns a promise when the menu is fully closed
3284 */
3285 close(menuId) {
3286 return menuController.close(menuId);
3287 }
3288 /**
3289 * Toggle the menu. If it's closed, it will open, and if opened, it
3290 * will close.
3291 * @param [menuId] Optionally get the menu by its id, or side.
3292 * @return returns a promise when the menu has been toggled
3293 */
3294 toggle(menuId) {
3295 return menuController.toggle(menuId);
3296 }
3297 /**
3298 * Used to enable or disable a menu. For example, there could be multiple
3299 * left menus, but only one of them should be able to be opened at the same
3300 * time. If there are multiple menus on the same side, then enabling one menu
3301 * will also automatically disable all the others that are on the same side.
3302 * @param [menuId] Optionally get the menu by its id, or side.
3303 * @return Returns the instance of the menu, which is useful for chaining.
3304 */
3305 enable(shouldEnable, menuId) {
3306 return menuController.enable(shouldEnable, menuId);
3307 }
3308 /**
3309 * Used to enable or disable the ability to swipe open the menu.
3310 * @param shouldEnable True if it should be swipe-able, false if not.
3311 * @param [menuId] Optionally get the menu by its id, or side.
3312 * @return Returns the instance of the menu, which is useful for chaining.
3313 */
3314 swipeGesture(shouldEnable, menuId) {
3315 return menuController.swipeGesture(shouldEnable, menuId);
3316 }
3317 /**
3318 * @param [menuId] Optionally get the menu by its id, or side.
3319 * @return Returns true if the specified menu is currently open, otherwise false.
3320 * If the menuId is not specified, it returns true if ANY menu is currenly open.
3321 */
3322 isOpen(menuId) {
3323 return menuController.isOpen(menuId);
3324 }
3325 /**
3326 * @param [menuId] Optionally get the menu by its id, or side.
3327 * @return Returns true if the menu is currently enabled, otherwise false.
3328 */
3329 isEnabled(menuId) {
3330 return menuController.isEnabled(menuId);
3331 }
3332 /**
3333 * Used to get a menu instance. If a `menuId` is not provided then it'll
3334 * return the first menu found. If a `menuId` is `left` or `right`, then
3335 * it'll return the enabled menu on that side. Otherwise, if a `menuId` is
3336 * provided, then it'll try to find the menu using the menu's `id`
3337 * property. If a menu is not found then it'll return `null`.
3338 * @param [menuId] Optionally get the menu by its id, or side.
3339 * @return Returns the instance of the menu if found, otherwise `null`.
3340 */
3341 get(menuId) {
3342 return menuController.get(menuId);
3343 }
3344 /**
3345 * @return Returns the instance of the menu already opened, otherwise `null`.
3346 */
3347 getOpen() {
3348 return menuController.getOpen();
3349 }
3350 /**
3351 * @return Returns an array of all menu instances.
3352 */
3353 getMenus() {
3354 return menuController.getMenus();
3355 }
3356};
3357MenuController.ngInjectableDef = ɵɵdefineInjectable({ factory: function MenuController_Factory() { return new MenuController(); }, token: MenuController, providedIn: "root" });
3358MenuController = __decorate([
3359 Injectable({
3360 providedIn: 'root',
3361 })
3362], MenuController);
3363
3364let PickerController = class PickerController extends OverlayBaseController {
3365 constructor() {
3366 super(pickerController);
3367 }
3368};
3369PickerController.ngInjectableDef = ɵɵdefineInjectable({ factory: function PickerController_Factory() { return new PickerController(); }, token: PickerController, providedIn: "root" });
3370PickerController = __decorate([
3371 Injectable({
3372 providedIn: 'root',
3373 })
3374], PickerController);
3375
3376let ModalController = class ModalController extends OverlayBaseController {
3377 constructor(angularDelegate, resolver, injector) {
3378 super(modalController);
3379 this.angularDelegate = angularDelegate;
3380 this.resolver = resolver;
3381 this.injector = injector;
3382 }
3383 create(opts) {
3384 return super.create(Object.assign({}, opts, { delegate: this.angularDelegate.create(this.resolver, this.injector) }));
3385 }
3386};
3387ModalController.ctorParameters = () => [
3388 { type: AngularDelegate },
3389 { type: ComponentFactoryResolver },
3390 { type: Injector }
3391];
3392ModalController = __decorate([
3393 Injectable()
3394], ModalController);
3395
3396let PopoverController = class PopoverController extends OverlayBaseController {
3397 constructor(angularDelegate, resolver, injector) {
3398 super(popoverController);
3399 this.angularDelegate = angularDelegate;
3400 this.resolver = resolver;
3401 this.injector = injector;
3402 }
3403 create(opts) {
3404 return super.create(Object.assign({}, opts, { delegate: this.angularDelegate.create(this.resolver, this.injector) }));
3405 }
3406};
3407PopoverController.ctorParameters = () => [
3408 { type: AngularDelegate },
3409 { type: ComponentFactoryResolver },
3410 { type: Injector }
3411];
3412PopoverController = __decorate([
3413 Injectable()
3414], PopoverController);
3415
3416let ToastController = class ToastController extends OverlayBaseController {
3417 constructor() {
3418 super(toastController);
3419 }
3420};
3421ToastController.ngInjectableDef = ɵɵdefineInjectable({ factory: function ToastController_Factory() { return new ToastController(); }, token: ToastController, providedIn: "root" });
3422ToastController = __decorate([
3423 Injectable({
3424 providedIn: 'root',
3425 })
3426], ToastController);
3427
3428let DomController = class DomController {
3429 /**
3430 * Schedules a task to run during the READ phase of the next frame.
3431 * This task should only read the DOM, but never modify it.
3432 */
3433 read(cb) {
3434 getQueue().read(cb);
3435 }
3436 /**
3437 * Schedules a task to run during the WRITE phase of the next frame.
3438 * This task should write the DOM, but never READ it.
3439 */
3440 write(cb) {
3441 getQueue().write(cb);
3442 }
3443};
3444DomController.ngInjectableDef = ɵɵdefineInjectable({ factory: function DomController_Factory() { return new DomController(); }, token: DomController, providedIn: "root" });
3445DomController = __decorate([
3446 Injectable({
3447 providedIn: 'root',
3448 })
3449], DomController);
3450const getQueue = () => {
3451 const win = typeof window !== 'undefined' ? window : null;
3452 if (win != null) {
3453 const Ionic = win.Ionic;
3454 if (Ionic && Ionic.queue) {
3455 return Ionic.queue;
3456 }
3457 return {
3458 read: (cb) => win.requestAnimationFrame(cb),
3459 write: (cb) => win.requestAnimationFrame(cb)
3460 };
3461 }
3462 return {
3463 read: (cb) => cb(),
3464 write: (cb) => cb()
3465 };
3466};
3467const ɵ0$8 = getQueue;
3468
3469let AnimationController = class AnimationController {
3470 /**
3471 * Create a new animation
3472 */
3473 create(animationId) {
3474 return createAnimation(animationId);
3475 }
3476 /**
3477 * EXPERIMENTAL
3478 *
3479 * Given a progression and a cubic bezier function,
3480 * this utility returns the time value(s) at which the
3481 * cubic bezier reaches the given time progression.
3482 *
3483 * If the cubic bezier never reaches the progression
3484 * the result will be an empty array.
3485 *
3486 * This is most useful for switching between easing curves
3487 * when doing a gesture animation (i.e. going from linear easing
3488 * during a drag, to another easing when `progressEnd` is called)
3489 */
3490 easingTime(p0, p1, p2, p3, progression) {
3491 return getTimeGivenProgression(p0, p1, p2, p3, progression);
3492 }
3493};
3494AnimationController.ngInjectableDef = ɵɵdefineInjectable({ factory: function AnimationController_Factory() { return new AnimationController(); }, token: AnimationController, providedIn: "root" });
3495AnimationController = __decorate([
3496 Injectable({
3497 providedIn: 'root',
3498 })
3499], AnimationController);
3500
3501let GestureController = class GestureController {
3502 constructor(zone) {
3503 this.zone = zone;
3504 }
3505 /**
3506 * Create a new gesture
3507 */
3508 create(opts, runInsideAngularZone = false) {
3509 if (runInsideAngularZone) {
3510 Object.getOwnPropertyNames(opts).forEach(key => {
3511 if (typeof opts[key] === 'function') {
3512 const fn = opts[key];
3513 opts[key] = (...props) => this.zone.run(() => fn(...props));
3514 }
3515 });
3516 }
3517 return createGesture(opts);
3518 }
3519};
3520GestureController.ctorParameters = () => [
3521 { type: NgZone }
3522];
3523GestureController.ngInjectableDef = ɵɵdefineInjectable({ factory: function GestureController_Factory() { return new GestureController(ɵɵinject(NgZone)); }, token: GestureController, providedIn: "root" });
3524GestureController = __decorate([
3525 Injectable({
3526 providedIn: 'root',
3527 })
3528], GestureController);
3529
3530class IonicRouteStrategy {
3531 shouldDetach(_route) {
3532 return false;
3533 }
3534 shouldAttach(_route) {
3535 return false;
3536 }
3537 store(_route, _detachedTree) {
3538 return;
3539 }
3540 retrieve(_route) {
3541 return null;
3542 }
3543 shouldReuseRoute(future, curr) {
3544 if (future.routeConfig !== curr.routeConfig) {
3545 return false;
3546 }
3547 // checking router params
3548 const futureParams = future.params;
3549 const currentParams = curr.params;
3550 const keysA = Object.keys(futureParams);
3551 const keysB = Object.keys(currentParams);
3552 if (keysA.length !== keysB.length) {
3553 return false;
3554 }
3555 // Test for A's keys different from B.
3556 for (const key of keysA) {
3557 if (currentParams[key] !== futureParams[key]) {
3558 return false;
3559 }
3560 }
3561 return true;
3562 }
3563}
3564
3565let didInitialize = false;
3566const appInitialize = (config, doc, zone) => {
3567 return () => {
3568 const win = doc.defaultView;
3569 if (win && typeof window !== 'undefined') {
3570 if (didInitialize) {
3571 console.warn('Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once.');
3572 }
3573 didInitialize = true;
3574 const Ionic = win.Ionic = win.Ionic || {};
3575 Ionic.config = Object.assign({}, config, { _zoneGate: (h) => zone.run(h) });
3576 const aelFn = '__zone_symbol__addEventListener' in doc.body
3577 ? '__zone_symbol__addEventListener'
3578 : 'addEventListener';
3579 return applyPolyfills().then(() => {
3580 return defineCustomElements(win, {
3581 exclude: ['ion-tabs', 'ion-tab'],
3582 syncQueue: true,
3583 raf,
3584 jmp: (h) => zone.runOutsideAngular(h),
3585 ael(elm, eventName, cb, opts) {
3586 elm[aelFn](eventName, cb, opts);
3587 },
3588 rel(elm, eventName, cb, opts) {
3589 elm.removeEventListener(eventName, cb, opts);
3590 }
3591 });
3592 });
3593 }
3594 };
3595};
3596
3597var IonicModule_1;
3598const DECLARATIONS = [
3599 // proxies
3600 IonApp,
3601 IonAvatar,
3602 IonBackButton,
3603 IonBackdrop,
3604 IonBadge,
3605 IonButton,
3606 IonButtons,
3607 IonCard,
3608 IonCardContent,
3609 IonCardHeader,
3610 IonCardSubtitle,
3611 IonCardTitle,
3612 IonCheckbox,
3613 IonChip,
3614 IonCol,
3615 IonContent,
3616 IonDatetime,
3617 IonFab,
3618 IonFabButton,
3619 IonFabList,
3620 IonFooter,
3621 IonGrid,
3622 IonHeader,
3623 IonIcon,
3624 IonImg,
3625 IonInfiniteScroll,
3626 IonInfiniteScrollContent,
3627 IonInput,
3628 IonItem,
3629 IonItemDivider,
3630 IonItemGroup,
3631 IonItemOption,
3632 IonItemOptions,
3633 IonItemSliding,
3634 IonLabel,
3635 IonList,
3636 IonListHeader,
3637 IonMenu,
3638 IonMenuButton,
3639 IonMenuToggle,
3640 IonNav,
3641 IonNavLink,
3642 IonNote,
3643 IonProgressBar,
3644 IonRadio,
3645 IonRadioGroup,
3646 IonRange,
3647 IonRefresher,
3648 IonRefresherContent,
3649 IonReorder,
3650 IonReorderGroup,
3651 IonRippleEffect,
3652 IonRow,
3653 IonSearchbar,
3654 IonSegment,
3655 IonSegmentButton,
3656 IonSelect,
3657 IonSelectOption,
3658 IonSkeletonText,
3659 IonSlide,
3660 IonSlides,
3661 IonSpinner,
3662 IonSplitPane,
3663 IonTabBar,
3664 IonTabButton,
3665 IonText,
3666 IonTextarea,
3667 IonThumbnail,
3668 IonToggle,
3669 IonToolbar,
3670 IonTitle,
3671 IonTabs,
3672 // ngModel accessors
3673 BooleanValueAccessor,
3674 NumericValueAccessor,
3675 RadioValueAccessor,
3676 SelectValueAccessor,
3677 TextValueAccessor,
3678 // navigation
3679 IonRouterOutlet,
3680 IonBackButtonDelegate,
3681 NavDelegate,
3682 RouterLinkDelegate,
3683 // virtual scroll
3684 VirtualFooter,
3685 VirtualHeader,
3686 VirtualItem,
3687 IonVirtualScroll
3688];
3689let IonicModule = IonicModule_1 = class IonicModule {
3690 static forRoot(config) {
3691 return {
3692 ngModule: IonicModule_1,
3693 providers: [
3694 {
3695 provide: ConfigToken,
3696 useValue: config
3697 },
3698 {
3699 provide: APP_INITIALIZER,
3700 useFactory: appInitialize,
3701 multi: true,
3702 deps: [
3703 ConfigToken,
3704 DOCUMENT,
3705 NgZone
3706 ]
3707 }
3708 ]
3709 };
3710 }
3711};
3712IonicModule = IonicModule_1 = __decorate([
3713 NgModule({
3714 declarations: DECLARATIONS,
3715 exports: DECLARATIONS,
3716 providers: [AngularDelegate, ModalController, PopoverController],
3717 imports: [CommonModule]
3718 })
3719], IonicModule);
3720
3721// DIRECTIVES
3722
3723/**
3724 * Generated bundle index. Do not edit.
3725 */
3726
3727export { ActionSheetController, AlertController, AngularDelegate, AnimationController, BooleanValueAccessor, Config, DomController, GestureController, IonApp, IonAvatar, IonBackButton, IonBackButtonDelegate, IonBackdrop, IonBadge, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonCheckbox, IonChip, IonCol, IonContent, IonDatetime, IonFab, IonFabButton, IonFabList, IonFooter, IonGrid, IonHeader, IonIcon, IonImg, IonInfiniteScroll, IonInfiniteScrollContent, IonInput, IonItem, IonItemDivider, IonItemGroup, IonItemOption, IonItemOptions, IonItemSliding, IonLabel, IonList, IonListHeader, IonMenu, IonMenuButton, IonMenuToggle, IonNav, IonNavLink, IonNote, IonProgressBar, IonRadio, IonRadioGroup, IonRange, IonRefresher, IonRefresherContent, IonReorder, IonReorderGroup, IonRippleEffect, IonRouterOutlet, IonRow, IonSearchbar, IonSegment, IonSegmentButton, IonSelect, IonSelectOption, IonSkeletonText, IonSlide, IonSlides, IonSpinner, IonSplitPane, IonTabBar, IonTabButton, IonTabs, IonText, IonTextarea, IonThumbnail, IonTitle, IonToggle, IonToolbar, IonVirtualScroll, IonicModule, IonicRouteStrategy, LoadingController, MenuController, ModalController, NavController, NavDelegate, NavParams, NumericValueAccessor, PickerController, Platform, PopoverController, RadioValueAccessor, RouterLinkDelegate, SelectValueAccessor, TextValueAccessor, ToastController, VirtualFooter, VirtualHeader, VirtualItem, ConfigToken as ɵa, ValueAccessor as ɵb, ProxyCmp as ɵc, OverlayBaseController as ɵe, appInitialize as ɵf };
3728//# sourceMappingURL=ionic-angular.js.map