From 36f4eec47d235e2494f7d2df10cee05edd5575f6 Mon Sep 17 00:00:00 2001 From: Romeo Rosete <110788242+bombastictranz@users.noreply.github.com> Date: Fri, 10 May 2024 08:02:58 -0400 Subject: [PATCH] eaf9ce4ae4903.js.download Stock control supervisors --- eaf9ce4ae4903.js.download | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 eaf9ce4ae4903.js.download diff --git a/eaf9ce4ae4903.js.download b/eaf9ce4ae4903.js.download new file mode 100644 index 0000000..6350c4e --- /dev/null +++ b/eaf9ce4ae4903.js.download @@ -0,0 +1,5 @@ +var CS_CONF={"projectId":5540,"status":1,"hostnames":["slack.com","slackdemo.com"],"crossDomainTracking":1,"crossDomainSingleIframeTracking":1,"consentRequired":0,"allowSubdomains":1,"visitorCookieTimeout":34164000000,"sampleRate":100,"replayRecordingRate":25,"validationRate":10,"lastTrackingDraw":null,"trackerDomain":"c.contentsquare.net","recordingDomain":"r.contentsquare.net","useMalkaPipeline":1,"ed":"l.contentsquare.net/log/web","eMerchandisingEnabled":0,"mouseMoveHeatmapEnabled":1,"autoInsightsEnabled":1,"jsErrorsEnabled":1,"customErrorsEnabled":0,"jsCustomErrorsEnabled":0,"apiErrorsEnabled":1,"customHashIdEnabled":0,"recordingEncryptionEnabled":0,"recordingEncryptionPublicKey":null,"recordingEncryptionPublicKeyId":0,"secureCookiesEnabled":0,"triggerSessionReplayEnabled":0,"triggerSessionReplayRegex":null,"dynamicIdRegex":"(^swiper-wrapper-[\\w-]+)","whitelistedAttributes":[],"replayRecordingUnmaskedUrlRegex":"","replayRecordingUnmaskedUrlRegexRules":[],"replayRecordingMaskedUrlRegexRules":[],"replayRecordingMaskedUrlRegex":"","anonymisationMethod":null,"tagDeploymentMode":"CONTENTSQUARE","experimental":null,"iframesTracking":1,"textVisibilityEnabled":0,"cookielessTrackingEnabled":0,"malkaUrlEnabled":0,"malkaEtrEnabled":0,"pathComputationRules":{"reliableSelectors":[],"uniqueAttributes":[],"uniqueCssSelectors":[]},"asyncSerializerEnabled":1,"pendingInactivityTimeout":5000,"accessibilityEnabled":0,"uxaDomain":"app.contentsquare.com","webviewsTrackingEnabled":0,"useStaticResourceManager":1,"performanceTimingOptions":{"withResource":false,"withNavigation":false},"replayConsentRequiredForSession":0,"apiErrors":{"validCustomHeaders":[],"plainCustomHeaders":[],"validUrls":[],"configurableApiErrorRules":[],"collectStandardHeaders":0,"collectQueryParam":0,"collectRequestBody":0,"collectResponseBody":0,"collectionRules":[]},"displayAdOptions":null,"taskSchedulerOptions":{"enabled":1},"malkaQuotaServiceDomain":"q-aus1.contentsquare.net","malkaRecordingDomain":"k-aus1.contentsquare.net","staticResourceManagerDomain":"srm.bf.contentsquare.net"}; +var CS_INTEGRATIONS_CONF = {"optimizely":{},"demandbase":{"settings":["enableAccessType","enableAnnualSales","enableAudience","enableAudienceSegment","enableB2B","enableB2C","enableCity","enableCompanyName","enableCountryName","enableEmployeeCount","enableEmployeeRange","enableFortune1000","enableForbes2000","enableIndustry","enableInformationLevel","enableMarketingAlias","enableNAICS","enableSIC","enableRevenueRange","enableSubIndustry","enableState","enableStockTicker","enableTraffic","enableWatchListAccountStatus","enableWatchListAccountType","enableWebsite"]}}; +/* integration-optimizely 2.6.3 */ +!function(e){var n={};function t(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)t.d(i,a,function(n){return e[n]}.bind(null,a));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e){e.exports=JSON.parse('{"name":"@contentsquare/integration-optimizely-contentsquare","version":"2.6.3","scripts":{"build:snippet":"webpack"}}')},function(e,n,t){"use strict";function i(e,n){try{e()}catch(e){window._uxa=window._uxa||[],_uxa.push(["logSnippetError",n,e.message])}}function a(e,n,t){if((t=t||window)&&n&&e){var i=!1,a=t[e];a?n():Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i||(i=!0,n())}})}}t.r(n);var r=t(0),o=r.name,u=r.version,p=function(e){var n,t,a,r;if(i((function(){var i=e.name;a=e.version;var o=i.replace("@contentsquare/integration-","");n=o+"-"+a;var u="-contentsquare";r=new RegExp(u+"$").test(o),t=o.replace(/-contentsquare([^-contentsquare]*)$/,"$1"),r||(u="-cap",r=new RegExp(u+"$").test(o),t=o.replace(/-cap([^-cap]*)$/,"$1"))}),"Shared-Function-readPackageJSON"),r)return{snippetBuildName:n,parameterName:t,snippetVersion:a}}(r);p&&(p.parameterName,o=p.snippetBuildName,u=p.snippetVersion),i((function(){window._uxa=window._uxa||[],CS_CONF.integrations=CS_CONF.integrations||[],CS_CONF.integrations.push("Optimizely - v"+u);var e=!1;function n(n){var t=[];!function(e,n,t){t=t||window;var i=e.split(".");if(1==i.length)a(e,n,t);else{var r=t,o=0;const e=function(){r=o>0?r[i[o-1]]:window,++o>=i.length?a(i[o-1],n,r):a(i[o-1],e,r)};e()}}("optimizely",(function(){setTimeout((function(){i((function(){function n(){i((function(){var e,n,i=optimizely.get&&optimizely.get("state");if(i&&i.getCampaignStates&&"function"==typeof i.getCampaignStates&&"object"==typeof i.getCampaignStates())for(var a=i.getCampaignStates({isActive:!0}),r=Object.keys(a),o=0;o-1&&(t=!0),n.indexOf("enableAnnualSales")>-1&&(i=!0),n.indexOf("enableAudience")>-1&&(c=!0),n.indexOf("enableAudienceSegment")>-1&&(f=!0),n.indexOf("enableB2B")>-1&&(p=!0),n.indexOf("enableB2C")>-1&&(b=!0),n.indexOf("enableCity")>-1&&(d=!0),n.indexOf("enableCompanyName")>-1&&(_=!0),n.indexOf("enableCountryName")>-1&&(y=!0),n.indexOf("enableEmployeeCount")>-1&&(m=!0),n.indexOf("enableEmployeeRange")>-1&&(g=!0),n.indexOf("enableFortune1000")>-1&&(O=!0),n.indexOf("enableForbes2000")>-1&&(x=!0),n.indexOf("enableIndustry")>-1&&(S=!0),n.indexOf("enableInformationLevel")>-1&&(v=!0),n.indexOf("enableMarketingAlias")>-1&&(w=!0),n.indexOf("enableNAICS")>-1&&(N=!0),n.indexOf("enableSIC")>-1&&(C=!0),n.indexOf("enableRevenueRange")>-1&&(A=!0),n.indexOf("enableSubIndustry")>-1&&(I=!0),n.indexOf("enableState")>-1&&(h=!0),n.indexOf("enableStockTicker")>-1&&(T=!0),n.indexOf("enableTraffic")>-1&&(k=!0),n.indexOf("enableWatchListAccountStatus")>-1&&(F=!0),n.indexOf("enableWatchListAccountType")>-1&&(P=!0),n.indexOf("enableWebsite")>-1&&(R=!0));var j=r(u,"customObjectName");j=j?j.trim():"Demandbase.IpApi.CompanyProfile";function B(n){!function(e,n,t){t=t||window;var a=e.split(".");if(1==a.length)o(e,n,t);else{var i=t,r=0;const e=function(){i=r>0?i[a[r-1]]:window,++r>=a.length?o(a[r-1],n,i):o(a[r-1],e,i)};e()}}(j,(function(){setTimeout((function(){a((function(){var n=function(e,n){for(var t=(n=(n=n.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),a=0,i=t.length;a{"use strict";var t={d:(s,i)=>{for(var e in i)t.o(i,e)&&!t.o(s,e)&&Object.defineProperty(s,e,{enumerable:!0,get:i[e]})},o:(t,s)=>Object.prototype.hasOwnProperty.call(t,s),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},s={};t.r(s),t.d(s,{getRequestParameters:()=>_o});const i="cs-native-frame",e={navigatorProperties:[{propertyName:"sendBeacon",binding:navigator}],nodeProperties:["childNodes","parentNode","nextSibling","firstChild"],elementProperties:["shadowRoot"],elementPropertiesValues:["matches","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector"],eventProperties:["target"],imageProperties:["src"],constructors:{Date:"csDate",JSON:"csJSON",Array:"csArray",String:"csString",URL:"csURL",MutationObserver:"csMutationObserver",screen:"csScreen"}};function n(t,s,i){const e=function(t,s){let i,e=t;for(;e&&!(i=Object.getOwnPropertyDescriptor(e,s));)e=Object.getPrototypeOf(e);return i}(t,s);if(!e)return function(){return this[s]};switch(i){case"get":return e.get;case"set":return e.set;case"value":return e.value}}function r(t){Object.keys(e.constructors).forEach((s=>{window[e.constructors[s]]=t[s]instanceof Function&&null==t[s].prototype?t[s].bind(window):t[s]})),function(t){window.csquerySelector={1:t.Element.prototype.querySelector,9:t.Document.prototype.querySelector,11:t.DocumentFragment.prototype.querySelector},window.csquerySelectorAll={1:t.Element.prototype.querySelectorAll,9:t.Document.prototype.querySelectorAll,11:t.DocumentFragment.prototype.querySelectorAll}}(t),("Prototype"in window||/^((?!chrome|android).)*safari/i.test(navigator.userAgent))&&(window.csMutationObserver=window.WebKitMutationObserver||window.MutationObserver),h("csNode",e.nodeProperties,t.Node.prototype,"get"),h("csElement",e.elementProperties,t.Element.prototype,"get"),h("csElement",e.elementPropertiesValues,t.Element.prototype,"value",!1),h("csHTMLImageElement",e.imageProperties,t.HTMLImageElement.prototype,"set"),h("csEvent",e.eventProperties,t.Event.prototype,"get"),h("csNavigator",e.navigatorProperties,t.navigator,"value")}function h(t,s,i,e,r=!0){s.forEach((s=>{const h="string"!=typeof s&&"binding"in s,o=h?s.propertyName:s;(r||o in i)&&(window[`${t+o}`]=n(i,o,e),h&&(window[`${t+o}`]=window[`${t+o}`].bind(s.binding)))}))}function o(t,s){window.CSProtectnativeFunctionsLogs=window.CSProtectnativeFunctionsLogs||{},window.CSProtectnativeFunctionsLogs[t]=s}if((()=>{var t;let s=0;function i(t){return"$$"+t+ ++s}i.for=i,window.csSymbol=null!==(t=window.Symbol)&&void 0!==t?t:i})(),!function(){try{const t=function(){const t=document.createElement("iframe");t.id=i,t.setAttribute("hidden",""),t.setAttribute("title","Intentionally blank"),t.setAttribute("sandbox","allow-same-origin");const s=document.createElement("cs-native-frame-holder");if(s.setAttribute("hidden",""),document.body.appendChild(s),Boolean(Element.prototype.attachShadow)){const i=s.attachShadow({mode:"closed"});return i.innerHTML=t.outerHTML,i.firstElementChild.contentWindow}return s.innerHTML=t.outerHTML,s.firstElementChild.contentWindow}();return!!t&&(window.CSPureWindow=t,r(window.CSPureWindow),!0)}catch(t){return o("Warning",`failed to copy references from pure iframe: ${t.message}`),!1}}())try{r(window)}catch(Ah){o("Critical",`failed to copy references from window: ${Ah.message}`)}function c(t){return a(csString.prototype.toLowerCase.call(t.localName))}function a(t){return csString.prototype.replace.call(t,/([#;&,.+*~':"!^$[\]()<=>|/%?@`{}\\ ])/g,"\\$1")}function u(t){return 1===t.nodeType}function l(t){return 3===t.nodeType}function d(t){return u(t)&&"source"===t.localName}function f(t){return null!==t&&u(t)&&"picture"===t.localName}function w(t){return u(t)&&"a"===t.localName}function p(t){return function(t){return u(t)&&"link"===t.localName}(t)&&-1!==csString.prototype.indexOf.call(t.rel,"stylesheet")}function m(t){return u(t)&&"img"===t.localName}function y(t){return u(t)&&"style"===t.localName}function A(t){return u(t)&&"input"===t.localName}function g(t){return u(t)&&"textarea"===t.localName}function E(t){return u(t)&&"script"===t.localName}function v(t){return u(t)&&"ownerSVGElement"in t}function _(t){return u(t)&&"select"===t.localName}function R(t){switch(t.nodeType){case 9:case 11:return!0;default:return!1}}function S(t){switch(t.nodeType){case 9:case 11:case 1:return!0;default:return!1}}function T(t){return 9===t.nodeType}function I(t){return R(t)&&"host"in t&&"mode"in t}function P(t){return u(t)&&!!csElementshadowRoot.apply(t)&&I(csElementshadowRoot.apply(t))}const b=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];const V="detached";function C(t){let s=t;const i=[s];for(;null!==csNodeparentNode.apply(s);)s=csNodeparentNode.apply(s),csArray.prototype.push.call(i,s);return N(s)&&csArray.prototype.push.call(i,V),{ancestors:i,selectionRoot:s}}function N(t){return G.isValidElement(t)}const k=window.csElementmatches||window.csElementmatchesSelector||window.csElementmozMatchesSelector||window.csElementmsMatchesSelector||window.csElementoMatchesSelector||window.csElementwebkitMatchesSelector,O=9;function $(t,s){return!!s&&csArray.prototype.some.call(s,(s=>k.call(t,s)))}const x=[/\d{4}/,/^ember\d+$/],L="@",M="data-cs-override-id",D="data-cs-dynamic-id";function U(t,s,i,e){const n=e.dynamicIdRegex||null,r=e.dynamicElementNameRegex;let h=c(t);if(r){r.test(t.localName)&&(h=csString.prototype.replace.call(h,r,`$1${L}`))}if(function(t,s){const i=z(t);return i&&csString.prototype.match.call(i,/^[\w-]+$/)&&H(M,i,s)}(t,i)){const s=z(t);return{hasUniqueIdentifier:!0,elementSelector:`${h}[${M}="${s}"]`}}const o=function(t,s,i){if(!i.uniqueAttributes)return{success:!1};for(const e of i.uniqueAttributes){const i=t.getAttribute(e);if(null!==i){if(H(e,i,s))return{attributeName:e,attributeValue:i,success:!0}}}return{success:!1}}(t,i,e);if(o.success)return{hasUniqueIdentifier:!0,elementSelector:`${h}#UA[${o.attributeName}="${o.attributeValue}"]`};const u=function(t,s,i){if(!i.uniqueCssSelectors)return;for(const e of i.uniqueCssSelectors)if(k.call(t,e)&&F(e,s))return e;return}(t,i,e);if(u)return{hasUniqueIdentifier:!0,elementSelector:`${h}#UCS[${u}]`};const l=function(t){const s=t.getAttribute("id");return s?a(s):s}(t);if(function(t,s,i,e){return s&&!function(t){return null!==z(t)}(t)&&!function(t,s,i){return t.hasAttribute(D)||function(t,s){let i=!1;t&&s&&(i=s.test(t));return t&&(csArray.prototype.some.call(x,(s=>s.test(t)))||i)}(s,i)}(t,s,e)&&function(t,s){return t&&H("id",t,s)}(s,i)}(t,l,i,n))return{hasUniqueIdentifier:!0,elementSelector:`${h}#${l}`};const d=function(t,s){if(!s.reliableSelectors)return;for(const i of s.reliableSelectors)if(k.call(t,i))return i;return}(t,e);if(d){const i=function(t,s,i){if(t===V||t.nodeType===O)return 0;let e=0,n=s.previousElementSibling;for(;n;)k.call(n,i)&&(e+=1),n=n.previousElementSibling;return e}(s,t,d);return{hasUniqueIdentifier:!1,elementSelector:`${h}[${d}](${i})`}}const f=function(t,s,i){if(t===V||t.nodeType===O)return 0;const e=i.dynamicElementNameRegex,n=!!(null==e?void 0:e.test(s.localName)),r=c(s);let h=0,o=s.previousElementSibling;for(;o;)(c(o)===r||n&&(null==e?void 0:e.test(o.localName)))&&!$(o,i.reliableSelectors)&&(h+=1),o=o.previousElementSibling;return h}(s,t,e);return{hasUniqueIdentifier:!1,elementSelector:`${h}:eq(${f})`}}function z(t){return t.getAttribute(M)}function H(t,s,i){try{return 1===window.csquerySelectorAll[i.nodeType].call(i,`[${t}="${s}"]`).length}catch(t){if("SyntaxError"!==t.name)throw t}return!1}function F(t,s){try{return 1===window.csquerySelectorAll[s.nodeType].call(s,t).length}catch(t){if("SyntaxError"!==t.name)throw t}return!1}const B=11;function q(t,s,i){const e=csArray.prototype.shift.call(t);if(0===t.length)return j(e,i);const n=e,r=t[0],{elementSelector:h,hasUniqueIdentifier:o}=U(n,r,s,i);if(!i.fullPath&&o){return`${j(t[t.length-1],i)}${h}`}const c=q(t,s,i);return`${c?`${c}>`:""}${h}`}function j(t,s){if(t===V)return"|detached|";if(t.host){const{ancestors:i,selectionRoot:e}=C(t.host);return`${q(i,e,s)}|shadow-root|`}return t.nodeType===B?"|fragment|":""}var G;!function(t){function s(t){return!!t&&"localName"in t&&"getAttribute"in t&&"hasAttribute"in t&&"parentNode"in t}function i(t){return t&&"jquery"in t&&1===t.length?t[0]:t}t.INVALID_ELEMENT="INVALID_ELEMENT",t.isValidElement=s,t.getElementPath=function(e,n={fullPath:!1,dynamicIdRegex:null}){const r=i(e);if(r===document)return"";if(!s(r))return t.INVALID_ELEMENT;const{ancestors:h,selectionRoot:o}=C(r);return q(h,o,n)},t.getElementPathAndFirstAnchorParent=function(e,n={fullPath:!1,dynamicIdRegex:null}){const r=i(e);if(r===document)return{path:"",firstAnchorParent:null};if(!s(r))return{path:t.INVALID_ELEMENT,firstAnchorParent:null};const{firstAnchorParent:h,ancestors:o,selectionRoot:c}=function(t){let s=t;const i=[s];let e=null;for(;null!==csNodeparentNode.apply(s);)null===e&&w(s)&&(e=s),csArray.prototype.push.call(i,csNodeparentNode.apply(s)),s=csNodeparentNode.apply(s);return N(s)&&csArray.prototype.push.call(i,V),{firstAnchorParent:e,ancestors:i,selectionRoot:s}}(r);return{path:q(o,c,n),firstAnchorParent:h}}}(G||(G={})),window.CSPathComputation=window.CSPathComputation||G;const Z=Number.MAX_SAFE_INTEGER||9007199254740991;function W(){}function J(t,s){return 0===csString.prototype.lastIndexOf.call(t,s,0)}function K(t,s){return-1!==csString.prototype.indexOf.call(t,s,t.length-s.length)}const X=34164e6,Y={percentage:()=>Math.floor(1e4*Math.random())/100,boolean(t){return this.percentage()Math.floor(Math.random()*t)},Q=csSymbol("cachedJson");const tt=void 0!==window.Symbol?function(t){if(t[Q])return t[Q];if(csArray.isArray(t)){if(0===t.length)return"[]";let s="["+tt(t[0]);for(let i=1;i{if("setOption"===t){const[t,i]=s;this.h(t,i)}}))}h(t,s){"trackerDomain"===t&&(this.trackerDomain=s),"loggerDomain"===t&&(this.loggerDomain=s),"malkaRecordingDomain"===t&&(this.malkaRecordingDomain=s),"malkaQuotaServiceDomain"===t&&(this.malkaQuotaServiceDomain=s),"staticResourceManagerDomain"===t&&(this.staticResourceManagerDomain=s),"minLogLevel"===t&&(this.minLogLevel=s),"useHttps"===t&&(this.useHttps=!!s),"isWebView"===t&&(this.isWebView=s)}t(t){return t?this.u(t):null}getRequestParameters(){return{pid:`${this.projectId}`}}updateDynamicFields(t,s){"emitDebugEvents"===t&&(this.emitDebugEvents=s),"minLogLevel"===t&&(this.minLogLevel=s)}u(t){try{const s=/^\/(.*)\/([gim]*)$/.exec(t);if(s){const[,t,i]=s;return new RegExp(`^${t}$`,i)}return new RegExp(`^${t}$`)}catch(t){return null}}isHeaderCollectionActive(){var t,s;return this.apiErrors.collectStandardHeaders||!!(null===(t=this.apiErrors.validCustomHeaders)||void 0===t?void 0:t.length)||!!(null===(s=this.apiErrors.plainCustomHeaders)||void 0===s?void 0:s.length)}}class it{constructor(t,s){this.A=t,this._=s}init(){this.R=this.A!==this.A.top,this.S=this._.isWebView&&this.A===this.A.top,this._.iframesTracking&&this.R||this.S?this.T=!1:this.T=!0}isInIframeContext(){return this.R}isTopWindowTracker(){return this.T}isInWebViewContext(){return this.S}}var et,nt;!function(t){t.debug="debug",t.warn="warn",t.error="error",t.critical="critical"}(et||(et={})),function(t){t.toQuery=function(t){return csArray.prototype.join.call(csArray.prototype.map.call(Object.keys(t),(s=>`${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`)),"&")}}(nt||(nt={}));class rt{constructor(t,s){this.domainUri=t,this.path=s,this.beforeRequestCallbacks=[],this.afterRequestCallbacks=[]}setRequestParametersProviders(...t){this.requestParametersProviders=t}before(t){csArray.prototype.push.call(this.beforeRequestCallbacks,t)}after(t){csArray.prototype.push.call(this.afterRequestCallbacks,t)}retrieveParameters(){return this.requestParametersProviders?csArray.prototype.reduce.call(csArray.prototype.map.call(this.requestParametersProviders,(t=>t.getRequestParameters())),((t,s)=>({...t,...s}))):{}}}class ht extends rt{constructor(t,s){super(t,s)}send(){csArray.prototype.forEach.call(this.beforeRequestCallbacks,(t=>t()));const t=this.retrieveParameters();this.I(t);const s=nt.toQuery(t);this.P(s),csArray.prototype.forEach.call(this.afterRequestCallbacks,(t=>t()))}P(t){const s=new window.Image(1,1);s.onload=W,s.onerror=W,csHTMLImageElementsrc.call(s,`${this.domainUri}${this.path?`/${this.path}`:""}?${t}`)}I(t){t.r=csString.prototype.slice.call(`${Math.random()}`,2,8)}}class ot{constructor(t,s){this.V=t,this.C=s}init(){this.N=new ht(this.V.getLoggerUri()),this.N.setRequestParametersProviders(this,this.C)}send(t){this.O=t,this.N.send()}getRequestParameters(){return{a:this.O.app,l:this.O.level,m:this.O.message,s:this.O.stacktrace}}}const ct=/[a-zA-Z0-9._%+-]+(?:@|%40|%2540)[a-zA-Z0-9.%-_]+((?:\.|%2[eE])[a-zA-Z0-9-]+)+/g,at=/[a-zA-Z0-9+_-](?:@|%40|%2540)/,ut="([-A-Za-z0-9+/=_]|=[^=]|={3,})+",lt=new RegExp(`(ey${ut}\\.ey${ut}\\.${ut})`,"g"),dt=/[0-9]{4}/,ft=/(^|[^a-zA-Z0-9*.,-])([45*][0-9*]{3}([ -]?)[0-9*]{4}\3[0-9*]{4}\3[0-9*]{4})($|[^a-zA-Z0-9*.,-])/g;class wt{anonymizePII(t){return"string"==typeof t&&(t=this.anonymizeEmail(t)),t}anonymizeEmail(t){return at.test(t)?csString.prototype.replace.call(t,ct,"CS_ANONYMIZED_EMAIL"):t}anonymizeCreditCard(t){return dt.test(t)?csString.prototype.replace.call(t,ft,((t,s,i,e,n)=>{if(-1===csString.prototype.indexOf.call(i,"*")){const s=e.length?csArray.prototype.join.call(csString.prototype.split.call(i,e),""):i;if(!this.$(s))return t}return`${s}CS_ANONYMIZED_PII${n}`})):t}$(t){const s=parseInt(t[t.length-1]);let i=0;for(let s=t.length-2;s>=0;s--){let e=parseInt(t[s]);s%2==0&&(e*=2),i+=Math.floor(e/10)+e%10}return 10-i%10===s}anonymizeJwt(t){return csString.prototype.replace.call(t,lt,"CS_ANONYMIZED_JWT")}anonymizeFields(t,s){return csArray.prototype.forEach.call(s,(s=>{t[s]=this.anonymizeEmail(t[s])})),t}}const pt="14.10.0";function mt(){return{v:pt}}const yt={now:()=>void 0!==window.performance&&window.performance.now?window.performance.timing.navigationStart+Math.round(window.performance.now()):csDate.now()};function At(){return Math.floor(yt.now()/1e3)}function gt(t,s){return 0===csString.prototype.lastIndexOf.call(t,s,0)}function Et(t,s){return-1!==csString.prototype.indexOf.call(t,s,t.length-s.length)}class vt{constructor(t,s){this.L=t,this.M=s}getRequestParameters(){return{d:`${yt.now()}`,p:this.M.anonymizePII(window.location.href),...this.L.getRequestParameters(),...mt()}}}function _t(t){return It(t)&&("number"==typeof t||t instanceof Number)&&!isNaN(t)}function Rt(t){return t===parseInt(t,10)}function St(t){return It(t)&&("string"==typeof t||t instanceof csString)}function Tt(t){return"object"==typeof t}function It(t){return void 0!==t}function Pt(t){return It(t)&&null!==t}function bt(t){return"function"==typeof t}function Vt(t){return t instanceof Element}function Ct(t){return t instanceof Error}const Nt="snippet-",kt="implementation-snippet-";var Ot,$t;!function(t){t.IMPLEMENTATION="implementation",t.DYNAMIC="dynamic"}(Ot||(Ot={})),function(t){t[t.debug=0]="debug",t[t.warn=1]="warn",t[t.error=2]="error",t[t.critical=3]="critical"}($t||($t={}));class xt{constructor(t,s,i){this.D=s,this.M=new wt,this.U=$t[et.warn],this.U=$t[t.minLogLevel||et.warn],this.N=i||new ot(t,new vt(t,this.M)),this.H={[et.debug]:[],[et.warn]:[],[et.error]:[],[et.critical]:[]},this.F={implementation:{},dynamic:{}},this.N.init()}send(t,s="",i=et.warn){if(!this.B(i,s))return;csArray.prototype.push.call(this.H[i],s||"");const e={message:this.q(t,s),stacktrace:this.j(t),app:"uxa",level:i};this.N.send(e)}q(t,s){let i=Ct(t)?this.M.anonymizePII(t.message||t.toString()):t;return s&&(i+=` ErrorCode: ${s}`),i}j(t){return Ct(t)?`${t.stack||"No stacktrace"} ${this.G()}`:this.G()}G(){const t=this.D.getVisitorService(),s=null==t?void 0:t.getVisitor();if(!s)return"No context";const i=this.D.getSessionService(),e=i&&i.getSession(),n={userId:s.id,sessionNumber:s.visitsCount,pageNumber:e&&e.pageNumber};return csJSON.stringify(n)}B(t,s){if($t[t]=5)&&(!s||!csArray.prototype.some.call(i,(t=>t===s)))}Z(t,s){return t in this.F[s]?!(this.F[s][t]>=5)&&(this.F[s][t]+=1,!0):(this.F[s][t]=1,!0)}}const Lt="undefined"==typeof window,Mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:process;const Dt=!Lt&&document.createElement("a"),Ut=/(:443|:80)$/;function zt(t){return Dt?(Dt.href=t,Dt.href):""}function Ht(t,s){return new csURL(t,s).href}function Ft(t){const s=jt(t);return null===s?"":decodeURIComponent(s.hostname)}function Bt(t,s){return csArray.prototype.some.call(s,(s=>Et(t,`.${s}`)||t===s||""===s))}function qt(t){return csString.prototype.replace.call(t,Ut,"")}function jt(t){return Dt&&(gt(t,"http://")||gt(t,"https://"))?(Dt.href=t,{hash:Dt.hash,host:qt(Dt.host),hostname:Dt.hostname,href:Dt.href,origin:Dt.origin?Dt.origin:qt(`${Dt.protocol}//${Dt.host}`),pathname:(s=Dt.pathname,"/"===s[0]?s:`/${s}`),port:Dt.port,protocol:Dt.protocol,search:Dt.search}):null;var s}const Gt="CS_IFRAME_MESSAGE";var Zt,Wt,Jt,Kt;!function(t){t.AfterPageView="afterPageView",t.GetSessionKey="getSessionKey"}(Zt||(Zt={})),function(t){t.Parent="parent",t.Child="child"}(Wt||(Wt={})),function(t){t.Discovery="discovery",t.Stop="stop",t.RecordingStatus="recordingStatus",t.RecordingEvent="recordingEvent",t.EndOfBufferedMessages="endOfBufferedMessages",t.ChildLogMessage="childLogMessage",t.AnalysisEvent="analysisEvent",t.JavascriptError="javascriptError",t.ApiError="apiError",t.Assets="assets",t.DetailedApiError="detailedApiError",t.EmerchandisingMessage="emerchandisingMessage",t.Commands="commands",t.IntegrationCallback="integrationCallback",t.StaticResource="staticResource",t.TrackingContextResultMessage="trackingContextResultMessage",t.TrackingContextRequestMessage="trackingContextRequestMessage",t.CustomError="customError"}(Jt||(Jt={})),function(t){t.buildBaseMessage=function(t,s,i,e){const n={type:t,from:s,pid:i,signature:Gt};return void 0!==e&&e>=0&&(n.id=e),n},t.isMessageValid=function(t,s,i,e){const n=Ft(t.origin);return!!t.data&&!!t.data.type&&t.data.signature===Gt&&t.data.from===s&&t.data.pid===i&&Bt(n,e)},t.sendPostMessage=function(t,s,i,e){e?t.postMessage(i,s,e):t.postMessage(i,s)},t.getNewChannelMessage=function(){return new MessageChannel},t.sendChannelMessage=function(t,s){t.postMessage(s)},t.closeChannelPort=function(t){t.close()}}(Kt||(Kt={}));class Xt{constructor(t){this.L=t}send(t,s="",i=et.warn){const e={message:t,errorCode:s,level:i},n=Kt.buildBaseMessage(Jt.ChildLogMessage,Wt.Child,this.L.projectId);n.content=e,Kt.sendPostMessage(window.parent,"*",n)}}class Yt{setContext(t,s){this.W=t,this.J=s}getVisitorService(){return this.W}getSessionService(){return this.J}}const Qt=["t.contentsquare.net","clicktale"];window.addEventListener("error",(t=>{"string"!=typeof t.filename||!csArray.prototype.some.call(Qt,(s=>csString.prototype.indexOf.call(t.filename,s)>-1))||csString.prototype.indexOf.call(t.filename,"blob")>-1&&(null==t.message?void 0:csString.prototype.indexOf.call(t.message,"importScripts"))>-1||ts.critical(`Uncaught jsError: filename: ${t.filename} - lineno: ${t.lineno} - colno: ${t.colno} - message: ${t.message} `)}));class ts{constructor(){}static whiteListFilename(t){csArray.prototype.push.call(Qt,t)}static setStrategy(t){ts.K=t}static computeIsActive(t){ts.X=Y.boolean(t),ts.X?ts.Y=Y.boolean(10):ts.Y=!1}static isLoggingActive(){return ts.X}static getStrategy(){return ts.K}static debug(t,s=""){ts.X&&this.K.send(t,s,et.debug)}static warn(t,s=""){ts.X&&this.K.send(t,s,et.warn)}static error(t,s=""){ts.X&&this.K.send(t,s,et.error)}static critical(t,s=""){this.K.send(t,s,et.critical)}static tryToExecute(t,s){return(...i)=>{try{const e=s(...i);return It(window.Promise)&&e instanceof window.Promise?e.then((t=>t),(s=>this.error(s,t))):e}catch(s){try{this.error(s,t)}catch{}}}}static isPerfLoggingActive(){return ts.Y}}ts.X=!1,ts.Y=!1;let ss={debug(...t){},warn(...t){},error(...t){},critical(...t){}};const is=t=>(s,i,e)=>{const n=(null==i?void 0:i.toString())||"",r=t||`${s.constructor&&s.constructor.name}.${n}`;if(e){const t=e.value;e.value=function(...s){return function(t,s){return(...i)=>{try{const e=s(...i);return It(window.Promise)&&e instanceof window.Promise?e.then((t=>t),(s=>ss.error(s,t))):e}catch(s){try{ss.error(s,t)}catch{}}}}(r,t.bind(this))(...s)}}};function es(t,s,i,e){var n,r=arguments.length,h=r<3?s:null===e?e=Object.getOwnPropertyDescriptor(s,i):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,s,i,e);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(h=(r<3?n(h):r>3?n(s,i,h):n(s,i))||h);return r>3&&h&&Object.defineProperty(s,i,h),h}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var ns,rs,hs,os;!function(t){function s(t){const s=new RegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(document.cookie);return s?decodeURIComponent(s[2]):null}function i(s,i,n,r,h,o){const c=encodeURIComponent(`${i}`),a=n===t.CURRENT_DOMAIN?void 0:n,u=e(r);let l=`${s}=${c}${u?`;expires=${u.toUTCString()}`:""};path=/${Pt(a)?`;domain=${a}`:""}`;return It(h)&&h!==hs.NotSet&&(l=`${l};SameSite=${h}`),It(o)&&o===os.Yes&&(l=`${l};Secure`),document.cookie=l,!0}function e(t){return _t(t)?new csDate(yt.now()+t):t}function n(t,e){s(t)&&i(t,"",e,new csDate(0)),s(t)&&i(t,"",e,new csDate(0),hs.None,os.Yes)}t.CURRENT_DOMAIN="CURRENT_DOMAIN",t.get=s,t.set=i,t.toExpireDate=e,t.remove=n,t.isCookiePresent=function(){return document.cookie.length>0},t.getRootDomain=function(t,e){const r="_cs_root-domain";let h=s(r);if(null!==h&&"1"!==h)return h;const o=csString.prototype.split.call(window.location.hostname,".");let c=csArray.prototype.pop.call(o);for(;o.length&&(null===h||"1"===h);)c=csArray.prototype.join.call([csArray.prototype.pop.call(o),c],"."),i(r,c,c,void 0,t,e),h=s(r);return n(r,c),c}}(ns||(ns={})),function(t){t.browserIsSafariV12=function(){return window.navigator.vendor&&csString.prototype.indexOf.call(window.navigator.vendor,"Apple")>-1&&window.navigator.appVersion&&csString.prototype.indexOf.call(window.navigator.appVersion,"Version/12.")>-1}}(rs||(rs={})),function(t){t.None="None",t.Lax="Lax",t.NotSet="X"}(hs||(hs={})),function(t){t[t.Yes=1]="Yes",t[t.No=0]="No"}(os||(os={}));class cs{constructor(t,s,i){this.L=t,this.tt=s,this.st=i,this.it=!1,this.et=hs.NotSet,this.nt=os.No}getSameSiteFlag(){return this.et}getSecureFlag(){return this.nt}getDomain(){return this.ht}getRootDomain(){return this.ot}init(){if(this.L.cookielessTrackingEnabled)return;const t=this.ut(),s=this.lt();this.it=this.ft(t,s),this.it?(this.et=t,this.nt=s):this.L.secureCookiesEnabled&&"https:"===this.tt.getUrlProtocol()&&(this.nt=os.Yes),this.ot=this.wt(),this.ht=this.yt(this.ot)}ft(t,s){return!rs.browserIsSafariV12()&&(ns.set(cs.COOKIE_TEST_FOR_SAME_SITE,"Test same site",cs.CURRENT_DOMAIN,void 0,t,s),!!ns.get(cs.COOKIE_TEST_FOR_SAME_SITE)&&(ns.remove(cs.COOKIE_TEST_FOR_SAME_SITE,cs.CURRENT_DOMAIN),!0))}ut(){return"http:"===this.tt.getUrlProtocol()?hs.Lax:this.st.isSameSiteNoneSecureNeeded()||this.L.crossDomainTracking?hs.None:hs.Lax}lt(){return"http:"===this.tt.getUrlProtocol()?os.No:this.L.secureCookiesEnabled||this.L.crossDomainTracking||this.st.isSameSiteNoneSecureNeeded()?os.Yes:os.No}isSameSiteSupported(){return this.it}set(t,s,i){const e=ns.toExpireDate(i);ns.set(t,s,this.ht,e,this.getSameSiteFlag(),this.getSecureFlag())}get(t){const s=new RegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(document.cookie);return s?decodeURIComponent(s[2]):null}delete(t,s){const i=s||this.ht;ns.remove(t,i)}wt(){const t=this.st.isSameSiteNoneSecureNeeded()&&this.isSameSiteSupported(),s=t?hs.None:void 0,i=t?os.Yes:void 0;return ns.getRootDomain(s,i)}yt(t){return this.L.allowSubdomains?t:ns.CURRENT_DOMAIN}}cs.CURRENT_DOMAIN="CURRENT_DOMAIN",cs.COOKIE_TEST_FOR_SAME_SITE="_cs_same_site";const as="_cs_t";class us{constructor(t,s){this.At=t,this.L=s,this.gt=!1,this.Et=!1}init(){if(!this.L.cookielessTrackingEnabled&&this.At.isTopWindowTracker()&&"cookie"in document){if(!this.At.isInIframeContext()&&ns.isCookiePresent())return this.gt=!0,void(this.Et=!1);if(ns.set(as,"1",ns.CURRENT_DOMAIN),null!==ns.get(as))return this.gt=!0,this.Et=!1,void ns.remove(as,ns.CURRENT_DOMAIN);ns.set(as,"1",ns.CURRENT_DOMAIN,void 0,hs.None,os.Yes),null!==ns.get(as)&&(this.gt=!0,this.Et=!0,ns.remove(as,ns.CURRENT_DOMAIN))}}areCookiesEnabled(){return this.gt}isSameSiteNoneSecureNeeded(){return this.Et}}class ls{constructor(t,s){this.L=t,this.st=s}canTrack(){return this.L.isProjectActive()&&this.vt()&&this._t()&&this.Rt()}canTrackInChild(){return this.L.isProjectActive()&&this.St()&&(this._t()||this.Tt())}Rt(){return this.L.cookielessTrackingEnabled?function(){const t="CSSessionStorageTest";try{return sessionStorage.setItem(t,t),sessionStorage.getItem(t)===t&&(sessionStorage.removeItem(t),!0)}catch{return!1}}():this.st.areCookiesEnabled()}_t(){return Bt(window.location.hostname,this.L.hostnames)}vt(){return!this.It()&&this.Pt()}St(){return!this.It()&&this.bt()}Tt(){return J(window.location.href,"about:srcdoc")&&"about:"===window.location.protocol&&""===window.location.hostname}It(){return"visibilityState"in document&&"prerender"===document.visibilityState}Pt(){return this.Vt()&&!!window.localStorage}bt(){return this.Vt()}Vt(){return"pageXOffset"in window&&"pageYOffset"in window&&"onpagehide"in window&&"JSON"in window&&"parse"in window.csJSON&&"stringify"in window.csJSON&&"addEventListener"in window&&"removeEventListener"in window&&"Node"in window&&"filter"in csArray.prototype&&"forEach"in csArray.prototype&&"querySelectorAll"in document&&"now"in csDate&&"keys"in Object&&"performance"in window&&"Map"in window&&"Set"in window}}class ds{constructor(t){this.Ct=!1,this.Nt=new Map,this.kt=new Map,this.Ot=new Map,this.$t="CS_WORKER_SIGNATURE";const s=`\n const algorithm = ${t.algorithm};\n const compressor = (${t.getCompressorSourceCode()})();\n (()=>{"use strict";var e,t;!function(e){e.UNCOMPRESSED="0",e.GZIP="2"}(e||(e={}));class s{constructor(e){this.queryParams={},this.headers={},this.handleRecoveredRequests=e=>{for(const t of e){const{metadata:e,events:s}=t;this.send(s,e)}},this.endpoint=e.endpoint,this.compressionOpts=e.compressionOpts,this.recoveryStorage=e.recoveryStorage,this.recoveryStorage&&this.recoveryStorage.recover(this.handleRecoveredRequests)}setQueryParams(e){Object.keys(e).forEach((t=>{this.queryParams[t]=e[t]}))}removeQueryParams(e){e?e.forEach((e=>{delete this.queryParams[e]})):this.queryParams={}}send(t,s){const r=s||{...this.queryParams},a=!("ct"in r),o="string"!=typeof t&&!this.isArrayBuffer(t);"ct"in r||(this.compressionOpts&&a?r.ct=this.compressionOpts.compressionType:r.ct=e.UNCOMPRESSED);const i=o?JSON.stringify(t):t,n=Object.keys(r).map((e=>\`\${encodeURIComponent(e)}=\${encodeURIComponent(r[e])}\`)).join("&"),h=\`\${this.endpoint}?\${n}\`;this.compressionOpts&&a&&"string"==typeof i?this.compressionOpts.compressor(i,this.compressionOpts.compressionOutputType,(e=>this.doSend(h,r,e))):this.doSend(h,r,i)}onLoad(e){this.onLoadCallback=e}onError(e){this.onErrorCallback=e}onTimeout(e,t){this.onTimeoutCallback=e,this.timeout=t}abort(){this.abortCurrentXhrCall&&this.abortCurrentXhrCall()}setRequestHeader(e,t){this.headers[e]=t}getQueryParams(){return this.queryParams}isArrayBuffer(e){return e&&void 0!==e.byteLength}doSend(e,t,s){const r=new XMLHttpRequest,a=Object.keys(t).map((e=>\`\${encodeURIComponent(e)}=\${encodeURIComponent(t[e])}\`)).join("&");r.open("POST",e),r.onload=()=>{if(this.recoveryStorage&&this.recoveryStorage.recover(this.handleRecoveredRequests),this.onLoadCallback){const e={params:t,responseText:r.responseText,status:r.status};this.onLoadCallback(e)}},r.onerror=()=>{this.recoveryStorage&&this.recoveryStorage.save({key:a,metadata:t,events:s}),this.onErrorCallback&&this.onErrorCallback({params:t})},this.timeout&&this.onTimeoutCallback&&(r.timeout=this.timeout,r.ontimeout=()=>{this.onTimeoutCallback()}),this.abortCurrentXhrCall=()=>r.abort(),Object.keys(this.headers).forEach((e=>{r.setRequestHeader(e,this.headers[e])})),r.send(s)}}class r{constructor(e){this.maxStoredBytes=e,this.storageBytesUsed=0}addString(e){this.storageBytesUsed+=2*e.length}addArrayBuffer(e){this.storageBytesUsed+=e.byteLength}isThresholdReached(){return this.storageBytesUsed>this.maxStoredBytes}reset(){this.storageBytesUsed=0}}class a{constructor(e){this.ramStorage={},this.byteSizeCounter=new r(e)}save({key:e,metadata:t,events:s}){this.byteSizeCounter.isThresholdReached()||(this.byteSizeCounter.addString(e),"string"==typeof s?this.byteSizeCounter.addString(s):this.byteSizeCounter.addArrayBuffer(s),this.byteSizeCounter.isThresholdReached()||(this.ramStorage[e]={metadata:t,events:s}))}recover(e){const t=[];this.getStorageKeys().forEach((e=>{const s=this.ramStorage[e];void 0!==s&&(delete s.metadata.datatype,t.push(s),this.removeItem(e))})),0!==t.length&&(e(t),this.byteSizeCounter.reset())}getStorageKeys(){return Object.keys(this.ramStorage)}removeItem(e){delete this.ramStorage[e]}}!function(e){e[e.NOT_STARTED=0]="NOT_STARTED",e[e.OPEN_IN_PROGRESS=1]="OPEN_IN_PROGRESS",e[e.OPEN_FAILED=2]="OPEN_FAILED",e[e.READY=3]="READY"}(t||(t={}));class o{constructor(e,s,a){this.storageName=e,this.onOpenError=a,this.cacheState=t.NOT_STARTED,this.toBeSavedBuffer=[],this.recoveryInProgress=0,this.origin=self.origin,this.context="object"==typeof window?"":"worker-",this.byteSizeCounter=new r(s),this.init()}async init(){await this.openCache(),this.cacheState===t.READY?this.flushToBeSavedBuffer():this.onOpenError(this.toBeSavedBuffer)}flushToBeSavedBuffer(){this.toBeSavedBuffer.forEach((e=>{this.save(e)})),this.toBeSavedBuffer=[]}async save(e){try{if(this.cacheState===t.OPEN_IN_PROGRESS)return void this.toBeSavedBuffer.push(e);if(this.cacheState!==t.READY)return;if(this.byteSizeCounter.isThresholdReached())return;const{key:s,metadata:r,events:a}=e;if(this.byteSizeCounter.addString(s),"string"==typeof a?this.byteSizeCounter.addString(a):this.byteSizeCounter.addArrayBuffer(a),this.byteSizeCounter.isThresholdReached())return;await this.cache.put(\`\${this.origin}/\${s}\`,new Response(a,{headers:r}))}catch{}}async recover(e){(this.cache||(await this.openCache(),this.cacheState===t.READY))&&this.doRecover(e)}async openCache(){try{this.cacheState=t.OPEN_IN_PROGRESS,this.cache=await self.caches.open(\`\${this.context}\${this.storageName}\`),this.cacheState=t.READY}catch{this.cacheState=t.OPEN_FAILED}}async doRecover(e){try{if(this.recoveryInProgress++,this.recoveryInProgress>1)return;const t=await this.cache.keys();if(0===t.length)return;const s=(await this.cache.matchAll()).map((e=>{const t={};e.headers.forEach(((e,s)=>{t[s]=e})),delete t["content-type"];const s=t.datatype;return delete t.datatype,"json"===s||"base64"===s?e.text().then((e=>({metadata:t,events:e}))):e.arrayBuffer().then((e=>({metadata:t,events:e})))})),r=await Promise.all(s);await Promise.all(t.map((e=>this.cache.delete(e)))),e(r),this.byteSizeCounter.reset()}catch{}finally{this.recoveryInProgress--}}}class i{constructor(e){self.caches?this.setCachesStrategy(e):this.setRamStorageStrategy()}save(e){this.storageStrategy.save(e)}recover(e){this.storageStrategy.recover(e)}setCachesStrategy(e){this.storageStrategy=new o(e,i.MAX_SIZE,(e=>{this.setRamStorageStrategy(e)}))}setRamStorageStrategy(e){this.storageStrategy=new a(i.MAX_SIZE),e&&e.forEach((e=>{this.storageStrategy.save(e)}))}}i.MAX_SIZE=16777216,function(){const e="CS_WORKER_SIGNATURE",t=new Map,r=new i("csPersisted");function a(a){var o;if((o=a)&&o.WORKER_SIGNATURE===e)switch(a.type){case"CreatePostRequest":{const{endpoint:o,compressionOutputType:i,useRetry:n}=a,h={endpoint:o};i&&(h.compressionOpts={compressor,compressionOutputType:i,compressionType:algorithm}),n&&(h.recoveryStorage=r);const c=new s(h);t.set(o,c),c.onLoad((t=>{const s={type:"onLoad",endpoint:o,response:t,WORKER_SIGNATURE:e};self.postMessage(s)})),c.onError((t=>{const s={type:"onError",endpoint:o,response:t,WORKER_SIGNATURE:e};self.postMessage(s)}))}break;case"SetQueryParams":{const{endpoint:e,queryParams:s}=a,r=t.get(e);r&&r.setQueryParams(s)}break;case"RemoveQueryParams":{const{endpoint:e,queryParams:s}=a,r=t.get(e);r&&r.removeQueryParams(s)}break;case"Send":{const{endpoint:e,payload:s,queryParams:r}=a,o=t.get(e);o&&o.send(s,r)}break;case"Abort":{const{endpoint:e}=a,s=t.get(e);s&&s.abort()}break;case"SetHeader":{const{endpoint:e,headerName:s,headerValue:r}=a,o=t.get(e);o&&o.setRequestHeader(s,r)}break;case"SetTimeout":{const{endpoint:s,timeout:r}=a,o=t.get(s);o&&o.onTimeout((()=>{const t={type:"onTimeout",endpoint:s,WORKER_SIGNATURE:e};self.postMessage(t)}),r)}break;default:throw new Error(JSON.stringify(a))}}self.addEventListener("message",(function(e){e.data.getReader?async function(e,t){const s=e.getReader();for(;;){const{done:e,value:r}=await s.read();if(e)break;t(r)}}(e.data,a):a(e.data)}))}()})();`;try{this.xt=this.Lt(s),this.Ct=!0,this.Mt()&&(this.Dt=new ReadableStream({start:t=>{this.Ut=t}}),this.xt.postMessage(this.Dt,[this.Dt]),this.postMessage=this.postMessageAsTransferable)}catch(t){this.Ct=!1}}postMessage(t){t.WORKER_SIGNATURE=this.$t,this.xt.postMessage(t)}postMessageAsTransferable(t){t.WORKER_SIGNATURE=this.$t,this.Ut.enqueue(t)}Lt(t){const s=window.csURL||window.webkitURL,i=window.Blob,e=window.Worker,n=new i([t],{type:"application/javascript"}),r=s.createObjectURL(n);ts.whiteListFilename(r);const h=new e(r);return h.onmessage=t=>{const{type:s,endpoint:i,WORKER_SIGNATURE:e}=t.data;if(e===this.$t)if("onLoad"===s){const{response:s}=t.data,e=this.Nt.get(i);e&&e(s)}else if("onError"===s){const{response:s}=t.data,e=this.kt.get(i);e&&e(s)}else if("onTimeout"===s){const t=this.Ot.get(i);t&&t()}},h}registerOnLoadCallback(t,s){this.Nt.set(t,s)}registerOnErrorCallback(t,s){this.kt.set(t,s)}registerOnTimeoutCallback(t,s){this.Ot.set(t,s)}isSupported(){return this.Ct}Mt(){try{const t=new ReadableStream;return structuredClone(t,{transfer:[t]}),!0}catch{return!1}}}class fs{constructor(t){this.zt={},this.Ht=t.endpoint,this.Ft=t.networkWorker,this.Bt=t.compressionOutputType,this.qt=t.useRetry,this.Ft.postMessage({type:"CreatePostRequest",endpoint:this.Ht,compressionOutputType:this.Bt,useRetry:this.qt})}setQueryParams(t){this.Ft.postMessage({type:"SetQueryParams",endpoint:this.Ht,queryParams:t}),csArray.prototype.forEach.call(Object.keys(t),(s=>{this.zt[s]=t[s]}))}getQueryParams(){return this.zt}removeQueryParams(t){this.Ft.postMessage({type:"RemoveQueryParams",endpoint:this.Ht,queryParams:t}),t&&csArray.prototype.forEach.call(t,(t=>{delete this.zt[t]}))}send(t,s){this.Ft.postMessage({type:"Send",endpoint:this.Ht,payload:t,queryParams:s})}abort(){this.Ft.postMessage({type:"Abort",endpoint:this.Ht})}onLoad(t){this.Ft.registerOnLoadCallback(this.Ht,t)}onError(t){this.Ft.registerOnErrorCallback(this.Ht,t)}setRequestHeader(t,s){this.Ft.postMessage({type:"SetHeader",endpoint:this.Ht,headerName:t,headerValue:s})}onTimeout(t,s){this.Ft.registerOnTimeoutCallback(this.Ht,t),this.Ft.postMessage({type:"SetTimeout",endpoint:this.Ht,timeout:s})}}var ws;!function(t){t.UNCOMPRESSED="0",t.GZIP="2"}(ws||(ws={}));class ps{constructor(t){this.onError=t}}class ms{constructor(t){this.zt={},this.jt={},this.Gt=t=>{for(const s of t){const{metadata:t,events:i}=s;this.send(i,t)}},this.Ht=t.endpoint,this.Zt=t.compressionOpts,this.Wt=t.recoveryStorage,this.Wt&&this.Wt.recover(this.Gt)}setQueryParams(t){Object.keys(t).forEach((s=>{this.zt[s]=t[s]}))}removeQueryParams(t){t?t.forEach((t=>{delete this.zt[t]})):this.zt={}}send(t,s){const i=s||{...this.zt},e=!("ct"in i),n="string"!=typeof t&&!this.Jt(t);"ct"in i||(this.Zt&&e?i.ct=this.Zt.compressionType:i.ct=ws.UNCOMPRESSED);const r=n?JSON.stringify(t):t,h=Object.keys(i).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(i[t])}`)).join("&"),o=`${this.Ht}?${h}`;this.Zt&&e&&"string"==typeof r?this.Zt.compressor(r,this.Zt.compressionOutputType,(t=>this.Kt(o,i,t))):this.Kt(o,i,r)}onLoad(t){this.Xt=t}onError(t){this.Yt=t}onTimeout(t,s){this.Qt=t,this.ss=s}abort(){this.es&&this.es()}setRequestHeader(t,s){this.jt[t]=s}getQueryParams(){return this.zt}Jt(t){return t&&void 0!==t.byteLength}Kt(t,s,i){const e=new XMLHttpRequest,n=Object.keys(s).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(s[t])}`)).join("&");e.open("POST",t),e.onload=()=>{if(this.Wt&&this.Wt.recover(this.Gt),this.Xt){const t={params:s,responseText:e.responseText,status:e.status};this.Xt(t)}},e.onerror=()=>{this.Wt&&this.Wt.save({key:n,metadata:s,events:i}),this.Yt&&this.Yt({params:s})},this.ss&&this.Qt&&(e.timeout=this.ss,e.ontimeout=()=>{this.Qt()}),this.es=()=>e.abort(),Object.keys(this.jt).forEach((t=>{e.setRequestHeader(t,this.jt[t])})),e.send(i)}}class ys{constructor(t){this.ns=t,this.Ft=new ds(this.ns)}create(t,s,i,e){if(this.Ft.isSupported()&&s)return new fs({networkWorker:this.Ft,endpoint:t,compressionOutputType:i,useRetry:!!e});{const s=i?{compressor:this.ns.compress,compressionOutputType:i,compressionType:this.ns.algorithm}:void 0;return new ms({endpoint:t,compressionOpts:s,recoveryStorage:e})}}}class As{constructor(t,s,i,e,n){this.W=t,this.J=s,this.rs=i,this.hs=e,this.L=n}get(){return{exclusion:this.rs.getAppliedTrackingDraw(),visitor:this.W.getVisitor(),session:this.J.getSession(),cvars:this.hs.getCustomVariablesSession()}}apply(t){t&&(t.exclusion?this.exclude():this.include(t))}exclude(){this.rs.exclude(this.L),this.W.removeVisitor(),this.J.removeSession(),this.hs.removeCustomVariablesSession()}include(t){this.rs.removeExclusion(),this.W.setVisitor(t.visitor),t.session?this.J.setSession(t.session):this.J.removeSession(),t.cvars?this.hs.setCustomVariableSession(t.cvars):this.hs.removeCustomVariablesSession()}}const gs="_cs_id",Es=/^(([a-z0-9\-])+(\.[0-9]+){6})(\.(None|Lax|X)\.(0|1))?(\.[0-1])?$/;class vs{constructor(t,s,i){this.L=t,this.cs=s,this.us=i}onCookieToSet(t){this.ls=t}onCookieToRemove(t){this.ds=t}get(){let t;return t=this.L.cookielessTrackingEnabled?this.us.getItem(gs):this.cs.get(gs),t?vs.fromString(t):null}set(t){var s;const i=vs.toString(t);if(this.L.cookielessTrackingEnabled)this.us.setItem(gs,i);else{const e=new csDate(t.expires);this.cs.set(gs,i,e),null===(s=this.ls)||void 0===s||s.call(this,gs,i,e)}}remove(){var t;this.L.cookielessTrackingEnabled?this.us.removeItem(gs):(this.cs.delete(gs),null===(t=this.ds)||void 0===t||t.call(this,gs))}handleSubdomainChange(){if(this.L.cookielessTrackingEnabled)return;const t=this.get();t&&(t.allowSubdomains=this.L.allowSubdomains,this.L.allowSubdomains?this.cs.delete(gs,cs.CURRENT_DOMAIN):this.cs.delete(gs,this.cs.getRootDomain()),this.set(t))}static fromString(t){const[s,i,e,n,r,h,o,c]=csString.prototype.split.call(t,".");return{id:s,creationTimestamp:Number(i),visitsCount:Number(e),hitTimestamp:Number(n),lastVisitTimestamp:Number(r),appliedTrackingDraw:Number(h),expires:Number(o),allowSubdomains:void 0===c?void 0:!!Number(c)}}static toString(t){return csArray.prototype.join.call([t.id,t.creationTimestamp,t.visitsCount,t.hitTimestamp,t.lastVisitTimestamp,t.appliedTrackingDraw,t.expires,t.allowSubdomains?1:0],".")}static isValidVisitorString(t){return Es.test(t)}}var _s,Rs,Ss;!function(t){t.BLOCKED_BY_CONSENT_NOT_EXPRESSED="B",t.BLOCKED_BY_CONSENT_WITHDRAWN="W",t.NOT_RECORDED="0",t.TEMPORARILY_RECORDED="T",t.GLOBAL_SAMPLING="5",t.URL_SAMPLING="6",t.ETR_SAMPLING="7"}(_s||(_s={})),function(t){t.ETR_OFF="0",t.ETR_ON="1"}(Rs||(Rs={})),function(t){t.ETR_LEGACY="0",t.ETR_SESSION="1",t.ETR_PAGE="2"}(Ss||(Ss={}));const Ts="_cs_s",Is=18e5,Ps=/^(\d+\.[013567TBW](\.[01])?)(\.\d+)?$/,bs=".";var Vs,Cs;!function(t){t[t.NOT_FOUND=0]="NOT_FOUND",t[t.EXPIRED=1]="EXPIRED",t[t.FOUND=2]="FOUND"}(Vs||(Vs={}));class Ns{constructor(t,s,i){this.L=t,this.cs=s,this.us=i,this.fs=null,this.ws=!1}get(t){const s=this.getRawSession(t);return this.isValid(s)?Ns.fromString(s):null}getRawSession(t){if(t){const t=this.ps();return Ns.ys(t)}const{sessionString:s,status:i}=this.As(),e=Ns.ys(s);if(i!==Vs.EXPIRED)return e;if(this.L.cookielessTrackingEnabled)return null;const n=this.ps();if(!n)return null;const r=csString.prototype.split.call(n,bs);if(!Ns.gs(r))return n;const h=r[r.length-1],o=parseInt(h,10);return isNaN(o)||this.Es(o),e}onCookieToSet(t){this.ls=t}onCookieToRemove(t){this.ds=t}set(t,s=18e5){var i;const e=yt.now()+s;let n=this.toString(t);n+=`${bs}${e}`,this.vs(n,e),this.L.cookielessTrackingEnabled?this.us.setItem(Ts,n):(this.cs.set(Ts,n,s),null===(i=this.ls)||void 0===i||i.call(this,Ts,n,s))}remove(){var t;this.L.cookielessTrackingEnabled?this.us.removeItem(Ts):(this.cs.delete(Ts),null===(t=this.ds)||void 0===t||t.call(this,Ts)),this._s()}handleSubdomainChange(){if(this.L.cookielessTrackingEnabled)return;const t=this.get(!0);t&&(this.L.allowSubdomains?this.cs.delete(Ts,cs.CURRENT_DOMAIN):this.cs.delete(Ts,this.cs.getRootDomain()),this.set(t))}isValid(t){return null!==t&&Ns.isValidSessionString(t)}toString(t){return csArray.prototype.join.call([t.pageNumber,t.recordingState,t.etrState],bs)}vs(t,s){this.fs={sessionString:t,expires:s}}As(){return this.fs?this.fs&&yt.now()<=this.fs.expires?{sessionString:this.fs.sessionString,status:Vs.FOUND}:{sessionString:this.fs.sessionString,status:Vs.EXPIRED}:{sessionString:this.ps(),status:Vs.NOT_FOUND}}_s(){this.fs=null}Es(t){this.fs&&(this.fs.expires=t,this.ws=!0)}isCacheRefreshed(){return this.ws}resetCacheRefreshed(){this.ws=!1}ps(){if(this.L.cookielessTrackingEnabled){const t=this.us.getItem(Ts);return!t||this.Rs(t)?null:t}const t=this.cs.get(Ts);return!t||this.Rs(t)?null:t}Rs(t){const s=csString.prototype.split.call(t,bs);if(!Ns.gs(s))return!1;const i=parseInt(s[s.length-1],10);return!isNaN(i)&&yt.now()>i}static gs(t){return 13===t[t.length-1].length}static ys(t){var s;if(!t)return null;const i=null===(s=csString.prototype.match.call(t,Ps))||void 0===s?void 0:s[1];return null!=i?i:null}static fromRawString(t){const s=Ns.ys(t);return null!==s?Ns.fromString(s):null}static fromString(t){var s;const[i,e,n]=csString.prototype.split.call(t,bs);return{recordingState:e,etrState:null!==(s=n)&&void 0!==s?s:Rs.ETR_OFF,pageNumber:parseInt(i,10)}}static isValidSessionString(t){return Ps.test(t)}}!function(t){t.fromRaw=function(t){return{exclusion:Number(t._cs_ex)||0,visitor:t._cs_id?vs.fromString(t._cs_id):null,session:t._cs_s?Ns.fromRawString(t._cs_s):null,cvars:t._cs_cvars?window.csJSON.parse(t._cs_cvars):null}}}(Cs||(Cs={}));const ks="_cs_ex",Os=2592e6,$s=/^[0-9]+$/;class xs{constructor(t,s,i){this.L=t,this.cs=s,this.us=i}onCookieToSet(t){this.ls=t}onCookieToRemove(t){this.ds=t}get(){return this.L.cookielessTrackingEnabled?Number(this.us.getItem(ks)):Number(this.cs.get(ks))}set(t){var s;this.L.cookielessTrackingEnabled?this.us.setItem(ks,t):(this.cs.set(ks,t,Os),null===(s=this.ls)||void 0===s||s.call(this,ks,t,Os))}remove(){var t;this.L.cookielessTrackingEnabled?this.us.removeItem(ks):(this.cs.delete(ks),null===(t=this.ds)||void 0===t||t.call(this,ks))}static isValidExclusionString(t){return $s.test(t)}}const Ls="_cs_cvars";class Ms{constructor(t,s,i){this.L=t,this.cs=s,this.us=i}onCookieToSet(t){this.ls=t}onCookieToRemove(t){this.ds=t}get(){return this.L.cookielessTrackingEnabled?this.us.getItem(Ls):this.cs.get(Ls)}set(t){var s;this.L.cookielessTrackingEnabled?this.us.setItem(Ls,t):(this.cs.set(Ls,t),null===(s=this.ls)||void 0===s||s.call(this,Ls,t))}remove(){var t;this.L.cookielessTrackingEnabled?this.us.removeItem(Ls):(this.cs.delete(Ls),null===(t=this.ds)||void 0===t||t.call(this,Ls))}static isValidCustomVarString(t){return"string"==typeof t}}var Ds;!function(t){function s(t){const s=["_cs_ex","_cs_id","_cs_s","_cs_cvars"];return csArray.prototype.every.call(Object.keys(t),(t=>csArray.prototype.indexOf.call(s,t)>=0))}t.isRawDomainState=s,t.isValid=function(t){return!!s(t)&&((!t._cs_id||vs.isValidVisitorString(t._cs_id))&&(!t._cs_s||Ns.isValidSessionString(t._cs_s))&&(!t._cs_ex||xs.isValidExclusionString(t._cs_ex))&&(!t._cs_cvars||Ms.isValidCustomVarString(t._cs_cvars)))}}(Ds||(Ds={}));class Us{constructor(t,s){this.Ss=t,this.Ts=s}retrieve(t,s){this.Is=s,this.retrievedStates=[],this.Ps=csArray.prototype.map.call(csArray.prototype.filter.call(t,(t=>this.bs(t))),Us.getXdframeOrigin),this.Ss.onMessage((t=>{this.Vs(t)})),this.Ss.onTimeout((()=>{this.Cs()})),this.Ss.start(),csArray.prototype.forEach.call(csArray.prototype.map.call(this.Ps,Us.getXdframeUrl),(t=>this.Ss.open(t)))}Vs(t){if(this.Ns(t)){const s=t.data;if(!Ds.isValid(s))throw this.Ss.stop(),`Invalid domain state: ${csJSON.stringify(t.data)} from ${t.origin}`;csArray.prototype.push.call(this.retrievedStates,s)}this.ks()&&(this.Ss.stop(),this.Is(csArray.prototype.map.call(this.retrievedStates,Cs.fromRaw)))}Cs(){ts.warn("xdframe: all messages not received")}Ns(t){return csArray.prototype.indexOf.call(this.Ps,t.origin)>-1}ks(){return this.retrievedStates.length===this.Ps.length}bs(t){return!K(this.Ts.hostname,t)}static getXdframeOrigin(t){return`https://csxd.${t}`}static getXdframeUrl(t){return`${t}/xdframe-1.0.0.html`}}class zs{constructor(){this.Os=3e3,this.$s=t=>{this.handleMessage(t)}}onMessage(t){this.xs=t}onTimeout(t){this.Qt=t}start(){window.addEventListener("message",this.$s),this.Ls=window.setTimeout((()=>{this.Qt()}),this.Os)}open(t){const s=document.createElement("iframe");return s.src=t,s.setAttribute("hidden",""),s.setAttribute("title","Intentionally blank"),document.body.appendChild(s),s}stop(){window.removeEventListener("message",this.$s),window.clearTimeout(this.Ls),this.xs=W,this.Qt=W}handleMessage(t){this.xs(t)}}function Hs(t,s=0){const i=Math.pow(10,s);return Math.round(t*i)/i}function Fs(t,s){"number"==typeof s&&(s={wait:s});const i=s.wait;if(s.ignoreThrottledCalls){let s=0;return function(...e){const n=yt.now();if(n-s>i)return s=n,t.apply(this,e)}}let e,n,r=[],h=null,o=0;const c=()=>{o=yt.now(),h=null,n=t.apply(e,r)},a=function(...s){const a=yt.now(),u=i-(a-o);return e=null!=this?this:window,r=[...s],u<=0||u>i?(o=a,n=t.apply(e,r),h?(window.clearTimeout(h),h=null):r=[]):h||(h=window.setTimeout(c,u)),n};return a.cancel=()=>{h&&(window.clearTimeout(h),o=0,h=null,r=[])},a.flushPending=()=>{h&&(window.clearTimeout(h),c())},a}es([is("XdframeMessage")],zs.prototype,"handleMessage",null);var Bs,qs,js,Gs;!function(t){t[t.MUTATION_INSERT=1]="MUTATION_INSERT",t[t.MUTATION_REMOVE=2]="MUTATION_REMOVE",t[t.MUTATION_ATTRIBUTE=3]="MUTATION_ATTRIBUTE",t[t.MUTATION_CHARACTER_DATA=4]="MUTATION_CHARACTER_DATA",t[t.INITIAL_DOM=5]="INITIAL_DOM",t[t.SCROLL=6]="SCROLL",t[t.CLICK=8]="CLICK",t[t.RESIZE=9]="RESIZE",t[t.INPUT_CHECKABLE=10]="INPUT_CHECKABLE",t[t.INPUT_SELECT=11]="INPUT_SELECT",t[t.INPUT_TEXT=12]="INPUT_TEXT",t[t.HASH_CHANGE=13]="HASH_CHANGE",t[t.UNANONYMIZED_CONSENT_GRANTED=14]="UNANONYMIZED_CONSENT_GRANTED",t[t.UNANONYMIZED_CONSENT_WITHDRAWN=15]="UNANONYMIZED_CONSENT_WITHDRAWN",t[t.MOUSE_OVER=16]="MOUSE_OVER",t[t.VISIBILITY_CHANGE=17]="VISIBILITY_CHANGE",t[t.STYLESHEET_RULE_INSERT=18]="STYLESHEET_RULE_INSERT",t[t.STATIC_RESOURCE_URL=19]="STATIC_RESOURCE_URL",t[t.PERFORMANCE_TIMINGS=20]="PERFORMANCE_TIMINGS",t[t.ATTACH_SHADOW=22]="ATTACH_SHADOW",t[t.STYLESHEET_CSS_TEXT_UPDATE=23]="STYLESHEET_CSS_TEXT_UPDATE",t[t.JAVASCRIPT_ERROR=26]="JAVASCRIPT_ERROR",t[t.PAGE_EVENT=27]="PAGE_EVENT",t[t.API_ERROR=28]="API_ERROR",t[t.TEXT_VISIBILITY=29]="TEXT_VISIBILITY",t[t.MUTATION_ENCRYPTED_CHARACTER_DATA=30]="MUTATION_ENCRYPTED_CHARACTER_DATA",t[t.INPUT_ENCRYPTED_TEXT=31]="INPUT_ENCRYPTED_TEXT",t[t.KEY_DOWN=32]="KEY_DOWN",t[t.KEY_UP=33]="KEY_UP",t[t.CLIPBOARD_COMMAND=34]="CLIPBOARD_COMMAND",t[t.STYLESHEET_RULE_DELETE=37]="STYLESHEET_RULE_DELETE",t[t.USER_IDENTIFIER=38]="USER_IDENTIFIER",t[t.TOUCH_START=41]="TOUCH_START",t[t.TOUCH_MOVE=42]="TOUCH_MOVE",t[t.TOUCH_END=43]="TOUCH_END",t[t.GESTURE_RECOGNITION=44]="GESTURE_RECOGNITION",t[t.POINTER_DOWN=47]="POINTER_DOWN",t[t.POINTER_MOVE=48]="POINTER_MOVE",t[t.POINTER_UP=49]="POINTER_UP",t[t.CUSTOM_ERROR=50]="CUSTOM_ERROR",t[t.CUSTOM_ELEMENT_REGISTRATION=54]="CUSTOM_ELEMENT_REGISTRATION",t[t.REGISTER_ADOPTED_STYLE_SHEET=60]="REGISTER_ADOPTED_STYLE_SHEET",t[t.SET_ADOPTED_STYLE_SHEETS=61]="SET_ADOPTED_STYLE_SHEETS",t[t.ADOPTED_STYLESHEET_RULE_INSERT=62]="ADOPTED_STYLESHEET_RULE_INSERT",t[t.ADOPTED_STYLESHEET_RULE_DELETE=63]="ADOPTED_STYLESHEET_RULE_DELETE",t[t.SCREEN_RESIZE=65]="SCREEN_RESIZE",t[t.RESOURCE_HASHES=66]="RESOURCE_HASHES",t[t.PERFORMANCE_NAVIGATION_TIMING=67]="PERFORMANCE_NAVIGATION_TIMING",t[t.PERFORMANCE_RESOURCE_TIMING=68]="PERFORMANCE_RESOURCE_TIMING",t[t.RECORDING_INFO_EVENT=72]="RECORDING_INFO_EVENT",t[t.TEXT_REF=73]="TEXT_REF",t[t.TOUCH_CANCEL=74]="TOUCH_CANCEL",t[t.MUTATION_MOVE=75]="MUTATION_MOVE"}(Bs||(Bs={})),function(t){t[t.RECORDING_CONSENT_FOR_SESSION_GRANTED=1]="RECORDING_CONSENT_FOR_SESSION_GRANTED",t[t.RECORDING_CONSENT_FOR_SESSION_WITHDRAWN=2]="RECORDING_CONSENT_FOR_SESSION_WITHDRAWN"}(qs||(qs={})),function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Fourth=3]="Fourth",t[t.Fifth=4]="Fifth"}(js||(js={})),function(t){t[t.SWIPE=0]="SWIPE",t[t.PINCH_IN=1]="PINCH_IN",t[t.PINCH_OUT=2]="PINCH_OUT",t[t.LONG_PRESS=3]="LONG_PRESS",t[t.TAP=4]="TAP",t[t.DOUBLE_TAP=5]="DOUBLE_TAP"}(Gs||(Gs={}));function Zs(t,s=true){t.boundElement.addEventListener(t.type,t.listener,s)}function Ws(t,s=true){t.boundElement.removeEventListener(t.type,t.listener,s)}var Js,Ks;!function(t){t[t.SPACE=0]="SPACE",t[t.ENTER=1]="ENTER",t[t.BACKSPACE=2]="BACKSPACE",t[t.DELETE=3]="DELETE",t[t.ARROWUP=4]="ARROWUP",t[t.ARROWDOWN=5]="ARROWDOWN",t[t.ARROWLEFT=6]="ARROWLEFT",t[t.ARROWRIGHT=7]="ARROWRIGHT",t[t.CAPSLOCK=8]="CAPSLOCK",t[t.SHIFT=9]="SHIFT",t[t.TAB=10]="TAB",t[t.ALPHANUMERICAL=11]="ALPHANUMERICAL",t[t.ESCAPE=12]="ESCAPE",t[t.END=13]="END",t[t.ALT=14]="ALT",t[t.CTRL=15]="CTRL",t[t.META=16]="META"}(Js||(Js={})),function(t){t[t.COPY=0]="COPY",t[t.CUT=1]="CUT",t[t.PASTE=2]="PASTE"}(Ks||(Ks={}));class Xs{static isEmpty(){return 0===Xs.Ms.length}static add(t){csArray.prototype.push.call(Xs.Ms,...t)}static getAll(){return Xs.Ms}static clear(){Xs.Ms=[]}}Xs.Ms=[];let Ys=50,Qs=.1;let ti=!1;const si=[];let ii=[];const ei=function(t){return function(s,i,e){const n=e.value;e.value=function(){if(!ti)return e.value=n,n.apply(this,arguments);!function(t){csArray.prototype.push.call(si,t),performance.mark(`${t}-start`)}(t);const s=n.apply(this,arguments);return function(t){const s=performance.measure(t,`${t}-start`);if(!s)return;const i=s.duration;i>=Qs&&csArray.prototype.push.call(ii,{mName:t,mDuration:+i.toFixed(2)}),csArray.prototype.pop.call(si),0===si.length&&(i>Ys&&Xs.add(ii),ii=[])}(t),s}}};function ni(t){const s=csEventtarget.apply(t);return s&&u(s)&&csElementshadowRoot.apply(s)&&t.composedPath?t.__csOriginalTarget||t.composedPath()[0]:s}function ri(){return(t,s,i)=>{const e=i.value;i.value=function(t,s){!1===(null==t?void 0:t.isTrusted)&&ri.enabled||e.call(this,t,s)}}}ri.enabled=!0;const hi=!!window.chrome,oi="data-cs-scroll-container";var ci,ai;!function(t){t.isEventOnScrollContainer=function(t){return!!(Pt(t)&&function(t){try{if(Pt(csEventtarget.apply(t)))return!0}catch{}return!1}(t)&&Vt(csEventtarget.apply(t))&&null!==csEventtarget.apply(t).getAttribute(oi))},t.getScrollContainer=function(){return window.csquerySelector[document.nodeType].call(document,`[${oi}]`)}}(ci||(ci={}));ai=Mt.Element;const ui=window.csElementmatches||window.csElementmatchesSelector||window.csElementmozMatchesSelector||window.csElementmsMatchesSelector||window.csElementoMatchesSelector||window.csElementwebkitMatchesSelector,li=document.createElement("div");const di=function(){const t=csSymbol.for("propStore");return{getStore:s=>s[t],get(s,i){const e=s[t];return null==e?void 0:e[i]},set(s,i,e){let n=s[t];n||(n={},s[t]=n),n[i]=e}}}();var fi,wi;!function(t){function s(t,i,e){let n=!1;if(e(t,i,(()=>n=!0)),n)return;const r=t.children;if(null==r?void 0:r.length)for(const i of r)if(s(i,t,e),n)break}t.setProperty=function(t,s,i){var e;t instanceof Node?di.set(t,s,i):(null!==(e=t.props)&&void 0!==e||(t.props={}),t.props[s]=i)},t.getProperty=function(t,s){var i;return t instanceof Node?di.get(t,s):null===(i=t.props)||void 0===i?void 0:i[s]},t.getProperties=function(t){return t instanceof Node?di.getStore(t):t.props},t.traverse=function(t,i){s(t,void 0,i)}}(fi||(fi={})),function(t){let s;!function(t){t[t.NotSensitive=0]="NotSensitive",t[t.Parent=1]="Parent",t[t.Child=2]="Child"}(s=t.SensitiveState||(t.SensitiveState={})),t.sensitiveProp="sensitive",t.sensitiveAttributeProp="sensitiveAttribute",t.getSensitiveDetails=function(i){var e;return null!==(e=fi.getProperty(i,t.sensitiveProp))&&void 0!==e?e:{state:s.NotSensitive}},t.getAttributeSensitiveDetails=function(s){var i;return null!==(i=fi.getProperty(s,t.sensitiveAttributeProp))&&void 0!==i?i:{attributes:[]}},t.isSensitive=function(i){const e=fi.getProperty(i,t.sensitiveProp);return(null==e?void 0:e.state)===s.Parent},t.isSensitiveChild=function(i){const e=fi.getProperty(i,t.sensitiveProp);return(null==e?void 0:e.state)===s.Child},t.isSensitiveAttribute=function(s,i){const e=fi.getProperty(s,t.sensitiveAttributeProp);return(null==(null==e?void 0:e.attributes)?void 0:csArray.prototype.indexOf.call(null==e?void 0:e.attributes,i))>-1},t.setSensitiveProperty=function(s,i){fi.setProperty(s,t.sensitiveProp,i)},t.unsetSensitiveProperty=function(s){fi.setProperty(s,t.sensitiveProp,void 0)},t.setSensitiveAttributeProperty=function(s,i){fi.setProperty(s,t.sensitiveAttributeProp,i)},t.getComputedAttributeSelector=function(t){let s="";return csArray.prototype.forEach.call(t,(t=>{const i=csString.prototype.split.call(t.selector,",");csArray.prototype.forEach.call(i,(t=>{(function(t){if(!t||!St(t))return ss.warn(`isValidSelector: invalid selector provided '${t}'`),!1;try{return ui.call(li,t),!0}catch{return ss.warn(`isValidSelector: invalid selector provided '${t}'`),!1}})(t)&&(s&&(s+=","),s+=t)}))})),s}}(wi||(wi={}));let pi=1;const mi="nodeIdentifier";function yi(t){return fi.getProperty(t,mi)}function Ai(t){const s=fi.getProperty(t,mi);return null!=s?s:(fi.setProperty(t,mi,pi++),fi.getProperty(t,mi))}function gi(t){const s=document.createTreeWalker(t,NodeFilter.SHOW_ALL);let i=s.root;for(;i;)fi.setProperty(i,mi,null),i=s.nextNode()}function Ei(t,s){const i=document.createTreeWalker(t,NodeFilter.SHOW_ALL,(t=>(null==s?void 0:s.get(t))?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT),!1);let e=i.root;for(;e;){if(Ai(e),u(e)&&csElementshadowRoot.apply(e))Ei(csElementshadowRoot.apply(e));else if(R(e))for(const t of vi)t(e);e=i.nextNode()}}let vi=[];function _i(t){csArray.prototype.push.call(vi,t)}class Ri{constructor(){this.Ds=new Set,this.Us=[],this.zs=[{type:"pointerup",listener:t=>this.pointerUpListener(t),boundElement:document},{type:"pointermove",listener:t=>this.pointerMoveListener(t),boundElement:document},{type:"pointerdown",listener:t=>this.pointerDownListener(t),boundElement:document}],this.Hs=[{type:"touchstart",listener:t=>this.touchStartListener(t),boundElement:document},{type:"touchmove",listener:t=>this.touchMoveListener(t),boundElement:document},{type:"touchend",listener:t=>this.touchEndCancelListener(t),boundElement:document},{type:"touchcancel",listener:t=>this.touchEndCancelListener(t),boundElement:document}],this.Fs=[{type:"click",listener:t=>this.clickListener(t),boundElement:document},{type:"keyup",listener:t=>this.keyUpListener(t),boundElement:document},{type:"keydown",listener:t=>this.keyDownListener(t),boundElement:document},{type:"copy",listener:t=>this.copyListener(t),boundElement:document},{type:"cut",listener:t=>this.cutListener(t),boundElement:document},{type:"paste",listener:t=>this.pasteListener(t),boundElement:document},{type:"scroll",listener:t=>this.scrollListener(csEventtarget.apply(t)),boundElement:document},{type:"mouseover",listener:t=>this.mouseOverListener(t),boundElement:document}],this.Bs=[{type:"scroll",listener:t=>this.scrollListener(csEventtarget.apply(t))}];const t=function(t){if(!St(t))return null;const s=/iP(ad|hone|od).+Version\/(\d+)\..*Safari/i.exec(t);return s?Number(s[2]):null}(window.navigator.userAgent);(null===t||t&&t>=16)&&csArray.prototype.push.call(this.Bs,{type:"mouseover",listener:t=>this.mouseOverListener(t)})}init(){this.qs(),this.js(),this.Gs(),this.Zs()}Zs(){_i((t=>this.Ws(t)))}onEvent(t){csArray.prototype.push.call(this.Us,t)}Js(t,s=!1){csArray.prototype.forEach.call(this.Us,(i=>i(t,s)))}start(){this.Ks()}stop(){this.Xs()}js(){this.Ys()&&csArray.prototype.push.call(this.Fs,...this.zs)}qs(){this.Qs()&&csArray.prototype.push.call(this.Fs,...this.Hs)}Ws(t){T(t)?csArray.prototype.forEach.call(this.Fs,(t=>Zs(t))):this.Ds.has(t)||(this.Ds.add(t),csArray.prototype.forEach.call(this.Bs,(s=>{const i=s;i.boundElement=t,Zs(i)})))}ti(t){T(t)?csArray.prototype.forEach.call(this.Fs,(t=>Ws(t))):(this.Ds.delete(t),csArray.prototype.forEach.call(this.Bs,(s=>{const i=s;i.boundElement=t,Ws(i)})))}Ys(){return"PointerEvent"in window&&"function"==typeof window.PointerEvent}Qs(){return"TouchEvent"in window&&"function"==typeof window.TouchEvent}Xs(){this.ti(document),this.Ds.forEach((t=>this.ti(t)))}Ks(){this.si()}si(){const t=ci.getScrollContainer()||document,s=yi(t);if(!s)return;const i=this.ii(t);if(0!==i.top||0!==i.left){const t={type:Bs.SCROLL,args:[s,i.left,i.top],date:yt.now()};this.Js(t,!0)}}ii(t){return t===document?{top:window.pageYOffset,left:window.pageXOffset}:{top:t.scrollTop,left:t.scrollLeft}}scrollListener(t){if(wi.isSensitive(t)||wi.isSensitiveChild(t))return;const s=yi(t);if(!s)return;const i=this.ii(t),e={type:Bs.SCROLL,args:[s,i.left,i.top],date:yt.now()};this.Js(e)}mouseOverListener(t){if(wi.isSensitiveChild(t.target))return;const s=yi(t.target);if(!s)return;const i={type:Bs.MOUSE_OVER,args:[s],date:yt.now()};this.Js(i)}clickListener(t){const s=ni(t);if(wi.isSensitiveChild(s))return;const i=yi(s);if(!i)return;const e={type:Bs.CLICK,args:[i],date:yt.now()};this.Js(e)}keyUpListener(t){const s=ni(t);if(wi.isSensitiveChild(s))return;const i=yi(s);if(!i)return;const e=this.ei[t.key];if(void 0===e)return;const n={type:Bs.KEY_UP,args:[i,e],date:yt.now()};this.Js(n)}keyDownListener(t){const s=ni(t);if(wi.isSensitiveChild(s))return;const i=yi(s);if(!i)return;const e=this.ei[t.key];if(void 0===e)return;const n={type:Bs.KEY_DOWN,args:[i,e],date:yt.now()};this.Js(n)}copyListener(t){const s=ni(t);if(wi.isSensitiveChild(s))return;const i=yi(s);if(!i)return;const e={type:Bs.CLIPBOARD_COMMAND,args:[i,Ks.COPY],date:yt.now()};this.Js(e)}cutListener(t){const s=ni(t);if(wi.isSensitiveChild(s))return;const i=yi(s);if(!i)return;const e={type:Bs.CLIPBOARD_COMMAND,args:[i,Ks.CUT],date:yt.now()};this.Js(e)}pasteListener(t){const s=ni(t);if(wi.isSensitiveChild(s))return;const i=yi(s);if(!i)return;const e={type:Bs.CLIPBOARD_COMMAND,args:[i,Ks.PASTE],date:yt.now()};this.Js(e)}pointerUpListener(t){const s=ni(t);if(wi.isSensitiveChild(s))return;const i=yi(s);if(!i)return;const e={type:Bs.POINTER_UP,args:[t.pointerId,t.pointerType,Hs(t.clientX,1),Hs(t.clientY,1),i,t.button],date:yt.now()};this.Js(e)}pointerMoveListener(t){const s={type:Bs.POINTER_MOVE,args:[t.pointerId,t.pointerType,Hs(t.clientX,1),Hs(t.clientY,1)],date:yt.now()};this.Js(s)}pointerDownListener(t){const s=ni(t);if(wi.isSensitiveChild(s))return;const i=yi(s);if(!i)return;const e={type:Bs.POINTER_DOWN,args:[t.pointerId,t.pointerType,Hs(t.clientX,1),Hs(t.clientY,1),i,t.button,{pageX:Hs(t.pageX,1),pageY:Hs(t.pageY,1)}],date:yt.now()};this.Js(e)}touchStartListener(t){if(!t.changedTouches)return;const{changedTouches:s}=t;for(let t=0;tcsArray.prototype.push.call(i,t))),i}function Vi(t,s){if(t.length>=0){const i=t.length;for(let e=0;ecsArray.prototype.push.call(s,t))),s}es([ei("RecordingPageEvents.start")],Ri.prototype,"start",null),es([is("scroll")],Ri.prototype,"scrollListener",null),es([is("mouseOver"),ri(),(t,s,i)=>{const e=i.value;return e&&(i.value=function(t){if(ni(t)===csEventtarget.apply(t))return e.call(this,t)}),i}],Ri.prototype,"mouseOverListener",null),es([is("click"),ri()],Ri.prototype,"clickListener",null),es([is("Event handler type: keyup")],Ri.prototype,"keyUpListener",null),es([is("Event handler type: keydown")],Ri.prototype,"keyDownListener",null),es([is("Event handler type: copy")],Ri.prototype,"copyListener",null),es([is("Event handler type: cut")],Ri.prototype,"cutListener",null),es([is("Event handler type: paste")],Ri.prototype,"pasteListener",null),es([is("Event handler type: pointerup"),ri()],Ri.prototype,"pointerUpListener",null),es([is("Event handler type: pointermove"),ri(),(Si={wait:33,ignoreThrottledCalls:!1},(t,s,i)=>{i.value=Fs(i.value,Si)})],Ri.prototype,"pointerMoveListener",null),es([is("Event handler type: pointerdown"),ri()],Ri.prototype,"pointerDownListener",null),es([is("Event handler type: touchstart"),ri()],Ri.prototype,"touchStartListener",null),es([is("Event handler type: touchmove"),ri()],Ri.prototype,"touchMoveListener",null),es([is("Event handler type: touchend-cancel"),ri()],Ri.prototype,"touchEndCancelListener",null);class Oi{constructor(){this.ni=0}get length(){return this.ni}get isEmpty(){return!this.hi}pushAll(t){for(let s=0;s{if(Ui!==i)return;const t=()=>{for(;!Di.isEmpty;){Di.pop()()}for(;!Mi.isEmpty;){Mi.pop()()}Di.isEmpty||t()};t()})),"high"===s?Di.push(t):Mi.push(t)}function Hi(t,s=10){$i(0===s?t:()=>Hi(t,s-1))}class Fi{constructor(t,s,i,e,n=document){this.ci=t,this.ai=s,this.ui=i,this.li=e,this.fi=n,this.wi=!1,this.pi=t=>{this.ui.emitInitialDomDone(t)},this.mi=t=>{const s=yi(t.target);if(!s)return;const i={args:[s,null,"style",`width:${t.width}px !important;height:${t.height}px !important;`],date:yt.now(),type:Bs.MUTATION_ATTRIBUTE};this.yi(i)},this.ai.onCharacterDataMutation((t=>{this.Ai(t)})),this.ai.onAttributesMutation((t=>{this.gi(t)})),this.ai.onChildListMutation(((t,s)=>{Vi(t.addedNodes,(t=>{Ei(t,s)})),this.Ei(t,s),Vi(t.removedNodes,(t=>{this.li.unidentifySensitiveNodes(t)}))})),this.ai.onAttachShadowMutation((t=>{t.target.isConnected&&null!==csElementshadowRoot.apply(t.target)&&(Ei(csElementshadowRoot.apply(t.target)),zi((()=>this._i(t))))})),this.li.onSensitiveElementResize(this.mi)}onEvent(t){this.yi=t}isStarted(){return this.wi}start(){this.isStarted()||(this.wi=!0,this.ai.start(),this.Ri())}stop(){this.isStarted()&&(this.wi=!1,this.li.unidentifyAllSensitiveNodes(),this.ai.stop())}flushEvents(){this.ai.flushPendingMutations()}Ri(){this.ui.emitInitialDomStart(),this.li.identifySensitiveNodes(),Ei(this.fi),this.ci.serializeInitialDom(this.fi,this.pi)}_i(t){if(wi.isSensitive(t.target)||wi.isSensitiveChild(t.target))return;const s=this.ci.serializeAttachShadowEvent(t);if(!s)return;const i={args:s,date:t.date,type:Bs.ATTACH_SHADOW};this.yi(i)}gi(t){if(wi.isSensitiveChild(t.target)||wi.isSensitiveAttribute(t.target,t.attributeName))return;const s=this.ci.serializeMutationAttribute(t);if(!s)return;const i={args:s,date:t.date,type:Bs.MUTATION_ATTRIBUTE};this.yi(i)}Ai(t){const s=t.target.parentElement;if(s&&(wi.isSensitive(s)||wi.isSensitiveChild(s)))return;const i=this.ci.serializeMutationCharacterData(t);if(!i)return;const e={args:i,date:t.date,type:Bs.MUTATION_CHARACTER_DATA};this.yi(e)}Ei(t,s){if(wi.isSensitive(t.target)||wi.isSensitiveChild(t.target))return;const i=this.ci.serializeMutationChildList(t,s);if(!i)return;const{removedNodes:e,addedNodes:n}=i;csArray.prototype.forEach.call(e,(s=>{const i={args:s,date:t.date,type:Bs.MUTATION_REMOVE};this.yi(i)})),csArray.prototype.forEach.call(n,(s=>{const i={args:s,date:t.date,type:Bs.MUTATION_INSERT};this.yi(i)}))}}class Bi{constructor(t){this.Si=t,this.Ti=0}addString(t){this.Ti+=2*t.length}addArrayBuffer(t){this.Ti+=t.byteLength}isThresholdReached(){return this.Ti>this.Si}reset(){this.Ti=0}}class qi{constructor(t=[],s=512e3){this.Ii=t,this.Pi=new Bi(s)}addEvent(t){this.Pi.addString(tt(t)),csArray.prototype.push.call(this.Ii,t)}addEventByTimestamp(t){let s=0;for(;s=t.date)break}csArray.prototype.splice.call(this.Ii,s,0,t)}eventsCount(){return this.Ii.length}clearEvents(){this.Pi.reset(),this.Ii=[]}isFull(){return this.eventsCount()>=200}isThresholdReached(){return this.Pi.isThresholdReached()}getEvents(){return this.Ii}extractEvents(...t){const s=[],i=[];return csArray.prototype.forEach.call(this.Ii,(e=>{-1!==csArray.prototype.indexOf.call(t,e.type)?csArray.prototype.push.call(s,e):csArray.prototype.push.call(i,e)})),this.Ii=i,s}stringifyEvents(){return tt(this.Ii)}bi(t){t.type===Bs.INITIAL_DOM&&(window.CSDomSerialized=window.CSDomSerialized?window.CSDomSerialized+1:1)}}es([ei("RecordingBatch.addEvent")],qi.prototype,"addEvent",null);class ji{constructor(){this.Vi=1}getCurrentIndex(){return this.Vi}increment(){this.Vi+=1}reset(){this.Vi=1}getRequestParameters(){return{ri:`${this.Vi}`}}}class Gi{emit(t,s,i,e=document){const n=`${void 0!==i?`${i}`:`${Gi.Ci}`}${t}`,r=Gi.createEvent(n,{detail:s});null!==r&&e.dispatchEvent(r)}static createEvent(t,s={}){if("function"==typeof CustomEvent)return new CustomEvent(t,s);const i=this.Ni();if(null===i)return null;const{bubbles:e=!1,cancelable:n=!1,detail:r}=s;return i.initCustomEvent(t,e,n,r),i}static Ni(){try{return document.createEvent("CustomEvent")}catch{return null}}}Gi.Ci="cs.tracking.";class Zi{constructor(){this.isStarted=!1}start(...t){this.isStarted||(this.isStarted=!0,this.onStart(...t))}stop(){this.isStarted&&(this.isStarted=!1,this.onStop())}restart(){this.stop(),this.start()}}class Wi{constructor(t){this.type="asyncEvent",this.ki=!1,t&&t((t=>this.resolve(t)))}resolve(t){if(this.ki)throw new Error("AsyncEvent already resolve.");null==t.timestamp&&(t={...t,timestamp:this.timestamp}),this.Oi=t,this.ki=!0,this.Is&&this.Is(this.Oi)}complete(t){this.ki&&t(this.Oi),this.Is=t}wait(){return new Promise((t=>this.complete(t)))}}class Ji{constructor(t){this.Is=t,this.$i=new Oi,this.xi=!1}onEvent(t){if(this.Is)throw new Error("callback already set");return this.Is=t,this}push(t){this.$i.push(t),this.Li()}static pipe(t,s){let i=t;for(const t of s){const s=new Ji((s=>{t.pushEvent(s)}));Vi(i,(t=>t.subscribe((t=>s.push(t))))),i=[t]}const e=new Ji;return Vi(i,(t=>t.subscribe((t=>e.push(t))))),e}Li(){if(this.xi)return;if(this.xi=!0,!this.Is)throw new Error("callback not set");const t=this.$i.pop(),s=t=>{this.Is(t),this.xi=!1,this.$i.isEmpty||this.Li()};t instanceof Wi?t.complete(s):s(t)}}class Ki{constructor(t,s=[]){this.producers=t,this.processors=s,this.wi=!1,this.Mi=[],this.Di=t=>csArray.prototype.forEach.call(this.Mi,(s=>s(t)))}start(){if(this.wi)throw new Error("Recording is already started.");Ji.pipe(this.producers,this.processors).onEvent(this.Di),Vi(this.producers,(t=>t.start())),Vi(this.processors,(t=>t.start())),this.wi=!0}stop(){for(const t of this.producers)t.stop();for(const t of this.processors)t.stop();this.wi=!1,this.Mi=[]}subscribe(t){if(this.wi)throw new Error("Recording is already started.");return csArray.prototype.push.call(this.Mi,t),()=>this.Mi=csArray.prototype.filter.call(this.Mi,(s=>s!==t))}}function Xi(t,s,i,e){var n,r=arguments.length,h=r<3?s:null===e?e=Object.getOwnPropertyDescriptor(s,i):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,s,i,e);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(h=(r<3?n(h):r>3?n(s,i,h):n(s,i))||h);return r>3&&h&&Object.defineProperty(s,i,h),h}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var Yi,Qi,te,se,ie,ee,ne,re;!function(t){function s(){const t=[e()];return document.documentElement&&csArray.prototype.push.call(t,document.documentElement.scrollHeight,document.documentElement.offsetHeight,document.documentElement.clientHeight),document.body&&csArray.prototype.push.call(t,document.body.scrollHeight,document.body.offsetHeight),Math.max(...t)}function i(){return document.documentElement.scrollWidth}function e(){return window.innerHeight}function n(){return window.innerWidth}function r(){const t=window.csScreen.width;return Rt(t)&&t>0?t:window.screen.width}function h(){const t=window.csScreen.height;return Rt(t)&&t>0?t:window.screen.height}t.documentHeight=s,t.documentWidth=i,t.windowHeight=e,t.windowWidth=n,t.screenWidth=r,t.screenHeight=h,t.windowOffsetX=function(){return window.pageXOffset},t.windowOffsetY=function(){return window.pageYOffset},t.getRequestParameters=function(){return{dw:`${i()}`,dh:`${s()}`,ww:`${n()}`,wh:`${e()}`,sw:`${r()}`,sh:`${h()}`}}}(Yi||(Yi={}));class he{constructor(t){this.Is=t,this.Ui={boundElement:window,type:"resize",listener:()=>this.resizeListener()},this.Is=t}observe(){Zs(this.Ui),this.Ks()}Ks(){this.resizeListener()}disconnect(){Ws(this.Ui)}resizeListener(){const t={width:Yi.windowWidth(),height:Yi.windowHeight()};this.Is(t)}}Xi([is("resize")],he.prototype,"resizeListener",null),function(t){t.PORTRAIT="Portrait",t.LANDSCAPE="Landscape"}(Qi||(Qi={})),function(t){t.PORTRAIT_PRIMARY="portrait-primary",t.PORTRAIT_SECONDARY="portrait-secondary",t.LANDSCAPE_PRIMARY="landscape-primary",t.LANDSCAPE_SECONDARY="landscape-secondary"}(te||(te={})),function(t){t[t.PORTRAIT=0]="PORTRAIT",t[t.PORTRAIT_REVERSE=180]="PORTRAIT_REVERSE",t[t.LANDSCAPE=-90]="LANDSCAPE",t[t.LANDSCAPE_REVERSE=90]="LANDSCAPE_REVERSE"}(se||(se={})),function(t){function s(){return"orientation"in screen}function i(){return"orientation"in window}t.isScreenOrientationApiSupported=s,t.isDeprecatedScreenOrientationApiSupported=i;const e=s()?function(){switch(screen.orientation.type){case te.PORTRAIT_PRIMARY:case te.PORTRAIT_SECONDARY:return Qi.PORTRAIT;case te.LANDSCAPE_PRIMARY:case te.LANDSCAPE_SECONDARY:return Qi.LANDSCAPE;default:return Qi.PORTRAIT}}:i()?function(){switch(window.orientation){case se.PORTRAIT:case se.PORTRAIT_REVERSE:return Qi.PORTRAIT;case se.LANDSCAPE:case se.LANDSCAPE_REVERSE:return Qi.LANDSCAPE;default:return Qi.PORTRAIT}}:function(){return Qi.LANDSCAPE};t.getCurrentOrientation=function(){return e()}}(ie||(ie={}));class oe{constructor(){this.zi=[]}produceEvent(t){var s;null!==(s=t.timestamp)&&void 0!==s||(t.timestamp=yt.now()),csArray.prototype.forEach.call(this.zi,(s=>s(t)))}stop(){this.zi=[]}subscribe(t){return csArray.prototype.push.call(this.zi,t),()=>{const s=csArray.prototype.indexOf.call(this.zi,t);csArray.prototype.splice.call(this.zi,s,1)}}}class ce extends oe{constructor(){super(...arguments),this.Hi=null,this.Fi=null,this.Bi=new he((t=>{this.produceEvent({...t,type:"viewportResize"}),this.onScreenPotentiallyChanged()}))}onScreenPotentiallyChanged(){const t=ie.getCurrentOrientation(),{screenWidth:s,screenHeight:i}=this.qi(t);if(s!==this.Hi||i!==this.Fi){this.Hi=s,this.Fi=i;const t={type:"screenResize",width:s,height:i};this.produceEvent(t)}}qi(t){let s,i;const e=Yi.screenWidth(),n=Yi.screenHeight();return t===Qi.PORTRAIT?(s=e,i=n):(s=Math.max(e,n),i=Math.min(e,n)),{screenWidth:s,screenHeight:i}}start(){this.Bi.observe()}stop(){super.stop(),this.Hi=null,this.Fi=null,this.Bi.disconnect()}}!function(t){t.isNavigationTimingObserverSupported=function(){var t,s;return(null==(null===(t=window.PerformanceObserver)||void 0===t?void 0:t.supportedEntryTypes)?void 0:csArray.prototype.indexOf.call(null===(s=window.PerformanceObserver)||void 0===s?void 0:s.supportedEntryTypes,"navigation"))>=0},t.getTimeOrigin=function(){return window.performance.timeOrigin}}(ee||(ee={}));class ae{static ji(){return new window.PerformanceObserver((t=>ae.Gi(t)))}static Gi(t){const s=t.getEntriesByType("navigation")[0];s&&(this.Zi=s,ae.Wi(s))}static Ji(t){ae.Ki(t),ae.Zi&&t(ae.Zi),ae.Xi||ae.Yi()}static Ki(t){ae.Mi.add(t)}static Qi(t){ae.Mi.delete(t)}static Yi(){if(!ae.te)return ae.Zi||(ae.Zi={requestStart:window.performance.timing.requestStart,domInteractive:window.performance.timing.domInteractive}),void ae.Wi(ae.Zi);ae.te.observe({type:"navigation",buffered:!0}),ae.Xi=!0}static Wi(t){ae.Mi.forEach((s=>{s(t)}))}static se(t){ae.Qi(t),0===ae.Mi.size&&ae.ie()}static ie(){var t;ae.Xi&&(null===(t=ae.te)||void 0===t||t.disconnect(),ae.Xi=!1,ae.Zi=null,ae.te=this.ji())}constructor(t){this.Is=t}observe(){ae.Ji(this.Is)}disconnect(){ae.se(this.Is)}}ae.te=ee.isNavigationTimingObserverSupported()?ae.ji():null,ae.Xi=!1,ae.Mi=new Set,ae.Zi=null;class ue extends oe{constructor(){super(...arguments),this.wi=!1,this.ee=null,this.ne=new ae((t=>{if(this.ee)return;const s=this.re(t);s&&(this.ee=s,this.produceEvent(s))}))}start(){this.wi||(this.wi=!0,this.ee?this.produceEvent(this.ee):this.ne.observe())}stop(){this.wi&&(this.wi=!1,this.ne.disconnect(),super.stop())}re(t){const s=ee.getTimeOrigin();return{type:"PerformanceTiming",timings:{timeOrigin:s,requestStart:Math.floor(s+t.requestStart),domInteractive:Math.floor(s+t.domInteractive)},timestamp:yt.now()}}}function le(){const t=new Set;return{add:function(s){t.add(s),1===t.size&&setTimeout((()=>{t.clear()}))},has:function(s){return t.has(s)},del:function(s){t.delete(s)},values:()=>ki(t),get count(){return t.size}}}function de(t,s=pe.SHOW_ALL){const i=s|pe.SHOW_ELEMENT,e=[document.createTreeWalker(t,i,null,!1)];let n=fe(t);n&&csArray.prototype.push.call(e,document.createTreeWalker(n,i,null,!1));let r=null;return{root:t,nextNode(){if(n){const t=n;return n=null,t}for(;e.length>0;){if(r){const t=r;return r=null,t}const t=e[e.length-1].nextNode();if(!t){csArray.prototype.pop.call(e);continue}const n=fe(t);if(s&pe.SHOW_DOCUMENT_FRAGMENT&&n&&(r=n),n&&csArray.prototype.push.call(e,document.createTreeWalker(n,i,null,!1)),me[t.nodeType]&s)return t}return null},visitAll(i){me[t.nodeType]&s&&i(t);let e=this.nextNode();for(;e;)i(e),e=this.nextNode()},collectAll(t){const s=[];return this.visitAll((i=>csArray.prototype.push.call(s,t?t(i):i))),s}}}function fe(t){return t&&P(t)?t.shadowRoot:null}const we=null!==(ne=Mt.Node)&&void 0!==ne?ne:{},pe=null!==(re=Mt.NodeFilter)&&void 0!==re?re:{},me={2:pe.SHOW_ATTRIBUTE,4:pe.SHOW_CDATA_SECTION,8:pe.SHOW_COMMENT,11:pe.SHOW_DOCUMENT_FRAGMENT,9:pe.SHOW_DOCUMENT,10:pe.SHOW_DOCUMENT_TYPE,1:pe.SHOW_ELEMENT,[we.ENTITY_NODE]:pe.SHOW_ENTITY,[we.ENTITY_REFERENCE_NODE]:pe.SHOW_ENTITY_REFERENCE,[we.NOTATION_NODE]:pe.SHOW_NOTATION,7:pe.SHOW_PROCESSING_INSTRUCTION,3:pe.SHOW_TEXT};var ye;function Ae(){const t=new Error;let s=t.stack?csArray.prototype.filter.call(csString.prototype.split.call(t.stack,"\n"),(t=>"Error"!==t&&-1===csString.prototype.indexOf.call(csString.prototype.toLowerCase.call(t),"promise ")&&-1===csString.prototype.indexOf.call(t,"[native code]"))):[];if(0===s.length)return"";const i=function(t){return t.length>0?ge(t[0]):""}(s);return""===i?"":(s=function(t,s){return csArray.prototype.filter.call(t,(t=>-1===csString.prototype.indexOf.call(t,s)))}(s,i),0===s.length?"":ge(s[0]))}function ge(t){let s,i="";var e;e=t,s=-1!==csString.prototype.indexOf.call(e,"@")?new RegExp("@(.+):(\\d+):(\\d+)$"):new RegExp("\\((.+):(\\d+):(\\d+)\\)");const n=s.exec(t);return n&&(i=n[1]),i}!function(t){t.isSupported=function(){return!!Element.prototype.attachShadow},t.getShadowRoot=function(t){return t&&P(t)?t.shadowRoot:null},t.getAllShadowHosts=function(t){return de(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).collectAll((t=>t.host))}}(ye||(ye={}));const Ee=t=>t;function ve({target:t,methodName:s,hook:i,hookPrepareArgs:e=Ee,options:n}){var r;if(!(null===(r=Object.getOwnPropertyDescriptor(t,s))||void 0===r?void 0:r.writable))return ss.warn(`Cannot intercept read only function '${csString(s)}' of object '${t}'`),null;let h=!1;const o=t[s];if("function"==typeof o){const r=function(){const t=e(arguments),s=o.apply(this,arguments);if(h){let e;n&&n.withCallerName&&(e=Ae());try{i({result:s,context:this,args:t,callerName:e})}catch(t){ss.error(t)}}return s};a=o,(c=r).prototype=a.prototype,Object.defineProperty(c,"toString",{value:()=>a.toString()}),t[s]=r}var c,a;return{activate:()=>h=!0,deactivate:()=>h=!1}}function _e(t,s,i){let e=!1;const n=Object.getOwnPropertyDescriptor(t,s);if(n){if(!n.configurable)return ss.warn(`Cannot intercept read only property '${csString(s)}' of object '${t}'`),null;const r=function(){return n.get.apply(this,arguments)},h=function(){const t=arguments,s=n.set.apply(this,t);if(e)try{i(this,t[0])}catch(t){ss.error(t)}return s};Object.defineProperty(t,s,{...n.get?{get:r}:{},...n.set?{set:h}:{}})}return{activate:()=>e=!0,deactivate:()=>e=!1}}var Re,Se;class Te{static he(t){this.Ds.forEach((s=>{t(s,"initial")}))}static Ji(t){if(csArray.prototype.push.call(this.oe,t),!this.wi){this.wi=!0;const t={childList:!0,subtree:!0};this.ce.observe(document,t);for(const s of ye.getAllShadowHosts(document))this.Ds.add(csElementshadowRoot.apply(s)),this.ce.observe(document,t);this.ae||(this.ae=ve({target:Element.prototype,methodName:"attachShadow",hook:t=>t.result.isConnected&&this.ue(t.result)})),this.ae.activate()}this.he(t)}static se(t){var s;this.oe=csArray.prototype.filter.call(this.oe,(s=>s!==t)),0===this.oe.length&&(this.oe=[],this.wi=!1,this.ce.disconnect(),null===(s=this.ae)||void 0===s||s.deactivate(),this.Ds.clear())}constructor(t){this.Is=t}get shadowRoots(){return ki(Re.Ds)}observe(){ye.isSupported()&&Re.Ji(this.Is)}disconnect(){ye.isSupported()&&Re.se(this.Is)}}Re=Te,Te.oe=[],Te.Ds=new Set,Te.wi=!1,Te.ce=new csMutationObserver((t=>{Pi(t,(t=>t.addedNodes),Re.le),Pi(t,(t=>t.removedNodes),(t=>{de(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).visitAll((t=>Re.Ds.delete(t)))}))})),Te.ue=t=>{Re.Ds.has(t)||(Re.Ds.add(t),Vi(Re.oe,(s=>s(t,"added"))))},Te.le=t=>{de(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).visitAll(Re.ue)};const Ie={childList:!0,subtree:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,attributeOldValue:!0};class Pe{static observe(t,s){csArray.prototype.push.call(this.callbacks,t),s&&csArray.prototype.push.call(this.shadowRootCallbacks,s),this.started?s&&csArray.prototype.forEach.call(ye.getAllShadowHosts(document),(t=>s(csElementshadowRoot.apply(t),"initial"))):(this.mutationObsever=new csMutationObserver((t=>{csArray.prototype.forEach.call(this.callbacks,(s=>s(t,this.mutationObsever)))})),this.mutationObsever.observe(document,Ie),this.shadowRootObserver=new Te(this.onShadowRoot),this.shadowRootObserver.observe(),this.started=!0,Vi(this.shadowRootObserver.shadowRoots,(t=>this.mutationObsever.observe(t,Ie))))}static disconnect(t,s){var i,e;this.callbacks=csArray.prototype.filter.call(this.callbacks,(s=>s!==t)),s&&(this.shadowRootCallbacks=csArray.prototype.filter.call(this.shadowRootCallbacks,(t=>t!==s))),0===this.callbacks.length&&(this.callbacks=[],this.shadowRootCallbacks=[],null===(i=this.shadowRootObserver)||void 0===i||i.disconnect(),null===(e=this.mutationObsever)||void 0===e||e.disconnect(),this.started=!1)}constructor(t,s){this.Is=t,this.de=s}get shadowRoots(){var t,s;return null!==(s=null===(t=Se.shadowRootObserver)||void 0===t?void 0:t.shadowRoots)&&void 0!==s?s:[]}observe(){Se.observe(this.Is,this.de)}disconnect(){Se.disconnect(this.Is,this.de)}}Se=Pe,Pe.callbacks=[],Pe.shadowRootCallbacks=[],Pe.started=!1,Pe.mutationObsever=new csMutationObserver((t=>{csArray.prototype.forEach.call(Se.callbacks,(s=>s(t,Se.mutationObsever)))})),Pe.onShadowRoot=(t,s)=>{Vi(Se.shadowRootCallbacks,(i=>i(t,s))),"removed"!==s&&Se.mutationObsever.observe(t,Ie)};class be{get selectors(){return""===this.fe?null:this.fe}constructor(t){this.fe="",this.we=le(),this.pe=t=>{if(""===this.fe)return;const s=[];for(const i of bi(t,(t=>t.addedNodes)))S(i)&&Ni(this.ye(i,this.fe),s);s.length&&this.Is(s)},this.Is=t,this.Ae=new Pe(this.pe)}observe(t){""===this.fe?this.Ae.observe():this.fe+=",",this.fe+=t;const s=this.ye(document,t);s.length&&(Vi(s,(t=>{this.we.add(t)})),this.Is(s))}disconnect(){this.Ae.disconnect(),this.fe=""}ye(t,s){const i=bi(ye.getAllShadowHosts(t),(t=>window.csquerySelectorAll[t.shadowRoot.nodeType].call(t.shadowRoot,s)));return Ni(window.csquerySelectorAll[t.nodeType].call(t,s),i),u(t)&&ui.call(t,s)&&csArray.prototype.push.call(i,t),csArray.prototype.filter.call(i,(t=>!1===this.we.has(t)))}}var Ve,Ce,Ne;!function(t){let s,i;t.ANONYMIZATION_STATUS_PROP="anonymizationStatus",t.CS_CAPTURE_ATTRIBUTE="data-cs-capture",t.ANONMIZATION_WHITELISTED_STATUS="whitelisted",t.start=function(){new be((s=>function(s){Vi(s,(s=>{de(s).visitAll((s=>function(s){fi.setProperty(s,t.ANONYMIZATION_STATUS_PROP,t.ANONMIZATION_WHITELISTED_STATUS)}(s)))}))}(s))).observe(`${i}`)},t.stop=function(){s},t.setWhitelistedElementsSelector=function(t){i=t},t.getWhitelistedElementsSelector=function(){return i},t.isWhitelisted=function(s){return fi.getProperty(s,t.ANONYMIZATION_STATUS_PROP)===t.ANONMIZATION_WHITELISTED_STATUS||u(s)&&s.hasAttribute(t.CS_CAPTURE_ATTRIBUTE)}}(Ve||(Ve={})),function(t){t.REQUEST_START="requestStart",t.DOM_INTERACTIVE="domInteractive",t.TIME_ORIGIN="timeOrigin"}(Ce||(Ce={}));class ke{constructor(t){this.ge=t}start(){this.ge.subscribe((t=>{const s=t,{timestamp:i}=s;switch(s.type){case"Legacy":this.Is(s.originalEvent);break;case"CustomElementRegistration":this.Is({type:Bs.CUSTOM_ELEMENT_REGISTRATION,date:i,args:[s.tagName]});break;case"DomEvent":!function(t,s){const{timestamp:i}=t;switch(t.domEvent){case"initialDOM":{const{initialDOM:e}=t;s({type:Bs.INITIAL_DOM,date:i,args:[e]});break}case"nodesAdded":csArray.prototype.forEach.call(t.nodes,(e=>{s({type:Bs.MUTATION_INSERT,date:i,args:[t.target,t.nextSibling,e]})}));break;case"nodesMoved":s({type:Bs.MUTATION_MOVE,date:i,args:[t.target,t.nextSibling,t.nodesIds]});break;case"nodesRemoved":csArray.prototype.forEach.call(t.nodesIds,(t=>{s({type:Bs.MUTATION_REMOVE,date:i,args:[t]})}));break;case"attributeChanged":{const{target:e,namespace:n,attribute:r,newValue:h}=t;s({type:Bs.MUTATION_ATTRIBUTE,date:i,args:[e,n,r,h]});break}case"characterDataChanged":{const{target:e,newValue:n}=t;s({type:Bs.MUTATION_CHARACTER_DATA,date:i,args:[e,n]});break}case"cssRuleInserted":{const{target:e,rule:n,index:r}=t,h=It(r)?[e,n,r]:[e,n];s({type:Bs.STYLESHEET_RULE_INSERT,date:i,args:h});break}case"cssRuleDeleted":{const{target:e,index:n}=t;s({type:Bs.STYLESHEET_RULE_DELETE,date:i,args:[e,n]});break}case"shadowRootAttached":{const{target:e,shadowRoot:n}=t;s({type:Bs.ATTACH_SHADOW,date:i,args:[e,n]});break}case"adoptedStyleSheetRegistered":{const{sheetId:e,cssRules:n}=t;s({type:Bs.REGISTER_ADOPTED_STYLE_SHEET,date:i,args:[e,n]});break}case"adoptedStyleSheetsSet":{const{target:e,sheetsIds:n}=t;s({type:Bs.SET_ADOPTED_STYLE_SHEETS,date:i,args:[e,n]});break}case"adoptedStyleSheetRuleInserted":{const{sheetId:e,rule:n,index:r}=t,h=It(r)?[e,n,r]:[e,n];s({type:Bs.ADOPTED_STYLESHEET_RULE_INSERT,date:i,args:h});break}case"adoptedStyleSheetRuleDeleted":{const{sheetId:e,index:n}=t;s({type:Bs.ADOPTED_STYLESHEET_RULE_DELETE,date:i,args:[e,n]});break}default:ts.error("translateDOMEvent: DOMEvent not supported")}}(s,this.Is);break;case"TextVisibility":break;case"encryptedCharacterDataChanged":{const{target:t,rawData:e,encryptedData:n,encryptionMetadata:r}=s;this.Is({type:Bs.MUTATION_ENCRYPTED_CHARACTER_DATA,date:i,args:[t,e,n,r]});break}case"StaticResource":{const{url:t}=s;this.Is({type:Bs.STATIC_RESOURCE_URL,date:i,args:[t]});break}case"screenResize":{const{width:t,height:e}=s,n={type:Bs.SCREEN_RESIZE,date:i,args:[t,e]};this.Is(n);break}case"viewportResize":{const{width:t,height:e}=s,n={type:Bs.RESIZE,date:i,args:[t,e]};this.Is(n);break}case"PerformanceTiming":this.Is(function(t){return{type:Bs.PERFORMANCE_TIMINGS,args:[{performanceTiming:Ce.REQUEST_START,timestamp:t.timings.requestStart},{performanceTiming:Ce.DOM_INTERACTIVE,timestamp:t.timings.domInteractive},{performanceTiming:Ce.TIME_ORIGIN,timestamp:t.timings.timeOrigin}],date:t.timestamp}}(s));break;default:ts.error("WebRecorderEventTranslator: Event not supported")}})),this.ge.start()}stop(){this.ge.stop()}onEvent(t){this.Is=t}}class Oe extends oe{constructor(t){super(),this.Ee=t}subscribe(t){return super.subscribe(t)}start(){Vi(this.Ee,(t=>{t.onEvent((t=>this.Di(t)))})),Vi(this.Ee,(t=>{var s;null===(s=t.start)||void 0===s||s.call(t)}))}stop(){Vi(this.Ee,(t=>{var s;return null===(s=t.stop)||void 0===s?void 0:s.call(t)})),super.stop()}Di(t){this.produceEvent({timestamp:yt.now(),type:"Legacy",originalEvent:t})}}!function(t){t.Visible="visible",t.Hidden="hidden",t.Blur="blur",t.PagehideVisible="pagehideVisible",t.PagehideHidden="pagehideHidden"}(Ne||(Ne={}));class $e{constructor(){this.ve=!1,this._e=t=>{try{switch(t.type){case"visibilitychange":if("hidden"===document.visibilityState)return this.Re(Ne.Hidden);break;case"pagehide":return"hidden"===document.visibilityState?this.Re(Ne.PagehideHidden):this.Re(Ne.PagehideVisible);case"blur":return this.Re(Ne.Blur);default:return}}catch{}}}start(){this.ve||(this.ve=!0,this.Se(),this.Te(),this.Ie())}stop(){this.ve&&(this.ve=!1,this.Pe(),this.be(),this.Ve())}onEvent(t){this.Re=t}Se(){document.addEventListener("visibilitychange",this._e)}Pe(){document.removeEventListener("visibilitychange",this._e)}Te(){window.addEventListener("pagehide",this._e)}be(){window.removeEventListener("pagehide",this._e)}Ie(){window.addEventListener("blur",this._e)}Ve(){window.removeEventListener("blur",this._e)}}class xe{constructor(t){this.Is=t,this.Ce=le(),this.Ne=t=>{zi((()=>{for(const s of t)"childList"===s.type&&Vi(s.addedNodes,(t=>{de(t,NodeFilter.SHOW_ELEMENT).visitAll((t=>{this.Ce.has(t)||(this.Ce.add(t),this.Is(t))}))}))}))},this.ke=new Pe(this.Ne)}observe(){this.ke.observe();de(document,NodeFilter.SHOW_ELEMENT).visitAll((t=>{this.Ce.add(t),this.Is(t)}))}disconnect(){this.ke.disconnect()}}class Le extends oe{constructor(){super(),this.Oe="object"==typeof window.customElements&&"function"==typeof window.customElements.whenDefined&&"function"==typeof window.Promise,this.$e=t=>{for(const i of t)wi.isSensitive(i)||wi.isSensitiveChild(i)||u(s=i)&&csString.prototype.indexOf.call(s.tagName,"-")>0&&-1===csString.prototype.indexOf.call(s.tagName,":")&&-1===csString.prototype.indexOf.call(s.tagName,'"')&&-1===csString.prototype.indexOf.call(s.tagName,",")&&csArray.prototype.indexOf.call(b,csString.prototype.toLocaleLowerCase.call(s.tagName))<0&&this.xe(csString.prototype.toLowerCase.call(i.tagName));var s};const t=function(t){const s=le();return{push(i){0===s.count&&setTimeout((()=>{t(s.values())})),s.add(i)}}}(this.$e);this.Le=new xe((s=>t.push(s))),this.Me=new Set}start(){this.Oe&&this.Le.observe()}stop(){this.Me.clear(),this.Le.disconnect(),super.stop()}async xe(t){this.Me.has(t)||(this.Me.add(t),await window.customElements.whenDefined(t),this.produceEvent({type:"CustomElementRegistration",tagName:csString.prototype.toLowerCase.call(t)}))}}class Me{constructor(t,s){this.Di=t,this.De=s,this.Ue=0,this.ze=0,this.He=[]}start(){this.Ue=0,this.He=[],this.ze=0}disconnect(){this.ze=2}Fe(){this.De(1),this.ze=1,setTimeout((()=>{1===this.ze&&this.Be()}),Me.STOP_TIMEOUT)}qe(){this.De(0),this.ze=0,Vi(this.He,this.Di),this.He=[]}Be(){this.He=[],this.De(2),this.ze=2}pushEvent(t,s){if(s.isUserEvent&&(this.Ue=t.date,0!==this.ze))return this.qe(),void this.Di(t);const i=t=>!s.isUserEvent&&this.Ue&&t.date-this.Ue>Me.INACTIVITY_TIMEOUT;switch(this.ze){case 0:if(i(t))return this.Fe(),void csArray.prototype.push.call(this.He,t);this.Di(t);break;case 1:csArray.prototype.push.call(this.He,t)}}}Me.INACTIVITY_TIMEOUT=5e3,Me.STOP_TIMEOUT=5e3;class De extends Zi{constructor(t,s,i,e,n,r,h,o,c,a,u,l,d,f,w,p,m,y,A,g=[],E){super(),this.L=t,this.je=s,this.Ge=i,this.Ze=e,this.We=n,this.Je=r,this.Ke=h,this.Xe=o,this.Ye=c,this.Qe=a,this.J=u,this.tn=l,this.en=d,this.nn=f,this.rn=w,this.hn=p,this.cn=m,this.an=y,this.un=A,this.Ee=g,this.ln=E,this.dn=0,this.fn=0,this.wn=0,this.mn=new Gi,this.yn={allowFromQuotaService:!0,allowFromSerialization:!0},this.An=Fs((()=>{this.je.eventsCount()>0&&this.gn()}),2e3),this.En=t=>this.processBrowserEvent(t),this.vn=t=>this._n(t),this.Rn=0,this.Sn=0,this.Tn=new $e,this.In=!1,this.Pn=51200,this.bn=!1,this.Vn=!1,this.Cn=[],this.Nn=new Me((t=>this.kn(t)),(t=>{switch(t){case 0:this.Je.start();break;case 2:this.Je.stop()}})),this.On=t=>{this.an.removeBatchInProgress(`${t.params.sn}.${t.params.pn}.${t.params.ri}`)},this.ge=new Ki([new Oe(csArray.prototype.filter.call([this.Je,...this.Ee],(t=>t))),new ce,new Le,new ue]),this.$n=new ke(this.ge),this.$n.onEvent(this.En)}init(){this.xn(),this.cn.onLoad(this.On),this.cn.onError(this.On)}xn(){var t,s,i,e;this.Ke.onEvent(this.vn),this.Xe.onEvent(this.vn),this.Ye.onEvent(this.vn),null===(t=this.hn)||void 0===t||t.onTextNodeToEncrypt(this.En),null===(s=this.hn)||void 0===s||s.onApiErrorToEncrypt((t=>{this.Ln(t)})),null===(i=this.hn)||void 0===i||i.onUserIdentifierToEncrypt(this.En),null===(e=this.un)||void 0===e||e.onEvent(this.En),this.Tn.onEvent((t=>t===Ne.Blur?this.Mn():this.In?void 0:(this.In=!0,setTimeout((()=>{this.In=!1})),t===Ne.Hidden?this.Mn():this.Dn())))}isRecording(){return this.J.hasValidSession()&&this.isStarted}Mn(){if(!this.canSendEvents())return;this.an.saveBatchesInProgress(),Vi(this.Ee,(t=>{var s,i;return Vi(null!==(i=null===(s=t.getPendingEvents)||void 0===s?void 0:s.call(t))&&void 0!==i?i:[],(t=>this.je.addEvent(t)))}));const t=this.je.getEvents();if(0===t.length)return;const s=this.cn.getQueryParams();s.rst=this.getRecordingStartTimestamp(),s.let=this.getRecordingLastEventTimestamp();const i=this.Ze.getCurrentIndex();s.ri=i.toString(),this.ln.removeQueryParams(),this.ln.setQueryParams(s),this.Sn=t[t.length-1].date;const e=this.je.stringifyEvents();if(e.length>this.Pn){const t=this.Un();if(t.length>0){const i=tt(t);this.ln.send(i)||this.an.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:i}),this.Ze.increment()}if(this.je.eventsCount()>0){s.ri=this.Ze.getCurrentIndex().toString();const t=this.je.stringifyEvents();this.an.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:t}),this.Ze.increment()}}else{this.ln.send(e)||this.an.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:e}),this.Ze.increment()}this.ln.removeQueryParams(),this.je.clearEvents()}Dn(){if(!this.canSendEvents())return;const t=this.cn.getQueryParams();this.an.saveBatchesInProgress(),t.rst=this.getRecordingStartTimestamp(),delete t.ri,t.hlm="true",this.ln.removeQueryParams(),Vi(this.Ee,(t=>{var s,i;return Vi(null!==(i=null===(s=t.getPendingEvents)||void 0===s?void 0:s.call(t))&&void 0!==i?i:[],(t=>this.je.addEvent(t)))}));const s=this.je.getEvents();if(0===s.length)return delete t.let,delete t.rst,this.ln.setQueryParams(t),this.ln.send(),void this.ln.removeQueryParams();this.Sn=s[s.length-1].date,t.let=this.getRecordingLastEventTimestamp(),this.ln.setQueryParams(t);const i=this.je.stringifyEvents();if(i.length>this.Pn){const s=this.Un();if(s.length>0){const i=tt(s);this.ln.send(i)||this.an.save({key:`${t.sn}.${t.pn}.last`,metadata:{...t,datatype:"json"},events:i})}else delete t.let,delete t.rst,delete t.ri,this.ln.removeQueryParams(),this.ln.setQueryParams(t),this.ln.send(),this.ln.removeQueryParams();if(this.je.eventsCount()>0){t.rst=this.getRecordingStartTimestamp(),t.let=this.getRecordingLastEventTimestamp();const s=this.Ze.getCurrentIndex();t.ri=s.toString();const i=this.je.stringifyEvents();this.an.save({key:`${t.sn}.${t.pn}.${t.ri}.last`,metadata:{...t,datatype:"json"},events:i}),this.Ze.increment()}}else{this.ln.send(i)||(this.an.save({key:`${t.sn}.${t.pn}.${t.ri}.last`,metadata:{...t,datatype:"json"},events:i}),this.Ze.increment())}this.ln.removeQueryParams(),this.je.clearEvents()}isMutationTrackerStarted(){return this.Je.isStarted()}blockSendingEventsFromQuotaService(){this.yn.allowFromQuotaService=!1}allowSendingEventsFromQuotaService(){this.yn.allowFromQuotaService=!0}blockSendingEventsFromSerialization(){this.yn.allowFromSerialization=!1}allowSendingEventsFromSerialization(){this.yn.allowFromSerialization=!0}canSendEvents(){return this.yn.allowFromQuotaService&&this.yn.allowFromSerialization}onIframeJavascriptError(t){this.zn(t)}onIframeDetailedApiError(t){this.Hn(t)}onIframeRecordingUserEvent(t){for(const s of t)this._n(s)}onIframeRecordingBrowserEvent(t){if(this.isMutationTrackerStarted())for(const s of t)this.processBrowserEvent(s)}processBrowserEvent(t){this.Qe.isCurrentPageviewValid()&&this.Nn.pushEvent(t,{isUserEvent:!1})}_n(t){this.Qe.isSessionValid()&&this.Nn.pushEvent(t,{isUserEvent:!0})}kn(t){this.je.addEvent(t);this.je.isThresholdReached()?this.pushEvents():this.je.isFull()&&this.An(),this.Fn(t)}Fn(t){this.L.emitDebugEvents&&this.mn.emit("recordingEvent",{...t,typeName:Bs[t.type]})}onStart(){this.Nn.start(),Ve.start(),this.Tn.start(),this.initStates(),this.We.start(),this.$n.start(),this.Ye.start(),this.Xe.start(),this.tn&&this.en&&this.tn.subscribe(De.Bn,(t=>this.zn(t))),this.nn&&this.rn&&this.nn.subscribe(De.Bn,(t=>this.Hn(t)),{detailedEvent:!0}),this.L.emitDebugEvents&&this.mn.emit("replayRecordingStarted"),csArray.prototype.forEach.call(this.Cn,(t=>this.qn(t))),this.Cn=[]}onStop(){this.Nn.disconnect(),Ve.stop(),this.Tn.stop(),this.We.stop(),this.Ke.stop(),this.Xe.stop(),this.tn&&this.tn.unsubscribe(De.Bn),this.nn&&this.nn.unsubscribe(De.Bn),this.$n.stop(),this.Ye.stop(),this.Vn=!1}clearStates(){this.Je.flushEvents(),this.An.cancel(),this.pushEvents(),this.cn.removeQueryParams()}initStates(){this.Rn=yt.now(),this.Ze.reset(),this.dn=0,this.fn=0,this.wn=0,this.cn.setQueryParams(this.Ge.getRequestParameters())}pushEvents(){Vi(this.Ee,(t=>{var s;return null===(s=t.flushEvents)||void 0===s?void 0:s.call(t)})),this.je.eventsCount()>0&&(this.isStarted?this.gn():this.je.clearEvents())}gn(){if(!this.canSendEvents())return;const t=this.je.getEvents();this.Sn=t[t.length-1].date;const s=this.Ze.getCurrentIndex();this.cn.setQueryParams({ri:s.toString(),rst:this.getRecordingStartTimestamp(),let:this.getRecordingLastEventTimestamp()});const i=this.cn.getQueryParams();this.an.addBatchInProgress(`${i.sn}.${i.pn}.${s}`,this.cn.getQueryParams(),t),this.cn.send(t),this.Ze.increment(),this.je.clearEvents(),this.jn&&this.jn()}addInitialDom(t){this.je.addEventByTimestamp(t),this.Fn(t)}Hn(t){if(t.customRequestHeaders||t.customResponseHeaders||t.queryParameters||t.requestBody||t.responseBody){if(this.hn)return void this.hn.registerApiErrorToEncrypt(t);t.customRequestHeaders="",t.customResponseHeaders="",t.queryParameters="",t.requestBody="",t.responseBody=""}this.Ln(t)}Ln(t){if(this.fn{var s;return null===(s=t.releaseResources)||void 0===s?void 0:s.call(t)}))}Un(){return this.je.extractEvents(Bs.API_ERROR,Bs.JAVASCRIPT_ERROR,Bs.CUSTOM_ERROR,Bs.TEXT_VISIBILITY,Bs.POINTER_DOWN)}}De.Bn="RecordingService",De.ir=255,De.Zn=20,De.Gn=20,De.Jn=20,De.Qn="etrp",De.Xn="etrs",De.Yn="1",es([ei("addInitialDom")],De.prototype,"addInitialDom",null);class Ue extends Zi{constructor(t,s,i){super(),this.Wt=t,this.ln=s,this.cn=i,this.er=!1,this.nr={},this.rr=t=>{if(0!==t.length)for(const s of t){const{metadata:t,events:i}=s;this.hr(t.rt)&&this.cn.send(i,t)}},window.addEventListener("focus",(()=>{this.recover()}))}onStart(){this.nr={}}onStop(){}recover(){this.Wt.recover(this.rr)}addBatchInProgress(t,s,i){this.nr[t]={metadata:{...s},events:i}}removeBatchInProgress(t){delete this.nr[t]}blockSendingLastMessage(){this.er=!1}allowSendingLastMessage(){this.er=!0}sendLastMessageBeacon(){if(this.er){const{ri:t,rst:s,let:i,...e}=this.cn.getQueryParams();e.hlm="true",this.ln.setQueryParams(e),this.ln.send()}}hr(t){return!!t&&-1===csString.prototype.indexOf.call(t,_s.TEMPORARILY_RECORDED)}saveBatchesInProgress(){csArray.prototype.forEach.call(Object.keys(this.nr),(t=>{const{metadata:s,events:i}=this.nr[t];this.Wt.save({key:`${s.sn}.${s.pn}.${s.ri}`,metadata:{...s,datatype:"json"},events:csJSON.stringify(i)})}))}save(t){this.Wt.save(t)}}var ze;es([is("RecordingRecovery")],Ue.prototype,"recover",null);const He=null!==(ze=Mt.Node)&&void 0!==ze?ze:Object;var Fe;!function(t){const s="isConnected"in He.prototype?t=>t.isConnected:t=>!(t.ownerDocument&&t.ownerDocument.compareDocumentPosition(t)&t.DOCUMENT_POSITION_DISCONNECTED);function i(t){var s;return t.parentElement?t.parentElement:t.getRootNode?null===(s=t.getRootNode())||void 0===s?void 0:s.host:null}function e(t){var s,i;if(!1===(null===(s=t.checkVisibility)||void 0===s?void 0:s.call(t,{checkOpacity:!0,checkVisibilityCSS:!0})))return!0;if(!t.offsetParent){if(!t.getBoundingClientRect)return ss.warn(`SUP-11432: Element doesn't have getBoundingClientRect. Node: ${t instanceof He} Ctor: ${null===(i=null==t?void 0:t.constructor)||void 0===i?void 0:i.name}`),!1;const s=t.getBoundingClientRect();if(0==s.width&&0==s.height)return!0}const e=window.getComputedStyle(t);if(!e)return!0;var n;return"none"===e.display||"hidden"===e.visibility||"collapse"===e.visibility||"0"===e.opacity||"opacity(0)"===e.filter||"0px"===e.width&&"0px"===e.height||("transparent"===(n=e.color)||/^(rgba|hsla)\(\d+, \d+%?, \d+%?, 0\)$/.test(n))}function n(t){const s=t.getBoundingClientRect(),i=s.left+.5*s.width,e=s.top+.5*s.height;return r(document,i,e)}function r(t,s,i){const e=t.elementFromPoint(s,i);if(!e)return null;const n=ye.getShadowRoot(e);return n&&n!=document.body.getRootNode()&&n!==t?r(n,s,i):e}function h(t){const s=n(t);return null!==s&&(t===s||t.contains(s))}t.forEachChild=function(t,s){for(let i=t;i;i=csNodenextSibling.apply(i))s(t)},t.isConnected=function(t){return s(t)},t.getAncestors=function(t,s){const i=[],e=t=>{csArray.prototype.push.call(i,t);const s=t.getRootNode();let e=t;for(;(null==e?void 0:e.parentElement)&&e.parentElement!==s;)csArray.prototype.push.call(i,e.parentElement),e=e.parentElement;return csArray.prototype.push.call(i,s),i};if(s){let s=t;for(;s;){e(s);const t=s.getRootNode();if(!(t instanceof ShadowRoot))break;s=t.host}}else e(t);return i},t.isDescendantOf=function s(i,e){if(i===e||e.contains(i))return!0;const n=t.getParentElement(i);return!(!n||n===i)&&s(n,e)},t.getParentElement=i,t.findAllElements=function(t,s=document){const i=Ti(window.csquerySelectorAll[s.nodeType].call(s,t)),e=ye.getAllShadowHosts(s);for(const s of e){const e=csElementshadowRoot.apply(s),n=Ti(window.csquerySelectorAll[e.nodeType].call(e,t));csArray.prototype.push.call(i,...n)}return i},t.isHiddenByCSS=e,t.areAncestorsHiddenByCSS=function t(s){if(e(s))return!0;const n=i(s);return null!=n&&t(n)},t.getTopAncestorHiddenByCSS=function(t){let s=null,n=t;do{if(!e(n))break;s=n}while(n=i(n));return s},t.getTopElement=n,t.getElementOnTop=function(s){if(!s.getBoundingClientRect)return null;const i=s.getBoundingClientRect(),e=i.x+i.width/2,n=i.y+i.height/2;return t.getTopElementFromPoint(document,e,n)},t.getTopElementFromPoint=r,t.isVisibleInDocument=function(t){return!function(t){const s=t.getBoundingClientRect();return s.right+Yi.windowOffsetX()<0||s.bottom+Yi.windowOffsetY()<0}(t)&&!e(t)&&!function(t){const s=n(t);return null!==s&&!t.contains(s)}(t)},t.isVisibleInViewportInForeground=function(t){return!e(t)&&h(t)},t.isInViewPort=h,t.getAttributeNS=function(t,s,i){const e=t.getAttributeNS(s,i);return""===e?t.hasAttributeNS(s,i)?e:null:e},t.isElementFocusable=function(t){return!!t.hasAttribute("tabIndex")||("true"===t.getAttribute("contentEditable")||(!(!w(t)||!t.hasAttribute("href"))||(!(!(_(t)||g(t)||A(t)||(s=t,u(s)&&"button"===s.localName))||t.hasAttribute("disabled"))||!(!function(t){return u(t)&&"details"===t.localName}(t)&&!function(t){return u(t)&&"summary"===t.localName}(t)))));var s}}(Fe||(Fe={}));const Be=/[^\s]/g;function qe(t){return csString.prototype.replace.call(t,Be,"a")}class je{constructor(t,s,i){this.cr=t,this.ar=s,this.hn=i,this.ur=!1}setAnonymization(t){this.lr=t}isDOMSerializationInProgress(){return this.ur}serializeInitialDom(t,s){if(this.cr.isAsynchronous())this.serializeDocumentAsync(t).then((t=>{t&&s(t)})).catch((t=>{ts.error(t)}));else{const i=this.wr(t);s(i)}}wr(t){return{args:[this.cr.serialize(t,{withAnonymization:this.lr})],date:yt.now(),type:Bs.INITIAL_DOM}}async serializeDocumentAsync(t){this.ur=!0;try{return await this.cr.startSerializeAsync(t,{withAnonymization:this.lr})}finally{this.ur=!1}}serializeMutationCharacterData(t){var s;const i=yi(t.target);if(!i)return null;const e=t.target;if(e.data===t.oldValue)return null;if(l(e)&&(null===(s=this.hn)||void 0===s?void 0:s.shouldEncrypt(e)))return this.hn.registerTextNodeMutationToEncrypt({targetId:i,textNode:e,serializedTextData:qe(e.data),date:t.date}),null;let n=this.ar.getAnonymizedText(this.lr,e,e.data);l(e)&&(n=this.cr.serializeTextMutation(e,n));const r=[i,n];return this.pr(this.cr)&&this.isDOMSerializationInProgress()&&this.cr.handleMutationCharacterData(t,r),r}serializeAttachShadowEvent(t){const s=yi(t.target);if(!s)return null;return[s,this.cr.serialize(t.shadowRoot)]}serializeMutationAttribute(t){const s=yi(t.target);if(!s)return null;const i=t.target,e=t.attributeName,n=t.attributeNamespace;let r=Fe.getAttributeNS(t.target,n,e);r&&(r=this.ar.getAnonymizedAttributeValue(i,this.lr,e,r),r=this.cr.serializeAttributeMutationValue(t.target,e,r));const h=[s,n,e,r];return this.pr(this.cr)&&this.isDOMSerializationInProgress()&&this.cr.handleMutationAttribute(t.oldValue?this.ar.getAnonymizedAttributeValue(i,this.lr,e,t.oldValue):t.oldValue,h),h}serializeMutationChildList(t,s){const i=yi(t.target);if(!i)return Vi(t.addedNodes,(t=>{const i=s.get(t);i&&s.set(t,i-1)})),null;if(this.pr(this.cr)&&this.isDOMSerializationInProgress())return this.cr.serializeMutationChildList(t,this.lr,s);return{removedNodes:this.mr(t),addedNodes:this.yr(t,i,s)}}pr(t){return t.isAsynchronous()}mr(t){const s=[];for(let i=0;i{!function(t){const s=performance.measure(t,`${t}-start`);if(!s)return;const i=s.duration;i>Ys&&Xs.add([{mName:t,mDuration:+i.toFixed(2)}])}(Ge)})),s}})],je.prototype,"serializeDocumentAsync",null);class Ze{constructor(t,s){this.Ar=t,this.We=s,this.gr()&&(this.Er=_e(window.CSSStyleDeclaration.prototype,"cssText",((t,s)=>this.setStyleDeclarationCssText(t,s))))}onEvent(t){this.yi=t}start(){this.vr=this.We.registerToInsertRuleInterceptor(this.sendInsertion.bind(this)),this._r=this.We.registerToDeleteRuleInterceptor(this.sendDeletion.bind(this)),this.Er&&this.Er.activate()}stop(){var t,s;null===(t=this.vr)||void 0===t||t.call(this),null===(s=this._r)||void 0===s||s.call(this),this.Er&&this.Er.deactivate()}setStyleDeclarationCssText(t,s){const i=this.Rr(t);if(!(null==i?void 0:i.ownerNode))return;if(u(i.ownerNode)&&wi.isSensitiveChild(i.ownerNode))return;const e=yi(i.ownerNode);if(!e)return;const n=this.Sr(i.cssRules,t.parentRule),r={date:yt.now(),type:Bs.STYLESHEET_CSS_TEXT_UPDATE,args:[e,n,s]};this.yi(r),this.Ar.scanCssString(s)}Rr(t){const s=t.parentRule;return s&&s.parentStyleSheet}Sr(t,s){return csArray.prototype.indexOf.call(csArray.from(t),s)}gr(){return window.CSSStyleDeclaration&&window.CSSStyleDeclaration.prototype&&Object.getOwnPropertyDescriptor(window.CSSStyleDeclaration.prototype,"cssText")}sendInsertion(t,[s,i]){if(!t.ownerNode)return;if(u(t.ownerNode)&&wi.isSensitiveChild(t.ownerNode))return;const e=yi(t.ownerNode);if(!e)return;const n={date:yt.now(),type:Bs.STYLESHEET_RULE_INSERT,args:It(i)?[e,s,i]:[e,s]};this.yi(n),this.Ar.scanCssString(s)}sendDeletion(t,[s]){if(!t.ownerNode)return;if(u(t.ownerNode)&&wi.isSensitiveChild(t.ownerNode))return;const i=yi(t.ownerNode);if(!i)return;const e={date:yt.now(),type:Bs.STYLESHEET_RULE_DELETE,args:[i,s]};this.yi(e)}}es([is("styleSheetRuleTracker.setStyleDeclarationCssText")],Ze.prototype,"setStyleDeclarationCssText",null),es([is("styleSheetRuleTracker.sendInsertion")],Ze.prototype,"sendInsertion",null),es([is("styleSheetRuleTracker.sendDeletion")],Ze.prototype,"sendDeletion",null);const We="data-cs-mask";class Je{constructor(){}beforeSerializeChildren(t,s){return wi.isSensitive(t)||this.Tr(t)?[]:s}beforeSerializeAttributes(t,s){return wi.isSensitive(t)&&!E(t)&&(csArray.prototype.push.call(s,this.Ir(t)),t.hasAttribute(We)||csArray.prototype.push.call(s,document.createAttribute(We))),csArray.prototype.filter.call(s,(s=>!wi.isSensitiveAttribute(t,s.name)))}Tr(t){return I(t)&&wi.isSensitive(t.host)}Ir(t){const s=t.getBoundingClientRect(),i=document.createAttribute("style");return i.value=`width: ${s.width}px !important; height: ${s.height}px !important;`,t.__contentsquare_height=s.height,t.__contentsquare_width=s.width,i}}var Ke,Xe,Ye;const Qe=null!==(Ke=Mt.Element)&&void 0!==Ke?Ke:{prototype:{}},tn=null!==(Xe=Mt.Node)&&void 0!==Xe?Xe:{prototype:{}},sn=t=>Object.getOwnPropertyDescriptor(t.prototype,"localName"),en=null!==(Ye=sn(Qe))&&void 0!==Ye?Ye:sn(tn);var nn;!function(t){t[t.WebElement=0]="WebElement",t[t.MobileView=1]="MobileView",t[t.WebViewContainer=2]="WebViewContainer"}(nn||(nn={}));class rn{constructor(t){this.csId=yi(t),this.format=nn.WebElement,t.__contentsquare_artificial&&(this.artificial=t.__contentsquare_artificial)}}class hn extends rn{constructor(t){var s;super(t),this.attributes=[],this.localName=(s=t,en.get.call(s)),this.namespaceURI=t.namespaceURI,this.children=[],this.nodeType=1}}const on=["id","class","style","src","srcset","sizes","href","rel","type","width","height","media","align","dir","bgcolor","color","border","colspan","rowspan","cols","rows","size","start","slot",M];class cn{constructor(t,s){this.M=t,this.L=s,this.Pr=new Set}init(){csArray.prototype.forEach.call(on,(t=>{this.Pr.add(t)})),csArray.prototype.forEach.call(this.L.whitelistedAttributes,(t=>{this.Pr.add(t)}))}beforeSerializeChildren(t,s,i){return(y(t)||Ve.isWhitelisted(t))&&(i.withAnonymization=!1),s}serializeAttribute(t,s,i,e){i.anonymized=e.withAnonymization;const n=this.getAnonymizedAttributeValue(t,e.withAnonymization,i.name,i.value);i.value=n}serializeTextNode(t,s,i){s.data=this.getAnonymizedText(i.withAnonymization,t,s.data)}serializeCDATASectionNode(t,s,i){const e=t.data;return s.data=i.withAnonymization?qe(e):this.M.anonymizePII(e),s}getAnonymizedText(t,s,i){if(csNodeparentNode.apply(s)){if(y(csNodeparentNode.apply(s)))return i;if(t&&Ve.isWhitelisted(csNodeparentNode.apply(s)))return this.M.anonymizeCreditCard(this.M.anonymizeEmail(i))}return t?qe(i):this.M.anonymizeCreditCard(this.M.anonymizeEmail(i))}getAnonymizedAttributeValue(t,s,i,e){return this.br(i)||v(t)||u(n=t)&&"slot"===n.localName?e:s&&A(t)&&("submit"===t.type||"button"===t.type)&&"value"===i?qe(e):s?"":this.M.anonymizeCreditCard(this.M.anonymizeEmail(e));var n}afterSerialize(t,s,i){null==s.anonymized&&(s.anonymized=i.withAnonymization),s instanceof hn&&s.shadowRoot&&null==s.shadowRoot.anonymized&&(s.shadowRoot.anonymized=i.withAnonymization)}br(t){return this.Pr.has(t)}}class an{constructor(...t){this.Vr=t}addProvider(t){csArray.prototype.push.call(this.Vr,t)}getRequestParameters(){return csArray.prototype.reduce.call(this.Vr,((t,s)=>({...s.getRequestParameters(),...t})),{})}}class un{constructor(t,s){this.Ts=t,this.M=s,this.Cr=[{boundElement:window,type:"hashchange",listener:()=>this.hashChangeListener()},{boundElement:document,type:"visibilitychange",listener:()=>this.visibilityChangeListener()}]}onEvent(t){this.yi=t}start(){this.Ws(),this.triggerInitialEvents()}stop(){this.ti()}Ws(){csArray.prototype.forEach.call(this.Cr,(t=>Zs(t)))}ti(){csArray.prototype.forEach.call(this.Cr,(t=>Ws(t)))}triggerInitialEvents(){this.hashChangeListener()}hashChangeListener(){const t={type:Bs.HASH_CHANGE,args:[this.M.anonymizePII(this.Ts.href)],date:yt.now()};this.yi(t)}visibilityChangeListener(){const t={type:Bs.VISIBILITY_CHANGE,args:[document.visibilityState],date:yt.now()};this.yi(t)}}es([is("hashChange")],un.prototype,"hashChangeListener",null),es([is("visibilityChange")],un.prototype,"visibilityChangeListener",null);const ln=/(@import\s*("([^"]+)"|'([^']+)'))|(url\s*\(\s*((("([^"\]]+)"|'([^'\]]+)')\s*)|([^)\]]+))\))/g;function dn(t,s){const i=csString.prototype.replace.call(t,ln,((...t)=>{const i=t[3]||t[4],e=t[9]||t[10]||t[11],n=function(t){const s=/(\\)*\\(?:([a-fA-F0-9]{1,6})|(.))[\n\t\x20]?/g;return csString.prototype.replace.call(t,s,((t,s,i,e)=>{if("\\"===s)return csString.prototype.slice.call(t,1);if(e)return e;const n=parseInt(i,16);return 55296<=n&&n<=57343||0===n||n>1114111?"�":csString.fromCodePoint(n)}))}((i||e).trim());return`${i?"@import ":""}url(${function(t){if(-1===csString.prototype.indexOf.call(t,'"'))return`"${t}"`;if(-1===csString.prototype.indexOf.call(t,"'"))return`'${t}'`;return t}(s(n)||n)})`}));return i}function fn(t){const s=new Set;return dn(t,(t=>{var i,e;return s.add(null!==(e=null===(i=csString.prototype.match.call(t,/^["|'](.*)?["|']$/))||void 0===i?void 0:i[1])&&void 0!==e?e:t),t})),ki(s)}function wn(t){return gt(t,"data:")}function pn(t){return gt(t,"#")}function mn(t){return!!t&&Et(t,".css")}function yn(t){const s=csString.prototype.trim.call(t);if(""===t)return[];let[i,e]=(n=s,csString.prototype.split.call(n,/\s(.+)/));var n;return e?(Et(i,",")||(e=function(t){return csString.prototype.split.call(t,/,(.+)/)[1]||""}(e)),[An(i),...yn(e)]):[An(i)]}function An(t){return csString.prototype.split.call(t,/,$/)[0]}class gn{constructor(t,s=30,i=0){this.Nr=t,this.kr=s,this.Or=i,this.$r=new Oi,this.X=!1,this.Lr=0,this.Mr=()=>{for(this.Lr=0;this.$r.length;){if(this.Lr>=this.kr)return void setTimeout(this.Mr,this.Or);const t=yt.now(),s=this.$r.pop();if(!s)break;this.runTask(s);const i=yt.now()-t;this.Lr+=i}this.X=!1}}schedule(t,s=!1){this.Nr&&!s?(this.$r.push(t),this.Dr()):t()}Dr(){this.X||(this.X=!0,setTimeout((()=>{this.Mr()})))}runTask(t){t()}runPendingTasks(){this.$r.forEach((t=>{this.runTask(t)})),this.$r.clear()}clearQueue(){this.$r.clear()}isEmpty(){return 0===this.$r.length}}es([is("TaskScheduler"),ei("runTask")],gn.prototype,"runTask",null),es([ei("runPendingTasks")],gn.prototype,"runPendingTasks",null);class En{constructor(t=!1){this.Ur=!1,this.taskScheduler=new gn(t),this.Le=new xe((t=>this.taskScheduler.schedule((()=>this.zr(t))))),this.ai=new Pe((t=>this.taskScheduler.schedule((()=>this.pe(t)))))}start(){this.Ur||(this.Ur=!0,this.Le.observe(),this.ai.observe())}stop(){this.Le.disconnect(),this.ai.disconnect(),this.Ur=!1}onEvent(t){this.yi=t}onAsset(t){this.Hr=t}onStyleSheetFound(t){this.Fr=t}scanText(t){l(t)&&csNodeparentNode.apply(t)&&y(csNodeparentNode.apply(t))&&this.scanCssString(t.data)}scanCssString(t){this.Br(fn(t))}zr(t){this.Ur&&wi.getSensitiveDetails(t).state===wi.SensitiveState.NotSensitive&&this.qr(t)}qr(t,s){wi.getSensitiveDetails(t).state!==wi.SensitiveState.NotSensitive||s&&wi.isSensitiveAttribute(t,s)||(y(t)?this.jr(t):this.Gr(t,s)||(this.Zr(t,s),this.Wr(t,s),this.Jr(t,s)))}Gr(t,s){var i,e,n;if(p(t)&&(!s||"href"===s)&&t.href){const s=(null===(i=t.sheet)||void 0===i?void 0:i.href)||t.href,r={assetId:s,assetBasePath:window.location.href,assetRawPath:t.getAttribute("href")};return null===(e=this.Fr)||void 0===e||e.call(this,r),null===(n=this.Hr)||void 0===n||n.call(this,r),this.Kr(s),!0}return!1}jr(t){var s;const i=new Set;for(let s=0;s!this.Yr(t))),(t=>!wn(t))),(t=>!pn(t))),(t=>({rawUrl:t,absoluteUrl:zt(t)}))),(t=>{var s;this.yi&&this.Kr(t.absoluteUrl),null===(s=this.Hr)||void 0===s||s.call(this,{assetId:t.absoluteUrl,assetBasePath:window.location.href,assetRawPath:t.rawUrl})}))}pe(t){for(const s of t)switch(s.type){case"attributes":this.qr(s.target,s.attributeName);break;case"characterData":this.scanText(s.target)}}Kr(t){var s;const i={date:yt.now(),type:Bs.STATIC_RESOURCE_URL,args:[t]};null===(s=this.yi)||void 0===s||s.call(this,i)}Yr(t){return/^https:\/\/\w+:\w+@/.test(t)}}class vn extends Zi{constructor(t){super(),this.th=t,this.ih=new Map}init(){this.eh(),this.nh()}nh(){this.Ae=new csMutationObserver((t=>{zi((()=>this.handleMutations(t)),"low")}))}eh(){this.rh()&&(this.hh=ve({target:Element.prototype,methodName:"attachShadow",hook:({context:t,result:s})=>this.handleAttachShadow(t,s)})),this.oh()&&(this.ah=ve({target:Element.prototype,methodName:"createShadowRoot",hook:({context:t,result:s})=>this.handleAttachShadow(t,s)}))}onChildListMutation(t){this.uh=t}onCharacterDataMutation(t){this.fh=t}onAttributesMutation(t){this.ph=t}onAttachShadowMutation(t){this.mh=t}observe(t,s){this.isStarted&&this.Ae.observe(t,s)}onStart(){this.hh&&this.hh.activate(),this.ah&&this.ah.activate()}onStop(){this.hh&&this.hh.deactivate(),this.ah&&this.ah.deactivate(),this.th.clearQueue(),this.Ae.disconnect()}flushPendingMutations(){if(!this.isStarted)return;!function(){for(Ui++;!Di.isEmpty;)Di.pop()();for(;!Mi.isEmpty;)Mi.pop()()}(),this.th.runPendingTasks();const t=this.Ae.takeRecords();this.handleMutations(t,!0)}rh(){return window.Element&&window.Element.prototype&&"function"==typeof window.Element.prototype.attachShadow}oh(){return window.Element&&window.Element.prototype&&"function"==typeof window.Element.prototype.createShadowRoot}handleMutations(t,s=!1){const i=yt.now(),e=t.length>1?this.yh(t):t;this.th.isEmpty()&&this.ih.clear(),this.Ah(e);for(let t=0;t{this.processMutation(n,this.ih)}),s)}}yh(t){const s=new Map;for(let i=0;i=0;e-=1){const n=t[e];if("attributes"!==n.type){csArray.prototype.push.call(i,n);continue}const r=n.target,h=`${n.attributeNamespace||""} ${n.attributeName}`,o=s.get(r);"last"===o.get(h)&&(csArray.prototype.push.call(i,n),o.set(h,"none"))}return csArray.prototype.reverse.call(i)}handleAttachShadow(t,s){this.mh({shadowRoot:s,date:yt.now(),target:t})}processMutation(t,s){switch(t.type){case"attributes":this.ph(t);break;case"characterData":this.fh(t);break;case"childList":this.uh(t,s);break;default:throw new Error("mutation type is not supported")}}Ah(t){csArray.prototype.forEach.call(t,(t=>{Vi(t.addedNodes,(t=>{const s=this.ih.get(t);s?this.ih.set(t,s+1):this.ih.set(t,1)}))}))}}es([is("handleMutations")],vn.prototype,"handleMutations",null),es([ei("handleAttachShadow")],vn.prototype,"handleAttachShadow",null),es([ei("processMutation")],vn.prototype,"processMutation",null);class _n extends vn{constructor(){super(...arguments),this.gh={subtree:!0,attributes:!0,childList:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}}init(){super.init(),this.Zs()}Zs(){_i((t=>{this.observe(t,this.gh)}))}}class Rn{constructor(t){this.Eh=[],this._h=[],this.zt={},this.Ht=t}setQueryParams(t){csArray.prototype.forEach.call(Object.keys(t),(s=>{this.zt[s]=t[s]}))}removeQueryParams(t){t?csArray.prototype.forEach.call(t,(t=>{delete this.zt[t]})):this.zt={}}onBeaconSuccess(t){csArray.prototype.push.call(this.Eh,t)}onBeaconFailure(t){csArray.prototype.push.call(this._h,t)}send(t){const s=nt.toQuery({...this.zt,ct:ws.UNCOMPRESSED}),i=this.Rh(s,t);return i?csArray.prototype.forEach.call(this.Eh,(t=>t())):csArray.prototype.forEach.call(this._h,(t=>t(this.zt))),i}Rh(t,s){try{if("function"!=typeof csNavigatorsendBeacon)return!1;const i=csNavigatorsendBeacon(`${this.Ht}?${t}`,s||"");if(i)return i}catch{}return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(`${this.Ht}?${t}`,s||"")}}var Sn,Tn;!function(t){t[t.TAP=0]="TAP",t[t.LONG_PRESS=1]="LONG_PRESS",t[t.DRAG=2]="DRAG",t[t.FLICK=3]="FLICK",t[t.PINCH_IN=4]="PINCH_IN",t[t.PINCH_OUT=5]="PINCH_OUT"}(Sn||(Sn={})),function(t){t[t.UP=1]="UP",t[t.DOWN=2]="DOWN",t[t.LEFT=3]="LEFT",t[t.RIGHT=4]="RIGHT"}(Tn||(Tn={}));class In{constructor(t){this.Sh=t}start(){this.Sh.subscribe(In.Th,((t,s)=>this.processGesture(t,s)))}stop(){this.Sh.unsubscribe(In.Th)}onEvent(t){this.yi=t}processGesture(t,s){if(!t.target)return;if(u(t.target)&&wi.isSensitiveChild(t.target))return;const i=yi(t.target);if(i)switch(t.type){case Sn.DRAG:case Sn.FLICK:this.Ih(Gs.SWIPE,t,i,s);break;case Sn.LONG_PRESS:this.Ih(Gs.LONG_PRESS,t,i,s);break;case Sn.TAP:this.Ih(Gs.TAP,t,i,s);break;case Sn.PINCH_IN:this.Ih(Gs.PINCH_IN,t,i,s);break;case Sn.PINCH_OUT:this.Ih(Gs.PINCH_OUT,t,i,s)}}Ih(t,s,i,e){const n=this.Ph(s,t,e),r={type:Bs.GESTURE_RECOGNITION,args:[i,n],date:yt.now()};this.yi(r)}Ph(t,s,i){const e={type:s};if(t.direction&&(e.direction=t.direction),t.distance&&(e.distance=t.distance),t.velocity&&(e.velocity=t.velocity),s===Gs.TAP&&i.changedTouches&&1===i.changedTouches.length){const t=i.changedTouches[0];e.pageX=Hs(t.pageX,1),e.pageY=Hs(t.pageY,1)}return e}}In.Th="RecordingGesturesTracker",es([ri()],In.prototype,"processGesture",null);class Pn extends rn{constructor(t){super(t),this.name=t.name,this.publicId=t.publicId,this.systemId=t.systemId,this.nodeType=10}}class bn{constructor(t){var s;this.name=t.name,this.value=t.value,this.namespaceURI=null!==(s=t.namespaceURI)&&void 0!==s?s:""}}class Vn extends rn{constructor(t){super(t),this.data=t.data,this.nodeType=3}}class Cn extends rn{constructor(t){super(t),this.data=t.data,this.nodeType=4}}class Nn extends rn{constructor(t){super(t),this.data=t.data,this.nodeType=8}}class kn extends rn{constructor(t){super(t),this.baseURI=kn.getBaseURI(t),this.children=[],this.nodeType=9}static getBaseURI(t){let s=t.baseURI;if(null==s){const i=t.getElementsByTagName("base");s=0!==i.length?i[0].href:t.URL}return s}}class On extends rn{constructor(t){super(t),this.mode=t.mode,this.children=[],this.nodeType=11}}class $n{constructor(t){for(const s of $n.bh){const i=csArray.prototype.map.call(csArray.prototype.filter.call(t,(t=>t[s])),(t=>(i,e,n,r)=>t[s](i,e,n,r))),e=$n.Vh(i);this[s]=e}}static create(t){return new $n(t)}static Vh(t){const[s,i,e,n,r]=csArray.prototype.map.call(t,(t=>(s,i,e,n)=>t(s,i,e,n)||i));switch(t.length){case 0:return(t,s)=>s;case 1:return t[0];case 2:return(t,e,n,r)=>i(t,s(t,e,n,r),n,r);case 3:return(t,n,r,h)=>e(t,i(t,s(t,n,r,h),r,h),r,h);case 4:return(t,r,h,o)=>n(t,e(t,i(t,s(t,r,h,o),h,o),h,o),h,o);case 5:return(t,h,o,c)=>r(t,n(t,e(t,i(t,s(t,h,o,c),o,c),o,c),o,c),o,c);default:return(s,i,e,n)=>{let r=i;for(let h=0;h!s.excludedNodes.get(t))):e,e=this.Ch.beforeSerializeChildren(t,e,s),Ti(e)}Uh(t,s){if(s.skipChildrenSerialization)return[];const i=this.runBeforeSerializeChildrenHook(t,s);for(let t=0;t{setTimeout((()=>{t()}),0)}))}class Mn{constructor(){this.Hh=!1,this.Fh=new Map,this.Bh={},this.qh=new Map,this.jh=new Map,this.Gh=new Set,this.Zh=new Map}beforeSerializeChildren(t,s){return this.Hh?Ci(s,(t=>!this.isAddedNodeDuringSerialization(t))):s}beforeSerializeAttributes(t,s,i){if(!this.Hh)return s;const e=yi(t);if(!e)return s;const n=this.jh.get(e);return n?csArray.prototype.filter.call(s,(t=>{const s=`${t.name}${t.namespaceURI||""}`,i=n.get(s);return!(i&&null===i.value)})):s}serializeTextNode(t,s,i){if(!this.Hh)return;const e=this.qh.get(s.csId);e&&(s.data=e)}serializeCommentNode(t,s){if(!this.Hh)return;const i=this.qh.get(s.csId);i&&(s.data=i)}afterSerialize(t,s,i){this.Hh&&(csNodeparentNode.apply(t)&&!this.getSerializedNodeByNode(csNodeparentNode.apply(t))||i.skipRegisterNode||this.Wh(s,i))}afterSerializeShadowRoot(t,s,i){this.Hh&&(i.skipRegisterNode||this.Wh(s,i))}enable(){this.Hh=!0,this.Jh()}disable(){this.Hh=!1,this.Jh()}setDefaultSerializationOptions(t){this.Bh=t}getSerializedNodeById(t){var s;return null===(s=this.Fh.get(t))||void 0===s?void 0:s.serializedNode}getSerializedNodeByNode(t){var s;const i=yi(t);if(i)return null===(s=this.Fh.get(i))||void 0===s?void 0:s.serializedNode}getOptions(t){var s;const i=yi(t);return i&&(null===(s=this.Fh.get(i))||void 0===s?void 0:s.options)||this.Bh}registerInitialCharacterData(t,s){this.qh.get(t)||this.qh.set(t,s)}registerInitialAttributes(t,s,i,e){let n=this.jh.get(t);const r=`${i}${s||""}`;if(n){if(n.has(r))return}else n=new Map,this.jh.set(t,n);const h={name:i,namespaceURI:s||"",value:e};n.set(r,h)}markAddedTreeAsProcessed(t){const s=document.createNodeIterator(t,NodeFilter.SHOW_ALL,null,!1);let i;for(;i=s.nextNode();){const t=yi(i);t&&this.Gh.add(t)}}markRemovedNodeAsProcessed(t,s,i){const e=yi(i),n=yi(t);if(!e||!n)return;const r=this.Zh.get(e);if(r)csArray.prototype.push.call(r.removedNodeIds,n),csArray.prototype.indexOf.call(r.childNodeIds,n)<0&&csArray.prototype.push.call(r.childNodeIds,n);else{const t=[],r=s?yi(s):null;for(let s=0;s{null!==t.value&&csArray.prototype.push.call(s.attributes,{name:t.name,value:t.value,namespaceURI:t.namespaceURI,anonymized:i.withAnonymization||!1})}))}}Kh(t,s,i){(i.csId||Dn(i))&&(t>=0?csArray.prototype.splice.call(s.children,t,0,i):Dn(i)&&csArray.prototype.push.call(s.children,i))}Yh(t,s){var i;if(!Un(s))return;const e=this.Zh.get(t);if(e)for(const t of e.removedNodeIds){const n=csArray.prototype.indexOf.call(e.childNodeIds,t);if(-1===n)continue;const r=null===(i=this.Fh.get(t))||void 0===i?void 0:i.serializedNode;void 0!==r&&this.Kh(n,s,r)}}}function Dn(t){return"artificial"in t}function Un(t){return"children"in t}const zn={taskTime:25};class Hn extends xn{constructor(t,s=new Mn,i=zn){super([s,...t]),this.Qh=s,this.so=i,this.io=0,this.eo=this.so.taskTime}isAsynchronous(){return!0}handleMutationAttribute(t,s){const[i,e,n]=s;this.Qh.getSerializedNodeById(i)||this.Qh.registerInitialAttributes(i,e,n,t)}handleMutationCharacterData(t,s){const[i]=s;this.Qh.getSerializedNodeById(i)||this.Qh.registerInitialCharacterData(i,t.oldValue||"")}serializeMutationChildList(t,s,i){const e=this.yr(t,s,i);this.no(t);return{removedNodes:this.mr(t,s),addedNodes:e}}async startSerializeAsync(t,s={}){return this.io+=1,this.Qh.setDefaultSerializationOptions(s),this.ro(t,s)}yr(t,s,i){const e=[];let n=null;if(t.nextSibling&&t.nextSibling.isConnected){const s=yi(t.nextSibling);n=void 0!==s?s:null}const r=yi(t.target);for(let h=0;h=0?i:csArray.prototype.indexOf.call(csNodechildNodes.apply(s),t)}mr(t,s){const i=[];for(let e=0;e0;){const t=csArray.prototype.pop.call(n),s=this.Qh.getOptions(t),e=this.runBeforeSerializeChildrenHook(t,s);let r=csArray.prototype.shift.call(e);for(;r;){if(csDate.now()-this.uo>this.eo){if(await Ln(),i!==this.io)return null;this.uo=csDate.now()}if(this.oo(r)){r=csArray.prototype.shift.call(e);continue}csArray.prototype.push.call(n,r);const h=this.serialize(r,s),o=this.ho(r,t);if(this.Qh.addSerializedChildToParent(t,o,h),u(r)&&csElementshadowRoot.apply(r)){const t=csElementshadowRoot.apply(r);csArray.prototype.push.call(n,t)}r=csArray.prototype.shift.call(e)}}const r=this.Qh.getSerializedNodeByNode(t);if(!r)throw this.Qh.disable(),new Error("traverseAndSerialize : fail to serialize");this.Qh.disable();return{args:[r],date:e,type:Bs.INITIAL_DOM}}}class Fn extends xn{isAsynchronous(){return!1}}class Bn{constructor(){this.lo=new Map,this.do=document.implementation.createHTMLDocument("")}beforeSerializeChildren(t,s){if(!y(t))return s;const i=this.fo(t);if(null===i||0===i.length)return s;if(function(t){const s=t.length;for(let i=0;is+=t.cssText));const i=document.createTextNode(s);return i.__contentsquare_artificial=!0,i}}class qn{constructor(t){this.We=t,this.mo=1,this.wi=!1}isAdoptedStyleSheetsSupported(){return"adoptedStyleSheets"in Document.prototype&&"queueMicrotask"in window}init(){this.isAdoptedStyleSheetsSupported()&&(this.yo=new Set,this.Ao=_e(window.ShadowRoot.prototype,"adoptedStyleSheets",this.Eo.bind(this)),this.vo=_e(window.Document.prototype,"adoptedStyleSheets",this.Eo.bind(this)))}onEvent(t){this.yi=t}start(){!this.wi&&this.isAdoptedStyleSheetsSupported()&&(this.wi=!0,this._o(),this.Ao&&this.Ao.activate(),this.vo&&this.vo.activate())}stop(){this.wi&&this.isAdoptedStyleSheetsSupported()&&(this.wi=!1,this.Ro(),this.yo.clear(),this.Ao&&this.Ao.deactivate(),this.vo&&this.vo.deactivate())}serializeDocumentNode(t){var s;(null===(s=t.adoptedStyleSheets)||void 0===s?void 0:s.length)&&this.Eo(t,t.adoptedStyleSheets)}serializeShadowRootNode(t){var s;(null===(s=t.adoptedStyleSheets)||void 0===s?void 0:s.length)&&this.Eo(t,t.adoptedStyleSheets)}_o(){this.vr=this.We.registerToInsertRuleInterceptor(this.So.bind(this)),this._r=this.We.registerToDeleteRuleInterceptor(this.To.bind(this))}Ro(){var t,s;null===(t=this.vr)||void 0===t||t.call(this),null===(s=this._r)||void 0===s||s.call(this)}Eo(t,s){this.wi&&zi((()=>{csArray.prototype.forEach.call(s,(t=>this.Io(t)));const i=csArray.prototype.map.call(s,(t=>this.Po(t))),e=yi(t);if(!e)return;const n={type:Bs.SET_ADOPTED_STYLE_SHEETS,args:[e,i],date:yt.now()};this.yi(n)}))}Po(t){return t.__adopted_stylesheet_id}So(t,[s,i]){const e=this.bo(t);if(!e)return;const n={date:yt.now(),type:Bs.ADOPTED_STYLESHEET_RULE_INSERT,args:It(i)?[e,s,i]:[e,s]};this.yi(n)}To(t,[s]){const i=this.bo(t);if(i&&i){const t={date:yt.now(),type:Bs.ADOPTED_STYLESHEET_RULE_DELETE,args:[i,s]};this.yi(t)}}bo(t){return this.yo.has(t)&&t.__adopted_stylesheet_id?t.__adopted_stylesheet_id:null}Io(t){if(this.yo.has(t))return;const s=this.mo++;t.__adopted_stylesheet_id=s,this.yo.add(t);const i=this.Vo(t),e={type:Bs.REGISTER_ADOPTED_STYLE_SHEET,args:[s,i],date:yt.now()};this.yi(e)}Vo(t){let s=[];try{s=csArray.prototype.map.call(t.cssRules,(t=>t.cssText))}catch{ts.warn("AdoptedStylesheetsTracker.serializeStyleSheet: could not extract cssRules")}return{cssRules:s}}}var jn,Gn,Zn;!function(t){t.replayRecordingUnmaskedUrlRegex="replayRecordingUnmaskedUrlRegex",t.replayRecordingMaskedUrlRegex="replayRecordingMaskedUrlRegex",t.replayRecordingUnmaskedUrlRegexRules="replayRecordingUnmaskedUrlRegexRules",t.replayRecordingMaskedUrlRegexRules="replayRecordingMaskedUrlRegexRules"}(jn||(jn={})),function(t){t.START="start",t.NOT_START="not-start",t.END="end",t.NOT_END="not-end",t.CONTAIN="contain",t.NOT_CONTAIN="not-contain",t.EXACT="exact",t.NOT_EXACT="not-exact"}(Gn||(Gn={}));class Wn{constructor(t,s,i,e){this.Co=t,this.L=s,this.tt=i,this.ko=e}init(){this.Oo()}shouldUseAnonymization(){if(this.Co.isReplayUnanonymizedAllowedByConsent()){switch(this.L.anonymisationMethod){case null:case jn.replayRecordingMaskedUrlRegex:return!(!this.L.replayRecordingMaskedUrlRegex||!this.L.replayRecordingMaskedUrlRegex.test(this.tt.getAnonymizedUrl()));case jn.replayRecordingMaskedUrlRegexRules:return this.ko.evaluateUrl(this.tt.getAnonymizedUrl())}return!1}switch(this.L.anonymisationMethod){case null:case jn.replayRecordingUnmaskedUrlRegex:return!(this.L.replayRecordingUnmaskedUrlRegex&&this.L.replayRecordingUnmaskedUrlRegex.test(this.tt.getAnonymizedUrl()));case jn.replayRecordingUnmaskedUrlRegexRules:return!this.ko.evaluateUrl(this.tt.getAnonymizedUrl())}return!0}Oo(){this.L.anonymisationMethod===jn.replayRecordingMaskedUrlRegexRules&&this.L.replayRecordingMaskedUrlRegexRules?this.ko.setRegexRules(this.L.replayRecordingMaskedUrlRegexRules):this.L.anonymisationMethod===jn.replayRecordingUnmaskedUrlRegexRules&&this.L.replayRecordingUnmaskedUrlRegexRules&&this.ko.setRegexRules(this.L.replayRecordingUnmaskedUrlRegexRules)}}class Jn{static isRecordingSupported(){return"MutationObserver"in window&&"visibilityState"in document}static isAsyncSerializationSupported(){return"Promise"in window&&"findIndex"in csArray.prototype}}class Kn{constructor(){this.wi=!1,this.$o=[],this.xo=[],this.Lo()}registerToInsertRuleInterceptor(t){return this.Mo(this.$o,t)?()=>{}:(csArray.prototype.push.call(this.$o,t),()=>{this.$o=csArray.prototype.filter.call(this.$o,(s=>s!==t))})}registerToDeleteRuleInterceptor(t){return this.Mo(this.xo,t)?()=>{}:(csArray.prototype.push.call(this.xo,t),()=>{this.xo=csArray.prototype.filter.call(this.xo,(s=>s!==t))})}start(){var t,s;this.wi||(this.wi=!0,null===(t=this.Do)||void 0===t||t.activate(),null===(s=this.Uo)||void 0===s||s.activate())}stop(){var t,s;this.wi&&(this.wi=!1,null===(t=this.Do)||void 0===t||t.deactivate(),null===(s=this.Uo)||void 0===s||s.deactivate())}Mo(t,s){return csArray.prototype.indexOf.call(t,s)>-1}zo(t,s){csArray.prototype.forEach.call(this.$o,(i=>i(t,s)))}Ho(t,s){csArray.prototype.forEach.call(this.xo,(i=>i(t,s)))}Lo(){this.Fo()&&(this.Do=ve({target:window.CSSStyleSheet.prototype,methodName:"insertRule",hook:({context:t,args:s})=>{this.zo(t,s)}})),this.Bo()&&(this.Uo=ve({target:window.CSSStyleSheet.prototype,methodName:"deleteRule",hook:({context:t,args:s})=>this.Ho(t,s)}))}Fo(){var t,s;return"function"==typeof(null===(s=null===(t=window.CSSStyleSheet)||void 0===t?void 0:t.prototype)||void 0===s?void 0:s.insertRule)}Bo(){var t,s;return"function"==typeof(null===(s=null===(t=window.CSSStyleSheet)||void 0===t?void 0:t.prototype)||void 0===s?void 0:s.deleteRule)}}class Xn{constructor(t){this.qo={},this.jo=new Bi(t)}save({key:t,metadata:s,events:i}){this.jo.isThresholdReached()||(this.jo.addString(t),"string"==typeof i?this.jo.addString(i):this.jo.addArrayBuffer(i),this.jo.isThresholdReached()||(this.qo[t]={metadata:s,events:i}))}recover(t){const s=[];csArray.prototype.forEach.call(this.Go(),(t=>{const i=this.qo[t];void 0!==i&&(delete i.metadata.datatype,csArray.prototype.push.call(s,i),this.Zo(t))})),0!==s.length&&(t(s),this.jo.reset())}Go(){return Object.keys(this.qo)}Zo(t){delete this.qo[t]}}!function(t){t[t.NOT_STARTED=0]="NOT_STARTED",t[t.OPEN_IN_PROGRESS=1]="OPEN_IN_PROGRESS",t[t.OPEN_FAILED=2]="OPEN_FAILED",t[t.READY=3]="READY"}(Zn||(Zn={}));class Yn{constructor(t,s,i){this.Wo=t,this.Jo=i,this.Ko=Zn.NOT_STARTED,this.Xo=[],this.Yo=0,this.Qo=self.origin,this.tc="object"==typeof window?"":"worker-",this.jo=new Bi(s),this.sc()}async sc(){await this.ec(),this.Ko===Zn.READY?this.nc():this.Jo(this.Xo)}nc(){csArray.prototype.forEach.call(this.Xo,(t=>{this.save(t)})),this.Xo=[]}async save(t){try{if(this.Ko===Zn.OPEN_IN_PROGRESS)return void csArray.prototype.push.call(this.Xo,t);if(this.Ko!==Zn.READY)return;if(this.jo.isThresholdReached())return;const{key:s,metadata:i,events:e}=t;if(this.jo.addString(s),"string"==typeof e?this.jo.addString(e):this.jo.addArrayBuffer(e),this.jo.isThresholdReached())return;await this.fs.put(`${this.Qo}/${s}`,new Response(e,{headers:i}))}catch{}}async recover(t){(this.fs||(await this.ec(),this.Ko===Zn.READY))&&this.rc(t)}async ec(){try{this.Ko=Zn.OPEN_IN_PROGRESS,this.fs=await self.caches.open(`${this.tc}${this.Wo}`),this.Ko=Zn.READY}catch{this.Ko=Zn.OPEN_FAILED}}async rc(t){try{if(this.Yo++,this.Yo>1)return;const s=await this.fs.keys();if(0===s.length)return;const i=await this.fs.matchAll(),e=csArray.prototype.map.call(i,(t=>{const s={};t.headers.forEach(((t,i)=>{s[i]=t})),delete s["content-type"];const i=s.datatype;return delete s.datatype,"json"===i||"base64"===i?t.text().then((t=>({metadata:s,events:t}))):t.arrayBuffer().then((t=>({metadata:s,events:t})))})),n=await Promise.all(e);await Promise.all(csArray.prototype.map.call(s,(t=>this.fs.delete(t)))),t(n),this.jo.reset()}catch{}finally{this.Yo--}}}class Qn{constructor(t){self.caches?this.hc(t):this.oc()}save(t){this.cc.save(t)}recover(t){this.cc.recover(t)}hc(t){this.cc=new Yn(t,Qn.ac,(t=>{this.oc(t)}))}oc(t){this.cc=new Xn(Qn.ac),t&&csArray.prototype.forEach.call(t,(t=>{this.cc.save(t)}))}}Qn.ac=16777216;var tr,sr=/(@import\s*("([^"]+)"|'([^']+)'))|(url\s*\(\s*((("([^"\]]+)"|'([^'\]]+)')\s*)|([^)\]]+))\))/g;function ir(t,s){var i=t.replace(sr,(function(){for(var t=[],i=0;i1114111?"�":String.fromCodePoint(n)}));return(e?"@import ":"")+"url("+function(t){if(-1===t.indexOf('"'))return'"'+t+'"';if(-1===t.indexOf("'"))return"'"+t+"'";return t}(s(r)||r)+")"}));return i}function er(t){var s=[];return ir(t,(function(t){return s.push(t),t})),s}class nr{constructor(t){this.un=t,this.lc="cssrm://",this.fc=0}beforeSerializeAttributes(t,s){if(wi.isSensitive(t))return s;if(m(t)||d(t)&&f(csNodeparentNode.apply(t))){let i=s;const e=t.getAttribute("src");if(null!==e&&e.length>0&&(wn(e)||this.un.isOnlineAssetsActivated()))return this.fc++,this.wc(t.src,this.fc),this.mc(s,this.fc);if(null!==t.getAttribute("srcset")&&this.un.isOnlineAssetsActivated()){const e=yn(t.srcset),n=this.fc+1;for(const t of e)this.fc++,this.wc(zt(t),this.fc);i=this.yc(s,n,e)}return i}return p(t)&&""!==t.getAttribute("href")&&this.un.isOnlineAssetsActivated()?(this.fc++,this.Ac(t.href,this.fc),this.gc(s,this.fc)):null!==t.getAttribute("style")?this.Ec(s):s}serializeTextNode(t,s,i){t.parentElement&&y(t.parentElement)&&(s.data=this.vc(s.data))}serializeTextMutation(t,s){return csNodeparentNode.apply(t)&&y(csNodeparentNode.apply(t))?this.vc(s):s}serializeAttributeMutationValue(t,s,i){if(wi.isSensitive(t))return s;if(m(t)||d(t)&&f(csNodeparentNode.apply(t))){if("src"===i&&(wn(s)||this.un.isOnlineAssetsActivated()))return this.fc++,this.wc(s,this.fc),this.lc+this.fc;if("srcset"===i&&this.un.isOnlineAssetsActivated()){const t=yn(s),i=this.fc+1;for(const s of t)this.fc++,this.wc(zt(s),this.fc);return this._c(i,s,t).value}}return p(t)&&"href"===i&&this.un.isOnlineAssetsActivated()?(this.fc++,this.Ac(s,this.fc),this.lc+this.fc):"style"===i?this.vc(s):s}vc(t){const s=csArray.from(new Set(er(t)));if(this.Rc(s)||this.un.isOnlineAssetsActivated()&&this.Sc(s)){let i=t;for(const t of s){if(this.Tc(t))return i;(this.un.isOnlineAssetsActivated()||wn(t))&&(this.fc++,i=csString.prototype.replace.call(i,t,this.lc+this.fc)),wn(t)?this.wc(t,this.fc):this.un.isOnlineAssetsActivated()&&(mn(t)?this.Ac(t,this.fc):this.wc(t,this.fc))}return i}return t}Rc(t){return csArray.prototype.some.call(t,(t=>wn(t)))}Sc(t){return csArray.prototype.some.call(t,(t=>!wn(t)))}Ec(t){return csArray.prototype.map.call(t,(t=>{if("style"!==t.name)return t;const s=document.createAttribute(t.name);return s.value=this.vc(t.value),s}))}mc(t,s){return csArray.prototype.map.call(t,(t=>{if("src"!==t.name)return t;const i=document.createAttribute(t.name);return i.value=this.lc+s,i}))}yc(t,s,i){return csArray.prototype.map.call(t,(t=>"srcset"!==t.name?t:this._c(s,t.value,i)))}_c(t,s,i){let e=t;const n=document.createAttribute("srcset");n.value=s;for(const t of i)n.value=csString.prototype.replace.call(n.value,t,this.lc+e),e++;return n}gc(t,s){const i=[];for(const e of t){const t=document.createAttribute(e.name);if(csArray.prototype.push.call(i,t),"href"===e.name){const n=document.createAttribute("data-cs-original-href");n.value=e.value,csArray.prototype.push.call(i,n),t.value=this.lc+s}else t.value=e.value}return i}wc(t,s){this.un.processStaticResource({id:s,input:t})}Ac(t,s){this.un.processStaticCssLinkResource({id:s,input:t})}Tc(t){return 0===csString.prototype.replaceAll.call(t,/['"]+/g,"").length}}function rr(t,s){let i,e,n,r,h=null;const o=c=>{const a=yt.now();if(!c&&null!==h){const t=s-(a-h);if(t>0)return void(e=window.setTimeout(o,t))}const u=a-n;e=null,h=null,n=null,r=t(u,...i)},c=(...t)=>{if(i=[...t],!n)return n=yt.now(),e=window.setTimeout(o,s),r;h=yt.now()};return c.flushPending=()=>{e&&(window.clearTimeout(e),o(!0))},c.cancel=()=>{h=null,n=null,e&&(window.clearTimeout(e),e=null)},c}function hr(t=0){return(s,i,e)=>{const n=e.value;let r=!1;e.value=function(...s){r||(r=!0,setTimeout((()=>{r=!1,n.apply(this,s)}),t))}}}!function(t){t[t.NOT_EXIST=2]="NOT_EXIST"}(tr||(tr={}));class or extends Zi{constructor(t,s,i,e=8388608){super(),this.un=t,this.Ic=s,this.Pc=i,this.bc=e,this.Vc={},this.Cc=new Set,this.xi=!1}onStart(){this.un.start()}onStop(){this.un.stop()}initState(){this.un.isStaticResourceManagerSupported()&&(this.Nc=this.Pc.getRequestParameters(),this.kc=`${this.Ic}/exist?${nt.toQuery(this.Nc)}`,this.Oc=`${this.Ic}/putTag?${nt.toQuery(this.Nc)}`,this.$c=rr((async()=>{if(this.xi)this.$c();else try{this.xi=!0,await this.xc()}finally{this.xi=!1}}),300),this.un.sendStaticResource((t=>{this.Cc.has(t.hash)||(this.Cc.add(t.hash),this.Vc[t.hash]=t,this.$c())})))}onIframeStaticResource(t){this.un.isStaticResourceManagerSupported()&&!this.Cc.has(t.hash)&&(this.Cc.add(t.hash),this.Vc[t.hash]=t,this.$c())}async xc(){const t=this.Vc;this.Vc={};const s=await this.Lc(t);if(!s.length)return;const i=this.Mc(s);await Promise.all(csArray.prototype.map.call(i,(t=>window.fetch(this.Oc,{method:"POST",body:t}))))}async Dc(t){try{const s=Object.keys(t);if(!s.length)return[];const i={projectId:this.Nc.pid,filter:tr.NOT_EXIST,hashes:s,touch:!0},e=await window.fetch(this.kc,{method:"POST",body:csJSON.stringify(i)});return await e.json()}catch(t){return[]}}async Lc(t){const s=[];try{const i=await this.Dc(t);csArray.prototype.forEach.call(i,(i=>{const e=t[i];e?csArray.prototype.push.call(s,e):ts.warn("SRM: received unknown hash: "+i)}))}catch(t){ts.warn(`SRM Service,getUnknownHashes error: ${t.message} `)}return s}Mc(t){let s=0;const i=[];for(const e of t){const{blob:t,hash:n}=e,r=s+t.size;if(rthis.Hc(t)))}evaluateUrl(t){return csArray.prototype.some.call(this.zc,(s=>{var i,e;const n=this.Fc(t,s);return(null==s?void 0:s.notOperator)?!(null===(i=s.regex)||void 0===i?void 0:i.test(n)):null===(e=s.regex)||void 0===e?void 0:e.test(n)}))}Fc(t,s){const i=jt(t);return i?s.ignoreQueryParams&&s.ignoreURIFragments?`${i.origin}${i.pathname}`:s.ignoreQueryParams?`${i.origin}${i.pathname}${i.hash}`:s.ignoreURIFragments?`${i.origin}${i.pathname}${i.search}`:t:t}Bc(t){return t.ignoreCaseSensitivity?"i":""}Hc(t){switch(t.operator){case Gn.NOT_START:t.notOperator=!0;case Gn.START:t.regex=new RegExp(`^${t.value}`,this.Bc(t));break;case Gn.NOT_END:t.notOperator=!0;case Gn.END:t.regex=new RegExp(`${t.value}$`,this.Bc(t));break;case Gn.NOT_CONTAIN:t.notOperator=!0;case Gn.CONTAIN:t.regex=new RegExp(`${t.value}`,this.Bc(t));break;case Gn.NOT_EXACT:t.notOperator=!0;case Gn.EXACT:t.regex=new RegExp(`^${t.value}$`,this.Bc(t));break;default:ts.warn(`buildRegexWithRule, unknown type: ${t.operator}`)}return t}}const ar={now:()=>void 0!==window.performance&&window.performance.now?window.performance.timing.navigationStart+Math.round(window.performance.now()):csDate.now()};function ur(t){const s=new ArrayBuffer(t.length),i=new Uint8Array(s);for(let s=0,e=t.length;scsString.prototype.padStart.call(t.toString(16),2,"0"))),"")}function wr(t){const s=-1!==csString.prototype.indexOf.call(t,";base64,"),i=csString.prototype.indexOf.call(t,","),e=s?[csString.prototype.substring.call(t,0,i-7),csString.prototype.substring.call(t,i+1)]:[csString.prototype.substring.call(t,0,i),csString.prototype.substring.call(t,i+1)];!s&&/^%3Csvg/i.test(e[1])&&(e[1]=decodeURIComponent(e[1]));const n=s?dr(e[1]):ur(e[1]);return new Blob([n],{type:csString.prototype.replace.call(e[0],"data:","")})}const pr="RSA-OAEP",mr="AES-CTR";var yr;!function(t){var s;let i,e=!1,n=null;const r=window.TextEncoder?new window.TextEncoder:null;let h;function o(){var t,s;return null!=(null===(s=null===(t=window.self.crypto)||void 0===t?void 0:t.subtle)||void 0===s?void 0:s.encrypt)&&null!=window.self.CryptoKey}async function c(s){if(!o()||e)return null;await i;let r=ur(s);r.byteLength>190&&(r=r.slice(0,190));try{return lr(await t.crypto.encrypt({name:pr},n,r))}catch{return null}}t.crypto=null===(s=window.crypto)||void 0===s?void 0:s.subtle,t.prop="toEncrypt",t.MAX_DIGEST_INPUT_SIZE=100,t.isKeyImported=function(){return!e},t.getCryptoKey=function(){return n},t.isSupported=o,t.importKey=async function(s){i=t.crypto.importKey("spki",dr(s),{name:pr,hash:"SHA-256"},!1,["encrypt"]).catch((()=>(e=!0,null))),n=await i,i=void 0,n||ss.warn(`Fail to import public key '${s}'`)},t.asymmetricEncrypt=c,t.symmetricEncrypt=async function(s,i){if(!o()||e)return null;const n={counter:i.initializationVector,name:mr,length:64},h=r.encode(s);try{return lr(await t.crypto.encrypt(n,i.cryptoKey,h))}catch{return null}},t.encryptSecret=async function(s){const i=await async function(s){var i;if(!o())return null;try{return null!==(i=(await t.crypto.exportKey("jwk",s)).k)&&void 0!==i?i:null}catch{return null}}(s);if(!i)throw new Error("Export secret failed");const e=await c(i);if(!e)throw new Error("Encrypt secret failed");return e},t.generateSymmetricKey=async function(){if(!o()||e)return null;try{return{cryptoKey:await t.crypto.generateKey({name:mr,length:128},!0,["encrypt","decrypt"]),initializationVector:window.crypto.getRandomValues(new Uint8Array(16))}}catch{return null}},t.setDigestSalt=function(t){h=t},t.digest=async function(s){s=csString.prototype.toLocaleLowerCase.call(csString.prototype.trim.call(s)),h&&(s=`${s}:${h}`);const i=r.encode(s);try{return fr(await t.crypto.digest("SHA-1",i))}catch{return null}},t.generateKeyPair=function(){return window.crypto.subtle.generateKey({name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!0,["encrypt","decrypt"])}}(yr||(yr={}));class Ar{constructor(t=100){this.qc=t,this.jc="original-resource-name",this.Gc=!1,this.wi=!1,this.Zc=!1,this.Wc="SHA-256",this.Jc={},this.Kc=null}init(){"Promise"in window&&"function"==typeof window.Promise&&yr.isSupported()&&(this.Gc=!0)}enableOnlineAssets(){this.Zc=!0}isOnlineAssetsActivated(){return this.Zc}isSupported(){return this.Gc}async processStaticResource(t){var s;try{if(!this.Gc)return;let i;if(wn(t.input)){const s=wr(t.input);if(!s)return;i=s}else{const s=await window.fetch(t.input);i=await s.blob()}const e=await i.arrayBuffer(),n=fr(await crypto.subtle.digest(this.Wc,e)),r=wn(t.input)?void 0:t.input;this.Xc(t.id,n,r),null===(s=this.Yc)||void 0===s||s.call(this,{hash:n,blob:i})}catch{}}async processStaticCssLinkResource(t){try{if(!this.Gc)return;const s=await this.Qc(t.input);this.Xc(t.id,s.get(zt(t.input)).hash,t.input),this.ta(s)}catch{}}isStaticResourceManagerSupported(){return this.Gc}onEvent(t){this.yi=t}sendStaticResource(t){this.Yc=t}flushEvents(){var t;if(!Object.keys(this.Jc).length)return;this.Kc&&clearTimeout(this.Kc);const s={type:Bs.RESOURCE_HASHES,date:ar.now(),args:[this.Jc]};this.Kc=null,this.Jc={},null===(t=this.yi)||void 0===t||t.call(this,s)}start(){this.wi||(this.wi=!0)}stop(){this.wi&&(this.wi=!1,this.Zc=!1,this.flushEvents())}Xc(t,s,i){let e=s;i&&(e+=`?${this.jc}=${i}`),this.Jc[t]=e,this.Kc&&clearTimeout(this.Kc),this.Kc=window.setTimeout((()=>this.flushEvents()),this.qc)}async Qc(t){const s=new Map,i=[{resourceRawPath:t,resourceAbsolutePath:zt(t)}];for(;i.length>0;){const t=csArray.prototype.pop.call(i);if(!this.isOnlineAssetsActivated()&&null!==t.resourceAbsolutePath&&!wn(t.resourceAbsolutePath))s.set(t.resourceAbsolutePath,null);else if(void 0===s.get(t.resourceAbsolutePath))try{if(null===t.resourceRawPath||csString.prototype.indexOf.call(t.resourceRawPath,".css")>0){if(!t.data){const s=await fetch(t.resourceAbsolutePath);t.data=await s.text()}t.nestedResources||(t.nestedResources=csArray.from(new Set(er(t.data))));let e=!1,n=!1;for(const r of t.nestedResources){const h=wn(r)?r:t.resourceAbsolutePath?Ht(r,t.resourceAbsolutePath):zt(r),o=s.get(h);if(void 0!==o){if(null!==o){const s=this.sa(o,r);t.data=csString.prototype.replaceAll.call(t.data,r,s)}continue}const c=void 0!==csArray.prototype.find.call(i,(t=>t.resourceAbsolutePath===h));c||(e=!0,n||(csArray.prototype.push.call(i,t),n=!0),csArray.prototype.push.call(i,{resourceRawPath:r,resourceAbsolutePath:h}))}if(!e){const i=await this.ia(t.data);s.set(t.resourceAbsolutePath,{hash:i.hash,blob:i.blob})}}else{let i;if(wn(t.resourceAbsolutePath)){const e=wr(t.resourceAbsolutePath);if(!e){s.set(t.resourceAbsolutePath,null);continue}i=e}else{const s=await fetch(t.resourceAbsolutePath);i=await s.blob()}const e=await this.ea(i);s.set(t.resourceAbsolutePath,{hash:e,blob:i})}}catch{s.set(t.resourceAbsolutePath,null)}}return s}sa(t,s){let i=`cs://resources/${t.hash}`;return wn(s)||(i+=`?${this.jc}=${s}`),i}async ia(t){const s=new Blob([t],{type:"text/css"}),i=await s.arrayBuffer();return{blob:s,hash:fr(await crypto.subtle.digest(this.Wc,i))}}async ea(t){const s=await t.arrayBuffer();return fr(await crypto.subtle.digest(this.Wc,s))}ta(t){t.forEach((t=>{var s;t&&(null===(s=this.Yc)||void 0===s||s.call(this,{hash:t.hash,blob:t.blob}))}))}}class gr{constructor(t){var s;this.hn=t,this.yi=W,this.wi=!1,this.na=new Set,this.ra=le(),this.ha=t=>this.inputHandler(t),this.oa=(t,s,i,e)=>{if(i&&this.wi&&t.isConnected){const s=yi(t);s&&this.ca(t)&&zi((()=>{this.aa(t,s)}))}return e.apply(t,[s])},this.ua(),this.da(),this.fa(),null===(s=this.hn)||void 0===s||s.onInputNodeToEncrypt((t=>{this.yi(t)}))}start(){this.wi||(this.wi=!0,Zs({type:"keyup",boundElement:document,listener:this.ha}),Zs({type:"change",boundElement:document,listener:this.ha}))}stop(){this.wi&&(this.wi=!1,Ws({type:"keyup",boundElement:document,listener:this.ha}),Ws({type:"change",boundElement:document,listener:this.ha}),this.na.forEach((t=>{Ws({type:"change",boundElement:t,listener:this.ha})})),this.na.clear())}serializeElementNode(t,s){if(this.wi){if(!this.ca(t))return;zi((()=>{this.aa(t,s.csId)}))}}onEvent(t){this.yi=t}aa(t,s){var i,e,n;if(this.ra.has(t))return;if(this.ra.add(t),this.wa(t)){const i={type:Bs.INPUT_SELECT,args:[s,t.selectedIndex],date:yt.now()};return void this.yi(i)}if(this.pa(t)){const i={type:Bs.INPUT_CHECKABLE,args:[s,t.checked],date:yt.now()};return void this.yi(i)}const r=this.ma(t),h=this.ya(t);if(r||h){const r=null!==(i=t.value)&&void 0!==i?i:"";if(null===(e=this.hn)||void 0===e?void 0:e.shouldEncrypt(t))return void(null===(n=this.hn)||void 0===n||n.registerInputNodeToEncrypt({targetId:s,targetValue:r,date:yt.now()}));const o=h?"0":"•",c={type:Bs.INPUT_TEXT,args:[s,csString.prototype.replace.call(r,/\S/g,o)],date:yt.now()};this.yi(c)}}inputHandler(t){const s=ni(t),i=yi(s);i&&this.ca(s)&&s.isConnected&&zi((()=>{this.aa(s,i)}))}afterSerializeShadowRoot(t){this.na.has(t)||(Zs({type:"change",listener:this.ha,boundElement:t}),this.na.add(t))}ua(){const t=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");if(!(null==t?void 0:t.configurable))return;const s=t.set,i=this;t.set=function(t){const e=t!==this.value;return i.oa(this,t,e,s)},Object.defineProperty(HTMLInputElement.prototype,"value",t)}da(){const t=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"checked");if(!(null==t?void 0:t.configurable))return;const s=t.set,i=this;t.set=function(t){const e=t!==this.checked;return i.oa(this,t,e,s)},Object.defineProperty(HTMLInputElement.prototype,"checked",t)}fa(){const t=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"selectedIndex");if(!(null==t?void 0:t.configurable))return;const s=t.set,i=this;t.set=function(t){const e=t!==this.selectedIndex;return i.oa(this,t,e,s)},Object.defineProperty(HTMLSelectElement.prototype,"selectedIndex",t)}wa(t){return ui.call(t,gr.Aa)}ma(t){return ui.call(t,gr.ga)}ya(t){return ui.call(t,gr.Ea)}pa(t){return ui.call(t,gr.va)}ca(t){return!wi.isSensitive(t)&&!wi.isSensitiveChild(t)&&(A(t)||_(t)||g(t))}}gr.ga=csArray.prototype.join.call(["textarea","input:not([type])",'input[type="text"]','input[type="email"]','input[type="search"]','input[type="tel"]','input[type="url"]','input[type="password"]'],","),gr.Ea='input[type="number"]',gr.va=csArray.prototype.join.call(['input[type="checkbox"]','input[type="radio"]'],","),gr.Aa="select",es([ri()],gr.prototype,"inputHandler",null);const Er="v2/recording",vr=["setCapturedElementsSelector"],_r=["setPIISelectors"],Rr=["isRecording"],Sr=["replay:resourceManager:enableForOnlineResource:nextPageviewOnly","cssrm:onlineAssets:activateForNextPageview"],Tr=["replay:resourceManager:getStatus","cssrm:getStatus"];class Ir{constructor(t,s,i,e,n,r,h,o,c,a,u,l,d,f,w,p,m,y,A,g,E,v){this._a=t,this.J=s,this.L=i,this.Co=e,this.Nc=n,this.Ra=r,this.M=h,this.Qe=o,this.tt=c,this.li=a,this.tn=u,this.en=l,this.nn=d,this.Sh=f,this.rn=w,this.ui=p,this.Sa=m,this.Ta=y,this.Ia=A,this.th=g,this.Pa=E,this.ba=v,this.un=null,this.Va=null}init(){const t=[],s=new Qn("csPersisted");this.Ca(s);const i=new ji;this.je=new qi;const e=new Je;this.Na=new cn(this.M,this.L),this.Na.init();const n=new En;csArray.prototype.push.call(t,n);const r=new _n(this.th),h=[new Bn,e,this.Na];let o=null;this.L.useStaticResourceManager&&(this.un=new Ar,this.un.init(),csArray.prototype.push.call(t,this.un),this.un.isStaticResourceManagerSupported()&&(o=new nr(this.un),csArray.prototype.push.call(h,o),this.Va=new or(this.un,this.L.getStaticResourceManagerUri(),this.Nc)));const c=new Kn,a=new qn(c);a.init(),csArray.prototype.push.call(t,a),a.isAdoptedStyleSheetsSupported()&&csArray.prototype.push.call(h,a);const u=new gr(this.hn);let l;csArray.prototype.push.call(h,u),l=this.ka()?new Hn(h):new Fn(h);const d=new an(i,this.Nc,{getRequestParameters:()=>({let:this.recordingService.getRecordingLastEventTimestamp()})},{getRequestParameters:()=>({rst:this.recordingService.getRecordingStartTimestamp()})},{getRequestParameters:()=>({rt:csArray.prototype.join.call(this.J.getRecordingStates(),",")})}),f=new Rn(`${this.L.getRecordingUri()}/${Er}`),w=new cr;this.Oa=new Wn(this.Co,this.L,this.tt,w),this.Oa.init(),this.ci=new je(l,this.Na,this.hn),this.ci.setAnonymization(this.Oa.shouldUseAnonymization()),this.Ke=new Ri,this.Ke.init();const p=new Fi(this.ci,r,this.ui,this.li);this.an=new Ue(s,f,this.cn),csArray.prototype.push.call(t,new Ze(n,c)),csArray.prototype.push.call(t,new un(window.location,this.M)),this.recordingService=new De(this.L,this.je,d,i,c,p,this.Ke,u,new In(this.Sh),this.Qe,this.J,this.tn,this.en,this.nn,this.rn,this.hn,this.cn,this.an,this.un,t,f),this.Sa.addListener(this.recordingService),this.Ta.addListener(this.recordingService),this.Va&&this.Ta.addListener(this.Va),r.init(),this.recordingService.init(),this.Ra.register(Rr,(()=>this.J.isReplayRecorded()&&!this.Ia.isUrlExcludedForSessionReplay())),this.Ra.register(vr,(t=>{Ve.setWhitelistedElementsSelector(t),this.ui.emitRecordingStatusChange()})),this.Ra.register(_r,(t=>{this.li.setPIISelectors(t),this.ui.emitRecordingStatusChange()})),this.Ra.register(Sr,(()=>{this.recordingService.activateOnlineAssetsOnNextPageview(),this.ui.emitRecordingStatusChange()})),this.Ra.register(Tr,(()=>this.recordingService.getStaticResourceManagerStatus())),this._a.enableRecordingStatus(this.recordingService,this.li,this.Oa,this.J,this.hn)}onAfterNaturalPageView(){var t;null===(t=this.Va)||void 0===t||t.initState()}onStartTracking(){this.an.recover(),this.ci.setAnonymization(this.Oa.shouldUseAnonymization()),this.J.isReplayRecorded()&&!this.Ia.isUrlExcludedForSessionReplay()&&(this.J.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.$a())}onArtificialPageViewEnd(){this.recordingService.clearStates(),!this.J.isReplayRecorded()||this.Ia.isUrlExcludedForSessionReplay()||this.J.isTemporarilyRecorded()||this.an.sendLastMessageBeacon()}onAfterArtificialPageView(){this.ci.setAnonymization(this.Oa.shouldUseAnonymization()),this.J.isReplayRecorded()&&!this.Ia.isUrlExcludedForSessionReplay()?(this.J.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.xa()):this.La()}onBeforeSessionRenewal(){this.recordingService.clearStates(),this.La()}onOptout(){this.La(),this.recordingService.onOptOut()}onReplayUnanonymizationConsentGranted(){this.ci.setAnonymization(this.Oa.shouldUseAnonymization()),this.recordingService.triggerUnanonymizationConsentGranted(),this.ui.emitRecordingStatusChange()}onReplayUnanonymizationConsentWithdrawn(){this.ci.setAnonymization(this.Oa.shouldUseAnonymization()),this.recordingService.triggerUnanonymizationConsentWithdrawn(),this.ui.emitRecordingStatusChange()}onRecordingStateChange(t,s){t===_s.NOT_RECORDED&&s===Rs.ETR_OFF?(this.recordingService.clearEvents(),this.La()):(this.cn.setQueryParams({rt:csArray.prototype.join.call(this.J.getRecordingStates(),",")}),this.recordingService.allowSendingEventsFromQuotaService(),this.ci.isDOMSerializationInProgress()||this.recordingService.pushEvents())}onInitialDomStart(){this.recordingService.blockSendingEventsFromSerialization(),this.an.blockSendingLastMessage()}onInitialDomDone(t){this.recordingService.allowSendingEventsFromSerialization(),this.recordingService.addInitialDom(t),this.an.allowSendingLastMessage(),this.Ke.start(),this.recordingService.pushEvents()}onAfterReplayRecordingConsentGranted(){this.J.isReplayRecorded()&&!this.Ia.isUrlExcludedForSessionReplay()&&(this.J.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.$a(),this.recordingService.triggerRecordingForSessionGranted())}onAfterReplayRecordingConsentWithdrawn(){this.recordingService.isRecording()&&(this.recordingService.triggerRecordingForSessionWithdrawn(),this.recordingService.clearStates(),this.La())}$a(){var t;this.recordingService.updateStaticResourceManagerOnlineAssets(),this.recordingService.start(),null===(t=this.Va)||void 0===t||t.start(),this.an.start(),this.ui.emitRecordingStatusChange()}La(){var t;this.recordingService.stop(),null===(t=this.Va)||void 0===t||t.stop(),this.an.stop(),this.ui.emitRecordingStatusChange()}xa(){this.La(),this.$a()}Ca(t){this.cn=this.Pa.create(`${this.L.getRecordingUri()}/${Er}`,!0,"byteArray",t)}ka(){return Jn.isAsyncSerializationSupported()&&this.L.asyncSerializerEnabled}Ma(){return!!this.L.encryptionPublicKey&&this.L.encryptionPublicKeyId>0&&yr.isSupported()}}var Pr,br;es([ei("Recording.onStartTracking")],Ir.prototype,"onStartTracking",null),es([ei("onInitialDomDone")],Ir.prototype,"onInitialDomDone",null),function(t){t[t.NOT_NEEDED=1]="NOT_NEEDED",t[t.NOT_EXPRESSED=2]="NOT_EXPRESSED",t[t.WITHDRAWN=3]="WITHDRAWN",t[t.GRANTED=4]="GRANTED"}(Pr||(Pr={})),function(t){t.isReplayConsentNeeded=function(t){return t.replayConsentRequiredForSession},t.isRecordingBlockedByConsent=function(t){return t.recordingState===_s.BLOCKED_BY_CONSENT_NOT_EXPRESSED||t.recordingState===_s.BLOCKED_BY_CONSENT_WITHDRAWN},t.isRecordingWithDrawn=function(t){return t.recordingState===_s.BLOCKED_BY_CONSENT_WITHDRAWN}}(br||(br={}));class Vr{constructor(t,s,i,e){this.W=t,this.J=s,this.L=i,this.Da=e,this.Ua=!1}isNaturalPageViewSent(){return this.Ua}setNaturalPageViewSent(t){this.Ua=t}getTrackingContext(){const t=this.J.getSession();if(!t)return null;const s=this.getSessionKey();if(!s)return null;const i=this.za(t),e=this.Ha(),n=this.Fa(),r=this.Ba();return{projectId:e,sessionKey:s,pageNumber:i,pageViewType:n,isRecording:this.qa(),uxaDomain:r,recordingConsentState:this.ja(t)}}getSessionKey(){const t=this.W.getVisitor();return t?`${t.id}.${t.visitsCount}`:null}ja(t){return br.isReplayConsentNeeded(this.L)?t.recordingState===_s.BLOCKED_BY_CONSENT_NOT_EXPRESSED?Pr.NOT_EXPRESSED:t.recordingState===_s.BLOCKED_BY_CONSENT_WITHDRAWN?Pr.WITHDRAWN:Pr.GRANTED:Pr.NOT_NEEDED}za(t){return t.pageNumber}Ha(){return this.L.projectId}Fa(){return this.Da.getPageViewType()}Ba(){return this.L.uxaDomain}qa(){return this.J.isReplayRecorded()}}class Cr{constructor(t){this.Ga=t,this.Za=[]}handleCommand(t){if(bt(t)&&(this.Wa(t),this.Ga.isNaturalPageViewSent())){const s=this.Ga.getTrackingContext();null!==s&&this.Ja(t,s)}}Wa(t){csArray.prototype.push.call(this.Za,t)}executeRegisteredCallbacks(){const t=this.Ga.getTrackingContext();null!==t&&csArray.prototype.map.call(this.Za,(s=>this.Ja(s,t)))}Ja(t,s){setTimeout((()=>{t(s)}))}}class Nr{constructor(t){this.Ga=t,this.Ka=[]}handleCommand(t){return this.Ga.isNaturalPageViewSent()?this.Xa(t):void this.Ya(t)}Xa(t){const s=this.Ga.getSessionKey();return this.Mo(t)&&null!==s&&this.Ja(t.callback,s),s}Ya(t){this.Mo(t)&&csArray.prototype.push.call(this.Ka,t.callback)}flushPendingCallbacks(){const t=this.Ga.getSessionKey();null!==t&&csArray.prototype.forEach.call(this.Ka,(s=>{this.Ja(s,t)})),this.Ka=[]}Mo(t){return t&&"function"==typeof t.callback}Ja(t,s){setTimeout((()=>{t(s)}))}}class kr{constructor(t,s){this.Qa=t,this.Ga=s}onTrackingContextRequestCallback(t){const s=this.Ga.getTrackingContext();null!==s&&this.Qa.sendToChildren(Jt.TrackingContextResultMessage,{...t,trackingContext:s})}onIframeIntegrationCallback(t){if(!this.Ga.isNaturalPageViewSent())return;const s=this.Ga.getTrackingContext();null!==s&&(t.trackingContext=s,this.Qa.sendToChildren(Jt.IntegrationCallback,t))}sendAfterPageViewCallbackToChildren(){const t=this.Ga.getTrackingContext();if(null===t)return;const s={trackingContext:t,initiator:Zt.AfterPageView};this.Qa.sendToChildren(Jt.IntegrationCallback,s)}}function Or(t,s){const{isRecording:i,pageNumber:e,projectId:n,uxaDomain:r}=t,h=/^(.+)\.(\d+)$/.exec(t.sessionKey);let o;if(i&&h){const[,t,i]=h;o=`${r}/quick-playback/index.html?pid=${n}&uu=${t}&sn=${i}&pvid=${e}&recordingType=cs`,s.withTimestamp&&(o+="&t="+(yt.now()-s.recordingStartTimestamp))}return{replayLink:o,isRecording:i}}class $r{constructor(t){this.Ga=t}handleCommand(t,s){Tt(t)&&bt(s)&&this.Ja(t,s)}Ja(t,s){setTimeout((()=>{const i=this.Ga.getTrackingContext();if(i){const e=Or(i,t);s(e)}}))}}class xr{constructor(){this.Za=new Set}handleCommand(t,s){return bt(t)?this.Za.has(t)?null:(this.Za.add(t),s&&(this.tc=s,this.tu(t,s)),()=>this.Za.delete(t)):null}executeCallbacks(t){this.su(t)&&(this.tc=t,this.Za.forEach((s=>this.tu(s,t))))}tu(t,s){setTimeout((()=>{try{t(s)}catch(t){}}))}su(t){const{isRecording:s,recordingStartTimestamp:i,etrState:e}=t;return this.tc&&(this.tc.isRecording!==s||this.tc.recordingStartTimestamp!==i||this.tc.etrState!==e)}}const Lr=["afterPageView"],Mr=["getSessionKey"],Dr=["onRecordingStateChange"],Ur=["replay:link:generate"];class zr{constructor(t,s,i,e,n,r,h,o){this.W=t,this.J=s,this.Ra=i,this.iu=e,this.Qa=n,this.L=r,this.Da=h,this._a=o}init(){this.Ga=new Vr(this.W,this.J,this.L,this.Da),this.eu=new Cr(this.Ga),this.nu=new Nr(this.Ga),this.ru=new xr,this.hu=new $r(this.Ga),this.ou=new kr(this.Qa,this.Ga),this.iu.addListener(this.ou),this.Ra.register(Mr,(t=>this.nu.handleCommand(t))),this.Ra.register(Lr,(t=>this.eu.handleCommand(t))),this.Ra.register(Dr,(t=>{this.ru.handleCommand(t,this._a.getRecordingStatus())})),this.Ra.register(Ur,((t,s)=>{this.au&&this.hu.handleCommand({...t,recordingStartTimestamp:this._a.getRecordingStatus().recordingStartTimestamp},s)}))}onAfterNaturalPageView(){this.Ga.setNaturalPageViewSent(!0),this.nu.flushPendingCallbacks(),this.eu.executeRegisteredCallbacks(),this.ou.sendAfterPageViewCallbackToChildren()}onAfterArtificialPageView(){this.eu.executeRegisteredCallbacks(),this.ou.sendAfterPageViewCallbackToChildren()}onRecordingStateChange(){this.ru.executeCallbacks(this._a.getRecordingStatus())}onRecordingStatusChange(){this.ru.executeCallbacks(this._a.getRecordingStatus())}setRecordingService(t){this.au=t}}es([hr()],zr.prototype,"onRecordingStateChange",null),es([hr()],zr.prototype,"onRecordingStatusChange",null);class Hr{constructor(t,s){this.key=csString.prototype.slice.call(t,0,512),this.value=St(s)?csString.prototype.slice.call(s,0,255):s}static isValid(t,s){return St(t)&&(St(s)||Rt(s))}}class Fr extends Zi{constructor(t,s){super(),this.lu=t,this.M=s,this.du=[]}onStart(){csArray.prototype.forEach.call(this.du,(t=>this.trackDynamicVariable(t.key,t.value))),this.du=[]}onStop(){}trackDynamicVariable(t,s){this.isStarted?Hr.isValid(t,s)&&this.lu.add(new Hr(this.M.anonymizePII(t),this.M.anonymizePII(s))):csArray.prototype.push.call(this.du,{key:t,value:s})}}class Br{constructor(t){this.fu=t,this.lu=[]}add(t){csArray.prototype.push.call(this.lu,t),this.setBatchReadyCall()}clear(){this.lu=[]}onBatchReady(t){this.wu=t}getRequestParameters(){const t={};for(const s of this.lu)t[s.key]=s.value;return{dv:this.fu.compressSync(csJSON.stringify(t),"base64"),ct:this.fu.algorithm}}setBatchReadyCall(){this.wu()}}es([hr(),is("dynamicVariablesBatchReady")],Br.prototype,"setBatchReadyCall",null);const qr=["trackDynamicVariable"];class jr{constructor(t,s,i,e,n,r){this.Ra=t,this.J=s,this.L=i,this.Nc=e,this.fu=n,this.M=r,this.N=new ht(this.L.getTrackerUri(),"dvar"),this.lu=new Br(this.fu),this.pu=new Fr(this.lu,this.M)}init(){this.N.setRequestParametersProviders(this.Nc,this.lu),this.J.setDynamicVariablesService(this.pu),this.lu.onBatchReady((()=>this.N.send())),this.N.after((()=>this.lu.clear())),this.Ra.register(qr,(({key:t,value:s}={})=>{this.pu.trackDynamicVariable(t,s)}))}onStartTracking(){this.pu.start()}}class Gr{constructor(t,s){this.id=t,this.revenue=s}static from(t){const s=new Gr(t.id,parseFloat(t.revenue));return isNaN(parseFloat(t.tax))||(s.tax=parseFloat(t.tax)),isNaN(parseFloat(t.shipping))||(s.shipping=parseFloat(t.shipping)),St(t.currency)&&t.currency.length<=10&&(s.currency=t.currency),s}hasValidRevenue(){return!isNaN(this.revenue)&&this.revenue>=0}static isValid(t){return Pt(t)&&_t(t.revenue)&&St(t.currency)&&t.currency.length<=10&&(!Pt(t.id)||St(t.id))}}class Zr{constructor(t,s,i,e){this.id=t,this.name=s,this.price=i,this.quantity=e}static from(t){if(!Zr.mu(t))return null;const s=new Zr(t.id,t.name,parseFloat(t.price),parseInt(t.quantity,10));return It(t.sku)&&(s.sku=t.sku),It(t.category)&&(s.category=t.category),It(t.merchant)&&t.merchant.length>0&&(s.merchant=t.merchant.slice(0,100)),s}static mu(t){return Pt(t)&&St(t.id)&&St(t.name)&&_t(parseFloat(t.price))&&Rt(parseInt(t.quantity,10))&&(!It(t.sku)||St(t.sku))&&(!It(t.category)||St(t.category))&&(!It(t.merchant)||St(t.merchant))}}class Wr{constructor(t,s,i){this.M=t,this.yu=s,this.Qe=i,this.clear()}addTransaction(t){const s=this.M.anonymizeFields(t,["id"]);this.Au=Gr.from(s)}getTransaction(){return this.Au}sendTransaction(){null!==this.yu&&null!==this.Qe&&this.Qe.isSessionValid()&&(this.Au.hasValidRevenue()?this.yu.send():ts.warn("Transaction Service: unable to send transaction with invalid parameters"))}addItem(t){if(bt(t))return;const s=this.M.anonymizeFields(t,["id","name","sku","category"]),i=Zr.from(s);null!==i&&csArray.prototype.push.call(this.gu,i)}getItems(){return this.gu}clear(){this.Au=Gr.from({revenue:NaN}),this.gu=[]}getRequestParameters(){const t={id:this.Au.id?`${this.Au.id}`:"",revenue:`${this.Au.revenue}`};return It(this.Au.tax)&&(t.tax=`${this.Au.tax}`),It(this.Au.shipping)&&(t.shipping=`${this.Au.shipping}`),It(this.Au.currency)&&(t.cu=`${this.Au.currency}`),t.items=window.csJSON.stringify(this.gu),t}}class Jr{constructor(t,s){this.Eu=t,this.Qe=s,this.vu=null}addToCart(t){const s={};St(t.sku)&&(s.sku=csString.prototype.slice.call(t.sku,0,100)),St(t.merchant)&&(s.merchant=csString.prototype.slice.call(t.merchant,0,100)),(s.sku||s.merchant)&&(this.vu=s,this.sendCartItem())}getCartItem(){return this.vu}sendCartItem(){this.Qe.isSessionValid()&&this.Eu.send()}clear(){this.vu=null}getRequestParameters(){if(!this.vu)return{};const t={};return St(this.vu.sku)&&this.vu.sku.length>0&&(t.sku=this.vu.sku),St(this.vu.merchant)&&this.vu.merchant.length>0&&(t.me=this.vu.merchant),t}}const Kr=["ecommerce:addToCart","ec:cart:add"],Xr=["ecommerce:addTransaction","ec:transaction:create"],Yr=["ecommerce:addItem","ec:transaction:items:add"],Qr=["ecommerce:send","ec:transaction:send"];class th{constructor(t,s,i,e,n,r,h){this.L=t,this.Pc=s,this.W=i,this.Ra=e,this.M=n,this.Qe=r,this.tt=h}init(){const t=new ht(this.L.getTrackerUri(),"transaction"),s=new ht(this.L.getTrackerUri(),"addtocart"),i=new Wr(this.M,t,this.Qe),e=new Jr(s,this.Qe),n=new an(this.Pc,this.W,this.tt,i);t.setRequestParametersProviders(n),t.after((()=>{i.clear()}));const r=new an(this.Pc,this.W,this.tt,e);s.setRequestParametersProviders(r),s.after((()=>{e.clear()})),this.Ra.register(Xr,(t=>{i.addTransaction(t)})),this.Ra.register(Yr,(t=>i.addItem(t))),this.Ra.register(Qr,(()=>i.sendTransaction())),this.Ra.register(Kr,(t=>{e.addToCart(t)}))}}class sh{constructor(t){this._u=t.performance}getRequestParameters(){if(this.Ru())return{};const t=this.Su();return{str:t.startRender,di:t.domInteractive,dc:t.domComplete,fl:t.fullyLoaded}}Su(){const t=this._u.timing;return{startRender:""+(t.domLoading-t.requestStart),domInteractive:""+(t.domInteractive-t.requestStart),domComplete:""+(t.domComplete-t.requestStart),fullyLoaded:""+(t.loadEventEnd-t.requestStart)}}Ru(){return!(this._u&&this._u.timing&&this._u.timing.loadEventEnd>0)}}var ih,eh;function nh(t){return void 0!==t.tgt}!function(t){t[t.RESIZE=0]="RESIZE",t[t.SCROLL=1]="SCROLL",t[t.MOUSEMOVE=2]="MOUSEMOVE",t[t.MOUSEDOWN=3]="MOUSEDOWN",t[t.MOUSEUP=4]="MOUSEUP",t[t.CLICK=5]="CLICK",t[t.MOUSEOVER=6]="MOUSEOVER",t[t.MOUSEOUT=7]="MOUSEOUT",t[t.CHANGE=10]="CHANGE",t[t.FOCUSIN=11]="FOCUSIN",t[t.FOCUSOUT=12]="FOCUSOUT",t[t.TAP=14]="TAP",t[t.KEYDOWN=15]="KEYDOWN",t[t.KEYUP=16]="KEYUP",t[t.COMMAND=17]="COMMAND",t[t.SUBMIT=18]="SUBMIT",t[t.PERFORMANCE=19]="PERFORMANCE",t[t.DRAG=20]="DRAG",t[t.FLICK=21]="FLICK",t[t.KEYBOARD_NAVIGATION=22]="KEYBOARD_NAVIGATION",t[t.ZOOM=23]="ZOOM",t[t.VIEWPORT_SCALE=24]="VIEWPORT_SCALE",t[t.TEXT_HIGHLIGHT=25]="TEXT_HIGHLIGHT",t[t.DEAD_CLICK=30]="DEAD_CLICK",t[t.DEAD_ZOOM=31]="DEAD_ZOOM",t[t.PAGE_RELOAD=32]="PAGE_RELOAD",t[t.THRASHED_CURSOR=33]="THRASHED_CURSOR",t[t.BLANK_PAGE=34]="BLANK_PAGE"}(ih||(ih={})),function(t){t.SUCCESS="success",t.FAILURE="failure",t.ATTEMPT="attempt"}(eh||(eh={}));class rh{static build(t,s,i){return csArray.prototype.reduce.call(i,((s,i)=>i.enhanceAnalysisEvent(t,s)),s)}}class hh{isEventTypeSupported(t){return-1!==csArray.prototype.indexOf.call(this.supportedEventTypes,t)}enhanceAnalysisEvent(t,s){return this.isEventTypeSupported(s.type)?this.baseEnhanceAnalysisEvent(t,s):s}}class oh extends hh{constructor(t){super(),this.Tu=t,this.supportedEventTypes=[ih.MOUSEDOWN,ih.MOUSEUP,ih.CLICK,ih.MOUSEOVER,ih.TAP,ih.DRAG,ih.FLICK]}baseEnhanceAnalysisEvent(t,s){return s.tgt||(s.tgt=this.Tu.getEventTargetPath(t)),s}}class ch{constructor(t,s,i,e){this.L=t,this.Tu=s,this.Sh=i,this.Iu=e,this.Pu=[],csArray.prototype.push.call(this.Pu,new oh(this.Tu))}processGesture(t,s){switch(t.type){case Sn.TAP:this.bu(s);break;case Sn.FLICK:this.Vu(t,s);break;case Sn.DRAG:this.Cu(t,s)}}bu(t){const s={type:ih.TAP,ts:0,x:0,y:0,tgt:""},i=rh.build(t,s,this.Pu);i.tgt!==G.INVALID_ELEMENT&&this.yi(i)}Cu(t,s){var i,e;const n={type:ih.DRAG,ts:0,fd:t.direction,tgt:""};(null===(i=this.Iu)||void 0===i?void 0:i.collectGestureDistance)&&(n.distance=t.distance),(null===(e=this.Iu)||void 0===e?void 0:e.collectGestureVelocity)&&(n.velocity=t.velocity);const r=rh.build(s,n,this.Pu);r.tgt!==G.INVALID_ELEMENT&&this.yi(r)}Vu(t,s){var i,e;const n={type:ih.FLICK,ts:0,fd:t.direction,tgt:""};(null===(i=this.Iu)||void 0===i?void 0:i.collectGestureDistance)&&(n.distance=t.distance),(null===(e=this.Iu)||void 0===e?void 0:e.collectGestureVelocity)&&(n.velocity=t.velocity);const r=rh.build(s,n,this.Pu);r.tgt!==G.INVALID_ELEMENT&&this.yi(r)}onEvent(t){this.yi=t}start(){this.Sh.subscribe(ch.Th,((t,s)=>this.processGesture(t,s)))}stop(){this.Sh.unsubscribe(ch.Th)}}ch.Th="AnalysisGestureTracker",es([ri()],ch.prototype,"processGesture",null);var ah;!function(t){t.getRelativePosition=function(t){const s=ni(t);if(!(s&&u(s)&&bt(s.getBoundingClientRect)&&Pt(t.pageX)&&Pt(t.pageY)))return{xRel:-1,yRel:-1,valid:!1};const i=s.getBoundingClientRect();let e=t.pageX-i.left-Yi.windowOffsetX(),n=t.pageY-i.top-Yi.windowOffsetY();s!==document.documentElement&&(e+=s.scrollLeft,n+=s.scrollTop);const r=Math.max(s.scrollWidth,i.width),h=Math.max(s.scrollHeight,i.height);return{xRel:Math.round(e/r*65535),yRel:Math.round(n/h*65535),valid:!0}}}(ah||(ah={}));class uh extends hh{constructor(t,s){super(),this.V=t,this.Tu=s,this.supportedEventTypes=[ih.MOUSEMOVE,ih.CLICK],this.Nu=""}baseEnhanceAnalysisEvent(t,s){const{valid:i,xRel:e,yRel:n}=ah.getRelativePosition(t);if(i){const i=this.Tu.getEventTargetPath(t);i!==G.INVALID_ELEMENT&&(s.xRel=e,s.yRel=n,s.type===ih.MOUSEMOVE&&(i!==this.Nu||this.V.iframesTracking?(this.Nu=i,s.tgtHM=i):s.tgtHM=""))}else s.type===ih.MOUSEMOVE&&(this.Nu="");return s}}class lh extends hh{constructor(){super(...arguments),this.supportedEventTypes=[ih.CHANGE],this.ku=["text","email","number","search","tel","url","password"]}baseEnhanceAnalysisEvent(t,s){const i=ni(t);return A(i)&&csArray.prototype.indexOf.call(this.ku,i.type)>=0&&(s.isBlank=""===i.value),s}}class dh{constructor(t,s,i){this.V=t,this.Tu=s,this.Ou=i,this.$u="select, select *, input, textarea",this.xu="select, select *, input, textarea",this.Lu="a, a *, button, button *, select, select *, input, textarea",this.Mu="input, select, textarea",this.Du=150,this.Uu=400,this.zu=!1,this.Hu=rr(((t,s)=>this.scrollListener(t,s)),this.Du),this.Fu=rr((t=>this.resizeListener(t)),this.Du),this.Bu=Fs((t=>this.mouseMoveListener(t)),this.Uu),this.qu=[{boundElement:window,type:"resize",listener:()=>this.Fu()},{boundElement:document,type:"scroll",listener:t=>this.Hu(t)},{boundElement:window,type:"mousemove",listener:t=>{this.Bu(function(t){return t.composedPath&&Object.defineProperty(t,"__csOriginalTarget",{value:t.composedPath()[0],writable:!1,enumerable:!1}),t}(t))}},{boundElement:document,type:"mousedown",listener:t=>this.mouseDownListener(t)},{boundElement:document,type:"mouseup",listener:t=>this.mouseUpListener(t)},{boundElement:document,type:"click",listener:t=>this.clickListener(t)}],this.ju=[{type:"change",listener:this.Ou.on(this.xu,(t=>this.changeListener(t)))}],this.Gu=[{boundElement:document,type:"mouseover",listener:this.Ou.on(this.Lu,(t=>this.mouseOverListener(t)))},{boundElement:document,type:"mouseout",listener:this.Ou.on(this.Lu,(t=>this.mouseOutListener(t)))},{boundElement:document,type:"focusin",listener:this.Ou.on(this.$u,(t=>this.focusInListener(t)))},{boundElement:document,type:"focusout",listener:this.Ou.on(this.$u,(t=>this.focusOutListener(t)))},{boundElement:document,type:"keyup",listener:this.Ou.on(this.Mu,(t=>this.keyUpListener(t)))},{boundElement:document,type:"keydown",listener:this.Ou.on(this.Mu,(t=>this.keyDownListener(t)))},{boundElement:document,type:"copy",listener:this.Ou.on(this.Mu,(t=>this.copyListener(t)))},{boundElement:document,type:"cut",listener:this.Ou.on(this.Mu,(t=>this.cutListener(t)))},{boundElement:document,type:"paste",listener:this.Ou.on(this.Mu,(t=>this.pasteListener(t)))},...csArray.prototype.map.call(this.ju,(t=>({...t,boundElement:document})))],this.Pu=[],this.ei={},this.Ds=new Set,this.Zu=(t,s)=>{switch(s){case"initial":this.Ds.add(t);break;case"added":this.Ds.has(t)||(this.Ds.add(t),this.Ws(t));break;case"removed":this.ti(t),this.Ds.delete(t)}},this.Wu=new Te(this.Zu),this.Gs(),this.V.mouseMoveHeatmapEnabled&&csArray.prototype.push.call(this.Pu,new uh(this.V,this.Tu)),csArray.prototype.push.call(this.Pu,new lh,new oh(this.Tu))}Ws(t){if(T(t)){const t=this.Ju();csArray.prototype.forEach.call(t,(t=>Zs(t)))}else{const s=this.Ku();csArray.prototype.forEach.call(s,(s=>{Zs({...s,boundElement:t})}))}}ti(t){if(T(t)){const t=this.Ju();csArray.prototype.forEach.call(t,(t=>Ws(t)))}else{const s=this.Ku();csArray.prototype.forEach.call(s,(s=>{Ws({...s,boundElement:t})}))}}onEvent(t){this.yi=t}start(){this.Wu.observe(),this.Ws(document),this.Ds.forEach((t=>this.Ws(t))),this.resizeListener()}stop(){this.ti(document),csArray.prototype.forEach.call(this.Wu.shadowRoots,(t=>this.ti(t))),this.Wu.disconnect(),this.Ds.clear()}flushPendingDebouncedListeners(){this.Hu.flushPending(),this.Fu.flushPending()}Ku(){return this.Ou.isMatchesSelectorSupported()?this.ju:(ts.warn("Element.matches is not implemented yet"),[])}Ju(){return this.Ou.isMatchesSelectorSupported()?[...this.qu,...this.Gu]:(ts.warn("Element.matches is not implemented yet"),this.qu)}resizeListener(t){const s=ci.getScrollContainer(),i=Vt(s);i&&(this.zu=!0);const e={type:ih.RESIZE,ts:0,x:i?s.clientWidth:Yi.windowWidth(),y:i?s.clientHeight:Yi.windowHeight()};void 0!==t&&(e.d=t),this.yi(e)}scrollListener(t,s){const i=ci.isEventOnScrollContainer(s);!this.zu&&i&&this.resizeListener();const e={type:ih.SCROLL,ts:0,x:i?csEventtarget.apply(s).scrollLeft:Yi.windowOffsetX(),y:i?csEventtarget.apply(s).scrollTop:Yi.windowOffsetY(),d:t},n=rh.build(s,e,this.Pu);this.yi(n)}mouseMoveListener(t){const s={type:ih.MOUSEMOVE,ts:0,x:t.pageX,y:t.pageY},i=rh.build(t,s,this.Pu);this.yi(i)}mouseDownListener(t){const s={type:ih.MOUSEDOWN,ts:0,x:t.pageX,y:t.pageY,tgt:""},i=rh.build(t,s,this.Pu);this.Xu(i)}mouseUpListener(t){const s={type:ih.MOUSEUP,ts:0,x:t.pageX,y:t.pageY,tgt:""},i=rh.build(t,s,this.Pu);this.Xu(i)}clickListener(t){const s={type:ih.CLICK,ts:0,x:t.pageX,y:t.pageY,tgt:""},i=rh.build(t,s,this.Pu);this.Xu(i)}mouseOverListener(t){const s={type:ih.MOUSEOVER,ts:0,x:t.pageX,y:t.pageY,tgt:""},i=rh.build(t,s,this.Pu);this.Xu(i)}mouseOutListener(t){const s={type:ih.MOUSEOUT,ts:0,x:t.pageX,y:t.pageY,tgt:this.Tu.getEventTargetPath(t)},i=rh.build(t,s,this.Pu);this.Xu(i)}focusInListener(t){const s={type:ih.FOCUSIN,ts:0,tgt:this.Tu.getEventTargetPath(t)},i=rh.build(t,s,this.Pu);this.Xu(i)}focusOutListener(t){const s={type:ih.FOCUSOUT,ts:0,tgt:this.Tu.getEventTargetPath(t)},i=rh.build(t,s,this.Pu);this.Xu(i)}changeListener(t){const s={type:ih.CHANGE,ts:0,tgt:this.Tu.getEventTargetPath(t)},i=rh.build(t,s,this.Pu);this.Xu(i)}copyListener(t){const s={type:ih.COMMAND,ts:0,tgt:this.Tu.getEventTargetPath(t),key:Ks.COPY};this.Xu(s)}cutListener(t){const s={type:ih.COMMAND,ts:0,tgt:this.Tu.getEventTargetPath(t),key:Ks.CUT};this.Xu(s)}pasteListener(t){const s={type:ih.COMMAND,ts:0,tgt:this.Tu.getEventTargetPath(t),key:Ks.PASTE};this.Xu(s)}keyUpListener(t){const s={type:ih.KEYUP,ts:0,tgt:this.Tu.getEventTargetPath(t),key:this.Yu(t)};this.Xu(s)}keyDownListener(t){const s={type:ih.KEYDOWN,ts:0,tgt:this.Tu.getEventTargetPath(t),key:this.Yu(t)};this.Xu(s)}Yu(t){const s=this.ei[t.key];return void 0===s?Js.ALPHANUMERICAL:s}Xu(t){nh(t)&&t.tgt!==G.INVALID_ELEMENT&&this.yi(t)}Gs(){this.ei[" "]=Js.SPACE,this.ei.Spacebar=Js.SPACE,this.ei.Enter=Js.ENTER,this.ei.Backspace=Js.BACKSPACE,this.ei.Delete=Js.DELETE,this.ei.ArrowUp=Js.ARROWUP,this.ei.ArrowDown=Js.ARROWDOWN,this.ei.ArrowLeft=Js.ARROWLEFT,this.ei.ArrowRight=Js.ARROWRIGHT,this.ei.Up=Js.ARROWUP,this.ei.Down=Js.ARROWDOWN,this.ei.Left=Js.ARROWLEFT,this.ei.Right=Js.ARROWRIGHT,this.ei.CapsLock=Js.CAPSLOCK,this.ei.Shift=Js.SHIFT,this.ei.Tab=Js.TAB}}es([is("Event handler type: resize")],dh.prototype,"resizeListener",null),es([is("Event handler type: scroll")],dh.prototype,"scrollListener",null),es([is("Event handler type: mouseMove"),ri()],dh.prototype,"mouseMoveListener",null),es([is("Event handler type: mouseDown"),ri()],dh.prototype,"mouseDownListener",null),es([is("Event handler type: mouseUp"),ri()],dh.prototype,"mouseUpListener",null),es([is("Event handler type: click"),ri()],dh.prototype,"clickListener",null),es([is("Event handler type: mouseOver"),ri()],dh.prototype,"mouseOverListener",null),es([is("Event handler type: mouseOut"),ri()],dh.prototype,"mouseOutListener",null),es([is("Event handler type: focusIn")],dh.prototype,"focusInListener",null),es([is("Event handler type: focusOut")],dh.prototype,"focusOutListener",null),es([is("Event handler type: change")],dh.prototype,"changeListener",null),es([is("Event handler type: copy")],dh.prototype,"copyListener",null),es([is("Event handler type: cut")],dh.prototype,"cutListener",null),es([is("Event handler type: paste")],dh.prototype,"pasteListener",null),es([is("Event handler type: keyup")],dh.prototype,"keyUpListener",null),es([is("Event handler type: keydown")],dh.prototype,"keyDownListener",null);class fh{constructor(){this.Qu=100,this.tl=0,this.sl=Yi.documentHeight(),this.il={boundElement:document,type:"scroll",listener:t=>this.maxScrollRateListener(t)}}onEvent(t){this.yi=t}start(){Zs(this.il),this.reset()}stop(){Ws(this.il)}reset(){this.sl=Yi.documentHeight();const t=ci.getScrollContainer();if(null===t)this.tl=this.el(Yi.documentHeight());else{const s=this.nl(t);this.tl=this.rl(t,s)}this.yi()}maxScrollRateListener(t){let s,i;if(ci.isEventOnScrollContainer(t)){const e=csEventtarget.apply(t),n=this.nl(e);s=this.hl(e,n),i=this.rl(e,n)}else s=Yi.documentHeight(),i=this.el(s);(i>this.tl||s>this.sl)&&(this.tl=i,s>this.sl&&(this.sl=s),this.yi())}el(t){const s=Math.round(this.ol()/t*100);return Math.min(s,this.Qu)}ol(){const t=Yi.windowHeight();return Yi.windowOffsetY()+t}rl(t,s){const i=t.scrollTop+t.clientHeight+t.getBoundingClientRect().top+s,e=this.hl(t,s),n=Math.round(i/e*100);return Math.min(n,this.Qu)}nl(t){const s=window.getComputedStyle(t).paddingTop||"0px";return parseInt(s,10)}hl(t,s){return t.scrollHeight+t.getBoundingClientRect().top+s}getRequestParameters(){return{sr:`${this.tl}`,mdh:`${this.sl}`}}}es([is("MaxScrollRate handler")],fh.prototype,"maxScrollRateListener",null);class wh{constructor(t,s,i,e,n,r,h,o,c,a,u,l,d,f,w,p,m,y,A,g,E){this.L=t,this.cl=s,this.Sh=i,this.al=e,this.ul=n,this.ll=r,this.dl=h,this.wl=o,this.Qe=c,this.Wt=a,this.pl=u,this.ml=l,this.Tn=d,this.cn=f,this.yl=w,this.Al=p,this.gl=m,this.El=y,this.vl=A,this._l=g,this.Rl=E,this.mn=new Gi,this.Sl=!1}init(){var t,s,i,e,n,r,h;this.cl.onEvent((t=>this._n(t))),this.Sh.onEvent((t=>this._n(t))),this.al.onEvent((()=>{const t=this.al.getRequestParameters();this.cn.setQueryParams(t),this.dl.setQueryParams(t)})),this.ml.onEvent((t=>this.Tl(t))),this.Il(),null===(t=this.yl)||void 0===t||t.onEvent((t=>this._n(t))),null===(s=this.vl)||void 0===s||s.onEvent((t=>this._n(t))),null===(i=this.Al)||void 0===i||i.onEvent((t=>this._n(t))),null===(e=this.gl)||void 0===e||e.onEvent((t=>this._n(t))),this.Pl(),null===(n=this.El)||void 0===n||n.onEvent((t=>this.Tl(t))),null===(r=this._l)||void 0===r||r.onEvent((t=>this.Tl(t))),null===(h=this.Rl)||void 0===h||h.onEvent((t=>this.Tl(t)))}Pl(){this.dl.onBeaconSuccess((()=>{this.ll.clearEvents()})),this.dl.onBeaconFailure((t=>{this.bl(t)}))}initStates(){const t=this.wl.getRequestParameters(),s=this.ul.getRequestParameters(),i=this.al.getRequestParameters();this.cn.setQueryParams(t),this.cn.setQueryParams(s),this.cn.setQueryParams(i),this.dl.setQueryParams(t),this.dl.setQueryParams(s),this.dl.setQueryParams(i),this.Vl()}start(t){var s,i,e,n,r,h,o;t||null===(s=this.El)||void 0===s||s.start(),this.Tn.start(),this.cl.start(),this.al.start(),this.Sh.start(),null===(i=this.yl)||void 0===i||i.start(),null===(e=this.gl)||void 0===e||e.start(),t||this.ml.start(),null===(n=this.Al)||void 0===n||n.start(),null===(r=this.vl)||void 0===r||r.start(),null===(h=this._l)||void 0===h||h.start(),null===(o=this.Rl)||void 0===o||o.start()}collectInitialEvents(){var t;null===(t=this.yl)||void 0===t||t.collectInitialEvents()}onIframeAnalysisEvent(t){this.kn(t)}Tl(t){this.Qe.isCurrentPageviewValid()&&this.kn(t)}_n(t){this.Qe.isSessionValid()&&this.kn(t)}kn(t){this.ll.addEvent(this.Cl(t)),this.ll.isFull()&&this.sendEvents(),this.L.emitDebugEvents&&this.mn.emit("analysisEvent",{...t,typeName:ih[t.type]})}Cl(t){return t.ts=this.Nl(),t}kl(){this.dl.setQueryParams({hlm:"true"}),this.Sl=!0}sendLastMessageBeacon(){this.dl.setQueryParams(this.ul.getRequestParameters()),this.dl.send(this.ll.stringifyEvents()),this.dl.removeQueryParams(["hlm"]),this.Sl=!1}sendEvents(){this.ll.isEmpty()||(this.cn.setQueryParams(this.wl.getRequestParameters()),this.cn.setQueryParams(this.ul.getRequestParameters()),this.cn.send(this.ll.getEvents()),this.ll.clearEvents())}stop(){var t,s,i,e,n,r,h;this.Tn.stop(),this.cl.stop(),this.al.stop(),this.Sh.stop(),this.ml.stop(),null===(t=this.yl)||void 0===t||t.stop(),null===(s=this.Al)||void 0===s||s.stop(),null===(i=this.gl)||void 0===i||i.stop(),null===(e=this.vl)||void 0===e||e.stop(),this.ll.empty(),null===(n=this.El)||void 0===n||n.stop(),null===(r=this._l)||void 0===r||r.stop(),null===(h=this.Rl)||void 0===h||h.stop()}clearStates(t){var s,i;this.cl.flushPendingDebouncedListeners(),null===(s=this.Al)||void 0===s||s.flushPendingKeyboardNavigationEvent(),null===(i=this.gl)||void 0===i||i.flushPendingTextHighlightEvent(),t?(this.kl(),this.sendLastMessageBeacon()):this.sendEvents(),this.al.reset(),this.ml.stop(),this.cn.removeQueryParams()}Vl(){this.Ol=yt.now()}Nl(){return yt.now()-this.Ol}Il(){this.Tn.onEvent((t=>{var s,i;null===(s=this.Al)||void 0===s||s.flushPendingKeyboardNavigationEvent(),null===(i=this.gl)||void 0===i||i.flushPendingTextHighlightEvent(),t===Ne.PagehideVisible?this.kl():t===Ne.PagehideHidden?(this.kl(),this.sendLastMessageBeacon()):this.ll.isEmpty()&&!this.Sl||this.sendLastMessageBeacon()}))}bl(t){try{this.ll.isEmpty()&&!this.Sl||this.Wt.save({requestParameters:t,events:this.ll.getEvents()})}catch{}}pushSubmitEvent(t,s){if(!function(t){return t===eh.SUCCESS||t===eh.FAILURE||t===eh.ATTEMPT}(t))return void ts.warn(`AnalysisEvents Service: invalid submit status: ${t}`);if(!Vt(s))return void ts.warn(`AnalysisEvents Service: invalid element: ${s}`);const i={status:t,type:ih.SUBMIT,ts:0,tgt:this.pl.getElementPath(s)};i.tgt!==G.INVALID_ELEMENT&&this.Tl(i)}}class ph{constructor(t,s){this.Wt=t,this.cn=s,this.$l=()=>{"visible"===document.visibilityState&&this.xl()}}start(){this.xl(),this.Se()}stop(){this.Pe()}getRecoveryStorage(){return this.Wt}xl(){const t=this.Wt.recover();if(null!==t){const{requestParameters:s,events:i}=t;this.cn.send(i,s)}}Se(){document.addEventListener("visibilitychange",this.$l)}Pe(){document.removeEventListener("visibilitychange",this.$l)}}class mh{constructor(t){this.Wo=t}save(t){localStorage.setItem(this.Wo,csJSON.stringify(t))}clear(){localStorage.removeItem(this.Wo)}recover(){const t=localStorage.getItem(this.Wo);if(null===t)return null;let s=null;try{s=csJSON.parse(t)}catch{ts.error(`Invalid item in localStorage.\n (key:${this.Wo}; value:${t})`)}finally{this.clear()}return s}}class yh{constructor(t){this.Ll=t,this.Ml=t=>this.processMetric(t),this.ve=!1}onEvent(t){this.yi=t}start(){this.ve||(this.ve=!0,this.Ll.onFCP(this.Ml),this.Ll.onCLS(this.Ml),this.Ll.onFID(this.Ml),this.Ll.onLCP(this.Ml),this.Ll.onTTFB(this.Ml),this.Ll.onINP(this.Ml))}stop(){this.ve=!1}processMetric(t){if(!this.ve)return;const s={type:ih.PERFORMANCE,name:t.name,val:t.value,ts:0};this.yi(s)}}es([is("Performance metric handler")],yh.prototype,"processMetric",null);var Ah,gh,Eh,vh,_h,Rh=-1,Sh=function(t){addEventListener("pageshow",(function(s){s.persisted&&(Rh=s.timeStamp,t(s))}),!0)},Th=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Ih=function(){var t=Th();return t&&t.activationStart||0},Ph=function(t,s){var i=Th(),e="navigate";return Rh>=0?e="back-forward-cache":i&&(document.prerendering||Ih()>0?e="prerender":document.wasDiscarded?e="restore":i.type&&(e=i.type.replace(/_/g,"-"))),{name:t,value:void 0===s?-1:s,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:e}},bh=function(t,s,i){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var e=new PerformanceObserver((function(t){Promise.resolve().then((function(){s(t.getEntries())}))}));return e.observe(Object.assign({type:t,buffered:!0},i||{})),e}}catch(t){}},Vh=function(t,s,i,e){var n,r;return function(h){s.value>=0&&(h||e)&&((r=s.value-(n||0))||void 0===n)&&(n=s.value,s.delta=r,s.rating=function(t,s){return t>s[1]?"poor":t>s[0]?"needs-improvement":"good"}(s.value,i),t(s))}},Ch=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},Nh=function(t){var s=function(s){"pagehide"!==s.type&&"hidden"!==document.visibilityState||t(s)};addEventListener("visibilitychange",s,!0),addEventListener("pagehide",s,!0)},kh=function(t){var s=!1;return function(i){s||(t(i),s=!0)}},Oh=-1,$h=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},xh=function(t){"hidden"===document.visibilityState&&Oh>-1&&(Oh="visibilitychange"===t.type?t.timeStamp:0,Mh())},Lh=function(){addEventListener("visibilitychange",xh,!0),addEventListener("prerenderingchange",xh,!0)},Mh=function(){removeEventListener("visibilitychange",xh,!0),removeEventListener("prerenderingchange",xh,!0)},Dh=function(){return Oh<0&&(Oh=$h(),Lh(),Sh((function(){setTimeout((function(){Oh=$h(),Lh()}),0)}))),{get firstHiddenTime(){return Oh}}},Uh=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},zh=[1800,3e3],Hh=function(t,s){s=s||{},Uh((function(){var i,e=Dh(),n=Ph("FCP"),r=bh("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(r.disconnect(),t.startTime=0&&gh1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,s){var i=function(){jh(t,s),n()},e=function(){n()},n=function(){removeEventListener("pointerup",i,Bh),removeEventListener("pointercancel",e,Bh)};addEventListener("pointerup",i,Bh),addEventListener("pointercancel",e,Bh)}(s,t):jh(s,t)}},Wh=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(s){return t(s,Zh,Bh)}))},Jh=[100,300],Kh=0,Xh=1/0,Yh=0,Qh=function(t){t.forEach((function(t){t.interactionId&&(Xh=Math.min(Xh,t.interactionId),Yh=Math.max(Yh,t.interactionId),Kh=Yh?(Yh-Xh)/7+1:0)}))},to=function(){return _h?Kh:performance.interactionCount||0},so=function(){"interactionCount"in performance||_h||(_h=bh("event",Qh,{type:"event",buffered:!0,durationThreshold:0}))},io=[200,500],eo=0,no=function(){return to()-eo},ro=[],ho={},oo=function(t){var s=ro[ro.length-1],i=ho[t.interactionId];if(i||ro.length<10||t.duration>s.latency){if(i)i.entries.push(t),i.latency=Math.max(i.latency,t.duration);else{var e={id:t.interactionId,latency:t.duration,entries:[t]};ho[e.id]=e,ro.push(e)}ro.sort((function(t,s){return s.latency-t.latency})),ro.splice(10).forEach((function(t){delete ho[t.id]}))}},co=[2500,4e3],ao={},uo=[800,1800],lo=function t(s){document.prerendering?Uh((function(){return t(s)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(s)}),!0):setTimeout(s,0)},fo=function(t,s){s=s||{};var i=Ph("TTFB"),e=Vh(t,i,uo,s.reportAllChanges);lo((function(){var n=Th();if(n){var r=n.responseStart;if(r<=0||r>performance.now())return;i.value=Math.max(r-Ih(),0),i.entries=[n],e(!0),Sh((function(){i=Ph("TTFB",0),(e=Vh(t,i,uo,s.reportAllChanges))(!0)}))}}))};class wo{onFCP(t){Hh(t,{reportAllChanges:!0})}onCLS(t){!function(t,s){s=s||{},Hh(kh((function(){var i,e=Ph("CLS",0),n=0,r=[],h=function(t){t.forEach((function(t){if(!t.hadRecentInput){var s=r[0],i=r[r.length-1];n&&t.startTime-i.startTime<1e3&&t.startTime-s.startTime<5e3?(n+=t.value,r.push(t)):(n=t.value,r=[t])}})),n>e.value&&(e.value=n,e.entries=r,i())},o=bh("layout-shift",h);o&&(i=Vh(t,e,Fh,s.reportAllChanges),Nh((function(){h(o.takeRecords()),i(!0)})),Sh((function(){n=0,e=Ph("CLS",0),i=Vh(t,e,Fh,s.reportAllChanges),Ch((function(){return i()}))})),setTimeout(i,0))})))}(t,{reportAllChanges:!0})}onFID(t){!function(t,s){s=s||{},Uh((function(){var i,e=Dh(),n=Ph("FID"),r=function(t){t.startTime0&&(n.value=0,n.entries=[]),e(!0)})),Sh((function(){ro=[],eo=to(),n=Ph("INP"),e=Vh(t,n,io,s.reportAllChanges)})))}))}(t,{reportAllChanges:!0})}}class po{constructor(t=[]){this.Ii=t}stringifyEvents(){return csJSON.stringify(this.Ii)}addEvent(t){csArray.prototype.push.call(this.Ii,t)}eventsCount(){return this.Ii.length}clearEvents(){this.Ii=[]}empty(){this.clearEvents()}isFull(){return this.eventsCount()>=50}isEmpty(){return 0===this.Ii.length}getEvents(){return this.Ii}}const mo="v2/events",yo=["submit"];class Ao{constructor(t,s,i,e,n,r,h,o,c,a){this.L=t,this.Pc=s,this.W=i,this.pl=e,this.Ou=n,this.Ra=r,this.Qe=h,this.Sh=o,this.iu=c,this.Pa=a}init(){const t=new po,s=this.Pa.create(`${this.L.getTrackerUri()}/${mo}`,!0,"base64");this.Dl=this.Ul(s),this.zl=this.Hl(t,this.Dl.getRecoveryStorage(),s),this.zl.init(),this.iu.addListener(this.zl),this.Ra.register(yo,((t,s)=>{this.zl.pushSubmitEvent(t,s)}))}onStartTracking(t){this.Dl.start(),this.zl.start(t)}onAfterNaturalPageView(){this.zl.initStates()}onAfterArtificialPageView(){this.zl.initStates(),this.zl.collectInitialEvents()}onArtificialPageViewEnd(){this.zl.clearStates(!0)}onBeforeSessionRenewal(){this.zl.clearStates(),this.zl.stop(),this.Dl.stop()}onOptout(){this.zl.stop(),this.Dl.stop()}Hl(t,s,i){const e=new sh(window),n=new fh,r=new dh(this.L,this.pl,this.Ou),h=new ch(this.L,this.pl,this.Sh),o=new yh(new wo),c=new $e;const a=new Rn(`${this.L.getTrackerUri()}/${mo}`),u=new an(this.Pc,this.W);return new wh(this.L,r,h,n,e,t,a,u,this.Qe,s,this.pl,o,c,i,undefined,undefined,undefined,undefined,undefined,undefined,undefined)}Ul(t){return new ph(new mh("csAnalysisEventsPersisted"),t)}}var go;!function(t){t.Artificial="a",t.Renewal="r",t.Natural="n"}(go||(go={}));class Eo extends Zi{constructor(t,s,i,e){super(),this.ui=t,this.Fl=s,this.tt=i,this.Da=e}init(){this.Bl()}onStart(t){t?this.ql():this.jl()}onStop(){}triggerArtificialPageView(t,s){this.isStarted?this.Gl(t,s):Pt(t)&&this.tt.overridePath(t,s)}jl(){this.Da.setPageViewType(go.Natural),this.ui.emitBeforeNaturalPageView(),this.Fl.send(),this.tt.cleanupOverrideLifespan(),this.ui.emitAfterNaturalPageView()}ql(){this.Da.setPageViewType(go.Renewal),this.ui.emitBeforeNaturalPageView(),this.Fl.send(),this.ui.emitAfterNaturalPageView()}Gl(t,s){this.Da.setPageViewType(go.Artificial),this.ui.emitArtificialPageViewEnd(),Pt(t)&&this.tt.overridePath(t,s),this.ui.emitBeforeArtificialPageView(),this.Fl.send(),this.tt.cleanupOverrideLifespan(),this.ui.emitAfterArtificialPageView()}Bl(){window.addEventListener("pageshow",(t=>{this.isStarted&&t.persisted&&this.Gl()}))}}const vo=window.navigator.language||window.navigator.userLanguage||window.navigator.browserLanguage||window.navigator.systemLanguage||"unknown";function _o(){return{la:vo}}class Ro{constructor(t){this.ba=t,this.Zl=[],this.Wl=!1}getRequestParameters(){return{dr:this.Jl()}}addUrlMaskingPattern(t){const s=this.ba.getUrlMaskingPattern(t);csArray.prototype.push.call(this.Zl,s)}enableRemoveQueryString(){this.Wl=!0}disableRemoveQueryString(){this.Wl=!1}Jl(){const t=this.Wl?this.ba.removeQueryString(this.Kl()):this.Kl();return this.ba.anonymizeUrl(t,this.Zl)}Kl(){let t="";try{t=window.top.document.referrer}catch(s){if(window.parent)try{t=window.parent.document.referrer}catch{t=""}}return""===t&&(t=document.referrer),"string"!=typeof t&&(t=""),t}}class So{constructor(t){this.J=t,this.Xl=this.Yl()&&"currentScript"in document}Ql(){const t=window.CSCurrentScript;if(!t)return null;const s=window.performance.getEntriesByName(t.src,"resource")[0];return!s||this.td(s)?null:Math.round(s.responseEnd-s.fetchStart)}td(t){const s=t.transferSize;return void 0!==s?0===s||300===s||s{St(t)?this.nd(s)?this.sd.triggerArtificialPageView(t,s):this.sd.triggerArtificialPageView(t):this.sd.triggerArtificialPageView()})),this.Ra.register(Io,((t,s)=>{St(t)&&(this.nd(s)?this.tt.overridePath(t,s):this.tt.overridePath(t))})),this.Ra.register(Po,((t,s)=>{St(t)&&(this.nd(s)?this.tt.overrideQuery(t,s):this.tt.overrideQuery(t))})),this.Ra.register(bo,(t=>i.addUrlMaskingPattern(t))),this.Ra.register(Vo,(()=>i.enableRemoveQueryString())),this.Ra.register(Co,(()=>i.disableRemoveQueryString()))}start(t){this.sd.start(t)}onBeforeSessionRenewal(){this.sd.stop()}nd(t){return Tt(t)&&null!==t}}class ko{constructor(t){this.Tu=t}on(t,s){return i=>{this.Tu.hasValidEventTarget(i)&&this.rd(i,t)&&s(i)}}rd(t,s){const i=ni(t);return k.call(i,s)}isMatchesSelectorSupported(){return!!k}}class Oo{constructor(){}onLoad(t){this.Xt=t}onLoadCallbackExecute(){this.Xt()}start(){const t=this.onLoadCallbackExecute.bind(this);this.od(t)}od(t){function s(){document.removeEventListener("DOMContentLoaded",s),window.removeEventListener("load",s),t()}"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?setTimeout(t):(document.addEventListener("DOMContentLoaded",s),window.addEventListener("load",s))}}es([is("onLoad")],Oo.prototype,"onLoadCallbackExecute",null);class $o{constructor(t,s,i){this.L=t,this.W=s,this.J=i,this.Ol=yt.now()}resetStartTime(){this.Ol=yt.now()}getSessionData(){const{projectId:t}=this.L,s=this.W.getVisitor();null==s&&ts.warn("Visitor is null. This happens when a snippet tries to get Session Data before the tag was initialized.");const{id:i,visitsCount:e}=null!=s?s:{},n=this.J.getSession();null===n&&ts.warn("Session is null. This happens when a snippet tries to get Session Data before the tag was initialized.");const{pageNumber:r}=null!=n?n:{};return{projectId:t,userId:i,sessionNumber:e,pageNumber:r,relativeTimestamp:yt.now()-this.Ol}}}const xo=["clearSession"],Lo=["extendSession"],Mo=["getSessionData"],Do=["session:start:newVisitor"],Uo=["session:clear:visitor"];class zo{constructor(t,s,i,e){this.L=t,this.W=s,this.J=i,this.Ra=e}init(){this.ad=new $o(this.L,this.W,this.J),this.Ra.register(xo,(()=>this.J.removeSession())),this.Ra.register(Lo,(()=>this.J.extendSessionPeriodically()),{disableApplyPending:!0}),this.Ra.register(Mo,(()=>this.ad.getSessionData()),{disableApplyPending:!0}),this.Ra.register(Do,(()=>this.W.renewVisitor())),this.Ra.register(Uo,(()=>{this.W.resetVisitor()}),{disableApplyImmediate:!0})}onBeforeNaturalPageView(){this.W.createOrUpdateVisitor(),this.J.createOrUpdateSession()}onBeforeArtificialPageView(){this.J.abortQuotaServiceRequest(),this.W.createOrUpdateVisitor(),this.J.createOrUpdateSession()}onAfterNaturalPageView(){this.ad.resetStartTime()}onAfterArtificialPageView(){this.ad.resetStartTime()}onOptout(){this.W.removeVisitor(),this.J.removeSession()}onRecordingStateChange(t,s){this.J.updateRecordingState(t,s)}}class Ho{constructor(t,s){this.J=t,this.W=s,this.ud=!1}onSessionExpired(t){this.ld=t}isSessionValid(){if(this.ud)return!0;const t=this.J.hasValidSession();let s=!1;return this.J.pollCacheRefreshEvent()&&(s=this.W.isSessionRenewed()),t&&!s||!this.dd()?t:(this.wd=yt.now(),this.ud=!0,this.ld(),this.ud=!1,this.J.hasValidSession())}isCurrentPageviewValid(){const t=this.J.hasValidSession();return this.J.pollCacheRefreshEvent(!1)?!this.W.isSessionRenewed():t}startNewSession(){this.ld()}dd(){return!It(this.wd)||yt.now()-this.wd>6e4}}var Fo,Bo;function qo(t){return t.tagDeploymentMode===Fo.DualCollectionReview||t.tagDeploymentMode===Fo.DualCollection}!function(t){t.ContentSquare="CONTENTSQUARE",t.LoadedByClicktale="LOADED_BY_CLICKTALE",t.LoadClicktalePtc="LOAD_CLICKTALE_PTC",t.DualCollectionReview="DUAL_COLLECTION_REVIEW",t.DualCollection="DUAL_COLLECTION",t.ContentSquareTagClickTaleEndpoints="CONTENTSQUARE_TAG_CLICKTALE_ENDPOINTS"}(Fo||(Fo={})),function(t){t.isRecording=function(){return window.ClickTaleIsRecording&&window.ClickTaleIsRecording()},t.stopRecording=function(){window.ClickTaleStop&&window.ClickTaleStop()},t.triggerLogicalPageView=function(t){window.ClickTaleLogicalWithUploadPage&&window.ClickTaleLogicalWithUploadPage(t)},t.sendPageEvent=function(t){window.ClickTaleEvent&&window.ClickTaleEvent(t)},t.sendEventTriggerRecording=function(t){window.ClickTaleEventTrigger&&window.ClickTaleEventTrigger(t)}}(Bo||(Bo={}));const jo="@user-identifier@";class Go extends Zi{constructor(t,s,i,e){super(),this.L=t,this.pd=s,this.fu=i,this.md=e,this.yd=[],this.Cn=[]}onStart(){csArray.prototype.forEach.call(this.yd,(t=>this.trackPageEvent(t))),this.yd=[],csArray.prototype.forEach.call(this.Cn,(t=>this.trackEventTriggerRecording(t))),this.Cn=[]}onStop(){}trackPageEvent(t){this.isStarted?Go.Ad(t)&&(this.gd(t)?yr.isSupported()&&this.Ed(t):this.vd(t)):csArray.prototype.push.call(this.yd,t)}gd(t){return J(t,jo)}async Ed(t){if(!this.L.customHashIdEnabled)return;const s=csString.prototype.slice.call(t,17);if(s.length>yr.MAX_DIGEST_INPUT_SIZE)return void ts.warn("UserIdentifier event: invalid user identifier");const i=await yr.digest(s);i?(this._d={eventName:i,isETR:!1,isCustomHashId:!0},this.Rd()):ts.warn("Page event: unable to compute customHashId"),this.L.encryptionEnabled&&this.md.emitUserIdentifierEvent(s)}vd(t){this.md.emitPageEvent(t),this._d={eventName:t,isETR:!1,isCustomHashId:!1},this.Rd(),this.L.tagDeploymentMode===Fo.LoadClicktalePtc&&Bo.sendPageEvent(t)}trackEventTriggerRecording(t){this.isStarted?Go.Ad(t)&&(this.L.malkaEtrEnabled?this.Sd(t):this.Td(t)):csArray.prototype.push.call(this.Cn,t)}Sd(t){J(t,"@ETP@")?this.md.emitEventTriggerRecording(t,Ss.ETR_PAGE):this.md.emitEventTriggerRecording(t,Ss.ETR_SESSION),this._d={eventName:t,isETR:!0,isCustomHashId:!1},this.Rd()}Td(t){var s;(qo(s=this.L)||s.tagDeploymentMode===Fo.LoadClicktalePtc)&&(this.md.emitEventTriggerRecording(t,Ss.ETR_LEGACY),this._d={eventName:t,isETR:!0,isCustomHashId:!1},this.Rd(),this.L.tagDeploymentMode===Fo.LoadClicktalePtc&&Bo.sendEventTriggerRecording(t))}getRequestParameters(){return{value:this.fu.compressSync(this._d.eventName,"base64"),ct:this.fu.algorithm,isETR:`${this._d.isETR}`,isCustomHashId:`${this._d.isCustomHashId}`}}Rd(){this.pd.send()}static Ad(t){return St(t)&&!!csString.prototype.trim.call(t)}}const Zo=["trackPageEvent"],Wo=["trackEventTriggerRecording"];class Jo{constructor(t,s,i,e,n){this.L=t,this.Ra=s,this.fu=i,this.Nc=e,this.md=n}init(){const t=new ht(this.L.getTrackerUri(),"pageEvent");this.Id=new Go(this.L,t,this.fu,this.md),t.setRequestParametersProviders(this.Id,this.Nc),this.Ra.register(Zo,(t=>{this.Id.trackPageEvent(t)})),this.Ra.register(Wo,(t=>{this.Id.trackEventTriggerRecording(t)}))}onStartTracking(){this.Id.start()}}class Ko{constructor(){this.subscriptions={}}subscribe(t,s){this.subscriptions[t]=s,1===Object.keys(this.subscriptions).length&&this.onStartTracking()}unsubscribe(t){delete this.subscriptions[t],0===Object.keys(this.subscriptions).length&&this.onStopTracking()}}var Xo;!function(t){t.ellipsis="…",t.truncateStringWithEllipsis=function(s,i){return s.length<=i?s:csString.prototype.slice.call(s,0,i-t.ellipsis.length)+t.ellipsis}}(Xo||(Xo={}));class Yo extends Ko{constructor(){super(),this.Pd=!1,this.Ui={boundElement:window,type:"error",listener:t=>this.errorListener(t)}}onStartTracking(){Zs(this.Ui,this.Pd)}onStopTracking(){Ws(this.Ui,this.Pd)}errorListener(t){const s=this.bd(t);for(const t in this.subscriptions){(0,this.subscriptions[t])(s)}}Vd(t){return t=null!=t?t:"[NO ERROR MESSAGE]",Xo.truncateStringWithEllipsis(t,Yo.Cd)}bd(t){return{errorType:"jsError",message:this.Vd(t.message),filename:t.filename,lineno:t.lineno,colno:t.colno}}}Yo.truncatedErrorMessageMarker="…",Yo.Cd=1024,es([is("Event handler type: error")],Yo.prototype,"errorListener",null);const Qo=document.createElement("div");function tc(t){if(!(!!t&&St(t)))return ts.warn(`isValidSelector: invalid selector provided '${t}'`),!1;try{return k.call(Qo,t),!0}catch{return ts.warn(`isValidSelector: invalid selector provided '${t}'`),!1}}const sc=["#c1_card_info_id"];class ic{constructor(t,s){this.L=t,this.Nd=s,this.kd=["[data-cs-mask]","script",...sc],this.Od=[{selector:"input:not([type=button]):not([type=submit])",attrName:"value"}],this.$d={PIISelectors:[".ctHidden,textarea",...sc],Attributes:[{selector:".ctHidden,input:not([type=button]):not([type=submit])",attrName:"value"}]},this.xd=[],this.Ld="",qo(this.L)||(this.Ld=this.Md(this.Ld,this.kd),csArray.prototype.push.call(this.xd,...this.Od))}setPIISelectors(t){var s;if(t){if(null===(s=t.PIISelectors)||void 0===s?void 0:s.length){const s=csArray.prototype.filter.call(t.PIISelectors,(t=>tc(t)));this.Ld=this.Md(this.Ld,s)}t.Attributes instanceof Array&&csArray.prototype.forEach.call(t.Attributes,(t=>{t&&t.attrName&&tc(t.selector)&&!this.Dd(t)&&csArray.prototype.push.call(this.xd,t)}))}}getPIISelectors(){return{PIISelectors:[this.Ld],Attributes:this.xd}}initCTPII(){var t,s;if(this.Ld=this.Md(this.Ld,this.$d.PIISelectors),!(null===(s=null===(t=null===window||void 0===window?void 0:window.ClickTaleSettings)||void 0===t?void 0:t.DOM)||void 0===s?void 0:s.PII))return;const i=csArray.prototype.filter.call(window.ClickTaleSettings.DOM.PII.Text,(t=>tc(t)));this.Ld=this.Md(this.Ld,i),csArray.prototype.push.call(this.xd,...this.$d.Attributes),csArray.prototype.forEach.call(window.ClickTaleSettings.DOM.PII.Attributes,(t=>{t.attr&&tc(t.rule)&&csArray.prototype.push.call(this.xd,{selector:t.rule,attrName:t.attr})}))}identifySensitiveNodes(){this.Nd.startSensitiveIdentifier(this.Ld,this.xd,(()=>{}))}unidentifyAllSensitiveNodes(){this.Nd.stopSensitiveIdentifier()}unidentifySensitiveNodes(t){this.Nd.unidentifySensitiveNodes(t)}onSensitiveElementResize(t){this.Nd.onSensitiveElementResize(t)}Md(t,s){if(0===s.length)return t;if(0===t.length)return csArray.prototype.join.call(s,",");const i=csString.prototype.split.call(t,",");for(const t of s){const s=csString.prototype.split.call(t,",");for(const t of s)-1===csArray.prototype.indexOf.call(i,t)&&csArray.prototype.push.call(i,t)}return csArray.prototype.join.call(i,",")}Dd(t){return csArray.prototype.some.call(this.xd,(s=>s.selector===t.selector&&s.attrName===t.attrName))}}class ec{constructor(t){this.Ra=t}init(){this.Ud(ec.zd,kt),this.Ud(ec.Hd,Nt)}Ud(t,s){this.Ra.register([t],((t,i)=>{St(t)&&(St(i)||Ct(i))&&ts.error(i,`${s}${t}`)}))}}ec.Hd="logSnippetError",ec.zd="logImplementationSnippetError";class nc{constructor(t,s,i,e){this.L=t,this.Qa=s,this._a=i,this.iu=e}init(){this.Qa.onChildMessage(((t,s,i)=>this.iu.emitIframeEvent(t,s,i))),this.Qa.setRecordingStatusCallback((()=>this._a.getRecordingStatus()))}onStartTracking(){this.L.iframesTracking&&this.Qa.start()}onOptout(){this.L.iframesTracking&&this.Qa.stop()}onRecordingStatusChange(){this.L.iframesTracking&&this.Qa.onRecordingStatusChange(this._a.getRecordingStatus())}}class rc extends Zi{constructor(t){super(),this.L=t,this.Fd=0,this.Bd=new Map,this.qd={boundElement:window,type:"message",listener:t=>this.jd(t)}}onChildMessage(t){this.Gd=t}setRecordingStatusCallback(t){this.Zd=t}onRecordingStatusChange(t){const s=Kt.buildBaseMessage(Jt.RecordingStatus,Wt.Parent,this.L.projectId);s.content=t,this.Bd.forEach((t=>{!this.Wd(t)&&t.port&&Kt.sendChannelMessage(t.port,s)}))}sendToChildren(t,s){const i=Kt.buildBaseMessage(t,Wt.Parent,this.L.projectId);i.content=s,this.Jd(i)}onStart(){Zs(this.qd,!1),this.Kd()}onStop(){this.Xd(),Ws(this.qd,!1),this.Yd()}Kd(){const t=this.Qd();this.tf(t),csArray.prototype.forEach.call(t,(t=>{if(null===this.sf(t)){const s={iframe:t};this.Bd.set(this.Fd,s),this.Fd+=1}})),this.if()}Qd(){return csArray.prototype.filter.call(Fe.findAllElements("iframe"),(t=>this.ef(t)))}tf(t){this.Bd.forEach(((s,i)=>{s.iframe&&-1===csArray.prototype.indexOf.call(t,s.iframe)&&this.nf(i,s)}))}nf(t,s){s.port&&Kt.closeChannelPort(s.port),this.Bd.delete(t)}Yd(){this.Bd.forEach((t=>{t.port&&Kt.closeChannelPort(t.port)})),this.Bd.clear()}sf(t){let s=null;return this.Bd.forEach(((i,e)=>{null===s&&i.iframe===t&&(s=e)})),s}ef(t){return t.id!==i&&(!t.src||Bt(Ft(t.src),this.L.hostnames))}Jd(t){this.Bd.forEach((s=>{s.port&&Kt.sendChannelMessage(s.port,t)}))}if(){this.Bd.forEach(((t,s)=>{if(t.iframe.contentWindow){const i=this.rf(s);Kt.sendPostMessage(t.iframe.contentWindow,"*",i)}}))}Xd(){const t=this.hf();this.Bd.forEach((s=>{s.port?Kt.sendChannelMessage(s.port,t):s.iframe.contentWindow&&Kt.sendPostMessage(s.iframe.contentWindow,"*",t)}))}rf(t){return Kt.buildBaseMessage(Jt.Discovery,Wt.Parent,this.L.projectId,t)}hf(){return Kt.buildBaseMessage(Jt.Stop,Wt.Parent,this.L.projectId)}cf(t,s){const i=this.Bd.get(t);void 0!==i?(i.port=s,i.port.onmessage=t=>{this.af(t,i)}):ts.error(`Parent received channel messaging initialization from unknow child id : ${t} (${this.Fd})`)}uf(t){if(!t.port)return;const s=Kt.buildBaseMessage(Jt.RecordingStatus,Wt.Parent,this.L.projectId),i=this.Zd();this.Wd(t)&&(i.isRecording=!1,i.isMutationTrackerStarted=!1),s.content=i,Kt.sendChannelMessage(t.port,s)}af(t,s){if(void 0===s)return void ts.error(`Parent received channelMessage from unknown child : ${csJSON.stringify(t.data)}`);const i=t.data.type,e=t.data.content;i===Jt.EndOfBufferedMessages?this.uf(s):this.Gd(s.iframe,i,e)}jd(t){if(Kt.isMessageValid(t,Wt.Child,this.L.projectId,this.L.hostnames))switch(t.data.type){case Jt.Discovery:if(void 0===t.data.id)return void this.Kd();if(t.ports&&1===t.ports.length&&this.Bd.has(t.data.id))return void this.cf(t.data.id,t.ports[0]);ts.error(`Parent received wrong channelMessage initialization : (${t.origin}) : ${csJSON.stringify(t.data)}`);break;case Jt.ChildLogMessage:this.Gd(null,Jt.ChildLogMessage,t.data.content);break;default:ts.warn(`Parent received unexpected postMessage type from child (${t.origin}) : ${csJSON.stringify(t.data)}`)}}Wd(t){return wi.isSensitive(t.iframe)||wi.isSensitiveChild(t.iframe)}}class hc extends Ko{constructor(t,s){super(),this.lf=t,this.df=s,this.ff=[]}subscribe(t,s,i){(null==i?void 0:i.detailedEvent)&&Object.defineProperty(s,"detailedEvent",{value:i.detailedEvent}),super.subscribe(t,s)}init(){this.lf.onEvent((t=>this.wf(t))),this.df.onEvent((t=>this.wf(t)))}onStartTracking(){this.lf.start(),this.df.start()}onStopTracking(){this.lf.stop(),this.df.stop()}wf(t){if(t.url&&t.statusCode){if(this.pf(t.url))return;if(t.statusCode>=400||t.isConfigurableApiError)for(const s in this.subscriptions){const i=this.subscriptions[s];if(i.hasOwnProperty("detailedEvent")){i(this.mf(t))}else{i(this.yf(t))}}}}yf(t){return{errorType:"apiError",url:t.url,method:t.method,requestTime:t.requestTime,responseTime:t.responseTime,statusCode:t.statusCode,library:t.library,matchingBodyContent:t.matchingBodyContent}}mf(t){const s=this.yf(t);return Object.keys(t.standardRequestHeaders).length>0&&(s.standardRequestHeaders=t.standardRequestHeaders),Object.keys(t.standardResponseHeaders).length>0&&(s.standardResponseHeaders=t.standardResponseHeaders),Object.keys(t.customRequestHeaders).length>0&&(s.customRequestHeaders=csJSON.stringify(t.customRequestHeaders)),Object.keys(t.customResponseHeaders).length>0&&(s.customResponseHeaders=csJSON.stringify(t.customResponseHeaders)),t.queryParameters&&(s.queryParameters=t.queryParameters),t.requestBody&&(s.requestBody=t.requestBody),t.responseBody&&(s.responseBody=t.responseBody),Object.keys(t.plainCustomRequestHeaders).length>0&&(s.plainCustomRequestHeaders=t.plainCustomRequestHeaders),Object.keys(t.plainCustomResponseHeaders).length>0&&(s.plainCustomResponseHeaders=t.plainCustomResponseHeaders),s}pf(t){return csArray.prototype.some.call(this.ff,(s=>-1!==csString.prototype.indexOf.call(t,s)))}excludeDomains(t){csArray.prototype.push.call(this.ff,...t)}}hc.truncatedErrorMessageMarker="…";class oc{constructor(t){this.ba=t,this.Zl=[]}addUrlMaskingPattern(t){const s=this.ba.getUrlMaskingPattern(t);csArray.prototype.push.call(this.Zl,s)}getUrlMaskingPatterns(){return this.Zl}anonymize(t){const s=this.ba.removeQueryString(t.url);return{...t,url:this.ba.anonymizeUrl(s,this.Zl),library:t.library?this.ba.anonymizeUrl(t.library,this.Zl):void 0}}}class cc{constructor(t,s){this.M=t,this.tt=s}anonymize(t){return St(t.message)&&(t.message=this.Af(t.message),t.message=this.M.anonymizePII(t.message)),St(t.filename)&&(t.filename=this.tt.computeOverriddenUrl(t.filename)),t}Af(t){return csString.prototype.replace.call(t,/(value\s*=\s*".*"|value\s*=\s*'.*')/,"value='CS_ANONYMIZED_VALUE'")}}class ac{compute(t,s){const i=this.gf(s.x)-this.gf(t.x),e=this.gf(s.y)-this.gf(t.y),n=s.time-t.time;return{duration:n,distance:this.Ef(i,e),direction:this.vf(i,e),velocity:this._f(i,e,n)}}computePinchMetrics(t,s){const i=this.gf(s.x)-this.gf(t.x),e=this.gf(s.y)-this.gf(t.y);return{duration:s.time-t.time,distance:this.Ef(i,e)}}getScale(t,s){return Math.abs(s/t-1)}gf(t){return t/window.devicePixelRatio}Ef(t,s){return Math.round(Math.sqrt(t*t+s*s))}_f(t,s,i){const e=i/1e3,n=t/e,r=s/e;return Math.round(Math.abs(n)+Math.abs(r))}vf(t,s){return Math.abs(t)>Math.abs(s)?t>0?Tn.RIGHT:Tn.LEFT:s>0?Tn.DOWN:Tn.UP}}class uc{constructor(){this.Rf={},this.Sf=new ac,this.Tf()}onGesture(t){this.If=t}isValidTouchEvent(t){return"touches"in t&&"changedTouches"in t}processActionDown(t){if(!this.Pf(t))return;this.bf(t)&&this.Tf();const s={x:t.touches[0].clientX,y:t.touches[0].clientY,time:yt.now()};if(1===t.touches.length)this.Rf.startPinchTime=s.time,this.Rf.firstTouch=s;else if(2===t.touches.length&&(this.Rf.secondTouch={x:t.touches[1].clientX,y:t.touches[1].clientY,time:yt.now()},this.Rf.firstTouch&&this.Rf.secondTouch)){const t=this.Sf.computePinchMetrics(this.Rf.firstTouch,this.Rf.secondTouch);this.Vf=t.distance}csArray.prototype.push.call(this.Cf,s),this.Nf=ni(t)}processActionMove(){this.kf=!0}processActionUp(t){if(this.Of(t)){if(csArray.prototype.push.call(this.Cf,{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY,time:yt.now()}),this.$f(t)&&this.Rf.startPinchTime){const s={x:t.touches[0].clientX,y:t.touches[0].clientY,time:this.Rf.startPinchTime},i={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY,time:yt.now()};this.Rf.firstTouch&&(this.Rf.firstTouch=s,this.Rf.secondTouch=i),this.xf(t)}this.Vf||this.Lf()&&this.Mf(t)}}Tf(){this.Cf=[],this.Nf=null,this.kf=!1,this.Vf=null,this.Df=!0}Mf(t){const s=this.Sf.compute(this.Cf[0],this.Cf[1]);this.Df=t.isTrusted;const i=this.kf?this.Uf(s):this.zf(s);this.If(i,t)}xf(t){if(!this.Rf.firstTouch||!this.Rf.secondTouch)return;const s=this.Sf.computePinchMetrics(this.Rf.firstTouch,this.Rf.secondTouch);this.Df=t.isTrusted;const i=this.Hf(s);i&&this.If(i,t)}Hf(t){if(!this.Vf)return;if(this.Sf.getScale(this.Vf,t.distance)<.1)return;return{type:this.Vf>t.distance?Sn.PINCH_IN:Sn.PINCH_OUT,target:this.Nf,distance:t.distance,isTrusted:this.Df}}Uf(t){return{type:t.velocity<100?Sn.DRAG:Sn.FLICK,target:this.Nf,velocity:t.velocity,distance:t.distance,direction:t.direction,isTrusted:this.Df}}zf(t){return{type:t.duration<1e3?Sn.TAP:Sn.LONG_PRESS,target:this.Nf,isTrusted:this.Df}}bf(t){return 1===t.touches.length}Lf(){return 2===this.Cf.length}Pf(t){return t.touches.length>0}Of(t){return t.changedTouches.length>0}$f(t){return this.kf&&!!this.Vf&&1===t.changedTouches.length&&1===t.touches.length}}class lc extends Ko{constructor(t){super(),this.Ff=t,this.Cr=[{boundElement:document,type:"touchstart",listener:t=>this.kn(t)},{boundElement:document,type:"touchmove",listener:t=>this.kn(t)},{boundElement:document,type:"touchend",listener:t=>this.kn(t)}],this.Bf=new uc,this.Bf.onGesture(((t,s)=>this.qf(t,s)))}qf(t,s){for(const i in this.subscriptions){(0,this.subscriptions[i])(t,s)}}onStartTracking(){this.canDetectGesture()&&csArray.prototype.forEach.call(this.Cr,(t=>Zs(t)))}onStopTracking(){this.canDetectGesture()&&csArray.prototype.forEach.call(this.Cr,(t=>Ws(t)))}canDetectGesture(){return void 0!==window.devicePixelRatio}kn(t){this.Ff.tryToExecute("process gesture event",(()=>{if(this.Bf.isValidTouchEvent(t))switch(t.type){case"touchstart":this.Bf.processActionDown(t);break;case"touchmove":this.Bf.processActionMove();break;case"touchend":this.Bf.processActionUp(t)}}))()}static isSwipe(t){return t.type===Sn.FLICK||t.type===Sn.DRAG}}class dc extends Zi{constructor(t,s){super(),this.cn=t,this.jf=s,this.Gf=0}onStart(){ts.isPerfLoggingActive()&&(this.Zf=window.setInterval((()=>this.Wf()),dc.Jf))}onStop(){ts.isPerfLoggingActive()&&(this.Wf(),clearInterval(this.Zf))}Wf(){if(Xs.isEmpty()||this.Gf>=dc.Kf)return;const t=Xs.getAll();this.Gf++;const s={a:dc.Xf,l:dc.Yf,...this.jf.getRequestParameters()},i=csArray.prototype.map.call(t,(t=>({...t,...s})));this.cn.send(i),Xs.clear()}}dc.Xf="uxa",dc.Yf="perf",dc.Jf=5e3,dc.Kf=5;class fc{constructor(t,s,i){this.L=t,this.jf=s,this.Pa=i}init(){this.Qf=new dc(this.Pa.create(this.L.getLoggerUri(),!0),this.jf)}onStartTracking(){this.Qf.start()}onOptout(){this.Qf.stop()}}class wc{constructor(){this.tw=!1}enableRecordingStatus(t,s,i,e,n){this.tw=!0,this.au=t,this.li=s,this.Oa=i,this.J=e,this.hn=n}getRecordingStatus(){var t,s,i,e;return this.tw?{isRecording:this.au.isRecording(),isMutationTrackerStarted:this.au.isMutationTrackerStarted(),PIISelectors:this.li.getPIISelectors(),capturedElementSelector:Ve.getWhitelistedElementsSelector(),useAnonymization:this.Oa.shouldUseAnonymization(),encryptionSelectors:null===(t=this.hn)||void 0===t?void 0:t.getEncryptionSelectors(),activateOnlineAssetsOnNextStart:null===(s=this.au.getStaticResourceManagerStatus())||void 0===s?void 0:s.onlineAssets.enabledForChildrenOnNextStart,recordingStartTimestamp:parseInt(this.au.getRecordingStartTimestamp(),10),etrState:null!==(e=null===(i=this.J.getSession())||void 0===i?void 0:i.etrState)&&void 0!==e?e:Rs.ETR_OFF}:{isRecording:!1,recordingStartTimestamp:0,etrState:Rs.ETR_OFF}}}class pc{constructor(t,s,i){this.L=t,this.iw=s,this.ew=i,this.ve=!1,this.nw=null,this.oe=[],this.rw=({result:t,args:s,callerName:i})=>{this.interceptFetch(t,s,i)}}onEvent(t){csArray.prototype.push.call(this.oe,t)}start(){this.ve||this.hw()&&(this.ow(),this.nw&&this.nw.activate(),this.ve=!0)}stop(){this.ve&&(this.nw&&this.nw.deactivate(),this.ve=!1)}hw(){return!!window.fetch&&"function"==typeof window.fetch}cw(t){if(t[0]&&"function"==typeof t[0].clone){const s=Ti(t);return s[0]=t[0].clone(),s}return t}ow(){this.nw||(this.nw=ve({target:window,methodName:"fetch",hook:this.rw,hookPrepareArgs:this.cw,options:{withCallerName:!0}}))}async aw(t,s,i){const[e,n]=csString.prototype.split.call(s.url,"?"),r={...t,url:zt(e),method:s.method,responseTime:yt.now(),standardRequestHeaders:{},standardResponseHeaders:{},customRequestHeaders:{},customResponseHeaders:{},plainCustomRequestHeaders:{},plainCustomResponseHeaders:{}};if(this.L.isHeaderCollectionActive()){const t=this.iw.extractAllHeaders(s.headers),e=this.iw.extractAllHeaders(i.headers);this.L.apiErrors.collectStandardHeaders&&(r.standardRequestHeaders=t.standardHeaders,r.standardResponseHeaders=e.standardHeaders),r.customRequestHeaders=t.validCustomHeaders,r.customResponseHeaders=e.validCustomHeaders,r.plainCustomRequestHeaders=t.plainCustomHeaders,r.plainCustomResponseHeaders=e.plainCustomHeaders}this.iw.isValidUrl(e,this.L.apiErrors.validUrls)&&(this.L.apiErrors.collectQueryParam&&n&&(r.queryParameters=n),this.L.apiErrors.collectResponseBody&&this.iw.isValidBodyType(r.standardResponseHeaders)&&(r.responseBody=await this.iw.getResponseBody(i)),this.L.apiErrors.collectRequestBody&&this.iw.isValidBodyType(r.standardRequestHeaders)&&(r.requestBody=await s.text())),csArray.prototype.forEach.call(this.oe,(t=>t(r)))}async interceptFetch(t,s,i){const e=s[0],n=s[1],r=new Request(e,n);if(!St(r.url))return;const h=yt.now();let o;try{o=await t}catch(t){if(this.uw(t)||this.lw(t)||this.fw(t))return;throw t}const c=o.status,a={statusCode:c,library:i,requestTime:h};c>=400&&await this.aw({...a,isConfigurableApiError:!1},r,o)}uw(t){return t instanceof TypeError}lw(t){return t instanceof DOMException&&"AbortError"===t.name}fw(t){return t instanceof DOMException&&csArray.prototype.some.call(pc.pw,(s=>s===t.name))}}pc.pw=["NoModificationAllowedError","InvalidStateError","OperationError"],es([is("FetchRequestTracker.interceptFetch")],pc.prototype,"interceptFetch",null);class mc{constructor(){this.mw=["application/json","application/graphql","application/xml","text/plain","text/csv","text/html","text/xml"]}isValidUrl(t,s){return!!s&&csArray.prototype.some.call(s,(s=>-1!==csString.prototype.indexOf.call(t,s)))}yw(t,s){for(const i of Object.keys(s))if(csString.prototype.toLowerCase.call(i)===t)return s[i];return""}isValidBodyType(t){const s=this.yw("content-type",t);if(!s)return!1;const i=csString.prototype.toLocaleLowerCase.call(s);return csArray.prototype.some.call(this.mw,(t=>J(i,t)))}}class yc extends mc{constructor(t){super(),this.Aw=t}extractAllHeaders(t){const s={},i={},e={};return t.forEach(((t,n)=>{this.Aw.isValidStandardHeader(n)&&t?s[n]=csString.prototype.trim.call(t):this.Aw.isValidCustomHeader(n)&&t?i[n]=csString.prototype.trim.call(t):this.Aw.isPlainCustomHeader(n)&&t&&(e[n]=csString.prototype.trim.call(t))})),{standardHeaders:s,validCustomHeaders:i,plainCustomHeaders:e}}extractHeadersByName(t,s){const i={};return s.headers.forEach(((s,e)=>{-1!==csArray.prototype.indexOf.call(t,csString.prototype.toLowerCase.call(e))&&s&&(i[e]=csString.prototype.trim.call(s))})),i}async getResponseBody(t){return t.bodyUsed?Promise.resolve(void 0):t.clone().text()}}class Ac{constructor(t,s,i){this.L=t,this.gw=s,this.ew=i,this.ve=!1,this.Ew=null,this._w=null,this.Rw=null,this.oe=[],this.Sw=({context:t,args:s,callerName:i})=>this.interceptOpen(t,s,i),this.Tw=({context:t,args:s})=>this.interceptSetRequestHeader(t,s),this.Iw=({context:t,args:s})=>this.interceptSend(t,s)}onEvent(t){csArray.prototype.push.call(this.oe,t)}start(){this.ve||(this.Pw(),this.Ew&&this.Ew.activate(),this._w&&this._w.activate(),this.Rw&&this.Rw.activate(),this.ve=!0)}stop(){this.ve&&(this.Ew&&this.Ew.deactivate(),this._w&&this._w.deactivate(),this.ve=!1)}Pw(){this.Ew||(this.Ew=ve({target:XMLHttpRequest.prototype,methodName:"open",hook:this.Sw,options:{withCallerName:!0}})),this._w||(this._w=ve({target:XMLHttpRequest.prototype,methodName:"setRequestHeader",hook:this.Tw})),this.Rw||(this.Rw=ve({target:XMLHttpRequest.prototype,methodName:"send",hook:this.Iw}))}interceptOpen(t,s,i){if(!s[1]||!St(s[1]))return;const[e,n]=csString.prototype.split.call(s[1],"?"),r=zt(e);t.apiCall={url:r,method:s[0],standardRequestHeaders:{},standardResponseHeaders:{},customRequestHeaders:{},customResponseHeaders:{},requestTime:yt.now(),responseTime:0,statusCode:0,library:i,isConfigurableApiError:!1,plainCustomRequestHeaders:{},plainCustomResponseHeaders:{}},n&&this.gw.isValidUrl(r,this.L.apiErrors.validUrls)&&this.L.apiErrors.collectQueryParam&&(t.apiCall.queryParameters=n),t.addEventListener("readystatechange",(()=>this.readyStateChangeListener(t)))}aw(t){if(t.apiCall.responseTime=yt.now(),t.apiCall.statusCode=t.status,this.L.isHeaderCollectionActive()){const s=this.gw.extractAllHeaders(t.getAllResponseHeaders());this.L.apiErrors.collectStandardHeaders&&(t.apiCall.standardResponseHeaders=s.standardHeaders),t.apiCall.customResponseHeaders=s.validCustomHeaders,t.apiCall.plainCustomResponseHeaders=s.plainCustomHeaders}this.gw.isValidUrl(t.apiCall.url,this.L.apiErrors.validUrls)&&this.L.apiErrors.collectResponseBody&&this.gw.isValidBodyType(t.apiCall.standardResponseHeaders)&&(t.apiCall.responseBody=t.responseText),csArray.prototype.forEach.call(this.oe,(s=>s(t.apiCall)))}readyStateChangeListener(t){t.apiCall&&t.readyState===XMLHttpRequest.DONE&&t.status>=400&&this.aw(t)}interceptSetRequestHeader(t,s){if(t.apiCall&&this.L.isHeaderCollectionActive()){const i=s[0],e=s[1];this.L.apiErrors.collectStandardHeaders&&this.gw.isValidStandardHeader(i)&&e?t.apiCall.standardRequestHeaders[i]=e.trim():this.gw.isValidCustomHeader(i)&&e?t.apiCall.customRequestHeaders[i]=e.trim():this.gw.isPlainCustomHeader(i)&&e&&(t.apiCall.plainCustomRequestHeaders[i]=e.trim())}}interceptSend(t,s){const i=s[0];t.apiCall&&this.gw.isValidUrl(t.apiCall.url,this.L.apiErrors.validUrls)&&this.L.apiErrors.collectRequestBody&&this.gw.isValidBodyType(t.apiCall.standardRequestHeaders)&&"string"==typeof i&&(t.apiCall.requestBody=i)}}es([is("XhrRequestTracker.interceptOpen")],Ac.prototype,"interceptOpen",null),es([is("XhrRequestTracker.readyStateChangeListener")],Ac.prototype,"readyStateChangeListener",null),es([is("XhrRequestTracker.interceptSetRequestHeader")],Ac.prototype,"interceptSetRequestHeader",null),es([is("XhrRequestTracker.interceptSend")],Ac.prototype,"interceptSend",null);class gc extends mc{constructor(t){super(),this.Aw=t}extractAllHeaders(t){const s={},i={},e={};return csArray.prototype.forEach.call(null==t?void 0:csString.prototype.split.call(t,/[\r\n]+/),(t=>{const[n,r]=csString.prototype.split.call(t,/:(.*)/);this.Aw.isValidStandardHeader(n)&&r?s[n]=csString.prototype.trim.call(r):this.Aw.isValidCustomHeader(n)&&r?i[n]=csString.prototype.trim.call(r):this.Aw.isPlainCustomHeader(n)&&r&&(e[n]=csString.prototype.trim.call(r))})),{standardHeaders:s,validCustomHeaders:i,plainCustomHeaders:e}}extractHeadersByName(t,s){const i={};return csArray.prototype.forEach.call(null==s.getAllResponseHeaders()?void 0:csString.prototype.split.call(s.getAllResponseHeaders(),/[\r\n]+/),(s=>{const[e,n]=csString.prototype.split.call(s,/:(.*)/);-1!==csArray.prototype.indexOf.call(t,csString.prototype.toLowerCase.call(e))&&n&&(i[e]=csString.prototype.trim.call(n))})),i}getResponseBody(t){return t.responseText}isValidStandardHeader(t){return this.Aw.isValidStandardHeader(t)}isValidCustomHeader(t){return this.Aw.isValidCustomHeader(t)}isPlainCustomHeader(t){return this.Aw.isPlainCustomHeader(t)}}class Ec extends Zi{constructor(t,s,i,e){super(),this.nn=t,this.bw=s,this.Pc=i,this.rn=e,this.Vw=[],this.fn=0}init(){this.nn.init()}initStates(){this.Cw(),this.Vw=[],this.fn=0,this.Vl()}Vl(){this.Ol=yt.now()}Nl(){return yt.now()-this.Ol}onStart(){this.nn.subscribe(Ec.Bn,(t=>this.kn(t)))}onStop(){this.nn.unsubscribe(Ec.Bn)}onIframeApiError(t){this.kn(t)}kn(t){this.isStarted&&this.fnthis.rn.addUrlMaskingPattern(t)))}onStartTracking(){this.Ow.start()}onAfterNaturalPageView(){this.Ow.initStates()}onAfterArtificialPageView(){this.Ow.initStates()}onBeforeSessionRenewal(){this.Ow.stop()}onOptout(){this.Ow.stop()}}class Sc{constructor(t){this.L=t,this.xw=["age","cache-control","clear-site-data","expires","pragma","warning","downlink","ect","rtt","last-modified","connection","keep-alive","accept","accept-encoding","accept-language","expect","access-control-allow-origin","access-control-allow-credentials","access-control-allow-headers","access-control-allow-methods","access-control-expose-headers","access-control-max-age","access-control-request-headers","access-control-request-method","origin","timing-allow-origin","content-length","content-type","content-encoding","content-language","via","host","referrer-policy","user-agent","allow","server","accept-ranges","range","if-range","content-range","cross-origin-embedder-policy","cross-origin-opener-policy","cross-origin-resource-policy","content-security-policy","content-security-policy-report-only","expect-ct","feature-policy","strict-transport-security","upgrade-insecure-requests","x-content-type-options","x-download-options","x-frame-options","x-permitted-cross-domain-policies","x-powered-by","x-xss-protection","sec-fetch-site","sec-fetch-mode","sec-fetch-user","sec-fetch-dest"]}isValidStandardHeader(t){return-1!==csArray.prototype.indexOf.call(this.xw,csString.prototype.toLowerCase.call(t))}isValidCustomHeader(t){return this.Lw(t,this.L.apiErrors.validCustomHeaders)}isPlainCustomHeader(t){return this.Lw(t,this.L.apiErrors.plainCustomHeaders)}Lw(t,s){if(!s||0===s.length)return!1;const i=csString.prototype.toLowerCase.call(t);return csArray.prototype.some.call(s,(t=>csString.prototype.toLowerCase.call(t)===i))}}class Tc extends Zi{constructor(t,s,i,e,n,r){super(),this.tn=t,this.Mw=s,this.Pc=i,this.en=e,this.Sa=n,this.tt=r,this.Dw=[],this.dn=0,this.Uw=[]}initStates(){this.Ol=yt.now(),this.Mw.removeQueryParams(),this.Mw.setQueryParams(this.Pc.getRequestParameters()),this.Dw=[],this.dn=0}onStart(){this.tn.subscribe(Tc.Bn,(t=>this.kn(t))),this.zw()}onStop(){this.tn.unsubscribe(Tc.Bn)}onIframeJavascriptError(t){this.kn(t)}trackCustomError(t){const s={errorType:"jsError",message:`Custom Error: ${t}`,lineno:1,colno:1,filename:"https://cserror.com/texterror.js"};this.Hw(s)}Hw(t){this.isStarted?this.kn(t,(t=>this.Sa.emitCustomJavaScriptErrorEvent(t))):csArray.prototype.push.call(this.Uw,t)}zw(){this.isStarted&&(csArray.prototype.forEach.call(this.Uw,(t=>this.Hw(t))),this.Uw=[])}kn(t,s){if(this.isStarted&&this.dn<20){const i={...t,pageUrl:this.tt.getAnonymizedUrl(),rt:this.Nl()};this.en.anonymize(i),csArray.prototype.push.call(this.Dw,i),this.kw(),s&&s(i)}}Nl(){return yt.now()-this.Ol}kw(){this.Mw.send({errors:this.Dw}),this.Dw=[],this.dn+=1}}Tc.Bn="JavaScriptErrorsService";const Ic=["trackError"];class Pc{constructor(t,s,i,e,n,r,h,o,c){this.tn=t,this.en=s,this.L=i,this.Pc=e,this.iu=n,this.Ra=r,this.Sa=h,this.tt=o,this.Pa=c}init(){const t=this.Pa.create(`${this.L.getTrackerUri()}/errors`,!0);this.Fw=new Tc(this.tn,t,this.Pc,this.en,this.Sa,this.tt),this.iu.addListener(this.Fw),this.$w()}$w(){this.L.jsCustomErrorsEnabled&&!this.L.customErrors.enabled&&this.Ra.register(Ic,(t=>{this.Fw.trackCustomError(t)}))}onStartTracking(){this.Fw.start()}onAfterNaturalPageView(){this.Fw.initStates()}onAfterArtificialPageView(){this.Fw.initStates()}onBeforeSessionRenewal(){this.Fw.stop()}onOptout(){this.Fw.stop()}}class bc{constructor(){this.Bw=go.Natural}setPageViewType(t){this.Bw=t}getPageViewType(){return this.Bw}getRequestParameters(){return{pvt:this.Bw}}}class Vc{constructor(t){this.Qe=t}onAfterVisitorRenewal(){this.Qe.startNewSession()}}class Cc{constructor(){this.qw=null,this.jw=null,this.ai=null,this.Wu=null,this.Bi=null,this.Gw=()=>{},this.Zw=["value","checked","src","data","alt"],this.Ww={state:wi.SensitiveState.Child},this.Jw=t=>{for(const s of t)if(wi.isSensitive(s.target)||wi.isSensitiveChild(s.target))for(let t=0;t"added"===s&&this.tp(t)))),this.Wu.observe(),setTimeout(i)}stopSensitiveIdentifier(){var t,s,i,e;this.qw&&(this.sp(document),this.qw.disconnect()),null===(t=this.jw)||void 0===t||t.disconnect(),null===(s=this.ai)||void 0===s||s.disconnect(),null===(i=this.Wu)||void 0===i||i.disconnect(),null===(e=this.Bi)||void 0===e||e.disconnect()}unidentifySensitiveNodes(t){this.sp(t)}onSensitiveElementResize(t){this.Gw=t}Xw(){return window.ResizeObserver?new ResizeObserver((t=>{csArray.prototype.forEach.call(t,(t=>{this.ip(t)}))})):null}Yw(){return new be((t=>{csArray.prototype.forEach.call(t,(t=>{this.ep(t)?this.Kw(t):(this.np(t),this.rp(t))}))}))}Qw(t){return new be((s=>{csArray.prototype.forEach.call(s,(s=>this.hp(s,t)))}))}ip(t){const s=t.target.getBoundingClientRect(),i=wi.getSensitiveDetails(t.target);if(i.state!==wi.SensitiveState.Parent)return;if(s.width===i.width&&s.height===i.height)return;const e={state:wi.SensitiveState.Parent,width:s.width,height:s.height};wi.setSensitiveProperty(t.target,e),this.Gw({target:t.target,width:s.width,height:s.height})}rp(t){this.Bi&&u(t)&&!E(t)&&this.Bi.observe(t)}ep(t){const s=csNodeparentNode.apply(t);return s?wi.isSensitive(s)||wi.isSensitiveChild(s):!!I(t)&&(wi.isSensitive(t.host)||wi.isSensitiveChild(t.host))}tp(t){(wi.isSensitive(t.host)||wi.isSensitiveChild(t.host))&&wi.setSensitiveProperty(t,this.Ww)}sp(t){de(t,NodeFilter.SHOW_ELEMENT).visitAll((t=>{wi.unsetSensitiveProperty(t)}))}np(t){const s=t.getBoundingClientRect(),i={state:wi.SensitiveState.Parent,width:s.width,height:s.height};wi.setSensitiveProperty(t,i),this.op(t),de(t).visitAll((s=>s!=t&&wi.setSensitiveProperty(s,this.Ww)))}Kw(t){wi.setSensitiveProperty(t,this.Ww),de(t).visitAll((s=>s!=t&&wi.setSensitiveProperty(s,this.Ww)))}op(t){var s;const i=null!==(s=fi.getProperty(t,wi.sensitiveAttributeProp))&&void 0!==s?s:{attributes:[]};for(let t=0;tcsString.prototype.indexOf.call(s.attrName,n)>-1&&ui.call(t,s.selector)))&&csArray.prototype.push.call(e.attributes,n)}0!==e.attributes.length&&wi.setSensitiveAttributeProperty(t,e)}}class Nc{constructor(t,s,i,e,n,r,h,o,c,a,u,l,d,f,w,p,m,y,A,g,E,v,_,R,S,T){this.Pc=t,this.fu=s,this.W=i,this.J=e,this.ui=n,this.Ra=r,this.cp=h,this.L=o,this.ap=c,this.up=a,this.lp=u,this.Co=l,this.M=d,this.pl=f,this.ba=w,this.tt=p,this.dp=m,this.md=y,this.iu=A,this.hs=g,this.fp=E,this.Ia=v,this.wp=_,this.th=R,this.Pa=S,this.pp=T,this.mp=(t=!1)=>{this.yp.start(t),this.Ap.start()}}start(){if(this.ap.init(),this.up.init(),this.up.isActive())return;let t,s,i,e,n,r,h,o,c,a,u,l,d,f,w;this.th.schedule((()=>{l=new Ho(this.J,this.W),w=new Vc(l),u=new ko(this.pl),f=new lc(ts),t=new Ao(this.L,this.Pc,this.W,this.pl,u,this.Ra,l,f,this.iu,this.Pa),s=new jr(this.Ra,this.J,this.L,this.Pc,this.fu,this.M);const p=new Cc;d=new ic(this.L,p),a=new wc;const m=new rc(this.L);c=new nc(this.L,m,a,this.iu),c.init();const y=new bc;i=new zr(this.W,this.J,this.Ra,this.iu,m,this.L,y,a),e=new th(this.L,this.Pc,this.W,this.Ra,this.M,l,this.tt),this.yp=new No(this.L,this.Ra,this.ui,this.Pc,this.W,this.J,this.Co,this.hs,this.ba,this.tt,this.Ia,y),n=new zo(this.L,this.W,this.J,this.Ra),r=new Jo(this.L,this.Ra,this.fu,this.Pc,this.md),h=new ec(this.Ra),o=new fc(this.L,new vt(this.L,this.M),this.Pa),this.Ap=new Oo})),this.L.apiErrors.enabled&&this.th.schedule((()=>{const t=new Sc(this.L);let s;const i=new gc(t),e=new Ac(this.L,i,s),n=new yc(t),r=new pc(this.L,n,s);this.nn=new hc(e,r),this.rn=new oc(this.ba);const h=new Rc(this.nn,this.rn,this.L,this.Pc,this.iu,this.Ra,this.Pa);h.init(),this.ui.addListener(h)})),this.L.jsErrorsEnabled&&this.th.schedule((()=>{this.tn=new Yo,this.en=new cc(this.M,this.tt);const t=new Pc(this.tn,this.en,this.L,this.Pc,this.iu,this.Ra,this.md,this.tt,this.Pa);t.init(),this.ui.addListener(t)})),this.th.schedule((()=>{this.lp.init()})),this.th.schedule((()=>{i.init()})),this.th.schedule((()=>{s.init()})),this.th.schedule((()=>{e.init()})),this.th.schedule((()=>{this.fp.init()})),this.th.schedule((()=>{this.yp.init()})),this.th.schedule((()=>{n.init()})),this.th.schedule((()=>{var t;null===(t=this.pp)||void 0===t||t.init()})),this.th.schedule((()=>{r.init()})),this.th.schedule((()=>{this.dp.init()})),this.th.schedule((()=>{h.init()})),this.th.schedule((()=>{o.init()})),this.th.schedule((()=>{this.wp.init()})),this.th.schedule((()=>{this.ui.addListener(n),this.ui.addListener(this.cp),this.ui.addListener(t),this.ui.addListener(this.lp),this.ui.addListener(i),this.ui.addListener(this.fp),this.ui.addListener(this.yp),this.pp&&this.ui.addListener(this.pp),this.ui.addListener(r),this.ui.addListener(s),this.ui.addListener(c),this.ui.addListener(o),this.ui.addListener(w)})),Jn.isRecordingSupported()&&this.th.schedule((()=>{const t=new Ir(a,this.J,this.L,this.Co,this.Pc,this.Ra,this.M,l,this.tt,d,this.tn,this.en,this.nn,f,this.rn,this.ui,this.md,this.iu,this.Ia,this.th,this.Pa,this.ba);t.init(),this.ui.addListener(t),i.setRecordingService(t.recordingService)})),this.th.schedule((()=>{t.init()})),this.th.schedule((()=>{l.onSessionExpired((()=>{this.ui.emitBeforeSessionRenewal(),this.gp(!0),this.ui.emitAfterSessionRenewal()})),this.gp()}))}gp(t=!1){var s;this.Ra.start(),this.Ap.onLoad((()=>{this.ui.emitStartTracking(t)}));null===(s=window.heap)||void 0===s||s.getUserId;qo(this.L)&&!t||this.mp(t)}}class kc{constructor(t,s,i,e,n,r,h,o){this.L=t,this.W=s,this.rs=i,this.Ep=e,this.vp=n,this._p=r,this.Rp=h,this.Sp=o}compute(t){var s,i;this.L.crossDomainTracking&&!this.L.cookielessTrackingEnabled?this.L.crossDomainSingleIframeTracking?null===(s=this.Rp)||void 0===s||s.start((()=>this.Tp(t))):null===(i=this._p)||void 0===i||i.applyUpToDate((()=>this.Tp(t))):this.Tp(t)}Tp(t){this.vp.handle(),this.Ep.clear(),this.Ip()?(this.Ep.restoreClearedVisitor(),t(!0)):(this.rs.exclude(this.L),t(!1))}Ip(){const t=Y.boolean(this.L.sampleRate);return this.Sp.isForceIncluded()||!this.rs.isExcluded()&&this.W.doesVisitorExist()||!this.rs.isExcluded()&&t}}var Oc;!function(t){t.generate=function(){const t=navigator.userAgent+navigator.language+navigator.platform,s=csString.prototype.slice.call(function(t){let s=0;for(let i=0;i{const s=(i+16*Math.random())%16|0;return i=Math.floor(i/16),("x"===t?s:7&s|8).toString(16)}));return csString.prototype.replace.call(e,"hhhh",s)}}(Oc||(Oc={}));class $c{constructor(t,s,i,e){this.L=t,this.Pp=s,this.J=i,this.ui=e,this.bp=1e4}createOrUpdateVisitor(){let t=this.getVisitor();null===t&&(t=this.Vp(),this.J.removeSession()),this.Cp(t),this.setVisitor(t)}Vp(){return{id:Oc.generate(),visitsCount:0,appliedTrackingDraw:this.L.lastTrackingDraw,creationTimestamp:At(),lastVisitTimestamp:0,hitTimestamp:0,expires:yt.now()+this.L.visitorCookieTimeout,allowSubdomains:this.L.allowSubdomains}}Cp(t){const s=At();this.J.doesSessionExist()||(t.visitsCount+=1,t.lastVisitTimestamp=s),t.hitTimestamp=s,t.appliedTrackingDraw=this.L.lastTrackingDraw,this.Np=t.visitsCount}getRequestParameters(){const t=this.getVisitor();return t?{uu:t.id,sn:`${t.visitsCount}`,hd:`${t.hitTimestamp}`}:{}}getVisitor(){return this.Pp.get()}setVisitor(t){this.Pp.set(t)}doesVisitorExist(){return null!==this.Pp.get()}resetVisitor(){this.kp(),this.ui.emitAfterVisitorCleared()}removeVisitor(){this.Pp.remove()}hasAllowSubdomainsChanged(){const t=this.getVisitor();if(!t)return!1;return t.allowSubdomains!==this.L.allowSubdomains}handleSubdomainChange(){this.Pp.handleSubdomainChange()}isSessionRenewed(){const t=this.getVisitor();return null!==t&&void 0!==this.Np&&t.visitsCount!==this.Np}Op(){return!It(this.$p)||yt.now()-this.$p>this.bp}renewVisitor(){this.Op()?(this.$p=yt.now(),this.kp(),this.ui.emitAfterVisitorRenewal()):ts.warn("session:start:newVisitor is trying to renew visitor under time limit")}kp(){this.ui.emitBeforeVisitorRenewal(),this.removeVisitor()}}var xc;!function(t){t[t.NO=0]="NO",t[t.WITHDRAWN=1]="WITHDRAWN",t[t.GRANTED=2]="GRANTED"}(xc||(xc={}));class Lc{constructor(t,s){this.xp=t,this.Lp=s,this.Mp=null,this.Dp=0,this.zp=xc.NO}setDynamicVariablesService(t){this.Hp=t}createOrUpdateSession(){this.Fp(),this.Bp=yt.now(),this.Dp=0;let t=this.qp();null===t?(t=this.jp(),this.Gp(t),this.Zp(t)):(t=this.Lp.sanitizeSessionRecordingState(t),this.Gp(t),t.recordingState=this.Lp.updateRecordingState(t)),this.setSession(t)}grantReplayRecording(t){t.recordingState=this.Lp.getDisabledRecordingState(),t.recordingState=this.Lp.computeInitialRecordingStateFromRecordingConsentGranted(t),this.setSession(t)}grantReplayRecordingBeforeSessionStart(){this.zp=xc.GRANTED}withdrawnReplayRecording(t){t.recordingState=this.Lp.getConsentWithdrawnRecordingState(),this.setSession(t)}withdrawnReplayRecordingBeforeSessionStart(){this.zp=xc.WITHDRAWN}Zp(t){this.zp===xc.WITHDRAWN?(t.recordingState=this.Lp.getConsentWithdrawnRecordingState(),this.setSession(t)):this.zp===xc.GRANTED?t.recordingState=this.Lp.computeInitialRecordingStateFromRecordingConsentGranted(t):t.recordingState=this.Lp.computeInitialRecordingState(t),this.zp=xc.NO}jp(){return{pageNumber:0,recordingState:this.Lp.getDisabledRecordingState(),etrState:Rs.ETR_OFF}}Gp(t){t.pageNumber+=1}isReplayRecorded(){const t=this.getSession();return!!t&&this.Lp.isReplayRecorded(t)}isTemporarilyRecorded(){const t=this.getSession();return(null==t?void 0:t.recordingState)===_s.TEMPORARILY_RECORDED}abortQuotaServiceRequest(){this.Lp.abortQuotaServiceRequest()}getRequestParameters(){const t={},s=this.getSession();return null!==s&&(t.pn=`${s.pageNumber}`),t}getSession(){return this.xp.get()}qp(){return this.xp.get(!0)}doesSessionExist(){return null!==this.xp.get()}setSession(t){this.xp.set(t)}removeSession(){this.xp.remove()}getRecordingStates(){const t=this.getSession(),s=[];return t&&(t.recordingState!==_s.NOT_RECORDED&&csArray.prototype.push.call(s,t.recordingState),t.etrState===Rs.ETR_ON&&csArray.prototype.push.call(s,_s.ETR_SAMPLING)),s}updateRecordingState(t,s){const i=this.getSession();null!==i&&(i.recordingState=t,i.etrState=s,this.setSession(i))}hasValidSession(){const t=this.xp.getRawSession();return this.xp.isValid(t)}handleSubdomainChange(){this.xp.handleSubdomainChange()}pollCacheRefreshEvent(t=!0){const s=this.xp.isCacheRefreshed();return s&&t&&this.xp.resetCacheRefreshed(),s}extendSessionPeriodically(){this.Mp||this.Wp()}extendSession(){const t=this.getSession();return null===t?(ts.warn("extendSession is trying to extend an expired session"),this.Fp(),!1):(this.xp.set(t,Is),!0)}Wp(){if(this.Jp())return void this.Fp();this.extendSession()&&(this.Kp(),this.Xp())}Xp(){this.Mp=window.setTimeout((()=>{this.Wp()}),174e4)}Jp(){return 1434e4-(yt.now()+Is-this.Bp)<0}Fp(){this.Mp&&(window.clearTimeout(this.Mp),this.Mp=null)}Kp(){this.Dp+=1,this.Hp.trackDynamicVariable("session_expiry_update",this.Dp)}}class Mc{constructor(t,s,i){this.L=t,this.W=s,this.rs=i}clear(){this.Yp()&&(this.Qp=this.W.getVisitor(),this.W.removeVisitor()),this.tm()&&this.rs.removeExclusion()}Yp(){return this.W.doesVisitorExist()&&this.W.getVisitor().appliedTrackingDraw!==this.L.lastTrackingDraw}tm(){return this.rs.getAppliedTrackingDraw()!==this.L.lastTrackingDraw}restoreClearedVisitor(){this.Qp&&this.W.setVisitor(this.Qp)}}class Dc{constructor(t,s,i){this.W=t,this.J=s,this.sm=i}handle(){this.W.hasAllowSubdomainsChanged()&&(this.W.handleSubdomainChange(),this.J.handleSubdomainChange(),this.sm.handleSubdomainChange())}}class Uc{constructor(){this.listeners=[]}addListener(t){csArray.prototype.push.call(this.listeners,t)}}class zc extends Uc{constructor(t){super(),this.th=t}emitBeforeNaturalPageView(){for(const t of this.listeners)t.onBeforeNaturalPageView&&t.onBeforeNaturalPageView()}emitAfterNaturalPageView(){for(const t of this.listeners)t.onAfterNaturalPageView&&t.onAfterNaturalPageView()}emitStartTracking(t){for(const s of this.listeners)s.onStartTracking&&this.th.schedule((()=>s.onStartTracking(t)))}emitArtificialPageViewEnd(){for(const t of this.listeners)if(t.onArtificialPageViewEnd)try{t.onArtificialPageViewEnd()}catch(t){ts.error(t)}}emitBeforeArtificialPageView(){for(const t of this.listeners)t.onBeforeArtificialPageView&&t.onBeforeArtificialPageView()}emitAfterArtificialPageView(){for(const t of this.listeners)t.onAfterArtificialPageView&&t.onAfterArtificialPageView()}emitBeforeSessionRenewal(){for(const t of this.listeners)t.onBeforeSessionRenewal&&t.onBeforeSessionRenewal()}emitAfterSessionRenewal(){for(const t of this.listeners)t.onAfterSessionRenewal&&t.onAfterSessionRenewal()}emitOptout(){for(const t of this.listeners)t.onOptout&&t.onOptout()}emitReplayUnanonymizationConsentGranted(){for(const t of this.listeners)t.onReplayUnanonymizationConsentGranted&&t.onReplayUnanonymizationConsentGranted()}emitReplayUnanonymizationConsentWithdrawn(){for(const t of this.listeners)t.onReplayUnanonymizationConsentWithdrawn&&t.onReplayUnanonymizationConsentWithdrawn()}emitAfterReplayRecordingConsentGranted(){for(const t of this.listeners)t.onAfterReplayRecordingConsentGranted&&t.onAfterReplayRecordingConsentGranted()}emitAfterReplayRecordingConsentWithdrawn(){for(const t of this.listeners)t.onAfterReplayRecordingConsentWithdrawn&&t.onAfterReplayRecordingConsentWithdrawn()}emitRecordingStateChange(t,s){for(const i of this.listeners)i.onRecordingStateChange&&i.onRecordingStateChange(t,s)}emitInitialDomStart(){for(const t of this.listeners)t.onInitialDomStart&&t.onInitialDomStart()}emitInitialDomDone(t){for(const s of this.listeners)s.onInitialDomDone&&s.onInitialDomDone(t)}emitRecordingStatusChange(){for(const t of this.listeners)t.onRecordingStatusChange&&t.onRecordingStatusChange()}emitBeforeVisitorRenewal(){for(const t of this.listeners)t.onBeforeVisitorRenewal&&t.onBeforeVisitorRenewal()}emitAfterVisitorCleared(){for(const t of this.listeners)t.onAfterVisitorCleared&&t.onAfterVisitorCleared()}emitAfterVisitorRenewal(){for(const t of this.listeners)t.onAfterVisitorRenewal&&t.onAfterVisitorRenewal()}}es([ei("emitStartTracking")],zc.prototype,"emitStartTracking",null);const Hc="_cs_c";var Fc;!function(t){t[t.NOT_REQUIRED=0]="NOT_REQUIRED",t[t.NOT_EXPRESSED=1]="NOT_EXPRESSED",t[t.GRANTED=2]="GRANTED",t[t.WITHDRAWN=3]="WITHDRAWN"}(Fc||(Fc={}));class Bc{constructor(t,s,i){this.L=t,this.cs=s,this.im=i}get(){let t;return t=this.L.cookielessTrackingEnabled?this.im.getItem(Hc):this.cs.get(Hc),null===t?t:Number(t)}set(t){this.L.cookielessTrackingEnabled?this.im.setItem(Hc,csString(t)):this.cs.set(Hc,csString(t),X)}remove(){this.L.cookielessTrackingEnabled?this.im.removeItem(Hc):this.cs.delete(Hc)}handleSubdomainChange(){this.L.cookielessTrackingEnabled||(this.L.allowSubdomains?this.cs.delete(Hc,cs.CURRENT_DOMAIN):this.cs.delete(Hc,this.cs.getRootDomain()))}}class qc{constructor(t,s,i){this.L=t,this.J=s,this.ui=i}grantReplayConsent(){if(!br.isReplayConsentNeeded(this.L))return;const t=this.J.getSession();t?br.isRecordingBlockedByConsent(t)&&(this.J.grantReplayRecording(t),this.ui.emitAfterReplayRecordingConsentGranted()):this.J.grantReplayRecordingBeforeSessionStart()}withdrawReplayConsent(){if(!br.isReplayConsentNeeded(this.L))return;const t=this.J.getSession();t?br.isRecordingWithDrawn(t)||(this.J.withdrawnReplayRecording(t),this.ui.emitAfterReplayRecordingConsentWithdrawn()):this.J.withdrawnReplayRecordingBeforeSessionStart()}}const jc=["replay:consent:unanonymized:granted","trackConsentGranted"],Gc=["replay:consent:unanonymized:withdrawn","trackConsentWithdrawn"],Zc=["replay:consent:startForSession:granted"],Wc=["replay:consent:startForSession:withdrawn"];class Jc{constructor(t,s,i,e,n){this.L=t,this.Ra=s,this.Co=i,this.J=e,this.ui=n}init(){this.nm=new qc(this.L,this.J,this.ui),this.Co.setInitialConsent(),this.$w()}$w(){this.Ra.register(jc,(()=>{this.Co.grantReplayAnonymizationConsent()})),this.Ra.register(Gc,(()=>{this.Co.withdrawReplayAnonymizationConsent()})),this.Ra.register(Zc,(()=>{this.nm.grantReplayConsent()})),this.Ra.register(Wc,(()=>{this.nm.withdrawReplayConsent()}))}onOptout(){this.Co.removeAllConsents()}onBeforeVisitorRenewal(){this.Co.removeAllConsents()}onAfterVisitorRenewal(){this.Co.setInitialConsent()}onAfterVisitorCleared(){this.Co.setInitialConsent()}}class Kc{constructor(t,s,i){this.L=t,this.Pp=s,this.ui=i}setInitialConsent(){const t=this.Pp.get();(null===t||this.hasConsentRequiredChanged(t))&&this.setDefaultReplayAnonymization()}hasConsentRequiredChanged(t){const s=this.L.consentRequired;return s&&t===Fc.NOT_REQUIRED||!s&&t!==Fc.NOT_REQUIRED}handleSubdomainChange(){this.Pp.handleSubdomainChange()}setDefaultReplayAnonymization(){const t=this.L.consentRequired?Fc.NOT_EXPRESSED:Fc.NOT_REQUIRED;this.Pp.set(t)}grantReplayAnonymizationConsent(){this.L.consentRequired&&(this.Pp.set(Fc.GRANTED),this.ui.emitReplayUnanonymizationConsentGranted())}withdrawReplayAnonymizationConsent(){this.L.consentRequired&&(this.Pp.set(Fc.WITHDRAWN),this.ui.emitReplayUnanonymizationConsentWithdrawn())}removeAllConsents(){this.Pp.remove()}isReplayUnanonymizedAllowedByConsent(){return!this.L.consentRequired||this.Pp.get()===Fc.GRANTED}getRequestParameters(){return{uc:`${this.Pp.get()}`}}}class Xc{constructor(t,s,i,e,n,r,h){this.ui=t,this.Ra=s,this.cp=i,this.ap=e,this.up=n,this.rm=r,this.lp=h}start(){this.ui.addListener(this.rm),this.ui.addListener(this.lp),this.ui.addListener(this.cp),this.lp.init(),this.ap.init(),this.up.init(),this.up.isActive()||this.Ra.start()}}class Yc{constructor(t,s){this.Ts=t,this.Pp=s}exclude(t){this.Pp.set(csString(t.lastTrackingDraw))}removeExclusion(){this.Pp.remove()}isExcluded(){return this.hm()||this.om()}hm(){return 0!==this.getAppliedTrackingDraw()}getAppliedTrackingDraw(){return this.Pp.get()}om(){return csString.prototype.indexOf.call(this.Ts.href,ks)>0}}class Qc{constructor(t){this.pu=t}onOptout(){this.pu.removeExclusion()}}var ta;!function(t){t.SessionReplay="SR",t.None=""}(ta||(ta={}));class sa{constructor(t){this.tt=t,this.am=new RegExp(".^")}setExcludeUrlForSessionReplay(t){this.am=new RegExp(t)}um(){return this.am.test(this.tt.getAnonymizedUrl())?ta.SessionReplay:ta.None}isUrlExcludedForSessionReplay(){return this.um()===ta.SessionReplay}getRequestParameters(){return{ex:this.um()}}}const ia=["excludeURLforReplay"];class ea{constructor(t,s){this.pu=t,this.Ra=s}init(){this.Ra.register(ia,(t=>{St(t)&&this.pu.setExcludeUrlForSessionReplay(t)}))}}const na="_cs_inc";class ra{constructor(t,s){this.Ts=t,this.cs=s}isForceIncluded(){return this.lm()||this.dm()}isForceReplayRecorded(){return this.fm(_s.GLOBAL_SAMPLING)}lm(){return null!==this.cs.get(na)}fm(t){return this.cs.get(na)===t}dm(){return csString.prototype.indexOf.call(this.Ts.href,na)>0}}const ha="_cs_optout";class oa{constructor(t,s,i){this.L=t,this.cs=s,this.im=i}get(){return this.L.cookielessTrackingEnabled?this.im.getItem(ha):this.cs.get(ha)}set(t){this.L.cookielessTrackingEnabled?this.im.setItem(ha,t):this.cs.set(ha,t,X)}}class ca{constructor(t,s,i){this.ui=t,this.Ts=s,this.Pp=i}init(){!this.isActive()&&this.wm()&&this.activate()}isActive(){return"1"===this.Pp.get()}activate(){this.ui.emitOptout(),this.Pp.set("1")}wm(){return csString.prototype.indexOf.call(this.Ts.href,ha)>0}}const aa=["optout"],ua=["optin"];class la{constructor(t,s){this.Ra=t,this.up=s}init(){this.Ra.register(aa,(()=>{this.up.activate()}))}}var da;function fa(t,s){return s.visitor.visitsCount!==t.visitor.visitsCount?s.visitor.visitsCount-t.visitor.visitsCount:t.session?s.session?s.session.pageNumber-t.session.pageNumber:-1:1}!function(t){t.select=function(t,s){const i=function(t,s){return csArray.prototype.filter.call(t,(t=>t.exclusion===s))[0]}(t,s),e=function(t,s){return csArray.prototype.sort.call(csArray.prototype.filter.call(t,(t=>function(t,s){return t.visitor&&t.visitor.appliedTrackingDraw===s}(t,s))),fa)[0]}(t,s);return i||e}}(da||(da={}));class wa{constructor(t,s,i){this.L=t,this.pm=s,this.ym=i}applyUpToDate(t){this.ym.retrieve(this.L.hostnames,(s=>{const i=[this.pm.get(),...s],e=da.select(i,this.L.lastTrackingDraw);this.pm.apply(e),t()}))}}class pa{constructor(t,s){this.Ra=t,this.iu=s}init(){this.iu.addListener(this.Ra)}onOptout(){this.Ra.stop()}onBeforeSessionRenewal(){this.Ra.stop()}}var ma;!function(t){t.UXA="_uxa",t.WVT="cs_wvt"}(ma||(ma={}));class ya extends Zi{constructor(t){super(),this.Am=t,this.gm={}}register(t,s,i){for(const e of t)this.gm[e]={callback:s,configuration:i},this.gm}onStart(){this.Em(),this.vm()}onStop(){for(const t of this.Am)window[t]=[]}applyFromIntegration(t,s,i){this.isStarted?ts.tryToExecute(`Commands.apply.from.integration: ${i}`,(()=>{if(this.gm[t])return this.gm[t].callback(...s)}))():window._uxa.push([t,...s])}onIframeCommands(t){for(const s of t.commands)this._m(s.name,s.params,t.iframePath)}_m(t,s,i){ts.tryToExecute(`Commands.apply.from.iframe: ${i}`,(()=>{if(this.gm[t])return this.gm[t].callback(...s)}))()}Em(){for(const t of this.Am)window[t].forEach((([t,...s])=>this.Rm(t,s,!1)))}vm(){for(const t of this.Am)window[t]={push:([t,...s])=>this.Rm(t,s,!0)}}Rm(t,s,i){var e,n;if(this.gm[t]){if((null===(e=this.gm[t].configuration)||void 0===e?void 0:e.disableApplyPending)&&!i||(null===(n=this.gm[t].configuration)||void 0===n?void 0:n.disableApplyImmediate)&&i)return;try{return this.gm[t].callback(...s)}catch(i){ts.error(`Command ${t} failed - params: ${csJSON.stringify(s)}`,i)}}}}const Aa="contentsquare.net";var ga;!function(t){t.Set="set",t.Remove="remove"}(ga||(ga={}));class Ea{constructor(t,s,i,e,n,r){this.L=t,this.cs=s,this.xp=i,this.Sm=e,this.Tm=n,this.Im=r,this.Pm=hs.None,this.bm=!1,this.Vm=[],this.Cm=[]}init(){this.Pm=this.cs.isSameSiteSupported()?hs.None:hs.NotSet,this.Nm()}setStates(t,s){this.pm=t,this.km=s}start(t){this.km.init(this.Om(),((s,i)=>{const e=[this.pm.get()];i&&csArray.prototype.push.call(e,s);const n=da.select(e,this.L.lastTrackingDraw);this.bm=!0,this.pm.apply(n),t()})),this.$m=this.km.openIframe()}setCookie(t,s,i){if(this.bm){const e={name:t,value:s,samesite:this.Pm,secure:os.Yes};i&&(e.expires=ns.toExpireDate(i).getTime()),this.xm(e)}}removeCookie(t){this.bm&&this.Lm(t)}Lm(t){this.Cm=csArray.prototype.filter.call(this.Cm,(s=>s!==t)),this.Vm=csArray.prototype.filter.call(this.Vm,(s=>s.name!==t)),csArray.prototype.push.call(this.Cm,t),this.setBatchReadyCall()}xm(t){this.Cm=csArray.prototype.filter.call(this.Cm,(s=>s!==t.name)),this.Vm=csArray.prototype.filter.call(this.Vm,(s=>s.name!==t.name)),csArray.prototype.push.call(this.Vm,t),this.setBatchReadyCall()}setBatchReadyCall(){this.Mm()}Mm(){if(this.Vm.length>0){const t=this.Dm(ga.Set,this.Vm);this.Um(t),this.Vm=[]}if(this.Cm.length>0){const t=this.Dm(ga.Remove,this.Cm);this.Um(t),this.Cm=[]}}Dm(t,s){return{command:t,cookies:s,domain:null,pid:this.L.projectId}}Um(t){const s=`https://${this.Om()}`;this.$m.contentWindow&&this.$m.contentWindow.postMessage(t,s)}Om(){return this.L.dualCollectionTagDomain&&this.L.dualCollectionTagDomain!==Aa?`cdnssl.${this.L.dualCollectionTagDomain}`:`csxd.${Aa}`}Nm(){this.xp.onCookieToSet(((t,s,i)=>{this.setCookie(t,s,i)})),this.Sm.onCookieToSet(((t,s,i)=>{this.setCookie(t,s,i)})),this.Tm.onCookieToSet(((t,s,i)=>{this.setCookie(t,s,i)})),this.Im.onCookieToSet(((t,s,i)=>{this.setCookie(t,s,i)})),this.xp.onCookieToRemove((t=>{this.removeCookie(t)})),this.Sm.onCookieToRemove((t=>{this.removeCookie(t)})),this.Tm.onCookieToRemove((t=>{this.removeCookie(t)})),this.Im.onCookieToRemove((t=>{this.removeCookie(t)}))}}es([hr(),is("send xdframe-single-iframe batch")],Ea.prototype,"setBatchReadyCall",null);class va{constructor(t,s){this.L=t,this.Ss=s}init(t,s){this.zm=`https://${t}`,this.Is=s}openIframe(){this.Ss.onMessage((t=>{this.Vs(t)})),this.Ss.onTimeout((()=>{this.Cs()})),this.Ss.start();const t=this.Hm(this.zm);return this.Ss.open(t)}Vs(t){if(this.Ns(t)){const s=t.data;let i=!0;if(this.Fm(t))return void ts.warn(`Error xdframe single domain: ${csJSON.stringify(t.data)} from ${t.origin}`);if(!Ds.isRawDomainState(s))return void ts.warn(`Unknown message format from xdframe single domain: ${csJSON.stringify(t.data)} from ${t.origin}`);Ds.isValid(s)||(ts.warn(`Invalid xdframe single domain state: ${csJSON.stringify(t.data)} from ${t.origin}`),i=!1),this.Ss.stop(),this.Is(i?Cs.fromRaw(s):{},i)}}Cs(){ts.warn(`xdframe single domain: timeout: ${this.Hm(this.zm)}`),this.Ss.stop(),this.Is({},!1)}Ns(t){return t.origin===this.zm&&Tt(t.data)}Fm(t){return!!t.data.error}Hm(t){return`${t}/uxa/xdframe-single-domain-1.2.0.html?pid=${this.L.projectId}`}}class _a{constructor(t,s,i,e){this.L=t,this.W=s,this.J=i,this.Bm=e}getRequestParameters(){var t;const s={...mt(),...this.L.getRequestParameters()},i=this.J.getSession();i&&(s.pn=`${i.pageNumber}`);const e=this.W.getVisitor();return e&&(s.sn=`${e.visitsCount}`,s.uu=`${e.id}`),(null===(t=this.Bm)||void 0===t?void 0:t.hasSubProjectId())&&(s.subProjectID=`${this.Bm.getSubProjectId()}`),s}}class Ra{constructor(t,s){this.Ra=t,this.V=s}init(){this.Ra.register(["debugEvents"],(t=>{"boolean"==typeof t&&this.V.updateDynamicFields("emitDebugEvents",t)}))}}function Sa(t,s,i){if(!It(s)&&!It(i))return t.href;const e=It(s)?function(t){return J(t,"/")?t:`/${t}`}(s):t.pathname,n=It(i)?function(t){return J(t,"?")||""===t?t:`?${t}`}(i):t.search;return`${t.protocol}//${t.host}${e}${n}`}var Ta;!function(t){t[t.page=1]="page",t[t.onNextPageviewOnly=2]="onNextPageviewOnly"}(Ta||(Ta={}));class Ia{constructor(t,s){this.Ts=t,this.ba=s,this.qm=10}overridePath(t,s){if(""===t)return void(this.jm=void 0);const i=this.Gm(s);i&&(this.Zm=i),this.jm=s?this.Wm(t,s):t}overrideQuery(t,s){const i=this.Gm(s);i&&(this.Jm=i),this.Km=s?this.Wm(t,s):t}computeOverriddenUrl(t){return this.Xm(t)?this.getAnonymizedUrl():t}Ym(t){return("string"==typeof t||"number"==typeof t)&&t in Ta}Xm(t){const s=this.Qm(this.Ts.href);return this.Qm(t)===s}Qm(t){return K(t,"/")?csString.prototype.slice.call(t,0,-1):t}Gm(t){return It(null==t?void 0:t.lifespan)&&this.Ym(null==t?void 0:t.lifespan)?null==t?void 0:t.lifespan:null}ty(){return this.Zm&&this.Zm in Ta}sy(){return this.Jm&&this.Jm in Ta}cleanupOverrideLifespan(){this.ty()&&(this.jm=void 0,this.Zm=void 0),this.sy()&&(this.Km=void 0,this.Jm=void 0)}getAnonymizedUrl(){const t=Sa(this.Ts,this.jm,this.Km);return this.ba.anonymizeUrl(t,[])}getUrlProtocol(){return this.Ts.protocol}getRequestParameters(){return{url:this.getAnonymizedUrl()}}Wm(t,s){return this.iy(s)?this.ey(t):this.ny(s)?this.hy(t):t}ny(t){return Boolean(t.decodeURI)}hy(t){return this.oy(t,1,!1)}iy(t){return Boolean(t.decodeURIDeep)}ey(t){return this.oy(t,this.qm,!0)}oy(t,s,i){let e=t;for(let t=0;t0?(this.py(t),_s.TEMPORARILY_RECORDED):_s.NOT_RECORDED):_s.NOT_RECORDED}updateRecordingState(t){return Jn.isRecordingSupported()?br.isRecordingBlockedByConsent(t)?t.recordingState===_s.BLOCKED_BY_CONSENT_WITHDRAWN?_s.BLOCKED_BY_CONSENT_WITHDRAWN:_s.BLOCKED_BY_CONSENT_NOT_EXPRESSED:t.recordingState===_s.GLOBAL_SAMPLING?_s.GLOBAL_SAMPLING:(this.ly=[],this.configuration.malkaUrlEnabled&&(csArray.prototype.push.call(this.ly,_s.URL_SAMPLING),this.configuration.malkaEtrEnabled&&csArray.prototype.push.call(this.ly,_s.ETR_SAMPLING)),this.ly.length>0?(this.py(t),_s.TEMPORARILY_RECORDED):_s.NOT_RECORDED):_s.NOT_RECORDED}py(t){var s;const i=null===(s=this.W)||void 0===s?void 0:s.getVisitor();this.uy.send({recordingTypes:csArray.prototype.map.call(this.ly,Number),url:this.tt.getAnonymizedUrl(),projectId:this.configuration.projectId,uu:(null==i?void 0:i.id)||"",sn:(null==i?void 0:i.visitsCount)||"",pn:(null==t?void 0:t.pageNumber)||""})}abortQuotaServiceRequest(){this.uy.abort()}isReplayRecorded(t){return!br.isRecordingBlockedByConsent(t)&&(t.recordingState===_s.TEMPORARILY_RECORDED||t.recordingState===_s.GLOBAL_SAMPLING||t.recordingState===_s.URL_SAMPLING||t.etrState===Rs.ETR_ON)}wy(){this.uy.onError((()=>this.quotaServiceErrorHandler("NetworkError"))),this.uy.onTimeout((()=>this.quotaServiceTimeoutHandler()),3e3),this.uy.onLoad((t=>this.quotaServiceLoadHandler(t)))}quotaServiceErrorHandler(t){this.my(`error - ${t}`)}quotaServiceTimeoutHandler(){this.my("timeout")}my(t){let s=_s.NOT_RECORDED;this.yy(this.ly)?(s=_s.GLOBAL_SAMPLING,ts.warn(`Quota Service: request ${t} - bypassed by GLOBAL_SAMPLING`)):ts.warn(`Quota Service: request ${t}`),this.ui.emitRecordingStateChange(s,Rs.ETR_OFF)}quotaServiceLoadHandler(t){if(200!==t.status)return void this.quotaServiceErrorHandler(`Status code: ${t.status}`);let s;try{s=csJSON.parse(t.responseText)}catch(s){return void this.quotaServiceErrorHandler(`Unable to parse the quota service response: ${t.responseText}`)}const i=null==s.allowedRecordingTypes?void 0:csArray.prototype.map.call(s.allowedRecordingTypes,csString);if(!i)return void this.quotaServiceErrorHandler("recording types missing from quota service response");let e=Rs.ETR_OFF,n=_s.NOT_RECORDED;this.yy(i)?n=_s.GLOBAL_SAMPLING:this.Ay(i)&&(n=_s.URL_SAMPLING),this.gy(i)&&(e=Rs.ETR_ON),this.ui.emitRecordingStateChange(n,e)}yy(t){return csArray.prototype.some.call(t,(t=>t===_s.GLOBAL_SAMPLING))}Ay(t){return csArray.prototype.some.call(t,(t=>t===_s.URL_SAMPLING))}gy(t){return csArray.prototype.some.call(t,(t=>t===_s.ETR_SAMPLING))}setVisitorService(t){this.W=t}getDisabledRecordingState(){return _s.NOT_RECORDED}getConsentWithdrawnRecordingState(){return _s.BLOCKED_BY_CONSENT_WITHDRAWN}}es([is("Quota Service: onerror")],ba.prototype,"quotaServiceErrorHandler",null),es([is("Quota Service: ontimeout")],ba.prototype,"quotaServiceTimeoutHandler",null),es([is("Quota Service: onload")],ba.prototype,"quotaServiceLoadHandler",null);const Va="|iframe|";class Ca extends Uc{constructor(t,s,i,e){super(),this.Ey=t,this.vy=s,this._y=i,this.Ry=e}emitIframeEvent(t,s,i){if(this.Sy(s)&&null===t)ts.error(`iframeEventEmitter received event ${s} with null iframe, content:${csJSON.stringify(i)}`);else switch(s){case Jt.ChildLogMessage:this.Ty(i);break;case Jt.AnalysisEvent:{const s=this.Ey.transformEvent(t,i);this.Iy(s);break}case Jt.RecordingEvent:{const s=i,e=this.Ry.transformEvents(t,s);if(0===e.events.length)return;e.containsUserEvent?this.Py(e.events):this.by(e.events);break}case Jt.JavascriptError:this.Vy(i);break;case Jt.ApiError:this.Cy(i);break;case Jt.DetailedApiError:this.Ny(i);break;case Jt.CustomError:this.ky(i);break;case Jt.EmerchandisingMessage:{const s=this._y.transformEvent(t,i);this.Oy(s);break}case Jt.Commands:{const s=this.vy.transformEvent(t,i);this.$y(s);break}case Jt.IntegrationCallback:this.xy(i);break;case Jt.StaticResource:this.Ly(i);break;case Jt.TrackingContextRequestMessage:this.My(i);break;default:ts.error(`Parent received unknown data type from iframe : ${csJSON.stringify(i)}`)}}Sy(t){const s=[Jt.AnalysisEvent,Jt.RecordingEvent,Jt.EmerchandisingMessage,Jt.Commands];return-1!==csArray.prototype.indexOf.call(s,t)}Ty(t){const{message:s,errorCode:i,level:e}=t;switch(e){case et.debug:ts.debug(s,i);break;case et.warn:ts.warn(s,i);break;case et.error:ts.error(s,i);break;case et.critical:ts.critical(s,i)}}Iy(t){for(const s of this.listeners)s.onIframeAnalysisEvent&&s.onIframeAnalysisEvent(t)}Py(t){for(const s of this.listeners)s.onIframeRecordingUserEvent&&s.onIframeRecordingUserEvent(t)}by(t){for(const s of this.listeners)s.onIframeRecordingBrowserEvent&&s.onIframeRecordingBrowserEvent(t)}Vy(t){for(const s of this.listeners)s.onIframeJavascriptError&&s.onIframeJavascriptError(t)}Cy(t){for(const s of this.listeners)s.onIframeApiError&&s.onIframeApiError(t)}Ny(t){for(const s of this.listeners)s.onIframeDetailedApiError&&s.onIframeDetailedApiError(t)}Oy(t){for(const s of this.listeners)s.onIframeEmerchandisingMessage&&s.onIframeEmerchandisingMessage(t)}$y(t){for(const s of this.listeners)s.onIframeCommands&&s.onIframeCommands(t)}xy(t){for(const s of this.listeners)s.onIframeIntegrationCallback&&s.onIframeIntegrationCallback(t)}Ly(t){for(const s of this.listeners)s.onIframeStaticResource&&s.onIframeStaticResource(t)}My(t){for(const s of this.listeners)s.onTrackingContextRequestCallback&&s.onTrackingContextRequestCallback(t)}ky(t){for(const s of this.listeners)s.onIframeCustomError&&s.onIframeCustomError(t)}}var Na;!function(t){t.COMPRESSION_DISABLED="compressionDisabled"}(Na||(Na={}));class ka{constructor(){}static init(t){this.Dy&&void 0===t||this.initFlags(t)}static initFlags(t=document.cookie){var s;const i=null===(s=/_cs_debug=((\w|\.|\:|=)+)/g.exec(t))||void 0===s?void 0:s[1];if(this.Dy=new Map,i){const t=csString.prototype.split.call(i,".");for(let s=0;s{var n;const r=i.toString(),h=`${null===(n=s.constructor)||void 0===n?void 0:n.name}.${r}`,o=e.value;(function(t,s){var i;if(null==t)return!1;return t===s||!!(null===(i=csString.prototype.match.call(t,new RegExp("(^|,)("+s+")(,|$)")))||void 0===i?void 0:i.length)})(ka.getString("debugLog"),t)&&(e.value=function(...t){return console.log(h,...t),o.bind(this)(...t)})}}}function Oa(){function t(t){let s=t.length;for(;--s>=0;)t[s]=0}const s=256,i=286,e=30,n=15,r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),c=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=new Array(576);t(a);const u=new Array(60);t(u);const l=new Array(512);t(l);const d=new Array(256);t(d);const f=new Array(29);t(f);const w=new Array(e);function p(t,s,i,e,n){this.static_tree=t,this.extra_bits=s,this.extra_base=i,this.elems=e,this.max_length=n,this.has_stree=t&&t.length}let m,y,A;function g(t,s){this.dyn_tree=t,this.max_code=0,this.stat_desc=s}t(w);const E=t=>t<256?l[t]:l[256+(t>>>7)],v=(t,s)=>{t.pending_buf[t.pending++]=255&s,t.pending_buf[t.pending++]=s>>>8&255},_=(t,s,i)=>{t.bi_valid>16-i?(t.bi_buf|=s<>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=s<{_(t,i[2*s],i[2*s+1])},S=(t,s)=>{let i=0;do{i|=1&t,t>>>=1,i<<=1}while(--s>0);return i>>>1},T=(t,s,i)=>{const e=new Array(16);let r,h,o=0;for(r=1;r<=n;r++)e[r]=o=o+i[r-1]<<1;for(h=0;h<=s;h++){let s=t[2*h+1];0!==s&&(t[2*h]=S(e[s]++,s))}},I=t=>{let s;for(s=0;s{t.bi_valid>8?v(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},b=(t,s,i,e)=>{const n=2*s,r=2*i;return t[n]{const e=t.heap[i];let n=i<<1;for(;n<=t.heap_len&&(n{let n,o,c,a,u=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],o=t.pending_buf[t.l_buf+u],u++,0===n?R(t,o,i):(c=d[o],R(t,c+s+1,i),a=r[c],0!==a&&(o-=f[c],_(t,o,a)),n--,c=E(n),R(t,c,e),a=h[c],0!==a&&(n-=w[c],_(t,n,a)))}while(u{const i=s.dyn_tree,e=s.stat_desc.static_tree,r=s.stat_desc.has_stree,h=s.stat_desc.elems;let o,c,a,u=-1;for(t.heap_len=0,t.heap_max=573,o=0;o>1;o>=1;o--)V(t,i,o);a=h;do{o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],V(t,i,1),c=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=c,i[2*a]=i[2*o]+i[2*c],t.depth[a]=(t.depth[o]>=t.depth[c]?t.depth[o]:t.depth[c])+1,i[2*o+1]=i[2*c+1]=a,t.heap[1]=a++,V(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,s)=>{const i=s.dyn_tree,e=s.max_code,r=s.stat_desc.static_tree,h=s.stat_desc.has_stree,o=s.stat_desc.extra_bits,c=s.stat_desc.extra_base,a=s.stat_desc.max_length;let u,l,d,f,w,p,m=0;for(f=0;f<=n;f++)t.bl_count[f]=0;for(i[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;u<573;u++)l=t.heap[u],f=i[2*i[2*l+1]+1]+1,f>a&&(f=a,m++),i[2*l+1]=f,l>e||(t.bl_count[f]++,w=0,l>=c&&(w=o[l-c]),p=i[2*l],t.opt_len+=p*(f+w),h&&(t.static_len+=p*(r[2*l+1]+w)));if(0!==m){do{for(f=a-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[a]--,m-=2}while(m>0);for(f=a;0!==f;f--)for(l=t.bl_count[f];0!==l;)d=t.heap[--u],d>e||(i[2*d+1]!==f&&(t.opt_len+=(f-i[2*d+1])*i[2*d],i[2*d+1]=f),l--)}})(t,s),T(i,u,t.bl_count)},k=(t,s,i)=>{let e,n,r=-1,h=s[1],o=0,c=7,a=4;for(0===h&&(c=138,a=3),s[2*(i+1)+1]=65535,e=0;e<=i;e++)n=h,h=s[2*(e+1)+1],++o{let e,n,r=-1,h=s[1],o=0,c=7,a=4;for(0===h&&(c=138,a=3),e=0;e<=i;e++)if(n=h,h=s[2*(e+1)+1],!(++o{_(t,0+(e?1:0),3),((t,s,i,e)=>{P(t),e&&(v(t,i),v(t,~i)),t.pending_buf.set(t.window.subarray(s,s+i),t.pending),t.pending+=i})(t,s,i,!0)};var L=t=>{$||((()=>{let t,s,c,g,E;const v=new Array(16);for(c=0,g=0;g<28;g++)for(f[g]=c,t=0;t<1<>=7;g{let r,h,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let i,e=4093624447;for(i=0;i<=31;i++,e>>>=1)if(1&e&&0!==t.dyn_ltree[2*i])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(i=32;i{let s;for(k(t,t.dyn_ltree,t.l_desc.max_code),k(t,t.dyn_dtree,t.d_desc.max_code),N(t,t.bl_desc),s=18;s>=3&&0===t.bl_tree[2*c[s]+1];s--);return t.opt_len+=3*(s+1)+5+5+4,s})(t),r=t.opt_len+3+7>>>3,h=t.static_len+3+7>>>3,h<=r&&(r=h)):r=h=e+5,e+4<=r&&-1!==i?x(t,i,e,n):4===t.strategy||h===r?(_(t,2+(n?1:0),3),C(t,a,u)):(_(t,4+(n?1:0),3),((t,s,i,e)=>{let n;for(_(t,s-257,5),_(t,i-1,5),_(t,e-4,4),n=0;n(t.pending_buf[t.d_buf+2*t.last_lit]=i>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&i,t.pending_buf[t.l_buf+t.last_lit]=255&e,t.last_lit++,0===i?t.dyn_ltree[2*e]++:(t.matches++,i--,t.dyn_ltree[2*(d[e]+s+1)]++,t.dyn_dtree[2*E(i)]++),t.last_lit===t.lit_bufsize-1),U=t=>{_(t,2,3),R(t,256,a),(t=>{16===t.bi_valid?(v(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)},z={_tr_init:L,_tr_stored_block:x,_tr_flush_block:M,_tr_tally:D,_tr_align:U};var H=(t,s,i,e)=>{let n=65535&t,r=t>>>16&65535,h=0;for(;0!==i;){h=i>2e3?2e3:i,i-=h;do{n=n+s[e++]|0,r=r+n|0}while(--h);n%=65521,r%=65521}return n|r<<16};const F=new Uint32Array((()=>{let t,s=[];for(var i=0;i<256;i++){t=i;for(var e=0;e<8;e++)t=1&t?3988292384^t>>>1:t>>>1;s[i]=t}return s})());var B=(t,s,i,e)=>{const n=F,r=e+i;t^=-1;for(let i=e;i>>8^n[255&(t^s[i])];return~t},q={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:G,_tr_stored_block:Z,_tr_flush_block:W,_tr_tally:J,_tr_align:K}=z,{Z_NO_FLUSH:X,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:Q,Z_FINISH:tt,Z_BLOCK:st,Z_OK:it,Z_STREAM_END:et,Z_STREAM_ERROR:nt,Z_DATA_ERROR:rt,Z_BUF_ERROR:ht,Z_DEFAULT_COMPRESSION:ot,Z_FILTERED:ct,Z_HUFFMAN_ONLY:at,Z_RLE:ut,Z_FIXED:lt,Z_DEFAULT_STRATEGY:dt,Z_UNKNOWN:ft,Z_DEFLATED:wt}=j,pt=258,mt=262,yt=103,At=113,gt=666,Et=(t,s)=>(t.msg=q[s],s),vt=t=>(t<<1)-(t>4?9:0),_t=t=>{let s=t.length;for(;--s>=0;)t[s]=0};let Rt=(t,s,i)=>(s<{const s=t.state;let i=s.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(t.output.set(s.pending_buf.subarray(s.pending_out,s.pending_out+i),t.next_out),t.next_out+=i,s.pending_out+=i,t.total_out+=i,t.avail_out-=i,s.pending-=i,0===s.pending&&(s.pending_out=0))},Tt=(t,s)=>{W(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,s),t.block_start=t.strstart,St(t.strm)},It=(t,s)=>{t.pending_buf[t.pending++]=s},Pt=(t,s)=>{t.pending_buf[t.pending++]=s>>>8&255,t.pending_buf[t.pending++]=255&s},bt=(t,s,i,e)=>{let n=t.avail_in;return n>e&&(n=e),0===n?0:(t.avail_in-=n,s.set(t.input.subarray(t.next_in,t.next_in+n),i),1===t.state.wrap?t.adler=H(t.adler,s,n,i):2===t.state.wrap&&(t.adler=B(t.adler,s,n,i)),t.next_in+=n,t.total_in+=n,n)},Vt=(t,s)=>{let i,e,n=t.max_chain_length,r=t.strstart,h=t.prev_length,o=t.nice_match;const c=t.strstart>t.w_size-mt?t.strstart-(t.w_size-mt):0,a=t.window,u=t.w_mask,l=t.prev,d=t.strstart+pt;let f=a[r+h-1],w=a[r+h];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(i=s,a[i+h]===w&&a[i+h-1]===f&&a[i]===a[r]&&a[++i]===a[r+1]){r+=2,i++;do{}while(a[++r]===a[++i]&&a[++r]===a[++i]&&a[++r]===a[++i]&&a[++r]===a[++i]&&a[++r]===a[++i]&&a[++r]===a[++i]&&a[++r]===a[++i]&&a[++r]===a[++i]&&rh){if(t.match_start=s,h=e,e>=o)break;f=a[r+h-1],w=a[r+h]}}}while((s=l[s&u])>c&&0!=--n);return h<=t.lookahead?h:t.lookahead},Ct=t=>{const s=t.w_size;let i,e,n,r,h;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-mt)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=t.hash_size,i=e;do{n=t.head[--i],t.head[i]=n>=s?n-s:0}while(--e);e=s,i=e;do{n=t.prev[--i],t.prev[i]=n>=s?n-s:0}while(--e);r+=s}if(0===t.strm.avail_in)break;if(e=bt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=e,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=Rt(t,t.ins_h,t.window[h+1]);t.insert&&(t.ins_h=Rt(t,t.ins_h,t.window[h+3-1]),t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let i,e;for(;;){if(t.lookahead=3&&(t.ins_h=Rt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-mt&&(t.match_length=Vt(t,i)),t.match_length>=3)if(e=J(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Rt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Rt(t,t.ins_h,t.window[t.strstart+1]);else e=J(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(e&&(Tt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Tt(t,!1),0===t.strm.avail_out)?1:2},kt=(t,s)=>{let i,e,n;for(;;){if(t.lookahead=3&&(t.ins_h=Rt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,e=J(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=Rt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,e&&(Tt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(e=J(t,0,t.window[t.strstart-1]),e&&Tt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(e=J(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Tt(t,!1),0===t.strm.avail_out)?1:2};function Ot(t,s,i,e,n){this.good_length=t,this.max_lazy=s,this.nice_length=i,this.max_chain=e,this.func=n}const $t=[new Ot(0,0,0,0,((t,s)=>{let i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ct(t),0===t.lookahead&&s===X)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const e=t.block_start+i;if((0===t.strstart||t.strstart>=e)&&(t.lookahead=t.strstart-e,t.strstart=e,Tt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-mt&&(Tt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Tt(t,!1),t.strm.avail_out),1)})),new Ot(4,4,8,4,Nt),new Ot(4,5,16,8,Nt),new Ot(4,6,32,32,Nt),new Ot(4,4,16,16,kt),new Ot(8,16,32,32,kt),new Ot(8,16,128,128,kt),new Ot(8,32,128,256,kt),new Ot(32,128,258,1024,kt),new Ot(32,258,258,4096,kt)];function xt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=wt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),_t(this.dyn_ltree),_t(this.dyn_dtree),_t(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),_t(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),_t(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Lt=t=>{if(!t||!t.state)return Et(t,nt);t.total_in=t.total_out=0,t.data_type=ft;const s=t.state;return s.pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap?42:At,t.adler=2===s.wrap?0:1,s.last_flush=X,G(s),it},Mt=t=>{const s=Lt(t);return s===it&&(t=>{t.window_size=2*t.w_size,_t(t.head),t.max_lazy_match=$t[t.level].max_lazy,t.good_match=$t[t.level].good_length,t.nice_match=$t[t.level].nice_length,t.max_chain_length=$t[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0})(t.state),s},Dt=(t,s,i,e,n,r)=>{if(!t)return nt;let h=1;if(s===ot&&(s=6),e<0?(h=0,e=-e):e>15&&(h=2,e-=16),n<1||n>9||i!==wt||e<8||e>15||s<0||s>9||r<0||r>lt)return Et(t,nt);8===e&&(e=9);const o=new xt;return t.state=o,o.strm=t,o.wrap=h,o.gzhead=null,o.w_bits=e,o.w_size=1<{let i,e;if(!t||!t.state||s>st||s<0)return t?Et(t,nt):nt;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===gt&&s!==tt)return Et(t,0===t.avail_out?ht:nt);n.strm=t;const r=n.last_flush;if(n.last_flush=s,42===n.status)if(2===n.wrap)t.adler=0,It(n,31),It(n,139),It(n,8),n.gzhead?(It(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),It(n,255&n.gzhead.time),It(n,n.gzhead.time>>8&255),It(n,n.gzhead.time>>16&255),It(n,n.gzhead.time>>24&255),It(n,9===n.level?2:n.strategy>=at||n.level<2?4:0),It(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(It(n,255&n.gzhead.extra.length),It(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=B(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(It(n,0),It(n,0),It(n,0),It(n,0),It(n,0),It(n,9===n.level?2:n.strategy>=at||n.level<2?4:0),It(n,3),n.status=At);else{let s=wt+(n.w_bits-8<<4)<<8,i=-1;i=n.strategy>=at||n.level<2?0:n.level<6?1:6===n.level?2:3,s|=i<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=At,Pt(n,s),0!==n.strstart&&(Pt(n,t.adler>>>16),Pt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(t.adler=B(t.adler,n.pending_buf,n.pending-i,i)),St(t),i=n.pending,n.pending!==n.pending_buf_size));)It(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(t.adler=B(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=B(t.adler,n.pending_buf,n.pending-i,i)),St(t),i=n.pending,n.pending===n.pending_buf_size)){e=1;break}e=n.gzindexi&&(t.adler=B(t.adler,n.pending_buf,n.pending-i,i)),0===e&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=B(t.adler,n.pending_buf,n.pending-i,i)),St(t),i=n.pending,n.pending===n.pending_buf_size)){e=1;break}e=n.gzindexi&&(t.adler=B(t.adler,n.pending_buf,n.pending-i,i)),0===e&&(n.status=yt)}else n.status=yt;if(n.status===yt&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&St(t),n.pending+2<=n.pending_buf_size&&(It(n,255&t.adler),It(n,t.adler>>8&255),t.adler=0,n.status=At)):n.status=At),0!==n.pending){if(St(t),0===t.avail_out)return n.last_flush=-1,it}else if(0===t.avail_in&&vt(s)<=vt(r)&&s!==tt)return Et(t,ht);if(n.status===gt&&0!==t.avail_in)return Et(t,ht);if(0!==t.avail_in||0!==n.lookahead||s!==X&&n.status!==gt){let i=n.strategy===at?((t,s)=>{let i;for(;;){if(0===t.lookahead&&(Ct(t),0===t.lookahead)){if(s===X)return 1;break}if(t.match_length=0,i=J(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(Tt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Tt(t,!1),0===t.strm.avail_out)?1:2})(n,s):n.strategy===ut?((t,s)=>{let i,e,n,r;const h=t.window;for(;;){if(t.lookahead<=pt){if(Ct(t),t.lookahead<=pt&&s===X)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,e=h[n],e===h[++n]&&e===h[++n]&&e===h[++n])){r=t.strstart+pt;do{}while(e===h[++n]&&e===h[++n]&&e===h[++n]&&e===h[++n]&&e===h[++n]&&e===h[++n]&&e===h[++n]&&e===h[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=J(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=J(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(Tt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,s===tt?(Tt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Tt(t,!1),0===t.strm.avail_out)?1:2})(n,s):$t[n.level].func(n,s);if(3!==i&&4!==i||(n.status=gt),1===i||3===i)return 0===t.avail_out&&(n.last_flush=-1),it;if(2===i&&(s===Y?K(n):s!==st&&(Z(n,0,0,!1),s===Q&&(_t(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),St(t),0===t.avail_out))return n.last_flush=-1,it}return s!==tt?it:n.wrap<=0?et:(2===n.wrap?(It(n,255&t.adler),It(n,t.adler>>8&255),It(n,t.adler>>16&255),It(n,t.adler>>24&255),It(n,255&t.total_in),It(n,t.total_in>>8&255),It(n,t.total_in>>16&255),It(n,t.total_in>>24&255)):(Pt(n,t.adler>>>16),Pt(n,65535&t.adler)),St(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?it:et)},zt=(t,s)=>{let i=s.length;if(!t||!t.state)return nt;const e=t.state,n=e.wrap;if(2===n||1===n&&42!==e.status||e.lookahead)return nt;if(1===n&&(t.adler=H(t.adler,s,i,0)),e.wrap=0,i>=e.w_size){0===n&&(_t(e.head),e.strstart=0,e.block_start=0,e.insert=0);let t=new Uint8Array(e.w_size);t.set(s.subarray(i-e.w_size,i),0),s=t,i=e.w_size}const r=t.avail_in,h=t.next_in,o=t.input;for(t.avail_in=i,t.next_in=0,t.input=s,Ct(e);e.lookahead>=3;){let t=e.strstart,s=e.lookahead-2;do{e.ins_h=Rt(e,e.ins_h,e.window[t+3-1]),e.prev[t&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=t,t++}while(--s);e.strstart=t,e.lookahead=2,Ct(e)}return e.strstart+=e.lookahead,e.block_start=e.strstart,e.insert=e.lookahead,e.lookahead=0,e.match_length=e.prev_length=2,e.match_available=0,t.next_in=h,t.input=o,t.avail_in=r,e.wrap=n,it},Ht={deflateInit:(t,s)=>Dt(t,s,wt,15,8,dt),deflateInit2:Dt,deflateReset:Mt,deflateResetKeep:Lt,deflateSetHeader:(t,s)=>t&&t.state?2!==t.state.wrap?nt:(t.state.gzhead=s,it):nt,deflate:Ut,deflateEnd:t=>{if(!t||!t.state)return nt;const s=t.state.status;return 42!==s&&69!==s&&73!==s&&91!==s&&s!==yt&&s!==At&&s!==gt?Et(t,nt):(t.state=null,s===At?Et(t,rt):it)},deflateSetDictionary:zt,deflateInfo:"pako deflate (from Nodeca project)"};const Ft=(t,s)=>Object.prototype.hasOwnProperty.call(t,s);var Bt={assign:function(t){const s=Array.prototype.slice.call(arguments,1);for(;s.length;){const i=s.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const s in i)Ft(i,s)&&(t[s]=i[s])}}return t},flattenChunks:t=>{let s=0;for(let i=0,e=t.length;i=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;jt[254]=jt[254]=1;const Gt=(t,s=t.length)=>{if(s<65534&&t.subarray&&qt)return String.fromCharCode.apply(null,t.length===s?t:t.subarray(0,s));let i="";for(let e=0;e{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let s,i,e,n,r,h=t.length,o=0;for(n=0;n>>6,s[r++]=128|63&i):i<65536?(s[r++]=224|i>>>12,s[r++]=128|i>>>6&63,s[r++]=128|63&i):(s[r++]=240|i>>>18,s[r++]=128|i>>>12&63,s[r++]=128|i>>>6&63,s[r++]=128|63&i);return s},buf2string:(t,s)=>{const i=s||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,s));let e,n;const r=new Array(2*i);for(n=0,e=0;e4)r[n++]=65533,e+=h-1;else{for(s&=2===h?31:3===h?15:7;h>1&&e1?r[n++]=65533:s<65536?r[n++]=s:(s-=65536,r[n++]=55296|s>>10&1023,r[n++]=56320|1023&s)}}return Gt(r,n)},utf8border:(t,s)=>{(s=s||t.length)>t.length&&(s=t.length);let i=s-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?s:i+jt[t[i]]>s?i:s}};var Wt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Jt=Object.prototype.toString,{Z_NO_FLUSH:Kt,Z_SYNC_FLUSH:Xt,Z_FULL_FLUSH:Yt,Z_FINISH:Qt,Z_OK:ts,Z_STREAM_END:ss,Z_DEFAULT_COMPRESSION:is,Z_DEFAULT_STRATEGY:es,Z_DEFLATED:ns}=j;function rs(t){this.options=Bt.assign({level:is,method:ns,chunkSize:16384,windowBits:15,memLevel:8,strategy:es},t||{});let s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wt,this.strm.avail_out=0;let i=Ht.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(i!==ts)throw new Error(q[i]);if(s.header&&Ht.deflateSetHeader(this.strm,s.header),s.dictionary){let t;if(t="string"==typeof s.dictionary?Zt.string2buf(s.dictionary):"[object ArrayBuffer]"===Jt.call(s.dictionary)?new Uint8Array(s.dictionary):s.dictionary,i=Ht.deflateSetDictionary(this.strm,t),i!==ts)throw new Error(q[i]);this._dict_set=!0}}function hs(t,s){return(s=s||{}).gzip=!0,function(t,s){const i=new rs(s=s||{});if(i.push(t,!0),i.err)throw i.msg||q[i.err];return i.result}(t,s)}return rs.prototype.push=function(t,s){const i=this.strm,e=this.options.chunkSize;let n,r;if(this.ended)return!1;for(r=s===~~s?s:!0===s?Qt:Kt,"string"==typeof t?i.input=Zt.string2buf(t):"[object ArrayBuffer]"===Jt.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(e),i.next_out=0,i.avail_out=e),(r===Xt||r===Yt)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(n=Ht.deflate(i,r),n===ss)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),n=Ht.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ts;if(0!==i.avail_out){if(r>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},rs.prototype.onData=function(t){this.chunks.push(t)},rs.prototype.onEnd=function(t){t===ts&&(this.result=Bt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},(t,s,i)=>{let e=hs(t);return e="base64"===s?btoa(Gt(e)):e.buffer,i&&i(e),e}}class $a extends ps{constructor(t){super(t),this.algorithm=ws.GZIP,this.Uy=Oa(),this.zy=(t,s,i)=>{i(this.Uy(t,s))},this.compress=xa();"undefined"!=typeof CompressionStream&&hi||(this.compress=this.zy,this.getCompressorSourceCode=()=>Oa.toString())}compressSync(t,s){return this.Uy(t,s)}getCompressorSourceCode(){return xa.toString()}}function xa(){return(t,s,i)=>{const e=new Response(t).body.pipeThrough(new CompressionStream("gzip")),n=new Response(e).arrayBuffer();"base64"!==s?n.then((t=>i(t))):n.then((t=>{return s=t,new Promise((t=>{const i=new FileReader;i.onload=s=>t(s.target.result.split(",")[1]),i.readAsDataURL(new Blob([s]))}));var s})).then((t=>i(t)))}}class La extends ps{constructor(){super(...arguments),this.algorithm=ws.UNCOMPRESSED}compress(t,s,i){i(this.compressSync(t,s))}compressSync(t,s){return t}getCompressorSourceCode(){return function(){return(t,s,i)=>i(t)}.toString()}}class Ma{static create(t,s=!0){return this.instance?this.instance:s&&!ka.isCompressionEnabled()?new La(t):this.instance=new $a(t)}}class Da{setItem(t,s){window.sessionStorage.setItem(t,s)}getItem(t){return window.sessionStorage.getItem(t)}removeItem(t){window.sessionStorage.removeItem(t)}}class Ua{setItem(t,s){window.localStorage.setItem(t,s)}getItem(t){return window.localStorage.getItem(t)}removeItem(t){window.localStorage.removeItem(t)}}const za=["visit",2],Ha=["page",3],Fa=["nextPageOnly",4];class Ba{constructor(t,s){this.M=t,this.Pp=s,this.Hy={},this.Fy={}}set(t,s,i,e){let n,r;if(t>0&&Pt(s)&&Pt(i)&&!bt(s)&&!bt(i)){const h=this.M.anonymizePII(csString(s)),o=this.M.anonymizePII(csString(i));if(n=[csString.prototype.slice.call(h,0,512),csString.prototype.slice.call(o,0,255)],r=""!==i,!It(e)||csArray.prototype.indexOf.call(za,e)>=0){const s=this.getCustomVariablesSession();r?s[t]=n:delete s[t],this.setCustomVariableSession(s)}(!It(e)||csArray.prototype.indexOf.call(Ha,e)>=0)&&(r?this.Hy[t]=n:delete this.Hy[t]),It(e)&&csArray.prototype.indexOf.call(Fa,e)>=0&&(r?this.Fy[t]=n:delete this.Fy[t])}}getCustomVariablesSession(){const t=this.Pp.get();if(!t)return{};const s=window.csJSON.parse(t);return null!==s&&Tt(s)?s:{}}setCustomVariableSession(t){this.Pp.set(window.csJSON.stringify(t))}removeCustomVariablesSession(){this.Pp.remove()}removeCustomVariablesPage(){this.Hy={}}getRequestParameters(){const t=this.getCustomVariablesSession();for(const t in this.Fy)this.Fy.hasOwnProperty(t)&&(this.Hy[t]=this.Fy[t]);for(const s in this.Hy)this.Hy.hasOwnProperty(s)&&(t[s]=this.Hy[s]);if(window.csJSON.stringify(t).length<=2)return{};const s={cvars:this.By(t)};return this.Hy&&window.csJSON.stringify(this.Hy).length>2&&(s.cvarp=this.By(this.Hy)),s}deleteNextPageOnlyCustomVariables(){if(Object.keys(this.Fy).length>0)for(const t in this.Fy)this.Fy[t]===this.Hy[t]&&(delete this.Hy[t],delete this.Fy[t])}By(t){for(const n in t)if(t.hasOwnProperty(n)){const r=parseInt(n,10),h=t[n],o=h[0],c=h[1];i=1,e=20,(!(Rt(s=r)&&s>=i&&s<=e)||o.length>512||c.length>255)&&delete t[n]}var s,i,e;const n=function(t){let s;for(s in t)return!1;return!0}(t)?[]:t;return window.csJSON.stringify(n)}}const qa=["setCustomVariable"];class ja{constructor(t,s){this.Ra=t,this.hs=s}init(){this.Ra.register(qa,((t,s,i,e)=>{this.hs.set(t,s,i,e)}))}onAfterArtificialPageView(){this.hs.deleteNextPageOnlyCustomVariables()}onAfterNaturalPageView(){this.hs.deleteNextPageOnlyCustomVariables()}onOptout(){this.hs.removeCustomVariablesSession()}onBeforeVisitorRenewal(){this.hs.removeCustomVariablesSession(),this.hs.removeCustomVariablesPage()}}class Ga{constructor(t){this.M=t}getUrlMaskingPattern(t){const s=[],i=csString.prototype.split.call(t,"/");for(const t of i)J(t,Ga.qy)?csArray.prototype.push.call(s,{key:t,value:`CS_ANONYMIZED_${csString.prototype.toUpperCase.call(csString.prototype.slice.call(t,1))}`}):csArray.prototype.push.call(s,{key:t,value:null});return s}anonymizeUrl(t,s){let i=this.M.anonymizePII(t);return i=this.M.anonymizeJwt(i),s.length>0?this.jy(i,s):i}removeQueryString(t){const{path:s,queryString:i}=this.Gy(t);return""!==i?`${s}?`:s}Gy(t){const s=csString.prototype.indexOf.call(t,"?");let i="",e="";return-1!==s?(i=csString.prototype.slice.call(t,0,s),e=csString.prototype.slice.call(t,s,t.length)):i=t,{path:i,queryString:e}}jy(t,s){const{path:i,queryString:e}=this.Gy(t),n=csString.prototype.split.call(i,"/");for(const t of s){const s=this.Zy(n,t);if(null!==s)return`${s}${e}`}return t}Zy(t,s){if(t.length=s.length)i+=`${t[e]}/`;else if(J(s[e].key,Ga.qy))i+=`${s[e].value}/`;else{if(t[e]!==s[e].key)return null;i+=`${t[e]}/`}return csString.prototype.slice.call(i,0,-1)}}Ga.qy=":";class Za{constructor(t,s){this.Tu=t,this.L=s}getEventTargetPath(t){const s=ni(t);return this.Tu.getElementPath(s,{dynamicIdRegex:this.L.dynamicIdRegex,...this.L.pathComputationRules})}getEventTargetPathAndTargetLink(t){const s=ni(t),{path:i,firstAnchorParent:e}=this.Tu.getElementPathAndFirstAnchorParent(s,{dynamicIdRegex:this.L.dynamicIdRegex,...this.L.pathComputationRules});return{path:i,targetLink:this.Wy(e)?e.href:""}}hasValidEventTarget(t){const s=ni(t);return this.Tu.isValidElement(s)}getElementPath(t){return this.Tu.getElementPath(t,{dynamicIdRegex:this.L.dynamicIdRegex,...this.L.pathComputationRules})}Wy(t){var s;return null!==t&&t.hasAttribute("href")&&!J(null!==(s=t.getAttribute("href"))&&void 0!==s?s:"","#")}}class Wa{constructor(t){this.pl=t}transformEvent(t,s){const i=this.Jy(t,s),e=this.pl.getElementPath(t);return this.Ky(e,i)}Jy(t,s){if(function(t){return void 0!==t.x&&void 0!==t.y}(s)){const i=t.getBoundingClientRect();s.x=Math.round(i.left+s.x+Yi.windowOffsetX()),s.y=Math.round(i.top+s.y+Yi.windowOffsetY())}return s}Ky(t,s){return nh(s)&&(s.tgt=`${t}${Va}${s.tgt}`),function(t){return void 0!==t.tgtHM}(s)&&(s.tgtHM=`${t}${Va}${s.tgtHM}`),function(t){return void 0!==t.tgtLk}(s)&&(s.tgtLk=`${t}${Va}${s.tgtLk}`),s}}class Ja{constructor(t){this.pl=t}transformEvent(t,s){const i=this.pl.getElementPath(t);return{iframePath:s.iframePath?`${i}${Va}${s.iframePath}`:i,commands:s.commands}}}class Ka{constructor(t){this.pl=t}transformEvent(t,s){if(0===s.products.length)return s;const i=this.pl.getElementPath(t),e=csArray.prototype.map.call(s.products,(t=>({...t,targetPath:`${i}${Va}${t.targetPath}`})));return{...s,products:e}}}class Xa{constructor(){this.Xy={clientX:2,clientY:3},this.Yy={clientX:1,clientY:2},this.Qy=[Bs.POINTER_DOWN,Bs.POINTER_MOVE,Bs.POINTER_UP],this.tA=[Bs.TOUCH_START,Bs.TOUCH_MOVE,Bs.TOUCH_END]}transformEvents(t,s){if(!Fe.isConnected(t))return s.events=csArray.prototype.filter.call(s.events,(t=>t.type!==Bs.VISIBILITY_CHANGE)),0===s.events.length||(ts.warn(`IframeRecordingEventsTransformer received event ${Jt.RecordingEvent}\n from disconnected iframe, content:${csJSON.stringify(s.events)}`),s.events=[]),s;const i=yi(t);if(!i)return ts.error(`IframeRecordingEventsTransformer received event ${Jt.RecordingEvent}\n from unidentified iframe, content:${csJSON.stringify(s.events)}`),s.events=[],s;let e=null;csArray.prototype.some.call(s.events,(t=>this.sA(t)||this.iA(t)))&&(e=t.getBoundingClientRect());for(const t of s.events)this.sA(t)?this.eA(e,t):this.iA(t)&&this.nA(e,t),t.context=t.context&&t.context.length>0?`${i}/${t.context}`:`${i}`;return s}nA(t,s){this.rA(this.Yy,t,s)}eA(t,s){this.rA(this.Xy,t,s)}rA(t,s,i){i.args&&(i.args[t.clientX]=Math.round(s.left+i.args[t.clientX]),i.args[t.clientY]=Math.round(s.top+i.args[t.clientY]))}sA(t){return-1!==csArray.prototype.indexOf.call(this.Qy,t.type)}iA(t){return-1!==csArray.prototype.indexOf.call(this.tA,t.type)}}class Ya{constructor(t){this.hA=t}start(){this.hA.onEvent((t=>this.kn(t))),this.hA.start()}stop(){this.hA.stop()}kn(t){const s=`Content Security Policy error. Violated directive: ${t.violatedDirective} - Source file: ${t.sourceFile}`;ts.warn(s)}}class Qa{constructor(){this.Ui={boundElement:document,type:"securitypolicyviolation",listener:t=>this.securityPolicyViolationListener(t)}}start(){Zs(this.Ui)}stop(){Ws(this.Ui)}onEvent(t){this.yi=t}oA(t){if(!t)return!1;const s=t.disposition;return St(t.sourceFile)&&csArray.prototype.some.call(Qa.cA,(s=>csString.prototype.indexOf.call(t.sourceFile,s)>0))&&"report"!==s}securityPolicyViolationListener(t){this.oA(t)&&this.yi({violatedDirective:t.violatedDirective,sourceFile:t.sourceFile})}}Qa.cA=["contentsquare","cdnssl.clicktale.net"],es([is("Event handler type: securitypolicyviolation")],Qa.prototype,"securityPolicyViolationListener",null);class tu{init(){this.aA=new Ya(new Qa),this.aA.start()}onOptout(){this.aA.stop()}}class su{constructor(t,s,i,e){this.L=t,this.st=s,this.D=i,this.th=e}init(){let t,s,i,e,n,r,h,o,c,a,u,l,d,f,w,p,m,y,A,g,E,v,_,R,S,T,I,P,b,V,C,N,k,O,$;yr.isSupported()&&yr.setDigestSalt(this.L.projectId.toString()),this.th.schedule((()=>{t=new zc(this.th),s=new wt,i=new Ga(s),n=new Ia(window.location,i),e=new cs(this.L,n,this.st),e.init()})),this.th.schedule((()=>{r=new Da,h=new Ua,A=new ra(window.location,e);(new tu).init(),g=Ma.create(ts.warn),y=new ys(g);const s=y.create(`${this.L.getQuotaServiceUri()}/quota`,!0);u=new ba(this.L,s,t,A,n),u.init()})),this.th.schedule((()=>{o=new Ns(this.L,e,r),a=new Lc(o,u)})),this.th.schedule((()=>{l=new vs(this.L,e,r),d=new $c(this.L,l,a,t),this.D.setContext(d,a),u.setVisitorService(d)})),this.th.schedule((()=>{$=new Kc(this.L,new Bc(this.L,e,h),t),f=new Dc(d,a,$),w=new xs(this.L,e,r),p=new Yc(window.location,w),m=new Qc(p),v=new Mc(this.L,d,p),k=new Za(G,this.L),P=new Wa(k),b=new Ja(k),V=new Ka(k),C=new Xa,N=new Ca(P,b,V,C),I=new ya([ma.UXA]),_=new pa(I,N),R=new sa(n),S=new ea(R,I);const i=new Ms(this.L,e,r);O=new Ba(s,i),T=new ja(I,O);const u=new As(d,a,p,O,this.L);{const t=new zs,s=new Us(t,window.location);this.L.crossDomainSingleIframeTracking||(E=new wa(this.L,u,s));{c=new Ea(this.L,e,o,l,w,i),c.init();const s=new va(this.L,t);c.setStates(u,s)}}})),this.th.schedule((()=>{new kc(this.L,d,p,v,f,E,c,A).compute((r=>{this.th.schedule((()=>{_.init();const o=new Pa,c=new Jc(this.L,I,$,a,t),u=new oa(this.L,e,h),l=new ca(t,window.location,u),f=new la(I,l),w=new Ra(I,this.L);const p=new _a(this.L,d,a,undefined);if(r){new Nc(p,g,d,a,t,I,_,this.L,f,l,c,$,s,k,i,n,w,o,N,O,T,R,S,this.th,y,undefined).start()}else{new Xc(t,I,_,f,l,m,c).start()}}))}))}))}}var iu,eu;!function(t){const s="{domain}/tag/bridge.html?v={version}#{token}";let i;const e={loadBundle(t){const o=t.source,c=t.data;if(r(c)){const r=()=>{!function(t,s){const i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=t,i.onload=s,i.charset="utf-8",document.head.appendChild(i)}(n("{domain}/tag/tag.bundle.js?v={version}",c),(()=>o.postMessage("csBundleLoaded",t.origin)))};i=c.token,u(e.loadBundle),h(t.origin)?r():function(t,i){const e=n(s,t),r=function(t){const s=document.createElement("iframe");return s.src=t,s.id="content-square-bridge",s.setAttribute("style","display: none !important; visibility: hidden !important;"),s}(e),h=t=>{t.source===r.contentWindow&&"TOKEN_VALID"===t.data&&(u(h),r.remove(),i())};a(h),document.head.appendChild(r)}(c,r)}}};function n(t,s){return csString.prototype.replace.call(csString.prototype.replace.call(csString.prototype.replace.call(t,"{version}",s.version),"{token}",s.token),"{domain}",s.domain)}function r(t){return t&&"csBundleInjection"===t.type&&h(t.domain)&&c(t.version)&&o(t.token)}function h(t){return/^https?:\/\/[a-zA-Z0-9\.\-]+\.(content-square\.fr|contentsquare\.com|csq\.io)$/.test(t)}function o(t){return/^[a-zA-Z0-9]+$/.test(t)}function c(t){return/^[a-zA-Z0-9\.]+$/.test(t)}function a(t){window.addEventListener("message",t,!1)}function u(t){window.removeEventListener("message",t,!1)}t.getToken=function(){return i},t.isAuthorizedIncomingMessage=r,t.isAuthorizedDomain=h,t.isAuthorizedToken=o,t.isAuthorizedTagVersion=c,t.isActivable=function(){const t=window.opener||window.parent;return window!==t&&window.addEventListener},t.waitForBundleInjection=function(){a(e.loadBundle)},t.listen=a,t.removeListener=u}(iu||(iu={})),function(t){const s=window.opener||window.parent,i=[/^https:\/\/app\.contentsquare\.com$/,/^https:\/\/dev-app\.contentsquare\.com$/,/^https:\/\/staging-app\.contentsquare\.com$/,/^https:\/\/.*\.test\.contentsquare\.com$/,/^https:\/\/app\.[a-z0-9-]+\.csiab\.[a-z0-9-]+\.csq\.io$/];let e;const n={ping(t){"ping"===t.data&&r(t.origin)&&(e=t.origin,c(n.ping),o(n.insertMessageScript),h(`${"utils.js"}?cb=${(new csDate).getTime()}`))},insertMessageScript:a((t=>{const s=t.data;"string"==typeof s&&"ping"!==s&&(c(n.insertMessageScript),h(s))}))};function r(t){return csArray.prototype.some.call(i,(s=>s.test(t)))}function h(t,s){const i=document.createElement("script");i.type="text/javascript",i.async=!0;const n=csString.prototype.replace.call(e,/^https?:/,"");i.src=`${n}/tag/${t}`,i.onload=s,i.charset="utf-8",document.getElementsByTagName("head")[0].appendChild(i)}function o(t){window.addEventListener("message",t,!1)}function c(t){window.removeEventListener("message",t,!1)}function a(t){return function(s){s.origin===e&&t(s)}}t.getToken=function(){return iu.getToken()},t.isActivable=function(){return window!==s&&window.addEventListener},t.isAuthorizedDomain=r,t.waitForConnection=function(){o(n.ping),iu.waitForBundleInjection()},t.listen=o,t.removeListener=c,t.secureListener=a,t.post=function(t){e&&s.postMessage(t,e)}}(eu||(eu={}));const nu=window.CSFrameCommunication||eu;class ru extends Uc{emitTrackingContextResultMessage(t){for(const s of this.listeners)s.onTrackingContextResultCallback&&s.onTrackingContextResultCallback(t)}emitAfterPageViewCallback(t){for(const s of this.listeners)s.onAfterPageViewCallback&&s.onAfterPageViewCallback(t)}emitIntegrationSessionKeyCallback(t){for(const s of this.listeners)s.onIntegrationSessionKeyCallback&&s.onIntegrationSessionKeyCallback(t)}emitParentRecordingStatusChange(t){for(const s of this.listeners)s.onParentRecordingStatusChange&&s.onParentRecordingStatusChange(t)}emitStartAnalytics(){for(const t of this.listeners)t.onStartAnalytics&&t.onStartAnalytics()}emitStopAnalytics(){for(const t of this.listeners)t.onStopAnalytics&&t.onStopAnalytics()}emitStartRecording(){for(const t of this.listeners)t.onStartRecording&&t.onStartRecording()}emitStopRecording(){for(const t of this.listeners)t.onStopRecording&&t.onStopRecording()}}const hu=["trackTransaction"];class ou{constructor(t){this.uA=t}init(){this.uA.register(qr),this.uA.register(qa),this.uA.register(Io),this.uA.register(Po),this.uA.register(To),this.uA.register(Kr),this.uA.register(Xr),this.uA.register(Yr),this.uA.register(Qr),this.uA.register(hu),this.uA.register(xo),this.uA.register(Lo),this.uA.register(aa),this.uA.register(ua),this.uA.register(Do),this.uA.register(Zo),this.uA.register(Wo),this.uA.register(Sr),this.uA.register(jc),this.uA.register(Gc),this.uA.register(Zc),this.uA.register(Wc)}onStartTracking(){this.uA.start()}onOptout(){this.uA.stop()}}class cu extends Zi{constructor(t,s){super(),this.Ra=t,this.lA=s,this.lu=[]}onStart(){this.commandsBatchReady()}onStop(){this.lu=[]}register(t){for(const s of t)this.Ra.register([s],((...t)=>this.send(s,t)))}send(t,s){csArray.prototype.push.call(this.lu,{name:t,params:s}),this.isStarted&&this.commandsBatchReady()}commandsBatchReady(){if(0===this.lu.length)return;const t={commands:this.lu};this.lA.sendToParent(Jt.Commands,t),this.lu=[]}}es([is("Commands.iframe.commandsBatch.send")],cu.prototype,"send",null),es([hr(),is("send iframe commands batch")],cu.prototype,"commandsBatchReady",null);class au{constructor(t=25){this.dA=t,this.fA=[]}reset(){this.fA=[]}getMessages(){return this.fA}addMessage(t){this.fA.lengththis.jd(t)}}onStart(){Zs(this.AA,!1),this.gA()}onStop(){Ws(this.AA,!1),this.yA&&(Kt.closeChannelPort(this.yA),this.yA=null)}sendToParent(t,s){const i=this.buildChildBaseMessage(t,s);this.Um(i)}gA(){const t=this.buildChildBaseMessage(Jt.Discovery);Kt.sendPostMessage(window.parent,"*",t)}buildChildBaseMessage(t,s){const i=Kt.buildBaseMessage(t,Wt.Child,this.L.projectId);return s&&(i.content=s),i}Um(t){null!==this.yA?Kt.sendChannelMessage(this.yA,t):this.buffer.addMessage(t)}EA(t,s){const i=Kt.getNewChannelMessage();this.yA=i.port1,this.yA.onmessage=t=>{this.af(t)};const e=this.buildChildBaseMessage(Jt.Discovery);e.id=s,Kt.sendPostMessage(window.parent,t,e,[i.port2]),this.sendAllMessagesFromBuffer()}af(t){switch(t.data.type){case Jt.TrackingContextResultMessage:this.mA.emitTrackingContextResultMessage(t.data.content);break;case Jt.IntegrationCallback:{const s=t.data.content;s.initiator===Zt.AfterPageView?this.mA.emitAfterPageViewCallback(s):s.initiator===Zt.GetSessionKey?this.mA.emitIntegrationSessionKeyCallback(s):ts.warn(`Iframe child received unknown IntegrationCallback type from parent : ${csJSON.stringify(t.data)}`);break}case Jt.Stop:this.ui.emitOptout();break;case Jt.RecordingStatus:{const s=t.data.content;this.pA.setRecordingStatus(s),this.mA.emitParentRecordingStatusChange(s);break}default:ts.warn(`Iframe child received unknown channelMessage type from parent : ${csJSON.stringify(t.data)}`)}}jd(t){if(null===this.yA&&Kt.isMessageValid(t,Wt.Parent,this.L.projectId,this.L.hostnames))switch(t.data.type){case Jt.Stop:this.ui.emitOptout();break;case Jt.Discovery:if(!Rt(t.data.id)||t.data.id<0)return void ts.warn(`Iframe child received discovery without valid id from parent (${t.origin}) : ${csJSON.stringify(t.data)}`);this.EA(t.origin,t.data.id);break;default:ts.warn(`Iframe child received unknown postMessage type from parent (${t.origin}) : ${csJSON.stringify(t.data)}`)}}sendAllMessagesFromBuffer(){if(null===this.yA)return;const t=this.buffer.getMessages();for(const s of t)Kt.sendChannelMessage(this.yA,s);this.vA(),this.buffer.reset()}vA(){const t=Kt.buildBaseMessage(Jt.EndOfBufferedMessages,Wt.Child,this.L.projectId);Kt.sendChannelMessage(this.yA,t)}}class du{constructor(t){this.lA=t}onStartTracking(){this.lA.start()}onOptout(){this.lA.stop()}}class fu{constructor(t,s,i,e){this.Qa=t,this.iu=s,this.lA=i,this.pA=e}init(){this.Qa.onChildMessage(((t,s,i)=>this.iu.emitIframeEvent(t,s,i))),this.Qa.setRecordingStatusCallback((()=>this.pA.getRecordingStatus()))}onStartTracking(){this.Qa.start()}onOptout(){this.Qa.stop()}onIframeRecordingUserEvent(t){const s={events:t,containsUserEvent:!0};this.lA.sendToParent(Jt.RecordingEvent,s)}onIframeRecordingBrowserEvent(t){const s={events:t,containsUserEvent:!1};this.lA.sendToParent(Jt.RecordingEvent,s)}onIframeAnalysisEvent(t){this.lA.sendToParent(Jt.AnalysisEvent,t)}onIframeJavascriptError(t){this.lA.sendToParent(Jt.JavascriptError,t)}onIframeApiError(t){this.lA.sendToParent(Jt.ApiError,t)}onIframeDetailedApiError(t){this.lA.sendToParent(Jt.DetailedApiError,t)}onIframeEmerchandisingMessage(t){this.lA.sendToParent(Jt.EmerchandisingMessage,t)}onIframeCommands(t){this.lA.sendToParent(Jt.Commands,t)}onIframeIntegrationCallback(t){this.lA.sendToParent(Jt.IntegrationCallback,t)}onTrackingContextRequestCallback(t){this.lA.sendToParent(Jt.TrackingContextRequestMessage,t)}onIframeStaticResource(t){this.lA.sendToParent(Jt.StaticResource,t)}onIframeCustomError(t){this.lA.sendToParent(Jt.CustomError,t)}onTrackingContextResultCallback(t){this.Qa.sendToChildren(Jt.TrackingContextResultMessage,t)}onAfterPageViewCallback(t){this.Qa.sendToChildren(Jt.IntegrationCallback,t)}onIntegrationSessionKeyCallback(t){this.Qa.sendToChildren(Jt.IntegrationCallback,t)}onParentRecordingStatusChange(t){this.Qa.sendToChildren(Jt.RecordingStatus,t)}}class wu extends Zi{constructor(t,s,i,e,n,r,h,o){super(),this.cl=t,this.Sh=s,this.lA=i,this.Al=e,this.gl=n,this.vl=r,this._l=h,this.Rl=o}init(){var t,s,i,e,n;this.cl.onEvent((t=>this.kn(t))),this.Sh.onEvent((t=>this.kn(t))),null===(t=this.Al)||void 0===t||t.onEvent((t=>this.kn(t))),null===(s=this.gl)||void 0===s||s.onEvent((t=>this.kn(t))),null===(i=this.vl)||void 0===i||i.onEvent((t=>this.kn(t))),null===(e=this._l)||void 0===e||e.onEvent((t=>this.kn(t))),null===(n=this.Rl)||void 0===n||n.onEvent((t=>this.kn(t)))}onStart(){var t,s,i,e,n;this.cl.start(),this.Sh.start(),null===(t=this.Al)||void 0===t||t.start(),null===(s=this.gl)||void 0===s||s.start(),null===(i=this.vl)||void 0===i||i.start(),null===(e=this._l)||void 0===e||e.start(),null===(n=this.Rl)||void 0===n||n.start()}onStop(){var t,s,i,e,n;this.cl.stop(),this.Sh.stop(),null===(t=this.Al)||void 0===t||t.stop(),null===(s=this.gl)||void 0===s||s.stop(),null===(i=this.vl)||void 0===i||i.stop(),null===(e=this._l)||void 0===e||e.stop(),null===(n=this.Rl)||void 0===n||n.stop()}kn(t){this.isStarted&&t.type!==ih.RESIZE&&this.lA.sendToParent(Jt.AnalysisEvent,t)}}const pu=["webview:analytics:start"],mu=["webview:analytics:stop"];class yu{constructor(t,s,i,e,n,r,h,o){this.L=t,this.pl=s,this.Ou=i,this.lA=e,this.At=n,this._A=r,this.Ra=h,this.Sh=o}init(){const t=new dh(this.L,this.pl,this.Ou),s=this.At.isInWebViewContext()?{collectGestureVelocity:!0,collectGestureDistance:!0}:{collectGestureVelocity:!1,collectGestureDistance:!1},i=new ch(this.L,this.pl,this.Sh,s);this.RA=new wu(t,i,this.lA,undefined,undefined,undefined,undefined,undefined),this.RA.init(),this.At.isInWebViewContext()&&this.SA()}onStartTracking(){this.RA.start()}onOptout(){this.RA.stop()}onStartAnalytics(){this.RA.start()}onStopAnalytics(){this.RA.stop()}SA(){this.Ra.register(pu,(()=>this._A.emitStartAnalytics()),{disableApplyPending:!0}),this.Ra.register(mu,(()=>{this._A.emitStopRecording(),this._A.emitStopAnalytics()}),{disableApplyPending:!0})}}class Au extends Zi{constructor(t,s,i,e,n,r,h,o,c,a=[]){super(),this.L=t,this.We=s,this.Je=i,this.Ke=e,this.Xe=n,this.Ye=r,this.hn=h,this.lA=o,this.un=c,this.Ee=a,this.TA=!1,this.mn=new Gi,this.yn=!1,this.je=[],this.IA=!1,this.En=t=>this.Tl(t),this.vn=t=>this._n(t),this.ge=new Ki([new Oe(csArray.prototype.filter.call([this.Je,...this.Ee],(t=>t))),new Le,new ue]),this.$n=new ke(this.ge),this.$n.onEvent(this.En)}init(){this.xn()}xn(){var t,s;this.Je.onEvent(this.En),this.Ke.onEvent(this.vn),this.Xe.onEvent(this.vn),this.Ye.onEvent(this.vn),null===(t=this.hn)||void 0===t||t.onTextNodeToEncrypt(this.En),null===(s=this.un)||void 0===s||s.onEvent(this.En)}blockSendingEventsFromSerialization(){this.yn=!1}allowSendingEventsFromSerialization(){this.yn=!0}activateOnlineAssetsOnNextStart(){this.TA=!0}getStaticResourceManagerStatus(){return this.un?{supported:this.un.isSupported(),onlineAssets:{activated:this.un.isOnlineAssetsActivated(),enableOnNextStart:this.TA}}:null}Tl(t){this.PA(t),this.bA()}_n(t){this.VA(t),this.bA()}VA(t){csArray.prototype.push.call(this.je,t),this.IA=!0}PA(t){csArray.prototype.push.call(this.je,t)}bA(){if(!this.yn)return;Vi(this.Ee,(t=>{var s;return null===(s=t.flushEvents)||void 0===s?void 0:s.call(t)}));const t={containsUserEvent:this.IA,events:this.je};this.lA.sendToParent(Jt.RecordingEvent,t),this.je=[],this.IA=!1}onStart(){var t;Ve.start(),this.un&&this.TA&&(this.un.enableOnlineAssets(),this.TA=!1),this.We.start(),this.$n.start(),this.Je.start(),this.Ye.start(),null===(t=this.un)||void 0===t||t.start(),this.Xe.start(),this.L.emitDebugEvents&&this.mn.emit("replayRecordingStarted")}onStop(){var t;Ve.stop(),this.We.stop(),this.$n.stop(),this.Je.stop(),this.Ke.stop(),this.Xe.stop(),this.Ye.stop(),null===(t=this.un)||void 0===t||t.stop()}addInitialDom(t){for(let s=0;s=t.date)return csArray.prototype.splice.call(this.je,s,0,t),this.IA=!0,void this.bA()}this.VA(t),this.bA()}}class gu{constructor(t){this.L=t}isReplayUnanonymizedAllowedByConsent(){return!this.L.consentRequired}}class Eu{static isWebViewLocalAssetsSupported(){return"URL"in window}}const vu=["webview:replay:start"],_u=["webview:replay:stop"];class Ru{constructor(t,s,i,e,n,r,h,o){this.L=t,this.li=s,this._A=i,this.Ar=e,this.CA=n,this.NA=r,this.Ra=h,this.tt=o,this.kA=!1}init(){const t=new gu(this.L),s=new cr;this.Ia=new sa(this.tt);if(new ea(this.Ia,this.Ra).init(),this.Oa=new Wn(t,this.L,this.tt,s),this.Oa.init(),Eu.isWebViewLocalAssetsSupported()){const t=t=>{this.OA(t)},s=t=>ts.error("An error occurred while fetching a styleSheet: "+t),i=new Set,e=t=>!i.has(t),n=t=>{i.add(t.assetId),this.OA([t])};this.Ar.onAsset((t=>{this.$A(t)})),this.Ar.onStyleSheetFound((i=>{this.NA.getStyleSheetAssets(i.assetId,t,s,e,n)}))}this.xA()}onStartRecording(){this.kA=!0,this.Ia.isUrlExcludedForSessionReplay()||this._A.emitParentRecordingStatusChange({isRecording:!0,isMutationTrackerStarted:!0,PIISelectors:this.li.getPIISelectors(),capturedElementSelector:Ve.getWhitelistedElementsSelector(),useAnonymization:this.Oa.shouldUseAnonymization()})}onStopRecording(){this.kA=!1,this._A.emitParentRecordingStatusChange({isRecording:!1,isMutationTrackerStarted:!1})}onArtificialPageViewEnd(){this._A.emitParentRecordingStatusChange({isRecording:!1})}onAfterArtificialPageView(){this.ve()&&!this.Ia.isUrlExcludedForSessionReplay()&&this._A.emitParentRecordingStatusChange({isRecording:!0})}ve(){return this.kA}xA(){this.Ra.register(vu,(()=>{this._A.emitStartAnalytics(),this._A.emitStartRecording()}),{disableApplyPending:!0}),this.Ra.register(_u,(()=>this._A.emitStopRecording()),{disableApplyPending:!0})}$A(t){this.CA.sendToParent(Jt.Assets,{assets:[t]})}OA(t){0!==t.length&&this.CA.sendToParent(Jt.Assets,{assets:t})}}class Su{constructor(t){this.LA=t}getStyleSheetAssets(t,s,i,e,n){const r=[];if(!mn(t))return;this.LA.getResourceContentText(t,((t,h)=>{const o=this.jr(t,h);csArray.prototype.forEach.call(o,(t=>{csArray.prototype.push.call(r,t),mn(t.assetId)&&e(t.assetId)&&(null==n||n(t),this.getStyleSheetAssets(t.assetId,s,i,e,n))})),s(r)}),(t=>i(t)))}jr(t,s){return this.MA(t,er(s))}MA(t,s){return csArray.prototype.map.call(csArray.prototype.filter.call(csArray.prototype.filter.call(s,(t=>!wn(t))),(t=>!pn(t))),(s=>({assetId:Ht(s,t),assetBasePath:t,assetRawPath:s})))}}class Tu{getResourceContentText(t,s,i){const e=this.DA((i=>{s(t,i.responseText)}),i);e.open("GET",t),e.send()}DA(t,s){const i=new XMLHttpRequest;return i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(200===i.status?t(i):s(i.statusText))},i}}class Iu extends Zi{constructor(t,s){super(),this.un=t,this.lA=s}onStart(){this.un.start()}onStop(){this.un.stop()}init(){this.un.isStaticResourceManagerSupported()&&this.un.sendStaticResource((t=>this.lA.sendToParent(Jt.StaticResource,t)))}}class Pu{constructor(t,s,i,e,n,r,h,o,c,a,u,l){this.L=t,this.M=s,this.li=i,this.Sh=e,this.ui=n,this.lA=r,this.pA=h,this.Ra=o,this.mA=c,this.At=a,this.th=u,this.tt=l}init(){const t=[],s=new Je;this.Na=new cn(this.M,this.L),this.Na.init();const i=new En;csArray.prototype.push.call(t,i);const e=new _n(this.th),n=[new Bn,s,this.Na];let r=null;!this.At.isInWebViewContext()&&this.L.useStaticResourceManager&&(this.un=new Ar,this.un.init(),csArray.prototype.push.call(t,this.un),this.un.isStaticResourceManagerSupported()&&(r=new nr(this.un),csArray.prototype.push.call(n,r),this.UA=new Iu(this.un,this.lA),this.UA.init()));const h=new gr(this.hn);csArray.prototype.push.call(n,h);const o=new Kn,c=new qn(o);let a;if(c.init(),csArray.prototype.push.call(t,c),c.isAdoptedStyleSheetsSupported()&&csArray.prototype.push.call(n,c),this.ka()){const t=new Mn;a=new Hn(n,t)}else a=new Fn(n);if(this.ci=new je(a,this.Na,this.hn),this.Ke=new Ri,this.Ke.init(),this.Je=new Fi(this.ci,e,this.ui,this.li),csArray.prototype.push.call(t,new Ze(i,o)),csArray.prototype.push.call(t,new un(window.location,this.M)),this.zA=new Au(this.L,o,this.Je,this.Ke,h,new In(this.Sh),this.hn,this.lA,this.un,t),this.Ra.register(Rr,(()=>this.pA.getRecordingStatus().isRecording)),this.Ra.register(vr,(t=>{Ve.setWhitelistedElementsSelector(t)})),this.Ra.register(_r,(t=>{this.li.setPIISelectors(t)})),this.Ra.register(Tr,(()=>this.zA.getStaticResourceManagerStatus())),e.init(),this.zA.init(),this.At.isInWebViewContext()){const t=new Su(new Tu);this.HA=new Ru(this.L,this.li,this.mA,i,this.lA,t,this.Ra,this.tt),this.mA.addListener(this.HA),this.ui.addListener(this.HA),this.HA.init()}}onParentRecordingStatusChange(t){var s,i;t.PIISelectors&&this.li.setPIISelectors(t.PIISelectors),t.capturedElementSelector&&Ve.setWhitelistedElementsSelector(t.capturedElementSelector),void 0!==t.useAnonymization&&this.ci.setAnonymization(t.useAnonymization),t.encryptionSelectors&&this.hn.setEncryptionSelectors(t.encryptionSelectors),t.activateOnlineAssetsOnNextStart&&this.zA.activateOnlineAssetsOnNextStart(),t.isRecording?(this.zA.start(),null===(s=this.UA)||void 0===s||s.start()):(this.zA.stop(),null===(i=this.UA)||void 0===i||i.stop()),t.isMutationTrackerStarted?this.Je.start():this.Je.stop()}onInitialDomStart(){this.zA.blockSendingEventsFromSerialization()}onInitialDomDone(t){this.Ke.start(),this.zA.allowSendingEventsFromSerialization(),this.zA.addInitialDom(t)}ka(){return Jn.isAsyncSerializationSupported()&&this.L.asyncSerializerEnabled}Ma(){return!!this.L.encryptionPublicKey&&this.L.encryptionPublicKeyId>0&&yr.isSupported()}onOptout(){this.zA.stop()}}class bu{constructor(t,s){this.CA=t,this.FA=s}init(){this.CA.onWebViewEvent(((t,s)=>{this.FA.emitWebviewEventToBridge(t,s)}))}onStartTracking(){this.CA.start()}onOptout(){this.CA.stop()}onStartAnalytics(){this.CA.setAnalyticsStatus(!0)}onStopAnalytics(){this.CA.setAnalyticsStatus(!1)}onParentRecordingStatusChange(t){this.FA.setSessionReplayStatus(t.isRecording)}}var Vu,Cu;!function(t){t[t.PAGE_VIEW=4]="PAGE_VIEW",t[t.TAP=6]="TAP",t[t.LONG_PRESS=8]="LONG_PRESS",t[t.DRAG=9]="DRAG",t[t.FLICK=10]="FLICK",t[t.DETAILED_API_ERROR=13]="DETAILED_API_ERROR",t[t.JAVASCRIPT_ERROR_SR=19]="JAVASCRIPT_ERROR_SR",t[t.CUSTOM_ERROR_SR=20]="CUSTOM_ERROR_SR",t[t.API_ERROR=21]="API_ERROR",t[t.CUSTOM_ERROR_AN=25]="CUSTOM_ERROR_AN",t[t.JAVASCRIPT_ERROR_AN=26]="JAVASCRIPT_ERROR_AN"}(Vu||(Vu={}));class Nu{constructor(){this.BA=1}transformEvent(t){switch(t.type){case ih.TAP:return{version:this.BA,type:Vu.TAP,data:{path:t.tgt}};case ih.DRAG:{const s=t;return{version:this.BA,type:Vu.DRAG,data:{path:s.tgt,direction:s.fd,distance:s.distance,velocity:s.velocity}}}case ih.FLICK:{const s=t;return{version:this.BA,type:Vu.FLICK,data:{path:s.tgt,direction:s.fd,distance:s.distance,velocity:s.velocity}}}default:return null}}}class ku{constructor(t,s,i,e){this.tt=t,this.en=s,this.rn=i,this.M=e,this.BA=1}transformEvent(t,s){switch(t){case Jt.ApiError:case Jt.DetailedApiError:{const t=this.rn.anonymize(s);return{version:this.BA,data:t}}case Jt.JavascriptError:{const t={...s,pageUrl:this.tt.getAnonymizedUrl()},i=this.en.anonymize(t);return{version:this.BA,data:{...i,date:yt.now()}}}case Jt.CustomError:{const t=s;return t.message=this.M.anonymizePII(t.message),{version:this.BA,data:{...t,date:yt.now()}}}default:return null}}}!function(t){const s=5,i=30,e=30;t.buildCustomErrorEvent=function(t,n,r=!1){const h={message:Xo.truncateStringWithEllipsis(t,300),errorType:"customError"};return(r||function(t){const i=Object.keys(t).length;return i>0&&i<=s}(n))&&(!function(t){for(const s in t){let n=t[s];if(t[s].length>e&&(n=Xo.truncateStringWithEllipsis(t[s],e),t[s]=n),s.length>i){const e=Xo.truncateStringWithEllipsis(s,i);delete t[s],t[e]=n}}}(n),h.attributes=n),h}}(Cu||(Cu={}));var Ou;!function(t){t.isCSJavascriptBridgeDefined=function(){return"object"==typeof window.CSJavascriptBridge&&"function"==typeof window.CSJavascriptBridge.optIn&&"function"==typeof window.CSJavascriptBridge.optOut&&"function"==typeof window.CSJavascriptBridge.sendEvent&&"function"==typeof window.CSJavascriptBridge.sendDynamicVar&&"function"==typeof window.CSJavascriptBridge.sendTransaction},t.getBridgeVersion=function(){if("function"==typeof window.CSJavascriptBridge.getVersion)try{const t=window.CSJavascriptBridge.getVersion();if(_t(t))return t}catch(t){ts.warn("an error occurred when calling getVersion")}return null},t.notifyIsReadyForTracking=function(){"function"==typeof window.CSJavascriptBridge.onWebviewTrackingReady&&window.CSJavascriptBridge.onWebviewTrackingReady()},t.sendAnalysisEvent=function(t){window.CSJavascriptBridge.sendEvent(csJSON.stringify(t))},t.sendSREvent=function(t){if(window.CSJavascriptBridge.sendSREvent)for(const s of t.events)window.CSJavascriptBridge.sendSREvent(csJSON.stringify(s))},t.sendLog=function(t){window.CSJavascriptBridge&&window.CSJavascriptBridge.sendLog&&window.CSJavascriptBridge.sendLog(csJSON.stringify(t))},t.sendOptIn=function(){window.CSJavascriptBridge.optIn()},t.sendOptOut=function(){window.CSJavascriptBridge.optOut()},t.sendDynamicVariable=function(t,s){window.CSJavascriptBridge.sendDynamicVar(t,s)},t.sendTransaction=function(t,s,i){window.CSJavascriptBridge.sendTransaction(t,s,i)},t.sendAssets=function(t,s){if(window.CSJavascriptBridge.sendAssets){const i=csJSON.stringify(t);window.CSJavascriptBridge.sendAssets(i,s||null)}else window.CSJavascriptBridge.sendSRAssets&&window.CSJavascriptBridge.sendSRAssets(csArray.prototype.map.call(t,(t=>t.assetId)))},t.sendNativeSREvent=function(t){window.CSJavascriptBridge&&window.CSJavascriptBridge.sendNativeSREvent&&window.CSJavascriptBridge.sendNativeSREvent(csJSON.stringify(t))}}(Ou||(Ou={}));class $u{constructor(t,s,i,e,n,r,h,o){this.qA=t,this.jA=s,this.GA=i,this.ZA=e,this.WA=n,this.ui=r,this.rn=h,this.tt=o,this.JA=!1}async emitWebviewEventToBridge(t,s){switch(t){case Jt.AnalysisEvent:{const t=this.GA.transformEvent(s);t&&Ou.sendAnalysisEvent(t);break}case Jt.RecordingEvent:Ou.sendSREvent(s);break;case Jt.ChildLogMessage:Ou.sendLog(s);break;case Jt.Commands:ts.tryToExecute(`SDKMessageUtils.sendMessage.sendCommandMessage: ${s}`,(()=>{this.KA(s)}))();break;case Jt.Assets:{const{assets:t,serializationId:i}=s,e=await this.WA.getTransformedAssets(t,i);Ou.sendAssets(e,i);break}case Jt.JavascriptError:{const t=this.ZA.transformEvent(Jt.JavascriptError,s);t&&(this.JA&&Ou.sendNativeSREvent({...t,type:Vu.JAVASCRIPT_ERROR_SR}),Ou.sendAnalysisEvent({...t,type:Vu.JAVASCRIPT_ERROR_AN}));break}case Jt.ApiError:{const t=this.ZA.transformEvent(Jt.ApiError,s);t&&Ou.sendAnalysisEvent({...t,type:Vu.API_ERROR});break}case Jt.DetailedApiError:{const t=this.ZA.transformEvent(Jt.DetailedApiError,s);t&&Ou.sendNativeSREvent({...t,type:Vu.DETAILED_API_ERROR});break}}}setSessionReplayStatus(t){this.JA=t}KA(t){const s=t.commands;for(const t of s)switch(!0){case csArray.prototype.indexOf.call(ua,t.name)>=0:Ou.sendOptIn();break;case csArray.prototype.indexOf.call(aa,t.name)>=0:this.ui.emitOptout(),Ou.sendOptOut();break;case csArray.prototype.indexOf.call(qr,t.name)>=0:this.XA(t);break;case csArray.prototype.indexOf.call(To,t.name)>=0:this.YA(t);break;case csArray.prototype.indexOf.call(Xr,t.name)>=0:this.QA(t);break;case csArray.prototype.indexOf.call(Yr,t.name)>=0:break;case csArray.prototype.indexOf.call(Qr,t.name)>=0:this.tg();break;case csArray.prototype.indexOf.call(hu,t.name)>=0:this.QA(t),this.tg();break;case csArray.prototype.indexOf.call(vc,t.name)>=0:this.rn.addUrlMaskingPattern(t.params[0]);break;case csArray.prototype.indexOf.call(Ic,t.name)>=0:this.sg(t);break;default:ts.warn(`WebviewBridgeEventEmitter received an unknown command: ${csJSON.stringify(t)}`)}}XA(t){if(1!==t.params.length)return;const s=t.params[0];if(Hr.isValid(s.key,s.value)){const t=this.qA.anonymizePII(s.key),i=this.qA.anonymizePII(s.value);Ou.sendDynamicVariable(t,i)}}YA(t){if(1!==t.params.length)return;const s=t.params[0];if(St(s)){const t={type:Vu.PAGE_VIEW,version:1,data:{url:s}};this.tt.overridePath(s),this.ui.emitArtificialPageViewEnd(),Ou.sendAnalysisEvent(t),this.ui.emitAfterArtificialPageView()}}QA(t){if(1!==t.params.length)return;const[s]=t.params;s.value&&(s.revenue=s.value),this.jA.addTransaction(s)}tg(){const t=this.jA.getTransaction();Gr.isValid(t)&&(Ou.sendTransaction(t.id?t.id:null,t.revenue,t.currency?t.currency:""),this.jA.clear())}sg(t){if(t.params.length<1)return;const s=t.params[0],i=t.params[1]||{};if(!St(s)||!Tt(i))return;const e=Cu.buildCustomErrorEvent(s,i),n=this.ZA.transformEvent(Jt.CustomError,e);n&&(this.JA&&Ou.sendNativeSREvent({...n,type:Vu.CUSTOM_ERROR_SR}),Ou.sendAnalysisEvent({...n,type:Vu.CUSTOM_ERROR_AN}))}}const xu="LOCAL_ASSET",Lu="NONE",Mu="ONLY_LOCAL_ASSETS",Du="ALL";class Uu{constructor(t){var s,i;this.ig=t,this.eg=new Set,this.ng=Lu;try{const t=null===(i=null===(s=window.CSJavascriptBridge)||void 0===s?void 0:s.getAssetTransformerMode)||void 0===i?void 0:i.call(s);t!==Mu&&t!==Du||(this.ng=t)}catch{}}setAssetProcessingMode(t){this.ng=t}async getTransformedAssets(t,s){if(this.ng===Lu)return t;const i=[];for(const e of t){const t=e.assetId,n=this.rg(t);if(this.ng===Du||n===xu){let n=t;if(this.hg(t,s)&&(n=this.og(t,s)),this.eg.has(n)){csArray.prototype.push.call(i,e);continue}try{const s=await this.ig.getAssetContent(t);if(this.eg.has(n)){csArray.prototype.push.call(i,e);continue}csArray.prototype.push.call(i,{...e,retrievedAssetContent:s}),this.eg.add(e.assetId)}catch(t){ts.error(`an error occurred while getting data for asset: ${n}: ${t}`),csArray.prototype.push.call(i,e)}}else csArray.prototype.push.call(i,e)}return i}rg(t){const s=window.WEBVIEW_SERVER_URL||null;try{const{protocol:i}=new csURL(t);return"file:"===i||s&&csString.prototype.startsWith.call(t,s)?xu:"REMOTE_ASSET"}catch(s){ts.error(`Error constructing URL (${t}"): ${s.message}`)}return"UNKNOWN_ASSET_TYPE"}hg(t,s){return s&&csString.prototype.endsWith.call(t,".css")||!1}og(t,s){return`${t}#${s}`}}class zu{constructor(){this.cg=52428800,this.ag=31457280,this.ug=0,this.lg=!1,this.dg=new Map,this.$i=[]}async getAssetContent(t){const s=this.dg.get(t);return s||new Promise(((s,i)=>{csArray.prototype.push.call(this.$i,{assetUrl:t,successCallback:s,errorCallback:i}),this.lg||this.fg()}))}async fg(){for(this.lg=!0;this.$i.length>0;){const{assetUrl:t,successCallback:s,errorCallback:i}=csArray.prototype.shift.call(this.$i),e=this.dg.get(t);if(e)s(e);else try{const e=(await this.wg("GET",t,"blob")).target;if(200===e.status){const n=e.getResponseHeader("Content-Type"),r=Number(e.getResponseHeader("Content-Length"));if(r&&Number(r)>this.ag){i(`asset is too big, size = ${r} bytes`);continue}const h=new FileReader;h.onload=()=>{const i={data:csString.prototype.split.call(h.result,"base64,")[1],mimeType:null!=n?n:""};this.ug+=r,this.ug>this.cg&&(this.ug=0,this.dg.clear()),this.dg.set(t,i),s(i)},h.onerror=()=>{i("Error converting XHR response to base64")},h.readAsDataURL(e.response)}else i(`error downloading ${t}: ${e.statusText}`)}catch(s){const e=`Error downloading resource ${t}: ${s.message}`;i(e)}}this.lg=!1}wg(t,s,i){return new Promise((function(e,n){const r=new XMLHttpRequest;r.open(t,s),r.responseType=i,r.onload=e,r.onerror=n,r.send()}))}}class Hu{constructor(t,s,i,e){this.lA=t,this.NA=s,this.Ar=i,this.cr=e}handleCommand(t){const s=t&&t.withAssets,i=[],e=new Set,n=new Set,r=[];s&&Eu.isWebViewLocalAssetsSupported()?(this.Ar.onAsset((t=>{e.has(t.assetId)||(e.add(t.assetId),csArray.prototype.push.call(i,t))})),this.Ar.onStyleSheetFound((t=>{n.has(t.assetId)||(n.add(t.assetId),csArray.prototype.push.call(r,t))})),this.Ar.stop(),this.Ar.start()):(this.Ar.stop(),Eu.isWebViewLocalAssetsSupported()||ts.warn("Local asset is not supported on this browser"));const h=this.cr.serialize(document),o=csJSON.stringify(h);if(s){const t=Oc.generate();return this.pg(i,r,t),csJSON.stringify({serializedDom:o,serializationId:t})}return o}pg(t,s,i){0===s.length?this.OA(t,i):this.mg(t,s,i,((t,s)=>this.OA(t,s)))}mg(t,s,i,e){let n=0,r=0;const h=new Set(csArray.prototype.map.call(t,(t=>t.assetId))),o=t=>!h.has(t),c=i=>{h.has(i.assetId)||(h.add(i.assetId),csArray.prototype.push.call(s,i),csArray.prototype.push.call(t,i))},a=o=>{for(const s of o)h.has(s.assetId)||(h.add(s.assetId),csArray.prototype.push.call(t,s));n++,n+r===s.length&&e(t,i)},u=h=>{r++,ts.error("An error occurred while fetching a styleSheet: "+h),n+r===s.length&&e(t,i)};csArray.prototype.forEach.call(s,(t=>{this.NA.getStyleSheetAssets(t.assetId,a,u,o,c)}))}OA(t,s){this.lA.sendToParent(Jt.Assets,{assets:t,serializationId:s})}}class Fu{serializeShadowRootNode(t,s){var i;(null===(i=t.adoptedStyleSheets)||void 0===i?void 0:i.length)>0&&(s.adoptedStyleSheets=this.yg(t.adoptedStyleSheets))}yg(t){return Ii(t,(t=>this.Vo(t)))}Vo(t){let s=[];try{s=Ii(t.cssRules,(t=>t.cssText))}catch{}return{cssRules:s}}}class Bu{constructor(t){this.L=t,this.Ag=null,this.gg=this.Ha(),this.Eg=this.Ba()}isSdkTrackingContext(t){return Pt(t)&&Tt(t)&&St(t.sessionKey)&&Rt(t.pageNumber)&&St(t.pageViewType)&&"boolean"==typeof t.isRecording}update(t){if(!this.isSdkTrackingContext(t))return ts.warn(`webViewTrackingContext.service received wrong sdkTrackingContext, content:${csJSON.stringify(t)}`),void(this.Ag=null);this.Ag={...t,recordingConsentState:Pr.NOT_NEEDED,projectId:this.gg,uxaDomain:this.Eg}}getTrackingContext(){return this.Ag}Ha(){return this.L.projectId}Ba(){return this.L.uxaDomain}}class qu{constructor(t){this.vg=t,this.Za=[]}handleCommand(t){if(!bt(t))return;this.Wa(t);const s=this.vg.getTrackingContext();null!==s&&this.Ja(t,s)}executeRegisteredCallbacks(t){const s=t.trackingContext;s&&csArray.prototype.map.call(this.Za,(t=>this.Ja(t,s)))}Wa(t){csArray.prototype.push.call(this.Za,t)}Ja(t,s){setTimeout((()=>{t(s)}))}}class ju{constructor(t,s){this.Qa=t,this.vg=s}onIframeIntegrationCallback(t){const s=this.vg.getTrackingContext();null!==s&&(t.trackingContext=s,this.Qa.sendToChildren(Jt.IntegrationCallback,t))}}class Gu{constructor(t){this.commandsService=t,this.ru=new xr}registerChildCommands(){this.commandsService.register(Dr,(t=>this.ru.handleCommand(t,this.Lp)))}onParentRecordingStatusChange(t){this.Lp={isRecording:t.isRecording,recordingStartTimestamp:t.recordingStartTimestamp||0,etrState:t.etrState||Rs.ETR_OFF},this.ru.executeCallbacks(this.Lp)}}es([hr()],Gu.prototype,"onParentRecordingStatusChange",null);const Zu=["serializeWebView","webview:serializeWebView"],Wu=["setAssetTransformerMode","webview:setAssetTransformerMode"],Ju=["webview:onAfterScreenView"];class Ku extends Gu{constructor(t,s,i,e,n,r,h){super(t),this.commandsService=t,this.lA=s,this.Qa=i,this.WA=e,this._g=n,this.iu=r,this.L=h}init(){this.vg=new Bu(this.L),this.Rg=new ju(this.Qa,this.vg),this.iu.addListener(this.Rg),this.Sg=new qu(this.vg);const t=new Su(new Tu),s=new En(!1),i=new xn([new Bn,new Fu]);this.Tg=new Hu(this.lA,t,s,i),this.$w()}onAfterPageViewCallback(t){this.Sg.executeRegisteredCallbacks(t)}$w(){super.registerChildCommands(),this.commandsService.register(Lr,(t=>{this.Sg.handleCommand(t)})),this.commandsService.register(Ju,(t=>{this.vg.update(t);const s=this.vg.getTrackingContext();null!==s&&this._g.emitAfterPageViewCallback({initiator:Zt.AfterPageView,trackingContext:s})})),this.commandsService.register(Zu,(t=>this.Tg.handleCommand(t))),this.commandsService.register(Wu,(t=>{t!==Lu&&t!==Mu&&t!==Du||this.WA.setAssetProcessingMode(t)}))}}class Xu{constructor(t){this.lA=t,this.Za={}}handleCommand(t){bt(t)&&this.Wa(t)}executeRegisteredCallbacks(t){const s=t.trackingContext;if(s)if(t.callbackId){const i=this.Za[t.callbackId];i&&this.Ja(i,s)}else for(const t in this.Za)this.Ja(this.Za[t],s)}Wa(t){const s=Y.integer(),i={callbackId:s,initiator:Zt.AfterPageView};this.Za[s]=t,this.lA.sendToParent(Jt.IntegrationCallback,i)}Ja(t,s){setTimeout((()=>{t(s)}))}}class Yu{constructor(t){this.lA=t,this.Ka={}}handleCommand(t){Tt(t)&&bt(t.callback)&&this.Ya(t.callback)}executePendingCallbacks(t){const{trackingContext:s,callbackId:i}=t;if(!i||!s)return;const e=this.Ka[i];e&&(delete this.Ka[i],this.Ja(e,s.sessionKey))}Ya(t){const s=Y.integer(),i={callbackId:s,initiator:Zt.GetSessionKey};this.Ka[s]=t,this.lA.sendToParent(Jt.IntegrationCallback,i)}Ja(t,s){setTimeout((()=>{t(s)}))}}class Qu{constructor(t,s){this.lA=t,this.Qa=s,this.Ig={}}handleCommand(t,s){Tt(t)&&bt(s)&&this.Ya(t,s)}executePendingCommand(t){const{trackingContext:s,callbackId:i}=t;if(i&&s)if(this.Ig[i]){const[t,e]=this.Ig[i];t&&(delete this.Ig[i],this.Ja(s,t,e))}else this.Qa.sendToChildren(Jt.TrackingContextResultMessage,t)}Ya(t,s){const i=Y.integer();this.Ig[i]=[t,s],this.lA.sendToParent(Jt.TrackingContextRequestMessage,{callbackId:i})}Ja(t,s,i){setTimeout((()=>{const e=Or(t,s);i(e)}))}}class tl extends Gu{constructor(t,s,i){super(t),this.commandsService=t,this.lA=s,this.Qa=i}init(){this.Pg=new Xu(this.lA),this.bg=new Yu(this.lA),this.Vg=new Qu(this.lA,this.Qa),this.$w()}onAfterPageViewCallback(t){this.Pg.executeRegisteredCallbacks(t)}onIntegrationSessionKeyCallback(t){this.bg.executePendingCallbacks(t)}onTrackingContextResultCallback(t){this.Vg.executePendingCommand(t)}$w(){super.registerChildCommands(),this.commandsService.register(Lr,(t=>{this.Pg.handleCommand(t)})),this.commandsService.register(Mr,(t=>this.bg.handleCommand(t))),this.commandsService.register(Ur,((t,s)=>{this.Vg.handleCommand(t,s)}))}}class sl{constructor(t,s,i,e,n,r,h,o){this._A=t,this.ui=s,this.L=i,this.lA=e,this.pA=n,this.Ra=r,this.At=h,this.th=o,this.mp=()=>{this.Ra.start(),this.Ap.start()}}start(){let t,s,i,e,n,r,h,o,c,a,u;this.th.schedule((()=>{t=new Za(G,this.L),s=new ko(t),i=new wt,c=new Ga(i),a=new Ia(window.location,c),u=new lc(ts),e=new yu(this.L,t,s,this.lA,this.At,this._A,this.Ra,u),this._A.addListener(e)})),this.th.schedule((()=>{const t=new Cc;n=new ic(this.L,t)})),Jn.isRecordingSupported()&&this.th.schedule((()=>{const t=new Pu(this.L,i,n,u,this.ui,this.lA,this.pA,this.Ra,this._A,this.At,this.th,a);this.ui.addListener(t),this._A.addListener(t),t.init()})),this.th.schedule((()=>{o=new rc(this.L);const s=new Wa(t),i=new Ja(t),e=new Ka(t),n=new Xa;h=new Ca(s,i,e,n),r=new fu(o,h,this.lA,this.pA)})),this.th.schedule((()=>{h.addListener(r),this._A.addListener(r),this.ui.addListener(r),this.ui.addListener(e)})),this.th.schedule((()=>{let t;if(this.At.isInWebViewContext()){const s=new zu;this.WA=new Uu(s),t=new Ku(this.Ra,this.lA,o,this.WA,this._A,h,this.L)}else t=new tl(this.Ra,this.lA,o);this._A.addListener(t),t.init()})),this.th.schedule((()=>{r.init(),e.init()})),this.th.schedule((()=>{if(this.At.isInWebViewContext()){const t=new Nu,s=new cc(i,a),e=new oc(c),n=new ku(a,s,e,i),r=new $u(i,new Wr(i,null,null),t,n,this.WA,this.ui,e,a),h=new bu(this.lA,r);h.init(),this.ui.addListener(h),this._A.addListener(h)}else{const t=new du(this.lA);this.ui.addListener(t)}})),this.Ap=new Oo,this.th.schedule((()=>{this.Ap.onLoad((()=>{this.ui.emitStartTracking()})),this.mp()}))}}class il extends uu{constructor(t,s=500){super(2500),this._A=t,this.Cg=s,this.Ng=!1,this.kg=void 0,this.Og=!0}onStart(){this.$g()}onStop(){this.buffer.reset(),this.xg&&window.clearInterval(this.xg)}sendToParent(t,s){var i;if(this.Lg())null===(i=this.Mg)||void 0===i||i.call(this,t,s);else if(this.Dg(t)){const i=this.buildChildBaseMessage(t,s);this.buffer.addMessage(i)}}Lg(){return this.Ng&&this.Og}Dg(t){return!this.Ng||t===Jt.Commands}onWebViewEvent(t){this.Mg=t}setAnalyticsStatus(t){this.Og=t,this.Og&&this.Ug()}sendAllMessagesFromBuffer(){var t;const s=this.buffer.getMessages();for(const i of s)null===(t=this.Mg)||void 0===t||t.call(this,i.type,i.content);this.buffer.reset()}Ug(){var t;if(!this.Ng)return;const s=this.buffer.getMessages();for(const i of s)i.type===Jt.Commands&&(null===(t=this.Mg)||void 0===t||t.call(this,i.type,i.content));this.buffer.reset()}buildChildBaseMessage(t,s){return{type:t,content:s}}$g(){this.Ng=Ou.isCSJavascriptBridgeDefined(),this.Ng?this.zg():this.xg=window.setInterval((()=>{this.Ng=Ou.isCSJavascriptBridgeDefined(),this.Ng&&(this.zg(),window.clearInterval(this.xg))}),this.Cg)}zg(){this.kg=Ou.getBridgeVersion(),null===this.kg?this.sendAllMessagesFromBuffer():this.kg>=2?(this.Hg(),Ou.notifyIsReadyForTracking()):ts.warn(`bridge version ${this.kg} is not supported`)}Hg(){this._A.emitStopAnalytics()}}class el{constructor(){this.Fg=null}getRecordingStatus(){return null===this.Fg?{isRecording:!1}:this.Fg}setRecordingStatus(t){this.Fg=t}}class nl extends Zi{constructor(t,s){super(),this.nn=t,this.lA=s}onStart(){this.nn.subscribe(nl.Bn,(t=>this.kn(t)))}onStop(){this.nn.unsubscribe(nl.Bn)}kn(t){this.isStarted&&this.lA.sendToParent(Jt.ApiError,t)}}nl.Bn="ChildApiErrorsService";class rl extends Zi{constructor(t,s){super(),this.nn=t,this.lA=s}onStart(){this.nn.subscribe(rl.Bn,(t=>this.kn(t)),{detailedEvent:!0})}onStop(){this.nn.unsubscribe(rl.Bn)}kn(t){this.isStarted&&this.lA.sendToParent(Jt.DetailedApiError,t)}}rl.Bn="ChildDetailedApiErrorsService";class hl{constructor(t,s,i){this.L=t,this.lA=s,this.uA=i}init(){const t=new Sc(this.L),s=new gc(t);let i;const e=new Ac(this.L,s,i),n=new yc(t),r=new pc(this.L,n,i);this.nn=new hc(e,r),this.nn.excludeDomains([_c.CONTENTSQUARE,_c.CLICKTALE]),this.nn.excludeDomains([_c.FAKE_TRACKER]),this.Bg=new nl(this.nn,this.lA),this.qg=new rl(this.nn,this.lA),this.nn.init(),this.$w()}$w(){this.uA.register(vc)}onStartTracking(){this.Bg.start()}onParentRecordingStatusChange(t){t.isRecording?this.qg.start():this.qg.stop()}onOptout(){this.Bg.stop(),this.qg.stop()}onStartAnalytics(){this.Bg.start()}onStopAnalytics(){this.Bg.stop()}}class ol extends Zi{constructor(t,s){super(),this.tn=t,this.lA=s}onStart(){this.tn.subscribe(ol.Bn,(t=>this.kn(t)))}onStop(){this.tn.unsubscribe(ol.Bn)}kn(t){this.isStarted&&this.lA.sendToParent(Jt.JavascriptError,t)}}ol.Bn="ChildJavaScriptErrorsService";class cl{constructor(t,s,i){this.L=t,this.lA=s,this.uA=i}init(){const t=new Yo;this.jg=new ol(t,this.lA),this.$w()}onStartTracking(){this.jg.start()}onOptout(){this.jg.stop()}onStartAnalytics(){this.jg.start()}onStopAnalytics(){this.jg.stop()}$w(){this.L.jsCustomErrorsEnabled&&!this.L.customErrors.enabled&&this.uA.register(Ic)}}class al{constructor(t,s,i){this.L=t,this.At=s,this.th=i}init(){let t,s,i,e,n,r,h;yr.isSupported()&&yr.setDigestSalt(this.L.projectId.toString()),this.th.schedule((()=>{t=new zc(this.th),s=new ru,i=new el;const r=[ma.UXA];this.At.isInWebViewContext()?(window.cs_wvt=window.cs_wvt||[],csArray.prototype.push.call(r,ma.WVT),e=new il(s)):e=new lu(this.L,t,i,s),n=new ya(r)})),this.th.schedule((()=>{r=new cu(n,e),h=new ou(r)})),this.th.schedule((()=>{h.init()})),this.th.schedule((()=>{if(this.L.apiErrors.enabled){const i=new hl(this.L,e,r);i.init(),t.addListener(i),s.addListener(i)}if(this.L.jsErrorsEnabled){const i=new cl(this.L,e,r);i.init(),t.addListener(i),s.addListener(i)}})),this.th.schedule((()=>{t.addListener(h)})),this.th.schedule((()=>{new sl(s,t,this.L,e,i,n,this.At,this.th).start()}))}}class ul{constructor(t,s,i){this.L=t,this.At=s,this.D=i}start(){var t,s,i,e,n;if(window.UXAnalytics)return;window.CSCurrentScript=document.currentScript;const r=new gn(!!(null===(t=this.L.taskSchedulerOptions)||void 0===t?void 0:t.enabled),null===(s=this.L.taskSchedulerOptions)||void 0===s?void 0:s.maxProcessingTime,null===(i=this.L.taskSchedulerOptions)||void 0===i?void 0:i.waitDuration),h=new us(this.At,this.L);h.init();const o=new ls(this.L,h);if(this.At.isTopWindowTracker()&&o.canTrack()){if((null===(e=window.CSProtectnativeFunctionsLogs)||void 0===e?void 0:e.Warning)&&ts.warn(`protectNativeFunctions failed: ${window.CSProtectnativeFunctionsLogs.Warning}`),null===(n=window.CSProtectnativeFunctionsLogs)||void 0===n?void 0:n.Critical)return void ts.error(`protectNativeFunctions failed: ${window.CSProtectnativeFunctionsLogs.Critical}`);new su(this.L,h,this.D,r).init()}else if(!this.At.isTopWindowTracker()&&o.canTrackInChild()){new al(this.L,this.At,r).init()}window.UXAnalytics={},!window.CSFrameCommunication&&nu.isActivable()&&(window.CSFrameCommunication=nu,nu.waitForConnection())}}es([ei("main.start"),is("main.start")],ul.prototype,"start",null);class ll{constructor(){}send(t,s,i=et.warn){const e={message:t,errorCode:s,level:i};Ou.sendLog(e)}}try{const t=new st(window.CS_CONF);window._uxa=window._uxa||[],t.processOptionOverrides(window._uxa);const s=new it(window,t);s.init();const i=new Yt;if(ss=ts,ts.computeIsActive(t.validationRate),s.isTopWindowTracker()){const s=new xt(t,i);ts.setStrategy(s)}else if(s.isInIframeContext()){const s=new Xt(t);ts.setStrategy(s)}else if(s.isInWebViewContext()){const t=new ll;ts.setStrategy(t)}!function(t=50,s=.1){ti=ts.isPerfLoggingActive()&&function(){var t;if(!(null===(t=window.performance)||void 0===t?void 0:t.mark))return!1;const s="isPerformanceMeasureSupported",i=`${s}_a`;return performance.mark(i),void 0!==performance.measure(s,i)}(),ti&&(Ys=t,Qs=s)}();new ul(t,s,i).start()}catch{}})(); \ No newline at end of file