(function () {
    'use strict';

    function getElementClasses(t){if(!t.classList)return [];var e=[];return t.classList.forEach((function(t){return e.push(t)})),e}function getElementShelf(t,e){var r,n=e.getAttribute(t);if(null===n)return "invalid";try{r=JSON.parse(n);}catch(t){return "invalid"}if("object"!=typeof r)return "invalid";var i=r.shn;if(!i||"string"!=typeof i)return "invalid";var a=r.sht;if(!a||"string"!=typeof a)return "invalid";var u=r.shtg;u&&validateShtg(u)||(u=void 0);var s=r.p;return (!s||"object"!=typeof s||Object.keys(s).length>16)&&(s=void 0),{shn:i,sht:a,shtg:u,p:s}}var validateShtg=function(t){return !!Array.isArray(t)&&(t.forEach((function(t){if(2!==Object.keys(t).length||!Object.hasOwn(t,"type")||!Object.hasOwn(t,"value"))return !1})),!0)},TrackedElements=function(){function t(t,e,r){this.query=t,this.markerAttribute=e,this.onDiscover=r;}return t.prototype.refresh=function(){var t=this;document.querySelectorAll(this.query).forEach((function(e){null===e.getAttribute(t.markerAttribute)&&(t.onDiscover(e),e.setAttribute(t.markerAttribute,"1"));}));},t}();

    var SEPARATOR=" ",FLAG_TRACK_PAGEVIEW="pv",FLAG_GENERATE_PAGEVIEW_ID="pvid",FLAG_ENABLE_ELEMENT_CLICK_TRACKING="ec",FLAG_ENABLE_ELEMENT_ACTIVE_VIEW_TRACKING="av",FLAG_ENABLE_CROSS_DOMAIN_TRACKING="cdt",FLAG_ENABLE_ACTIVITY_TRACKING="at";function getFeatureFlags(_){if(!_)return {track_pageview:!0,generate_page_view_id:!0,enable_element_click_tracking:!0,enable_active_view_tracking:!0,enable_cross_domain_tracking:!0,enable_activity_tracking:!1};var e=_.split(SEPARATOR).filter((function(_){return !!_})).map((function(_){return _.trim()}));return {track_pageview:e.some((function(_){return _===FLAG_TRACK_PAGEVIEW})),generate_page_view_id:e.some((function(_){return _===FLAG_GENERATE_PAGEVIEW_ID})),enable_element_click_tracking:e.some((function(_){return _===FLAG_ENABLE_ELEMENT_CLICK_TRACKING})),enable_active_view_tracking:e.some((function(_){return _===FLAG_ENABLE_ELEMENT_ACTIVE_VIEW_TRACKING})),enable_activity_tracking:e.some((function(_){return _===FLAG_ENABLE_ACTIVITY_TRACKING})),enable_cross_domain_tracking:e.some((function(_){return _===FLAG_ENABLE_CROSS_DOMAIN_TRACKING}))}}

    /******************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */

    var __assign = function() {
        __assign = Object.assign || function __assign(t) {
            for (var s, i = 1, n = arguments.length; i < n; i++) {
                s = arguments[i];
                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
            }
            return t;
        };
        return __assign.apply(this, arguments);
    };

    function __values(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
            next: function () {
                if (o && i >= o.length) o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }

    function __spreadArray(to, from, pack) {
        if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
            if (ar || !(i in from)) {
                if (!ar) ar = Array.prototype.slice.call(from, 0, i);
                ar[i] = from[i];
            }
        }
        return to.concat(ar || Array.prototype.slice.call(from));
    }

    typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
        var e = new Error(message);
        return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
    };

    var rngBrowser$1 = {exports: {}};

    var getRandomValues$2="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues$2){var rnds8$2=new Uint8Array(16);rngBrowser$1.exports=function(){return getRandomValues$2(rnds8$2),rnds8$2};}else {var rnds$1=new Array(16);rngBrowser$1.exports=function(){for(var r,o=0;o<16;o++)0==(3&o)&&(r=4294967296*Math.random()),rnds$1[o]=r>>>((3&o)<<3)&255;return rnds$1};}

    for(var byteToHex$2=[],i$1=0;i$1<256;++i$1)byteToHex$2[i$1]=(i$1+256).toString(16).substr(1);function bytesToUuid$5(o,e){var t=e||0,r=byteToHex$2;return [r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]]].join("")}var bytesToUuid_1$1=bytesToUuid$5;

    var _nodeId$1,_clockseq$1,rng$4=rngBrowser$1.exports,bytesToUuid$4=bytesToUuid_1$1,_lastMSecs$1=0,_lastNSecs$1=0;function v1$3(e,s,o){var r=s&&o||0,c=s||[],d=(e=e||{}).node||_nodeId$1,n=void 0!==e.clockseq?e.clockseq:_clockseq$1;if(null==d||null==n){var a=rng$4();null==d&&(d=_nodeId$1=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==n&&(n=_clockseq$1=16383&(a[6]<<8|a[7]));}var i=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:_lastNSecs$1+1,t=i-_lastMSecs$1+(l-_lastNSecs$1)/1e4;if(t<0&&void 0===e.clockseq&&(n=n+1&16383),(t<0||i>_lastMSecs$1)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs$1=i,_lastNSecs$1=l,_clockseq$1=n;var u=(1e4*(268435455&(i+=122192928e5))+l)%4294967296;c[r++]=u>>>24&255,c[r++]=u>>>16&255,c[r++]=u>>>8&255,c[r++]=255&u;var _=i/4294967296*1e4&268435455;c[r++]=_>>>8&255,c[r++]=255&_,c[r++]=_>>>24&15|16,c[r++]=_>>>16&255,c[r++]=n>>>8|128,c[r++]=255&n;for(var m=0;m<6;++m)c[r+m]=d[m];return s||bytesToUuid$4(c)}var v1_1$1=v1$3;

    var rng$3=rngBrowser$1.exports,bytesToUuid$3=bytesToUuid_1$1;function v4$4(r,o,e){var n=o&&e||0;"string"==typeof r&&(o="binary"===r?new Array(16):null,r=null);var s=(r=r||{}).random||(r.rng||rng$3)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,o)for(var d=0;d<16;++d)o[n+d]=s[d];return o||bytesToUuid$3(s)}var v4_1$1=v4$4;

    var v1$2=v1_1$1,v4$3=v4_1$1,uuid$1=v4$3;uuid$1.v1=v1$2,uuid$1.v4=v4$3;var uuid_1$1=uuid$1;

    /*!
     * Core functionality for Snowplow JavaScript trackers v3.21.0 (http://bit.ly/sp-js)
     * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
     * Licensed under BSD-3-Clause
     */
    var version$1="3.21.0";function base64urldecode(e){if(!e)return e;switch(4-e.length%4){case 2:e+="==";break;case 3:e+="=";}return base64decode(e.replace(/-/g,"+").replace(/_/g,"/"))}function base64urlencode(e){return e?base64encode(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"):e}var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function base64encode(e){var n,t,r,o,i,a=0,s=0,c=[];if(!e)return e;e=unescape(encodeURIComponent(e));do{n=(i=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,t=i>>12&63,r=i>>6&63,o=63&i,c[s++]=b64.charAt(n)+b64.charAt(t)+b64.charAt(r)+b64.charAt(o);}while(a<e.length);var l=c.join(""),u=e.length%3;return (u?l.slice(0,u-3):l)+"===".slice(u||3)}function base64decode(e){var n,t,r,o,i,a,s,c=0,l=0,u="",d=[];if(!e)return e;e+="";do{n=(a=b64.indexOf(e.charAt(c++))<<18|b64.indexOf(e.charAt(c++))<<12|(o=b64.indexOf(e.charAt(c++)))<<6|(i=b64.indexOf(e.charAt(c++))))>>16&255,t=a>>8&255,r=255&a,d[l++]=64===o?String.fromCharCode(n):64===i?String.fromCharCode(n,t):String.fromCharCode(n,t,r);}while(c<e.length);return u=d.join(""),s=u.replace(/\0+$/,""),decodeURIComponent(s.split("").map((function(e){return "%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}function payloadBuilder(){var e,n={},t=[],r=[],o=[],i=function(e,t){null!=t&&""!==t&&(n[e]=t);};return {add:i,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i(n,e[n]);},addJson:function(e,n,o){if(o&&isNonEmptyJson(o)){var i={keyIfEncoded:e,keyIfNotEncoded:n,json:o};r.push(i),t.push(i);}},addContextEntity:function(e){o.push(e);},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n;},build:function(){return null==e||e(this,r,o),n}}}function payloadJsonProcessor(e){return function(n,t,r){for(var o=function(t,r,o){var i=JSON.stringify(t);e?n.add(r,base64urlencode(i)):n.add(o,i);},i=function(t,r){var o=t||function(){var t=n.getPayload();if(e?t.cx:t.co)return JSON.parse(e?base64urldecode(t.cx):t.co)}();return o?o.data=o.data.concat(r.data):o=r,o},a=void 0,s=0,c=t;s<c.length;s++){var l=c[s];"cx"===l.keyIfEncoded?a=i(a,l.json):o(l.json,l.keyIfEncoded,l.keyIfNotEncoded);}(t.length=0,r.length)&&(a=i(a,{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:__spreadArray([],r,!0)}),r.length=0);a&&o(a,"cx","co");}}function isNonEmptyJson(e){if(!isJson(e))return !1;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return !0;return !1}function isJson(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}var LOG_LEVEL,label="Snowplow: ";!function(e){e[e.none=0]="none",e[e.error=1]="error",e[e.warn=2]="warn",e[e.debug=3]="debug",e[e.info=4]="info";}(LOG_LEVEL||(LOG_LEVEL={}));var LOG=logger();function logger(e){return void 0===e&&(e=LOG_LEVEL.warn),{setLogLevel:function(n){e=LOG_LEVEL[n]?n:LOG_LEVEL.warn;},warn:function(n,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(e>=LOG_LEVEL.warn&&"undefined"!=typeof console){var i=label+n;t?console.warn.apply(console,__spreadArray([i+"\n",t],r,!1)):console.warn.apply(console,__spreadArray([i],r,!1));}},error:function(n,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(e>=LOG_LEVEL.error&&"undefined"!=typeof console){var i=label+n+"\n";t?console.error.apply(console,__spreadArray([i+"\n",t],r,!1)):console.error.apply(console,__spreadArray([i],r,!1));}},debug:function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];e>=LOG_LEVEL.debug&&"undefined"!=typeof console&&console.debug.apply(console,__spreadArray([label+n],t,!1));},info:function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];e>=LOG_LEVEL.info&&"undefined"!=typeof console&&console.info.apply(console,__spreadArray([label+n],t,!1));}}}function globalContexts(){var e=[],n=[];return {getGlobalPrimitives:function(){return e},getConditionalProviders:function(){return n},addGlobalContexts:function(t){for(var r=[],o=[],i=0,a=t;i<a.length;i++){var s=a[i];isConditionalContextProvider(s)?r.push(s):isContextPrimitive(s)&&o.push(s);}e=e.concat(o),n=n.concat(r);},clearGlobalContexts:function(){n=[],e=[];},removeGlobalContexts:function(t){for(var r=function(t){isConditionalContextProvider(t)?n=n.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})):isContextPrimitive(t)&&(e=e.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})));},o=0,i=t;o<i.length;o++){r(i[o]);}},getApplicableContexts:function(t){return function(t){var r=getUsefulSchema(t),o=getEventType(t),i=[],a=generatePrimitives(e,t,o,r);i.push.apply(i,a);var s=generateConditionals(n,t,o,r);return i.push.apply(i,s),i}(t)}}}function pluginContexts(e){return {addPluginContexts:function(n){var t=n?__spreadArray([],n,!0):[];return e.forEach((function(e){try{e.contexts&&t.push.apply(t,e.contexts());}catch(e){LOG.error("Error adding plugin contexts",e);}})),t}}}function getSchemaParts(e){var n=new RegExp("^iglu:([a-zA-Z0-9-_.]+)/([a-zA-Z0-9-_]+)/jsonschema/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$").exec(e);if(null!==n)return n.slice(1,6)}function validateVendorParts(e){if("*"===e[0]||"*"===e[1])return !1;if(e.slice(2).length>0){for(var n=!1,t=0,r=e.slice(2);t<r.length;t++){if("*"===r[t])n=!0;else if(n)return !1}return !0}return 2==e.length}function validateVendor(e){var n=e.split(".");return !!(n&&n.length>1)&&validateVendorParts(n)}function getRuleParts(e){var n=new RegExp("^iglu:((?:(?:[a-zA-Z0-9-_]+|\\*).)+(?:[a-zA-Z0-9-_]+|\\*))/([a-zA-Z0-9-_.]+|\\*)/jsonschema/([1-9][0-9]*|\\*)-(0|[1-9][0-9]*|\\*)-(0|[1-9][0-9]*|\\*)$").exec(e);if(null!==n&&validateVendor(n[1]))return n.slice(1,6)}function isValidRule(e){var n=getRuleParts(e);if(n){var t=n[0];return 5===n.length&&validateVendor(t)}return !1}function isStringArray(e){return Array.isArray(e)&&e.every((function(e){return "string"==typeof e}))}function isValidRuleSetArg(e){return isStringArray(e)?e.every((function(e){return isValidRule(e)})):"string"==typeof e&&isValidRule(e)}function isSelfDescribingJson(e){var n=e;return !!(isNonEmptyJson(n)&&"schema"in n&&"data"in n)&&("string"==typeof n.schema&&"object"==typeof n.data)}function isRuleSet(e){var n=e,t=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(n,"accept")){if(!isValidRuleSetArg(n.accept))return !1;t+=1;}if(Object.prototype.hasOwnProperty.call(n,"reject")){if(!isValidRuleSetArg(n.reject))return !1;t+=1;}return t>0&&t<=2}return !1}function isContextCallbackFunction(e){return "function"==typeof e&&e.length<=1}function isContextPrimitive(e){return isContextCallbackFunction(e)||isSelfDescribingJson(e)}function isFilterProvider(e){return !(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?isContextCallbackFunction(e[0])&&e[1].every(isContextPrimitive):isContextCallbackFunction(e[0])&&isContextPrimitive(e[1]))}function isRuleSetProvider(e){return !(!Array.isArray(e)||2!==e.length)&&(!!isRuleSet(e[0])&&(Array.isArray(e[1])?e[1].every(isContextPrimitive):isContextPrimitive(e[1])))}function isConditionalContextProvider(e){return isFilterProvider(e)||isRuleSetProvider(e)}function matchSchemaAgainstRuleSet(e,n){var t=0,r=0,o=e.accept;Array.isArray(o)?e.accept.some((function(e){return matchSchemaAgainstRule(e,n)}))&&r++:"string"==typeof o&&matchSchemaAgainstRule(o,n)&&r++;var i=e.reject;return Array.isArray(i)?e.reject.some((function(e){return matchSchemaAgainstRule(e,n)}))&&t++:"string"==typeof i&&matchSchemaAgainstRule(i,n)&&t++,r>0&&0===t}function matchSchemaAgainstRule(e,n){if(!isValidRule(e))return !1;var t=getRuleParts(e),r=getSchemaParts(n);if(t&&r){if(!matchVendor(t[0],r[0]))return !1;for(var o=1;o<5;o++)if(!matchPart(t[o],r[o]))return !1;return !0}return !1}function matchVendor(e,n){var t=n.split("."),r=e.split(".");if(t&&r){if(t.length!==r.length)return !1;for(var o=0;o<r.length;o++)if(!matchPart(t[o],r[o]))return !1;return !0}return !1}function matchPart(e,n){return e&&n&&"*"===e||e===n}function getUsefulSchema(e){for(var n=0,t=e.getJson();n<t.length;n++){var r=t[n];if("ue_px"===r.keyIfEncoded&&"object"==typeof r.json.data){var o=r.json.data.schema;if("string"==typeof o)return o}}return ""}function getEventType(e){var n=e.getPayload().e;return "string"==typeof n?n:""}function buildGenerator(e,n,t,r){var o=void 0;try{return o=e({event:n.getPayload(),eventType:t,eventSchema:r}),Array.isArray(o)&&o.every(isSelfDescribingJson)||isSelfDescribingJson(o)?o:void 0}catch(e){o=void 0;}return o}function normalizeToArray(e){return Array.isArray(e)?e:Array.of(e)}function generatePrimitives(e,n,t,r){var o,i=normalizeToArray(e).map((function(e){var o=evaluatePrimitive(e,n,t,r);if(o&&0!==o.length)return o}));return (o=[]).concat.apply(o,i.filter((function(e){return null!=e&&e.filter(Boolean)})))}function evaluatePrimitive(e,n,t,r){if(isSelfDescribingJson(e))return [e];if(isContextCallbackFunction(e)){var o=buildGenerator(e,n,t,r);if(isSelfDescribingJson(o))return [o];if(Array.isArray(o))return o}}function evaluateProvider(e,n,t,r){if(isFilterProvider(e)){var o=e[0],i=!1;try{i=o({event:n.getPayload(),eventType:t,eventSchema:r});}catch(e){i=!1;}if(!0===i)return generatePrimitives(e[1],n,t,r)}else if(isRuleSetProvider(e)&&matchSchemaAgainstRuleSet(e[0],r))return generatePrimitives(e[1],n,t,r);return []}function generateConditionals(e,n,t,r){var o,i=normalizeToArray(e).map((function(e){var o=evaluateProvider(e,n,t,r);if(o&&0!==o.length)return o}));return (o=[]).concat.apply(o,i.filter((function(e){return null!=e&&e.filter(Boolean)})))}function getTimestamp(e){return null==e?{type:"dtm",value:(new Date).getTime()}:"number"==typeof e?{type:"dtm",value:e}:"ttm"===e.type?{type:"ttm",value:e.value}:{type:"dtm",value:e.value||(new Date).getTime()}}function trackerCore(e){void 0===e&&(e={});var n=e.base64,t=e.corePlugins,r=e.callback,o=null!=t?t:[],i=function(e,n,t){var r=pluginContexts(n),o=globalContexts(),i=e,a={};function s(e,n){a[e]=n;}var c={track:function(e,s,c){e.withJsonProcessor(payloadJsonProcessor(i)),e.add("eid",uuid_1$1.v4()),e.addDict(a);var l=getTimestamp(c);e.add(l.type,l.value.toString());var u=function(e){if(e&&e.length)return {schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:e}}(function(e,n){var t=o.getApplicableContexts(e),r=[];return n&&n.length&&r.push.apply(r,n),t&&t.length&&r.push.apply(r,t),r}(e,r.addPluginContexts(s)));void 0!==u&&e.addJson("cx","co",u),n.forEach((function(n){try{n.beforeTrack&&n.beforeTrack(e);}catch(e){LOG.error("Plugin beforeTrack",e);}})),"function"==typeof t&&t(e);var d=e.build();return n.forEach((function(e){try{e.afterTrack&&e.afterTrack(d);}catch(e){LOG.error("Plugin afterTrack",e);}})),d},addPayloadPair:s,getBase64Encoding:function(){return i},setBase64Encoding:function(e){i=e;},addPayloadDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);},resetPayloadPairs:function(e){a=isJson(e)?e:{};},setTrackerVersion:function(e){s("tv",e);},setTrackerNamespace:function(e){s("tna",e);},setAppId:function(e){s("aid",e);},setPlatform:function(e){s("p",e);},setUserId:function(e){s("uid",e);},setScreenResolution:function(e,n){s("res",e+"x"+n);},setViewport:function(e,n){s("vp",e+"x"+n);},setColorDepth:function(e){s("cd",e);},setTimezone:function(e){s("tz",e);},setLang:function(e){s("lang",e);},setIpAddress:function(e){s("ip",e);},setUseragent:function(e){s("ua",e);},addGlobalContexts:function(e){o.addGlobalContexts(e);},clearGlobalContexts:function(){o.clearGlobalContexts();},removeGlobalContexts:function(e){o.removeGlobalContexts(e);}};return c}(null==n||n,o,r),a=__assign(__assign({},i),{addPlugin:function(e){var n,t,r=e.plugin;o.push(r),null===(n=r.logger)||void 0===n||n.call(r,LOG),null===(t=r.activateCorePlugin)||void 0===t||t.call(r,a);}});return null==o||o.forEach((function(e){var n,t;null===(n=e.logger)||void 0===n||n.call(e,LOG),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,a);})),a}function buildSelfDescribingEvent(e){var n=e.event,t=n.schema,r=n.data,o=payloadBuilder(),i={schema:"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",data:{schema:t,data:r}};return o.add("e","ue"),o.addJson("ue_px","ue_pr",i),o}function buildPageView(e){var n=e.pageUrl,t=e.pageTitle,r=e.referrer,o=payloadBuilder();return o.add("e","pv"),o.add("url",n),o.add("page",t),o.add("refr",r),o}function buildPagePing(e){var n=e.pageUrl,t=e.pageTitle,r=e.referrer,o=e.minXOffset,i=e.maxXOffset,a=e.minYOffset,s=e.maxYOffset,c=payloadBuilder();return c.add("e","pp"),c.add("url",n),c.add("page",t),c.add("refr",r),o&&!isNaN(Number(o))&&c.add("pp_mix",o.toString()),i&&!isNaN(Number(i))&&c.add("pp_max",i.toString()),a&&!isNaN(Number(a))&&c.add("pp_miy",a.toString()),s&&!isNaN(Number(s))&&c.add("pp_may",s.toString()),c}var version=version$1;

    var global$1 = "undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};

    var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,inited=!1;function init$1(){inited=!0;for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)lookup[r]=o[r],revLookup[o.charCodeAt(r)]=r;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;}function toByteArray(o){var r,e,t,u,n,p;inited||init$1();var i=o.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");n="="===o[i-2]?2:"="===o[i-1]?1:0,p=new Arr(3*i/4-n),t=n>0?i-4:i;var a=0;for(r=0,e=0;r<t;r+=4,e+=3)u=revLookup[o.charCodeAt(r)]<<18|revLookup[o.charCodeAt(r+1)]<<12|revLookup[o.charCodeAt(r+2)]<<6|revLookup[o.charCodeAt(r+3)],p[a++]=u>>16&255,p[a++]=u>>8&255,p[a++]=255&u;return 2===n?(u=revLookup[o.charCodeAt(r)]<<2|revLookup[o.charCodeAt(r+1)]>>4,p[a++]=255&u):1===n&&(u=revLookup[o.charCodeAt(r)]<<10|revLookup[o.charCodeAt(r+1)]<<4|revLookup[o.charCodeAt(r+2)]>>2,p[a++]=u>>8&255,p[a++]=255&u),p}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,u=[],n=r;n<e;n+=3)t=(o[n]<<16)+(o[n+1]<<8)+o[n+2],u.push(tripletToBase64(t));return u.join("")}function fromByteArray(o){var r;inited||init$1();for(var e=o.length,t=e%3,u="",n=[],p=16383,i=0,a=e-t;i<a;i+=p)n.push(encodeChunk(o,i,i+p>a?a:i+p));return 1===t?(r=o[e-1],u+=lookup[r>>2],u+=lookup[r<<4&63],u+="=="):2===t&&(r=(o[e-2]<<8)+o[e-1],u+=lookup[r>>10],u+=lookup[r>>4&63],u+=lookup[r<<2&63],u+="="),n.push(u),n.join("")}

    function read(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else {if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e;}return (s?-1:1)*p*Math.pow(2,M-r)}function write(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l;}

    var toString={}.toString;var isArray = Array.isArray||function(r){return "[object Array]"==toString.call(r)};

    var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=void 0===global$1.TYPED_ARRAY_SUPPORT||global$1.TYPED_ARRAY_SUPPORT;kMaxLength();function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(t,e){if(kMaxLength()<e)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Buffer.prototype:(null===t&&(t=new Buffer(e)),t.length=e),t}function Buffer(t,e,r){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,t)}return from(this,t,e,r)}function from(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return "undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?fromArrayBuffer(t,e,r,n):"string"==typeof e?fromString(t,e,r):fromObject(t,e)}function assertSize(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc(t,e,r,n){return assertSize(e),e<=0?createBuffer(t,e):void 0!==r?"string"==typeof n?createBuffer(t,e).fill(r,n):createBuffer(t,e).fill(r):createBuffer(t,e)}function allocUnsafe(t,e){if(assertSize(e),t=createBuffer(t,e<0?0:0|checked(e)),!Buffer.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function fromString(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!Buffer.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|byteLength(e,r),f=(t=createBuffer(t,n)).write(e,r);return f!==n&&(t=t.slice(0,f)),t}function fromArrayLike(t,e){var r=e.length<0?0:0|checked(e.length);t=createBuffer(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function fromArrayBuffer(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),Buffer.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Buffer.prototype:t=fromArrayLike(t,e),t}function fromObject(t,e){if(internalIsBuffer(e)){var r=0|checked(e.length);return 0===(t=createBuffer(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return "number"!=typeof e.length||isnan(e.length)?createBuffer(t,0):fromArrayLike(t,e);if("Buffer"===e.type&&isArray(e.data))return fromArrayLike(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(t){if(t>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|t}Buffer.poolSize=8192,Buffer._augment=function(t){return t.__proto__=Buffer.prototype,t},Buffer.from=function(t,e,r){return from(null,t,e,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]),Buffer.alloc=function(t,e,r){return alloc(null,t,e,r)},Buffer.allocUnsafe=function(t){return allocUnsafe(null,t)},Buffer.allocUnsafeSlow=function(t){return allocUnsafe(null,t)};function internalIsBuffer(t){return !(null==t||!t._isBuffer)}function byteLength(t,e){if(internalIsBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(t).length;default:if(n)return utf8ToBytes(t).length;e=(""+e).toLowerCase(),n=!0;}}function slowToString(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return "";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return "";if((r>>>=0)<=(e>>>=0))return "";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,e,r);case"utf8":case"utf-8":return utf8Slice(this,e,r);case"ascii":return asciiSlice(this,e,r);case"latin1":case"binary":return latin1Slice(this,e,r);case"base64":return base64Slice(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0;}}function swap(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function bidirectionalIndexOf(t,e,r,n,f){if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=f?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(f)return -1;r=t.length-1;}else if(r<0){if(!f)return -1;r=0;}if("string"==typeof e&&(e=Buffer.from(e,n)),internalIsBuffer(e))return 0===e.length?-1:arrayIndexOf(t,e,r,n,f);if("number"==typeof e)return e&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):arrayIndexOf(t,[e],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,e,r,n,f){var i,o=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;o=2,u/=2,s/=2,r/=2;}function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(f){var h=-1;for(i=r;i<u;i++)if(a(t,i)===a(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===s)return h*o}else -1!==h&&(i-=i-h),h=-1;}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var c=!0,l=0;l<s;l++)if(a(t,i+l)!==a(e,l)){c=!1;break}if(c)return i}return -1}function hexWrite(t,e,r,n){r=Number(r)||0;var f=t.length-r;n?(n=Number(n))>f&&(n=f):n=f;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(e.substr(2*o,2),16);if(isNaN(u))return o;t[r+o]=u;}return o}function utf8Write(t,e,r,n){return blitBuffer(utf8ToBytes(e,t.length-r),t,r,n)}function asciiWrite(t,e,r,n){return blitBuffer(asciiToBytes(e),t,r,n)}function latin1Write(t,e,r,n){return asciiWrite(t,e,r,n)}function base64Write(t,e,r,n){return blitBuffer(base64ToBytes(e),t,r,n)}function ucs2Write(t,e,r,n){return blitBuffer(utf16leToBytes(e,t.length-r),t,r,n)}function base64Slice(t,e,r){return 0===e&&r===t.length?fromByteArray(t):fromByteArray(t.slice(e,r))}function utf8Slice(t,e,r){r=Math.min(t.length,r);for(var n=[],f=e;f<r;){var i,o,u,s,a=t[f],h=null,c=a>239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=t[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=t[f+1],o=t[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=t[f+1],o=t[f+2],u=t[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s);}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c;}return decodeCodePointsArray(n)}Buffer.isBuffer=isBuffer,Buffer.compare=function(t,e){if(!internalIsBuffer(t)||!internalIsBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,f=0,i=Math.min(r,n);f<i;++f)if(t[f]!==e[f]){r=t[f],n=e[f];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return !0;default:return !1}},Buffer.concat=function(t,e){if(!isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=Buffer.allocUnsafe(e),f=0;for(r=0;r<t.length;++r){var i=t[r];if(!internalIsBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length;}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)swap(this,e,e+1);return this},Buffer.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)swap(this,e,e+3),swap(this,e+1,e+2);return this},Buffer.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)swap(this,e,e+7),swap(this,e+1,e+6),swap(this,e+2,e+5),swap(this,e+3,e+4);return this},Buffer.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?utf8Slice(this,0,t):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(t){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Buffer.compare(this,t)},Buffer.prototype.inspect=function(){var t="",e=INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,e,r,n,f){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),e<0||r>t.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&e>=r)return 0;if(n>=f)return -1;if(e>=r)return 1;if(this===t)return 0;for(var i=(f>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),u=Math.min(i,o),s=this.slice(n,f),a=t.slice(e,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},Buffer.prototype.indexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!0)},Buffer.prototype.lastIndexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!1)},Buffer.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else {if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0);}var f=this.length-e;if((void 0===r||r>f)&&(r=f),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,t,e,r);case"utf8":case"utf-8":return utf8Write(this,t,e,r);case"ascii":return asciiWrite(this,t,e,r);case"latin1":case"binary":return latin1Write(this,t,e,r);case"base64":return base64Write(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0;}},Buffer.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(t){var e=t.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(t,e,r){var n="";r=Math.min(t.length,r);for(var f=e;f<r;++f)n+=String.fromCharCode(127&t[f]);return n}function latin1Slice(t,e,r){var n="";r=Math.min(t.length,r);for(var f=e;f<r;++f)n+=String.fromCharCode(t[f]);return n}function hexSlice(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=e;i<r;++i)f+=toHex(t[i]);return f}function utf16leSlice(t,e,r){for(var n=t.slice(e,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(t,e,r,n,f,i){if(!internalIsBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>f||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function objectWriteUInt16(t,e,r,n){e<0&&(e=65535+e+1);for(var f=0,i=Math.min(t.length-r,2);f<i;++f)t[r+f]=(e&255<<8*(n?f:1-f))>>>8*(n?f:1-f);}function objectWriteUInt32(t,e,r,n){e<0&&(e=4294967295+e+1);for(var f=0,i=Math.min(t.length-r,4);f<i;++f)t[r+f]=e>>>8*(n?f:3-f)&255;}function checkIEEE754(t,e,r,n,f,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(t,e,r,n,f){return f||checkIEEE754(t,e,r,4),write(t,e,r,n,23,4),r+4}function writeDouble(t,e,r,n,f){return f||checkIEEE754(t,e,r,8),write(t,e,r,n,52,8),r+8}Buffer.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),Buffer.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=Buffer.prototype;else {var f=e-t;r=new Buffer(f,void 0);for(var i=0;i<f;++i)r[i]=this[i+t];}return r},Buffer.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t],f=1,i=0;++i<e&&(f*=256);)n+=this[t+i]*f;return n},Buffer.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t+--e],f=1;e>0&&(f*=256);)n+=this[t+--e]*f;return n},Buffer.prototype.readUInt8=function(t,e){return e||checkOffset(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,e){return e||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,e){return e||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,e){return e||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUInt32BE=function(t,e){return e||checkOffset(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t],f=1,i=0;++i<e&&(f*=256);)n+=this[t+i]*f;return n>=(f*=128)&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=e,f=1,i=this[t+--n];n>0&&(f*=256);)i+=this[t+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*e)),i},Buffer.prototype.readInt8=function(t,e){return e||checkOffset(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Buffer.prototype.readInt16LE=function(t,e){e||checkOffset(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){e||checkOffset(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return e||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return e||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,e){return e||checkOffset(t,4,this.length),read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return e||checkOffset(t,4,this.length),read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return e||checkOffset(t,8,this.length),read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return e||checkOffset(t,8,this.length),read(this,t,!1,52,8)},Buffer.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||checkInt(this,t,e,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[e]=255&t;++i<r&&(f*=256);)this[e+i]=t/f&255;return e+r},Buffer.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||checkInt(this,t,e,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[e+f]=255&t;--f>=0&&(i*=256);)this[e+f]=t/i&255;return e+r},Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):objectWriteUInt16(this,t,e,!0),e+2},Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):objectWriteUInt16(this,t,e,!1),e+2},Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):objectWriteUInt32(this,t,e,!0),e+4},Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):objectWriteUInt32(this,t,e,!1),e+4},Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,t,e,r,f-1,-f);}var i=0,o=1,u=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,t,e,r,f-1,-f);}var i=r-1,o=1,u=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):objectWriteUInt16(this,t,e,!0),e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):objectWriteUInt16(this,t,e,!1),e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):objectWriteUInt32(this,t,e,!0),e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):objectWriteUInt32(this,t,e,!1),e+4},Buffer.prototype.writeFloatLE=function(t,e,r){return writeFloat(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return writeFloat(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return writeDouble(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return writeDouble(this,t,e,!1,r)},Buffer.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var f,i=n-r;if(this===t&&r<e&&e<n)for(f=i-1;f>=0;--f)t[f+e]=this[f+r];else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(f=0;f<i;++f)t[f+e]=this[f+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},Buffer.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var f=t.charCodeAt(0);f<256&&(t=f);}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else "number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else {var o=internalIsBuffer(t)?t:utf8ToBytes(new Buffer(t,n).toString()),u=o.length;for(i=0;i<r-e;++i)this[i+e]=o[i%u];}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(t){if((t=stringtrim(t).replace(INVALID_BASE64_RE,"")).length<2)return "";for(;t.length%4!=0;)t+="=";return t}function stringtrim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes(t,e){var r;e=e||1/0;for(var n=t.length,f=null,i=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!f){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320);}else f&&(e-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((e-=1)<0)break;i.push(r);}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128);}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128);}else {if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128);}}return i}function asciiToBytes(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function utf16leToBytes(t,e){for(var r,n,f,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(t){return toByteArray(base64clean(t))}function blitBuffer(t,e,r,n){for(var f=0;f<n&&!(f+r>=e.length||f>=t.length);++f)e[f+r]=t[f];return f}function isnan(t){return t!=t}function isBuffer(t){return null!=t&&(!!t._isBuffer||isFastBuffer(t)||isSlowBuffer(t))}function isFastBuffer(t){return !!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function isSlowBuffer(t){return "function"==typeof t.readFloatLE&&"function"==typeof t.slice&&isFastBuffer(t.slice(0,0))}

    var sha1$1 = {exports: {}};

    var crypt = {exports: {}};

    !function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(r,t){return r<<t|r>>>32-t},rotr:function(r,t){return r<<32-t|r>>>t},endian:function(r){if(r.constructor==Number)return 16711935&t.rotl(r,8)|4278255360&t.rotl(r,24);for(var o=0;o<r.length;o++)r[o]=t.endian(r[o]);return r},randomBytes:function(r){for(var t=[];r>0;r--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(r){for(var t=[],o=0,n=0;o<r.length;o++,n+=8)t[n>>>5]|=r[o]<<24-n%32;return t},wordsToBytes:function(r){for(var t=[],o=0;o<32*r.length;o+=8)t.push(r[o>>>5]>>>24-o%32&255);return t},bytesToHex:function(r){for(var t=[],o=0;o<r.length;o++)t.push((r[o]>>>4).toString(16)),t.push((15&r[o]).toString(16));return t.join("")},hexToBytes:function(r){for(var t=[],o=0;o<r.length;o+=2)t.push(parseInt(r.substr(o,2),16));return t},bytesToBase64:function(t){for(var o=[],n=0;n<t.length;n+=3)for(var e=t[n]<<16|t[n+1]<<8|t[n+2],s=0;s<4;s++)8*n+6*s<=8*t.length?o.push(r.charAt(e>>>6*(3-s)&63)):o.push("=");return o.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],n=0,e=0;n<t.length;e=++n%4)0!=e&&o.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*e+8)-1)<<2*e|r.indexOf(t.charAt(n))>>>6-2*e);return o}};crypt.exports=t;}();

    var charenc={utf8:{stringToBytes:function(n){return charenc.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(charenc.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var e=[],r=0;r<n.length;r++)e.push(255&n.charCodeAt(r));return e},bytesToString:function(n){for(var e=[],r=0;r<n.length;r++)e.push(String.fromCharCode(n[r]));return e.join("")}}},charenc_1=charenc;

    !function(){var r=crypt.exports,e=charenc_1.utf8,s=charenc_1.bin,o=function(o,i){var a=r.wordsToBytes(function(s){s.constructor==String?s=e.stringToBytes(s):void 0!==Buffer&&"function"==typeof isBuffer&&isBuffer(s)?s=Array.prototype.slice.call(s,0):Array.isArray(s)||(s=s.toString());var o=r.bytesToWords(s),i=8*s.length,a=[],t=1732584193,n=-271733879,d=-1732584194,f=271733878,u=-1009589776;o[i>>5]|=128<<24-i%32,o[15+(i+64>>>9<<4)]=i;for(var c=0;c<o.length;c+=16){for(var m=t,p=n,k=d,l=f,_=u,h=0;h<80;h++){if(h<16)a[h]=o[c+h];else {var g=a[h-3]^a[h-8]^a[h-14]^a[h-16];a[h]=g<<1|g>>>31;}var b=(t<<5|t>>>27)+u+(a[h]>>>0)+(h<20?1518500249+(n&d|~n&f):h<40?1859775393+(n^d^f):h<60?(n&d|n&f|d&f)-1894007588:(n^d^f)-899497514);u=f,f=d,d=n<<30|n>>>2,n=t,t=b;}t+=m,n+=p,d+=k,f+=l,u+=_;}return [t,n,d,f,u]}(o));return i&&i.asBytes?a:i&&i.asString?s.bytesToString(a):r.bytesToHex(a)};o._blocksize=16,o._digestsize=20,sha1$1.exports=o;}();

    var rngBrowser = {exports: {}};

    var getRandomValues$1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues$1){var rnds8$1=new Uint8Array(16);rngBrowser.exports=function(){return getRandomValues$1(rnds8$1),rnds8$1};}else {var rnds=new Array(16);rngBrowser.exports=function(){for(var r,o=0;o<16;o++)0==(3&o)&&(r=4294967296*Math.random()),rnds[o]=r>>>((3&o)<<3)&255;return rnds};}

    for(var byteToHex$1=[],i=0;i<256;++i)byteToHex$1[i]=(i+256).toString(16).substr(1);function bytesToUuid$2(o,e){var t=e||0,r=byteToHex$1;return [r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]]].join("")}var bytesToUuid_1=bytesToUuid$2;

    var _nodeId,_clockseq,rng$2=rngBrowser.exports,bytesToUuid$1=bytesToUuid_1,_lastMSecs=0,_lastNSecs=0;function v1$1(e,s,o){var r=s&&o||0,c=s||[],d=(e=e||{}).node||_nodeId,n=void 0!==e.clockseq?e.clockseq:_clockseq;if(null==d||null==n){var a=rng$2();null==d&&(d=_nodeId=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==n&&(n=_clockseq=16383&(a[6]<<8|a[7]));}var i=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:_lastNSecs+1,t=i-_lastMSecs+(l-_lastNSecs)/1e4;if(t<0&&void 0===e.clockseq&&(n=n+1&16383),(t<0||i>_lastMSecs)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=i,_lastNSecs=l,_clockseq=n;var u=(1e4*(268435455&(i+=122192928e5))+l)%4294967296;c[r++]=u>>>24&255,c[r++]=u>>>16&255,c[r++]=u>>>8&255,c[r++]=255&u;var _=i/4294967296*1e4&268435455;c[r++]=_>>>8&255,c[r++]=255&_,c[r++]=_>>>24&15|16,c[r++]=_>>>16&255,c[r++]=n>>>8|128,c[r++]=255&n;for(var m=0;m<6;++m)c[r+m]=d[m];return s||bytesToUuid$1(c)}var v1_1=v1$1;

    var rng$1=rngBrowser.exports,bytesToUuid=bytesToUuid_1;function v4$2(r,o,e){var n=o&&e||0;"string"==typeof r&&(o="binary"===r?new Array(16):null,r=null);var s=(r=r||{}).random||(r.rng||rng$1)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,o)for(var d=0;d<16;++d)o[n+d]=s[d];return o||bytesToUuid(s)}var v4_1=v4$2;

    var v1=v1_1,v4$1=v4_1,uuid=v4$1;uuid.v1=v1,uuid.v4=v4$1;var uuid_1=uuid;

    /*!
     * Core functionality for Snowplow Browser trackers v3.21.0 (http://bit.ly/sp-js)
     * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
     * Licensed under BSD-3-Clause
     */
    function attemptGetLocalStorage(e){try{var n=window.localStorage,t=n.getItem(e+".expires");return null===t||+t>Date.now()?n.getItem(e):(n.removeItem(e),void n.removeItem(e+".expires"))}catch(e){return}}function attemptWriteLocalStorage(e,n,t){void 0===t&&(t=63072e3);try{var o=window.localStorage,r=Date.now()+1e3*t;return o.setItem("".concat(e,".expires"),r.toString()),o.setItem(e,n),!0}catch(e){return !1}}function attemptDeleteLocalStorage(e){try{var n=window.localStorage;return n.removeItem(e),n.removeItem(e+".expires"),!0}catch(e){return !1}}function attemptGetSessionStorage(e){try{return window.sessionStorage.getItem(e)}catch(e){return}}function attemptWriteSessionStorage(e,n){try{return window.sessionStorage.setItem(e,n),!0}catch(e){return !1}}var DEFAULT_CROSS_DOMAIN_LINKER_PARAMS={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1};function createCrossDomainParameterValue(e,n,t){var o,r=(new Date).getTime(),i=__assign(__assign({},DEFAULT_CROSS_DOMAIN_LINKER_PARAMS),n),a=t.domainUserId,s=t.userId,u=t.sessionId,c=t.sourceId,d=t.sourcePlatform,l=t.event,f=l.currentTarget,v="function"==typeof i.reason?i.reason(l):null===(o=null==f?void 0:f.textContent)||void 0===o?void 0:o.trim();return e?[a,r,i.sessionId&&u,i.userId&&urlSafeBase64Encode(s||""),i.sourceId&&urlSafeBase64Encode(c||""),i.sourcePlatform&&d,i.reason&&urlSafeBase64Encode(v||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):t.domainUserId+"."+r}function urlSafeBase64Encode(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")}function isString(e){return !(!e||"string"!=typeof e.valueOf())}function isInteger(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function fixupTitle(e){if(!isString(e)){e=e.text||"";var n=document.getElementsByTagName("title");n&&null!=n[0]&&(e=n[0].text);}return e}function getHostName(e){var n=new RegExp("^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)").exec(e);return n?n[1]:e}function fixupDomain(e){var n=e.length;return "."===e.charAt(--n)&&(e=e.slice(0,n)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function getReferrer(e){var n=window,t=fromQuerystring$1("referrer",n.location.href)||fromQuerystring$1("referer",n.location.href);if(t)return t;if(e)return e;try{if(n.top)return n.top.document.referrer;if(n.parent)return n.parent.document.referrer}catch(e){}return document.referrer}function addEventListener$1(e,n,t,o){return e.addEventListener?(e.addEventListener(n,t,o),!0):e.attachEvent?e.attachEvent("on"+n,t):void(e["on"+n]=t)}function fromQuerystring$1(e,n){var t=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(n);return t?decodeURIComponent(t[1].replace(/\+/g," ")):null}function decorateQuerystring$1(e,n,t){var o=n+"="+t,r=e.split("#"),i=r[0].split("?"),a=i.shift(),s=i.join("?");if(s){for(var u=!0,c=s.split("&"),d=0;d<c.length;d++)if(c[d].substr(0,n.length+1)===n+"="){u=!1,c[d]=o,s=c.join("&");break}u&&(s=o+"&"+s);}else s=o;return r[0]=a+"?"+s,r.join("#")}function findRootDomain(e,n){for(var t=window.location.hostname,o="_sp_root_domain_test_",r=o+(new Date).getTime(),i="_test_value_"+(new Date).getTime(),a=t.split("."),s=a.length-2;s>=0;s--){var u=a.slice(s).join(".");if(cookie(r,i,0,"/",u,e,n),cookie(r)===i){deleteCookie(r,u,e,n);for(var c=getCookiesWithPrefix(o),d=0;d<c.length;d++)deleteCookie(c[d],u,e,n);return u}}return t}function deleteCookie(e,n,t,o){cookie(e,"",-1,"/",n,t,o);}function getCookiesWithPrefix(e){for(var n=document.cookie.split("; "),t=[],o=0;o<n.length;o++)n[o].substring(0,e.length)===e&&t.push(n[o]);return t}function cookie(e,n,t,o,r,i,a){return arguments.length>1?document.cookie=e+"="+encodeURIComponent(null!=n?n:"")+(t?"; Expires="+new Date(+new Date+1e3*t).toUTCString():"")+(o?"; Path="+o:"")+(r?"; Domain="+r:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function hasLocalStorage(){try{return !!window.localStorage}catch(e){return !0}}function localStorageAccessible(){var e="modernizr";if(!hasLocalStorage())return !1;try{var n=window.localStorage;return n.setItem(e,e),n.removeItem(e),!0}catch(e){return !1}}var WEB_PAGE_SCHEMA="iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",BROWSER_CONTEXT_SCHEMA="iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",CLIENT_SESSION_SCHEMA="iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",PAYLOAD_DATA_SCHEMA="iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4";function OutQueueManager(e,n,t,o,r,i,a,s,u,c,d,l,f,v,m,g,I,p,w,h){void 0===p&&(p=!0);var S,k,y=!1,x=[],T=!1,C=!0===(o="string"==typeof o?o.toLowerCase():o)||"beacon"===o||"true"===o,E=Boolean(C&&window.navigator&&"function"==typeof window.navigator.sendBeacon&&!(function(e,n){var t=n.match("(iP.+; CPU .*OS (d+)[_d]*.*) AppleWebKit/");return !(!t||!t.length)&&parseInt(t[0])<=e}(13,k=window.navigator.userAgent)||function(e,n,t){var o=t.match("(Macintosh;.*Mac OS X (d+)_(d+)[_d]*.*) AppleWebKit/");return !(!o||!o.length)&&(parseInt(o[0])<=e||parseInt(o[0])===e&&parseInt(o[1])<=n)}(10,15,k)&&function(e){return e.match("Version/.* Safari/")&&!function(e){return e.match("Chrom(e|ium)")}(e)}(k)))&&C,b="get"===o,O=Boolean(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),L=!b&&O&&("post"===o||C),D=L?r:"/i",P="snowplowOutQueue_".concat(e,"_").concat(L?"post2":"get");if(C&&(f={}),i=t&&localStorageAccessible()&&L&&i||1,t)try{var A=window.localStorage.getItem(P);x=A?JSON.parse(A):[];}catch(e){}function _(e){var n=Object.keys(e).map((function(n){return [n,e[n]]})).reduce((function(e,n){var t=n[0],o=n[1];return e[t]=o.toString(),e}),{});return {evt:n,bytes:N(JSON.stringify(n))}}function N(e){for(var n=0,t=0;t<e.length;t++){var o=e.charCodeAt(t);o<=127?n+=1:o<=2047?n+=2:o>=55296&&o<=57343?(n+=4,t++):n+=o<65535?3:4;}return n}Array.isArray(x)||(x=[]),n.outQueues.push(x),O&&i>1&&n.bufferFlushers.push((function(e){y||B(e);}));var R=function(e){return "object"==typeof e[0]&&"evt"in e[0]};function M(e,n){var t=H(n,!0,!1),o=W([e.evt]);t.onreadystatechange=function(){4===t.readyState&&(V(t.status)?null==w||w(o):null==h||h({status:t.status,message:t.statusText,events:o,willRetry:!1}));},t.send(j(o));}function F(e){for(var n=0;n<e;n++)x.shift();t&&attemptWriteLocalStorage(P,JSON.stringify(x.slice(0,c)));}function U(e,n,t){e.onreadystatechange=function(){if(4===e.readyState)if(clearTimeout(o),V(e.status))F(n),null==w||w(t),B();else {var r=function(e){if(V(e))return !1;if(!p)return !1;if(m.includes(e))return !0;return !g.includes(e)}(e.status);r||(LOG.error("Status ".concat(e.status,", will not retry.")),F(n)),null==h||h({status:e.status,message:e.statusText,events:t,willRetry:r}),y=!1;}};var o=setTimeout((function(){e.abort(),p||F(n),null==h||h({status:0,message:"timeout",events:t,willRetry:p}),y=!1;}),d);}function B(e){for(void 0===e&&(e=!1);x.length&&"string"!=typeof x[0]&&"object"!=typeof x[0];)x.shift();if(x.length){if(!isString(S))throw "No collector configured";if(y=!0,I&&!T){var n=H(I,!1,e);return T=!0,n.timeout=d,n.onreadystatechange=function(){4===n.readyState&&B();},void n.send()}if(O){var o=void 0,r=void 0,i=void 0;if(R(x)?(r=H(o=S,!0,e),i=function(e){for(var n=0,t=0;n<e.length&&!((t+=e[n].bytes)>=a);)n+=1;return n}(x)):(r=H(o=z(x[0]),!1,e),i=1),R(x)){var s=x.slice(0,i);if(s.length>0){var u=!1,f=s.map((function(e){return e.evt}));if(E){var v=new Blob([j(W(f))],{type:"application/json"});try{u=window.navigator.sendBeacon(o,v);}catch(e){u=!1;}}if(!0===u)F(i),null==w||w(s),B();else {var m=W(f);U(r,i,m),r.send(j(m));}}}else U(r,i,[o]),r.send();}else if(l||R(x))y=!1;else {var g=new Image(1,1),p=!0;g.onload=function(){p&&(p=!1,x.shift(),t&&attemptWriteLocalStorage(P,JSON.stringify(x.slice(0,c))),B());},g.onerror=function(){p&&(p=!1,y=!1);},g.src=z(x[0]),setTimeout((function(){p&&y&&(p=!1,B());}),d);}}else y=!1;}function V(e){return e>=200&&e<300}function H(e,n,t){var o=new XMLHttpRequest;for(var r in n?(o.open("POST",e,!t),o.setRequestHeader("Content-Type","application/json; charset=UTF-8")):o.open("GET",e,!t),o.withCredentials=v,l&&o.setRequestHeader("SP-Anonymous","*"),f)Object.prototype.hasOwnProperty.call(f,r)&&o.setRequestHeader(r,f[r]);return o}function j(e){return JSON.stringify({schema:PAYLOAD_DATA_SCHEMA,data:e})}function W(e){for(var n=(new Date).getTime().toString(),t=0;t<e.length;t++)e[t].stm=n;return e}function z(e){return u?S+e.replace("?","?stm="+(new Date).getTime()+"&"):S+e}return {enqueueRequest:function(e,n){S=n+D;var o=function(e,n){return LOG.warn("Event ("+e+"B) too big, max is "+n)};if(L){if((l=_(e)).bytes>=a)return o(l.bytes,a),void M(l,S);x.push(l);}else {var u=function(e){var n="?",t={co:!0,cx:!0},o=!0;for(var r in e)e.hasOwnProperty(r)&&!t.hasOwnProperty(r)&&(o?o=!1:n+="&",n+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));for(var i in t)e.hasOwnProperty(i)&&t.hasOwnProperty(i)&&(n+="&"+i+"="+encodeURIComponent(e[i]));return n}(e);if(s>0){var d=N(z(u));if(d>=s){var l;if(o(d,s),O)M(l=_(e),n+r);return}}x.push(u);}var f=!1;t&&(f=attemptWriteLocalStorage(P,JSON.stringify(x.slice(0,c)))),y||f&&!(x.length>=i)||B();},executeQueue:function(){y||B();},setUseLocalStorage:function(e){t=e;},setAnonymousTracking:function(e){l=e;},setCollectorUrl:function(e){S=e+D;},setBufferSize:function(e){i=e;}}}function getParameter(e,n){var t=new RegExp("^(?:https?|ftp)(?::/*(?:[^?]+))([?][^#]+)").exec(e);return t&&(null==t?void 0:t.length)>1?fromQuerystring$1(n,t[1]):null}function fixupUrl(e,n,t){var o;return "translate.googleusercontent.com"===e?(""===t&&(t=n),e=getHostName(n=null!==(o=getParameter(n,"u"))&&void 0!==o?o:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=getHostName(n=document.links[0].href)),[e,n,t]}var cookieDisabledIndex=0,domainUserIdIndex=1,createTsIndex=2,visitCountIndex=3,nowTsIndex=4,lastVisitTsIndex=5,sessionIdIndex=6,previousSessionIdIndex=7,firstEventIdIndex=8,firstEventTsInMsIndex=9,eventIndexIndex=10;function emptyIdCookie(){return ["1","",0,0,0,void 0,"","","",void 0,0]}function parseIdCookie(e,n,t,o){var r,i=new Date,a=Math.round(i.getTime()/1e3);e?(r=e.split(".")).unshift("0"):r=["1",n,a,o,a,"",t],r[sessionIdIndex]&&"undefined"!==r[sessionIdIndex]||(r[sessionIdIndex]=uuid_1.v4()),r[previousSessionIdIndex]&&"undefined"!==r[previousSessionIdIndex]||(r[previousSessionIdIndex]=""),r[firstEventIdIndex]&&"undefined"!==r[firstEventIdIndex]||(r[firstEventIdIndex]=""),r[firstEventTsInMsIndex]&&"undefined"!==r[firstEventTsInMsIndex]||(r[firstEventTsInMsIndex]=""),r[eventIndexIndex]&&"undefined"!==r[eventIndexIndex]||(r[eventIndexIndex]=0);var s=function(e,n){var t=parseInt(e);return isNaN(t)?n:t},u=function(e){return e?s(e,void 0):void 0};return [r[cookieDisabledIndex],r[domainUserIdIndex],s(r[createTsIndex],a),s(r[visitCountIndex],o),s(r[nowTsIndex],a),u(r[lastVisitTsIndex]),r[sessionIdIndex],r[previousSessionIdIndex],r[firstEventIdIndex],u(r[firstEventTsInMsIndex]),s(r[eventIndexIndex],0)]}function initializeDomainUserId(e,n){var t;return e[domainUserIdIndex]?t=e[domainUserIdIndex]:n?(t="",e[domainUserIdIndex]=t):(t=uuid_1.v4(),e[domainUserIdIndex]=t),t}function startNewIdCookieSession(e,n){void 0===n&&(n={memorizedVisitCount:1});var t=n.memorizedVisitCount;cookiesEnabledInIdCookie(e)?(e[previousSessionIdIndex]=e[sessionIdIndex],e[lastVisitTsIndex]=e[nowTsIndex],e[visitCountIndex]++):e[visitCountIndex]=t;var o=uuid_1.v4();return e[sessionIdIndex]=o,e[eventIndexIndex]=0,e[firstEventIdIndex]="",e[firstEventTsInMsIndex]=void 0,o}function updateNowTsInIdCookie(e){e[nowTsIndex]=Math.round((new Date).getTime()/1e3);}function updateFirstEventInIdCookie(e,n){if(0===e[eventIndexIndex]){var t=n.build();e[firstEventIdIndex]=t.eid;var o=t.dtm||t.ttm;e[firstEventTsInMsIndex]=o?parseInt(o):void 0;}}function incrementEventIndexInIdCookie(e){e[eventIndexIndex]+=1;}function serializeIdCookie(e,n){var t=__spreadArray([],e,!0);return n&&(t[domainUserIdIndex]="",t[previousSessionIdIndex]=""),t.shift(),t.join(".")}function clientSessionFromIdCookie(e,n,t){var o=e[firstEventTsInMsIndex];return {userId:t?"00000000-0000-0000-0000-000000000000":e[domainUserIdIndex],sessionId:e[sessionIdIndex],eventIndex:e[eventIndexIndex],sessionIndex:e[visitCountIndex],previousSessionId:t?null:e[previousSessionIdIndex]||null,storageMechanism:"localStorage"==n?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[firstEventIdIndex]||null,firstEventTimestamp:o?new Date(o).toISOString():null}}function sessionIdFromIdCookie(e){return e[sessionIdIndex]}function domainUserIdFromIdCookie(e){return e[domainUserIdIndex]}function visitCountFromIdCookie(e){return e[visitCountIndex]}function cookiesEnabledInIdCookie(e){return "0"===e[cookieDisabledIndex]}function eventIndexFromIdCookie(e){return e[eventIndexIndex]}var DIMENSION_SEPARATOR="x";function getBrowserProperties(){return {viewport:floorDimensionFields(detectViewport()),documentSize:floorDimensionFields(detectDocumentSize()),resolution:floorDimensionFields(detectScreenResolution()),colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio,cookiesEnabled:window.navigator.cookieEnabled,online:window.navigator.onLine,browserLanguage:window.navigator.language||window.navigator.userLanguage,documentLanguage:document.documentElement.lang,webdriver:window.navigator.webdriver,deviceMemory:window.navigator.deviceMemory,hardwareConcurrency:window.navigator.hardwareConcurrency}}function detectViewport(){var e,n;if("innerWidth"in window)e=window.innerWidth,n=window.innerHeight;else {var t=document.documentElement||document.body;e=t.clientWidth,n=t.clientHeight;}return e>=0&&n>=0?e+DIMENSION_SEPARATOR+n:null}function detectDocumentSize(){var e=document.documentElement,n=document.body,t=n?Math.max(n.offsetHeight,n.scrollHeight):0,o=Math.max(e.clientWidth,e.offsetWidth,e.scrollWidth),r=Math.max(e.clientHeight,e.offsetHeight,e.scrollHeight,t);return isNaN(o)||isNaN(r)?"":o+DIMENSION_SEPARATOR+r}function detectScreenResolution(){return screen.width+DIMENSION_SEPARATOR+screen.height}function floorDimensionFields(e){return e&&e.split(DIMENSION_SEPARATOR).map((function(e){return Math.floor(Number(e))})).join(DIMENSION_SEPARATOR)}function Tracker$1(e,n,t,o,r,i){void 0===i&&(i={});var a=[],s=function(e,n,t,o,r,i){var s,u,c,d,l,f,v,m,g,I,p,w,h,S,k,y,x,T,C,E,b,O,L,D,P,A,_,N;i.eventMethod=null!==(s=i.eventMethod)&&void 0!==s?s:"post";var R,M,F=function(e){var n;return null!==(n=e.stateStorageStrategy)&&void 0!==n?n:"cookieAndLocalStorage"},U=function(e){var n,t;return "boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withSessionTracking))&&void 0!==t&&t)},B=function(e){var n,t;return "boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withServerAnonymisation))&&void 0!==t&&t)},V=function(e){return !!e.anonymousTracking},H=null!==(c=null===(u=null==i?void 0:i.contexts)||void 0===u?void 0:u.browser)&&void 0!==c&&c,j=null===(l=null===(d=null==i?void 0:i.contexts)||void 0===d?void 0:d.webPage)||void 0===l||l;a.push((R=function(e){return Le?null:e},M=function(e){return be?e:R(e)},{beforeTrack:function(e){var n=Ze("ses"),t=vn(),o=0===eventIndexFromIdCookie(t);if(re=!!X&&!!cookie(X),Te||re)dn();else {cookiesEnabledInIdCookie(t)?(te=n||"none"==De?sessionIdFromIdCookie(t):startNewIdCookieSession(t),Ae=visitCountFromIdCookie(t)):(new Date).getTime()-Pe>1e3*Ee&&(Ae++,te=startNewIdCookieSession(t,{memorizedVisitCount:Ae})),updateNowTsInIdCookie(t),updateFirstEventInIdCookie(t,e),incrementEventIndexInIdCookie(t);var r=getBrowserProperties(),i=r.viewport,a=r.documentSize;e.add("vp",i),e.add("ds",a),e.add("vid",M(Ae)),e.add("sid",M(te)),e.add("duid",R(domainUserIdFromIdCookie(t))),e.add("uid",R(oe)),Xe(),e.add("refr",Je(W||le)),e.add("url",Je(z||de));var s=clientSessionFromIdCookie(t,De,Le);if(!Fe||Le&&!be||function(e,n){var t={schema:CLIENT_SESSION_SCHEMA,data:n};e.addContextEntity(t);}(e,s),"none"!=De){un(t);var u=sn();n&&!o||!u||!Ue||Be||(Ue(s),Be=!1);}Pe=(new Date).getTime();}}})),j&&a.push({contexts:function(){return [{schema:WEB_PAGE_SCHEMA,data:{id:In()}}]}}),H&&a.push({contexts:function(){return [{schema:BROWSER_CONTEXT_SCHEMA,data:__assign(__assign({},getBrowserProperties()),{tabId:pn()})}]}}),a.push.apply(a,null!==(f=i.plugins)&&void 0!==f?f:[]);var W,z,G,Q,q,X,Y,J,K,$,Z,ee,ne,te,oe,re,ie,ae=trackerCore({base64:i.encodeBase64,corePlugins:a,callback:function(e){Te||re||_e.enqueueRequest(e.build(),ve);}}),se=document.characterSet||document.charset,ue=fixupUrl(window.location.hostname,window.location.href,getReferrer()),ce=fixupDomain(ue[0]),de=ue[1],le=ue[2],fe=null!==(v=i.platform)&&void 0!==v?v:"web",ve=mn(o),me=null!==(m=i.postPath)&&void 0!==m?m:"/com.snowplowanalytics.snowplow/tp2",ge=null!==(g=i.appId)&&void 0!==g?g:"",Ie=document.title,pe=null===(I=i.resetActivityTrackingOnPageView)||void 0===I||I,we=null!==(p=i.cookieName)&&void 0!==p?p:"_sp_",he=null!==(w=i.cookieDomain)&&void 0!==w?w:void 0,Se="/",ke=null!==(h=i.cookieSameSite)&&void 0!==h?h:"None",ye=null===(S=i.cookieSecure)||void 0===S||S,xe=window.navigator.doNotTrack||window.navigator.msDoNotTrack||window.doNotTrack,Te=void 0!==i.respectDoNotTrack&&(i.respectDoNotTrack&&("yes"===xe||"1"===xe)),Ce=null!==(k=i.cookieLifetime)&&void 0!==k?k:63072e3,Ee=null!==(y=i.sessionCookieTimeout)&&void 0!==y?y:1800,be=U(i),Oe=B(i),Le=V(i),De=F(i),Pe=(new Date).getTime(),Ae=1,_e=OutQueueManager(e,r,"localStorage"==De||"cookieAndLocalStorage"==De,i.eventMethod,me,null!==(x=i.bufferSize)&&void 0!==x?x:1,null!==(T=i.maxPostBytes)&&void 0!==T?T:4e4,null!==(C=i.maxGetBytes)&&void 0!==C?C:0,null===(E=i.useStm)||void 0===E||E,null!==(b=i.maxLocalStorageQueueSize)&&void 0!==b?b:1e3,null!==(O=i.connectionTimeout)&&void 0!==O?O:5e3,Oe,null!==(L=i.customHeaders)&&void 0!==L?L:{},null===(D=i.withCredentials)||void 0===D||D,null!==(P=i.retryStatusCodes)&&void 0!==P?P:[],(null!==(A=i.dontRetryStatusCodes)&&void 0!==A?A:[]).concat([400,401,403,410,422]),i.idService,i.retryFailedRequests,i.onRequestSuccess,i.onRequestFailure),Ne=!1,Re=!1,Me={enabled:!1,installed:!1,configurations:{}},Fe=null!==(N=null===(_=i.contexts)||void 0===_?void 0:_.session)&&void 0!==N&&N,Ue=i.onSessionUpdateCallback,Be=!1,Ve="boolean"==typeof(ie=i.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:ie}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:ie},He=Ve.useExtendedCrossDomainLinker,je=Ve.collectCrossDomainAttributes;i.hasOwnProperty("discoverRootDomain")&&i.discoverRootDomain&&(he=findRootDomain(ke,ye));var We=getBrowserProperties(),ze=We.browserLanguage,Ge=We.resolution,Qe=We.colorDepth,qe=We.cookiesEnabled;function Xe(){(ue=fixupUrl(window.location.hostname,window.location.href,getReferrer()))[1]!==de&&(le=getReferrer(de)),ce=fixupDomain(ue[0]),de=ue[1];}function Ye(e){for(var n,t=(n=He,function(e){var t=e.currentTarget,o=createCrossDomainParameterValue(n,je,{domainUserId:ne,userId:oe||void 0,sessionId:te,sourceId:ge,sourcePlatform:fe,event:e});(null==t?void 0:t.href)&&(t.href=decorateQuerystring$1(t.href,"_sp",o));}),o=0;o<document.links.length;o++){var r=document.links[o];!r.spDecorationEnabled&&e(r)&&(r.addEventListener("click",t,!0),r.addEventListener("mousedown",t,!0),r.spDecorationEnabled=!0);}}function Je(e){var n;return Q&&(n=new RegExp("#.*"),e=e.replace(n,"")),q&&(n=new RegExp("[{}]","g"),e=e.replace(n,"")),e}function Ke(e){var n=new RegExp("^([a-z]+):").exec(e);return n?n[1]:null}function $e(e){return we+e+"."+ee}function Ze(e){var n=$e(e);return "localStorage"==De?attemptGetLocalStorage(n):"cookie"==De||"cookieAndLocalStorage"==De?cookie(n):void 0}function en(){Xe(),ee=sha1$1.exports((he||ce)+(Se||"/")).slice(0,4);}function nn(){var e=new Date;Y=e.getTime();}function tn(){!function(){var e=on(),n=e[0];n<J?J=n:n>K&&(K=n);var t=e[1];t<$?$=t:t>Z&&(Z=t);}(),nn();}function on(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function rn(){var e=on(),n=e[0];J=n,K=n;var t=e[1];$=t,Z=t;}function an(e){return Math.round(e)}function sn(){return cn($e("ses"),"*",Ee)}function un(e){return cn($e("id"),serializeIdCookie(e,Le),Ce)}function cn(e,n,t){return !(Le&&!be)&&("localStorage"==De?attemptWriteLocalStorage(e,n,t):("cookie"==De||"cookieAndLocalStorage"==De)&&(cookie(e,n,t,Se,he,ke,ye),-1!==document.cookie.indexOf("".concat(e,"="))))}function dn(e){var n=$e("id"),t=$e("ses");attemptDeleteLocalStorage(n),attemptDeleteLocalStorage(t),deleteCookie(n,he,ke,ye),deleteCookie(t,he,ke,ye),(null==e?void 0:e.preserveSession)||(te=uuid_1.v4(),Ae=1),(null==e?void 0:e.preserveUser)||(ne=Le?"":uuid_1.v4(),oe=null);}function ln(e){e&&e.stateStorageStrategy&&(i.stateStorageStrategy=e.stateStorageStrategy,De=F(i)),Le=V(i),be=U(i),Oe=B(i),_e.setUseLocalStorage("localStorage"==De||"cookieAndLocalStorage"==De),_e.setAnonymousTracking(Oe);}function fn(){if(!Le||be){var e="none"!=De&&!!Ze("ses"),n=vn();ne=initializeDomainUserId(n,Le),te=e?sessionIdFromIdCookie(n):startNewIdCookieSession(n),Ae=visitCountFromIdCookie(n),"none"!=De&&(sn(),updateNowTsInIdCookie(n),un(n));}}function vn(){return "none"==De?emptyIdCookie():parseIdCookie(Ze("id")||void 0,ne,te,Ae)}function mn(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function gn(){Ne&&null!=r.pageViewId||(r.pageViewId=uuid_1.v4());}function In(){return null==r.pageViewId&&(r.pageViewId=uuid_1.v4()),r.pageViewId}function pn(){if("none"===De||Le||!j)return null;var e="_sp_tab_id",n=attemptGetSessionStorage(e);return n||(attemptWriteSessionStorage(e,uuid_1.v4()),n=attemptGetSessionStorage(e)),n||null}function wn(e,n){return (e||[]).concat(n?n():[])}function hn(e,n,t){var o=function(e,n){Xe(),e({context:n,pageViewId:In(),minXOffset:J,minYOffset:$,maxXOffset:K,maxYOffset:Z}),rn();},r=function(){var r=new Date;Y+e.configHeartBeatTimer>r.getTime()&&o(e.callback,wn(n,t));};0===e.configMinimumVisitLength?e.activityInterval=window.setInterval(r,e.configHeartBeatTimer):e.activityInterval=window.setTimeout((function(){var i=new Date;Y+e.configMinimumVisitLength>i.getTime()&&o(e.callback,wn(n,t)),e.activityInterval=window.setInterval(r,e.configHeartBeatTimer);}),e.configMinimumVisitLength);}function Sn(e){var n=e.minimumVisitLength,t=e.heartbeatDelay,o=e.callback;if(isInteger(n)&&isInteger(t))return {configMinimumVisitLength:1e3*n,configHeartBeatTimer:1e3*t,callback:o};LOG.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers");}function kn(e){var n=e.context,t=e.minXOffset,o=e.minYOffset,r=e.maxXOffset,i=e.maxYOffset,a=document.title;a!==Ie&&(Ie=a,G=void 0),ae.track(buildPagePing({pageUrl:Je(z||de),pageTitle:fixupTitle(G||Ie),referrer:Je(W||le),minXOffset:an(t),maxXOffset:an(r),minYOffset:an(o),maxYOffset:an(i)}),n);}function yn(e){var n=Me.configurations[e];0===(null==n?void 0:n.configMinimumVisitLength)?window.clearTimeout(null==n?void 0:n.activityInterval):window.clearInterval(null==n?void 0:n.activityInterval),Me.configurations[e]=void 0;}ae.setTrackerVersion(t),ae.setTrackerNamespace(n),ae.setAppId(ge),ae.setPlatform(fe),ae.addPayloadPair("cookie",qe?"1":"0"),ae.addPayloadPair("cs",se),ae.addPayloadPair("lang",ze),ae.addPayloadPair("res",Ge),ae.addPayloadPair("cd",Qe),en(),fn(),i.crossDomainLinker&&Ye(i.crossDomainLinker);var xn={getDomainSessionIndex:function(){return Ae},getPageViewId:In,getTabId:pn,newSession:function(){var e=vn();if(cookiesEnabledInIdCookie(e)?(te="none"!=De?startNewIdCookieSession(e):sessionIdFromIdCookie(e),Ae=visitCountFromIdCookie(e)):(Ae++,te=startNewIdCookieSession(e,{memorizedVisitCount:Ae})),updateNowTsInIdCookie(e),"none"!=De){var n=clientSessionFromIdCookie(e,De,Le);un(e),sn()&&Ue&&(Be=!0,Ue(n));}Pe=(new Date).getTime();},getCookieName:function(e){return $e(e)},getUserId:function(){return oe},getDomainUserId:function(){return vn()[1]},getDomainUserInfo:function(){return vn()},setReferrerUrl:function(e){W=e;},setCustomUrl:function(e){Xe(),z=function(e,n){var t;return Ke(n)?n:"/"===n.slice(0,1)?Ke(e)+"://"+getHostName(e)+n:((t=(e=Je(e)).indexOf("?"))>=0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))!==e.length-1&&(e=e.slice(0,t+1)),e+n)}(de,e);},setDocumentTitle:function(e){Ie=document.title,G=e;},discardHashTag:function(e){Q=e;},discardBrace:function(e){q=e;},setCookiePath:function(e){Se=e,en();},setVisitorCookieTimeout:function(e){Ce=e;},crossDomainLinker:function(e){Ye(e);},enableActivityTracking:function(e){Me.configurations.pagePing||(Me.enabled=!0,Me.configurations.pagePing=Sn(__assign(__assign({},e),{callback:kn})));},enableActivityTrackingCallback:function(e){Me.configurations.callback||(Me.enabled=!0,Me.configurations.callback=Sn(e));},disableActivityTracking:function(){yn("pagePing");},disableActivityTrackingCallback:function(){yn("callback");},updatePageActivity:function(){nn();},setOptOutCookie:function(e){X=e;},setUserId:function(e){oe=e;},setUserIdFromLocation:function(e){Xe(),oe=fromQuerystring$1(e,de);},setUserIdFromReferrer:function(e){Xe(),oe=fromQuerystring$1(e,le);},setUserIdFromCookie:function(e){oe=cookie(e);},setCollectorUrl:function(e){ve=mn(e),_e.setCollectorUrl(ve);},setBufferSize:function(e){_e.setBufferSize(e);},flushBuffer:function(e){void 0===e&&(e={}),_e.executeQueue(),e.newBufferSize&&_e.setBufferSize(e.newBufferSize);},trackPageView:function(e){void 0===e&&(e={}),function(e){var n=e.title,t=e.context,o=e.timestamp,r=e.contextCallback;Xe(),Re&&gn(),Re=!0,Ie=document.title;var i=fixupTitle((G=n)||Ie);ae.track(buildPageView({pageUrl:Je(z||de),pageTitle:i,referrer:Je(W||le)}),wn(t,r),o);var a=new Date,s=!1;if(Me.enabled&&!Me.installed){Me.installed=!0,s=!0;var u={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,n=Object.defineProperty({},"passive",{get:function(){e=!0;},set:function(){}}),t=function(){};window.addEventListener("testPassiveEventSupport",t,n),window.removeEventListener("testPassiveEventSupport",t,n),u.hasSupport=e;}}};u.update();var c="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(u,"hasSupport")?addEventListener$1(document,c,nn,{passive:!0}):addEventListener$1(document,c,nn),rn();var d=function(e,n){return void 0===n&&(n=nn),function(e){return addEventListener$1(document,e,n)}};["click","mouseup","mousedown","mousemove","keypress","keydown","keyup","touchend","touchstart"].forEach(d(document)),["resize","focus","blur"].forEach(d(window)),d(window,tn)("scroll");}if(Me.enabled&&(pe||s)){Y=a.getTime();var l=void 0;for(l in Me.configurations){var f=Me.configurations[l];f&&(window.clearInterval(f.activityInterval),hn(f,t,r));}}}(e);},preservePageViewId:function(){Ne=!0;},disableAnonymousTracking:function(e){i.anonymousTracking=!1,ln(e),fn(),_e.executeQueue();},enableAnonymousTracking:function(e){var n;i.anonymousTracking=null===(n=e&&(null==e?void 0:e.options))||void 0===n||n,ln(e),be||gn();},clearUserData:dn};return __assign(__assign({},xn),{id:e,namespace:n,core:ae,sharedState:r})}(e,n,t,o,r,i),u=__assign(__assign({},s),{addPlugin:function(e){var n,t;u.core.addPlugin(e),null===(t=(n=e.plugin).activateBrowserPlugin)||void 0===t||t.call(n,u);}});return a.forEach((function(e){var n;null===(n=e.activateBrowserPlugin)||void 0===n||n.call(e,u);})),u}var namedTrackers={};function dispatchToTrackers(e,n){try{getTrackers(null!=e?e:allTrackerNames()).forEach(n);}catch(e){LOG.error("Function failed",e);}}function addTracker(e,n,t,o,r,i){return namedTrackers.hasOwnProperty(e)?null:(namedTrackers[e]=Tracker$1(e,n,t,o,r,i),namedTrackers[e])}function getTrackers(e){return getTrackersFromCollection(e,namedTrackers)}function allTrackerNames(){return Object.keys(namedTrackers)}function getTrackersFromCollection(e,n){for(var t=[],o=0,r=e;o<r.length;o++){var i=r[o];n.hasOwnProperty(i)?t.push(n[i]):LOG.warn(i+" not configured");}return t}var SharedState=function(){this.outQueues=[],this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[];};function createSharedState(){var e=new SharedState,n=document,t=window;function o(){var n;if(!e.hasLoaded)for(e.hasLoaded=!0,n=0;n<e.registeredOnLoadHandlers.length;n++)e.registeredOnLoadHandlers[n]();return !0}return n.visibilityState&&addEventListener$1(n,"visibilitychange",(function(){"hidden"==n.visibilityState&&e.bufferFlushers.forEach((function(e){e(!1);}));}),!1),addEventListener$1(t,"beforeunload",(function(){e.bufferFlushers.forEach((function(e){e(!1);}));}),!1),"loading"===document.readyState?(n.addEventListener?n.addEventListener("DOMContentLoaded",(function e(){n.removeEventListener("DOMContentLoaded",e,!1),o();})):n.attachEvent&&n.attachEvent("onreadystatechange",(function e(){"complete"===n.readyState&&(n.detachEvent("onreadystatechange",e),o());})),addEventListener$1(t,"load",o,!1)):o(),e}

    /*!
     * Browser tracker for Snowplow v3.21.0 (http://bit.ly/sp-js)
     * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
     * Licensed under BSD-3-Clause
     */
    function enableActivityTrackingCallback(e,t){dispatchToTrackers(t,(function(t){t.enableActivityTrackingCallback(e);}));}function trackPageView(e,t){dispatchToTrackers(t,(function(t){t.trackPageView(e);}));}function trackSelfDescribingEvent(e,t){dispatchToTrackers(t,(function(t){t.core.track(buildSelfDescribingEvent({event:e.event}),e.context,e.timestamp);}));}var state="undefined"!=typeof window?createSharedState():void 0;function newTracker(e,t,c){return void 0===c&&(c={}),state?addTracker(e,e,"js-".concat(version),t,state,c):void 0}

    var eventemitter3 = {exports: {}};

    !function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1;}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new o(r,s||e,i),f=n?n+t:t;return e._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t];}function c(){this._events=new r,this._eventsCount=0;}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return [];if(r.fn)return [r.fn];for(var o=0,s=r.length,i=new Array(s);o<s;o++)i[o]=r[o].fn;return i},c.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,o,s,i){var c=n?n+e:e;if(!this._events[c])return !1;var f,a,u=this._events[c],l=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,s),!0;case 6:return u.fn.call(u.context,t,r,o,s,i),!0}for(a=1,f=new Array(l-1);a<l;a++)f[a-1]=arguments[a];u.fn.apply(u.context,f);}else {var p,v=u.length;for(a=0;a<v;a++)switch(u[a].once&&this.removeListener(e,u[a].fn,void 0,!0),l){case 1:u[a].fn.call(u[a].context);break;case 2:u[a].fn.call(u[a].context,t);break;case 3:u[a].fn.call(u[a].context,t,r);break;case 4:u[a].fn.call(u[a].context,t,r,o);break;default:if(!f)for(p=1,f=new Array(l-1);p<l;p++)f[p-1]=arguments[p];u[a].fn.apply(u[a].context,f);}}return !0},c.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,r,o){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var c=this._events[s];if(c.fn)c.fn!==t||o&&!c.once||r&&c.context!==r||i(this,s);else {for(var f=0,a=[],u=c.length;f<u;f++)(c[f].fn!==t||o&&!c[f].once||r&&c[f].context!==r)&&a.push(c[f]);a.length?this._events[s]=1===a.length?a[0]:a:i(this,s);}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c;}(eventemitter3);var EventEmitter = eventemitter3.exports;

    var ATTRIBUTE_ID_ACTIVE_VIEW="id-av";var ActiveView=function(){function e(e,t,i){void 0===e&&(e=.5),void 0===t&&(t=1e3);var r=this;this.events=new EventEmitter,this.viewTime=t,this.inner=new IntersectionObserver((function(e,t){e.forEach((function(e){var t=e.target;if(e.isIntersecting)t.setAttribute(ATTRIBUTE_ID_ACTIVE_VIEW,setTimeout((function(){r.trackVisibility(t);}),r.viewTime).toString());else {var i=t.getAttribute(ATTRIBUTE_ID_ACTIVE_VIEW);if(null===i)return;clearTimeout(parseInt(i,10)),t.removeAttribute(ATTRIBUTE_ID_ACTIVE_VIEW);}}));}),{threshold:e,root:i});}return e.prototype.addEventListener=function(e){this.events.addListener("observe",e);},e.prototype.trackVisibility=function(e){this.inner.unobserve(e),e.removeAttribute(ATTRIBUTE_ID_ACTIVE_VIEW),this.events.emit("observe",e);},e.prototype.observe=function(e){this.inner.observe(e);},e.prototype.unobserve=function(e){this.inner.unobserve(e);},e}();

    function onlineContext(e){return {schema:"iglu:de.id.bi.audience/online_story/jsonschema/1-0-0",data:{oid:e}}}

    function pageViewContext(e){return {schema:"iglu:de.id.bi.audience/page_view/jsonschema/1-0-0",data:{pvid:e.toString()}}}

    function shelfContext(e){var s=e.shn;return {schema:"iglu:de.id.bi.audience/shelf/jsonschema/1-0-0",data:{sht:e.sht,shn:s,shtg:e.shtg,properties:e.p}}}

    function userContext(i,t){return {schema:"iglu:de.id.bi.audience/user/jsonschema/1-0-0",data:__assign({utid:i.toString()},t&&{upid:t})}}

    function userInteractionContext(e,n){return {schema:"iglu:de.id.bi.audience/user_interaction/jsonschema/1-0-0",data:{uiaid:"".concat(e,"-").concat(n)}}}

    function pagePingContext(e,n){return {schema:"iglu:de.id.bi.audience/page_ping/jsonschema/1-0-0",data:{ppid:"".concat(e,"-").concat(n)}}}

    function elementActiveViewEvent(e,t){return {schema:"iglu:de.id.bi.audience/element_active_view/jsonschema/1-0-0",data:{elementId:e,elementClasses:t}}}

    function elementClickEvent(e,n){return {schema:"iglu:de.id.bi.audience/element_click/jsonschema/1-0-0",data:{elementId:e,elementClasses:n}}}

    /*! js-cookie v3.0.5 | MIT */
    function assign(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r];}return e}var defaultConverter={read:function(e){return '"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function init(e,t){function n(n,r,i){if("undefined"!=typeof document){"number"==typeof(i=assign({},t,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var a in i)i[a]&&(o+="; "+a,!0!==i[a]&&(o+="="+i[a].split(";")[0]));return document.cookie=n+"="+e.write(r,n)+o}}return Object.create({set:n,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),a=o.slice(1).join("=");try{var c=decodeURIComponent(o[0]);if(r[c]=e.read(a,c),t===c)break}catch(e){}}return t?r[t]:r}},remove:function(e,t){n(e,"",assign({},t,{expires:-1}));},withAttributes:function(e){return init(this.converter,assign({},this.attributes,e))},withConverter:function(e){return init(assign({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var api=init(defaultConverter,{path:"/"});

    let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}

    var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;

    function validate(t){return "string"==typeof t&&REGEX.test(t)}

    const byteToHex=[];for(let e=0;e<256;++e)byteToHex.push((e+256).toString(16).slice(1));function unsafeStringify(e,t=0){return byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]}

    function parse(e){if(!validate(e))throw TypeError("Invalid UUID");let r;const t=new Uint8Array(16);return t[0]=(r=parseInt(e.slice(0,8),16))>>>24,t[1]=r>>>16&255,t[2]=r>>>8&255,t[3]=255&r,t[4]=(r=parseInt(e.slice(9,13),16))>>>8,t[5]=255&r,t[6]=(r=parseInt(e.slice(14,18),16))>>>8,t[7]=255&r,t[8]=(r=parseInt(e.slice(19,23),16))>>>8,t[9]=255&r,t[10]=(r=parseInt(e.slice(24,36),16))/1099511627776&255,t[11]=r/4294967296&255,t[12]=r>>>24&255,t[13]=r>>>16&255,t[14]=r>>>8&255,t[15]=255&r,t}

    function stringToBytes(t){t=unescape(encodeURIComponent(t));const e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}const DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";const URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function v35(t,e,r){function n(t,n,o,s){var i;if("string"==typeof t&&(t=stringToBytes(t)),"string"==typeof n&&(n=parse(n)),16!==(null===(i=n)||void 0===i?void 0:i.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+t.length);if(a.set(n),a.set(t,n.length),a=r(a),a[6]=15&a[6]|e,a[8]=63&a[8]|128,o){s=s||0;for(let t=0;t<16;++t)o[s+t]=a[t];return o}return unsafeStringify(a)}try{n.name=t;}catch(t){}return n.DNS=DNS,n.URL=URL,n}

    function md5(d){if("string"==typeof d){const m=unescape(encodeURIComponent(d));d=new Uint8Array(m.length);for(let t=0;t<m.length;++t)d[t]=m.charCodeAt(t);}return md5ToHexEncodedArray(wordsToMd5(bytesToWords(d),8*d.length))}function md5ToHexEncodedArray(d){const m=[],t=32*d.length,n="0123456789abcdef";for(let f=0;f<t;f+=8){const t=d[f>>5]>>>f%32&255,e=parseInt(n.charAt(t>>>4&15)+n.charAt(15&t),16);m.push(e);}return m}function getOutputLength(d){return 14+(d+64>>>9<<4)+1}function wordsToMd5(d,m){d[m>>5]|=128<<m%32,d[getOutputLength(m)-1]=m;let t=1732584193,n=-271733879,f=-1732584194,e=271733878;for(let m=0;m<d.length;m+=16){const i=t,g=n,h=f,r=e;t=md5ff(t,n,f,e,d[m],7,-680876936),e=md5ff(e,t,n,f,d[m+1],12,-389564586),f=md5ff(f,e,t,n,d[m+2],17,606105819),n=md5ff(n,f,e,t,d[m+3],22,-1044525330),t=md5ff(t,n,f,e,d[m+4],7,-176418897),e=md5ff(e,t,n,f,d[m+5],12,1200080426),f=md5ff(f,e,t,n,d[m+6],17,-1473231341),n=md5ff(n,f,e,t,d[m+7],22,-45705983),t=md5ff(t,n,f,e,d[m+8],7,1770035416),e=md5ff(e,t,n,f,d[m+9],12,-1958414417),f=md5ff(f,e,t,n,d[m+10],17,-42063),n=md5ff(n,f,e,t,d[m+11],22,-1990404162),t=md5ff(t,n,f,e,d[m+12],7,1804603682),e=md5ff(e,t,n,f,d[m+13],12,-40341101),f=md5ff(f,e,t,n,d[m+14],17,-1502002290),n=md5ff(n,f,e,t,d[m+15],22,1236535329),t=md5gg(t,n,f,e,d[m+1],5,-165796510),e=md5gg(e,t,n,f,d[m+6],9,-1069501632),f=md5gg(f,e,t,n,d[m+11],14,643717713),n=md5gg(n,f,e,t,d[m],20,-373897302),t=md5gg(t,n,f,e,d[m+5],5,-701558691),e=md5gg(e,t,n,f,d[m+10],9,38016083),f=md5gg(f,e,t,n,d[m+15],14,-660478335),n=md5gg(n,f,e,t,d[m+4],20,-405537848),t=md5gg(t,n,f,e,d[m+9],5,568446438),e=md5gg(e,t,n,f,d[m+14],9,-1019803690),f=md5gg(f,e,t,n,d[m+3],14,-187363961),n=md5gg(n,f,e,t,d[m+8],20,1163531501),t=md5gg(t,n,f,e,d[m+13],5,-1444681467),e=md5gg(e,t,n,f,d[m+2],9,-51403784),f=md5gg(f,e,t,n,d[m+7],14,1735328473),n=md5gg(n,f,e,t,d[m+12],20,-1926607734),t=md5hh(t,n,f,e,d[m+5],4,-378558),e=md5hh(e,t,n,f,d[m+8],11,-2022574463),f=md5hh(f,e,t,n,d[m+11],16,1839030562),n=md5hh(n,f,e,t,d[m+14],23,-35309556),t=md5hh(t,n,f,e,d[m+1],4,-1530992060),e=md5hh(e,t,n,f,d[m+4],11,1272893353),f=md5hh(f,e,t,n,d[m+7],16,-155497632),n=md5hh(n,f,e,t,d[m+10],23,-1094730640),t=md5hh(t,n,f,e,d[m+13],4,681279174),e=md5hh(e,t,n,f,d[m],11,-358537222),f=md5hh(f,e,t,n,d[m+3],16,-722521979),n=md5hh(n,f,e,t,d[m+6],23,76029189),t=md5hh(t,n,f,e,d[m+9],4,-640364487),e=md5hh(e,t,n,f,d[m+12],11,-421815835),f=md5hh(f,e,t,n,d[m+15],16,530742520),n=md5hh(n,f,e,t,d[m+2],23,-995338651),t=md5ii(t,n,f,e,d[m],6,-198630844),e=md5ii(e,t,n,f,d[m+7],10,1126891415),f=md5ii(f,e,t,n,d[m+14],15,-1416354905),n=md5ii(n,f,e,t,d[m+5],21,-57434055),t=md5ii(t,n,f,e,d[m+12],6,1700485571),e=md5ii(e,t,n,f,d[m+3],10,-1894986606),f=md5ii(f,e,t,n,d[m+10],15,-1051523),n=md5ii(n,f,e,t,d[m+1],21,-2054922799),t=md5ii(t,n,f,e,d[m+8],6,1873313359),e=md5ii(e,t,n,f,d[m+15],10,-30611744),f=md5ii(f,e,t,n,d[m+6],15,-1560198380),n=md5ii(n,f,e,t,d[m+13],21,1309151649),t=md5ii(t,n,f,e,d[m+4],6,-145523070),e=md5ii(e,t,n,f,d[m+11],10,-1120210379),f=md5ii(f,e,t,n,d[m+2],15,718787259),n=md5ii(n,f,e,t,d[m+9],21,-343485551),t=safeAdd(t,i),n=safeAdd(n,g),f=safeAdd(f,h),e=safeAdd(e,r);}return [t,n,f,e]}function bytesToWords(d){if(0===d.length)return [];const m=8*d.length,t=new Uint32Array(getOutputLength(m));for(let n=0;n<m;n+=8)t[n>>5]|=(255&d[n/8])<<n%32;return t}function safeAdd(d,m){const t=(65535&d)+(65535&m);return (d>>16)+(m>>16)+(t>>16)<<16|65535&t}function bitRotateLeft(d,m){return d<<m|d>>>32-m}function md5cmn(d,m,t,n,f,e){return safeAdd(bitRotateLeft(safeAdd(safeAdd(m,d),safeAdd(n,e)),f),t)}function md5ff(d,m,t,n,f,e,i){return md5cmn(m&t|~m&n,d,m,f,e,i)}function md5gg(d,m,t,n,f,e,i){return md5cmn(m&n|t&~n,d,m,f,e,i)}function md5hh(d,m,t,n,f,e,i){return md5cmn(m^t^n,d,m,f,e,i)}function md5ii(d,m,t,n,f,e,i){return md5cmn(t^(m|~n),d,m,f,e,i)}

    v35("v3",48,md5);

    const randomUUID="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var native = {randomUUID:randomUUID};

    function v4(r,n,t){if(native.randomUUID&&!n&&!r)return native.randomUUID();const i=(r=r||{}).random||(r.rng||rng)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){t=t||0;for(let r=0;r<16;++r)n[t+r]=i[r];return n}return unsafeStringify(i)}

    function f(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function ROTL(t,e){return t<<e|t>>>32-e}function sha1(t){const e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const n=t.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let e=0;e<o;++e){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=t[64*e+4*n]<<24|t[64*e+4*n+1]<<16|t[64*e+4*n+2]<<8|t[64*e+4*n+3];a[e]=r;}a[o-1][14]=8*(t.length-1)/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const n=new Uint32Array(80);for(let e=0;e<16;++e)n[e]=a[t][e];for(let t=16;t<80;++t)n[t]=ROTL(n[t-3]^n[t-8]^n[t-14]^n[t-16],1);let o=r[0],c=r[1],l=r[2],s=r[3],h=r[4];for(let t=0;t<80;++t){const r=Math.floor(t/20),a=ROTL(o,5)+f(r,c,l,s)+h+e[r]+n[t]>>>0;h=s,s=l,l=ROTL(c,30)>>>0,c=o,o=a;}r[0]=r[0]+o>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+l>>>0,r[3]=r[3]+s>>>0,r[4]=r[4]+h>>>0;}return [r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}

    v35("v5",80,sha1);

    var UserTransientId=function(){function t(t){var n=this;this.toString=function(){return n.utid},this.utid=t||v4();}return t.generate=function(){return new t(v4())},t}();

    var PageViewId=function(){function t(t){var n=this;this.toString=function(){return n.pvid},this.pvid=t;}return t.generate=function(n){return new t(n?"".concat(n,"-").concat(Math.floor(Date.now()/1e3),"-").concat(String(1).padStart(10,"0")):"".concat(v4(),"-").concat(Math.floor(Date.now()/1e3),"-").concat(String(1).padStart(10,"0")))},t.fromCookie=function(n){var r=api.get(n);if(r)return new t(r)},t.prototype.getUserTransientId=function(){return new UserTransientId(this.pvid.substring(0,36))},t}();

    var UserInteraction=function(){function t(t){var n=this;this.toString=function(){return String(n.state).padStart(4,"0")},this.state=t||1;}return t.prototype.increment=function(){this.state+=1;},t}();

    var PagePing=function(){function t(t){var n=this;this.toString=function(){return String(n.state).padStart(4,"0")},this.state=t||1;}return t.prototype.increment=function(){this.state+=1;},t}();

    function readDataLayer(){var i,e,d=void 0,a=void 0,n=void 0,t=void 0,p=void 0;if(window.dataLayer&&window.dataLayer instanceof Array)try{for(var r=__values(window.dataLayer),l=r.next();!l.done;l=r.next()){var o=l.value;"de.ippen-digital.story.onlineId"in o&&o["de.ippen-digital.story.onlineId"]&&(d=o["de.ippen-digital.story.onlineId"]),"de.ippen-digital.page.pageViewId"in o&&o["de.ippen-digital.page.pageViewId"]&&(a=o["de.ippen-digital.page.pageViewId"]),"de.ippen-digital.user.transientId"in o&&o["de.ippen-digital.user.transientId"]&&(n=o["de.ippen-digital.user.transientId"]),"de.ippen-digital.cms.cid"in o&&o["de.ippen-digital.cms.cid"]&&(t=o["de.ippen-digital.cms.cid"]),"de.ippen-digital.useCase"in o&&o["de.ippen-digital.useCase"]&&(p=o["de.ippen-digital.useCase"]);}}catch(e){i={error:e};}finally{try{l&&!l.done&&(e=r.return)&&e.call(r);}finally{if(i)throw i.error}}return {oid:d,pvid:a,utid:n,cid:t,useCase:p}}

    function trackDevEvent(e,t,a,n,i,o,s,d){fetch("".concat(e,"/bi/dev"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({metadata:{key:d},origin:{system:t,useCase:a},cmsClientId:s,pageViewId:n,payload:o,userAgent:i})});}

    function cmsClientContext(e){return {schema:"iglu:de.id.bi.audience/cms_client/jsonschema/1-0-0",data:{cid:e}}}

    function decorateLinks(e,n){for(var t=0;t<document.links.length;t++){var r=document.links[t];!r.spDecorationEnabled&&n(r)&&(addEventListener(r,"click",(function(n){return linkDecorationHandler(n,e)}),!0),addEventListener(r,"mousedown",(function(n){return linkDecorationHandler(n,e)}),!0),r.spDecorationEnabled=!0);}}function addEventListener(e,n,t,r){return e.addEventListener?(e.addEventListener(n,t,r),!0):e.attachEvent?e.attachEvent("on"+n,t):void(e["on"+n]=t)}function linkDecorationHandler(e,n){var t=(new Date).getTime(),r=e.currentTarget;(null==r?void 0:r.href)&&(r.href=decorateQuerystring(r.href,"_sp",n+"."+t));}function decorateQuerystring(e,n,t){var r=n+"="+t,o=e.split("#"),i=o[0].split("?"),a=i.shift(),c=i.join("?");if(c){for(var l=!0,d=c.split("&"),u=0;u<d.length;u++)if(d[u].substr(0,n.length+1)===n+"="){l=!1,d[u]=r,c=d.join("&");break}l&&(c=r+"&"+c);}else c=r;return o[0]=a+"?"+c,o.join("#")}function fromQuerystring(e,n){var t=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(n);return t?decodeURIComponent(t[1].replace(/\+/g," ")):null}function getCookie(e){var n,t="; ".concat(document.cookie).split("; ".concat(e,"="));if(2===t.length)return null===(n=null==t?void 0:t.pop())||void 0===n?void 0:n.split(";").shift()}

    var ALLOWED_ORIGIN_SYSTEMS=["BI_AUDIENCE_HUB","PNA","WEST","MOBILE_APP","YARP2","NEWSLETTER","FR_PLUS_APP","SUBSCRIPTION","CIAM_SSO","E_PAPER","SERIENJUNKIES_WIKI","USER_ID"];var CID_REQUIRED=["MOBILE_APP","CIAM_SSO"];

    function useCaseContext(e){return {schema:"iglu:de.id.bi.audience/use_case/jsonschema/1-0-0",data:{useCase:e}}}

    var DEFAULT_ID="bi-audience-hub";var Tracker=function(){function e(e,t,i,n,r,s,o,a,d,c,l,h,p){var u=this;this.trackUserActivity=function(){enableActivityTrackingCallback({minimumVisitLength:10,heartbeatDelay:10,callback:function(e){u.sendIndependentPagePing();}});},this.pageViewId=e,this.userTransientId=t,this.userInteraction=i,this.pagePing=n,this.activeView=r,this.trackerId=a,this.endpoint=o,this.originSystem=s,p&&(this.persistentId=p),h&&(this.useCase=h),c&&(this.cid=c),l&&(this.onlineId=l),this.activeView.addEventListener((function(e){var t=e.id,i=getElementClasses(e),n=getElementShelf("data-id-av",e);u.sendIndependentActiveView({elementId:t,elementClasses:i,shelfData:n});})),this.setIdCookie(),this.tracker=newTracker(a,o,{postPath:"/bi/doop/",appId:s,discoverRootDomain:!0,cookieSameSite:"Lax",plugins:d,eventMethod:"beacon"});}return e.prototype.getUserTransientId=function(){return this.userTransientId},e.prototype.decoratePageLinks=function(e,t,i,n){if(decorateLinks(e,t),i){var r=document.getElementById(i),s=n||{attributes:!0,childList:!0,subtree:!0},o=new MutationObserver((function(i){var n,r;try{for(var s=__values(i),o=s.next();!o.done;o=s.next()){o.value;decorateLinks(e,t);}}catch(e){n={error:e};}finally{try{o&&!o.done&&(r=s.return)&&r.call(s);}finally{if(n)throw n.error}}}));r&&o.observe(r,s);}},e.prototype.setIdCookie=function(e){var t=new Date;t.setTime(t.getTime()+864e6);var i="expires="+t.toUTCString();document.cookie="_id="+(e||this.userTransientId.toString())+";"+i+";path=/";},e.prototype.sendPageView=function(){var e=[pageViewContext(this.pageViewId),userContext(this.userTransientId,this.persistentId)];this.useCase&&e.push(useCaseContext(this.useCase)),this.onlineId&&e.push(onlineContext(this.onlineId)),(this.cid||0===this.cid)&&e.push(cmsClientContext(this.cid)),trackPageView({context:e},[this.trackerId]);},e.prototype.trackElementClick=function(e){var t=this,i=e.htmlElement,n=e.shelfData;i.addEventListener("click",(function(){var e=i.id,r=getElementClasses(i);t.sendIndependentElementClick({elementId:e,elementClasses:r,shelfData:n});}),{once:!0});},e.prototype.sendIndependentElementClick=function(e){var t=e.elementId,i=e.elementClasses,n=e.shelfData;if("invalid"!==n){var r=[pageViewContext(this.pageViewId),userContext(this.userTransientId,this.persistentId),shelfContext(n),userInteractionContext(this.pageViewId,this.userInteraction)];this.useCase&&r.push(useCaseContext(this.useCase)),this.onlineId&&r.push(onlineContext(this.onlineId)),(this.cid||0===this.cid)&&r.push(cmsClientContext(this.cid));var s=elementClickEvent(t,i);this.userInteraction.increment(),trackSelfDescribingEvent({context:r,event:s},[this.trackerId]);}},e.prototype.trackElementActiveView=function(e){this.activeView.observe(e);},e.prototype.sendIndependentActiveView=function(e){var t=e.elementId,i=e.elementClasses,n=e.shelfData;if("invalid"!==n){var r=[pageViewContext(this.pageViewId),userContext(this.userTransientId,this.persistentId),shelfContext(n),userInteractionContext(this.pageViewId,this.userInteraction)];this.useCase&&r.push(useCaseContext(this.useCase)),this.onlineId&&r.push(onlineContext(this.onlineId)),(this.cid||0===this.cid)&&r.push(cmsClientContext(this.cid));var s=elementActiveViewEvent(t,i);this.userInteraction.increment(),trackSelfDescribingEvent({context:r,event:s},[this.trackerId]);}},e.prototype.sendIndependentPagePing=function(){var e=[pageViewContext(this.pageViewId),userContext(this.userTransientId,this.persistentId),pagePingContext(this.pageViewId,this.pagePing)];this.useCase&&e.push(useCaseContext(this.useCase)),(this.cid||0===this.cid)&&e.push(cmsClientContext(this.cid));var t=pagePingContext(this.pageViewId,this.pagePing);this.pagePing.increment(),trackSelfDescribingEvent({context:e,event:t},[this.trackerId]);},e.prototype.sendDevEvent=function(e,t,i){var n=navigator.userAgent;trackDevEvent(this.endpoint,this.originSystem,e,this.pageViewId.toString(),n,t,this.cid||0,i);},e}();function CreateTracker(e){if(!e.originSystem)throw new Error("Invalid originSystem");if(!e.endpoint)throw new Error("Invalid endpoint");var t=e.originSystem;if(!ALLOWED_ORIGIN_SYSTEMS.includes(t))throw new Error("The origin system ".concat(t," is not allowed. Note that the origin system is case sensitive"));var i,n,r,s,o=readDataLayer(),a=e.endpoint,d=function(e){if(e&&"string"==typeof e&&!(e.length>128)&&e===e.toLowerCase()&&/^[a-zßöäü0-9_]+$/.test(e))return e}(o.useCase),c=e.id?e.id:DEFAULT_ID,l=e.plugins?e.plugins:[],h=function(e){if(e&&"string"==typeof e&&/^[a-f0-9]{64}$/.test(e))return e}(getCookie("id_userid_pid")),p=new UserInteraction(e.firstUserInteraction),u=new PagePing(e.firstPagePing),g=new ActiveView(e.activeViewThreshold,e.activeViewTime,e.activeViewRoot),m=fromQuerystring("_sp",window.location.href);if(m){var I=m.split(".")[0];i=new UserTransientId(I);}else if(e.userTransientId)i=new UserTransientId(e.userTransientId);else if(o.utid)i=new UserTransientId(o.utid);else if(getCookie("_id"))i=new UserTransientId(getCookie("_id"));else {if(!0!==e.generatePageViewIdIfMissing)throw new Error("UserTransientId not found");i=UserTransientId.generate();}if(m)n=PageViewId.generate(i.toString());else if(e.pageViewId)n=new PageViewId(e.pageViewId);else if(o.pvid)n=new PageViewId(o.pvid);else {if(!0!==e.generatePageViewIdIfMissing)throw new Error("PageViewId not found");n=PageViewId.generate(i.toString());}if(e.cid)r=e.cid;else if(o.cid)r=o.cid;else {if(CID_REQUIRED.includes(t))throw new Error("The Client ID (CID) must be included!");console.warn("Client ID (CID) not found in Data Layer or settings"),r=void 0;}if(r&&"number"!=typeof r)throw new Error("The Client ID (CID) must be a number, but it is ".concat(typeof r));if(e.onlineId?s=e.onlineId:o.oid?s=o.oid:(console.warn("Online ID (OID) not found in Data Layer or settings"),s=void 0),s&&"number"!=typeof s)throw new Error("The Online ID (OID) must be a number, but it is ".concat(typeof s));return new Tracker(n,i,p,u,g,t,a,c,l,r,s,d,h)}

    var CROSS_DOMAIN_ALLOWED_DOMAINS=["epaper.hna.de","devhnaepaper.de"];

    !function(){var e=document.currentScript;if(e){var t=e.getAttribute("data-id-origin-system"),i=e.getAttribute("data-id-address"),r=e.getAttribute("data-id-features"),n=getFeatureFlags(r);if(t&&i){var a=CreateTracker({originSystem:t,endpoint:i,generatePageViewIdIfMissing:n.generate_page_view_id});if((n.enable_activity_tracking||window.location.href.includes("webnachrichten.de")||window.location.href.includes("webnachrichten.idstg.de")||window.location.href.includes("buzzfeed.at")||window.location.href.includes("merkur.de"))&&a.trackUserActivity(),n.track_pageview&&a.sendPageView(),n.enable_element_click_tracking){var d=new TrackedElements("[data-id-ec]","data-id-em",(function(e){var t=getElementShelf("data-id-ec",e);a.trackElementClick({htmlElement:e,shelfData:t});}));d.refresh(),document.addEventListener("id-refresh",(function(){return d.refresh()}));}if(n.enable_active_view_tracking){var c=new TrackedElements("[data-id-av]","data-id-am",(function(e){a.trackElementActiveView(e);}));c.refresh(),document.addEventListener("id-refresh",(function(){return c.refresh()}));}if(n.enable_cross_domain_tracking){var o=a.getUserTransientId().toString();a.decoratePageLinks(o,(function(e){return CROSS_DOMAIN_ALLOWED_DOMAINS.some((function(t){return e.href.includes(t)}))}),"cxo-widget-host",{attributes:!0,childList:!0,subtree:!0});}}}}();

})();
//# sourceMappingURL=current-tracker.js.map
