text: !function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},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=28)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SERVICE_WORKER_URL="pushwoosh-service-worker.js",t.DEFAULT_API_URL="https://cp.pushwoosh.com/json/1.3/",t.PERIOD_SEND_APP_OPEN=36e5,t.PERIOD_GOAL_EVENT=864e5,t.DEFAULT_NOTIFICATION_DURATION=10,t.MIN_NOTIFICATION_DURATION=10,t.MAX_NOTIFICATION_DURATION=90,t.WAKE_UP_SERVICE_WORKER_INTERVAL=20,t.DEFAULT_NOTIFICATION_TITLE="Pushwoosh notification",t.DEFAULT_NOTIFICATION_IMAGE="https://cp.pushwoosh.com/img/logo-medium.png",t.DEFAULT_NOTIFICATION_URL="/",t.KEY_API_PARAMS="API_PARAMS",t.KEY_INIT_PARAMS="INIT_PARAMS",t.KEY_SDK_VERSION="SDK_VERSION",t.KEY_WORKER_VERSION="WORKER_VERSION",t.KEY_LAST_SENT_APP_OPEN="LAST_SENT_APP_OPEN",t.KEY_LAST_OPEN_MESSAGE="LAST_OPEN_MESSAGE",t.KEY_API_BASE_URL="API_BASE_URL",t.KEY_SHOW_SUBSCRIBE_WIDGET="WIDGET_SHOWED",t.KEY_CLICK_SUBSCRIBE_WIDGET="WIDGET_CLICKED",t.KEY_DELAYED_EVENT="DELAYED_EVENT",t.KEY_COMMUNICATION_ENABLED="COMMUNICATION_ENABLED",t.KEY_DEVICE_DATA_REMOVED="DEVICE_DATA_REMOVED",t.KEY_INTERNAL_EVENTS="INTERNAL_EVENTS",t.KEY_UNSUBSCRIBED_DUE_TO_UNDEFINED_KEYS="UNSUBSCRIBED_DUE_TO_UNDEFINED_KEYS",t.KEY_FAKE_PUSH_TOKEN="fakePushToken",t.KEY_DEVICE_REGISTRATION_STATUS="deviceRegistrationStatus",t.KEY_SAFARI_PREVIOUS_PERMISSION="safariPreviousPermission",t.MANUAL_SET_LOGGER_LEVEL="PW_SET_LOGGER_LEVEL",t.DEVICE_REGISTRATION_STATUS_REGISTERED="registered",t.DEVICE_REGISTRATION_STATUS_UNREGISTERED="unregistered",t.KEY_SENDER_ID="GCM_SENDER_ID",t.KEY_FCM_SUBSCRIPTION="FCM_SUBSCRIPTION",t.PERMISSION_DENIED="denied",t.PERMISSION_GRANTED="granted",t.PERMISSION_PROMPT="default",t.EVENT_ON_READY="onReady",t.EVENT_ON_SUBSCRIBE="onSubscribe",t.EVENT_ON_UNSUBSCRIBE="onUnsubscribe",t.EVENT_ON_REGISTER="onRegister",t.EVENT_ON_PERMISSION_PROMPT="onPermissionPrompt",t.EVENT_ON_PERMISSION_DENIED="onPermissionDenied",t.EVENT_ON_PERMISSION_GRANTED="onPermissionGranted",t.EVENT_ON_SW_INIT_ERROR="onSWInitError",t.EVENT_ON_PUSH_DELIVERY="onPushDelivery",t.EVENT_ON_NOTIFICATION_CLICK="onNotificationClick",t.EVENT_ON_NOTIFICATION_CLOSE="onNotificationClose",t.EVENT_ON_CHANGE_COMMUNICATION_ENABLED="onChangeCommunicationEnabled",t.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE="onPutNewMessageToInboxStore",t.EVENT_ON_UPDATE_INBOX_MESSAGES="onUpdateInboxMessages",t.EVENT_SHOW_SUBSCRIBE_BUTTON="showSubscribeButton",t.EVENT_CLICK_SUBSCRIBE_BUTTON="clickSubscribeButton",t.EVENT_GDPR_CONSENT="GDPRConsent",t.EVENT_GDPR_DELETE="GDPRDelete"},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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}r(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,r=arguments.length;r>n;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},u=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);r.length>i;i++)0>t.indexOf(r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var c,l=n(9),p=n(10),d=n(7);function f(e,t){console.info("onversionchange",t),e.close()}function h(){return c||(c=new Promise(function(e,t){var n=indexedDB.open("PUSHWOOSH_SDK_STORE",l.default);n.onsuccess=function(n){var r=n.target.result;r.onversionchange=f.bind(null,r,t),e(r)},n.onerror=function(){return t(n.error)},n.onupgradeneeded=function(e){var n=e.target.result;n.onversionchange=f.bind(null,n,t),new p.default(n).applyMigrations()}})),c}function b(e){return h().then(function(t){return new Promise(function(n,r){return e(t,n,r)})})}t.getInstance=h;var g=function(){function e(){}return e.prototype._add=function(e){var t=this;return b(function(n,r,i){var o=n.transaction([t.name],"readwrite").objectStore(t.name).add(e);o.onsuccess=function(){r(e)},o.onerror=function(){i(o.error)}}).then(function(e){return t.getAll().then(function(n){if(Array.isArray(n)){var r=n.map(function(e){return e.id}).sort(function(e,t){return e==t?0:t>e?1:-1});if(r.length>t.maxItems)return Promise.all(r.slice(t.maxItems).map(function(e){return t.delete(e)})).then(function(){return e})}return e})})},e.prototype.delete=function(e){var t=this;return b(function(n,r,i){var o=n.transaction([t.name],"readwrite").objectStore(t.name).delete(e);o.onsuccess=function(){r(o.result)},o.onerror=function(){i(o.error)}})},e.prototype.getAll=function(){var e=this;return b(function(t,n,r){var i=[],o=t.transaction(e.name).objectStore(e.name).openCursor();o.onsuccess=function(e){var t=e.target.result;t?(t.value&&i.push(t.value),t.continue()):n(i)},o.onerror=function(){r(o.error)}})},e}();t.LogBase=g;var w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name=d.STORE_NAME_MAIN_LOG,t.maxItems=100,t.environment="undefined"!=typeof self&&self.registration?"worker":"browser",t}return i(t,e),t.prototype.add=function(e,t,n){var r={type:e,environment:this.environment,message:""+t,date:new Date};return t instanceof Error&&(r.stack=t.stack),n&&(r.additional=n),this._add(r)},t}(g);t.LogLog=w;var _,m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name=d.STORE_NAME_MESSAGE_LOG,t.maxItems=25,t}return i(t,e),t.prototype.add=function(e){return this._add(o({},e,{date:new Date}))},t}(g);t.LogMessage=m,t.keyValue=(_=d.STORE_NAME_KEY_VALUE,{get:function(e,t){return b(function(n,r,i){var o,s=n.transaction(_).objectStore(_).get(e),a=!1,u=!1,c=function(){if(clearTimeout(o),a){var e=s.result;r(e&&e.value||t)}else u?i(s.error):o=setTimeout(c,0)};s.onsuccess=function(){return a=!0},s.onerror=function(){return u=!0},c()})},getAll:function(){return b(function(e,t,n){var r,i={},o=e.transaction(_).objectStore(_).openCursor(),s=!1,a=!1,u=function(){clearTimeout(r),s?t(i):a?n(o.error):r=setTimeout(u,0)};o.onsuccess=function(e){var t=e.target.result;t?(i[t.key]=t.value.value,t.continue()):s=!0},o.onerror=function(){return a=!0},u()})},extend:function(e,t){return s(this,void 0,void 0,function(){var n,r;return a(this,function(i){switch(i.label){case 0:return[4,this.get(e)];case 1:return n=i.sent(),r=u(t,[]),[4,this.set(e,o({},n,r))];case 2:return i.sent(),[2]}})})},set:function(e,t){return b(function(n,r,i){var o,s=n.transaction([_],"readwrite").objectStore(_).put({key:e,value:t}),a=!1,u=!1,c=function(){clearTimeout(o),a?r(e):u?i(s.error):o=setTimeout(c,0)};s.onsuccess=function(){return a=!0},s.onerror=function(){return u=!0},c()})}}),t.log=new w,t.message=new m},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),a=n(24),u=function(){function e(e){void 0===e&&(e=new a.default),this.paramsBuilder=e}return Object.defineProperty(e.prototype,"apiUrl",{get:function(){return o.keyValue.get("params.apiUrl",s.DEFAULT_API_URL)},enumerable:!0,configurable:!0}),e.prototype.setApiUrl=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return e?[3,2]:[4,this.paramsBuilder.buildApiUrl(this.appCode)];case 1:return t=n.sent(),[2,o.keyValue.set("params.apiUrl",t)];case 2:return[2,o.keyValue.set("params.apiUrl",e)]}})})},Object.defineProperty(e.prototype,"appCode",{get:function(){return o.keyValue.get("params.applicationCode","")},enumerable:!0,configurable:!0}),e.prototype.setAppCode=function(e){return o.keyValue.set("params.applicationCode",e)},Object.defineProperty(e.prototype,"hwid",{get:function(){return o.keyValue.get("params.hwid","")},enumerable:!0,configurable:!0}),e.prototype.setHwid=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return t=s.KEY_API_PARAMS,[4,o.keyValue.getAll()];case 1:return(n=r.sent()[t])?(n.hwid=e,[4,o.keyValue.extend(s.KEY_API_PARAMS,n)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2,o.keyValue.set("params.hwid",e)]}})})},Object.defineProperty(e.prototype,"defaultNotificationImage",{get:function(){return o.keyValue.get("params.defaultNotificationImage",s.DEFAULT_NOTIFICATION_IMAGE)},enumerable:!0,configurable:!0}),e.prototype.setDefaultNotificationImage=function(e){return o.keyValue.set("params.defaultNotificationImage",e)},Object.defineProperty(e.prototype,"defaultNotificationTitle",{get:function(){return o.keyValue.get("params.defaultNotificationTitle",s.DEFAULT_NOTIFICATION_TITLE)},enumerable:!0,configurable:!0}),e.prototype.setDefaultNotificationTitle=function(e){return o.keyValue.set("params.defaultNotificationTitle",e)},Object.defineProperty(e.prototype,"userId",{get:function(){return o.keyValue.get("params.userId","")},enumerable:!0,configurable:!0}),e.prototype.setUserId=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return[4,this.userId];case 1:return t=r.sent(),[4,this.setUserIdWasChanged(t!==(n="user_id"===e?"":e))];case 2:return r.sent(),[2,o.keyValue.set("params.userId",n)]}})})},Object.defineProperty(e.prototype,"userIdWasChanged",{get:function(){return o.keyValue.get("params.userIdWasChanged",!1)},enumerable:!0,configurable:!0}),e.prototype.setUserIdWasChanged=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,o.keyValue.set("params.userIdWasChanged",e)]})})},Object.defineProperty(e.prototype,"subscriptionPopupLastOpen",{get:function(){return o.keyValue.get("params.subscriptionPopupLastOpen",0)},enumerable:!0,configurable:!0}),e.prototype.setSubscriptionPopupLastOpen=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,o.keyValue.set("params.subscriptionPopupLastOpen",e)]})})},e}();t.default=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);r.length>i;i++)0>t.indexOf(r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),a=n(4);function u(){return Function("return this")()}function c(e){for(var t="",n=0;32>n;n++){var r=e.length-n-1,i=0;0>r||(i=e.charCodeAt(r)),t+="0123456789abcdef".substr(i%16,1)}return t}function l(){return localStorage.getItem(s.KEY_FAKE_PUSH_TOKEN)}function p(){var e=function(e){e=e||32;for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;e>r;r++)t+=n.charAt(Math.floor(62*Math.random()));return t}();return localStorage.setItem(s.KEY_FAKE_PUSH_TOKEN,e),e}function d(e,t){var n=e&&e.getKey&&e.getKey(t);return n?btoa(String.fromCharCode.apply(String,new Uint8Array(n))):""}t.getGlobal=u,t.getVersion=function(){return"3.4.7"},t.parseSerializedNotificationParams=function(e,t){if("string"==typeof e)try{return JSON.parse(e)}catch(e){console.log(e)}return void 0===e&&void 0!==t?t:e},t.urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),i=0;n.length>i;++i)r[i]=n.charCodeAt(i);return r},t.createUUID=c,t.generateHwid=function(e,t){return e+"_"+c(t=l()||t||p())},t.getFakePushToken=l,t.generateFakePushToken=p,t.getPushToken=function(e){return e?e.subscriptionId?e.subscriptionId:12===a.default.platform?e.endpoint:e.endpoint.split("/").pop()||"":""},t.getFcmKey=function(e,t){return e?new Promise(function(e){o.keyValue.get(s.KEY_FCM_SUBSCRIPTION).then(function(n){e(n&&n[t]||"")}).catch(function(){e("")})}):Promise.resolve("")},t.getAuthToken=function(e){return d(e,"auth")},t.getPublicKey=function(e){return d(e,"p256dh")},t.getPushwooshUrl=function(e){var t=e&&!~e.indexOf(".")?"https://"+e+".api.pushwoosh.com/json/1.3/":"https://cp.pushwoosh.com/json/1.3/";return o.keyValue.get(s.KEY_API_BASE_URL).then(function(e){return void 0===e&&(e=null),e||t}).catch(function(){return t})},t.patchConsole=function(){for(var e,t=function(){},n=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],r=n.length,i=u(),o=i.console=i.console||{};r--;)o[e=n[r]]||(o[e]=t)},t.patchPromise=function(){!a.default.isAvailablePromise&&a.default.isAvailableNotifications&&(window.Promise=function(){return{then:function(){},catch:function(){}}})},t.clearLocationHash=function(){"history"in u()&&history.pushState?history.pushState(null,"","#"):location.hash="#"},t.validateParams=function(e){var t=i(e,[]);return t.userId&&"user_id"===t.userId&&delete t.userId,t},t.sendInternalPostEvent=function(e){o.keyValue.get(s.KEY_INTERNAL_EVENTS).then(function(t){var n;void 0===t&&(t={}),0===Object.keys(t).length&&o.keyValue.set(s.KEY_INTERNAL_EVENTS,{});var i=(new Date).setHours(0,0,0,0),a=t[e.event];if(!a||i>a){o.keyValue.extend(s.KEY_INTERNAL_EVENTS,((n={})[e.event]=i,n));var u=new XMLHttpRequest,c=r({application:"DD275-06947"},e);u.open("POST","https://cp.pushwoosh.com/json/1.3/postEvent",!0),u.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),u.send(JSON.stringify({request:c}))}})},t.generateUUID=function(){var e=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(12);t.PlatformChecker=i.PlatformChecker,t.default=r.platformChecker},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){void 0===e&&(e=new Date),this._date=e}return Object.defineProperty(e.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e},enumerable:!0,configurable:!0}),e.prototype.getUtcTimestamp=function(){return Math.floor((this.date.getTime()+60*this.date.getTimezoneOffset()*1e3)/1e3)},e.prototype.getTimestamp=function(){return Math.round(this.date.getTime()/1e3)},e.prototype.setLocal=function(){var e=this._date.getTime()-60*this.date.getTimezoneOffset()*1e3;this._date=new Date(e)},e.prototype.addDays=function(e){var t=this._date.getTime()+24*e*60*60*1e3;this._date=new Date(t)},e.prototype.getInboxFakeOrder=function(){return""+(100*this._date.getTime()+9e9)},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i={error:1,info:2,debug:3},o=3;n(3).patchConsole();var s={setLevel:function(e){i[e]||(e="error"),o=i[e]},write:function(e,t,n){return"error"===e?this.error(t):this.info(t),r.log.add(e,t,n)}};Object.keys(i).forEach(function(e){var t=i[e];s[e]=function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];t>o||(console.groupCollapsed(e),console.info.apply(console,[""].concat(n)),console.trace("trace"),console.groupEnd())}}),t.logAndThrowError=function(e){var t=Error(e);throw s.write("error",t,"logAndThrowError"),t},t.logAndRejectError=function(e,t){var n=Error(e);s.write("error",n,"logAndRejectError"),t(n)},t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STORE_NAME_KEY_VALUE="keyValue",t.STORE_NAME_MESSAGE_LOG="messages",t.STORE_NAME_MAIN_LOG="log",t.STORE_NAME_INBOX_MESSAGES="inboxMessages",t.KEY_PATH_BASE_INCREMENT="id"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},s=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);r.length>i;i++)0>t.indexOf(r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(19),u=new a.Logger({level:"error",subscribers:[{level:"fatal",handler:a.handlerSematext},{level:"error",handler:a.handlerSematext}]});function c(e){var t=e.message,n=e.code,i=e.error,o=s(e,["message","code","error"]),a=function(e){var t=Error("unknown error");"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e||(t.message=""+e);e instanceof Error&&(t=e);return t}(i);return{text:t,code:n,options:r({},o,{errorText:a.message,errorStack:a.stack})}}t.logger=u,t.sendFatalLogToRemoteServer=function(e){return i(this,void 0,void 0,function(){var t;return o(this,function(n){return t=c(e),[2,u.fatal(t.text,t.code,t.options)]})})},t.sendErrorLogToRemoteServer=function(e){return i(this,void 0,void 0,function(){var t;return o(this,function(n){return t=c(e),[2,u.error(t.text,t.code,t.options)]})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=7},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21),i=function(){function e(e,t){void 0===t&&(t=new r.default),this.db=e,this.migrationsBuilder=t}return e.prototype.applyMigrations=function(){var e=this;this.applyMigrationsPack(this.migrationsBuilder.initial),this.migrationsBuilder.dateSorted.forEach(function(t){e.applyMigrationsPack(t)})},e.prototype.applyMigrationsPack=function(e){var t=this;e.forEach(function(e){e(t.db)})},e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeCreatorDecorator=function(e,t){return function(n){n.objectStoreNames.contains(e)||t(n)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){void 0===e&&(e=window),this.global=e,this._isSafari=this.isSafariBrowser(),this._isOpera=this.isOperaBrowser(),this._isEdge=this.isEdgeBrowser(),this._isFirefox=this.isFirefoxBrowser(),this._isChrome=this.isChromeBrowser(),this._isMacOS=this.isMacOS(),this._isAvailablePromise=this.canUsePromise(),this._isAvailableServiceWorker=this.canUseServiceWorkers(),this._isAvailableNotifications=this.canReceiveNotifications(),this._platform=this.getPlatformType(),this._browserVersion=this.getBrowserVersion()}return Object.defineProperty(e.prototype,"isEdge",{get:function(){return this._isEdge},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSafari",{get:function(){return this._isSafari},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpera",{get:function(){return this._isOpera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAvailablePromise",{get:function(){return this._isAvailablePromise},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAvailableServiceWorker",{get:function(){return this._isAvailableServiceWorker},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAvailableNotifications",{get:function(){return this._isAvailableNotifications},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return this._platform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"browserVersion",{get:function(){return this._browserVersion},enumerable:!0,configurable:!0}),e.prototype.isSafariBrowser=function(){return"safari"in this.global&&navigator.userAgent.indexOf("Safari")>-1},e.prototype.isOperaBrowser=function(){return-1!==navigator.userAgent.indexOf("Opera")||-1!==navigator.userAgent.indexOf("OPR")},e.prototype.isEdgeBrowser=function(){return navigator.userAgent.indexOf("Edge")>-1},e.prototype.isFirefoxBrowser=function(){return-1!==navigator.userAgent.toLowerCase().indexOf("firefox")},e.prototype.isChromeBrowser=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)&&!this._isOpera&&!this._isEdge},e.prototype.isMacOS=function(){return"platform"in navigator&&-1!==navigator.platform.toLowerCase().indexOf("mac")},e.prototype.canUseServiceWorkers=function(){return!!navigator.serviceWorker&&"PushManager"in this.global&&"Notification"in this.global},e.prototype.canUsePromise=function(){return"Promise"in this.global},e.prototype.canReceiveNotifications=function(){return this._isSafari&&this._isMacOS||this._isAvailableServiceWorker&&!this._isEdge},e.prototype.getPlatformType=function(){var e=11;switch(!0){case this._isSafari:e=10;break;case this._isOpera||this._isChrome:e=11;break;case this._isFirefox:e=12;break;case this._isEdge:e=150}return e},e.prototype.getBrowserVersion=function(){var e=navigator.userAgent,t=e.match(/\bOPR\/(\d+)/);if(null!==t)return"Opera "+t[1];var n=e.match(/\bEdge\/(\d+)/);if(null!==n)return"Edge "+n[1];var r=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],i=r[1],o=void 0===i?"":i;if(/trident/i.test(e)){var s=/trident\/([.\d]+)/gi.exec(e)||[];return"IE "+(("7.0"===s[1]?"11":s[1])||"")}r=r[2]?[o,r[2]]:[navigator.appName,navigator.appVersion,"-?"];var a=e.match(/version\/([.\d]+)/i);return null!==a&&r.splice(1,1,a[1]),r.join(" ")},e}();t.PlatformChecker=r,t.platformChecker=new r(Function("return this")())},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),s=n(1),a=n(0),u=n(2);t.default=function(e,t){var n=this;return new Promise(function(c,l){return r(n,void 0,void 0,function(){var n,p,d=this;return i(this,function(f){switch(f.label){case 0:return[4,(n=new u.default).apiUrl];case 1:p=f.sent();try{fetch(""+p+e,{method:"post",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:JSON.stringify({request:t})}).then(function(u){u.ok?u.json().then(function(u){return r(d,void 0,void 0,function(){var r,p;return i(this,function(i){switch(i.label){case 0:return 200!=u.status_code?(o.logAndRejectError("Error occurred during the "+e+" call to Pushwoosh: "+u.status_message,l),[2]):(p=void 0===(r=u.base_url)?null:r)?(s.keyValue.set(a.KEY_API_BASE_URL,p),[4,n.setApiUrl(p)]):[3,2];case 1:i.sent(),i.label=2;case 2:return o.default.write("apirequest",e+" call with arguments: "+JSON.stringify(t)+" to Pushwoosh has been successful. Result: "+JSON.stringify(u.response),"createDoApiFetch"),c(u.response),[2]}})})}):o.logAndRejectError(u.statusText||"response not ok",l)})}catch(t){o.logAndRejectError("Exception while "+e+" the device: "+t,l)}return[2]}})})})}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(25),s=n(2),a=n(15),u=n(5),c=n(16),l=n(17),p=n(18),d=n(0),f=function(){function e(e,t,n,r,i,p){void 0===e&&(e=new o.default),void 0===t&&(t=new s.default),void 0===n&&(n=new a.default),void 0===r&&(r=new u.default),void 0===i&&(i=new c.default),void 0===p&&(p=new l.default),this.storage=e,this.storeName="inboxMessages",this.params=t,this.inboxParams=n,this.dateModule=r,this.payloadBuilder=p,this.apiClient=i}return e.prototype.getInboxMessages=function(){return r(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return[4,this.payloadBuilder.getInboxMessages()];case 1:return e=n.sent(),[4,this.apiClient.getInboxMessages(e)];case 2:return t=n.sent(),[4,this.storeGetInboxMessagesRequestParams(t.next,t.new_inbox)];case 3:return n.sent(),[2,t]}})})},e.prototype.storeGetInboxMessagesRequestParams=function(e,t){return r(this,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return this.dateModule.date=new Date,[4,this.inboxParams.setLastRequestTime(this.dateModule.getUtcTimestamp())];case 1:return n.sent(),[4,this.inboxParams.setLastRequestCode(e)];case 2:return n.sent(),[4,this.inboxParams.setNewMessagesCount(t)];case 3:return n.sent(),[2]}})})},e.prototype.putServerMessages=function(e){return r(this,void 0,void 0,function(){var t,n=this;return i(this,function(o){return t=e.map(function(e){return r(n,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return[4,this.storage.get(this.storeName,e.inbox_id,{})];case 1:return"status"in(t=n.sent())&&(e.status=t.status),[2,this.putMessage(e)]}})})}),[2,Promise.all(t)]})})},e.prototype.putMessage=function(e){return this.storage.put(this.storeName,e)},e.prototype.putBulkMessages=function(e){var t=this,n=e.map(function(e){return t.putMessage(e)});return Promise.all(n)},e.prototype.deleteMessages=function(e){var t=this,n=e.map(function(e){return t.storage.delete(t.storeName,e)});return Promise.all(n)},e.prototype.deleteExpiredMessages=function(){return r(this,void 0,void 0,function(){var e,t,n;return i(this,function(r){switch(r.label){case 0:return this.dateModule.date=new Date,e=""+this.dateModule.getTimestamp(),[4,this.storage.getAll(this.storeName)];case 1:return t=r.sent(),n=t.filter(function(t){return t.rt>e}).map(function(e){return e.inbox_id}),[2,this.deleteMessages(n)]}})})},e.prototype.getMessage=function(e){return this.storage.get(this.storeName,e)},e.prototype.getReadOpenMessages=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.storage.getAll(this.storeName)];case 1:return[2,e.sent().filter(function(e){return 2===e.status||3===e.status})]}})})},e.prototype.getDeliveredMessages=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.storage.getAll(this.storeName)];case 1:return[2,e.sent().filter(function(e){return 1===e.status})]}})})},e.prototype.messagesCount=function(){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,this.storage.count(this.storeName)]})})},e.prototype.getDeliveredMessagesCount=function(){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,this.storage.countByIndex(this.storeName,"status",1)]})})},e.prototype.getReadMessagesCount=function(){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,this.storage.countByIndex(this.storeName,"status",2)]})})},e.prototype.getDeliveredReadMessagesCount=function(){return r(this,void 0,void 0,function(){var e,t;return i(this,function(n){return e=[2,3],t=IDBKeyRange.bound(e[0],e[1]),[2,this.storage.countByIndex(this.storeName,"status",t)]})})},e.prototype.updateMessages=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return[4,this.getInboxMessages()];case 1:return t=n.sent(),[4,this.deleteExpiredMessages()];case 2:return n.sent(),[4,this.deleteMessages(t.deleted)];case 3:return n.sent(),[4,this.putServerMessages(t.messages)];case 4:return n.sent(),e&&e.emit(d.EVENT_ON_UPDATE_INBOX_MESSAGES,new p.default),[2]}})})},e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(){}return Object.defineProperty(e.prototype,"lastRequestCode",{get:function(){return r.keyValue.get("inbox.lastRequestCode","")},enumerable:!0,configurable:!0}),e.prototype.setLastRequestCode=function(e){return r.keyValue.set("inbox.lastRequestCode",e)},Object.defineProperty(e.prototype,"lastRequestTime",{get:function(){return r.keyValue.get("inbox.lastRequestTime",0)},enumerable:!0,configurable:!0}),e.prototype.setLastRequestTime=function(e){return r.keyValue.set("inbox.lastRequestTime",e)},Object.defineProperty(e.prototype,"newMessagesCount",{get:function(){return r.keyValue.get("inbox.newMessagesCount",0)},enumerable:!0,configurable:!0}),e.prototype.setNewMessagesCount=function(e){return r.keyValue.set("inbox.newMessagesCount",e)},e}();t.default=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(13),s=function(){function e(){}return e.prototype.getInboxMessages=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,o.default("getInboxMessages",e)]})})},e.prototype.inboxStatus=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,o.default("inboxStatus",e)]})})},e}();t.default=s},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),s=n(15),a=n(4),u=function(){function e(e,t,n){void 0===e&&(e=new o.default),void 0===t&&(t=new s.default),void 0===n&&(n=new a.PlatformChecker(Function("return this")())),this.params=e,this.inboxParams=t,this.platformChecker=n}return e.prototype.getInboxMessages=function(e){return r(this,void 0,void 0,function(){var t,n,r,o,s;return i(this,function(i){switch(i.label){case 0:return[4,this.params.appCode];case 1:return t=i.sent(),[4,this.params.hwid];case 2:return n=i.sent(),[4,this.params.userId];case 3:return r=i.sent()||n,[4,this.inboxParams.lastRequestCode];case 4:return o=i.sent(),[4,this.inboxParams.lastRequestTime];case 5:return s=i.sent(),[2,{application:t,hwid:n,userId:r,count:e,last_code:o,last_request_time:s}]}})})},e.prototype.inboxStatus=function(e,t){return r(this,void 0,void 0,function(){var n,r,o;return i(this,function(i){switch(i.label){case 0:return[4,this.params.appCode];case 1:return n=i.sent(),[4,this.params.hwid];case 2:return r=i.sent(),[4,this.params.userId];case 3:return o=i.sent()||r,[2,{application:n,hwid:r,userId:o,inbox_code:e,status:t,time:(new Date).getTime(),device_type:this.platformChecker.platform}]}})})},e}();t.default=u},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(14),s=n(5),a=n(16),u=n(17),c=n(2),l=function(){function e(e,t,n,r,i){void 0===e&&(e=new o.default),void 0===t&&(t=new s.default),void 0===n&&(n=new a.default),void 0===r&&(r=new u.default),void 0===i&&(i=new c.default),this.inboxModel=e,this.dateModule=t,this.apiClient=n,this.payloadBuilder=r,this.params=i,this.publicMessageBuilder=this.publicMessageBuilder.bind(this)}return e.prototype.messageTypeFactory=function(e){var t=0;return"h"in e||"rm"in e||"r"in e?t=1:"l"in e&&void 0!==e.l&&(t=e.l.startsWith("http")?2:3),t},e.prototype.updateMessagesStatusWithCodes=function(e,t,n){return r(this,void 0,void 0,function(){var o,s,a=this;return i(this,function(u){switch(u.label){case 0:return o=[],s=[],t.forEach(function(t){return r(a,void 0,void 0,function(){var r;return i(this,function(i){switch(i.label){case 0:return-1===e.indexOf(t.inbox_id)?[2]:(t.status=n,o.push(t),[4,this.payloadBuilder.inboxStatus(t.order,t.status)]);case 1:return r=i.sent(),s.push(this.apiClient.inboxStatus(r)),[2]}})})}),[4,this.inboxModel.putBulkMessages(o)];case 1:return u.sent(),[4,Promise.all(s)];case 2:return u.sent(),[2]}})})},e.prototype.publicMessageBuilder=function(e){return r(this,void 0,void 0,function(){var t,n,r,o;return i(this,function(i){switch(i.label){case 0:return(n=e.image)?[3,2]:[4,this.params.defaultNotificationImage];case 1:n=i.sent(),i.label=2;case 2:return t=n,(o=e.title)?[3,4]:[4,this.params.defaultNotificationTitle];case 3:o=i.sent(),i.label=4;case 4:return r=o,this.dateModule.date=new Date(1e3*parseInt(e.send_date)),this.dateModule.setLocal(),[2,{title:r,imageUrl:t,code:e.inbox_id,message:e.text,sendDate:this.dateModule.date.toISOString(),type:this.messageTypeFactory(JSON.parse(e.action_params)),isRead:2===e.status||3===e.status,isActionPerformed:3===e.status}]}})})},e.prototype.messagesWithNoActionPerformedCount=function(){return this.inboxModel.getDeliveredReadMessagesCount()},e.prototype.unreadMessagesCount=function(){return this.inboxModel.getDeliveredMessagesCount()},e.prototype.messagesCount=function(){return this.inboxModel.messagesCount()},e.prototype.loadMessages=function(){return r(this,void 0,void 0,function(){var e,t,n;return i(this,function(r){switch(r.label){case 0:return[4,this.inboxModel.getReadOpenMessages()];case 1:return e=r.sent(),[4,this.inboxModel.getDeliveredMessages()];case 2:return t=r.sent(),n=e.concat(t).sort(function(e,t){return parseInt(t.send_date,10)-parseInt(e.send_date,10)}).sort(function(e,t){return parseInt(t.order||"0",10)-parseInt(e.order||"0",10)}).map(this.publicMessageBuilder),[2,Promise.all(n)]}})})},e.prototype.readMessagesWithCodes=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return[4,this.inboxModel.getDeliveredMessages()];case 1:return t=n.sent(),[4,this.updateMessagesStatusWithCodes(e,t,2)];case 2:return n.sent(),[2]}})})},e.prototype.performActionForMessageWithCode=function(e){return r(this,void 0,void 0,function(){var t,n,r,o;return i(this,function(i){switch(i.label){case 0:return[4,this.inboxModel.getMessage(e)];case 1:return t=i.sent(),n=JSON.parse(t.action_params),2===(r=this.messageTypeFactory(n))&&void 0!==n.l?document.location.href=n.l:3===r&&void 0!==n.l&&window.history.go(n.l),t.status=3,[4,this.inboxModel.putMessage(t)];case 2:return i.sent(),[4,this.payloadBuilder.inboxStatus(t.order,t.status)];case 3:return o=i.sent(),[4,this.apiClient.inboxStatus(o)];case 4:return i.sent(),[2]}})})},e.prototype.deleteMessagesWithCodes=function(e){return r(this,void 0,void 0,function(){var t,n,r;return i(this,function(i){switch(i.label){case 0:return[4,this.inboxModel.getReadOpenMessages()];case 1:return t=i.sent(),[4,this.inboxModel.getDeliveredMessages()];case 2:return n=i.sent(),r=4,[4,this.updateMessagesStatusWithCodes(e,t.concat(n),r)];case 3:return i.sent(),[2]}})})},e.prototype.syncMessages=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.inboxModel.updateMessages()];case 1:return e.sent(),[2]}})})},e}();t.default=l},function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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=4)}([function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return i}),n.d(t,"__assign",function(){return o}),n.d(t,"__rest",function(){return s}),n.d(t,"__decorate",function(){return a}),n.d(t,"__param",function(){return u}),n.d(t,"__metadata",function(){return c}),n.d(t,"__awaiter",function(){return l}),n.d(t,"__generator",function(){return p}),n.d(t,"__exportStar",function(){return d}),n.d(t,"__values",function(){return f}),n.d(t,"__read",function(){return h}),n.d(t,"__spread",function(){return b}),n.d(t,"__await",function(){return g}),n.d(t,"__asyncGenerator",function(){return w}),n.d(t,"__asyncDelegator",function(){return _}),n.d(t,"__asyncValues",function(){return m}),n.d(t,"__makeTemplateObject",function(){return v}),n.d(t,"__importStar",function(){return y}),n.d(t,"__importDefault",function(){return E});var r=function(e,t){return(r=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])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);r.length>i;i++)0>t.indexOf(r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})}function p(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function d(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function f(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function b(){for(var e=[],t=0;arguments.length>t;t++)e=e.concat(h(arguments[t]));return e}function g(e){return this instanceof g?(this.v=e,this):new g(e)}function w(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||a(e,t)})})}function a(e,t){try{(n=i[e](t)).value instanceof g?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function u(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function _(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:g(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function m(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}}}function v(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function y(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LOGGER_LEVEL_SILENT="silent",t.LOGGER_LEVEL_FATAL="fatal",t.LOGGER_LEVEL_ERROR="error",t.LOGGER_LEVEL_WARN="warn",t.LOGGER_LEVEL_INFO="info",t.LOGGER_LEVEL_DEBUG="debug",t.LOGGER_LEVEL_VALUE_SILENT=0,t.LOGGER_LEVEL_VALUE_FATAL=10,t.LOGGER_LEVEL_VALUE_ERROR=20,t.LOGGER_LEVEL_VALUE_WARN=30,t.LOGGER_LEVEL_VALUE_INFO=40,t.LOGGER_LEVEL_VALUE_DEBUG=50,t.loggerRelationsMap=((r={})[t.LOGGER_LEVEL_SILENT]=t.LOGGER_LEVEL_VALUE_SILENT,r[t.LOGGER_LEVEL_FATAL]=t.LOGGER_LEVEL_VALUE_FATAL,r[t.LOGGER_LEVEL_ERROR]=t.LOGGER_LEVEL_VALUE_ERROR,r[t.LOGGER_LEVEL_WARN]=t.LOGGER_LEVEL_VALUE_WARN,r[t.LOGGER_LEVEL_INFO]=t.LOGGER_LEVEL_VALUE_INFO,r[t.LOGGER_LEVEL_DEBUG]=t.LOGGER_LEVEL_VALUE_DEBUG,r)},function(e,t,n){"use strict";t.a=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);n(5),n(6),r.__exportStar(n(10),t),r.__exportStar(n(11),t),r.__exportStar(n(12),t)},function(e,t,n){"use strict";n.r(t),n.d(t,"Headers",function(){return c}),n.d(t,"Request",function(){return g}),n.d(t,"Response",function(){return _}),n.d(t,"DOMException",function(){return v}),n.d(t,"fetch",function(){return y});var r={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e+=""),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e+=""),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function d(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;(this._bodyInit=e)?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=""+e:r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,n,r=l(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=p(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=Array(t.length),r=0;t.length>r;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=s(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},c.prototype.delete=function(e){delete this.map[s(e)]},c.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},c.prototype.set=function(e,t){this.map[s(e)]=a(t)},c.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),u(e)},c.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),u(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),u(e)},r.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var n,r,i=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=e+"";if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),b.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&300>this.status,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},h.call(g.prototype),h.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var m=[301,302,303,307,308];_.redirect=function(e,t){if(-1===m.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})};var v=self.DOMException;try{new v}catch(e){(v=function(e,t){this.message=e,this.name=t,this.stack=Error(e).stack}).prototype=Object.create(Error.prototype),v.prototype.constructor=v}function y(e,t){return new Promise(function(n,i){var o=new g(e,t);if(o.signal&&o.signal.aborted)return i(new v("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}}),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL"),n(new _("response"in s?s.response:s.responseText,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new v("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&r.blob&&(s.responseType="blob"),o.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",a),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",a)}),s.send(void 0===o._bodyInit?null:o._bodyInit)})}y.polyfill=!0,self.fetch||(self.fetch=y,self.Headers=c,self.Request=g,self.Response=_)},function(e,t,n){"use strict";n.r(t),function(e){var r=n(3),i=setTimeout;function o(){}function s(e){if(!(this instanceof s))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,s._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void c(t.promise,e)}u(t.promise,r)}else(1===e._state?u:c)(t.promise,e._value)})):e._deferreds.push(t)}function u(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof s)return e._state=3,e._value=t,void l(e);if("function"==typeof n)return void p((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,l(e)}catch(t){c(e,t)}var r,i}function c(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&s._immediateFn(function(){e._handled||s._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;n>t;t++)a(e,e._deferreds[t]);e._deferreds=null}function p(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}s.prototype.catch=function(e){return this.then(null,e)},s.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},s.prototype.finally=r.a,s.all=function(e){return new s(function(t,n){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var i=r.length;function o(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){o(e,t)},n)}r[e]=s,0==--i&&t(r)}catch(e){n(e)}}for(var s=0;r.length>s;s++)o(s,r[s])})},s.resolve=function(e){return e&&"object"==typeof e&&e.constructor===s?e:new s(function(t){t(e)})},s.reject=function(e){return new s(function(t,n){n(e)})},s.race=function(e){return new s(function(t,n){for(var r=0,i=e.length;i>r;r++)e[r].then(t,n)})},s._immediateFn="function"==typeof e&&function(t){e(t)}||function(e){i(e,0)},s._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t.default=s}(n(7).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(8),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,s,a,u=1,c={},l=!1,p=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,r="[object process]"==={}.toString.call(e.process)?function(e){t.nextTick(function(){h(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},function(e){o.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(i=p.documentElement,function(e){var t=p.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):function(e){setTimeout(h,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=Function(""+e));for(var t=Array(arguments.length-1),n=0;t.length>n;n++)t[n]=arguments[n+1];return c[u]={callback:e,args:t},r(u),u++},d.clearImmediate=f}function f(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{f(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(1),n(9))},function(e,t){var n,r,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,c=[],l=!1,p=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):p=-1,c.length&&f())}function f(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++p<t;)u&&u[p].run();p=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function b(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;arguments.length>n;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||a(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(2);r.__exportStar(n(2),t);var o=function(){function e(e){this.relations=i.loggerRelationsMap,this.level=e&&void 0!==e.level?e.level:i.LOGGER_LEVEL_ERROR,this.applicationType=e&&void 0!==e.applicationType?e.applicationType:"sdk",this.subscribers=e&&void 0!==e.subscribers?e.subscribers:[]}return e.prototype.updateLogLevel=function(e){this.level=e},e.prototype.updateApplicationType=function(e){this.applicationType=e},e.prototype.updateApplicationCode=function(e){this.applicationCode=e},e.prototype.updateDomain=function(e){this.domain=e},e.prototype.updateDeviceInfo=function(e){this.deviceInfo=e},e.prototype.subscribe=function(e,t){this.subscribers.push({handler:t,level:e})},e.prototype.log=function(e){return r.__awaiter(this,void 0,void 0,function(){var t,n,o,s,a,u,c=this;return r.__generator(this,function(l){switch(l.label){case 0:return t=[],n=e.options,o=r.__rest(e,["options"]),s=o,n&&(a=r.__rest(n,["handler"]),s=r.__assign({},o,a)),u=this.getMessage(s),this.subscribers.forEach(function(n){n.level===e.type&&c.relations[c.level]>=c.relations[n.level]&&t.push(n.handler.call(null,u))}),n&&n.handler&&this.level!==i.LOGGER_LEVEL_SILENT&&n.handler.call(null,u),[4,Promise.all(t)];case 1:return l.sent(),[2]}})})},e.prototype.debug=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.log({type:i.LOGGER_LEVEL_DEBUG,text:e,options:t})]})})},e.prototype.info=function(e,t){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(n){return[2,this.log({type:i.LOGGER_LEVEL_INFO,text:e,options:t})]})})},e.prototype.warn=function(e,t,n){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.log({type:i.LOGGER_LEVEL_WARN,text:e,code:t,options:n})]})})},e.prototype.error=function(e,t,n){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.log({type:i.LOGGER_LEVEL_ERROR,text:e,code:t,options:n})]})})},e.prototype.fatal=function(e,t,n){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.log({type:i.LOGGER_LEVEL_FATAL,text:e,code:t,options:n})]})})},e.prototype.errorAndThrow=function(e,t,n){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.logAndThrow({type:i.LOGGER_LEVEL_ERROR,text:e,code:t,options:n})]})})},e.prototype.errorAndReject=function(e,t,n,o){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.logAndReject(e,{type:i.LOGGER_LEVEL_ERROR,text:t,code:n,options:o})]})})},e.prototype.fatalAndThrow=function(e,t,n){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.logAndThrow({type:i.LOGGER_LEVEL_FATAL,text:e,code:t,options:n})]})})},e.prototype.fatalAndReject=function(e,t,n,o){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(r){return[2,this.logAndReject(e,{type:i.LOGGER_LEVEL_FATAL,text:t,code:n,options:o})]})})},e.prototype.logAndThrow=function(e){return r.__awaiter(this,void 0,void 0,function(){var t;return r.__generator(this,function(n){switch(n.label){case 0:return[4,this.log(e)];case 1:throw n.sent(),t=Error(e.text),e.code&&(t.code=e.code),t}})})},e.prototype.logAndReject=function(e,t){return r.__awaiter(this,void 0,void 0,function(){var n;return r.__generator(this,function(r){switch(r.label){case 0:return[4,this.log(t)];case 1:return r.sent(),n=Error(t.text),t.code&&(n.code=t.code),e(n),[2]}})})},e.prototype.getMessage=function(e){return r.__assign({applicationCode:this.applicationCode,domain:this.domain,applicationType:this.applicationType,deviceInfo:this.deviceInfo},e)},e}();t.Logger=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handlerConsole=function(e){var t=e.code,n=e.text,r=e.type,i=function(e){switch(e){case"fatal":case"error":return console.error;case"warn":case"info":case"debug":return console.log}}(r);console.groupCollapsed(r),i(t?t+": "+n:n),console.groupEnd()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.handlerSematext=function(e){return r.__awaiter(this,void 0,void 0,function(){var t,n,i,o,s;return r.__generator(this,function(a){switch(a.label){case 0:for(s in t=e.text,n=e.type,i=r.__rest(e,["text","type"]),o="https://logsene-receiver.eu.sematext.com/0ebd661c-f417-4b86-aa50-223165ac1047/"+n,i)i.hasOwnProperty(s)&&"object"==typeof i[s]&&(i[s]=JSON.stringify(i[s]));return[4,fetch(o,{method:"POST",body:JSON.stringify(r.__assign({message:t},i))})];case 1:return a.sent(),[2]}})})}}])},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),a=n(8),u=n(3),c=n(4),l=n(1),p=n(6),d=n(13),f=n(2),h=function(){function e(e,t,n){void 0===n&&(n=new f.default),this.apiParams=e,this.lastOpenMessage=t,this.timezone=60*-(new Date).getTimezoneOffset(),this.doPushwooshApiMethod=d.default,this.paramsModule=n}return Object.defineProperty(e.prototype,"params",{get:function(){return console.error('Property "Pushwoosh.api.params" will be deprecated in next minor version. Instead, use the async method "Pushwoosh.api.getParams()"'),u.sendInternalPostEvent({hwid:this.apiParams.hwid,userId:this.apiParams.userId,device_type:this.apiParams.deviceType,event:"API Params",attributes:{app_code:this.apiParams.applicationCode,device_type:this.apiParams.deviceType,url:this.apiParams.applicationCode+" - "+(location?location.href:"none")}}),this.apiParams},enumerable:!0,configurable:!0}),e.prototype.getParams=function(){return i(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return[4,l.keyValue.getAll()];case 1:return e=t.sent(),[2,r({},e[s.KEY_API_PARAMS],e[s.KEY_INIT_PARAMS])]}})})},e.prototype.callAPI=function(e,t){return i(this,void 0,void 0,function(){var n,d,f,h,b,g,w,_,m=this;return o(this,function(v){switch(v.label){case 0:return[4,this.getParams()];case 1:return n=v.sent(),[4,l.keyValue.get(s.KEY_DEVICE_DATA_REMOVED)];case 2:return v.sent()?[4,a.sendFatalLogToRemoteServer({message:"Error in callAPI",code:"FATAL-API-001",error:"Device data is removed",applicationCode:n.applicationCode,deviceType:n.deviceType})]:[3,4];case 3:return v.sent(),p.default.write("error","Device data has been removed"),[2];case 4:return f=void 0===(d=n.hwid)?"":d,b=void 0===(h=n.applicationCode)?"":h,w=void 0===(g=n.userId)?"":g,c.default.isSafari&&!f?[2]:(_={hwid:f,application:b,userId:t&&t.userId||w||f,device_type:n.deviceType,v:u.getVersion()},[2,this.doPushwooshApiMethod(e,r({},t,_)).catch(function(e){return i(m,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,a.sendFatalLogToRemoteServer({message:"Error in callAPI",code:"FATAL-API-002",error:e,applicationCode:n.applicationCode,deviceType:n.deviceType})];case 1:return t.sent(),[2]}})})})])}})})},e.prototype.registerDevice=function(){return i(this,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return[4,this.getParams()];case 1:if(!(e=n.sent()).pushToken||c.default.isSafari)return[2];n.label=2;case 2:return n.trys.push([2,5,,6]),[4,l.keyValue.get(s.KEY_COMMUNICATION_ENABLED)];case 3:return 0!==n.sent()?[4,this.callAPI("registerDevice",{push_token:e.pushToken,public_key:e.publicKey,auth_token:e.authToken,fcm_token:e.fcmToken,fcm_push_set:e.fcmPushSet,language:e.tags.Language,timezone:this.timezone,device_model:e.tags["Device Model"]})]:(p.default.write("error","Communication is disabled"),[2]);case 4:return n.sent(),localStorage.setItem(s.KEY_DEVICE_REGISTRATION_STATUS,s.DEVICE_REGISTRATION_STATUS_REGISTERED),[3,6];case 5:return t=n.sent(),p.logAndThrowError(t),[3,6];case 6:return[2]}})})},e.prototype.unregisterDevice=function(){return i(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:if(c.default.isSafari)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.callAPI("unregisterDevice")];case 2:return t.sent(),localStorage.setItem(s.KEY_DEVICE_REGISTRATION_STATUS,s.DEVICE_REGISTRATION_STATUS_UNREGISTERED),[3,4];case 3:return e=t.sent(),p.logAndThrowError(e),[3,4];case 4:return[2]}})})},e.prototype.registerUser=function(e){return i(this,void 0,void 0,function(){var t,n;return o(this,function(r){switch(r.label){case 0:return[4,this.getParams()];case 1:return(t=r.sent()).userId||e?[4,this.paramsModule.setUserId((n={timezone:this.timezone,userId:e||t.userId}).userId||"")]:[2];case 2:return r.sent(),[4,l.keyValue.extend(s.KEY_INIT_PARAMS,u.validateParams(n))];case 3:return r.sent(),this.callAPI("registerUser",n),[2]}})})},e.prototype.applicationOpen=function(){return i(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return[4,this.getParams()];case 1:return e=t.sent(),this.callAPI("applicationOpen",{push_token:e.pushToken,timezone:this.timezone}),[2]}})})},e.prototype.setTags=function(e){return this.callAPI("setTags",{tags:e})},e.prototype.getTags=function(){return this.callAPI("getTags")},e.prototype.pushStat=function(e){return this.callAPI("pushStat",{hash:e})},e.prototype.messageDeliveryEvent=function(e){return this.callAPI("messageDeliveryEvent",{hash:e})},e.prototype.postEvent=function(e,t){var n=this.lastOpenMessage,i=new Date,o=i.getTime(),s=Math.floor(o/1e3),a=s-i.getTimezoneOffset()/60*3600;if(n.expiry>Date.now()){if(t.msgHash)return Promise.reject("attribute msgHash already defined");t=r({},t,{msgHash:n.messageHash})}return this.callAPI("postEvent",{event:e,attributes:t,timestampUTC:s,timestampCurrent:a})},e.prototype.triggerEvent=function(e,t){return i(this,void 0,void 0,function(){var n;return o(this,function(r){switch(r.label){case 0:return t?[4,l.keyValue.get(t)]:[3,2];case 1:return n=r.sent(),[3,3];case 2:n=null,r.label=3;case 3:return t&&n?[2]:[4,this.callAPI("triggerEvent",e)];case 4:return r.sent(),t&&l.keyValue.set(t,1),[2]}})})},e}();t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22),i=n(23),o=n(5),s=function(){function e(e){void 0===e&&(e=new o.default),this.migrations={initial:r.default,"2018/11/26":i.default},this.dateModule=e}return Object.defineProperty(e.prototype,"initial",{get:function(){return this.migrations.initial},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dateSorted",{get:function(){var e=this;return Object.keys(this.migrations).filter(function(e){return"initial"!==e}).sort(function(e,t){var n=new o.default(new Date(e)),r=new o.default(new Date(t));return n.getTimestamp()-r.getTimestamp()}).map(function(t){return e.migrations[t]})},enumerable:!0,configurable:!0}),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),i=n(7);t.default=[r.storeCreatorDecorator(i.STORE_NAME_KEY_VALUE,function(e){e.createObjectStore(i.STORE_NAME_KEY_VALUE,{keyPath:"key"})}),r.storeCreatorDecorator(i.STORE_NAME_MAIN_LOG,function(e){var t=e.createObjectStore(i.STORE_NAME_MAIN_LOG,{keyPath:i.KEY_PATH_BASE_INCREMENT,autoIncrement:!0});t.createIndex("environment","environment",{unique:!1}),t.createIndex("date","date",{unique:!1}),t.createIndex("type","type",{unique:!1})}),r.storeCreatorDecorator(i.STORE_NAME_MESSAGE_LOG,function(e){e.createObjectStore(i.STORE_NAME_MESSAGE_LOG,{keyPath:i.KEY_PATH_BASE_INCREMENT,autoIncrement:!0}).createIndex("date","date",{unique:!1})})]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),i=n(7);t.default=[r.storeCreatorDecorator(i.STORE_NAME_INBOX_MESSAGES,function(e){var t=e.createObjectStore(i.STORE_NAME_INBOX_MESSAGES,{keyPath:"inbox_id",autoIncrement:!1});t.createIndex("status","status",{unique:!1,multiEntry:!0}),t.createIndex("rt","rt",{unique:!1,multiEntry:!0})})]},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),s=function(){function e(){}return e.prototype.buildApiUrl=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return[4,e];case 1:return[2,(t=n.sent())&&-1===t.indexOf(".")?"https://"+t+".api.pushwoosh.com/json/1.3/":o.DEFAULT_API_URL]}})})},e}();t.default=s},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(9),s=n(10),a=n(26),u=function(){function e(){}return e.prototype.dbVersionChangeHandler=function(e,t){console.info("onversionchange",t),e.close()},e.prototype.dbRequestSuccessHandler=function(e,t){var n=this,r=t.target.result;r.onversionchange=function(e){n.dbVersionChangeHandler(r,e)},e(r)},e.prototype.dbRequestUpgradeNeededHandler=function(e){var t=this,n=e.target.result;n.onversionchange=function(e){t.dbVersionChangeHandler(n,e)},new s.default(n).applyMigrations()},e.prototype.getDB=function(){var e=this;return new Promise(function(t,n){var r=indexedDB.open("PUSHWOOSH_SDK_STORE",o.default);r.onsuccess=function(n){e.dbRequestSuccessHandler(t,n)},r.onupgradeneeded=function(t){e.dbRequestUpgradeNeededHandler(t)},r.onerror=function(){return n(r.error)}})},e.prototype.put=function(e,t,n){return r(this,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:return[4,this.getDB()];case 1:return r=i.sent(),[4,new a.default(r,e).put(t,n)];case 2:return o=i.sent(),r.close(),[2,o]}})})},e.prototype.delete=function(e,t){return r(this,void 0,void 0,function(){var n,r;return i(this,function(i){switch(i.label){case 0:return[4,this.getDB()];case 1:return n=i.sent(),[4,new a.default(n,e).delete(t)];case 2:return r=i.sent(),n.close(),[2,r]}})})},e.prototype.get=function(e,t,n){return r(this,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:return[4,this.getDB()];case 1:return r=i.sent(),[4,new a.default(r,e).get(t,n)];case 2:return o=i.sent(),r.close(),[2,o]}})})},e.prototype.getAll=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return[4,this.getDB()];case 1:return t=r.sent(),[4,new a.default(t,e).getAll()];case 2:return n=r.sent(),t.close(),[2,n||[]]}})})},e.prototype.count=function(e,t){return r(this,void 0,void 0,function(){var n,r;return i(this,function(i){switch(i.label){case 0:return[4,this.getDB()];case 1:return n=i.sent(),[4,new a.default(n,e).count(t)];case 2:return r=i.sent(),n.close(),[2,r]}})})},e.prototype.countByIndex=function(e,t,n){return r(this,void 0,void 0,function(){var r,o,s;return i(this,function(i){switch(i.label){case 0:return[4,this.getDB()];case 1:return r=i.sent(),(o=new a.default(r,e)).index=t,[4,o.countByIndex(n)];case 2:return s=i.sent(),r.close(),[2,s]}})})},e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){this.name=t,this.store=e.transaction(this.name,"readwrite").objectStore(this.name)}return Object.defineProperty(e.prototype,"index",{set:function(e){this.store.indexNames.contains(e)?this._index=this.store.index(e):console.warn('Index "'+e+'" in ')},enumerable:!0,configurable:!0}),e.prototype.writeRequestPromise=function(e,t){return new Promise(function(n,r){e.onsuccess=function(){n(t)},e.onerror=function(){r(e.error)}})},e.prototype.readRequestPromise=function(e,t){return new Promise(function(n,r){e.onsuccess=function(e){n(e.target.result||t)},e.onerror=function(){r(e.error)}})},e.prototype.put=function(e,t){var n=this.store.put(e,t);return this.writeRequestPromise(n,t)},e.prototype.add=function(e,t){return this.put(e,t)},e.prototype.delete=function(e){var t=this.store.delete(e);return this.writeRequestPromise(t)},e.prototype.get=function(e,t){var n=this.store.get(e);return this.readRequestPromise(n,t)},e.prototype.getAll=function(){var e=this.store.openCursor(),t=[];return new Promise(function(n,r){e.onsuccess=function(e){var r=e.target.result;r?(t.push(r.value),r.continue()):n(t)},e.onerror=function(){r(e.error)}})},e.prototype.count=function(e){var t=this.store.count(e);return this.readRequestPromise(t,0)},e.prototype.countByIndex=function(e){var t=this._index.count(e);return this.readRequestPromise(t,0)},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BELL_POSITION_BOTTOM_RIGHT="bottomRight",t.BELL_POSITION_BOTTOM_LEFT="bottomLeft",t.BELL_POSITION_TOP_RIGHT="topRight",t.BELL_POSITION_TOP_LEFT="topLeft",t.WIDGET_CONTAINER_ID="pushwooshBellWidget",t.SUBSCRIBE_WIDGET_DEFAULT_CONFIG={position:t.BELL_POSITION_BOTTOM_LEFT,bgColor:"#12AE7E",bellColor:"white",bellStrokeColor:"#08754f",bellButtonBorder:"1px solid #379676",shadow:"0px 0px 6px rgba(0, 0, 0, 0.75)",size:"48px",indent:"20px",zIndex:"999999",tooltipText:{successSubscribe:"You are successfully subscribed!",needSubscribe:"Get notifications about important news!",blockSubscribe:"Click to see how to get notifications",alreadySubscribed:"You are already subscribed"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(29),i=n(3);function o(){var e,t=i.getGlobal(),n=t.Pushwoosh;n&&(e=n),n=new r.default,Array.isArray(e)&&e.forEach(function(e){return n.push(e)}),t.Pushwoosh=n}n(33),n(39),n(41),"complete"===document.readyState?o():window.addEventListener("load",o)},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(8),a=n(30),u=n(20),c=n(3),l=n(4),p=n(0),d=n(6),f=n(31),h=n(32),b=n(1),g=n(2),w=n(14),_=n(18);c.patchPromise();var m=function(){function e(e,t,n,r){var s;void 0===e&&(e=new g.default),void 0===t&&(t=new w.default),void 0===n&&(n=new _.default),void 0===r&&(r=new l.PlatformChecker);var u=this;this._ee=new a.default,this._isNeedResubscribe=!1,this.ready=!1,this.debug={showLog:function(){return i(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return[4,b.log.getAll()];case 1:return e=t.sent(),console.log(e),[2]}})})},showKeyValues:function(){return i(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return[4,b.keyValue.getAll()];case 1:return e=t.sent(),console.log(e),[2]}})})},showMessages:function(){return i(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,b.message.getAll()];case 1:return e.sent().forEach(function(e){return console.log(e)}),[2]}})})}},this.pwinbox=n,this.inboxModel=t,this.paramsModule=e,this.platformChecker=r,this._onPromises={},this.platformChecker.isAvailablePromise&&(this._onPromises=((s={})[p.EVENT_ON_PERMISSION_DENIED]=new Promise(function(e){return u._ee.once(p.EVENT_ON_PERMISSION_DENIED,e)}),s[p.EVENT_ON_PERMISSION_PROMPT]=new Promise(function(e){return u._ee.once(p.EVENT_ON_PERMISSION_PROMPT,e)}),s[p.EVENT_ON_PERMISSION_GRANTED]=new Promise(function(e){return u._ee.once(p.EVENT_ON_PERMISSION_GRANTED,e)}),s)),this.onServiceWorkerMessage=this.onServiceWorkerMessage.bind(this)}return e.prototype.onReadyHandler=function(e){var t=this;this.ready?e(this.api):this._ee.on(p.EVENT_ON_READY,function(n){return e(t.api,n)})},e.prototype.push=function(e){return i(this,void 0,void 0,function(){var t,n,r,i=this;return o(this,function(o){switch(o.label){case 0:return"function"!=typeof e?[3,1]:(this.onReadyHandler(e),[3,15]);case 1:if(!Array.isArray(e))return[3,14];switch(n=e[1],t=e[0]){case"init":return[3,2];case p.EVENT_ON_READY:return[3,9];case p.EVENT_ON_REGISTER:case p.EVENT_ON_SUBSCRIBE:case p.EVENT_ON_UNSUBSCRIBE:case p.EVENT_ON_SW_INIT_ERROR:case p.EVENT_ON_PUSH_DELIVERY:case p.EVENT_ON_NOTIFICATION_CLICK:case p.EVENT_ON_NOTIFICATION_CLOSE:case p.EVENT_ON_CHANGE_COMMUNICATION_ENABLED:case p.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE:case p.EVENT_ON_UPDATE_INBOX_MESSAGES:return[3,10];case p.EVENT_ON_PERMISSION_DENIED:case p.EVENT_ON_PERMISSION_PROMPT:case p.EVENT_ON_PERMISSION_GRANTED:return[3,11]}return[3,12];case 2:if(!this.platformChecker.isAvailableNotifications)return[3,7];if("object"!=typeof n)return[3,13];o.label=3;case 3:return o.trys.push([3,5,,6]),[4,this.init(n)];case 4:return o.sent(),[3,6];case 5:return r=o.sent(),d.default.write("info","Pushwoosh init failed",r),[3,6];case 6:return[3,8];case 7:d.default.write("info","This browser does not support pushes"),o.label=8;case 8:return[3,13];case 9:return"function"!=typeof n?[3,13]:(this.onReadyHandler(n),[3,13]);case 10:return"function"!=typeof n?[3,13]:(this._ee.on(t,function(e){return n(i.api,e)}),[3,13]);case 11:return"function"!=typeof n?[3,13]:(this._onPromises[t]&&this._onPromises[t].then(function(){return n(i.api)}),[3,13]);case 12:throw Error("unknown command");case 13:return[3,15];case 14:throw Error("invalid command");case 15:return[2]}})})},e.prototype.init=function(e){return i(this,void 0,void 0,function(){var t,n,i,s,a,u,l,b,g,w,_,m,v,y,E=this;return o(this,function(o){switch(o.label){case 0:if(this._initParams=e,t=e.scope,n=e.applicationCode,i=e.pushwooshApiUrl,a=void 0===(s=e.userId)?"":s,l=void 0===(u=e.logLevel)?"error":u,!n)throw Error("no application code");return[4,this.getParams()];case 1:return(b=o.sent()).applicationCode&&b.applicationCode!==n&&(this._isNeedResubscribe=!0),[4,this.paramsModule.setAppCode(n)];case 2:return o.sent(),[4,this.paramsModule.setApiUrl(i)];case 3:return o.sent(),[4,this.paramsModule.setUserId(a)];case 4:return o.sent(),[4,this.paramsModule.setDefaultNotificationImage(e.defaultNotificationImage||"")];case 5:return o.sent(),[4,this.paramsModule.setDefaultNotificationTitle(e.defaultNotificationTitle||"")];case 6:return o.sent(),[4,this.paramsModule.apiUrl];case 7:if(g=o.sent(),w=this.params=r({autoSubscribe:!0,serviceWorkerUrl:null,pushwooshUrl:g},e,{deviceType:this.platformChecker.platform,tags:r({Language:navigator.language||"en"},e.tags,{"Device Model":this.platformChecker.browserVersion}),driversSettings:{worker:r({serviceWorkerUrl:p.DEFAULT_SERVICE_WORKER_URL,applicationServerPublicKey:void 0},e.driversSettings&&e.driversSettings.worker)},subscribeWidget:r({enable:!1},e.subscribeWidget),inboxWidget:r({enable:!1},e.inboxWidget),subscribePopup:r({enable:!1},e.subscribePopup)}),this.subscribeWidgetConfig=w.subscribeWidget,this.inboxWidgetConfig=w.inboxWidget,this.subscribePopupConfig=w.subscribePopup,_=localStorage.getItem(p.MANUAL_SET_LOGGER_LEVEL),d.default.setLevel(_||l),!this.platformChecker.isAvailableServiceWorker)return[3,13];this.driver=new f.default({eventEmitter:this._ee,scope:t,applicationCode:n,serviceWorkerUrl:w.serviceWorkerUrl,applicationServerPublicKey:w.driversSettings.worker.applicationServerPublicKey}),o.label=8;case 8:return o.trys.push([8,11,,12]),this.driver&&this.driver.initWorker?[4,this.driver.initWorker()]:[3,10];case 9:o.sent(),o.label=10;case 10:return[3,12];case 11:return m=o.sent(),d.default.write("error",m,"driver initialization failed"),[3,12];case 12:return[3,14];case 13:if(!this.platformChecker.isSafari||!w.safariWebsitePushID)throw Error("can't initialize safari");this.driver=new h.default({eventEmitter:this._ee,applicationCode:n,pushwooshUrl:g,pushwooshApiUrl:w.pushwooshApiUrl,webSitePushID:w.safariWebsitePushID}),this._ee.on(p.EVENT_ON_READY,function(){var e=/#P(.*)/,t=decodeURIComponent(document.location.hash);e.test(t)&&E.api.pushStat(e.exec(t)[1]).then(c.clearLocationHash)}),o.label=14;case 14:return o.trys.push([14,16,,17]),[4,this.defaultProcess()];case 15:return o.sent(),"serviceWorker"in navigator&&(navigator.serviceWorker.onmessage=this.onServiceWorkerMessage),[3,17];case 16:return v=o.sent(),d.default.write("error",v,"defaultProcess fail"),[3,17];case 17:return y=new CustomEvent("pushwoosh.initialized",{detail:{pw:this}}),document.dispatchEvent(y),[2]}})})},e.prototype.onServiceWorkerMessage=function(e){var t=(e||{}).data,n=(void 0===t?{}:t)||{},r=n.type,i=n.payload;this._ee.emit(void 0===r?"":r,void 0===i?{}:i)},e.prototype.initApi=function(){return i(this,void 0,void 0,function(){var e,t,n,i;return o(this,function(o){switch(o.label){case 0:return e=this.params,[4,this.driver.getAPIParams()];case 1:return t=o.sent(),[4,b.keyValue.get(p.KEY_LAST_OPEN_MESSAGE)];case 2:return n=o.sent()||{},i=r({},t,{deviceType:e.deviceType,deviceModel:e.tags["Device Model"],applicationCode:e.applicationCode,language:e.tags.Language}),e.userId&&(i.userId=e.userId),[4,Promise.all([b.keyValue.extend(p.KEY_INIT_PARAMS,c.validateParams(this.params)),b.keyValue.extend(p.KEY_API_PARAMS,t)])];case 3:return o.sent(),this.api=new u.default(i,n),[2]}})})},e.prototype.subscribe=function(){return i(this,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return[4,this.isCommunicationEnabled()];case 1:if(!n.sent())return d.default.write("error","Communication is disabled"),[2];n.label=2;case 2:return n.trys.push([2,8,,9]),[4,this.driver.isSubscribed()];case 3:return e=n.sent(),[4,this.driver.askSubscribe(this.isDeviceRegistered())];case 4:return n.sent(),[4,this.registerDuringSubscribe()];case 5:return n.sent(),e?[3,7]:[4,this.onSubscribeEmitter()];case 6:n.sent(),n.label=7;case 7:return[3,9];case 8:return t=n.sent(),d.default.write("error",t,"subscribe fail"),[3,9];case 9:return[2]}})})},e.prototype.registerDuringSubscribe=function(){return i(this,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return[4,this.driver.isSubscribed()];case 1:return e=n.sent(),this.platformChecker.isSafari?[4,this.needForcedOpen()]:[3,5];case 2:return t=n.sent(),[4,this.open(t)];case 3:return n.sent(),[4,this.inboxModel.updateMessages()];case 4:n.sent(),n.label=5;case 5:return[4,this.register(e)];case 6:return n.sent(),[2]}})})},e.prototype.onSubscribeEmitter=function(){return i(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.driver.isSubscribed()];case 1:return e.sent()&&this._ee.emit(p.EVENT_ON_SUBSCRIBE),[2]}})})},e.prototype.unsubscribe=function(e){return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this.driver.unsubscribe()];case 1:return n.sent(),[4,this.api.unregisterDevice()];case 2:return n.sent(),e&&this._ee.emit(p.EVENT_ON_UNSUBSCRIBE),[3,4];case 3:return t=n.sent(),d.default.write("error",t,"Error occurred during the unsubscribe"),[3,4];case 4:return[2]}})})},e.prototype.isDeviceRegistered=function(){return localStorage.getItem(p.KEY_DEVICE_REGISTRATION_STATUS)===p.DEVICE_REGISTRATION_STATUS_REGISTERED},e.prototype.isDeviceUnregistered=function(){return localStorage.getItem(p.KEY_DEVICE_REGISTRATION_STATUS)===p.DEVICE_REGISTRATION_STATUS_UNREGISTERED},e.prototype.isSubscribed=function(){return i(this,void 0,void 0,function(){return o(this,function(e){return[2,(this.platformChecker.isSafari||this.isDeviceRegistered())&&this.driver.isSubscribed()||!1]})})},e.prototype.register=function(e){return i(this,void 0,void 0,function(){var t,n,i,s,a,u;return o(this,function(o){switch(o.label){case 0:if(!this.api)throw Error("API is not inited");return[4,this.isCommunicationEnabled()];case 1:return o.sent()?[4,b.keyValue.getAll()]:[2];case 2:return t=o.sent(),n=t[p.KEY_SDK_VERSION],i=t[p.KEY_API_PARAMS],s=t[p.KEY_INIT_PARAMS],[4,this.driver.getAPIParams()];case 3:return a=o.sent(),u=this.params,!(c.getVersion()===n&&JSON.stringify(i)===JSON.stringify(a)&&JSON.stringify(s.tags)===JSON.stringify(u.tags))||e?[4,Promise.all([b.keyValue.set(p.KEY_API_PARAMS,a),b.keyValue.extend(p.KEY_INIT_PARAMS,{tags:u.tags}),b.keyValue.set(p.KEY_SDK_VERSION,c.getVersion())])]:[3,6];case 4:return o.sent(),[4,Promise.all([this.api.registerDevice(),this.api.setTags(r({},u.tags)),this.api.registerUser()])];case 5:o.sent(),this._ee.emit(p.EVENT_ON_REGISTER),o.label=6;case 6:return[2]}})})},e.prototype.isCommunicationEnabled=function(){return i(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,b.keyValue.get(p.KEY_COMMUNICATION_ENABLED)];case 1:return[2,0!==e.sent()]}})})},e.prototype.setCommunicationEnabled=function(e){return void 0===e&&(e=!0),i(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:if(!this.api)throw Error("API is not inited");return[4,this.getParams()];case 1:return t=n.sent().deviceType,[4,this.api.postEvent(p.EVENT_GDPR_CONSENT,{channel:!!e,device_type:t})];case 2:return n.sent(),[4,b.keyValue.set(p.KEY_COMMUNICATION_ENABLED,e?1:0)];case 3:return n.sent(),this._ee.emit(p.EVENT_ON_CHANGE_COMMUNICATION_ENABLED,!!e),e?[2,this.api.registerDevice()]:[2,this.api.unregisterDevice()]}})})},e.prototype.removeAllDeviceData=function(){return i(this,void 0,void 0,function(){var e,t,n;return o(this,function(r){switch(r.label){case 0:if(!this.api)throw Error("API is not inited");return[4,this.getParams()];case 1:return e=r.sent().deviceType,[4,this.api.getTags()];case 2:return t=r.sent(),n=Object.keys(t.result).reduce(function(e,t){return e[t]=null,e},{}),[4,this.api.postEvent(p.EVENT_GDPR_DELETE,{status:!0,device_type:e})];case 3:return r.sent(),[4,Promise.all([this.api.setTags(n),this.api.unregisterDevice()])];case 4:return r.sent(),[2,b.keyValue.set(p.KEY_DEVICE_DATA_REMOVED,1)]}})})},e.prototype.open=function(e){return i(this,void 0,void 0,function(){var t,n,r,i;return o(this,function(o){switch(o.label){case 0:return[4,this.driver.getAPIParams()];case 1:return t=o.sent(),n=Date.now(),[4,b.keyValue.get(p.KEY_LAST_SENT_APP_OPEN)];case 2:return r=o.sent(),this.platformChecker.isSafari&&!t.hwid?[2]:e||n-(isNaN(r)?0:+r)>p.PERIOD_SEND_APP_OPEN?(i=[b.keyValue.set(p.KEY_LAST_SENT_APP_OPEN,n||Date.now()),this.api.applicationOpen()],[4,Promise.all(i)]):[3,4];case 3:o.sent(),o.label=4;case 4:return[2]}})})},e.prototype.needForcedOpen=function(){return i(this,void 0,void 0,function(){var e,t,n,r;return o(this,function(i){switch(i.label){case 0:return this.platformChecker.isSafari?[4,b.keyValue.get(p.KEY_SAFARI_PREVIOUS_PERMISSION)]:[2,Promise.resolve(!1)];case 1:return e=i.sent(),[4,this.driver.getPermission()];case 2:return t=i.sent(),n=function(e,t){return e!==p.PERMISSION_GRANTED&&t===p.PERMISSION_GRANTED},[4,b.keyValue.set(p.KEY_SAFARI_PREVIOUS_PERMISSION,t)];case 3:return i.sent(),r=n(this.permissionOnInit,t)||n(e,t),[2,Promise.resolve(r)]}})})},e.prototype.healthCheck=function(){return i(this,void 0,void 0,function(){var e,t,n=this;return o(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,6]),this.isDeviceRegistered()?[4,this.api.getTags().catch(function(){return n.api.registerDevice()})]:[3,2];case 1:r.sent(),r.label=2;case 2:return[3,6];case 3:return e=r.sent(),[4,b.keyValue.getAll()];case 4:return t=r.sent(),[4,s.sendFatalLogToRemoteServer({message:"Error in healthCheck",code:"FATAL-API-002",error:e,applicationCode:t["params.applicationCode"],workerVersion:t.WORKER_VERSION})];case 5:return r.sent(),[3,6];case 6:return[2]}})})},e.prototype.defaultProcess=function(){return i(this,void 0,void 0,function(){var e,t,n,r,i,s;return o(this,function(o){switch(o.label){case 0:return t=void 0===(e=(this.params||{}).autoSubscribe)||e,n=this,[4,this.driver.getPermission()];case 1:return n.permissionOnInit=o.sent(),[4,this.initApi()];case 2:return o.sent(),[4,this.healthCheck()];case 3:return o.sent(),[4,this.open()];case 4:return o.sent(),[4,this.api.getParams()];case 5:return r=o.sent(),this.platformChecker.isSafari&&r.hwid?[4,this.inboxModel.updateMessages(this._ee)]:[3,7];case 6:o.sent(),o.label=7;case 7:return this.driver.isNeedUnsubscribe?[4,this.driver.isNeedUnsubscribe()]:[3,11];case 8:return o.sent()&&this.isDeviceRegistered()?[4,this.unsubscribe(!1)]:[3,11];case 9:return o.sent(),[4,b.keyValue.set(p.KEY_UNSUBSCRIBED_DUE_TO_UNDEFINED_KEYS,!0)];case 10:o.sent(),o.label=11;case 11:return this._isNeedResubscribe?[4,this.unsubscribe(!1)]:[3,13];case 12:o.sent(),o.label=13;case 13:return[4,b.keyValue.get(p.KEY_DEVICE_DATA_REMOVED)];case 14:if(o.sent())return d.default.write("error","Device data has been removed"),[2];switch(this.permissionOnInit){case p.PERMISSION_DENIED:return[3,15];case p.PERMISSION_PROMPT:return[3,18];case p.PERMISSION_GRANTED:return[3,24]}return[3,32];case 15:return this._ee.emit(p.EVENT_ON_PERMISSION_DENIED),this.platformChecker.isSafari||!this.isDeviceRegistered()?[3,17]:[4,this.unsubscribe()];case 16:o.sent(),o.label=17;case 17:return localStorage.removeItem(p.KEY_DEVICE_REGISTRATION_STATUS),[3,33];case 18:return this.platformChecker.isSafari||!this.isDeviceRegistered()?[3,20]:[4,this.unsubscribe()];case 19:o.sent(),o.label=20;case 20:return localStorage.removeItem(p.KEY_DEVICE_REGISTRATION_STATUS),t?[4,this.subscribe()]:[3,22];case 21:return o.sent(),[3,23];case 22:this._ee.emit(p.EVENT_ON_PERMISSION_PROMPT),o.label=23;case 23:return[3,33];case 24:return[4,this.isSubscribed()];case 25:return o.sent()?[3,27]:[4,this.subscribe()];case 26:o.sent(),o.label=27;case 27:return this._ee.emit(p.EVENT_ON_PERMISSION_GRANTED),[4,b.keyValue.get(p.KEY_UNSUBSCRIBED_DUE_TO_UNDEFINED_KEYS)];case 28:return i=o.sent(),!(this.platformChecker.isSafari||this.isDeviceRegistered()||this.isDeviceUnregistered())||this._isNeedResubscribe||i?[4,this.subscribe()]:[3,31];case 29:return o.sent(),[4,b.keyValue.set(p.KEY_UNSUBSCRIBED_DUE_TO_UNDEFINED_KEYS,!1)];case 30:o.sent(),o.label=31;case 31:return[3,33];case 32:d.default.write("error",this.permissionOnInit,"unknown permission value"),o.label=33;case 33:return[4,this.initApi()];case 34:return o.sent(),[4,this.register()];case 35:return o.sent(),[4,this.needForcedOpen()];case 36:return o.sent()?[4,this.open(!0)]:[3,38];case 37:o.sent(),o.label=38;case 38:return this._ee.emit(p.EVENT_ON_READY),this.ready=!0,[4,b.keyValue.get(p.KEY_DELAYED_EVENT)];case 39:return(s=o.sent())?[4,this._ee.emit(s.type,s.payload)]:[3,42];case 40:return o.sent(),[4,b.keyValue.set(p.KEY_DELAYED_EVENT,null)];case 41:o.sent(),o.label=42;case 42:return[2]}})})},e.prototype.getHWID=function(){return i(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return[4,this.driver.getAPIParams()];case 1:return e=t.sent().hwid,[2,Promise.resolve(e)]}})})},e.prototype.getPushToken=function(){return i(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return[4,this.driver.getAPIParams()];case 1:return e=t.sent().pushToken,[2,Promise.resolve(e)]}})})},e.prototype.getUserId=function(){return i(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.getParams()];case 1:return[2,e.sent().userId||this.params.userId||null]}})})},e.prototype.getParams=function(){return i(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return[4,b.keyValue.getAll()];case 1:return e=t.sent(),[2,r({},e[p.KEY_API_PARAMS],e[p.KEY_INIT_PARAMS])]}})})},e}();t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._events={}}return e.prototype.emit=function(e,t){var n=this._events[e]&&this._events[e].slice();if(n&&n.length)for(var r=0;n.length>r;r++)n[r](t)},e.prototype.on=function(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),this},e.prototype.once=function(e,t){var n=this,r=!1,i=function(o){if(!r)return r=!0,n.removeListener(e,i),t(o)};return this.on(e,i)},e.prototype.removeListener=function(e,t){var n=this._events[e];if(n){var r=n.indexOf(t);r>-1&&n.splice(r,1),1>n.length&&delete this._events[e]}},e}();t.default=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),s=n(4),a=n(0),u=n(1),c=n(6),l=n(2),p=function(){function e(e,t){void 0===t&&(t=new l.default),this.params=e,this.paramsModule=t}return e.prototype.initWorker=function(){return r(this,void 0,void 0,function(){var e,t,n,r,s;return i(this,function(i){switch(i.label){case 0:return t=(e=this.params).serviceWorkerUrl,r=(n=e.scope)?{scope:n}:void 0,s=null===t?"/"+a.DEFAULT_SERVICE_WORKER_URL+"?cache_clean="+o.generateUUID():t+"?cache_clean="+o.generateUUID(),[4,navigator.serviceWorker.register(s,r)];case 1:return i.sent(),[2]}})})},e.prototype.getPermission=function(){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,Notification.permission]})})},e.prototype.isSubscribed=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,navigator.serviceWorker.getRegistration()];case 1:return(e=t.sent())?[4,e.update()]:[2,!1];case 2:return t.sent(),[4,e.pushManager.getSubscription()];case 3:return[2,!!t.sent()]}})})},e.prototype.emit=function(e){var t=(this.params||{}).eventEmitter;(void 0===t?{emit:function(e){return e}}:t).emit(e)},e.prototype.askSubscribe=function(e){return r(this,void 0,void 0,function(){var t,n,r;return i(this,function(i){switch(i.label){case 0:return[4,navigator.serviceWorker.ready];case 1:return[4,(t=i.sent()).pushManager.getSubscription()];case 2:return(n=i.sent())&&n.unsubscribe&&e?[4,n.unsubscribe()]:[3,4];case 3:i.sent(),i.label=4;case 4:return[4,u.keyValue.get(a.KEY_DEVICE_DATA_REMOVED)];case 5:return i.sent()?(c.default.write("error","Device data has been removed"),[2]):[4,window.Notification.requestPermission()];case 6:return(r=i.sent())!==a.PERMISSION_GRANTED?[3,8]:[4,this.subscribe(t)];case 7:return[2,i.sent()];case 8:r===a.PERMISSION_DENIED&&this.emit(a.EVENT_ON_PERMISSION_DENIED),i.label=9;case 9:return[2,n]}})})},e.prototype.subscribe=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return[4,u.keyValue.get(a.KEY_DEVICE_DATA_REMOVED)];case 1:return r.sent()?(c.default.write("error","Device data has been removed"),[2]):(t={userVisibleOnly:!0},11==s.default.platform&&this.params.applicationServerPublicKey&&(t.applicationServerKey=o.urlB64ToUint8Array(this.params.applicationServerPublicKey)),[4,e.pushManager.subscribe(t)]);case 2:return n=r.sent(),this.emit(a.EVENT_ON_PERMISSION_GRANTED),[4,this.getFCMToken()];case 3:return r.sent(),[2,n]}})})},e.prototype.unsubscribe=function(){return r(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return[4,navigator.serviceWorker.getRegistration()];case 1:return(e=n.sent())?[4,e.pushManager.getSubscription()]:[2,!1];case 2:return(t=n.sent())&&t.unsubscribe?[2,t.unsubscribe()]:[2,!1]}})})},e.prototype.getAPIParams=function(){return r(this,void 0,void 0,function(){var e,t,n,r,s,c;return i(this,function(i){switch(i.label){case 0:return[4,navigator.serviceWorker.getRegistration()];case 1:return i.sent()?[3,3]:(e=a.KEY_API_PARAMS,[4,u.keyValue.getAll()]);case 2:if(t=i.sent()[e])return[2,t];throw this.emit(a.EVENT_ON_SW_INIT_ERROR),Error("No service worker registration");case 3:return[4,navigator.serviceWorker.ready];case 4:return[4,i.sent().pushManager.getSubscription()];case 5:return n=i.sent(),r=o.getPushToken(n),c={pushToken:r},[4,o.generateHwid(this.params.applicationCode,r)];case 6:return c.hwid=i.sent(),c.publicKey=o.getPublicKey(n),c.authToken=o.getAuthToken(n),[4,o.getFcmKey(n,"pushSet")];case 7:return c.fcmPushSet=i.sent(),[4,o.getFcmKey(n,"token")];case 8:return c.fcmToken=i.sent(),[4,this.paramsModule.setHwid((s=c).hwid)];case 9:return i.sent(),[2,s]}})})},e.prototype.getFCMToken=function(){return r(this,void 0,void 0,function(){var e,t,n,r,s,c=this;return i(this,function(i){switch(i.label){case 0:return[4,navigator.serviceWorker.getRegistration()];case 1:return e=i.sent(),t=null,e?[4,e.pushManager.getSubscription()]:[3,3];case 2:t=i.sent(),i.label=3;case 3:return[4,u.keyValue.get(a.KEY_SENDER_ID)];case 4:return n=i.sent(),r="https://fcm.googleapis.com/fcm/connect/subscribe",n?(s={endpoint:t?t.endpoint:"",encryption_key:o.getPublicKey(t),encryption_auth:o.getAuthToken(t),authorized_entity:n},[4,fetch(r,{method:"post",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:JSON.stringify(s)}).then(function(e){return c.onFCMSubscribe(e)})]):(console.warn("SenderID can not be found"),[2]);case 5:return i.sent(),[2]}})})},e.prototype.onFCMSubscribe=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:if(200!==e.status)return[3,6];r.label=1;case 1:return r.trys.push([1,4,,5]),[4,e.json()];case 2:return t=r.sent(),[4,u.keyValue.set(a.KEY_FCM_SUBSCRIPTION,{token:t.token||"",pushSet:t.pushSet||""})];case 3:return r.sent(),[3,5];case 4:return n=r.sent(),console.warn("Can't parse FCM response",n),[3,5];case 5:return[3,7];case 6:return console.warn("Error while FCM Subscribe",e.text()),[2];case 7:return[2]}})})},e.prototype.isNeedUnsubscribe=function(){return r(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return[4,this.checkSenderId()];case 1:return e=n.sent(),[4,this.checkFCMKeys()];case 2:return t=n.sent(),[2,!e||!t]}})})},e.prototype.checkFCMKeys=function(){return r(this,void 0,void 0,function(){var e,t,n;return i(this,function(r){switch(r.label){case 0:return[4,u.keyValue.get(a.KEY_FCM_SUBSCRIPTION)];case 1:return e=r.sent()||{},n=e.token,[2,!(!(void 0===(t=e.pushSet)?"":t)||!(void 0===n?"":n))]}})})},e.prototype.checkSenderId=function(){return r(this,void 0,void 0,function(){var e,t,n=this;return i(this,function(r){switch(r.label){case 0:return null===(e=document.querySelector('link[rel="manifest"]'))?(c.default.write("error","Link to manifest can not find"),[2,!1]):(t=e.getAttribute("href")||"",[4,fetch(t,{method:"get",headers:{"Content-Type":"application/json;charset=UTF-8"}}).then(function(e){return n.isSameManifest(e)})]);case 1:return[2,r.sent()]}})})},e.prototype.isSameManifest=function(e){return r(this,void 0,void 0,function(){var t,n,r,o;return i(this,function(i){switch(i.label){case 0:return 200!==e.status?[3,5]:[4,e.text()];case 1:return t=i.sent(),n=t.match(/("|')?gcm_sender_id("|')?:\s*("|')?(\d+)("|')?/),r="",n&&(r=n[4]),[4,u.keyValue.get(a.KEY_SENDER_ID)];case 2:return o=i.sent(),r&&o!==r?[4,u.keyValue.set(a.KEY_SENDER_ID,r)]:[3,4];case 3:return i.sent(),[2,!1];case 4:return[2,!0];case 5:throw Error("Cant load manifest.json")}})})},e}();t.default=p},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),s=n(2),a=function(){function e(e,t){void 0===t&&(t=new s.default),this.params=e,this.paramsModule=t}return e.prototype.getPermissionObject=function(){return safari.pushNotification.permission(this.params.webSitePushID)},e.prototype.getPermission=function(){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,this.getPermissionObject().permission]})})},e.prototype.isSubscribed=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.getPermission()];case 1:return[2,e.sent()===o.PERMISSION_GRANTED]}})})},e.prototype.askSubscribe=function(){var e=this.params||{},t=e.eventEmitter,n=void 0===t?{emit:function(e){return e}}:t,r=e.applicationCode,i=void 0===r?"":r,s=e.webSitePushID,a=void 0===s?"":s;return new Promise(function(e,t){safari.pushNotification.requestPermission("https://cp.pushwoosh.com/json/1.3/safari",a,{application:i},function(r){r.permission===o.PERMISSION_GRANTED?(n.emit(o.EVENT_ON_PERMISSION_GRANTED),e(!0)):(n.emit(o.EVENT_ON_PERMISSION_DENIED),t("Safari permission denied"))})})},e.prototype.unsubscribe=function(){return new Promise(function(e){return e(!0)})},e.prototype.getAPIParams=function(){return r(this,void 0,void 0,function(){var e,t,n,r;return i(this,function(i){switch(i.label){case 0:return e=(this.getPermissionObject()||{}).deviceToken,n=(t=void 0===e?"":e)&&t.toLowerCase()||"",r=t&&t.toLowerCase()||"",[4,this.paramsModule.setHwid(n)];case 1:return i.sent(),[2,{hwid:n,pushToken:r}]}})})},e}();t.default=a},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),s=n(4),a=n(27),u=n(34),c=n(35),l=function(){function e(e){var t=this;if(this.pw=e,s.default.isAvailableNotifications){this.clickBell=this.clickBell.bind(this),this.onSubscribeEvent=this.onSubscribeEvent.bind(this),this.onPermissionDeniedEvent=this.onPermissionDeniedEvent.bind(this),this.clickOutOfPopover=this.clickOutOfPopover.bind(this);var n=Object.assign(a.SUBSCRIBE_WIDGET_DEFAULT_CONFIG.tooltipText,this.pw.subscribeWidgetConfig.tooltipText);this.config=Object.assign(a.SUBSCRIBE_WIDGET_DEFAULT_CONFIG,this.pw.subscribeWidgetConfig),this.config.tooltipText=n,this.pw.isSubscribed().then(function(e){e||t.pw.isDeviceUnregistered()||t.render()})}else console.warn("Browser does not support push notifications")}return e.prototype.addStylesToElement=function(e,t){Object.keys(e).forEach(function(n){t.style[n]=e[n]})},e.prototype.createContainer=function(){var e=document.createElement("div");e.id=a.WIDGET_CONTAINER_ID,e.className="pushwoosh-subscribe-widget";var t=u.default.getBellPosition(this.config.position,this.config.indent),n=Object.assign({zIndex:this.config.zIndex},t);return this.addStylesToElement(n,e),e},e.prototype.createStyle=function(){var e=n(36),t=document.createElement("style");return t.innerHTML=e,t},e.prototype.createBell=function(){var e=document.createElement("div");return e.className="pushwoosh-subscribe-widget__bell-button",this.addStylesToElement({width:this.config.size,height:this.config.size,backgroundColor:this.config.bgColor,boxShadow:this.config.shadow,lineHeight:this.config.size,border:this.config.bellButtonBorder},e),e.innerHTML=c.default(this.config.bellColor,this.config.bellStrokeColor),e},e.prototype.createTooltip=function(){return r(this,void 0,void 0,function(){var e,t,n,r,o;return i(this,function(i){switch(i.label){case 0:return e=document.createElement("div"),t=u.default.getTooltipPosition(this.config.position,this.config.size),n=t[0],e.className="pushwoosh-subscribe-widget__tooltip pushwoosh-subscribe-widget__tooltip__"+t[1],this.addStylesToElement(n,e),o=(r=e).appendChild,[4,this.createTooltipContent()];case 1:return o.call(r,i.sent()),[2,e]}})})},e.prototype.createTooltipContent=function(){return r(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return e=document.createElement("div"),t=e,[4,this.tooltipTextFactory()];case 1:return t.innerText=n.sent(),e.className="pushwoosh-subscribe-widget__tooltip-content",[2,e]}})})},e.prototype.tooltipTextFactory=function(){return r(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return[4,this.pw.driver.getPermission()];case 1:switch(e=n.sent(),t=this.config.tooltipText,e){case o.PERMISSION_GRANTED:return[2,t.alreadySubscribed];case o.PERMISSION_PROMPT:return[2,t.needSubscribe];case o.PERMISSION_DENIED:return[2,t.blockSubscribe];default:return[2,t.needSubscribe]}return[2]}})})},e.prototype.createPopover=function(){var e=document.createElement("div"),t=document.createElement("div"),n=u.default.getPopoverPosition(this.config.position,this.config.size),r=n[0];t.className="pushwoosh-subscribe-widget__popover pushwoosh-subscribe-widget__popover__"+n[1],e.className="pushwoosh-subscribe-widget__popover-content-wrapper",this.style.innerHTML+=u.default.getPopoverArrowPosition(this.config.position,this.config.size);var i=Object.assign({maxWidth:"calc(100vw - "+this.config.indent+" - "+this.config.indent+")"},r);return this.addStylesToElement(i,t),e.appendChild(this.createPopoverContent()),t.appendChild(e),t},e.prototype.createPopoverContent=function(){var e,t=document.createElement("div");t.className="pushwoosh-subscribe-widget__popover-content";var n=document.createElement("img");n.width=500,n.height=130;var r=document.createElement("img");return r.width=500,r.height=230,e=this.helpImageSourceFactory(),n.src=e[0],r.src=e[1],t.appendChild(n),t.appendChild(r),t},e.prototype.helpImageSourceFactory=function(){var e,t;return s.default.isOpera?[e="https://cdn.pushwoosh.com/webpush/img/opera.jpg",t="https://cdn.pushwoosh.com/webpush/img/opera_unlock.jpg"]:(11===s.default.platform?navigator.userAgent.match(/Android/i)?(e="https://cdn.pushwoosh.com/webpush/img/mobile_chrome.jpg",t="https://cdn.pushwoosh.com/webpush/img/mobile_chrome_unlock.jpg"):(e="https://cdn.pushwoosh.com/webpush/img/chrome.jpg",t="https://cdn.pushwoosh.com/webpush/img/chrome_unlock.jpg"):12===s.default.platform?(e="https://cdn.pushwoosh.com/webpush/img/FF.jpg",t="https://cdn.pushwoosh.com/webpush/img/FF_unlock.jpg"):10===s.default.platform?(e="https://cdn.pushwoosh.com/webpush/img/safari.jpg",t="https://cdn.pushwoosh.com/webpush/img/safari_unlock.jpg"):(e="https://cdn.pushwoosh.com/webpush/img/chrome.jpg",t="https://cdn.pushwoosh.com/webpush/img/chrome_unlock.jpg"),[e,t])},e.prototype.render=function(){return r(this,void 0,void 0,function(){var e,t,n;return i(this,function(r){switch(r.label){case 0:return this.widget=this.createContainer(),this.style=this.createStyle(),e=this.createBell(),t=this,[4,this.createTooltip()];case 1:return t.tooltip=r.sent(),n=this,[4,this.createPopover()];case 2:return n.popover=r.sent(),this.widget.appendChild(this.style),this.widget.appendChild(e),this.widget.appendChild(this.tooltip),this.widget.appendChild(this.popover),document.body.appendChild(this.widget),e.addEventListener("click",this.clickBell),this.pw.push(["onSubscribe",this.onSubscribeEvent]),this.pw.push(["onPermissionDenied",this.onPermissionDeniedEvent]),window.addEventListener("click",this.clickOutOfPopover),[4,this.triggerPwEvent(o.EVENT_SHOW_SUBSCRIBE_BUTTON,o.KEY_SHOW_SUBSCRIBE_WIDGET)];case 3:return r.sent(),[2]}})})},e.prototype.toggleHelpPopover=function(){this.popover.classList.toggle("pushwoosh-subscribe-widget__popover__visible")},e.prototype.clickBell=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.pw.driver.getPermission()];case 1:return e=t.sent(),[4,this.triggerPwEvent(o.EVENT_CLICK_SUBSCRIBE_BUTTON,o.KEY_CLICK_SUBSCRIBE_WIDGET)];case 2:switch(t.sent(),e){case o.PERMISSION_GRANTED:return[2];case o.PERMISSION_PROMPT:return this.pw.subscribe(),[2];case o.PERMISSION_DENIED:return this.toggleHelpPopover(),[2];default:console.warn("Unknown browser notification permission")}return[2]}})})},e.prototype.onSubscribeEvent=function(){return r(this,void 0,void 0,function(){var e,t=this;return i(this,function(n){return null===(e=this.tooltip.querySelector("div"))?[2]:(e.innerText=this.config.tooltipText.successSubscribe,this.tooltip.classList.add("pushwoosh-subscribe-widget__tooltip__visible"),setTimeout(function(){return r(t,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return this.tooltip.classList.remove("pushwoosh-subscribe-widget__tooltip__visible"),t=e,[4,this.tooltipTextFactory()];case 1:return t.innerText=n.sent(),this.widget.classList.add("pushwoosh-subscribe-widget__subscribed"),[2]}})})},2e3),[2])})})},e.prototype.onPermissionDeniedEvent=function(){return r(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return null===(e=this.tooltip.querySelector("div"))?[2]:(t=e,[4,this.tooltipTextFactory()]);case 1:return t.innerText=n.sent(),[2]}})})},e.prototype.clickOutOfPopover=function(e){this.popover.classList.contains("pushwoosh-subscribe-widget__popover__visible")&&!e.target.classList.contains("pushwoosh-subscribe-widget__popover")&&null===e.target.closest(".pushwoosh-subscribe-widget__popover")&&!e.target.classList.contains("pushwoosh-subscribe-widget__bell-button")&&null===e.target.closest(".pushwoosh-subscribe-widget__bell-button")&&this.popover.classList.remove("pushwoosh-subscribe-widget__popover__visible")},e.prototype.triggerPwEvent=function(e,t){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return void 0===this.pw.api?[2]:[4,this.pw.getParams()];case 1:return n=r.sent().applicationCode,this.pw.api.triggerEvent({event_id:e,application:n},t),[2]}})})},e}();document.addEventListener("pushwoosh.initialized",function(e){e.detail.pw.subscribeWidgetConfig.enable&&new l(e.detail.pw)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27),i=function(){function e(){}return e.getBellPosition=function(e,t){var n;switch(e){case r.BELL_POSITION_BOTTOM_RIGHT:n={top:"auto",left:"auto",bottom:t,right:t};break;case r.BELL_POSITION_BOTTOM_LEFT:n={top:"auto",left:t,bottom:t,right:"auto"};break;case r.BELL_POSITION_TOP_LEFT:n={top:t,left:t,bottom:"auto",right:"auto"};break;case r.BELL_POSITION_TOP_RIGHT:n={top:t,left:"auto",bottom:"auto",right:t};break;default:n={top:"auto",left:"auto",bottom:t,right:t}}return n},e.getTooltipPosition=function(e,t){var n,i,o=parseInt(t)+12+"px";switch(e){case r.BELL_POSITION_BOTTOM_RIGHT:n={right:o},i="right";break;case r.BELL_POSITION_BOTTOM_LEFT:case r.BELL_POSITION_TOP_LEFT:n={left:o},i="left";break;case r.BELL_POSITION_TOP_RIGHT:n={right:o},i="right";break;default:n={right:o},i="right"}return[n,i]},e.getPopoverPosition=function(e,t){var n,i,o=parseInt(t)+15+"px";switch(e){case r.BELL_POSITION_BOTTOM_RIGHT:n={bottom:o,right:"0",left:"auto",top:"auto"},i="bottom";break;case r.BELL_POSITION_BOTTOM_LEFT:n={bottom:o,left:"0",right:"auto",top:"auto"},i="bottom";break;case r.BELL_POSITION_TOP_LEFT:n={top:o,left:"0",right:"auto",bottom:"auto"},i="top";break;case r.BELL_POSITION_TOP_RIGHT:n={top:o,right:"0",left:"auto",bottom:"auto"},i="top";break;default:n={bottom:o,right:"0",left:"auto",top:"auto"},i="bottom"}return[n,i]},e.getPopoverArrowPosition=function(e,t){var n;switch(e){case r.BELL_POSITION_BOTTOM_RIGHT:n="\n.pushwoosh-subscribe-widget__popover__bottom:after {left: auto; right: "+(parseInt(t)/2-4)+"px";break;case r.BELL_POSITION_BOTTOM_LEFT:n="\n.pushwoosh-subscribe-widget__popover__bottom:after {right: auto; left: "+(parseInt(t)/2-12)+"px";break;case r.BELL_POSITION_TOP_LEFT:n="\n.pushwoosh-subscribe-widget__popover__top:after {right: auto; left: "+(parseInt(t)/2-12)+"px";break;case r.BELL_POSITION_TOP_RIGHT:n="\n.pushwoosh-subscribe-widget__popover__top:after {left: auto; right: "+(parseInt(t)/2-4)+"px";break;default:n="\n.pushwoosh-subscribe-widget__popover__bottom:after {left: auto; right: "+(parseInt(t)/2-4)+"px"}return n},e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n   xmlns:dc="http://purl.org/dc/elements/1.1/"\n   xmlns:cc="http://creativecommons.org/ns#"\n   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n   xmlns:svg="http://www.w3.org/2000/svg"\n   xmlns="http://www.w3.org/2000/svg"\n   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n   version="1.1"\n   id="Capa_1"\n   x="0px"\n   y="0px"\n   viewBox="0 0 346.013 346.013"\n   style="enable-background:new 0 0 346.013 346.013;width: 80%; height: auto; vertical-align: middle;"\n   xml:space="preserve"\n   inkscape:version="0.91 r13725"\n   sodipodi:docname="alarm_white.svg"><metadata\n     id="metadata51"><rdf:RDF><cc:Work\n         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type\n           rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs\n     id="defs49" /><sodipodi:namedview\n     borderopacity="1"\n     objecttolerance="10"\n     gridtolerance="10"\n     guidetolerance="10"\n     inkscape:pageopacity="0"\n     inkscape:pageshadow="2"\n     inkscape:window-width="1618"\n     inkscape:window-height="828"\n     id="namedview47"\n     showgrid="false"\n     inkscape:zoom="0.6820553"\n     inkscape:cx="173.0065"\n     inkscape:cy="173.0065"\n     inkscape:window-x="0"\n     inkscape:window-y="0"\n     inkscape:window-maximized="0"\n     inkscape:current-layer="g3" /><g\n     id="g3"><path\n       d="m 256.76227,220.19006 c -1.77513,-2.69766 -3.45154,-5.24564 -3.98966,-7.46382 -0.042,-0.17861 -0.0911,-0.36128 -0.16237,-0.61436 -2.28354,-7.67647 0.69147,-24.43921 2.46886,-34.45124 0.26788,-1.50394 0.52274,-2.94197 0.75286,-4.29035 0.0232,-0.13675 0.044,-0.27211 0.0724,-0.48006 1.95582,-15.28051 2.58811,-37.91956 -5.51044,-58.99147 -5.6032,-14.57978 -14.45978,-25.82612 -26.3559,-33.48393 1.26598,-9.812938 -4.85967,-19.343691 -14.66682,-22.0511 -9.80715,-2.70741 -19.95724,2.33226 -23.90298,11.405413 -14.1382,0.467533 -27.51111,5.577097 -39.80114,15.219267 -17.76129,13.9298 -28.83431,33.68757 -34.99389,47.80757 l -0.0479,0.11335 c -0.0512,0.12175 -0.0998,0.24114 -0.13249,0.32962 -0.49733,1.28292 -1.01552,2.64514 -1.55689,4.07255 -3.61311,9.51043 -9.66004,25.42824 -15.611995,30.89342 -0.106524,0.10027 -0.208228,0.20187 -0.362362,0.35435 -1.636243,1.66563 -4.382941,2.99463 -7.288979,4.40101 -7.145531,3.45301 -22.013613,10.64166 -17.206389,31.67844 0.929154,4.07105 4.008437,7.29057 8.033861,8.40185 l 167.570804,46.2604 c 4.02253,1.11048 8.31521,-0.0729 11.2052,-3.08958 14.91617,-15.58874 5.84693,-29.38668 1.48625,-36.02133 z"\n       id="path5"\n       inkscape:connector-curvature="0"\n       vector-effect="non-scaling-stroke"\n       style="fill:'+e+"; stroke: "+t+'; stroke-width: 1; " /><path\n       vector-effect="non-scaling-stroke"\n       d="m 174.26737,259.72378 -38.76399,-10.70137 c -1.59243,-0.43962 -3.28183,-0.15596 -4.63548,0.7754 -2.53909,1.7494 -2.84182,4.93159 -3.02304,6.83188 l -0.0151,0.15247 c -1.22819,12.67106 6.79854,24.33046 19.08688,27.72284 12.51583,3.45518 25.8324,-2.91586 30.9681,-14.80385 l 0.0935,-0.19205 c 0.52305,-1.06418 1.74613,-3.55554 0.50882,-6.31116 -0.44302,-0.98439 -1.5794,-2.74529 -4.21964,-3.47416 z"\n       id="path7"\n       inkscape:connector-curvature="0"\n       style="fill:'+e+"; stroke: "+t+'; stroke-width: 1;" /></g><g\n     id="g17" /><g\n     id="g19" /><g\n     id="g21" /><g\n     id="g23" /><g\n     id="g25" /><g\n     id="g27" /><g\n     id="g29" /><g\n     id="g31" /><g\n     id="g33" /><g\n     id="g35" /><g\n     id="g37" /><g\n     id="g39" /><g\n     id="g41" /><g\n     id="g43" /><g\n     id="g45" /></svg>'}},function(e,t,n){var r=n(37);e.exports="string"==typeof r?r:""+r},function(e,t,n){(e.exports=n(38)(void 0)).push([e.i,'/* Widget */\n.pushwoosh-subscribe-widget {\n  position: fixed;\n  display: block;\n  -webkit-transform: translate3d(0, 0, 0);\n          transform: translate3d(0, 0, 0);\n}\n\n.pushwoosh-subscribe-widget__subscribed {\n  display: none;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__bell-button {\n  -webkit-border-radius: 50%;\n          border-radius: 50%;\n  cursor: pointer;\n  font-size: 0;\n  text-align: center;\n  -webkit-transform: scale(0.9) translate3d(0, 0, 0);\n          transform: scale(0.9) translate3d(0, 0, 0);\n  -webkit-transition: -webkit-transform .3s ease-in-out;\n  transition: -webkit-transform .3s ease-in-out;\n  -o-transition: transform .3s ease-in-out;\n  transition: transform .3s ease-in-out;\n  transition: transform .3s ease-in-out, -webkit-transform .3s ease-in-out;\n  position: relative;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__bell-button:hover {\n  -webkit-transform: scale(1);\n      -ms-transform: scale(1);\n          transform: scale(1);\n}\n\n/* Tooltip */\n.pushwoosh-subscribe-widget__tooltip {\n  position: absolute;\n  height: 48px;\n  max-width: 300px;\n  min-width: 200px;\n  padding: 5px 7px;\n  background-color: #3b444b;\n  color: #ffffff;\n  text-align: center;\n  vertical-align: middle;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  line-height: 38px;\n  font-size: 0;\n  font-weight: normal;\n  visibility: hidden;\n  opacity: 0;\n  -webkit-transition: visibility 0s ease-in .3s,\n              opacity .3s ease-in;\n  -o-transition: visibility 0s ease-in .3s,\n              opacity .3s ease-in;\n  transition: visibility 0s ease-in .3s,\n              opacity .3s ease-in;\n  top: 50%;\n  -webkit-transform: translate(0, -50%);\n      -ms-transform: translate(0, -50%);\n          transform: translate(0, -50%);\n  -webkit-box-shadow: 1px 1px 5px 0 rgba(0,0,0,0.5);\n          box-shadow: 1px 1px 5px 0 rgba(0,0,0,0.5);\n}\n\n.pushwoosh-subscribe-widget__tooltip__right:after,\n.pushwoosh-subscribe-widget__tooltip__left:after {\n  content: "";\n  top: 50%;\n  height: 0;\n  width: 0;\n  position: absolute;\n  pointer-events: none;\n  border-top: 5px solid transparent;\n  border-bottom: 5px solid transparent;\n  background: #3b444b;\n}\n\n.pushwoosh-subscribe-widget__tooltip__right:after {\n  left: calc(100% - 7px);\n  border-top: 5px solid #3b444b;\n  border-left: 5px solid #3b444b;\n  border-right: 5px solid transparent;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  -webkit-transform-origin: 0 0;\n      -ms-transform-origin: 0 0;\n          transform-origin: 0 0;\n  -webkit-transform: rotate(-45deg);\n      -ms-transform: rotate(-45deg);\n          transform: rotate(-45deg);\n  -webkit-box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.25);\n          box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__tooltip__left:after {\n  left: -7px;\n  border-top: 5px solid #3b444b;\n  border-right: 5px solid #3b444b;\n  border-left: 5px solid transparent;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  -webkit-transform-origin: 0 0;\n      -ms-transform-origin: 0 0;\n          transform-origin: 0 0;\n  -webkit-transform: rotate(-45deg);\n      -ms-transform: rotate(-45deg);\n          transform: rotate(-45deg);\n  -webkit-box-shadow: -2px -2px 2px 0 rgba(0, 0, 0, 0.25);\n          box-shadow: -2px -2px 2px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__bell-button:hover + .pushwoosh-subscribe-widget__tooltip,\n.pushwoosh-subscribe-widget__tooltip.pushwoosh-subscribe-widget__tooltip__visible {\n  display: block;\n  visibility: visible;\n  opacity: 1;\n  -webkit-transition-delay: 0s;\n       -o-transition-delay: 0s;\n          transition-delay: 0s;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__tooltip-content {\n  display: inline-block;\n  vertical-align: middle;\n  font-size: 14px;\n  line-height: 1.4;\n  white-space: nowrap;\n  overflow: hidden;\n  padding-right: 5px;\n  -o-text-overflow: ellipsis;\n     text-overflow: ellipsis;\n  max-width: 100%;\n}\n\n/* Popover */\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover {\n  position: absolute;\n  right: auto;\n  -webkit-box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.5);\n          box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.5);\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  background: #9ca8b1;\n  visibility: hidden;\n  opacity: 0;\n  -webkit-transition: visibility 0s ease-in .5s,\n              opacity .5s ease-in;\n  -o-transition: visibility 0s ease-in .5s,\n              opacity .5s ease-in;\n  transition: visibility 0s ease-in .5s,\n              opacity .5s ease-in;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover__visible {\n  display: block;\n  visibility: visible;\n  opacity: 1;\n  -webkit-transition-delay: 0s;\n       -o-transition-delay: 0s;\n          transition-delay: 0s;\n}\n\n.pushwoosh-subscribe-widget__popover__bottom:after,\n.pushwoosh-subscribe-widget__popover__top:after {\n  content: "";\n  height: 0;\n  width: 0;\n  position: absolute;\n  pointer-events: none;\n  border-right: 8px solid transparent;\n  border-left: 8px solid #9ca8b1;\n  background: #9ca8b1;\n  -webkit-transform-origin: 0 0;\n      -ms-transform-origin: 0 0;\n          transform-origin: 0 0;\n  -webkit-transform: rotate(-45deg);\n      -ms-transform: rotate(-45deg);\n          transform: rotate(-45deg);\n}\n\n.pushwoosh-subscribe-widget__popover__bottom:after {\n  border-bottom: 8px solid #9ca8b1;\n  border-top: 8px solid transparent;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  -webkit-box-shadow: -2px 2px 1px 0 rgba(0, 0, 0, 0.25);\n          box-shadow: -2px 2px 1px 0 rgba(0, 0, 0, 0.25);\n  bottom: -16px;\n}\n\n.pushwoosh-subscribe-widget__popover__top:after {\n  top: 0;\n  border-top: 8px solid #9ca8b1;\n  border-bottom: 8px solid transparent;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  -webkit-box-shadow: 1px -1px 1px 0 rgba(0, 0, 0, 0.25);\n          box-shadow: 1px -1px 1px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__popover-content-wrapper {\n  overflow: auto;\n  max-width: 100%;\n}\n\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-orient: vertical;\n  -webkit-box-direction: normal;\n  -webkit-flex-direction: column;\n      -ms-flex-direction: column;\n          flex-direction: column;\n  padding: 14px;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  float: left;\n  min-width: 100%;\n  -webkit-box-align: center;\n  -webkit-align-items: center;\n      -ms-flex-align: center;\n          align-items: center;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n  display: block;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n  margin-bottom: 14px;\n}\n\n@media (max-width: 767px) and (orientation: portrait) {\n  .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n    -webkit-box-orient: vertical;\n    -webkit-box-direction: normal;\n    -webkit-flex-direction: column;\n        -ms-flex-direction: column;\n            flex-direction: column;\n  }\n  .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n    max-width: 280px;\n    height: auto;\n  }\n  .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n    margin-right: 0;\n    margin-bottom: 14px;\n  }\n}\n@media (max-width: 767px) and (orientation: landscape) {\n  .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n    -webkit-box-orient: horizontal;\n    -webkit-box-direction: normal;\n    -webkit-flex-direction: row;\n        -ms-flex-direction: row;\n            flex-direction: row;\n  }\n  .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n    max-width: 280px;\n    height: auto;\n  }\n  .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n    margin-right: 14px;\n    margin-bottom: 0;\n  }\n}\n',""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i="/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */",o=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(o).concat([i]).join("\n")}return""+n}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;this.length>i;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;e.length>i;i++){var s=e[i];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(40);document.addEventListener("pushwoosh.initialized",function(e){e.detail.pw.pwinbox&&e.detail.pw.inboxWidgetConfig.enable&&(e.detail.pw.pwinboxWidget=new r.PWInboxWidget(e.detail.pw))})},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},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=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.isElementFixed=function e(t){var n="fixed"===window.getComputedStyle(t).position;return!n&&t.parentElement&&(n=e(t.parentElement)),n},t.getGlobal=function(){return Function("return this")()},t.getMessageTime=function(e){var t=new Date(e),n=t.getHours()+t.getTimezoneOffset()/60;t.setHours(n);var i=(new Date).getTime()-t.getTime();return i>6e4?r.MILLISECONDS_IN_HOUR>i&&i>0?Math.floor(i/6e4)+" minutes ago":r.MILLISECONDS_IN_DAY>i&&i>0?Math.floor(i/36e5)+" hours ago":t.getDate()+" "+r.MONTHS[t.getMonth()]+" "+t.getFullYear()+", "+t.getHours()+":"+("0"+t.getMinutes()).slice(-2):"Just now"},t.getValidColor=function(e){return"transparent"===e?e:r.COLOR_TEST_REGEXP.test(e)?e:"#333"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MILLISECONDS_IN_DAY=864e5,t.MILLISECONDS_IN_HOUR=36e5,t.MONTHS=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],t.CONFIG_STYLES=[{name:"widgetWidth",type:"size"},{name:"borderRadius",type:"size"},{name:"zIndex",type:"number"},{name:"fontFamily",type:"string"},{name:"bgColor",type:"color"},{name:"textColor",type:"color"},{name:"arrowBorderColor",type:"color"},{name:"borderColor",type:"color"},{name:"badgeBgColor",type:"color"},{name:"badgeTextColor",type:"color"},{name:"timeTextColor",type:"color"},{name:"messageTitleColor",type:"color"},{name:"emptyInboxTitleColor",type:"color"},{name:"emptyInboxTextColor",type:"color"}],t.DEFAULT_CONFIG={enable:!1,triggerId:"pwInbox",position:"bottom",appendTo:"body",title:"Inbox",bgColor:"#ffffff",textColor:"#333333",fontFamily:"inherit",borderRadius:4,borderColor:"transparent",badgeBgColor:"#ff4c00",badgeTextColor:"#ffffff",widgetWidth:350,zIndex:100,messageTitleColor:"#7a7a7a",timeTextColor:"#c4c4c4",emptyInboxTitle:"You're all caught up",emptyInboxTitleColor:"#333333",emptyInboxText:"There are no new messages. Stay tuned!",emptyInboxTextColor:"#7a7a7a",emptyInboxIconUrl:"https://pushon.pushwoosh.com/images/icon-empty-inbox.png",arrowBorderColor:"rgba(0,0,0,.1)"},t.COLOR_TEST_REGEXP=/^(#([\da-f]{3}){1,2}$|(rgb|hsl)a\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)$|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?){2}\)$)/},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.PWInboxWidget=r.default},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(1),s=n(0),a=function(){function e(e){this.pw=e,this.config=r({},o.DEFAULT_CONFIG,{arrowBorderColor:this.pw.inboxWidgetConfig.borderColor&&"transparent"!==this.pw.inboxWidgetConfig.borderColor?this.pw.inboxWidgetConfig.borderColor:"rgba(0,0,0,.1)"},this.pw.inboxWidgetConfig),this.updateInbox=this.updateInbox.bind(this),this.markVisibleItemsAsRead=this.markVisibleItemsAsRead.bind(this),this.onWidgetClickHandler=this.onWidgetClickHandler.bind(this),this.onTriggerClickHandler=this.onTriggerClickHandler.bind(this),this.onWindowScrollHandler=this.onWindowScrollHandler.bind(this),this.toggle=this.toggle.bind(this);try{this.initTrigger(),this.updateInbox(),this.addListeners()}catch(e){console.warn(e)}}return e.prototype.toggle=function(e){(void 0===e?!this.isOpened:e)?this.openWidget():this.closeWidget()},e.prototype.initTrigger=function(){if(!this.pw.pwinbox)throw Error("Web inbox is not allowed.");var e=document.getElementById(this.config.triggerId);if(!e)throw Error("Inbox trigger element doesn't exist. You must set triggerId in inboxWidget config. See the documentation.");this.trigger=e,this.trigger.classList.add("pw-inbox-trigger"),this.defaultMargin=12,this.messagesElements={},this.messages=[],this.readItems=[],this.updateCounter(0),this.isOpened=!1,this.renderWidget(),this.isFixed=s.isElementFixed(this.trigger)},e.prototype.renderWidget=function(){this.widget=document.createElement("div"),this.widget.id="pwInboxWidget",this.widget.className="pw-inbox-widget",this.widget.classList.toggle("pw-open",this.isOpened),this.widgetParent=document.querySelector(this.config.appendTo)||document.body,this.widgetParent.appendChild(this.widget),this.widgetParent.appendChild(this.getStyle()),this.renderWidgetInner()},e.prototype.getStyle=function(){var e=n(5),t=document.createElement("style");return t.innerHTML=this.configureStyle(e),t},e.prototype.configureStyle=function(e){var t=this,n=""+e;return o.CONFIG_STYLES.forEach(function(e){var r=RegExp("var\\(--"+e.name+"\\)","ig"),i=t.getStyleFormatter(e);n=n.replace(r,i)}),n},e.prototype.getStyleFormatter=function(e){switch(e.type){case"size":return(this.config[e.name]||0)+"px";case"number":return""+parseFloat(""+this.config[e.name]);case"string":return""+this.config[e.name];case"color":return s.getValidColor(""+this.config[e.name]);default:return"none"}},e.prototype.renderWidgetInner=function(){if(this.messages.length>0)this.widget.classList.remove("pw-inbox-widget--empty"),this.widget.innerHTML=i.widgetTemplate(this.config.title),this.renderMessages();else{this.widget.classList.add("pw-inbox-widget--empty");var e=this.config,t=e.emptyInboxTitle,n=e.emptyInboxText,r=e.emptyInboxIconUrl;this.widget.innerHTML=i.widgetTemplateEmpty(r,t,n)}},e.prototype.renderMessages=function(){var e=this;this.list=this.widget.querySelector(".pw-inbox_list")||document.createElement("ul"),this.messages.forEach(function(t){var n=document.createElement("li");n.className="pw-inbox_item",n.classList.toggle("pw-new",!t.isRead),n.classList.toggle("pw-unread",!t.isActionPerformed),n.setAttribute("data-pw-inbox-message-id",t.code),n.innerHTML=i.messageTemplate(t),e.list.appendChild(n),e.messagesElements[t.code]=n})},e.prototype.updateCounter=function(e){this.count=e,this.trigger.setAttribute("data-pw-count",""+this.count),this.trigger.classList.toggle("pw-empty",0===this.count)},e.prototype.updateInboxMessages=function(e){this.messages=e,this.renderWidgetInner()},e.prototype.openWidget=function(){this.isOpened=!0,this.widget.classList.add("pw-open"),document.addEventListener("click",this.onWidgetClickHandler),window.addEventListener("scroll",this.onWindowScrollHandler),window.addEventListener("resize",this.onWindowScrollHandler),this.markVisibleItemsAsRead(),this.messages.length>0&&this.list.addEventListener("scroll",this.markVisibleItemsAsRead),this.positionWidget()},e.prototype.closeWidget=function(){this.isOpened=!1,document.removeEventListener("click",this.onWidgetClickHandler),document.removeEventListener("click",this.onWindowScrollHandler),window.removeEventListener("resize",this.onWindowScrollHandler),this.updateReadStatus(),this.messages.length>0&&this.list.removeEventListener("scroll",this.markVisibleItemsAsRead),this.widget.classList.remove("pw-open","pw-top","pw-bottom","pw-right","pw-left"),this.widget.removeAttribute("style")},e.prototype.positionWidget=function(){this.isOpened&&(this.widgetParent===document.body?this.defaultPlaceWidget():this.customPlaceWidget())},e.prototype.customPlaceWidget=function(){var e=this.config.position;this.widgetParent.style.position="relative",this.widget.classList.add("pw-inbox-widget--inset"),this.widget.classList.add("pw-"+e)},e.prototype.defaultPlaceWidget=function(){var e=this.pw.inboxWidgetConfig.position?this.config.position:this.getDefaultPosition(),t=this.widget.getBoundingClientRect();if(document.documentElement){var n=Math.max(document.documentElement.clientWidth,window.innerWidth||0),r=Math.max(document.documentElement.clientHeight,window.innerHeight||0);switch(t.width+2*this.defaultMargin>n&&(this.widget.style.width=n-2*this.defaultMargin+"px"),t.height+24>r&&(this.widget.style.height=r-2*this.defaultMargin+"px"),e){case"top":this.alignWidgetTop();break;case"right":this.alignWidgetRight();break;case"left":this.alignWidgetLeft();break;case"bottom":this.alignWidgetBottom()}}},e.prototype.alignWidgetTop=function(){var e=this.trigger.getBoundingClientRect(),t=this.widget.getBoundingClientRect();if(document.documentElement){var n=Math.max(document.documentElement.clientWidth,window.innerWidth||0),r=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-top");var i=pageXOffset+e.left+Math.floor(e.width/2)-Math.floor(t.width/2),o=i<pageXOffset,s=i+t.width>pageXOffset+n;o&&(i=pageXOffset+this.defaultMargin),s&&(i=pageXOffset+n-t.width-this.defaultMargin);var a=pageYOffset+e.top-t.height;this.alignWidgetElement(i,a),r.style.left=e.left+Math.floor(e.width/2)-i+"px";var u=this.widget.getBoundingClientRect().top;if(0>u){var c=this.widget.getBoundingClientRect().height+u-this.defaultMargin,l=this.widget.getBoundingClientRect().top-u+this.defaultMargin;this.widget.style.height=c+"px",this.widget.style.top=l+"px"}}},e.prototype.alignWidgetRight=function(){var e=this.trigger.getBoundingClientRect(),t=this.widget.getBoundingClientRect();if(document.documentElement){var n=Math.max(document.documentElement.clientWidth,window.innerWidth||0),r=Math.max(document.documentElement.clientHeight,window.innerHeight||0),i=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-right");var o=pageYOffset+e.top+Math.floor(e.height/2)-Math.floor(t.height/2),s=o<pageYOffset,a=pageYOffset+r<o+t.height;s&&(o=pageYOffset+this.defaultMargin),a&&(o=pageYOffset+r-t.height-this.defaultMargin);var u=pageXOffset+e.left+e.width;this.alignWidgetElement(u,o),i.style.top=e.top+Math.floor(e.height/2)-o+"px";var c=n-this.widget.getBoundingClientRect().right;if(this.defaultMargin>c){var l=this.widget.getBoundingClientRect().width+c-this.defaultMargin;this.widget.style.width=l+"px"}}},e.prototype.alignWidgetLeft=function(){var e=this.trigger.getBoundingClientRect(),t=this.widget.getBoundingClientRect();if(document.documentElement){var n=Math.max(document.documentElement.clientHeight,window.innerHeight||0),r=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-left");var i=pageYOffset+e.top+Math.floor(e.height/2)-Math.floor(t.height/2),o=i<pageYOffset,s=pageYOffset+n<i+t.height;o&&(i=pageYOffset+this.defaultMargin),s&&(i=pageYOffset+n-t.height-this.defaultMargin);var a=pageXOffset+e.left-t.width;this.alignWidgetElement(a,i),r.style.top=e.top+Math.floor(e.height/2)-i+"px";var u=this.widget.getBoundingClientRect().left;if(0>u){var c=this.widget.getBoundingClientRect().width+u-this.defaultMargin,l=this.widget.getBoundingClientRect().left-u;this.widget.style.width=c+"px",this.widget.style.left=l+"px"}}},e.prototype.alignWidgetBottom=function(){var e=this.trigger.getBoundingClientRect(),t=this.widget.getBoundingClientRect();if(document.documentElement){var n=Math.max(document.documentElement.clientWidth,window.innerWidth||0),r=Math.max(document.documentElement.clientHeight,window.innerHeight||0),i=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-bottom");var o=pageXOffset+e.left+Math.floor(e.width/2)-Math.floor(t.width/2),s=o<pageXOffset,a=o+t.width>pageXOffset+n;s&&(o=pageXOffset+this.defaultMargin),a&&(o=pageXOffset+n-t.width-12);var u=pageYOffset+e.top+e.height;this.alignWidgetElement(o,u),i.style.left=e.left+Math.floor(e.width/2)-o+"px";var c=r-this.widget.getBoundingClientRect().bottom;if(this.defaultMargin>c){var l=this.widget.getBoundingClientRect().height+c-this.defaultMargin;this.widget.style.height=l+"px"}}},e.prototype.alignWidgetElement=function(e,t){this.widget.style.left=e+"px",this.widget.style.top=t+"px"},e.prototype.getDefaultPosition=function(){var e=this.trigger.getBoundingClientRect(),t=e.left,n=e.top,r=e.width,i=e.height;if(!document.documentElement)return"";var o={right:t,bottom:n,left:Math.max(document.documentElement.clientWidth,window.innerWidth||0)-(t+r),top:Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(n+i)},s=Math.min(t,n,o.left,o.top),a="bottom";return Object.keys(o).forEach(function(e){o[e]===s&&(a=e)}),a},e.prototype.addListeners=function(){var e=this;this.trigger.addEventListener("click",this.onTriggerClickHandler),this.pw.push(["onPutNewMessageToInboxStore",function(){e.updateInbox()}]),this.pw.push(["onUpdateInboxMessages",function(){e.updateInbox()}])},e.prototype.markVisibleItemsAsRead=function(){var e=this;if(0!==this.messages.length){var t=this.list.clientHeight+this.list.scrollTop-50;Object.keys(this.messagesElements).forEach(function(n){if(e.messagesElements[n]&&t>=e.messagesElements[n].offsetTop){var r=e.messages.find(function(e){return e.code===n});!r||r.isRead||e.readItems.indexOf(n)+1||e.readItems.push(n)}})}},e.prototype.updateReadStatus=function(){this.pw.pwinbox.readMessagesWithCodes(this.readItems).then(this.updateInbox)},e.prototype.updateInbox=function(){var e=this;this.pw.pwinbox.loadMessages().then(function(t){e.updateInboxMessages(t)}),this.pw.pwinbox.unreadMessagesCount().then(function(t){e.updateCounter(t)})},e.prototype.performMessageAction=function(e){var t=this;this.pw.pwinbox.performActionForMessageWithCode(e).then(function(){t.updateInbox()})},e.prototype.removeMessages=function(e){var t=this;e.forEach(function(e){t.readItems=t.readItems.slice(t.readItems.indexOf(e),1)}),this.pw.pwinbox.deleteMessagesWithCodes(e).then(function(){t.updateInbox()})},e.prototype.onTriggerClickHandler=function(e){e.stopPropagation(),e.target&&this.toggle()},e.prototype.onWidgetClickHandler=function(e){if(e.target){var t=e.target.closest(".pw-inbox_item");if(t){var n=t.getAttribute("data-pw-inbox-message-id");n&&(e.target.closest(".pw-inbox_item-remove")?this.removeMessages([n]):this.performMessageAction(n))}else this.toggle()}},e.prototype.onWindowScrollHandler=function(){this.isFixed&&this.isOpened?this.toggle():this.positionWidget()},e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.widgetTemplate=function(e){return'\n<div class="pw-inbox__arrow"></div>\n<div class="pw-inbox_inner">\n    <div class="pw-inbox_title">\n      '+e+'\n    </div>\n    <ul class="pw-inbox_list">\n    \n    </ul>\n</div>'},t.widgetTemplateEmpty=function(e,t,n){return'\n<div class="pw-inbox__arrow"></div>\n<div class="pw-inbox_list--empty">\n    <div class="pw-inbox_list-icon">\n      <img src="'+e+'" alt="'+t+'">\n    </div>\n    <div class="pw-inbox_list-title">\n      '+t+'\n    </div>\n    <div class="ipw-inbox_list-body">\n      '+n+"\n    </div>\n</div>"},t.messageTemplate=function(e){var t=e.imageUrl,n=e.title,i=e.message,o=e.sendDate;return'\n<div class="pw-inbox_item-inner">\n  <div class="pw-inbox_icon">\n    <img src="'+t+'" alt="'+(n||i)+'" class="pw-inbox_message-image">\n  </div>\n  <div class="pw-inbox_content">\n    '+(n?'<div class="pw-inbox_item-title">\n      '+n+"\n    </div>":null)+'\n    <div class="pw-inbox_item-body">\n      '+i+'\n    </div>\n    <div class="pw-inbox_item-time">\n      '+r.getMessageTime(o)+'\n    </div>\n  </div>\n</div>\n<span class="pw-inbox_item-remove"></span>'}},function(e,t,n){var r=n(6);e.exports="string"==typeof r?r:""+r},function(e,t,n){(e.exports=n(7)(void 0)).push([e.i,".pw-inbox-trigger {\n  position: relative;\n  cursor: pointer;\n}\n\n.pw-inbox-trigger:after {\n  content: attr(data-pw-count);\n  display: block;\n  position: absolute;\n  right: 0;\n  top: 0;\n  background: var(--badgeBgColor);\n  -webkit-border-radius: 8px;\n          border-radius: 8px;\n  color: var(--badgeTextColor);\n  font-size: 10px;\n  font-weight: normal;\n  line-height: 16px;\n  width: 16px;\n  padding: 0 2px;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  text-align: center;\n}\n\n.pw-inbox-trigger.pw-empty:after {\n  display: none;\n}\n\n.pw-inbox-widget * {\n  position: static;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  font-size: 1em;\n  outline: none;\n  font-family: var(--fontFamily);\n}\n.pw-inbox-widget {\n  font-size: 14px;\n  position: absolute;\n  top: 0;\n  left: -1000px;\n  background: var(--bgColor);\n  border: solid 1px var(--borderColor);\n  -webkit-border-radius: var(--borderRadius);\n          border-radius: var(--borderRadius);\n  width: var(--widgetWidth);\n  -webkit-box-shadow: 0 1px 4px 0 rgba(0,0,0,.25);\n          box-shadow: 0 1px 4px 0 rgba(0,0,0,.25);\n  z-index: var(--zIndex);\n  opacity: 0;\n  -webkit-transition: opacity .6s ease;\n  -o-transition: opacity .6s ease;\n  transition: opacity .6s ease;\n  -webkit-transition-delay: 100ms;\n       -o-transition-delay: 100ms;\n          transition-delay: 100ms;\n}\n.pw-inbox-widget.pw-open {\n  opacity: 1;\n  -webkit-transition-delay: 0ms;\n       -o-transition-delay: 0ms;\n          transition-delay: 0ms;\n}\n.pw-inbox-widget.pw-inbox-widget--inset {\n  top: auto;\n  left: auto;\n  display: none;\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-open {\n  display: block;\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-bottom {\n  top: 100%;\n  left: 50%;\n  -webkit-transform: translateX(-50%);\n      -ms-transform: translateX(-50%);\n          transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-top {\n  bottom: 100%;\n  left: 50%;\n  -webkit-transform: translateX(-50%);\n      -ms-transform: translateX(-50%);\n          transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-right {\n  left: 100%;\n  top: 50%;\n  -webkit-transform: translateY(-50%);\n      -ms-transform: translateY(-50%);\n          transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-left {\n  right: 100%;\n  top: 50%;\n  -webkit-transform: translateY(-50%);\n      -ms-transform: translateY(-50%);\n          transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--empty {\n  max-height: none;\n}\n.pw-inbox-widget .pw-inbox__arrow {\n  display: block;\n  width: 0;\n  height: 0;\n  border-width: 10px;\n  border-style: solid;\n  border-color: transparent;\n  position: absolute;\n}\n.pw-inbox-widget .pw-inbox__arrow:before {\n  content: \"\";\n  display: block;\n  width: 0;\n  height: 0;\n  border-width: 10px;\n  border-style: solid;\n  border-color: transparent;\n  position: absolute;\n}\n.pw-inbox-widget.pw-top {\n  margin-top: -12px;\n}\n.pw-inbox-widget.pw-top .pw-inbox__arrow {\n  border-top-color: var(--arrowBorderColor);\n  bottom: -21px;\n  left: 50%;\n  -webkit-transform: translateX(-50%);\n      -ms-transform: translateX(-50%);\n          transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-top .pw-inbox__arrow:before {\n  border-top-color: var(--bgColor);\n  top: -11px;\n  left: -10px;\n}\n.pw-inbox-widget.pw-bottom {\n  margin-top: 12px;\n}\n.pw-inbox-widget.pw-bottom .pw-inbox__arrow {\n  border-bottom-color: var(--arrowBorderColor);\n  top: -21px;\n  left: 50%;\n  -webkit-transform: translateX(-50%);\n      -ms-transform: translateX(-50%);\n          transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-bottom .pw-inbox__arrow:before {\n  border-bottom-color: var(--bgColor);\n  bottom: -11px;\n  left: -10px;\n}\n.pw-inbox-widget.pw-left {\n  margin-left: -12px;\n}\n.pw-inbox-widget.pw-left .pw-inbox__arrow {\n  border-left-color: var(--arrowBorderColor);\n  right: -21px;\n  top: 50%;\n  -webkit-transform: translateY(-50%);\n      -ms-transform: translateY(-50%);\n          transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-left .pw-inbox__arrow:before {\n  border-left-color: var(--bgColor);\n  left: -11px;\n  top: -10px;\n}\n.pw-inbox-widget.pw-right {\n  margin-left: 12px;\n}\n.pw-inbox-widget.pw-right .pw-inbox__arrow {\n  border-right-color: var(--arrowBorderColor);\n  left: -21px;\n  top: 50%;\n  -webkit-transform: translateY(-50%);\n      -ms-transform: translateY(-50%);\n          transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-right .pw-inbox__arrow:before {\n  border-right-color: var(--bgColor);\n  right: -11px;\n  top: -10px;\n}\n.pw-inbox_inner {\n  overflow: hidden;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-orient: vertical;\n  -webkit-box-direction: normal;\n  -webkit-flex-direction: column;\n      -ms-flex-direction: column;\n          flex-direction: column;\n  height: 100%;\n}\n.pw-inbox_title {\n  color: var(--textColor);\n  margin: 0;\n  padding: 28px 32px 12px;\n  font-size: 24px;\n  font-weight: 500;\n  line-height: 1.1;\n  text-align: left;\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 66px;\n      -ms-flex: 0 0 66px;\n          flex: 0 0 66px;\n}\n.pw-inbox_list {\n  overflow-x: hidden;\n  overflow-y: auto;\n  min-width: 200px;\n  max-height: 300px;\n  padding: 0;\n  margin: 0;\n  list-style: none;\n  position: relative;\n  -webkit-box-flex: 1;\n  -webkit-flex: 1 1 auto;\n      -ms-flex: 1 1 auto;\n          flex: 1 1 auto;\n}\n\n.pw-inbox_item {\n  position: relative;\n  padding: 8px 32px;\n  margin: 0;\n  text-align: left;\n}\n.pw-inbox_item-inner {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  cursor: pointer;\n}\n.pw-inbox_icon {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 40px;\n      -ms-flex: 0 0 40px;\n          flex: 0 0 40px;\n}\n.pw-inbox_message-image {\n  width: 28px;\n}\n.pw-inbox_content {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 1 100%;\n      -ms-flex: 0 1 100%;\n          flex: 0 1 100%;\n}\n.pw-inbox_item-title {\n  color: var(--messageTitleColor);\n  font-size: 14px;\n  line-height: 20px;\n  margin-bottom: 4px;\n}\n.pw-inbox_item-body {\n  color: var(--textColor);\n  font-size: 14px;\n  line-height: 20px;\n  margin-bottom: 4px;\n}\n.pw-inbox_item-time {\n  color: var(--timeTextColor);\n  font-size: 12px;\n  line-height: 17px;\n}\n.pw-inbox_item-remove {\n  position: absolute;\n  z-index: 2;\n  top: 8px;\n  right: 8px;\n  display: none;\n  width: 10px;\n  height: 10px;\n  background: transparent url('https://cdn.pushwoosh.com/webpush/img/iconClose.svg') 50% no-repeat;\n  cursor: pointer;\n}\n.pw-inbox_item:hover .pw-inbox_item-remove {\n  display: block;\n}\n\n.pw-inbox_item.pw-new .pw-inbox_item-title {\n  color: var(--textColor);\n  font-weight: 700;\n}\n\n.pw-inbox_item.pw-new .pw-inbox_item-body {\n  font-weight: 700;\n}\n\n.pw-inbox_list--empty {\n  padding: 50px 16px;\n  text-align: center;\n  max-height: 100%;\n  overflow: auto;\n}\n\n.pw-inbox_list--empty .pw-inbox_list-icon {\n  text-align: center;\n  margin-bottom: 30px;\n}\n.pw-inbox_list--empty .pw-inbox_list-icon img {\n  max-width: 100%;\n}\n\n.pw-inbox_list--empty .pw-inbox_list-title {\n  font-size: 28px;\n  line-height: 36px;\n  color: var(--emptyInboxTitleColor);\n  margin-bottom: 20px;\n}\n\n.pw-inbox_list--empty .ipw-inbox_list-body {\n  font-size: 14px;\n  line-height: 18px;\n  color: var(--emptyInboxTextColor);\n}\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i="/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */",o=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(o).concat([i]).join("\n")}return""+n}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;this.length>i;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;e.length>i;i++){var s=e[i];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}}])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(42);document.addEventListener("pushwoosh.initialized",function(e){if(e.detail.pw.subscribePopupConfig&&e.detail.pw.subscribePopupConfig.enable){var t=new r.PWSubscribePopup(e.detail.pw);t.initPopup().then(function(){e.detail.pw.subscribePopup=t})}})},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},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=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG={text:"Donâ€™t miss out on our news and updates! Enable push notifications",askLaterButtonText:"Not now",confirmSubscriptionButtonText:"Subscribe",delay:60,retryOffset:604800,overlay:!1,position:"top",bgColor:"#fff",borderColor:"transparent",boxShadow:"0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)",textColor:"#000",textSize:"inherit",fontFamily:"inherit",subscribeBtnBgColor:"#4285f4",subscribeBtnTextColor:"#fff",askLaterBtnBgColor:"transparent",askLaterBtnTextColor:"#000"},t.COLOR_TEST_REGEXP=/^(#([\da-f]{3}){1,2}$|(rgb|hsl)a\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)$|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?){2}\)$)/,t.PERMISSION_DENIED="denied",t.PERMISSION_GRANTED="granted",t.PERMISSION_PROMPT="default",t.CONFIG_STYLES=[{name:"bgColor",type:"color"},{name:"borderColor",type:"color"},{name:"boxShadow",type:"string"},{name:"textColor",type:"color"},{name:"textSize",type:"string"},{name:"fontFamily",type:"string"},{name:"subscribeBtnBgColor",type:"color"},{name:"subscribeBtnTextColor",type:"color"},{name:"askLaterBtnBgColor",type:"color"},{name:"askLaterBtnTextColor",type:"color"}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.PWSubscribePopup=r.default},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){s.label=o[1];break}if(6===o[0]&&i[1]>s.label){s.label=i[1],i=o;break}if(i&&i[2]>s.label){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),a=n(3),u=n(0),c=n(4),l=function(){function e(e){this.pw=e,this.config=r({},s.DEFAULT_CONFIG,this.pw.subscribePopupConfig),this.onAskLaterClick=this.onAskLaterClick.bind(this),this.onSubscribeClick=this.onSubscribeClick.bind(this)}return e.prototype.initPopup=function(){return i(this,void 0,void 0,function(){var e,t,n,r,i=this;return o(this,function(o){switch(o.label){case 0:return[4,this.pw.isSubscribed()];case 1:return e=o.sent(),t=this.pw.isDeviceUnregistered(),e||t?[2]:[4,this.pw.driver.getPermission()];case 2:return(n=o.sent())===u.PERMISSION_GRANTED||n===u.PERMISSION_DENIED?[2]:(this.renderPopup(),this.appendStyles(),[4,this.pw.paramsModule.subscriptionPopupLastOpen]);case 3:return r=o.sent(),(new Date).getTime()>r+1e3*this.config.retryOffset&&setTimeout(function(){i.toggle(!0)},1e3*this.config.delay),[2]}})})},e.prototype.toggle=function(e){var t="boolean"==typeof e?e:!this.isShown;if(this.popup.classList.toggle("pw-show",t),this.isShown=t,!this.isShown){var n=(new Date).getTime();this.pw.paramsModule.setSubscriptionPopupLastOpen(n)}},e.prototype.renderPopup=function(){this.popup=document.createElement("div"),this.popup.id="pwSubscribePopup";var e=this.config,t=e.text,n=e.askLaterButtonText,r=e.confirmSubscriptionButtonText,i=e.iconUrl,o=e.position,s=e.overlay;this.popup.className="pw-subscribe-popup pw-position-"+o,this.popup.classList.toggle("pw-subscribe-popup__overlay",s),this.popup.classList.toggle("pw-subscribe-popup__compact",!s),this.popup.innerHTML=a.innerTemplate({text:t,askLaterButtonText:n,confirmSubscriptionButtonText:r,iconUrl:i}),document.body.appendChild(this.popup),this.addListeners()},e.prototype.appendStyles=function(){var e=n(5),t=document.createElement("style");t.innerHTML=this.configureStyle(e),document.body.appendChild(t)},e.prototype.getStyleFormatter=function(e){switch(e.type){case"size":return(this.config[e.name]||0)+"px";case"number":return""+parseFloat(""+this.config[e.name]);case"string":return""+this.config[e.name];case"color":return c.getValidColor(""+this.config[e.name]);default:return"none"}},e.prototype.configureStyle=function(e){var t=this,n=""+e;return s.CONFIG_STYLES.forEach(function(e){var r=RegExp("var\\(--"+e.name+"\\)","ig"),i=t.getStyleFormatter(e);n=n.replace(r,i)}),n},e.prototype.addListeners=function(){var e=this.popup.querySelector('button[name="pwAskLater"]')||document.createElement("button"),t=this.popup.querySelector('button[name="pwSubscribe"]')||document.createElement("button");e.addEventListener("click",this.onAskLaterClick),t.addEventListener("click",this.onSubscribeClick)},e.prototype.onAskLaterClick=function(){this.toggle(!1)},e.prototype.onSubscribeClick=function(){this.pw.subscribe(),this.toggle(!1)},e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.innerTemplate=function(e){var t=e.iconUrl,n=e.text,r=e.askLaterButtonText,i=e.confirmSubscriptionButtonText;return'<div class="pw-subscription-popup-inner">\n    <div class="pw-subscription-popup-content">\n      '+(t?'<div class="pw-subscription-popup-icon">\n        <img src="'+t+'">\n      </div>':"")+'\n      <div class="pw-subscription-popup-text">\n        '+n+'\n      </div>\n    </div>\n    <div class="pw-subscription-popup-controls">\n      <button name="pwSubscribe" class="pw-subscribe-popup-button pw-subscribe-popup-button-active">'+i+'</button>\n      <button name="pwAskLater" class="pw-subscribe-popup-button">'+r+"</button>\n    </div>\n  </div>"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.getValidColor=function(e){return"transparent"===e?e:r.COLOR_TEST_REGEXP.test(e)?e:"#333"},t.getGlobal=function(){return Function("return this")()}},function(e,t,n){var r=n(6);e.exports="string"==typeof r?r:""+r},function(e,t,n){(e.exports=n(7)(void 0)).push([e.i,".pw-subscribe-popup__compact {\n  position: fixed;\n  left: 50%;\n  -webkit-transform: translateX(-50%);\n      -ms-transform: translateX(-50%);\n          transform: translateX(-50%);\n  -webkit-box-pack: center;\n  -webkit-justify-content: center;\n      -ms-flex-pack: center;\n          justify-content: center;\n  z-index: 1000000;\n  display: none;\n}\n\n.pw-subscribe-popup__compact.pw-position-top {\n  top: 0;\n}\n\n.pw-subscribe-popup__compact.pw-position-bottom {\n  bottom: 0;\n}\n\n.pw-subscribe-popup__compact.pw-position-center {\n  top: 50%;\n  -webkit-transform: translate(-50% -50%);\n      -ms-transform: translate(-50% -50%);\n          transform: translate(-50% -50%);\n}\n\n.pw-subscribe-popup__overlay {\n  position: fixed;\n  left: 0;\n  right: 0;\n  -webkit-transform: none;\n      -ms-transform: none;\n          transform: none;\n  height: 100%;\n  -webkit-box-pack: center;\n  -webkit-justify-content: center;\n      -ms-flex-pack: center;\n          justify-content: center;\n  background: rgba(0,0,0,.4);\n  z-index: 1000000;\n  display: none;\n  top: 0;\n}\n\n.pw-subscribe-popup__overlay.pw-position-top {\n  -webkit-box-align: start;\n  -webkit-align-items: flex-start;\n      -ms-flex-align: start;\n          align-items: flex-start;\n}\n\n.pw-subscribe-popup__overlay.pw-position-bottom {\n  -webkit-box-align: end;\n  -webkit-align-items: flex-end;\n      -ms-flex-align: end;\n          align-items: flex-end;\n}\n\n.pw-subscribe-popup__overlay.pw-position-center {\n  -webkit-box-align: center;\n  -webkit-align-items: center;\n      -ms-flex-align: center;\n          align-items: center;\n}\n\n.pw-subscribe-popup.pw-show {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n}\n\n.pw-subscription-popup-inner {\n  max-width: 400px;\n  font-size: var(--textSize);\n  color: var(--textColor);\n  font-family: var(--textColor);\n  border-style: solid;\n  border-width: 1px;\n  border-color: var(--borderColor);\n  background: var(--bgColor);\n  -webkit-box-shadow: var(--boxShadow);\n          box-shadow: var(--boxShadow);\n}\n\n.pw-subscription-popup-content {\n  padding: 16px 16px 4px;\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-pack: stretch;\n  -webkit-justify-content: stretch;\n      -ms-flex-pack: stretch;\n          justify-content: stretch;\n}\n\n.pw-subscription-popup-icon {\n  -webkit-box-flex: 0;\n  -webkit-flex: 0 0 50px;\n      -ms-flex: 0 0 50px;\n          flex: 0 0 50px;\n  margin-right: 12px;\n  padding-top: 4px;\n}\n\n.pw-subscription-popup-icon img {\n  max-width: 60px;\n  max-height: 60px;\n}\n\n.pw-subscription-popup-text {\n  -webkit-box-flex: 1;\n  -webkit-flex: 1 1 300px;\n      -ms-flex: 1 1 300px;\n          flex: 1 1 300px;\n}\n\n.pw-subscription-popup-controls {\n  display: -webkit-box;\n  display: -webkit-flex;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-flex-wrap: wrap;\n      -ms-flex-wrap: wrap;\n          flex-wrap: wrap;\n  -webkit-box-pack: center;\n  -webkit-justify-content: center;\n      -ms-flex-pack: center;\n          justify-content: center;\n  padding: 8px 16px 16px;\n}\n\nbutton.pw-subscribe-popup-button {\n  border: solid 1px transparent;\n  -webkit-border-radius: 2px;\n          border-radius: 2px;\n  display: inline-block;\n  height: 36px;\n  line-height: 36px;\n  padding: 0 16px;\n  text-transform: uppercase;\n  vertical-align: middle;\n  -webkit-tap-highlight-color: transparent;\n  font-size: 14px;\n  outline: 0;\n  text-decoration: none;\n  color: var(--askLaterBtnTextColor);\n  text-align: center;\n  letter-spacing: .5px;\n  cursor: pointer;\n  background: var(--askLaterBtnBgColor);\n  margin: 4px 8px;\n}\nbutton.pw-subscribe-popup-button:hover {\n  background: rgba(0,0,0,.04);\n}\nbutton.pw-subscribe-popup-button:active {\n  background: rgba(0,0,0,.12);\n}\n\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active {\n  color: var(--subscribeBtnTextColor);\n  background: var(--subscribeBtnBgColor);\n  -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n  0 3px 1px -2px rgba(0,0,0,0.12),\n  0 1px 5px 0 rgba(0,0,0,0.2);\n          box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n  0 3px 1px -2px rgba(0,0,0,0.12),\n  0 1px 5px 0 rgba(0,0,0,0.2);\n}\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active:hover {\n  -webkit-box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),\n  0 1px 7px 0 rgba(0,0,0,0.12),\n  0 3px 1px -1px rgba(0,0,0,0.2);\n          box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),\n  0 1px 7px 0 rgba(0,0,0,0.12),\n  0 3px 1px -1px rgba(0,0,0,0.2);\n}\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active:active {\n  -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n  0 3px 1px -2px rgba(0,0,0,0.12),\n  0 1px 5px 0 rgba(0,0,0,0.2);\n          box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n  0 3px 1px -2px rgba(0,0,0,0.12),\n  0 1px 5px 0 rgba(0,0,0,0.2);\n}\n\n@media screen and (max-width: 540px) {\n  .pw-subscribe-popup__compact,\n  .pw-subscribe-popup__compact.pw-position-top,\n  .pw-subscribe-popup__compact.pw-position-center,\n  .pw-subscribe-popup__compact.pw-position-bottom {\n    top: auto;\n    bottom: -110%;\n    left: 0;\n    right: 0;\n    -webkit-transform: none;\n        -ms-transform: none;\n            transform: none;\n    display: -webkit-box;\n    display: -webkit-flex;\n    display: -ms-flexbox;\n    display: flex;\n    -webkit-transition: bottom .4s ease-out;\n    -o-transition: bottom .4s ease-out;\n    transition: bottom .4s ease-out;\n  }\n\n  .pw-subscribe-popup.pw-subscribe-popup__overlay {\n    height: 100%;\n    -webkit-box-align: end;\n    -webkit-align-items: flex-end;\n        -ms-flex-align: end;\n            align-items: flex-end;\n  }\n\n  .pw-subscribe-popup__compact.pw-show {\n    bottom: 0;\n  }\n\n  .pw-subscribe-popup__overlay .pw-subscription-popup-inner {\n    -webkit-box-align: end;\n    -webkit-align-items: flex-end;\n        -ms-flex-align: end;\n            align-items: flex-end;\n    -webkit-box-pack: stretch;\n    -webkit-justify-content: stretch;\n        -ms-flex-pack: stretch;\n            justify-content: stretch;\n  }\n\n  .pw-subscription-popup-inner {\n    max-width: 100%;\n    width: 100%;\n  }\n}\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i="/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */",o=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(o).concat([i]).join("\n")}return""+n}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;this.length>i;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;e.length>i;i++){var s=e[i];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}}])}]);
  