UNPKG

44.3 kBSource Map (JSON)View Raw
1{"version":3,"sources":["packages/service-worker/service-worker.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","serviceWorker","common","core","rxjs","operators","this","ERR_SW_NOT_SUPPORTED","NgswCommChannel","controllerChanges","fromEvent","pipe","map","controller","currentController","defer","of","controllerWithChanges","concat","worker","filter","c","registration","switchMap","getRegistration","events","event","data","type","publish","connect","errorObservable","message","throwError","Error","prototype","postMessage","action","payload","take","tap","sw","Object","assign","toPromise","then","postMessageWithStatus","nonce","waitForStatus","Promise","all","generateNonce","Math","round","random","eventsOfType","nextEventOfType","status","error","defineProperty","get","enumerable","configurable","SwPush","subscriptionChanges","Subject","isEnabled","messages","NEVER","notificationClicks","subscription","pushManager","workerDrivenSubscriptions","pm","getSubscription","merge","requestSubscription","options","_this","reject","pushOptions","userVisibleOnly","key","decodeBase64","serverPublicKey","replace","applicationServerKey","Uint8Array","ArrayBuffer","length","i","charCodeAt","subscribe","sub","next","unsubscribe","success","input","atob","decorators","Injectable","ctorParameters","SwUpdate","available","activated","checkForUpdate","statusNonce","activateUpdate","SwRegistrationOptions","SCRIPT","InjectionToken","ngswAppInitializer","injector","script","platformId","isPlatformBrowser","navigator","enabled","readyToRegister$","addEventListener","registrationStrategy","_a","__read","o","n","m","Symbol","iterator","r","e","call","ar","done","push","value","split","strategy","args","slice","delayWithTimeout","whenStable","NgZone","runOutsideAngular","register","scope","catch","err","console","timeout","delay","ApplicationRef","isStable","stable","ngswCommChannelFactory","opts","undefined","ServiceWorkerModule","ngModule","providers","provide","useValue","useFactory","deps","PLATFORM_ID","APP_INITIALIZER","Injector","multi","NgModule","ɵangular_packages_service_worker_service_worker_a","ɵangular_packages_service_worker_service_worker_b","ɵangular_packages_service_worker_service_worker_c","ɵangular_packages_service_worker_service_worker_d"],"mappings":";;;;;CAMC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,mBAAoBA,QAAQ,iBA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J,QAAS5J,EAAKiK,gBACdH,WAAYlD,EACZmD,KAAM,CAAC/J,EAAKkK,SAAUxD,EAAQD,EAAuBzG,EAAKgK,aAC1DG,OAAO,MAKhBV,EA9B6B,GAgCxCA,EAAoBzD,WAAa,CAC7B,CAAEvE,KAAMzB,EAAKoK,SAAU9B,KAAM,CAAC,CAClBqB,UAAW,CAAC/F,EAAQuC;;;;;;;;;;;;;;;;;;;;;;AAiCpC5G,EAAQkK,oBAAsBA,EAC9BlK,EAAQqE,OAASA,EACjBrE,EAAQkH,sBAAwBA,EAChClH,EAAQ4G,SAAWA,EACnB5G,EAAQ8K,kDAAoDhK,EAC5Dd,EAAQ+K,kDAAoD5D,EAC5DnH,EAAQgL,kDAAoD3D,EAC5DrH,EAAQiL,kDAAoDlB,EAE5D/G,OAAOiB,eAAejE,EAAS,aAAc,CAAE4I,OAAO","sourcesContent":["/**\n * @license Angular v10.2.3\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :\n typeof define === 'function' && define.amd ? define('@angular/service-worker', ['exports', '@angular/common', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.serviceWorker = {}), global.ng.common, global.ng.core, global.rxjs, global.rxjs.operators));\n}(this, (function (exports, common, core, rxjs, operators) { 'use strict';\n\n /*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */\n /* global Reflect, Promise */\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b)\n if (b.hasOwnProperty(p))\n d[p] = b[p]; };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n 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]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n r = Reflect.decorate(decorators, target, key, desc);\n else\n for (var i = decorators.length - 1; i >= 0; i--)\n if (d = decorators[i])\n 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 }\n function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); };\n }\n function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n return Reflect.metadata(metadataKey, metadataValue);\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try {\n step(generator.next(value));\n }\n catch (e) {\n reject(e);\n } }\n function rejected(value) { try {\n step(generator[\"throw\"](value));\n }\n catch (e) {\n reject(e);\n } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function () { if (t[0] & 1)\n throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f)\n throw new TypeError(\"Generator is already executing.\");\n while (_)\n 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)\n return t;\n if (y = 0, t)\n 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 { value: op[1], done: false };\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])\n _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n }\n catch (e) {\n op = [6, e];\n y = 0;\n }\n finally {\n f = t = 0;\n }\n if (op[0] & 5)\n throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n var __createBinding = Object.create ? (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n }) : (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n o[k2] = m[k];\n });\n function __exportStar(m, exports) {\n for (var p in m)\n if (p !== \"default\" && !exports.hasOwnProperty(p))\n __createBinding(exports, m, p);\n }\n function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m)\n return m.call(o);\n if (o && typeof o.length === \"number\")\n return {\n next: function () {\n if (o && i >= o.length)\n o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }\n function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m)\n return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n ar.push(r.value);\n }\n catch (error) {\n e = { error: error };\n }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"]))\n m.call(i);\n }\n finally {\n if (e)\n throw e.error;\n }\n }\n return ar;\n }\n function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n }\n function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n }\n ;\n function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n }\n function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n])\n i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try {\n step(g[n](v));\n }\n catch (e) {\n settle(q[0][3], e);\n } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length)\n resume(q[0][0], q[0][1]); }\n }\n function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\n }\n function __asyncValues(o) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], 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 () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n }\n function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", { value: raw });\n }\n else {\n cooked.raw = raw;\n }\n return cooked;\n }\n ;\n var __setModuleDefault = Object.create ? (function (o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n }) : function (o, v) {\n o[\"default\"] = v;\n };\n function __importStar(mod) {\n if (mod && mod.__esModule)\n return mod;\n var result = {};\n if (mod != null)\n for (var k in mod)\n if (Object.hasOwnProperty.call(mod, k))\n __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n }\n function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n }\n function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n }\n function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n }\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 var ERR_SW_NOT_SUPPORTED = 'Service workers are disabled or not supported by this browser';\n function errorObservable(message) {\n return rxjs.defer(function () { return rxjs.throwError(new Error(message)); });\n }\n /**\n * @publicApi\n */\n var NgswCommChannel = /** @class */ (function () {\n function NgswCommChannel(serviceWorker) {\n this.serviceWorker = serviceWorker;\n if (!serviceWorker) {\n this.worker = this.events = this.registration = errorObservable(ERR_SW_NOT_SUPPORTED);\n }\n else {\n var controllerChangeEvents = rxjs.fromEvent(serviceWorker, 'controllerchange');\n var controllerChanges = controllerChangeEvents.pipe(operators.map(function () { return serviceWorker.controller; }));\n var currentController = rxjs.defer(function () { return rxjs.of(serviceWorker.controller); });\n var controllerWithChanges = rxjs.concat(currentController, controllerChanges);\n this.worker = controllerWithChanges.pipe(operators.filter(function (c) { return !!c; }));\n this.registration = (this.worker.pipe(operators.switchMap(function () { return serviceWorker.getRegistration(); })));\n var rawEvents = rxjs.fromEvent(serviceWorker, 'message');\n var rawEventPayload = rawEvents.pipe(operators.map(function (event) { return event.data; }));\n var eventsUnconnected = rawEventPayload.pipe(operators.filter(function (event) { return event && event.type; }));\n var events = eventsUnconnected.pipe(operators.publish());\n events.connect();\n this.events = events;\n }\n }\n NgswCommChannel.prototype.postMessage = function (action, payload) {\n return this.worker\n .pipe(operators.take(1), operators.tap(function (sw) {\n sw.postMessage(Object.assign({ action: action }, payload));\n }))\n .toPromise()\n .then(function () { return undefined; });\n };\n NgswCommChannel.prototype.postMessageWithStatus = function (type, payload, nonce) {\n var waitForStatus = this.waitForStatus(nonce);\n var postMessage = this.postMessage(type, payload);\n return Promise.all([waitForStatus, postMessage]).then(function () { return undefined; });\n };\n NgswCommChannel.prototype.generateNonce = function () {\n return Math.round(Math.random() * 10000000);\n };\n NgswCommChannel.prototype.eventsOfType = function (type) {\n var filterFn = function (event) { return event.type === type; };\n return this.events.pipe(operators.filter(filterFn));\n };\n NgswCommChannel.prototype.nextEventOfType = function (type) {\n return this.eventsOfType(type).pipe(operators.take(1));\n };\n NgswCommChannel.prototype.waitForStatus = function (nonce) {\n return this.eventsOfType('STATUS')\n .pipe(operators.filter(function (event) { return event.nonce === nonce; }), operators.take(1), operators.map(function (event) {\n if (event.status) {\n return undefined;\n }\n throw new Error(event.error);\n }))\n .toPromise();\n };\n Object.defineProperty(NgswCommChannel.prototype, \"isEnabled\", {\n get: function () {\n return !!this.serviceWorker;\n },\n enumerable: false,\n configurable: true\n });\n return NgswCommChannel;\n }());\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 * Subscribe and listen to\n * [Web Push\n * Notifications](https://developer.mozilla.org/en-US/docs/Web/API/Push_API/Best_Practices) through\n * Angular Service Worker.\n *\n * @usageNotes\n *\n * You can inject a `SwPush` instance into any component or service\n * as a dependency.\n *\n * <code-example path=\"service-worker/push/module.ts\" region=\"inject-sw-push\"\n * header=\"app.component.ts\"></code-example>\n *\n * To subscribe, call `SwPush.requestSubscription()`, which asks the user for permission.\n * The call returns a `Promise` with a new\n * [`PushSubscription`](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription)\n * instance.\n *\n * <code-example path=\"service-worker/push/module.ts\" region=\"subscribe-to-push\"\n * header=\"app.component.ts\"></code-example>\n *\n * A request is rejected if the user denies permission, or if the browser\n * blocks or does not support the Push API or ServiceWorkers.\n * Check `SwPush.isEnabled` to confirm status.\n *\n * Invoke Push Notifications by pushing a message with the following payload.\n *\n * ```ts\n * {\n * \"notification\": {\n * \"actions\": NotificationAction[],\n * \"badge\": USVString\n * \"body\": DOMString,\n * \"data\": any,\n * \"dir\": \"auto\"|\"ltr\"|\"rtl\",\n * \"icon\": USVString,\n * \"image\": USVString,\n * \"lang\": DOMString,\n * \"renotify\": boolean,\n * \"requireInteraction\": boolean,\n * \"silent\": boolean,\n * \"tag\": DOMString,\n * \"timestamp\": DOMTimeStamp,\n * \"title\": DOMString,\n * \"vibrate\": number[]\n * }\n * }\n * ```\n *\n * Only `title` is required. See `Notification`\n * [instance\n * properties](https://developer.mozilla.org/en-US/docs/Web/API/Notification#Instance_properties).\n *\n * While the subscription is active, Service Worker listens for\n * [PushEvent](https://developer.mozilla.org/en-US/docs/Web/API/PushEvent)\n * occurrences and creates\n * [Notification](https://developer.mozilla.org/en-US/docs/Web/API/Notification)\n * instances in response.\n *\n * Unsubscribe using `SwPush.unsubscribe()`.\n *\n * An application can subscribe to `SwPush.notificationClicks` observable to be notified when a user\n * clicks on a notification. For example:\n *\n * <code-example path=\"service-worker/push/module.ts\" region=\"subscribe-to-notification-clicks\"\n * header=\"app.component.ts\"></code-example>\n *\n * @see [Push Notifications](https://developers.google.com/web/fundamentals/codelabs/push-notifications/)\n * @see [Angular Push Notifications](https://blog.angular-university.io/angular-push-notifications/)\n * @see [MDN: Push API](https://developer.mozilla.org/en-US/docs/Web/API/Push_API)\n * @see [MDN: Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API)\n * @see [MDN: Web Push API Notifications best practices](https://developer.mozilla.org/en-US/docs/Web/API/Push_API/Best_Practices)\n *\n * @publicApi\n */\n var SwPush = /** @class */ (function () {\n function SwPush(sw) {\n this.sw = sw;\n this.subscriptionChanges = new rxjs.Subject();\n if (!sw.isEnabled) {\n this.messages = rxjs.NEVER;\n this.notificationClicks = rxjs.NEVER;\n this.subscription = rxjs.NEVER;\n return;\n }\n this.messages = this.sw.eventsOfType('PUSH').pipe(operators.map(function (message) { return message.data; }));\n this.notificationClicks =\n this.sw.eventsOfType('NOTIFICATION_CLICK').pipe(operators.map(function (message) { return message.data; }));\n this.pushManager = this.sw.registration.pipe(operators.map(function (registration) { return registration.pushManager; }));\n var workerDrivenSubscriptions = this.pushManager.pipe(operators.switchMap(function (pm) { return pm.getSubscription(); }));\n this.subscription = rxjs.merge(workerDrivenSubscriptions, this.subscriptionChanges);\n }\n Object.defineProperty(SwPush.prototype, \"isEnabled\", {\n /**\n * True if the Service Worker is enabled (supported by the browser and enabled via\n * `ServiceWorkerModule`).\n */\n get: function () {\n return this.sw.isEnabled;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Subscribes to Web Push Notifications,\n * after requesting and receiving user permission.\n *\n * @param options An object containing the `serverPublicKey` string.\n * @returns A Promise that resolves to the new subscription object.\n */\n SwPush.prototype.requestSubscription = function (options) {\n var _this = this;\n if (!this.sw.isEnabled) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n var pushOptions = { userVisibleOnly: true };\n var key = this.decodeBase64(options.serverPublicKey.replace(/_/g, '/').replace(/-/g, '+'));\n var applicationServerKey = new Uint8Array(new ArrayBuffer(key.length));\n for (var i = 0; i < key.length; i++) {\n applicationServerKey[i] = key.charCodeAt(i);\n }\n pushOptions.applicationServerKey = applicationServerKey;\n return this.pushManager.pipe(operators.switchMap(function (pm) { return pm.subscribe(pushOptions); }), operators.take(1))\n .toPromise()\n .then(function (sub) {\n _this.subscriptionChanges.next(sub);\n return sub;\n });\n };\n /**\n * Unsubscribes from Service Worker push notifications.\n *\n * @returns A Promise that is resolved when the operation succeeds, or is rejected if there is no\n * active subscription or the unsubscribe operation fails.\n */\n SwPush.prototype.unsubscribe = function () {\n var _this = this;\n if (!this.sw.isEnabled) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n var doUnsubscribe = function (sub) {\n if (sub === null) {\n throw new Error('Not subscribed to push notifications.');\n }\n return sub.unsubscribe().then(function (success) {\n if (!success) {\n throw new Error('Unsubscribe failed!');\n }\n _this.subscriptionChanges.next(null);\n });\n };\n return this.subscription.pipe(operators.take(1), operators.switchMap(doUnsubscribe)).toPromise();\n };\n SwPush.prototype.decodeBase64 = function (input) {\n return atob(input);\n };\n return SwPush;\n }());\n SwPush.decorators = [\n { type: core.Injectable }\n ];\n SwPush.ctorParameters = function () { return [\n { type: NgswCommChannel }\n ]; };\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 * Subscribe to update notifications from the Service Worker, trigger update\n * checks, and forcibly activate updates.\n *\n * @publicApi\n */\n var SwUpdate = /** @class */ (function () {\n function SwUpdate(sw) {\n this.sw = sw;\n if (!sw.isEnabled) {\n this.available = rxjs.NEVER;\n this.activated = rxjs.NEVER;\n return;\n }\n this.available = this.sw.eventsOfType('UPDATE_AVAILABLE');\n this.activated = this.sw.eventsOfType('UPDATE_ACTIVATED');\n }\n Object.defineProperty(SwUpdate.prototype, \"isEnabled\", {\n /**\n * True if the Service Worker is enabled (supported by the browser and enabled via\n * `ServiceWorkerModule`).\n */\n get: function () {\n return this.sw.isEnabled;\n },\n enumerable: false,\n configurable: true\n });\n SwUpdate.prototype.checkForUpdate = function () {\n if (!this.sw.isEnabled) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n var statusNonce = this.sw.generateNonce();\n return this.sw.postMessageWithStatus('CHECK_FOR_UPDATES', { statusNonce: statusNonce }, statusNonce);\n };\n SwUpdate.prototype.activateUpdate = function () {\n if (!this.sw.isEnabled) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n var statusNonce = this.sw.generateNonce();\n return this.sw.postMessageWithStatus('ACTIVATE_UPDATE', { statusNonce: statusNonce }, statusNonce);\n };\n return SwUpdate;\n }());\n SwUpdate.decorators = [\n { type: core.Injectable }\n ];\n SwUpdate.ctorParameters = function () { return [\n { type: NgswCommChannel }\n ]; };\n\n /**\n * Token that can be used to provide options for `ServiceWorkerModule` outside of\n * `ServiceWorkerModule.register()`.\n *\n * You can use this token to define a provider that generates the registration options at runtime,\n * for example via a function call:\n *\n * {@example service-worker/registration-options/module.ts region=\"registration-options\"\n * header=\"app.module.ts\"}\n *\n * @publicApi\n */\n var SwRegistrationOptions = /** @class */ (function () {\n function SwRegistrationOptions() {\n }\n return SwRegistrationOptions;\n }());\n var SCRIPT = new core.InjectionToken('NGSW_REGISTER_SCRIPT');\n function ngswAppInitializer(injector, script, options, platformId) {\n var initializer = function () {\n if (!(common.isPlatformBrowser(platformId) && ('serviceWorker' in navigator) &&\n options.enabled !== false)) {\n return;\n }\n // Wait for service worker controller changes, and fire an INITIALIZE action when a new SW\n // becomes active. This allows the SW to initialize itself even if there is no application\n // traffic.\n navigator.serviceWorker.addEventListener('controllerchange', function () {\n if (navigator.serviceWorker.controller !== null) {\n navigator.serviceWorker.controller.postMessage({ action: 'INITIALIZE' });\n }\n });\n var readyToRegister$;\n if (typeof options.registrationStrategy === 'function') {\n readyToRegister$ = options.registrationStrategy();\n }\n else {\n var _a = __read((options.registrationStrategy || 'registerWhenStable:30000').split(':')), strategy = _a[0], args = _a.slice(1);\n switch (strategy) {\n case 'registerImmediately':\n readyToRegister$ = rxjs.of(null);\n break;\n case 'registerWithDelay':\n readyToRegister$ = delayWithTimeout(+args[0] || 0);\n break;\n case 'registerWhenStable':\n readyToRegister$ = !args[0] ? whenStable(injector) :\n rxjs.merge(whenStable(injector), delayWithTimeout(+args[0]));\n break;\n default:\n // Unknown strategy.\n throw new Error(\"Unknown ServiceWorker registration strategy: \" + options.registrationStrategy);\n }\n }\n // Don't return anything to avoid blocking the application until the SW is registered.\n // Also, run outside the Angular zone to avoid preventing the app from stabilizing (especially\n // given that some registration strategies wait for the app to stabilize).\n // Catch and log the error if SW registration fails to avoid uncaught rejection warning.\n var ngZone = injector.get(core.NgZone);\n ngZone.runOutsideAngular(function () { return readyToRegister$.pipe(operators.take(1)).subscribe(function () { return navigator.serviceWorker.register(script, { scope: options.scope })\n .catch(function (err) { return console.error('Service worker registration failed with:', err); }); }); });\n };\n return initializer;\n }\n function delayWithTimeout(timeout) {\n return rxjs.of(null).pipe(operators.delay(timeout));\n }\n function whenStable(injector) {\n var appRef = injector.get(core.ApplicationRef);\n return appRef.isStable.pipe(operators.filter(function (stable) { return stable; }));\n }\n function ngswCommChannelFactory(opts, platformId) {\n return new NgswCommChannel(common.isPlatformBrowser(platformId) && opts.enabled !== false ? navigator.serviceWorker :\n undefined);\n }\n /**\n * @publicApi\n */\n var ServiceWorkerModule = /** @class */ (function () {\n function ServiceWorkerModule() {\n }\n /**\n * Register the given Angular Service Worker script.\n *\n * If `enabled` is set to `false` in the given options, the module will behave as if service\n * workers are not supported by the browser, and the service worker will not be registered.\n */\n ServiceWorkerModule.register = function (script, opts) {\n if (opts === void 0) { opts = {}; }\n return {\n ngModule: ServiceWorkerModule,\n providers: [\n { provide: SCRIPT, useValue: script },\n { provide: SwRegistrationOptions, useValue: opts },\n {\n provide: NgswCommChannel,\n useFactory: ngswCommChannelFactory,\n deps: [SwRegistrationOptions, core.PLATFORM_ID]\n },\n {\n provide: core.APP_INITIALIZER,\n useFactory: ngswAppInitializer,\n deps: [core.Injector, SCRIPT, SwRegistrationOptions, core.PLATFORM_ID],\n multi: true,\n },\n ],\n };\n };\n return ServiceWorkerModule;\n }());\n ServiceWorkerModule.decorators = [\n { type: core.NgModule, args: [{\n providers: [SwPush, SwUpdate],\n },] }\n ];\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 /**\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 // This file only reexports content of the `src` folder. Keep it that way.\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 /**\n * Generated bundle index. Do not edit.\n */\n\n exports.ServiceWorkerModule = ServiceWorkerModule;\n exports.SwPush = SwPush;\n exports.SwRegistrationOptions = SwRegistrationOptions;\n exports.SwUpdate = SwUpdate;\n exports.ɵangular_packages_service_worker_service_worker_a = NgswCommChannel;\n exports.ɵangular_packages_service_worker_service_worker_b = SCRIPT;\n exports.ɵangular_packages_service_worker_service_worker_c = ngswAppInitializer;\n exports.ɵangular_packages_service_worker_service_worker_d = ngswCommChannelFactory;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=service-worker.umd.js.map\n"]}
\No newline at end of file