PageSourceSearch

https://assets.site.ua/js/push.js?id=3e9e40d60186326614b3

js site.ua collected 2026-10-02 02:33:02 UTC 28,914 bytes, 1 lines download raw bytes

vendor: 4,579 bytes, line 1
1(()=>{"use strict";var e=function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}};var t=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var r=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var n=function(n){return e(n)||t(n)||r()};var i,o=(function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new D(n||[]);return o._invoke=function(e,t,r){var n=h;return function(i,o){if(n===p)throw new Error("Generator is already running");if(n===f){if("throw"===i)throw o;return R()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=u(e,t,r);if("normal"===c.type){if(n=r.done?f:d,c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=f,r.method="throw",r.arg=c.arg)}}}(e,r,a),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h="suspendedStart",d="suspendedYield",p="executing",f="completed",l={};function v(){}function w(){}function _(){}var y={};y[o]=function(){return this};var g=Object.getPrototypeOf,b=g&&g(g(P([])));b&&b!==r&&n.call(b,o)&&(y=b);var m=_.prototype=v.prototype=Object.create(y);function S(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function k(e){function t(r,i,o,a){var s=u(e[r],e,i);if("throw"!==s.type){var c=s.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?Promise.resolve(h.__await).then((function(e){t("next",e,o,a)}),(function(e){t("throw",e,o,a)})):Promise.resolve(h).then((function(e){c.value=e,o(c)}),(function(e){return t("throw",e,o,a)}))}a(s.arg)}var r;this._invoke=function(e,n){function i(){return new Promise((function(r,i){t(e,n,r,i)}))}return r=r?r.then(i,i):i()}}function x(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method))return l;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var i=u(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,l;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function P(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:R}}function R(){return{value:t,done:!0}}return w.prototype=m.constructor=_,_.constructor=w,_[s]=w.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},S(k.prototype),k.prototype[a]=function(){return this},e.AsyncIterator=k,e.async=function(t,r,n,i){var o=new k(c(t,r,n,i));return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(m),m[s]="Generator",m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=P,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEac
1h(E),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),l}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(i={exports:{}},i.exports),i.exports);function a(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}var s=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function s(e){a(o,n,i,s,c,"next",e)}function c(e){a(o,n,i,s,c,"throw",e)}s(void 0)}))}};var c=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var h=function(e,t,r){return t&&u(e.prototype,t),r&&u(e,r),e};var d=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e};var p=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){d(e,t,r[t])}))}return e};function f(e){var t=e.method,r=e.path,n=e.body,i=void 0===n?null:n,a=e.headers,c=void 0===a?{}:a,u=e.credentials,h={method:t,headers:c,credentials:void 0===u?"same-origin":u};return null!==i&&(h.body=JSON.stringify(i),h.headers=p({"Content-Type":"application/json"},c)),fetch(r,h).then(function(){var e=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=3;break}return e.next=3,l(t);case 3:return e.prev=3,e.next=6,t.json();case 6:return e.abrupt("return",e.sent);case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t){return e.apply(this,arguments)}}())}function l(e){return v.apply(this,arguments)}function v(){return(v=s(o.mark((function e(t){var r,n,i,a,s,c;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.json();case 3:n=e.sent,i=n.error,a=void 0===i?"Unknown error":i,s=n.description,c=void 0===s?"No description":s,r="Unexpected status code ".concat(t.status,": ").concat(a,", ").concat(c),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),r="Unexpected status code ".concat(t.status,": Cannot parse error response");case 14:throw new Error(r);case 15:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)}var w=function(){function e(t){c(this,e),this._instanceId=t,this._dbConn=null}var t,r;
1return h(e,[{key:"connect",value:function(){var e=this;return new Promise((function(t,r){var n=indexedDB.open(e._dbName);n.onsuccess=function(r){var n=r.target.result;e._dbConn=n,e._readState().then((function(t){return null===t?e.clear():Promise.resolve()})).then(t)},n.onupgradeneeded=function(e){e.target.result.createObjectStore("beams",{keyPath:"instance_id"})},n.onerror=function(e){var t=new Error("Database error: ".concat(e.target.error));r(t)}}))}},{key:"clear",value:function(){return this._writeState({instance_id:this._instanceId,device_id:null,token:null,user_id:null})}},{key:"_readState",value:function(){var e=this;if(!this.isConnected)throw new Error("Cannot read value: DeviceStateStore not connected to IndexedDB");return new Promise((function(t,r){var n=e._dbConn.transaction("beams").objectStore("beams").get(e._instanceId);n.onsuccess=function(e){var r=e.target.result;r||t(null),t(r)},n.onerror=function(e){r(e.target.error)}}))}},{key:"_readProperty",value:(r=s(o.mark((function e(t){var r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._readState();case 2:if(null!==(r=e.sent)){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",r[t]||null);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_writeState",value:function(e){var t=this;if(!this.isConnected)throw new Error("Cannot write value: DeviceStateStore not connected to IndexedDB");return new Promise((function(r,n){var i=t._dbConn.transaction("beams","readwrite").objectStore("beams").put(e);i.onsuccess=function(e){r()},i.onerror=function(e){n(e.target.error)}}))}},{key:"_writeProperty",value:(t=s(o.mark((function e(t,r){var n;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._readState();case 2:return(n=e.sent)[t]=r,e.next=6,this._writeState(n);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"getToken",value:function(){return this._readProperty("token")}},{key:"setToken",value:function(e){return this._writeProperty("token",e)}},{key:"getDeviceId",value:function(){return this._readProperty("device_id")}},{key:"setDeviceId",value:function(e){return this._writeProperty("device_id",e)}},{key:"getUserId",value:function(){return this._readProperty("user_id")}},{key:"setUserId",value:function(e){return this._writeProperty("user_id",e)}},{key:"getLastSeenSdkVersion",value:function(){return this._readProperty("last_seen_sdk_version")}},{key:"setLastSeenSdkVersion",value:function(e){return this._writeProperty("last_seen_sdk_version",e)}},{key:"getLastSeenUserAgent",value:function(){return this._readProperty("last_seen_user_agent")}},{key:"setLastSeenUserAgent",value:function(e){return this._writeProperty("last_seen_user_agent",e)}},{key:"_dbName",get:function(){return"beams-".concat(this._instanceId)}},{key:"isConnected",get:function(){return null!==this._dbConn}}]),e}(),_="1.1.0",y=new RegExp("^(_|\\-|=|@|,|\\.|;|[A-Z]|[a-z]|[0-9])*$"),g="/service-worker.js?pusherBeamsWebSDKVersion=".concat(_),b=Object.freeze({PERMISSION_PROMPT_REQUIRED:"PERMISSION_PROMPT_REQUIRED",PERMISSION_GRANTED_NOT_REGISTERED_WITH_BEAMS:"PERMISSION_GRANTED_NOT_REGISTERED_WITH_BEAMS",PERMISSION_GRANTED_REGISTERED_WITH_BEAMS:"PERMISSION_GRANTED_REGISTERED_WITH_BEAMS",PERMISSION_DENIED:"PERMISSION_DENIED"}),m=function(){function e(t){if(c(this,e),!t)throw new Error("Config object required");var r=t.instanceId,n=t.endpointOverride,i=void 0===n?null:n,o=t.serviceWorkerRegistration,a=void 0===o?null:o;if(void 0===r)throw new Error("Instance ID is required");if("string"!=typeof r)throw new Error("Instance ID must be a string");if(0===r.length)throw new Error("Instance ID cannot be empty");if(!("indexedDB"in window))throw new Error("Pusher Beams does not support this browser version (IndexedDB not supported)");if(!window.isSecureContext)throw new Error("Pusher Beams relies on Service Workers, which only work in secure contexts. Check that your page is being served from localhost/over HTTPS");
1if(!("serviceWorker"in navigator))throw new Error("Pusher Beams does not support this browser version (Service Workers not supported)");if(!("PushManager"in window))throw new Error("Pusher Beams does not support this browser version (Web Push not supported)");if(a){var s=a.scope;if(!window.location.href.startsWith(s))throw new Error("Could not initialize Pusher web push: current page not in serviceWorkerRegistration scope (".concat(s,")"))}this.instanceId=r,this._deviceId=null,this._token=null,this._userId=null,this._serviceWorkerRegistration=a,this._deviceStateStore=new w(r),this._endpoint=i,this._ready=this._init()}var t,r,i,a,u,d,p,l,v,y,g,m,x,E,D,P,R,T,O,L,N,U;return h(e,[{key:"_init",value:(U=s(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this._deviceId){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this._deviceStateStore.connect();case 4:if(!this._serviceWorkerRegistration){e.next=9;break}return e.next=7,window.navigator.serviceWorker.ready;case 7:e.next=12;break;case 9:return e.next=11,k();case 11:this._serviceWorkerRegistration=e.sent;case 12:return e.next=14,this._detectSubscriptionChange();case 14:return e.next=16,this._deviceStateStore.getDeviceId();case 16:return this._deviceId=e.sent,e.next=19,this._deviceStateStore.getToken();case 19:return this._token=e.sent,e.next=22,this._deviceStateStore.getUserId();case 22:this._userId=e.sent;case 23:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{key:"_resolveSDKState",value:(N=s(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready;case 2:return e.next=4,this._detectSubscriptionChange();case 4:case"end":return e.stop()}}),e,this)}))),function(){return N.apply(this,arguments)})},{key:"_detectSubscriptionChange",value:(L=s(o.mark((function e(){var t,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._deviceStateStore.getToken();case 2:return t=e.sent,e.next=5,this._serviceWorkerRegistration.pushManager.getSubscription().then((function(e){return e?function(e){return btoa(JSON.stringify(e))}(e):null}));case 5:if(r=e.sent,t===r){e.next=13;break}return e.next=10,this._deviceStateStore.clear();case 10:this._deviceId=null,this._token=null,this._userId=null;case 13:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"getDeviceId",value:(O=s(o.mark((function e(){var t=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:return e.abrupt("return",this._ready.then((function(){return t._deviceId})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"getToken",value:(T=s(o.mark((function e(){var t=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:return e.abrupt("return",this._ready.then((function(){return t._token}
1)));case 3:case"end":return e.stop()}}),e,this)}))),function(){return T.apply(this,arguments)})},{key:"getUserId",value:(R=s(o.mark((function e(){var t=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:return e.abrupt("return",this._ready.then((function(){return t._userId})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return R.apply(this,arguments)})},{key:"_throwIfNotStarted",value:function(e){if(!this._deviceId)throw new Error("".concat(e,". SDK not registered with Beams. Did you call .start?"))}},{key:"start",value:(P=s(o.mark((function e(){var t,r,n,i;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:if(I()){e.next=4;break}return e.abrupt("return",this);case 4:if(null===this._deviceId){e.next=6;break}return e.abrupt("return",this);case 6:return e.next=8,this._getPublicKey();case 8:return t=e.sent,r=t.vapidPublicKey,e.next=12,this._getPushToken(r);case 12:return n=e.sent,e.next=15,this._registerDevice(n);case 15:return i=e.sent,e.next=18,this._deviceStateStore.setToken(n);case 18:return e.next=20,this._deviceStateStore.setDeviceId(i);case 20:return e.next=22,this._deviceStateStore.setLastSeenSdkVersion(_);case 22:return e.next=24,this._deviceStateStore.setLastSeenUserAgent(window.navigator.userAgent);case 24:return this._token=n,this._deviceId=i,e.abrupt("return",this);case 27:case"end":return e.stop()}}),e,this)}))),function(){return P.apply(this,arguments)})},{key:"getRegistrationState",value:(D=s(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:if("denied"!==Notification.permission){e.next=4;break}return e.abrupt("return",b.PERMISSION_DENIED);case 4:if("granted"!==Notification.permission||null===this._deviceId){e.next=6;break}return e.abrupt("return",b.PERMISSION_GRANTED_REGISTERED_WITH_BEAMS);case 6:if("granted"!==Notification.permission||null!==this._deviceId){e.next=8;break}return e.abrupt("return",b.PERMISSION_GRANTED_NOT_REGISTERED_WITH_BEAMS);case 8:return e.abrupt("return",b.PERMISSION_PROMPT_REQUIRED);case 9:case"end":return e.stop()}}),e,this)}))),function(){return D.apply(this,arguments)})},{key:"addDeviceInterest",value:(E=s(o.mark((function e(t){var r,n;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:return this._throwIfNotStarted("Could not add Device Interest"),S(t),r="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/devices/web/").concat(this._deviceId,"/interests/").concat(encodeURIComponent(t)),n={method:"POST",path:r},e.next=8,f(n);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"removeDeviceInterest",value:(x=s(o.mark((function e(t){var r,n;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:return this._throwIfNotStarted("Could not remove Device Interest"),S(t),r="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/devices/web/").concat(this._deviceId,"/interests/").concat(encodeURIComponent(t)),n={method:"DELETE",path:r},e.next=8,f(n);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"getDeviceInterests",value:(m=s(o.mark((function e(){var t,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:return this._throwIfNotStarted("Could not get Device Interests"),t="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/devices/web/").concat(this._deviceId,"/interests"),r={method:"GET",path:t},e.next=7,f(r);case 7:if(e.t0=e.sent.interests,e.t0){e.next=10;break}e.t0=[];case 10:return e.abrupt("return",e.t0);case 11:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"setDeviceInterests",value:(g=s(o.mark((function e(t){var r,n,i,a,s,c,u,h,d;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:if(this._throwIfNotStarted("Could not set Device Interests"),null!=t){e.next=5;break}throw new Error("interests argument is required");case 5:if(Array.isArray(t)){e.next=7;break}throw new Error("interests argument must be an array");case 7:if(!(t.length>5e3)){e.next=9;break}throw new Error("Number of interests (".concat(t.length,") exceeds maximum of ").concat(5e3));case 9:for(r=!0,n=!1,i=void 0,e.prev=12,a=t[Symbol.iterator]();!(r=(s=a.next()).done);r=!0)c=s.value,S(c);e.next=20;break;case 16:e.prev=16,e.t0=e.catch(12),n=!0,i=e.t0;case 20:e.prev=20,e.prev=21,r||null==a.return||a.return();case 23:if(e.prev=23,!n){e.next=26;break}throw i;case 26:return e.finish(23);case 27:return e.finish(20);case 28:return u=Array.from(new Set(t)),h="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/devices/web/").concat(this._deviceId,"/interests"),d={method:"PUT",path:h,body:{interests:u}},e.next=33,f(d);case 33:case"end":return e.stop()}}),e,this,[[12,16,20,28],[21,,23,27]])}))),function(e){return g.apply(this,arguments)})},{key:"clearDeviceInterests",value:(y=s(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:return this._throwIfNotStarted("Could not clear Device Interests"),e.next=5,this.setDeviceInterests([]);case 5:case"end":return e.stop()}}),e,this)}))),function(){return y.apply(this,arguments)})},{key:"setUserId",value:(v=s(o.mark((function e(t,r){var n,i,a,s,c;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:if(I()){e.next=4;break}return e.abrupt("return");case 4:if(null!==this._deviceId){e.next=7;break}return n=new Error(".start must be called before .setUserId"),e.abrupt("return",Promise.reject(n));case 7:if("string"==typeof t){e.next=9;break}throw new Error("User ID must be a string (was ".concat(t,")"));case 9:if(""!==t){e.next=11;break}throw new Error("User ID cannot be the empty string");case 11:if(null===this._userId||this._userId===t){e.next=13;break}throw new Error("Changing the `userId` is not allowed.");case 13:return i="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/devices/web/").concat(this._deviceId,"/user"),e.next=16,r.fetchToken(t);case 16:return a=e.sent,s=a.token,c={method:"PUT",path:i,headers:{Authorization:"Bearer ".concat(s)}},e.next=21,f(c);case 21:return this._userId=t,e.abrupt("return",this._deviceStateStore.setUserId(t));case 23:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"stop",value:(l=s(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._resolveSDKState();case 2:if(I()){e.next=4;break}return e.abrupt("return");case 4:if(null!==this._deviceId){e.next=6;break}return e.abrupt("return");case 6:return e.next=8,this._deleteDevice();case 8:return e.next=10,this._deviceStateStore.clear();case 10:this._clearPushToken().catch((function(){})),this._deviceId=null,this._token=null,this._userId=null;case 14:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"clearAllState",value:(p=s(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(I()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.stop();case 4:return e.next=6,this.start();case 6:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"_getPublicKey",value:(d=s(o.mark((function e(){var t,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/web-vapid-public-key"),r={method:"GET",path:t},e.abrupt("return",f(r));case 3:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"_getPushToken",value:(u=s(o.mark((function e(t){var r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._clearPushToken();case 3:return e.next=5,this._serviceWorkerRegistration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:(i=t,o=void 0,a=void 0,s=void 0,o="=".repeat((4-i.length%4)%4),a=(i+o).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(a),Uint8Array.from(n(s).map((function(e){return e.charCodeAt(0)}))))});case 5:return r=e.sent,e.abrupt("return",btoa(JSON.stringify(r)));case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 12:case"end":return e.stop()}var i,o,a,s}),e,this,[[0,9]])}))),function(e){return u.apply(this,arguments)})},{key:"_clearPushToken",value:(a=s(o.mark((function e(){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",navigator.serviceWorker.ready.then((function(e){return e.pushManager.getSubscription()})).then((function(e){e&&e.unsubscribe()})));case 1:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"_registerDevice",value:(i=s(o.mark((function e(t){var r,n,i;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/devices/web"),n={method:"POST",path:r,body:{token:t,metadata:{sdkVersion:_}}},e.next=5,f(n);case 5:return i=e.sent,e.abrupt("return",i.id);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_deleteDevice",value:(r=s(o.mark((function e(){var t,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/devices/web/").concat(encodeURIComponent(this._deviceId)),r={method:"DELETE",path:t},e.next=4,f(r);case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"_updateDeviceMetadata",value:(t=s(o.mark((function e(){var t,r,n,i,a;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.navigator.userAgent,e.next=3,this._deviceStateStore.getLastSeenUserAgent();case 3:return r=e.sent,e.next=6,this._deviceStateStore.getLastSeenSdkVersion();case 6:if(n=e.sent,t!==r||_!==n){e.next=9;break}return e.abrupt("return");case 9:return i="".concat(this._baseURL,"/device_api/v1/instances/").concat(encodeURIComponent(this.instanceId),"/devices/web/").concat(this._deviceId,"/metadata"),a={method:"PUT",path:i,body:{sdkVersion:_}},e.next=14,f(a);case 14:return e.next=16,this._deviceStateStore.setLastSeenSdkVersion(_);case 16:return e.next=18,this._deviceStateStore.setLastSeenUserAgent(t);case 18:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_baseURL",get:function(){return null!==this._endpoint?this._endpoint:"https://".concat(this.instanceId,".pushnotifications.pusher.com")}}]),e}(),S=function(e){if(null==e)throw new Error("Interest name is required");if("string"!=typeof e)throw new Error("Interest ".concat(e," is not a string"));if(!y.test(e))throw new Error('interest "'.concat(e,'" contains a forbidden character. ')+"Allowed characters are: ASCII upper/lower-case letters, numbers or one of _-=@,.;");if(e.length>164)throw new Error("Interest is longer than the maximum of ".concat(164," chars"))};function k(){return x.apply(this,arguments)}function x(){return(x=s(o.mark((function e(){var t;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(g);case 2:if(t=e.sent,200===t.status){e.next=6;break}throw new Error("Cannot start SDK, service worker missing: No file found at /service-worker.js");case 6:return window.navigator.serviceWorker.register(g,{updateViaCache:"none"}),e.abrupt("return",window.navigator.serviceWorker.ready);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(){var e=window.navigator,t=e.vendor,r=null!==window.chrome&&void 0!==window.chrome,n=e.userAgent.indexOf("OPR")>-1,i=e.userAgent.indexOf("Edg")>-1,o=e.userAgent.indexOf("Firefox")>-1,a=r&&"Google Inc."===t&&!i&&!n||n||o||i;
1return a||console.warn("Pusher Web Push Notifications supports Chrome, Firefox, Edge and Opera."),a}var E=document.currentScript.dataset.instanceId,D=document.currentScript.dataset.interest,P=new m({instanceId:E});P.start().then((function(){return P.addDeviceInterest(D)})).then((function(){return console.log("Subscribed")})).catch(console.error)})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.