{"version":3,"sources":["src/js/wpd_node.js","node_modules/jimp/browser/lib/jimp.js","node_modules/moment/moment.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/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/Scheduler.js","node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js","node_modules/rxjs/dist/esm/internal/scheduler/async.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/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/interval.js","node_modules/rxjs/dist/esm/internal/observable/merge.js","node_modules/rxjs/dist/esm/internal/util/argsOrArgArray.js","node_modules/rxjs/dist/esm/internal/operators/filter.js","node_modules/rxjs/dist/esm/internal/observable/race.js","node_modules/rxjs/dist/esm/internal/observable/zip.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/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/endWith.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/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/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/tap.js","node_modules/rxjs/dist/esm/internal/operators/withLatestFrom.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/router/fesm2022/router.mjs","node_modules/@angular/forms/fesm2022/forms.mjs","src/app/models/speed-units.ts","src/app/models/length-units.ts","node_modules/@popperjs/core/lib/enums.js","node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","node_modules/@popperjs/core/lib/dom-utils/getWindow.js","node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","node_modules/@popperjs/core/lib/modifiers/applyStyles.js","node_modules/@popperjs/core/lib/utils/getBasePlacement.js","node_modules/@popperjs/core/lib/utils/math.js","node_modules/@popperjs/core/lib/utils/userAgent.js","node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","node_modules/@popperjs/core/lib/dom-utils/contains.js","node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","node_modules/@popperjs/core/lib/utils/within.js","node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","node_modules/@popperjs/core/lib/utils/expandToHashMap.js","node_modules/@popperjs/core/lib/modifiers/arrow.js","node_modules/@popperjs/core/lib/utils/getVariation.js","node_modules/@popperjs/core/lib/modifiers/computeStyles.js","node_modules/@popperjs/core/lib/modifiers/eventListeners.js","node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","node_modules/@popperjs/core/lib/utils/rectToClientRect.js","node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","node_modules/@popperjs/core/lib/utils/computeOffsets.js","node_modules/@popperjs/core/lib/utils/detectOverflow.js","node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","node_modules/@popperjs/core/lib/modifiers/flip.js","node_modules/@popperjs/core/lib/modifiers/offset.js","node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","node_modules/@popperjs/core/lib/utils/getAltAxis.js","node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","node_modules/@popperjs/core/lib/utils/orderModifiers.js","node_modules/@popperjs/core/lib/utils/debounce.js","node_modules/@popperjs/core/lib/utils/mergeByName.js","node_modules/@popperjs/core/lib/createPopper.js","node_modules/@popperjs/core/lib/popper-lite.js","node_modules/@ng-bootstrap/ng-bootstrap/fesm2022/ng-bootstrap.mjs","src/app/services/event-broadcast.service.ts","src/environments/environment.ts","src/app/models/power-units.ts","src/app/models/torque-units.ts","src/app/models/weight-units.ts","src/app/components/error-modal/error-modal.component.ts","src/app/components/error-modal/error-modal.component.html","src/app/services/error-handler.service.ts","src/app/services/protune-api.service.ts","src/app/services/user-preferences.service.ts","src/app/components/tire-size-calculator/tire-size-calculator.component.ts","src/app/components/tire-size-calculator/tire-size-calculator.component.html","src/app/directives/input-range.directive.ts","src/app/components/input-spinner/input-spinner.component.ts","src/app/components/input-spinner/input-spinner.component.html","src/app/components/image-digitizer/image-digitizer.component.ts","src/app/components/image-digitizer/image-digitizer.component.html","src/app/services/digitizer.service.ts","node_modules/@kurkle/color/dist/color.esm.js","node_modules/chart.js/dist/chunks/helpers.segment.js","node_modules/chart.js/dist/chart.js","node_modules/chart.js/auto/auto.js","src/app/directives/chart-js.directive.ts","src/app/models/suspension-settings.ts","src/app/models/drivetrain-settings.ts","src/app/models/car-track-settings.ts","src/app/components/confirmation-modal/confirmation-modal.component.ts","src/app/components/confirmation-modal/confirmation-modal.component.html","src/app/components/screenshot-help-modal/screenshot-help-modal.component.ts","src/app/components/screenshot-help-modal/screenshot-help-modal.component.html","src/app/services/auth.service.ts","src/app/components/saved-settings-modal/saved-settings-modal.component.ts","src/app/components/saved-settings-modal/saved-settings-modal.component.html","src/app/models/subscription-levels.ts","src/app/models/drive-types.ts","src/app/services/chart.service.ts","src/app/routes/home/home.component.ts","src/app/routes/home/home.component.html","src/app/routes/auth/login/login.component.ts","src/app/routes/auth/login/login.component.html","src/app/routes/auth/register/register.component.ts","src/app/routes/auth/register/register.component.html","src/app/routes/subscription-confirmation/subscription-confirmation.component.ts","src/app/routes/subscription-confirmation/subscription-confirmation.component.html","src/app/guards/auth.guard.ts","src/app/routes/subscription/subscription/subscription-update.component.ts","src/app/routes/subscription/subscription/subscription-update.component.html","src/app/guards/subscription.guard.ts","src/app/routes/auth/forgot-password/forgot-password.component.ts","src/app/routes/auth/forgot-password/forgot-password.component.html","src/app/routes/auth/reset-password/reset-password.component.ts","src/app/routes/auth/reset-password/reset-password.component.html","src/app/routes/profile-management/profile-management.component.ts","src/app/routes/profile-management/profile-management.component.html","src/app/routes/redirect/redirect.component.ts","src/app/routes/redirect/redirect.component.html","src/app/app.routes.ts","src/app/security/auth.interceptor.ts","src/app/providers/http-interceptors.ts","src/app/app.config.ts","src/app/models/user-preferences.ts","src/app/components/user-settings-modal/user-settings-modal.component.ts","src/app/components/user-settings-modal/user-settings-modal.component.html","src/app/app.component.ts","src/app/app.component.html","src/main.ts"],"sourcesContent":["/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd._AutoDetectionDataCounter = 0;\r\n\r\nwpd.AutoDetectionData = class {\r\n constructor() {\r\n // public\r\n this.imageWidth = 0;\r\n this.imageHeight = 0;\r\n this.fgColor = [0, 0, 255];\r\n this.bgColor = [255, 255, 255];\r\n this.mask = new Set();\r\n this.binaryData = new Set();\r\n this.colorDetectionMode = 'fg';\r\n this.colorDistance = 120;\r\n this.algorithm = null;\r\n this.name = wpd._AutoDetectionDataCounter++;\r\n }\r\n\r\n serialize() {\r\n // if there's no algo, or if the algo was never run (no algoData),\r\n // then just return null as there's no reason to save this data.\r\n if (this.algorithm == null) {\r\n return null;\r\n }\r\n let algoData = this.algorithm.serialize();\r\n if (algoData == null) {\r\n return null;\r\n }\r\n\r\n let compressedMask = wpd.rle.encode(Array.from(this.mask.values()).sort((a, b) => {\r\n return (a - b);\r\n }));\r\n\r\n return {\r\n fgColor: this.fgColor,\r\n bgColor: this.bgColor,\r\n mask: compressedMask,\r\n colorDetectionMode: this.colorDetectionMode,\r\n colorDistance: this.colorDistance,\r\n algorithm: algoData,\r\n name: this.name,\r\n imageWidth: this.imageWidth,\r\n imageHeight: this.imageHeight\r\n };\r\n }\r\n\r\n deserialize(jsonObj) {\r\n this.fgColor = jsonObj.fgColor;\r\n this.bgColor = jsonObj.bgColor;\r\n this.imageWidth = jsonObj.imageWidth;\r\n this.imageHeight = jsonObj.imageHeight;\r\n if (jsonObj.mask != null) {\r\n let uncompressedMaskData = wpd.rle.decode(jsonObj.mask);\r\n this.mask = new Set();\r\n for (let i of uncompressedMaskData) {\r\n this.mask.add(i);\r\n }\r\n }\r\n this.colorDetectionMode = jsonObj.colorDetectionMode;\r\n this.colorDistance = jsonObj.colorDistance;\r\n\r\n if (jsonObj.algorithm != null) {\r\n let algoType = jsonObj.algorithm.algoType;\r\n if (algoType === \"AveragingWindowAlgo\") {\r\n this.algorithm = new wpd.AveragingWindowAlgo();\r\n } else if (algoType === \"AveragingWindowWithStepSizeAlgo\") {\r\n this.algorithm = new wpd.AveragingWindowWithStepSizeAlgo();\r\n } else if (algoType === \"BarExtractionAlgo\") {\r\n this.algorithm = new wpd.BarExtractionAlgo();\r\n } else if (algoType === \"BlobDetectorAlgo\") {\r\n this.algorithm = new wpd.BlobDetectorAlgo();\r\n } else if (algoType === \"XStepWithInterpolationAlgo\") {\r\n this.algorithm = new wpd.XStepWithInterpolationAlgo();\r\n } else if (algoType === \"CustomIndependents\") {\r\n this.algorithm = new wpd.CustomIndependents();\r\n }\r\n this.algorithm.deserialize(jsonObj.algorithm);\r\n }\r\n\r\n this.name = jsonObj.name;\r\n }\r\n\r\n generateBinaryDataFromMask(imageData) {\r\n this.binaryData = new Set();\r\n let refColor = this.colorDetectionMode === 'fg' ? this.fgColor : this.bgColor;\r\n for (let imageIdx of this.mask) {\r\n let ir = imageData.data[imageIdx * 4];\r\n let ig = imageData.data[imageIdx * 4 + 1];\r\n let ib = imageData.data[imageIdx * 4 + 2];\r\n let ia = imageData.data[imageIdx * 4 + 3];\r\n if (ia === 0) {\r\n // for completely transparent part of the image, assume white\r\n ir = 255;\r\n ig = 255;\r\n ib = 255;\r\n }\r\n let dist = wpd.dist3d(ir, ig, ib, refColor[0], refColor[1], refColor[2]);\r\n if (this.colorDetectionMode === 'fg') {\r\n if (dist <= this.colorDistance) {\r\n this.binaryData.add(imageIdx);\r\n }\r\n } else {\r\n if (dist >= this.colorDistance) {\r\n this.binaryData.add(imageIdx);\r\n }\r\n }\r\n }\r\n }\r\n\r\n generateBinaryDataUsingFullImage(imageData) {\r\n this.binaryData = new Set();\r\n let refColor = this.colorDetectionMode === 'fg' ? this.fgColor : this.bgColor;\r\n for (let imageIdx = 0; imageIdx < imageData.data.length; imageIdx++) {\r\n let ir = imageData.data[imageIdx * 4];\r\n let ig = imageData.data[imageIdx * 4 + 1];\r\n let ib = imageData.data[imageIdx * 4 + 2];\r\n let ia = imageData.data[imageIdx * 4 + 3];\r\n if (ia === 0) {\r\n // for completely transparent part of the image, assume white\r\n ir = 255;\r\n ig = 255;\r\n ib = 255;\r\n }\r\n let dist = wpd.dist3d(ir, ig, ib, refColor[0], refColor[1], refColor[2]);\r\n if (this.colorDetectionMode === 'fg') {\r\n if (dist <= this.colorDistance) {\r\n this.binaryData.add(imageIdx);\r\n }\r\n } else {\r\n if (dist >= this.colorDistance) {\r\n this.binaryData.add(imageIdx);\r\n }\r\n }\r\n }\r\n }\r\n\r\n generateBinaryData(imageData) {\r\n if (this.mask == null || this.mask.size == 0) {\r\n this.generateBinaryDataUsingFullImage(imageData);\r\n } else {\r\n this.generateBinaryDataFromMask(imageData);\r\n }\r\n }\r\n\r\n setMask(mask) {\r\n this.mask = mask;\r\n }\r\n};\r\n\r\nwpd.GridDetectionData = class {\r\n constructor() {\r\n this.mask = {\r\n xmin: null,\r\n xmax: null,\r\n ymin: null,\r\n ymax: null,\r\n pixels: []\r\n };\r\n this.lineColor = [255, 255, 255];\r\n this.colorDistance = 10;\r\n this.gridData = null;\r\n this.gridMask = {\r\n xmin: null,\r\n xmax: null,\r\n ymin: null,\r\n ymax: null,\r\n pixels: new Set()\r\n };\r\n this.binaryData = new Set();\r\n this.imageWidth = 0;\r\n this.imageHeight = 0;\r\n this.backupImageData = null;\r\n this.gridBackgroundMode = true;\r\n }\r\n\r\n generateBinaryData(imageData) {\r\n this.binaryData = new Set();\r\n this.imageWidth = imageData.width;\r\n this.imageHeight = imageData.height;\r\n\r\n // use the full image if no grid mask is present\r\n if (this.gridMask.pixels == null || this.gridMask.pixels.size === 0) {\r\n this.gridMask.pixels = new Set();\r\n\r\n for (let yi = 0; yi < this.imageHeight; yi++) {\r\n for (let xi = 0; xi < this.imageWidth; xi++) {\r\n let img_index = yi * this.imageWidth + xi;\r\n let ir = imageData.data[img_index * 4];\r\n let ig = imageData.data[img_index * 4 + 1];\r\n let ib = imageData.data[img_index * 4 + 2];\r\n let ia = imageData.data[img_index * 4 + 3];\r\n\r\n if (ia === 0) {\r\n // assume white color when image is transparent\r\n ir = 255;\r\n ig = 255;\r\n ib = 255;\r\n }\r\n\r\n let dist = wpd.dist3d(this.lineColor[0], this.lineColor[1], this.lineColor[2],\r\n ir, ig, ib);\r\n\r\n if (this.gridBackgroundMode) {\r\n if (dist > this.colorDistance) {\r\n this.binaryData.add(img_index);\r\n this.gridMask.pixels.add(img_index);\r\n }\r\n } else {\r\n if (dist < this.colorDistance) {\r\n this.binaryData.add(img_index);\r\n this.gridMask.pixels.add(img_index);\r\n }\r\n }\r\n }\r\n }\r\n this.gridMask.xmin = 0;\r\n this.gridMask.xmax = this.imageWidth;\r\n this.gridMask.ymin = 0;\r\n this.gridMask.ymax = this.imageHeight;\r\n return;\r\n }\r\n\r\n for (let img_index of this.gridMask.pixels) {\r\n let ir = imageData.data[img_index * 4];\r\n let ig = imageData.data[img_index * 4 + 1];\r\n let ib = imageData.data[img_index * 4 + 2];\r\n let ia = imageData.data[img_index * 4 + 3];\r\n\r\n let dist =\r\n wpd.dist3d(this.lineColor[0], this.lineColor[1], this.lineColor[2], ir, ig, ib);\r\n\r\n if (this.gridBackgroundMode) {\r\n if (dist > this.colorDistance) {\r\n this.binaryData.add(img_index);\r\n }\r\n } else {\r\n if (dist < this.colorDistance) {\r\n this.binaryData.add(img_index);\r\n }\r\n }\r\n }\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\n// calibration info\r\nwpd.Calibration = class {\r\n\r\n constructor(dim) {\r\n this._dim = dim;\r\n this._px = [];\r\n this._py = [];\r\n this._dimensions = dim == null ? 2 : dim;\r\n this._dp = [];\r\n this._selections = [];\r\n\r\n // public:\r\n this.labels = [];\r\n this.labelPositions = [];\r\n this.maxPointCount = 0;\r\n }\r\n\r\n getCount() {\r\n return this._px.length;\r\n }\r\n\r\n getDimensions() {\r\n return this._dimensions;\r\n }\r\n\r\n addPoint(pxi, pyi, dxi, dyi, dzi) {\r\n let plen = this._px.length;\r\n let dlen = this._dp.length;\r\n this._px[plen] = pxi;\r\n this._py[plen] = pyi;\r\n this._dp[dlen] = dxi;\r\n this._dp[dlen + 1] = dyi;\r\n if (this._dimensions === 3) {\r\n this._dp[dlen + 2] = dzi;\r\n }\r\n }\r\n\r\n getPoint(index) {\r\n if (index < 0 || index >= this._px.length)\r\n return null;\r\n\r\n return {\r\n px: this._px[index],\r\n py: this._py[index],\r\n dx: this._dp[this._dimensions * index],\r\n dy: this._dp[this._dimensions * index + 1],\r\n dz: this._dimensions === 2 ? null : this._dp[this._dimensions * index + 2]\r\n };\r\n }\r\n\r\n changePointPx(index, npx, npy) {\r\n if (index < 0 || index >= this._px.length) {\r\n return;\r\n }\r\n this._px[index] = npx;\r\n this._py[index] = npy;\r\n }\r\n\r\n setDataAt(index, dxi, dyi, dzi) {\r\n if (index < 0 || index >= this._px.length)\r\n return;\r\n this._dp[this._dimensions * index] = dxi;\r\n this._dp[this._dimensions * index + 1] = dyi;\r\n if (this._dimensions === 3) {\r\n this._dp[this._dimensions * index + 2] = dzi;\r\n }\r\n }\r\n\r\n findNearestPoint(x, y, threshold) {\r\n threshold = (threshold == null) ? 50 : parseFloat(threshold);\r\n let minDist = 0;\r\n let minIndex = -1;\r\n\r\n for (let i = 0; i < this._px.length; i++) {\r\n let dist = Math.sqrt((x - this._px[i]) * (x - this._px[i]) +\r\n (y - this._py[i]) * (y - this._py[i]));\r\n if ((minIndex < 0 && dist <= threshold) || (minIndex >= 0 && dist < minDist)) {\r\n minIndex = i;\r\n minDist = dist;\r\n }\r\n }\r\n return minIndex;\r\n }\r\n\r\n selectPoint(index) {\r\n if (this._selections.indexOf(index) < 0) {\r\n this._selections.push(index);\r\n }\r\n }\r\n\r\n selectNearestPoint(x, y, threshold) {\r\n let minIndex = this.findNearestPoint(x, y, threshold);\r\n if (minIndex >= 0) {\r\n this.selectPoint(minIndex);\r\n }\r\n }\r\n\r\n getSelectedPoints() {\r\n return this._selections;\r\n }\r\n\r\n unselectAll() {\r\n this._selections = [];\r\n }\r\n\r\n isPointSelected(index) {\r\n return this._selections.indexOf(index) >= 0;\r\n }\r\n\r\n dump() {\r\n console.log(this._px);\r\n console.log(this._py);\r\n console.log(this._dp);\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.Color = class {\r\n constructor(r = 0, g = 0, b = 0, a = 255) {\r\n this._r = r;\r\n this._g = g;\r\n this._b = b;\r\n this._a = a;\r\n }\r\n\r\n toRGBString() {\r\n return `rgb(${this._r}, ${this._g}, ${this._b})`;\r\n }\r\n\r\n toRGBAString() {\r\n return `rgba(${this._r}, ${this._g}, ${this._b}, ${this._a})`;\r\n }\r\n\r\n serialize() {\r\n return [this._r, this._g, this._b, this._a];\r\n }\r\n\r\n getRGB() {\r\n return [this._r, this._g, this._b];\r\n }\r\n\r\n deserialize(data) {\r\n this._r = data[0];\r\n this._g = data[1];\r\n this._b = data[2];\r\n this._a = data[3];\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.ColorGroup = (function () {\r\n var CGroup = function (tolerance) {\r\n var totalPixelCount = 0,\r\n averageColor = {\r\n r: 0,\r\n g: 0,\r\n b: 0\r\n };\r\n\r\n tolerance = tolerance == null ? 100 : tolerance;\r\n\r\n this.getPixelCount = function () {\r\n return totalPixelCount;\r\n };\r\n\r\n this.getAverageColor = function () {\r\n return averageColor;\r\n };\r\n\r\n this.isColorInGroup = function (r, g, b) {\r\n if (totalPixelCount === 0) {\r\n return true;\r\n }\r\n\r\n var dist = (averageColor.r - r) * (averageColor.r - r) +\r\n (averageColor.g - g) * (averageColor.g - g) +\r\n (averageColor.b - b) * (averageColor.b - b);\r\n\r\n return (dist <= tolerance * tolerance);\r\n };\r\n\r\n this.addPixel = function (r, g, b) {\r\n averageColor.r = (averageColor.r * totalPixelCount + r) / (totalPixelCount + 1.0);\r\n averageColor.g = (averageColor.g * totalPixelCount + g) / (totalPixelCount + 1.0);\r\n averageColor.b = (averageColor.b * totalPixelCount + b) / (totalPixelCount + 1.0);\r\n totalPixelCount = totalPixelCount + 1;\r\n };\r\n };\r\n return CGroup;\r\n})();\r\n\r\nwpd.colorAnalyzer = (function () {\r\n function getTopColors(imageData) {\r\n\r\n var colorGroupColl = [], // collection of color groups\r\n pixi, r, g, b, a, groupi, groupMatched, rtnVal = [],\r\n avColor, tolerance = 120;\r\n\r\n colorGroupColl[0] = new wpd.ColorGroup(tolerance); // initial group\r\n\r\n for (pixi = 0; pixi < imageData.data.length; pixi += 4) {\r\n r = imageData.data[pixi];\r\n g = imageData.data[pixi + 1];\r\n b = imageData.data[pixi + 2];\r\n a = imageData.data[pixi + 3];\r\n if (a === 0) {\r\n r = 255;\r\n g = 255;\r\n b = 255;\r\n }\r\n\r\n groupMatched = false;\r\n\r\n for (groupi = 0; groupi < colorGroupColl.length; groupi++) {\r\n if (colorGroupColl[groupi].isColorInGroup(r, g, b)) {\r\n colorGroupColl[groupi].addPixel(r, g, b);\r\n groupMatched = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!groupMatched) {\r\n colorGroupColl[colorGroupColl.length] = new wpd.ColorGroup(tolerance);\r\n colorGroupColl[colorGroupColl.length - 1].addPixel(r, g, b);\r\n }\r\n }\r\n\r\n // sort groups\r\n colorGroupColl.sort(function (a, b) {\r\n if (a.getPixelCount() > b.getPixelCount()) {\r\n return -1;\r\n } else if (a.getPixelCount() < b.getPixelCount()) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n\r\n for (groupi = 0; groupi < colorGroupColl.length; groupi++) {\r\n\r\n avColor = colorGroupColl[groupi].getAverageColor();\r\n\r\n rtnVal[groupi] = {\r\n r: parseInt(avColor.r, 10),\r\n g: parseInt(avColor.g, 10),\r\n b: parseInt(avColor.b, 10),\r\n pixels: colorGroupColl[groupi].getPixelCount(),\r\n percentage: 100.0 * colorGroupColl[groupi].getPixelCount() / (0.25 * imageData.data.length)\r\n };\r\n }\r\n\r\n return rtnVal;\r\n }\r\n\r\n return {\r\n getTopColors: getTopColors\r\n };\r\n})();/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.ConnectedPoints = class {\r\n constructor(connectivity) {\r\n this._connections = [];\r\n this._selectedConnectionIndex = -1;\r\n this._selectedPointIndex = -1;\r\n this._connectivity = connectivity;\r\n\r\n if (wpd.appData.isMultipage()) {\r\n this.page = 1;\r\n }\r\n }\r\n\r\n addConnection(plist) {\r\n this._connections.push(plist);\r\n }\r\n\r\n clearAll() {\r\n this._connections = [];\r\n }\r\n\r\n getConnectionAt(index) {\r\n if (index < this._connections.length) {\r\n return this._connections[index];\r\n }\r\n }\r\n\r\n replaceConnectionAt(index, plist) {\r\n if (index < this._connections.length) {\r\n this._connections[index] = plist;\r\n }\r\n }\r\n\r\n deleteConnectionAt(index) {\r\n if (index < this._connections.length) {\r\n this._connections.splice(index, 1);\r\n }\r\n }\r\n\r\n connectionCount() {\r\n return this._connections.length;\r\n }\r\n\r\n findNearestPointAndConnection(x, y) {\r\n var minConnIndex = -1,\r\n minPointIndex = -1,\r\n minDist, dist, ci, pi;\r\n\r\n for (ci = 0; ci < this._connections.length; ci++) {\r\n for (pi = 0; pi < this._connections[ci].length; pi += 2) {\r\n dist = (this._connections[ci][pi] - x) * (this._connections[ci][pi] - x) +\r\n (this._connections[ci][pi + 1] - y) * (this._connections[ci][pi + 1] - y);\r\n if (minPointIndex === -1 || dist < minDist) {\r\n minConnIndex = ci;\r\n minPointIndex = pi / 2;\r\n minDist = dist;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n connectionIndex: minConnIndex,\r\n pointIndex: minPointIndex\r\n };\r\n }\r\n\r\n selectNearestPoint(x, y) {\r\n var nearestPt = this.findNearestPointAndConnection(x, y);\r\n if (nearestPt.connectionIndex >= 0) {\r\n this._selectedConnectionIndex = nearestPt.connectionIndex;\r\n this._selectedPointIndex = nearestPt.pointIndex;\r\n }\r\n }\r\n\r\n deleteNearestConnection(x, y) {\r\n var nearestPt = this.findNearestPointAndConnection(x, y);\r\n if (nearestPt.connectionIndex >= 0) {\r\n this.deleteConnectionAt(nearestPt.connectionIndex);\r\n }\r\n }\r\n\r\n isPointSelected(connectionIndex, pointIndex) {\r\n if (this._selectedPointIndex === pointIndex &&\r\n this._selectedConnectionIndex === connectionIndex) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n getSelectedConnectionAndPoint() {\r\n return {\r\n connectionIndex: this._selectedConnectionIndex,\r\n pointIndex: this._selectedPointIndex\r\n };\r\n }\r\n\r\n unselectConnectionAndPoint() {\r\n this._selectedConnectionIndex = -1;\r\n this._selectedPointIndex = -1;\r\n }\r\n\r\n setPointAt(connectionIndex, pointIndex, x, y) {\r\n this._connections[connectionIndex][pointIndex * 2] = x;\r\n this._connections[connectionIndex][pointIndex * 2 + 1] = y;\r\n }\r\n\r\n getPointAt(connectionIndex, pointIndex) {\r\n return {\r\n x: this._connections[connectionIndex][pointIndex * 2],\r\n y: this._connections[connectionIndex][pointIndex * 2 + 1]\r\n };\r\n }\r\n};\r\n\r\nwpd.DistanceMeasurement = class extends wpd.ConnectedPoints {\r\n constructor() {\r\n super(2);\r\n }\r\n\r\n getDistance(index) {\r\n if (index < this._connections.length && this._connectivity === 2) {\r\n var dist = Math.sqrt((this._connections[index][0] - this._connections[index][2]) *\r\n (this._connections[index][0] - this._connections[index][2]) +\r\n (this._connections[index][1] - this._connections[index][3]) *\r\n (this._connections[index][1] - this._connections[index][3]));\r\n return dist; // this is in pixels!\r\n }\r\n }\r\n};\r\n\r\nwpd.AngleMeasurement = class extends wpd.ConnectedPoints {\r\n constructor() {\r\n super(3);\r\n }\r\n\r\n getAngle(index) {\r\n if (index < this._connections.length && this._connectivity === 3) {\r\n\r\n var ang1 = wpd.taninverse(-(this._connections[index][5] - this._connections[index][3]),\r\n this._connections[index][4] - this._connections[index][2]),\r\n ang2 = wpd.taninverse(-(this._connections[index][1] - this._connections[index][3]),\r\n this._connections[index][0] - this._connections[index][2]),\r\n ang = ang1 - ang2;\r\n\r\n ang = 180.0 * ang / Math.PI;\r\n ang = ang < 0 ? ang + 360 : ang;\r\n return ang;\r\n }\r\n }\r\n};\r\n\r\nwpd.AreaMeasurement = class extends wpd.ConnectedPoints {\r\n constructor() {\r\n super(-1); // connectivity can vary here depending on number of points in the polygon\r\n }\r\n\r\n getArea(index) {\r\n // return pixel area of polygons\r\n if (index < this._connections.length) {\r\n if (this._connections[index].length >= 4) {\r\n let totalArea = 0.0;\r\n for (let pi = 0; pi < this._connections[index].length; pi += 2) {\r\n\r\n let px1 = this._connections[index][pi];\r\n let py1 = this._connections[index][pi + 1];\r\n\r\n let px2 = 0.0;\r\n let py2 = 0.0;\r\n if (pi <= this._connections[index].length - 4) {\r\n px2 = this._connections[index][pi + 2];\r\n py2 = this._connections[index][pi + 3];\r\n } else {\r\n px2 = this._connections[index][0];\r\n py2 = this._connections[index][1];\r\n }\r\n totalArea += (px1 * py2 - px2 * py1);\r\n }\r\n totalArea /= 2.0;\r\n return totalArea;\r\n }\r\n }\r\n return 0;\r\n }\r\n\r\n getPerimeter(index) {\r\n if (index < this._connections.length) {\r\n let totalDist = 0.0;\r\n let px_prev = 0.0;\r\n let py_prev = 0.0;\r\n for (let pi = 0; pi < this._connections[index].length; pi += 2) {\r\n let px = this._connections[index][pi];\r\n let py = this._connections[index][pi + 1];\r\n if (pi >= 2) {\r\n totalDist += Math.sqrt((px - px_prev) * (px - px_prev) +\r\n (py - py_prev) * (py - py_prev));\r\n }\r\n // include the connection between the last and first point in the set (only when >=\r\n // 2 sides in the polygon):\r\n if (pi == this._connections[index].length - 2 && pi >= 4) {\r\n let px0 = this._connections[index][0];\r\n let py0 = this._connections[index][1];\r\n totalDist += Math.sqrt((px - px0) * (px - px0) + (py - py0) * (py - py0));\r\n }\r\n px_prev = px;\r\n py_prev = py;\r\n }\r\n return totalDist;\r\n }\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.plotDataProvider = (function () {\r\n let _ds = null;\r\n\r\n function setDataSource(ds) {\r\n _ds = ds;\r\n }\r\n\r\n function getData() {\r\n var axes = wpd.appData.getPlotData().getAxesForDataset(_ds);\r\n\r\n if (axes instanceof wpd.BarAxes) {\r\n return getBarAxesData(_ds, axes);\r\n } else {\r\n return getGeneralAxesData(_ds, axes);\r\n }\r\n }\r\n\r\n function getBarAxesData(dataSeries, axes) {\r\n const fieldDateFormat = [],\r\n rawData = [],\r\n isFieldSortable = [false, true],\r\n hasMetadata = dataSeries.hasMetadata();\r\n\r\n let fields = ['Label', 'Value'],\r\n // remove label from metadata\r\n metaKeys = dataSeries.getMetadataKeys().filter(key => key !== 'label');\r\n\r\n const hasOverrides = metaKeys.indexOf('overrides') > -1;\r\n\r\n if (hasOverrides) {\r\n // remove label and overrides key\r\n metaKeys = metaKeys.filter(key => key !== 'overrides');\r\n }\r\n\r\n const hasPointGroups = dataSeries.hasPointGroups();\r\n const pointGroupNames = dataSeries.getPointGroups();\r\n\r\n for (let rowi = 0; rowi < dataSeries.getCount(); rowi++) {\r\n const dataPt = dataSeries.getPixel(rowi);\r\n const transformedDataPt = axes.pixelToData(dataPt.x, dataPt.y);\r\n\r\n let tupleIdx;\r\n let groupIdx;\r\n if (hasPointGroups) {\r\n tupleIdx = dataSeries.getTupleIndex(rowi);\r\n groupIdx = dataSeries.getPointGroupIndexInTuple(tupleIdx, rowi);\r\n }\r\n\r\n rawData[rowi] = [];\r\n\r\n let lab = \"Bar\" + rowi;\r\n\r\n if (dataPt.metadata != null) {\r\n lab = dataPt.metadata[\"label\"];\r\n } else if (hasPointGroups) {\r\n // for point groups, label each tuple as the bar in the primary group\r\n // if there isn't a label stored in the metadata\r\n if (tupleIdx > -1 && groupIdx > -1) {\r\n const primaryPt = dataSeries.getPixel(dataSeries.getTuple(tupleIdx)[0]);\r\n if (primaryPt.metadata != null) {\r\n lab = primaryPt.metadata[\"label\"];\r\n } else {\r\n lab = \"Bar\" + tupleIdx;\r\n }\r\n }\r\n }\r\n rawData[rowi].push(lab);\r\n // transformed value\r\n rawData[rowi].push(transformedDataPt[0]);\r\n\r\n // point groups\r\n if (hasPointGroups) {\r\n let groupName = pointGroupNames[groupIdx];\r\n if (!groupName) {\r\n if (groupIdx === -1) {\r\n // not in a group\r\n groupName = \"\";\r\n } else if (groupIdx === 0) {\r\n // unnamed primary group\r\n groupName = wpd.gettext(\"point-group-primary-group\");\r\n } else {\r\n // unnamed non-primary group\r\n groupName = `${wpd.gettext(\"point-group-group\")} ${groupIdx}`\r\n }\r\n }\r\n rawData[rowi].push(tupleIdx);\r\n rawData[rowi].push(groupName);\r\n }\r\n\r\n // other metadata\r\n for (let metadi = 0; metadi < metaKeys.length; metadi++) {\r\n const key = metaKeys[metadi];\r\n let ptmetadata = null;\r\n if (dataPt.metadata != null && dataPt.metadata[key] != null) {\r\n ptmetadata = dataPt.metadata[key];\r\n }\r\n rawData[rowi].push(ptmetadata);\r\n }\r\n\r\n // overrides\r\n if (hasOverrides) {\r\n const field = 'y';\r\n let ptoverride = null;\r\n if (\r\n dataPt.metadata != null &&\r\n dataPt.metadata.overrides != null &&\r\n dataPt.metadata.overrides[field] != null\r\n ) {\r\n ptoverride = dataPt.metadata.overrides[field];\r\n }\r\n rawData[rowi].push(ptoverride);\r\n }\r\n }\r\n\r\n if (hasPointGroups) {\r\n // add tuples and groups to fields\r\n fields = fields.concat(\"Tuple\", \"Group\");\r\n isFieldSortable.push(true, true);\r\n }\r\n\r\n if (metaKeys.length) {\r\n // add metadata keys to fields\r\n fields = fields.concat(metaKeys.map(key => {\r\n isFieldSortable.push(true);\r\n return wpd.utils.toSentenceCase(key);\r\n }));\r\n }\r\n\r\n if (hasOverrides) {\r\n // add override field labels to fields\r\n fields = fields.concat(['Value-Override']);\r\n\r\n isFieldSortable.push(true);\r\n }\r\n\r\n return {\r\n fields: fields,\r\n fieldDateFormat: fieldDateFormat,\r\n rawData: rawData,\r\n allowConnectivity: false,\r\n connectivityFieldIndices: [],\r\n isFieldSortable: isFieldSortable\r\n };\r\n }\r\n\r\n function getGeneralAxesData(dataSeries, axes) {\r\n // 2D XY, Polar, Ternary, Image, Map\r\n const rawData = [],\r\n isFieldSortable = [],\r\n hasMetadata = dataSeries.hasMetadata();\r\n\r\n let fields = axes.getAxesLabels(),\r\n fieldDateFormat = [],\r\n connectivityFieldIndices = [],\r\n metaKeys = dataSeries.getMetadataKeys(),\r\n metaKeyCount = hasMetadata === true ? metaKeys.length : 0;\r\n\r\n const hasOverrides = metaKeys.indexOf('overrides') > -1;\r\n\r\n if (hasOverrides) {\r\n // remove overrides key\r\n metaKeys = metaKeys.filter(key => key !== 'overrides');\r\n metaKeyCount -= 1;\r\n }\r\n\r\n const hasPointGroups = dataSeries.hasPointGroups();\r\n const pointGroupNames = dataSeries.getPointGroups();\r\n\r\n // data points\r\n for (let rowi = 0; rowi < dataSeries.getCount(); rowi++) {\r\n const pt = dataSeries.getPixel(rowi);\r\n const ptData = axes.pixelToData(pt.x, pt.y);\r\n rawData[rowi] = [];\r\n\r\n // transformed coordinates\r\n for (let coli = 0; coli < ptData.length; coli++) {\r\n rawData[rowi].push(ptData[coli]);\r\n }\r\n\r\n // point groups\r\n if (hasPointGroups) {\r\n const tuplei = dataSeries.getTupleIndex(rowi)\r\n const groupi = dataSeries.getPointGroupIndexInTuple(tuplei, rowi);\r\n let groupName = pointGroupNames[groupi];\r\n if (!groupName) {\r\n if (groupi === -1) {\r\n // not in a group\r\n groupName = \"\";\r\n } else if (groupi === 0) {\r\n // unnamed primary group\r\n groupName = wpd.gettext(\"point-group-primary-group\");\r\n } else {\r\n // unnamed non-primary group\r\n groupName = `${wpd.gettext(\"point-group-group\")} ${groupi}`\r\n }\r\n }\r\n rawData[rowi].push(tuplei);\r\n rawData[rowi].push(groupName);\r\n }\r\n\r\n // metadata\r\n for (let metadi = 0; metadi < metaKeyCount; metadi++) {\r\n const key = metaKeys[metadi];\r\n let ptmetadata = null;\r\n if (pt.metadata != null && pt.metadata[key] != null) {\r\n ptmetadata = pt.metadata[key];\r\n }\r\n rawData[rowi].push(ptmetadata);\r\n }\r\n\r\n // overrides\r\n if (hasOverrides) {\r\n for (let fieldi = 0; fieldi < fields.length; fieldi++) {\r\n const field = fields[fieldi].toLowerCase();\r\n let ptoverride = null;\r\n if (\r\n pt.metadata != null &&\r\n pt.metadata.overrides != null &&\r\n pt.metadata.overrides[field] != null\r\n ) {\r\n ptoverride = pt.metadata.overrides[field];\r\n }\r\n rawData[rowi].push(ptoverride);\r\n }\r\n }\r\n }\r\n\r\n // field labels\r\n if (hasPointGroups) {\r\n fields = fields.concat(\"Tuple\", \"Group\");\r\n isFieldSortable.push(true, true);\r\n }\r\n if (hasMetadata) {\r\n fields = fields.concat(metaKeys.map(key => {\r\n return wpd.utils.toSentenceCase(key);\r\n }));\r\n\r\n if (hasOverrides) {\r\n // add override field labels to fields\r\n fields = fields.concat(axes.getAxesLabels().map(field => {\r\n return wpd.utils.toSentenceCase(field) + '-Override';\r\n }));\r\n }\r\n }\r\n\r\n for (let coli = 0; coli < fields.length; coli++) {\r\n if (coli < axes.getDimensions()) {\r\n connectivityFieldIndices[coli] = coli;\r\n if (axes.isDate != null && axes.isDate(coli)) {\r\n fieldDateFormat[coli] = axes.getInitialDateFormat(coli);\r\n }\r\n }\r\n\r\n isFieldSortable[coli] = true; // all fields are sortable\r\n }\r\n\r\n return {\r\n fields: fields,\r\n fieldDateFormat: fieldDateFormat,\r\n rawData: rawData,\r\n allowConnectivity: true,\r\n connectivityFieldIndices: connectivityFieldIndices,\r\n isFieldSortable: isFieldSortable\r\n };\r\n }\r\n\r\n return {\r\n setDataSource: setDataSource,\r\n getData: getData\r\n };\r\n})();\r\n\r\nwpd.measurementDataProvider = (function () {\r\n let _ms = null;\r\n\r\n function setDataSource(ms) {\r\n _ms = ms;\r\n }\r\n\r\n function getData() {\r\n var fields = [],\r\n fieldDateFormat = [],\r\n rawData = [],\r\n isFieldSortable = [],\r\n plotData = wpd.appData.getPlotData(),\r\n axes = plotData.getAxesForMeasurement(_ms),\r\n isMap = axes != null && (axes instanceof wpd.MapAxes),\r\n conni;\r\n\r\n if (_ms instanceof wpd.DistanceMeasurement) {\r\n for (conni = 0; conni < _ms.connectionCount(); conni++) {\r\n rawData[conni] = [];\r\n rawData[conni][0] = 'Dist' + conni;\r\n if (isMap) {\r\n rawData[conni][1] = axes.pixelToDataDistance(_ms.getDistance(conni));\r\n } else {\r\n rawData[conni][1] = _ms.getDistance(conni);\r\n }\r\n }\r\n\r\n fields = ['Label', 'Distance'];\r\n isFieldSortable = [false, true];\r\n\r\n } else if (_ms instanceof wpd.AngleMeasurement) {\r\n\r\n for (conni = 0; conni < _ms.connectionCount(); conni++) {\r\n rawData[conni] = [];\r\n rawData[conni][0] = 'Theta' + conni;\r\n rawData[conni][1] = _ms.getAngle(conni);\r\n }\r\n\r\n fields = ['Label', 'Angle'];\r\n isFieldSortable = [false, true];\r\n\r\n } else if (_ms instanceof wpd.AreaMeasurement) {\r\n\r\n for (conni = 0; conni < _ms.connectionCount(); conni++) {\r\n rawData[conni] = [];\r\n rawData[conni][0] = 'Poly' + conni;\r\n if (isMap) {\r\n rawData[conni][1] = axes.pixelToDataArea(_ms.getArea(conni));\r\n rawData[conni][2] = axes.pixelToDataDistance(_ms.getPerimeter(conni));\r\n } else {\r\n rawData[conni][1] = _ms.getArea(conni);\r\n rawData[conni][2] = _ms.getPerimeter(conni);\r\n }\r\n }\r\n\r\n fields = ['Label', 'Area', 'Perimeter'];\r\n isFieldSortable = [false, true, true];\r\n }\r\n\r\n return {\r\n fields: fields,\r\n fieldDateFormat: fieldDateFormat,\r\n rawData: rawData,\r\n allowConnectivity: false,\r\n connectivityFieldIndices: [],\r\n isFieldSortable: isFieldSortable\r\n };\r\n }\r\n\r\n return {\r\n getData: getData,\r\n setDataSource: setDataSource\r\n };\r\n})();/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\n// Data from a series\r\nwpd.Dataset = class {\r\n constructor(dim) {\r\n this._dim = dim;\r\n this._dataPoints = [];\r\n this._connections = [];\r\n this._selections = [];\r\n this._pixelMetadataCount = 0;\r\n this._pixelMetadataKeys = [];\r\n this._metadata = {};\r\n this._groupNames = []; // point group names\r\n // _tuples is an array of arrays\r\n // each inner array contains pixel indexes, indexed by group indexes\r\n this._tuples = [];\r\n\r\n // public:\r\n this.name = 'Default Dataset';\r\n this.variableNames = ['x', 'y'];\r\n this.colorRGB = new wpd.Color(200, 0, 0);\r\n }\r\n\r\n hasMetadata() {\r\n return this._pixelMetadataCount > 0;\r\n }\r\n\r\n setMetadataKeys(metakeys) {\r\n this._pixelMetadataKeys = metakeys;\r\n }\r\n\r\n getMetadataKeys() {\r\n return this._pixelMetadataKeys;\r\n }\r\n\r\n addPixel(pxi, pyi, mdata) {\r\n let dlen = this._dataPoints.length;\r\n this._dataPoints[dlen] = {\r\n x: pxi,\r\n y: pyi,\r\n metadata: mdata\r\n };\r\n if (mdata != null) {\r\n this._pixelMetadataCount++;\r\n }\r\n return dlen;\r\n }\r\n\r\n getPixel(index) {\r\n return this._dataPoints[index];\r\n }\r\n\r\n getAllPixels() {\r\n return this._dataPoints;\r\n }\r\n\r\n setPixelAt(index, pxi, pyi) {\r\n if (index < this._dataPoints.length) {\r\n this._dataPoints[index].x = pxi;\r\n this._dataPoints[index].y = pyi;\r\n }\r\n }\r\n\r\n setMetadataAt(index, mdata) {\r\n if (index < this._dataPoints.length) {\r\n if (mdata != null) {\r\n if (this._dataPoints[index].metadata == null) {\r\n this._pixelMetadataCount++;\r\n }\r\n } else {\r\n if (this._dataPoints[index].metadata != null) {\r\n this._pixelMetadataCount--;\r\n }\r\n }\r\n this._dataPoints[index].metadata = mdata;\r\n }\r\n }\r\n\r\n insertPixel(index, pxi, pyi, mdata) {\r\n this._dataPoints.splice(index, 0, {\r\n x: pxi,\r\n y: pyi,\r\n metadata: mdata\r\n });\r\n if (mdata != null) {\r\n this._pixelMetadataCount++;\r\n }\r\n }\r\n\r\n removePixelAtIndex(index) {\r\n if (index < this._dataPoints.length) {\r\n if (this._dataPoints[index].metadata != null) {\r\n this._pixelMetadataCount--;\r\n }\r\n this._dataPoints.splice(index, 1);\r\n }\r\n }\r\n\r\n removeLastPixel() {\r\n let pIndex = this._dataPoints.length - 1;\r\n this.removePixelAtIndex(pIndex);\r\n return pIndex;\r\n }\r\n\r\n findNearestPixel(x, y, threshold) {\r\n threshold = (threshold == null) ? 50 : parseFloat(threshold);\r\n let minDist = 0,\r\n minIndex = -1;\r\n for (let i = 0; i < this._dataPoints.length; i++) {\r\n let dist = Math.sqrt((x - this._dataPoints[i].x) * (x - this._dataPoints[i].x) +\r\n (y - this._dataPoints[i].y) * (y - this._dataPoints[i].y));\r\n if ((minIndex < 0 && dist <= threshold) || (minIndex >= 0 && dist < minDist)) {\r\n minIndex = i;\r\n minDist = dist;\r\n }\r\n }\r\n return minIndex;\r\n }\r\n\r\n removeNearestPixel(x, y, threshold) {\r\n let minIndex = this.findNearestPixel(x, y, threshold);\r\n if (minIndex >= 0) {\r\n this.removePixelAtIndex(minIndex);\r\n }\r\n return minIndex;\r\n }\r\n\r\n clearAll() {\r\n this._dataPoints = [];\r\n this._pixelMetadataCount = 0;\r\n this._pixelMetadataKeys = [];\r\n this._metadata = {};\r\n this._groupNames = [];\r\n this._tuples = [];\r\n }\r\n\r\n getCount() {\r\n return this._dataPoints.length;\r\n }\r\n\r\n selectPixel(index) {\r\n if (this._selections.indexOf(index) >= 0) {\r\n return;\r\n }\r\n this._selections.push(index);\r\n }\r\n\r\n selectPixels(indexes) {\r\n for (let i = 0; i < indexes.length; i++) {\r\n this.selectPixel(indexes[i]);\r\n }\r\n }\r\n\r\n unselectAll() {\r\n this._selections = [];\r\n }\r\n\r\n selectPixelsInRectangle(p1, p2) {\r\n // define tester functions for each quadrant\r\n const tester = {\r\n ne: function (x, y) {\r\n return x >= p1.x && x <= p2.x && y >= p1.y && y <= p2.y;\r\n },\r\n se: function (x, y) {\r\n return x >= p1.x && x <= p2.x && y <= p1.y && y >= p2.y;\r\n },\r\n sw: function (x, y) {\r\n return x <= p1.x && x >= p2.x && y <= p1.y && y >= p2.y;\r\n },\r\n nw: function (x, y) {\r\n return x <= p1.x && x >= p2.x && y >= p1.y && y <= p2.y;\r\n }\r\n };\r\n\r\n // determine directional relationship between p1 and p2\r\n const xDirection = (p1.x - p2.x) > 0 ? -1 : 1;\r\n const yDirection = (p1.y - p2.y) > 0 ? 1 : -1;\r\n\r\n // pick tester function based on relationship between p1 and p2\r\n let direction = null;\r\n if (yDirection > 0) { // south\r\n if (xDirection > 0) { // east\r\n direction = 'se';\r\n } else { // west\r\n direction = 'sw';\r\n }\r\n } else { // north\r\n if (xDirection > 0) { // east\r\n direction = 'ne';\r\n } else { // west\r\n direction = 'nw';\r\n }\r\n }\r\n\r\n // go through each data point and test if coordinates are inside rectangle\r\n // defined by p1 and p2\r\n for (let index = 0; index < this._dataPoints.length; index++) {\r\n if (tester[direction](this._dataPoints[index].x, this._dataPoints[index].y)) {\r\n this.selectPixel(index);\r\n }\r\n }\r\n }\r\n\r\n selectNearestPixel(x, y, threshold) {\r\n let minIndex = this.findNearestPixel(x, y, threshold);\r\n if (minIndex >= 0) {\r\n this.selectPixel(minIndex);\r\n }\r\n return minIndex;\r\n }\r\n\r\n selectNextPixel() {\r\n for (let i = 0; i < this._selections.length; i++) {\r\n this._selections[i] = (this._selections[i] + 1) % this._dataPoints.length;\r\n }\r\n }\r\n\r\n selectPreviousPixel() {\r\n for (let i = 0; i < this._selections.length; i++) {\r\n let newIndex = this._selections[i];\r\n if (newIndex === 0) {\r\n newIndex = this._dataPoints.length - 1;\r\n } else {\r\n newIndex = newIndex - 1;\r\n }\r\n this._selections[i] = newIndex;\r\n }\r\n }\r\n\r\n getSelectedPixels() {\r\n return this._selections;\r\n }\r\n\r\n getPointGroups() {\r\n return this._groupNames;\r\n }\r\n\r\n setPointGroups(pointGroups) {\r\n this._groupNames = pointGroups;\r\n }\r\n\r\n hasPointGroups() {\r\n return this._groupNames.length > 0;\r\n }\r\n\r\n getPointGroupsCount() {\r\n return this._groupNames.length;\r\n }\r\n\r\n getPointGroupIndexInTuple(tupleIndex, pixelIndex) {\r\n if (this._tuples[tupleIndex]) {\r\n return this._tuples[tupleIndex].indexOf(pixelIndex);\r\n }\r\n return -1;\r\n }\r\n\r\n getPixelIndexesInGroup(groupIndex) {\r\n if (groupIndex < this._groupNames.length) {\r\n return this._tuples.map(tuple => tuple[groupIndex]);\r\n }\r\n return [];\r\n }\r\n\r\n removePointGroupFromTuples(groupIndex) {\r\n if (groupIndex < this._groupNames.length) {\r\n this._tuples.forEach(tuple => {\r\n tuple.splice(groupIndex, 1);\r\n });\r\n }\r\n }\r\n\r\n addTuple(pixelIndex) {\r\n if (!this._tuples.some(tuple => tuple[0] === pixelIndex)) {\r\n // create a new array of nulls\r\n const tuple = Array(this._groupNames.length).fill(null);\r\n tuple[0] = pixelIndex;\r\n this._tuples.push(tuple);\r\n\r\n // return last index\r\n return this._tuples.length - 1;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n addEmptyTupleAt(tupleIndex) {\r\n // create an \"empty\" tuple if it doesn't already exist\r\n // \"empty\" here means filled with nulls\r\n if (!this._tuples[tupleIndex]) {\r\n this._tuples[tupleIndex] = Array(this._groupNames.length).fill(null);\r\n }\r\n }\r\n\r\n addToTupleAt(tupleIndex, groupIndex, pixelIndex) {\r\n if (!this._tuples[tupleIndex].includes(pixelIndex)) {\r\n this._tuples[tupleIndex][groupIndex] = pixelIndex;\r\n }\r\n }\r\n\r\n removeTuple(tupleIndex) {\r\n if (tupleIndex < this._tuples.length) {\r\n this._tuples.splice(tupleIndex, 1);\r\n }\r\n }\r\n\r\n removeFromTupleAt(tupleIndex, pixelIndex) {\r\n const groupIndex = this._tuples[tupleIndex].indexOf(pixelIndex);\r\n\r\n if (groupIndex > -1) {\r\n // set group to null for the tuple\r\n this._tuples[tupleIndex][groupIndex] = null;\r\n }\r\n }\r\n\r\n getTupleIndex(pixelIndex) {\r\n return this._tuples.findIndex(tuple => tuple.includes(pixelIndex));\r\n }\r\n\r\n getTuple(tupleIndex) {\r\n return this._tuples[tupleIndex];\r\n }\r\n\r\n getTupleCount() {\r\n return this._tuples.length;\r\n }\r\n\r\n getAllTuples() {\r\n return this._tuples;\r\n }\r\n\r\n isTupleEmpty(tupleIndex) {\r\n return this._tuples[tupleIndex].every(groupIndex => groupIndex === null);\r\n }\r\n\r\n refreshTuplesAfterGroupAdd(count) {\r\n this._tuples.forEach(tuple => tuple.push(...Array(count).fill(null)));\r\n }\r\n\r\n refreshTuplesAfterPixelRemoval(removedPixelIndex) {\r\n for (let tupleIndex = 0; tupleIndex < this._tuples.length; tupleIndex++) {\r\n const tuple = this._tuples[tupleIndex];\r\n\r\n for (let groupIndex = 0; groupIndex < tuple.length; groupIndex++) {\r\n if (tuple[groupIndex] !== null) {\r\n if (tuple[groupIndex] === removedPixelIndex) {\r\n // set to null\r\n tuple[groupIndex] = null;\r\n } else if (tuple[groupIndex] > removedPixelIndex) {\r\n // decrement any index greater than the removed index\r\n tuple[groupIndex]--;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n getMetadata() {\r\n // deep clone\r\n return JSON.parse(JSON.stringify(this._metadata));\r\n }\r\n\r\n setMetadata(obj) {\r\n // deep clone\r\n this._metadata = JSON.parse(JSON.stringify(obj));\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\n/* Parse dates and convert back and forth to Julian days */\r\nvar wpd = wpd || {};\r\n\r\nwpd.dateConverter = (function () {\r\n function parse(input) {\r\n if (input == null) {\r\n return null;\r\n }\r\n\r\n if (typeof input === \"string\") {\r\n if (input.indexOf('/') < 0 && input.indexOf(':') < 0) {\r\n return null;\r\n }\r\n }\r\n\r\n return toJD(input);\r\n }\r\n\r\n function toJD(dateString) {\r\n dateString = dateString.toString();\r\n var dateParts = dateString.split(/[/ :]/),\r\n hasDatePart = dateString.indexOf('/') >= 0,\r\n year,\r\n month, date, hour, min, sec, timeIdxOffset, today, tempDate, rtnValue;\r\n\r\n if (dateParts.length <= 0 || dateParts.length > 6) {\r\n return null;\r\n }\r\n\r\n if (hasDatePart) {\r\n year = parseInt(dateParts[0], 10);\r\n month = parseInt(dateParts[1] === undefined ? 0 : dateParts[1], 10);\r\n date = parseInt(dateParts[2] === undefined ? 1 : dateParts[2], 10);\r\n timeIdxOffset = 3;\r\n } else {\r\n today = new Date();\r\n year = today.getFullYear();\r\n month = today.getMonth() + 1;\r\n date = today.getDate();\r\n timeIdxOffset = 0;\r\n }\r\n hour = parseInt(dateParts[timeIdxOffset] === undefined ? 0 : dateParts[timeIdxOffset], 10);\r\n min = parseInt(\r\n dateParts[timeIdxOffset + 1] === undefined ? 0 : dateParts[timeIdxOffset + 1], 10);\r\n sec = parseInt(\r\n dateParts[timeIdxOffset + 2] === undefined ? 0 : dateParts[timeIdxOffset + 2], 10);\r\n\r\n if (isNaN(year) || isNaN(month) || isNaN(date) || isNaN(hour) || isNaN(min) || isNaN(sec)) {\r\n return null;\r\n }\r\n\r\n if (month > 12 || month < 1) {\r\n return null;\r\n }\r\n\r\n if (date > 31 || date < 1) {\r\n return null;\r\n }\r\n\r\n if (hour > 23 || hour < 0) {\r\n return null;\r\n }\r\n\r\n if (min > 59 || min < 0) {\r\n return null;\r\n }\r\n\r\n if (sec > 59 || sec < 0) {\r\n return null;\r\n }\r\n\r\n // Temporary till I figure out julian dates:\r\n tempDate = new Date();\r\n tempDate.setUTCFullYear(year);\r\n tempDate.setUTCMonth(month - 1);\r\n tempDate.setUTCDate(date);\r\n tempDate.setUTCHours(hour, min, sec);\r\n rtnValue = parseFloat(Date.parse(tempDate));\r\n if (!isNaN(rtnValue)) {\r\n return rtnValue;\r\n }\r\n return null;\r\n }\r\n\r\n function formatDateNumber(dateNumber, formatString) {\r\n // round to smallest time unit\r\n var coeff = 1;\r\n\r\n if (formatString.indexOf('s') >= 0)\r\n coeff = 1000;\r\n else if (formatString.indexOf('i') >= 0)\r\n coeff = 1000 * 60;\r\n else if (formatString.indexOf('h') >= 0)\r\n coeff = 1000 * 60 * 60;\r\n else if (formatString.indexOf('d') >= 0)\r\n coeff = 1000 * 60 * 60 * 24;\r\n else if (formatString.indexOf('m') >= 0)\r\n coeff = 1000 * 60 * 60 * 24 * 365.2425 / 12;\r\n else if (formatString.indexOf('y') >= 0)\r\n coeff = 1000 * 60 * 60 * 24 * 365.2425;\r\n\r\n return formatDate(new Date(Math.round(new Date(dateNumber).getTime() / coeff) * coeff),\r\n formatString);\r\n }\r\n\r\n function formatDate(dateObject, formatString) {\r\n\r\n var longMonths = [],\r\n shortMonths = [],\r\n tmpDate = new Date('1/1/2021');\r\n\r\n for (var i = 0; i < 12; i++) {\r\n tmpDate.setUTCMonth(i);\r\n longMonths.push(tmpDate.toLocaleString(undefined, {\r\n month: \"long\"\r\n }));\r\n shortMonths.push(tmpDate.toLocaleString(undefined, {\r\n month: \"short\"\r\n }));\r\n }\r\n\r\n var outputString = formatString;\r\n\r\n outputString = outputString.replace(\"YYYY\", \"yyyy\");\r\n outputString = outputString.replace(\"YY\", \"yy\");\r\n outputString = outputString.replace(\"MMMM\", \"mmmm\");\r\n outputString = outputString.replace(\"MMM\", \"mmm\");\r\n outputString = outputString.replace(\"MM\", \"mm\");\r\n outputString = outputString.replace(\"DD\", \"dd\");\r\n outputString = outputString.replace(\"HH\", \"hh\");\r\n outputString = outputString.replace(\"II\", \"ii\");\r\n outputString = outputString.replace(\"SS\", \"ss\");\r\n\r\n outputString = outputString.replace(\"yyyy\", dateObject.getUTCFullYear());\r\n\r\n var twoDigitYear = dateObject.getUTCFullYear() % 100;\r\n twoDigitYear = twoDigitYear < 10 ? '0' + twoDigitYear : twoDigitYear;\r\n\r\n outputString = outputString.replace(\"yy\", twoDigitYear);\r\n\r\n outputString = outputString.replace(\"mmmm\", longMonths[dateObject.getUTCMonth()]);\r\n outputString = outputString.replace(\"mmm\", shortMonths[dateObject.getUTCMonth()]);\r\n outputString = outputString.replace(\"mm\", (\"0\" + (dateObject.getUTCMonth() + 1)).slice(-2));\r\n outputString = outputString.replace(\"dd\", (\"0\" + dateObject.getUTCDate()).slice(-2));\r\n\r\n outputString = outputString.replace(\"hh\", (\"0\" + dateObject.getUTCHours()).slice(-2));\r\n outputString = outputString.replace(\"ii\", (\"0\" + dateObject.getUTCMinutes()).slice(-2));\r\n outputString = outputString.replace(\"ss\", (\"0\" + dateObject.getUTCSeconds()).slice(-2));\r\n\r\n return outputString;\r\n }\r\n\r\n function getFormatString(dateString) {\r\n var dateParts = dateString.split(/[/ :]/),\r\n hasDatePart = dateString.indexOf('/') >= 0,\r\n formatString = 'yyyy/mm/dd hh:ii:ss';\r\n\r\n if (dateParts.length >= 1) {\r\n formatString = hasDatePart ? 'yyyy' : 'hh';\r\n }\r\n\r\n if (dateParts.length >= 2) {\r\n formatString += hasDatePart ? '/mm' : ':ii';\r\n }\r\n\r\n if (dateParts.length >= 3) {\r\n formatString += hasDatePart ? '/dd' : ':ss';\r\n }\r\n\r\n if (dateParts.length >= 4) {\r\n formatString += ' hh';\r\n }\r\n\r\n if (dateParts.length >= 5) {\r\n formatString += ':ii';\r\n }\r\n\r\n if (dateParts.length === 6) {\r\n formatString += ':ss';\r\n }\r\n\r\n return formatString;\r\n }\r\n\r\n return {\r\n parse: parse,\r\n getFormatString: getFormatString,\r\n formatDateNumber: formatDateNumber\r\n };\r\n})();/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.gridDetectionCore = (function () {\r\n var hasHorizontal, hasVertical, xFrac = 0.1,\r\n yFrac = 0.1;\r\n\r\n function run(autoDetector) {\r\n var gridData = new Set(),\r\n xi, yi, xmin = autoDetector.gridMask.xmin,\r\n xmax = autoDetector.gridMask.xmax,\r\n ymin = autoDetector.gridMask.ymin,\r\n ymax = autoDetector.gridMask.ymax,\r\n dw = autoDetector.imageWidth,\r\n dh = autoDetector.imageHeight,\r\n linePixCount;\r\n\r\n if (hasVertical) {\r\n\r\n for (xi = xmin; xi <= xmax; xi++) {\r\n linePixCount = 0;\r\n for (yi = ymin; yi < ymax; yi++) {\r\n if (autoDetector.binaryData.has(yi * dw + xi)) {\r\n linePixCount++;\r\n }\r\n }\r\n if (linePixCount > yFrac * (ymax - ymin)) {\r\n for (yi = ymin; yi < ymax; yi++) {\r\n gridData.add(yi * dw + xi);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (hasHorizontal) {\r\n\r\n for (yi = ymin; yi <= ymax; yi++) {\r\n linePixCount = 0;\r\n for (xi = xmin; xi <= xmax; xi++) {\r\n if (autoDetector.binaryData.has(yi * dw + xi)) {\r\n linePixCount++;\r\n }\r\n }\r\n if (linePixCount > xFrac * (xmax - xmin)) {\r\n for (xi = xmin; xi <= xmax; xi++) {\r\n gridData.add(yi * dw + xi);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return gridData;\r\n }\r\n\r\n function setHorizontalParameters(has_horizontal, x_perc) {\r\n hasHorizontal = has_horizontal;\r\n xFrac = Math.abs(parseFloat(x_perc) / 100.0);\r\n }\r\n\r\n function setVerticalParameters(has_vertical, y_perc) {\r\n hasVertical = has_vertical;\r\n yFrac = Math.abs(parseFloat(y_perc) / 100.0);\r\n }\r\n\r\n return {\r\n run: run,\r\n setHorizontalParameters: setHorizontalParameters,\r\n setVerticalParameters: setVerticalParameters\r\n };\r\n})();\r\n/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\n/* Parse user provided expressions, dates etc. */\r\nvar wpd = wpd || {};\r\n\r\nwpd.InputParser = class {\r\n constructor() {\r\n // public:\r\n this.isValid = false;\r\n this.isDate = false;\r\n this.formatting = null;\r\n this.isArray = false;\r\n }\r\n\r\n parse(input) {\r\n this.isValid = false;\r\n this.isDate = false;\r\n this.formatting = null;\r\n\r\n if (input == null) {\r\n return null;\r\n }\r\n\r\n if (typeof input === \"string\") {\r\n input = input.trim();\r\n\r\n if (input.indexOf('^') >= 0) {\r\n return null;\r\n }\r\n }\r\n\r\n let parsedDate = wpd.dateConverter.parse(input);\r\n if (parsedDate != null) {\r\n this.isValid = true;\r\n this.isDate = true;\r\n this.formatting = wpd.dateConverter.getFormatString(input);\r\n return parsedDate;\r\n }\r\n\r\n let parsedArray = this._parseArray(input);\r\n if (parsedArray != null) {\r\n this.isValid = true;\r\n this.isArray = true;\r\n return parsedArray;\r\n }\r\n\r\n let parsedFloat = parseFloat(input);\r\n if (!isNaN(parsedFloat)) {\r\n this.isValid = true;\r\n return parsedFloat;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n _parseArray(input) {\r\n // e.g. convert \"[1.2, 3.4, 100]\" to an array [1.2, 3.4, 100]\r\n // TODO: support comma decimal separators somehow...\r\n let valArray = input.replace(\"[\", \"\").replace(\"]\", \"\").split(\",\").map(v => parseFloat(v)).filter(v => !isNaN(v));\r\n if (valArray.length == 0) {\r\n return null;\r\n }\r\n return valArray;\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\n/**\r\n * Calculate inverse tan with range between 0, 2*pi.\r\n */\r\nvar wpd = wpd || {};\r\n\r\nwpd.taninverse = function (y, x) {\r\n var inv_ans;\r\n if (y > 0) // I & II\r\n inv_ans = Math.atan2(y, x);\r\n else if (y <= 0) // III & IV\r\n inv_ans = Math.atan2(y, x) + 2 * Math.PI;\r\n\r\n if (inv_ans >= 2 * Math.PI)\r\n inv_ans = 0.0;\r\n return inv_ans;\r\n};\r\n\r\nwpd.sqDist2d = function (x1, y1, x2, y2) {\r\n return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\r\n};\r\n\r\nwpd.sqDist3d = function (\r\n x1, y1, z1, x2, y2,\r\n z2) {\r\n return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2);\r\n};\r\n\r\nwpd.dist2d = function (x1, y1, x2, y2) {\r\n return Math.sqrt(wpd.sqDist2d(x1, y1, x2, y2));\r\n};\r\n\r\nwpd.dist3d = function (x1, y1, z1, x2, y2,\r\n z2) {\r\n return Math.sqrt(wpd.sqDist3d(x1, y1, z1, x2, y2, z2));\r\n};\r\n\r\nwpd.mat = (function () {\r\n function det2x2(m) {\r\n return m[0] * m[3] - m[1] * m[2];\r\n }\r\n\r\n function inv2x2(m) {\r\n var det = det2x2(m);\r\n return [m[3] / det, -m[1] / det, -m[2] / det, m[0] / det];\r\n }\r\n\r\n function mult2x2(m1, m2) {\r\n return [\r\n m1[0] * m2[0] + m1[1] * m2[2], m1[0] * m2[1] + m1[1] * m2[3],\r\n m1[2] * m2[0] + m1[3] * m2[2], m1[2] * m2[1] + m1[3] * m2[3]\r\n ];\r\n }\r\n\r\n function mult2x2Vec(m, v) {\r\n return [m[0] * v[0] + m[1] * v[1], m[2] * v[0] + m[3] * v[1]];\r\n }\r\n\r\n function multVec2x2(v, m) {\r\n return [m[0] * v[0] + m[2] * v[1], m[1] * v[0] + m[3] * v[1]];\r\n }\r\n\r\n return {\r\n det2x2: det2x2,\r\n inv2x2: inv2x2,\r\n mult2x2: mult2x2,\r\n mult2x2Vec: mult2x2Vec,\r\n multVec2x2: multVec2x2\r\n };\r\n})();\r\n\r\nwpd.cspline =\r\n function (x, y) {\r\n var len = x.length,\r\n cs = {\r\n x: x,\r\n y: y,\r\n len: len,\r\n d: []\r\n },\r\n l = [],\r\n b = [],\r\n i;\r\n\r\n /* TODO: when len = 1, return the same value. For len = 2, do a linear interpolation */\r\n if (len < 3) {\r\n return null;\r\n }\r\n\r\n b[0] = 2.0;\r\n l[0] = 3.0 * (y[1] - y[0]);\r\n for (i = 1; i < len - 1; ++i) {\r\n b[i] = 4.0 - 1.0 / b[i - 1];\r\n l[i] = 3.0 * (y[i + 1] - y[i - 1]) - l[i - 1] / b[i - 1];\r\n }\r\n\r\n b[len - 1] = 2.0 - 1.0 / b[len - 2];\r\n l[len - 1] = 3.0 * (y[len - 1] - y[len - 2]) - l[len - 2] / b[len - 1];\r\n\r\n i = len - 1;\r\n cs.d[i] = l[i] / b[i];\r\n while (i > 0) {\r\n --i;\r\n cs.d[i] = (l[i] - cs.d[i + 1]) / b[i];\r\n }\r\n\r\n return cs;\r\n };\r\n\r\nwpd.cspline_interp =\r\n function (cs, x) {\r\n var i = 0,\r\n t, a, b, c, d;\r\n if (x >= cs.x[cs.len - 1] || x < cs.x[0]) {\r\n return null;\r\n }\r\n\r\n /* linear search to find the index */\r\n while (x > cs.x[i]) {\r\n i++;\r\n }\r\n\r\n i = (i > 0) ? i - 1 : 0;\r\n t = (x - cs.x[i]) / (cs.x[i + 1] - cs.x[i]);\r\n a = cs.y[i];\r\n b = cs.d[i];\r\n c = 3.0 * (cs.y[i + 1] - cs.y[i]) - 2.0 * cs.d[i] - cs.d[i + 1];\r\n d = 2.0 * (cs.y[i] - cs.y[i + 1]) + cs.d[i] + cs.d[i + 1];\r\n return a + b * t + c * t * t + d * t * t * t;\r\n };\r\n\r\n\r\n// Get circle center and radius from three 2D points\r\nwpd.getCircleFrom3Pts = function (pts) {\r\n let Ax = pts[0][0];\r\n let Bx = pts[1][0];\r\n let Cx = pts[2][0];\r\n let Ay = pts[0][1];\r\n let By = pts[1][1];\r\n let Cy = pts[2][1];\r\n let a = wpd.dist2d(Cx, Cy, Bx, By);\r\n let b = wpd.dist2d(Ax, Ay, Cx, Cy);\r\n let c = wpd.dist2d(Bx, By, Ax, Ay);\r\n let s = (a + b + c) / 2.0;\r\n let R = (a * b * c) / 4.0 / Math.sqrt(s * (s - a) * (s - b) * (s - c));\r\n let b1 = a * a * (b * b + c * c - a * a);\r\n let b2 = b * b * (a * a + c * c - b * b);\r\n let b3 = c * c * (a * a + b * b - c * c);\r\n let X = [\r\n (Ax * b1 + Bx * b2 + Cx * b3) / (b1 + b2 + b3),\r\n (Ay * b1 + By * b2 + Cy * b3) / (b1 + b2 + b3)\r\n ];\r\n return {\r\n \"x0\": X[0],\r\n \"y0\": X[1],\r\n \"radius\": R,\r\n };\r\n};\r\n\r\nwpd.normalizeAngleDeg = function (angleDeg) {\r\n let normDeg = angleDeg % 360;\r\n if (normDeg < 0) {\r\n normDeg += 360.0;\r\n }\r\n return normDeg;\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\n// Plot information\r\n\r\nwpd.PlotData = class {\r\n constructor() {\r\n this._topColors = null;\r\n this._axesColl = [];\r\n this._datasetColl = [];\r\n this._measurementColl = [];\r\n this._objectAxesMap = new Map();\r\n this._datasetAutoDetectionDataMap = new Map();\r\n this._gridDetectionData = null;\r\n }\r\n\r\n reset() {\r\n this._axesColl = [];\r\n this._datasetColl = [];\r\n this._measurementColl = [];\r\n this._objectAxesMap = new Map();\r\n this._datasetAutoDetectionDataMap = new Map();\r\n this._gridDetectionData = null;\r\n }\r\n\r\n setTopColors(topColors) {\r\n this._topColors = topColors;\r\n }\r\n\r\n getTopColors(topColors) {\r\n return this._topColors;\r\n }\r\n\r\n addAxes(ax) {\r\n this._axesColl.push(ax);\r\n }\r\n\r\n getAxesColl() {\r\n return this._axesColl;\r\n }\r\n\r\n getAxesNames() {\r\n let names = [];\r\n this._axesColl.forEach((ax) => {\r\n names.push(ax.name);\r\n });\r\n return names;\r\n }\r\n\r\n deleteAxes(ax) {\r\n let axIdx = this._axesColl.indexOf(ax);\r\n if (axIdx >= 0) {\r\n this._axesColl.splice(axIdx, 1);\r\n\r\n // take care of dependents\r\n this._objectAxesMap.forEach((val, key, map) => {\r\n if (val === ax) {\r\n map.set(key, null);\r\n }\r\n });\r\n }\r\n }\r\n\r\n getAxesCount() {\r\n return this._axesColl.length;\r\n }\r\n\r\n addDataset(ds) {\r\n this._datasetColl.push(ds);\r\n\r\n // by default bind ds to last axes\r\n const axCount = this._axesColl.length;\r\n if (axCount > 0) {\r\n let axes = this._axesColl[axCount - 1];\r\n this.setAxesForDataset(ds, axes);\r\n }\r\n }\r\n\r\n getDatasets() {\r\n return this._datasetColl;\r\n }\r\n\r\n getDatasetNames() {\r\n let names = [];\r\n this._datasetColl.forEach((ds) => {\r\n names.push(ds.name);\r\n });\r\n return names;\r\n }\r\n\r\n getDatasetCount() {\r\n return this._datasetColl.length;\r\n }\r\n\r\n addMeasurement(ms, skipAutoAttach) {\r\n this._measurementColl.push(ms);\r\n\r\n // if this is a distance measurement, then attach to first existing image or map axes:\r\n if (!skipAutoAttach && ms instanceof wpd.DistanceMeasurement && this._axesColl.length > 0) {\r\n for (let aIdx = 0; aIdx < this._axesColl.length; aIdx++) {\r\n if (this._axesColl[aIdx] instanceof wpd.MapAxes || this._axesColl[aIdx] instanceof wpd.ImageAxes) {\r\n this.setAxesForMeasurement(ms, this._axesColl[aIdx]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n getMeasurementColl() {\r\n return this._measurementColl;\r\n }\r\n\r\n getMeasurementsByType(mtype) {\r\n let mcoll = [];\r\n this._measurementColl.forEach(m => {\r\n if (m instanceof mtype) {\r\n mcoll.push(m);\r\n }\r\n });\r\n return mcoll;\r\n }\r\n\r\n deleteMeasurement(ms) {\r\n var msIdx = this._measurementColl.indexOf(ms);\r\n if (msIdx >= 0) {\r\n this._measurementColl.splice(msIdx, 1);\r\n this._objectAxesMap.delete(ms);\r\n }\r\n }\r\n\r\n setAxesForDataset(ds, ax) {\r\n this._objectAxesMap.set(ds, ax);\r\n }\r\n\r\n setAxesForMeasurement(ms, ax) {\r\n this._objectAxesMap.set(ms, ax);\r\n }\r\n\r\n setAutoDetectionDataForDataset(ds, autoDetectionData) {\r\n this._datasetAutoDetectionDataMap.set(ds, autoDetectionData);\r\n }\r\n\r\n getAxesForDataset(ds) {\r\n return this._objectAxesMap.get(ds);\r\n }\r\n\r\n getAxesForMeasurement(ms) {\r\n return this._objectAxesMap.get(ms);\r\n }\r\n\r\n getAutoDetectionDataForDataset(ds) {\r\n let ad = this._datasetAutoDetectionDataMap.get(ds);\r\n if (ad == null) { // create one if no autodetection data is present!\r\n ad = new wpd.AutoDetectionData();\r\n this.setAutoDetectionDataForDataset(ds, ad);\r\n }\r\n return ad;\r\n }\r\n\r\n getGridDetectionData() {\r\n if (this._gridDetectionData == null) {\r\n this._gridDetectionData = new wpd.GridDetectionData();\r\n }\r\n return this._gridDetectionData;\r\n }\r\n\r\n deleteDataset(ds) {\r\n var dsIdx = this._datasetColl.indexOf(ds);\r\n if (dsIdx >= 0) {\r\n this._datasetColl.splice(dsIdx, 1);\r\n this._objectAxesMap.delete(ds);\r\n this._datasetAutoDetectionDataMap.delete(ds);\r\n }\r\n }\r\n\r\n _deserializePreVersion4(data) {\r\n // read axes info\r\n if (data.axesType == null) {\r\n return true;\r\n }\r\n if (data.axesType !== \"ImageAxes\" &&\r\n (data.calibration == null || data.axesParameters == null)) {\r\n return false;\r\n }\r\n\r\n // get calibration points\r\n let calibration = null;\r\n if (data.axesType !== \"ImageAxes\") {\r\n if (data.axesType === \"TernaryAxes\") {\r\n calibration = new wpd.Calibration(3);\r\n } else {\r\n calibration = new wpd.Calibration(2);\r\n }\r\n for (let calIdx = 0; calIdx < data.calibration.length; calIdx++) {\r\n calibration.addPoint(data.calibration[calIdx].px, data.calibration[calIdx].py,\r\n data.calibration[calIdx].dx, data.calibration[calIdx].dy,\r\n data.calibration[calIdx].dz);\r\n }\r\n }\r\n\r\n let axes = null;\r\n if (data.axesType === \"XYAxes\") {\r\n axes = new wpd.XYAxes();\r\n calibration.labels = ['X1', 'X2', 'Y1', 'Y2'];\r\n calibration.labelPositions = ['N', 'N', 'E', 'E'];\r\n calibration.maxPointCount = 4;\r\n axes.calibrate(calibration, data.axesParameters.isLogX, data.axesParameters.isLogY);\r\n } else if (data.axesType === \"BarAxes\") {\r\n axes = new wpd.BarAxes();\r\n calibration.labels = ['P1', 'P2'];\r\n calibration.labelPositions = ['S', 'S'];\r\n calibration.maxPointCount = 2;\r\n axes.calibrate(calibration, data.axesParameters.isLog);\r\n } else if (data.axesType === \"PolarAxes\") {\r\n axes = new wpd.PolarAxes();\r\n calibration.labels = ['Origin', 'P1', 'P2'];\r\n calibration.labelPositions = ['E', 'S', 'S'];\r\n calibration.maxPointCount = 3;\r\n axes.calibrate(calibration, data.axesParameters.isDegrees,\r\n data.axesParameters.isClockwise);\r\n } else if (data.axesType === \"TernaryAxes\") {\r\n axes = new wpd.TernaryAxes();\r\n calibration.labels = ['A', 'B', 'C'];\r\n calibration.labelPositions = ['S', 'S', 'E'];\r\n calibration.maxPointCount = 3;\r\n axes.calibrate(calibration, data.axesParameters.isRange100,\r\n data.axesParameters.isNormalOrientation);\r\n } else if (data.axesType === \"MapAxes\") {\r\n axes = new wpd.MapAxes();\r\n calibration.labels = ['P1', 'P2'];\r\n calibration.labelPositions = ['S', 'S'];\r\n calibration.maxPointCount = 2;\r\n axes.calibrate(calibration, data.axesParameters.scaleLength,\r\n data.axesParameters.unitString, \"top-left\", 0);\r\n } else if (data.axesType === \"ImageAxes\") {\r\n axes = new wpd.ImageAxes();\r\n }\r\n\r\n if (axes != null) {\r\n this._axesColl.push(axes);\r\n }\r\n\r\n // datasets\r\n if (data.dataSeries != null) {\r\n for (let dsIdx = 0; dsIdx < data.dataSeries.length; dsIdx++) {\r\n const dsData = data.dataSeries[dsIdx];\r\n let ds = new wpd.Dataset();\r\n ds.name = dsData.name;\r\n if (dsData.metadataKeys != null && dsData.metadataKeys.length > 0) {\r\n ds.setMetadataKeys(dsData.metadataKeys.map(k => k.toLowerCase()));\r\n }\r\n for (let pxIdx = 0; pxIdx < dsData.data.length; pxIdx++) {\r\n // only label key existed in the past\r\n if (dsData.metadataKeys.length > 0) {\r\n const metadataKey = dsData.metadataKeys[0].toLowerCase();\r\n const metadataValue = dsData.data[pxIdx].metadata[0];\r\n ds.addPixel(dsData.data[pxIdx].x, dsData.data[pxIdx].y, {\r\n [metadataKey]: metadataValue\r\n });\r\n } else {\r\n ds.addPixel(dsData.data[pxIdx].x, dsData.data[pxIdx].y);\r\n }\r\n }\r\n this.addDataset(ds);\r\n this.setAxesForDataset(ds, axes);\r\n }\r\n }\r\n\r\n // measurements\r\n\r\n // distances\r\n if (data.distanceMeasurementData != null) {\r\n let dist = new wpd.DistanceMeasurement();\r\n for (let cIdx = 0; cIdx < data.distanceMeasurementData.length; cIdx++) {\r\n dist.addConnection(data.distanceMeasurementData[cIdx]);\r\n }\r\n this.addMeasurement(dist);\r\n if (axes instanceof wpd.MapAxes) {\r\n this.setAxesForMeasurement(dist, axes);\r\n }\r\n }\r\n\r\n // angles\r\n if (data.angleMeasurementData != null) {\r\n let ang = new wpd.AngleMeasurement();\r\n for (let cIdx = 0; cIdx < data.angleMeasurementData.length; cIdx++) {\r\n ang.addConnection(data.angleMeasurementData[cIdx]);\r\n }\r\n this.addMeasurement(ang);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n _deserializeVersion4(data) {\r\n // collect page data if it exists\r\n let documentMetadata = {};\r\n\r\n const collectMetadata = (group, type, key, object) => {\r\n if (!documentMetadata[group])\r\n documentMetadata[group] = {};\r\n if (!documentMetadata[group][type])\r\n documentMetadata[group][type] = {};\r\n if (!documentMetadata[group][type][key])\r\n documentMetadata[group][type][key] = [];\r\n documentMetadata[group][type][key].push(object);\r\n };\r\n\r\n // axes data\r\n if (data.axesColl != null) {\r\n for (let axIdx = 0; axIdx < data.axesColl.length; axIdx++) {\r\n const axData = data.axesColl[axIdx];\r\n\r\n // get calibration\r\n let calibration = null;\r\n if (axData.type !== \"ImageAxes\") {\r\n if (axData.type === \"TernaryAxes\") {\r\n calibration = new wpd.Calibration(3);\r\n } else {\r\n calibration = new wpd.Calibration(2);\r\n }\r\n for (let calIdx = 0; calIdx < axData.calibrationPoints.length; calIdx++) {\r\n calibration.addPoint(axData.calibrationPoints[calIdx].px,\r\n axData.calibrationPoints[calIdx].py,\r\n axData.calibrationPoints[calIdx].dx,\r\n axData.calibrationPoints[calIdx].dy,\r\n axData.calibrationPoints[calIdx].dz);\r\n }\r\n }\r\n\r\n // create axes\r\n let axes = null;\r\n if (axData.type === \"XYAxes\") {\r\n axes = new wpd.XYAxes();\r\n calibration.labels = ['X1', 'X2', 'Y1', 'Y2'];\r\n calibration.labelPositions = ['N', 'N', 'E', 'E'];\r\n calibration.maxPointCount = 4;\r\n axes.calibrate(calibration, axData.isLogX, axData.isLogY, axData.noRotation);\r\n } else if (axData.type === \"BarAxes\") {\r\n axes = new wpd.BarAxes();\r\n calibration.labels = ['P1', 'P2'];\r\n calibration.labelPositions = ['S', 'S'];\r\n calibration.maxPointCount = 2;\r\n axes.calibrate(calibration, axData.isLog,\r\n axData.isRotated == null ? false : axData.isRotated);\r\n } else if (axData.type === \"PolarAxes\") {\r\n axes = new wpd.PolarAxes();\r\n calibration.labels = ['Origin', 'P1', 'P2'];\r\n calibration.labelPositions = ['E', 'S', 'S'];\r\n calibration.maxPointCount = 3;\r\n axes.calibrate(calibration, axData.isDegrees, axData.isClockwise, axData.isLog);\r\n } else if (axData.type === \"TernaryAxes\") {\r\n axes = new wpd.TernaryAxes();\r\n calibration.labels = ['A', 'B', 'C'];\r\n calibration.labelPositions = ['S', 'S', 'E'];\r\n calibration.maxPointCount = 3;\r\n axes.calibrate(calibration, axData.isRange100, axData.isNormalOrientation);\r\n } else if (axData.type === \"MapAxes\") {\r\n axes = new wpd.MapAxes();\r\n calibration.labels = ['P1', 'P2'];\r\n calibration.labelPositions = ['S', 'S'];\r\n calibration.maxPointCount = 2;\r\n let originLocation = axData.originLocation != null ? axData.originLocation : \"top-left\";\r\n let imageHeight = axData.imageHeight != null ? parseInt(axData.imageHeight, 10) : 0;\r\n axes.calibrate(calibration, axData.scaleLength, axData.unitString, originLocation, imageHeight);\r\n } else if (axData.type === \"ImageAxes\") {\r\n axes = new wpd.ImageAxes();\r\n } else if (axData.type === \"CircularChartRecorderAxes\") {\r\n axes = new wpd.CircularChartRecorderAxes();\r\n calibration.labels = ['(T0,R0)', '(T0,R1)', '(T0,R2)', '(T1,R2)', '(T2,R2)'];\r\n calibration.labelPositions = ['S', 'S', 'S', 'S', 'S'];\r\n calibration.maxPointCount = 5;\r\n axes.calibrate(calibration, axData.startTime, axData.rotationTime == null ? \"week\" : axData.rotationTime, axData.rotationDirection == null ? \"anticlockwise\" : axData.rotationDirection);\r\n }\r\n\r\n if (axes != null) {\r\n axes.name = axData.name;\r\n\r\n if (axData.metadata !== undefined) {\r\n axes.setMetadata(axData.metadata);\r\n }\r\n\r\n this._axesColl.push(axes);\r\n\r\n // collect document metadata\r\n if (axData.file !== undefined) {\r\n collectMetadata('file', 'axes', axData.file, axes);\r\n }\r\n if (axData.page !== undefined) {\r\n collectMetadata('page', 'axes', axData.page, axes);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // datasets\r\n if (data.datasetColl != null) {\r\n for (let dsIdx = 0; dsIdx < data.datasetColl.length; dsIdx++) {\r\n const dsData = data.datasetColl[dsIdx];\r\n let ds = new wpd.Dataset();\r\n ds.name = dsData.name;\r\n if (dsData.colorRGB != null) {\r\n ds.colorRGB = new wpd.Color(dsData.colorRGB[0], dsData.colorRGB[1], dsData.colorRGB[2]);\r\n }\r\n // dataset metadata\r\n if (dsData.metadata !== undefined) {\r\n ds.setMetadata(dsData.metadata);\r\n }\r\n // data point groups\r\n if (dsData.groupNames !== undefined) {\r\n ds.setPointGroups(dsData.groupNames);\r\n }\r\n // data points metadata keys\r\n if (dsData.metadataKeys != null) {\r\n ds.setMetadataKeys(dsData.metadataKeys);\r\n }\r\n\r\n // data points\r\n for (let pxIdx = 0; pxIdx < dsData.data.length; pxIdx++) {\r\n // for backwards compatibility; metadata was updated from array\r\n // to object\r\n let metadata = dsData.data[pxIdx].metadata;\r\n if (dsData.data[pxIdx].metadata != null) {\r\n if (Array.isArray(metadata)) {\r\n // transform metadata array into object\r\n metadata = metadata.reduce((obj, val, idx) => {\r\n return {\r\n ...obj,\r\n [dsData.metadataKeys[idx]]: val\r\n };\r\n }, {});\r\n }\r\n }\r\n // set point group data, if present\r\n if (\r\n ds.hasPointGroups() &&\r\n dsData.data[pxIdx].tuple !== undefined &&\r\n dsData.data[pxIdx].group !== undefined\r\n ) {\r\n // addEmptyTupleAt checks if tuple exists\r\n ds.addEmptyTupleAt(dsData.data[pxIdx].tuple);\r\n ds.addToTupleAt(dsData.data[pxIdx].tuple, dsData.data[pxIdx].group, pxIdx);\r\n }\r\n ds.addPixel(dsData.data[pxIdx].x, dsData.data[pxIdx].y, metadata);\r\n }\r\n this._datasetColl.push(ds);\r\n\r\n // collect document metadata\r\n if (dsData.file !== undefined) {\r\n collectMetadata('file', 'datasets', dsData.file, ds);\r\n }\r\n if (dsData.page !== undefined) {\r\n collectMetadata('page', 'datasets', dsData.page, ds);\r\n }\r\n\r\n // set axes for this dataset\r\n const axIdx = this.getAxesNames().indexOf(dsData.axesName);\r\n if (axIdx >= 0) {\r\n this.setAxesForDataset(ds, this._axesColl[axIdx]);\r\n }\r\n\r\n // autodetector\r\n if (dsData.autoDetectionData != null) {\r\n let autoDetectionData = new wpd.AutoDetectionData();\r\n autoDetectionData.deserialize(dsData.autoDetectionData);\r\n this.setAutoDetectionDataForDataset(ds, autoDetectionData);\r\n }\r\n }\r\n }\r\n\r\n // measurements\r\n if (data.measurementColl != null) {\r\n for (let msIdx = 0; msIdx < data.measurementColl.length; msIdx++) {\r\n const msData = data.measurementColl[msIdx];\r\n let ms = null;\r\n if (msData.type === \"Distance\") {\r\n ms = new wpd.DistanceMeasurement();\r\n this._measurementColl.push(ms);\r\n // set axes\r\n const axIdx = this.getAxesNames().indexOf(msData.axesName);\r\n if (axIdx >= 0) {\r\n this.setAxesForMeasurement(ms, this._axesColl[axIdx]);\r\n }\r\n } else if (msData.type === \"Angle\") {\r\n ms = new wpd.AngleMeasurement();\r\n this._measurementColl.push(ms);\r\n } else if (msData.type === \"Area\") {\r\n ms = new wpd.AreaMeasurement();\r\n this._measurementColl.push(ms);\r\n // set axes\r\n const axIdx = this.getAxesNames().indexOf(msData.axesName);\r\n if (axIdx >= 0) {\r\n this.setAxesForMeasurement(ms, this._axesColl[axIdx]);\r\n }\r\n }\r\n if (ms != null) {\r\n // add connections\r\n for (let cIdx = 0; cIdx < msData.data.length; cIdx++) {\r\n ms.addConnection(msData.data[cIdx]);\r\n }\r\n\r\n // collect document metadata\r\n if (msData.file !== undefined) {\r\n collectMetadata('file', 'measurements', msData.file, ms);\r\n }\r\n if (msData.page !== undefined) {\r\n collectMetadata('page', 'measurements', msData.page, ms);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // misc\r\n if (data.misc != null) {\r\n documentMetadata.misc = data.misc;\r\n }\r\n\r\n return documentMetadata;\r\n }\r\n\r\n deserialize(data) {\r\n this.reset();\r\n try {\r\n if (data.wpd != null && data.wpd.version[0] === 3) {\r\n return this._deserializePreVersion4(data.wpd);\r\n }\r\n if (data.version != null && data.version[0] === 4) {\r\n return this._deserializeVersion4(data);\r\n }\r\n return true;\r\n } catch (e) {\r\n console.log(e);\r\n return false;\r\n }\r\n }\r\n\r\n serialize(documentMetadata) {\r\n let data = {};\r\n data.version = [4, 2];\r\n data.axesColl = [];\r\n data.datasetColl = [];\r\n data.measurementColl = [];\r\n\r\n // axes data\r\n for (let axIdx = 0; axIdx < this._axesColl.length; axIdx++) {\r\n const axes = this._axesColl[axIdx];\r\n let axData = {};\r\n axData.name = axes.name;\r\n\r\n // file and page metadata\r\n if (documentMetadata) {\r\n if (documentMetadata.file && documentMetadata.file.axes[axes.name] !== undefined) {\r\n axData.file = documentMetadata.file.axes[axes.name];\r\n }\r\n if (documentMetadata.page && documentMetadata.page.axes[axes.name] !== undefined) {\r\n axData.page = documentMetadata.page.axes[axes.name];\r\n }\r\n }\r\n\r\n // axes data\r\n if (axes instanceof wpd.XYAxes) {\r\n axData.type = \"XYAxes\";\r\n axData.isLogX = axes.isLogX();\r\n axData.isLogY = axes.isLogY();\r\n axData.noRotation = axes.noRotation();\r\n } else if (axes instanceof wpd.BarAxes) {\r\n axData.type = \"BarAxes\";\r\n axData.isLog = axes.isLog();\r\n axData.isRotated = axes.isRotated();\r\n } else if (axes instanceof wpd.PolarAxes) {\r\n axData.type = \"PolarAxes\";\r\n axData.isDegrees = axes.isThetaDegrees();\r\n axData.isClockwise = axes.isThetaClockwise();\r\n axData.isLog = axes.isRadialLog();\r\n } else if (axes instanceof wpd.TernaryAxes) {\r\n axData.type = \"TernaryAxes\";\r\n axData.isRange100 = axes.isRange100();\r\n axData.isNormalOrientation = axes.isNormalOrientation;\r\n } else if (axes instanceof wpd.MapAxes) {\r\n axData.type = \"MapAxes\";\r\n axData.scaleLength = axes.getScaleLength();\r\n axData.unitString = axes.getUnits();\r\n axData.originLocation = axes.getOriginLocation();\r\n axData.imageHeight = axes.getImageHeight();\r\n } else if (axes instanceof wpd.ImageAxes) {\r\n axData.type = \"ImageAxes\";\r\n } else if (axes instanceof wpd.CircularChartRecorderAxes) {\r\n axData.type = \"CircularChartRecorderAxes\";\r\n axData.startTime = axes.getStartTime();\r\n axData.rotationTime = axes.getRotationTime();\r\n axData.rotationDirection = axes.getRotationDirection();\r\n }\r\n\r\n // include axes metadata, if present\r\n if (Object.keys(axes.getMetadata()).length > 0) {\r\n axData.metadata = axes.getMetadata();\r\n }\r\n\r\n // calibration points\r\n if (!(axes instanceof wpd.ImageAxes)) {\r\n axData.calibrationPoints = [];\r\n for (let calIdx = 0; calIdx < axes.calibration.getCount(); calIdx++) {\r\n axData.calibrationPoints.push(axes.calibration.getPoint(calIdx));\r\n }\r\n }\r\n\r\n data.axesColl.push(axData);\r\n }\r\n\r\n // datasets\r\n for (let dsIdx = 0; dsIdx < this._datasetColl.length; dsIdx++) {\r\n const ds = this._datasetColl[dsIdx];\r\n const axes = this.getAxesForDataset(ds);\r\n const autoDetectionData = this.getAutoDetectionDataForDataset(ds);\r\n\r\n // dataset information\r\n let dsData = {};\r\n dsData.name = ds.name;\r\n dsData.axesName = axes != null ? axes.name : \"\";\r\n dsData.colorRGB = ds.colorRGB.serialize();\r\n dsData.metadataKeys = ds.getMetadataKeys(); // point metadata keys\r\n // include file and page information, if present\r\n if (documentMetadata) {\r\n if (documentMetadata.file && documentMetadata.file.datasets[ds.name] !== undefined) {\r\n dsData.file = documentMetadata.file.datasets[ds.name];\r\n }\r\n if (documentMetadata.page && documentMetadata.page.datasets[ds.name] !== undefined) {\r\n dsData.page = documentMetadata.page.datasets[ds.name];\r\n }\r\n }\r\n // include point group names, if present\r\n if (ds.hasPointGroups()) {\r\n dsData.groupNames = ds.getPointGroups();\r\n }\r\n // include dataset metadata, if present\r\n if (Object.keys(ds.getMetadata()).length > 0) {\r\n // this is metadata on the dataset itself, not to be confused with metadataKeys which denote metadata keys on\r\n // each data point within the dataset\r\n dsData.metadata = ds.getMetadata();\r\n }\r\n\r\n // data points\r\n dsData.data = [];\r\n for (let pxIdx = 0; pxIdx < ds.getCount(); pxIdx++) {\r\n let px = ds.getPixel(pxIdx);\r\n\r\n // include point group data, if present\r\n if (ds.hasPointGroups()) {\r\n const tupleIdx = ds.getTupleIndex(pxIdx)\r\n const groupIdx = ds.getPointGroupIndexInTuple(tupleIdx, pxIdx);\r\n if (tupleIdx > -1 && groupIdx > -1) {\r\n px.tuple = tupleIdx;\r\n px.group = groupIdx;\r\n }\r\n }\r\n\r\n dsData.data[pxIdx] = px;\r\n if (axes != null) {\r\n dsData.data[pxIdx].value = axes.pixelToData(px.x, px.y);\r\n }\r\n }\r\n dsData.autoDetectionData =\r\n autoDetectionData != null ? autoDetectionData.serialize() : null;\r\n data.datasetColl.push(dsData);\r\n }\r\n\r\n // measurements\r\n for (let msIdx = 0; msIdx < this._measurementColl.length; msIdx++) {\r\n const ms = this._measurementColl[msIdx];\r\n const axes = this.getAxesForMeasurement(ms);\r\n let msData = {};\r\n if (ms instanceof wpd.DistanceMeasurement) {\r\n msData.type = \"Distance\";\r\n msData.name = \"Distance\";\r\n msData.axesName = axes != null ? axes.name : \"\";\r\n } else if (ms instanceof wpd.AngleMeasurement) {\r\n msData.type = \"Angle\";\r\n msData.name = \"Angle\";\r\n } else if (ms instanceof wpd.AreaMeasurement) {\r\n msData.type = \"Area\";\r\n msData.name = \"Area\";\r\n msData.axesName = axes != null ? axes.name : \"\";\r\n }\r\n if (documentMetadata) {\r\n if (documentMetadata.file && documentMetadata.file.measurements[msIdx] !== undefined) {\r\n msData.file = documentMetadata.file.measurements[msIdx];\r\n }\r\n if (documentMetadata.page && documentMetadata.page.measurements[msIdx] !== undefined) {\r\n msData.page = documentMetadata.page.measurements[msIdx];\r\n }\r\n }\r\n msData.data = [];\r\n for (let cIdx = 0; cIdx < ms.connectionCount(); cIdx++) {\r\n msData.data.push(ms.getConnectionAt(cIdx));\r\n }\r\n data.measurementColl.push(msData);\r\n }\r\n\r\n if (documentMetadata && documentMetadata.misc) {\r\n data.misc = documentMetadata.misc;\r\n }\r\n\r\n return data;\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\n// Run-length encoder/decoder (Mainly used for masks)\r\nwpd.rle = {};\r\n\r\n// wpd.rle.encode - Encode a sorted array of integers\r\nwpd.rle.encode = function (sortedArray) {\r\n // return an array as [[pos, count], [pos, count], ... ]\r\n let ret = [];\r\n let prevVal = null;\r\n let item = [0, 0];\r\n for (let val of sortedArray) {\r\n if (prevVal == null) { // first item\r\n item = [val, 1];\r\n } else if (val == prevVal + 1) { // continued item\r\n item[1]++;\r\n } else { // item ended\r\n ret.push(item);\r\n item = [val, 1];\r\n }\r\n prevVal = val;\r\n }\r\n // add last item\r\n if (item[1] != 0) {\r\n ret.push(item);\r\n }\r\n\r\n return ret;\r\n};\r\n\r\n// wpd.rle.decode - Decode RLE array with data as [[pos, count], [pos, count], ... ] etc.\r\nwpd.rle.decode = function (rleArray) {\r\n let ret = [];\r\n for (let item of rleArray) {\r\n let val = item[0];\r\n let count = item[1];\r\n for (let i = 0; i < count; ++i) {\r\n ret.push(val + i);\r\n }\r\n }\r\n return ret;\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.AveragingWindowAlgo = class {\r\n\r\n constructor() {\r\n this._xStep = 10;\r\n this._yStep = 10;\r\n this._wasRun = false;\r\n }\r\n\r\n getParamList(axes) {\r\n return {\r\n xStep: ['ΔX', 'Px', this._xStep],\r\n yStep: ['ΔY', 'Px', this._yStep]\r\n };\r\n }\r\n\r\n setParams(params) {\r\n this._xStep = parseFloat(params.xStep);\r\n this._yStep = parseFloat(params.yStep);\r\n }\r\n\r\n getParams() {\r\n return {\r\n xStep: this._xStep,\r\n yStep: this._yStep\r\n };\r\n }\r\n\r\n serialize() {\r\n return this._wasRun ? {\r\n algoType: \"AveragingWindowAlgo\",\r\n xStep: this._xStep,\r\n yStep: this._yStep\r\n } :\r\n null;\r\n }\r\n\r\n deserialize(obj) {\r\n this._xStep = obj.xStep;\r\n this._yStep = obj.yStep;\r\n this._wasRun = true;\r\n }\r\n\r\n run(autoDetector, dataSeries, axes) {\r\n this._wasRun = true;\r\n let algoCore = new wpd.AveragingWindowCore(\r\n autoDetector.binaryData, autoDetector.imageHeight, autoDetector.imageWidth, this._xStep,\r\n this._yStep, dataSeries);\r\n algoCore.run();\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.AveragingWindowCore = class {\r\n\r\n constructor(binaryData, imageHeight, imageWidth, dx, dy, dataSeries) {\r\n this._binaryData = binaryData;\r\n this._imageHeight = imageHeight;\r\n this._imageWidth = imageWidth;\r\n this._dx = dx;\r\n this._dy = dy;\r\n this._dataSeries = dataSeries;\r\n }\r\n\r\n run() {\r\n var xPoints = [],\r\n xPointsPicked = 0,\r\n pointsPicked = 0,\r\n dw = this._imageWidth,\r\n dh = this._imageHeight,\r\n blobAvg = [],\r\n coli, rowi, firstbloby, bi, blobs, blbi, xi, yi,\r\n pi, inRange, xxi, oldX, oldY, avgX, avgY, newX, newY, matches, xStep = this._dx,\r\n yStep = this._dy;\r\n\r\n this._dataSeries.clearAll();\r\n\r\n for (coli = 0; coli < dw; coli++) {\r\n\r\n blobs = -1;\r\n firstbloby = -2.0 * yStep;\r\n bi = 0;\r\n\r\n // Scan vertically for blobs:\r\n\r\n for (rowi = 0; rowi < dh; rowi++) {\r\n if (this._binaryData.has(rowi * dw + coli)) {\r\n if (rowi > firstbloby + yStep) {\r\n blobs = blobs + 1;\r\n bi = 1;\r\n blobAvg[blobs] = rowi;\r\n firstbloby = rowi;\r\n } else {\r\n bi = bi + 1;\r\n blobAvg[blobs] =\r\n parseFloat((blobAvg[blobs] * (bi - 1.0) + rowi) / parseFloat(bi));\r\n }\r\n }\r\n }\r\n\r\n if (blobs >= 0) {\r\n xi = coli + 0.5;\r\n for (blbi = 0; blbi <= blobs; blbi++) {\r\n yi = blobAvg[blbi] + 0.5; // add 0.5 to shift to the middle of the pixels\r\n // instead of the starting edge.\r\n\r\n xPoints[xPointsPicked] = [];\r\n xPoints[xPointsPicked][0] = parseFloat(xi);\r\n xPoints[xPointsPicked][1] = parseFloat(yi);\r\n xPoints[xPointsPicked][2] =\r\n true; // true if not filtered, false if processed already\r\n xPointsPicked = xPointsPicked + 1;\r\n }\r\n }\r\n }\r\n\r\n if (xPointsPicked === 0) {\r\n return;\r\n }\r\n\r\n for (pi = 0; pi < xPointsPicked; pi++) {\r\n if (xPoints[pi][2] === true) { // if still available\r\n inRange = true;\r\n xxi = pi + 1;\r\n\r\n oldX = xPoints[pi][0];\r\n oldY = xPoints[pi][1];\r\n\r\n avgX = oldX;\r\n avgY = oldY;\r\n\r\n matches = 1;\r\n\r\n while ((inRange === true) && (xxi < xPointsPicked)) {\r\n newX = xPoints[xxi][0];\r\n newY = xPoints[xxi][1];\r\n\r\n if ((Math.abs(newX - oldX) <= xStep) && (Math.abs(newY - oldY) <= yStep) &&\r\n (xPoints[xxi][2] === true)) {\r\n avgX = (avgX * matches + newX) / (matches + 1.0);\r\n avgY = (avgY * matches + newY) / (matches + 1.0);\r\n matches = matches + 1;\r\n xPoints[xxi][2] = false;\r\n }\r\n\r\n if (newX > oldX + 2 * xStep) {\r\n inRange = false;\r\n }\r\n\r\n xxi = xxi + 1;\r\n }\r\n\r\n xPoints[pi][2] = false;\r\n\r\n pointsPicked = pointsPicked + 1;\r\n this._dataSeries.addPixel(parseFloat(avgX), parseFloat(avgY));\r\n }\r\n }\r\n xPoints = [];\r\n return this._dataSeries;\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\nvar wpd = wpd || {};\r\n\r\nwpd.AveragingWindowWithStepSizeAlgo = class {\r\n\r\n constructor() {\r\n this._xmin = 0;\r\n this._xmax = 0;\r\n this._delx = 0.1;\r\n this._lineWidth = 30;\r\n this._ymin = 0;\r\n this._ymax = 0;\r\n this._wasRun = false;\r\n }\r\n\r\n getParamList(axes) {\r\n if (!this._wasRun) {\r\n if (axes != null && axes instanceof wpd.XYAxes) {\r\n let bounds = axes.getBounds();\r\n this._xmin = bounds.x1;\r\n this._xmax = bounds.x2;\r\n this._ymin = bounds.y3;\r\n this._ymax = bounds.y4;\r\n }\r\n }\r\n\r\n return {\r\n xmin: [\"X_min\", \"Units\", this._xmin],\r\n delx: [\"ΔX Step\", \"Units\", this._delx],\r\n xmax: [\"X_max\", \"Units\", this._xmax],\r\n ymin: [\"Y_min\", \"Units\", this._ymin],\r\n ymax: [\"Y_max\", \"Units\", this._ymax],\r\n lineWidth: [\"Line width\", \"Px\", this._lineWidth]\r\n };\r\n }\r\n\r\n setParams(params) {\r\n this._xmin = parseFloat(params.xmin);\r\n this._delx = parseFloat(params.delx);\r\n this._xmax = parseFloat(params.xmax);\r\n this._ymin = parseFloat(params.ymin);\r\n this._ymax = parseFloat(params.ymax);\r\n this._lineWidth = parseFloat(params.lineWidth);\r\n }\r\n\r\n getParams() {\r\n return {\r\n xmin: this._xmin,\r\n delx: this._delx,\r\n xmax: this._xmax,\r\n ymin: this._ymin,\r\n ymax: this._ymax,\r\n lineWidth: this._lineWidth\r\n };\r\n }\r\n\r\n serialize() {\r\n return this._wasRun ? {\r\n algoType: \"AveragingWindowWithStepSizeAlgo\",\r\n xmin: this._xmin,\r\n delx: this._delx,\r\n xmax: this._xmax,\r\n ymin: this._ymin,\r\n ymax: this._ymax,\r\n lineWidth: this._lineWidth\r\n } :\r\n null;\r\n }\r\n\r\n deserialize(obj) {\r\n this._xmin = obj.xmin;\r\n this._delx = obj.delx;\r\n this._xmax = obj.xmax;\r\n this._ymin = obj.ymin;\r\n this._ymax = obj.ymax;\r\n this._lineWidth = obj.lineWidth;\r\n this._wasRun = true;\r\n }\r\n\r\n run(autoDetector, dataSeries, axes) {\r\n this._wasRun = true;\r\n var pointsPicked = 0,\r\n dw = autoDetector.imageWidth,\r\n dh = autoDetector.imageHeight,\r\n blobx = [],\r\n bloby = [],\r\n xi, xmin_pix, xmax_pix, ymin_pix, ymax_pix, dpix,\r\n r_unit_per_pix, step_pix, blobActive, blobEntry, blobExit, blobExitLocked, ii, yi,\r\n mean_ii, mean_yi, pdata;\r\n\r\n dataSeries.clearAll();\r\n\r\n for (xi = this._xmin; xi <= this._xmax; xi += this._delx) {\r\n step_pix = 1;\r\n\r\n pdata = axes.dataToPixel(xi, this._ymin);\r\n xmin_pix = pdata.x;\r\n ymin_pix = pdata.y;\r\n\r\n pdata = axes.dataToPixel(xi, this._ymax);\r\n xmax_pix = pdata.x;\r\n ymax_pix = pdata.y;\r\n\r\n dpix = Math.sqrt((ymax_pix - ymin_pix) * (ymax_pix - ymin_pix) +\r\n (xmax_pix - xmin_pix) * (xmax_pix - xmin_pix));\r\n r_unit_per_pix = (this._ymax - this._ymin) / dpix;\r\n\r\n blobActive = false;\r\n blobEntry = 0;\r\n blobExit = 0;\r\n // To account for noise or if actual thickness is less than specified thickness.\r\n // This flag helps to set blobExit at the end of the thin part or account for noise.\r\n blobExitLocked = false;\r\n\r\n for (ii = 0; ii <= dpix; ii++) {\r\n yi = -ii * step_pix * r_unit_per_pix + this._ymax;\r\n pdata = axes.dataToPixel(xi, yi);\r\n let xi_pix = pdata.x;\r\n let yi_pix = pdata.y;\r\n\r\n if (xi_pix >= 0 && xi_pix < dw && yi_pix >= 0 && yi_pix < dh) {\r\n if (autoDetector.binaryData.has(parseInt(yi_pix, 10) * dw +\r\n parseInt(xi_pix, 10))) {\r\n if (blobActive === false) {\r\n blobEntry = ii;\r\n blobExit = blobEntry;\r\n blobActive = true;\r\n blobExitLocked = false;\r\n }\r\n // Resume collection, it was just noise\r\n if (blobExitLocked === true) {\r\n blobExit = ii;\r\n blobExitLocked = false;\r\n }\r\n } else {\r\n\r\n // collection ended before line thickness was hit. It could just be noise\r\n // or it could be the actual end.\r\n if (blobExitLocked === false) {\r\n blobExit = ii;\r\n blobExitLocked = true;\r\n }\r\n }\r\n\r\n if (blobActive === true) {\r\n\r\n if ((ii > blobEntry + this._lineWidth) || (ii == dpix - 1)) {\r\n blobActive = false;\r\n\r\n if (blobEntry > blobExit) {\r\n blobExit = ii;\r\n }\r\n\r\n mean_ii = (blobEntry + blobExit) / 2.0;\r\n mean_yi = -mean_ii * step_pix * r_unit_per_pix + this._ymax;\r\n\r\n pdata = axes.dataToPixel(xi, mean_yi);\r\n dataSeries.addPixel(parseFloat(pdata.x), parseFloat(pdata.y));\r\n pointsPicked = pointsPicked + 1;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.BarValue = class {\r\n\r\n constructor() {\r\n this.npoints = 0;\r\n this.avgValTop = 0;\r\n this.avgValBot = 0;\r\n this.avgX = 0;\r\n }\r\n\r\n append(x, valTop, valBot) {\r\n this.avgX = (this.npoints * this.avgX + x) / (this.npoints + 1.0);\r\n this.avgValTop = (this.npoints * this.avgValTop + valTop) / (this.npoints + 1.0);\r\n this.avgValBot = (this.npoints * this.avgValBot + valBot) / (this.npoints + 1.0);\r\n this.npoints++;\r\n }\r\n\r\n isPointInGroup(x, valTop, valBot, del_x, del_val) {\r\n if (this.npoints === 0) {\r\n return true;\r\n }\r\n if (Math.abs(this.avgX - x) <= del_x && Math.abs(this.avgValTop - valTop) <= del_val &&\r\n Math.abs(this.avgValBot - valBot) <= del_val) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n};\r\n\r\nwpd.BarExtractionAlgo = class {\r\n\r\n constructor() {\r\n this._delX = 30;\r\n this._delVal = 10;\r\n this._wasRun = false;\r\n }\r\n\r\n getParamList(axes) {\r\n var orientationAxes = axes.getOrientation().axes;\r\n if (orientationAxes === 'Y') {\r\n return {\r\n delX: ['ΔX', 'Px', this._delX],\r\n delVal: ['ΔVal', 'Px', this._delVal]\r\n };\r\n } else {\r\n return {\r\n delX: ['ΔY', 'Px', this._delX],\r\n delVal: ['ΔVal', 'Px', this._delVal]\r\n };\r\n }\r\n }\r\n\r\n setParams(params) {\r\n this._delX = parseFloat(params.delX);\r\n this._delVal = parseFloat(params.delVal);\r\n }\r\n\r\n getParams(params) {\r\n return {\r\n delX: this._delX,\r\n delVal: this._delVal\r\n };\r\n }\r\n\r\n serialize() {\r\n return this._wasRun ? {\r\n algoType: \"BarExtractionAlgo\",\r\n delX: this._delX,\r\n delVal: this._delVal\r\n } :\r\n null;\r\n }\r\n\r\n deserialize(obj) {\r\n this._delX = obj.delX;\r\n this._delVal = obj.delVal;\r\n this._wasRun = true;\r\n }\r\n\r\n run(autoDetector, dataSeries, axes) {\r\n this._wasRun = true;\r\n var orientation = axes.getOrientation(),\r\n barValueColl = [],\r\n valTop, valBot, valCount, val,\r\n px, py, width = autoDetector.imageWidth,\r\n height = autoDetector.imageHeight,\r\n pixelAdded,\r\n barValuei, bv, dataVal, pxVal, mkeys, topVal, botVal,\r\n\r\n appendData = function (x, valTop, valBot, delX, delVal) {\r\n pixelAdded = false;\r\n for (barValuei = 0; barValuei < barValueColl.length; barValuei++) {\r\n bv = barValueColl[barValuei];\r\n\r\n if (bv.isPointInGroup(x, valTop, valBot, delX, delVal)) {\r\n bv.append(x, valTop, valBot);\r\n pixelAdded = true;\r\n break;\r\n }\r\n }\r\n if (!pixelAdded) {\r\n bv = new wpd.BarValue();\r\n bv.append(x, valTop, valBot);\r\n barValueColl.push(bv);\r\n }\r\n };\r\n\r\n dataSeries.clearAll();\r\n\r\n // Switch directions based on axes orientation and direction of data along that axes:\r\n // For each direction, look for both top and bottom side of the bar to account for cases\r\n // where some bars are oriented in the increasing direction, while others are in a\r\n // decreasing direction\r\n if (orientation.axes === 'Y') {\r\n for (px = 0; px < width; px++) {\r\n valTop = 0;\r\n valBot = height - 1;\r\n valCount = 0;\r\n\r\n for (py = 0; py < height; py++) {\r\n if (autoDetector.binaryData.has(py * width + px)) {\r\n valTop = py;\r\n valCount++;\r\n break;\r\n }\r\n }\r\n for (py = height - 1; py >= 0; py--) {\r\n if (autoDetector.binaryData.has(py * width + px)) {\r\n valBot = py;\r\n valCount++;\r\n break;\r\n }\r\n }\r\n if (valCount === 2) { // found both top and bottom ends\r\n appendData(px, valTop, valBot, this._delX, this._delVal);\r\n }\r\n }\r\n } else {\r\n for (py = 0; py < height; py++) {\r\n valTop = width - 1;\r\n valBot = 0;\r\n valCount = 0;\r\n\r\n for (px = width - 1; px >= 0; px--) {\r\n if (autoDetector.binaryData.has(py * width + px)) {\r\n valTop = px;\r\n valCount++;\r\n break;\r\n }\r\n }\r\n for (px = 0; px < width; px++) {\r\n if (autoDetector.binaryData.has(py * width + px)) {\r\n valBot = px;\r\n valCount++;\r\n break;\r\n }\r\n }\r\n if (valCount === 2) {\r\n appendData(py, valTop, valBot, this._delX, this._delVal);\r\n }\r\n }\r\n }\r\n\r\n if (axes.dataPointsHaveLabels) {\r\n mkeys = dataSeries.getMetadataKeys();\r\n if (mkeys == null || mkeys[0] !== 'label') {\r\n dataSeries.setMetadataKeys(['label']);\r\n }\r\n }\r\n\r\n for (barValuei = 0; barValuei < barValueColl.length; barValuei++) {\r\n\r\n bv = barValueColl[barValuei];\r\n\r\n if (orientation.axes === 'Y') {\r\n valTop = axes.pixelToData(bv.avgX, bv.avgValTop)[0];\r\n valBot = axes.pixelToData(bv.avgX, bv.avgValBot)[0];\r\n } else {\r\n valTop = axes.pixelToData(bv.avgValTop, bv.avgX)[0];\r\n valBot = axes.pixelToData(bv.avgValBot, bv.avgX)[0];\r\n }\r\n\r\n if (valTop + valBot < 0) {\r\n val = orientation.direction === 'increasing' ? bv.avgValBot : bv.avgValTop;\r\n } else {\r\n val = orientation.direction === 'increasing' ? bv.avgValTop : bv.avgValBot;\r\n }\r\n\r\n if (axes.dataPointsHaveLabels) {\r\n\r\n if (orientation.axes === 'Y') {\r\n dataSeries.addPixel(bv.avgX + 0.5, val + 0.5, {\r\n \"label\": \"Bar\" + barValuei\r\n });\r\n } else {\r\n dataSeries.addPixel(val + 0.5, bv.avgX + 0.5, {\r\n \"label\": \"Bar\" + barValuei\r\n });\r\n }\r\n\r\n } else {\r\n\r\n if (orientation.axes === 'Y') {\r\n dataSeries.addPixel(bv.avgX + 0.5, val + 0.5);\r\n } else {\r\n dataSeries.addPixel(val + 0.5, bv.avgX + 0.5);\r\n }\r\n }\r\n }\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.BlobDetectorAlgo = class {\r\n\r\n constructor() {\r\n this._minDia = 0;\r\n this._maxDia = 5000;\r\n this._wasRun = false;\r\n }\r\n\r\n getParamList(axes) {\r\n if (axes != null && axes instanceof wpd.MapAxes) {\r\n return {\r\n minDia: ['Min Diameter', 'Units', this._minDia],\r\n maxDia: ['Max Diameter', 'Units', this._maxDia]\r\n };\r\n }\r\n return {\r\n minDia: ['Min Diameter', 'Px', this._minDia],\r\n maxDia: ['Max Diameter', 'Px', this._maxDia]\r\n };\r\n }\r\n\r\n serialize() {\r\n return this._wasRun ? {\r\n algoType: \"BlobDetectorAlgo\",\r\n minDia: this._minDia,\r\n maxDia: this._maxDia\r\n } :\r\n null;\r\n }\r\n\r\n deserialize(obj) {\r\n this._minDia = obj.minDia;\r\n this._maxDia = obj.maxDia;\r\n this._wasRun = true;\r\n }\r\n\r\n setParams(params) {\r\n this._minDia = parseFloat(params.minDia);\r\n this._maxDia = parseFloat(params.maxDia);\r\n }\r\n\r\n getParams() {\r\n return {\r\n minDia: this._minDia,\r\n maxDia: this._maxDia\r\n };\r\n }\r\n\r\n run(autoDetector, dataSeries, axes) {\r\n this._wasRun = true;\r\n var dw = autoDetector.imageWidth,\r\n dh = autoDetector.imageHeight,\r\n pixelVisited = [],\r\n blobCount = 0,\r\n blobs = [],\r\n xi, yi, blobPtIndex, bIndex, nxi, nyi, bxi, byi, pcount, dia;\r\n\r\n if (dw <= 0 || dh <= 0 || autoDetector.binaryData == null ||\r\n autoDetector.binaryData.size === 0) {\r\n return;\r\n }\r\n\r\n dataSeries.clearAll();\r\n dataSeries.setMetadataKeys([\"area\", \"moment\"]);\r\n\r\n for (xi = 0; xi < dw; xi++) {\r\n for (yi = 0; yi < dh; yi++) {\r\n if (autoDetector.binaryData.has(yi * dw + xi) &&\r\n !(pixelVisited[yi * dw + xi] === true)) {\r\n\r\n pixelVisited[yi * dw + xi] = true;\r\n\r\n bIndex = blobs.length;\r\n\r\n blobs[bIndex] = {\r\n pixels: [{\r\n x: xi,\r\n y: yi\r\n }],\r\n centroid: {\r\n x: xi,\r\n y: yi\r\n },\r\n area: 1.0,\r\n moment: 0.0\r\n };\r\n\r\n blobPtIndex = 0;\r\n while (blobPtIndex < blobs[bIndex].pixels.length) {\r\n bxi = blobs[bIndex].pixels[blobPtIndex].x;\r\n byi = blobs[bIndex].pixels[blobPtIndex].y;\r\n\r\n for (nxi = bxi - 1; nxi <= bxi + 1; nxi++) {\r\n for (nyi = byi - 1; nyi <= byi + 1; nyi++) {\r\n if (nxi >= 0 && nyi >= 0 && nxi < dw && nyi < dh) {\r\n if (!(pixelVisited[nyi * dw + nxi] === true) &&\r\n autoDetector.binaryData.has(nyi * dw + nxi)) {\r\n\r\n pixelVisited[nyi * dw + nxi] = true;\r\n\r\n pcount = blobs[bIndex].pixels.length;\r\n\r\n blobs[bIndex].pixels[pcount] = {\r\n x: nxi,\r\n y: nyi\r\n };\r\n\r\n blobs[bIndex].centroid.x =\r\n (blobs[bIndex].centroid.x * pcount + nxi) /\r\n (pcount + 1.0);\r\n blobs[bIndex].centroid.y =\r\n (blobs[bIndex].centroid.y * pcount + nyi) /\r\n (pcount + 1.0);\r\n blobs[bIndex].area = blobs[bIndex].area + 1.0;\r\n }\r\n }\r\n }\r\n }\r\n blobPtIndex = blobPtIndex + 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (bIndex = 0; bIndex < blobs.length; bIndex++) {\r\n blobs[bIndex].moment = 0;\r\n for (blobPtIndex = 0; blobPtIndex < blobs[bIndex].pixels.length; blobPtIndex++) {\r\n blobs[bIndex].moment =\r\n blobs[bIndex].moment +\r\n (blobs[bIndex].pixels[blobPtIndex].x - blobs[bIndex].centroid.x) *\r\n (blobs[bIndex].pixels[blobPtIndex].x - blobs[bIndex].centroid.x) +\r\n (blobs[bIndex].pixels[blobPtIndex].y - blobs[bIndex].centroid.y) *\r\n (blobs[bIndex].pixels[blobPtIndex].y - blobs[bIndex].centroid.y);\r\n }\r\n if (axes instanceof wpd.MapAxes) {\r\n blobs[bIndex].area = plotData.axes.pixelToDataArea(blobs[bIndex].area);\r\n }\r\n\r\n dia = 2.0 * Math.sqrt(blobs[bIndex].area / Math.PI);\r\n if (dia <= this._maxDia && dia >= this._minDia) {\r\n // add 0.5 pixel offset to shift to the center of the pixels.\r\n dataSeries.addPixel(blobs[bIndex].centroid.x + 0.5, blobs[bIndex].centroid.y + 0.5, {\r\n \"area\": blobs[bIndex].area,\r\n \"moment\": blobs[bIndex].moment\r\n });\r\n }\r\n }\r\n }\r\n}/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\n// Simple curve extraction with interpolation, but at user provided independents (x, theta etc.)\r\nwpd.CustomIndependents = class {\r\n constructor() {\r\n this._xvals = [];\r\n this._ymin = 0;\r\n this._ymax = 0;\r\n this._curveWidth = 5;\r\n this._wasRun = false;\r\n }\r\n\r\n deserialize(obj) {\r\n this._xvals = obj.xvals;\r\n this._ymin = obj.ymin;\r\n this._ymax = obj.ymax;\r\n this._curveWidth = obj.curveWidth;\r\n this._wasRun = true;\r\n }\r\n\r\n setParams(params) {\r\n this._xvals = params.xvals;\r\n this._ymin = parseFloat(params.ymin);\r\n this._ymax = parseFloat(params.ymax);\r\n this._curveWidth = parseFloat(params.curveWidth);\r\n }\r\n\r\n getParams() {\r\n return {\r\n xvals: this._xvals,\r\n ymin: this._ymin,\r\n ymax: this._ymax,\r\n curveWidth: this._curveWidth\r\n };\r\n }\r\n\r\n getParamList(axes) {\r\n if (!this._wasRun) {\r\n if (axes != null && axes instanceof wpd.XYAxes) {\r\n let bounds = axes.getBounds();\r\n this._xvals = \"[\" + bounds.x1 + \", \" + bounds.x2 + \"]\";\r\n this._ymin = bounds.y3;\r\n this._ymax = bounds.y4;\r\n this._curveWidth = 5;\r\n }\r\n }\r\n return {\r\n xvals: [\"X Values\", \"Array\", this._xvals],\r\n ymin: [\"Y min\", \"Units\", this._ymin],\r\n ymax: [\"Y max\", \"Units\", this._ymax],\r\n curveWidth: [\"Curve Width\", \"Px\", this._curveWidth]\r\n };\r\n }\r\n\r\n serialize() {\r\n return this._wasRun ? {\r\n algoType: \"CustomIndependents\",\r\n xvals: this._xvals,\r\n ymin: this._ymin,\r\n ymax: this._ymax,\r\n curveWidth: this._curveWidth\r\n } : null;\r\n }\r\n\r\n run(autoDetector, dataSeries, axes) {\r\n this._wasRun = true;\r\n dataSeries.clearAll();\r\n\r\n let inputParser = new wpd.InputParser();\r\n let parsedVals = inputParser.parse(this._xvals);\r\n if (parsedVals == null || !inputParser.isArray) {\r\n return;\r\n }\r\n let isLogX = axes.isLogX();\r\n let isLogY = axes.isLogY();\r\n let isLogXNegative = axes.isLogXNegative();\r\n let isLogYNegative = axes.isLogYNegative();\r\n let logXFactor = isLogXNegative ? -1.0 : 1.0;\r\n let logYFactor = isLogYNegative ? -1.0 : 1.0;\r\n if (isLogXNegative) {\r\n parsedVals.sort((a, b) => {\r\n return b - a;\r\n });\r\n } else {\r\n parsedVals.sort((a, b) => {\r\n return a - b;\r\n });\r\n }\r\n let xmin = parsedVals[0];\r\n let xmax = parsedVals[parsedVals.length - 1];\r\n let ymin = this._ymin;\r\n let ymax = this._ymax;\r\n\r\n let scaled_xmin = xmin;\r\n let scaled_xmax = xmax;\r\n let scaled_ymin = ymin;\r\n let scaled_ymax = ymax;\r\n\r\n if (isLogX) {\r\n scaled_xmin = Math.log10(logXFactor * scaled_xmin);\r\n scaled_xmax = Math.log10(logXFactor * scaled_xmax);\r\n }\r\n if (isLogY) {\r\n scaled_ymin = Math.log10(logYFactor * scaled_ymin);\r\n scaled_ymax = Math.log10(logYFactor * scaled_ymax);\r\n }\r\n\r\n // pixel distance between xmin and xmax, ymin and ymax:\r\n let xmin_ymin_px = axes.dataToPixel(xmin, this._ymin);\r\n let xmax_ymin_px = axes.dataToPixel(xmax, this._ymin);\r\n let xmin_ymax_px = axes.dataToPixel(xmin, this._ymax);\r\n let distX = Math.sqrt((xmin_ymin_px.x - xmax_ymin_px.x) * (xmin_ymin_px.x - xmax_ymin_px.x) + (xmin_ymin_px.y - xmax_ymin_px.y) * (xmin_ymin_px.y - xmax_ymin_px.y));\r\n let distY = Math.sqrt((xmin_ymin_px.x - xmin_ymax_px.x) * (xmin_ymin_px.x - xmin_ymax_px.x) + (xmin_ymin_px.y - xmin_ymax_px.y) * (xmin_ymin_px.y - xmin_ymax_px.y));\r\n\r\n // change in axes units per pixel:\r\n let delX = (scaled_xmax - scaled_xmin) / distX;\r\n let delY = (scaled_ymax - scaled_ymin) / distY;\r\n\r\n let imageWidth = autoDetector.imageWidth;\r\n let imageHeight = autoDetector.imageHeight;\r\n let xpoints = [];\r\n let ypoints = [];\r\n\r\n let overflowPixels = this._curveWidth > 2.0 ? this._curveWidth : 2.0;\r\n for (let xi = scaled_xmin - overflowPixels * delX; xi <= scaled_xmax + overflowPixels * delX; xi += delX) {\r\n let mean_yi = 0;\r\n let y_count = 0;\r\n let yi = delY > 0 ? scaled_ymin : scaled_ymax;\r\n while ((delY > 0 && yi <= scaled_ymax) || (delY < 0 && yi <= scaled_ymin)) {\r\n let px = axes.dataToPixel(isLogX ? (logXFactor * Math.pow(10, xi)) : xi, isLogY ? (logYFactor * Math.pow(10, yi)) : yi);\r\n if (px.x >= 0 && px.y >= 0 && px.x < imageWidth && px.y < imageHeight) {\r\n if (autoDetector.binaryData.has(parseInt(px.y, 10) * imageWidth +\r\n parseInt(px.x, 10))) {\r\n mean_yi += yi;\r\n y_count++;\r\n }\r\n }\r\n yi += Math.abs(delY);\r\n }\r\n\r\n if (y_count > 0) {\r\n mean_yi /= y_count;\r\n xpoints.push(parseFloat(xi));\r\n ypoints.push(parseFloat(mean_yi));\r\n }\r\n }\r\n\r\n if (xpoints.length <= 0 || ypoints.length <= 0) {\r\n return;\r\n }\r\n\r\n let xpointsMean = [];\r\n let ypointsMean = [];\r\n if (this._curveWidth > 0) {\r\n let stepSize = parseInt(this._curveWidth / 2, 10);\r\n if (stepSize < 1) {\r\n stepSize = 1;\r\n }\r\n for (let ptIdx = 0; ptIdx < xpoints.length; ptIdx += stepSize) {\r\n let meanX = 0;\r\n let meanY = 0;\r\n let neighborCount = 0;\r\n let currPx = axes.dataToPixel(isLogX ? logXFactor * Math.pow(10, xpoints[ptIdx]) : xpoints[ptIdx], isLogY ? logYFactor * Math.pow(10, ypoints[ptIdx]) : ypoints[ptIdx]);\r\n for (let nIdx = 0; nIdx < xpoints.length; nIdx++) {\r\n let nPx = axes.dataToPixel(isLogX ? logXFactor * Math.pow(10, xpoints[nIdx]) : xpoints[nIdx], isLogY ? logYFactor * Math.pow(10, ypoints[nIdx]) : ypoints[nIdx]);\r\n if (Math.abs(currPx.x - nPx.x) < this._curveWidth && Math.abs(currPx.y - nPx.y) < this._curveWidth) {\r\n meanX += xpoints[nIdx];\r\n meanY += ypoints[nIdx];\r\n neighborCount++;\r\n }\r\n }\r\n meanX /= neighborCount;\r\n meanY /= neighborCount;\r\n xpointsMean.push(meanX);\r\n ypointsMean.push(meanY);\r\n }\r\n } else {\r\n xpointsMean = xpoints;\r\n ypointsMean = ypoints;\r\n }\r\n\r\n // Cubic spline\r\n let cs = wpd.cspline(xpointsMean, ypointsMean);\r\n if (cs == null) {\r\n return;\r\n }\r\n\r\n for (let ptIdx = 0; ptIdx < parsedVals.length; ptIdx++) {\r\n if (isNaN(parsedVals[ptIdx])) {\r\n continue;\r\n }\r\n\r\n let yinterp = wpd.cspline_interp(cs, isLogX ? Math.log10(logXFactor * parsedVals[ptIdx]) : parsedVals[ptIdx]);\r\n if (yinterp == null) {\r\n continue;\r\n }\r\n\r\n let px = axes.dataToPixel(parsedVals[ptIdx], isLogY ? logYFactor * Math.pow(10, yinterp) : yinterp);\r\n dataSeries.addPixel(px.x, px.y);\r\n }\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.XStepWithInterpolationAlgo = class {\r\n constructor() {\r\n this._xmin = 0;\r\n this._xmax = 1;\r\n this._delx = 0.1;\r\n this._smoothing = 0;\r\n this._ymin = 0;\r\n this._ymax = 0;\r\n this._wasRun = false;\r\n }\r\n\r\n getParamList(axes) {\r\n if (!this._wasRun) {\r\n if (axes != null && axes instanceof wpd.XYAxes) {\r\n let bounds = axes.getBounds();\r\n this._xmin = bounds.x1;\r\n this._xmax = bounds.x2;\r\n this._delx = (bounds.x2 - bounds.x1) / 50.0;\r\n this._ymin = bounds.y3;\r\n this._ymax = bounds.y4;\r\n this._smoothing = 0;\r\n }\r\n }\r\n return {\r\n xmin: [\"X_min\", \"Units\", this._xmin],\r\n delx: [\"ΔX Step\", \"Units\", this._delx],\r\n xmax: [\"X_max\", \"Units\", this._xmax],\r\n ymin: [\"Y_min\", \"Units\", this._ymin],\r\n ymax: [\"Y_max\", \"Units\", this._ymax],\r\n smoothing: [\"Smoothing\", \"% of ΔX\", this._smoothing]\r\n };\r\n }\r\n\r\n setParams(params) {\r\n this._xmin = parseFloat(params.xmin);\r\n this._delx = parseFloat(params.delx);\r\n this._xmax = parseFloat(params.xmax);\r\n this._ymin = parseFloat(params.ymin);\r\n this._ymax = parseFloat(params.ymax);\r\n this._smoothing = parseFloat(params.smoothing);\r\n }\r\n\r\n getParams() {\r\n return {\r\n xmin: this._xmin,\r\n delx: this._delx,\r\n xmax: this._xmax,\r\n ymin: this._ymin,\r\n ymax: this._ymax,\r\n smoothing: this._smoothing\r\n };\r\n }\r\n\r\n serialize() {\r\n return this._wasRun ? {\r\n algoType: \"XStepWithInterpolationAlgo\",\r\n xmin: this._xmin,\r\n delx: this._delx,\r\n xmax: this._xmax,\r\n ymin: this._ymin,\r\n ymax: this._ymax,\r\n smoothing: this._smoothing\r\n } :\r\n null;\r\n }\r\n\r\n deserialize(obj) {\r\n this._xmin = obj.xmin;\r\n this._delx = obj.delx;\r\n this._xmax = obj.xmax;\r\n this._ymin = obj.ymin;\r\n this._ymax = obj.ymax;\r\n this._smoothing = obj.smoothing;\r\n this._wasRun = true;\r\n }\r\n\r\n run(autoDetector, dataSeries, axes) {\r\n this._wasRun = true;\r\n var pointsPicked = 0,\r\n dw = autoDetector.imageWidth,\r\n dh = autoDetector.imageHeight,\r\n xi,\r\n dist_y_px, dist_x_px, ii, yi, jj, mean_yi, y_count, pdata, pdata0, pdata1, xpoints = [],\r\n ypoints = [],\r\n xpoints_mean = [],\r\n ypoints_mean = [],\r\n mean_x, mean_y, delx, dely, xinterp,\r\n yinterp, param_width = Math.abs(this._delx * (this._smoothing / 100.0)),\r\n cs,\r\n isLogX = axes.isLogX(),\r\n isLogY = axes.isLogY(),\r\n isLogXNegative = axes.isLogXNegative(),\r\n isLogYNegative = axes.isLogYNegative(),\r\n logXFactor = isLogXNegative ? -1.0 : 1.0,\r\n logYFactor = isLogYNegative ? -1.0 : 1.0,\r\n isDateX = axes.isDate(0),\r\n isDateY = axes.isDate(1),\r\n scaled_param_xmin = this._xmin,\r\n scaled_param_xmax = this._xmax,\r\n scaled_param_ymin = this._ymin,\r\n scaled_param_ymax = this._ymax,\r\n scaled_param_width = param_width,\r\n scaled_param_delx = this._delx;\r\n\r\n dataSeries.clearAll();\r\n\r\n if (isLogX) {\r\n scaled_param_xmax = Math.log10(logXFactor * scaled_param_xmax);\r\n scaled_param_xmin = Math.log10(logXFactor * scaled_param_xmin);\r\n scaled_param_width = Math.abs(Math.log10(logXFactor * this._delx) * this._smoothing / 100.0);\r\n scaled_param_delx = logXFactor * Math.log10(logXFactor * scaled_param_delx);\r\n }\r\n if (isLogY) {\r\n scaled_param_ymin = Math.log10(logYFactor * scaled_param_ymin);\r\n scaled_param_ymax = Math.log10(logYFactor * scaled_param_ymax);\r\n }\r\n\r\n // Calculate pixel distance between y_min and y_max:\r\n pdata0 = axes.dataToPixel(this._xmin, this._ymin);\r\n pdata1 = axes.dataToPixel(this._xmin, this._ymax);\r\n dist_y_px = Math.sqrt((pdata0.x - pdata1.x) * (pdata0.x - pdata1.x) +\r\n (pdata0.y - pdata1.y) * (pdata0.y - pdata1.y));\r\n dely = (scaled_param_ymax - scaled_param_ymin) / dist_y_px;\r\n\r\n // Calculate pixel distance between x_min and x_max:\r\n pdata1 = axes.dataToPixel(this._xmax, this._ymin);\r\n dist_x_px = Math.sqrt((pdata0.x - pdata1.x) * (pdata0.x - pdata1.x) +\r\n (pdata0.y - pdata1.y) * (pdata0.y - pdata1.y));\r\n delx = (scaled_param_xmax - scaled_param_xmin) / dist_x_px;\r\n\r\n if (Math.abs(scaled_param_width / delx) > 0 && Math.abs(scaled_param_width / delx) < 1) {\r\n scaled_param_width = delx;\r\n }\r\n\r\n xi = delx > 0 ? scaled_param_xmin - 2 * delx : scaled_param_xmin + 2 * delx;\r\n while ((delx > 0 && xi <= scaled_param_xmax + 2 * delx) ||\r\n (delx < 0 && xi >= scaled_param_xmax - 2 * delx)) {\r\n\r\n mean_yi = 0;\r\n y_count = 0;\r\n yi = scaled_param_ymin;\r\n while ((dely > 0 && yi <= scaled_param_ymax) || (dely < 0 && yi >= scaled_param_ymax)) {\r\n pdata = axes.dataToPixel(isLogX ? logXFactor * Math.pow(10, xi) : xi,\r\n isLogY ? logYFactor * Math.pow(10, yi) : yi);\r\n if (pdata.x >= 0 && pdata.y >= 0 && pdata.x < dw && pdata.y < dh) {\r\n if (autoDetector.binaryData.has(parseInt(pdata.y, 10) * dw +\r\n parseInt(pdata.x, 10))) {\r\n mean_yi = (mean_yi * y_count + yi) / (parseFloat(y_count + 1));\r\n y_count++;\r\n }\r\n }\r\n yi = yi + dely;\r\n }\r\n\r\n if (y_count > 0) {\r\n xpoints[pointsPicked] = parseFloat(xi);\r\n ypoints[pointsPicked] = parseFloat(mean_yi);\r\n pointsPicked = pointsPicked + 1;\r\n }\r\n\r\n xi = xi + delx;\r\n }\r\n\r\n if (xpoints.length <= 0 || ypoints.length <= 0) {\r\n return; // kill if nothing was detected so far.\r\n }\r\n\r\n if (scaled_param_width > 0) {\r\n xpoints_mean = [];\r\n ypoints_mean = [];\r\n\r\n xi = xpoints[0];\r\n while ((delx > 0 && xi <= xpoints[xpoints.length - 1]) ||\r\n (delx < 0 && xi >= xpoints[xpoints.length - 1])) {\r\n mean_x = 0;\r\n mean_y = 0;\r\n y_count = 0;\r\n for (ii = 0; ii < xpoints.length; ii++) {\r\n if (xpoints[ii] <= xi + scaled_param_width &&\r\n xpoints[ii] >= xi - scaled_param_width) {\r\n mean_x = (mean_x * y_count + xpoints[ii]) / parseFloat(y_count + 1);\r\n mean_y = (mean_y * y_count + ypoints[ii]) / parseFloat(y_count + 1);\r\n y_count++;\r\n }\r\n }\r\n\r\n if (y_count > 0) {\r\n xpoints_mean[xpoints_mean.length] = mean_x;\r\n ypoints_mean[ypoints_mean.length] = mean_y;\r\n }\r\n\r\n if (delx > 0) {\r\n xi = xi + param_width;\r\n } else {\r\n xi = xi - param_width;\r\n }\r\n }\r\n\r\n } else {\r\n xpoints_mean = xpoints;\r\n ypoints_mean = ypoints;\r\n }\r\n\r\n if (xpoints_mean.length <= 0 || ypoints_mean.length <= 0) {\r\n return;\r\n }\r\n\r\n xinterp = [];\r\n ii = 0;\r\n xi = scaled_param_xmin;\r\n\r\n if ((delx < 0 && this._delx > 0) || (delx > 0 && this._delx < 0)) {\r\n return;\r\n }\r\n\r\n while ((delx > 0 && xi <= scaled_param_xmax) || (delx < 0 && xi >= scaled_param_xmax)) {\r\n xinterp[ii] = xi;\r\n ii++;\r\n xi = xi + scaled_param_delx;\r\n }\r\n\r\n if (delx < 0) {\r\n xpoints_mean = xpoints_mean.reverse();\r\n ypoints_mean = ypoints_mean.reverse();\r\n }\r\n\r\n // Cubic spline interpolation:\r\n cs = wpd.cspline(xpoints_mean, ypoints_mean);\r\n if (cs != null) {\r\n yinterp = [];\r\n for (ii = 0; ii < xinterp.length; ++ii) {\r\n if (!isNaN(xinterp[ii])) {\r\n yinterp[ii] = wpd.cspline_interp(cs, xinterp[ii]);\r\n if (yinterp[ii] !== null) {\r\n pdata = axes.dataToPixel(isLogX ? logXFactor * Math.pow(10, xinterp[ii]) : xinterp[ii],\r\n isLogY ? logYFactor * Math.pow(10, yinterp[ii]) : yinterp[ii]);\r\n dataSeries.addPixel(pdata.x, pdata.y);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.BarAxes = (function () {\r\n var AxesObj = function () {\r\n // Throughout this code, it is assumed that \"y\" is the continuous axes and \"x\" is\r\n // the discrete axes. In practice, this shouldn't matter even if the orientation\r\n // is different.\r\n var isCalibrated = false,\r\n isLogScale = false,\r\n isRotatedAxes = false,\r\n metadata = {},\r\n x1, y1, x2, y2, p1, p2,\r\n orientation;\r\n\r\n this.isCalibrated = function () {\r\n return isCalibrated;\r\n };\r\n\r\n this.calibration = null;\r\n\r\n this.calibrate = function (calibration, isLog, isRotated) {\r\n this.calibration = calibration;\r\n isCalibrated = false;\r\n var cp1 = calibration.getPoint(0),\r\n cp2 = calibration.getPoint(1);\r\n\r\n x1 = cp1.px;\r\n y1 = cp1.py;\r\n x2 = cp2.px;\r\n y2 = cp2.py;\r\n p1 = parseFloat(cp1.dy);\r\n p2 = parseFloat(cp2.dy);\r\n\r\n if (isLog) {\r\n isLogScale = true;\r\n p1 = Math.log(p1) / Math.log(10);\r\n p2 = Math.log(p2) / Math.log(10);\r\n } else {\r\n isLogScale = false;\r\n }\r\n\r\n orientation = this.calculateOrientation();\r\n isRotatedAxes = isRotated;\r\n\r\n if (!isRotated) {\r\n // ignore rotation and assume axes is precisely vertical or horizontal\r\n if (orientation.axes == 'Y') {\r\n x2 = x1;\r\n } else {\r\n y2 = y1;\r\n }\r\n // recalculate orientation:\r\n orientation = this.calculateOrientation();\r\n }\r\n\r\n isCalibrated = true;\r\n return true;\r\n };\r\n\r\n this.pixelToData = function (pxi, pyi) {\r\n var data = [],\r\n c_c2 = ((pyi - y1) * (y2 - y1) + (x2 - x1) * (pxi - x1)) /\r\n ((y2 - y1) * (y2 - y1) + (x2 - x1) * (x2 - x1));\r\n // We could return X pixel value (or Y, depending on orientation) but that's not very\r\n // useful. For now, just return the bar value. That's it.\r\n data[0] = (p2 - p1) * c_c2 + p1;\r\n if (isLogScale) {\r\n data[0] = Math.pow(10, data[0]);\r\n }\r\n return data;\r\n };\r\n\r\n this.dataToPixel = function (x, y) {\r\n // not implemented yet\r\n return {\r\n x: 0,\r\n y: 0\r\n };\r\n };\r\n\r\n this.pixelToLiveString = function (pxi, pyi) {\r\n var dataVal = this.pixelToData(pxi, pyi);\r\n return dataVal[0].toExponential(4);\r\n };\r\n\r\n this.isLog = function () {\r\n return isLogScale;\r\n };\r\n\r\n this.isRotated = function () {\r\n return isRotatedAxes;\r\n }\r\n\r\n this.dataPointsHaveLabels = true;\r\n\r\n this.dataPointsLabelPrefix = 'Bar';\r\n\r\n this.calculateOrientation = function () { // Used by auto-extract algo to switch orientation.\r\n var orientationAngle = wpd.taninverse(-(y2 - y1), x2 - x1) * 180 / Math.PI,\r\n orientation = {\r\n axes: 'Y',\r\n direction: 'increasing',\r\n angle: orientationAngle\r\n },\r\n tol = 30; // degrees.\r\n\r\n if (Math.abs(orientationAngle - 90) < tol) {\r\n orientation.axes = 'Y';\r\n orientation.direction = 'increasing';\r\n } else if (Math.abs(orientationAngle - 270) < tol) {\r\n orientation.axes = 'Y';\r\n orientation.direction = 'decreasing';\r\n } else if (Math.abs(orientationAngle - 0) < tol ||\r\n Math.abs(orientationAngle - 360) < tol) {\r\n orientation.axes = 'X';\r\n orientation.direction = 'increasing';\r\n } else if (Math.abs(orientationAngle - 180) < tol) {\r\n orientation.axes = 'X';\r\n orientation.direction = 'decreasing';\r\n }\r\n\r\n return orientation;\r\n\r\n };\r\n\r\n this.getOrientation = function () {\r\n return orientation;\r\n };\r\n\r\n this.getMetadata = function () {\r\n // deep clone\r\n return JSON.parse(JSON.stringify(metadata));\r\n };\r\n\r\n this.setMetadata = function (obj) {\r\n // deep clone\r\n metadata = JSON.parse(JSON.stringify(obj));\r\n };\r\n\r\n this.name = \"Bar\";\r\n };\r\n\r\n AxesObj.prototype.numCalibrationPointsRequired = function () {\r\n return 2;\r\n };\r\n\r\n AxesObj.prototype.getDimensions = function () {\r\n return 2;\r\n };\r\n\r\n AxesObj.prototype.getAxesLabels = function () {\r\n return ['Label', 'Y'];\r\n };\r\n\r\n return AxesObj;\r\n})();/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.CircularChartRecorderAxes = class {\r\n isCalibrated() {\r\n return false;\r\n }\r\n\r\n xChart = 0;\r\n yChart = 0;\r\n\r\n xPen = 0;\r\n yPen = 0;\r\n rPen = 0;\r\n rMax = 0;\r\n rMin = 0;\r\n rMinPx = 0;\r\n rMaxPx = 0;\r\n\r\n chartToPenDist = 0;\r\n thetac0 = 0;\r\n thetaStartOffset = 0;\r\n timeFormat = null;\r\n time0 = 0;\r\n timeMax = 0;\r\n tStart = null;\r\n tEnd = null;\r\n rotationDirection = 'anticlockwise';\r\n rotationTime = 'week';\r\n\r\n calibrate(calib, startTimeInput, rotationTime, rotationDirection) {\r\n\r\n let cp0 = calib.getPoint(0);\r\n let cp1 = calib.getPoint(1);\r\n let cp2 = calib.getPoint(2);\r\n let cp3 = calib.getPoint(3);\r\n let cp4 = calib.getPoint(4);\r\n\r\n let ip = new wpd.InputParser();\r\n let t0 = cp0.dx;\r\n this.time0 = ip.parse(t0);\r\n if (ip.isDate) {\r\n this.timeFormat = ip.formatting;\r\n }\r\n let date0 = new Date(this.time0);\r\n this.tStart = ip.parse(startTimeInput);\r\n let dateEnd = new Date(this.tStart);\r\n\r\n if (rotationTime === \"week\") {\r\n this.timeMax = parseFloat(date0.setDate(date0.getDate() + 7));\r\n this.tEnd = parseFloat(dateEnd.setDate(dateEnd.getDate() + 7));\r\n } else if (rotationTime === \"day\") {\r\n this.timeMax = parseFloat(date0.setHours(date0.getHours() + 24));\r\n this.tEnd = parseFloat(dateEnd.setHours(dateEnd.getHours() + 24));\r\n }\r\n\r\n let r0 = cp0.dy;\r\n let r2 = cp2.dy;\r\n\r\n let penArcPts = [\r\n [cp0.px, cp0.py],\r\n [cp1.px, cp1.py],\r\n [cp2.px, cp2.py],\r\n ];\r\n let penCircle = wpd.getCircleFrom3Pts(penArcPts);\r\n\r\n let chartArcPts = [\r\n [cp2.px, cp2.py],\r\n [cp3.px, cp3.py],\r\n [cp4.px, cp4.py],\r\n ];\r\n let chartCircle = wpd.getCircleFrom3Pts(chartArcPts);\r\n\r\n this.thetac0 = wpd.taninverse(penCircle.y0 - chartCircle.y0, penCircle.x0 - chartCircle.x0) * 180.0 / Math.PI;\r\n\r\n // find offset for tStart:\r\n this.thetaStartOffset = 360.0 * (this.tStart - this.time0) / (this.timeMax - this.time0);\r\n\r\n this.xChart = chartCircle.x0;\r\n this.yChart = chartCircle.y0;\r\n this.xPen = penCircle.x0;\r\n this.yPen = penCircle.y0;\r\n this.rPen = penCircle.radius;\r\n this.rMin = r0;\r\n this.rMax = r2;\r\n this.rMinPx = wpd.dist2d(cp0.px, cp0.py, chartCircle.x0, chartCircle.y0);\r\n this.rMaxPx = wpd.dist2d(cp2.px, cp2.py, chartCircle.x0, chartCircle.y0);\r\n this.chartToPenDist = wpd.dist2d(chartCircle.x0, chartCircle.y0, penCircle.x0, penCircle.y0);\r\n this.rotationDirection = rotationDirection;\r\n this.rotationTime = rotationTime;\r\n this.calibration = calib;\r\n\r\n return true;\r\n }\r\n\r\n pixelToData(pxi, pyi) {\r\n let data = [0, 1];\r\n\r\n let rPx = wpd.dist2d(pxi, pyi, this.xChart, this.yChart);\r\n\r\n // calc range\r\n let r = (this.rMax - this.rMin) * (rPx - this.rMinPx) / (this.rMaxPx - this.rMinPx) + this.rMin;\r\n\r\n // calc time angle\r\n let thetap = wpd.taninverse(pyi - this.yChart, pxi - this.xChart);\r\n let alpha = Math.acos((this.chartToPenDist * this.chartToPenDist + rPx * rPx - this.rPen * this.rPen) / (2.0 * this.chartToPenDist * rPx));\r\n let timeVal = 0;\r\n if (this.rotationDirection === 'anticlockwise') {\r\n let thetac = thetap + alpha;\r\n let thetacDeg = wpd.normalizeAngleDeg(thetac * 180.0 / Math.PI);\r\n timeVal = (this.tEnd - this.tStart) * (wpd.normalizeAngleDeg(thetacDeg - this.thetac0 - this.thetaStartOffset)) / 360.0 + this.tStart;\r\n } else if (this.rotationDirection === 'clockwise') {\r\n let thetac = thetap - alpha;\r\n let thetacDeg = wpd.normalizeAngleDeg(thetac * 180.0 / Math.PI);\r\n timeVal = (this.tEnd - this.tStart) * (wpd.normalizeAngleDeg(-(thetacDeg - this.thetac0) - this.thetaStartOffset)) / 360.0 + this.tStart;\r\n }\r\n data[0] = timeVal;\r\n data[1] = r;\r\n\r\n return data;\r\n }\r\n\r\n dataToPixel(t, r) {\r\n // calc thetac\r\n\r\n // calc range\r\n\r\n // calc coords\r\n\r\n return {\r\n \"x\": 0,\r\n \"y\": 0\r\n };\r\n }\r\n\r\n pixelToLiveString(pxi, pyi) {\r\n let dataVal = this.pixelToData(pxi, pyi);\r\n if (this.timeFormat == null) {\r\n return \"calibration error!\";\r\n }\r\n let timeStr = wpd.dateConverter.formatDateNumber(dataVal[0], this.timeFormat);\r\n return timeStr + ', ' + dataVal[1].toExponential(4);\r\n }\r\n\r\n name = \"Circular Chart\";\r\n calibration = null;\r\n _metadata = {};\r\n\r\n getStartTime() {\r\n if (this.timeFormat == null || this.tStart == null) {\r\n return null;\r\n }\r\n return wpd.dateConverter.formatDateNumber(this.tStart, this.timeFormat);\r\n }\r\n\r\n getRotationTime() {\r\n return this.rotationTime;\r\n }\r\n\r\n getRotationDirection() {\r\n return this.rotationDirection;\r\n }\r\n\r\n getTimeFormat() {\r\n return this.timeFormat;\r\n }\r\n\r\n getInitialDateFormat(col) {\r\n if (col == 0) {\r\n return this.timeFormat;\r\n }\r\n return null;\r\n }\r\n\r\n isDate(col) {\r\n return (col === 0) ? true : false;\r\n }\r\n\r\n getMetadata() {\r\n // deep clone\r\n return JSON.parse(JSON.stringify(this._metadata));\r\n };\r\n\r\n setMetadata(obj) {\r\n // deep clone\r\n this._metadata = JSON.parse(JSON.stringify(obj));\r\n };\r\n\r\n numCalibrationPointsRequired() {\r\n return 5;\r\n }\r\n\r\n getDimensions() {\r\n return 2;\r\n }\r\n\r\n getAxesLabels() {\r\n return ['Time', 'Magnitude'];\r\n }\r\n};/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.ImageAxes = (function () {\r\n var AxesObj = function () {\r\n let metadata = {};\r\n\r\n this.isCalibrated = function () {\r\n return true;\r\n };\r\n\r\n this.calibrate = function () {\r\n return true;\r\n };\r\n\r\n this.pixelToData = function (pxi, pyi) {\r\n var data = [pxi, pyi];\r\n return data;\r\n };\r\n\r\n this.dataToPixel = function (x, y) {\r\n return {\r\n x: x,\r\n y: y\r\n };\r\n };\r\n\r\n this.pixelToLiveString = function (pxi, pyi) {\r\n var dataVal = this.pixelToData(pxi, pyi);\r\n return dataVal[0].toFixed(2) + ', ' + dataVal[1].toFixed(2);\r\n };\r\n\r\n this.getMetadata = function () {\r\n // deep clone\r\n return JSON.parse(JSON.stringify(metadata));\r\n };\r\n\r\n this.setMetadata = function (obj) {\r\n // deep clone\r\n metadata = JSON.parse(JSON.stringify(obj));\r\n };\r\n\r\n this.name = \"Image\";\r\n };\r\n\r\n AxesObj.prototype.numCalibrationPointsRequired = function () {\r\n return 0;\r\n };\r\n\r\n AxesObj.prototype.getDimensions = function () {\r\n return 2;\r\n };\r\n\r\n AxesObj.prototype.getAxesLabels = function () {\r\n return ['X', 'Y'];\r\n };\r\n\r\n return AxesObj;\r\n})();/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.MapAxes = (function () {\r\n var AxesObj = function () {\r\n var isCalibrated = false,\r\n\r\n metadata = {},\r\n\r\n scaleLength, scaleUnits, dist, originLocation, imageHeight,\r\n\r\n processCalibration = function (cal, scale_length, scale_units, origin_location, image_height) {\r\n var cp0 = cal.getPoint(0),\r\n cp1 = cal.getPoint(1);\r\n dist = Math.sqrt((cp0.px - cp1.px) * (cp0.px - cp1.px) +\r\n (cp0.py - cp1.py) * (cp0.py - cp1.py));\r\n scaleLength = parseFloat(scale_length);\r\n scaleUnits = scale_units;\r\n originLocation = origin_location != null ? origin_location : \"top-left\";\r\n imageHeight = parseFloat(image_height);\r\n return true;\r\n };\r\n\r\n this.calibration = null;\r\n\r\n this.isCalibrated = function () {\r\n return isCalibrated;\r\n };\r\n\r\n this.calibrate = function (calib, scale_length, scale_units, origin_location, image_height) {\r\n this.calibration = calib;\r\n isCalibrated = processCalibration(calib, scale_length, scale_units, origin_location, image_height);\r\n return isCalibrated;\r\n };\r\n\r\n this.pixelToData = function (pxi, pyi) {\r\n var data = [];\r\n data[0] = pxi * scaleLength / dist;\r\n if (originLocation === \"top-left\") {\r\n data[1] = pyi * scaleLength / dist;\r\n } else if (originLocation === \"bottom-left\") {\r\n data[1] = (imageHeight - pyi - 1) * scaleLength / dist;\r\n }\r\n return data;\r\n };\r\n\r\n this.pixelToDataDistance = function (distancePx) {\r\n return distancePx * scaleLength / dist;\r\n };\r\n\r\n this.pixelToDataArea = function (\r\n areaPx) {\r\n return areaPx * scaleLength * scaleLength / (dist * dist);\r\n };\r\n\r\n this.dataToPixel = function (a, b, c) {\r\n return {\r\n x: 0,\r\n y: 0\r\n };\r\n };\r\n\r\n this.pixelToLiveString = function (pxi, pyi) {\r\n var dataVal = this.pixelToData(pxi, pyi);\r\n return dataVal[0].toExponential(4) + ', ' + dataVal[1].toExponential(4);\r\n };\r\n\r\n this.getScaleLength = function () {\r\n return scaleLength;\r\n };\r\n\r\n this.getUnits = function () {\r\n return scaleUnits;\r\n };\r\n\r\n this.getOriginLocation = function () {\r\n return originLocation;\r\n };\r\n\r\n this.getImageHeight = function () {\r\n return imageHeight;\r\n };\r\n\r\n this.getMetadata = function () {\r\n // deep clone\r\n return JSON.parse(JSON.stringify(metadata));\r\n };\r\n\r\n this.setMetadata = function (obj) {\r\n // deep clone\r\n metadata = JSON.parse(JSON.stringify(obj));\r\n };\r\n\r\n this.name = \"Map\";\r\n };\r\n\r\n AxesObj.prototype.numCalibrationPointsRequired = function () {\r\n return 2;\r\n };\r\n\r\n AxesObj.prototype.getDimensions = function () {\r\n return 2;\r\n };\r\n\r\n AxesObj.prototype.getAxesLabels = function () {\r\n return ['X', 'Y'];\r\n };\r\n\r\n return AxesObj;\r\n})();/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.PolarAxes = (function () {\r\n var AxesObj = function () {\r\n var isCalibrated = false,\r\n isDegrees = false,\r\n isClockwise = false,\r\n isLog = false,\r\n\r\n metadata = {},\r\n\r\n x0, y0, x1, y1, x2, y2, r1, theta1, r2, theta2, dist10, dist20, dist12, phi0, alpha0;\r\n\r\n let processCalibration = function (cal, is_degrees, is_clockwise, is_log_r) {\r\n var cp0 = cal.getPoint(0),\r\n cp1 = cal.getPoint(1),\r\n cp2 = cal.getPoint(2);\r\n x0 = cp0.px;\r\n y0 = cp0.py;\r\n x1 = cp1.px;\r\n y1 = cp1.py;\r\n x2 = cp2.px;\r\n y2 = cp2.py;\r\n\r\n r1 = cp1.dx;\r\n theta1 = cp1.dy;\r\n\r\n r2 = cp2.dx;\r\n theta2 = cp2.dy;\r\n\r\n isDegrees = is_degrees;\r\n isClockwise = is_clockwise;\r\n\r\n if (isDegrees === true) { // if degrees\r\n theta1 = (Math.PI / 180.0) * theta1;\r\n theta2 = (Math.PI / 180.0) * theta2;\r\n }\r\n\r\n if (is_log_r) {\r\n isLog = true;\r\n r1 = Math.log(r1) / Math.log(10);\r\n r2 = Math.log(r2) / Math.log(10);\r\n }\r\n\r\n // Distance between 1 and 0.\r\n dist10 = Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));\r\n\r\n // Distance between 2 and 0\r\n dist20 = Math.sqrt((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0));\r\n\r\n // Radial Distance between 1 and 2.\r\n dist12 = dist20 - dist10;\r\n\r\n phi0 = wpd.taninverse(-(y1 - y0), x1 - x0);\r\n\r\n if (isClockwise) {\r\n alpha0 = phi0 + theta1;\r\n } else {\r\n alpha0 = phi0 - theta1;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n this.calibration = null;\r\n\r\n this.isCalibrated = function () {\r\n return isCalibrated;\r\n };\r\n\r\n this.calibrate = function (calib, is_degrees, is_clockwise, is_log_r) {\r\n this.calibration = calib;\r\n isCalibrated = processCalibration(calib, is_degrees, is_clockwise, is_log_r);\r\n return isCalibrated;\r\n };\r\n\r\n this.isThetaDegrees = function () {\r\n return isDegrees;\r\n };\r\n\r\n this.isThetaClockwise = function () {\r\n return isClockwise;\r\n };\r\n\r\n this.isRadialLog = function () {\r\n return isLog;\r\n };\r\n\r\n this.pixelToData = function (pxi, pyi) {\r\n var data = [],\r\n rp, thetap;\r\n\r\n let xp = parseFloat(pxi);\r\n let yp = parseFloat(pyi);\r\n\r\n rp = ((r2 - r1) / dist12) *\r\n (Math.sqrt((xp - x0) * (xp - x0) + (yp - y0) * (yp - y0)) - dist10) +\r\n r1;\r\n\r\n if (isClockwise) {\r\n thetap = alpha0 - wpd.taninverse(-(yp - y0), xp - x0);\r\n } else {\r\n thetap = wpd.taninverse(-(yp - y0), xp - x0) - alpha0;\r\n }\r\n\r\n if (thetap < 0) {\r\n thetap = thetap + 2 * Math.PI;\r\n }\r\n\r\n if (isDegrees === true) {\r\n thetap = 180.0 * thetap / Math.PI;\r\n }\r\n\r\n if (isLog) {\r\n rp = Math.pow(10, rp);\r\n }\r\n\r\n data[0] = rp;\r\n data[1] = thetap;\r\n\r\n return data;\r\n };\r\n\r\n this.dataToPixel = function (r, theta) {\r\n return {\r\n x: 0,\r\n y: 0\r\n };\r\n };\r\n\r\n this.pixelToLiveString = function (pxi, pyi) {\r\n var dataVal = this.pixelToData(pxi, pyi);\r\n return dataVal[0].toExponential(4) + ', ' + dataVal[1].toExponential(4);\r\n };\r\n\r\n this.getMetadata = function () {\r\n // deep clone\r\n return JSON.parse(JSON.stringify(metadata));\r\n };\r\n\r\n this.setMetadata = function (obj) {\r\n // deep clone\r\n metadata = JSON.parse(JSON.stringify(obj));\r\n };\r\n\r\n this.name = \"Polar\";\r\n };\r\n\r\n AxesObj.prototype.numCalibrationPointsRequired = function () {\r\n return 3;\r\n };\r\n\r\n AxesObj.prototype.getDimensions = function () {\r\n return 2;\r\n };\r\n\r\n AxesObj.prototype.getAxesLabels = function () {\r\n return ['r', 'θ'];\r\n };\r\n\r\n return AxesObj;\r\n})();/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.TernaryAxes = (function () {\r\n var AxesObj = function () {\r\n var isCalibrated = false,\r\n\r\n metadata = {},\r\n\r\n x0, y0, x1, y1, x2, y2, L, phi0, root3, isRange0to100, isOrientationNormal,\r\n\r\n processCalibration = function (cal, range100, is_normal) {\r\n var cp0 = cal.getPoint(0),\r\n cp1 = cal.getPoint(1),\r\n cp2 = cal.getPoint(2);\r\n\r\n x0 = cp0.px;\r\n y0 = cp0.py;\r\n x1 = cp1.px;\r\n y1 = cp1.py;\r\n x2 = cp2.px;\r\n y2 = cp2.py;\r\n\r\n L = Math.sqrt((x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1));\r\n\r\n phi0 = wpd.taninverse(-(y1 - y0), x1 - x0);\r\n\r\n root3 = Math.sqrt(3);\r\n\r\n isRange0to100 = range100;\r\n\r\n isOrientationNormal = is_normal;\r\n\r\n return true;\r\n };\r\n\r\n this.isCalibrated = function () {\r\n return isCalibrated;\r\n };\r\n\r\n this.calibration = null;\r\n\r\n this.calibrate = function (calib, range100, is_normal) {\r\n this.calibration = calib;\r\n isCalibrated = processCalibration(calib, range100, is_normal);\r\n return isCalibrated;\r\n };\r\n\r\n this.isRange100 = function () {\r\n return isRange0to100;\r\n };\r\n\r\n this.isNormalOrientation = function () {\r\n return isOrientationNormal;\r\n };\r\n\r\n this.pixelToData = function (pxi, pyi) {\r\n var data = [],\r\n rp, thetap, xx, yy, ap, bp, cp, bpt;\r\n\r\n let xp = parseFloat(pxi);\r\n let yp = parseFloat(pyi);\r\n\r\n rp = Math.sqrt((xp - x0) * (xp - x0) + (yp - y0) * (yp - y0));\r\n\r\n thetap = wpd.taninverse(-(yp - y0), xp - x0) - phi0;\r\n\r\n xx = (rp * Math.cos(thetap)) / L;\r\n yy = (rp * Math.sin(thetap)) / L;\r\n\r\n ap = 1.0 - xx - yy / root3;\r\n bp = xx - yy / root3;\r\n cp = 2.0 * yy / root3;\r\n\r\n if (isOrientationNormal == false) {\r\n // reverse axes orientation\r\n bpt = bp;\r\n bp = ap;\r\n ap = cp;\r\n cp = bpt;\r\n }\r\n\r\n if (isRange0to100 == true) {\r\n ap = ap * 100;\r\n bp = bp * 100;\r\n cp = cp * 100;\r\n }\r\n\r\n data[0] = ap;\r\n data[1] = bp;\r\n data[2] = cp;\r\n return data;\r\n };\r\n\r\n this.dataToPixel = function (a, b, c) {\r\n return {\r\n x: 0,\r\n y: 0\r\n };\r\n };\r\n\r\n this.pixelToLiveString = function (pxi, pyi) {\r\n var dataVal = this.pixelToData(pxi, pyi);\r\n return dataVal[0].toExponential(4) + ', ' + dataVal[1].toExponential(4) + ', ' +\r\n dataVal[2].toExponential(4);\r\n };\r\n\r\n this.getMetadata = function () {\r\n // deep clone\r\n return JSON.parse(JSON.stringify(metadata));\r\n };\r\n\r\n this.setMetadata = function (obj) {\r\n // deep clone\r\n metadata = JSON.parse(JSON.stringify(obj));\r\n };\r\n\r\n this.name = \"Ternary\";\r\n };\r\n\r\n AxesObj.prototype.numCalibrationPointsRequired = function () {\r\n return 3;\r\n };\r\n\r\n AxesObj.prototype.getDimensions = function () {\r\n return 3;\r\n };\r\n\r\n AxesObj.prototype.getAxesLabels = function () {\r\n return ['a', 'b', 'c'];\r\n };\r\n\r\n return AxesObj;\r\n})();/*\r\n WebPlotDigitizer - https://automeris.io/WebPlotDigitizer\r\n\r\n Copyright 2010-2024 Ankit Rohatgi \r\n\r\n This file is part of WebPlotDigitizer.\r\n\r\n WebPlotDigitizer is free software: you can redistribute it and/or modify\r\n it under the terms of the GNU Affero General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n WebPlotDigitizer is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU Affero General Public License for more details.\r\n\r\n You should have received a copy of the GNU Affero General Public License\r\n along with WebPlotDigitizer. If not, see .\r\n*/\r\n\r\nvar wpd = wpd || {};\r\n\r\nwpd.XYAxes = (function () {\r\n var AxesObj = function () {\r\n var calibration, isCalibrated = false,\r\n isLogScaleX = false,\r\n isLogScaleY = false,\r\n isLogScaleXNegative = false,\r\n isLogScaleYNegative = false,\r\n\r\n isXDate = false,\r\n isYDate = false,\r\n noRotation = false,\r\n\r\n metadata = {},\r\n\r\n initialFormattingX, initialFormattingY,\r\n\r\n x1, x2, x3, x4, y1, y2, y3, y4, xmin, xmax, ymin, ymax,\r\n a_mat = [0, 0, 0, 0],\r\n a_inv_mat = [0, 0, 0, 0],\r\n c_vec = [0, 0],\r\n\r\n processCalibration = function (cal, isLogX, isLogY, noRotationCorrection) {\r\n if (cal.getCount() < 4) {\r\n return false;\r\n }\r\n\r\n var cp1 = cal.getPoint(0),\r\n cp2 = cal.getPoint(1),\r\n cp3 = cal.getPoint(2),\r\n cp4 = cal.getPoint(3),\r\n ip = new wpd.InputParser(),\r\n dat_mat, pix_mat;\r\n\r\n x1 = cp1.px;\r\n y1 = cp1.py;\r\n x2 = cp2.px;\r\n y2 = cp2.py;\r\n x3 = cp3.px;\r\n y3 = cp3.py;\r\n x4 = cp4.px;\r\n y4 = cp4.py;\r\n\r\n xmin = cp1.dx;\r\n xmax = cp2.dx;\r\n ymin = cp3.dy;\r\n ymax = cp4.dy;\r\n\r\n // Check for dates, validity etc.\r\n\r\n // Validate X-Axes:\r\n xmin = ip.parse(xmin);\r\n if (!ip.isValid) {\r\n return false;\r\n }\r\n isXDate = ip.isDate;\r\n xmax = ip.parse(xmax);\r\n if (!ip.isValid || (ip.isDate != isXDate)) {\r\n return false;\r\n }\r\n initialFormattingX = ip.formatting;\r\n\r\n // Validate Y-Axes:\r\n ymin = ip.parse(ymin);\r\n if (!ip.isValid) {\r\n return false;\r\n }\r\n isYDate = ip.isDate;\r\n ymax = ip.parse(ymax);\r\n if (!ip.isValid || (ip.isDate != isYDate)) {\r\n return false;\r\n }\r\n initialFormattingY = ip.formatting;\r\n\r\n isLogScaleX = isLogX;\r\n isLogScaleY = isLogY;\r\n noRotation = noRotationCorrection;\r\n\r\n // If x-axis is log scale\r\n if (isLogScaleX === true) {\r\n if (xmin < 0 && xmax < 0) {\r\n isLogScaleXNegative = true;\r\n xmin = Math.log(-xmin) / Math.log(10);\r\n xmax = Math.log(-xmax) / Math.log(10);\r\n } else {\r\n xmin = Math.log(xmin) / Math.log(10);\r\n xmax = Math.log(xmax) / Math.log(10);\r\n }\r\n }\r\n\r\n // If y-axis is log scale\r\n if (isLogScaleY === true) {\r\n if (ymin < 0 && ymax < 0) {\r\n isLogScaleYNegative = true;\r\n ymin = Math.log(-ymin) / Math.log(10);\r\n ymax = Math.log(-ymax) / Math.log(10);\r\n } else {\r\n ymin = Math.log(ymin) / Math.log(10);\r\n ymax = Math.log(ymax) / Math.log(10);\r\n }\r\n }\r\n\r\n dat_mat = [xmin - xmax, 0, 0, ymin - ymax];\r\n pix_mat = [x1 - x2, x3 - x4, y1 - y2, y3 - y4];\r\n\r\n a_mat = wpd.mat.mult2x2(dat_mat, wpd.mat.inv2x2(pix_mat));\r\n\r\n if (noRotation) {\r\n // avoid rotating the axes if this is selected.\r\n if (Math.abs(a_mat[0] * a_mat[3]) > Math.abs(a_mat[1] * a_mat[2])) {\r\n // snap to zero deg\r\n a_mat[1] = 0;\r\n a_mat[2] = 0;\r\n a_mat[0] = (xmax - xmin) / (x2 - x1);\r\n a_mat[3] = (ymax - ymin) / (y4 - y3);\r\n } else {\r\n // snap to +/- 90 deg since it appears x-axis is vertical and y is horizontal\r\n a_mat[0] = 0;\r\n a_mat[3] = 0;\r\n a_mat[1] = (xmax - xmin) / (y2 - y1);\r\n a_mat[2] = (ymax - ymin) / (x4 - x3);\r\n }\r\n }\r\n\r\n a_inv_mat = wpd.mat.inv2x2(a_mat);\r\n c_vec[0] = xmin - a_mat[0] * x1 - a_mat[1] * y1;\r\n c_vec[1] = ymin - a_mat[2] * x3 - a_mat[3] * y3;\r\n\r\n calibration = cal;\r\n return true;\r\n };\r\n\r\n this.getBounds = function () {\r\n return {\r\n x1: isLogScaleX ? Math.pow(10, xmin) : xmin,\r\n x2: isLogScaleX ? Math.pow(10, xmax) : xmax,\r\n y3: isLogScaleY ? Math.pow(10, ymin) : ymin,\r\n y4: isLogScaleY ? Math.pow(10, ymax) : ymax\r\n };\r\n };\r\n\r\n this.isCalibrated = function () {\r\n return isCalibrated;\r\n };\r\n\r\n this.calibration = null;\r\n\r\n this.calibrate = function (calib, isLogX, isLogY, noRotationCorrection) {\r\n this.calibration = calib;\r\n isCalibrated = processCalibration(calib, isLogX, isLogY, noRotationCorrection);\r\n return isCalibrated;\r\n };\r\n\r\n this.pixelToData = function (pxi, pyi) {\r\n var data = [],\r\n xp, yp, xf, yf, dat_vec;\r\n\r\n xp = parseFloat(pxi);\r\n yp = parseFloat(pyi);\r\n\r\n dat_vec = wpd.mat.mult2x2Vec(a_mat, [xp, yp]);\r\n dat_vec[0] = dat_vec[0] + c_vec[0];\r\n dat_vec[1] = dat_vec[1] + c_vec[1];\r\n\r\n xf = dat_vec[0];\r\n yf = dat_vec[1];\r\n\r\n // if x-axis is log scale\r\n if (isLogScaleX === true) {\r\n xf = isLogScaleXNegative ? -Math.pow(10, xf) : Math.pow(10, xf);\r\n }\r\n\r\n // if y-axis is log scale\r\n if (isLogScaleY === true) {\r\n yf = isLogScaleYNegative ? -Math.pow(10, yf) : Math.pow(10, yf);\r\n }\r\n\r\n data[0] = xf;\r\n data[1] = yf;\r\n\r\n return data;\r\n };\r\n\r\n this.dataToPixel = function (x, y) {\r\n var xf, yf, dat_vec, rtnPix;\r\n\r\n if (isLogScaleX) {\r\n x = isLogScaleXNegative ? Math.log(-x) / Math.log(10) : Math.log(x) / Math.log(10);\r\n }\r\n if (isLogScaleY) {\r\n y = isLogScaleYNegative ? Math.log(-y) / Math.log(10) : Math.log(y) / Math.log(10);\r\n }\r\n\r\n dat_vec = [x - c_vec[0], y - c_vec[1]];\r\n rtnPix = wpd.mat.mult2x2Vec(a_inv_mat, dat_vec);\r\n\r\n xf = rtnPix[0];\r\n yf = rtnPix[1];\r\n\r\n return {\r\n x: xf,\r\n y: yf\r\n };\r\n };\r\n\r\n this.pixelToLiveString = function (pxi, pyi) {\r\n var rtnString = '',\r\n dataVal = this.pixelToData(pxi, pyi);\r\n if (isXDate) {\r\n rtnString += wpd.dateConverter.formatDateNumber(dataVal[0], initialFormattingX);\r\n } else {\r\n rtnString += dataVal[0].toExponential(4);\r\n }\r\n rtnString += ', ';\r\n\r\n if (isYDate) {\r\n rtnString += wpd.dateConverter.formatDateNumber(dataVal[1], initialFormattingY);\r\n } else {\r\n rtnString += dataVal[1].toExponential(4);\r\n }\r\n return rtnString;\r\n };\r\n\r\n this.isDate = function (varIndex) {\r\n if (varIndex === 0) {\r\n return isXDate;\r\n } else {\r\n return isYDate;\r\n }\r\n };\r\n\r\n this.getInitialDateFormat = function (varIndex) {\r\n if (varIndex === 0) {\r\n return initialFormattingX;\r\n } else {\r\n return initialFormattingY;\r\n }\r\n };\r\n\r\n this.isLogX = function () {\r\n return isLogScaleX;\r\n };\r\n\r\n this.isLogXNegative = function () {\r\n return isLogScaleXNegative;\r\n }\r\n\r\n this.isLogY = function () {\r\n return isLogScaleY;\r\n };\r\n\r\n this.isLogYNegative = function () {\r\n return isLogScaleYNegative;\r\n }\r\n\r\n this.noRotation = function () {\r\n return noRotation;\r\n };\r\n\r\n this.getOrientation = function () {\r\n // Used by histogram auto-extract method only at the moment.\r\n // Just indicate increasing y-axis at the moment so that we can work with histograms.\r\n return {\r\n axes: 'Y',\r\n direction: 'increasing',\r\n angle: 90\r\n };\r\n };\r\n\r\n this.getMetadata = function () {\r\n // deep clone\r\n return JSON.parse(JSON.stringify(metadata));\r\n };\r\n\r\n this.setMetadata = function (obj) {\r\n // deep clone\r\n metadata = JSON.parse(JSON.stringify(obj));\r\n };\r\n\r\n this.name = \"XY\";\r\n };\r\n\r\n AxesObj.prototype.numCalibrationPointsRequired = function () {\r\n return 4;\r\n };\r\n\r\n AxesObj.prototype.getDimensions = function () {\r\n return 2;\r\n };\r\n\r\n AxesObj.prototype.getAxesLabels = function () {\r\n return ['X', 'Y'];\r\n };\r\n\r\n return AxesObj;\r\n})();\r\nmodule.exports = { wpd: wpd };\r\n","/*! For license information please see jimp.js.LICENSE.txt */\n(() => {\n var __webpack_modules__ = {\n 236: (t, e, r) => {\n var i = r(4618);\n function n(t, e) {\n var r = new i(t, e);\n return function (t) {\n return r.convert(t);\n };\n }\n n.BIN = \"01\", n.OCT = \"01234567\", n.DEC = \"0123456789\", n.HEX = \"0123456789abcdef\", t.exports = n;\n },\n 4618: t => {\n \"use strict\";\n\n function e(t, e) {\n if (!(t && e && t.length && e.length)) throw new Error(\"Bad alphabet\");\n this.srcAlphabet = t, this.dstAlphabet = e;\n }\n e.prototype.convert = function (t) {\n var e,\n r,\n i,\n n = {},\n a = this.srcAlphabet.length,\n o = this.dstAlphabet.length,\n s = t.length,\n h = \"string\" == typeof t ? \"\" : [];\n if (!this.isValid(t)) throw new Error('Number \"' + t + '\" contains of non-alphabetic digits (' + this.srcAlphabet + \")\");\n if (this.srcAlphabet === this.dstAlphabet) return t;\n for (e = 0; e < s; e++) n[e] = this.srcAlphabet.indexOf(t[e]);\n do {\n for (r = 0, i = 0, e = 0; e < s; e++) (r = r * a + n[e]) >= o ? (n[i++] = parseInt(r / o, 10), r %= o) : i > 0 && (n[i++] = 0);\n s = i, h = this.dstAlphabet.slice(r, r + 1).concat(h);\n } while (0 !== i);\n return h;\n }, e.prototype.isValid = function (t) {\n for (var e = 0; e < t.length; ++e) if (-1 === this.srcAlphabet.indexOf(t[e])) return !1;\n return !0;\n }, t.exports = e;\n },\n 5766: (t, e) => {\n \"use strict\";\n\n e.byteLength = function (t) {\n var e = h(t),\n r = e[0],\n i = e[1];\n return 3 * (r + i) / 4 - i;\n }, e.toByteArray = function (t) {\n var e,\n r,\n a = h(t),\n o = a[0],\n s = a[1],\n l = new n(function (t, e, r) {\n return 3 * (e + r) / 4 - r;\n }(0, o, s)),\n f = 0,\n u = s > 0 ? o - 4 : o;\n for (r = 0; r < u; r += 4) e = i[t.charCodeAt(r)] << 18 | i[t.charCodeAt(r + 1)] << 12 | i[t.charCodeAt(r + 2)] << 6 | i[t.charCodeAt(r + 3)], l[f++] = e >> 16 & 255, l[f++] = e >> 8 & 255, l[f++] = 255 & e;\n return 2 === s && (e = i[t.charCodeAt(r)] << 2 | i[t.charCodeAt(r + 1)] >> 4, l[f++] = 255 & e), 1 === s && (e = i[t.charCodeAt(r)] << 10 | i[t.charCodeAt(r + 1)] << 4 | i[t.charCodeAt(r + 2)] >> 2, l[f++] = e >> 8 & 255, l[f++] = 255 & e), l;\n }, e.fromByteArray = function (t) {\n for (var e, i = t.length, n = i % 3, a = [], o = 16383, s = 0, h = i - n; s < h; s += o) a.push(l(t, s, s + o > h ? h : s + o));\n return 1 === n ? (e = t[i - 1], a.push(r[e >> 2] + r[e << 4 & 63] + \"==\")) : 2 === n && (e = (t[i - 2] << 8) + t[i - 1], a.push(r[e >> 10] + r[e >> 4 & 63] + r[e << 2 & 63] + \"=\")), a.join(\"\");\n };\n for (var r = [], i = [], n = \"undefined\" != typeof Uint8Array ? Uint8Array : Array, a = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\", o = 0, s = a.length; o < s; ++o) r[o] = a[o], i[a.charCodeAt(o)] = o;\n function h(t) {\n var e = t.length;\n if (e % 4 > 0) throw new Error(\"Invalid string. Length must be a multiple of 4\");\n var r = t.indexOf(\"=\");\n return -1 === r && (r = e), [r, r === e ? 0 : 4 - r % 4];\n }\n function l(t, e, i) {\n for (var n, a, o = [], s = e; s < i; s += 3) n = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (255 & t[s + 2]), o.push(r[(a = n) >> 18 & 63] + r[a >> 12 & 63] + r[a >> 6 & 63] + r[63 & a]);\n return o.join(\"\");\n }\n i[\"-\".charCodeAt(0)] = 62, i[\"_\".charCodeAt(0)] = 63;\n },\n 486: (t, e, r) => {\n var i = r(5433),\n n = r(1651);\n t.exports = {\n encode: i,\n decode: n\n };\n },\n 1651: (t, e, r) => {\n var i = r(8834).lW;\n function n(t, e) {\n if (this.pos = 0, this.buffer = t, this.is_with_alpha = !!e, this.bottom_up = !0, this.flag = this.buffer.toString(\"utf-8\", 0, this.pos += 2), \"BM\" != this.flag) throw new Error(\"Invalid BMP File\");\n this.parseHeader(), this.parseRGBA();\n }\n n.prototype.parseHeader = function () {\n if (this.fileSize = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.reserved = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.offset = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.headerSize = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.width = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.height = this.buffer.readInt32LE(this.pos), this.pos += 4, this.planes = this.buffer.readUInt16LE(this.pos), this.pos += 2, this.bitPP = this.buffer.readUInt16LE(this.pos), this.pos += 2, this.compress = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.rawSize = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.hr = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.vr = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.colors = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.importantColors = this.buffer.readUInt32LE(this.pos), this.pos += 4, 16 === this.bitPP && this.is_with_alpha && (this.bitPP = 15), this.bitPP < 15) {\n var t = 0 === this.colors ? 1 << this.bitPP : this.colors;\n this.palette = new Array(t);\n for (var e = 0; e < t; e++) {\n var r = this.buffer.readUInt8(this.pos++),\n i = this.buffer.readUInt8(this.pos++),\n n = this.buffer.readUInt8(this.pos++),\n a = this.buffer.readUInt8(this.pos++);\n this.palette[e] = {\n red: n,\n green: i,\n blue: r,\n quad: a\n };\n }\n }\n this.height < 0 && (this.height *= -1, this.bottom_up = !1);\n }, n.prototype.parseRGBA = function () {\n var t = \"bit\" + this.bitPP,\n e = this.width * this.height * 4;\n this.data = new i(e), this[t]();\n }, n.prototype.bit1 = function () {\n var t = Math.ceil(this.width / 8),\n e = t % 4,\n r = this.height >= 0 ? this.height - 1 : -this.height;\n for (r = this.height - 1; r >= 0; r--) {\n for (var i = this.bottom_up ? r : this.height - 1 - r, n = 0; n < t; n++) for (var a = this.buffer.readUInt8(this.pos++), o = i * this.width * 4 + 8 * n * 4, s = 0; s < 8 && 8 * n + s < this.width; s++) {\n var h = this.palette[a >> 7 - s & 1];\n this.data[o + 4 * s] = 0, this.data[o + 4 * s + 1] = h.blue, this.data[o + 4 * s + 2] = h.green, this.data[o + 4 * s + 3] = h.red;\n }\n 0 != e && (this.pos += 4 - e);\n }\n }, n.prototype.bit4 = function () {\n if (2 == this.compress) {\n this.data.fill(255);\n for (var t = 0, e = this.bottom_up ? this.height - 1 : 0, r = !1; t < this.data.length;) {\n var i = this.buffer.readUInt8(this.pos++),\n n = this.buffer.readUInt8(this.pos++);\n if (0 == i) {\n if (0 == n) {\n this.bottom_up ? e-- : e++, t = e * this.width * 4, r = !1;\n continue;\n }\n if (1 == n) break;\n if (2 == n) {\n var a = this.buffer.readUInt8(this.pos++),\n o = this.buffer.readUInt8(this.pos++);\n this.bottom_up ? e -= o : e += o, t += o * this.width * 4 + 4 * a;\n } else {\n for (var s = this.buffer.readUInt8(this.pos++), h = 0; h < n; h++) r ? l.call(this, 15 & s) : l.call(this, (240 & s) >> 4), 1 & h && h + 1 < n && (s = this.buffer.readUInt8(this.pos++)), r = !r;\n 1 == (n + 1 >> 1 & 1) && this.pos++;\n }\n } else for (h = 0; h < i; h++) r ? l.call(this, 15 & n) : l.call(this, (240 & n) >> 4), r = !r;\n }\n function l(e) {\n var r = this.palette[e];\n this.data[t] = 0, this.data[t + 1] = r.blue, this.data[t + 2] = r.green, this.data[t + 3] = r.red, t += 4;\n }\n } else {\n var f = Math.ceil(this.width / 2),\n u = f % 4;\n for (o = this.height - 1; o >= 0; o--) {\n var c = this.bottom_up ? o : this.height - 1 - o;\n for (a = 0; a < f; a++) {\n n = this.buffer.readUInt8(this.pos++), t = c * this.width * 4 + 2 * a * 4;\n var d = n >> 4,\n p = 15 & n,\n m = this.palette[d];\n if (this.data[t] = 0, this.data[t + 1] = m.blue, this.data[t + 2] = m.green, this.data[t + 3] = m.red, 2 * a + 1 >= this.width) break;\n m = this.palette[p], this.data[t + 4] = 0, this.data[t + 4 + 1] = m.blue, this.data[t + 4 + 2] = m.green, this.data[t + 4 + 3] = m.red;\n }\n 0 != u && (this.pos += 4 - u);\n }\n }\n }, n.prototype.bit8 = function () {\n if (1 == this.compress) {\n this.data.fill(255);\n for (var t = 0, e = this.bottom_up ? this.height - 1 : 0; t < this.data.length;) {\n var r = this.buffer.readUInt8(this.pos++),\n i = this.buffer.readUInt8(this.pos++);\n if (0 == r) {\n if (0 == i) {\n this.bottom_up ? e-- : e++, t = e * this.width * 4;\n continue;\n }\n if (1 == i) break;\n if (2 == i) {\n var n = this.buffer.readUInt8(this.pos++),\n a = this.buffer.readUInt8(this.pos++);\n this.bottom_up ? e -= a : e += a, t += a * this.width * 4 + 4 * n;\n } else {\n for (var o = 0; o < i; o++) {\n var s = this.buffer.readUInt8(this.pos++);\n h.call(this, s);\n }\n !0 & i && this.pos++;\n }\n } else for (o = 0; o < r; o++) h.call(this, i);\n }\n function h(e) {\n var r = this.palette[e];\n this.data[t] = 0, this.data[t + 1] = r.blue, this.data[t + 2] = r.green, this.data[t + 3] = r.red, t += 4;\n }\n } else {\n var l = this.width % 4;\n for (a = this.height - 1; a >= 0; a--) {\n var f = this.bottom_up ? a : this.height - 1 - a;\n for (n = 0; n < this.width; n++) if (i = this.buffer.readUInt8(this.pos++), t = f * this.width * 4 + 4 * n, i < this.palette.length) {\n var u = this.palette[i];\n this.data[t] = 0, this.data[t + 1] = u.blue, this.data[t + 2] = u.green, this.data[t + 3] = u.red;\n } else this.data[t] = 0, this.data[t + 1] = 255, this.data[t + 2] = 255, this.data[t + 3] = 255;\n 0 != l && (this.pos += 4 - l);\n }\n }\n }, n.prototype.bit15 = function () {\n for (var t = this.width % 3, e = parseInt(\"11111\", 2), r = this.height - 1; r >= 0; r--) {\n for (var i = this.bottom_up ? r : this.height - 1 - r, n = 0; n < this.width; n++) {\n var a = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n var o = (a & e) / e * 255 | 0,\n s = (a >> 5 & e) / e * 255 | 0,\n h = (a >> 10 & e) / e * 255 | 0,\n l = a >> 15 ? 255 : 0,\n f = i * this.width * 4 + 4 * n;\n this.data[f] = l, this.data[f + 1] = o, this.data[f + 2] = s, this.data[f + 3] = h;\n }\n this.pos += t;\n }\n }, n.prototype.bit16 = function () {\n var t = this.width % 2 * 2;\n this.maskRed = 31744, this.maskGreen = 992, this.maskBlue = 31, this.mask0 = 0, 3 == this.compress && (this.maskRed = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.maskGreen = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.maskBlue = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.mask0 = this.buffer.readUInt32LE(this.pos), this.pos += 4);\n for (var e = [0, 0, 0], r = 0; r < 16; r++) this.maskRed >> r & 1 && e[0]++, this.maskGreen >> r & 1 && e[1]++, this.maskBlue >> r & 1 && e[2]++;\n e[1] += e[0], e[2] += e[1], e[0] = 8 - e[0], e[1] -= 8, e[2] -= 8;\n for (var i = this.height - 1; i >= 0; i--) {\n for (var n = this.bottom_up ? i : this.height - 1 - i, a = 0; a < this.width; a++) {\n var o = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n var s = (o & this.maskBlue) << e[0],\n h = (o & this.maskGreen) >> e[1],\n l = (o & this.maskRed) >> e[2],\n f = n * this.width * 4 + 4 * a;\n this.data[f] = 0, this.data[f + 1] = s, this.data[f + 2] = h, this.data[f + 3] = l;\n }\n this.pos += t;\n }\n }, n.prototype.bit24 = function () {\n for (var t = this.height - 1; t >= 0; t--) {\n for (var e = this.bottom_up ? t : this.height - 1 - t, r = 0; r < this.width; r++) {\n var i = this.buffer.readUInt8(this.pos++),\n n = this.buffer.readUInt8(this.pos++),\n a = this.buffer.readUInt8(this.pos++),\n o = e * this.width * 4 + 4 * r;\n this.data[o] = 0, this.data[o + 1] = i, this.data[o + 2] = n, this.data[o + 3] = a;\n }\n this.pos += this.width % 4;\n }\n }, n.prototype.bit32 = function () {\n if (3 == this.compress) {\n this.maskRed = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.maskGreen = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.maskBlue = this.buffer.readUInt32LE(this.pos), this.pos += 4, this.mask0 = this.buffer.readUInt32LE(this.pos), this.pos += 4;\n for (var t = this.height - 1; t >= 0; t--) for (var e = this.bottom_up ? t : this.height - 1 - t, r = 0; r < this.width; r++) {\n var i = this.buffer.readUInt8(this.pos++),\n n = this.buffer.readUInt8(this.pos++),\n a = this.buffer.readUInt8(this.pos++),\n o = this.buffer.readUInt8(this.pos++),\n s = e * this.width * 4 + 4 * r;\n this.data[s] = i, this.data[s + 1] = n, this.data[s + 2] = a, this.data[s + 3] = o;\n }\n } else for (t = this.height - 1; t >= 0; t--) for (e = this.bottom_up ? t : this.height - 1 - t, r = 0; r < this.width; r++) n = this.buffer.readUInt8(this.pos++), a = this.buffer.readUInt8(this.pos++), o = this.buffer.readUInt8(this.pos++), i = this.buffer.readUInt8(this.pos++), s = e * this.width * 4 + 4 * r, this.data[s] = i, this.data[s + 1] = n, this.data[s + 2] = a, this.data[s + 3] = o;\n }, n.prototype.getData = function () {\n return this.data;\n }, t.exports = function (t) {\n return new n(t);\n };\n },\n 5433: (t, e, r) => {\n var i = r(8834).lW;\n function n(t) {\n this.buffer = t.data, this.width = t.width, this.height = t.height, this.extraBytes = this.width % 4, this.rgbSize = this.height * (3 * this.width + this.extraBytes), this.headerInfoSize = 40, this.data = [], this.flag = \"BM\", this.reserved = 0, this.offset = 54, this.fileSize = this.rgbSize + this.offset, this.planes = 1, this.bitPP = 24, this.compress = 0, this.hr = 0, this.vr = 0, this.colors = 0, this.importantColors = 0;\n }\n n.prototype.encode = function () {\n var t = new i(this.offset + this.rgbSize);\n this.pos = 0, t.write(this.flag, this.pos, 2), this.pos += 2, t.writeUInt32LE(this.fileSize, this.pos), this.pos += 4, t.writeUInt32LE(this.reserved, this.pos), this.pos += 4, t.writeUInt32LE(this.offset, this.pos), this.pos += 4, t.writeUInt32LE(this.headerInfoSize, this.pos), this.pos += 4, t.writeUInt32LE(this.width, this.pos), this.pos += 4, t.writeInt32LE(-this.height, this.pos), this.pos += 4, t.writeUInt16LE(this.planes, this.pos), this.pos += 2, t.writeUInt16LE(this.bitPP, this.pos), this.pos += 2, t.writeUInt32LE(this.compress, this.pos), this.pos += 4, t.writeUInt32LE(this.rgbSize, this.pos), this.pos += 4, t.writeUInt32LE(this.hr, this.pos), this.pos += 4, t.writeUInt32LE(this.vr, this.pos), this.pos += 4, t.writeUInt32LE(this.colors, this.pos), this.pos += 4, t.writeUInt32LE(this.importantColors, this.pos), this.pos += 4;\n for (var e = 0, r = 3 * this.width + this.extraBytes, n = 0; n < this.height; n++) {\n for (var a = 0; a < this.width; a++) {\n var o = this.pos + n * r + 3 * a;\n e++, t[o] = this.buffer[e++], t[o + 1] = this.buffer[e++], t[o + 2] = this.buffer[e++];\n }\n if (this.extraBytes > 0) {\n var s = this.pos + n * r + 3 * this.width;\n t.fill(0, s, s + this.extraBytes);\n }\n }\n return t;\n }, t.exports = function (t, e) {\n return void 0 === e && (e = 100), {\n data: new n(t).encode(),\n width: t.width,\n height: t.height\n };\n };\n },\n 5137: (t, e, r) => {\n var i = r(8834).lW;\n t.exports = function (t, e) {\n if (i.isBuffer(t) && i.isBuffer(e)) {\n if (\"function\" == typeof t.equals) return t.equals(e);\n if (t.length !== e.length) return !1;\n for (var r = 0; r < t.length; r++) if (t[r] !== e[r]) return !1;\n return !0;\n }\n };\n },\n 8834: (t, e, r) => {\n \"use strict\";\n\n var i = r(5766),\n n = r(4181);\n e.lW = s, e.h2 = 50;\n var a = 2147483647;\n function o(t) {\n if (t > a) throw new RangeError('The value \"' + t + '\" is invalid for option \"size\"');\n var e = new Uint8Array(t);\n return e.__proto__ = s.prototype, e;\n }\n function s(t, e, r) {\n if (\"number\" == typeof t) {\n if (\"string\" == typeof e) throw new TypeError('The \"string\" argument must be of type string. Received type number');\n return f(t);\n }\n return h(t, e, r);\n }\n function h(t, e, r) {\n if (\"string\" == typeof t) return function (t, e) {\n if (\"string\" == typeof e && \"\" !== e || (e = \"utf8\"), !s.isEncoding(e)) throw new TypeError(\"Unknown encoding: \" + e);\n var r = 0 | d(t, e),\n i = o(r),\n n = i.write(t, e);\n return n !== r && (i = i.slice(0, n)), i;\n }(t, e);\n if (ArrayBuffer.isView(t)) return u(t);\n if (null == t) throw TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof t);\n if (F(t, ArrayBuffer) || t && F(t.buffer, ArrayBuffer)) return function (t, e, r) {\n if (e < 0 || t.byteLength < e) throw new RangeError('\"offset\" is outside of buffer bounds');\n if (t.byteLength < e + (r || 0)) throw new RangeError('\"length\" is outside of buffer bounds');\n var i;\n return (i = void 0 === e && void 0 === r ? new Uint8Array(t) : void 0 === r ? new Uint8Array(t, e) : new Uint8Array(t, e, r)).__proto__ = s.prototype, i;\n }(t, e, r);\n if (\"number\" == typeof t) throw new TypeError('The \"value\" argument must not be of type number. Received type number');\n var i = t.valueOf && t.valueOf();\n if (null != i && i !== t) return s.from(i, e, r);\n var n = function (t) {\n if (s.isBuffer(t)) {\n var e = 0 | c(t.length),\n r = o(e);\n return 0 === r.length || t.copy(r, 0, 0, e), r;\n }\n return void 0 !== t.length ? \"number\" != typeof t.length || j(t.length) ? o(0) : u(t) : \"Buffer\" === t.type && Array.isArray(t.data) ? u(t.data) : void 0;\n }(t);\n if (n) return n;\n if (\"undefined\" != typeof Symbol && null != Symbol.toPrimitive && \"function\" == typeof t[Symbol.toPrimitive]) return s.from(t[Symbol.toPrimitive](\"string\"), e, r);\n throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof t);\n }\n function l(t) {\n if (\"number\" != typeof t) throw new TypeError('\"size\" argument must be of type number');\n if (t < 0) throw new RangeError('The value \"' + t + '\" is invalid for option \"size\"');\n }\n function f(t) {\n return l(t), o(t < 0 ? 0 : 0 | c(t));\n }\n function u(t) {\n for (var e = t.length < 0 ? 0 : 0 | c(t.length), r = o(e), i = 0; i < e; i += 1) r[i] = 255 & t[i];\n return r;\n }\n function c(t) {\n if (t >= a) throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\" + a.toString(16) + \" bytes\");\n return 0 | t;\n }\n function d(t, e) {\n if (s.isBuffer(t)) return t.length;\n if (ArrayBuffer.isView(t) || F(t, ArrayBuffer)) return t.byteLength;\n if (\"string\" != typeof t) throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof t);\n var r = t.length,\n i = arguments.length > 2 && !0 === arguments[2];\n if (!i && 0 === r) return 0;\n for (var n = !1;;) switch (e) {\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return r;\n case \"utf8\":\n case \"utf-8\":\n return z(t).length;\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return 2 * r;\n case \"hex\":\n return r >>> 1;\n case \"base64\":\n return D(t).length;\n default:\n if (n) return i ? -1 : z(t).length;\n e = (\"\" + e).toLowerCase(), n = !0;\n }\n }\n function p(t, e, r) {\n var i = !1;\n if ((void 0 === e || e < 0) && (e = 0), e > this.length) return \"\";\n if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) return \"\";\n if ((r >>>= 0) <= (e >>>= 0)) return \"\";\n for (t || (t = \"utf8\");;) switch (t) {\n case \"hex\":\n return B(this, e, r);\n case \"utf8\":\n case \"utf-8\":\n return S(this, e, r);\n case \"ascii\":\n return A(this, e, r);\n case \"latin1\":\n case \"binary\":\n return I(this, e, r);\n case \"base64\":\n return k(this, e, r);\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return T(this, e, r);\n default:\n if (i) throw new TypeError(\"Unknown encoding: \" + t);\n t = (t + \"\").toLowerCase(), i = !0;\n }\n }\n function m(t, e, r) {\n var i = t[e];\n t[e] = t[r], t[r] = i;\n }\n function g(t, e, r, i, n) {\n if (0 === t.length) return -1;\n if (\"string\" == typeof r ? (i = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), j(r = +r) && (r = n ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {\n if (n) return -1;\n r = t.length - 1;\n } else if (r < 0) {\n if (!n) return -1;\n r = 0;\n }\n if (\"string\" == typeof e && (e = s.from(e, i)), s.isBuffer(e)) return 0 === e.length ? -1 : b(t, e, r, i, n);\n if (\"number\" == typeof e) return e &= 255, \"function\" == typeof Uint8Array.prototype.indexOf ? n ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : b(t, [e], r, i, n);\n throw new TypeError(\"val must be string, number or Buffer\");\n }\n function b(t, e, r, i, n) {\n var a,\n o = 1,\n s = t.length,\n h = e.length;\n if (void 0 !== i && (\"ucs2\" === (i = String(i).toLowerCase()) || \"ucs-2\" === i || \"utf16le\" === i || \"utf-16le\" === i)) {\n if (t.length < 2 || e.length < 2) return -1;\n o = 2, s /= 2, h /= 2, r /= 2;\n }\n function l(t, e) {\n return 1 === o ? t[e] : t.readUInt16BE(e * o);\n }\n if (n) {\n var f = -1;\n for (a = r; a < s; a++) if (l(t, a) === l(e, -1 === f ? 0 : a - f)) {\n if (-1 === f && (f = a), a - f + 1 === h) return f * o;\n } else -1 !== f && (a -= a - f), f = -1;\n } else for (r + h > s && (r = s - h), a = r; a >= 0; a--) {\n for (var u = !0, c = 0; c < h; c++) if (l(t, a + c) !== l(e, c)) {\n u = !1;\n break;\n }\n if (u) return a;\n }\n return -1;\n }\n function _(t, e, r, i) {\n r = Number(r) || 0;\n var n = t.length - r;\n i ? (i = Number(i)) > n && (i = n) : i = n;\n var a = e.length;\n i > a / 2 && (i = a / 2);\n for (var o = 0; o < i; ++o) {\n var s = parseInt(e.substr(2 * o, 2), 16);\n if (j(s)) return o;\n t[r + o] = s;\n }\n return o;\n }\n function y(t, e, r, i) {\n return N(z(e, t.length - r), t, r, i);\n }\n function w(t, e, r, i) {\n return N(function (t) {\n for (var e = [], r = 0; r < t.length; ++r) e.push(255 & t.charCodeAt(r));\n return e;\n }(e), t, r, i);\n }\n function v(t, e, r, i) {\n return w(t, e, r, i);\n }\n function x(t, e, r, i) {\n return N(D(e), t, r, i);\n }\n function E(t, e, r, i) {\n return N(function (t, e) {\n for (var r, i, n, a = [], o = 0; o < t.length && !((e -= 2) < 0); ++o) i = (r = t.charCodeAt(o)) >> 8, n = r % 256, a.push(n), a.push(i);\n return a;\n }(e, t.length - r), t, r, i);\n }\n function k(t, e, r) {\n return 0 === e && r === t.length ? i.fromByteArray(t) : i.fromByteArray(t.slice(e, r));\n }\n function S(t, e, r) {\n r = Math.min(t.length, r);\n for (var i = [], n = e; n < r;) {\n var a,\n o,\n s,\n h,\n l = t[n],\n f = null,\n u = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;\n if (n + u <= r) switch (u) {\n case 1:\n l < 128 && (f = l);\n break;\n case 2:\n 128 == (192 & (a = t[n + 1])) && (h = (31 & l) << 6 | 63 & a) > 127 && (f = h);\n break;\n case 3:\n a = t[n + 1], o = t[n + 2], 128 == (192 & a) && 128 == (192 & o) && (h = (15 & l) << 12 | (63 & a) << 6 | 63 & o) > 2047 && (h < 55296 || h > 57343) && (f = h);\n break;\n case 4:\n a = t[n + 1], o = t[n + 2], s = t[n + 3], 128 == (192 & a) && 128 == (192 & o) && 128 == (192 & s) && (h = (15 & l) << 18 | (63 & a) << 12 | (63 & o) << 6 | 63 & s) > 65535 && h < 1114112 && (f = h);\n }\n null === f ? (f = 65533, u = 1) : f > 65535 && (f -= 65536, i.push(f >>> 10 & 1023 | 55296), f = 56320 | 1023 & f), i.push(f), n += u;\n }\n return function (t) {\n var e = t.length;\n if (e <= M) return String.fromCharCode.apply(String, t);\n for (var r = \"\", i = 0; i < e;) r += String.fromCharCode.apply(String, t.slice(i, i += M));\n return r;\n }(i);\n }\n s.TYPED_ARRAY_SUPPORT = function () {\n try {\n var t = new Uint8Array(1);\n return t.__proto__ = {\n __proto__: Uint8Array.prototype,\n foo: function () {\n return 42;\n }\n }, 42 === t.foo();\n } catch (t) {\n return !1;\n }\n }(), s.TYPED_ARRAY_SUPPORT || \"undefined\" == typeof console || \"function\" != typeof console.error || console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"), Object.defineProperty(s.prototype, \"parent\", {\n enumerable: !0,\n get: function () {\n if (s.isBuffer(this)) return this.buffer;\n }\n }), Object.defineProperty(s.prototype, \"offset\", {\n enumerable: !0,\n get: function () {\n if (s.isBuffer(this)) return this.byteOffset;\n }\n }), \"undefined\" != typeof Symbol && null != Symbol.species && s[Symbol.species] === s && Object.defineProperty(s, Symbol.species, {\n value: null,\n configurable: !0,\n enumerable: !1,\n writable: !1\n }), s.poolSize = 8192, s.from = function (t, e, r) {\n return h(t, e, r);\n }, s.prototype.__proto__ = Uint8Array.prototype, s.__proto__ = Uint8Array, s.alloc = function (t, e, r) {\n return function (t, e, r) {\n return l(t), t <= 0 ? o(t) : void 0 !== e ? \"string\" == typeof r ? o(t).fill(e, r) : o(t).fill(e) : o(t);\n }(t, e, r);\n }, s.allocUnsafe = function (t) {\n return f(t);\n }, s.allocUnsafeSlow = function (t) {\n return f(t);\n }, s.isBuffer = function (t) {\n return null != t && !0 === t._isBuffer && t !== s.prototype;\n }, s.compare = function (t, e) {\n if (F(t, Uint8Array) && (t = s.from(t, t.offset, t.byteLength)), F(e, Uint8Array) && (e = s.from(e, e.offset, e.byteLength)), !s.isBuffer(t) || !s.isBuffer(e)) throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');\n if (t === e) return 0;\n for (var r = t.length, i = e.length, n = 0, a = Math.min(r, i); n < a; ++n) if (t[n] !== e[n]) {\n r = t[n], i = e[n];\n break;\n }\n return r < i ? -1 : i < r ? 1 : 0;\n }, s.isEncoding = function (t) {\n switch (String(t).toLowerCase()) {\n case \"hex\":\n case \"utf8\":\n case \"utf-8\":\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n case \"base64\":\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return !0;\n default:\n return !1;\n }\n }, s.concat = function (t, e) {\n if (!Array.isArray(t)) throw new TypeError('\"list\" argument must be an Array of Buffers');\n if (0 === t.length) return s.alloc(0);\n var r;\n if (void 0 === e) for (e = 0, r = 0; r < t.length; ++r) e += t[r].length;\n var i = s.allocUnsafe(e),\n n = 0;\n for (r = 0; r < t.length; ++r) {\n var a = t[r];\n if (F(a, Uint8Array) && (a = s.from(a)), !s.isBuffer(a)) throw new TypeError('\"list\" argument must be an Array of Buffers');\n a.copy(i, n), n += a.length;\n }\n return i;\n }, s.byteLength = d, s.prototype._isBuffer = !0, s.prototype.swap16 = function () {\n var t = this.length;\n if (t % 2 != 0) throw new RangeError(\"Buffer size must be a multiple of 16-bits\");\n for (var e = 0; e < t; e += 2) m(this, e, e + 1);\n return this;\n }, s.prototype.swap32 = function () {\n var t = this.length;\n if (t % 4 != 0) throw new RangeError(\"Buffer size must be a multiple of 32-bits\");\n for (var e = 0; e < t; e += 4) m(this, e, e + 3), m(this, e + 1, e + 2);\n return this;\n }, s.prototype.swap64 = function () {\n var t = this.length;\n if (t % 8 != 0) throw new RangeError(\"Buffer size must be a multiple of 64-bits\");\n for (var e = 0; e < t; e += 8) m(this, e, e + 7), m(this, e + 1, e + 6), m(this, e + 2, e + 5), m(this, e + 3, e + 4);\n return this;\n }, s.prototype.toString = function () {\n var t = this.length;\n return 0 === t ? \"\" : 0 === arguments.length ? S(this, 0, t) : p.apply(this, arguments);\n }, s.prototype.toLocaleString = s.prototype.toString, s.prototype.equals = function (t) {\n if (!s.isBuffer(t)) throw new TypeError(\"Argument must be a Buffer\");\n return this === t || 0 === s.compare(this, t);\n }, s.prototype.inspect = function () {\n var t = \"\",\n r = e.h2;\n return t = this.toString(\"hex\", 0, r).replace(/(.{2})/g, \"$1 \").trim(), this.length > r && (t += \" ... \"), \"\";\n }, s.prototype.compare = function (t, e, r, i, n) {\n if (F(t, Uint8Array) && (t = s.from(t, t.offset, t.byteLength)), !s.isBuffer(t)) throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t);\n if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0), void 0 === i && (i = 0), void 0 === n && (n = this.length), e < 0 || r > t.length || i < 0 || n > this.length) throw new RangeError(\"out of range index\");\n if (i >= n && e >= r) return 0;\n if (i >= n) return -1;\n if (e >= r) return 1;\n if (this === t) return 0;\n for (var a = (n >>>= 0) - (i >>>= 0), o = (r >>>= 0) - (e >>>= 0), h = Math.min(a, o), l = this.slice(i, n), f = t.slice(e, r), u = 0; u < h; ++u) if (l[u] !== f[u]) {\n a = l[u], o = f[u];\n break;\n }\n return a < o ? -1 : o < a ? 1 : 0;\n }, s.prototype.includes = function (t, e, r) {\n return -1 !== this.indexOf(t, e, r);\n }, s.prototype.indexOf = function (t, e, r) {\n return g(this, t, e, r, !0);\n }, s.prototype.lastIndexOf = function (t, e, r) {\n return g(this, t, e, r, !1);\n }, s.prototype.write = function (t, e, r, i) {\n if (void 0 === e) i = \"utf8\", r = this.length, e = 0;else if (void 0 === r && \"string\" == typeof e) i = e, r = this.length, e = 0;else {\n if (!isFinite(e)) throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");\n e >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === i && (i = \"utf8\")) : (i = r, r = void 0);\n }\n var n = this.length - e;\n if ((void 0 === r || r > n) && (r = n), t.length > 0 && (r < 0 || e < 0) || e > this.length) throw new RangeError(\"Attempt to write outside buffer bounds\");\n i || (i = \"utf8\");\n for (var a = !1;;) switch (i) {\n case \"hex\":\n return _(this, t, e, r);\n case \"utf8\":\n case \"utf-8\":\n return y(this, t, e, r);\n case \"ascii\":\n return w(this, t, e, r);\n case \"latin1\":\n case \"binary\":\n return v(this, t, e, r);\n case \"base64\":\n return x(this, t, e, r);\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return E(this, t, e, r);\n default:\n if (a) throw new TypeError(\"Unknown encoding: \" + i);\n i = (\"\" + i).toLowerCase(), a = !0;\n }\n }, s.prototype.toJSON = function () {\n return {\n type: \"Buffer\",\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n var M = 4096;\n function A(t, e, r) {\n var i = \"\";\n r = Math.min(t.length, r);\n for (var n = e; n < r; ++n) i += String.fromCharCode(127 & t[n]);\n return i;\n }\n function I(t, e, r) {\n var i = \"\";\n r = Math.min(t.length, r);\n for (var n = e; n < r; ++n) i += String.fromCharCode(t[n]);\n return i;\n }\n function B(t, e, r) {\n var i,\n n = t.length;\n (!e || e < 0) && (e = 0), (!r || r < 0 || r > n) && (r = n);\n for (var a = \"\", o = e; o < r; ++o) a += (i = t[o]) < 16 ? \"0\" + i.toString(16) : i.toString(16);\n return a;\n }\n function T(t, e, r) {\n for (var i = t.slice(e, r), n = \"\", a = 0; a < i.length; a += 2) n += String.fromCharCode(i[a] + 256 * i[a + 1]);\n return n;\n }\n function R(t, e, r) {\n if (t % 1 != 0 || t < 0) throw new RangeError(\"offset is not uint\");\n if (t + e > r) throw new RangeError(\"Trying to access beyond buffer length\");\n }\n function P(t, e, r, i, n, a) {\n if (!s.isBuffer(t)) throw new TypeError('\"buffer\" argument must be a Buffer instance');\n if (e > n || e < a) throw new RangeError('\"value\" argument is out of bounds');\n if (r + i > t.length) throw new RangeError(\"Index out of range\");\n }\n function O(t, e, r, i, n, a) {\n if (r + i > t.length) throw new RangeError(\"Index out of range\");\n if (r < 0) throw new RangeError(\"Index out of range\");\n }\n function L(t, e, r, i, a) {\n return e = +e, r >>>= 0, a || O(t, 0, r, 4), n.write(t, e, r, i, 23, 4), r + 4;\n }\n function C(t, e, r, i, a) {\n return e = +e, r >>>= 0, a || O(t, 0, r, 8), n.write(t, e, r, i, 52, 8), r + 8;\n }\n s.prototype.slice = function (t, e) {\n var r = this.length;\n (t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r), e < t && (e = t);\n var i = this.subarray(t, e);\n return i.__proto__ = s.prototype, i;\n }, s.prototype.readUIntLE = function (t, e, r) {\n t >>>= 0, e >>>= 0, r || R(t, e, this.length);\n for (var i = this[t], n = 1, a = 0; ++a < e && (n *= 256);) i += this[t + a] * n;\n return i;\n }, s.prototype.readUIntBE = function (t, e, r) {\n t >>>= 0, e >>>= 0, r || R(t, e, this.length);\n for (var i = this[t + --e], n = 1; e > 0 && (n *= 256);) i += this[t + --e] * n;\n return i;\n }, s.prototype.readUInt8 = function (t, e) {\n return t >>>= 0, e || R(t, 1, this.length), this[t];\n }, s.prototype.readUInt16LE = function (t, e) {\n return t >>>= 0, e || R(t, 2, this.length), this[t] | this[t + 1] << 8;\n }, s.prototype.readUInt16BE = function (t, e) {\n return t >>>= 0, e || R(t, 2, this.length), this[t] << 8 | this[t + 1];\n }, s.prototype.readUInt32LE = function (t, e) {\n return t >>>= 0, e || R(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3];\n }, s.prototype.readUInt32BE = function (t, e) {\n return t >>>= 0, e || R(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);\n }, s.prototype.readIntLE = function (t, e, r) {\n t >>>= 0, e >>>= 0, r || R(t, e, this.length);\n for (var i = this[t], n = 1, a = 0; ++a < e && (n *= 256);) i += this[t + a] * n;\n return i >= (n *= 128) && (i -= Math.pow(2, 8 * e)), i;\n }, s.prototype.readIntBE = function (t, e, r) {\n t >>>= 0, e >>>= 0, r || R(t, e, this.length);\n for (var i = e, n = 1, a = this[t + --i]; i > 0 && (n *= 256);) a += this[t + --i] * n;\n return a >= (n *= 128) && (a -= Math.pow(2, 8 * e)), a;\n }, s.prototype.readInt8 = function (t, e) {\n return t >>>= 0, e || R(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t];\n }, s.prototype.readInt16LE = function (t, e) {\n t >>>= 0, e || R(t, 2, this.length);\n var r = this[t] | this[t + 1] << 8;\n return 32768 & r ? 4294901760 | r : r;\n }, s.prototype.readInt16BE = function (t, e) {\n t >>>= 0, e || R(t, 2, this.length);\n var r = this[t + 1] | this[t] << 8;\n return 32768 & r ? 4294901760 | r : r;\n }, s.prototype.readInt32LE = function (t, e) {\n return t >>>= 0, e || R(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;\n }, s.prototype.readInt32BE = function (t, e) {\n return t >>>= 0, e || R(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];\n }, s.prototype.readFloatLE = function (t, e) {\n return t >>>= 0, e || R(t, 4, this.length), n.read(this, t, !0, 23, 4);\n }, s.prototype.readFloatBE = function (t, e) {\n return t >>>= 0, e || R(t, 4, this.length), n.read(this, t, !1, 23, 4);\n }, s.prototype.readDoubleLE = function (t, e) {\n return t >>>= 0, e || R(t, 8, this.length), n.read(this, t, !0, 52, 8);\n }, s.prototype.readDoubleBE = function (t, e) {\n return t >>>= 0, e || R(t, 8, this.length), n.read(this, t, !1, 52, 8);\n }, s.prototype.writeUIntLE = function (t, e, r, i) {\n t = +t, e >>>= 0, r >>>= 0, i || P(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);\n var n = 1,\n a = 0;\n for (this[e] = 255 & t; ++a < r && (n *= 256);) this[e + a] = t / n & 255;\n return e + r;\n }, s.prototype.writeUIntBE = function (t, e, r, i) {\n t = +t, e >>>= 0, r >>>= 0, i || P(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);\n var n = r - 1,\n a = 1;\n for (this[e + n] = 255 & t; --n >= 0 && (a *= 256);) this[e + n] = t / a & 255;\n return e + r;\n }, s.prototype.writeUInt8 = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 1, 255, 0), this[e] = 255 & t, e + 1;\n }, s.prototype.writeUInt16LE = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 2, 65535, 0), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;\n }, s.prototype.writeUInt16BE = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;\n }, s.prototype.writeUInt32LE = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t, e + 4;\n }, s.prototype.writeUInt32BE = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;\n }, s.prototype.writeIntLE = function (t, e, r, i) {\n if (t = +t, e >>>= 0, !i) {\n var n = Math.pow(2, 8 * r - 1);\n P(this, t, e, r, n - 1, -n);\n }\n var a = 0,\n o = 1,\n s = 0;\n for (this[e] = 255 & t; ++a < r && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + a - 1] && (s = 1), this[e + a] = (t / o >> 0) - s & 255;\n return e + r;\n }, s.prototype.writeIntBE = function (t, e, r, i) {\n if (t = +t, e >>>= 0, !i) {\n var n = Math.pow(2, 8 * r - 1);\n P(this, t, e, r, n - 1, -n);\n }\n var a = r - 1,\n o = 1,\n s = 0;\n for (this[e + a] = 255 & t; --a >= 0 && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + a + 1] && (s = 1), this[e + a] = (t / o >> 0) - s & 255;\n return e + r;\n }, s.prototype.writeInt8 = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1;\n }, s.prototype.writeInt16LE = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 2, 32767, -32768), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;\n }, s.prototype.writeInt16BE = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;\n }, s.prototype.writeInt32LE = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 4, 2147483647, -2147483648), this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;\n }, s.prototype.writeInt32BE = function (t, e, r) {\n return t = +t, e >>>= 0, r || P(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;\n }, s.prototype.writeFloatLE = function (t, e, r) {\n return L(this, t, e, !0, r);\n }, s.prototype.writeFloatBE = function (t, e, r) {\n return L(this, t, e, !1, r);\n }, s.prototype.writeDoubleLE = function (t, e, r) {\n return C(this, t, e, !0, r);\n }, s.prototype.writeDoubleBE = function (t, e, r) {\n return C(this, t, e, !1, r);\n }, s.prototype.copy = function (t, e, r, i) {\n if (!s.isBuffer(t)) throw new TypeError(\"argument should be a Buffer\");\n if (r || (r = 0), i || 0 === i || (i = this.length), e >= t.length && (e = t.length), e || (e = 0), i > 0 && i < r && (i = r), i === r) return 0;\n if (0 === t.length || 0 === this.length) return 0;\n if (e < 0) throw new RangeError(\"targetStart out of bounds\");\n if (r < 0 || r >= this.length) throw new RangeError(\"Index out of range\");\n if (i < 0) throw new RangeError(\"sourceEnd out of bounds\");\n i > this.length && (i = this.length), t.length - e < i - r && (i = t.length - e + r);\n var n = i - r;\n if (this === t && \"function\" == typeof Uint8Array.prototype.copyWithin) this.copyWithin(e, r, i);else if (this === t && r < e && e < i) for (var a = n - 1; a >= 0; --a) t[a + e] = this[a + r];else Uint8Array.prototype.set.call(t, this.subarray(r, i), e);\n return n;\n }, s.prototype.fill = function (t, e, r, i) {\n if (\"string\" == typeof t) {\n if (\"string\" == typeof e ? (i = e, e = 0, r = this.length) : \"string\" == typeof r && (i = r, r = this.length), void 0 !== i && \"string\" != typeof i) throw new TypeError(\"encoding must be a string\");\n if (\"string\" == typeof i && !s.isEncoding(i)) throw new TypeError(\"Unknown encoding: \" + i);\n if (1 === t.length) {\n var n = t.charCodeAt(0);\n (\"utf8\" === i && n < 128 || \"latin1\" === i) && (t = n);\n }\n } else \"number\" == typeof t && (t &= 255);\n if (e < 0 || this.length < e || this.length < r) throw new RangeError(\"Out of range index\");\n if (r <= e) return this;\n var a;\n if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0, t || (t = 0), \"number\" == typeof t) for (a = e; a < r; ++a) this[a] = t;else {\n var o = s.isBuffer(t) ? t : s.from(t, i),\n h = o.length;\n if (0 === h) throw new TypeError('The value \"' + t + '\" is invalid for argument \"value\"');\n for (a = 0; a < r - e; ++a) this[a + e] = o[a % h];\n }\n return this;\n };\n var U = /[^+/0-9A-Za-z-_]/g;\n function z(t, e) {\n var r;\n e = e || 1 / 0;\n for (var i = t.length, n = null, a = [], o = 0; o < i; ++o) {\n if ((r = t.charCodeAt(o)) > 55295 && r < 57344) {\n if (!n) {\n if (r > 56319) {\n (e -= 3) > -1 && a.push(239, 191, 189);\n continue;\n }\n if (o + 1 === i) {\n (e -= 3) > -1 && a.push(239, 191, 189);\n continue;\n }\n n = r;\n continue;\n }\n if (r < 56320) {\n (e -= 3) > -1 && a.push(239, 191, 189), n = r;\n continue;\n }\n r = 65536 + (n - 55296 << 10 | r - 56320);\n } else n && (e -= 3) > -1 && a.push(239, 191, 189);\n if (n = null, r < 128) {\n if ((e -= 1) < 0) break;\n a.push(r);\n } else if (r < 2048) {\n if ((e -= 2) < 0) break;\n a.push(r >> 6 | 192, 63 & r | 128);\n } else if (r < 65536) {\n if ((e -= 3) < 0) break;\n a.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128);\n } else {\n if (!(r < 1114112)) throw new Error(\"Invalid code point\");\n if ((e -= 4) < 0) break;\n a.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128);\n }\n }\n return a;\n }\n function D(t) {\n return i.toByteArray(function (t) {\n if ((t = (t = t.split(\"=\")[0]).trim().replace(U, \"\")).length < 2) return \"\";\n for (; t.length % 4 != 0;) t += \"=\";\n return t;\n }(t));\n }\n function N(t, e, r, i) {\n for (var n = 0; n < i && !(n + r >= e.length || n >= t.length); ++n) e[n + r] = t[n];\n return n;\n }\n function F(t, e) {\n return t instanceof e || null != t && null != t.constructor && null != t.constructor.name && t.constructor.name === e.name;\n }\n function j(t) {\n return t != t;\n }\n },\n 4181: (t, e) => {\n e.read = function (t, e, r, i, n) {\n var a,\n o,\n s = 8 * n - i - 1,\n h = (1 << s) - 1,\n l = h >> 1,\n f = -7,\n u = r ? n - 1 : 0,\n c = r ? -1 : 1,\n d = t[e + u];\n for (u += c, a = d & (1 << -f) - 1, d >>= -f, f += s; f > 0; a = 256 * a + t[e + u], u += c, f -= 8);\n for (o = a & (1 << -f) - 1, a >>= -f, f += i; f > 0; o = 256 * o + t[e + u], u += c, f -= 8);\n if (0 === a) a = 1 - l;else {\n if (a === h) return o ? NaN : 1 / 0 * (d ? -1 : 1);\n o += Math.pow(2, i), a -= l;\n }\n return (d ? -1 : 1) * o * Math.pow(2, a - i);\n }, e.write = function (t, e, r, i, n, a) {\n var o,\n s,\n h,\n l = 8 * a - n - 1,\n f = (1 << l) - 1,\n u = f >> 1,\n c = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0,\n d = i ? 0 : a - 1,\n p = i ? 1 : -1,\n m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;\n for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, o = f) : (o = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -o)) < 1 && (o--, h *= 2), (e += o + u >= 1 ? c / h : c * Math.pow(2, 1 - u)) * h >= 2 && (o++, h /= 2), o + u >= f ? (s = 0, o = f) : o + u >= 1 ? (s = (e * h - 1) * Math.pow(2, n), o += u) : (s = e * Math.pow(2, u - 1) * Math.pow(2, n), o = 0)); n >= 8; t[r + d] = 255 & s, d += p, s /= 256, n -= 8);\n for (o = o << n | s, l += n; l > 0; t[r + d] = 255 & o, d += p, o /= 256, l -= 8);\n t[r + d - p] |= 128 * m;\n };\n },\n 2699: t => {\n \"use strict\";\n\n var e,\n r = \"object\" == typeof Reflect ? Reflect : null,\n i = r && \"function\" == typeof r.apply ? r.apply : function (t, e, r) {\n return Function.prototype.apply.call(t, e, r);\n };\n e = r && \"function\" == typeof r.ownKeys ? r.ownKeys : Object.getOwnPropertySymbols ? function (t) {\n return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));\n } : function (t) {\n return Object.getOwnPropertyNames(t);\n };\n var n = Number.isNaN || function (t) {\n return t != t;\n };\n function a() {\n a.init.call(this);\n }\n t.exports = a, t.exports.once = function (t, e) {\n return new Promise(function (r, i) {\n function n(r) {\n t.removeListener(e, a), i(r);\n }\n function a() {\n \"function\" == typeof t.removeListener && t.removeListener(\"error\", n), r([].slice.call(arguments));\n }\n m(t, e, a, {\n once: !0\n }), \"error\" !== e && function (t, e, r) {\n \"function\" == typeof t.on && m(t, \"error\", e, {\n once: !0\n });\n }(t, n);\n });\n }, a.EventEmitter = a, a.prototype._events = void 0, a.prototype._eventsCount = 0, a.prototype._maxListeners = void 0;\n var o = 10;\n function s(t) {\n if (\"function\" != typeof t) throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof t);\n }\n function h(t) {\n return void 0 === t._maxListeners ? a.defaultMaxListeners : t._maxListeners;\n }\n function l(t, e, r, i) {\n var n, a, o, l;\n if (s(r), void 0 === (a = t._events) ? (a = t._events = Object.create(null), t._eventsCount = 0) : (void 0 !== a.newListener && (t.emit(\"newListener\", e, r.listener ? r.listener : r), a = t._events), o = a[e]), void 0 === o) o = a[e] = r, ++t._eventsCount;else if (\"function\" == typeof o ? o = a[e] = i ? [r, o] : [o, r] : i ? o.unshift(r) : o.push(r), (n = h(t)) > 0 && o.length > n && !o.warned) {\n o.warned = !0;\n var f = new Error(\"Possible EventEmitter memory leak detected. \" + o.length + \" \" + String(e) + \" listeners added. Use emitter.setMaxListeners() to increase limit\");\n f.name = \"MaxListenersExceededWarning\", f.emitter = t, f.type = e, f.count = o.length, l = f, console && console.warn && console.warn(l);\n }\n return t;\n }\n function f() {\n if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);\n }\n function u(t, e, r) {\n var i = {\n fired: !1,\n wrapFn: void 0,\n target: t,\n type: e,\n listener: r\n },\n n = f.bind(i);\n return n.listener = r, i.wrapFn = n, n;\n }\n function c(t, e, r) {\n var i = t._events;\n if (void 0 === i) return [];\n var n = i[e];\n return void 0 === n ? [] : \"function\" == typeof n ? r ? [n.listener || n] : [n] : r ? function (t) {\n for (var e = new Array(t.length), r = 0; r < e.length; ++r) e[r] = t[r].listener || t[r];\n return e;\n }(n) : p(n, n.length);\n }\n function d(t) {\n var e = this._events;\n if (void 0 !== e) {\n var r = e[t];\n if (\"function\" == typeof r) return 1;\n if (void 0 !== r) return r.length;\n }\n return 0;\n }\n function p(t, e) {\n for (var r = new Array(e), i = 0; i < e; ++i) r[i] = t[i];\n return r;\n }\n function m(t, e, r, i) {\n if (\"function\" == typeof t.on) i.once ? t.once(e, r) : t.on(e, r);else {\n if (\"function\" != typeof t.addEventListener) throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof t);\n t.addEventListener(e, function n(a) {\n i.once && t.removeEventListener(e, n), r(a);\n });\n }\n }\n Object.defineProperty(a, \"defaultMaxListeners\", {\n enumerable: !0,\n get: function () {\n return o;\n },\n set: function (t) {\n if (\"number\" != typeof t || t < 0 || n(t)) throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + t + \".\");\n o = t;\n }\n }), a.init = function () {\n void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;\n }, a.prototype.setMaxListeners = function (t) {\n if (\"number\" != typeof t || t < 0 || n(t)) throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + t + \".\");\n return this._maxListeners = t, this;\n }, a.prototype.getMaxListeners = function () {\n return h(this);\n }, a.prototype.emit = function (t) {\n for (var e = [], r = 1; r < arguments.length; r++) e.push(arguments[r]);\n var n = \"error\" === t,\n a = this._events;\n if (void 0 !== a) n = n && void 0 === a.error;else if (!n) return !1;\n if (n) {\n var o;\n if (e.length > 0 && (o = e[0]), o instanceof Error) throw o;\n var s = new Error(\"Unhandled error.\" + (o ? \" (\" + o.message + \")\" : \"\"));\n throw s.context = o, s;\n }\n var h = a[t];\n if (void 0 === h) return !1;\n if (\"function\" == typeof h) i(h, this, e);else {\n var l = h.length,\n f = p(h, l);\n for (r = 0; r < l; ++r) i(f[r], this, e);\n }\n return !0;\n }, a.prototype.addListener = function (t, e) {\n return l(this, t, e, !1);\n }, a.prototype.on = a.prototype.addListener, a.prototype.prependListener = function (t, e) {\n return l(this, t, e, !0);\n }, a.prototype.once = function (t, e) {\n return s(e), this.on(t, u(this, t, e)), this;\n }, a.prototype.prependOnceListener = function (t, e) {\n return s(e), this.prependListener(t, u(this, t, e)), this;\n }, a.prototype.removeListener = function (t, e) {\n var r, i, n, a, o;\n if (s(e), void 0 === (i = this._events)) return this;\n if (void 0 === (r = i[t])) return this;\n if (r === e || r.listener === e) 0 == --this._eventsCount ? this._events = Object.create(null) : (delete i[t], i.removeListener && this.emit(\"removeListener\", t, r.listener || e));else if (\"function\" != typeof r) {\n for (n = -1, a = r.length - 1; a >= 0; a--) if (r[a] === e || r[a].listener === e) {\n o = r[a].listener, n = a;\n break;\n }\n if (n < 0) return this;\n 0 === n ? r.shift() : function (t, e) {\n for (; e + 1 < t.length; e++) t[e] = t[e + 1];\n t.pop();\n }(r, n), 1 === r.length && (i[t] = r[0]), void 0 !== i.removeListener && this.emit(\"removeListener\", t, o || e);\n }\n return this;\n }, a.prototype.off = a.prototype.removeListener, a.prototype.removeAllListeners = function (t) {\n var e, r, i;\n if (void 0 === (r = this._events)) return this;\n if (void 0 === r.removeListener) return 0 === arguments.length ? (this._events = Object.create(null), this._eventsCount = 0) : void 0 !== r[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete r[t]), this;\n if (0 === arguments.length) {\n var n,\n a = Object.keys(r);\n for (i = 0; i < a.length; ++i) \"removeListener\" !== (n = a[i]) && this.removeAllListeners(n);\n return this.removeAllListeners(\"removeListener\"), this._events = Object.create(null), this._eventsCount = 0, this;\n }\n if (\"function\" == typeof (e = r[t])) this.removeListener(t, e);else if (void 0 !== e) for (i = e.length - 1; i >= 0; i--) this.removeListener(t, e[i]);\n return this;\n }, a.prototype.listeners = function (t) {\n return c(this, t, !0);\n }, a.prototype.rawListeners = function (t) {\n return c(this, t, !1);\n }, a.listenerCount = function (t, e) {\n return \"function\" == typeof t.listenerCount ? t.listenerCount(e) : d.call(t, e);\n }, a.prototype.listenerCount = d, a.prototype.eventNames = function () {\n return this._eventsCount > 0 ? e(this._events) : [];\n };\n },\n 6551: (t, e, r) => {\n var i = r(453);\n t.exports = {\n create: function (t, e) {\n if (t instanceof (e = e || (0, eval)(\"this\")).ArrayBuffer) {\n var n = r(909);\n return new i(new n(t, 0, t.byteLength, !0, e));\n }\n var a = r(3684);\n return new i(new a(t, 0, t.length, !0));\n }\n };\n },\n 3684: t => {\n function e(t, e, r, i) {\n this.buffer = t, this.offset = e || 0, r = \"number\" == typeof r ? r : t.length, this.endPosition = this.offset + r, this.setBigEndian(i);\n }\n e.prototype = {\n setBigEndian: function (t) {\n this.bigEndian = !!t;\n },\n nextUInt8: function () {\n var t = this.buffer.readUInt8(this.offset);\n return this.offset += 1, t;\n },\n nextInt8: function () {\n var t = this.buffer.readInt8(this.offset);\n return this.offset += 1, t;\n },\n nextUInt16: function () {\n var t = this.bigEndian ? this.buffer.readUInt16BE(this.offset) : this.buffer.readUInt16LE(this.offset);\n return this.offset += 2, t;\n },\n nextUInt32: function () {\n var t = this.bigEndian ? this.buffer.readUInt32BE(this.offset) : this.buffer.readUInt32LE(this.offset);\n return this.offset += 4, t;\n },\n nextInt16: function () {\n var t = this.bigEndian ? this.buffer.readInt16BE(this.offset) : this.buffer.readInt16LE(this.offset);\n return this.offset += 2, t;\n },\n nextInt32: function () {\n var t = this.bigEndian ? this.buffer.readInt32BE(this.offset) : this.buffer.readInt32LE(this.offset);\n return this.offset += 4, t;\n },\n nextFloat: function () {\n var t = this.bigEndian ? this.buffer.readFloatBE(this.offset) : this.buffer.readFloatLE(this.offset);\n return this.offset += 4, t;\n },\n nextDouble: function () {\n var t = this.bigEndian ? this.buffer.readDoubleBE(this.offset) : this.buffer.readDoubleLE(this.offset);\n return this.offset += 8, t;\n },\n nextBuffer: function (t) {\n var e = this.buffer.slice(this.offset, this.offset + t);\n return this.offset += t, e;\n },\n remainingLength: function () {\n return this.endPosition - this.offset;\n },\n nextString: function (t) {\n var e = this.buffer.toString(\"utf8\", this.offset, this.offset + t);\n return this.offset += t, e;\n },\n mark: function () {\n var t = this;\n return {\n openWithOffset: function (r) {\n return r = (r || 0) + this.offset, new e(t.buffer, r, t.endPosition - r, t.bigEndian);\n },\n offset: this.offset\n };\n },\n offsetFrom: function (t) {\n return this.offset - t.offset;\n },\n skip: function (t) {\n this.offset += t;\n },\n branch: function (t, r) {\n return r = \"number\" == typeof r ? r : this.endPosition - (this.offset + t), new e(this.buffer, this.offset + t, r, this.bigEndian);\n }\n }, t.exports = e;\n },\n 565: t => {\n function e(t) {\n return parseInt(t, 10);\n }\n var r = 3600,\n i = 60;\n function n(t, r) {\n t = t.map(e), r = r.map(e);\n var i = t[0],\n n = t[1] - 1,\n a = t[2],\n o = r[0],\n s = r[1],\n h = r[2];\n return Date.UTC(i, n, a, o, s, h, 0) / 1e3;\n }\n function a(t) {\n var a = t.substr(0, 10).split(\"-\"),\n o = t.substr(11, 8).split(\":\"),\n s = t.substr(19, 6).split(\":\").map(e),\n h = s[0] * r + s[1] * i,\n l = n(a, o);\n if (\"number\" == typeof (l -= h) && !isNaN(l)) return l;\n }\n function o(t) {\n var e = t.split(\" \"),\n r = n(e[0].split(\":\"), e[1].split(\":\"));\n if (\"number\" == typeof r && !isNaN(r)) return r;\n }\n t.exports = {\n parseDateWithSpecFormat: o,\n parseDateWithTimezoneFormat: a,\n parseExifDate: function (t) {\n var e = 19 === t.length && \":\" === t.charAt(4);\n return 25 === t.length && \"T\" === t.charAt(10) ? a(t) : e ? o(t) : void 0;\n }\n };\n },\n 909: t => {\n function e(t, e, r, i, n, a) {\n this.global = n, e = e || 0, r = r || t.byteLength - e, this.arrayBuffer = t.slice(e, e + r), this.view = new n.DataView(this.arrayBuffer, 0, this.arrayBuffer.byteLength), this.setBigEndian(i), this.offset = 0, this.parentOffset = (a || 0) + e;\n }\n e.prototype = {\n setBigEndian: function (t) {\n this.littleEndian = !t;\n },\n nextUInt8: function () {\n var t = this.view.getUint8(this.offset);\n return this.offset += 1, t;\n },\n nextInt8: function () {\n var t = this.view.getInt8(this.offset);\n return this.offset += 1, t;\n },\n nextUInt16: function () {\n var t = this.view.getUint16(this.offset, this.littleEndian);\n return this.offset += 2, t;\n },\n nextUInt32: function () {\n var t = this.view.getUint32(this.offset, this.littleEndian);\n return this.offset += 4, t;\n },\n nextInt16: function () {\n var t = this.view.getInt16(this.offset, this.littleEndian);\n return this.offset += 2, t;\n },\n nextInt32: function () {\n var t = this.view.getInt32(this.offset, this.littleEndian);\n return this.offset += 4, t;\n },\n nextFloat: function () {\n var t = this.view.getFloat32(this.offset, this.littleEndian);\n return this.offset += 4, t;\n },\n nextDouble: function () {\n var t = this.view.getFloat64(this.offset, this.littleEndian);\n return this.offset += 8, t;\n },\n nextBuffer: function (t) {\n var e = this.arrayBuffer.slice(this.offset, this.offset + t);\n return this.offset += t, e;\n },\n remainingLength: function () {\n return this.arrayBuffer.byteLength - this.offset;\n },\n nextString: function (t) {\n var e = this.arrayBuffer.slice(this.offset, this.offset + t);\n return e = String.fromCharCode.apply(null, new this.global.Uint8Array(e)), this.offset += t, e;\n },\n mark: function () {\n var t = this;\n return {\n openWithOffset: function (r) {\n return r = (r || 0) + this.offset, new e(t.arrayBuffer, r, t.arrayBuffer.byteLength - r, !t.littleEndian, t.global, t.parentOffset);\n },\n offset: this.offset,\n getParentOffset: function () {\n return t.parentOffset;\n }\n };\n },\n offsetFrom: function (t) {\n return this.parentOffset + this.offset - (t.offset + t.getParentOffset());\n },\n skip: function (t) {\n this.offset += t;\n },\n branch: function (t, r) {\n return r = \"number\" == typeof r ? r : this.arrayBuffer.byteLength - (this.offset + t), new e(this.arrayBuffer, this.offset + t, r, !this.littleEndian, this.global, this.parentOffset);\n }\n }, t.exports = e;\n },\n 3332: t => {\n t.exports = {\n exif: {\n 1: \"InteropIndex\",\n 2: \"InteropVersion\",\n 11: \"ProcessingSoftware\",\n 254: \"SubfileType\",\n 255: \"OldSubfileType\",\n 256: \"ImageWidth\",\n 257: \"ImageHeight\",\n 258: \"BitsPerSample\",\n 259: \"Compression\",\n 262: \"PhotometricInterpretation\",\n 263: \"Thresholding\",\n 264: \"CellWidth\",\n 265: \"CellLength\",\n 266: \"FillOrder\",\n 269: \"DocumentName\",\n 270: \"ImageDescription\",\n 271: \"Make\",\n 272: \"Model\",\n 273: \"StripOffsets\",\n 274: \"Orientation\",\n 277: \"SamplesPerPixel\",\n 278: \"RowsPerStrip\",\n 279: \"StripByteCounts\",\n 280: \"MinSampleValue\",\n 281: \"MaxSampleValue\",\n 282: \"XResolution\",\n 283: \"YResolution\",\n 284: \"PlanarConfiguration\",\n 285: \"PageName\",\n 286: \"XPosition\",\n 287: \"YPosition\",\n 288: \"FreeOffsets\",\n 289: \"FreeByteCounts\",\n 290: \"GrayResponseUnit\",\n 291: \"GrayResponseCurve\",\n 292: \"T4Options\",\n 293: \"T6Options\",\n 296: \"ResolutionUnit\",\n 297: \"PageNumber\",\n 300: \"ColorResponseUnit\",\n 301: \"TransferFunction\",\n 305: \"Software\",\n 306: \"ModifyDate\",\n 315: \"Artist\",\n 316: \"HostComputer\",\n 317: \"Predictor\",\n 318: \"WhitePoint\",\n 319: \"PrimaryChromaticities\",\n 320: \"ColorMap\",\n 321: \"HalftoneHints\",\n 322: \"TileWidth\",\n 323: \"TileLength\",\n 324: \"TileOffsets\",\n 325: \"TileByteCounts\",\n 326: \"BadFaxLines\",\n 327: \"CleanFaxData\",\n 328: \"ConsecutiveBadFaxLines\",\n 330: \"SubIFD\",\n 332: \"InkSet\",\n 333: \"InkNames\",\n 334: \"NumberofInks\",\n 336: \"DotRange\",\n 337: \"TargetPrinter\",\n 338: \"ExtraSamples\",\n 339: \"SampleFormat\",\n 340: \"SMinSampleValue\",\n 341: \"SMaxSampleValue\",\n 342: \"TransferRange\",\n 343: \"ClipPath\",\n 344: \"XClipPathUnits\",\n 345: \"YClipPathUnits\",\n 346: \"Indexed\",\n 347: \"JPEGTables\",\n 351: \"OPIProxy\",\n 400: \"GlobalParametersIFD\",\n 401: \"ProfileType\",\n 402: \"FaxProfile\",\n 403: \"CodingMethods\",\n 404: \"VersionYear\",\n 405: \"ModeNumber\",\n 433: \"Decode\",\n 434: \"DefaultImageColor\",\n 435: \"T82Options\",\n 437: \"JPEGTables\",\n 512: \"JPEGProc\",\n 513: \"ThumbnailOffset\",\n 514: \"ThumbnailLength\",\n 515: \"JPEGRestartInterval\",\n 517: \"JPEGLosslessPredictors\",\n 518: \"JPEGPointTransforms\",\n 519: \"JPEGQTables\",\n 520: \"JPEGDCTables\",\n 521: \"JPEGACTables\",\n 529: \"YCbCrCoefficients\",\n 530: \"YCbCrSubSampling\",\n 531: \"YCbCrPositioning\",\n 532: \"ReferenceBlackWhite\",\n 559: \"StripRowCounts\",\n 700: \"ApplicationNotes\",\n 999: \"USPTOMiscellaneous\",\n 4096: \"RelatedImageFileFormat\",\n 4097: \"RelatedImageWidth\",\n 4098: \"RelatedImageHeight\",\n 18246: \"Rating\",\n 18247: \"XP_DIP_XML\",\n 18248: \"StitchInfo\",\n 18249: \"RatingPercent\",\n 32781: \"ImageID\",\n 32931: \"WangTag1\",\n 32932: \"WangAnnotation\",\n 32933: \"WangTag3\",\n 32934: \"WangTag4\",\n 32995: \"Matteing\",\n 32996: \"DataType\",\n 32997: \"ImageDepth\",\n 32998: \"TileDepth\",\n 33405: \"Model2\",\n 33421: \"CFARepeatPatternDim\",\n 33422: \"CFAPattern2\",\n 33423: \"BatteryLevel\",\n 33424: \"KodakIFD\",\n 33432: \"Copyright\",\n 33434: \"ExposureTime\",\n 33437: \"FNumber\",\n 33445: \"MDFileTag\",\n 33446: \"MDScalePixel\",\n 33447: \"MDColorTable\",\n 33448: \"MDLabName\",\n 33449: \"MDSampleInfo\",\n 33450: \"MDPrepDate\",\n 33451: \"MDPrepTime\",\n 33452: \"MDFileUnits\",\n 33550: \"PixelScale\",\n 33589: \"AdventScale\",\n 33590: \"AdventRevision\",\n 33628: \"UIC1Tag\",\n 33629: \"UIC2Tag\",\n 33630: \"UIC3Tag\",\n 33631: \"UIC4Tag\",\n 33723: \"IPTC-NAA\",\n 33918: \"IntergraphPacketData\",\n 33919: \"IntergraphFlagRegisters\",\n 33920: \"IntergraphMatrix\",\n 33921: \"INGRReserved\",\n 33922: \"ModelTiePoint\",\n 34016: \"Site\",\n 34017: \"ColorSequence\",\n 34018: \"IT8Header\",\n 34019: \"RasterPadding\",\n 34020: \"BitsPerRunLength\",\n 34021: \"BitsPerExtendedRunLength\",\n 34022: \"ColorTable\",\n 34023: \"ImageColorIndicator\",\n 34024: \"BackgroundColorIndicator\",\n 34025: \"ImageColorValue\",\n 34026: \"BackgroundColorValue\",\n 34027: \"PixelIntensityRange\",\n 34028: \"TransparencyIndicator\",\n 34029: \"ColorCharacterization\",\n 34030: \"HCUsage\",\n 34031: \"TrapIndicator\",\n 34032: \"CMYKEquivalent\",\n 34118: \"SEMInfo\",\n 34152: \"AFCP_IPTC\",\n 34232: \"PixelMagicJBIGOptions\",\n 34264: \"ModelTransform\",\n 34306: \"WB_GRGBLevels\",\n 34310: \"LeafData\",\n 34377: \"PhotoshopSettings\",\n 34665: \"ExifOffset\",\n 34675: \"ICC_Profile\",\n 34687: \"TIFF_FXExtensions\",\n 34688: \"MultiProfiles\",\n 34689: \"SharedData\",\n 34690: \"T88Options\",\n 34732: \"ImageLayer\",\n 34735: \"GeoTiffDirectory\",\n 34736: \"GeoTiffDoubleParams\",\n 34737: \"GeoTiffAsciiParams\",\n 34850: \"ExposureProgram\",\n 34852: \"SpectralSensitivity\",\n 34853: \"GPSInfo\",\n 34855: \"ISO\",\n 34856: \"Opto-ElectricConvFactor\",\n 34857: \"Interlace\",\n 34858: \"TimeZoneOffset\",\n 34859: \"SelfTimerMode\",\n 34864: \"SensitivityType\",\n 34865: \"StandardOutputSensitivity\",\n 34866: \"RecommendedExposureIndex\",\n 34867: \"ISOSpeed\",\n 34868: \"ISOSpeedLatitudeyyy\",\n 34869: \"ISOSpeedLatitudezzz\",\n 34908: \"FaxRecvParams\",\n 34909: \"FaxSubAddress\",\n 34910: \"FaxRecvTime\",\n 34954: \"LeafSubIFD\",\n 36864: \"ExifVersion\",\n 36867: \"DateTimeOriginal\",\n 36868: \"CreateDate\",\n 37121: \"ComponentsConfiguration\",\n 37122: \"CompressedBitsPerPixel\",\n 37377: \"ShutterSpeedValue\",\n 37378: \"ApertureValue\",\n 37379: \"BrightnessValue\",\n 37380: \"ExposureCompensation\",\n 37381: \"MaxApertureValue\",\n 37382: \"SubjectDistance\",\n 37383: \"MeteringMode\",\n 37384: \"LightSource\",\n 37385: \"Flash\",\n 37386: \"FocalLength\",\n 37387: \"FlashEnergy\",\n 37388: \"SpatialFrequencyResponse\",\n 37389: \"Noise\",\n 37390: \"FocalPlaneXResolution\",\n 37391: \"FocalPlaneYResolution\",\n 37392: \"FocalPlaneResolutionUnit\",\n 37393: \"ImageNumber\",\n 37394: \"SecurityClassification\",\n 37395: \"ImageHistory\",\n 37396: \"SubjectArea\",\n 37397: \"ExposureIndex\",\n 37398: \"TIFF-EPStandardID\",\n 37399: \"SensingMethod\",\n 37434: \"CIP3DataFile\",\n 37435: \"CIP3Sheet\",\n 37436: \"CIP3Side\",\n 37439: \"StoNits\",\n 37500: \"MakerNote\",\n 37510: \"UserComment\",\n 37520: \"SubSecTime\",\n 37521: \"SubSecTimeOriginal\",\n 37522: \"SubSecTimeDigitized\",\n 37679: \"MSDocumentText\",\n 37680: \"MSPropertySetStorage\",\n 37681: \"MSDocumentTextPosition\",\n 37724: \"ImageSourceData\",\n 40091: \"XPTitle\",\n 40092: \"XPComment\",\n 40093: \"XPAuthor\",\n 40094: \"XPKeywords\",\n 40095: \"XPSubject\",\n 40960: \"FlashpixVersion\",\n 40961: \"ColorSpace\",\n 40962: \"ExifImageWidth\",\n 40963: \"ExifImageHeight\",\n 40964: \"RelatedSoundFile\",\n 40965: \"InteropOffset\",\n 41483: \"FlashEnergy\",\n 41484: \"SpatialFrequencyResponse\",\n 41485: \"Noise\",\n 41486: \"FocalPlaneXResolution\",\n 41487: \"FocalPlaneYResolution\",\n 41488: \"FocalPlaneResolutionUnit\",\n 41489: \"ImageNumber\",\n 41490: \"SecurityClassification\",\n 41491: \"ImageHistory\",\n 41492: \"SubjectLocation\",\n 41493: \"ExposureIndex\",\n 41494: \"TIFF-EPStandardID\",\n 41495: \"SensingMethod\",\n 41728: \"FileSource\",\n 41729: \"SceneType\",\n 41730: \"CFAPattern\",\n 41985: \"CustomRendered\",\n 41986: \"ExposureMode\",\n 41987: \"WhiteBalance\",\n 41988: \"DigitalZoomRatio\",\n 41989: \"FocalLengthIn35mmFormat\",\n 41990: \"SceneCaptureType\",\n 41991: \"GainControl\",\n 41992: \"Contrast\",\n 41993: \"Saturation\",\n 41994: \"Sharpness\",\n 41995: \"DeviceSettingDescription\",\n 41996: \"SubjectDistanceRange\",\n 42016: \"ImageUniqueID\",\n 42032: \"OwnerName\",\n 42033: \"SerialNumber\",\n 42034: \"LensInfo\",\n 42035: \"LensMake\",\n 42036: \"LensModel\",\n 42037: \"LensSerialNumber\",\n 42112: \"GDALMetadata\",\n 42113: \"GDALNoData\",\n 42240: \"Gamma\",\n 44992: \"ExpandSoftware\",\n 44993: \"ExpandLens\",\n 44994: \"ExpandFilm\",\n 44995: \"ExpandFilterLens\",\n 44996: \"ExpandScanner\",\n 44997: \"ExpandFlashLamp\",\n 48129: \"PixelFormat\",\n 48130: \"Transformation\",\n 48131: \"Uncompressed\",\n 48132: \"ImageType\",\n 48256: \"ImageWidth\",\n 48257: \"ImageHeight\",\n 48258: \"WidthResolution\",\n 48259: \"HeightResolution\",\n 48320: \"ImageOffset\",\n 48321: \"ImageByteCount\",\n 48322: \"AlphaOffset\",\n 48323: \"AlphaByteCount\",\n 48324: \"ImageDataDiscard\",\n 48325: \"AlphaDataDiscard\",\n 50215: \"OceScanjobDesc\",\n 50216: \"OceApplicationSelector\",\n 50217: \"OceIDNumber\",\n 50218: \"OceImageLogic\",\n 50255: \"Annotations\",\n 50341: \"PrintIM\",\n 50560: \"USPTOOriginalContentType\",\n 50706: \"DNGVersion\",\n 50707: \"DNGBackwardVersion\",\n 50708: \"UniqueCameraModel\",\n 50709: \"LocalizedCameraModel\",\n 50710: \"CFAPlaneColor\",\n 50711: \"CFALayout\",\n 50712: \"LinearizationTable\",\n 50713: \"BlackLevelRepeatDim\",\n 50714: \"BlackLevel\",\n 50715: \"BlackLevelDeltaH\",\n 50716: \"BlackLevelDeltaV\",\n 50717: \"WhiteLevel\",\n 50718: \"DefaultScale\",\n 50719: \"DefaultCropOrigin\",\n 50720: \"DefaultCropSize\",\n 50721: \"ColorMatrix1\",\n 50722: \"ColorMatrix2\",\n 50723: \"CameraCalibration1\",\n 50724: \"CameraCalibration2\",\n 50725: \"ReductionMatrix1\",\n 50726: \"ReductionMatrix2\",\n 50727: \"AnalogBalance\",\n 50728: \"AsShotNeutral\",\n 50729: \"AsShotWhiteXY\",\n 50730: \"BaselineExposure\",\n 50731: \"BaselineNoise\",\n 50732: \"BaselineSharpness\",\n 50733: \"BayerGreenSplit\",\n 50734: \"LinearResponseLimit\",\n 50735: \"CameraSerialNumber\",\n 50736: \"DNGLensInfo\",\n 50737: \"ChromaBlurRadius\",\n 50738: \"AntiAliasStrength\",\n 50739: \"ShadowScale\",\n 50740: \"DNGPrivateData\",\n 50741: \"MakerNoteSafety\",\n 50752: \"RawImageSegmentation\",\n 50778: \"CalibrationIlluminant1\",\n 50779: \"CalibrationIlluminant2\",\n 50780: \"BestQualityScale\",\n 50781: \"RawDataUniqueID\",\n 50784: \"AliasLayerMetadata\",\n 50827: \"OriginalRawFileName\",\n 50828: \"OriginalRawFileData\",\n 50829: \"ActiveArea\",\n 50830: \"MaskedAreas\",\n 50831: \"AsShotICCProfile\",\n 50832: \"AsShotPreProfileMatrix\",\n 50833: \"CurrentICCProfile\",\n 50834: \"CurrentPreProfileMatrix\",\n 50879: \"ColorimetricReference\",\n 50898: \"PanasonicTitle\",\n 50899: \"PanasonicTitle2\",\n 50931: \"CameraCalibrationSig\",\n 50932: \"ProfileCalibrationSig\",\n 50933: \"ProfileIFD\",\n 50934: \"AsShotProfileName\",\n 50935: \"NoiseReductionApplied\",\n 50936: \"ProfileName\",\n 50937: \"ProfileHueSatMapDims\",\n 50938: \"ProfileHueSatMapData1\",\n 50939: \"ProfileHueSatMapData2\",\n 50940: \"ProfileToneCurve\",\n 50941: \"ProfileEmbedPolicy\",\n 50942: \"ProfileCopyright\",\n 50964: \"ForwardMatrix1\",\n 50965: \"ForwardMatrix2\",\n 50966: \"PreviewApplicationName\",\n 50967: \"PreviewApplicationVersion\",\n 50968: \"PreviewSettingsName\",\n 50969: \"PreviewSettingsDigest\",\n 50970: \"PreviewColorSpace\",\n 50971: \"PreviewDateTime\",\n 50972: \"RawImageDigest\",\n 50973: \"OriginalRawFileDigest\",\n 50974: \"SubTileBlockSize\",\n 50975: \"RowInterleaveFactor\",\n 50981: \"ProfileLookTableDims\",\n 50982: \"ProfileLookTableData\",\n 51008: \"OpcodeList1\",\n 51009: \"OpcodeList2\",\n 51022: \"OpcodeList3\",\n 51041: \"NoiseProfile\",\n 51043: \"TimeCodes\",\n 51044: \"FrameRate\",\n 51058: \"TStop\",\n 51081: \"ReelName\",\n 51089: \"OriginalDefaultFinalSize\",\n 51090: \"OriginalBestQualitySize\",\n 51091: \"OriginalDefaultCropSize\",\n 51105: \"CameraLabel\",\n 51107: \"ProfileHueSatMapEncoding\",\n 51108: \"ProfileLookTableEncoding\",\n 51109: \"BaselineExposureOffset\",\n 51110: \"DefaultBlackRender\",\n 51111: \"NewRawImageDigest\",\n 51112: \"RawToPreviewGain\",\n 51125: \"DefaultUserCrop\",\n 59932: \"Padding\",\n 59933: \"OffsetSchema\",\n 65e3: \"OwnerName\",\n 65001: \"SerialNumber\",\n 65002: \"Lens\",\n 65024: \"KDC_IFD\",\n 65100: \"RawFile\",\n 65101: \"Converter\",\n 65102: \"WhiteBalance\",\n 65105: \"Exposure\",\n 65106: \"Shadows\",\n 65107: \"Brightness\",\n 65108: \"Contrast\",\n 65109: \"Saturation\",\n 65110: \"Sharpness\",\n 65111: \"Smoothness\",\n 65112: \"MoireFilter\"\n },\n gps: {\n 0: \"GPSVersionID\",\n 1: \"GPSLatitudeRef\",\n 2: \"GPSLatitude\",\n 3: \"GPSLongitudeRef\",\n 4: \"GPSLongitude\",\n 5: \"GPSAltitudeRef\",\n 6: \"GPSAltitude\",\n 7: \"GPSTimeStamp\",\n 8: \"GPSSatellites\",\n 9: \"GPSStatus\",\n 10: \"GPSMeasureMode\",\n 11: \"GPSDOP\",\n 12: \"GPSSpeedRef\",\n 13: \"GPSSpeed\",\n 14: \"GPSTrackRef\",\n 15: \"GPSTrack\",\n 16: \"GPSImgDirectionRef\",\n 17: \"GPSImgDirection\",\n 18: \"GPSMapDatum\",\n 19: \"GPSDestLatitudeRef\",\n 20: \"GPSDestLatitude\",\n 21: \"GPSDestLongitudeRef\",\n 22: \"GPSDestLongitude\",\n 23: \"GPSDestBearingRef\",\n 24: \"GPSDestBearing\",\n 25: \"GPSDestDistanceRef\",\n 26: \"GPSDestDistance\",\n 27: \"GPSProcessingMethod\",\n 28: \"GPSAreaInformation\",\n 29: \"GPSDateStamp\",\n 30: \"GPSDifferential\",\n 31: \"GPSHPositioningError\"\n }\n };\n },\n 592: t => {\n function e(t, e) {\n switch (t) {\n case 1:\n return e.nextUInt8();\n case 3:\n case 8:\n return e.nextUInt16();\n case 4:\n case 9:\n return e.nextUInt32();\n case 5:\n return [e.nextUInt32(), e.nextUInt32()];\n case 6:\n return e.nextInt8();\n case 10:\n return [e.nextInt32(), e.nextInt32()];\n case 11:\n return e.nextFloat();\n case 12:\n return e.nextDouble();\n default:\n throw new Error(\"Invalid format while decoding: \" + t);\n }\n }\n function r(t, r) {\n var i,\n n,\n a = r.nextUInt16(),\n o = r.nextUInt16(),\n s = function (t) {\n switch (t) {\n case 1:\n case 2:\n case 6:\n case 7:\n return 1;\n case 3:\n case 8:\n return 2;\n case 4:\n case 9:\n case 11:\n return 4;\n case 5:\n case 10:\n case 12:\n return 8;\n default:\n return 0;\n }\n }(o),\n h = r.nextUInt32(),\n l = s * h;\n if (l > 4 && (r = t.openWithOffset(r.nextUInt32())), 2 === o) {\n var f = (i = r.nextString(h)).indexOf(\"\\0\");\n -1 !== f && (i = i.substr(0, f));\n } else if (7 === o) i = r.nextBuffer(h);else if (0 !== o) for (i = [], n = 0; n < h; ++n) i.push(e(o, r));\n return l < 4 && r.skip(4 - l), [a, i, o];\n }\n function i(t, e, i) {\n var n,\n a,\n o = e.nextUInt16();\n for (a = 0; a < o; ++a) i((n = r(t, e))[0], n[1], n[2]);\n }\n t.exports = {\n IFD0: 1,\n IFD1: 2,\n GPSIFD: 3,\n SubIFD: 4,\n InteropIFD: 5,\n parseTags: function (t, e) {\n var r, n, a, o;\n try {\n r = function (t) {\n if (\"Exif\\0\\0\" !== t.nextString(6)) throw new Error(\"Invalid EXIF header\");\n var e = t.mark(),\n r = t.nextUInt16();\n if (18761 === r) t.setBigEndian(!1);else {\n if (19789 !== r) throw new Error(\"Invalid TIFF header\");\n t.setBigEndian(!0);\n }\n if (42 !== t.nextUInt16()) throw new Error(\"Invalid TIFF data\");\n return e;\n }(t);\n } catch (t) {\n return !1;\n }\n var s = r.openWithOffset(t.nextUInt32()),\n h = this.IFD0;\n i(r, s, function (t, r, i) {\n switch (t) {\n case 34853:\n a = r[0];\n break;\n case 34665:\n n = r[0];\n break;\n default:\n e(h, t, r, i);\n }\n });\n var l = s.nextUInt32();\n if (0 !== l) {\n var f = r.openWithOffset(l);\n i(r, f, e.bind(null, this.IFD1));\n }\n if (a) {\n var u = r.openWithOffset(a);\n i(r, u, e.bind(null, this.GPSIFD));\n }\n if (n) {\n var c = r.openWithOffset(n),\n d = this.InteropIFD;\n i(r, c, function (t, r, i) {\n 40965 === t ? o = r[0] : e(d, t, r, i);\n });\n }\n if (o) {\n var p = r.openWithOffset(o);\n i(r, p, e.bind(null, this.InteropIFD));\n }\n return !0;\n }\n };\n },\n 656: t => {\n t.exports = {\n parseSections: function (t, e) {\n var r, i;\n for (t.setBigEndian(!0); t.remainingLength() > 0 && 218 !== i;) {\n if (255 !== t.nextUInt8()) throw new Error(\"Invalid JPEG section offset\");\n r = (i = t.nextUInt8()) >= 208 && i <= 217 || 218 === i ? 0 : t.nextUInt16() - 2, e(i, t.branch(0, r)), t.skip(r);\n }\n },\n getSizeFromSOFSection: function (t) {\n return t.skip(1), {\n height: t.nextUInt16(),\n width: t.nextUInt16()\n };\n },\n getSectionName: function (t) {\n var e, r;\n switch (t) {\n case 216:\n e = \"SOI\";\n break;\n case 196:\n e = \"DHT\";\n break;\n case 219:\n e = \"DQT\";\n break;\n case 221:\n e = \"DRI\";\n break;\n case 218:\n e = \"SOS\";\n break;\n case 254:\n e = \"COM\";\n break;\n case 217:\n e = \"EOI\";\n break;\n default:\n t >= 224 && t <= 239 ? (e = \"APP\", r = t - 224) : t >= 192 && t <= 207 && 196 !== t && 200 !== t && 204 !== t ? (e = \"SOF\", r = t - 192) : t >= 208 && t <= 215 && (e = \"RST\", r = t - 208);\n }\n var i = {\n name: e\n };\n return \"number\" == typeof r && (i.index = r), i;\n }\n };\n },\n 453: (t, e, r) => {\n var i = r(656),\n n = r(592),\n a = r(3814);\n function o(t, e, r, i, n, a, o) {\n this.startMarker = t, this.tags = e, this.imageSize = r, this.thumbnailOffset = i, this.thumbnailLength = n, this.thumbnailType = a, this.app1Offset = o;\n }\n function s(t) {\n this.stream = t, this.flags = {\n readBinaryTags: !1,\n resolveTagNames: !0,\n simplifyValues: !0,\n imageSize: !0,\n hidePointers: !0,\n returnTags: !0\n };\n }\n o.prototype = {\n hasThumbnail: function (t) {\n return !(!this.thumbnailOffset || !this.thumbnailLength || \"string\" == typeof t && (\"image/jpeg\" === t.toLowerCase().trim() ? 6 !== this.thumbnailType : \"image/tiff\" !== t.toLowerCase().trim() || 1 !== this.thumbnailType));\n },\n getThumbnailOffset: function () {\n return this.app1Offset + 6 + this.thumbnailOffset;\n },\n getThumbnailLength: function () {\n return this.thumbnailLength;\n },\n getThumbnailBuffer: function () {\n return this._getThumbnailStream().nextBuffer(this.thumbnailLength);\n },\n _getThumbnailStream: function () {\n return this.startMarker.openWithOffset(this.getThumbnailOffset());\n },\n getImageSize: function () {\n return this.imageSize;\n },\n getThumbnailSize: function () {\n var t,\n e = this._getThumbnailStream();\n return i.parseSections(e, function (e, r) {\n \"SOF\" === i.getSectionName(e).name && (t = i.getSizeFromSOFSection(r));\n }), t;\n }\n }, s.prototype = {\n enableBinaryFields: function (t) {\n return this.flags.readBinaryTags = !!t, this;\n },\n enablePointers: function (t) {\n return this.flags.hidePointers = !t, this;\n },\n enableTagNames: function (t) {\n return this.flags.resolveTagNames = !!t, this;\n },\n enableImageSize: function (t) {\n return this.flags.imageSize = !!t, this;\n },\n enableReturnTags: function (t) {\n return this.flags.returnTags = !!t, this;\n },\n enableSimpleValues: function (t) {\n return this.flags.simplifyValues = !!t, this;\n },\n parse: function () {\n var t,\n e,\n s,\n h,\n l,\n f,\n u,\n c,\n d,\n p = this.stream.mark(),\n m = p.openWithOffset(0),\n g = this.flags;\n return g.resolveTagNames && (u = r(3332)), g.resolveTagNames ? (t = {}, c = function (e) {\n return t[e.name];\n }, d = function (e, r) {\n t[e.name] = r;\n }) : (t = [], c = function (e) {\n var r;\n for (r = 0; r < t.length; ++r) if (t[r].type === e.type && t[r].section === e.section) return t.value;\n }, d = function (e, r) {\n var i;\n for (i = 0; i < t.length; ++i) if (t[i].type === e.type && t[i].section === e.section) return void (t.value = r);\n }), i.parseSections(m, function (r, o) {\n var c = o.offsetFrom(p);\n 225 === r ? n.parseTags(o, function (e, r, i, o) {\n if (g.readBinaryTags || 7 !== o) {\n if (513 === r) {\n if (s = i[0], g.hidePointers) return;\n } else if (514 === r) {\n if (h = i[0], g.hidePointers) return;\n } else if (259 === r && (l = i[0], g.hidePointers)) return;\n if (g.returnTags) if (g.simplifyValues && (i = a.simplifyValue(i, o)), g.resolveTagNames) {\n var f = (e === n.GPSIFD ? u.gps : u.exif)[r];\n f || (f = u.exif[r]), t.hasOwnProperty(f) || (t[f] = i);\n } else t.push({\n section: e,\n type: r,\n value: i\n });\n }\n }) && (f = c) : g.imageSize && \"SOF\" === i.getSectionName(r).name && (e = i.getSizeFromSOFSection(o));\n }), g.simplifyValues && (a.castDegreeValues(c, d), a.castDateValues(c, d)), new o(p, t, e, s, h, l, f);\n }\n }, t.exports = s;\n },\n 3814: (t, e, r) => {\n var i = r(592),\n n = r(565),\n a = [{\n section: i.GPSIFD,\n type: 2,\n name: \"GPSLatitude\",\n refType: 1,\n refName: \"GPSLatitudeRef\",\n posVal: \"N\"\n }, {\n section: i.GPSIFD,\n type: 4,\n name: \"GPSLongitude\",\n refType: 3,\n refName: \"GPSLongitudeRef\",\n posVal: \"E\"\n }],\n o = [{\n section: i.SubIFD,\n type: 306,\n name: \"ModifyDate\"\n }, {\n section: i.SubIFD,\n type: 36867,\n name: \"DateTimeOriginal\"\n }, {\n section: i.SubIFD,\n type: 36868,\n name: \"CreateDate\"\n }, {\n section: i.SubIFD,\n type: 306,\n name: \"ModifyDate\"\n }];\n t.exports = {\n castDegreeValues: function (t, e) {\n a.forEach(function (r) {\n var i = t(r);\n if (i) {\n var n = t({\n section: r.section,\n type: r.refType,\n name: r.refName\n }) === r.posVal ? 1 : -1,\n a = (i[0] + i[1] / 60 + i[2] / 3600) * n;\n e(r, a);\n }\n });\n },\n castDateValues: function (t, e) {\n o.forEach(function (r) {\n var i = t(r);\n if (i) {\n var a = n.parseExifDate(i);\n void 0 !== a && e(r, a);\n }\n });\n },\n simplifyValue: function (t, e) {\n return Array.isArray(t) && 1 === (t = t.map(function (t) {\n return 10 === e || 5 === e ? t[0] / t[1] : t;\n })).length && (t = t[0]), t;\n }\n };\n },\n 8789: (module, __unused_webpack_exports, __webpack_require__) => {\n \"use strict\";\n\n var Buffer = __webpack_require__(8834).lW;\n const Token = __webpack_require__(5010),\n strtok3 = __webpack_require__(7378),\n {\n stringToBytes,\n tarHeaderChecksumMatches,\n uint32SyncSafeToken\n } = __webpack_require__(7044),\n supported = __webpack_require__(4078),\n minimumBytes = 4100;\n async function fromStream(t) {\n const e = await strtok3.fromStream(t);\n try {\n return await fromTokenizer(e);\n } finally {\n await e.close();\n }\n }\n async function fromBuffer(t) {\n if (!(t instanceof Uint8Array || t instanceof ArrayBuffer || Buffer.isBuffer(t))) throw new TypeError(`Expected the \\`input\\` argument to be of type \\`Uint8Array\\` or \\`Buffer\\` or \\`ArrayBuffer\\`, got \\`${typeof t}\\``);\n const e = t instanceof Buffer ? t : Buffer.from(t);\n if (e && e.length > 1) return fromTokenizer(strtok3.fromBuffer(e));\n }\n function _check(t, e, r) {\n r = {\n offset: 0,\n ...r\n };\n for (const [i, n] of e.entries()) if (r.mask) {\n if (n !== (r.mask[i] & t[i + r.offset])) return !1;\n } else if (n !== t[i + r.offset]) return !1;\n return !0;\n }\n async function fromTokenizer(t) {\n try {\n return _fromTokenizer(t);\n } catch (t) {\n if (!(t instanceof strtok3.EndOfStreamError)) throw t;\n }\n }\n async function _fromTokenizer(t) {\n let e = Buffer.alloc(minimumBytes);\n const r = (t, r) => _check(e, t, r),\n i = (t, e) => r(stringToBytes(t), e);\n if (t.fileInfo.size || (t.fileInfo.size = Number.MAX_SAFE_INTEGER), await t.peekBuffer(e, {\n length: 12,\n mayBeLess: !0\n }), r([66, 77])) return {\n ext: \"bmp\",\n mime: \"image/bmp\"\n };\n if (r([11, 119])) return {\n ext: \"ac3\",\n mime: \"audio/vnd.dolby.dd-raw\"\n };\n if (r([120, 1])) return {\n ext: \"dmg\",\n mime: \"application/x-apple-diskimage\"\n };\n if (r([77, 90])) return {\n ext: \"exe\",\n mime: \"application/x-msdownload\"\n };\n if (r([37, 33])) return await t.peekBuffer(e, {\n length: 24,\n mayBeLess: !0\n }), i(\"PS-Adobe-\", {\n offset: 2\n }) && i(\" EPSF-\", {\n offset: 14\n }) ? {\n ext: \"eps\",\n mime: \"application/eps\"\n } : {\n ext: \"ps\",\n mime: \"application/postscript\"\n };\n if (r([31, 160]) || r([31, 157])) return {\n ext: \"Z\",\n mime: \"application/x-compress\"\n };\n if (r([255, 216, 255])) return {\n ext: \"jpg\",\n mime: \"image/jpeg\"\n };\n if (r([73, 73, 188])) return {\n ext: \"jxr\",\n mime: \"image/vnd.ms-photo\"\n };\n if (r([31, 139, 8])) return {\n ext: \"gz\",\n mime: \"application/gzip\"\n };\n if (r([66, 90, 104])) return {\n ext: \"bz2\",\n mime: \"application/x-bzip2\"\n };\n if (i(\"ID3\")) {\n await t.ignore(6);\n const n = await t.readToken(uint32SyncSafeToken);\n return t.position + n > t.fileInfo.size ? {\n ext: \"mp3\",\n mime: \"audio/mpeg\"\n } : (await t.ignore(n), fromTokenizer(t));\n }\n if (i(\"MP+\")) return {\n ext: \"mpc\",\n mime: \"audio/x-musepack\"\n };\n if ((67 === e[0] || 70 === e[0]) && r([87, 83], {\n offset: 1\n })) return {\n ext: \"swf\",\n mime: \"application/x-shockwave-flash\"\n };\n if (r([71, 73, 70])) return {\n ext: \"gif\",\n mime: \"image/gif\"\n };\n if (i(\"FLIF\")) return {\n ext: \"flif\",\n mime: \"image/flif\"\n };\n if (i(\"8BPS\")) return {\n ext: \"psd\",\n mime: \"image/vnd.adobe.photoshop\"\n };\n if (i(\"WEBP\", {\n offset: 8\n })) return {\n ext: \"webp\",\n mime: \"image/webp\"\n };\n if (i(\"MPCK\")) return {\n ext: \"mpc\",\n mime: \"audio/x-musepack\"\n };\n if (i(\"FORM\")) return {\n ext: \"aif\",\n mime: \"audio/aiff\"\n };\n if (i(\"icns\", {\n offset: 0\n })) return {\n ext: \"icns\",\n mime: \"image/icns\"\n };\n if (r([80, 75, 3, 4])) {\n try {\n for (; t.position + 30 < t.fileInfo.size;) {\n await t.readBuffer(e, {\n length: 30\n });\n const a = {\n compressedSize: e.readUInt32LE(18),\n uncompressedSize: e.readUInt32LE(22),\n filenameLength: e.readUInt16LE(26),\n extraFieldLength: e.readUInt16LE(28)\n };\n if (a.filename = await t.readToken(new Token.StringType(a.filenameLength, \"utf-8\")), await t.ignore(a.extraFieldLength), \"META-INF/mozilla.rsa\" === a.filename) return {\n ext: \"xpi\",\n mime: \"application/x-xpinstall\"\n };\n if (a.filename.endsWith(\".rels\") || a.filename.endsWith(\".xml\")) switch (a.filename.split(\"/\")[0]) {\n case \"_rels\":\n default:\n break;\n case \"word\":\n return {\n ext: \"docx\",\n mime: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n };\n case \"ppt\":\n return {\n ext: \"pptx\",\n mime: \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n };\n case \"xl\":\n return {\n ext: \"xlsx\",\n mime: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n };\n }\n if (a.filename.startsWith(\"xl/\")) return {\n ext: \"xlsx\",\n mime: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n };\n if (a.filename.startsWith(\"3D/\") && a.filename.endsWith(\".model\")) return {\n ext: \"3mf\",\n mime: \"model/3mf\"\n };\n if (\"mimetype\" === a.filename && a.compressedSize === a.uncompressedSize) switch (await t.readToken(new Token.StringType(a.compressedSize, \"utf-8\"))) {\n case \"application/epub+zip\":\n return {\n ext: \"epub\",\n mime: \"application/epub+zip\"\n };\n case \"application/vnd.oasis.opendocument.text\":\n return {\n ext: \"odt\",\n mime: \"application/vnd.oasis.opendocument.text\"\n };\n case \"application/vnd.oasis.opendocument.spreadsheet\":\n return {\n ext: \"ods\",\n mime: \"application/vnd.oasis.opendocument.spreadsheet\"\n };\n case \"application/vnd.oasis.opendocument.presentation\":\n return {\n ext: \"odp\",\n mime: \"application/vnd.oasis.opendocument.presentation\"\n };\n }\n if (0 === a.compressedSize) {\n let o = -1;\n for (; o < 0 && t.position < t.fileInfo.size;) await t.peekBuffer(e, {\n mayBeLess: !0\n }), o = e.indexOf(\"504B0304\", 0, \"hex\"), await t.ignore(o >= 0 ? o : e.length);\n } else await t.ignore(a.compressedSize);\n }\n } catch (s) {\n if (!(s instanceof strtok3.EndOfStreamError)) throw s;\n }\n return {\n ext: \"zip\",\n mime: \"application/zip\"\n };\n }\n if (i(\"OggS\")) {\n await t.ignore(28);\n const h = Buffer.alloc(8);\n return await t.readBuffer(h), _check(h, [79, 112, 117, 115, 72, 101, 97, 100]) ? {\n ext: \"opus\",\n mime: \"audio/opus\"\n } : _check(h, [128, 116, 104, 101, 111, 114, 97]) ? {\n ext: \"ogv\",\n mime: \"video/ogg\"\n } : _check(h, [1, 118, 105, 100, 101, 111, 0]) ? {\n ext: \"ogm\",\n mime: \"video/ogg\"\n } : _check(h, [127, 70, 76, 65, 67]) ? {\n ext: \"oga\",\n mime: \"audio/ogg\"\n } : _check(h, [83, 112, 101, 101, 120, 32, 32]) ? {\n ext: \"spx\",\n mime: \"audio/ogg\"\n } : _check(h, [1, 118, 111, 114, 98, 105, 115]) ? {\n ext: \"ogg\",\n mime: \"audio/ogg\"\n } : {\n ext: \"ogx\",\n mime: \"application/ogg\"\n };\n }\n if (r([80, 75]) && (3 === e[2] || 5 === e[2] || 7 === e[2]) && (4 === e[3] || 6 === e[3] || 8 === e[3])) return {\n ext: \"zip\",\n mime: \"application/zip\"\n };\n if (i(\"ftyp\", {\n offset: 4\n }) && 0 != (96 & e[8])) {\n const l = e.toString(\"binary\", 8, 12).replace(\"\\0\", \" \").trim();\n switch (l) {\n case \"avif\":\n return {\n ext: \"avif\",\n mime: \"image/avif\"\n };\n case \"mif1\":\n return {\n ext: \"heic\",\n mime: \"image/heif\"\n };\n case \"msf1\":\n return {\n ext: \"heic\",\n mime: \"image/heif-sequence\"\n };\n case \"heic\":\n case \"heix\":\n return {\n ext: \"heic\",\n mime: \"image/heic\"\n };\n case \"hevc\":\n case \"hevx\":\n return {\n ext: \"heic\",\n mime: \"image/heic-sequence\"\n };\n case \"qt\":\n return {\n ext: \"mov\",\n mime: \"video/quicktime\"\n };\n case \"M4V\":\n case \"M4VH\":\n case \"M4VP\":\n return {\n ext: \"m4v\",\n mime: \"video/x-m4v\"\n };\n case \"M4P\":\n return {\n ext: \"m4p\",\n mime: \"video/mp4\"\n };\n case \"M4B\":\n return {\n ext: \"m4b\",\n mime: \"audio/mp4\"\n };\n case \"M4A\":\n return {\n ext: \"m4a\",\n mime: \"audio/x-m4a\"\n };\n case \"F4V\":\n return {\n ext: \"f4v\",\n mime: \"video/mp4\"\n };\n case \"F4P\":\n return {\n ext: \"f4p\",\n mime: \"video/mp4\"\n };\n case \"F4A\":\n return {\n ext: \"f4a\",\n mime: \"audio/mp4\"\n };\n case \"F4B\":\n return {\n ext: \"f4b\",\n mime: \"audio/mp4\"\n };\n case \"crx\":\n return {\n ext: \"cr3\",\n mime: \"image/x-canon-cr3\"\n };\n default:\n return l.startsWith(\"3g\") ? l.startsWith(\"3g2\") ? {\n ext: \"3g2\",\n mime: \"video/3gpp2\"\n } : {\n ext: \"3gp\",\n mime: \"video/3gpp\"\n } : {\n ext: \"mp4\",\n mime: \"video/mp4\"\n };\n }\n }\n if (i(\"MThd\")) return {\n ext: \"mid\",\n mime: \"audio/midi\"\n };\n if (i(\"wOFF\") && (r([0, 1, 0, 0], {\n offset: 4\n }) || i(\"OTTO\", {\n offset: 4\n }))) return {\n ext: \"woff\",\n mime: \"font/woff\"\n };\n if (i(\"wOF2\") && (r([0, 1, 0, 0], {\n offset: 4\n }) || i(\"OTTO\", {\n offset: 4\n }))) return {\n ext: \"woff2\",\n mime: \"font/woff2\"\n };\n if (r([212, 195, 178, 161]) || r([161, 178, 195, 212])) return {\n ext: \"pcap\",\n mime: \"application/vnd.tcpdump.pcap\"\n };\n if (i(\"DSD \")) return {\n ext: \"dsf\",\n mime: \"audio/x-dsf\"\n };\n if (i(\"LZIP\")) return {\n ext: \"lz\",\n mime: \"application/x-lzip\"\n };\n if (i(\"fLaC\")) return {\n ext: \"flac\",\n mime: \"audio/x-flac\"\n };\n if (r([66, 80, 71, 251])) return {\n ext: \"bpg\",\n mime: \"image/bpg\"\n };\n if (i(\"wvpk\")) return {\n ext: \"wv\",\n mime: \"audio/wavpack\"\n };\n if (i(\"%PDF\")) {\n await t.ignore(1350);\n const f = 10485760,\n u = Buffer.alloc(Math.min(f, t.fileInfo.size));\n return await t.readBuffer(u, {\n mayBeLess: !0\n }), u.includes(Buffer.from(\"AIPrivateData\")) ? {\n ext: \"ai\",\n mime: \"application/postscript\"\n } : {\n ext: \"pdf\",\n mime: \"application/pdf\"\n };\n }\n if (r([0, 97, 115, 109])) return {\n ext: \"wasm\",\n mime: \"application/wasm\"\n };\n if (r([73, 73, 42, 0])) return i(\"CR\", {\n offset: 8\n }) ? {\n ext: \"cr2\",\n mime: \"image/x-canon-cr2\"\n } : r([28, 0, 254, 0], {\n offset: 8\n }) || r([31, 0, 11, 0], {\n offset: 8\n }) ? {\n ext: \"nef\",\n mime: \"image/x-nikon-nef\"\n } : r([8, 0, 0, 0], {\n offset: 4\n }) && (r([45, 0, 254, 0], {\n offset: 8\n }) || r([39, 0, 254, 0], {\n offset: 8\n })) ? {\n ext: \"dng\",\n mime: \"image/x-adobe-dng\"\n } : (e = Buffer.alloc(24), await t.peekBuffer(e), (r([16, 251, 134, 1], {\n offset: 4\n }) || r([8, 0, 0, 0], {\n offset: 4\n })) && r([0, 254, 0, 4, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 1], {\n offset: 9\n }) ? {\n ext: \"arw\",\n mime: \"image/x-sony-arw\"\n } : {\n ext: \"tif\",\n mime: \"image/tiff\"\n });\n if (r([77, 77, 0, 42])) return {\n ext: \"tif\",\n mime: \"image/tiff\"\n };\n if (i(\"MAC \")) return {\n ext: \"ape\",\n mime: \"audio/ape\"\n };\n if (r([26, 69, 223, 163])) {\n async function c() {\n const e = await t.peekNumber(Token.UINT8);\n let r = 128,\n i = 0;\n for (; 0 == (e & r) && 0 !== r;) ++i, r >>= 1;\n const n = Buffer.alloc(i + 1);\n return await t.readBuffer(n), n;\n }\n async function d() {\n const t = await c(),\n e = await c();\n e[0] ^= 128 >> e.length - 1;\n const r = Math.min(6, e.length);\n return {\n id: t.readUIntBE(0, t.length),\n len: e.readUIntBE(e.length - r, r)\n };\n }\n async function p(e, r) {\n for (; r > 0;) {\n const e = await d();\n if (17026 === e.id) return t.readToken(new Token.StringType(e.len, \"utf-8\"));\n await t.ignore(e.len), --r;\n }\n }\n const m = await d();\n switch (await p(0, m.len)) {\n case \"webm\":\n return {\n ext: \"webm\",\n mime: \"video/webm\"\n };\n case \"matroska\":\n return {\n ext: \"mkv\",\n mime: \"video/x-matroska\"\n };\n default:\n return;\n }\n }\n if (r([82, 73, 70, 70])) {\n if (r([65, 86, 73], {\n offset: 8\n })) return {\n ext: \"avi\",\n mime: \"video/vnd.avi\"\n };\n if (r([87, 65, 86, 69], {\n offset: 8\n })) return {\n ext: \"wav\",\n mime: \"audio/vnd.wave\"\n };\n if (r([81, 76, 67, 77], {\n offset: 8\n })) return {\n ext: \"qcp\",\n mime: \"audio/qcelp\"\n };\n }\n if (i(\"SQLi\")) return {\n ext: \"sqlite\",\n mime: \"application/x-sqlite3\"\n };\n if (r([78, 69, 83, 26])) return {\n ext: \"nes\",\n mime: \"application/x-nintendo-nes-rom\"\n };\n if (i(\"Cr24\")) return {\n ext: \"crx\",\n mime: \"application/x-google-chrome-extension\"\n };\n if (i(\"MSCF\") || i(\"ISc(\")) return {\n ext: \"cab\",\n mime: \"application/vnd.ms-cab-compressed\"\n };\n if (r([237, 171, 238, 219])) return {\n ext: \"rpm\",\n mime: \"application/x-rpm\"\n };\n if (r([197, 208, 211, 198])) return {\n ext: \"eps\",\n mime: \"application/eps\"\n };\n if (r([40, 181, 47, 253])) return {\n ext: \"zst\",\n mime: \"application/zstd\"\n };\n if (r([79, 84, 84, 79, 0])) return {\n ext: \"otf\",\n mime: \"font/otf\"\n };\n if (i(\"#!AMR\")) return {\n ext: \"amr\",\n mime: \"audio/amr\"\n };\n if (i(\"{\\\\rtf\")) return {\n ext: \"rtf\",\n mime: \"application/rtf\"\n };\n if (r([70, 76, 86, 1])) return {\n ext: \"flv\",\n mime: \"video/x-flv\"\n };\n if (i(\"IMPM\")) return {\n ext: \"it\",\n mime: \"audio/x-it\"\n };\n if (i(\"-lh0-\", {\n offset: 2\n }) || i(\"-lh1-\", {\n offset: 2\n }) || i(\"-lh2-\", {\n offset: 2\n }) || i(\"-lh3-\", {\n offset: 2\n }) || i(\"-lh4-\", {\n offset: 2\n }) || i(\"-lh5-\", {\n offset: 2\n }) || i(\"-lh6-\", {\n offset: 2\n }) || i(\"-lh7-\", {\n offset: 2\n }) || i(\"-lzs-\", {\n offset: 2\n }) || i(\"-lz4-\", {\n offset: 2\n }) || i(\"-lz5-\", {\n offset: 2\n }) || i(\"-lhd-\", {\n offset: 2\n })) return {\n ext: \"lzh\",\n mime: \"application/x-lzh-compressed\"\n };\n if (r([0, 0, 1, 186])) {\n if (r([33], {\n offset: 4,\n mask: [241]\n })) return {\n ext: \"mpg\",\n mime: \"video/MP1S\"\n };\n if (r([68], {\n offset: 4,\n mask: [196]\n })) return {\n ext: \"mpg\",\n mime: \"video/MP2P\"\n };\n }\n if (i(\"ITSF\")) return {\n ext: \"chm\",\n mime: \"application/vnd.ms-htmlhelp\"\n };\n if (r([253, 55, 122, 88, 90, 0])) return {\n ext: \"xz\",\n mime: \"application/x-xz\"\n };\n if (i(\"\")) return await t.ignore(8), \"debian-binary\" === (await t.readToken(new Token.StringType(13, \"ascii\"))) ? {\n ext: \"deb\",\n mime: \"application/x-deb\"\n } : {\n ext: \"ar\",\n mime: \"application/x-unix-archive\"\n };\n if (r([137, 80, 78, 71, 13, 10, 26, 10])) {\n async function g() {\n return {\n length: await t.readToken(Token.INT32_BE),\n type: await t.readToken(new Token.StringType(4, \"binary\"))\n };\n }\n await t.ignore(8);\n do {\n const b = await g();\n if (b.length < 0) return;\n switch (b.type) {\n case \"IDAT\":\n return {\n ext: \"png\",\n mime: \"image/png\"\n };\n case \"acTL\":\n return {\n ext: \"apng\",\n mime: \"image/apng\"\n };\n default:\n await t.ignore(b.length + 4);\n }\n } while (t.position + 8 < t.fileInfo.size);\n return {\n ext: \"png\",\n mime: \"image/png\"\n };\n }\n if (r([65, 82, 82, 79, 87, 49, 0, 0])) return {\n ext: \"arrow\",\n mime: \"application/x-apache-arrow\"\n };\n if (r([103, 108, 84, 70, 2, 0, 0, 0])) return {\n ext: \"glb\",\n mime: \"model/gltf-binary\"\n };\n if (r([102, 114, 101, 101], {\n offset: 4\n }) || r([109, 100, 97, 116], {\n offset: 4\n }) || r([109, 111, 111, 118], {\n offset: 4\n }) || r([119, 105, 100, 101], {\n offset: 4\n })) return {\n ext: \"mov\",\n mime: \"video/quicktime\"\n };\n if (r([73, 73, 82, 79, 8, 0, 0, 0, 24])) return {\n ext: \"orf\",\n mime: \"image/x-olympus-orf\"\n };\n if (i(\"gimp xcf \")) return {\n ext: \"xcf\",\n mime: \"image/x-xcf\"\n };\n if (r([73, 73, 85, 0, 24, 0, 0, 0, 136, 231, 116, 216])) return {\n ext: \"rw2\",\n mime: \"image/x-panasonic-rw2\"\n };\n if (r([48, 38, 178, 117, 142, 102, 207, 17, 166, 217])) {\n async function _() {\n const e = Buffer.alloc(16);\n return await t.readBuffer(e), {\n id: e,\n size: Number(await t.readToken(Token.UINT64_LE))\n };\n }\n for (await t.ignore(30); t.position + 24 < t.fileInfo.size;) {\n const y = await _();\n let w = y.size - 24;\n if (_check(y.id, [145, 7, 220, 183, 183, 169, 207, 17, 142, 230, 0, 192, 12, 32, 83, 101])) {\n const v = Buffer.alloc(16);\n if (w -= await t.readBuffer(v), _check(v, [64, 158, 105, 248, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43])) return {\n ext: \"asf\",\n mime: \"audio/x-ms-asf\"\n };\n if (_check(v, [192, 239, 25, 188, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43])) return {\n ext: \"asf\",\n mime: \"video/x-ms-asf\"\n };\n break;\n }\n await t.ignore(w);\n }\n return {\n ext: \"asf\",\n mime: \"application/vnd.ms-asf\"\n };\n }\n if (r([171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10])) return {\n ext: \"ktx\",\n mime: \"image/ktx\"\n };\n if ((r([126, 16, 4]) || r([126, 24, 4])) && r([48, 77, 73, 69], {\n offset: 4\n })) return {\n ext: \"mie\",\n mime: \"application/x-mie\"\n };\n if (r([39, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], {\n offset: 2\n })) return {\n ext: \"shp\",\n mime: \"application/x-esri-shape\"\n };\n if (r([0, 0, 0, 12, 106, 80, 32, 32, 13, 10, 135, 10])) switch (await t.ignore(20), await t.readToken(new Token.StringType(4, \"ascii\"))) {\n case \"jp2 \":\n return {\n ext: \"jp2\",\n mime: \"image/jp2\"\n };\n case \"jpx \":\n return {\n ext: \"jpx\",\n mime: \"image/jpx\"\n };\n case \"jpm \":\n return {\n ext: \"jpm\",\n mime: \"image/jpm\"\n };\n case \"mjp2\":\n return {\n ext: \"mj2\",\n mime: \"image/mj2\"\n };\n default:\n return;\n }\n if (r([255, 10]) || r([0, 0, 0, 12, 74, 88, 76, 32, 13, 10, 135, 10])) return {\n ext: \"jxl\",\n mime: \"image/jxl\"\n };\n if (r([0, 0, 1, 186]) || r([0, 0, 1, 179])) return {\n ext: \"mpg\",\n mime: \"video/mpeg\"\n };\n if (r([0, 1, 0, 0, 0])) return {\n ext: \"ttf\",\n mime: \"font/ttf\"\n };\n if (r([0, 0, 1, 0])) return {\n ext: \"ico\",\n mime: \"image/x-icon\"\n };\n if (r([0, 0, 2, 0])) return {\n ext: \"cur\",\n mime: \"image/x-icon\"\n };\n if (r([208, 207, 17, 224, 161, 177, 26, 225])) return {\n ext: \"cfb\",\n mime: \"application/x-cfb\"\n };\n if (await t.peekBuffer(e, {\n length: Math.min(256, t.fileInfo.size),\n mayBeLess: !0\n }), i(\"BEGIN:\")) {\n if (i(\"VCARD\", {\n offset: 6\n })) return {\n ext: \"vcf\",\n mime: \"text/vcard\"\n };\n if (i(\"VCALENDAR\", {\n offset: 6\n })) return {\n ext: \"ics\",\n mime: \"text/calendar\"\n };\n }\n if (i(\"FUJIFILMCCD-RAW\")) return {\n ext: \"raf\",\n mime: \"image/x-fujifilm-raf\"\n };\n if (i(\"Extended Module:\")) return {\n ext: \"xm\",\n mime: \"audio/x-xm\"\n };\n if (i(\"Creative Voice File\")) return {\n ext: \"voc\",\n mime: \"audio/x-voc\"\n };\n if (r([4, 0, 0, 0]) && e.length >= 16) {\n const x = e.readUInt32LE(12);\n if (x > 12 && e.length >= x + 16) try {\n const E = e.slice(16, x + 16).toString();\n if (JSON.parse(E).files) return {\n ext: \"asar\",\n mime: \"application/x-asar\"\n };\n } catch (k) {}\n }\n if (r([6, 14, 43, 52, 2, 5, 1, 1, 13, 1, 2, 1, 1, 2])) return {\n ext: \"mxf\",\n mime: \"application/mxf\"\n };\n if (i(\"SCRM\", {\n offset: 44\n })) return {\n ext: \"s3m\",\n mime: \"audio/x-s3m\"\n };\n if (r([71], {\n offset: 4\n }) && (r([71], {\n offset: 192\n }) || r([71], {\n offset: 196\n }))) return {\n ext: \"mts\",\n mime: \"video/mp2t\"\n };\n if (r([66, 79, 79, 75, 77, 79, 66, 73], {\n offset: 60\n })) return {\n ext: \"mobi\",\n mime: \"application/x-mobipocket-ebook\"\n };\n if (r([68, 73, 67, 77], {\n offset: 128\n })) return {\n ext: \"dcm\",\n mime: \"application/dicom\"\n };\n if (r([76, 0, 0, 0, 1, 20, 2, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70])) return {\n ext: \"lnk\",\n mime: \"application/x.ms.shortcut\"\n };\n if (r([98, 111, 111, 107, 0, 0, 0, 0, 109, 97, 114, 107, 0, 0, 0, 0])) return {\n ext: \"alias\",\n mime: \"application/x.apple.alias\"\n };\n if (r([76, 80], {\n offset: 34\n }) && (r([0, 0, 1], {\n offset: 8\n }) || r([1, 0, 2], {\n offset: 8\n }) || r([2, 0, 2], {\n offset: 8\n }))) return {\n ext: \"eot\",\n mime: \"application/vnd.ms-fontobject\"\n };\n if (r([6, 6, 237, 245, 216, 29, 70, 229, 189, 49, 239, 231, 254, 116, 183, 29])) return {\n ext: \"indd\",\n mime: \"application/x-indesign\"\n };\n if (await t.peekBuffer(e, {\n length: Math.min(512, t.fileInfo.size),\n mayBeLess: !0\n }), tarHeaderChecksumMatches(e)) return {\n ext: \"tar\",\n mime: \"application/x-tar\"\n };\n if (r([255, 254, 255, 14, 83, 0, 107, 0, 101, 0, 116, 0, 99, 0, 104, 0, 85, 0, 112, 0, 32, 0, 77, 0, 111, 0, 100, 0, 101, 0, 108, 0])) return {\n ext: \"skp\",\n mime: \"application/vnd.sketchup.skp\"\n };\n if (i(\"-----BEGIN PGP MESSAGE-----\")) return {\n ext: \"pgp\",\n mime: \"application/pgp-encrypted\"\n };\n if (e.length >= 2 && r([255, 224], {\n offset: 0,\n mask: [255, 224]\n })) {\n if (r([16], {\n offset: 1,\n mask: [22]\n })) return r([8], {\n offset: 1,\n mask: [8]\n }), {\n ext: \"aac\",\n mime: \"audio/aac\"\n };\n if (r([2], {\n offset: 1,\n mask: [6]\n })) return {\n ext: \"mp3\",\n mime: \"audio/mpeg\"\n };\n if (r([4], {\n offset: 1,\n mask: [6]\n })) return {\n ext: \"mp2\",\n mime: \"audio/mpeg\"\n };\n if (r([6], {\n offset: 1,\n mask: [6]\n })) return {\n ext: \"mp1\",\n mime: \"audio/mpeg\"\n };\n }\n }\n const stream = readableStream => new Promise((resolve, reject) => {\n const stream = eval(\"require\")(\"stream\");\n readableStream.on(\"error\", reject), readableStream.once(\"readable\", async () => {\n const t = new stream.PassThrough();\n let e;\n e = stream.pipeline ? stream.pipeline(readableStream, t, () => {}) : readableStream.pipe(t);\n const r = readableStream.read(minimumBytes) || readableStream.read() || Buffer.alloc(0);\n try {\n const e = await fromBuffer(r);\n t.fileType = e;\n } catch (t) {\n reject(t);\n }\n resolve(e);\n });\n }),\n fileType = {\n fromStream,\n fromTokenizer,\n fromBuffer,\n stream\n };\n Object.defineProperty(fileType, \"extensions\", {\n get: () => new Set(supported.extensions)\n }), Object.defineProperty(fileType, \"mimeTypes\", {\n get: () => new Set(supported.mimeTypes)\n }), module.exports = fileType;\n },\n 5025: (t, e, r) => {\n \"use strict\";\n\n const i = r(3569),\n n = r(8789),\n a = {\n fromFile: async function (t) {\n const e = await i.fromFile(t);\n try {\n return await n.fromTokenizer(e);\n } finally {\n await e.close();\n }\n }\n };\n Object.assign(a, n), Object.defineProperty(a, \"extensions\", {\n get: () => n.extensions\n }), Object.defineProperty(a, \"mimeTypes\", {\n get: () => n.mimeTypes\n }), t.exports = a;\n },\n 4078: t => {\n \"use strict\";\n\n t.exports = {\n extensions: [\"jpg\", \"png\", \"apng\", \"gif\", \"webp\", \"flif\", \"xcf\", \"cr2\", \"cr3\", \"orf\", \"arw\", \"dng\", \"nef\", \"rw2\", \"raf\", \"tif\", \"bmp\", \"icns\", \"jxr\", \"psd\", \"indd\", \"zip\", \"tar\", \"rar\", \"gz\", \"bz2\", \"7z\", \"dmg\", \"mp4\", \"mid\", \"mkv\", \"webm\", \"mov\", \"avi\", \"mpg\", \"mp2\", \"mp3\", \"m4a\", \"oga\", \"ogg\", \"ogv\", \"opus\", \"flac\", \"wav\", \"spx\", \"amr\", \"pdf\", \"epub\", \"exe\", \"swf\", \"rtf\", \"wasm\", \"woff\", \"woff2\", \"eot\", \"ttf\", \"otf\", \"ico\", \"flv\", \"ps\", \"xz\", \"sqlite\", \"nes\", \"crx\", \"xpi\", \"cab\", \"deb\", \"ar\", \"rpm\", \"Z\", \"lz\", \"cfb\", \"mxf\", \"mts\", \"blend\", \"bpg\", \"docx\", \"pptx\", \"xlsx\", \"3gp\", \"3g2\", \"jp2\", \"jpm\", \"jpx\", \"mj2\", \"aif\", \"qcp\", \"odt\", \"ods\", \"odp\", \"xml\", \"mobi\", \"heic\", \"cur\", \"ktx\", \"ape\", \"wv\", \"dcm\", \"ics\", \"glb\", \"pcap\", \"dsf\", \"lnk\", \"alias\", \"voc\", \"ac3\", \"m4v\", \"m4p\", \"m4b\", \"f4v\", \"f4p\", \"f4b\", \"f4a\", \"mie\", \"asf\", \"ogm\", \"ogx\", \"mpc\", \"arrow\", \"shp\", \"aac\", \"mp1\", \"it\", \"s3m\", \"xm\", \"ai\", \"skp\", \"avif\", \"eps\", \"lzh\", \"pgp\", \"asar\", \"stl\", \"chm\", \"3mf\", \"zst\", \"jxl\", \"vcf\"],\n mimeTypes: [\"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\", \"image/flif\", \"image/x-xcf\", \"image/x-canon-cr2\", \"image/x-canon-cr3\", \"image/tiff\", \"image/bmp\", \"image/vnd.ms-photo\", \"image/vnd.adobe.photoshop\", \"application/x-indesign\", \"application/epub+zip\", \"application/x-xpinstall\", \"application/vnd.oasis.opendocument.text\", \"application/vnd.oasis.opendocument.spreadsheet\", \"application/vnd.oasis.opendocument.presentation\", \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\", \"application/vnd.openxmlformats-officedocument.presentationml.presentation\", \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\", \"application/zip\", \"application/x-tar\", \"application/x-rar-compressed\", \"application/gzip\", \"application/x-bzip2\", \"application/x-7z-compressed\", \"application/x-apple-diskimage\", \"application/x-apache-arrow\", \"video/mp4\", \"audio/midi\", \"video/x-matroska\", \"video/webm\", \"video/quicktime\", \"video/vnd.avi\", \"audio/vnd.wave\", \"audio/qcelp\", \"audio/x-ms-asf\", \"video/x-ms-asf\", \"application/vnd.ms-asf\", \"video/mpeg\", \"video/3gpp\", \"audio/mpeg\", \"audio/mp4\", \"audio/opus\", \"video/ogg\", \"audio/ogg\", \"application/ogg\", \"audio/x-flac\", \"audio/ape\", \"audio/wavpack\", \"audio/amr\", \"application/pdf\", \"application/x-msdownload\", \"application/x-shockwave-flash\", \"application/rtf\", \"application/wasm\", \"font/woff\", \"font/woff2\", \"application/vnd.ms-fontobject\", \"font/ttf\", \"font/otf\", \"image/x-icon\", \"video/x-flv\", \"application/postscript\", \"application/eps\", \"application/x-xz\", \"application/x-sqlite3\", \"application/x-nintendo-nes-rom\", \"application/x-google-chrome-extension\", \"application/vnd.ms-cab-compressed\", \"application/x-deb\", \"application/x-unix-archive\", \"application/x-rpm\", \"application/x-compress\", \"application/x-lzip\", \"application/x-cfb\", \"application/x-mie\", \"application/mxf\", \"video/mp2t\", \"application/x-blender\", \"image/bpg\", \"image/jp2\", \"image/jpx\", \"image/jpm\", \"image/mj2\", \"audio/aiff\", \"application/xml\", \"application/x-mobipocket-ebook\", \"image/heif\", \"image/heif-sequence\", \"image/heic\", \"image/heic-sequence\", \"image/icns\", \"image/ktx\", \"application/dicom\", \"audio/x-musepack\", \"text/calendar\", \"text/vcard\", \"model/gltf-binary\", \"application/vnd.tcpdump.pcap\", \"audio/x-dsf\", \"application/x.ms.shortcut\", \"application/x.apple.alias\", \"audio/x-voc\", \"audio/vnd.dolby.dd-raw\", \"audio/x-m4a\", \"image/apng\", \"image/x-olympus-orf\", \"image/x-sony-arw\", \"image/x-adobe-dng\", \"image/x-nikon-nef\", \"image/x-panasonic-rw2\", \"image/x-fujifilm-raf\", \"video/x-m4v\", \"video/3gpp2\", \"application/x-esri-shape\", \"audio/aac\", \"audio/x-it\", \"audio/x-s3m\", \"audio/x-xm\", \"video/MP1S\", \"video/MP2P\", \"application/vnd.sketchup.skp\", \"image/avif\", \"application/x-lzh-compressed\", \"application/pgp-encrypted\", \"application/x-asar\", \"model/stl\", \"application/vnd.ms-htmlhelp\", \"model/3mf\", \"image/jxl\", \"application/zstd\"]\n };\n },\n 7044: (t, e) => {\n \"use strict\";\n\n e.stringToBytes = t => [...t].map(t => t.charCodeAt(0)), e.tarHeaderChecksumMatches = (t, e = 0) => {\n const r = parseInt(t.toString(\"utf8\", 148, 154).replace(/\\0.*$/, \"\").trim(), 8);\n if (isNaN(r)) return !1;\n let i = 256;\n for (let r = e; r < e + 148; r++) i += t[r];\n for (let r = e + 156; r < e + 512; r++) i += t[r];\n return r === i;\n }, e.uint32SyncSafeToken = {\n get: (t, e) => 127 & t[e + 3] | t[e + 2] << 7 | t[e + 1] << 14 | t[e] << 21,\n len: 4\n };\n },\n 3243: (t, e, r) => {\n \"use strict\";\n\n var i = r(9680),\n n = Object.prototype.toString,\n a = Object.prototype.hasOwnProperty,\n o = function (t, e, r) {\n for (var i = 0, n = t.length; i < n; i++) a.call(t, i) && (null == r ? e(t[i], i, t) : e.call(r, t[i], i, t));\n },\n s = function (t, e, r) {\n for (var i = 0, n = t.length; i < n; i++) null == r ? e(t.charAt(i), i, t) : e.call(r, t.charAt(i), i, t);\n },\n h = function (t, e, r) {\n for (var i in t) a.call(t, i) && (null == r ? e(t[i], i, t) : e.call(r, t[i], i, t));\n };\n t.exports = function (t, e, r) {\n if (!i(e)) throw new TypeError(\"iterator must be a function\");\n var a;\n arguments.length >= 3 && (a = r), \"[object Array]\" === n.call(t) ? o(t, e, a) : \"string\" == typeof t ? s(t, e, a) : h(t, e, a);\n };\n },\n 2855: (t, e) => {\n \"use strict\";\n\n function r(t, e, r, i) {\n for (var n = t[e++], a = 1 << n, o = a + 1, s = o + 1, h = n + 1, l = (1 << h) - 1, f = 0, u = 0, c = 0, d = t[e++], p = new Int32Array(4096), m = null;;) {\n for (; f < 16 && 0 !== d;) u |= t[e++] << f, f += 8, 1 === d ? d = t[e++] : --d;\n if (f < h) break;\n var g = u & l;\n if (u >>= h, f -= h, g !== a) {\n if (g === o) break;\n for (var b = g < s ? g : m, _ = 0, y = b; y > a;) y = p[y] >> 8, ++_;\n var w = y;\n if (c + _ + (b !== g ? 1 : 0) > i) return void console.log(\"Warning, gif stream longer than expected.\");\n r[c++] = w;\n var v = c += _;\n for (b !== g && (r[c++] = w), y = b; _--;) y = p[y], r[--v] = 255 & y, y >>= 8;\n null !== m && s < 4096 && (p[s++] = m << 8 | w, s >= l + 1 && h < 12 && (++h, l = l << 1 | 1)), m = g;\n } else s = o + 1, l = (1 << (h = n + 1)) - 1, m = null;\n }\n return c !== i && console.log(\"Warning, gif stream shorter than expected.\"), r;\n }\n try {\n e.GifWriter = function (t, e, r, i) {\n var n = 0,\n a = void 0 === (i = void 0 === i ? {} : i).loop ? null : i.loop,\n o = void 0 === i.palette ? null : i.palette;\n if (e <= 0 || r <= 0 || e > 65535 || r > 65535) throw new Error(\"Width/Height invalid.\");\n function s(t) {\n var e = t.length;\n if (e < 2 || e > 256 || e & e - 1) throw new Error(\"Invalid code/color length, must be power of 2 and 2 .. 256.\");\n return e;\n }\n t[n++] = 71, t[n++] = 73, t[n++] = 70, t[n++] = 56, t[n++] = 57, t[n++] = 97;\n var h = 0,\n l = 0;\n if (null !== o) {\n for (var f = s(o); f >>= 1;) ++h;\n if (f = 1 << h, --h, void 0 !== i.background) {\n if ((l = i.background) >= f) throw new Error(\"Background index out of range.\");\n if (0 === l) throw new Error(\"Background index explicitly passed as 0.\");\n }\n }\n if (t[n++] = 255 & e, t[n++] = e >> 8 & 255, t[n++] = 255 & r, t[n++] = r >> 8 & 255, t[n++] = (null !== o ? 128 : 0) | h, t[n++] = l, t[n++] = 0, null !== o) for (var u = 0, c = o.length; u < c; ++u) {\n var d = o[u];\n t[n++] = d >> 16 & 255, t[n++] = d >> 8 & 255, t[n++] = 255 & d;\n }\n if (null !== a) {\n if (a < 0 || a > 65535) throw new Error(\"Loop count invalid.\");\n t[n++] = 33, t[n++] = 255, t[n++] = 11, t[n++] = 78, t[n++] = 69, t[n++] = 84, t[n++] = 83, t[n++] = 67, t[n++] = 65, t[n++] = 80, t[n++] = 69, t[n++] = 50, t[n++] = 46, t[n++] = 48, t[n++] = 3, t[n++] = 1, t[n++] = 255 & a, t[n++] = a >> 8 & 255, t[n++] = 0;\n }\n var p = !1;\n this.addFrame = function (e, r, i, a, h, l) {\n if (!0 === p && (--n, p = !1), l = void 0 === l ? {} : l, e < 0 || r < 0 || e > 65535 || r > 65535) throw new Error(\"x/y invalid.\");\n if (i <= 0 || a <= 0 || i > 65535 || a > 65535) throw new Error(\"Width/Height invalid.\");\n if (h.length < i * a) throw new Error(\"Not enough pixels for the frame size.\");\n var f = !0,\n u = l.palette;\n if (null == u && (f = !1, u = o), null == u) throw new Error(\"Must supply either a local or global palette.\");\n for (var c = s(u), d = 0; c >>= 1;) ++d;\n c = 1 << d;\n var m = void 0 === l.delay ? 0 : l.delay,\n g = void 0 === l.disposal ? 0 : l.disposal;\n if (g < 0 || g > 3) throw new Error(\"Disposal out of range.\");\n var b = !1,\n _ = 0;\n if (void 0 !== l.transparent && null !== l.transparent && (b = !0, (_ = l.transparent) < 0 || _ >= c)) throw new Error(\"Transparent color index.\");\n if ((0 !== g || b || 0 !== m) && (t[n++] = 33, t[n++] = 249, t[n++] = 4, t[n++] = g << 2 | (!0 === b ? 1 : 0), t[n++] = 255 & m, t[n++] = m >> 8 & 255, t[n++] = _, t[n++] = 0), t[n++] = 44, t[n++] = 255 & e, t[n++] = e >> 8 & 255, t[n++] = 255 & r, t[n++] = r >> 8 & 255, t[n++] = 255 & i, t[n++] = i >> 8 & 255, t[n++] = 255 & a, t[n++] = a >> 8 & 255, t[n++] = !0 === f ? 128 | d - 1 : 0, !0 === f) for (var y = 0, w = u.length; y < w; ++y) {\n var v = u[y];\n t[n++] = v >> 16 & 255, t[n++] = v >> 8 & 255, t[n++] = 255 & v;\n }\n return n = function (t, e, r, i) {\n t[e++] = r;\n var n = e++,\n a = 1 << r,\n o = a - 1,\n s = a + 1,\n h = s + 1,\n l = r + 1,\n f = 0,\n u = 0;\n function c(r) {\n for (; f >= r;) t[e++] = 255 & u, u >>= 8, f -= 8, e === n + 256 && (t[n] = 255, n = e++);\n }\n function d(t) {\n u |= t << f, f += l, c(8);\n }\n var p = i[0] & o,\n m = {};\n d(a);\n for (var g = 1, b = i.length; g < b; ++g) {\n var _ = i[g] & o,\n y = p << 8 | _,\n w = m[y];\n if (void 0 === w) {\n for (u |= p << f, f += l; f >= 8;) t[e++] = 255 & u, u >>= 8, f -= 8, e === n + 256 && (t[n] = 255, n = e++);\n 4096 === h ? (d(a), h = s + 1, l = r + 1, m = {}) : (h >= 1 << l && ++l, m[y] = h++), p = _;\n } else p = w;\n }\n return d(p), d(s), c(1), n + 1 === e ? t[n] = 0 : (t[n] = e - n - 1, t[e++] = 0), e;\n }(t, n, d < 2 ? 2 : d, h), n;\n }, this.end = function () {\n return !1 === p && (t[n++] = 59, p = !0), n;\n }, this.getOutputBuffer = function () {\n return t;\n }, this.setOutputBuffer = function (e) {\n t = e;\n }, this.getOutputBufferPosition = function () {\n return n;\n }, this.setOutputBufferPosition = function (t) {\n n = t;\n };\n }, e.GifReader = function (t) {\n var e = 0;\n if (71 !== t[e++] || 73 !== t[e++] || 70 !== t[e++] || 56 !== t[e++] || 56 != (t[e++] + 1 & 253) || 97 !== t[e++]) throw new Error(\"Invalid GIF 87a/89a header.\");\n var i = t[e++] | t[e++] << 8,\n n = t[e++] | t[e++] << 8,\n a = t[e++],\n o = a >> 7,\n s = 1 << 1 + (7 & a);\n t[e++], t[e++];\n var h = null,\n l = null;\n o && (h = e, l = s, e += 3 * s);\n var f = !0,\n u = [],\n c = 0,\n d = null,\n p = 0,\n m = null;\n for (this.width = i, this.height = n; f && e < t.length;) switch (t[e++]) {\n case 33:\n switch (t[e++]) {\n case 255:\n if (11 !== t[e] || 78 == t[e + 1] && 69 == t[e + 2] && 84 == t[e + 3] && 83 == t[e + 4] && 67 == t[e + 5] && 65 == t[e + 6] && 80 == t[e + 7] && 69 == t[e + 8] && 50 == t[e + 9] && 46 == t[e + 10] && 48 == t[e + 11] && 3 == t[e + 12] && 1 == t[e + 13] && 0 == t[e + 16]) e += 14, m = t[e++] | t[e++] << 8, e++;else for (e += 12;;) {\n if (!((I = t[e++]) >= 0)) throw Error(\"Invalid block size\");\n if (0 === I) break;\n e += I;\n }\n break;\n case 249:\n if (4 !== t[e++] || 0 !== t[e + 4]) throw new Error(\"Invalid graphics extension block.\");\n var g = t[e++];\n c = t[e++] | t[e++] << 8, d = t[e++], 0 == (1 & g) && (d = null), p = g >> 2 & 7, e++;\n break;\n case 254:\n for (;;) {\n if (!((I = t[e++]) >= 0)) throw Error(\"Invalid block size\");\n if (0 === I) break;\n e += I;\n }\n break;\n default:\n throw new Error(\"Unknown graphic control label: 0x\" + t[e - 1].toString(16));\n }\n break;\n case 44:\n var b = t[e++] | t[e++] << 8,\n _ = t[e++] | t[e++] << 8,\n y = t[e++] | t[e++] << 8,\n w = t[e++] | t[e++] << 8,\n v = t[e++],\n x = v >> 6 & 1,\n E = 1 << 1 + (7 & v),\n k = h,\n S = l,\n M = !1;\n v >> 7 && (M = !0, k = e, S = E, e += 3 * E);\n var A = e;\n for (e++;;) {\n var I;\n if (!((I = t[e++]) >= 0)) throw Error(\"Invalid block size\");\n if (0 === I) break;\n e += I;\n }\n u.push({\n x: b,\n y: _,\n width: y,\n height: w,\n has_local_palette: M,\n palette_offset: k,\n palette_size: S,\n data_offset: A,\n data_length: e - A,\n transparent_index: d,\n interlaced: !!x,\n delay: c,\n disposal: p\n });\n break;\n case 59:\n f = !1;\n break;\n default:\n throw new Error(\"Unknown gif block: 0x\" + t[e - 1].toString(16));\n }\n this.numFrames = function () {\n return u.length;\n }, this.loopCount = function () {\n return m;\n }, this.frameInfo = function (t) {\n if (t < 0 || t >= u.length) throw new Error(\"Frame index out of range.\");\n return u[t];\n }, this.decodeAndBlitFrameBGRA = function (e, n) {\n var a = this.frameInfo(e),\n o = a.width * a.height,\n s = new Uint8Array(o);\n r(t, a.data_offset, s, o);\n var h = a.palette_offset,\n l = a.transparent_index;\n null === l && (l = 256);\n var f = a.width,\n u = i - f,\n c = f,\n d = 4 * (a.y * i + a.x),\n p = 4 * ((a.y + a.height) * i + a.x),\n m = d,\n g = 4 * u;\n !0 === a.interlaced && (g += 4 * i * 7);\n for (var b = 8, _ = 0, y = s.length; _ < y; ++_) {\n var w = s[_];\n if (0 === c && (c = f, (m += g) >= p && (g = 4 * u + 4 * i * (b - 1), m = d + (f + u) * (b << 1), b >>= 1)), w === l) m += 4;else {\n var v = t[h + 3 * w],\n x = t[h + 3 * w + 1],\n E = t[h + 3 * w + 2];\n n[m++] = E, n[m++] = x, n[m++] = v, n[m++] = 255;\n }\n --c;\n }\n }, this.decodeAndBlitFrameRGBA = function (e, n) {\n var a = this.frameInfo(e),\n o = a.width * a.height,\n s = new Uint8Array(o);\n r(t, a.data_offset, s, o);\n var h = a.palette_offset,\n l = a.transparent_index;\n null === l && (l = 256);\n var f = a.width,\n u = i - f,\n c = f,\n d = 4 * (a.y * i + a.x),\n p = 4 * ((a.y + a.height) * i + a.x),\n m = d,\n g = 4 * u;\n !0 === a.interlaced && (g += 4 * i * 7);\n for (var b = 8, _ = 0, y = s.length; _ < y; ++_) {\n var w = s[_];\n if (0 === c && (c = f, (m += g) >= p && (g = 4 * u + 4 * i * (b - 1), m = d + (f + u) * (b << 1), b >>= 1)), w === l) m += 4;else {\n var v = t[h + 3 * w],\n x = t[h + 3 * w + 1],\n E = t[h + 3 * w + 2];\n n[m++] = v, n[m++] = x, n[m++] = E, n[m++] = 255;\n }\n --c;\n }\n };\n };\n } catch (t) {}\n },\n 7604: (t, e, r) => {\n \"use strict\";\n\n var i = r(8834).lW;\n class n {\n constructor(...t) {\n if (0 === t.length) throw new Error(\"constructor requires parameters\");\n const e = t[0];\n if (null !== e && \"object\" == typeof e) {\n if (e instanceof n) {\n const t = e.bitmap;\n this.bitmap = {\n width: t.width,\n height: t.height,\n data: new i(t.width * t.height * 4)\n }, t.data.copy(this.bitmap.data);\n } else {\n if (!(e.width && e.height && e.data)) throw new Error(\"unrecognized constructor parameters\");\n this.bitmap = e;\n }\n } else {\n if (\"number\" != typeof e || \"number\" != typeof t[1]) throw new Error(\"unrecognized constructor parameters\");\n {\n const r = e,\n n = t[1],\n a = t[2];\n this.bitmap = {\n width: r,\n height: n\n }, i.isBuffer(a) ? this.bitmap.data = a : (this.bitmap.data = new i(r * n * 4), \"number\" == typeof a && this.fillRGBA(a));\n }\n }\n }\n blit(t, e, r, i, n, a, o) {\n if (i + a > this.bitmap.width) throw new Error(\"copy exceeds width of source bitmap\");\n if (e + a > t.bitmap.width) throw new Error(\"copy exceeds width of target bitmap\");\n if (n + o > this.bitmap.height) throw new Error(\"copy exceeds height of source bitmap\");\n if (r + o > t.bitmap.height) throw new Erro(\"copy exceeds height of target bitmap\");\n const s = this.bitmap.data,\n h = t.bitmap.data,\n l = 4 * this.bitmap.width,\n f = 4 * t.bitmap.width,\n u = 4 * a;\n let c = n * l + 4 * i,\n d = r * f + 4 * e;\n for (; --o >= 0;) s.copy(h, d, c, c + u), c += l, d += f;\n return this;\n }\n fillRGBA(t) {\n const e = this.bitmap.data,\n r = 4 * this.bitmap.height;\n let i = 0;\n for (; i < r;) e.writeUInt32BE(t, i), i += 4;\n for (; i < e.length;) e.copy(e, i, 0, r), i += r;\n return this;\n }\n getRGBA(t, e) {\n const r = 4 * (e * this.bitmap.width + t);\n return this.bitmap.data.readUInt32BE(r);\n }\n getRGBASet() {\n const t = new Set(),\n e = this.bitmap.data;\n for (let r = 0; r < e.length; r += 4) t.add(e.readUInt32BE(r, !0));\n return t;\n }\n greyscale() {\n const t = this.bitmap.data;\n return this.scan(0, 0, this.bitmap.width, this.bitmap.height, (e, r, i) => {\n const n = Math.round(.299 * t[i] + .587 * t[i + 1] + .114 * t[i + 2]);\n t[i] = n, t[i + 1] = n, t[i + 2] = n;\n }), this;\n }\n reframe(t, e, r, i, a) {\n const o = t < 0 ? 0 : t,\n s = e < 0 ? 0 : e,\n h = r + o > this.bitmap.width ? this.bitmap.width - o : r,\n l = i + s > this.bitmap.height ? this.bitmap.height - s : i,\n f = t < 0 ? -t : 0,\n u = e < 0 ? -e : 0;\n let c;\n if (void 0 === a) {\n if (o !== t || s != e || h !== r || l !== i) throw new GifError(\"fillRGBA required for this reframing\");\n c = new n(r, i);\n } else c = new n(r, i, a);\n return this.blit(c, f, u, o, s, h, l), this.bitmap = c.bitmap, this;\n }\n scale(t) {\n if (1 === t) return;\n if (!Number.isInteger(t) || t < 1) throw new Error(\"the scale must be an integer >= 1\");\n const e = this.bitmap.width,\n r = this.bitmap.height,\n n = e * t * 4,\n a = this.bitmap.data,\n o = new i(r * n * t);\n let s,\n h = 0,\n l = 0;\n for (let i = 0; i < r; ++i) {\n s = l;\n for (let r = 0; r < e; ++r) {\n const e = a.readUInt32BE(h, !0);\n for (let r = 0; r < t; ++r) o.writeUInt32BE(e, l), l += 4;\n h += 4;\n }\n for (let e = 1; e < t; ++e) o.copy(o, l, s, l), l += n, s += n;\n }\n return this.bitmap = {\n width: e * t,\n height: r * t,\n data: o\n }, this;\n }\n scanAllCoords(t) {\n const e = this.bitmap.width,\n r = this.bitmap.data.length;\n let i = 0,\n n = 0;\n for (let a = 0; a < r; a += 4) t(i, n, a), ++i === e && (i = 0, ++n);\n }\n scanAllIndexes(t) {\n const e = this.bitmap.data.length;\n for (let r = 0; r < e; r += 4) t(r);\n }\n }\n t.exports = n;\n },\n 4364: (t, e) => {\n \"use strict\";\n\n class r {\n constructor(t, e, r) {\n this.width = r.width, this.height = r.height, this.loops = r.loops, this.usesTransparency = r.usesTransparency, this.colorScope = r.colorScope, this.frames = e, this.buffer = t;\n }\n }\n r.GlobalColorsPreferred = 0, r.GlobalColorsOnly = 1, r.LocalColorsOnly = 2;\n class i extends Error {\n constructor(t) {\n super(t), t instanceof Error && (this.stack = \"Gif\" + t.stack);\n }\n }\n e.Gif = r, e.GifError = i;\n },\n 6512: (t, e, r) => {\n \"use strict\";\n\n var i = r(8834).lW;\n const n = r(2855),\n {\n Gif: a,\n GifError: o\n } = r(4364);\n function s() {\n const t = r(4602);\n return s = function () {\n return t;\n }, t;\n }\n const {\n GifFrame: h\n } = r(5585),\n l = 100;\n function f(t, e) {\n const r = t.indexOf(e);\n return -1 === r ? null : r;\n }\n function u(t, e) {\n for (var r, i = 0, n = t.length - 1; i <= n;) if (t[r = Math.floor((i + n) / 2)] > e) n = r - 1;else {\n if (!(t[r] < e)) return r;\n i = r + 1;\n }\n return null;\n }\n function c(t) {\n const e = t.colors;\n t.usesTransparency && e.push(0);\n const r = e.length;\n let i = 2;\n for (; r > i;) i <<= 1;\n e.length = i, e.fill(0, r);\n }\n function d(t, e) {\n let r = t.bitmap.width * t.bitmap.height;\n return r = Math.ceil(r * e / 8), r += Math.ceil(r / 255), l + r + 768;\n }\n function p(t) {\n let e = t.indexCount,\n r = 0;\n for (--e; e;) ++r, e >>= 1;\n return r > 0 ? r : 1;\n }\n function m(t, e, r, n, a) {\n if (r.interlaced) throw new o(\"writing interlaced GIFs is not supported\");\n const s = function (t, e, r) {\n const n = r.colors,\n a = n.length <= 8 ? f : u,\n s = e.bitmap.data,\n h = new i(s.length / 4);\n let l = n.length,\n c = 0,\n d = 0;\n for (; c < s.length;) {\n if (0 !== s[c + 3]) {\n const t = s.readUInt32BE(c, !0) >> 8 & 16777215;\n h[d] = a(n, t);\n } else h[d] = l;\n c += 4, ++d;\n }\n if (r.usesTransparency) {\n if (256 === l) throw new o(`Frame ${t} already has 256 colorsand so can't use transparency`);\n } else l = null;\n return {\n buffer: h,\n transparentIndex: l\n };\n }(e, r, n),\n h = {\n delay: r.delayCentisecs,\n disposal: r.disposalMethod,\n transparent: s.transparentIndex\n };\n a && (c(n), h.palette = n.colors);\n try {\n let e,\n n = t.getOutputBuffer(),\n a = t.getOutputBufferPosition(),\n o = !0;\n for (; o;) if (e = t.addFrame(r.xOffset, r.yOffset, r.bitmap.width, r.bitmap.height, s.buffer, h), o = !1, e >= n.length - 1) {\n const e = new i(1.5 * n.length);\n n.copy(e), t.setOutputBuffer(e), t.setOutputBufferPosition(a), n = e, o = !0;\n }\n return n;\n } catch (t) {\n throw new o(t);\n }\n }\n e.GifCodec = class {\n constructor(t = {}) {\n this._transparentRGB = null, \"number\" == typeof t.transparentRGB && 0 !== t.transparentRGB && (this._transparentRGBA = 256 * t.transparentRGB), this._testInitialBufferSize = 0;\n }\n decodeGif(t) {\n try {\n let e;\n try {\n e = new n.GifReader(t);\n } catch (t) {\n throw new o(t);\n }\n const r = e.numFrames(),\n i = [],\n s = {\n width: e.width,\n height: e.height,\n loops: e.loopCount(),\n usesTransparency: !1\n };\n for (let t = 0; t < r; ++t) {\n const r = this._decodeFrame(e, t, s.usesTransparency);\n i.push(r.frame), r.usesTransparency && (s.usesTransparency = !0);\n }\n return Promise.resolve(new a(t, i, s));\n } catch (t) {\n return Promise.reject(t);\n }\n }\n encodeGif(t, e = {}) {\n try {\n if (null === t || 0 === t.length) throw new o(\"there are no frames\");\n const r = s().getMaxDimensions(t);\n return (e = Object.assign({}, e)).width = r.maxWidth, e.height = r.maxHeight, void 0 === e.loops && (e.loops = 0), e.colorScope = e.colorScope || a.GlobalColorsPreferred, Promise.resolve(this._encodeGif(t, e));\n } catch (t) {\n return Promise.reject(t);\n }\n }\n _decodeFrame(t, e, r) {\n let n, a;\n try {\n if (n = t.frameInfo(e), a = new i(t.width * t.height * 4), t.decodeAndBlitFrameRGBA(e, a), n.width !== t.width || n.height !== t.height) {\n if (n.y && (a = a.slice(n.y * t.width * 4)), t.width > n.width) for (let e = 0; e < n.height; ++e) a.copy(a, e * n.width * 4, 4 * (n.x + e * t.width), 4 * (n.x + e * t.width) + 4 * n.width);\n a = a.slice(0, n.width * n.height * 4);\n }\n } catch (t) {\n throw new o(t);\n }\n let s = !1;\n if (null === this._transparentRGBA) {\n if (!r) for (let t = 3; t < a.length; t += 4) 0 === a[t] && (s = !0, t = a.length);\n } else for (let t = 3; t < a.length; t += 4) 0 === a[t] && (a.writeUInt32BE(this._transparentRGBA, t - 3), s = !0);\n return {\n frame: new h(n.width, n.height, a, {\n xOffset: n.x,\n yOffset: n.y,\n disposalMethod: n.disposal,\n interlaced: n.interlaced,\n delayCentisecs: n.delay\n }),\n usesTransparency: s\n };\n }\n _encodeGif(t, e) {\n let r;\n if (e.colorScope === a.LocalColorsOnly) r = s().getColorInfo(t, 0);else if (r = s().getColorInfo(t, 256), !r.colors) {\n if (e.colorScope === a.GlobalColorsOnly) throw new o(\"Too many color indexes for global color table\");\n e.colorScope = a.LocalColorsOnly;\n }\n e.usesTransparency = r.usesTransparency;\n const h = r.palettes;\n return e.colorScope === a.LocalColorsOnly ? function (t, e, r, s) {\n const h = {\n loop: e.loops\n };\n let l,\n f = new i(2e3);\n try {\n l = new n.GifWriter(f, e.width, e.height, h);\n } catch (t) {\n throw new o(t);\n }\n for (let e = 0; e < t.length; ++e) f = m(l, e, t[e], s[e], !0);\n return new a(f.slice(0, l.end()), t, e);\n }(t, e, 0, h) : function (t, e, r, s) {\n const h = {\n colors: s.colors.slice(),\n usesTransparency: s.usesTransparency\n };\n c(h);\n const l = {\n palette: h.colors,\n loop: e.loops\n };\n let f,\n u = new i(2e3);\n try {\n f = new n.GifWriter(u, e.width, e.height, l);\n } catch (t) {\n throw new o(t);\n }\n for (let e = 0; e < t.length; ++e) u = m(f, e, t[e], s, !1);\n return new a(u.slice(0, f.end()), t, e);\n }(t, e, 0, r);\n }\n _getSizeEstimateGlobal(t, e) {\n if (this._testInitialBufferSize > 0) return this._testInitialBufferSize;\n let r = 968;\n const i = p(t);\n return e.forEach(t => {\n r += d(t, i);\n }), r;\n }\n _getSizeEstimateLocal(t, e) {\n if (this._testInitialBufferSize > 0) return this._testInitialBufferSize;\n let r = 200;\n for (let i = 0; i < e.length; ++i) {\n const n = p(t[i]);\n r += d(e[i], n);\n }\n return r;\n }\n };\n },\n 5585: (t, e, r) => {\n \"use strict\";\n\n const i = r(7604),\n {\n GifError: n\n } = r(4364);\n class a extends i {\n constructor(...t) {\n if (super(...t), t[0] instanceof a) {\n const e = t[0];\n this.xOffset = e.xOffset, this.yOffset = e.yOffset, this.disposalMethod = e.disposalMethod, this.delayCentisecs = e.delayCentisecs, this.interlaced = e.interlaced;\n } else {\n const e = t[t.length - 1];\n let r = {};\n \"object\" != typeof e || e instanceof i || (r = e), this.xOffset = r.xOffset || 0, this.yOffset = r.yOffset || 0, this.disposalMethod = void 0 !== r.disposalMethod ? r.disposalMethod : a.DisposeToBackgroundColor, this.delayCentisecs = r.delayCentisecs || 8, this.interlaced = r.interlaced || !1;\n }\n }\n getPalette() {\n const t = new Set(),\n e = this.bitmap.data;\n let r = 0,\n i = !1;\n for (; r < e.length;) {\n if (0 === e[r + 3]) i = !0;else {\n const i = e.readUInt32BE(r, !0) >> 8 & 16777215;\n t.add(i);\n }\n r += 4;\n }\n const n = new Array(t.size),\n a = t.values();\n for (r = 0; r < n.length; ++r) n[r] = a.next().value;\n n.sort((t, e) => t - e);\n let o = n.length;\n return i && ++o, {\n colors: n,\n usesTransparency: i,\n indexCount: o\n };\n }\n }\n a.DisposeToAnything = 0, a.DisposeNothing = 1, a.DisposeToBackgroundColor = 2, a.DisposeToPrevious = 3, e.GifFrame = a;\n },\n 4602: (t, e, r) => {\n \"use strict\";\n\n var i = r(8834).lW;\n const n = r(8522),\n a = r(2460),\n o = r(7604),\n {\n GifFrame: s\n } = r(5585),\n {\n GifError: h\n } = r(4364),\n {\n GifCodec: l\n } = r(6512),\n f = [\".jpg\", \".jpeg\", \".png\", \".bmp\"],\n u = new l();\n function c(t, e, r, i, n) {\n const o = Array.isArray(t) ? t : [t];\n if (n) {\n if ([\"FloydSteinberg\", \"FalseFloydSteinberg\", \"Stucki\", \"Atkinson\", \"Jarvis\", \"Burkes\", \"Sierra\", \"TwoSierra\", \"SierraLite\"].indexOf(n.ditherAlgorithm) < 0) throw new Error(`Invalid ditherAlgorithm '${n.ditherAlgorithm}'`);\n void 0 === n.serpentine && (n.serpentine = !0), void 0 === n.minimumColorDistanceToDither && (n.minimumColorDistanceToDither = 0), void 0 === n.calculateErrorLikeGIMP && (n.calculateErrorLikeGIMP = !1);\n }\n const s = new a.distance.Euclidean(),\n h = new a.palette[e](s, r, i);\n let l;\n l = n ? new a.image.ErrorDiffusionArray(s, a.image.ErrorDiffusionArrayKernel[n.ditherAlgorithm], n.serpentine, n.minimumColorDistanceToDither, n.calculateErrorLikeGIMP) : new a.image.NearestColor(s);\n const f = [];\n o.forEach(t => {\n const e = t.bitmap.data,\n r = new ArrayBuffer(e.length),\n i = new Uint32Array(r);\n for (let t = 0, r = 0; t < e.length; t += 4, ++r) i[r] = e.readUInt32LE(t, !0);\n const n = a.utils.PointContainer.fromUint32Array(i, t.bitmap.width, t.bitmap.height);\n h.sample(n), f.push(n);\n });\n const u = h.quantizeSync();\n for (let t = 0; t < o.length; ++t) {\n const e = o[t].bitmap.data,\n r = l.quantizeSync(f[t], u).toUint32Array();\n for (let t = 0, i = 0; t < e.length; t += 4, ++i) e.writeUInt32LE(r[i], t);\n }\n }\n e.cloneFrames = function (t) {\n let e = [];\n return t.forEach(t => {\n e.push(new s(t));\n }), e;\n }, e.getColorInfo = function (t, e) {\n let r = !1;\n const i = [];\n for (let e = 0; e < t.length; ++e) {\n let n = t[e].getPalette();\n if (n.usesTransparency && (r = !0), n.indexCount > 256) throw new h(`Frame ${e} uses more than 256 color indexes`);\n i.push(n);\n }\n if (0 === e) return {\n usesTransparency: r,\n palettes: i\n };\n const n = new Set();\n i.forEach(t => {\n t.colors.forEach(t => {\n n.add(t);\n });\n });\n let a = n.size;\n if (r && ++a, e && a > e) return {\n usesTransparency: r,\n palettes: i\n };\n const o = new Array(n.size),\n s = n.values();\n for (let t = 0; t < o.length; ++t) o[t] = s.next().value;\n return o.sort((t, e) => t - e), {\n colors: o,\n indexCount: a,\n usesTransparency: r,\n palettes: i\n };\n }, e.copyAsJimp = function (t, r) {\n return e.shareAsJimp(t, new o(r));\n }, e.getMaxDimensions = function (t) {\n let e = 0,\n r = 0;\n return t.forEach(t => {\n const i = t.xOffset + t.bitmap.width;\n i > e && (e = i);\n const n = t.yOffset + t.bitmap.height;\n n > r && (r = n);\n }), {\n maxWidth: e,\n maxHeight: r\n };\n }, e.quantizeDekker = function (t, e, r) {\n c(t, \"NeuQuantFloat\", e = e || 256, 0, r);\n }, e.quantizeSorokin = function (t, e, r, i) {\n let n;\n switch (e = e || 256, r = r || \"min-pop\") {\n case \"min-pop\":\n n = 2;\n break;\n case \"top-pop\":\n n = 1;\n break;\n default:\n throw new Error(`Invalid quantizeSorokin histogram '${r}'`);\n }\n c(t, \"RGBQuant\", e, n, i);\n }, e.quantizeWu = function (t, e, r, i) {\n if (e = e || 256, (r = r || 5) < 1 || r > 8) throw new Error(\"Invalid quantization quality\");\n c(t, \"WuQuant\", e, r, i);\n }, e.read = function (t, e) {\n return e = e || u, i.isBuffer(t) ? e.decodeGif(t) : (r = t, new Promise((t, e) => {\n n.readFile(r, (r, i) => r ? e(r) : t(i));\n })).then(t => e.decodeGif(t));\n var r;\n }, e.shareAsJimp = function (t, e) {\n const r = new t(e.bitmap.width, e.bitmap.height, 0);\n return r.bitmap.data = e.bitmap.data, r;\n }, e.write = function (t, e, r, i) {\n i = i || u;\n const a = t.match(/\\.[a-zA-Z]+$/);\n if (null !== a && f.includes(a[0].toLowerCase())) throw new Error(`GIF '${t}' has an unexpected suffix`);\n return i.encodeGif(e, r).then(e => function (t, e) {\n return new Promise((r, i) => {\n n.writeFile(t, e, t => t ? i(t) : r());\n });\n }(t, e.buffer).then(() => e));\n };\n },\n 9455: (t, e, r) => {\n \"use strict\";\n\n const i = r(7604),\n {\n Gif: n,\n GifError: a\n } = r(4364),\n {\n GifCodec: o\n } = r(6512),\n {\n GifFrame: s\n } = r(5585),\n h = r(4602);\n t.exports = {\n BitmapImage: i,\n Gif: n,\n GifCodec: o,\n GifFrame: s,\n GifUtil: h,\n GifError: a\n };\n },\n 5048: (t, e, r) => {\n var i;\n i = \"undefined\" != typeof window ? window : void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : {}, t.exports = i;\n },\n 2333: (t, e) => {\n e.read = function (t, e, r, i, n) {\n var a,\n o,\n s = 8 * n - i - 1,\n h = (1 << s) - 1,\n l = h >> 1,\n f = -7,\n u = r ? n - 1 : 0,\n c = r ? -1 : 1,\n d = t[e + u];\n for (u += c, a = d & (1 << -f) - 1, d >>= -f, f += s; f > 0; a = 256 * a + t[e + u], u += c, f -= 8);\n for (o = a & (1 << -f) - 1, a >>= -f, f += i; f > 0; o = 256 * o + t[e + u], u += c, f -= 8);\n if (0 === a) a = 1 - l;else {\n if (a === h) return o ? NaN : 1 / 0 * (d ? -1 : 1);\n o += Math.pow(2, i), a -= l;\n }\n return (d ? -1 : 1) * o * Math.pow(2, a - i);\n }, e.write = function (t, e, r, i, n, a) {\n var o,\n s,\n h,\n l = 8 * a - n - 1,\n f = (1 << l) - 1,\n u = f >> 1,\n c = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0,\n d = i ? 0 : a - 1,\n p = i ? 1 : -1,\n m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;\n for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, o = f) : (o = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -o)) < 1 && (o--, h *= 2), (e += o + u >= 1 ? c / h : c * Math.pow(2, 1 - u)) * h >= 2 && (o++, h /= 2), o + u >= f ? (s = 0, o = f) : o + u >= 1 ? (s = (e * h - 1) * Math.pow(2, n), o += u) : (s = e * Math.pow(2, u - 1) * Math.pow(2, n), o = 0)); n >= 8; t[r + d] = 255 & s, d += p, s /= 256, n -= 8);\n for (o = o << n | s, l += n; l > 0; t[r + d] = 255 & o, d += p, o /= 256, l -= 8);\n t[r + d - p] |= 128 * m;\n };\n },\n 9680: t => {\n \"use strict\";\n\n var e = Function.prototype.toString,\n r = /^\\s*class\\b/,\n i = function (t) {\n try {\n var i = e.call(t);\n return r.test(i);\n } catch (t) {\n return !1;\n }\n },\n n = Object.prototype.toString,\n a = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.toStringTag;\n t.exports = function (t) {\n if (!t) return !1;\n if (\"function\" != typeof t && \"object\" != typeof t) return !1;\n if (\"function\" == typeof t && !t.prototype) return !0;\n if (a) return function (t) {\n try {\n return !i(t) && (e.call(t), !0);\n } catch (t) {\n return !1;\n }\n }(t);\n if (i(t)) return !1;\n var r = n.call(t);\n return \"[object Function]\" === r || \"[object GeneratorFunction]\" === r;\n };\n },\n 9748: t => {\n t.exports = function (t) {\n var r = e.call(t);\n return \"[object Function]\" === r || \"function\" == typeof t && \"[object RegExp]\" !== r || \"undefined\" != typeof window && (t === window.setTimeout || t === window.alert || t === window.confirm || t === window.prompt);\n };\n var e = Object.prototype.toString;\n },\n 9307: (t, e, r) => {\n r(6168), t.exports = self.fetch.bind(self);\n },\n 2691: (t, e, r) => {\n var i = r(706),\n n = r(770);\n t.exports = {\n encode: i,\n decode: n\n };\n },\n 770: (t, e, r) => {\n var i = r(8834).lW,\n n = function () {\n \"use strict\";\n\n var t = new Int32Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]),\n e = 4017,\n r = 799,\n i = 3406,\n n = 2276,\n a = 1567,\n o = 3784,\n s = 5793,\n h = 2896;\n function l() {}\n function f(t, e) {\n for (var r, i, n = 0, a = [], o = 16; o > 0 && !t[o - 1];) o--;\n a.push({\n children: [],\n index: 0\n });\n var s,\n h = a[0];\n for (r = 0; r < o; r++) {\n for (i = 0; i < t[r]; i++) {\n for ((h = a.pop()).children[h.index] = e[n]; h.index > 0;) {\n if (0 === a.length) throw new Error(\"Could not recreate Huffman Table\");\n h = a.pop();\n }\n for (h.index++, a.push(h); a.length <= r;) a.push(s = {\n children: [],\n index: 0\n }), h.children[h.index] = s.children, h = s;\n n++;\n }\n r + 1 < o && (a.push(s = {\n children: [],\n index: 0\n }), h.children[h.index] = s.children, h = s);\n }\n return a[0].children;\n }\n function u(e, r, i, n, a, o, s, h, l, f) {\n i.precision, i.samplesPerLine, i.scanLines;\n var u = i.mcusPerLine,\n c = i.progressive,\n d = (i.maxH, i.maxV, r),\n p = 0,\n m = 0;\n function g() {\n if (m > 0) return m--, p >> m & 1;\n if (255 == (p = e[r++])) {\n var t = e[r++];\n if (t) throw new Error(\"unexpected marker: \" + (p << 8 | t).toString(16));\n }\n return m = 7, p >>> 7;\n }\n function b(t) {\n for (var e, r = t; null !== (e = g());) {\n if (\"number\" == typeof (r = r[e])) return r;\n if (\"object\" != typeof r) throw new Error(\"invalid huffman sequence\");\n }\n return null;\n }\n function _(t) {\n for (var e = 0; t > 0;) {\n var r = g();\n if (null === r) return;\n e = e << 1 | r, t--;\n }\n return e;\n }\n function y(t) {\n var e = _(t);\n return e >= 1 << t - 1 ? e : e + (-1 << t) + 1;\n }\n var w,\n v = 0,\n x = 0;\n function E(t, e, r, i, n) {\n var a = r % u,\n o = (r / u | 0) * t.v + i,\n s = a * t.h + n;\n void 0 === t.blocks[o] && f.tolerantDecoding || e(t, t.blocks[o][s]);\n }\n function k(t, e, r) {\n var i = r / t.blocksPerLine | 0,\n n = r % t.blocksPerLine;\n void 0 === t.blocks[i] && f.tolerantDecoding || e(t, t.blocks[i][n]);\n }\n var S,\n M,\n A,\n I,\n B,\n T,\n R = n.length;\n T = c ? 0 === o ? 0 === h ? function (t, e) {\n var r = b(t.huffmanTableDC),\n i = 0 === r ? 0 : y(r) << l;\n e[0] = t.pred += i;\n } : function (t, e) {\n e[0] |= g() << l;\n } : 0 === h ? function (e, r) {\n if (v > 0) v--;else for (var i = o, n = s; i <= n;) {\n var a = b(e.huffmanTableAC),\n h = 15 & a,\n f = a >> 4;\n if (0 !== h) r[t[i += f]] = y(h) * (1 << l), i++;else {\n if (f < 15) {\n v = _(f) + (1 << f) - 1;\n break;\n }\n i += 16;\n }\n }\n } : function (e, r) {\n for (var i = o, n = s, a = 0; i <= n;) {\n var h = t[i],\n f = r[h] < 0 ? -1 : 1;\n switch (x) {\n case 0:\n var u = b(e.huffmanTableAC),\n c = 15 & u;\n if (a = u >> 4, 0 === c) a < 15 ? (v = _(a) + (1 << a), x = 4) : (a = 16, x = 1);else {\n if (1 !== c) throw new Error(\"invalid ACn encoding\");\n w = y(c), x = a ? 2 : 3;\n }\n continue;\n case 1:\n case 2:\n r[h] ? r[h] += (g() << l) * f : 0 == --a && (x = 2 == x ? 3 : 0);\n break;\n case 3:\n r[h] ? r[h] += (g() << l) * f : (r[h] = w << l, x = 0);\n break;\n case 4:\n r[h] && (r[h] += (g() << l) * f);\n }\n i++;\n }\n 4 === x && 0 == --v && (x = 0);\n } : function (e, r) {\n var i = b(e.huffmanTableDC),\n n = 0 === i ? 0 : y(i);\n r[0] = e.pred += n;\n for (var a = 1; a < 64;) {\n var o = b(e.huffmanTableAC),\n s = 15 & o,\n h = o >> 4;\n if (0 !== s) r[t[a += h]] = y(s), a++;else {\n if (h < 15) break;\n a += 16;\n }\n }\n };\n var P,\n O,\n L,\n C,\n U = 0;\n for (O = 1 == R ? n[0].blocksPerLine * n[0].blocksPerColumn : u * i.mcusPerColumn, a || (a = O); U < O;) {\n for (M = 0; M < R; M++) n[M].pred = 0;\n if (v = 0, 1 == R) for (S = n[0], B = 0; B < a; B++) k(S, T, U), U++;else for (B = 0; B < a; B++) {\n for (M = 0; M < R; M++) for (L = (S = n[M]).h, C = S.v, A = 0; A < C; A++) for (I = 0; I < L; I++) E(S, T, U, A, I);\n if (++U === O) break;\n }\n if (U === O) do {\n if (255 === e[r] && 0 !== e[r + 1]) break;\n r += 1;\n } while (r < e.length - 2);\n if (m = 0, (P = e[r] << 8 | e[r + 1]) < 65280) throw new Error(\"marker was not found\");\n if (!(P >= 65488 && P <= 65495)) break;\n r += 2;\n }\n return r - d;\n }\n function c(t, l) {\n var f,\n u,\n c = [],\n d = l.blocksPerLine,\n p = l.blocksPerColumn,\n m = d << 3,\n b = new Int32Array(64),\n _ = new Uint8Array(64);\n function y(t, f, u) {\n var c,\n d,\n p,\n m,\n g,\n b,\n _,\n y,\n w,\n v,\n x = l.quantizationTable,\n E = u;\n for (v = 0; v < 64; v++) E[v] = t[v] * x[v];\n for (v = 0; v < 8; ++v) {\n var k = 8 * v;\n 0 != E[1 + k] || 0 != E[2 + k] || 0 != E[3 + k] || 0 != E[4 + k] || 0 != E[5 + k] || 0 != E[6 + k] || 0 != E[7 + k] ? (c = s * E[0 + k] + 128 >> 8, d = s * E[4 + k] + 128 >> 8, p = E[2 + k], m = E[6 + k], g = h * (E[1 + k] - E[7 + k]) + 128 >> 8, y = h * (E[1 + k] + E[7 + k]) + 128 >> 8, b = E[3 + k] << 4, _ = E[5 + k] << 4, w = c - d + 1 >> 1, c = c + d + 1 >> 1, d = w, w = p * o + m * a + 128 >> 8, p = p * a - m * o + 128 >> 8, m = w, w = g - _ + 1 >> 1, g = g + _ + 1 >> 1, _ = w, w = y + b + 1 >> 1, b = y - b + 1 >> 1, y = w, w = c - m + 1 >> 1, c = c + m + 1 >> 1, m = w, w = d - p + 1 >> 1, d = d + p + 1 >> 1, p = w, w = g * n + y * i + 2048 >> 12, g = g * i - y * n + 2048 >> 12, y = w, w = b * r + _ * e + 2048 >> 12, b = b * e - _ * r + 2048 >> 12, _ = w, E[0 + k] = c + y, E[7 + k] = c - y, E[1 + k] = d + _, E[6 + k] = d - _, E[2 + k] = p + b, E[5 + k] = p - b, E[3 + k] = m + g, E[4 + k] = m - g) : (w = s * E[0 + k] + 512 >> 10, E[0 + k] = w, E[1 + k] = w, E[2 + k] = w, E[3 + k] = w, E[4 + k] = w, E[5 + k] = w, E[6 + k] = w, E[7 + k] = w);\n }\n for (v = 0; v < 8; ++v) {\n var S = v;\n 0 != E[8 + S] || 0 != E[16 + S] || 0 != E[24 + S] || 0 != E[32 + S] || 0 != E[40 + S] || 0 != E[48 + S] || 0 != E[56 + S] ? (c = s * E[0 + S] + 2048 >> 12, d = s * E[32 + S] + 2048 >> 12, p = E[16 + S], m = E[48 + S], g = h * (E[8 + S] - E[56 + S]) + 2048 >> 12, y = h * (E[8 + S] + E[56 + S]) + 2048 >> 12, b = E[24 + S], _ = E[40 + S], w = c - d + 1 >> 1, c = c + d + 1 >> 1, d = w, w = p * o + m * a + 2048 >> 12, p = p * a - m * o + 2048 >> 12, m = w, w = g - _ + 1 >> 1, g = g + _ + 1 >> 1, _ = w, w = y + b + 1 >> 1, b = y - b + 1 >> 1, y = w, w = c - m + 1 >> 1, c = c + m + 1 >> 1, m = w, w = d - p + 1 >> 1, d = d + p + 1 >> 1, p = w, w = g * n + y * i + 2048 >> 12, g = g * i - y * n + 2048 >> 12, y = w, w = b * r + _ * e + 2048 >> 12, b = b * e - _ * r + 2048 >> 12, _ = w, E[0 + S] = c + y, E[56 + S] = c - y, E[8 + S] = d + _, E[48 + S] = d - _, E[16 + S] = p + b, E[40 + S] = p - b, E[24 + S] = m + g, E[32 + S] = m - g) : (w = s * u[v + 0] + 8192 >> 14, E[0 + S] = w, E[8 + S] = w, E[16 + S] = w, E[24 + S] = w, E[32 + S] = w, E[40 + S] = w, E[48 + S] = w, E[56 + S] = w);\n }\n for (v = 0; v < 64; ++v) {\n var M = 128 + (E[v] + 8 >> 4);\n f[v] = M < 0 ? 0 : M > 255 ? 255 : M;\n }\n }\n g(m * p * 8);\n for (var w = 0; w < p; w++) {\n var v = w << 3;\n for (f = 0; f < 8; f++) c.push(new Uint8Array(m));\n for (var x = 0; x < d; x++) {\n y(l.blocks[w][x], _, b);\n var E = 0,\n k = x << 3;\n for (u = 0; u < 8; u++) {\n var S = c[v + u];\n for (f = 0; f < 8; f++) S[k + f] = _[E++];\n }\n }\n }\n return c;\n }\n function d(t) {\n return t < 0 ? 0 : t > 255 ? 255 : t;\n }\n l.prototype = {\n load: function (t) {\n var e = new XMLHttpRequest();\n e.open(\"GET\", t, !0), e.responseType = \"arraybuffer\", e.onload = function () {\n var t = new Uint8Array(e.response || e.mozResponseArrayBuffer);\n this.parse(t), this.onload && this.onload();\n }.bind(this), e.send(null);\n },\n parse: function (e) {\n var r = 1e3 * this.opts.maxResolutionInMP * 1e3,\n i = 0;\n function n() {\n var t = e[i] << 8 | e[i + 1];\n return i += 2, t;\n }\n function a(t) {\n var e,\n r,\n i = 1,\n n = 1;\n for (r in t.components) t.components.hasOwnProperty(r) && (i < (e = t.components[r]).h && (i = e.h), n < e.v && (n = e.v));\n var a = Math.ceil(t.samplesPerLine / 8 / i),\n o = Math.ceil(t.scanLines / 8 / n);\n for (r in t.components) if (t.components.hasOwnProperty(r)) {\n e = t.components[r];\n var s = Math.ceil(Math.ceil(t.samplesPerLine / 8) * e.h / i),\n h = Math.ceil(Math.ceil(t.scanLines / 8) * e.v / n),\n l = a * e.h,\n f = o * e.v,\n u = [];\n g(f * l * 256);\n for (var c = 0; c < f; c++) {\n for (var d = [], p = 0; p < l; p++) d.push(new Int32Array(64));\n u.push(d);\n }\n e.blocksPerLine = s, e.blocksPerColumn = h, e.blocks = u;\n }\n t.maxH = i, t.maxV = n, t.mcusPerLine = a, t.mcusPerColumn = o;\n }\n e.length;\n var o,\n s,\n h,\n l,\n d = null,\n p = null,\n m = [],\n b = [],\n _ = [],\n y = [],\n w = n(),\n v = -1;\n if (this.comments = [], 65496 != w) throw new Error(\"SOI not found\");\n for (w = n(); 65497 != w;) {\n switch (w) {\n case 65280:\n break;\n case 65504:\n case 65505:\n case 65506:\n case 65507:\n case 65508:\n case 65509:\n case 65510:\n case 65511:\n case 65512:\n case 65513:\n case 65514:\n case 65515:\n case 65516:\n case 65517:\n case 65518:\n case 65519:\n case 65534:\n var x = (h = void 0, l = void 0, h = n(), l = e.subarray(i, i + h - 2), i += l.length, l);\n if (65534 === w) {\n var E = String.fromCharCode.apply(null, x);\n this.comments.push(E);\n }\n 65504 === w && 74 === x[0] && 70 === x[1] && 73 === x[2] && 70 === x[3] && 0 === x[4] && (d = {\n version: {\n major: x[5],\n minor: x[6]\n },\n densityUnits: x[7],\n xDensity: x[8] << 8 | x[9],\n yDensity: x[10] << 8 | x[11],\n thumbWidth: x[12],\n thumbHeight: x[13],\n thumbData: x.subarray(14, 14 + 3 * x[12] * x[13])\n }), 65505 === w && 69 === x[0] && 120 === x[1] && 105 === x[2] && 102 === x[3] && 0 === x[4] && (this.exifBuffer = x.subarray(5, x.length)), 65518 === w && 65 === x[0] && 100 === x[1] && 111 === x[2] && 98 === x[3] && 101 === x[4] && 0 === x[5] && (p = {\n version: x[6],\n flags0: x[7] << 8 | x[8],\n flags1: x[9] << 8 | x[10],\n transformCode: x[11]\n });\n break;\n case 65499:\n for (var k = n() + i - 2; i < k;) {\n var S = e[i++];\n g(256);\n var M = new Int32Array(64);\n if (S >> 4 == 0) for (V = 0; V < 64; V++) M[t[V]] = e[i++];else {\n if (S >> 4 != 1) throw new Error(\"DQT: invalid table spec\");\n for (V = 0; V < 64; V++) M[t[V]] = n();\n }\n m[15 & S] = M;\n }\n break;\n case 65472:\n case 65473:\n case 65474:\n n(), (o = {}).extended = 65473 === w, o.progressive = 65474 === w, o.precision = e[i++], o.scanLines = n(), o.samplesPerLine = n(), o.components = {}, o.componentsOrder = [];\n var A = o.scanLines * o.samplesPerLine;\n if (A > r) {\n var I = Math.ceil((A - r) / 1e6);\n throw new Error(`maxResolutionInMP limit exceeded by ${I}MP`);\n }\n var B,\n T = e[i++];\n for (Z = 0; Z < T; Z++) {\n B = e[i];\n var R = e[i + 1] >> 4,\n P = 15 & e[i + 1],\n O = e[i + 2];\n if (R <= 0 || P <= 0) throw new Error(\"Invalid sampling factor, expected values above 0\");\n o.componentsOrder.push(B), o.components[B] = {\n h: R,\n v: P,\n quantizationIdx: O\n }, i += 3;\n }\n a(o), b.push(o);\n break;\n case 65476:\n var L = n();\n for (Z = 2; Z < L;) {\n var C = e[i++],\n U = new Uint8Array(16),\n z = 0;\n for (V = 0; V < 16; V++, i++) z += U[V] = e[i];\n g(16 + z);\n var D = new Uint8Array(z);\n for (V = 0; V < z; V++, i++) D[V] = e[i];\n Z += 17 + z, (C >> 4 == 0 ? y : _)[15 & C] = f(U, D);\n }\n break;\n case 65501:\n n(), s = n();\n break;\n case 65500:\n n(), n();\n break;\n case 65498:\n n();\n var N = e[i++],\n F = [];\n for (Z = 0; Z < N; Z++) {\n X = o.components[e[i++]];\n var j = e[i++];\n X.huffmanTableDC = y[j >> 4], X.huffmanTableAC = _[15 & j], F.push(X);\n }\n var G = e[i++],\n H = e[i++],\n W = e[i++],\n q = u(e, i, o, F, s, G, H, W >> 4, 15 & W, this.opts);\n i += q;\n break;\n case 65535:\n 255 !== e[i] && i--;\n break;\n default:\n if (255 == e[i - 3] && e[i - 2] >= 192 && e[i - 2] <= 254) {\n i -= 3;\n break;\n }\n if (224 === w || 225 == w) {\n if (-1 !== v) throw new Error(`first unknown JPEG marker at offset ${v.toString(16)}, second unknown JPEG marker ${w.toString(16)} at offset ${(i - 1).toString(16)}`);\n v = i - 1;\n const t = n();\n if (255 === e[i + t - 2]) {\n i += t - 2;\n break;\n }\n }\n throw new Error(\"unknown JPEG marker \" + w.toString(16));\n }\n w = n();\n }\n if (1 != b.length) throw new Error(\"only single frame JPEGs supported\");\n for (var Z = 0; Z < b.length; Z++) {\n var Y = b[Z].components;\n for (var V in Y) Y[V].quantizationTable = m[Y[V].quantizationIdx], delete Y[V].quantizationIdx;\n }\n for (this.width = o.samplesPerLine, this.height = o.scanLines, this.jfif = d, this.adobe = p, this.components = [], Z = 0; Z < o.componentsOrder.length; Z++) {\n var X = o.components[o.componentsOrder[Z]];\n this.components.push({\n lines: c(0, X),\n scaleX: X.h / o.maxH,\n scaleY: X.v / o.maxV\n });\n }\n },\n getData: function (t, e) {\n var r,\n i,\n n,\n a,\n o,\n s,\n h,\n l,\n f,\n u,\n c,\n p,\n m,\n b,\n _,\n y,\n w,\n v,\n x,\n E,\n k,\n S = this.width / t,\n M = this.height / e,\n A = 0,\n I = t * e * this.components.length;\n g(I);\n var B = new Uint8Array(I);\n switch (this.components.length) {\n case 1:\n for (r = this.components[0], u = 0; u < e; u++) for (o = r.lines[0 | u * r.scaleY * M], f = 0; f < t; f++) c = o[0 | f * r.scaleX * S], B[A++] = c;\n break;\n case 2:\n for (r = this.components[0], i = this.components[1], u = 0; u < e; u++) for (o = r.lines[0 | u * r.scaleY * M], s = i.lines[0 | u * i.scaleY * M], f = 0; f < t; f++) c = o[0 | f * r.scaleX * S], B[A++] = c, c = s[0 | f * i.scaleX * S], B[A++] = c;\n break;\n case 3:\n for (k = !0, this.adobe && this.adobe.transformCode ? k = !0 : void 0 !== this.opts.colorTransform && (k = !!this.opts.colorTransform), r = this.components[0], i = this.components[1], n = this.components[2], u = 0; u < e; u++) for (o = r.lines[0 | u * r.scaleY * M], s = i.lines[0 | u * i.scaleY * M], h = n.lines[0 | u * n.scaleY * M], f = 0; f < t; f++) k ? (c = o[0 | f * r.scaleX * S], p = s[0 | f * i.scaleX * S], v = d(c + 1.402 * ((m = h[0 | f * n.scaleX * S]) - 128)), x = d(c - .3441363 * (p - 128) - .71413636 * (m - 128)), E = d(c + 1.772 * (p - 128))) : (v = o[0 | f * r.scaleX * S], x = s[0 | f * i.scaleX * S], E = h[0 | f * n.scaleX * S]), B[A++] = v, B[A++] = x, B[A++] = E;\n break;\n case 4:\n if (!this.adobe) throw new Error(\"Unsupported color mode (4 components)\");\n for (k = !1, this.adobe && this.adobe.transformCode ? k = !0 : void 0 !== this.opts.colorTransform && (k = !!this.opts.colorTransform), r = this.components[0], i = this.components[1], n = this.components[2], a = this.components[3], u = 0; u < e; u++) for (o = r.lines[0 | u * r.scaleY * M], s = i.lines[0 | u * i.scaleY * M], h = n.lines[0 | u * n.scaleY * M], l = a.lines[0 | u * a.scaleY * M], f = 0; f < t; f++) k ? (c = o[0 | f * r.scaleX * S], p = s[0 | f * i.scaleX * S], m = h[0 | f * n.scaleX * S], b = l[0 | f * a.scaleX * S], _ = 255 - d(c + 1.402 * (m - 128)), y = 255 - d(c - .3441363 * (p - 128) - .71413636 * (m - 128)), w = 255 - d(c + 1.772 * (p - 128))) : (_ = o[0 | f * r.scaleX * S], y = s[0 | f * i.scaleX * S], w = h[0 | f * n.scaleX * S], b = l[0 | f * a.scaleX * S]), B[A++] = 255 - _, B[A++] = 255 - y, B[A++] = 255 - w, B[A++] = 255 - b;\n break;\n default:\n throw new Error(\"Unsupported color mode\");\n }\n return B;\n },\n copyToImageData: function (t, e) {\n var r,\n i,\n n,\n a,\n o,\n s,\n h,\n l,\n f,\n u = t.width,\n c = t.height,\n p = t.data,\n m = this.getData(u, c),\n g = 0,\n b = 0;\n switch (this.components.length) {\n case 1:\n for (i = 0; i < c; i++) for (r = 0; r < u; r++) n = m[g++], p[b++] = n, p[b++] = n, p[b++] = n, e && (p[b++] = 255);\n break;\n case 3:\n for (i = 0; i < c; i++) for (r = 0; r < u; r++) h = m[g++], l = m[g++], f = m[g++], p[b++] = h, p[b++] = l, p[b++] = f, e && (p[b++] = 255);\n break;\n case 4:\n for (i = 0; i < c; i++) for (r = 0; r < u; r++) o = m[g++], s = m[g++], n = m[g++], h = 255 - d(o * (1 - (a = m[g++]) / 255) + a), l = 255 - d(s * (1 - a / 255) + a), f = 255 - d(n * (1 - a / 255) + a), p[b++] = h, p[b++] = l, p[b++] = f, e && (p[b++] = 255);\n break;\n default:\n throw new Error(\"Unsupported color mode\");\n }\n }\n };\n var p = 0,\n m = 0;\n function g(t = 0) {\n var e = p + t;\n if (e > m) {\n var r = Math.ceil((e - m) / 1024 / 1024);\n throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`);\n }\n p = e;\n }\n return l.resetMaxMemoryUsage = function (t) {\n p = 0, m = t;\n }, l.getBytesAllocated = function () {\n return p;\n }, l.requestMemoryAllocation = g, l;\n }();\n t.exports = function (t, e = {}) {\n var r = {\n colorTransform: void 0,\n useTArray: !1,\n formatAsRGBA: !0,\n tolerantDecoding: !0,\n maxResolutionInMP: 100,\n maxMemoryUsageInMB: 512,\n ...e\n },\n a = new Uint8Array(t),\n o = new n();\n o.opts = r, n.resetMaxMemoryUsage(1024 * r.maxMemoryUsageInMB * 1024), o.parse(a);\n var s = r.formatAsRGBA ? 4 : 3,\n h = o.width * o.height * s;\n try {\n n.requestMemoryAllocation(h);\n var l = {\n width: o.width,\n height: o.height,\n exifBuffer: o.exifBuffer,\n data: r.useTArray ? new Uint8Array(h) : i.alloc(h)\n };\n o.comments.length > 0 && (l.comments = o.comments);\n } catch (t) {\n if (t instanceof RangeError) throw new Error(\"Could not allocate enough memory for the image. Required: \" + h);\n if (t instanceof ReferenceError && \"Buffer is not defined\" === t.message) throw new Error(\"Buffer is not globally defined in this environment. Consider setting useTArray to true\");\n throw t;\n }\n return o.copyToImageData(l, r.formatAsRGBA), l;\n };\n },\n 706: (t, e, r) => {\n var i = r(8834).lW;\n function n(t) {\n Math.round;\n var e,\n r,\n n,\n a,\n o,\n s = Math.floor,\n h = new Array(64),\n l = new Array(64),\n f = new Array(64),\n u = new Array(64),\n c = new Array(65535),\n d = new Array(65535),\n p = new Array(64),\n m = new Array(64),\n g = [],\n b = 0,\n _ = 7,\n y = new Array(64),\n w = new Array(64),\n v = new Array(64),\n x = new Array(256),\n E = new Array(2048),\n k = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63],\n S = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],\n M = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],\n A = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],\n I = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250],\n B = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],\n T = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],\n R = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],\n P = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];\n function O(t, e) {\n for (var r = 0, i = 0, n = new Array(), a = 1; a <= 16; a++) {\n for (var o = 1; o <= t[a]; o++) n[e[i]] = [], n[e[i]][0] = r, n[e[i]][1] = a, i++, r++;\n r *= 2;\n }\n return n;\n }\n function L(t) {\n for (var e = t[0], r = t[1] - 1; r >= 0;) e & 1 << r && (b |= 1 << _), r--, --_ < 0 && (255 == b ? (C(255), C(0)) : C(b), _ = 7, b = 0);\n }\n function C(t) {\n g.push(t);\n }\n function U(t) {\n C(t >> 8 & 255), C(255 & t);\n }\n function z(t, e, r, i, n) {\n for (var a, o = n[0], s = n[240], h = function (t, e) {\n var r,\n i,\n n,\n a,\n o,\n s,\n h,\n l,\n f,\n u,\n c = 0;\n for (f = 0; f < 8; ++f) {\n r = t[c], i = t[c + 1], n = t[c + 2], a = t[c + 3], o = t[c + 4], s = t[c + 5], h = t[c + 6];\n var d = r + (l = t[c + 7]),\n m = r - l,\n g = i + h,\n b = i - h,\n _ = n + s,\n y = n - s,\n w = a + o,\n v = a - o,\n x = d + w,\n E = d - w,\n k = g + _,\n S = g - _;\n t[c] = x + k, t[c + 4] = x - k;\n var M = .707106781 * (S + E);\n t[c + 2] = E + M, t[c + 6] = E - M;\n var A = .382683433 * ((x = v + y) - (S = b + m)),\n I = .5411961 * x + A,\n B = 1.306562965 * S + A,\n T = .707106781 * (k = y + b),\n R = m + T,\n P = m - T;\n t[c + 5] = P + I, t[c + 3] = P - I, t[c + 1] = R + B, t[c + 7] = R - B, c += 8;\n }\n for (c = 0, f = 0; f < 8; ++f) {\n r = t[c], i = t[c + 8], n = t[c + 16], a = t[c + 24], o = t[c + 32], s = t[c + 40], h = t[c + 48];\n var O = r + (l = t[c + 56]),\n L = r - l,\n C = i + h,\n U = i - h,\n z = n + s,\n D = n - s,\n N = a + o,\n F = a - o,\n j = O + N,\n G = O - N,\n H = C + z,\n W = C - z;\n t[c] = j + H, t[c + 32] = j - H;\n var q = .707106781 * (W + G);\n t[c + 16] = G + q, t[c + 48] = G - q;\n var Z = .382683433 * ((j = F + D) - (W = U + L)),\n Y = .5411961 * j + Z,\n V = 1.306562965 * W + Z,\n X = .707106781 * (H = D + U),\n J = L + X,\n Q = L - X;\n t[c + 40] = Q + Y, t[c + 24] = Q - Y, t[c + 8] = J + V, t[c + 56] = J - V, c++;\n }\n for (f = 0; f < 64; ++f) u = t[f] * e[f], p[f] = u > 0 ? u + .5 | 0 : u - .5 | 0;\n return p;\n }(t, e), l = 0; l < 64; ++l) m[k[l]] = h[l];\n var f = m[0] - r;\n r = m[0], 0 == f ? L(i[0]) : (L(i[d[a = 32767 + f]]), L(c[a]));\n for (var u = 63; u > 0 && 0 == m[u]; u--);\n if (0 == u) return L(o), r;\n for (var g, b = 1; b <= u;) {\n for (var _ = b; 0 == m[b] && b <= u; ++b);\n var y = b - _;\n if (y >= 16) {\n g = y >> 4;\n for (var w = 1; w <= g; ++w) L(s);\n y &= 15;\n }\n a = 32767 + m[b], L(n[(y << 4) + d[a]]), L(c[a]), b++;\n }\n return 63 != u && L(o), r;\n }\n function D(t) {\n t <= 0 && (t = 1), t > 100 && (t = 100), o != t && (function (t) {\n for (var e = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], r = 0; r < 64; r++) {\n var i = s((e[r] * t + 50) / 100);\n i < 1 ? i = 1 : i > 255 && (i = 255), h[k[r]] = i;\n }\n for (var n = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], a = 0; a < 64; a++) {\n var o = s((n[a] * t + 50) / 100);\n o < 1 ? o = 1 : o > 255 && (o = 255), l[k[a]] = o;\n }\n for (var c = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], d = 0, p = 0; p < 8; p++) for (var m = 0; m < 8; m++) f[d] = 1 / (h[k[d]] * c[p] * c[m] * 8), u[d] = 1 / (l[k[d]] * c[p] * c[m] * 8), d++;\n }(t < 50 ? Math.floor(5e3 / t) : Math.floor(200 - 2 * t)), o = t);\n }\n this.encode = function (t, o) {\n var s;\n new Date().getTime(), o && D(o), g = new Array(), b = 0, _ = 7, U(65496), U(65504), U(16), C(74), C(70), C(73), C(70), C(0), C(1), C(1), C(0), U(1), U(1), C(0), C(0), void 0 !== (s = t.comments) && s.constructor === Array && s.forEach(t => {\n if (\"string\" == typeof t) {\n U(65534);\n var e,\n r = t.length;\n for (U(r + 2), e = 0; e < r; e++) C(t.charCodeAt(e));\n }\n }), function (t) {\n if (t) {\n U(65505), 69 === t[0] && 120 === t[1] && 105 === t[2] && 102 === t[3] ? U(t.length + 2) : (U(t.length + 5 + 2), C(69), C(120), C(105), C(102), C(0));\n for (var e = 0; e < t.length; e++) C(t[e]);\n }\n }(t.exifBuffer), function () {\n U(65499), U(132), C(0);\n for (var t = 0; t < 64; t++) C(h[t]);\n C(1);\n for (var e = 0; e < 64; e++) C(l[e]);\n }(), function (t, e) {\n U(65472), U(17), C(8), U(e), U(t), C(3), C(1), C(17), C(0), C(2), C(17), C(1), C(3), C(17), C(1);\n }(t.width, t.height), function () {\n U(65476), U(418), C(0);\n for (var t = 0; t < 16; t++) C(S[t + 1]);\n for (var e = 0; e <= 11; e++) C(M[e]);\n C(16);\n for (var r = 0; r < 16; r++) C(A[r + 1]);\n for (var i = 0; i <= 161; i++) C(I[i]);\n C(1);\n for (var n = 0; n < 16; n++) C(B[n + 1]);\n for (var a = 0; a <= 11; a++) C(T[a]);\n C(17);\n for (var o = 0; o < 16; o++) C(R[o + 1]);\n for (var s = 0; s <= 161; s++) C(P[s]);\n }(), U(65498), U(12), C(3), C(1), C(0), C(2), C(17), C(3), C(17), C(0), C(63), C(0);\n var c = 0,\n d = 0,\n p = 0;\n b = 0, _ = 7, this.encode.displayName = \"_encode_\";\n for (var m, x, k, O, N, F, j, G, H, W = t.data, q = t.width, Z = t.height, Y = 4 * q, V = 0; V < Z;) {\n for (m = 0; m < Y;) {\n for (F = N = Y * V + m, j = -1, G = 0, H = 0; H < 64; H++) F = N + (G = H >> 3) * Y + (j = 4 * (7 & H)), V + G >= Z && (F -= Y * (V + 1 + G - Z)), m + j >= Y && (F -= m + j - Y + 4), x = W[F++], k = W[F++], O = W[F++], y[H] = (E[x] + E[k + 256 >> 0] + E[O + 512 >> 0] >> 16) - 128, w[H] = (E[x + 768 >> 0] + E[k + 1024 >> 0] + E[O + 1280 >> 0] >> 16) - 128, v[H] = (E[x + 1280 >> 0] + E[k + 1536 >> 0] + E[O + 1792 >> 0] >> 16) - 128;\n c = z(y, f, c, e, n), d = z(w, u, d, r, a), p = z(v, u, p, r, a), m += 32;\n }\n V += 8;\n }\n if (_ >= 0) {\n var X = [];\n X[1] = _ + 1, X[0] = (1 << _ + 1) - 1, L(X);\n }\n return U(65497), i.from(g);\n }, new Date().getTime(), t || (t = 50), function () {\n for (var t = String.fromCharCode, e = 0; e < 256; e++) x[e] = t(e);\n }(), e = O(S, M), r = O(B, T), n = O(A, I), a = O(R, P), function () {\n for (var t = 1, e = 2, r = 1; r <= 15; r++) {\n for (var i = t; i < e; i++) d[32767 + i] = r, c[32767 + i] = [], c[32767 + i][1] = r, c[32767 + i][0] = i;\n for (var n = -(e - 1); n <= -t; n++) d[32767 + n] = r, c[32767 + n] = [], c[32767 + n][1] = r, c[32767 + n][0] = e - 1 + n;\n t <<= 1, e <<= 1;\n }\n }(), function () {\n for (var t = 0; t < 256; t++) E[t] = 19595 * t, E[t + 256 >> 0] = 38470 * t, E[t + 512 >> 0] = 7471 * t + 32768, E[t + 768 >> 0] = -11059 * t, E[t + 1024 >> 0] = -21709 * t, E[t + 1280 >> 0] = 32768 * t + 8421375, E[t + 1536 >> 0] = -27439 * t, E[t + 1792 >> 0] = -5329 * t;\n }(), D(t), new Date().getTime();\n }\n t.exports = function (t, e) {\n return void 0 === e && (e = 50), {\n data: new n(e).encode(t, e),\n width: t.width,\n height: t.height\n };\n };\n },\n 8058: (t, e, r) => {\n var i = r(8834).lW,\n n = r(6290),\n a = function () {},\n o = r(4398),\n s = r(5947),\n h = r(8438),\n l = r(5565),\n f = r(1960),\n u = self.XMLHttpRequest && \"withCredentials\" in new XMLHttpRequest();\n t.exports = function (t, e) {\n e = \"function\" == typeof e ? e : a, \"string\" == typeof t ? t = {\n uri: t\n } : t || (t = {}), t.binary && (t = function (t) {\n if (u) return f(t, {\n responseType: \"arraybuffer\"\n });\n if (void 0 === self.XMLHttpRequest) throw new Error(\"your browser does not support XHR loading\");\n var e = new self.XMLHttpRequest();\n return e.overrideMimeType(\"text/plain; charset=x-user-defined\"), f({\n xhr: e\n }, t);\n }(t)), n(t, function (r, n, f) {\n if (r) return e(r);\n if (!/^2/.test(n.statusCode)) return e(new Error(\"http status code: \" + n.statusCode));\n if (!f) return e(new Error(\"no body result\"));\n var u,\n c,\n d = !1;\n if (u = f, \"[object ArrayBuffer]\" === Object.prototype.toString.call(u)) {\n var p = new Uint8Array(f);\n f = i.from(p, \"binary\");\n }\n l(f) && (d = !0, \"string\" == typeof f && (f = i.from(f, \"binary\"))), d || (i.isBuffer(f) && (f = f.toString(t.encoding)), f = f.trim());\n try {\n var m = n.headers[\"content-type\"];\n c = d ? h(f) : /json/.test(m) || \"{\" === f.charAt(0) ? JSON.parse(f) : /xml/.test(m) || \"<\" === f.charAt(0) ? s(f) : o(f);\n } catch (t) {\n e(new Error(\"error parsing font \" + t.message)), e = a;\n }\n e(null, c);\n });\n };\n },\n 5565: (t, e, r) => {\n var i = r(8834).lW,\n n = r(5137),\n a = i.from([66, 77, 70, 3]);\n t.exports = function (t) {\n return \"string\" == typeof t ? \"BMF\" === t.substring(0, 3) : t.length > 4 && n(t.slice(0, 4), a);\n };\n },\n 63: (t, e) => {\n \"use strict\";\n\n function r(t, e, r, i) {\n for (var n = t[e++], a = 1 << n, o = a + 1, s = o + 1, h = n + 1, l = (1 << h) - 1, f = 0, u = 0, c = 0, d = t[e++], p = new Int32Array(4096), m = null;;) {\n for (; f < 16 && 0 !== d;) u |= t[e++] << f, f += 8, 1 === d ? d = t[e++] : --d;\n if (f < h) break;\n var g = u & l;\n if (u >>= h, f -= h, g !== a) {\n if (g === o) break;\n for (var b = g < s ? g : m, _ = 0, y = b; y > a;) y = p[y] >> 8, ++_;\n var w = y;\n if (c + _ + (b !== g ? 1 : 0) > i) return void console.log(\"Warning, gif stream longer than expected.\");\n r[c++] = w;\n var v = c += _;\n for (b !== g && (r[c++] = w), y = b; _--;) y = p[y], r[--v] = 255 & y, y >>= 8;\n null !== m && s < 4096 && (p[s++] = m << 8 | w, s >= l + 1 && h < 12 && (++h, l = l << 1 | 1)), m = g;\n } else s = o + 1, l = (1 << (h = n + 1)) - 1, m = null;\n }\n return c !== i && console.log(\"Warning, gif stream shorter than expected.\"), r;\n }\n try {\n e.N = function (t) {\n var e = 0;\n if (71 !== t[e++] || 73 !== t[e++] || 70 !== t[e++] || 56 !== t[e++] || 56 != (t[e++] + 1 & 253) || 97 !== t[e++]) throw new Error(\"Invalid GIF 87a/89a header.\");\n var i = t[e++] | t[e++] << 8,\n n = t[e++] | t[e++] << 8,\n a = t[e++],\n o = a >> 7,\n s = 1 << 1 + (7 & a);\n t[e++], t[e++];\n var h = null,\n l = null;\n o && (h = e, l = s, e += 3 * s);\n var f = !0,\n u = [],\n c = 0,\n d = null,\n p = 0,\n m = null;\n for (this.width = i, this.height = n; f && e < t.length;) switch (t[e++]) {\n case 33:\n switch (t[e++]) {\n case 255:\n if (11 !== t[e] || 78 == t[e + 1] && 69 == t[e + 2] && 84 == t[e + 3] && 83 == t[e + 4] && 67 == t[e + 5] && 65 == t[e + 6] && 80 == t[e + 7] && 69 == t[e + 8] && 50 == t[e + 9] && 46 == t[e + 10] && 48 == t[e + 11] && 3 == t[e + 12] && 1 == t[e + 13] && 0 == t[e + 16]) e += 14, m = t[e++] | t[e++] << 8, e++;else for (e += 12;;) {\n if (!((I = t[e++]) >= 0)) throw Error(\"Invalid block size\");\n if (0 === I) break;\n e += I;\n }\n break;\n case 249:\n if (4 !== t[e++] || 0 !== t[e + 4]) throw new Error(\"Invalid graphics extension block.\");\n var g = t[e++];\n c = t[e++] | t[e++] << 8, d = t[e++], 0 == (1 & g) && (d = null), p = g >> 2 & 7, e++;\n break;\n case 254:\n for (;;) {\n if (!((I = t[e++]) >= 0)) throw Error(\"Invalid block size\");\n if (0 === I) break;\n e += I;\n }\n break;\n default:\n throw new Error(\"Unknown graphic control label: 0x\" + t[e - 1].toString(16));\n }\n break;\n case 44:\n var b = t[e++] | t[e++] << 8,\n _ = t[e++] | t[e++] << 8,\n y = t[e++] | t[e++] << 8,\n w = t[e++] | t[e++] << 8,\n v = t[e++],\n x = v >> 6 & 1,\n E = 1 << 1 + (7 & v),\n k = h,\n S = l,\n M = !1;\n v >> 7 && (M = !0, k = e, S = E, e += 3 * E);\n var A = e;\n for (e++;;) {\n var I;\n if (!((I = t[e++]) >= 0)) throw Error(\"Invalid block size\");\n if (0 === I) break;\n e += I;\n }\n u.push({\n x: b,\n y: _,\n width: y,\n height: w,\n has_local_palette: M,\n palette_offset: k,\n palette_size: S,\n data_offset: A,\n data_length: e - A,\n transparent_index: d,\n interlaced: !!x,\n delay: c,\n disposal: p\n });\n break;\n case 59:\n f = !1;\n break;\n default:\n throw new Error(\"Unknown gif block: 0x\" + t[e - 1].toString(16));\n }\n this.numFrames = function () {\n return u.length;\n }, this.loopCount = function () {\n return m;\n }, this.frameInfo = function (t) {\n if (t < 0 || t >= u.length) throw new Error(\"Frame index out of range.\");\n return u[t];\n }, this.decodeAndBlitFrameBGRA = function (e, n) {\n var a = this.frameInfo(e),\n o = a.width * a.height,\n s = new Uint8Array(o);\n r(t, a.data_offset, s, o);\n var h = a.palette_offset,\n l = a.transparent_index;\n null === l && (l = 256);\n var f = a.width,\n u = i - f,\n c = f,\n d = 4 * (a.y * i + a.x),\n p = 4 * ((a.y + a.height) * i + a.x),\n m = d,\n g = 4 * u;\n !0 === a.interlaced && (g += 4 * i * 7);\n for (var b = 8, _ = 0, y = s.length; _ < y; ++_) {\n var w = s[_];\n if (0 === c && (c = f, (m += g) >= p && (g = 4 * u + 4 * i * (b - 1), m = d + (f + u) * (b << 1), b >>= 1)), w === l) m += 4;else {\n var v = t[h + 3 * w],\n x = t[h + 3 * w + 1],\n E = t[h + 3 * w + 2];\n n[m++] = E, n[m++] = x, n[m++] = v, n[m++] = 255;\n }\n --c;\n }\n }, this.decodeAndBlitFrameRGBA = function (e, n) {\n var a = this.frameInfo(e),\n o = a.width * a.height,\n s = new Uint8Array(o);\n r(t, a.data_offset, s, o);\n var h = a.palette_offset,\n l = a.transparent_index;\n null === l && (l = 256);\n var f = a.width,\n u = i - f,\n c = f,\n d = 4 * (a.y * i + a.x),\n p = 4 * ((a.y + a.height) * i + a.x),\n m = d,\n g = 4 * u;\n !0 === a.interlaced && (g += 4 * i * 7);\n for (var b = 8, _ = 0, y = s.length; _ < y; ++_) {\n var w = s[_];\n if (0 === c && (c = f, (m += g) >= p && (g = 4 * u + 4 * i * (b - 1), m = d + (f + u) * (b << 1), b >>= 1)), w === l) m += 4;else {\n var v = t[h + 3 * w],\n x = t[h + 3 * w + 1],\n E = t[h + 3 * w + 2];\n n[m++] = v, n[m++] = x, n[m++] = E, n[m++] = 255;\n }\n --c;\n }\n };\n };\n } catch (t) {}\n },\n 2845: (t, e, r) => {\n \"use strict\";\n\n var i = {};\n (0, r(9761).assign)(i, r(9880), r(1380), r(1271)), t.exports = i;\n },\n 9880: (t, e, r) => {\n \"use strict\";\n\n var i = r(5789),\n n = r(9761),\n a = r(7944),\n o = r(2950),\n s = r(744),\n h = Object.prototype.toString,\n l = 0,\n f = -1,\n u = 0,\n c = 8;\n function d(t) {\n if (!(this instanceof d)) return new d(t);\n this.options = n.assign({\n level: f,\n method: c,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: u,\n to: \"\"\n }, t || {});\n var e = this.options;\n e.raw && e.windowBits > 0 ? e.windowBits = -e.windowBits : e.gzip && e.windowBits > 0 && e.windowBits < 16 && (e.windowBits += 16), this.err = 0, this.msg = \"\", this.ended = !1, this.chunks = [], this.strm = new s(), this.strm.avail_out = 0;\n var r = i.deflateInit2(this.strm, e.level, e.method, e.windowBits, e.memLevel, e.strategy);\n if (r !== l) throw new Error(o[r]);\n if (e.header && i.deflateSetHeader(this.strm, e.header), e.dictionary) {\n var p;\n if (p = \"string\" == typeof e.dictionary ? a.string2buf(e.dictionary) : \"[object ArrayBuffer]\" === h.call(e.dictionary) ? new Uint8Array(e.dictionary) : e.dictionary, (r = i.deflateSetDictionary(this.strm, p)) !== l) throw new Error(o[r]);\n this._dict_set = !0;\n }\n }\n function p(t, e) {\n var r = new d(e);\n if (r.push(t, !0), r.err) throw r.msg || o[r.err];\n return r.result;\n }\n d.prototype.push = function (t, e) {\n var r,\n o,\n s = this.strm,\n f = this.options.chunkSize;\n if (this.ended) return !1;\n o = e === ~~e ? e : !0 === e ? 4 : 0, \"string\" == typeof t ? s.input = a.string2buf(t) : \"[object ArrayBuffer]\" === h.call(t) ? s.input = new Uint8Array(t) : s.input = t, s.next_in = 0, s.avail_in = s.input.length;\n do {\n if (0 === s.avail_out && (s.output = new n.Buf8(f), s.next_out = 0, s.avail_out = f), 1 !== (r = i.deflate(s, o)) && r !== l) return this.onEnd(r), this.ended = !0, !1;\n 0 !== s.avail_out && (0 !== s.avail_in || 4 !== o && 2 !== o) || (\"string\" === this.options.to ? this.onData(a.buf2binstring(n.shrinkBuf(s.output, s.next_out))) : this.onData(n.shrinkBuf(s.output, s.next_out)));\n } while ((s.avail_in > 0 || 0 === s.avail_out) && 1 !== r);\n return 4 === o ? (r = i.deflateEnd(this.strm), this.onEnd(r), this.ended = !0, r === l) : 2 !== o || (this.onEnd(l), s.avail_out = 0, !0);\n }, d.prototype.onData = function (t) {\n this.chunks.push(t);\n }, d.prototype.onEnd = function (t) {\n t === l && (\"string\" === this.options.to ? this.result = this.chunks.join(\"\") : this.result = n.flattenChunks(this.chunks)), this.chunks = [], this.err = t, this.msg = this.strm.msg;\n }, e.Deflate = d, e.deflate = p, e.deflateRaw = function (t, e) {\n return (e = e || {}).raw = !0, p(t, e);\n }, e.gzip = function (t, e) {\n return (e = e || {}).gzip = !0, p(t, e);\n };\n },\n 1380: (t, e, r) => {\n \"use strict\";\n\n var i = r(5020),\n n = r(9761),\n a = r(7944),\n o = r(1271),\n s = r(2950),\n h = r(744),\n l = r(7357),\n f = Object.prototype.toString;\n function u(t) {\n if (!(this instanceof u)) return new u(t);\n this.options = n.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: \"\"\n }, t || {});\n var e = this.options;\n e.raw && e.windowBits >= 0 && e.windowBits < 16 && (e.windowBits = -e.windowBits, 0 === e.windowBits && (e.windowBits = -15)), !(e.windowBits >= 0 && e.windowBits < 16) || t && t.windowBits || (e.windowBits += 32), e.windowBits > 15 && e.windowBits < 48 && 0 == (15 & e.windowBits) && (e.windowBits |= 15), this.err = 0, this.msg = \"\", this.ended = !1, this.chunks = [], this.strm = new h(), this.strm.avail_out = 0;\n var r = i.inflateInit2(this.strm, e.windowBits);\n if (r !== o.Z_OK) throw new Error(s[r]);\n if (this.header = new l(), i.inflateGetHeader(this.strm, this.header), e.dictionary && (\"string\" == typeof e.dictionary ? e.dictionary = a.string2buf(e.dictionary) : \"[object ArrayBuffer]\" === f.call(e.dictionary) && (e.dictionary = new Uint8Array(e.dictionary)), e.raw && (r = i.inflateSetDictionary(this.strm, e.dictionary)) !== o.Z_OK)) throw new Error(s[r]);\n }\n function c(t, e) {\n var r = new u(e);\n if (r.push(t, !0), r.err) throw r.msg || s[r.err];\n return r.result;\n }\n u.prototype.push = function (t, e) {\n var r,\n s,\n h,\n l,\n u,\n c = this.strm,\n d = this.options.chunkSize,\n p = this.options.dictionary,\n m = !1;\n if (this.ended) return !1;\n s = e === ~~e ? e : !0 === e ? o.Z_FINISH : o.Z_NO_FLUSH, \"string\" == typeof t ? c.input = a.binstring2buf(t) : \"[object ArrayBuffer]\" === f.call(t) ? c.input = new Uint8Array(t) : c.input = t, c.next_in = 0, c.avail_in = c.input.length;\n do {\n if (0 === c.avail_out && (c.output = new n.Buf8(d), c.next_out = 0, c.avail_out = d), (r = i.inflate(c, o.Z_NO_FLUSH)) === o.Z_NEED_DICT && p && (r = i.inflateSetDictionary(this.strm, p)), r === o.Z_BUF_ERROR && !0 === m && (r = o.Z_OK, m = !1), r !== o.Z_STREAM_END && r !== o.Z_OK) return this.onEnd(r), this.ended = !0, !1;\n c.next_out && (0 !== c.avail_out && r !== o.Z_STREAM_END && (0 !== c.avail_in || s !== o.Z_FINISH && s !== o.Z_SYNC_FLUSH) || (\"string\" === this.options.to ? (h = a.utf8border(c.output, c.next_out), l = c.next_out - h, u = a.buf2string(c.output, h), c.next_out = l, c.avail_out = d - l, l && n.arraySet(c.output, c.output, h, l, 0), this.onData(u)) : this.onData(n.shrinkBuf(c.output, c.next_out)))), 0 === c.avail_in && 0 === c.avail_out && (m = !0);\n } while ((c.avail_in > 0 || 0 === c.avail_out) && r !== o.Z_STREAM_END);\n return r === o.Z_STREAM_END && (s = o.Z_FINISH), s === o.Z_FINISH ? (r = i.inflateEnd(this.strm), this.onEnd(r), this.ended = !0, r === o.Z_OK) : s !== o.Z_SYNC_FLUSH || (this.onEnd(o.Z_OK), c.avail_out = 0, !0);\n }, u.prototype.onData = function (t) {\n this.chunks.push(t);\n }, u.prototype.onEnd = function (t) {\n t === o.Z_OK && (\"string\" === this.options.to ? this.result = this.chunks.join(\"\") : this.result = n.flattenChunks(this.chunks)), this.chunks = [], this.err = t, this.msg = this.strm.msg;\n }, e.Inflate = u, e.inflate = c, e.inflateRaw = function (t, e) {\n return (e = e || {}).raw = !0, c(t, e);\n }, e.ungzip = c;\n },\n 9761: (t, e) => {\n \"use strict\";\n\n var r = \"undefined\" != typeof Uint8Array && \"undefined\" != typeof Uint16Array && \"undefined\" != typeof Int32Array;\n function i(t, e) {\n return Object.prototype.hasOwnProperty.call(t, e);\n }\n e.assign = function (t) {\n for (var e = Array.prototype.slice.call(arguments, 1); e.length;) {\n var r = e.shift();\n if (r) {\n if (\"object\" != typeof r) throw new TypeError(r + \"must be non-object\");\n for (var n in r) i(r, n) && (t[n] = r[n]);\n }\n }\n return t;\n }, e.shrinkBuf = function (t, e) {\n return t.length === e ? t : t.subarray ? t.subarray(0, e) : (t.length = e, t);\n };\n var n = {\n arraySet: function (t, e, r, i, n) {\n if (e.subarray && t.subarray) t.set(e.subarray(r, r + i), n);else for (var a = 0; a < i; a++) t[n + a] = e[r + a];\n },\n flattenChunks: function (t) {\n var e, r, i, n, a, o;\n for (i = 0, e = 0, r = t.length; e < r; e++) i += t[e].length;\n for (o = new Uint8Array(i), n = 0, e = 0, r = t.length; e < r; e++) a = t[e], o.set(a, n), n += a.length;\n return o;\n }\n },\n a = {\n arraySet: function (t, e, r, i, n) {\n for (var a = 0; a < i; a++) t[n + a] = e[r + a];\n },\n flattenChunks: function (t) {\n return [].concat.apply([], t);\n }\n };\n e.setTyped = function (t) {\n t ? (e.Buf8 = Uint8Array, e.Buf16 = Uint16Array, e.Buf32 = Int32Array, e.assign(e, n)) : (e.Buf8 = Array, e.Buf16 = Array, e.Buf32 = Array, e.assign(e, a));\n }, e.setTyped(r);\n },\n 7944: (t, e, r) => {\n \"use strict\";\n\n var i = r(9761),\n n = !0,\n a = !0;\n try {\n String.fromCharCode.apply(null, [0]);\n } catch (t) {\n n = !1;\n }\n try {\n String.fromCharCode.apply(null, new Uint8Array(1));\n } catch (t) {\n a = !1;\n }\n for (var o = new i.Buf8(256), s = 0; s < 256; s++) o[s] = s >= 252 ? 6 : s >= 248 ? 5 : s >= 240 ? 4 : s >= 224 ? 3 : s >= 192 ? 2 : 1;\n function h(t, e) {\n if (e < 65534 && (t.subarray && a || !t.subarray && n)) return String.fromCharCode.apply(null, i.shrinkBuf(t, e));\n for (var r = \"\", o = 0; o < e; o++) r += String.fromCharCode(t[o]);\n return r;\n }\n o[254] = o[254] = 1, e.string2buf = function (t) {\n var e,\n r,\n n,\n a,\n o,\n s = t.length,\n h = 0;\n for (a = 0; a < s; a++) 55296 == (64512 & (r = t.charCodeAt(a))) && a + 1 < s && 56320 == (64512 & (n = t.charCodeAt(a + 1))) && (r = 65536 + (r - 55296 << 10) + (n - 56320), a++), h += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4;\n for (e = new i.Buf8(h), o = 0, a = 0; o < h; a++) 55296 == (64512 & (r = t.charCodeAt(a))) && a + 1 < s && 56320 == (64512 & (n = t.charCodeAt(a + 1))) && (r = 65536 + (r - 55296 << 10) + (n - 56320), a++), r < 128 ? e[o++] = r : r < 2048 ? (e[o++] = 192 | r >>> 6, e[o++] = 128 | 63 & r) : r < 65536 ? (e[o++] = 224 | r >>> 12, e[o++] = 128 | r >>> 6 & 63, e[o++] = 128 | 63 & r) : (e[o++] = 240 | r >>> 18, e[o++] = 128 | r >>> 12 & 63, e[o++] = 128 | r >>> 6 & 63, e[o++] = 128 | 63 & r);\n return e;\n }, e.buf2binstring = function (t) {\n return h(t, t.length);\n }, e.binstring2buf = function (t) {\n for (var e = new i.Buf8(t.length), r = 0, n = e.length; r < n; r++) e[r] = t.charCodeAt(r);\n return e;\n }, e.buf2string = function (t, e) {\n var r,\n i,\n n,\n a,\n s = e || t.length,\n l = new Array(2 * s);\n for (i = 0, r = 0; r < s;) if ((n = t[r++]) < 128) l[i++] = n;else if ((a = o[n]) > 4) l[i++] = 65533, r += a - 1;else {\n for (n &= 2 === a ? 31 : 3 === a ? 15 : 7; a > 1 && r < s;) n = n << 6 | 63 & t[r++], a--;\n a > 1 ? l[i++] = 65533 : n < 65536 ? l[i++] = n : (n -= 65536, l[i++] = 55296 | n >> 10 & 1023, l[i++] = 56320 | 1023 & n);\n }\n return h(l, i);\n }, e.utf8border = function (t, e) {\n var r;\n for ((e = e || t.length) > t.length && (e = t.length), r = e - 1; r >= 0 && 128 == (192 & t[r]);) r--;\n return r < 0 || 0 === r ? e : r + o[t[r]] > e ? r : e;\n };\n },\n 5562: t => {\n \"use strict\";\n\n t.exports = function (t, e, r, i) {\n for (var n = 65535 & t | 0, a = t >>> 16 & 65535 | 0, o = 0; 0 !== r;) {\n r -= o = r > 2e3 ? 2e3 : r;\n do {\n a = a + (n = n + e[i++] | 0) | 0;\n } while (--o);\n n %= 65521, a %= 65521;\n }\n return n | a << 16 | 0;\n };\n },\n 1271: t => {\n \"use strict\";\n\n t.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n },\n 4299: t => {\n \"use strict\";\n\n var e = function () {\n for (var t, e = [], r = 0; r < 256; r++) {\n t = r;\n for (var i = 0; i < 8; i++) t = 1 & t ? 3988292384 ^ t >>> 1 : t >>> 1;\n e[r] = t;\n }\n return e;\n }();\n t.exports = function (t, r, i, n) {\n var a = e,\n o = n + i;\n t ^= -1;\n for (var s = n; s < o; s++) t = t >>> 8 ^ a[255 & (t ^ r[s])];\n return -1 ^ t;\n };\n },\n 5789: (t, e, r) => {\n \"use strict\";\n\n var i,\n n = r(9761),\n a = r(9564),\n o = r(5562),\n s = r(4299),\n h = r(2950),\n l = 0,\n f = 4,\n u = 0,\n c = -2,\n d = -1,\n p = 1,\n m = 4,\n g = 2,\n b = 8,\n _ = 9,\n y = 286,\n w = 30,\n v = 19,\n x = 2 * y + 1,\n E = 15,\n k = 3,\n S = 258,\n M = S + k + 1,\n A = 42,\n I = 103,\n B = 113,\n T = 666,\n R = 1,\n P = 2,\n O = 3,\n L = 4;\n function C(t, e) {\n return t.msg = h[e], e;\n }\n function U(t) {\n return (t << 1) - (t > 4 ? 9 : 0);\n }\n function z(t) {\n for (var e = t.length; --e >= 0;) t[e] = 0;\n }\n function D(t) {\n var e = t.state,\n r = e.pending;\n r > t.avail_out && (r = t.avail_out), 0 !== r && (n.arraySet(t.output, e.pending_buf, e.pending_out, r, t.next_out), t.next_out += r, e.pending_out += r, t.total_out += r, t.avail_out -= r, e.pending -= r, 0 === e.pending && (e.pending_out = 0));\n }\n function N(t, e) {\n a._tr_flush_block(t, t.block_start >= 0 ? t.block_start : -1, t.strstart - t.block_start, e), t.block_start = t.strstart, D(t.strm);\n }\n function F(t, e) {\n t.pending_buf[t.pending++] = e;\n }\n function j(t, e) {\n t.pending_buf[t.pending++] = e >>> 8 & 255, t.pending_buf[t.pending++] = 255 & e;\n }\n function G(t, e) {\n var r,\n i,\n n = t.max_chain_length,\n a = t.strstart,\n o = t.prev_length,\n s = t.nice_match,\n h = t.strstart > t.w_size - M ? t.strstart - (t.w_size - M) : 0,\n l = t.window,\n f = t.w_mask,\n u = t.prev,\n c = t.strstart + S,\n d = l[a + o - 1],\n p = l[a + o];\n t.prev_length >= t.good_match && (n >>= 2), s > t.lookahead && (s = t.lookahead);\n do {\n if (l[(r = e) + o] === p && l[r + o - 1] === d && l[r] === l[a] && l[++r] === l[a + 1]) {\n a += 2, r++;\n do {} while (l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && a < c);\n if (i = S - (c - a), a = c - S, i > o) {\n if (t.match_start = e, o = i, i >= s) break;\n d = l[a + o - 1], p = l[a + o];\n }\n }\n } while ((e = u[e & f]) > h && 0 != --n);\n return o <= t.lookahead ? o : t.lookahead;\n }\n function H(t) {\n var e,\n r,\n i,\n a,\n h,\n l,\n f,\n u,\n c,\n d,\n p = t.w_size;\n do {\n if (a = t.window_size - t.lookahead - t.strstart, t.strstart >= p + (p - M)) {\n n.arraySet(t.window, t.window, p, p, 0), t.match_start -= p, t.strstart -= p, t.block_start -= p, e = r = t.hash_size;\n do {\n i = t.head[--e], t.head[e] = i >= p ? i - p : 0;\n } while (--r);\n e = r = p;\n do {\n i = t.prev[--e], t.prev[e] = i >= p ? i - p : 0;\n } while (--r);\n a += p;\n }\n if (0 === t.strm.avail_in) break;\n if (l = t.strm, f = t.window, u = t.strstart + t.lookahead, c = a, d = void 0, (d = l.avail_in) > c && (d = c), r = 0 === d ? 0 : (l.avail_in -= d, n.arraySet(f, l.input, l.next_in, d, u), 1 === l.state.wrap ? l.adler = o(l.adler, f, d, u) : 2 === l.state.wrap && (l.adler = s(l.adler, f, d, u)), l.next_in += d, l.total_in += d, d), t.lookahead += r, t.lookahead + t.insert >= k) for (h = t.strstart - t.insert, t.ins_h = t.window[h], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[h + 1]) & t.hash_mask; t.insert && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[h + k - 1]) & t.hash_mask, t.prev[h & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = h, h++, t.insert--, !(t.lookahead + t.insert < k)););\n } while (t.lookahead < M && 0 !== t.strm.avail_in);\n }\n function W(t, e) {\n for (var r, i;;) {\n if (t.lookahead < M) {\n if (H(t), t.lookahead < M && e === l) return R;\n if (0 === t.lookahead) break;\n }\n if (r = 0, t.lookahead >= k && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + k - 1]) & t.hash_mask, r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), 0 !== r && t.strstart - r <= t.w_size - M && (t.match_length = G(t, r)), t.match_length >= k) {\n if (i = a._tr_tally(t, t.strstart - t.match_start, t.match_length - k), t.lookahead -= t.match_length, t.match_length <= t.max_lazy_match && t.lookahead >= k) {\n t.match_length--;\n do {\n t.strstart++, t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + k - 1]) & t.hash_mask, r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart;\n } while (0 != --t.match_length);\n t.strstart++;\n } else t.strstart += t.match_length, t.match_length = 0, t.ins_h = t.window[t.strstart], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + 1]) & t.hash_mask;\n } else i = a._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++;\n if (i && (N(t, !1), 0 === t.strm.avail_out)) return R;\n }\n return t.insert = t.strstart < k - 1 ? t.strstart : k - 1, e === f ? (N(t, !0), 0 === t.strm.avail_out ? O : L) : t.last_lit && (N(t, !1), 0 === t.strm.avail_out) ? R : P;\n }\n function q(t, e) {\n for (var r, i, n;;) {\n if (t.lookahead < M) {\n if (H(t), t.lookahead < M && e === l) return R;\n if (0 === t.lookahead) break;\n }\n if (r = 0, t.lookahead >= k && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + k - 1]) & t.hash_mask, r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), t.prev_length = t.match_length, t.prev_match = t.match_start, t.match_length = k - 1, 0 !== r && t.prev_length < t.max_lazy_match && t.strstart - r <= t.w_size - M && (t.match_length = G(t, r), t.match_length <= 5 && (t.strategy === p || t.match_length === k && t.strstart - t.match_start > 4096) && (t.match_length = k - 1)), t.prev_length >= k && t.match_length <= t.prev_length) {\n n = t.strstart + t.lookahead - k, i = a._tr_tally(t, t.strstart - 1 - t.prev_match, t.prev_length - k), t.lookahead -= t.prev_length - 1, t.prev_length -= 2;\n do {\n ++t.strstart <= n && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + k - 1]) & t.hash_mask, r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart);\n } while (0 != --t.prev_length);\n if (t.match_available = 0, t.match_length = k - 1, t.strstart++, i && (N(t, !1), 0 === t.strm.avail_out)) return R;\n } else if (t.match_available) {\n if ((i = a._tr_tally(t, 0, t.window[t.strstart - 1])) && N(t, !1), t.strstart++, t.lookahead--, 0 === t.strm.avail_out) return R;\n } else t.match_available = 1, t.strstart++, t.lookahead--;\n }\n return t.match_available && (i = a._tr_tally(t, 0, t.window[t.strstart - 1]), t.match_available = 0), t.insert = t.strstart < k - 1 ? t.strstart : k - 1, e === f ? (N(t, !0), 0 === t.strm.avail_out ? O : L) : t.last_lit && (N(t, !1), 0 === t.strm.avail_out) ? R : P;\n }\n function Z(t, e, r, i, n) {\n this.good_length = t, this.max_lazy = e, this.nice_length = r, this.max_chain = i, this.func = n;\n }\n function Y() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = b, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new n.Buf16(2 * x), this.dyn_dtree = new n.Buf16(2 * (2 * w + 1)), this.bl_tree = new n.Buf16(2 * (2 * v + 1)), z(this.dyn_ltree), z(this.dyn_dtree), z(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new n.Buf16(E + 1), this.heap = new n.Buf16(2 * y + 1), z(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new n.Buf16(2 * y + 1), z(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function V(t) {\n var e;\n return t && t.state ? (t.total_in = t.total_out = 0, t.data_type = g, (e = t.state).pending = 0, e.pending_out = 0, e.wrap < 0 && (e.wrap = -e.wrap), e.status = e.wrap ? A : B, t.adler = 2 === e.wrap ? 0 : 1, e.last_flush = l, a._tr_init(e), u) : C(t, c);\n }\n function X(t) {\n var e,\n r = V(t);\n return r === u && ((e = t.state).window_size = 2 * e.w_size, z(e.head), e.max_lazy_match = i[e.level].max_lazy, e.good_match = i[e.level].good_length, e.nice_match = i[e.level].nice_length, e.max_chain_length = i[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = k - 1, e.match_available = 0, e.ins_h = 0), r;\n }\n function J(t, e, r, i, a, o) {\n if (!t) return c;\n var s = 1;\n if (e === d && (e = 6), i < 0 ? (s = 0, i = -i) : i > 15 && (s = 2, i -= 16), a < 1 || a > _ || r !== b || i < 8 || i > 15 || e < 0 || e > 9 || o < 0 || o > m) return C(t, c);\n 8 === i && (i = 9);\n var h = new Y();\n return t.state = h, h.strm = t, h.wrap = s, h.gzhead = null, h.w_bits = i, h.w_size = 1 << h.w_bits, h.w_mask = h.w_size - 1, h.hash_bits = a + 7, h.hash_size = 1 << h.hash_bits, h.hash_mask = h.hash_size - 1, h.hash_shift = ~~((h.hash_bits + k - 1) / k), h.window = new n.Buf8(2 * h.w_size), h.head = new n.Buf16(h.hash_size), h.prev = new n.Buf16(h.w_size), h.lit_bufsize = 1 << a + 6, h.pending_buf_size = 4 * h.lit_bufsize, h.pending_buf = new n.Buf8(h.pending_buf_size), h.d_buf = 1 * h.lit_bufsize, h.l_buf = 3 * h.lit_bufsize, h.level = e, h.strategy = o, h.method = r, X(t);\n }\n i = [new Z(0, 0, 0, 0, function (t, e) {\n var r = 65535;\n for (r > t.pending_buf_size - 5 && (r = t.pending_buf_size - 5);;) {\n if (t.lookahead <= 1) {\n if (H(t), 0 === t.lookahead && e === l) return R;\n if (0 === t.lookahead) break;\n }\n t.strstart += t.lookahead, t.lookahead = 0;\n var i = t.block_start + r;\n if ((0 === t.strstart || t.strstart >= i) && (t.lookahead = t.strstart - i, t.strstart = i, N(t, !1), 0 === t.strm.avail_out)) return R;\n if (t.strstart - t.block_start >= t.w_size - M && (N(t, !1), 0 === t.strm.avail_out)) return R;\n }\n return t.insert = 0, e === f ? (N(t, !0), 0 === t.strm.avail_out ? O : L) : (t.strstart > t.block_start && (N(t, !1), t.strm.avail_out), R);\n }), new Z(4, 4, 8, 4, W), new Z(4, 5, 16, 8, W), new Z(4, 6, 32, 32, W), new Z(4, 4, 16, 16, q), new Z(8, 16, 32, 32, q), new Z(8, 16, 128, 128, q), new Z(8, 32, 128, 256, q), new Z(32, 128, 258, 1024, q), new Z(32, 258, 258, 4096, q)], e.deflateInit = function (t, e) {\n return J(t, e, b, 15, 8, 0);\n }, e.deflateInit2 = J, e.deflateReset = X, e.deflateResetKeep = V, e.deflateSetHeader = function (t, e) {\n return t && t.state ? 2 !== t.state.wrap ? c : (t.state.gzhead = e, u) : c;\n }, e.deflate = function (t, e) {\n var r, n, o, h;\n if (!t || !t.state || e > 5 || e < 0) return t ? C(t, c) : c;\n if (n = t.state, !t.output || !t.input && 0 !== t.avail_in || n.status === T && e !== f) return C(t, 0 === t.avail_out ? -5 : c);\n if (n.strm = t, r = n.last_flush, n.last_flush = e, n.status === A) if (2 === n.wrap) t.adler = 0, F(n, 31), F(n, 139), F(n, 8), n.gzhead ? (F(n, (n.gzhead.text ? 1 : 0) + (n.gzhead.hcrc ? 2 : 0) + (n.gzhead.extra ? 4 : 0) + (n.gzhead.name ? 8 : 0) + (n.gzhead.comment ? 16 : 0)), F(n, 255 & n.gzhead.time), F(n, n.gzhead.time >> 8 & 255), F(n, n.gzhead.time >> 16 & 255), F(n, n.gzhead.time >> 24 & 255), F(n, 9 === n.level ? 2 : n.strategy >= 2 || n.level < 2 ? 4 : 0), F(n, 255 & n.gzhead.os), n.gzhead.extra && n.gzhead.extra.length && (F(n, 255 & n.gzhead.extra.length), F(n, n.gzhead.extra.length >> 8 & 255)), n.gzhead.hcrc && (t.adler = s(t.adler, n.pending_buf, n.pending, 0)), n.gzindex = 0, n.status = 69) : (F(n, 0), F(n, 0), F(n, 0), F(n, 0), F(n, 0), F(n, 9 === n.level ? 2 : n.strategy >= 2 || n.level < 2 ? 4 : 0), F(n, 3), n.status = B);else {\n var d = b + (n.w_bits - 8 << 4) << 8;\n d |= (n.strategy >= 2 || n.level < 2 ? 0 : n.level < 6 ? 1 : 6 === n.level ? 2 : 3) << 6, 0 !== n.strstart && (d |= 32), d += 31 - d % 31, n.status = B, j(n, d), 0 !== n.strstart && (j(n, t.adler >>> 16), j(n, 65535 & t.adler)), t.adler = 1;\n }\n if (69 === n.status) if (n.gzhead.extra) {\n for (o = n.pending; n.gzindex < (65535 & n.gzhead.extra.length) && (n.pending !== n.pending_buf_size || (n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), D(t), o = n.pending, n.pending !== n.pending_buf_size));) F(n, 255 & n.gzhead.extra[n.gzindex]), n.gzindex++;\n n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), n.gzindex === n.gzhead.extra.length && (n.gzindex = 0, n.status = 73);\n } else n.status = 73;\n if (73 === n.status) if (n.gzhead.name) {\n o = n.pending;\n do {\n if (n.pending === n.pending_buf_size && (n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), D(t), o = n.pending, n.pending === n.pending_buf_size)) {\n h = 1;\n break;\n }\n h = n.gzindex < n.gzhead.name.length ? 255 & n.gzhead.name.charCodeAt(n.gzindex++) : 0, F(n, h);\n } while (0 !== h);\n n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), 0 === h && (n.gzindex = 0, n.status = 91);\n } else n.status = 91;\n if (91 === n.status) if (n.gzhead.comment) {\n o = n.pending;\n do {\n if (n.pending === n.pending_buf_size && (n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), D(t), o = n.pending, n.pending === n.pending_buf_size)) {\n h = 1;\n break;\n }\n h = n.gzindex < n.gzhead.comment.length ? 255 & n.gzhead.comment.charCodeAt(n.gzindex++) : 0, F(n, h);\n } while (0 !== h);\n n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), 0 === h && (n.status = I);\n } else n.status = I;\n if (n.status === I && (n.gzhead.hcrc ? (n.pending + 2 > n.pending_buf_size && D(t), n.pending + 2 <= n.pending_buf_size && (F(n, 255 & t.adler), F(n, t.adler >> 8 & 255), t.adler = 0, n.status = B)) : n.status = B), 0 !== n.pending) {\n if (D(t), 0 === t.avail_out) return n.last_flush = -1, u;\n } else if (0 === t.avail_in && U(e) <= U(r) && e !== f) return C(t, -5);\n if (n.status === T && 0 !== t.avail_in) return C(t, -5);\n if (0 !== t.avail_in || 0 !== n.lookahead || e !== l && n.status !== T) {\n var p = 2 === n.strategy ? function (t, e) {\n for (var r;;) {\n if (0 === t.lookahead && (H(t), 0 === t.lookahead)) {\n if (e === l) return R;\n break;\n }\n if (t.match_length = 0, r = a._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++, r && (N(t, !1), 0 === t.strm.avail_out)) return R;\n }\n return t.insert = 0, e === f ? (N(t, !0), 0 === t.strm.avail_out ? O : L) : t.last_lit && (N(t, !1), 0 === t.strm.avail_out) ? R : P;\n }(n, e) : 3 === n.strategy ? function (t, e) {\n for (var r, i, n, o, s = t.window;;) {\n if (t.lookahead <= S) {\n if (H(t), t.lookahead <= S && e === l) return R;\n if (0 === t.lookahead) break;\n }\n if (t.match_length = 0, t.lookahead >= k && t.strstart > 0 && (i = s[n = t.strstart - 1]) === s[++n] && i === s[++n] && i === s[++n]) {\n o = t.strstart + S;\n do {} while (i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && n < o);\n t.match_length = S - (o - n), t.match_length > t.lookahead && (t.match_length = t.lookahead);\n }\n if (t.match_length >= k ? (r = a._tr_tally(t, 1, t.match_length - k), t.lookahead -= t.match_length, t.strstart += t.match_length, t.match_length = 0) : (r = a._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++), r && (N(t, !1), 0 === t.strm.avail_out)) return R;\n }\n return t.insert = 0, e === f ? (N(t, !0), 0 === t.strm.avail_out ? O : L) : t.last_lit && (N(t, !1), 0 === t.strm.avail_out) ? R : P;\n }(n, e) : i[n.level].func(n, e);\n if (p !== O && p !== L || (n.status = T), p === R || p === O) return 0 === t.avail_out && (n.last_flush = -1), u;\n if (p === P && (1 === e ? a._tr_align(n) : 5 !== e && (a._tr_stored_block(n, 0, 0, !1), 3 === e && (z(n.head), 0 === n.lookahead && (n.strstart = 0, n.block_start = 0, n.insert = 0))), D(t), 0 === t.avail_out)) return n.last_flush = -1, u;\n }\n return e !== f ? u : n.wrap <= 0 ? 1 : (2 === n.wrap ? (F(n, 255 & t.adler), F(n, t.adler >> 8 & 255), F(n, t.adler >> 16 & 255), F(n, t.adler >> 24 & 255), F(n, 255 & t.total_in), F(n, t.total_in >> 8 & 255), F(n, t.total_in >> 16 & 255), F(n, t.total_in >> 24 & 255)) : (j(n, t.adler >>> 16), j(n, 65535 & t.adler)), D(t), n.wrap > 0 && (n.wrap = -n.wrap), 0 !== n.pending ? u : 1);\n }, e.deflateEnd = function (t) {\n var e;\n return t && t.state ? (e = t.state.status) !== A && 69 !== e && 73 !== e && 91 !== e && e !== I && e !== B && e !== T ? C(t, c) : (t.state = null, e === B ? C(t, -3) : u) : c;\n }, e.deflateSetDictionary = function (t, e) {\n var r,\n i,\n a,\n s,\n h,\n l,\n f,\n d,\n p = e.length;\n if (!t || !t.state) return c;\n if (2 === (s = (r = t.state).wrap) || 1 === s && r.status !== A || r.lookahead) return c;\n for (1 === s && (t.adler = o(t.adler, e, p, 0)), r.wrap = 0, p >= r.w_size && (0 === s && (z(r.head), r.strstart = 0, r.block_start = 0, r.insert = 0), d = new n.Buf8(r.w_size), n.arraySet(d, e, p - r.w_size, r.w_size, 0), e = d, p = r.w_size), h = t.avail_in, l = t.next_in, f = t.input, t.avail_in = p, t.next_in = 0, t.input = e, H(r); r.lookahead >= k;) {\n i = r.strstart, a = r.lookahead - (k - 1);\n do {\n r.ins_h = (r.ins_h << r.hash_shift ^ r.window[i + k - 1]) & r.hash_mask, r.prev[i & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = i, i++;\n } while (--a);\n r.strstart = i, r.lookahead = k - 1, H(r);\n }\n return r.strstart += r.lookahead, r.block_start = r.strstart, r.insert = r.lookahead, r.lookahead = 0, r.match_length = r.prev_length = k - 1, r.match_available = 0, t.next_in = l, t.input = f, t.avail_in = h, r.wrap = s, u;\n }, e.deflateInfo = \"pako deflate (from Nodeca project)\";\n },\n 7357: t => {\n \"use strict\";\n\n t.exports = function () {\n this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = \"\", this.comment = \"\", this.hcrc = 0, this.done = !1;\n };\n },\n 4980: t => {\n \"use strict\";\n\n t.exports = function (t, e) {\n var r, i, n, a, o, s, h, l, f, u, c, d, p, m, g, b, _, y, w, v, x, E, k, S, M;\n r = t.state, i = t.next_in, S = t.input, n = i + (t.avail_in - 5), a = t.next_out, M = t.output, o = a - (e - t.avail_out), s = a + (t.avail_out - 257), h = r.dmax, l = r.wsize, f = r.whave, u = r.wnext, c = r.window, d = r.hold, p = r.bits, m = r.lencode, g = r.distcode, b = (1 << r.lenbits) - 1, _ = (1 << r.distbits) - 1;\n t: do {\n p < 15 && (d += S[i++] << p, p += 8, d += S[i++] << p, p += 8), y = m[d & b];\n e: for (;;) {\n if (d >>>= w = y >>> 24, p -= w, 0 == (w = y >>> 16 & 255)) M[a++] = 65535 & y;else {\n if (!(16 & w)) {\n if (0 == (64 & w)) {\n y = m[(65535 & y) + (d & (1 << w) - 1)];\n continue e;\n }\n if (32 & w) {\n r.mode = 12;\n break t;\n }\n t.msg = \"invalid literal/length code\", r.mode = 30;\n break t;\n }\n v = 65535 & y, (w &= 15) && (p < w && (d += S[i++] << p, p += 8), v += d & (1 << w) - 1, d >>>= w, p -= w), p < 15 && (d += S[i++] << p, p += 8, d += S[i++] << p, p += 8), y = g[d & _];\n r: for (;;) {\n if (d >>>= w = y >>> 24, p -= w, !(16 & (w = y >>> 16 & 255))) {\n if (0 == (64 & w)) {\n y = g[(65535 & y) + (d & (1 << w) - 1)];\n continue r;\n }\n t.msg = \"invalid distance code\", r.mode = 30;\n break t;\n }\n if (x = 65535 & y, p < (w &= 15) && (d += S[i++] << p, (p += 8) < w && (d += S[i++] << p, p += 8)), (x += d & (1 << w) - 1) > h) {\n t.msg = \"invalid distance too far back\", r.mode = 30;\n break t;\n }\n if (d >>>= w, p -= w, x > (w = a - o)) {\n if ((w = x - w) > f && r.sane) {\n t.msg = \"invalid distance too far back\", r.mode = 30;\n break t;\n }\n if (E = 0, k = c, 0 === u) {\n if (E += l - w, w < v) {\n v -= w;\n do {\n M[a++] = c[E++];\n } while (--w);\n E = a - x, k = M;\n }\n } else if (u < w) {\n if (E += l + u - w, (w -= u) < v) {\n v -= w;\n do {\n M[a++] = c[E++];\n } while (--w);\n if (E = 0, u < v) {\n v -= w = u;\n do {\n M[a++] = c[E++];\n } while (--w);\n E = a - x, k = M;\n }\n }\n } else if (E += u - w, w < v) {\n v -= w;\n do {\n M[a++] = c[E++];\n } while (--w);\n E = a - x, k = M;\n }\n for (; v > 2;) M[a++] = k[E++], M[a++] = k[E++], M[a++] = k[E++], v -= 3;\n v && (M[a++] = k[E++], v > 1 && (M[a++] = k[E++]));\n } else {\n E = a - x;\n do {\n M[a++] = M[E++], M[a++] = M[E++], M[a++] = M[E++], v -= 3;\n } while (v > 2);\n v && (M[a++] = M[E++], v > 1 && (M[a++] = M[E++]));\n }\n break;\n }\n }\n break;\n }\n } while (i < n && a < s);\n i -= v = p >> 3, d &= (1 << (p -= v << 3)) - 1, t.next_in = i, t.next_out = a, t.avail_in = i < n ? n - i + 5 : 5 - (i - n), t.avail_out = a < s ? s - a + 257 : 257 - (a - s), r.hold = d, r.bits = p;\n };\n },\n 5020: (t, e, r) => {\n \"use strict\";\n\n var i = r(9761),\n n = r(5562),\n a = r(4299),\n o = r(4980),\n s = r(881),\n h = 1,\n l = 2,\n f = 0,\n u = -2,\n c = 1,\n d = 12,\n p = 30,\n m = 852,\n g = 592;\n function b(t) {\n return (t >>> 24 & 255) + (t >>> 8 & 65280) + ((65280 & t) << 8) + ((255 & t) << 24);\n }\n function _() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new i.Buf16(320), this.work = new i.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function y(t) {\n var e;\n return t && t.state ? (e = t.state, t.total_in = t.total_out = e.total = 0, t.msg = \"\", e.wrap && (t.adler = 1 & e.wrap), e.mode = c, e.last = 0, e.havedict = 0, e.dmax = 32768, e.head = null, e.hold = 0, e.bits = 0, e.lencode = e.lendyn = new i.Buf32(m), e.distcode = e.distdyn = new i.Buf32(g), e.sane = 1, e.back = -1, f) : u;\n }\n function w(t) {\n var e;\n return t && t.state ? ((e = t.state).wsize = 0, e.whave = 0, e.wnext = 0, y(t)) : u;\n }\n function v(t, e) {\n var r, i;\n return t && t.state ? (i = t.state, e < 0 ? (r = 0, e = -e) : (r = 1 + (e >> 4), e < 48 && (e &= 15)), e && (e < 8 || e > 15) ? u : (null !== i.window && i.wbits !== e && (i.window = null), i.wrap = r, i.wbits = e, w(t))) : u;\n }\n function x(t, e) {\n var r, i;\n return t ? (i = new _(), t.state = i, i.window = null, (r = v(t, e)) !== f && (t.state = null), r) : u;\n }\n var E,\n k,\n S = !0;\n function M(t) {\n if (S) {\n var e;\n for (E = new i.Buf32(512), k = new i.Buf32(32), e = 0; e < 144;) t.lens[e++] = 8;\n for (; e < 256;) t.lens[e++] = 9;\n for (; e < 280;) t.lens[e++] = 7;\n for (; e < 288;) t.lens[e++] = 8;\n for (s(h, t.lens, 0, 288, E, 0, t.work, {\n bits: 9\n }), e = 0; e < 32;) t.lens[e++] = 5;\n s(l, t.lens, 0, 32, k, 0, t.work, {\n bits: 5\n }), S = !1;\n }\n t.lencode = E, t.lenbits = 9, t.distcode = k, t.distbits = 5;\n }\n function A(t, e, r, n) {\n var a,\n o = t.state;\n return null === o.window && (o.wsize = 1 << o.wbits, o.wnext = 0, o.whave = 0, o.window = new i.Buf8(o.wsize)), n >= o.wsize ? (i.arraySet(o.window, e, r - o.wsize, o.wsize, 0), o.wnext = 0, o.whave = o.wsize) : ((a = o.wsize - o.wnext) > n && (a = n), i.arraySet(o.window, e, r - n, a, o.wnext), (n -= a) ? (i.arraySet(o.window, e, r - n, n, 0), o.wnext = n, o.whave = o.wsize) : (o.wnext += a, o.wnext === o.wsize && (o.wnext = 0), o.whave < o.wsize && (o.whave += a))), 0;\n }\n e.inflateReset = w, e.inflateReset2 = v, e.inflateResetKeep = y, e.inflateInit = function (t) {\n return x(t, 15);\n }, e.inflateInit2 = x, e.inflate = function (t, e) {\n var r,\n m,\n g,\n _,\n y,\n w,\n v,\n x,\n E,\n k,\n S,\n I,\n B,\n T,\n R,\n P,\n O,\n L,\n C,\n U,\n z,\n D,\n N,\n F,\n j = 0,\n G = new i.Buf8(4),\n H = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!t || !t.state || !t.output || !t.input && 0 !== t.avail_in) return u;\n (r = t.state).mode === d && (r.mode = 13), y = t.next_out, g = t.output, v = t.avail_out, _ = t.next_in, m = t.input, w = t.avail_in, x = r.hold, E = r.bits, k = w, S = v, D = f;\n t: for (;;) switch (r.mode) {\n case c:\n if (0 === r.wrap) {\n r.mode = 13;\n break;\n }\n for (; E < 16;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (2 & r.wrap && 35615 === x) {\n r.check = 0, G[0] = 255 & x, G[1] = x >>> 8 & 255, r.check = a(r.check, G, 2, 0), x = 0, E = 0, r.mode = 2;\n break;\n }\n if (r.flags = 0, r.head && (r.head.done = !1), !(1 & r.wrap) || (((255 & x) << 8) + (x >> 8)) % 31) {\n t.msg = \"incorrect header check\", r.mode = p;\n break;\n }\n if (8 != (15 & x)) {\n t.msg = \"unknown compression method\", r.mode = p;\n break;\n }\n if (E -= 4, z = 8 + (15 & (x >>>= 4)), 0 === r.wbits) r.wbits = z;else if (z > r.wbits) {\n t.msg = \"invalid window size\", r.mode = p;\n break;\n }\n r.dmax = 1 << z, t.adler = r.check = 1, r.mode = 512 & x ? 10 : d, x = 0, E = 0;\n break;\n case 2:\n for (; E < 16;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (r.flags = x, 8 != (255 & r.flags)) {\n t.msg = \"unknown compression method\", r.mode = p;\n break;\n }\n if (57344 & r.flags) {\n t.msg = \"unknown header flags set\", r.mode = p;\n break;\n }\n r.head && (r.head.text = x >> 8 & 1), 512 & r.flags && (G[0] = 255 & x, G[1] = x >>> 8 & 255, r.check = a(r.check, G, 2, 0)), x = 0, E = 0, r.mode = 3;\n case 3:\n for (; E < 32;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n r.head && (r.head.time = x), 512 & r.flags && (G[0] = 255 & x, G[1] = x >>> 8 & 255, G[2] = x >>> 16 & 255, G[3] = x >>> 24 & 255, r.check = a(r.check, G, 4, 0)), x = 0, E = 0, r.mode = 4;\n case 4:\n for (; E < 16;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n r.head && (r.head.xflags = 255 & x, r.head.os = x >> 8), 512 & r.flags && (G[0] = 255 & x, G[1] = x >>> 8 & 255, r.check = a(r.check, G, 2, 0)), x = 0, E = 0, r.mode = 5;\n case 5:\n if (1024 & r.flags) {\n for (; E < 16;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n r.length = x, r.head && (r.head.extra_len = x), 512 & r.flags && (G[0] = 255 & x, G[1] = x >>> 8 & 255, r.check = a(r.check, G, 2, 0)), x = 0, E = 0;\n } else r.head && (r.head.extra = null);\n r.mode = 6;\n case 6:\n if (1024 & r.flags && ((I = r.length) > w && (I = w), I && (r.head && (z = r.head.extra_len - r.length, r.head.extra || (r.head.extra = new Array(r.head.extra_len)), i.arraySet(r.head.extra, m, _, I, z)), 512 & r.flags && (r.check = a(r.check, m, I, _)), w -= I, _ += I, r.length -= I), r.length)) break t;\n r.length = 0, r.mode = 7;\n case 7:\n if (2048 & r.flags) {\n if (0 === w) break t;\n I = 0;\n do {\n z = m[_ + I++], r.head && z && r.length < 65536 && (r.head.name += String.fromCharCode(z));\n } while (z && I < w);\n if (512 & r.flags && (r.check = a(r.check, m, I, _)), w -= I, _ += I, z) break t;\n } else r.head && (r.head.name = null);\n r.length = 0, r.mode = 8;\n case 8:\n if (4096 & r.flags) {\n if (0 === w) break t;\n I = 0;\n do {\n z = m[_ + I++], r.head && z && r.length < 65536 && (r.head.comment += String.fromCharCode(z));\n } while (z && I < w);\n if (512 & r.flags && (r.check = a(r.check, m, I, _)), w -= I, _ += I, z) break t;\n } else r.head && (r.head.comment = null);\n r.mode = 9;\n case 9:\n if (512 & r.flags) {\n for (; E < 16;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (x !== (65535 & r.check)) {\n t.msg = \"header crc mismatch\", r.mode = p;\n break;\n }\n x = 0, E = 0;\n }\n r.head && (r.head.hcrc = r.flags >> 9 & 1, r.head.done = !0), t.adler = r.check = 0, r.mode = d;\n break;\n case 10:\n for (; E < 32;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n t.adler = r.check = b(x), x = 0, E = 0, r.mode = 11;\n case 11:\n if (0 === r.havedict) return t.next_out = y, t.avail_out = v, t.next_in = _, t.avail_in = w, r.hold = x, r.bits = E, 2;\n t.adler = r.check = 1, r.mode = d;\n case d:\n if (5 === e || 6 === e) break t;\n case 13:\n if (r.last) {\n x >>>= 7 & E, E -= 7 & E, r.mode = 27;\n break;\n }\n for (; E < 3;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n switch (r.last = 1 & x, E -= 1, 3 & (x >>>= 1)) {\n case 0:\n r.mode = 14;\n break;\n case 1:\n if (M(r), r.mode = 20, 6 === e) {\n x >>>= 2, E -= 2;\n break t;\n }\n break;\n case 2:\n r.mode = 17;\n break;\n case 3:\n t.msg = \"invalid block type\", r.mode = p;\n }\n x >>>= 2, E -= 2;\n break;\n case 14:\n for (x >>>= 7 & E, E -= 7 & E; E < 32;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if ((65535 & x) != (x >>> 16 ^ 65535)) {\n t.msg = \"invalid stored block lengths\", r.mode = p;\n break;\n }\n if (r.length = 65535 & x, x = 0, E = 0, r.mode = 15, 6 === e) break t;\n case 15:\n r.mode = 16;\n case 16:\n if (I = r.length) {\n if (I > w && (I = w), I > v && (I = v), 0 === I) break t;\n i.arraySet(g, m, _, I, y), w -= I, _ += I, v -= I, y += I, r.length -= I;\n break;\n }\n r.mode = d;\n break;\n case 17:\n for (; E < 14;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (r.nlen = 257 + (31 & x), x >>>= 5, E -= 5, r.ndist = 1 + (31 & x), x >>>= 5, E -= 5, r.ncode = 4 + (15 & x), x >>>= 4, E -= 4, r.nlen > 286 || r.ndist > 30) {\n t.msg = \"too many length or distance symbols\", r.mode = p;\n break;\n }\n r.have = 0, r.mode = 18;\n case 18:\n for (; r.have < r.ncode;) {\n for (; E < 3;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n r.lens[H[r.have++]] = 7 & x, x >>>= 3, E -= 3;\n }\n for (; r.have < 19;) r.lens[H[r.have++]] = 0;\n if (r.lencode = r.lendyn, r.lenbits = 7, N = {\n bits: r.lenbits\n }, D = s(0, r.lens, 0, 19, r.lencode, 0, r.work, N), r.lenbits = N.bits, D) {\n t.msg = \"invalid code lengths set\", r.mode = p;\n break;\n }\n r.have = 0, r.mode = 19;\n case 19:\n for (; r.have < r.nlen + r.ndist;) {\n for (; P = (j = r.lencode[x & (1 << r.lenbits) - 1]) >>> 16 & 255, O = 65535 & j, !((R = j >>> 24) <= E);) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (O < 16) x >>>= R, E -= R, r.lens[r.have++] = O;else {\n if (16 === O) {\n for (F = R + 2; E < F;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (x >>>= R, E -= R, 0 === r.have) {\n t.msg = \"invalid bit length repeat\", r.mode = p;\n break;\n }\n z = r.lens[r.have - 1], I = 3 + (3 & x), x >>>= 2, E -= 2;\n } else if (17 === O) {\n for (F = R + 3; E < F;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n E -= R, z = 0, I = 3 + (7 & (x >>>= R)), x >>>= 3, E -= 3;\n } else {\n for (F = R + 7; E < F;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n E -= R, z = 0, I = 11 + (127 & (x >>>= R)), x >>>= 7, E -= 7;\n }\n if (r.have + I > r.nlen + r.ndist) {\n t.msg = \"invalid bit length repeat\", r.mode = p;\n break;\n }\n for (; I--;) r.lens[r.have++] = z;\n }\n }\n if (r.mode === p) break;\n if (0 === r.lens[256]) {\n t.msg = \"invalid code -- missing end-of-block\", r.mode = p;\n break;\n }\n if (r.lenbits = 9, N = {\n bits: r.lenbits\n }, D = s(h, r.lens, 0, r.nlen, r.lencode, 0, r.work, N), r.lenbits = N.bits, D) {\n t.msg = \"invalid literal/lengths set\", r.mode = p;\n break;\n }\n if (r.distbits = 6, r.distcode = r.distdyn, N = {\n bits: r.distbits\n }, D = s(l, r.lens, r.nlen, r.ndist, r.distcode, 0, r.work, N), r.distbits = N.bits, D) {\n t.msg = \"invalid distances set\", r.mode = p;\n break;\n }\n if (r.mode = 20, 6 === e) break t;\n case 20:\n r.mode = 21;\n case 21:\n if (w >= 6 && v >= 258) {\n t.next_out = y, t.avail_out = v, t.next_in = _, t.avail_in = w, r.hold = x, r.bits = E, o(t, S), y = t.next_out, g = t.output, v = t.avail_out, _ = t.next_in, m = t.input, w = t.avail_in, x = r.hold, E = r.bits, r.mode === d && (r.back = -1);\n break;\n }\n for (r.back = 0; P = (j = r.lencode[x & (1 << r.lenbits) - 1]) >>> 16 & 255, O = 65535 & j, !((R = j >>> 24) <= E);) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (P && 0 == (240 & P)) {\n for (L = R, C = P, U = O; P = (j = r.lencode[U + ((x & (1 << L + C) - 1) >> L)]) >>> 16 & 255, O = 65535 & j, !(L + (R = j >>> 24) <= E);) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n x >>>= L, E -= L, r.back += L;\n }\n if (x >>>= R, E -= R, r.back += R, r.length = O, 0 === P) {\n r.mode = 26;\n break;\n }\n if (32 & P) {\n r.back = -1, r.mode = d;\n break;\n }\n if (64 & P) {\n t.msg = \"invalid literal/length code\", r.mode = p;\n break;\n }\n r.extra = 15 & P, r.mode = 22;\n case 22:\n if (r.extra) {\n for (F = r.extra; E < F;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n r.length += x & (1 << r.extra) - 1, x >>>= r.extra, E -= r.extra, r.back += r.extra;\n }\n r.was = r.length, r.mode = 23;\n case 23:\n for (; P = (j = r.distcode[x & (1 << r.distbits) - 1]) >>> 16 & 255, O = 65535 & j, !((R = j >>> 24) <= E);) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (0 == (240 & P)) {\n for (L = R, C = P, U = O; P = (j = r.distcode[U + ((x & (1 << L + C) - 1) >> L)]) >>> 16 & 255, O = 65535 & j, !(L + (R = j >>> 24) <= E);) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n x >>>= L, E -= L, r.back += L;\n }\n if (x >>>= R, E -= R, r.back += R, 64 & P) {\n t.msg = \"invalid distance code\", r.mode = p;\n break;\n }\n r.offset = O, r.extra = 15 & P, r.mode = 24;\n case 24:\n if (r.extra) {\n for (F = r.extra; E < F;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n r.offset += x & (1 << r.extra) - 1, x >>>= r.extra, E -= r.extra, r.back += r.extra;\n }\n if (r.offset > r.dmax) {\n t.msg = \"invalid distance too far back\", r.mode = p;\n break;\n }\n r.mode = 25;\n case 25:\n if (0 === v) break t;\n if (I = S - v, r.offset > I) {\n if ((I = r.offset - I) > r.whave && r.sane) {\n t.msg = \"invalid distance too far back\", r.mode = p;\n break;\n }\n I > r.wnext ? (I -= r.wnext, B = r.wsize - I) : B = r.wnext - I, I > r.length && (I = r.length), T = r.window;\n } else T = g, B = y - r.offset, I = r.length;\n I > v && (I = v), v -= I, r.length -= I;\n do {\n g[y++] = T[B++];\n } while (--I);\n 0 === r.length && (r.mode = 21);\n break;\n case 26:\n if (0 === v) break t;\n g[y++] = r.length, v--, r.mode = 21;\n break;\n case 27:\n if (r.wrap) {\n for (; E < 32;) {\n if (0 === w) break t;\n w--, x |= m[_++] << E, E += 8;\n }\n if (S -= v, t.total_out += S, r.total += S, S && (t.adler = r.check = r.flags ? a(r.check, g, S, y - S) : n(r.check, g, S, y - S)), S = v, (r.flags ? x : b(x)) !== r.check) {\n t.msg = \"incorrect data check\", r.mode = p;\n break;\n }\n x = 0, E = 0;\n }\n r.mode = 28;\n case 28:\n if (r.wrap && r.flags) {\n for (; E < 32;) {\n if (0 === w) break t;\n w--, x += m[_++] << E, E += 8;\n }\n if (x !== (4294967295 & r.total)) {\n t.msg = \"incorrect length check\", r.mode = p;\n break;\n }\n x = 0, E = 0;\n }\n r.mode = 29;\n case 29:\n D = 1;\n break t;\n case p:\n D = -3;\n break t;\n case 31:\n return -4;\n default:\n return u;\n }\n return t.next_out = y, t.avail_out = v, t.next_in = _, t.avail_in = w, r.hold = x, r.bits = E, (r.wsize || S !== t.avail_out && r.mode < p && (r.mode < 27 || 4 !== e)) && A(t, t.output, t.next_out, S - t.avail_out) ? (r.mode = 31, -4) : (k -= t.avail_in, S -= t.avail_out, t.total_in += k, t.total_out += S, r.total += S, r.wrap && S && (t.adler = r.check = r.flags ? a(r.check, g, S, t.next_out - S) : n(r.check, g, S, t.next_out - S)), t.data_type = r.bits + (r.last ? 64 : 0) + (r.mode === d ? 128 : 0) + (20 === r.mode || 15 === r.mode ? 256 : 0), (0 === k && 0 === S || 4 === e) && D === f && (D = -5), D);\n }, e.inflateEnd = function (t) {\n if (!t || !t.state) return u;\n var e = t.state;\n return e.window && (e.window = null), t.state = null, f;\n }, e.inflateGetHeader = function (t, e) {\n var r;\n return t && t.state ? 0 == (2 & (r = t.state).wrap) ? u : (r.head = e, e.done = !1, f) : u;\n }, e.inflateSetDictionary = function (t, e) {\n var r,\n i = e.length;\n return t && t.state ? 0 !== (r = t.state).wrap && 11 !== r.mode ? u : 11 === r.mode && n(1, e, i, 0) !== r.check ? -3 : A(t, e, i, i) ? (r.mode = 31, -4) : (r.havedict = 1, f) : u;\n }, e.inflateInfo = \"pako inflate (from Nodeca project)\";\n },\n 881: (t, e, r) => {\n \"use strict\";\n\n var i = r(9761),\n n = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0],\n a = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78],\n o = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0],\n s = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];\n t.exports = function (t, e, r, h, l, f, u, c) {\n var d,\n p,\n m,\n g,\n b,\n _,\n y,\n w,\n v,\n x = c.bits,\n E = 0,\n k = 0,\n S = 0,\n M = 0,\n A = 0,\n I = 0,\n B = 0,\n T = 0,\n R = 0,\n P = 0,\n O = null,\n L = 0,\n C = new i.Buf16(16),\n U = new i.Buf16(16),\n z = null,\n D = 0;\n for (E = 0; E <= 15; E++) C[E] = 0;\n for (k = 0; k < h; k++) C[e[r + k]]++;\n for (A = x, M = 15; M >= 1 && 0 === C[M]; M--);\n if (A > M && (A = M), 0 === M) return l[f++] = 20971520, l[f++] = 20971520, c.bits = 1, 0;\n for (S = 1; S < M && 0 === C[S]; S++);\n for (A < S && (A = S), T = 1, E = 1; E <= 15; E++) if (T <<= 1, (T -= C[E]) < 0) return -1;\n if (T > 0 && (0 === t || 1 !== M)) return -1;\n for (U[1] = 0, E = 1; E < 15; E++) U[E + 1] = U[E] + C[E];\n for (k = 0; k < h; k++) 0 !== e[r + k] && (u[U[e[r + k]]++] = k);\n if (0 === t ? (O = z = u, _ = 19) : 1 === t ? (O = n, L -= 257, z = a, D -= 257, _ = 256) : (O = o, z = s, _ = -1), P = 0, k = 0, E = S, b = f, I = A, B = 0, m = -1, g = (R = 1 << A) - 1, 1 === t && R > 852 || 2 === t && R > 592) return 1;\n for (;;) {\n y = E - B, u[k] < _ ? (w = 0, v = u[k]) : u[k] > _ ? (w = z[D + u[k]], v = O[L + u[k]]) : (w = 96, v = 0), d = 1 << E - B, S = p = 1 << I;\n do {\n l[b + (P >> B) + (p -= d)] = y << 24 | w << 16 | v | 0;\n } while (0 !== p);\n for (d = 1 << E - 1; P & d;) d >>= 1;\n if (0 !== d ? (P &= d - 1, P += d) : P = 0, k++, 0 == --C[E]) {\n if (E === M) break;\n E = e[r + u[k]];\n }\n if (E > A && (P & g) !== m) {\n for (0 === B && (B = A), b += S, T = 1 << (I = E - B); I + B < M && !((T -= C[I + B]) <= 0);) I++, T <<= 1;\n if (R += 1 << I, 1 === t && R > 852 || 2 === t && R > 592) return 1;\n l[m = P & g] = A << 24 | I << 16 | b - f | 0;\n }\n }\n return 0 !== P && (l[b + P] = E - B << 24 | 64 << 16 | 0), c.bits = A, 0;\n };\n },\n 2950: t => {\n \"use strict\";\n\n t.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n },\n 9564: (t, e, r) => {\n \"use strict\";\n\n var i = r(9761);\n function n(t) {\n for (var e = t.length; --e >= 0;) t[e] = 0;\n }\n var a = 0,\n o = 256,\n s = o + 1 + 29,\n h = 30,\n l = 19,\n f = 2 * s + 1,\n u = 15,\n c = 16,\n d = 256,\n p = 16,\n m = 17,\n g = 18,\n b = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0],\n _ = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13],\n y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7],\n w = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],\n v = new Array(2 * (s + 2));\n n(v);\n var x = new Array(2 * h);\n n(x);\n var E = new Array(512);\n n(E);\n var k = new Array(256);\n n(k);\n var S = new Array(29);\n n(S);\n var M,\n A,\n I,\n B = new Array(h);\n function T(t, e, r, i, n) {\n this.static_tree = t, this.extra_bits = e, this.extra_base = r, this.elems = i, this.max_length = n, this.has_stree = t && t.length;\n }\n function R(t, e) {\n this.dyn_tree = t, this.max_code = 0, this.stat_desc = e;\n }\n function P(t) {\n return t < 256 ? E[t] : E[256 + (t >>> 7)];\n }\n function O(t, e) {\n t.pending_buf[t.pending++] = 255 & e, t.pending_buf[t.pending++] = e >>> 8 & 255;\n }\n function L(t, e, r) {\n t.bi_valid > c - r ? (t.bi_buf |= e << t.bi_valid & 65535, O(t, t.bi_buf), t.bi_buf = e >> c - t.bi_valid, t.bi_valid += r - c) : (t.bi_buf |= e << t.bi_valid & 65535, t.bi_valid += r);\n }\n function C(t, e, r) {\n L(t, r[2 * e], r[2 * e + 1]);\n }\n function U(t, e) {\n var r = 0;\n do {\n r |= 1 & t, t >>>= 1, r <<= 1;\n } while (--e > 0);\n return r >>> 1;\n }\n function z(t, e, r) {\n var i,\n n,\n a = new Array(u + 1),\n o = 0;\n for (i = 1; i <= u; i++) a[i] = o = o + r[i - 1] << 1;\n for (n = 0; n <= e; n++) {\n var s = t[2 * n + 1];\n 0 !== s && (t[2 * n] = U(a[s]++, s));\n }\n }\n function D(t) {\n var e;\n for (e = 0; e < s; e++) t.dyn_ltree[2 * e] = 0;\n for (e = 0; e < h; e++) t.dyn_dtree[2 * e] = 0;\n for (e = 0; e < l; e++) t.bl_tree[2 * e] = 0;\n t.dyn_ltree[2 * d] = 1, t.opt_len = t.static_len = 0, t.last_lit = t.matches = 0;\n }\n function N(t) {\n t.bi_valid > 8 ? O(t, t.bi_buf) : t.bi_valid > 0 && (t.pending_buf[t.pending++] = t.bi_buf), t.bi_buf = 0, t.bi_valid = 0;\n }\n function F(t, e, r, i) {\n var n = 2 * e,\n a = 2 * r;\n return t[n] < t[a] || t[n] === t[a] && i[e] <= i[r];\n }\n function j(t, e, r) {\n for (var i = t.heap[r], n = r << 1; n <= t.heap_len && (n < t.heap_len && F(e, t.heap[n + 1], t.heap[n], t.depth) && n++, !F(e, i, t.heap[n], t.depth));) t.heap[r] = t.heap[n], r = n, n <<= 1;\n t.heap[r] = i;\n }\n function G(t, e, r) {\n var i,\n n,\n a,\n s,\n h = 0;\n if (0 !== t.last_lit) do {\n i = t.pending_buf[t.d_buf + 2 * h] << 8 | t.pending_buf[t.d_buf + 2 * h + 1], n = t.pending_buf[t.l_buf + h], h++, 0 === i ? C(t, n, e) : (C(t, (a = k[n]) + o + 1, e), 0 !== (s = b[a]) && L(t, n -= S[a], s), C(t, a = P(--i), r), 0 !== (s = _[a]) && L(t, i -= B[a], s));\n } while (h < t.last_lit);\n C(t, d, e);\n }\n function H(t, e) {\n var r,\n i,\n n,\n a = e.dyn_tree,\n o = e.stat_desc.static_tree,\n s = e.stat_desc.has_stree,\n h = e.stat_desc.elems,\n l = -1;\n for (t.heap_len = 0, t.heap_max = f, r = 0; r < h; r++) 0 !== a[2 * r] ? (t.heap[++t.heap_len] = l = r, t.depth[r] = 0) : a[2 * r + 1] = 0;\n for (; t.heap_len < 2;) a[2 * (n = t.heap[++t.heap_len] = l < 2 ? ++l : 0)] = 1, t.depth[n] = 0, t.opt_len--, s && (t.static_len -= o[2 * n + 1]);\n for (e.max_code = l, r = t.heap_len >> 1; r >= 1; r--) j(t, a, r);\n n = h;\n do {\n r = t.heap[1], t.heap[1] = t.heap[t.heap_len--], j(t, a, 1), i = t.heap[1], t.heap[--t.heap_max] = r, t.heap[--t.heap_max] = i, a[2 * n] = a[2 * r] + a[2 * i], t.depth[n] = (t.depth[r] >= t.depth[i] ? t.depth[r] : t.depth[i]) + 1, a[2 * r + 1] = a[2 * i + 1] = n, t.heap[1] = n++, j(t, a, 1);\n } while (t.heap_len >= 2);\n t.heap[--t.heap_max] = t.heap[1], function (t, e) {\n var r,\n i,\n n,\n a,\n o,\n s,\n h = e.dyn_tree,\n l = e.max_code,\n c = e.stat_desc.static_tree,\n d = e.stat_desc.has_stree,\n p = e.stat_desc.extra_bits,\n m = e.stat_desc.extra_base,\n g = e.stat_desc.max_length,\n b = 0;\n for (a = 0; a <= u; a++) t.bl_count[a] = 0;\n for (h[2 * t.heap[t.heap_max] + 1] = 0, r = t.heap_max + 1; r < f; r++) (a = h[2 * h[2 * (i = t.heap[r]) + 1] + 1] + 1) > g && (a = g, b++), h[2 * i + 1] = a, i > l || (t.bl_count[a]++, o = 0, i >= m && (o = p[i - m]), s = h[2 * i], t.opt_len += s * (a + o), d && (t.static_len += s * (c[2 * i + 1] + o)));\n if (0 !== b) {\n do {\n for (a = g - 1; 0 === t.bl_count[a];) a--;\n t.bl_count[a]--, t.bl_count[a + 1] += 2, t.bl_count[g]--, b -= 2;\n } while (b > 0);\n for (a = g; 0 !== a; a--) for (i = t.bl_count[a]; 0 !== i;) (n = t.heap[--r]) > l || (h[2 * n + 1] !== a && (t.opt_len += (a - h[2 * n + 1]) * h[2 * n], h[2 * n + 1] = a), i--);\n }\n }(t, e), z(a, l, t.bl_count);\n }\n function W(t, e, r) {\n var i,\n n,\n a = -1,\n o = e[1],\n s = 0,\n h = 7,\n l = 4;\n for (0 === o && (h = 138, l = 3), e[2 * (r + 1) + 1] = 65535, i = 0; i <= r; i++) n = o, o = e[2 * (i + 1) + 1], ++s < h && n === o || (s < l ? t.bl_tree[2 * n] += s : 0 !== n ? (n !== a && t.bl_tree[2 * n]++, t.bl_tree[2 * p]++) : s <= 10 ? t.bl_tree[2 * m]++ : t.bl_tree[2 * g]++, s = 0, a = n, 0 === o ? (h = 138, l = 3) : n === o ? (h = 6, l = 3) : (h = 7, l = 4));\n }\n function q(t, e, r) {\n var i,\n n,\n a = -1,\n o = e[1],\n s = 0,\n h = 7,\n l = 4;\n for (0 === o && (h = 138, l = 3), i = 0; i <= r; i++) if (n = o, o = e[2 * (i + 1) + 1], !(++s < h && n === o)) {\n if (s < l) do {\n C(t, n, t.bl_tree);\n } while (0 != --s);else 0 !== n ? (n !== a && (C(t, n, t.bl_tree), s--), C(t, p, t.bl_tree), L(t, s - 3, 2)) : s <= 10 ? (C(t, m, t.bl_tree), L(t, s - 3, 3)) : (C(t, g, t.bl_tree), L(t, s - 11, 7));\n s = 0, a = n, 0 === o ? (h = 138, l = 3) : n === o ? (h = 6, l = 3) : (h = 7, l = 4);\n }\n }\n n(B);\n var Z = !1;\n function Y(t, e, r, n) {\n L(t, (a << 1) + (n ? 1 : 0), 3), function (t, e, r, n) {\n N(t), O(t, r), O(t, ~r), i.arraySet(t.pending_buf, t.window, e, r, t.pending), t.pending += r;\n }(t, e, r);\n }\n e._tr_init = function (t) {\n Z || (function () {\n var t,\n e,\n r,\n i,\n n,\n a = new Array(u + 1);\n for (r = 0, i = 0; i < 28; i++) for (S[i] = r, t = 0; t < 1 << b[i]; t++) k[r++] = i;\n for (k[r - 1] = i, n = 0, i = 0; i < 16; i++) for (B[i] = n, t = 0; t < 1 << _[i]; t++) E[n++] = i;\n for (n >>= 7; i < h; i++) for (B[i] = n << 7, t = 0; t < 1 << _[i] - 7; t++) E[256 + n++] = i;\n for (e = 0; e <= u; e++) a[e] = 0;\n for (t = 0; t <= 143;) v[2 * t + 1] = 8, t++, a[8]++;\n for (; t <= 255;) v[2 * t + 1] = 9, t++, a[9]++;\n for (; t <= 279;) v[2 * t + 1] = 7, t++, a[7]++;\n for (; t <= 287;) v[2 * t + 1] = 8, t++, a[8]++;\n for (z(v, s + 1, a), t = 0; t < h; t++) x[2 * t + 1] = 5, x[2 * t] = U(t, 5);\n M = new T(v, b, o + 1, s, u), A = new T(x, _, 0, h, u), I = new T(new Array(0), y, 0, l, 7);\n }(), Z = !0), t.l_desc = new R(t.dyn_ltree, M), t.d_desc = new R(t.dyn_dtree, A), t.bl_desc = new R(t.bl_tree, I), t.bi_buf = 0, t.bi_valid = 0, D(t);\n }, e._tr_stored_block = Y, e._tr_flush_block = function (t, e, r, i) {\n var n,\n a,\n s = 0;\n t.level > 0 ? (2 === t.strm.data_type && (t.strm.data_type = function (t) {\n var e,\n r = 4093624447;\n for (e = 0; e <= 31; e++, r >>>= 1) if (1 & r && 0 !== t.dyn_ltree[2 * e]) return 0;\n if (0 !== t.dyn_ltree[18] || 0 !== t.dyn_ltree[20] || 0 !== t.dyn_ltree[26]) return 1;\n for (e = 32; e < o; e++) if (0 !== t.dyn_ltree[2 * e]) return 1;\n return 0;\n }(t)), H(t, t.l_desc), H(t, t.d_desc), s = function (t) {\n var e;\n for (W(t, t.dyn_ltree, t.l_desc.max_code), W(t, t.dyn_dtree, t.d_desc.max_code), H(t, t.bl_desc), e = l - 1; e >= 3 && 0 === t.bl_tree[2 * w[e] + 1]; e--);\n return t.opt_len += 3 * (e + 1) + 5 + 5 + 4, e;\n }(t), n = t.opt_len + 3 + 7 >>> 3, (a = t.static_len + 3 + 7 >>> 3) <= n && (n = a)) : n = a = r + 5, r + 4 <= n && -1 !== e ? Y(t, e, r, i) : 4 === t.strategy || a === n ? (L(t, 2 + (i ? 1 : 0), 3), G(t, v, x)) : (L(t, 4 + (i ? 1 : 0), 3), function (t, e, r, i) {\n var n;\n for (L(t, e - 257, 5), L(t, r - 1, 5), L(t, i - 4, 4), n = 0; n < i; n++) L(t, t.bl_tree[2 * w[n] + 1], 3);\n q(t, t.dyn_ltree, e - 1), q(t, t.dyn_dtree, r - 1);\n }(t, t.l_desc.max_code + 1, t.d_desc.max_code + 1, s + 1), G(t, t.dyn_ltree, t.dyn_dtree)), D(t), i && N(t);\n }, e._tr_tally = function (t, e, r) {\n return t.pending_buf[t.d_buf + 2 * t.last_lit] = e >>> 8 & 255, t.pending_buf[t.d_buf + 2 * t.last_lit + 1] = 255 & e, t.pending_buf[t.l_buf + t.last_lit] = 255 & r, t.last_lit++, 0 === e ? t.dyn_ltree[2 * r]++ : (t.matches++, e--, t.dyn_ltree[2 * (k[r] + o + 1)]++, t.dyn_dtree[2 * P(e)]++), t.last_lit === t.lit_bufsize - 1;\n }, e._tr_align = function (t) {\n L(t, 2, 3), C(t, d, v), function (t) {\n 16 === t.bi_valid ? (O(t, t.bi_buf), t.bi_buf = 0, t.bi_valid = 0) : t.bi_valid >= 8 && (t.pending_buf[t.pending++] = 255 & t.bi_buf, t.bi_buf >>= 8, t.bi_valid -= 8);\n }(t);\n };\n },\n 744: t => {\n \"use strict\";\n\n t.exports = function () {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n };\n },\n 4398: t => {\n function e(t, e) {\n if (!(t = t.replace(/\\t+/g, \" \").trim())) return null;\n var i = t.indexOf(\" \");\n if (-1 === i) throw new Error(\"no named row at line \" + e);\n var n = t.substring(0, i);\n t = (t = (t = (t = t.substring(i + 1)).replace(/letter=[\\'\\\"]\\S+[\\'\\\"]/gi, \"\")).split(\"=\")).map(function (t) {\n return t.trim().match(/(\".*?\"|[^\"\\s]+)+(?=\\s*|\\s*$)/g);\n });\n for (var a = [], o = 0; o < t.length; o++) {\n var s = t[o];\n 0 === o ? a.push({\n key: s[0],\n data: \"\"\n }) : o === t.length - 1 ? a[a.length - 1].data = r(s[0]) : (a[a.length - 1].data = r(s[0]), a.push({\n key: s[1],\n data: \"\"\n }));\n }\n var h = {\n key: n,\n data: {}\n };\n return a.forEach(function (t) {\n h.data[t.key] = t.data;\n }), h;\n }\n function r(t) {\n return t && 0 !== t.length ? 0 === t.indexOf('\"') || 0 === t.indexOf(\"'\") ? t.substring(1, t.length - 1) : -1 !== t.indexOf(\",\") ? function (t) {\n return t.split(\",\").map(function (t) {\n return parseInt(t, 10);\n });\n }(t) : parseInt(t, 10) : \"\";\n }\n t.exports = function (t) {\n if (!t) throw new Error(\"no data provided\");\n var r = {\n pages: [],\n chars: [],\n kernings: []\n },\n i = (t = t.toString().trim()).split(/\\r\\n?|\\n/g);\n if (0 === i.length) throw new Error(\"no data in BMFont file\");\n for (var n = 0; n < i.length; n++) {\n var a = e(i[n], n);\n if (a) if (\"page\" === a.key) {\n if (\"number\" != typeof a.data.id) throw new Error(\"malformed file at line \" + n + \" -- needs page id=N\");\n if (\"string\" != typeof a.data.file) throw new Error(\"malformed file at line \" + n + ' -- needs page file=\"path\"');\n r.pages[a.data.id] = a.data.file;\n } else \"chars\" === a.key || \"kernings\" === a.key || (\"char\" === a.key ? r.chars.push(a.data) : \"kerning\" === a.key ? r.kernings.push(a.data) : r[a.key] = a.data);\n }\n return r;\n };\n },\n 8438: t => {\n var e = [66, 77, 70];\n function r(t, e, r) {\n if (r > e.length - 1) return 0;\n var n = e.readUInt8(r++),\n a = e.readInt32LE(r);\n switch (r += 4, n) {\n case 1:\n t.info = function (t, e) {\n var r = {};\n r.size = t.readInt16LE(e);\n var n = t.readUInt8(e + 2);\n return r.smooth = n >> 7 & 1, r.unicode = n >> 6 & 1, r.italic = n >> 5 & 1, r.bold = n >> 4 & 1, n >> 3 & 1 && (r.fixedHeight = 1), r.charset = t.readUInt8(e + 3) || \"\", r.stretchH = t.readUInt16LE(e + 4), r.aa = t.readUInt8(e + 6), r.padding = [t.readInt8(e + 7), t.readInt8(e + 8), t.readInt8(e + 9), t.readInt8(e + 10)], r.spacing = [t.readInt8(e + 11), t.readInt8(e + 12)], r.outline = t.readUInt8(e + 13), r.face = function (t, e) {\n return i(t, e).toString(\"utf8\");\n }(t, e + 14), r;\n }(e, r);\n break;\n case 2:\n t.common = function (t, e) {\n var r = {};\n return r.lineHeight = t.readUInt16LE(e), r.base = t.readUInt16LE(e + 2), r.scaleW = t.readUInt16LE(e + 4), r.scaleH = t.readUInt16LE(e + 6), r.pages = t.readUInt16LE(e + 8), t.readUInt8(e + 10), r.packed = 0, r.alphaChnl = t.readUInt8(e + 11), r.redChnl = t.readUInt8(e + 12), r.greenChnl = t.readUInt8(e + 13), r.blueChnl = t.readUInt8(e + 14), r;\n }(e, r);\n break;\n case 3:\n t.pages = function (t, e, r) {\n for (var n = [], a = i(t, e), o = a.length + 1, s = r / o, h = 0; h < s; h++) n[h] = t.slice(e, e + a.length).toString(\"utf8\"), e += o;\n return n;\n }(e, r, a);\n break;\n case 4:\n t.chars = function (t, e, r) {\n for (var i = [], n = r / 20, a = 0; a < n; a++) {\n var o = {},\n s = 20 * a;\n o.id = t.readUInt32LE(e + 0 + s), o.x = t.readUInt16LE(e + 4 + s), o.y = t.readUInt16LE(e + 6 + s), o.width = t.readUInt16LE(e + 8 + s), o.height = t.readUInt16LE(e + 10 + s), o.xoffset = t.readInt16LE(e + 12 + s), o.yoffset = t.readInt16LE(e + 14 + s), o.xadvance = t.readInt16LE(e + 16 + s), o.page = t.readUInt8(e + 18 + s), o.chnl = t.readUInt8(e + 19 + s), i[a] = o;\n }\n return i;\n }(e, r, a);\n break;\n case 5:\n t.kernings = function (t, e, r) {\n for (var i = [], n = r / 10, a = 0; a < n; a++) {\n var o = {},\n s = 10 * a;\n o.first = t.readUInt32LE(e + 0 + s), o.second = t.readUInt32LE(e + 4 + s), o.amount = t.readInt16LE(e + 8 + s), i[a] = o;\n }\n return i;\n }(e, r, a);\n }\n return 5 + a;\n }\n function i(t, e) {\n for (var r = e; r < t.length && 0 !== t[r]; r++);\n return t.slice(e, r);\n }\n t.exports = function (t) {\n if (t.length < 6) throw new Error(\"invalid buffer length for BMFont\");\n var i = e.every(function (e, r) {\n return t.readUInt8(r) === e;\n });\n if (!i) throw new Error(\"BMFont missing BMF byte header\");\n var n = 3;\n if (t.readUInt8(n++) > 3) throw new Error(\"Only supports BMFont Binary v3 (BMFont App v1.10)\");\n for (var a = {\n kernings: [],\n chars: []\n }, o = 0; o < 5; o++) n += r(a, t, n);\n return a;\n };\n },\n 5947: (t, e, r) => {\n var i = r(403),\n n = r(1596),\n a = {\n scaleh: \"scaleH\",\n scalew: \"scaleW\",\n stretchh: \"stretchH\",\n lineheight: \"lineHeight\",\n alphachnl: \"alphaChnl\",\n redchnl: \"redChnl\",\n greenchnl: \"greenChnl\",\n bluechnl: \"blueChnl\"\n };\n function o(t) {\n var e = function (t) {\n for (var e = [], r = 0; r < t.attributes.length; r++) e.push(t.attributes[r]);\n return e;\n }(t);\n return e.reduce(function (t, e) {\n var r;\n return t[(r = e.nodeName, a[r.toLowerCase()] || r)] = e.nodeValue, t;\n }, {});\n }\n t.exports = function (t) {\n t = t.toString();\n var e = n(t),\n r = {\n pages: [],\n chars: [],\n kernings: []\n };\n [\"info\", \"common\"].forEach(function (t) {\n var n = e.getElementsByTagName(t)[0];\n n && (r[t] = i(o(n)));\n });\n var a = e.getElementsByTagName(\"pages\")[0];\n if (!a) throw new Error(\"malformed file -- no element\");\n for (var s = a.getElementsByTagName(\"page\"), h = 0; h < s.length; h++) {\n var l = s[h],\n f = parseInt(l.getAttribute(\"id\"), 10),\n u = l.getAttribute(\"file\");\n if (isNaN(f)) throw new Error('malformed file -- page \"id\" attribute is NaN');\n if (!u) throw new Error('malformed file -- needs page \"file\" attribute');\n r.pages[parseInt(f, 10)] = u;\n }\n return [\"chars\", \"kernings\"].forEach(function (t) {\n var n = e.getElementsByTagName(t)[0];\n if (n) for (var a = t.substring(0, t.length - 1), s = n.getElementsByTagName(a), h = 0; h < s.length; h++) {\n var l = s[h];\n r[t].push(i(o(l)));\n }\n }), r;\n };\n },\n 403: t => {\n var e = \"chasrset\";\n t.exports = function (t) {\n for (var r in e in t && (t.charset = t[e], delete t[e]), t) \"face\" !== r && \"charset\" !== r && (t[r] = \"padding\" === r || \"spacing\" === r ? t[r].split(\",\").map(function (t) {\n return parseInt(t, 10);\n }) : parseInt(t[r], 10));\n return t;\n };\n },\n 4655: (t, e, r) => {\n var i = r(311),\n n = r(3243);\n t.exports = function (t) {\n if (!t) return {};\n var e = {};\n return n(i(t).split(\"\\n\"), function (t) {\n var r,\n n = t.indexOf(\":\"),\n a = i(t.slice(0, n)).toLowerCase(),\n o = i(t.slice(n + 1));\n void 0 === e[a] ? e[a] = o : (r = e[a], \"[object Array]\" === Object.prototype.toString.call(r) ? e[a].push(o) : e[a] = [e[a], o]);\n }), e;\n };\n },\n 1023: (t, e, r) => {\n \"use strict\";\n\n var i = r(4406);\n function n(t) {\n if (\"string\" != typeof t) throw new TypeError(\"Path must be a string. Received \" + JSON.stringify(t));\n }\n function a(t, e) {\n for (var r, i = \"\", n = 0, a = -1, o = 0, s = 0; s <= t.length; ++s) {\n if (s < t.length) r = t.charCodeAt(s);else {\n if (47 === r) break;\n r = 47;\n }\n if (47 === r) {\n if (a === s - 1 || 1 === o) ;else if (a !== s - 1 && 2 === o) {\n if (i.length < 2 || 2 !== n || 46 !== i.charCodeAt(i.length - 1) || 46 !== i.charCodeAt(i.length - 2)) if (i.length > 2) {\n var h = i.lastIndexOf(\"/\");\n if (h !== i.length - 1) {\n -1 === h ? (i = \"\", n = 0) : n = (i = i.slice(0, h)).length - 1 - i.lastIndexOf(\"/\"), a = s, o = 0;\n continue;\n }\n } else if (2 === i.length || 1 === i.length) {\n i = \"\", n = 0, a = s, o = 0;\n continue;\n }\n e && (i.length > 0 ? i += \"/..\" : i = \"..\", n = 2);\n } else i.length > 0 ? i += \"/\" + t.slice(a + 1, s) : i = t.slice(a + 1, s), n = s - a - 1;\n a = s, o = 0;\n } else 46 === r && -1 !== o ? ++o : o = -1;\n }\n return i;\n }\n var o = {\n resolve: function () {\n for (var t, e = \"\", r = !1, o = arguments.length - 1; o >= -1 && !r; o--) {\n var s;\n o >= 0 ? s = arguments[o] : (void 0 === t && (t = i.cwd()), s = t), n(s), 0 !== s.length && (e = s + \"/\" + e, r = 47 === s.charCodeAt(0));\n }\n return e = a(e, !r), r ? e.length > 0 ? \"/\" + e : \"/\" : e.length > 0 ? e : \".\";\n },\n normalize: function (t) {\n if (n(t), 0 === t.length) return \".\";\n var e = 47 === t.charCodeAt(0),\n r = 47 === t.charCodeAt(t.length - 1);\n return 0 !== (t = a(t, !e)).length || e || (t = \".\"), t.length > 0 && r && (t += \"/\"), e ? \"/\" + t : t;\n },\n isAbsolute: function (t) {\n return n(t), t.length > 0 && 47 === t.charCodeAt(0);\n },\n join: function () {\n if (0 === arguments.length) return \".\";\n for (var t, e = 0; e < arguments.length; ++e) {\n var r = arguments[e];\n n(r), r.length > 0 && (void 0 === t ? t = r : t += \"/\" + r);\n }\n return void 0 === t ? \".\" : o.normalize(t);\n },\n relative: function (t, e) {\n if (n(t), n(e), t === e) return \"\";\n if ((t = o.resolve(t)) === (e = o.resolve(e))) return \"\";\n for (var r = 1; r < t.length && 47 === t.charCodeAt(r); ++r);\n for (var i = t.length, a = i - r, s = 1; s < e.length && 47 === e.charCodeAt(s); ++s);\n for (var h = e.length - s, l = a < h ? a : h, f = -1, u = 0; u <= l; ++u) {\n if (u === l) {\n if (h > l) {\n if (47 === e.charCodeAt(s + u)) return e.slice(s + u + 1);\n if (0 === u) return e.slice(s + u);\n } else a > l && (47 === t.charCodeAt(r + u) ? f = u : 0 === u && (f = 0));\n break;\n }\n var c = t.charCodeAt(r + u);\n if (c !== e.charCodeAt(s + u)) break;\n 47 === c && (f = u);\n }\n var d = \"\";\n for (u = r + f + 1; u <= i; ++u) u !== i && 47 !== t.charCodeAt(u) || (0 === d.length ? d += \"..\" : d += \"/..\");\n return d.length > 0 ? d + e.slice(s + f) : (s += f, 47 === e.charCodeAt(s) && ++s, e.slice(s));\n },\n _makeLong: function (t) {\n return t;\n },\n dirname: function (t) {\n if (n(t), 0 === t.length) return \".\";\n for (var e = t.charCodeAt(0), r = 47 === e, i = -1, a = !0, o = t.length - 1; o >= 1; --o) if (47 === (e = t.charCodeAt(o))) {\n if (!a) {\n i = o;\n break;\n }\n } else a = !1;\n return -1 === i ? r ? \"/\" : \".\" : r && 1 === i ? \"//\" : t.slice(0, i);\n },\n basename: function (t, e) {\n if (void 0 !== e && \"string\" != typeof e) throw new TypeError('\"ext\" argument must be a string');\n n(t);\n var r,\n i = 0,\n a = -1,\n o = !0;\n if (void 0 !== e && e.length > 0 && e.length <= t.length) {\n if (e.length === t.length && e === t) return \"\";\n var s = e.length - 1,\n h = -1;\n for (r = t.length - 1; r >= 0; --r) {\n var l = t.charCodeAt(r);\n if (47 === l) {\n if (!o) {\n i = r + 1;\n break;\n }\n } else -1 === h && (o = !1, h = r + 1), s >= 0 && (l === e.charCodeAt(s) ? -1 == --s && (a = r) : (s = -1, a = h));\n }\n return i === a ? a = h : -1 === a && (a = t.length), t.slice(i, a);\n }\n for (r = t.length - 1; r >= 0; --r) if (47 === t.charCodeAt(r)) {\n if (!o) {\n i = r + 1;\n break;\n }\n } else -1 === a && (o = !1, a = r + 1);\n return -1 === a ? \"\" : t.slice(i, a);\n },\n extname: function (t) {\n n(t);\n for (var e = -1, r = 0, i = -1, a = !0, o = 0, s = t.length - 1; s >= 0; --s) {\n var h = t.charCodeAt(s);\n if (47 !== h) -1 === i && (a = !1, i = s + 1), 46 === h ? -1 === e ? e = s : 1 !== o && (o = 1) : -1 !== e && (o = -1);else if (!a) {\n r = s + 1;\n break;\n }\n }\n return -1 === e || -1 === i || 0 === o || 1 === o && e === i - 1 && e === r + 1 ? \"\" : t.slice(e, i);\n },\n format: function (t) {\n if (null === t || \"object\" != typeof t) throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof t);\n return function (t, e) {\n var r = e.dir || e.root,\n i = e.base || (e.name || \"\") + (e.ext || \"\");\n return r ? r === e.root ? r + i : r + \"/\" + i : i;\n }(0, t);\n },\n parse: function (t) {\n n(t);\n var e = {\n root: \"\",\n dir: \"\",\n base: \"\",\n ext: \"\",\n name: \"\"\n };\n if (0 === t.length) return e;\n var r,\n i = t.charCodeAt(0),\n a = 47 === i;\n a ? (e.root = \"/\", r = 1) : r = 0;\n for (var o = -1, s = 0, h = -1, l = !0, f = t.length - 1, u = 0; f >= r; --f) if (47 !== (i = t.charCodeAt(f))) -1 === h && (l = !1, h = f + 1), 46 === i ? -1 === o ? o = f : 1 !== u && (u = 1) : -1 !== o && (u = -1);else if (!l) {\n s = f + 1;\n break;\n }\n return -1 === o || -1 === h || 0 === u || 1 === u && o === h - 1 && o === s + 1 ? -1 !== h && (e.base = e.name = 0 === s && a ? t.slice(1, h) : t.slice(s, h)) : (0 === s && a ? (e.name = t.slice(1, o), e.base = t.slice(1, h)) : (e.name = t.slice(s, o), e.base = t.slice(s, h)), e.ext = t.slice(o, h)), s > 0 ? e.dir = t.slice(0, s - 1) : a && (e.dir = \"/\"), e;\n },\n sep: \"/\",\n delimiter: \":\",\n win32: null,\n posix: null\n };\n o.posix = o, t.exports = o;\n },\n 482: (t, e) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.Deferred = void 0, e.Deferred = class {\n constructor() {\n this.resolve = () => null, this.reject = () => null, this.promise = new Promise((t, e) => {\n this.reject = e, this.resolve = t;\n });\n }\n };\n },\n 5567: (t, e) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.EndOfStreamError = e.defaultMessages = void 0, e.defaultMessages = \"End-Of-Stream\";\n class r extends Error {\n constructor() {\n super(e.defaultMessages);\n }\n }\n e.EndOfStreamError = r;\n },\n 4514: (t, e, r) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.StreamReader = e.EndOfStreamError = void 0;\n const i = r(5567),\n n = r(482);\n var a = r(5567);\n Object.defineProperty(e, \"EndOfStreamError\", {\n enumerable: !0,\n get: function () {\n return a.EndOfStreamError;\n }\n }), e.StreamReader = class {\n constructor(t) {\n if (this.s = t, this.deferred = null, this.endOfStream = !1, this.peekQueue = [], !t.read || !t.once) throw new Error(\"Expected an instance of stream.Readable\");\n this.s.once(\"end\", () => this.reject(new i.EndOfStreamError())), this.s.once(\"error\", t => this.reject(t)), this.s.once(\"close\", () => this.reject(new Error(\"Stream closed\")));\n }\n async peek(t, e, r) {\n const i = await this.read(t, e, r);\n return this.peekQueue.push(t.subarray(e, e + i)), i;\n }\n async read(t, e, r) {\n if (0 === r) return 0;\n if (0 === this.peekQueue.length && this.endOfStream) throw new i.EndOfStreamError();\n let n = r,\n a = 0;\n for (; this.peekQueue.length > 0 && n > 0;) {\n const r = this.peekQueue.pop();\n if (!r) throw new Error(\"peekData should be defined\");\n const i = Math.min(r.length, n);\n t.set(r.subarray(0, i), e + a), a += i, n -= i, i < r.length && this.peekQueue.push(r.subarray(i));\n }\n for (; n > 0 && !this.endOfStream;) {\n const r = Math.min(n, 1048576),\n i = await this.readFromStream(t, e + a, r);\n if (a += i, i < r) break;\n n -= i;\n }\n return a;\n }\n async readFromStream(t, e, r) {\n const i = this.s.read(r);\n if (i) return t.set(i, e), i.length;\n {\n const i = {\n buffer: t,\n offset: e,\n length: r,\n deferred: new n.Deferred()\n };\n return this.deferred = i.deferred, this.s.once(\"readable\", () => {\n this.readDeferred(i);\n }), i.deferred.promise;\n }\n }\n readDeferred(t) {\n const e = this.s.read(t.length);\n e ? (t.buffer.set(e, t.offset), t.deferred.resolve(e.length), this.deferred = null) : this.s.once(\"readable\", () => {\n this.readDeferred(t);\n });\n }\n reject(t) {\n this.endOfStream = !0, this.deferred && (this.deferred.reject(t), this.deferred = null);\n }\n };\n },\n 4644: (t, e, r) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.StreamReader = e.EndOfStreamError = void 0;\n var i = r(5567);\n Object.defineProperty(e, \"EndOfStreamError\", {\n enumerable: !0,\n get: function () {\n return i.EndOfStreamError;\n }\n });\n var n = r(4514);\n Object.defineProperty(e, \"StreamReader\", {\n enumerable: !0,\n get: function () {\n return n.StreamReader;\n }\n });\n },\n 1294: t => {\n \"use strict\";\n\n function e(t, i, n, a, o, s) {\n for (var h, l, f, u, c = Math.max(i - 1, 0), d = Math.max(n - 1, 0), p = Math.min(i + 1, a - 1), m = Math.min(n + 1, o - 1), g = 4 * (n * a + i), b = 0, _ = 0, y = 0, w = 0, v = 0, x = c; x <= p; x++) for (var E = d; E <= m; E++) if (x !== i || E !== n) {\n var k = r(t, t, g, 4 * (E * a + x), !0);\n if (0 === k ? b++ : k < 0 ? y++ : k > 0 && _++, b > 2) return !1;\n s && (k < w && (w = k, h = x, l = E), k > v && (v = k, f = x, u = E));\n }\n return !s || 0 !== y && 0 !== _ && (!e(t, h, l, a, o) && !e(s, h, l, a, o) || !e(t, f, u, a, o) && !e(s, f, u, a, o));\n }\n function r(t, e, r, s, h) {\n var l = t[r + 3] / 255,\n f = e[s + 3] / 255,\n u = o(t[r + 0], l),\n c = o(t[r + 1], l),\n d = o(t[r + 2], l),\n p = o(e[s + 0], f),\n m = o(e[s + 1], f),\n g = o(e[s + 2], f),\n b = i(u, c, d) - i(p, m, g);\n if (h) return b;\n var _ = n(u, c, d) - n(p, m, g),\n y = a(u, c, d) - a(p, m, g);\n return .5053 * b * b + .299 * _ * _ + .1957 * y * y;\n }\n function i(t, e, r) {\n return .29889531 * t + .58662247 * e + .11448223 * r;\n }\n function n(t, e, r) {\n return .59597799 * t - .2741761 * e - .32180189 * r;\n }\n function a(t, e, r) {\n return .21147017 * t - .52261711 * e + .31114694 * r;\n }\n function o(t, e) {\n return 255 + (t - 255) * e;\n }\n function s(t, e, r, i, n) {\n t[e + 0] = r, t[e + 1] = i, t[e + 2] = n, t[e + 3] = 255;\n }\n t.exports = function (t, n, a, h, l, f) {\n f || (f = {});\n for (var u = void 0 === f.threshold ? .1 : f.threshold, c = 35215 * u * u, d = 0, p = 0; p < l; p++) for (var m = 0; m < h; m++) {\n var g = 4 * (p * h + m);\n if (r(t, n, g, g) > c) f.includeAA || !e(t, m, p, h, l, n) && !e(n, m, p, h, l, t) ? (a && s(a, g, 255, 0, 0), d++) : a && s(a, g, 255, 255, 0);else if (a) {\n var b = o((void 0, void 0, void 0, void 0, w = (_ = t)[(y = g) + 3] / 255, i(o(_[y + 0], w), o(_[y + 1], w), o(_[y + 2], w))), .1);\n s(a, g, b, b, b);\n }\n }\n var _, y, w;\n return d;\n };\n },\n 9902: (t, e, r) => {\n t.exports = function t(e, r, i) {\n function n(o, s) {\n if (!r[o]) {\n if (!e[o]) {\n if (a) return a(o, !0);\n var h = new Error(\"Cannot find module '\" + o + \"'\");\n throw h.code = \"MODULE_NOT_FOUND\", h;\n }\n var l = r[o] = {\n exports: {}\n };\n e[o][0].call(l.exports, function (t) {\n return n(e[o][1][t] || t);\n }, l, l.exports, t, e, r, i);\n }\n return r[o].exports;\n }\n for (var a = void 0, o = 0; o < i.length; o++) n(i[o]);\n return n;\n }({\n 1: [function (t, e, r) {\n (function (e) {\n (function () {\n \"use strict\";\n\n let i = t(\"./interlace\"),\n n = [function () {}, function (t, e, r, i) {\n if (i === e.length) throw new Error(\"Ran out of data\");\n let n = e[i];\n t[r] = n, t[r + 1] = n, t[r + 2] = n, t[r + 3] = 255;\n }, function (t, e, r, i) {\n if (i + 1 >= e.length) throw new Error(\"Ran out of data\");\n let n = e[i];\n t[r] = n, t[r + 1] = n, t[r + 2] = n, t[r + 3] = e[i + 1];\n }, function (t, e, r, i) {\n if (i + 2 >= e.length) throw new Error(\"Ran out of data\");\n t[r] = e[i], t[r + 1] = e[i + 1], t[r + 2] = e[i + 2], t[r + 3] = 255;\n }, function (t, e, r, i) {\n if (i + 3 >= e.length) throw new Error(\"Ran out of data\");\n t[r] = e[i], t[r + 1] = e[i + 1], t[r + 2] = e[i + 2], t[r + 3] = e[i + 3];\n }],\n a = [function () {}, function (t, e, r, i) {\n let n = e[0];\n t[r] = n, t[r + 1] = n, t[r + 2] = n, t[r + 3] = i;\n }, function (t, e, r) {\n let i = e[0];\n t[r] = i, t[r + 1] = i, t[r + 2] = i, t[r + 3] = e[1];\n }, function (t, e, r, i) {\n t[r] = e[0], t[r + 1] = e[1], t[r + 2] = e[2], t[r + 3] = i;\n }, function (t, e, r) {\n t[r] = e[0], t[r + 1] = e[1], t[r + 2] = e[2], t[r + 3] = e[3];\n }];\n function o(t, e, r, i, a, o) {\n let s = t.width,\n h = t.height,\n l = t.index;\n for (let t = 0; t < h; t++) for (let h = 0; h < s; h++) {\n let s = r(h, t, l);\n n[i](e, a, s, o), o += i;\n }\n return o;\n }\n function s(t, e, r, i, n, o) {\n let s = t.width,\n h = t.height,\n l = t.index;\n for (let t = 0; t < h; t++) {\n for (let h = 0; h < s; h++) {\n let s = n.get(i),\n f = r(h, t, l);\n a[i](e, s, f, o);\n }\n n.resetAfterLine();\n }\n }\n r.dataToBitMap = function (t, r) {\n let n,\n a,\n h = r.width,\n l = r.height,\n f = r.depth,\n u = r.bpp,\n c = r.interlace;\n 8 !== f && (n = function (t, e) {\n let r = [],\n i = 0;\n function n() {\n if (i === t.length) throw new Error(\"Ran out of data\");\n let n,\n a,\n o,\n s,\n h,\n l,\n f,\n u,\n c = t[i];\n switch (i++, e) {\n default:\n throw new Error(\"unrecognised depth\");\n case 16:\n f = t[i], i++, r.push((c << 8) + f);\n break;\n case 4:\n f = 15 & c, u = c >> 4, r.push(u, f);\n break;\n case 2:\n h = 3 & c, l = c >> 2 & 3, f = c >> 4 & 3, u = c >> 6 & 3, r.push(u, f, l, h);\n break;\n case 1:\n n = 1 & c, a = c >> 1 & 1, o = c >> 2 & 1, s = c >> 3 & 1, h = c >> 4 & 1, l = c >> 5 & 1, f = c >> 6 & 1, u = c >> 7 & 1, r.push(u, f, l, h, s, o, a, n);\n }\n }\n return {\n get: function (t) {\n for (; r.length < t;) n();\n let e = r.slice(0, t);\n return r = r.slice(t), e;\n },\n resetAfterLine: function () {\n r.length = 0;\n },\n end: function () {\n if (i !== t.length) throw new Error(\"extra data found\");\n }\n };\n }(t, f)), a = f <= 8 ? e.alloc(h * l * 4) : new Uint16Array(h * l * 4);\n let d,\n p,\n m = Math.pow(2, f) - 1,\n g = 0;\n if (c) d = i.getImagePasses(h, l), p = i.getInterlaceIterator(h, l);else {\n let t = 0;\n p = function () {\n let e = t;\n return t += 4, e;\n }, d = [{\n width: h,\n height: l\n }];\n }\n for (let e = 0; e < d.length; e++) 8 === f ? g = o(d[e], a, p, u, t, g) : s(d[e], a, p, u, n, m);\n if (8 === f) {\n if (g !== t.length) throw new Error(\"extra data found\");\n } else n.end();\n return a;\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./interlace\": 11,\n buffer: 33\n }],\n 2: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = t(\"./constants\");\n e.exports = function (t, e, n, a) {\n let o = -1 !== [i.COLORTYPE_COLOR_ALPHA, i.COLORTYPE_ALPHA].indexOf(a.colorType);\n if (a.colorType === a.inputColorType) {\n let e = function () {\n let t = new ArrayBuffer(2);\n return new DataView(t).setInt16(0, 256, !0), 256 !== new Int16Array(t)[0];\n }();\n if (8 === a.bitDepth || 16 === a.bitDepth && e) return t;\n }\n let s = 16 !== a.bitDepth ? t : new Uint16Array(t.buffer),\n h = 255,\n l = i.COLORTYPE_TO_BPP_MAP[a.inputColorType];\n 4 !== l || a.inputHasAlpha || (l = 3);\n let f = i.COLORTYPE_TO_BPP_MAP[a.colorType];\n 16 === a.bitDepth && (h = 65535, f *= 2);\n let u = r.alloc(e * n * f),\n c = 0,\n d = 0,\n p = a.bgColor || {};\n function m() {\n let t,\n e,\n r,\n n = h;\n switch (a.inputColorType) {\n case i.COLORTYPE_COLOR_ALPHA:\n n = s[c + 3], t = s[c], e = s[c + 1], r = s[c + 2];\n break;\n case i.COLORTYPE_COLOR:\n t = s[c], e = s[c + 1], r = s[c + 2];\n break;\n case i.COLORTYPE_ALPHA:\n n = s[c + 1], t = s[c], e = t, r = t;\n break;\n case i.COLORTYPE_GRAYSCALE:\n t = s[c], e = t, r = t;\n break;\n default:\n throw new Error(\"input color type:\" + a.inputColorType + \" is not supported at present\");\n }\n return a.inputHasAlpha && (o || (n /= h, t = Math.min(Math.max(Math.round((1 - n) * p.red + n * t), 0), h), e = Math.min(Math.max(Math.round((1 - n) * p.green + n * e), 0), h), r = Math.min(Math.max(Math.round((1 - n) * p.blue + n * r), 0), h))), {\n red: t,\n green: e,\n blue: r,\n alpha: n\n };\n }\n void 0 === p.red && (p.red = h), void 0 === p.green && (p.green = h), void 0 === p.blue && (p.blue = h);\n for (let t = 0; t < n; t++) for (let t = 0; t < e; t++) {\n let t = m();\n switch (a.colorType) {\n case i.COLORTYPE_COLOR_ALPHA:\n case i.COLORTYPE_COLOR:\n 8 === a.bitDepth ? (u[d] = t.red, u[d + 1] = t.green, u[d + 2] = t.blue, o && (u[d + 3] = t.alpha)) : (u.writeUInt16BE(t.red, d), u.writeUInt16BE(t.green, d + 2), u.writeUInt16BE(t.blue, d + 4), o && u.writeUInt16BE(t.alpha, d + 6));\n break;\n case i.COLORTYPE_ALPHA:\n case i.COLORTYPE_GRAYSCALE:\n {\n let e = (t.red + t.green + t.blue) / 3;\n 8 === a.bitDepth ? (u[d] = e, o && (u[d + 1] = t.alpha)) : (u.writeUInt16BE(e, d), o && u.writeUInt16BE(t.alpha, d + 2));\n break;\n }\n default:\n throw new Error(\"unrecognised color Type \" + a.colorType);\n }\n c += l, d += f;\n }\n return u;\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./constants\": 4,\n buffer: 33\n }],\n 3: [function (t, e, r) {\n (function (r, i) {\n (function () {\n \"use strict\";\n\n let n = t(\"util\"),\n a = t(\"stream\"),\n o = e.exports = function () {\n a.call(this), this._buffers = [], this._buffered = 0, this._reads = [], this._paused = !1, this._encoding = \"utf8\", this.writable = !0;\n };\n n.inherits(o, a), o.prototype.read = function (t, e) {\n this._reads.push({\n length: Math.abs(t),\n allowLess: t < 0,\n func: e\n }), r.nextTick(function () {\n this._process(), this._paused && this._reads && this._reads.length > 0 && (this._paused = !1, this.emit(\"drain\"));\n }.bind(this));\n }, o.prototype.write = function (t, e) {\n if (!this.writable) return this.emit(\"error\", new Error(\"Stream not writable\")), !1;\n let r;\n return r = i.isBuffer(t) ? t : i.from(t, e || this._encoding), this._buffers.push(r), this._buffered += r.length, this._process(), this._reads && 0 === this._reads.length && (this._paused = !0), this.writable && !this._paused;\n }, o.prototype.end = function (t, e) {\n t && this.write(t, e), this.writable = !1, this._buffers && (0 === this._buffers.length ? this._end() : (this._buffers.push(null), this._process()));\n }, o.prototype.destroySoon = o.prototype.end, o.prototype._end = function () {\n this._reads.length > 0 && this.emit(\"error\", new Error(\"Unexpected end of input\")), this.destroy();\n }, o.prototype.destroy = function () {\n this._buffers && (this.writable = !1, this._reads = null, this._buffers = null, this.emit(\"close\"));\n }, o.prototype._processReadAllowingLess = function (t) {\n this._reads.shift();\n let e = this._buffers[0];\n e.length > t.length ? (this._buffered -= t.length, this._buffers[0] = e.slice(t.length), t.func.call(this, e.slice(0, t.length))) : (this._buffered -= e.length, this._buffers.shift(), t.func.call(this, e));\n }, o.prototype._processRead = function (t) {\n this._reads.shift();\n let e = 0,\n r = 0,\n n = i.alloc(t.length);\n for (; e < t.length;) {\n let i = this._buffers[r++],\n a = Math.min(i.length, t.length - e);\n i.copy(n, e, 0, a), e += a, a !== i.length && (this._buffers[--r] = i.slice(a));\n }\n r > 0 && this._buffers.splice(0, r), this._buffered -= t.length, t.func.call(this, n);\n }, o.prototype._process = function () {\n try {\n for (; this._buffered > 0 && this._reads && this._reads.length > 0;) {\n let t = this._reads[0];\n if (t.allowLess) this._processReadAllowingLess(t);else {\n if (!(this._buffered >= t.length)) break;\n this._processRead(t);\n }\n }\n this._buffers && !this.writable && this._end();\n } catch (t) {\n this.emit(\"error\", t);\n }\n };\n }).call(this);\n }).call(this, t(\"_process\"), t(\"buffer\").Buffer);\n }, {\n _process: 60,\n buffer: 33,\n stream: 61,\n util: 81\n }],\n 4: [function (t, e, r) {\n \"use strict\";\n\n e.exports = {\n PNG_SIGNATURE: [137, 80, 78, 71, 13, 10, 26, 10],\n TYPE_IHDR: 1229472850,\n TYPE_IEND: 1229278788,\n TYPE_IDAT: 1229209940,\n TYPE_PLTE: 1347179589,\n TYPE_tRNS: 1951551059,\n TYPE_gAMA: 1732332865,\n COLORTYPE_GRAYSCALE: 0,\n COLORTYPE_PALETTE: 1,\n COLORTYPE_COLOR: 2,\n COLORTYPE_ALPHA: 4,\n COLORTYPE_PALETTE_COLOR: 3,\n COLORTYPE_COLOR_ALPHA: 6,\n COLORTYPE_TO_BPP_MAP: {\n 0: 1,\n 2: 3,\n 3: 1,\n 4: 2,\n 6: 4\n },\n GAMMA_DIVISION: 1e5\n };\n }, {}],\n 5: [function (t, e, r) {\n \"use strict\";\n\n let i = [];\n !function () {\n for (let t = 0; t < 256; t++) {\n let e = t;\n for (let t = 0; t < 8; t++) 1 & e ? e = 3988292384 ^ e >>> 1 : e >>>= 1;\n i[t] = e;\n }\n }();\n let n = e.exports = function () {\n this._crc = -1;\n };\n n.prototype.write = function (t) {\n for (let e = 0; e < t.length; e++) this._crc = i[255 & (this._crc ^ t[e])] ^ this._crc >>> 8;\n return !0;\n }, n.prototype.crc32 = function () {\n return -1 ^ this._crc;\n }, n.crc32 = function (t) {\n let e = -1;\n for (let r = 0; r < t.length; r++) e = i[255 & (e ^ t[r])] ^ e >>> 8;\n return -1 ^ e;\n };\n }, {}],\n 6: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = t(\"./paeth-predictor\");\n let n = {\n 0: function (t, e, r, i, n) {\n for (let a = 0; a < r; a++) i[n + a] = t[e + a];\n },\n 1: function (t, e, r, i, n, a) {\n for (let o = 0; o < r; o++) {\n let r = o >= a ? t[e + o - a] : 0,\n s = t[e + o] - r;\n i[n + o] = s;\n }\n },\n 2: function (t, e, r, i, n) {\n for (let a = 0; a < r; a++) {\n let o = e > 0 ? t[e + a - r] : 0,\n s = t[e + a] - o;\n i[n + a] = s;\n }\n },\n 3: function (t, e, r, i, n, a) {\n for (let o = 0; o < r; o++) {\n let s = o >= a ? t[e + o - a] : 0,\n h = e > 0 ? t[e + o - r] : 0,\n l = t[e + o] - (s + h >> 1);\n i[n + o] = l;\n }\n },\n 4: function (t, e, r, n, a, o) {\n for (let s = 0; s < r; s++) {\n let h = s >= o ? t[e + s - o] : 0,\n l = e > 0 ? t[e + s - r] : 0,\n f = e > 0 && s >= o ? t[e + s - (r + o)] : 0,\n u = t[e + s] - i(h, l, f);\n n[a + s] = u;\n }\n }\n },\n a = {\n 0: function (t, e, r) {\n let i = 0,\n n = e + r;\n for (let r = e; r < n; r++) i += Math.abs(t[r]);\n return i;\n },\n 1: function (t, e, r, i) {\n let n = 0;\n for (let a = 0; a < r; a++) {\n let r = a >= i ? t[e + a - i] : 0,\n o = t[e + a] - r;\n n += Math.abs(o);\n }\n return n;\n },\n 2: function (t, e, r) {\n let i = 0,\n n = e + r;\n for (let a = e; a < n; a++) {\n let n = e > 0 ? t[a - r] : 0,\n o = t[a] - n;\n i += Math.abs(o);\n }\n return i;\n },\n 3: function (t, e, r, i) {\n let n = 0;\n for (let a = 0; a < r; a++) {\n let o = a >= i ? t[e + a - i] : 0,\n s = e > 0 ? t[e + a - r] : 0,\n h = t[e + a] - (o + s >> 1);\n n += Math.abs(h);\n }\n return n;\n },\n 4: function (t, e, r, n) {\n let a = 0;\n for (let o = 0; o < r; o++) {\n let s = o >= n ? t[e + o - n] : 0,\n h = e > 0 ? t[e + o - r] : 0,\n l = e > 0 && o >= n ? t[e + o - (r + n)] : 0,\n f = t[e + o] - i(s, h, l);\n a += Math.abs(f);\n }\n return a;\n }\n };\n e.exports = function (t, e, i, o, s) {\n let h;\n if (\"filterType\" in o && -1 !== o.filterType) {\n if (\"number\" != typeof o.filterType) throw new Error(\"unrecognised filter types\");\n h = [o.filterType];\n } else h = [0, 1, 2, 3, 4];\n 16 === o.bitDepth && (s *= 2);\n let l = e * s,\n f = 0,\n u = 0,\n c = r.alloc((l + 1) * i),\n d = h[0];\n for (let e = 0; e < i; e++) {\n if (h.length > 1) {\n let e = 1 / 0;\n for (let r = 0; r < h.length; r++) {\n let i = a[h[r]](t, u, l, s);\n i < e && (d = h[r], e = i);\n }\n }\n c[f] = d, f++, n[d](t, u, l, c, f, s), f += l, u += l;\n }\n return c;\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./paeth-predictor\": 15,\n buffer: 33\n }],\n 7: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = t(\"util\"),\n n = t(\"./chunkstream\"),\n a = t(\"./filter-parse\"),\n o = e.exports = function (t) {\n n.call(this);\n let e = [],\n i = this;\n this._filter = new a(t, {\n read: this.read.bind(this),\n write: function (t) {\n e.push(t);\n },\n complete: function () {\n i.emit(\"complete\", r.concat(e));\n }\n }), this._filter.start();\n };\n i.inherits(o, n);\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./chunkstream\": 3,\n \"./filter-parse\": 9,\n buffer: 33,\n util: 81\n }],\n 8: [function (t, e, r) {\n (function (e) {\n (function () {\n \"use strict\";\n\n let i = t(\"./sync-reader\"),\n n = t(\"./filter-parse\");\n r.process = function (t, r) {\n let a = [],\n o = new i(t);\n return new n(r, {\n read: o.read.bind(o),\n write: function (t) {\n a.push(t);\n },\n complete: function () {}\n }).start(), o.process(), e.concat(a);\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./filter-parse\": 9,\n \"./sync-reader\": 22,\n buffer: 33\n }],\n 9: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = t(\"./interlace\"),\n n = t(\"./paeth-predictor\");\n function a(t, e, r) {\n let i = t * e;\n return 8 !== r && (i = Math.ceil(i / (8 / r))), i;\n }\n let o = e.exports = function (t, e) {\n let r = t.width,\n n = t.height,\n o = t.interlace,\n s = t.bpp,\n h = t.depth;\n if (this.read = e.read, this.write = e.write, this.complete = e.complete, this._imageIndex = 0, this._images = [], o) {\n let t = i.getImagePasses(r, n);\n for (let e = 0; e < t.length; e++) this._images.push({\n byteWidth: a(t[e].width, s, h),\n height: t[e].height,\n lineIndex: 0\n });\n } else this._images.push({\n byteWidth: a(r, s, h),\n height: n,\n lineIndex: 0\n });\n this._xComparison = 8 === h ? s : 16 === h ? 2 * s : 1;\n };\n o.prototype.start = function () {\n this.read(this._images[this._imageIndex].byteWidth + 1, this._reverseFilterLine.bind(this));\n }, o.prototype._unFilterType1 = function (t, e, r) {\n let i = this._xComparison,\n n = i - 1;\n for (let a = 0; a < r; a++) {\n let r = t[1 + a],\n o = a > n ? e[a - i] : 0;\n e[a] = r + o;\n }\n }, o.prototype._unFilterType2 = function (t, e, r) {\n let i = this._lastLine;\n for (let n = 0; n < r; n++) {\n let r = t[1 + n],\n a = i ? i[n] : 0;\n e[n] = r + a;\n }\n }, o.prototype._unFilterType3 = function (t, e, r) {\n let i = this._xComparison,\n n = i - 1,\n a = this._lastLine;\n for (let o = 0; o < r; o++) {\n let r = t[1 + o],\n s = a ? a[o] : 0,\n h = o > n ? e[o - i] : 0,\n l = Math.floor((h + s) / 2);\n e[o] = r + l;\n }\n }, o.prototype._unFilterType4 = function (t, e, r) {\n let i = this._xComparison,\n a = i - 1,\n o = this._lastLine;\n for (let s = 0; s < r; s++) {\n let r = t[1 + s],\n h = o ? o[s] : 0,\n l = s > a ? e[s - i] : 0,\n f = s > a && o ? o[s - i] : 0,\n u = n(l, h, f);\n e[s] = r + u;\n }\n }, o.prototype._reverseFilterLine = function (t) {\n let e,\n i = t[0],\n n = this._images[this._imageIndex],\n a = n.byteWidth;\n if (0 === i) e = t.slice(1, a + 1);else switch (e = r.alloc(a), i) {\n case 1:\n this._unFilterType1(t, e, a);\n break;\n case 2:\n this._unFilterType2(t, e, a);\n break;\n case 3:\n this._unFilterType3(t, e, a);\n break;\n case 4:\n this._unFilterType4(t, e, a);\n break;\n default:\n throw new Error(\"Unrecognised filter type - \" + i);\n }\n this.write(e), n.lineIndex++, n.lineIndex >= n.height ? (this._lastLine = null, this._imageIndex++, n = this._images[this._imageIndex]) : this._lastLine = e, n ? this.read(n.byteWidth + 1, this._reverseFilterLine.bind(this)) : (this._lastLine = null, this.complete());\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./interlace\": 11,\n \"./paeth-predictor\": 15,\n buffer: 33\n }],\n 10: [function (t, e, r) {\n (function (t) {\n (function () {\n \"use strict\";\n\n e.exports = function (e, r, i = !1) {\n let n = r.depth,\n a = r.width,\n o = r.height,\n s = r.colorType,\n h = r.transColor,\n l = r.palette,\n f = e;\n return 3 === s ? function (t, e, r, i, n) {\n let a = 0;\n for (let o = 0; o < i; o++) for (let i = 0; i < r; i++) {\n let r = n[t[a]];\n if (!r) throw new Error(\"index \" + t[a] + \" not in palette\");\n for (let t = 0; t < 4; t++) e[a + t] = r[t];\n a += 4;\n }\n }(e, f, a, o, l) : (h && function (t, e, r, i, n) {\n let a = 0;\n for (let o = 0; o < i; o++) for (let i = 0; i < r; i++) {\n let r = !1;\n if (1 === n.length ? n[0] === t[a] && (r = !0) : n[0] === t[a] && n[1] === t[a + 1] && n[2] === t[a + 2] && (r = !0), r) for (let t = 0; t < 4; t++) e[a + t] = 0;\n a += 4;\n }\n }(e, f, a, o, h), 8 === n || i || (16 === n && (f = t.alloc(a * o * 4)), function (t, e, r, i, n) {\n let a = Math.pow(2, n) - 1,\n o = 0;\n for (let n = 0; n < i; n++) for (let i = 0; i < r; i++) {\n for (let r = 0; r < 4; r++) e[o + r] = Math.floor(255 * t[o + r] / a + .5);\n o += 4;\n }\n }(e, f, a, o, n))), f;\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n buffer: 33\n }],\n 11: [function (t, e, r) {\n \"use strict\";\n\n let i = [{\n x: [0],\n y: [0]\n }, {\n x: [4],\n y: [0]\n }, {\n x: [0, 4],\n y: [4]\n }, {\n x: [2, 6],\n y: [0, 4]\n }, {\n x: [0, 2, 4, 6],\n y: [2, 6]\n }, {\n x: [1, 3, 5, 7],\n y: [0, 2, 4, 6]\n }, {\n x: [0, 1, 2, 3, 4, 5, 6, 7],\n y: [1, 3, 5, 7]\n }];\n r.getImagePasses = function (t, e) {\n let r = [],\n n = t % 8,\n a = e % 8,\n o = (t - n) / 8,\n s = (e - a) / 8;\n for (let t = 0; t < i.length; t++) {\n let e = i[t],\n h = o * e.x.length,\n l = s * e.y.length;\n for (let t = 0; t < e.x.length && e.x[t] < n; t++) h++;\n for (let t = 0; t < e.y.length && e.y[t] < a; t++) l++;\n h > 0 && l > 0 && r.push({\n width: h,\n height: l,\n index: t\n });\n }\n return r;\n }, r.getInterlaceIterator = function (t) {\n return function (e, r, n) {\n let a = e % i[n].x.length,\n o = (e - a) / i[n].x.length * 8 + i[n].x[a],\n s = r % i[n].y.length;\n return 4 * o + ((r - s) / i[n].y.length * 8 + i[n].y[s]) * t * 4;\n };\n };\n }, {}],\n 12: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = t(\"util\"),\n n = t(\"stream\"),\n a = t(\"./constants\"),\n o = t(\"./packer\"),\n s = e.exports = function (t) {\n n.call(this);\n let e = t || {};\n this._packer = new o(e), this._deflate = this._packer.createDeflate(), this.readable = !0;\n };\n i.inherits(s, n), s.prototype.pack = function (t, e, i, n) {\n this.emit(\"data\", r.from(a.PNG_SIGNATURE)), this.emit(\"data\", this._packer.packIHDR(e, i)), n && this.emit(\"data\", this._packer.packGAMA(n));\n let o = this._packer.filterData(t, e, i);\n this._deflate.on(\"error\", this.emit.bind(this, \"error\")), this._deflate.on(\"data\", function (t) {\n this.emit(\"data\", this._packer.packIDAT(t));\n }.bind(this)), this._deflate.on(\"end\", function () {\n this.emit(\"data\", this._packer.packIEND()), this.emit(\"end\");\n }.bind(this)), this._deflate.end(o);\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./constants\": 4,\n \"./packer\": 14,\n buffer: 33,\n stream: 61,\n util: 81\n }],\n 13: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = !0,\n n = t(\"zlib\");\n n.deflateSync || (i = !1);\n let a = t(\"./constants\"),\n o = t(\"./packer\");\n e.exports = function (t, e) {\n if (!i) throw new Error(\"To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0\");\n let s = new o(e || {}),\n h = [];\n h.push(r.from(a.PNG_SIGNATURE)), h.push(s.packIHDR(t.width, t.height)), t.gamma && h.push(s.packGAMA(t.gamma));\n let l = s.filterData(t.data, t.width, t.height),\n f = n.deflateSync(l, s.getDeflateOptions());\n if (l = null, !f || !f.length) throw new Error(\"bad png - invalid compressed data response\");\n return h.push(s.packIDAT(f)), h.push(s.packIEND()), r.concat(h);\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./constants\": 4,\n \"./packer\": 14,\n buffer: 33,\n zlib: 32\n }],\n 14: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = t(\"./constants\"),\n n = t(\"./crc\"),\n a = t(\"./bitpacker\"),\n o = t(\"./filter-pack\"),\n s = t(\"zlib\"),\n h = e.exports = function (t) {\n if (this._options = t, t.deflateChunkSize = t.deflateChunkSize || 32768, t.deflateLevel = null != t.deflateLevel ? t.deflateLevel : 9, t.deflateStrategy = null != t.deflateStrategy ? t.deflateStrategy : 3, t.inputHasAlpha = null == t.inputHasAlpha || t.inputHasAlpha, t.deflateFactory = t.deflateFactory || s.createDeflate, t.bitDepth = t.bitDepth || 8, t.colorType = \"number\" == typeof t.colorType ? t.colorType : i.COLORTYPE_COLOR_ALPHA, t.inputColorType = \"number\" == typeof t.inputColorType ? t.inputColorType : i.COLORTYPE_COLOR_ALPHA, -1 === [i.COLORTYPE_GRAYSCALE, i.COLORTYPE_COLOR, i.COLORTYPE_COLOR_ALPHA, i.COLORTYPE_ALPHA].indexOf(t.colorType)) throw new Error(\"option color type:\" + t.colorType + \" is not supported at present\");\n if (-1 === [i.COLORTYPE_GRAYSCALE, i.COLORTYPE_COLOR, i.COLORTYPE_COLOR_ALPHA, i.COLORTYPE_ALPHA].indexOf(t.inputColorType)) throw new Error(\"option input color type:\" + t.inputColorType + \" is not supported at present\");\n if (8 !== t.bitDepth && 16 !== t.bitDepth) throw new Error(\"option bit depth:\" + t.bitDepth + \" is not supported at present\");\n };\n h.prototype.getDeflateOptions = function () {\n return {\n chunkSize: this._options.deflateChunkSize,\n level: this._options.deflateLevel,\n strategy: this._options.deflateStrategy\n };\n }, h.prototype.createDeflate = function () {\n return this._options.deflateFactory(this.getDeflateOptions());\n }, h.prototype.filterData = function (t, e, r) {\n let n = a(t, e, r, this._options),\n s = i.COLORTYPE_TO_BPP_MAP[this._options.colorType];\n return o(n, e, r, this._options, s);\n }, h.prototype._packChunk = function (t, e) {\n let i = e ? e.length : 0,\n a = r.alloc(i + 12);\n return a.writeUInt32BE(i, 0), a.writeUInt32BE(t, 4), e && e.copy(a, 8), a.writeInt32BE(n.crc32(a.slice(4, a.length - 4)), a.length - 4), a;\n }, h.prototype.packGAMA = function (t) {\n let e = r.alloc(4);\n return e.writeUInt32BE(Math.floor(t * i.GAMMA_DIVISION), 0), this._packChunk(i.TYPE_gAMA, e);\n }, h.prototype.packIHDR = function (t, e) {\n let n = r.alloc(13);\n return n.writeUInt32BE(t, 0), n.writeUInt32BE(e, 4), n[8] = this._options.bitDepth, n[9] = this._options.colorType, n[10] = 0, n[11] = 0, n[12] = 0, this._packChunk(i.TYPE_IHDR, n);\n }, h.prototype.packIDAT = function (t) {\n return this._packChunk(i.TYPE_IDAT, t);\n }, h.prototype.packIEND = function () {\n return this._packChunk(i.TYPE_IEND, null);\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./bitpacker\": 2,\n \"./constants\": 4,\n \"./crc\": 5,\n \"./filter-pack\": 6,\n buffer: 33,\n zlib: 32\n }],\n 15: [function (t, e, r) {\n \"use strict\";\n\n e.exports = function (t, e, r) {\n let i = t + e - r,\n n = Math.abs(i - t),\n a = Math.abs(i - e),\n o = Math.abs(i - r);\n return n <= a && n <= o ? t : a <= o ? e : r;\n };\n }, {}],\n 16: [function (t, e, r) {\n \"use strict\";\n\n let i = t(\"util\"),\n n = t(\"zlib\"),\n a = t(\"./chunkstream\"),\n o = t(\"./filter-parse-async\"),\n s = t(\"./parser\"),\n h = t(\"./bitmapper\"),\n l = t(\"./format-normaliser\"),\n f = e.exports = function (t) {\n a.call(this), this._parser = new s(t, {\n read: this.read.bind(this),\n error: this._handleError.bind(this),\n metadata: this._handleMetaData.bind(this),\n gamma: this.emit.bind(this, \"gamma\"),\n palette: this._handlePalette.bind(this),\n transColor: this._handleTransColor.bind(this),\n finished: this._finished.bind(this),\n inflateData: this._inflateData.bind(this),\n simpleTransparency: this._simpleTransparency.bind(this),\n headersFinished: this._headersFinished.bind(this)\n }), this._options = t, this.writable = !0, this._parser.start();\n };\n i.inherits(f, a), f.prototype._handleError = function (t) {\n this.emit(\"error\", t), this.writable = !1, this.destroy(), this._inflate && this._inflate.destroy && this._inflate.destroy(), this._filter && (this._filter.destroy(), this._filter.on(\"error\", function () {})), this.errord = !0;\n }, f.prototype._inflateData = function (t) {\n if (!this._inflate) if (this._bitmapInfo.interlace) this._inflate = n.createInflate(), this._inflate.on(\"error\", this.emit.bind(this, \"error\")), this._filter.on(\"complete\", this._complete.bind(this)), this._inflate.pipe(this._filter);else {\n let t = (1 + (this._bitmapInfo.width * this._bitmapInfo.bpp * this._bitmapInfo.depth + 7 >> 3)) * this._bitmapInfo.height,\n e = Math.max(t, n.Z_MIN_CHUNK);\n this._inflate = n.createInflate({\n chunkSize: e\n });\n let r = t,\n i = this.emit.bind(this, \"error\");\n this._inflate.on(\"error\", function (t) {\n r && i(t);\n }), this._filter.on(\"complete\", this._complete.bind(this));\n let a = this._filter.write.bind(this._filter);\n this._inflate.on(\"data\", function (t) {\n r && (t.length > r && (t = t.slice(0, r)), r -= t.length, a(t));\n }), this._inflate.on(\"end\", this._filter.end.bind(this._filter));\n }\n this._inflate.write(t);\n }, f.prototype._handleMetaData = function (t) {\n this._metaData = t, this._bitmapInfo = Object.create(t), this._filter = new o(this._bitmapInfo);\n }, f.prototype._handleTransColor = function (t) {\n this._bitmapInfo.transColor = t;\n }, f.prototype._handlePalette = function (t) {\n this._bitmapInfo.palette = t;\n }, f.prototype._simpleTransparency = function () {\n this._metaData.alpha = !0;\n }, f.prototype._headersFinished = function () {\n this.emit(\"metadata\", this._metaData);\n }, f.prototype._finished = function () {\n this.errord || (this._inflate ? this._inflate.end() : this.emit(\"error\", \"No Inflate block\"));\n }, f.prototype._complete = function (t) {\n if (this.errord) return;\n let e;\n try {\n let r = h.dataToBitMap(t, this._bitmapInfo);\n e = l(r, this._bitmapInfo, this._options.skipRescale), r = null;\n } catch (t) {\n return void this._handleError(t);\n }\n this.emit(\"parsed\", e);\n };\n }, {\n \"./bitmapper\": 1,\n \"./chunkstream\": 3,\n \"./filter-parse-async\": 7,\n \"./format-normaliser\": 10,\n \"./parser\": 18,\n util: 81,\n zlib: 32\n }],\n 17: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = !0,\n n = t(\"zlib\"),\n a = t(\"./sync-inflate\");\n n.deflateSync || (i = !1);\n let o = t(\"./sync-reader\"),\n s = t(\"./filter-parse-sync\"),\n h = t(\"./parser\"),\n l = t(\"./bitmapper\"),\n f = t(\"./format-normaliser\");\n e.exports = function (t, e) {\n if (!i) throw new Error(\"To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0\");\n let u, c, d;\n let p = [];\n let m = new o(t);\n if (new h(e, {\n read: m.read.bind(m),\n error: function (t) {\n u = t;\n },\n metadata: function (t) {\n c = t;\n },\n gamma: function (t) {\n d = t;\n },\n palette: function (t) {\n c.palette = t;\n },\n transColor: function (t) {\n c.transColor = t;\n },\n inflateData: function (t) {\n p.push(t);\n },\n simpleTransparency: function () {\n c.alpha = !0;\n }\n }).start(), m.process(), u) throw u;\n let g,\n b = r.concat(p);\n if (p.length = 0, c.interlace) g = n.inflateSync(b);else {\n let t = (1 + (c.width * c.bpp * c.depth + 7 >> 3)) * c.height;\n g = a(b, {\n chunkSize: t,\n maxLength: t\n });\n }\n if (b = null, !g || !g.length) throw new Error(\"bad png - invalid inflate data response\");\n let _ = s.process(g, c);\n b = null;\n let y = l.dataToBitMap(_, c);\n _ = null;\n let w = f(y, c, e.skipRescale);\n return c.data = w, c.gamma = d || 0, c;\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./bitmapper\": 1,\n \"./filter-parse-sync\": 8,\n \"./format-normaliser\": 10,\n \"./parser\": 18,\n \"./sync-inflate\": 21,\n \"./sync-reader\": 22,\n buffer: 33,\n zlib: 32\n }],\n 18: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n let i = t(\"./constants\"),\n n = t(\"./crc\"),\n a = e.exports = function (t, e) {\n this._options = t, t.checkCRC = !1 !== t.checkCRC, this._hasIHDR = !1, this._hasIEND = !1, this._emittedHeadersFinished = !1, this._palette = [], this._colorType = 0, this._chunks = {}, this._chunks[i.TYPE_IHDR] = this._handleIHDR.bind(this), this._chunks[i.TYPE_IEND] = this._handleIEND.bind(this), this._chunks[i.TYPE_IDAT] = this._handleIDAT.bind(this), this._chunks[i.TYPE_PLTE] = this._handlePLTE.bind(this), this._chunks[i.TYPE_tRNS] = this._handleTRNS.bind(this), this._chunks[i.TYPE_gAMA] = this._handleGAMA.bind(this), this.read = e.read, this.error = e.error, this.metadata = e.metadata, this.gamma = e.gamma, this.transColor = e.transColor, this.palette = e.palette, this.parsed = e.parsed, this.inflateData = e.inflateData, this.finished = e.finished, this.simpleTransparency = e.simpleTransparency, this.headersFinished = e.headersFinished || function () {};\n };\n a.prototype.start = function () {\n this.read(i.PNG_SIGNATURE.length, this._parseSignature.bind(this));\n }, a.prototype._parseSignature = function (t) {\n let e = i.PNG_SIGNATURE;\n for (let r = 0; r < e.length; r++) if (t[r] !== e[r]) return void this.error(new Error(\"Invalid file signature\"));\n this.read(8, this._parseChunkBegin.bind(this));\n }, a.prototype._parseChunkBegin = function (t) {\n let e = t.readUInt32BE(0),\n a = t.readUInt32BE(4),\n o = \"\";\n for (let e = 4; e < 8; e++) o += String.fromCharCode(t[e]);\n let s = Boolean(32 & t[4]);\n if (this._hasIHDR || a === i.TYPE_IHDR) {\n if (this._crc = new n(), this._crc.write(r.from(o)), this._chunks[a]) return this._chunks[a](e);\n s ? this.read(e + 4, this._skipChunk.bind(this)) : this.error(new Error(\"Unsupported critical chunk type \" + o));\n } else this.error(new Error(\"Expected IHDR on beggining\"));\n }, a.prototype._skipChunk = function () {\n this.read(8, this._parseChunkBegin.bind(this));\n }, a.prototype._handleChunkEnd = function () {\n this.read(4, this._parseChunkEnd.bind(this));\n }, a.prototype._parseChunkEnd = function (t) {\n let e = t.readInt32BE(0),\n r = this._crc.crc32();\n this._options.checkCRC && r !== e ? this.error(new Error(\"Crc error - \" + e + \" - \" + r)) : this._hasIEND || this.read(8, this._parseChunkBegin.bind(this));\n }, a.prototype._handleIHDR = function (t) {\n this.read(t, this._parseIHDR.bind(this));\n }, a.prototype._parseIHDR = function (t) {\n this._crc.write(t);\n let e = t.readUInt32BE(0),\n r = t.readUInt32BE(4),\n n = t[8],\n a = t[9],\n o = t[10],\n s = t[11],\n h = t[12];\n if (8 !== n && 4 !== n && 2 !== n && 1 !== n && 16 !== n) return void this.error(new Error(\"Unsupported bit depth \" + n));\n if (!(a in i.COLORTYPE_TO_BPP_MAP)) return void this.error(new Error(\"Unsupported color type\"));\n if (0 !== o) return void this.error(new Error(\"Unsupported compression method\"));\n if (0 !== s) return void this.error(new Error(\"Unsupported filter method\"));\n if (0 !== h && 1 !== h) return void this.error(new Error(\"Unsupported interlace method\"));\n this._colorType = a;\n let l = i.COLORTYPE_TO_BPP_MAP[this._colorType];\n this._hasIHDR = !0, this.metadata({\n width: e,\n height: r,\n depth: n,\n interlace: Boolean(h),\n palette: Boolean(a & i.COLORTYPE_PALETTE),\n color: Boolean(a & i.COLORTYPE_COLOR),\n alpha: Boolean(a & i.COLORTYPE_ALPHA),\n bpp: l,\n colorType: a\n }), this._handleChunkEnd();\n }, a.prototype._handlePLTE = function (t) {\n this.read(t, this._parsePLTE.bind(this));\n }, a.prototype._parsePLTE = function (t) {\n this._crc.write(t);\n let e = Math.floor(t.length / 3);\n for (let r = 0; r < e; r++) this._palette.push([t[3 * r], t[3 * r + 1], t[3 * r + 2], 255]);\n this.palette(this._palette), this._handleChunkEnd();\n }, a.prototype._handleTRNS = function (t) {\n this.simpleTransparency(), this.read(t, this._parseTRNS.bind(this));\n }, a.prototype._parseTRNS = function (t) {\n if (this._crc.write(t), this._colorType === i.COLORTYPE_PALETTE_COLOR) {\n if (0 === this._palette.length) return void this.error(new Error(\"Transparency chunk must be after palette\"));\n if (t.length > this._palette.length) return void this.error(new Error(\"More transparent colors than palette size\"));\n for (let e = 0; e < t.length; e++) this._palette[e][3] = t[e];\n this.palette(this._palette);\n }\n this._colorType === i.COLORTYPE_GRAYSCALE && this.transColor([t.readUInt16BE(0)]), this._colorType === i.COLORTYPE_COLOR && this.transColor([t.readUInt16BE(0), t.readUInt16BE(2), t.readUInt16BE(4)]), this._handleChunkEnd();\n }, a.prototype._handleGAMA = function (t) {\n this.read(t, this._parseGAMA.bind(this));\n }, a.prototype._parseGAMA = function (t) {\n this._crc.write(t), this.gamma(t.readUInt32BE(0) / i.GAMMA_DIVISION), this._handleChunkEnd();\n }, a.prototype._handleIDAT = function (t) {\n this._emittedHeadersFinished || (this._emittedHeadersFinished = !0, this.headersFinished()), this.read(-t, this._parseIDAT.bind(this, t));\n }, a.prototype._parseIDAT = function (t, e) {\n if (this._crc.write(e), this._colorType === i.COLORTYPE_PALETTE_COLOR && 0 === this._palette.length) throw new Error(\"Expected palette not found\");\n this.inflateData(e);\n let r = t - e.length;\n r > 0 ? this._handleIDAT(r) : this._handleChunkEnd();\n }, a.prototype._handleIEND = function (t) {\n this.read(t, this._parseIEND.bind(this));\n }, a.prototype._parseIEND = function (t) {\n this._crc.write(t), this._hasIEND = !0, this._handleChunkEnd(), this.finished && this.finished();\n };\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"./constants\": 4,\n \"./crc\": 5,\n buffer: 33\n }],\n 19: [function (t, e, r) {\n \"use strict\";\n\n let i = t(\"./parser-sync\"),\n n = t(\"./packer-sync\");\n r.read = function (t, e) {\n return i(t, e || {});\n }, r.write = function (t, e) {\n return n(t, e);\n };\n }, {\n \"./packer-sync\": 13,\n \"./parser-sync\": 17\n }],\n 20: [function (t, e, r) {\n (function (e, i) {\n (function () {\n \"use strict\";\n\n let n = t(\"util\"),\n a = t(\"stream\"),\n o = t(\"./parser-async\"),\n s = t(\"./packer-async\"),\n h = t(\"./png-sync\"),\n l = r.PNG = function (t) {\n a.call(this), t = t || {}, this.width = 0 | t.width, this.height = 0 | t.height, this.data = this.width > 0 && this.height > 0 ? i.alloc(4 * this.width * this.height) : null, t.fill && this.data && this.data.fill(0), this.gamma = 0, this.readable = this.writable = !0, this._parser = new o(t), this._parser.on(\"error\", this.emit.bind(this, \"error\")), this._parser.on(\"close\", this._handleClose.bind(this)), this._parser.on(\"metadata\", this._metadata.bind(this)), this._parser.on(\"gamma\", this._gamma.bind(this)), this._parser.on(\"parsed\", function (t) {\n this.data = t, this.emit(\"parsed\", t);\n }.bind(this)), this._packer = new s(t), this._packer.on(\"data\", this.emit.bind(this, \"data\")), this._packer.on(\"end\", this.emit.bind(this, \"end\")), this._parser.on(\"close\", this._handleClose.bind(this)), this._packer.on(\"error\", this.emit.bind(this, \"error\"));\n };\n n.inherits(l, a), l.sync = h, l.prototype.pack = function () {\n return this.data && this.data.length ? (e.nextTick(function () {\n this._packer.pack(this.data, this.width, this.height, this.gamma);\n }.bind(this)), this) : (this.emit(\"error\", \"No data provided\"), this);\n }, l.prototype.parse = function (t, e) {\n if (e) {\n let t, r;\n t = function (t) {\n this.removeListener(\"error\", r), this.data = t, e(null, this);\n }.bind(this), r = function (r) {\n this.removeListener(\"parsed\", t), e(r, null);\n }.bind(this), this.once(\"parsed\", t), this.once(\"error\", r);\n }\n return this.end(t), this;\n }, l.prototype.write = function (t) {\n return this._parser.write(t), !0;\n }, l.prototype.end = function (t) {\n this._parser.end(t);\n }, l.prototype._metadata = function (t) {\n this.width = t.width, this.height = t.height, this.emit(\"metadata\", t);\n }, l.prototype._gamma = function (t) {\n this.gamma = t;\n }, l.prototype._handleClose = function () {\n this._parser.writable || this._packer.readable || this.emit(\"close\");\n }, l.bitblt = function (t, e, r, i, n, a, o, s) {\n if (i |= 0, n |= 0, a |= 0, o |= 0, s |= 0, (r |= 0) > t.width || i > t.height || r + n > t.width || i + a > t.height) throw new Error(\"bitblt reading outside image\");\n if (o > e.width || s > e.height || o + n > e.width || s + a > e.height) throw new Error(\"bitblt writing outside image\");\n for (let h = 0; h < a; h++) t.data.copy(e.data, (s + h) * e.width + o << 2, (i + h) * t.width + r << 2, (i + h) * t.width + r + n << 2);\n }, l.prototype.bitblt = function (t, e, r, i, n, a, o) {\n return l.bitblt(this, t, e, r, i, n, a, o), this;\n }, l.adjustGamma = function (t) {\n if (t.gamma) {\n for (let e = 0; e < t.height; e++) for (let r = 0; r < t.width; r++) {\n let i = t.width * e + r << 2;\n for (let e = 0; e < 3; e++) {\n let r = t.data[i + e] / 255;\n r = Math.pow(r, 1 / 2.2 / t.gamma), t.data[i + e] = Math.round(255 * r);\n }\n }\n t.gamma = 0;\n }\n }, l.prototype.adjustGamma = function () {\n l.adjustGamma(this);\n };\n }).call(this);\n }).call(this, t(\"_process\"), t(\"buffer\").Buffer);\n }, {\n \"./packer-async\": 12,\n \"./parser-async\": 16,\n \"./png-sync\": 19,\n _process: 60,\n buffer: 33,\n stream: 61,\n util: 81\n }],\n 21: [function (t, e, r) {\n (function (i, n) {\n (function () {\n \"use strict\";\n\n let a = t(\"assert\").ok,\n o = t(\"zlib\"),\n s = t(\"util\"),\n h = t(\"buffer\").kMaxLength;\n function l(t) {\n if (!(this instanceof l)) return new l(t);\n t && t.chunkSize < o.Z_MIN_CHUNK && (t.chunkSize = o.Z_MIN_CHUNK), o.Inflate.call(this, t), this._offset = void 0 === this._offset ? this._outOffset : this._offset, this._buffer = this._buffer || this._outBuffer, t && null != t.maxLength && (this._maxLength = t.maxLength);\n }\n function f(t, e) {\n e && i.nextTick(e), t._handle && (t._handle.close(), t._handle = null);\n }\n function u(t, e) {\n return function (t, e) {\n if (\"string\" == typeof e && (e = n.from(e)), !(e instanceof n)) throw new TypeError(\"Not a string or buffer\");\n let r = t._finishFlushFlag;\n return null == r && (r = o.Z_FINISH), t._processChunk(e, r);\n }(new l(e), t);\n }\n l.prototype._processChunk = function (t, e, r) {\n if (\"function\" == typeof r) return o.Inflate._processChunk.call(this, t, e, r);\n let i,\n s,\n l = this,\n u = t && t.length,\n c = this._chunkSize - this._offset,\n d = this._maxLength,\n p = 0,\n m = [],\n g = 0;\n function b(t, e) {\n if (l._hadError) return;\n let r = c - e;\n if (a(r >= 0, \"have should not go down\"), r > 0) {\n let t = l._buffer.slice(l._offset, l._offset + r);\n if (l._offset += r, t.length > d && (t = t.slice(0, d)), m.push(t), g += t.length, d -= t.length, 0 === d) return !1;\n }\n return (0 === e || l._offset >= l._chunkSize) && (c = l._chunkSize, l._offset = 0, l._buffer = n.allocUnsafe(l._chunkSize)), 0 === e && (p += u - t, u = t, !0);\n }\n this.on(\"error\", function (t) {\n i = t;\n }), a(this._handle, \"zlib binding closed\");\n do {\n s = this._handle.writeSync(e, t, p, u, this._buffer, this._offset, c), s = s || this._writeState;\n } while (!this._hadError && b(s[0], s[1]));\n if (this._hadError) throw i;\n if (g >= h) throw f(this), new RangeError(\"Cannot create final Buffer. It would be larger than 0x\" + h.toString(16) + \" bytes\");\n let _ = n.concat(m, g);\n return f(this), _;\n }, s.inherits(l, o.Inflate), e.exports = r = u, r.Inflate = l, r.createInflate = function (t) {\n return new l(t);\n }, r.inflateSync = u;\n }).call(this);\n }).call(this, t(\"_process\"), t(\"buffer\").Buffer);\n }, {\n _process: 60,\n assert: 23,\n buffer: 33,\n util: 81,\n zlib: 32\n }],\n 22: [function (t, e, r) {\n \"use strict\";\n\n let i = e.exports = function (t) {\n this._buffer = t, this._reads = [];\n };\n i.prototype.read = function (t, e) {\n this._reads.push({\n length: Math.abs(t),\n allowLess: t < 0,\n func: e\n });\n }, i.prototype.process = function () {\n for (; this._reads.length > 0 && this._buffer.length;) {\n let t = this._reads[0];\n if (!this._buffer.length || !(this._buffer.length >= t.length || t.allowLess)) break;\n {\n this._reads.shift();\n let e = this._buffer;\n this._buffer = e.slice(t.length), t.func.call(this, e.slice(0, t.length));\n }\n }\n if (this._reads.length > 0) throw new Error(\"There are some read requests waitng on finished stream\");\n if (this._buffer.length > 0) throw new Error(\"unrecognised content at end of stream\");\n };\n }, {}],\n 23: [function (t, e, i) {\n (function (r) {\n (function () {\n \"use strict\";\n\n function i(t, e) {\n if (t === e) return 0;\n for (var r = t.length, i = e.length, n = 0, a = Math.min(r, i); n < a; ++n) if (t[n] !== e[n]) {\n r = t[n], i = e[n];\n break;\n }\n return r < i ? -1 : i < r ? 1 : 0;\n }\n function n(t) {\n return r.Buffer && \"function\" == typeof r.Buffer.isBuffer ? r.Buffer.isBuffer(t) : !(null == t || !t._isBuffer);\n }\n var a = t(\"util/\"),\n o = Object.prototype.hasOwnProperty,\n s = Array.prototype.slice,\n h = \"foo\" === function () {}.name;\n function l(t) {\n return Object.prototype.toString.call(t);\n }\n function f(t) {\n return !n(t) && \"function\" == typeof r.ArrayBuffer && (\"function\" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(t) : !!t && (t instanceof DataView || !!(t.buffer && t.buffer instanceof ArrayBuffer)));\n }\n var u = e.exports = b,\n c = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n function d(t) {\n if (a.isFunction(t)) {\n if (h) return t.name;\n var e = t.toString().match(c);\n return e && e[1];\n }\n }\n function p(t, e) {\n return \"string\" == typeof t ? t.length < e ? t : t.slice(0, e) : t;\n }\n function m(t) {\n if (h || !a.isFunction(t)) return a.inspect(t);\n var e = d(t);\n return \"[Function\" + (e ? \": \" + e : \"\") + \"]\";\n }\n function g(t, e, r, i, n) {\n throw new u.AssertionError({\n message: r,\n actual: t,\n expected: e,\n operator: i,\n stackStartFunction: n\n });\n }\n function b(t, e) {\n t || g(t, !0, e, \"==\", u.ok);\n }\n function _(t, e, r, o) {\n if (t === e) return !0;\n if (n(t) && n(e)) return 0 === i(t, e);\n if (a.isDate(t) && a.isDate(e)) return t.getTime() === e.getTime();\n if (a.isRegExp(t) && a.isRegExp(e)) return t.source === e.source && t.global === e.global && t.multiline === e.multiline && t.lastIndex === e.lastIndex && t.ignoreCase === e.ignoreCase;\n if (null !== t && \"object\" == typeof t || null !== e && \"object\" == typeof e) {\n if (f(t) && f(e) && l(t) === l(e) && !(t instanceof Float32Array || t instanceof Float64Array)) return 0 === i(new Uint8Array(t.buffer), new Uint8Array(e.buffer));\n if (n(t) !== n(e)) return !1;\n var h = (o = o || {\n actual: [],\n expected: []\n }).actual.indexOf(t);\n return -1 !== h && h === o.expected.indexOf(e) || (o.actual.push(t), o.expected.push(e), function (t, e, r, i) {\n if (null == t || null == e) return !1;\n if (a.isPrimitive(t) || a.isPrimitive(e)) return t === e;\n if (r && Object.getPrototypeOf(t) !== Object.getPrototypeOf(e)) return !1;\n var n = y(t),\n o = y(e);\n if (n && !o || !n && o) return !1;\n if (n) return _(t = s.call(t), e = s.call(e), r);\n var h,\n l,\n f = x(t),\n u = x(e);\n if (f.length !== u.length) return !1;\n for (f.sort(), u.sort(), l = f.length - 1; l >= 0; l--) if (f[l] !== u[l]) return !1;\n for (l = f.length - 1; l >= 0; l--) if (!_(t[h = f[l]], e[h], r, i)) return !1;\n return !0;\n }(t, e, r, o));\n }\n return r ? t === e : t == e;\n }\n function y(t) {\n return \"[object Arguments]\" == Object.prototype.toString.call(t);\n }\n function w(t, e) {\n if (!t || !e) return !1;\n if (\"[object RegExp]\" == Object.prototype.toString.call(e)) return e.test(t);\n try {\n if (t instanceof e) return !0;\n } catch (t) {}\n return !Error.isPrototypeOf(e) && !0 === e.call({}, t);\n }\n function v(t, e, r, i) {\n var n;\n if (\"function\" != typeof e) throw new TypeError('\"block\" argument must be a function');\n \"string\" == typeof r && (i = r, r = null), n = function (t) {\n var e;\n try {\n t();\n } catch (t) {\n e = t;\n }\n return e;\n }(e), i = (r && r.name ? \" (\" + r.name + \").\" : \".\") + (i ? \" \" + i : \".\"), t && !n && g(n, r, \"Missing expected exception\" + i);\n var o = \"string\" == typeof i,\n s = !t && n && !r;\n if ((!t && a.isError(n) && o && w(n, r) || s) && g(n, r, \"Got unwanted exception\" + i), t && n && r && !w(n, r) || !t && n) throw n;\n }\n u.AssertionError = function (t) {\n this.name = \"AssertionError\", this.actual = t.actual, this.expected = t.expected, this.operator = t.operator, t.message ? (this.message = t.message, this.generatedMessage = !1) : (this.message = function (t) {\n return p(m(t.actual), 128) + \" \" + t.operator + \" \" + p(m(t.expected), 128);\n }(this), this.generatedMessage = !0);\n var e = t.stackStartFunction || g;\n if (Error.captureStackTrace) Error.captureStackTrace(this, e);else {\n var r = new Error();\n if (r.stack) {\n var i = r.stack,\n n = d(e),\n a = i.indexOf(\"\\n\" + n);\n if (a >= 0) {\n var o = i.indexOf(\"\\n\", a + 1);\n i = i.substring(o + 1);\n }\n this.stack = i;\n }\n }\n }, a.inherits(u.AssertionError, Error), u.fail = g, u.ok = b, u.equal = function (t, e, r) {\n t != e && g(t, e, r, \"==\", u.equal);\n }, u.notEqual = function (t, e, r) {\n t == e && g(t, e, r, \"!=\", u.notEqual);\n }, u.deepEqual = function (t, e, r) {\n _(t, e, !1) || g(t, e, r, \"deepEqual\", u.deepEqual);\n }, u.deepStrictEqual = function (t, e, r) {\n _(t, e, !0) || g(t, e, r, \"deepStrictEqual\", u.deepStrictEqual);\n }, u.notDeepEqual = function (t, e, r) {\n _(t, e, !1) && g(t, e, r, \"notDeepEqual\", u.notDeepEqual);\n }, u.notDeepStrictEqual = function t(e, r, i) {\n _(e, r, !0) && g(e, r, i, \"notDeepStrictEqual\", t);\n }, u.strictEqual = function (t, e, r) {\n t !== e && g(t, e, r, \"===\", u.strictEqual);\n }, u.notStrictEqual = function (t, e, r) {\n t === e && g(t, e, r, \"!==\", u.notStrictEqual);\n }, u.throws = function (t, e, r) {\n v(!0, t, e, r);\n }, u.doesNotThrow = function (t, e, r) {\n v(!1, t, e, r);\n }, u.ifError = function (t) {\n if (t) throw t;\n };\n var x = Object.keys || function (t) {\n var e = [];\n for (var r in t) o.call(t, r) && e.push(r);\n return e;\n };\n }).call(this);\n }).call(this, void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {\n \"util/\": 26\n }],\n 24: [function (t, e, r) {\n \"function\" == typeof Object.create ? e.exports = function (t, e) {\n t.super_ = e, t.prototype = Object.create(e.prototype, {\n constructor: {\n value: t,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n } : e.exports = function (t, e) {\n t.super_ = e;\n var r = function () {};\n r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;\n };\n }, {}],\n 25: [function (t, e, r) {\n e.exports = function (t) {\n return t && \"object\" == typeof t && \"function\" == typeof t.copy && \"function\" == typeof t.fill && \"function\" == typeof t.readUInt8;\n };\n }, {}],\n 26: [function (t, e, i) {\n (function (e, r) {\n (function () {\n var n = /%[sdj%]/g;\n i.format = function (t) {\n if (!b(t)) {\n for (var e = [], r = 0; r < arguments.length; r++) e.push(s(arguments[r]));\n return e.join(\" \");\n }\n r = 1;\n for (var i = arguments, a = i.length, o = String(t).replace(n, function (t) {\n if (\"%%\" === t) return \"%\";\n if (r >= a) return t;\n switch (t) {\n case \"%s\":\n return String(i[r++]);\n case \"%d\":\n return Number(i[r++]);\n case \"%j\":\n try {\n return JSON.stringify(i[r++]);\n } catch (t) {\n return \"[Circular]\";\n }\n default:\n return t;\n }\n }), h = i[r]; r < a; h = i[++r]) m(h) || !w(h) ? o += \" \" + h : o += \" \" + s(h);\n return o;\n }, i.deprecate = function (t, n) {\n if (_(r.process)) return function () {\n return i.deprecate(t, n).apply(this, arguments);\n };\n if (!0 === e.noDeprecation) return t;\n var a = !1;\n return function () {\n if (!a) {\n if (e.throwDeprecation) throw new Error(n);\n e.traceDeprecation ? console.trace(n) : console.error(n), a = !0;\n }\n return t.apply(this, arguments);\n };\n };\n var a,\n o = {};\n function s(t, e) {\n var r = {\n seen: [],\n stylize: l\n };\n return arguments.length >= 3 && (r.depth = arguments[2]), arguments.length >= 4 && (r.colors = arguments[3]), p(e) ? r.showHidden = e : e && i._extend(r, e), _(r.showHidden) && (r.showHidden = !1), _(r.depth) && (r.depth = 2), _(r.colors) && (r.colors = !1), _(r.customInspect) && (r.customInspect = !0), r.colors && (r.stylize = h), f(r, t, r.depth);\n }\n function h(t, e) {\n var r = s.styles[e];\n return r ? \"\u001b[\" + s.colors[r][0] + \"m\" + t + \"\u001b[\" + s.colors[r][1] + \"m\" : t;\n }\n function l(t, e) {\n return t;\n }\n function f(t, e, r) {\n if (t.customInspect && e && E(e.inspect) && e.inspect !== i.inspect && (!e.constructor || e.constructor.prototype !== e)) {\n var n = e.inspect(r, t);\n return b(n) || (n = f(t, n, r)), n;\n }\n var a = function (t, e) {\n if (_(e)) return t.stylize(\"undefined\", \"undefined\");\n if (b(e)) {\n var r = \"'\" + JSON.stringify(e).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return t.stylize(r, \"string\");\n }\n return g(e) ? t.stylize(\"\" + e, \"number\") : p(e) ? t.stylize(\"\" + e, \"boolean\") : m(e) ? t.stylize(\"null\", \"null\") : void 0;\n }(t, e);\n if (a) return a;\n var o = Object.keys(e),\n s = function (t) {\n var e = {};\n return t.forEach(function (t, r) {\n e[t] = !0;\n }), e;\n }(o);\n if (t.showHidden && (o = Object.getOwnPropertyNames(e)), x(e) && (o.indexOf(\"message\") >= 0 || o.indexOf(\"description\") >= 0)) return u(e);\n if (0 === o.length) {\n if (E(e)) {\n var h = e.name ? \": \" + e.name : \"\";\n return t.stylize(\"[Function\" + h + \"]\", \"special\");\n }\n if (y(e)) return t.stylize(RegExp.prototype.toString.call(e), \"regexp\");\n if (v(e)) return t.stylize(Date.prototype.toString.call(e), \"date\");\n if (x(e)) return u(e);\n }\n var l,\n w = \"\",\n k = !1,\n S = [\"{\", \"}\"];\n return d(e) && (k = !0, S = [\"[\", \"]\"]), E(e) && (w = \" [Function\" + (e.name ? \": \" + e.name : \"\") + \"]\"), y(e) && (w = \" \" + RegExp.prototype.toString.call(e)), v(e) && (w = \" \" + Date.prototype.toUTCString.call(e)), x(e) && (w = \" \" + u(e)), 0 !== o.length || k && 0 != e.length ? r < 0 ? y(e) ? t.stylize(RegExp.prototype.toString.call(e), \"regexp\") : t.stylize(\"[Object]\", \"special\") : (t.seen.push(e), l = k ? function (t, e, r, i, n) {\n for (var a = [], o = 0, s = e.length; o < s; ++o) A(e, String(o)) ? a.push(c(t, e, r, i, String(o), !0)) : a.push(\"\");\n return n.forEach(function (n) {\n n.match(/^\\d+$/) || a.push(c(t, e, r, i, n, !0));\n }), a;\n }(t, e, r, s, o) : o.map(function (i) {\n return c(t, e, r, s, i, k);\n }), t.seen.pop(), function (t, e, r) {\n return t.reduce(function (t, e) {\n return e.indexOf(\"\\n\"), t + e.replace(/\\u001b\\[\\d\\d?m/g, \"\").length + 1;\n }, 0) > 60 ? r[0] + (\"\" === e ? \"\" : e + \"\\n \") + \" \" + t.join(\",\\n \") + \" \" + r[1] : r[0] + e + \" \" + t.join(\", \") + \" \" + r[1];\n }(l, w, S)) : S[0] + w + S[1];\n }\n function u(t) {\n return \"[\" + Error.prototype.toString.call(t) + \"]\";\n }\n function c(t, e, r, i, n, a) {\n var o, s, h;\n if ((h = Object.getOwnPropertyDescriptor(e, n) || {\n value: e[n]\n }).get ? s = h.set ? t.stylize(\"[Getter/Setter]\", \"special\") : t.stylize(\"[Getter]\", \"special\") : h.set && (s = t.stylize(\"[Setter]\", \"special\")), A(i, n) || (o = \"[\" + n + \"]\"), s || (t.seen.indexOf(h.value) < 0 ? (s = m(r) ? f(t, h.value, null) : f(t, h.value, r - 1)).indexOf(\"\\n\") > -1 && (s = a ? s.split(\"\\n\").map(function (t) {\n return \" \" + t;\n }).join(\"\\n\").substr(2) : \"\\n\" + s.split(\"\\n\").map(function (t) {\n return \" \" + t;\n }).join(\"\\n\")) : s = t.stylize(\"[Circular]\", \"special\")), _(o)) {\n if (a && n.match(/^\\d+$/)) return s;\n (o = JSON.stringify(\"\" + n)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/) ? (o = o.substr(1, o.length - 2), o = t.stylize(o, \"name\")) : (o = o.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), o = t.stylize(o, \"string\"));\n }\n return o + \": \" + s;\n }\n function d(t) {\n return Array.isArray(t);\n }\n function p(t) {\n return \"boolean\" == typeof t;\n }\n function m(t) {\n return null === t;\n }\n function g(t) {\n return \"number\" == typeof t;\n }\n function b(t) {\n return \"string\" == typeof t;\n }\n function _(t) {\n return void 0 === t;\n }\n function y(t) {\n return w(t) && \"[object RegExp]\" === k(t);\n }\n function w(t) {\n return \"object\" == typeof t && null !== t;\n }\n function v(t) {\n return w(t) && \"[object Date]\" === k(t);\n }\n function x(t) {\n return w(t) && (\"[object Error]\" === k(t) || t instanceof Error);\n }\n function E(t) {\n return \"function\" == typeof t;\n }\n function k(t) {\n return Object.prototype.toString.call(t);\n }\n function S(t) {\n return t < 10 ? \"0\" + t.toString(10) : t.toString(10);\n }\n i.debuglog = function (t) {\n if (_(a) && (a = e.env.NODE_DEBUG || \"\"), t = t.toUpperCase(), !o[t]) if (new RegExp(\"\\\\b\" + t + \"\\\\b\", \"i\").test(a)) {\n var r = e.pid;\n o[t] = function () {\n var e = i.format.apply(i, arguments);\n console.error(\"%s %d: %s\", t, r, e);\n };\n } else o[t] = function () {};\n return o[t];\n }, i.inspect = s, s.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n }, s.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n }, i.isArray = d, i.isBoolean = p, i.isNull = m, i.isNullOrUndefined = function (t) {\n return null == t;\n }, i.isNumber = g, i.isString = b, i.isSymbol = function (t) {\n return \"symbol\" == typeof t;\n }, i.isUndefined = _, i.isRegExp = y, i.isObject = w, i.isDate = v, i.isError = x, i.isFunction = E, i.isPrimitive = function (t) {\n return null === t || \"boolean\" == typeof t || \"number\" == typeof t || \"string\" == typeof t || \"symbol\" == typeof t || void 0 === t;\n }, i.isBuffer = t(\"./support/isBuffer\");\n var M = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n function A(t, e) {\n return Object.prototype.hasOwnProperty.call(t, e);\n }\n i.log = function () {\n var t, e;\n console.log(\"%s - %s\", (t = new Date(), e = [S(t.getHours()), S(t.getMinutes()), S(t.getSeconds())].join(\":\"), [t.getDate(), M[t.getMonth()], e].join(\" \")), i.format.apply(i, arguments));\n }, i.inherits = t(\"inherits\"), i._extend = function (t, e) {\n if (!e || !w(e)) return t;\n for (var r = Object.keys(e), i = r.length; i--;) t[r[i]] = e[r[i]];\n return t;\n };\n }).call(this);\n }).call(this, t(\"_process\"), void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {\n \"./support/isBuffer\": 25,\n _process: 60,\n inherits: 24\n }],\n 27: [function (t, e, i) {\n (function (r) {\n (function () {\n \"use strict\";\n\n var i = t(\"array-filter\");\n e.exports = function () {\n return i([\"BigInt64Array\", \"BigUint64Array\", \"Float32Array\", \"Float64Array\", \"Int16Array\", \"Int32Array\", \"Int8Array\", \"Uint16Array\", \"Uint32Array\", \"Uint8Array\", \"Uint8ClampedArray\"], function (t) {\n return \"function\" == typeof r[t];\n });\n };\n }).call(this);\n }).call(this, void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {\n \"array-filter\": 28\n }],\n 28: [function (t, e, r) {\n e.exports = function (t, e, r) {\n if (t.filter) return t.filter(e, r);\n if (null == t) throw new TypeError();\n if (\"function\" != typeof e) throw new TypeError();\n for (var n = [], a = 0; a < t.length; a++) if (i.call(t, a)) {\n var o = t[a];\n e.call(r, o, a, t) && n.push(o);\n }\n return n;\n };\n var i = Object.prototype.hasOwnProperty;\n }, {}],\n 29: [function (t, e, r) {\n \"use strict\";\n\n r.byteLength = function (t) {\n var e = l(t),\n r = e[0],\n i = e[1];\n return 3 * (r + i) / 4 - i;\n }, r.toByteArray = function (t) {\n var e,\n r,\n i = l(t),\n o = i[0],\n s = i[1],\n h = new a(function (t, e, r) {\n return 3 * (e + r) / 4 - r;\n }(0, o, s)),\n f = 0,\n u = s > 0 ? o - 4 : o;\n for (r = 0; r < u; r += 4) e = n[t.charCodeAt(r)] << 18 | n[t.charCodeAt(r + 1)] << 12 | n[t.charCodeAt(r + 2)] << 6 | n[t.charCodeAt(r + 3)], h[f++] = e >> 16 & 255, h[f++] = e >> 8 & 255, h[f++] = 255 & e;\n return 2 === s && (e = n[t.charCodeAt(r)] << 2 | n[t.charCodeAt(r + 1)] >> 4, h[f++] = 255 & e), 1 === s && (e = n[t.charCodeAt(r)] << 10 | n[t.charCodeAt(r + 1)] << 4 | n[t.charCodeAt(r + 2)] >> 2, h[f++] = e >> 8 & 255, h[f++] = 255 & e), h;\n }, r.fromByteArray = function (t) {\n for (var e, r = t.length, n = r % 3, a = [], o = 16383, s = 0, h = r - n; s < h; s += o) a.push(f(t, s, s + o > h ? h : s + o));\n return 1 === n ? (e = t[r - 1], a.push(i[e >> 2] + i[e << 4 & 63] + \"==\")) : 2 === n && (e = (t[r - 2] << 8) + t[r - 1], a.push(i[e >> 10] + i[e >> 4 & 63] + i[e << 2 & 63] + \"=\")), a.join(\"\");\n };\n for (var i = [], n = [], a = \"undefined\" != typeof Uint8Array ? Uint8Array : Array, o = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\", s = 0, h = o.length; s < h; ++s) i[s] = o[s], n[o.charCodeAt(s)] = s;\n function l(t) {\n var e = t.length;\n if (e % 4 > 0) throw new Error(\"Invalid string. Length must be a multiple of 4\");\n var r = t.indexOf(\"=\");\n return -1 === r && (r = e), [r, r === e ? 0 : 4 - r % 4];\n }\n function f(t, e, r) {\n for (var n, a = [], o = e; o < r; o += 3) n = (t[o] << 16 & 16711680) + (t[o + 1] << 8 & 65280) + (255 & t[o + 2]), a.push(i[(s = n) >> 18 & 63] + i[s >> 12 & 63] + i[s >> 6 & 63] + i[63 & s]);\n var s;\n return a.join(\"\");\n }\n n[\"-\".charCodeAt(0)] = 62, n[\"_\".charCodeAt(0)] = 63;\n }, {}],\n 30: [function (t, e, r) {}, {}],\n 31: [function (t, e, r) {\n (function (e, i) {\n (function () {\n \"use strict\";\n\n var n = t(\"assert\"),\n a = t(\"pako/lib/zlib/zstream\"),\n o = t(\"pako/lib/zlib/deflate.js\"),\n s = t(\"pako/lib/zlib/inflate.js\"),\n h = t(\"pako/lib/zlib/constants\");\n for (var l in h) r[l] = h[l];\n r.NONE = 0, r.DEFLATE = 1, r.INFLATE = 2, r.GZIP = 3, r.GUNZIP = 4, r.DEFLATERAW = 5, r.INFLATERAW = 6, r.UNZIP = 7;\n function f(t) {\n if (\"number\" != typeof t || t < r.DEFLATE || t > r.UNZIP) throw new TypeError(\"Bad argument\");\n this.dictionary = null, this.err = 0, this.flush = 0, this.init_done = !1, this.level = 0, this.memLevel = 0, this.mode = t, this.strategy = 0, this.windowBits = 0, this.write_in_progress = !1, this.pending_close = !1, this.gzip_id_bytes_read = 0;\n }\n f.prototype.close = function () {\n this.write_in_progress ? this.pending_close = !0 : (this.pending_close = !1, n(this.init_done, \"close before init\"), n(this.mode <= r.UNZIP), this.mode === r.DEFLATE || this.mode === r.GZIP || this.mode === r.DEFLATERAW ? o.deflateEnd(this.strm) : this.mode !== r.INFLATE && this.mode !== r.GUNZIP && this.mode !== r.INFLATERAW && this.mode !== r.UNZIP || s.inflateEnd(this.strm), this.mode = r.NONE, this.dictionary = null);\n }, f.prototype.write = function (t, e, r, i, n, a, o) {\n return this._write(!0, t, e, r, i, n, a, o);\n }, f.prototype.writeSync = function (t, e, r, i, n, a, o) {\n return this._write(!1, t, e, r, i, n, a, o);\n }, f.prototype._write = function (t, a, o, s, h, l, f, u) {\n if (n.equal(arguments.length, 8), n(this.init_done, \"write before init\"), n(this.mode !== r.NONE, \"already finalized\"), n.equal(!1, this.write_in_progress, \"write already in progress\"), n.equal(!1, this.pending_close, \"close is pending\"), this.write_in_progress = !0, n.equal(!1, void 0 === a, \"must provide flush value\"), this.write_in_progress = !0, a !== r.Z_NO_FLUSH && a !== r.Z_PARTIAL_FLUSH && a !== r.Z_SYNC_FLUSH && a !== r.Z_FULL_FLUSH && a !== r.Z_FINISH && a !== r.Z_BLOCK) throw new Error(\"Invalid flush value\");\n if (null == o && (o = i.alloc(0), h = 0, s = 0), this.strm.avail_in = h, this.strm.input = o, this.strm.next_in = s, this.strm.avail_out = u, this.strm.output = l, this.strm.next_out = f, this.flush = a, !t) return this._process(), this._checkError() ? this._afterSync() : void 0;\n var c = this;\n return e.nextTick(function () {\n c._process(), c._after();\n }), this;\n }, f.prototype._afterSync = function () {\n var t = this.strm.avail_out,\n e = this.strm.avail_in;\n return this.write_in_progress = !1, [e, t];\n }, f.prototype._process = function () {\n var t = null;\n switch (this.mode) {\n case r.DEFLATE:\n case r.GZIP:\n case r.DEFLATERAW:\n this.err = o.deflate(this.strm, this.flush);\n break;\n case r.UNZIP:\n switch (this.strm.avail_in > 0 && (t = this.strm.next_in), this.gzip_id_bytes_read) {\n case 0:\n if (null === t) break;\n if (31 !== this.strm.input[t]) {\n this.mode = r.INFLATE;\n break;\n }\n if (this.gzip_id_bytes_read = 1, t++, 1 === this.strm.avail_in) break;\n case 1:\n if (null === t) break;\n 139 === this.strm.input[t] ? (this.gzip_id_bytes_read = 2, this.mode = r.GUNZIP) : this.mode = r.INFLATE;\n break;\n default:\n throw new Error(\"invalid number of gzip magic number bytes read\");\n }\n case r.INFLATE:\n case r.GUNZIP:\n case r.INFLATERAW:\n for (this.err = s.inflate(this.strm, this.flush), this.err === r.Z_NEED_DICT && this.dictionary && (this.err = s.inflateSetDictionary(this.strm, this.dictionary), this.err === r.Z_OK ? this.err = s.inflate(this.strm, this.flush) : this.err === r.Z_DATA_ERROR && (this.err = r.Z_NEED_DICT)); this.strm.avail_in > 0 && this.mode === r.GUNZIP && this.err === r.Z_STREAM_END && 0 !== this.strm.next_in[0];) this.reset(), this.err = s.inflate(this.strm, this.flush);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n }, f.prototype._checkError = function () {\n switch (this.err) {\n case r.Z_OK:\n case r.Z_BUF_ERROR:\n if (0 !== this.strm.avail_out && this.flush === r.Z_FINISH) return this._error(\"unexpected end of file\"), !1;\n break;\n case r.Z_STREAM_END:\n break;\n case r.Z_NEED_DICT:\n return null == this.dictionary ? this._error(\"Missing dictionary\") : this._error(\"Bad dictionary\"), !1;\n default:\n return this._error(\"Zlib error\"), !1;\n }\n return !0;\n }, f.prototype._after = function () {\n if (this._checkError()) {\n var t = this.strm.avail_out,\n e = this.strm.avail_in;\n this.write_in_progress = !1, this.callback(e, t), this.pending_close && this.close();\n }\n }, f.prototype._error = function (t) {\n this.strm.msg && (t = this.strm.msg), this.onerror(t, this.err), this.write_in_progress = !1, this.pending_close && this.close();\n }, f.prototype.init = function (t, e, i, a, o) {\n n(4 === arguments.length || 5 === arguments.length, \"init(windowBits, level, memLevel, strategy, [dictionary])\"), n(t >= 8 && t <= 15, \"invalid windowBits\"), n(e >= -1 && e <= 9, \"invalid compression level\"), n(i >= 1 && i <= 9, \"invalid memlevel\"), n(a === r.Z_FILTERED || a === r.Z_HUFFMAN_ONLY || a === r.Z_RLE || a === r.Z_FIXED || a === r.Z_DEFAULT_STRATEGY, \"invalid strategy\"), this._init(e, t, i, a, o), this._setDictionary();\n }, f.prototype.params = function () {\n throw new Error(\"deflateParams Not supported\");\n }, f.prototype.reset = function () {\n this._reset(), this._setDictionary();\n }, f.prototype._init = function (t, e, i, n, h) {\n switch (this.level = t, this.windowBits = e, this.memLevel = i, this.strategy = n, this.flush = r.Z_NO_FLUSH, this.err = r.Z_OK, this.mode !== r.GZIP && this.mode !== r.GUNZIP || (this.windowBits += 16), this.mode === r.UNZIP && (this.windowBits += 32), this.mode !== r.DEFLATERAW && this.mode !== r.INFLATERAW || (this.windowBits = -1 * this.windowBits), this.strm = new a(), this.mode) {\n case r.DEFLATE:\n case r.GZIP:\n case r.DEFLATERAW:\n this.err = o.deflateInit2(this.strm, this.level, r.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case r.INFLATE:\n case r.GUNZIP:\n case r.INFLATERAW:\n case r.UNZIP:\n this.err = s.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error(\"Unknown mode \" + this.mode);\n }\n this.err !== r.Z_OK && this._error(\"Init error\"), this.dictionary = h, this.write_in_progress = !1, this.init_done = !0;\n }, f.prototype._setDictionary = function () {\n if (null != this.dictionary) {\n switch (this.err = r.Z_OK, this.mode) {\n case r.DEFLATE:\n case r.DEFLATERAW:\n this.err = o.deflateSetDictionary(this.strm, this.dictionary);\n }\n this.err !== r.Z_OK && this._error(\"Failed to set dictionary\");\n }\n }, f.prototype._reset = function () {\n switch (this.err = r.Z_OK, this.mode) {\n case r.DEFLATE:\n case r.DEFLATERAW:\n case r.GZIP:\n this.err = o.deflateReset(this.strm);\n break;\n case r.INFLATE:\n case r.INFLATERAW:\n case r.GUNZIP:\n this.err = s.inflateReset(this.strm);\n }\n this.err !== r.Z_OK && this._error(\"Failed to reset stream\");\n }, r.Zlib = f;\n }).call(this);\n }).call(this, t(\"_process\"), t(\"buffer\").Buffer);\n }, {\n _process: 60,\n assert: 23,\n buffer: 33,\n \"pako/lib/zlib/constants\": 51,\n \"pako/lib/zlib/deflate.js\": 53,\n \"pako/lib/zlib/inflate.js\": 55,\n \"pako/lib/zlib/zstream\": 59\n }],\n 32: [function (t, e, r) {\n (function (e) {\n (function () {\n \"use strict\";\n\n var i = t(\"buffer\").Buffer,\n n = t(\"stream\").Transform,\n a = t(\"./binding\"),\n o = t(\"util\"),\n s = t(\"assert\").ok,\n h = t(\"buffer\").kMaxLength,\n l = \"Cannot create final Buffer. It would be larger than 0x\" + h.toString(16) + \" bytes\";\n a.Z_MIN_WINDOWBITS = 8, a.Z_MAX_WINDOWBITS = 15, a.Z_DEFAULT_WINDOWBITS = 15, a.Z_MIN_CHUNK = 64, a.Z_MAX_CHUNK = 1 / 0, a.Z_DEFAULT_CHUNK = 16384, a.Z_MIN_MEMLEVEL = 1, a.Z_MAX_MEMLEVEL = 9, a.Z_DEFAULT_MEMLEVEL = 8, a.Z_MIN_LEVEL = -1, a.Z_MAX_LEVEL = 9, a.Z_DEFAULT_LEVEL = a.Z_DEFAULT_COMPRESSION;\n for (var f = Object.keys(a), u = 0; u < f.length; u++) {\n var c = f[u];\n c.match(/^Z/) && Object.defineProperty(r, c, {\n enumerable: !0,\n value: a[c],\n writable: !1\n });\n }\n for (var d = {\n Z_OK: a.Z_OK,\n Z_STREAM_END: a.Z_STREAM_END,\n Z_NEED_DICT: a.Z_NEED_DICT,\n Z_ERRNO: a.Z_ERRNO,\n Z_STREAM_ERROR: a.Z_STREAM_ERROR,\n Z_DATA_ERROR: a.Z_DATA_ERROR,\n Z_MEM_ERROR: a.Z_MEM_ERROR,\n Z_BUF_ERROR: a.Z_BUF_ERROR,\n Z_VERSION_ERROR: a.Z_VERSION_ERROR\n }, p = Object.keys(d), m = 0; m < p.length; m++) {\n var g = p[m];\n d[d[g]] = g;\n }\n function b(t, e, r) {\n var n = [],\n a = 0;\n function o() {\n for (var e; null !== (e = t.read());) n.push(e), a += e.length;\n t.once(\"readable\", o);\n }\n function s() {\n var e,\n o = null;\n a >= h ? o = new RangeError(l) : e = i.concat(n, a), n = [], t.close(), r(o, e);\n }\n t.on(\"error\", function (e) {\n t.removeListener(\"end\", s), t.removeListener(\"readable\", o), r(e);\n }), t.on(\"end\", s), t.end(e), o();\n }\n function _(t, e) {\n if (\"string\" == typeof e && (e = i.from(e)), !i.isBuffer(e)) throw new TypeError(\"Not a string or buffer\");\n var r = t._finishFlushFlag;\n return t._processChunk(e, r);\n }\n function y(t) {\n if (!(this instanceof y)) return new y(t);\n A.call(this, t, a.DEFLATE);\n }\n function w(t) {\n if (!(this instanceof w)) return new w(t);\n A.call(this, t, a.INFLATE);\n }\n function v(t) {\n if (!(this instanceof v)) return new v(t);\n A.call(this, t, a.GZIP);\n }\n function x(t) {\n if (!(this instanceof x)) return new x(t);\n A.call(this, t, a.GUNZIP);\n }\n function E(t) {\n if (!(this instanceof E)) return new E(t);\n A.call(this, t, a.DEFLATERAW);\n }\n function k(t) {\n if (!(this instanceof k)) return new k(t);\n A.call(this, t, a.INFLATERAW);\n }\n function S(t) {\n if (!(this instanceof S)) return new S(t);\n A.call(this, t, a.UNZIP);\n }\n function M(t) {\n return t === a.Z_NO_FLUSH || t === a.Z_PARTIAL_FLUSH || t === a.Z_SYNC_FLUSH || t === a.Z_FULL_FLUSH || t === a.Z_FINISH || t === a.Z_BLOCK;\n }\n function A(t, e) {\n var o = this;\n if (this._opts = t = t || {}, this._chunkSize = t.chunkSize || r.Z_DEFAULT_CHUNK, n.call(this, t), t.flush && !M(t.flush)) throw new Error(\"Invalid flush flag: \" + t.flush);\n if (t.finishFlush && !M(t.finishFlush)) throw new Error(\"Invalid flush flag: \" + t.finishFlush);\n if (this._flushFlag = t.flush || a.Z_NO_FLUSH, this._finishFlushFlag = void 0 !== t.finishFlush ? t.finishFlush : a.Z_FINISH, t.chunkSize && (t.chunkSize < r.Z_MIN_CHUNK || t.chunkSize > r.Z_MAX_CHUNK)) throw new Error(\"Invalid chunk size: \" + t.chunkSize);\n if (t.windowBits && (t.windowBits < r.Z_MIN_WINDOWBITS || t.windowBits > r.Z_MAX_WINDOWBITS)) throw new Error(\"Invalid windowBits: \" + t.windowBits);\n if (t.level && (t.level < r.Z_MIN_LEVEL || t.level > r.Z_MAX_LEVEL)) throw new Error(\"Invalid compression level: \" + t.level);\n if (t.memLevel && (t.memLevel < r.Z_MIN_MEMLEVEL || t.memLevel > r.Z_MAX_MEMLEVEL)) throw new Error(\"Invalid memLevel: \" + t.memLevel);\n if (t.strategy && t.strategy != r.Z_FILTERED && t.strategy != r.Z_HUFFMAN_ONLY && t.strategy != r.Z_RLE && t.strategy != r.Z_FIXED && t.strategy != r.Z_DEFAULT_STRATEGY) throw new Error(\"Invalid strategy: \" + t.strategy);\n if (t.dictionary && !i.isBuffer(t.dictionary)) throw new Error(\"Invalid dictionary: it should be a Buffer instance\");\n this._handle = new a.Zlib(e);\n var s = this;\n this._hadError = !1, this._handle.onerror = function (t, e) {\n I(s), s._hadError = !0;\n var i = new Error(t);\n i.errno = e, i.code = r.codes[e], s.emit(\"error\", i);\n };\n var h = r.Z_DEFAULT_COMPRESSION;\n \"number\" == typeof t.level && (h = t.level);\n var l = r.Z_DEFAULT_STRATEGY;\n \"number\" == typeof t.strategy && (l = t.strategy), this._handle.init(t.windowBits || r.Z_DEFAULT_WINDOWBITS, h, t.memLevel || r.Z_DEFAULT_MEMLEVEL, l, t.dictionary), this._buffer = i.allocUnsafe(this._chunkSize), this._offset = 0, this._level = h, this._strategy = l, this.once(\"end\", this.close), Object.defineProperty(this, \"_closed\", {\n get: function () {\n return !o._handle;\n },\n configurable: !0,\n enumerable: !0\n });\n }\n function I(t, r) {\n r && e.nextTick(r), t._handle && (t._handle.close(), t._handle = null);\n }\n function B(t) {\n t.emit(\"close\");\n }\n Object.defineProperty(r, \"codes\", {\n enumerable: !0,\n value: Object.freeze(d),\n writable: !1\n }), r.Deflate = y, r.Inflate = w, r.Gzip = v, r.Gunzip = x, r.DeflateRaw = E, r.InflateRaw = k, r.Unzip = S, r.createDeflate = function (t) {\n return new y(t);\n }, r.createInflate = function (t) {\n return new w(t);\n }, r.createDeflateRaw = function (t) {\n return new E(t);\n }, r.createInflateRaw = function (t) {\n return new k(t);\n }, r.createGzip = function (t) {\n return new v(t);\n }, r.createGunzip = function (t) {\n return new x(t);\n }, r.createUnzip = function (t) {\n return new S(t);\n }, r.deflate = function (t, e, r) {\n return \"function\" == typeof e && (r = e, e = {}), b(new y(e), t, r);\n }, r.deflateSync = function (t, e) {\n return _(new y(e), t);\n }, r.gzip = function (t, e, r) {\n return \"function\" == typeof e && (r = e, e = {}), b(new v(e), t, r);\n }, r.gzipSync = function (t, e) {\n return _(new v(e), t);\n }, r.deflateRaw = function (t, e, r) {\n return \"function\" == typeof e && (r = e, e = {}), b(new E(e), t, r);\n }, r.deflateRawSync = function (t, e) {\n return _(new E(e), t);\n }, r.unzip = function (t, e, r) {\n return \"function\" == typeof e && (r = e, e = {}), b(new S(e), t, r);\n }, r.unzipSync = function (t, e) {\n return _(new S(e), t);\n }, r.inflate = function (t, e, r) {\n return \"function\" == typeof e && (r = e, e = {}), b(new w(e), t, r);\n }, r.inflateSync = function (t, e) {\n return _(new w(e), t);\n }, r.gunzip = function (t, e, r) {\n return \"function\" == typeof e && (r = e, e = {}), b(new x(e), t, r);\n }, r.gunzipSync = function (t, e) {\n return _(new x(e), t);\n }, r.inflateRaw = function (t, e, r) {\n return \"function\" == typeof e && (r = e, e = {}), b(new k(e), t, r);\n }, r.inflateRawSync = function (t, e) {\n return _(new k(e), t);\n }, o.inherits(A, n), A.prototype.params = function (t, i, n) {\n if (t < r.Z_MIN_LEVEL || t > r.Z_MAX_LEVEL) throw new RangeError(\"Invalid compression level: \" + t);\n if (i != r.Z_FILTERED && i != r.Z_HUFFMAN_ONLY && i != r.Z_RLE && i != r.Z_FIXED && i != r.Z_DEFAULT_STRATEGY) throw new TypeError(\"Invalid strategy: \" + i);\n if (this._level !== t || this._strategy !== i) {\n var o = this;\n this.flush(a.Z_SYNC_FLUSH, function () {\n s(o._handle, \"zlib binding closed\"), o._handle.params(t, i), o._hadError || (o._level = t, o._strategy = i, n && n());\n });\n } else e.nextTick(n);\n }, A.prototype.reset = function () {\n return s(this._handle, \"zlib binding closed\"), this._handle.reset();\n }, A.prototype._flush = function (t) {\n this._transform(i.alloc(0), \"\", t);\n }, A.prototype.flush = function (t, r) {\n var n = this,\n o = this._writableState;\n (\"function\" == typeof t || void 0 === t && !r) && (r = t, t = a.Z_FULL_FLUSH), o.ended ? r && e.nextTick(r) : o.ending ? r && this.once(\"end\", r) : o.needDrain ? r && this.once(\"drain\", function () {\n return n.flush(t, r);\n }) : (this._flushFlag = t, this.write(i.alloc(0), \"\", r));\n }, A.prototype.close = function (t) {\n I(this, t), e.nextTick(B, this);\n }, A.prototype._transform = function (t, e, r) {\n var n,\n o = this._writableState,\n s = (o.ending || o.ended) && (!t || o.length === t.length);\n return null === t || i.isBuffer(t) ? this._handle ? (s ? n = this._finishFlushFlag : (n = this._flushFlag, t.length >= o.length && (this._flushFlag = this._opts.flush || a.Z_NO_FLUSH)), void this._processChunk(t, n, r)) : r(new Error(\"zlib binding closed\")) : r(new Error(\"invalid input\"));\n }, A.prototype._processChunk = function (t, e, r) {\n var n = t && t.length,\n a = this._chunkSize - this._offset,\n o = 0,\n f = this,\n u = \"function\" == typeof r;\n if (!u) {\n var c,\n d = [],\n p = 0;\n this.on(\"error\", function (t) {\n c = t;\n }), s(this._handle, \"zlib binding closed\");\n do {\n var m = this._handle.writeSync(e, t, o, n, this._buffer, this._offset, a);\n } while (!this._hadError && _(m[0], m[1]));\n if (this._hadError) throw c;\n if (p >= h) throw I(this), new RangeError(l);\n var g = i.concat(d, p);\n return I(this), g;\n }\n s(this._handle, \"zlib binding closed\");\n var b = this._handle.write(e, t, o, n, this._buffer, this._offset, a);\n function _(h, l) {\n if (this && (this.buffer = null, this.callback = null), !f._hadError) {\n var c = a - l;\n if (s(c >= 0, \"have should not go down\"), c > 0) {\n var m = f._buffer.slice(f._offset, f._offset + c);\n f._offset += c, u ? f.push(m) : (d.push(m), p += m.length);\n }\n if ((0 === l || f._offset >= f._chunkSize) && (a = f._chunkSize, f._offset = 0, f._buffer = i.allocUnsafe(f._chunkSize)), 0 === l) {\n if (o += n - h, n = h, !u) return !0;\n var g = f._handle.write(e, t, o, n, f._buffer, f._offset, f._chunkSize);\n return g.callback = _, void (g.buffer = t);\n }\n if (!u) return !1;\n r();\n }\n }\n b.buffer = t, b.callback = _;\n }, o.inherits(y, A), o.inherits(w, A), o.inherits(v, A), o.inherits(x, A), o.inherits(E, A), o.inherits(k, A), o.inherits(S, A);\n }).call(this);\n }).call(this, t(\"_process\"));\n }, {\n \"./binding\": 31,\n _process: 60,\n assert: 23,\n buffer: 33,\n stream: 61,\n util: 81\n }],\n 33: [function (t, e, r) {\n (function (e) {\n (function () {\n \"use strict\";\n\n var e = t(\"base64-js\"),\n i = t(\"ieee754\");\n r.Buffer = o, r.SlowBuffer = function (t) {\n return +t != t && (t = 0), o.alloc(+t);\n }, r.INSPECT_MAX_BYTES = 50;\n var n = 2147483647;\n function a(t) {\n if (t > n) throw new RangeError('The value \"' + t + '\" is invalid for option \"size\"');\n var e = new Uint8Array(t);\n return e.__proto__ = o.prototype, e;\n }\n function o(t, e, r) {\n if (\"number\" == typeof t) {\n if (\"string\" == typeof e) throw new TypeError('The \"string\" argument must be of type string. Received type number');\n return l(t);\n }\n return s(t, e, r);\n }\n function s(t, e, r) {\n if (\"string\" == typeof t) return function (t, e) {\n if (\"string\" == typeof e && \"\" !== e || (e = \"utf8\"), !o.isEncoding(e)) throw new TypeError(\"Unknown encoding: \" + e);\n var r = 0 | c(t, e),\n i = a(r),\n n = i.write(t, e);\n return n !== r && (i = i.slice(0, n)), i;\n }(t, e);\n if (ArrayBuffer.isView(t)) return f(t);\n if (null == t) throw TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof t);\n if (N(t, ArrayBuffer) || t && N(t.buffer, ArrayBuffer)) return function (t, e, r) {\n if (e < 0 || t.byteLength < e) throw new RangeError('\"offset\" is outside of buffer bounds');\n if (t.byteLength < e + (r || 0)) throw new RangeError('\"length\" is outside of buffer bounds');\n var i;\n return (i = void 0 === e && void 0 === r ? new Uint8Array(t) : void 0 === r ? new Uint8Array(t, e) : new Uint8Array(t, e, r)).__proto__ = o.prototype, i;\n }(t, e, r);\n if (\"number\" == typeof t) throw new TypeError('The \"value\" argument must not be of type number. Received type number');\n var i = t.valueOf && t.valueOf();\n if (null != i && i !== t) return o.from(i, e, r);\n var n = function (t) {\n if (o.isBuffer(t)) {\n var e = 0 | u(t.length),\n r = a(e);\n return 0 === r.length || t.copy(r, 0, 0, e), r;\n }\n return void 0 !== t.length ? \"number\" != typeof t.length || F(t.length) ? a(0) : f(t) : \"Buffer\" === t.type && Array.isArray(t.data) ? f(t.data) : void 0;\n }(t);\n if (n) return n;\n if (\"undefined\" != typeof Symbol && null != Symbol.toPrimitive && \"function\" == typeof t[Symbol.toPrimitive]) return o.from(t[Symbol.toPrimitive](\"string\"), e, r);\n throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \" + typeof t);\n }\n function h(t) {\n if (\"number\" != typeof t) throw new TypeError('\"size\" argument must be of type number');\n if (t < 0) throw new RangeError('The value \"' + t + '\" is invalid for option \"size\"');\n }\n function l(t) {\n return h(t), a(t < 0 ? 0 : 0 | u(t));\n }\n function f(t) {\n for (var e = t.length < 0 ? 0 : 0 | u(t.length), r = a(e), i = 0; i < e; i += 1) r[i] = 255 & t[i];\n return r;\n }\n function u(t) {\n if (t >= n) throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\" + n.toString(16) + \" bytes\");\n return 0 | t;\n }\n function c(t, e) {\n if (o.isBuffer(t)) return t.length;\n if (ArrayBuffer.isView(t) || N(t, ArrayBuffer)) return t.byteLength;\n if (\"string\" != typeof t) throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof t);\n var r = t.length,\n i = arguments.length > 2 && !0 === arguments[2];\n if (!i && 0 === r) return 0;\n for (var n = !1;;) switch (e) {\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return r;\n case \"utf8\":\n case \"utf-8\":\n return U(t).length;\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return 2 * r;\n case \"hex\":\n return r >>> 1;\n case \"base64\":\n return z(t).length;\n default:\n if (n) return i ? -1 : U(t).length;\n e = (\"\" + e).toLowerCase(), n = !0;\n }\n }\n function d(t, e, r) {\n var i = !1;\n if ((void 0 === e || e < 0) && (e = 0), e > this.length) return \"\";\n if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) return \"\";\n if ((r >>>= 0) <= (e >>>= 0)) return \"\";\n for (t || (t = \"utf8\");;) switch (t) {\n case \"hex\":\n return I(this, e, r);\n case \"utf8\":\n case \"utf-8\":\n return k(this, e, r);\n case \"ascii\":\n return M(this, e, r);\n case \"latin1\":\n case \"binary\":\n return A(this, e, r);\n case \"base64\":\n return E(this, e, r);\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return B(this, e, r);\n default:\n if (i) throw new TypeError(\"Unknown encoding: \" + t);\n t = (t + \"\").toLowerCase(), i = !0;\n }\n }\n function p(t, e, r) {\n var i = t[e];\n t[e] = t[r], t[r] = i;\n }\n function m(t, e, r, i, n) {\n if (0 === t.length) return -1;\n if (\"string\" == typeof r ? (i = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), F(r = +r) && (r = n ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {\n if (n) return -1;\n r = t.length - 1;\n } else if (r < 0) {\n if (!n) return -1;\n r = 0;\n }\n if (\"string\" == typeof e && (e = o.from(e, i)), o.isBuffer(e)) return 0 === e.length ? -1 : g(t, e, r, i, n);\n if (\"number\" == typeof e) return e &= 255, \"function\" == typeof Uint8Array.prototype.indexOf ? n ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : g(t, [e], r, i, n);\n throw new TypeError(\"val must be string, number or Buffer\");\n }\n function g(t, e, r, i, n) {\n var a,\n o = 1,\n s = t.length,\n h = e.length;\n if (void 0 !== i && (\"ucs2\" === (i = String(i).toLowerCase()) || \"ucs-2\" === i || \"utf16le\" === i || \"utf-16le\" === i)) {\n if (t.length < 2 || e.length < 2) return -1;\n o = 2, s /= 2, h /= 2, r /= 2;\n }\n function l(t, e) {\n return 1 === o ? t[e] : t.readUInt16BE(e * o);\n }\n if (n) {\n var f = -1;\n for (a = r; a < s; a++) if (l(t, a) === l(e, -1 === f ? 0 : a - f)) {\n if (-1 === f && (f = a), a - f + 1 === h) return f * o;\n } else -1 !== f && (a -= a - f), f = -1;\n } else for (r + h > s && (r = s - h), a = r; a >= 0; a--) {\n for (var u = !0, c = 0; c < h; c++) if (l(t, a + c) !== l(e, c)) {\n u = !1;\n break;\n }\n if (u) return a;\n }\n return -1;\n }\n function b(t, e, r, i) {\n r = Number(r) || 0;\n var n = t.length - r;\n i ? (i = Number(i)) > n && (i = n) : i = n;\n var a = e.length;\n i > a / 2 && (i = a / 2);\n for (var o = 0; o < i; ++o) {\n var s = parseInt(e.substr(2 * o, 2), 16);\n if (F(s)) return o;\n t[r + o] = s;\n }\n return o;\n }\n function _(t, e, r, i) {\n return D(U(e, t.length - r), t, r, i);\n }\n function y(t, e, r, i) {\n return D(function (t) {\n for (var e = [], r = 0; r < t.length; ++r) e.push(255 & t.charCodeAt(r));\n return e;\n }(e), t, r, i);\n }\n function w(t, e, r, i) {\n return y(t, e, r, i);\n }\n function v(t, e, r, i) {\n return D(z(e), t, r, i);\n }\n function x(t, e, r, i) {\n return D(function (t, e) {\n for (var r, i, n, a = [], o = 0; o < t.length && !((e -= 2) < 0); ++o) i = (r = t.charCodeAt(o)) >> 8, n = r % 256, a.push(n), a.push(i);\n return a;\n }(e, t.length - r), t, r, i);\n }\n function E(t, r, i) {\n return 0 === r && i === t.length ? e.fromByteArray(t) : e.fromByteArray(t.slice(r, i));\n }\n function k(t, e, r) {\n r = Math.min(t.length, r);\n for (var i = [], n = e; n < r;) {\n var a,\n o,\n s,\n h,\n l = t[n],\n f = null,\n u = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;\n if (n + u <= r) switch (u) {\n case 1:\n l < 128 && (f = l);\n break;\n case 2:\n 128 == (192 & (a = t[n + 1])) && (h = (31 & l) << 6 | 63 & a) > 127 && (f = h);\n break;\n case 3:\n a = t[n + 1], o = t[n + 2], 128 == (192 & a) && 128 == (192 & o) && (h = (15 & l) << 12 | (63 & a) << 6 | 63 & o) > 2047 && (h < 55296 || h > 57343) && (f = h);\n break;\n case 4:\n a = t[n + 1], o = t[n + 2], s = t[n + 3], 128 == (192 & a) && 128 == (192 & o) && 128 == (192 & s) && (h = (15 & l) << 18 | (63 & a) << 12 | (63 & o) << 6 | 63 & s) > 65535 && h < 1114112 && (f = h);\n }\n null === f ? (f = 65533, u = 1) : f > 65535 && (f -= 65536, i.push(f >>> 10 & 1023 | 55296), f = 56320 | 1023 & f), i.push(f), n += u;\n }\n return function (t) {\n var e = t.length;\n if (e <= S) return String.fromCharCode.apply(String, t);\n for (var r = \"\", i = 0; i < e;) r += String.fromCharCode.apply(String, t.slice(i, i += S));\n return r;\n }(i);\n }\n r.kMaxLength = n, o.TYPED_ARRAY_SUPPORT = function () {\n try {\n var t = new Uint8Array(1);\n return t.__proto__ = {\n __proto__: Uint8Array.prototype,\n foo: function () {\n return 42;\n }\n }, 42 === t.foo();\n } catch (t) {\n return !1;\n }\n }(), o.TYPED_ARRAY_SUPPORT || \"undefined\" == typeof console || \"function\" != typeof console.error || console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"), Object.defineProperty(o.prototype, \"parent\", {\n enumerable: !0,\n get: function () {\n if (o.isBuffer(this)) return this.buffer;\n }\n }), Object.defineProperty(o.prototype, \"offset\", {\n enumerable: !0,\n get: function () {\n if (o.isBuffer(this)) return this.byteOffset;\n }\n }), \"undefined\" != typeof Symbol && null != Symbol.species && o[Symbol.species] === o && Object.defineProperty(o, Symbol.species, {\n value: null,\n configurable: !0,\n enumerable: !1,\n writable: !1\n }), o.poolSize = 8192, o.from = function (t, e, r) {\n return s(t, e, r);\n }, o.prototype.__proto__ = Uint8Array.prototype, o.__proto__ = Uint8Array, o.alloc = function (t, e, r) {\n return function (t, e, r) {\n return h(t), t <= 0 ? a(t) : void 0 !== e ? \"string\" == typeof r ? a(t).fill(e, r) : a(t).fill(e) : a(t);\n }(t, e, r);\n }, o.allocUnsafe = function (t) {\n return l(t);\n }, o.allocUnsafeSlow = function (t) {\n return l(t);\n }, o.isBuffer = function (t) {\n return null != t && !0 === t._isBuffer && t !== o.prototype;\n }, o.compare = function (t, e) {\n if (N(t, Uint8Array) && (t = o.from(t, t.offset, t.byteLength)), N(e, Uint8Array) && (e = o.from(e, e.offset, e.byteLength)), !o.isBuffer(t) || !o.isBuffer(e)) throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');\n if (t === e) return 0;\n for (var r = t.length, i = e.length, n = 0, a = Math.min(r, i); n < a; ++n) if (t[n] !== e[n]) {\n r = t[n], i = e[n];\n break;\n }\n return r < i ? -1 : i < r ? 1 : 0;\n }, o.isEncoding = function (t) {\n switch (String(t).toLowerCase()) {\n case \"hex\":\n case \"utf8\":\n case \"utf-8\":\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n case \"base64\":\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return !0;\n default:\n return !1;\n }\n }, o.concat = function (t, e) {\n if (!Array.isArray(t)) throw new TypeError('\"list\" argument must be an Array of Buffers');\n if (0 === t.length) return o.alloc(0);\n var r;\n if (void 0 === e) for (e = 0, r = 0; r < t.length; ++r) e += t[r].length;\n var i = o.allocUnsafe(e),\n n = 0;\n for (r = 0; r < t.length; ++r) {\n var a = t[r];\n if (N(a, Uint8Array) && (a = o.from(a)), !o.isBuffer(a)) throw new TypeError('\"list\" argument must be an Array of Buffers');\n a.copy(i, n), n += a.length;\n }\n return i;\n }, o.byteLength = c, o.prototype._isBuffer = !0, o.prototype.swap16 = function () {\n var t = this.length;\n if (t % 2 != 0) throw new RangeError(\"Buffer size must be a multiple of 16-bits\");\n for (var e = 0; e < t; e += 2) p(this, e, e + 1);\n return this;\n }, o.prototype.swap32 = function () {\n var t = this.length;\n if (t % 4 != 0) throw new RangeError(\"Buffer size must be a multiple of 32-bits\");\n for (var e = 0; e < t; e += 4) p(this, e, e + 3), p(this, e + 1, e + 2);\n return this;\n }, o.prototype.swap64 = function () {\n var t = this.length;\n if (t % 8 != 0) throw new RangeError(\"Buffer size must be a multiple of 64-bits\");\n for (var e = 0; e < t; e += 8) p(this, e, e + 7), p(this, e + 1, e + 6), p(this, e + 2, e + 5), p(this, e + 3, e + 4);\n return this;\n }, o.prototype.toString = function () {\n var t = this.length;\n return 0 === t ? \"\" : 0 === arguments.length ? k(this, 0, t) : d.apply(this, arguments);\n }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function (t) {\n if (!o.isBuffer(t)) throw new TypeError(\"Argument must be a Buffer\");\n return this === t || 0 === o.compare(this, t);\n }, o.prototype.inspect = function () {\n var t = \"\",\n e = r.INSPECT_MAX_BYTES;\n return t = this.toString(\"hex\", 0, e).replace(/(.{2})/g, \"$1 \").trim(), this.length > e && (t += \" ... \"), \"\";\n }, o.prototype.compare = function (t, e, r, i, n) {\n if (N(t, Uint8Array) && (t = o.from(t, t.offset, t.byteLength)), !o.isBuffer(t)) throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t);\n if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0), void 0 === i && (i = 0), void 0 === n && (n = this.length), e < 0 || r > t.length || i < 0 || n > this.length) throw new RangeError(\"out of range index\");\n if (i >= n && e >= r) return 0;\n if (i >= n) return -1;\n if (e >= r) return 1;\n if (this === t) return 0;\n for (var a = (n >>>= 0) - (i >>>= 0), s = (r >>>= 0) - (e >>>= 0), h = Math.min(a, s), l = this.slice(i, n), f = t.slice(e, r), u = 0; u < h; ++u) if (l[u] !== f[u]) {\n a = l[u], s = f[u];\n break;\n }\n return a < s ? -1 : s < a ? 1 : 0;\n }, o.prototype.includes = function (t, e, r) {\n return -1 !== this.indexOf(t, e, r);\n }, o.prototype.indexOf = function (t, e, r) {\n return m(this, t, e, r, !0);\n }, o.prototype.lastIndexOf = function (t, e, r) {\n return m(this, t, e, r, !1);\n }, o.prototype.write = function (t, e, r, i) {\n if (void 0 === e) i = \"utf8\", r = this.length, e = 0;else if (void 0 === r && \"string\" == typeof e) i = e, r = this.length, e = 0;else {\n if (!isFinite(e)) throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");\n e >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === i && (i = \"utf8\")) : (i = r, r = void 0);\n }\n var n = this.length - e;\n if ((void 0 === r || r > n) && (r = n), t.length > 0 && (r < 0 || e < 0) || e > this.length) throw new RangeError(\"Attempt to write outside buffer bounds\");\n i || (i = \"utf8\");\n for (var a = !1;;) switch (i) {\n case \"hex\":\n return b(this, t, e, r);\n case \"utf8\":\n case \"utf-8\":\n return _(this, t, e, r);\n case \"ascii\":\n return y(this, t, e, r);\n case \"latin1\":\n case \"binary\":\n return w(this, t, e, r);\n case \"base64\":\n return v(this, t, e, r);\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return x(this, t, e, r);\n default:\n if (a) throw new TypeError(\"Unknown encoding: \" + i);\n i = (\"\" + i).toLowerCase(), a = !0;\n }\n }, o.prototype.toJSON = function () {\n return {\n type: \"Buffer\",\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n var S = 4096;\n function M(t, e, r) {\n var i = \"\";\n r = Math.min(t.length, r);\n for (var n = e; n < r; ++n) i += String.fromCharCode(127 & t[n]);\n return i;\n }\n function A(t, e, r) {\n var i = \"\";\n r = Math.min(t.length, r);\n for (var n = e; n < r; ++n) i += String.fromCharCode(t[n]);\n return i;\n }\n function I(t, e, r) {\n var i,\n n = t.length;\n (!e || e < 0) && (e = 0), (!r || r < 0 || r > n) && (r = n);\n for (var a = \"\", o = e; o < r; ++o) a += (i = t[o]) < 16 ? \"0\" + i.toString(16) : i.toString(16);\n return a;\n }\n function B(t, e, r) {\n for (var i = t.slice(e, r), n = \"\", a = 0; a < i.length; a += 2) n += String.fromCharCode(i[a] + 256 * i[a + 1]);\n return n;\n }\n function T(t, e, r) {\n if (t % 1 != 0 || t < 0) throw new RangeError(\"offset is not uint\");\n if (t + e > r) throw new RangeError(\"Trying to access beyond buffer length\");\n }\n function R(t, e, r, i, n, a) {\n if (!o.isBuffer(t)) throw new TypeError('\"buffer\" argument must be a Buffer instance');\n if (e > n || e < a) throw new RangeError('\"value\" argument is out of bounds');\n if (r + i > t.length) throw new RangeError(\"Index out of range\");\n }\n function P(t, e, r, i, n, a) {\n if (r + i > t.length) throw new RangeError(\"Index out of range\");\n if (r < 0) throw new RangeError(\"Index out of range\");\n }\n function O(t, e, r, n, a) {\n return e = +e, r >>>= 0, a || P(t, 0, r, 4), i.write(t, e, r, n, 23, 4), r + 4;\n }\n function L(t, e, r, n, a) {\n return e = +e, r >>>= 0, a || P(t, 0, r, 8), i.write(t, e, r, n, 52, 8), r + 8;\n }\n o.prototype.slice = function (t, e) {\n var r = this.length;\n (t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r), e < t && (e = t);\n var i = this.subarray(t, e);\n return i.__proto__ = o.prototype, i;\n }, o.prototype.readUIntLE = function (t, e, r) {\n t >>>= 0, e >>>= 0, r || T(t, e, this.length);\n for (var i = this[t], n = 1, a = 0; ++a < e && (n *= 256);) i += this[t + a] * n;\n return i;\n }, o.prototype.readUIntBE = function (t, e, r) {\n t >>>= 0, e >>>= 0, r || T(t, e, this.length);\n for (var i = this[t + --e], n = 1; e > 0 && (n *= 256);) i += this[t + --e] * n;\n return i;\n }, o.prototype.readUInt8 = function (t, e) {\n return t >>>= 0, e || T(t, 1, this.length), this[t];\n }, o.prototype.readUInt16LE = function (t, e) {\n return t >>>= 0, e || T(t, 2, this.length), this[t] | this[t + 1] << 8;\n }, o.prototype.readUInt16BE = function (t, e) {\n return t >>>= 0, e || T(t, 2, this.length), this[t] << 8 | this[t + 1];\n }, o.prototype.readUInt32LE = function (t, e) {\n return t >>>= 0, e || T(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3];\n }, o.prototype.readUInt32BE = function (t, e) {\n return t >>>= 0, e || T(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);\n }, o.prototype.readIntLE = function (t, e, r) {\n t >>>= 0, e >>>= 0, r || T(t, e, this.length);\n for (var i = this[t], n = 1, a = 0; ++a < e && (n *= 256);) i += this[t + a] * n;\n return i >= (n *= 128) && (i -= Math.pow(2, 8 * e)), i;\n }, o.prototype.readIntBE = function (t, e, r) {\n t >>>= 0, e >>>= 0, r || T(t, e, this.length);\n for (var i = e, n = 1, a = this[t + --i]; i > 0 && (n *= 256);) a += this[t + --i] * n;\n return a >= (n *= 128) && (a -= Math.pow(2, 8 * e)), a;\n }, o.prototype.readInt8 = function (t, e) {\n return t >>>= 0, e || T(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t];\n }, o.prototype.readInt16LE = function (t, e) {\n t >>>= 0, e || T(t, 2, this.length);\n var r = this[t] | this[t + 1] << 8;\n return 32768 & r ? 4294901760 | r : r;\n }, o.prototype.readInt16BE = function (t, e) {\n t >>>= 0, e || T(t, 2, this.length);\n var r = this[t + 1] | this[t] << 8;\n return 32768 & r ? 4294901760 | r : r;\n }, o.prototype.readInt32LE = function (t, e) {\n return t >>>= 0, e || T(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;\n }, o.prototype.readInt32BE = function (t, e) {\n return t >>>= 0, e || T(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];\n }, o.prototype.readFloatLE = function (t, e) {\n return t >>>= 0, e || T(t, 4, this.length), i.read(this, t, !0, 23, 4);\n }, o.prototype.readFloatBE = function (t, e) {\n return t >>>= 0, e || T(t, 4, this.length), i.read(this, t, !1, 23, 4);\n }, o.prototype.readDoubleLE = function (t, e) {\n return t >>>= 0, e || T(t, 8, this.length), i.read(this, t, !0, 52, 8);\n }, o.prototype.readDoubleBE = function (t, e) {\n return t >>>= 0, e || T(t, 8, this.length), i.read(this, t, !1, 52, 8);\n }, o.prototype.writeUIntLE = function (t, e, r, i) {\n t = +t, e >>>= 0, r >>>= 0, i || R(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);\n var n = 1,\n a = 0;\n for (this[e] = 255 & t; ++a < r && (n *= 256);) this[e + a] = t / n & 255;\n return e + r;\n }, o.prototype.writeUIntBE = function (t, e, r, i) {\n t = +t, e >>>= 0, r >>>= 0, i || R(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);\n var n = r - 1,\n a = 1;\n for (this[e + n] = 255 & t; --n >= 0 && (a *= 256);) this[e + n] = t / a & 255;\n return e + r;\n }, o.prototype.writeUInt8 = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 1, 255, 0), this[e] = 255 & t, e + 1;\n }, o.prototype.writeUInt16LE = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 2, 65535, 0), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;\n }, o.prototype.writeUInt16BE = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;\n }, o.prototype.writeUInt32LE = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t, e + 4;\n }, o.prototype.writeUInt32BE = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;\n }, o.prototype.writeIntLE = function (t, e, r, i) {\n if (t = +t, e >>>= 0, !i) {\n var n = Math.pow(2, 8 * r - 1);\n R(this, t, e, r, n - 1, -n);\n }\n var a = 0,\n o = 1,\n s = 0;\n for (this[e] = 255 & t; ++a < r && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + a - 1] && (s = 1), this[e + a] = (t / o >> 0) - s & 255;\n return e + r;\n }, o.prototype.writeIntBE = function (t, e, r, i) {\n if (t = +t, e >>>= 0, !i) {\n var n = Math.pow(2, 8 * r - 1);\n R(this, t, e, r, n - 1, -n);\n }\n var a = r - 1,\n o = 1,\n s = 0;\n for (this[e + a] = 255 & t; --a >= 0 && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + a + 1] && (s = 1), this[e + a] = (t / o >> 0) - s & 255;\n return e + r;\n }, o.prototype.writeInt8 = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1;\n }, o.prototype.writeInt16LE = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 2, 32767, -32768), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;\n }, o.prototype.writeInt16BE = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;\n }, o.prototype.writeInt32LE = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 4, 2147483647, -2147483648), this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;\n }, o.prototype.writeInt32BE = function (t, e, r) {\n return t = +t, e >>>= 0, r || R(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;\n }, o.prototype.writeFloatLE = function (t, e, r) {\n return O(this, t, e, !0, r);\n }, o.prototype.writeFloatBE = function (t, e, r) {\n return O(this, t, e, !1, r);\n }, o.prototype.writeDoubleLE = function (t, e, r) {\n return L(this, t, e, !0, r);\n }, o.prototype.writeDoubleBE = function (t, e, r) {\n return L(this, t, e, !1, r);\n }, o.prototype.copy = function (t, e, r, i) {\n if (!o.isBuffer(t)) throw new TypeError(\"argument should be a Buffer\");\n if (r || (r = 0), i || 0 === i || (i = this.length), e >= t.length && (e = t.length), e || (e = 0), i > 0 && i < r && (i = r), i === r) return 0;\n if (0 === t.length || 0 === this.length) return 0;\n if (e < 0) throw new RangeError(\"targetStart out of bounds\");\n if (r < 0 || r >= this.length) throw new RangeError(\"Index out of range\");\n if (i < 0) throw new RangeError(\"sourceEnd out of bounds\");\n i > this.length && (i = this.length), t.length - e < i - r && (i = t.length - e + r);\n var n = i - r;\n if (this === t && \"function\" == typeof Uint8Array.prototype.copyWithin) this.copyWithin(e, r, i);else if (this === t && r < e && e < i) for (var a = n - 1; a >= 0; --a) t[a + e] = this[a + r];else Uint8Array.prototype.set.call(t, this.subarray(r, i), e);\n return n;\n }, o.prototype.fill = function (t, e, r, i) {\n if (\"string\" == typeof t) {\n if (\"string\" == typeof e ? (i = e, e = 0, r = this.length) : \"string\" == typeof r && (i = r, r = this.length), void 0 !== i && \"string\" != typeof i) throw new TypeError(\"encoding must be a string\");\n if (\"string\" == typeof i && !o.isEncoding(i)) throw new TypeError(\"Unknown encoding: \" + i);\n if (1 === t.length) {\n var n = t.charCodeAt(0);\n (\"utf8\" === i && n < 128 || \"latin1\" === i) && (t = n);\n }\n } else \"number\" == typeof t && (t &= 255);\n if (e < 0 || this.length < e || this.length < r) throw new RangeError(\"Out of range index\");\n if (r <= e) return this;\n var a;\n if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0, t || (t = 0), \"number\" == typeof t) for (a = e; a < r; ++a) this[a] = t;else {\n var s = o.isBuffer(t) ? t : o.from(t, i),\n h = s.length;\n if (0 === h) throw new TypeError('The value \"' + t + '\" is invalid for argument \"value\"');\n for (a = 0; a < r - e; ++a) this[a + e] = s[a % h];\n }\n return this;\n };\n var C = /[^+/0-9A-Za-z-_]/g;\n function U(t, e) {\n var r;\n e = e || 1 / 0;\n for (var i = t.length, n = null, a = [], o = 0; o < i; ++o) {\n if ((r = t.charCodeAt(o)) > 55295 && r < 57344) {\n if (!n) {\n if (r > 56319) {\n (e -= 3) > -1 && a.push(239, 191, 189);\n continue;\n }\n if (o + 1 === i) {\n (e -= 3) > -1 && a.push(239, 191, 189);\n continue;\n }\n n = r;\n continue;\n }\n if (r < 56320) {\n (e -= 3) > -1 && a.push(239, 191, 189), n = r;\n continue;\n }\n r = 65536 + (n - 55296 << 10 | r - 56320);\n } else n && (e -= 3) > -1 && a.push(239, 191, 189);\n if (n = null, r < 128) {\n if ((e -= 1) < 0) break;\n a.push(r);\n } else if (r < 2048) {\n if ((e -= 2) < 0) break;\n a.push(r >> 6 | 192, 63 & r | 128);\n } else if (r < 65536) {\n if ((e -= 3) < 0) break;\n a.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128);\n } else {\n if (!(r < 1114112)) throw new Error(\"Invalid code point\");\n if ((e -= 4) < 0) break;\n a.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128);\n }\n }\n return a;\n }\n function z(t) {\n return e.toByteArray(function (t) {\n if ((t = (t = t.split(\"=\")[0]).trim().replace(C, \"\")).length < 2) return \"\";\n for (; t.length % 4 != 0;) t += \"=\";\n return t;\n }(t));\n }\n function D(t, e, r, i) {\n for (var n = 0; n < i && !(n + r >= e.length || n >= t.length); ++n) e[n + r] = t[n];\n return n;\n }\n function N(t, e) {\n return t instanceof e || null != t && null != t.constructor && null != t.constructor.name && t.constructor.name === e.name;\n }\n function F(t) {\n return t != t;\n }\n }).call(this);\n }).call(this, t(\"buffer\").Buffer);\n }, {\n \"base64-js\": 29,\n buffer: 33,\n ieee754: 44\n }],\n 34: [function (t, e, r) {\n \"use strict\";\n\n var i,\n n = TypeError,\n a = Object.getOwnPropertyDescriptor;\n if (a) try {\n a({}, \"\");\n } catch (t) {\n a = null;\n }\n var o = function () {\n throw new n();\n },\n s = a ? function () {\n try {\n return o;\n } catch (t) {\n try {\n return a(arguments, \"callee\").get;\n } catch (t) {\n return o;\n }\n }\n }() : o,\n h = t(\"has-symbols\")(),\n l = Object.getPrototypeOf || function (t) {\n return t.__proto__;\n },\n f = i,\n u = i,\n c = i,\n d = i,\n p = \"undefined\" == typeof Uint8Array ? i : l(Uint8Array),\n m = {\n \"%Array%\": Array,\n \"%ArrayBuffer%\": \"undefined\" == typeof ArrayBuffer ? i : ArrayBuffer,\n \"%ArrayBufferPrototype%\": \"undefined\" == typeof ArrayBuffer ? i : ArrayBuffer.prototype,\n \"%ArrayIteratorPrototype%\": h ? l([][Symbol.iterator]()) : i,\n \"%ArrayPrototype%\": Array.prototype,\n \"%ArrayProto_entries%\": Array.prototype.entries,\n \"%ArrayProto_forEach%\": Array.prototype.forEach,\n \"%ArrayProto_keys%\": Array.prototype.keys,\n \"%ArrayProto_values%\": Array.prototype.values,\n \"%AsyncFromSyncIteratorPrototype%\": i,\n \"%AsyncFunction%\": u,\n \"%AsyncFunctionPrototype%\": i,\n \"%AsyncGenerator%\": i,\n \"%AsyncGeneratorFunction%\": c,\n \"%AsyncGeneratorPrototype%\": i,\n \"%AsyncIteratorPrototype%\": d && h && Symbol.asyncIterator ? d[Symbol.asyncIterator]() : i,\n \"%Atomics%\": \"undefined\" == typeof Atomics ? i : Atomics,\n \"%Boolean%\": Boolean,\n \"%BooleanPrototype%\": Boolean.prototype,\n \"%DataView%\": \"undefined\" == typeof DataView ? i : DataView,\n \"%DataViewPrototype%\": \"undefined\" == typeof DataView ? i : DataView.prototype,\n \"%Date%\": Date,\n \"%DatePrototype%\": Date.prototype,\n \"%decodeURI%\": decodeURI,\n \"%decodeURIComponent%\": decodeURIComponent,\n \"%encodeURI%\": encodeURI,\n \"%encodeURIComponent%\": encodeURIComponent,\n \"%Error%\": Error,\n \"%ErrorPrototype%\": Error.prototype,\n \"%eval%\": eval,\n \"%EvalError%\": EvalError,\n \"%EvalErrorPrototype%\": EvalError.prototype,\n \"%Float32Array%\": \"undefined\" == typeof Float32Array ? i : Float32Array,\n \"%Float32ArrayPrototype%\": \"undefined\" == typeof Float32Array ? i : Float32Array.prototype,\n \"%Float64Array%\": \"undefined\" == typeof Float64Array ? i : Float64Array,\n \"%Float64ArrayPrototype%\": \"undefined\" == typeof Float64Array ? i : Float64Array.prototype,\n \"%Function%\": Function,\n \"%FunctionPrototype%\": Function.prototype,\n \"%Generator%\": i,\n \"%GeneratorFunction%\": f,\n \"%GeneratorPrototype%\": i,\n \"%Int8Array%\": \"undefined\" == typeof Int8Array ? i : Int8Array,\n \"%Int8ArrayPrototype%\": \"undefined\" == typeof Int8Array ? i : Int8Array.prototype,\n \"%Int16Array%\": \"undefined\" == typeof Int16Array ? i : Int16Array,\n \"%Int16ArrayPrototype%\": \"undefined\" == typeof Int16Array ? i : Int8Array.prototype,\n \"%Int32Array%\": \"undefined\" == typeof Int32Array ? i : Int32Array,\n \"%Int32ArrayPrototype%\": \"undefined\" == typeof Int32Array ? i : Int32Array.prototype,\n \"%isFinite%\": isFinite,\n \"%isNaN%\": isNaN,\n \"%IteratorPrototype%\": h ? l(l([][Symbol.iterator]())) : i,\n \"%JSON%\": \"object\" == typeof JSON ? JSON : i,\n \"%JSONParse%\": \"object\" == typeof JSON ? JSON.parse : i,\n \"%Map%\": \"undefined\" == typeof Map ? i : Map,\n \"%MapIteratorPrototype%\": \"undefined\" != typeof Map && h ? l(new Map()[Symbol.iterator]()) : i,\n \"%MapPrototype%\": \"undefined\" == typeof Map ? i : Map.prototype,\n \"%Math%\": Math,\n \"%Number%\": Number,\n \"%NumberPrototype%\": Number.prototype,\n \"%Object%\": Object,\n \"%ObjectPrototype%\": Object.prototype,\n \"%ObjProto_toString%\": Object.prototype.toString,\n \"%ObjProto_valueOf%\": Object.prototype.valueOf,\n \"%parseFloat%\": parseFloat,\n \"%parseInt%\": parseInt,\n \"%Promise%\": \"undefined\" == typeof Promise ? i : Promise,\n \"%PromisePrototype%\": \"undefined\" == typeof Promise ? i : Promise.prototype,\n \"%PromiseProto_then%\": \"undefined\" == typeof Promise ? i : Promise.prototype.then,\n \"%Promise_all%\": \"undefined\" == typeof Promise ? i : Promise.all,\n \"%Promise_reject%\": \"undefined\" == typeof Promise ? i : Promise.reject,\n \"%Promise_resolve%\": \"undefined\" == typeof Promise ? i : Promise.resolve,\n \"%Proxy%\": \"undefined\" == typeof Proxy ? i : Proxy,\n \"%RangeError%\": RangeError,\n \"%RangeErrorPrototype%\": RangeError.prototype,\n \"%ReferenceError%\": ReferenceError,\n \"%ReferenceErrorPrototype%\": ReferenceError.prototype,\n \"%Reflect%\": \"undefined\" == typeof Reflect ? i : Reflect,\n \"%RegExp%\": RegExp,\n \"%RegExpPrototype%\": RegExp.prototype,\n \"%Set%\": \"undefined\" == typeof Set ? i : Set,\n \"%SetIteratorPrototype%\": \"undefined\" != typeof Set && h ? l(new Set()[Symbol.iterator]()) : i,\n \"%SetPrototype%\": \"undefined\" == typeof Set ? i : Set.prototype,\n \"%SharedArrayBuffer%\": \"undefined\" == typeof SharedArrayBuffer ? i : SharedArrayBuffer,\n \"%SharedArrayBufferPrototype%\": \"undefined\" == typeof SharedArrayBuffer ? i : SharedArrayBuffer.prototype,\n \"%String%\": String,\n \"%StringIteratorPrototype%\": h ? l(\"\"[Symbol.iterator]()) : i,\n \"%StringPrototype%\": String.prototype,\n \"%Symbol%\": h ? Symbol : i,\n \"%SymbolPrototype%\": h ? Symbol.prototype : i,\n \"%SyntaxError%\": SyntaxError,\n \"%SyntaxErrorPrototype%\": SyntaxError.prototype,\n \"%ThrowTypeError%\": s,\n \"%TypedArray%\": p,\n \"%TypedArrayPrototype%\": p ? p.prototype : i,\n \"%TypeError%\": n,\n \"%TypeErrorPrototype%\": n.prototype,\n \"%Uint8Array%\": \"undefined\" == typeof Uint8Array ? i : Uint8Array,\n \"%Uint8ArrayPrototype%\": \"undefined\" == typeof Uint8Array ? i : Uint8Array.prototype,\n \"%Uint8ClampedArray%\": \"undefined\" == typeof Uint8ClampedArray ? i : Uint8ClampedArray,\n \"%Uint8ClampedArrayPrototype%\": \"undefined\" == typeof Uint8ClampedArray ? i : Uint8ClampedArray.prototype,\n \"%Uint16Array%\": \"undefined\" == typeof Uint16Array ? i : Uint16Array,\n \"%Uint16ArrayPrototype%\": \"undefined\" == typeof Uint16Array ? i : Uint16Array.prototype,\n \"%Uint32Array%\": \"undefined\" == typeof Uint32Array ? i : Uint32Array,\n \"%Uint32ArrayPrototype%\": \"undefined\" == typeof Uint32Array ? i : Uint32Array.prototype,\n \"%URIError%\": URIError,\n \"%URIErrorPrototype%\": URIError.prototype,\n \"%WeakMap%\": \"undefined\" == typeof WeakMap ? i : WeakMap,\n \"%WeakMapPrototype%\": \"undefined\" == typeof WeakMap ? i : WeakMap.prototype,\n \"%WeakSet%\": \"undefined\" == typeof WeakSet ? i : WeakSet,\n \"%WeakSetPrototype%\": \"undefined\" == typeof WeakSet ? i : WeakSet.prototype\n },\n g = t(\"function-bind\").call(Function.call, String.prototype.replace),\n b = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,\n _ = /\\\\(\\\\)?/g,\n y = function (t) {\n var e = [];\n return g(t, b, function (t, r, i, n) {\n e[e.length] = i ? g(n, _, \"$1\") : r || t;\n }), e;\n },\n w = function (t, e) {\n if (!(t in m)) throw new SyntaxError(\"intrinsic \" + t + \" does not exist!\");\n if (void 0 === m[t] && !e) throw new n(\"intrinsic \" + t + \" exists, but is not available. Please file an issue!\");\n return m[t];\n };\n e.exports = function (t, e) {\n if (\"string\" != typeof t || 0 === t.length) throw new TypeError(\"intrinsic name must be a non-empty string\");\n if (arguments.length > 1 && \"boolean\" != typeof e) throw new TypeError('\"allowMissing\" argument must be a boolean');\n for (var r = y(t), i = w(\"%\" + (r.length > 0 ? r[0] : \"\") + \"%\", e), o = 1; o < r.length; o += 1) if (null != i) if (a && o + 1 >= r.length) {\n var s = a(i, r[o]);\n if (!e && !(r[o] in i)) throw new n(\"base intrinsic for \" + t + \" exists, but the property is not available.\");\n i = s ? s.get || s.value : i[r[o]];\n } else i = i[r[o]];\n return i;\n };\n }, {\n \"function-bind\": 41,\n \"has-symbols\": 42\n }],\n 35: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"function-bind\"),\n n = t(\"../GetIntrinsic\")(\"%Function%\"),\n a = n.apply,\n o = n.call;\n e.exports = function () {\n return i.apply(o, arguments);\n }, e.exports.apply = function () {\n return i.apply(a, arguments);\n };\n }, {\n \"../GetIntrinsic\": 34,\n \"function-bind\": 41\n }],\n 36: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"../GetIntrinsic\"),\n n = t(\"./callBind\"),\n a = n(i(\"String.prototype.indexOf\"));\n e.exports = function (t, e) {\n var r = i(t, !!e);\n return \"function\" == typeof r && a(t, \".prototype.\") ? n(r) : r;\n };\n }, {\n \"../GetIntrinsic\": 34,\n \"./callBind\": 35\n }],\n 37: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"../GetIntrinsic\")(\"%Object.getOwnPropertyDescriptor%\");\n if (i) try {\n i([], \"length\");\n } catch (t) {\n i = null;\n }\n e.exports = i;\n }, {\n \"../GetIntrinsic\": 34\n }],\n 38: [function (t, e, r) {\n \"use strict\";\n\n var i,\n n = \"object\" == typeof Reflect ? Reflect : null,\n a = n && \"function\" == typeof n.apply ? n.apply : function (t, e, r) {\n return Function.prototype.apply.call(t, e, r);\n };\n i = n && \"function\" == typeof n.ownKeys ? n.ownKeys : Object.getOwnPropertySymbols ? function (t) {\n return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));\n } : function (t) {\n return Object.getOwnPropertyNames(t);\n };\n var o = Number.isNaN || function (t) {\n return t != t;\n };\n function s() {\n s.init.call(this);\n }\n e.exports = s, e.exports.once = function (t, e) {\n return new Promise(function (r, i) {\n function n() {\n void 0 !== a && t.removeListener(\"error\", a), r([].slice.call(arguments));\n }\n var a;\n \"error\" !== e && (a = function (r) {\n t.removeListener(e, n), i(r);\n }, t.once(\"error\", a)), t.once(e, n);\n });\n }, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0;\n var h = 10;\n function l(t) {\n if (\"function\" != typeof t) throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof t);\n }\n function f(t) {\n return void 0 === t._maxListeners ? s.defaultMaxListeners : t._maxListeners;\n }\n function u(t, e, r, i) {\n var n, a, o, s;\n if (l(r), void 0 === (a = t._events) ? (a = t._events = Object.create(null), t._eventsCount = 0) : (void 0 !== a.newListener && (t.emit(\"newListener\", e, r.listener ? r.listener : r), a = t._events), o = a[e]), void 0 === o) o = a[e] = r, ++t._eventsCount;else if (\"function\" == typeof o ? o = a[e] = i ? [r, o] : [o, r] : i ? o.unshift(r) : o.push(r), (n = f(t)) > 0 && o.length > n && !o.warned) {\n o.warned = !0;\n var h = new Error(\"Possible EventEmitter memory leak detected. \" + o.length + \" \" + String(e) + \" listeners added. Use emitter.setMaxListeners() to increase limit\");\n h.name = \"MaxListenersExceededWarning\", h.emitter = t, h.type = e, h.count = o.length, s = h, console && console.warn && console.warn(s);\n }\n return t;\n }\n function c() {\n if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);\n }\n function d(t, e, r) {\n var i = {\n fired: !1,\n wrapFn: void 0,\n target: t,\n type: e,\n listener: r\n },\n n = c.bind(i);\n return n.listener = r, i.wrapFn = n, n;\n }\n function p(t, e, r) {\n var i = t._events;\n if (void 0 === i) return [];\n var n = i[e];\n return void 0 === n ? [] : \"function\" == typeof n ? r ? [n.listener || n] : [n] : r ? function (t) {\n for (var e = new Array(t.length), r = 0; r < e.length; ++r) e[r] = t[r].listener || t[r];\n return e;\n }(n) : g(n, n.length);\n }\n function m(t) {\n var e = this._events;\n if (void 0 !== e) {\n var r = e[t];\n if (\"function\" == typeof r) return 1;\n if (void 0 !== r) return r.length;\n }\n return 0;\n }\n function g(t, e) {\n for (var r = new Array(e), i = 0; i < e; ++i) r[i] = t[i];\n return r;\n }\n Object.defineProperty(s, \"defaultMaxListeners\", {\n enumerable: !0,\n get: function () {\n return h;\n },\n set: function (t) {\n if (\"number\" != typeof t || t < 0 || o(t)) throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + t + \".\");\n h = t;\n }\n }), s.init = function () {\n void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;\n }, s.prototype.setMaxListeners = function (t) {\n if (\"number\" != typeof t || t < 0 || o(t)) throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + t + \".\");\n return this._maxListeners = t, this;\n }, s.prototype.getMaxListeners = function () {\n return f(this);\n }, s.prototype.emit = function (t) {\n for (var e = [], r = 1; r < arguments.length; r++) e.push(arguments[r]);\n var i = \"error\" === t,\n n = this._events;\n if (void 0 !== n) i = i && void 0 === n.error;else if (!i) return !1;\n if (i) {\n var o;\n if (e.length > 0 && (o = e[0]), o instanceof Error) throw o;\n var s = new Error(\"Unhandled error.\" + (o ? \" (\" + o.message + \")\" : \"\"));\n throw s.context = o, s;\n }\n var h = n[t];\n if (void 0 === h) return !1;\n if (\"function\" == typeof h) a(h, this, e);else {\n var l = h.length,\n f = g(h, l);\n for (r = 0; r < l; ++r) a(f[r], this, e);\n }\n return !0;\n }, s.prototype.addListener = function (t, e) {\n return u(this, t, e, !1);\n }, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function (t, e) {\n return u(this, t, e, !0);\n }, s.prototype.once = function (t, e) {\n return l(e), this.on(t, d(this, t, e)), this;\n }, s.prototype.prependOnceListener = function (t, e) {\n return l(e), this.prependListener(t, d(this, t, e)), this;\n }, s.prototype.removeListener = function (t, e) {\n var r, i, n, a, o;\n if (l(e), void 0 === (i = this._events)) return this;\n if (void 0 === (r = i[t])) return this;\n if (r === e || r.listener === e) 0 == --this._eventsCount ? this._events = Object.create(null) : (delete i[t], i.removeListener && this.emit(\"removeListener\", t, r.listener || e));else if (\"function\" != typeof r) {\n for (n = -1, a = r.length - 1; a >= 0; a--) if (r[a] === e || r[a].listener === e) {\n o = r[a].listener, n = a;\n break;\n }\n if (n < 0) return this;\n 0 === n ? r.shift() : function (t, e) {\n for (; e + 1 < t.length; e++) t[e] = t[e + 1];\n t.pop();\n }(r, n), 1 === r.length && (i[t] = r[0]), void 0 !== i.removeListener && this.emit(\"removeListener\", t, o || e);\n }\n return this;\n }, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function (t) {\n var e, r, i;\n if (void 0 === (r = this._events)) return this;\n if (void 0 === r.removeListener) return 0 === arguments.length ? (this._events = Object.create(null), this._eventsCount = 0) : void 0 !== r[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete r[t]), this;\n if (0 === arguments.length) {\n var n,\n a = Object.keys(r);\n for (i = 0; i < a.length; ++i) \"removeListener\" !== (n = a[i]) && this.removeAllListeners(n);\n return this.removeAllListeners(\"removeListener\"), this._events = Object.create(null), this._eventsCount = 0, this;\n }\n if (\"function\" == typeof (e = r[t])) this.removeListener(t, e);else if (void 0 !== e) for (i = e.length - 1; i >= 0; i--) this.removeListener(t, e[i]);\n return this;\n }, s.prototype.listeners = function (t) {\n return p(this, t, !0);\n }, s.prototype.rawListeners = function (t) {\n return p(this, t, !1);\n }, s.listenerCount = function (t, e) {\n return \"function\" == typeof t.listenerCount ? t.listenerCount(e) : m.call(t, e);\n }, s.prototype.listenerCount = m, s.prototype.eventNames = function () {\n return this._eventsCount > 0 ? i(this._events) : [];\n };\n }, {}],\n 39: [function (t, e, r) {\n var i = Object.prototype.hasOwnProperty,\n n = Object.prototype.toString;\n e.exports = function (t, e, r) {\n if (\"[object Function]\" !== n.call(e)) throw new TypeError(\"iterator must be a function\");\n var a = t.length;\n if (a === +a) for (var o = 0; o < a; o++) e.call(r, t[o], o, t);else for (var s in t) i.call(t, s) && e.call(r, t[s], s, t);\n };\n }, {}],\n 40: [function (t, e, r) {\n \"use strict\";\n\n var i = \"Function.prototype.bind called on incompatible \",\n n = Array.prototype.slice,\n a = Object.prototype.toString,\n o = \"[object Function]\";\n e.exports = function (t) {\n var e = this;\n if (\"function\" != typeof e || a.call(e) !== o) throw new TypeError(i + e);\n for (var r, s = n.call(arguments, 1), h = Math.max(0, e.length - s.length), l = [], f = 0; f < h; f++) l.push(\"$\" + f);\n if (r = Function(\"binder\", \"return function (\" + l.join(\",\") + \"){ return binder.apply(this,arguments); }\")(function () {\n if (this instanceof r) {\n var i = e.apply(this, s.concat(n.call(arguments)));\n return Object(i) === i ? i : this;\n }\n return e.apply(t, s.concat(n.call(arguments)));\n }), e.prototype) {\n var u = function () {};\n u.prototype = e.prototype, r.prototype = new u(), u.prototype = null;\n }\n return r;\n };\n }, {}],\n 41: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"./implementation\");\n e.exports = Function.prototype.bind || i;\n }, {\n \"./implementation\": 40\n }],\n 42: [function (t, e, i) {\n (function (r) {\n (function () {\n \"use strict\";\n\n var i = r.Symbol,\n n = t(\"./shams\");\n e.exports = function () {\n return \"function\" == typeof i && \"function\" == typeof Symbol && \"symbol\" == typeof i(\"foo\") && \"symbol\" == typeof Symbol(\"bar\") && n();\n };\n }).call(this);\n }).call(this, void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {\n \"./shams\": 43\n }],\n 43: [function (t, e, r) {\n \"use strict\";\n\n e.exports = function () {\n if (\"function\" != typeof Symbol || \"function\" != typeof Object.getOwnPropertySymbols) return !1;\n if (\"symbol\" == typeof Symbol.iterator) return !0;\n var t = {},\n e = Symbol(\"test\"),\n r = Object(e);\n if (\"string\" == typeof e) return !1;\n if (\"[object Symbol]\" !== Object.prototype.toString.call(e)) return !1;\n if (\"[object Symbol]\" !== Object.prototype.toString.call(r)) return !1;\n for (e in t[e] = 42, t) return !1;\n if (\"function\" == typeof Object.keys && 0 !== Object.keys(t).length) return !1;\n if (\"function\" == typeof Object.getOwnPropertyNames && 0 !== Object.getOwnPropertyNames(t).length) return !1;\n var i = Object.getOwnPropertySymbols(t);\n if (1 !== i.length || i[0] !== e) return !1;\n if (!Object.prototype.propertyIsEnumerable.call(t, e)) return !1;\n if (\"function\" == typeof Object.getOwnPropertyDescriptor) {\n var n = Object.getOwnPropertyDescriptor(t, e);\n if (42 !== n.value || !0 !== n.enumerable) return !1;\n }\n return !0;\n };\n }, {}],\n 44: [function (t, e, r) {\n r.read = function (t, e, r, i, n) {\n var a,\n o,\n s = 8 * n - i - 1,\n h = (1 << s) - 1,\n l = h >> 1,\n f = -7,\n u = r ? n - 1 : 0,\n c = r ? -1 : 1,\n d = t[e + u];\n for (u += c, a = d & (1 << -f) - 1, d >>= -f, f += s; f > 0; a = 256 * a + t[e + u], u += c, f -= 8);\n for (o = a & (1 << -f) - 1, a >>= -f, f += i; f > 0; o = 256 * o + t[e + u], u += c, f -= 8);\n if (0 === a) a = 1 - l;else {\n if (a === h) return o ? NaN : 1 / 0 * (d ? -1 : 1);\n o += Math.pow(2, i), a -= l;\n }\n return (d ? -1 : 1) * o * Math.pow(2, a - i);\n }, r.write = function (t, e, r, i, n, a) {\n var o,\n s,\n h,\n l = 8 * a - n - 1,\n f = (1 << l) - 1,\n u = f >> 1,\n c = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0,\n d = i ? 0 : a - 1,\n p = i ? 1 : -1,\n m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;\n for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, o = f) : (o = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -o)) < 1 && (o--, h *= 2), (e += o + u >= 1 ? c / h : c * Math.pow(2, 1 - u)) * h >= 2 && (o++, h /= 2), o + u >= f ? (s = 0, o = f) : o + u >= 1 ? (s = (e * h - 1) * Math.pow(2, n), o += u) : (s = e * Math.pow(2, u - 1) * Math.pow(2, n), o = 0)); n >= 8; t[r + d] = 255 & s, d += p, s /= 256, n -= 8);\n for (o = o << n | s, l += n; l > 0; t[r + d] = 255 & o, d += p, o /= 256, l -= 8);\n t[r + d - p] |= 128 * m;\n };\n }, {}],\n 45: [function (t, e, r) {\n \"function\" == typeof Object.create ? e.exports = function (t, e) {\n e && (t.super_ = e, t.prototype = Object.create(e.prototype, {\n constructor: {\n value: t,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }));\n } : e.exports = function (t, e) {\n if (e) {\n t.super_ = e;\n var r = function () {};\n r.prototype = e.prototype, t.prototype = new r(), t.prototype.constructor = t;\n }\n };\n }, {}],\n 46: [function (t, e, r) {\n \"use strict\";\n\n var i = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.toStringTag,\n n = Object.prototype.toString,\n a = function (t) {\n return !(i && t && \"object\" == typeof t && Symbol.toStringTag in t) && \"[object Arguments]\" === n.call(t);\n },\n o = function (t) {\n return !!a(t) || null !== t && \"object\" == typeof t && \"number\" == typeof t.length && t.length >= 0 && \"[object Array]\" !== n.call(t) && \"[object Function]\" === n.call(t.callee);\n },\n s = function () {\n return a(arguments);\n }();\n a.isLegacyArguments = o, e.exports = s ? a : o;\n }, {}],\n 47: [function (t, e, r) {\n \"use strict\";\n\n var i = Object.prototype.toString,\n n = Function.prototype.toString,\n a = /^\\s*(?:function)?\\*/,\n o = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.toStringTag,\n s = Object.getPrototypeOf,\n h = function () {\n if (!o) return !1;\n try {\n return Function(\"return function*() {}\")();\n } catch (t) {}\n }(),\n l = h ? s(h) : {};\n e.exports = function (t) {\n return \"function\" == typeof t && (!!a.test(n.call(t)) || (o ? s(t) === l : \"[object GeneratorFunction]\" === i.call(t)));\n };\n }, {}],\n 48: [function (t, e, i) {\n (function (r) {\n (function () {\n \"use strict\";\n\n var i = t(\"foreach\"),\n n = t(\"available-typed-arrays\"),\n a = t(\"es-abstract/helpers/callBound\"),\n o = a(\"Object.prototype.toString\"),\n s = t(\"has-symbols\")() && \"symbol\" == typeof Symbol.toStringTag,\n h = n(),\n l = a(\"Array.prototype.indexOf\", !0) || function (t, e) {\n for (var r = 0; r < t.length; r += 1) if (t[r] === e) return r;\n return -1;\n },\n f = a(\"String.prototype.slice\"),\n u = {},\n c = t(\"es-abstract/helpers/getOwnPropertyDescriptor\"),\n d = Object.getPrototypeOf;\n s && c && d && i(h, function (t) {\n var e = new r[t]();\n if (!(Symbol.toStringTag in e)) throw new EvalError(\"this engine has support for Symbol.toStringTag, but \" + t + \" does not have the property! Please report this.\");\n var i = d(e),\n n = c(i, Symbol.toStringTag);\n if (!n) {\n var a = d(i);\n n = c(a, Symbol.toStringTag);\n }\n u[t] = n.get;\n });\n e.exports = function (t) {\n if (!t || \"object\" != typeof t) return !1;\n if (!s) {\n var e = f(o(t), 8, -1);\n return l(h, e) > -1;\n }\n return !!c && function (t) {\n var e = !1;\n return i(u, function (r, i) {\n if (!e) try {\n e = r.call(t) === i;\n } catch (t) {}\n }), e;\n }(t);\n };\n }).call(this);\n }).call(this, void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {\n \"available-typed-arrays\": 27,\n \"es-abstract/helpers/callBound\": 36,\n \"es-abstract/helpers/getOwnPropertyDescriptor\": 37,\n foreach: 39,\n \"has-symbols\": 42\n }],\n 49: [function (t, e, r) {\n \"use strict\";\n\n var i = \"undefined\" != typeof Uint8Array && \"undefined\" != typeof Uint16Array && \"undefined\" != typeof Int32Array;\n function n(t, e) {\n return Object.prototype.hasOwnProperty.call(t, e);\n }\n r.assign = function (t) {\n for (var e = Array.prototype.slice.call(arguments, 1); e.length;) {\n var r = e.shift();\n if (r) {\n if (\"object\" != typeof r) throw new TypeError(r + \"must be non-object\");\n for (var i in r) n(r, i) && (t[i] = r[i]);\n }\n }\n return t;\n }, r.shrinkBuf = function (t, e) {\n return t.length === e ? t : t.subarray ? t.subarray(0, e) : (t.length = e, t);\n };\n var a = {\n arraySet: function (t, e, r, i, n) {\n if (e.subarray && t.subarray) t.set(e.subarray(r, r + i), n);else for (var a = 0; a < i; a++) t[n + a] = e[r + a];\n },\n flattenChunks: function (t) {\n var e, r, i, n, a, o;\n for (i = 0, e = 0, r = t.length; e < r; e++) i += t[e].length;\n for (o = new Uint8Array(i), n = 0, e = 0, r = t.length; e < r; e++) a = t[e], o.set(a, n), n += a.length;\n return o;\n }\n },\n o = {\n arraySet: function (t, e, r, i, n) {\n for (var a = 0; a < i; a++) t[n + a] = e[r + a];\n },\n flattenChunks: function (t) {\n return [].concat.apply([], t);\n }\n };\n r.setTyped = function (t) {\n t ? (r.Buf8 = Uint8Array, r.Buf16 = Uint16Array, r.Buf32 = Int32Array, r.assign(r, a)) : (r.Buf8 = Array, r.Buf16 = Array, r.Buf32 = Array, r.assign(r, o));\n }, r.setTyped(i);\n }, {}],\n 50: [function (t, e, r) {\n \"use strict\";\n\n e.exports = function (t, e, r, i) {\n for (var n = 65535 & t | 0, a = t >>> 16 & 65535 | 0, o = 0; 0 !== r;) {\n r -= o = r > 2e3 ? 2e3 : r;\n do {\n a = a + (n = n + e[i++] | 0) | 0;\n } while (--o);\n n %= 65521, a %= 65521;\n }\n return n | a << 16 | 0;\n };\n }, {}],\n 51: [function (t, e, r) {\n \"use strict\";\n\n e.exports = {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_BUF_ERROR: -5,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n Z_BINARY: 0,\n Z_TEXT: 1,\n Z_UNKNOWN: 2,\n Z_DEFLATED: 8\n };\n }, {}],\n 52: [function (t, e, r) {\n \"use strict\";\n\n var i = function () {\n for (var t, e = [], r = 0; r < 256; r++) {\n t = r;\n for (var i = 0; i < 8; i++) t = 1 & t ? 3988292384 ^ t >>> 1 : t >>> 1;\n e[r] = t;\n }\n return e;\n }();\n e.exports = function (t, e, r, n) {\n var a = i,\n o = n + r;\n t ^= -1;\n for (var s = n; s < o; s++) t = t >>> 8 ^ a[255 & (t ^ e[s])];\n return -1 ^ t;\n };\n }, {}],\n 53: [function (t, e, r) {\n \"use strict\";\n\n var i,\n n = t(\"../utils/common\"),\n a = t(\"./trees\"),\n o = t(\"./adler32\"),\n s = t(\"./crc32\"),\n h = t(\"./messages\"),\n l = 0,\n f = 1,\n u = 3,\n c = 4,\n d = 5,\n p = 0,\n m = 1,\n g = -2,\n b = -3,\n _ = -5,\n y = -1,\n w = 1,\n v = 2,\n x = 3,\n E = 4,\n k = 0,\n S = 2,\n M = 8,\n A = 9,\n I = 15,\n B = 8,\n T = 286,\n R = 30,\n P = 19,\n O = 2 * T + 1,\n L = 15,\n C = 3,\n U = 258,\n z = U + C + 1,\n D = 32,\n N = 42,\n F = 69,\n j = 73,\n G = 91,\n H = 103,\n W = 113,\n q = 666,\n Z = 1,\n Y = 2,\n V = 3,\n X = 4,\n J = 3;\n function Q(t, e) {\n return t.msg = h[e], e;\n }\n function K(t) {\n return (t << 1) - (t > 4 ? 9 : 0);\n }\n function $(t) {\n for (var e = t.length; --e >= 0;) t[e] = 0;\n }\n function tt(t) {\n var e = t.state,\n r = e.pending;\n r > t.avail_out && (r = t.avail_out), 0 !== r && (n.arraySet(t.output, e.pending_buf, e.pending_out, r, t.next_out), t.next_out += r, e.pending_out += r, t.total_out += r, t.avail_out -= r, e.pending -= r, 0 === e.pending && (e.pending_out = 0));\n }\n function et(t, e) {\n a._tr_flush_block(t, t.block_start >= 0 ? t.block_start : -1, t.strstart - t.block_start, e), t.block_start = t.strstart, tt(t.strm);\n }\n function rt(t, e) {\n t.pending_buf[t.pending++] = e;\n }\n function it(t, e) {\n t.pending_buf[t.pending++] = e >>> 8 & 255, t.pending_buf[t.pending++] = 255 & e;\n }\n function nt(t, e) {\n var r,\n i,\n n = t.max_chain_length,\n a = t.strstart,\n o = t.prev_length,\n s = t.nice_match,\n h = t.strstart > t.w_size - z ? t.strstart - (t.w_size - z) : 0,\n l = t.window,\n f = t.w_mask,\n u = t.prev,\n c = t.strstart + U,\n d = l[a + o - 1],\n p = l[a + o];\n t.prev_length >= t.good_match && (n >>= 2), s > t.lookahead && (s = t.lookahead);\n do {\n if (l[(r = e) + o] === p && l[r + o - 1] === d && l[r] === l[a] && l[++r] === l[a + 1]) {\n a += 2, r++;\n do {} while (l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && l[++a] === l[++r] && a < c);\n if (i = U - (c - a), a = c - U, i > o) {\n if (t.match_start = e, o = i, i >= s) break;\n d = l[a + o - 1], p = l[a + o];\n }\n }\n } while ((e = u[e & f]) > h && 0 != --n);\n return o <= t.lookahead ? o : t.lookahead;\n }\n function at(t) {\n var e,\n r,\n i,\n a,\n h,\n l,\n f,\n u,\n c,\n d,\n p = t.w_size;\n do {\n if (a = t.window_size - t.lookahead - t.strstart, t.strstart >= p + (p - z)) {\n n.arraySet(t.window, t.window, p, p, 0), t.match_start -= p, t.strstart -= p, t.block_start -= p, e = r = t.hash_size;\n do {\n i = t.head[--e], t.head[e] = i >= p ? i - p : 0;\n } while (--r);\n e = r = p;\n do {\n i = t.prev[--e], t.prev[e] = i >= p ? i - p : 0;\n } while (--r);\n a += p;\n }\n if (0 === t.strm.avail_in) break;\n if (l = t.strm, f = t.window, u = t.strstart + t.lookahead, c = a, d = void 0, (d = l.avail_in) > c && (d = c), r = 0 === d ? 0 : (l.avail_in -= d, n.arraySet(f, l.input, l.next_in, d, u), 1 === l.state.wrap ? l.adler = o(l.adler, f, d, u) : 2 === l.state.wrap && (l.adler = s(l.adler, f, d, u)), l.next_in += d, l.total_in += d, d), t.lookahead += r, t.lookahead + t.insert >= C) for (h = t.strstart - t.insert, t.ins_h = t.window[h], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[h + 1]) & t.hash_mask; t.insert && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[h + C - 1]) & t.hash_mask, t.prev[h & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = h, h++, t.insert--, !(t.lookahead + t.insert < C)););\n } while (t.lookahead < z && 0 !== t.strm.avail_in);\n }\n function ot(t, e) {\n for (var r, i;;) {\n if (t.lookahead < z) {\n if (at(t), t.lookahead < z && e === l) return Z;\n if (0 === t.lookahead) break;\n }\n if (r = 0, t.lookahead >= C && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + C - 1]) & t.hash_mask, r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), 0 !== r && t.strstart - r <= t.w_size - z && (t.match_length = nt(t, r)), t.match_length >= C) {\n if (i = a._tr_tally(t, t.strstart - t.match_start, t.match_length - C), t.lookahead -= t.match_length, t.match_length <= t.max_lazy_match && t.lookahead >= C) {\n t.match_length--;\n do {\n t.strstart++, t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + C - 1]) & t.hash_mask, r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart;\n } while (0 != --t.match_length);\n t.strstart++;\n } else t.strstart += t.match_length, t.match_length = 0, t.ins_h = t.window[t.strstart], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + 1]) & t.hash_mask;\n } else i = a._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++;\n if (i && (et(t, !1), 0 === t.strm.avail_out)) return Z;\n }\n return t.insert = t.strstart < C - 1 ? t.strstart : C - 1, e === c ? (et(t, !0), 0 === t.strm.avail_out ? V : X) : t.last_lit && (et(t, !1), 0 === t.strm.avail_out) ? Z : Y;\n }\n function st(t, e) {\n for (var r, i, n;;) {\n if (t.lookahead < z) {\n if (at(t), t.lookahead < z && e === l) return Z;\n if (0 === t.lookahead) break;\n }\n if (r = 0, t.lookahead >= C && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + C - 1]) & t.hash_mask, r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), t.prev_length = t.match_length, t.prev_match = t.match_start, t.match_length = C - 1, 0 !== r && t.prev_length < t.max_lazy_match && t.strstart - r <= t.w_size - z && (t.match_length = nt(t, r), t.match_length <= 5 && (t.strategy === w || t.match_length === C && t.strstart - t.match_start > 4096) && (t.match_length = C - 1)), t.prev_length >= C && t.match_length <= t.prev_length) {\n n = t.strstart + t.lookahead - C, i = a._tr_tally(t, t.strstart - 1 - t.prev_match, t.prev_length - C), t.lookahead -= t.prev_length - 1, t.prev_length -= 2;\n do {\n ++t.strstart <= n && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + C - 1]) & t.hash_mask, r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart);\n } while (0 != --t.prev_length);\n if (t.match_available = 0, t.match_length = C - 1, t.strstart++, i && (et(t, !1), 0 === t.strm.avail_out)) return Z;\n } else if (t.match_available) {\n if ((i = a._tr_tally(t, 0, t.window[t.strstart - 1])) && et(t, !1), t.strstart++, t.lookahead--, 0 === t.strm.avail_out) return Z;\n } else t.match_available = 1, t.strstart++, t.lookahead--;\n }\n return t.match_available && (i = a._tr_tally(t, 0, t.window[t.strstart - 1]), t.match_available = 0), t.insert = t.strstart < C - 1 ? t.strstart : C - 1, e === c ? (et(t, !0), 0 === t.strm.avail_out ? V : X) : t.last_lit && (et(t, !1), 0 === t.strm.avail_out) ? Z : Y;\n }\n function ht(t, e, r, i, n) {\n this.good_length = t, this.max_lazy = e, this.nice_length = r, this.max_chain = i, this.func = n;\n }\n function lt() {\n this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = M, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new n.Buf16(2 * O), this.dyn_dtree = new n.Buf16(2 * (2 * R + 1)), this.bl_tree = new n.Buf16(2 * (2 * P + 1)), $(this.dyn_ltree), $(this.dyn_dtree), $(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new n.Buf16(L + 1), this.heap = new n.Buf16(2 * T + 1), $(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new n.Buf16(2 * T + 1), $(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;\n }\n function ft(t) {\n var e;\n return t && t.state ? (t.total_in = t.total_out = 0, t.data_type = S, (e = t.state).pending = 0, e.pending_out = 0, e.wrap < 0 && (e.wrap = -e.wrap), e.status = e.wrap ? N : W, t.adler = 2 === e.wrap ? 0 : 1, e.last_flush = l, a._tr_init(e), p) : Q(t, g);\n }\n function ut(t) {\n var e,\n r = ft(t);\n return r === p && ((e = t.state).window_size = 2 * e.w_size, $(e.head), e.max_lazy_match = i[e.level].max_lazy, e.good_match = i[e.level].good_length, e.nice_match = i[e.level].nice_length, e.max_chain_length = i[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = C - 1, e.match_available = 0, e.ins_h = 0), r;\n }\n function ct(t, e, r, i, a, o) {\n if (!t) return g;\n var s = 1;\n if (e === y && (e = 6), i < 0 ? (s = 0, i = -i) : i > 15 && (s = 2, i -= 16), a < 1 || a > A || r !== M || i < 8 || i > 15 || e < 0 || e > 9 || o < 0 || o > E) return Q(t, g);\n 8 === i && (i = 9);\n var h = new lt();\n return t.state = h, h.strm = t, h.wrap = s, h.gzhead = null, h.w_bits = i, h.w_size = 1 << h.w_bits, h.w_mask = h.w_size - 1, h.hash_bits = a + 7, h.hash_size = 1 << h.hash_bits, h.hash_mask = h.hash_size - 1, h.hash_shift = ~~((h.hash_bits + C - 1) / C), h.window = new n.Buf8(2 * h.w_size), h.head = new n.Buf16(h.hash_size), h.prev = new n.Buf16(h.w_size), h.lit_bufsize = 1 << a + 6, h.pending_buf_size = 4 * h.lit_bufsize, h.pending_buf = new n.Buf8(h.pending_buf_size), h.d_buf = 1 * h.lit_bufsize, h.l_buf = 3 * h.lit_bufsize, h.level = e, h.strategy = o, h.method = r, ut(t);\n }\n i = [new ht(0, 0, 0, 0, function (t, e) {\n var r = 65535;\n for (r > t.pending_buf_size - 5 && (r = t.pending_buf_size - 5);;) {\n if (t.lookahead <= 1) {\n if (at(t), 0 === t.lookahead && e === l) return Z;\n if (0 === t.lookahead) break;\n }\n t.strstart += t.lookahead, t.lookahead = 0;\n var i = t.block_start + r;\n if ((0 === t.strstart || t.strstart >= i) && (t.lookahead = t.strstart - i, t.strstart = i, et(t, !1), 0 === t.strm.avail_out)) return Z;\n if (t.strstart - t.block_start >= t.w_size - z && (et(t, !1), 0 === t.strm.avail_out)) return Z;\n }\n return t.insert = 0, e === c ? (et(t, !0), 0 === t.strm.avail_out ? V : X) : (t.strstart > t.block_start && (et(t, !1), t.strm.avail_out), Z);\n }), new ht(4, 4, 8, 4, ot), new ht(4, 5, 16, 8, ot), new ht(4, 6, 32, 32, ot), new ht(4, 4, 16, 16, st), new ht(8, 16, 32, 32, st), new ht(8, 16, 128, 128, st), new ht(8, 32, 128, 256, st), new ht(32, 128, 258, 1024, st), new ht(32, 258, 258, 4096, st)], r.deflateInit = function (t, e) {\n return ct(t, e, M, I, B, k);\n }, r.deflateInit2 = ct, r.deflateReset = ut, r.deflateResetKeep = ft, r.deflateSetHeader = function (t, e) {\n return t && t.state ? 2 !== t.state.wrap ? g : (t.state.gzhead = e, p) : g;\n }, r.deflate = function (t, e) {\n var r, n, o, h;\n if (!t || !t.state || e > d || e < 0) return t ? Q(t, g) : g;\n if (n = t.state, !t.output || !t.input && 0 !== t.avail_in || n.status === q && e !== c) return Q(t, 0 === t.avail_out ? _ : g);\n if (n.strm = t, r = n.last_flush, n.last_flush = e, n.status === N) if (2 === n.wrap) t.adler = 0, rt(n, 31), rt(n, 139), rt(n, 8), n.gzhead ? (rt(n, (n.gzhead.text ? 1 : 0) + (n.gzhead.hcrc ? 2 : 0) + (n.gzhead.extra ? 4 : 0) + (n.gzhead.name ? 8 : 0) + (n.gzhead.comment ? 16 : 0)), rt(n, 255 & n.gzhead.time), rt(n, n.gzhead.time >> 8 & 255), rt(n, n.gzhead.time >> 16 & 255), rt(n, n.gzhead.time >> 24 & 255), rt(n, 9 === n.level ? 2 : n.strategy >= v || n.level < 2 ? 4 : 0), rt(n, 255 & n.gzhead.os), n.gzhead.extra && n.gzhead.extra.length && (rt(n, 255 & n.gzhead.extra.length), rt(n, n.gzhead.extra.length >> 8 & 255)), n.gzhead.hcrc && (t.adler = s(t.adler, n.pending_buf, n.pending, 0)), n.gzindex = 0, n.status = F) : (rt(n, 0), rt(n, 0), rt(n, 0), rt(n, 0), rt(n, 0), rt(n, 9 === n.level ? 2 : n.strategy >= v || n.level < 2 ? 4 : 0), rt(n, J), n.status = W);else {\n var b = M + (n.w_bits - 8 << 4) << 8;\n b |= (n.strategy >= v || n.level < 2 ? 0 : n.level < 6 ? 1 : 6 === n.level ? 2 : 3) << 6, 0 !== n.strstart && (b |= D), b += 31 - b % 31, n.status = W, it(n, b), 0 !== n.strstart && (it(n, t.adler >>> 16), it(n, 65535 & t.adler)), t.adler = 1;\n }\n if (n.status === F) if (n.gzhead.extra) {\n for (o = n.pending; n.gzindex < (65535 & n.gzhead.extra.length) && (n.pending !== n.pending_buf_size || (n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), tt(t), o = n.pending, n.pending !== n.pending_buf_size));) rt(n, 255 & n.gzhead.extra[n.gzindex]), n.gzindex++;\n n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), n.gzindex === n.gzhead.extra.length && (n.gzindex = 0, n.status = j);\n } else n.status = j;\n if (n.status === j) if (n.gzhead.name) {\n o = n.pending;\n do {\n if (n.pending === n.pending_buf_size && (n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), tt(t), o = n.pending, n.pending === n.pending_buf_size)) {\n h = 1;\n break;\n }\n h = n.gzindex < n.gzhead.name.length ? 255 & n.gzhead.name.charCodeAt(n.gzindex++) : 0, rt(n, h);\n } while (0 !== h);\n n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), 0 === h && (n.gzindex = 0, n.status = G);\n } else n.status = G;\n if (n.status === G) if (n.gzhead.comment) {\n o = n.pending;\n do {\n if (n.pending === n.pending_buf_size && (n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), tt(t), o = n.pending, n.pending === n.pending_buf_size)) {\n h = 1;\n break;\n }\n h = n.gzindex < n.gzhead.comment.length ? 255 & n.gzhead.comment.charCodeAt(n.gzindex++) : 0, rt(n, h);\n } while (0 !== h);\n n.gzhead.hcrc && n.pending > o && (t.adler = s(t.adler, n.pending_buf, n.pending - o, o)), 0 === h && (n.status = H);\n } else n.status = H;\n if (n.status === H && (n.gzhead.hcrc ? (n.pending + 2 > n.pending_buf_size && tt(t), n.pending + 2 <= n.pending_buf_size && (rt(n, 255 & t.adler), rt(n, t.adler >> 8 & 255), t.adler = 0, n.status = W)) : n.status = W), 0 !== n.pending) {\n if (tt(t), 0 === t.avail_out) return n.last_flush = -1, p;\n } else if (0 === t.avail_in && K(e) <= K(r) && e !== c) return Q(t, _);\n if (n.status === q && 0 !== t.avail_in) return Q(t, _);\n if (0 !== t.avail_in || 0 !== n.lookahead || e !== l && n.status !== q) {\n var y = n.strategy === v ? function (t, e) {\n for (var r;;) {\n if (0 === t.lookahead && (at(t), 0 === t.lookahead)) {\n if (e === l) return Z;\n break;\n }\n if (t.match_length = 0, r = a._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++, r && (et(t, !1), 0 === t.strm.avail_out)) return Z;\n }\n return t.insert = 0, e === c ? (et(t, !0), 0 === t.strm.avail_out ? V : X) : t.last_lit && (et(t, !1), 0 === t.strm.avail_out) ? Z : Y;\n }(n, e) : n.strategy === x ? function (t, e) {\n for (var r, i, n, o, s = t.window;;) {\n if (t.lookahead <= U) {\n if (at(t), t.lookahead <= U && e === l) return Z;\n if (0 === t.lookahead) break;\n }\n if (t.match_length = 0, t.lookahead >= C && t.strstart > 0 && (i = s[n = t.strstart - 1]) === s[++n] && i === s[++n] && i === s[++n]) {\n o = t.strstart + U;\n do {} while (i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && i === s[++n] && n < o);\n t.match_length = U - (o - n), t.match_length > t.lookahead && (t.match_length = t.lookahead);\n }\n if (t.match_length >= C ? (r = a._tr_tally(t, 1, t.match_length - C), t.lookahead -= t.match_length, t.strstart += t.match_length, t.match_length = 0) : (r = a._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++), r && (et(t, !1), 0 === t.strm.avail_out)) return Z;\n }\n return t.insert = 0, e === c ? (et(t, !0), 0 === t.strm.avail_out ? V : X) : t.last_lit && (et(t, !1), 0 === t.strm.avail_out) ? Z : Y;\n }(n, e) : i[n.level].func(n, e);\n if (y !== V && y !== X || (n.status = q), y === Z || y === V) return 0 === t.avail_out && (n.last_flush = -1), p;\n if (y === Y && (e === f ? a._tr_align(n) : e !== d && (a._tr_stored_block(n, 0, 0, !1), e === u && ($(n.head), 0 === n.lookahead && (n.strstart = 0, n.block_start = 0, n.insert = 0))), tt(t), 0 === t.avail_out)) return n.last_flush = -1, p;\n }\n return e !== c ? p : n.wrap <= 0 ? m : (2 === n.wrap ? (rt(n, 255 & t.adler), rt(n, t.adler >> 8 & 255), rt(n, t.adler >> 16 & 255), rt(n, t.adler >> 24 & 255), rt(n, 255 & t.total_in), rt(n, t.total_in >> 8 & 255), rt(n, t.total_in >> 16 & 255), rt(n, t.total_in >> 24 & 255)) : (it(n, t.adler >>> 16), it(n, 65535 & t.adler)), tt(t), n.wrap > 0 && (n.wrap = -n.wrap), 0 !== n.pending ? p : m);\n }, r.deflateEnd = function (t) {\n var e;\n return t && t.state ? (e = t.state.status) !== N && e !== F && e !== j && e !== G && e !== H && e !== W && e !== q ? Q(t, g) : (t.state = null, e === W ? Q(t, b) : p) : g;\n }, r.deflateSetDictionary = function (t, e) {\n var r,\n i,\n a,\n s,\n h,\n l,\n f,\n u,\n c = e.length;\n if (!t || !t.state) return g;\n if (2 === (s = (r = t.state).wrap) || 1 === s && r.status !== N || r.lookahead) return g;\n for (1 === s && (t.adler = o(t.adler, e, c, 0)), r.wrap = 0, c >= r.w_size && (0 === s && ($(r.head), r.strstart = 0, r.block_start = 0, r.insert = 0), u = new n.Buf8(r.w_size), n.arraySet(u, e, c - r.w_size, r.w_size, 0), e = u, c = r.w_size), h = t.avail_in, l = t.next_in, f = t.input, t.avail_in = c, t.next_in = 0, t.input = e, at(r); r.lookahead >= C;) {\n i = r.strstart, a = r.lookahead - (C - 1);\n do {\n r.ins_h = (r.ins_h << r.hash_shift ^ r.window[i + C - 1]) & r.hash_mask, r.prev[i & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = i, i++;\n } while (--a);\n r.strstart = i, r.lookahead = C - 1, at(r);\n }\n return r.strstart += r.lookahead, r.block_start = r.strstart, r.insert = r.lookahead, r.lookahead = 0, r.match_length = r.prev_length = C - 1, r.match_available = 0, t.next_in = l, t.input = f, t.avail_in = h, r.wrap = s, p;\n }, r.deflateInfo = \"pako deflate (from Nodeca project)\";\n }, {\n \"../utils/common\": 49,\n \"./adler32\": 50,\n \"./crc32\": 52,\n \"./messages\": 57,\n \"./trees\": 58\n }],\n 54: [function (t, e, r) {\n \"use strict\";\n\n e.exports = function (t, e) {\n var r, i, n, a, o, s, h, l, f, u, c, d, p, m, g, b, _, y, w, v, x, E, k, S, M;\n r = t.state, i = t.next_in, S = t.input, n = i + (t.avail_in - 5), a = t.next_out, M = t.output, o = a - (e - t.avail_out), s = a + (t.avail_out - 257), h = r.dmax, l = r.wsize, f = r.whave, u = r.wnext, c = r.window, d = r.hold, p = r.bits, m = r.lencode, g = r.distcode, b = (1 << r.lenbits) - 1, _ = (1 << r.distbits) - 1;\n t: do {\n p < 15 && (d += S[i++] << p, p += 8, d += S[i++] << p, p += 8), y = m[d & b];\n e: for (;;) {\n if (d >>>= w = y >>> 24, p -= w, 0 == (w = y >>> 16 & 255)) M[a++] = 65535 & y;else {\n if (!(16 & w)) {\n if (0 == (64 & w)) {\n y = m[(65535 & y) + (d & (1 << w) - 1)];\n continue e;\n }\n if (32 & w) {\n r.mode = 12;\n break t;\n }\n t.msg = \"invalid literal/length code\", r.mode = 30;\n break t;\n }\n v = 65535 & y, (w &= 15) && (p < w && (d += S[i++] << p, p += 8), v += d & (1 << w) - 1, d >>>= w, p -= w), p < 15 && (d += S[i++] << p, p += 8, d += S[i++] << p, p += 8), y = g[d & _];\n r: for (;;) {\n if (d >>>= w = y >>> 24, p -= w, !(16 & (w = y >>> 16 & 255))) {\n if (0 == (64 & w)) {\n y = g[(65535 & y) + (d & (1 << w) - 1)];\n continue r;\n }\n t.msg = \"invalid distance code\", r.mode = 30;\n break t;\n }\n if (x = 65535 & y, p < (w &= 15) && (d += S[i++] << p, (p += 8) < w && (d += S[i++] << p, p += 8)), (x += d & (1 << w) - 1) > h) {\n t.msg = \"invalid distance too far back\", r.mode = 30;\n break t;\n }\n if (d >>>= w, p -= w, x > (w = a - o)) {\n if ((w = x - w) > f && r.sane) {\n t.msg = \"invalid distance too far back\", r.mode = 30;\n break t;\n }\n if (E = 0, k = c, 0 === u) {\n if (E += l - w, w < v) {\n v -= w;\n do {\n M[a++] = c[E++];\n } while (--w);\n E = a - x, k = M;\n }\n } else if (u < w) {\n if (E += l + u - w, (w -= u) < v) {\n v -= w;\n do {\n M[a++] = c[E++];\n } while (--w);\n if (E = 0, u < v) {\n v -= w = u;\n do {\n M[a++] = c[E++];\n } while (--w);\n E = a - x, k = M;\n }\n }\n } else if (E += u - w, w < v) {\n v -= w;\n do {\n M[a++] = c[E++];\n } while (--w);\n E = a - x, k = M;\n }\n for (; v > 2;) M[a++] = k[E++], M[a++] = k[E++], M[a++] = k[E++], v -= 3;\n v && (M[a++] = k[E++], v > 1 && (M[a++] = k[E++]));\n } else {\n E = a - x;\n do {\n M[a++] = M[E++], M[a++] = M[E++], M[a++] = M[E++], v -= 3;\n } while (v > 2);\n v && (M[a++] = M[E++], v > 1 && (M[a++] = M[E++]));\n }\n break;\n }\n }\n break;\n }\n } while (i < n && a < s);\n i -= v = p >> 3, d &= (1 << (p -= v << 3)) - 1, t.next_in = i, t.next_out = a, t.avail_in = i < n ? n - i + 5 : 5 - (i - n), t.avail_out = a < s ? s - a + 257 : 257 - (a - s), r.hold = d, r.bits = p;\n };\n }, {}],\n 55: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"../utils/common\"),\n n = t(\"./adler32\"),\n a = t(\"./crc32\"),\n o = t(\"./inffast\"),\n s = t(\"./inftrees\"),\n h = 0,\n l = 1,\n f = 2,\n u = 4,\n c = 5,\n d = 6,\n p = 0,\n m = 1,\n g = 2,\n b = -2,\n _ = -3,\n y = -4,\n w = -5,\n v = 8,\n x = 1,\n E = 2,\n k = 3,\n S = 4,\n M = 5,\n A = 6,\n I = 7,\n B = 8,\n T = 9,\n R = 10,\n P = 11,\n O = 12,\n L = 13,\n C = 14,\n U = 15,\n z = 16,\n D = 17,\n N = 18,\n F = 19,\n j = 20,\n G = 21,\n H = 22,\n W = 23,\n q = 24,\n Z = 25,\n Y = 26,\n V = 27,\n X = 28,\n J = 29,\n Q = 30,\n K = 31,\n $ = 852,\n tt = 592,\n et = 15;\n function rt(t) {\n return (t >>> 24 & 255) + (t >>> 8 & 65280) + ((65280 & t) << 8) + ((255 & t) << 24);\n }\n function it() {\n this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new i.Buf16(320), this.work = new i.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;\n }\n function nt(t) {\n var e;\n return t && t.state ? (e = t.state, t.total_in = t.total_out = e.total = 0, t.msg = \"\", e.wrap && (t.adler = 1 & e.wrap), e.mode = x, e.last = 0, e.havedict = 0, e.dmax = 32768, e.head = null, e.hold = 0, e.bits = 0, e.lencode = e.lendyn = new i.Buf32($), e.distcode = e.distdyn = new i.Buf32(tt), e.sane = 1, e.back = -1, p) : b;\n }\n function at(t) {\n var e;\n return t && t.state ? ((e = t.state).wsize = 0, e.whave = 0, e.wnext = 0, nt(t)) : b;\n }\n function ot(t, e) {\n var r, i;\n return t && t.state ? (i = t.state, e < 0 ? (r = 0, e = -e) : (r = 1 + (e >> 4), e < 48 && (e &= 15)), e && (e < 8 || e > 15) ? b : (null !== i.window && i.wbits !== e && (i.window = null), i.wrap = r, i.wbits = e, at(t))) : b;\n }\n function st(t, e) {\n var r, i;\n return t ? (i = new it(), t.state = i, i.window = null, (r = ot(t, e)) !== p && (t.state = null), r) : b;\n }\n var ht,\n lt,\n ft = !0;\n function ut(t) {\n if (ft) {\n var e;\n for (ht = new i.Buf32(512), lt = new i.Buf32(32), e = 0; e < 144;) t.lens[e++] = 8;\n for (; e < 256;) t.lens[e++] = 9;\n for (; e < 280;) t.lens[e++] = 7;\n for (; e < 288;) t.lens[e++] = 8;\n for (s(l, t.lens, 0, 288, ht, 0, t.work, {\n bits: 9\n }), e = 0; e < 32;) t.lens[e++] = 5;\n s(f, t.lens, 0, 32, lt, 0, t.work, {\n bits: 5\n }), ft = !1;\n }\n t.lencode = ht, t.lenbits = 9, t.distcode = lt, t.distbits = 5;\n }\n function ct(t, e, r, n) {\n var a,\n o = t.state;\n return null === o.window && (o.wsize = 1 << o.wbits, o.wnext = 0, o.whave = 0, o.window = new i.Buf8(o.wsize)), n >= o.wsize ? (i.arraySet(o.window, e, r - o.wsize, o.wsize, 0), o.wnext = 0, o.whave = o.wsize) : ((a = o.wsize - o.wnext) > n && (a = n), i.arraySet(o.window, e, r - n, a, o.wnext), (n -= a) ? (i.arraySet(o.window, e, r - n, n, 0), o.wnext = n, o.whave = o.wsize) : (o.wnext += a, o.wnext === o.wsize && (o.wnext = 0), o.whave < o.wsize && (o.whave += a))), 0;\n }\n r.inflateReset = at, r.inflateReset2 = ot, r.inflateResetKeep = nt, r.inflateInit = function (t) {\n return st(t, et);\n }, r.inflateInit2 = st, r.inflate = function (t, e) {\n var r,\n $,\n tt,\n et,\n it,\n nt,\n at,\n ot,\n st,\n ht,\n lt,\n ft,\n dt,\n pt,\n mt,\n gt,\n bt,\n _t,\n yt,\n wt,\n vt,\n xt,\n Et,\n kt,\n St = 0,\n Mt = new i.Buf8(4),\n At = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n if (!t || !t.state || !t.output || !t.input && 0 !== t.avail_in) return b;\n (r = t.state).mode === O && (r.mode = L), it = t.next_out, tt = t.output, at = t.avail_out, et = t.next_in, $ = t.input, nt = t.avail_in, ot = r.hold, st = r.bits, ht = nt, lt = at, xt = p;\n t: for (;;) switch (r.mode) {\n case x:\n if (0 === r.wrap) {\n r.mode = L;\n break;\n }\n for (; st < 16;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (2 & r.wrap && 35615 === ot) {\n r.check = 0, Mt[0] = 255 & ot, Mt[1] = ot >>> 8 & 255, r.check = a(r.check, Mt, 2, 0), ot = 0, st = 0, r.mode = E;\n break;\n }\n if (r.flags = 0, r.head && (r.head.done = !1), !(1 & r.wrap) || (((255 & ot) << 8) + (ot >> 8)) % 31) {\n t.msg = \"incorrect header check\", r.mode = Q;\n break;\n }\n if ((15 & ot) !== v) {\n t.msg = \"unknown compression method\", r.mode = Q;\n break;\n }\n if (st -= 4, vt = 8 + (15 & (ot >>>= 4)), 0 === r.wbits) r.wbits = vt;else if (vt > r.wbits) {\n t.msg = \"invalid window size\", r.mode = Q;\n break;\n }\n r.dmax = 1 << vt, t.adler = r.check = 1, r.mode = 512 & ot ? R : O, ot = 0, st = 0;\n break;\n case E:\n for (; st < 16;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (r.flags = ot, (255 & r.flags) !== v) {\n t.msg = \"unknown compression method\", r.mode = Q;\n break;\n }\n if (57344 & r.flags) {\n t.msg = \"unknown header flags set\", r.mode = Q;\n break;\n }\n r.head && (r.head.text = ot >> 8 & 1), 512 & r.flags && (Mt[0] = 255 & ot, Mt[1] = ot >>> 8 & 255, r.check = a(r.check, Mt, 2, 0)), ot = 0, st = 0, r.mode = k;\n case k:\n for (; st < 32;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n r.head && (r.head.time = ot), 512 & r.flags && (Mt[0] = 255 & ot, Mt[1] = ot >>> 8 & 255, Mt[2] = ot >>> 16 & 255, Mt[3] = ot >>> 24 & 255, r.check = a(r.check, Mt, 4, 0)), ot = 0, st = 0, r.mode = S;\n case S:\n for (; st < 16;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n r.head && (r.head.xflags = 255 & ot, r.head.os = ot >> 8), 512 & r.flags && (Mt[0] = 255 & ot, Mt[1] = ot >>> 8 & 255, r.check = a(r.check, Mt, 2, 0)), ot = 0, st = 0, r.mode = M;\n case M:\n if (1024 & r.flags) {\n for (; st < 16;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n r.length = ot, r.head && (r.head.extra_len = ot), 512 & r.flags && (Mt[0] = 255 & ot, Mt[1] = ot >>> 8 & 255, r.check = a(r.check, Mt, 2, 0)), ot = 0, st = 0;\n } else r.head && (r.head.extra = null);\n r.mode = A;\n case A:\n if (1024 & r.flags && ((ft = r.length) > nt && (ft = nt), ft && (r.head && (vt = r.head.extra_len - r.length, r.head.extra || (r.head.extra = new Array(r.head.extra_len)), i.arraySet(r.head.extra, $, et, ft, vt)), 512 & r.flags && (r.check = a(r.check, $, ft, et)), nt -= ft, et += ft, r.length -= ft), r.length)) break t;\n r.length = 0, r.mode = I;\n case I:\n if (2048 & r.flags) {\n if (0 === nt) break t;\n ft = 0;\n do {\n vt = $[et + ft++], r.head && vt && r.length < 65536 && (r.head.name += String.fromCharCode(vt));\n } while (vt && ft < nt);\n if (512 & r.flags && (r.check = a(r.check, $, ft, et)), nt -= ft, et += ft, vt) break t;\n } else r.head && (r.head.name = null);\n r.length = 0, r.mode = B;\n case B:\n if (4096 & r.flags) {\n if (0 === nt) break t;\n ft = 0;\n do {\n vt = $[et + ft++], r.head && vt && r.length < 65536 && (r.head.comment += String.fromCharCode(vt));\n } while (vt && ft < nt);\n if (512 & r.flags && (r.check = a(r.check, $, ft, et)), nt -= ft, et += ft, vt) break t;\n } else r.head && (r.head.comment = null);\n r.mode = T;\n case T:\n if (512 & r.flags) {\n for (; st < 16;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (ot !== (65535 & r.check)) {\n t.msg = \"header crc mismatch\", r.mode = Q;\n break;\n }\n ot = 0, st = 0;\n }\n r.head && (r.head.hcrc = r.flags >> 9 & 1, r.head.done = !0), t.adler = r.check = 0, r.mode = O;\n break;\n case R:\n for (; st < 32;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n t.adler = r.check = rt(ot), ot = 0, st = 0, r.mode = P;\n case P:\n if (0 === r.havedict) return t.next_out = it, t.avail_out = at, t.next_in = et, t.avail_in = nt, r.hold = ot, r.bits = st, g;\n t.adler = r.check = 1, r.mode = O;\n case O:\n if (e === c || e === d) break t;\n case L:\n if (r.last) {\n ot >>>= 7 & st, st -= 7 & st, r.mode = V;\n break;\n }\n for (; st < 3;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n switch (r.last = 1 & ot, st -= 1, 3 & (ot >>>= 1)) {\n case 0:\n r.mode = C;\n break;\n case 1:\n if (ut(r), r.mode = j, e === d) {\n ot >>>= 2, st -= 2;\n break t;\n }\n break;\n case 2:\n r.mode = D;\n break;\n case 3:\n t.msg = \"invalid block type\", r.mode = Q;\n }\n ot >>>= 2, st -= 2;\n break;\n case C:\n for (ot >>>= 7 & st, st -= 7 & st; st < 32;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if ((65535 & ot) != (ot >>> 16 ^ 65535)) {\n t.msg = \"invalid stored block lengths\", r.mode = Q;\n break;\n }\n if (r.length = 65535 & ot, ot = 0, st = 0, r.mode = U, e === d) break t;\n case U:\n r.mode = z;\n case z:\n if (ft = r.length) {\n if (ft > nt && (ft = nt), ft > at && (ft = at), 0 === ft) break t;\n i.arraySet(tt, $, et, ft, it), nt -= ft, et += ft, at -= ft, it += ft, r.length -= ft;\n break;\n }\n r.mode = O;\n break;\n case D:\n for (; st < 14;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (r.nlen = 257 + (31 & ot), ot >>>= 5, st -= 5, r.ndist = 1 + (31 & ot), ot >>>= 5, st -= 5, r.ncode = 4 + (15 & ot), ot >>>= 4, st -= 4, r.nlen > 286 || r.ndist > 30) {\n t.msg = \"too many length or distance symbols\", r.mode = Q;\n break;\n }\n r.have = 0, r.mode = N;\n case N:\n for (; r.have < r.ncode;) {\n for (; st < 3;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n r.lens[At[r.have++]] = 7 & ot, ot >>>= 3, st -= 3;\n }\n for (; r.have < 19;) r.lens[At[r.have++]] = 0;\n if (r.lencode = r.lendyn, r.lenbits = 7, Et = {\n bits: r.lenbits\n }, xt = s(h, r.lens, 0, 19, r.lencode, 0, r.work, Et), r.lenbits = Et.bits, xt) {\n t.msg = \"invalid code lengths set\", r.mode = Q;\n break;\n }\n r.have = 0, r.mode = F;\n case F:\n for (; r.have < r.nlen + r.ndist;) {\n for (; gt = (St = r.lencode[ot & (1 << r.lenbits) - 1]) >>> 16 & 255, bt = 65535 & St, !((mt = St >>> 24) <= st);) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (bt < 16) ot >>>= mt, st -= mt, r.lens[r.have++] = bt;else {\n if (16 === bt) {\n for (kt = mt + 2; st < kt;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (ot >>>= mt, st -= mt, 0 === r.have) {\n t.msg = \"invalid bit length repeat\", r.mode = Q;\n break;\n }\n vt = r.lens[r.have - 1], ft = 3 + (3 & ot), ot >>>= 2, st -= 2;\n } else if (17 === bt) {\n for (kt = mt + 3; st < kt;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n st -= mt, vt = 0, ft = 3 + (7 & (ot >>>= mt)), ot >>>= 3, st -= 3;\n } else {\n for (kt = mt + 7; st < kt;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n st -= mt, vt = 0, ft = 11 + (127 & (ot >>>= mt)), ot >>>= 7, st -= 7;\n }\n if (r.have + ft > r.nlen + r.ndist) {\n t.msg = \"invalid bit length repeat\", r.mode = Q;\n break;\n }\n for (; ft--;) r.lens[r.have++] = vt;\n }\n }\n if (r.mode === Q) break;\n if (0 === r.lens[256]) {\n t.msg = \"invalid code -- missing end-of-block\", r.mode = Q;\n break;\n }\n if (r.lenbits = 9, Et = {\n bits: r.lenbits\n }, xt = s(l, r.lens, 0, r.nlen, r.lencode, 0, r.work, Et), r.lenbits = Et.bits, xt) {\n t.msg = \"invalid literal/lengths set\", r.mode = Q;\n break;\n }\n if (r.distbits = 6, r.distcode = r.distdyn, Et = {\n bits: r.distbits\n }, xt = s(f, r.lens, r.nlen, r.ndist, r.distcode, 0, r.work, Et), r.distbits = Et.bits, xt) {\n t.msg = \"invalid distances set\", r.mode = Q;\n break;\n }\n if (r.mode = j, e === d) break t;\n case j:\n r.mode = G;\n case G:\n if (nt >= 6 && at >= 258) {\n t.next_out = it, t.avail_out = at, t.next_in = et, t.avail_in = nt, r.hold = ot, r.bits = st, o(t, lt), it = t.next_out, tt = t.output, at = t.avail_out, et = t.next_in, $ = t.input, nt = t.avail_in, ot = r.hold, st = r.bits, r.mode === O && (r.back = -1);\n break;\n }\n for (r.back = 0; gt = (St = r.lencode[ot & (1 << r.lenbits) - 1]) >>> 16 & 255, bt = 65535 & St, !((mt = St >>> 24) <= st);) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (gt && 0 == (240 & gt)) {\n for (_t = mt, yt = gt, wt = bt; gt = (St = r.lencode[wt + ((ot & (1 << _t + yt) - 1) >> _t)]) >>> 16 & 255, bt = 65535 & St, !(_t + (mt = St >>> 24) <= st);) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n ot >>>= _t, st -= _t, r.back += _t;\n }\n if (ot >>>= mt, st -= mt, r.back += mt, r.length = bt, 0 === gt) {\n r.mode = Y;\n break;\n }\n if (32 & gt) {\n r.back = -1, r.mode = O;\n break;\n }\n if (64 & gt) {\n t.msg = \"invalid literal/length code\", r.mode = Q;\n break;\n }\n r.extra = 15 & gt, r.mode = H;\n case H:\n if (r.extra) {\n for (kt = r.extra; st < kt;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n r.length += ot & (1 << r.extra) - 1, ot >>>= r.extra, st -= r.extra, r.back += r.extra;\n }\n r.was = r.length, r.mode = W;\n case W:\n for (; gt = (St = r.distcode[ot & (1 << r.distbits) - 1]) >>> 16 & 255, bt = 65535 & St, !((mt = St >>> 24) <= st);) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (0 == (240 & gt)) {\n for (_t = mt, yt = gt, wt = bt; gt = (St = r.distcode[wt + ((ot & (1 << _t + yt) - 1) >> _t)]) >>> 16 & 255, bt = 65535 & St, !(_t + (mt = St >>> 24) <= st);) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n ot >>>= _t, st -= _t, r.back += _t;\n }\n if (ot >>>= mt, st -= mt, r.back += mt, 64 & gt) {\n t.msg = \"invalid distance code\", r.mode = Q;\n break;\n }\n r.offset = bt, r.extra = 15 & gt, r.mode = q;\n case q:\n if (r.extra) {\n for (kt = r.extra; st < kt;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n r.offset += ot & (1 << r.extra) - 1, ot >>>= r.extra, st -= r.extra, r.back += r.extra;\n }\n if (r.offset > r.dmax) {\n t.msg = \"invalid distance too far back\", r.mode = Q;\n break;\n }\n r.mode = Z;\n case Z:\n if (0 === at) break t;\n if (ft = lt - at, r.offset > ft) {\n if ((ft = r.offset - ft) > r.whave && r.sane) {\n t.msg = \"invalid distance too far back\", r.mode = Q;\n break;\n }\n ft > r.wnext ? (ft -= r.wnext, dt = r.wsize - ft) : dt = r.wnext - ft, ft > r.length && (ft = r.length), pt = r.window;\n } else pt = tt, dt = it - r.offset, ft = r.length;\n ft > at && (ft = at), at -= ft, r.length -= ft;\n do {\n tt[it++] = pt[dt++];\n } while (--ft);\n 0 === r.length && (r.mode = G);\n break;\n case Y:\n if (0 === at) break t;\n tt[it++] = r.length, at--, r.mode = G;\n break;\n case V:\n if (r.wrap) {\n for (; st < 32;) {\n if (0 === nt) break t;\n nt--, ot |= $[et++] << st, st += 8;\n }\n if (lt -= at, t.total_out += lt, r.total += lt, lt && (t.adler = r.check = r.flags ? a(r.check, tt, lt, it - lt) : n(r.check, tt, lt, it - lt)), lt = at, (r.flags ? ot : rt(ot)) !== r.check) {\n t.msg = \"incorrect data check\", r.mode = Q;\n break;\n }\n ot = 0, st = 0;\n }\n r.mode = X;\n case X:\n if (r.wrap && r.flags) {\n for (; st < 32;) {\n if (0 === nt) break t;\n nt--, ot += $[et++] << st, st += 8;\n }\n if (ot !== (4294967295 & r.total)) {\n t.msg = \"incorrect length check\", r.mode = Q;\n break;\n }\n ot = 0, st = 0;\n }\n r.mode = J;\n case J:\n xt = m;\n break t;\n case Q:\n xt = _;\n break t;\n case K:\n return y;\n default:\n return b;\n }\n return t.next_out = it, t.avail_out = at, t.next_in = et, t.avail_in = nt, r.hold = ot, r.bits = st, (r.wsize || lt !== t.avail_out && r.mode < Q && (r.mode < V || e !== u)) && ct(t, t.output, t.next_out, lt - t.avail_out) ? (r.mode = K, y) : (ht -= t.avail_in, lt -= t.avail_out, t.total_in += ht, t.total_out += lt, r.total += lt, r.wrap && lt && (t.adler = r.check = r.flags ? a(r.check, tt, lt, t.next_out - lt) : n(r.check, tt, lt, t.next_out - lt)), t.data_type = r.bits + (r.last ? 64 : 0) + (r.mode === O ? 128 : 0) + (r.mode === j || r.mode === U ? 256 : 0), (0 === ht && 0 === lt || e === u) && xt === p && (xt = w), xt);\n }, r.inflateEnd = function (t) {\n if (!t || !t.state) return b;\n var e = t.state;\n return e.window && (e.window = null), t.state = null, p;\n }, r.inflateGetHeader = function (t, e) {\n var r;\n return t && t.state ? 0 == (2 & (r = t.state).wrap) ? b : (r.head = e, e.done = !1, p) : b;\n }, r.inflateSetDictionary = function (t, e) {\n var r,\n i = e.length;\n return t && t.state ? 0 !== (r = t.state).wrap && r.mode !== P ? b : r.mode === P && n(1, e, i, 0) !== r.check ? _ : ct(t, e, i, i) ? (r.mode = K, y) : (r.havedict = 1, p) : b;\n }, r.inflateInfo = \"pako inflate (from Nodeca project)\";\n }, {\n \"../utils/common\": 49,\n \"./adler32\": 50,\n \"./crc32\": 52,\n \"./inffast\": 54,\n \"./inftrees\": 56\n }],\n 56: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"../utils/common\"),\n n = 15,\n a = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0],\n o = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78],\n s = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0],\n h = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];\n e.exports = function (t, e, r, l, f, u, c, d) {\n var p,\n m,\n g,\n b,\n _,\n y,\n w,\n v,\n x,\n E = d.bits,\n k = 0,\n S = 0,\n M = 0,\n A = 0,\n I = 0,\n B = 0,\n T = 0,\n R = 0,\n P = 0,\n O = 0,\n L = null,\n C = 0,\n U = new i.Buf16(16),\n z = new i.Buf16(16),\n D = null,\n N = 0;\n for (k = 0; k <= n; k++) U[k] = 0;\n for (S = 0; S < l; S++) U[e[r + S]]++;\n for (I = E, A = n; A >= 1 && 0 === U[A]; A--);\n if (I > A && (I = A), 0 === A) return f[u++] = 20971520, f[u++] = 20971520, d.bits = 1, 0;\n for (M = 1; M < A && 0 === U[M]; M++);\n for (I < M && (I = M), R = 1, k = 1; k <= n; k++) if (R <<= 1, (R -= U[k]) < 0) return -1;\n if (R > 0 && (0 === t || 1 !== A)) return -1;\n for (z[1] = 0, k = 1; k < n; k++) z[k + 1] = z[k] + U[k];\n for (S = 0; S < l; S++) 0 !== e[r + S] && (c[z[e[r + S]]++] = S);\n if (0 === t ? (L = D = c, y = 19) : 1 === t ? (L = a, C -= 257, D = o, N -= 257, y = 256) : (L = s, D = h, y = -1), O = 0, S = 0, k = M, _ = u, B = I, T = 0, g = -1, b = (P = 1 << I) - 1, 1 === t && P > 852 || 2 === t && P > 592) return 1;\n for (;;) {\n w = k - T, c[S] < y ? (v = 0, x = c[S]) : c[S] > y ? (v = D[N + c[S]], x = L[C + c[S]]) : (v = 96, x = 0), p = 1 << k - T, M = m = 1 << B;\n do {\n f[_ + (O >> T) + (m -= p)] = w << 24 | v << 16 | x | 0;\n } while (0 !== m);\n for (p = 1 << k - 1; O & p;) p >>= 1;\n if (0 !== p ? (O &= p - 1, O += p) : O = 0, S++, 0 == --U[k]) {\n if (k === A) break;\n k = e[r + c[S]];\n }\n if (k > I && (O & b) !== g) {\n for (0 === T && (T = I), _ += M, R = 1 << (B = k - T); B + T < A && !((R -= U[B + T]) <= 0);) B++, R <<= 1;\n if (P += 1 << B, 1 === t && P > 852 || 2 === t && P > 592) return 1;\n f[g = O & b] = I << 24 | B << 16 | _ - u | 0;\n }\n }\n return 0 !== O && (f[_ + O] = k - T << 24 | 64 << 16 | 0), d.bits = I, 0;\n };\n }, {\n \"../utils/common\": 49\n }],\n 57: [function (t, e, r) {\n \"use strict\";\n\n e.exports = {\n 2: \"need dictionary\",\n 1: \"stream end\",\n 0: \"\",\n \"-1\": \"file error\",\n \"-2\": \"stream error\",\n \"-3\": \"data error\",\n \"-4\": \"insufficient memory\",\n \"-5\": \"buffer error\",\n \"-6\": \"incompatible version\"\n };\n }, {}],\n 58: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"../utils/common\"),\n n = 4,\n a = 0,\n o = 1,\n s = 2;\n function h(t) {\n for (var e = t.length; --e >= 0;) t[e] = 0;\n }\n var l = 0,\n f = 1,\n u = 2,\n c = 29,\n d = 256,\n p = d + 1 + c,\n m = 30,\n g = 19,\n b = 2 * p + 1,\n _ = 15,\n y = 16,\n w = 7,\n v = 256,\n x = 16,\n E = 17,\n k = 18,\n S = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0],\n M = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13],\n A = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7],\n I = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],\n B = new Array(2 * (p + 2));\n h(B);\n var T = new Array(2 * m);\n h(T);\n var R = new Array(512);\n h(R);\n var P = new Array(256);\n h(P);\n var O = new Array(c);\n h(O);\n var L,\n C,\n U,\n z = new Array(m);\n function D(t, e, r, i, n) {\n this.static_tree = t, this.extra_bits = e, this.extra_base = r, this.elems = i, this.max_length = n, this.has_stree = t && t.length;\n }\n function N(t, e) {\n this.dyn_tree = t, this.max_code = 0, this.stat_desc = e;\n }\n function F(t) {\n return t < 256 ? R[t] : R[256 + (t >>> 7)];\n }\n function j(t, e) {\n t.pending_buf[t.pending++] = 255 & e, t.pending_buf[t.pending++] = e >>> 8 & 255;\n }\n function G(t, e, r) {\n t.bi_valid > y - r ? (t.bi_buf |= e << t.bi_valid & 65535, j(t, t.bi_buf), t.bi_buf = e >> y - t.bi_valid, t.bi_valid += r - y) : (t.bi_buf |= e << t.bi_valid & 65535, t.bi_valid += r);\n }\n function H(t, e, r) {\n G(t, r[2 * e], r[2 * e + 1]);\n }\n function W(t, e) {\n var r = 0;\n do {\n r |= 1 & t, t >>>= 1, r <<= 1;\n } while (--e > 0);\n return r >>> 1;\n }\n function q(t, e, r) {\n var i,\n n,\n a = new Array(_ + 1),\n o = 0;\n for (i = 1; i <= _; i++) a[i] = o = o + r[i - 1] << 1;\n for (n = 0; n <= e; n++) {\n var s = t[2 * n + 1];\n 0 !== s && (t[2 * n] = W(a[s]++, s));\n }\n }\n function Z(t) {\n var e;\n for (e = 0; e < p; e++) t.dyn_ltree[2 * e] = 0;\n for (e = 0; e < m; e++) t.dyn_dtree[2 * e] = 0;\n for (e = 0; e < g; e++) t.bl_tree[2 * e] = 0;\n t.dyn_ltree[2 * v] = 1, t.opt_len = t.static_len = 0, t.last_lit = t.matches = 0;\n }\n function Y(t) {\n t.bi_valid > 8 ? j(t, t.bi_buf) : t.bi_valid > 0 && (t.pending_buf[t.pending++] = t.bi_buf), t.bi_buf = 0, t.bi_valid = 0;\n }\n function V(t, e, r, i) {\n var n = 2 * e,\n a = 2 * r;\n return t[n] < t[a] || t[n] === t[a] && i[e] <= i[r];\n }\n function X(t, e, r) {\n for (var i = t.heap[r], n = r << 1; n <= t.heap_len && (n < t.heap_len && V(e, t.heap[n + 1], t.heap[n], t.depth) && n++, !V(e, i, t.heap[n], t.depth));) t.heap[r] = t.heap[n], r = n, n <<= 1;\n t.heap[r] = i;\n }\n function J(t, e, r) {\n var i,\n n,\n a,\n o,\n s = 0;\n if (0 !== t.last_lit) do {\n i = t.pending_buf[t.d_buf + 2 * s] << 8 | t.pending_buf[t.d_buf + 2 * s + 1], n = t.pending_buf[t.l_buf + s], s++, 0 === i ? H(t, n, e) : (H(t, (a = P[n]) + d + 1, e), 0 !== (o = S[a]) && G(t, n -= O[a], o), H(t, a = F(--i), r), 0 !== (o = M[a]) && G(t, i -= z[a], o));\n } while (s < t.last_lit);\n H(t, v, e);\n }\n function Q(t, e) {\n var r,\n i,\n n,\n a = e.dyn_tree,\n o = e.stat_desc.static_tree,\n s = e.stat_desc.has_stree,\n h = e.stat_desc.elems,\n l = -1;\n for (t.heap_len = 0, t.heap_max = b, r = 0; r < h; r++) 0 !== a[2 * r] ? (t.heap[++t.heap_len] = l = r, t.depth[r] = 0) : a[2 * r + 1] = 0;\n for (; t.heap_len < 2;) a[2 * (n = t.heap[++t.heap_len] = l < 2 ? ++l : 0)] = 1, t.depth[n] = 0, t.opt_len--, s && (t.static_len -= o[2 * n + 1]);\n for (e.max_code = l, r = t.heap_len >> 1; r >= 1; r--) X(t, a, r);\n n = h;\n do {\n r = t.heap[1], t.heap[1] = t.heap[t.heap_len--], X(t, a, 1), i = t.heap[1], t.heap[--t.heap_max] = r, t.heap[--t.heap_max] = i, a[2 * n] = a[2 * r] + a[2 * i], t.depth[n] = (t.depth[r] >= t.depth[i] ? t.depth[r] : t.depth[i]) + 1, a[2 * r + 1] = a[2 * i + 1] = n, t.heap[1] = n++, X(t, a, 1);\n } while (t.heap_len >= 2);\n t.heap[--t.heap_max] = t.heap[1], function (t, e) {\n var r,\n i,\n n,\n a,\n o,\n s,\n h = e.dyn_tree,\n l = e.max_code,\n f = e.stat_desc.static_tree,\n u = e.stat_desc.has_stree,\n c = e.stat_desc.extra_bits,\n d = e.stat_desc.extra_base,\n p = e.stat_desc.max_length,\n m = 0;\n for (a = 0; a <= _; a++) t.bl_count[a] = 0;\n for (h[2 * t.heap[t.heap_max] + 1] = 0, r = t.heap_max + 1; r < b; r++) (a = h[2 * h[2 * (i = t.heap[r]) + 1] + 1] + 1) > p && (a = p, m++), h[2 * i + 1] = a, i > l || (t.bl_count[a]++, o = 0, i >= d && (o = c[i - d]), s = h[2 * i], t.opt_len += s * (a + o), u && (t.static_len += s * (f[2 * i + 1] + o)));\n if (0 !== m) {\n do {\n for (a = p - 1; 0 === t.bl_count[a];) a--;\n t.bl_count[a]--, t.bl_count[a + 1] += 2, t.bl_count[p]--, m -= 2;\n } while (m > 0);\n for (a = p; 0 !== a; a--) for (i = t.bl_count[a]; 0 !== i;) (n = t.heap[--r]) > l || (h[2 * n + 1] !== a && (t.opt_len += (a - h[2 * n + 1]) * h[2 * n], h[2 * n + 1] = a), i--);\n }\n }(t, e), q(a, l, t.bl_count);\n }\n function K(t, e, r) {\n var i,\n n,\n a = -1,\n o = e[1],\n s = 0,\n h = 7,\n l = 4;\n for (0 === o && (h = 138, l = 3), e[2 * (r + 1) + 1] = 65535, i = 0; i <= r; i++) n = o, o = e[2 * (i + 1) + 1], ++s < h && n === o || (s < l ? t.bl_tree[2 * n] += s : 0 !== n ? (n !== a && t.bl_tree[2 * n]++, t.bl_tree[2 * x]++) : s <= 10 ? t.bl_tree[2 * E]++ : t.bl_tree[2 * k]++, s = 0, a = n, 0 === o ? (h = 138, l = 3) : n === o ? (h = 6, l = 3) : (h = 7, l = 4));\n }\n function $(t, e, r) {\n var i,\n n,\n a = -1,\n o = e[1],\n s = 0,\n h = 7,\n l = 4;\n for (0 === o && (h = 138, l = 3), i = 0; i <= r; i++) if (n = o, o = e[2 * (i + 1) + 1], !(++s < h && n === o)) {\n if (s < l) do {\n H(t, n, t.bl_tree);\n } while (0 != --s);else 0 !== n ? (n !== a && (H(t, n, t.bl_tree), s--), H(t, x, t.bl_tree), G(t, s - 3, 2)) : s <= 10 ? (H(t, E, t.bl_tree), G(t, s - 3, 3)) : (H(t, k, t.bl_tree), G(t, s - 11, 7));\n s = 0, a = n, 0 === o ? (h = 138, l = 3) : n === o ? (h = 6, l = 3) : (h = 7, l = 4);\n }\n }\n h(z);\n var tt = !1;\n function et(t, e, r, n) {\n G(t, (l << 1) + (n ? 1 : 0), 3), function (t, e, r, n) {\n Y(t), n && (j(t, r), j(t, ~r)), i.arraySet(t.pending_buf, t.window, e, r, t.pending), t.pending += r;\n }(t, e, r, !0);\n }\n r._tr_init = function (t) {\n tt || (function () {\n var t,\n e,\n r,\n i,\n n,\n a = new Array(_ + 1);\n for (r = 0, i = 0; i < c - 1; i++) for (O[i] = r, t = 0; t < 1 << S[i]; t++) P[r++] = i;\n for (P[r - 1] = i, n = 0, i = 0; i < 16; i++) for (z[i] = n, t = 0; t < 1 << M[i]; t++) R[n++] = i;\n for (n >>= 7; i < m; i++) for (z[i] = n << 7, t = 0; t < 1 << M[i] - 7; t++) R[256 + n++] = i;\n for (e = 0; e <= _; e++) a[e] = 0;\n for (t = 0; t <= 143;) B[2 * t + 1] = 8, t++, a[8]++;\n for (; t <= 255;) B[2 * t + 1] = 9, t++, a[9]++;\n for (; t <= 279;) B[2 * t + 1] = 7, t++, a[7]++;\n for (; t <= 287;) B[2 * t + 1] = 8, t++, a[8]++;\n for (q(B, p + 1, a), t = 0; t < m; t++) T[2 * t + 1] = 5, T[2 * t] = W(t, 5);\n L = new D(B, S, d + 1, p, _), C = new D(T, M, 0, m, _), U = new D(new Array(0), A, 0, g, w);\n }(), tt = !0), t.l_desc = new N(t.dyn_ltree, L), t.d_desc = new N(t.dyn_dtree, C), t.bl_desc = new N(t.bl_tree, U), t.bi_buf = 0, t.bi_valid = 0, Z(t);\n }, r._tr_stored_block = et, r._tr_flush_block = function (t, e, r, i) {\n var h,\n l,\n c = 0;\n t.level > 0 ? (t.strm.data_type === s && (t.strm.data_type = function (t) {\n var e,\n r = 4093624447;\n for (e = 0; e <= 31; e++, r >>>= 1) if (1 & r && 0 !== t.dyn_ltree[2 * e]) return a;\n if (0 !== t.dyn_ltree[18] || 0 !== t.dyn_ltree[20] || 0 !== t.dyn_ltree[26]) return o;\n for (e = 32; e < d; e++) if (0 !== t.dyn_ltree[2 * e]) return o;\n return a;\n }(t)), Q(t, t.l_desc), Q(t, t.d_desc), c = function (t) {\n var e;\n for (K(t, t.dyn_ltree, t.l_desc.max_code), K(t, t.dyn_dtree, t.d_desc.max_code), Q(t, t.bl_desc), e = g - 1; e >= 3 && 0 === t.bl_tree[2 * I[e] + 1]; e--);\n return t.opt_len += 3 * (e + 1) + 5 + 5 + 4, e;\n }(t), h = t.opt_len + 3 + 7 >>> 3, (l = t.static_len + 3 + 7 >>> 3) <= h && (h = l)) : h = l = r + 5, r + 4 <= h && -1 !== e ? et(t, e, r, i) : t.strategy === n || l === h ? (G(t, (f << 1) + (i ? 1 : 0), 3), J(t, B, T)) : (G(t, (u << 1) + (i ? 1 : 0), 3), function (t, e, r, i) {\n var n;\n for (G(t, e - 257, 5), G(t, r - 1, 5), G(t, i - 4, 4), n = 0; n < i; n++) G(t, t.bl_tree[2 * I[n] + 1], 3);\n $(t, t.dyn_ltree, e - 1), $(t, t.dyn_dtree, r - 1);\n }(t, t.l_desc.max_code + 1, t.d_desc.max_code + 1, c + 1), J(t, t.dyn_ltree, t.dyn_dtree)), Z(t), i && Y(t);\n }, r._tr_tally = function (t, e, r) {\n return t.pending_buf[t.d_buf + 2 * t.last_lit] = e >>> 8 & 255, t.pending_buf[t.d_buf + 2 * t.last_lit + 1] = 255 & e, t.pending_buf[t.l_buf + t.last_lit] = 255 & r, t.last_lit++, 0 === e ? t.dyn_ltree[2 * r]++ : (t.matches++, e--, t.dyn_ltree[2 * (P[r] + d + 1)]++, t.dyn_dtree[2 * F(e)]++), t.last_lit === t.lit_bufsize - 1;\n }, r._tr_align = function (t) {\n G(t, f << 1, 3), H(t, v, B), function (t) {\n 16 === t.bi_valid ? (j(t, t.bi_buf), t.bi_buf = 0, t.bi_valid = 0) : t.bi_valid >= 8 && (t.pending_buf[t.pending++] = 255 & t.bi_buf, t.bi_buf >>= 8, t.bi_valid -= 8);\n }(t);\n };\n }, {\n \"../utils/common\": 49\n }],\n 59: [function (t, e, r) {\n \"use strict\";\n\n e.exports = function () {\n this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = \"\", this.state = null, this.data_type = 2, this.adler = 0;\n };\n }, {}],\n 60: [function (t, e, r) {\n var i,\n n,\n a = e.exports = {};\n function o() {\n throw new Error(\"setTimeout has not been defined\");\n }\n function s() {\n throw new Error(\"clearTimeout has not been defined\");\n }\n function h(t) {\n if (i === setTimeout) return setTimeout(t, 0);\n if ((i === o || !i) && setTimeout) return i = setTimeout, setTimeout(t, 0);\n try {\n return i(t, 0);\n } catch (e) {\n try {\n return i.call(null, t, 0);\n } catch (e) {\n return i.call(this, t, 0);\n }\n }\n }\n !function () {\n try {\n i = \"function\" == typeof setTimeout ? setTimeout : o;\n } catch (t) {\n i = o;\n }\n try {\n n = \"function\" == typeof clearTimeout ? clearTimeout : s;\n } catch (t) {\n n = s;\n }\n }();\n var l,\n f = [],\n u = !1,\n c = -1;\n function d() {\n u && l && (u = !1, l.length ? f = l.concat(f) : c = -1, f.length && p());\n }\n function p() {\n if (!u) {\n var t = h(d);\n u = !0;\n for (var e = f.length; e;) {\n for (l = f, f = []; ++c < e;) l && l[c].run();\n c = -1, e = f.length;\n }\n l = null, u = !1, function (t) {\n if (n === clearTimeout) return clearTimeout(t);\n if ((n === s || !n) && clearTimeout) return n = clearTimeout, clearTimeout(t);\n try {\n n(t);\n } catch (e) {\n try {\n return n.call(null, t);\n } catch (e) {\n return n.call(this, t);\n }\n }\n }(t);\n }\n }\n function m(t, e) {\n this.fun = t, this.array = e;\n }\n function g() {}\n a.nextTick = function (t) {\n var e = new Array(arguments.length - 1);\n if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r];\n f.push(new m(t, e)), 1 !== f.length || u || h(p);\n }, m.prototype.run = function () {\n this.fun.apply(null, this.array);\n }, a.title = \"browser\", a.browser = !0, a.env = {}, a.argv = [], a.version = \"\", a.versions = {}, a.on = g, a.addListener = g, a.once = g, a.off = g, a.removeListener = g, a.removeAllListeners = g, a.emit = g, a.prependListener = g, a.prependOnceListener = g, a.listeners = function (t) {\n return [];\n }, a.binding = function (t) {\n throw new Error(\"process.binding is not supported\");\n }, a.cwd = function () {\n return \"/\";\n }, a.chdir = function (t) {\n throw new Error(\"process.chdir is not supported\");\n }, a.umask = function () {\n return 0;\n };\n }, {}],\n 61: [function (t, e, r) {\n e.exports = n;\n var i = t(\"events\").EventEmitter;\n function n() {\n i.call(this);\n }\n t(\"inherits\")(n, i), n.Readable = t(\"readable-stream/lib/_stream_readable.js\"), n.Writable = t(\"readable-stream/lib/_stream_writable.js\"), n.Duplex = t(\"readable-stream/lib/_stream_duplex.js\"), n.Transform = t(\"readable-stream/lib/_stream_transform.js\"), n.PassThrough = t(\"readable-stream/lib/_stream_passthrough.js\"), n.finished = t(\"readable-stream/lib/internal/streams/end-of-stream.js\"), n.pipeline = t(\"readable-stream/lib/internal/streams/pipeline.js\"), n.Stream = n, n.prototype.pipe = function (t, e) {\n var r = this;\n function n(e) {\n t.writable && !1 === t.write(e) && r.pause && r.pause();\n }\n function a() {\n r.readable && r.resume && r.resume();\n }\n r.on(\"data\", n), t.on(\"drain\", a), t._isStdio || e && !1 === e.end || (r.on(\"end\", s), r.on(\"close\", h));\n var o = !1;\n function s() {\n o || (o = !0, t.end());\n }\n function h() {\n o || (o = !0, \"function\" == typeof t.destroy && t.destroy());\n }\n function l(t) {\n if (f(), 0 === i.listenerCount(this, \"error\")) throw t;\n }\n function f() {\n r.removeListener(\"data\", n), t.removeListener(\"drain\", a), r.removeListener(\"end\", s), r.removeListener(\"close\", h), r.removeListener(\"error\", l), t.removeListener(\"error\", l), r.removeListener(\"end\", f), r.removeListener(\"close\", f), t.removeListener(\"close\", f);\n }\n return r.on(\"error\", l), t.on(\"error\", l), r.on(\"end\", f), r.on(\"close\", f), t.on(\"close\", f), t.emit(\"pipe\", r), t;\n };\n }, {\n events: 38,\n inherits: 45,\n \"readable-stream/lib/_stream_duplex.js\": 63,\n \"readable-stream/lib/_stream_passthrough.js\": 64,\n \"readable-stream/lib/_stream_readable.js\": 65,\n \"readable-stream/lib/_stream_transform.js\": 66,\n \"readable-stream/lib/_stream_writable.js\": 67,\n \"readable-stream/lib/internal/streams/end-of-stream.js\": 71,\n \"readable-stream/lib/internal/streams/pipeline.js\": 73\n }],\n 62: [function (t, e, r) {\n \"use strict\";\n\n var i = {};\n function n(t, e, r) {\n r || (r = Error);\n var n = function (t) {\n function r(r, i, n) {\n return t.call(this, function (t, r, i) {\n return \"string\" == typeof e ? e : e(t, r, i);\n }(r, i, n)) || this;\n }\n return n = t, (i = r).prototype = Object.create(n.prototype), i.prototype.constructor = i, i.__proto__ = n, r;\n var i, n;\n }(r);\n n.prototype.name = r.name, n.prototype.code = t, i[t] = n;\n }\n function a(t, e) {\n if (Array.isArray(t)) {\n var r = t.length;\n return t = t.map(function (t) {\n return String(t);\n }), r > 2 ? \"one of \".concat(e, \" \").concat(t.slice(0, r - 1).join(\", \"), \", or \") + t[r - 1] : 2 === r ? \"one of \".concat(e, \" \").concat(t[0], \" or \").concat(t[1]) : \"of \".concat(e, \" \").concat(t[0]);\n }\n return \"of \".concat(e, \" \").concat(String(t));\n }\n n(\"ERR_INVALID_OPT_VALUE\", function (t, e) {\n return 'The value \"' + e + '\" is invalid for option \"' + t + '\"';\n }, TypeError), n(\"ERR_INVALID_ARG_TYPE\", function (t, e, r) {\n var i, n, o, s;\n if (\"string\" == typeof e && (o = \"not \", e.substr(!s || s < 0 ? 0 : +s, o.length) === o) ? (i = \"must not be\", e = e.replace(/^not /, \"\")) : i = \"must be\", function (t, e, r) {\n return (void 0 === r || r > t.length) && (r = t.length), t.substring(r - e.length, r) === e;\n }(t, \" argument\")) n = \"The \".concat(t, \" \").concat(i, \" \").concat(a(e, \"type\"));else {\n var h = function (t, e, r) {\n return \"number\" != typeof r && (r = 0), !(r + e.length > t.length) && -1 !== t.indexOf(e, r);\n }(t, \".\") ? \"property\" : \"argument\";\n n = 'The \"'.concat(t, '\" ').concat(h, \" \").concat(i, \" \").concat(a(e, \"type\"));\n }\n return n + \". Received type \".concat(typeof r);\n }, TypeError), n(\"ERR_STREAM_PUSH_AFTER_EOF\", \"stream.push() after EOF\"), n(\"ERR_METHOD_NOT_IMPLEMENTED\", function (t) {\n return \"The \" + t + \" method is not implemented\";\n }), n(\"ERR_STREAM_PREMATURE_CLOSE\", \"Premature close\"), n(\"ERR_STREAM_DESTROYED\", function (t) {\n return \"Cannot call \" + t + \" after a stream was destroyed\";\n }), n(\"ERR_MULTIPLE_CALLBACK\", \"Callback called multiple times\"), n(\"ERR_STREAM_CANNOT_PIPE\", \"Cannot pipe, not readable\"), n(\"ERR_STREAM_WRITE_AFTER_END\", \"write after end\"), n(\"ERR_STREAM_NULL_VALUES\", \"May not write null values to stream\", TypeError), n(\"ERR_UNKNOWN_ENCODING\", function (t) {\n return \"Unknown encoding: \" + t;\n }, TypeError), n(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\", \"stream.unshift() after end event\"), e.exports.codes = i;\n }, {}],\n 63: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n var i = Object.keys || function (t) {\n var e = [];\n for (var r in t) e.push(r);\n return e;\n };\n e.exports = l;\n var n = t(\"./_stream_readable\"),\n a = t(\"./_stream_writable\");\n t(\"inherits\")(l, n);\n for (var o = i(a.prototype), s = 0; s < o.length; s++) {\n var h = o[s];\n l.prototype[h] || (l.prototype[h] = a.prototype[h]);\n }\n function l(t) {\n if (!(this instanceof l)) return new l(t);\n n.call(this, t), a.call(this, t), this.allowHalfOpen = !0, t && (!1 === t.readable && (this.readable = !1), !1 === t.writable && (this.writable = !1), !1 === t.allowHalfOpen && (this.allowHalfOpen = !1, this.once(\"end\", f)));\n }\n function f() {\n this._writableState.ended || r.nextTick(u, this);\n }\n function u(t) {\n t.end();\n }\n Object.defineProperty(l.prototype, \"writableHighWaterMark\", {\n enumerable: !1,\n get: function () {\n return this._writableState.highWaterMark;\n }\n }), Object.defineProperty(l.prototype, \"writableBuffer\", {\n enumerable: !1,\n get: function () {\n return this._writableState && this._writableState.getBuffer();\n }\n }), Object.defineProperty(l.prototype, \"writableLength\", {\n enumerable: !1,\n get: function () {\n return this._writableState.length;\n }\n }), Object.defineProperty(l.prototype, \"destroyed\", {\n enumerable: !1,\n get: function () {\n return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (t) {\n void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = t, this._writableState.destroyed = t);\n }\n });\n }).call(this);\n }).call(this, t(\"_process\"));\n }, {\n \"./_stream_readable\": 65,\n \"./_stream_writable\": 67,\n _process: 60,\n inherits: 45\n }],\n 64: [function (t, e, r) {\n \"use strict\";\n\n e.exports = n;\n var i = t(\"./_stream_transform\");\n function n(t) {\n if (!(this instanceof n)) return new n(t);\n i.call(this, t);\n }\n t(\"inherits\")(n, i), n.prototype._transform = function (t, e, r) {\n r(null, t);\n };\n }, {\n \"./_stream_transform\": 66,\n inherits: 45\n }],\n 65: [function (t, e, i) {\n (function (r, i) {\n (function () {\n \"use strict\";\n\n var n;\n e.exports = S, S.ReadableState = k, t(\"events\").EventEmitter;\n var a = function (t, e) {\n return t.listeners(e).length;\n },\n o = t(\"./internal/streams/stream\"),\n s = t(\"buffer\").Buffer,\n h = i.Uint8Array || function () {};\n var l,\n f = t(\"util\");\n l = f && f.debuglog ? f.debuglog(\"stream\") : function () {};\n var u,\n c,\n d,\n p = t(\"./internal/streams/buffer_list\"),\n m = t(\"./internal/streams/destroy\"),\n g = t(\"./internal/streams/state\").getHighWaterMark,\n b = t(\"../errors\").codes,\n _ = b.ERR_INVALID_ARG_TYPE,\n y = b.ERR_STREAM_PUSH_AFTER_EOF,\n w = b.ERR_METHOD_NOT_IMPLEMENTED,\n v = b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;\n t(\"inherits\")(S, o);\n var x = m.errorOrDestroy,\n E = [\"error\", \"close\", \"destroy\", \"pause\", \"resume\"];\n function k(e, r, i) {\n n = n || t(\"./_stream_duplex\"), e = e || {}, \"boolean\" != typeof i && (i = r instanceof n), this.objectMode = !!e.objectMode, i && (this.objectMode = this.objectMode || !!e.readableObjectMode), this.highWaterMark = g(this, e, \"readableHighWaterMark\", i), this.buffer = new p(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = !1 !== e.emitClose, this.autoDestroy = !!e.autoDestroy, this.destroyed = !1, this.defaultEncoding = e.defaultEncoding || \"utf8\", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, e.encoding && (u || (u = t(\"string_decoder/\").StringDecoder), this.decoder = new u(e.encoding), this.encoding = e.encoding);\n }\n function S(e) {\n if (n = n || t(\"./_stream_duplex\"), !(this instanceof S)) return new S(e);\n var r = this instanceof n;\n this._readableState = new k(e, this, r), this.readable = !0, e && (\"function\" == typeof e.read && (this._read = e.read), \"function\" == typeof e.destroy && (this._destroy = e.destroy)), o.call(this);\n }\n function M(t, e, r, i, n) {\n l(\"readableAddChunk\", e);\n var a,\n o = t._readableState;\n if (null === e) o.reading = !1, function (t, e) {\n if (l(\"onEofChunk\"), !e.ended) {\n if (e.decoder) {\n var r = e.decoder.end();\n r && r.length && (e.buffer.push(r), e.length += e.objectMode ? 1 : r.length);\n }\n e.ended = !0, e.sync ? T(t) : (e.needReadable = !1, e.emittedReadable || (e.emittedReadable = !0, R(t)));\n }\n }(t, o);else if (n || (a = function (t, e) {\n var r;\n return i = e, s.isBuffer(i) || i instanceof h || \"string\" == typeof e || void 0 === e || t.objectMode || (r = new _(\"chunk\", [\"string\", \"Buffer\", \"Uint8Array\"], e)), r;\n var i;\n }(o, e)), a) x(t, a);else if (o.objectMode || e && e.length > 0) {\n if (\"string\" == typeof e || o.objectMode || Object.getPrototypeOf(e) === s.prototype || (e = function (t) {\n return s.from(t);\n }(e)), i) o.endEmitted ? x(t, new v()) : A(t, o, e, !0);else if (o.ended) x(t, new y());else {\n if (o.destroyed) return !1;\n o.reading = !1, o.decoder && !r ? (e = o.decoder.write(e), o.objectMode || 0 !== e.length ? A(t, o, e, !1) : P(t, o)) : A(t, o, e, !1);\n }\n } else i || (o.reading = !1, P(t, o));\n return !o.ended && (o.length < o.highWaterMark || 0 === o.length);\n }\n function A(t, e, r, i) {\n e.flowing && 0 === e.length && !e.sync ? (e.awaitDrain = 0, t.emit(\"data\", r)) : (e.length += e.objectMode ? 1 : r.length, i ? e.buffer.unshift(r) : e.buffer.push(r), e.needReadable && T(t)), P(t, e);\n }\n Object.defineProperty(S.prototype, \"destroyed\", {\n enumerable: !1,\n get: function () {\n return void 0 !== this._readableState && this._readableState.destroyed;\n },\n set: function (t) {\n this._readableState && (this._readableState.destroyed = t);\n }\n }), S.prototype.destroy = m.destroy, S.prototype._undestroy = m.undestroy, S.prototype._destroy = function (t, e) {\n e(t);\n }, S.prototype.push = function (t, e) {\n var r,\n i = this._readableState;\n return i.objectMode ? r = !0 : \"string\" == typeof t && ((e = e || i.defaultEncoding) !== i.encoding && (t = s.from(t, e), e = \"\"), r = !0), M(this, t, e, !1, r);\n }, S.prototype.unshift = function (t) {\n return M(this, t, null, !0, !1);\n }, S.prototype.isPaused = function () {\n return !1 === this._readableState.flowing;\n }, S.prototype.setEncoding = function (e) {\n u || (u = t(\"string_decoder/\").StringDecoder);\n var r = new u(e);\n this._readableState.decoder = r, this._readableState.encoding = this._readableState.decoder.encoding;\n for (var i = this._readableState.buffer.head, n = \"\"; null !== i;) n += r.write(i.data), i = i.next;\n return this._readableState.buffer.clear(), \"\" !== n && this._readableState.buffer.push(n), this._readableState.length = n.length, this;\n };\n var I = 1073741824;\n function B(t, e) {\n return t <= 0 || 0 === e.length && e.ended ? 0 : e.objectMode ? 1 : t != t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = function (t) {\n return t >= I ? t = I : (t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++), t;\n }(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));\n }\n function T(t) {\n var e = t._readableState;\n l(\"emitReadable\", e.needReadable, e.emittedReadable), e.needReadable = !1, e.emittedReadable || (l(\"emitReadable\", e.flowing), e.emittedReadable = !0, r.nextTick(R, t));\n }\n function R(t) {\n var e = t._readableState;\n l(\"emitReadable_\", e.destroyed, e.length, e.ended), e.destroyed || !e.length && !e.ended || (t.emit(\"readable\"), e.emittedReadable = !1), e.needReadable = !e.flowing && !e.ended && e.length <= e.highWaterMark, z(t);\n }\n function P(t, e) {\n e.readingMore || (e.readingMore = !0, r.nextTick(O, t, e));\n }\n function O(t, e) {\n for (; !e.reading && !e.ended && (e.length < e.highWaterMark || e.flowing && 0 === e.length);) {\n var r = e.length;\n if (l(\"maybeReadMore read 0\"), t.read(0), r === e.length) break;\n }\n e.readingMore = !1;\n }\n function L(t) {\n var e = t._readableState;\n e.readableListening = t.listenerCount(\"readable\") > 0, e.resumeScheduled && !e.paused ? e.flowing = !0 : t.listenerCount(\"data\") > 0 && t.resume();\n }\n function C(t) {\n l(\"readable nexttick read 0\"), t.read(0);\n }\n function U(t, e) {\n l(\"resume\", e.reading), e.reading || t.read(0), e.resumeScheduled = !1, t.emit(\"resume\"), z(t), e.flowing && !e.reading && t.read(0);\n }\n function z(t) {\n var e = t._readableState;\n for (l(\"flow\", e.flowing); e.flowing && null !== t.read(););\n }\n function D(t, e) {\n return 0 === e.length ? null : (e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (r = e.decoder ? e.buffer.join(\"\") : 1 === e.buffer.length ? e.buffer.first() : e.buffer.concat(e.length), e.buffer.clear()) : r = e.buffer.consume(t, e.decoder), r);\n var r;\n }\n function N(t) {\n var e = t._readableState;\n l(\"endReadable\", e.endEmitted), e.endEmitted || (e.ended = !0, r.nextTick(F, e, t));\n }\n function F(t, e) {\n if (l(\"endReadableNT\", t.endEmitted, t.length), !t.endEmitted && 0 === t.length && (t.endEmitted = !0, e.readable = !1, e.emit(\"end\"), t.autoDestroy)) {\n var r = e._writableState;\n (!r || r.autoDestroy && r.finished) && e.destroy();\n }\n }\n function j(t, e) {\n for (var r = 0, i = t.length; r < i; r++) if (t[r] === e) return r;\n return -1;\n }\n S.prototype.read = function (t) {\n l(\"read\", t), t = parseInt(t, 10);\n var e = this._readableState,\n r = t;\n if (0 !== t && (e.emittedReadable = !1), 0 === t && e.needReadable && ((0 !== e.highWaterMark ? e.length >= e.highWaterMark : e.length > 0) || e.ended)) return l(\"read: emitReadable\", e.length, e.ended), 0 === e.length && e.ended ? N(this) : T(this), null;\n if (0 === (t = B(t, e)) && e.ended) return 0 === e.length && N(this), null;\n var i,\n n = e.needReadable;\n return l(\"need readable\", n), (0 === e.length || e.length - t < e.highWaterMark) && l(\"length less than watermark\", n = !0), e.ended || e.reading ? l(\"reading or ended\", n = !1) : n && (l(\"do read\"), e.reading = !0, e.sync = !0, 0 === e.length && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = B(r, e))), null === (i = t > 0 ? D(t, e) : null) ? (e.needReadable = e.length <= e.highWaterMark, t = 0) : (e.length -= t, e.awaitDrain = 0), 0 === e.length && (e.ended || (e.needReadable = !0), r !== t && e.ended && N(this)), null !== i && this.emit(\"data\", i), i;\n }, S.prototype._read = function (t) {\n x(this, new w(\"_read()\"));\n }, S.prototype.pipe = function (t, e) {\n var i = this,\n n = this._readableState;\n switch (n.pipesCount) {\n case 0:\n n.pipes = t;\n break;\n case 1:\n n.pipes = [n.pipes, t];\n break;\n default:\n n.pipes.push(t);\n }\n n.pipesCount += 1, l(\"pipe count=%d opts=%j\", n.pipesCount, e);\n var o = e && !1 === e.end || t === r.stdout || t === r.stderr ? g : h;\n function s(e, r) {\n l(\"onunpipe\"), e === i && r && !1 === r.hasUnpiped && (r.hasUnpiped = !0, l(\"cleanup\"), t.removeListener(\"close\", p), t.removeListener(\"finish\", m), t.removeListener(\"drain\", f), t.removeListener(\"error\", d), t.removeListener(\"unpipe\", s), i.removeListener(\"end\", h), i.removeListener(\"end\", g), i.removeListener(\"data\", c), u = !0, !n.awaitDrain || t._writableState && !t._writableState.needDrain || f());\n }\n function h() {\n l(\"onend\"), t.end();\n }\n n.endEmitted ? r.nextTick(o) : i.once(\"end\", o), t.on(\"unpipe\", s);\n var f = function (t) {\n return function () {\n var e = t._readableState;\n l(\"pipeOnDrain\", e.awaitDrain), e.awaitDrain && e.awaitDrain--, 0 === e.awaitDrain && a(t, \"data\") && (e.flowing = !0, z(t));\n };\n }(i);\n t.on(\"drain\", f);\n var u = !1;\n function c(e) {\n l(\"ondata\");\n var r = t.write(e);\n l(\"dest.write\", r), !1 === r && ((1 === n.pipesCount && n.pipes === t || n.pipesCount > 1 && -1 !== j(n.pipes, t)) && !u && (l(\"false write response, pause\", n.awaitDrain), n.awaitDrain++), i.pause());\n }\n function d(e) {\n l(\"onerror\", e), g(), t.removeListener(\"error\", d), 0 === a(t, \"error\") && x(t, e);\n }\n function p() {\n t.removeListener(\"finish\", m), g();\n }\n function m() {\n l(\"onfinish\"), t.removeListener(\"close\", p), g();\n }\n function g() {\n l(\"unpipe\"), i.unpipe(t);\n }\n return i.on(\"data\", c), function (t, e, r) {\n if (\"function\" == typeof t.prependListener) return t.prependListener(e, r);\n t._events && t._events[e] ? Array.isArray(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]] : t.on(e, r);\n }(t, \"error\", d), t.once(\"close\", p), t.once(\"finish\", m), t.emit(\"pipe\", i), n.flowing || (l(\"pipe resume\"), i.resume()), t;\n }, S.prototype.unpipe = function (t) {\n var e = this._readableState,\n r = {\n hasUnpiped: !1\n };\n if (0 === e.pipesCount) return this;\n if (1 === e.pipesCount) return t && t !== e.pipes || (t || (t = e.pipes), e.pipes = null, e.pipesCount = 0, e.flowing = !1, t && t.emit(\"unpipe\", this, r)), this;\n if (!t) {\n var i = e.pipes,\n n = e.pipesCount;\n e.pipes = null, e.pipesCount = 0, e.flowing = !1;\n for (var a = 0; a < n; a++) i[a].emit(\"unpipe\", this, {\n hasUnpiped: !1\n });\n return this;\n }\n var o = j(e.pipes, t);\n return -1 === o || (e.pipes.splice(o, 1), e.pipesCount -= 1, 1 === e.pipesCount && (e.pipes = e.pipes[0]), t.emit(\"unpipe\", this, r)), this;\n }, S.prototype.on = function (t, e) {\n var i = o.prototype.on.call(this, t, e),\n n = this._readableState;\n return \"data\" === t ? (n.readableListening = this.listenerCount(\"readable\") > 0, !1 !== n.flowing && this.resume()) : \"readable\" === t && (n.endEmitted || n.readableListening || (n.readableListening = n.needReadable = !0, n.flowing = !1, n.emittedReadable = !1, l(\"on readable\", n.length, n.reading), n.length ? T(this) : n.reading || r.nextTick(C, this))), i;\n }, S.prototype.addListener = S.prototype.on, S.prototype.removeListener = function (t, e) {\n var i = o.prototype.removeListener.call(this, t, e);\n return \"readable\" === t && r.nextTick(L, this), i;\n }, S.prototype.removeAllListeners = function (t) {\n var e = o.prototype.removeAllListeners.apply(this, arguments);\n return \"readable\" !== t && void 0 !== t || r.nextTick(L, this), e;\n }, S.prototype.resume = function () {\n var t = this._readableState;\n return t.flowing || (l(\"resume\"), t.flowing = !t.readableListening, function (t, e) {\n e.resumeScheduled || (e.resumeScheduled = !0, r.nextTick(U, t, e));\n }(this, t)), t.paused = !1, this;\n }, S.prototype.pause = function () {\n return l(\"call pause flowing=%j\", this._readableState.flowing), !1 !== this._readableState.flowing && (l(\"pause\"), this._readableState.flowing = !1, this.emit(\"pause\")), this._readableState.paused = !0, this;\n }, S.prototype.wrap = function (t) {\n var e = this,\n r = this._readableState,\n i = !1;\n for (var n in t.on(\"end\", function () {\n if (l(\"wrapped end\"), r.decoder && !r.ended) {\n var t = r.decoder.end();\n t && t.length && e.push(t);\n }\n e.push(null);\n }), t.on(\"data\", function (n) {\n l(\"wrapped data\"), r.decoder && (n = r.decoder.write(n)), r.objectMode && null == n || (r.objectMode || n && n.length) && (e.push(n) || (i = !0, t.pause()));\n }), t) void 0 === this[n] && \"function\" == typeof t[n] && (this[n] = function (e) {\n return function () {\n return t[e].apply(t, arguments);\n };\n }(n));\n for (var a = 0; a < E.length; a++) t.on(E[a], this.emit.bind(this, E[a]));\n return this._read = function (e) {\n l(\"wrapped _read\", e), i && (i = !1, t.resume());\n }, this;\n }, \"function\" == typeof Symbol && (S.prototype[Symbol.asyncIterator] = function () {\n return void 0 === c && (c = t(\"./internal/streams/async_iterator\")), c(this);\n }), Object.defineProperty(S.prototype, \"readableHighWaterMark\", {\n enumerable: !1,\n get: function () {\n return this._readableState.highWaterMark;\n }\n }), Object.defineProperty(S.prototype, \"readableBuffer\", {\n enumerable: !1,\n get: function () {\n return this._readableState && this._readableState.buffer;\n }\n }), Object.defineProperty(S.prototype, \"readableFlowing\", {\n enumerable: !1,\n get: function () {\n return this._readableState.flowing;\n },\n set: function (t) {\n this._readableState && (this._readableState.flowing = t);\n }\n }), S._fromList = D, Object.defineProperty(S.prototype, \"readableLength\", {\n enumerable: !1,\n get: function () {\n return this._readableState.length;\n }\n }), \"function\" == typeof Symbol && (S.from = function (e, r) {\n return void 0 === d && (d = t(\"./internal/streams/from\")), d(S, e, r);\n });\n }).call(this);\n }).call(this, t(\"_process\"), void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {\n \"../errors\": 62,\n \"./_stream_duplex\": 63,\n \"./internal/streams/async_iterator\": 68,\n \"./internal/streams/buffer_list\": 69,\n \"./internal/streams/destroy\": 70,\n \"./internal/streams/from\": 72,\n \"./internal/streams/state\": 74,\n \"./internal/streams/stream\": 75,\n _process: 60,\n buffer: 33,\n events: 38,\n inherits: 45,\n \"string_decoder/\": 76,\n util: 30\n }],\n 66: [function (t, e, r) {\n \"use strict\";\n\n e.exports = f;\n var i = t(\"../errors\").codes,\n n = i.ERR_METHOD_NOT_IMPLEMENTED,\n a = i.ERR_MULTIPLE_CALLBACK,\n o = i.ERR_TRANSFORM_ALREADY_TRANSFORMING,\n s = i.ERR_TRANSFORM_WITH_LENGTH_0,\n h = t(\"./_stream_duplex\");\n function l(t, e) {\n var r = this._transformState;\n r.transforming = !1;\n var i = r.writecb;\n if (null === i) return this.emit(\"error\", new a());\n r.writechunk = null, r.writecb = null, null != e && this.push(e), i(t);\n var n = this._readableState;\n n.reading = !1, (n.needReadable || n.length < n.highWaterMark) && this._read(n.highWaterMark);\n }\n function f(t) {\n if (!(this instanceof f)) return new f(t);\n h.call(this, t), this._transformState = {\n afterTransform: l.bind(this),\n needTransform: !1,\n transforming: !1,\n writecb: null,\n writechunk: null,\n writeencoding: null\n }, this._readableState.needReadable = !0, this._readableState.sync = !1, t && (\"function\" == typeof t.transform && (this._transform = t.transform), \"function\" == typeof t.flush && (this._flush = t.flush)), this.on(\"prefinish\", u);\n }\n function u() {\n var t = this;\n \"function\" != typeof this._flush || this._readableState.destroyed ? c(this, null, null) : this._flush(function (e, r) {\n c(t, e, r);\n });\n }\n function c(t, e, r) {\n if (e) return t.emit(\"error\", e);\n if (null != r && t.push(r), t._writableState.length) throw new s();\n if (t._transformState.transforming) throw new o();\n return t.push(null);\n }\n t(\"inherits\")(f, h), f.prototype.push = function (t, e) {\n return this._transformState.needTransform = !1, h.prototype.push.call(this, t, e);\n }, f.prototype._transform = function (t, e, r) {\n r(new n(\"_transform()\"));\n }, f.prototype._write = function (t, e, r) {\n var i = this._transformState;\n if (i.writecb = r, i.writechunk = t, i.writeencoding = e, !i.transforming) {\n var n = this._readableState;\n (i.needTransform || n.needReadable || n.length < n.highWaterMark) && this._read(n.highWaterMark);\n }\n }, f.prototype._read = function (t) {\n var e = this._transformState;\n null === e.writechunk || e.transforming ? e.needTransform = !0 : (e.transforming = !0, this._transform(e.writechunk, e.writeencoding, e.afterTransform));\n }, f.prototype._destroy = function (t, e) {\n h.prototype._destroy.call(this, t, function (t) {\n e(t);\n });\n };\n }, {\n \"../errors\": 62,\n \"./_stream_duplex\": 63,\n inherits: 45\n }],\n 67: [function (t, e, i) {\n (function (r, i) {\n (function () {\n \"use strict\";\n\n function n(t) {\n var e = this;\n this.next = null, this.entry = null, this.finish = function () {\n !function (t, e, r) {\n var i = t.entry;\n for (t.entry = null; i;) {\n var n = i.callback;\n e.pendingcb--, n(r), i = i.next;\n }\n e.corkedRequestsFree.next = t;\n }(e, t);\n };\n }\n var a;\n e.exports = S, S.WritableState = k;\n var o = {\n deprecate: t(\"util-deprecate\")\n },\n s = t(\"./internal/streams/stream\"),\n h = t(\"buffer\").Buffer,\n l = i.Uint8Array || function () {};\n var f,\n u = t(\"./internal/streams/destroy\"),\n c = t(\"./internal/streams/state\").getHighWaterMark,\n d = t(\"../errors\").codes,\n p = d.ERR_INVALID_ARG_TYPE,\n m = d.ERR_METHOD_NOT_IMPLEMENTED,\n g = d.ERR_MULTIPLE_CALLBACK,\n b = d.ERR_STREAM_CANNOT_PIPE,\n _ = d.ERR_STREAM_DESTROYED,\n y = d.ERR_STREAM_NULL_VALUES,\n w = d.ERR_STREAM_WRITE_AFTER_END,\n v = d.ERR_UNKNOWN_ENCODING,\n x = u.errorOrDestroy;\n function E() {}\n function k(e, i, o) {\n a = a || t(\"./_stream_duplex\"), e = e || {}, \"boolean\" != typeof o && (o = i instanceof a), this.objectMode = !!e.objectMode, o && (this.objectMode = this.objectMode || !!e.writableObjectMode), this.highWaterMark = c(this, e, \"writableHighWaterMark\", o), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;\n var s = !1 === e.decodeStrings;\n this.decodeStrings = !s, this.defaultEncoding = e.defaultEncoding || \"utf8\", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function (t) {\n !function (t, e) {\n var i = t._writableState,\n n = i.sync,\n a = i.writecb;\n if (\"function\" != typeof a) throw new g();\n if (function (t) {\n t.writing = !1, t.writecb = null, t.length -= t.writelen, t.writelen = 0;\n }(i), e) !function (t, e, i, n, a) {\n --e.pendingcb, i ? (r.nextTick(a, n), r.nextTick(P, t, e), t._writableState.errorEmitted = !0, x(t, n)) : (a(n), t._writableState.errorEmitted = !0, x(t, n), P(t, e));\n }(t, i, n, e, a);else {\n var o = T(i) || t.destroyed;\n o || i.corked || i.bufferProcessing || !i.bufferedRequest || B(t, i), n ? r.nextTick(I, t, i, o, a) : I(t, i, o, a);\n }\n }(i, t);\n }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = !1 !== e.emitClose, this.autoDestroy = !!e.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new n(this);\n }\n function S(e) {\n var r = this instanceof (a = a || t(\"./_stream_duplex\"));\n if (!r && !f.call(S, this)) return new S(e);\n this._writableState = new k(e, this, r), this.writable = !0, e && (\"function\" == typeof e.write && (this._write = e.write), \"function\" == typeof e.writev && (this._writev = e.writev), \"function\" == typeof e.destroy && (this._destroy = e.destroy), \"function\" == typeof e.final && (this._final = e.final)), s.call(this);\n }\n function M(t, e, r, i, n, a) {\n if (!r) {\n var o = function (t, e, r) {\n return t.objectMode || !1 === t.decodeStrings || \"string\" != typeof e || (e = h.from(e, r)), e;\n }(e, i, n);\n i !== o && (r = !0, n = \"buffer\", i = o);\n }\n var s = e.objectMode ? 1 : i.length;\n e.length += s;\n var l = e.length < e.highWaterMark;\n if (l || (e.needDrain = !0), e.writing || e.corked) {\n var f = e.lastBufferedRequest;\n e.lastBufferedRequest = {\n chunk: i,\n encoding: n,\n isBuf: r,\n callback: a,\n next: null\n }, f ? f.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest, e.bufferedRequestCount += 1;\n } else A(t, e, !1, s, i, n, a);\n return l;\n }\n function A(t, e, r, i, n, a, o) {\n e.writelen = i, e.writecb = o, e.writing = !0, e.sync = !0, e.destroyed ? e.onwrite(new _(\"write\")) : r ? t._writev(n, e.onwrite) : t._write(n, a, e.onwrite), e.sync = !1;\n }\n function I(t, e, r, i) {\n r || function (t, e) {\n 0 === e.length && e.needDrain && (e.needDrain = !1, t.emit(\"drain\"));\n }(t, e), e.pendingcb--, i(), P(t, e);\n }\n function B(t, e) {\n e.bufferProcessing = !0;\n var r = e.bufferedRequest;\n if (t._writev && r && r.next) {\n var i = e.bufferedRequestCount,\n a = new Array(i),\n o = e.corkedRequestsFree;\n o.entry = r;\n for (var s = 0, h = !0; r;) a[s] = r, r.isBuf || (h = !1), r = r.next, s += 1;\n a.allBuffers = h, A(t, e, !0, e.length, a, \"\", o.finish), e.pendingcb++, e.lastBufferedRequest = null, o.next ? (e.corkedRequestsFree = o.next, o.next = null) : e.corkedRequestsFree = new n(e), e.bufferedRequestCount = 0;\n } else {\n for (; r;) {\n var l = r.chunk,\n f = r.encoding,\n u = r.callback;\n if (A(t, e, !1, e.objectMode ? 1 : l.length, l, f, u), r = r.next, e.bufferedRequestCount--, e.writing) break;\n }\n null === r && (e.lastBufferedRequest = null);\n }\n e.bufferedRequest = r, e.bufferProcessing = !1;\n }\n function T(t) {\n return t.ending && 0 === t.length && null === t.bufferedRequest && !t.finished && !t.writing;\n }\n function R(t, e) {\n t._final(function (r) {\n e.pendingcb--, r && x(t, r), e.prefinished = !0, t.emit(\"prefinish\"), P(t, e);\n });\n }\n function P(t, e) {\n var i = T(e);\n if (i && (function (t, e) {\n e.prefinished || e.finalCalled || (\"function\" != typeof t._final || e.destroyed ? (e.prefinished = !0, t.emit(\"prefinish\")) : (e.pendingcb++, e.finalCalled = !0, r.nextTick(R, t, e)));\n }(t, e), 0 === e.pendingcb && (e.finished = !0, t.emit(\"finish\"), e.autoDestroy))) {\n var n = t._readableState;\n (!n || n.autoDestroy && n.endEmitted) && t.destroy();\n }\n return i;\n }\n t(\"inherits\")(S, s), k.prototype.getBuffer = function () {\n for (var t = this.bufferedRequest, e = []; t;) e.push(t), t = t.next;\n return e;\n }, function () {\n try {\n Object.defineProperty(k.prototype, \"buffer\", {\n get: o.deprecate(function () {\n return this.getBuffer();\n }, \"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\", \"DEP0003\")\n });\n } catch (t) {}\n }(), \"function\" == typeof Symbol && Symbol.hasInstance && \"function\" == typeof Function.prototype[Symbol.hasInstance] ? (f = Function.prototype[Symbol.hasInstance], Object.defineProperty(S, Symbol.hasInstance, {\n value: function (t) {\n return !!f.call(this, t) || this === S && t && t._writableState instanceof k;\n }\n })) : f = function (t) {\n return t instanceof this;\n }, S.prototype.pipe = function () {\n x(this, new b());\n }, S.prototype.write = function (t, e, i) {\n var n,\n a = this._writableState,\n o = !1,\n s = !a.objectMode && (n = t, h.isBuffer(n) || n instanceof l);\n return s && !h.isBuffer(t) && (t = function (t) {\n return h.from(t);\n }(t)), \"function\" == typeof e && (i = e, e = null), s ? e = \"buffer\" : e || (e = a.defaultEncoding), \"function\" != typeof i && (i = E), a.ending ? function (t, e) {\n var i = new w();\n x(t, i), r.nextTick(e, i);\n }(this, i) : (s || function (t, e, i, n) {\n var a;\n return null === i ? a = new y() : \"string\" == typeof i || e.objectMode || (a = new p(\"chunk\", [\"string\", \"Buffer\"], i)), !a || (x(t, a), r.nextTick(n, a), !1);\n }(this, a, t, i)) && (a.pendingcb++, o = M(this, a, s, t, e, i)), o;\n }, S.prototype.cork = function () {\n this._writableState.corked++;\n }, S.prototype.uncork = function () {\n var t = this._writableState;\n t.corked && (t.corked--, t.writing || t.corked || t.bufferProcessing || !t.bufferedRequest || B(this, t));\n }, S.prototype.setDefaultEncoding = function (t) {\n if (\"string\" == typeof t && (t = t.toLowerCase()), !([\"hex\", \"utf8\", \"utf-8\", \"ascii\", \"binary\", \"base64\", \"ucs2\", \"ucs-2\", \"utf16le\", \"utf-16le\", \"raw\"].indexOf((t + \"\").toLowerCase()) > -1)) throw new v(t);\n return this._writableState.defaultEncoding = t, this;\n }, Object.defineProperty(S.prototype, \"writableBuffer\", {\n enumerable: !1,\n get: function () {\n return this._writableState && this._writableState.getBuffer();\n }\n }), Object.defineProperty(S.prototype, \"writableHighWaterMark\", {\n enumerable: !1,\n get: function () {\n return this._writableState.highWaterMark;\n }\n }), S.prototype._write = function (t, e, r) {\n r(new m(\"_write()\"));\n }, S.prototype._writev = null, S.prototype.end = function (t, e, i) {\n var n = this._writableState;\n return \"function\" == typeof t ? (i = t, t = null, e = null) : \"function\" == typeof e && (i = e, e = null), null != t && this.write(t, e), n.corked && (n.corked = 1, this.uncork()), n.ending || function (t, e, i) {\n e.ending = !0, P(t, e), i && (e.finished ? r.nextTick(i) : t.once(\"finish\", i)), e.ended = !0, t.writable = !1;\n }(this, n, i), this;\n }, Object.defineProperty(S.prototype, \"writableLength\", {\n enumerable: !1,\n get: function () {\n return this._writableState.length;\n }\n }), Object.defineProperty(S.prototype, \"destroyed\", {\n enumerable: !1,\n get: function () {\n return void 0 !== this._writableState && this._writableState.destroyed;\n },\n set: function (t) {\n this._writableState && (this._writableState.destroyed = t);\n }\n }), S.prototype.destroy = u.destroy, S.prototype._undestroy = u.undestroy, S.prototype._destroy = function (t, e) {\n e(t);\n };\n }).call(this);\n }).call(this, t(\"_process\"), void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {\n \"../errors\": 62,\n \"./_stream_duplex\": 63,\n \"./internal/streams/destroy\": 70,\n \"./internal/streams/state\": 74,\n \"./internal/streams/stream\": 75,\n _process: 60,\n buffer: 33,\n inherits: 45,\n \"util-deprecate\": 78\n }],\n 68: [function (t, e, r) {\n (function (r) {\n (function () {\n \"use strict\";\n\n var i;\n function n(t, e, r) {\n return e in t ? Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : t[e] = r, t;\n }\n var a = t(\"./end-of-stream\"),\n o = Symbol(\"lastResolve\"),\n s = Symbol(\"lastReject\"),\n h = Symbol(\"error\"),\n l = Symbol(\"ended\"),\n f = Symbol(\"lastPromise\"),\n u = Symbol(\"handlePromise\"),\n c = Symbol(\"stream\");\n function d(t, e) {\n return {\n value: t,\n done: e\n };\n }\n function p(t) {\n var e = t[o];\n if (null !== e) {\n var r = t[c].read();\n null !== r && (t[f] = null, t[o] = null, t[s] = null, e(d(r, !1)));\n }\n }\n function m(t) {\n r.nextTick(p, t);\n }\n var g = Object.getPrototypeOf(function () {}),\n b = Object.setPrototypeOf((n(i = {\n get stream() {\n return this[c];\n },\n next: function () {\n var t = this,\n e = this[h];\n if (null !== e) return Promise.reject(e);\n if (this[l]) return Promise.resolve(d(void 0, !0));\n if (this[c].destroyed) return new Promise(function (e, i) {\n r.nextTick(function () {\n t[h] ? i(t[h]) : e(d(void 0, !0));\n });\n });\n var i,\n n = this[f];\n if (n) i = new Promise(function (t, e) {\n return function (r, i) {\n t.then(function () {\n e[l] ? r(d(void 0, !0)) : e[u](r, i);\n }, i);\n };\n }(n, this));else {\n var a = this[c].read();\n if (null !== a) return Promise.resolve(d(a, !1));\n i = new Promise(this[u]);\n }\n return this[f] = i, i;\n }\n }, Symbol.asyncIterator, function () {\n return this;\n }), n(i, \"return\", function () {\n var t = this;\n return new Promise(function (e, r) {\n t[c].destroy(null, function (t) {\n t ? r(t) : e(d(void 0, !0));\n });\n });\n }), i), g);\n e.exports = function (t) {\n var e,\n r = Object.create(b, (n(e = {}, c, {\n value: t,\n writable: !0\n }), n(e, o, {\n value: null,\n writable: !0\n }), n(e, s, {\n value: null,\n writable: !0\n }), n(e, h, {\n value: null,\n writable: !0\n }), n(e, l, {\n value: t._readableState.endEmitted,\n writable: !0\n }), n(e, u, {\n value: function (t, e) {\n var i = r[c].read();\n i ? (r[f] = null, r[o] = null, r[s] = null, t(d(i, !1))) : (r[o] = t, r[s] = e);\n },\n writable: !0\n }), e));\n return r[f] = null, a(t, function (t) {\n if (t && \"ERR_STREAM_PREMATURE_CLOSE\" !== t.code) {\n var e = r[s];\n return null !== e && (r[f] = null, r[o] = null, r[s] = null, e(t)), void (r[h] = t);\n }\n var i = r[o];\n null !== i && (r[f] = null, r[o] = null, r[s] = null, i(d(void 0, !0))), r[l] = !0;\n }), t.on(\"readable\", m.bind(null, r)), r;\n };\n }).call(this);\n }).call(this, t(\"_process\"));\n }, {\n \"./end-of-stream\": 71,\n _process: 60\n }],\n 69: [function (t, e, r) {\n \"use strict\";\n\n function i(t, e) {\n var r = Object.keys(t);\n if (Object.getOwnPropertySymbols) {\n var i = Object.getOwnPropertySymbols(t);\n e && (i = i.filter(function (e) {\n return Object.getOwnPropertyDescriptor(t, e).enumerable;\n })), r.push.apply(r, i);\n }\n return r;\n }\n function n(t, e, r) {\n return e in t ? Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : t[e] = r, t;\n }\n function a(t, e) {\n for (var r = 0; r < e.length; r++) {\n var i = e[r];\n i.enumerable = i.enumerable || !1, i.configurable = !0, \"value\" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);\n }\n }\n var o = t(\"buffer\").Buffer,\n s = t(\"util\").inspect,\n h = s && s.custom || \"inspect\";\n e.exports = function () {\n function t() {\n (function (t, e) {\n if (!(t instanceof e)) throw new TypeError(\"Cannot call a class as a function\");\n })(this, t), this.head = null, this.tail = null, this.length = 0;\n }\n return e = t, r = [{\n key: \"push\",\n value: function (t) {\n var e = {\n data: t,\n next: null\n };\n this.length > 0 ? this.tail.next = e : this.head = e, this.tail = e, ++this.length;\n }\n }, {\n key: \"unshift\",\n value: function (t) {\n var e = {\n data: t,\n next: this.head\n };\n 0 === this.length && (this.tail = e), this.head = e, ++this.length;\n }\n }, {\n key: \"shift\",\n value: function () {\n if (0 !== this.length) {\n var t = this.head.data;\n return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, t;\n }\n }\n }, {\n key: \"clear\",\n value: function () {\n this.head = this.tail = null, this.length = 0;\n }\n }, {\n key: \"join\",\n value: function (t) {\n if (0 === this.length) return \"\";\n for (var e = this.head, r = \"\" + e.data; e = e.next;) r += t + e.data;\n return r;\n }\n }, {\n key: \"concat\",\n value: function (t) {\n if (0 === this.length) return o.alloc(0);\n for (var e = o.allocUnsafe(t >>> 0), r = this.head, i = 0; r;) n = r.data, a = e, s = i, o.prototype.copy.call(n, a, s), i += r.data.length, r = r.next;\n var n, a, s;\n return e;\n }\n }, {\n key: \"consume\",\n value: function (t, e) {\n var r;\n return t < this.head.data.length ? (r = this.head.data.slice(0, t), this.head.data = this.head.data.slice(t)) : r = t === this.head.data.length ? this.shift() : e ? this._getString(t) : this._getBuffer(t), r;\n }\n }, {\n key: \"first\",\n value: function () {\n return this.head.data;\n }\n }, {\n key: \"_getString\",\n value: function (t) {\n var e = this.head,\n r = 1,\n i = e.data;\n for (t -= i.length; e = e.next;) {\n var n = e.data,\n a = t > n.length ? n.length : t;\n if (a === n.length ? i += n : i += n.slice(0, t), 0 == (t -= a)) {\n a === n.length ? (++r, e.next ? this.head = e.next : this.head = this.tail = null) : (this.head = e, e.data = n.slice(a));\n break;\n }\n ++r;\n }\n return this.length -= r, i;\n }\n }, {\n key: \"_getBuffer\",\n value: function (t) {\n var e = o.allocUnsafe(t),\n r = this.head,\n i = 1;\n for (r.data.copy(e), t -= r.data.length; r = r.next;) {\n var n = r.data,\n a = t > n.length ? n.length : t;\n if (n.copy(e, e.length - t, 0, a), 0 == (t -= a)) {\n a === n.length ? (++i, r.next ? this.head = r.next : this.head = this.tail = null) : (this.head = r, r.data = n.slice(a));\n break;\n }\n ++i;\n }\n return this.length -= i, e;\n }\n }, {\n key: h,\n value: function (t, e) {\n return s(this, function (t) {\n for (var e = 1; e < arguments.length; e++) {\n var r = null != arguments[e] ? arguments[e] : {};\n e % 2 ? i(Object(r), !0).forEach(function (e) {\n n(t, e, r[e]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : i(Object(r)).forEach(function (e) {\n Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));\n });\n }\n return t;\n }({}, e, {\n depth: 0,\n customInspect: !1\n }));\n }\n }], r && a(e.prototype, r), l && a(e, l), t;\n var e, r, l;\n }();\n }, {\n buffer: 33,\n util: 30\n }],\n 70: [function (t, e, r) {\n (function (t) {\n (function () {\n \"use strict\";\n\n function r(t, e) {\n n(t, e), i(t);\n }\n function i(t) {\n t._writableState && !t._writableState.emitClose || t._readableState && !t._readableState.emitClose || t.emit(\"close\");\n }\n function n(t, e) {\n t.emit(\"error\", e);\n }\n e.exports = {\n destroy: function (e, a) {\n var o = this,\n s = this._readableState && this._readableState.destroyed,\n h = this._writableState && this._writableState.destroyed;\n return s || h ? (a ? a(e) : e && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, t.nextTick(n, this, e)) : t.nextTick(n, this, e)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(e || null, function (e) {\n !a && e ? o._writableState ? o._writableState.errorEmitted ? t.nextTick(i, o) : (o._writableState.errorEmitted = !0, t.nextTick(r, o, e)) : t.nextTick(r, o, e) : a ? (t.nextTick(i, o), a(e)) : t.nextTick(i, o);\n }), this);\n },\n undestroy: function () {\n this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);\n },\n errorOrDestroy: function (t, e) {\n var r = t._readableState,\n i = t._writableState;\n r && r.autoDestroy || i && i.autoDestroy ? t.destroy(e) : t.emit(\"error\", e);\n }\n };\n }).call(this);\n }).call(this, t(\"_process\"));\n }, {\n _process: 60\n }],\n 71: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"../../../errors\").codes.ERR_STREAM_PREMATURE_CLOSE;\n function n() {}\n e.exports = function t(e, r, a) {\n if (\"function\" == typeof r) return t(e, null, r);\n r || (r = {}), a = function (t) {\n var e = !1;\n return function () {\n if (!e) {\n e = !0;\n for (var r = arguments.length, i = new Array(r), n = 0; n < r; n++) i[n] = arguments[n];\n t.apply(this, i);\n }\n };\n }(a || n);\n var o = r.readable || !1 !== r.readable && e.readable,\n s = r.writable || !1 !== r.writable && e.writable,\n h = function () {\n e.writable || f();\n },\n l = e._writableState && e._writableState.finished,\n f = function () {\n s = !1, l = !0, o || a.call(e);\n },\n u = e._readableState && e._readableState.endEmitted,\n c = function () {\n o = !1, u = !0, s || a.call(e);\n },\n d = function (t) {\n a.call(e, t);\n },\n p = function () {\n var t;\n return o && !u ? (e._readableState && e._readableState.ended || (t = new i()), a.call(e, t)) : s && !l ? (e._writableState && e._writableState.ended || (t = new i()), a.call(e, t)) : void 0;\n },\n m = function () {\n e.req.on(\"finish\", f);\n };\n return function (t) {\n return t.setHeader && \"function\" == typeof t.abort;\n }(e) ? (e.on(\"complete\", f), e.on(\"abort\", p), e.req ? m() : e.on(\"request\", m)) : s && !e._writableState && (e.on(\"end\", h), e.on(\"close\", h)), e.on(\"end\", c), e.on(\"finish\", f), !1 !== r.error && e.on(\"error\", d), e.on(\"close\", p), function () {\n e.removeListener(\"complete\", f), e.removeListener(\"abort\", p), e.removeListener(\"request\", m), e.req && e.req.removeListener(\"finish\", f), e.removeListener(\"end\", h), e.removeListener(\"close\", h), e.removeListener(\"finish\", f), e.removeListener(\"end\", c), e.removeListener(\"error\", d), e.removeListener(\"close\", p);\n };\n };\n }, {\n \"../../../errors\": 62\n }],\n 72: [function (t, e, r) {\n e.exports = function () {\n throw new Error(\"Readable.from is not available in the browser\");\n };\n }, {}],\n 73: [function (t, e, r) {\n \"use strict\";\n\n var i;\n var n = t(\"../../../errors\").codes,\n a = n.ERR_MISSING_ARGS,\n o = n.ERR_STREAM_DESTROYED;\n function s(t) {\n if (t) throw t;\n }\n function h(t) {\n t();\n }\n function l(t, e) {\n return t.pipe(e);\n }\n e.exports = function () {\n for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++) r[n] = arguments[n];\n var f,\n u = function (t) {\n return t.length ? \"function\" != typeof t[t.length - 1] ? s : t.pop() : s;\n }(r);\n if (Array.isArray(r[0]) && (r = r[0]), r.length < 2) throw new a(\"streams\");\n var c = r.map(function (e, n) {\n var a = n < r.length - 1;\n return function (e, r, n, a) {\n a = function (t) {\n var e = !1;\n return function () {\n e || (e = !0, t.apply(void 0, arguments));\n };\n }(a);\n var s = !1;\n e.on(\"close\", function () {\n s = !0;\n }), void 0 === i && (i = t(\"./end-of-stream\")), i(e, {\n readable: r,\n writable: n\n }, function (t) {\n if (t) return a(t);\n s = !0, a();\n });\n var h = !1;\n return function (t) {\n if (!s && !h) return h = !0, function (t) {\n return t.setHeader && \"function\" == typeof t.abort;\n }(e) ? e.abort() : \"function\" == typeof e.destroy ? e.destroy() : void a(t || new o(\"pipe\"));\n };\n }(e, a, n > 0, function (t) {\n f || (f = t), t && c.forEach(h), a || (c.forEach(h), u(f));\n });\n });\n return r.reduce(l);\n };\n }, {\n \"../../../errors\": 62,\n \"./end-of-stream\": 71\n }],\n 74: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"../../../errors\").codes.ERR_INVALID_OPT_VALUE;\n e.exports = {\n getHighWaterMark: function (t, e, r, n) {\n var a = function (t, e, r) {\n return null != t.highWaterMark ? t.highWaterMark : e ? t[r] : null;\n }(e, n, r);\n if (null != a) {\n if (!isFinite(a) || Math.floor(a) !== a || a < 0) throw new i(n ? r : \"highWaterMark\", a);\n return Math.floor(a);\n }\n return t.objectMode ? 16 : 16384;\n }\n };\n }, {\n \"../../../errors\": 62\n }],\n 75: [function (t, e, r) {\n e.exports = t(\"events\").EventEmitter;\n }, {\n events: 38\n }],\n 76: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"safe-buffer\").Buffer,\n n = i.isEncoding || function (t) {\n switch ((t = \"\" + t) && t.toLowerCase()) {\n case \"hex\":\n case \"utf8\":\n case \"utf-8\":\n case \"ascii\":\n case \"binary\":\n case \"base64\":\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n case \"raw\":\n return !0;\n default:\n return !1;\n }\n };\n function a(t) {\n var e;\n switch (this.encoding = function (t) {\n var e = function (t) {\n if (!t) return \"utf8\";\n for (var e;;) switch (t) {\n case \"utf8\":\n case \"utf-8\":\n return \"utf8\";\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return \"utf16le\";\n case \"latin1\":\n case \"binary\":\n return \"latin1\";\n case \"base64\":\n case \"ascii\":\n case \"hex\":\n return t;\n default:\n if (e) return;\n t = (\"\" + t).toLowerCase(), e = !0;\n }\n }(t);\n if (\"string\" != typeof e && (i.isEncoding === n || !n(t))) throw new Error(\"Unknown encoding: \" + t);\n return e || t;\n }(t), this.encoding) {\n case \"utf16le\":\n this.text = h, this.end = l, e = 4;\n break;\n case \"utf8\":\n this.fillLast = s, e = 4;\n break;\n case \"base64\":\n this.text = f, this.end = u, e = 3;\n break;\n default:\n return this.write = c, void (this.end = d);\n }\n this.lastNeed = 0, this.lastTotal = 0, this.lastChar = i.allocUnsafe(e);\n }\n function o(t) {\n return t <= 127 ? 0 : t >> 5 == 6 ? 2 : t >> 4 == 14 ? 3 : t >> 3 == 30 ? 4 : t >> 6 == 2 ? -1 : -2;\n }\n function s(t) {\n var e = this.lastTotal - this.lastNeed,\n r = function (t, e, r) {\n if (128 != (192 & e[0])) return t.lastNeed = 0, \"�\";\n if (t.lastNeed > 1 && e.length > 1) {\n if (128 != (192 & e[1])) return t.lastNeed = 1, \"�\";\n if (t.lastNeed > 2 && e.length > 2 && 128 != (192 & e[2])) return t.lastNeed = 2, \"�\";\n }\n }(this, t);\n return void 0 !== r ? r : this.lastNeed <= t.length ? (t.copy(this.lastChar, e, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (t.copy(this.lastChar, e, 0, t.length), void (this.lastNeed -= t.length));\n }\n function h(t, e) {\n if ((t.length - e) % 2 == 0) {\n var r = t.toString(\"utf16le\", e);\n if (r) {\n var i = r.charCodeAt(r.length - 1);\n if (i >= 55296 && i <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = t[t.length - 2], this.lastChar[1] = t[t.length - 1], r.slice(0, -1);\n }\n return r;\n }\n return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = t[t.length - 1], t.toString(\"utf16le\", e, t.length - 1);\n }\n function l(t) {\n var e = t && t.length ? this.write(t) : \"\";\n if (this.lastNeed) {\n var r = this.lastTotal - this.lastNeed;\n return e + this.lastChar.toString(\"utf16le\", 0, r);\n }\n return e;\n }\n function f(t, e) {\n var r = (t.length - e) % 3;\n return 0 === r ? t.toString(\"base64\", e) : (this.lastNeed = 3 - r, this.lastTotal = 3, 1 === r ? this.lastChar[0] = t[t.length - 1] : (this.lastChar[0] = t[t.length - 2], this.lastChar[1] = t[t.length - 1]), t.toString(\"base64\", e, t.length - r));\n }\n function u(t) {\n var e = t && t.length ? this.write(t) : \"\";\n return this.lastNeed ? e + this.lastChar.toString(\"base64\", 0, 3 - this.lastNeed) : e;\n }\n function c(t) {\n return t.toString(this.encoding);\n }\n function d(t) {\n return t && t.length ? this.write(t) : \"\";\n }\n r.StringDecoder = a, a.prototype.write = function (t) {\n if (0 === t.length) return \"\";\n var e, r;\n if (this.lastNeed) {\n if (void 0 === (e = this.fillLast(t))) return \"\";\n r = this.lastNeed, this.lastNeed = 0;\n } else r = 0;\n return r < t.length ? e ? e + this.text(t, r) : this.text(t, r) : e || \"\";\n }, a.prototype.end = function (t) {\n var e = t && t.length ? this.write(t) : \"\";\n return this.lastNeed ? e + \"�\" : e;\n }, a.prototype.text = function (t, e) {\n var r = function (t, e, r) {\n var i = e.length - 1;\n if (i < r) return 0;\n var n = o(e[i]);\n return n >= 0 ? (n > 0 && (t.lastNeed = n - 1), n) : --i < r || -2 === n ? 0 : (n = o(e[i])) >= 0 ? (n > 0 && (t.lastNeed = n - 2), n) : --i < r || -2 === n ? 0 : (n = o(e[i])) >= 0 ? (n > 0 && (2 === n ? n = 0 : t.lastNeed = n - 3), n) : 0;\n }(this, t, e);\n if (!this.lastNeed) return t.toString(\"utf8\", e);\n this.lastTotal = r;\n var i = t.length - (r - this.lastNeed);\n return t.copy(this.lastChar, 0, i), t.toString(\"utf8\", e, i);\n }, a.prototype.fillLast = function (t) {\n if (this.lastNeed <= t.length) return t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);\n t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t.length), this.lastNeed -= t.length;\n };\n }, {\n \"safe-buffer\": 77\n }],\n 77: [function (t, e, r) {\n var i = t(\"buffer\"),\n n = i.Buffer;\n function a(t, e) {\n for (var r in t) e[r] = t[r];\n }\n function o(t, e, r) {\n return n(t, e, r);\n }\n n.from && n.alloc && n.allocUnsafe && n.allocUnsafeSlow ? e.exports = i : (a(i, r), r.Buffer = o), o.prototype = Object.create(n.prototype), a(n, o), o.from = function (t, e, r) {\n if (\"number\" == typeof t) throw new TypeError(\"Argument must not be a number\");\n return n(t, e, r);\n }, o.alloc = function (t, e, r) {\n if (\"number\" != typeof t) throw new TypeError(\"Argument must be a number\");\n var i = n(t);\n return void 0 !== e ? \"string\" == typeof r ? i.fill(e, r) : i.fill(e) : i.fill(0), i;\n }, o.allocUnsafe = function (t) {\n if (\"number\" != typeof t) throw new TypeError(\"Argument must be a number\");\n return n(t);\n }, o.allocUnsafeSlow = function (t) {\n if (\"number\" != typeof t) throw new TypeError(\"Argument must be a number\");\n return i.SlowBuffer(t);\n };\n }, {\n buffer: 33\n }],\n 78: [function (t, e, i) {\n (function (t) {\n (function () {\n function r(e) {\n try {\n if (!t.localStorage) return !1;\n } catch (t) {\n return !1;\n }\n var r = t.localStorage[e];\n return null != r && \"true\" === String(r).toLowerCase();\n }\n e.exports = function (t, e) {\n if (r(\"noDeprecation\")) return t;\n var i = !1;\n return function () {\n if (!i) {\n if (r(\"throwDeprecation\")) throw new Error(e);\n r(\"traceDeprecation\") ? console.trace(e) : console.warn(e), i = !0;\n }\n return t.apply(this, arguments);\n };\n };\n }).call(this);\n }).call(this, void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {}],\n 79: [function (t, e, r) {\n arguments[4][25][0].apply(r, arguments);\n }, {\n dup: 25\n }],\n 80: [function (t, e, r) {\n \"use strict\";\n\n var i = t(\"is-arguments\"),\n n = t(\"is-generator-function\"),\n a = t(\"which-typed-array\"),\n o = t(\"is-typed-array\");\n function s(t) {\n return t.call.bind(t);\n }\n var h = \"undefined\" != typeof BigInt,\n l = \"undefined\" != typeof Symbol,\n f = s(Object.prototype.toString),\n u = s(Number.prototype.valueOf),\n c = s(String.prototype.valueOf),\n d = s(Boolean.prototype.valueOf);\n if (h) var p = s(BigInt.prototype.valueOf);\n if (l) var m = s(Symbol.prototype.valueOf);\n function g(t, e) {\n if (\"object\" != typeof t) return !1;\n try {\n return e(t), !0;\n } catch (t) {\n return !1;\n }\n }\n function b(t) {\n return \"[object Map]\" === f(t);\n }\n function _(t) {\n return \"[object Set]\" === f(t);\n }\n function y(t) {\n return \"[object WeakMap]\" === f(t);\n }\n function w(t) {\n return \"[object WeakSet]\" === f(t);\n }\n function v(t) {\n return \"[object ArrayBuffer]\" === f(t);\n }\n function x(t) {\n return \"undefined\" != typeof ArrayBuffer && (v.working ? v(t) : t instanceof ArrayBuffer);\n }\n function E(t) {\n return \"[object DataView]\" === f(t);\n }\n function k(t) {\n return \"undefined\" != typeof DataView && (E.working ? E(t) : t instanceof DataView);\n }\n function S(t) {\n return \"[object SharedArrayBuffer]\" === f(t);\n }\n function M(t) {\n return \"undefined\" != typeof SharedArrayBuffer && (S.working ? S(t) : t instanceof SharedArrayBuffer);\n }\n function A(t) {\n return g(t, u);\n }\n function I(t) {\n return g(t, c);\n }\n function B(t) {\n return g(t, d);\n }\n function T(t) {\n return h && g(t, p);\n }\n function R(t) {\n return l && g(t, m);\n }\n r.isArgumentsObject = i, r.isGeneratorFunction = n, r.isTypedArray = o, r.isPromise = function (t) {\n return \"undefined\" != typeof Promise && t instanceof Promise || null !== t && \"object\" == typeof t && \"function\" == typeof t.then && \"function\" == typeof t.catch;\n }, r.isArrayBufferView = function (t) {\n return \"undefined\" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(t) : o(t) || k(t);\n }, r.isUint8Array = function (t) {\n return \"Uint8Array\" === a(t);\n }, r.isUint8ClampedArray = function (t) {\n return \"Uint8ClampedArray\" === a(t);\n }, r.isUint16Array = function (t) {\n return \"Uint16Array\" === a(t);\n }, r.isUint32Array = function (t) {\n return \"Uint32Array\" === a(t);\n }, r.isInt8Array = function (t) {\n return \"Int8Array\" === a(t);\n }, r.isInt16Array = function (t) {\n return \"Int16Array\" === a(t);\n }, r.isInt32Array = function (t) {\n return \"Int32Array\" === a(t);\n }, r.isFloat32Array = function (t) {\n return \"Float32Array\" === a(t);\n }, r.isFloat64Array = function (t) {\n return \"Float64Array\" === a(t);\n }, r.isBigInt64Array = function (t) {\n return \"BigInt64Array\" === a(t);\n }, r.isBigUint64Array = function (t) {\n return \"BigUint64Array\" === a(t);\n }, b.working = \"undefined\" != typeof Map && b(new Map()), r.isMap = function (t) {\n return \"undefined\" != typeof Map && (b.working ? b(t) : t instanceof Map);\n }, _.working = \"undefined\" != typeof Set && _(new Set()), r.isSet = function (t) {\n return \"undefined\" != typeof Set && (_.working ? _(t) : t instanceof Set);\n }, y.working = \"undefined\" != typeof WeakMap && y(new WeakMap()), r.isWeakMap = function (t) {\n return \"undefined\" != typeof WeakMap && (y.working ? y(t) : t instanceof WeakMap);\n }, w.working = \"undefined\" != typeof WeakSet && w(new WeakSet()), r.isWeakSet = function (t) {\n return w(t);\n }, v.working = \"undefined\" != typeof ArrayBuffer && v(new ArrayBuffer()), r.isArrayBuffer = x, E.working = \"undefined\" != typeof ArrayBuffer && \"undefined\" != typeof DataView && E(new DataView(new ArrayBuffer(1), 0, 1)), r.isDataView = k, S.working = \"undefined\" != typeof SharedArrayBuffer && S(new SharedArrayBuffer()), r.isSharedArrayBuffer = M, r.isAsyncFunction = function (t) {\n return \"[object AsyncFunction]\" === f(t);\n }, r.isMapIterator = function (t) {\n return \"[object Map Iterator]\" === f(t);\n }, r.isSetIterator = function (t) {\n return \"[object Set Iterator]\" === f(t);\n }, r.isGeneratorObject = function (t) {\n return \"[object Generator]\" === f(t);\n }, r.isWebAssemblyCompiledModule = function (t) {\n return \"[object WebAssembly.Module]\" === f(t);\n }, r.isNumberObject = A, r.isStringObject = I, r.isBooleanObject = B, r.isBigIntObject = T, r.isSymbolObject = R, r.isBoxedPrimitive = function (t) {\n return A(t) || I(t) || B(t) || T(t) || R(t);\n }, r.isAnyArrayBuffer = function (t) {\n return \"undefined\" != typeof Uint8Array && (x(t) || M(t));\n }, [\"isProxy\", \"isExternal\", \"isModuleNamespaceObject\"].forEach(function (t) {\n Object.defineProperty(r, t, {\n enumerable: !1,\n value: function () {\n throw new Error(t + \" is not supported in userland\");\n }\n });\n });\n }, {\n \"is-arguments\": 46,\n \"is-generator-function\": 47,\n \"is-typed-array\": 48,\n \"which-typed-array\": 82\n }],\n 81: [function (t, e, r) {\n (function (e) {\n (function () {\n var i = Object.getOwnPropertyDescriptors || function (t) {\n for (var e = Object.keys(t), r = {}, i = 0; i < e.length; i++) r[e[i]] = Object.getOwnPropertyDescriptor(t, e[i]);\n return r;\n },\n n = /%[sdj%]/g;\n r.format = function (t) {\n if (!_(t)) {\n for (var e = [], r = 0; r < arguments.length; r++) e.push(h(arguments[r]));\n return e.join(\" \");\n }\n r = 1;\n for (var i = arguments, a = i.length, o = String(t).replace(n, function (t) {\n if (\"%%\" === t) return \"%\";\n if (r >= a) return t;\n switch (t) {\n case \"%s\":\n return String(i[r++]);\n case \"%d\":\n return Number(i[r++]);\n case \"%j\":\n try {\n return JSON.stringify(i[r++]);\n } catch (t) {\n return \"[Circular]\";\n }\n default:\n return t;\n }\n }), s = i[r]; r < a; s = i[++r]) g(s) || !v(s) ? o += \" \" + s : o += \" \" + h(s);\n return o;\n }, r.deprecate = function (t, i) {\n if (void 0 !== e && !0 === e.noDeprecation) return t;\n if (void 0 === e) return function () {\n return r.deprecate(t, i).apply(this, arguments);\n };\n var n = !1;\n return function () {\n if (!n) {\n if (e.throwDeprecation) throw new Error(i);\n e.traceDeprecation ? console.trace(i) : console.error(i), n = !0;\n }\n return t.apply(this, arguments);\n };\n };\n var a = {},\n o = /^$/;\n if (e.env.NODE_DEBUG) {\n var s = e.env.NODE_DEBUG;\n s = s.replace(/[|\\\\{}()[\\]^$+?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), o = new RegExp(\"^\" + s + \"$\", \"i\");\n }\n function h(t, e) {\n var i = {\n seen: [],\n stylize: f\n };\n return arguments.length >= 3 && (i.depth = arguments[2]), arguments.length >= 4 && (i.colors = arguments[3]), m(e) ? i.showHidden = e : e && r._extend(i, e), y(i.showHidden) && (i.showHidden = !1), y(i.depth) && (i.depth = 2), y(i.colors) && (i.colors = !1), y(i.customInspect) && (i.customInspect = !0), i.colors && (i.stylize = l), u(i, t, i.depth);\n }\n function l(t, e) {\n var r = h.styles[e];\n return r ? \"\u001b[\" + h.colors[r][0] + \"m\" + t + \"\u001b[\" + h.colors[r][1] + \"m\" : t;\n }\n function f(t, e) {\n return t;\n }\n function u(t, e, i) {\n if (t.customInspect && e && k(e.inspect) && e.inspect !== r.inspect && (!e.constructor || e.constructor.prototype !== e)) {\n var n = e.inspect(i, t);\n return _(n) || (n = u(t, n, i)), n;\n }\n var a = function (t, e) {\n if (y(e)) return t.stylize(\"undefined\", \"undefined\");\n if (_(e)) {\n var r = \"'\" + JSON.stringify(e).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return t.stylize(r, \"string\");\n }\n return b(e) ? t.stylize(\"\" + e, \"number\") : m(e) ? t.stylize(\"\" + e, \"boolean\") : g(e) ? t.stylize(\"null\", \"null\") : void 0;\n }(t, e);\n if (a) return a;\n var o = Object.keys(e),\n s = function (t) {\n var e = {};\n return t.forEach(function (t, r) {\n e[t] = !0;\n }), e;\n }(o);\n if (t.showHidden && (o = Object.getOwnPropertyNames(e)), E(e) && (o.indexOf(\"message\") >= 0 || o.indexOf(\"description\") >= 0)) return c(e);\n if (0 === o.length) {\n if (k(e)) {\n var h = e.name ? \": \" + e.name : \"\";\n return t.stylize(\"[Function\" + h + \"]\", \"special\");\n }\n if (w(e)) return t.stylize(RegExp.prototype.toString.call(e), \"regexp\");\n if (x(e)) return t.stylize(Date.prototype.toString.call(e), \"date\");\n if (E(e)) return c(e);\n }\n var l,\n f = \"\",\n v = !1,\n S = [\"{\", \"}\"];\n return p(e) && (v = !0, S = [\"[\", \"]\"]), k(e) && (f = \" [Function\" + (e.name ? \": \" + e.name : \"\") + \"]\"), w(e) && (f = \" \" + RegExp.prototype.toString.call(e)), x(e) && (f = \" \" + Date.prototype.toUTCString.call(e)), E(e) && (f = \" \" + c(e)), 0 !== o.length || v && 0 != e.length ? i < 0 ? w(e) ? t.stylize(RegExp.prototype.toString.call(e), \"regexp\") : t.stylize(\"[Object]\", \"special\") : (t.seen.push(e), l = v ? function (t, e, r, i, n) {\n for (var a = [], o = 0, s = e.length; o < s; ++o) I(e, String(o)) ? a.push(d(t, e, r, i, String(o), !0)) : a.push(\"\");\n return n.forEach(function (n) {\n n.match(/^\\d+$/) || a.push(d(t, e, r, i, n, !0));\n }), a;\n }(t, e, i, s, o) : o.map(function (r) {\n return d(t, e, i, s, r, v);\n }), t.seen.pop(), function (t, e, r) {\n return t.reduce(function (t, e) {\n return e.indexOf(\"\\n\"), t + e.replace(/\\u001b\\[\\d\\d?m/g, \"\").length + 1;\n }, 0) > 60 ? r[0] + (\"\" === e ? \"\" : e + \"\\n \") + \" \" + t.join(\",\\n \") + \" \" + r[1] : r[0] + e + \" \" + t.join(\", \") + \" \" + r[1];\n }(l, f, S)) : S[0] + f + S[1];\n }\n function c(t) {\n return \"[\" + Error.prototype.toString.call(t) + \"]\";\n }\n function d(t, e, r, i, n, a) {\n var o, s, h;\n if ((h = Object.getOwnPropertyDescriptor(e, n) || {\n value: e[n]\n }).get ? s = h.set ? t.stylize(\"[Getter/Setter]\", \"special\") : t.stylize(\"[Getter]\", \"special\") : h.set && (s = t.stylize(\"[Setter]\", \"special\")), I(i, n) || (o = \"[\" + n + \"]\"), s || (t.seen.indexOf(h.value) < 0 ? (s = g(r) ? u(t, h.value, null) : u(t, h.value, r - 1)).indexOf(\"\\n\") > -1 && (s = a ? s.split(\"\\n\").map(function (t) {\n return \" \" + t;\n }).join(\"\\n\").substr(2) : \"\\n\" + s.split(\"\\n\").map(function (t) {\n return \" \" + t;\n }).join(\"\\n\")) : s = t.stylize(\"[Circular]\", \"special\")), y(o)) {\n if (a && n.match(/^\\d+$/)) return s;\n (o = JSON.stringify(\"\" + n)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/) ? (o = o.substr(1, o.length - 2), o = t.stylize(o, \"name\")) : (o = o.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), o = t.stylize(o, \"string\"));\n }\n return o + \": \" + s;\n }\n function p(t) {\n return Array.isArray(t);\n }\n function m(t) {\n return \"boolean\" == typeof t;\n }\n function g(t) {\n return null === t;\n }\n function b(t) {\n return \"number\" == typeof t;\n }\n function _(t) {\n return \"string\" == typeof t;\n }\n function y(t) {\n return void 0 === t;\n }\n function w(t) {\n return v(t) && \"[object RegExp]\" === S(t);\n }\n function v(t) {\n return \"object\" == typeof t && null !== t;\n }\n function x(t) {\n return v(t) && \"[object Date]\" === S(t);\n }\n function E(t) {\n return v(t) && (\"[object Error]\" === S(t) || t instanceof Error);\n }\n function k(t) {\n return \"function\" == typeof t;\n }\n function S(t) {\n return Object.prototype.toString.call(t);\n }\n function M(t) {\n return t < 10 ? \"0\" + t.toString(10) : t.toString(10);\n }\n r.debuglog = function (t) {\n if (t = t.toUpperCase(), !a[t]) if (o.test(t)) {\n var i = e.pid;\n a[t] = function () {\n var e = r.format.apply(r, arguments);\n console.error(\"%s %d: %s\", t, i, e);\n };\n } else a[t] = function () {};\n return a[t];\n }, r.inspect = h, h.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n }, h.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n }, r.types = t(\"./support/types\"), r.isArray = p, r.isBoolean = m, r.isNull = g, r.isNullOrUndefined = function (t) {\n return null == t;\n }, r.isNumber = b, r.isString = _, r.isSymbol = function (t) {\n return \"symbol\" == typeof t;\n }, r.isUndefined = y, r.isRegExp = w, r.types.isRegExp = w, r.isObject = v, r.isDate = x, r.types.isDate = x, r.isError = E, r.types.isNativeError = E, r.isFunction = k, r.isPrimitive = function (t) {\n return null === t || \"boolean\" == typeof t || \"number\" == typeof t || \"string\" == typeof t || \"symbol\" == typeof t || void 0 === t;\n }, r.isBuffer = t(\"./support/isBuffer\");\n var A = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n function I(t, e) {\n return Object.prototype.hasOwnProperty.call(t, e);\n }\n r.log = function () {\n var t, e;\n console.log(\"%s - %s\", (t = new Date(), e = [M(t.getHours()), M(t.getMinutes()), M(t.getSeconds())].join(\":\"), [t.getDate(), A[t.getMonth()], e].join(\" \")), r.format.apply(r, arguments));\n }, r.inherits = t(\"inherits\"), r._extend = function (t, e) {\n if (!e || !v(e)) return t;\n for (var r = Object.keys(e), i = r.length; i--;) t[r[i]] = e[r[i]];\n return t;\n };\n var B = \"undefined\" != typeof Symbol ? Symbol(\"util.promisify.custom\") : void 0;\n function T(t, e) {\n if (!t) {\n var r = new Error(\"Promise was rejected with a falsy value\");\n r.reason = t, t = r;\n }\n return e(t);\n }\n r.promisify = function (t) {\n if (\"function\" != typeof t) throw new TypeError('The \"original\" argument must be of type Function');\n if (B && t[B]) {\n var e;\n if (\"function\" != typeof (e = t[B])) throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(e, B, {\n value: e,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), e;\n }\n function e() {\n for (var e, r, i = new Promise(function (t, i) {\n e = t, r = i;\n }), n = [], a = 0; a < arguments.length; a++) n.push(arguments[a]);\n n.push(function (t, i) {\n t ? r(t) : e(i);\n });\n try {\n t.apply(this, n);\n } catch (t) {\n r(t);\n }\n return i;\n }\n return Object.setPrototypeOf(e, Object.getPrototypeOf(t)), B && Object.defineProperty(e, B, {\n value: e,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), Object.defineProperties(e, i(t));\n }, r.promisify.custom = B, r.callbackify = function (t) {\n if (\"function\" != typeof t) throw new TypeError('The \"original\" argument must be of type Function');\n function r() {\n for (var r = [], i = 0; i < arguments.length; i++) r.push(arguments[i]);\n var n = r.pop();\n if (\"function\" != typeof n) throw new TypeError(\"The last argument must be of type Function\");\n var a = this,\n o = function () {\n return n.apply(a, arguments);\n };\n t.apply(this, r).then(function (t) {\n e.nextTick(o.bind(null, null, t));\n }, function (t) {\n e.nextTick(T.bind(null, t, o));\n });\n }\n return Object.setPrototypeOf(r, Object.getPrototypeOf(t)), Object.defineProperties(r, i(t)), r;\n };\n }).call(this);\n }).call(this, t(\"_process\"));\n }, {\n \"./support/isBuffer\": 79,\n \"./support/types\": 80,\n _process: 60,\n inherits: 45\n }],\n 82: [function (t, e, i) {\n (function (r) {\n (function () {\n \"use strict\";\n\n var i = t(\"foreach\"),\n n = t(\"available-typed-arrays\"),\n a = t(\"es-abstract/helpers/callBound\"),\n o = a(\"Object.prototype.toString\"),\n s = t(\"has-symbols\")() && \"symbol\" == typeof Symbol.toStringTag,\n h = n(),\n l = a(\"String.prototype.slice\"),\n f = {},\n u = t(\"es-abstract/helpers/getOwnPropertyDescriptor\"),\n c = Object.getPrototypeOf;\n s && u && c && i(h, function (t) {\n if (\"function\" == typeof r[t]) {\n var e = new r[t]();\n if (!(Symbol.toStringTag in e)) throw new EvalError(\"this engine has support for Symbol.toStringTag, but \" + t + \" does not have the property! Please report this.\");\n var i = c(e),\n n = u(i, Symbol.toStringTag);\n if (!n) {\n var a = c(i);\n n = u(a, Symbol.toStringTag);\n }\n f[t] = n.get;\n }\n });\n var d = t(\"is-typed-array\");\n e.exports = function (t) {\n return !!d(t) && (s ? function (t) {\n var e = !1;\n return i(f, function (r, i) {\n if (!e) try {\n var n = r.call(t);\n n === i && (e = n);\n } catch (t) {}\n }), e;\n }(t) : l(o(t), 8, -1));\n };\n }).call(this);\n }).call(this, void 0 !== r.g ? r.g : \"undefined\" != typeof self ? self : \"undefined\" != typeof window ? window : {});\n }, {\n \"available-typed-arrays\": 27,\n \"es-abstract/helpers/callBound\": 36,\n \"es-abstract/helpers/getOwnPropertyDescriptor\": 37,\n foreach: 39,\n \"has-symbols\": 42,\n \"is-typed-array\": 48\n }]\n }, {}, [20])(20);\n },\n 4406: t => {\n var e = t.exports = {};\n e.nextTick = function () {\n var t = \"undefined\" != typeof window && window.setImmediate,\n e = \"undefined\" != typeof window && window.postMessage && window.addEventListener;\n if (t) return function (t) {\n return window.setImmediate(t);\n };\n if (e) {\n var r = [];\n return window.addEventListener(\"message\", function (t) {\n var e = t.source;\n e !== window && null !== e || \"process-tick\" !== t.data || (t.stopPropagation(), r.length > 0 && r.shift()());\n }, !0), function (t) {\n r.push(t), window.postMessage(\"process-tick\", \"*\");\n };\n }\n return function (t) {\n setTimeout(t, 0);\n };\n }(), e.title = \"browser\", e.browser = !0, e.env = {}, e.argv = [], e.binding = function (t) {\n throw new Error(\"process.binding is not supported\");\n }, e.cwd = function () {\n return \"/\";\n }, e.chdir = function (t) {\n throw new Error(\"process.chdir is not supported\");\n };\n },\n 6197: (t, e, r) => {\n \"use strict\";\n\n var i = r(8834).lW;\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.AbstractTokenizer = void 0;\n const n = r(4644);\n e.AbstractTokenizer = class {\n constructor(t) {\n this.position = 0, this.numBuffer = new Uint8Array(8), this.fileInfo = t || {};\n }\n async readToken(t, e = this.position) {\n const r = i.alloc(t.len);\n if ((await this.readBuffer(r, {\n position: e\n })) < t.len) throw new n.EndOfStreamError();\n return t.get(r, 0);\n }\n async peekToken(t, e = this.position) {\n const r = i.alloc(t.len);\n if ((await this.peekBuffer(r, {\n position: e\n })) < t.len) throw new n.EndOfStreamError();\n return t.get(r, 0);\n }\n async readNumber(t) {\n if ((await this.readBuffer(this.numBuffer, {\n length: t.len\n })) < t.len) throw new n.EndOfStreamError();\n return t.get(this.numBuffer, 0);\n }\n async peekNumber(t) {\n if ((await this.peekBuffer(this.numBuffer, {\n length: t.len\n })) < t.len) throw new n.EndOfStreamError();\n return t.get(this.numBuffer, 0);\n }\n async ignore(t) {\n if (void 0 !== this.fileInfo.size) {\n const e = this.fileInfo.size - this.position;\n if (t > e) return this.position += e, e;\n }\n return this.position += t, t;\n }\n async close() {}\n normalizeOptions(t, e) {\n if (e && void 0 !== e.position && e.position < this.position) throw new Error(\"`options.position` must be equal or greater than `tokenizer.position`\");\n return e ? {\n mayBeLess: !0 === e.mayBeLess,\n offset: e.offset ? e.offset : 0,\n length: e.length ? e.length : t.length - (e.offset ? e.offset : 0),\n position: e.position ? e.position : this.position\n } : {\n mayBeLess: !1,\n offset: 0,\n length: t.length,\n position: this.position\n };\n }\n };\n },\n 932: (t, e, r) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.BufferTokenizer = void 0;\n const i = r(4644),\n n = r(6197);\n class a extends n.AbstractTokenizer {\n constructor(t, e) {\n super(e), this.uint8Array = t, this.fileInfo.size = this.fileInfo.size ? this.fileInfo.size : t.length;\n }\n async readBuffer(t, e) {\n if (e && e.position) {\n if (e.position < this.position) throw new Error(\"`options.position` must be equal or greater than `tokenizer.position`\");\n this.position = e.position;\n }\n const r = await this.peekBuffer(t, e);\n return this.position += r, r;\n }\n async peekBuffer(t, e) {\n const r = this.normalizeOptions(t, e),\n n = Math.min(this.uint8Array.length - r.position, r.length);\n if (!r.mayBeLess && n < r.length) throw new i.EndOfStreamError();\n return t.set(this.uint8Array.subarray(r.position, r.position + n), r.offset), n;\n }\n async close() {}\n }\n e.BufferTokenizer = a;\n },\n 9425: (t, e, r) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.fromFile = e.FileTokenizer = void 0;\n const i = r(6197),\n n = r(4644),\n a = r(5187);\n class o extends i.AbstractTokenizer {\n constructor(t, e) {\n super(e), this.fd = t;\n }\n async readBuffer(t, e) {\n const r = this.normalizeOptions(t, e);\n this.position = r.position;\n const i = await a.read(this.fd, t, r.offset, r.length, r.position);\n if (this.position += i.bytesRead, i.bytesRead < r.length && (!e || !e.mayBeLess)) throw new n.EndOfStreamError();\n return i.bytesRead;\n }\n async peekBuffer(t, e) {\n const r = this.normalizeOptions(t, e),\n i = await a.read(this.fd, t, r.offset, r.length, r.position);\n if (!r.mayBeLess && i.bytesRead < r.length) throw new n.EndOfStreamError();\n return i.bytesRead;\n }\n async close() {\n return a.close(this.fd);\n }\n }\n e.FileTokenizer = o, e.fromFile = async function (t) {\n const e = await a.stat(t);\n if (!e.isFile) throw new Error(`File not a file: ${t}`);\n const r = await a.open(t, \"r\");\n return new o(r, {\n path: t,\n size: e.size\n });\n };\n },\n 5187: (t, e, r) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.readFile = e.writeFileSync = e.writeFile = e.read = e.open = e.close = e.stat = e.createReadStream = e.pathExists = void 0;\n const i = r(6777);\n e.pathExists = i.existsSync, e.createReadStream = i.createReadStream, e.stat = async function (t) {\n return new Promise((e, r) => {\n i.stat(t, (t, i) => {\n t ? r(t) : e(i);\n });\n });\n }, e.close = async function (t) {\n return new Promise((e, r) => {\n i.close(t, t => {\n t ? r(t) : e();\n });\n });\n }, e.open = async function (t, e) {\n return new Promise((r, n) => {\n i.open(t, e, (t, e) => {\n t ? n(t) : r(e);\n });\n });\n }, e.read = async function (t, e, r, n, a) {\n return new Promise((o, s) => {\n i.read(t, e, r, n, a, (t, e, r) => {\n t ? s(t) : o({\n bytesRead: e,\n buffer: r\n });\n });\n });\n }, e.writeFile = async function (t, e) {\n return new Promise((r, n) => {\n i.writeFile(t, e, t => {\n t ? n(t) : r();\n });\n });\n }, e.writeFileSync = function (t, e) {\n i.writeFileSync(t, e);\n }, e.readFile = async function (t) {\n return new Promise((e, r) => {\n i.readFile(t, (t, i) => {\n t ? r(t) : e(i);\n });\n });\n };\n },\n 8286: (t, e, r) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.ReadStreamTokenizer = void 0;\n const i = r(6197),\n n = r(4644);\n class a extends i.AbstractTokenizer {\n constructor(t, e) {\n super(e), this.streamReader = new n.StreamReader(t);\n }\n async getFileInfo() {\n return this.fileInfo;\n }\n async readBuffer(t, e) {\n const r = this.normalizeOptions(t, e),\n i = r.position - this.position;\n if (i > 0) return await this.ignore(i), this.readBuffer(t, e);\n if (i < 0) throw new Error(\"`options.position` must be equal or greater than `tokenizer.position`\");\n if (0 === r.length) return 0;\n const a = await this.streamReader.read(t, r.offset, r.length);\n if (this.position += a, (!e || !e.mayBeLess) && a < r.length) throw new n.EndOfStreamError();\n return a;\n }\n async peekBuffer(t, e) {\n const r = this.normalizeOptions(t, e);\n let i = 0;\n if (r.position) {\n const e = r.position - this.position;\n if (e > 0) {\n const n = new Uint8Array(r.length + e);\n return i = await this.peekBuffer(n, {\n mayBeLess: r.mayBeLess\n }), t.set(n.subarray(e), r.offset), i - e;\n }\n if (e < 0) throw new Error(\"Cannot peek from a negative offset in a stream\");\n }\n if (r.length > 0) {\n try {\n i = await this.streamReader.peek(t, r.offset, r.length);\n } catch (t) {\n if (e && e.mayBeLess && t instanceof n.EndOfStreamError) return 0;\n throw t;\n }\n if (!r.mayBeLess && i < r.length) throw new n.EndOfStreamError();\n }\n return i;\n }\n async ignore(t) {\n const e = Math.min(256e3, t),\n r = new Uint8Array(e);\n let i = 0;\n for (; i < t;) {\n const n = t - i,\n a = await this.readBuffer(r, {\n length: Math.min(e, n)\n });\n if (a < 0) return a;\n i += a;\n }\n return i;\n }\n }\n e.ReadStreamTokenizer = a;\n },\n 7378: (t, e, r) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.fromBuffer = e.fromStream = e.EndOfStreamError = void 0;\n const i = r(8286),\n n = r(932);\n var a = r(4644);\n Object.defineProperty(e, \"EndOfStreamError\", {\n enumerable: !0,\n get: function () {\n return a.EndOfStreamError;\n }\n }), e.fromStream = function (t, e) {\n return e = e || {}, new i.ReadStreamTokenizer(t, e);\n }, e.fromBuffer = function (t, e) {\n return new n.BufferTokenizer(t, e);\n };\n },\n 3569: (t, e, r) => {\n \"use strict\";\n\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.fromStream = e.fromBuffer = e.EndOfStreamError = e.fromFile = void 0;\n const i = r(5187),\n n = r(7378);\n var a = r(9425);\n Object.defineProperty(e, \"fromFile\", {\n enumerable: !0,\n get: function () {\n return a.fromFile;\n }\n });\n var o = r(7378);\n Object.defineProperty(e, \"EndOfStreamError\", {\n enumerable: !0,\n get: function () {\n return o.EndOfStreamError;\n }\n }), Object.defineProperty(e, \"fromBuffer\", {\n enumerable: !0,\n get: function () {\n return o.fromBuffer;\n }\n }), e.fromStream = async function (t, e) {\n if (e = e || {}, t.path) {\n const r = await i.stat(t.path);\n e.path = t.path, e.size = r.size;\n }\n return n.fromStream(t, e);\n };\n },\n 643: (t, e) => {\n \"use strict\";\n\n var r = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (t) {\n return typeof t;\n } : function (t) {\n return t && \"function\" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? \"symbol\" : typeof t;\n };\n e.Ee = function (t, e, r, i, n, a) {\n for (var o = arguments.length, h = Array(o > 6 ? o - 6 : 0), l = 6; l < o; l++) h[l - 6] = arguments[l];\n return h.length ? s.call.apply(s, [null, !1, !0, t, e, r, i, n, a].concat(h)) : s(!1, !0, t, e, r, i, n, a);\n };\n var i = \"INVALID_ARGS\";\n function n(t) {\n throw new Error(t);\n }\n function a(t) {\n var e = Object.keys(t);\n return Object.getOwnPropertySymbols ? e.concat(Object.getOwnPropertySymbols(t)) : e;\n }\n function o(t) {\n if (Array.isArray(t)) return t.slice();\n for (var e = a(t), r = {}, i = 0; i < e.length; i++) {\n var n = e[i];\n r[n] = t[n];\n }\n return r;\n }\n function s(t, e, r) {\n var l = r;\n null == l && n(i);\n for (var f = !1, u = arguments.length, c = Array(u > 3 ? u - 3 : 0), d = 3; d < u; d++) c[d - 3] = arguments[d];\n for (var p = 0; p < c.length; p++) {\n var m = c[p];\n if (null != m) {\n var g = a(m);\n if (g.length) for (var b = 0; b <= g.length; b++) {\n var _ = g[b];\n if (!t || void 0 === l[_]) {\n var y = m[_];\n e && h(l[_]) && h(y) && (y = s(t, e, l[_], y)), void 0 !== y && y !== l[_] && (f || (f = !0, l = o(l)), l[_] = y);\n }\n }\n }\n }\n return l;\n }\n function h(t) {\n var e = void 0 === t ? \"undefined\" : r(t);\n return null != t && \"object\" === e;\n }\n },\n 5010: (t, e, r) => {\n \"use strict\";\n\n var i = r(8834).lW;\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.AnsiStringType = e.StringType = e.BufferType = e.Uint8ArrayType = e.IgnoreType = e.Float80_LE = e.Float80_BE = e.Float64_LE = e.Float64_BE = e.Float32_LE = e.Float32_BE = e.Float16_LE = e.Float16_BE = e.INT64_BE = e.UINT64_BE = e.INT64_LE = e.UINT64_LE = e.INT32_LE = e.INT32_BE = e.INT24_BE = e.INT24_LE = e.INT16_LE = e.INT16_BE = e.INT8 = e.UINT32_BE = e.UINT32_LE = e.UINT24_BE = e.UINT24_LE = e.UINT16_BE = e.UINT16_LE = e.UINT8 = void 0;\n const n = r(2333);\n function a(t) {\n return new DataView(t.buffer, t.byteOffset);\n }\n e.UINT8 = {\n len: 1,\n get: (t, e) => a(t).getUint8(e),\n put: (t, e, r) => (a(t).setUint8(e, r), e + 1)\n }, e.UINT16_LE = {\n len: 2,\n get: (t, e) => a(t).getUint16(e, !0),\n put: (t, e, r) => (a(t).setUint16(e, r, !0), e + 2)\n }, e.UINT16_BE = {\n len: 2,\n get: (t, e) => a(t).getUint16(e),\n put: (t, e, r) => (a(t).setUint16(e, r), e + 2)\n }, e.UINT24_LE = {\n len: 3,\n get(t, e) {\n const r = a(t);\n return r.getUint8(e) + (r.getUint16(e + 1, !0) << 8);\n },\n put(t, e, r) {\n const i = a(t);\n return i.setUint8(e, 255 & r), i.setUint16(e + 1, r >> 8, !0), e + 3;\n }\n }, e.UINT24_BE = {\n len: 3,\n get(t, e) {\n const r = a(t);\n return (r.getUint16(e) << 8) + r.getUint8(e + 2);\n },\n put(t, e, r) {\n const i = a(t);\n return i.setUint16(e, r >> 8), i.setUint8(e + 2, 255 & r), e + 3;\n }\n }, e.UINT32_LE = {\n len: 4,\n get: (t, e) => a(t).getUint32(e, !0),\n put: (t, e, r) => (a(t).setUint32(e, r, !0), e + 4)\n }, e.UINT32_BE = {\n len: 4,\n get: (t, e) => a(t).getUint32(e),\n put: (t, e, r) => (a(t).setUint32(e, r), e + 4)\n }, e.INT8 = {\n len: 1,\n get: (t, e) => a(t).getInt8(e),\n put: (t, e, r) => (a(t).setInt8(e, r), e + 1)\n }, e.INT16_BE = {\n len: 2,\n get: (t, e) => a(t).getInt16(e),\n put: (t, e, r) => (a(t).setInt16(e, r), e + 2)\n }, e.INT16_LE = {\n len: 2,\n get: (t, e) => a(t).getInt16(e, !0),\n put: (t, e, r) => (a(t).setInt16(e, r, !0), e + 2)\n }, e.INT24_LE = {\n len: 3,\n get(t, r) {\n const i = e.UINT24_LE.get(t, r);\n return i > 8388607 ? i - 16777216 : i;\n },\n put(t, e, r) {\n const i = a(t);\n return i.setUint8(e, 255 & r), i.setUint16(e + 1, r >> 8, !0), e + 3;\n }\n }, e.INT24_BE = {\n len: 3,\n get(t, r) {\n const i = e.UINT24_BE.get(t, r);\n return i > 8388607 ? i - 16777216 : i;\n },\n put(t, e, r) {\n const i = a(t);\n return i.setUint16(e, r >> 8), i.setUint8(e + 2, 255 & r), e + 3;\n }\n }, e.INT32_BE = {\n len: 4,\n get: (t, e) => a(t).getInt32(e),\n put: (t, e, r) => (a(t).setInt32(e, r), e + 4)\n }, e.INT32_LE = {\n len: 4,\n get: (t, e) => a(t).getInt32(e, !0),\n put: (t, e, r) => (a(t).setInt32(e, r, !0), e + 4)\n }, e.UINT64_LE = {\n len: 8,\n get: (t, e) => a(t).getBigUint64(e, !0),\n put: (t, e, r) => (a(t).setBigUint64(e, r, !0), e + 8)\n }, e.INT64_LE = {\n len: 8,\n get: (t, e) => a(t).getBigInt64(e, !0),\n put: (t, e, r) => (a(t).setBigInt64(e, r, !0), e + 8)\n }, e.UINT64_BE = {\n len: 8,\n get: (t, e) => a(t).getBigUint64(e),\n put: (t, e, r) => (a(t).setBigUint64(e, r), e + 8)\n }, e.INT64_BE = {\n len: 8,\n get: (t, e) => a(t).getBigInt64(e),\n put: (t, e, r) => (a(t).setBigInt64(e, r), e + 8)\n }, e.Float16_BE = {\n len: 2,\n get(t, e) {\n return n.read(t, e, !1, 10, this.len);\n },\n put(t, e, r) {\n return n.write(t, r, e, !1, 10, this.len), e + this.len;\n }\n }, e.Float16_LE = {\n len: 2,\n get(t, e) {\n return n.read(t, e, !0, 10, this.len);\n },\n put(t, e, r) {\n return n.write(t, r, e, !0, 10, this.len), e + this.len;\n }\n }, e.Float32_BE = {\n len: 4,\n get: (t, e) => a(t).getFloat32(e),\n put: (t, e, r) => (a(t).setFloat32(e, r), e + 4)\n }, e.Float32_LE = {\n len: 4,\n get: (t, e) => a(t).getFloat32(e, !0),\n put: (t, e, r) => (a(t).setFloat32(e, r, !0), e + 4)\n }, e.Float64_BE = {\n len: 8,\n get: (t, e) => a(t).getFloat64(e),\n put: (t, e, r) => (a(t).setFloat64(e, r), e + 8)\n }, e.Float64_LE = {\n len: 8,\n get: (t, e) => a(t).getFloat64(e, !0),\n put: (t, e, r) => (a(t).setFloat64(e, r, !0), e + 8)\n }, e.Float80_BE = {\n len: 10,\n get(t, e) {\n return n.read(t, e, !1, 63, this.len);\n },\n put(t, e, r) {\n return n.write(t, r, e, !1, 63, this.len), e + this.len;\n }\n }, e.Float80_LE = {\n len: 10,\n get(t, e) {\n return n.read(t, e, !0, 63, this.len);\n },\n put(t, e, r) {\n return n.write(t, r, e, !0, 63, this.len), e + this.len;\n }\n }, e.IgnoreType = class {\n constructor(t) {\n this.len = t;\n }\n get(t, e) {}\n }, e.Uint8ArrayType = class {\n constructor(t) {\n this.len = t;\n }\n get(t, e) {\n return t.subarray(e, e + this.len);\n }\n }, e.BufferType = class {\n constructor(t) {\n this.len = t;\n }\n get(t, e) {\n return i.from(t.subarray(e, e + this.len));\n }\n }, e.StringType = class {\n constructor(t, e) {\n this.len = t, this.encoding = e;\n }\n get(t, e) {\n return i.from(t).toString(this.encoding, e, e + this.len);\n }\n };\n class o {\n constructor(t) {\n this.len = t;\n }\n static decode(t, e, r) {\n let i = \"\";\n for (let n = e; n < r; ++n) i += o.codePointToString(o.singleByteDecoder(t[n]));\n return i;\n }\n static inRange(t, e, r) {\n return e <= t && t <= r;\n }\n static codePointToString(t) {\n return t <= 65535 ? String.fromCharCode(t) : (t -= 65536, String.fromCharCode(55296 + (t >> 10), 56320 + (1023 & t)));\n }\n static singleByteDecoder(t) {\n if (o.inRange(t, 0, 127)) return t;\n const e = o.windows1252[t - 128];\n if (null === e) throw Error(\"invaliding encoding\");\n return e;\n }\n get(t, e = 0) {\n return o.decode(t, e, e + this.len);\n }\n }\n e.AnsiStringType = o, o.windows1252 = [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, 141, 381, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, 157, 382, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255];\n },\n 311: (t, e) => {\n (e = t.exports = function (t) {\n return t.replace(/^\\s*|\\s*$/g, \"\");\n }).left = function (t) {\n return t.replace(/^\\s*/, \"\");\n }, e.right = function (t) {\n return t.replace(/\\s*$/, \"\");\n };\n },\n 9299: (t, e, r) => {\n var i = r(4406);\n !function () {\n var e = {};\n function n() {\n void 0 === i && console.log.apply(console, arguments);\n }\n t.exports = e, function (t, e) {\n var r, i, a, o, s, h, l, f, u, c, d, p, m, g, b;\n !function () {\n \"use strict\";\n\n var e = function () {\n function t(t) {\n this.message = \"JPEG error: \" + t;\n }\n return t.prototype = new Error(), t.prototype.name = \"JpegError\", t.constructor = t, t;\n }(),\n r = function () {\n var t = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]),\n r = 4017,\n n = 799,\n a = 3406,\n o = 2276,\n s = 1567,\n h = 3784,\n l = 5793,\n f = 2896;\n function u(t) {\n null == t && (t = {}), null == t.w && (t.w = -1), this.V = t.n, this.N = t.w;\n }\n function c(t, e) {\n for (var r, i, n, a = 0, o = [], s = 16; s > 0 && !t[s - 1];) s--;\n o.push({\n children: [],\n index: 0\n });\n var h = o[0];\n for (r = 0; r < s; r++) {\n for (i = 0; i < t[r]; i++) {\n for ((h = o.pop()).children[h.index] = e[a]; h.index > 0;) h = o.pop();\n for (h.index++, o.push(h); o.length <= r;) o.push(n = {\n children: [],\n index: 0\n }), h.children[h.index] = n.children, h = n;\n a++;\n }\n r + 1 < s && (o.push(n = {\n children: [],\n index: 0\n }), h.children[h.index] = n.children, h = n);\n }\n return o[0].children;\n }\n function d(t, e, r) {\n return 64 * ((t.P + 1) * e + r);\n }\n function p(r, n, a, o, s, h, l, f, u, c) {\n null == c && (c = !1);\n var p,\n m,\n g,\n _,\n y,\n w,\n v,\n x,\n E,\n k,\n S,\n M = a.m,\n A = a.Z,\n I = n,\n B = 0,\n T = 0,\n R = 0,\n P = 0,\n O = 0,\n L = 0;\n function C() {\n if (T > 0) return T--, B >> T & 1;\n if (255 === (B = r[n++])) {\n var t = r[n++];\n if (t) {\n if (220 === t && c) {\n var o = i(r, n += 2);\n if (n += 2, o > 0 && o !== a.s) throw new DNLMarkerError(\"Found DNL marker (0xFFDC) while parsing scan data\", o);\n } else if (217 === t) {\n if (c) {\n var s = 8 * O;\n if (s > 0 && s < a.s / 10) throw new DNLMarkerError(\"Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter\", s);\n }\n throw new EOIMarkerError(\"Found EOI marker (0xFFD9) while parsing scan data\");\n }\n throw new e(\"unexpected marker\");\n }\n }\n return T = 7, B >>> 7;\n }\n function U(t) {\n for (var r = t;;) {\n switch (typeof (r = r[C()])) {\n case \"number\":\n return r;\n case \"object\":\n continue;\n }\n throw new e(\"invalid huffman sequence\");\n }\n }\n function z(t) {\n for (var e = 0; t > 0;) e = e << 1 | C(), t--;\n return e;\n }\n function D(t) {\n if (1 === t) return 1 === C() ? 1 : -1;\n var e = z(t);\n return e >= 1 << t - 1 ? e : e + (-1 << t) + 1;\n }\n function N(t, e, r, i, n) {\n var a = r % M;\n O = (r / M | 0) * t.A + i;\n var o = a * t.h + n;\n e(t, d(t, O, o));\n }\n function F(t, e, r) {\n O = r / t.P | 0;\n var i = r % t.P;\n e(t, d(t, O, i));\n }\n var j = o.length;\n for (v = A ? 0 === h ? 0 === f ? function (t, e) {\n var r = U(t.J),\n i = 0 === r ? 0 : D(r) << u;\n t.D[e] = t.Q += i;\n } : function (t, e) {\n t.D[e] |= C() << u;\n } : 0 === f ? function (e, r) {\n if (R > 0) R--;else for (var i = h, n = l; i <= n;) {\n var a = U(e.i),\n o = 15 & a,\n s = a >> 4;\n if (0 !== o) {\n var f = t[i += s];\n e.D[r + f] = D(o) * (1 << u), i++;\n } else {\n if (s < 15) {\n R = z(s) + (1 << s) - 1;\n break;\n }\n i += 16;\n }\n }\n } : function (r, i) {\n for (var n, a, o = h, s = l, f = 0; o <= s;) {\n var c = i + t[o],\n d = r.D[c] < 0 ? -1 : 1;\n switch (P) {\n case 0:\n if (f = (a = U(r.i)) >> 4, 0 == (n = 15 & a)) f < 15 ? (R = z(f) + (1 << f), P = 4) : (f = 16, P = 1);else {\n if (1 !== n) throw new e(\"invalid ACn encoding\");\n p = D(n), P = f ? 2 : 3;\n }\n continue;\n case 1:\n case 2:\n r.D[c] ? r.D[c] += d * (C() << u) : 0 == --f && (P = 2 === P ? 3 : 0);\n break;\n case 3:\n r.D[c] ? r.D[c] += d * (C() << u) : (r.D[c] = p << u, P = 0);\n break;\n case 4:\n r.D[c] && (r.D[c] += d * (C() << u));\n }\n o++;\n }\n 4 === P && 0 == --R && (P = 0);\n } : function (e, r) {\n var i = U(e.J),\n n = 0 === i ? 0 : D(i),\n a = 1;\n for (e.D[r] = e.Q += n; a < 64;) {\n var o = U(e.i),\n s = 15 & o,\n h = o >> 4;\n if (0 !== s) {\n var l = t[a += h];\n e.D[r + l] = D(s), a++;\n } else {\n if (h < 15) break;\n a += 16;\n }\n }\n }, E = 1 === j ? o[0].P * o[0].c : M * a.R; L <= E;) {\n var G = s ? Math.min(E - L, s) : E;\n if (G > 0) {\n for (g = 0; g < j; g++) o[g].Q = 0;\n if (R = 0, 1 === j) for (m = o[0], w = 0; w < G; w++) F(m, v, L), L++;else for (w = 0; w < G; w++) {\n for (g = 0; g < j; g++) for (k = (m = o[g]).h, S = m.A, _ = 0; _ < S; _++) for (y = 0; y < k; y++) N(m, v, L, _, y);\n L++;\n }\n }\n if (T = 0, !(x = b(r, n))) break;\n if (x.u && (n = x.offset), !(x.M >= 65488 && x.M <= 65495)) break;\n n += 2;\n }\n return n - I;\n }\n function m(t, i, u) {\n var c,\n d,\n p,\n m,\n g,\n b,\n _,\n y,\n w,\n v,\n x,\n E,\n k,\n S,\n M,\n A,\n I,\n B = t.$,\n T = t.D;\n if (!B) throw new e(\"missing required Quantization Table.\");\n for (var R = 0; R < 64; R += 8) w = T[i + R], v = T[i + R + 1], x = T[i + R + 2], E = T[i + R + 3], k = T[i + R + 4], S = T[i + R + 5], M = T[i + R + 6], A = T[i + R + 7], w *= B[R], 0 != (v | x | E | k | S | M | A) ? (v *= B[R + 1], x *= B[R + 2], E *= B[R + 3], k *= B[R + 4], S *= B[R + 5], M *= B[R + 6], A *= B[R + 7], d = (c = (c = l * w + 128 >> 8) + (d = l * k + 128 >> 8) + 1 >> 1) - d, I = (p = x) * h + (m = M) * s + 128 >> 8, p = p * s - m * h + 128 >> 8, _ = (g = (g = f * (v - A) + 128 >> 8) + (_ = S << 4) + 1 >> 1) - _, b = (y = (y = f * (v + A) + 128 >> 8) + (b = E << 4) + 1 >> 1) - b, m = (c = c + (m = I) + 1 >> 1) - m, p = (d = d + p + 1 >> 1) - p, I = g * o + y * a + 2048 >> 12, g = g * a - y * o + 2048 >> 12, y = I, I = b * n + _ * r + 2048 >> 12, b = b * r - _ * n + 2048 >> 12, _ = I, u[R] = c + y, u[R + 7] = c - y, u[R + 1] = d + _, u[R + 6] = d - _, u[R + 2] = p + b, u[R + 5] = p - b, u[R + 3] = m + g, u[R + 4] = m - g) : (I = l * w + 512 >> 10, u[R] = I, u[R + 1] = I, u[R + 2] = I, u[R + 3] = I, u[R + 4] = I, u[R + 5] = I, u[R + 6] = I, u[R + 7] = I);\n for (var P = 0; P < 8; ++P) w = u[P], 0 != ((v = u[P + 8]) | (x = u[P + 16]) | (E = u[P + 24]) | (k = u[P + 32]) | (S = u[P + 40]) | (M = u[P + 48]) | (A = u[P + 56])) ? (d = (c = 4112 + ((c = l * w + 2048 >> 12) + (d = l * k + 2048 >> 12) + 1 >> 1)) - d, I = (p = x) * h + (m = M) * s + 2048 >> 12, p = p * s - m * h + 2048 >> 12, m = I, _ = (g = (g = f * (v - A) + 2048 >> 12) + (_ = S) + 1 >> 1) - _, b = (y = (y = f * (v + A) + 2048 >> 12) + (b = E) + 1 >> 1) - b, I = g * o + y * a + 2048 >> 12, g = g * a - y * o + 2048 >> 12, y = I, I = b * n + _ * r + 2048 >> 12, b = b * r - _ * n + 2048 >> 12, (w = (c = c + m + 1 >> 1) + y) < 16 ? w = 0 : w >= 4080 ? w = 255 : w >>= 4, (v = (d = d + p + 1 >> 1) + (_ = I)) < 16 ? v = 0 : v >= 4080 ? v = 255 : v >>= 4, (x = (p = d - p) + b) < 16 ? x = 0 : x >= 4080 ? x = 255 : x >>= 4, (E = (m = c - m) + g) < 16 ? E = 0 : E >= 4080 ? E = 255 : E >>= 4, (k = m - g) < 16 ? k = 0 : k >= 4080 ? k = 255 : k >>= 4, (S = p - b) < 16 ? S = 0 : S >= 4080 ? S = 255 : S >>= 4, (M = d - _) < 16 ? M = 0 : M >= 4080 ? M = 255 : M >>= 4, (A = c - y) < 16 ? A = 0 : A >= 4080 ? A = 255 : A >>= 4, T[i + P] = w, T[i + P + 8] = v, T[i + P + 16] = x, T[i + P + 24] = E, T[i + P + 32] = k, T[i + P + 40] = S, T[i + P + 48] = M, T[i + P + 56] = A) : (I = (I = l * w + 8192 >> 14) < -2040 ? 0 : I >= 2024 ? 255 : I + 2056 >> 4, T[i + P] = I, T[i + P + 8] = I, T[i + P + 16] = I, T[i + P + 24] = I, T[i + P + 32] = I, T[i + P + 40] = I, T[i + P + 48] = I, T[i + P + 56] = I);\n }\n function g(t, e) {\n for (var r = e.P, i = e.c, n = new Int16Array(64), a = 0; a < i; a++) for (var o = 0; o < r; o++) m(e, d(e, a, o), n);\n return e.D;\n }\n function b(t, e, r) {\n null == r && (r = e);\n var n = t.length - 1,\n a = r < e ? r : e;\n if (e >= n) return null;\n var o = i(t, e);\n if (o >= 65472 && o <= 65534) return {\n u: null,\n M: o,\n offset: e\n };\n for (var s = i(t, a); !(s >= 65472 && s <= 65534);) {\n if (++a >= n) return null;\n s = i(t, a);\n }\n return {\n u: o.toString(16),\n M: s,\n offset: a\n };\n }\n return u.prototype = {\n parse(r, n) {\n null == n && (n = {});\n var a,\n o,\n s = n.F,\n h = 0,\n l = null,\n f = null,\n u = 0;\n function d() {\n var t = i(r, h),\n e = (h += 2) + t - 2,\n n = b(r, e, h);\n n && n.u && (e = n.offset);\n var a = r.subarray(h, e);\n return h += a.length, a;\n }\n function m(t) {\n for (var e = Math.ceil(t.o / 8 / t.X), r = Math.ceil(t.s / 8 / t.B), i = 0; i < t.W.length; i++) {\n G = t.W[i];\n var n = Math.ceil(Math.ceil(t.o / 8) * G.h / t.X),\n a = Math.ceil(Math.ceil(t.s / 8) * G.A / t.B),\n o = e * G.h,\n s = r * G.A * 64 * (o + 1);\n G.D = new Int16Array(s), G.P = n, G.c = a;\n }\n t.m = e, t.R = r;\n }\n var _ = [],\n y = [],\n w = [],\n v = i(r, h);\n if (h += 2, 65496 !== v) throw new e(\"SOI not found\");\n v = i(r, h), h += 2;\n t: for (; 65497 !== v;) {\n var x, E, k;\n switch (v) {\n case 65504:\n case 65505:\n case 65506:\n case 65507:\n case 65508:\n case 65509:\n case 65510:\n case 65511:\n case 65512:\n case 65513:\n case 65514:\n case 65515:\n case 65516:\n case 65517:\n case 65518:\n case 65519:\n case 65534:\n var S = d();\n 65504 === v && 74 === S[0] && 70 === S[1] && 73 === S[2] && 70 === S[3] && 0 === S[4] && (l = {\n version: {\n d: S[5],\n T: S[6]\n },\n K: S[7],\n j: S[8] << 8 | S[9],\n H: S[10] << 8 | S[11],\n S: S[12],\n I: S[13],\n C: S.subarray(14, 14 + 3 * S[12] * S[13])\n }), 65518 === v && 65 === S[0] && 100 === S[1] && 111 === S[2] && 98 === S[3] && 101 === S[4] && (f = {\n version: S[5] << 8 | S[6],\n k: S[7] << 8 | S[8],\n q: S[9] << 8 | S[10],\n a: S[11]\n });\n break;\n case 65499:\n for (var M = i(r, h) + (h += 2) - 2; h < M;) {\n var A = r[h++],\n I = new Uint16Array(64);\n if (A >> 4 == 0) for (E = 0; E < 64; E++) I[t[E]] = r[h++];else {\n if (A >> 4 != 1) throw new e(\"DQT - invalid table spec\");\n for (E = 0; E < 64; E++) I[t[E]] = i(r, h), h += 2;\n }\n _[15 & A] = I;\n }\n break;\n case 65472:\n case 65473:\n case 65474:\n if (a) throw new e(\"Only single frame JPEGs supported\");\n h += 2, (a = {}).G = 65473 === v, a.Z = 65474 === v, a.precision = r[h++];\n var B,\n T = i(r, h),\n R = 0,\n P = 0;\n h += 2, a.s = s || T, a.o = i(r, h), h += 2, a.W = [], a._ = {};\n var O = r[h++];\n for (x = 0; x < O; x++) {\n B = r[h];\n var L = r[h + 1] >> 4,\n C = 15 & r[h + 1];\n R < L && (R = L), P < C && (P = C);\n var U = r[h + 2];\n k = a.W.push({\n h: L,\n A: C,\n L: U,\n $: null\n }), a._[B] = k - 1, h += 3;\n }\n a.X = R, a.B = P, m(a);\n break;\n case 65476:\n var z = i(r, h);\n for (h += 2, x = 2; x < z;) {\n var D = r[h++],\n N = new Uint8Array(16),\n F = 0;\n for (E = 0; E < 16; E++, h++) F += N[E] = r[h];\n var j = new Uint8Array(F);\n for (E = 0; E < F; E++, h++) j[E] = r[h];\n x += 17 + F, (D >> 4 == 0 ? w : y)[15 & D] = c(N, j);\n }\n break;\n case 65501:\n o = i(r, h += 2), h += 2;\n break;\n case 65498:\n var G,\n H = 1 == ++u && !s;\n h += 2;\n var W = r[h++],\n q = [];\n for (x = 0; x < W; x++) {\n var Z = r[h++],\n Y = a._[Z];\n (G = a.W[Y]).index = Z;\n var V = r[h++];\n G.J = w[V >> 4], G.i = y[15 & V], q.push(G);\n }\n var X = r[h++],\n J = r[h++],\n Q = r[h++];\n try {\n var K = p(r, h, a, q, o, X, J, Q >> 4, 15 & Q, H);\n h += K;\n } catch (t) {\n if (t instanceof DNLMarkerError) return this.parse(r, {\n F: t.s\n });\n if (t instanceof EOIMarkerError) break t;\n throw t;\n }\n break;\n case 65500:\n h += 4;\n break;\n case 65535:\n 255 !== r[h] && h--;\n break;\n default:\n var $ = b(r, h - 2, h - 3);\n if ($ && $.u) {\n h = $.offset;\n break;\n }\n if (h >= r.length - 1) break t;\n throw new e(\"JpegImage.parse - unknown marker: \" + v.toString(16));\n }\n v = i(r, h), h += 2;\n }\n for (this.width = a.o, this.height = a.s, this.g = l, this.b = f, this.W = [], x = 0; x < a.W.length; x++) {\n var tt = _[(G = a.W[x]).L];\n tt && (G.$ = tt), this.W.push({\n index: G.index,\n e: g(0, G),\n l: G.h / a.X,\n t: G.A / a.B,\n P: G.P,\n c: G.c\n });\n }\n this.p = this.W.length;\n },\n Y(t, e, r) {\n null == r && (r = !1);\n var i,\n n,\n a,\n o,\n s,\n h,\n l,\n f,\n u,\n c,\n d,\n p,\n m = this.width / t,\n g = this.height / e,\n b = 0,\n _ = this.W.length,\n y = t * e * _,\n w = new Uint8ClampedArray(y),\n v = new Uint32Array(t),\n x = 4294967288;\n for (l = 0; l < _; l++) {\n if (n = (i = this.W[l]).l * m, a = i.t * g, b = l, d = i.e, o = i.P + 1 << 3, n !== p) {\n for (s = 0; s < t; s++) f = 0 | s * n, v[s] = (f & x) << 3 | 7 & f;\n p = n;\n }\n for (h = 0; h < e; h++) for (c = o * ((f = 0 | h * a) & x) | (7 & f) << 3, s = 0; s < t; s++) w[b] = d[c + v[s]], b += _;\n }\n var E = this.V;\n if (r || 4 !== _ || E || (E = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255])), E) for (l = 0; l < y;) for (f = 0, u = 0; f < _; f++, l++, u += 2) w[l] = (w[l] * E[u] >> 8) + E[u + 1];\n return w;\n },\n get f() {\n return this.b ? !!this.b.a : 3 === this.p ? 0 !== this.N && (82 !== this.W[0].index || 71 !== this.W[1].index || 66 !== this.W[2].index) : 1 === this.N;\n },\n z: function (t) {\n for (var e, r, i, n = 0, a = t.length; n < a; n += 3) e = t[n], r = t[n + 1], i = t[n + 2], t[n] = e - 179.456 + 1.402 * i, t[n + 1] = e + 135.459 - .344 * r - .714 * i, t[n + 2] = e - 226.816 + 1.772 * r;\n return t;\n },\n O: function (t) {\n for (var e, r, i, n, a = 0, o = 0, s = t.length; o < s; o += 4) e = t[o], r = t[o + 1], i = t[o + 2], n = t[o + 3], t[a++] = r * (-660635669420364e-19 * r + .000437130475926232 * i - 54080610064599e-18 * e + .00048449797120281 * n - .154362151871126) - 122.67195406894 + i * (-.000957964378445773 * i + .000817076911346625 * e - .00477271405408747 * n + 1.53380253221734) + e * (.000961250184130688 * e - .00266257332283933 * n + .48357088451265) + n * (-.000336197177618394 * n + .484791561490776), t[a++] = 107.268039397724 + r * (219927104525741e-19 * r - .000640992018297945 * i + .000659397001245577 * e + .000426105652938837 * n - .176491792462875) + i * (-.000778269941513683 * i + .00130872261408275 * e + .000770482631801132 * n - .151051492775562) + e * (.00126935368114843 * e - .00265090189010898 * n + .25802910206845) + n * (-.000318913117588328 * n - .213742400323665), t[a++] = r * (-.000570115196973677 * r - 263409051004589e-19 * i + .0020741088115012 * e - .00288260236853442 * n + .814272968359295) - 20.810012546947 + i * (-153496057440975e-19 * i - .000132689043961446 * e + .000560833691242812 * n - .195152027534049) + e * (.00174418132927582 * e - .00255243321439347 * n + .116935020465145) + n * (-.000343531996510555 * n + .24165260232407);\n return t.subarray(0, a);\n },\n r: function (t) {\n for (var e, r, i, n = 0, a = t.length; n < a; n += 4) e = t[n], r = t[n + 1], i = t[n + 2], t[n] = 434.456 - e - 1.402 * i, t[n + 1] = 119.541 - e + .344 * r + .714 * i, t[n + 2] = 481.816 - e - 1.772 * r;\n return t;\n },\n U: function (t) {\n for (var e, r, i, n, a = 0, o = 0, s = t.length; o < s; o += 4) e = t[o], r = t[o + 1], i = t[o + 2], n = t[o + 3], t[a++] = 255 + e * (-6747147073602441e-20 * e + .0008379262121013727 * r + .0002894718188643294 * i + .003264231057537806 * n - 1.1185611867203937) + r * (26374107616089405e-21 * r - 8626949158638572e-20 * i - .0002748769067499491 * n - .02155688794978967) + i * (-3878099212869363e-20 * i - .0003267808279485286 * n + .0686742238595345) - n * (.0003361971776183937 * n + .7430659151342254), t[a++] = 255 + e * (.00013596372813588848 * e + .000924537132573585 * r + .00010567359618683593 * i + .0004791864687436512 * n - .3109689587515875) + r * (-.00023545346108370344 * r + .0002702845253534714 * i + .0020200308977307156 * n - .7488052167015494) + i * (6834815998235662e-20 * i + .00015168452363460973 * n - .09751927774728933) - n * (.0003189131175883281 * n + .7364883807733168), t[a++] = 255 + e * (13598650411385307e-21 * e + .00012423956175490851 * r + .0004751985097583589 * i - 36729317476630422e-22 * n - .05562186980264034) + r * (.00016141380598724676 * r + .0009692239130725186 * i + .0007782692450036253 * n - .44015232367526463) + i * (5.068882914068769e-7 * i + .0017778369011375071 * n - .7591454649749609) - n * (.0003435319965105553 * n + .7063770186160144);\n return t.subarray(0, a);\n },\n getData: function (t) {\n var r = t.width,\n i = t.height,\n n = t.forceRGB,\n a = t.isSourcePDF;\n if (this.p > 4) throw new e(\"Unsupported color mode\");\n var o = this.Y(r, i, a);\n if (1 === this.p && n) {\n for (var s = o.length, h = new Uint8ClampedArray(3 * s), l = 0, f = 0; f < s; f++) {\n var u = o[f];\n h[l++] = u, h[l++] = u, h[l++] = u;\n }\n return h;\n }\n if (3 === this.p && this.f) return this.z(o);\n if (4 === this.p) {\n if (this.f) return n ? this.O(o) : this.r(o);\n if (n) return this.U(o);\n }\n return o;\n }\n }, u;\n }();\n function i(t, e) {\n return t[e] << 8 | t[e + 1];\n }\n t.JpegDecoder = r;\n }(), t.encodeImage = function (e, r, i, n) {\n var a = {\n t256: [r],\n t257: [i],\n t258: [8, 8, 8, 8],\n t259: [1],\n t262: [2],\n t273: [1e3],\n t277: [4],\n t278: [i],\n t279: [r * i * 4],\n t282: [[72, 1]],\n t283: [[72, 1]],\n t284: [1],\n t286: [[0, 1]],\n t287: [[0, 1]],\n t296: [1],\n t305: [\"Photopea (UTIF.js)\"],\n t338: [1]\n };\n if (n) for (var o in n) a[o] = n[o];\n var s = new Uint8Array(t.encode([a])),\n h = new Uint8Array(e),\n l = new Uint8Array(1e3 + r * i * 4);\n for (o = 0; o < s.length; o++) l[o] = s[o];\n for (o = 0; o < h.length; o++) l[1e3 + o] = h[o];\n return l.buffer;\n }, t.encode = function (e) {\n var r = new Uint8Array(2e4),\n i = 4,\n n = t._binBE;\n r[0] = r[1] = 77, n.writeUshort(r, 2, 42);\n var a = 8;\n n.writeUint(r, i, a), i += 4;\n for (var o = 0; o < e.length; o++) {\n var s = t._writeIFD(n, t._types.basic, r, a, e[o]);\n a = s[1], o < e.length - 1 && (0 != (3 & a) && (a += 4 - (3 & a)), n.writeUint(r, s[0], a));\n }\n return r.slice(0, a).buffer;\n }, t.decode = function (e, r) {\n null == r && (r = {\n parseMN: !0,\n debug: !1\n });\n var i = new Uint8Array(e),\n a = 0,\n o = t._binBE.readASCII(i, a, 2);\n a += 2;\n var s = \"II\" == o ? t._binLE : t._binBE;\n s.readUshort(i, a), a += 2;\n var h = s.readUint(i, a);\n a += 4;\n for (var l = [];;) {\n var f = s.readUshort(i, h),\n u = s.readUshort(i, h + 4);\n if (0 != f && (u < 1 || 13 < u)) {\n n(\"error in TIFF\");\n break;\n }\n if (t._readIFD(s, i, h, l, 0, r), 0 == (h = s.readUint(i, h + 2 + 12 * f))) break;\n }\n return l;\n }, t.decodeImage = function (e, r, i) {\n if (!r.data) {\n var a = new Uint8Array(e),\n o = t._binBE.readASCII(a, 0, 2);\n if (null != r.t256) {\n r.isLE = \"II\" == o, r.width = r.t256[0], r.height = r.t257[0];\n var s,\n h = r.t259 ? r.t259[0] : 1,\n l = r.t266 ? r.t266[0] : 1;\n r.t284 && 2 == r.t284[0] && n(\"PlanarConfiguration 2 should not be used!\"), 7 == h && r.t258 && r.t258.length > 3 && (r.t258 = r.t258.slice(0, 3)), s = r.t258 ? Math.min(32, r.t258[0]) * r.t258.length : r.t277 ? r.t277[0] : 1, 1 == h && null != r.t279 && r.t278 && 32803 == r.t262[0] && (s = Math.round(8 * r.t279[0] / (r.width * r.t278[0]))), r.t50885 && 4 == r.t50885[0] && (s = 3 * r.t258[0]);\n var f = 8 * Math.ceil(r.width * s / 8),\n u = r.t273;\n (null == u || r.t322) && (u = r.t324);\n var c = r.t279;\n 1 == h && 1 == u.length && (c = [r.height * (f >>> 3)]), (null == c || r.t322) && (c = r.t325);\n var d = new Uint8Array(r.height * (f >>> 3)),\n p = 0;\n if (null != r.t322) {\n var m = r.t322[0],\n g = r.t323[0],\n b = Math.floor((r.width + m - 1) / m),\n _ = Math.floor((r.height + g - 1) / g),\n y = new Uint8Array(0 | Math.ceil(m * g * s / 8));\n console.log(\"====\", b, _);\n for (var w = 0; w < _; w++) for (var v = 0; v < b; v++) {\n var x = w * b + v;\n y.fill(0), t.decode._decompress(r, i, a, u[x], c[x], h, y, 0, l), 6 == h ? d = y : t._copyTile(y, 0 | Math.ceil(m * s / 8), g, d, 0 | Math.ceil(r.width * s / 8), r.height, 0 | Math.ceil(v * m * s / 8), w * g);\n }\n p = 8 * d.length;\n } else {\n var E = r.t278 ? r.t278[0] : r.height;\n for (E = Math.min(E, r.height), console.log(\"====\", r.width, E), x = 0; x < u.length; x++) t.decode._decompress(r, i, a, u[x], c[x], h, d, 0 | Math.ceil(p / 8), l), p += f * E;\n p = Math.min(p, 8 * d.length);\n }\n r.data = new Uint8Array(d.buffer, 0, 0 | Math.ceil(p / 8));\n }\n }\n }, t.decode._decompress = function (r, i, a, o, s, h, l, f, u) {\n if (1 == h) for (var c = 0; c < s; c++) l[f + c] = a[o + c];else if (2 == h) t.decode._decodeG2(a, o, s, l, f, r.width, u);else if (3 == h) t.decode._decodeG3(a, o, s, l, f, r.width, u, !!r.t292 && 1 == (1 & r.t292[0]));else if (4 == h) t.decode._decodeG4(a, o, s, l, f, r.width, u);else if (5 == h) t.decode._decodeLZW(a, o, s, l, f, 8);else if (6 == h) t.decode._decodeOldJPEG(r, a, o, s, l, f);else if (7 == h || 34892 == h) t.decode._decodeNewJPEG(r, a, o, s, l, f);else if (8 == h || 32946 == h) for (var d = new Uint8Array(a.buffer, o, s), p = e.inflate(d), m = 0; m < p.length; m++) l[f + m] = p[m];else 9 == h ? t.decode._decodeVC5(a, o, s, l, f) : 32767 == h ? t.decode._decodeARW(r, a, o, s, l, f) : 32773 == h ? t.decode._decodePackBits(a, o, s, l, f) : 32809 == h ? t.decode._decodeThunder(a, o, s, l, f) : 34713 == h ? t.decode._decodeNikon(r, i, a, o, s, l, f) : 34676 == h ? t.decode._decodeLogLuv32(r, a, o, s, l, f) : n(\"Unknown compression\", h);\n var g = r.t258 ? Math.min(32, r.t258[0]) : 1,\n b = r.t277 ? r.t277[0] : 1,\n _ = g * b >>> 3,\n y = r.t278 ? r.t278[0] : r.height,\n w = Math.ceil(g * b * r.width / 8);\n if (16 == g && !r.isLE && null == r.t33422) for (var v = 0; v < y; v++) for (var x = f + v * w, E = 1; E < w; E += 2) {\n var k = l[x + E];\n l[x + E] = l[x + E - 1], l[x + E - 1] = k;\n }\n if (r.t317 && 2 == r.t317[0]) for (v = 0; v < y; v++) {\n var S = f + v * w;\n if (16 == g) for (c = _; c < w; c += 2) {\n var M = (l[S + c + 1] << 8 | l[S + c]) + (l[S + c - _ + 1] << 8 | l[S + c - _]);\n l[S + c] = 255 & M, l[S + c + 1] = M >>> 8 & 255;\n } else if (3 == b) for (c = 3; c < w; c += 3) l[S + c] = l[S + c] + l[S + c - 3] & 255, l[S + c + 1] = l[S + c + 1] + l[S + c - 2] & 255, l[S + c + 2] = l[S + c + 2] + l[S + c - 1] & 255;else for (c = _; c < w; c++) l[S + c] = l[S + c] + l[S + c - _] & 255;\n }\n }, t.decode._decodeVC5 = t.decode._decodeVC5 = function () {\n var e,\n r,\n i,\n n = [1, 0, 1, 0, 2, 2, 1, 1, 3, 7, 1, 2, 5, 25, 1, 3, 6, 48, 1, 4, 6, 54, 1, 5, 7, 111, 1, 8, 7, 99, 1, 6, 7, 105, 12, 0, 7, 107, 1, 7, 8, 209, 20, 0, 8, 212, 1, 9, 8, 220, 1, 10, 9, 393, 1, 11, 9, 394, 32, 0, 9, 416, 1, 12, 9, 427, 1, 13, 10, 887, 1, 18, 10, 784, 1, 14, 10, 790, 1, 15, 10, 835, 60, 0, 10, 852, 1, 16, 10, 885, 1, 17, 11, 1571, 1, 19, 11, 1668, 1, 20, 11, 1669, 100, 0, 11, 1707, 1, 21, 11, 1772, 1, 22, 12, 3547, 1, 29, 12, 3164, 1, 24, 12, 3166, 1, 25, 12, 3140, 1, 23, 12, 3413, 1, 26, 12, 3537, 1, 27, 12, 3539, 1, 28, 13, 7093, 1, 35, 13, 6283, 1, 30, 13, 6331, 1, 31, 13, 6335, 180, 0, 13, 6824, 1, 32, 13, 7072, 1, 33, 13, 7077, 320, 0, 13, 7076, 1, 34, 14, 12565, 1, 36, 14, 12661, 1, 37, 14, 12669, 1, 38, 14, 13651, 1, 39, 14, 14184, 1, 40, 15, 28295, 1, 46, 15, 28371, 1, 47, 15, 25320, 1, 42, 15, 25336, 1, 43, 15, 25128, 1, 41, 15, 27300, 1, 44, 15, 28293, 1, 45, 16, 50259, 1, 48, 16, 50643, 1, 49, 16, 50675, 1, 50, 16, 56740, 1, 53, 16, 56584, 1, 51, 16, 56588, 1, 52, 17, 113483, 1, 61, 17, 113482, 1, 60, 17, 101285, 1, 55, 17, 101349, 1, 56, 17, 109205, 1, 57, 17, 109207, 1, 58, 17, 100516, 1, 54, 17, 113171, 1, 59, 18, 202568, 1, 62, 18, 202696, 1, 63, 18, 218408, 1, 64, 18, 218412, 1, 65, 18, 226340, 1, 66, 18, 226356, 1, 67, 18, 226358, 1, 68, 19, 402068, 1, 69, 19, 405138, 1, 70, 19, 405394, 1, 71, 19, 436818, 1, 72, 19, 436826, 1, 73, 19, 452714, 1, 75, 19, 452718, 1, 76, 19, 452682, 1, 74, 20, 804138, 1, 77, 20, 810279, 1, 78, 20, 810790, 1, 79, 20, 873638, 1, 80, 20, 873654, 1, 81, 20, 905366, 1, 82, 20, 905430, 1, 83, 20, 905438, 1, 84, 21, 1608278, 1, 85, 21, 1620557, 1, 86, 21, 1621582, 1, 87, 21, 1621583, 1, 88, 21, 1747310, 1, 89, 21, 1810734, 1, 90, 21, 1810735, 1, 91, 21, 1810863, 1, 92, 21, 1810879, 1, 93, 22, 3621725, 1, 99, 22, 3621757, 1, 100, 22, 3241112, 1, 94, 22, 3494556, 1, 95, 22, 3494557, 1, 96, 22, 3494622, 1, 97, 22, 3494623, 1, 98, 23, 6482227, 1, 102, 23, 6433117, 1, 101, 23, 6989117, 1, 103, 23, 6989119, 1, 105, 23, 6989118, 1, 104, 23, 7243449, 1, 106, 23, 7243512, 1, 107, 24, 13978233, 1, 111, 24, 12964453, 1, 109, 24, 12866232, 1, 108, 24, 14486897, 1, 113, 24, 13978232, 1, 110, 24, 14486896, 1, 112, 24, 14487026, 1, 114, 24, 14487027, 1, 115, 25, 25732598, 1, 225, 25, 25732597, 1, 189, 25, 25732596, 1, 188, 25, 25732595, 1, 203, 25, 25732594, 1, 202, 25, 25732593, 1, 197, 25, 25732592, 1, 207, 25, 25732591, 1, 169, 25, 25732590, 1, 223, 25, 25732589, 1, 159, 25, 25732522, 1, 235, 25, 25732579, 1, 152, 25, 25732575, 1, 192, 25, 25732489, 1, 179, 25, 25732573, 1, 201, 25, 25732472, 1, 172, 25, 25732576, 1, 149, 25, 25732488, 1, 178, 25, 25732566, 1, 120, 25, 25732571, 1, 219, 25, 25732577, 1, 150, 25, 25732487, 1, 127, 25, 25732506, 1, 211, 25, 25732548, 1, 125, 25, 25732588, 1, 158, 25, 25732486, 1, 247, 25, 25732467, 1, 238, 25, 25732508, 1, 163, 25, 25732552, 1, 228, 25, 25732603, 1, 183, 25, 25732513, 1, 217, 25, 25732587, 1, 168, 25, 25732520, 1, 122, 25, 25732484, 1, 128, 25, 25732562, 1, 249, 25, 25732505, 1, 187, 25, 25732504, 1, 186, 25, 25732483, 1, 136, 25, 25928905, 1, 181, 25, 25732560, 1, 255, 25, 25732500, 1, 230, 25, 25732482, 1, 135, 25, 25732555, 1, 233, 25, 25732568, 1, 222, 25, 25732583, 1, 145, 25, 25732481, 1, 134, 25, 25732586, 1, 167, 25, 25732521, 1, 248, 25, 25732518, 1, 209, 25, 25732480, 1, 243, 25, 25732512, 1, 216, 25, 25732509, 1, 164, 25, 25732547, 1, 140, 25, 25732479, 1, 157, 25, 25732544, 1, 239, 25, 25732574, 1, 191, 25, 25732564, 1, 251, 25, 25732478, 1, 156, 25, 25732546, 1, 139, 25, 25732498, 1, 242, 25, 25732557, 1, 133, 25, 25732477, 1, 162, 25, 25732515, 1, 213, 25, 25732584, 1, 165, 25, 25732514, 1, 212, 25, 25732476, 1, 227, 25, 25732494, 1, 198, 25, 25732531, 1, 236, 25, 25732530, 1, 234, 25, 25732529, 1, 117, 25, 25732528, 1, 215, 25, 25732527, 1, 124, 25, 25732526, 1, 123, 25, 25732525, 1, 254, 25, 25732524, 1, 253, 25, 25732523, 1, 148, 25, 25732570, 1, 218, 25, 25732580, 1, 146, 25, 25732581, 1, 147, 25, 25732569, 1, 224, 25, 25732533, 1, 143, 25, 25732540, 1, 184, 25, 25732541, 1, 185, 25, 25732585, 1, 166, 25, 25732556, 1, 132, 25, 25732485, 1, 129, 25, 25732563, 1, 250, 25, 25732578, 1, 151, 25, 25732501, 1, 119, 25, 25732502, 1, 193, 25, 25732536, 1, 176, 25, 25732496, 1, 245, 25, 25732553, 1, 229, 25, 25732516, 1, 206, 25, 25732582, 1, 144, 25, 25732517, 1, 208, 25, 25732558, 1, 137, 25, 25732543, 1, 241, 25, 25732466, 1, 237, 25, 25732507, 1, 190, 25, 25732542, 1, 240, 25, 25732551, 1, 131, 25, 25732554, 1, 232, 25, 25732565, 1, 252, 25, 25732475, 1, 171, 25, 25732493, 1, 205, 25, 25732492, 1, 204, 25, 25732491, 1, 118, 25, 25732490, 1, 214, 25, 25928904, 1, 180, 25, 25732549, 1, 126, 25, 25732602, 1, 182, 25, 25732539, 1, 175, 25, 25732545, 1, 141, 25, 25732559, 1, 138, 25, 25732537, 1, 177, 25, 25732534, 1, 153, 25, 25732503, 1, 194, 25, 25732606, 1, 160, 25, 25732567, 1, 121, 25, 25732538, 1, 174, 25, 25732497, 1, 246, 25, 25732550, 1, 130, 25, 25732572, 1, 200, 25, 25732474, 1, 170, 25, 25732511, 1, 221, 25, 25732601, 1, 196, 25, 25732532, 1, 142, 25, 25732519, 1, 210, 25, 25732495, 1, 199, 25, 25732605, 1, 155, 25, 25732535, 1, 154, 25, 25732499, 1, 244, 25, 25732510, 1, 220, 25, 25732600, 1, 195, 25, 25732607, 1, 161, 25, 25732604, 1, 231, 25, 25732473, 1, 173, 25, 25732599, 1, 226, 26, 51465122, 1, 116, 26, 51465123, 0, 1],\n a = [3, 3, 3, 3, 2, 2, 2, 1, 1, 1];\n function o(t) {\n var e = t[1],\n r = t[0][e >>> 3] >>> 7 - (7 & e) & 1;\n return t[1]++, r;\n }\n function s(t, r) {\n if (null == e) {\n e = {};\n for (var i = 0; i < n.length; i += 4) e[n[i + 1]] = n.slice(i, i + 4);\n }\n for (var a = o(t), s = e[a]; null == s;) a = a << 1 | o(t), s = e[a];\n var h = s[3];\n 0 != h && (h = 0 == o(t) ? h : -h), r[0] = s[2], r[1] = h;\n }\n function h(t, e) {\n for (var r = 0; r < e; r++) 1 == (1 & t) && t++, t >>>= 1;\n return t;\n }\n function l(t, e) {\n return t >> e;\n }\n function f(t, e, r, i, n, a) {\n e[r] = l(l(11 * t[n] - 4 * t[n + a] + t[n + a + a] + 4, 3) + t[i], 1), e[r + a] = l(l(5 * t[n] + 4 * t[n + a] - t[n + a + a] + 4, 3) - t[i], 1);\n }\n function u(t, e, r, i, n, a) {\n var o = t[n - a] - t[n + a],\n s = t[n],\n h = t[i];\n e[r] = l(l(o + 4, 3) + s + h, 1), e[r + a] = l(l(4 - o, 3) + s - h, 1);\n }\n function c(t, e, r, i, n, a) {\n e[r] = l(l(5 * t[n] + 4 * t[n - a] - t[n - a - a] + 4, 3) + t[i], 1), e[r + a] = l(l(11 * t[n] - 4 * t[n - a] + t[n - a - a] + 4, 3) - t[i], 1);\n }\n function d(t) {\n return i[t = t < 0 ? 0 : t > 4095 ? 4095 : t] >>> 2;\n }\n return function (e, n, o, l, p) {\n l = new Uint16Array(l.buffer);\n var m,\n g,\n b,\n _,\n y,\n w,\n v,\n x,\n E = Date.now(),\n k = t._binBE,\n S = n + o;\n for (n += 4; n < S;) {\n var M = k.readShort(e, n),\n A = k.readUshort(e, n + 2);\n if (n += 4, 12 == M) L = A;else if (20 == M) m = A;else if (21 == M) g = A;else if (48 == M) b = A;else if (53 == M) _ = A;else if (35 == M) ;else if (62 == M) y = A;else if (101 == M) ;else if (109 == M) w = A;else if (84 == M) ;else if (106 == M) ;else if (107 == M) ;else if (108 == M) ;else if (102 == M) ;else if (104 == M) tt = A;else if (105 == M) ;else {\n var I = M < 0 ? -M : M,\n B = 65280 & I,\n T = 0;\n if (24576 & I && (8192 & I ? (T = 65535 & A, T += (255 & I) << 16) : T = 65535 & A), 24576 == (24576 & I)) {\n if (null == v) {\n v = [];\n for (var R = 0; R < 4; R++) v[R] = new Int16Array((m >>> 1) * (g >>> 1));\n for (x = new Int16Array((m >>> 1) * (g >>> 1)), r = new Int16Array(1024), R = 0; R < 1024; R++) {\n var P = R - 512,\n O = Math.abs(P),\n L = Math.floor(768 * O * O * O / 16581375) + O;\n r[R] = Math.sign(P) * L;\n }\n for (i = new Uint16Array(4096), R = 0; R < 4096; R++) {\n var C = R,\n U = 65535 * (Math.pow(113, C / 4095) - 1) / 112;\n i[R] = Math.min(U, 65535);\n }\n }\n var z = v[y],\n D = h(m, 1 + a[b]),\n N = h(g, 1 + a[b]);\n if (0 == b) for (var F = 0; F < N; F++) for (var j = 0; j < D; j++) {\n var G = n + 2 * (F * D + j);\n z[F * (m >>> 1) + j] = e[G] << 8 | e[G + 1];\n } else {\n var H = [e, 8 * n],\n W = [],\n q = 0,\n Z = D * N,\n Y = [0, 0],\n V = 0;\n for (A = 0; q < Z;) for (s(H, Y), V = Y[0], A = Y[1]; V > 0;) W[q++] = A, V--;\n var X = (b - 1) % 3,\n J = 1 != X ? D : 0,\n Q = 0 != X ? N : 0;\n for (F = 0; F < N; F++) {\n var K = (F + Q) * (m >>> 1) + J,\n $ = F * D;\n for (j = 0; j < D; j++) z[K + j] = r[W[$ + j] + 512] * _;\n }\n if (2 == X) {\n var tt = m >>> 1,\n et = 2 * D,\n rt = 2 * N;\n for (F = 0; F < N; F++) for (j = 0; j < et; j++) {\n R = 2 * F * tt + j;\n var it = N * tt + (at = F * tt + j);\n 0 == F ? f(z, x, R, it, at, tt) : F == N - 1 ? c(z, x, R, it, at, tt) : u(z, x, R, it, at, tt);\n }\n var nt = z;\n for (z = x, x = nt, F = 0; F < rt; F++) for (j = 0; j < D; j++) {\n var at;\n R = F * tt + 2 * j, it = D + (at = F * tt + j), 0 == j ? f(z, x, R, it, at, 1) : j == D - 1 ? c(z, x, R, it, at, 1) : u(z, x, R, it, at, 1);\n }\n nt = z, z = x, x = nt;\n for (var ot = [], st = 2 - ~~((b - 1) / 3), ht = 0; ht < 3; ht++) ot[ht] = w >> 14 - 2 * ht & 3;\n var lt = ot[st];\n if (0 != lt) for (F = 0; F < rt; F++) for (j = 0; j < et; j++) z[R = F * tt + j] = z[R] << lt;\n }\n }\n if (9 == b && 3 == y) {\n var ft = v[0],\n ut = v[1],\n ct = v[2],\n dt = v[3];\n for (F = 0; F < g; F += 2) for (j = 0; j < m; j += 2) {\n var pt = F * m + j,\n mt = ft[G = (F >>> 1) * (m >>> 1) + (j >>> 1)],\n gt = ut[G] - 2048,\n bt = ct[G] - 2048,\n _t = dt[G] - 2048,\n yt = (gt << 1) + mt,\n wt = (bt << 1) + mt,\n vt = mt + _t,\n xt = mt - _t;\n l[pt] = d(yt), l[pt + 1] = d(vt), l[pt + m] = d(xt), l[pt + m + 1] = d(wt);\n }\n }\n n += 4 * T;\n } else if (16388 == I) n += 4 * T;else if (8192 != B && 8448 != B && 9216 != B) throw I.toString(16);\n }\n }\n console.log(Date.now() - E);\n };\n }(), t.decode._decodeLogLuv32 = function (t, e, r, i, n, a) {\n for (var o = t.width, s = 4 * o, h = 0, l = new Uint8Array(s); h < i;) {\n for (var f = 0; f < s;) {\n var u = e[r + h];\n if (h++, u < 128) {\n for (var c = 0; c < u; c++) l[f + c] = e[r + h + c];\n f += u, h += u;\n } else {\n for (u -= 126, c = 0; c < u; c++) l[f + c] = e[r + h];\n f += u, h++;\n }\n }\n for (var d = 0; d < o; d++) n[a + 0] = l[d], n[a + 1] = l[d + o], n[a + 2] = l[d + 2 * o], n[a + 4] = l[d + 3 * o], a += 6;\n }\n }, t.decode._ljpeg_diff = function (e, r, i) {\n var n,\n a,\n o = t.decode._getbithuff;\n return n = o(e, r, i[0], i), 0 == ((a = o(e, r, n, 0)) & 1 << n - 1) && (a -= (1 << n) - 1), a;\n }, t.decode._decodeARW = function (e, r, i, n, a, o) {\n var s = e.t256[0],\n h = e.t257[0],\n l = e.t258[0],\n f = e.isLE ? t._binLE : t._binBE;\n if (s * h == n || s * h * 1.5 == n) {\n if (s * h * 1.5 != n) {\n var u,\n c,\n d,\n p,\n m,\n g,\n b,\n _,\n y = new Uint16Array(16),\n w = new Uint8Array(s + 1);\n for (I = 0; I < h; I++) {\n for (var v = 0; v < s; v++) w[v] = r[i++];\n for (_ = 0, A = 0; A < s - 30; _ += 16) {\n for (c = 2047 & (u = f.readUint(w, _)), d = 2047 & u >>> 11, p = 15 & u >>> 22, m = 15 & u >>> 26, g = 0; g < 4 && 128 << g <= c - d; g++);\n for (b = 30, x = 0; x < 16; x++) x == p ? y[x] = c : x == m ? y[x] = d : (y[x] = ((f.readUshort(w, _ + (b >> 3)) >>> (7 & b) & 127) << g) + d, y[x] > 2047 && (y[x] = 2047), b += 7);\n for (x = 0; x < 16; x++, A += 2) U = y[x] << 1, t.decode._putsF(a, (I * s + A) * l, U << 16 - l);\n A -= 1 & A ? 1 : 31;\n }\n }\n } else for (var x = 0; x < n; x += 3) {\n var E = r[i + x + 0],\n k = r[i + x + 1],\n S = r[i + x + 2];\n a[o + x] = k << 4 | E >>> 4, a[o + x + 1] = E << 4 | S >>> 4, a[o + x + 2] = S << 4 | k >>> 4;\n }\n } else {\n h += 8;\n var M,\n A,\n I,\n B = [i, 0, 0, 0],\n T = new Uint16Array(32770),\n R = [3857, 3856, 3599, 3342, 3085, 2828, 2571, 2314, 2057, 1800, 1543, 1286, 1029, 772, 771, 768, 514, 513],\n P = 0,\n O = t.decode._ljpeg_diff;\n for (T[0] = 15, M = x = 0; x < 18; x++) for (var L = 32768 >>> (R[x] >>> 8), C = 0; C < L; C++) T[++M] = R[x];\n for (A = s; A--;) for (I = 0; I < h + 1; I += 2) if (I == h && (I = 1), P += O(r, B, T), I < h) {\n var U = 4095 & P;\n t.decode._putsF(a, (I * s + A) * l, U << 16 - l);\n }\n }\n }, t.decode._decodeNikon = function (e, r, i, n, a, o, s) {\n var h = [[0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 5, 4, 3, 6, 2, 7, 1, 0, 8, 9, 11, 10, 12], [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 57, 90, 56, 39, 22, 5, 4, 3, 2, 1, 0, 11, 12, 12], [0, 0, 1, 4, 2, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10, 11, 12], [0, 0, 1, 4, 3, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 5, 6, 4, 7, 8, 3, 9, 2, 1, 0, 10, 11, 12, 13, 14], [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 8, 92, 75, 58, 41, 7, 6, 5, 4, 3, 2, 1, 0, 13, 14], [0, 0, 1, 4, 2, 2, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 8, 5, 9, 4, 10, 3, 11, 12, 2, 0, 1, 13, 14]],\n l = e.t256[0],\n f = e.t257[0],\n u = e.t258[0],\n c = 0,\n d = 0,\n p = t.decode._make_decoder,\n m = t.decode._getbithuff,\n g = r[0].exifIFD.makerNote,\n b = g.t150 ? g.t150 : g.t140,\n _ = 0,\n y = b[_++],\n w = b[_++];\n 73 != y && 88 != w || (_ += 2110), 70 == y && (c = 2), 14 == u && (c += 3);\n for (var v = [[0, 0], [0, 0]], x = e.isLE ? t._binLE : t._binBE, E = 0; E < 2; E++) for (var k = 0; k < 2; k++) v[E][k] = x.readShort(b, _), _ += 2;\n var S,\n M,\n A,\n I,\n B,\n T = 1 << u & 32767,\n R = 0,\n P = x.readShort(b, _);\n _ += 2, P > 1 && (R = Math.floor(T / (P - 1))), 68 == y && 32 == w && R > 0 && (d = x.readShort(b, 562));\n var O = [0, 0],\n L = p(h[c]),\n C = [n, 0, 0, 0];\n for (S = 0; S < f; S++) for (d && S == d && (L = p(h[c + 1])), M = 0; M < l; M++) {\n E = m(i, C, L[0], L), 0 == ((B = 1 + (m(i, C, (A = 15 & E) - (I = E >>> 4), 0) << 1) << I >>> 1) & 1 << A - 1) && (B -= (1 << A) - (0 == I ? 1 : 0)), M < 2 ? O[M] = v[1 & S][M] += B : O[1 & M] += B;\n var U = Math.min(Math.max(O[1 & M], 0), (1 << u) - 1),\n z = (S * l + M) * u;\n t.decode._putsF(o, z, U << 16 - u);\n }\n }, t.decode._putsF = function (t, e, r) {\n r <<= 8 - (7 & e);\n var i = e >>> 3;\n t[i] |= r >>> 16, t[i + 1] |= r >>> 8, t[i + 2] |= r;\n }, t.decode._getbithuff = function (e, r, i, n) {\n t.decode._get_byte;\n var a,\n o = r[0],\n s = r[1],\n h = r[2],\n l = r[3];\n if (0 == i || h < 0) return 0;\n for (; !l && h < i && -1 != (a = e[o++]) && !(l = 0);) s = (s << 8) + a, h += 8;\n if (a = s << 32 - h >>> 32 - i, n ? (h -= n[a + 1] >>> 8, a = 255 & n[a + 1]) : h -= i, h < 0) throw \"e\";\n return r[0] = o, r[1] = s, r[2] = h, r[3] = l, a;\n }, t.decode._make_decoder = function (t) {\n var e,\n r,\n i,\n n,\n a,\n o = [];\n for (e = 16; 0 != e && !t[e]; e--);\n var s = 17;\n for (o[0] = e, i = r = 1; r <= e; r++) for (n = 0; n < t[r]; n++, ++s) for (a = 0; a < 1 << e - r; a++) i <= 1 << e && (o[i++] = r << 8 | t[s]);\n return o;\n }, t.decode._decodeNewJPEG = function (e, r, i, n, a, o) {\n n = Math.min(n, r.length - i);\n var s = e.t347,\n h = s ? s.length : 0,\n l = new Uint8Array(h + n);\n if (s) {\n for (var f = 0, u = 0; u < h - 1 && (255 != s[u] || 217 != s[u + 1]); u++) l[f++] = s[u];\n var c = r[i],\n d = r[i + 1];\n for (255 == c && 216 == d || (l[f++] = c, l[f++] = d), u = 2; u < n; u++) l[f++] = r[i + u];\n } else for (u = 0; u < n; u++) l[u] = r[i + u];\n if (32803 == e.t262[0] || 7 == e.t259[0] && 34892 == e.t262[0]) {\n var p = e.t258[0],\n m = t.LosslessJpegDecode(l),\n g = m.length;\n if (16 == p) {\n if (e.isLE) for (u = 0; u < g; u++) a[o + (u << 1)] = 255 & m[u], a[o + (u << 1) + 1] = m[u] >>> 8;else for (u = 0; u < g; u++) a[o + (u << 1)] = m[u] >>> 8, a[o + (u << 1) + 1] = 255 & m[u];\n } else if (14 == p || 12 == p) {\n var b = 16 - p;\n for (u = 0; u < g; u++) t.decode._putsF(a, u * p, m[u] << b);\n } else {\n if (8 != p) throw new Error(\"unsupported bit depth \" + p);\n for (u = 0; u < g; u++) a[o + u] = m[u];\n }\n } else {\n var _ = new t.JpegDecoder();\n _.parse(l);\n var y = _.getData({\n width: _.width,\n height: _.height,\n forceRGB: !0,\n isSourcePDF: !1\n });\n for (u = 0; u < y.length; u++) a[o + u] = y[u];\n }\n 6 == e.t262[0] && (e.t262[0] = 2);\n }, t.decode._decodeOldJPEGInit = function (t, e, r, i) {\n var a,\n o,\n s,\n h,\n l,\n f = 216,\n u = 0,\n c = 0,\n d = !1,\n p = t.t513,\n m = p ? p[0] : 0,\n g = t.t514,\n b = g ? g[0] : 0,\n _ = t.t324 || t.t273 || p,\n y = t.t530,\n w = 0,\n v = 0,\n x = t.t277 ? t.t277[0] : 1,\n E = t.t515;\n if (_ && (c = _[0], d = _.length > 1), !d) {\n if (255 == e[r] && e[r + 1] == f) return {\n jpegOffset: r\n };\n if (null != p && (255 == e[r + m] && e[r + m + 1] == f ? u = r + m : n(\"JPEGInterchangeFormat does not point to SOI\"), null == g ? n(\"JPEGInterchangeFormatLength field is missing\") : (m >= c || m + b <= c) && n(\"JPEGInterchangeFormatLength field value is invalid\"), null != u)) return {\n jpegOffset: u\n };\n }\n if (null != y && (w = y[0], v = y[1]), null != p && null != g) if (b >= 2 && m + b <= c) {\n for (a = 255 == e[r + m + b - 2] && e[r + m + b - 1] == f ? new Uint8Array(b - 2) : new Uint8Array(b), s = 0; s < a.length; s++) a[s] = e[r + m + s];\n n(\"Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables\");\n } else n(\"JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile\");\n if (null == a) {\n var k = 0,\n S = [];\n S[k++] = 255, S[k++] = f;\n var M = t.t519;\n if (null == M) throw new Error(\"JPEGQTables tag is missing\");\n for (s = 0; s < M.length; s++) for (S[k++] = 255, S[k++] = 219, S[k++] = 0, S[k++] = 67, S[k++] = s, h = 0; h < 64; h++) S[k++] = e[r + M[s] + h];\n for (l = 0; l < 2; l++) {\n var A = t[0 == l ? \"t520\" : \"t521\"];\n if (null == A) throw new Error((0 == l ? \"JPEGDCTables\" : \"JPEGACTables\") + \" tag is missing\");\n for (s = 0; s < A.length; s++) {\n S[k++] = 255, S[k++] = 196;\n var I = 19;\n for (h = 0; h < 16; h++) I += e[r + A[s] + h];\n for (S[k++] = I >>> 8, S[k++] = 255 & I, S[k++] = s | l << 4, h = 0; h < 16; h++) S[k++] = e[r + A[s] + h];\n for (h = 0; h < I; h++) S[k++] = e[r + A[s] + 16 + h];\n }\n }\n if (S[k++] = 255, S[k++] = 192, S[k++] = 0, S[k++] = 8 + 3 * x, S[k++] = 8, S[k++] = t.height >>> 8 & 255, S[k++] = 255 & t.height, S[k++] = t.width >>> 8 & 255, S[k++] = 255 & t.width, S[k++] = x, 1 == x) S[k++] = 1, S[k++] = 17, S[k++] = 0;else for (s = 0; s < 3; s++) S[k++] = s + 1, S[k++] = 0 != s ? 17 : (15 & w) << 4 | 15 & v, S[k++] = s;\n null != E && 0 != E[0] && (S[k++] = 255, S[k++] = 221, S[k++] = 0, S[k++] = 4, S[k++] = E[0] >>> 8 & 255, S[k++] = 255 & E[0]), a = new Uint8Array(S);\n }\n var B = -1;\n for (s = 0; s < a.length - 1;) {\n if (255 == a[s] && 192 == a[s + 1]) {\n B = s;\n break;\n }\n s++;\n }\n if (-1 == B) {\n var T = new Uint8Array(a.length + 10 + 3 * x);\n T.set(a);\n var R = a.length;\n if (B = a.length, (a = T)[R++] = 255, a[R++] = 192, a[R++] = 0, a[R++] = 8 + 3 * x, a[R++] = 8, a[R++] = t.height >>> 8 & 255, a[R++] = 255 & t.height, a[R++] = t.width >>> 8 & 255, a[R++] = 255 & t.width, a[R++] = x, 1 == x) a[R++] = 1, a[R++] = 17, a[R++] = 0;else for (s = 0; s < 3; s++) a[R++] = s + 1, a[R++] = 0 != s ? 17 : (15 & w) << 4 | 15 & v, a[R++] = s;\n }\n if (255 == e[c] && 218 == e[c + 1]) {\n var P = e[c + 2] << 8 | e[c + 3];\n for ((o = new Uint8Array(P + 2))[0] = e[c], o[1] = e[c + 1], o[2] = e[c + 2], o[3] = e[c + 3], s = 0; s < P - 2; s++) o[s + 4] = e[c + s + 4];\n } else {\n var O = 0;\n if ((o = new Uint8Array(8 + 2 * x))[O++] = 255, o[O++] = 218, o[O++] = 0, o[O++] = 6 + 2 * x, o[O++] = x, 1 == x) o[O++] = 1, o[O++] = 0;else for (s = 0; s < 3; s++) o[O++] = s + 1, o[O++] = s << 4 | s;\n o[O++] = 0, o[O++] = 63, o[O++] = 0;\n }\n return {\n jpegOffset: r,\n tables: a,\n sosMarker: o,\n sofPosition: B\n };\n }, t.decode._decodeOldJPEG = function (e, r, i, n, a, o) {\n var s,\n h,\n l,\n f,\n u = t.decode._decodeOldJPEGInit(e, r, i, n);\n if (null != u.jpegOffset) for (s = i + n - u.jpegOffset, l = new Uint8Array(s), p = 0; p < s; p++) l[p] = r[u.jpegOffset + p];else {\n for (h = u.tables.length, (l = new Uint8Array(h + u.sosMarker.length + n + 2)).set(u.tables), f = h, l[u.sofPosition + 5] = e.height >>> 8 & 255, l[u.sofPosition + 6] = 255 & e.height, l[u.sofPosition + 7] = e.width >>> 8 & 255, l[u.sofPosition + 8] = 255 & e.width, 255 == r[i] && r[i + 1] == SOS || (l.set(u.sosMarker, f), f += sosMarker.length), p = 0; p < n; p++) l[f++] = r[i + p];\n l[f++] = 255, l[f++] = EOI;\n }\n var c = new t.JpegDecoder();\n c.parse(l);\n for (var d = c.getData({\n width: c.width,\n height: c.height,\n forceRGB: !0,\n isSourcePDF: !1\n }), p = 0; p < d.length; p++) a[o + p] = d[p];\n e.t262 && 6 == e.t262[0] && (e.t262[0] = 2);\n }, t.decode._decodePackBits = function (t, e, r, i, n) {\n for (var a = new Int8Array(t.buffer), o = new Int8Array(i.buffer), s = e + r; e < s;) {\n var h = a[e];\n if (e++, h >= 0 && h < 128) for (var l = 0; l < h + 1; l++) o[n] = a[e], n++, e++;\n if (h >= -127 && h < 0) {\n for (l = 0; l < 1 - h; l++) o[n] = a[e], n++;\n e++;\n }\n }\n return n;\n }, t.decode._decodeThunder = function (t, e, r, i, n) {\n for (var a = [0, 1, 0, -1], o = [0, 1, 2, 3, 0, -3, -2, -1], s = e + r, h = 2 * n, l = 0; e < s;) {\n var f = t[e],\n u = f >>> 6,\n c = 63 & f;\n if (e++, 3 == u && (l = 15 & c, i[h >>> 1] |= l << 4 * (1 - h & 1), h++), 0 == u) for (var d = 0; d < c; d++) i[h >>> 1] |= l << 4 * (1 - h & 1), h++;\n if (2 == u) for (d = 0; d < 2; d++) 4 != (p = c >>> 3 * (1 - d) & 7) && (l += o[p], i[h >>> 1] |= l << 4 * (1 - h & 1), h++);\n if (1 == u) for (d = 0; d < 3; d++) {\n var p;\n 2 != (p = c >>> 2 * (2 - d) & 3) && (l += a[p], i[h >>> 1] |= l << 4 * (1 - h & 1), h++);\n }\n }\n }, t.decode._dmap = {\n 1: 0,\n \"011\": 1,\n \"000011\": 2,\n \"0000011\": 3,\n \"010\": -1,\n \"000010\": -2,\n \"0000010\": -3\n }, t.decode._lens = function () {\n var t = function (t, e, r, i) {\n for (var n = 0; n < e.length; n++) t[e[n]] = r + n * i;\n },\n e = \"00110101,000111,0111,1000,1011,1100,1110,1111,10011,10100,00111,01000,001000,000011,110100,110101,101010,101011,0100111,0001100,0001000,0010111,0000011,0000100,0101000,0101011,0010011,0100100,0011000,00000010,00000011,00011010,00011011,00010010,00010011,00010100,00010101,00010110,00010111,00101000,00101001,00101010,00101011,00101100,00101101,00000100,00000101,00001010,00001011,01010010,01010011,01010100,01010101,00100100,00100101,01011000,01011001,01011010,01011011,01001010,01001011,00110010,00110011,00110100\",\n r = \"0000110111,010,11,10,011,0011,0010,00011,000101,000100,0000100,0000101,0000111,00000100,00000111,000011000,0000010111,0000011000,0000001000,00001100111,00001101000,00001101100,00000110111,00000101000,00000010111,00000011000,000011001010,000011001011,000011001100,000011001101,000001101000,000001101001,000001101010,000001101011,000011010010,000011010011,000011010100,000011010101,000011010110,000011010111,000001101100,000001101101,000011011010,000011011011,000001010100,000001010101,000001010110,000001010111,000001100100,000001100101,000001010010,000001010011,000000100100,000000110111,000000111000,000000100111,000000101000,000001011000,000001011001,000000101011,000000101100,000001011010,000001100110,000001100111\",\n i = \"11011,10010,010111,0110111,00110110,00110111,01100100,01100101,01101000,01100111,011001100,011001101,011010010,011010011,011010100,011010101,011010110,011010111,011011000,011011001,011011010,011011011,010011000,010011001,010011010,011000,010011011\",\n n = \"0000001111,000011001000,000011001001,000001011011,000000110011,000000110100,000000110101,0000001101100,0000001101101,0000001001010,0000001001011,0000001001100,0000001001101,0000001110010,0000001110011,0000001110100,0000001110101,0000001110110,0000001110111,0000001010010,0000001010011,0000001010100,0000001010101,0000001011010,0000001011011,0000001100100,0000001100101\",\n a = \"00000001000,00000001100,00000001101,000000010010,000000010011,000000010100,000000010101,000000010110,000000010111,000000011100,000000011101,000000011110,000000011111\";\n e = e.split(\",\"), r = r.split(\",\"), i = i.split(\",\"), n = n.split(\",\"), a = a.split(\",\");\n var o = {},\n s = {};\n return t(o, e, 0, 1), t(o, i, 64, 64), t(o, a, 1792, 64), t(s, r, 0, 1), t(s, n, 64, 64), t(s, a, 1792, 64), [o, s];\n }(), t.decode._decodeG4 = function (e, r, i, n, a, o, s) {\n for (var h = t.decode, l = r << 3, f = 0, u = \"\", c = [], d = [], p = 0; p < o; p++) d.push(0);\n d = h._makeDiff(d);\n for (var m = 0, g = 0, b = 0, _ = 0, y = 0, w = 0, v = \"\", x = 0, E = 8 * Math.ceil(o / 8); l >>> 3 < r + i;) {\n b = h._findDiff(d, m + (0 == m ? 0 : 1), 1 - y), _ = h._findDiff(d, b, y);\n var k = 0;\n if (1 == s && (k = e[l >>> 3] >>> 7 - (7 & l) & 1), 2 == s && (k = e[l >>> 3] >>> (7 & l) & 1), l++, u += k, \"H\" == v) {\n if (null != h._lens[y][u]) {\n var S = h._lens[y][u];\n u = \"\", f += S, S < 64 && (h._addNtimes(c, f, y), m += f, y = 1 - y, f = 0, 0 == --x && (v = \"\"));\n }\n } else \"0001\" == u && (u = \"\", h._addNtimes(c, _ - m, y), m = _), \"001\" == u && (u = \"\", v = \"H\", x = 2), null != h._dmap[u] && (g = b + h._dmap[u], h._addNtimes(c, g - m, y), m = g, u = \"\", y = 1 - y);\n c.length == o && \"\" == v && (h._writeBits(c, n, 8 * a + w * E), y = 0, w++, m = 0, d = h._makeDiff(c), c = []);\n }\n }, t.decode._findDiff = function (t, e, r) {\n for (var i = 0; i < t.length; i += 2) if (t[i] >= e && t[i + 1] == r) return t[i];\n }, t.decode._makeDiff = function (t) {\n var e = [];\n 1 == t[0] && e.push(0, 1);\n for (var r = 1; r < t.length; r++) t[r - 1] != t[r] && e.push(r, t[r]);\n return e.push(t.length, 0, t.length, 1), e;\n }, t.decode._decodeG2 = function (e, r, i, n, a, o, s) {\n for (var h = t.decode, l = r << 3, f = 0, u = \"\", c = [], d = 0, p = 0, m = 8 * Math.ceil(o / 8); l >>> 3 < r + i;) {\n var g = 0;\n 1 == s && (g = e[l >>> 3] >>> 7 - (7 & l) & 1), 2 == s && (g = e[l >>> 3] >>> (7 & l) & 1), l++, u += g, null != (f = h._lens[d][u]) && (h._addNtimes(c, f, d), u = \"\", f < 64 && (d = 1 - d), c.length == o && (h._writeBits(c, n, 8 * a + p * m), c = [], p++, d = 0, 0 != (7 & l) && (l += 8 - (7 & l)), f >= 64 && (l += 8)));\n }\n }, t.decode._decodeG3 = function (e, r, i, n, a, o, s, h) {\n for (var l = t.decode, f = r << 3, u = 0, c = \"\", d = [], p = [], m = 0; m < o; m++) d.push(0);\n for (var g = 0, b = 0, _ = 0, y = 0, w = 0, v = -1, x = \"\", E = 0, k = !0, S = 8 * Math.ceil(o / 8); f >>> 3 < r + i;) {\n _ = l._findDiff(p, g + (0 == g ? 0 : 1), 1 - w), y = l._findDiff(p, _, w);\n var M = 0;\n if (1 == s && (M = e[f >>> 3] >>> 7 - (7 & f) & 1), 2 == s && (M = e[f >>> 3] >>> (7 & f) & 1), f++, c += M, k) {\n if (null != l._lens[w][c]) {\n var A = l._lens[w][c];\n c = \"\", u += A, A < 64 && (l._addNtimes(d, u, w), w = 1 - w, u = 0);\n }\n } else \"H\" == x ? null != l._lens[w][c] && (A = l._lens[w][c], c = \"\", u += A, A < 64 && (l._addNtimes(d, u, w), g += u, w = 1 - w, u = 0, 0 == --E && (x = \"\"))) : (\"0001\" == c && (c = \"\", l._addNtimes(d, y - g, w), g = y), \"001\" == c && (c = \"\", x = \"H\", E = 2), null != l._dmap[c] && (b = _ + l._dmap[c], l._addNtimes(d, b - g, w), g = b, c = \"\", w = 1 - w));\n c.endsWith(\"000000000001\") && (v >= 0 && l._writeBits(d, n, 8 * a + v * S), h && (1 == s && (k = 1 == (e[f >>> 3] >>> 7 - (7 & f) & 1)), 2 == s && (k = 1 == (e[f >>> 3] >>> (7 & f) & 1)), f++), c = \"\", w = 0, v++, g = 0, p = l._makeDiff(d), d = []);\n }\n d.length == o && l._writeBits(d, n, 8 * a + v * S);\n }, t.decode._addNtimes = function (t, e, r) {\n for (var i = 0; i < e; i++) t.push(r);\n }, t.decode._writeBits = function (t, e, r) {\n for (var i = 0; i < t.length; i++) e[r + i >>> 3] |= t[i] << 7 - (r + i & 7);\n }, t.decode._decodeLZW = t.decode._decodeLZW = (s = 0, h = 0, l = 0, f = 0, u = function () {\n var t = r >>> 3,\n e = (i[t] << 16 | i[t + 1] << 8 | i[t + 2]) >>> 24 - (7 & r) - h & (1 << h) - 1;\n return r += h, e;\n }, c = new Uint32Array(16384), d = 0, p = function (t) {\n h = t + 1, s = f + 1;\n }, m = function (t) {\n for (var e = t << 2, r = c[e + 2], i = o + r - 1; 65535 != e;) a[i--] = c[e], e = c[e + 1];\n o += r;\n }, g = function (t, e) {\n var r = s << 2,\n i = t << 2;\n c[r] = c[3 + (e << 2)], c[r + 1] = i, c[r + 2] = c[i + 2] + 1, c[r + 3] = c[i + 3], 1 + ++s == 1 << h && 12 != h && h++;\n }, function (t, e, n, h, b, _) {\n r = e << 3, i = t, a = h, o = b;\n var y = e + n << 3,\n w = 0,\n v = 0;\n for (function (t) {\n if (t != d) {\n d = t, f = 1 + (l = 1 << t);\n for (var e = 0; e < f + 1; e++) c[4 * e] = c[4 * e + 3] = e, c[4 * e + 1] = 65535, c[4 * e + 2] = 1;\n }\n }(_), p(_); r < y && (w = u()) != f;) {\n if (w == l) {\n if (p(_), (w = u()) == f) break;\n m(w);\n } else w < s ? (m(w), g(v, w)) : (g(v, v), m(s - 1));\n v = w;\n }\n return o;\n }), t.tags = {}, t._types = ((b = new Array(250)).fill(0), {\n basic: {\n main: b = b.concat([0, 0, 0, 0, 4, 3, 3, 3, 3, 3, 0, 0, 3, 0, 0, 0, 3, 0, 0, 2, 2, 2, 2, 4, 3, 0, 0, 3, 4, 4, 3, 3, 5, 5, 3, 2, 5, 5, 0, 0, 0, 0, 4, 4, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 5, 5, 3, 0, 3, 3, 4, 4, 4, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),\n rest: {\n 33432: 2,\n 33434: 5,\n 33437: 5,\n 34665: 4,\n 34850: 3,\n 34853: 4,\n 34855: 3,\n 34864: 3,\n 34866: 4,\n 36864: 7,\n 36867: 2,\n 36868: 2,\n 37121: 7,\n 37377: 10,\n 37378: 5,\n 37380: 10,\n 37381: 5,\n 37383: 3,\n 37384: 3,\n 37385: 3,\n 37386: 5,\n 37510: 7,\n 37520: 2,\n 37521: 2,\n 37522: 2,\n 40960: 7,\n 40961: 3,\n 40962: 4,\n 40963: 4,\n 40965: 4,\n 41486: 5,\n 41487: 5,\n 41488: 3,\n 41985: 3,\n 41986: 3,\n 41987: 3,\n 41988: 5,\n 41989: 3,\n 41990: 3,\n 41993: 3,\n 41994: 3,\n 41995: 7,\n 41996: 3,\n 42032: 2,\n 42033: 2,\n 42034: 5,\n 42036: 2,\n 42037: 2,\n 59932: 7\n }\n },\n gps: {\n main: [1, 2, 5, 2, 5, 1, 5, 5, 0, 9],\n rest: {\n 18: 2,\n 29: 2\n }\n }\n }), t._readIFD = function (e, r, i, a, o, s) {\n var h = e.readUshort(r, i);\n i += 2;\n var l = {};\n s.debug && n(\" \".repeat(o), a.length - 1, \">>>----------------\");\n for (var f = 0; f < h; f++) {\n var u = e.readUshort(r, i);\n i += 2;\n var c = e.readUshort(r, i);\n i += 2;\n var d = e.readUint(r, i);\n i += 4;\n var p = e.readUint(r, i);\n i += 4;\n var m = [];\n if (1 != c && 7 != c || (m = new Uint8Array(r.buffer, d < 5 ? i - 4 : p, d)), 2 == c) {\n var g = d < 5 ? i - 4 : p,\n b = r[g],\n _ = Math.max(0, Math.min(d - 1, r.length - g));\n b < 128 || 0 == _ ? m.push(e.readASCII(r, g, _)) : m = new Uint8Array(r.buffer, g, _);\n }\n if (3 == c) for (var y = 0; y < d; y++) m.push(e.readUshort(r, (d < 3 ? i - 4 : p) + 2 * y));\n if (4 == c || 13 == c) for (y = 0; y < d; y++) m.push(e.readUint(r, (d < 2 ? i - 4 : p) + 4 * y));\n if (5 == c || 10 == c) {\n var w = 5 == c ? e.readUint : e.readInt;\n for (y = 0; y < d; y++) m.push([w(r, p + 8 * y), w(r, p + 8 * y + 4)]);\n }\n if (8 == c) for (y = 0; y < d; y++) m.push(e.readShort(r, (d < 3 ? i - 4 : p) + 2 * y));\n if (9 == c) for (y = 0; y < d; y++) m.push(e.readInt(r, (d < 2 ? i - 4 : p) + 4 * y));\n if (11 == c) for (y = 0; y < d; y++) m.push(e.readFloat(r, p + 4 * y));\n if (12 == c) for (y = 0; y < d; y++) m.push(e.readDouble(r, p + 8 * y));\n if (0 == d || 0 != m.length) {\n if (s.debug && n(\" \".repeat(o), u, c, t.tags[u], m), l[\"t\" + u] = m, 330 == u && l.t272 && \"DSLR-A100\" == l.t272[0]) ;else if (330 == u || 34665 == u || 34853 == u || 50740 == u && e.readUshort(r, e.readUint(m, 0)) < 300 || 61440 == u) {\n var v = 50740 == u ? [e.readUint(m, 0)] : m,\n x = [];\n for (y = 0; y < v.length; y++) t._readIFD(e, r, v[y], x, o + 1, s);\n 330 == u && (l.subIFD = x), 34665 == u && (l.exifIFD = x[0]), 34853 == u && (l.gpsiIFD = x[0]), 50740 == u && (l.dngPrvt = x[0]), 61440 == u && (l.fujiIFD = x[0]);\n }\n if (37500 == u && s.parseMN) {\n var E = m;\n if (\"Nikon\" == e.readASCII(E, 0, 5)) l.makerNote = t.decode(E.slice(10).buffer)[0];else if (e.readUshort(r, p) < 300 && e.readUshort(r, p + 4) <= 12) {\n var k = [];\n t._readIFD(e, r, p, k, o + 1, s), l.makerNote = k[0];\n }\n }\n } else if (n(u, \"unknown TIFF tag type: \", c, \"num:\", d), 0 == f) return;\n }\n return a.push(l), s.debug && n(\" \".repeat(o), \"<<<---------------\"), i;\n }, t._writeIFD = function (e, r, i, n, a) {\n var o = Object.keys(a),\n s = o.length;\n a.exifIFD && s--, a.gpsiIFD && s--, e.writeUshort(i, n, s);\n for (var h = (n += 2) + 12 * s + 4, l = 0; l < o.length; l++) {\n var f = o[l];\n if (\"t34665\" != f && \"t34853\" != f) {\n \"exifIFD\" == f && (f = \"t34665\"), \"gpsiIFD\" == f && (f = \"t34853\");\n var u = parseInt(f.slice(1)),\n c = r.main[u];\n if (null == c && (c = r.rest[u]), null == c || 0 == c) throw new Error(\"unknown type of tag: \" + u);\n var d = a[f];\n 34665 == u && (d = [h], h = t._writeIFD(e, r, i, h, a.exifIFD)[1]), 34853 == u && (d = [h], h = t._writeIFD(e, t._types.gps, i, h, a.gpsiIFD)[1]), 2 == c && (d = d[0] + \"\\0\");\n var p = d.length;\n e.writeUshort(i, n, u), n += 2, e.writeUshort(i, n, c), n += 2, e.writeUint(i, n, p);\n var m = [-1, 1, 1, 2, 4, 8, 0, 1, 0, 4, 8, 0, 8][c] * p,\n g = n += 4;\n if (m > 4 && (e.writeUint(i, n, h), g = h), 1 == c || 7 == c) for (var b = 0; b < p; b++) i[g + b] = d[b];else if (2 == c) e.writeASCII(i, g, d);else if (3 == c) for (b = 0; b < p; b++) e.writeUshort(i, g + 2 * b, d[b]);else if (4 == c) for (b = 0; b < p; b++) e.writeUint(i, g + 4 * b, d[b]);else if (5 == c || 10 == c) {\n var _ = 5 == c ? e.writeUint : e.writeInt;\n for (b = 0; b < p; b++) {\n var y = d[b],\n w = y[0],\n v = y[1];\n if (null == w) throw \"e\";\n _(i, g + 8 * b, w), _(i, g + 8 * b + 4, v);\n }\n } else if (9 == c) for (b = 0; b < p; b++) e.writeInt(i, g + 4 * b, d[b]);else {\n if (12 != c) throw c;\n for (b = 0; b < p; b++) e.writeDouble(i, g + 8 * b, d[b]);\n }\n m > 4 && (h += m += 1 & m), n += 4;\n }\n }\n return [n, h];\n }, t.toRGBA8 = function (t, e) {\n var r = t.width,\n i = t.height,\n a = r * i,\n o = 4 * a,\n s = t.data,\n h = new Uint8Array(4 * a),\n l = t.t262 ? t.t262[0] : 2,\n f = t.t258 ? Math.min(32, t.t258[0]) : 1;\n if (null == t.t262 && 1 == f && (l = 0), 0 == l) for (var u = Math.ceil(f * r / 8), c = 0; c < i; c++) {\n var d = c * u,\n p = c * r;\n if (1 == f) for (var m = 0; m < r; m++) {\n var g = p + m << 2,\n b = s[d + (m >> 3)] >> 7 - (7 & m) & 1;\n h[g] = h[g + 1] = h[g + 2] = 255 * (1 - b), h[g + 3] = 255;\n }\n if (4 == f) for (m = 0; m < r; m++) g = p + m << 2, b = s[d + (m >> 1)] >> 4 - 4 * (1 & m) & 15, h[g] = h[g + 1] = h[g + 2] = 17 * (15 - b), h[g + 3] = 255;\n if (8 == f) for (m = 0; m < r; m++) g = p + m << 2, b = s[d + m], h[g] = h[g + 1] = h[g + 2] = 255 - b, h[g + 3] = 255;\n } else if (1 == l) {\n var _ = t.t258 ? t.t258.length : 1;\n for (u = Math.ceil(_ * f * r / 8), null == e && (e = 1 / 256), c = 0; c < i; c++) {\n if (d = c * u, p = c * r, 1 == f) for (m = 0; m < r; m++) g = p + m << 2, b = s[d + (m >> 3)] >> 7 - (7 & m) & 1, h[g] = h[g + 1] = h[g + 2] = 255 * b, h[g + 3] = 255;\n if (2 == f) for (m = 0; m < r; m++) g = p + m << 2, b = s[d + (m >> 2)] >> 6 - 2 * (3 & m) & 3, h[g] = h[g + 1] = h[g + 2] = 85 * b, h[g + 3] = 255;\n if (8 == f) for (m = 0; m < r; m++) g = p + m << 2, b = s[d + m * _], h[g] = h[g + 1] = h[g + 2] = b, h[g + 3] = 255;\n if (16 == f) for (m = 0; m < r; m++) {\n g = p + m << 2;\n var y = d + 2 * m;\n b = s[y + 1] << 8 | s[y], h[g] = h[g + 1] = h[g + 2] = Math.min(255, ~~(b * e)), h[g + 3] = 255;\n }\n }\n } else if (2 == l) {\n if (_ = t.t258 ? t.t258.length : 3, 8 == f) {\n if (4 == _) for (m = 0; m < o; m++) h[m] = s[m];\n if (3 == _) for (m = 0; m < a; m++) {\n var w = 3 * m;\n h[g = m << 2] = s[w], h[g + 1] = s[w + 1], h[g + 2] = s[w + 2], h[g + 3] = 255;\n }\n } else if (16 == f) {\n if (4 == _) for (m = 0; m < a; m++) w = 8 * m + 1, h[g = m << 2] = s[w], h[g + 1] = s[w + 2], h[g + 2] = s[w + 4], h[g + 3] = s[w + 6];\n if (3 == _) for (m = 0; m < a; m++) w = 6 * m + 1, h[g = m << 2] = s[w], h[g + 1] = s[w + 2], h[g + 2] = s[w + 4], h[g + 3] = 255;\n } else {\n if (32 != f) throw f;\n if (!h.isLE) for (m = 0; m < s.length; m += 4) {\n var v = s[m];\n s[m] = s[m + 3], s[m + 3] = v, v = s[m + 1], s[m + 1] = s[m + 2], s[m + 2] = v;\n }\n var x = new Float32Array(s.buffer);\n if (3 != _) throw _;\n for (m = 0; m < a; m++) w = 3 * m, h[g = m << 2] = ~~(.5 + 255 * x[w]), h[g + 1] = ~~(.5 + 255 * x[w + 1]), h[g + 2] = ~~(.5 + 255 * x[w + 2]), h[g + 3] = 255;\n }\n } else if (3 == l) {\n var E = t.t320,\n k = (_ = t.t258 ? t.t258.length : 1, u = Math.ceil(_ * f * r / 8), 1 << f);\n for (c = 0; c < i; c++) for (var S = 0; S < r; S++) {\n g = (m = c * r + S) << 2;\n var M = 0,\n A = c * u;\n if (1 == f) M = s[A + (S >>> 3)] >>> 7 - (7 & S) & 1;else if (2 == f) M = s[A + (S >>> 2)] >>> 6 - 2 * (3 & S) & 3;else if (4 == f) M = s[A + (S >>> 1)] >>> 4 - 4 * (1 & S) & 15;else {\n if (8 != f) throw f;\n M = s[A + S * _];\n }\n h[g] = E[M] >> 8, h[g + 1] = E[k + M] >> 8, h[g + 2] = E[k + k + M] >> 8, h[g + 3] = 255;\n }\n } else if (5 == l) {\n var I = (_ = t.t258 ? t.t258.length : 4) > 4 ? 1 : 0;\n for (m = 0; m < a; m++) {\n g = m << 2;\n var B = m * _;\n if (UDOC) {\n var T = s[B],\n R = s[B + 1],\n P = s[B + 2],\n O = s[B + 3],\n L = UDOC.C.cmykToRgb([T * (1 / 255), R * (1 / 255), P * (1 / 255), O * (1 / 255)]);\n h[g] = ~~(.5 + 255 * L[0]), h[g + 1] = ~~(.5 + 255 * L[1]), h[g + 2] = ~~(.5 + 255 * L[2]);\n } else T = 255 - s[B], R = 255 - s[B + 1], P = 255 - s[B + 2], O = (255 - s[B + 3]) * (1 / 255), h[g] = ~~(T * O + .5), h[g + 1] = ~~(R * O + .5), h[g + 2] = ~~(P * O + .5);\n h[g + 3] = 255 * (1 - I) + s[B + 4] * I;\n }\n } else if (6 == l && t.t278) {\n var C = t.t278[0];\n for (c = 0; c < i; c += C) {\n m = c * r;\n for (var U = C * r, z = 0; z < U; z++) {\n g = 4 * (m + z), P = s[(B = 3 * m + 4 * (z >>> 1)) + (1 & z)];\n var D = s[B + 2] - 128,\n N = s[B + 3] - 128,\n F = P + ((N >> 2) + (N >> 3) + (N >> 5)),\n j = P - ((D >> 2) + (D >> 4) + (D >> 5)) - ((N >> 1) + (N >> 3) + (N >> 4) + (N >> 5)),\n G = P + (D + (D >> 1) + (D >> 2) + (D >> 6));\n h[g] = Math.max(0, Math.min(255, F)), h[g + 1] = Math.max(0, Math.min(255, j)), h[g + 2] = Math.max(0, Math.min(255, G)), h[g + 3] = 255;\n }\n }\n } else if (32845 == l) {\n function H(t) {\n return t < .0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - .055;\n }\n for (c = 0; c < i; c++) for (S = 0; S < r; S++) {\n g = 4 * (c * r + S);\n var W = s[1 + (B = 6 * (c * r + S))] << 8 | s[B],\n q = (W = Math.pow(2, (W + .5) / 256 - 64), (s[B + 3] + .5) / 410),\n Z = (s[B + 5] + .5) / 410,\n Y = 9 * q / (6 * q - 16 * Z + 12),\n V = 4 * Z / (6 * q - 16 * Z + 12),\n X = Y * W / V,\n J = (1 - Y - V) * W / V;\n F = 2.69 * X - 1.276 * (P = W) - .414 * J, j = -1.022 * X + 1.978 * P + .044 * J, G = .061 * X - .224 * P + 1.163 * J, h[g] = 255 * H(Math.min(F, 1)), h[g + 1] = 255 * H(Math.min(j, 1)), h[g + 2] = 255 * H(Math.min(G, 1)), h[g + 3] = 255;\n }\n } else n(\"Unknown Photometric interpretation: \" + l);\n return h;\n }, t.replaceIMG = function (e) {\n null == e && (e = document.getElementsByTagName(\"img\"));\n for (var r = [\"tif\", \"tiff\", \"dng\", \"cr2\", \"nef\"], i = 0; i < e.length; i++) {\n var n = e[i],\n a = n.getAttribute(\"src\");\n if (null != a) {\n var o = a.split(\".\").pop().toLowerCase();\n if (-1 != r.indexOf(o)) {\n var s = new XMLHttpRequest();\n t._xhrs.push(s), t._imgs.push(n), s.open(\"GET\", a), s.responseType = \"arraybuffer\", s.onload = t._imgLoaded, s.send();\n }\n }\n }\n }, t._xhrs = [], t._imgs = [], t._imgLoaded = function (e) {\n var r = t._xhrs.indexOf(e.target),\n i = t._imgs[r];\n t._xhrs.splice(r, 1), t._imgs.splice(r, 1), i.setAttribute(\"src\", t.bufferToURI(e.target.response));\n }, t.bufferToURI = function (e) {\n var r = t.decode(e),\n i = r,\n n = 0,\n a = i[0];\n r[0].subIFD && (i = i.concat(r[0].subIFD));\n for (var o = 0; o < i.length; o++) {\n var s = i[o];\n if (!(null == s.t258 || s.t258.length < 3)) {\n var h = s.t256 * s.t257;\n h > n && (n = h, a = s);\n }\n }\n t.decodeImage(e, a, r);\n var l = t.toRGBA8(a),\n f = a.width,\n u = a.height,\n c = document.createElement(\"canvas\");\n c.width = f, c.height = u;\n var d = c.getContext(\"2d\"),\n p = new ImageData(new Uint8ClampedArray(l.buffer), f, u);\n return d.putImageData(p, 0, 0), c.toDataURL();\n }, t._binBE = {\n nextZero: function (t, e) {\n for (; 0 != t[e];) e++;\n return e;\n },\n readUshort: function (t, e) {\n return t[e] << 8 | t[e + 1];\n },\n readShort: function (e, r) {\n var i = t._binBE.ui8;\n return i[0] = e[r + 1], i[1] = e[r + 0], t._binBE.i16[0];\n },\n readInt: function (e, r) {\n var i = t._binBE.ui8;\n return i[0] = e[r + 3], i[1] = e[r + 2], i[2] = e[r + 1], i[3] = e[r + 0], t._binBE.i32[0];\n },\n readUint: function (e, r) {\n var i = t._binBE.ui8;\n return i[0] = e[r + 3], i[1] = e[r + 2], i[2] = e[r + 1], i[3] = e[r + 0], t._binBE.ui32[0];\n },\n readASCII: function (t, e, r) {\n for (var i = \"\", n = 0; n < r; n++) i += String.fromCharCode(t[e + n]);\n return i;\n },\n readFloat: function (e, r) {\n for (var i = t._binBE.ui8, n = 0; n < 4; n++) i[n] = e[r + 3 - n];\n return t._binBE.fl32[0];\n },\n readDouble: function (e, r) {\n for (var i = t._binBE.ui8, n = 0; n < 8; n++) i[n] = e[r + 7 - n];\n return t._binBE.fl64[0];\n },\n writeUshort: function (t, e, r) {\n t[e] = r >> 8 & 255, t[e + 1] = 255 & r;\n },\n writeInt: function (e, r, i) {\n var n = t._binBE.ui8;\n t._binBE.i32[0] = i, e[r + 3] = n[0], e[r + 2] = n[1], e[r + 1] = n[2], e[r + 0] = n[3];\n },\n writeUint: function (t, e, r) {\n t[e] = r >> 24 & 255, t[e + 1] = r >> 16 & 255, t[e + 2] = r >> 8 & 255, t[e + 3] = r >> 0 & 255;\n },\n writeASCII: function (t, e, r) {\n for (var i = 0; i < r.length; i++) t[e + i] = r.charCodeAt(i);\n },\n writeDouble: function (e, r, i) {\n t._binBE.fl64[0] = i;\n for (var n = 0; n < 8; n++) e[r + n] = t._binBE.ui8[7 - n];\n }\n }, t._binBE.ui8 = new Uint8Array(8), t._binBE.i16 = new Int16Array(t._binBE.ui8.buffer), t._binBE.i32 = new Int32Array(t._binBE.ui8.buffer), t._binBE.ui32 = new Uint32Array(t._binBE.ui8.buffer), t._binBE.fl32 = new Float32Array(t._binBE.ui8.buffer), t._binBE.fl64 = new Float64Array(t._binBE.ui8.buffer), t._binLE = {\n nextZero: t._binBE.nextZero,\n readUshort: function (t, e) {\n return t[e + 1] << 8 | t[e];\n },\n readShort: function (e, r) {\n var i = t._binBE.ui8;\n return i[0] = e[r + 0], i[1] = e[r + 1], t._binBE.i16[0];\n },\n readInt: function (e, r) {\n var i = t._binBE.ui8;\n return i[0] = e[r + 0], i[1] = e[r + 1], i[2] = e[r + 2], i[3] = e[r + 3], t._binBE.i32[0];\n },\n readUint: function (e, r) {\n var i = t._binBE.ui8;\n return i[0] = e[r + 0], i[1] = e[r + 1], i[2] = e[r + 2], i[3] = e[r + 3], t._binBE.ui32[0];\n },\n readASCII: t._binBE.readASCII,\n readFloat: function (e, r) {\n for (var i = t._binBE.ui8, n = 0; n < 4; n++) i[n] = e[r + n];\n return t._binBE.fl32[0];\n },\n readDouble: function (e, r) {\n for (var i = t._binBE.ui8, n = 0; n < 8; n++) i[n] = e[r + n];\n return t._binBE.fl64[0];\n },\n writeUshort: function (t, e, r) {\n t[e] = 255 & r, t[e + 1] = r >> 8 & 255;\n },\n writeInt: function (e, r, i) {\n var n = t._binBE.ui8;\n t._binBE.i32[0] = i, e[r + 0] = n[0], e[r + 1] = n[1], e[r + 2] = n[2], e[r + 3] = n[3];\n },\n writeUint: function (t, e, r) {\n t[e] = r >>> 0 & 255, t[e + 1] = r >>> 8 & 255, t[e + 2] = r >>> 16 & 255, t[e + 3] = r >>> 24 & 255;\n },\n writeASCII: t._binBE.writeASCII\n }, t._copyTile = function (t, e, r, i, n, a, o, s) {\n for (var h = Math.min(e, n - o), l = Math.min(r, a - s), f = 0; f < l; f++) for (var u = (s + f) * n + o, c = f * e, d = 0; d < h; d++) i[u + d] = t[c + d];\n }, t.LosslessJpegDecode = function () {\n var t, e;\n function r() {\n return t[e++];\n }\n function i() {\n return t[e++] << 8 | t[e++];\n }\n function n(t) {\n for (var e = r(), i = [0, 0, 0, 255], n = [], o = 0; o < 16; o++) n[o] = r();\n for (o = 0; o < 16; o++) for (var s = 0; s < n[o]; s++) i[a(i, 0, o + 1, 1) + 3] = r();\n var h = new Uint8Array(256);\n for (t[e] = [new Uint8Array(i), h], o = 0; o < 256; o++) {\n for (var l = 8, f = o, u = 0; 255 == i[u + 3] && 0 != l;) u = i[u + (f >> --l & 1)];\n h[o] = u;\n }\n }\n function a(t, e, r, i) {\n if (255 != t[e + 3]) return 0;\n if (0 == r) return e;\n for (var n = 0; n < 2; n++) {\n 0 == t[e + n] && (t[e + n] = t.length, t.push(0, 0, i, 255));\n var o = a(t, t[e + n], r - 1, i + 1);\n if (0 != o) return o;\n }\n return 0;\n }\n function o(t) {\n for (var e = t.b, r = t.a; e < 25 && t.e < t.d;) {\n var i = t.data[t.e++];\n t.c || (t.e += i + 1 >>> 8), r = r << 8 | i, e += 8;\n }\n if (e < 0) throw \"e\";\n t.b = e, t.a = r;\n }\n function s(t, e) {\n return e.b < t && o(e), e.a >> (e.b -= t) & 65535 >> 16 - t;\n }\n function h(t, e) {\n var r = t[0],\n i = 0,\n n = 255;\n e.b < 16 && o(e);\n var a = e.a >> e.b - 8 & 255;\n for (n = r[(i = t[1][a]) + 3], e.b -= r[i + 2]; 255 == n;) n = r[(i = r[i + (e.a >> --e.b & 1)]) + 3];\n return n;\n }\n function l(t, e) {\n return t < 32768 >> 16 - e && (t += 1 - (1 << e)), t;\n }\n function f(t, e) {\n var r = h(t, e);\n return 0 == r ? 0 : 16 == r ? -32768 : l(s(r, e), r);\n }\n function u(t, e, r, i, n, a) {\n for (var o = 0; o < a; o++) for (var s = o * e, h = 0; h < e; h += n) for (var l = 0; l < n; l++) t[s + h + l] = f(i[l], r);\n }\n function c(t, e) {\n return l(s(t, e), t);\n }\n function d(t, e, r, i, n, a, o, s) {\n for (var h = r * o, l = n; l < a; l++) t[l] += 1 << s - 1;\n for (var f = o; f < h; f += o) for (l = n; l < a; l++) t[f + l] += t[f + l - o];\n for (var u = 1; u < i; u++) {\n var c = u * h;\n for (l = n; l < a; l++) t[c + l] += t[c + l - h];\n for (f = o; f < h; f += o) for (l = n; l < a; l++) {\n var d = c + f + l,\n p = d - h,\n m = t[d - o],\n g = 0;\n if (0 == e) g = 0;else if (1 == e) g = m;else if (2 == e) g = t[p];else if (3 == e) g = t[p - o];else if (4 == e) g = m + (t[p] - t[p - o]);else if (5 == e) g = m + (t[p] - t[p - o] >>> 1);else if (6 == e) g = t[p] + (m - t[p - o] >>> 1);else {\n if (7 != e) throw e;\n g = m + t[p] >>> 1;\n }\n t[d] += g;\n }\n }\n }\n return function (a) {\n if (t = a, e = 0, 65496 != i()) throw \"e\";\n for (var o = [], s = 0, l = 0, f = [], p = [], m = [], g = 0, b = 0, _ = 0;;) {\n var y = i();\n if (65535 != y) {\n var w = i();\n if (65475 == y) {\n l = r(), b = i(), _ = i(), g = r();\n for (var v = 0; v < g; v++) {\n var x = r(),\n E = r();\n if (0 != r()) throw \"e\";\n o[x] = [v, E >> 4, 15 & E];\n }\n } else if (65476 == y) for (var k = e + w - 2; e < k;) n(p);else {\n if (65498 == y) {\n for (e++, v = 0; v < g; v++) {\n var S = o[r()];\n m[S[0]] = p[r() >>> 4], f[S[0]] = S.slice(1);\n }\n s = r(), e += 2;\n break;\n }\n e += w - 2;\n }\n } else e--;\n }\n var M = new (l > 8 ? Uint16Array : Uint8Array)(b * _ * g),\n A = {\n b: 0,\n a: 0,\n c: 8 == s,\n e,\n data: t,\n d: t.length\n };\n if (A.c) !function (r, i, n, a, o) {\n for (var s = t.length - e, l = 0; l < s; l += 4) {\n var f = t[e + l];\n t[e + l] = t[e + l + 3], t[e + l + 3] = f, f = t[e + l + 1], t[e + l + 1] = t[e + l + 2], t[e + l + 2] = f;\n }\n for (var u = 0; u < o; u++) for (var d = 32768, p = 32768, m = 0; m < i; m += 2) {\n var g = h(a, n),\n b = h(a, n);\n 0 != g && (d += c(g, n)), 0 != b && (p += c(b, n)), r[u * i + m] = 65535 & d, r[u * i + m + 1] = 65535 & p;\n }\n }(M, _ * g, A, m[0], b);else {\n var I = [],\n B = 0,\n T = 0;\n for (v = 0; v < g; v++) {\n var R = f[v];\n (N = R[0]) > B && (B = N), (D = R[1]) > T && (T = D), I.push(N * D);\n }\n if (1 != B || 1 != T) {\n var P = [],\n O = 0;\n for (v = 0; v < g; v++) {\n for (var L = 0; L < I[v]; L++) P.push(m[v]);\n O += I[v];\n }\n var C = _ / B,\n U = b / T;\n u(M, C * O, A, P, O, U), d(M, s, C, U, O - 2, O, O, l);\n for (var z = M.slice(0), D = 0; D < b; D++) for (var N = 0; N < _; N++) {\n var F = (D * _ + N) * g,\n j = ~~(D / T) * C + ~~(N / B),\n G = 0;\n for (v = 0; v < g; v++) {\n var H = 1 & N,\n W = j * O + G + (0 == v ? 1 == T ? H : 2 * H + (1 & D) : 0);\n M[F + v] = z[W], G += I[v];\n }\n }\n d(M, s, _, b, 0, 1, g, l);\n } else u(M, _ * g, A, m, g, b), d(M, s, _, b, 0, g, g, l);\n }\n return M;\n };\n }(), function () {\n var e = 2,\n r = 3,\n i = 4,\n n = 5,\n a = 6,\n o = 7,\n s = 8,\n h = 9,\n l = 10,\n f = 11,\n u = 12,\n c = 13,\n d = 14,\n p = 15,\n m = 16,\n g = 17;\n function b(t) {\n for (var e = [[], [], []], r = Math.max(2, t.w + 32 >>> 6), i = 0; i < 3; i++) for (var n = 0; n < 41; n++) e[i][n] = [r, 1];\n return e;\n }\n function _(t, e) {\n var r = 0,\n i = 8 - t.a;\n if (t.j, t.a, e) {\n if (e >= i) do {\n r <<= i, e -= i, r |= t[t.j] & (1 << i) - 1, t.j++, i = 8;\n } while (e >= 8);\n e && (r <<= e, i -= e, r |= t[t.j] >>> i & (1 << e) - 1), t.a = 8 - i;\n }\n return r;\n }\n function y(t, e, r, i, n, a, o, s) {\n null == s && (s = 0);\n var h,\n l,\n f,\n u,\n c,\n d,\n p = a + 1,\n m = p % 2,\n g = 0,\n b = i[n],\n y = i[n - 1],\n w = i[n - 2][p],\n v = y[p - 1],\n x = y[p],\n E = y[p + 1],\n k = b[p - 1],\n S = b[p + 1],\n M = Math.abs;\n if (m && (f = M(E - x), u = M(w - x), c = M(v - x)), m) {\n if (d = (d = f > c && u < f ? w + v : f < c && u < c ? w + E : E + v) + 2 * x >>> 2, s) return void (b[p] = d);\n h = e.t * e.c[t.g + x - w] + e.c[t.g + v - x];\n } else d = x > v && x > E || x < v && x < E ? S + k + 2 * x >>> 2 : k + S >>> 1, h = e.t * e.c[t.g + x - v] + e.c[t.g + v - k];\n l = M(h);\n var A = function (t) {\n for (var e = -1, r = 0; !r; e++) r = t[t.j] >>> 7 - t.a & 1, t.a++, t.a &= 7, t.a || t.j++;\n return e;\n }(r);\n if (A < t.n - e.v - 1) {\n var I = function (t, e) {\n var r = 0;\n if (e < t) for (; r <= 14 && e << ++r < t;);\n return r;\n }(o[l][0], o[l][1]);\n g = _(r, I) + (A << I);\n } else g = _(r, e.v) + 1;\n g = 1 & g ? -1 - (g >>> 1) : g >>> 1, o[l][0] += M(g), o[l][1] == t.f && (o[l][0] >>>= 1, o[l][1] >>>= 1), o[l][1]++, d = h < 0 ? d - g : d + g, t.i && (d < 0 ? d += e.w : d > t.g && (d -= e.w)), b[p] = d >= 0 ? Math.min(d, t.g) : 0;\n }\n function w(t, e, r) {\n for (var i = t[0].length, n = e; n <= r; n++) t[n][0] = t[n - 1][1], t[n][i - 1] = t[n - 1][i - 2];\n }\n function v(t) {\n w(t, o, u), w(t, e, i), w(t, p, g);\n }\n function x(t, e, r, n, a, o, s, h, l, f, u, d, p) {\n for (var m = 0, g = 1, b = a < c && a > i; g < t.m;) m < t.m && (y(t, e, r, n, a, m, s[l], t.h && (b && f || !b && (u || (m & d) == p))), y(t, e, r, n, o, m, s[l], t.h && (!b && f || b && (u || (m & d) == p))), m += 2), m > 8 && (y(t, e, r, n, a, g, h[l]), y(t, e, r, n, o, g, h[l]), g += 2);\n v(n);\n }\n function E(t, n, a, c, d, b) {\n x(t, n, a, c, e, o, d, b, 0, 0, 1, 0, 8), x(t, n, a, c, s, p, d, b, 1, 0, 1, 0, 8), x(t, n, a, c, r, h, d, b, 2, 1, 0, 3, 0), x(t, n, a, c, l, m, d, b, 0, 0, 0, 3, 2), x(t, n, a, c, i, f, d, b, 1, 0, 0, 3, 2), x(t, n, a, c, u, g, d, b, 2, 1, 0, 3, 0);\n }\n function k(t, r, i, n, a, s) {\n var h = s.length,\n l = t.l;\n a + 1 == t.s && (l = t.e - a * t.l);\n for (var f = 6 * t.e * n + a * t.l, u = 0; u < 6; u++) {\n for (var c = 0; c < l; c++) {\n var d,\n m = s[u % h][c % h];\n d = 0 == m ? e + (u >>> 1) : 2 == m ? p + (u >>> 1) : o + u;\n var g = t.h ? (2 * c / 3 & 2147483646 | c % 3 & 1) + (c % 3 >>> 1) : c >>> 1;\n r[f + c] = i[d][g + 1];\n }\n f += t.e;\n }\n }\n t._decompressRAF = function (o, s) {\n var h = function (e) {\n var r = t._binBE.readUshort,\n i = {\n b: r(e, 0),\n i: e[2],\n C: e[3],\n u: e[4],\n q: r(e, 5),\n k: r(e, 7),\n e: r(e, 9),\n l: r(e, 11),\n s: e[13],\n d: r(e, 14)\n };\n if (18771 != i.b || i.i > 1 || i.q < 6 || i.q % 6 || i.e < 768 || i.e % 24 || 768 != i.l || i.k < i.l || i.k % i.l || i.k - i.e >= i.l || i.s > 16 || i.s != i.k / i.l || i.s != Math.ceil(i.e / i.l) || i.d != i.q / 6 || 12 != i.u && 14 != i.u && 16 != i.u || 16 != i.C && 0 != i.C) throw \"Invalid data\";\n if (0 == i.i) throw \"Not implemented. We need this file!\";\n return i.h = 16 == i.C, i.m = 0 | (i.h ? 2 * i.l / 3 : i.l >>> 1), i.A = i.m + 2, i.f = 64, i.g = (1 << i.u) - 1, i.n = 4 * i.u, i;\n }(o),\n l = function (e, r) {\n var i = new Array(r.s),\n n = 4 * r.s,\n a = 16 + n;\n 12 & n && (a += 16 - (12 & n));\n for (var o = 0, s = 16; o < r.s; s += 4) {\n var h = t._binBE.readUint(e, s);\n i[o] = e.slice(a, a + h), i[o].j = 0, i[o].a = 0, a += h, o++;\n }\n if (a != e.length) throw \"Invalid data\";\n return i;\n }(o, h),\n p = function (t) {\n var e = {\n c: new Int8Array(2 << t.u)\n };\n return function (t, e, r) {\n var i = [0, 18, 67, 276, r];\n t.o = 0, t.w = (i[4] + 0) / 1 + 1 | 0, t.v = Math.ceil(Math.log2(t.w)), t.t = 9, function (t, e) {\n for (var r = -e[4], i = 0; r <= e[4]; i++, r++) t[i] = r <= -e[3] ? -4 : r <= -e[2] ? -3 : r <= -e[1] ? -2 : r < -e[0] ? -1 : r <= e[0] ? 0 : r < e[1] ? 1 : r < e[2] ? 2 : r < e[3] ? 3 : 4;\n }(t.c, i);\n }(e, 0, t.g), e;\n }(h),\n _ = new Int16Array(h.e * h.q);\n null == s && (s = h.h ? [[1, 1, 0, 1, 1, 2], [1, 1, 2, 1, 1, 0], [2, 0, 1, 0, 2, 1], [1, 1, 2, 1, 1, 0], [1, 1, 0, 1, 1, 2], [0, 2, 1, 2, 0, 1]] : [[0, 1], [3, 2]]);\n for (var y = [[0, r], [1, i], [n, f], [a, u], [c, m], [d, g]], w = [], x = 0; x < 18; x++) w[x] = new Uint16Array(h.A);\n for (var S = 0; S < h.s; S++) {\n var M = b(p),\n A = b(p);\n for (x = 0; x < 18; x++) for (var I = 0; I < h.A; I++) w[x][I] = 0;\n for (var B = 0; B < h.d; B++) {\n for (E(h, p, l[S], w, M, A), x = 0; x < 6; x++) for (I = 0; I < h.A; I++) w[y[x][0]][I] = w[y[x][1]][I];\n for (k(h, _, w, B, S, s), x = e; x < 18; x++) if (-1 == [n, a, c, d].indexOf(x)) for (I = 0; I < h.A; I++) w[x][I] = 0;\n v(w);\n }\n }\n return _;\n };\n }();\n }(e, r(2845));\n }();\n },\n 6168: (t, e, r) => {\n \"use strict\";\n\n r.r(e), r.d(e, {\n DOMException: () => v,\n Headers: () => f,\n Request: () => b,\n Response: () => y,\n fetch: () => x\n });\n var i = \"undefined\" != typeof globalThis && globalThis || \"undefined\" != typeof self && self || void 0 !== i && i,\n n = {\n searchParams: \"URLSearchParams\" in i,\n iterable: \"Symbol\" in i && \"iterator\" in Symbol,\n blob: \"FileReader\" in i && \"Blob\" in i && function () {\n try {\n return new Blob(), !0;\n } catch (t) {\n return !1;\n }\n }(),\n formData: \"FormData\" in i,\n arrayBuffer: \"ArrayBuffer\" in i\n };\n if (n.arrayBuffer) var a = [\"[object Int8Array]\", \"[object Uint8Array]\", \"[object Uint8ClampedArray]\", \"[object Int16Array]\", \"[object Uint16Array]\", \"[object Int32Array]\", \"[object Uint32Array]\", \"[object Float32Array]\", \"[object Float64Array]\"],\n o = ArrayBuffer.isView || function (t) {\n return t && a.indexOf(Object.prototype.toString.call(t)) > -1;\n };\n function s(t) {\n if (\"string\" != typeof t && (t = String(t)), /[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(t) || \"\" === t) throw new TypeError('Invalid character in header field name: \"' + t + '\"');\n return t.toLowerCase();\n }\n function h(t) {\n return \"string\" != typeof t && (t = String(t)), t;\n }\n function l(t) {\n var e = {\n next: function () {\n var e = t.shift();\n return {\n done: void 0 === e,\n value: e\n };\n }\n };\n return n.iterable && (e[Symbol.iterator] = function () {\n return e;\n }), e;\n }\n function f(t) {\n this.map = {}, t instanceof f ? t.forEach(function (t, e) {\n this.append(e, t);\n }, this) : Array.isArray(t) ? t.forEach(function (t) {\n this.append(t[0], t[1]);\n }, this) : t && Object.getOwnPropertyNames(t).forEach(function (e) {\n this.append(e, t[e]);\n }, this);\n }\n function u(t) {\n if (t.bodyUsed) return Promise.reject(new TypeError(\"Already read\"));\n t.bodyUsed = !0;\n }\n function c(t) {\n return new Promise(function (e, r) {\n t.onload = function () {\n e(t.result);\n }, t.onerror = function () {\n r(t.error);\n };\n });\n }\n function d(t) {\n var e = new FileReader(),\n r = c(e);\n return e.readAsArrayBuffer(t), r;\n }\n function p(t) {\n if (t.slice) return t.slice(0);\n var e = new Uint8Array(t.byteLength);\n return e.set(new Uint8Array(t)), e.buffer;\n }\n function m() {\n return this.bodyUsed = !1, this._initBody = function (t) {\n var e;\n this.bodyUsed = this.bodyUsed, this._bodyInit = t, t ? \"string\" == typeof t ? this._bodyText = t : n.blob && Blob.prototype.isPrototypeOf(t) ? this._bodyBlob = t : n.formData && FormData.prototype.isPrototypeOf(t) ? this._bodyFormData = t : n.searchParams && URLSearchParams.prototype.isPrototypeOf(t) ? this._bodyText = t.toString() : n.arrayBuffer && n.blob && (e = t) && DataView.prototype.isPrototypeOf(e) ? (this._bodyArrayBuffer = p(t.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : n.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(t) || o(t)) ? this._bodyArrayBuffer = p(t) : this._bodyText = t = Object.prototype.toString.call(t) : this._bodyText = \"\", this.headers.get(\"content-type\") || (\"string\" == typeof t ? this.headers.set(\"content-type\", \"text/plain;charset=UTF-8\") : this._bodyBlob && this._bodyBlob.type ? this.headers.set(\"content-type\", this._bodyBlob.type) : n.searchParams && URLSearchParams.prototype.isPrototypeOf(t) && this.headers.set(\"content-type\", \"application/x-www-form-urlencoded;charset=UTF-8\"));\n }, n.blob && (this.blob = function () {\n var t = u(this);\n if (t) return t;\n if (this._bodyBlob) return Promise.resolve(this._bodyBlob);\n if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer]));\n if (this._bodyFormData) throw new Error(\"could not read FormData body as blob\");\n return Promise.resolve(new Blob([this._bodyText]));\n }, this.arrayBuffer = function () {\n return this._bodyArrayBuffer ? u(this) || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength)) : Promise.resolve(this._bodyArrayBuffer)) : this.blob().then(d);\n }), this.text = function () {\n var t,\n e,\n r,\n i = u(this);\n if (i) return i;\n if (this._bodyBlob) return t = this._bodyBlob, r = c(e = new FileReader()), e.readAsText(t), r;\n if (this._bodyArrayBuffer) return Promise.resolve(function (t) {\n for (var e = new Uint8Array(t), r = new Array(e.length), i = 0; i < e.length; i++) r[i] = String.fromCharCode(e[i]);\n return r.join(\"\");\n }(this._bodyArrayBuffer));\n if (this._bodyFormData) throw new Error(\"could not read FormData body as text\");\n return Promise.resolve(this._bodyText);\n }, n.formData && (this.formData = function () {\n return this.text().then(_);\n }), this.json = function () {\n return this.text().then(JSON.parse);\n }, this;\n }\n f.prototype.append = function (t, e) {\n t = s(t), e = h(e);\n var r = this.map[t];\n this.map[t] = r ? r + \", \" + e : e;\n }, f.prototype.delete = function (t) {\n delete this.map[s(t)];\n }, f.prototype.get = function (t) {\n return t = s(t), this.has(t) ? this.map[t] : null;\n }, f.prototype.has = function (t) {\n return this.map.hasOwnProperty(s(t));\n }, f.prototype.set = function (t, e) {\n this.map[s(t)] = h(e);\n }, f.prototype.forEach = function (t, e) {\n for (var r in this.map) this.map.hasOwnProperty(r) && t.call(e, this.map[r], r, this);\n }, f.prototype.keys = function () {\n var t = [];\n return this.forEach(function (e, r) {\n t.push(r);\n }), l(t);\n }, f.prototype.values = function () {\n var t = [];\n return this.forEach(function (e) {\n t.push(e);\n }), l(t);\n }, f.prototype.entries = function () {\n var t = [];\n return this.forEach(function (e, r) {\n t.push([r, e]);\n }), l(t);\n }, n.iterable && (f.prototype[Symbol.iterator] = f.prototype.entries);\n var g = [\"DELETE\", \"GET\", \"HEAD\", \"OPTIONS\", \"POST\", \"PUT\"];\n function b(t, e) {\n if (!(this instanceof b)) throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.');\n var r,\n i,\n n = (e = e || {}).body;\n if (t instanceof b) {\n if (t.bodyUsed) throw new TypeError(\"Already read\");\n this.url = t.url, this.credentials = t.credentials, e.headers || (this.headers = new f(t.headers)), this.method = t.method, this.mode = t.mode, this.signal = t.signal, n || null == t._bodyInit || (n = t._bodyInit, t.bodyUsed = !0);\n } else this.url = String(t);\n if (this.credentials = e.credentials || this.credentials || \"same-origin\", !e.headers && this.headers || (this.headers = new f(e.headers)), this.method = (i = (r = e.method || this.method || \"GET\").toUpperCase(), g.indexOf(i) > -1 ? i : r), this.mode = e.mode || this.mode || null, this.signal = e.signal || this.signal, this.referrer = null, (\"GET\" === this.method || \"HEAD\" === this.method) && n) throw new TypeError(\"Body not allowed for GET or HEAD requests\");\n if (this._initBody(n), !(\"GET\" !== this.method && \"HEAD\" !== this.method || \"no-store\" !== e.cache && \"no-cache\" !== e.cache)) {\n var a = /([?&])_=[^&]*/;\n a.test(this.url) ? this.url = this.url.replace(a, \"$1_=\" + new Date().getTime()) : this.url += (/\\?/.test(this.url) ? \"&\" : \"?\") + \"_=\" + new Date().getTime();\n }\n }\n function _(t) {\n var e = new FormData();\n return t.trim().split(\"&\").forEach(function (t) {\n if (t) {\n var r = t.split(\"=\"),\n i = r.shift().replace(/\\+/g, \" \"),\n n = r.join(\"=\").replace(/\\+/g, \" \");\n e.append(decodeURIComponent(i), decodeURIComponent(n));\n }\n }), e;\n }\n function y(t, e) {\n if (!(this instanceof y)) throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.');\n e || (e = {}), this.type = \"default\", this.status = void 0 === e.status ? 200 : e.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = void 0 === e.statusText ? \"\" : \"\" + e.statusText, this.headers = new f(e.headers), this.url = e.url || \"\", this._initBody(t);\n }\n b.prototype.clone = function () {\n return new b(this, {\n body: this._bodyInit\n });\n }, m.call(b.prototype), m.call(y.prototype), y.prototype.clone = function () {\n return new y(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new f(this.headers),\n url: this.url\n });\n }, y.error = function () {\n var t = new y(null, {\n status: 0,\n statusText: \"\"\n });\n return t.type = \"error\", t;\n };\n var w = [301, 302, 303, 307, 308];\n y.redirect = function (t, e) {\n if (-1 === w.indexOf(e)) throw new RangeError(\"Invalid status code\");\n return new y(null, {\n status: e,\n headers: {\n location: t\n }\n });\n };\n var v = i.DOMException;\n try {\n new v();\n } catch (t) {\n (v = function (t, e) {\n this.message = t, this.name = e;\n var r = Error(t);\n this.stack = r.stack;\n }).prototype = Object.create(Error.prototype), v.prototype.constructor = v;\n }\n function x(t, e) {\n return new Promise(function (r, a) {\n var o = new b(t, e);\n if (o.signal && o.signal.aborted) return a(new v(\"Aborted\", \"AbortError\"));\n var s = new XMLHttpRequest();\n function l() {\n s.abort();\n }\n s.onload = function () {\n var t,\n e,\n i = {\n status: s.status,\n statusText: s.statusText,\n headers: (t = s.getAllResponseHeaders() || \"\", e = new f(), t.replace(/\\r?\\n[\\t ]+/g, \" \").split(\"\\r\").map(function (t) {\n return 0 === t.indexOf(\"\\n\") ? t.substr(1, t.length) : t;\n }).forEach(function (t) {\n var r = t.split(\":\"),\n i = r.shift().trim();\n if (i) {\n var n = r.join(\":\").trim();\n e.append(i, n);\n }\n }), e)\n };\n i.url = \"responseURL\" in s ? s.responseURL : i.headers.get(\"X-Request-URL\");\n var n = \"response\" in s ? s.response : s.responseText;\n setTimeout(function () {\n r(new y(n, i));\n }, 0);\n }, s.onerror = function () {\n setTimeout(function () {\n a(new TypeError(\"Network request failed\"));\n }, 0);\n }, s.ontimeout = function () {\n setTimeout(function () {\n a(new TypeError(\"Network request failed\"));\n }, 0);\n }, s.onabort = function () {\n setTimeout(function () {\n a(new v(\"Aborted\", \"AbortError\"));\n }, 0);\n }, s.open(o.method, function (t) {\n try {\n return \"\" === t && i.location.href ? i.location.href : t;\n } catch (e) {\n return t;\n }\n }(o.url), !0), \"include\" === o.credentials ? s.withCredentials = !0 : \"omit\" === o.credentials && (s.withCredentials = !1), \"responseType\" in s && (n.blob ? s.responseType = \"blob\" : n.arrayBuffer && o.headers.get(\"Content-Type\") && -1 !== o.headers.get(\"Content-Type\").indexOf(\"application/octet-stream\") && (s.responseType = \"arraybuffer\")), !e || \"object\" != typeof e.headers || e.headers instanceof f ? o.headers.forEach(function (t, e) {\n s.setRequestHeader(e, t);\n }) : Object.getOwnPropertyNames(e.headers).forEach(function (t) {\n s.setRequestHeader(t, h(e.headers[t]));\n }), o.signal && (o.signal.addEventListener(\"abort\", l), s.onreadystatechange = function () {\n 4 === s.readyState && o.signal.removeEventListener(\"abort\", l);\n }), s.send(void 0 === o._bodyInit ? null : o._bodyInit);\n });\n }\n x.polyfill = !0, i.fetch || (i.fetch = x, i.Headers = f, i.Request = b, i.Response = y);\n },\n 6290: (t, e, r) => {\n \"use strict\";\n\n var i = r(5048),\n n = r(9748),\n a = r(4655),\n o = r(1960);\n function s(t, e, r) {\n var i = t;\n return n(e) ? (r = e, \"string\" == typeof t && (i = {\n uri: t\n })) : i = o(e, {\n uri: t\n }), i.callback = r, i;\n }\n function h(t, e, r) {\n return l(e = s(t, e, r));\n }\n function l(t) {\n if (void 0 === t.callback) throw new Error(\"callback argument missing\");\n var e = !1,\n r = function (r, i, n) {\n e || (e = !0, t.callback(r, i, n));\n };\n function i() {\n var t = void 0;\n if (t = f.response ? f.response : f.responseText || function (t) {\n try {\n if (\"document\" === t.responseType) return t.responseXML;\n var e = t.responseXML && \"parsererror\" === t.responseXML.documentElement.nodeName;\n if (\"\" === t.responseType && !e) return t.responseXML;\n } catch (t) {}\n return null;\n }(f), b) try {\n t = JSON.parse(t);\n } catch (t) {}\n return t;\n }\n function n(t) {\n return clearTimeout(u), t instanceof Error || (t = new Error(\"\" + (t || \"Unknown XMLHttpRequest Error\"))), t.statusCode = 0, r(t, _);\n }\n function o() {\n if (!l) {\n var e;\n clearTimeout(u), e = t.useXDR && void 0 === f.status ? 200 : 1223 === f.status ? 204 : f.status;\n var n = _,\n o = null;\n return 0 !== e ? (n = {\n body: i(),\n statusCode: e,\n method: d,\n headers: {},\n url: c,\n rawRequest: f\n }, f.getAllResponseHeaders && (n.headers = a(f.getAllResponseHeaders()))) : o = new Error(\"Internal XMLHttpRequest Error\"), r(o, n, n.body);\n }\n }\n var s,\n l,\n f = t.xhr || null;\n f || (f = t.cors || t.useXDR ? new h.XDomainRequest() : new h.XMLHttpRequest());\n var u,\n c = f.url = t.uri || t.url,\n d = f.method = t.method || \"GET\",\n p = t.body || t.data,\n m = f.headers = t.headers || {},\n g = !!t.sync,\n b = !1,\n _ = {\n body: void 0,\n headers: {},\n statusCode: 0,\n method: d,\n url: c,\n rawRequest: f\n };\n if (\"json\" in t && !1 !== t.json && (b = !0, m.accept || m.Accept || (m.Accept = \"application/json\"), \"GET\" !== d && \"HEAD\" !== d && (m[\"content-type\"] || m[\"Content-Type\"] || (m[\"Content-Type\"] = \"application/json\"), p = JSON.stringify(!0 === t.json ? p : t.json))), f.onreadystatechange = function () {\n 4 === f.readyState && setTimeout(o, 0);\n }, f.onload = o, f.onerror = n, f.onprogress = function () {}, f.onabort = function () {\n l = !0;\n }, f.ontimeout = n, f.open(d, c, !g, t.username, t.password), g || (f.withCredentials = !!t.withCredentials), !g && t.timeout > 0 && (u = setTimeout(function () {\n if (!l) {\n l = !0, f.abort(\"timeout\");\n var t = new Error(\"XMLHttpRequest timeout\");\n t.code = \"ETIMEDOUT\", n(t);\n }\n }, t.timeout)), f.setRequestHeader) for (s in m) m.hasOwnProperty(s) && f.setRequestHeader(s, m[s]);else if (t.headers && !function (t) {\n for (var e in t) if (t.hasOwnProperty(e)) return !1;\n return !0;\n }(t.headers)) throw new Error(\"Headers cannot be set on an XDomainRequest object\");\n return \"responseType\" in t && (f.responseType = t.responseType), \"beforeSend\" in t && \"function\" == typeof t.beforeSend && t.beforeSend(f), f.send(p || null), f;\n }\n t.exports = h, t.exports.default = h, h.XMLHttpRequest = i.XMLHttpRequest || function () {}, h.XDomainRequest = \"withCredentials\" in new h.XMLHttpRequest() ? h.XMLHttpRequest : i.XDomainRequest, function (t, e) {\n for (var r = 0; r < t.length; r++) e(t[r]);\n }([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function (t) {\n h[\"delete\" === t ? \"del\" : t] = function (e, r, i) {\n return (r = s(e, r, i)).method = t.toUpperCase(), l(r);\n };\n });\n },\n 1596: t => {\n t.exports = void 0 !== self.DOMParser ? function (t) {\n return new self.DOMParser().parseFromString(t, \"application/xml\");\n } : void 0 !== self.ActiveXObject && new self.ActiveXObject(\"Microsoft.XMLDOM\") ? function (t) {\n var e = new self.ActiveXObject(\"Microsoft.XMLDOM\");\n return e.async = \"false\", e.loadXML(t), e;\n } : function (t) {\n var e = document.createElement(\"div\");\n return e.innerHTML = t, e;\n };\n },\n 1960: t => {\n t.exports = function () {\n for (var t = {}, r = 0; r < arguments.length; r++) {\n var i = arguments[r];\n for (var n in i) e.call(i, n) && (t[n] = i[n]);\n }\n return t;\n };\n var e = Object.prototype.hasOwnProperty;\n },\n 8522: () => {},\n 6777: () => {},\n 5546: () => {},\n 2460: (t, e, r) => {\n var i = r(4406),\n n = Object.defineProperty,\n a = Object.getOwnPropertyDescriptor,\n o = Object.getOwnPropertyNames,\n s = Object.prototype.hasOwnProperty,\n h = (t, e) => {\n for (var r in e) n(t, r, {\n get: e[r],\n enumerable: !0\n });\n },\n l = (t => (e, r) => t && t.get(e) || (r = ((t, e, r, i) => {\n if (e && \"object\" == typeof e || \"function\" == typeof e) for (let r of o(e)) s.call(t, r) || n(t, r, {\n get: () => e[r],\n enumerable: !(i = a(e, r)) || i.enumerable\n });\n return t;\n })(n({}, \"__esModule\", {\n value: !0\n }), e), t && t.set(e, r), r))(\"undefined\" != typeof WeakMap ? new WeakMap() : 0),\n f = (t, e, r) => (((t, e, r) => {\n e in t ? n(t, e, {\n enumerable: !0,\n configurable: !0,\n writable: !0,\n value: r\n }) : t[e] = r;\n })(t, \"symbol\" != typeof e ? e + \"\" : e, r), r),\n u = {};\n h(u, {\n applyPalette: () => te,\n applyPaletteSync: () => $t,\n buildPalette: () => Kt,\n buildPaletteSync: () => Qt,\n constants: () => c,\n conversion: () => b,\n distance: () => H,\n image: () => Ct,\n palette: () => ot,\n quality: () => Wt,\n utils: () => ct\n });\n var c = {};\n h(c, {\n bt709: () => d\n });\n var d = {};\n h(d, {\n Y: () => p,\n x: () => m,\n y: () => g\n });\n var p = (t => (t[t.RED = .2126] = \"RED\", t[t.GREEN = .7152] = \"GREEN\", t[t.BLUE = .0722] = \"BLUE\", t[t.WHITE = 1] = \"WHITE\", t))(p || {}),\n m = (t => (t[t.RED = .64] = \"RED\", t[t.GREEN = .3] = \"GREEN\", t[t.BLUE = .15] = \"BLUE\", t[t.WHITE = .3127] = \"WHITE\", t))(m || {}),\n g = (t => (t[t.RED = .33] = \"RED\", t[t.GREEN = .6] = \"GREEN\", t[t.BLUE = .06] = \"BLUE\", t[t.WHITE = .329] = \"WHITE\", t))(g || {}),\n b = {};\n function _(t) {\n return t > .04045 ? ((t + .055) / 1.055) ** 2.4 : t / 12.92;\n }\n function y(t, e, r) {\n return {\n x: .4124 * (t = _(t / 255)) + .3576 * (e = _(e / 255)) + .1805 * (r = _(r / 255)),\n y: .2126 * t + .7152 * e + .0722 * r,\n z: .0193 * t + .1192 * e + .9505 * r\n };\n }\n h(b, {\n lab2rgb: () => G,\n lab2xyz: () => N,\n rgb2hsl: () => I,\n rgb2lab: () => L,\n rgb2xyz: () => y,\n xyz2lab: () => O,\n xyz2rgb: () => j\n });\n var w = {};\n function v(t) {\n return t * (Math.PI / 180);\n }\n function x(t, e, r) {\n let i = t;\n return i < e && (i = e), i < r && (i = r), i;\n }\n function E(t, e, r) {\n let i = t;\n return i > e && (i = e), i > r && (i = r), i;\n }\n function k(t, e, r) {\n return t > r && (t = r), t < e && (t = e), 0 | t;\n }\n function S(t) {\n return (t = Math.round(t)) > 255 ? t = 255 : t < 0 && (t = 0), t;\n }\n function M(t) {\n return t > 255 ? t = 255 : t < 0 && (t = 0), t;\n }\n function A(t, e) {\n const r = typeof t[0];\n let i;\n if (\"number\" === r || \"string\" === r) {\n const r = Object.create(null);\n for (let e = 0, i = t.length; e < i; e++) {\n const i = t[e];\n r[i] || 0 === r[i] || (r[i] = e);\n }\n i = t.sort((t, i) => e(t, i) || r[t] - r[i]);\n } else {\n const r = t.slice(0);\n i = t.sort((t, i) => e(t, i) || r.indexOf(t) - r.indexOf(i));\n }\n return i;\n }\n function I(t, e, r) {\n const i = E(t, e, r),\n n = x(t, e, r),\n a = n - i,\n o = (i + n) / 510;\n let s = 0;\n o > 0 && o < 1 && (s = a / (o < .5 ? n + i : 510 - n - i));\n let h = 0;\n return a > 0 && (h = n === t ? (e - r) / a : n === e ? 2 + (r - t) / a : 4 + (t - e) / a, h *= 60, h < 0 && (h += 360)), {\n h,\n s,\n l: o\n };\n }\n h(w, {\n degrees2radians: () => v,\n inRange0to255: () => M,\n inRange0to255Rounded: () => S,\n intInRange: () => k,\n max3: () => x,\n min3: () => E,\n stableSort: () => A\n });\n var B = .95047,\n T = 1,\n R = 1.08883;\n function P(t) {\n return t > .008856 ? t ** (1 / 3) : 7.787 * t + 16 / 116;\n }\n function O(t, e, r) {\n if (t = P(t / B), e = P(e / T), r = P(r / R), 116 * e - 16 < 0) throw new Error(\"xxx\");\n return {\n L: Math.max(0, 116 * e - 16),\n a: 500 * (t - e),\n b: 200 * (e - r)\n };\n }\n function L(t, e, r) {\n const i = y(t, e, r);\n return O(i.x, i.y, i.z);\n }\n var C = .95047,\n U = 1,\n z = 1.08883;\n function D(t) {\n return t > .206893034 ? t ** 3 : (t - 16 / 116) / 7.787;\n }\n function N(t, e, r) {\n const i = (t + 16) / 116,\n n = i - r / 200;\n return {\n x: C * D(e / 500 + i),\n y: U * D(i),\n z: z * D(n)\n };\n }\n function F(t) {\n return t > .0031308 ? 1.055 * t ** (1 / 2.4) - .055 : 12.92 * t;\n }\n function j(t, e, r) {\n const i = F(3.2406 * t + -1.5372 * e + -.4986 * r),\n n = F(-.9689 * t + 1.8758 * e + .0415 * r),\n a = F(.0557 * t + -.204 * e + 1.057 * r);\n return {\n r: S(255 * i),\n g: S(255 * n),\n b: S(255 * a)\n };\n }\n function G(t, e, r) {\n const i = N(t, e, r);\n return j(i.x, i.y, i.z);\n }\n var H = {};\n h(H, {\n AbstractDistanceCalculator: () => W,\n AbstractEuclidean: () => Q,\n AbstractManhattan: () => et,\n CIE94GraphicArts: () => Y,\n CIE94Textiles: () => Z,\n CIEDE2000: () => X,\n CMetric: () => J,\n Euclidean: () => K,\n EuclideanBT709: () => $,\n EuclideanBT709NoAlpha: () => tt,\n Manhattan: () => rt,\n ManhattanBT709: () => nt,\n ManhattanNommyde: () => it,\n PNGQuant: () => at\n });\n var W = class {\n constructor() {\n f(this, \"_maxDistance\"), f(this, \"_whitePoint\"), this._setDefaults(), this.setWhitePoint(255, 255, 255, 255);\n }\n setWhitePoint(t, e, r, i) {\n this._whitePoint = {\n r: t > 0 ? 255 / t : 0,\n g: e > 0 ? 255 / e : 0,\n b: r > 0 ? 255 / r : 0,\n a: i > 0 ? 255 / i : 0\n }, this._maxDistance = this.calculateRaw(t, e, r, i, 0, 0, 0, 0);\n }\n calculateNormalized(t, e) {\n return this.calculateRaw(t.r, t.g, t.b, t.a, e.r, e.g, e.b, e.a) / this._maxDistance;\n }\n },\n q = class extends W {\n calculateRaw(t, e, r, i, n, a, o, s) {\n const h = L(M(t * this._whitePoint.r), M(e * this._whitePoint.g), M(r * this._whitePoint.b)),\n l = L(M(n * this._whitePoint.r), M(a * this._whitePoint.g), M(o * this._whitePoint.b)),\n f = h.L - l.L,\n u = h.a - l.a,\n c = h.b - l.b,\n d = Math.sqrt(h.a * h.a + h.b * h.b),\n p = d - Math.sqrt(l.a * l.a + l.b * l.b);\n let m = u * u + c * c - p * p;\n m = m < 0 ? 0 : Math.sqrt(m);\n const g = (s - i) * this._whitePoint.a * this._kA;\n return Math.sqrt((f / this._Kl) ** 2 + (p / (1 + this._K1 * d)) ** 2 + (m / (1 + this._K2 * d)) ** 2 + g ** 2);\n }\n },\n Z = class extends q {\n _setDefaults() {\n this._Kl = 2, this._K1 = .048, this._K2 = .014, this._kA = 12.5 / 255;\n }\n },\n Y = class extends q {\n _setDefaults() {\n this._Kl = 1, this._K1 = .045, this._K2 = .015, this._kA = 25 / 255;\n }\n },\n V = class extends W {\n _setDefaults() {}\n static _calculatehp(t, e) {\n const r = Math.atan2(t, e);\n return r >= 0 ? r : r + V._deg360InRad;\n }\n static _calculateRT(t, e) {\n const r = e ** 7,\n i = 2 * Math.sqrt(r / (r + V._pow25to7)),\n n = V._deg30InRad * Math.exp(-(((t - V._deg275InRad) / V._deg25InRad) ** 2));\n return -Math.sin(2 * n) * i;\n }\n static _calculateT(t) {\n return 1 - .17 * Math.cos(t - V._deg30InRad) + .24 * Math.cos(2 * t) + .32 * Math.cos(3 * t + V._deg6InRad) - .2 * Math.cos(4 * t - V._deg63InRad);\n }\n static _calculate_ahp(t, e, r, i) {\n const n = r + i;\n return 0 === t ? n : e <= V._deg180InRad ? n / 2 : n < V._deg360InRad ? (n + V._deg360InRad) / 2 : (n - V._deg360InRad) / 2;\n }\n static _calculate_dHp(t, e, r, i) {\n let n;\n return n = 0 === t ? 0 : e <= V._deg180InRad ? r - i : r <= i ? r - i + V._deg360InRad : r - i - V._deg360InRad, 2 * Math.sqrt(t) * Math.sin(n / 2);\n }\n calculateRaw(t, e, r, i, n, a, o, s) {\n const h = L(M(t * this._whitePoint.r), M(e * this._whitePoint.g), M(r * this._whitePoint.b)),\n l = L(M(n * this._whitePoint.r), M(a * this._whitePoint.g), M(o * this._whitePoint.b)),\n f = (s - i) * this._whitePoint.a * V._kA,\n u = this.calculateRawInLab(h, l);\n return Math.sqrt(u + f * f);\n }\n calculateRawInLab(t, e) {\n const r = t.L,\n i = t.a,\n n = t.b,\n a = e.L,\n o = e.a,\n s = e.b,\n h = ((Math.sqrt(i * i + n * n) + Math.sqrt(o * o + s * s)) / 2) ** 7,\n l = .5 * (1 - Math.sqrt(h / (h + V._pow25to7))),\n f = (1 + l) * i,\n u = (1 + l) * o,\n c = Math.sqrt(f * f + n * n),\n d = Math.sqrt(u * u + s * s),\n p = c * d,\n m = V._calculatehp(n, f),\n g = V._calculatehp(s, u),\n b = Math.abs(m - g),\n _ = a - r,\n y = d - c,\n w = V._calculate_dHp(p, b, g, m),\n v = V._calculate_ahp(p, b, m, g),\n x = (c + d) / 2,\n E = ((r + a) / 2 - 50) ** 2,\n k = y / (1 + .045 * x),\n S = w / (1 + .015 * V._calculateT(v) * x);\n return (_ / (1 + .015 * E / Math.sqrt(20 + E))) ** 2 + k ** 2 + S ** 2 + V._calculateRT(v, x) * k * S;\n }\n },\n X = V;\n f(X, \"_kA\", 25 / 255), f(X, \"_pow25to7\", 25 ** 7), f(X, \"_deg360InRad\", v(360)), f(X, \"_deg180InRad\", v(180)), f(X, \"_deg30InRad\", v(30)), f(X, \"_deg6InRad\", v(6)), f(X, \"_deg63InRad\", v(63)), f(X, \"_deg275InRad\", v(275)), f(X, \"_deg25InRad\", v(25));\n var J = class extends W {\n calculateRaw(t, e, r, i, n, a, o, s) {\n const h = (t + n) / 2 * this._whitePoint.r,\n l = (t - n) * this._whitePoint.r,\n f = (e - a) * this._whitePoint.g,\n u = (r - o) * this._whitePoint.b,\n c = ((512 + h) * l * l >> 8) + 4 * f * f + ((767 - h) * u * u >> 8),\n d = (s - i) * this._whitePoint.a;\n return Math.sqrt(c + d * d);\n }\n _setDefaults() {}\n },\n Q = class extends W {\n calculateRaw(t, e, r, i, n, a, o, s) {\n const h = n - t,\n l = a - e,\n f = o - r,\n u = s - i;\n return Math.sqrt(this._kR * h * h + this._kG * l * l + this._kB * f * f + this._kA * u * u);\n }\n },\n K = class extends Q {\n _setDefaults() {\n this._kR = 1, this._kG = 1, this._kB = 1, this._kA = 1;\n }\n },\n $ = class extends Q {\n _setDefaults() {\n this._kR = .2126, this._kG = .7152, this._kB = .0722, this._kA = 1;\n }\n },\n tt = class extends Q {\n _setDefaults() {\n this._kR = .2126, this._kG = .7152, this._kB = .0722, this._kA = 0;\n }\n },\n et = class extends W {\n calculateRaw(t, e, r, i, n, a, o, s) {\n let h = n - t,\n l = a - e,\n f = o - r,\n u = s - i;\n return h < 0 && (h = 0 - h), l < 0 && (l = 0 - l), f < 0 && (f = 0 - f), u < 0 && (u = 0 - u), this._kR * h + this._kG * l + this._kB * f + this._kA * u;\n }\n },\n rt = class extends et {\n _setDefaults() {\n this._kR = 1, this._kG = 1, this._kB = 1, this._kA = 1;\n }\n },\n it = class extends et {\n _setDefaults() {\n this._kR = .4984, this._kG = .8625, this._kB = .2979, this._kA = 1;\n }\n },\n nt = class extends et {\n _setDefaults() {\n this._kR = .2126, this._kG = .7152, this._kB = .0722, this._kA = 1;\n }\n },\n at = class extends W {\n calculateRaw(t, e, r, i, n, a, o, s) {\n const h = (s - i) * this._whitePoint.a;\n return this._colordifferenceCh(t * this._whitePoint.r, n * this._whitePoint.r, h) + this._colordifferenceCh(e * this._whitePoint.g, a * this._whitePoint.g, h) + this._colordifferenceCh(r * this._whitePoint.b, o * this._whitePoint.b, h);\n }\n _colordifferenceCh(t, e, r) {\n const i = t - e,\n n = i + r;\n return i * i + n * n;\n }\n _setDefaults() {}\n },\n ot = {};\n h(ot, {\n AbstractPaletteQuantizer: () => st,\n ColorHistogram: () => kt,\n NeuQuant: () => yt,\n NeuQuantFloat: () => xt,\n RGBQuant: () => Mt,\n WuColorCube: () => Pt,\n WuQuant: () => Lt\n });\n var st = class {\n quantizeSync() {\n for (const t of this.quantize()) if (t.palette) return t.palette;\n throw new Error(\"unreachable\");\n }\n },\n ht = class {\n constructor() {\n f(this, \"r\"), f(this, \"g\"), f(this, \"b\"), f(this, \"a\"), f(this, \"uint32\"), f(this, \"rgba\"), this.uint32 = -1 >>> 0, this.r = this.g = this.b = this.a = 0, this.rgba = new Array(4), this.rgba[0] = 0, this.rgba[1] = 0, this.rgba[2] = 0, this.rgba[3] = 0;\n }\n static createByQuadruplet(t) {\n const e = new ht();\n return e.r = 0 | t[0], e.g = 0 | t[1], e.b = 0 | t[2], e.a = 0 | t[3], e._loadUINT32(), e._loadQuadruplet(), e;\n }\n static createByRGBA(t, e, r, i) {\n const n = new ht();\n return n.r = 0 | t, n.g = 0 | e, n.b = 0 | r, n.a = 0 | i, n._loadUINT32(), n._loadQuadruplet(), n;\n }\n static createByUint32(t) {\n const e = new ht();\n return e.uint32 = t >>> 0, e._loadRGBA(), e._loadQuadruplet(), e;\n }\n from(t) {\n this.r = t.r, this.g = t.g, this.b = t.b, this.a = t.a, this.uint32 = t.uint32, this.rgba[0] = t.r, this.rgba[1] = t.g, this.rgba[2] = t.b, this.rgba[3] = t.a;\n }\n getLuminosity(t) {\n let e = this.r,\n r = this.g,\n i = this.b;\n return t && (e = Math.min(255, 255 - this.a + this.a * e / 255), r = Math.min(255, 255 - this.a + this.a * r / 255), i = Math.min(255, 255 - this.a + this.a * i / 255)), .2126 * e + .7152 * r + .0722 * i;\n }\n _loadUINT32() {\n this.uint32 = (this.a << 24 | this.b << 16 | this.g << 8 | this.r) >>> 0;\n }\n _loadRGBA() {\n this.r = 255 & this.uint32, this.g = this.uint32 >>> 8 & 255, this.b = this.uint32 >>> 16 & 255, this.a = this.uint32 >>> 24 & 255;\n }\n _loadQuadruplet() {\n this.rgba[0] = this.r, this.rgba[1] = this.g, this.rgba[2] = this.b, this.rgba[3] = this.a;\n }\n },\n lt = class {\n constructor() {\n f(this, \"_pointArray\"), f(this, \"_width\"), f(this, \"_height\"), this._width = 0, this._height = 0, this._pointArray = [];\n }\n getWidth() {\n return this._width;\n }\n getHeight() {\n return this._height;\n }\n setWidth(t) {\n this._width = t;\n }\n setHeight(t) {\n this._height = t;\n }\n getPointArray() {\n return this._pointArray;\n }\n clone() {\n const t = new lt();\n t._width = this._width, t._height = this._height;\n for (let e = 0, r = this._pointArray.length; e < r; e++) t._pointArray[e] = ht.createByUint32(0 | this._pointArray[e].uint32);\n return t;\n }\n toUint32Array() {\n const t = this._pointArray.length,\n e = new Uint32Array(t);\n for (let r = 0; r < t; r++) e[r] = this._pointArray[r].uint32;\n return e;\n }\n toUint8Array() {\n return new Uint8Array(this.toUint32Array().buffer);\n }\n static fromHTMLImageElement(t) {\n const e = t.naturalWidth,\n r = t.naturalHeight,\n i = document.createElement(\"canvas\");\n return i.width = e, i.height = r, i.getContext(\"2d\").drawImage(t, 0, 0, e, r, 0, 0, e, r), lt.fromHTMLCanvasElement(i);\n }\n static fromHTMLCanvasElement(t) {\n const e = t.width,\n r = t.height,\n i = t.getContext(\"2d\").getImageData(0, 0, e, r);\n return lt.fromImageData(i);\n }\n static fromImageData(t) {\n const e = t.width,\n r = t.height;\n return lt.fromUint8Array(t.data, e, r);\n }\n static fromUint8Array(t, e, r) {\n switch (Object.prototype.toString.call(t)) {\n case \"[object Uint8ClampedArray]\":\n case \"[object Uint8Array]\":\n break;\n default:\n t = new Uint8Array(t);\n }\n const i = new Uint32Array(t.buffer);\n return lt.fromUint32Array(i, e, r);\n }\n static fromUint32Array(t, e, r) {\n const i = new lt();\n i._width = e, i._height = r;\n for (let e = 0, r = t.length; e < r; e++) i._pointArray[e] = ht.createByUint32(0 | t[e]);\n return i;\n }\n static fromBuffer(t, e, r) {\n const i = new Uint32Array(t.buffer, t.byteOffset, t.byteLength / Uint32Array.BYTES_PER_ELEMENT);\n return lt.fromUint32Array(i, e, r);\n }\n };\n function ft(t, e) {\n const r = 360 / e;\n for (let i = 1, n = r - r / 2; i < e; i++, n += r) if (t >= n && t < n + r) return i;\n return 0;\n }\n var ut = class {\n constructor() {\n f(this, \"_pointContainer\"), f(this, \"_pointArray\", []), f(this, \"_i32idx\", {}), this._pointContainer = new lt(), this._pointContainer.setHeight(1), this._pointArray = this._pointContainer.getPointArray();\n }\n add(t) {\n this._pointArray.push(t), this._pointContainer.setWidth(this._pointArray.length);\n }\n has(t) {\n for (let e = this._pointArray.length - 1; e >= 0; e--) if (t.uint32 === this._pointArray[e].uint32) return !0;\n return !1;\n }\n getNearestColor(t, e) {\n return this._pointArray[0 | this._getNearestIndex(t, e)];\n }\n getPointContainer() {\n return this._pointContainer;\n }\n _nearestPointFromCache(t) {\n return \"number\" == typeof this._i32idx[t] ? this._i32idx[t] : -1;\n }\n _getNearestIndex(t, e) {\n let r = this._nearestPointFromCache(\"\" + e.uint32);\n if (r >= 0) return r;\n let i = Number.MAX_VALUE;\n r = 0;\n for (let n = 0, a = this._pointArray.length; n < a; n++) {\n const a = this._pointArray[n],\n o = t.calculateRaw(e.r, e.g, e.b, e.a, a.r, a.g, a.b, a.a);\n o < i && (i = o, r = n);\n }\n return this._i32idx[e.uint32] = r, r;\n }\n sort() {\n this._i32idx = {}, this._pointArray.sort((t, e) => {\n const r = I(t.r, t.g, t.b),\n i = I(e.r, e.g, e.b),\n n = t.r === t.g && t.g === t.b ? 0 : 1 + ft(r.h, 10),\n a = (e.r === e.g && e.g === e.b ? 0 : 1 + ft(i.h, 10)) - n;\n if (a) return -a;\n const o = t.getLuminosity(!0),\n s = e.getLuminosity(!0);\n if (s - o != 0) return s - o;\n const h = (100 * i.s | 0) - (100 * r.s | 0);\n return h ? -h : 0;\n });\n }\n },\n ct = {};\n h(ct, {\n HueStatistics: () => pt,\n Palette: () => ut,\n Point: () => ht,\n PointContainer: () => lt,\n ProgressTracker: () => gt,\n arithmetic: () => w\n });\n var dt = class {\n constructor() {\n f(this, \"num\", 0), f(this, \"cols\", []);\n }\n },\n pt = class {\n constructor(t, e) {\n f(this, \"_numGroups\"), f(this, \"_minCols\"), f(this, \"_stats\"), f(this, \"_groupsFull\"), this._numGroups = t, this._minCols = e, this._stats = [];\n for (let e = 0; e <= t; e++) this._stats[e] = new dt();\n this._groupsFull = 0;\n }\n check(t) {\n this._groupsFull === this._numGroups + 1 && (this.check = () => {});\n const e = 255 & t,\n r = t >>> 8 & 255,\n i = t >>> 16 & 255,\n n = e === r && r === i ? 0 : 1 + ft(I(e, r, i).h, this._numGroups),\n a = this._stats[n],\n o = this._minCols;\n a.num++, a.num > o || (a.num === o && this._groupsFull++, a.num <= o && this._stats[n].cols.push(t));\n }\n injectIntoDictionary(t) {\n for (let e = 0; e <= this._numGroups; e++) this._stats[e].num <= this._minCols && this._stats[e].cols.forEach(e => {\n t[e] ? t[e]++ : t[e] = 1;\n });\n }\n injectIntoArray(t) {\n for (let e = 0; e <= this._numGroups; e++) this._stats[e].num <= this._minCols && this._stats[e].cols.forEach(e => {\n -1 === t.indexOf(e) && t.push(e);\n });\n }\n },\n mt = class {\n constructor(t, e) {\n f(this, \"progress\"), f(this, \"_step\"), f(this, \"_range\"), f(this, \"_last\"), f(this, \"_progressRange\"), this._range = t, this._progressRange = e, this._step = Math.max(1, this._range / (mt.steps + 1) | 0), this._last = -this._step, this.progress = 0;\n }\n shouldNotify(t) {\n return t - this._last >= this._step && (this._last = t, this.progress = Math.min(this._progressRange * this._last / this._range, this._progressRange), !0);\n }\n },\n gt = mt;\n f(gt, \"steps\", 100);\n var bt = class {\n constructor(t) {\n f(this, \"r\"), f(this, \"g\"), f(this, \"b\"), f(this, \"a\"), this.r = this.g = this.b = this.a = t;\n }\n toPoint() {\n return ht.createByRGBA(this.r >> 3, this.g >> 3, this.b >> 3, this.a >> 3);\n }\n subtract(t, e, r, i) {\n this.r -= 0 | t, this.g -= 0 | e, this.b -= 0 | r, this.a -= 0 | i;\n }\n },\n _t = class extends st {\n constructor(t, e = 256) {\n super(), f(this, \"_pointArray\"), f(this, \"_networkSize\"), f(this, \"_network\"), f(this, \"_sampleFactor\"), f(this, \"_radPower\"), f(this, \"_freq\"), f(this, \"_bias\"), f(this, \"_distance\"), this._distance = t, this._pointArray = [], this._sampleFactor = 1, this._networkSize = e, this._distance.setWhitePoint(2040, 2040, 2040, 2040);\n }\n sample(t) {\n this._pointArray = this._pointArray.concat(t.getPointArray());\n }\n *quantize() {\n this._init(), yield* this._learn(), yield {\n palette: this._buildPalette(),\n progress: 100\n };\n }\n _init() {\n this._freq = [], this._bias = [], this._radPower = [], this._network = [];\n for (let t = 0; t < this._networkSize; t++) this._network[t] = new bt((t << 11) / this._networkSize | 0), this._freq[t] = _t._initialBias / this._networkSize | 0, this._bias[t] = 0;\n }\n *_learn() {\n let t = this._sampleFactor;\n const e = this._pointArray.length;\n e < _t._minpicturebytes && (t = 1);\n const r = 30 + (t - 1) / 3 | 0,\n i = e / t | 0;\n let n,\n a = i / _t._nCycles | 0,\n o = _t._initAlpha,\n s = (this._networkSize >> 3) * _t._radiusBias,\n h = s >> _t._radiusBiasShift;\n h <= 1 && (h = 0);\n for (let t = 0; t < h; t++) this._radPower[t] = o * ((h * h - t * t) * _t._radBias / (h * h)) >>> 0;\n n = e < _t._minpicturebytes ? 1 : e % _t._prime1 != 0 ? _t._prime1 : e % _t._prime2 != 0 ? _t._prime2 : e % _t._prime3 != 0 ? _t._prime3 : _t._prime4;\n const l = new gt(i, 99);\n for (let t = 0, f = 0; t < i;) {\n l.shouldNotify(t) && (yield {\n progress: l.progress\n });\n const i = this._pointArray[f],\n u = i.b << 3,\n c = i.g << 3,\n d = i.r << 3,\n p = i.a << 3,\n m = this._contest(u, c, d, p);\n if (this._alterSingle(o, m, u, c, d, p), 0 !== h && this._alterNeighbour(h, m, u, c, d, p), f += n, f >= e && (f -= e), t++, 0 === a && (a = 1), t % a == 0) {\n o -= o / r | 0, s -= s / _t._radiusDecrease | 0, h = s >> _t._radiusBiasShift, h <= 1 && (h = 0);\n for (let t = 0; t < h; t++) this._radPower[t] = o * ((h * h - t * t) * _t._radBias / (h * h)) >>> 0;\n }\n }\n }\n _buildPalette() {\n const t = new ut();\n return this._network.forEach(e => {\n t.add(e.toPoint());\n }), t.sort(), t;\n }\n _alterNeighbour(t, e, r, i, n, a) {\n let o = e - t;\n o < -1 && (o = -1);\n let s = e + t;\n s > this._networkSize && (s = this._networkSize);\n let h = e + 1,\n l = e - 1,\n f = 1;\n for (; h < s || l > o;) {\n const t = this._radPower[f++] / _t._alphaRadBias;\n if (h < s) {\n const e = this._network[h++];\n e.subtract(t * (e.r - n), t * (e.g - i), t * (e.b - r), t * (e.a - a));\n }\n if (l > o) {\n const e = this._network[l--];\n e.subtract(t * (e.r - n), t * (e.g - i), t * (e.b - r), t * (e.a - a));\n }\n }\n }\n _alterSingle(t, e, r, i, n, a) {\n t /= _t._initAlpha;\n const o = this._network[e];\n o.subtract(t * (o.r - n), t * (o.g - i), t * (o.b - r), t * (o.a - a));\n }\n _contest(t, e, r, i) {\n let n = ~(1 << 31),\n a = n,\n o = -1,\n s = o;\n for (let h = 0; h < this._networkSize; h++) {\n const l = this._network[h],\n f = 8160 * this._distance.calculateNormalized(l, {\n r,\n g: e,\n b: t,\n a: i\n }) | 0;\n f < n && (n = f, o = h);\n const u = f - (this._bias[h] >> _t._initialBiasShift - 3);\n u < a && (a = u, s = h);\n const c = this._freq[h] >> _t._betaShift;\n this._freq[h] -= c, this._bias[h] += c << _t._gammaShift;\n }\n return this._freq[o] += _t._beta, this._bias[o] -= _t._betaGamma, s;\n }\n },\n yt = _t;\n f(yt, \"_prime1\", 499), f(yt, \"_prime2\", 491), f(yt, \"_prime3\", 487), f(yt, \"_prime4\", 503), f(yt, \"_minpicturebytes\", _t._prime4), f(yt, \"_nCycles\", 100), f(yt, \"_initialBiasShift\", 16), f(yt, \"_initialBias\", 1 << _t._initialBiasShift), f(yt, \"_gammaShift\", 10), f(yt, \"_betaShift\", 10), f(yt, \"_beta\", _t._initialBias >> _t._betaShift), f(yt, \"_betaGamma\", _t._initialBias << _t._gammaShift - _t._betaShift), f(yt, \"_radiusBiasShift\", 6), f(yt, \"_radiusBias\", 1 << _t._radiusBiasShift), f(yt, \"_radiusDecrease\", 30), f(yt, \"_alphaBiasShift\", 10), f(yt, \"_initAlpha\", 1 << _t._alphaBiasShift), f(yt, \"_radBiasShift\", 8), f(yt, \"_radBias\", 1 << _t._radBiasShift), f(yt, \"_alphaRadBiasShift\", _t._alphaBiasShift + _t._radBiasShift), f(yt, \"_alphaRadBias\", 1 << _t._alphaRadBiasShift);\n var wt = class {\n constructor(t) {\n f(this, \"r\"), f(this, \"g\"), f(this, \"b\"), f(this, \"a\"), this.r = this.g = this.b = this.a = t;\n }\n toPoint() {\n return ht.createByRGBA(this.r >> 3, this.g >> 3, this.b >> 3, this.a >> 3);\n }\n subtract(t, e, r, i) {\n this.r -= t, this.g -= e, this.b -= r, this.a -= i;\n }\n },\n vt = class extends st {\n constructor(t, e = 256) {\n super(), f(this, \"_pointArray\"), f(this, \"_networkSize\"), f(this, \"_network\"), f(this, \"_sampleFactor\"), f(this, \"_radPower\"), f(this, \"_freq\"), f(this, \"_bias\"), f(this, \"_distance\"), this._distance = t, this._pointArray = [], this._sampleFactor = 1, this._networkSize = e, this._distance.setWhitePoint(2040, 2040, 2040, 2040);\n }\n sample(t) {\n this._pointArray = this._pointArray.concat(t.getPointArray());\n }\n *quantize() {\n this._init(), yield* this._learn(), yield {\n palette: this._buildPalette(),\n progress: 100\n };\n }\n _init() {\n this._freq = [], this._bias = [], this._radPower = [], this._network = [];\n for (let t = 0; t < this._networkSize; t++) this._network[t] = new wt((t << 11) / this._networkSize), this._freq[t] = vt._initialBias / this._networkSize, this._bias[t] = 0;\n }\n *_learn() {\n let t = this._sampleFactor;\n const e = this._pointArray.length;\n e < vt._minpicturebytes && (t = 1);\n const r = 30 + (t - 1) / 3,\n i = e / t;\n let n,\n a = i / vt._nCycles | 0,\n o = vt._initAlpha,\n s = (this._networkSize >> 3) * vt._radiusBias,\n h = s >> vt._radiusBiasShift;\n h <= 1 && (h = 0);\n for (let t = 0; t < h; t++) this._radPower[t] = o * ((h * h - t * t) * vt._radBias / (h * h));\n n = e < vt._minpicturebytes ? 1 : e % vt._prime1 != 0 ? vt._prime1 : e % vt._prime2 != 0 ? vt._prime2 : e % vt._prime3 != 0 ? vt._prime3 : vt._prime4;\n const l = new gt(i, 99);\n for (let t = 0, f = 0; t < i;) {\n l.shouldNotify(t) && (yield {\n progress: l.progress\n });\n const i = this._pointArray[f],\n u = i.b << 3,\n c = i.g << 3,\n d = i.r << 3,\n p = i.a << 3,\n m = this._contest(u, c, d, p);\n if (this._alterSingle(o, m, u, c, d, p), 0 !== h && this._alterNeighbour(h, m, u, c, d, p), f += n, f >= e && (f -= e), t++, 0 === a && (a = 1), t % a == 0) {\n o -= o / r, s -= s / vt._radiusDecrease, h = s >> vt._radiusBiasShift, h <= 1 && (h = 0);\n for (let t = 0; t < h; t++) this._radPower[t] = o * ((h * h - t * t) * vt._radBias / (h * h));\n }\n }\n }\n _buildPalette() {\n const t = new ut();\n return this._network.forEach(e => {\n t.add(e.toPoint());\n }), t.sort(), t;\n }\n _alterNeighbour(t, e, r, i, n, a) {\n let o = e - t;\n o < -1 && (o = -1);\n let s = e + t;\n s > this._networkSize && (s = this._networkSize);\n let h = e + 1,\n l = e - 1,\n f = 1;\n for (; h < s || l > o;) {\n const t = this._radPower[f++] / vt._alphaRadBias;\n if (h < s) {\n const e = this._network[h++];\n e.subtract(t * (e.r - n), t * (e.g - i), t * (e.b - r), t * (e.a - a));\n }\n if (l > o) {\n const e = this._network[l--];\n e.subtract(t * (e.r - n), t * (e.g - i), t * (e.b - r), t * (e.a - a));\n }\n }\n }\n _alterSingle(t, e, r, i, n, a) {\n t /= vt._initAlpha;\n const o = this._network[e];\n o.subtract(t * (o.r - n), t * (o.g - i), t * (o.b - r), t * (o.a - a));\n }\n _contest(t, e, r, i) {\n let n = ~(1 << 31),\n a = n,\n o = -1,\n s = o;\n for (let h = 0; h < this._networkSize; h++) {\n const l = this._network[h],\n f = 8160 * this._distance.calculateNormalized(l, {\n r,\n g: e,\n b: t,\n a: i\n });\n f < n && (n = f, o = h);\n const u = f - (this._bias[h] >> vt._initialBiasShift - 3);\n u < a && (a = u, s = h);\n const c = this._freq[h] >> vt._betaShift;\n this._freq[h] -= c, this._bias[h] += c << vt._gammaShift;\n }\n return this._freq[o] += vt._beta, this._bias[o] -= vt._betaGamma, s;\n }\n },\n xt = vt;\n f(xt, \"_prime1\", 499), f(xt, \"_prime2\", 491), f(xt, \"_prime3\", 487), f(xt, \"_prime4\", 503), f(xt, \"_minpicturebytes\", vt._prime4), f(xt, \"_nCycles\", 100), f(xt, \"_initialBiasShift\", 16), f(xt, \"_initialBias\", 1 << vt._initialBiasShift), f(xt, \"_gammaShift\", 10), f(xt, \"_betaShift\", 10), f(xt, \"_beta\", vt._initialBias >> vt._betaShift), f(xt, \"_betaGamma\", vt._initialBias << vt._gammaShift - vt._betaShift), f(xt, \"_radiusBiasShift\", 6), f(xt, \"_radiusBias\", 1 << vt._radiusBiasShift), f(xt, \"_radiusDecrease\", 30), f(xt, \"_alphaBiasShift\", 10), f(xt, \"_initAlpha\", 1 << vt._alphaBiasShift), f(xt, \"_radBiasShift\", 8), f(xt, \"_radBias\", 1 << vt._radBiasShift), f(xt, \"_alphaRadBiasShift\", vt._alphaBiasShift + vt._radBiasShift), f(xt, \"_alphaRadBias\", 1 << vt._alphaRadBiasShift);\n var Et = class {\n constructor(t, e) {\n f(this, \"_method\"), f(this, \"_hueStats\"), f(this, \"_histogram\"), f(this, \"_initColors\"), f(this, \"_minHueCols\"), this._method = t, this._minHueCols = e << 2, this._initColors = e << 2, this._hueStats = new pt(Et._hueGroups, this._minHueCols), this._histogram = Object.create(null);\n }\n sample(t) {\n switch (this._method) {\n case 1:\n this._colorStats1D(t);\n break;\n case 2:\n this._colorStats2D(t);\n }\n }\n getImportanceSortedColorsIDXI32() {\n const t = A(Object.keys(this._histogram), (t, e) => this._histogram[e] - this._histogram[t]);\n if (0 === t.length) return [];\n let e;\n switch (this._method) {\n case 1:\n const r = Math.min(t.length, this._initColors),\n i = t[r - 1],\n n = this._histogram[i];\n e = t.slice(0, r);\n let a = r;\n const o = t.length;\n for (; a < o && this._histogram[t[a]] === n;) e.push(t[a++]);\n this._hueStats.injectIntoArray(e);\n break;\n case 2:\n e = t;\n break;\n default:\n throw new Error(\"Incorrect method\");\n }\n return e.map(t => +t);\n }\n _colorStats1D(t) {\n const e = this._histogram,\n r = t.getPointArray(),\n i = r.length;\n for (let t = 0; t < i; t++) {\n const i = r[t].uint32;\n this._hueStats.check(i), i in e ? e[i]++ : e[i] = 1;\n }\n }\n _colorStats2D(t) {\n const e = t.getWidth(),\n r = t.getHeight(),\n i = t.getPointArray(),\n n = Et._boxSize[0],\n a = Et._boxSize[1],\n o = n * a,\n s = this._makeBoxes(e, r, n, a),\n h = this._histogram;\n s.forEach(t => {\n let r = Math.round(t.w * t.h / o) * Et._boxPixels;\n r < 2 && (r = 2);\n const n = {};\n this._iterateBox(t, e, t => {\n const e = i[t].uint32;\n this._hueStats.check(e), e in h ? h[e]++ : e in n ? ++n[e] >= r && (h[e] = n[e]) : n[e] = 1;\n });\n }), this._hueStats.injectIntoDictionary(h);\n }\n _iterateBox(t, e, r) {\n const i = t,\n n = i.y * e + i.x,\n a = (i.y + i.h - 1) * e + (i.x + i.w - 1),\n o = e - i.w + 1;\n let s = 0,\n h = n;\n do {\n r.call(this, h), h += ++s % i.w == 0 ? o : 1;\n } while (h <= a);\n }\n _makeBoxes(t, e, r, i) {\n const n = t % r,\n a = e % i,\n o = t - n,\n s = e - a,\n h = [];\n for (let l = 0; l < e; l += i) for (let e = 0; e < t; e += r) h.push({\n x: e,\n y: l,\n w: e === o ? n : r,\n h: l === s ? a : i\n });\n return h;\n }\n },\n kt = Et;\n f(kt, \"_boxSize\", [64, 64]), f(kt, \"_boxPixels\", 2), f(kt, \"_hueGroups\", 10);\n var St = class {\n constructor(t, e, r) {\n f(this, \"index\"), f(this, \"color\"), f(this, \"distance\"), this.index = t, this.color = e, this.distance = r;\n }\n },\n Mt = class extends st {\n constructor(t, e = 256, r = 2) {\n super(), f(this, \"_colors\"), f(this, \"_initialDistance\"), f(this, \"_distanceIncrement\"), f(this, \"_histogram\"), f(this, \"_distance\"), this._distance = t, this._colors = e, this._histogram = new kt(r, e), this._initialDistance = .01, this._distanceIncrement = .005;\n }\n sample(t) {\n this._histogram.sample(t);\n }\n *quantize() {\n const t = this._histogram.getImportanceSortedColorsIDXI32();\n if (0 === t.length) throw new Error(\"No colors in image\");\n yield* this._buildPalette(t);\n }\n *_buildPalette(t) {\n const e = new ut(),\n r = e.getPointContainer().getPointArray(),\n i = new Array(t.length);\n for (let e = 0; e < t.length; e++) r.push(ht.createByUint32(t[e])), i[e] = 1;\n const n = r.length,\n a = [];\n let o = n,\n s = this._initialDistance;\n const h = new gt(o - this._colors, 99);\n for (; o > this._colors;) {\n a.length = 0;\n for (let t = 0; t < n; t++) {\n if (h.shouldNotify(n - o) && (yield {\n progress: h.progress\n }), 0 === i[t]) continue;\n const e = r[t];\n for (let h = t + 1; h < n; h++) {\n if (0 === i[h]) continue;\n const t = r[h],\n n = this._distance.calculateNormalized(e, t);\n n < s && (a.push(new St(h, t, n)), i[h] = 0, o--);\n }\n }\n s += o > 3 * this._colors ? this._initialDistance : this._distanceIncrement;\n }\n if (o < this._colors) {\n A(a, (t, e) => e.distance - t.distance);\n let t = 0;\n for (; o < this._colors && t < a.length;) i[a[t].index] = 1, o++, t++;\n }\n let l = r.length;\n for (let t = l - 1; t >= 0; t--) 0 === i[t] && (t !== l - 1 && (r[t] = r[l - 1]), --l);\n r.length = l, e.sort(), yield {\n palette: e,\n progress: 100\n };\n }\n };\n function At(t) {\n const e = [];\n for (let r = 0; r < t; r++) e[r] = 0;\n return e;\n }\n function It(t, e, r, i) {\n const n = new Array(t);\n for (let a = 0; a < t; a++) {\n n[a] = new Array(e);\n for (let t = 0; t < e; t++) {\n n[a][t] = new Array(r);\n for (let e = 0; e < r; e++) {\n n[a][t][e] = new Array(i);\n for (let r = 0; r < i; r++) n[a][t][e][r] = 0;\n }\n }\n }\n return n;\n }\n function Bt(t, e, r) {\n const i = new Array(t);\n for (let n = 0; n < t; n++) {\n i[n] = new Array(e);\n for (let t = 0; t < e; t++) {\n i[n][t] = new Array(r);\n for (let e = 0; e < r; e++) i[n][t][e] = 0;\n }\n }\n return i;\n }\n function Tt(t, e, r, i, n) {\n for (let a = 0; a < e; a++) {\n t[a] = [];\n for (let e = 0; e < r; e++) {\n t[a][e] = [];\n for (let r = 0; r < i; r++) t[a][e][r] = n;\n }\n }\n }\n function Rt(t, e, r) {\n for (let i = 0; i < e; i++) t[i] = r;\n }\n var Pt = class {\n constructor() {\n f(this, \"redMinimum\"), f(this, \"redMaximum\"), f(this, \"greenMinimum\"), f(this, \"greenMaximum\"), f(this, \"blueMinimum\"), f(this, \"blueMaximum\"), f(this, \"volume\"), f(this, \"alphaMinimum\"), f(this, \"alphaMaximum\");\n }\n },\n Ot = class extends st {\n constructor(t, e = 256, r = 5) {\n super(), f(this, \"_reds\"), f(this, \"_greens\"), f(this, \"_blues\"), f(this, \"_alphas\"), f(this, \"_sums\"), f(this, \"_weights\"), f(this, \"_momentsRed\"), f(this, \"_momentsGreen\"), f(this, \"_momentsBlue\"), f(this, \"_momentsAlpha\"), f(this, \"_moments\"), f(this, \"_table\"), f(this, \"_pixels\"), f(this, \"_cubes\"), f(this, \"_colors\"), f(this, \"_significantBitsPerChannel\"), f(this, \"_maxSideIndex\"), f(this, \"_alphaMaxSideIndex\"), f(this, \"_sideSize\"), f(this, \"_alphaSideSize\"), f(this, \"_distance\"), this._distance = t, this._setQuality(r), this._initialize(e);\n }\n sample(t) {\n const e = t.getPointArray();\n for (let t = 0, r = e.length; t < r; t++) this._addColor(e[t]);\n this._pixels = this._pixels.concat(e);\n }\n *quantize() {\n yield* this._preparePalette();\n const t = new ut();\n for (let e = 0; e < this._colors; e++) if (this._sums[e] > 0) {\n const r = this._sums[e],\n i = this._reds[e] / r,\n n = this._greens[e] / r,\n a = this._blues[e] / r,\n o = this._alphas[e] / r,\n s = ht.createByRGBA(0 | i, 0 | n, 0 | a, 0 | o);\n t.add(s);\n }\n t.sort(), yield {\n palette: t,\n progress: 100\n };\n }\n *_preparePalette() {\n yield* this._calculateMoments();\n let t = 0;\n const e = At(this._colors);\n for (let r = 1; r < this._colors; ++r) {\n this._cut(this._cubes[t], this._cubes[r]) ? (e[t] = this._cubes[t].volume > 1 ? this._calculateVariance(this._cubes[t]) : 0, e[r] = this._cubes[r].volume > 1 ? this._calculateVariance(this._cubes[r]) : 0) : (e[t] = 0, r--), t = 0;\n let i = e[0];\n for (let n = 1; n <= r; ++n) e[n] > i && (i = e[n], t = n);\n if (i <= 0) {\n this._colors = r + 1;\n break;\n }\n }\n const r = [],\n i = [],\n n = [],\n a = [];\n for (let t = 0; t < this._colors; ++t) {\n const e = Ot._volume(this._cubes[t], this._weights);\n e > 0 ? (r[t] = Ot._volume(this._cubes[t], this._momentsRed) / e | 0, i[t] = Ot._volume(this._cubes[t], this._momentsGreen) / e | 0, n[t] = Ot._volume(this._cubes[t], this._momentsBlue) / e | 0, a[t] = Ot._volume(this._cubes[t], this._momentsAlpha) / e | 0) : (r[t] = 0, i[t] = 0, n[t] = 0, a[t] = 0);\n }\n this._reds = At(this._colors + 1), this._greens = At(this._colors + 1), this._blues = At(this._colors + 1), this._alphas = At(this._colors + 1), this._sums = At(this._colors + 1);\n for (let t = 0, e = this._pixels.length; t < e; t++) {\n const e = this._pixels[t];\n let o = -1,\n s = Number.MAX_VALUE;\n for (let t = 0; t < this._colors; t++) {\n const h = r[t],\n l = i[t],\n f = n[t],\n u = a[t],\n c = this._distance.calculateRaw(h, l, f, u, e.r, e.g, e.b, e.a);\n c < s && (s = c, o = t);\n }\n this._reds[o] += e.r, this._greens[o] += e.g, this._blues[o] += e.b, this._alphas[o] += e.a, this._sums[o]++;\n }\n }\n _addColor(t) {\n const e = 8 - this._significantBitsPerChannel,\n r = 1 + (t.r >> e),\n i = 1 + (t.g >> e),\n n = 1 + (t.b >> e),\n a = 1 + (t.a >> e);\n this._weights[a][r][i][n]++, this._momentsRed[a][r][i][n] += t.r, this._momentsGreen[a][r][i][n] += t.g, this._momentsBlue[a][r][i][n] += t.b, this._momentsAlpha[a][r][i][n] += t.a, this._moments[a][r][i][n] += this._table[t.r] + this._table[t.g] + this._table[t.b] + this._table[t.a];\n }\n *_calculateMoments() {\n const t = [],\n e = [],\n r = [],\n i = [],\n n = [],\n a = [],\n o = Bt(this._sideSize, this._sideSize, this._sideSize),\n s = Bt(this._sideSize, this._sideSize, this._sideSize),\n h = Bt(this._sideSize, this._sideSize, this._sideSize),\n l = Bt(this._sideSize, this._sideSize, this._sideSize),\n f = Bt(this._sideSize, this._sideSize, this._sideSize),\n u = Bt(this._sideSize, this._sideSize, this._sideSize);\n let c = 0;\n const d = new gt(this._alphaMaxSideIndex * this._maxSideIndex, 99);\n for (let p = 1; p <= this._alphaMaxSideIndex; ++p) {\n Tt(o, this._sideSize, this._sideSize, this._sideSize, 0), Tt(s, this._sideSize, this._sideSize, this._sideSize, 0), Tt(h, this._sideSize, this._sideSize, this._sideSize, 0), Tt(l, this._sideSize, this._sideSize, this._sideSize, 0), Tt(f, this._sideSize, this._sideSize, this._sideSize, 0), Tt(u, this._sideSize, this._sideSize, this._sideSize, 0);\n for (let m = 1; m <= this._maxSideIndex; ++m, ++c) {\n d.shouldNotify(c) && (yield {\n progress: d.progress\n }), Rt(t, this._sideSize, 0), Rt(e, this._sideSize, 0), Rt(r, this._sideSize, 0), Rt(i, this._sideSize, 0), Rt(n, this._sideSize, 0), Rt(a, this._sideSize, 0);\n for (let c = 1; c <= this._maxSideIndex; ++c) {\n let d = 0,\n g = 0,\n b = 0,\n _ = 0,\n y = 0,\n w = 0;\n for (let v = 1; v <= this._maxSideIndex; ++v) d += this._weights[p][m][c][v], g += this._momentsRed[p][m][c][v], b += this._momentsGreen[p][m][c][v], _ += this._momentsBlue[p][m][c][v], y += this._momentsAlpha[p][m][c][v], w += this._moments[p][m][c][v], t[v] += d, e[v] += g, r[v] += b, i[v] += _, n[v] += y, a[v] += w, o[m][c][v] = o[m - 1][c][v] + t[v], s[m][c][v] = s[m - 1][c][v] + e[v], h[m][c][v] = h[m - 1][c][v] + r[v], l[m][c][v] = l[m - 1][c][v] + i[v], f[m][c][v] = f[m - 1][c][v] + n[v], u[m][c][v] = u[m - 1][c][v] + a[v], this._weights[p][m][c][v] = this._weights[p - 1][m][c][v] + o[m][c][v], this._momentsRed[p][m][c][v] = this._momentsRed[p - 1][m][c][v] + s[m][c][v], this._momentsGreen[p][m][c][v] = this._momentsGreen[p - 1][m][c][v] + h[m][c][v], this._momentsBlue[p][m][c][v] = this._momentsBlue[p - 1][m][c][v] + l[m][c][v], this._momentsAlpha[p][m][c][v] = this._momentsAlpha[p - 1][m][c][v] + f[m][c][v], this._moments[p][m][c][v] = this._moments[p - 1][m][c][v] + u[m][c][v];\n }\n }\n }\n }\n static _volumeFloat(t, e) {\n return e[t.alphaMaximum][t.redMaximum][t.greenMaximum][t.blueMaximum] - e[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMaximum] - e[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMaximum] + e[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMaximum] - e[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMaximum] + e[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMaximum] + e[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMaximum] - e[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum] - (e[t.alphaMaximum][t.redMaximum][t.greenMaximum][t.blueMinimum] - e[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMinimum] - e[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMinimum] + e[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum] - e[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMinimum] + e[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum] + e[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum] - e[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);\n }\n static _volume(t, e) {\n return 0 | Ot._volumeFloat(t, e);\n }\n static _top(t, e, r, i) {\n let n;\n switch (e) {\n case Ot._alpha:\n n = i[r][t.redMaximum][t.greenMaximum][t.blueMaximum] - i[r][t.redMaximum][t.greenMinimum][t.blueMaximum] - i[r][t.redMinimum][t.greenMaximum][t.blueMaximum] + i[r][t.redMinimum][t.greenMinimum][t.blueMaximum] - (i[r][t.redMaximum][t.greenMaximum][t.blueMinimum] - i[r][t.redMaximum][t.greenMinimum][t.blueMinimum] - i[r][t.redMinimum][t.greenMaximum][t.blueMinimum] + i[r][t.redMinimum][t.greenMinimum][t.blueMinimum]);\n break;\n case Ot._red:\n n = i[t.alphaMaximum][r][t.greenMaximum][t.blueMaximum] - i[t.alphaMaximum][r][t.greenMinimum][t.blueMaximum] - i[t.alphaMinimum][r][t.greenMaximum][t.blueMaximum] + i[t.alphaMinimum][r][t.greenMinimum][t.blueMaximum] - (i[t.alphaMaximum][r][t.greenMaximum][t.blueMinimum] - i[t.alphaMaximum][r][t.greenMinimum][t.blueMinimum] - i[t.alphaMinimum][r][t.greenMaximum][t.blueMinimum] + i[t.alphaMinimum][r][t.greenMinimum][t.blueMinimum]);\n break;\n case Ot._green:\n n = i[t.alphaMaximum][t.redMaximum][r][t.blueMaximum] - i[t.alphaMaximum][t.redMinimum][r][t.blueMaximum] - i[t.alphaMinimum][t.redMaximum][r][t.blueMaximum] + i[t.alphaMinimum][t.redMinimum][r][t.blueMaximum] - (i[t.alphaMaximum][t.redMaximum][r][t.blueMinimum] - i[t.alphaMaximum][t.redMinimum][r][t.blueMinimum] - i[t.alphaMinimum][t.redMaximum][r][t.blueMinimum] + i[t.alphaMinimum][t.redMinimum][r][t.blueMinimum]);\n break;\n case Ot._blue:\n n = i[t.alphaMaximum][t.redMaximum][t.greenMaximum][r] - i[t.alphaMaximum][t.redMaximum][t.greenMinimum][r] - i[t.alphaMaximum][t.redMinimum][t.greenMaximum][r] + i[t.alphaMaximum][t.redMinimum][t.greenMinimum][r] - (i[t.alphaMinimum][t.redMaximum][t.greenMaximum][r] - i[t.alphaMinimum][t.redMaximum][t.greenMinimum][r] - i[t.alphaMinimum][t.redMinimum][t.greenMaximum][r] + i[t.alphaMinimum][t.redMinimum][t.greenMinimum][r]);\n break;\n default:\n throw new Error(\"impossible\");\n }\n return 0 | n;\n }\n static _bottom(t, e, r) {\n switch (e) {\n case Ot._alpha:\n return -r[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMaximum] + r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMaximum] + r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMaximum] - r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum] - (-r[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMinimum] + r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum] + r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum] - r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);\n case Ot._red:\n return -r[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMaximum] + r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMaximum] + r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMaximum] - r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum] - (-r[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMinimum] + r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum] + r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum] - r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);\n case Ot._green:\n return -r[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMaximum] + r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMaximum] + r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMaximum] - r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum] - (-r[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMinimum] + r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum] + r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum] - r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);\n case Ot._blue:\n return -r[t.alphaMaximum][t.redMaximum][t.greenMaximum][t.blueMinimum] + r[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMinimum] + r[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMinimum] - r[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum] - (-r[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMinimum] + r[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum] + r[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum] - r[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum]);\n default:\n return 0;\n }\n }\n _calculateVariance(t) {\n const e = Ot._volume(t, this._momentsRed),\n r = Ot._volume(t, this._momentsGreen),\n i = Ot._volume(t, this._momentsBlue),\n n = Ot._volume(t, this._momentsAlpha);\n return Ot._volumeFloat(t, this._moments) - (e * e + r * r + i * i + n * n) / Ot._volume(t, this._weights);\n }\n _maximize(t, e, r, i, n, a, o, s, h) {\n const l = 0 | Ot._bottom(t, e, this._momentsRed),\n f = 0 | Ot._bottom(t, e, this._momentsGreen),\n u = 0 | Ot._bottom(t, e, this._momentsBlue),\n c = 0 | Ot._bottom(t, e, this._momentsAlpha),\n d = 0 | Ot._bottom(t, e, this._weights);\n let p = 0,\n m = -1;\n for (let g = r; g < i; ++g) {\n let r = l + Ot._top(t, e, g, this._momentsRed),\n i = f + Ot._top(t, e, g, this._momentsGreen),\n b = u + Ot._top(t, e, g, this._momentsBlue),\n _ = c + Ot._top(t, e, g, this._momentsAlpha),\n y = d + Ot._top(t, e, g, this._weights);\n if (0 !== y) {\n let t = r * r + i * i + b * b + _ * _,\n e = t / y;\n r = n - r, i = a - i, b = o - b, _ = s - _, y = h - y, 0 !== y && (t = r * r + i * i + b * b + _ * _, e += t / y, e > p && (p = e, m = g));\n }\n }\n return {\n max: p,\n position: m\n };\n }\n _cut(t, e) {\n let r;\n const i = Ot._volume(t, this._momentsRed),\n n = Ot._volume(t, this._momentsGreen),\n a = Ot._volume(t, this._momentsBlue),\n o = Ot._volume(t, this._momentsAlpha),\n s = Ot._volume(t, this._weights),\n h = this._maximize(t, Ot._red, t.redMinimum + 1, t.redMaximum, i, n, a, o, s),\n l = this._maximize(t, Ot._green, t.greenMinimum + 1, t.greenMaximum, i, n, a, o, s),\n f = this._maximize(t, Ot._blue, t.blueMinimum + 1, t.blueMaximum, i, n, a, o, s),\n u = this._maximize(t, Ot._alpha, t.alphaMinimum + 1, t.alphaMaximum, i, n, a, o, s);\n if (u.max >= h.max && u.max >= l.max && u.max >= f.max) {\n if (r = Ot._alpha, u.position < 0) return !1;\n } else r = h.max >= u.max && h.max >= l.max && h.max >= f.max ? Ot._red : l.max >= u.max && l.max >= h.max && l.max >= f.max ? Ot._green : Ot._blue;\n switch (e.redMaximum = t.redMaximum, e.greenMaximum = t.greenMaximum, e.blueMaximum = t.blueMaximum, e.alphaMaximum = t.alphaMaximum, r) {\n case Ot._red:\n e.redMinimum = t.redMaximum = h.position, e.greenMinimum = t.greenMinimum, e.blueMinimum = t.blueMinimum, e.alphaMinimum = t.alphaMinimum;\n break;\n case Ot._green:\n e.greenMinimum = t.greenMaximum = l.position, e.redMinimum = t.redMinimum, e.blueMinimum = t.blueMinimum, e.alphaMinimum = t.alphaMinimum;\n break;\n case Ot._blue:\n e.blueMinimum = t.blueMaximum = f.position, e.redMinimum = t.redMinimum, e.greenMinimum = t.greenMinimum, e.alphaMinimum = t.alphaMinimum;\n break;\n case Ot._alpha:\n e.alphaMinimum = t.alphaMaximum = u.position, e.blueMinimum = t.blueMinimum, e.redMinimum = t.redMinimum, e.greenMinimum = t.greenMinimum;\n }\n return t.volume = (t.redMaximum - t.redMinimum) * (t.greenMaximum - t.greenMinimum) * (t.blueMaximum - t.blueMinimum) * (t.alphaMaximum - t.alphaMinimum), e.volume = (e.redMaximum - e.redMinimum) * (e.greenMaximum - e.greenMinimum) * (e.blueMaximum - e.blueMinimum) * (e.alphaMaximum - e.alphaMinimum), !0;\n }\n _initialize(t) {\n this._colors = t, this._cubes = [];\n for (let e = 0; e < t; e++) this._cubes[e] = new Pt();\n this._cubes[0].redMinimum = 0, this._cubes[0].greenMinimum = 0, this._cubes[0].blueMinimum = 0, this._cubes[0].alphaMinimum = 0, this._cubes[0].redMaximum = this._maxSideIndex, this._cubes[0].greenMaximum = this._maxSideIndex, this._cubes[0].blueMaximum = this._maxSideIndex, this._cubes[0].alphaMaximum = this._alphaMaxSideIndex, this._weights = It(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize), this._momentsRed = It(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize), this._momentsGreen = It(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize), this._momentsBlue = It(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize), this._momentsAlpha = It(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize), this._moments = It(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize), this._table = [];\n for (let t = 0; t < 256; ++t) this._table[t] = t * t;\n this._pixels = [];\n }\n _setQuality(t = 5) {\n this._significantBitsPerChannel = t, this._maxSideIndex = 1 << this._significantBitsPerChannel, this._alphaMaxSideIndex = this._maxSideIndex, this._sideSize = this._maxSideIndex + 1, this._alphaSideSize = this._alphaMaxSideIndex + 1;\n }\n },\n Lt = Ot;\n f(Lt, \"_alpha\", 3), f(Lt, \"_red\", 2), f(Lt, \"_green\", 1), f(Lt, \"_blue\", 0);\n var Ct = {};\n h(Ct, {\n AbstractImageQuantizer: () => Ut,\n ErrorDiffusionArray: () => Nt,\n ErrorDiffusionArrayKernel: () => Dt,\n ErrorDiffusionRiemersma: () => Ht,\n NearestColor: () => zt\n });\n var Ut = class {\n quantizeSync(t, e) {\n for (const r of this.quantize(t, e)) if (r.pointContainer) return r.pointContainer;\n throw new Error(\"unreachable\");\n }\n },\n zt = class extends Ut {\n constructor(t) {\n super(), f(this, \"_distance\"), this._distance = t;\n }\n *quantize(t, e) {\n const r = t.getPointArray(),\n i = t.getWidth(),\n n = t.getHeight(),\n a = new gt(n, 99);\n for (let t = 0; t < n; t++) {\n a.shouldNotify(t) && (yield {\n progress: a.progress\n });\n for (let n = 0, a = t * i; n < i; n++, a++) {\n const t = r[a];\n t.from(e.getNearestColor(this._distance, t));\n }\n }\n yield {\n pointContainer: t,\n progress: 100\n };\n }\n },\n Dt = (t => (t[t.FloydSteinberg = 0] = \"FloydSteinberg\", t[t.FalseFloydSteinberg = 1] = \"FalseFloydSteinberg\", t[t.Stucki = 2] = \"Stucki\", t[t.Atkinson = 3] = \"Atkinson\", t[t.Jarvis = 4] = \"Jarvis\", t[t.Burkes = 5] = \"Burkes\", t[t.Sierra = 6] = \"Sierra\", t[t.TwoSierra = 7] = \"TwoSierra\", t[t.SierraLite = 8] = \"SierraLite\", t))(Dt || {}),\n Nt = class extends Ut {\n constructor(t, e, r = !0, i = 0, n = !1) {\n super(), f(this, \"_minColorDistance\"), f(this, \"_serpentine\"), f(this, \"_kernel\"), f(this, \"_calculateErrorLikeGIMP\"), f(this, \"_distance\"), this._setKernel(e), this._distance = t, this._minColorDistance = i, this._serpentine = r, this._calculateErrorLikeGIMP = n;\n }\n *quantize(t, e) {\n const r = t.getPointArray(),\n i = new ht(),\n n = t.getWidth(),\n a = t.getHeight(),\n o = [];\n let s = 1,\n h = 1;\n for (const t of this._kernel) {\n const e = t[2] + 1;\n h < e && (h = e);\n }\n for (let t = 0; t < h; t++) this._fillErrorLine(o[t] = [], n);\n const l = new gt(a, 99);\n for (let t = 0; t < a; t++) {\n l.shouldNotify(t) && (yield {\n progress: l.progress\n }), this._serpentine && (s *= -1);\n const h = t * n,\n f = 1 === s ? 0 : n - 1,\n u = 1 === s ? n : -1;\n this._fillErrorLine(o[0], n), o.push(o.shift());\n const c = o[0];\n for (let l = f, d = h + f; l !== u; l += s, d += s) {\n const h = r[d],\n f = c[l];\n i.from(h);\n const u = ht.createByRGBA(S(h.r + f[0]), S(h.g + f[1]), S(h.b + f[2]), S(h.a + f[3])),\n p = e.getNearestColor(this._distance, u);\n if (h.from(p), this._minColorDistance && this._distance.calculateNormalized(i, p) < this._minColorDistance) continue;\n let m, g, b, _;\n this._calculateErrorLikeGIMP ? (m = u.r - p.r, g = u.g - p.g, b = u.b - p.b, _ = u.a - p.a) : (m = i.r - p.r, g = i.g - p.g, b = i.b - p.b, _ = i.a - p.a);\n const y = 1 === s ? 0 : this._kernel.length - 1,\n w = 1 === s ? this._kernel.length : -1;\n for (let e = y; e !== w; e += s) {\n const r = this._kernel[e][1] * s,\n i = this._kernel[e][2];\n if (r + l >= 0 && r + l < n && i + t >= 0 && i + t < a) {\n const t = this._kernel[e][0],\n n = o[i][r + l];\n n[0] += m * t, n[1] += g * t, n[2] += b * t, n[3] += _ * t;\n }\n }\n }\n }\n yield {\n pointContainer: t,\n progress: 100\n };\n }\n _fillErrorLine(t, e) {\n t.length > e && (t.length = e);\n const r = t.length;\n for (let e = 0; e < r; e++) {\n const r = t[e];\n r[0] = r[1] = r[2] = r[3] = 0;\n }\n for (let i = r; i < e; i++) t[i] = [0, 0, 0, 0];\n }\n _setKernel(t) {\n switch (t) {\n case 0:\n this._kernel = [[7 / 16, 1, 0], [3 / 16, -1, 1], [5 / 16, 0, 1], [1 / 16, 1, 1]];\n break;\n case 1:\n this._kernel = [[3 / 8, 1, 0], [3 / 8, 0, 1], [2 / 8, 1, 1]];\n break;\n case 2:\n this._kernel = [[8 / 42, 1, 0], [4 / 42, 2, 0], [2 / 42, -2, 1], [4 / 42, -1, 1], [8 / 42, 0, 1], [4 / 42, 1, 1], [2 / 42, 2, 1], [1 / 42, -2, 2], [2 / 42, -1, 2], [4 / 42, 0, 2], [2 / 42, 1, 2], [1 / 42, 2, 2]];\n break;\n case 3:\n this._kernel = [[1 / 8, 1, 0], [1 / 8, 2, 0], [1 / 8, -1, 1], [1 / 8, 0, 1], [1 / 8, 1, 1], [1 / 8, 0, 2]];\n break;\n case 4:\n this._kernel = [[7 / 48, 1, 0], [5 / 48, 2, 0], [3 / 48, -2, 1], [5 / 48, -1, 1], [7 / 48, 0, 1], [5 / 48, 1, 1], [3 / 48, 2, 1], [1 / 48, -2, 2], [3 / 48, -1, 2], [5 / 48, 0, 2], [3 / 48, 1, 2], [1 / 48, 2, 2]];\n break;\n case 5:\n this._kernel = [[.25, 1, 0], [4 / 32, 2, 0], [2 / 32, -2, 1], [4 / 32, -1, 1], [.25, 0, 1], [4 / 32, 1, 1], [2 / 32, 2, 1]];\n break;\n case 6:\n this._kernel = [[5 / 32, 1, 0], [3 / 32, 2, 0], [2 / 32, -2, 1], [4 / 32, -1, 1], [5 / 32, 0, 1], [4 / 32, 1, 1], [2 / 32, 2, 1], [2 / 32, -1, 2], [3 / 32, 0, 2], [2 / 32, 1, 2]];\n break;\n case 7:\n this._kernel = [[.25, 1, 0], [3 / 16, 2, 0], [1 / 16, -2, 1], [2 / 16, -1, 1], [3 / 16, 0, 1], [2 / 16, 1, 1], [1 / 16, 2, 1]];\n break;\n case 8:\n this._kernel = [[.5, 1, 0], [1 / 4, -1, 1], [1 / 4, 0, 1]];\n break;\n default:\n throw new Error(`ErrorDiffusionArray: unknown kernel = ${t}`);\n }\n }\n };\n function* Ft(t, e, r) {\n const i = Math.max(t, e),\n n = {\n width: t,\n height: e,\n level: Math.floor(Math.log(i) / Math.log(2) + 1),\n callback: r,\n tracker: new gt(t * e, 99),\n index: 0,\n x: 0,\n y: 0\n };\n yield* jt(n, 1), Gt(n, 0);\n }\n function* jt(t, e) {\n if (!(t.level < 1)) {\n switch (t.tracker.shouldNotify(t.index) && (yield {\n progress: t.tracker.progress\n }), t.level--, e) {\n case 2:\n yield* jt(t, 1), Gt(t, 3), yield* jt(t, 2), Gt(t, 4), yield* jt(t, 2), Gt(t, 2), yield* jt(t, 4);\n break;\n case 3:\n yield* jt(t, 4), Gt(t, 2), yield* jt(t, 3), Gt(t, 1), yield* jt(t, 3), Gt(t, 3), yield* jt(t, 1);\n break;\n case 1:\n yield* jt(t, 2), Gt(t, 4), yield* jt(t, 1), Gt(t, 3), yield* jt(t, 1), Gt(t, 1), yield* jt(t, 3);\n break;\n case 4:\n yield* jt(t, 3), Gt(t, 1), yield* jt(t, 4), Gt(t, 2), yield* jt(t, 4), Gt(t, 4), yield* jt(t, 2);\n }\n t.level++;\n }\n }\n function Gt(t, e) {\n switch (t.x >= 0 && t.x < t.width && t.y >= 0 && t.y < t.height && (t.callback(t.x, t.y), t.index++), e) {\n case 2:\n t.x--;\n break;\n case 3:\n t.x++;\n break;\n case 1:\n t.y--;\n break;\n case 4:\n t.y++;\n }\n }\n var Ht = class extends Ut {\n constructor(t, e = 16, r = 1) {\n super(), f(this, \"_distance\"), f(this, \"_weights\"), f(this, \"_errorQueueSize\"), this._distance = t, this._errorQueueSize = e, this._weights = Ht._createWeights(r, e);\n }\n *quantize(t, e) {\n const r = t.getPointArray(),\n i = t.getWidth(),\n n = t.getHeight(),\n a = [];\n let o = 0;\n for (let t = 0; t < this._errorQueueSize; t++) a[t] = {\n r: 0,\n g: 0,\n b: 0,\n a: 0\n };\n yield* Ft(i, n, (t, n) => {\n const s = r[t + n * i];\n let {\n r: h,\n g: l,\n b: f,\n a: u\n } = s;\n for (let t = 0; t < this._errorQueueSize; t++) {\n const e = this._weights[t],\n r = a[(t + o) % this._errorQueueSize];\n h += r.r * e, l += r.g * e, f += r.b * e, u += r.a * e;\n }\n const c = ht.createByRGBA(S(h), S(l), S(f), S(u)),\n d = e.getNearestColor(this._distance, c);\n o = (o + 1) % this._errorQueueSize;\n const p = (o + this._errorQueueSize - 1) % this._errorQueueSize;\n a[p].r = s.r - d.r, a[p].g = s.g - d.g, a[p].b = s.b - d.b, a[p].a = s.a - d.a, s.from(d);\n }), yield {\n pointContainer: t,\n progress: 100\n };\n }\n static _createWeights(t, e) {\n const r = [],\n i = Math.exp(Math.log(e) / (e - 1));\n for (let n = 0, a = 1; n < e; n++) r[n] = (a + .5 | 0) / e * t, a *= i;\n return r;\n }\n },\n Wt = {};\n h(Wt, {\n ssim: () => Yt\n });\n var qt = .01,\n Zt = .03;\n function Yt(t, e) {\n if (t.getHeight() !== e.getHeight() || t.getWidth() !== e.getWidth()) throw new Error(\"Images have different sizes!\");\n const r = (255 * qt) ** 2,\n i = (255 * Zt) ** 2;\n let n = 0,\n a = 0;\n return function (t, e, r) {\n const i = t.getWidth(),\n n = t.getHeight();\n for (let a = 0; a < n; a += 8) for (let o = 0; o < i; o += 8) {\n const s = Math.min(8, i - o),\n h = Math.min(8, n - a),\n l = Vt(t, o, a, s, h),\n f = Vt(e, o, a, s, h);\n r(l, f, Xt(l), Xt(f));\n }\n }(t, e, (t, e, o, s) => {\n let h = 0,\n l = 0,\n f = 0;\n for (let r = 0; r < t.length; r++) l += (t[r] - o) ** 2, f += (e[r] - s) ** 2, h += (t[r] - o) * (e[r] - s);\n const u = t.length - 1;\n l /= u, f /= u, h /= u, a += (2 * o * s + r) * (2 * h + i) / ((o ** 2 + s ** 2 + r) * (l + f + i)), n++;\n }), a / n;\n }\n function Vt(t, e, r, i, n) {\n const a = t.getPointArray(),\n o = [];\n let s = 0;\n for (let h = r; h < r + n; h++) {\n const r = h * t.getWidth();\n for (let t = e; t < e + i; t++) {\n const e = a[r + t];\n o[s] = .2126 * e.r + .7152 * e.g + .0722 * e.b, s++;\n }\n }\n return o;\n }\n function Xt(t) {\n let e = 0;\n for (const r of t) e += r;\n return e / t.length;\n }\n var Jt = \"function\" == typeof setImmediate ? setImmediate : void 0 !== i && \"function\" == typeof (null == i ? void 0 : i.nextTick) ? t => i.nextTick(t) : t => setTimeout(t, 0);\n function Qt(t, {\n colorDistanceFormula: e,\n paletteQuantization: r,\n colors: i\n } = {}) {\n const n = ie(ee(e), r, i);\n return t.forEach(t => n.sample(t)), n.quantizeSync();\n }\n async function Kt(t, {\n colorDistanceFormula: e,\n paletteQuantization: r,\n colors: i,\n onProgress: n\n } = {}) {\n return new Promise((a, o) => {\n const s = ie(ee(e), r, i);\n let h;\n t.forEach(t => s.sample(t));\n const l = s.quantize(),\n f = () => {\n try {\n const t = l.next();\n t.done ? a(h) : (t.value.palette && (h = t.value.palette), n && n(t.value.progress), Jt(f));\n } catch (t) {\n o(t);\n }\n };\n Jt(f);\n });\n }\n function $t(t, e, {\n colorDistanceFormula: r,\n imageQuantization: i\n } = {}) {\n return re(ee(r), i).quantizeSync(t, e);\n }\n async function te(t, e, {\n colorDistanceFormula: r,\n imageQuantization: i,\n onProgress: n\n } = {}) {\n return new Promise((a, o) => {\n let s;\n const h = re(ee(r), i).quantize(t, e),\n l = () => {\n try {\n const t = h.next();\n t.done ? a(s) : (t.value.pointContainer && (s = t.value.pointContainer), n && n(t.value.progress), Jt(l));\n } catch (t) {\n o(t);\n }\n };\n Jt(l);\n });\n }\n function ee(t = \"euclidean-bt709\") {\n switch (t) {\n case \"cie94-graphic-arts\":\n return new Y();\n case \"cie94-textiles\":\n return new Z();\n case \"ciede2000\":\n return new X();\n case \"color-metric\":\n return new J();\n case \"euclidean\":\n return new K();\n case \"euclidean-bt709\":\n return new $();\n case \"euclidean-bt709-noalpha\":\n return new tt();\n case \"manhattan\":\n return new rt();\n case \"manhattan-bt709\":\n return new nt();\n case \"manhattan-nommyde\":\n return new it();\n case \"pngquant\":\n return new at();\n default:\n throw new Error(`Unknown colorDistanceFormula ${t}`);\n }\n }\n function re(t, e = \"floyd-steinberg\") {\n switch (e) {\n case \"nearest\":\n return new zt(t);\n case \"riemersma\":\n return new Ht(t);\n case \"floyd-steinberg\":\n return new Nt(t, 0);\n case \"false-floyd-steinberg\":\n return new Nt(t, 1);\n case \"stucki\":\n return new Nt(t, 2);\n case \"atkinson\":\n return new Nt(t, 3);\n case \"jarvis\":\n return new Nt(t, 4);\n case \"burkes\":\n return new Nt(t, 5);\n case \"sierra\":\n return new Nt(t, 6);\n case \"two-sierra\":\n return new Nt(t, 7);\n case \"sierra-lite\":\n return new Nt(t, 8);\n default:\n throw new Error(`Unknown imageQuantization ${e}`);\n }\n }\n function ie(t, e = \"wuquant\", r = 256) {\n switch (e) {\n case \"neuquant\":\n return new yt(t, r);\n case \"rgbquant\":\n return new Mt(t, r);\n case \"wuquant\":\n return new Lt(t, r);\n case \"neuquant-float\":\n return new xt(t, r);\n default:\n throw new Error(`Unknown paletteQuantization ${e}`);\n }\n }\n t.exports = l(u);\n }\n },\n __webpack_module_cache__ = {};\n function __webpack_require__(t) {\n var e = __webpack_module_cache__[t];\n if (void 0 !== e) return e.exports;\n var r = __webpack_module_cache__[t] = {\n exports: {}\n };\n return __webpack_modules__[t](r, r.exports, __webpack_require__), r.exports;\n }\n __webpack_require__.n = t => {\n var e = t && t.__esModule ? () => t.default : () => t;\n return __webpack_require__.d(e, {\n a: e\n }), e;\n }, __webpack_require__.d = (t, e) => {\n for (var r in e) __webpack_require__.o(e, r) && !__webpack_require__.o(t, r) && Object.defineProperty(t, r, {\n enumerable: !0,\n get: e[r]\n });\n }, __webpack_require__.g = function () {\n if (\"object\" == typeof globalThis) return globalThis;\n try {\n return this || new Function(\"return this\")();\n } catch (t) {\n if (\"object\" == typeof window) return window;\n }\n }(), __webpack_require__.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), __webpack_require__.r = t => {\n \"undefined\" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {\n value: \"Module\"\n }), Object.defineProperty(t, \"__esModule\", {\n value: !0\n });\n };\n var __webpack_exports__ = {};\n (() => {\n \"use strict\";\n\n var t = {};\n __webpack_require__.r(t), __webpack_require__.d(t, {\n AUTO: () => et,\n BLEND_ADD: () => ut,\n BLEND_DARKEN: () => pt,\n BLEND_DESTINATION_OVER: () => lt,\n BLEND_DIFFERENCE: () => bt,\n BLEND_EXCLUSION: () => _t,\n BLEND_HARDLIGHT: () => gt,\n BLEND_LIGHTEN: () => mt,\n BLEND_MULTIPLY: () => ft,\n BLEND_OVERLAY: () => dt,\n BLEND_SCREEN: () => ct,\n BLEND_SOURCE_OVER: () => ht,\n EDGE_CROP: () => vt,\n EDGE_EXTEND: () => yt,\n EDGE_WRAP: () => wt,\n HORIZONTAL_ALIGN_CENTER: () => it,\n HORIZONTAL_ALIGN_LEFT: () => rt,\n HORIZONTAL_ALIGN_RIGHT: () => nt,\n VERTICAL_ALIGN_BOTTOM: () => st,\n VERTICAL_ALIGN_MIDDLE: () => ot,\n VERTICAL_ALIGN_TOP: () => at\n });\n var e = {};\n __webpack_require__.r(e), __webpack_require__.d(e, {\n add: () => St,\n darken: () => It,\n difference: () => Rt,\n dstOver: () => Et,\n exclusion: () => Pt,\n hardLight: () => Tt,\n lighten: () => Bt,\n multiply: () => kt,\n overlay: () => At,\n screen: () => Mt,\n srcOver: () => xt\n });\n var r = __webpack_require__(5546),\n i = __webpack_require__.n(r),\n n = __webpack_require__(1023),\n a = __webpack_require__.n(n),\n o = __webpack_require__(2699),\n s = __webpack_require__.n(o);\n function h(t) {\n if (void 0 === t) return !1;\n if (\"function\" != typeof t) throw new TypeError(\"Callback must be a function\");\n return !0;\n }\n function l(t, e) {\n if (\"string\" == typeof t && (t = new Error(t)), \"function\" == typeof e) return e.call(this, t);\n throw t;\n }\n function f(t, e, r, i, n, a) {\n e = Math.round(e), r = Math.round(r), i = Math.round(i), n = Math.round(n);\n for (let o = r; o < r + n; o++) for (let r = e; r < e + i; r++) {\n const e = t.bitmap.width * o + r << 2;\n a.call(t, r, o, e);\n }\n return t;\n }\n var u = __webpack_require__(236),\n c = __webpack_require__.n(u),\n d = __webpack_require__(1294),\n p = __webpack_require__.n(d);\n function m(t) {\n return m = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (t) {\n return typeof t;\n } : function (t) {\n return t && \"function\" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? \"symbol\" : typeof t;\n }, m(t);\n }\n var g = /^\\s+/,\n b = /\\s+$/;\n function _(t, e) {\n if (e = e || {}, (t = t || \"\") instanceof _) return t;\n if (!(this instanceof _)) return new _(t, e);\n var r = function (t) {\n var e,\n r,\n i,\n n = {\n r: 0,\n g: 0,\n b: 0\n },\n a = 1,\n o = null,\n s = null,\n h = null,\n l = !1,\n f = !1;\n return \"string\" == typeof t && (t = function (t) {\n t = t.replace(g, \"\").replace(b, \"\").toLowerCase();\n var e,\n r = !1;\n if (C[t]) t = C[t], r = !0;else if (\"transparent\" == t) return {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n format: \"name\"\n };\n return (e = V.rgb.exec(t)) ? {\n r: e[1],\n g: e[2],\n b: e[3]\n } : (e = V.rgba.exec(t)) ? {\n r: e[1],\n g: e[2],\n b: e[3],\n a: e[4]\n } : (e = V.hsl.exec(t)) ? {\n h: e[1],\n s: e[2],\n l: e[3]\n } : (e = V.hsla.exec(t)) ? {\n h: e[1],\n s: e[2],\n l: e[3],\n a: e[4]\n } : (e = V.hsv.exec(t)) ? {\n h: e[1],\n s: e[2],\n v: e[3]\n } : (e = V.hsva.exec(t)) ? {\n h: e[1],\n s: e[2],\n v: e[3],\n a: e[4]\n } : (e = V.hex8.exec(t)) ? {\n r: F(e[1]),\n g: F(e[2]),\n b: F(e[3]),\n a: W(e[4]),\n format: r ? \"name\" : \"hex8\"\n } : (e = V.hex6.exec(t)) ? {\n r: F(e[1]),\n g: F(e[2]),\n b: F(e[3]),\n format: r ? \"name\" : \"hex\"\n } : (e = V.hex4.exec(t)) ? {\n r: F(e[1] + \"\" + e[1]),\n g: F(e[2] + \"\" + e[2]),\n b: F(e[3] + \"\" + e[3]),\n a: W(e[4] + \"\" + e[4]),\n format: r ? \"name\" : \"hex8\"\n } : !!(e = V.hex3.exec(t)) && {\n r: F(e[1] + \"\" + e[1]),\n g: F(e[2] + \"\" + e[2]),\n b: F(e[3] + \"\" + e[3]),\n format: r ? \"name\" : \"hex\"\n };\n }(t)), \"object\" == m(t) && (X(t.r) && X(t.g) && X(t.b) ? (e = t.r, r = t.g, i = t.b, n = {\n r: 255 * D(e, 255),\n g: 255 * D(r, 255),\n b: 255 * D(i, 255)\n }, l = !0, f = \"%\" === String(t.r).substr(-1) ? \"prgb\" : \"rgb\") : X(t.h) && X(t.s) && X(t.v) ? (o = G(t.s), s = G(t.v), n = function (t, e, r) {\n t = 6 * D(t, 360), e = D(e, 100), r = D(r, 100);\n var i = Math.floor(t),\n n = t - i,\n a = r * (1 - e),\n o = r * (1 - n * e),\n s = r * (1 - (1 - n) * e),\n h = i % 6;\n return {\n r: 255 * [r, o, a, a, s, r][h],\n g: 255 * [s, r, r, o, a, a][h],\n b: 255 * [a, a, s, r, r, o][h]\n };\n }(t.h, o, s), l = !0, f = \"hsv\") : X(t.h) && X(t.s) && X(t.l) && (o = G(t.s), h = G(t.l), n = function (t, e, r) {\n var i, n, a;\n function o(t, e, r) {\n return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + 6 * (e - t) * r : r < .5 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t;\n }\n if (t = D(t, 360), e = D(e, 100), r = D(r, 100), 0 === e) i = n = a = r;else {\n var s = r < .5 ? r * (1 + e) : r + e - r * e,\n h = 2 * r - s;\n i = o(h, s, t + 1 / 3), n = o(h, s, t), a = o(h, s, t - 1 / 3);\n }\n return {\n r: 255 * i,\n g: 255 * n,\n b: 255 * a\n };\n }(t.h, o, h), l = !0, f = \"hsl\"), t.hasOwnProperty(\"a\") && (a = t.a)), a = z(a), {\n ok: l,\n format: t.format || f,\n r: Math.min(255, Math.max(n.r, 0)),\n g: Math.min(255, Math.max(n.g, 0)),\n b: Math.min(255, Math.max(n.b, 0)),\n a\n };\n }(t);\n this._originalInput = t, this._r = r.r, this._g = r.g, this._b = r.b, this._a = r.a, this._roundA = Math.round(100 * this._a) / 100, this._format = e.format || r.format, this._gradientType = e.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = r.ok;\n }\n function y(t, e, r) {\n t = D(t, 255), e = D(e, 255), r = D(r, 255);\n var i,\n n,\n a = Math.max(t, e, r),\n o = Math.min(t, e, r),\n s = (a + o) / 2;\n if (a == o) i = n = 0;else {\n var h = a - o;\n switch (n = s > .5 ? h / (2 - a - o) : h / (a + o), a) {\n case t:\n i = (e - r) / h + (e < r ? 6 : 0);\n break;\n case e:\n i = (r - t) / h + 2;\n break;\n case r:\n i = (t - e) / h + 4;\n }\n i /= 6;\n }\n return {\n h: i,\n s: n,\n l: s\n };\n }\n function w(t, e, r) {\n t = D(t, 255), e = D(e, 255), r = D(r, 255);\n var i,\n n,\n a = Math.max(t, e, r),\n o = Math.min(t, e, r),\n s = a,\n h = a - o;\n if (n = 0 === a ? 0 : h / a, a == o) i = 0;else {\n switch (a) {\n case t:\n i = (e - r) / h + (e < r ? 6 : 0);\n break;\n case e:\n i = (r - t) / h + 2;\n break;\n case r:\n i = (t - e) / h + 4;\n }\n i /= 6;\n }\n return {\n h: i,\n s: n,\n v: s\n };\n }\n function v(t, e, r, i) {\n var n = [j(Math.round(t).toString(16)), j(Math.round(e).toString(16)), j(Math.round(r).toString(16))];\n return i && n[0].charAt(0) == n[0].charAt(1) && n[1].charAt(0) == n[1].charAt(1) && n[2].charAt(0) == n[2].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join(\"\");\n }\n function x(t, e, r, i) {\n return [j(H(i)), j(Math.round(t).toString(16)), j(Math.round(e).toString(16)), j(Math.round(r).toString(16))].join(\"\");\n }\n function E(t, e) {\n e = 0 === e ? 0 : e || 10;\n var r = _(t).toHsl();\n return r.s -= e / 100, r.s = N(r.s), _(r);\n }\n function k(t, e) {\n e = 0 === e ? 0 : e || 10;\n var r = _(t).toHsl();\n return r.s += e / 100, r.s = N(r.s), _(r);\n }\n function S(t) {\n return _(t).desaturate(100);\n }\n function M(t, e) {\n e = 0 === e ? 0 : e || 10;\n var r = _(t).toHsl();\n return r.l += e / 100, r.l = N(r.l), _(r);\n }\n function A(t, e) {\n e = 0 === e ? 0 : e || 10;\n var r = _(t).toRgb();\n return r.r = Math.max(0, Math.min(255, r.r - Math.round(-e / 100 * 255))), r.g = Math.max(0, Math.min(255, r.g - Math.round(-e / 100 * 255))), r.b = Math.max(0, Math.min(255, r.b - Math.round(-e / 100 * 255))), _(r);\n }\n function I(t, e) {\n e = 0 === e ? 0 : e || 10;\n var r = _(t).toHsl();\n return r.l -= e / 100, r.l = N(r.l), _(r);\n }\n function B(t, e) {\n var r = _(t).toHsl(),\n i = (r.h + e) % 360;\n return r.h = i < 0 ? 360 + i : i, _(r);\n }\n function T(t) {\n var e = _(t).toHsl();\n return e.h = (e.h + 180) % 360, _(e);\n }\n function R(t, e) {\n if (isNaN(e) || e <= 0) throw new Error(\"Argument to polyad must be a positive number\");\n for (var r = _(t).toHsl(), i = [_(t)], n = 360 / e, a = 1; a < e; a++) i.push(_({\n h: (r.h + a * n) % 360,\n s: r.s,\n l: r.l\n }));\n return i;\n }\n function P(t) {\n var e = _(t).toHsl(),\n r = e.h;\n return [_(t), _({\n h: (r + 72) % 360,\n s: e.s,\n l: e.l\n }), _({\n h: (r + 216) % 360,\n s: e.s,\n l: e.l\n })];\n }\n function O(t, e, r) {\n e = e || 6, r = r || 30;\n var i = _(t).toHsl(),\n n = 360 / r,\n a = [_(t)];\n for (i.h = (i.h - (n * e >> 1) + 720) % 360; --e;) i.h = (i.h + n) % 360, a.push(_(i));\n return a;\n }\n function L(t, e) {\n e = e || 6;\n for (var r = _(t).toHsv(), i = r.h, n = r.s, a = r.v, o = [], s = 1 / e; e--;) o.push(_({\n h: i,\n s: n,\n v: a\n })), a = (a + s) % 1;\n return o;\n }\n _.prototype = {\n isDark: function () {\n return this.getBrightness() < 128;\n },\n isLight: function () {\n return !this.isDark();\n },\n isValid: function () {\n return this._ok;\n },\n getOriginalInput: function () {\n return this._originalInput;\n },\n getFormat: function () {\n return this._format;\n },\n getAlpha: function () {\n return this._a;\n },\n getBrightness: function () {\n var t = this.toRgb();\n return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3;\n },\n getLuminance: function () {\n var t,\n e,\n r,\n i = this.toRgb();\n return t = i.r / 255, e = i.g / 255, r = i.b / 255, .2126 * (t <= .03928 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4)) + .7152 * (e <= .03928 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4)) + .0722 * (r <= .03928 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4));\n },\n setAlpha: function (t) {\n return this._a = z(t), this._roundA = Math.round(100 * this._a) / 100, this;\n },\n toHsv: function () {\n var t = w(this._r, this._g, this._b);\n return {\n h: 360 * t.h,\n s: t.s,\n v: t.v,\n a: this._a\n };\n },\n toHsvString: function () {\n var t = w(this._r, this._g, this._b),\n e = Math.round(360 * t.h),\n r = Math.round(100 * t.s),\n i = Math.round(100 * t.v);\n return 1 == this._a ? \"hsv(\" + e + \", \" + r + \"%, \" + i + \"%)\" : \"hsva(\" + e + \", \" + r + \"%, \" + i + \"%, \" + this._roundA + \")\";\n },\n toHsl: function () {\n var t = y(this._r, this._g, this._b);\n return {\n h: 360 * t.h,\n s: t.s,\n l: t.l,\n a: this._a\n };\n },\n toHslString: function () {\n var t = y(this._r, this._g, this._b),\n e = Math.round(360 * t.h),\n r = Math.round(100 * t.s),\n i = Math.round(100 * t.l);\n return 1 == this._a ? \"hsl(\" + e + \", \" + r + \"%, \" + i + \"%)\" : \"hsla(\" + e + \", \" + r + \"%, \" + i + \"%, \" + this._roundA + \")\";\n },\n toHex: function (t) {\n return v(this._r, this._g, this._b, t);\n },\n toHexString: function (t) {\n return \"#\" + this.toHex(t);\n },\n toHex8: function (t) {\n return function (t, e, r, i, n) {\n var a = [j(Math.round(t).toString(16)), j(Math.round(e).toString(16)), j(Math.round(r).toString(16)), j(H(i))];\n return n && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join(\"\");\n }(this._r, this._g, this._b, this._a, t);\n },\n toHex8String: function (t) {\n return \"#\" + this.toHex8(t);\n },\n toRgb: function () {\n return {\n r: Math.round(this._r),\n g: Math.round(this._g),\n b: Math.round(this._b),\n a: this._a\n };\n },\n toRgbString: function () {\n return 1 == this._a ? \"rgb(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \")\" : \"rgba(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function () {\n return {\n r: Math.round(100 * D(this._r, 255)) + \"%\",\n g: Math.round(100 * D(this._g, 255)) + \"%\",\n b: Math.round(100 * D(this._b, 255)) + \"%\",\n a: this._a\n };\n },\n toPercentageRgbString: function () {\n return 1 == this._a ? \"rgb(\" + Math.round(100 * D(this._r, 255)) + \"%, \" + Math.round(100 * D(this._g, 255)) + \"%, \" + Math.round(100 * D(this._b, 255)) + \"%)\" : \"rgba(\" + Math.round(100 * D(this._r, 255)) + \"%, \" + Math.round(100 * D(this._g, 255)) + \"%, \" + Math.round(100 * D(this._b, 255)) + \"%, \" + this._roundA + \")\";\n },\n toName: function () {\n return 0 === this._a ? \"transparent\" : !(this._a < 1) && (U[v(this._r, this._g, this._b, !0)] || !1);\n },\n toFilter: function (t) {\n var e = \"#\" + x(this._r, this._g, this._b, this._a),\n r = e,\n i = this._gradientType ? \"GradientType = 1, \" : \"\";\n if (t) {\n var n = _(t);\n r = \"#\" + x(n._r, n._g, n._b, n._a);\n }\n return \"progid:DXImageTransform.Microsoft.gradient(\" + i + \"startColorstr=\" + e + \",endColorstr=\" + r + \")\";\n },\n toString: function (t) {\n var e = !!t;\n t = t || this._format;\n var r = !1,\n i = this._a < 1 && this._a >= 0;\n return e || !i || \"hex\" !== t && \"hex6\" !== t && \"hex3\" !== t && \"hex4\" !== t && \"hex8\" !== t && \"name\" !== t ? (\"rgb\" === t && (r = this.toRgbString()), \"prgb\" === t && (r = this.toPercentageRgbString()), \"hex\" !== t && \"hex6\" !== t || (r = this.toHexString()), \"hex3\" === t && (r = this.toHexString(!0)), \"hex4\" === t && (r = this.toHex8String(!0)), \"hex8\" === t && (r = this.toHex8String()), \"name\" === t && (r = this.toName()), \"hsl\" === t && (r = this.toHslString()), \"hsv\" === t && (r = this.toHsvString()), r || this.toHexString()) : \"name\" === t && 0 === this._a ? this.toName() : this.toRgbString();\n },\n clone: function () {\n return _(this.toString());\n },\n _applyModification: function (t, e) {\n var r = t.apply(null, [this].concat([].slice.call(e)));\n return this._r = r._r, this._g = r._g, this._b = r._b, this.setAlpha(r._a), this;\n },\n lighten: function () {\n return this._applyModification(M, arguments);\n },\n brighten: function () {\n return this._applyModification(A, arguments);\n },\n darken: function () {\n return this._applyModification(I, arguments);\n },\n desaturate: function () {\n return this._applyModification(E, arguments);\n },\n saturate: function () {\n return this._applyModification(k, arguments);\n },\n greyscale: function () {\n return this._applyModification(S, arguments);\n },\n spin: function () {\n return this._applyModification(B, arguments);\n },\n _applyCombination: function (t, e) {\n return t.apply(null, [this].concat([].slice.call(e)));\n },\n analogous: function () {\n return this._applyCombination(O, arguments);\n },\n complement: function () {\n return this._applyCombination(T, arguments);\n },\n monochromatic: function () {\n return this._applyCombination(L, arguments);\n },\n splitcomplement: function () {\n return this._applyCombination(P, arguments);\n },\n triad: function () {\n return this._applyCombination(R, [3]);\n },\n tetrad: function () {\n return this._applyCombination(R, [4]);\n }\n }, _.fromRatio = function (t, e) {\n if (\"object\" == m(t)) {\n var r = {};\n for (var i in t) t.hasOwnProperty(i) && (r[i] = \"a\" === i ? t[i] : G(t[i]));\n t = r;\n }\n return _(t, e);\n }, _.equals = function (t, e) {\n return !(!t || !e) && _(t).toRgbString() == _(e).toRgbString();\n }, _.random = function () {\n return _.fromRatio({\n r: Math.random(),\n g: Math.random(),\n b: Math.random()\n });\n }, _.mix = function (t, e, r) {\n r = 0 === r ? 0 : r || 50;\n var i = _(t).toRgb(),\n n = _(e).toRgb(),\n a = r / 100;\n return _({\n r: (n.r - i.r) * a + i.r,\n g: (n.g - i.g) * a + i.g,\n b: (n.b - i.b) * a + i.b,\n a: (n.a - i.a) * a + i.a\n });\n }, _.readability = function (t, e) {\n var r = _(t),\n i = _(e);\n return (Math.max(r.getLuminance(), i.getLuminance()) + .05) / (Math.min(r.getLuminance(), i.getLuminance()) + .05);\n }, _.isReadable = function (t, e, r) {\n var i,\n n,\n a,\n o,\n s,\n h = _.readability(t, e);\n switch (n = !1, (a = r, \"AA\" !== (o = ((a = a || {\n level: \"AA\",\n size: \"small\"\n }).level || \"AA\").toUpperCase()) && \"AAA\" !== o && (o = \"AA\"), \"small\" !== (s = (a.size || \"small\").toLowerCase()) && \"large\" !== s && (s = \"small\"), i = {\n level: o,\n size: s\n }).level + i.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n n = h >= 4.5;\n break;\n case \"AAlarge\":\n n = h >= 3;\n break;\n case \"AAAsmall\":\n n = h >= 7;\n }\n return n;\n }, _.mostReadable = function (t, e, r) {\n var i,\n n,\n a,\n o,\n s = null,\n h = 0;\n n = (r = r || {}).includeFallbackColors, a = r.level, o = r.size;\n for (var l = 0; l < e.length; l++) (i = _.readability(t, e[l])) > h && (h = i, s = _(e[l]));\n return _.isReadable(t, s, {\n level: a,\n size: o\n }) || !n ? s : (r.includeFallbackColors = !1, _.mostReadable(t, [\"#fff\", \"#000\"], r));\n };\n var C = _.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n },\n U = _.hexNames = function (t) {\n var e = {};\n for (var r in t) t.hasOwnProperty(r) && (e[t[r]] = r);\n return e;\n }(C);\n function z(t) {\n return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n }\n function D(t, e) {\n (function (t) {\n return \"string\" == typeof t && -1 != t.indexOf(\".\") && 1 === parseFloat(t);\n })(t) && (t = \"100%\");\n var r = function (t) {\n return \"string\" == typeof t && -1 != t.indexOf(\"%\");\n }(t);\n return t = Math.min(e, Math.max(0, parseFloat(t))), r && (t = parseInt(t * e, 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : t % e / parseFloat(e);\n }\n function N(t) {\n return Math.min(1, Math.max(0, t));\n }\n function F(t) {\n return parseInt(t, 16);\n }\n function j(t) {\n return 1 == t.length ? \"0\" + t : \"\" + t;\n }\n function G(t) {\n return t <= 1 && (t = 100 * t + \"%\"), t;\n }\n function H(t) {\n return Math.round(255 * parseFloat(t)).toString(16);\n }\n function W(t) {\n return F(t) / 255;\n }\n var q,\n Z,\n Y,\n V = (Z = \"[\\\\s|\\\\(]+(\" + (q = \"(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)\") + \")[,|\\\\s]+(\" + q + \")[,|\\\\s]+(\" + q + \")\\\\s*\\\\)?\", Y = \"[\\\\s|\\\\(]+(\" + q + \")[,|\\\\s]+(\" + q + \")[,|\\\\s]+(\" + q + \")[,|\\\\s]+(\" + q + \")\\\\s*\\\\)?\", {\n CSS_UNIT: new RegExp(q),\n rgb: new RegExp(\"rgb\" + Z),\n rgba: new RegExp(\"rgba\" + Y),\n hsl: new RegExp(\"hsl\" + Z),\n hsla: new RegExp(\"hsla\" + Y),\n hsv: new RegExp(\"hsv\" + Z),\n hsva: new RegExp(\"hsva\" + Y),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n });\n function X(t) {\n return !!V.CSS_UNIT.exec(t);\n }\n function J(t, e) {\n this.size = this.size || t, this.smallerSize = this.smallerSize || e, function (t) {\n for (let e = 1; e < t; e++) K[e] = 1;\n K[0] = 1 / Math.sqrt(2);\n }(this.size);\n }\n function Q(t) {\n const e = 255 & t,\n r = 255 & (t >>>= 8),\n i = 255 & (t >>>= 8);\n return {\n r: 255 & (t >>>= 8),\n g: i,\n b: r,\n a: e\n };\n }\n J.prototype.size = 32, J.prototype.smallerSize = 8, J.prototype.distance = function (t, e) {\n let r = 0;\n for (let i = 0; i < t.length; i++) t[i] !== e[i] && r++;\n return r / t.length;\n }, J.prototype.getHash = function (t) {\n (t = t.clone().resize(this.size, this.size)).grayscale();\n const e = [];\n for (let r = 0; r < t.bitmap.width; r++) {\n e[r] = [];\n for (let i = 0; i < t.bitmap.height; i++) e[r][i] = Q(t.getPixelColor(r, i)).b;\n }\n const r = function (t, e) {\n const r = e,\n i = [];\n for (let e = 0; e < r; e++) {\n i[e] = [];\n for (let n = 0; n < r; n++) {\n let a = 0;\n for (let i = 0; i < r; i++) for (let o = 0; o < r; o++) a += Math.cos((2 * i + 1) / (2 * r) * e * Math.PI) * Math.cos((2 * o + 1) / (2 * r) * n * Math.PI) * t[i][o];\n a *= K[e] * K[n] / 4, i[e][n] = a;\n }\n }\n return i;\n }(e, this.size);\n let i = 0;\n for (let t = 0; t < this.smallerSize; t++) for (let e = 0; e < this.smallerSize; e++) i += r[t][e];\n const n = i / (this.smallerSize * this.smallerSize);\n let a = \"\";\n for (let t = 0; t < this.smallerSize; t++) for (let e = 0; e < this.smallerSize; e++) a += r[t][e] > n ? \"1\" : \"0\";\n return a;\n };\n const K = [],\n $ = J;\n __webpack_require__(9307);\n const tt = (t, e) => {\n let {\n url: r,\n ...i\n } = t;\n fetch(r, i).then(t => {\n if (t.ok) return t.arrayBuffer().catch(t => {\n throw new Error(`Response is not a buffer for url ${r}. Error: ${t.message}`);\n });\n throw new Error(`HTTP Status ${t.status} for url ${r}`);\n }).then(t => e(null, t)).catch(t => e(t));\n },\n et = -1,\n rt = 1,\n it = 2,\n nt = 4,\n at = 8,\n ot = 16,\n st = 32,\n ht = \"srcOver\",\n lt = \"dstOver\",\n ft = \"multiply\",\n ut = \"add\",\n ct = \"screen\",\n dt = \"overlay\",\n pt = \"darken\",\n mt = \"lighten\",\n gt = \"hardLight\",\n bt = \"difference\",\n _t = \"exclusion\",\n yt = 1,\n wt = 2,\n vt = 3;\n function xt(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a;\n return {\n r: (t.r * t.a + e.r * e.a * (1 - t.a)) / i,\n g: (t.g * t.a + e.g * e.a * (1 - t.a)) / i,\n b: (t.b * t.a + e.b * e.a * (1 - t.a)) / i,\n a: i\n };\n }\n function Et(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a;\n return {\n r: (e.r * e.a + t.r * t.a * (1 - e.a)) / i,\n g: (e.g * e.a + t.g * t.a * (1 - e.a)) / i,\n b: (e.b * e.a + t.b * t.a * (1 - e.a)) / i,\n a: i\n };\n }\n function kt(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a,\n s = e.r * e.a,\n h = e.g * e.a,\n l = e.b * e.a;\n return {\n r: (n * s + n * (1 - e.a) + s * (1 - t.a)) / i,\n g: (a * h + a * (1 - e.a) + h * (1 - t.a)) / i,\n b: (o * l + o * (1 - e.a) + l * (1 - t.a)) / i,\n a: i\n };\n }\n function St(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a;\n return {\n r: (n + e.r * e.a) / i,\n g: (a + e.g * e.a) / i,\n b: (o + e.b * e.a) / i,\n a: i\n };\n }\n function Mt(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a,\n s = e.r * e.a,\n h = e.g * e.a,\n l = e.b * e.a;\n return {\n r: (n * e.a + s * t.a - n * s + n * (1 - e.a) + s * (1 - t.a)) / i,\n g: (a * e.a + h * t.a - a * h + a * (1 - e.a) + h * (1 - t.a)) / i,\n b: (o * e.a + l * t.a - o * l + o * (1 - e.a) + l * (1 - t.a)) / i,\n a: i\n };\n }\n function At(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a,\n s = e.r * e.a,\n h = e.g * e.a,\n l = e.b * e.a;\n return {\n r: (2 * s <= e.a ? 2 * n * s + n * (1 - e.a) + s * (1 - t.a) : n * (1 + e.a) + s * (1 + t.a) - 2 * s * n - e.a * t.a) / i,\n g: (2 * h <= e.a ? 2 * a * h + a * (1 - e.a) + h * (1 - t.a) : a * (1 + e.a) + h * (1 + t.a) - 2 * h * a - e.a * t.a) / i,\n b: (2 * l <= e.a ? 2 * o * l + o * (1 - e.a) + l * (1 - t.a) : o * (1 + e.a) + l * (1 + t.a) - 2 * l * o - e.a * t.a) / i,\n a: i\n };\n }\n function It(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a,\n s = e.r * e.a,\n h = e.g * e.a,\n l = e.b * e.a;\n return {\n r: (Math.min(n * e.a, s * t.a) + n * (1 - e.a) + s * (1 - t.a)) / i,\n g: (Math.min(a * e.a, h * t.a) + a * (1 - e.a) + h * (1 - t.a)) / i,\n b: (Math.min(o * e.a, l * t.a) + o * (1 - e.a) + l * (1 - t.a)) / i,\n a: i\n };\n }\n function Bt(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a,\n s = e.r * e.a,\n h = e.g * e.a,\n l = e.b * e.a;\n return {\n r: (Math.max(n * e.a, s * t.a) + n * (1 - e.a) + s * (1 - t.a)) / i,\n g: (Math.max(a * e.a, h * t.a) + a * (1 - e.a) + h * (1 - t.a)) / i,\n b: (Math.max(o * e.a, l * t.a) + o * (1 - e.a) + l * (1 - t.a)) / i,\n a: i\n };\n }\n function Tt(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a,\n s = e.r * e.a,\n h = e.g * e.a,\n l = e.b * e.a;\n return {\n r: (2 * n <= t.a ? 2 * n * s + n * (1 - e.a) + s * (1 - t.a) : n * (1 + e.a) + s * (1 + t.a) - 2 * s * n - e.a * t.a) / i,\n g: (2 * a <= t.a ? 2 * a * h + a * (1 - e.a) + h * (1 - t.a) : a * (1 + e.a) + h * (1 + t.a) - 2 * h * a - e.a * t.a) / i,\n b: (2 * o <= t.a ? 2 * o * l + o * (1 - e.a) + l * (1 - t.a) : o * (1 + e.a) + l * (1 + t.a) - 2 * l * o - e.a * t.a) / i,\n a: i\n };\n }\n function Rt(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a,\n s = e.r * e.a,\n h = e.g * e.a,\n l = e.b * e.a;\n return {\n r: (n + s - 2 * Math.min(n * e.a, s * t.a)) / i,\n g: (a + h - 2 * Math.min(a * e.a, h * t.a)) / i,\n b: (o + l - 2 * Math.min(o * e.a, l * t.a)) / i,\n a: i\n };\n }\n function Pt(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n t.a *= r;\n const i = e.a + t.a - e.a * t.a,\n n = t.r * t.a,\n a = t.g * t.a,\n o = t.b * t.a,\n s = e.r * e.a,\n h = e.g * e.a,\n l = e.b * e.a;\n return {\n r: (n * e.a + s * t.a - 2 * n * s + n * (1 - e.a) + s * (1 - t.a)) / i,\n g: (a * e.a + h * t.a - 2 * a * h + a * (1 - e.a) + h * (1 - t.a)) / i,\n b: (o * e.a + l * t.a - 2 * o * l + o * (1 - e.a) + l * (1 - t.a)) / i,\n a: i\n };\n }\n const Ot = function (t, e) {\n for (var r = arguments.length, i = new Array(r > 2 ? r - 2 : 0), n = 2; n < r; n++) i[n - 2] = arguments[n];\n return new Promise((r, n) => {\n i.push((t, e) => {\n t && n(t), r(e);\n }), t.bind(e)(...i);\n });\n },\n Lt = {},\n Ct = (t, e) => {\n Lt[t] = e;\n },\n Ut = t => {\n const e = t.split(\"/\").slice(-1);\n var r;\n return (r = e[e.length - 1].split(\".\").pop(), Object.entries(Lt).find(t => t[1].includes(r)) || [])[0];\n };\n var zt = __webpack_require__(5025),\n Dt = __webpack_require__.n(zt),\n Nt = __webpack_require__(6551),\n Ft = __webpack_require__.n(Nt),\n jt = __webpack_require__(8834).lW;\n function Gt(t) {\n return t._exif && t._exif.tags && t._exif.tags.Orientation || 1;\n }\n async function Ht(t, e, r) {\n const i = await async function (t, e) {\n const r = await Dt().fromBuffer(t);\n return r ? r.mime : e ? Ut(e) : null;\n }(t, e);\n if (\"string\" != typeof i) return r(new Error(\"Could not find MIME for Buffer <\" + e + \">\"));\n this._originalMime = i.toLowerCase();\n try {\n const e = this.getMIME();\n if (!this.constructor.decoders[e]) return l.call(this, \"Unsupported MIME type: \" + e, r);\n this.bitmap = this.constructor.decoders[e](t);\n } catch (t) {\n return r.call(this, t, this);\n }\n try {\n this._exif = Ft().create(t).parse(), function (t) {\n if (Gt(t) < 2) return;\n const e = function (t) {\n const e = t.getWidth(),\n r = t.getHeight();\n switch (Gt(t)) {\n case 1:\n default:\n return null;\n case 2:\n return function (t, r) {\n return [e - t - 1, r];\n };\n case 3:\n return function (t, i) {\n return [e - t - 1, r - i - 1];\n };\n case 4:\n return function (t, e) {\n return [t, r - e - 1];\n };\n case 5:\n return function (t, e) {\n return [e, t];\n };\n case 6:\n return function (t, e) {\n return [e, r - t - 1];\n };\n case 7:\n return function (t, i) {\n return [e - i - 1, r - t - 1];\n };\n case 8:\n return function (t, r) {\n return [e - r - 1, t];\n };\n }\n }(t),\n r = Gt(t) > 4;\n !function (t, e, r, i) {\n const n = t.bitmap.data,\n a = t.bitmap.width,\n o = jt.alloc(n.length);\n for (let t = 0; t < e; t++) for (let s = 0; s < r; s++) {\n const [r, h] = i(t, s),\n l = e * s + t << 2,\n f = a * h + r << 2,\n u = n.readUInt32BE(f);\n o.writeUInt32BE(u, l);\n }\n t.bitmap.data = o, t.bitmap.width = e, t.bitmap.height = r;\n }(t, r ? t.bitmap.height : t.bitmap.width, r ? t.bitmap.width : t.bitmap.height, e);\n }(this);\n } catch (t) {}\n return r.call(this, null, this), this;\n }\n function Wt(t, e) {\n if (t === et && (t = this.getMIME()), \"string\" != typeof t) return l.call(this, \"mime must be a string\", e);\n if (\"function\" != typeof e) return l.call(this, \"cb must be a function\", e);\n if (t = t.toLowerCase(), this._rgba && this.constructor.hasAlpha[t] ? this.bitmap.data = jt.from(this.bitmap.data) : this.bitmap.data = function (t, e) {\n return new t(e.bitmap.width, e.bitmap.height, e._background).composite(e, 0, 0).bitmap;\n }(this.constructor, this).data, !this.constructor.encoders[t]) return l.call(this, \"Unsupported MIME type: \" + t, e);\n {\n const r = this.constructor.encoders[t](this);\n r instanceof Promise ? r.then(t => {\n e.call(this, null, t);\n }) : e.call(this, null, r);\n }\n return this;\n }\n function qt(t) {\n return Ot(Wt, this, t);\n }\n var Zt = __webpack_require__(8834).lW;\n function Yt(t, e, r) {\n return (e = function (t) {\n var e = function (t, e) {\n if (\"object\" != typeof t || null === t) return t;\n var r = t[Symbol.toPrimitive];\n if (void 0 !== r) {\n var i = r.call(t, \"string\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return String(t);\n }(t);\n return \"symbol\" == typeof e ? e : String(e);\n }(e)) in t ? Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : t[e] = r, t;\n }\n const Vt = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_\",\n Xt = [NaN, NaN];\n for (let t = 2; t < 65; t++) {\n const e = c()(c().BIN, Vt.slice(0, t))(new Array(65).join(\"1\"));\n Xt.push(e.length);\n }\n function Jt() {}\n function Qt(t) {\n return Object.prototype.toString.call(t).toLowerCase().indexOf(\"arraybuffer\") > -1;\n }\n function Kt(t) {\n const e = Zt.alloc(t.byteLength),\n r = new Uint8Array(t);\n for (let t = 0; t < e.length; ++t) e[t] = r[t];\n return e;\n }\n function $t(t, e) {\n tt(t, (r, i) => r ? e(r) : \"object\" == typeof i && Zt.isBuffer(i) ? e(null, i) : \"object\" == typeof i && Qt(i) ? e(null, Kt(i)) : new Error(`Could not load Buffer from <${t.url}>`));\n }\n const te = {\n data: null,\n width: null,\n height: null\n };\n class ee extends s() {\n constructor() {\n for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r];\n super(), Yt(this, \"bitmap\", te), Yt(this, \"_background\", 0), Yt(this, \"_originalMime\", ee.MIME_PNG), Yt(this, \"_exif\", null), Yt(this, \"_rgba\", !0), Yt(this, \"writeAsync\", t => Ot(this.write, this, t)), Yt(this, \"getBase64Async\", t => Ot(this.getBase64, this, t)), Yt(this, \"getBuffer\", Wt), Yt(this, \"getBufferAsync\", qt), Yt(this, \"getPixelColour\", this.getPixelColor), Yt(this, \"setPixelColour\", this.setPixelColor);\n const n = this;\n let a = Jt;\n function o() {\n for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r];\n const [i] = e;\n (i || {}).methodName = \"constructor\", setTimeout(() => {\n i && a === Jt ? n.emitError(\"constructor\", i) : i || n.emitMulti(\"constructor\", \"initialized\"), a.call(n, ...e);\n }, 1);\n }\n if (Qt(e[0]) && (e[0] = Kt(e[0])), \"number\" == typeof e[0] && \"number\" == typeof e[1] || parseInt(e[0], 10) && parseInt(e[1], 10)) {\n const t = parseInt(e[0], 10),\n r = parseInt(e[1], 10);\n if (a = e[2], \"number\" == typeof e[2] && (this._background = e[2], a = e[3]), \"string\" == typeof e[2] && (this._background = ee.cssColorToHex(e[2]), a = e[3]), void 0 === a && (a = Jt), \"function\" != typeof a) return l.call(this, \"cb must be a function\", o);\n this.bitmap = {\n data: Zt.alloc(t * r * 4),\n width: t,\n height: r\n };\n for (let t = 0; t < this.bitmap.data.length; t += 4) this.bitmap.data.writeUInt32BE(this._background, t);\n o(null, this);\n } else if (\"object\" == typeof e[0] && e[0].url) {\n if (a = e[1] || Jt, \"function\" != typeof a) return l.call(this, \"cb must be a function\", o);\n $t(e[0], (t, r) => {\n if (t) return l.call(this, t, o);\n this.parseBitmap(r, e[0].url, o);\n });\n } else if (e[0] instanceof ee) {\n const [t] = e;\n if (a = e[1], void 0 === a && (a = Jt), \"function\" != typeof a) return l.call(this, \"cb must be a function\", o);\n this.bitmap = {\n data: Zt.from(t.bitmap.data),\n width: t.bitmap.width,\n height: t.bitmap.height\n }, this._quality = t._quality, this._deflateLevel = t._deflateLevel, this._deflateStrategy = t._deflateStrategy, this._filterType = t._filterType, this._rgba = t._rgba, this._background = t._background, this._originalMime = t._originalMime, o(null, this);\n } else if ((s = e[0]) && \"object\" == typeof s && \"number\" == typeof s.width && \"number\" == typeof s.height && (Zt.isBuffer(s.data) || s.data instanceof Uint8Array || \"function\" == typeof Uint8ClampedArray && s.data instanceof Uint8ClampedArray) && (s.data.length === s.width * s.height * 4 || s.data.length === s.width * s.height * 3)) {\n const [t] = e;\n a = e[1] || Jt;\n const r = t.width * t.height * 4 === t.data.length ? Zt.from(t.data) : function (t) {\n if (t.length % 3 != 0) throw new Error(\"Buffer length is incorrect\");\n const e = Zt.allocUnsafe(t.length / 3 * 4);\n let r = 0;\n for (let i = 0; i < t.length; i++) e[r] = t[i], (i + 1) % 3 == 0 && (e[++r] = 255), r++;\n return e;\n }(t.data);\n this.bitmap = {\n data: r,\n width: t.width,\n height: t.height\n }, o(null, this);\n } else if (\"string\" == typeof e[0]) {\n const t = e[0];\n if (a = e[1], void 0 === a && (a = Jt), \"function\" != typeof a) return l.call(this, \"cb must be a function\", o);\n !function (t, e) {\n i() && \"function\" == typeof i().readFile && !t.match(/^(http|ftp)s?:\\/\\/./) ? i().readFile(t, e) : $t({\n url: t\n }, e);\n }(t, (e, r) => {\n if (e) return l.call(this, e, o);\n this.parseBitmap(r, t, o);\n });\n } else if (\"object\" == typeof e[0] && Zt.isBuffer(e[0])) {\n const t = e[0];\n if (a = e[1], \"function\" != typeof a) return l.call(this, \"cb must be a function\", o);\n this.parseBitmap(t, null, o);\n } else {\n a = e[e.length - 1], \"function\" != typeof a && (a = e[e.length - 2], \"function\" != typeof a && (a = Jt));\n const t = ee.__extraConstructors.find(t => t.test(...e));\n if (!t) return l.call(this, \"No matching constructor overloading was found. Please see the docs for how to call the Jimp constructor.\", o);\n new Promise((r, i) => {\n t.run.call(this, r, i, ...e);\n }).then(() => o(null, this)).catch(o);\n }\n var s;\n }\n parseBitmap(t, e, r) {\n Ht.call(this, t, null, r);\n }\n rgba(t, e) {\n return \"boolean\" != typeof t ? l.call(this, \"bool must be a boolean, true for RGBA or false for RGB\", e) : (this._rgba = t, h(e) && e.call(this, null, this), this);\n }\n emitMulti(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};\n r = Object.assign(r, {\n methodName: t,\n eventName: e\n }), this.emit(\"any\", r), t && this.emit(t, r), this.emit(e, r);\n }\n emitError(t, e) {\n this.emitMulti(t, \"error\", e);\n }\n getHeight() {\n return this.bitmap.height;\n }\n getWidth() {\n return this.bitmap.width;\n }\n inspect() {\n return \"\";\n }\n toString() {\n return \"[object Jimp]\";\n }\n getMIME() {\n return this._originalMime || ee.MIME_PNG;\n }\n getExtension() {\n const t = this.getMIME();\n return (Lt[t.toLowerCase()] || [])[0];\n }\n write(t, e) {\n if (!i() || !i().createWriteStream) throw new Error(\"Cant access the filesystem. You can use the getBase64 method.\");\n if (\"string\" != typeof t) return l.call(this, \"path must be a string\", e);\n if (void 0 === e && (e = Jt), \"function\" != typeof e) return l.call(this, \"cb must be a function\", e);\n const r = Ut(t) || this.getMIME(),\n n = a().parse(t);\n return n.dir && i().mkdirSync(n.dir, {\n recursive: !0\n }), this.getBuffer(r, (r, n) => {\n if (r) return l.call(this, r, e);\n const a = i().createWriteStream(t);\n a.on(\"open\", () => {\n a.write(n), a.end();\n }).on(\"error\", t => l.call(this, t, e)), a.on(\"finish\", () => {\n e.call(this, null, this);\n });\n }), this;\n }\n getBase64(t, e) {\n return t === ee.AUTO && (t = this.getMIME()), \"string\" != typeof t ? l.call(this, \"mime must be a string\", e) : \"function\" != typeof e ? l.call(this, \"cb must be a function\", e) : (this.getBuffer(t, function (r, i) {\n if (r) return l.call(this, r, e);\n const n = \"data:\" + t + \";base64,\" + i.toString(\"base64\");\n e.call(this, null, n);\n }), this);\n }\n hash(t, e) {\n if (\"function\" == typeof (t = t || 64) && (e = t, t = 64), \"number\" != typeof t) return l.call(this, \"base must be a number\", e);\n if (t < 2 || t > 64) return l.call(this, \"base must be a number between 2 and 64\", e);\n let r = this.pHash();\n for (r = c()(c().BIN, Vt.slice(0, t))(r); r.length < Xt[t];) r = \"0\" + r;\n return h(e) && e.call(this, null, r), r;\n }\n pHash() {\n return new $().getHash(this);\n }\n distanceFromHash(t) {\n const e = new $(),\n r = e.getHash(this);\n return e.distance(r, t);\n }\n getPixelIndex(t, e, r, i) {\n let n, a;\n if (\"function\" == typeof r && void 0 === i && (i = r, r = null), r || (r = ee.EDGE_EXTEND), \"number\" != typeof t || \"number\" != typeof e) return l.call(this, \"x and y must be numbers\", i);\n n = t = Math.round(t), a = e = Math.round(e), r === ee.EDGE_EXTEND && (t < 0 && (n = 0), t >= this.bitmap.width && (n = this.bitmap.width - 1), e < 0 && (a = 0), e >= this.bitmap.height && (a = this.bitmap.height - 1)), r === ee.EDGE_WRAP && (t < 0 && (n = this.bitmap.width + t), t >= this.bitmap.width && (n = t % this.bitmap.width), e < 0 && (a = this.bitmap.height + e), e >= this.bitmap.height && (a = e % this.bitmap.height));\n let o = this.bitmap.width * a + n << 2;\n return (n < 0 || n >= this.bitmap.width) && (o = -1), (a < 0 || a >= this.bitmap.height) && (o = -1), h(i) && i.call(this, null, o), o;\n }\n getPixelColor(t, e, r) {\n if (\"number\" != typeof t || \"number\" != typeof e) return l.call(this, \"x and y must be numbers\", r);\n const i = this.getPixelIndex(t, e),\n n = this.bitmap.data.readUInt32BE(i);\n return h(r) && r.call(this, null, n), n;\n }\n setPixelColor(t, e, r, i) {\n if (\"number\" != typeof t || \"number\" != typeof e || \"number\" != typeof r) return l.call(this, \"hex, x and y must be numbers\", i);\n const n = this.getPixelIndex(e, r);\n return this.bitmap.data.writeUInt32BE(t, n), h(i) && i.call(this, null, this), this;\n }\n hasAlpha() {\n const {\n width: t,\n height: e,\n data: r\n } = this.bitmap,\n i = t * e << 2;\n for (let t = 3; t < i; t += 4) if (255 !== r[t]) return !0;\n return !1;\n }\n scanIterator(t, e, r, i) {\n return \"number\" != typeof t || \"number\" != typeof e ? l.call(this, \"x and y must be numbers\") : \"number\" != typeof r || \"number\" != typeof i ? l.call(this, \"w and h must be numbers\") : function* (t, e, r, i, n) {\n e = Math.round(e), r = Math.round(r), i = Math.round(i), n = Math.round(n);\n for (let a = r; a < r + n; a++) for (let r = e; r < e + i; r++) {\n const e = t.bitmap.width * a + r << 2;\n yield {\n x: r,\n y: a,\n idx: e,\n image: t\n };\n }\n }(this, t, e, r, i);\n }\n }\n function re(t) {\n let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ee;\n Object.entries(t).forEach(t => {\n let [r, i] = t;\n e[r] = i;\n });\n }\n function ie(t) {\n let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ee;\n Object.entries(t).forEach(t => {\n let [r, i] = t;\n e.prototype[r] = i;\n });\n }\n function ne(t, e, r) {\n const i = \"before-\" + e,\n n = e.replace(/e$/, \"\") + \"ed\";\n ee.prototype[t] = function () {\n let e;\n for (var a = arguments.length, o = new Array(a), s = 0; s < a; s++) o[s] = arguments[s];\n const h = o[r.length - 1],\n l = this;\n let f;\n \"function\" == typeof h ? (e = function () {\n for (var e = arguments.length, r = new Array(e), i = 0; i < e; i++) r[i] = arguments[i];\n const [a, o] = r;\n a ? l.emitError(t, a) : l.emitMulti(t, n, {\n [t]: o\n }), h.apply(this, r);\n }, o[o.length - 1] = e) : e = !1, this.emitMulti(t, i);\n try {\n f = r.apply(this, o), e || this.emitMulti(t, n, {\n [t]: f\n });\n } catch (e) {\n e.methodName = t, this.emitError(t, e);\n }\n return f;\n }, ee.prototype[t + \"Quiet\"] = r;\n }\n function ae(t, e) {\n ne(t, \"change\", e);\n }\n re(t), ie({\n composite: function (t, r, i) {\n let n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {},\n a = arguments.length > 4 ? arguments[4] : void 0;\n if (\"function\" == typeof n && (a = n, n = {}), !(t instanceof this.constructor)) return l.call(this, \"The source must be a Jimp image\", a);\n if (\"number\" != typeof r || \"number\" != typeof i) return l.call(this, \"x and y must be numbers\", a);\n let {\n mode: o,\n opacitySource: s,\n opacityDest: f\n } = n;\n o || (o = ht), (\"number\" != typeof s || s < 0 || s > 1) && (s = 1), (\"number\" != typeof f || f < 0 || f > 1) && (f = 1);\n const u = e[o];\n r = Math.round(r), i = Math.round(i);\n const c = this;\n return 1 !== f && c.opacity(f), t.scanQuiet(0, 0, t.bitmap.width, t.bitmap.height, function (t, e, n) {\n const a = c.getPixelIndex(r + t, i + e, vt);\n if (-1 === a) return;\n const o = u({\n r: this.bitmap.data[n + 0] / 255,\n g: this.bitmap.data[n + 1] / 255,\n b: this.bitmap.data[n + 2] / 255,\n a: this.bitmap.data[n + 3] / 255\n }, {\n r: c.bitmap.data[a + 0] / 255,\n g: c.bitmap.data[a + 1] / 255,\n b: c.bitmap.data[a + 2] / 255,\n a: c.bitmap.data[a + 3] / 255\n }, s);\n c.bitmap.data[a + 0] = this.constructor.limit255(255 * o.r), c.bitmap.data[a + 1] = this.constructor.limit255(255 * o.g), c.bitmap.data[a + 2] = this.constructor.limit255(255 * o.b), c.bitmap.data[a + 3] = this.constructor.limit255(255 * o.a);\n }), h(a) && a.call(this, null, this), this;\n }\n }), ee.__extraConstructors = [], ee.appendConstructorOption = function (t, e, r) {\n ee.__extraConstructors.push({\n name: t,\n test: e,\n run: r\n });\n }, ee.read = function () {\n for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r];\n return new Promise((t, r) => {\n new ee(...e, (e, i) => {\n e ? r(e) : t(i);\n });\n });\n }, ee.create = ee.read, ee.rgbaToInt = function (t, e, r, i, n) {\n if (\"number\" != typeof t || \"number\" != typeof e || \"number\" != typeof r || \"number\" != typeof i) return l.call(this, \"r, g, b and a must be numbers\", n);\n if (t < 0 || t > 255) return l.call(this, \"r must be between 0 and 255\", n);\n if ((e < 0 || e > 255) && l.call(this, \"g must be between 0 and 255\", n), r < 0 || r > 255) return l.call(this, \"b must be between 0 and 255\", n);\n if (i < 0 || i > 255) return l.call(this, \"a must be between 0 and 255\", n);\n let a = 255 & t;\n return a <<= 8, a |= 255 & e, a <<= 8, a |= 255 & r, a <<= 8, a |= 255 & i, a >>>= 0, h(n) && n.call(this, null, a), a;\n }, ee.intToRGBA = function (t, e) {\n if (\"number\" != typeof t) return l.call(this, \"i must be a number\", e);\n const r = {};\n return r.r = Math.floor(t / Math.pow(256, 3)), r.g = Math.floor((t - r.r * Math.pow(256, 3)) / Math.pow(256, 2)), r.b = Math.floor((t - r.r * Math.pow(256, 3) - r.g * Math.pow(256, 2)) / Math.pow(256, 1)), r.a = Math.floor((t - r.r * Math.pow(256, 3) - r.g * Math.pow(256, 2) - r.b * Math.pow(256, 1)) / Math.pow(256, 0)), h(e) && e.call(this, null, r), r;\n }, ee.cssColorToHex = function (t) {\n return \"number\" == typeof (t = t || 0) ? Number(t) : parseInt(_(t).toHex8(), 16);\n }, ee.limit255 = function (t) {\n return t = Math.max(t, 0), Math.min(t, 255);\n }, ee.diff = function (t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : .1;\n if (!(t instanceof ee && e instanceof ee)) return l.call(this, \"img1 and img2 must be an Jimp images\");\n const i = t.bitmap,\n n = e.bitmap;\n if (i.width === n.width && i.height === n.height || (i.width * i.height > n.width * n.height ? t = t.cloneQuiet().resize(n.width, n.height) : e = e.cloneQuiet().resize(i.width, i.height)), \"number\" != typeof r || r < 0 || r > 1) return l.call(this, \"threshold must be a number between 0 and 1\");\n const a = new ee(i.width, i.height, 4294967295);\n return {\n percent: p()(i.data, n.data, a.bitmap.data, a.bitmap.width, a.bitmap.height, {\n threshold: r\n }) / (a.bitmap.width * a.bitmap.height),\n image: a\n };\n }, ee.distance = function (t, e) {\n const r = new $(),\n i = r.getHash(t),\n n = r.getHash(e);\n return r.distance(i, n);\n }, ee.compareHashes = function (t, e) {\n return new $().distance(t, e);\n }, ee.colorDiff = function (t, e) {\n const r = t => Math.pow(t, 2),\n {\n max: i\n } = Math;\n return 0 === t.a || t.a || (t.a = 255), 0 === e.a || e.a || (e.a = 255), (i(r(t.r - e.r), r(t.r - e.r - t.a + e.a)) + i(r(t.g - e.g), r(t.g - e.g - t.a + e.a)) + i(r(t.b - e.b), r(t.b - e.b - t.a + e.a))) / 195075;\n }, ne(\"clone\", \"clone\", function (t) {\n const e = new ee(this);\n return h(t) && t.call(e, null, e), e;\n }), ae(\"background\", function (t, e) {\n return \"number\" != typeof t ? l.call(this, \"hex must be a hexadecimal rgba value\", e) : (this._background = t, h(e) && e.call(this, null, this), this);\n }), ae(\"scan\", function (t, e, r, i, n, a) {\n if (\"number\" != typeof t || \"number\" != typeof e) return l.call(this, \"x and y must be numbers\", a);\n if (\"number\" != typeof r || \"number\" != typeof i) return l.call(this, \"w and h must be numbers\", a);\n if (\"function\" != typeof n) return l.call(this, \"f must be a function\", a);\n const o = f(this, t, e, r, i, n);\n return h(a) && a.call(this, null, o), o;\n });\n {\n let t;\n \"undefined\" != typeof window && \"object\" == typeof window && (t = window), \"undefined\" != typeof self && \"object\" == typeof self && (t = self), t.Jimp = ee, t.Buffer = Zt;\n }\n const oe = ee;\n var se = __webpack_require__(643),\n he = __webpack_require__(2691),\n le = __webpack_require__.n(he);\n const fe = \"image/jpeg\",\n ue = () => ({\n mime: {\n [fe]: [\"jpeg\", \"jpg\", \"jpe\"]\n },\n constants: {\n MIME_JPEG: fe\n },\n decoders: {\n [fe]: le().decode\n },\n encoders: {\n [fe]: t => le().encode(t.bitmap, t._quality).data\n },\n class: {\n _quality: 100,\n quality(t, e) {\n return \"number\" != typeof t ? l.call(this, \"n must be a number\", e) : t < 0 || t > 100 ? l.call(this, \"n must be a number 0 - 100\", e) : (this._quality = Math.round(t), h(e) && e.call(this, null, this), this);\n }\n }\n });\n var ce = __webpack_require__(9902);\n const de = \"image/png\",\n pe = () => ({\n mime: {\n [de]: [\"png\"]\n },\n constants: {\n MIME_PNG: de,\n PNG_FILTER_AUTO: -1,\n PNG_FILTER_NONE: 0,\n PNG_FILTER_SUB: 1,\n PNG_FILTER_UP: 2,\n PNG_FILTER_AVERAGE: 3,\n PNG_FILTER_PATH: 4\n },\n hasAlpha: {\n [de]: !0\n },\n decoders: {\n [de]: ce.PNG.sync.read\n },\n encoders: {\n [de](t) {\n const e = new ce.PNG({\n width: t.bitmap.width,\n height: t.bitmap.height\n });\n return e.data = t.bitmap.data, ce.PNG.sync.write(e, {\n deflateLevel: t._deflateLevel,\n deflateStrategy: t._deflateStrategy,\n filterType: t._filterType,\n colorType: \"number\" == typeof t._colorType ? t._colorType : t._rgba ? 6 : 2,\n inputHasAlpha: t._rgba\n });\n }\n },\n class: {\n _deflateLevel: 9,\n _deflateStrategy: 3,\n _filterType: -1,\n _colorType: null,\n deflateLevel(t, e) {\n return \"number\" != typeof t ? l.call(this, \"l must be a number\", e) : t < 0 || t > 9 ? l.call(this, \"l must be a number 0 - 9\", e) : (this._deflateLevel = Math.round(t), h(e) && e.call(this, null, this), this);\n },\n deflateStrategy(t, e) {\n return \"number\" != typeof t ? l.call(this, \"s must be a number\", e) : t < 0 || t > 3 ? l.call(this, \"s must be a number 0 - 3\", e) : (this._deflateStrategy = Math.round(t), h(e) && e.call(this, null, this), this);\n },\n filterType(t, e) {\n return \"number\" != typeof t ? l.call(this, \"n must be a number\", e) : t < -1 || t > 4 ? l.call(this, \"n must be -1 (auto) or a number 0 - 4\", e) : (this._filterType = Math.round(t), h(e) && e.call(this, null, this), this);\n },\n colorType(t, e) {\n return \"number\" != typeof t ? l.call(this, \"s must be a number\", e) : 0 !== t && 2 !== t && 4 !== t && 6 !== t ? l.call(this, \"s must be a number 0, 2, 4, 6.\", e) : (this._colorType = Math.round(t), h(e) && e.call(this, null, this), this);\n }\n }\n });\n var me = __webpack_require__(486),\n ge = __webpack_require__.n(me);\n const be = \"image/bmp\",\n _e = \"image/x-ms-bmp\",\n ye = t => {\n return f({\n bitmap: e = ge().decode(t)\n }, 0, 0, e.width, e.height, function (t, r, i) {\n const n = this.bitmap.data[i + 0],\n a = this.bitmap.data[i + 1],\n o = this.bitmap.data[i + 2],\n s = this.bitmap.data[i + 3];\n this.bitmap.data[i + 0] = s, this.bitmap.data[i + 1] = o, this.bitmap.data[i + 2] = a, this.bitmap.data[i + 3] = e.is_with_alpha ? n : 255;\n }).bitmap;\n var e;\n },\n we = t => ge().encode(function (t) {\n return f(t, 0, 0, t.bitmap.width, t.bitmap.height, function (t, e, r) {\n const i = this.bitmap.data[r + 0],\n n = this.bitmap.data[r + 1],\n a = this.bitmap.data[r + 2],\n o = this.bitmap.data[r + 3];\n this.bitmap.data[r + 0] = o, this.bitmap.data[r + 1] = a, this.bitmap.data[r + 2] = n, this.bitmap.data[r + 3] = i;\n }).bitmap;\n }(t)).data;\n var ve = __webpack_require__(9299),\n xe = __webpack_require__.n(ve),\n Ee = __webpack_require__(8834).lW;\n const ke = \"image/tiff\";\n var Se = __webpack_require__(63),\n Me = __webpack_require__(9455),\n Ae = __webpack_require__(8834).lW;\n const Ie = \"image/gif\",\n Be = [1, 57, 41, 21, 203, 34, 97, 73, 227, 91, 149, 62, 105, 45, 39, 137, 241, 107, 3, 173, 39, 71, 65, 238, 219, 101, 187, 87, 81, 151, 141, 133, 249, 117, 221, 209, 197, 187, 177, 169, 5, 153, 73, 139, 133, 127, 243, 233, 223, 107, 103, 99, 191, 23, 177, 171, 165, 159, 77, 149, 9, 139, 135, 131, 253, 245, 119, 231, 224, 109, 211, 103, 25, 195, 189, 23, 45, 175, 171, 83, 81, 79, 155, 151, 147, 9, 141, 137, 67, 131, 129, 251, 123, 30, 235, 115, 113, 221, 217, 53, 13, 51, 50, 49, 193, 189, 185, 91, 179, 175, 43, 169, 83, 163, 5, 79, 155, 19, 75, 147, 145, 143, 35, 69, 17, 67, 33, 65, 255, 251, 247, 243, 239, 59, 29, 229, 113, 111, 219, 27, 213, 105, 207, 51, 201, 199, 49, 193, 191, 47, 93, 183, 181, 179, 11, 87, 43, 85, 167, 165, 163, 161, 159, 157, 155, 77, 19, 75, 37, 73, 145, 143, 141, 35, 138, 137, 135, 67, 33, 131, 129, 255, 63, 250, 247, 61, 121, 239, 237, 117, 29, 229, 227, 225, 111, 55, 109, 216, 213, 211, 209, 207, 205, 203, 201, 199, 197, 195, 193, 48, 190, 47, 93, 185, 183, 181, 179, 178, 176, 175, 173, 171, 85, 21, 167, 165, 41, 163, 161, 5, 79, 157, 78, 154, 153, 19, 75, 149, 74, 147, 73, 144, 143, 71, 141, 140, 139, 137, 17, 135, 134, 133, 66, 131, 65, 129, 1],\n Te = [0, 9, 10, 10, 14, 12, 14, 14, 16, 15, 16, 15, 16, 15, 15, 17, 18, 17, 12, 18, 16, 17, 17, 19, 19, 18, 19, 18, 18, 19, 19, 19, 20, 19, 20, 20, 20, 20, 20, 20, 15, 20, 19, 20, 20, 20, 21, 21, 21, 20, 20, 20, 21, 18, 21, 21, 21, 21, 20, 21, 17, 21, 21, 21, 22, 22, 21, 22, 22, 21, 22, 21, 19, 22, 22, 19, 20, 22, 22, 21, 21, 21, 22, 22, 22, 18, 22, 22, 21, 22, 22, 23, 22, 20, 23, 22, 22, 23, 23, 21, 19, 21, 21, 21, 23, 23, 23, 22, 23, 23, 21, 23, 22, 23, 18, 22, 23, 20, 22, 23, 23, 23, 21, 22, 20, 22, 21, 22, 24, 24, 24, 24, 24, 22, 21, 24, 23, 23, 24, 21, 24, 23, 24, 22, 24, 24, 22, 24, 24, 22, 23, 24, 24, 24, 20, 23, 22, 23, 24, 24, 24, 24, 24, 24, 24, 23, 21, 23, 22, 23, 24, 24, 24, 22, 24, 24, 24, 23, 22, 24, 24, 25, 23, 25, 25, 23, 24, 25, 25, 24, 22, 25, 25, 25, 24, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 22, 25, 25, 23, 25, 25, 20, 24, 25, 24, 25, 25, 22, 24, 25, 24, 25, 24, 25, 25, 24, 25, 25, 25, 25, 22, 25, 25, 25, 24, 25, 24, 25, 18];\n var Re = __webpack_require__(8834).lW;\n function Pe(t, e, r, i) {\n const n = [0, 0, 0],\n a = (e.length - 1) / 2;\n for (let o = 0; o < e.length; o += 1) for (let s = 0; s < e[o].length; s += 1) {\n const h = t.getPixelIndex(r + o - a, i + s - a);\n n[0] += t.bitmap.data[h] * e[o][s], n[1] += t.bitmap.data[h + 1] * e[o][s], n[2] += t.bitmap.data[h + 2] * e[o][s];\n }\n return n;\n }\n const Oe = t => null != t;\n function Le(t) {\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, r) {\n const i = parseInt(.2126 * this.bitmap.data[r] + .7152 * this.bitmap.data[r + 1] + .0722 * this.bitmap.data[r + 2], 10);\n this.bitmap.data[r] = i, this.bitmap.data[r + 1] = i, this.bitmap.data[r + 2] = i;\n }), h(t) && t.call(this, null, this), this;\n }\n function Ce(t, e) {\n let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 50;\n return {\n r: (e.r - t.r) * (r / 100) + t.r,\n g: (e.g - t.g) * (r / 100) + t.g,\n b: (e.b - t.b) * (r / 100) + t.b\n };\n }\n function Ue(t, e) {\n return t && Array.isArray(t) ? (t = t.map(t => (\"xor\" !== t.apply && \"mix\" !== t.apply || (t.params[0] = _(t.params[0]).toRgb()), t)), this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, (r, i, n) => {\n let a = {\n r: this.bitmap.data[n],\n g: this.bitmap.data[n + 1],\n b: this.bitmap.data[n + 2]\n };\n const o = (t, e) => this.constructor.limit255(a[t] + e);\n t.forEach(t => {\n if (\"mix\" === t.apply) a = Ce(a, t.params[0], t.params[1]);else if (\"tint\" === t.apply) a = Ce(a, {\n r: 255,\n g: 255,\n b: 255\n }, t.params[0]);else if (\"shade\" === t.apply) a = Ce(a, {\n r: 0,\n g: 0,\n b: 0\n }, t.params[0]);else if (\"xor\" === t.apply) a = {\n r: a.r ^ t.params[0].r,\n g: a.g ^ t.params[0].g,\n b: a.b ^ t.params[0].b\n };else if (\"red\" === t.apply) a.r = o(\"r\", t.params[0]);else if (\"green\" === t.apply) a.g = o(\"g\", t.params[0]);else if (\"blue\" === t.apply) a.b = o(\"b\", t.params[0]);else {\n if (\"hue\" === t.apply && (t.apply = \"spin\"), a = _(a), !a[t.apply]) return l.call(this, \"action \" + t.apply + \" not supported\", e);\n a = a[t.apply](...t.params).toRgb();\n }\n }), this.bitmap.data[n] = a.r, this.bitmap.data[n + 1] = a.g, this.bitmap.data[n + 2] = a.b;\n }), h(e) && e.call(this, null, this), this) : l.call(this, \"actions must be an array\", e);\n }\n Object.freeze({\n LIGHTEN: \"lighten\",\n BRIGHTEN: \"brighten\",\n DARKEN: \"darken\",\n DESATURATE: \"desaturate\",\n SATURATE: \"saturate\",\n GREYSCALE: \"greyscale\",\n SPIN: \"spin\",\n HUE: \"hue\",\n MIX: \"mix\",\n TINT: \"tint\",\n SHADE: \"shade\",\n XOR: \"xor\",\n RED: \"red\",\n GREEN: \"green\",\n BLUE: \"blue\"\n });\n var ze = __webpack_require__(8834).lW;\n function De(t) {\n const e = [1, 9, 3, 11, 13, 5, 15, 7, 4, 12, 2, 10, 16, 8, 14, 6];\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, r, i) {\n const n = e[((3 & r) << 2) + t % 4];\n this.bitmap.data[i] = Math.min(this.bitmap.data[i] + n, 255), this.bitmap.data[i + 1] = Math.min(this.bitmap.data[i + 1] + n, 255), this.bitmap.data[i + 2] = Math.min(this.bitmap.data[i + 2] + n, 255);\n }), h(t) && t.call(this, null, this), this;\n }\n var Ne = __webpack_require__(8834).lW;\n function Fe(t, e, r) {\n if (\"boolean\" != typeof t || \"boolean\" != typeof e) return l.call(this, \"horizontal and vertical must be Booleans\", r);\n const i = Ne.alloc(this.bitmap.data.length);\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (r, n, a) {\n const o = t ? this.bitmap.width - 1 - r : r,\n s = e ? this.bitmap.height - 1 - n : n,\n h = this.bitmap.width * s + o << 2,\n l = this.bitmap.data.readUInt32BE(a);\n i.writeUInt32BE(l, h);\n }), this.bitmap.data = Ne.from(i), h(r) && r.call(this, null, this), this;\n }\n function je() {\n const t = {\n r: new Array(256).fill(0),\n g: new Array(256).fill(0),\n b: new Array(256).fill(0)\n };\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (e, r, i) {\n t.r[this.bitmap.data[i + 0]]++, t.g[this.bitmap.data[i + 1]]++, t.b[this.bitmap.data[i + 2]]++;\n }), t;\n }\n const Ge = function (t, e, r) {\n return 255 * (t - e) / (r - e);\n },\n He = function (t) {\n return [t.findIndex(t => t > 0), 255 - t.slice().reverse().findIndex(t => t > 0)];\n };\n var We = __webpack_require__(8058),\n qe = __webpack_require__.n(We);\n function Ze(t, e) {\n let r = 0;\n for (let i = 0; i < e.length; i++) if (t.chars[e[i]]) {\n const n = t.kernings[e[i]] && t.kernings[e[i]][e[i + 1]] ? t.kernings[e[i]][e[i + 1]] : 0;\n r += (t.chars[e[i]].xadvance || 0) + n;\n }\n return r;\n }\n function Ye(t, e, r) {\n const i = e.replace(/[\\r\\n]+/g, \" \\n\").split(\" \"),\n n = [];\n let a = [],\n o = 0;\n return i.forEach(e => {\n const i = [...a, e].join(\" \"),\n s = Ze(t, i);\n s <= r && !e.includes(\"\\n\") ? (s > o && (o = s), a.push(e)) : (n.push(a), a = [e.replace(\"\\n\", \"\")]);\n }), n.push(a), {\n lines: n,\n longestLine: o\n };\n }\n function Ve(t, e, r) {\n const {\n lines: i\n } = Ye(t, e, r);\n return i.length * t.common.lineHeight;\n }\n function Xe(t, e, r, i, n) {\n if (n.width > 0 && n.height > 0) {\n const a = e.pages[n.page];\n t.blit(a, r + n.xoffset, i + n.yoffset, n.x, n.y, n.width, n.height);\n }\n return t;\n }\n function Je(t, e, r, i, n) {\n for (let a = 0; a < i.length; a++) {\n let o;\n o = t.chars[i[a]] ? i[a] : /\\s/.test(i[a]) ? \"\" : \"?\";\n const s = t.chars[o] || {},\n h = t.kernings[o];\n Xe(this, t, e, r, s || {}), e += (h && h[i[a + 1]] ? h[i[a + 1]] : 0) + (s.xadvance || n);\n }\n }\n const Qe = \"//../\";\n function Ke(t, e, r, i, n, a, o) {\n this.widthOriginal = Math.abs(Math.floor(t) || 0), this.heightOriginal = Math.abs(Math.floor(e) || 0), this.targetWidth = Math.abs(Math.floor(r) || 0), this.targetHeight = Math.abs(Math.floor(i) || 0), this.colorChannels = n ? 4 : 3, this.interpolationPass = Boolean(a), this.resizeCallback = \"function\" == typeof o ? o : function () {}, this.targetWidthMultipliedByChannels = this.targetWidth * this.colorChannels, this.originalWidthMultipliedByChannels = this.widthOriginal * this.colorChannels, this.originalHeightMultipliedByChannels = this.heightOriginal * this.colorChannels, this.widthPassResultSize = this.targetWidthMultipliedByChannels * this.heightOriginal, this.finalResultSize = this.targetWidthMultipliedByChannels * this.targetHeight, this.initialize();\n }\n Ke.prototype.initialize = function () {\n if (!(this.widthOriginal > 0 && this.heightOriginal > 0 && this.targetWidth > 0 && this.targetHeight > 0)) throw new Error(\"Invalid settings specified for the resizer.\");\n this.configurePasses();\n }, Ke.prototype.configurePasses = function () {\n this.widthOriginal === this.targetWidth ? this.resizeWidth = this.bypassResizer : (this.ratioWeightWidthPass = this.widthOriginal / this.targetWidth, this.ratioWeightWidthPass < 1 && this.interpolationPass ? (this.initializeFirstPassBuffers(!0), this.resizeWidth = 4 === this.colorChannels ? this.resizeWidthInterpolatedRGBA : this.resizeWidthInterpolatedRGB) : (this.initializeFirstPassBuffers(!1), this.resizeWidth = 4 === this.colorChannels ? this.resizeWidthRGBA : this.resizeWidthRGB)), this.heightOriginal === this.targetHeight ? this.resizeHeight = this.bypassResizer : (this.ratioWeightHeightPass = this.heightOriginal / this.targetHeight, this.ratioWeightHeightPass < 1 && this.interpolationPass ? (this.initializeSecondPassBuffers(!0), this.resizeHeight = this.resizeHeightInterpolated) : (this.initializeSecondPassBuffers(!1), this.resizeHeight = 4 === this.colorChannels ? this.resizeHeightRGBA : this.resizeHeightRGB));\n }, Ke.prototype._resizeWidthInterpolatedRGBChannels = function (t, e) {\n const r = e ? 4 : 3,\n i = this.ratioWeightWidthPass,\n n = this.widthBuffer;\n let a,\n o,\n s = 0,\n h = 0,\n l = 0,\n f = 0,\n u = 0;\n for (a = 0; s < 1 / 3; a += r, s += i) for (h = a, l = 0; h < this.widthPassResultSize; l += this.originalWidthMultipliedByChannels, h += this.targetWidthMultipliedByChannels) n[h] = t[l], n[h + 1] = t[l + 1], n[h + 2] = t[l + 2], e && (n[h + 3] = t[l + 3]);\n for (s -= 1 / 3, o = this.widthOriginal - 1; s < o; a += r, s += i) for (u = s % 1, f = 1 - u, h = a, l = Math.floor(s) * r; h < this.widthPassResultSize; l += this.originalWidthMultipliedByChannels, h += this.targetWidthMultipliedByChannels) n[h + 0] = t[l + 0] * f + t[l + r + 0] * u, n[h + 1] = t[l + 1] * f + t[l + r + 1] * u, n[h + 2] = t[l + 2] * f + t[l + r + 2] * u, e && (n[h + 3] = t[l + 3] * f + t[l + r + 3] * u);\n for (o = this.originalWidthMultipliedByChannels - r; a < this.targetWidthMultipliedByChannels; a += r) for (h = a, l = o; h < this.widthPassResultSize; l += this.originalWidthMultipliedByChannels, h += this.targetWidthMultipliedByChannels) n[h] = t[l], n[h + 1] = t[l + 1], n[h + 2] = t[l + 2], e && (n[h + 3] = t[l + 3]);\n return n;\n }, Ke.prototype._resizeWidthRGBChannels = function (t, e) {\n const r = e ? 4 : 3,\n i = this.ratioWeightWidthPass,\n n = 1 / i,\n a = this.originalWidthMultipliedByChannels - r + 1,\n o = this.targetWidthMultipliedByChannels - r + 1,\n s = this.outputWidthWorkBench,\n h = this.widthBuffer,\n l = this.outputWidthWorkBenchOpaquePixelsCount;\n let f = 0,\n u = 0,\n c = 0,\n d = 0,\n p = 0,\n m = 0,\n g = 0,\n b = 1,\n _ = 0,\n y = 0,\n w = 0,\n v = 0;\n do {\n for (p = 0; p < this.originalHeightMultipliedByChannels;) s[p++] = 0, s[p++] = 0, s[p++] = 0, e && (s[p++] = 0, l[p / r - 1] = 0);\n f = i;\n do {\n for (u = 1 + c - d, b = Math.min(f, u), p = 0, m = c; p < this.originalHeightMultipliedByChannels; m += a) _ = t[m], y = t[++m], w = t[++m], v = e ? t[++m] : 255, s[p++] += (v ? _ : 0) * b, s[p++] += (v ? y : 0) * b, s[p++] += (v ? w : 0) * b, e && (s[p++] += v * b, l[p / r - 1] += v ? b : 0);\n if (!(f >= u)) {\n d += f;\n break;\n }\n c += r, d = c, f -= u;\n } while (f > 0 && c < this.originalWidthMultipliedByChannels);\n for (p = 0, m = g; p < this.originalHeightMultipliedByChannels; m += o) f = e ? l[p / r] : 1, b = e ? f ? 1 / f : 0 : n, h[m] = s[p++] * b, h[++m] = s[p++] * b, h[++m] = s[p++] * b, e && (h[++m] = s[p++] * n);\n g += r;\n } while (g < this.targetWidthMultipliedByChannels);\n return h;\n }, Ke.prototype._resizeHeightRGBChannels = function (t, e) {\n const r = this.ratioWeightHeightPass,\n i = 1 / r,\n n = this.outputHeightWorkBench,\n a = this.heightBuffer,\n o = this.outputHeightWorkBenchOpaquePixelsCount;\n let s = 0,\n h = 0,\n l = 0,\n f = 0,\n u = 0,\n c = 0,\n d = 0,\n p = 1,\n m = 0,\n g = 0,\n b = 0,\n _ = 0;\n do {\n for (u = 0; u < this.targetWidthMultipliedByChannels;) n[u++] = 0, n[u++] = 0, n[u++] = 0, e && (n[u++] = 0, o[u / 4 - 1] = 0);\n s = r;\n do {\n for (h = 1 + l - f, p = Math.min(s, h), d = l, u = 0; u < this.targetWidthMultipliedByChannels;) m = t[d++], g = t[d++], b = t[d++], _ = e ? t[d++] : 255, n[u++] += (_ ? m : 0) * p, n[u++] += (_ ? g : 0) * p, n[u++] += (_ ? b : 0) * p, e && (n[u++] += _ * p, o[u / 4 - 1] += _ ? p : 0);\n if (!(s >= h)) {\n f += s;\n break;\n }\n l = d, f = l, s -= h;\n } while (s > 0 && l < this.widthPassResultSize);\n for (u = 0; u < this.targetWidthMultipliedByChannels;) s = e ? o[u / 4] : 1, p = e ? s ? 1 / s : 0 : i, a[c++] = Math.round(n[u++] * p), a[c++] = Math.round(n[u++] * p), a[c++] = Math.round(n[u++] * p), e && (a[c++] = Math.round(n[u++] * i));\n } while (c < this.finalResultSize);\n return a;\n }, Ke.prototype.resizeWidthInterpolatedRGB = function (t) {\n return this._resizeWidthInterpolatedRGBChannels(t, !1);\n }, Ke.prototype.resizeWidthInterpolatedRGBA = function (t) {\n return this._resizeWidthInterpolatedRGBChannels(t, !0);\n }, Ke.prototype.resizeWidthRGB = function (t) {\n return this._resizeWidthRGBChannels(t, !1);\n }, Ke.prototype.resizeWidthRGBA = function (t) {\n return this._resizeWidthRGBChannels(t, !0);\n }, Ke.prototype.resizeHeightInterpolated = function (t) {\n const e = this.ratioWeightHeightPass,\n r = this.heightBuffer;\n let i,\n n = 0,\n a = 0,\n o = 0,\n s = 0,\n h = 0,\n l = 0,\n f = 0;\n for (; n < 1 / 3; n += e) for (o = 0; o < this.targetWidthMultipliedByChannels;) r[a++] = Math.round(t[o++]);\n for (n -= 1 / 3, i = this.heightOriginal - 1; n < i; n += e) for (f = n % 1, l = 1 - f, s = Math.floor(n) * this.targetWidthMultipliedByChannels, h = s + this.targetWidthMultipliedByChannels, o = 0; o < this.targetWidthMultipliedByChannels; ++o) r[a++] = Math.round(t[s++] * l + t[h++] * f);\n for (; a < this.finalResultSize;) for (o = 0, s = i * this.targetWidthMultipliedByChannels; o < this.targetWidthMultipliedByChannels; ++o) r[a++] = Math.round(t[s++]);\n return r;\n }, Ke.prototype.resizeHeightRGB = function (t) {\n return this._resizeHeightRGBChannels(t, !1);\n }, Ke.prototype.resizeHeightRGBA = function (t) {\n return this._resizeHeightRGBChannels(t, !0);\n }, Ke.prototype.resize = function (t) {\n this.resizeCallback(this.resizeHeight(this.resizeWidth(t)));\n }, Ke.prototype.bypassResizer = function (t) {\n return t;\n }, Ke.prototype.initializeFirstPassBuffers = function (t) {\n this.widthBuffer = this.generateFloatBuffer(this.widthPassResultSize), t || (this.outputWidthWorkBench = this.generateFloatBuffer(this.originalHeightMultipliedByChannels), this.colorChannels > 3 && (this.outputWidthWorkBenchOpaquePixelsCount = this.generateFloat64Buffer(this.heightOriginal)));\n }, Ke.prototype.initializeSecondPassBuffers = function (t) {\n this.heightBuffer = this.generateUint8Buffer(this.finalResultSize), t || (this.outputHeightWorkBench = this.generateFloatBuffer(this.targetWidthMultipliedByChannels), this.colorChannels > 3 && (this.outputHeightWorkBenchOpaquePixelsCount = this.generateFloat64Buffer(this.targetWidth)));\n }, Ke.prototype.generateFloatBuffer = function (t) {\n try {\n return new Float32Array(t);\n } catch (t) {\n return [];\n }\n }, Ke.prototype.generateFloat64Buffer = function (t) {\n try {\n return new Float64Array(t);\n } catch (t) {\n return [];\n }\n }, Ke.prototype.generateUint8Buffer = function (t) {\n try {\n return new Uint8Array(t);\n } catch (t) {\n return [];\n }\n };\n const $e = Ke;\n var tr = __webpack_require__(8834).lW;\n const er = {\n nearestNeighbor(t, e) {\n const r = t.width,\n i = t.height,\n n = e.width,\n a = e.height,\n o = t.data,\n s = e.data;\n for (let t = 0; t < a; t++) for (let e = 0; e < n; e++) {\n let h = 4 * (t * n + e),\n l = 4 * (Math.floor(t * i / a) * r + Math.floor(e * r / n));\n s[h++] = o[l++], s[h++] = o[l++], s[h++] = o[l++], s[h++] = o[l++];\n }\n },\n bilinearInterpolation(t, e) {\n const r = t.width,\n i = t.height,\n n = e.width,\n a = e.height,\n o = t.data,\n s = e.data,\n h = function (t, e, r, i, n) {\n return e === i ? r : Math.round((t - e) * n + (i - t) * r);\n },\n l = function (t, e, i, n, a, l, f, u) {\n let c = 4 * (f * r + n) + e,\n d = 4 * (f * r + a) + e;\n const p = h(i, n, o[c], a, o[d]);\n if (u === f) s[t + e] = p;else {\n c = 4 * (u * r + n) + e, d = 4 * (u * r + a) + e;\n const m = h(i, n, o[c], a, o[d]);\n s[t + e] = h(l, f, p, u, m);\n }\n };\n for (let t = 0; t < a; t++) for (let e = 0; e < n; e++) {\n const o = 4 * (t * n + e),\n s = e * r / n,\n h = Math.floor(s),\n f = Math.min(Math.ceil(s), r - 1),\n u = t * i / a,\n c = Math.floor(u),\n d = Math.min(Math.ceil(u), i - 1);\n l(o, 0, s, h, f, u, c, d), l(o, 1, s, h, f, u, c, d), l(o, 2, s, h, f, u, c, d), l(o, 3, s, h, f, u, c, d);\n }\n },\n _interpolate2D(t, e, r, i) {\n const n = t.data,\n a = e.data,\n o = t.width,\n s = t.height,\n h = e.width,\n l = e.height,\n f = Math.max(1, Math.floor(o / h)),\n u = h * f,\n c = Math.max(1, Math.floor(s / l)),\n d = l * c,\n p = tr.alloc(u * s * 4);\n for (let t = 0; t < s; t++) for (let e = 0; e < u; e++) {\n const r = e * (o - 1) / u,\n a = Math.floor(r),\n s = r - a,\n h = 4 * (t * o + a),\n l = 4 * (t * u + e);\n for (let t = 0; t < 4; t++) {\n const e = h + t,\n r = a > 0 ? n[e - 4] : 2 * n[e] - n[e + 4],\n f = n[e],\n u = n[e + 4],\n c = a < o - 2 ? n[e + 8] : 2 * n[e + 4] - n[e];\n p[l + t] = i(r, f, u, c, s);\n }\n }\n const m = tr.alloc(u * d * 4);\n for (let t = 0; t < d; t++) for (let e = 0; e < u; e++) {\n const r = t * (s - 1) / d,\n n = Math.floor(r),\n a = r - n,\n o = 4 * (n * u + e),\n h = 4 * (t * u + e);\n for (let t = 0; t < 4; t++) {\n const e = o + t,\n r = n > 0 ? p[e - 4 * u] : 2 * p[e] - p[e + 4 * u],\n l = p[e],\n f = p[e + 4 * u],\n c = n < s - 2 ? p[e + 8 * u] : 2 * p[e + 4 * u] - p[e];\n m[h + t] = i(r, l, f, c, a);\n }\n }\n const g = f * c;\n if (g > 1) for (let t = 0; t < l; t++) for (let e = 0; e < h; e++) {\n let r = 0,\n i = 0,\n n = 0,\n o = 0,\n s = 0;\n for (let a = 0; a < c; a++) {\n const h = t * c + a;\n for (let t = 0; t < f; t++) {\n const a = 4 * (h * u + (e * f + t)),\n l = m[a + 3];\n l && (r += m[a], i += m[a + 1], n += m[a + 2], s++), o += l;\n }\n }\n const l = 4 * (t * h + e);\n a[l] = s ? Math.round(r / s) : 0, a[l + 1] = s ? Math.round(i / s) : 0, a[l + 2] = s ? Math.round(n / s) : 0, a[l + 3] = Math.round(o / g);\n } else e.data = m;\n },\n bicubicInterpolation(t, e, r) {\n return this._interpolate2D(t, e, r, function (t, e, r, i, n) {\n const a = i - r - t + e,\n o = t - e - a,\n s = r - t,\n h = e;\n return Math.max(0, Math.min(255, a * (n * n * n) + o * (n * n) + s * n + h));\n });\n },\n hermiteInterpolation(t, e, r) {\n return this._interpolate2D(t, e, r, function (t, e, r, i, n) {\n const a = e,\n o = .5 * (r - t),\n s = t - 2.5 * e + 2 * r - .5 * i,\n h = .5 * (i - t) + 1.5 * (e - r);\n return Math.max(0, Math.min(255, Math.round(((h * n + s) * n + o) * n + a)));\n });\n },\n bezierInterpolation(t, e, r) {\n return this._interpolate2D(t, e, r, function (t, e, r, i, n) {\n const a = 1 - n,\n o = e * a * a * a,\n s = 3 * (e + (r - t) / 4) * a * a * n,\n h = 3 * (r - (i - e) / 4) * a * n * n,\n l = r * n * n * n;\n return Math.max(0, Math.min(255, Math.round(o + s + h + l)));\n });\n }\n },\n rr = er;\n var ir = __webpack_require__(8834).lW,\n nr = __webpack_require__(8834).lW;\n function ar(t) {\n if (Math.abs(t) % 90 != 0) throw new Error(\"Unsupported matrix rotation degree\");\n if (t %= 360, 0 === Math.abs(t)) return;\n const e = this.bitmap.width,\n r = this.bitmap.height;\n let i;\n switch (t) {\n case 90:\n case -270:\n i = 90;\n break;\n case 180:\n case -180:\n i = 180;\n break;\n case 270:\n case -90:\n i = -90;\n break;\n default:\n throw new Error(\"Unsupported matrix rotation degree\");\n }\n const n = 180 === i ? e : r,\n a = 180 === i ? r : e,\n o = nr.alloc(this.bitmap.data.length);\n function s(t, e) {\n return function (e, r) {\n return r * t + e << 2;\n };\n }\n const h = s(e),\n l = s(n);\n for (let t = 0; t < e; t++) for (let n = 0; n < r; n++) {\n const a = h(t, n),\n s = this.bitmap.data.readUInt32BE(a);\n let f;\n switch (i) {\n case 90:\n f = l(n, e - t - 1);\n break;\n case -90:\n f = l(r - n - 1, t);\n break;\n case 180:\n f = l(e - t - 1, r - n - 1);\n break;\n default:\n throw new Error(\"Unsupported matrix rotation angle\");\n }\n o.writeUInt32BE(s, f);\n }\n this.bitmap.data = o, this.bitmap.width = n, this.bitmap.height = a;\n }\n function or(t, e) {\n const r = (t %= 360) * Math.PI / 180,\n i = Math.cos(r),\n n = Math.sin(r);\n let a = this.bitmap.width,\n o = this.bitmap.height;\n if (!0 === e || \"string\" == typeof e) {\n a = Math.ceil(Math.abs(this.bitmap.width * i) + Math.abs(this.bitmap.height * n)) + 1, o = Math.ceil(Math.abs(this.bitmap.width * n) + Math.abs(this.bitmap.height * i)) + 1, a % 2 != 0 && a++, o % 2 != 0 && o++;\n const t = this.cloneQuiet();\n this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, r) {\n this.bitmap.data.writeUInt32BE(this._background, r);\n });\n const r = Math.max(a, o, this.bitmap.width, this.bitmap.height);\n this.resize(r, r, e), this.blit(t, this.bitmap.width / 2 - t.bitmap.width / 2, this.bitmap.height / 2 - t.bitmap.height / 2);\n }\n const s = this.bitmap.width,\n h = this.bitmap.height,\n l = nr.alloc(this.bitmap.data.length);\n function f(t, e) {\n return function (r, i) {\n return {\n x: r + t,\n y: i + e\n };\n };\n }\n const u = f(-s / 2, -h / 2),\n c = f(s / 2 + .5, h / 2 + .5);\n for (let t = 1; t <= h; t++) for (let e = 1; e <= s; e++) {\n const r = u(e, t),\n a = c(i * r.x - n * r.y, i * r.y + n * r.x),\n o = s * (t - 1) + e - 1 << 2;\n if (a.x >= 0 && a.x < s && a.y >= 0 && a.y < h) {\n const t = (s * (0 | a.y) + a.x | 0) << 2,\n e = this.bitmap.data.readUInt32BE(t);\n l.writeUInt32BE(e, o);\n } else l.writeUInt32BE(this._background, o);\n }\n if (this.bitmap.data = l, !0 === e || \"string\" == typeof e) {\n const t = s / 2 - a / 2,\n e = h / 2 - o / 2;\n this.crop(t, e, a, o);\n }\n }\n const sr = [() => ({\n blit(t, e, r, i, n, a, o, s) {\n if (!(t instanceof this.constructor)) return l.call(this, \"The source must be a Jimp image\", s);\n if (\"number\" != typeof e || \"number\" != typeof r) return l.call(this, \"x and y must be numbers\", s);\n if (\"function\" == typeof i) s = i, i = 0, n = 0, a = t.bitmap.width, o = t.bitmap.height;else {\n if (typeof i != typeof n || typeof n != typeof a || typeof a != typeof o) return l.call(this, \"srcx, srcy, srcw, srch must be numbers\", s);\n i = i || 0, n = n || 0, a = a || t.bitmap.width, o = o || t.bitmap.height;\n }\n e = Math.round(e), r = Math.round(r), i = Math.round(i), n = Math.round(n), a = Math.round(a), o = Math.round(o);\n const f = this.bitmap.width,\n u = this.bitmap.height,\n c = this;\n return t.scanQuiet(i, n, a, o, function (t, a, o) {\n const s = e + t - i,\n h = r + a - n;\n if (s >= 0 && h >= 0 && f - s > 0 && u - h > 0) {\n const t = c.getPixelIndex(s, h),\n e = {\n r: this.bitmap.data[o],\n g: this.bitmap.data[o + 1],\n b: this.bitmap.data[o + 2],\n a: this.bitmap.data[o + 3]\n },\n r = {\n r: c.bitmap.data[t],\n g: c.bitmap.data[t + 1],\n b: c.bitmap.data[t + 2],\n a: c.bitmap.data[t + 3]\n };\n c.bitmap.data[t] = (e.a * (e.r - r.r) - r.r + 255 >> 8) + r.r, c.bitmap.data[t + 1] = (e.a * (e.g - r.g) - r.g + 255 >> 8) + r.g, c.bitmap.data[t + 2] = (e.a * (e.b - r.b) - r.b + 255 >> 8) + r.b, c.bitmap.data[t + 3] = this.constructor.limit255(r.a + e.a);\n }\n }), h(s) && s.call(this, null, this), this;\n }\n }), () => ({\n blur(t, e) {\n if (\"number\" != typeof t) return l.call(this, \"r must be a number\", e);\n if (t < 1) return l.call(this, \"r must be greater than 0\", e);\n let r, i, n, a, o, s, f, u, c, d, p, m, g, b;\n const _ = this.bitmap.width - 1,\n y = this.bitmap.height - 1,\n w = t + 1,\n v = Be[t],\n x = Te[t],\n E = [],\n k = [],\n S = [],\n M = [],\n A = [],\n I = [];\n let B = 2;\n for (; B-- > 0;) {\n for (m = 0, g = 0, s = 0; s < this.bitmap.height; s++) {\n for (r = this.bitmap.data[g] * w, i = this.bitmap.data[g + 1] * w, n = this.bitmap.data[g + 2] * w, a = this.bitmap.data[g + 3] * w, f = 1; f <= t; f++) u = g + ((f > _ ? _ : f) << 2), r += this.bitmap.data[u++], i += this.bitmap.data[u++], n += this.bitmap.data[u++], a += this.bitmap.data[u];\n for (o = 0; o < this.bitmap.width; o++) E[m] = r, k[m] = i, S[m] = n, M[m] = a, 0 === s && (A[o] = ((u = o + w) < _ ? u : _) << 2, I[o] = (u = o - t) > 0 ? u << 2 : 0), c = g + A[o], d = g + I[o], r += this.bitmap.data[c++] - this.bitmap.data[d++], i += this.bitmap.data[c++] - this.bitmap.data[d++], n += this.bitmap.data[c++] - this.bitmap.data[d++], a += this.bitmap.data[c] - this.bitmap.data[d], m++;\n g += this.bitmap.width << 2;\n }\n for (o = 0; o < this.bitmap.width; o++) {\n for (p = o, r = E[p] * w, i = k[p] * w, n = S[p] * w, a = M[p] * w, f = 1; f <= t; f++) p += f > y ? 0 : this.bitmap.width, r += E[p], i += k[p], n += S[p], a += M[p];\n for (m = o << 2, s = 0; s < this.bitmap.height; s++) b = a * v >>> x, this.bitmap.data[m + 3] = b, b > 255 && (this.bitmap.data[m + 3] = 255), b > 0 ? (b = 255 / b, this.bitmap.data[m] = (r * v >>> x) * b, this.bitmap.data[m + 1] = (i * v >>> x) * b, this.bitmap.data[m + 2] = (n * v >>> x) * b) : (this.bitmap.data[m + 2] = 0, this.bitmap.data[m + 1] = 0, this.bitmap.data[m] = 0), 0 === o && (A[s] = ((u = s + w) < y ? u : y) * this.bitmap.width, I[s] = (u = s - t) > 0 ? u * this.bitmap.width : 0), c = o + A[s], d = o + I[s], r += E[c] - E[d], i += k[c] - k[d], n += S[c] - S[d], a += M[c] - M[d], m += this.bitmap.width << 2;\n }\n }\n return h(e) && e.call(this, null, this), this;\n }\n }), () => ({\n circle() {\n let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},\n e = arguments.length > 1 ? arguments[1] : void 0;\n \"function\" == typeof t && (e = t, t = {});\n const r = t.radius || (this.bitmap.width > this.bitmap.height ? this.bitmap.height : this.bitmap.width) / 2,\n i = \"number\" == typeof t.x ? t.x : this.bitmap.width / 2,\n n = \"number\" == typeof t.y ? t.y : this.bitmap.height / 2;\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, a) {\n const o = Math.sqrt(Math.pow(t - i, 2) + Math.pow(e - n, 2));\n r - o <= 0 ? this.bitmap.data[a + 3] = 0 : r - o < 1 && (this.bitmap.data[a + 3] = 255 * (r - o));\n }), h(e) && e.call(this, null, this), this;\n }\n }), () => ({\n brightness(t, e) {\n return \"number\" != typeof t ? l.call(this, \"val must be numbers\", e) : t < -1 || t > 1 ? l.call(this, \"val must be a number between -1 and +1\", e) : (this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (e, r, i) {\n t < 0 ? (this.bitmap.data[i] *= 1 + t, this.bitmap.data[i + 1] *= 1 + t, this.bitmap.data[i + 2] *= 1 + t) : (this.bitmap.data[i] += (255 - this.bitmap.data[i]) * t, this.bitmap.data[i + 1] += (255 - this.bitmap.data[i + 1]) * t, this.bitmap.data[i + 2] += (255 - this.bitmap.data[i + 2]) * t);\n }), h(e) && e.call(this, null, this), this);\n },\n contrast(t, e) {\n if (\"number\" != typeof t) return l.call(this, \"val must be numbers\", e);\n if (t < -1 || t > 1) return l.call(this, \"val must be a number between -1 and +1\", e);\n const r = (t + 1) / (1 - t);\n function i(t) {\n return (t = Math.floor(r * (t - 127) + 127)) < 0 ? 0 : t > 255 ? 255 : t;\n }\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, r) {\n this.bitmap.data[r] = i(this.bitmap.data[r]), this.bitmap.data[r + 1] = i(this.bitmap.data[r + 1]), this.bitmap.data[r + 2] = i(this.bitmap.data[r + 2]);\n }), h(e) && e.call(this, null, this), this;\n },\n posterize(t, e) {\n return \"number\" != typeof t ? l.call(this, \"n must be numbers\", e) : (t < 2 && (t = 2), this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (e, r, i) {\n this.bitmap.data[i] = Math.floor(this.bitmap.data[i] / 255 * (t - 1)) / (t - 1) * 255, this.bitmap.data[i + 1] = Math.floor(this.bitmap.data[i + 1] / 255 * (t - 1)) / (t - 1) * 255, this.bitmap.data[i + 2] = Math.floor(this.bitmap.data[i + 2] / 255 * (t - 1)) / (t - 1) * 255;\n }), h(e) && e.call(this, null, this), this);\n },\n greyscale: Le,\n grayscale: Le,\n opacity(t, e) {\n return \"number\" != typeof t ? l.call(this, \"f must be a number\", e) : t < 0 || t > 1 ? l.call(this, \"f must be a number from 0 to 1\", e) : (this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (e, r, i) {\n const n = this.bitmap.data[i + 3] * t;\n this.bitmap.data[i + 3] = n;\n }), h(e) && e.call(this, null, this), this);\n },\n sepia(t) {\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, r) {\n let i = this.bitmap.data[r],\n n = this.bitmap.data[r + 1],\n a = this.bitmap.data[r + 2];\n i = .393 * i + .769 * n + .189 * a, n = .349 * i + .686 * n + .168 * a, a = .272 * i + .534 * n + .131 * a, this.bitmap.data[r] = i < 255 ? i : 255, this.bitmap.data[r + 1] = n < 255 ? n : 255, this.bitmap.data[r + 2] = a < 255 ? a : 255;\n }), h(t) && t.call(this, null, this), this;\n },\n fade(t, e) {\n return \"number\" != typeof t ? l.call(this, \"f must be a number\", e) : t < 0 || t > 1 ? l.call(this, \"f must be a number from 0 to 1\", e) : (this.opacity(1 - t), h(e) && e.call(this, null, this), this);\n },\n convolution(t, e, r) {\n \"function\" == typeof e && void 0 === r && (r = e, e = null), e || (e = this.constructor.EDGE_EXTEND);\n const i = Re.from(this.bitmap.data),\n n = t.length,\n a = t[0].length,\n o = Math.floor(n / 2),\n s = Math.floor(a / 2),\n l = -o,\n f = -s;\n let u, c, d, p, m, g, b, _, y, w;\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (r, n, a) {\n p = 0, d = 0, c = 0;\n for (let i = l; i <= o; i++) for (let a = f; a <= s; a++) _ = r + a, y = n + i, u = t[i + o][a + s], w = this.getPixelIndex(_, y, e), -1 === w ? (b = 0, g = 0, m = 0) : (m = this.bitmap.data[w + 0], g = this.bitmap.data[w + 1], b = this.bitmap.data[w + 2]), c += u * m, d += u * g, p += u * b;\n c < 0 && (c = 0), d < 0 && (d = 0), p < 0 && (p = 0), c > 255 && (c = 255), d > 255 && (d = 255), p > 255 && (p = 255), i[a + 0] = c, i[a + 1] = d, i[a + 2] = p;\n }), this.bitmap.data = i, h(r) && r.call(this, null, this), this;\n },\n opaque(t) {\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, r) {\n this.bitmap.data[r + 3] = 255;\n }), h(t) && t.call(this, null, this), this;\n },\n pixelate(t, e, r, i, n, a) {\n if (\"function\" == typeof e) a = e, n = null, i = null, r = null, e = null;else {\n if (\"number\" != typeof t) return l.call(this, \"size must be a number\", a);\n if (Oe(e) && \"number\" != typeof e) return l.call(this, \"x must be a number\", a);\n if (Oe(r) && \"number\" != typeof r) return l.call(this, \"y must be a number\", a);\n if (Oe(i) && \"number\" != typeof i) return l.call(this, \"w must be a number\", a);\n if (Oe(n) && \"number\" != typeof n) return l.call(this, \"h must be a number\", a);\n }\n const o = [[1 / 16, 2 / 16, 1 / 16], [2 / 16, .25, 2 / 16], [1 / 16, 2 / 16, 1 / 16]];\n e = e || 0, r = r || 0, i = Oe(i) ? i : this.bitmap.width - e, n = Oe(n) ? n : this.bitmap.height - r;\n const s = this.cloneQuiet();\n return this.scanQuiet(e, r, i, n, function (e, r, i) {\n e = t * Math.floor(e / t), r = t * Math.floor(r / t);\n const n = Pe(s, o, e, r);\n this.bitmap.data[i] = n[0], this.bitmap.data[i + 1] = n[1], this.bitmap.data[i + 2] = n[2];\n }), h(a) && a.call(this, null, this), this;\n },\n convolute(t, e, r, i, n, a) {\n if (!Array.isArray(t)) return l.call(this, \"the kernel must be an array\", a);\n if (\"function\" == typeof e) a = e, e = null, r = null, i = null, n = null;else {\n if (Oe(e) && \"number\" != typeof e) return l.call(this, \"x must be a number\", a);\n if (Oe(r) && \"number\" != typeof r) return l.call(this, \"y must be a number\", a);\n if (Oe(i) && \"number\" != typeof i) return l.call(this, \"w must be a number\", a);\n if (Oe(n) && \"number\" != typeof n) return l.call(this, \"h must be a number\", a);\n }\n e = Oe(e) ? e : 0, r = Oe(r) ? r : 0, i = Oe(i) ? i : this.bitmap.width - e, n = Oe(n) ? n : this.bitmap.height - r;\n const o = this.cloneQuiet();\n return this.scanQuiet(e, r, i, n, function (e, r, i) {\n const n = Pe(o, t, e, r);\n this.bitmap.data[i] = this.constructor.limit255(n[0]), this.bitmap.data[i + 1] = this.constructor.limit255(n[1]), this.bitmap.data[i + 2] = this.constructor.limit255(n[2]);\n }), h(a) && a.call(this, null, this), this;\n },\n color: Ue,\n colour: Ue\n }), () => ({\n contain(t, e, r, i, n) {\n if (\"number\" != typeof t || \"number\" != typeof e) return l.call(this, \"w and h must be numbers\", n);\n \"string\" == typeof r && (\"function\" == typeof i && void 0 === n && (n = i), i = r, r = null), \"function\" == typeof r && (void 0 === n && (n = r), i = null, r = null), \"function\" == typeof i && void 0 === n && (n = i, i = null);\n const a = 7 & (r = r || this.constructor.HORIZONTAL_ALIGN_CENTER | this.constructor.VERTICAL_ALIGN_MIDDLE),\n o = r >> 3;\n if ((0 === a || a & a - 1) && (0 === o || o & o - 1)) return l.call(this, \"only use one flag per alignment direction\", n);\n const s = a >> 1,\n f = o >> 1,\n u = t / e > this.bitmap.width / this.bitmap.height ? e / this.bitmap.height : t / this.bitmap.width,\n c = this.cloneQuiet().scale(u, i);\n return this.resize(t, e, i), this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, r) {\n this.bitmap.data.writeUInt32BE(this._background, r);\n }), this.blit(c, (this.bitmap.width - c.bitmap.width) / 2 * s, (this.bitmap.height - c.bitmap.height) / 2 * f), h(n) && n.call(this, null, this), this;\n }\n }), () => ({\n cover(t, e, r, i, n) {\n if (\"number\" != typeof t || \"number\" != typeof e) return l.call(this, \"w and h must be numbers\", n);\n r && \"function\" == typeof r && void 0 === n ? (n = r, r = null, i = null) : \"function\" == typeof i && void 0 === n && (n = i, i = null);\n const a = 7 & (r = r || this.constructor.HORIZONTAL_ALIGN_CENTER | this.constructor.VERTICAL_ALIGN_MIDDLE),\n o = r >> 3;\n if ((0 === a || a & a - 1) && (0 === o || o & o - 1)) return l.call(this, \"only use one flag per alignment direction\", n);\n const s = a >> 1,\n f = o >> 1,\n u = t / e > this.bitmap.width / this.bitmap.height ? t / this.bitmap.width : e / this.bitmap.height;\n return this.scale(u, i), this.crop((this.bitmap.width - t) / 2 * s, (this.bitmap.height - e) / 2 * f, t, e), h(n) && n.call(this, null, this), this;\n }\n }), function (t) {\n return t(\"crop\", function (t, e, r, i, n) {\n if (\"number\" != typeof t || \"number\" != typeof e) return l.call(this, \"x and y must be numbers\", n);\n if (\"number\" != typeof r || \"number\" != typeof i) return l.call(this, \"w and h must be numbers\", n);\n if (t = Math.round(t), e = Math.round(e), r = Math.round(r), i = Math.round(i), 0 === t && r === this.bitmap.width) {\n const n = r * e + t << 2,\n a = n + (i * r << 2);\n this.bitmap.data = this.bitmap.data.slice(n, a);\n } else {\n const n = ze.allocUnsafe(r * i * 4);\n let a = 0;\n this.scanQuiet(t, e, r, i, function (t, e, r) {\n const i = this.bitmap.data.readUInt32BE(r, !0);\n n.writeUInt32BE(i, a, !0), a += 4;\n }), this.bitmap.data = n;\n }\n return this.bitmap.width = r, this.bitmap.height = i, h(n) && n.call(this, null, this), this;\n }), {\n class: {\n autocrop() {\n const t = this.bitmap.width,\n e = this.bitmap.height;\n let r,\n i = 0,\n n = 2e-4,\n a = !0,\n o = !1,\n s = {\n north: !1,\n south: !1,\n east: !1,\n west: !1\n };\n for (var l = arguments.length, f = new Array(l), u = 0; u < l; u++) f[u] = arguments[u];\n for (let t = 0, e = f.length; t < e; t++) if (\"number\" == typeof f[t] && (n = f[t]), \"boolean\" == typeof f[t] && (a = f[t]), \"function\" == typeof f[t] && (r = f[t]), \"object\" == typeof f[t]) {\n const e = f[t];\n void 0 !== e.tolerance && ({\n tolerance: n\n } = e), void 0 !== e.cropOnlyFrames && ({\n cropOnlyFrames: a\n } = e), void 0 !== e.cropSymmetric && ({\n cropSymmetric: o\n } = e), void 0 !== e.leaveBorder && ({\n leaveBorder: i\n } = e), void 0 !== e.ignoreSides && ({\n ignoreSides: s\n } = e);\n }\n let c = this.getPixelColor(0, 0);\n const d = this.constructor.intToRGBA(c);\n let p = 0,\n m = 0,\n g = 0,\n b = 0;\n if (c = this.getPixelColor(0, 0), !s.north) t: for (let r = 0; r < e - 1; r++) {\n for (let e = 0; e < t; e++) {\n const t = this.getPixelColor(e, r),\n i = this.constructor.intToRGBA(t);\n if (this.constructor.colorDiff(d, i) > n) break t;\n }\n p++;\n }\n if (c = this.getPixelColor(t, 0), !s.west) t: for (let r = 0; r < t - 1; r++) {\n for (let t = 0 + p; t < e; t++) {\n const e = this.getPixelColor(r, t),\n i = this.constructor.intToRGBA(e);\n if (this.constructor.colorDiff(d, i) > n) break t;\n }\n b++;\n }\n if (c = this.getPixelColor(0, e), !s.south) t: for (let r = e - 1; r >= p + 1; r--) {\n for (let e = t - m - 1; e >= 0; e--) {\n const t = this.getPixelColor(e, r),\n i = this.constructor.intToRGBA(t);\n if (this.constructor.colorDiff(d, i) > n) break t;\n }\n g++;\n }\n if (c = this.getPixelColor(t, e), !s.east) t: for (let r = t - 1; r >= 0 + b + 1; r--) {\n for (let t = e - 1; t >= 0 + p; t--) {\n const e = this.getPixelColor(r, t),\n i = this.constructor.intToRGBA(e);\n if (this.constructor.colorDiff(d, i) > n) break t;\n }\n m++;\n }\n let _ = !1;\n if (b -= i, m -= i, p -= i, g -= i, o) {\n const t = Math.min(m, b),\n e = Math.min(p, g);\n b = t, m = t, p = e, g = e;\n }\n b = b >= 0 ? b : 0, m = m >= 0 ? m : 0, p = p >= 0 ? p : 0, g = g >= 0 ? g : 0;\n const y = t - (b + m),\n w = e - (g + p);\n return _ = a ? 0 !== m && 0 !== p && 0 !== b && 0 !== g : 0 !== m || 0 !== p || 0 !== b || 0 !== g, _ && this.crop(b, p, y, w), h(r) && r.call(this, null, this), this;\n }\n }\n };\n }, () => ({\n displace(t, e, r) {\n if (\"object\" != typeof t || t.constructor !== this.constructor) return l.call(this, \"The source must be a Jimp image\", r);\n if (\"number\" != typeof e) return l.call(this, \"factor must be a number\", r);\n const i = this.cloneQuiet();\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (r, n, a) {\n let o = t.bitmap.data[a] / 256 * e;\n o = Math.round(o);\n const s = this.getPixelIndex(r + o, n);\n this.bitmap.data[s] = i.bitmap.data[a], this.bitmap.data[s + 1] = i.bitmap.data[a + 1], this.bitmap.data[s + 2] = i.bitmap.data[a + 2];\n }), h(r) && r.call(this, null, this), this;\n }\n }), () => ({\n dither565: De,\n dither16: De\n }), () => ({\n fisheye() {\n let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {\n r: 2.5\n },\n e = arguments.length > 1 ? arguments[1] : void 0;\n \"function\" == typeof t && (e = t, t = {\n r: 2.5\n });\n const r = this.cloneQuiet(),\n {\n width: i,\n height: n\n } = r.bitmap;\n return r.scanQuiet(0, 0, i, n, (e, a) => {\n const o = e / i,\n s = a / n,\n h = Math.sqrt(Math.pow(o - .5, 2) + Math.pow(s - .5, 2)),\n l = 2 * Math.pow(h, t.r),\n f = (o - .5) / h,\n u = (s - .5) / h,\n c = Math.round((l * f + .5) * i),\n d = Math.round((l * u + .5) * n),\n p = r.getPixelColor(c, d);\n this.setPixelColor(p, e, a);\n }), this.setPixelColor(r.getPixelColor(i / 2, n / 2), i / 2, n / 2), h(e) && e.call(this, null, this), this;\n }\n }), () => ({\n flip: Fe,\n mirror: Fe\n }), () => ({\n gaussian(t, e) {\n if (\"number\" != typeof t) return l.call(this, \"r must be a number\", e);\n if (t < 1) return l.call(this, \"r must be greater than 0\", e);\n const r = Math.ceil(2.57 * t),\n i = 2 * r + 1,\n n = t * t * 2,\n a = n * Math.PI,\n o = [];\n for (let t = 0; t < i; t++) {\n o[t] = [];\n for (let e = 0; e < i; e++) {\n const i = (e - r) ** 2 + (t - r) ** 2;\n o[t][e] = Math.exp(-i / n) / a;\n }\n }\n for (let t = 0; t < this.bitmap.height; t++) for (let e = 0; e < this.bitmap.width; e++) {\n let n = 0,\n a = 0,\n s = 0,\n h = 0,\n l = 0;\n for (let f = 0; f < i; f++) {\n for (let u = 0; u < i; u++) {\n const i = Math.min(this.bitmap.width - 1, Math.max(0, u + e - r)),\n c = Math.min(this.bitmap.height - 1, Math.max(0, f + t - r)),\n d = o[f][u],\n p = c * this.bitmap.width + i << 2;\n n += this.bitmap.data[p] * d, a += this.bitmap.data[p + 1] * d, s += this.bitmap.data[p + 2] * d, h += this.bitmap.data[p + 3] * d, l += d;\n }\n const u = t * this.bitmap.width + e << 2;\n this.bitmap.data[u] = Math.round(n / l), this.bitmap.data[u + 1] = Math.round(a / l), this.bitmap.data[u + 2] = Math.round(s / l), this.bitmap.data[u + 3] = Math.round(h / l);\n }\n }\n return h(e) && e.call(this, null, this), this;\n }\n }), () => ({\n invert(t) {\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, r) {\n this.bitmap.data[r] = 255 - this.bitmap.data[r], this.bitmap.data[r + 1] = 255 - this.bitmap.data[r + 1], this.bitmap.data[r + 2] = 255 - this.bitmap.data[r + 2];\n }), h(t) && t.call(this, null, this), this;\n }\n }), () => ({\n mask(t) {\n let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,\n r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,\n i = arguments.length > 3 ? arguments[3] : void 0;\n if (!(t instanceof this.constructor)) return l.call(this, \"The source must be a Jimp image\", i);\n if (\"number\" != typeof e || \"number\" != typeof r) return l.call(this, \"x and y must be numbers\", i);\n e = Math.round(e), r = Math.round(r);\n const n = this.bitmap.width,\n a = this.bitmap.height,\n o = this;\n return t.scanQuiet(0, 0, t.bitmap.width, t.bitmap.height, function (t, i, s) {\n const h = e + t,\n l = r + i;\n if (h >= 0 && l >= 0 && h < n && l < a) {\n const t = o.getPixelIndex(h, l),\n {\n data: e\n } = this.bitmap,\n r = (e[s + 0] + e[s + 1] + e[s + 2]) / 3;\n o.bitmap.data[t + 3] *= r / 255;\n }\n }), h(i) && i.call(this, null, this), this;\n }\n }), () => ({\n normalize(t) {\n const e = je.call(this),\n r = {\n r: He(e.r),\n g: He(e.g),\n b: He(e.b)\n };\n return this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (t, e, i) {\n const n = this.bitmap.data[i + 0],\n a = this.bitmap.data[i + 1],\n o = this.bitmap.data[i + 2];\n this.bitmap.data[i + 0] = Ge(n, r.r[0], r.r[1]), this.bitmap.data[i + 1] = Ge(a, r.g[0], r.g[1]), this.bitmap.data[i + 2] = Ge(o, r.b[0], r.b[1]);\n }), h(t) && t.call(this, null, this), this;\n }\n }), () => ({\n constants: {\n measureText: Ze,\n measureTextHeight: Ve,\n FONT_SANS_8_BLACK: a().join(Qe, \"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt\"),\n FONT_SANS_10_BLACK: a().join(Qe, \"fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt\"),\n FONT_SANS_12_BLACK: a().join(Qe, \"fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt\"),\n FONT_SANS_14_BLACK: a().join(Qe, \"fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt\"),\n FONT_SANS_16_BLACK: a().join(Qe, \"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt\"),\n FONT_SANS_32_BLACK: a().join(Qe, \"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt\"),\n FONT_SANS_64_BLACK: a().join(Qe, \"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt\"),\n FONT_SANS_128_BLACK: a().join(Qe, \"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt\"),\n FONT_SANS_8_WHITE: a().join(Qe, \"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt\"),\n FONT_SANS_16_WHITE: a().join(Qe, \"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt\"),\n FONT_SANS_32_WHITE: a().join(Qe, \"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt\"),\n FONT_SANS_64_WHITE: a().join(Qe, \"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt\"),\n FONT_SANS_128_WHITE: a().join(Qe, \"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt\"),\n loadFont(t, e) {\n return \"string\" != typeof t ? l.call(this, \"file must be a string\", e) : new Promise((r, i) => {\n e = e || function (t, e) {\n t ? i(t) : r(e);\n }, qe()(t, (r, i) => {\n const n = {},\n o = {};\n if (r) return l.call(this, r, e);\n for (let t = 0; t < i.chars.length; t++) n[String.fromCharCode(i.chars[t].id)] = i.chars[t];\n for (let t = 0; t < i.kernings.length; t++) {\n const e = String.fromCharCode(i.kernings[t].first);\n o[e] = o[e] || {}, o[e][String.fromCharCode(i.kernings[t].second)] = i.kernings[t].amount;\n }\n (function (t, e, r) {\n const i = r.map(r => t.read(e + \"/\" + r));\n return Promise.all(i);\n })(this, a().dirname(t), i.pages).then(t => {\n e(null, {\n chars: n,\n kernings: o,\n pages: t,\n common: i.common,\n info: i.info\n });\n });\n });\n });\n }\n },\n class: {\n print(t, e, r, i, n, a, o) {\n if (\"function\" == typeof n && void 0 === o && (o = n, n = 1 / 0), void 0 === n && (n = 1 / 0), \"function\" == typeof a && void 0 === o && (o = a, a = 1 / 0), void 0 === a && (a = 1 / 0), \"object\" != typeof t) return l.call(this, \"font must be a Jimp loadFont\", o);\n if (\"number\" != typeof e || \"number\" != typeof r || \"number\" != typeof n) return l.call(this, \"x, y and maxWidth must be numbers\", o);\n if (\"number\" != typeof n) return l.call(this, \"maxWidth must be a number\", o);\n if (\"number\" != typeof a) return l.call(this, \"maxHeight must be a number\", o);\n let s, f;\n \"object\" == typeof i && null !== i.text && void 0 !== i.text ? (s = i.alignmentX || this.constructor.HORIZONTAL_ALIGN_LEFT, f = i.alignmentY || this.constructor.VERTICAL_ALIGN_TOP, ({\n text: i\n } = i)) : (s = this.constructor.HORIZONTAL_ALIGN_LEFT, f = this.constructor.VERTICAL_ALIGN_TOP, i = i.toString()), a !== 1 / 0 && f === this.constructor.VERTICAL_ALIGN_BOTTOM ? r += a - Ve(t, i, n) : a !== 1 / 0 && f === this.constructor.VERTICAL_ALIGN_MIDDLE && (r += a / 2 - Ve(t, i, n) / 2);\n const u = Object.entries(t.chars)[0][1].xadvance,\n {\n lines: c,\n longestLine: d\n } = Ye(t, i, n);\n return c.forEach(i => {\n const a = i.join(\" \"),\n o = function (t, e, r, i, n) {\n return n === t.HORIZONTAL_ALIGN_LEFT ? 0 : n === t.HORIZONTAL_ALIGN_CENTER ? (i - Ze(e, r)) / 2 : i - Ze(e, r);\n }(this.constructor, t, a, n, s);\n Je.call(this, t, e + o, r, a, u), r += t.common.lineHeight;\n }), h(o) && o.call(this, null, this, {\n x: e + d,\n y: r\n }), this;\n }\n }\n }), () => ({\n constants: {\n RESIZE_NEAREST_NEIGHBOR: \"nearestNeighbor\",\n RESIZE_BILINEAR: \"bilinearInterpolation\",\n RESIZE_BICUBIC: \"bicubicInterpolation\",\n RESIZE_HERMITE: \"hermiteInterpolation\",\n RESIZE_BEZIER: \"bezierInterpolation\"\n },\n class: {\n resize(t, e, r, i) {\n if (\"number\" != typeof t || \"number\" != typeof e) return l.call(this, \"w and h must be numbers\", i);\n if (\"function\" == typeof r && void 0 === i && (i = r, r = null), t === this.constructor.AUTO && e === this.constructor.AUTO) return l.call(this, \"w and h cannot both be set to auto\", i);\n if (t === this.constructor.AUTO && (t = this.bitmap.width * (e / this.bitmap.height)), e === this.constructor.AUTO && (e = this.bitmap.height * (t / this.bitmap.width)), t < 0 || e < 0) return l.call(this, \"w and h must be positive numbers\", i);\n if (t = Math.round(t) || 1, e = Math.round(e) || 1, \"function\" == typeof rr[r]) {\n const i = {\n data: ir.alloc(t * e * 4),\n width: t,\n height: e\n };\n rr[r](this.bitmap, i), this.bitmap = i;\n } else {\n const r = this;\n new $e(this.bitmap.width, this.bitmap.height, t, e, !0, !0, i => {\n r.bitmap.data = ir.from(i), r.bitmap.width = t, r.bitmap.height = e;\n }).resize(this.bitmap.data);\n }\n return h(i) && i.call(this, null, this), this;\n }\n }\n }), () => ({\n rotate(t, e, r) {\n return null == e && (e = !0), \"function\" == typeof e && void 0 === r && (r = e, e = !0), \"number\" != typeof t ? l.call(this, \"deg must be a number\", r) : \"boolean\" != typeof e && \"string\" != typeof e ? l.call(this, \"mode must be a boolean or a string\", r) : (t % 90 != 0 || !e && this.bitmap.width !== this.bitmap.height && t % 180 != 0 ? or.call(this, t, e, r) : ar.call(this, t), h(r) && r.call(this, null, this), this);\n }\n }), () => ({\n scale(t, e, r) {\n if (\"number\" != typeof t) return l.call(this, \"f must be a number\", r);\n if (t < 0) return l.call(this, \"f must be a positive number\", r);\n \"function\" == typeof e && void 0 === r && (r = e, e = null);\n const i = this.bitmap.width * t,\n n = this.bitmap.height * t;\n return this.resize(i, n, e), h(r) && r.call(this, null, this), this;\n },\n scaleToFit(t, e, r, i) {\n if (\"number\" != typeof t || \"number\" != typeof e) return l.call(this, \"w and h must be numbers\", i);\n \"function\" == typeof r && void 0 === i && (i = r, r = null);\n const n = t / e > this.bitmap.width / this.bitmap.height ? e / this.bitmap.height : t / this.bitmap.width;\n return this.scale(n, r), h(i) && i.call(this, null, this), this;\n }\n }), () => ({\n shadow() {\n let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},\n e = arguments.length > 1 ? arguments[1] : void 0;\n \"function\" == typeof t && (e = t, t = {});\n const {\n opacity: r = .7,\n size: i = 1.1,\n x: n = -25,\n y: a = 25,\n blur: o = 5\n } = t,\n s = this.clone(),\n l = this.clone();\n return l.scan(0, 0, l.bitmap.width, l.bitmap.height, (t, e, i) => {\n l.bitmap.data[i] = 0, l.bitmap.data[i + 1] = 0, l.bitmap.data[i + 2] = 0, l.bitmap.data[i + 3] = l.constructor.limit255(l.bitmap.data[i + 3] * r), this.bitmap.data[i] = 0, this.bitmap.data[i + 1] = 0, this.bitmap.data[i + 2] = 0, this.bitmap.data[i + 3] = 0;\n }), l.resize(l.bitmap.width * i, l.bitmap.height * i).blur(o), this.composite(l, n, a), this.composite(s, 0, 0), h(e) && e.call(this, null, this), this;\n }\n }), () => ({\n threshold(t, e) {\n let {\n max: r,\n replace: i = 255,\n autoGreyscale: n = !0\n } = t;\n return \"number\" != typeof r ? l.call(this, \"max must be a number\", e) : \"number\" != typeof i ? l.call(this, \"replace must be a number\", e) : \"boolean\" != typeof n ? l.call(this, \"autoGreyscale must be a boolean\", e) : (r = this.constructor.limit255(r), i = this.constructor.limit255(i), n && this.greyscale(), this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, (t, e, n) => {\n const a = this.bitmap.data[n] < r ? this.bitmap.data[n] : i;\n this.bitmap.data[n] = a, this.bitmap.data[n + 1] = a, this.bitmap.data[n + 2] = a;\n }), h(e) && e.call(this, null, this), this);\n }\n })];\n !function (t) {\n let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : oe;\n const r = {\n hasAlpha: {},\n encoders: {},\n decoders: {},\n class: {},\n constants: {}\n };\n function i(t) {\n Object.entries(t).forEach(t => {\n let [e, i] = t;\n r[e] = {\n ...r[e],\n ...i\n };\n });\n }\n t.types && (t.types.forEach(function (t) {\n const e = t();\n Array.isArray(e.mime) ? Ct(...e.mime) : Object.entries(e.mime).forEach(t => Ct(...t)), delete e.mime, i(e);\n }), e.decoders = {\n ...e.decoders,\n ...r.decoders\n }, e.encoders = {\n ...e.encoders,\n ...r.encoders\n }, e.hasAlpha = {\n ...e.hasAlpha,\n ...r.hasAlpha\n }), t.plugins && t.plugins.forEach(function (t) {\n const e = t(ae) || {};\n e.class || e.constants ? i(e) : i({\n class: e\n });\n }), ie(r.class, e), re(r.constants, e);\n }({\n types: [() => (0, se.Ee)(ue(), pe(), {\n mime: {\n [be]: [\"bmp\"]\n },\n constants: {\n MIME_BMP: be,\n MIME_X_MS_BMP: _e\n },\n decoders: {\n [be]: ye,\n [_e]: ye\n },\n encoders: {\n [be]: we,\n [_e]: we\n }\n }, {\n mime: {\n [ke]: [\"tiff\", \"tif\"]\n },\n constants: {\n MIME_TIFF: ke\n },\n decoders: {\n [ke]: t => {\n const e = xe().decode(t),\n r = e[0];\n e.forEach(e => {\n xe().decodeImage(t, e);\n });\n const i = xe().toRGBA8(r);\n return {\n data: Ee.from(i),\n width: r.t256[0],\n height: r.t257[0]\n };\n }\n },\n encoders: {\n [ke]: t => {\n const e = xe().encodeImage(t.bitmap.data, t.bitmap.width, t.bitmap.height);\n return Ee.from(e);\n }\n }\n }, {\n mime: {\n [Ie]: [\"gif\"]\n },\n constants: {\n MIME_GIF: Ie\n },\n decoders: {\n [Ie]: t => {\n const e = new Se.N(t),\n r = Ae.alloc(e.width * e.height * 4);\n return e.decodeAndBlitFrameRGBA(0, r), {\n data: r,\n width: e.width,\n height: e.height\n };\n }\n },\n encoders: {\n [Ie]: t => {\n const e = new Me.BitmapImage(t.bitmap);\n Me.GifUtil.quantizeDekker(e, 256);\n const r = new Me.GifFrame(e);\n return new Me.GifCodec().encodeGif([r], {}).then(t => t.buffer);\n }\n }\n })],\n plugins: [t => {\n const e = sr.map(e => {\n let r = e(t) || {};\n return r.class || r.constants || (r = {\n class: r\n }), r;\n });\n return (0, se.Ee)(...e);\n }]\n });\n })();\n})();\n","//! moment.js\n//! version : 2.30.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory();\n})(this, function () {\n 'use strict';\n\n var hookCallback;\n function hooks() {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback(callback) {\n hookCallback = callback;\n }\n function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n }\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n }\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n for (k in obj) {\n if (hasOwnProp(obj, k)) {\n return false;\n }\n }\n return true;\n }\n }\n function isUndefined(input) {\n return input === void 0;\n }\n function isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n }\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n function map(arr, fn) {\n var res = [],\n i,\n arrLen = arr.length;\n for (i = 0; i < arrLen; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n return a;\n }\n function createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidEra: null,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n era: null,\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false\n };\n }\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this),\n len = t.length >>> 0,\n i;\n for (i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n return false;\n };\n }\n function isValid(m) {\n var flags = null,\n parsedParts = false,\n isNowValid = m._d && !isNaN(m._d.getTime());\n if (isNowValid) {\n flags = getParsingFlags(m);\n parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);\n if (m._strict) {\n isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined;\n }\n }\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n return m._isValid;\n }\n function createInvalid(flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n return m;\n }\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n var momentProperties = hooks.momentProperties = [],\n updateInProgress = false;\n function copyConfig(to, from) {\n var i,\n prop,\n val,\n momentPropertiesLen = momentProperties.length;\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n if (momentPropertiesLen > 0) {\n for (i = 0; i < momentPropertiesLen; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n return to;\n }\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n function isMoment(obj) {\n return obj instanceof Moment || obj != null && obj._isAMomentObject != null;\n }\n function warn(msg) {\n if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n function deprecate(msg, fn) {\n var firstTime = true;\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [],\n arg,\n i,\n key,\n argLen = arguments.length;\n for (i = 0; i < argLen; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (key in arguments[0]) {\n if (hasOwnProp(arguments[0], key)) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + new Error().stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n var deprecations = {};\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n function isFunction(input) {\n return typeof Function !== 'undefined' && input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n function set(config) {\n var prop, i;\n for (i in config) {\n if (hasOwnProp(config, i)) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\\d{1,2}/.source);\n }\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n var keys;\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i,\n res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n var defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L'\n };\n function calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n formatFunctions = {},\n formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n return function (mom) {\n var output = '',\n i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n return formatFunctions[format](m);\n }\n function expandFormat(format, locale) {\n var i = 5;\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n return format;\n }\n var defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A'\n };\n function longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n if (format || !formatUpper) {\n return format;\n }\n this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function (tok) {\n if (tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd') {\n return tok.slice(1);\n }\n return tok;\n }).join('');\n return this._longDateFormat[key];\n }\n var defaultInvalidDate = 'Invalid date';\n function invalidDate() {\n return this._invalidDate;\n }\n var defaultOrdinal = '%d',\n defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n function ordinal(number) {\n return this._ordinal.replace('%d', number);\n }\n var defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years'\n };\n function relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);\n }\n function pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n var aliases = {\n D: 'date',\n dates: 'date',\n date: 'date',\n d: 'day',\n days: 'day',\n day: 'day',\n e: 'weekday',\n weekdays: 'weekday',\n weekday: 'weekday',\n E: 'isoWeekday',\n isoweekdays: 'isoWeekday',\n isoweekday: 'isoWeekday',\n DDD: 'dayOfYear',\n dayofyears: 'dayOfYear',\n dayofyear: 'dayOfYear',\n h: 'hour',\n hours: 'hour',\n hour: 'hour',\n ms: 'millisecond',\n milliseconds: 'millisecond',\n millisecond: 'millisecond',\n m: 'minute',\n minutes: 'minute',\n minute: 'minute',\n M: 'month',\n months: 'month',\n month: 'month',\n Q: 'quarter',\n quarters: 'quarter',\n quarter: 'quarter',\n s: 'second',\n seconds: 'second',\n second: 'second',\n gg: 'weekYear',\n weekyears: 'weekYear',\n weekyear: 'weekYear',\n GG: 'isoWeekYear',\n isoweekyears: 'isoWeekYear',\n isoweekyear: 'isoWeekYear',\n w: 'week',\n weeks: 'week',\n week: 'week',\n W: 'isoWeek',\n isoweeks: 'isoWeek',\n isoweek: 'isoWeek',\n y: 'year',\n years: 'year',\n year: 'year'\n };\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n return normalizedInput;\n }\n var priorities = {\n date: 9,\n day: 11,\n weekday: 11,\n isoWeekday: 11,\n dayOfYear: 4,\n hour: 13,\n millisecond: 16,\n minute: 14,\n month: 8,\n quarter: 7,\n second: 15,\n weekYear: 1,\n isoWeekYear: 1,\n week: 5,\n isoWeek: 5,\n year: 1\n };\n function getPrioritizedUnits(unitsObj) {\n var units = [],\n u;\n for (u in unitsObj) {\n if (hasOwnProp(unitsObj, u)) {\n units.push({\n unit: u,\n priority: priorities[u]\n });\n }\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n var match1 = /\\d/,\n // 0 - 9\n match2 = /\\d\\d/,\n // 00 - 99\n match3 = /\\d{3}/,\n // 000 - 999\n match4 = /\\d{4}/,\n // 0000 - 9999\n match6 = /[+-]?\\d{6}/,\n // -999999 - 999999\n match1to2 = /\\d\\d?/,\n // 0 - 99\n match3to4 = /\\d\\d\\d\\d?/,\n // 999 - 9999\n match5to6 = /\\d\\d\\d\\d\\d\\d?/,\n // 99999 - 999999\n match1to3 = /\\d{1,3}/,\n // 0 - 999\n match1to4 = /\\d{1,4}/,\n // 0 - 9999\n match1to6 = /[+-]?\\d{1,6}/,\n // -999999 - 999999\n matchUnsigned = /\\d+/,\n // 0 - inf\n matchSigned = /[+-]?\\d+/,\n // -inf - inf\n matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi,\n // +00:00 -00:00 +0000 -0000 or Z\n matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi,\n // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/,\n // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n match1to2NoLeadingZero = /^[1-9]\\d?/,\n // 1-99\n match1to2HasZero = /^([1-9]\\d|\\d)/,\n // 0-99\n regexes;\n regexes = {};\n function addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n }\n function getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n }\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n function absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n return value;\n }\n var tokens = {};\n function addParseToken(token, callback) {\n var i,\n func = callback,\n tokenLen;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n tokenLen = token.length;\n for (i = 0; i < tokenLen; i++) {\n tokens[token[i]] = func;\n }\n }\n function addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n function isLeapYear(year) {\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n }\n var YEAR = 0,\n MONTH = 1,\n DATE = 2,\n HOUR = 3,\n MINUTE = 4,\n SECOND = 5,\n MILLISECOND = 6,\n WEEK = 7,\n WEEKDAY = 8;\n\n // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n });\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n // HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n function getIsLeapYear() {\n return isLeapYear(this.year());\n }\n function makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n function get(mom, unit) {\n if (!mom.isValid()) {\n return NaN;\n }\n var d = mom._d,\n isUTC = mom._isUTC;\n switch (unit) {\n case 'Milliseconds':\n return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();\n case 'Seconds':\n return isUTC ? d.getUTCSeconds() : d.getSeconds();\n case 'Minutes':\n return isUTC ? d.getUTCMinutes() : d.getMinutes();\n case 'Hours':\n return isUTC ? d.getUTCHours() : d.getHours();\n case 'Date':\n return isUTC ? d.getUTCDate() : d.getDate();\n case 'Day':\n return isUTC ? d.getUTCDay() : d.getDay();\n case 'Month':\n return isUTC ? d.getUTCMonth() : d.getMonth();\n case 'FullYear':\n return isUTC ? d.getUTCFullYear() : d.getFullYear();\n default:\n return NaN;\n // Just in case\n }\n }\n function set$1(mom, unit, value) {\n var d, isUTC, year, month, date;\n if (!mom.isValid() || isNaN(value)) {\n return;\n }\n d = mom._d;\n isUTC = mom._isUTC;\n switch (unit) {\n case 'Milliseconds':\n return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));\n case 'Seconds':\n return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));\n case 'Minutes':\n return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));\n case 'Hours':\n return void (isUTC ? d.setUTCHours(value) : d.setHours(value));\n case 'Date':\n return void (isUTC ? d.setUTCDate(value) : d.setDate(value));\n // case 'Day': // Not real\n // return void (isUTC ? d.setUTCDay(value) : d.setDay(value));\n // case 'Month': // Not used because we need to pass two variables\n // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));\n case 'FullYear':\n break;\n // See below ...\n default:\n return;\n // Just in case\n }\n year = value;\n month = mom.month();\n date = mom.date();\n date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;\n void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));\n }\n\n // MOMENTS\n\n function stringGet(units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n function stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units),\n i,\n prioritizedLen = prioritized.length;\n for (i = 0; i < prioritizedLen; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n function mod(n, x) {\n return (n % x + x) % x;\n }\n var indexOf;\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // PARSING\n\n addRegexToken('M', match1to2, match1to2NoLeadingZero);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n defaultMonthsShortRegex = matchWord,\n defaultMonthsRegex = matchWord;\n function localeMonths(m, format) {\n if (!m) {\n return isArray(this._months) ? this._months : this._months['standalone'];\n }\n return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n }\n function localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n function handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n function localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth(mom, value) {\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n var month = value,\n date = mom.date();\n date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));\n void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));\n return mom;\n }\n function getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n function getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n }\n function monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n }\n function monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;\n }\n }\n function computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n shortP,\n longP;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortP = regexEscape(this.monthsShort(mom, ''));\n longP = regexEscape(this.months(mom, ''));\n shortPieces.push(shortP);\n longPieces.push(longP);\n mixedPieces.push(longP);\n mixedPieces.push(shortP);\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n }\n function createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date;\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n return date;\n }\n function createUTCDate(y) {\n var date, args;\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n args = Array.prototype.slice.call(arguments);\n // preserve leap years using a full 400 year cycle, then reset\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n return date;\n }\n\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var\n // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n return -fwdlw + fwd - 1;\n }\n\n // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n }\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n return {\n week: resWeek,\n year: resYear\n };\n }\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n // FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // PARSING\n\n addRegexToken('w', match1to2, match1to2NoLeadingZero);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2, match1to2NoLeadingZero);\n addRegexToken('WW', match1to2, match2);\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n // HELPERS\n\n // LOCALES\n\n function localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n var defaultLocaleWeek = {\n dow: 0,\n // Sunday is the first day of the week.\n doy: 6 // The week that contains Jan 6th is the first week of the year.\n };\n function localeFirstDayOfWeek() {\n return this._week.dow;\n }\n function localeFirstDayOfYear() {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n function getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n return null;\n }\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n // LOCALES\n function shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n defaultWeekdaysRegex = matchWord,\n defaultWeekdaysShortRegex = matchWord,\n defaultWeekdaysMinRegex = matchWord;\n function localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone'];\n return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;\n }\n function localeWeekdaysShort(m) {\n return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n }\n function localeWeekdaysMin(m) {\n return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n }\n function handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n function localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$', 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = get(this, 'Day');\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n function getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n function getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n function weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n function weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n function weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n function computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = regexEscape(this.weekdaysMin(mom, ''));\n shortp = regexEscape(this.weekdaysShort(mom, ''));\n longp = regexEscape(this.weekdays(mom, ''));\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n }\n\n // FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n function kFormat() {\n return this.hours() || 24;\n }\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n addFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);\n });\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n addFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);\n });\n function meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n meridiem('a', true);\n meridiem('A', false);\n\n // PARSING\n\n function matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n }\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2, match1to2HasZero);\n addRegexToken('h', match1to2, match1to2NoLeadingZero);\n addRegexToken('k', match1to2, match1to2NoLeadingZero);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n // LOCALES\n\n function localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n }\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n getSetHour = makeGetSet('Hours', true);\n function localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n week: defaultLocaleWeek,\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n meridiemParse: defaultLocaleMeridiemParse\n };\n\n // internal storage for locale config files\n var locales = {},\n localeFamilies = {},\n globalLocale;\n function commonPrefix(arr1, arr2) {\n var i,\n minl = Math.min(arr1.length, arr2.length);\n for (i = 0; i < minl; i += 1) {\n if (arr1[i] !== arr2[i]) {\n return i;\n }\n }\n return minl;\n }\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }\n function isLocaleNameSane(name) {\n // Prevent names that look like filesystem paths, i.e contain '/' or '\\'\n // Ensure name is available and function returns boolean\n return !!(name && name.match('^[^/\\\\\\\\]*$'));\n }\n function loadLocale(name) {\n var oldLocale = null,\n aliasedRequire;\n // TODO: Find a better way to register and load all the locales in Node\n if (locales[name] === undefined && typeof module !== 'undefined' && module && module.exports && isLocaleNameSane(name)) {\n try {\n oldLocale = globalLocale._abbr;\n aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {\n // mark as not found to avoid repeating expensive file require call causing high CPU\n // when trying to find en-US, en_US, en-us for every format call\n locales[name] = null; // null means not found\n }\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n return globalLocale._abbr;\n }\n function defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple('defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n function updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig;\n if (locales[name] != null && locales[name].parentLocale != null) {\n // Update existing child locale in-place to avoid memory-leaks\n locales[name].set(mergeConfigs(locales[name]._config, config));\n } else {\n // MERGE\n tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n config = mergeConfigs(parentConfig, config);\n if (tmpLocale == null) {\n // updateLocale is called for creating a new locale\n // Set abbr so it will have a name (getters return\n // undefined otherwise).\n config.abbr = name;\n }\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n }\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n if (name === getSetGlobalLocale()) {\n getSetGlobalLocale(name);\n }\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n // returns locale data\n function getLocale(key) {\n var locale;\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n if (!key) {\n return globalLocale;\n }\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n return chooseLocale(key);\n }\n function listLocales() {\n return keys(locales);\n }\n function checkOverflow(m) {\n var overflow,\n a = m._a;\n if (a && getParsingFlags(m).overflow === -2) {\n overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n getParsingFlags(m).overflow = overflow;\n }\n return m;\n }\n\n // iso 8601 regex\n // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n isoDates = [['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/], ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/], ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/], ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false], ['YYYY-DDD', /\\d{4}-\\d{3}/], ['YYYY-MM', /\\d{4}-\\d\\d/, false], ['YYYYYYMMDD', /[+-]\\d{10}/], ['YYYYMMDD', /\\d{8}/], ['GGGG[W]WWE', /\\d{4}W\\d{3}/], ['GGGG[W]WW', /\\d{4}W\\d{2}/, false], ['YYYYDDD', /\\d{7}/], ['YYYYMM', /\\d{6}/, false], ['YYYY', /\\d{4}/, false]],\n // iso time formats and regexes\n isoTimes = [['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/], ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/], ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/], ['HH:mm', /\\d\\d:\\d\\d/], ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/], ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/], ['HHmmss', /\\d\\d\\d\\d\\d\\d/], ['HHmm', /\\d\\d\\d\\d/], ['HH', /\\d\\d/]],\n aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60\n };\n\n // date from iso format\n function configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat,\n isoDatesLen = isoDates.length,\n isoTimesLen = isoTimes.length;\n if (match) {\n getParsingFlags(config).iso = true;\n for (i = 0, l = isoDatesLen; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimesLen; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)];\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n return result;\n }\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n return year;\n }\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s.replace(/\\([^()]*\\)|[\\n\\t]/g, ' ').replace(/(\\s\\s+)/g, ' ').replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n return true;\n }\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10),\n m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n }\n\n // date and time from ref 2822 format\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i)),\n parsedArray;\n if (match) {\n parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n if (config._strict) {\n config._isValid = false;\n } else {\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n }\n hooks.createFromInputFallback = deprecate('value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n });\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n if (config._d) {\n return;\n }\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n curWeek = weekOfYear(createLocal(), dow, doy);\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n // constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n // constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0,\n era,\n tokenLen;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n tokenLen = tokens.length;\n for (i = 0; i < tokenLen; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n // handle era\n era = getParsingFlags(config).era;\n if (era !== null) {\n config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n }\n configFromArray(config);\n checkOverflow(config);\n }\n function meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n // date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n scoreToBeat,\n i,\n currentScore,\n validFormatFound,\n bestFormatIsValid = false,\n configfLen = config._f.length;\n if (configfLen === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n for (i = 0; i < configfLen; i++) {\n currentScore = 0;\n validFormatFound = false;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n if (isValid(tempConfig)) {\n validFormatFound = true;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n getParsingFlags(tempConfig).score = currentScore;\n if (!bestFormatIsValid) {\n if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n if (validFormatFound) {\n bestFormatIsValid = true;\n }\n }\n } else {\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n }\n extend(config, bestMoment || tempConfig);\n }\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n var i = normalizeObjectUnits(config._i),\n dayOrDate = i.day === undefined ? i.date : i.day;\n config._a = map([i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n configFromArray(config);\n }\n function createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n return res;\n }\n function prepareConfig(config) {\n var input = config._i,\n format = config._f;\n config._locale = config._locale || getLocale(config._l);\n if (input === null || format === undefined && input === '') {\n return createInvalid({\n nullInput: true\n });\n }\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n if (!isValid(config)) {\n config._d = null;\n }\n return config;\n }\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n function createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n if (format === true || format === false) {\n strict = format;\n format = undefined;\n }\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n return createFromConfig(c);\n }\n function createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }),\n prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n });\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min() {\n var args = [].slice.call(arguments, 0);\n return pickBy('isBefore', args);\n }\n function max() {\n var args = [].slice.call(arguments, 0);\n return pickBy('isAfter', args);\n }\n var now = function () {\n return Date.now ? Date.now() : +new Date();\n };\n var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\n function isDurationValid(m) {\n var key,\n unitHasDecimal = false,\n i,\n orderLen = ordering.length;\n for (key in m) {\n if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {\n return false;\n }\n }\n for (i = 0; i < orderLen; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n return true;\n }\n function isValid$1() {\n return this._isValid;\n }\n function createInvalid$1() {\n return createDuration(NaN);\n }\n function Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds + seconds * 1e3 +\n // 1000\n minutes * 6e4 +\n // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days + weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months + quarters * 3 + years * 12;\n this._data = {};\n this._locale = getLocale();\n this._bubble();\n }\n function isDuration(obj) {\n return obj instanceof Duration;\n }\n function absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n // compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n // FORMATTING\n\n function offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset(),\n sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2);\n });\n }\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher),\n chunk,\n parts,\n minutes;\n if (matches === null) {\n return null;\n }\n chunk = matches[matches.length - 1] || [];\n parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n minutes = +(parts[1] * 60) + toInt(parts[2]);\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n function getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset());\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n this.utcOffset(input, keepLocalTime);\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n function setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n function setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n function setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n function hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n return (this.utcOffset() - input) % 60 === 0;\n }\n function isDaylightSavingTime() {\n return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();\n }\n function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n var c = {},\n other;\n copyConfig(c, this);\n c = prepareConfig(c);\n if (c._a) {\n other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n return this._isDSTShifted;\n }\n function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n }\n function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n }\n function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n // ASP.NET json date format regex\n var aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n isoRegex = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n function createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months\n };\n } else if (isNumber(input) || !isNaN(+input)) {\n duration = {};\n if (key) {\n duration[key] = +input;\n } else {\n duration.milliseconds = +input;\n }\n } else if (match = aspNetRegex.exec(input)) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n };\n } else if (match = isoRegex.exec(input)) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign)\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n ret = new Duration(duration);\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n ret._isValid = input._isValid;\n }\n return ret;\n }\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n function positiveMomentsDifference(base, other) {\n var res = {};\n res.months = other.month() - base.month() + (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n return res;\n }\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return {\n milliseconds: 0,\n months: 0\n };\n }\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n return res;\n }\n\n // TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val;\n val = period;\n period = tmp;\n }\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n function addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n if (!mom.isValid()) {\n // No op\n return;\n }\n updateOffset = updateOffset == null ? true : updateOffset;\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n var add = createAdder(1, 'add'),\n subtract = createAdder(-1, 'subtract');\n function isString(input) {\n return typeof input === 'string' || input instanceof String;\n }\n\n // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\n function isMomentInput(input) {\n return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined;\n }\n function isMomentInputObject(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = ['years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms'],\n i,\n property,\n propertyLen = properties.length;\n for (i = 0; i < propertyLen; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n return objectTest && propertyTest;\n }\n function isNumberOrStringArray(input) {\n var arrayTest = isArray(input),\n dataTypeTest = false;\n if (arrayTest) {\n dataTypeTest = input.filter(function (item) {\n return !isNumber(item) && isString(input);\n }).length === 0;\n }\n return arrayTest && dataTypeTest;\n }\n function isCalendarSpec(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = ['sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse'],\n i,\n property;\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n return objectTest && propertyTest;\n }\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse';\n }\n function calendar$1(time, formats) {\n // Support for single parameter, formats only overload to the calendar function\n if (arguments.length === 1) {\n if (!arguments[0]) {\n time = undefined;\n formats = undefined;\n } else if (isMomentInput(arguments[0])) {\n time = arguments[0];\n formats = undefined;\n } else if (isCalendarSpec(arguments[0])) {\n formats = arguments[0];\n time = undefined;\n }\n }\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse',\n output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n }\n function clone() {\n return new Moment(this);\n }\n function isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n function isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n function isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));\n }\n function isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n }\n function isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n function isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n function diff(input, units, asFloat) {\n var that, zoneDelta, output;\n if (!this.isValid()) {\n return NaN;\n }\n that = cloneWithOffset(input, this);\n if (!that.isValid()) {\n return NaN;\n }\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n units = normalizeUnits(units);\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n case 'month':\n output = monthDiff(this, that);\n break;\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n case 'second':\n output = (this - that) / 1e3;\n break;\n // 1000\n case 'minute':\n output = (this - that) / 6e4;\n break;\n // 1000 * 60\n case 'hour':\n output = (this - that) / 36e5;\n break;\n // 1000 * 60 * 60\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break;\n // 1000 * 60 * 60 * 24, negate dst\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break;\n // 1000 * 60 * 60 * 24 * 7, negate dst\n default:\n output = this - that;\n }\n return asFloat ? output : absFloor(output);\n }\n function monthDiff(a, b) {\n if (a.date() < b.date()) {\n // end-of-month calculations work correct when the start month has more\n // days than the end month.\n return -monthDiff(b, a);\n }\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n function toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n var utc = keepOffset !== true,\n m = utc ? this.clone().utc() : this;\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));\n }\n }\n return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment',\n zone = '',\n prefix,\n year,\n datetime,\n suffix;\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n prefix = '[' + func + '(\"]';\n year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n datetime = '-MM-DD[T]HH:mm:ss.SSS';\n suffix = zone + '[\")]';\n return this.format(prefix + year + datetime + suffix);\n }\n function format(inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n function from(time, withoutSuffix) {\n if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {\n return createDuration({\n to: this,\n from: time\n }).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n function fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n function to(time, withoutSuffix) {\n if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {\n return createDuration({\n from: this,\n to: time\n }).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n function toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n function locale(key) {\n var newLocaleData;\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n });\n function localeData() {\n return this._locale;\n }\n var MS_PER_SECOND = 1000,\n MS_PER_MINUTE = 60 * MS_PER_SECOND,\n MS_PER_HOUR = 60 * MS_PER_MINUTE,\n MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n // actual modulo - handles negative numbers (for dates before 1970):\n function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n function startOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3, 1);\n break;\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday());\n break;\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);\n break;\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n function endOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n case 'quarter':\n time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;\n break;\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n case 'week':\n time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;\n break;\n case 'isoWeek':\n time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n case 'hour':\n time = this._d.valueOf();\n time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;\n break;\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n function valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n }\n function unix() {\n return Math.floor(this.valueOf() / 1000);\n }\n function toDate() {\n return new Date(this.valueOf());\n }\n function toArray() {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n function toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n function toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n function isValid$2() {\n return isValid(this);\n }\n function parsingFlags() {\n return extend({}, getParsingFlags(this));\n }\n function invalidAt() {\n return getParsingFlags(this).overflow;\n }\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n }\n addFormatToken('N', 0, 0, 'eraAbbr');\n addFormatToken('NN', 0, 0, 'eraAbbr');\n addFormatToken('NNN', 0, 0, 'eraAbbr');\n addFormatToken('NNNN', 0, 0, 'eraName');\n addFormatToken('NNNNN', 0, 0, 'eraNarrow');\n addFormatToken('y', ['y', 1], 'yo', 'eraYear');\n addFormatToken('y', ['yy', 2], 0, 'eraYear');\n addFormatToken('y', ['yyy', 3], 0, 'eraYear');\n addFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n addRegexToken('N', matchEraAbbr);\n addRegexToken('NN', matchEraAbbr);\n addRegexToken('NNN', matchEraAbbr);\n addRegexToken('NNNN', matchEraName);\n addRegexToken('NNNNN', matchEraNarrow);\n addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (input, array, config, token) {\n var era = config._locale.erasParse(input, token, config._strict);\n if (era) {\n getParsingFlags(config).era = era;\n } else {\n getParsingFlags(config).invalidEra = input;\n }\n });\n addRegexToken('y', matchUnsigned);\n addRegexToken('yy', matchUnsigned);\n addRegexToken('yyy', matchUnsigned);\n addRegexToken('yyyy', matchUnsigned);\n addRegexToken('yo', matchEraYearOrdinal);\n addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\n addParseToken(['yo'], function (input, array, config, token) {\n var match;\n if (config._locale._eraYearOrdinalRegex) {\n match = input.match(config._locale._eraYearOrdinalRegex);\n }\n if (config._locale.eraYearOrdinalParse) {\n array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n } else {\n array[YEAR] = parseInt(input, 10);\n }\n });\n function localeEras(m, format) {\n var i,\n l,\n date,\n eras = this._eras || getLocale('en')._eras;\n for (i = 0, l = eras.length; i < l; ++i) {\n switch (typeof eras[i].since) {\n case 'string':\n // truncate time\n date = hooks(eras[i].since).startOf('day');\n eras[i].since = date.valueOf();\n break;\n }\n switch (typeof eras[i].until) {\n case 'undefined':\n eras[i].until = +Infinity;\n break;\n case 'string':\n // truncate time\n date = hooks(eras[i].until).startOf('day').valueOf();\n eras[i].until = date.valueOf();\n break;\n }\n }\n return eras;\n }\n function localeErasParse(eraName, format, strict) {\n var i,\n l,\n eras = this.eras(),\n name,\n abbr,\n narrow;\n eraName = eraName.toUpperCase();\n for (i = 0, l = eras.length; i < l; ++i) {\n name = eras[i].name.toUpperCase();\n abbr = eras[i].abbr.toUpperCase();\n narrow = eras[i].narrow.toUpperCase();\n if (strict) {\n switch (format) {\n case 'N':\n case 'NN':\n case 'NNN':\n if (abbr === eraName) {\n return eras[i];\n }\n break;\n case 'NNNN':\n if (name === eraName) {\n return eras[i];\n }\n break;\n case 'NNNNN':\n if (narrow === eraName) {\n return eras[i];\n }\n break;\n }\n } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n return eras[i];\n }\n }\n }\n function localeErasConvertYear(era, year) {\n var dir = era.since <= era.until ? +1 : -1;\n if (year === undefined) {\n return hooks(era.since).year();\n } else {\n return hooks(era.since).year() + (year - era.offset) * dir;\n }\n }\n function getEraName() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].name;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].name;\n }\n }\n return '';\n }\n function getEraNarrow() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].narrow;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].narrow;\n }\n }\n return '';\n }\n function getEraAbbr() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].abbr;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].abbr;\n }\n }\n return '';\n }\n function getEraYear() {\n var i,\n l,\n dir,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n // truncate time\n val = this.clone().startOf('day').valueOf();\n if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) {\n return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset;\n }\n }\n return this.year();\n }\n function erasNameRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNameRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNameRegex : this._erasRegex;\n }\n function erasAbbrRegex(isStrict) {\n if (!hasOwnProp(this, '_erasAbbrRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasAbbrRegex : this._erasRegex;\n }\n function erasNarrowRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNarrowRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNarrowRegex : this._erasRegex;\n }\n function matchEraAbbr(isStrict, locale) {\n return locale.erasAbbrRegex(isStrict);\n }\n function matchEraName(isStrict, locale) {\n return locale.erasNameRegex(isStrict);\n }\n function matchEraNarrow(isStrict, locale) {\n return locale.erasNarrowRegex(isStrict);\n }\n function matchEraYearOrdinal(isStrict, locale) {\n return locale._eraYearOrdinalRegex || matchUnsigned;\n }\n function computeErasParse() {\n var abbrPieces = [],\n namePieces = [],\n narrowPieces = [],\n mixedPieces = [],\n i,\n l,\n erasName,\n erasAbbr,\n erasNarrow,\n eras = this.eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n erasName = regexEscape(eras[i].name);\n erasAbbr = regexEscape(eras[i].abbr);\n erasNarrow = regexEscape(eras[i].narrow);\n namePieces.push(erasName);\n abbrPieces.push(erasAbbr);\n narrowPieces.push(erasNarrow);\n mixedPieces.push(erasName);\n mixedPieces.push(erasAbbr);\n mixedPieces.push(erasNarrow);\n }\n this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n this._erasNarrowRegex = new RegExp('^(' + narrowPieces.join('|') + ')', 'i');\n }\n\n // FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n function addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n // MOMENTS\n\n function getSetWeekYear(input) {\n return getSetWeekYearHelper.call(this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy);\n }\n function getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4);\n }\n function getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n }\n function getISOWeeksInISOWeekYear() {\n return weeksInYear(this.isoWeekYear(), 1, 4);\n }\n function getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n function getWeeksInWeekYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n }\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n // FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter(input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n }\n\n // FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // PARSING\n\n addRegexToken('D', match1to2, match1to2NoLeadingZero);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient;\n });\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n // MOMENTS\n\n function getSetDayOfYear(input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // PARSING\n\n addRegexToken('m', match1to2, match1to2HasZero);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // PARSING\n\n addRegexToken('s', match1to2, match1to2HasZero);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n var token, getSetMillisecond;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n getSetMillisecond = makeGetSet('Milliseconds', false);\n\n // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n }\n function getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n var proto = Moment.prototype;\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n if (typeof Symbol !== 'undefined' && Symbol.for != null) {\n proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n return 'Moment<' + this.format() + '>';\n };\n }\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.eraName = getEraName;\n proto.eraNarrow = getEraNarrow;\n proto.eraAbbr = getEraAbbr;\n proto.eraYear = getEraYear;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.weeksInWeekYear = getWeeksInWeekYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\n proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n function createUnix(input) {\n return createLocal(input * 1000);\n }\n function createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n }\n function preParsePostFormat(string) {\n return string;\n }\n var proto$1 = Locale.prototype;\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n proto$1.eras = localeEras;\n proto$1.erasParse = localeErasParse;\n proto$1.erasConvertYear = localeErasConvertYear;\n proto$1.erasAbbrRegex = erasAbbrRegex;\n proto$1.erasNameRegex = erasNameRegex;\n proto$1.erasNarrowRegex = erasNarrowRegex;\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n function get$1(format, index, field, setter) {\n var locale = getLocale(),\n utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n function listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n format = format || '';\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n var i,\n out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n function listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n format = format || '';\n }\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0,\n i,\n out = [];\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n function listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n function listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n function listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n function listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n function listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n getSetGlobalLocale('en', {\n eras: [{\n since: '0001-01-01',\n until: +Infinity,\n offset: 1,\n name: 'Anno Domini',\n narrow: 'AD',\n abbr: 'AD'\n }, {\n since: '0000-12-31',\n until: -Infinity,\n offset: 1,\n name: 'Before Christ',\n narrow: 'BC',\n abbr: 'BC'\n }],\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';\n return number + output;\n }\n });\n\n // Side effect imports\n\n hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\n hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n var mathAbs = Math.abs;\n function abs() {\n var data = this._data;\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n return this;\n }\n function addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n function absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n function bubble() {\n var milliseconds = this._milliseconds,\n days = this._days,\n months = this._months,\n data = this._data,\n seconds,\n minutes,\n hours,\n years,\n monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n data.days = days;\n data.months = months;\n data.years = years;\n return this;\n }\n function daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n function monthsToDays(months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n function as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days,\n months,\n milliseconds = this._milliseconds;\n units = normalizeUnits(units);\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n switch (units) {\n case 'month':\n return months;\n case 'quarter':\n return months / 3;\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n case 'day':\n return days + milliseconds / 864e5;\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n }\n function makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n }\n var asMilliseconds = makeAs('ms'),\n asSeconds = makeAs('s'),\n asMinutes = makeAs('m'),\n asHours = makeAs('h'),\n asDays = makeAs('d'),\n asWeeks = makeAs('w'),\n asMonths = makeAs('M'),\n asQuarters = makeAs('Q'),\n asYears = makeAs('y'),\n valueOf$1 = asMilliseconds;\n function clone$1() {\n return createDuration(this);\n }\n function get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n var milliseconds = makeGetter('milliseconds'),\n seconds = makeGetter('seconds'),\n minutes = makeGetter('minutes'),\n hours = makeGetter('hours'),\n days = makeGetter('days'),\n months = makeGetter('months'),\n years = makeGetter('years');\n function weeks() {\n return absFloor(this.days() / 7);\n }\n var round = Math.round,\n thresholds = {\n ss: 44,\n // a few seconds to seconds\n s: 45,\n // seconds to minute\n m: 45,\n // minutes to hour\n h: 22,\n // hours to day\n d: 26,\n // days to month/week\n w: null,\n // weeks to month\n M: 11 // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n var duration = createDuration(posNegDuration).abs(),\n seconds = round(duration.as('s')),\n minutes = round(duration.as('m')),\n hours = round(duration.as('h')),\n days = round(duration.as('d')),\n months = round(duration.as('M')),\n weeks = round(duration.as('w')),\n years = round(duration.as('y')),\n a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days];\n if (thresholds.w != null) {\n a = a || weeks <= 1 && ['w'] || weeks < thresholds.w && ['ww', weeks];\n }\n a = a || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years];\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n // This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n function humanize(argWithSuffix, argThresholds) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n var withSuffix = false,\n th = thresholds,\n locale,\n output;\n if (typeof argWithSuffix === 'object') {\n argThresholds = argWithSuffix;\n argWithSuffix = false;\n }\n if (typeof argWithSuffix === 'boolean') {\n withSuffix = argWithSuffix;\n }\n if (typeof argThresholds === 'object') {\n th = Object.assign({}, thresholds, argThresholds);\n if (argThresholds.s != null && argThresholds.ss == null) {\n th.ss = argThresholds.s - 1;\n }\n }\n locale = this.localeData();\n output = relativeTime$1(this, !withSuffix, th, locale);\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n return locale.postformat(output);\n }\n var abs$1 = Math.abs;\n function sign(x) {\n return (x > 0) - (x < 0) || +x;\n }\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n var seconds = abs$1(this._milliseconds) / 1000,\n days = abs$1(this._days),\n months = abs$1(this._months),\n minutes,\n hours,\n years,\n s,\n total = this.asSeconds(),\n totalSign,\n ymSign,\n daysSign,\n hmsSign;\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n totalSign = total < 0 ? '-' : '';\n ymSign = sign(this._months) !== sign(total) ? '-' : '';\n daysSign = sign(this._days) !== sign(total) ? '-' : '';\n hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n return totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '');\n }\n var proto$2 = Duration.prototype;\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\n proto$2.lang = lang;\n\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n //! moment.js\n\n hooks.version = '2.30.1';\n setHookCallback(createLocal);\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n // currently HTML5 input type only supports 24-hour formats\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm',\n // \n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss',\n // \n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS',\n // \n DATE: 'YYYY-MM-DD',\n // \n TIME: 'HH:mm',\n // \n TIME_SECONDS: 'HH:mm:ss',\n // \n TIME_MS: 'HH:mm:ss.SSS',\n // \n WEEK: 'GGGG-[W]WW',\n // \n MONTH: 'YYYY-MM' // \n };\n return hooks;\n});","/**\n * @license Angular v17.3.0\n * (c) 2010-2022 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 assertConsumerNode(node);\n if (node.liveConsumerNode.length === 0) {\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 assertConsumerNode(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) {\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}\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}\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, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, 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 let Observable = /*#__PURE__*/(() => {\n 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 }\n Observable.create = subscribe => {\n return new Observable(subscribe);\n };\n return Observable;\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 { 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 let Subject = /*#__PURE__*/(() => {\n 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 }\n Subject.create = (destination, source) => {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\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","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 { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\nexport const async = asyncScheduler;\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 */\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;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, 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 = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i;\n function verb(n) {\n if (g[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 }\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;\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 }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\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 function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function (e) {\n fail(e);\n return next();\n });\n } catch (e) {\n fail(e);\n }\n }\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","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 { asyncScheduler } from '../scheduler/async';\nimport { timer } from './timer';\nexport function interval(period = 0, scheduler = asyncScheduler) {\n if (period < 0) {\n period = 0;\n }\n return timer(period, period, scheduler);\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","const {\n isArray\n} = Array;\nexport function argsOrArgArray(args) {\n return args.length === 1 && isArray(args[0]) ? args[0] : args;\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 { Observable } from '../Observable';\nimport { innerFrom } from './innerFrom';\nimport { argsOrArgArray } from '../util/argsOrArgArray';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nexport function race(...sources) {\n sources = argsOrArgArray(sources);\n return sources.length === 1 ? innerFrom(sources[0]) : new Observable(raceInit(sources));\n}\nexport function raceInit(sources) {\n return subscriber => {\n let subscriptions = [];\n for (let i = 0; subscriptions && !subscriber.closed && i < sources.length; i++) {\n subscriptions.push(innerFrom(sources[i]).subscribe(createOperatorSubscriber(subscriber, value => {\n if (subscriptions) {\n for (let s = 0; s < subscriptions.length; s++) {\n s !== i && subscriptions[s].unsubscribe();\n }\n subscriptions = null;\n }\n subscriber.next(value);\n })));\n }\n };\n}\n","import { Observable } from '../Observable';\nimport { innerFrom } from './innerFrom';\nimport { argsOrArgArray } from '../util/argsOrArgArray';\nimport { EMPTY } from './empty';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { popResultSelector } from '../util/args';\nexport function zip(...args) {\n const resultSelector = popResultSelector(args);\n const sources = argsOrArgArray(args);\n return sources.length ? new Observable(subscriber => {\n let buffers = sources.map(() => []);\n let completed = sources.map(() => false);\n subscriber.add(() => {\n buffers = completed = null;\n });\n for (let sourceIndex = 0; !subscriber.closed && sourceIndex < sources.length; sourceIndex++) {\n innerFrom(sources[sourceIndex]).subscribe(createOperatorSubscriber(subscriber, value => {\n buffers[sourceIndex].push(value);\n if (buffers.every(buffer => buffer.length)) {\n const result = buffers.map(buffer => buffer.shift());\n subscriber.next(resultSelector ? resultSelector(...result) : result);\n if (buffers.some((buffer, i) => !buffer.length && completed[i])) {\n subscriber.complete();\n }\n }\n }, () => {\n completed[sourceIndex] = true;\n !buffers[sourceIndex].length && subscriber.complete();\n }));\n }\n return () => {\n buffers = completed = null;\n };\n }) : EMPTY;\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 { 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 { concat } from '../observable/concat';\nimport { of } from '../observable/of';\nexport function endWith(...values) {\n return source => concat(source, of(...values));\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 { 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 { 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 { 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","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nimport { identity } from '../util/identity';\nimport { noop } from '../util/noop';\nimport { popResultSelector } from '../util/args';\nexport function withLatestFrom(...inputs) {\n const project = popResultSelector(inputs);\n return operate((source, subscriber) => {\n const len = inputs.length;\n const otherValues = new Array(len);\n let hasValue = inputs.map(() => false);\n let ready = false;\n for (let i = 0; i < len; i++) {\n innerFrom(inputs[i]).subscribe(createOperatorSubscriber(subscriber, value => {\n otherValues[i] = value;\n if (!ready && !hasValue[i]) {\n hasValue[i] = true;\n (ready = hasValue.every(identity)) && (hasValue = null);\n }\n }, noop));\n }\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n if (ready) {\n const values = [value, ...otherValues];\n subscriber.next(project ? project(...values) : values);\n }\n }));\n });\n}\n","/**\n * @license Angular v17.3.0\n * (c) 2010-2022 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';\nimport { Subject, Subscription, BehaviorSubject } from 'rxjs';\nimport { map, first } from 'rxjs/operators';\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.io/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__ = /*#__PURE__*/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: ``,\n * })\n * export class ParentComponent {\n * @Input() hideParent: boolean;\n * }\n *\n *\n * @Component({\n * standalone: true,\n * imports: [CommonModule, forwardRef(() => ParentComponent)],\n * selector: 'app-child',\n * template: ``,\n * })\n * export class ChildComponent {\n * @Input() hideParent: boolean;\n * }\n * ```\n *\n * @publicApi\n */\nfunction forwardRef(forwardRefFn) {\n forwardRefFn.__forward_ref__ = forwardRef;\n forwardRefFn.toString = function () {\n return stringify(this());\n };\n return forwardRefFn;\n}\n/**\n * Lazily retrieves the reference value from a forwardRef.\n *\n * Acts as the identity function when given a non-forward-ref value.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n *\n * @see {@link forwardRef}\n * @publicApi\n */\nfunction resolveForwardRef(type) {\n return isForwardRef(type) ? type() : type;\n}\n/** Checks whether a function is wrapped by a `forwardRef`. */\nfunction isForwardRef(fn) {\n return typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) && fn.__forward_ref__ === forwardRef;\n}\n\n// The functions in this file verify that the assumptions we are making\nfunction assertNumber(actual, msg) {\n if (!(typeof actual === 'number')) {\n throwError(msg, typeof actual, 'number', '===');\n }\n}\nfunction assertNumberInRange(actual, minInclusive, maxInclusive) {\n assertNumber(actual, 'Expected a number');\n assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to');\n assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to');\n}\nfunction assertString(actual, msg) {\n if (!(typeof actual === 'string')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');\n }\n}\nfunction assertFunction(actual, msg) {\n if (!(typeof actual === 'function')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'function', '===');\n }\n}\nfunction assertEqual(actual, expected, msg) {\n if (!(actual == expected)) {\n throwError(msg, actual, expected, '==');\n }\n}\nfunction assertNotEqual(actual, expected, msg) {\n if (!(actual != expected)) {\n throwError(msg, actual, expected, '!=');\n }\n}\nfunction assertSame(actual, expected, msg) {\n if (!(actual === expected)) {\n throwError(msg, actual, expected, '===');\n }\n}\nfunction assertNotSame(actual, expected, msg) {\n if (!(actual !== expected)) {\n throwError(msg, actual, expected, '!==');\n }\n}\nfunction assertLessThan(actual, expected, msg) {\n if (!(actual < expected)) {\n throwError(msg, actual, expected, '<');\n }\n}\nfunction assertLessThanOrEqual(actual, expected, msg) {\n if (!(actual <= expected)) {\n throwError(msg, actual, expected, '<=');\n }\n}\nfunction assertGreaterThan(actual, expected, msg) {\n if (!(actual > expected)) {\n throwError(msg, actual, expected, '>');\n }\n}\nfunction assertGreaterThanOrEqual(actual, expected, msg) {\n if (!(actual >= expected)) {\n throwError(msg, actual, expected, '>=');\n }\n}\nfunction assertNotDefined(actual, msg) {\n if (actual != null) {\n throwError(msg, actual, null, '==');\n }\n}\nfunction assertDefined(actual, msg) {\n if (actual == null) {\n throwError(msg, actual, null, '!=');\n }\n}\nfunction throwError(msg, actual, expected, comparison) {\n throw new Error(`ASSERTION ERROR: ${msg}` + (comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));\n}\nfunction assertDomNode(node) {\n if (!(node instanceof Node)) {\n throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);\n }\n}\nfunction assertElement(node) {\n if (!(node instanceof Element)) {\n throwError(`The provided value must be an element but got ${stringify(node)}`);\n }\n}\nfunction assertIndexInRange(arr, index) {\n assertDefined(arr, 'Array must be defined.');\n const maxLen = arr.length;\n if (index < 0 || index >= maxLen) {\n throwError(`Index expected to be less than ${maxLen} but got ${index}`);\n }\n}\nfunction assertOneOf(value, ...validValues) {\n if (validValues.indexOf(value) !== -1) return true;\n throwError(`Expected value to be one of ${JSON.stringify(validValues)} but was ${JSON.stringify(value)}.`);\n}\nfunction assertNotReactive(fn) {\n if (getActiveConsumer$1() !== null) {\n throwError(`${fn}() should never be called in a reactive context.`);\n }\n}\n\n/**\n * Construct an injectable definition which defines how a token will be constructed by the DI\n * system, and in which injectors (if any) it will be available.\n *\n * This should be assigned to a static `ɵprov` field on a type, which will then be an\n * `InjectableType`.\n *\n * Options:\n * * `providedIn` determines which injectors will include the injectable, by either associating it\n * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be\n * provided in the `'root'` injector, which will be the application-level injector in most apps.\n * * `factory` gives the zero argument function which will create an instance of the injectable.\n * The factory can call [`inject`](api/core/inject) to access the `Injector` and request injection\n * of dependencies.\n *\n * @codeGenApi\n * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.\n */\nfunction ɵɵdefineInjectable(opts) {\n return {\n token: opts.token,\n providedIn: opts.providedIn || null,\n factory: opts.factory,\n value: undefined\n };\n}\n/**\n * @deprecated in v8, delete after v10. This API should be used only by generated code, and that\n * code should now use ɵɵdefineInjectable instead.\n * @publicApi\n */\nconst defineInjectable = ɵɵdefineInjectable;\n/**\n * Construct an `InjectorDef` which configures an injector.\n *\n * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an\n * `InjectorType`.\n *\n * Options:\n *\n * * `providers`: an optional array of providers to add to the injector. Each provider must\n * either have a factory or point to a type which has a `ɵprov` static property (the\n * type must be an `InjectableType`).\n * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s\n * whose providers will also be added to the injector. Locally provided types will override\n * providers from imports.\n *\n * @codeGenApi\n */\nfunction ɵɵdefineInjector(options) {\n return {\n providers: options.providers || [],\n imports: options.imports || []\n };\n}\n/**\n * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading\n * inherited value.\n *\n * @param type A type which may have its own (non-inherited) `ɵprov`.\n */\nfunction getInjectableDef(type) {\n return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);\n}\nfunction isInjectable(type) {\n return getInjectableDef(type) !== null;\n}\n/**\n * Return definition only if it is defined directly on `type` and is not inherited from a base\n * class of `type`.\n */\nfunction getOwnDefinition(type, field) {\n return type.hasOwnProperty(field) ? type[field] : null;\n}\n/**\n * Read the injectable def (`ɵprov`) for `type` or read the `ɵprov` from one of its ancestors.\n *\n * @param type A type which may have `ɵprov`, via inheritance.\n *\n * @deprecated Will be removed in a future version of Angular, where an error will occur in the\n * scenario if we find the `ɵprov` on an ancestor only.\n */\nfunction getInheritedInjectableDef(type) {\n const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);\n if (def) {\n ngDevMode && console.warn(`DEPRECATED: DI is instantiating a token \"${type.name}\" that inherits its @Injectable decorator but does not provide one itself.\\n` + `This will become an error in a future version of Angular. Please add @Injectable() to the \"${type.name}\" class.`);\n return def;\n } else {\n return null;\n }\n}\n/**\n * Read the injector def type in a way which is immune to accidentally reading inherited value.\n *\n * @param type type which may have an injector def (`ɵinj`)\n */\nfunction getInjectorDef(type) {\n return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF)) ? type[NG_INJ_DEF] : null;\n}\nconst NG_PROV_DEF = /*#__PURE__*/getClosureSafeProperty({\n ɵprov: getClosureSafeProperty\n});\nconst NG_INJ_DEF = /*#__PURE__*/getClosureSafeProperty({\n ɵinj: getClosureSafeProperty\n});\n// We need to keep these around so we can read off old defs if new defs are unavailable\nconst NG_INJECTABLE_DEF = /*#__PURE__*/getClosureSafeProperty({\n ngInjectableDef: getClosureSafeProperty\n});\nconst NG_INJECTOR_DEF = /*#__PURE__*/getClosureSafeProperty({\n ngInjectorDef: getClosureSafeProperty\n});\n\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n * runtime representation) such as when injecting an interface, callable type, array or\n * parameterized type.\n *\n * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n * the `Injector`. This provides an additional level of type safety.\n *\n *
\n *\n * **Important Note**: Ensure that you use the same instance of the `InjectionToken` in both the\n * provider and the injection call. Creating a new instance of `InjectionToken` in different places,\n * even with the same description, will be treated as different tokens by Angular's DI system,\n * leading to a `NullInjectorError`.\n *\n *
\n *\n * \n *\n * When creating an `InjectionToken`, you can optionally specify a factory function which returns\n * (possibly by creating) a default value of the parameterized type `T`. This sets up the\n * `InjectionToken` using this factory as a provider as if it was defined explicitly in the\n * application's root injector. If the factory function, which takes zero arguments, needs to inject\n * dependencies, it can do so using the [`inject`](api/core/inject) function.\n * As you can see in the Tree-shakable InjectionToken example below.\n *\n * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which\n * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:\n * this option is now deprecated). As mentioned above, `'root'` is the default value for\n * `providedIn`.\n *\n * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.\n *\n * @usageNotes\n * ### Basic Examples\n *\n * ### Plain InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='InjectionToken'}\n *\n * ### Tree-shakable InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n *\n * @publicApi\n */\nclass InjectionToken {\n /**\n * @param _desc Description for the token,\n * used only for debugging purposes,\n * it should but does not need to be unique\n * @param options Options for the token's usage, as described above\n */\n constructor(_desc, options) {\n this._desc = _desc;\n /** @internal */\n this.ngMetadataName = 'InjectionToken';\n this.ɵprov = undefined;\n if (typeof options == 'number') {\n (typeof ngDevMode === 'undefined' || ngDevMode) && assertLessThan(options, 0, 'Only negative numbers are supported here');\n // This is a special hack to assign __NG_ELEMENT_ID__ to this instance.\n // See `InjectorMarkers`\n this.__NG_ELEMENT_ID__ = options;\n } else if (options !== undefined) {\n this.ɵprov = ɵɵdefineInjectable({\n token: this,\n providedIn: options.providedIn || 'root',\n factory: options.factory\n });\n }\n }\n /**\n * @internal\n */\n get multi() {\n return this;\n }\n toString() {\n return `InjectionToken ${this._desc}`;\n }\n}\nlet _injectorProfilerContext;\nfunction getInjectorProfilerContext() {\n !ngDevMode && throwError('getInjectorProfilerContext should never be called in production mode');\n return _injectorProfilerContext;\n}\nfunction setInjectorProfilerContext(context) {\n !ngDevMode && throwError('setInjectorProfilerContext should never be called in production mode');\n const previous = _injectorProfilerContext;\n _injectorProfilerContext = context;\n return previous;\n}\nlet injectorProfilerCallback = null;\n/**\n * Sets the callback function which will be invoked during certain DI events within the\n * runtime (for example: injecting services, creating injectable instances, configuring providers)\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable profiling.\n */\nconst setInjectorProfiler = injectorProfiler => {\n !ngDevMode && throwError('setInjectorProfiler should never be called in production mode');\n injectorProfilerCallback = injectorProfiler;\n};\n/**\n * Injector profiler function which emits on DI events executed by the runtime.\n *\n * @param event InjectorProfilerEvent corresponding to the DI event being emitted\n */\nfunction injectorProfiler(event) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n if (injectorProfilerCallback != null /* both `null` and `undefined` */) {\n injectorProfilerCallback(event);\n }\n}\n/**\n * Emits an InjectorProfilerEventType.ProviderConfigured to the injector profiler. The data in the\n * emitted event includes the raw provider, as well as the token that provider is providing.\n *\n * @param eventProvider A provider object\n */\nfunction emitProviderConfiguredEvent(eventProvider, isViewProvider = false) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n let token;\n // if the provider is a TypeProvider (typeof provider is function) then the token is the\n // provider itself\n if (typeof eventProvider === 'function') {\n token = eventProvider;\n }\n // if the provider is an injection token, then the token is the injection token.\n else if (eventProvider instanceof InjectionToken) {\n token = eventProvider;\n }\n // in all other cases we can access the token via the `provide` property of the provider\n else {\n token = resolveForwardRef(eventProvider.provide);\n }\n let provider = eventProvider;\n // Injection tokens may define their own default provider which gets attached to the token itself\n // as `ɵprov`. In this case, we want to emit the provider that is attached to the token, not the\n // token itself.\n if (eventProvider instanceof InjectionToken) {\n provider = eventProvider.ɵprov || eventProvider;\n }\n injectorProfiler({\n type: 2 /* InjectorProfilerEventType.ProviderConfigured */,\n context: getInjectorProfilerContext(),\n providerRecord: {\n token,\n provider,\n isViewProvider\n }\n });\n}\n/**\n * Emits an event to the injector profiler with the instance that was created. Note that\n * the injector associated with this emission can be accessed by using getDebugInjectContext()\n *\n * @param instance an object created by an injector\n */\nfunction emitInstanceCreatedByInjectorEvent(instance) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */,\n context: getInjectorProfilerContext(),\n instance: {\n value: instance\n }\n });\n}\n/**\n * @param token DI token associated with injected service\n * @param value the instance of the injected service (i.e the result of `inject(token)`)\n * @param flags the flags that the token was injected with\n */\nfunction emitInjectEvent(token, value, flags) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 0 /* InjectorProfilerEventType.Inject */,\n context: getInjectorProfilerContext(),\n service: {\n token,\n value,\n flags\n }\n });\n}\nfunction runInInjectorProfilerContext(injector, token, callback) {\n !ngDevMode && throwError('runInInjectorProfilerContext should never be called in production mode');\n const prevInjectContext = setInjectorProfilerContext({\n injector,\n token\n });\n try {\n callback();\n } finally {\n setInjectorProfilerContext(prevInjectContext);\n }\n}\nfunction isEnvironmentProviders(value) {\n return value && !!value.ɵproviders;\n}\nconst NG_COMP_DEF = /*#__PURE__*/getClosureSafeProperty({\n ɵcmp: getClosureSafeProperty\n});\nconst NG_DIR_DEF = /*#__PURE__*/getClosureSafeProperty({\n ɵdir: getClosureSafeProperty\n});\nconst NG_PIPE_DEF = /*#__PURE__*/getClosureSafeProperty({\n ɵpipe: getClosureSafeProperty\n});\nconst NG_MOD_DEF = /*#__PURE__*/getClosureSafeProperty({\n ɵmod: getClosureSafeProperty\n});\nconst NG_FACTORY_DEF = /*#__PURE__*/getClosureSafeProperty({\n ɵfac: getClosureSafeProperty\n});\n/**\n * If a directive is diPublic, bloomAdd sets a property on the type with this constant as\n * the key and the directive's unique ID as the value. This allows us to map directives to their\n * bloom filter bit for DI.\n */\n// TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.\nconst NG_ELEMENT_ID = /*#__PURE__*/getClosureSafeProperty({\n __NG_ELEMENT_ID__: getClosureSafeProperty\n});\n/**\n * The `NG_ENV_ID` field on a DI token indicates special processing in the `EnvironmentInjector`:\n * getting such tokens from the `EnvironmentInjector` will bypass the standard DI resolution\n * strategy and instead will return implementation produced by the `NG_ENV_ID` factory function.\n *\n * This particular retrieval of DI tokens is mostly done to eliminate circular dependencies and\n * improve tree-shaking.\n */\nconst NG_ENV_ID = /*#__PURE__*/getClosureSafeProperty({\n __NG_ENV_ID__: getClosureSafeProperty\n});\n\n/**\n * Used for stringify render output in Ivy.\n * Important! This function is very performance-sensitive and we should\n * be extra careful not to introduce megamorphic reads in it.\n * Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations.\n */\nfunction renderStringify(value) {\n if (typeof value === 'string') return value;\n if (value == null) return '';\n // Use `String` so that it invokes the `toString` method of the value. Note that this\n // appears to be faster than calling `value.toString` (see `render_stringify` benchmark).\n return String(value);\n}\n/**\n * Used to stringify a value so that it can be displayed in an error message.\n *\n * Important! This function contains a megamorphic read and should only be\n * used for error messages.\n */\nfunction stringifyForError(value) {\n if (typeof value === 'function') return value.name || value.toString();\n if (typeof value === 'object' && value != null && typeof value.type === 'function') {\n return value.type.name || value.type.toString();\n }\n return renderStringify(value);\n}\n/**\n * Used to stringify a `Type` and including the file path and line number in which it is defined, if\n * possible, for better debugging experience.\n *\n * Important! This function contains a megamorphic read and should only be used for error messages.\n */\nfunction debugStringifyTypeForError(type) {\n // TODO(pmvald): Do some refactoring so that we can use getComponentDef here without creating\n // circular deps.\n let componentDef = type[NG_COMP_DEF] || null;\n if (componentDef !== null && componentDef.debugInfo) {\n return stringifyTypeFromDebugInfo(componentDef.debugInfo);\n }\n return stringifyForError(type);\n}\n// TODO(pmvald): Do some refactoring so that we can use the type ClassDebugInfo for the param\n// debugInfo here without creating circular deps.\nfunction stringifyTypeFromDebugInfo(debugInfo) {\n if (!debugInfo.filePath || !debugInfo.lineNumber) {\n return debugInfo.className;\n } else {\n return `${debugInfo.className} (at ${debugInfo.filePath}:${debugInfo.lineNumber})`;\n }\n}\n\n/** Called when directives inject each other (creating a circular dependency) */\nfunction throwCyclicDependencyError(token, path) {\n const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';\n throw new RuntimeError(-200 /* RuntimeErrorCode.CYCLIC_DI_DEPENDENCY */, ngDevMode ? `Circular dependency in DI detected for ${token}${depPath}` : token);\n}\nfunction throwMixedMultiProviderError() {\n throw new Error(`Cannot mix multi providers and regular providers`);\n}\nfunction throwInvalidProviderError(ngModuleType, providers, provider) {\n if (ngModuleType && providers) {\n const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...');\n throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`);\n } else if (isEnvironmentProviders(provider)) {\n if (provider.ɵfromNgModule) {\n throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`);\n } else {\n throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers.`);\n }\n } else {\n throw new Error('Invalid provider');\n }\n}\n/** Throws an error when a token is not found in DI. */\nfunction throwProviderNotFoundError(token, injectorName) {\n const errorMessage = ngDevMode && `No provider for ${stringifyForError(token)} found${injectorName ? ` in ${injectorName}` : ''}`;\n throw new RuntimeError(-201 /* RuntimeErrorCode.PROVIDER_NOT_FOUND */, errorMessage);\n}\n\n/**\n * Injection flags for DI.\n *\n * @publicApi\n * @deprecated use an options object for [`inject`](api/core/inject) instead.\n */\nvar InjectFlags = /*#__PURE__*/function (InjectFlags) {\n // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer\n // writes exports of it into ngfactory files.\n /** Check self and check parent injector if needed */\n InjectFlags[InjectFlags[\"Default\"] = 0] = \"Default\";\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n InjectFlags[InjectFlags[\"Host\"] = 1] = \"Host\";\n /** Don't ascend to ancestors of the node requesting injection. */\n InjectFlags[InjectFlags[\"Self\"] = 2] = \"Self\";\n /** Skip the node that is requesting injection. */\n InjectFlags[InjectFlags[\"SkipSelf\"] = 4] = \"SkipSelf\";\n /** Inject `defaultValue` instead if token not found. */\n InjectFlags[InjectFlags[\"Optional\"] = 8] = \"Optional\";\n return InjectFlags;\n}(InjectFlags || {});\n/**\n * Current implementation of inject.\n *\n * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed\n * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this\n * way for two reasons:\n * 1. `Injector` should not depend on ivy logic.\n * 2. To maintain tree shake-ability we don't want to bring in unnecessary code.\n */\nlet _injectImplementation;\nfunction getInjectImplementation() {\n return _injectImplementation;\n}\n/**\n * Sets the current inject implementation.\n */\nfunction setInjectImplementation(impl) {\n const previous = _injectImplementation;\n _injectImplementation = impl;\n return previous;\n}\n/**\n * Injects `root` tokens in limp mode.\n *\n * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to\n * `\"root\"`. This is known as the limp mode injection. In such case the value is stored in the\n * injectable definition.\n */\nfunction injectRootLimpMode(token, notFoundValue, flags) {\n const injectableDef = getInjectableDef(token);\n if (injectableDef && injectableDef.providedIn == 'root') {\n return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() : injectableDef.value;\n }\n if (flags & InjectFlags.Optional) return null;\n if (notFoundValue !== undefined) return notFoundValue;\n throwProviderNotFoundError(token, 'Injector');\n}\n/**\n * Assert that `_injectImplementation` is not `fn`.\n *\n * This is useful, to prevent infinite recursion.\n *\n * @param fn Function which it should not equal to\n */\nfunction assertInjectImplementationNotEqual(fn) {\n ngDevMode && assertNotEqual(_injectImplementation, fn, 'Calling ɵɵinject would cause infinite recursion');\n}\nconst _THROW_IF_NOT_FOUND = {};\nconst THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n/*\n * Name of a property (that we patch onto DI decorator), which is used as an annotation of which\n * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators\n * in the code, thus making them tree-shakable.\n */\nconst DI_DECORATOR_FLAG = '__NG_DI_FLAG__';\nconst NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';\nconst NG_TOKEN_PATH = 'ngTokenPath';\nconst NEW_LINE = /\\n/gm;\nconst NO_NEW_LINE = 'ɵ';\nconst SOURCE = '__source';\n/**\n * Current injector value used by `inject`.\n * - `undefined`: it is an error to call `inject`\n * - `null`: `inject` can be called but there is no injector (limp-mode).\n * - Injector instance: Use the injector for resolution.\n */\nlet _currentInjector = undefined;\nfunction getCurrentInjector() {\n return _currentInjector;\n}\nfunction setCurrentInjector(injector) {\n const former = _currentInjector;\n _currentInjector = injector;\n return former;\n}\nfunction injectInjectorOnly(token, flags = InjectFlags.Default) {\n if (_currentInjector === undefined) {\n throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode && `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \\`runInInjectionContext\\`.`);\n } else if (_currentInjector === null) {\n return injectRootLimpMode(token, undefined, flags);\n } else {\n const value = _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);\n ngDevMode && emitInjectEvent(token, value, flags);\n return value;\n }\n}\nfunction ɵɵinject(token, flags = InjectFlags.Default) {\n return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);\n}\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nfunction ɵɵinvalidFactoryDep(index) {\n throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode && `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\n\nPlease check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);\n}\n/**\n * Injects a token from the currently active injector.\n * `inject` is only supported in an [injection context](/guide/dependency-injection-context). It can\n * be used during:\n * - Construction (via the `constructor`) of a class being instantiated by the DI system, such\n * as an `@Injectable` or `@Component`.\n * - In the initializer for fields of such classes.\n * - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`.\n * - In the `factory` function specified for an `InjectionToken`.\n * - In a stackframe of a function call in a DI context\n *\n * @param token A token that represents a dependency that should be injected.\n * @param flags Optional flags that control how injection is executed.\n * The flags correspond to injection strategies that can be specified with\n * parameter decorators `@Host`, `@Self`, `@SkipSelf`, and `@Optional`.\n * @returns the injected value if operation is successful, `null` otherwise.\n * @throws if called outside of a supported context.\n *\n * @usageNotes\n * In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a\n * field initializer:\n *\n * ```typescript\n * @Injectable({providedIn: 'root'})\n * export class Car {\n * radio: Radio|undefined;\n * // OK: field initializer\n * spareTyre = inject(Tyre);\n *\n * constructor() {\n * // OK: constructor body\n * this.radio = inject(Radio);\n * }\n * }\n * ```\n *\n * It is also legal to call `inject` from a provider's factory:\n *\n * ```typescript\n * providers: [\n * {provide: Car, useFactory: () => {\n * // OK: a class factory\n * const engine = inject(Engine);\n * return new Car(engine);\n * }}\n * ]\n * ```\n *\n * Calls to the `inject()` function outside of the class creation context will result in error. Most\n * notably, calls to `inject()` are disallowed after a class instance was created, in methods\n * (including lifecycle hooks):\n *\n * ```typescript\n * @Component({ ... })\n * export class CarComponent {\n * ngOnInit() {\n * // ERROR: too late, the component instance was already created\n * const engine = inject(Engine);\n * engine.start();\n * }\n * }\n * ```\n *\n * @publicApi\n */\nfunction inject(token, flags = InjectFlags.Default) {\n // The `as any` here _shouldn't_ be necessary, but without it JSCompiler\n // throws a disambiguation error due to the multiple signatures.\n return ɵɵinject(token, convertToBitFlags(flags));\n}\n// Converts object-based DI flags (`InjectOptions`) to bit flags (`InjectFlags`).\nfunction convertToBitFlags(flags) {\n if (typeof flags === 'undefined' || typeof flags === 'number') {\n return flags;\n }\n // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in\n // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from\n // `InjectOptions` to `InjectFlags`.\n return 0 /* InternalInjectFlags.Default */ | (\n // comment to force a line break in the formatter\n flags.optional && 8 /* InternalInjectFlags.Optional */) | (flags.host && 1 /* InternalInjectFlags.Host */) | (flags.self && 2 /* InternalInjectFlags.Self */) | (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */);\n}\nfunction injectArgs(types) {\n const args = [];\n for (let i = 0; i < types.length; i++) {\n const arg = resolveForwardRef(types[i]);\n if (Array.isArray(arg)) {\n if (arg.length === 0) {\n throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');\n }\n let type = undefined;\n let flags = InjectFlags.Default;\n for (let j = 0; j < arg.length; j++) {\n const meta = arg[j];\n const flag = getInjectFlag(meta);\n if (typeof flag === 'number') {\n // Special case when we handle @Inject decorator.\n if (flag === -1 /* DecoratorFlags.Inject */) {\n type = meta.token;\n } else {\n flags |= flag;\n }\n } else {\n type = meta;\n }\n }\n args.push(ɵɵinject(type, flags));\n } else {\n args.push(ɵɵinject(arg));\n }\n }\n return args;\n}\n/**\n * Attaches a given InjectFlag to a given decorator using monkey-patching.\n * Since DI decorators can be used in providers `deps` array (when provider is configured using\n * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we\n * attach the flag to make it available both as a static property and as a field on decorator\n * instance.\n *\n * @param decorator Provided DI decorator.\n * @param flag InjectFlag that should be applied.\n */\nfunction attachInjectFlag(decorator, flag) {\n decorator[DI_DECORATOR_FLAG] = flag;\n decorator.prototype[DI_DECORATOR_FLAG] = flag;\n return decorator;\n}\n/**\n * Reads monkey-patched property that contains InjectFlag attached to a decorator.\n *\n * @param token Token that may contain monkey-patched DI flags property.\n */\nfunction getInjectFlag(token) {\n return token[DI_DECORATOR_FLAG];\n}\nfunction catchInjectorError(e, token, injectorErrorName, source) {\n const tokenPath = e[NG_TEMP_TOKEN_PATH];\n if (token[SOURCE]) {\n tokenPath.unshift(token[SOURCE]);\n }\n e.message = formatError('\\n' + e.message, tokenPath, injectorErrorName, source);\n e[NG_TOKEN_PATH] = tokenPath;\n e[NG_TEMP_TOKEN_PATH] = null;\n throw e;\n}\nfunction formatError(text, obj, injectorErrorName, source = null) {\n text = text && text.charAt(0) === '\\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text;\n let context = stringify(obj);\n if (Array.isArray(obj)) {\n context = obj.map(stringify).join(' -> ');\n } else if (typeof obj === 'object') {\n let parts = [];\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n let value = obj[key];\n parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));\n }\n }\n context = `{${parts.join(', ')}}`;\n }\n return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\\n ')}`;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Inject = /*#__PURE__*/attachInjectFlag(\n/*#__PURE__*/\n// Disable tslint because `DecoratorFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nmakeParamDecorator('Inject', token => ({\n token\n})), -1 /* DecoratorFlags.Inject */);\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Optional =\n/*#__PURE__*/\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag( /*#__PURE__*/makeParamDecorator('Optional'), 8 /* InternalInjectFlags.Optional */);\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Self =\n/*#__PURE__*/\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag( /*#__PURE__*/makeParamDecorator('Self'), 2 /* InternalInjectFlags.Self */);\n/**\n * `SkipSelf` decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst SkipSelf =\n/*#__PURE__*/\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag( /*#__PURE__*/makeParamDecorator('SkipSelf'), 4 /* InternalInjectFlags.SkipSelf */);\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Host =\n/*#__PURE__*/\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag( /*#__PURE__*/makeParamDecorator('Host'), 1 /* InternalInjectFlags.Host */);\nfunction getFactoryDef(type, throwNotFound) {\n const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);\n if (!hasFactoryDef && throwNotFound === true && ngDevMode) {\n throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`);\n }\n return hasFactoryDef ? type[NG_FACTORY_DEF] : null;\n}\n\n/**\n * Determines if the contents of two arrays is identical\n *\n * @param a first array\n * @param b second array\n * @param identityAccessor Optional function for extracting stable object identity from a value in\n * the array.\n */\nfunction arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}\n/**\n * Flattens an array.\n */\nfunction flatten(list) {\n return list.flat(Number.POSITIVE_INFINITY);\n}\nfunction deepForEach(input, fn) {\n input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));\n}\nfunction addToArray(arr, index, value) {\n // perf: array.push is faster than array.splice!\n if (index >= arr.length) {\n arr.push(value);\n } else {\n arr.splice(index, 0, value);\n }\n}\nfunction removeFromArray(arr, index) {\n // perf: array.pop is faster than array.splice!\n if (index >= arr.length - 1) {\n return arr.pop();\n } else {\n return arr.splice(index, 1)[0];\n }\n}\nfunction newArray(size, value) {\n const list = [];\n for (let i = 0; i < size; i++) {\n list.push(value);\n }\n return list;\n}\n/**\n * Remove item from array (Same as `Array.splice()` but faster.)\n *\n * `Array.splice()` is not as fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * https://jsperf.com/fast-array-splice (About 20x faster)\n *\n * @param array Array to splice\n * @param index Index of element in array to remove.\n * @param count Number of items to remove.\n */\nfunction arraySplice(array, index, count) {\n const length = array.length - count;\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n while (count--) {\n array.pop(); // shrink the array\n }\n}\n/**\n * Same as `Array.splice(index, 0, value)` but faster.\n *\n * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * @param array Array to splice.\n * @param index Index in array where the `value` should be added.\n * @param value Value to add to array.\n */\nfunction arrayInsert(array, index, value) {\n ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\\'t insert past array end.');\n let end = array.length;\n while (end > index) {\n const previousEnd = end - 1;\n array[end] = array[previousEnd];\n end = previousEnd;\n }\n array[index] = value;\n}\n/**\n * Same as `Array.splice2(index, 0, value1, value2)` but faster.\n *\n * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * @param array Array to splice.\n * @param index Index in array where the `value` should be added.\n * @param value1 Value to add to array.\n * @param value2 Value to add to array.\n */\nfunction arrayInsert2(array, index, value1, value2) {\n ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\\'t insert past array end.');\n let end = array.length;\n if (end == index) {\n // inserting at the end.\n array.push(value1, value2);\n } else if (end === 1) {\n // corner case when we have less items in array than we have items to insert.\n array.push(value2, array[0]);\n array[0] = value1;\n } else {\n end--;\n array.push(array[end - 1], array[end]);\n while (end > index) {\n const previousEnd = end - 2;\n array[end] = array[previousEnd];\n end--;\n }\n array[index] = value1;\n array[index + 1] = value2;\n }\n}\n/**\n * Get an index of an `value` in a sorted `array`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @returns index of the value.\n * - positive index if value found.\n * - negative index if value not found. (`~index` to get the value where it should have been\n * located)\n */\nfunction arrayIndexOfSorted(array, value) {\n return _arrayIndexOfSorted(array, value, 0);\n}\n/**\n * Set a `value` for a `key`.\n *\n * @param keyValueArray to modify.\n * @param key The key to locate or create.\n * @param value The value to set for a `key`.\n * @returns index (always even) of where the value vas set.\n */\nfunction keyValueArraySet(keyValueArray, key, value) {\n let index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it set it.\n keyValueArray[index | 1] = value;\n } else {\n index = ~index;\n arrayInsert2(keyValueArray, index, key, value);\n }\n return index;\n}\n/**\n * Retrieve a `value` for a `key` (on `undefined` if not found.)\n *\n * @param keyValueArray to search.\n * @param key The key to locate.\n * @return The `value` stored at the `key` location or `undefined if not found.\n */\nfunction keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1];\n }\n return undefined;\n}\n/**\n * Retrieve a `key` index value in the array or `-1` if not found.\n *\n * @param keyValueArray to search.\n * @param key The key to locate.\n * @returns index of where the key is (or should have been.)\n * - positive (even) index if key found.\n * - negative index if key not found. (`~index` (even) to get the index where it should have\n * been inserted.)\n */\nfunction keyValueArrayIndexOf(keyValueArray, key) {\n return _arrayIndexOfSorted(keyValueArray, key, 1);\n}\n/**\n * Delete a `key` (and `value`) from the `KeyValueArray`.\n *\n * @param keyValueArray to modify.\n * @param key The key to locate or delete (if exist).\n * @returns index of where the key was (or should have been.)\n * - positive (even) index if key found and deleted.\n * - negative index if key not found. (`~index` (even) to get the index where it should have\n * been.)\n */\nfunction keyValueArrayDelete(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it remove it.\n arraySplice(keyValueArray, index, 2);\n }\n return index;\n}\n/**\n * INTERNAL: Get an index of an `value` in a sorted `array` by grouping search by `shift`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @param shift grouping shift.\n * - `0` means look at every location\n * - `1` means only look at every other (even) location (the odd locations are to be ignored as\n * they are values.)\n * @returns index of the value.\n * - positive index if value found.\n * - negative index if value not found. (`~index` to get the value where it should have been\n * inserted)\n */\nfunction _arrayIndexOfSorted(array, value, shift) {\n ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');\n let start = 0;\n let end = array.length >> shift;\n while (end !== start) {\n const middle = start + (end - start >> 1); // find the middle.\n const current = array[middle << shift];\n if (value === current) {\n return middle << shift;\n } else if (current > value) {\n end = middle;\n } else {\n start = middle + 1; // We already searched middle so make it non-inclusive by adding 1\n }\n }\n return ~(end << shift);\n}\n\n/**\n * This file contains reuseable \"empty\" symbols that can be used as default return values\n * in different parts of the rendering code. Because the same symbols are returned, this\n * allows for identity checks against these values to be consistently used by the framework\n * code.\n */\nconst EMPTY_OBJ = {};\nconst EMPTY_ARRAY = [];\n// freezing the values prevents any code from accidentally inserting new values in\nif ((typeof ngDevMode === 'undefined' || ngDevMode) && /*#__PURE__*/initNgDevMode()) {\n // These property accesses can be ignored because ngDevMode will be set to false\n // when optimizing code and the whole if statement will be dropped.\n // tslint:disable-next-line:no-toplevel-property-access\n /*#__PURE__*/Object.freeze(EMPTY_OBJ);\n // tslint:disable-next-line:no-toplevel-property-access\n /*#__PURE__*/Object.freeze(EMPTY_ARRAY);\n}\n\n/**\n * A multi-provider token for initialization functions that will run upon construction of an\n * environment injector.\n *\n * @publicApi\n */\nconst ENVIRONMENT_INITIALIZER = /*#__PURE__*/new InjectionToken(ngDevMode ? 'ENVIRONMENT_INITIALIZER' : '');\n\n/**\n * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.\n *\n * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a\n * project.\n *\n * @publicApi\n */\nconst INJECTOR$1 = /*#__PURE__*/new InjectionToken(ngDevMode ? 'INJECTOR' : '',\n// Disable tslint because this is const enum which gets inlined not top level prop access.\n// tslint:disable-next-line: no-toplevel-property-access\n-1 /* InjectorMarkers.Injector */);\nconst INJECTOR_DEF_TYPES = /*#__PURE__*/new InjectionToken(ngDevMode ? 'INJECTOR_DEF_TYPES' : '');\nclass NullInjector {\n get(token, notFoundValue = THROW_IF_NOT_FOUND) {\n if (notFoundValue === THROW_IF_NOT_FOUND) {\n const error = new Error(`NullInjectorError: No provider for ${stringify(token)}!`);\n error.name = 'NullInjectorError';\n throw error;\n }\n return notFoundValue;\n }\n}\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @see {@link ChangeDetectorRef#usage-notes Change detection usage}\n *\n * @publicApi\n */\nvar ChangeDetectionStrategy = /*#__PURE__*/function (ChangeDetectionStrategy) {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n * This strategy applies to all child directives and cannot be overridden.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n return ChangeDetectionStrategy;\n}(ChangeDetectionStrategy || {});\n/**\n * Defines the CSS styles encapsulation policies for the {@link Component} decorator's\n * `encapsulation` option.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n *\n * @publicApi\n */\nvar ViewEncapsulation$1 = /*#__PURE__*/function (ViewEncapsulation) {\n // TODO: consider making `ViewEncapsulation` a `const enum` instead. See\n // https://github.com/angular/angular/issues/44119 for additional information.\n /**\n * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the\n * component's host element and applying the same attribute to all the CSS selectors provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.\n *\n * This is the default option.\n */\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n /**\n * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable\n * to any HTML element of the application regardless of their host Component.\n */\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n /**\n * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates\n * a ShadowRoot for the component's host element which is then used to encapsulate\n * all the Component's styling.\n */\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n return ViewEncapsulation;\n}(ViewEncapsulation$1 || {});\n/** Flags describing an input for a directive. */\nvar InputFlags = /*#__PURE__*/function (InputFlags) {\n InputFlags[InputFlags[\"None\"] = 0] = \"None\";\n InputFlags[InputFlags[\"SignalBased\"] = 1] = \"SignalBased\";\n InputFlags[InputFlags[\"HasDecoratorInputTransform\"] = 2] = \"HasDecoratorInputTransform\";\n return InputFlags;\n}(InputFlags || {});\n/**\n * Returns an index of `classToSearch` in `className` taking token boundaries into account.\n *\n * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`)\n *\n * @param className A string containing classes (whitespace separated)\n * @param classToSearch A class name to locate\n * @param startingIndex Starting location of search\n * @returns an index of the located class (or -1 if not found)\n */\nfunction classIndexOf(className, classToSearch, startingIndex) {\n ngDevMode && assertNotEqual(classToSearch, '', 'can not look for \"\" string.');\n let end = className.length;\n while (true) {\n const foundIndex = className.indexOf(classToSearch, startingIndex);\n if (foundIndex === -1) return foundIndex;\n if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has leading whitespace\n const length = classToSearch.length;\n if (foundIndex + length === end || className.charCodeAt(foundIndex + length) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has trailing whitespace\n return foundIndex;\n }\n }\n // False positive, keep searching from where we left off.\n startingIndex = foundIndex + 1;\n }\n}\n\n/**\n * Assigns all attribute values to the provided element via the inferred renderer.\n *\n * This function accepts two forms of attribute entries:\n *\n * default: (key, value):\n * attrs = [key1, value1, key2, value2]\n *\n * namespaced: (NAMESPACE_MARKER, uri, name, value)\n * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n *\n * The `attrs` array can contain a mix of both the default and namespaced entries.\n * The \"default\" values are set without a marker, but if the function comes across\n * a marker value then it will attempt to set a namespaced value. If the marker is\n * not of a namespaced value then the function will quit and return the index value\n * where it stopped during the iteration of the attrs array.\n *\n * See [AttributeMarker] to understand what the namespace marker value is.\n *\n * Note that this instruction does not support assigning style and class values to\n * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n * are applied to an element.\n * @param renderer The renderer to be used\n * @param native The element that the attributes will be assigned to\n * @param attrs The attribute array of values that will be assigned to the element\n * @returns the index value that was last accessed in the attributes array\n */\nfunction setUpAttributes(renderer, native, attrs) {\n let i = 0;\n while (i < attrs.length) {\n const value = attrs[i];\n if (typeof value === 'number') {\n // only namespaces are supported. Other value types (such as style/class\n // entries) are not supported in this function.\n if (value !== 0 /* AttributeMarker.NamespaceURI */) {\n break;\n }\n // we just landed on the marker value ... therefore\n // we should skip to the next entry\n i++;\n const namespaceURI = attrs[i++];\n const attrName = attrs[i++];\n const attrVal = attrs[i++];\n ngDevMode && ngDevMode.rendererSetAttribute++;\n renderer.setAttribute(native, attrName, attrVal, namespaceURI);\n } else {\n // attrName is string;\n const attrName = value;\n const attrVal = attrs[++i];\n // Standard attributes\n ngDevMode && ngDevMode.rendererSetAttribute++;\n if (isAnimationProp(attrName)) {\n renderer.setProperty(native, attrName, attrVal);\n } else {\n renderer.setAttribute(native, attrName, attrVal);\n }\n i++;\n }\n }\n // another piece of code may iterate over the same attributes array. Therefore\n // it may be helpful to return the exact spot where the attributes array exited\n // whether by running into an unsupported marker or if all the static values were\n // iterated over.\n return i;\n}\n/**\n * Test whether the given value is a marker that indicates that the following\n * attribute values in a `TAttributes` array are only the names of attributes,\n * and not name-value pairs.\n * @param marker The attribute marker to test.\n * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n */\nfunction isNameOnlyAttributeMarker(marker) {\n return marker === 3 /* AttributeMarker.Bindings */ || marker === 4 /* AttributeMarker.Template */ || marker === 6 /* AttributeMarker.I18n */;\n}\nfunction isAnimationProp(name) {\n // Perf note: accessing charCodeAt to check for the first character of a string is faster as\n // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that\n // charCodeAt doesn't allocate memory to return a substring.\n return name.charCodeAt(0) === 64 /* CharCode.AT_SIGN */;\n}\n/**\n * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.\n *\n * This merge function keeps the order of attrs same.\n *\n * @param dst Location of where the merged `TAttributes` should end up.\n * @param src `TAttributes` which should be appended to `dst`\n */\nfunction mergeHostAttrs(dst, src) {\n if (src === null || src.length === 0) {\n // do nothing\n } else if (dst === null || dst.length === 0) {\n // We have source, but dst is empty, just make a copy.\n dst = src.slice();\n } else {\n let srcMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n for (let i = 0; i < src.length; i++) {\n const item = src[i];\n if (typeof item === 'number') {\n srcMarker = item;\n } else {\n if (srcMarker === 0 /* AttributeMarker.NamespaceURI */) {\n // Case where we need to consume `key1`, `key2`, `value` items.\n } else if (srcMarker === -1 /* AttributeMarker.ImplicitAttributes */ || srcMarker === 2 /* AttributeMarker.Styles */) {\n // Case where we have to consume `key1` and `value` only.\n mergeHostAttribute(dst, srcMarker, item, null, src[++i]);\n } else {\n // Case where we have to consume `key1` only.\n mergeHostAttribute(dst, srcMarker, item, null, null);\n }\n }\n }\n }\n return dst;\n}\n/**\n * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.\n *\n * @param dst `TAttributes` to append to.\n * @param marker Region where the `key`/`value` should be added.\n * @param key1 Key to add to `TAttributes`\n * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)\n * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.\n */\nfunction mergeHostAttribute(dst, marker, key1, key2, value) {\n let i = 0;\n // Assume that new markers will be inserted at the end.\n let markerInsertPosition = dst.length;\n // scan until correct type.\n if (marker === -1 /* AttributeMarker.ImplicitAttributes */) {\n markerInsertPosition = -1;\n } else {\n while (i < dst.length) {\n const dstValue = dst[i++];\n if (typeof dstValue === 'number') {\n if (dstValue === marker) {\n markerInsertPosition = -1;\n break;\n } else if (dstValue > marker) {\n // We need to save this as we want the markers to be inserted in specific order.\n markerInsertPosition = i - 1;\n break;\n }\n }\n }\n }\n // search until you find place of insertion\n while (i < dst.length) {\n const item = dst[i];\n if (typeof item === 'number') {\n // since `i` started as the index after the marker, we did not find it if we are at the next\n // marker\n break;\n } else if (item === key1) {\n // We already have same token\n if (key2 === null) {\n if (value !== null) {\n dst[i + 1] = value;\n }\n return;\n } else if (key2 === dst[i + 1]) {\n dst[i + 2] = value;\n return;\n }\n }\n // Increment counter.\n i++;\n if (key2 !== null) i++;\n if (value !== null) i++;\n }\n // insert at location.\n if (markerInsertPosition !== -1) {\n dst.splice(markerInsertPosition, 0, marker);\n i = markerInsertPosition + 1;\n }\n dst.splice(i++, 0, key1);\n if (key2 !== null) {\n dst.splice(i++, 0, key2);\n }\n if (value !== null) {\n dst.splice(i++, 0, value);\n }\n}\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\n/**\n * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)\n *\n * @param tNode static data of the node to match\n * @param attrs `TAttributes` to search through.\n * @param cssClassToMatch class to match (lowercase)\n * @param isProjectionMode Whether or not class matching should look into the attribute `class` in\n * addition to the `AttributeMarker.Classes`.\n */\nfunction isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) {\n ngDevMode && assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');\n let i = 0;\n if (isProjectionMode) {\n for (; i < attrs.length && typeof attrs[i] === 'string'; i += 2) {\n // Search for an implicit `class` attribute and check if its value matches `cssClassToMatch`.\n if (attrs[i] === 'class' && classIndexOf(attrs[i + 1].toLowerCase(), cssClassToMatch, 0) !== -1) {\n return true;\n }\n }\n } else if (isInlineTemplate(tNode)) {\n // Matching directives (i.e. when not matching for projection mode) should not consider the\n // class bindings that are present on inline templates, as those class bindings only target\n // the root node of the template, not the template itself.\n return false;\n }\n // Resume the search for classes after the `Classes` marker.\n i = attrs.indexOf(1 /* AttributeMarker.Classes */, i);\n if (i > -1) {\n // We found the classes section. Start searching for the class.\n let item;\n while (++i < attrs.length && typeof (item = attrs[i]) === 'string') {\n if (item.toLowerCase() === cssClassToMatch) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`).\n *\n * @param tNode current TNode\n */\nfunction isInlineTemplate(tNode) {\n return tNode.type === 4 /* TNodeType.Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}\n/**\n * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n *\n * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular\n * directive matching mode:\n * - in the \"directive matching\" mode we do _not_ take TContainer's tagName into account if it is\n * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a\n * tag name was extracted from * syntax so we would match the same directive twice);\n * - in the \"projection\" mode, we use a tag name potentially extracted from the * syntax processing\n * (applicable to TNodeType.Container only).\n */\nfunction hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {\n const tagNameToCompare = tNode.type === 4 /* TNodeType.Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;\n return currentSelector === tagNameToCompare;\n}\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param tNode static data of the node to match\n * @param selector The selector to try matching against the node.\n * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing\n * directive matching.\n * @returns true if node matches the selector.\n */\nfunction isNodeMatchingSelector(tNode, selector, isProjectionMode) {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n let mode = 4 /* SelectorFlags.ELEMENT */;\n const nodeAttrs = tNode.attrs;\n // Find the index of first attribute that has no value, only a name.\n const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0;\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current)) continue;\n skipToNextSelector = false;\n mode = current | mode & 1 /* SelectorFlags.NOT */;\n continue;\n }\n if (skipToNextSelector) continue;\n if (mode & 4 /* SelectorFlags.ELEMENT */) {\n mode = 2 /* SelectorFlags.ATTRIBUTE */ | mode & 1 /* SelectorFlags.NOT */;\n if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) || current === '' && selector.length === 1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else if (mode & 8 /* SelectorFlags.CLASS */) {\n if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else {\n const selectorAttrValue = selector[++i];\n const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);\n if (attrIndexInNode === -1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n continue;\n }\n if (selectorAttrValue !== '') {\n let nodeAttrValue;\n if (attrIndexInNode > nameOnlyMarkerIdx) {\n nodeAttrValue = '';\n } else {\n ngDevMode && assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* AttributeMarker.NamespaceURI */, 'We do not match directives on namespaced attributes');\n // we lowercase the attribute value to be able to match\n // selectors without case-sensitivity\n // (selectors are already in lowercase when generated)\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();\n }\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n return isPositive(mode) || skipToNextSelector;\n}\nfunction isPositive(mode) {\n return (mode & 1 /* SelectorFlags.NOT */) === 0;\n}\n/**\n * Examines the attribute's definition array for a node to find the index of the\n * attribute that matches the given `name`.\n *\n * NOTE: This will not match namespaced attributes.\n *\n * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`.\n * The following table summarizes which types of attributes we attempt to match:\n *\n * ===========================================================================================================\n * Modes | Normal Attributes | Bindings Attributes | Template Attributes | I18n\n * Attributes\n * ===========================================================================================================\n * Inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Inline + Directive | NO | NO | YES | NO\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Directive | YES | YES | NO | YES\n * ===========================================================================================================\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`)\n * rather than a manually expanded template node (e.g ``).\n * @param isProjectionMode true if we are matching against content projection otherwise we are\n * matching against directives.\n */\nfunction findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {\n if (attrs === null) return -1;\n let i = 0;\n if (isProjectionMode || !isInlineTemplate) {\n let bindingsMode = false;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n } else if (maybeAttrName === 3 /* AttributeMarker.Bindings */ || maybeAttrName === 6 /* AttributeMarker.I18n */) {\n bindingsMode = true;\n } else if (maybeAttrName === 1 /* AttributeMarker.Classes */ || maybeAttrName === 2 /* AttributeMarker.Styles */) {\n let value = attrs[++i];\n // We should skip classes here because we have a separate mechanism for\n // matching classes in projection mode.\n while (typeof value === 'string') {\n value = attrs[++i];\n }\n continue;\n } else if (maybeAttrName === 4 /* AttributeMarker.Template */) {\n // We do not care about Template attributes in this scenario.\n break;\n } else if (maybeAttrName === 0 /* AttributeMarker.NamespaceURI */) {\n // Skip the whole namespaced attribute and value. This is by design.\n i += 4;\n continue;\n }\n // In binding mode there are only names, rather than name-value pairs.\n i += bindingsMode ? 1 : 2;\n }\n // We did not match the attribute\n return -1;\n } else {\n return matchTemplateAttribute(attrs, name);\n }\n}\nfunction isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n return false;\n}\nfunction getProjectAsAttrValue(tNode) {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* AttributeMarker.ProjectAs */);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1];\n }\n }\n return null;\n}\nfunction getNameOnlyMarkerIndex(nodeAttrs) {\n for (let i = 0; i < nodeAttrs.length; i++) {\n const nodeAttr = nodeAttrs[i];\n if (isNameOnlyAttributeMarker(nodeAttr)) {\n return i;\n }\n }\n return nodeAttrs.length;\n}\nfunction matchTemplateAttribute(attrs, name) {\n let i = attrs.indexOf(4 /* AttributeMarker.Template */);\n if (i > -1) {\n i++;\n while (i < attrs.length) {\n const attr = attrs[i];\n // Return in case we checked all template attrs and are switching to the next section in the\n // attrs array (that starts with a number that represents an attribute marker).\n if (typeof attr === 'number') return -1;\n if (attr === name) return i;\n i++;\n }\n }\n return -1;\n}\n/**\n * Checks whether a selector is inside a CssSelectorList\n * @param selector Selector to be checked.\n * @param list List in which to look for the selector.\n */\nfunction isSelectorInSelectorList(selector, list) {\n selectorListLoop: for (let i = 0; i < list.length; i++) {\n const currentSelectorInList = list[i];\n if (selector.length !== currentSelectorInList.length) {\n continue;\n }\n for (let j = 0; j < selector.length; j++) {\n if (selector[j] !== currentSelectorInList[j]) {\n continue selectorListLoop;\n }\n }\n return true;\n }\n return false;\n}\nfunction maybeWrapInNotSelector(isNegativeMode, chunk) {\n return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;\n}\nfunction stringifyCSSSelector(selector) {\n let result = selector[0];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n let currentChunk = '';\n let isNegativeMode = false;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */) {\n const attrValue = selector[++i];\n currentChunk += '[' + valueOrMarker + (attrValue.length > 0 ? '=\"' + attrValue + '\"' : '') + ']';\n } else if (mode & 8 /* SelectorFlags.CLASS */) {\n currentChunk += '.' + valueOrMarker;\n } else if (mode & 4 /* SelectorFlags.ELEMENT */) {\n currentChunk += ' ' + valueOrMarker;\n }\n } else {\n //\n // Append current chunk to the final result in case we come across SelectorFlag, which\n // indicates that the previous section of a selector is over. We need to accumulate content\n // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g.\n // ```\n // ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC']\n // ```\n // should be transformed to `.classA :not(.classB .classC)`.\n //\n // Note: for negative selector part, we accumulate content between flags until we find the\n // next negative flag. This is needed to support a case where `:not()` rule contains more than\n // one chunk, e.g. the following selector:\n // ```\n // ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar']\n // ```\n // should be stringified to `:not(p.foo) :not(.bar)`\n //\n if (currentChunk !== '' && !isPositive(valueOrMarker)) {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n currentChunk = '';\n }\n mode = valueOrMarker;\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector.\n isNegativeMode = isNegativeMode || !isPositive(mode);\n }\n i++;\n }\n if (currentChunk !== '') {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n }\n return result;\n}\n/**\n * Generates string representation of CSS selector in parsed form.\n *\n * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing\n * additional parsing at runtime (for example, for directive matching). However in some cases (for\n * example, while bootstrapping a component), a string version of the selector is required to query\n * for the host element on the page. This function takes the parsed form of a selector and returns\n * its string representation.\n *\n * @param selectorList selector in parsed form\n * @returns string representation of a given selector\n */\nfunction stringifyCSSSelectorList(selectorList) {\n return selectorList.map(stringifyCSSSelector).join(',');\n}\n/**\n * Extracts attributes and classes information from a given CSS selector.\n *\n * This function is used while creating a component dynamically. In this case, the host element\n * (that is created dynamically) should contain attributes and classes specified in component's CSS\n * selector.\n *\n * @param selector CSS selector in parsed form (in a form of array)\n * @returns object with `attrs` and `classes` fields that contain extracted information\n */\nfunction extractAttrsAndClassesFromSelector(selector) {\n const attrs = [];\n const classes = [];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode === 2 /* SelectorFlags.ATTRIBUTE */) {\n if (valueOrMarker !== '') {\n attrs.push(valueOrMarker, selector[++i]);\n }\n } else if (mode === 8 /* SelectorFlags.CLASS */) {\n classes.push(valueOrMarker);\n }\n } else {\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector. Since attributes and classes are\n // extracted only for \"positive\" part of the selector, we can stop here.\n if (!isPositive(mode)) break;\n mode = valueOrMarker;\n }\n i++;\n }\n return {\n attrs,\n classes\n };\n}\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```\n * class MyComponent {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵcmp = defineComponent({\n * ...\n * });\n * }\n * ```\n * @codeGenApi\n */\nfunction ɵɵdefineComponent(componentDefinition) {\n return noSideEffects(() => {\n // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n const baseDef = getNgDirectiveDef(componentDefinition);\n const def = {\n ...baseDef,\n decls: componentDefinition.decls,\n vars: componentDefinition.vars,\n template: componentDefinition.template,\n consts: componentDefinition.consts || null,\n ngContentSelectors: componentDefinition.ngContentSelectors,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: null,\n // assigned in noSideEffects\n pipeDefs: null,\n // assigned in noSideEffects\n dependencies: baseDef.standalone && componentDefinition.dependencies || null,\n getStandaloneInjector: null,\n signals: componentDefinition.signals ?? false,\n data: componentDefinition.data || {},\n encapsulation: componentDefinition.encapsulation || ViewEncapsulation$1.Emulated,\n styles: componentDefinition.styles || EMPTY_ARRAY,\n _: null,\n schemas: componentDefinition.schemas || null,\n tView: null,\n id: ''\n };\n initFeatures(def);\n const dependencies = componentDefinition.dependencies;\n def.directiveDefs = extractDefListOrFactory(dependencies, /* pipeDef */false);\n def.pipeDefs = extractDefListOrFactory(dependencies, /* pipeDef */true);\n def.id = getComponentId(def);\n return def;\n });\n}\nfunction extractDirectiveDef(type) {\n return getComponentDef(type) || getDirectiveDef(type);\n}\nfunction nonNull(value) {\n return value !== null;\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵdefineNgModule(def) {\n return noSideEffects(() => {\n const res = {\n type: def.type,\n bootstrap: def.bootstrap || EMPTY_ARRAY,\n declarations: def.declarations || EMPTY_ARRAY,\n imports: def.imports || EMPTY_ARRAY,\n exports: def.exports || EMPTY_ARRAY,\n transitiveCompileScopes: null,\n schemas: def.schemas || null,\n id: def.id || null\n };\n return res;\n });\n}\nfunction parseAndConvertBindingsForDefinition(obj, declaredInputs) {\n if (obj == null) return EMPTY_OBJ;\n const newLookup = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n const value = obj[minifiedKey];\n let publicName;\n let declaredName;\n let inputFlags = InputFlags.None;\n if (Array.isArray(value)) {\n inputFlags = value[0];\n publicName = value[1];\n declaredName = value[2] ?? publicName; // declared name might not be set to save bytes.\n } else {\n publicName = value;\n declaredName = value;\n }\n // For inputs, capture the declared name, or if some flags are set.\n if (declaredInputs) {\n // Perf note: An array is only allocated for the input if there are flags.\n newLookup[publicName] = inputFlags !== InputFlags.None ? [minifiedKey, inputFlags] : minifiedKey;\n declaredInputs[publicName] = declaredName;\n } else {\n newLookup[publicName] = minifiedKey;\n }\n }\n }\n return newLookup;\n}\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```ts\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵdir = ɵɵdefineDirective({\n * ...\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵdefineDirective(directiveDefinition) {\n return noSideEffects(() => {\n const def = getNgDirectiveDef(directiveDefinition);\n initFeatures(def);\n return def;\n });\n}\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ɵpipe = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n *\n * @codeGenApi\n */\nfunction ɵɵdefinePipe(pipeDef) {\n return {\n type: pipeDef.type,\n name: pipeDef.name,\n factory: null,\n pure: pipeDef.pure !== false,\n standalone: pipeDef.standalone === true,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null\n };\n}\n/**\n * The following getter methods retrieve the definition from the type. Currently the retrieval\n * honors inheritance, but in the future we may change the rule to require that definitions are\n * explicit. This would require some sort of migration strategy.\n */\nfunction getComponentDef(type) {\n return type[NG_COMP_DEF] || null;\n}\nfunction getDirectiveDef(type) {\n return type[NG_DIR_DEF] || null;\n}\nfunction getPipeDef$1(type) {\n return type[NG_PIPE_DEF] || null;\n}\n/**\n * Checks whether a given Component, Directive or Pipe is marked as standalone.\n * This will return false if passed anything other than a Component, Directive, or Pipe class\n * See [this guide](/guide/standalone-components) for additional information:\n *\n * @param type A reference to a Component, Directive or Pipe.\n * @publicApi\n */\nfunction isStandalone(type) {\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n return def !== null ? def.standalone : false;\n}\nfunction getNgModuleDef(type, throwNotFound) {\n const ngModuleDef = type[NG_MOD_DEF] || null;\n if (!ngModuleDef && throwNotFound === true) {\n throw new Error(`Type ${stringify(type)} does not have 'ɵmod' property.`);\n }\n return ngModuleDef;\n}\nfunction getNgDirectiveDef(directiveDefinition) {\n const declaredInputs = {};\n return {\n type: directiveDefinition.type,\n providersResolver: null,\n factory: null,\n hostBindings: directiveDefinition.hostBindings || null,\n hostVars: directiveDefinition.hostVars || 0,\n hostAttrs: directiveDefinition.hostAttrs || null,\n contentQueries: directiveDefinition.contentQueries || null,\n declaredInputs: declaredInputs,\n inputTransforms: null,\n inputConfig: directiveDefinition.inputs || EMPTY_OBJ,\n exportAs: directiveDefinition.exportAs || null,\n standalone: directiveDefinition.standalone === true,\n signals: directiveDefinition.signals === true,\n selectors: directiveDefinition.selectors || EMPTY_ARRAY,\n viewQuery: directiveDefinition.viewQuery || null,\n features: directiveDefinition.features || null,\n setInput: null,\n findHostDirectiveDefs: null,\n hostDirectives: null,\n inputs: parseAndConvertBindingsForDefinition(directiveDefinition.inputs, declaredInputs),\n outputs: parseAndConvertBindingsForDefinition(directiveDefinition.outputs),\n debugInfo: null\n };\n}\nfunction initFeatures(definition) {\n definition.features?.forEach(fn => fn(definition));\n}\nfunction extractDefListOrFactory(dependencies, pipeDef) {\n if (!dependencies) {\n return null;\n }\n const defExtractor = pipeDef ? getPipeDef$1 : extractDirectiveDef;\n return () => (typeof dependencies === 'function' ? dependencies() : dependencies).map(dep => defExtractor(dep)).filter(nonNull);\n}\n/**\n * A map that contains the generated component IDs and type.\n */\nconst GENERATED_COMP_IDS = /*#__PURE__*/new Map();\n/**\n * A method can returns a component ID from the component definition using a variant of DJB2 hash\n * algorithm.\n */\nfunction getComponentId(componentDef) {\n let hash = 0;\n // We cannot rely solely on the component selector as the same selector can be used in different\n // modules.\n //\n // `componentDef.style` is not used, due to it causing inconsistencies. Ex: when server\n // component styles has no sourcemaps and browsers do.\n //\n // Example:\n // https://github.com/angular/components/blob/d9f82c8f95309e77a6d82fd574c65871e91354c2/src/material/core/option/option.ts#L248\n // https://github.com/angular/components/blob/285f46dc2b4c5b127d356cb7c4714b221f03ce50/src/material/legacy-core/option/option.ts#L32\n const hashSelectors = [componentDef.selectors, componentDef.ngContentSelectors, componentDef.hostVars, componentDef.hostAttrs, componentDef.consts, componentDef.vars, componentDef.decls, componentDef.encapsulation, componentDef.standalone, componentDef.signals, componentDef.exportAs, JSON.stringify(componentDef.inputs), JSON.stringify(componentDef.outputs),\n // We cannot use 'componentDef.type.name' as the name of the symbol will change and will not\n // match in the server and browser bundles.\n Object.getOwnPropertyNames(componentDef.type.prototype), !!componentDef.contentQueries, !!componentDef.viewQuery].join('|');\n for (const char of hashSelectors) {\n hash = Math.imul(31, hash) + char.charCodeAt(0) << 0;\n }\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n const compId = 'c' + hash;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (GENERATED_COMP_IDS.has(compId)) {\n const previousCompDefType = GENERATED_COMP_IDS.get(compId);\n if (previousCompDefType !== componentDef.type) {\n console.warn(formatRuntimeError(-912 /* RuntimeErrorCode.COMPONENT_ID_COLLISION */, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef.selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`));\n }\n } else {\n GENERATED_COMP_IDS.set(compId, componentDef.type);\n }\n }\n return compId;\n}\n\n/**\n * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally\n * referenced in `@Component` in a component injector.\n */\nfunction makeEnvironmentProviders(providers) {\n return {\n ɵproviders: providers\n };\n}\n/**\n * Collects providers from all NgModules and standalone components, including transitively imported\n * ones.\n *\n * Providers extracted via `importProvidersFrom` are only usable in an application injector or\n * another environment injector (such as a route injector). They should not be used in component\n * providers.\n *\n * More information about standalone components can be found in [this\n * guide](guide/standalone-components).\n *\n * @usageNotes\n * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:\n *\n * ```typescript\n * await bootstrapApplication(RootComponent, {\n * providers: [\n * importProvidersFrom(NgModuleOne, NgModuleTwo)\n * ]\n * });\n * ```\n *\n * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a\n * standalone component is used:\n *\n * ```typescript\n * export const ROUTES: Route[] = [\n * {\n * path: 'foo',\n * providers: [\n * importProvidersFrom(NgModuleOne, NgModuleTwo)\n * ],\n * component: YourStandaloneComponent\n * }\n * ];\n * ```\n *\n * @returns Collected providers from the specified list of types.\n * @publicApi\n */\nfunction importProvidersFrom(...sources) {\n return {\n ɵproviders: internalImportProvidersFrom(true, sources),\n ɵfromNgModule: true\n };\n}\nfunction internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {\n const providersOut = [];\n const dedup = new Set(); // already seen types\n let injectorTypesWithProviders;\n const collectProviders = provider => {\n providersOut.push(provider);\n };\n deepForEach(sources, source => {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && checkForStandaloneCmp) {\n const cmpDef = getComponentDef(source);\n if (cmpDef?.standalone) {\n throw new RuntimeError(800 /* RuntimeErrorCode.IMPORT_PROVIDERS_FROM_STANDALONE */, `Importing providers supports NgModule or ModuleWithProviders but got a standalone component \"${stringifyForError(source)}\"`);\n }\n }\n // Narrow `source` to access the internal type analogue for `ModuleWithProviders`.\n const internalSource = source;\n if (walkProviderTree(internalSource, collectProviders, [], dedup)) {\n injectorTypesWithProviders ||= [];\n injectorTypesWithProviders.push(internalSource);\n }\n });\n // Collect all providers from `ModuleWithProviders` types.\n if (injectorTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(injectorTypesWithProviders, collectProviders);\n }\n return providersOut;\n}\n/**\n * Collects all providers from the list of `ModuleWithProviders` and appends them to the provided\n * array.\n */\nfunction processInjectorTypesWithProviders(typesWithProviders, visitor) {\n for (let i = 0; i < typesWithProviders.length; i++) {\n const {\n ngModule,\n providers\n } = typesWithProviders[i];\n deepForEachProvider(providers, provider => {\n ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);\n visitor(provider, ngModule);\n });\n }\n}\n/**\n * The logic visits an `InjectorType`, an `InjectorTypeWithProviders`, or a standalone\n * `ComponentType`, and all of its transitive providers and collects providers.\n *\n * If an `InjectorTypeWithProviders` that declares providers besides the type is specified,\n * the function will return \"true\" to indicate that the providers of the type definition need\n * to be processed. This allows us to process providers of injector types after all imports of\n * an injector definition are processed. (following View Engine semantics: see FW-1349)\n */\nfunction walkProviderTree(container, visitor, parents, dedup) {\n container = resolveForwardRef(container);\n if (!container) return false;\n // The actual type which had the definition. Usually `container`, but may be an unwrapped type\n // from `InjectorTypeWithProviders`.\n let defType = null;\n let injDef = getInjectorDef(container);\n const cmpDef = !injDef && getComponentDef(container);\n if (!injDef && !cmpDef) {\n // `container` is not an injector type or a component type. It might be:\n // * An `InjectorTypeWithProviders` that wraps an injector type.\n // * A standalone directive or pipe that got pulled in from a standalone component's\n // dependencies.\n // Try to unwrap it as an `InjectorTypeWithProviders` first.\n const ngModule = container.ngModule;\n injDef = getInjectorDef(ngModule);\n if (injDef) {\n defType = ngModule;\n } else {\n // Not a component or injector type, so ignore it.\n return false;\n }\n } else if (cmpDef && !cmpDef.standalone) {\n return false;\n } else {\n defType = container;\n }\n // Check for circular dependencies.\n if (ngDevMode && parents.indexOf(defType) !== -1) {\n const defName = stringify(defType);\n const path = parents.map(stringify);\n throwCyclicDependencyError(defName, path);\n }\n // Check for multiple imports of the same module\n const isDuplicate = dedup.has(defType);\n if (cmpDef) {\n if (isDuplicate) {\n // This component definition has already been processed.\n return false;\n }\n dedup.add(defType);\n if (cmpDef.dependencies) {\n const deps = typeof cmpDef.dependencies === 'function' ? cmpDef.dependencies() : cmpDef.dependencies;\n for (const dep of deps) {\n walkProviderTree(dep, visitor, parents, dedup);\n }\n }\n } else if (injDef) {\n // First, include providers from any imports.\n if (injDef.imports != null && !isDuplicate) {\n // Before processing defType's imports, add it to the set of parents. This way, if it ends\n // up deeply importing itself, this can be detected.\n ngDevMode && parents.push(defType);\n // Add it to the set of dedups. This way we can detect multiple imports of the same module\n dedup.add(defType);\n let importTypesWithProviders;\n try {\n deepForEach(injDef.imports, imported => {\n if (walkProviderTree(imported, visitor, parents, dedup)) {\n importTypesWithProviders ||= [];\n // If the processed import is an injector type with providers, we store it in the\n // list of import types with providers, so that we can process those afterwards.\n importTypesWithProviders.push(imported);\n }\n });\n } finally {\n // Remove it from the parents set when finished.\n ngDevMode && parents.pop();\n }\n // Imports which are declared with providers (TypeWithProviders) need to be processed\n // after all imported modules are processed. This is similar to how View Engine\n // processes/merges module imports in the metadata resolver. See: FW-1349.\n if (importTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(importTypesWithProviders, visitor);\n }\n }\n if (!isDuplicate) {\n // Track the InjectorType and add a provider for it.\n // It's important that this is done after the def's imports.\n const factory = getFactoryDef(defType) || (() => new defType());\n // Append extra providers to make more info available for consumers (to retrieve an injector\n // type), as well as internally (to calculate an injection scope correctly and eagerly\n // instantiate a `defType` when an injector is created).\n // Provider to create `defType` using its factory.\n visitor({\n provide: defType,\n useFactory: factory,\n deps: EMPTY_ARRAY\n }, defType);\n // Make this `defType` available to an internal logic that calculates injector scope.\n visitor({\n provide: INJECTOR_DEF_TYPES,\n useValue: defType,\n multi: true\n }, defType);\n // Provider to eagerly instantiate `defType` via `INJECTOR_INITIALIZER`.\n visitor({\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => ɵɵinject(defType),\n multi: true\n }, defType);\n }\n // Next, include providers listed on the definition itself.\n const defProviders = injDef.providers;\n if (defProviders != null && !isDuplicate) {\n const injectorType = container;\n deepForEachProvider(defProviders, provider => {\n ngDevMode && validateProvider(provider, defProviders, injectorType);\n visitor(provider, injectorType);\n });\n }\n } else {\n // Should not happen, but just in case.\n return false;\n }\n return defType !== container && container.providers !== undefined;\n}\nfunction validateProvider(provider, providers, containerType) {\n if (isTypeProvider(provider) || isValueProvider(provider) || isFactoryProvider(provider) || isExistingProvider(provider)) {\n return;\n }\n // Here we expect the provider to be a `useClass` provider (by elimination).\n const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));\n if (!classRef) {\n throwInvalidProviderError(containerType, providers, provider);\n }\n}\nfunction deepForEachProvider(providers, fn) {\n for (let provider of providers) {\n if (isEnvironmentProviders(provider)) {\n provider = provider.ɵproviders;\n }\n if (Array.isArray(provider)) {\n deepForEachProvider(provider, fn);\n } else {\n fn(provider);\n }\n }\n}\nconst USE_VALUE$1 = /*#__PURE__*/getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty\n});\nfunction isValueProvider(value) {\n return value !== null && typeof value == 'object' && USE_VALUE$1 in value;\n}\nfunction isExistingProvider(value) {\n return !!(value && value.useExisting);\n}\nfunction isFactoryProvider(value) {\n return !!(value && value.useFactory);\n}\nfunction isTypeProvider(value) {\n return typeof value === 'function';\n}\nfunction isClassProvider(value) {\n return !!value.useClass;\n}\n\n/**\n * An internal token whose presence in an injector indicates that the injector should treat itself\n * as a root scoped injector when processing requests for unknown tokens which may indicate\n * they are provided in the root scope.\n */\nconst INJECTOR_SCOPE = /*#__PURE__*/new InjectionToken(ngDevMode ? 'Set Injector scope.' : '');\n\n/**\n * Marker which indicates that a value has not yet been created from the factory function.\n */\nconst NOT_YET = {};\n/**\n * Marker which indicates that the factory function for a token is in the process of being called.\n *\n * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates\n * injection of a dependency has recursively attempted to inject the original token, and there is\n * a circular dependency among the providers.\n */\nconst CIRCULAR = {};\n/**\n * A lazily initialized NullInjector.\n */\nlet NULL_INJECTOR = undefined;\nfunction getNullInjector() {\n if (NULL_INJECTOR === undefined) {\n NULL_INJECTOR = new NullInjector();\n }\n return NULL_INJECTOR;\n}\n/**\n * An `Injector` that's part of the environment injector hierarchy, which exists outside of the\n * component tree.\n */\nclass EnvironmentInjector {}\nclass R3Injector extends EnvironmentInjector {\n /**\n * Flag indicating that this injector was previously destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n constructor(providers, parent, source, scopes) {\n super();\n this.parent = parent;\n this.source = source;\n this.scopes = scopes;\n /**\n * Map of tokens to records which contain the instances of those tokens.\n * - `null` value implies that we don't have the record. Used by tree-shakable injectors\n * to prevent further searches.\n */\n this.records = new Map();\n /**\n * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.\n */\n this._ngOnDestroyHooks = new Set();\n this._onDestroyHooks = [];\n this._destroyed = false;\n // Start off by creating Records for every provider.\n forEachSingleProvider(providers, provider => this.processProvider(provider));\n // Make sure the INJECTOR token provides this injector.\n this.records.set(INJECTOR$1, makeRecord(undefined, this));\n // And `EnvironmentInjector` if the current injector is supposed to be env-scoped.\n if (scopes.has('environment')) {\n this.records.set(EnvironmentInjector, makeRecord(undefined, this));\n }\n // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide\n // any injectable scoped to APP_ROOT_SCOPE.\n const record = this.records.get(INJECTOR_SCOPE);\n if (record != null && typeof record.value === 'string') {\n this.scopes.add(record.value);\n }\n this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES, EMPTY_ARRAY, InjectFlags.Self));\n }\n /**\n * Destroy the injector and release references to every instance or provider associated with it.\n *\n * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a\n * hook was found.\n */\n destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n const prevConsumer = setActiveConsumer$1(null);\n try {\n // Call all the lifecycle hooks.\n for (const service of this._ngOnDestroyHooks) {\n service.ngOnDestroy();\n }\n const onDestroyHooks = this._onDestroyHooks;\n // Reset the _onDestroyHooks array before iterating over it to prevent hooks that unregister\n // themselves from mutating the array during iteration.\n this._onDestroyHooks = [];\n for (const hook of onDestroyHooks) {\n hook();\n }\n } finally {\n // Release all references.\n this.records.clear();\n this._ngOnDestroyHooks.clear();\n this.injectorDefTypes.clear();\n setActiveConsumer$1(prevConsumer);\n }\n }\n onDestroy(callback) {\n this.assertNotDestroyed();\n this._onDestroyHooks.push(callback);\n return () => this.removeOnDestroy(callback);\n }\n runInContext(fn) {\n this.assertNotDestroyed();\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: null\n });\n }\n try {\n return fn();\n } finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n }\n }\n get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {\n this.assertNotDestroyed();\n if (token.hasOwnProperty(NG_ENV_ID)) {\n return token[NG_ENV_ID](this);\n }\n flags = convertToBitFlags(flags);\n // Set the injection context.\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: token\n });\n }\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n // Check for the SkipSelf flag.\n if (!(flags & InjectFlags.SkipSelf)) {\n // SkipSelf isn't set, check if the record belongs to this injector.\n let record = this.records.get(token);\n if (record === undefined) {\n // No record, but maybe the token is scoped to this injector. Look for an injectable\n // def with a scope matching this injector.\n const def = couldBeInjectableType(token) && getInjectableDef(token);\n if (def && this.injectableDefInScope(def)) {\n // Found an injectable def and it's scoped to this injector. Pretend as if it was here\n // all along.\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n emitProviderConfiguredEvent(token);\n });\n }\n record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);\n } else {\n record = null;\n }\n this.records.set(token, record);\n }\n // If a record was found, get the instance for it and return it.\n if (record != null /* NOT null || undefined */) {\n return this.hydrate(token, record);\n }\n }\n // Select the next injector based on the Self flag - if self is set, the next injector is\n // the NullInjector, otherwise it's the parent.\n const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();\n // Set the notFoundValue based on the Optional flag - if optional is set and notFoundValue\n // is undefined, the value is null, otherwise it's the notFoundValue.\n notFoundValue = flags & InjectFlags.Optional && notFoundValue === THROW_IF_NOT_FOUND ? null : notFoundValue;\n return nextInjector.get(token, notFoundValue);\n } catch (e) {\n if (e.name === 'NullInjectorError') {\n const path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];\n path.unshift(stringify(token));\n if (previousInjector) {\n // We still have a parent injector, keep throwing\n throw e;\n } else {\n // Format & throw the final error message when we don't have any previous injector\n return catchInjectorError(e, token, 'R3InjectorError', this.source);\n }\n } else {\n throw e;\n }\n } finally {\n // Lastly, restore the previous injection context.\n setInjectImplementation(previousInjectImplementation);\n setCurrentInjector(previousInjector);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n }\n }\n /** @internal */\n resolveInjectorInitializers() {\n const prevConsumer = setActiveConsumer$1(null);\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: null\n });\n }\n try {\n const initializers = this.get(ENVIRONMENT_INITIALIZER, EMPTY_ARRAY, InjectFlags.Self);\n if (ngDevMode && !Array.isArray(initializers)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' + `(expected an array, but got ${typeof initializers}). ` + 'Please check that the `ENVIRONMENT_INITIALIZER` token is configured as a ' + '`multi: true` provider.');\n }\n for (const initializer of initializers) {\n initializer();\n }\n } finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n setActiveConsumer$1(prevConsumer);\n }\n }\n toString() {\n const tokens = [];\n const records = this.records;\n for (const token of records.keys()) {\n tokens.push(stringify(token));\n }\n return `R3Injector[${tokens.join(', ')}]`;\n }\n assertNotDestroyed() {\n if (this._destroyed) {\n throw new RuntimeError(205 /* RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');\n }\n }\n /**\n * Process a `SingleProvider` and add it.\n */\n processProvider(provider) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider);\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n // Emit InjectorProfilerEventType.Create if provider is a value provider because\n // these are the only providers that do not go through the value hydration logic\n // where this event would normally be emitted from.\n if (isValueProvider(provider)) {\n emitInstanceCreatedByInjectorEvent(provider.useValue);\n }\n emitProviderConfiguredEvent(provider);\n });\n }\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n } else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n } else {\n if (ngDevMode) {\n const existing = this.records.get(token);\n if (existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n }\n this.records.set(token, record);\n }\n hydrate(token, record) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n if (ngDevMode && record.value === CIRCULAR) {\n throwCyclicDependencyError(stringify(token));\n } else if (record.value === NOT_YET) {\n record.value = CIRCULAR;\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n record.value = record.factory();\n emitInstanceCreatedByInjectorEvent(record.value);\n });\n } else {\n record.value = record.factory();\n }\n }\n if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n this._ngOnDestroyHooks.add(record.value);\n }\n return record.value;\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n injectableDefInScope(def) {\n if (!def.providedIn) {\n return false;\n }\n const providedIn = resolveForwardRef(def.providedIn);\n if (typeof providedIn === 'string') {\n return providedIn === 'any' || this.scopes.has(providedIn);\n } else {\n return this.injectorDefTypes.has(providedIn);\n }\n }\n removeOnDestroy(callback) {\n const destroyCBIdx = this._onDestroyHooks.indexOf(callback);\n if (destroyCBIdx !== -1) {\n this._onDestroyHooks.splice(destroyCBIdx, 1);\n }\n }\n}\nfunction injectableDefOrInjectorDefFactory(token) {\n // Most tokens will have an injectable def directly on them, which specifies a factory directly.\n const injectableDef = getInjectableDef(token);\n const factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);\n if (factory !== null) {\n return factory;\n }\n // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.\n // If it's missing that, it's an error.\n if (token instanceof InjectionToken) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Token ${stringify(token)} is missing a ɵprov definition.`);\n }\n // Undecorated types can sometimes be created if they have no constructor arguments.\n if (token instanceof Function) {\n return getUndecoratedInjectableFactory(token);\n }\n // There was no way to resolve a factory for this token.\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && 'unreachable');\n}\nfunction getUndecoratedInjectableFactory(token) {\n // If the token has parameters then it has dependencies that we cannot resolve implicitly.\n const paramLength = token.length;\n if (paramLength > 0) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${newArray(paramLength, '?').join(', ')}).`);\n }\n // The constructor function appears to have no parameters.\n // This might be because it inherits from a super-class. In which case, use an injectable\n // def from an ancestor if there is one.\n // Otherwise this really is a simple class with no dependencies, so return a factory that\n // just instantiates the zero-arg constructor.\n const inheritedInjectableDef = getInheritedInjectableDef(token);\n if (inheritedInjectableDef !== null) {\n return () => inheritedInjectableDef.factory(token);\n } else {\n return () => new token();\n }\n}\nfunction providerToRecord(provider) {\n if (isValueProvider(provider)) {\n return makeRecord(undefined, provider.useValue);\n } else {\n const factory = providerToFactory(provider);\n return makeRecord(factory, NOT_YET);\n }\n}\n/**\n * Converts a `SingleProvider` into a factory function.\n *\n * @param provider provider to convert to factory\n */\nfunction providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (ngDevMode && isEnvironmentProviders(provider)) {\n throwInvalidProviderError(undefined, providers, provider);\n }\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n } else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n } else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n } else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n } else {\n const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new classRef(...injectArgs(provider.deps));\n } else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}\nfunction makeRecord(factory, value, multi = false) {\n return {\n factory: factory,\n value: value,\n multi: multi ? [] : undefined\n };\n}\nfunction hasDeps(value) {\n return !!value.deps;\n}\nfunction hasOnDestroy(value) {\n return value !== null && typeof value === 'object' && typeof value.ngOnDestroy === 'function';\n}\nfunction couldBeInjectableType(value) {\n return typeof value === 'function' || typeof value === 'object' && value instanceof InjectionToken;\n}\nfunction forEachSingleProvider(providers, fn) {\n for (const provider of providers) {\n if (Array.isArray(provider)) {\n forEachSingleProvider(provider, fn);\n } else if (provider && isEnvironmentProviders(provider)) {\n forEachSingleProvider(provider.ɵproviders, fn);\n } else {\n fn(provider);\n }\n }\n}\n\n/**\n * Runs the given function in the [context](guide/dependency-injection-context) of the given\n * `Injector`.\n *\n * Within the function's stack frame, [`inject`](api/core/inject) can be used to inject dependencies\n * from the given `Injector`. Note that `inject` is only usable synchronously, and cannot be used in\n * any asynchronous callbacks or after any `await` points.\n *\n * @param injector the injector which will satisfy calls to [`inject`](api/core/inject) while `fn`\n * is executing\n * @param fn the closure to be run in the context of `injector`\n * @returns the return value of the function, if any\n * @publicApi\n */\nfunction runInInjectionContext(injector, fn) {\n if (injector instanceof R3Injector) {\n injector.assertNotDestroyed();\n }\n let prevInjectorProfilerContext;\n if (ngDevMode) {\n prevInjectorProfilerContext = setInjectorProfilerContext({\n injector,\n token: null\n });\n }\n const prevInjector = setCurrentInjector(injector);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n return fn();\n } finally {\n setCurrentInjector(prevInjector);\n ngDevMode && setInjectorProfilerContext(prevInjectorProfilerContext);\n setInjectImplementation(previousInjectImplementation);\n }\n}\n/**\n * Whether the current stack frame is inside an injection context.\n */\nfunction isInInjectionContext() {\n return getInjectImplementation() !== undefined || getCurrentInjector() != null;\n}\n/**\n * Asserts that the current stack frame is within an [injection\n * context](guide/dependency-injection-context) and has access to `inject`.\n *\n * @param debugFn a reference to the function making the assertion (used for the error message).\n *\n * @publicApi\n */\nfunction assertInInjectionContext(debugFn) {\n // Taking a `Function` instead of a string name here prevents the unminified name of the function\n // from being retained in the bundle regardless of minification.\n if (!isInInjectionContext()) {\n throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode && debugFn.name + '() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`');\n }\n}\nvar FactoryTarget = /*#__PURE__*/function (FactoryTarget) {\n FactoryTarget[FactoryTarget[\"Directive\"] = 0] = \"Directive\";\n FactoryTarget[FactoryTarget[\"Component\"] = 1] = \"Component\";\n FactoryTarget[FactoryTarget[\"Injectable\"] = 2] = \"Injectable\";\n FactoryTarget[FactoryTarget[\"Pipe\"] = 3] = \"Pipe\";\n FactoryTarget[FactoryTarget[\"NgModule\"] = 4] = \"NgModule\";\n return FactoryTarget;\n}(FactoryTarget || {});\nvar R3TemplateDependencyKind = /*#__PURE__*/function (R3TemplateDependencyKind) {\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"Directive\"] = 0] = \"Directive\";\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"Pipe\"] = 1] = \"Pipe\";\n R3TemplateDependencyKind[R3TemplateDependencyKind[\"NgModule\"] = 2] = \"NgModule\";\n return R3TemplateDependencyKind;\n}(R3TemplateDependencyKind || {});\nvar ViewEncapsulation = /*#__PURE__*/function (ViewEncapsulation) {\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n return ViewEncapsulation;\n}(ViewEncapsulation || {});\nfunction getCompilerFacade(request) {\n const globalNg = _global['ng'];\n if (globalNg && globalNg.ɵcompilerFacade) {\n return globalNg.ɵcompilerFacade;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Log the type as an error so that a developer can easily navigate to the type from the\n // console.\n console.error(`JIT compilation failed for ${request.kind}`, request.type);\n let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\\n\\n`;\n if (request.usage === 1 /* JitCompilerUsage.PartialDeclaration */) {\n message += `The ${request.kind} is part of a library that has been partially compiled.\\n`;\n message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\\n`;\n message += '\\n';\n message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\\n`;\n } else {\n message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\\n`;\n }\n message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\\n`;\n message += `or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`;\n throw new Error(message);\n } else {\n throw new Error('JIT compiler unavailable');\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreDiEnv = {\n 'ɵɵdefineInjectable': ɵɵdefineInjectable,\n 'ɵɵdefineInjector': ɵɵdefineInjector,\n 'ɵɵinject': ɵɵinject,\n 'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,\n 'resolveForwardRef': resolveForwardRef\n};\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nconst Type = Function;\nfunction isType(v) {\n return typeof v === 'function';\n}\n\n/*\n * #########################\n * Attention: These Regular expressions have to hold even if the code is minified!\n * ##########################\n */\n/**\n * Regular expression that detects pass-through constructors for ES5 output. This Regex\n * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also\n * it intends to capture the pattern where existing constructors have been downleveled from\n * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.\n *\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, arguments) || this;\n * ```\n *\n * downleveled to ES5 with `downlevelIteration` for TypeScript < 4.2:\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, __spread(arguments)) || this;\n * ```\n *\n * or downleveled to ES5 with `downlevelIteration` for TypeScript >= 4.2:\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n * ```\n *\n * More details can be found in: https://github.com/angular/angular/issues/38453.\n */\nconst ES5_DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\).*)\\)/;\n/** Regular expression that detects ES2015 classes which extend from other classes. */\nconst ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes and\n * have an explicit constructor defined.\n */\nconst ES2015_INHERITED_CLASS_WITH_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes\n * and inherit a constructor.\n */\nconst ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{[^}]*super\\(\\.\\.\\.arguments\\)/;\n/**\n * Determine whether a stringified type is a class which delegates its constructor\n * to its parent.\n *\n * This is not trivial since compiled code can actually contain a constructor function\n * even if the original source code did not. For instance, when the child class contains\n * an initialized instance property.\n */\nfunction isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);\n}\nclass ReflectionCapabilities {\n constructor(reflect) {\n this._reflect = reflect || _global['Reflect'];\n }\n factory(t) {\n return (...args) => new t(...args);\n }\n /** @internal */\n _zipTypesAndAnnotations(paramTypes, paramAnnotations) {\n let result;\n if (typeof paramTypes === 'undefined') {\n result = newArray(paramAnnotations.length);\n } else {\n result = newArray(paramTypes.length);\n }\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] && paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n _ownParameters(type, parentCtor) {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (isDelegateCtor(typeStr)) {\n return null;\n }\n // Prefer the direct API.\n if (type.parameters && type.parameters !== parentCtor.parameters) {\n return type.parameters;\n }\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = type.ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];\n const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return newArray(type.length);\n }\n parameters(type) {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n _ownAnnotations(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {\n let annotations = typeOrFunc.annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return typeOrFunc[ANNOTATIONS];\n }\n return null;\n }\n annotations(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n _ownPropMetadata(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) {\n let propMetadata = typeOrFunc.propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) {\n const propDecorators = typeOrFunc.propDecorators;\n const propMetadata = {};\n Object.keys(propDecorators).forEach(prop => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return typeOrFunc[PROP_METADATA];\n }\n return null;\n }\n propMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach(propName => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach(propName => {\n const decorators = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n ownPropMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n }\n hasLifecycleHook(type, lcProperty) {\n return type instanceof Type && lcProperty in type.prototype;\n }\n}\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations) {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map(decoratorInvocation => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\nfunction getParentCtor(ctor) {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n\n// Below are constants for LView indices to help us look up LView members\n// without having to remember the specific indices.\n// Uglify will inline these when minifying so there shouldn't be a cost.\nconst HOST = 0;\nconst TVIEW = 1;\n// Shared with LContainer\nconst FLAGS = 2;\nconst PARENT = 3;\nconst NEXT = 4;\nconst T_HOST = 5;\n// End shared with LContainer\nconst HYDRATION = 6;\nconst CLEANUP = 7;\nconst CONTEXT = 8;\nconst INJECTOR = 9;\nconst ENVIRONMENT = 10;\nconst RENDERER = 11;\nconst CHILD_HEAD = 12;\nconst CHILD_TAIL = 13;\n// FIXME(misko): Investigate if the three declarations aren't all same thing.\nconst DECLARATION_VIEW = 14;\nconst DECLARATION_COMPONENT_VIEW = 15;\nconst DECLARATION_LCONTAINER = 16;\nconst PREORDER_HOOK_FLAGS = 17;\nconst QUERIES = 18;\nconst ID = 19;\nconst EMBEDDED_VIEW_INJECTOR = 20;\nconst ON_DESTROY_HOOKS = 21;\nconst EFFECTS_TO_SCHEDULE = 22;\nconst REACTIVE_TEMPLATE_CONSUMER = 23;\n/**\n * Size of LView's header. Necessary to adjust for it when setting slots.\n *\n * IMPORTANT: `HEADER_OFFSET` should only be referred to the in the `ɵɵ*` instructions to translate\n * instruction index into `LView` index. All other indexes should be in the `LView` index space and\n * there should be no need to refer to `HEADER_OFFSET` anywhere else.\n */\nconst HEADER_OFFSET = 25;\n\n/**\n * Special location which allows easy identification of type. If we have an array which was\n * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is\n * `LContainer`.\n */\nconst TYPE = 1;\n/**\n * Below are constants for LContainer indices to help us look up LContainer members\n * without having to remember the specific indices.\n * Uglify will inline these when minifying so there shouldn't be a cost.\n */\n// FLAGS, PARENT, NEXT, and T_HOST are indices 2, 3, 4, and 5\n// As we already have these constants in LView, we don't need to re-create them.\nconst DEHYDRATED_VIEWS = 6;\nconst NATIVE = 7;\nconst VIEW_REFS = 8;\nconst MOVED_VIEWS = 9;\n/**\n * Size of LContainer's header. Represents the index after which all views in the\n * container will be inserted. We need to keep a record of current views so we know\n * which views are already in the DOM (and don't need to be re-added) and so we can\n * remove views from the DOM when they are no longer required.\n */\nconst CONTAINER_HEADER_OFFSET = 10;\n/** Flags associated with an LContainer (saved in LContainer[FLAGS]) */\nvar LContainerFlags = /*#__PURE__*/function (LContainerFlags) {\n LContainerFlags[LContainerFlags[\"None\"] = 0] = \"None\";\n /**\n * Flag to signify that this `LContainer` may have transplanted views which need to be change\n * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.\n *\n * This flag, once set, is never unset for the `LContainer`.\n */\n LContainerFlags[LContainerFlags[\"HasTransplantedViews\"] = 2] = \"HasTransplantedViews\";\n return LContainerFlags;\n}(LContainerFlags || {});\n/**\n * True if `value` is `LView`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction isLView(value) {\n return Array.isArray(value) && typeof value[TYPE] === 'object';\n}\n/**\n * True if `value` is `LContainer`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}\nfunction isContentQueryHost(tNode) {\n return (tNode.flags & 4 /* TNodeFlags.hasContentQuery */) !== 0;\n}\nfunction isComponentHost(tNode) {\n return tNode.componentOffset > -1;\n}\nfunction isDirectiveHost(tNode) {\n return (tNode.flags & 1 /* TNodeFlags.isDirectiveHost */) === 1 /* TNodeFlags.isDirectiveHost */;\n}\nfunction isComponentDef(def) {\n return !!def.template;\n}\nfunction isRootView(target) {\n return (target[FLAGS] & 512 /* LViewFlags.IsRoot */) !== 0;\n}\nfunction isProjectionTNode(tNode) {\n return (tNode.type & 16 /* TNodeType.Projection */) === 16 /* TNodeType.Projection */;\n}\nfunction hasI18n(lView) {\n return (lView[FLAGS] & 32 /* LViewFlags.HasI18n */) === 32 /* LViewFlags.HasI18n */;\n}\nfunction isDestroyed(lView) {\n return (lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */;\n}\n\n// [Assert functions do not constraint type when they are guarded by a truthy\n// expression.](https://github.com/microsoft/TypeScript/issues/37295)\nfunction assertTNodeForLView(tNode, lView) {\n assertTNodeForTView(tNode, lView[TVIEW]);\n}\nfunction assertTNodeForTView(tNode, tView) {\n assertTNode(tNode);\n const tData = tView.data;\n for (let i = HEADER_OFFSET; i < tData.length; i++) {\n if (tData[i] === tNode) {\n return;\n }\n }\n throwError('This TNode does not belong to this TView.');\n}\nfunction assertTNode(tNode) {\n assertDefined(tNode, 'TNode must be defined');\n if (!(tNode && typeof tNode === 'object' && tNode.hasOwnProperty('directiveStylingLast'))) {\n throwError('Not of type TNode, got: ' + tNode);\n }\n}\nfunction assertTIcu(tIcu) {\n assertDefined(tIcu, 'Expected TIcu to be defined');\n if (!(typeof tIcu.currentCaseLViewIndex === 'number')) {\n throwError('Object is not of TIcu type.');\n }\n}\nfunction assertComponentType(actual, msg = 'Type passed in is not ComponentType, it does not have \\'ɵcmp\\' property.') {\n if (!getComponentDef(actual)) {\n throwError(msg);\n }\n}\nfunction assertNgModuleType(actual, msg = 'Type passed in is not NgModuleType, it does not have \\'ɵmod\\' property.') {\n if (!getNgModuleDef(actual)) {\n throwError(msg);\n }\n}\nfunction assertCurrentTNodeIsParent(isParent) {\n assertEqual(isParent, true, 'currentTNode should be a parent');\n}\nfunction assertHasParent(tNode) {\n assertDefined(tNode, 'currentTNode should exist!');\n assertDefined(tNode.parent, 'currentTNode should have a parent');\n}\nfunction assertLContainer(value) {\n assertDefined(value, 'LContainer must be defined');\n assertEqual(isLContainer(value), true, 'Expecting LContainer');\n}\nfunction assertLViewOrUndefined(value) {\n value && assertEqual(isLView(value), true, 'Expecting LView or undefined or null');\n}\nfunction assertLView(value) {\n assertDefined(value, 'LView must be defined');\n assertEqual(isLView(value), true, 'Expecting LView');\n}\nfunction assertFirstCreatePass(tView, errMessage) {\n assertEqual(tView.firstCreatePass, true, errMessage || 'Should only be called in first create pass.');\n}\nfunction assertFirstUpdatePass(tView, errMessage) {\n assertEqual(tView.firstUpdatePass, true, errMessage || 'Should only be called in first update pass.');\n}\n/**\n * This is a basic sanity check that an object is probably a directive def. DirectiveDef is\n * an interface, so we can't do a direct instanceof check.\n */\nfunction assertDirectiveDef(obj) {\n if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) {\n throwError(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`);\n }\n}\nfunction assertIndexInDeclRange(tView, index) {\n assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);\n}\nfunction assertIndexInExpandoRange(lView, index) {\n const tView = lView[1];\n assertBetween(tView.expandoStartIndex, lView.length, index);\n}\nfunction assertBetween(lower, upper, index) {\n if (!(lower <= index && index < upper)) {\n throwError(`Index out of range (expecting ${lower} <= ${index} < ${upper})`);\n }\n}\nfunction assertProjectionSlots(lView, errMessage) {\n assertDefined(lView[DECLARATION_COMPONENT_VIEW], 'Component views should exist.');\n assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, errMessage || 'Components with projection nodes () must have projection slots defined.');\n}\nfunction assertParentView(lView, errMessage) {\n assertDefined(lView, errMessage || 'Component views should always have a parent view (component\\'s host view)');\n}\nfunction assertNoDuplicateDirectives(directives) {\n // The array needs at least two elements in order to have duplicates.\n if (directives.length < 2) {\n return;\n }\n const seenDirectives = new Set();\n for (const current of directives) {\n if (seenDirectives.has(current)) {\n throw new RuntimeError(309 /* RuntimeErrorCode.DUPLICATE_DIRECTIVE */, `Directive ${current.type.name} matches multiple times on the same element. ` + `Directives can only match an element once.`);\n }\n seenDirectives.add(current);\n }\n}\n/**\n * This is a basic sanity check that the `injectorIndex` seems to point to what looks like a\n * NodeInjector data structure.\n *\n * @param lView `LView` which should be checked.\n * @param injectorIndex index into the `LView` where the `NodeInjector` is expected.\n */\nfunction assertNodeInjector(lView, injectorIndex) {\n assertIndexInExpandoRange(lView, injectorIndex);\n assertIndexInExpandoRange(lView, injectorIndex + 8 /* NodeInjectorOffset.PARENT */);\n assertNumber(lView[injectorIndex + 0], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 1], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 2], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 3], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 4], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 5], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 6], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 7], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */], 'injectorIndex should point to parent injector');\n}\n\n/**\n * Represents a basic change from a previous to a new value for a single\n * property on a directive instance. Passed as a value in a\n * {@link SimpleChanges} object to the `ngOnChanges` hook.\n *\n * @see {@link OnChanges}\n *\n * @publicApi\n */\nclass SimpleChange {\n constructor(previousValue, currentValue, firstChange) {\n this.previousValue = previousValue;\n this.currentValue = currentValue;\n this.firstChange = firstChange;\n }\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange() {\n return this.firstChange;\n }\n}\nfunction applyValueToInputField(instance, inputSignalNode, privateName, value) {\n if (inputSignalNode !== null) {\n inputSignalNode.applyValueToInputSignal(inputSignalNode, value);\n } else {\n instance[privateName] = value;\n }\n}\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```\n * static ɵcmp = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵNgOnChangesFeature() {\n return NgOnChangesFeatureImpl;\n}\nfunction NgOnChangesFeatureImpl(definition) {\n if (definition.type.prototype.ngOnChanges) {\n definition.setInput = ngOnChangesSetInput;\n }\n return rememberChangeHistoryAndInvokeOnChangesHook;\n}\n// This option ensures that the ngOnChanges lifecycle hook will be inherited\n// from superclasses (in InheritDefinitionFeature).\n/** @nocollapse */\n// tslint:disable-next-line:no-toplevel-property-access\nɵɵNgOnChangesFeature.ngInherit = true;\n/**\n * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate\n * `ngOnChanges`.\n *\n * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are\n * found it invokes `ngOnChanges` on the component instance.\n *\n * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,\n * it is guaranteed to be called with component instance.\n */\nfunction rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore?.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n } else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}\nfunction ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {\n const declaredName = this.declaredInputs[publicName];\n ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');\n const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, {\n previous: EMPTY_OBJ,\n current: null\n });\n const current = simpleChangesStore.current || (simpleChangesStore.current = {});\n const previous = simpleChangesStore.previous;\n const previousChange = previous[declaredName];\n current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n}\nconst SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\nfunction getSimpleChangesStore(instance) {\n return instance[SIMPLE_CHANGES_STORE] || null;\n}\nfunction setSimpleChangesStore(instance, store) {\n return instance[SIMPLE_CHANGES_STORE] = store;\n}\nlet profilerCallback = null;\n/**\n * Sets the callback function which will be invoked before and after performing certain actions at\n * runtime (for example, before and after running change detection).\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable profiling.\n */\nconst setProfiler = profiler => {\n profilerCallback = profiler;\n};\n/**\n * Profiler function which wraps user code executed by the runtime.\n *\n * @param event ProfilerEvent corresponding to the execution context\n * @param instance component instance\n * @param hookOrListener lifecycle hook function or output listener. The value depends on the\n * execution context\n * @returns\n */\nconst profiler = function (event, instance, hookOrListener) {\n if (profilerCallback != null /* both `null` and `undefined` */) {\n profilerCallback(event, instance, hookOrListener);\n }\n};\nconst SVG_NAMESPACE = 'svg';\nconst MATH_ML_NAMESPACE = 'math';\n\n// TODO(atscott): flip default internally ASAP and externally for v18 (#52928)\nlet _ensureDirtyViewsAreAlwaysReachable = false;\nfunction getEnsureDirtyViewsAreAlwaysReachable() {\n return _ensureDirtyViewsAreAlwaysReachable;\n}\nfunction setEnsureDirtyViewsAreAlwaysReachable(v) {\n _ensureDirtyViewsAreAlwaysReachable = v;\n}\n\n/**\n * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)\n * in same location in `LView`. This is because we don't want to pre-allocate space for it\n * because the storage is sparse. This file contains utilities for dealing with such data types.\n *\n * How do we know what is stored at a given location in `LView`.\n * - `Array.isArray(value) === false` => `RNode` (The normal storage value)\n * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.\n * - `typeof value[TYPE] === 'object'` => `LView`\n * - This happens when we have a component at a given location\n * - `typeof value[TYPE] === true` => `LContainer`\n * - This happens when we have `LContainer` binding at a given location.\n *\n *\n * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.\n */\n/**\n * Returns `RNode`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction unwrapRNode(value) {\n while (Array.isArray(value)) {\n value = value[HOST];\n }\n return value;\n}\n/**\n * Returns `LView` or `null` if not found.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nfunction unwrapLView(value) {\n while (Array.isArray(value)) {\n // This check is same as `isLView()` but we don't call at as we don't want to call\n // `Array.isArray()` twice and give JITer more work for inlining.\n if (typeof value[TYPE] === 'object') return value;\n value = value[HOST];\n }\n return null;\n}\n/**\n * Retrieves an element value from the provided `viewData`, by unwrapping\n * from any containers, component views, or style contexts.\n */\nfunction getNativeByIndex(index, lView) {\n ngDevMode && assertIndexInRange(lView, index);\n ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Expected to be past HEADER_OFFSET');\n return unwrapRNode(lView[index]);\n}\n/**\n * Retrieve an `RNode` for a given `TNode` and `LView`.\n *\n * This function guarantees in dev mode to retrieve a non-null `RNode`.\n *\n * @param tNode\n * @param lView\n */\nfunction getNativeByTNode(tNode, lView) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n ngDevMode && assertIndexInRange(lView, tNode.index);\n const node = unwrapRNode(lView[tNode.index]);\n return node;\n}\n/**\n * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.\n *\n * Some `TNode`s don't have associated `RNode`s. For example `Projection`\n *\n * @param tNode\n * @param lView\n */\nfunction getNativeByTNodeOrNull(tNode, lView) {\n const index = tNode === null ? -1 : tNode.index;\n if (index !== -1) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const node = unwrapRNode(lView[index]);\n return node;\n }\n return null;\n}\n// fixme(misko): The return Type should be `TNode|null`\nfunction getTNode(tView, index) {\n ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');\n ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');\n const tNode = tView.data[index];\n ngDevMode && tNode !== null && assertTNode(tNode);\n return tNode;\n}\n/** Retrieves a value from any `LView` or `TData`. */\nfunction load(view, index) {\n ngDevMode && assertIndexInRange(view, index);\n return view[index];\n}\nfunction getComponentLViewByIndex(nodeIndex, hostView) {\n // Could be an LView or an LContainer. If LContainer, unwrap to find LView.\n ngDevMode && assertIndexInRange(hostView, nodeIndex);\n const slotValue = hostView[nodeIndex];\n const lView = isLView(slotValue) ? slotValue : slotValue[HOST];\n return lView;\n}\n/** Checks whether a given view is in creation mode */\nfunction isCreationMode(view) {\n return (view[FLAGS] & 4 /* LViewFlags.CreationMode */) === 4 /* LViewFlags.CreationMode */;\n}\n/**\n * Returns a boolean for whether the view is attached to the change detection tree.\n *\n * Note: This determines whether a view should be checked, not whether it's inserted\n * into a container. For that, you'll want `viewAttachedToContainer` below.\n */\nfunction viewAttachedToChangeDetector(view) {\n return (view[FLAGS] & 128 /* LViewFlags.Attached */) === 128 /* LViewFlags.Attached */;\n}\n/** Returns a boolean for whether the view is attached to a container. */\nfunction viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}\nfunction getConstant(consts, index) {\n if (index === null || index === undefined) return null;\n ngDevMode && assertIndexInRange(consts, index);\n return consts[index];\n}\n/**\n * Resets the pre-order hook flags of the view.\n * @param lView the LView on which the flags are reset\n */\nfunction resetPreOrderHookFlags(lView) {\n lView[PREORDER_HOOK_FLAGS] = 0;\n}\n/**\n * Adds the `RefreshView` flag from the lView and updates HAS_CHILD_VIEWS_TO_REFRESH flag of\n * parents.\n */\nfunction markViewForRefresh(lView) {\n if (lView[FLAGS] & 1024 /* LViewFlags.RefreshView */) {\n return;\n }\n lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n if (viewAttachedToChangeDetector(lView)) {\n markAncestorsForTraversal(lView);\n }\n}\n/**\n * Walks up the LView hierarchy.\n * @param nestingLevel Number of times to walk up in hierarchy.\n * @param currentView View from which to start the lookup.\n */\nfunction walkUpViews(nestingLevel, currentView) {\n while (nestingLevel > 0) {\n ngDevMode && assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.');\n currentView = currentView[DECLARATION_VIEW];\n nestingLevel--;\n }\n return currentView;\n}\nfunction requiresRefreshOrTraversal(lView) {\n return !!(lView[FLAGS] & (1024 /* LViewFlags.RefreshView */ | 8192 /* LViewFlags.HasChildViewsToRefresh */) || lView[REACTIVE_TEMPLATE_CONSUMER]?.dirty);\n}\n/**\n * Updates the `HasChildViewsToRefresh` flag on the parents of the `LView` as well as the\n * parents above.\n */\nfunction updateAncestorTraversalFlagsOnAttach(lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(1 /* NotificationType.AfterRenderHooks */);\n // TODO(atscott): Simplify if...else cases once getEnsureDirtyViewsAreAlwaysReachable is always\n // `true`. When we attach a view that's marked `Dirty`, we should ensure that it is reached during\n // the next CD traversal so we add the `RefreshView` flag and mark ancestors accordingly.\n if (requiresRefreshOrTraversal(lView)) {\n markAncestorsForTraversal(lView);\n } else if (lView[FLAGS] & 64 /* LViewFlags.Dirty */) {\n if (getEnsureDirtyViewsAreAlwaysReachable()) {\n lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n markAncestorsForTraversal(lView);\n } else {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify();\n }\n }\n}\n/**\n * Ensures views above the given `lView` are traversed during change detection even when they are\n * not dirty.\n *\n * This is done by setting the `HAS_CHILD_VIEWS_TO_REFRESH` flag up to the root, stopping when the\n * flag is already `true` or the `lView` is detached.\n */\nfunction markAncestorsForTraversal(lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify();\n let parent = getLViewParent(lView);\n while (parent !== null) {\n // We stop adding markers to the ancestors once we reach one that already has the marker. This\n // is to avoid needlessly traversing all the way to the root when the marker already exists.\n if (parent[FLAGS] & 8192 /* LViewFlags.HasChildViewsToRefresh */) {\n break;\n }\n parent[FLAGS] |= 8192 /* LViewFlags.HasChildViewsToRefresh */;\n if (!viewAttachedToChangeDetector(parent)) {\n break;\n }\n parent = getLViewParent(parent);\n }\n}\n/**\n * Stores a LView-specific destroy callback.\n */\nfunction storeLViewOnDestroy(lView, onDestroyCallback) {\n if ((lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */) {\n throw new RuntimeError(911 /* RuntimeErrorCode.VIEW_ALREADY_DESTROYED */, ngDevMode && 'View has already been destroyed.');\n }\n if (lView[ON_DESTROY_HOOKS] === null) {\n lView[ON_DESTROY_HOOKS] = [];\n }\n lView[ON_DESTROY_HOOKS].push(onDestroyCallback);\n}\n/**\n * Removes previously registered LView-specific destroy callback.\n */\nfunction removeLViewOnDestroy(lView, onDestroyCallback) {\n if (lView[ON_DESTROY_HOOKS] === null) return;\n const destroyCBIdx = lView[ON_DESTROY_HOOKS].indexOf(onDestroyCallback);\n if (destroyCBIdx !== -1) {\n lView[ON_DESTROY_HOOKS].splice(destroyCBIdx, 1);\n }\n}\n/**\n * Gets the parent LView of the passed LView, if the PARENT is an LContainer, will get the parent of\n * that LContainer, which is an LView\n * @param lView the lView whose parent to get\n */\nfunction getLViewParent(lView) {\n ngDevMode && assertLView(lView);\n const parent = lView[PARENT];\n return isLContainer(parent) ? parent[PARENT] : parent;\n}\nconst instructionState = {\n lFrame: /*#__PURE__*/createLFrame(null),\n bindingsEnabled: true,\n skipHydrationRootTNode: null\n};\n/**\n * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.\n *\n * Necessary to support ChangeDetectorRef.checkNoChanges().\n *\n * The `checkNoChanges` function is invoked only in ngDevMode=true and verifies that no unintended\n * changes exist in the change detector or its children.\n */\nlet _isInCheckNoChangesMode = false;\n/**\n * Returns true if the instruction state stack is empty.\n *\n * Intended to be called from tests only (tree shaken otherwise).\n */\nfunction specOnlyIsInstructionStateEmpty() {\n return instructionState.lFrame.parent === null;\n}\nfunction getElementDepthCount() {\n return instructionState.lFrame.elementDepthCount;\n}\nfunction increaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount++;\n}\nfunction decreaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount--;\n}\nfunction getBindingsEnabled() {\n return instructionState.bindingsEnabled;\n}\n/**\n * Returns true if currently inside a skip hydration block.\n * @returns boolean\n */\nfunction isInSkipHydrationBlock$1() {\n return instructionState.skipHydrationRootTNode !== null;\n}\n/**\n * Returns true if this is the root TNode of the skip hydration block.\n * @param tNode the current TNode\n * @returns boolean\n */\nfunction isSkipHydrationRootTNode(tNode) {\n return instructionState.skipHydrationRootTNode === tNode;\n}\n/**\n * Enables directive matching on elements.\n *\n * * Example:\n * ```\n * \n * Should match component / directive.\n * \n *
\n * \n * \n * Should not match component / directive because we are in ngNonBindable.\n * \n * \n *
\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵenableBindings() {\n instructionState.bindingsEnabled = true;\n}\n/**\n * Sets a flag to specify that the TNode is in a skip hydration block.\n * @param tNode the current TNode\n */\nfunction enterSkipHydrationBlock(tNode) {\n instructionState.skipHydrationRootTNode = tNode;\n}\n/**\n * Disables directive matching on element.\n *\n * * Example:\n * ```\n * \n * Should match component / directive.\n * \n *
\n * \n * \n * Should not match component / directive because we are in ngNonBindable.\n * \n * \n *
\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵdisableBindings() {\n instructionState.bindingsEnabled = false;\n}\n/**\n * Clears the root skip hydration node when leaving a skip hydration block.\n */\nfunction leaveSkipHydrationBlock() {\n instructionState.skipHydrationRootTNode = null;\n}\n/**\n * Return the current `LView`.\n */\nfunction getLView() {\n return instructionState.lFrame.lView;\n}\n/**\n * Return the current `TView`.\n */\nfunction getTView() {\n return instructionState.lFrame.tView;\n}\n/**\n * Restores `contextViewData` to the given OpaqueViewState instance.\n *\n * Used in conjunction with the getCurrentView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @param viewToRestore The OpaqueViewState instance to restore.\n * @returns Context of the restored OpaqueViewState instance.\n *\n * @codeGenApi\n */\nfunction ɵɵrestoreView(viewToRestore) {\n instructionState.lFrame.contextLView = viewToRestore;\n return viewToRestore[CONTEXT];\n}\n/**\n * Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in\n * value so that it can be used as a return value of an instruction.\n *\n * @codeGenApi\n */\nfunction ɵɵresetView(value) {\n instructionState.lFrame.contextLView = null;\n return value;\n}\nfunction getCurrentTNode() {\n let currentTNode = getCurrentTNodePlaceholderOk();\n while (currentTNode !== null && currentTNode.type === 64 /* TNodeType.Placeholder */) {\n currentTNode = currentTNode.parent;\n }\n return currentTNode;\n}\nfunction getCurrentTNodePlaceholderOk() {\n return instructionState.lFrame.currentTNode;\n}\nfunction getCurrentParentTNode() {\n const lFrame = instructionState.lFrame;\n const currentTNode = lFrame.currentTNode;\n return lFrame.isParent ? currentTNode : currentTNode.parent;\n}\nfunction setCurrentTNode(tNode, isParent) {\n ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);\n const lFrame = instructionState.lFrame;\n lFrame.currentTNode = tNode;\n lFrame.isParent = isParent;\n}\nfunction isCurrentTNodeParent() {\n return instructionState.lFrame.isParent;\n}\nfunction setCurrentTNodeAsNotParent() {\n instructionState.lFrame.isParent = false;\n}\nfunction getContextLView() {\n const contextLView = instructionState.lFrame.contextLView;\n ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');\n return contextLView;\n}\nfunction isInCheckNoChangesMode() {\n !ngDevMode && throwError('Must never be called in production mode');\n return _isInCheckNoChangesMode;\n}\nfunction setIsInCheckNoChangesMode(mode) {\n !ngDevMode && throwError('Must never be called in production mode');\n _isInCheckNoChangesMode = mode;\n}\n// top level variables should not be exported for performance reasons (PERF_NOTES.md)\nfunction getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}\nfunction getBindingIndex() {\n return instructionState.lFrame.bindingIndex;\n}\nfunction setBindingIndex(value) {\n return instructionState.lFrame.bindingIndex = value;\n}\nfunction nextBindingIndex() {\n return instructionState.lFrame.bindingIndex++;\n}\nfunction incrementBindingIndex(count) {\n const lFrame = instructionState.lFrame;\n const index = lFrame.bindingIndex;\n lFrame.bindingIndex = lFrame.bindingIndex + count;\n return index;\n}\nfunction isInI18nBlock() {\n return instructionState.lFrame.inI18n;\n}\nfunction setInI18nBlock(isInI18nBlock) {\n instructionState.lFrame.inI18n = isInI18nBlock;\n}\n/**\n * Set a new binding root index so that host template functions can execute.\n *\n * Bindings inside the host template are 0 index. But because we don't know ahead of time\n * how many host bindings we have we can't pre-compute them. For this reason they are all\n * 0 index and we just shift the root so that they match next available location in the LView.\n *\n * @param bindingRootIndex Root index for `hostBindings`\n * @param currentDirectiveIndex `TData[currentDirectiveIndex]` will point to the current directive\n * whose `hostBindings` are being processed.\n */\nfunction setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) {\n const lFrame = instructionState.lFrame;\n lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;\n setCurrentDirectiveIndex(currentDirectiveIndex);\n}\n/**\n * When host binding is executing this points to the directive index.\n * `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef`\n * `LView[getCurrentDirectiveIndex()]` is directive instance.\n */\nfunction getCurrentDirectiveIndex() {\n return instructionState.lFrame.currentDirectiveIndex;\n}\n/**\n * Sets an index of a directive whose `hostBindings` are being processed.\n *\n * @param currentDirectiveIndex `TData` index where current directive instance can be found.\n */\nfunction setCurrentDirectiveIndex(currentDirectiveIndex) {\n instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;\n}\n/**\n * Retrieve the current `DirectiveDef` which is active when `hostBindings` instruction is being\n * executed.\n *\n * @param tData Current `TData` where the `DirectiveDef` will be looked up at.\n */\nfunction getCurrentDirectiveDef(tData) {\n const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];\n}\nfunction getCurrentQueryIndex() {\n return instructionState.lFrame.currentQueryIndex;\n}\nfunction setCurrentQueryIndex(value) {\n instructionState.lFrame.currentQueryIndex = value;\n}\n/**\n * Returns a `TNode` of the location where the current `LView` is declared at.\n *\n * @param lView an `LView` that we want to find parent `TNode` for.\n */\nfunction getDeclarationTNode(lView) {\n const tView = lView[TVIEW];\n // Return the declaration parent for embedded views\n if (tView.type === 2 /* TViewType.Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n }\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n // Falling back to `T_HOST` in case we cross component boundary.\n if (tView.type === 1 /* TViewType.Component */) {\n return lView[T_HOST];\n }\n // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.\n return null;\n}\n/**\n * This is a light weight version of the `enterView` which is needed by the DI system.\n *\n * @param lView `LView` location of the DI context.\n * @param tNode `TNode` for DI context\n * @param flags DI context flags. if `SkipSelf` flag is set than we walk up the declaration\n * tree from `tNode` until we find parent declared `TElementNode`.\n * @returns `true` if we have successfully entered DI associated with `tNode` (or with declared\n * `TNode` if `flags` has `SkipSelf`). Failing to enter DI implies that no associated\n * `NodeInjector` can be found and we should instead use `ModuleInjector`.\n * - If `true` than this call must be fallowed by `leaveDI`\n * - If `false` than this call failed and we should NOT call `leaveDI`\n */\nfunction enterDI(lView, tNode, flags) {\n ngDevMode && assertLViewOrUndefined(lView);\n if (flags & InjectFlags.SkipSelf) {\n ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);\n let parentTNode = tNode;\n let parentLView = lView;\n while (true) {\n ngDevMode && assertDefined(parentTNode, 'Parent TNode should be defined');\n parentTNode = parentTNode.parent;\n if (parentTNode === null && !(flags & InjectFlags.Host)) {\n parentTNode = getDeclarationTNode(parentLView);\n if (parentTNode === null) break;\n // In this case, a parent exists and is definitely an element. So it will definitely\n // have an existing lView as the declaration view, which is why we can assume it's defined.\n ngDevMode && assertDefined(parentLView, 'Parent LView should be defined');\n parentLView = parentLView[DECLARATION_VIEW];\n // In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives\n // We want to skip those and look only at Elements and ElementContainers to ensure\n // we're looking at true parent nodes, and not content or other types.\n if (parentTNode.type & (2 /* TNodeType.Element */ | 8 /* TNodeType.ElementContainer */)) {\n break;\n }\n } else {\n break;\n }\n }\n if (parentTNode === null) {\n // If we failed to find a parent TNode this means that we should use module injector.\n return false;\n } else {\n tNode = parentTNode;\n lView = parentLView;\n }\n }\n ngDevMode && assertTNodeForLView(tNode, lView);\n const lFrame = instructionState.lFrame = allocLFrame();\n lFrame.currentTNode = tNode;\n lFrame.lView = lView;\n return true;\n}\n/**\n * Swap the current lView with a new lView.\n *\n * For performance reasons we store the lView in the top level of the module.\n * This way we minimize the number of properties to read. Whenever a new view\n * is entered we have to store the lView for later, and when the view is\n * exited the state has to be restored\n *\n * @param newView New lView to become active\n * @returns the previously active lView;\n */\nfunction enterView(newView) {\n ngDevMode && assertNotEqual(newView[0], newView[1], '????');\n ngDevMode && assertLViewOrUndefined(newView);\n const newLFrame = allocLFrame();\n if (ngDevMode) {\n assertEqual(newLFrame.isParent, true, 'Expected clean LFrame');\n assertEqual(newLFrame.lView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.tView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.selectedIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.elementDepthCount, 0, 'Expected clean LFrame');\n assertEqual(newLFrame.currentDirectiveIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentNamespace, null, 'Expected clean LFrame');\n assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame');\n }\n const tView = newView[TVIEW];\n instructionState.lFrame = newLFrame;\n ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);\n newLFrame.currentTNode = tView.firstChild;\n newLFrame.lView = newView;\n newLFrame.tView = tView;\n newLFrame.contextLView = newView;\n newLFrame.bindingIndex = tView.bindingStartIndex;\n newLFrame.inI18n = false;\n}\n/**\n * Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure.\n */\nfunction allocLFrame() {\n const currentLFrame = instructionState.lFrame;\n const childLFrame = currentLFrame === null ? null : currentLFrame.child;\n const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;\n return newLFrame;\n}\nfunction createLFrame(parent) {\n const lFrame = {\n currentTNode: null,\n isParent: true,\n lView: null,\n tView: null,\n selectedIndex: -1,\n contextLView: null,\n elementDepthCount: 0,\n currentNamespace: null,\n currentDirectiveIndex: -1,\n bindingRootIndex: -1,\n bindingIndex: -1,\n currentQueryIndex: 0,\n parent: parent,\n child: null,\n inI18n: false\n };\n parent !== null && (parent.child = lFrame); // link the new LFrame for reuse.\n return lFrame;\n}\n/**\n * A lightweight version of leave which is used with DI.\n *\n * This function only resets `currentTNode` and `LView` as those are the only properties\n * used with DI (`enterDI()`).\n *\n * NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where\n * as `leaveViewLight` has `LFrame`. This is so that `leaveViewLight` can be used in `leaveView`.\n */\nfunction leaveViewLight() {\n const oldLFrame = instructionState.lFrame;\n instructionState.lFrame = oldLFrame.parent;\n oldLFrame.currentTNode = null;\n oldLFrame.lView = null;\n return oldLFrame;\n}\n/**\n * This is a lightweight version of the `leaveView` which is needed by the DI system.\n *\n * NOTE: this function is an alias so that we can change the type of the function to have `void`\n * return type.\n */\nconst leaveDI = leaveViewLight;\n/**\n * Leave the current `LView`\n *\n * This pops the `LFrame` with the associated `LView` from the stack.\n *\n * IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is\n * because for performance reasons we don't release `LFrame` but rather keep it for next use.\n */\nfunction leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}\nfunction nextContextImpl(level) {\n const contextLView = instructionState.lFrame.contextLView = walkUpViews(level, instructionState.lFrame.contextLView);\n return contextLView[CONTEXT];\n}\n/**\n * Gets the currently selected element index.\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n */\nfunction getSelectedIndex() {\n return instructionState.lFrame.selectedIndex;\n}\n/**\n * Sets the most recent index passed to {@link select}\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n *\n * (Note that if an \"exit function\" was set earlier (via `setElementExitFn()`) then that will be\n * run if and when the provided `index` value is different from the current selected index value.)\n */\nfunction setSelectedIndex(index) {\n ngDevMode && index !== -1 && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).');\n ngDevMode && assertLessThan(index, instructionState.lFrame.lView.length, 'Can\\'t set index passed end of LView');\n instructionState.lFrame.selectedIndex = index;\n}\n/**\n * Gets the `tNode` that represents currently selected element.\n */\nfunction getSelectedTNode() {\n const lFrame = instructionState.lFrame;\n return getTNode(lFrame.tView, lFrame.selectedIndex);\n}\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceSVG() {\n instructionState.lFrame.currentNamespace = SVG_NAMESPACE;\n}\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceMathML() {\n instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;\n}\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n */\nfunction namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}\nfunction getNamespace$1() {\n return instructionState.lFrame.currentNamespace;\n}\nlet _wasLastNodeCreated = true;\n/**\n * Retrieves a global flag that indicates whether the most recent DOM node\n * was created or hydrated.\n */\nfunction wasLastNodeCreated() {\n return _wasLastNodeCreated;\n}\n/**\n * Sets a global flag to indicate whether the most recent DOM node\n * was created or hydrated.\n */\nfunction lastNodeWasCreated(flag) {\n _wasLastNodeCreated = flag;\n}\n\n/**\n * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.\n *\n * Must be run *only* on the first template pass.\n *\n * Sets up the pre-order hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * @param directiveIndex The index of the directive in LView\n * @param directiveDef The definition containing the hooks to setup in tView\n * @param tView The current TView\n */\nfunction registerPreOrderHooks(directiveIndex, directiveDef, tView) {\n ngDevMode && assertFirstCreatePass(tView);\n const {\n ngOnChanges,\n ngOnInit,\n ngDoCheck\n } = directiveDef.type.prototype;\n if (ngOnChanges) {\n const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);\n (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);\n }\n if (ngOnInit) {\n (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);\n }\n if (ngDoCheck) {\n (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);\n }\n}\n/**\n *\n * Loops through the directives on the provided `tNode` and queues hooks to be\n * run that are not initialization hooks.\n *\n * Should be executed during `elementEnd()` and similar to\n * preserve hook execution order. Content, view, and destroy hooks for projected\n * components and directives must be called *before* their hosts.\n *\n * Sets up the content, view, and destroy hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up\n * separately at `elementStart`.\n *\n * @param tView The current TView\n * @param tNode The TNode whose directives are to be searched for hooks to queue\n */\nfunction registerPostOrderHooks(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const directiveDef = tView.data[i];\n ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n const lifecycleHooks = directiveDef.type.prototype;\n const {\n ngAfterContentInit,\n ngAfterContentChecked,\n ngAfterViewInit,\n ngAfterViewChecked,\n ngOnDestroy\n } = lifecycleHooks;\n if (ngAfterContentInit) {\n (tView.contentHooks ??= []).push(-i, ngAfterContentInit);\n }\n if (ngAfterContentChecked) {\n (tView.contentHooks ??= []).push(i, ngAfterContentChecked);\n (tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);\n }\n if (ngAfterViewInit) {\n (tView.viewHooks ??= []).push(-i, ngAfterViewInit);\n }\n if (ngAfterViewChecked) {\n (tView.viewHooks ??= []).push(i, ngAfterViewChecked);\n (tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);\n }\n if (ngOnDestroy != null) {\n (tView.destroyHooks ??= []).push(i, ngOnDestroy);\n }\n }\n}\n/**\n * Executing hooks requires complex logic as we need to deal with 2 constraints.\n *\n * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only\n * once, across many change detection cycles. This must be true even if some hooks throw, or if\n * some recursively trigger a change detection cycle.\n * To solve that, it is required to track the state of the execution of these init hooks.\n * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},\n * and the index within that phase. They can be seen as a cursor in the following structure:\n * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]\n * They are stored as flags in LView[FLAGS].\n *\n * 2. Pre-order hooks can be executed in batches, because of the select instruction.\n * To be able to pause and resume their execution, we also need some state about the hook's array\n * that is being processed:\n * - the index of the next hook to be executed\n * - the number of init hooks already found in the processed part of the array\n * They are stored as flags in LView[PREORDER_HOOK_FLAGS].\n */\n/**\n * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were\n * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read\n * / write of the init-hooks related flags.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeCheckHooks(lView, hooks, nodeIndex) {\n callHooks(lView, hooks, 3 /* InitPhaseState.InitPhaseCompleted */, nodeIndex);\n}\n/**\n * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,\n * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param initPhase A phase for which hooks should be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {\n ngDevMode && assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');\n if ((lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n callHooks(lView, hooks, initPhase, nodeIndex);\n }\n}\nfunction incrementInitPhaseFlags(lView, initPhase) {\n ngDevMode && assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');\n let flags = lView[FLAGS];\n if ((flags & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n flags &= 16383 /* LViewFlags.IndexWithinInitPhaseReset */;\n flags += 1 /* LViewFlags.InitPhaseStateIncrementer */;\n lView[FLAGS] = flags;\n }\n}\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n * @param initPhaseState the current state of the init phase\n * @param currentNodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction callHooks(currentView, arr, initPhase, currentNodeIndex) {\n ngDevMode && assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');\n const startIndex = currentNodeIndex !== undefined ? currentView[PREORDER_HOOK_FLAGS] & 65535 /* PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask */ : 0;\n const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1\n let lastNodeIndexFound = 0;\n for (let i = startIndex; i < max; i++) {\n const hook = arr[i + 1];\n if (typeof hook === 'number') {\n lastNodeIndexFound = arr[i];\n if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n break;\n }\n } else {\n const isInitHook = arr[i] < 0;\n if (isInitHook) {\n currentView[PREORDER_HOOK_FLAGS] += 65536 /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */;\n }\n if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n callHook(currentView, initPhase, arr, i);\n currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* PreOrderHookFlags.NumberOfInitHooksCalledMask */) + i + 2;\n }\n i++;\n }\n }\n}\n/**\n * Executes a single lifecycle hook, making sure that:\n * - it is called in the non-reactive context;\n * - profiling data are registered.\n */\nfunction callHookInternal(directive, hook) {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook);\n const prevConsumer = setActiveConsumer$1(null);\n try {\n hook.call(directive);\n } finally {\n setActiveConsumer$1(prevConsumer);\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook);\n }\n}\n/**\n * Execute one hook against the current `LView`.\n *\n * @param currentView The current view\n * @param initPhaseState the current state of the init phase\n * @param arr The array in which the hooks are found\n * @param i The current index within the hook data array\n */\nfunction callHook(currentView, initPhase, arr, i) {\n const isInitHook = arr[i] < 0;\n const hook = arr[i + 1];\n const directiveIndex = isInitHook ? -arr[i] : arr[i];\n const directive = currentView[directiveIndex];\n if (isInitHook) {\n const indexWithintInitPhase = currentView[FLAGS] >> 14 /* LViewFlags.IndexWithinInitPhaseShift */;\n // The init phase state must be always checked here as it may have been recursively updated.\n if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 /* PreOrderHookFlags.NumberOfInitHooksCalledShift */ && (currentView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n currentView[FLAGS] += 16384 /* LViewFlags.IndexWithinInitPhaseIncrementer */;\n callHookInternal(directive, hook);\n }\n } else {\n callHookInternal(directive, hook);\n }\n}\nconst NO_PARENT_INJECTOR = -1;\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n/**\n * Factory for creating instances of injectors in the NodeInjector.\n *\n * This factory is complicated by the fact that it can resolve `multi` factories as well.\n *\n * NOTE: Some of the fields are optional which means that this class has two hidden classes.\n * - One without `multi` support (most common)\n * - One with `multi` values, (rare).\n *\n * Since VMs can cache up to 4 inline hidden classes this is OK.\n *\n * - Single factory: Only `resolving` and `factory` is defined.\n * - `providers` factory: `componentProviders` is a number and `index = -1`.\n * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n */\nclass NodeInjectorFactory {\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n factory,\n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider, injectImplementation) {\n this.factory = factory;\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n this.resolving = false;\n ngDevMode && assertDefined(factory, 'Factory not specified');\n ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\nfunction isFactory(obj) {\n return obj instanceof NodeInjectorFactory;\n}\n\n/**\n * Converts `TNodeType` into human readable text.\n * Make sure this matches with `TNodeType`\n */\nfunction toTNodeTypeAsString(tNodeType) {\n let text = '';\n tNodeType & 1 /* TNodeType.Text */ && (text += '|Text');\n tNodeType & 2 /* TNodeType.Element */ && (text += '|Element');\n tNodeType & 4 /* TNodeType.Container */ && (text += '|Container');\n tNodeType & 8 /* TNodeType.ElementContainer */ && (text += '|ElementContainer');\n tNodeType & 16 /* TNodeType.Projection */ && (text += '|Projection');\n tNodeType & 32 /* TNodeType.Icu */ && (text += '|IcuContainer');\n tNodeType & 64 /* TNodeType.Placeholder */ && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n}\n/**\n * Helper function to detect if a given value matches a `TNode` shape.\n *\n * The logic uses the `insertBeforeIndex` and its possible values as\n * a way to differentiate a TNode shape from other types of objects\n * within the `TView.data`. This is not a perfect check, but it can\n * be a reasonable differentiator, since we control the shapes of objects\n * within `TView.data`.\n */\nfunction isTNodeShape(value) {\n return value != null && typeof value === 'object' && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === 'number' || Array.isArray(value.insertBeforeIndex));\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.\n *\n * ```\n *
\n * ```\n * and\n * ```\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasClassInput(tNode) {\n return (tNode.flags & 8 /* TNodeFlags.hasClassInput */) !== 0;\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.\n *\n * ```\n *
\n * ```\n * and\n * ```\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasStyleInput(tNode) {\n return (tNode.flags & 16 /* TNodeFlags.hasStyleInput */) !== 0;\n}\nfunction assertTNodeType(tNode, expectedTypes, message) {\n assertDefined(tNode, 'should be called with a TNode');\n if ((tNode.type & expectedTypes) === 0) {\n throwError(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);\n }\n}\nfunction assertPureTNodeType(type) {\n if (!(type === 2 /* TNodeType.Element */ ||\n //\n type === 1 /* TNodeType.Text */ ||\n //\n type === 4 /* TNodeType.Container */ ||\n //\n type === 8 /* TNodeType.ElementContainer */ ||\n //\n type === 32 /* TNodeType.Icu */ ||\n //\n type === 16 /* TNodeType.Projection */ ||\n //\n type === 64 /* TNodeType.Placeholder */)) {\n throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);\n }\n}\n\n/// Parent Injector Utils ///////////////////////////////////////////////////////////////\nfunction hasParentInjector(parentLocation) {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\nfunction getParentInjectorIndex(parentLocation) {\n if (ngDevMode) {\n assertNumber(parentLocation, 'Number expected');\n assertNotEqual(parentLocation, -1, 'Not a valid state.');\n const parentInjectorIndex = parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');\n }\n return parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n}\nfunction getParentInjectorViewOffset(parentLocation) {\n return parentLocation >> 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;\n}\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nfunction getParentInjectorView(location, startView) {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW];\n viewOffset--;\n }\n return parentView;\n}\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\nfunction setIncludeViewProviders(v) {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n/**\n * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,\n * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash\n * number.\n */\nconst BLOOM_BUCKET_BITS = 5;\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n/** Value used when something wasn't found by an injector. */\nconst NOT_FOUND = {};\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nfunction bloomAdd(injectorIndex, tView, type) {\n ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n let id;\n if (typeof type === 'string') {\n id = type.charCodeAt(0) || 0;\n } else if (type.hasOwnProperty(NG_ELEMENT_ID)) {\n id = type[NG_ELEMENT_ID];\n }\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = type[NG_ELEMENT_ID] = nextNgElementId++;\n }\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomHash = id & BLOOM_MASK;\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.\n // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask\n // should be written to.\n tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n}\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param lView View where the node is stored\n * @returns Node injector\n */\nfunction getOrCreateNodeInjectorForNode(tNode, lView) {\n const existingInjectorIndex = getInjectorIndex(tNode, lView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n const tView = lView[TVIEW];\n if (tView.firstCreatePass) {\n tNode.injectorIndex = lView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(lView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n }\n const parentLoc = getParentInjectorLocation(tNode, lView);\n const injectorIndex = tNode.injectorIndex;\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, lView);\n const parentData = parentLView[TVIEW].data;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < 8 /* NodeInjectorOffset.BLOOM_SIZE */; i++) {\n lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */] = parentLoc;\n return injectorIndex;\n}\nfunction insertBloom(arr, footer) {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\nfunction getInjectorIndex(tNode, lView) {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n lView[tNode.injectorIndex + 8 /* NodeInjectorOffset.PARENT */] === null) {\n return -1;\n } else {\n ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n return tNode.injectorIndex;\n }\n}\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * @returns Returns a number that is the combination of the number of LViews that we have to go up\n * to find the LView containing the parent inject AND the index of the injector within that LView.\n */\nfunction getParentInjectorLocation(tNode, lView) {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n // If we have a parent `TNode` and there is an injector associated with it we are done, because\n // the parent injector is within the current `LView`.\n return tNode.parent.injectorIndex; // ViewOffset is 0\n }\n // When parent injector location is computed it may be outside of the current view. (ie it could\n // be pointing to a declared parent location). This variable stores number of declaration parents\n // we need to walk up in order to find the parent injector location.\n let declarationViewOffset = 0;\n let parentTNode = null;\n let lViewCursor = lView;\n // The parent injector is not in the current `LView`. We will have to walk the declared parent\n // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent\n // `NodeInjector`.\n while (lViewCursor !== null) {\n parentTNode = getTNodeFromLView(lViewCursor);\n if (parentTNode === null) {\n // If we have no parent, than we are done.\n return NO_PARENT_INJECTOR;\n }\n ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);\n // Every iteration of the loop requires that we go to the declared parent.\n declarationViewOffset++;\n lViewCursor = lViewCursor[DECLARATION_VIEW];\n if (parentTNode.injectorIndex !== -1) {\n // We found a NodeInjector which points to something.\n return parentTNode.injectorIndex | declarationViewOffset << 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;\n }\n }\n return NO_PARENT_INJECTOR;\n}\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nfunction diPublicInInjector(injectorIndex, tView, token) {\n bloomAdd(injectorIndex, tView, token);\n}\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```\n * \n * ```\n *\n * Then factory method generated is:\n * ```\n * MyComponent.ɵcmp = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nfunction injectAttributeImpl(tNode, attrNameToInject) {\n ngDevMode && assertTNodeType(tNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return tNode.classes;\n }\n if (attrNameToInject === 'style') {\n return tNode.styles;\n }\n const attrs = tNode.attrs;\n if (attrs) {\n const attrsLength = attrs.length;\n let i = 0;\n while (i < attrsLength) {\n const value = attrs[i];\n // If we hit a `Bindings` or `Template` marker then we are done.\n if (isNameOnlyAttributeMarker(value)) break;\n // Skip namespaced attributes\n if (value === 0 /* AttributeMarker.NamespaceURI */) {\n // we skip the next two values\n // as namespaced attributes looks like\n // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n // 'existValue', ...]\n i = i + 2;\n } else if (typeof value === 'number') {\n // Skip to the first value of the marked attribute.\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n } else if (value === attrNameToInject) {\n return attrs[i + 1];\n } else {\n i = i + 2;\n }\n }\n }\n return null;\n}\nfunction notFoundValueOrThrow(notFoundValue, token, flags) {\n if (flags & InjectFlags.Optional || notFoundValue !== undefined) {\n return notFoundValue;\n } else {\n throwProviderNotFoundError(token, 'NodeInjector');\n }\n}\n/**\n * Returns the value associated to the given token from the ModuleInjector or throws exception\n *\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector or throws an exception\n */\nfunction lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {\n if (flags & InjectFlags.Optional && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {\n const moduleInjector = lView[INJECTOR];\n // switch to `injectInjectorOnly` implementation for module injector, since module injector\n // should not have access to Component/Directive DI scope (that may happen through\n // `directiveInject` implementation)\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);\n } else {\n return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);\n }\n } finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n return notFoundValueOrThrow(notFoundValue, token, flags);\n}\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, notFoundValue) {\n if (tNode !== null) {\n // If the view or any of its ancestors have an embedded\n // view injector, we have to look it up there first.\n if (lView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ &&\n // The token must be present on the current node injector when the `Self`\n // flag is set, so the lookup on embedded view injector(s) can be skipped.\n !(flags & InjectFlags.Self)) {\n const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);\n if (embeddedInjectorValue !== NOT_FOUND) {\n return embeddedInjectorValue;\n }\n }\n // Otherwise try the node injector.\n const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);\n if (value !== NOT_FOUND) {\n return value;\n }\n }\n // Finally, fall back to the module injector.\n return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n}\n/**\n * Returns the value associated to the given token from the node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n if (!enterDI(lView, tNode, flags)) {\n // Failed to enter DI, try module injector instead. If a token is injected with the @Host\n // flag, the module injector is not searched for that token in Ivy.\n return flags & InjectFlags.Host ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n }\n try {\n let value;\n if (ngDevMode) {\n runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {\n value = bloomHash(flags);\n if (value != null) {\n emitInstanceCreatedByInjectorEvent(value);\n }\n });\n } else {\n value = bloomHash(flags);\n }\n if (value == null && !(flags & InjectFlags.Optional)) {\n throwProviderNotFoundError(token);\n } else {\n return value;\n }\n } finally {\n leaveDI();\n }\n } else if (typeof bloomHash === 'number') {\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation = NO_PARENT_INJECTOR;\n let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching the parent injector.\n if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {\n parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n } else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n ngDevMode && assertNodeInjector(lView, injectorIndex);\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n ngDevMode && assertTNodeForLView(tView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */], lView);\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n } else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n return notFoundValue;\n}\nfunction searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibilities\n const canAccessViewProviders = previousTView == null ?\n // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n isComponentHost(tNode) && includeViewProviders :\n // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n previousTView != currentTView && (tNode.type & 3 /* TNodeType.AnyRNode */) !== 0;\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = flags & InjectFlags.Host && hostTElementNode === tNode;\n const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(lView, currentTView, injectableIdx, tNode);\n } else {\n return NOT_FOUND;\n }\n}\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param tView The tView we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nfunction locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n const injectablesStart = nodeProviderIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount = nodeProviderIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i];\n if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart];\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n/**\n * Retrieve or instantiate the injectable from the `LView` at particular `index`.\n *\n * This function checks to see if the value has already been instantiated and if so returns the\n * cached `injectable`. Otherwise if it detects that the value is still a factory it\n * instantiates the `injectable` and caches the value.\n */\nfunction getNodeInjectable(lView, tView, index, tNode) {\n let value = lView[index];\n const tData = tView.data;\n if (isFactory(value)) {\n const factory = value;\n if (factory.resolving) {\n throwCyclicDependencyError(stringifyForError(tData[index]));\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n let prevInjectContext;\n if (ngDevMode) {\n // tData indexes mirror the concrete instances in its corresponding LView.\n // lView[index] here is either the injectable instace itself or a factory,\n // therefore tData[index] is the constructor of that injectable or a\n // definition object that contains the constructor in a `.type` field.\n const token = tData[index].type || tData[index];\n const injector = new NodeInjector(tNode, lView);\n prevInjectContext = setInjectorProfilerContext({\n injector,\n token\n });\n }\n const previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;\n const success = enterDI(lView, tNode, InjectFlags.Default);\n ngDevMode && assertEqual(success, true, 'Because flags do not contain \\`SkipSelf\\' we expect this to always succeed.');\n try {\n value = lView[index] = factory.factory(undefined, tData, lView, tNode);\n ngDevMode && emitInstanceCreatedByInjectorEvent(value);\n // This code path is hit for both directives and providers.\n // For perf reasons, we want to avoid searching for hooks on providers.\n // It does no harm to try (the hooks just won't exist), but the extra\n // checks are unnecessary and this is a hot path. So we check to see\n // if the index of the dependency is in the directive range for this\n // tNode. If it's not, we know it's a provider and skip hook registration.\n if (tView.firstCreatePass && index >= tNode.directiveStart) {\n ngDevMode && assertDirectiveDef(tData[index]);\n registerPreOrderHooks(index, tData[index], tView);\n }\n } finally {\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n previousInjectImplementation !== null && setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n leaveDI();\n }\n }\n return value;\n}\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n * When the returned value is negative then it represents special values such as `Injector`.\n */\nfunction bloomHashBitOrFactory(token) {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId =\n // First check with `hasOwnProperty` so we don't get an inherited ID.\n token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;\n // Negative token IDs are used for special objects such as `Injector`\n if (typeof tokenId === 'number') {\n if (tokenId >= 0) {\n return tokenId & BLOOM_MASK;\n } else {\n ngDevMode && assertEqual(tokenId, -1 /* InjectorMarkers.Injector */, 'Expecting to get Special Injector Id');\n return createNodeInjector;\n }\n } else {\n return tokenId;\n }\n}\nfunction bloomHasToken(bloomHash, injectorIndex, injectorView) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of\n // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset\n // that should be used.\n const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags, isFirstHostTNode) {\n return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);\n}\nfunction getNodeInjectorLView(nodeInjector) {\n return nodeInjector._lView;\n}\nfunction getNodeInjectorTNode(nodeInjector) {\n return nodeInjector._tNode;\n}\nclass NodeInjector {\n constructor(_tNode, _lView) {\n this._tNode = _tNode;\n this._lView = _lView;\n }\n get(token, notFoundValue, flags) {\n return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);\n }\n}\n/** Creates a `NodeInjector` for the current node. */\nfunction createNodeInjector() {\n return new NodeInjector(getCurrentTNode(), getLView());\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵgetInheritedFactory(type) {\n return noSideEffects(() => {\n const ownConstructor = type.prototype.constructor;\n const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n const objectPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objectPrototype) {\n const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n // If we hit something that has a factory and the factory isn't the same as the type,\n // we've found the inherited factory. Note the check that the factory isn't the type's\n // own factory is redundant in most cases, but if the user has custom decorators on the\n // class, this lookup will start one level down in the prototype chain, causing us to\n // find the own factory first and potentially triggering an infinite loop downstream.\n if (factory && factory !== ownFactory) {\n return factory;\n }\n parent = Object.getPrototypeOf(parent);\n }\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return t => new t();\n });\n}\nfunction getFactoryOf(type) {\n if (isForwardRef(type)) {\n return () => {\n const factory = getFactoryOf(resolveForwardRef(type));\n return factory && factory();\n };\n }\n return getFactoryDef(type);\n}\n/**\n * Returns a value from the closest embedded or node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {\n let currentTNode = tNode;\n let currentLView = lView;\n // When an LView with an embedded view injector is inserted, it'll likely be interlaced with\n // nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector).\n // Since the bloom filters for the node injectors have already been constructed and we don't\n // have a way of extracting the records from an injector, the only way to maintain the correct\n // hierarchy when resolving the value is to walk it node-by-node while attempting to resolve\n // the token at each level.\n while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ && !(currentLView[FLAGS] & 512 /* LViewFlags.IsRoot */)) {\n ngDevMode && assertTNodeForLView(currentTNode, currentLView);\n // Note that this lookup on the node injector is using the `Self` flag, because\n // we don't want the node injector to look at any parent injectors since we\n // may hit the embedded view injector first.\n const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | InjectFlags.Self, NOT_FOUND);\n if (nodeInjectorValue !== NOT_FOUND) {\n return nodeInjectorValue;\n }\n // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191\n let parentTNode = currentTNode.parent;\n // `TNode.parent` includes the parent within the current view only. If it doesn't exist,\n // it means that we've hit the view boundary and we need to go up to the next view.\n if (!parentTNode) {\n // Before we go to the next LView, check if the token exists on the current embedded injector.\n const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];\n if (embeddedViewInjector) {\n const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);\n if (embeddedViewInjectorValue !== NOT_FOUND) {\n return embeddedViewInjectorValue;\n }\n }\n // Otherwise keep going up the tree.\n parentTNode = getTNodeFromLView(currentLView);\n currentLView = currentLView[DECLARATION_VIEW];\n }\n currentTNode = parentTNode;\n }\n return notFoundValue;\n}\n/** Gets the TNode associated with an LView inside of the declaration view. */\nfunction getTNodeFromLView(lView) {\n const tView = lView[TVIEW];\n const tViewType = tView.type;\n // The parent pointer differs based on `TView.type`.\n if (tViewType === 2 /* TViewType.Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n } else if (tViewType === 1 /* TViewType.Component */) {\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n return lView[T_HOST];\n }\n return null;\n}\n\n/**\n * Facade for the attribute injection from DI.\n *\n * @codeGenApi\n */\nfunction ɵɵinjectAttribute(attrNameToInject) {\n return injectAttributeImpl(getCurrentTNode(), attrNameToInject);\n}\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Attribute = /*#__PURE__*/makeParamDecorator('Attribute', attributeName => ({\n attributeName,\n __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName)\n}));\nlet _reflect = null;\nfunction getReflect() {\n return _reflect = _reflect || new ReflectionCapabilities();\n}\nfunction reflectDependencies(type) {\n return convertDependencies(getReflect().parameters(type));\n}\nfunction convertDependencies(deps) {\n return deps.map(dep => reflectDependency(dep));\n}\nfunction reflectDependency(dep) {\n const meta = {\n token: null,\n attribute: null,\n host: false,\n optional: false,\n self: false,\n skipSelf: false\n };\n if (Array.isArray(dep) && dep.length > 0) {\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n }\n const proto = Object.getPrototypeOf(param);\n if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n meta.optional = true;\n } else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n } else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n meta.self = true;\n } else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n meta.host = true;\n } else if (param instanceof Inject) {\n meta.token = param.token;\n } else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);\n }\n meta.attribute = param.attributeName;\n } else {\n meta.token = param;\n }\n }\n } else if (dep === undefined || Array.isArray(dep) && dep.length === 0) {\n meta.token = null;\n } else {\n meta.token = dep;\n }\n return meta;\n}\n\n/**\n * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n * injectable def (`ɵprov`) onto the injectable type.\n */\nfunction compileInjectable(type, meta) {\n let ngInjectableDef = null;\n let ngFactoryDef = null;\n // if NG_PROV_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_PROV_DEF)) {\n Object.defineProperty(type, NG_PROV_DEF, {\n get: () => {\n if (ngInjectableDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type\n });\n ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));\n }\n return ngInjectableDef;\n }\n });\n }\n // if NG_FACTORY_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_FACTORY_DEF)) {\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type\n });\n ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {\n name: type.name,\n type,\n typeArgumentCount: 0,\n // In JIT mode types are not available nor used.\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Injectable\n });\n }\n return ngFactoryDef;\n },\n // Leave this configurable so that the factories from directives or pipes can take precedence.\n configurable: true\n });\n }\n}\nconst USE_VALUE = /*#__PURE__*/getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty\n});\nfunction isUseClassProvider(meta) {\n return meta.useClass !== undefined;\n}\nfunction isUseValueProvider(meta) {\n return USE_VALUE in meta;\n}\nfunction isUseFactoryProvider(meta) {\n return meta.useFactory !== undefined;\n}\nfunction isUseExistingProvider(meta) {\n return meta.useExisting !== undefined;\n}\nfunction getInjectableMetadata(type, srcMeta) {\n // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n const meta = srcMeta || {\n providedIn: null\n };\n const compilerMeta = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.deps = convertDependencies(meta.deps);\n }\n // Check to see if the user explicitly provided a `useXxxx` property.\n if (isUseClassProvider(meta)) {\n compilerMeta.useClass = meta.useClass;\n } else if (isUseValueProvider(meta)) {\n compilerMeta.useValue = meta.useValue;\n } else if (isUseFactoryProvider(meta)) {\n compilerMeta.useFactory = meta.useFactory;\n } else if (isUseExistingProvider(meta)) {\n compilerMeta.useExisting = meta.useExisting;\n }\n return compilerMeta;\n}\n\n/**\n * Injectable decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Injectable = /*#__PURE__*/makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta));\n\n/**\n * Create a new `Injector` which is configured using a `defType` of `InjectorType`s.\n */\nfunction createInjector(defType, parent = null, additionalProviders = null, name) {\n const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);\n injector.resolveInjectorInitializers();\n return injector;\n}\n/**\n * Creates a new injector without eagerly resolving its injector types. Can be used in places\n * where resolving the injector types immediately can lead to an infinite loop. The injector types\n * should be resolved at a later point by calling `_resolveInjectorDefTypes`.\n */\nfunction createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = new Set()) {\n const providers = [additionalProviders || EMPTY_ARRAY, importProvidersFrom(defType)];\n name = name || (typeof defType === 'object' ? undefined : stringify(defType));\n return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);\n}\n\n/**\n * Concrete injectors implement this interface. Injectors are configured\n * with [providers](guide/dependency-injection-providers) that associate\n * dependencies of various types with [injection tokens](guide/dependency-injection-providers).\n *\n * @see [DI Providers](guide/dependency-injection-providers).\n * @see {@link StaticProvider}\n *\n * @usageNotes\n *\n * The following example creates a service injector instance.\n *\n * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n *\n * ### Usage example\n *\n * {@example core/di/ts/injector_spec.ts region='Injector'}\n *\n * `Injector` returns itself when given `Injector` as a token:\n *\n * {@example core/di/ts/injector_spec.ts region='injectInjector'}\n *\n * @publicApi\n */\nlet Injector = /*#__PURE__*/(() => {\n class Injector {\n static {\n this.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;\n }\n static {\n this.NULL = /* @__PURE__ */new NullInjector();\n }\n static create(options, parent) {\n if (Array.isArray(options)) {\n return createInjector({\n name: ''\n }, parent, options, '');\n } else {\n const name = options.name ?? '';\n return createInjector({\n name\n }, options.parent, options.providers, name);\n }\n }\n /** @nocollapse */\n static {\n this.ɵprov = ɵɵdefineInjectable({\n token: Injector,\n providedIn: 'any',\n factory: () => ɵɵinject(INJECTOR$1)\n });\n }\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = -1 /* InjectorMarkers.Injector */;\n }\n }\n return Injector;\n})();\n/*!\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Creates a token that can be used to inject static attributes of the host node.\n *\n * @usageNotes\n * ### Injecting an attribute that is known to exist\n * ```typescript\n * @Directive()\n * class MyDir {\n * attr: string = inject(new HostAttributeToken('some-attr'));\n * }\n * ```\n *\n * ### Optionally injecting an attribute\n * ```typescript\n * @Directive()\n * class MyDir {\n * attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});\n * }\n * ```\n * @publicApi\n */\nclass HostAttributeToken {\n constructor(attributeName) {\n this.attributeName = attributeName;\n /** @internal */\n this.__NG_ELEMENT_ID__ = () => ɵɵinjectAttribute(this.attributeName);\n }\n toString() {\n return `HostAttributeToken ${this.attributeName}`;\n }\n}\n\n/**\n * @module\n * @description\n * The `di` module provides dependency injection container services.\n */\n\n/**\n * This file should not be necessary because node resolution should just default to `./di/index`!\n *\n * However it does not seem to work and it breaks:\n * - //packages/animations/browser/test:test_web_chromium-local\n * - //packages/compiler-cli/test:extract_i18n\n * - //packages/compiler-cli/test:ngc\n * - //packages/compiler-cli/test:perform_watch\n * - //packages/compiler-cli/test/diagnostics:check_types\n * - //packages/compiler-cli/test/transformers:test\n * - //packages/compiler/test:test\n * - //tools/public_api_guard:core_api\n *\n * Remove this file once the above is solved or wait until `ngc` is deleted and then it should be\n * safe to delete this file.\n */\n\nconst ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nfunction wrappedError(message, originalError) {\n const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;\n const error = Error(msg);\n error[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\nfunction getOriginalError(error) {\n return error[ERROR_ORIGINAL_ERROR];\n}\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 = /*#__PURE__*/new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'internal error handler' : '', {\n providedIn: 'root',\n factory: () => {\n const userErrorHandler = inject(ErrorHandler);\n return userErrorHandler.handleError.bind(undefined);\n }\n});\n\n/**\n * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.\n * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`\n * is injected in a component or directive, the callbacks run when that component or\n * directive is destroyed. Otherwise the callbacks run when a corresponding injector is destroyed.\n *\n * @publicApi\n */\nlet DestroyRef = /*#__PURE__*/(() => {\n class DestroyRef {\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = injectDestroyRef;\n }\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ENV_ID__ = injector => injector;\n }\n }\n return DestroyRef;\n})();\nclass NodeInjectorDestroyRef extends DestroyRef {\n constructor(_lView) {\n super();\n this._lView = _lView;\n }\n onDestroy(callback) {\n storeLViewOnDestroy(this._lView, callback);\n return () => removeLViewOnDestroy(this._lView, callback);\n }\n}\nfunction injectDestroyRef() {\n return new NodeInjectorDestroyRef(getLView());\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 * \n * ```\n *\n * @developerPreview\n */\nclass OutputEmitterRef {\n constructor() {\n this.destroyed = false;\n this.listeners = null;\n this.errorHandler = inject(ErrorHandler, {\n optional: true\n });\n /** @internal */\n this.destroyRef = inject(DestroyRef);\n // Clean-up all listeners and mark as destroyed upon destroy.\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n this.listeners = null;\n });\n }\n subscribe(callback) {\n if (this.destroyed) {\n throw new RuntimeError(953 /* RuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode && 'Unexpected subscription to destroyed `OutputRef`. ' + 'The owning directive/component is destroyed.');\n }\n (this.listeners ??= []).push(callback);\n return {\n unsubscribe: () => {\n const idx = this.listeners?.indexOf(callback);\n if (idx !== undefined && idx !== -1) {\n this.listeners?.splice(idx, 1);\n }\n }\n };\n }\n /** Emits a new value to the output. */\n emit(value) {\n if (this.destroyed) {\n throw new RuntimeError(953 /* RuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode && 'Unexpected emit for destroyed `OutputRef`. ' + 'The owning directive/component is destroyed.');\n }\n if (this.listeners === null) {\n return;\n }\n const previousConsumer = setActiveConsumer$1(null);\n try {\n for (const listenerFn of this.listeners) {\n try {\n listenerFn(value);\n } catch (err) {\n this.errorHandler?.handleError(err);\n }\n }\n } finally {\n setActiveConsumer$1(previousConsumer);\n }\n }\n}\n/** Gets the owning `DestroyRef` for the given output. */\nfunction getOutputDestroyRef(ref) {\n return ref.destroyRef;\n}\n\n/**\n * The `output` function allows declaration of outputs in directives and\n * components.\n *\n * Initializes an output that can emit values to consumers of your\n * directive/component.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `output()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange = output(); // OutputEmitterRef\n * onClick = output(); // OutputEmitterRef\n * }\n * ```\n *\n * @developerPreview\n */\nfunction output(opts) {\n ngDevMode && assertInInjectionContext(output);\n return new OutputEmitterRef();\n}\nfunction inputFunction(initialValue, opts) {\n ngDevMode && assertInInjectionContext(input);\n return createInputSignal(initialValue, opts);\n}\nfunction inputRequiredFunction(opts) {\n ngDevMode && assertInInjectionContext(input);\n return createInputSignal(REQUIRED_UNSET_VALUE, opts);\n}\n/**\n * The `input` function allows declaration of inputs in directives and\n * components.\n *\n * Initializes an input with an initial value. If no explicit value\n * is specified, Angular will use `undefined`.\n *\n * Consider using `input.required` for inputs that don't need an\n * initial value.\n *\n * @usageNotes\n * Initialize an input in your directive or component by declaring a\n * class field and initializing it with the `input()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * firstName = input(); // string|undefined\n * lastName = input.required(); // string\n * age = input(0); // number\n * }\n * ```\n *\n * @developerPreview\n */\nconst input = /*#__PURE__*/(() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `input` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing`input` export.\n inputFunction.required = inputRequiredFunction;\n return inputFunction;\n})();\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nfunction injectElementRef() {\n return createElementRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates an ElementRef given a node.\n *\n * @param tNode The node for which you'd like an ElementRef\n * @param lView The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nfunction createElementRef(tNode, lView) {\n return new ElementRef(getNativeByTNode(tNode, lView));\n}\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](https://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nlet ElementRef = /*#__PURE__*/(() => {\n class ElementRef {\n constructor(nativeElement) {\n this.nativeElement = nativeElement;\n }\n /**\n * @internal\n * @nocollapse\n */\n static {\n this.__NG_ELEMENT_ID__ = injectElementRef;\n }\n }\n return ElementRef;\n})();\n/**\n * Unwraps `ElementRef` and return the `nativeElement`.\n *\n * @param value value to unwrap\n * @returns `nativeElement` if `ElementRef` otherwise returns value as is.\n */\nfunction unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\nclass EventEmitter_ extends Subject {\n constructor(isAsync = false) {\n super();\n this.destroyRef = undefined;\n this.__isAsync = isAsync;\n // Attempt to retrieve a `DestroyRef` optionally.\n // For backwards compatibility reasons, this cannot be required\n if (isInInjectionContext()) {\n this.destroyRef = inject(DestroyRef, {\n optional: true\n }) ?? undefined;\n }\n }\n emit(value) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n super.next(value);\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n subscribe(observerOrNext, error, complete) {\n let nextFn = observerOrNext;\n let errorFn = error || (() => null);\n let completeFn = complete;\n if (observerOrNext && typeof observerOrNext === 'object') {\n const observer = observerOrNext;\n nextFn = observer.next?.bind(observer);\n errorFn = observer.error?.bind(observer);\n completeFn = observer.complete?.bind(observer);\n }\n if (this.__isAsync) {\n errorFn = _wrapInTimeout(errorFn);\n if (nextFn) {\n nextFn = _wrapInTimeout(nextFn);\n }\n if (completeFn) {\n completeFn = _wrapInTimeout(completeFn);\n }\n }\n const sink = super.subscribe({\n next: nextFn,\n error: errorFn,\n complete: completeFn\n });\n if (observerOrNext instanceof Subscription) {\n observerOrNext.add(sink);\n }\n return sink;\n }\n}\nfunction _wrapInTimeout(fn) {\n return value => {\n setTimeout(fn, undefined, value);\n };\n}\n/**\n * @publicApi\n */\nconst EventEmitter = EventEmitter_;\nfunction symbolIterator() {\n // @ts-expect-error accessing a private member\n return this._results[Symbol.iterator]();\n}\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList;\n * }\n * ```\n *\n * @publicApi\n */\nclass QueryList {\n static {\n Symbol.iterator;\n }\n /**\n * Returns `Observable` of `QueryList` notifying the subscriber of changes.\n */\n get changes() {\n return this._changes ??= new EventEmitter();\n }\n /**\n * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change\n * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in\n * the same result)\n */\n constructor(_emitDistinctChangesOnly = false) {\n this._emitDistinctChangesOnly = _emitDistinctChangesOnly;\n this.dirty = true;\n this._onDirty = undefined;\n this._results = [];\n this._changesDetected = false;\n this._changes = undefined;\n this.length = 0;\n this.first = undefined;\n this.last = undefined;\n // This function should be declared on the prototype, but doing so there will cause the class\n // declaration to have side-effects and become not tree-shakable. For this reason we do it in\n // the constructor.\n // [Symbol.iterator](): Iterator { ... }\n const proto = QueryList.prototype;\n if (!proto[Symbol.iterator]) proto[Symbol.iterator] = symbolIterator;\n }\n /**\n * Returns the QueryList entry at `index`.\n */\n get(index) {\n return this._results[index];\n }\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map(fn) {\n return this._results.map(fn);\n }\n filter(fn) {\n return this._results.filter(fn);\n }\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn) {\n return this._results.find(fn);\n }\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce(fn, init) {\n return this._results.reduce(fn, init);\n }\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn) {\n this._results.forEach(fn);\n }\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn) {\n return this._results.some(fn);\n }\n /**\n * Returns a copy of the internal results list as an Array.\n */\n toArray() {\n return this._results.slice();\n }\n toString() {\n return this._results.toString();\n }\n /**\n * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that\n * on change detection, it will not notify of changes to the queries, unless a new change\n * occurs.\n *\n * @param resultsTree The query results to store\n * @param identityAccessor Optional function for extracting stable object identity from a value\n * in the array. This function is executed for each element of the query result list while\n * comparing current query list with the new one (provided as a first argument of the `reset`\n * function) to detect if the lists are different. If the function is not provided, elements\n * are compared as is (without any pre-processing).\n */\n reset(resultsTree, identityAccessor) {\n this.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor)) {\n this._results = newResultFlat;\n this.length = newResultFlat.length;\n this.last = newResultFlat[this.length - 1];\n this.first = newResultFlat[0];\n }\n }\n /**\n * Triggers a change event by emitting on the `changes` {@link EventEmitter}.\n */\n notifyOnChanges() {\n if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly)) this._changes.emit(this);\n }\n /** @internal */\n onDirty(cb) {\n this._onDirty = cb;\n }\n /** internal */\n setDirty() {\n this.dirty = true;\n this._onDirty?.();\n }\n /** internal */\n destroy() {\n if (this._changes !== undefined) {\n this._changes.complete();\n this._changes.unsubscribe();\n }\n }\n}\n\n/**\n * The name of an attribute that can be added to the hydration boundary node\n * (component host node) to disable hydration for the content within that boundary.\n */\nconst SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';\n/** Lowercase name of the `ngSkipHydration` attribute used for case-insensitive comparisons. */\nconst SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = 'ngskiphydration';\n/**\n * Helper function to check if a given TNode has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnTNode(tNode) {\n const attrs = tNode.mergedAttrs;\n if (attrs === null) return false;\n // only ever look at the attribute name and skip the values\n for (let i = 0; i < attrs.length; i += 2) {\n const value = attrs[i];\n // This is a marker, which means that the static attributes section is over,\n // so we can exit early.\n if (typeof value === 'number') return false;\n if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {\n return true;\n }\n }\n return false;\n}\n/**\n * Helper function to check if a given RElement has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnRElement(rNode) {\n return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME);\n}\n/**\n * Checks whether a TNode has a flag to indicate that it's a part of\n * a skip hydration block.\n */\nfunction hasInSkipHydrationBlockFlag(tNode) {\n return (tNode.flags & 128 /* TNodeFlags.inSkipHydrationBlock */) === 128 /* TNodeFlags.inSkipHydrationBlock */;\n}\n/**\n * Helper function that determines if a given node is within a skip hydration block\n * by navigating up the TNode tree to see if any parent nodes have skip hydration\n * attribute.\n */\nfunction isInSkipHydrationBlock(tNode) {\n if (hasInSkipHydrationBlockFlag(tNode)) {\n return true;\n }\n let currentTNode = tNode.parent;\n while (currentTNode) {\n if (hasInSkipHydrationBlockFlag(tNode) || hasSkipHydrationAttrOnTNode(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\n\n/**\n * Most of the use of `document` in Angular is from within the DI system so it is possible to simply\n * inject the `DOCUMENT` token and are done.\n *\n * Ivy is special because it does not rely upon the DI and must get hold of the document some other\n * way.\n *\n * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.\n * Wherever ivy needs the global document, it calls `getDocument()` instead.\n *\n * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to\n * tell ivy what the global `document` is.\n *\n * Angular does this for us in each of the standard platforms (`Browser` and `Server`)\n * by calling `setDocument()` when providing the `DOCUMENT` token.\n */\nlet DOCUMENT = undefined;\n/**\n * Tell ivy what the `document` is for this platform.\n *\n * It is only necessary to call this if the current platform is not a browser.\n *\n * @param document The object representing the global `document` in this environment.\n */\nfunction setDocument(document) {\n DOCUMENT = document;\n}\n/**\n * Access the object that represents the `document` for this platform.\n *\n * Ivy calls this whenever it needs to access the `document` object.\n * For example to create the renderer or to do sanitization.\n */\nfunction getDocument() {\n if (DOCUMENT !== undefined) {\n return DOCUMENT;\n } else if (typeof document !== 'undefined') {\n return document;\n }\n throw new RuntimeError(210 /* RuntimeErrorCode.MISSING_DOCUMENT */, (typeof ngDevMode === 'undefined' || ngDevMode) && `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);\n // No \"document\" can be found. This should only happen if we are running ivy outside Angular and\n // the current platform is not a browser. Since this is not a supported scenario at the moment\n // this should not happen in Angular apps.\n // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a\n // public API.\n}\n\n/**\n * A [DI token](guide/glossary#di-token \"DI token definition\") representing a string ID, used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated} is being used.\n *\n * The token is needed in cases when multiple applications are bootstrapped on a page\n * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications\n * have different `APP_ID` value setup. For example:\n *\n * ```\n * bootstrapApplication(ComponentA, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-a' },\n * // ... other providers ...\n * ]\n * });\n *\n * bootstrapApplication(ComponentB, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-b' },\n * // ... other providers ...\n * ]\n * });\n * ```\n *\n * By default, when there is only one application bootstrapped, you don't need to provide the\n * `APP_ID` token (the `ng` will be used as an app ID).\n *\n * @publicApi\n */\nconst APP_ID = /*#__PURE__*/new InjectionToken(ngDevMode ? 'AppId' : '', {\n providedIn: 'root',\n factory: () => DEFAULT_APP_ID\n});\n/** Default value of the `APP_ID` token. */\nconst DEFAULT_APP_ID = 'ng';\n/**\n * A function that is executed when a platform is initialized.\n * @publicApi\n */\nconst PLATFORM_INITIALIZER = /*#__PURE__*/new InjectionToken(ngDevMode ? 'Platform Initializer' : '');\n/**\n * A token that indicates an opaque platform ID.\n * @publicApi\n */\nconst PLATFORM_ID = /*#__PURE__*/new InjectionToken(ngDevMode ? 'Platform ID' : '', {\n providedIn: 'platform',\n factory: () => 'unknown' // set a default platform name, when none set explicitly\n});\n/**\n * A [DI token](guide/glossary#di-token \"DI token definition\") that indicates the root directory of\n * the application\n * @publicApi\n * @deprecated\n */\nconst PACKAGE_ROOT_URL = /*#__PURE__*/new InjectionToken(ngDevMode ? 'Application Packages Root URL' : '');\n// We keep this token here, rather than the animations package, so that modules that only care\n// about which animations module is loaded (e.g. the CDK) can retrieve it without having to\n// include extra dependencies. See #44970 for more context.\n/**\n * A [DI token](api/core/InjectionToken) that indicates which animations\n * module has been loaded.\n * @publicApi\n */\nconst ANIMATION_MODULE_TYPE = /*#__PURE__*/new InjectionToken(ngDevMode ? 'AnimationModuleType' : '');\n// TODO(crisbeto): link to CSP guide here.\n/**\n * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that\n * Angular will apply when inserting inline styles. If not provided, Angular will look up its value\n * from the `ngCspNonce` attribute of the application root node.\n *\n * @publicApi\n */\nconst CSP_NONCE = /*#__PURE__*/new InjectionToken(ngDevMode ? 'CSP nonce' : '', {\n providedIn: 'root',\n factory: () => {\n // Ideally we wouldn't have to use `querySelector` here since we know that the nonce will be on\n // the root node, but because the token value is used in renderers, it has to be available\n // *very* early in the bootstrapping process. This should be a fairly shallow search, because\n // the app won't have been added to the DOM yet. Some approaches that were considered:\n // 1. Find the root node through `ApplicationRef.components[i].location` - normally this would\n // be enough for our purposes, but the token is injected very early so the `components` array\n // isn't populated yet.\n // 2. Find the root `LView` through the current `LView` - renderers are a prerequisite to\n // creating the `LView`. This means that no `LView` will have been entered when this factory is\n // invoked for the root component.\n // 3. Have the token factory return `() => string` which is invoked when a nonce is requested -\n // the slightly later execution does allow us to get an `LView` reference, but the fact that\n // it is a function means that it could be executed at *any* time (including immediately) which\n // may lead to weird bugs.\n // 4. Have the `ComponentFactory` read the attribute and provide it to the injector under the\n // hood - has the same problem as #1 and #2 in that the renderer is used to query for the root\n // node and the nonce value needs to be available when the renderer is created.\n return getDocument().body?.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null;\n }\n});\nconst IMAGE_CONFIG_DEFAULTS = {\n breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],\n placeholderResolution: 30,\n disableImageSizeWarning: false,\n disableImageLazyLoadWarning: false\n};\n/**\n * Injection token that configures the image optimized image functionality.\n * See {@link ImageConfig} for additional information about parameters that\n * can be used.\n *\n * @see {@link NgOptimizedImage}\n * @see {@link ImageConfig}\n * @publicApi\n */\nconst IMAGE_CONFIG = /*#__PURE__*/new InjectionToken(ngDevMode ? 'ImageConfig' : '', {\n providedIn: 'root',\n factory: () => IMAGE_CONFIG_DEFAULTS\n});\n\n/**\n * Create a `StateKey` that can be used to store value of type T with `TransferState`.\n *\n * Example:\n *\n * ```\n * const COUNTER_KEY = makeStateKey('counter');\n * let value = 10;\n *\n * transferState.set(COUNTER_KEY, value);\n * ```\n *\n * @publicApi\n */\nfunction makeStateKey(key) {\n return key;\n}\nfunction initTransferState() {\n const transferState = new TransferState();\n if (inject(PLATFORM_ID) === 'browser') {\n transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));\n }\n return transferState;\n}\n/**\n * A key value store that is transferred from the application on the server side to the application\n * on the client side.\n *\n * The `TransferState` is available as an injectable token.\n * On the client, just inject this token using DI and use it, it will be lazily initialized.\n * On the server it's already included if `renderApplication` function is used. Otherwise, import\n * the `ServerTransferStateModule` module to make the `TransferState` available.\n *\n * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only\n * boolean, number, string, null and non-class objects will be serialized and deserialized in a\n * non-lossy manner.\n *\n * @publicApi\n */\nlet TransferState = /*#__PURE__*/(() => {\n class TransferState {\n constructor() {\n /** @internal */\n this.store = {};\n this.onSerializeCallbacks = {};\n }\n /** @nocollapse */\n static {\n this.ɵprov = /** @pureOrBreakMyCode */ɵɵdefineInjectable({\n token: TransferState,\n providedIn: 'root',\n factory: initTransferState\n });\n }\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n */\n get(key, defaultValue) {\n return this.store[key] !== undefined ? this.store[key] : defaultValue;\n }\n /**\n * Set the value corresponding to a key.\n */\n set(key, value) {\n this.store[key] = value;\n }\n /**\n * Remove a key from the store.\n */\n remove(key) {\n delete this.store[key];\n }\n /**\n * Test whether a key exists in the store.\n */\n hasKey(key) {\n return this.store.hasOwnProperty(key);\n }\n /**\n * Indicates whether the state is empty.\n */\n get isEmpty() {\n return Object.keys(this.store).length === 0;\n }\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n */\n onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }\n /**\n * Serialize the current state of the store to JSON.\n */\n toJson() {\n // Call the onSerialize callbacks and put those values into the store.\n for (const key in this.onSerializeCallbacks) {\n if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n } catch (e) {\n console.warn('Exception in onSerialize callback: ', e);\n }\n }\n }\n // Escape script tag to avoid break out of