http://example.com#/foo,
- * and `PathLocationStrategy` produces
- * http://example.com/foo as an equivalent URL.
- *
- * See these two classes for more.
- *
- * @publicApi
- */
-var LocationStrategy = /** @class */ (function () {
- function LocationStrategy() {
- }
- return LocationStrategy;
-}());
-/**
- * A predefined [DI token](guide/glossary#di-token) for the base href
- * to be used with the `PathLocationStrategy`.
- * The base href is the URL prefix that should be preserved when generating
- * and recognizing URLs.
- *
- * @usageNotes
- *
- * The following example shows how to use this token to configure the root app injector
- * with a base href value, so that the DI framework can supply the dependency anywhere in the app.
- *
- * ```typescript
- * import {Component, NgModule} from '@angular/core';
- * import {APP_BASE_HREF} from '@angular/common';
- *
- * @NgModule({
- * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]
- * })
- * class AppModule {}
- * ```
- *
- * @publicApi
- */
-var APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('appBaseHref');
-
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-/**
- * @description
- *
- * A service that applications can use to interact with a browser's URL.
- *
- * Depending on the `LocationStrategy` used, `Location` persists
- * to the URL's path or the URL's hash segment.
- *
- * @usageNotes
- *
- * It's better to use the `Router#navigate` service to trigger route changes. Use
- * `Location` only if you need to interact with or create normalized URLs outside of
- * routing.
- *
- * `Location` is responsible for normalizing the URL against the application's base href.
- * A normalized URL is absolute from the URL host, includes the application's base href, and has no
- * trailing slash:
- * - `/my/app/user/123` is normalized
- * - `my/app/user/123` **is not** normalized
- * - `/my/app/user/123/` **is not** normalized
- *
- * ### Example
- *
- * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
- * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.
- * - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.
- * - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.
- *
- * For more information on the acceptable range for each of these numbers and other
- * details see your native internationalization library.
- *
- * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
- * and may require a polyfill. See [Browser Support](guide/browser-support) for details.
- *
- * @usageNotes
- *
- * ### Example
- *
- * {@example common/pipes/ts/number_pipe.ts region='DeprecatedNumberPipe'}
- *
- * @ngModule CommonModule
- * @publicApi
- */
-var DeprecatedDecimalPipe = /** @class */ (function () {
- function DeprecatedDecimalPipe(_locale) {
- this._locale = _locale;
- }
- DeprecatedDecimalPipe_1 = DeprecatedDecimalPipe;
- DeprecatedDecimalPipe.prototype.transform = function (value, digits) {
- return formatNumber$1(DeprecatedDecimalPipe_1, this._locale, value, NumberFormatStyle.Decimal, digits);
- };
- var DeprecatedDecimalPipe_1;
- DeprecatedDecimalPipe = DeprecatedDecimalPipe_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__decorate"])([
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"])({ name: 'number' }),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__param"])(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__metadata"])("design:paramtypes", [String])
- ], DeprecatedDecimalPipe);
- return DeprecatedDecimalPipe;
-}());
-/**
- * @ngModule CommonModule
- *
- * @description
- *
- * Formats a number as percentage according to locale rules.
- *
- * - `digitInfo` See {@link DecimalPipe} for detailed description.
- *
- * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
- * and may require a polyfill. See [Browser Support](guide/browser-support) for details.
- *
- * @usageNotes
- *
- * ### Example
- *
- * {@example common/pipes/ts/percent_pipe.ts region='DeprecatedPercentPipe'}
- *
- * @publicApi
- */
-var DeprecatedPercentPipe = /** @class */ (function () {
- function DeprecatedPercentPipe(_locale) {
- this._locale = _locale;
- }
- DeprecatedPercentPipe_1 = DeprecatedPercentPipe;
- DeprecatedPercentPipe.prototype.transform = function (value, digits) {
- return formatNumber$1(DeprecatedPercentPipe_1, this._locale, value, NumberFormatStyle.Percent, digits);
- };
- var DeprecatedPercentPipe_1;
- DeprecatedPercentPipe = DeprecatedPercentPipe_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__decorate"])([
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"])({ name: 'percent' }),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__param"])(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__metadata"])("design:paramtypes", [String])
- ], DeprecatedPercentPipe);
- return DeprecatedPercentPipe;
-}());
-/**
- * @ngModule CommonModule
- * @description
- *
- * Formats a number as currency using locale rules.
- *
- * Use `currency` to format a number as currency.
- *
- * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
- * as `USD` for the US dollar and `EUR` for the euro.
- * - `symbolDisplay` is a boolean indicating whether to use the currency symbol or code.
- * - `true`: use symbol (e.g. `$`).
- * - `false`(default): use code (e.g. `USD`).
- * - `digitInfo` See {@link DecimalPipe} for detailed description.
- *
- * WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
- * and may require a polyfill. See [Browser Support](guide/browser-support) for details.
- *
- * @usageNotes
- *
- * ### Example
- *
- * {@example common/pipes/ts/currency_pipe.ts region='DeprecatedCurrencyPipe'}
- *
- * @publicApi
- */
-var DeprecatedCurrencyPipe = /** @class */ (function () {
- function DeprecatedCurrencyPipe(_locale) {
- this._locale = _locale;
- }
- DeprecatedCurrencyPipe_1 = DeprecatedCurrencyPipe;
- DeprecatedCurrencyPipe.prototype.transform = function (value, currencyCode, symbolDisplay, digits) {
- if (currencyCode === void 0) { currencyCode = 'USD'; }
- if (symbolDisplay === void 0) { symbolDisplay = false; }
- return formatNumber$1(DeprecatedCurrencyPipe_1, this._locale, value, NumberFormatStyle.Currency, digits, currencyCode, symbolDisplay);
- };
- var DeprecatedCurrencyPipe_1;
- DeprecatedCurrencyPipe = DeprecatedCurrencyPipe_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__decorate"])([
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"])({ name: 'currency' }),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__param"])(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__metadata"])("design:paramtypes", [String])
- ], DeprecatedCurrencyPipe);
- return DeprecatedCurrencyPipe;
-}());
-
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-/**
- * A collection of deprecated i18n pipes that require intl api
- *
- * @deprecated from v5
- */
-var COMMON_DEPRECATED_I18N_PIPES = [DeprecatedDecimalPipe, DeprecatedPercentPipe, DeprecatedCurrencyPipe, DeprecatedDatePipe];
-
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-var ObservableStrategy = /** @class */ (function () {
- function ObservableStrategy() {
- }
- ObservableStrategy.prototype.createSubscription = function (async, updateLatestValue) {
- return async.subscribe({ next: updateLatestValue, error: function (e) { throw e; } });
- };
- ObservableStrategy.prototype.dispose = function (subscription) { subscription.unsubscribe(); };
- ObservableStrategy.prototype.onDestroy = function (subscription) { subscription.unsubscribe(); };
- return ObservableStrategy;
-}());
-var PromiseStrategy = /** @class */ (function () {
- function PromiseStrategy() {
- }
- PromiseStrategy.prototype.createSubscription = function (async, updateLatestValue) {
- return async.then(updateLatestValue, function (e) { throw e; });
- };
- PromiseStrategy.prototype.dispose = function (subscription) { };
- PromiseStrategy.prototype.onDestroy = function (subscription) { };
- return PromiseStrategy;
-}());
-var _promiseStrategy = new PromiseStrategy();
-var _observableStrategy = new ObservableStrategy();
-/**
- * @ngModule CommonModule
- * @description
- *
- * Unwraps a value from an asynchronous primitive.
- *
- * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
- * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
- * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
- * potential memory leaks.
- *
- * @usageNotes
- *
- * ### Examples
- *
- * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
- * promise.
- *
- * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
- *
- * It's also possible to use `async` with Observables. The example below binds the `time` Observable
- * to the view. The Observable continuously updates the view with the current time.
- *
- * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
- *
- * @publicApi
- */
-var AsyncPipe = /** @class */ (function () {
- function AsyncPipe(_ref) {
- this._ref = _ref;
- this._latestValue = null;
- this._latestReturnedValue = null;
- this._subscription = null;
- this._obj = null;
- this._strategy = null;
- }
- AsyncPipe_1 = AsyncPipe;
- AsyncPipe.prototype.ngOnDestroy = function () {
- if (this._subscription) {
- this._dispose();
- }
- };
- AsyncPipe.prototype.transform = function (obj) {
- if (!this._obj) {
- if (obj) {
- this._subscribe(obj);
- }
- this._latestReturnedValue = this._latestValue;
- return this._latestValue;
- }
- if (obj !== this._obj) {
- this._dispose();
- return this.transform(obj);
- }
- if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵlooseIdentical"])(this._latestValue, this._latestReturnedValue)) {
- return this._latestReturnedValue;
- }
- this._latestReturnedValue = this._latestValue;
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["WrappedValue"].wrap(this._latestValue);
- };
- AsyncPipe.prototype._subscribe = function (obj) {
- var _this = this;
- this._obj = obj;
- this._strategy = this._selectStrategy(obj);
- this._subscription = this._strategy.createSubscription(obj, function (value) { return _this._updateLatestValue(obj, value); });
- };
- AsyncPipe.prototype._selectStrategy = function (obj) {
- if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisPromise"])(obj)) {
- return _promiseStrategy;
- }
- if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisObservable"])(obj)) {
- return _observableStrategy;
- }
- throw invalidPipeArgumentError(AsyncPipe_1, obj);
- };
- AsyncPipe.prototype._dispose = function () {
- this._strategy.dispose(this._subscription);
- this._latestValue = null;
- this._latestReturnedValue = null;
- this._subscription = null;
- this._obj = null;
- };
- AsyncPipe.prototype._updateLatestValue = function (async, value) {
- if (async === this._obj) {
- this._latestValue = value;
- this._ref.markForCheck();
- }
- };
- var AsyncPipe_1;
- AsyncPipe = AsyncPipe_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__decorate"])([
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])(),
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"])({ name: 'async', pure: false }),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__metadata"])("design:paramtypes", [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"]])
- ], AsyncPipe);
- return AsyncPipe;
-}());
-
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-/**
- * Transforms text to all lower case.
- *
- * @see `UpperCasePipe`
- * @see `TitleCasePipe`
- * @usageNotes
- *
- * The following example defines a view that allows the user to enter
- * text, and then uses the pipe to convert the input text to all lower case.
- *
- * Today is {{today | date}}
- *Or if you prefer, {{today | date:'fullDate'}}
- *The time is {{today | date:'h:mm a z'}}
- *{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}.
- * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
- * Default is `1`.
- * - `minFractionDigits`: The minimum number of digits after the decimal point.
- * Default is `0`.
- * - `maxFractionDigits`: The maximum number of digits after the decimal point.
- * Default is `3`.
- * @param locale A locale code for the locale format rules to use.
- * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
- * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
- */
- DecimalPipe.prototype.transform = function (value, digitsInfo, locale) {
- if (isEmpty(value))
- return null;
- locale = locale || this._locale;
- try {
- var num = strToNumber(value);
- return formatNumber(num, locale, digitsInfo);
- }
- catch (error) {
- throw invalidPipeArgumentError(DecimalPipe_1, error.message);
- }
- };
- var DecimalPipe_1;
- DecimalPipe = DecimalPipe_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__decorate"])([
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])(),
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"])({ name: 'number' }),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__param"])(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__metadata"])("design:paramtypes", [String])
- ], DecimalPipe);
- return DecimalPipe;
-}());
-/**
- * @ngModule CommonModule
- * @description
- *
- * Transforms a number to a percentage
- * string, formatted according to locale rules that determine group sizing and
- * separator, decimal-point character, and other locale-specific
- * configurations.
- *
- * @see `formatPercent()`
- *
- * @usageNotes
- * The following code shows how the pipe transforms numbers
- * into text strings, according to various format specifications,
- * where the caller's default locale is `en-US`.
- *
- * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}.
- * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
- * Default is `1`.
- * - `minFractionDigits`: The minimum number of digits after the decimal point.
- * Default is `0`.
- * - `maxFractionDigits`: The maximum number of digits after the decimal point.
- * Default is `0`.
- * @param locale A locale code for the locale format rules to use.
- * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
- * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
- */
- PercentPipe.prototype.transform = function (value, digitsInfo, locale) {
- if (isEmpty(value))
- return null;
- locale = locale || this._locale;
- try {
- var num = strToNumber(value);
- return formatPercent(num, locale, digitsInfo);
- }
- catch (error) {
- throw invalidPipeArgumentError(PercentPipe_1, error.message);
- }
- };
- var PercentPipe_1;
- PercentPipe = PercentPipe_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__decorate"])([
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])(),
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"])({ name: 'percent' }),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__param"])(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__metadata"])("design:paramtypes", [String])
- ], PercentPipe);
- return PercentPipe;
-}());
-/**
- * @ngModule CommonModule
- * @description
- *
- * Transforms a number to a currency string, formatted according to locale rules
- * that determine group sizing and separator, decimal-point character,
- * and other locale-specific configurations.
- *
- * @see `getCurrencySymbol()`
- * @see `formatCurrency()`
- *
- * @usageNotes
- * The following code shows how the pipe transforms numbers
- * into text strings, according to various format specifications,
- * where the caller's default locale is `en-US`.
- *
- * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}.
- * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
- * Default is `1`.
- * - `minFractionDigits`: The minimum number of digits after the decimal point.
- * Default is `2`.
- * - `maxFractionDigits`: The maximum number of digits after the decimal point.
- * Default is `2`.
- * If not provided, the number will be formatted with the proper amount of digits,
- * depending on what the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) specifies.
- * For example, the Canadian dollar has 2 digits, whereas the Chilean peso has none.
- * @param locale A locale code for the locale format rules to use.
- * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
- * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
- */
- CurrencyPipe.prototype.transform = function (value, currencyCode, display, digitsInfo, locale) {
- if (display === void 0) { display = 'symbol'; }
- if (isEmpty(value))
- return null;
- locale = locale || this._locale;
- if (typeof display === 'boolean') {
- if (console && console.warn) {
- console.warn("Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are \"code\", \"symbol\" or \"symbol-narrow\".");
- }
- display = display ? 'symbol' : 'code';
- }
- var currency = currencyCode || 'USD';
- if (display !== 'code') {
- if (display === 'symbol' || display === 'symbol-narrow') {
- currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale);
- }
- else {
- currency = display;
- }
- }
- try {
- var num = strToNumber(value);
- return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
- }
- catch (error) {
- throw invalidPipeArgumentError(CurrencyPipe_1, error.message);
- }
- };
- var CurrencyPipe_1;
- CurrencyPipe = CurrencyPipe_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__decorate"])([
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])(),
- Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"])({ name: 'currency' }),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__param"])(0, Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"])(_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])),
- Object(tslib__WEBPACK_IMPORTED_MODULE_1__["__metadata"])("design:paramtypes", [String])
- ], CurrencyPipe);
- return CurrencyPipe;
-}());
-function isEmpty(value) {
- return value == null || value === '' || value !== value;
-}
-/**
- * Transforms a string into a number (if needed).
- */
-function strToNumber(value) {
- // Convert strings to numbers
- if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {
- return Number(value);
- }
- if (typeof value !== 'number') {
- throw new Error(value + " is not a number");
- }
- return value;
-}
-
-/**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
-/**
- * @ngModule CommonModule
- * @description
- *
- * Creates a new `Array` or `String` containing a subset (slice) of the elements.
- *
- * @usageNotes
- *
- * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
- * and `String.prototype.slice()`.
- *
- * When operating on an `Array`, the returned `Array` is always a copy even when all
- * the elements are being returned.
- *
- * When operating on a blank value, the pipe returns the blank value.
- *
- * ### List Example
- *
- * This `ngFor` example:
- *
- * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}
- *
- * produces the following:
- *
- * ```html
- *