amplitude-js
Version:
Javascript library for Amplitude Analytics
1 lines • 101 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("amplitude",t):(e="undefined"!=typeof globalThis?globalThis:e||self).amplitude=t()}(this,(function(){"use strict";function e(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function o(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,i){return(t=l(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return c(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function l(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function p(){return"object"==typeof window&&void 0!==(null===window||void 0===window?void 0:window.document)}var d="$default_instance",h=2,f=4096,v=1e3,b="$identify",m="$groupidentify",g="api.amplitude.com",y="api.eu.amplitude.com",w="regionconfig.amplitude.com",_="regionconfig.eu.amplitude.com",I=0,k=1,S=2,x=3,O=4,E=5,N=6,C=7,A="amp_cookie_test",j="amp",q="",T="cookies",P="none",R="localStorage",U="sessionStorage",D="revenue_amount",z="$productId",M="$quantity",F="$price",K="$revenueType",$="amp_device_id",B="amp_referrer",L="referrer",V="referring_domain",G="utm_source",W="utm_medium",Z="utm_campaign",J="utm_term",H="utm_content",X="[Amplitude] Attribution Captured",Q="http",Y="beacon",ee=function(e){for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},te=function(e){for(var t="",i=0,n=0,r=0,o=0;i<e.length;)(n=e.charCodeAt(i))<128?(t+=String.fromCharCode(n),i++):n>191&&n<224?(r=e.charCodeAt(i+1),t+=String.fromCharCode((31&n)<<6|63&r),i+=2):(r=e.charCodeAt(i+1),o=e.charCodeAt(i+2),t+=String.fromCharCode((15&n)<<12|(63&r)<<6|63&o),i+=3);return t},ie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0,ne={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(ie.btoa&&ie.atob)return ie.btoa(unescape(encodeURIComponent(e)))}catch(e){}return ne._encode(e)},_encode:function(e){var t,i,n,r,o,s,a,u="",c=0;for(e=ee(e);c<e.length;)r=(t=e.charCodeAt(c++))>>2,o=(3&t)<<4|(i=e.charCodeAt(c++))>>4,s=(15&i)<<2|(n=e.charCodeAt(c++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),u=u+ne._keyStr.charAt(r)+ne._keyStr.charAt(o)+ne._keyStr.charAt(s)+ne._keyStr.charAt(a);return u},decode:function(e){try{if(ie.btoa&&ie.atob)return decodeURIComponent(escape(ie.atob(e)))}catch(e){}return ne._decode(e)},_decode:function(e){var t,i,n,r,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=ne._keyStr.indexOf(e.charAt(u++))<<2|(r=ne._keyStr.indexOf(e.charAt(u++)))>>4,i=(15&r)<<4|(o=ne._keyStr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(s=ne._keyStr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(i)),64!==s&&(a+=String.fromCharCode(n));return a=te(a)}},re=Object.prototype.toString;function oe(e){switch(re.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)?"buffer":i(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))}var se,ae={DISABLE:0,ERROR:1,WARN:2,INFO:3},ue=ae.WARN,ce={error:function(e){ue>=ae.ERROR&&le(e)},warn:function(e){ue>=ae.WARN&&le(e)},info:function(e){ue>=ae.INFO&&le(e)}},le=function(e){try{console.log("[Amplitude] "+e)}catch(e){}},pe=function(e){return"string"===oe(e)&&e.length>f?e.substring(0,f):e},de=function(e,t,i){return oe(e)===i||(ce.error("Invalid "+t+" input type. Expected "+i+" but received "+oe(e)),!1)},he=function(e){var t=oe(e);if("object"!==t)return ce.error("Error: invalid properties format. Expecting Javascript object, received "+t+", ignoring"),{};if(Object.keys(e).length>v)return ce.error("Error: too many properties (more than 1000), ignoring"),{};var i={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=n,o=oe(r);"string"!==o&&(r=String(r),ce.warn("WARNING: Non-string property key, received type "+o+', coercing to string "'+r+'"'));var s=ve(r,e[n]);null!==s&&(i[r]=s)}return i},fe=["nan","function","arguments","regexp","element"],ve=function e(t,i){var n=oe(i);if(-1!==fe.indexOf(n))ce.warn('WARNING: Property key "'+t+'" with invalid value type '+n+", ignoring"),i=null;else if("undefined"===n)i=null;else if("error"===n)i=String(i),ce.warn('WARNING: Property key "'+t+'" with value type error, coercing to '+i);else if("array"===n){for(var r=[],o=0;o<i.length;o++){var s=i[o],a=oe(s);"array"!==a?"object"===a?r.push(he(s)):r.push(e(t,s)):ce.warn("WARNING: Cannot have "+a+" nested in an array property value, skipping")}i=r}else"object"===n&&(i=he(i));return i},be=function(e,t){var i=oe(t);if("string"===i)return t;if("date"===i||"number"===i||"boolean"===i)return t=String(t),ce.warn("WARNING: Non-string groupName, received type "+i+', coercing to string "'+t+'"'),t;if("array"===i){for(var n=[],r=0;r<t.length;r++){var o=t[r],s=oe(o);"array"!==s&&"object"!==s?"string"===s?n.push(o):"date"!==s&&"number"!==s&&"boolean"!==s||(o=String(o),ce.warn("WARNING: Non-string groupName, received type "+s+', coercing to string "'+o+'"'),n.push(o)):ce.warn("WARNING: Skipping nested "+s+" in array groupName")}return n}ce.warn("WARNING: Non-string groupName, received type "+i+". Please use strings or array of strings for groupName")},me=function(e){Object.prototype.hasOwnProperty.call(ae,e)&&(ue=ae[e])},ge=ce,ye=function(e){return!e||0===e.length},we=function(){return"undefined"!=typeof WorkerGlobalScope},_e=function(e,t){e=e.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===i?void 0:decodeURIComponent(i[1].replace(/\+/g," "))},Ie=function e(t){if("array"===oe(t))for(var i=0;i<t.length;i++)t[i]=e(t[i]);else if("object"===oe(t))for(var n in t)n in t&&(t[n]=e(t[n]));else t=pe(t);return t},ke=function(e){var t=oe(e);if("object"!==t)return ce.error("Error: invalid groups format. Expecting Javascript object, received "+t+", ignoring"),{};var i={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=n,o=oe(r);"string"!==o&&(r=String(r),ce.warn("WARNING: Non-string groupType, received type "+o+', coercing to string "'+r+'"'));var s=be(r,e[n]);null!==s&&(i[r]=s)}return i},Se=de,xe=he,Oe=function(e){return!!de(e,"deviceId","string")&&(!(e.indexOf(".")>=0)||(ce.error("Device IDs may not contain '.' characters. Value will be ignored: \"".concat(e,'"')),!1))},Ee=function(e){return!!de(e,"transport","string")&&(e!==Q&&e!==Y?(ce.error("transport value must be one of '".concat(Y,"' or '").concat(Q,"'")),!1):!(e!==Q&&"undefined"!=typeof navigator&&!navigator.sendBeacon)||(ce.error("browser does not support sendBeacon, so transport must be HTTP"),!1))},Ne=function(e){return!!(de(e,"sessionId","number")&&new Date(e).getTime()>0)||(ce.error("sessionId value must in milliseconds since epoch (Unix Timestamp)"),!1)},Ce=function(){return ie.location},Ae=function(e){var t=ie.location?ie.location.hostname:"";if(e){if("undefined"!=typeof document){var i=document.createElement("a");return i.href=e,i.hostname||t}if("function"==typeof URL)return new URL(e).hostname||t}return t},je=function(e){try{for(var t=document.cookie.split(";"),i=null,n=0;n<t.length;n++){for(var r=t[n];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e)){i=r.substring(e.length,r.length);break}}return i}catch(e){return null}},qe=function(e,t,i){var n=null!==t?i.expirationDays:-1;if(n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),n=r}var o=e+"="+t;n&&(o+="; expires="+n.toUTCString()),o+="; path=/",i.domain&&(o+="; domain="+i.domain),i.secure&&(o+="; Secure"),i.sameSite&&(o+="; SameSite="+i.sameSite),document.cookie=o},Te=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=t.split(".")[O];return i&&(e=parseInt(i,32)),e||(ge.warn("unable to parse malformed cookie: ".concat(t)),0)},Pe=qe,Re=je,Ue=function(e){try{var t,i=document.cookie.split(";").map((function(e){return e.trimStart()})),n=[],r=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=u(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}(i);try{for(r.s();!(t=r.n()).done;){for(var o=t.value;" "===o.charAt(0);)o=o.substring(1);0===o.indexOf(e)&&n.push(o.substring(e.length))}}catch(e){r.e(e)}finally{r.f()}return n}catch(e){return[]}},De=function(e){return a(e).sort((function(e,t){var i=Te(e);return Te(t)-i}))},ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=A;if("undefined"==typeof document)return!1;var i=!1;try{var n=String(Date.now());qe(t,n,e),ge.info("Testing if cookies available"),i=je(t+"=")===n}catch(e){ge.warn('Error thrown when checking for cookies. Reason: "'.concat(e,'"'))}finally{ge.info("Cleaning up cookies availability test"),qe(t,null,e)}return i},Me=function(){for(var e="",t=0;t<22;++t)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(Math.floor(64*Math.random()));return e},Fe=function(e){var t=Ae(e).split("."),i=[],n="_tldtest_"+Me();if(we())return"";for(var r=t.length-2;r>=0;--r)i.push(t.slice(r).join("."));for(var o=0;o<i.length;++o){var s=i[o],a={domain:"."+s};if(Pe(n,1,a),Re(n))return Pe(n,null,a),s}return""},Ke={expirationDays:void 0,domain:void 0},$e=function(e){var t="";return Ke.domain&&(t="."===Ke.domain.charAt(0)?Ke.domain.substring(1):Ke.domain),e+t},Be=function(e){var t=$e(e)+"=",i=Re(t);try{if(i)return JSON.parse(ne.decode(i))}catch(e){return null}return null},Le=function(e,t){try{return Pe($e(e),ne.encode(JSON.stringify(t)),Ke),!0}catch(e){return!1}},Ve=function(e){try{return Pe($e(e),null,Ke),!0}catch(e){return!1}},Ge={reset:function(){Ke={expirationDays:void 0,domain:void 0}},options:function(e){if(0===arguments.length)return Ke;e=e||{},Ke.expirationDays=e.expirationDays,Ke.secure=e.secure,Ke.sameSite=e.sameSite;var t=ye(e.domain)?"."+Fe(Ce().href):e.domain,i=Math.random();Ke.domain=t,Le("amplitude_test",i);var n=Be("amplitude_test");return n&&n===i||(t=null),Ve("amplitude_test"),Ke.domain=t,Ke},get:Be,set:Le,remove:Ve,setRaw:function(e,t){try{return Pe($e(e),t,Ke),!0}catch(e){return!1}},getRaw:function(e){var t=$e(e)+"=";return Re(t)}},We=function(){function e(){n(this,e),this.map=new Map,this.length=0}return o(e,[{key:"key",value:function(e){var t=Array.from(this.map.keys())[e];return this.map.get(t)}},{key:"getItem",value:function(e){return this.map.get(e)}},{key:"setItem",value:function(e,t){this.map.has(e)||(this.length+=1),this.map.set(e,t)}},{key:"removeItem",value:function(e){this.map.has(e)&&(this.length-=1,this.map.delete(e))}},{key:"clear",value:function(){this.map.clear(),this.length=0}}]),e}();if(function(){var e,t=new Date;try{return ie.localStorage.setItem(t,t),e=ie.localStorage.getItem(t)===String(t),ie.localStorage.removeItem(t),e}catch(e){}return!1}())se=ie.localStorage;else if(void 0!==ie&&ie.globalStorage)try{se=ie.globalStorage[ie.location.hostname]}catch(e){}else if("undefined"!=typeof document){var Ze=document.createElement("div"),Je="localStorage";Ze.style.display="none",document.getElementsByTagName("head")[0].appendChild(Ze),Ze.addBehavior&&(Ze.addBehavior("#default#userdata"),se={length:0,setItem:function(e,t){Ze.load(Je),Ze.getAttribute(e)||this.length++,Ze.setAttribute(e,t),Ze.save(Je)},getItem:function(e){return Ze.load(Je),Ze.getAttribute(e)},removeItem:function(e){Ze.load(Je),Ze.getAttribute(e)&&this.length--,Ze.removeAttribute(e),Ze.save(Je)},clear:function(){Ze.load(Je);for(var e,t=0;e=Ze.XMLDocument.documentElement.attributes[t++];)Ze.removeAttribute(e.name);Ze.save(Je),this.length=0},key:function(e){return Ze.load(Je),Ze.XMLDocument.documentElement.attributes[e]}},Ze.load(Je),se.length=Ze.XMLDocument.documentElement.attributes.length)}else we()&&(se=new We);se||(se={length:0,setItem:function(e,t){},getItem:function(e){},removeItem:function(e){},clear:function(){},key:function(e){}});var He,Xe=se,Qe=function(){this.storage=null};Qe.prototype.getStorage=function(e){if(null!==this.storage)return this.storage;if(!e&&ze())this.storage=Ge;else{var t="amp_cookiestore_";this.storage={_options:{expirationDays:void 0,domain:void 0,secure:!1},reset:function(){this._options={expirationDays:void 0,domain:void 0,secure:!1}},options:function(e){return 0===arguments.length?this._options:(e=e||{},this._options.expirationDays=e.expirationDays||this._options.expirationDays,this._options.domain=e.domain||this._options.domain||ie&&ie.location&&ie.location.hostname,this._options.secure=e.secure||!1)},get:function(e){try{return JSON.parse(Xe.getItem(t+e))}catch(e){}return null},set:function(e,i){try{return Xe.setItem(t+e,JSON.stringify(i)),!0}catch(e){}return!1},remove:function(e){try{Xe.removeItem(t+e)}catch(e){return!1}}}}return this.storage};var Ye=(s(He={},T,!0),s(He,P,!0),s(He,R,!0),s(He,U,!0),He),et=function(){function e(t){var i=t.storageKey,r=t.disableCookies,o=t.domain,s=t.secure,a=t.sameSite,u=t.expirationDays,c=t.storage;n(this,e),this.storageKey=i,this.domain=o,this.secure=s,this.sameSite=a,this.expirationDays=u,this.cookieDomain="";var l=Ce()?Ce().href:void 0,p=r?"":Fe(l);if(this.cookieDomain=o||(p?"."+p:null),Ye[c])this.storage=c;else{var d=r||!ze({domain:this.cookieDomain,secure:this.secure,sameSite:this.sameSite,expirationDays:this.expirationDays});this.storage=d?R:T}}return o(e,[{key:"getCookieStorageKey",value:function(){if(!this.domain)return this.storageKey;var e="."===this.domain.charAt(0)?this.domain.substring(1):this.domain;return"".concat(this.storageKey).concat(e?"_".concat(e):"")}},{key:"save",value:function(e){var t=e.deviceId,i=e.userId,n=e.optOut,r=e.sessionId,o=e.lastEventTime,s=e.eventId,a=e.identifyId,u=e.sequenceNumber;if(this.storage!==P){var c=[t,ne.encode(i||""),n?"1":"",r?r.toString(32):"0",o?o.toString(32):"0",s?s.toString(32):"0",a?a.toString(32):"0",u?u.toString(32):"0"].join(".");switch(this.storage){case U:ie.sessionStorage&&ie.sessionStorage.setItem(this.storageKey,c);break;case R:Xe.setItem(this.storageKey,c);break;case T:this.saveCookie(c)}}}},{key:"saveCookie",value:function(e){Pe(this.getCookieStorageKey(),e,{domain:this.cookieDomain,secure:this.secure,sameSite:this.sameSite,expirationDays:this.expirationDays})}},{key:"load",value:function(){var e,t=this;if(this.storage===T){var i=this.getCookieStorageKey()+"=",n=Ue(i);if(0===n.length||1===n.length)e=n[0];else{var r=De(n)[0];n.forEach((function(){return Pe(t.getCookieStorageKey(),null,{})})),this.saveCookie(r),e=Re(i)}}if(e||(e=Xe.getItem(this.storageKey)),!e)try{e=ie.sessionStorage&&ie.sessionStorage.getItem(this.storageKey)}catch(e){ge.info('window.sessionStorage unavailable. Reason: "'.concat(e,'"'))}if(!e)return null;var o=e.split("."),s=null;if(o[k])try{s=ne.decode(o[k])}catch(e){s=null}return{deviceId:o[I],userId:s,optOut:"1"===o[S],sessionId:parseInt(o[x],32),lastEventTime:parseInt(o[O],32),eventId:parseInt(o[E],32),identifyId:parseInt(o[N],32),sequenceNumber:parseInt(o[C],32)}}},{key:"clear",value:function(){var e;if(this.storage===T&&(e=Re(this.getCookieStorageKey()+"="),Pe(this.getCookieStorageKey(),null,{domain:this.cookieDomain,secure:this.secure,sameSite:this.sameSite,expirationDays:0})),e||(e=Xe.getItem(this.storageKey),Xe.clear()),!e)try{e=ie.sessionStorage&&ie.sessionStorage.getItem(this.storageKey),ie.sessionStorage.clear()}catch(e){ge.info('window.sessionStorage unavailable. Reason: "'.concat(e,'"'))}return!!e}}]),e}(),tt="$clearAll",it=function(){this.userPropertiesOperations={},this.properties=[]};it.prototype.add=function(e,t){return"number"===oe(t)||"string"===oe(t)?this._addOperation("$add",e,t):ge.error("Unsupported type for value: "+oe(t)+", expecting number or string"),this},it.prototype.append=function(e,t){return this._addOperation("$append",e,t),this},it.prototype.clearAll=function(){return Object.keys(this.userPropertiesOperations).length>0?(Object.prototype.hasOwnProperty.call(this.userPropertiesOperations,tt)||ge.error("Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll"),this):(this.userPropertiesOperations[tt]="-",this)},it.prototype.prepend=function(e,t){return this._addOperation("$prepend",e,t),this},it.prototype.set=function(e,t){return this._addOperation("$set",e,t),this},it.prototype.setOnce=function(e,t){return this._addOperation("$setOnce",e,t),this},it.prototype.unset=function(e){return this._addOperation("$unset",e,"-"),this},it.prototype.preInsert=function(e,t){return this._addOperation("$preInsert",e,t),this},it.prototype.postInsert=function(e,t){return this._addOperation("$postInsert",e,t),this},it.prototype.remove=function(e,t){return this._addOperation("$remove",e,t),this},it.prototype._addOperation=function(e,t,i){Object.prototype.hasOwnProperty.call(this.userPropertiesOperations,tt)?ge.error("This identify already contains a $clearAll operation, skipping operation "+e):-1===this.properties.indexOf(t)?(Object.prototype.hasOwnProperty.call(this.userPropertiesOperations,e)||(this.userPropertiesOperations[e]={}),this.userPropertiesOperations[e][t]=i,this.properties.push(t)):ge.error('User property "'+t+'" already used in this identify, skipping operation '+e)};var nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},rt={};!function(e){!function(t){function i(e,t){var i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function n(e,t,n,r,o,s){return i((a=i(i(t,e),i(r,s)))<<(u=o)|a>>>32-u,n);var a,u}function r(e,t,i,r,o,s,a){return n(t&i|~t&r,e,t,o,s,a)}function o(e,t,i,r,o,s,a){return n(t&r|i&~r,e,t,o,s,a)}function s(e,t,i,r,o,s,a){return n(t^i^r,e,t,o,s,a)}function a(e,t,i,r,o,s,a){return n(i^(t|~r),e,t,o,s,a)}function u(e,t){var n,u,c,l,p;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var d=1732584193,h=-271733879,f=-1732584194,v=271733878;for(n=0;n<e.length;n+=16)u=d,c=h,l=f,p=v,d=r(d,h,f,v,e[n],7,-680876936),v=r(v,d,h,f,e[n+1],12,-389564586),f=r(f,v,d,h,e[n+2],17,606105819),h=r(h,f,v,d,e[n+3],22,-1044525330),d=r(d,h,f,v,e[n+4],7,-176418897),v=r(v,d,h,f,e[n+5],12,1200080426),f=r(f,v,d,h,e[n+6],17,-1473231341),h=r(h,f,v,d,e[n+7],22,-45705983),d=r(d,h,f,v,e[n+8],7,1770035416),v=r(v,d,h,f,e[n+9],12,-1958414417),f=r(f,v,d,h,e[n+10],17,-42063),h=r(h,f,v,d,e[n+11],22,-1990404162),d=r(d,h,f,v,e[n+12],7,1804603682),v=r(v,d,h,f,e[n+13],12,-40341101),f=r(f,v,d,h,e[n+14],17,-1502002290),d=o(d,h=r(h,f,v,d,e[n+15],22,1236535329),f,v,e[n+1],5,-165796510),v=o(v,d,h,f,e[n+6],9,-1069501632),f=o(f,v,d,h,e[n+11],14,643717713),h=o(h,f,v,d,e[n],20,-373897302),d=o(d,h,f,v,e[n+5],5,-701558691),v=o(v,d,h,f,e[n+10],9,38016083),f=o(f,v,d,h,e[n+15],14,-660478335),h=o(h,f,v,d,e[n+4],20,-405537848),d=o(d,h,f,v,e[n+9],5,568446438),v=o(v,d,h,f,e[n+14],9,-1019803690),f=o(f,v,d,h,e[n+3],14,-187363961),h=o(h,f,v,d,e[n+8],20,1163531501),d=o(d,h,f,v,e[n+13],5,-1444681467),v=o(v,d,h,f,e[n+2],9,-51403784),f=o(f,v,d,h,e[n+7],14,1735328473),d=s(d,h=o(h,f,v,d,e[n+12],20,-1926607734),f,v,e[n+5],4,-378558),v=s(v,d,h,f,e[n+8],11,-2022574463),f=s(f,v,d,h,e[n+11],16,1839030562),h=s(h,f,v,d,e[n+14],23,-35309556),d=s(d,h,f,v,e[n+1],4,-1530992060),v=s(v,d,h,f,e[n+4],11,1272893353),f=s(f,v,d,h,e[n+7],16,-155497632),h=s(h,f,v,d,e[n+10],23,-1094730640),d=s(d,h,f,v,e[n+13],4,681279174),v=s(v,d,h,f,e[n],11,-358537222),f=s(f,v,d,h,e[n+3],16,-722521979),h=s(h,f,v,d,e[n+6],23,76029189),d=s(d,h,f,v,e[n+9],4,-640364487),v=s(v,d,h,f,e[n+12],11,-421815835),f=s(f,v,d,h,e[n+15],16,530742520),d=a(d,h=s(h,f,v,d,e[n+2],23,-995338651),f,v,e[n],6,-198630844),v=a(v,d,h,f,e[n+7],10,1126891415),f=a(f,v,d,h,e[n+14],15,-1416354905),h=a(h,f,v,d,e[n+5],21,-57434055),d=a(d,h,f,v,e[n+12],6,1700485571),v=a(v,d,h,f,e[n+3],10,-1894986606),f=a(f,v,d,h,e[n+10],15,-1051523),h=a(h,f,v,d,e[n+1],21,-2054922799),d=a(d,h,f,v,e[n+8],6,1873313359),v=a(v,d,h,f,e[n+15],10,-30611744),f=a(f,v,d,h,e[n+6],15,-1560198380),h=a(h,f,v,d,e[n+13],21,1309151649),d=a(d,h,f,v,e[n+4],6,-145523070),v=a(v,d,h,f,e[n+11],10,-1120210379),f=a(f,v,d,h,e[n+2],15,718787259),h=a(h,f,v,d,e[n+9],21,-343485551),d=i(d,u),h=i(h,c),f=i(f,l),v=i(v,p);return[d,h,f,v]}function c(e){var t,i="",n=32*e.length;for(t=0;t<n;t+=8)i+=String.fromCharCode(e[t>>5]>>>t%32&255);return i}function l(e){var t,i=[];for(i[(e.length>>2)-1]=void 0,t=0;t<i.length;t+=1)i[t]=0;var n=8*e.length;for(t=0;t<n;t+=8)i[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return i}function p(e){var t,i,n="0123456789abcdef",r="";for(i=0;i<e.length;i+=1)t=e.charCodeAt(i),r+=n.charAt(t>>>4&15)+n.charAt(15&t);return r}function d(e){return unescape(encodeURIComponent(e))}function h(e){return function(e){return c(u(l(e),8*e.length))}(d(e))}function f(e,t){return function(e,t){var i,n,r=l(e),o=[],s=[];for(o[15]=s[15]=void 0,r.length>16&&(r=u(r,8*e.length)),i=0;i<16;i+=1)o[i]=909522486^r[i],s[i]=1549556828^r[i];return n=u(o.concat(l(t)),512+8*t.length),c(u(s.concat(n),640))}(d(e),d(t))}function v(e,t,i){return t?i?f(t,e):p(f(t,e)):i?h(e):p(h(e))}e.exports?e.exports=v:t.md5=v}(nt)}({get exports(){return rt},set exports(e){rt=e}});var ot=rt;const st="%[a-f0-9]{2}",at=new RegExp("("+st+")|([^%]+?)","gi"),ut=new RegExp("("+st+")+","gi");function ct(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;const i=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],ct(i),ct(n))}function lt(e){try{return decodeURIComponent(e)}catch{let t=e.match(at)||[];for(let i=1;i<t.length;i++)t=(e=ct(t,i).join("")).match(at)||[];return e}}function pt(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return function(e){const t={"%FE%FF":"��","%FF%FE":"��"};let i=ut.exec(e);for(;i;){try{t[i[0]]=decodeURIComponent(i[0])}catch{const e=lt(i[0]);e!==i[0]&&(t[i[0]]=e)}i=ut.exec(e)}t["%C2"]="�";const n=Object.keys(t);for(const i of n)e=e.replace(new RegExp(i,"g"),t[i]);return e}(e)}}function dt(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===e||""===t)return[];const i=e.indexOf(t);return-1===i?[]:[e.slice(0,i),e.slice(i+t.length)]}function ht(e,t){const i={};if(Array.isArray(t))for(const n of t){const t=Object.getOwnPropertyDescriptor(e,n);t?.enumerable&&Object.defineProperty(i,n,t)}else for(const n of Reflect.ownKeys(e)){const r=Object.getOwnPropertyDescriptor(e,n);if(r.enumerable){t(n,e[n],e)&&Object.defineProperty(i,n,r)}}return i}const ft=e=>null==e,vt=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),bt=Symbol("encodeFragmentIdentifier");function mt(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function gt(e,t){return t.encode?t.strict?vt(e):encodeURIComponent(e):e}function yt(e,t){return t.decode?pt(e):e}function wt(e){return Array.isArray(e)?e.sort():"object"==typeof e?wt(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function _t(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function It(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function kt(e){const t=(e=_t(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function St(e,t){mt((t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t}).arrayFormatSeparator);const i=function(e){let t;switch(e.arrayFormat){case"index":return(e,i,n)=>{t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=i):n[e]=i};case"bracket":return(e,i,n)=>{t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),t?void 0!==n[e]?n[e]=[...n[e],i]:n[e]=[i]:n[e]=i};case"colon-list-separator":return(e,i,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[...n[e],i]:n[e]=[i]:n[e]=i};case"comma":case"separator":return(t,i,n)=>{const r="string"==typeof i&&i.includes(e.arrayFormatSeparator),o="string"==typeof i&&!r&&yt(i,e).includes(e.arrayFormatSeparator);i=o?yt(i,e):i;const s=r||o?i.split(e.arrayFormatSeparator).map((t=>yt(t,e))):null===i?i:yt(i,e);n[t]=s};case"bracket-separator":return(t,i,n)=>{const r=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!r)return void(n[t]=i?yt(i,e):i);const o=null===i?[]:i.split(e.arrayFormatSeparator).map((t=>yt(t,e)));void 0!==n[t]?n[t]=[...n[t],...o]:n[t]=o};default:return(e,t,i)=>{void 0!==i[e]?i[e]=[...[i[e]].flat(),t]:i[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const r of e.split("&")){if(""===r)continue;const e=t.decode?r.replace(/\+/g," "):r;let[o,s]=dt(e,"=");void 0===o&&(o=e),s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:yt(s,t),i(yt(o,t),s,n)}for(const[e,i]of Object.entries(n))if("object"==typeof i&&null!==i)for(const[e,n]of Object.entries(i))i[e]=It(n,t);else n[e]=It(i,t);return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce(((e,t)=>{const i=n[t];return Boolean(i)&&"object"==typeof i&&!Array.isArray(i)?e[t]=wt(i):e[t]=i,e}),Object.create(null))}function xt(e,t){if(!e)return"";mt((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);const i=i=>t.skipNull&&ft(e[i])||t.skipEmptyString&&""===e[i],n=function(e){switch(e.arrayFormat){case"index":return t=>(i,n)=>{const r=i.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?i:null===n?[...i,[gt(t,e),"[",r,"]"].join("")]:[...i,[gt(t,e),"[",gt(r,e),"]=",gt(n,e)].join("")]};case"bracket":return t=>(i,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?i:null===n?[...i,[gt(t,e),"[]"].join("")]:[...i,[gt(t,e),"[]=",gt(n,e)].join("")];case"colon-list-separator":return t=>(i,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?i:null===n?[...i,[gt(t,e),":list="].join("")]:[...i,[gt(t,e),":list=",gt(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return i=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:(r=null===r?"":r,0===n.length?[[gt(i,e),t,gt(r,e)].join("")]:[[n,gt(r,e)].join(e.arrayFormatSeparator)])}default:return t=>(i,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?i:null===n?[...i,gt(t,e)]:[...i,[gt(t,e),"=",gt(n,e)].join("")]}}(t),r={};for(const[t,n]of Object.entries(e))i(t)||(r[t]=n);const o=Object.keys(r);return!1!==t.sort&&o.sort(t.sort),o.map((i=>{const r=e[i];return void 0===r?"":null===r?gt(i,t):Array.isArray(r)?0===r.length&&"bracket-separator"===t.arrayFormat?gt(i,t)+"[]":r.reduce(n(i),[]).join("&"):gt(i,t)+"="+gt(r,t)})).filter((e=>e.length>0)).join("&")}function Ot(e,t){t={decode:!0,...t};let[i,n]=dt(e,"#");return void 0===i&&(i=e),{url:i?.split("?")?.[0]??"",query:St(kt(e),t),...t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:yt(n,t)}:{}}}function Et(e,t){t={encode:!0,strict:!0,[bt]:!0,...t};const i=_t(e.url).split("?")[0]||"";let n=xt({...St(kt(e.url),{sort:!1}),...e.query},t);n&&(n=`?${n}`);let r=function(e){let t="";const i=e.indexOf("#");return-1!==i&&(t=e.slice(i)),t}(e.url);if(e.fragmentIdentifier){const n=new URL(i);n.hash=e.fragmentIdentifier,r=t[bt]?n.hash:`#${e.fragmentIdentifier}`}return`${i}${n}${r}`}function Nt(e,t,i){i={parseFragmentIdentifier:!0,[bt]:!1,...i};const{url:n,query:r,fragmentIdentifier:o}=Ot(e,i);return Et({url:n,query:ht(r,t),fragmentIdentifier:o},i)}var Ct=Object.freeze({__proto__:null,extract:kt,parse:St,stringify:xt,parseUrl:Ot,stringifyUrl:Et,pick:Nt,exclude:function(e,t,i){return Nt(e,Array.isArray(t)?e=>!t.includes(e):(e,i)=>!t(e,i),i)}}),At=function(e,t,i){this.url=e,this.data=t||{},this.headers=i},jt="Cross-Origin-Resource-Policy";At.prototype.send=function(e){if(!!ie.XDomainRequest){var t=new ie.XDomainRequest;t.open("POST",this.url,!0),t.onload=function(){e(200,t.responseText)},t.onerror=function(){"Request Entity Too Large"===t.responseText?e(413,t.responseText):e(500,t.responseText)},t.ontimeout=function(){},t.onprogress=function(){},t.send(Ct.stringify(this.data))}else if("undefined"!=typeof XMLHttpRequest){var i=new XMLHttpRequest;i.open("POST",this.url,!0),i.onreadystatechange=function(){4===i.readyState&&e(i.status,i.responseText)},function(e,t){for(var i in t)(i!==jt||t[i])&&e.setRequestHeader(i,t[i])}(i,this.headers),i.send(Ct.stringify(this.data))}else{var n=void 0;fetch(this.url,{method:"POST",headers:this.headers,body:Ct.stringify(this.data)}).then((function(e){return n=e.status,e.text()})).then((function(t){e(n,t)}))}};var qt=function(){this._price=null,this._productId=null,this._quantity=1,this._revenueType=null,this._properties=null};qt.prototype.setProductId=function(e){return"string"!==oe(e)?ge.error("Unsupported type for productId: "+oe(e)+", expecting string"):ye(e)?ge.error("Invalid empty productId"):this._productId=e,this},qt.prototype.setQuantity=function(e){return"number"!==oe(e)?ge.error("Unsupported type for quantity: "+oe(e)+", expecting number"):this._quantity=parseInt(e),this},qt.prototype.setPrice=function(e){return"number"!==oe(e)?ge.error("Unsupported type for price: "+oe(e)+", expecting number"):this._price=e,this},qt.prototype.setRevenueType=function(e){return"string"!==oe(e)?ge.error("Unsupported type for revenueType: "+oe(e)+", expecting string"):this._revenueType=e,this},qt.prototype.setEventProperties=function(e){return"object"!==oe(e)?ge.error("Unsupported type for eventProperties: "+oe(e)+", expecting object"):this._properties=xe(e),this},qt.prototype._isValidRevenue=function(){return"number"===oe(this._price)||(ge.error("Invalid revenue, need to set price field"),!1)},qt.prototype._toJSONObject=function(){var e="object"===oe(this._properties)?this._properties:{};return null!==this._productId&&(e[z]=this._productId),null!==this._quantity&&(e[M]=this._quantity),null!==this._price&&(e[F]=this._price),null!==this._revenueType&&(e[K]=this._revenueType),e};var Tt={};!function(e,t){!function(i,n){var r="function",o="undefined",s="object",a="string",u="model",c="name",l="type",p="vendor",d="version",h="architecture",f="console",v="mobile",b="tablet",m="smarttv",g="wearable",y="embedded",w="Amazon",_="Apple",I="ASUS",k="BlackBerry",S="Browser",x="Chrome",O="Firefox",E="Google",N="Huawei",C="LG",A="Microsoft",j="Motorola",q="Opera",T="Samsung",P="Sharp",R="Sony",U="Xiaomi",D="Zebra",z="Facebook",M=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},F=function(e,t){return typeof e===a&&-1!==K(t).indexOf(K(e))},K=function(e){return e.toLowerCase()},$=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},B=function(e,t){for(var i,o,a,u,c,l,p=0;p<t.length&&!c;){var d=t[p],h=t[p+1];for(i=o=0;i<d.length&&!c;)if(c=d[i++].exec(e))for(a=0;a<h.length;a++)l=c[++o],typeof(u=h[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;p+=2}},L=function(e,t){for(var i in t)if(typeof t[i]===s&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(F(t[i][r],e))return"?"===i?n:i}else if(F(t[i],e))return"?"===i?n:i;return e},V={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"},G={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,d],[/opios[\/ ]+([\w\.]+)/i],[d,[c,q+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[c,q]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[c,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+S],d],[/\bfocus\/([\w\.]+)/i],[d,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[c,q+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[c,q+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[c,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[d,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+S]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+S],d],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,z],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[c,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,x+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[c,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[d,L,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,d],[/(cobalt)\/([\w\.]+)/i],[c,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,K]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",K]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,K]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,T],[l,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,T],[l,v]],[/((ipod|iphone)\d+,\d+)/i],[u,[p,_],[l,v]],[/(ipad\d+,\d+)/i],[u,[p,_],[l,b]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[p,_],[l,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,_],[l,b]],[/(macintosh);/i],[u,[p,_]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,N],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,N],[l,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[p,U],[l,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,U],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[l,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[l,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[l,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,j],[l,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,j],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,C],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,C],[l,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[l,v]],[/(pixel c)\b/i],[u,[p,E],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,E],[l,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[p,R],[l,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,R],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[l,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,w],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,w],[l,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,k],[l,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,I],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,I],[l,v]],[/(nexus 9)/i],[u,[p,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[l,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[l,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,P],[l,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[l,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,u,[l,b]],[/(surface duo)/i],[u,[p,A],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[l,v]],[/(u304aa)/i],[u,[p,"AT&T"],[l,v]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[l,v]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[l,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[l,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[l,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[l,b]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[l,b]],[/\b(k88) b/i],[u,[p,"ZTE"],[l,b]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[l,v]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[l,v]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[l,b]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[l,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[l,b]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[l,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[l,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[l,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[l,v]],[/\b(ph-1) /i],[u,[p,"Essential"],[l,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[l,b]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[l,b]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[l,b]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[p,u,[l,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,A],[l,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,D],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,D],[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[l,f]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[l,f]],[/(playstation [345portablevi]+)/i],[u,[p,R],[l,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,A],[l,f]],[/smart-tv.+(samsung)/i],[p,[l,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,T],[l,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,C],[l,m]],[/(apple) ?tv/i],[p,[u,_+" TV"],[l,m]],[/crkey/i],[[u,x+"cast"],[p,E],[l,m]],[/droid.+aft(\w)( bui|\))/i],[u,[p,w],[l,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,P],[l,m]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,R],[l,m]],[/(mitv-\w{5}) bui/i],[u,[p,U],[l,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,$],[u,$],[l,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,m]],[/((pebble))app/i],[p,u,[l,g]],[/droid.+; (glass) \d/i],[u,[p,E],[l,g]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,D],[l,g]],[/(quest( 2)?)/i],[u,[p,z],[l,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[l,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[d,L,V]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[d,L,V]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,d],[/\(bb(10);/i],[d,[c,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[c,x+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,d],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,d]]},W=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof W))return new W(e,t).getResult();var r=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),f=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(G,t):G;return this.getBrowser=function(){var e={};return e[c]=n,e[d]=n,B.call(e,r,f.browser),e.major=function(e){return typeof e===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[h]=n,B.call(e,r,f.cpu),e},this.getDevice=function(){var e={};return e[p]=n,e[u]=n,e[l]=n,B.call(e,r,f.device),e},this.getEngine=function(){var e={};return e[c]=n,e[d]=n,B.call(e,r,f.engine),e},this.getOS=function(){var e={};return e[c]=n,e[d]=n,B.call(e,r,f.os),e},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(e){return r=typeof e===a&&e.length>350?$(e,350):e,this},this.setUA(r),this};W.VERSION="0.7.33",W.BROWSER=M([c,d,"major"]),W.CPU=M([h]),W.DEVICE=M([u,p,l,f,v,m,b,g,y]),W.ENGINE=W.OS=M([c,d]),e.exports&&(t=e.exports=W),t.UAParser=W;var Z=typeof i!==o&&(i.jQuery||i.Zepto);if(Z&&!Z.ua){var J=new W;Z.ua=J.getResult(),Z.ua.get=function(){return J.getUA()},Z.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var i in t)Z.ua[i]=t[i]}}}("object"==typeof window?window:nt)}({get exports(){return Tt},set exports(e){Tt=e}},Tt);var Pt=Tt,Rt=function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},Ut="US",Dt="EU",zt=function(e){var t=g;switch(e){case Dt:t=y;break;case Ut:t=g}return t},Mt="8.21.9",Ft={apiEndpoint:g,batchEvents:!1,cookieExpiration:365,cookieName:"amplitude_id",sameSiteCookie:"Lax",cookieForceUpgrade:!1,deferInitialization:!1,disableCookies:!1,deviceIdFromUrlParam:!1,domain:"",eventUploadPeriodMillis:3e4,eventUploadThreshold:30,forceHttps:!0,includeFbclid:!1,includeGclid:!1,includeReferrer:!1,includeUtm:!1,ingestionMetadata:{sourceName:"",sourceVersion:""},language:function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||""}(),library:{name:"amplitude-js",version:Mt},logLevel:"WARN",logAttributionCapturedEvent:!1,optOut:!1,onError:function(){},onExitPage:function(){},onNewSessionStart:function(){},plan:{branch:"",source:"",version:"",versionId:""},platform:"Web",savedMaxCount:1e3,saveEvents:!0,saveParamsReferrerOncePerSession:!0,secureCookie:!1,sessionTimeout:18e5,storage:q,trackingOptions:{city:!0,country:!0,carrier:!0,device_manufacturer:!0,device_model:!0,dma:!0,ip_address:!0,language:!0,os_name:!0,os_version:!0,platform:!0,region:!0,version_name:!0},transport:Q,unsetParamsReferrerOnNewSession:!1,unsentKey:"amplitude_unsent",unsentIdentifyKey:"amplitude_unsent_identify",uploadBatchSize:100,headers:{"Conten