/*! UA-Web-Push: a01e5f2:1740058277787 */!function(){"use strict";var t={946:function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},33:function(t){function e(t,e){for(var n=0;n0?this._waitingResolvers.shift()():this._acquired=!1}}]),t}();e.Z=a},314:function(t,e,n){var r,i,o;t=n.nmd(t);var a,s=n(424)(n(924));a=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==(0,s.default)(t)&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=90)}({17:function(t,e,n){e.__esModule=!0,e.default=void 0;var r=n(18),i=function(){function t(){}return t.getFirstMatch=function(t,e){var n=e.match(t);return n&&n.length>0&&n[1]||""},t.getSecondMatch=function(t,e){var n=e.match(t);return n&&n.length>1&&n[2]||""},t.matchAndReturnConst=function(t,e,n){if(t.test(e))return n},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,n,r){void 0===r&&(r=!1);var i=t.getVersionPrecision(e),o=t.getVersionPrecision(n),a=Math.max(i,o),s=0,u=t.map([e,n],(function(e){var n=a-t.getVersionPrecision(e),r=e+new Array(n+1).join(".0");return t.map(r.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(r&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(u[0][a]>u[1][a])return 1;if(u[0][a]===u[1][a]){if(a===s)return 0;a-=1}else if(u[0][a]1?i-1:0),a=1;a0){var a=Object.keys(n),c=u.default.find(a,(function(t){return e.isOS(t)}));if(c){var l=this.satisfies(n[c]);if(void 0!==l)return l}var f=u.default.find(a,(function(t){return e.isPlatform(t)}));if(f){var p=this.satisfies(n[f]);if(void 0!==p)return p}}if(o>0){var d=Object.keys(i),h=u.default.find(d,(function(t){return e.isBrowser(t,!0)}));if(void 0!==h)return this.compareVersion(i[h])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var n=this.getBrowserName().toLowerCase(),r=t.toLowerCase(),i=u.default.getBrowserTypeByAlias(r);return e&&i&&(r=i.toLowerCase()),r===n},e.compareVersion=function(t){var e=[0],n=t,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===t[0]||"<"===t[0]?(n=t.substr(1),"="===t[1]?(r=!0,n=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?n=t.substr(1):"~"===t[0]&&(r=!0,n=t.substr(1)),e.indexOf(u.default.compareVersions(i,n,r))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t){return this.isBrowser(t)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=l,t.exports=e.default},92:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},n=i.default.getFirstMatch(o,t)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){var e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe:function(t){var e={name:"Android Browser"},n=i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},n=i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},n=i.default.getFirstMatch(o,t);return n&&(e.version=n),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(e,t),version:i.default.getSecondMatch(e,t)}}}];e.default=a,t.exports=e.default},93:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:[/Roku\/DVP/],describe:function(t){var e=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:o.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=i.default.getWindowsVersionName(e);return{name:o.OS_MAP.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?) Version\//],describe:function(t){var e=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return{name:o.OS_MAP.iOS,version:e}}},{test:[/macintosh/i],describe:function(t){var e=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(e),r={name:o.OS_MAP.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe:function(t){var e=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=i.default.getAndroidVersionName(e),r={name:o.OS_MAP.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:o.OS_MAP.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:o.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:o.OS_MAP.PlayStation4,version:e}}}];e.default=a,t.exports=e.default},94:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=i.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?) Version\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe:function(t){var e=i.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];e.default=a,t.exports=e.default},95:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:o.ENGINE_MAP.Blink};var e=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:o.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){var e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe:function(t){var e={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];e.default=a,t.exports=e.default}})},"object"==(0,s.default)(e)&&"object"==(0,s.default)(t)?t.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(e,i):r)||(t.exports=o))},690:function(t){t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=void 0,i=void 0,o=void 0,a=[];return function(){var u=function(t){return"function"==typeof t?t():t}(e),c=(new Date).getTime(),l=!r||c-r>u;r=c;for(var f=arguments.length,p=Array(f),d=0;d0){for(var t=new Array(arguments.length),e=0;e>>9<<4)+1}function r(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function i(t,e,n,i,o,a){return r((s=r(r(e,t),r(i,a)))<<(u=o)|s>>>32-u,n);var s,u}function o(t,e,n,r,o,a,s){return i(e&n|~e&r,t,e,o,a,s)}function a(t,e,n,r,o,a,s){return i(e&r|n&~r,t,e,o,a,s)}function s(t,e,n,r,o,a,s){return i(e^n^r,t,e,o,a,s)}function u(t,e,n,r,o,a,s){return i(n^(e|~r),t,e,o,a,s)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var i=0;i>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(15&o),16);e.push(a)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[i/8])<>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n};e.default=o},729:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},794:function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};var r=new Uint8Array(16)},637:function(t,e){function n(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function r(t,e){return t<>>32-e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){var e=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var o=unescape(encodeURIComponent(t));t=[];for(var a=0;a>>0;_=w,w=m,m=r(g,30)>>>0,g=b,b=x}i[0]=i[0]+b>>>0,i[1]=i[1]+g>>>0,i[2]=i[2]+m>>>0,i[3]=i[3]+w>>>0,i[4]=i[4]+_>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]};e.default=i},376:function(t,e,n){var r=n(424);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;for(var i=r(n(721)),o=[],a=0;a<256;++a)o.push((a+256).toString(16).substr(1));var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]).toLowerCase();if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n};e.default=s},144:function(t,e,n){var r=n(424);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i,o,a=r(n(794)),s=r(n(376)),u=0,c=0;var l=function(t,e,n){var r=e&&n||0,l=e||new Array(16),f=(t=t||{}).node||i,p=void 0!==t.clockseq?t.clockseq:o;if(null==f||null==p){var d=t.random||(t.rng||a.default)();null==f&&(f=i=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==p&&(p=o=16383&(d[6]<<8|d[7]))}var h=void 0!==t.msecs?t.msecs:Date.now(),v=void 0!==t.nsecs?t.nsecs:c+1,y=h-u+(v-c)/1e4;if(y<0&&void 0===t.clockseq&&(p=p+1&16383),(y<0||h>u)&&void 0===t.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=h,c=v,o=p;var b=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;l[r++]=b>>>24&255,l[r++]=b>>>16&255,l[r++]=b>>>8&255,l[r++]=255&b;var g=h/4294967296*1e4&268435455;l[r++]=g>>>8&255,l[r++]=255&g,l[r++]=g>>>24&15|16,l[r++]=g>>>16&255,l[r++]=p>>>8|128,l[r++]=255&p;for(var m=0;m<6;++m)l[r+m]=f[m];return e||(0,s.default)(l)};e.default=l},501:function(t,e,n){var r=n(424);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(855)),o=r(n(357)),a=(0,i.default)("v3",48,o.default);e.default=a},855:function(t,e,n){var r=n(424);Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0,e.default=function(t,e,n){function r(t,r,a,s){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s=function(t,e){for(var n=0,r=e.length,i=t.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function w(t){var e=Intl.DateTimeFormat().resolvedOptions(),n=e.timeZone,r=m(e.locale.split("-"),2),i=r[0],o=r[1],a=(null==t?void 0:t.language)||i,s=(null==t?void 0:t.country)||o;!s&&navigator.languages&&(s=navigator.languages.reduce((function(t,e){return t||(t=e.includes("-")?e.split("-")[1]:null),t}),null)||"");return{localeCountry:s,localeLanguage:a,timezone:n}}var _=function(){return _=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},I=function(t,e){for(var n=0,r=e.length,i=t.length;nthis._getExpiry(t)},t.prototype.info=function(t){var e=this._makeKey(t),n=this._getValue(e);return n===j?{cachedAt:0,exists:!1,expired:!0}:{cachedAt:this._getCachedAt(n),exists:!0,expired:this._getExpired(n)}},t.prototype.load=function(t,e){var n=this._makeKey(t),r=this._getValue(n);return r===j?j:this._getExpired(r)?(this._storage.removeItem(n),e?r.data:j):r.data},t.prototype.store=function(t,e){var n={cachedAt:this._getNow(),data:e};this._storage.setItem(this._makeKey(t),JSON.stringify(n))},t.prototype.invalidate=function(t){this._storage.removeItem(this._makeKey(t))},t.prototype._makeKey=function(t){return this._prefix+":"+t},t}(),B=function(){function t(t){this._storageManager=t}return t.prototype.get=function(t,e){return A(this,void 0,void 0,(function(){var n,r,i;return T(this,(function(o){switch(o.label){case 0:return n=this._storageManager.info(t),(r=this._storageManager.load(t,!0))===j||n.expired?[4,e(n.exists?n.cachedAt:void 0)]:[2,r];case 1:if((i=o.sent())===N){if(!n.exists||r===j)throw new Error("unable to cache a missed value");return this._storageManager.store(t,r),[2,r]}return this._storageManager.store(t,i),[2,i]}}))}))},t.prototype.invalidate=function(t){this._storageManager.invalidate(t)},t}(),L=function(){function t(t,e){var n=t.keyFn,r=t.indexKey;this._storageManager=e,this._indexKey=r,this._keyFn=n}return t.prototype.values=function(){var t=this,e=[],n=this._storageManager.load(this._indexKey);return n===j?[]:(n.forEach((function(r){var i=t._storageManager.load(r);i===j?t._storageManager.store(t._indexKey,n.filter((function(t){return t!==r}))):e.push(i)})),e)},t.prototype.push=function(t){var e=this._keyFn(t);this._pushToIndex(e),this._storageManager.store(e,t)},t.prototype._pushToIndex=function(t){var e=this._storageManager.load(this._indexKey);if(e!==j){var n=e.filter((function(e){return e!==t}));this._storageManager.store(this._indexKey,I(I([],C(n)),[t]))}else this._storageManager.store(this._indexKey,[t])},t}();function U(t,e){t=""+o.apiUrl+t;var n={Accept:"application/vnd.urbanairship+json; version=3;"};if(o.appKey&&o.token)n["X-UA-Appkey"]=o.appKey,n.Authorization="Bearer "+o.token;else if(o.appKey&&o.secret){var r=self.btoa(o.appKey+":"+o.secret);n.Authorization="Basic "+r}return e.credentials="include",e.body&&(n["Content-type"]="application/json","string"!=typeof e.body&&(e.body=JSON.stringify(e.body))),e.headers=e.headers||{},Object.assign(e.headers,n),u("REQUEST",t,e),self.fetch(t,e)}function D(t){return void 0===t||Array.isArray(t)?t:[t]}var F,q=(F=function(t,e){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},F(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),G=function(t){function e(n){void 0===n&&(n="Predicate was not satisfied.");var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(r,e),r.name=r.constructor.name,r}return q(e,t),e}(TypeError),V=function(t){function e(n,r){void 0===r&&(r="Request Error");var i=t.call(this,r)||this;return i._statusCode=n,Object.setPrototypeOf(i,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,e),i.name=i.constructor.name,i}return q(e,t),Object.defineProperty(e.prototype,"statusCode",{get:function(){return this._statusCode},enumerable:!1,configurable:!0}),e}(Error),K=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},W=function(t,e){for(var n=0,r=e.length,i=t.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},tt=["tags","channel"],et={set:function(t,e){var n;return null===(n=self.localStorage)||void 0===n?void 0:n.setItem(nt(t),e)},get:function(t){var e;return null===(e=self.localStorage)||void 0===e?void 0:e.getItem(nt(t))},setJSON:function(t,e){return this.set(t,JSON.stringify(e))},getJSON:function(t){var e=this.get(t);if(e)return JSON.parse(e)},clear:function(){var t;null===(t=self.localStorage)||void 0===t||t.clear()},remove:function(t){var e;return null===(e=self.localStorage)||void 0===e?void 0:e.removeItem(nt(t))},onStorage:function(t){return function(e){var n,r;try{for(var i=$(tt),a=i.next();!a.done;a=i.next()){var s=a.value,u=o.storagePrefix+":"+s;if(e.key===u){var c={};c[s]=JSON.parse(e.newValue||""),t(c)}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}};function nt(t){return o.storagePrefix+":"+t}function rt(t){return(null!=t?t:new Date).toISOString().split(".")[0]}var it,ot,at=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),st=function(t){function e(n){void 0===n&&(n="The provided name is not valid.");var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(r,e),r.name=r.constructor.name,r}return at(e,t),e}(Error);function ut(t){if("string"==typeof t)return t;if("number"==typeof t)return t.toString(10);if(t instanceof Date)return rt(t);throw new st("invalid attribute value")}!function(t){t.SET="set",t.REMOVE="remove"}(it||(it={})),function(t){t.ADD="add",t.SET="set",t.REMOVE="remove"}(ot||(ot={}));var ct=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},lt=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},pt=function(){function t(t){this._getAudience=t}return t.prototype.set=function(t){return ct(this,void 0,void 0,(function(){return lt(this,(function(e){switch(e.label){case 0:return[4,M()];case 1:return e.sent()?[2,this.send(this.buildSetPayload(t))]:(console.warn("Data collection is disabled. Setting attributes is not allowed."),[2,!1])}}))}))},t.prototype.remove=function(){for(var t=[],e=0;e0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},St=function(t,e){for(var n=0,r=e.length,i=t.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},It=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},jt=function(t){function e(e){var n=t.call(this)||this;return n.storeName=e,n._tagList={},n.tagMap=new Map,n._load(),n}return kt(e,t),e.prototype.has=function(t,e){void 0===e&&(e="device"),console.warn("Tags.has() is deprecated, and will be removed in a future version.");var n=this.tagMap.get(e);return!!n&&n.has(t)},e.prototype.add=function(t,e){var n;return void 0===e&&(e=""),At(this,void 0,void 0,(function(){return Tt(this,(function(r){switch(r.label){case 0:return[4,M()];case 1:return r.sent()?(e=this._validateGroup(e),this.has(t,e)?[2,!0]:(this.tagMap.has(e)?null===(n=this.tagMap.get(e))||void 0===n||n.add(t):this.tagMap.set(e,new Set([t])),[2,this._send(ot.ADD,[t],e)])):(console.warn("Data collection is disabled. Adding tags is not allowed."),[2,!1])}}))}))},e.prototype.remove=function(t,e){var n;return void 0===e&&(e=""),At(this,void 0,void 0,(function(){return Tt(this,(function(r){return e=this._validateGroup(e),this.has(t,e)?(null===(n=this.tagMap.get(e))||void 0===n||n.delete(t),[2,this._send(ot.REMOVE,[t],e)]):[2,!0]}))}))},e.prototype.clear=function(){this.tagMap=new Map,this.set([],"device")},e.prototype.set=function(t,e){return void 0===e&&(e=""),At(this,void 0,void 0,(function(){return Tt(this,(function(n){switch(n.label){case 0:return[4,M()];case 1:return!n.sent()&&t.length?(console.warn("Data collection is disabled. Setting tags is not allowed."),[2,!1]):(e=this._validateGroup(e),this.tagMap.set(e,new Set(t)),[2,this._send(ot.SET,t,e)])}}))}))},Object.defineProperty(e.prototype,"list",{get:function(){var t,e;console.warn("Tags.list is deprecated, and will be removed in a future version.");var n={};try{for(var r=Ct(this.tagMap),i=r.next();!i.done;i=r.next()){var o=It(i.value,2),a=o[0],s=o[1];s.size&&(n[a]=Array.from(s))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},enumerable:!1,configurable:!0}),e.prototype._load=function(t){var e,n;void 0===t&&(t=et.getJSON(this.storeName));var r=new Map;try{if(t)try{for(var i=Ct(Object.keys(t)),o=i.next();!o.done;o=i.next()){var a=o.value;r.set(a,new Set(t[a]))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}catch(t){u("Error loading tags:",t)}return this.tagMap=r,this.tagMap},e.prototype._send=function(t,e,n){return At(this,void 0,void 0,(function(){return Tt(this,(function(r){return this._store(),[2,this._apply(t,e,n)]}))}))},e.prototype.sync=function(t){this._load(t),this._store()},e.prototype._store=function(){var t=this.list;if(t!==this._tagList){et.setJSON("tags",t),this._tagList=t;var e=new CustomEvent("tags",{detail:t});this.dispatchEvent(e)}},e}(e.EventTarget);function Nt(t,e,n){var r=t.storeName,i=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return kt(r,t),r.prototype._apply=function(t,n,r){return e(t,n,r)},r.prototype._validateGroup=function(t){return n(t)},r}(jt);return new i(r)}var Rt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Bt=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Ut=function(t,e){for(var n=0,r=e.length,i=t.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Zt=function(t,e){for(var n=0,r=e.length,i=t.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},he=function(t,e){for(var n=0,r=e.length,i=t.length;n10?(console.error("Airship SDK: Maximum named user changes reached"),[2,!1]):(r=new CustomEvent("channel",{detail:this}),this.dispatchEvent(r),[2,!0]);case 6:return i=o.sent(),console.error("Airship SDK: Error while storing channel",i),[2,!1];case 7:return[2]}}))}))},e.prototype._update=function(t){return void 0===t&&(t=!0),console.warn("Channel._update() is deprecated and will be removed in the future. Please use Channel.update() instead."),this.update(t)},e.prototype.update=function(t){return void 0===t&&(t=!0),fe(this,void 0,void 0,(function(){var e,n;return pe(this,(function(r){switch(r.label){case 0:return e=this.toJSON(),t&&delete e.opt_in,[4,M()];case 1:if(!r.sent())return console.warn("Data collection is disabled. Skipping channel update."),[2,!1];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,U(this.path,{method:"put",body:{channel:e}})];case 3:return r.sent(),[2,!0];case 4:return n=r.sent(),console.error("Airship SDK: Error while updating channel",n),[2,!1];case 5:return[2]}}))}))},e.prototype._applyTags=function(t,e,n){return fe(this,void 0,void 0,(function(){var r,i,a;return pe(this,(function(s){switch(s.label){case 0:(i={audience:{web_channel:this.channel_id}})[t]=((a={})[n]=e,a),r=i,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,U(o.paths.tags,{method:"post",body:r})];case 2:return[2,s.sent().ok];case 3:return s.sent(),[2,!1];case 4:return[2]}}))}))},e.prototype._validateTagGroup=function(t){return t||"device"},e}(e.EventTarget),ye=ve,be=["web","email","sms","open","ios","android","amazon"];var ge=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},me=function(t,e){for(var n=0,r=e.length,i=t.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Be=function(t,e){for(var n=0,r=e.length,i=t.length;nthis._namedUserTtlMs?[2]:[4,this._db.get(Ue)];case 2:return(e=n.sent())&&!t&&this.setNamedUserAssociatedTimestamp(),[2,e]}}))}))},t.prototype.setNamedUserId=function(t){return je(this,void 0,void 0,(function(){return Ne(this,(function(e){switch(e.label){case 0:return[4,this._db.set(Ue,t)];case 1:return e.sent(),[4,this.setNamedUserAssociatedTimestamp()];case 2:return e.sent(),[2]}}))}))},t.prototype.clearNamedUserId=function(){return je(this,void 0,void 0,(function(){return Ne(this,(function(t){switch(t.label){case 0:return[4,this._db.remove(Ue)];case 1:return t.sent(),[4,this.clearNamedUserAssociatedTimestamp()];case 2:return t.sent(),[2]}}))}))},t.prototype.setNamedUserAssociatedTimestamp=function(){return je(this,void 0,void 0,(function(){return Ne(this,(function(t){return this._db.set(De,String(this._getNow())),[2]}))}))},t.prototype.clearNamedUserAssociatedTimestamp=function(){return je(this,void 0,void 0,(function(){return Ne(this,(function(t){return this._db.remove(De),[2]}))}))},t.prototype.getNamedUserAssociatedTimestamp=function(){return je(this,void 0,void 0,(function(){var t,e;return Ne(this,(function(n){switch(n.label){case 0:return[4,this._db.get(De)];case 1:return(t=n.sent())?(e=Number.parseInt(t,10),Number.isNaN(e)?[4,this.clearNamedUserAssociatedTimestamp()]:[3,3]):[2];case 2:return n.sent(),[2];case 3:return[2,e]}}))}))},t.prototype.getPendingTagMutations=function(){return je(this,void 0,void 0,(function(){var t;return Ne(this,(function(e){switch(e.label){case 0:return[4,this._db.get(Fe)];case 1:return[2,null!=(t=e.sent())?t:[]]}}))}))},t.prototype.setPendingTagMutations=function(t){return je(this,void 0,void 0,(function(){return Ne(this,(function(e){switch(e.label){case 0:return[4,this._db.set(Fe,t)];case 1:return e.sent(),[2]}}))}))},t.prototype.appendTagMutations=function(t,e){return je(this,void 0,void 0,(function(){var n;return Ne(this,(function(r){switch(r.label){case 0:return[4,this.getTagMutations(t)];case 1:return n=r.sent(),[4,this._db.set(Ve(t),n.concat.apply(n,Be([],Re(e))))];case 2:return r.sent(),[2]}}))}))},t.prototype.getTagMutations=function(t){return je(this,void 0,void 0,(function(){var e;return Ne(this,(function(n){switch(n.label){case 0:return[4,this._db.get(Ve(t))];case 1:return[2,null!=(e=n.sent())?e:[]]}}))}))},t.prototype.getPendingAttributeMutations=function(){return je(this,void 0,void 0,(function(){var t;return Ne(this,(function(e){switch(e.label){case 0:return[4,this._db.get(qe)];case 1:return[2,null!=(t=e.sent())?t:[]]}}))}))},t.prototype.setPendingAttributeMutations=function(t){return je(this,void 0,void 0,(function(){return Ne(this,(function(e){switch(e.label){case 0:return[4,this._db.set(qe,t)];case 1:return e.sent(),[2]}}))}))},t.prototype.appendAttributeMutations=function(t,e){return je(this,void 0,void 0,(function(){var n;return Ne(this,(function(r){switch(r.label){case 0:return[4,this.getAttributeMutations(t)];case 1:return n=r.sent(),[4,this._db.set(Ke(t),n.concat.apply(n,Be([],Re(e))))];case 2:return r.sent(),[2]}}))}))},t.prototype.getAttributeMutations=function(t){return je(this,void 0,void 0,(function(){var e;return Ne(this,(function(n){switch(n.label){case 0:return[4,this._db.get(Ke(t))];case 1:return[2,null!=(e=n.sent())?e:[]]}}))}))},t.prototype.getPendingSubscriptionListMutations=function(){return je(this,void 0,void 0,(function(){var t;return Ne(this,(function(e){switch(e.label){case 0:return[4,this._db.get(Ge)];case 1:return[2,null!=(t=e.sent())?t:[]]}}))}))},t.prototype.setPendingSubscriptionListMutations=function(t){return je(this,void 0,void 0,(function(){return Ne(this,(function(e){switch(e.label){case 0:return[4,this._db.set(Ge,t)];case 1:return e.sent(),[2]}}))}))},t.prototype.appendSubscriptionListMutations=function(t,e){return je(this,void 0,void 0,(function(){var n;return Ne(this,(function(r){switch(r.label){case 0:return[4,this.getSubscriptionListMutations(t)];case 1:return n=r.sent(),[4,this._db.set(We(t),n.concat.apply(n,Be([],Re(e))))];case 2:return r.sent(),[2]}}))}))},t.prototype.getSubscriptionListMutations=function(t){return je(this,void 0,void 0,(function(){var e;return Ne(this,(function(n){switch(n.label){case 0:return[4,this._db.get(We(t))];case 1:return[2,null!=(e=n.sent())?e:[]]}}))}))},t.prototype.getAssociatedChannels=function(t){return je(this,void 0,void 0,(function(){var e;return Ne(this,(function(n){switch(n.label){case 0:return[4,this._db.get(ze(t))];case 1:return[2,null!=(e=n.sent())?e:[]]}}))}))},t.prototype.appendAssociatedChannel=function(t,e){return je(this,void 0,void 0,(function(){var n;return Ne(this,(function(r){switch(r.label){case 0:return[4,this.getAssociatedChannels(t)];case 1:return n=r.sent(),[4,this._db.set(ze(t),Be(Be([],Re(n)),[e]))];case 2:return r.sent(),[2]}}))}))},t.prototype.clearAssociatedChannels=function(t){return je(this,void 0,void 0,(function(){return Ne(this,(function(e){switch(e.label){case 0:return[4,this._db.remove(ze(t))];case 1:return e.sent(),[2]}}))}))},t}(),Qe=He,Ze=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Ye=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},$e=function(t,e){for(var n=0,r=e.length,i=t.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},on=function(t,e){for(var n=0,r=e.length,i=t.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},vn=function(e){function n(n,r,i,o,a,s,u,c){var l,f=e.call(this)||this;return f._channel=n,f._locale=r,f._storage=i,f._client=o,f._registration=a,f._flags=s,f._lifecycle=u,f._emitter=c,f._mutex=new t.Z,f._ready=f._init(),null===(l=f._emitter)||void 0===l||l.addEventListener("channel",(function(t){return f._onChannel(t)})),f}return ln(n,e),n.prototype.contactId=function(){return pn(this,void 0,void 0,(function(){var t=this;return dn(this,(function(e){switch(e.label){case 0:return[4,this._ready];case 1:return e.sent(),[2,this._mutex.acquireAsync().then((function(){return t._storage.getOrCreateContactId()})).finally((function(){return t._mutex.release()}))]}}))}))},n.prototype._init=function(){return pn(this,void 0,void 0,(function(){var t,e,n,r;return dn(this,(function(i){switch(i.label){case 0:return[4,this._channel()];case 1:return t=i.sent(),[4,this._storage.getNamedUserId()];case 2:return e=i.sent(),t?[4,this._migrate(t,e)]:(u("contact: initialized without channel"),[2]);case 3:return i.sent()?(u("contact: successful migration"),[2]):[4,this._resolve(t.id)];case 4:return n=hn.apply(void 0,[i.sent(),1]),r=n[0],[4,this._applyPendingAttributeMutations(r)];case 5:return i.sent(),[4,this._applyPendingTagMutations(r)];case 6:return i.sent(),[4,this._applyPendingSubscriptionListMutations(r)];case 7:return i.sent(),u("contact: initialized"),[2]}}))}))},n.prototype.identify=function(t){return pn(this,void 0,void 0,(function(){var e=this;return dn(this,(function(n){switch(n.label){case 0:return[4,this._ready];case 1:return n.sent(),function(t){if("string"!=typeof t)throw new bt("must be a string");if(!t.trim())throw new bt("must not be blank")}(t),[2,this._mutex.acquireAsync().then((function(){return e._identify(t)})).then((function(n){return e._lifecycle.accept("contact",Date.now(),{contactId:n,type:"identify",id:t})})).finally((function(){return e._mutex.release()}))]}}))}))},n.prototype._identify=function(t){return pn(this,void 0,void 0,(function(){var e,n,r;return dn(this,(function(i){switch(i.label){case 0:return[4,this._namedUserIdEquals(t)];case 1:return i.sent()?(u("contact: identify, not setting as user is already identified"),[2,this._storage.getOrCreateContactId()]):[4,this._storage.getNamedUserId()];case 2:return i.sent()?(u("contact: identify, this contact already has a named user. Creating new contact."),[4,this._storage.clearContactId()]):[3,5];case 3:return e=i.sent(),[4,this._resetStoredContact(e)];case 4:i.sent(),i.label=5;case 5:return[4,this._nonCanonicalChannelId()];case 6:if(!(n=i.sent()))throw new yt;return[4,this._doIdentify(t,n)];case 7:return r=i.sent(),u("contact: identified",t,n,r),[2,r]}}))}))},n.prototype._namedUserIdEquals=function(t){return pn(this,void 0,void 0,(function(){var e;return dn(this,(function(n){switch(n.label){case 0:return e=t,[4,this._storage.getNamedUserId()];case 1:return[2,e===n.sent()]}}))}))},n.prototype.reset=function(){return pn(this,void 0,void 0,(function(){var t=this;return dn(this,(function(e){switch(e.label){case 0:return[4,this._ready];case 1:return e.sent(),[4,this._mutex.acquireAsync().then((function(){return t._reset()})).then((function(e){return t._lifecycle.accept("contact",Date.now(),{contactId:e,type:"reset"})})).finally((function(){return t._mutex.release()}))];case 2:return e.sent(),[2]}}))}))},n.prototype._reset=function(){return pn(this,void 0,void 0,(function(){var t;return dn(this,(function(e){switch(e.label){case 0:return[4,this._channel()];case 1:return t=e.sent(),[4,this._doReset(null==t?void 0:t.id)];case 2:return[2,e.sent()]}}))}))},n.prototype.editAttributes=function(){return pn(this,void 0,void 0,(function(){var t,e,n=this;return dn(this,(function(r){switch(r.label){case 0:return[4,this._ready];case 1:return r.sent(),[4,this._storage.getOrCreateContactId()];case 2:return t=r.sent(),e=we,[4,this._storage.getPendingAttributeMutations()];case 3:return[2,e.apply(void 0,[r.sent(),function(e){return pn(n,void 0,void 0,(function(){return dn(this,(function(n){switch(n.label){case 0:return[4,this._flags.isDataCollectionEnabled()];case 1:if(!n.sent())throw new Gt;return[4,this._isRelevantToAirship()];case 2:return n.sent()?[3,4]:[4,this._storage.setPendingAttributeMutations(e)];case 3:case 5:return n.sent(),[2];case 4:return[4,this._applyPendingAttributeMutations(t,e)]}}))}))}])]}}))}))},n.prototype._applyPendingAttributeMutations=function(t,e){return pn(this,void 0,void 0,(function(){var n,r;return dn(this,(function(i){switch(i.label){case 0:return null==e?[3,1]:(r=e,[3,3]);case 1:return[4,this._storage.getPendingAttributeMutations()];case 2:r=i.sent(),i.label=3;case 3:return(n=r).length?[4,this._client.updateAttributes(t,n)]:[3,7];case 4:return i.sent(),[4,this._storage.setPendingAttributeMutations([])];case 5:return i.sent(),[4,this._storage.appendAttributeMutations(t,n)];case 6:i.sent(),this._lifecycle.accept("contact",Date.now(),{contactId:t,type:"attribute_mutation",mutations:n,outcome:Pt(n)}),i.label=7;case 7:return[2]}}))}))},n.prototype.editTags=function(){return pn(this,void 0,void 0,(function(){var t,e,n=this;return dn(this,(function(r){switch(r.label){case 0:return[4,this._ready];case 1:return r.sent(),[4,this._storage.getOrCreateContactId()];case 2:return t=r.sent(),e=un,[4,this._storage.getPendingTagMutations()];case 3:return[2,e.apply(void 0,[r.sent(),function(e){return pn(n,void 0,void 0,(function(){return dn(this,(function(n){switch(n.label){case 0:return[4,this._flags.isDataCollectionEnabled()];case 1:if(!n.sent())throw new Gt;return[4,this._isRelevantToAirship()];case 2:return n.sent()?[3,4]:[4,this._storage.setPendingTagMutations(e)];case 3:case 5:return n.sent(),[2];case 4:return[4,this._applyPendingTagMutations(t,e)]}}))}))}])]}}))}))},n.prototype._applyPendingTagMutations=function(t,e){return pn(this,void 0,void 0,(function(){var n,r;return dn(this,(function(i){switch(i.label){case 0:return null==e?[3,1]:(r=e,[3,3]);case 1:return[4,this._storage.getPendingTagMutations()];case 2:r=i.sent(),i.label=3;case 3:return(n=r).length?[4,this._client.updateTags(t,n)]:[3,7];case 4:return i.sent(),[4,this._storage.setPendingTagMutations([])];case 5:return i.sent(),[4,this._storage.appendTagMutations(t,n)];case 6:i.sent(),this._lifecycle.accept("contact",Date.now(),{contactId:t,type:"tag_mutation",mutations:n,outcome:xt(n)}),i.label=7;case 7:return[2]}}))}))},n.prototype._createSubscriptionManager=function(){var t=this;return new en(this._client,this._storage,(function(){return pn(t,void 0,void 0,(function(){return dn(this,(function(t){switch(t.label){case 0:return[4,this._ready];case 1:return t.sent(),[2,this._storage.getOrCreateContactId()]}}))}))}),(function(){return t._flags.isDataCollectionEnabled()}),(function(){return t._isRelevantToAirship()}))},Object.defineProperty(n.prototype,"subscriptions",{get:function(){return this._subscriptions||(this._subscriptions=this._createSubscriptionManager()),this._subscriptions},enumerable:!1,configurable:!0}),n.prototype._applyPendingSubscriptionListMutations=function(t,e){return pn(this,void 0,void 0,(function(){var n,r;return dn(this,(function(i){switch(i.label){case 0:return null==e?[3,1]:(r=e,[3,3]);case 1:return[4,this._storage.getPendingSubscriptionListMutations()];case 2:r=i.sent(),i.label=3;case 3:return(n=r).length?[4,this._client.updateSubscriptions(t,n)]:[3,7];case 4:return i.sent(),[4,this._storage.setPendingSubscriptionListMutations([])];case 5:return i.sent(),[4,this._storage.appendSubscriptionListMutations(t,n)];case 6:i.sent(),this._lifecycle.accept("contact",Date.now(),{contactId:t,type:"subscription_list_mutation",mutations:n,outcome:ee(n)}),i.label=7;case 7:return[2]}}))}))},n.prototype._registerAndAssociateChannel=function(t){return pn(this,void 0,void 0,(function(){var e,n,r;return dn(this,(function(i){switch(i.label){case 0:return[4,this._ready];case 1:return i.sent(),n=w,[4,this._locale()];case 2:return e=n.apply(void 0,[i.sent()]),[4,t(e)];case 3:return r=i.sent(),[2,this._associateChannel(r)]}}))}))},n.prototype._associateChannel=function(t){return pn(this,void 0,void 0,(function(){var e;return dn(this,(function(n){switch(n.label){case 0:return[4,this._storage.getOrCreateContactId()];case 1:return e=n.sent(),[4,this._client.associateChannel(e,t)];case 2:return n.sent(),[4,this._storage.appendAssociatedChannel(e,t)];case 3:return n.sent(),[4,this._applyPendingAttributeMutations(e)];case 4:return n.sent(),[4,this._applyPendingTagMutations(e)];case 5:return n.sent(),[4,this._applyPendingSubscriptionListMutations(e)];case 6:return n.sent(),[2]}}))}))},n.prototype.registerEmail=function(t,e){return pn(this,void 0,void 0,(function(){var n=this;return dn(this,(function(r){return[2,this._registerAndAssociateChannel((function(r){return pn(n,void 0,void 0,(function(){return dn(this,(function(n){switch(n.label){case 0:return[4,this._registration.registerEmail(t,fn(fn({},e),r))];case 1:return[2,{channelId:n.sent(),platform:"email"}]}}))}))}))]}))}))},n.prototype.registerSms=function(t,e){return pn(this,void 0,void 0,(function(){var n=this;return dn(this,(function(r){return[2,this._registerAndAssociateChannel((function(r){return pn(n,void 0,void 0,(function(){return dn(this,(function(n){switch(n.label){case 0:return[4,this._registration.registerSms(t,fn(fn({},e),r))];case 1:return[2,{channelId:n.sent(),platform:"sms"}]}}))}))}))]}))}))},n.prototype.registerOpen=function(t,e){return pn(this,void 0,void 0,(function(){var n=this;return dn(this,(function(r){return[2,this._registerAndAssociateChannel((function(r){return pn(n,void 0,void 0,(function(){return dn(this,(function(n){switch(n.label){case 0:return[4,this._registration.registerOpen(t,fn(fn({},e),r))];case 1:return[2,{channelId:n.sent(),platform:"open"}]}}))}))}))]}))}))},n.prototype.associateChannel=function(t,e){return pn(this,void 0,void 0,(function(){return dn(this,(function(n){switch(n.label){case 0:return[4,this._ready];case 1:if(n.sent(),r=t,!be.includes(r))throw new Vt("invalid platform: "+t);return[2,this._associateChannel({platform:t,channelId:e})]}var r}))}))},n.prototype._migrate=function(t,e){return pn(this,void 0,void 0,(function(){var n,r;return dn(this,(function(i){switch(i.label){case 0:return(n=null==t?void 0:t.named_user_id)?n===e?(u("contact: old nu matches new nu, no migration needed"),[2,!1]):[4,this._resolve(t.id,!0)]:(u("contact: no old nu, no migration needed"),[2,!1]);case 1:return r=hn.apply(void 0,[i.sent(),2]),r[1]?(u("contact: migration for existing user resolved to anonymous"),[2,!1]):[4,this._storage.setNamedUserId(n)];case 2:return i.sent(),[2,!0]}}))}))},n.prototype._resolve=function(t,e){return pn(this,void 0,void 0,(function(){var n,r,i,o,a,s,u;return dn(this,(function(c){switch(c.label){case 0:return[4,this._storage.getOrCreateContactId()];case 1:return n=c.sent(),[4,this._storage.getNamedUserId()];case 2:return r=c.sent(),(i=!e)?[4,this._storage.sessionResolved()]:[3,4];case 3:i=c.sent(),c.label=4;case 4:return i?[2,[n,!r]]:[4,this._client.resolve(t)];case 5:return o=hn.apply(void 0,[c.sent(),2]),a=o[0],s=o[1],[4,this._storage.setSessionResolved(!0)];case 6:return c.sent(),u=!r===s,n===a&&u?(this._lifecycle.accept("contact",Date.now(),{contactId:a,type:"resolve"}),[2,[a,s]]):[4,this._storage.setContactId(a)];case 7:return c.sent(),s?[4,this._storage.clearNamedUserId()]:[3,9];case 8:c.sent(),c.label=9;case 9:return[4,this._maybeEmitConflict(n,r)];case 10:return c.sent(),this._lifecycle.accept("contact",Date.now(),{contactId:a,type:"resolve"}),[2,[a,s]]}}))}))},n.prototype._doIdentify=function(t,e){return pn(this,void 0,void 0,(function(){var n,r;return dn(this,(function(i){switch(i.label){case 0:return[4,this._storage.getOrCreateContactId()];case 1:return n=i.sent(),[4,this._client.identify(t,e,{contactId:n})];case 2:return r=i.sent(),n===r?[3,4]:[4,this._maybeEmitConflict(n)];case 3:i.sent(),i.label=4;case 4:return[4,this._storage.setContactId(r)];case 5:return i.sent(),[4,this._storage.setNamedUserId(t)];case 6:return i.sent(),[4,this._storage.setSessionResolved(!0)];case 7:return i.sent(),[2,r]}}))}))},n.prototype._doReset=function(t){return pn(this,void 0,void 0,(function(){var e,n,r,i;return dn(this,(function(o){switch(o.label){case 0:return[4,this._storage.getOrCreateContactId()];case 1:return e=o.sent(),t?[4,this._client.reset(t)]:[3,3];case 2:return n=o.sent(),[3,5];case 3:return[4,this._storage.clearContactId()];case 4:n=o.sent(),o.label=5;case 5:return e===n?[3,8]:(r=this._maybeEmitConflict,i=[e],[4,this._storage.getNamedUserId()]);case 6:return[4,r.apply(this,i.concat([o.sent()]))];case 7:o.sent(),o.label=8;case 8:return[4,this._resetStoredContact(n)];case 9:return o.sent(),[2,n]}}))}))},n.prototype._onChannel=function(t){return pn(this,void 0,void 0,(function(){var e,n,r,i;return dn(this,(function(o){switch(o.label){case 0:return[4,this._ready];case 1:return o.sent(),(e=t.detail)?[4,this._isRelevantToAirship()]:[2];case 2:return o.sent()?[4,this._resolve(e.id)]:[2];case 3:return n=hn.apply(void 0,[o.sent(),1]),r=n[0],[4,this._applyPendingAttributeMutations(r)];case 4:return o.sent(),[4,this._applyPendingTagMutations(r)];case 5:return o.sent(),[4,this._applyPendingSubscriptionListMutations(r)];case 6:return o.sent(),i=new CustomEvent("_channel_handled"),this.dispatchEvent(i),[2]}}))}))},n.prototype._maybeEmitConflict=function(t,e){return pn(this,void 0,void 0,(function(){var n,r,i,o,a,s;return dn(this,(function(u){switch(u.label){case 0:return[4,this._storage.getAttributeMutations(t)];case 1:return n=u.sent(),[4,this._storage.getTagMutations(t)];case 2:return r=u.sent(),[4,this._storage.getAssociatedChannels(t)];case 3:return i=u.sent(),[4,this._storage.getSubscriptionListMutations(t)];case 4:return o=u.sent(),e||n.length||r.length||i.length||o.length?(a={namedUserId:e,attributes:Pt(n),tags:xt(r),subscriptions:Xt(o),associatedChannels:i},s=new CustomEvent("conflict",{detail:a}),this.dispatchEvent(s),[2]):[2]}}))}))},Object.defineProperty(n.prototype,"ready",{get:function(){return this._ready},enumerable:!1,configurable:!0}),n.prototype._isRelevantToAirship=function(){return pn(this,void 0,void 0,(function(){var t,e,n;return dn(this,(function(r){switch(r.label){case 0:return[4,this._channel()];case 1:return t=r.sent(),[4,this._storage.getOrCreateContactId()];case 2:return e=r.sent(),[4,this._storage.getAssociatedChannels(e)];case 3:return n=r.sent(),[2,!!t||!!n.length]}}))}))},n.prototype._nonCanonicalChannelId=function(){var t;return pn(this,void 0,void 0,(function(){var e,n,r;return dn(this,(function(i){switch(i.label){case 0:return[4,this._channel()];case 1:return(e=i.sent())?[2,e.id]:[4,this._storage.getOrCreateContactId()];case 2:return n=i.sent(),[4,this._storage.getAssociatedChannels(n)];case 3:return r=i.sent(),[2,null===(t=r[0])||void 0===t?void 0:t.channelId]}}))}))},n.prototype._resetStoredContact=function(t){return pn(this,void 0,void 0,(function(){return dn(this,(function(e){switch(e.label){case 0:return[4,this._storage.setContactId(t)];case 1:return e.sent(),[4,this._storage.clearNamedUserId()];case 2:return e.sent(),[4,this._storage.setPendingAttributeMutations([])];case 3:return e.sent(),[4,this._storage.setPendingTagMutations([])];case 4:return e.sent(),[2]}}))}))},n}(e.EventTarget);function yn(t,e,n,r,i,o){var a=new Qe({prefix:t.storagePrefix,sessionLengthMs:t.contacts.sessionLengthMs,namedUserTtlMs:t.contacts.namedUserTtlMs,_forceExpireNamedUsers:t.contacts._forceExpireNamedUsers},d,self.sessionStorage),s=function(t,e){var n=new xe(t,e),r=new R({prefix:t.storagePrefix,ttlMs:t.cacheTtlMs},self.sessionStorage),i=new B(r),o=new L({indexKey:"contact",keyFn:function(t){return t.listId+":"+t.scope}},r);return new Pe(n,i,o)}({paths:t.paths.contact,storagePrefix:t.storagePrefix,cacheTtlMs:t.subscriptionLists.cacheTtlMs},X(t)),u=new Ae({paths:t.paths.contact.registration},X(t));return new vn(e,n,a,s,u,r,i,o)}function bn(){return window.location}var gn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var mn=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},wn=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]255)throw new RangeError(n+"."+s+" has a 255 character limit")}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}(this,["name","transactionId","interactionId","interactionId"])},t.prototype._validateProperties=function(t){if(Array.isArray(t)||"object"!=typeof t)throw new TypeError("CustomEvent: properties must be an object");var e;try{e=JSON.stringify(t)}catch(t){throw new TypeError("CustomEvent: properties must be JSON serializable.")}if(e.length>32768)throw new RangeError("CustomEvent: properties are "+e.length+" when JSON encoded, exceeding the maximum of 32768.")},t.prototype._validateBooleanProperty=function(t){if(this.properties&&this.properties.hasOwnProperty(t)&&"boolean"!=typeof this.properties[t])throw new TypeError("CustomEvent property '"+t+"' must be a Boolean")},t.prototype._validateIsoDateProperty=function(t){if(this.properties&&this.properties.hasOwnProperty(t)&&!_n(this.properties[t]))throw new TypeError("CustomEvent property '"+t+"' must be an ISO_8601 date string")},t.prototype.toJSON=function(){var t=this.getSession(),e={web_channel:this._channel.id},n=(new Date).toISOString().split(".")[0]+"Z",r=null==t?void 0:t.send_id,i=this._prepareProperties();return{occurred:n,user:e,send_id:r,body:{name:this.name,value:this.value,transaction:this.transactionId,interaction_id:this.interactionId,interaction_type:this.interactionType,template_type:this.templateType,session_id:null==t?void 0:t.id,properties:Object.keys(i).length?i:void 0}}},t.prototype.track=function(){return mn(this,void 0,void 0,(function(){return wn(this,(function(t){switch(t.label){case 0:return[4,this.reportable()];case 1:return t.sent()?[4,this._prepareInteractionId()]:[2,{ok:!1,message:"Channel is not opted in or analytics/data-collection are disabled."}];case 2:return t.sent(),this.validate(),[2,this.sendEvent()]}}))}))},t}(),Pn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xn=function(t){function e(e,n,r){void 0===n&&(n={});var i=t.call(this,"registered_account",e,n,r)||this;return i.templateType="account",i}return Pn(e,t),e.prototype._prepareProperties=function(){return this.value&&(this.properties.ltv=!0),t.prototype._prepareProperties.call(this)},e}(Sn),En=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),On=function(t){function e(e,n,r,i){void 0===r&&(r={});var o=t.call(this,e,n,r,i)||this;return o.templateType="media",o}return En(e,t),e.prototype.validate=function(){this._validateBooleanProperty("feature"),this._validateIsoDateProperty("published_date"),t.prototype.validate.call(this)},e.prototype._prepareProperties=function(){return this.value&&(this.properties.ltv=!0),t.prototype._prepareProperties.call(this)},e}(Sn),Mn=function(t){function e(e,n,r){return void 0===n&&(n={}),t.call(this,"browsed_content",e,n,r)||this}return En(e,t),e}(On),kn=function(t){function e(e,n,r){return void 0===n&&(n={}),t.call(this,"consumed_content",e,n,r)||this}return En(e,t),e}(On),An=function(t){function e(e,n,r){return void 0===n&&(n={}),t.call(this,"starred_content",e,n,r)||this}return En(e,t),e}(On),Tn=function(t){function e(e,n,r,i){void 0===r&&(r={});var o=t.call(this,"shared_content",void 0,r,i)||this;return o.properties.source=e,o.properties.medium=n,o}return En(e,t),e}(On),Cn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),In=function(t){function e(e,n,r,i){void 0===r&&(r={});var o=t.call(this,e,n,r,i)||this;return o.templateType="retail",o}return Cn(e,t),e.prototype.validate=function(){this._validateBooleanProperty("new_item"),t.prototype.validate.call(this)},e}(Sn),jn=function(t){function e(e,n,r){return void 0===n&&(n={}),t.call(this,"browsed",e,n,r)||this}return Cn(e,t),e}(In),Nn=function(t){function e(e,n,r){return void 0===n&&(n={}),t.call(this,"added_to_cart",e,n,r)||this}return Cn(e,t),e}(In),Rn=function(t){function e(e,n,r){return void 0===n&&(n={}),t.call(this,"purchased",e,n,r)||this}return Cn(e,t),e.prototype._prepareProperties=function(){return this.value&&(this.properties.ltv=!0),t.prototype._prepareProperties.call(this)},e}(In),Bn=function(t){function e(e,n,r){return void 0===n&&(n={}),t.call(this,"starred_product",e,n,r)||this}return Cn(e,t),e}(In),Ln=function(t){function e(e,n,r,i){void 0===r&&(r={});var o=t.call(this,"shared_product",void 0,r,i)||this;return o.properties.source=e,o.properties.medium=n,o}return Cn(e,t),e}(In),Un=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var Dn=36e5;function Fn(t,e){if(void 0===t&&(t={}),void 0===e&&(e=!1),o.configured)return o;delete t.paths,delete t.consts,Object.assign(o,t);var n=new URL(o.workerUrl,o.workerUrl.startsWith("/")?self.location.href:void 0);o.deprecatedStoragePrefix=self.btoa(o.storagePrefix+":"+o.appKey+":"+o.workerUrl);var r=n.pathname.replace(/[^/]+$/,"");if(o.storagePrefix=self.btoa(o.storagePrefix+":"+o.appKey+":"+r),o.secureBridgeUrl=function(t){return t.secureIframeUrl||t.secureBridgeUrl?t.secureIframeUrl||t.secureBridgeUrl:t.registrationDomain&&t.secureBridgePath?new URL(t.secureBridgePath,"https://"+t.registrationDomain).href:null}(o),o.registrationDomain?o.secureHost="https://"+o.registrationDomain:o.secureBridgeUrl&&(o.secureHost=new URL(o.secureBridgeUrl).origin),o.debug){var a=e?"secure-bridge":"main";console.log("UA[%s] configured with:",a,o)}return o.contacts.namedUserTtlMs=Math.max(Dn,o.contacts.namedUserTtlMs),"string"!=typeof o.appVersion&&(console.error("invalid app version "+o.appVersion+" specified; resetting to default"),o.appVersion=i),o.configured=!0,o}function qn(t,e){t="last_"+t;var n=+new Date,r=et.getJSON(t);return{store:function(){return et.setJSON(t,n)},after:!r||n-r>36e5*e}}var Gn=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Vn=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function er(t){t.tags&&(u("[secure-bridge] Setting channel tags from message data: %o",t.tags),et.setJSON("tags",t.tags)),t.channel&&(u("[secure-bridge] Setting channel data from message data: %o",t.channel),d.set("channel",t.channel)),t.subscriptionDomain&&(u("[secure-bridge] Setting subscriptionDomain from message data: %s",t.subscriptionDomain),d.set("subscriptionDomain",t.subscriptionDomain))}var nr=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},rr=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},or=function(){function t(){this.plugins=new Map,this.loaders=new Map}return Object.defineProperty(t.prototype,"list",{get:function(){var t,e,n=[];try{for(var r=ir(this.plugins.keys()),i=r.next();!i.done;i=r.next()){var o=i.value;n.push(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},enumerable:!1,configurable:!0}),t.prototype.load=function(t,e,n){var r=this,i=this.loaders.get(t);if(i)return i;var o=new Promise((function(i){var o={url:e,opts:n,setLoaded:function(t){i(t)}};r.plugins.set(t,o)}));this.loaders.set(t,o);var a=function(t,e,n){void 0===n&&(n=document);var r=n.createElement("script");return r.src=e,r.async=!0,r.setAttribute("rel",t),n.head.appendChild(r),r}(t,e);return a.addEventListener("error",(function(){throw r.loaders.delete(t),new Error("Error while loading plugin at URL: '"+e+"'")})),o},t.prototype._setLoaded=function(t,e,n){var r=this.plugins.get(t);if(!r)throw new Error("Airship Plugin "+t+" does not match any currently loading plugins: "+this.list.join(", "));return r.setLoaded(e(r.opts,n))},t.prototype.get=function(t){return nr(this,void 0,void 0,(function(){var e;return rr(this,(function(n){if(e=this.loaders.get(t))return[2,e];throw new Error("The plugin '"+t+"' is not loaded. Make sure you have called plugins.load(...) correctly.")}))}))},t}(),ar=or;function sr(t){return void 0===t&&(t=self),!("PushManager"in t)&&!!("safari"in t||navigator.userAgent.match(/Safari/)&&!navigator.userAgent.match(/Chrome/))}function ur(t,e){return e.push_address=t.endpoint,e.web.subscription=t.toJSON().keys,{channel:e}}var cr=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},lr=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xr=function(){function t(t,e,n){this._client=t,this._locale=e,this._cache=n}return t.prototype.get=function(){return _r(this,void 0,void 0,(function(){var t,e=this;return Sr(this,(function(n){switch(n.label){case 0:return[4,this._locale()];case 1:return t=n.sent(),[2,this._cache.get(this._cacheKey(t),(function(n){return _r(e,void 0,void 0,(function(){var e;return Sr(this,(function(r){switch(r.label){case 0:return[4,this._client.get({locale:t,ifModifiedSince:n})];case 1:return(e=r.sent())===gr?[2,N]:[2,e]}}))}))}))]}}))}))},t.prototype._cacheKey=function(t){var e,n;return"remote_data:"+[null!==(e=t.language)&&void 0!==e?e:"default",null!==(n=t.country)&&void 0!==n?n:"default"].join("-")},t}(),Er=xr,Or=function(){function t(t){this._remote=t}return t.prototype.get=function(t){return _r(this,void 0,void 0,(function(){var e,n,r,i,o,a;return Sr(this,(function(s){switch(s.label){case 0:return[4,this.list()];case 1:e=s.sent();try{for(n=Pr(e),r=n.next();!r.done;r=n.next())if((i=r.value).id===t)return[2,i]}catch(t){o={error:t}}finally{try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}}return[2,null]}}))}))},t.prototype.list=function(){return _r(this,void 0,void 0,(function(){var t,e;return Sr(this,(function(n){switch(n.label){case 0:return[4,this._remote.get()];case 1:return t=n.sent(),e=[],t.filter(yr).forEach((function(t){t.data.preference_forms.forEach((function(t){return e.push(t.form)}))})),[2,e]}}))}))},t}();!function(){function t(t){this._remote=t}t.prototype.list=function(){return _r(this,void 0,void 0,(function(){return Sr(this,(function(t){switch(t.label){case 0:return[4,this._remote.get()];case 1:return[2,t.sent().filter(br).reduce((function(t,e){return t.concat(e.data.in_app_messages)}),[])]}}))}))}}();function Mr(){return!("standalone"in navigator)||!("ontouchstart"in window)||navigator.standalone}function kr(){var t=window.location.hostname;return!o.registrationDomain||t===o.registrationDomain}function Ar(){var t=window.isSecureContext;return void 0!==t?t:Boolean(bn().protocol.match("https"))}var Tr=["indexedDB","localStorage","fetch","crypto"];function Cr(){var t=Tr.every((function(t){return t in window}));return o.loadIfPushNotSupported?t:t&&Ir()}function Ir(){var t=navigator.userAgent.match(/Chrome\/(\d\d)\./);return!(t&&Number(t[1])<52)&&Boolean("PushManager"in window||sr()&&o.websitePushId&&"safari"in window&&"pushNotification"in window.safari)}var jr=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Nr=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=12.1||i.includes("firefox")&&a>=72),s.isAllowedPushRegistrationContext=Mr(),s.setDataCollectionEnabled=function(t){return k(t,s)},s.isDataCollectionEnabled=M,s._lifecycleEvents=new Jr,o.secureBridgeUrl&&o.secureBridgeUrl.match(/accengage\.net/)&&!o.mixedRegistrationDomains&&console.warn("WARNING: you should set 'mixedRegistrationDomains' to true if you are migrating from Accengage and were using an Accengage-owned domain"),u("[main] Web SDK environment:");var c={isSecure:Ar(),isRegistrationDomain:s.isRegistrationDomain,mixedRegistrationDomains:o.mixedRegistrationDomains,secureBridgeUrl:o.secureBridgeUrl,allowedDomains:o.allowedDomains};o.secureBridgeUrl&&(c.sbOriginDifferentFromCurrent=new URL(o.secureBridgeUrl).origin!==window.location.origin),u(c);var l,f=(!Ar()||!s.isRegistrationDomain||o.mixedRegistrationDomains)&&o.secureBridgeUrl&&new URL(o.secureBridgeUrl).origin!==window.location.origin&&!sr();if(f&&!o.secureBridgeUrl&&console.warn("Airship SDK is integrated on a non-secured domain but 'secureIframeUrl' is not provided."),s.hasExistingSubscription=Promise.resolve(),f&&o.secureBridgeUrl){if(function(t,e){u("Setting up secure-bridge with %s",e);var n=o.secureHost,r=document.createElement("iframe"),i=new Promise((function(t){r.onload=function(){return t(r)}})),a=new URL(e);function s(t){i.then((function(e){var r;u("[main] Sending data to secure-bridge (%s): %o",n,t),null===(r=e.contentWindow)||void 0===r||r.postMessage($n(t),n)}))}a.searchParams.append("__ua_secondary_origin",bn().origin),r.style.display="none",r.src=a.toString(),document.body.appendChild(r),window.addEventListener("message",(function(e){var r=Xn(e,n);t._set(r)})),t.addEventListener("tags",(function(t){s({tags:t.tags})})),t.addEventListener("channel",(function(){d.get("channel").then((function(t){s({channel:t})}))})),t.addEventListener("subscriptiondomain",(function(t){s({subscriptionDomain:t.detail})}))}(s,o.secureBridgeUrl),o.mixedRegistrationDomains){var p=new Promise((function(t){s.addEventListener("subscriptiondomain",(function(e){return t(e.detail)}),{once:!0})}));s.hasExistingSubscription=Promise.race([p,(l=1e3,new Promise((function(t){setTimeout(t,l)})))])}}else s._channelPromise.then((function(t){return Hn(t)}));return s.channel=null,s.localeOverride=new b,s.CustomEvent=function(t,e,n,r){var i,o;return i=function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(Sn),i.templates={retail:{AddedToCartEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(Nn),BrowsedEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(jn),PurchasedEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(Rn),SharedProductEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(Ln),StarredProductEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(Bn)},media:{BrowsedContentEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(Mn),ConsumedContentEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(kn),SharedContentEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(Tn),StarredContentEvent:function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(An)},account:(o=function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return Un(o,i),o.prototype.getChannel=function(){return t()},o.prototype.getSession=function(){return e()},o.prototype.reportable=function(){return n()},o.prototype.sendEvent=function(){return r(this)},o}(xn),o.RegisterEvent=o,o)},i}((function(){return s.channel}),(function(){return et.getJSON("session")}),(function(){var t,e;return Yn(null!==(e=null===(t=s.channel)||void 0===t?void 0:t.optedIn)&&void 0!==e&&e)}),(function(t){return s.sendCustomEvent(t)})),s.plugins=new ar,s._contactPromise=s.createContact(),window.addEventListener("storage",et.onStorage((function(t){return s._set(t)}))),navigator.serviceWorker&&navigator.serviceWorker.addEventListener("message",(function(t){"push"===t.data.type&&(u("Push event from worker",t),s.dispatchEvent({type:"push",push:t.data.push}))})),s}return zr(n,e),n.prototype.sendCustomEvent=function(t){return Hr(this,void 0,void 0,(function(){var e,n;return Qr(this,(function(r){switch(r.label){case 0:return e=t.toJSON(),[4,U(o.paths.custom_events,{method:"post",body:e})];case 1:return 200===(n=r.sent()).status&&this._lifecycleEvents.accept("custom_event",new Date(e.occurred).getTime(),{name:t.name,properties:t.properties,value:t.value}),[2,n.json()]}}))}))},n.prototype.createContact=function(){return Hr(this,void 0,void 0,(function(){var t=this;return Qr(this,(function(e){switch(e.label){case 0:return[4,this._isSetup.promise];case 1:return e.sent(),[2,yn(o,(function(){return Hr(t,void 0,void 0,(function(){return Qr(this,(function(t){return[2,this.channel]}))}))}),(function(){return Hr(t,void 0,void 0,(function(){return Qr(this,(function(t){return[2,this.localeOverride]}))}))}),{isDataCollectionEnabled:this.isDataCollectionEnabled},this._lifecycleEvents,this)]}}))}))},n.prototype.checkDataCollection=function(){var t=this;return Promise.resolve(this.dataCollectionEnabled).then((function(e){t.dataCollectionEnabledSync=e}))},n.prototype.checkPermission=function(t){return Hr(this,void 0,void 0,(function(){var e;return Qr(this,(function(n){switch(n.label){case 0:return o.mixedRegistrationDomains?[4,this.hasExistingSubscription]:[3,2];case 1:if(n.sent())return[2];n.label=2;case 2:return[4,this.getNotificationPermission()];case 3:return(e=n.sent())&&"granted"!==e&&t.optedIn&&this.isRegistrationDomain&&t.optOut(),[2]}}))}))},n.prototype.heartbeat=function(t){var e=qn("heartbeat",24),n=e.after,r=e.store;n&&(u("SENDING heartbeat"),r(),t.optedIn&&this.isRegistrationDomain?this.register().catch((function(){return t.update()})):t.update())},n.prototype.getChannel=function(){return this._channelPromise},n.prototype._legacySetup=function(){try{var t=et.getJSON("channel");(null==t?void 0:t.channel_id)&&this._setChannel(t),this._isSetup.resolve()}catch(t){throw this._isSetup.reject(t),t}},n.prototype._setup=function(){return Hr(this,void 0,void 0,(function(){var t,e=this;return Qr(this,(function(n){switch(n.label){case 0:return[4,Rr()];case 1:return n.sent(),(t=[]).push(d.get("channel").then((function(t){t&&t.channel_id&&e._setChannel(t)})).then((function(){return b.getStoredLocale().then((function(t){e.localeOverride.set(t),e.channel&&e.localeOverride.setChannel(e.channel)}))}))),t.push(d.get("subscriptionDomain").then((function(t){t&&e._setSubscriptionDomain(t)}))),t.push(this.checkDataCollection()),[2,Promise.all(t).then((function(){return e._isSetup.resolve()})).catch((function(t){throw e._isSetup.reject(t),t}))]}}))}))},Object.defineProperty(n.prototype,"disableAnalytics",{get:function(){return d.get(o.consts.DISABLE_ANALYTICS).then((function(t){return!!t}))},set:function(t){d.set(o.consts.DISABLE_ANALYTICS,!!t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataCollectionEnabled",{get:function(){return M()},set:function(t){k(!!t,this),this.dataCollectionEnabledSync=!!t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"permission",{get:function(){var t;if(Ar())return null===(t=window.Notification)||void 0===t?void 0:t.permission},enumerable:!1,configurable:!0}),n.prototype.getNotificationPermission=function(){return Hr(this,void 0,void 0,(function(){return Qr(this,(function(t){switch(t.label){case 0:return[4,Dr()];case 1:return[2,t.sent()]}}))}))},Object.defineProperty(n.prototype,"contact",{get:function(){return this._contactPromise},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lifecycleEvents",{get:function(){return this._lifecycleEvents},enumerable:!1,configurable:!0}),n.prototype.register=function(){return Hr(this,void 0,void 0,(function(){var t=this;return Qr(this,(function(e){return[2,this._registrationMutex.acquireAsync().then((function(){return t._register(!0)})).finally((function(){return t._registrationMutex.release()}))]}))}))},n.prototype.create=function(){return Hr(this,void 0,void 0,(function(){var t=this;return Qr(this,(function(e){return[2,this._registrationMutex.acquireAsync().then((function(){var e,n;return t._register(null!==(n=null===(e=t.channel)||void 0===e?void 0:e.optedIn)&&void 0!==n&&n)})).finally((function(){return t._registrationMutex.release()}))]}))}))},n.prototype._register=function(t){return Hr(this,void 0,void 0,(function(){var e,n,r,i,a;return Qr(this,(function(s){switch(s.label){case 0:if(!sr()){if(!Ar())return[2,Promise.reject("Registration not possible on a non-secure context.")];if(!this.isRegistrationDomain)return[2,Promise.reject("Domain is not allowed for registration.")]}if(t&&!this.isAllowedPushRegistrationContext)return[2,Promise.reject("Registration cannot happen in this context.")];if(!this.dataCollectionEnabledSync)return[2,Promise.reject("Data collection is disabled. Cannot register user.")];if(!this.isWebPushSupported)return[2,Promise.reject("Web push not supported in browser")];e=null,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._workerRegistration];case 2:return e=s.sent(),[3,4];case 3:return s.sent(),[3,4];case 4:return[4,this.hasExistingSubscription];case 5:return(n=s.sent())&&n!==bn().hostname?[2,Promise.reject("An existing registration exists on "+n)]:[4,dr(e,t)];case 6:return r=s.sent(),this.channel?[4,U(this.channel.path,{method:"put",body:r})]:[3,8];case 7:return i=s.sent(),[3,10];case 8:return[4,U(o.paths.cra,{method:"post",body:r})];case 9:i=s.sent(),s.label=10;case 10:return[4,i.json()];case 11:return a=s.sent(),Vr(),(0,qn("heartbeat",24).store)(),this._setSubscriptionDomain(bn().hostname),[2,this._setChannel(a)]}}))}))},Object.defineProperty(n.prototype,"_intlDetails",{get:function(){return w(this.localeOverride)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_remoteData",{get:function(){var t=this;if(!this._remoteDataProvider){var e=new wr({paths:o.paths.remote_data,sdkVersion:o.VERSION,appKey:o.appKey},X(o)),n=new R({ttlMs:o.remoteData.cacheTtlMs,prefix:o.storagePrefix},self.sessionStorage);this._remoteDataProvider=new Er(e,(function(){return Hr(t,void 0,void 0,(function(){var t;return Qr(this,(function(e){return[2,{country:(t=this._intlDetails).localeCountry,language:t.localeLanguage}]}))}))}),new B(n))}return this._remoteDataProvider},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"preferenceCenters",{get:function(){return this._preferenceCenterManager||(this._preferenceCenterManager=new Or(this._remoteData)),this._preferenceCenterManager},enumerable:!1,configurable:!0}),n.prototype._set=function(t){void 0===t&&(t={}),t.channel&&t.channel.channel_id&&this._setChannel(t.channel),t.tags&&this.channel&&this.channel.tags.sync(t.tags),t.subscriptionDomain&&this._setSubscriptionDomain(t.subscriptionDomain),t.session&&this._setSession(t.session)},n.prototype._setSubscriptionDomain=function(t){d.set("subscriptionDomain",t);var e=new CustomEvent("subscriptiondomain",{detail:t});this.dispatchEvent(e)},n.prototype._setChannel=function(t){var e=this;return this.channel?(this.channel.set(t),this.channel):(this.channel=new ye((function(){return e.contact}),t),this.localeOverride.setChannel(this.channel),this.channel.addEventListener("channel",(function(t){t.channel=t.detail,e.dispatchEvent(t)})),this.channel.tags.addEventListener("tags",(function(t){var n=new CustomEvent("tags",{detail:t.detail});n.tags=t.detail,e.dispatchEvent(n)})),this.channel)},n.prototype._setSession=function(t){et.setJSON("session",t),this._channelPromise.then((function(e){Hn(e,t)}))},Object.defineProperty(n.prototype,"isSetup",{get:function(){return this._isSetup.promise},enumerable:!1,configurable:!0}),n}(e.EventTarget),Yr=Zr,Xr=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},$r=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},wi=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function _i(t){return"object"==typeof t&&(!!t&&!Array.isArray(t))}function Si(t){return!!_i(t)&&("channel_id"in t&&"string"==typeof t.channel_id&&"string"==typeof t.send_id)}function Pi(t){return!!_i(t)&&("a4sid"in t&&"string"==typeof t.a4sid)}function xi(t){return gi().then((function(e){var n={channel_id:e,body:t.body,title:t.title,icon:t.icon,require_interaction:"reqInt"in t&&Boolean(t.reqInt)},r=function(t){var e,n;if(null==t?void 0:t.onClick){var r=new URL(t.onClick.url),i=r.searchParams;try{for(var o=mi(Object.entries(t.onClick.params||{})),a=o.next();!a.done;a=o.next()){var s=wi(a.value,2),u=s[0],c=s[1];i.set(u,c)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r.search=i.toString(),r.toString()}}(t);return r&&(n.action={"^u":r}),t.a4sb&&Array.isArray(t.a4sb)&&t.a4sb.length&&(n.buttons=t.a4sb.reduce((function(t,e){var n={id:String(e.id),label:e.title,icon:e.icon,actions:{open:{type:"url",content:e.url}}};return t.push(n),t}),[])),"a4sbigpicture"in t&&(n.image=t.a4sbigpicture),n}))}function Ei(t){return"contact"===t.type}function Oi(t){return"channel"===t.type}var Mi=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},ki=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Fi(t,e){var n;return Li(this,void 0,void 0,(function(){var r,i,a,s,u;return Ui(this,(function(c){switch(c.label){case 0:return[4,Pi(e)?xi(e):Promise.resolve(e)];case 1:return r=c.sent(),i=r.title||o.defaultTitle,a=r.require_interaction||!1,s=r.send_id,[4,ti(t)];case 2:return c.sent(),[4,Gi(t,r)];case 3:c.sent(),c.label=4;case 4:return c.trys.push([4,6,,7]),[4,qi(t,s)];case 5:return c.sent(),[3,7];case 6:return u=c.sent(),console.error("error clearing notifications",u),[3,7];case 7:return r.body?[4,t.registration.showNotification(i,{body:r.body,icon:r.icon||o.defaultIcon,image:r.image,data:r,actions:null===(n=r.buttons)||void 0===n?void 0:n.map((function(t){return{title:t.label,action:t.id,icon:t.icon}})),requireInteraction:a})]:[3,9];case 8:c.sent(),c.label=9;case 9:return[2]}}))}))}function qi(t,e){return Li(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c;return Ui(this,(function(l){switch(l.label){case 0:return[4,t.registration.getNotifications()];case 1:if(!(null==(n=l.sent())?void 0:n.length))return[2];r=Date.now()/1e3;try{for(i=Di(n),o=i.next();!o.done;o=i.next()){if(a=o.value,!Si(s=a.data))return[2];e&&s.send_id===e||s.expiry&&s.expiry0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]