(()=>{(function(){({initialize:function(){window.ReamazePushData&&(this.data=window.ReamazePushData,this.handleSubscription()),window.addEventListener("ReamazePushDataInit",function(){this.data=window.ReamazePushData,this.handleSubscription()}.bind(this))},handleSubscription:function(){let t="serviceWorker"in navigator&&"PushManager"in window,e=typeof Notification<"u"?Notification.permission:null;typeof this.data.customVapidToken<"u"?this.data.customVapidToken&&this.saveVapidToken(this.data.customVapidToken):t&&e==="granted"&&this._nonReamazeDomain()&&this.registerServiceWorker()},saveVapidToken:function(t){let e=new XMLHttpRequest;e.open("POST",this.data.baseDataUrl+"/data/push_tokens.json",!0),e.setRequestHeader("Content-Type","application/json");let i=JSON.stringify({sso:this.data.currentUser.ssoData(),push_token:{token:t,token_name:null,device_id:null,platform:"vapid",status:this.data.subscribed?"active":"paused"}});e.send(i)},applicationKey:function(){return this.urlB64ToUint8Array(this.data.publicKey?this.data.publicKey:"BB4X1o9wQvuF7xVsk1NSgSLQlw-UB-NvdYvpc67vxa9GuHOKCBhXM9QyJUiaAAtSILVblrunLrQeuMOYImJuoI8")},resetSubscription:function(t){t.pushManager.getSubscription().then(function(e){var i=this.applicationKey(),n=e?new Uint8Array(e.options.applicationServerKey):[];e&&this.data.enabled&&(i.length!==n.length||!i.every((s,a)=>s===n[a]))?e.unsubscribe().then(function(){this.subscribeToken(t)}):e||this.subscribeToken(t)}.bind(this))},registerServiceWorker:function(){var t=function(e){worker=null,e.installing?worker=e.installing:e.waiting?worker=e.waiting:e.active&&(worker=e.active),worker&&(worker.state==="activated"?this.resetSubscription(e):worker.addEventListener("statechange",function(i){i.target.state==="activated"&&this.resetSubscription(e)}.bind(this)))}.bind(this);navigator.serviceWorker.register("/apps/reamaze/sdks/rmzServiceWorker.js").then(t).catch(function(){navigator.serviceWorker.register("/sdks/rmzServiceWorker.js").then(t).catch(function(){navigator.serviceWorker.register("/content/rmzServiceWorker.js").then(t).catch(function(){navigator.serviceWorker.register("/rmzServiceWorker.js").then(t)})})}),navigator.serviceWorker.ready.then(function(e){this.subscribeToken(e)}.bind(this))},subscribeToken:function(t){t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:this.applicationKey()}).then(function(e){this.saveVapidToken(JSON.stringify(e.toJSON()))}.bind(this))},urlB64ToUint8Array:function(t){let e="=".repeat((4-t.length%4)%4),i=(t+e).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(i),s=new Uint8Array(n.length);for(let a=0;a