@letscooee/web-sdk 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ # 0.0.8
4
+
5
+ 1. Feature: Ability of InApp to be rendered inside an element.
6
+ 2. Fix: Overflowed content should not be rendered.
7
+ 3. Fix: Placing in-app on east direction.
8
+
3
9
  # 0.0.7
4
10
 
5
11
  More feature support in the sdk.
package/README.md CHANGED
@@ -27,11 +27,11 @@ code before calling any other CooeeSDK functions.
27
27
  <script src="https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@latest/dist/sdk.min.js" async></script>
28
28
  <script>
29
29
  window.CooeeSDK = window.CooeeSDK || {events: [], profile: [], account: []};
30
- CooeeSDK.account.push({"appID": "MY_COOEE_APP_ID", "appSecret": "MY_COOEE_APP_SECRET"});
30
+ CooeeSDK.account.push({"appID": "MY_COOEE_APP_ID"});
31
31
  </script>
32
32
  ```
33
33
 
34
- Replace `MY_COOEE_APP_ID` & `MY_COOEE_APP_SECRET` with the app id & secret given to you.
34
+ Replace `MY_COOEE_APP_ID` with the app id as seen in your Cooee dashboard.
35
35
 
36
36
  #### Step 2: Track Custom Events
37
37
 
@@ -46,7 +46,7 @@ var Container = /** @class */ (function (_super) {
46
46
  else if (this.o === ContainerOrigin.E) {
47
47
  styles = {
48
48
  top: '50%',
49
- left: 0,
49
+ right: 0,
50
50
  transform: 'translateY(-50%)',
51
51
  };
52
52
  }
@@ -84,6 +84,7 @@ var Container = /** @class */ (function (_super) {
84
84
  };
85
85
  }
86
86
  styles.position = 'absolute';
87
+ styles.overflow = 'hidden';
87
88
  return styles;
88
89
  };
89
90
  return Container;
@@ -15,6 +15,9 @@ var TriggerHelper = /** @class */ (function () {
15
15
  * @param triggerData trigger data
16
16
  */
17
17
  TriggerHelper.storeActiveTrigger = function (triggerData) {
18
+ if (triggerData.id === 'test') {
19
+ return;
20
+ }
18
21
  var activeTriggers = LocalStorageHelper.getObject(Constants.STORAGE_ACTIVE_TRIGGERS);
19
22
  if (!activeTriggers) {
20
23
  activeTriggers = [];
@@ -11,12 +11,12 @@ import { Container } from '../models/trigger/inapp/container';
11
11
  */
12
12
  var BlockProcessor = /** @class */ (function () {
13
13
  function BlockProcessor(parentHTMLEl, inappElement) {
14
+ this.renderer = Renderer.get();
14
15
  this.screenWidth = 0;
15
16
  this.screenHeight = 0;
16
17
  this.scalingFactor = getScalingFactor();
17
18
  this.parentHTMLEl = parentHTMLEl;
18
19
  this.inappElement = inappElement;
19
- this.renderer = new Renderer();
20
20
  this.screenWidth = this.renderer.getWidth();
21
21
  this.screenHeight = this.renderer.getHeight();
22
22
  }
@@ -37,7 +37,6 @@ var BlockProcessor = /** @class */ (function () {
37
37
  this.processSpaceBlock();
38
38
  this.processTransformBlock();
39
39
  this.registerAction();
40
- this.renderer.setStyle(this.inappHTMLEl, 'overflow', 'visible');
41
40
  this.renderer.setStyle(this.inappHTMLEl, 'outline', 'none');
42
41
  };
43
42
  /**
@@ -7,11 +7,8 @@ import { Constants } from '../constants';
7
7
  * @version 0.0.5
8
8
  */
9
9
  var IFrameRenderer = /** @class */ (function () {
10
- /**
11
- * Constructor
12
- */
13
10
  function IFrameRenderer() {
14
- this.renderer = new Renderer();
11
+ this.renderer = Renderer.get();
15
12
  }
16
13
  /**
17
14
  * Render iFrame element on CTAs.
@@ -16,10 +16,13 @@ import { Event } from '../models/event/event';
16
16
  */
17
17
  var InAppRenderer = /** @class */ (function () {
18
18
  /**
19
- * Public constructor
19
+ * Public constructor.
20
+ *
21
+ * @param parent Place the in-app in the given parent instead of the document.body.
20
22
  */
21
- function InAppRenderer() {
22
- this.rootContainer = new RootContainerRenderer().render();
23
+ function InAppRenderer(parent) {
24
+ this.parent = parent;
25
+ this.rootContainer = new RootContainerRenderer(parent).render();
23
26
  }
24
27
  /**
25
28
  * Renders in-app trigger from payload received
@@ -1,16 +1,17 @@
1
1
  import { Constants } from '../constants';
2
+ import { Renderer } from './renderer';
2
3
  export { TextRenderer } from './text-renderer';
3
4
  export { ShapeRenderer } from './shape-renderer';
4
5
  export { ImageRenderer } from './image-renderer';
5
6
  export { RootContainerRenderer } from './root-container-renderer';
6
7
  export { IFrameRenderer } from './iFrame-renderer';
7
8
  /**
8
- * Calculate scaling factor according to screen sizes
9
+ * Calculate scaling factor according to parent most container where the in-app's root container will be rendered.
9
10
  * @return number scaling factor
10
11
  */
11
12
  export function getScalingFactor() {
12
- var screenWidth = document.documentElement.clientWidth;
13
- var screenHeight = document.documentElement.clientHeight;
13
+ var screenWidth = Renderer.get().getWidth();
14
+ var screenHeight = Renderer.get().getHeight();
14
15
  var scalingFactor;
15
16
  if (screenWidth < screenHeight) {
16
17
  var shortEdge = Math.min(Constants.CANVAS_WIDTH, Constants.CANVAS_HEIGHT);
@@ -5,21 +5,34 @@
5
5
  * @version 0.0.5
6
6
  */
7
7
  var Renderer = /** @class */ (function () {
8
+ // No need to instantiate this class.
8
9
  function Renderer() {
9
10
  this.doc = document;
10
11
  }
12
+ Renderer.get = function () {
13
+ if (!Renderer._instance) {
14
+ Renderer._instance = new Renderer();
15
+ }
16
+ return Renderer._instance;
17
+ };
11
18
  /**
12
- * Get width of the browser
13
- * @return {number} inner width of the browser
19
+ * Get width of the parent most container where the Cooee's root div will render.
20
+ * @return width of the parent most container.
14
21
  */
15
22
  Renderer.prototype.getWidth = function () {
23
+ if (this.parentContainer) {
24
+ return this.parentContainer.clientWidth;
25
+ }
16
26
  return document.documentElement.clientWidth;
17
27
  };
18
28
  /**
19
- * Get height of the browser
20
- * @return {number} inner height of the browser
29
+ * Get height of the parent most container where the Cooee's root div will render.
30
+ * @return height of the parent most container.
21
31
  */
22
32
  Renderer.prototype.getHeight = function () {
33
+ if (this.parentContainer) {
34
+ return this.parentContainer.clientHeight;
35
+ }
23
36
  return document.documentElement.clientHeight;
24
37
  };
25
38
  /**
@@ -72,6 +85,13 @@ var Renderer = /** @class */ (function () {
72
85
  Renderer.prototype.getElementById = function (id) {
73
86
  return this.doc.getElementById(id);
74
87
  };
88
+ /**
89
+ * Set the parent most container where the Cooee's In-App's root div will render.
90
+ * @param container The HTML holder element.
91
+ */
92
+ Renderer.prototype.setParentContainer = function (container) {
93
+ this.parentContainer = container;
94
+ };
75
95
  return Renderer;
76
96
  }());
77
97
  export { Renderer };
@@ -1,5 +1,6 @@
1
1
  import { Constants } from '../constants';
2
2
  import { Renderer } from './renderer';
3
+ import { ClickActionExecutor } from '../models/trigger/action/click-action-executor';
3
4
  /**
4
5
  * Renders root container.
5
6
  *
@@ -7,8 +8,10 @@ import { Renderer } from './renderer';
7
8
  * @version 0.0.5
8
9
  */
9
10
  var RootContainerRenderer = /** @class */ (function () {
10
- function RootContainerRenderer() {
11
- this.renderer = new Renderer();
11
+ function RootContainerRenderer(parent) {
12
+ this.parent = parent;
13
+ this.renderer = Renderer.get();
14
+ this.renderer.setParentContainer(parent);
12
15
  }
13
16
  /**
14
17
  * Render root container.
@@ -19,13 +22,21 @@ var RootContainerRenderer = /** @class */ (function () {
19
22
  var rootDiv = this.renderer.createElement('div');
20
23
  rootDiv.id = Constants.IN_APP_CONTAINER_NAME;
21
24
  rootDiv.classList.add(Constants.IN_APP_CONTAINER_NAME);
25
+ if (this.parent) {
26
+ this.renderer.setStyle(rootDiv, 'position', 'absolute');
27
+ }
28
+ else {
29
+ this.renderer.setStyle(rootDiv, 'position', 'fixed');
30
+ }
22
31
  this.renderer.setStyle(rootDiv, 'z-index', '10000000');
23
- this.renderer.setStyle(rootDiv, 'position', 'fixed');
24
32
  this.renderer.setStyle(rootDiv, 'top', '0');
25
33
  this.renderer.setStyle(rootDiv, 'left', '0');
26
34
  this.renderer.setStyle(rootDiv, 'width', '100%');
27
35
  this.renderer.setStyle(rootDiv, 'height', '100%');
28
- this.renderer.appendChild(document.body, rootDiv);
36
+ this.renderer.appendChild(this.parent || document.body, rootDiv);
37
+ rootDiv.addEventListener('click', function () {
38
+ new ClickActionExecutor({ close: true }).execute();
39
+ });
29
40
  return rootDiv;
30
41
  };
31
42
  // noinspection JSMethodCanBeStatic
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see sdk-preview.min.js.LICENSE.txt */
2
- !function(){var t={489:function(t){for(var e=Math.floor(16777215*Math.random()),r=u.index=parseInt(16777215*Math.random(),10),n=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,i=function(t){return!(null==t||!t.constructor||"function"!=typeof t.constructor.isBuffer||!t.constructor.isBuffer(t))},o=[],s=0;s<256;s++)o[s]=(s<=15?"0":"")+s.toString(16);var a=new RegExp("^[0-9a-fA-F]{24}$"),c=[];for(s=0;s<10;)c[48+s]=s++;for(;s<16;)c[55+s]=c[87+s]=s++;function u(t){if(!(this instanceof u))return new u(t);if(t&&(t instanceof u||"ObjectID"===t._bsontype))return t;if(this._bsontype="ObjectID",null!=t&&"number"!=typeof t){var e=u.isValid(t);if(!e&&null!=t)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&"string"==typeof t&&24===t.length)return u.createFromHexString(t);if(null==t||12!==t.length){if(null!=t&&"function"==typeof t.toHexString)return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=t}else this.id=this.generate(t)}t.exports=u,u.default=u,u.createFromTime=function(t){return new u((8,(8===(e=(e=t=parseInt(t,10)%4294967295).toString(16)).length?e:"00000000".substring(e.length,8)+e)+"0000000000000000"));var e},u.createFromHexString=function(t){if(void 0===t||null!=t&&24!==t.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",r=0;r<24;)e+=String.fromCharCode(c[t.charCodeAt(r++)]<<4|c[t.charCodeAt(r++)]);return new u(e)},u.isValid=function(t){return null!=t&&("number"==typeof t||("string"==typeof t?12===t.length||24===t.length&&a.test(t):t instanceof u||!!i(t)||"function"==typeof t.toHexString&&(t.id instanceof _Buffer||"string"==typeof t.id)&&(12===t.id.length||24===t.id.length&&a.test(t.id))))},u.prototype={constructor:u,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=o[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof u?this.toString()===t.toString():"string"==typeof t&&u.isValid(t)&&12===t.length&&i(this.id)?t===this.id.toString("binary"):"string"==typeof t&&u.isValid(t)&&24===t.length?t.toLowerCase()===this.toHexString():"string"==typeof t&&u.isValid(t)&&12===t.length?t===this.id:!(null==t||!(t instanceof u||t.toHexString))&&t.toHexString()===this.toHexString()},getTimestamp:function(){var t,e=new Date;return t=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,e.setTime(1e3*Math.floor(t)),e},generate:function(t){"number"!=typeof t&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var i=r=(r+1)%16777215;return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t,e>>16&255,e>>8&255,255&e,n>>8&255,255&n,i>>16&255,i>>8&255,255&i)}};var l=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";u.prototype[l]=function(){return"ObjectID("+this+")"},u.prototype.toJSON=u.prototype.toHexString,u.prototype.toString=u.prototype.toHexString},238:function(t,e,r){var n;!function(i,o){"use strict";var s="function",a="undefined",c="object",u="string",l="model",p="name",h="type",f="vendor",d="version",b="architecture",g="console",v="mobile",y="tablet",w="smarttv",m="wearable",S="embedded",E={extend:function(t,e){var r={};for(var n in t)e[n]&&e[n].length%2==0?r[n]=e[n].concat(t[n]):r[n]=t[n];return r},has:function(t,e){return typeof t===u&&-1!==e.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return typeof t===u?t.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(t,e){return t=t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),typeof e===a?t:t.substring(0,255)}},T={rgx:function(t,e){for(var r,n,i,a,u,l,p=0;p<e.length&&!u;){var h=e[p],f=e[p+1];for(r=n=0;r<h.length&&!u;)if(u=h[r++].exec(t))for(i=0;i<f.length;i++)l=u[++n],typeof(a=f[i])===c&&a.length>0?2==a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3==a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):o:this[a[0]]=l?a[1].call(this,l,a[2]):o:4==a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):o):this[a]=l||o;p+=2}},str:function(t,e){for(var r in e)if(typeof e[r]===c&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(E.has(e[r][n],t))return"?"===r?o:r}else if(E.has(e[r],t))return"?"===r?o:r;return t}},_={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},A={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[p,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[p,d],[/opios[\/\s]+([\w\.]+)/i],[d,[p,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[d,[p,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,d],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[d,[p,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[d,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[p,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[d,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure Browser"],d],[/focus\/([\w\.]+)/i],[d,[p,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[d,[p,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[d,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[p,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[p,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[d,[p,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[p,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],d],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[p,d],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[p],[/;fbav\/([\w\.]+);/i],[d,[p,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[p,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[p,d],[/\bgsa\/([\w\.]+)\s.*safari\//i],[d,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[p,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],d],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[d,[p,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[p,d],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[p,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[p,[d,T.str,_.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[p,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[p,"Netscape"],d],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[d,[p,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[p,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,E.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[b,/ower/,"",E.lowerize]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,E.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[l,[f,"Samsung"],[h,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[l,[f,"Samsung"],[h,v]],[/\((ip(?:hone|od)[\s\w]*);/i],[l,[f,"Apple"],[h,v]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,"Apple"],[h,y]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[l,[f,"Huawei"],[h,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[l,[f,"Huawei"],[h,v]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[l,/_/g," "],[f,"Xiaomi"],[h,v]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[l,/_/g," "],[f,"Xiaomi"],[h,y]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[f,"OPPO"],[h,v]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[l,[f,"Vivo"],[h,v]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[l,[f,"Realme"],[h,v]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[l,[f,"Motorola"],[h,v]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[f,"Motorola"],[h,y]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[l,[f,"LG"],[h,y]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[l,[f,"LG"],[h,v]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[l,[f,"Lenovo"],[h,y]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[l,/_/g," "],[f,"Nokia"],[h,v]],[/droid.+;\s(pixel\sc)[\s)]/i],[l,[f,"Google"],[h,y]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[l,[f,"Google"],[h,v]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,"Sony"],[h,v]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[l,"Xperia Tablet"],[f,"Sony"],[h,y]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[l,[f,"OnePlus"],[h,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[l,[f,"Amazon"],[h,y]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[l,"Fire Phone"],[f,"Amazon"],[h,v]],[/\((playbook);[\w\s\),;-]+(rim)/i],[l,f,[h,y]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[l,[f,"BlackBerry"],[h,v]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[l,[f,"ASUS"],[h,y]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[l,[f,"ASUS"],[h,v]],[/(nexus\s9)/i],[l,[f,"HTC"],[h,y]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[l,/_/g," "],[h,v]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[l,[f,"Acer"],[h,y]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[l,[f,"Meizu"],[h,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,l,[h,v]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[f,l,[h,y]],[/\s(surface\sduo)\s/i],[l,[f,"Microsoft"],[h,y]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[l,[f,"Fairphone"],[h,v]],[/\s(u304aa)\sbuild/i],[l,[f,"AT&T"],[h,v]],[/sie-(\w*)/i],[l,[f,"Siemens"],[h,v]],[/[;\/]\s?(rct\w+)\sbuild/i],[l,[f,"RCA"],[h,y]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[l,[f,"Dell"],[h,y]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[l,[f,"Verizon"],[h,y]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[l,[f,"Barnes & Noble"],[h,y]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[l,[f,"NuVision"],[h,y]],[/;\s(k88)\sbuild/i],[l,[f,"ZTE"],[h,y]],[/;\s(nx\d{3}j)\sbuild/i],[l,[f,"ZTE"],[h,v]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[l,[f,"Swiss"],[h,v]],[/[;\/]\s?(zur\d{3})\sbuild/i],[l,[f,"Swiss"],[h,y]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[l,[f,"Zeki"],[h,y]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[f,"Dragon Touch"],l,[h,y]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[l,[f,"Insignia"],[h,y]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[l,[f,"NextBook"],[h,y]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[f,"Voice"],l,[h,v]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[f,"LvTel"],l,[h,v]],[/;\s(ph-1)\s/i],[l,[f,"Essential"],[h,v]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[l,[f,"Envizen"],[h,y]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[l,[f,"MachSpeed"],[h,y]],[/[;\/]\s?tu_(1491)\sbuild/i],[l,[f,"Rotor"],[h,y]],[/(shield[\w\s]+)\sbuild/i],[l,[f,"Nvidia"],[h,y]],[/(sprint)\s(\w+)/i],[f,l,[h,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,"Microsoft"],[h,v]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,"Zebra"],[h,y]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,"Zebra"],[h,v]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[f,l,[h,g]],[/droid.+;\s(shield)\sbuild/i],[l,[f,"Nvidia"],[h,g]],[/(playstation\s[345portablevi]+)/i],[l,[f,"Sony"],[h,g]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[l,[f,"Microsoft"],[h,g]],[/smart-tv.+(samsung)/i],[f,[h,w]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,"Samsung"],[h,w]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[f,"LG"],[h,w]],[/(apple)\s?tv/i],[f,[l,"Apple TV"],[h,w]],[/crkey/i],[[l,"Chromecast"],[f,"Google"],[h,w]],[/droid.+aft([\w])(\sbuild\/|\))/i],[l,[f,"Amazon"],[h,w]],[/\(dtv[\);].+(aquos)/i],[l,[f,"Sharp"],[h,w]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,E.trim],[l,E.trim],[h,w]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[h,w]],[/((pebble))app\/[\d\.]+\s/i],[f,l,[h,m]],[/droid.+;\s(glass)\s\d/i],[l,[f,"Google"],[h,m]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[l,[f,"Zebra"],[h,m]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[f,[h,S]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[l,[h,v]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[l,[h,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,E.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[f,"Generic"]],[/(phone)/i],[[h,v]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[p,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,p]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[p,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[p,[d,T.str,_.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[p,"Windows"],[d,T.str,_.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[p,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[p,"Mac OS"],[d,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[p,d],[/\(bb(10);/i],[d,[p,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[d,[p,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[p,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[p,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[p,"Chromium OS"],d],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[p,d],[/(sunos)\s?([\w\.\d]*)/i],[[p,"Solaris"],d],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[p,d]]},I=function(t,e){if("object"==typeof t&&(e=t,t=o),!(this instanceof I))return new I(t,e).getResult();var r=t||(void 0!==i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=e?E.extend(A,e):A;return this.getBrowser=function(){var t={name:o,version:o};return T.rgx.call(t,r,n.browser),t.major=E.major(t.version),t},this.getCPU=function(){var t={architecture:o};return T.rgx.call(t,r,n.cpu),t},this.getDevice=function(){var t={vendor:o,model:o,type:o};return T.rgx.call(t,r,n.device),t},this.getEngine=function(){var t={name:o,version:o};return T.rgx.call(t,r,n.engine),t},this.getOS=function(){var t={name:o,version:o};return T.rgx.call(t,r,n.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(t){return r=typeof t===u&&t.length>255?E.trim(t,255):t,this},this.setUA(r),this};I.VERSION="0.7.28",I.BROWSER={NAME:p,MAJOR:"major",VERSION:d},I.CPU={ARCHITECTURE:b},I.DEVICE={MODEL:l,VENDOR:f,TYPE:h,CONSOLE:g,MOBILE:v,SMARTTV:w,TABLET:y,WEARABLE:m,EMBEDDED:S},I.ENGINE={NAME:p,VERSION:d},I.OS={NAME:p,VERSION:d},typeof e!==a?(t.exports&&(e=t.exports=I),e.UAParser=I):(n=function(){return I}.call(e,r,e,t))===o||(t.exports=n);var x=void 0!==i&&(i.jQuery||i.Zepto);if(x&&!x.ua){var O=new I;x.ua=O.getResult(),x.ua.get=function(){return O.getUA()},x.ua.set=function(t){O.setUA(t);var e=O.getResult();for(var r in e)x.ua[r]=e[r]}}}("object"==typeof window?window:this)},306:function(t){"use strict";t.exports={i8:"0.0.7"}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var n={};!function(){"use strict";r.d(n,{default:function(){return re}});var t=function(){function t(){}var e;return t.API_URL="https://api.sdk.letscooee.com",t.SDK_VERSION=r(306).i8,t.SDK_DEBUG=!1,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.CANVAS_WIDTH=1080,t.CANVAS_HEIGHT=1920,t.STORAGE_USER_ID="uid",t.STORAGE_SDK_TOKEN="st",t.STORAGE_DEVICE_UUID="uuid",t.STORAGE_SESSION_ID="sid",t.STORAGE_SESSION_NUMBER="sn",t.STORAGE_SESSION_START_TIME="sst",t.STORAGE_SESSION_START_EVENT_SENT="sses",t.STORAGE_FIRST_TIME_LAUNCH="ifl",t.STORAGE_LAST_ACTIVE="la",t.STORAGE_TRIGGER_START_TIME="tst",t.STORAGE_ACTIVE_TRIGGER="at",t.STORAGE_ACTIVE_TRIGGERS="ats",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_CONTAINER_NAME="cooee-wrapper",e=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(e,10),t}(),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},i=function(){function r(){}return r.log=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.log.apply(console,e([t.LOG_PREFIX,":"],r,!1))},r.error=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.error.apply(console,e([t.LOG_PREFIX,":"],r,!1))},r.warning=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.warn.apply(console,e([t.LOG_PREFIX,":"],r,!1))},r}(),o=function(){function t(t){t.s&&(this.s=new u(t.s)),t.g&&(this.g=new h(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const s=new RegExp("[^#a-f\\d]","gi"),a=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var c,u=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||s.test(t)||!a.test(t))throw new TypeError("Expected a valid hex string");let r=1;8===(t=t.replace(/^#/,"")).length&&(r=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(r=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const n=Number.parseInt(t,16),i=n>>16,o=n>>8&255,c=255&n,u="number"==typeof e.alpha?e.alpha:r;return"array"===e.format?[i,o,c,u]:"css"===e.format?`rgb(${i} ${o} ${c}${1===u?"":` / ${Number((100*u).toFixed(2))}%`})`:{red:i,green:o,blue:c,alpha:u}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),l=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new u(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return c[null!==(t=this.s)&&void 0!==t?t:c.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(c||(c={}));var p,h=function(){function t(t){this.r=t.r,t.c&&(this.c=new u(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),t}(),f=(Object.defineProperty(function(){}.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),function(){function t(t){this.t=t.t,t.bg&&(this.bg=new o(t.bg)),t.br&&(this.br=new l(t.br)),this.clc=t.clc,this.shd=t.shd,this.spc=t.spc,this.trf=t.trf,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y}return Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return p[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}());!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(p||(p={}));var d,b,g=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),v=function(t){function e(e){return t.call(this,e)||this}return g(e,t),e}(f),y=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),w=function(t){function e(e){var r=t.call(this,e)||this;return r.src=e.src,r}return y(e,t),e}(f),m=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),S=function(t){function e(e){var r=t.call(this,e)||this;return r.alg=d.START,r.prs=e.prs,r.alg=e.alg,e.f&&(r.f=e.f),e.c&&(r.c=new u(e.c)),r}return m(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(f);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(d||(d={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(b||(b={}));var E,T=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_=function(t){function e(e){var r,n=t.call(this,e)||this;return n.o=null!==(r=e.o)&&void 0!==r?r:E.C,n}return T(e,t),e.prototype.getStyles=function(){var t;return(t=this.o===E.NW?{top:0,left:0}:this.o===E.N?{top:0,left:"50%",transform:"translateX(-50%)"}:this.o===E.NE?{top:0,right:0}:this.o===E.E?{top:"50%",left:0,transform:"translateY(-50%)"}:this.o===E.SE?{bottom:0,right:0}:this.o===E.S?{bottom:0,left:"50%",transform:"translateX(-50%)"}:this.o===E.SW?{bottom:0,left:0}:this.o===E.W?{top:"50%",left:0,transform:"translateY(-50%)"}:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"}).position="absolute",t},e}(f);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(E||(E={}));var A=function(t){var e=this;this.elems=[],this.cont=new _(t.cont),t.elems.forEach((function(t){t.t===p.IMAGE?e.elems.push(new w(t)):t.t===p.TEXT||t.t===p.BUTTON?e.elems.push(new S(t)):t.t===p.SHAPE&&e.elems.push(new v(t))}))},I=function(t){this.expireAt=(new Date).getTime(),this.id=t.id,this.expireAt=t.expireAt,this.version=t.version,this.engagementID=t.engagementID,this.internal=t.internal,this.pn=t.pn,this.ian=new A(t.ian)},x=function(){function t(){}return t.getString=function(e,r){return t.LOCAL_STORAGE.getItem(e)||r},t.setString=function(e,r){r||(r=""),t.LOCAL_STORAGE.setItem(e,r)},t.getNumber=function(e,r){return+t.getString(e,"")||r},t.setNumber=function(e,r){t.setString(e,r.toString())},t.getBoolean=function(t,e){var r=this.LOCAL_STORAGE.getItem(t);return r?JSON.parse(r):e},t.setBoolean=function(e,r){t.setString(e,JSON.stringify(r))},t.getObject=function(e){try{return JSON.parse(t.getString(e,""))}catch(t){return null}},t.setObject=function(e,r){t.setString(e,JSON.stringify(r))},t.remove=function(e){t.LOCAL_STORAGE.removeItem(e)},t.LOCAL_STORAGE=window.localStorage,t}(),O=function(){function t(){this.doc=document}return t.prototype.getWidth=function(){return document.documentElement.clientWidth},t.prototype.getHeight=function(){return document.documentElement.clientHeight},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,r){e&&(r?t.style.setProperty(e,r):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,r){t.setAttribute(e,r)},t.prototype.getElementById=function(t){return this.doc.getElementById(t)},t}(),N=r(238),k=r.n(N),C=r(489),D=r.n(C),R=function(){function e(){this.inInactive=!0,this.lastEnterActive=new Date,this.lastEnterInactive=null,this.isDebug=!1}return e.getInstance=function(){return this.INSTANCE},e.prototype.getWebAppVersion=function(){var t;return null!==(t=this.webAppVersion)&&void 0!==t?t:"0.0.1+1"},e.prototype.setWebAppVersion=function(t){this.webAppVersion=t},e.prototype.isDebugWebApp=function(){return this.isDebug},e.prototype.setDebugWebApp=function(t){this.isDebug=t},e.prototype.isInactive=function(){return this.inInactive},e.prototype.setInactive=function(){this.inInactive=!0,this.lastEnterInactive=new Date,x.setNumber(t.STORAGE_LAST_ACTIVE,this.lastEnterInactive.getTime())},e.prototype.setActive=function(){this.inInactive=!1,this.lastEnterActive=new Date},e.prototype.isFirstActive=function(){return null==this.lastEnterInactive},e.prototype.getLastEnterInactive=function(){return this.lastEnterInactive},e.prototype.getTimeForActiveInSeconds=function(){var t,e;return((null===(t=this.lastEnterInactive)||void 0===t?void 0:t.getTime())-(null===(e=this.lastEnterActive)||void 0===e?void 0:e.getTime()))/1e3},e.prototype.getTimeForInactiveInSeconds=function(){return null==this.lastEnterInactive?0:((new Date).getTime()-this.lastEnterInactive.getTime())/1e3},e.INSTANCE=new e,e}(),P=function(){function e(){}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.getCurrentSessionID=function(){return this.currentSessionID||null},e.prototype.isNewSessionRequired=function(){if(!x.getString(t.STORAGE_SESSION_ID,""))return!0;var e=x.getNumber(t.STORAGE_SESSION_START_TIME,0);return((new Date).getTime()-e)/1e3>t.IDLE_TIME_IN_SECONDS},e.prototype.checkForNewSession=function(){this.isNewSessionRequired()?this.startNewSession():this.initializeSessionFromStorage()},e.prototype.startNewSession=function(){this.currentSessionID||(x.setBoolean(t.STORAGE_SESSION_START_EVENT_SENT,!1),this.currentSessionStartTime=new Date,this.currentSessionID=(new(D())).toHexString(),x.setNumber(t.STORAGE_SESSION_START_TIME,this.currentSessionStartTime.getTime()),x.setString(t.STORAGE_SESSION_ID,this.currentSessionID),this.bumpSessionNumber())},e.prototype.bumpSessionNumber=function(){this.currentSessionNumber=x.getNumber(t.STORAGE_SESSION_NUMBER,0),this.currentSessionNumber+=1,x.setNumber(t.STORAGE_SESSION_NUMBER,this.currentSessionNumber)},e.prototype.getCurrentSessionNumber=function(){return this.currentSessionNumber||0},e.prototype.getTotalDurationInSeconds=function(){if(R.getInstance().isFirstActive())throw new Error("This is the first time in foreground after launch");return(this.getLastActive()-this.currentSessionStartTime.getTime())/1e3},e.prototype.conclude=function(){var e={sessionID:this.currentSessionID,occurred:new Date,duration:this.getTotalDurationInSeconds()};Bt.getInstance().concludeSession(e),x.remove(t.STORAGE_ACTIVE_TRIGGER),this.destroySession()},e.prototype.destroySession=function(){this.currentSessionID=void 0,this.currentSessionNumber=void 0,this.currentSessionStartTime=void 0,x.remove(t.STORAGE_SESSION_ID),x.remove(t.STORAGE_SESSION_START_TIME)},e.prototype.initializeSessionFromStorage=function(){this.currentSessionStartTime=new Date(x.getNumber(t.STORAGE_SESSION_START_TIME,0)),this.currentSessionID=x.getString(t.STORAGE_SESSION_ID,""),this.currentSessionNumber=x.getNumber(t.STORAGE_SESSION_NUMBER,0)},e.prototype.getLastActive=function(){return x.getNumber(t.STORAGE_LAST_ACTIVE,0)},e}(),M=function(t,e){void 0===e&&(e={}),this.name=t,this.properties=e,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.activeTriggers=[],this.occurred=(new Date).toISOString()},L=function(){function t(t){this.triggerID=t.id,this.engagementID=t.engagementID,this.expireAt=t.expireAt,this.isExpired&&(this.expired=this.isExpired)}return Object.defineProperty(t.prototype,"isExpired",{get:function(){return this.expireAt<(new Date).getTime()},enumerable:!1,configurable:!0}),t}(),G=function(){function e(){}return e.storeActiveTrigger=function(e){var r=x.getObject(t.STORAGE_ACTIVE_TRIGGERS);r||(r=[]);var n=new L(e);n.isExpired||r.push(n),x.setObject(t.STORAGE_ACTIVE_TRIGGER,n),x.setObject(t.STORAGE_ACTIVE_TRIGGERS,r)},e.getActiveTriggers=function(){var e=x.getObject(t.STORAGE_ACTIVE_TRIGGERS);return e?(e.forEach((function(t,e,r){new L(t).isExpired&&r.splice(e,1)})),x.setObject(t.STORAGE_ACTIVE_TRIGGERS,e),e):[]},e}(),H=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},j=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},B=function(){function e(){this.runtimeData=R.getInstance(),this.apiToken="",this.userID=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.doHTTP=function(e,r,n,i){return H(this,void 0,void 0,(function(){var o,s;return j(this,(function(a){switch(a.label){case 0:return r.startsWith("http")||(r=t.API_URL+r),!("keepalive"in new Request(""))&&JSON.stringify(n).includes("CE App Background")?((o=new XMLHttpRequest).open("POST",r,!1),i.forEach((function(t,e){o.setRequestHeader(e,t)})),o.send(JSON.stringify(n)),[2,o.response.json()]):[4,fetch(r,{method:e,body:JSON.stringify(n),headers:i,keepalive:!0})];case 1:if(!(s=a.sent()).ok)throw s;return[2,s.json()]}}))}))},e.prototype.registerDevice=function(t){return H(this,void 0,void 0,(function(){return j(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",t,this.getDefaultHeaders())]}))}))},e.prototype.sendEvent=function(e){var r=this.getDefaultHeaders();r.append("x-sdk-token",this.apiToken),e.activeTriggers=G.getActiveTriggers();var n=x.getObject(t.STORAGE_ACTIVE_TRIGGER);n&&(e.trigger=n),this.doHTTP("POST","/v1/event/track",e,r).then((function(t){i.log("Sent",e.name),t.triggerData&&(new ee).render(t.triggerData)})).catch((function(t){i.error("Error sending event",t)}))},e.prototype.updateUserData=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("PUT","/v1/user/update",t,e).then((function(){i.log("Updated user profile")})).catch((function(t){i.error("Error saving user profile",t)}))},e.prototype.concludeSession=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("POST","/v1/session/conclude",t,e).then((function(t){i.log("Conclude Session",t)})).catch((function(t){i.error(t)}))},e.prototype.getDefaultHeaders=function(){var e=new Headers;return e.set("sdk-version",t.SDK_VERSION),e.set("sdk-version-code",t.SDK_VERSION_CODE.toString()),e.set("app-version",this.runtimeData.getWebAppVersion()),e.set("user-id",this.userID),t.SDK_DEBUG&&e.set("sdk-debug",String(1)),this.runtimeData.isDebugWebApp()&&e.set("app-debug",String(1)),e},e.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},e.prototype.setUserId=function(t){this.userID=null!=t?t:""},e.INSTANCE=new e,e}(),U=function(e,r,n,i){this.appID=e,this.appSecret=r,this.uuid=n,this.props=i,this.sdk=t.SDK},F=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},V=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},z=function(){function t(){this.parser=new(k()),this.result={}}return t.prototype.get=function(){return F(this,void 0,void 0,(function(){var t;return V(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,r=t.offsetWidth*e;return document.body.removeChild(t),r},t.prototype.getLocation=function(){return F(this,void 0,void 0,(function(){var t=this;return V(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(r){t.result.coords=[r.coords.latitude,r.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return F(this,void 0,void 0,(function(){var t;return V(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),W=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},q=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},K=function(){function e(){this.apiService=B.getInstance(),this.sdkToken="",this.userID="",this.appID="",this.appSecret=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.init=function(t,e){return this.appID=t,this.appSecret=e,this.acquireSDKToken()},e.prototype.hasToken=function(){return!!x.getString(t.STORAGE_SDK_TOKEN,"")},e.prototype.getUserID=function(){return this.userID},e.prototype.populateUserDataFromStorage=function(){return W(this,void 0,void 0,(function(){return q(this,(function(e){return this.sdkToken=x.getString(t.STORAGE_SDK_TOKEN,""),this.sdkToken||i.log("No SDK token found in local storage"),this.userID=x.getString(t.STORAGE_USER_ID,""),this.userID||i.log("No user ID found in local storage"),this.updateAPIClient(),[2]}))}))},e.prototype.updateAPIClient=function(){i.log("SDK Token:",this.sdkToken),i.log("User ID:",this.userID),this.apiService.setAPIToken(this.sdkToken),this.apiService.setUserId(this.userID)},e.prototype.acquireSDKToken=function(){return W(this,void 0,void 0,(function(){return q(this,(function(t){return this.hasToken()?[2,this.populateUserDataFromStorage()]:(i.log("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}))}))},e.prototype.getSDKTokenFromServer=function(){return W(this,void 0,void 0,(function(){var t,e,r,n;return q(this,(function(o){switch(o.label){case 0:return[4,this.getUserAuthRequest()];case 1:t=o.sent(),e=this.apiService.registerDevice(t),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,e];case 3:return r=o.sent(),i.log("Register Device Response",r),this.saveUserDataInStorage(r),[3,5];case 4:throw n=o.sent(),i.error(n),n;case 5:return[2]}}))}))},e.prototype.saveUserDataInStorage=function(e){this.sdkToken=e.sdkToken,this.userID=e.id,this.updateAPIClient(),x.setString(t.STORAGE_SDK_TOKEN,this.sdkToken),x.setString(t.STORAGE_USER_ID,this.userID)},e.prototype.getUserAuthRequest=function(){return W(this,void 0,void 0,(function(){var t;return q(this,(function(e){switch(e.label){case 0:return[4,(new z).get()];case 1:return t=e.sent(),[2,new U(this.appID,this.appSecret,this.getOrCreateUUID(),t)]}}))}))},e.prototype.getOrCreateUUID=function(){var e=x.getString(t.STORAGE_DEVICE_UUID,"");return e||(e=(new(D())).toHexString(),x.setString(t.STORAGE_DEVICE_UUID,e)),e},e.INSTANCE=new e,e}(),X=function(t,e){return(X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(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 r(){this.constructor=t}X(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function J(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function Z(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t}function Q(t){return"function"==typeof t}function tt(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var et=tt((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function rt(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var nt=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=null}var e;return t.prototype.unsubscribe=function(){var t,e,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=J(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(Q(c))try{c()}catch(t){i=t instanceof et?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var l=J(u),p=l.next();!p.done;p=l.next()){var h=p.value;try{st(h)}catch(t){i=null!=i?i:[],t instanceof et?i=Z(Z([],Y(i)),Y(t.errors)):i.push(t)}}}catch(t){r={error:t}}finally{try{p&&!p.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new et(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)st(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(r=this._teardowns)&&void 0!==r?r:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&rt(e,t)},t.prototype.remove=function(e){var r=this._teardowns;r&&rt(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),it=nt.EMPTY;function ot(t){return t instanceof nt||t&&"closed"in t&&Q(t.remove)&&Q(t.add)&&Q(t.unsubscribe)}function st(t){Q(t)?t():t.unsubscribe()}var at=null,ct=null,ut=void 0,lt=!1,pt=!1,ht={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=ht.delegate;return((null==r?void 0:r.setTimeout)||setTimeout).apply(void 0,Z([],Y(t)))},clearTimeout:function(t){var e=ht.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ft(t){ht.setTimeout((function(){if(!at)throw t;at(t)}))}function dt(){}var bt=gt("C",void 0,void 0);function gt(t,e,r){return{kind:t,value:e,error:r}}var vt=null;function yt(t){if(lt){var e=!vt;if(e&&(vt={errorThrown:!1,error:null}),t(),e){var r=vt,n=r.errorThrown,i=r.error;if(vt=null,n)throw i}}else t()}function wt(t){lt&&vt&&(vt.errorThrown=!0,vt.error=t)}var mt=function(t){function e(e){var r=t.call(this)||this;return r.isStopped=!1,e?(r.destination=e,ot(e)&&e.add(r)):r.destination=At,r}return $(e,t),e.create=function(t,e,r){return new St(t,e,r)},e.prototype.next=function(t){this.isStopped?_t(function(t){return gt("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?_t(gt("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?_t(bt,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(nt),St=function(t){function e(e,r,n){var i,o=t.call(this)||this;if(Q(e))i=e;else if(e){var s;i=e.next,r=e.error,n=e.complete,o&&pt?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),r=null==r?void 0:r.bind(s),n=null==n?void 0:n.bind(s)}return o.destination={next:i?Et(i):dt,error:Et(null!=r?r:Tt),complete:n?Et(n):dt},o}return $(e,t),e}(mt);function Et(t,e){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{t.apply(void 0,Z([],Y(e)))}catch(t){lt?wt(t):ft(t)}}}function Tt(t){throw t}function _t(t,e){var r=ct;r&&ht.setTimeout((function(){return r(t,e)}))}var At={closed:!0,next:dt,error:Tt,complete:dt},It="function"==typeof Symbol&&Symbol.observable||"@@observable";function xt(t){return t}function Ot(t){return 0===t.length?xt:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Nt=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n,i=this,o=(n=t)&&n instanceof mt||function(t){return t&&Q(t.next)&&Q(t.error)&&Q(t.complete)}(n)&&ot(n)?t:new St(t,e,r);return yt((function(){var t=i,e=t.operator,r=t.source;o.add(e?e.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=kt(e))((function(e,n){var i;i=r.subscribe((function(e){try{t(e)}catch(t){n(t),null==i||i.unsubscribe()}}),n,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[It]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ot(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=kt(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function kt(t){var e;return null!==(e=null!=t?t:ut)&&void 0!==e?e:Promise}var Ct,Dt=tt((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Rt=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return $(e,t),e.prototype.lift=function(t){var e=new Pt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Dt},e.prototype.next=function(t){var e=this;yt((function(){var r,n;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=J(i),s=o.next();!s.done;s=o.next())s.value.next(t)}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}}))},e.prototype.error=function(t){var e=this;yt((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}}))},e.prototype.complete=function(){var t=this;yt((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,r=e.hasError,n=e.isStopped,i=e.observers;return r||n?it:(i.push(t),new nt((function(){return rt(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,n=e.thrownError,i=e.isStopped;r?t.error(n):i&&t.complete()},e.prototype.asObservable=function(){var t=new Nt;return t.source=this,t},e.create=function(t,e){return new Pt(t,e)},e}(Nt),Pt=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return $(e,t),e.prototype.next=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)},e.prototype.error=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:it},e}(Rt),Mt={now:function(){return(Mt.delegate||Date).now()},delegate:void 0},Lt=function(t){function e(e,r,n){void 0===e&&(e=1/0),void 0===r&&(r=1/0),void 0===n&&(n=Mt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,r),i}return $(e,t),e.prototype.next=function(e){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!t.closed;i+=r?1:2)t.next(n[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,r=t._timestampProvider,n=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}},e}(Rt),Gt=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},Ht=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},jt=function(){function e(){this.sessionManager=P.getInstance(),this.safeHttpCallService=Bt.getInstance(),this.userAuthService=K.getInstance()}return e.prototype.init=function(t,r){var n=this;this.userAuthService.init(t,r).then((function(){e.replaySubject.next(!0),e.replaySubject.complete()})).catch((function(){setTimeout((function(){n.init(t,r)}),3e4)})),this.execute()},e.prototype.execute=function(){this.sessionManager.checkForNewSession(),x.getBoolean(t.STORAGE_SESSION_START_EVENT_SENT,!1)||(x.setBoolean(t.STORAGE_SESSION_START_EVENT_SENT,!0),this.isAppFirstTimeLaunch()?this.sendFirstLaunchEvent():this.sendSuccessiveLaunchEvent())},e.prototype.isAppFirstTimeLaunch=function(){return!!x.getBoolean(t.STORAGE_FIRST_TIME_LAUNCH,!0)&&(x.setBoolean(t.STORAGE_FIRST_TIME_LAUNCH,!1),!0)},e.prototype.sendFirstLaunchEvent=function(){return Gt(this,void 0,void 0,(function(){var t,e;return Ht(this,(function(r){switch(r.label){case 0:return t=new M("CE App Installed",{}),e=t,[4,(new z).get()];case 1:return e.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(t),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return Gt(this,void 0,void 0,(function(){var t,e;return Ht(this,(function(r){switch(r.label){case 0:return t=new M("CE App Launched",{}),e=t,[4,(new z).get()];case 1:return e.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(t),[2]}}))}))},e.replaySubject=new Lt(1),e}(),Bt=function(){function t(){this.sessionManager=P.getInstance(),this.httpApiService=B.getInstance()}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.sendEvent=function(t){var e=this;jt.replaySubject.subscribe((function(){e.addEventVariable(t),e.httpApiService.sendEvent(t)}))},t.prototype.updateProfile=function(t){var e=this;jt.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},t.prototype.concludeSession=function(t){var e=this;jt.replaySubject.subscribe((function(){e.httpApiService.concludeSession(t)}))},t.prototype.addEventVariable=function(t){t.screenName=location.pathname,t.properties.path=location.pathname,t.sessionID=this.sessionManager.getCurrentSessionID(),t.sessionNumber=this.sessionManager.getCurrentSessionNumber()},t}();!function(t){t.Location="LOCATION",t.Push="PUSH",t.Camera="CAMERA"}(Ct||(Ct={}));var Ut=function(){function e(t){this.action=t,this.apiService=Bt.getInstance()}return e.prototype.execute=function(){this.externalAction(),this.iabAction(),this.upAction(),this.kvAction(),this.prompt(),this.closeAction(),this.shareAction()},e.prototype.externalAction=function(){var t;this.action.ext&&(null===(t=window.open(this.action.ext.u,"_blank"))||void 0===t||t.focus())},e.prototype.iabAction=function(){this.action.iab&&(new Zt).render(this.action.iab.u)},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.kvAction=function(){this.action.kv&&document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:this.action.kv}))},e.prototype.prompt=function(){var t=this.action.prompt;t&&(t===Ct.Location&&this.promptLocationPermission(),t===Ct.Push&&this.promptPushNotificationPermission(),t===Ct.Camera&&this.promptCameraPermission())},e.prototype.closeAction=function(){var e;if(this.action.close){(new Yt).removeInApp();var r=x.getNumber(t.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),n={triggerID:null===(e=x.getObject(t.STORAGE_ACTIVE_TRIGGER))||void 0===e?void 0:e.triggerID,"Close Behaviour":"CTA",Duration:((new Date).getTime()-r)/1e3};this.apiService.sendEvent(new M("CE Trigger Closed",n)),x.remove(t.STORAGE_TRIGGER_START_TIME)}},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):i.warning("Navigator.share is not compatible with this browser"))},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateProfile({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateProfile({pnPerm:Notification.permission}):i.warning("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return t=this,e=void 0,n=function(){var t,e,r;return function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(n){switch(n.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=n.sent(),[4,this.checkPermission("geolocation")];case 2:return e=n.sent(),r=Notification.permission,[2,{camera:t,location:e,notification:r}]}}))},new((r=void 0)||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}));var t,e,r,n},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateProfile({perm:e})}))},e}(),Ft=function(){function e(e,r){var n,i,o;this.screenWidth=0,this.screenHeight=0,this.scalingFactor=(i=document.documentElement.clientWidth,o=document.documentElement.clientHeight,n=i<o?i/Math.min(t.CANVAS_WIDTH,t.CANVAS_HEIGHT):o/Math.max(t.CANVAS_WIDTH,t.CANVAS_HEIGHT),Math.min(n,1)),this.parentHTMLEl=e,this.inappElement=r,this.renderer=new O,this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return e.prototype.getHTMLElement=function(){return this.inappHTMLEl},e.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},e.prototype.processCommonBlocks=function(){this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"overflow","visible"),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},e.prototype.processWidthAndHeight=function(){this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},e.prototype.getSizePx=function(t){return t*this.scalingFactor+"px"},e.prototype.processPositionBlock=function(){this.inappElement.x&&(this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)))},e.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},e.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.p&&this.renderer.setStyle(this.inappHTMLEl,"padding",this.getSizePx(t.p)),t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},e.prototype.processTransformBlock=function(){var t=this.inappElement.trf;t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate("+t.rotate+"deg)")},e.prototype.registerAction=function(){var t=this.inappElement.clc;t&&this.inappHTMLEl.addEventListener("click",(function(){new Ut(t).execute()}))},e.prototype.processBackgroundBlock=function(){var t,e=this.inappElement.bg;if(e){var r=this.inappHTMLEl;this.inappElement instanceof _&&(r=r.parentElement);var n="";if((null===(t=(new(k())).getBrowser().name)||void 0===t?void 0:t.toLowerCase().includes("safari"))&&(n="-webkit-"),e.glossy)this.renderer.setStyle(r,n+"backdrop-filter","blur("+e.glossy.radius+"px)"),e.glossy.color&&this.processColourBlock(e.glossy.color,"background",r);else if(e.solid)e.solid.grad?this.processGradient(e.solid.grad,"background"):e.solid.hex&&this.renderer.setStyle(r,"background",e.solid.rgba);else if(e.img){if(!e.img.src)return;var i='url("'+e.img.src+'") no-repeat center';this.renderer.setStyle(r,"background",i),this.renderer.setStyle(r,"background-size","cover"),e.img.a&&this.renderer.setStyle(r,n+"backdrop-filter","opacity("+e.img.a+")")}}},e.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var r="linear-gradient("+t.ang+"deg, "+t.c1+", "+t.c2;t.c3&&(r+=", "+t.c3),t.c4&&(r+=", "+t.c4),t.c5&&(r+=", "+t.c5);var n=r+=")";this.renderer.setStyle(this.inappHTMLEl,e,n)}},e.prototype.processColourBlock=function(t,e,r){void 0===e&&(e="color"),void 0===r&&(r=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(r,e,t.rgba))},e}(),Vt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zt=function(t){function e(e,r){return t.call(this,e,r)||this}return Vt(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t=this.inappElement.font;t&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(t.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",t.ff),this.renderer.setStyle(this.inappHTMLEl,"line-height",t.lh))},e.prototype.processPart=function(t,e){var r,n=[];e.u&&n.push("underline"),e.st&&n.push("line-through"),n.length||n.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",n.join(" ")),this.renderer.setStyle(t,"color",null!==(r=e.c)&&void 0!==r?r:"inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=d[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(Ft),Wt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.inappHTMLEl=n.renderer.createElement("div"),n.insertElement(),n}return Wt(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var r,n,i=e.renderer.createElement("span");i.innerHTML=null===(n=null===(r=t.txt)||void 0===r?void 0:r.toString())||void 0===n?void 0:n.replace(/\n/g,"<br />"),e.processPart(i,t),e.renderer.appendChild(e.inappHTMLEl,i)})),this.processCommonBlocks()},e}(zt),Kt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.inappHTMLEl=n.renderer.createElement("div"),n.insertElement(),n}return Kt(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(Ft),$t=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.inappHTMLEl=n.renderer.createElement("img"),n.insertElement(),n}return $t(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","100%"),this.renderer.setStyle(this.inappHTMLEl,"max-height","100%"),this.renderer.setStyle(this.inappHTMLEl,"display","block"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(Ft),Yt=function(){function e(){this.renderer=new O}return e.prototype.render=function(){this.removeInApp();var e=this.renderer.createElement("div");return e.id=t.IN_APP_CONTAINER_NAME,e.classList.add(t.IN_APP_CONTAINER_NAME),this.renderer.setStyle(e,"z-index","10000000"),this.renderer.setStyle(e,"position","fixed"),this.renderer.setStyle(e,"top","0"),this.renderer.setStyle(e,"left","0"),this.renderer.setStyle(e,"width","100%"),this.renderer.setStyle(e,"height","100%"),this.renderer.appendChild(document.body,e),e},e.prototype.removeInApp=function(){var e=document.getElementById(t.IN_APP_CONTAINER_NAME);e&&e.parentElement.removeChild(e)},e}(),Zt=function(){function e(){this.renderer=new O}return e.prototype.render=function(e){var r=this.renderer.getElementById(t.IN_APP_CONTAINER_NAME),n=this.createIFrameContainer();return this.createIFrameElement(n,e),this.createAnchorElement(r,n),this.renderer.appendChild(r,n),n},e.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},e.prototype.createIFrameElement=function(t,e){var r=this.renderer.createElement("iframe");return this.renderer.setStyle(r,"width","100%"),this.renderer.setStyle(r,"height","100%"),this.renderer.setAttribute(r,"src",e),this.renderer.setAttribute(r,"frameBorder","0"),this.renderer.appendChild(t,r),r},e.prototype.createAnchorElement=function(t,e){var r=this.renderer.createElement("a");return this.renderer.setStyle(r,"position","absolute"),this.renderer.setStyle(r,"top","0px"),this.renderer.setStyle(r,"right","0px"),r.href="#",r.innerHTML="Close",r.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,r),r},e}(),Qt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),te=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.inappHTMLEl=n.renderer.createElement("div"),n.insertElement(),n.inappElement.w=1080,n.inappElement.h=1920,n}return Qt(e,t),e.prototype.render=function(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),Object.assign(this.inappHTMLEl.style,this.inappElement.getStyles()),this},e}(Ft),ee=function(){function e(){this.rootContainer=(new Yt).render()}return e.prototype.render=function(e){e=new I(e),this.ian=e.ian;try{this.renderContainer();var r=new M("CE Trigger Displayed",{triggerID:e.id});Bt.getInstance().sendEvent(r),x.setNumber(t.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),G.storeActiveTrigger(e)}catch(t){i.error(t)}},e.prototype.renderElement=function(t,e){e instanceof S?new qt(t,e).render():e instanceof w?new Jt(t,e).render():e instanceof v?new Xt(t,e).render():i.error("Unsupported element type- "+e.type)},e.prototype.renderContainer=function(){var t,e,r=this,n=null===(t=this.ian)||void 0===t?void 0:t.cont;if(n){var i=new te(this.rootContainer,n).render().getHTMLElement();null===(e=this.ian.elems)||void 0===e||e.forEach((function(t){r.renderElement(i,t)}))}},e}(),re=ee}(),CooeePreview=n.default}();
2
+ !function(){var t={489:function(t){for(var e=Math.floor(16777215*Math.random()),r=u.index=parseInt(16777215*Math.random(),10),n=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,i=function(t){return!(null==t||!t.constructor||"function"!=typeof t.constructor.isBuffer||!t.constructor.isBuffer(t))},o=[],s=0;s<256;s++)o[s]=(s<=15?"0":"")+s.toString(16);var a=new RegExp("^[0-9a-fA-F]{24}$"),c=[];for(s=0;s<10;)c[48+s]=s++;for(;s<16;)c[55+s]=c[87+s]=s++;function u(t){if(!(this instanceof u))return new u(t);if(t&&(t instanceof u||"ObjectID"===t._bsontype))return t;if(this._bsontype="ObjectID",null!=t&&"number"!=typeof t){var e=u.isValid(t);if(!e&&null!=t)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&"string"==typeof t&&24===t.length)return u.createFromHexString(t);if(null==t||12!==t.length){if(null!=t&&"function"==typeof t.toHexString)return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=t}else this.id=this.generate(t)}t.exports=u,u.default=u,u.createFromTime=function(t){return new u((8,(8===(e=(e=t=parseInt(t,10)%4294967295).toString(16)).length?e:"00000000".substring(e.length,8)+e)+"0000000000000000"));var e},u.createFromHexString=function(t){if(void 0===t||null!=t&&24!==t.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",r=0;r<24;)e+=String.fromCharCode(c[t.charCodeAt(r++)]<<4|c[t.charCodeAt(r++)]);return new u(e)},u.isValid=function(t){return null!=t&&("number"==typeof t||("string"==typeof t?12===t.length||24===t.length&&a.test(t):t instanceof u||!!i(t)||"function"==typeof t.toHexString&&(t.id instanceof _Buffer||"string"==typeof t.id)&&(12===t.id.length||24===t.id.length&&a.test(t.id))))},u.prototype={constructor:u,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=o[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof u?this.toString()===t.toString():"string"==typeof t&&u.isValid(t)&&12===t.length&&i(this.id)?t===this.id.toString("binary"):"string"==typeof t&&u.isValid(t)&&24===t.length?t.toLowerCase()===this.toHexString():"string"==typeof t&&u.isValid(t)&&12===t.length?t===this.id:!(null==t||!(t instanceof u||t.toHexString))&&t.toHexString()===this.toHexString()},getTimestamp:function(){var t,e=new Date;return t=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,e.setTime(1e3*Math.floor(t)),e},generate:function(t){"number"!=typeof t&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var i=r=(r+1)%16777215;return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t,e>>16&255,e>>8&255,255&e,n>>8&255,255&n,i>>16&255,i>>8&255,255&i)}};var l=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";u.prototype[l]=function(){return"ObjectID("+this+")"},u.prototype.toJSON=u.prototype.toHexString,u.prototype.toString=u.prototype.toHexString},238:function(t,e,r){var n;!function(i,o){"use strict";var s="function",a="undefined",c="object",u="string",l="model",p="name",h="type",f="vendor",d="version",b="architecture",g="console",v="mobile",y="tablet",w="smarttv",m="wearable",S="embedded",E={extend:function(t,e){var r={};for(var n in t)e[n]&&e[n].length%2==0?r[n]=e[n].concat(t[n]):r[n]=t[n];return r},has:function(t,e){return typeof t===u&&-1!==e.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return typeof t===u?t.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(t,e){return t=t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),typeof e===a?t:t.substring(0,255)}},T={rgx:function(t,e){for(var r,n,i,a,u,l,p=0;p<e.length&&!u;){var h=e[p],f=e[p+1];for(r=n=0;r<h.length&&!u;)if(u=h[r++].exec(t))for(i=0;i<f.length;i++)l=u[++n],typeof(a=f[i])===c&&a.length>0?2==a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3==a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):o:this[a[0]]=l?a[1].call(this,l,a[2]):o:4==a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):o):this[a]=l||o;p+=2}},str:function(t,e){for(var r in e)if(typeof e[r]===c&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(E.has(e[r][n],t))return"?"===r?o:r}else if(E.has(e[r],t))return"?"===r?o:r;return t}},_={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},A={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[p,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[p,d],[/opios[\/\s]+([\w\.]+)/i],[d,[p,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[d,[p,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,d],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[d,[p,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[d,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[p,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[d,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure Browser"],d],[/focus\/([\w\.]+)/i],[d,[p,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[d,[p,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[d,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[p,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[p,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[d,[p,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[p,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],d],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[p,d],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[p],[/;fbav\/([\w\.]+);/i],[d,[p,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[p,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[p,d],[/\bgsa\/([\w\.]+)\s.*safari\//i],[d,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[p,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],d],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[d,[p,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[p,d],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[p,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[p,[d,T.str,_.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[p,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[p,"Netscape"],d],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[d,[p,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[p,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,E.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[b,/ower/,"",E.lowerize]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,E.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[l,[f,"Samsung"],[h,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[l,[f,"Samsung"],[h,v]],[/\((ip(?:hone|od)[\s\w]*);/i],[l,[f,"Apple"],[h,v]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,"Apple"],[h,y]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[l,[f,"Huawei"],[h,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[l,[f,"Huawei"],[h,v]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[l,/_/g," "],[f,"Xiaomi"],[h,v]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[l,/_/g," "],[f,"Xiaomi"],[h,y]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[f,"OPPO"],[h,v]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[l,[f,"Vivo"],[h,v]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[l,[f,"Realme"],[h,v]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[l,[f,"Motorola"],[h,v]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[f,"Motorola"],[h,y]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[l,[f,"LG"],[h,y]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[l,[f,"LG"],[h,v]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[l,[f,"Lenovo"],[h,y]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[l,/_/g," "],[f,"Nokia"],[h,v]],[/droid.+;\s(pixel\sc)[\s)]/i],[l,[f,"Google"],[h,y]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[l,[f,"Google"],[h,v]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,"Sony"],[h,v]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[l,"Xperia Tablet"],[f,"Sony"],[h,y]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[l,[f,"OnePlus"],[h,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[l,[f,"Amazon"],[h,y]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[l,"Fire Phone"],[f,"Amazon"],[h,v]],[/\((playbook);[\w\s\),;-]+(rim)/i],[l,f,[h,y]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[l,[f,"BlackBerry"],[h,v]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[l,[f,"ASUS"],[h,y]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[l,[f,"ASUS"],[h,v]],[/(nexus\s9)/i],[l,[f,"HTC"],[h,y]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[l,/_/g," "],[h,v]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[l,[f,"Acer"],[h,y]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[l,[f,"Meizu"],[h,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,l,[h,v]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[f,l,[h,y]],[/\s(surface\sduo)\s/i],[l,[f,"Microsoft"],[h,y]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[l,[f,"Fairphone"],[h,v]],[/\s(u304aa)\sbuild/i],[l,[f,"AT&T"],[h,v]],[/sie-(\w*)/i],[l,[f,"Siemens"],[h,v]],[/[;\/]\s?(rct\w+)\sbuild/i],[l,[f,"RCA"],[h,y]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[l,[f,"Dell"],[h,y]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[l,[f,"Verizon"],[h,y]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[l,[f,"Barnes & Noble"],[h,y]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[l,[f,"NuVision"],[h,y]],[/;\s(k88)\sbuild/i],[l,[f,"ZTE"],[h,y]],[/;\s(nx\d{3}j)\sbuild/i],[l,[f,"ZTE"],[h,v]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[l,[f,"Swiss"],[h,v]],[/[;\/]\s?(zur\d{3})\sbuild/i],[l,[f,"Swiss"],[h,y]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[l,[f,"Zeki"],[h,y]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[f,"Dragon Touch"],l,[h,y]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[l,[f,"Insignia"],[h,y]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[l,[f,"NextBook"],[h,y]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[f,"Voice"],l,[h,v]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[f,"LvTel"],l,[h,v]],[/;\s(ph-1)\s/i],[l,[f,"Essential"],[h,v]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[l,[f,"Envizen"],[h,y]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[l,[f,"MachSpeed"],[h,y]],[/[;\/]\s?tu_(1491)\sbuild/i],[l,[f,"Rotor"],[h,y]],[/(shield[\w\s]+)\sbuild/i],[l,[f,"Nvidia"],[h,y]],[/(sprint)\s(\w+)/i],[f,l,[h,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,"Microsoft"],[h,v]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,"Zebra"],[h,y]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,"Zebra"],[h,v]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[f,l,[h,g]],[/droid.+;\s(shield)\sbuild/i],[l,[f,"Nvidia"],[h,g]],[/(playstation\s[345portablevi]+)/i],[l,[f,"Sony"],[h,g]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[l,[f,"Microsoft"],[h,g]],[/smart-tv.+(samsung)/i],[f,[h,w]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,"Samsung"],[h,w]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[f,"LG"],[h,w]],[/(apple)\s?tv/i],[f,[l,"Apple TV"],[h,w]],[/crkey/i],[[l,"Chromecast"],[f,"Google"],[h,w]],[/droid.+aft([\w])(\sbuild\/|\))/i],[l,[f,"Amazon"],[h,w]],[/\(dtv[\);].+(aquos)/i],[l,[f,"Sharp"],[h,w]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,E.trim],[l,E.trim],[h,w]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[h,w]],[/((pebble))app\/[\d\.]+\s/i],[f,l,[h,m]],[/droid.+;\s(glass)\s\d/i],[l,[f,"Google"],[h,m]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[l,[f,"Zebra"],[h,m]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[f,[h,S]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[l,[h,v]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[l,[h,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,E.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[f,"Generic"]],[/(phone)/i],[[h,v]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[p,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,p]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[p,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[p,[d,T.str,_.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[p,"Windows"],[d,T.str,_.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[p,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[p,"Mac OS"],[d,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[p,d],[/\(bb(10);/i],[d,[p,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[d,[p,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[p,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[p,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[p,"Chromium OS"],d],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[p,d],[/(sunos)\s?([\w\.\d]*)/i],[[p,"Solaris"],d],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[p,d]]},I=function(t,e){if("object"==typeof t&&(e=t,t=o),!(this instanceof I))return new I(t,e).getResult();var r=t||(void 0!==i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=e?E.extend(A,e):A;return this.getBrowser=function(){var t={name:o,version:o};return T.rgx.call(t,r,n.browser),t.major=E.major(t.version),t},this.getCPU=function(){var t={architecture:o};return T.rgx.call(t,r,n.cpu),t},this.getDevice=function(){var t={vendor:o,model:o,type:o};return T.rgx.call(t,r,n.device),t},this.getEngine=function(){var t={name:o,version:o};return T.rgx.call(t,r,n.engine),t},this.getOS=function(){var t={name:o,version:o};return T.rgx.call(t,r,n.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(t){return r=typeof t===u&&t.length>255?E.trim(t,255):t,this},this.setUA(r),this};I.VERSION="0.7.28",I.BROWSER={NAME:p,MAJOR:"major",VERSION:d},I.CPU={ARCHITECTURE:b},I.DEVICE={MODEL:l,VENDOR:f,TYPE:h,CONSOLE:g,MOBILE:v,SMARTTV:w,TABLET:y,WEARABLE:m,EMBEDDED:S},I.ENGINE={NAME:p,VERSION:d},I.OS={NAME:p,VERSION:d},typeof e!==a?(t.exports&&(e=t.exports=I),e.UAParser=I):(n=function(){return I}.call(e,r,e,t))===o||(t.exports=n);var x=void 0!==i&&(i.jQuery||i.Zepto);if(x&&!x.ua){var O=new I;x.ua=O.getResult(),x.ua.get=function(){return O.getUA()},x.ua.set=function(t){O.setUA(t);var e=O.getResult();for(var r in e)x.ua[r]=e[r]}}}("object"==typeof window?window:this)},306:function(t){"use strict";t.exports={i8:"0.0.8"}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var n={};!function(){"use strict";r.d(n,{default:function(){return re}});var t=function(){function t(){}var e;return t.API_URL="https://api.sdk.letscooee.com",t.SDK_VERSION=r(306).i8,t.SDK_DEBUG=!1,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.CANVAS_WIDTH=1080,t.CANVAS_HEIGHT=1920,t.STORAGE_USER_ID="uid",t.STORAGE_SDK_TOKEN="st",t.STORAGE_DEVICE_UUID="uuid",t.STORAGE_SESSION_ID="sid",t.STORAGE_SESSION_NUMBER="sn",t.STORAGE_SESSION_START_TIME="sst",t.STORAGE_SESSION_START_EVENT_SENT="sses",t.STORAGE_FIRST_TIME_LAUNCH="ifl",t.STORAGE_LAST_ACTIVE="la",t.STORAGE_TRIGGER_START_TIME="tst",t.STORAGE_ACTIVE_TRIGGER="at",t.STORAGE_ACTIVE_TRIGGERS="ats",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_CONTAINER_NAME="cooee-wrapper",e=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(e,10),t}(),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},i=function(){function r(){}return r.log=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.log.apply(console,e([t.LOG_PREFIX,":"],r,!1))},r.error=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.error.apply(console,e([t.LOG_PREFIX,":"],r,!1))},r.warning=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.warn.apply(console,e([t.LOG_PREFIX,":"],r,!1))},r}(),o=function(){function t(t){t.s&&(this.s=new u(t.s)),t.g&&(this.g=new h(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const s=new RegExp("[^#a-f\\d]","gi"),a=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var c,u=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||s.test(t)||!a.test(t))throw new TypeError("Expected a valid hex string");let r=1;8===(t=t.replace(/^#/,"")).length&&(r=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(r=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const n=Number.parseInt(t,16),i=n>>16,o=n>>8&255,c=255&n,u="number"==typeof e.alpha?e.alpha:r;return"array"===e.format?[i,o,c,u]:"css"===e.format?`rgb(${i} ${o} ${c}${1===u?"":` / ${Number((100*u).toFixed(2))}%`})`:{red:i,green:o,blue:c,alpha:u}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),l=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new u(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return c[null!==(t=this.s)&&void 0!==t?t:c.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(c||(c={}));var p,h=function(){function t(t){this.r=t.r,t.c&&(this.c=new u(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),t}(),f=(Object.defineProperty(function(){}.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),function(){function t(t){this.t=t.t,t.bg&&(this.bg=new o(t.bg)),t.br&&(this.br=new l(t.br)),this.clc=t.clc,this.shd=t.shd,this.spc=t.spc,this.trf=t.trf,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y}return Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return p[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}());!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(p||(p={}));var d,b,g=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),v=function(t){function e(e){return t.call(this,e)||this}return g(e,t),e}(f),y=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),w=function(t){function e(e){var r=t.call(this,e)||this;return r.src=e.src,r}return y(e,t),e}(f),m=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),S=function(t){function e(e){var r=t.call(this,e)||this;return r.alg=d.START,r.prs=e.prs,r.alg=e.alg,e.f&&(r.f=e.f),e.c&&(r.c=new u(e.c)),r}return m(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(f);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(d||(d={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(b||(b={}));var E,T=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_=function(t){function e(e){var r,n=t.call(this,e)||this;return n.o=null!==(r=e.o)&&void 0!==r?r:E.C,n}return T(e,t),e.prototype.getStyles=function(){var t;return(t=this.o===E.NW?{top:0,left:0}:this.o===E.N?{top:0,left:"50%",transform:"translateX(-50%)"}:this.o===E.NE?{top:0,right:0}:this.o===E.E?{top:"50%",right:0,transform:"translateY(-50%)"}:this.o===E.SE?{bottom:0,right:0}:this.o===E.S?{bottom:0,left:"50%",transform:"translateX(-50%)"}:this.o===E.SW?{bottom:0,left:0}:this.o===E.W?{top:"50%",left:0,transform:"translateY(-50%)"}:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"}).position="absolute",t.overflow="hidden",t},e}(f);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(E||(E={}));var A=function(t){var e=this;this.elems=[],this.cont=new _(t.cont),t.elems.forEach((function(t){t.t===p.IMAGE?e.elems.push(new w(t)):t.t===p.TEXT||t.t===p.BUTTON?e.elems.push(new S(t)):t.t===p.SHAPE&&e.elems.push(new v(t))}))},I=function(t){this.expireAt=(new Date).getTime(),this.id=t.id,this.expireAt=t.expireAt,this.version=t.version,this.engagementID=t.engagementID,this.internal=t.internal,this.pn=t.pn,this.ian=new A(t.ian)},x=function(){function t(){}return t.getString=function(e,r){return t.LOCAL_STORAGE.getItem(e)||r},t.setString=function(e,r){r||(r=""),t.LOCAL_STORAGE.setItem(e,r)},t.getNumber=function(e,r){return+t.getString(e,"")||r},t.setNumber=function(e,r){t.setString(e,r.toString())},t.getBoolean=function(t,e){var r=this.LOCAL_STORAGE.getItem(t);return r?JSON.parse(r):e},t.setBoolean=function(e,r){t.setString(e,JSON.stringify(r))},t.getObject=function(e){try{return JSON.parse(t.getString(e,""))}catch(t){return null}},t.setObject=function(e,r){t.setString(e,JSON.stringify(r))},t.remove=function(e){t.LOCAL_STORAGE.removeItem(e)},t.LOCAL_STORAGE=window.localStorage,t}(),O=function(){function t(){this.doc=document}return t.get=function(){return t._instance||(t._instance=new t),t._instance},t.prototype.getWidth=function(){return this.parentContainer?this.parentContainer.clientWidth:document.documentElement.clientWidth},t.prototype.getHeight=function(){return this.parentContainer?this.parentContainer.clientHeight:document.documentElement.clientHeight},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,r){e&&(r?t.style.setProperty(e,r):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,r){t.setAttribute(e,r)},t.prototype.getElementById=function(t){return this.doc.getElementById(t)},t.prototype.setParentContainer=function(t){this.parentContainer=t},t}(),N=r(238),k=r.n(N),C=r(489),D=r.n(C),R=function(){function e(){this.inInactive=!0,this.lastEnterActive=new Date,this.lastEnterInactive=null,this.isDebug=!1}return e.getInstance=function(){return this.INSTANCE},e.prototype.getWebAppVersion=function(){var t;return null!==(t=this.webAppVersion)&&void 0!==t?t:"0.0.1+1"},e.prototype.setWebAppVersion=function(t){this.webAppVersion=t},e.prototype.isDebugWebApp=function(){return this.isDebug},e.prototype.setDebugWebApp=function(t){this.isDebug=t},e.prototype.isInactive=function(){return this.inInactive},e.prototype.setInactive=function(){this.inInactive=!0,this.lastEnterInactive=new Date,x.setNumber(t.STORAGE_LAST_ACTIVE,this.lastEnterInactive.getTime())},e.prototype.setActive=function(){this.inInactive=!1,this.lastEnterActive=new Date},e.prototype.isFirstActive=function(){return null==this.lastEnterInactive},e.prototype.getLastEnterInactive=function(){return this.lastEnterInactive},e.prototype.getTimeForActiveInSeconds=function(){var t,e;return((null===(t=this.lastEnterInactive)||void 0===t?void 0:t.getTime())-(null===(e=this.lastEnterActive)||void 0===e?void 0:e.getTime()))/1e3},e.prototype.getTimeForInactiveInSeconds=function(){return null==this.lastEnterInactive?0:((new Date).getTime()-this.lastEnterInactive.getTime())/1e3},e.INSTANCE=new e,e}(),P=function(){function e(){}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.getCurrentSessionID=function(){return this.currentSessionID||null},e.prototype.isNewSessionRequired=function(){if(!x.getString(t.STORAGE_SESSION_ID,""))return!0;var e=x.getNumber(t.STORAGE_SESSION_START_TIME,0);return((new Date).getTime()-e)/1e3>t.IDLE_TIME_IN_SECONDS},e.prototype.checkForNewSession=function(){this.isNewSessionRequired()?this.startNewSession():this.initializeSessionFromStorage()},e.prototype.startNewSession=function(){this.currentSessionID||(x.setBoolean(t.STORAGE_SESSION_START_EVENT_SENT,!1),this.currentSessionStartTime=new Date,this.currentSessionID=(new(D())).toHexString(),x.setNumber(t.STORAGE_SESSION_START_TIME,this.currentSessionStartTime.getTime()),x.setString(t.STORAGE_SESSION_ID,this.currentSessionID),this.bumpSessionNumber())},e.prototype.bumpSessionNumber=function(){this.currentSessionNumber=x.getNumber(t.STORAGE_SESSION_NUMBER,0),this.currentSessionNumber+=1,x.setNumber(t.STORAGE_SESSION_NUMBER,this.currentSessionNumber)},e.prototype.getCurrentSessionNumber=function(){return this.currentSessionNumber||0},e.prototype.getTotalDurationInSeconds=function(){if(R.getInstance().isFirstActive())throw new Error("This is the first time in foreground after launch");return(this.getLastActive()-this.currentSessionStartTime.getTime())/1e3},e.prototype.conclude=function(){var e={sessionID:this.currentSessionID,occurred:new Date,duration:this.getTotalDurationInSeconds()};Bt.getInstance().concludeSession(e),x.remove(t.STORAGE_ACTIVE_TRIGGER),this.destroySession()},e.prototype.destroySession=function(){this.currentSessionID=void 0,this.currentSessionNumber=void 0,this.currentSessionStartTime=void 0,x.remove(t.STORAGE_SESSION_ID),x.remove(t.STORAGE_SESSION_START_TIME)},e.prototype.initializeSessionFromStorage=function(){this.currentSessionStartTime=new Date(x.getNumber(t.STORAGE_SESSION_START_TIME,0)),this.currentSessionID=x.getString(t.STORAGE_SESSION_ID,""),this.currentSessionNumber=x.getNumber(t.STORAGE_SESSION_NUMBER,0)},e.prototype.getLastActive=function(){return x.getNumber(t.STORAGE_LAST_ACTIVE,0)},e}(),M=function(t,e){void 0===e&&(e={}),this.name=t,this.properties=e,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.activeTriggers=[],this.occurred=(new Date).toISOString()},L=function(){function t(t){this.triggerID=t.id,this.engagementID=t.engagementID,this.expireAt=t.expireAt,this.isExpired&&(this.expired=this.isExpired)}return Object.defineProperty(t.prototype,"isExpired",{get:function(){return this.expireAt<(new Date).getTime()},enumerable:!1,configurable:!0}),t}(),G=function(){function e(){}return e.storeActiveTrigger=function(e){if("test"!==e.id){var r=x.getObject(t.STORAGE_ACTIVE_TRIGGERS);r||(r=[]);var n=new L(e);n.isExpired||r.push(n),x.setObject(t.STORAGE_ACTIVE_TRIGGER,n),x.setObject(t.STORAGE_ACTIVE_TRIGGERS,r)}},e.getActiveTriggers=function(){var e=x.getObject(t.STORAGE_ACTIVE_TRIGGERS);return e?(e.forEach((function(t,e,r){new L(t).isExpired&&r.splice(e,1)})),x.setObject(t.STORAGE_ACTIVE_TRIGGERS,e),e):[]},e}(),H=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},j=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},B=function(){function e(){this.runtimeData=R.getInstance(),this.apiToken="",this.userID=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.doHTTP=function(e,r,n,i){return H(this,void 0,void 0,(function(){var o,s;return j(this,(function(a){switch(a.label){case 0:return r.startsWith("http")||(r=t.API_URL+r),!("keepalive"in new Request(""))&&JSON.stringify(n).includes("CE App Background")?((o=new XMLHttpRequest).open("POST",r,!1),i.forEach((function(t,e){o.setRequestHeader(e,t)})),o.send(JSON.stringify(n)),[2,o.response.json()]):[4,fetch(r,{method:e,body:JSON.stringify(n),headers:i,keepalive:!0})];case 1:if(!(s=a.sent()).ok)throw s;return[2,s.json()]}}))}))},e.prototype.registerDevice=function(t){return H(this,void 0,void 0,(function(){return j(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",t,this.getDefaultHeaders())]}))}))},e.prototype.sendEvent=function(e){var r=this.getDefaultHeaders();r.append("x-sdk-token",this.apiToken),e.activeTriggers=G.getActiveTriggers();var n=x.getObject(t.STORAGE_ACTIVE_TRIGGER);n&&(e.trigger=n,"test"===n.triggerID)||this.doHTTP("POST","/v1/event/track",e,r).then((function(t){i.log("Sent",e.name),t.triggerData&&(new ee).render(t.triggerData)})).catch((function(t){i.error("Error sending event",t)}))},e.prototype.updateUserData=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("PUT","/v1/user/update",t,e).then((function(){i.log("Updated user profile")})).catch((function(t){i.error("Error saving user profile",t)}))},e.prototype.concludeSession=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("POST","/v1/session/conclude",t,e).then((function(t){i.log("Conclude Session",t)})).catch((function(t){i.error(t)}))},e.prototype.getDefaultHeaders=function(){var e=new Headers;return e.set("sdk-version",t.SDK_VERSION),e.set("sdk-version-code",t.SDK_VERSION_CODE.toString()),e.set("app-version",this.runtimeData.getWebAppVersion()),e.set("user-id",this.userID),t.SDK_DEBUG&&e.set("sdk-debug",String(1)),this.runtimeData.isDebugWebApp()&&e.set("app-debug",String(1)),e},e.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},e.prototype.setUserId=function(t){this.userID=null!=t?t:""},e.INSTANCE=new e,e}(),U=function(e,r,n,i){this.appID=e,this.appSecret=r,this.uuid=n,this.props=i,this.sdk=t.SDK},F=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},V=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},z=function(){function t(){this.parser=new(k()),this.result={}}return t.prototype.get=function(){return F(this,void 0,void 0,(function(){var t;return V(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,r=t.offsetWidth*e;return document.body.removeChild(t),r},t.prototype.getLocation=function(){return F(this,void 0,void 0,(function(){var t=this;return V(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(r){t.result.coords=[r.coords.latitude,r.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return F(this,void 0,void 0,(function(){var t;return V(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),W=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},q=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},K=function(){function e(){this.apiService=B.getInstance(),this.sdkToken="",this.userID="",this.appID="",this.appSecret=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.init=function(t,e){return this.appID=t,this.appSecret=e,this.acquireSDKToken()},e.prototype.hasToken=function(){return!!x.getString(t.STORAGE_SDK_TOKEN,"")},e.prototype.getUserID=function(){return this.userID},e.prototype.populateUserDataFromStorage=function(){return W(this,void 0,void 0,(function(){return q(this,(function(e){return this.sdkToken=x.getString(t.STORAGE_SDK_TOKEN,""),this.sdkToken||i.log("No SDK token found in local storage"),this.userID=x.getString(t.STORAGE_USER_ID,""),this.userID||i.log("No user ID found in local storage"),this.updateAPIClient(),[2]}))}))},e.prototype.updateAPIClient=function(){i.log("SDK Token:",this.sdkToken),i.log("User ID:",this.userID),this.apiService.setAPIToken(this.sdkToken),this.apiService.setUserId(this.userID)},e.prototype.acquireSDKToken=function(){return W(this,void 0,void 0,(function(){return q(this,(function(t){return this.hasToken()?[2,this.populateUserDataFromStorage()]:(i.log("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}))}))},e.prototype.getSDKTokenFromServer=function(){return W(this,void 0,void 0,(function(){var t,e,r,n;return q(this,(function(o){switch(o.label){case 0:return[4,this.getUserAuthRequest()];case 1:t=o.sent(),e=this.apiService.registerDevice(t),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,e];case 3:return r=o.sent(),i.log("Register Device Response",r),this.saveUserDataInStorage(r),[3,5];case 4:throw n=o.sent(),i.error(n),n;case 5:return[2]}}))}))},e.prototype.saveUserDataInStorage=function(e){this.sdkToken=e.sdkToken,this.userID=e.id,this.updateAPIClient(),x.setString(t.STORAGE_SDK_TOKEN,this.sdkToken),x.setString(t.STORAGE_USER_ID,this.userID)},e.prototype.getUserAuthRequest=function(){return W(this,void 0,void 0,(function(){var t;return q(this,(function(e){switch(e.label){case 0:return[4,(new z).get()];case 1:return t=e.sent(),[2,new U(this.appID,this.appSecret,this.getOrCreateUUID(),t)]}}))}))},e.prototype.getOrCreateUUID=function(){var e=x.getString(t.STORAGE_DEVICE_UUID,"");return e||(e=(new(D())).toHexString(),x.setString(t.STORAGE_DEVICE_UUID,e)),e},e.INSTANCE=new e,e}(),X=function(t,e){return(X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(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 r(){this.constructor=t}X(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function J(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function Z(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t}function Q(t){return"function"==typeof t}function tt(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var et=tt((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function rt(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var nt=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=null}var e;return t.prototype.unsubscribe=function(){var t,e,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=J(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(Q(c))try{c()}catch(t){i=t instanceof et?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var l=J(u),p=l.next();!p.done;p=l.next()){var h=p.value;try{st(h)}catch(t){i=null!=i?i:[],t instanceof et?i=Z(Z([],Y(i)),Y(t.errors)):i.push(t)}}}catch(t){r={error:t}}finally{try{p&&!p.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new et(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)st(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(r=this._teardowns)&&void 0!==r?r:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&rt(e,t)},t.prototype.remove=function(e){var r=this._teardowns;r&&rt(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),it=nt.EMPTY;function ot(t){return t instanceof nt||t&&"closed"in t&&Q(t.remove)&&Q(t.add)&&Q(t.unsubscribe)}function st(t){Q(t)?t():t.unsubscribe()}var at=null,ct=null,ut=void 0,lt=!1,pt=!1,ht={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=ht.delegate;return((null==r?void 0:r.setTimeout)||setTimeout).apply(void 0,Z([],Y(t)))},clearTimeout:function(t){var e=ht.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ft(t){ht.setTimeout((function(){if(!at)throw t;at(t)}))}function dt(){}var bt=gt("C",void 0,void 0);function gt(t,e,r){return{kind:t,value:e,error:r}}var vt=null;function yt(t){if(lt){var e=!vt;if(e&&(vt={errorThrown:!1,error:null}),t(),e){var r=vt,n=r.errorThrown,i=r.error;if(vt=null,n)throw i}}else t()}function wt(t){lt&&vt&&(vt.errorThrown=!0,vt.error=t)}var mt=function(t){function e(e){var r=t.call(this)||this;return r.isStopped=!1,e?(r.destination=e,ot(e)&&e.add(r)):r.destination=At,r}return $(e,t),e.create=function(t,e,r){return new St(t,e,r)},e.prototype.next=function(t){this.isStopped?_t(function(t){return gt("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?_t(gt("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?_t(bt,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(nt),St=function(t){function e(e,r,n){var i,o=t.call(this)||this;if(Q(e))i=e;else if(e){var s;i=e.next,r=e.error,n=e.complete,o&&pt?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),r=null==r?void 0:r.bind(s),n=null==n?void 0:n.bind(s)}return o.destination={next:i?Et(i):dt,error:Et(null!=r?r:Tt),complete:n?Et(n):dt},o}return $(e,t),e}(mt);function Et(t,e){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{t.apply(void 0,Z([],Y(e)))}catch(t){lt?wt(t):ft(t)}}}function Tt(t){throw t}function _t(t,e){var r=ct;r&&ht.setTimeout((function(){return r(t,e)}))}var At={closed:!0,next:dt,error:Tt,complete:dt},It="function"==typeof Symbol&&Symbol.observable||"@@observable";function xt(t){return t}function Ot(t){return 0===t.length?xt:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Nt=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n,i=this,o=(n=t)&&n instanceof mt||function(t){return t&&Q(t.next)&&Q(t.error)&&Q(t.complete)}(n)&&ot(n)?t:new St(t,e,r);return yt((function(){var t=i,e=t.operator,r=t.source;o.add(e?e.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=kt(e))((function(e,n){var i;i=r.subscribe((function(e){try{t(e)}catch(t){n(t),null==i||i.unsubscribe()}}),n,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[It]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ot(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=kt(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function kt(t){var e;return null!==(e=null!=t?t:ut)&&void 0!==e?e:Promise}var Ct,Dt=tt((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Rt=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return $(e,t),e.prototype.lift=function(t){var e=new Pt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Dt},e.prototype.next=function(t){var e=this;yt((function(){var r,n;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=J(i),s=o.next();!s.done;s=o.next())s.value.next(t)}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}}))},e.prototype.error=function(t){var e=this;yt((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}}))},e.prototype.complete=function(){var t=this;yt((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,r=e.hasError,n=e.isStopped,i=e.observers;return r||n?it:(i.push(t),new nt((function(){return rt(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,n=e.thrownError,i=e.isStopped;r?t.error(n):i&&t.complete()},e.prototype.asObservable=function(){var t=new Nt;return t.source=this,t},e.create=function(t,e){return new Pt(t,e)},e}(Nt),Pt=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return $(e,t),e.prototype.next=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)},e.prototype.error=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:it},e}(Rt),Mt={now:function(){return(Mt.delegate||Date).now()},delegate:void 0},Lt=function(t){function e(e,r,n){void 0===e&&(e=1/0),void 0===r&&(r=1/0),void 0===n&&(n=Mt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,r),i}return $(e,t),e.prototype.next=function(e){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!t.closed;i+=r?1:2)t.next(n[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,r=t._timestampProvider,n=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}},e}(Rt),Gt=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},Ht=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},jt=function(){function e(){this.sessionManager=P.getInstance(),this.safeHttpCallService=Bt.getInstance(),this.userAuthService=K.getInstance()}return e.prototype.init=function(t,r){var n=this;this.userAuthService.init(t,r).then((function(){e.replaySubject.next(!0),e.replaySubject.complete()})).catch((function(){setTimeout((function(){n.init(t,r)}),3e4)})),this.execute()},e.prototype.execute=function(){this.sessionManager.checkForNewSession(),x.getBoolean(t.STORAGE_SESSION_START_EVENT_SENT,!1)||(x.setBoolean(t.STORAGE_SESSION_START_EVENT_SENT,!0),this.isAppFirstTimeLaunch()?this.sendFirstLaunchEvent():this.sendSuccessiveLaunchEvent())},e.prototype.isAppFirstTimeLaunch=function(){return!!x.getBoolean(t.STORAGE_FIRST_TIME_LAUNCH,!0)&&(x.setBoolean(t.STORAGE_FIRST_TIME_LAUNCH,!1),!0)},e.prototype.sendFirstLaunchEvent=function(){return Gt(this,void 0,void 0,(function(){var t,e;return Ht(this,(function(r){switch(r.label){case 0:return t=new M("CE App Installed",{}),e=t,[4,(new z).get()];case 1:return e.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(t),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return Gt(this,void 0,void 0,(function(){var t,e;return Ht(this,(function(r){switch(r.label){case 0:return t=new M("CE App Launched",{}),e=t,[4,(new z).get()];case 1:return e.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(t),[2]}}))}))},e.replaySubject=new Lt(1),e}(),Bt=function(){function t(){this.sessionManager=P.getInstance(),this.httpApiService=B.getInstance()}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.sendEvent=function(t){var e=this;jt.replaySubject.subscribe((function(){e.addEventVariable(t),e.httpApiService.sendEvent(t)}))},t.prototype.updateProfile=function(t){var e=this;jt.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},t.prototype.concludeSession=function(t){var e=this;jt.replaySubject.subscribe((function(){e.httpApiService.concludeSession(t)}))},t.prototype.addEventVariable=function(t){t.screenName=location.pathname,t.properties.path=location.pathname,t.sessionID=this.sessionManager.getCurrentSessionID(),t.sessionNumber=this.sessionManager.getCurrentSessionNumber()},t}();!function(t){t.Location="LOCATION",t.Push="PUSH",t.Camera="CAMERA"}(Ct||(Ct={}));var Ut=function(){function e(t){this.action=t,this.apiService=Bt.getInstance()}return e.prototype.execute=function(){this.externalAction(),this.iabAction(),this.upAction(),this.kvAction(),this.prompt(),this.closeAction(),this.shareAction()},e.prototype.externalAction=function(){var t;this.action.ext&&(null===(t=window.open(this.action.ext.u,"_blank"))||void 0===t||t.focus())},e.prototype.iabAction=function(){this.action.iab&&(new Zt).render(this.action.iab.u)},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.kvAction=function(){this.action.kv&&document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:this.action.kv}))},e.prototype.prompt=function(){var t=this.action.prompt;t&&(t===Ct.Location&&this.promptLocationPermission(),t===Ct.Push&&this.promptPushNotificationPermission(),t===Ct.Camera&&this.promptCameraPermission())},e.prototype.closeAction=function(){var e;if(this.action.close){(new Yt).removeInApp();var r=x.getNumber(t.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),n={triggerID:null===(e=x.getObject(t.STORAGE_ACTIVE_TRIGGER))||void 0===e?void 0:e.triggerID,"Close Behaviour":"CTA",Duration:((new Date).getTime()-r)/1e3};this.apiService.sendEvent(new M("CE Trigger Closed",n)),x.remove(t.STORAGE_TRIGGER_START_TIME)}},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):i.warning("Navigator.share is not compatible with this browser"))},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateProfile({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateProfile({pnPerm:Notification.permission}):i.warning("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return t=this,e=void 0,n=function(){var t,e,r;return function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(n){switch(n.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=n.sent(),[4,this.checkPermission("geolocation")];case 2:return e=n.sent(),r=Notification.permission,[2,{camera:t,location:e,notification:r}]}}))},new((r=void 0)||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}));var t,e,r,n},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateProfile({perm:e})}))},e}(),Ft=function(){function e(e,r){var n,i,o;this.renderer=O.get(),this.screenWidth=0,this.screenHeight=0,this.scalingFactor=(i=O.get().getWidth(),o=O.get().getHeight(),n=i<o?i/Math.min(t.CANVAS_WIDTH,t.CANVAS_HEIGHT):o/Math.max(t.CANVAS_WIDTH,t.CANVAS_HEIGHT),Math.min(n,1)),this.parentHTMLEl=e,this.inappElement=r,this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return e.prototype.getHTMLElement=function(){return this.inappHTMLEl},e.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},e.prototype.processCommonBlocks=function(){this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},e.prototype.processWidthAndHeight=function(){this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},e.prototype.getSizePx=function(t){return t*this.scalingFactor+"px"},e.prototype.processPositionBlock=function(){this.inappElement.x&&(this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)))},e.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},e.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.p&&this.renderer.setStyle(this.inappHTMLEl,"padding",this.getSizePx(t.p)),t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},e.prototype.processTransformBlock=function(){var t=this.inappElement.trf;t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate("+t.rotate+"deg)")},e.prototype.registerAction=function(){var t=this.inappElement.clc;t&&this.inappHTMLEl.addEventListener("click",(function(){new Ut(t).execute()}))},e.prototype.processBackgroundBlock=function(){var t,e=this.inappElement.bg;if(e){var r=this.inappHTMLEl;this.inappElement instanceof _&&(r=r.parentElement);var n="";if((null===(t=(new(k())).getBrowser().name)||void 0===t?void 0:t.toLowerCase().includes("safari"))&&(n="-webkit-"),e.glossy)this.renderer.setStyle(r,n+"backdrop-filter","blur("+e.glossy.radius+"px)"),e.glossy.color&&this.processColourBlock(e.glossy.color,"background",r);else if(e.solid)e.solid.grad?this.processGradient(e.solid.grad,"background"):e.solid.hex&&this.renderer.setStyle(r,"background",e.solid.rgba);else if(e.img){if(!e.img.src)return;var i='url("'+e.img.src+'") no-repeat center';this.renderer.setStyle(r,"background",i),this.renderer.setStyle(r,"background-size","cover"),e.img.a&&this.renderer.setStyle(r,n+"backdrop-filter","opacity("+e.img.a+")")}}},e.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var r="linear-gradient("+t.ang+"deg, "+t.c1+", "+t.c2;t.c3&&(r+=", "+t.c3),t.c4&&(r+=", "+t.c4),t.c5&&(r+=", "+t.c5);var n=r+=")";this.renderer.setStyle(this.inappHTMLEl,e,n)}},e.prototype.processColourBlock=function(t,e,r){void 0===e&&(e="color"),void 0===r&&(r=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(r,e,t.rgba))},e}(),Vt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zt=function(t){function e(e,r){return t.call(this,e,r)||this}return Vt(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t=this.inappElement.font;t&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(t.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",t.ff),this.renderer.setStyle(this.inappHTMLEl,"line-height",t.lh))},e.prototype.processPart=function(t,e){var r,n=[];e.u&&n.push("underline"),e.st&&n.push("line-through"),n.length||n.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",n.join(" ")),this.renderer.setStyle(t,"color",null!==(r=e.c)&&void 0!==r?r:"inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=d[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(Ft),Wt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.inappHTMLEl=n.renderer.createElement("div"),n.insertElement(),n}return Wt(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var r,n,i=e.renderer.createElement("span");i.innerHTML=null===(n=null===(r=t.txt)||void 0===r?void 0:r.toString())||void 0===n?void 0:n.replace(/\n/g,"<br />"),e.processPart(i,t),e.renderer.appendChild(e.inappHTMLEl,i)})),this.processCommonBlocks()},e}(zt),Kt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.inappHTMLEl=n.renderer.createElement("div"),n.insertElement(),n}return Kt(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(Ft),$t=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.inappHTMLEl=n.renderer.createElement("img"),n.insertElement(),n}return $t(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","100%"),this.renderer.setStyle(this.inappHTMLEl,"max-height","100%"),this.renderer.setStyle(this.inappHTMLEl,"display","block"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(Ft),Yt=function(){function e(t){this.parent=t,this.renderer=O.get(),this.renderer.setParentContainer(t)}return e.prototype.render=function(){this.removeInApp();var e=this.renderer.createElement("div");return e.id=t.IN_APP_CONTAINER_NAME,e.classList.add(t.IN_APP_CONTAINER_NAME),this.parent?this.renderer.setStyle(e,"position","absolute"):this.renderer.setStyle(e,"position","fixed"),this.renderer.setStyle(e,"z-index","10000000"),this.renderer.setStyle(e,"top","0"),this.renderer.setStyle(e,"left","0"),this.renderer.setStyle(e,"width","100%"),this.renderer.setStyle(e,"height","100%"),this.renderer.appendChild(this.parent||document.body,e),e.addEventListener("click",(function(){new Ut({close:!0}).execute()})),e},e.prototype.removeInApp=function(){var e=document.getElementById(t.IN_APP_CONTAINER_NAME);e&&e.parentElement.removeChild(e)},e}(),Zt=function(){function e(){this.renderer=O.get()}return e.prototype.render=function(e){var r=this.renderer.getElementById(t.IN_APP_CONTAINER_NAME),n=this.createIFrameContainer();return this.createIFrameElement(n,e),this.createAnchorElement(r,n),this.renderer.appendChild(r,n),n},e.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},e.prototype.createIFrameElement=function(t,e){var r=this.renderer.createElement("iframe");return this.renderer.setStyle(r,"width","100%"),this.renderer.setStyle(r,"height","100%"),this.renderer.setAttribute(r,"src",e),this.renderer.setAttribute(r,"frameBorder","0"),this.renderer.appendChild(t,r),r},e.prototype.createAnchorElement=function(t,e){var r=this.renderer.createElement("a");return this.renderer.setStyle(r,"position","absolute"),this.renderer.setStyle(r,"top","0px"),this.renderer.setStyle(r,"right","0px"),r.href="#",r.innerHTML="Close",r.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,r),r},e}(),Qt=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),te=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.inappHTMLEl=n.renderer.createElement("div"),n.insertElement(),n.inappElement.w=1080,n.inappElement.h=1920,n}return Qt(e,t),e.prototype.render=function(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),Object.assign(this.inappHTMLEl.style,this.inappElement.getStyles()),this},e}(Ft),ee=function(){function e(t){this.parent=t,this.rootContainer=new Yt(t).render()}return e.prototype.render=function(e){e=new I(e),this.ian=e.ian;try{this.renderContainer();var r=new M("CE Trigger Displayed",{triggerID:e.id});Bt.getInstance().sendEvent(r),x.setNumber(t.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),G.storeActiveTrigger(e)}catch(t){i.error(t)}},e.prototype.renderElement=function(t,e){e instanceof S?new qt(t,e).render():e instanceof w?new Jt(t,e).render():e instanceof v?new Xt(t,e).render():i.error("Unsupported element type- "+e.type)},e.prototype.renderContainer=function(){var t,e,r=this,n=null===(t=this.ian)||void 0===t?void 0:t.cont;if(n){var i=new te(this.rootContainer,n).render().getHTMLElement();null===(e=this.ian.elems)||void 0===e||e.forEach((function(t){r.renderElement(i,t)}))}},e}(),re=ee}(),CooeePreview=n.default}();
package/dist/sdk.min.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see sdk.min.js.LICENSE.txt */
2
- !function(){var t={489:function(t){for(var e=Math.floor(16777215*Math.random()),n=u.index=parseInt(16777215*Math.random(),10),r=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,i=function(t){return!(null==t||!t.constructor||"function"!=typeof t.constructor.isBuffer||!t.constructor.isBuffer(t))},o=[],s=0;s<256;s++)o[s]=(s<=15?"0":"")+s.toString(16);var a=new RegExp("^[0-9a-fA-F]{24}$"),c=[];for(s=0;s<10;)c[48+s]=s++;for(;s<16;)c[55+s]=c[87+s]=s++;function u(t){if(!(this instanceof u))return new u(t);if(t&&(t instanceof u||"ObjectID"===t._bsontype))return t;if(this._bsontype="ObjectID",null!=t&&"number"!=typeof t){var e=u.isValid(t);if(!e&&null!=t)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&"string"==typeof t&&24===t.length)return u.createFromHexString(t);if(null==t||12!==t.length){if(null!=t&&"function"==typeof t.toHexString)return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=t}else this.id=this.generate(t)}t.exports=u,u.default=u,u.createFromTime=function(t){return new u((8,(8===(e=(e=t=parseInt(t,10)%4294967295).toString(16)).length?e:"00000000".substring(e.length,8)+e)+"0000000000000000"));var e},u.createFromHexString=function(t){if(void 0===t||null!=t&&24!==t.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",n=0;n<24;)e+=String.fromCharCode(c[t.charCodeAt(n++)]<<4|c[t.charCodeAt(n++)]);return new u(e)},u.isValid=function(t){return null!=t&&("number"==typeof t||("string"==typeof t?12===t.length||24===t.length&&a.test(t):t instanceof u||!!i(t)||"function"==typeof t.toHexString&&(t.id instanceof _Buffer||"string"==typeof t.id)&&(12===t.id.length||24===t.id.length&&a.test(t.id))))},u.prototype={constructor:u,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=o[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof u?this.toString()===t.toString():"string"==typeof t&&u.isValid(t)&&12===t.length&&i(this.id)?t===this.id.toString("binary"):"string"==typeof t&&u.isValid(t)&&24===t.length?t.toLowerCase()===this.toHexString():"string"==typeof t&&u.isValid(t)&&12===t.length?t===this.id:!(null==t||!(t instanceof u||t.toHexString))&&t.toHexString()===this.toHexString()},getTimestamp:function(){var t,e=new Date;return t=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,e.setTime(1e3*Math.floor(t)),e},generate:function(t){"number"!=typeof t&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var i=n=(n+1)%16777215;return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t,e>>16&255,e>>8&255,255&e,r>>8&255,255&r,i>>16&255,i>>8&255,255&i)}};var l=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";u.prototype[l]=function(){return"ObjectID("+this+")"},u.prototype.toJSON=u.prototype.toHexString,u.prototype.toString=u.prototype.toHexString},238:function(t,e,n){var r;!function(i,o){"use strict";var s="function",a="undefined",c="object",u="string",l="model",p="name",h="type",f="vendor",d="version",b="architecture",v="console",g="mobile",y="tablet",w="smarttv",m="wearable",S="embedded",E={extend:function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n},has:function(t,e){return typeof t===u&&-1!==e.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return typeof t===u?t.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(t,e){return t=t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),typeof e===a?t:t.substring(0,255)}},T={rgx:function(t,e){for(var n,r,i,a,u,l,p=0;p<e.length&&!u;){var h=e[p],f=e[p+1];for(n=r=0;n<h.length&&!u;)if(u=h[n++].exec(t))for(i=0;i<f.length;i++)l=u[++r],typeof(a=f[i])===c&&a.length>0?2==a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3==a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):o:this[a[0]]=l?a[1].call(this,l,a[2]):o:4==a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):o):this[a]=l||o;p+=2}},str:function(t,e){for(var n in e)if(typeof e[n]===c&&e[n].length>0){for(var r=0;r<e[n].length;r++)if(E.has(e[n][r],t))return"?"===n?o:n}else if(E.has(e[n],t))return"?"===n?o:n;return t}},_={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},A={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[p,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[p,d],[/opios[\/\s]+([\w\.]+)/i],[d,[p,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[d,[p,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,d],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[d,[p,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[d,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[p,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[d,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure Browser"],d],[/focus\/([\w\.]+)/i],[d,[p,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[d,[p,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[d,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[p,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[p,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[d,[p,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[p,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],d],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[p,d],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[p],[/;fbav\/([\w\.]+);/i],[d,[p,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[p,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[p,d],[/\bgsa\/([\w\.]+)\s.*safari\//i],[d,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[p,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],d],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[d,[p,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[p,d],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[p,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[p,[d,T.str,_.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[p,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[p,"Netscape"],d],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[d,[p,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[p,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,E.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[b,/ower/,"",E.lowerize]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,E.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[l,[f,"Samsung"],[h,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[l,[f,"Samsung"],[h,g]],[/\((ip(?:hone|od)[\s\w]*);/i],[l,[f,"Apple"],[h,g]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,"Apple"],[h,y]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[l,[f,"Huawei"],[h,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[l,[f,"Huawei"],[h,g]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[l,/_/g," "],[f,"Xiaomi"],[h,g]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[l,/_/g," "],[f,"Xiaomi"],[h,y]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[f,"OPPO"],[h,g]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[l,[f,"Vivo"],[h,g]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[l,[f,"Realme"],[h,g]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[l,[f,"Motorola"],[h,g]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[f,"Motorola"],[h,y]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[l,[f,"LG"],[h,y]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[l,[f,"LG"],[h,g]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[l,[f,"Lenovo"],[h,y]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[l,/_/g," "],[f,"Nokia"],[h,g]],[/droid.+;\s(pixel\sc)[\s)]/i],[l,[f,"Google"],[h,y]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[l,[f,"Google"],[h,g]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,"Sony"],[h,g]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[l,"Xperia Tablet"],[f,"Sony"],[h,y]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[l,[f,"OnePlus"],[h,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[l,[f,"Amazon"],[h,y]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[l,"Fire Phone"],[f,"Amazon"],[h,g]],[/\((playbook);[\w\s\),;-]+(rim)/i],[l,f,[h,y]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[l,[f,"BlackBerry"],[h,g]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[l,[f,"ASUS"],[h,y]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[l,[f,"ASUS"],[h,g]],[/(nexus\s9)/i],[l,[f,"HTC"],[h,y]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[l,/_/g," "],[h,g]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[l,[f,"Acer"],[h,y]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[l,[f,"Meizu"],[h,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,l,[h,g]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[f,l,[h,y]],[/\s(surface\sduo)\s/i],[l,[f,"Microsoft"],[h,y]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[l,[f,"Fairphone"],[h,g]],[/\s(u304aa)\sbuild/i],[l,[f,"AT&T"],[h,g]],[/sie-(\w*)/i],[l,[f,"Siemens"],[h,g]],[/[;\/]\s?(rct\w+)\sbuild/i],[l,[f,"RCA"],[h,y]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[l,[f,"Dell"],[h,y]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[l,[f,"Verizon"],[h,y]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[l,[f,"Barnes & Noble"],[h,y]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[l,[f,"NuVision"],[h,y]],[/;\s(k88)\sbuild/i],[l,[f,"ZTE"],[h,y]],[/;\s(nx\d{3}j)\sbuild/i],[l,[f,"ZTE"],[h,g]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[l,[f,"Swiss"],[h,g]],[/[;\/]\s?(zur\d{3})\sbuild/i],[l,[f,"Swiss"],[h,y]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[l,[f,"Zeki"],[h,y]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[f,"Dragon Touch"],l,[h,y]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[l,[f,"Insignia"],[h,y]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[l,[f,"NextBook"],[h,y]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[f,"Voice"],l,[h,g]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[f,"LvTel"],l,[h,g]],[/;\s(ph-1)\s/i],[l,[f,"Essential"],[h,g]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[l,[f,"Envizen"],[h,y]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[l,[f,"MachSpeed"],[h,y]],[/[;\/]\s?tu_(1491)\sbuild/i],[l,[f,"Rotor"],[h,y]],[/(shield[\w\s]+)\sbuild/i],[l,[f,"Nvidia"],[h,y]],[/(sprint)\s(\w+)/i],[f,l,[h,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,"Microsoft"],[h,g]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,"Zebra"],[h,y]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,"Zebra"],[h,g]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[f,l,[h,v]],[/droid.+;\s(shield)\sbuild/i],[l,[f,"Nvidia"],[h,v]],[/(playstation\s[345portablevi]+)/i],[l,[f,"Sony"],[h,v]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[l,[f,"Microsoft"],[h,v]],[/smart-tv.+(samsung)/i],[f,[h,w]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,"Samsung"],[h,w]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[f,"LG"],[h,w]],[/(apple)\s?tv/i],[f,[l,"Apple TV"],[h,w]],[/crkey/i],[[l,"Chromecast"],[f,"Google"],[h,w]],[/droid.+aft([\w])(\sbuild\/|\))/i],[l,[f,"Amazon"],[h,w]],[/\(dtv[\);].+(aquos)/i],[l,[f,"Sharp"],[h,w]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,E.trim],[l,E.trim],[h,w]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[h,w]],[/((pebble))app\/[\d\.]+\s/i],[f,l,[h,m]],[/droid.+;\s(glass)\s\d/i],[l,[f,"Google"],[h,m]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[l,[f,"Zebra"],[h,m]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[f,[h,S]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[l,[h,g]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[l,[h,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,E.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[f,"Generic"]],[/(phone)/i],[[h,g]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[p,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,p]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[p,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[p,[d,T.str,_.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[p,"Windows"],[d,T.str,_.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[p,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[p,"Mac OS"],[d,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[p,d],[/\(bb(10);/i],[d,[p,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[d,[p,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[p,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[p,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[p,"Chromium OS"],d],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[p,d],[/(sunos)\s?([\w\.\d]*)/i],[[p,"Solaris"],d],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[p,d]]},I=function(t,e){if("object"==typeof t&&(e=t,t=o),!(this instanceof I))return new I(t,e).getResult();var n=t||(void 0!==i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=e?E.extend(A,e):A;return this.getBrowser=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.browser),t.major=E.major(t.version),t},this.getCPU=function(){var t={architecture:o};return T.rgx.call(t,n,r.cpu),t},this.getDevice=function(){var t={vendor:o,model:o,type:o};return T.rgx.call(t,n,r.device),t},this.getEngine=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.engine),t},this.getOS=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(t){return n=typeof t===u&&t.length>255?E.trim(t,255):t,this},this.setUA(n),this};I.VERSION="0.7.28",I.BROWSER={NAME:p,MAJOR:"major",VERSION:d},I.CPU={ARCHITECTURE:b},I.DEVICE={MODEL:l,VENDOR:f,TYPE:h,CONSOLE:v,MOBILE:g,SMARTTV:w,TABLET:y,WEARABLE:m,EMBEDDED:S},I.ENGINE={NAME:p,VERSION:d},I.OS={NAME:p,VERSION:d},typeof e!==a?(t.exports&&(e=t.exports=I),e.UAParser=I):(r=function(){return I}.call(e,n,e,t))===o||(t.exports=r);var x=void 0!==i&&(i.jQuery||i.Zepto);if(x&&!x.ua){var O=new I;x.ua=O.getResult(),x.ua.get=function(){return O.getUA()},x.ua.set=function(t){O.setUA(t);var e=O.getResult();for(var n in e)x.ua[n]=e[n]}}}("object"==typeof window?window:this)},306:function(t){"use strict";t.exports={i8:"0.0.7"}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};!function(){"use strict";n.d(r,{default:function(){return ue}});var t=function(t,e){void 0===e&&(e={}),this.name=t,this.properties=e,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.activeTriggers=[],this.occurred=(new Date).toISOString()},e=n(489),i=n.n(e),o=function(){function t(){}return t.getString=function(e,n){return t.LOCAL_STORAGE.getItem(e)||n},t.setString=function(e,n){n||(n=""),t.LOCAL_STORAGE.setItem(e,n)},t.getNumber=function(e,n){return+t.getString(e,"")||n},t.setNumber=function(e,n){t.setString(e,n.toString())},t.getBoolean=function(t,e){var n=this.LOCAL_STORAGE.getItem(t);return n?JSON.parse(n):e},t.setBoolean=function(e,n){t.setString(e,JSON.stringify(n))},t.getObject=function(e){try{return JSON.parse(t.getString(e,""))}catch(t){return null}},t.setObject=function(e,n){t.setString(e,JSON.stringify(n))},t.remove=function(e){t.LOCAL_STORAGE.removeItem(e)},t.LOCAL_STORAGE=window.localStorage,t}(),s=function(){function t(){}var e;return t.API_URL="https://api.sdk.letscooee.com",t.SDK_VERSION=n(306).i8,t.SDK_DEBUG=!1,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.CANVAS_WIDTH=1080,t.CANVAS_HEIGHT=1920,t.STORAGE_USER_ID="uid",t.STORAGE_SDK_TOKEN="st",t.STORAGE_DEVICE_UUID="uuid",t.STORAGE_SESSION_ID="sid",t.STORAGE_SESSION_NUMBER="sn",t.STORAGE_SESSION_START_TIME="sst",t.STORAGE_SESSION_START_EVENT_SENT="sses",t.STORAGE_FIRST_TIME_LAUNCH="ifl",t.STORAGE_LAST_ACTIVE="la",t.STORAGE_TRIGGER_START_TIME="tst",t.STORAGE_ACTIVE_TRIGGER="at",t.STORAGE_ACTIVE_TRIGGERS="ats",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_CONTAINER_NAME="cooee-wrapper",e=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(e,10),t}(),a=function(){function t(){this.inInactive=!0,this.lastEnterActive=new Date,this.lastEnterInactive=null,this.isDebug=!1}return t.getInstance=function(){return this.INSTANCE},t.prototype.getWebAppVersion=function(){var t;return null!==(t=this.webAppVersion)&&void 0!==t?t:"0.0.1+1"},t.prototype.setWebAppVersion=function(t){this.webAppVersion=t},t.prototype.isDebugWebApp=function(){return this.isDebug},t.prototype.setDebugWebApp=function(t){this.isDebug=t},t.prototype.isInactive=function(){return this.inInactive},t.prototype.setInactive=function(){this.inInactive=!0,this.lastEnterInactive=new Date,o.setNumber(s.STORAGE_LAST_ACTIVE,this.lastEnterInactive.getTime())},t.prototype.setActive=function(){this.inInactive=!1,this.lastEnterActive=new Date},t.prototype.isFirstActive=function(){return null==this.lastEnterInactive},t.prototype.getLastEnterInactive=function(){return this.lastEnterInactive},t.prototype.getTimeForActiveInSeconds=function(){var t,e;return((null===(t=this.lastEnterInactive)||void 0===t?void 0:t.getTime())-(null===(e=this.lastEnterActive)||void 0===e?void 0:e.getTime()))/1e3},t.prototype.getTimeForInactiveInSeconds=function(){return null==this.lastEnterInactive?0:((new Date).getTime()-this.lastEnterInactive.getTime())/1e3},t.INSTANCE=new t,t}(),c=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},u=function(){function t(){}return t.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.log.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t.warning=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.warn.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t}(),l=function(){function t(t){t.s&&(this.s=new d(t.s)),t.g&&(this.g=new g(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const p=new RegExp("[^#a-f\\d]","gi"),h=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var f,d=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||p.test(t)||!h.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const r=Number.parseInt(t,16),i=r>>16,o=r>>8&255,s=255&r,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[i,o,s,a]:"css"===e.format?`rgb(${i} ${o} ${s}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:i,green:o,blue:s,alpha:a}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),b=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new d(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return f[null!==(t=this.s)&&void 0!==t?t:f.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(f||(f={}));var v,g=function(){function t(t){this.r=t.r,t.c&&(this.c=new d(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),t}(),y=(Object.defineProperty(function(){}.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),function(){function t(t){this.t=t.t,t.bg&&(this.bg=new l(t.bg)),t.br&&(this.br=new b(t.br)),this.clc=t.clc,this.shd=t.shd,this.spc=t.spc,this.trf=t.trf,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y}return Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return v[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}());!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(v||(v={}));var w,m,S=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])})(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)}}(),E=function(t){function e(e){return t.call(this,e)||this}return S(e,t),e}(y),T=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])})(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)}}(),_=function(t){function e(e){var n=t.call(this,e)||this;return n.src=e.src,n}return T(e,t),e}(y),A=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])})(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)}}(),I=function(t){function e(e){var n=t.call(this,e)||this;return n.alg=w.START,n.prs=e.prs,n.alg=e.alg,e.f&&(n.f=e.f),e.c&&(n.c=new d(e.c)),n}return A(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(y);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(w||(w={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(m||(m={}));var x,O=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])})(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)}}(),N=function(t){function e(e){var n,r=t.call(this,e)||this;return r.o=null!==(n=e.o)&&void 0!==n?n:x.C,r}return O(e,t),e.prototype.getStyles=function(){var t;return(t=this.o===x.NW?{top:0,left:0}:this.o===x.N?{top:0,left:"50%",transform:"translateX(-50%)"}:this.o===x.NE?{top:0,right:0}:this.o===x.E?{top:"50%",left:0,transform:"translateY(-50%)"}:this.o===x.SE?{bottom:0,right:0}:this.o===x.S?{bottom:0,left:"50%",transform:"translateX(-50%)"}:this.o===x.SW?{bottom:0,left:0}:this.o===x.W?{top:"50%",left:0,transform:"translateY(-50%)"}:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"}).position="absolute",t},e}(y);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(x||(x={}));var D,k=function(t){var e=this;this.elems=[],this.cont=new N(t.cont),t.elems.forEach((function(t){t.t===v.IMAGE?e.elems.push(new _(t)):t.t===v.TEXT||t.t===v.BUTTON?e.elems.push(new I(t)):t.t===v.SHAPE&&e.elems.push(new E(t))}))},C=function(t){this.expireAt=(new Date).getTime(),this.id=t.id,this.expireAt=t.expireAt,this.version=t.version,this.engagementID=t.engagementID,this.internal=t.internal,this.pn=t.pn,this.ian=new k(t.ian)},P=function(){function t(){this.doc=document}return t.prototype.getWidth=function(){return document.documentElement.clientWidth},t.prototype.getHeight=function(){return document.documentElement.clientHeight},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,n){e&&(n?t.style.setProperty(e,n):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},t.prototype.getElementById=function(t){return this.doc.getElementById(t)},t}(),R=n(238),M=n.n(R);!function(t){t.Location="LOCATION",t.Push="PUSH",t.Camera="CAMERA"}(D||(D={}));var j=function(){function e(t){this.action=t,this.apiService=nt.getInstance()}return e.prototype.execute=function(){this.externalAction(),this.iabAction(),this.upAction(),this.kvAction(),this.prompt(),this.closeAction(),this.shareAction()},e.prototype.externalAction=function(){var t;this.action.ext&&(null===(t=window.open(this.action.ext.u,"_blank"))||void 0===t||t.focus())},e.prototype.iabAction=function(){this.action.iab&&(new q).render(this.action.iab.u)},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.kvAction=function(){this.action.kv&&document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:this.action.kv}))},e.prototype.prompt=function(){var t=this.action.prompt;t&&(t===D.Location&&this.promptLocationPermission(),t===D.Push&&this.promptPushNotificationPermission(),t===D.Camera&&this.promptCameraPermission())},e.prototype.closeAction=function(){var e;if(this.action.close){(new K).removeInApp();var n=o.getNumber(s.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),r={triggerID:null===(e=o.getObject(s.STORAGE_ACTIVE_TRIGGER))||void 0===e?void 0:e.triggerID,"Close Behaviour":"CTA",Duration:((new Date).getTime()-n)/1e3};this.apiService.sendEvent(new t("CE Trigger Closed",r)),o.remove(s.STORAGE_TRIGGER_START_TIME)}},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):u.warning("Navigator.share is not compatible with this browser"))},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateProfile({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateProfile({pnPerm:Notification.permission}):u.warning("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return t=this,e=void 0,r=function(){var t,e,n;return function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(r){switch(r.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=r.sent(),[4,this.checkPermission("geolocation")];case 2:return e=r.sent(),n=Notification.permission,[2,{camera:t,location:e,notification:n}]}}))},new((n=void 0)||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateProfile({perm:e})}))},e}(),L=function(){function t(t,e){var n,r,i;this.screenWidth=0,this.screenHeight=0,this.scalingFactor=(r=document.documentElement.clientWidth,i=document.documentElement.clientHeight,n=r<i?r/Math.min(s.CANVAS_WIDTH,s.CANVAS_HEIGHT):i/Math.max(s.CANVAS_WIDTH,s.CANVAS_HEIGHT),Math.min(n,1)),this.parentHTMLEl=t,this.inappElement=e,this.renderer=new P,this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return t.prototype.getHTMLElement=function(){return this.inappHTMLEl},t.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},t.prototype.processCommonBlocks=function(){this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"overflow","visible"),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},t.prototype.processWidthAndHeight=function(){this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},t.prototype.getSizePx=function(t){return t*this.scalingFactor+"px"},t.prototype.processPositionBlock=function(){this.inappElement.x&&(this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)))},t.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},t.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.p&&this.renderer.setStyle(this.inappHTMLEl,"padding",this.getSizePx(t.p)),t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},t.prototype.processTransformBlock=function(){var t=this.inappElement.trf;t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate("+t.rotate+"deg)")},t.prototype.registerAction=function(){var t=this.inappElement.clc;t&&this.inappHTMLEl.addEventListener("click",(function(){new j(t).execute()}))},t.prototype.processBackgroundBlock=function(){var t,e=this.inappElement.bg;if(e){var n=this.inappHTMLEl;this.inappElement instanceof N&&(n=n.parentElement);var r="";if((null===(t=(new(M())).getBrowser().name)||void 0===t?void 0:t.toLowerCase().includes("safari"))&&(r="-webkit-"),e.glossy)this.renderer.setStyle(n,r+"backdrop-filter","blur("+e.glossy.radius+"px)"),e.glossy.color&&this.processColourBlock(e.glossy.color,"background",n);else if(e.solid)e.solid.grad?this.processGradient(e.solid.grad,"background"):e.solid.hex&&this.renderer.setStyle(n,"background",e.solid.rgba);else if(e.img){if(!e.img.src)return;var i='url("'+e.img.src+'") no-repeat center';this.renderer.setStyle(n,"background",i),this.renderer.setStyle(n,"background-size","cover"),e.img.a&&this.renderer.setStyle(n,r+"backdrop-filter","opacity("+e.img.a+")")}}},t.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var n="linear-gradient("+t.ang+"deg, "+t.c1+", "+t.c2;t.c3&&(n+=", "+t.c3),t.c4&&(n+=", "+t.c4),t.c5&&(n+=", "+t.c5);var r=n+=")";this.renderer.setStyle(this.inappHTMLEl,e,r)}},t.prototype.processColourBlock=function(t,e,n){void 0===e&&(e="color"),void 0===n&&(n=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(n,e,t.rgba))},t}(),H=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])})(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)}}(),G=function(t){function e(e,n){return t.call(this,e,n)||this}return H(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t=this.inappElement.font;t&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(t.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",t.ff),this.renderer.setStyle(this.inappHTMLEl,"line-height",t.lh))},e.prototype.processPart=function(t,e){var n,r=[];e.u&&r.push("underline"),e.st&&r.push("line-through"),r.length||r.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",r.join(" ")),this.renderer.setStyle(t,"color",null!==(n=e.c)&&void 0!==n?n:"inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=w[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(L),B=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])})(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)}}(),U=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("div"),r.insertElement(),r}return B(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var n,r,i=e.renderer.createElement("span");i.innerHTML=null===(r=null===(n=t.txt)||void 0===n?void 0:n.toString())||void 0===r?void 0:r.replace(/\n/g,"<br />"),e.processPart(i,t),e.renderer.appendChild(e.inappHTMLEl,i)})),this.processCommonBlocks()},e}(G),V=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])})(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)}}(),F=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("div"),r.insertElement(),r}return V(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(L),z=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])})(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)}}(),W=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("img"),r.insertElement(),r}return z(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","100%"),this.renderer.setStyle(this.inappHTMLEl,"max-height","100%"),this.renderer.setStyle(this.inappHTMLEl,"display","block"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(L),K=function(){function t(){this.renderer=new P}return t.prototype.render=function(){this.removeInApp();var t=this.renderer.createElement("div");return t.id=s.IN_APP_CONTAINER_NAME,t.classList.add(s.IN_APP_CONTAINER_NAME),this.renderer.setStyle(t,"z-index","10000000"),this.renderer.setStyle(t,"position","fixed"),this.renderer.setStyle(t,"top","0"),this.renderer.setStyle(t,"left","0"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.appendChild(document.body,t),t},t.prototype.removeInApp=function(){var t=document.getElementById(s.IN_APP_CONTAINER_NAME);t&&t.parentElement.removeChild(t)},t}(),q=function(){function t(){this.renderer=new P}return t.prototype.render=function(t){var e=this.renderer.getElementById(s.IN_APP_CONTAINER_NAME),n=this.createIFrameContainer();return this.createIFrameElement(n,t),this.createAnchorElement(e,n),this.renderer.appendChild(e,n),n},t.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},t.prototype.createIFrameElement=function(t,e){var n=this.renderer.createElement("iframe");return this.renderer.setStyle(n,"width","100%"),this.renderer.setStyle(n,"height","100%"),this.renderer.setAttribute(n,"src",e),this.renderer.setAttribute(n,"frameBorder","0"),this.renderer.appendChild(t,n),n},t.prototype.createAnchorElement=function(t,e){var n=this.renderer.createElement("a");return this.renderer.setStyle(n,"position","absolute"),this.renderer.setStyle(n,"top","0px"),this.renderer.setStyle(n,"right","0px"),n.href="#",n.innerHTML="Close",n.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,n),n},t}(),X=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])})(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)}}(),$=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("div"),r.insertElement(),r.inappElement.w=1080,r.inappElement.h=1920,r}return X(e,t),e.prototype.render=function(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),Object.assign(this.inappHTMLEl.style,this.inappElement.getStyles()),this},e}(L),J=function(){function t(t){this.triggerID=t.id,this.engagementID=t.engagementID,this.expireAt=t.expireAt,this.isExpired&&(this.expired=this.isExpired)}return Object.defineProperty(t.prototype,"isExpired",{get:function(){return this.expireAt<(new Date).getTime()},enumerable:!1,configurable:!0}),t}(),Y=function(){function t(){}return t.storeActiveTrigger=function(t){var e=o.getObject(s.STORAGE_ACTIVE_TRIGGERS);e||(e=[]);var n=new J(t);n.isExpired||e.push(n),o.setObject(s.STORAGE_ACTIVE_TRIGGER,n),o.setObject(s.STORAGE_ACTIVE_TRIGGERS,e)},t.getActiveTriggers=function(){var t=o.getObject(s.STORAGE_ACTIVE_TRIGGERS);return t?(t.forEach((function(t,e,n){new J(t).isExpired&&n.splice(e,1)})),o.setObject(s.STORAGE_ACTIVE_TRIGGERS,t),t):[]},t}(),Z=function(){function e(){this.rootContainer=(new K).render()}return e.prototype.render=function(e){e=new C(e),this.ian=e.ian;try{this.renderContainer();var n=new t("CE Trigger Displayed",{triggerID:e.id});nt.getInstance().sendEvent(n),o.setNumber(s.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),Y.storeActiveTrigger(e)}catch(t){u.error(t)}},e.prototype.renderElement=function(t,e){e instanceof I?new U(t,e).render():e instanceof _?new W(t,e).render():e instanceof E?new F(t,e).render():u.error("Unsupported element type- "+e.type)},e.prototype.renderContainer=function(){var t,e,n=this,r=null===(t=this.ian)||void 0===t?void 0:t.cont;if(r){var i=new $(this.rootContainer,r).render().getHTMLElement();null===(e=this.ian.elems)||void 0===e||e.forEach((function(t){n.renderElement(i,t)}))}},e}(),Q=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},tt=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},et=function(){function t(){this.runtimeData=a.getInstance(),this.apiToken="",this.userID=""}return t.getInstance=function(){return this.INSTANCE},t.prototype.doHTTP=function(t,e,n,r){return Q(this,void 0,void 0,(function(){var i,o;return tt(this,(function(a){switch(a.label){case 0:return e.startsWith("http")||(e=s.API_URL+e),!("keepalive"in new Request(""))&&JSON.stringify(n).includes("CE App Background")?((i=new XMLHttpRequest).open("POST",e,!1),r.forEach((function(t,e){i.setRequestHeader(e,t)})),i.send(JSON.stringify(n)),[2,i.response.json()]):[4,fetch(e,{method:t,body:JSON.stringify(n),headers:r,keepalive:!0})];case 1:if(!(o=a.sent()).ok)throw o;return[2,o.json()]}}))}))},t.prototype.registerDevice=function(t){return Q(this,void 0,void 0,(function(){return tt(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",t,this.getDefaultHeaders())]}))}))},t.prototype.sendEvent=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),t.activeTriggers=Y.getActiveTriggers();var n=o.getObject(s.STORAGE_ACTIVE_TRIGGER);n&&(t.trigger=n),this.doHTTP("POST","/v1/event/track",t,e).then((function(e){u.log("Sent",t.name),e.triggerData&&(new Z).render(e.triggerData)})).catch((function(t){u.error("Error sending event",t)}))},t.prototype.updateUserData=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("PUT","/v1/user/update",t,e).then((function(){u.log("Updated user profile")})).catch((function(t){u.error("Error saving user profile",t)}))},t.prototype.concludeSession=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("POST","/v1/session/conclude",t,e).then((function(t){u.log("Conclude Session",t)})).catch((function(t){u.error(t)}))},t.prototype.getDefaultHeaders=function(){var t=new Headers;return t.set("sdk-version",s.SDK_VERSION),t.set("sdk-version-code",s.SDK_VERSION_CODE.toString()),t.set("app-version",this.runtimeData.getWebAppVersion()),t.set("user-id",this.userID),s.SDK_DEBUG&&t.set("sdk-debug",String(1)),this.runtimeData.isDebugWebApp()&&t.set("app-debug",String(1)),t},t.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},t.prototype.setUserId=function(t){this.userID=null!=t?t:""},t.INSTANCE=new t,t}(),nt=function(){function t(){this.sessionManager=rt.getInstance(),this.httpApiService=et.getInstance()}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.sendEvent=function(t){var e=this;ee.replaySubject.subscribe((function(){e.addEventVariable(t),e.httpApiService.sendEvent(t)}))},t.prototype.updateProfile=function(t){var e=this;ee.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},t.prototype.concludeSession=function(t){var e=this;ee.replaySubject.subscribe((function(){e.httpApiService.concludeSession(t)}))},t.prototype.addEventVariable=function(t){t.screenName=location.pathname,t.properties.path=location.pathname,t.sessionID=this.sessionManager.getCurrentSessionID(),t.sessionNumber=this.sessionManager.getCurrentSessionNumber()},t}(),rt=function(){function t(){}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.getCurrentSessionID=function(){return this.currentSessionID||null},t.prototype.isNewSessionRequired=function(){if(!o.getString(s.STORAGE_SESSION_ID,""))return!0;var t=o.getNumber(s.STORAGE_SESSION_START_TIME,0);return((new Date).getTime()-t)/1e3>s.IDLE_TIME_IN_SECONDS},t.prototype.checkForNewSession=function(){this.isNewSessionRequired()?this.startNewSession():this.initializeSessionFromStorage()},t.prototype.startNewSession=function(){this.currentSessionID||(o.setBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!1),this.currentSessionStartTime=new Date,this.currentSessionID=(new(i())).toHexString(),o.setNumber(s.STORAGE_SESSION_START_TIME,this.currentSessionStartTime.getTime()),o.setString(s.STORAGE_SESSION_ID,this.currentSessionID),this.bumpSessionNumber())},t.prototype.bumpSessionNumber=function(){this.currentSessionNumber=o.getNumber(s.STORAGE_SESSION_NUMBER,0),this.currentSessionNumber+=1,o.setNumber(s.STORAGE_SESSION_NUMBER,this.currentSessionNumber)},t.prototype.getCurrentSessionNumber=function(){return this.currentSessionNumber||0},t.prototype.getTotalDurationInSeconds=function(){if(a.getInstance().isFirstActive())throw new Error("This is the first time in foreground after launch");return(this.getLastActive()-this.currentSessionStartTime.getTime())/1e3},t.prototype.conclude=function(){var t={sessionID:this.currentSessionID,occurred:new Date,duration:this.getTotalDurationInSeconds()};nt.getInstance().concludeSession(t),o.remove(s.STORAGE_ACTIVE_TRIGGER),this.destroySession()},t.prototype.destroySession=function(){this.currentSessionID=void 0,this.currentSessionNumber=void 0,this.currentSessionStartTime=void 0,o.remove(s.STORAGE_SESSION_ID),o.remove(s.STORAGE_SESSION_START_TIME)},t.prototype.initializeSessionFromStorage=function(){this.currentSessionStartTime=new Date(o.getNumber(s.STORAGE_SESSION_START_TIME,0)),this.currentSessionID=o.getString(s.STORAGE_SESSION_ID,""),this.currentSessionNumber=o.getNumber(s.STORAGE_SESSION_NUMBER,0)},t.prototype.getLastActive=function(){return o.getNumber(s.STORAGE_LAST_ACTIVE,0)},t}(),it=function(t,e,n,r){this.appID=t,this.appSecret=e,this.uuid=n,this.props=r,this.sdk=s.SDK},ot=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},st=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},at=function(){function t(){this.parser=new(M()),this.result={}}return t.prototype.get=function(){return ot(this,void 0,void 0,(function(){var t;return st(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,n=t.offsetWidth*e;return document.body.removeChild(t),n},t.prototype.getLocation=function(){return ot(this,void 0,void 0,(function(){var t=this;return st(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(n){t.result.coords=[n.coords.latitude,n.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return ot(this,void 0,void 0,(function(){var t;return st(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),ct=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},ut=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},lt=function(){function t(){this.apiService=et.getInstance(),this.sdkToken="",this.userID="",this.appID="",this.appSecret=""}return t.getInstance=function(){return this.INSTANCE},t.prototype.init=function(t,e){return this.appID=t,this.appSecret=e,this.acquireSDKToken()},t.prototype.hasToken=function(){return!!o.getString(s.STORAGE_SDK_TOKEN,"")},t.prototype.getUserID=function(){return this.userID},t.prototype.populateUserDataFromStorage=function(){return ct(this,void 0,void 0,(function(){return ut(this,(function(t){return this.sdkToken=o.getString(s.STORAGE_SDK_TOKEN,""),this.sdkToken||u.log("No SDK token found in local storage"),this.userID=o.getString(s.STORAGE_USER_ID,""),this.userID||u.log("No user ID found in local storage"),this.updateAPIClient(),[2]}))}))},t.prototype.updateAPIClient=function(){u.log("SDK Token:",this.sdkToken),u.log("User ID:",this.userID),this.apiService.setAPIToken(this.sdkToken),this.apiService.setUserId(this.userID)},t.prototype.acquireSDKToken=function(){return ct(this,void 0,void 0,(function(){return ut(this,(function(t){return this.hasToken()?[2,this.populateUserDataFromStorage()]:(u.log("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}))}))},t.prototype.getSDKTokenFromServer=function(){return ct(this,void 0,void 0,(function(){var t,e,n,r;return ut(this,(function(i){switch(i.label){case 0:return[4,this.getUserAuthRequest()];case 1:t=i.sent(),e=this.apiService.registerDevice(t),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e];case 3:return n=i.sent(),u.log("Register Device Response",n),this.saveUserDataInStorage(n),[3,5];case 4:throw r=i.sent(),u.error(r),r;case 5:return[2]}}))}))},t.prototype.saveUserDataInStorage=function(t){this.sdkToken=t.sdkToken,this.userID=t.id,this.updateAPIClient(),o.setString(s.STORAGE_SDK_TOKEN,this.sdkToken),o.setString(s.STORAGE_USER_ID,this.userID)},t.prototype.getUserAuthRequest=function(){return ct(this,void 0,void 0,(function(){var t;return ut(this,(function(e){switch(e.label){case 0:return[4,(new at).get()];case 1:return t=e.sent(),[2,new it(this.appID,this.appSecret,this.getOrCreateUUID(),t)]}}))}))},t.prototype.getOrCreateUUID=function(){var t=o.getString(s.STORAGE_DEVICE_UUID,"");return t||(t=(new(i())).toHexString(),o.setString(s.STORAGE_DEVICE_UUID,t)),t},t.INSTANCE=new t,t}(),pt=function(t,e){return(pt=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)};function ht(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}pt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function ft(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.")}function dt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.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 s}function bt(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function vt(t){return"function"==typeof t}function gt(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var yt=gt((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function wt(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var mt=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=ft(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(vt(c))try{c()}catch(t){i=t instanceof yt?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var l=ft(u),p=l.next();!p.done;p=l.next()){var h=p.value;try{Tt(h)}catch(t){i=null!=i?i:[],t instanceof yt?i=bt(bt([],dt(i)),dt(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new yt(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Tt(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&wt(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&wt(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),St=mt.EMPTY;function Et(t){return t instanceof mt||t&&"closed"in t&&vt(t.remove)&&vt(t.add)&&vt(t.unsubscribe)}function Tt(t){vt(t)?t():t.unsubscribe()}var _t=null,At=null,It=void 0,xt=!1,Ot=!1,Nt={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Nt.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,bt([],dt(t)))},clearTimeout:function(t){var e=Nt.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Dt(t){Nt.setTimeout((function(){if(!_t)throw t;_t(t)}))}function kt(){}var Ct=Pt("C",void 0,void 0);function Pt(t,e,n){return{kind:t,value:e,error:n}}var Rt=null;function Mt(t){if(xt){var e=!Rt;if(e&&(Rt={errorThrown:!1,error:null}),t(),e){var n=Rt,r=n.errorThrown,i=n.error;if(Rt=null,r)throw i}}else t()}function jt(t){xt&&Rt&&(Rt.errorThrown=!0,Rt.error=t)}var Lt=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Et(e)&&e.add(n)):n.destination=Vt,n}return ht(e,t),e.create=function(t,e,n){return new Ht(t,e,n)},e.prototype.next=function(t){this.isStopped?Ut(function(t){return Pt("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Ut(Pt("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Ut(Ct,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(mt),Ht=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(vt(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&Ot?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s),r=null==r?void 0:r.bind(s)}return o.destination={next:i?Gt(i):kt,error:Gt(null!=n?n:Bt),complete:r?Gt(r):kt},o}return ht(e,t),e}(Lt);function Gt(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,bt([],dt(e)))}catch(t){xt?jt(t):Dt(t)}}}function Bt(t){throw t}function Ut(t,e){var n=At;n&&Nt.setTimeout((function(){return n(t,e)}))}var Vt={closed:!0,next:kt,error:Bt,complete:kt},Ft="function"==typeof Symbol&&Symbol.observable||"@@observable";function zt(t){return t}function Wt(t){return 0===t.length?zt:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Kt=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Lt||function(t){return t&&vt(t.next)&&vt(t.error)&&vt(t.complete)}(r)&&Et(r)?t:new Ht(t,e,n);return Mt((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=qt(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),null==i||i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Ft]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Wt(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=qt(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function qt(t){var e;return null!==(e=null!=t?t:It)&&void 0!==e?e:Promise}var Xt=gt((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),$t=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return ht(e,t),e.prototype.lift=function(t){var e=new Jt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Xt},e.prototype.next=function(t){var e=this;Mt((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=ft(i),s=o.next();!s.done;s=o.next())s.value.next(t)}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Mt((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Mt((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=e.hasError,r=e.isStopped,i=e.observers;return n||r?St:(i.push(t),new mt((function(){return wt(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new Kt;return t.source=this,t},e.create=function(t,e){return new Jt(t,e)},e}(Kt),Jt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return ht(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:St},e}($t),Yt={now:function(){return(Yt.delegate||Date).now()},delegate:void 0},Zt=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Yt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return ht(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,c=1;c<r.length&&r[c]<=s;c+=2)a=c;a&&r.splice(0,a+1)}},e}($t),Qt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},te=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},ee=function(){function e(){this.sessionManager=rt.getInstance(),this.safeHttpCallService=nt.getInstance(),this.userAuthService=lt.getInstance()}return e.prototype.init=function(t,n){var r=this;this.userAuthService.init(t,n).then((function(){e.replaySubject.next(!0),e.replaySubject.complete()})).catch((function(){setTimeout((function(){r.init(t,n)}),3e4)})),this.execute()},e.prototype.execute=function(){this.sessionManager.checkForNewSession(),o.getBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!1)||(o.setBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!0),this.isAppFirstTimeLaunch()?this.sendFirstLaunchEvent():this.sendSuccessiveLaunchEvent())},e.prototype.isAppFirstTimeLaunch=function(){return!!o.getBoolean(s.STORAGE_FIRST_TIME_LAUNCH,!0)&&(o.setBoolean(s.STORAGE_FIRST_TIME_LAUNCH,!1),!0)},e.prototype.sendFirstLaunchEvent=function(){return Qt(this,void 0,void 0,(function(){var e,n;return te(this,(function(r){switch(r.label){case 0:return e=new t("CE App Installed",{}),n=e,[4,(new at).get()];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return Qt(this,void 0,void 0,(function(){var e,n;return te(this,(function(r){switch(r.label){case 0:return e=new t("CE App Launched",{}),n=e,[4,(new at).get()];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.replaySubject=new Zt(1),e}(),ne=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},re=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},ie=function(){function e(){this.apiService=nt.getInstance(),this.runtimeData=a.getInstance()}return e.prototype.listen=function(){var t=this;document.onvisibilitychange=function(){"visible"===document.visibilityState?t.onVisible():"hidden"===document.visibilityState&&t.onHidden()}},e.prototype.onVisible=function(){return ne(this,void 0,void 0,(function(){var n,r,i,o;return re(this,(function(a){switch(a.label){case 0:return this.runtimeData.setActive(),(n=this.runtimeData.getTimeForInactiveInSeconds())>s.IDLE_TIME_IN_SECONDS&&(rt.getInstance().conclude(),(new ee).execute()),(r={})[e.INACTIVE_DURATION]=n,i=new t("CE App Foreground",r),o=i,[4,(new at).get()];case 1:return o.deviceProps=a.sent(),this.apiService.sendEvent(i),[2]}}))}))},e.prototype.onHidden=function(){return ne(this,void 0,void 0,(function(){var n,r;return re(this,(function(i){return this.runtimeData.setInactive(),n=this.runtimeData.getTimeForActiveInSeconds(),(r={})[e.ACTIVE_DURATION]=n,this.apiService.sendEvent(new t("CE App Background",r)),[2]}))}))},e.ACTIVE_DURATION="aDur",e.INACTIVE_DURATION="iaDur",e}(),oe=function(){function e(){this.apiService=nt.getInstance()}return e.prototype.listen=function(){var e=this;window.onpageshow=function(){e.apiService.sendEvent(new t("CE Screen View",{screenName:location.pathname}))}},e}(),se=function(){function t(){this.existingSDKObject=window.CooeeSDK}return t.prototype.meddle=function(){var t,e,n;this.existingSDKObject||(this.existingSDKObject=window.CooeeSDK={events:[],profile:[],account:[]}),this.existingSDKObject.account=null!==(t=this.existingSDKObject.account)&&void 0!==t?t:[],this.existingSDKObject.profile=null!==(e=this.existingSDKObject.profile)&&void 0!==e?e:[],this.existingSDKObject.events=null!==(n=this.existingSDKObject.events)&&void 0!==n?n:[],this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.existingSDKObject.account.forEach(this.processAccount),this.existingSDKObject.events.forEach(this.processEvent),this.existingSDKObject.profile.forEach(this.processProfile)},t.prototype.overwritePush=function(t,e){Object.defineProperty(t,"push",{enumerable:!1,configurable:!1,writable:!1,value:e})},t.prototype.meddleAccount=function(){var t=this;this.overwritePush(this.existingSDKObject.account,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processAccount(e[0])}))},t.prototype.meddleEvents=function(){var t=this;this.overwritePush(this.existingSDKObject.events,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processEvent(e[0])}))},t.prototype.meddleProfile=function(){var t=this;this.overwritePush(this.existingSDKObject.profile,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processProfile(e[0])}))},t.prototype.processAccount=function(t){if(t){var e=Object.keys(t);e.includes("appID")?ce.init(t.appID,t.appSecret):e.includes("appVersion")?ce.setWebAppVersion(t.appVersion):e.includes("debug")&&ce.setDebug(t.debug)}},t.prototype.processEvent=function(t){t&&ce.sendEvent(t[0],t[1])},t.prototype.processProfile=function(t){t&&ce.updateProfile(t)},t}(),ae=function(){function t(){}return t.prototype.init=function(){(new ie).listen(),(new oe).listen(),(new se).meddle()},t}(),ce=function(){function e(){this.runtimeData=a.getInstance(),this.safeHttpCallService=nt.getInstance(),this.newSessionExecutor=new ee}return e.init=function(t,e){this.INSTANCE.newSessionExecutor.init(t,e)},e.setWebAppVersion=function(t){this.INSTANCE.runtimeData.setWebAppVersion(t)},e.setDebug=function(t){this.INSTANCE.runtimeData.setDebugWebApp(t)},e.sendEvent=function(e,n){for(var r in n)if(r.length>3&&r.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");this.INSTANCE.safeHttpCallService.sendEvent(new t(e,n))},e.updateProfile=function(t){for(var e in t)if(e.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");this.INSTANCE.safeHttpCallService.updateProfile(t)},e.INSTANCE=new e,e}();(new ae).init();var ue=ce}();var i=CooeeSDK="undefined"==typeof CooeeSDK?{}:CooeeSDK,o=r.default;for(var s in o)i[s]=o[s];o.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})}();
2
+ !function(){var t={489:function(t){for(var e=Math.floor(16777215*Math.random()),n=u.index=parseInt(16777215*Math.random(),10),r=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,i=function(t){return!(null==t||!t.constructor||"function"!=typeof t.constructor.isBuffer||!t.constructor.isBuffer(t))},o=[],s=0;s<256;s++)o[s]=(s<=15?"0":"")+s.toString(16);var a=new RegExp("^[0-9a-fA-F]{24}$"),c=[];for(s=0;s<10;)c[48+s]=s++;for(;s<16;)c[55+s]=c[87+s]=s++;function u(t){if(!(this instanceof u))return new u(t);if(t&&(t instanceof u||"ObjectID"===t._bsontype))return t;if(this._bsontype="ObjectID",null!=t&&"number"!=typeof t){var e=u.isValid(t);if(!e&&null!=t)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&"string"==typeof t&&24===t.length)return u.createFromHexString(t);if(null==t||12!==t.length){if(null!=t&&"function"==typeof t.toHexString)return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=t}else this.id=this.generate(t)}t.exports=u,u.default=u,u.createFromTime=function(t){return new u((8,(8===(e=(e=t=parseInt(t,10)%4294967295).toString(16)).length?e:"00000000".substring(e.length,8)+e)+"0000000000000000"));var e},u.createFromHexString=function(t){if(void 0===t||null!=t&&24!==t.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",n=0;n<24;)e+=String.fromCharCode(c[t.charCodeAt(n++)]<<4|c[t.charCodeAt(n++)]);return new u(e)},u.isValid=function(t){return null!=t&&("number"==typeof t||("string"==typeof t?12===t.length||24===t.length&&a.test(t):t instanceof u||!!i(t)||"function"==typeof t.toHexString&&(t.id instanceof _Buffer||"string"==typeof t.id)&&(12===t.id.length||24===t.id.length&&a.test(t.id))))},u.prototype={constructor:u,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=o[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof u?this.toString()===t.toString():"string"==typeof t&&u.isValid(t)&&12===t.length&&i(this.id)?t===this.id.toString("binary"):"string"==typeof t&&u.isValid(t)&&24===t.length?t.toLowerCase()===this.toHexString():"string"==typeof t&&u.isValid(t)&&12===t.length?t===this.id:!(null==t||!(t instanceof u||t.toHexString))&&t.toHexString()===this.toHexString()},getTimestamp:function(){var t,e=new Date;return t=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,e.setTime(1e3*Math.floor(t)),e},generate:function(t){"number"!=typeof t&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var i=n=(n+1)%16777215;return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t,e>>16&255,e>>8&255,255&e,r>>8&255,255&r,i>>16&255,i>>8&255,255&i)}};var l=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";u.prototype[l]=function(){return"ObjectID("+this+")"},u.prototype.toJSON=u.prototype.toHexString,u.prototype.toString=u.prototype.toHexString},238:function(t,e,n){var r;!function(i,o){"use strict";var s="function",a="undefined",c="object",u="string",l="model",p="name",h="type",f="vendor",d="version",b="architecture",g="console",v="mobile",y="tablet",w="smarttv",m="wearable",S="embedded",E={extend:function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n},has:function(t,e){return typeof t===u&&-1!==e.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return typeof t===u?t.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(t,e){return t=t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),typeof e===a?t:t.substring(0,255)}},T={rgx:function(t,e){for(var n,r,i,a,u,l,p=0;p<e.length&&!u;){var h=e[p],f=e[p+1];for(n=r=0;n<h.length&&!u;)if(u=h[n++].exec(t))for(i=0;i<f.length;i++)l=u[++r],typeof(a=f[i])===c&&a.length>0?2==a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3==a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):o:this[a[0]]=l?a[1].call(this,l,a[2]):o:4==a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):o):this[a]=l||o;p+=2}},str:function(t,e){for(var n in e)if(typeof e[n]===c&&e[n].length>0){for(var r=0;r<e[n].length;r++)if(E.has(e[n][r],t))return"?"===n?o:n}else if(E.has(e[n],t))return"?"===n?o:n;return t}},_={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},A={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[p,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[p,d],[/opios[\/\s]+([\w\.]+)/i],[d,[p,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[d,[p,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,d],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[d,[p,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[d,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[p,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[d,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure Browser"],d],[/focus\/([\w\.]+)/i],[d,[p,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[d,[p,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[d,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[p,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[d,[p,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[d,[p,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[p,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],d],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[p,d],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[p],[/;fbav\/([\w\.]+);/i],[d,[p,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[p,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[p,d],[/\bgsa\/([\w\.]+)\s.*safari\//i],[d,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[d,[p,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],d],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[d,[p,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[p,d],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[d,[p,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[d,p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[p,[d,T.str,_.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[p,d],[/(navigator|netscape)\/([\w\.-]+)/i],[[p,"Netscape"],d],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[d,[p,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[p,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,E.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows\s(ce|mobile);\sppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[b,/ower/,"",E.lowerize]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,E.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[l,[f,"Samsung"],[h,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[l,[f,"Samsung"],[h,v]],[/\((ip(?:hone|od)[\s\w]*);/i],[l,[f,"Apple"],[h,v]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,"Apple"],[h,y]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[l,[f,"Huawei"],[h,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[l,[f,"Huawei"],[h,v]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[l,/_/g," "],[f,"Xiaomi"],[h,v]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[l,/_/g," "],[f,"Xiaomi"],[h,y]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[l,[f,"OPPO"],[h,v]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[l,[f,"Vivo"],[h,v]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[l,[f,"Realme"],[h,v]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[l,[f,"Motorola"],[h,v]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[f,"Motorola"],[h,y]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[l,[f,"LG"],[h,y]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[l,[f,"LG"],[h,v]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[l,[f,"Lenovo"],[h,y]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[l,/_/g," "],[f,"Nokia"],[h,v]],[/droid.+;\s(pixel\sc)[\s)]/i],[l,[f,"Google"],[h,y]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[l,[f,"Google"],[h,v]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,"Sony"],[h,v]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[l,"Xperia Tablet"],[f,"Sony"],[h,y]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[l,[f,"OnePlus"],[h,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[l,[f,"Amazon"],[h,y]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[l,"Fire Phone"],[f,"Amazon"],[h,v]],[/\((playbook);[\w\s\),;-]+(rim)/i],[l,f,[h,y]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[l,[f,"BlackBerry"],[h,v]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[l,[f,"ASUS"],[h,y]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[l,[f,"ASUS"],[h,v]],[/(nexus\s9)/i],[l,[f,"HTC"],[h,y]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[l,/_/g," "],[h,v]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[l,[f,"Acer"],[h,y]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[l,[f,"Meizu"],[h,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,l,[h,v]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[f,l,[h,y]],[/\s(surface\sduo)\s/i],[l,[f,"Microsoft"],[h,y]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[l,[f,"Fairphone"],[h,v]],[/\s(u304aa)\sbuild/i],[l,[f,"AT&T"],[h,v]],[/sie-(\w*)/i],[l,[f,"Siemens"],[h,v]],[/[;\/]\s?(rct\w+)\sbuild/i],[l,[f,"RCA"],[h,y]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[l,[f,"Dell"],[h,y]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[l,[f,"Verizon"],[h,y]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[l,[f,"Barnes & Noble"],[h,y]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[l,[f,"NuVision"],[h,y]],[/;\s(k88)\sbuild/i],[l,[f,"ZTE"],[h,y]],[/;\s(nx\d{3}j)\sbuild/i],[l,[f,"ZTE"],[h,v]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[l,[f,"Swiss"],[h,v]],[/[;\/]\s?(zur\d{3})\sbuild/i],[l,[f,"Swiss"],[h,y]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[l,[f,"Zeki"],[h,y]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[f,"Dragon Touch"],l,[h,y]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[l,[f,"Insignia"],[h,y]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[l,[f,"NextBook"],[h,y]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[f,"Voice"],l,[h,v]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[f,"LvTel"],l,[h,v]],[/;\s(ph-1)\s/i],[l,[f,"Essential"],[h,v]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[l,[f,"Envizen"],[h,y]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[l,[f,"MachSpeed"],[h,y]],[/[;\/]\s?tu_(1491)\sbuild/i],[l,[f,"Rotor"],[h,y]],[/(shield[\w\s]+)\sbuild/i],[l,[f,"Nvidia"],[h,y]],[/(sprint)\s(\w+)/i],[f,l,[h,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,"Microsoft"],[h,v]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,"Zebra"],[h,y]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,"Zebra"],[h,v]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[f,l,[h,g]],[/droid.+;\s(shield)\sbuild/i],[l,[f,"Nvidia"],[h,g]],[/(playstation\s[345portablevi]+)/i],[l,[f,"Sony"],[h,g]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[l,[f,"Microsoft"],[h,g]],[/smart-tv.+(samsung)/i],[f,[h,w]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,"Samsung"],[h,w]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[f,"LG"],[h,w]],[/(apple)\s?tv/i],[f,[l,"Apple TV"],[h,w]],[/crkey/i],[[l,"Chromecast"],[f,"Google"],[h,w]],[/droid.+aft([\w])(\sbuild\/|\))/i],[l,[f,"Amazon"],[h,w]],[/\(dtv[\);].+(aquos)/i],[l,[f,"Sharp"],[h,w]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,E.trim],[l,E.trim],[h,w]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[h,w]],[/((pebble))app\/[\d\.]+\s/i],[f,l,[h,m]],[/droid.+;\s(glass)\s\d/i],[l,[f,"Google"],[h,m]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[l,[f,"Zebra"],[h,m]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[f,[h,S]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[l,[h,v]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[l,[h,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,E.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[f,"Generic"]],[/(phone)/i],[[h,v]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[d,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[p,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,p]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[p,d],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[p,[d,T.str,_.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[p,"Windows"],[d,T.str,_.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[p,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[p,"Mac OS"],[d,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[p,d],[/\(bb(10);/i],[d,[p,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[d,[p,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[p,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[p,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[p,"Chromium OS"],d],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[p,d],[/(sunos)\s?([\w\.\d]*)/i],[[p,"Solaris"],d],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[p,d]]},I=function(t,e){if("object"==typeof t&&(e=t,t=o),!(this instanceof I))return new I(t,e).getResult();var n=t||(void 0!==i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=e?E.extend(A,e):A;return this.getBrowser=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.browser),t.major=E.major(t.version),t},this.getCPU=function(){var t={architecture:o};return T.rgx.call(t,n,r.cpu),t},this.getDevice=function(){var t={vendor:o,model:o,type:o};return T.rgx.call(t,n,r.device),t},this.getEngine=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.engine),t},this.getOS=function(){var t={name:o,version:o};return T.rgx.call(t,n,r.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(t){return n=typeof t===u&&t.length>255?E.trim(t,255):t,this},this.setUA(n),this};I.VERSION="0.7.28",I.BROWSER={NAME:p,MAJOR:"major",VERSION:d},I.CPU={ARCHITECTURE:b},I.DEVICE={MODEL:l,VENDOR:f,TYPE:h,CONSOLE:g,MOBILE:v,SMARTTV:w,TABLET:y,WEARABLE:m,EMBEDDED:S},I.ENGINE={NAME:p,VERSION:d},I.OS={NAME:p,VERSION:d},typeof e!==a?(t.exports&&(e=t.exports=I),e.UAParser=I):(r=function(){return I}.call(e,n,e,t))===o||(t.exports=r);var x=void 0!==i&&(i.jQuery||i.Zepto);if(x&&!x.ua){var O=new I;x.ua=O.getResult(),x.ua.get=function(){return O.getUA()},x.ua.set=function(t){O.setUA(t);var e=O.getResult();for(var n in e)x.ua[n]=e[n]}}}("object"==typeof window?window:this)},306:function(t){"use strict";t.exports={i8:"0.0.8"}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};!function(){"use strict";n.d(r,{default:function(){return ue}});var t=function(t,e){void 0===e&&(e={}),this.name=t,this.properties=e,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.activeTriggers=[],this.occurred=(new Date).toISOString()},e=n(489),i=n.n(e),o=function(){function t(){}return t.getString=function(e,n){return t.LOCAL_STORAGE.getItem(e)||n},t.setString=function(e,n){n||(n=""),t.LOCAL_STORAGE.setItem(e,n)},t.getNumber=function(e,n){return+t.getString(e,"")||n},t.setNumber=function(e,n){t.setString(e,n.toString())},t.getBoolean=function(t,e){var n=this.LOCAL_STORAGE.getItem(t);return n?JSON.parse(n):e},t.setBoolean=function(e,n){t.setString(e,JSON.stringify(n))},t.getObject=function(e){try{return JSON.parse(t.getString(e,""))}catch(t){return null}},t.setObject=function(e,n){t.setString(e,JSON.stringify(n))},t.remove=function(e){t.LOCAL_STORAGE.removeItem(e)},t.LOCAL_STORAGE=window.localStorage,t}(),s=function(){function t(){}var e;return t.API_URL="https://api.sdk.letscooee.com",t.SDK_VERSION=n(306).i8,t.SDK_DEBUG=!1,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.CANVAS_WIDTH=1080,t.CANVAS_HEIGHT=1920,t.STORAGE_USER_ID="uid",t.STORAGE_SDK_TOKEN="st",t.STORAGE_DEVICE_UUID="uuid",t.STORAGE_SESSION_ID="sid",t.STORAGE_SESSION_NUMBER="sn",t.STORAGE_SESSION_START_TIME="sst",t.STORAGE_SESSION_START_EVENT_SENT="sses",t.STORAGE_FIRST_TIME_LAUNCH="ifl",t.STORAGE_LAST_ACTIVE="la",t.STORAGE_TRIGGER_START_TIME="tst",t.STORAGE_ACTIVE_TRIGGER="at",t.STORAGE_ACTIVE_TRIGGERS="ats",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_CONTAINER_NAME="cooee-wrapper",e=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(e,10),t}(),a=function(){function t(){this.inInactive=!0,this.lastEnterActive=new Date,this.lastEnterInactive=null,this.isDebug=!1}return t.getInstance=function(){return this.INSTANCE},t.prototype.getWebAppVersion=function(){var t;return null!==(t=this.webAppVersion)&&void 0!==t?t:"0.0.1+1"},t.prototype.setWebAppVersion=function(t){this.webAppVersion=t},t.prototype.isDebugWebApp=function(){return this.isDebug},t.prototype.setDebugWebApp=function(t){this.isDebug=t},t.prototype.isInactive=function(){return this.inInactive},t.prototype.setInactive=function(){this.inInactive=!0,this.lastEnterInactive=new Date,o.setNumber(s.STORAGE_LAST_ACTIVE,this.lastEnterInactive.getTime())},t.prototype.setActive=function(){this.inInactive=!1,this.lastEnterActive=new Date},t.prototype.isFirstActive=function(){return null==this.lastEnterInactive},t.prototype.getLastEnterInactive=function(){return this.lastEnterInactive},t.prototype.getTimeForActiveInSeconds=function(){var t,e;return((null===(t=this.lastEnterInactive)||void 0===t?void 0:t.getTime())-(null===(e=this.lastEnterActive)||void 0===e?void 0:e.getTime()))/1e3},t.prototype.getTimeForInactiveInSeconds=function(){return null==this.lastEnterInactive?0:((new Date).getTime()-this.lastEnterInactive.getTime())/1e3},t.INSTANCE=new t,t}(),c=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},u=function(){function t(){}return t.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.log.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t.warning=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.warn.apply(console,c([s.LOG_PREFIX,":"],t,!1))},t}(),l=function(){function t(t){t.s&&(this.s=new d(t.s)),t.g&&(this.g=new v(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const p=new RegExp("[^#a-f\\d]","gi"),h=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var f,d=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||p.test(t)||!h.test(t))throw new TypeError("Expected a valid hex string");let n=1;8===(t=t.replace(/^#/,"")).length&&(n=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(n=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const r=Number.parseInt(t,16),i=r>>16,o=r>>8&255,s=255&r,a="number"==typeof e.alpha?e.alpha:n;return"array"===e.format?[i,o,s,a]:"css"===e.format?`rgb(${i} ${o} ${s}${1===a?"":` / ${Number((100*a).toFixed(2))}%`})`:{red:i,green:o,blue:s,alpha:a}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),b=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new d(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return f[null!==(t=this.s)&&void 0!==t?t:f.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(f||(f={}));var g,v=function(){function t(t){this.r=t.r,t.c&&(this.c=new d(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),t}(),y=(Object.defineProperty(function(){}.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),function(){function t(t){this.t=t.t,t.bg&&(this.bg=new l(t.bg)),t.br&&(this.br=new b(t.br)),this.clc=t.clc,this.shd=t.shd,this.spc=t.spc,this.trf=t.trf,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y}return Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return g[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}());!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(g||(g={}));var w,m,S=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])})(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)}}(),E=function(t){function e(e){return t.call(this,e)||this}return S(e,t),e}(y),T=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])})(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)}}(),_=function(t){function e(e){var n=t.call(this,e)||this;return n.src=e.src,n}return T(e,t),e}(y),A=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])})(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)}}(),I=function(t){function e(e){var n=t.call(this,e)||this;return n.alg=w.START,n.prs=e.prs,n.alg=e.alg,e.f&&(n.f=e.f),e.c&&(n.c=new d(e.c)),n}return A(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(y);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(w||(w={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(m||(m={}));var x,O=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])})(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)}}(),N=function(t){function e(e){var n,r=t.call(this,e)||this;return r.o=null!==(n=e.o)&&void 0!==n?n:x.C,r}return O(e,t),e.prototype.getStyles=function(){var t;return(t=this.o===x.NW?{top:0,left:0}:this.o===x.N?{top:0,left:"50%",transform:"translateX(-50%)"}:this.o===x.NE?{top:0,right:0}:this.o===x.E?{top:"50%",right:0,transform:"translateY(-50%)"}:this.o===x.SE?{bottom:0,right:0}:this.o===x.S?{bottom:0,left:"50%",transform:"translateX(-50%)"}:this.o===x.SW?{bottom:0,left:0}:this.o===x.W?{top:"50%",left:0,transform:"translateY(-50%)"}:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"}).position="absolute",t.overflow="hidden",t},e}(y);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(x||(x={}));var D,k=function(t){var e=this;this.elems=[],this.cont=new N(t.cont),t.elems.forEach((function(t){t.t===g.IMAGE?e.elems.push(new _(t)):t.t===g.TEXT||t.t===g.BUTTON?e.elems.push(new I(t)):t.t===g.SHAPE&&e.elems.push(new E(t))}))},C=function(t){this.expireAt=(new Date).getTime(),this.id=t.id,this.expireAt=t.expireAt,this.version=t.version,this.engagementID=t.engagementID,this.internal=t.internal,this.pn=t.pn,this.ian=new k(t.ian)},P=function(){function t(){this.doc=document}return t.get=function(){return t._instance||(t._instance=new t),t._instance},t.prototype.getWidth=function(){return this.parentContainer?this.parentContainer.clientWidth:document.documentElement.clientWidth},t.prototype.getHeight=function(){return this.parentContainer?this.parentContainer.clientHeight:document.documentElement.clientHeight},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,n){e&&(n?t.style.setProperty(e,n):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},t.prototype.getElementById=function(t){return this.doc.getElementById(t)},t.prototype.setParentContainer=function(t){this.parentContainer=t},t}(),R=n(238),M=n.n(R);!function(t){t.Location="LOCATION",t.Push="PUSH",t.Camera="CAMERA"}(D||(D={}));var j=function(){function e(t){this.action=t,this.apiService=nt.getInstance()}return e.prototype.execute=function(){this.externalAction(),this.iabAction(),this.upAction(),this.kvAction(),this.prompt(),this.closeAction(),this.shareAction()},e.prototype.externalAction=function(){var t;this.action.ext&&(null===(t=window.open(this.action.ext.u,"_blank"))||void 0===t||t.focus())},e.prototype.iabAction=function(){this.action.iab&&(new q).render(this.action.iab.u)},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.kvAction=function(){this.action.kv&&document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:this.action.kv}))},e.prototype.prompt=function(){var t=this.action.prompt;t&&(t===D.Location&&this.promptLocationPermission(),t===D.Push&&this.promptPushNotificationPermission(),t===D.Camera&&this.promptCameraPermission())},e.prototype.closeAction=function(){var e;if(this.action.close){(new K).removeInApp();var n=o.getNumber(s.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),r={triggerID:null===(e=o.getObject(s.STORAGE_ACTIVE_TRIGGER))||void 0===e?void 0:e.triggerID,"Close Behaviour":"CTA",Duration:((new Date).getTime()-n)/1e3};this.apiService.sendEvent(new t("CE Trigger Closed",r)),o.remove(s.STORAGE_TRIGGER_START_TIME)}},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):u.warning("Navigator.share is not compatible with this browser"))},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateProfile({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateProfile({pnPerm:Notification.permission}):u.warning("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return t=this,e=void 0,r=function(){var t,e,n;return function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(r){switch(r.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=r.sent(),[4,this.checkPermission("geolocation")];case 2:return e=r.sent(),n=Notification.permission,[2,{camera:t,location:e,notification:n}]}}))},new((n=void 0)||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateProfile({perm:e})}))},e}(),L=function(){function t(t,e){var n,r,i;this.renderer=P.get(),this.screenWidth=0,this.screenHeight=0,this.scalingFactor=(r=P.get().getWidth(),i=P.get().getHeight(),n=r<i?r/Math.min(s.CANVAS_WIDTH,s.CANVAS_HEIGHT):i/Math.max(s.CANVAS_WIDTH,s.CANVAS_HEIGHT),Math.min(n,1)),this.parentHTMLEl=t,this.inappElement=e,this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return t.prototype.getHTMLElement=function(){return this.inappHTMLEl},t.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},t.prototype.processCommonBlocks=function(){this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},t.prototype.processWidthAndHeight=function(){this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},t.prototype.getSizePx=function(t){return t*this.scalingFactor+"px"},t.prototype.processPositionBlock=function(){this.inappElement.x&&(this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)))},t.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},t.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.p&&this.renderer.setStyle(this.inappHTMLEl,"padding",this.getSizePx(t.p)),t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},t.prototype.processTransformBlock=function(){var t=this.inappElement.trf;t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate("+t.rotate+"deg)")},t.prototype.registerAction=function(){var t=this.inappElement.clc;t&&this.inappHTMLEl.addEventListener("click",(function(){new j(t).execute()}))},t.prototype.processBackgroundBlock=function(){var t,e=this.inappElement.bg;if(e){var n=this.inappHTMLEl;this.inappElement instanceof N&&(n=n.parentElement);var r="";if((null===(t=(new(M())).getBrowser().name)||void 0===t?void 0:t.toLowerCase().includes("safari"))&&(r="-webkit-"),e.glossy)this.renderer.setStyle(n,r+"backdrop-filter","blur("+e.glossy.radius+"px)"),e.glossy.color&&this.processColourBlock(e.glossy.color,"background",n);else if(e.solid)e.solid.grad?this.processGradient(e.solid.grad,"background"):e.solid.hex&&this.renderer.setStyle(n,"background",e.solid.rgba);else if(e.img){if(!e.img.src)return;var i='url("'+e.img.src+'") no-repeat center';this.renderer.setStyle(n,"background",i),this.renderer.setStyle(n,"background-size","cover"),e.img.a&&this.renderer.setStyle(n,r+"backdrop-filter","opacity("+e.img.a+")")}}},t.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var n="linear-gradient("+t.ang+"deg, "+t.c1+", "+t.c2;t.c3&&(n+=", "+t.c3),t.c4&&(n+=", "+t.c4),t.c5&&(n+=", "+t.c5);var r=n+=")";this.renderer.setStyle(this.inappHTMLEl,e,r)}},t.prototype.processColourBlock=function(t,e,n){void 0===e&&(e="color"),void 0===n&&(n=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(n,e,t.rgba))},t}(),H=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])})(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)}}(),G=function(t){function e(e,n){return t.call(this,e,n)||this}return H(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t=this.inappElement.font;t&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(t.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",t.ff),this.renderer.setStyle(this.inappHTMLEl,"line-height",t.lh))},e.prototype.processPart=function(t,e){var n,r=[];e.u&&r.push("underline"),e.st&&r.push("line-through"),r.length||r.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",r.join(" ")),this.renderer.setStyle(t,"color",null!==(n=e.c)&&void 0!==n?n:"inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=w[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(L),B=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])})(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)}}(),U=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("div"),r.insertElement(),r}return B(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var n,r,i=e.renderer.createElement("span");i.innerHTML=null===(r=null===(n=t.txt)||void 0===n?void 0:n.toString())||void 0===r?void 0:r.replace(/\n/g,"<br />"),e.processPart(i,t),e.renderer.appendChild(e.inappHTMLEl,i)})),this.processCommonBlocks()},e}(G),V=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])})(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)}}(),F=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("div"),r.insertElement(),r}return V(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(L),z=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])})(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)}}(),W=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("img"),r.insertElement(),r}return z(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","100%"),this.renderer.setStyle(this.inappHTMLEl,"max-height","100%"),this.renderer.setStyle(this.inappHTMLEl,"display","block"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(L),K=function(){function t(t){this.parent=t,this.renderer=P.get(),this.renderer.setParentContainer(t)}return t.prototype.render=function(){this.removeInApp();var t=this.renderer.createElement("div");return t.id=s.IN_APP_CONTAINER_NAME,t.classList.add(s.IN_APP_CONTAINER_NAME),this.parent?this.renderer.setStyle(t,"position","absolute"):this.renderer.setStyle(t,"position","fixed"),this.renderer.setStyle(t,"z-index","10000000"),this.renderer.setStyle(t,"top","0"),this.renderer.setStyle(t,"left","0"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.appendChild(this.parent||document.body,t),t.addEventListener("click",(function(){new j({close:!0}).execute()})),t},t.prototype.removeInApp=function(){var t=document.getElementById(s.IN_APP_CONTAINER_NAME);t&&t.parentElement.removeChild(t)},t}(),q=function(){function t(){this.renderer=P.get()}return t.prototype.render=function(t){var e=this.renderer.getElementById(s.IN_APP_CONTAINER_NAME),n=this.createIFrameContainer();return this.createIFrameElement(n,t),this.createAnchorElement(e,n),this.renderer.appendChild(e,n),n},t.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},t.prototype.createIFrameElement=function(t,e){var n=this.renderer.createElement("iframe");return this.renderer.setStyle(n,"width","100%"),this.renderer.setStyle(n,"height","100%"),this.renderer.setAttribute(n,"src",e),this.renderer.setAttribute(n,"frameBorder","0"),this.renderer.appendChild(t,n),n},t.prototype.createAnchorElement=function(t,e){var n=this.renderer.createElement("a");return this.renderer.setStyle(n,"position","absolute"),this.renderer.setStyle(n,"top","0px"),this.renderer.setStyle(n,"right","0px"),n.href="#",n.innerHTML="Close",n.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,n),n},t}(),X=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])})(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)}}(),$=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inappHTMLEl=r.renderer.createElement("div"),r.insertElement(),r.inappElement.w=1080,r.inappElement.h=1920,r}return X(e,t),e.prototype.render=function(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),Object.assign(this.inappHTMLEl.style,this.inappElement.getStyles()),this},e}(L),J=function(){function t(t){this.triggerID=t.id,this.engagementID=t.engagementID,this.expireAt=t.expireAt,this.isExpired&&(this.expired=this.isExpired)}return Object.defineProperty(t.prototype,"isExpired",{get:function(){return this.expireAt<(new Date).getTime()},enumerable:!1,configurable:!0}),t}(),Y=function(){function t(){}return t.storeActiveTrigger=function(t){if("test"!==t.id){var e=o.getObject(s.STORAGE_ACTIVE_TRIGGERS);e||(e=[]);var n=new J(t);n.isExpired||e.push(n),o.setObject(s.STORAGE_ACTIVE_TRIGGER,n),o.setObject(s.STORAGE_ACTIVE_TRIGGERS,e)}},t.getActiveTriggers=function(){var t=o.getObject(s.STORAGE_ACTIVE_TRIGGERS);return t?(t.forEach((function(t,e,n){new J(t).isExpired&&n.splice(e,1)})),o.setObject(s.STORAGE_ACTIVE_TRIGGERS,t),t):[]},t}(),Z=function(){function e(t){this.parent=t,this.rootContainer=new K(t).render()}return e.prototype.render=function(e){e=new C(e),this.ian=e.ian;try{this.renderContainer();var n=new t("CE Trigger Displayed",{triggerID:e.id});nt.getInstance().sendEvent(n),o.setNumber(s.STORAGE_TRIGGER_START_TIME,(new Date).getTime()),Y.storeActiveTrigger(e)}catch(t){u.error(t)}},e.prototype.renderElement=function(t,e){e instanceof I?new U(t,e).render():e instanceof _?new W(t,e).render():e instanceof E?new F(t,e).render():u.error("Unsupported element type- "+e.type)},e.prototype.renderContainer=function(){var t,e,n=this,r=null===(t=this.ian)||void 0===t?void 0:t.cont;if(r){var i=new $(this.rootContainer,r).render().getHTMLElement();null===(e=this.ian.elems)||void 0===e||e.forEach((function(t){n.renderElement(i,t)}))}},e}(),Q=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},tt=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},et=function(){function t(){this.runtimeData=a.getInstance(),this.apiToken="",this.userID=""}return t.getInstance=function(){return this.INSTANCE},t.prototype.doHTTP=function(t,e,n,r){return Q(this,void 0,void 0,(function(){var i,o;return tt(this,(function(a){switch(a.label){case 0:return e.startsWith("http")||(e=s.API_URL+e),!("keepalive"in new Request(""))&&JSON.stringify(n).includes("CE App Background")?((i=new XMLHttpRequest).open("POST",e,!1),r.forEach((function(t,e){i.setRequestHeader(e,t)})),i.send(JSON.stringify(n)),[2,i.response.json()]):[4,fetch(e,{method:t,body:JSON.stringify(n),headers:r,keepalive:!0})];case 1:if(!(o=a.sent()).ok)throw o;return[2,o.json()]}}))}))},t.prototype.registerDevice=function(t){return Q(this,void 0,void 0,(function(){return tt(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",t,this.getDefaultHeaders())]}))}))},t.prototype.sendEvent=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),t.activeTriggers=Y.getActiveTriggers();var n=o.getObject(s.STORAGE_ACTIVE_TRIGGER);n&&(t.trigger=n,"test"===n.triggerID)||this.doHTTP("POST","/v1/event/track",t,e).then((function(e){u.log("Sent",t.name),e.triggerData&&(new Z).render(e.triggerData)})).catch((function(t){u.error("Error sending event",t)}))},t.prototype.updateUserData=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("PUT","/v1/user/update",t,e).then((function(){u.log("Updated user profile")})).catch((function(t){u.error("Error saving user profile",t)}))},t.prototype.concludeSession=function(t){var e=this.getDefaultHeaders();e.append("x-sdk-token",this.apiToken),this.doHTTP("POST","/v1/session/conclude",t,e).then((function(t){u.log("Conclude Session",t)})).catch((function(t){u.error(t)}))},t.prototype.getDefaultHeaders=function(){var t=new Headers;return t.set("sdk-version",s.SDK_VERSION),t.set("sdk-version-code",s.SDK_VERSION_CODE.toString()),t.set("app-version",this.runtimeData.getWebAppVersion()),t.set("user-id",this.userID),s.SDK_DEBUG&&t.set("sdk-debug",String(1)),this.runtimeData.isDebugWebApp()&&t.set("app-debug",String(1)),t},t.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},t.prototype.setUserId=function(t){this.userID=null!=t?t:""},t.INSTANCE=new t,t}(),nt=function(){function t(){this.sessionManager=rt.getInstance(),this.httpApiService=et.getInstance()}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.sendEvent=function(t){var e=this;ee.replaySubject.subscribe((function(){e.addEventVariable(t),e.httpApiService.sendEvent(t)}))},t.prototype.updateProfile=function(t){var e=this;ee.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},t.prototype.concludeSession=function(t){var e=this;ee.replaySubject.subscribe((function(){e.httpApiService.concludeSession(t)}))},t.prototype.addEventVariable=function(t){t.screenName=location.pathname,t.properties.path=location.pathname,t.sessionID=this.sessionManager.getCurrentSessionID(),t.sessionNumber=this.sessionManager.getCurrentSessionNumber()},t}(),rt=function(){function t(){}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.getCurrentSessionID=function(){return this.currentSessionID||null},t.prototype.isNewSessionRequired=function(){if(!o.getString(s.STORAGE_SESSION_ID,""))return!0;var t=o.getNumber(s.STORAGE_SESSION_START_TIME,0);return((new Date).getTime()-t)/1e3>s.IDLE_TIME_IN_SECONDS},t.prototype.checkForNewSession=function(){this.isNewSessionRequired()?this.startNewSession():this.initializeSessionFromStorage()},t.prototype.startNewSession=function(){this.currentSessionID||(o.setBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!1),this.currentSessionStartTime=new Date,this.currentSessionID=(new(i())).toHexString(),o.setNumber(s.STORAGE_SESSION_START_TIME,this.currentSessionStartTime.getTime()),o.setString(s.STORAGE_SESSION_ID,this.currentSessionID),this.bumpSessionNumber())},t.prototype.bumpSessionNumber=function(){this.currentSessionNumber=o.getNumber(s.STORAGE_SESSION_NUMBER,0),this.currentSessionNumber+=1,o.setNumber(s.STORAGE_SESSION_NUMBER,this.currentSessionNumber)},t.prototype.getCurrentSessionNumber=function(){return this.currentSessionNumber||0},t.prototype.getTotalDurationInSeconds=function(){if(a.getInstance().isFirstActive())throw new Error("This is the first time in foreground after launch");return(this.getLastActive()-this.currentSessionStartTime.getTime())/1e3},t.prototype.conclude=function(){var t={sessionID:this.currentSessionID,occurred:new Date,duration:this.getTotalDurationInSeconds()};nt.getInstance().concludeSession(t),o.remove(s.STORAGE_ACTIVE_TRIGGER),this.destroySession()},t.prototype.destroySession=function(){this.currentSessionID=void 0,this.currentSessionNumber=void 0,this.currentSessionStartTime=void 0,o.remove(s.STORAGE_SESSION_ID),o.remove(s.STORAGE_SESSION_START_TIME)},t.prototype.initializeSessionFromStorage=function(){this.currentSessionStartTime=new Date(o.getNumber(s.STORAGE_SESSION_START_TIME,0)),this.currentSessionID=o.getString(s.STORAGE_SESSION_ID,""),this.currentSessionNumber=o.getNumber(s.STORAGE_SESSION_NUMBER,0)},t.prototype.getLastActive=function(){return o.getNumber(s.STORAGE_LAST_ACTIVE,0)},t}(),it=function(t,e,n,r){this.appID=t,this.appSecret=e,this.uuid=n,this.props=r,this.sdk=s.SDK},ot=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},st=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},at=function(){function t(){this.parser=new(M()),this.result={}}return t.prototype.get=function(){return ot(this,void 0,void 0,(function(){var t;return st(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,n=t.offsetWidth*e;return document.body.removeChild(t),n},t.prototype.getLocation=function(){return ot(this,void 0,void 0,(function(){var t=this;return st(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(n){t.result.coords=[n.coords.latitude,n.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return ot(this,void 0,void 0,(function(){var t;return st(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),ct=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},ut=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},lt=function(){function t(){this.apiService=et.getInstance(),this.sdkToken="",this.userID="",this.appID="",this.appSecret=""}return t.getInstance=function(){return this.INSTANCE},t.prototype.init=function(t,e){return this.appID=t,this.appSecret=e,this.acquireSDKToken()},t.prototype.hasToken=function(){return!!o.getString(s.STORAGE_SDK_TOKEN,"")},t.prototype.getUserID=function(){return this.userID},t.prototype.populateUserDataFromStorage=function(){return ct(this,void 0,void 0,(function(){return ut(this,(function(t){return this.sdkToken=o.getString(s.STORAGE_SDK_TOKEN,""),this.sdkToken||u.log("No SDK token found in local storage"),this.userID=o.getString(s.STORAGE_USER_ID,""),this.userID||u.log("No user ID found in local storage"),this.updateAPIClient(),[2]}))}))},t.prototype.updateAPIClient=function(){u.log("SDK Token:",this.sdkToken),u.log("User ID:",this.userID),this.apiService.setAPIToken(this.sdkToken),this.apiService.setUserId(this.userID)},t.prototype.acquireSDKToken=function(){return ct(this,void 0,void 0,(function(){return ut(this,(function(t){return this.hasToken()?[2,this.populateUserDataFromStorage()]:(u.log("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}))}))},t.prototype.getSDKTokenFromServer=function(){return ct(this,void 0,void 0,(function(){var t,e,n,r;return ut(this,(function(i){switch(i.label){case 0:return[4,this.getUserAuthRequest()];case 1:t=i.sent(),e=this.apiService.registerDevice(t),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e];case 3:return n=i.sent(),u.log("Register Device Response",n),this.saveUserDataInStorage(n),[3,5];case 4:throw r=i.sent(),u.error(r),r;case 5:return[2]}}))}))},t.prototype.saveUserDataInStorage=function(t){this.sdkToken=t.sdkToken,this.userID=t.id,this.updateAPIClient(),o.setString(s.STORAGE_SDK_TOKEN,this.sdkToken),o.setString(s.STORAGE_USER_ID,this.userID)},t.prototype.getUserAuthRequest=function(){return ct(this,void 0,void 0,(function(){var t;return ut(this,(function(e){switch(e.label){case 0:return[4,(new at).get()];case 1:return t=e.sent(),[2,new it(this.appID,this.appSecret,this.getOrCreateUUID(),t)]}}))}))},t.prototype.getOrCreateUUID=function(){var t=o.getString(s.STORAGE_DEVICE_UUID,"");return t||(t=(new(i())).toHexString(),o.setString(s.STORAGE_DEVICE_UUID,t)),t},t.INSTANCE=new t,t}(),pt=function(t,e){return(pt=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)};function ht(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}pt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function ft(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.")}function dt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.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 s}function bt(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}function gt(t){return"function"==typeof t}function vt(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var yt=vt((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function wt(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var mt=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=ft(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var c=this.initialTeardown;if(gt(c))try{c()}catch(t){i=t instanceof yt?t.errors:[t]}var u=this._teardowns;if(u){this._teardowns=null;try{for(var l=ft(u),p=l.next();!p.done;p=l.next()){var h=p.value;try{Tt(h)}catch(t){i=null!=i?i:[],t instanceof yt?i=bt(bt([],dt(i)),dt(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new yt(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Tt(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&wt(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&wt(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),St=mt.EMPTY;function Et(t){return t instanceof mt||t&&"closed"in t&&gt(t.remove)&&gt(t.add)&&gt(t.unsubscribe)}function Tt(t){gt(t)?t():t.unsubscribe()}var _t=null,At=null,It=void 0,xt=!1,Ot=!1,Nt={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Nt.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,bt([],dt(t)))},clearTimeout:function(t){var e=Nt.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Dt(t){Nt.setTimeout((function(){if(!_t)throw t;_t(t)}))}function kt(){}var Ct=Pt("C",void 0,void 0);function Pt(t,e,n){return{kind:t,value:e,error:n}}var Rt=null;function Mt(t){if(xt){var e=!Rt;if(e&&(Rt={errorThrown:!1,error:null}),t(),e){var n=Rt,r=n.errorThrown,i=n.error;if(Rt=null,r)throw i}}else t()}function jt(t){xt&&Rt&&(Rt.errorThrown=!0,Rt.error=t)}var Lt=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Et(e)&&e.add(n)):n.destination=Vt,n}return ht(e,t),e.create=function(t,e,n){return new Ht(t,e,n)},e.prototype.next=function(t){this.isStopped?Ut(function(t){return Pt("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Ut(Pt("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Ut(Ct,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(mt),Ht=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(gt(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&Ot?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s),r=null==r?void 0:r.bind(s)}return o.destination={next:i?Gt(i):kt,error:Gt(null!=n?n:Bt),complete:r?Gt(r):kt},o}return ht(e,t),e}(Lt);function Gt(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,bt([],dt(e)))}catch(t){xt?jt(t):Dt(t)}}}function Bt(t){throw t}function Ut(t,e){var n=At;n&&Nt.setTimeout((function(){return n(t,e)}))}var Vt={closed:!0,next:kt,error:Bt,complete:kt},Ft="function"==typeof Symbol&&Symbol.observable||"@@observable";function zt(t){return t}function Wt(t){return 0===t.length?zt:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Kt=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Lt||function(t){return t&&gt(t.next)&&gt(t.error)&&gt(t.complete)}(r)&&Et(r)?t:new Ht(t,e,n);return Mt((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=qt(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),null==i||i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Ft]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Wt(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=qt(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function qt(t){var e;return null!==(e=null!=t?t:It)&&void 0!==e?e:Promise}var Xt=vt((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),$t=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return ht(e,t),e.prototype.lift=function(t){var e=new Jt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new Xt},e.prototype.next=function(t){var e=this;Mt((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=ft(i),s=o.next();!s.done;s=o.next())s.value.next(t)}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Mt((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Mt((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=e.hasError,r=e.isStopped,i=e.observers;return n||r?St:(i.push(t),new mt((function(){return wt(i,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new Kt;return t.source=this,t},e.create=function(t,e){return new Jt(t,e)},e}(Kt),Jt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return ht(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:St},e}($t),Yt={now:function(){return(Yt.delegate||Date).now()},delegate:void 0},Zt=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Yt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return ht(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,c=1;c<r.length&&r[c]<=s;c+=2)a=c;a&&r.splice(0,a+1)}},e}($t),Qt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},te=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},ee=function(){function e(){this.sessionManager=rt.getInstance(),this.safeHttpCallService=nt.getInstance(),this.userAuthService=lt.getInstance()}return e.prototype.init=function(t,n){var r=this;this.userAuthService.init(t,n).then((function(){e.replaySubject.next(!0),e.replaySubject.complete()})).catch((function(){setTimeout((function(){r.init(t,n)}),3e4)})),this.execute()},e.prototype.execute=function(){this.sessionManager.checkForNewSession(),o.getBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!1)||(o.setBoolean(s.STORAGE_SESSION_START_EVENT_SENT,!0),this.isAppFirstTimeLaunch()?this.sendFirstLaunchEvent():this.sendSuccessiveLaunchEvent())},e.prototype.isAppFirstTimeLaunch=function(){return!!o.getBoolean(s.STORAGE_FIRST_TIME_LAUNCH,!0)&&(o.setBoolean(s.STORAGE_FIRST_TIME_LAUNCH,!1),!0)},e.prototype.sendFirstLaunchEvent=function(){return Qt(this,void 0,void 0,(function(){var e,n;return te(this,(function(r){switch(r.label){case 0:return e=new t("CE App Installed",{}),n=e,[4,(new at).get()];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return Qt(this,void 0,void 0,(function(){var e,n;return te(this,(function(r){switch(r.label){case 0:return e=new t("CE App Launched",{}),n=e,[4,(new at).get()];case 1:return n.deviceProps=r.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.replaySubject=new Zt(1),e}(),ne=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},re=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},ie=function(){function e(){this.apiService=nt.getInstance(),this.runtimeData=a.getInstance()}return e.prototype.listen=function(){var t=this;document.onvisibilitychange=function(){"visible"===document.visibilityState?t.onVisible():"hidden"===document.visibilityState&&t.onHidden()}},e.prototype.onVisible=function(){return ne(this,void 0,void 0,(function(){var n,r,i,o;return re(this,(function(a){switch(a.label){case 0:return this.runtimeData.setActive(),(n=this.runtimeData.getTimeForInactiveInSeconds())>s.IDLE_TIME_IN_SECONDS&&(rt.getInstance().conclude(),(new ee).execute()),(r={})[e.INACTIVE_DURATION]=n,i=new t("CE App Foreground",r),o=i,[4,(new at).get()];case 1:return o.deviceProps=a.sent(),this.apiService.sendEvent(i),[2]}}))}))},e.prototype.onHidden=function(){return ne(this,void 0,void 0,(function(){var n,r;return re(this,(function(i){return this.runtimeData.setInactive(),n=this.runtimeData.getTimeForActiveInSeconds(),(r={})[e.ACTIVE_DURATION]=n,this.apiService.sendEvent(new t("CE App Background",r)),[2]}))}))},e.ACTIVE_DURATION="aDur",e.INACTIVE_DURATION="iaDur",e}(),oe=function(){function e(){this.apiService=nt.getInstance()}return e.prototype.listen=function(){var e=this;window.onpageshow=function(){e.apiService.sendEvent(new t("CE Screen View",{screenName:location.pathname}))}},e}(),se=function(){function t(){this.existingSDKObject=window.CooeeSDK}return t.prototype.meddle=function(){var t,e,n;this.existingSDKObject||(this.existingSDKObject=window.CooeeSDK={events:[],profile:[],account:[]}),this.existingSDKObject.account=null!==(t=this.existingSDKObject.account)&&void 0!==t?t:[],this.existingSDKObject.profile=null!==(e=this.existingSDKObject.profile)&&void 0!==e?e:[],this.existingSDKObject.events=null!==(n=this.existingSDKObject.events)&&void 0!==n?n:[],this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.existingSDKObject.account.forEach(this.processAccount),this.existingSDKObject.events.forEach(this.processEvent),this.existingSDKObject.profile.forEach(this.processProfile)},t.prototype.overwritePush=function(t,e){Object.defineProperty(t,"push",{enumerable:!1,configurable:!1,writable:!1,value:e})},t.prototype.meddleAccount=function(){var t=this;this.overwritePush(this.existingSDKObject.account,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processAccount(e[0])}))},t.prototype.meddleEvents=function(){var t=this;this.overwritePush(this.existingSDKObject.events,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processEvent(e[0])}))},t.prototype.meddleProfile=function(){var t=this;this.overwritePush(this.existingSDKObject.profile,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.processProfile(e[0])}))},t.prototype.processAccount=function(t){if(t){var e=Object.keys(t);e.includes("appID")?ce.init(t.appID,t.appSecret):e.includes("appVersion")?ce.setWebAppVersion(t.appVersion):e.includes("debug")&&ce.setDebug(t.debug)}},t.prototype.processEvent=function(t){t&&ce.sendEvent(t[0],t[1])},t.prototype.processProfile=function(t){t&&ce.updateProfile(t)},t}(),ae=function(){function t(){}return t.prototype.init=function(){(new ie).listen(),(new oe).listen(),(new se).meddle()},t}(),ce=function(){function e(){this.runtimeData=a.getInstance(),this.safeHttpCallService=nt.getInstance(),this.newSessionExecutor=new ee}return e.init=function(t,e){this.INSTANCE.newSessionExecutor.init(t,e)},e.setWebAppVersion=function(t){this.INSTANCE.runtimeData.setWebAppVersion(t)},e.setDebug=function(t){this.INSTANCE.runtimeData.setDebugWebApp(t)},e.sendEvent=function(e,n){for(var r in n)if(r.length>3&&r.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");this.INSTANCE.safeHttpCallService.sendEvent(new t(e,n))},e.updateProfile=function(t){for(var e in t)if(e.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");this.INSTANCE.safeHttpCallService.updateProfile(t)},e.INSTANCE=new e,e}();(new ae).init();var ue=ce}();var i=CooeeSDK="undefined"==typeof CooeeSDK?{}:CooeeSDK,o=r.default;for(var s in o)i[s]=o[s];o.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})}();
@@ -130,6 +130,9 @@ var HttpAPIService = /** @class */ (function () {
130
130
  var trigger = LocalStorageHelper.getObject(Constants.STORAGE_ACTIVE_TRIGGER);
131
131
  if (trigger) {
132
132
  event.trigger = trigger;
133
+ if (trigger.triggerID === 'test') {
134
+ return;
135
+ }
133
136
  }
134
137
  this.doHTTP('POST', '/v1/event/track', event, headers)
135
138
  .then(function (data) {
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@letscooee/web-sdk",
3
3
  "description": "Hyperpersonalised Mobile/Web App Re-Engagement via Machine Learning",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "scripts": {
6
6
  "lint": "eslint 'src/**'",
7
7
  "prepare": "npm run build",
8
8
  "build": "tsc",
9
9
  "build:production": "webpack && webpack --config ./webpack-preview.config.js",
10
- "serve:old-school": "webpack serve",
10
+ "serve": "webpack serve",
11
+ "serve:preview": "webpack serve --config ./webpack-preview.config.js",
11
12
  "preversion": "git add CHANGELOG.md src/constants.ts",
12
13
  "version": "npm run build:production",
13
14
  "postversion": "git push && git push --tags"