{"version":3,"sources":["node_modules/@messageformat/core/messageformat.js","node_modules/@angular/core/fesm2022/primitives/signals.mjs","node_modules/rxjs/dist/esm/internal/util/isFunction.js","node_modules/rxjs/dist/esm/internal/util/createErrorClass.js","node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js","node_modules/rxjs/dist/esm/internal/util/arrRemove.js","node_modules/rxjs/dist/esm/internal/Subscription.js","node_modules/rxjs/dist/esm/internal/config.js","node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js","node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js","node_modules/rxjs/dist/esm/internal/util/noop.js","node_modules/rxjs/dist/esm/internal/NotificationFactories.js","node_modules/rxjs/dist/esm/internal/util/errorContext.js","node_modules/rxjs/dist/esm/internal/Subscriber.js","node_modules/rxjs/dist/esm/internal/symbol/observable.js","node_modules/rxjs/dist/esm/internal/util/identity.js","node_modules/rxjs/dist/esm/internal/util/pipe.js","node_modules/rxjs/dist/esm/internal/Observable.js","node_modules/rxjs/dist/esm/internal/util/lift.js","node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js","node_modules/rxjs/dist/esm/internal/operators/refCount.js","node_modules/rxjs/dist/esm/internal/observable/ConnectableObservable.js","node_modules/rxjs/dist/esm/internal/scheduler/animationFrameProvider.js","node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js","node_modules/rxjs/dist/esm/internal/Subject.js","node_modules/rxjs/dist/esm/internal/BehaviorSubject.js","node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js","node_modules/rxjs/dist/esm/internal/ReplaySubject.js","node_modules/rxjs/dist/esm/internal/scheduler/Action.js","node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js","node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js","node_modules/rxjs/dist/esm/internal/util/Immediate.js","node_modules/rxjs/dist/esm/internal/scheduler/immediateProvider.js","node_modules/rxjs/dist/esm/internal/scheduler/AsapAction.js","node_modules/rxjs/dist/esm/internal/Scheduler.js","node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js","node_modules/rxjs/dist/esm/internal/scheduler/AsapScheduler.js","node_modules/rxjs/dist/esm/internal/scheduler/asap.js","node_modules/rxjs/dist/esm/internal/scheduler/async.js","node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameAction.js","node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameScheduler.js","node_modules/rxjs/dist/esm/internal/scheduler/animationFrame.js","node_modules/rxjs/dist/esm/internal/observable/empty.js","node_modules/rxjs/dist/esm/internal/util/isScheduler.js","node_modules/rxjs/dist/esm/internal/util/args.js","node_modules/tslib/tslib.es6.mjs","node_modules/rxjs/dist/esm/internal/util/isArrayLike.js","node_modules/rxjs/dist/esm/internal/util/isPromise.js","node_modules/rxjs/dist/esm/internal/util/isInteropObservable.js","node_modules/rxjs/dist/esm/internal/util/isAsyncIterable.js","node_modules/rxjs/dist/esm/internal/util/throwUnobservableError.js","node_modules/rxjs/dist/esm/internal/symbol/iterator.js","node_modules/rxjs/dist/esm/internal/util/isIterable.js","node_modules/rxjs/dist/esm/internal/util/isReadableStreamLike.js","node_modules/rxjs/dist/esm/internal/observable/innerFrom.js","node_modules/rxjs/dist/esm/internal/util/executeSchedule.js","node_modules/rxjs/dist/esm/internal/operators/observeOn.js","node_modules/rxjs/dist/esm/internal/operators/subscribeOn.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleObservable.js","node_modules/rxjs/dist/esm/internal/scheduled/schedulePromise.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleArray.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleIterable.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleAsyncIterable.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduleReadableStreamLike.js","node_modules/rxjs/dist/esm/internal/scheduled/scheduled.js","node_modules/rxjs/dist/esm/internal/observable/from.js","node_modules/rxjs/dist/esm/internal/observable/of.js","node_modules/rxjs/dist/esm/internal/observable/throwError.js","node_modules/rxjs/dist/esm/internal/util/isObservable.js","node_modules/rxjs/dist/esm/internal/util/EmptyError.js","node_modules/rxjs/dist/esm/internal/lastValueFrom.js","node_modules/rxjs/dist/esm/internal/util/isDate.js","node_modules/rxjs/dist/esm/internal/operators/map.js","node_modules/rxjs/dist/esm/internal/util/mapOneOrManyArgs.js","node_modules/rxjs/dist/esm/internal/util/argsArgArrayOrObject.js","node_modules/rxjs/dist/esm/internal/util/createObject.js","node_modules/rxjs/dist/esm/internal/observable/combineLatest.js","node_modules/rxjs/dist/esm/internal/operators/mergeInternals.js","node_modules/rxjs/dist/esm/internal/operators/mergeMap.js","node_modules/rxjs/dist/esm/internal/operators/mergeAll.js","node_modules/rxjs/dist/esm/internal/operators/concatAll.js","node_modules/rxjs/dist/esm/internal/observable/concat.js","node_modules/rxjs/dist/esm/internal/observable/defer.js","node_modules/rxjs/dist/esm/internal/observable/forkJoin.js","node_modules/rxjs/dist/esm/internal/observable/fromEvent.js","node_modules/rxjs/dist/esm/internal/observable/timer.js","node_modules/rxjs/dist/esm/internal/observable/merge.js","node_modules/rxjs/dist/esm/internal/operators/filter.js","node_modules/rxjs/dist/esm/internal/operators/audit.js","node_modules/rxjs/dist/esm/internal/operators/auditTime.js","node_modules/rxjs/dist/esm/internal/operators/catchError.js","node_modules/rxjs/dist/esm/internal/operators/scanInternals.js","node_modules/rxjs/dist/esm/internal/operators/concatMap.js","node_modules/rxjs/dist/esm/internal/operators/debounce.js","node_modules/rxjs/dist/esm/internal/operators/debounceTime.js","node_modules/rxjs/dist/esm/internal/operators/defaultIfEmpty.js","node_modules/rxjs/dist/esm/internal/operators/take.js","node_modules/rxjs/dist/esm/internal/operators/ignoreElements.js","node_modules/rxjs/dist/esm/internal/operators/mapTo.js","node_modules/rxjs/dist/esm/internal/operators/delayWhen.js","node_modules/rxjs/dist/esm/internal/operators/delay.js","node_modules/rxjs/dist/esm/internal/operators/distinctUntilChanged.js","node_modules/rxjs/dist/esm/internal/operators/throwIfEmpty.js","node_modules/rxjs/dist/esm/internal/operators/finalize.js","node_modules/rxjs/dist/esm/internal/operators/first.js","node_modules/rxjs/dist/esm/internal/operators/takeLast.js","node_modules/rxjs/dist/esm/internal/operators/last.js","node_modules/rxjs/dist/esm/internal/operators/pairwise.js","node_modules/rxjs/dist/esm/internal/operators/scan.js","node_modules/rxjs/dist/esm/internal/operators/share.js","node_modules/rxjs/dist/esm/internal/operators/shareReplay.js","node_modules/rxjs/dist/esm/internal/operators/skip.js","node_modules/rxjs/dist/esm/internal/operators/startWith.js","node_modules/rxjs/dist/esm/internal/operators/switchMap.js","node_modules/rxjs/dist/esm/internal/operators/takeUntil.js","node_modules/rxjs/dist/esm/internal/operators/takeWhile.js","node_modules/rxjs/dist/esm/internal/operators/tap.js","node_modules/@angular/core/fesm2022/core.mjs","node_modules/@angular/common/fesm2022/common.mjs","node_modules/@angular/common/fesm2022/http.mjs","node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs","node_modules/@angular/common/locales/de.mjs","node_modules/@angular/common/locales/extra/de.mjs","node_modules/@angular/forms/fesm2022/forms.mjs","node_modules/@angular/cdk/fesm2022/platform.mjs","node_modules/@angular/cdk/fesm2022/keycodes.mjs","node_modules/@angular/cdk/fesm2022/coercion/private.mjs","node_modules/@angular/cdk/fesm2022/coercion.mjs","node_modules/@angular/cdk/fesm2022/observers.mjs","node_modules/@angular/cdk/fesm2022/layout.mjs","node_modules/@angular/cdk/fesm2022/a11y.mjs","node_modules/@angular/cdk/fesm2022/bidi.mjs","node_modules/@angular/cdk/fesm2022/cdk.mjs","node_modules/@angular/material/fesm2022/core.mjs","node_modules/@angular/animations/fesm2022/animations.mjs","node_modules/@angular/animations/fesm2022/browser.mjs","node_modules/@angular/platform-browser/fesm2022/animations.mjs","node_modules/@ngx-translate/core/dist/fesm2022/ngx-translate-core.mjs","node_modules/ngx-translate-messageformat-compiler/fesm2022/ngx-translate-messageformat-compiler.mjs","node_modules/@angular/cdk/fesm2022/collections.mjs","node_modules/@angular/cdk/fesm2022/scrolling.mjs","node_modules/@angular/cdk/fesm2022/portal.mjs","node_modules/@angular/cdk/fesm2022/overlay.mjs","node_modules/@angular/cdk/fesm2022/dialog.mjs","node_modules/@angular/material/fesm2022/dialog.mjs","node_modules/@ngneat/until-destroy/fesm2022/ngneat-until-destroy.mjs","node_modules/@w11k/ngx-componentdestroyed/dist/es2015/index.js","src/app/app-component/utilities/get-string-and-number-value-array-from-enum.ts","src/app/app-component/utilities/time-zone-unit.ts","src/app/app-component/utilities/provider-brand-utilities.ts","node_modules/@angular/material/fesm2022/button.mjs","node_modules/@angular/material/fesm2022/icon.mjs","node_modules/@angular/material/fesm2022/divider.mjs","src/app/components/dialogs/imprint-dialog/imprint-dialog.component.ts","src/app/components/dialogs/imprint-dialog/imprint-dialog.component.html","src/app/components/dialogs/privacy-policy-dialog/privacy-policy-dialog.component.ts","src/app/components/dialogs/privacy-policy-dialog/privacy-policy-dialog.component.html","src/app/components/dialogs/terms-of-service-dialog/terms-of-service-dialog.component.ts","src/app/components/dialogs/terms-of-service-dialog/terms-of-service-dialog.component.html","src/app/components/help-dialog/help-dialog.component.ts","src/app/components/help-dialog/help-dialog.component.html","src/app/services/logo.service.ts","node_modules/@angular/router/fesm2022/router.mjs","src/app/app-component/app.component.ts","src/app/app-component/app.component.html","node_modules/@angular/cdk/fesm2022/stepper.mjs","src/app/models/associated-brand.ts","src/app/models/authentication-result.ts","src/app/services/data-processing-agreement.service.ts","node_modules/@angular/material/fesm2022/snack-bar.mjs","src/app/shared/snackbar/snackbar.component.ts","src/app/shared/snackbar/snackbar.component.html","src/app/services/notification.service.ts","src/app/shared/constants.ts","src/app/shared/instant-error-state-matcher.ts","src/app/models/registration-model.ts","src/app/services/auth.service.ts","src/app/services/invitation.service.ts","src/app/shared/blob-helper.ts","node_modules/@angular/material/fesm2022/checkbox.mjs","node_modules/@angular/cdk/fesm2022/text-field.mjs","node_modules/@angular/cdk/fesm2022/observers/private.mjs","node_modules/@angular/material/fesm2022/form-field.mjs","node_modules/@angular/material/fesm2022/input.mjs","node_modules/@angular/material/fesm2022/select.mjs","node_modules/@angular/material/fesm2022/tooltip.mjs","src/app/shared/directives/button-loading.directive.ts","node_modules/dompurify/dist/purify.es.mjs","src/app/shared/safe-html.pipe.ts","src/app/components/dialogs/dpa-dialog/dpa-dialog.component.ts","src/app/components/dialogs/dpa-dialog/dpa-dialog.component.html","node_modules/@angular/material/fesm2022/autocomplete.mjs","node_modules/@angular/material/fesm2022/stepper.mjs","src/app/shared/directives/trim.directive.ts","src/app/models/login-input-model.ts","src/app/models/password-reset-input-model.ts","src/app/components/login-dialog/login-dialog.component.ts","src/app/components/login-dialog/login-dialog.component.html","src/app/components/invite/invite.component.ts","src/app/components/invite/invite.component.html","src/app/models/digital-invoice-state.ts","src/app/services/invoice.service.ts","src/app/shared/helper.ts","src/app/components/invoice/invoice.component.ts","src/app/components/invoice/invoice.component.html","src/app/models/token-login-model.ts","src/app/components/login/login.component.ts","src/app/components/login/login.component.html","src/app/components/redirect/redirect.component.ts","src/app/components/logout/logout.component.ts","src/app/components/logout/logout.component.html","src/app/app-routing.module.ts","node_modules/@angular/material/fesm2022/badge.mjs","node_modules/@angular/material/fesm2022/bottom-sheet.mjs","node_modules/@angular/material/fesm2022/button-toggle.mjs","node_modules/@angular/material/fesm2022/radio.mjs","node_modules/@angular/material/fesm2022/toolbar.mjs","node_modules/@angular/material/fesm2022/menu.mjs","src/app/shared/material.module.ts","src/app/shared/shared.module.ts","src/app/shared/translate-http-post-loader.ts","src/app/app.module.ts","src/environments/environment.ts","src/main.ts"],"sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MessageFormat = factory());\n})(this, function () {\n 'use strict';\n\n /******************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\n /* global Reflect, Promise, SuppressedError, Symbol */\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }\n function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o),\n r,\n ar = [],\n e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = {\n error: error\n };\n } finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n }\n function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n }\n typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n };\n\n /**\n * Parent class for errors.\n *\n * @remarks\n * Errors with `type: \"warning\"` do not necessarily indicate that the parser\n * encountered an error. In addition to a human-friendly `message`, may also\n * includes the `token` at which the error was encountered.\n *\n * @public\n */\n class DateFormatError extends Error {\n /** @internal */\n constructor(msg, token, type) {\n super(msg);\n this.token = token;\n this.type = type || 'error';\n }\n }\n const alpha = width => width < 4 ? 'short' : width === 4 ? 'long' : 'narrow';\n const numeric = width => width % 2 === 0 ? '2-digit' : 'numeric';\n function yearOptions(token, onError) {\n switch (token.char) {\n case 'y':\n return {\n year: numeric(token.width)\n };\n case 'r':\n return {\n calendar: 'gregory',\n year: 'numeric'\n };\n case 'u':\n case 'U':\n case 'Y':\n default:\n onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);\n return {\n year: 'numeric'\n };\n }\n }\n function monthStyle(token, onError) {\n switch (token.width) {\n case 1:\n return 'numeric';\n case 2:\n return '2-digit';\n case 3:\n return 'short';\n case 4:\n return 'long';\n case 5:\n return 'narrow';\n default:\n onError(`${token.desc} is not supported with width ${token.width}`);\n return undefined;\n }\n }\n function dayStyle(token, onError) {\n const {\n char,\n desc,\n width\n } = token;\n if (char === 'd') {\n return numeric(width);\n } else {\n onError(`${desc} is not supported`);\n return undefined;\n }\n }\n function weekdayStyle(token, onError) {\n const {\n char,\n desc,\n width\n } = token;\n if ((char === 'c' || char === 'e') && width < 3) {\n // ignoring stand-alone-ness\n const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;\n onError(msg, DateFormatError.WARNING);\n }\n // merging narrow styles\n return alpha(width);\n }\n function hourOptions(token) {\n const hour = numeric(token.width);\n let hourCycle;\n switch (token.char) {\n case 'h':\n hourCycle = 'h12';\n break;\n case 'H':\n hourCycle = 'h23';\n break;\n case 'k':\n hourCycle = 'h24';\n break;\n case 'K':\n hourCycle = 'h11';\n break;\n }\n return hourCycle ? {\n hour,\n hourCycle\n } : {\n hour\n };\n }\n function timeZoneNameStyle(token, onError) {\n // so much fallback behaviour here\n const {\n char,\n desc,\n width\n } = token;\n switch (char) {\n case 'v':\n case 'z':\n return width === 4 ? 'long' : 'short';\n case 'V':\n if (width === 4) return 'long';\n onError(`${desc} is not supported with width ${width}`);\n return undefined;\n case 'X':\n onError(`${desc} is not supported`);\n return undefined;\n }\n return 'short';\n }\n function compileOptions(token, onError) {\n switch (token.field) {\n case 'era':\n return {\n era: alpha(token.width)\n };\n case 'year':\n return yearOptions(token, onError);\n case 'month':\n return {\n month: monthStyle(token, onError)\n };\n case 'day':\n return {\n day: dayStyle(token, onError)\n };\n case 'weekday':\n return {\n weekday: weekdayStyle(token, onError)\n };\n case 'period':\n return undefined;\n case 'hour':\n return hourOptions(token);\n case 'min':\n return {\n minute: numeric(token.width)\n };\n case 'sec':\n return {\n second: numeric(token.width)\n };\n case 'tz':\n return {\n timeZoneName: timeZoneNameStyle(token, onError)\n };\n case 'quarter':\n case 'week':\n case 'sec-frac':\n case 'ms':\n onError(`${token.desc} is not supported`);\n }\n return undefined;\n }\n function getDateFormatOptions(tokens, timeZone) {\n let onError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : error => {\n throw error;\n };\n const options = {\n timeZone\n };\n const fields = [];\n for (const token of tokens) {\n const {\n error,\n field,\n str\n } = token;\n if (error) {\n const dte = new DateFormatError(error.message, token);\n dte.stack = error.stack;\n onError(dte);\n }\n if (str) {\n const msg = `Ignoring string part: ${str}`;\n onError(new DateFormatError(msg, token, DateFormatError.WARNING));\n }\n if (field) {\n if (fields.indexOf(field) === -1) fields.push(field);else onError(new DateFormatError(`Duplicate ${field} token`, token));\n }\n const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));\n if (opt) Object.assign(options, opt);\n }\n return options;\n }\n const fields = {\n G: {\n field: 'era',\n desc: 'Era'\n },\n y: {\n field: 'year',\n desc: 'Year'\n },\n Y: {\n field: 'year',\n desc: 'Year of \"Week of Year\"'\n },\n u: {\n field: 'year',\n desc: 'Extended year'\n },\n U: {\n field: 'year',\n desc: 'Cyclic year name'\n },\n r: {\n field: 'year',\n desc: 'Related Gregorian year'\n },\n Q: {\n field: 'quarter',\n desc: 'Quarter'\n },\n q: {\n field: 'quarter',\n desc: 'Stand-alone quarter'\n },\n M: {\n field: 'month',\n desc: 'Month in year'\n },\n L: {\n field: 'month',\n desc: 'Stand-alone month in year'\n },\n w: {\n field: 'week',\n desc: 'Week of year'\n },\n W: {\n field: 'week',\n desc: 'Week of month'\n },\n d: {\n field: 'day',\n desc: 'Day in month'\n },\n D: {\n field: 'day',\n desc: 'Day of year'\n },\n F: {\n field: 'day',\n desc: 'Day of week in month'\n },\n g: {\n field: 'day',\n desc: 'Modified julian day'\n },\n E: {\n field: 'weekday',\n desc: 'Day of week'\n },\n e: {\n field: 'weekday',\n desc: 'Local day of week'\n },\n c: {\n field: 'weekday',\n desc: 'Stand-alone local day of week'\n },\n a: {\n field: 'period',\n desc: 'AM/PM marker'\n },\n b: {\n field: 'period',\n desc: 'AM/PM/noon/midnight marker'\n },\n B: {\n field: 'period',\n desc: 'Flexible day period'\n },\n h: {\n field: 'hour',\n desc: 'Hour in AM/PM (1~12)'\n },\n H: {\n field: 'hour',\n desc: 'Hour in day (0~23)'\n },\n k: {\n field: 'hour',\n desc: 'Hour in day (1~24)'\n },\n K: {\n field: 'hour',\n desc: 'Hour in AM/PM (0~11)'\n },\n j: {\n field: 'hour',\n desc: 'Hour in preferred cycle'\n },\n J: {\n field: 'hour',\n desc: 'Hour in preferred cycle without marker'\n },\n C: {\n field: 'hour',\n desc: 'Hour in preferred cycle with flexible marker'\n },\n m: {\n field: 'min',\n desc: 'Minute in hour'\n },\n s: {\n field: 'sec',\n desc: 'Second in minute'\n },\n S: {\n field: 'sec-frac',\n desc: 'Fractional second'\n },\n A: {\n field: 'ms',\n desc: 'Milliseconds in day'\n },\n z: {\n field: 'tz',\n desc: 'Time Zone: specific non-location'\n },\n Z: {\n field: 'tz',\n desc: 'Time Zone'\n },\n O: {\n field: 'tz',\n desc: 'Time Zone: localized'\n },\n v: {\n field: 'tz',\n desc: 'Time Zone: generic non-location'\n },\n V: {\n field: 'tz',\n desc: 'Time Zone: ID'\n },\n X: {\n field: 'tz',\n desc: 'Time Zone: ISO8601 with Z'\n },\n x: {\n field: 'tz',\n desc: 'Time Zone: ISO8601'\n }\n };\n const isLetter = char => char >= 'A' && char <= 'Z' || char >= 'a' && char <= 'z';\n function readFieldToken(src, pos) {\n const char = src[pos];\n let width = 1;\n while (src[++pos] === char) ++width;\n const field = fields[char];\n if (!field) {\n const msg = `The letter ${char} is not a valid field identifier`;\n return {\n char,\n error: new Error(msg),\n width\n };\n }\n return {\n char,\n field: field.field,\n desc: field.desc,\n width\n };\n }\n function readQuotedToken(src, pos) {\n let str = src[++pos];\n let width = 2;\n if (str === \"'\") return {\n char: \"'\",\n str,\n width\n };\n while (true) {\n const next = src[++pos];\n ++width;\n if (next === undefined) {\n const msg = `Unterminated quoted literal in pattern: ${str || src}`;\n return {\n char: \"'\",\n error: new Error(msg),\n str,\n width\n };\n } else if (next === \"'\") {\n if (src[++pos] !== \"'\") return {\n char: \"'\",\n str,\n width\n };else ++width;\n }\n str += next;\n }\n }\n function readToken(src, pos) {\n const char = src[pos];\n if (!char) return null;\n if (isLetter(char)) return readFieldToken(src, pos);\n if (char === \"'\") return readQuotedToken(src, pos);\n let str = char;\n let width = 1;\n while (true) {\n const next = src[++pos];\n if (!next || isLetter(next) || next === \"'\") return {\n char,\n str,\n width\n };\n str += next;\n width += 1;\n }\n }\n /**\n * Parse an {@link http://userguide.icu-project.org/formatparse/datetime | ICU\n * DateFormat skeleton} string into a {@link DateToken} array.\n *\n * @remarks\n * Errors will not be thrown, but if encountered are included as the relevant\n * token's `error` value.\n *\n * @public\n * @param src - The skeleton string\n *\n * @example\n * ```js\n * import { parseDateTokens } from '@messageformat/date-skeleton'\n *\n * parseDateTokens('GrMMMdd', console.error)\n * // [\n * // { char: 'G', field: 'era', desc: 'Era', width: 1 },\n * // { char: 'r', field: 'year', desc: 'Related Gregorian year', width: 1 },\n * // { char: 'M', field: 'month', desc: 'Month in year', width: 3 },\n * // { char: 'd', field: 'day', desc: 'Day in month', width: 2 }\n * // ]\n * ```\n */\n function parseDateTokens(src) {\n const tokens = [];\n let pos = 0;\n while (true) {\n const token = readToken(src, pos);\n if (!token) return tokens;\n tokens.push(token);\n pos += token.width;\n }\n }\n\n /**\n * Returns a date formatter function for the given locales and date skeleton\n *\n * @remarks\n * Uses `Intl.DateTimeFormat` internally.\n *\n * @public\n * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA`\n * @param tokens - An ICU DateFormat skeleton string, or an array or parsed\n * `DateToken` tokens\n * @param onError - If defined, will be called separately for each encountered\n * parsing error and unsupported feature.\n * @example\n * ```js\n * import { getDateFormatter } from '@messageformat/date-skeleton'\n *\n * // 2006 Jan 2, 15:04:05.789 in local time\n * const date = new Date(2006, 0, 2, 15, 4, 5, 789)\n *\n * let fmt = getDateFormatter('en-CA', 'GrMMMdd', console.error)\n * fmt(date) // 'Jan. 02, 2006 AD'\n *\n * fmt = getDateFormatter('en-CA', 'hamszzzz', console.error)\n * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time'\n * ```\n */\n function getDateFormatter(locales, tokens, timeZone, onError) {\n if (typeof tokens === 'string') tokens = parseDateTokens(tokens);\n if (typeof timeZone === 'function') {\n onError = timeZone;\n timeZone = undefined;\n }\n const opt = getDateFormatOptions(tokens, timeZone, onError);\n const dtf = new Intl.DateTimeFormat(locales, opt);\n return date => dtf.format(date);\n }\n /**\n * Returns a string of JavaScript source that evaluates to a date formatter\n * function with the same `(date: Date | number) => string` signature as the\n * function returned by {@link getDateFormatter}.\n *\n * @remarks\n * The returned function will memoize an `Intl.DateTimeFormat` instance.\n *\n * @public\n * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA`\n * @param tokens - An ICU DateFormat skeleton string, or an array or parsed\n * `DateToken` tokens\n * @param onError - If defined, will be called separately for each encountered\n * parsing error and unsupported feature.\n * @example\n * ```js\n * import { getDateFormatterSource } from '@messageformat/date-skeleton'\n *\n * getDateFormatterSource('en-CA', 'GrMMMdd', console.error)\n * // '(function() {\\n' +\n * // ' var opt = {\"era\":\"short\",\"calendar\":\"gregory\",\"year\":\"numeric\",' +\n * // '\"month\":\"short\",\"day\":\"2-digit\"};\\n' +\n * // ' var dtf = new Intl.DateTimeFormat(\"en-CA\", opt);\\n' +\n * // ' return function(value) { return dtf.format(value); }\\n' +\n * // '})()'\n *\n * const src = getDateFormatterSource('en-CA', 'hamszzzz', console.error)\n * // '(function() {\\n' +\n * // ' var opt = {\"hour\":\"numeric\",\"hourCycle\":\"h12\",\"minute\":\"numeric\",' +\n * // '\"second\":\"numeric\",\"timeZoneName\":\"long\"};\\n' +\n * // ' var dtf = new Intl.DateTimeFormat(\"en-CA\", opt);\\n' +\n * // ' return function(value) { return dtf.format(value); }\\n' +\n * // '})()'\n *\n * const fmt = new Function(`return ${src}`)()\n * const date = new Date(2006, 0, 2, 15, 4, 5, 789)\n * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time'\n * ```\n */\n function getDateFormatterSource(locales, tokens, timeZone, onError) {\n if (typeof tokens === 'string') tokens = parseDateTokens(tokens);\n if (typeof timeZone === 'function') {\n onError = timeZone;\n timeZone = undefined;\n }\n const opt = getDateFormatOptions(tokens, timeZone, onError);\n const lines = [`(function() {`, `var opt = ${JSON.stringify(opt)};`, `var dtf = new Intl.DateTimeFormat(${JSON.stringify(locales)}, opt);`, `return function(value) { return dtf.format(value); }`];\n return lines.join('\\n ') + '\\n})()';\n }\n\n /**\n * Base class for errors. In addition to a `code` and a human-friendly\n * `message`, may also includes the token `stem` as well as other fields.\n *\n * @public\n */\n class NumberFormatError extends Error {\n /** @internal */\n constructor(code, msg) {\n super(msg);\n this.code = code;\n }\n }\n /** @internal */\n class BadOptionError extends NumberFormatError {\n constructor(stem, opt) {\n super('BAD_OPTION', `Unknown ${stem} option: ${opt}`);\n this.stem = stem;\n this.option = opt;\n }\n }\n /** @internal */\n class BadStemError extends NumberFormatError {\n constructor(stem) {\n super('BAD_STEM', `Unknown stem: ${stem}`);\n this.stem = stem;\n }\n }\n /** @internal */\n class MaskedValueError extends NumberFormatError {\n constructor(type, prev) {\n super('MASKED_VALUE', `Value for ${type} is set multiple times`);\n this.type = type;\n this.prev = prev;\n }\n }\n /** @internal */\n class MissingOptionError extends NumberFormatError {\n constructor(stem) {\n super('MISSING_OPTION', `Required option missing for ${stem}`);\n this.stem = stem;\n }\n }\n /** @internal */\n class PatternError extends NumberFormatError {\n constructor(char, msg) {\n super('BAD_PATTERN', msg);\n this.char = char;\n }\n }\n /** @internal */\n class TooManyOptionsError extends NumberFormatError {\n constructor(stem, options, maxOpt) {\n const maxOptStr = maxOpt > 1 ? `${maxOpt} options` : 'one option';\n super('TOO_MANY_OPTIONS', `Token ${stem} only supports ${maxOptStr} (got ${options.length})`);\n this.stem = stem;\n this.options = options;\n }\n }\n /** @internal */\n class UnsupportedError extends NumberFormatError {\n constructor(stem, source) {\n super('UNSUPPORTED', `The stem ${stem} is not supported`);\n this.stem = stem;\n if (source) {\n this.message += ` with value ${source}`;\n this.source = source;\n }\n }\n }\n\n /**\n * Add\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation | numbering-system tags}\n * to locale identifiers\n *\n * @internal\n */\n function getNumberFormatLocales(locales, _ref) {\n let {\n numberingSystem\n } = _ref;\n if (!Array.isArray(locales)) locales = [locales];\n return numberingSystem ? locales.map(lc => {\n const ext = lc.indexOf('-u-') === -1 ? 'u-nu' : 'nu';\n return `${lc}-${ext}-${numberingSystem}`;\n }).concat(locales) : locales;\n }\n\n // from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round\n function round(x, precision) {\n const y = +x + precision / 2;\n return y - y % +precision;\n }\n function getNumberFormatMultiplier(_ref) {\n let {\n scale,\n unit\n } = _ref;\n let mult = typeof scale === 'number' && scale >= 0 ? scale : 1;\n if (unit && unit.style === 'percent') mult *= 0.01;\n return mult;\n }\n /**\n * Determine a modifier for the input value to account for any `scale`,\n * `percent`, and `precision-increment` tokens in the skeleton.\n *\n * @internal\n * @remarks\n * With ICU NumberFormatter, the `percent` skeleton would style `25` as \"25%\".\n * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`.\n */\n function getNumberFormatModifier(skeleton) {\n const mult = getNumberFormatMultiplier(skeleton);\n const {\n precision\n } = skeleton;\n if (precision && precision.style === 'precision-increment') {\n return n => round(n, precision.increment) * mult;\n } else {\n return n => n * mult;\n }\n }\n /**\n * Returns a string of JavaScript source that evaluates to a modifier for the\n * input value to account for any `scale`, `percent`, and `precision-increment`\n * tokens in the skeleton.\n *\n * @internal\n * @remarks\n * With ICU NumberFormatter, the `percent` skeleton would style `25` as \"25%\".\n * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`.\n */\n function getNumberFormatModifierSource(skeleton) {\n const mult = getNumberFormatMultiplier(skeleton);\n const {\n precision\n } = skeleton;\n if (precision && precision.style === 'precision-increment') {\n // see round() above for source\n const setX = `+n + ${precision.increment / 2}`;\n let res = `x - (x % +${precision.increment})`;\n if (mult !== 1) res = `(${res}) * ${mult}`;\n return `function(n) { var x = ${setX}; return ${res}; }`;\n }\n return mult !== 1 ? `function(n) { return n * ${mult}; }` : null;\n }\n\n /**\n * Given an input ICU NumberFormatter skeleton, does its best to construct a\n * corresponding `Intl.NumberFormat` options structure.\n *\n * @remarks\n * Some features depend on `Intl.NumberFormat` features defined in ES2020.\n *\n * @internal\n * @param onUnsupported - If defined, called when encountering unsupported (but\n * valid) tokens, such as `decimal-always` or `permille`. The error `source`\n * may specify the source of an unsupported option.\n *\n * @example\n * ```js\n * import {\n * getNumberFormatOptions,\n * parseNumberSkeleton\n * } from '@messageformat/number-skeleton'\n *\n * const src = 'currency/CAD unit-width-narrow'\n * const skeleton = parseNumberSkeleton(src, console.error)\n * // {\n * // unit: { style: 'currency', currency: 'CAD' },\n * // unitWidth: 'unit-width-narrow'\n * // }\n *\n * getNumberFormatOptions(skeleton, console.error)\n * // {\n * // style: 'currency',\n * // currency: 'CAD',\n * // currencyDisplay: 'narrowSymbol',\n * // unitDisplay: 'narrow'\n * // }\n *\n * const sk2 = parseNumberSkeleton('group-min2')\n * // { group: 'group-min2' }\n *\n * getNumberFormatOptions(sk2, console.error)\n * // Error: The stem group-min2 is not supported\n * // at UnsupportedError.NumberFormatError ... {\n * // code: 'UNSUPPORTED',\n * // stem: 'group-min2'\n * // }\n * // {}\n * ```\n */\n function getNumberFormatOptions(skeleton, onUnsupported) {\n const {\n decimal,\n group,\n integerWidth,\n notation,\n precision,\n roundingMode,\n sign,\n unit,\n unitPer,\n unitWidth\n } = skeleton;\n const fail = (stem, source) => {\n if (onUnsupported) onUnsupported(new UnsupportedError(stem, source));\n };\n const opt = {};\n if (unit) {\n switch (unit.style) {\n case 'base-unit':\n opt.style = 'decimal';\n break;\n case 'currency':\n opt.style = 'currency';\n opt.currency = unit.currency;\n break;\n case 'measure-unit':\n opt.style = 'unit';\n opt.unit = unit.unit.replace(/.*-/, '');\n if (unitPer) opt.unit += '-per-' + unitPer.replace(/.*-/, '');\n break;\n case 'percent':\n opt.style = 'percent';\n break;\n case 'permille':\n fail('permille');\n break;\n }\n }\n switch (unitWidth) {\n case 'unit-width-full-name':\n opt.currencyDisplay = 'name';\n opt.unitDisplay = 'long';\n break;\n case 'unit-width-hidden':\n fail(unitWidth);\n break;\n case 'unit-width-iso-code':\n opt.currencyDisplay = 'code';\n break;\n case 'unit-width-narrow':\n opt.currencyDisplay = 'narrowSymbol';\n opt.unitDisplay = 'narrow';\n break;\n case 'unit-width-short':\n opt.currencyDisplay = 'symbol';\n opt.unitDisplay = 'short';\n break;\n }\n switch (group) {\n case 'group-off':\n opt.useGrouping = false;\n break;\n case 'group-auto':\n opt.useGrouping = true;\n break;\n case 'group-min2':\n case 'group-on-aligned':\n case 'group-thousands':\n fail(group);\n opt.useGrouping = true;\n break;\n }\n if (precision) {\n switch (precision.style) {\n case 'precision-fraction':\n {\n const {\n minFraction: minF,\n maxFraction: maxF,\n minSignificant: minS,\n maxSignificant: maxS,\n source\n } = precision;\n if (typeof minF === 'number') {\n opt.minimumFractionDigits = minF;\n if (typeof minS === 'number') fail('precision-fraction', source);\n }\n if (typeof maxF === 'number') opt.maximumFractionDigits = maxF;\n if (typeof minS === 'number') opt.minimumSignificantDigits = minS;\n if (typeof maxS === 'number') opt.maximumSignificantDigits = maxS;\n break;\n }\n case 'precision-integer':\n opt.maximumFractionDigits = 0;\n break;\n case 'precision-unlimited':\n opt.maximumFractionDigits = 20;\n break;\n case 'precision-increment':\n break;\n case 'precision-currency-standard':\n opt.trailingZeroDisplay = precision.trailingZero;\n break;\n case 'precision-currency-cash':\n fail(precision.style);\n break;\n }\n }\n if (notation) {\n switch (notation.style) {\n case 'compact-short':\n opt.notation = 'compact';\n opt.compactDisplay = 'short';\n break;\n case 'compact-long':\n opt.notation = 'compact';\n opt.compactDisplay = 'long';\n break;\n case 'notation-simple':\n opt.notation = 'standard';\n break;\n case 'scientific':\n case 'engineering':\n {\n const {\n expDigits,\n expSign,\n source,\n style\n } = notation;\n opt.notation = style;\n if (expDigits && expDigits > 1 || expSign && expSign !== 'sign-auto') {\n fail(style, source);\n }\n break;\n }\n }\n }\n if (integerWidth) {\n const {\n min,\n max,\n source\n } = integerWidth;\n if (min > 0) opt.minimumIntegerDigits = min;\n if (Number(max) > 0) {\n const hasExp = opt.notation === 'engineering' || opt.notation === 'scientific';\n if (max === 3 && hasExp) opt.notation = 'engineering';else fail('integer-width', source);\n }\n }\n switch (sign) {\n case 'sign-auto':\n opt.signDisplay = 'auto';\n break;\n case 'sign-always':\n opt.signDisplay = 'always';\n break;\n case 'sign-except-zero':\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/46712\n opt.signDisplay = 'exceptZero';\n break;\n case 'sign-never':\n opt.signDisplay = 'never';\n break;\n case 'sign-accounting':\n opt.currencySign = 'accounting';\n break;\n case 'sign-accounting-always':\n opt.currencySign = 'accounting';\n opt.signDisplay = 'always';\n break;\n case 'sign-accounting-except-zero':\n opt.currencySign = 'accounting';\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/46712\n opt.signDisplay = 'exceptZero';\n break;\n }\n if (decimal === 'decimal-always') fail(decimal);\n if (roundingMode) fail(roundingMode);\n return opt;\n }\n function parseAffixToken(src, pos, onError) {\n const char = src[pos];\n switch (char) {\n case '%':\n return {\n char: '%',\n style: 'percent',\n width: 1\n };\n case '‰':\n return {\n char: '%',\n style: 'permille',\n width: 1\n };\n case '¤':\n {\n let width = 1;\n while (src[++pos] === '¤') ++width;\n switch (width) {\n case 1:\n return {\n char,\n currency: 'default',\n width\n };\n case 2:\n return {\n char,\n currency: 'iso-code',\n width\n };\n case 3:\n return {\n char,\n currency: 'full-name',\n width\n };\n case 5:\n return {\n char,\n currency: 'narrow',\n width\n };\n default:\n {\n const msg = `Invalid number (${width}) of ¤ chars in pattern`;\n onError(new PatternError('¤', msg));\n return null;\n }\n }\n }\n case '*':\n {\n const pad = src[pos + 1];\n if (pad) return {\n char,\n pad,\n width: 2\n };\n break;\n }\n case '+':\n case '-':\n return {\n char,\n width: 1\n };\n case \"'\":\n {\n let str = src[++pos];\n let width = 2;\n if (str === \"'\") return {\n char,\n str,\n width\n };\n while (true) {\n const next = src[++pos];\n ++width;\n if (next === undefined) {\n const msg = `Unterminated quoted literal in pattern: ${str}`;\n onError(new PatternError(\"'\", msg));\n return {\n char,\n str,\n width\n };\n } else if (next === \"'\") {\n if (src[++pos] !== \"'\") return {\n char,\n str,\n width\n };else ++width;\n }\n str += next;\n }\n }\n }\n return null;\n }\n const isDigit = char => char >= '0' && char <= '9';\n function parseNumberToken(src, pos) {\n const char = src[pos];\n if (isDigit(char)) {\n let digits = char;\n while (true) {\n const next = src[++pos];\n if (isDigit(next)) digits += next;else return {\n char: '0',\n digits,\n width: digits.length\n };\n }\n }\n switch (char) {\n case '#':\n {\n let width = 1;\n while (src[++pos] === '#') ++width;\n return {\n char,\n width\n };\n }\n case '@':\n {\n let min = 1;\n while (src[++pos] === '@') ++min;\n let width = min;\n pos -= 1;\n while (src[++pos] === '#') ++width;\n return {\n char,\n min,\n width\n };\n }\n case 'E':\n {\n const plus = src[pos + 1] === '+';\n if (plus) ++pos;\n let expDigits = 0;\n while (src[++pos] === '0') ++expDigits;\n const width = (plus ? 2 : 1) + expDigits;\n if (expDigits) return {\n char,\n expDigits,\n plus,\n width\n };else break;\n }\n case '.':\n case ',':\n return {\n char,\n width: 1\n };\n }\n return null;\n }\n function parseSubpattern(src, pos, onError) {\n let State;\n (function (State) {\n State[State[\"Prefix\"] = 0] = \"Prefix\";\n State[State[\"Number\"] = 1] = \"Number\";\n State[State[\"Suffix\"] = 2] = \"Suffix\";\n })(State || (State = {}));\n const prefix = [];\n const number = [];\n const suffix = [];\n let state = State.Prefix;\n let str = '';\n while (pos < src.length) {\n const char = src[pos];\n if (char === ';') {\n pos += 1;\n break;\n }\n switch (state) {\n case State.Prefix:\n {\n const token = parseAffixToken(src, pos, onError);\n if (token) {\n if (str) {\n prefix.push({\n char: \"'\",\n str,\n width: str.length\n });\n str = '';\n }\n prefix.push(token);\n pos += token.width;\n } else {\n const token = parseNumberToken(src, pos);\n if (token) {\n if (str) {\n prefix.push({\n char: \"'\",\n str,\n width: str.length\n });\n str = '';\n }\n state = State.Number;\n number.push(token);\n pos += token.width;\n } else {\n str += char;\n pos += 1;\n }\n }\n break;\n }\n case State.Number:\n {\n const token = parseNumberToken(src, pos);\n if (token) {\n number.push(token);\n pos += token.width;\n } else {\n state = State.Suffix;\n }\n break;\n }\n case State.Suffix:\n {\n const token = parseAffixToken(src, pos, onError);\n if (token) {\n if (str) {\n suffix.push({\n char: \"'\",\n str,\n width: str.length\n });\n str = '';\n }\n suffix.push(token);\n pos += token.width;\n } else {\n str += char;\n pos += 1;\n }\n break;\n }\n }\n }\n if (str) suffix.push({\n char: \"'\",\n str,\n width: str.length\n });\n return {\n pattern: {\n prefix,\n number,\n suffix\n },\n pos\n };\n }\n function parseTokens(src, onError) {\n const {\n pattern,\n pos\n } = parseSubpattern(src, 0, onError);\n if (pos < src.length) {\n const {\n pattern: negative\n } = parseSubpattern(src, pos, onError);\n return {\n tokens: pattern,\n negative\n };\n }\n return {\n tokens: pattern\n };\n }\n function parseNumberAsSkeleton(tokens, onError) {\n const res = {};\n let hasGroups = false;\n let hasExponent = false;\n let intOptional = 0;\n let intDigits = '';\n let decimalPos = -1;\n let fracDigits = '';\n let fracOptional = 0;\n for (let pos = 0; pos < tokens.length; ++pos) {\n const token = tokens[pos];\n switch (token.char) {\n case '#':\n {\n if (decimalPos === -1) {\n if (intDigits) {\n const msg = 'Pattern has # after integer digits';\n onError(new PatternError('#', msg));\n }\n intOptional += token.width;\n } else {\n fracOptional += token.width;\n }\n break;\n }\n case '0':\n {\n if (decimalPos === -1) {\n intDigits += token.digits;\n } else {\n if (fracOptional) {\n const msg = 'Pattern has digits after # in fraction';\n onError(new PatternError('0', msg));\n }\n fracDigits += token.digits;\n }\n break;\n }\n case '@':\n {\n if (res.precision) {\n onError(new MaskedValueError('precision', res.precision));\n }\n res.precision = {\n style: 'precision-fraction',\n minSignificant: token.min,\n maxSignificant: token.width\n };\n break;\n }\n case ',':\n hasGroups = true;\n break;\n case '.':\n if (decimalPos === 1) {\n const msg = 'Pattern has more than one decimal separator';\n onError(new PatternError('.', msg));\n }\n decimalPos = pos;\n break;\n case 'E':\n {\n if (hasExponent) {\n onError(new MaskedValueError('exponent', res.notation));\n }\n if (hasGroups) {\n const msg = 'Exponential patterns may not contain grouping separators';\n onError(new PatternError('E', msg));\n }\n res.notation = {\n style: 'scientific'\n };\n if (token.expDigits > 1) res.notation.expDigits = token.expDigits;\n if (token.plus) res.notation.expSign = 'sign-always';\n hasExponent = true;\n }\n }\n }\n // imprecise mapping due to paradigm differences\n if (hasGroups) res.group = 'group-auto';else if (intOptional + intDigits.length > 3) res.group = 'group-off';\n const increment = Number(`${intDigits || '0'}.${fracDigits}`);\n if (increment) res.precision = {\n style: 'precision-increment',\n increment\n };\n if (!hasExponent) {\n if (intDigits.length > 1) res.integerWidth = {\n min: intDigits.length\n };\n if (!res.precision && (fracDigits.length || fracOptional)) {\n res.precision = {\n style: 'precision-fraction',\n minFraction: fracDigits.length,\n maxFraction: fracDigits.length + fracOptional\n };\n }\n } else {\n if (!res.precision || increment) {\n res.integerWidth = intOptional ? {\n min: 1,\n max: intOptional + intDigits.length\n } : {\n min: Math.max(1, intDigits.length)\n };\n }\n if (res.precision) {\n if (!increment) res.integerWidth = {\n min: 1,\n max: 1\n };\n } else {\n const dc = intDigits.length + fracDigits.length;\n if (decimalPos === -1) {\n if (dc > 0) {\n res.precision = {\n style: 'precision-fraction',\n maxSignificant: dc\n };\n }\n } else {\n res.precision = {\n style: 'precision-fraction',\n maxSignificant: Math.max(1, dc) + fracOptional\n };\n if (dc > 1) res.precision.minSignificant = dc;\n }\n }\n }\n return res;\n }\n function handleAffix(affixTokens, res, currency, onError, isPrefix) {\n let inFmt = false;\n let str = '';\n for (const token of affixTokens) {\n switch (token.char) {\n case '%':\n res.unit = {\n style: token.style\n };\n if (isPrefix) inFmt = true;else str = '';\n break;\n case '¤':\n if (!currency) {\n const msg = `The ¤ pattern requires a currency`;\n onError(new PatternError('¤', msg));\n break;\n }\n res.unit = {\n style: 'currency',\n currency\n };\n switch (token.currency) {\n case 'iso-code':\n res.unitWidth = 'unit-width-iso-code';\n break;\n case 'full-name':\n res.unitWidth = 'unit-width-full-name';\n break;\n case 'narrow':\n res.unitWidth = 'unit-width-narrow';\n break;\n }\n if (isPrefix) inFmt = true;else str = '';\n break;\n case '*':\n // TODO\n break;\n case '+':\n if (!inFmt) str += '+';\n break;\n case \"'\":\n if (!inFmt) str += token.str;\n break;\n }\n }\n return str;\n }\n function getNegativeAffix(affixTokens, isPrefix) {\n let inFmt = false;\n let str = '';\n for (const token of affixTokens) {\n switch (token.char) {\n case '%':\n case '¤':\n if (isPrefix) inFmt = true;else str = '';\n break;\n case '-':\n if (!inFmt) str += '-';\n break;\n case \"'\":\n if (!inFmt) str += token.str;\n break;\n }\n }\n return str;\n }\n /**\n * Parse an {@link\n * http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns |\n * ICU NumberFormatter pattern} string into a {@link Skeleton} structure.\n *\n * @public\n * @param src - The pattern string\n * @param currency - If the pattern includes ¤ tokens, their skeleton\n * representation requires a three-letter currency code.\n * @param onError - Called when the parser encounters a syntax error. The\n * function will still return a {@link Skeleton}, but it will be incomplete\n * and/or inaccurate. If not defined, the error will be thrown instead.\n *\n * @remarks\n * Unlike the skeleton parser, the pattern parser is not able to return partial\n * results on error, and will instead throw. Output padding is not supported.\n *\n * @example\n * ```js\n * import { parseNumberPattern } from '@messageformat/number-skeleton'\n *\n * parseNumberPattern('#,##0.00 ¤', 'EUR', console.error)\n * // {\n * // group: 'group-auto',\n * // precision: {\n * // style: 'precision-fraction',\n * // minFraction: 2,\n * // maxFraction: 2\n * // },\n * // unit: { style: 'currency', currency: 'EUR' }\n * // }\n * ```\n */\n function parseNumberPattern(src, currency) {\n let onError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : error => {\n throw error;\n };\n const {\n tokens,\n negative\n } = parseTokens(src, onError);\n const res = parseNumberAsSkeleton(tokens.number, onError);\n const prefix = handleAffix(tokens.prefix, res, currency, onError, true);\n const suffix = handleAffix(tokens.suffix, res, currency, onError, false);\n if (negative) {\n const negPrefix = getNegativeAffix(negative.prefix, true);\n const negSuffix = getNegativeAffix(negative.suffix, false);\n res.affix = {\n pos: [prefix, suffix],\n neg: [negPrefix, negSuffix]\n };\n res.sign = 'sign-never';\n } else if (prefix || suffix) {\n res.affix = {\n pos: [prefix, suffix]\n };\n }\n return res;\n }\n\n /** @internal */\n function isNumberingSystem(ns) {\n const systems = ['arab', 'arabext', 'bali', 'beng', 'deva', 'fullwide', 'gujr', 'guru', 'hanidec', 'khmr', 'knda', 'laoo', 'latn', 'limb', 'mlym', 'mong', 'mymr', 'orya', 'tamldec', 'telu', 'thai', 'tibt'];\n return systems.indexOf(ns) !== -1;\n }\n\n // FIXME: subtype is not checked\n /** @internal */\n function isUnit(unit) {\n const types = ['acceleration', 'angle', 'area', 'concentr', 'consumption', 'digital', 'duration', 'electric', 'energy', 'force', 'frequency', 'graphics', 'length', 'light', 'mass', 'power', 'pressure', 'speed', 'temperature', 'torque', 'volume'];\n const [type] = unit.split('-', 1);\n return types.indexOf(type) !== -1;\n }\n const maxOptions = {\n 'compact-short': 0,\n 'compact-long': 0,\n 'notation-simple': 0,\n scientific: 2,\n engineering: 2,\n percent: 0,\n permille: 0,\n 'base-unit': 0,\n currency: 1,\n 'measure-unit': 1,\n 'per-measure-unit': 1,\n 'unit-width-narrow': 0,\n 'unit-width-short': 0,\n 'unit-width-full-name': 0,\n 'unit-width-iso-code': 0,\n 'unit-width-hidden': 0,\n 'precision-integer': 0,\n 'precision-unlimited': 0,\n 'precision-currency-standard': 1,\n 'precision-currency-cash': 0,\n 'precision-increment': 1,\n 'rounding-mode-ceiling': 0,\n 'rounding-mode-floor': 0,\n 'rounding-mode-down': 0,\n 'rounding-mode-up': 0,\n 'rounding-mode-half-even': 0,\n 'rounding-mode-half-down': 0,\n 'rounding-mode-half-up': 0,\n 'rounding-mode-unnecessary': 0,\n 'integer-width': 1,\n scale: 1,\n 'group-off': 0,\n 'group-min2': 0,\n 'group-auto': 0,\n 'group-on-aligned': 0,\n 'group-thousands': 0,\n latin: 0,\n 'numbering-system': 1,\n 'sign-auto': 0,\n 'sign-always': 0,\n 'sign-never': 0,\n 'sign-accounting': 0,\n 'sign-accounting-always': 0,\n 'sign-except-zero': 0,\n 'sign-accounting-except-zero': 0,\n 'decimal-auto': 0,\n 'decimal-always': 0\n };\n const minOptions = {\n currency: 1,\n 'integer-width': 1,\n 'measure-unit': 1,\n 'numbering-system': 1,\n 'per-measure-unit': 1,\n 'precision-increment': 1,\n scale: 1\n };\n function hasMaxOption(stem) {\n return stem in maxOptions;\n }\n function hasMinOption(stem) {\n return stem in minOptions;\n }\n /** @internal */\n function validOptions(stem, options, onError) {\n if (hasMaxOption(stem)) {\n const maxOpt = maxOptions[stem];\n if (options.length > maxOpt) {\n if (maxOpt === 0) {\n for (const opt of options) onError(new BadOptionError(stem, opt));\n } else {\n onError(new TooManyOptionsError(stem, options, maxOpt));\n }\n return false;\n } else if (hasMinOption(stem) && options.length < minOptions[stem]) {\n onError(new MissingOptionError(stem));\n return false;\n }\n }\n return true;\n }\n function parseBlueprintDigits(src, style) {\n const re = style === 'fraction' ? /^\\.(0*)(\\+|#*)$/ : /^(@+)(\\+|#*)$/;\n const match = src && src.match(re);\n if (match) {\n const min = match[1].length;\n switch (match[2].charAt(0)) {\n case '':\n return {\n min,\n max: min\n };\n case '+':\n return {\n min,\n max: null\n };\n case '#':\n {\n return {\n min,\n max: min + match[2].length\n };\n }\n }\n }\n return null;\n }\n function parsePrecisionBlueprint(stem, options, onError) {\n const fd = parseBlueprintDigits(stem, 'fraction');\n if (fd) {\n if (options.length > 1) onError(new TooManyOptionsError(stem, options, 1));\n const res = {\n style: 'precision-fraction',\n source: stem,\n minFraction: fd.min\n };\n if (fd.max != null) res.maxFraction = fd.max;\n const option = options[0];\n const sd = parseBlueprintDigits(option, 'significant');\n if (sd) {\n res.source = `${stem}/${option}`;\n res.minSignificant = sd.min;\n if (sd.max != null) res.maxSignificant = sd.max;\n } else if (option) {\n onError(new BadOptionError(stem, option));\n }\n return res;\n }\n const sd = parseBlueprintDigits(stem, 'significant');\n if (sd) {\n for (const opt of options) onError(new BadOptionError(stem, opt));\n const res = {\n style: 'precision-fraction',\n source: stem,\n minSignificant: sd.min\n };\n if (sd.max != null) res.maxSignificant = sd.max;\n return res;\n }\n return null;\n }\n\n /** @internal */\n class TokenParser {\n constructor(onError) {\n this.skeleton = {};\n this.onError = onError;\n }\n badOption(stem, opt) {\n this.onError(new BadOptionError(stem, opt));\n }\n assertEmpty(key) {\n const prev = this.skeleton[key];\n if (prev) this.onError(new MaskedValueError(key, prev));\n }\n parseToken(stem, options) {\n if (!validOptions(stem, options, this.onError)) return;\n const option = options[0];\n const res = this.skeleton;\n switch (stem) {\n // notation\n case 'compact-short':\n case 'compact-long':\n case 'notation-simple':\n this.assertEmpty('notation');\n res.notation = {\n style: stem\n };\n break;\n case 'scientific':\n case 'engineering':\n {\n let expDigits = null;\n let expSign = undefined;\n for (const opt of options) {\n switch (opt) {\n case 'sign-auto':\n case 'sign-always':\n case 'sign-never':\n case 'sign-accounting':\n case 'sign-accounting-always':\n case 'sign-except-zero':\n case 'sign-accounting-except-zero':\n expSign = opt;\n break;\n default:\n if (/^\\+e+$/.test(opt)) {\n expDigits = opt.length - 1;\n } else {\n this.badOption(stem, opt);\n }\n }\n }\n this.assertEmpty('notation');\n const source = options.join('/');\n res.notation = expDigits && expSign ? {\n style: stem,\n source,\n expDigits,\n expSign\n } : expDigits ? {\n style: stem,\n source,\n expDigits\n } : expSign ? {\n style: stem,\n source,\n expSign\n } : {\n style: stem,\n source\n };\n break;\n }\n // unit\n case 'percent':\n case 'permille':\n case 'base-unit':\n this.assertEmpty('unit');\n res.unit = {\n style: stem\n };\n break;\n case 'currency':\n if (/^[A-Z]{3}$/.test(option)) {\n this.assertEmpty('unit');\n res.unit = {\n style: stem,\n currency: option\n };\n } else {\n this.badOption(stem, option);\n }\n break;\n case 'measure-unit':\n {\n if (isUnit(option)) {\n this.assertEmpty('unit');\n res.unit = {\n style: stem,\n unit: option\n };\n } else {\n this.badOption(stem, option);\n }\n break;\n }\n // unitPer\n case 'per-measure-unit':\n {\n if (isUnit(option)) {\n this.assertEmpty('unitPer');\n res.unitPer = option;\n } else {\n this.badOption(stem, option);\n }\n break;\n }\n // unitWidth\n case 'unit-width-narrow':\n case 'unit-width-short':\n case 'unit-width-full-name':\n case 'unit-width-iso-code':\n case 'unit-width-hidden':\n this.assertEmpty('unitWidth');\n res.unitWidth = stem;\n break;\n // precision\n case 'precision-integer':\n case 'precision-unlimited':\n case 'precision-currency-cash':\n this.assertEmpty('precision');\n res.precision = {\n style: stem\n };\n break;\n case 'precision-currency-standard':\n this.assertEmpty('precision');\n if (option === 'w') {\n res.precision = {\n style: stem,\n trailingZero: 'stripIfInteger'\n };\n } else {\n res.precision = {\n style: stem\n };\n }\n break;\n case 'precision-increment':\n {\n const increment = Number(option);\n if (increment > 0) {\n this.assertEmpty('precision');\n res.precision = {\n style: stem,\n increment\n };\n } else {\n this.badOption(stem, option);\n }\n break;\n }\n // roundingMode\n case 'rounding-mode-ceiling':\n case 'rounding-mode-floor':\n case 'rounding-mode-down':\n case 'rounding-mode-up':\n case 'rounding-mode-half-even':\n case 'rounding-mode-half-odd':\n case 'rounding-mode-half-ceiling':\n case 'rounding-mode-half-floor':\n case 'rounding-mode-half-down':\n case 'rounding-mode-half-up':\n case 'rounding-mode-unnecessary':\n this.assertEmpty('roundingMode');\n res.roundingMode = stem;\n break;\n // integerWidth\n case 'integer-width':\n {\n if (/^\\+0*$/.test(option)) {\n this.assertEmpty('integerWidth');\n res.integerWidth = {\n source: option,\n min: option.length - 1\n };\n } else {\n const m = option.match(/^#*(0*)$/);\n if (m) {\n this.assertEmpty('integerWidth');\n res.integerWidth = {\n source: option,\n min: m[1].length,\n max: m[0].length\n };\n } else {\n this.badOption(stem, option);\n }\n }\n break;\n }\n // scale\n case 'scale':\n {\n const scale = Number(option);\n if (scale > 0) {\n this.assertEmpty('scale');\n res.scale = scale;\n } else {\n this.badOption(stem, option);\n }\n break;\n }\n // group\n case 'group-off':\n case 'group-min2':\n case 'group-auto':\n case 'group-on-aligned':\n case 'group-thousands':\n this.assertEmpty('group');\n res.group = stem;\n break;\n // numberingSystem\n case 'latin':\n this.assertEmpty('numberingSystem');\n res.numberingSystem = 'latn';\n break;\n case 'numbering-system':\n {\n if (isNumberingSystem(option)) {\n this.assertEmpty('numberingSystem');\n res.numberingSystem = option;\n } else {\n this.badOption(stem, option);\n }\n break;\n }\n // sign\n case 'sign-auto':\n case 'sign-always':\n case 'sign-never':\n case 'sign-accounting':\n case 'sign-accounting-always':\n case 'sign-except-zero':\n case 'sign-accounting-except-zero':\n this.assertEmpty('sign');\n res.sign = stem;\n break;\n // decimal\n case 'decimal-auto':\n case 'decimal-always':\n this.assertEmpty('decimal');\n res.decimal = stem;\n break;\n // precision blueprint\n default:\n {\n const precision = parsePrecisionBlueprint(stem, options, this.onError);\n if (precision) {\n this.assertEmpty('precision');\n res.precision = precision;\n } else {\n this.onError(new BadStemError(stem));\n }\n }\n }\n }\n }\n\n /**\n * Parse an {@link\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md\n * | ICU NumberFormatter skeleton} string into a {@link Skeleton} structure.\n *\n * @public\n * @param src - The skeleton string\n * @param onError - Called when the parser encounters a syntax error. The\n * function will still return a {@link Skeleton}, but it may not contain\n * information for all tokens. If not defined, the error will be thrown\n * instead.\n *\n * @example\n * ```js\n * import { parseNumberSkeleton } from '@messageformat/number-skeleton'\n *\n * parseNumberSkeleton('compact-short currency/GBP', console.error)\n * // {\n * // notation: { style: 'compact-short' },\n * // unit: { style: 'currency', currency: 'GBP' }\n * // }\n * ```\n */\n function parseNumberSkeleton(src) {\n let onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : error => {\n throw error;\n };\n const tokens = [];\n for (const part of src.split(' ')) {\n if (part) {\n const options = part.split('/');\n const stem = options.shift() || '';\n tokens.push({\n stem,\n options\n });\n }\n }\n const parser = new TokenParser(onError);\n for (const {\n stem,\n options\n } of tokens) {\n parser.parseToken(stem, options);\n }\n return parser.skeleton;\n }\n\n /**\n * Returns a number formatter function for the given locales and number skeleton\n *\n * @remarks\n * Uses `Intl.NumberFormat` (ES2020) internally.\n *\n * @public\n * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA`\n * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton\n * string, or a parsed `Skeleton` structure\n * @param currency - If `skeleton` is a pattern string that includes ¤ tokens,\n * their skeleton representation requires a three-letter currency code.\n * @param onError - If defined, will be called separately for each encountered\n * parsing error and unsupported feature.\n * @example\n * ```js\n * import { getNumberFormatter } from '@messageformat/number-skeleton'\n *\n * let src = ':: currency/CAD unit-width-narrow'\n * let fmt = getNumberFormatter('en-CA', src, console.error)\n * fmt(42) // '$42.00'\n *\n * src = '::percent scale/100'\n * fmt = getNumberFormatter('en', src, console.error)\n * fmt(0.3) // '30%'\n * ```\n */\n function getNumberFormatter(locales, skeleton, currency, onError) {\n if (typeof skeleton === 'string') {\n skeleton = skeleton.indexOf('::') === 0 ? parseNumberSkeleton(skeleton.slice(2), onError) : parseNumberPattern(skeleton, currency, onError);\n }\n const lc = getNumberFormatLocales(locales, skeleton);\n const opt = getNumberFormatOptions(skeleton, onError);\n const mod = getNumberFormatModifier(skeleton);\n const nf = new Intl.NumberFormat(lc, opt);\n if (skeleton.affix) {\n const [p0, p1] = skeleton.affix.pos;\n const [n0, n1] = skeleton.affix.neg || ['', ''];\n return value => {\n const n = nf.format(mod(value));\n return value < 0 ? `${n0}${n}${n1}` : `${p0}${n}${p1}`;\n };\n }\n return value => nf.format(mod(value));\n }\n /**\n * Returns a string of JavaScript source that evaluates to a number formatter\n * function with the same `(value: number) => string` signature as the function\n * returned by {@link getNumberFormatter}.\n *\n * @remarks\n * The returned function will memoize an `Intl.NumberFormat` instance.\n *\n * @public\n * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA`\n * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton\n * string, or a parsed `Skeleton` structure\n * @param currency - If `skeleton` is a pattern string that includes ¤ tokens,\n * their skeleton representation requires a three-letter currency code.\n * @param onError - If defined, will be called separately for each encountered\n * parsing error and unsupported feature.\n * @example\n * ```js\n * import { getNumberFormatterSource } from '@messageformat/number-skeleton'\n *\n * getNumberFormatterSource('en', '::percent', console.error)\n * // '(function() {\\n' +\n * // ' var opt = {\"style\":\"percent\"};\\n' +\n * // ' var nf = new Intl.NumberFormat([\"en\"], opt);\\n' +\n * // ' var mod = function(n) { return n * 0.01; };\\n' +\n * // ' return function(value) { return nf.format(mod(value)); }\\n' +\n * // '})()'\n *\n * const src = getNumberFormatterSource('en-CA', ':: currency/CAD unit-width-narrow', console.error)\n * // '(function() {\\n' +\n * // ' var opt = {\"style\":\"currency\",\"currency\":\"CAD\",\"currencyDisplay\":\"narrowSymbol\",\"unitDisplay\":\"narrow\"};\\n' +\n * // ' var nf = new Intl.NumberFormat([\"en-CA\"], opt);\\n'\n * // ' return function(value) { return nf.format(value); }\\n' +\n * // '})()'\n * const fmt = new Function(`return ${src}`)()\n * fmt(42) // '$42.00'\n * ```\n */\n function getNumberFormatterSource(locales, skeleton, currency, onError) {\n if (typeof skeleton === 'string') {\n skeleton = skeleton.indexOf('::') === 0 ? parseNumberSkeleton(skeleton.slice(2), onError) : parseNumberPattern(skeleton, currency, onError);\n }\n const lc = getNumberFormatLocales(locales, skeleton);\n const opt = getNumberFormatOptions(skeleton, onError);\n const modSrc = getNumberFormatModifierSource(skeleton);\n const lines = [`(function() {`, `var opt = ${JSON.stringify(opt)};`, `var nf = new Intl.NumberFormat(${JSON.stringify(lc)}, opt);`];\n let res = 'nf.format(value)';\n if (modSrc) {\n lines.push(`var mod = ${modSrc};`);\n res = 'nf.format(mod(value))';\n }\n if (skeleton.affix) {\n const [p0, p1] = skeleton.affix.pos.map(s => JSON.stringify(s));\n if (skeleton.affix.neg) {\n const [n0, n1] = skeleton.affix.neg.map(s => JSON.stringify(s));\n res = `value < 0 ? ${n0} + ${res} + ${n1} : ${p0} + ${res} + ${p1}`;\n } else {\n res = `${p0} + ${res} + ${p1}`;\n }\n }\n lines.push(`return function(value) { return ${res}; }`);\n return lines.join('\\n ') + '\\n})()';\n }\n var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n function getDefaultExportFromCjs(x) {\n return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n }\n var parser = {};\n var lexer = {};\n var moo = {\n exports: {}\n };\n (function (module) {\n (function (root, factory) {\n if (module.exports) {\n module.exports = factory();\n } else {\n root.moo = factory();\n }\n })(commonjsGlobal, function () {\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n var toString = Object.prototype.toString;\n var hasSticky = typeof new RegExp().sticky === 'boolean';\n\n /***************************************************************************/\n\n function isRegExp(o) {\n return o && toString.call(o) === '[object RegExp]';\n }\n function isObject(o) {\n return o && typeof o === 'object' && !isRegExp(o) && !Array.isArray(o);\n }\n function reEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n function reGroups(s) {\n var re = new RegExp('|' + s);\n return re.exec('').length - 1;\n }\n function reCapture(s) {\n return '(' + s + ')';\n }\n function reUnion(regexps) {\n if (!regexps.length) return '(?!)';\n var source = regexps.map(function (s) {\n return \"(?:\" + s + \")\";\n }).join('|');\n return \"(?:\" + source + \")\";\n }\n function regexpOrLiteral(obj) {\n if (typeof obj === 'string') {\n return '(?:' + reEscape(obj) + ')';\n } else if (isRegExp(obj)) {\n // TODO: consider /u support\n if (obj.ignoreCase) throw new Error('RegExp /i flag not allowed');\n if (obj.global) throw new Error('RegExp /g flag is implied');\n if (obj.sticky) throw new Error('RegExp /y flag is implied');\n if (obj.multiline) throw new Error('RegExp /m flag is implied');\n return obj.source;\n } else {\n throw new Error('Not a pattern: ' + obj);\n }\n }\n function pad(s, length) {\n if (s.length > length) {\n return s;\n }\n return Array(length - s.length + 1).join(\" \") + s;\n }\n function lastNLines(string, numLines) {\n var position = string.length;\n var lineBreaks = 0;\n while (true) {\n var idx = string.lastIndexOf(\"\\n\", position - 1);\n if (idx === -1) {\n break;\n } else {\n lineBreaks++;\n }\n position = idx;\n if (lineBreaks === numLines) {\n break;\n }\n if (position === 0) {\n break;\n }\n }\n var startPosition = lineBreaks < numLines ? 0 : position + 1;\n return string.substring(startPosition).split(\"\\n\");\n }\n function objectToRules(object) {\n var keys = Object.getOwnPropertyNames(object);\n var result = [];\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var thing = object[key];\n var rules = [].concat(thing);\n if (key === 'include') {\n for (var j = 0; j < rules.length; j++) {\n result.push({\n include: rules[j]\n });\n }\n continue;\n }\n var match = [];\n rules.forEach(function (rule) {\n if (isObject(rule)) {\n if (match.length) result.push(ruleOptions(key, match));\n result.push(ruleOptions(key, rule));\n match = [];\n } else {\n match.push(rule);\n }\n });\n if (match.length) result.push(ruleOptions(key, match));\n }\n return result;\n }\n function arrayToRules(array) {\n var result = [];\n for (var i = 0; i < array.length; i++) {\n var obj = array[i];\n if (obj.include) {\n var include = [].concat(obj.include);\n for (var j = 0; j < include.length; j++) {\n result.push({\n include: include[j]\n });\n }\n continue;\n }\n if (!obj.type) {\n throw new Error('Rule has no type: ' + JSON.stringify(obj));\n }\n result.push(ruleOptions(obj.type, obj));\n }\n return result;\n }\n function ruleOptions(type, obj) {\n if (!isObject(obj)) {\n obj = {\n match: obj\n };\n }\n if (obj.include) {\n throw new Error('Matching rules cannot also include states');\n }\n\n // nb. error and fallback imply lineBreaks\n var options = {\n defaultType: type,\n lineBreaks: !!obj.error || !!obj.fallback,\n pop: false,\n next: null,\n push: null,\n error: false,\n fallback: false,\n value: null,\n type: null,\n shouldThrow: false\n };\n\n // Avoid Object.assign(), so we support IE9+\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n options[key] = obj[key];\n }\n }\n\n // type transform cannot be a string\n if (typeof options.type === 'string' && type !== options.type) {\n throw new Error(\"Type transform cannot be a string (type '\" + options.type + \"' for token '\" + type + \"')\");\n }\n\n // convert to array\n var match = options.match;\n options.match = Array.isArray(match) ? match : match ? [match] : [];\n options.match.sort(function (a, b) {\n return isRegExp(a) && isRegExp(b) ? 0 : isRegExp(b) ? -1 : isRegExp(a) ? +1 : b.length - a.length;\n });\n return options;\n }\n function toRules(spec) {\n return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec);\n }\n var defaultErrorRule = ruleOptions('error', {\n lineBreaks: true,\n shouldThrow: true\n });\n function compileRules(rules, hasStates) {\n var errorRule = null;\n var fast = Object.create(null);\n var fastAllowed = true;\n var unicodeFlag = null;\n var groups = [];\n var parts = [];\n\n // If there is a fallback rule, then disable fast matching\n for (var i = 0; i < rules.length; i++) {\n if (rules[i].fallback) {\n fastAllowed = false;\n }\n }\n for (var i = 0; i < rules.length; i++) {\n var options = rules[i];\n if (options.include) {\n // all valid inclusions are removed by states() preprocessor\n throw new Error('Inheritance is not allowed in stateless lexers');\n }\n if (options.error || options.fallback) {\n // errorRule can only be set once\n if (errorRule) {\n if (!options.fallback === !errorRule.fallback) {\n throw new Error(\"Multiple \" + (options.fallback ? \"fallback\" : \"error\") + \" rules not allowed (for token '\" + options.defaultType + \"')\");\n } else {\n throw new Error(\"fallback and error are mutually exclusive (for token '\" + options.defaultType + \"')\");\n }\n }\n errorRule = options;\n }\n var match = options.match.slice();\n if (fastAllowed) {\n while (match.length && typeof match[0] === 'string' && match[0].length === 1) {\n var word = match.shift();\n fast[word.charCodeAt(0)] = options;\n }\n }\n\n // Warn about inappropriate state-switching options\n if (options.pop || options.push || options.next) {\n if (!hasStates) {\n throw new Error(\"State-switching options are not allowed in stateless lexers (for token '\" + options.defaultType + \"')\");\n }\n if (options.fallback) {\n throw new Error(\"State-switching options are not allowed on fallback tokens (for token '\" + options.defaultType + \"')\");\n }\n }\n\n // Only rules with a .match are included in the RegExp\n if (match.length === 0) {\n continue;\n }\n fastAllowed = false;\n groups.push(options);\n\n // Check unicode flag is used everywhere or nowhere\n for (var j = 0; j < match.length; j++) {\n var obj = match[j];\n if (!isRegExp(obj)) {\n continue;\n }\n if (unicodeFlag === null) {\n unicodeFlag = obj.unicode;\n } else if (unicodeFlag !== obj.unicode && options.fallback === false) {\n throw new Error('If one rule is /u then all must be');\n }\n }\n\n // convert to RegExp\n var pat = reUnion(match.map(regexpOrLiteral));\n\n // validate\n var regexp = new RegExp(pat);\n if (regexp.test(\"\")) {\n throw new Error(\"RegExp matches empty string: \" + regexp);\n }\n var groupCount = reGroups(pat);\n if (groupCount > 0) {\n throw new Error(\"RegExp has capture groups: \" + regexp + \"\\nUse (?: … ) instead\");\n }\n\n // try and detect rules matching newlines\n if (!options.lineBreaks && regexp.test('\\n')) {\n throw new Error('Rule should declare lineBreaks: ' + regexp);\n }\n\n // store regex\n parts.push(reCapture(pat));\n }\n\n // If there's no fallback rule, use the sticky flag so we only look for\n // matches at the current index.\n //\n // If we don't support the sticky flag, then fake it using an irrefutable\n // match (i.e. an empty pattern).\n var fallbackRule = errorRule && errorRule.fallback;\n var flags = hasSticky && !fallbackRule ? 'ym' : 'gm';\n var suffix = hasSticky || fallbackRule ? '' : '|';\n if (unicodeFlag === true) flags += \"u\";\n var combined = new RegExp(reUnion(parts) + suffix, flags);\n return {\n regexp: combined,\n groups: groups,\n fast: fast,\n error: errorRule || defaultErrorRule\n };\n }\n function compile(rules) {\n var result = compileRules(toRules(rules));\n return new Lexer({\n start: result\n }, 'start');\n }\n function checkStateGroup(g, name, map) {\n var state = g && (g.push || g.next);\n if (state && !map[state]) {\n throw new Error(\"Missing state '\" + state + \"' (in token '\" + g.defaultType + \"' of state '\" + name + \"')\");\n }\n if (g && g.pop && +g.pop !== 1) {\n throw new Error(\"pop must be 1 (in token '\" + g.defaultType + \"' of state '\" + name + \"')\");\n }\n }\n function compileStates(states, start) {\n var all = states.$all ? toRules(states.$all) : [];\n delete states.$all;\n var keys = Object.getOwnPropertyNames(states);\n if (!start) start = keys[0];\n var ruleMap = Object.create(null);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n ruleMap[key] = toRules(states[key]).concat(all);\n }\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var rules = ruleMap[key];\n var included = Object.create(null);\n for (var j = 0; j < rules.length; j++) {\n var rule = rules[j];\n if (!rule.include) continue;\n var splice = [j, 1];\n if (rule.include !== key && !included[rule.include]) {\n included[rule.include] = true;\n var newRules = ruleMap[rule.include];\n if (!newRules) {\n throw new Error(\"Cannot include nonexistent state '\" + rule.include + \"' (in state '\" + key + \"')\");\n }\n for (var k = 0; k < newRules.length; k++) {\n var newRule = newRules[k];\n if (rules.indexOf(newRule) !== -1) continue;\n splice.push(newRule);\n }\n }\n rules.splice.apply(rules, splice);\n j--;\n }\n }\n var map = Object.create(null);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key] = compileRules(ruleMap[key], true);\n }\n for (var i = 0; i < keys.length; i++) {\n var name = keys[i];\n var state = map[name];\n var groups = state.groups;\n for (var j = 0; j < groups.length; j++) {\n checkStateGroup(groups[j], name, map);\n }\n var fastKeys = Object.getOwnPropertyNames(state.fast);\n for (var j = 0; j < fastKeys.length; j++) {\n checkStateGroup(state.fast[fastKeys[j]], name, map);\n }\n }\n return new Lexer(map, start);\n }\n function keywordTransform(map) {\n // Use a JavaScript Map to map keywords to their corresponding token type\n // unless Map is unsupported, then fall back to using an Object:\n var isMap = typeof Map !== 'undefined';\n var reverseMap = isMap ? new Map() : Object.create(null);\n var types = Object.getOwnPropertyNames(map);\n for (var i = 0; i < types.length; i++) {\n var tokenType = types[i];\n var item = map[tokenType];\n var keywordList = Array.isArray(item) ? item : [item];\n keywordList.forEach(function (keyword) {\n if (typeof keyword !== 'string') {\n throw new Error(\"keyword must be string (in keyword '\" + tokenType + \"')\");\n }\n if (isMap) {\n reverseMap.set(keyword, tokenType);\n } else {\n reverseMap[keyword] = tokenType;\n }\n });\n }\n return function (k) {\n return isMap ? reverseMap.get(k) : reverseMap[k];\n };\n }\n\n /***************************************************************************/\n\n var Lexer = function (states, state) {\n this.startState = state;\n this.states = states;\n this.buffer = '';\n this.stack = [];\n this.reset();\n };\n Lexer.prototype.reset = function (data, info) {\n this.buffer = data || '';\n this.index = 0;\n this.line = info ? info.line : 1;\n this.col = info ? info.col : 1;\n this.queuedToken = info ? info.queuedToken : null;\n this.queuedText = info ? info.queuedText : \"\";\n this.queuedThrow = info ? info.queuedThrow : null;\n this.setState(info ? info.state : this.startState);\n this.stack = info && info.stack ? info.stack.slice() : [];\n return this;\n };\n Lexer.prototype.save = function () {\n return {\n line: this.line,\n col: this.col,\n state: this.state,\n stack: this.stack.slice(),\n queuedToken: this.queuedToken,\n queuedText: this.queuedText,\n queuedThrow: this.queuedThrow\n };\n };\n Lexer.prototype.setState = function (state) {\n if (!state || this.state === state) return;\n this.state = state;\n var info = this.states[state];\n this.groups = info.groups;\n this.error = info.error;\n this.re = info.regexp;\n this.fast = info.fast;\n };\n Lexer.prototype.popState = function () {\n this.setState(this.stack.pop());\n };\n Lexer.prototype.pushState = function (state) {\n this.stack.push(this.state);\n this.setState(state);\n };\n var eat = hasSticky ? function (re, buffer) {\n // assume re is /y\n return re.exec(buffer);\n } : function (re, buffer) {\n // assume re is /g\n var match = re.exec(buffer);\n // will always match, since we used the |(?:) trick\n if (match[0].length === 0) {\n return null;\n }\n return match;\n };\n Lexer.prototype._getGroup = function (match) {\n var groupCount = this.groups.length;\n for (var i = 0; i < groupCount; i++) {\n if (match[i + 1] !== undefined) {\n return this.groups[i];\n }\n }\n throw new Error('Cannot find token type for matched text');\n };\n function tokenToString() {\n return this.value;\n }\n Lexer.prototype.next = function () {\n var index = this.index;\n\n // If a fallback token matched, we don't need to re-run the RegExp\n if (this.queuedGroup) {\n var token = this._token(this.queuedGroup, this.queuedText, index);\n this.queuedGroup = null;\n this.queuedText = \"\";\n return token;\n }\n var buffer = this.buffer;\n if (index === buffer.length) {\n return; // EOF\n }\n\n // Fast matching for single characters\n var group = this.fast[buffer.charCodeAt(index)];\n if (group) {\n return this._token(group, buffer.charAt(index), index);\n }\n\n // Execute RegExp\n var re = this.re;\n re.lastIndex = index;\n var match = eat(re, buffer);\n\n // Error tokens match the remaining buffer\n var error = this.error;\n if (match == null) {\n return this._token(error, buffer.slice(index, buffer.length), index);\n }\n var group = this._getGroup(match);\n var text = match[0];\n if (error.fallback && match.index !== index) {\n this.queuedGroup = group;\n this.queuedText = text;\n\n // Fallback tokens contain the unmatched portion of the buffer\n return this._token(error, buffer.slice(index, match.index), index);\n }\n return this._token(group, text, index);\n };\n Lexer.prototype._token = function (group, text, offset) {\n // count line breaks\n var lineBreaks = 0;\n if (group.lineBreaks) {\n var matchNL = /\\n/g;\n var nl = 1;\n if (text === '\\n') {\n lineBreaks = 1;\n } else {\n while (matchNL.exec(text)) {\n lineBreaks++;\n nl = matchNL.lastIndex;\n }\n }\n }\n var token = {\n type: typeof group.type === 'function' && group.type(text) || group.defaultType,\n value: typeof group.value === 'function' ? group.value(text) : text,\n text: text,\n toString: tokenToString,\n offset: offset,\n lineBreaks: lineBreaks,\n line: this.line,\n col: this.col\n };\n // nb. adding more props to token object will make V8 sad!\n\n var size = text.length;\n this.index += size;\n this.line += lineBreaks;\n if (lineBreaks !== 0) {\n this.col = size - nl + 1;\n } else {\n this.col += size;\n }\n\n // throw, if no rule with {error: true}\n if (group.shouldThrow) {\n var err = new Error(this.formatError(token, \"invalid syntax\"));\n throw err;\n }\n if (group.pop) this.popState();else if (group.push) this.pushState(group.push);else if (group.next) this.setState(group.next);\n return token;\n };\n if (typeof Symbol !== 'undefined' && Symbol.iterator) {\n var LexerIterator = function (lexer) {\n this.lexer = lexer;\n };\n LexerIterator.prototype.next = function () {\n var token = this.lexer.next();\n return {\n value: token,\n done: !token\n };\n };\n LexerIterator.prototype[Symbol.iterator] = function () {\n return this;\n };\n Lexer.prototype[Symbol.iterator] = function () {\n return new LexerIterator(this);\n };\n }\n Lexer.prototype.formatError = function (token, message) {\n if (token == null) {\n // An undefined token indicates EOF\n var text = this.buffer.slice(this.index);\n var token = {\n text: text,\n offset: this.index,\n lineBreaks: text.indexOf('\\n') === -1 ? 0 : 1,\n line: this.line,\n col: this.col\n };\n }\n var numLinesAround = 2;\n var firstDisplayedLine = Math.max(token.line - numLinesAround, 1);\n var lastDisplayedLine = token.line + numLinesAround;\n var lastLineDigits = String(lastDisplayedLine).length;\n var displayedLines = lastNLines(this.buffer, this.line - token.line + numLinesAround + 1).slice(0, 5);\n var errorLines = [];\n errorLines.push(message + \" at line \" + token.line + \" col \" + token.col + \":\");\n errorLines.push(\"\");\n for (var i = 0; i < displayedLines.length; i++) {\n var line = displayedLines[i];\n var lineNo = firstDisplayedLine + i;\n errorLines.push(pad(String(lineNo), lastLineDigits) + \" \" + line);\n if (lineNo === token.line) {\n errorLines.push(pad(\"\", lastLineDigits + token.col + 1) + \"^\");\n }\n }\n return errorLines.join(\"\\n\");\n };\n Lexer.prototype.clone = function () {\n return new Lexer(this.states, this.state);\n };\n Lexer.prototype.has = function (tokenType) {\n return true;\n };\n return {\n compile: compile,\n states: compileStates,\n error: Object.freeze({\n error: true\n }),\n fallback: Object.freeze({\n fallback: true\n }),\n keywords: keywordTransform\n };\n });\n })(moo);\n var mooExports = moo.exports;\n (function (exports) {\n var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n };\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.lexer = exports.states = void 0;\n const moo_1 = __importDefault(mooExports);\n exports.states = {\n body: {\n doubleapos: {\n match: \"''\",\n value: () => \"'\"\n },\n quoted: {\n lineBreaks: true,\n match: /'[{}#](?:[^]*?[^'])?'(?!')/u,\n value: src => src.slice(1, -1).replace(/''/g, \"'\")\n },\n argument: {\n lineBreaks: true,\n match: /\\{\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*/u,\n push: 'arg',\n value: src => src.substring(1).trim()\n },\n octothorpe: '#',\n end: {\n match: '}',\n pop: 1\n },\n content: {\n lineBreaks: true,\n match: /[^][^{}#']*/u\n }\n },\n arg: {\n select: {\n lineBreaks: true,\n match: /,\\s*(?:plural|select|selectordinal)\\s*,\\s*/u,\n next: 'select',\n value: src => src.split(',')[1].trim()\n },\n 'func-args': {\n lineBreaks: true,\n match: /,\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*,/u,\n next: 'body',\n value: src => src.split(',')[1].trim()\n },\n 'func-simple': {\n lineBreaks: true,\n match: /,\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*/u,\n value: src => src.substring(1).trim()\n },\n end: {\n match: '}',\n pop: 1\n }\n },\n select: {\n offset: {\n lineBreaks: true,\n match: /\\s*offset\\s*:\\s*\\d+\\s*/u,\n value: src => src.split(':')[1].trim()\n },\n case: {\n lineBreaks: true,\n match: /\\s*(?:=\\d+|[^\\p{Pat_Syn}\\p{Pat_WS}]+)\\s*\\{/u,\n push: 'body',\n value: src => src.substring(0, src.indexOf('{')).trim()\n },\n end: {\n match: /\\s*\\}/u,\n pop: 1\n }\n }\n };\n exports.lexer = moo_1.default.states(exports.states);\n })(lexer);\n\n /**\n * An AST parser for ICU MessageFormat strings\n *\n * @packageDocumentation\n * @example\n * ```\n * import { parse } from '@messageformat/parser\n *\n * parse('So {wow}.')\n * [ { type: 'content', value: 'So ' },\n * { type: 'argument', arg: 'wow' },\n * { type: 'content', value: '.' } ]\n *\n *\n * parse('Such { thing }. { count, selectordinal, one {First} two {Second}' +\n * ' few {Third} other {#th} } word.')\n * [ { type: 'content', value: 'Such ' },\n * { type: 'argument', arg: 'thing' },\n * { type: 'content', value: '. ' },\n * { type: 'selectordinal',\n * arg: 'count',\n * cases: [\n * { key: 'one', tokens: [ { type: 'content', value: 'First' } ] },\n * { key: 'two', tokens: [ { type: 'content', value: 'Second' } ] },\n * { key: 'few', tokens: [ { type: 'content', value: 'Third' } ] },\n * { key: 'other',\n * tokens: [ { type: 'octothorpe' }, { type: 'content', value: 'th' } ] }\n * ] },\n * { type: 'content', value: ' word.' } ]\n *\n *\n * parse('Many{type,select,plural{ numbers}selectordinal{ counting}' +\n * 'select{ choices}other{ some {type}}}.')\n * [ { type: 'content', value: 'Many' },\n * { type: 'select',\n * arg: 'type',\n * cases: [\n * { key: 'plural', tokens: [ { type: 'content', value: 'numbers' } ] },\n * { key: 'selectordinal', tokens: [ { type: 'content', value: 'counting' } ] },\n * { key: 'select', tokens: [ { type: 'content', value: 'choices' } ] },\n * { key: 'other',\n * tokens: [ { type: 'content', value: 'some ' }, { type: 'argument', arg: 'type' } ] }\n * ] },\n * { type: 'content', value: '.' } ]\n *\n *\n * parse('{Such compliance')\n * // ParseError: invalid syntax at line 1 col 7:\n * //\n * // {Such compliance\n * // ^\n *\n *\n * const msg = '{words, plural, zero{No words} one{One word} other{# words}}'\n * parse(msg)\n * [ { type: 'plural',\n * arg: 'words',\n * cases: [\n * { key: 'zero', tokens: [ { type: 'content', value: 'No words' } ] },\n * { key: 'one', tokens: [ { type: 'content', value: 'One word' } ] },\n * { key: 'other',\n * tokens: [ { type: 'octothorpe' }, { type: 'content', value: ' words' } ] }\n * ] } ]\n *\n *\n * parse(msg, { cardinal: [ 'one', 'other' ], ordinal: [ 'one', 'two', 'few', 'other' ] })\n * // ParseError: The plural case zero is not valid in this locale at line 1 col 17:\n * //\n * // {words, plural, zero{\n * // ^\n * ```\n */\n Object.defineProperty(parser, \"__esModule\", {\n value: true\n });\n var parse_1 = parser.parse = parser.ParseError = void 0;\n const lexer_js_1 = lexer;\n const getContext = lt => ({\n offset: lt.offset,\n line: lt.line,\n col: lt.col,\n text: lt.text,\n lineBreaks: lt.lineBreaks\n });\n const isSelectType = type => type === 'plural' || type === 'select' || type === 'selectordinal';\n function strictArgStyleParam(lt, param) {\n let value = '';\n let text = '';\n for (const p of param) {\n const pText = p.ctx.text;\n text += pText;\n switch (p.type) {\n case 'content':\n value += p.value;\n break;\n case 'argument':\n case 'function':\n case 'octothorpe':\n value += pText;\n break;\n default:\n throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`);\n }\n }\n const c = {\n type: 'content',\n value: value.trim(),\n ctx: Object.assign({}, param[0].ctx, {\n text\n })\n };\n return [c];\n }\n const strictArgTypes = ['number', 'date', 'time', 'spellout', 'ordinal', 'duration'];\n const defaultPluralKeys = ['zero', 'one', 'two', 'few', 'many', 'other'];\n /**\n * Thrown by {@link parse} on error\n *\n * @public\n */\n class ParseError extends Error {\n /** @internal */\n constructor(lt, msg) {\n super(lexer_js_1.lexer.formatError(lt, msg));\n }\n }\n parser.ParseError = ParseError;\n class Parser {\n constructor(src, opt) {\n var _a, _b, _c, _d;\n this.lexer = lexer_js_1.lexer.reset(src);\n this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys;\n this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys;\n this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false;\n this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true;\n }\n parse() {\n return this.parseBody(false, true);\n }\n checkSelectKey(lt, type, key) {\n if (key[0] === '=') {\n if (type === 'select') {\n throw new ParseError(lt, `The case ${key} is not valid with select`);\n }\n } else if (type !== 'select') {\n const keys = type === 'plural' ? this.cardinalKeys : this.ordinalKeys;\n if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {\n const msg = `The ${type} case ${key} is not valid in this locale`;\n throw new ParseError(lt, msg);\n }\n }\n }\n parseSelect(_ref, inPlural, ctx, type) {\n let {\n value: arg\n } = _ref;\n const sel = {\n type,\n arg,\n cases: [],\n ctx\n };\n if (type === 'plural' || type === 'selectordinal') inPlural = true;else if (this.strict) inPlural = false;\n for (const lt of this.lexer) {\n switch (lt.type) {\n case 'offset':\n if (type === 'select') {\n throw new ParseError(lt, 'Unexpected plural offset for select');\n }\n if (sel.cases.length > 0) {\n throw new ParseError(lt, 'Plural offset must be set before cases');\n }\n sel.pluralOffset = Number(lt.value);\n ctx.text += lt.text;\n ctx.lineBreaks += lt.lineBreaks;\n break;\n case 'case':\n {\n this.checkSelectKey(lt, type, lt.value);\n sel.cases.push({\n key: lt.value,\n tokens: this.parseBody(inPlural),\n ctx: getContext(lt)\n });\n break;\n }\n case 'end':\n return sel;\n /* istanbul ignore next: never happens */\n default:\n throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`);\n }\n }\n throw new ParseError(null, 'Unexpected message end');\n }\n parseArgToken(lt, inPlural) {\n const ctx = getContext(lt);\n const argType = this.lexer.next();\n if (!argType) throw new ParseError(null, 'Unexpected message end');\n ctx.text += argType.text;\n ctx.lineBreaks += argType.lineBreaks;\n if (this.strict && (argType.type === 'func-simple' || argType.type === 'func-args') && !strictArgTypes.includes(argType.value)) {\n const msg = `Invalid strict mode function arg type: ${argType.value}`;\n throw new ParseError(lt, msg);\n }\n switch (argType.type) {\n case 'end':\n return {\n type: 'argument',\n arg: lt.value,\n ctx\n };\n case 'func-simple':\n {\n const end = this.lexer.next();\n if (!end) throw new ParseError(null, 'Unexpected message end');\n /* istanbul ignore if: never happens */\n if (end.type !== 'end') {\n throw new ParseError(end, `Unexpected lexer token: ${end.type}`);\n }\n ctx.text += end.text;\n if (isSelectType(argType.value.toLowerCase())) {\n throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);\n }\n return {\n type: 'function',\n arg: lt.value,\n key: argType.value,\n ctx\n };\n }\n case 'func-args':\n {\n if (isSelectType(argType.value.toLowerCase())) {\n const msg = `Invalid type identifier: ${argType.value}`;\n throw new ParseError(argType, msg);\n }\n let param = this.parseBody(this.strict ? false : inPlural);\n if (this.strict && param.length > 0) {\n param = strictArgStyleParam(lt, param);\n }\n return {\n type: 'function',\n arg: lt.value,\n key: argType.value,\n param,\n ctx\n };\n }\n case 'select':\n /* istanbul ignore else: never happens */\n if (isSelectType(argType.value)) {\n return this.parseSelect(lt, inPlural, ctx, argType.value);\n } else {\n throw new ParseError(argType, `Unexpected select type ${argType.value}`);\n }\n /* istanbul ignore next: never happens */\n default:\n throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);\n }\n }\n parseBody(inPlural, atRoot) {\n const tokens = [];\n let content = null;\n for (const lt of this.lexer) {\n if (lt.type === 'argument') {\n if (content) content = null;\n tokens.push(this.parseArgToken(lt, inPlural));\n } else if (lt.type === 'octothorpe' && inPlural) {\n if (content) content = null;\n tokens.push({\n type: 'octothorpe',\n ctx: getContext(lt)\n });\n } else if (lt.type === 'end' && !atRoot) {\n return tokens;\n } else {\n let value = lt.value;\n if (!inPlural && lt.type === 'quoted' && value[0] === '#') {\n if (value.includes('{')) {\n const errMsg = `Unsupported escape pattern: ${value}`;\n throw new ParseError(lt, errMsg);\n }\n value = lt.text;\n }\n if (content) {\n content.value += value;\n content.ctx.text += lt.text;\n content.ctx.lineBreaks += lt.lineBreaks;\n } else {\n content = {\n type: 'content',\n value,\n ctx: getContext(lt)\n };\n tokens.push(content);\n }\n }\n }\n if (atRoot) return tokens;\n throw new ParseError(null, 'Unexpected message end');\n }\n }\n /**\n * Parse an input string into an array of tokens\n *\n * @public\n * @remarks\n * The parser only supports the default `DOUBLE_OPTIONAL`\n * {@link http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b | apostrophe mode}.\n */\n function parse(src) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const parser = new Parser(src, options);\n return parser.parse();\n }\n parse_1 = parser.parse = parse;\n\n /**\n * A set of utility functions that are called by the compiled Javascript\n * functions, these are included locally in the output of {@link MessageFormat.compile compile()}.\n */\n /** @private */\n function _nf$1(lc) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return _nf$1[lc] || (_nf$1[lc] = new Intl.NumberFormat(lc));\n }\n /**\n * Utility function for `#` in plural rules\n *\n * @param lc The current locale\n * @param value The value to operate on\n * @param offset An offset, set by the surrounding context\n * @returns The result of applying the offset to the input value\n */\n function number(lc, value, offset) {\n return _nf$1(lc).format(value - offset);\n }\n /**\n * Strict utility function for `#` in plural rules\n *\n * Will throw an Error if `value` or `offset` are non-numeric.\n *\n * @param lc The current locale\n * @param value The value to operate on\n * @param offset An offset, set by the surrounding context\n * @param name The name of the argument, used for error reporting\n * @returns The result of applying the offset to the input value\n */\n function strictNumber(lc, value, offset, name) {\n var n = value - offset;\n if (isNaN(n)) throw new Error('`' + name + '` or its offset is not a number');\n return _nf$1(lc).format(n);\n }\n /**\n * Utility function for `{N, plural|selectordinal, ...}`\n *\n * @param value The key to use to find a pluralization rule\n * @param offset An offset to apply to `value`\n * @param lcfunc A locale function from `pluralFuncs`\n * @param data The object from which results are looked up\n * @param isOrdinal If true, use ordinal rather than cardinal rules\n * @returns The result of the pluralization\n */\n function plural(value, offset, lcfunc, data, isOrdinal) {\n if ({}.hasOwnProperty.call(data, value)) return data[value];\n if (offset) value -= offset;\n var key = lcfunc(value, isOrdinal);\n return key in data ? data[key] : data.other;\n }\n /**\n * Utility function for `{N, select, ...}`\n *\n * @param value The key to use to find a selection\n * @param data The object from which results are looked up\n * @returns The result of the select statement\n */\n function select(value, data) {\n return {}.hasOwnProperty.call(data, value) ? data[value] : data.other;\n }\n /**\n * Checks that all required arguments are set to defined values\n *\n * Throws on failure; otherwise returns undefined\n *\n * @param keys The required keys\n * @param data The data object being checked\n */\n function reqArgs(keys, data) {\n for (var i = 0; i < keys.length; ++i) {\n if (!data || data[keys[i]] === undefined) {\n throw new Error(\"Message requires argument '\".concat(keys[i], \"'\"));\n }\n }\n }\n var Runtime = /*#__PURE__*/Object.freeze({\n __proto__: null,\n _nf: _nf$1,\n number: number,\n plural: plural,\n reqArgs: reqArgs,\n select: select,\n strictNumber: strictNumber\n });\n\n /**\n * Represent a date as a short/default/long/full string\n *\n * @param value Either a Unix epoch time in milliseconds, or a string value\n * representing a date. Parsed with `new Date(value)`\n *\n * @example\n * ```js\n * var mf = new MessageFormat(['en', 'fi']);\n *\n * mf.compile('Today is {T, date}')({ T: Date.now() })\n * // 'Today is Feb 21, 2016'\n *\n * mf.compile('Tänään on {T, date}', 'fi')({ T: Date.now() })\n * // 'Tänään on 21. helmikuuta 2016'\n *\n * mf.compile('Unix time started on {T, date, full}')({ T: 0 })\n * // 'Unix time started on Thursday, January 1, 1970'\n *\n * var cf = mf.compile('{sys} became operational on {d0, date, short}');\n * cf({ sys: 'HAL 9000', d0: '12 January 1999' })\n * // 'HAL 9000 became operational on 1/12/1999'\n * ```\n */\n function date(value, lc, size) {\n var o = {\n day: 'numeric',\n month: 'short',\n year: 'numeric'\n };\n /* eslint-disable no-fallthrough */\n switch (size) {\n case 'full':\n o.weekday = 'long';\n case 'long':\n o.month = 'long';\n break;\n case 'short':\n o.month = 'numeric';\n }\n return new Date(value).toLocaleDateString(lc, o);\n }\n\n /**\n * Represent a duration in seconds as a string\n *\n * @param value A finite number, or its string representation\n * @return Includes one or two `:` separators, and matches the pattern\n * `hhhh:mm:ss`, possibly with a leading `-` for negative values and a\n * trailing `.sss` part for non-integer input\n *\n * @example\n * ```js\n * var mf = new MessageFormat();\n *\n * mf.compile('It has been {D, duration}')({ D: 123 })\n * // 'It has been 2:03'\n *\n * mf.compile('Countdown: {D, duration}')({ D: -151200.42 })\n * // 'Countdown: -42:00:00.420'\n * ```\n */\n function duration(value) {\n if (typeof value !== 'number') value = Number(value);\n if (!isFinite(value)) return String(value);\n var sign = '';\n if (value < 0) {\n sign = '-';\n value = Math.abs(value);\n } else {\n value = Number(value);\n }\n var sec = value % 60;\n var parts = [Math.round(sec) === sec ? sec : sec.toFixed(3)];\n if (value < 60) {\n parts.unshift(0); // at least one : is required\n } else {\n value = Math.round((value - Number(parts[0])) / 60);\n parts.unshift(value % 60); // minutes\n if (value >= 60) {\n value = Math.round((value - Number(parts[0])) / 60);\n parts.unshift(value); // hours\n }\n }\n var first = parts.shift();\n return sign + first + ':' + parts.map(function (n) {\n return Number(n) < 10 ? '0' + String(n) : String(n);\n }).join(':');\n }\n\n /**\n * Represent a number as an integer, percent or currency value\n *\n * Available in MessageFormat strings as `{VAR, number, integer|percent|currency}`.\n * Internally, calls Intl.NumberFormat with appropriate parameters. `currency` will\n * default to USD; to change, set `MessageFormat#currency` to the appropriate\n * three-letter currency code, or use the `currency:EUR` form of the argument.\n *\n * @example\n * ```js\n * var mf = new MessageFormat('en', { currency: 'EUR'});\n *\n * mf.compile('{N} is almost {N, number, integer}')({ N: 3.14 })\n * // '3.14 is almost 3'\n *\n * mf.compile('{P, number, percent} complete')({ P: 0.99 })\n * // '99% complete'\n *\n * mf.compile('The total is {V, number, currency}.')({ V: 5.5 })\n * // 'The total is €5.50.'\n *\n * mf.compile('The total is {V, number, currency:GBP}.')({ V: 5.5 })\n * // 'The total is £5.50.'\n * ```\n */\n var _nf = {};\n function nf(lc, opt) {\n var key = String(lc) + JSON.stringify(opt);\n if (!_nf[key]) _nf[key] = new Intl.NumberFormat(lc, opt);\n return _nf[key];\n }\n function numberFmt(value, lc, arg, defaultCurrency) {\n var _a = arg && arg.split(':') || [],\n type = _a[0],\n currency = _a[1];\n var opt = {\n integer: {\n maximumFractionDigits: 0\n },\n percent: {\n style: 'percent'\n },\n currency: {\n style: 'currency',\n currency: currency && currency.trim() || defaultCurrency,\n minimumFractionDigits: 2,\n maximumFractionDigits: 2\n }\n };\n return nf(lc, opt[type] || {}).format(value);\n }\n var numberCurrency = function (value, lc, arg) {\n return nf(lc, {\n style: 'currency',\n currency: arg,\n minimumFractionDigits: 2,\n maximumFractionDigits: 2\n }).format(value);\n };\n var numberInteger = function (value, lc) {\n return nf(lc, {\n maximumFractionDigits: 0\n }).format(value);\n };\n var numberPercent = function (value, lc) {\n return nf(lc, {\n style: 'percent'\n }).format(value);\n };\n\n /**\n * Represent a time as a short/default/long string\n *\n * @param value Either a Unix epoch time in milliseconds, or a string value\n * representing a date. Parsed with `new Date(value)`\n *\n * @example\n * ```js\n * var mf = new MessageFormat(['en', 'fi']);\n *\n * mf.compile('The time is now {T, time}')({ T: Date.now() })\n * // 'The time is now 11:26:35 PM'\n *\n * mf.compile('Kello on nyt {T, time}', 'fi')({ T: Date.now() })\n * // 'Kello on nyt 23.26.35'\n *\n * var cf = mf.compile('The Eagle landed at {T, time, full} on {T, date, full}');\n * cf({ T: '1969-07-20 20:17:40 UTC' })\n * // 'The Eagle landed at 10:17:40 PM GMT+2 on Sunday, July 20, 1969'\n * ```\n */\n function time(value, lc, size) {\n var o = {\n second: 'numeric',\n minute: 'numeric',\n hour: 'numeric'\n };\n /* eslint-disable no-fallthrough */\n switch (size) {\n case 'full':\n case 'long':\n o.timeZoneName = 'short';\n break;\n case 'short':\n delete o.second;\n }\n return new Date(value).toLocaleTimeString(lc, o);\n }\n var Formatters = /*#__PURE__*/Object.freeze({\n __proto__: null,\n date: date,\n duration: duration,\n numberCurrency: numberCurrency,\n numberFmt: numberFmt,\n numberInteger: numberInteger,\n numberPercent: numberPercent,\n time: time\n });\n const ES3 = {\n break: true,\n continue: true,\n delete: true,\n else: true,\n for: true,\n function: true,\n if: true,\n in: true,\n new: true,\n return: true,\n this: true,\n typeof: true,\n var: true,\n void: true,\n while: true,\n with: true,\n case: true,\n catch: true,\n default: true,\n do: true,\n finally: true,\n instanceof: true,\n switch: true,\n throw: true,\n try: true\n };\n const ESnext = {\n // in addition to reservedES3\n await: true,\n debugger: true,\n class: true,\n enum: true,\n extends: true,\n super: true,\n const: true,\n export: true,\n import: true,\n null: true,\n true: true,\n false: true,\n implements: true,\n let: true,\n private: true,\n public: true,\n yield: true,\n interface: true,\n package: true,\n protected: true,\n static: true\n };\n var reserved = {\n ES3,\n ESnext\n };\n var reserved$1 = /*@__PURE__*/getDefaultExportFromCjs(reserved);\n\n // from https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n function hashCode(str) {\n let hash = 0;\n for (let i = 0; i < str.length; ++i) {\n const char = str.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n }\n function identifier(key, unique) {\n if (unique) key += ' ' + hashCode(key).toString(36);\n const id = key.trim().replace(/\\W+/g, '_');\n return reserved$1.ES3[id] || reserved$1.ESnext[id] || /^\\d/.test(id) ? '_' + id : id;\n }\n function property(obj, key) {\n if (/^[A-Z_$][0-9A-Z_$]*$/i.test(key) && !reserved$1.ES3[key]) {\n return obj ? obj + '.' + key : key;\n } else {\n const jkey = JSON.stringify(key);\n return obj ? obj + '[' + jkey + ']' : jkey;\n }\n }\n var rtlLanguages = ['ar', 'ckb', 'fa', 'he', 'ks($|[^bfh])', 'lrc', 'mzn', 'pa-Arab', 'ps', 'ug', 'ur', 'uz-Arab', 'yi'];\n var rtlRegExp = new RegExp('^' + rtlLanguages.join('|^'));\n function biDiMarkText(text, locale) {\n var isLocaleRTL = rtlRegExp.test(locale);\n var mark = JSON.stringify(isLocaleRTL ? '\\u200F' : '\\u200E');\n return \"\".concat(mark, \" + \").concat(text, \" + \").concat(mark);\n }\n var RUNTIME_MODULE = '@messageformat/runtime';\n var CARDINAL_MODULE = '@messageformat/runtime/lib/cardinals';\n var PLURAL_MODULE = '@messageformat/runtime/lib/plurals';\n var FORMATTER_MODULE = '@messageformat/runtime/lib/formatters';\n var Compiler = function () {\n function Compiler(options) {\n this.arguments = [];\n this.runtime = {};\n this.options = options;\n }\n Compiler.prototype.compile = function (src, plural, plurals) {\n var e_1, _a;\n var _this = this;\n var _b = this.options,\n localeCodeFromKey = _b.localeCodeFromKey,\n requireAllArguments = _b.requireAllArguments,\n strict = _b.strict,\n strictPluralKeys = _b.strictPluralKeys;\n if (typeof src === 'object') {\n var result = {};\n try {\n for (var _c = __values(Object.keys(src)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var key = _d.value;\n var lc = localeCodeFromKey ? localeCodeFromKey(key) : key;\n var pl = plurals && lc && plurals[lc] || plural;\n result[key] = this.compile(src[key], pl, plurals);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n return result;\n }\n this.plural = plural;\n var parserOptions = {\n cardinal: plural.cardinals,\n ordinal: plural.ordinals,\n strict: strict,\n strictPluralKeys: strictPluralKeys\n };\n this.arguments = [];\n var r = parse_1(src, parserOptions).map(function (token) {\n return _this.token(token, null);\n });\n var hasArgs = this.arguments.length > 0;\n var res = this.concatenate(r, true);\n if (requireAllArguments && hasArgs) {\n this.setRuntimeFn('reqArgs');\n var reqArgs = JSON.stringify(this.arguments);\n return \"(d) => { reqArgs(\".concat(reqArgs, \", d); return \").concat(res, \"; }\");\n }\n return \"(\".concat(hasArgs ? 'd' : '', \") => \").concat(res);\n };\n Compiler.prototype.cases = function (token, pluralToken) {\n var _this = this;\n var needOther = true;\n var r = token.cases.map(function (_a) {\n var key = _a.key,\n tokens = _a.tokens;\n if (key === 'other') needOther = false;\n var s = tokens.map(function (tok) {\n return _this.token(tok, pluralToken);\n });\n return \"\".concat(property(null, key.replace(/^=/, '')), \": \").concat(_this.concatenate(s, false));\n });\n if (needOther) {\n var type = token.type;\n var _a = this.plural,\n cardinals = _a.cardinals,\n ordinals = _a.ordinals;\n if (type === 'select' || type === 'plural' && cardinals.includes('other') || type === 'selectordinal' && ordinals.includes('other')) {\n throw new Error(\"No 'other' form found in \".concat(JSON.stringify(token)));\n }\n }\n return \"{ \".concat(r.join(', '), \" }\");\n };\n Compiler.prototype.concatenate = function (tokens, root) {\n var asValues = this.options.returnType === 'values';\n return asValues && (root || tokens.length > 1) ? '[' + tokens.join(', ') + ']' : tokens.join(' + ') || '\"\"';\n };\n Compiler.prototype.token = function (token, pluralToken) {\n if (token.type === 'content') return JSON.stringify(token.value);\n var _a = this.plural,\n id = _a.id,\n lc = _a.lc;\n var args, fn;\n if ('arg' in token) {\n this.arguments.push(token.arg);\n args = [property('d', token.arg)];\n } else {\n args = [];\n }\n switch (token.type) {\n case 'argument':\n return this.options.biDiSupport ? biDiMarkText(String(args[0]), lc) : String(args[0]);\n case 'select':\n fn = 'select';\n if (pluralToken && this.options.strict) pluralToken = null;\n args.push(this.cases(token, pluralToken));\n this.setRuntimeFn('select');\n break;\n case 'selectordinal':\n fn = 'plural';\n args.push(token.pluralOffset || 0, id, this.cases(token, token), 1);\n this.setLocale(id, true);\n this.setRuntimeFn('plural');\n break;\n case 'plural':\n fn = 'plural';\n args.push(token.pluralOffset || 0, id, this.cases(token, token));\n this.setLocale(id, false);\n this.setRuntimeFn('plural');\n break;\n case 'function':\n {\n var formatter = this.options.customFormatters[token.key];\n var isModuleFn = formatter && 'module' in formatter && typeof formatter.module === 'function';\n if (!formatter) {\n if (token.key === 'date') {\n fn = this.setDateFormatter(token, args, pluralToken);\n break;\n } else if (token.key === 'number') {\n fn = this.setNumberFormatter(token, args, pluralToken);\n break;\n }\n }\n args.push(JSON.stringify(this.plural.locale));\n if (token.param) {\n if (pluralToken && this.options.strict) pluralToken = null;\n var arg = this.getFormatterArg(token, pluralToken);\n if (arg) args.push(arg);\n }\n fn = isModuleFn ? identifier(\"\".concat(token.key, \"__\").concat(this.plural.locale)) : token.key;\n this.setFormatter(fn, token.key);\n break;\n }\n case 'octothorpe':\n if (!pluralToken) return '\"#\"';\n args = [JSON.stringify(this.plural.locale), property('d', pluralToken.arg), pluralToken.pluralOffset || 0];\n if (this.options.strict) {\n fn = 'strictNumber';\n args.push(JSON.stringify(pluralToken.arg));\n this.setRuntimeFn('strictNumber');\n } else {\n fn = 'number';\n this.setRuntimeFn('number');\n }\n break;\n }\n if (!fn) throw new Error('Parser error for token ' + JSON.stringify(token));\n return \"\".concat(fn, \"(\").concat(args.join(', '), \")\");\n };\n Compiler.prototype.runtimeIncludes = function (key, type) {\n if (identifier(key) !== key) {\n throw new SyntaxError(\"Reserved word used as \".concat(type, \" identifier: \").concat(key));\n }\n var prev = this.runtime[key];\n if (!prev || prev.type === type) return prev;\n throw new TypeError(\"Cannot override \".concat(prev.type, \" runtime function as \").concat(type, \": \").concat(key));\n };\n Compiler.prototype.setLocale = function (key, ord) {\n var prev = this.runtimeIncludes(key, 'locale');\n var _a = this.plural,\n getCardinal = _a.getCardinal,\n getPlural = _a.getPlural,\n isDefault = _a.isDefault;\n var pf, module, toString;\n if (!ord && isDefault && getCardinal) {\n if (prev) return;\n pf = function (n) {\n return getCardinal(n);\n };\n module = CARDINAL_MODULE;\n toString = function () {\n return String(getCardinal);\n };\n } else {\n if (prev && (!isDefault || prev.module === PLURAL_MODULE)) return;\n pf = function (n, ord) {\n return getPlural(n, ord);\n };\n module = isDefault ? PLURAL_MODULE : getPlural.module || null;\n toString = function () {\n return String(getPlural);\n };\n }\n this.runtime[key] = Object.assign(pf, {\n id: key,\n module: module,\n toString: toString,\n type: 'locale'\n });\n };\n Compiler.prototype.setRuntimeFn = function (key) {\n if (this.runtimeIncludes(key, 'runtime')) return;\n this.runtime[key] = Object.assign(Runtime[key], {\n id: key,\n module: RUNTIME_MODULE,\n type: 'runtime'\n });\n };\n Compiler.prototype.getFormatterArg = function (_a, pluralToken) {\n var e_2, _b, e_3, _c;\n var _this = this;\n var key = _a.key,\n param = _a.param;\n var fmt = this.options.customFormatters[key] || isFormatterKey(key) && Formatters[key];\n if (!fmt || !param) return null;\n var argShape = 'arg' in fmt && fmt.arg || 'string';\n if (argShape === 'options') {\n var value = '';\n try {\n for (var param_1 = __values(param), param_1_1 = param_1.next(); !param_1_1.done; param_1_1 = param_1.next()) {\n var tok = param_1_1.value;\n if (tok.type === 'content') {\n value += tok.value;\n } else {\n throw new SyntaxError(\"Expected literal options for \".concat(key, \" formatter\"));\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (param_1_1 && !param_1_1.done && (_b = param_1.return)) _b.call(param_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n var options = {};\n try {\n for (var _d = __values(value.split(',')), _e = _d.next(); !_e.done; _e = _d.next()) {\n var pair = _e.value;\n var keyEnd = pair.indexOf(':');\n if (keyEnd === -1) {\n options[pair.trim()] = null;\n } else {\n var k = pair.substring(0, keyEnd).trim();\n var v = pair.substring(keyEnd + 1).trim();\n if (v === 'true') {\n options[k] = true;\n } else if (v === 'false') {\n options[k] = false;\n } else if (v === 'null') {\n options[k] = null;\n } else {\n var n = Number(v);\n options[k] = Number.isFinite(n) ? n : v;\n }\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_e && !_e.done && (_c = _d.return)) _c.call(_d);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n return JSON.stringify(options);\n } else {\n var parts = param.map(function (tok) {\n return _this.token(tok, pluralToken);\n });\n if (argShape === 'raw') return \"[\".concat(parts.join(', '), \"]\");\n var s = parts.join(' + ');\n return s ? \"(\".concat(s, \").trim()\") : '\"\"';\n }\n };\n Compiler.prototype.setFormatter = function (key, parentKey) {\n if (this.runtimeIncludes(key, 'formatter')) return;\n var cf = this.options.customFormatters[parentKey || key];\n if (cf) {\n var cfo_1 = typeof cf === 'function' ? {\n formatter: cf\n } : cf;\n this.runtime[key] = Object.assign(cfo_1.formatter.bind({}), __assign(__assign({}, cfo_1.formatter.prototype), {\n toString: function () {\n return String(cfo_1.formatter);\n }\n }), {\n type: 'formatter'\n }, 'module' in cf && cf.module && cf.id ? {\n id: identifier(cf.id),\n module: typeof cf.module === 'function' ? cf.module(this.plural.locale) : cf.module\n } : {\n id: null,\n module: null\n });\n } else if (isFormatterKey(key)) {\n this.runtime[key] = Object.assign(Formatters[key], {\n type: 'formatter'\n }, {\n id: key,\n module: FORMATTER_MODULE\n });\n } else {\n throw new Error(\"Formatting function not found: \".concat(key));\n }\n };\n Compiler.prototype.setDateFormatter = function (_a, args, plural) {\n var _this = this;\n var param = _a.param;\n var locale = this.plural.locale;\n var argStyle = param && param.length === 1 && param[0];\n if (argStyle && argStyle.type === 'content' && /^\\s*::/.test(argStyle.value)) {\n var argSkeletonText_1 = argStyle.value.trim().substr(2);\n var key = identifier(\"date_\".concat(locale, \"_\").concat(argSkeletonText_1), true);\n if (!this.runtimeIncludes(key, 'formatter')) {\n var fmt = getDateFormatter(locale, argSkeletonText_1, this.options.timeZone);\n this.runtime[key] = Object.assign(fmt, {\n id: key,\n module: null,\n toString: function () {\n return getDateFormatterSource(locale, argSkeletonText_1, _this.options.timeZone);\n },\n type: 'formatter'\n });\n }\n return key;\n }\n args.push(JSON.stringify(locale));\n if (param && param.length > 0) {\n if (plural && this.options.strict) plural = null;\n var s = param.map(function (tok) {\n return _this.token(tok, plural);\n });\n args.push('(' + (s.join(' + ') || '\"\"') + ').trim()');\n }\n this.setFormatter('date');\n return 'date';\n };\n Compiler.prototype.setNumberFormatter = function (_a, args, plural) {\n var _this = this;\n var param = _a.param;\n var locale = this.plural.locale;\n if (!param || param.length === 0) {\n args.unshift(JSON.stringify(locale));\n args.push('0');\n this.setRuntimeFn('number');\n return 'number';\n }\n args.push(JSON.stringify(locale));\n if (param.length === 1 && param[0].type === 'content') {\n var fmtArg_1 = param[0].value.trim();\n switch (fmtArg_1) {\n case 'currency':\n args.push(JSON.stringify(this.options.currency));\n this.setFormatter('numberCurrency');\n return 'numberCurrency';\n case 'integer':\n this.setFormatter('numberInteger');\n return 'numberInteger';\n case 'percent':\n this.setFormatter('numberPercent');\n return 'numberPercent';\n }\n var cm = fmtArg_1.match(/^currency:([A-Z]+)$/);\n if (cm) {\n args.push(JSON.stringify(cm[1]));\n this.setFormatter('numberCurrency');\n return 'numberCurrency';\n }\n var key = identifier(\"number_\".concat(locale, \"_\").concat(fmtArg_1), true);\n if (!this.runtimeIncludes(key, 'formatter')) {\n var currency_1 = this.options.currency;\n var fmt = getNumberFormatter(locale, fmtArg_1, currency_1);\n this.runtime[key] = Object.assign(fmt, {\n id: null,\n module: null,\n toString: function () {\n return getNumberFormatterSource(locale, fmtArg_1, currency_1);\n },\n type: 'formatter'\n });\n }\n return key;\n }\n if (plural && this.options.strict) plural = null;\n var s = param.map(function (tok) {\n return _this.token(tok, plural);\n });\n args.push('(' + (s.join(' + ') || '\"\"') + ').trim()');\n args.push(JSON.stringify(this.options.currency));\n this.setFormatter('numberFmt');\n return 'numberFmt';\n };\n return Compiler;\n }();\n function isFormatterKey(key) {\n return key in Formatters;\n }\n const a$2 = n => n == 1 ? 'one' : 'other';\n const b$2 = n => n == 0 || n == 1 ? 'one' : 'other';\n const c$2 = n => n >= 0 && n <= 1 ? 'one' : 'other';\n const d$2 = n => {\n const s = String(n).split('.'),\n v0 = !s[1];\n return n == 1 && v0 ? 'one' : 'other';\n };\n const e$1 = n => 'other';\n const f$2 = n => n == 1 ? 'one' : n == 2 ? 'two' : 'other';\n const af$2 = a$2;\n const ak$2 = b$2;\n const am$2 = c$2;\n const an$2 = a$2;\n const ar$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 99 ? 'many' : 'other';\n };\n const ars$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 99 ? 'many' : 'other';\n };\n const as$2 = c$2;\n const asa$2 = a$2;\n const ast$2 = d$2;\n const az$2 = a$2;\n const bal$2 = a$2;\n const be$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2);\n return n10 == 1 && n100 != 11 ? 'one' : n10 >= 2 && n10 <= 4 && (n100 < 12 || n100 > 14) ? 'few' : t0 && n10 == 0 || n10 >= 5 && n10 <= 9 || n100 >= 11 && n100 <= 14 ? 'many' : 'other';\n };\n const bem$2 = a$2;\n const bez$2 = a$2;\n const bg$2 = a$2;\n const bho$2 = b$2;\n const bm$2 = e$1;\n const bn$2 = c$2;\n const bo$2 = e$1;\n const br$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2),\n n1000000 = t0 && s[0].slice(-6);\n return n10 == 1 && n100 != 11 && n100 != 71 && n100 != 91 ? 'one' : n10 == 2 && n100 != 12 && n100 != 72 && n100 != 92 ? 'two' : (n10 == 3 || n10 == 4 || n10 == 9) && (n100 < 10 || n100 > 19) && (n100 < 70 || n100 > 79) && (n100 < 90 || n100 > 99) ? 'few' : n != 0 && t0 && n1000000 == 0 ? 'many' : 'other';\n };\n const brx$2 = a$2;\n const bs$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other';\n };\n const ca$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const ce$2 = a$2;\n const ceb$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n f10 = f.slice(-1);\n return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other';\n };\n const cgg$2 = a$2;\n const chr$2 = a$2;\n const ckb$2 = a$2;\n const cs$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1];\n return n == 1 && v0 ? 'one' : i >= 2 && i <= 4 && v0 ? 'few' : !v0 ? 'many' : 'other';\n };\n const cy$2 = n => n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n == 3 ? 'few' : n == 6 ? 'many' : 'other';\n const da$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n t0 = Number(s[0]) == n;\n return n == 1 || !t0 && (i == 0 || i == 1) ? 'one' : 'other';\n };\n const de$2 = d$2;\n const doi$2 = c$2;\n const dsb$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i100 = i.slice(-2),\n f100 = f.slice(-2);\n return v0 && i100 == 1 || f100 == 1 ? 'one' : v0 && i100 == 2 || f100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || f100 == 3 || f100 == 4 ? 'few' : 'other';\n };\n const dv$2 = a$2;\n const dz$2 = e$1;\n const ee$2 = a$2;\n const el$2 = a$2;\n const en$2 = d$2;\n const eo$2 = a$2;\n const es$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n return n == 1 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const et$2 = d$2;\n const eu$2 = a$2;\n const fa$2 = c$2;\n const ff$2 = n => n >= 0 && n < 2 ? 'one' : 'other';\n const fi$2 = d$2;\n const fil$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n f10 = f.slice(-1);\n return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other';\n };\n const fo$2 = a$2;\n const fr$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n return n >= 0 && n < 2 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const fur$2 = a$2;\n const fy$2 = d$2;\n const ga$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n return n == 1 ? 'one' : n == 2 ? 'two' : t0 && n >= 3 && n <= 6 ? 'few' : t0 && n >= 7 && n <= 10 ? 'many' : 'other';\n };\n const gd$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n return n == 1 || n == 11 ? 'one' : n == 2 || n == 12 ? 'two' : t0 && n >= 3 && n <= 10 || t0 && n >= 13 && n <= 19 ? 'few' : 'other';\n };\n const gl$2 = d$2;\n const gsw$2 = a$2;\n const gu$2 = c$2;\n const guw$2 = b$2;\n const gv$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n return v0 && i10 == 1 ? 'one' : v0 && i10 == 2 ? 'two' : v0 && (i100 == 0 || i100 == 20 || i100 == 40 || i100 == 60 || i100 == 80) ? 'few' : !v0 ? 'many' : 'other';\n };\n const ha$2 = a$2;\n const haw$2 = a$2;\n const he$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1];\n return i == 1 && v0 || i == 0 && !v0 ? 'one' : i == 2 && v0 ? 'two' : 'other';\n };\n const hi$2 = c$2;\n const hnj$2 = e$1;\n const hr$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other';\n };\n const hsb$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i100 = i.slice(-2),\n f100 = f.slice(-2);\n return v0 && i100 == 1 || f100 == 1 ? 'one' : v0 && i100 == 2 || f100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || f100 == 3 || f100 == 4 ? 'few' : 'other';\n };\n const hu$2 = a$2;\n const hy$2 = n => n >= 0 && n < 2 ? 'one' : 'other';\n const ia$2 = d$2;\n const id$2 = e$1;\n const ig$2 = e$1;\n const ii$2 = e$1;\n const io$2 = d$2;\n const is$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n t = (s[1] || '').replace(/0+$/, ''),\n t0 = Number(s[0]) == n,\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n return t0 && i10 == 1 && i100 != 11 || t % 10 == 1 && t % 100 != 11 ? 'one' : 'other';\n };\n const it$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const iu$2 = f$2;\n const ja$2 = e$1;\n const jbo$2 = e$1;\n const jgo$2 = a$2;\n const jmc$2 = a$2;\n const jv$2 = e$1;\n const jw$2 = e$1;\n const ka$2 = a$2;\n const kab$2 = n => n >= 0 && n < 2 ? 'one' : 'other';\n const kaj$2 = a$2;\n const kcg$2 = a$2;\n const kde$2 = e$1;\n const kea$2 = e$1;\n const kk$2 = a$2;\n const kkj$2 = a$2;\n const kl$2 = a$2;\n const km$2 = e$1;\n const kn$2 = c$2;\n const ko$2 = e$1;\n const ks$2 = a$2;\n const ksb$2 = a$2;\n const ksh$2 = n => n == 0 ? 'zero' : n == 1 ? 'one' : 'other';\n const ku$2 = a$2;\n const kw$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2),\n n1000 = t0 && s[0].slice(-3),\n n100000 = t0 && s[0].slice(-5),\n n1000000 = t0 && s[0].slice(-6);\n return n == 0 ? 'zero' : n == 1 ? 'one' : n100 == 2 || n100 == 22 || n100 == 42 || n100 == 62 || n100 == 82 || t0 && n1000 == 0 && (n100000 >= 1000 && n100000 <= 20000 || n100000 == 40000 || n100000 == 60000 || n100000 == 80000) || n != 0 && n1000000 == 100000 ? 'two' : n100 == 3 || n100 == 23 || n100 == 43 || n100 == 63 || n100 == 83 ? 'few' : n != 1 && (n100 == 1 || n100 == 21 || n100 == 41 || n100 == 61 || n100 == 81) ? 'many' : 'other';\n };\n const ky$2 = a$2;\n const lag$2 = n => {\n const s = String(n).split('.'),\n i = s[0];\n return n == 0 ? 'zero' : (i == 0 || i == 1) && n != 0 ? 'one' : 'other';\n };\n const lb$2 = a$2;\n const lg$2 = a$2;\n const lij$2 = d$2;\n const lkt$2 = e$1;\n const ln$2 = b$2;\n const lo$2 = e$1;\n const lt$2 = n => {\n const s = String(n).split('.'),\n f = s[1] || '',\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2);\n return n10 == 1 && (n100 < 11 || n100 > 19) ? 'one' : n10 >= 2 && n10 <= 9 && (n100 < 11 || n100 > 19) ? 'few' : f != 0 ? 'many' : 'other';\n };\n const lv$2 = n => {\n const s = String(n).split('.'),\n f = s[1] || '',\n v = f.length,\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2),\n f100 = f.slice(-2),\n f10 = f.slice(-1);\n return t0 && n10 == 0 || n100 >= 11 && n100 <= 19 || v == 2 && f100 >= 11 && f100 <= 19 ? 'zero' : n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one' : 'other';\n };\n const mas$2 = a$2;\n const mg$2 = b$2;\n const mgo$2 = a$2;\n const mk$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : 'other';\n };\n const ml$2 = a$2;\n const mn$2 = a$2;\n const mo$2 = n => {\n const s = String(n).split('.'),\n v0 = !s[1],\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n return n == 1 && v0 ? 'one' : !v0 || n == 0 || n != 1 && n100 >= 1 && n100 <= 19 ? 'few' : 'other';\n };\n const mr$2 = a$2;\n const ms$2 = e$1;\n const mt$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n return n == 1 ? 'one' : n == 2 ? 'two' : n == 0 || n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 19 ? 'many' : 'other';\n };\n const my$2 = e$1;\n const nah$2 = a$2;\n const naq$2 = f$2;\n const nb$2 = a$2;\n const nd$2 = a$2;\n const ne$2 = a$2;\n const nl$2 = d$2;\n const nn$2 = a$2;\n const nnh$2 = a$2;\n const no$2 = a$2;\n const nqo$2 = e$1;\n const nr$2 = a$2;\n const nso$2 = b$2;\n const ny$2 = a$2;\n const nyn$2 = a$2;\n const om$2 = a$2;\n const or$2 = a$2;\n const os$2 = a$2;\n const osa$2 = e$1;\n const pa$2 = b$2;\n const pap$2 = a$2;\n const pcm$2 = c$2;\n const pl$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n return n == 1 && v0 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i != 1 && (i10 == 0 || i10 == 1) || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 12 && i100 <= 14 ? 'many' : 'other';\n };\n const prg$2 = n => {\n const s = String(n).split('.'),\n f = s[1] || '',\n v = f.length,\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2),\n f100 = f.slice(-2),\n f10 = f.slice(-1);\n return t0 && n10 == 0 || n100 >= 11 && n100 <= 19 || v == 2 && f100 >= 11 && f100 <= 19 ? 'zero' : n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one' : 'other';\n };\n const ps$2 = a$2;\n const pt$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n return i == 0 || i == 1 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const pt_PT$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const rm$2 = a$2;\n const ro$2 = n => {\n const s = String(n).split('.'),\n v0 = !s[1],\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n return n == 1 && v0 ? 'one' : !v0 || n == 0 || n != 1 && n100 >= 1 && n100 <= 19 ? 'few' : 'other';\n };\n const rof$2 = a$2;\n const ru$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n return v0 && i10 == 1 && i100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i10 == 0 || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 11 && i100 <= 14 ? 'many' : 'other';\n };\n const rwk$2 = a$2;\n const sah$2 = e$1;\n const saq$2 = a$2;\n const sat$2 = f$2;\n const sc$2 = d$2;\n const scn$2 = d$2;\n const sd$2 = a$2;\n const sdh$2 = a$2;\n const se$2 = f$2;\n const seh$2 = a$2;\n const ses$2 = e$1;\n const sg$2 = e$1;\n const sh$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other';\n };\n const shi$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n return n >= 0 && n <= 1 ? 'one' : t0 && n >= 2 && n <= 10 ? 'few' : 'other';\n };\n const si$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '';\n return n == 0 || n == 1 || i == 0 && f == 1 ? 'one' : 'other';\n };\n const sk$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1];\n return n == 1 && v0 ? 'one' : i >= 2 && i <= 4 && v0 ? 'few' : !v0 ? 'many' : 'other';\n };\n const sl$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i100 = i.slice(-2);\n return v0 && i100 == 1 ? 'one' : v0 && i100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || !v0 ? 'few' : 'other';\n };\n const sma$2 = f$2;\n const smi$2 = f$2;\n const smj$2 = f$2;\n const smn$2 = f$2;\n const sms$2 = f$2;\n const sn$2 = a$2;\n const so$2 = a$2;\n const sq$2 = a$2;\n const sr$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other';\n };\n const ss$2 = a$2;\n const ssy$2 = a$2;\n const st$2 = a$2;\n const su$2 = e$1;\n const sv$2 = d$2;\n const sw$2 = d$2;\n const syr$2 = a$2;\n const ta$2 = a$2;\n const te$2 = a$2;\n const teo$2 = a$2;\n const th$2 = e$1;\n const ti$2 = b$2;\n const tig$2 = a$2;\n const tk$2 = a$2;\n const tl$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n f10 = f.slice(-1);\n return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other';\n };\n const tn$2 = a$2;\n const to$2 = e$1;\n const tpi$2 = e$1;\n const tr$2 = a$2;\n const ts$2 = a$2;\n const tzm$2 = n => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n return n == 0 || n == 1 || t0 && n >= 11 && n <= 99 ? 'one' : 'other';\n };\n const ug$2 = a$2;\n const uk$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n return v0 && i10 == 1 && i100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i10 == 0 || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 11 && i100 <= 14 ? 'many' : 'other';\n };\n const und$2 = e$1;\n const ur$2 = d$2;\n const uz$2 = a$2;\n const ve$2 = a$2;\n const vec$2 = n => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const vi$2 = e$1;\n const vo$2 = a$2;\n const vun$2 = a$2;\n const wa$2 = b$2;\n const wae$2 = a$2;\n const wo$2 = e$1;\n const xh$2 = a$2;\n const xog$2 = a$2;\n const yi$2 = d$2;\n const yo$2 = e$1;\n const yue$2 = e$1;\n const zh$2 = e$1;\n const zu$2 = c$2;\n var Cardinals = /*#__PURE__*/Object.freeze({\n __proto__: null,\n af: af$2,\n ak: ak$2,\n am: am$2,\n an: an$2,\n ar: ar$2,\n ars: ars$2,\n as: as$2,\n asa: asa$2,\n ast: ast$2,\n az: az$2,\n bal: bal$2,\n be: be$2,\n bem: bem$2,\n bez: bez$2,\n bg: bg$2,\n bho: bho$2,\n bm: bm$2,\n bn: bn$2,\n bo: bo$2,\n br: br$2,\n brx: brx$2,\n bs: bs$2,\n ca: ca$2,\n ce: ce$2,\n ceb: ceb$2,\n cgg: cgg$2,\n chr: chr$2,\n ckb: ckb$2,\n cs: cs$2,\n cy: cy$2,\n da: da$2,\n de: de$2,\n doi: doi$2,\n dsb: dsb$2,\n dv: dv$2,\n dz: dz$2,\n ee: ee$2,\n el: el$2,\n en: en$2,\n eo: eo$2,\n es: es$2,\n et: et$2,\n eu: eu$2,\n fa: fa$2,\n ff: ff$2,\n fi: fi$2,\n fil: fil$2,\n fo: fo$2,\n fr: fr$2,\n fur: fur$2,\n fy: fy$2,\n ga: ga$2,\n gd: gd$2,\n gl: gl$2,\n gsw: gsw$2,\n gu: gu$2,\n guw: guw$2,\n gv: gv$2,\n ha: ha$2,\n haw: haw$2,\n he: he$2,\n hi: hi$2,\n hnj: hnj$2,\n hr: hr$2,\n hsb: hsb$2,\n hu: hu$2,\n hy: hy$2,\n ia: ia$2,\n id: id$2,\n ig: ig$2,\n ii: ii$2,\n io: io$2,\n is: is$2,\n it: it$2,\n iu: iu$2,\n ja: ja$2,\n jbo: jbo$2,\n jgo: jgo$2,\n jmc: jmc$2,\n jv: jv$2,\n jw: jw$2,\n ka: ka$2,\n kab: kab$2,\n kaj: kaj$2,\n kcg: kcg$2,\n kde: kde$2,\n kea: kea$2,\n kk: kk$2,\n kkj: kkj$2,\n kl: kl$2,\n km: km$2,\n kn: kn$2,\n ko: ko$2,\n ks: ks$2,\n ksb: ksb$2,\n ksh: ksh$2,\n ku: ku$2,\n kw: kw$2,\n ky: ky$2,\n lag: lag$2,\n lb: lb$2,\n lg: lg$2,\n lij: lij$2,\n lkt: lkt$2,\n ln: ln$2,\n lo: lo$2,\n lt: lt$2,\n lv: lv$2,\n mas: mas$2,\n mg: mg$2,\n mgo: mgo$2,\n mk: mk$2,\n ml: ml$2,\n mn: mn$2,\n mo: mo$2,\n mr: mr$2,\n ms: ms$2,\n mt: mt$2,\n my: my$2,\n nah: nah$2,\n naq: naq$2,\n nb: nb$2,\n nd: nd$2,\n ne: ne$2,\n nl: nl$2,\n nn: nn$2,\n nnh: nnh$2,\n no: no$2,\n nqo: nqo$2,\n nr: nr$2,\n nso: nso$2,\n ny: ny$2,\n nyn: nyn$2,\n om: om$2,\n or: or$2,\n os: os$2,\n osa: osa$2,\n pa: pa$2,\n pap: pap$2,\n pcm: pcm$2,\n pl: pl$2,\n prg: prg$2,\n ps: ps$2,\n pt: pt$2,\n pt_PT: pt_PT$2,\n rm: rm$2,\n ro: ro$2,\n rof: rof$2,\n ru: ru$2,\n rwk: rwk$2,\n sah: sah$2,\n saq: saq$2,\n sat: sat$2,\n sc: sc$2,\n scn: scn$2,\n sd: sd$2,\n sdh: sdh$2,\n se: se$2,\n seh: seh$2,\n ses: ses$2,\n sg: sg$2,\n sh: sh$2,\n shi: shi$2,\n si: si$2,\n sk: sk$2,\n sl: sl$2,\n sma: sma$2,\n smi: smi$2,\n smj: smj$2,\n smn: smn$2,\n sms: sms$2,\n sn: sn$2,\n so: so$2,\n sq: sq$2,\n sr: sr$2,\n ss: ss$2,\n ssy: ssy$2,\n st: st$2,\n su: su$2,\n sv: sv$2,\n sw: sw$2,\n syr: syr$2,\n ta: ta$2,\n te: te$2,\n teo: teo$2,\n th: th$2,\n ti: ti$2,\n tig: tig$2,\n tk: tk$2,\n tl: tl$2,\n tn: tn$2,\n to: to$2,\n tpi: tpi$2,\n tr: tr$2,\n ts: ts$2,\n tzm: tzm$2,\n ug: ug$2,\n uk: uk$2,\n und: und$2,\n ur: ur$2,\n uz: uz$2,\n ve: ve$2,\n vec: vec$2,\n vi: vi$2,\n vo: vo$2,\n vun: vun$2,\n wa: wa$2,\n wae: wae$2,\n wo: wo$2,\n xh: xh$2,\n xog: xog$2,\n yi: yi$2,\n yo: yo$2,\n yue: yue$2,\n zh: zh$2,\n zu: zu$2\n });\n const z = \"zero\",\n o = \"one\",\n t = \"two\",\n f$1 = \"few\",\n m = \"many\",\n x = \"other\";\n const a$1 = {\n cardinal: [o, x],\n ordinal: [x]\n };\n const b$1 = {\n cardinal: [o, x],\n ordinal: [o, x]\n };\n const c$1 = {\n cardinal: [x],\n ordinal: [x]\n };\n const d$1 = {\n cardinal: [o, t, x],\n ordinal: [x]\n };\n const af$1 = a$1;\n const ak$1 = a$1;\n const am$1 = a$1;\n const an$1 = a$1;\n const ar$1 = {\n cardinal: [z, o, t, f$1, m, x],\n ordinal: [x]\n };\n const ars$1 = {\n cardinal: [z, o, t, f$1, m, x],\n ordinal: [x]\n };\n const as$1 = {\n cardinal: [o, x],\n ordinal: [o, t, f$1, m, x]\n };\n const asa$1 = a$1;\n const ast$1 = a$1;\n const az$1 = {\n cardinal: [o, x],\n ordinal: [o, f$1, m, x]\n };\n const bal$1 = b$1;\n const be$1 = {\n cardinal: [o, f$1, m, x],\n ordinal: [f$1, x]\n };\n const bem$1 = a$1;\n const bez$1 = a$1;\n const bg$1 = a$1;\n const bho$1 = a$1;\n const bm$1 = c$1;\n const bn$1 = {\n cardinal: [o, x],\n ordinal: [o, t, f$1, m, x]\n };\n const bo$1 = c$1;\n const br$1 = {\n cardinal: [o, t, f$1, m, x],\n ordinal: [x]\n };\n const brx$1 = a$1;\n const bs$1 = {\n cardinal: [o, f$1, x],\n ordinal: [x]\n };\n const ca$1 = {\n cardinal: [o, m, x],\n ordinal: [o, t, f$1, x]\n };\n const ce$1 = a$1;\n const ceb$1 = a$1;\n const cgg$1 = a$1;\n const chr$1 = a$1;\n const ckb$1 = a$1;\n const cs$1 = {\n cardinal: [o, f$1, m, x],\n ordinal: [x]\n };\n const cy$1 = {\n cardinal: [z, o, t, f$1, m, x],\n ordinal: [z, o, t, f$1, m, x]\n };\n const da$1 = a$1;\n const de$1 = a$1;\n const doi$1 = a$1;\n const dsb$1 = {\n cardinal: [o, t, f$1, x],\n ordinal: [x]\n };\n const dv$1 = a$1;\n const dz$1 = c$1;\n const ee$1 = a$1;\n const el$1 = a$1;\n const en$1 = {\n cardinal: [o, x],\n ordinal: [o, t, f$1, x]\n };\n const eo$1 = a$1;\n const es$1 = {\n cardinal: [o, m, x],\n ordinal: [x]\n };\n const et$1 = a$1;\n const eu$1 = a$1;\n const fa$1 = a$1;\n const ff$1 = a$1;\n const fi$1 = a$1;\n const fil$1 = b$1;\n const fo$1 = a$1;\n const fr$1 = {\n cardinal: [o, m, x],\n ordinal: [o, x]\n };\n const fur$1 = a$1;\n const fy$1 = a$1;\n const ga$1 = {\n cardinal: [o, t, f$1, m, x],\n ordinal: [o, x]\n };\n const gd$1 = {\n cardinal: [o, t, f$1, x],\n ordinal: [o, t, f$1, x]\n };\n const gl$1 = a$1;\n const gsw$1 = a$1;\n const gu$1 = {\n cardinal: [o, x],\n ordinal: [o, t, f$1, m, x]\n };\n const guw$1 = a$1;\n const gv$1 = {\n cardinal: [o, t, f$1, m, x],\n ordinal: [x]\n };\n const ha$1 = a$1;\n const haw$1 = a$1;\n const he$1 = d$1;\n const hi$1 = {\n cardinal: [o, x],\n ordinal: [o, t, f$1, m, x]\n };\n const hnj$1 = c$1;\n const hr$1 = {\n cardinal: [o, f$1, x],\n ordinal: [x]\n };\n const hsb$1 = {\n cardinal: [o, t, f$1, x],\n ordinal: [x]\n };\n const hu$1 = b$1;\n const hy$1 = b$1;\n const ia$1 = a$1;\n const id$1 = c$1;\n const ig$1 = c$1;\n const ii$1 = c$1;\n const io$1 = a$1;\n const is$1 = a$1;\n const it$1 = {\n cardinal: [o, m, x],\n ordinal: [m, x]\n };\n const iu$1 = d$1;\n const ja$1 = c$1;\n const jbo$1 = c$1;\n const jgo$1 = a$1;\n const jmc$1 = a$1;\n const jv$1 = c$1;\n const jw$1 = c$1;\n const ka$1 = {\n cardinal: [o, x],\n ordinal: [o, m, x]\n };\n const kab$1 = a$1;\n const kaj$1 = a$1;\n const kcg$1 = a$1;\n const kde$1 = c$1;\n const kea$1 = c$1;\n const kk$1 = {\n cardinal: [o, x],\n ordinal: [m, x]\n };\n const kkj$1 = a$1;\n const kl$1 = a$1;\n const km$1 = c$1;\n const kn$1 = a$1;\n const ko$1 = c$1;\n const ks$1 = a$1;\n const ksb$1 = a$1;\n const ksh$1 = {\n cardinal: [z, o, x],\n ordinal: [x]\n };\n const ku$1 = a$1;\n const kw$1 = {\n cardinal: [z, o, t, f$1, m, x],\n ordinal: [o, m, x]\n };\n const ky$1 = a$1;\n const lag$1 = {\n cardinal: [z, o, x],\n ordinal: [x]\n };\n const lb$1 = a$1;\n const lg$1 = a$1;\n const lij$1 = {\n cardinal: [o, x],\n ordinal: [m, x]\n };\n const lkt$1 = c$1;\n const ln$1 = a$1;\n const lo$1 = {\n cardinal: [x],\n ordinal: [o, x]\n };\n const lt$1 = {\n cardinal: [o, f$1, m, x],\n ordinal: [x]\n };\n const lv$1 = {\n cardinal: [z, o, x],\n ordinal: [x]\n };\n const mas$1 = a$1;\n const mg$1 = a$1;\n const mgo$1 = a$1;\n const mk$1 = {\n cardinal: [o, x],\n ordinal: [o, t, m, x]\n };\n const ml$1 = a$1;\n const mn$1 = a$1;\n const mo$1 = {\n cardinal: [o, f$1, x],\n ordinal: [o, x]\n };\n const mr$1 = {\n cardinal: [o, x],\n ordinal: [o, t, f$1, x]\n };\n const ms$1 = {\n cardinal: [x],\n ordinal: [o, x]\n };\n const mt$1 = {\n cardinal: [o, t, f$1, m, x],\n ordinal: [x]\n };\n const my$1 = c$1;\n const nah$1 = a$1;\n const naq$1 = d$1;\n const nb$1 = a$1;\n const nd$1 = a$1;\n const ne$1 = b$1;\n const nl$1 = a$1;\n const nn$1 = a$1;\n const nnh$1 = a$1;\n const no$1 = a$1;\n const nqo$1 = c$1;\n const nr$1 = a$1;\n const nso$1 = a$1;\n const ny$1 = a$1;\n const nyn$1 = a$1;\n const om$1 = a$1;\n const or$1 = {\n cardinal: [o, x],\n ordinal: [o, t, f$1, m, x]\n };\n const os$1 = a$1;\n const osa$1 = c$1;\n const pa$1 = a$1;\n const pap$1 = a$1;\n const pcm$1 = a$1;\n const pl$1 = {\n cardinal: [o, f$1, m, x],\n ordinal: [x]\n };\n const prg$1 = {\n cardinal: [z, o, x],\n ordinal: [x]\n };\n const ps$1 = a$1;\n const pt$1 = {\n cardinal: [o, m, x],\n ordinal: [x]\n };\n const pt_PT$1 = {\n cardinal: [o, m, x],\n ordinal: [x]\n };\n const rm$1 = a$1;\n const ro$1 = {\n cardinal: [o, f$1, x],\n ordinal: [o, x]\n };\n const rof$1 = a$1;\n const ru$1 = {\n cardinal: [o, f$1, m, x],\n ordinal: [x]\n };\n const rwk$1 = a$1;\n const sah$1 = c$1;\n const saq$1 = a$1;\n const sat$1 = d$1;\n const sc$1 = {\n cardinal: [o, x],\n ordinal: [m, x]\n };\n const scn$1 = {\n cardinal: [o, x],\n ordinal: [m, x]\n };\n const sd$1 = a$1;\n const sdh$1 = a$1;\n const se$1 = d$1;\n const seh$1 = a$1;\n const ses$1 = c$1;\n const sg$1 = c$1;\n const sh$1 = {\n cardinal: [o, f$1, x],\n ordinal: [x]\n };\n const shi$1 = {\n cardinal: [o, f$1, x],\n ordinal: [x]\n };\n const si$1 = a$1;\n const sk$1 = {\n cardinal: [o, f$1, m, x],\n ordinal: [x]\n };\n const sl$1 = {\n cardinal: [o, t, f$1, x],\n ordinal: [x]\n };\n const sma$1 = d$1;\n const smi$1 = d$1;\n const smj$1 = d$1;\n const smn$1 = d$1;\n const sms$1 = d$1;\n const sn$1 = a$1;\n const so$1 = a$1;\n const sq$1 = {\n cardinal: [o, x],\n ordinal: [o, m, x]\n };\n const sr$1 = {\n cardinal: [o, f$1, x],\n ordinal: [x]\n };\n const ss$1 = a$1;\n const ssy$1 = a$1;\n const st$1 = a$1;\n const su$1 = c$1;\n const sv$1 = b$1;\n const sw$1 = a$1;\n const syr$1 = a$1;\n const ta$1 = a$1;\n const te$1 = a$1;\n const teo$1 = a$1;\n const th$1 = c$1;\n const ti$1 = a$1;\n const tig$1 = a$1;\n const tk$1 = {\n cardinal: [o, x],\n ordinal: [f$1, x]\n };\n const tl$1 = b$1;\n const tn$1 = a$1;\n const to$1 = c$1;\n const tpi$1 = c$1;\n const tr$1 = a$1;\n const ts$1 = a$1;\n const tzm$1 = a$1;\n const ug$1 = a$1;\n const uk$1 = {\n cardinal: [o, f$1, m, x],\n ordinal: [f$1, x]\n };\n const und$1 = c$1;\n const ur$1 = a$1;\n const uz$1 = a$1;\n const ve$1 = a$1;\n const vec$1 = {\n cardinal: [o, m, x],\n ordinal: [m, x]\n };\n const vi$1 = {\n cardinal: [x],\n ordinal: [o, x]\n };\n const vo$1 = a$1;\n const vun$1 = a$1;\n const wa$1 = a$1;\n const wae$1 = a$1;\n const wo$1 = c$1;\n const xh$1 = a$1;\n const xog$1 = a$1;\n const yi$1 = a$1;\n const yo$1 = c$1;\n const yue$1 = c$1;\n const zh$1 = c$1;\n const zu$1 = a$1;\n var PluralCategories = /*#__PURE__*/Object.freeze({\n __proto__: null,\n af: af$1,\n ak: ak$1,\n am: am$1,\n an: an$1,\n ar: ar$1,\n ars: ars$1,\n as: as$1,\n asa: asa$1,\n ast: ast$1,\n az: az$1,\n bal: bal$1,\n be: be$1,\n bem: bem$1,\n bez: bez$1,\n bg: bg$1,\n bho: bho$1,\n bm: bm$1,\n bn: bn$1,\n bo: bo$1,\n br: br$1,\n brx: brx$1,\n bs: bs$1,\n ca: ca$1,\n ce: ce$1,\n ceb: ceb$1,\n cgg: cgg$1,\n chr: chr$1,\n ckb: ckb$1,\n cs: cs$1,\n cy: cy$1,\n da: da$1,\n de: de$1,\n doi: doi$1,\n dsb: dsb$1,\n dv: dv$1,\n dz: dz$1,\n ee: ee$1,\n el: el$1,\n en: en$1,\n eo: eo$1,\n es: es$1,\n et: et$1,\n eu: eu$1,\n fa: fa$1,\n ff: ff$1,\n fi: fi$1,\n fil: fil$1,\n fo: fo$1,\n fr: fr$1,\n fur: fur$1,\n fy: fy$1,\n ga: ga$1,\n gd: gd$1,\n gl: gl$1,\n gsw: gsw$1,\n gu: gu$1,\n guw: guw$1,\n gv: gv$1,\n ha: ha$1,\n haw: haw$1,\n he: he$1,\n hi: hi$1,\n hnj: hnj$1,\n hr: hr$1,\n hsb: hsb$1,\n hu: hu$1,\n hy: hy$1,\n ia: ia$1,\n id: id$1,\n ig: ig$1,\n ii: ii$1,\n io: io$1,\n is: is$1,\n it: it$1,\n iu: iu$1,\n ja: ja$1,\n jbo: jbo$1,\n jgo: jgo$1,\n jmc: jmc$1,\n jv: jv$1,\n jw: jw$1,\n ka: ka$1,\n kab: kab$1,\n kaj: kaj$1,\n kcg: kcg$1,\n kde: kde$1,\n kea: kea$1,\n kk: kk$1,\n kkj: kkj$1,\n kl: kl$1,\n km: km$1,\n kn: kn$1,\n ko: ko$1,\n ks: ks$1,\n ksb: ksb$1,\n ksh: ksh$1,\n ku: ku$1,\n kw: kw$1,\n ky: ky$1,\n lag: lag$1,\n lb: lb$1,\n lg: lg$1,\n lij: lij$1,\n lkt: lkt$1,\n ln: ln$1,\n lo: lo$1,\n lt: lt$1,\n lv: lv$1,\n mas: mas$1,\n mg: mg$1,\n mgo: mgo$1,\n mk: mk$1,\n ml: ml$1,\n mn: mn$1,\n mo: mo$1,\n mr: mr$1,\n ms: ms$1,\n mt: mt$1,\n my: my$1,\n nah: nah$1,\n naq: naq$1,\n nb: nb$1,\n nd: nd$1,\n ne: ne$1,\n nl: nl$1,\n nn: nn$1,\n nnh: nnh$1,\n no: no$1,\n nqo: nqo$1,\n nr: nr$1,\n nso: nso$1,\n ny: ny$1,\n nyn: nyn$1,\n om: om$1,\n or: or$1,\n os: os$1,\n osa: osa$1,\n pa: pa$1,\n pap: pap$1,\n pcm: pcm$1,\n pl: pl$1,\n prg: prg$1,\n ps: ps$1,\n pt: pt$1,\n pt_PT: pt_PT$1,\n rm: rm$1,\n ro: ro$1,\n rof: rof$1,\n ru: ru$1,\n rwk: rwk$1,\n sah: sah$1,\n saq: saq$1,\n sat: sat$1,\n sc: sc$1,\n scn: scn$1,\n sd: sd$1,\n sdh: sdh$1,\n se: se$1,\n seh: seh$1,\n ses: ses$1,\n sg: sg$1,\n sh: sh$1,\n shi: shi$1,\n si: si$1,\n sk: sk$1,\n sl: sl$1,\n sma: sma$1,\n smi: smi$1,\n smj: smj$1,\n smn: smn$1,\n sms: sms$1,\n sn: sn$1,\n so: so$1,\n sq: sq$1,\n sr: sr$1,\n ss: ss$1,\n ssy: ssy$1,\n st: st$1,\n su: su$1,\n sv: sv$1,\n sw: sw$1,\n syr: syr$1,\n ta: ta$1,\n te: te$1,\n teo: teo$1,\n th: th$1,\n ti: ti$1,\n tig: tig$1,\n tk: tk$1,\n tl: tl$1,\n tn: tn$1,\n to: to$1,\n tpi: tpi$1,\n tr: tr$1,\n ts: ts$1,\n tzm: tzm$1,\n ug: ug$1,\n uk: uk$1,\n und: und$1,\n ur: ur$1,\n uz: uz$1,\n ve: ve$1,\n vec: vec$1,\n vi: vi$1,\n vo: vo$1,\n vun: vun$1,\n wa: wa$1,\n wae: wae$1,\n wo: wo$1,\n xh: xh$1,\n xog: xog$1,\n yi: yi$1,\n yo: yo$1,\n yue: yue$1,\n zh: zh$1,\n zu: zu$1\n });\n const a = (n, ord) => {\n if (ord) return 'other';\n return n == 1 ? 'one' : 'other';\n };\n const b = (n, ord) => {\n if (ord) return 'other';\n return n == 0 || n == 1 ? 'one' : 'other';\n };\n const c = (n, ord) => {\n if (ord) return 'other';\n return n >= 0 && n <= 1 ? 'one' : 'other';\n };\n const d = (n, ord) => {\n const s = String(n).split('.'),\n v0 = !s[1];\n if (ord) return 'other';\n return n == 1 && v0 ? 'one' : 'other';\n };\n const e = (n, ord) => 'other';\n const f = (n, ord) => {\n if (ord) return 'other';\n return n == 1 ? 'one' : n == 2 ? 'two' : 'other';\n };\n const af = a;\n const ak = b;\n const am = c;\n const an = a;\n const ar = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return 'other';\n return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 99 ? 'many' : 'other';\n };\n const ars = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return 'other';\n return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 99 ? 'many' : 'other';\n };\n const as = (n, ord) => {\n if (ord) return n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other';\n return n >= 0 && n <= 1 ? 'one' : 'other';\n };\n const asa = a;\n const ast = d;\n const az = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n i1000 = i.slice(-3);\n if (ord) return i10 == 1 || i10 == 2 || i10 == 5 || i10 == 7 || i10 == 8 || i100 == 20 || i100 == 50 || i100 == 70 || i100 == 80 ? 'one' : i10 == 3 || i10 == 4 || i1000 == 100 || i1000 == 200 || i1000 == 300 || i1000 == 400 || i1000 == 500 || i1000 == 600 || i1000 == 700 || i1000 == 800 || i1000 == 900 ? 'few' : i == 0 || i10 == 6 || i100 == 40 || i100 == 60 || i100 == 90 ? 'many' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const bal = (n, ord) => n == 1 ? 'one' : 'other';\n const be = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2);\n if (ord) return (n10 == 2 || n10 == 3) && n100 != 12 && n100 != 13 ? 'few' : 'other';\n return n10 == 1 && n100 != 11 ? 'one' : n10 >= 2 && n10 <= 4 && (n100 < 12 || n100 > 14) ? 'few' : t0 && n10 == 0 || n10 >= 5 && n10 <= 9 || n100 >= 11 && n100 <= 14 ? 'many' : 'other';\n };\n const bem = a;\n const bez = a;\n const bg = a;\n const bho = b;\n const bm = e;\n const bn = (n, ord) => {\n if (ord) return n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other';\n return n >= 0 && n <= 1 ? 'one' : 'other';\n };\n const bo = e;\n const br = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2),\n n1000000 = t0 && s[0].slice(-6);\n if (ord) return 'other';\n return n10 == 1 && n100 != 11 && n100 != 71 && n100 != 91 ? 'one' : n10 == 2 && n100 != 12 && n100 != 72 && n100 != 92 ? 'two' : (n10 == 3 || n10 == 4 || n10 == 9) && (n100 < 10 || n100 > 19) && (n100 < 70 || n100 > 79) && (n100 < 90 || n100 > 99) ? 'few' : n != 0 && t0 && n1000000 == 0 ? 'many' : 'other';\n };\n const brx = a;\n const bs = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n if (ord) return 'other';\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other';\n };\n const ca = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n if (ord) return n == 1 || n == 3 ? 'one' : n == 2 ? 'two' : n == 4 ? 'few' : 'other';\n return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const ce = a;\n const ceb = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n f10 = f.slice(-1);\n if (ord) return 'other';\n return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other';\n };\n const cgg = a;\n const chr = a;\n const ckb = a;\n const cs = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1];\n if (ord) return 'other';\n return n == 1 && v0 ? 'one' : i >= 2 && i <= 4 && v0 ? 'few' : !v0 ? 'many' : 'other';\n };\n const cy = (n, ord) => {\n if (ord) return n == 0 || n == 7 || n == 8 || n == 9 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n == 3 || n == 4 ? 'few' : n == 5 || n == 6 ? 'many' : 'other';\n return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n == 3 ? 'few' : n == 6 ? 'many' : 'other';\n };\n const da = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n t0 = Number(s[0]) == n;\n if (ord) return 'other';\n return n == 1 || !t0 && (i == 0 || i == 1) ? 'one' : 'other';\n };\n const de = d;\n const doi = c;\n const dsb = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i100 = i.slice(-2),\n f100 = f.slice(-2);\n if (ord) return 'other';\n return v0 && i100 == 1 || f100 == 1 ? 'one' : v0 && i100 == 2 || f100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || f100 == 3 || f100 == 4 ? 'few' : 'other';\n };\n const dv = a;\n const dz = e;\n const ee = a;\n const el = a;\n const en = (n, ord) => {\n const s = String(n).split('.'),\n v0 = !s[1],\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2);\n if (ord) return n10 == 1 && n100 != 11 ? 'one' : n10 == 2 && n100 != 12 ? 'two' : n10 == 3 && n100 != 13 ? 'few' : 'other';\n return n == 1 && v0 ? 'one' : 'other';\n };\n const eo = a;\n const es = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n if (ord) return 'other';\n return n == 1 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const et = d;\n const eu = a;\n const fa = c;\n const ff = (n, ord) => {\n if (ord) return 'other';\n return n >= 0 && n < 2 ? 'one' : 'other';\n };\n const fi = d;\n const fil = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n f10 = f.slice(-1);\n if (ord) return n == 1 ? 'one' : 'other';\n return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other';\n };\n const fo = a;\n const fr = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n if (ord) return n == 1 ? 'one' : 'other';\n return n >= 0 && n < 2 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const fur = a;\n const fy = d;\n const ga = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n if (ord) return n == 1 ? 'one' : 'other';\n return n == 1 ? 'one' : n == 2 ? 'two' : t0 && n >= 3 && n <= 6 ? 'few' : t0 && n >= 7 && n <= 10 ? 'many' : 'other';\n };\n const gd = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n if (ord) return n == 1 || n == 11 ? 'one' : n == 2 || n == 12 ? 'two' : n == 3 || n == 13 ? 'few' : 'other';\n return n == 1 || n == 11 ? 'one' : n == 2 || n == 12 ? 'two' : t0 && n >= 3 && n <= 10 || t0 && n >= 13 && n <= 19 ? 'few' : 'other';\n };\n const gl = d;\n const gsw = a;\n const gu = (n, ord) => {\n if (ord) return n == 1 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other';\n return n >= 0 && n <= 1 ? 'one' : 'other';\n };\n const guw = b;\n const gv = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return 'other';\n return v0 && i10 == 1 ? 'one' : v0 && i10 == 2 ? 'two' : v0 && (i100 == 0 || i100 == 20 || i100 == 40 || i100 == 60 || i100 == 80) ? 'few' : !v0 ? 'many' : 'other';\n };\n const ha = a;\n const haw = a;\n const he = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1];\n if (ord) return 'other';\n return i == 1 && v0 || i == 0 && !v0 ? 'one' : i == 2 && v0 ? 'two' : 'other';\n };\n const hi = (n, ord) => {\n if (ord) return n == 1 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other';\n return n >= 0 && n <= 1 ? 'one' : 'other';\n };\n const hnj = e;\n const hr = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n if (ord) return 'other';\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other';\n };\n const hsb = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i100 = i.slice(-2),\n f100 = f.slice(-2);\n if (ord) return 'other';\n return v0 && i100 == 1 || f100 == 1 ? 'one' : v0 && i100 == 2 || f100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || f100 == 3 || f100 == 4 ? 'few' : 'other';\n };\n const hu = (n, ord) => {\n if (ord) return n == 1 || n == 5 ? 'one' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const hy = (n, ord) => {\n if (ord) return n == 1 ? 'one' : 'other';\n return n >= 0 && n < 2 ? 'one' : 'other';\n };\n const ia = d;\n const id = e;\n const ig = e;\n const ii = e;\n const io = d;\n const is = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n t = (s[1] || '').replace(/0+$/, ''),\n t0 = Number(s[0]) == n,\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return 'other';\n return t0 && i10 == 1 && i100 != 11 || t % 10 == 1 && t % 100 != 11 ? 'one' : 'other';\n };\n const it = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n if (ord) return n == 11 || n == 8 || n == 80 || n == 800 ? 'many' : 'other';\n return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const iu = f;\n const ja = e;\n const jbo = e;\n const jgo = a;\n const jmc = a;\n const jv = e;\n const jw = e;\n const ka = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n i100 = i.slice(-2);\n if (ord) return i == 1 ? 'one' : i == 0 || i100 >= 2 && i100 <= 20 || i100 == 40 || i100 == 60 || i100 == 80 ? 'many' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const kab = (n, ord) => {\n if (ord) return 'other';\n return n >= 0 && n < 2 ? 'one' : 'other';\n };\n const kaj = a;\n const kcg = a;\n const kde = e;\n const kea = e;\n const kk = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1);\n if (ord) return n10 == 6 || n10 == 9 || t0 && n10 == 0 && n != 0 ? 'many' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const kkj = a;\n const kl = a;\n const km = e;\n const kn = c;\n const ko = e;\n const ks = a;\n const ksb = a;\n const ksh = (n, ord) => {\n if (ord) return 'other';\n return n == 0 ? 'zero' : n == 1 ? 'one' : 'other';\n };\n const ku = a;\n const kw = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2),\n n1000 = t0 && s[0].slice(-3),\n n100000 = t0 && s[0].slice(-5),\n n1000000 = t0 && s[0].slice(-6);\n if (ord) return t0 && n >= 1 && n <= 4 || n100 >= 1 && n100 <= 4 || n100 >= 21 && n100 <= 24 || n100 >= 41 && n100 <= 44 || n100 >= 61 && n100 <= 64 || n100 >= 81 && n100 <= 84 ? 'one' : n == 5 || n100 == 5 ? 'many' : 'other';\n return n == 0 ? 'zero' : n == 1 ? 'one' : n100 == 2 || n100 == 22 || n100 == 42 || n100 == 62 || n100 == 82 || t0 && n1000 == 0 && (n100000 >= 1000 && n100000 <= 20000 || n100000 == 40000 || n100000 == 60000 || n100000 == 80000) || n != 0 && n1000000 == 100000 ? 'two' : n100 == 3 || n100 == 23 || n100 == 43 || n100 == 63 || n100 == 83 ? 'few' : n != 1 && (n100 == 1 || n100 == 21 || n100 == 41 || n100 == 61 || n100 == 81) ? 'many' : 'other';\n };\n const ky = a;\n const lag = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0];\n if (ord) return 'other';\n return n == 0 ? 'zero' : (i == 0 || i == 1) && n != 0 ? 'one' : 'other';\n };\n const lb = a;\n const lg = a;\n const lij = (n, ord) => {\n const s = String(n).split('.'),\n v0 = !s[1],\n t0 = Number(s[0]) == n;\n if (ord) return n == 11 || n == 8 || t0 && n >= 80 && n <= 89 || t0 && n >= 800 && n <= 899 ? 'many' : 'other';\n return n == 1 && v0 ? 'one' : 'other';\n };\n const lkt = e;\n const ln = b;\n const lo = (n, ord) => {\n if (ord) return n == 1 ? 'one' : 'other';\n return 'other';\n };\n const lt = (n, ord) => {\n const s = String(n).split('.'),\n f = s[1] || '',\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2);\n if (ord) return 'other';\n return n10 == 1 && (n100 < 11 || n100 > 19) ? 'one' : n10 >= 2 && n10 <= 9 && (n100 < 11 || n100 > 19) ? 'few' : f != 0 ? 'many' : 'other';\n };\n const lv = (n, ord) => {\n const s = String(n).split('.'),\n f = s[1] || '',\n v = f.length,\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2),\n f100 = f.slice(-2),\n f10 = f.slice(-1);\n if (ord) return 'other';\n return t0 && n10 == 0 || n100 >= 11 && n100 <= 19 || v == 2 && f100 >= 11 && f100 <= 19 ? 'zero' : n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one' : 'other';\n };\n const mas = a;\n const mg = b;\n const mgo = a;\n const mk = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n if (ord) return i10 == 1 && i100 != 11 ? 'one' : i10 == 2 && i100 != 12 ? 'two' : (i10 == 7 || i10 == 8) && i100 != 17 && i100 != 18 ? 'many' : 'other';\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : 'other';\n };\n const ml = a;\n const mn = a;\n const mo = (n, ord) => {\n const s = String(n).split('.'),\n v0 = !s[1],\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return n == 1 ? 'one' : 'other';\n return n == 1 && v0 ? 'one' : !v0 || n == 0 || n != 1 && n100 >= 1 && n100 <= 19 ? 'few' : 'other';\n };\n const mr = (n, ord) => {\n if (ord) return n == 1 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const ms = (n, ord) => {\n if (ord) return n == 1 ? 'one' : 'other';\n return 'other';\n };\n const mt = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return 'other';\n return n == 1 ? 'one' : n == 2 ? 'two' : n == 0 || n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 19 ? 'many' : 'other';\n };\n const my = e;\n const nah = a;\n const naq = f;\n const nb = a;\n const nd = a;\n const ne = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n if (ord) return t0 && n >= 1 && n <= 4 ? 'one' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const nl = d;\n const nn = a;\n const nnh = a;\n const no = a;\n const nqo = e;\n const nr = a;\n const nso = b;\n const ny = a;\n const nyn = a;\n const om = a;\n const or = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n if (ord) return n == 1 || n == 5 || t0 && n >= 7 && n <= 9 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const os = a;\n const osa = e;\n const pa = b;\n const pap = a;\n const pcm = c;\n const pl = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return 'other';\n return n == 1 && v0 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i != 1 && (i10 == 0 || i10 == 1) || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 12 && i100 <= 14 ? 'many' : 'other';\n };\n const prg = (n, ord) => {\n const s = String(n).split('.'),\n f = s[1] || '',\n v = f.length,\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2),\n f100 = f.slice(-2),\n f10 = f.slice(-1);\n if (ord) return 'other';\n return t0 && n10 == 0 || n100 >= 11 && n100 <= 19 || v == 2 && f100 >= 11 && f100 <= 19 ? 'zero' : n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one' : 'other';\n };\n const ps = a;\n const pt = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n if (ord) return 'other';\n return i == 0 || i == 1 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const pt_PT = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n if (ord) return 'other';\n return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const rm = a;\n const ro = (n, ord) => {\n const s = String(n).split('.'),\n v0 = !s[1],\n t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return n == 1 ? 'one' : 'other';\n return n == 1 && v0 ? 'one' : !v0 || n == 0 || n != 1 && n100 >= 1 && n100 <= 19 ? 'few' : 'other';\n };\n const rof = a;\n const ru = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return 'other';\n return v0 && i10 == 1 && i100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i10 == 0 || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 11 && i100 <= 14 ? 'many' : 'other';\n };\n const rwk = a;\n const sah = e;\n const saq = a;\n const sat = f;\n const sc = (n, ord) => {\n const s = String(n).split('.'),\n v0 = !s[1];\n if (ord) return n == 11 || n == 8 || n == 80 || n == 800 ? 'many' : 'other';\n return n == 1 && v0 ? 'one' : 'other';\n };\n const scn = (n, ord) => {\n const s = String(n).split('.'),\n v0 = !s[1];\n if (ord) return n == 11 || n == 8 || n == 80 || n == 800 ? 'many' : 'other';\n return n == 1 && v0 ? 'one' : 'other';\n };\n const sd = a;\n const sdh = a;\n const se = f;\n const seh = a;\n const ses = e;\n const sg = e;\n const sh = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n if (ord) return 'other';\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other';\n };\n const shi = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n if (ord) return 'other';\n return n >= 0 && n <= 1 ? 'one' : t0 && n >= 2 && n <= 10 ? 'few' : 'other';\n };\n const si = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '';\n if (ord) return 'other';\n return n == 0 || n == 1 || i == 0 && f == 1 ? 'one' : 'other';\n };\n const sk = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1];\n if (ord) return 'other';\n return n == 1 && v0 ? 'one' : i >= 2 && i <= 4 && v0 ? 'few' : !v0 ? 'many' : 'other';\n };\n const sl = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i100 = i.slice(-2);\n if (ord) return 'other';\n return v0 && i100 == 1 ? 'one' : v0 && i100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || !v0 ? 'few' : 'other';\n };\n const sma = f;\n const smi = f;\n const smj = f;\n const smn = f;\n const sms = f;\n const sn = a;\n const so = a;\n const sq = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2);\n if (ord) return n == 1 ? 'one' : n10 == 4 && n100 != 14 ? 'many' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const sr = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n i100 = i.slice(-2),\n f10 = f.slice(-1),\n f100 = f.slice(-2);\n if (ord) return 'other';\n return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other';\n };\n const ss = a;\n const ssy = a;\n const st = a;\n const su = e;\n const sv = (n, ord) => {\n const s = String(n).split('.'),\n v0 = !s[1],\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2);\n if (ord) return (n10 == 1 || n10 == 2) && n100 != 11 && n100 != 12 ? 'one' : 'other';\n return n == 1 && v0 ? 'one' : 'other';\n };\n const sw = d;\n const syr = a;\n const ta = a;\n const te = a;\n const teo = a;\n const th = e;\n const ti = b;\n const tig = a;\n const tk = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1);\n if (ord) return n10 == 6 || n10 == 9 || n == 10 ? 'few' : 'other';\n return n == 1 ? 'one' : 'other';\n };\n const tl = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n f = s[1] || '',\n v0 = !s[1],\n i10 = i.slice(-1),\n f10 = f.slice(-1);\n if (ord) return n == 1 ? 'one' : 'other';\n return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other';\n };\n const tn = a;\n const to = e;\n const tpi = e;\n const tr = a;\n const ts = a;\n const tzm = (n, ord) => {\n const s = String(n).split('.'),\n t0 = Number(s[0]) == n;\n if (ord) return 'other';\n return n == 0 || n == 1 || t0 && n >= 11 && n <= 99 ? 'one' : 'other';\n };\n const ug = a;\n const uk = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2),\n i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return n10 == 3 && n100 != 13 ? 'few' : 'other';\n return v0 && i10 == 1 && i100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i10 == 0 || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 11 && i100 <= 14 ? 'many' : 'other';\n };\n const und = e;\n const ur = d;\n const uz = a;\n const ve = a;\n const vec = (n, ord) => {\n const s = String(n).split('.'),\n i = s[0],\n v0 = !s[1],\n i1000000 = i.slice(-6);\n if (ord) return n == 11 || n == 8 || n == 80 || n == 800 ? 'many' : 'other';\n return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other';\n };\n const vi = (n, ord) => {\n if (ord) return n == 1 ? 'one' : 'other';\n return 'other';\n };\n const vo = a;\n const vun = a;\n const wa = b;\n const wae = a;\n const wo = e;\n const xh = a;\n const xog = a;\n const yi = d;\n const yo = e;\n const yue = e;\n const zh = e;\n const zu = c;\n var Plurals = /*#__PURE__*/Object.freeze({\n __proto__: null,\n af: af,\n ak: ak,\n am: am,\n an: an,\n ar: ar,\n ars: ars,\n as: as,\n asa: asa,\n ast: ast,\n az: az,\n bal: bal,\n be: be,\n bem: bem,\n bez: bez,\n bg: bg,\n bho: bho,\n bm: bm,\n bn: bn,\n bo: bo,\n br: br,\n brx: brx,\n bs: bs,\n ca: ca,\n ce: ce,\n ceb: ceb,\n cgg: cgg,\n chr: chr,\n ckb: ckb,\n cs: cs,\n cy: cy,\n da: da,\n de: de,\n doi: doi,\n dsb: dsb,\n dv: dv,\n dz: dz,\n ee: ee,\n el: el,\n en: en,\n eo: eo,\n es: es,\n et: et,\n eu: eu,\n fa: fa,\n ff: ff,\n fi: fi,\n fil: fil,\n fo: fo,\n fr: fr,\n fur: fur,\n fy: fy,\n ga: ga,\n gd: gd,\n gl: gl,\n gsw: gsw,\n gu: gu,\n guw: guw,\n gv: gv,\n ha: ha,\n haw: haw,\n he: he,\n hi: hi,\n hnj: hnj,\n hr: hr,\n hsb: hsb,\n hu: hu,\n hy: hy,\n ia: ia,\n id: id,\n ig: ig,\n ii: ii,\n io: io,\n is: is,\n it: it,\n iu: iu,\n ja: ja,\n jbo: jbo,\n jgo: jgo,\n jmc: jmc,\n jv: jv,\n jw: jw,\n ka: ka,\n kab: kab,\n kaj: kaj,\n kcg: kcg,\n kde: kde,\n kea: kea,\n kk: kk,\n kkj: kkj,\n kl: kl,\n km: km,\n kn: kn,\n ko: ko,\n ks: ks,\n ksb: ksb,\n ksh: ksh,\n ku: ku,\n kw: kw,\n ky: ky,\n lag: lag,\n lb: lb,\n lg: lg,\n lij: lij,\n lkt: lkt,\n ln: ln,\n lo: lo,\n lt: lt,\n lv: lv,\n mas: mas,\n mg: mg,\n mgo: mgo,\n mk: mk,\n ml: ml,\n mn: mn,\n mo: mo,\n mr: mr,\n ms: ms,\n mt: mt,\n my: my,\n nah: nah,\n naq: naq,\n nb: nb,\n nd: nd,\n ne: ne,\n nl: nl,\n nn: nn,\n nnh: nnh,\n no: no,\n nqo: nqo,\n nr: nr,\n nso: nso,\n ny: ny,\n nyn: nyn,\n om: om,\n or: or,\n os: os,\n osa: osa,\n pa: pa,\n pap: pap,\n pcm: pcm,\n pl: pl,\n prg: prg,\n ps: ps,\n pt: pt,\n pt_PT: pt_PT,\n rm: rm,\n ro: ro,\n rof: rof,\n ru: ru,\n rwk: rwk,\n sah: sah,\n saq: saq,\n sat: sat,\n sc: sc,\n scn: scn,\n sd: sd,\n sdh: sdh,\n se: se,\n seh: seh,\n ses: ses,\n sg: sg,\n sh: sh,\n shi: shi,\n si: si,\n sk: sk,\n sl: sl,\n sma: sma,\n smi: smi,\n smj: smj,\n smn: smn,\n sms: sms,\n sn: sn,\n so: so,\n sq: sq,\n sr: sr,\n ss: ss,\n ssy: ssy,\n st: st,\n su: su,\n sv: sv,\n sw: sw,\n syr: syr,\n ta: ta,\n te: te,\n teo: teo,\n th: th,\n ti: ti,\n tig: tig,\n tk: tk,\n tl: tl,\n tn: tn,\n to: to,\n tpi: tpi,\n tr: tr,\n ts: ts,\n tzm: tzm,\n ug: ug,\n uk: uk,\n und: und,\n ur: ur,\n uz: uz,\n ve: ve,\n vec: vec,\n vi: vi,\n vo: vo,\n vun: vun,\n wa: wa,\n wae: wae,\n wo: wo,\n xh: xh,\n xog: xog,\n yi: yi,\n yo: yo,\n yue: yue,\n zh: zh,\n zu: zu\n });\n function normalize(locale) {\n if (typeof locale !== 'string' || locale.length < 2) {\n throw new RangeError(\"Invalid language tag: \".concat(locale));\n }\n if (locale.startsWith('pt-PT')) return 'pt-PT';\n var m = locale.match(/.+?(?=[-_])/);\n return m ? m[0] : locale;\n }\n function getPlural(locale) {\n if (typeof locale === 'function') {\n var lc_1 = normalize(locale.name);\n return {\n isDefault: false,\n id: identifier(lc_1),\n lc: lc_1,\n locale: locale.name,\n getPlural: locale,\n cardinals: locale.cardinals || [],\n ordinals: locale.ordinals || []\n };\n }\n var lc = normalize(locale);\n var id = identifier(lc);\n if (isPluralId(id)) {\n return {\n isDefault: true,\n id: id,\n lc: lc,\n locale: locale,\n getCardinal: Cardinals[id],\n getPlural: Plurals[id],\n cardinals: PluralCategories[id].cardinal,\n ordinals: PluralCategories[id].ordinal\n };\n }\n return null;\n }\n function getAllPlurals(firstLocale) {\n var keys = Object.keys(Plurals).filter(function (key) {\n return key !== firstLocale;\n });\n keys.unshift(firstLocale);\n return keys.map(getPlural);\n }\n function hasPlural(locale) {\n var lc = normalize(locale);\n return identifier(lc) in Plurals;\n }\n function isPluralId(id) {\n return id in Plurals;\n }\n var MessageFormat = function () {\n function MessageFormat(locale, options) {\n this.plurals = [];\n this.options = Object.assign({\n biDiSupport: false,\n currency: 'USD',\n customFormatters: {},\n localeCodeFromKey: null,\n requireAllArguments: false,\n returnType: 'string',\n strict: options && options.strictNumberSign || false,\n strictPluralKeys: true\n }, options);\n if (locale === '*') {\n this.plurals = getAllPlurals(MessageFormat.defaultLocale);\n } else if (Array.isArray(locale)) {\n this.plurals = locale.map(getPlural).filter(Boolean);\n } else if (locale) {\n var pl = getPlural(locale);\n if (pl) this.plurals = [pl];\n }\n if (this.plurals.length === 0) {\n var pl = getPlural(MessageFormat.defaultLocale);\n this.plurals = [pl];\n }\n }\n MessageFormat.escape = function (str, octothorpe) {\n var esc = octothorpe ? /[#{}]/g : /[{}]/g;\n return String(str).replace(esc, \"'$&'\");\n };\n MessageFormat.supportedLocalesOf = function (locales) {\n var la = Array.isArray(locales) ? locales : [locales];\n return la.filter(hasPlural);\n };\n MessageFormat.prototype.resolvedOptions = function () {\n return __assign(__assign({}, this.options), {\n locale: this.plurals[0].locale,\n plurals: this.plurals\n });\n };\n MessageFormat.prototype.compile = function (message) {\n var e_1, _a;\n var compiler = new Compiler(this.options);\n var fnBody = 'return ' + compiler.compile(message, this.plurals[0]);\n var nfArgs = [];\n var fnArgs = [];\n try {\n for (var _b = __values(Object.entries(compiler.runtime)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read(_c.value, 2),\n key = _d[0],\n fmt = _d[1];\n nfArgs.push(key);\n fnArgs.push(fmt);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n var fn = new (Function.bind.apply(Function, __spreadArray(__spreadArray([void 0], __read(nfArgs), false), [fnBody], false)))();\n return fn.apply(void 0, __spreadArray([], __read(fnArgs), false));\n };\n MessageFormat.defaultLocale = 'en';\n return MessageFormat;\n }();\n return MessageFormat;\n});","/**\n * @license Angular v18.2.7\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\n/**\n * The default equality function used for `signal` and `computed`, which uses referential equality.\n */\nfunction defaultEquals(a, b) {\n return Object.is(a, b);\n}\n\n/**\n * The currently active consumer `ReactiveNode`, if running code in a reactive context.\n *\n * Change this via `setActiveConsumer`.\n */\nlet activeConsumer = null;\nlet inNotificationPhase = false;\n/**\n * Global epoch counter. Incremented whenever a source signal is set.\n */\nlet epoch = 1;\n/**\n * Symbol used to tell `Signal`s apart from other functions.\n *\n * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.\n */\nconst SIGNAL = /* @__PURE__ */Symbol('SIGNAL');\nfunction setActiveConsumer(consumer) {\n const prev = activeConsumer;\n activeConsumer = consumer;\n return prev;\n}\nfunction getActiveConsumer() {\n return activeConsumer;\n}\nfunction isInNotificationPhase() {\n return inNotificationPhase;\n}\nfunction isReactive(value) {\n return value[SIGNAL] !== undefined;\n}\nconst REACTIVE_NODE = {\n version: 0,\n lastCleanEpoch: 0,\n dirty: false,\n producerNode: undefined,\n producerLastReadVersion: undefined,\n producerIndexOfThis: undefined,\n nextProducerIndex: 0,\n liveConsumerNode: undefined,\n liveConsumerIndexOfThis: undefined,\n consumerAllowSignalWrites: false,\n consumerIsAlwaysLive: false,\n producerMustRecompute: () => false,\n producerRecomputeValue: () => {},\n consumerMarkedDirty: () => {},\n consumerOnSignalRead: () => {}\n};\n/**\n * Called by implementations when a producer's signal is read.\n */\nfunction producerAccessed(node) {\n if (inNotificationPhase) {\n throw new Error(typeof ngDevMode !== 'undefined' && ngDevMode ? `Assertion error: signal read during notification phase` : '');\n }\n if (activeConsumer === null) {\n // Accessed outside of a reactive context, so nothing to record.\n return;\n }\n activeConsumer.consumerOnSignalRead(node);\n // This producer is the `idx`th dependency of `activeConsumer`.\n const idx = activeConsumer.nextProducerIndex++;\n assertConsumerNode(activeConsumer);\n if (idx < activeConsumer.producerNode.length && activeConsumer.producerNode[idx] !== node) {\n // There's been a change in producers since the last execution of `activeConsumer`.\n // `activeConsumer.producerNode[idx]` holds a stale dependency which will be be removed and\n // replaced with `this`.\n //\n // If `activeConsumer` isn't live, then this is a no-op, since we can replace the producer in\n // `activeConsumer.producerNode` directly. However, if `activeConsumer` is live, then we need\n // to remove it from the stale producer's `liveConsumer`s.\n if (consumerIsLive(activeConsumer)) {\n const staleProducer = activeConsumer.producerNode[idx];\n producerRemoveLiveConsumerAtIndex(staleProducer, activeConsumer.producerIndexOfThis[idx]);\n // At this point, the only record of `staleProducer` is the reference at\n // `activeConsumer.producerNode[idx]` which will be overwritten below.\n }\n }\n if (activeConsumer.producerNode[idx] !== node) {\n // We're a new dependency of the consumer (at `idx`).\n activeConsumer.producerNode[idx] = node;\n // If the active consumer is live, then add it as a live consumer. If not, then use 0 as a\n // placeholder value.\n activeConsumer.producerIndexOfThis[idx] = consumerIsLive(activeConsumer) ? producerAddLiveConsumer(node, activeConsumer, idx) : 0;\n }\n activeConsumer.producerLastReadVersion[idx] = node.version;\n}\n/**\n * Increment the global epoch counter.\n *\n * Called by source producers (that is, not computeds) whenever their values change.\n */\nfunction producerIncrementEpoch() {\n epoch++;\n}\n/**\n * Ensure this producer's `version` is up-to-date.\n */\nfunction producerUpdateValueVersion(node) {\n if (consumerIsLive(node) && !node.dirty) {\n // A live consumer will be marked dirty by producers, so a clean state means that its version\n // is guaranteed to be up-to-date.\n return;\n }\n if (!node.dirty && node.lastCleanEpoch === epoch) {\n // Even non-live consumers can skip polling if they previously found themselves to be clean at\n // the current epoch, since their dependencies could not possibly have changed (such a change\n // would've increased the epoch).\n return;\n }\n if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {\n // None of our producers report a change since the last time they were read, so no\n // recomputation of our value is necessary, and we can consider ourselves clean.\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n return;\n }\n node.producerRecomputeValue(node);\n // After recomputing the value, we're no longer dirty.\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n}\n/**\n * Propagate a dirty notification to live consumers of this producer.\n */\nfunction producerNotifyConsumers(node) {\n if (node.liveConsumerNode === undefined) {\n return;\n }\n // Prevent signal reads when we're updating the graph\n const prev = inNotificationPhase;\n inNotificationPhase = true;\n try {\n for (const consumer of node.liveConsumerNode) {\n if (!consumer.dirty) {\n consumerMarkDirty(consumer);\n }\n }\n } finally {\n inNotificationPhase = prev;\n }\n}\n/**\n * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,\n * based on the current consumer context.\n */\nfunction producerUpdatesAllowed() {\n return activeConsumer?.consumerAllowSignalWrites !== false;\n}\nfunction consumerMarkDirty(node) {\n node.dirty = true;\n producerNotifyConsumers(node);\n node.consumerMarkedDirty?.(node);\n}\n/**\n * Prepare this consumer to run a computation in its reactive context.\n *\n * Must be called by subclasses which represent reactive computations, before those computations\n * begin.\n */\nfunction consumerBeforeComputation(node) {\n node && (node.nextProducerIndex = 0);\n return setActiveConsumer(node);\n}\n/**\n * Finalize this consumer's state after a reactive computation has run.\n *\n * Must be called by subclasses which represent reactive computations, after those computations\n * have finished.\n */\nfunction consumerAfterComputation(node, prevConsumer) {\n setActiveConsumer(prevConsumer);\n if (!node || node.producerNode === undefined || node.producerIndexOfThis === undefined || node.producerLastReadVersion === undefined) {\n return;\n }\n if (consumerIsLive(node)) {\n // For live consumers, we need to remove the producer -> consumer edge for any stale producers\n // which weren't dependencies after the recomputation.\n for (let i = node.nextProducerIndex; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Truncate the producer tracking arrays.\n // Perf note: this is essentially truncating the length to `node.nextProducerIndex`, but\n // benchmarking has shown that individual pop operations are faster.\n while (node.producerNode.length > node.nextProducerIndex) {\n node.producerNode.pop();\n node.producerLastReadVersion.pop();\n node.producerIndexOfThis.pop();\n }\n}\n/**\n * Determine whether this consumer has any dependencies which have changed since the last time\n * they were read.\n */\nfunction consumerPollProducersForChange(node) {\n assertConsumerNode(node);\n // Poll producers for change.\n for (let i = 0; i < node.producerNode.length; i++) {\n const producer = node.producerNode[i];\n const seenVersion = node.producerLastReadVersion[i];\n // First check the versions. A mismatch means that the producer's value is known to have\n // changed since the last time we read it.\n if (seenVersion !== producer.version) {\n return true;\n }\n // The producer's version is the same as the last time we read it, but it might itself be\n // stale. Force the producer to recompute its version (calculating a new value if necessary).\n producerUpdateValueVersion(producer);\n // Now when we do this check, `producer.version` is guaranteed to be up to date, so if the\n // versions still match then it has not changed since the last time we read it.\n if (seenVersion !== producer.version) {\n return true;\n }\n }\n return false;\n}\n/**\n * Disconnect this consumer from the graph.\n */\nfunction consumerDestroy(node) {\n assertConsumerNode(node);\n if (consumerIsLive(node)) {\n // Drop all connections from the graph to this node.\n for (let i = 0; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Truncate all the arrays to drop all connection from this node to the graph.\n node.producerNode.length = node.producerLastReadVersion.length = node.producerIndexOfThis.length = 0;\n if (node.liveConsumerNode) {\n node.liveConsumerNode.length = node.liveConsumerIndexOfThis.length = 0;\n }\n}\n/**\n * Add `consumer` as a live consumer of this node.\n *\n * Note that this operation is potentially transitive. If this node becomes live, then it becomes\n * a live consumer of all of its current producers.\n */\nfunction producerAddLiveConsumer(node, consumer, indexOfThis) {\n assertProducerNode(node);\n if (node.liveConsumerNode.length === 0 && isConsumerNode(node)) {\n // When going from 0 to 1 live consumers, we become a live consumer to our producers.\n for (let i = 0; i < node.producerNode.length; i++) {\n node.producerIndexOfThis[i] = producerAddLiveConsumer(node.producerNode[i], node, i);\n }\n }\n node.liveConsumerIndexOfThis.push(indexOfThis);\n return node.liveConsumerNode.push(consumer) - 1;\n}\n/**\n * Remove the live consumer at `idx`.\n */\nfunction producerRemoveLiveConsumerAtIndex(node, idx) {\n assertProducerNode(node);\n if (typeof ngDevMode !== 'undefined' && ngDevMode && idx >= node.liveConsumerNode.length) {\n throw new Error(`Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`);\n }\n if (node.liveConsumerNode.length === 1 && isConsumerNode(node)) {\n // When removing the last live consumer, we will no longer be live. We need to remove\n // ourselves from our producers' tracking (which may cause consumer-producers to lose\n // liveness as well).\n for (let i = 0; i < node.producerNode.length; i++) {\n producerRemoveLiveConsumerAtIndex(node.producerNode[i], node.producerIndexOfThis[i]);\n }\n }\n // Move the last value of `liveConsumers` into `idx`. Note that if there's only a single\n // live consumer, this is a no-op.\n const lastIdx = node.liveConsumerNode.length - 1;\n node.liveConsumerNode[idx] = node.liveConsumerNode[lastIdx];\n node.liveConsumerIndexOfThis[idx] = node.liveConsumerIndexOfThis[lastIdx];\n // Truncate the array.\n node.liveConsumerNode.length--;\n node.liveConsumerIndexOfThis.length--;\n // If the index is still valid, then we need to fix the index pointer from the producer to this\n // consumer, and update it from `lastIdx` to `idx` (accounting for the move above).\n if (idx < node.liveConsumerNode.length) {\n const idxProducer = node.liveConsumerIndexOfThis[idx];\n const consumer = node.liveConsumerNode[idx];\n assertConsumerNode(consumer);\n consumer.producerIndexOfThis[idxProducer] = idx;\n }\n}\nfunction consumerIsLive(node) {\n return node.consumerIsAlwaysLive || (node?.liveConsumerNode?.length ?? 0) > 0;\n}\nfunction assertConsumerNode(node) {\n node.producerNode ??= [];\n node.producerIndexOfThis ??= [];\n node.producerLastReadVersion ??= [];\n}\nfunction assertProducerNode(node) {\n node.liveConsumerNode ??= [];\n node.liveConsumerIndexOfThis ??= [];\n}\nfunction isConsumerNode(node) {\n return node.producerNode !== undefined;\n}\n\n/**\n * Create a computed signal which derives a reactive value from an expression.\n */\nfunction createComputed(computation) {\n const node = Object.create(COMPUTED_NODE);\n node.computation = computation;\n const computed = () => {\n // Check if the value needs updating before returning it.\n producerUpdateValueVersion(node);\n // Record that someone looked at this signal.\n producerAccessed(node);\n if (node.value === ERRORED) {\n throw node.error;\n }\n return node.value;\n };\n computed[SIGNAL] = node;\n return computed;\n}\n/**\n * A dedicated symbol used before a computed value has been calculated for the first time.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst UNSET = /* @__PURE__ */Symbol('UNSET');\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * is in progress. Used to detect cycles in computation chains.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst COMPUTING = /* @__PURE__ */Symbol('COMPUTING');\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * failed. The thrown error is cached until the computation gets dirty again.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst ERRORED = /* @__PURE__ */Symbol('ERRORED');\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst COMPUTED_NODE = /* @__PURE__ */(() => {\n return {\n ...REACTIVE_NODE,\n value: UNSET,\n dirty: true,\n error: null,\n equal: defaultEquals,\n producerMustRecompute(node) {\n // Force a recomputation if there's no current value, or if the current value is in the\n // process of being calculated (which should throw an error).\n return node.value === UNSET || node.value === COMPUTING;\n },\n producerRecomputeValue(node) {\n if (node.value === COMPUTING) {\n // Our computation somehow led to a cyclic read of itself.\n throw new Error('Detected cycle in computations.');\n }\n const oldValue = node.value;\n node.value = COMPUTING;\n const prevConsumer = consumerBeforeComputation(node);\n let newValue;\n try {\n newValue = node.computation();\n } catch (err) {\n newValue = ERRORED;\n node.error = err;\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n if (oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED && node.equal(oldValue, newValue)) {\n // No change to `valueVersion` - old and new values are\n // semantically equivalent.\n node.value = oldValue;\n return;\n }\n node.value = newValue;\n node.version++;\n }\n };\n})();\nfunction defaultThrowError() {\n throw new Error();\n}\nlet throwInvalidWriteToSignalErrorFn = defaultThrowError;\nfunction throwInvalidWriteToSignalError() {\n throwInvalidWriteToSignalErrorFn();\n}\nfunction setThrowInvalidWriteToSignalError(fn) {\n throwInvalidWriteToSignalErrorFn = fn;\n}\n\n/**\n * If set, called after `WritableSignal`s are updated.\n *\n * This hook can be used to achieve various effects, such as running effects synchronously as part\n * of setting a signal.\n */\nlet postSignalSetFn = null;\n/**\n * Create a `Signal` that can be set or updated directly.\n */\nfunction createSignal(initialValue) {\n const node = Object.create(SIGNAL_NODE);\n node.value = initialValue;\n const getter = () => {\n producerAccessed(node);\n return node.value;\n };\n getter[SIGNAL] = node;\n return getter;\n}\nfunction setPostSignalSetFn(fn) {\n const prev = postSignalSetFn;\n postSignalSetFn = fn;\n return prev;\n}\nfunction signalGetFn() {\n producerAccessed(this);\n return this.value;\n}\nfunction signalSetFn(node, newValue) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError();\n }\n if (!node.equal(node.value, newValue)) {\n node.value = newValue;\n signalValueChanged(node);\n }\n}\nfunction signalUpdateFn(node, updater) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError();\n }\n signalSetFn(node, updater(node.value));\n}\nfunction runPostSignalSetFn() {\n postSignalSetFn?.();\n}\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst SIGNAL_NODE = /* @__PURE__ */(() => {\n return {\n ...REACTIVE_NODE,\n equal: defaultEquals,\n value: undefined\n };\n})();\nfunction signalValueChanged(node) {\n node.version++;\n producerIncrementEpoch();\n producerNotifyConsumers(node);\n postSignalSetFn?.();\n}\nfunction createWatch(fn, schedule, allowSignalWrites) {\n const node = Object.create(WATCH_NODE);\n if (allowSignalWrites) {\n node.consumerAllowSignalWrites = true;\n }\n node.fn = fn;\n node.schedule = schedule;\n const registerOnCleanup = cleanupFn => {\n node.cleanupFn = cleanupFn;\n };\n function isWatchNodeDestroyed(node) {\n return node.fn === null && node.schedule === null;\n }\n function destroyWatchNode(node) {\n if (!isWatchNodeDestroyed(node)) {\n consumerDestroy(node); // disconnect watcher from the reactive graph\n node.cleanupFn();\n // nullify references to the integration functions to mark node as destroyed\n node.fn = null;\n node.schedule = null;\n node.cleanupFn = NOOP_CLEANUP_FN;\n }\n }\n const run = () => {\n if (node.fn === null) {\n // trying to run a destroyed watch is noop\n return;\n }\n if (isInNotificationPhase()) {\n throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);\n }\n node.dirty = false;\n if (node.hasRun && !consumerPollProducersForChange(node)) {\n return;\n }\n node.hasRun = true;\n const prevConsumer = consumerBeforeComputation(node);\n try {\n node.cleanupFn();\n node.cleanupFn = NOOP_CLEANUP_FN;\n node.fn(registerOnCleanup);\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n };\n node.ref = {\n notify: () => consumerMarkDirty(node),\n run,\n cleanup: () => node.cleanupFn(),\n destroy: () => destroyWatchNode(node),\n [SIGNAL]: node\n };\n return node.ref;\n}\nconst NOOP_CLEANUP_FN = () => {};\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst WATCH_NODE = /* @__PURE__ */(() => {\n return {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n consumerAllowSignalWrites: false,\n consumerMarkedDirty: node => {\n if (node.schedule !== null) {\n node.schedule(node.ref);\n }\n },\n hasRun: false,\n cleanupFn: NOOP_CLEANUP_FN\n };\n})();\nfunction setAlternateWeakRefImpl(impl) {\n // TODO: remove this function\n}\nexport { REACTIVE_NODE, SIGNAL, SIGNAL_NODE, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, createComputed, createSignal, createWatch, defaultEquals, getActiveConsumer, isInNotificationPhase, isReactive, producerAccessed, producerIncrementEpoch, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, runPostSignalSetFn, setActiveConsumer, setAlternateWeakRefImpl, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalSetFn, signalUpdateFn };\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n","export function createErrorClass(createImpl) {\n const _super = instance => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n","import { createErrorClass } from './createErrorClass';\nexport const UnsubscriptionError = createErrorClass(_super => function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}` : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n});\n","export function arrRemove(arr, item) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nexport class Subscription {\n constructor(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n unsubscribe() {\n let errors;\n if (!this.closed) {\n this.closed = true;\n const {\n _parentage\n } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n const {\n initialTeardown: initialFinalizer\n } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n const {\n _finalizers\n } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n add(teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n }\n _hasParent(parent) {\n const {\n _parentage\n } = this;\n return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent);\n }\n _addParent(parent) {\n const {\n _parentage\n } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n _removeParent(parent) {\n const {\n _parentage\n } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n remove(teardown) {\n const {\n _finalizers\n } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\nSubscription.EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n})();\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return value instanceof Subscription || value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe);\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n","export const config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false\n};\n","export const timeoutProvider = {\n setTimeout(handler, timeout, ...args) {\n const {\n delegate\n } = timeoutProvider;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const {\n delegate\n } = timeoutProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined\n};\n","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(() => {\n const {\n onUnhandledError\n } = config;\n if (onUnhandledError) {\n onUnhandledError(err);\n } else {\n throw err;\n }\n });\n}\n","export function noop() {}\n","export const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind,\n value,\n error\n };\n}\n","import { config } from '../config';\nlet context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = {\n errorThrown: false,\n error: null\n };\n }\n cb();\n if (isRoot) {\n const {\n errorThrown,\n error\n } = context;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nexport class Subscriber extends Subscription {\n constructor(destination) {\n super();\n this.isStopped = false;\n if (destination) {\n this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n static create(next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n }\n next(value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value);\n }\n }\n error(err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n complete() {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n unsubscribe() {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null;\n }\n }\n _next(value) {\n this.destination.next(value);\n }\n _error(err) {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n _complete() {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\nconst _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nclass ConsumerObserver {\n constructor(partialObserver) {\n this.partialObserver = partialObserver;\n }\n next(value) {\n const {\n partialObserver\n } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n error(err) {\n const {\n partialObserver\n } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n complete() {\n const {\n partialObserver\n } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\nexport class SafeSubscriber extends Subscriber {\n constructor(observerOrNext, error, complete) {\n super();\n let partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined\n };\n } else {\n let context;\n if (this && config.useDeprecatedNextContext) {\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context)\n };\n } else {\n partialObserver = observerOrNext;\n }\n }\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n const {\n onStoppedNotification\n } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\nexport const EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop\n};\n","export const observable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();\n","export function identity(x) {\n return x;\n}\n","import { identity } from './identity';\nexport function pipe(...fns) {\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce((prev, fn) => fn(prev), input);\n };\n}\n","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nexport class Observable {\n constructor(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n lift(operator) {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n subscribe(observerOrNext, error, complete) {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(() => {\n const {\n operator,\n source\n } = this;\n subscriber.add(operator ? operator.call(subscriber, source) : source ? this._subscribe(subscriber) : this._trySubscribe(subscriber));\n });\n return subscriber;\n }\n _trySubscribe(sink) {\n try {\n return this._subscribe(sink);\n } catch (err) {\n sink.error(err);\n }\n }\n forEach(next, promiseCtor) {\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor((resolve, reject) => {\n const subscriber = new SafeSubscriber({\n next: value => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n this.subscribe(subscriber);\n });\n }\n _subscribe(subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n }\n [Symbol_observable]() {\n return this;\n }\n pipe(...operations) {\n return pipeFromArray(operations)(this);\n }\n toPromise(promiseCtor) {\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor((resolve, reject) => {\n let value;\n this.subscribe(x => value = x, err => reject(err), () => resolve(value));\n });\n }\n}\nObservable.create = subscribe => {\n return new Observable(subscribe);\n};\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return value && value instanceof Subscriber || isObserver(value) && isSubscription(value);\n}\n","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return source => {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n","import { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nexport class OperatorSubscriber extends Subscriber {\n constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n super(destination);\n this.onFinalize = onFinalize;\n this.shouldUnsubscribe = shouldUnsubscribe;\n this._next = onNext ? function (value) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n } : super._next;\n this._error = onError ? function (err) {\n try {\n onError(err);\n } catch (err) {\n destination.error(err);\n } finally {\n this.unsubscribe();\n }\n } : super._error;\n this._complete = onComplete ? function () {\n try {\n onComplete();\n } catch (err) {\n destination.error(err);\n } finally {\n this.unsubscribe();\n }\n } : super._complete;\n }\n unsubscribe() {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const {\n closed\n } = this;\n super.unsubscribe();\n !closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n }\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function refCount() {\n return operate((source, subscriber) => {\n let connection = null;\n source._refCount++;\n const refCounter = createOperatorSubscriber(subscriber, undefined, undefined, undefined, () => {\n if (!source || source._refCount <= 0 || 0 < --source._refCount) {\n connection = null;\n return;\n }\n const sharedConnection = source._connection;\n const conn = connection;\n connection = null;\n if (sharedConnection && (!conn || sharedConnection === conn)) {\n sharedConnection.unsubscribe();\n }\n subscriber.unsubscribe();\n });\n source.subscribe(refCounter);\n if (!refCounter.closed) {\n connection = source.connect();\n }\n });\n}\n","import { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { refCount as higherOrderRefCount } from '../operators/refCount';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { hasLift } from '../util/lift';\nexport class ConnectableObservable extends Observable {\n constructor(source, subjectFactory) {\n super();\n this.source = source;\n this.subjectFactory = subjectFactory;\n this._subject = null;\n this._refCount = 0;\n this._connection = null;\n if (hasLift(source)) {\n this.lift = source.lift;\n }\n }\n _subscribe(subscriber) {\n return this.getSubject().subscribe(subscriber);\n }\n getSubject() {\n const subject = this._subject;\n if (!subject || subject.isStopped) {\n this._subject = this.subjectFactory();\n }\n return this._subject;\n }\n _teardown() {\n this._refCount = 0;\n const {\n _connection\n } = this;\n this._subject = this._connection = null;\n _connection === null || _connection === void 0 ? void 0 : _connection.unsubscribe();\n }\n connect() {\n let connection = this._connection;\n if (!connection) {\n connection = this._connection = new Subscription();\n const subject = this.getSubject();\n connection.add(this.source.subscribe(createOperatorSubscriber(subject, undefined, () => {\n this._teardown();\n subject.complete();\n }, err => {\n this._teardown();\n subject.error(err);\n }, () => this._teardown())));\n if (connection.closed) {\n this._connection = null;\n connection = Subscription.EMPTY;\n }\n }\n return connection;\n }\n refCount() {\n return higherOrderRefCount()(this);\n }\n}\n","import { Subscription } from '../Subscription';\nexport const animationFrameProvider = {\n schedule(callback) {\n let request = requestAnimationFrame;\n let cancel = cancelAnimationFrame;\n const {\n delegate\n } = animationFrameProvider;\n if (delegate) {\n request = delegate.requestAnimationFrame;\n cancel = delegate.cancelAnimationFrame;\n }\n const handle = request(timestamp => {\n cancel = undefined;\n callback(timestamp);\n });\n return new Subscription(() => cancel === null || cancel === void 0 ? void 0 : cancel(handle));\n },\n requestAnimationFrame(...args) {\n const {\n delegate\n } = animationFrameProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame)(...args);\n },\n cancelAnimationFrame(...args) {\n const {\n delegate\n } = animationFrameProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame)(...args);\n },\n delegate: undefined\n};\n","import { createErrorClass } from './createErrorClass';\nexport const ObjectUnsubscribedError = createErrorClass(_super => function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n});\n","import { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nexport class Subject extends Observable {\n constructor() {\n super();\n this.closed = false;\n this.currentObservers = null;\n this.observers = [];\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n lift(operator) {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n }\n _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n next(value) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n error(err) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const {\n observers\n } = this;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n }\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const {\n observers\n } = this;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n }\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n }\n get observed() {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n }\n _trySubscribe(subscriber) {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n _subscribe(subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n _innerSubscribe(subscriber) {\n const {\n hasError,\n isStopped,\n observers\n } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n _checkFinalizedStatuses(subscriber) {\n const {\n hasError,\n thrownError,\n isStopped\n } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n asObservable() {\n const observable = new Observable();\n observable.source = this;\n return observable;\n }\n}\nSubject.create = (destination, source) => {\n return new AnonymousSubject(destination, source);\n};\nexport class AnonymousSubject extends Subject {\n constructor(destination, source) {\n super();\n this.destination = destination;\n this.source = source;\n }\n next(value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n }\n error(err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n }\n complete() {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n _subscribe(subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n }\n}\n","import { Subject } from './Subject';\nexport class BehaviorSubject extends Subject {\n constructor(_value) {\n super();\n this._value = _value;\n }\n get value() {\n return this.getValue();\n }\n _subscribe(subscriber) {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n getValue() {\n const {\n hasError,\n thrownError,\n _value\n } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n next(value) {\n super.next(this._value = value);\n }\n}\n","export const dateTimestampProvider = {\n now() {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined\n};\n","import { Subject } from './Subject';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nexport class ReplaySubject extends Subject {\n constructor(_bufferSize = Infinity, _windowTime = Infinity, _timestampProvider = dateTimestampProvider) {\n super();\n this._bufferSize = _bufferSize;\n this._windowTime = _windowTime;\n this._timestampProvider = _timestampProvider;\n this._buffer = [];\n this._infiniteTimeWindow = true;\n this._infiniteTimeWindow = _windowTime === Infinity;\n this._bufferSize = Math.max(1, _bufferSize);\n this._windowTime = Math.max(1, _windowTime);\n }\n next(value) {\n const {\n isStopped,\n _buffer,\n _infiniteTimeWindow,\n _timestampProvider,\n _windowTime\n } = this;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n super.next(value);\n }\n _subscribe(subscriber) {\n this._throwIfClosed();\n this._trimBuffer();\n const subscription = this._innerSubscribe(subscriber);\n const {\n _infiniteTimeWindow,\n _buffer\n } = this;\n const copy = _buffer.slice();\n for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i]);\n }\n this._checkFinalizedStatuses(subscriber);\n return subscription;\n }\n _trimBuffer() {\n const {\n _bufferSize,\n _timestampProvider,\n _buffer,\n _infiniteTimeWindow\n } = this;\n const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n if (!_infiniteTimeWindow) {\n const now = _timestampProvider.now();\n let last = 0;\n for (let i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n }\n}\n","import { Subscription } from '../Subscription';\nexport class Action extends Subscription {\n constructor(scheduler, work) {\n super();\n }\n schedule(state, delay = 0) {\n return this;\n }\n}\n","export const intervalProvider = {\n setInterval(handler, timeout, ...args) {\n const {\n delegate\n } = intervalProvider;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval(handler, timeout, ...args);\n }\n return setInterval(handler, timeout, ...args);\n },\n clearInterval(handle) {\n const {\n delegate\n } = intervalProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined\n};\n","import { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nexport class AsyncAction extends Action {\n constructor(scheduler, work) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n this.pending = false;\n }\n schedule(state, delay = 0) {\n var _a;\n if (this.closed) {\n return this;\n }\n this.state = state;\n const id = this.id;\n const scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n }\n requestAsyncId(scheduler, _id, delay = 0) {\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n recycleAsyncId(_scheduler, id, delay = 0) {\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n }\n execute(state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n _execute(state, _delay) {\n let errored = false;\n let errorValue;\n try {\n this.work(state);\n } catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n unsubscribe() {\n if (!this.closed) {\n const {\n id,\n scheduler\n } = this;\n const {\n actions\n } = scheduler;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n super.unsubscribe();\n }\n }\n}\n","let nextHandle = 1;\nlet resolved;\nconst activeHandles = {};\nfunction findAndClearHandle(handle) {\n if (handle in activeHandles) {\n delete activeHandles[handle];\n return true;\n }\n return false;\n}\nexport const Immediate = {\n setImmediate(cb) {\n const handle = nextHandle++;\n activeHandles[handle] = true;\n if (!resolved) {\n resolved = Promise.resolve();\n }\n resolved.then(() => findAndClearHandle(handle) && cb());\n return handle;\n },\n clearImmediate(handle) {\n findAndClearHandle(handle);\n }\n};\nexport const TestTools = {\n pending() {\n return Object.keys(activeHandles).length;\n }\n};\n","import { Immediate } from '../util/Immediate';\nconst {\n setImmediate,\n clearImmediate\n} = Immediate;\nexport const immediateProvider = {\n setImmediate(...args) {\n const {\n delegate\n } = immediateProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate)(...args);\n },\n clearImmediate(handle) {\n const {\n delegate\n } = immediateProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle);\n },\n delegate: undefined\n};\n","import { AsyncAction } from './AsyncAction';\nimport { immediateProvider } from './immediateProvider';\nexport class AsapAction extends AsyncAction {\n constructor(scheduler, work) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n }\n requestAsyncId(scheduler, id, delay = 0) {\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler._scheduled || (scheduler._scheduled = immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined)));\n }\n recycleAsyncId(scheduler, id, delay = 0) {\n var _a;\n if (delay != null ? delay > 0 : this.delay > 0) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n const {\n actions\n } = scheduler;\n if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {\n immediateProvider.clearImmediate(id);\n if (scheduler._scheduled === id) {\n scheduler._scheduled = undefined;\n }\n }\n return undefined;\n }\n}\n","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nexport class Scheduler {\n constructor(schedulerActionCtor, now = Scheduler.now) {\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n schedule(work, delay = 0, state) {\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n }\n}\nScheduler.now = dateTimestampProvider.now;\n","import { Scheduler } from '../Scheduler';\nexport class AsyncScheduler extends Scheduler {\n constructor(SchedulerAction, now = Scheduler.now) {\n super(SchedulerAction, now);\n this.actions = [];\n this._active = false;\n }\n flush(action) {\n const {\n actions\n } = this;\n if (this._active) {\n actions.push(action);\n return;\n }\n let error;\n this._active = true;\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift());\n this._active = false;\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AsyncScheduler } from './AsyncScheduler';\nexport class AsapScheduler extends AsyncScheduler {\n flush(action) {\n this._active = true;\n const flushId = this._scheduled;\n this._scheduled = undefined;\n const {\n actions\n } = this;\n let error;\n action = action || actions.shift();\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n this._active = false;\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AsapAction } from './AsapAction';\nimport { AsapScheduler } from './AsapScheduler';\nexport const asapScheduler = new AsapScheduler(AsapAction);\nexport const asap = asapScheduler;\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\nexport const async = asyncScheduler;\n","import { AsyncAction } from './AsyncAction';\nimport { animationFrameProvider } from './animationFrameProvider';\nexport class AnimationFrameAction extends AsyncAction {\n constructor(scheduler, work) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n }\n requestAsyncId(scheduler, id, delay = 0) {\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined)));\n }\n recycleAsyncId(scheduler, id, delay = 0) {\n var _a;\n if (delay != null ? delay > 0 : this.delay > 0) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n const {\n actions\n } = scheduler;\n if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {\n animationFrameProvider.cancelAnimationFrame(id);\n scheduler._scheduled = undefined;\n }\n return undefined;\n }\n}\n","import { AsyncScheduler } from './AsyncScheduler';\nexport class AnimationFrameScheduler extends AsyncScheduler {\n flush(action) {\n this._active = true;\n const flushId = this._scheduled;\n this._scheduled = undefined;\n const {\n actions\n } = this;\n let error;\n action = action || actions.shift();\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n this._active = false;\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nexport const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\nexport const animationFrame = animationFrameScheduler;\n","import { Observable } from '../Observable';\nexport const EMPTY = new Observable(subscriber => subscriber.complete());\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(subscriber => scheduler.schedule(() => subscriber.complete()));\n}\n","import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n}\n","import { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexport function popResultSelector(args) {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\nexport function popScheduler(args) {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\nexport function popNumber(args, defaultValue) {\n return typeof last(args) === 'number' ? args.pop() : defaultValue;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n};\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\nexport var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\nexport function __param(paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n}\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) {\n if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\");\n return f;\n }\n var kind = contextIn.kind,\n key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _,\n done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) {\n if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\");\n extraInitializers.push(accept(f || null));\n };\n var result = (0, decorators[i])(kind === \"accessor\" ? {\n get: descriptor.get,\n set: descriptor.set\n } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n } else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n}\n;\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n}\n;\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n}\n;\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", {\n configurable: true,\n value: prefix ? \"\".concat(prefix, \" \", name) : name\n });\n}\n;\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\nexport function __generator(thisArg, body) {\n var _ = {\n label: 0,\n sent: function () {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nexport var __createBinding = Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = {\n enumerable: true,\n get: function () {\n return m[k];\n }\n };\n }\n Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n};\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o),\n r,\n ar = [],\n e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = {\n error: error\n };\n } finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n}\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []),\n i,\n q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () {\n return this;\n }, i;\n function awaitReturn(f) {\n return function (v) {\n return Promise.resolve(v).then(f, reject);\n };\n }\n function verb(n, f) {\n if (g[n]) {\n i[n] = function (v) {\n return new Promise(function (a, b) {\n q.push([n, v, a, b]) > 1 || resume(n, v);\n });\n };\n if (f) i[n] = f(i[n]);\n }\n }\n function resume(n, v) {\n try {\n step(g[n](v));\n } catch (e) {\n settle(q[0][3], e);\n }\n }\n function step(r) {\n r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);\n }\n function fulfill(value) {\n resume(\"next\", value);\n }\n function reject(value) {\n resume(\"throw\", value);\n }\n function settle(f, v) {\n if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n }\n}\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) {\n throw e;\n }), verb(\"return\"), i[Symbol.iterator] = function () {\n return this;\n }, i;\n function verb(n, f) {\n i[n] = o[n] ? function (v) {\n return (p = !p) ? {\n value: __await(o[n](v)),\n done: false\n } : f ? f(v) : v;\n } : f;\n }\n}\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n}\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", {\n value: raw\n });\n } else {\n cooked.raw = raw;\n }\n return cooked;\n}\n;\nvar __setModuleDefault = Object.create ? function (o, v) {\n Object.defineProperty(o, \"default\", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o[\"default\"] = v;\n};\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\nexport function __importDefault(mod) {\n return mod && mod.__esModule ? mod : {\n default: mod\n };\n}\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;\n}\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || typeof receiver !== \"object\" && typeof receiver !== \"function\") throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function () {\n try {\n inner.call(this);\n } catch (e) {\n return Promise.reject(e);\n }\n };\n env.stack.push({\n value: value,\n dispose: dispose,\n async: async\n });\n } else if (async) {\n env.stack.push({\n async: true\n });\n }\n return value;\n}\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r,\n s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function (e) {\n fail(e);\n return next();\n });\n } else s |= 1;\n } catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources\n};","export const isArrayLike = x => x && typeof x.length === 'number' && typeof x !== 'function';\n","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n","export function createInvalidObservableTypeError(input) {\n return new TypeError(`You provided ${input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`);\n}\n","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport const iterator = getSymbolIterator();\n","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n","import { __asyncGenerator, __await } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function* readableStreamLikeToAsyncGenerator_1() {\n const reader = readableStream.getReader();\n try {\n while (true) {\n const {\n value,\n done\n } = yield __await(reader.read());\n if (done) {\n return yield __await(void 0);\n }\n yield yield __await(value);\n }\n } finally {\n reader.releaseLock();\n }\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n","import { __asyncValues, __awaiter } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(subscriber => {\n const obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(subscriber => {\n for (let i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(subscriber => {\n promise.then(value => {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, err => subscriber.error(err)).then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(subscriber => {\n for (const value of iterable) {\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(subscriber => {\n process(asyncIterable, subscriber).catch(err => subscriber.error(err));\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_1, _a;\n return __awaiter(this, void 0, void 0, function* () {\n try {\n for (asyncIterable_1 = __asyncValues(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done;) {\n const value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)) yield _a.call(asyncIterable_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n subscriber.complete();\n });\n}\n","export function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat = false) {\n const scheduleSubscription = scheduler.schedule(function () {\n work();\n if (repeat) {\n parentSubscription.add(this.schedule(null, delay));\n } else {\n this.unsubscribe();\n }\n }, delay);\n parentSubscription.add(scheduleSubscription);\n if (!repeat) {\n return scheduleSubscription;\n }\n}\n","import { executeSchedule } from '../util/executeSchedule';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function observeOn(scheduler, delay = 0) {\n return operate((source, subscriber) => {\n source.subscribe(createOperatorSubscriber(subscriber, value => executeSchedule(subscriber, scheduler, () => subscriber.next(value), delay), () => executeSchedule(subscriber, scheduler, () => subscriber.complete(), delay), err => executeSchedule(subscriber, scheduler, () => subscriber.error(err), delay)));\n });\n}\n","import { operate } from '../util/lift';\nexport function subscribeOn(scheduler, delay = 0) {\n return operate((source, subscriber) => {\n subscriber.add(scheduler.schedule(() => source.subscribe(subscriber), delay));\n });\n}\n","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function scheduleObservable(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function schedulePromise(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n","import { Observable } from '../Observable';\nexport function scheduleArray(input, scheduler) {\n return new Observable(subscriber => {\n let i = 0;\n return scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n } else {\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n this.schedule();\n }\n }\n });\n });\n}\n","import { Observable } from '../Observable';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from '../util/isFunction';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleIterable(input, scheduler) {\n return new Observable(subscriber => {\n let iterator;\n executeSchedule(subscriber, scheduler, () => {\n iterator = input[Symbol_iterator]();\n executeSchedule(subscriber, scheduler, () => {\n let value;\n let done;\n try {\n ({\n value,\n done\n } = iterator.next());\n } catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n } else {\n subscriber.next(value);\n }\n }, 0, true);\n });\n return () => isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return();\n });\n}\n","import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(subscriber => {\n executeSchedule(subscriber, scheduler, () => {\n const iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, () => {\n iterator.next().then(result => {\n if (result.done) {\n subscriber.complete();\n } else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}\n","import { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nexport function scheduleReadableStreamLike(input, scheduler) {\n return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);\n}\n","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isReadableStreamLike } from '../util/isReadableStreamLike';\nimport { scheduleReadableStreamLike } from './scheduleReadableStreamLike';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n if (isAsyncIterable(input)) {\n return scheduleAsyncIterable(input, scheduler);\n }\n if (isIterable(input)) {\n return scheduleIterable(input, scheduler);\n }\n if (isReadableStreamLike(input)) {\n return scheduleReadableStreamLike(input, scheduler);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\n","import { scheduled } from '../scheduled/scheduled';\nimport { innerFrom } from './innerFrom';\nexport function from(input, scheduler) {\n return scheduler ? scheduled(input, scheduler) : innerFrom(input);\n}\n","import { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function of(...args) {\n const scheduler = popScheduler(args);\n return from(args, scheduler);\n}\n","import { Observable } from '../Observable';\nimport { isFunction } from '../util/isFunction';\nexport function throwError(errorOrErrorFactory, scheduler) {\n const errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory;\n const init = subscriber => subscriber.error(errorFactory());\n return new Observable(scheduler ? subscriber => scheduler.schedule(init, 0, subscriber) : init);\n}\n","import { Observable } from '../Observable';\nimport { isFunction } from './isFunction';\nexport function isObservable(obj) {\n return !!obj && (obj instanceof Observable || isFunction(obj.lift) && isFunction(obj.subscribe));\n}\n","import { createErrorClass } from './createErrorClass';\nexport const EmptyError = createErrorClass(_super => function EmptyErrorImpl() {\n _super(this);\n this.name = 'EmptyError';\n this.message = 'no elements in sequence';\n});\n","import { EmptyError } from './util/EmptyError';\nexport function lastValueFrom(source, config) {\n const hasConfig = typeof config === 'object';\n return new Promise((resolve, reject) => {\n let _hasValue = false;\n let _value;\n source.subscribe({\n next: value => {\n _value = value;\n _hasValue = true;\n },\n error: reject,\n complete: () => {\n if (_hasValue) {\n resolve(_value);\n } else if (hasConfig) {\n resolve(config.defaultValue);\n } else {\n reject(new EmptyError());\n }\n }\n });\n });\n}\n","export function isValidDate(value) {\n return value instanceof Date && !isNaN(value);\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate((source, subscriber) => {\n let index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n","import { map } from \"../operators/map\";\nconst {\n isArray\n} = Array;\nfunction callOrApply(fn, args) {\n return isArray(args) ? fn(...args) : fn(args);\n}\nexport function mapOneOrManyArgs(fn) {\n return map(args => callOrApply(fn, args));\n}\n","const {\n isArray\n} = Array;\nconst {\n getPrototypeOf,\n prototype: objectProto,\n keys: getKeys\n} = Object;\nexport function argsArgArrayOrObject(args) {\n if (args.length === 1) {\n const first = args[0];\n if (isArray(first)) {\n return {\n args: first,\n keys: null\n };\n }\n if (isPOJO(first)) {\n const keys = getKeys(first);\n return {\n args: keys.map(key => first[key]),\n keys\n };\n }\n }\n return {\n args: args,\n keys: null\n };\n}\nfunction isPOJO(obj) {\n return obj && typeof obj === 'object' && getPrototypeOf(obj) === objectProto;\n}\n","export function createObject(keys, values) {\n return keys.reduce((result, key, i) => (result[key] = values[i], result), {});\n}\n","import { Observable } from '../Observable';\nimport { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';\nimport { from } from './from';\nimport { identity } from '../util/identity';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { popResultSelector, popScheduler } from '../util/args';\nimport { createObject } from '../util/createObject';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function combineLatest(...args) {\n const scheduler = popScheduler(args);\n const resultSelector = popResultSelector(args);\n const {\n args: observables,\n keys\n } = argsArgArrayOrObject(args);\n if (observables.length === 0) {\n return from([], scheduler);\n }\n const result = new Observable(combineLatestInit(observables, scheduler, keys ? values => createObject(keys, values) : identity));\n return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;\n}\nexport function combineLatestInit(observables, scheduler, valueTransform = identity) {\n return subscriber => {\n maybeSchedule(scheduler, () => {\n const {\n length\n } = observables;\n const values = new Array(length);\n let active = length;\n let remainingFirstValues = length;\n for (let i = 0; i < length; i++) {\n maybeSchedule(scheduler, () => {\n const source = from(observables[i], scheduler);\n let hasFirstValue = false;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n values[i] = value;\n if (!hasFirstValue) {\n hasFirstValue = true;\n remainingFirstValues--;\n }\n if (!remainingFirstValues) {\n subscriber.next(valueTransform(values.slice()));\n }\n }, () => {\n if (! --active) {\n subscriber.complete();\n }\n }));\n }, subscriber);\n }\n }, subscriber);\n };\n}\nfunction maybeSchedule(scheduler, execute, subscription) {\n if (scheduler) {\n executeSchedule(subscription, scheduler, execute);\n } else {\n execute();\n }\n}\n","import { innerFrom } from '../observable/innerFrom';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {\n const buffer = [];\n let active = 0;\n let index = 0;\n let isComplete = false;\n const checkComplete = () => {\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n const outerNext = value => active < concurrent ? doInnerSub(value) : buffer.push(value);\n const doInnerSub = value => {\n expand && subscriber.next(value);\n active++;\n let innerComplete = false;\n innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, innerValue => {\n onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);\n if (expand) {\n outerNext(innerValue);\n } else {\n subscriber.next(innerValue);\n }\n }, () => {\n innerComplete = true;\n }, undefined, () => {\n if (innerComplete) {\n try {\n active--;\n while (buffer.length && active < concurrent) {\n const bufferedValue = buffer.shift();\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, () => doInnerSub(bufferedValue));\n } else {\n doInnerSub(bufferedValue);\n }\n }\n checkComplete();\n } catch (err) {\n subscriber.error(err);\n }\n }\n }));\n };\n source.subscribe(createOperatorSubscriber(subscriber, outerNext, () => {\n isComplete = true;\n checkComplete();\n }));\n return () => {\n additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();\n };\n}\n","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMap(project, resultSelector, concurrent = Infinity) {\n if (isFunction(resultSelector)) {\n return mergeMap((a, i) => map((b, ii) => resultSelector(a, b, i, ii))(innerFrom(project(a, i))), concurrent);\n } else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return operate((source, subscriber) => mergeInternals(source, subscriber, project, concurrent));\n}\n","import { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nexport function mergeAll(concurrent = Infinity) {\n return mergeMap(identity, concurrent);\n}\n","import { mergeAll } from './mergeAll';\nexport function concatAll() {\n return mergeAll(1);\n}\n","import { concatAll } from '../operators/concatAll';\nimport { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function concat(...args) {\n return concatAll()(from(args, popScheduler(args)));\n}\n","import { Observable } from '../Observable';\nimport { innerFrom } from './innerFrom';\nexport function defer(observableFactory) {\n return new Observable(subscriber => {\n innerFrom(observableFactory()).subscribe(subscriber);\n });\n}\n","import { Observable } from '../Observable';\nimport { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';\nimport { innerFrom } from './innerFrom';\nimport { popResultSelector } from '../util/args';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { createObject } from '../util/createObject';\nexport function forkJoin(...args) {\n const resultSelector = popResultSelector(args);\n const {\n args: sources,\n keys\n } = argsArgArrayOrObject(args);\n const result = new Observable(subscriber => {\n const {\n length\n } = sources;\n if (!length) {\n subscriber.complete();\n return;\n }\n const values = new Array(length);\n let remainingCompletions = length;\n let remainingEmissions = length;\n for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) {\n let hasValue = false;\n innerFrom(sources[sourceIndex]).subscribe(createOperatorSubscriber(subscriber, value => {\n if (!hasValue) {\n hasValue = true;\n remainingEmissions--;\n }\n values[sourceIndex] = value;\n }, () => remainingCompletions--, undefined, () => {\n if (!remainingCompletions || !hasValue) {\n if (!remainingEmissions) {\n subscriber.next(keys ? createObject(keys, values) : values);\n }\n subscriber.complete();\n }\n }));\n }\n });\n return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;\n}\n","import { innerFrom } from '../observable/innerFrom';\nimport { Observable } from '../Observable';\nimport { mergeMap } from '../operators/mergeMap';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isFunction } from '../util/isFunction';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nconst nodeEventEmitterMethods = ['addListener', 'removeListener'];\nconst eventTargetMethods = ['addEventListener', 'removeEventListener'];\nconst jqueryMethods = ['on', 'off'];\nexport function fromEvent(target, eventName, options, resultSelector) {\n if (isFunction(options)) {\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs(resultSelector));\n }\n const [add, remove] = isEventTarget(target) ? eventTargetMethods.map(methodName => handler => target[methodName](eventName, handler, options)) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [];\n if (!add) {\n if (isArrayLike(target)) {\n return mergeMap(subTarget => fromEvent(subTarget, eventName, options))(innerFrom(target));\n }\n }\n if (!add) {\n throw new TypeError('Invalid event target');\n }\n return new Observable(subscriber => {\n const handler = (...args) => subscriber.next(1 < args.length ? args : args[0]);\n add(handler);\n return () => remove(handler);\n });\n}\nfunction toCommonHandlerRegistry(target, eventName) {\n return methodName => handler => target[methodName](eventName, handler);\n}\nfunction isNodeStyleEventEmitter(target) {\n return isFunction(target.addListener) && isFunction(target.removeListener);\n}\nfunction isJQueryStyleEventEmitter(target) {\n return isFunction(target.on) && isFunction(target.off);\n}\nfunction isEventTarget(target) {\n return isFunction(target.addEventListener) && isFunction(target.removeEventListener);\n}\n","import { Observable } from '../Observable';\nimport { async as asyncScheduler } from '../scheduler/async';\nimport { isScheduler } from '../util/isScheduler';\nimport { isValidDate } from '../util/isDate';\nexport function timer(dueTime = 0, intervalOrScheduler, scheduler = asyncScheduler) {\n let intervalDuration = -1;\n if (intervalOrScheduler != null) {\n if (isScheduler(intervalOrScheduler)) {\n scheduler = intervalOrScheduler;\n } else {\n intervalDuration = intervalOrScheduler;\n }\n }\n return new Observable(subscriber => {\n let due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;\n if (due < 0) {\n due = 0;\n }\n let n = 0;\n return scheduler.schedule(function () {\n if (!subscriber.closed) {\n subscriber.next(n++);\n if (0 <= intervalDuration) {\n this.schedule(undefined, intervalDuration);\n } else {\n subscriber.complete();\n }\n }\n }, due);\n });\n}\n","import { mergeAll } from '../operators/mergeAll';\nimport { innerFrom } from './innerFrom';\nimport { EMPTY } from './empty';\nimport { popNumber, popScheduler } from '../util/args';\nimport { from } from './from';\nexport function merge(...args) {\n const scheduler = popScheduler(args);\n const concurrent = popNumber(args, Infinity);\n const sources = args;\n return !sources.length ? EMPTY : sources.length === 1 ? innerFrom(sources[0]) : mergeAll(concurrent)(from(sources, scheduler));\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function filter(predicate, thisArg) {\n return operate((source, subscriber) => {\n let index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, value => predicate.call(thisArg, value, index++) && subscriber.next(value)));\n });\n}\n","import { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function audit(durationSelector) {\n return operate((source, subscriber) => {\n let hasValue = false;\n let lastValue = null;\n let durationSubscriber = null;\n let isComplete = false;\n const endDuration = () => {\n durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();\n durationSubscriber = null;\n if (hasValue) {\n hasValue = false;\n const value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n isComplete && subscriber.complete();\n };\n const cleanupDuration = () => {\n durationSubscriber = null;\n isComplete && subscriber.complete();\n };\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n hasValue = true;\n lastValue = value;\n if (!durationSubscriber) {\n innerFrom(durationSelector(value)).subscribe(durationSubscriber = createOperatorSubscriber(subscriber, endDuration, cleanupDuration));\n }\n }, () => {\n isComplete = true;\n (!hasValue || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();\n }));\n });\n}\n","import { asyncScheduler } from '../scheduler/async';\nimport { audit } from './audit';\nimport { timer } from '../observable/timer';\nexport function auditTime(duration, scheduler = asyncScheduler) {\n return audit(() => timer(duration, scheduler));\n}\n","import { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { operate } from '../util/lift';\nexport function catchError(selector) {\n return operate((source, subscriber) => {\n let innerSub = null;\n let syncUnsub = false;\n let handledResult;\n innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, err => {\n handledResult = innerFrom(selector(err, catchError(selector)(source)));\n if (innerSub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n } else {\n syncUnsub = true;\n }\n }));\n if (syncUnsub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n });\n}\n","import { createOperatorSubscriber } from './OperatorSubscriber';\nexport function scanInternals(accumulator, seed, hasSeed, emitOnNext, emitBeforeComplete) {\n return (source, subscriber) => {\n let hasState = hasSeed;\n let state = seed;\n let index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n const i = index++;\n state = hasState ? accumulator(state, value, i) : (hasState = true, value);\n emitOnNext && subscriber.next(state);\n }, emitBeforeComplete && (() => {\n hasState && subscriber.next(state);\n subscriber.complete();\n })));\n };\n}\n","import { mergeMap } from './mergeMap';\nimport { isFunction } from '../util/isFunction';\nexport function concatMap(project, resultSelector) {\n return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);\n}\n","import { operate } from '../util/lift';\nimport { noop } from '../util/noop';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nexport function debounce(durationSelector) {\n return operate((source, subscriber) => {\n let hasValue = false;\n let lastValue = null;\n let durationSubscriber = null;\n const emit = () => {\n durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();\n durationSubscriber = null;\n if (hasValue) {\n hasValue = false;\n const value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n };\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();\n hasValue = true;\n lastValue = value;\n durationSubscriber = createOperatorSubscriber(subscriber, emit, noop);\n innerFrom(durationSelector(value)).subscribe(durationSubscriber);\n }, () => {\n emit();\n subscriber.complete();\n }, undefined, () => {\n lastValue = durationSubscriber = null;\n }));\n });\n}\n","import { asyncScheduler } from '../scheduler/async';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function debounceTime(dueTime, scheduler = asyncScheduler) {\n return operate((source, subscriber) => {\n let activeTask = null;\n let lastValue = null;\n let lastTime = null;\n const emit = () => {\n if (activeTask) {\n activeTask.unsubscribe();\n activeTask = null;\n const value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n };\n function emitWhenIdle() {\n const targetTime = lastTime + dueTime;\n const now = scheduler.now();\n if (now < targetTime) {\n activeTask = this.schedule(undefined, targetTime - now);\n subscriber.add(activeTask);\n return;\n }\n emit();\n }\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n lastValue = value;\n lastTime = scheduler.now();\n if (!activeTask) {\n activeTask = scheduler.schedule(emitWhenIdle, dueTime);\n subscriber.add(activeTask);\n }\n }, () => {\n emit();\n subscriber.complete();\n }, undefined, () => {\n lastValue = activeTask = null;\n }));\n });\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function defaultIfEmpty(defaultValue) {\n return operate((source, subscriber) => {\n let hasValue = false;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n hasValue = true;\n subscriber.next(value);\n }, () => {\n if (!hasValue) {\n subscriber.next(defaultValue);\n }\n subscriber.complete();\n }));\n });\n}\n","import { EMPTY } from '../observable/empty';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function take(count) {\n return count <= 0 ? () => EMPTY : operate((source, subscriber) => {\n let seen = 0;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n if (++seen <= count) {\n subscriber.next(value);\n if (count <= seen) {\n subscriber.complete();\n }\n }\n }));\n });\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { noop } from '../util/noop';\nexport function ignoreElements() {\n return operate((source, subscriber) => {\n source.subscribe(createOperatorSubscriber(subscriber, noop));\n });\n}\n","import { map } from './map';\nexport function mapTo(value) {\n return map(() => value);\n}\n","import { concat } from '../observable/concat';\nimport { take } from './take';\nimport { ignoreElements } from './ignoreElements';\nimport { mapTo } from './mapTo';\nimport { mergeMap } from './mergeMap';\nimport { innerFrom } from '../observable/innerFrom';\nexport function delayWhen(delayDurationSelector, subscriptionDelay) {\n if (subscriptionDelay) {\n return source => concat(subscriptionDelay.pipe(take(1), ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));\n }\n return mergeMap((value, index) => innerFrom(delayDurationSelector(value, index)).pipe(take(1), mapTo(value)));\n}\n","import { asyncScheduler } from '../scheduler/async';\nimport { delayWhen } from './delayWhen';\nimport { timer } from '../observable/timer';\nexport function delay(due, scheduler = asyncScheduler) {\n const duration = timer(due, scheduler);\n return delayWhen(() => duration);\n}\n","import { identity } from '../util/identity';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function distinctUntilChanged(comparator, keySelector = identity) {\n comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;\n return operate((source, subscriber) => {\n let previousKey;\n let first = true;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n const currentKey = keySelector(value);\n if (first || !comparator(previousKey, currentKey)) {\n first = false;\n previousKey = currentKey;\n subscriber.next(value);\n }\n }));\n });\n}\nfunction defaultCompare(a, b) {\n return a === b;\n}\n","import { EmptyError } from '../util/EmptyError';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function throwIfEmpty(errorFactory = defaultErrorFactory) {\n return operate((source, subscriber) => {\n let hasValue = false;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n hasValue = true;\n subscriber.next(value);\n }, () => hasValue ? subscriber.complete() : subscriber.error(errorFactory())));\n });\n}\nfunction defaultErrorFactory() {\n return new EmptyError();\n}\n","import { operate } from '../util/lift';\nexport function finalize(callback) {\n return operate((source, subscriber) => {\n try {\n source.subscribe(subscriber);\n } finally {\n subscriber.add(callback);\n }\n });\n}\n","import { EmptyError } from '../util/EmptyError';\nimport { filter } from './filter';\nimport { take } from './take';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { identity } from '../util/identity';\nexport function first(predicate, defaultValue) {\n const hasDefaultValue = arguments.length >= 2;\n return source => source.pipe(predicate ? filter((v, i) => predicate(v, i, source)) : identity, take(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()));\n}\n","import { EMPTY } from '../observable/empty';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function takeLast(count) {\n return count <= 0 ? () => EMPTY : operate((source, subscriber) => {\n let buffer = [];\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n buffer.push(value);\n count < buffer.length && buffer.shift();\n }, () => {\n for (const value of buffer) {\n subscriber.next(value);\n }\n subscriber.complete();\n }, undefined, () => {\n buffer = null;\n }));\n });\n}\n","import { EmptyError } from '../util/EmptyError';\nimport { filter } from './filter';\nimport { takeLast } from './takeLast';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { identity } from '../util/identity';\nexport function last(predicate, defaultValue) {\n const hasDefaultValue = arguments.length >= 2;\n return source => source.pipe(predicate ? filter((v, i) => predicate(v, i, source)) : identity, takeLast(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()));\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function pairwise() {\n return operate((source, subscriber) => {\n let prev;\n let hasPrev = false;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n const p = prev;\n prev = value;\n hasPrev && subscriber.next([p, value]);\n hasPrev = true;\n }));\n });\n}\n","import { operate } from '../util/lift';\nimport { scanInternals } from './scanInternals';\nexport function scan(accumulator, seed) {\n return operate(scanInternals(accumulator, seed, arguments.length >= 2, true));\n}\n","import { innerFrom } from '../observable/innerFrom';\nimport { Subject } from '../Subject';\nimport { SafeSubscriber } from '../Subscriber';\nimport { operate } from '../util/lift';\nexport function share(options = {}) {\n const {\n connector = () => new Subject(),\n resetOnError = true,\n resetOnComplete = true,\n resetOnRefCountZero = true\n } = options;\n return wrapperSource => {\n let connection;\n let resetConnection;\n let subject;\n let refCount = 0;\n let hasCompleted = false;\n let hasErrored = false;\n const cancelReset = () => {\n resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();\n resetConnection = undefined;\n };\n const reset = () => {\n cancelReset();\n connection = subject = undefined;\n hasCompleted = hasErrored = false;\n };\n const resetAndUnsubscribe = () => {\n const conn = connection;\n reset();\n conn === null || conn === void 0 ? void 0 : conn.unsubscribe();\n };\n return operate((source, subscriber) => {\n refCount++;\n if (!hasErrored && !hasCompleted) {\n cancelReset();\n }\n const dest = subject = subject !== null && subject !== void 0 ? subject : connector();\n subscriber.add(() => {\n refCount--;\n if (refCount === 0 && !hasErrored && !hasCompleted) {\n resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);\n }\n });\n dest.subscribe(subscriber);\n if (!connection && refCount > 0) {\n connection = new SafeSubscriber({\n next: value => dest.next(value),\n error: err => {\n hasErrored = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnError, err);\n dest.error(err);\n },\n complete: () => {\n hasCompleted = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnComplete);\n dest.complete();\n }\n });\n innerFrom(source).subscribe(connection);\n }\n })(wrapperSource);\n };\n}\nfunction handleReset(reset, on, ...args) {\n if (on === true) {\n reset();\n return;\n }\n if (on === false) {\n return;\n }\n const onSubscriber = new SafeSubscriber({\n next: () => {\n onSubscriber.unsubscribe();\n reset();\n }\n });\n return innerFrom(on(...args)).subscribe(onSubscriber);\n}\n","import { ReplaySubject } from '../ReplaySubject';\nimport { share } from './share';\nexport function shareReplay(configOrBufferSize, windowTime, scheduler) {\n let bufferSize;\n let refCount = false;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n ({\n bufferSize = Infinity,\n windowTime = Infinity,\n refCount = false,\n scheduler\n } = configOrBufferSize);\n } else {\n bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity;\n }\n return share({\n connector: () => new ReplaySubject(bufferSize, windowTime, scheduler),\n resetOnError: true,\n resetOnComplete: false,\n resetOnRefCountZero: refCount\n });\n}\n","import { filter } from './filter';\nexport function skip(count) {\n return filter((_, index) => count <= index);\n}\n","import { concat } from '../observable/concat';\nimport { popScheduler } from '../util/args';\nimport { operate } from '../util/lift';\nexport function startWith(...values) {\n const scheduler = popScheduler(values);\n return operate((source, subscriber) => {\n (scheduler ? concat(values, source, scheduler) : concat(values, source)).subscribe(subscriber);\n });\n}\n","import { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function switchMap(project, resultSelector) {\n return operate((source, subscriber) => {\n let innerSubscriber = null;\n let index = 0;\n let isComplete = false;\n const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();\n let innerIndex = 0;\n const outerIndex = index++;\n innerFrom(project(value, outerIndex)).subscribe(innerSubscriber = createOperatorSubscriber(subscriber, innerValue => subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue), () => {\n innerSubscriber = null;\n checkComplete();\n }));\n }, () => {\n isComplete = true;\n checkComplete();\n }));\n });\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nimport { noop } from '../util/noop';\nexport function takeUntil(notifier) {\n return operate((source, subscriber) => {\n innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, () => subscriber.complete(), noop));\n !subscriber.closed && source.subscribe(subscriber);\n });\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function takeWhile(predicate, inclusive = false) {\n return operate((source, subscriber) => {\n let index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n const result = predicate(value, index++);\n (result || inclusive) && subscriber.next(value);\n !result && subscriber.complete();\n }));\n });\n}\n","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n const tapObserver = isFunction(observerOrNext) || error || complete ? {\n next: observerOrNext,\n error,\n complete\n } : observerOrNext;\n return tapObserver ? operate((source, subscriber) => {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n let isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, () => {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, err => {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, () => {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n }) : identity;\n}\n","/**\n * @license Angular v18.2.7\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { SIGNAL_NODE as SIGNAL_NODE$1, signalSetFn as signalSetFn$1, producerAccessed as producerAccessed$1, SIGNAL as SIGNAL$1, getActiveConsumer as getActiveConsumer$1, setActiveConsumer as setActiveConsumer$1, consumerDestroy as consumerDestroy$1, REACTIVE_NODE as REACTIVE_NODE$1, consumerBeforeComputation as consumerBeforeComputation$1, consumerAfterComputation as consumerAfterComputation$1, consumerPollProducersForChange as consumerPollProducersForChange$1, createSignal as createSignal$1, signalUpdateFn as signalUpdateFn$1, createComputed as createComputed$1, setThrowInvalidWriteToSignalError as setThrowInvalidWriteToSignalError$1, createWatch as createWatch$1 } from '@angular/core/primitives/signals';\nexport { SIGNAL as ɵSIGNAL } from '@angular/core/primitives/signals';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { map, first } from 'rxjs/operators';\nimport { Attribute as Attribute$1, EventContract, EventContractContainer, getAppScopedQueuedEventInfos, clearAppScopedEarlyEventContract, EventDispatcher, registerDispatcher, isEarlyEventType, isCaptureEventType } from '@angular/core/primitives/event-dispatch';\n\n/**\n * Base URL for the error details page.\n *\n * Keep this constant in sync across:\n * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts\n * - packages/core/src/error_details_base_url.ts\n */\nconst ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.dev/errors';\n/**\n * URL for the XSS security documentation.\n */\nconst XSS_SECURITY_URL = 'https://g.co/ng/security#xss';\n\n/**\n * Class that represents a runtime error.\n * Formats and outputs the error message in a consistent way.\n *\n * Example:\n * ```\n * throw new RuntimeError(\n * RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,\n * ngDevMode && 'Injector has already been destroyed.');\n * ```\n *\n * Note: the `message` argument contains a descriptive error message as a string in development\n * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the\n * `message` argument becomes `false`, thus we account for it in the typings and the runtime\n * logic.\n */\nclass RuntimeError extends Error {\n constructor(code, message) {\n super(formatRuntimeError(code, message));\n this.code = code;\n }\n}\n/**\n * Called to format a runtime error.\n * See additional info on the `message` argument type in the `RuntimeError` class description.\n */\nfunction formatRuntimeError(code, message) {\n // Error code might be a negative number, which is a special marker that instructs the logic to\n // generate a link to the error details page on angular.io.\n // We also prepend `0` to non-compile-time errors.\n const fullCode = `NG0${Math.abs(code)}`;\n let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;\n if (ngDevMode && code < 0) {\n const addPeriodSeparator = !errorMessage.match(/[.,;!?\\n]$/);\n const separator = addPeriodSeparator ? '.' : '';\n errorMessage = `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;\n }\n return errorMessage;\n}\nconst REQUIRED_UNSET_VALUE = /* @__PURE__ */Symbol('InputSignalNode#UNSET');\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst INPUT_SIGNAL_NODE = /* @__PURE__ */(() => {\n return {\n ...SIGNAL_NODE$1,\n transformFn: undefined,\n applyValueToInputSignal(node, value) {\n signalSetFn$1(node, value);\n }\n };\n})();\nconst ɵINPUT_SIGNAL_BRAND_READ_TYPE = /* @__PURE__ */Symbol();\nconst ɵINPUT_SIGNAL_BRAND_WRITE_TYPE = /* @__PURE__ */Symbol();\n/**\n * Creates an input signal.\n *\n * @param initialValue The initial value.\n * Can be set to {@link REQUIRED_UNSET_VALUE} for required inputs.\n * @param options Additional options for the input. e.g. a transform, or an alias.\n */\nfunction createInputSignal(initialValue, options) {\n const node = Object.create(INPUT_SIGNAL_NODE);\n node.value = initialValue;\n // Perf note: Always set `transformFn` here to ensure that `node` always\n // has the same v8 class shape, allowing monomorphic reads on input signals.\n node.transformFn = options?.transform;\n function inputValueFn() {\n // Record that someone looked at this signal.\n producerAccessed$1(node);\n if (node.value === REQUIRED_UNSET_VALUE) {\n throw new RuntimeError(-950 /* RuntimeErrorCode.REQUIRED_INPUT_NO_VALUE */, ngDevMode && 'Input is required but no value is available yet.');\n }\n return node.value;\n }\n inputValueFn[SIGNAL$1] = node;\n if (ngDevMode) {\n inputValueFn.toString = () => `[Input Signal: ${inputValueFn()}]`;\n }\n return inputValueFn;\n}\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nfunction noSideEffects(fn) {\n return {\n toString: fn\n }.toString();\n}\nconst ANNOTATIONS = '__annotations__';\nconst PARAMETERS = '__parameters__';\nconst PROP_METADATA = '__prop__metadata__';\n/**\n * @suppress {globalThis}\n */\nfunction makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function DecoratorFactory(...args) {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n const annotationInstance = new DecoratorFactory(...args);\n return function TypeDecorator(cls) {\n if (typeFn) typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, {\n value: []\n })[ANNOTATIONS];\n annotations.push(annotationInstance);\n if (additionalProcessing) additionalProcessing(cls);\n return cls;\n };\n }\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n DecoratorFactory.prototype.ngMetadataName = name;\n DecoratorFactory.annotationCls = DecoratorFactory;\n return DecoratorFactory;\n });\n}\nfunction makeMetadataCtor(props) {\n return function ctor(...args) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\nfunction makeParamDecorator(name, props, parentClass) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args) {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new ParamDecoratorFactory(...args);\n ParamDecorator.annotation = annotationInstance;\n return ParamDecorator;\n function ParamDecorator(cls, unusedKey, index) {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, {\n value: []\n })[PARAMETERS];\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n if (parentClass) {\n ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n });\n}\nfunction makePropDecorator(name, props, parentClass, additionalProcessing) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function PropDecoratorFactory(...args) {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const decoratorInstance = new PropDecoratorFactory(...args);\n function PropDecorator(target, name) {\n // target is undefined with standard decorators. This case is not supported and will throw\n // if this decorator is used in JIT mode with standard decorators.\n if (target === undefined) {\n throw new Error('Standard Angular field decorators are not supported in JIT mode.');\n }\n const constructor = target.constructor;\n // Use of Object.defineProperty is important because it creates a non-enumerable property\n // which prevents the property from being copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, {\n value: {}\n })[PROP_METADATA];\n meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n meta[name].unshift(decoratorInstance);\n if (additionalProcessing) additionalProcessing(target, name, ...args);\n }\n return PropDecorator;\n }\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n PropDecoratorFactory.prototype.ngMetadataName = name;\n PropDecoratorFactory.annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n });\n}\nconst _global = globalThis;\nfunction ngDevModeResetPerfCounters() {\n const locationString = typeof location !== 'undefined' ? location.toString() : '';\n const newCounters = {\n namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1,\n firstCreatePass: 0,\n tNode: 0,\n tView: 0,\n rendererCreateTextNode: 0,\n rendererSetText: 0,\n rendererCreateElement: 0,\n rendererAddEventListener: 0,\n rendererSetAttribute: 0,\n rendererRemoveAttribute: 0,\n rendererSetProperty: 0,\n rendererSetClassName: 0,\n rendererAddClass: 0,\n rendererRemoveClass: 0,\n rendererSetStyle: 0,\n rendererRemoveStyle: 0,\n rendererDestroy: 0,\n rendererDestroyNode: 0,\n rendererMoveNode: 0,\n rendererRemoveNode: 0,\n rendererAppendChild: 0,\n rendererInsertBefore: 0,\n rendererCreateComment: 0,\n hydratedNodes: 0,\n hydratedComponents: 0,\n dehydratedViewsRemoved: 0,\n dehydratedViewsCleanupRuns: 0,\n componentsSkippedHydration: 0\n };\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;\n if (!allowNgDevModeTrue) {\n _global['ngDevMode'] = false;\n } else {\n if (typeof _global['ngDevMode'] !== 'object') {\n _global['ngDevMode'] = {};\n }\n Object.assign(_global['ngDevMode'], newCounters);\n }\n return newCounters;\n}\n/**\n * This function checks to see if the `ngDevMode` has been set. If yes,\n * then we honor it, otherwise we default to dev mode with additional checks.\n *\n * The idea is that unless we are doing production build where we explicitly\n * set `ngDevMode == false` we should be helping the developer by providing\n * as much early warning and errors as possible.\n *\n * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions\n * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode\n * is defined for the entire instruction set.\n *\n * When checking `ngDevMode` on toplevel, always init it before referencing it\n * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can\n * get a `ReferenceError` like in https://github.com/angular/angular/issues/31595.\n *\n * Details on possible values for `ngDevMode` can be found on its docstring.\n *\n * NOTE:\n * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`.\n */\nfunction initNgDevMode() {\n // The below checks are to ensure that calling `initNgDevMode` multiple times does not\n // reset the counters.\n // If the `ngDevMode` is not an object, then it means we have not created the perf counters\n // yet.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (typeof ngDevMode !== 'object' || Object.keys(ngDevMode).length === 0) {\n ngDevModeResetPerfCounters();\n }\n return typeof ngDevMode !== 'undefined' && !!ngDevMode;\n }\n return false;\n}\nfunction getClosureSafeProperty(objWithPropertyToExtract) {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === getClosureSafeProperty) {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.');\n}\n/**\n * Sets properties on a target object from a source object, but only if\n * the property doesn't already exist on the target object.\n * @param target The target to set properties on\n * @param source The source of the property keys and values to set\n */\nfunction fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}\nfunction stringify(token) {\n if (typeof token === 'string') {\n return token;\n }\n if (Array.isArray(token)) {\n return '[' + token.map(stringify).join(', ') + ']';\n }\n if (token == null) {\n return '' + token;\n }\n if (token.overriddenName) {\n return `${token.overriddenName}`;\n }\n if (token.name) {\n return `${token.name}`;\n }\n const res = token.toString();\n if (res == null) {\n return '' + res;\n }\n const newLineIndex = res.indexOf('\\n');\n return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n/**\n * Concatenates two strings with separator, allocating new strings only when necessary.\n *\n * @param before before string.\n * @param separator separator string.\n * @param after after string.\n * @returns concatenated string.\n */\nfunction concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n}\n/**\n * Ellipses the string in the middle when longer than the max length\n *\n * @param string\n * @param maxLength of the output string\n * @returns ellipsed string with ... in the middle\n */\nfunction truncateMiddle(str, maxLength = 100) {\n if (!str || maxLength < 1 || str.length <= maxLength) return str;\n if (maxLength == 1) return str.substring(0, 1) + '...';\n const halfLimit = Math.round(maxLength / 2);\n return str.substring(0, halfLimit) + '...' + str.substring(str.length - halfLimit);\n}\nconst __forward_ref__ = getClosureSafeProperty({\n __forward_ref__: getClosureSafeProperty\n});\n/**\n * Allows to refer to references which are not yet defined.\n *\n * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n * DI is declared, but not yet defined. It is also used when the `token` which we use when creating\n * a query is not yet defined.\n *\n * `forwardRef` is also used to break circularities in standalone components imports.\n *\n * @usageNotes\n * ### Circular dependency example\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n *\n * ### Circular standalone reference import example\n * ```ts\n * @Component({\n * standalone: true,\n * imports: [ChildComponent],\n * selector: 'app-parent',\n * template: `
Progress: {{progress}}%
\n *= 100\">Done processing {{label}} of Angular zone!
\n *\n * \n * \n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @publicApi\n */\nclass NgZone {\n constructor(options) {\n this.hasPendingMacrotasks = false;\n this.hasPendingMicrotasks = false;\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n this.isStable = true;\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n this.onUnstable = new EventEmitter(false);\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n this.onMicrotaskEmpty = new EventEmitter(false);\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n this.onStable = new EventEmitter(false);\n /**\n * Notifies that an error has been delivered.\n */\n this.onError = new EventEmitter(false);\n const {\n enableLongStackTrace = false,\n shouldCoalesceEventChangeDetection = false,\n shouldCoalesceRunChangeDetection = false,\n scheduleInRootZone = SCHEDULE_IN_ROOT_ZONE_DEFAULT\n } = options;\n if (typeof Zone == 'undefined') {\n throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);\n }\n Zone.assertZonePatched();\n const self = this;\n self._nesting = 0;\n self._outer = self._inner = Zone.current;\n // AsyncStackTaggingZoneSpec provides `linked stack traces` to show\n // where the async operation is scheduled. For more details, refer\n // to this article, https://developer.chrome.com/blog/devtools-better-angular-debugging/\n // And we only import this AsyncStackTaggingZoneSpec in development mode,\n // in the production mode, the AsyncStackTaggingZoneSpec will be tree shaken away.\n if (ngDevMode) {\n self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));\n }\n if (Zone['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']());\n }\n if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);\n }\n // if shouldCoalesceRunChangeDetection is true, all tasks including event tasks will be\n // coalesced, so shouldCoalesceEventChangeDetection option is not necessary and can be skipped.\n self.shouldCoalesceEventChangeDetection = !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;\n self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;\n self.callbackScheduled = false;\n self.scheduleInRootZone = scheduleInRootZone;\n forkInnerZoneWithAngularBehavior(self);\n }\n /**\n This method checks whether the method call happens within an Angular Zone instance.\n */\n static isInAngularZone() {\n // Zone needs to be checked, because this method might be called even when NoopNgZone is used.\n return typeof Zone !== 'undefined' && Zone.current.get(isAngularZoneProperty) === true;\n }\n /**\n Assures that the method is called within the Angular Zone, otherwise throws an error.\n */\n static assertInAngularZone() {\n if (!NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');\n }\n }\n /**\n Assures that the method is called outside of the Angular Zone, otherwise throws an error.\n */\n static assertNotInAngularZone() {\n if (NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');\n }\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run(fn, applyThis, applyArgs) {\n return this._inner.run(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask(fn, applyThis, applyArgs, name) {\n const zone = this._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs);\n } finally {\n zone.cancelTask(task);\n }\n }\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded(fn, applyThis, applyArgs) {\n return this._inner.runGuarded(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular(fn) {\n return this._outer.run(fn);\n }\n}\nconst EMPTY_PAYLOAD = {};\nfunction checkStable(zone) {\n // TODO: @JiaLiPassion, should check zone.isCheckStableRunning to prevent\n // re-entry. The case is:\n //\n // @Component({...})\n // export class AppComponent {\n // constructor(private ngZone: NgZone) {\n // this.ngZone.onStable.subscribe(() => {\n // this.ngZone.run(() => console.log('stable'););\n // });\n // }\n //\n // The onStable subscriber run another function inside ngZone\n // which causes `checkStable()` re-entry.\n // But this fix causes some issues in g3, so this fix will be\n // launched in another PR.\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n } finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n } finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\nfunction delayChangeDetectionForEvents(zone) {\n /**\n * We also need to check _nesting here\n * Consider the following case with shouldCoalesceRunChangeDetection = true\n *\n * ngZone.run(() => {});\n * ngZone.run(() => {});\n *\n * We want the two `ngZone.run()` only trigger one change detection\n * when shouldCoalesceRunChangeDetection is true.\n * And because in this case, change detection run in async way(requestAnimationFrame),\n * so we also need to check the _nesting here to prevent multiple\n * change detections.\n */\n if (zone.isCheckStableRunning || zone.callbackScheduled) {\n return;\n }\n zone.callbackScheduled = true;\n function scheduleCheckStable() {\n scheduleCallbackWithRafRace(() => {\n zone.callbackScheduled = false;\n updateMicroTaskStatus(zone);\n zone.isCheckStableRunning = true;\n checkStable(zone);\n zone.isCheckStableRunning = false;\n });\n }\n if (zone.scheduleInRootZone) {\n Zone.root.run(() => {\n scheduleCheckStable();\n });\n } else {\n zone._outer.run(() => {\n scheduleCheckStable();\n });\n }\n updateMicroTaskStatus(zone);\n}\nfunction forkInnerZoneWithAngularBehavior(zone) {\n const delayChangeDetectionForEventsDelegate = () => {\n delayChangeDetectionForEvents(zone);\n };\n const instanceId = ngZoneInstanceId++;\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: {\n [isAngularZoneProperty]: true,\n [angularZoneInstanceIdProperty]: instanceId,\n [angularZoneInstanceIdProperty + instanceId]: true\n },\n onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {\n // Prevent triggering change detection when the flag is detected.\n if (shouldBeIgnoredByZone(applyArgs)) {\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n }\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n } finally {\n if (zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask' || zone.shouldCoalesceRunChangeDetection) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n if (zone.shouldCoalesceRunChangeDetection &&\n // Do not delay change detection when the task is the scheduler's tick.\n // We need to synchronously trigger the stability logic so that the\n // zone-based scheduler can prevent a duplicate ApplicationRef.tick\n // by first checking if the scheduler tick is running. This does seem a bit roundabout,\n // but we _do_ still want to trigger all the correct events when we exit the zone.run\n // (`onMicrotaskEmpty` and `onStable` _should_ emit; developers can have code which\n // relies on these events happening after change detection runs).\n // Note: `zone.callbackScheduled` is already in delayChangeDetectionForEventsDelegate\n // but is added here as well to prevent reads of applyArgs when not necessary\n !zone.callbackScheduled && !isSchedulerTick(applyArgs)) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onHasTask: (delegate, current, target, hasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone._hasPendingMicrotasks = hasTaskState.microTask;\n updateMicroTaskStatus(zone);\n checkStable(zone);\n } else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n onHandleError: (delegate, current, target, error) => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n }\n });\n}\nfunction updateMicroTaskStatus(zone) {\n if (zone._hasPendingMicrotasks || (zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) && zone.callbackScheduled === true) {\n zone.hasPendingMicrotasks = true;\n } else {\n zone.hasPendingMicrotasks = false;\n }\n}\nfunction onEnter(zone) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\nfunction onLeave(zone) {\n zone._nesting--;\n checkStable(zone);\n}\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nclass NoopNgZone {\n constructor() {\n this.hasPendingMicrotasks = false;\n this.hasPendingMacrotasks = false;\n this.isStable = true;\n this.onUnstable = new EventEmitter();\n this.onMicrotaskEmpty = new EventEmitter();\n this.onStable = new EventEmitter();\n this.onError = new EventEmitter();\n }\n run(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runGuarded(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runOutsideAngular(fn) {\n return fn();\n }\n runTask(fn, applyThis, applyArgs, name) {\n return fn.apply(applyThis, applyArgs);\n }\n}\nfunction shouldBeIgnoredByZone(applyArgs) {\n return hasApplyArgsData(applyArgs, '__ignore_ng_zone__');\n}\nfunction isSchedulerTick(applyArgs) {\n return hasApplyArgsData(applyArgs, '__scheduler_tick__');\n}\nfunction hasApplyArgsData(applyArgs, key) {\n if (!Array.isArray(applyArgs)) {\n return false;\n }\n // We should only ever get 1 arg passed through to invokeTask.\n // Short circuit here incase that behavior changes.\n if (applyArgs.length !== 1) {\n return false;\n }\n return applyArgs[0]?.data?.[key] === true;\n}\nfunction getNgZone(ngZoneToUse = 'zone.js', options) {\n if (ngZoneToUse === 'noop') {\n return new NoopNgZone();\n }\n if (ngZoneToUse === 'zone.js') {\n return new NgZone(options);\n }\n return ngZoneToUse;\n}\n\n// Public API for Zone\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n * handleError(error) {\n * // do something with the exception\n * }\n * }\n *\n * @NgModule({\n * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n *\n * @publicApi\n */\nclass ErrorHandler {\n constructor() {\n /**\n * @internal\n */\n this._console = console;\n }\n handleError(error) {\n const originalError = this._findOriginalError(error);\n this._console.error('ERROR', error);\n if (originalError) {\n this._console.error('ORIGINAL ERROR', originalError);\n }\n }\n /** @internal */\n _findOriginalError(error) {\n let e = error && getOriginalError(error);\n while (e && getOriginalError(e)) {\n e = getOriginalError(e);\n }\n return e || null;\n }\n}\n/**\n * `InjectionToken` used to configure how to call the `ErrorHandler`.\n *\n * `NgZone` is provided by default today so the default (and only) implementation for this\n * is calling `ErrorHandler.handleError` outside of the Angular zone.\n */\nconst INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'internal error handler' : '', {\n providedIn: 'root',\n factory: () => {\n const zone = inject(NgZone);\n const userErrorHandler = inject(ErrorHandler);\n return e => zone.runOutsideAngular(() => userErrorHandler.handleError(e));\n }\n});\n\n/**\n * An `OutputEmitterRef` is created by the `output()` function and can be\n * used to emit values to consumers of your directive or component.\n *\n * Consumers of your directive/component can bind to the output and\n * subscribe to changes via the bound event syntax. For example:\n *\n * ```html\n *