OneSignalSDK.js

!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=91)}([function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0)for(var s=0;s0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=0;i--){n[i]===t&&n.splice(i,1)}},e}();t.WorkerMessengerReplyBuffer=p;var h=function(){function e(e,t){void 0===t&&(t=new p),this.context=e,this.replies=t,this.debug=!0}return e.prototype.broadcast=function(e,t){return i(this,void 0,void 0,function(){var n,i,o,s;return r(this,function(r){switch(r.label){case 0:return u.default.getWindowEnv()===l.WindowEnvironmentKind.ServiceWorker?[3,1]:[2];case 1:return[4,self.clients.matchAll({type:"window",includeUncontrolled:!0})];case 2:for(n=r.sent(),i=0,o=n;i Page] Broadcasting '"+e.toString()+"' to window client "+s.url+"."),s.postMessage({command:e,payload:t});r.label=3;case 3:return[2]}})})},e.prototype.unicast=function(e,t,n){return i(this,void 0,void 0,function(){return r(this,function(i){switch(i.label){case 0:if(u.default.getWindowEnv()!==l.WindowEnvironmentKind.ServiceWorker)return[3,1];if(!n)throw new a.InvalidArgumentError("windowClient",a.InvalidArgumentReason.Empty);return f.default.debug("[Worker Messenger] [SW -> Page] Unicasting '"+e.toString()+"' to window client "+n.url+"."),n.postMessage({command:e,payload:t}),[3,4];case 1:return[4,this.isWorkerControllingPage()];case 2:return i.sent()||f.default.debug("[Worker Messenger] The page is not controlled by the service worker yet. Waiting...",self.registration),[4,this.waitUntilWorkerControlsPage()];case 3:i.sent(),f.default.debug("[Worker Messenger] [Page -> SW] Unicasting '"+e.toString()+"' to service worker."),navigator.serviceWorker.controller.postMessage({command:e,payload:t}),i.label=4;case 4:return[2]}})})},e.prototype.listen=function(e){return i(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return d.default.supportsServiceWorkers()?u.default.getWindowEnv()!==l.WindowEnvironmentKind.ServiceWorker?[3,1]:(self.addEventListener("message",this.onWorkerMessageReceivedFromPage.bind(this)),f.default.debug("[Worker Messenger] Service worker is now listening for messages."),[3,3]):[2];case 1:return[4,this.listenForPage(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},e.prototype.listenForPage=function(e){return i(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return e?[3,3]:[4,this.isWorkerControllingPage()];case 1:return t.sent()||f.default.debug("("+location.origin+") [Worker Messenger] The page is not controlled by the service worker yet. Waiting...",self.registration),[4,this.waitUntilWorkerControlsPage()];case 2:t.sent(),f.default.debug("("+location.origin+") [Worker Messenger] The page is now controlled by the service worker."),t.label=3;case 3:return navigator.serviceWorker.addEventListener("message",this.onPageMessageReceivedFromServiceWorker.bind(this)),f.default.debug("("+location.origin+") [Worker Messenger] Page is now listening for messages."),[2]}})})},e.prototype.onWorkerMessageReceivedFromPage=function(e){var t=e.data;if(t&&t.command){var n=this.replies.findListenersForMessage(t.command),i=[],r=[];f.default.debug("[Worker Messenger] Service worker received message:",e.data);for(var o=0,s=n;o=0;a--){var u=i[a];this.replies.deleteListenerRecord(t.command,u)}for(var c=0,l=r;c=0;a--){var u=i[a];this.replies.deleteListenerRecord(t.command,u)}for(var c=0,l=r;c0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1] to the first element in ."))}},e.getNotificationTypeFromOptIn=function(e){return 1==e||null==e?1:-2},e.wasHttpsNativePromptDismissed=function(){return"dismissed"===d.default.getItem("onesignal-notification-prompt")},e.markHttpPopoverShown=function(){sessionStorage.setItem("ONESIGNAL_HTTP_PROMPT_SHOWN","true")},e.isHttpPromptAlreadyShown=function(){return"true"==sessionStorage.getItem("ONESIGNAL_HTTP_PROMPT_SHOWN")},e.checkAndTriggerNotificationPermissionChanged=function(){return i(this,void 0,void 0,function(){var e,t;return r(this,function(n){switch(n.label){case 0:return[4,c.default.get("Options","notificationPermission")];case 1:return e=n.sent(),[4,OneSignal.getNotificationPermission()];case 2:return t=n.sent(),e===t?[3,5]:[4,l.triggerNotificationPermissionChanged()];case 3:return n.sent(),[4,c.default.put("Options",{key:"notificationPermission",value:t})];case 4:n.sent(),n.label=5;case 5:return[2]}})})},e.getNotificationIcons=function(){return i(this,void 0,void 0,function(){var t,n,i;return r(this,function(r){switch(r.label){case 0:return[4,e.getAppId()];case 1:if(!(t=r.sent()))throw new s.InvalidStateError(s.InvalidStateReason.MissingAppId);return n=u.default.getOneSignalApiUrl().toString()+"/apps/"+t+"/icon",[4,fetch(n)];case 2:return[4,r.sent().json()];case 3:if((i=r.sent()).errors)throw f.default.error("API call %c"+n,l.getConsoleStyle("code"),"failed with:",i.errors),new Error("Failed to get notification icons.");return[2,i]}})})},e.getSlidedownPermissionMessageOptions=function(){var e=OneSignal.config.userConfig.promptOptions;return e?e&&!e.slidedown?e:{actionMessage:e.slidedown.actionMessage,acceptButtonText:e.slidedown.acceptButtonText,cancelButtonText:e.slidedown.cancelButtonText}:null},e.getFullscreenPermissionMessageOptions=function(){var e=OneSignal.config.userConfig.promptOptions;return e?e&&!e.fullscreen?e:{autoAcceptTitle:e.fullscreen.autoAcceptTitle,actionMessage:e.fullscreen.actionMessage,exampleNotificationTitleDesktop:e.fullscreen.title,exampleNotificationTitleMobile:e.fullscreen.title,exampleNotificationMessageDesktop:e.fullscreen.message,exampleNotificationMessageMobile:e.fullscreen.message,exampleNotificationCaption:e.fullscreen.caption,acceptButtonText:e.fullscreen.acceptButton,cancelButtonText:e.fullscreen.cancelButton}:null},e.getPromptOptionsQueryString=function(){var t="";if(e.getFullscreenPermissionMessageOptions())for(var n=e.getPromptOptionsPostHash(),i=0,r=Object.keys(n);i0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]{{prompt.native.grant}}{{prompt.native.grant}} to receive notifications"),this.text["message.action.unsubscribed"]||(this.text["message.action.unsubscribed"]="You won't receive notifications again"),this.text["dialog.main.title"]||(this.text["dialog.main.title"]="Manage Site Notifications"),this.text["dialog.main.button.subscribe"]||(this.text["dialog.main.button.subscribe"]="SUBSCRIBE"),this.text["dialog.main.button.unsubscribe"]||(this.text["dialog.main.button.unsubscribe"]="UNSUBSCRIBE"),this.text["dialog.blocked.title"]||(this.text["dialog.blocked.title"]="Unblock Notifications"),this.text["dialog.blocked.message"]||(this.text["dialog.blocked.message"]="Follow these instructions to allow notifications:"),this._launcher=N,this.state=e.STATES.UNINITIALIZED,this._ignoreSubscriptionState=!1,b.default.emitter.on(e.EVENTS.SUBSCRIBE_CLICK,function(){x.dialog.subscribeButton.disabled=!0,x._ignoreSubscriptionState=!0,b.default.setSubscription(!0).then(function(){return x.dialog.subscribeButton.disabled=!1,x.dialog.hide()}).then(function(){return x.message.display(h.default.TYPES.MESSAGE,x.text["message.action.resubscribed"],h.default.TIMEOUT)}).then(function(){return x._ignoreSubscriptionState=!1,x.launcher.clearIfWasInactive(),x.launcher.inactivate()}).then(function(){return x.updateState()})}),b.default.emitter.on(e.EVENTS.UNSUBSCRIBE_CLICK,function(){x.dialog.unsubscribeButton.disabled=!0,b.default.setSubscription(!1).then(function(){return x.dialog.unsubscribeButton.disabled=!1,x.dialog.hide()}).then(function(){return x.launcher.clearIfWasInactive(),x.launcher.activate()}).then(function(){return x.message.display(h.default.TYPES.MESSAGE,x.text["message.action.unsubscribed"],h.default.TIMEOUT)}).then(function(){return x.updateState()})}),b.default.emitter.on(e.EVENTS.HOVERING,function(){x.hovering=!0,x.launcher.activateIfInactive(),x.message.shown||x.dialog.shown?x.hovering=!1:x.message.contentType!==h.default.TYPES.MESSAGE?new Promise(function(e){if(x.message.queued.length>0)return x.message.dequeue().then(function(t){x.message.content=t,x.message.contentType=h.default.TYPES.QUEUED,e()});x.message.content=c.decodeHtmlEntities(x.message.getTipForState()),x.message.contentType=h.default.TYPES.TIP,e()}).then(function(){return x.message.show()}).then(function(){x.hovering=!1}):x.hovering=!1}),b.default.emitter.on(e.EVENTS.HOVERED,function(){x.message.contentType!==h.default.TYPES.MESSAGE&&x.dialog.hidden&&(x.hovering&&(x.hovering=!1,x.message.waitUntilShown().then(function(){return c.delay(h.default.TIMEOUT)}).then(function(){return x.message.hide()}).then(function(){x.launcher.wasInactive&&x.dialog.hidden&&(x.launcher.inactivate(),x.launcher.wasInactive=null)})),x.message.shown&&x.message.hide().then(function(){x.launcher.wasInactive&&x.dialog.hidden&&(x.launcher.inactivate(),x.launcher.wasInactive=null)}))}),b.default.emitter.on(b.default.EVENTS.SUBSCRIPTION_CHANGED,function(t){return i(x,void 0,void 0,function(){var n,i=this;return r(this,function(r){switch(r.label){case 0:return 1!=t?[3,2]:(this.badge.shown&&this.options.prenotify&&this.badge.hide(),null!==this.dialog.notificationIcons?[3,2]:[4,u.default.getNotificationIcons()]);case 1:n=r.sent(),this.dialog.notificationIcons=n,r.label=2;case 2:return b.default.getNotificationPermission(function(n){i.setState(t?e.STATES.SUBSCRIBED:"denied"===n?e.STATES.BLOCKED:e.STATES.UNSUBSCRIBED,i._ignoreSubscriptionState)}),[2]}})})}),b.default.emitter.on(e.EVENTS.STATE_CHANGED,function(t){x.launcher.element&&(t.to===e.STATES.SUBSCRIBED?x.launcher.inactivate():(t.to===e.STATES.UNSUBSCRIBED||e.STATES.BLOCKED)&&x.launcher.activate())}),b.default.emitter.on(b.default.EVENTS.NATIVE_PROMPT_PERMISSIONCHANGED,function(){x.updateState()}),this.updateState()}}return Object.defineProperty(e,"EVENTS",{get:function(){return{STATE_CHANGED:"notifyButtonStateChange",LAUNCHER_CLICK:"notifyButtonLauncherClick",BELL_CLICK:"notifyButtonButtonClick",SUBSCRIBE_CLICK:"notifyButtonSubscribeClick",UNSUBSCRIBE_CLICK:"notifyButtonUnsubscribeClick",HOVERING:"notifyButtonHovering",HOVERED:"notifyButtonHover"}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"STATES",{get:function(){return{UNINITIALIZED:"uninitialized",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed",BLOCKED:"blocked"}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"TEXT_SUBS",{get:function(){return{"prompt.native.grant":{default:"Allow",chrome:"Allow",firefox:"Always Receive Notifications",safari:"Allow"}}},enumerable:!0,configurable:!0}),e.prototype.showDialogProcedure=function(){var e=this;this.dialog.shown||this.dialog.show().then(function(){c.once(document,"click",function(t,n){e.dialog.element.contains(t.target)||(n(),e.dialog.shown&&e.dialog.hide().then(function(){e.launcher.inactivateIfWasInactive()}))},!0)})},e.prototype.create=function(){return i(this,void 0,void 0,function(){var e,t,n,i,o=this;return r(this,function(r){switch(r.label){case 0:return this.options.enable?[4,b.default.context.dynamicResourceLoader.loadSdkStylesheet()]:[2];case 1:return 0!==r.sent()?(g.default.debug("Not showing notify button because styles failed to load."),[2]):(this.container&&c.removeDomElement("#onesignal-bell-container"),c.addDomElement("body","beforeend",'
'),c.addDomElement(this.container,"beforeend",'
'),c.addDomElement(this.launcher.selector,"beforeend",'
'),c.addDomElement(this.launcher.selector,"beforeend",'
'),c.addDomElement(this.launcher.selector,"beforeend",'
'),c.addDomElement(this.message.selector,"beforeend",'
'),c.addDomElement(this.launcher.selector,"beforeend",'
'),c.addDomElement(this.dialog.selector,"beforeend",'
'),c.addDomElement(this.button.selector,"beforeEnd",''),[4,b.default.isPushNotificationsEnabled()]);case 2:return e=r.sent(),[4,b.default.getSubscription()];case 3:return t=r.sent(),[4,u.default.wasHttpsNativePromptDismissed()];case 4:return n=r.sent(),i=e?"small":this.options.size,[4,this.launcher.resize(i)];case 5:if(r.sent(),"bottom-left"===this.options.position)c.addCssClass(this.container,"onesignal-bell-container-bottom-left"),c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-bottom-left");else{if("bottom-right"!==this.options.position)throw new Error("Invalid OneSignal notify button position "+this.options.position);c.addCssClass(this.container,"onesignal-bell-container-bottom-right"),c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-bottom-right")}if("default"===this.options.theme)c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-theme-default");else{if("inverse"!==this.options.theme)throw new Error("Invalid OneSignal notify button theme "+this.options.theme);c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-theme-inverse")}return this.applyOffsetIfSpecified(),this.setCustomColorsIfSpecified(),this.patchSafariSvgFilterBug(),g.default.info("Showing the notify button."),[4,(e?this.launcher.inactivate():c.nothing()).then(function(){return b.default.getSubscription()}).then(function(t){return!e&&t||null!==o.dialog.notificationIcons?c.nothing():u.default.getNotificationIcons().then(function(e){o.dialog.notificationIcons=e})}).then(function(){return c.delay(o.options.showLauncherAfter)}).then(function(){return c.isUsingSubscriptionWorkaround()&&t&&!0!==n&&!e&&!0===b.default.config.userConfig.autoRegister&&!u.default.isHttpPromptAlreadyShown()?(g.default.debug("Not showing notify button because popover will be shown."),c.nothing()):o.launcher.show()}).then(function(){return c.delay(o.options.showBadgeAfter)}).then(function(){return o.options.prenotify&&!e&&b.default._isNewVisitor?o.message.enqueue(o.text["message.prenotify"]).then(function(){return o.badge.show()}):c.nothing()}).then(function(){return o.initialized=!0})];case 6:return r.sent(),[2]}})})},e.prototype.patchSafariSvgFilterBug=function(){if(!(s.default.safari&&Number(s.default.version)>=9.1)){var e="drop-shadow(0 2px 4px rgba(34,36,38,0.35));",t="drop-shadow(0 2px 4px rgba(34,36,38,0));",n="drop-shadow(0px 2px 2px rgba(34,36,38,.15));";this.graphic.setAttribute("style","filter: "+e+"; -webkit-filter: "+e+";"),this.badge.element.setAttribute("style","filter: "+t+"; -webkit-filter: "+t+";"),this.dialog.element.setAttribute("style","filter: "+n+"; -webkit-filter: "+n+";")}s.default.safari&&this.badge.element.setAttribute("style","display: none;")},e.prototype.applyOffsetIfSpecified=function(){var e=this.options.offset;e&&(this.launcher.element.style.cssText="",e.bottom&&(this.launcher.element.style.cssText+="bottom: "+e.bottom+";"),"bottom-right"===this.options.position?e.right&&(this.launcher.element.style.cssText+="right: "+e.right+";"):"bottom-left"===this.options.position&&e.left&&(this.launcher.element.style.cssText+="left: "+e.left+";"))},e.prototype.setCustomColorsIfSpecified=function(){var e=this.dialog.element.querySelector("button.action"),t=this.button.element.querySelector(".pulse-ring");this.graphic.querySelector(".background").style.cssText="";for(var n=this.graphic.querySelectorAll(".foreground"),i=0;i0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0))for(var n=0,i=t.buttons;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]OneSignal: This page cannot be directly opened, and must be opened as a result of a subscription call."),[2,Promise.resolve()]):((e=i({},this.options)).appId=e.appId,e.subdomainName=e.subdomain,e.origin=e.origin,OneSignal.config=e||{},[4,(new c.default).getAppConfig(e)]);case 1:return t=r.sent(),OneSignal.context=new u.default(t),OneSignal.context.workerMessenger.listen(!0),OneSignal.initialized=!0,this.loadPromise={},this.loadPromise.promise=new Promise(function(e,t){n.loadPromise.resolver=e,n.loadPromise.rejector=t}),this.establishCrossOriginMessaging(),[2,this.loadPromise.promise]}})})},e.prototype.establishCrossOriginMessaging=function(){},e.prototype.dispose=function(){this.messenger.destroy()},e.prototype.finishInitialization=function(){this.loadPromise.resolver()},e.prototype.subscribe=function(){return r(this,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return e=n.sent(),t=opener||parent,e?t&&window.close():a.default.registerForPush(),[2]}})})},e}();t.default=l},function(e,t,n){"use strict";var i,r,o;Object.defineProperty(t,"__esModule",{value:!0}),(i=t.ConfigIntegrationKind||(t.ConfigIntegrationKind={})).TypicalSite="typical",i.WordPress="wordpress",i.Shopify="shopify",i.Blogger="blogger",i.Magento="magento",i.Drupal="drupal",i.SquareSpace="squarespace",i.Joomla="joomla",i.Weebly="weebly",i.Wix="wix",i.Custom="custom",(r=t.NotificationClickMatchBehavior||(t.NotificationClickMatchBehavior={})).Exact="exact",r.Origin="origin",(o=t.NotificationClickActionBehavior||(t.NotificationClickActionBehavior={})).Navigate="navigate",o.Focus="focus"},function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=i(n(6)),s=i(n(2)),a=i(n(35)),u=function(){function e(e,t,n,i,r,o,s){void 0===i&&(i="shown"),void 0===r&&(r=["opacity","transform"]),void 0===s&&(s=500),this.selector=e,this.showClass=t,this.hideClass=n,this.state=i,this.targetTransitionEvents=r,this.nestedContentSelector=o,this.transitionCheckTimeout=s}return e.prototype.show=function(){var t=this;return this.hidden?new Promise(function(n){if(t.state="showing",o.default.trigger(e.EVENTS.SHOWING,t),t.hideClass&&r.removeCssClass(t.element,t.hideClass),t.showClass&&r.addCssClass(t.element,t.showClass),0==t.targetTransitionEvents.length)return n(t);var i=setTimeout(function(){s.default.debug("Element did not completely show (state: "+t.state+").")},t.transitionCheckTimeout);r.once(t.element,"transitionend",function(s,a){if(s.target===t.element&&r.contains(t.targetTransitionEvents,s.propertyName))return clearTimeout(i),a(),t.state="shown",o.default.trigger(e.EVENTS.SHOWN,t),n(t)},!0)}):Promise.resolve(this)},e.prototype.hide=function(){var t=this;return this.shown?new Promise(function(n){if(t.state="hiding",o.default.trigger(e.EVENTS.HIDING,t),t.showClass&&r.removeCssClass(t.element,t.showClass),t.hideClass&&r.addCssClass(t.element,t.hideClass),0==t.targetTransitionEvents.length)return n(t);r.once(t.element,"transitionend",function(i,a){var u=setTimeout(function(){s.default.debug("Element did not completely hide (state: "+t.state+").")},t.transitionCheckTimeout);if(i.target===t.element&&r.contains(t.targetTransitionEvents,i.propertyName))return clearTimeout(u),a(),t.state="hidden",o.default.trigger(e.EVENTS.HIDDEN,t),n(t)},!0)}):Promise.resolve(this)},e.prototype.waitUntilShown=function(){var t=this;return"shown"===this.state?Promise.resolve(this):new Promise(function(n){a.default.emitter.once(e.EVENTS.SHOWN,function(e){if(e===t)return n(t)})})},e.prototype.waitUntilHidden=function(){var t=this;return"hidden"===this.state?Promise.resolve(this):new Promise(function(n){a.default.emitter.once(e.EVENTS.HIDDEN,function(e){if(e===t)return n(t)})})},Object.defineProperty(e,"EVENTS",{get:function(){return{SHOWING:"animatedElementShowing",SHOWN:"animatedElementShown",HIDING:"animatedElementHiding",HIDDEN:"animatedElementHidden"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this.nestedContentSelector?this.element.querySelector(this.nestedContentSelector).innerHTML:this.element.innerHTML},set:function(e){this.nestedContentSelector?this.element.querySelector(this.nestedContentSelector).innerHTML=e:this.element.innerHTML=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return document.querySelector(this.selector)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showing",{get:function(){return"showing"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shown",{get:function(){return"shown"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hiding",{get:function(){return"hiding"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return"hidden"===this.state},enumerable:!0,configurable:!0}),e}();t.default=u},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=i]:[2,!1];case 12:return[2]}})})},e.prototype.isSubscriptionExpiringForSecureIntegration=function(){return i(this,void 0,void 0,function(){var e,t,n,i,o;return r(this,function(r){switch(r.label){case 0:return[4,this.context.serviceWorkerManager.getActiveState()];case 1:return(e=r.sent())!==E.ServiceWorkerActiveState.WorkerA&&e!==E.ServiceWorkerActiveState.WorkerB?[2,!1]:[4,navigator.serviceWorker.getRegistration()];case 2:return[4,r.sent().pushManager.getSubscription()];case 3:return(t=r.sent())&&t.expirationTime?[4,S.default.getSubscription()]:[2,!1];case 4:return(n=r.sent().createdAt)||(i=31536e6,n=(new Date).getTime()+i),o=n+(t.expirationTime-n)/2,[2,t.expirationTime&&((new Date).getTime()>=t.expirationTime||(new Date).getTime()>=o)]}})})},e.prototype.getSubscriptionState=function(){return i(this,void 0,void 0,function(){var t,n,i,o;return r(this,function(r){switch(r.label){case 0:if(e.isSafari())return[2,this.getSubscriptionStateForSecure()];switch(t=y.default.getWindowEnv(),t){case v.WindowEnvironmentKind.ServiceWorker:return[3,1]}return[3,4];case 1:return[4,self.registration.pushManager.getSubscription()];case 2:return n=r.sent(),[4,S.default.getSubscription()];case 3:return i=r.sent().optedOut,[2,{subscribed:!!n,optedOut:i}];case 4:return[4,y.default.getIntegration()];case 5:switch(o=r.sent(),o){case P.IntegrationKind.Secure:return[3,6];case P.IntegrationKind.SecureProxy:return[3,7];case P.IntegrationKind.InsecureProxy:return[3,11]}return[3,13];case 6:return[2,this.getSubscriptionStateForSecure()];case 7:switch(t){case v.WindowEnvironmentKind.OneSignalProxyFrame:case v.WindowEnvironmentKind.OneSignalSubscriptionPopup:case v.WindowEnvironmentKind.OneSignalSubscriptionModal:return[3,8]}return[3,9];case 8:return[2,this.getSubscriptionStateForSecure()];case 9:return[4,OneSignal.proxyFrameHost.runCommand(OneSignal.POSTMAM_COMMANDS.GET_SUBSCRIPTION_STATE)];case 10:return[2,r.sent()];case 11:return[4,this.getSubscriptionStateForInsecure()];case 12:return[2,r.sent()];case 13:throw new a.InvalidStateError(a.InvalidStateReason.UnsupportedEnvironment)}})})},e.prototype.getSubscriptionStateForSecure=function(){return i(this,void 0,void 0,function(){var t,n,i,o,s,a,u,c,l;return r(this,function(r){switch(r.label){case 0:return[4,S.default.getSubscription()];case 1:return t=r.sent(),n=t.deviceId,t.subscriptionToken,i=t.optedOut,e.isSafari()?(o=window.safari.pushNotification.permission(this.config.safariWebId),[2,{subscribed:!("granted"!==o.permission||!o.deviceToken||!n),optedOut:i}]):[4,this.context.serviceWorkerManager.getActiveState()];case 2:return s=r.sent(),[4,navigator.serviceWorker.getRegistration()];case 3:return a=r.sent(),[4,this.context.permissionManager.getNotificationPermission(this.context.appConfig.safariWebId)];case 4:return u=r.sent(),c=s===E.ServiceWorkerActiveState.WorkerA||s===E.ServiceWorkerActiveState.WorkerB,a?[4,a.pushManager.getSubscription()]:[2,{subscribed:!1,optedOut:i}];case 5:return l=r.sent(),[2,{subscribed:!!(l&&n&&u===h.NotificationPermission.Granted&&c),optedOut:i}]}})})},e.prototype.getSubscriptionStateForInsecure=function(){return i(this,void 0,void 0,function(){var e,t,n,i,o;return r(this,function(r){switch(r.label){case 0:return[4,S.default.getSubscription()];case 1:return e=r.sent(),t=e.deviceId,n=e.subscriptionToken,i=e.optedOut,[4,this.context.permissionManager.getNotificationPermission(this.context.appConfig.safariWebId)];case 2:return o=r.sent(),[2,{subscribed:!(!t||!n||o!==h.NotificationPermission.Granted),optedOut:i}]}})})},e.prototype.registerFailedSubscription=function(e,t){return i(this,void 0,void 0,function(){return r(this,function(n){return t.sessionManager.isFirstPageView()&&(t.subscriptionManager.registerSubscription(new g.RawPushSubscription,e),t.sessionManager.incrementPageViewCount()),[2]})})},e}();t.SubscriptionManager=C},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.getBaseUrl=function(){return location.origin},e}();t.Utils=i,t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.isLocalStorageSupported=function(){if("undefined"==typeof localStorage)return!1;try{return localStorage.getItem("test"),!0}catch(e){return!1}},e.setItem=function(t,n,i){if(e.isLocalStorageSupported()){var r=void 0!==i?60*i*1e3:0,o={value:JSON.stringify(n),timestamp:void 0!==i?(new Date).getTime()+r:void 0};localStorage.setItem(t,JSON.stringify(o))}},e.getItem=function(t){if(!e.isLocalStorageSupported())return null;var n,i=localStorage.getItem(t);try{n=JSON.parse(i)}catch(e){return null}if(null===n)return null;if(n.timestamp&&(new Date).getTime()>=n.timestamp)return localStorage.removeItem(t),null;var r=n.value;try{r=JSON.parse(n.value)}catch(e){return r}return r},e.removeItem=function(t){if(!e.isLocalStorageSupported())return null;localStorage.removeItem(t)},e}();t.default=i},function(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),(i=t.DevicePlatformKind||(t.DevicePlatformKind={})).Mobile="mobile",i.Tablet="tablet",i.Desktop="desktop"},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s,a=o(n(4));(s=t.OneSignalApiErrorKind||(t.OneSignalApiErrorKind={}))[s.MissingAppId=0]="MissingAppId";var u=function(e){function n(i){var r=this;switch(i){case t.OneSignalApiErrorKind.MissingAppId:r=e.call(this,"The API call is missing an app ID.")||this}return Object.setPrototypeOf(r,n.prototype),r}return r(n,e),n}(a.default);t.OneSignalApiError=u},function(e,t){e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={});t||(t={});var o,s,a=t.prefix||"__jp",u=t.name||a+n++,c=t.param||"callback",l=null!=t.timeout?t.timeout:6e4,d=encodeURIComponent,f=document.getElementsByTagName("script")[0]||document.head;l&&(s=setTimeout(function(){p(),r&&r(new Error("Timeout"))},l));function p(){o.parentNode&&o.parentNode.removeChild(o),window[u]=i,s&&clearTimeout(s)}return window[u]=function(e){p(),r&&r(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+c+"="+d(u)).replace("?&","?"),(o=document.createElement("script")).src=e,f.parentNode.insertBefore(o,f),function(){window[u]&&p()}};var n=0;function i(){}},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0?i.message:"Thanks for subscribing!",p=new URL(location.href).origin+"?_osp=do_not_open",h=i&&i.url&&i.url.length>0?i.url:p,a=l.decodeHtmlEntities(a),f=l.decodeHtmlEntities(f),o||(d.default.debug("Sending welcome notification."),u.default.sendNotification(n,[t],{en:a},{en:f},h,null,{__isOneSignalWelcomeNotification:!0},void 0),s.default.trigger(OneSignal.EVENTS.WELCOME_NOTIFICATION_SENT,{title:a,message:f,url:h})),r.label=3;case 3:return[2]}})})},e.onSubscriptionChanged_evaluateNotifyButtonDisplayPredicate=function(e){return i(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return(e=OneSignal.config.userConfig.notifyButton.displayPredicate)&&"function"==typeof e&&OneSignal.notifyButton?[4,e()]:[3,2];case 1:!1!==t.sent()?(d.default.debug("Showing notify button because display predicate returned true."),OneSignal.notifyButton.launcher.show()):(d.default.debug("Hiding notify button because display predicate returned false."),OneSignal.notifyButton.launcher.hide()),t.label=2;case 2:return[2]}})})},e.triggerSubscriptionChanged=function(e){s.default.trigger(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,e)},e.fireStoredNotificationClicks=function(e){return void 0===e&&(e=document.URL),i(this,void 0,void 0,function(){function t(e){return i(this,void 0,void 0,function(){var t,n,i;return r(this,function(r){switch(r.label){case 0:return[4,c.default.getAppState()];case 1:return(t=r.sent()).clickedNotifications[e.url]=null,[4,c.default.setAppState(t)];case 2:return r.sent(),n=e.data,(i=e.timestamp)&&(Date.now()-i)/1e3/60>5?[2]:(s.default.trigger(OneSignal.EVENTS.NOTIFICATION_CLICKED,n),[2])}})})}var n,o,a,u,l,d;return r(this,function(i){switch(i.label){case 0:return[4,c.default.getAppState()];case 1:return n=i.sent(),[4,c.default.get("Options","notificationClickHandlerMatch")];case 2:if("origin"!==i.sent())return[3,7];o=0,a=Object.keys(n.clickedNotifications),i.label=3;case 3:return o0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]2&&(t=30),c.default.debug("("+s.default.getWindowEnv().toString()+") OneSignal: User dismissed the native notification prompt; reprompt after "+t+" days."),[4,a.default.put("Options",{key:"promptDismissCount",value:e})];case 4:return i.sent(),n=24*t*60,[2,u.default.setItem("onesignal-notification-prompt","dismissed",n)]}})})},e}();t.default=d},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),a=o(n(50)),u=o(n(38)),c=o(n(2)),l=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-message","onesignal-bell-launcher-message-opened",null,"hidden",["opacity","transform"],".onesignal-bell-launcher-message-body")||this;return n.bell=t,n.contentType="",n.queued=[],n}return r(t,e),Object.defineProperty(t,"TIMEOUT",{get:function(){return 2500},enumerable:!0,configurable:!0}),Object.defineProperty(t,"TYPES",{get:function(){return{TIP:"tip",MESSAGE:"message",QUEUED:"queued"}},enumerable:!0,configurable:!0}),t.prototype.display=function(e,t,n){var i=this;return void 0===n&&(n=0),c.default.debug("Calling %cdisplay("+e+", "+t+", "+n+").",s.getConsoleStyle("code")),(this.shown?this.hide():s.nothing()).then(function(){i.content=s.decodeHtmlEntities(t),i.contentType=e}).then(function(){return i.show()}).then(function(){return s.delay(n)}).then(function(){return i.hide()}).then(function(){i.content=i.getTipForState(),i.contentType="tip"})},t.prototype.getTipForState=function(){return this.bell.state===u.default.STATES.UNSUBSCRIBED?this.bell.text["tip.state.unsubscribed"]:this.bell.state===u.default.STATES.SUBSCRIBED?this.bell.text["tip.state.subscribed"]:this.bell.state===u.default.STATES.BLOCKED?this.bell.text["tip.state.blocked"]:void 0},t.prototype.enqueue=function(e){var t=this;return this.queued.push(s.decodeHtmlEntities(e)),new Promise(function(e){t.bell.badge.shown?t.bell.badge.hide().then(function(){return t.bell.badge.increment()}).then(function(){return t.bell.badge.show()}).then(e):(t.bell.badge.increment(),t.bell.initialized?t.bell.badge.show().then(e):e())})},t.prototype.dequeue=function(e){var t=this,n=this.queued.pop(e);return new Promise(function(e){t.bell.badge.shown?t.bell.badge.hide().then(function(){return t.bell.badge.decrement()}).then(function(e){return e>0?t.bell.badge.show():Promise.resolve(t)}).then(e(n)):(t.bell.badge.decrement(),e(n))})},t}(a.default);t.default=l},function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=63&&(a.default.tablet||a.default.mobile)?[4,OneSignal.privateShowHttpPrompt()]:[3,8];case 7:return n.sent(),[3,10];case 8:return[4,y.default.registerForPush()];case 9:n.sent(),n.label=10;case 10:return[3,12];case 11:OneSignal._sessionInitAlreadyRunning=!1,n.label=12;case 12:return[3,16];case 13:return!0!==OneSignal.config.userConfig.autoRegister&&A.default.debug("OneSignal: Not automatically showing popover because autoRegister is not specifically true."),S.default.isHttpPromptAlreadyShown()&&A.default.debug("OneSignal: Not automatically showing popover because it was previously shown in the same session."),!0!==OneSignal.config.userConfig.autoRegister||S.default.isHttpPromptAlreadyShown()?[3,15]:[4,OneSignal.privateShowHttpPrompt().catch(function(e){e instanceof c.InvalidStateError&&e.reason===c.InvalidStateReason[c.InvalidStateReason.RedundantPermissionMessage]||e instanceof l.default||e instanceof u.default||e instanceof I.default?A.default.debug("[Prompt Not Showing]",e):A.default.info(e)})];case 14:n.sent(),n.label=15;case 15:OneSignal._sessionInitAlreadyRunning=!1,n.label=16;case 16:return[4,d.default.trigger(OneSignal.EVENTS.SDK_INITIALIZED)];case 17:return n.sent(),[2]}})})},e.ponyfillSafariFetch=function(){return r(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:if(!a.default.safari||void 0!==window.fetch)return[3,4];A.default.debug("Loading fetch polyfill for Safari.."),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,(new P.DynamicResourceLoader).loadFetchPolyfill()];case 2:return t.sent(),A.default.debug("Done loading fetch polyfill."),[3,4];case 3:return e=t.sent(),A.default.debug("Error loading fetch polyfill:",e),[3,4];case 4:return[2]}})})},e.errorIfInitAlreadyCalled=function(){if(OneSignal._initCalled)throw new w.SdkInitError(w.SdkInitErrorKind.MultipleInitialization);OneSignal._initCalled=!0},e.initializeConfig=function(e){return r(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:return[4,(new R.default).getAppConfig(e)];case 1:return t=n.sent(),A.default.debug("OneSignal: Final web app config: %c"+JSON.stringify(t,null,4),m.getConsoleStyle("code")),OneSignal.context=new _.default(t),OneSignal.config=OneSignal.context.appConfig,[2]}})})},e}();t.default=D},function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=i(n(0)),s=function(){function e(){}return e.promiseStub=function(){return{then:e.promiseStub,catch:e.promiseStub}},e.ensureBackwardsCompatibility=function(t){e.environmentPolyfill(t),e.postmams(t),t.syncHashedEmail=e.promiseStub},e.environmentPolyfill=function(e){e.environment={},e.environment.getEnv=function(){return""},e.environment.isPopup=function(){return o.default.getWindowEnv()===r.WindowEnvironmentKind.OneSignalSubscriptionPopup},e.environment.isIframe=function(){return o.default.getWindowEnv()===r.WindowEnvironmentKind.OneSignalProxyFrame}},e.postmams=function(e){var t=function(){this.messenger.message.apply(this.messenger,arguments)},n=function(){this.messenger.postMessage.apply(this.messenger,arguments)};function i(e){e.message=t,e.postMessage=n}e.proxyFrame&&(e.iframePostmam=e.proxyFrame,i(e.iframePostmam)),e.subscriptionPopup&&(e.popupPostmam=e.subscriptionPopup,i(e.popupPostmam)),e.subscriptionModal&&(e.modalPostmam=e.subscriptionModal,i(e.modalPostmam))},e}();t.default=s},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var PermissionMessageDismissedError=function(e){function PermissionMessageDismissedError(){var t=e.call(this,"The permission message was previously dismissed.")||this;return Object.setPrototypeOf(t,PermissionMessageDismissedError.prototype),t}return r(PermissionMessageDismissedError,e),PermissionMessageDismissedError}(o(n(4)).default);t.default=PermissionMessageDismissedError},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var AlreadySubscribedError=function(e){function AlreadySubscribedError(){var t=e.call(this,"This operation can only be performed when the user is not subscribed.")||this;return Object.setPrototypeOf(t,AlreadySubscribedError.prototype),t}return r(AlreadySubscribedError,e),AlreadySubscribedError}(o(n(4)).default);t.default=AlreadySubscribedError},,function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s,a=o(n(4)),u=n(39);(s=t.DeprecatedApiReason||(t.DeprecatedApiReason={}))[s.HttpPermissionRequest=0]="HttpPermissionRequest",s[s.SyncHashedEmail=1]="SyncHashedEmail";var c=function(e){function n(i){var r=this;switch(i){case t.DeprecatedApiReason.HttpPermissionRequest:(r=e.call(this,"The HTTP permission request has been deprecated. Please remove any custom popups from your code.")||this).reportUsage(u.ApiUsageMetricKind.HttpPermissionRequest);break;case t.DeprecatedApiReason.SyncHashedEmail:(r=e.call(this,"API syncHashedEmail() has been deprecated and will be removed in a future SDK release. Please remove any usages from your code.")||this).reportUsage(u.ApiUsageMetricKind.SyncHashedEmail)}return Object.setPrototypeOf(r,n.prototype),r}return r(n,e),n.prototype.reportUsage=function(e){"undefined"!=typeof OneSignal&&OneSignal.context&&OneSignal.context.metricsManager&&OneSignal.context.metricsManager.reportEvent(new u.ApiUsageMetricEvent(e))},n}(a.default);t.DeprecatedApiError=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.isValidUrl=function(e,t){if(t&&t.allowNull&&null===e)return!0;if(t&&t.allowEmpty&&(null===e||void 0===e))return!0;try{var n=new URL(e);return!t||!t.requireHttps||"https:"===n.protocol}catch(e){return!1}},e.isValidBoolean=function(e,t){return!(!t||!t.allowNull||null!==e)||(!0===e||!1===e)},e.isValidArray=function(e,t){return!(!t||!t.allowNull||null!==e)||(!(!t||!t.allowEmpty||null!==e&&void 0!==e)||e instanceof Array)},e}();t.ValidatorUtils=i},function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]
'+this.options.actionMessage+'
',l.addDomElement("body","beforeend",'
'),l.addDomElement(this.container,"beforeend",'
'+i+"
"),l.addCssClass(this.container,a.default.mobile?"slide-up":"slide-down"),this.allowButton.addEventListener("click",this.onPopoverAllowed.bind(this)),this.cancelButton.addEventListener("click",this.onPopoverCanceled.bind(this)),u.default.trigger(e.EVENTS.SHOWN),r.label=2;case 2:return[2]}})})},e.prototype.onPopoverAllowed=function(t){u.default.trigger(e.EVENTS.ALLOW_CLICK)},e.prototype.onPopoverCanceled=function(t){u.default.trigger(e.EVENTS.CANCEL_CLICK),this.close()},e.prototype.close=function(){var t=this;l.addCssClass(this.container,"close-popover"),l.once(this.dialog,"animationend",function(n,i){n.target!==t.dialog||"slideDownExit"!==n.animationName&&"slideUpExit"!==n.animationName||(l.removeDomElement("#onesignal-popover-container"),i(),u.default.trigger(e.EVENTS.CLOSED))},!0)},e.prototype.getPlatformNotificationIcon=function(){return this.notificationIcons?l.isChromeLikeBrowser()||a.default.firefox||a.default.msedge?this.notificationIcons.chrome?this.notificationIcons.chrome:this.notificationIcons.firefox?this.notificationIcons.firefox:"default-icon":a.default.safari?this.notificationIcons.safari?this.notificationIcons.safari:this.notificationIcons.chrome?this.notificationIcons.chrome:"default-icon":void 0:"default-icon"},Object.defineProperty(e.prototype,"container",{get:function(){return document.querySelector("#onesignal-popover-container")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dialog",{get:function(){return document.querySelector("#onesignal-popover-dialog")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowButton",{get:function(){return document.querySelector("#onesignal-popover-allow-button")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cancelButton",{get:function(){return document.querySelector("#onesignal-popover-cancel-button")},enumerable:!0,configurable:!0}),e}();t.default=d},function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1] Host) Getting event listener count for ",t),e.reply(OneSignal.emitter.numberOfListeners(t)),!1},e.prototype.isSubscribed=function(){var e=this;return new Promise(function(t){e.messenger.message(OneSignal.POSTMAM_COMMANDS.IS_SUBSCRIBED,null,function(e){t(e.data)})})},e.prototype.unsubscribeFromPush=function(){var e=this;return new Promise(function(t){e.messenger.message(OneSignal.POSTMAM_COMMANDS.UNSUBSCRIBE_PROXY_FRAME,null,function(e){t()})})},e.prototype.getProxyServiceWorkerActiveState=function(){var e=this;return new Promise(function(t,n){e.message(OneSignal.POSTMAM_COMMANDS.SERVICE_WORKER_STATE,null,function(e){t(e.data)})})},e.prototype.runCommand=function(e){return i(this,void 0,void 0,function(){var t=this;return r(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n,i){t.message(e,null,function(e){n(e.data)})})];case 1:return[2,n.sent()]}})})},e.prototype.message=function(){for(var e=[],t=0;t0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0?t.bell.badge.hide().then(function(){return Promise.all([e.prototype.inactivate.call(t),t.resize("small")])}).then(function(){return t.bell.badge.show()}):Promise.all([e.prototype.inactivate.call(t),t.resize("small")])})},t.prototype.activate=function(){var t=this;return this.bell.badge.content.length>0?this.bell.badge.hide().then(function(){return Promise.all([e.prototype.activate.call(t),t.resize(t.bell.options.size)])}):Promise.all([e.prototype.activate.call(this),this.resize(this.bell.options.size)])},t}(l.default);t.default=f},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(7)),a=o(n(6)),u=o(n(0)),c=n(1),l=o(n(50)),d=o(n(38)),f=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-dialog","onesignal-bell-launcher-dialog-opened",null,"hidden",["opacity","transform"],".onesignal-bell-launcher-dialog-body")||this;return n.bell=t,n.subscribeButtonId="#onesignal-bell-container .onesignal-bell-launcher #subscribe-button",n.unsubscribeButtonId="#onesignal-bell-container .onesignal-bell-launcher #unsubscribe-button",n.notificationIcons=null,n}return r(t,e),t.prototype.getPlatformNotificationIcon=function(){return this.notificationIcons?c.isChromeLikeBrowser()||s.default.firefox||s.default.msedge?this.notificationIcons.chrome||this.notificationIcons.safari:s.default.safari?this.notificationIcons.safari||this.notificationIcons.chrome:void 0:null},t.prototype.show=function(){var t=this;return this.updateBellLauncherDialogBody().then(function(){return e.prototype.show.call(t)})},Object.defineProperty(t.prototype,"subscribeButtonSelectorId",{get:function(){return"subscribe-button"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unsubscribeButtonSelectorId",{get:function(){return"unsubscribe-button"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subscribeButton",{get:function(){return this.element.querySelector("#"+this.subscribeButtonSelectorId)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unsubscribeButton",{get:function(){return this.element.querySelector("#"+this.unsubscribeButtonSelectorId)},enumerable:!0,configurable:!0}),t.prototype.updateBellLauncherDialogBody=function(){var e=this;return OneSignal.getSubscription().then(function(t){c.clearDomElementChildren(document.querySelector(e.nestedContentSelector));var n="Nothing to show.",i="";if(e.bell.options.showCredit&&(i='
Powered by OneSignal
'),e.bell.state===d.default.STATES.SUBSCRIBED&&!0===t||e.bell.state===d.default.STATES.UNSUBSCRIBED&&!1===t){var r="";r=(l=e.getPlatformNotificationIcon())?'
':'
';var o="";o=e.bell.state!==d.default.STATES.SUBSCRIBED?'":'",n="

"+e.bell.text["dialog.main.title"]+'

'+r+'
'+o+"
"+i}else if(e.bell.state===d.default.STATES.BLOCKED){var l=null;s.default.chrome?s.default.mobile||s.default.tablet||(l=u.default.getOneSignalApiUrl().origin+"/bell/chrome-unblock.jpg"):s.default.firefox?l=u.default.getOneSignalApiUrl().origin+"/bell/firefox-unblock.jpg":s.default.safari&&(l=u.default.getOneSignalApiUrl().origin+"/bell/safari-unblock.jpg");var f="";l&&(f=''),(s.default.mobile||s.default.tablet)&&s.default.chrome&&(f="
  1. Access Settings by tapping the three menu dots â‹®
  2. Click Site settings under Advanced.
  3. Click Notifications.
  4. Find and click this entry for this website.
  5. Click Notifications and set it to Allow.
"),n="

"+e.bell.text["dialog.blocked.title"]+'

'+e.bell.text["dialog.blocked.message"]+"

"+f+"
"+i}c.addDomElement(document.querySelector(e.nestedContentSelector),"beforeend",n),e.subscribeButton&&e.subscribeButton.addEventListener("click",function(){OneSignal.__doNotShowWelcomeNotification=!1,a.default.trigger(d.default.EVENTS.SUBSCRIBE_CLICK)}),e.unsubscribeButton&&e.unsubscribeButton.addEventListener("click",function(){return a.default.trigger(d.default.EVENTS.UNSUBSCRIBE_CLICK)}),e.bell.setCustomColorsIfSpecified()})},t}(l.default);t.default=f},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),a=o(n(6)),u=o(n(51)),c=o(n(38)),l=o(n(42)),d=o(n(67)),f=o(n(35)),p=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-button",null,null,"onesignal-bell-launcher-button-active",null,"shown","")||this;return n.bell=t,n.events={mouse:"bell.launcher.button.mouse"},n.element.addEventListener("touchstart",function(){n.onHovering(),n.onTap()},{passive:!0}),n.element.addEventListener("mouseenter",function(){n.onHovering()}),n.element.addEventListener("mouseleave",function(){n.onHovered()}),n.element.addEventListener("touchmove",function(){n.onHovered()},{passive:!0}),n.element.addEventListener("mousedown",function(){n.onTap()}),n.element.addEventListener("mouseup",function(){n.onEndTap()}),n.element.addEventListener("click",function(){n.onHovered(),n.onClick()}),n}return r(t,e),t.prototype.onHovering=function(){(l.default.isEmpty(this.events.mouse)||"out"===l.default.getLast(this.events.mouse))&&a.default.trigger(c.default.EVENTS.HOVERING),l.default.put(this.events.mouse,"over")},t.prototype.onHovered=function(){l.default.put(this.events.mouse,"out"),a.default.trigger(c.default.EVENTS.HOVERED)},t.prototype.onTap=function(){this.pulse(),this.activate(),this.bell.badge.activate()},t.prototype.onEndTap=function(){this.inactivate(),this.bell.badge.inactivate()},t.prototype.onClick=function(){var e=this;if(a.default.trigger(c.default.EVENTS.BELL_CLICK),a.default.trigger(c.default.EVENTS.LAUNCHER_CLICK),!this.bell.message.shown||this.bell.message.contentType!=d.default.TYPES.MESSAGE){var t=l.default.getLast("subscription.optedOut");return this.bell.unsubscribed?t?this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()}):(f.default.registerForPushNotifications(),this.bell._ignoreSubscriptionState=!0,f.default.emitter.once(f.default.EVENTS.SUBSCRIPTION_CHANGED,function(){e.bell.message.display(d.default.TYPES.MESSAGE,e.bell.text["message.action.subscribed"],d.default.TIMEOUT).then(function(){e.bell._ignoreSubscriptionState=!1,e.bell.launcher.inactivate()})})):this.bell.subscribed?this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()}):this.bell.blocked&&(s.isUsingSubscriptionWorkaround()?f.default.registerForPushNotifications():this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()})),this.bell.message.hide()}},t.prototype.pulse=function(){s.removeDomElement(".pulse-ring"),s.addDomElement(this.element,"beforeend",'
'),this.bell.setCustomColorsIfSpecified()},t}(u.default);t.default=p},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){return e.call(this,".onesignal-bell-launcher-badge","onesignal-bell-launcher-badge-opened",null,"onesignal-bell-launcher-badge-active",null,"hidden")||this}return r(t,e),t.prototype.increment=function(){if(!isNaN(this.content)){var e=+this.content;e+=1,this.content=e.toString()}},t.prototype.show=function(){var t=e.prototype.show.call(this);return OneSignal.notifyButton.setCustomColorsIfSpecified(),t},t.prototype.decrement=function(){if(!isNaN(this.content)){var e=+this.content;e-=1,this.content=e>0?e.toString():""}},t}(o(n(51)).default);t.default=s},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1] Host) User unsubscribed but permission granted. Re-prompting the user for push."),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,g.unsubscribeFromPush()];case 2:return n.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[3,4];case 3:return t=n.sent(),v.default.debug("Failed to unsubscribe from push remotely:",t),[3,4];case 4:return[2]}})})},t.prototype.onMarkPromptDismissed=function(e){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return v.default.debug("(Reposted from iFrame -> Host) Marking prompt as dismissed."),[4,d.default.markHttpsNativePromptDismissed()];case 1:return t.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t.prototype.onIsSubscribed=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onUnsubscribeProxyFrame=function(e){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return t.sent()?[4,OneSignal.setSubscription(!1)]:[3,4];case 2:return t.sent(),[4,OneSignal.database.rebuild()];case 3:t.sent(),t.label=4;case 4:return e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t.prototype.onServiceWorkerState=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.context.serviceWorkerManager.getActiveState()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onWorkerVersion=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.context.serviceWorkerManager.getWorkerVersion()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onSubscriptionExpirationState=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.context.subscriptionManager.isSubscriptionExpiring()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onProcessExpiringSubscriptions=function(e){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return OneSignal.context,[4,l.default.processExpiringSubscriptions()];case 1:return t.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t.prototype.onGetSubscriptionState=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.context.subscriptionManager.getSubscriptionState()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t}(b.default);t.default=m},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]1)return o.default.warn("OneSignal: The web push SDK is included more than once. For optimal performance, please include our SDK only once on your page."),void o.default.debug("OneSignal: Exiting from SDK initialization to prevent double-initialization errors. Occurred "+s.getSdkLoadCount()+" times.");var e;if("undefined"!=typeof OneSignal&&(e=OneSignal),s.isPushNotificationsSupported()?window.OneSignal=n(35).default:(o.default.debug("OneSignal: Push notifications are not supported. A stubbed version of the SDK will be initialized."),window.OneSignal=r.default),e){if(!Array.isArray(e))return void o.default.error("'OneSignal' was not defined as an Array. Skipping pushes");for(var t=0,i=e;t
loading...

Jesz późno kolację? Zwiększasz ryzyko raka

Ostatni posiłek po 22.00 lub tuż przed snem nie wychodzi nam na zdrowie. Zakłócony zostaje wtedy naturalny cykl dobowy, co przekłada się nie tylko na gorszą jakość wypoczynku, ale i ryzyko zachorowania na raka piersi czy prostaty.

zdjęcie ilustracyjne: pixabay

Zaburzenie naturalnego rytmu dobowego, naszego wewnętrznego zegara biologicznego, nie wychodzi nam na zdrowie, czego dowodzą liczne badania. Ekspozycja na światło w czasie, kiedy powinniśmy spać, znacząco zwiększa ryzyko wielu chorób, w tym nowotworów, schorzeń sercowo-naczyniowych, cukrzycy typu II czy otyłości. 
Zaburzenie rytmu dobowego i brak snu powoduje zmiany w ludzkim transkryptomie, czyli zbiorze cząsteczek, głównie mRNA, obecnych w określonym momencie w komórce. Chodzi o to, że komórki, w odpowiedzi na różne czynniki, uruchamiają i wyłączają transkrypcję genów, zmieniając w ten sposób swój transkryptom.

Nieprzestrzeganie rytmu dobowego powoduje też zmiany w zestawie wszystkich metabolitów obecnych w organizmie, np. pochodnych aminokwasów, lipidów, węglowodanów, nukleotydów, drobnocząsteczkowych hormonów. To wszystko dowodzi, że zachowanie właściwej pory snu i czuwania jest niezbędne dla właściwego funkcjonowania organizmu.

Kto jest narażony na zaburzenia rytmu dobowego?

Najczęściej dochodzi do nich w wyniku pracy zmianowej. Zdając sobie sprawę z zagrożeń jakie ze sobą niosą, w 2007 Międzynarodowa Agencja Badań nad Rakiem zakwalifikowała pracę na zmiany jako prawdopodobnie rakotwórczą. Co ciekawe, z dotychczasowych badań wynika również, że z zaburzeniami rytmu dobowego są powiązane określone podtypy nowotworów. 
O ile nie każdy ma możliwości zmiany pracy, to na wiele innych czynników wpływających na porę kładzenia się spać i wstawania mamy wpływ. Mowa tu np. o uczących się nocami czy też imprezowiczach, którzy prowadząc taki tryb życia narażają się na choroby w przyszłości.A także o tych, którzy lubią jeść posiłki późnym wieczorem.

Rytm dobowy a rak



Zakłócenia zegara biologicznego oraz ich powiązania z nowotworami są przedmiotem badań zespołu prof. Manolisa Kogevinasa z Barcelona Institute for Global Health. Uczeni ci postanowili sprawdzić, na ile posiłek tuż przed snem lub spożywany bardzo późno zwiększa ryzyko zachorowania na nowotwór. Według nich niewłaściwe pory spożywania posiłków stanowią element zakłócenia rytmu dobowego. Człowiek bowiem jest biologicznie przystosowany do tego, by jeść, kiedy świeci słonce i pościć po zapadnięciu zmroku.
Do analizy wybrali dwa najczęściej kojarzone z pracą zmianową nowotwory:  piersi i prostaty (wcześniejsze badania wykazały, że praca zmianowa może przyczyniać się do ich rozwoju).
Uczeni przeanalizowali dane zebrane w trakcie dużych hiszpańskich badań nad rakiem. Ostatecznie ich badania objęły 1205 kobiet z rakiem piersi i 621 mężczyzn z rakiem prostaty oraz odpowiadającą im pod względem wieku (20-85 lat) i zamieszkania grupę kontrolną składającą się z 1321 kobiet i 872 mężczyzn.
Co ważne, wśród uczestników badań nikt nigdy nie pracował na zmiany. 
Badacze przeprowadzili z ochotnikami bardzo szczegółowe wywiady dotyczące stylu życia, tego, co i kiedy jedzą, jakości oraz czasu snu, pracy a także indywidualnego chronotypu (czyli sprawdzali, czy ktoś jest „sową” czy „skowronkiem”). W interesującym badaczy temacie okazało się, że prawie wszystkie osoby biorące udział w badaniu spożywały trzy posiłki dziennie, jedna trzecia miała jeszcze popołudniową przekąskę, a 7 proc. przegryzkę po kolacji. Śniadanie jedzono ok. 8:30, obiad o 14.00, zaś kolację o 21.00 (trzeba pamiętać, że w badaniu uczestniczyli Hiszpanie, którzy zazwyczaj jedzą późno wieczorem.) Nie było różnic w godzinach spożywania posiłków między weekendem a dniami roboczymi. 
Wszystkie te dane zostały poddane bardzo rygorystycznej analizie statystycznej, która przyniosła zaskakujące wyniki. Oto one: 
  • Ryzyko raka znacząco się zmniejszało w miarę zwiększania się upływu czasu między ostatnim dużym posiłkiem a snem. W porównaniu do mężczyzn zasypiających tuż po kolacji, ci, którzy robili to ci najmniej dwie godziny później, mieli o 26 proc. mniejsze szanse na zachorowanie na raka prostaty. Mówiąc inaczej – odpowiednio długi czas między snem a  ostatnim posiłkiem przekładał się bezpośrednio na zdrowie. Podobną zależność zaobserwowano w przypadku kobiet, choć tu ryzyko zmniejszało się o 16 proc.
  • Porównanie osób jedzących kolację przed 21.00 z tymi, którzy spożywali ją po 22.00 również dało ciekawe rezultaty. Okazało się, że jedzenie wcześniej zmniejsza ryzyko raka prostaty o 25 proc. i raka piersi o 15 proc. 
  • Najzdrowsze była kombinacja dwóch powyżej opisanych obyczajów: wczesnego jedzenia kolacji (przed 21.00) i zasypiania co najmniej dwie godziny po posiłku. W tym przypadku ryzyko raka prostaty było mniejsze o 26 proc., a raka piersi 23 o proc. 
  • Na dłuższym odstępie od kolacji do snu zdecydowanie bardziej korzystają osoby z chronotypem skowronka. W ich przypadku ryzyko raka piersi było mniejsze o 35 proc. a raka prostaty 33 proc. 
  • Podsumowując wyniki swoich badań, naukowcy  pod kierunkiem prof. Manolisa Kogevinasa stwierdzili, iż udało się im stwierdzić zależności między rakiem piersi i prostaty a przestrzeganiem codziennych zwyczajów związanych z jedzeniem kolacji. Wczesne spożywanie tego posiłku  i dłuższa przerwa między nim a pójściem spać zmniejsza ryzyko raka. Są to pierwsze epidemiologiczne badania pokazujące, że niezgodne z naturalnym rytmem dobowym spożywanie posiłków ma długotrwałe efekty zdrowotne. 
    Badacze podkreślają, że choć niewłaściwy czas spożywania posiłków, nie jest dla organizmu tak ekstremalnym zaburzeniem naturalnego zegara biologicznego jak praca zmianowa, to warto mieć na uwadze fakt, że także ma wpływ na prawdopodobieństwo zachorowania na raka.  

    Ograniczenia badania

    Silnym aspektem tego badania jest dość duża grupa osób, które wzięły w nim udział, bardzo szczegółowy wywiad związany z czasem spożywania posiłków oraz dane związane z chronotypem uczestników. Nie wiadomo jednak, na ile precyzyjni byli w swoich odpowiedziach ci ludzie. Kolejne ograniczenie badania to dość małe zróżnicowanie pory jedzenia ostatniego posiłku przez ochotników (Hiszpanie jedzą go dość późno). Być może, gdyby określić jeszcze inne widełki, np. jedzenie ostatniego posiłku przed 19.00, uzyskane wyniki były by nieco inne. Badania trzeba będzie więc powtórzyć na innych populacjach. 
    Oczywiście na rozwój raka wpływa bardzo wiele czynników, w tym takich, na które nie mamy wpływu. Wnioskiem z tego badania, o ile rezultaty zostaną potwierdzone w kolejnych próbach wyjaśnienia tego fenomenu, nie jest zatem to, że odpowiedni odstęp między kolacją a pójściem spać gwarantuje nam, że nie zachorujemy na raka. Prawidłowy wniosek jest taki, że zachowanie tego odstępu daje nam większe szanse uniknięcia nowotworu. A także, co już wcześniej udowodniono, szeregu innych schorzeń.
    Ustalenia naukowców z Barcelony przynoszą zatem nowe, ciekawe spojrzenie na prewencję nowotworów, zwłaszcza tak często występujących, jak rak piersi czy prostaty. Jeśli zostaną potwierdzone, będą miały ogromne znaczenie dla rekomendacji żywieniowych, zwłaszcza w kulturach południowej Europy, gdzie kolacje jada się naprawdę późno. 
    Anna Piotrowska, zdrowie.pap.pl
« PREV
NEXT »
loading...