var CS_CONF={"isSMB":false,"projectId":49600,"status":1,"hostnames":["fxcm.com","fxcm-arabic.com","fxcorporate.com","myfxcm.com","fxcm.app","fxcmsupport.com"],"crossDomainTracking":0,"crossDomainSingleIframeTracking":0,"consentRequired":0,"allowSubdomains":1,"visitorCookieTimeout":34164000000,"sampleRate":100,"replayRecordingRate":100,"validationRate":10,"lastTrackingDraw":null,"trackerDomain":"c.az.contentsquare.net","recordingDomain":"r.contentsquare.net","useMalkaPipeline":1,"ed":"l.contentsquare.net/log/web","eMerchandisingEnabled":0,"mouseMoveHeatmapEnabled":1,"autoInsightsEnabled":0,"jsErrorsEnabled":1,"customErrorsEnabled":1,"jsCustomErrorsEnabled":0,"apiErrorsEnabled":1,"customHashIdEnabled":1,"recordingEncryptionEnabled":0,"recordingEncryptionPublicKey":null,"recordingEncryptionPublicKeyId":0,"secureCookiesEnabled":0,"triggerSessionReplayEnabled":0,"triggerSessionReplayRegex":null,"dynamicIdRegex":null,"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,"eventsApiEnabled":0,"apiErrors":{"validCustomHeaders":[],"plainCustomHeaders":[],"validUrls":[],"configurableApiErrorRules":[],"collectStandardHeaders":0,"collectQueryParam":0,"collectRequestBody":0,"collectResponseBody":0,"collectionRules":[]},"customErrors":{"consoleMessageLogLevels":[]},"displayAdOptions":null,"taskSchedulerOptions":{"enabled":1},"malkaQuotaServiceDomain":"q-us1.az.contentsquare.net","malkaRecordingDomain":"k-us1.az.contentsquare.net","staticResourceManagerDomain":"srm.af.contentsquare.net","voc":{"siteId":null,"enabled":0}}; ; var CS_INTEGRATIONS_CONF = {"optimizely":{},"youtube":{"settings":["enableVideoStarted","enableVideoPaused","enableVideoCompleted","enableVideoPlayDuration","enableVideoQuality","enableVideoMuted","enableVolumeChanged"]},"usertesting":{}}; /* 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=25&&(t="25"),n>=50&&(t="50"),n>=75&&(t="75"),100===n&&(t="100"),t){const n="videoduration_"+t+"_"+i;-1===e.indexOf(n)&&(e.push(n),p("Video play view duration","Video ID : "+i+" : "+t+"%"))}}}}}),a)}catch(c){}}));for(let e=0;e0&&(c=!0)),0===m.length){const e=new MutationObserver((function(){o((function(){if(document.querySelector(i)||document.querySelector(r)){m=document.querySelectorAll(i),0===m.length&&(m=document.querySelectorAll(r),m.length>0&&(c=!0)),e.disconnect();for(let e=0;e-1&&(n=!0),e.indexOf("enableVideoPaused")>-1&&(t=!0),e.indexOf("enableVideoCompleted")>-1&&(u=!0),e.indexOf("enableVideoPlayDuration")>-1&&(d=!0),e.indexOf("enableVideoQuality")>-1&&(s=!0),e.indexOf("enableVolumeChanged")>-1&&(l=!0),e.indexOf("enableVideoMuted")>-1&&(f=!0));let w=!1;_uxa.push(["afterPageView",function(e){o((function(){m()}),a)}])}),a)}]);/* integration-usertesting 2.1.5 */ !function(e){var n={};function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},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 r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(n){return e[n]}.bind(null,i));return r},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-usertesting-contentsquare","version":"2.1.5","scripts":{"build:snippet":"webpack"}}')},function(e,n,t){"use strict";function r(e,n){try{e()}catch(e){window._uxa=window._uxa||[],_uxa.push(["logSnippetError",n,e.message])}}function i(e){return"object"==typeof e&&null!==e}function a(e,n){n||(n="="),e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&=]"+e+n+"([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}t.r(n);const o=t(0);let u,s=o.name,c=o.version;const p=function(e){var n,t,i,a;if(r((function(){var r=e.name;i=e.version;var o=r.replace("@contentsquare/integration-","");n=o+"-"+i;var u="-contentsquare";a=new RegExp(u+"$").test(o),t=o.replace(/-contentsquare([^-contentsquare]*)$/,"$1"),a||(u="-cap",a=new RegExp(u+"$").test(o),t=o.replace(/-cap([^-cap]*)$/,"$1"))}),"Shared-Function-readPackageJSON"),a)return{snippetBuildName:n,parameterName:t,snippetVersion:i}}(o);p&&(u=p.parameterName,s=p.snippetBuildName,c=p.snippetVersion),r((function(){window._uxa=window._uxa||[],CS_CONF.integrations=CS_CONF.integrations||[],CS_CONF.integrations.push("UserTesting - v"+c);const e=function(e,n){if(i(window.CS_INTEGRATIONS_CONF)&&i(window.CS_INTEGRATIONS_CONF[e]))return window.CS_INTEGRATIONS_CONF[e][n]}(u,"settings");let n=!1,t="";e&&(e.indexOf("sendArtificialPageviews")>-1&&(n=!0),e.indexOf("setReplayLinkToFirstPV")>-1&&(t=0));let o=!1;function p(e){const r=document.location.search;if(r.indexOf("utm_source=UserTesting")>-1&&r.indexOf("utm_campaign=")>-1&&r.indexOf("utm_content=")>-1){const r=a("utm_campaign"),p=a("utm_content");p&&setTimeout((function(){if(o=_uxa.push(["isRecording"]),o){var n=function(e,n,t){e||(e="missingFromDynamicSnippet");var r=n;if(isNaN(r)&&(n=0),t){var i=t.sessionKey.split("."),a=t.projectId,o=i[0],u=i[1],s=t.pageNumber,c=s-n;return n>=s&&(c=s),0===r&&(c=1),"https://app.contentsquare.com/quick-playback/index.html?pid="+a+"&uu="+o+"&sn="+u+"&pvid="+c+"&recordingType=cs&vd="+e}}("ut",t,e);if(n){var r=new XMLHttpRequest;r.open("POST","https://cloudhub-prod.usertesting.com/usertesting/api/v1/partner-analytics"),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify({usertesting_eid:p,external_link:n,partner_name:"Contentsquare"}))}}}),500),r&&(u=r,s="etr",c="cs_usertesting=study_id_"+r,i="UGC_UT_"+(i="Study ID"),_uxa.push(["trackDynamicVariable",{key:i,value:u}]),o&&"etr"===s&&_uxa.push(["trackEventTriggerRecording","@ETS@"+i]),c&&n&&_uxa.push(["trackPageview",window.location.pathname+"?"+c]))}var i,u,s,c}let l=!1;_uxa.push(["afterPageView",function(e){r((function(){!function(e){l||(l=!0,p(e))}(e)}),s)}])}),s)}]);; ; (()=>{"use strict";var t={d:(s,e)=>{for(var i in e)t.o(e,i)&&!t.o(s,i)&&Object.defineProperty(s,i,{enumerable:!0,get:e[i]})},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={};function e(t,s){let e;return window.Zone&&"function"==typeof window.Zone.__symbol__&&(e=t[window.Zone.__symbol__(s)]),e||(e=t[s]),e}t.r(s),t.d(s,{getRequestParameters:()=>zh});const i="cs-native-frame",n={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",RegExp:"csRegExp"}};function r(t,s,e){const i=function(t,s){let e,i=t;for(;i&&!(e=Object.getOwnPropertyDescriptor(i,s));)i=Object.getPrototypeOf(i);return e}(t,s);if(!i)return function(){return this[s]};switch(e){case"get":return i.get;case"set":return i.set;case"value":return i.value}}function o(t){Object.keys(n.constructors).forEach((s=>{window[n.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",n.nodeProperties,t.Node.prototype,"get"),h("csElement",n.elementProperties,t.Element.prototype,"get"),h("csElement",n.elementPropertiesValues,t.Element.prototype,"value",!1),h("csHTMLImageElement",n.imageProperties,t.HTMLImageElement.prototype,"set"),h("csEvent",n.eventProperties,t.Event.prototype,"get"),h("csNavigator",n.navigatorProperties,t.navigator,"value")}function h(t,s,e,i,n=!0){s.forEach((s=>{const o="string"!=typeof s&&"binding"in s,h=o?s.propertyName:s;(n||h in e)&&(window[`${t+h}`]=r(e,h,i),o&&(window[`${t+h}`]=window[`${t+h}`].bind(s.binding)))}))}function c(t,s){window.CSProtectnativeFunctionsLogs=window.CSProtectnativeFunctionsLogs||{},window.CSProtectnativeFunctionsLogs[t]=s}if(window.csSetTimeout=e(window,"setTimeout"),window.csQueueMicrotask=e(window,"queueMicrotask"),window.csClearTimeout=e(window,"clearTimeout"),(()=>{var t;let s=0;function e(t){return"$$"+t+ ++s}e.for=e,window.csSymbol=null!==(t=window.Symbol)&&void 0!==t?t:e})(),!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 e=s.attachShadow({mode:"closed"});return e.innerHTML=t.outerHTML,e.firstElementChild.contentWindow}return s.innerHTML=t.outerHTML,s.firstElementChild.contentWindow}();return!!t&&(window.CSPureWindow=t,o(window.CSPureWindow),!0)}catch(t){return c("Warning",`failed to copy references from pure iframe: ${t.message}`),!1}}())try{o(window)}catch(Oo){c("Critical",`failed to copy references from window: ${Oo.message}`)}function a(t){return u(csString.prototype.toLowerCase.call(t.localName))}function u(t){return csString.prototype.replace.call(t,/([#;&,.+*~':"!^$[\]()<=>|/%?@`{}\\ ])/g,"\\$1")}function l(t){return 1===t.nodeType}function d(t){return 3===t.nodeType}function f(t){return l(t)&&"link"===t.localName}function p(t){return l(t)&&"a"===t.localName}function v(t){return f(t)&&-1!==csString.prototype.indexOf.call(t.rel,"stylesheet")}function m(t){return l(t)&&"style"===t.localName}function w(t){return l(t)&&"input"===t.localName}function g(t){return l(t)&&"textarea"===t.localName}function y(t){return l(t)&&"script"===t.localName}function E(t){return l(t)&&"ownerSVGElement"in t}function A(t){return l(t)&&"select"===t.localName}function _(t){switch(t.nodeType){case 9:case 11:case 1:return!0;default:return!1}}function R(t){return 9===t.nodeType}function S(t){return function(t){switch(t.nodeType){case 9:case 11:return!0;default:return!1}}(t)&&"host"in t&&"mode"in t}function T(t){return l(t)&&!!csElementshadowRoot.apply(t)&&S(csElementshadowRoot.apply(t))}const I=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];const P="detached";function b(t){let s=t;const e=[s];for(;null!==csNodeparentNode.apply(s);)s=csNodeparentNode.apply(s),csArray.prototype.push.call(e,s);return V(s)&&csArray.prototype.push.call(e,P),{ancestors:e,selectionRoot:s}}function V(t){return F.isValidElement(t)}const C=window.csElementmatches||window.csElementmatchesSelector||window.csElementmozMatchesSelector||window.csElementmsMatchesSelector||window.csElementoMatchesSelector||window.csElementwebkitMatchesSelector;function k(t,s){return!!s&&csArray.prototype.some.call(s,(s=>C.call(t,s)))}const O=[/\d{4}/,/^ember\d+$/],N="data-cs-override-id",x="data-cs-dynamic-id";function $(t,s,e,i){const n=i.dynamicIdRegex||null,r=i.dynamicElementNameRegex;let o=a(t);if(r){r.test(t.localName)&&(o=csString.prototype.replace.call(o,r,"$1@"))}if(function(t,s){const e=L(t);return e&&csString.prototype.match.call(e,/^[\w-]+$/)&&M(N,e,s)}(t,e)){const s=L(t);return{hasUniqueIdentifier:!0,elementSelector:`${o}[${N}="${s}"]`}}const h=function(t,s,e){if(!e.uniqueAttributes)return{success:!1};for(const i of e.uniqueAttributes){const e=t.getAttribute(i);if(null!==e){if(M(i,e,s))return{attributeName:i,attributeValue:e,success:!0}}}return{success:!1}}(t,e,i);if(h.success)return{hasUniqueIdentifier:!0,elementSelector:`${o}#UA[${h.attributeName}="${h.attributeValue}"]`};const c=function(t,s,e){if(!e.uniqueCssSelectors)return;for(const i of e.uniqueCssSelectors)if(C.call(t,i)&&D(i,s))return i;return}(t,e,i);if(c)return{hasUniqueIdentifier:!0,elementSelector:`${o}#UCS[${c}]`};const l=function(t){const s=t.getAttribute("id");return s?u(s):s}(t);if(function(t,s,e,i){return s&&!function(t){return null!==L(t)}(t)&&!function(t,s,e){return t.hasAttribute(x)||function(t,s){let e=!1;t&&s&&(e=s.test(t));return t&&(csArray.prototype.some.call(O,(s=>s.test(t)))||e)}(s,e)}(t,s,i)&&function(t,s){return t&&M("id",t,s)}(s,e)}(t,l,e,n))return{hasUniqueIdentifier:!0,elementSelector:`${o}#${l}`};const d=function(t,s){if(!s.reliableSelectors)return;for(const e of s.reliableSelectors)if(C.call(t,e))return e;return}(t,i);if(d){const e=function(t,s,e){if(t===P||9===t.nodeType)return 0;let i=0,n=s.previousElementSibling;for(;n;)C.call(n,e)&&(i+=1),n=n.previousElementSibling;return i}(s,t,d);return{hasUniqueIdentifier:!1,elementSelector:`${o}[${d}](${e})`}}const f=function(t,s,e){if(t===P||9===t.nodeType)return 0;const i=e.dynamicElementNameRegex,n=!!(null==i?void 0:i.test(s.localName)),r=a(s);let o=0,h=s.previousElementSibling;for(;h;)(a(h)===r||n&&(null==i?void 0:i.test(h.localName)))&&!k(h,e.reliableSelectors)&&(o+=1),h=h.previousElementSibling;return o}(s,t,i);return{hasUniqueIdentifier:!1,elementSelector:`${o}:eq(${f})`}}function L(t){return t.getAttribute(N)}function M(t,s,e){try{return 1===window.csquerySelectorAll[e.nodeType].call(e,`[${t}="${s}"]`).length}catch(t){if("SyntaxError"!==t.name)throw t}return!1}function D(t,s){try{return 1===window.csquerySelectorAll[s.nodeType].call(s,t).length}catch(t){if("SyntaxError"!==t.name)throw t}return!1}function U(t,s,e){const i=csArray.prototype.shift.call(t);if(0===t.length)return B(i,e);const n=i,r=t[0],{elementSelector:o,hasUniqueIdentifier:h}=$(n,r,s,e);if(!e.fullPath&&h){return`${B(t[t.length-1],e)}${o}`}const c=U(t,s,e);return`${c?`${c}>`:""}${o}`}function B(t,s){if(t===P)return"|detached|";if(t.host){const{ancestors:e,selectionRoot:i}=b(t.host);return`${U(e,i,s)}|shadow-root|`}return 11===t.nodeType?"|fragment|":""}var F;!function(t){function s(t){return!!t&&"localName"in t&&"getAttribute"in t&&"hasAttribute"in t&&"parentNode"in t}function e(t){return t&&"jquery"in t&&1===t.length?t[0]:t}t.INVALID_ELEMENT="INVALID_ELEMENT",t.isValidElement=s,t.getElementPath=function(i,n={fullPath:!1,dynamicIdRegex:null}){const r=e(i);if(r===document)return"";if(!s(r))return t.INVALID_ELEMENT;const{ancestors:o,selectionRoot:h}=b(r);return U(o,h,n)},t.getElementPathAndFirstAnchorParent=function(i,n={fullPath:!1,dynamicIdRegex:null}){const r=e(i);if(r===document)return{path:"",firstAnchorParent:null};if(!s(r))return{path:t.INVALID_ELEMENT,firstAnchorParent:null};const{firstAnchorParent:o,ancestors:h,selectionRoot:c}=function(t){let s=t;const e=[s];let i=null;for(;null!==csNodeparentNode.apply(s);)null===i&&p(s)&&(i=s),csArray.prototype.push.call(e,csNodeparentNode.apply(s)),s=csNodeparentNode.apply(s);return V(s)&&csArray.prototype.push.call(e,P),{firstAnchorParent:i,ancestors:e,selectionRoot:s}}(r);return{path:U(h,c,n),firstAnchorParent:o}}}(F||(F={})),window.CSPathComputation=window.CSPathComputation||F;const q=Number.MAX_SAFE_INTEGER||9007199254740991;function H(){}function z(t,s){return 0===csString.prototype.lastIndexOf.call(t,s,0)}const j=34164e6,G={percentage:()=>Math.floor(1e4*Math.random())/100,boolean(t){return this.percentage()Math.floor(Math.random()*t)},Z=csSymbol("cachedJson");const W=void 0!==window.Symbol?function(t){if(t[Z])return t[Z];if(csArray.isArray(t)){if(0===t.length)return"[]";let s="["+W(t[0]);for(let e=1;e{if("setOption"===t){const[t,e]=s;this.h(t,e)}}))}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,e]=s;return new csRegExp(`^${t}$`,e)}return new csRegExp(`^${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)}isCsSideloadingHeap(){var t;return"cs_sideloads_heap"===(null===(t=this.heapEnvironment)||void 0===t?void 0:t.heap_tag_status)&&!this.isHeapPresent}isHeapSideloadsCsV5(){var t,s;const e="function"==typeof(null===(t=window.heap)||void 0===t?void 0:t.getUserId);return"heap_sideloads_cs"===(null===(s=this.heapEnvironment)||void 0===s?void 0:s.heap_tag_status)&&e}isCsCrosswritingHeap(){var t;return"cs_crosswrites_heap"===(null===(t=this.heapEnvironment)||void 0===t?void 0:t.heap_tag_status)}isClickedElementTextEnabled(){return this.isSMB}}class K{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 Y,Q;!function(t){t.debug="debug",t.warn="warn",t.error="error",t.critical="critical"}(Y||(Y={})),function(t){t.toQuery=function(t){return csArray.prototype.join.call(csArray.prototype.map.call(Object.keys(t),(s=>`${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`)),"&")}}(Q||(Q={}));class X{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 tt extends X{constructor(t,s){super(t,s)}send(){csArray.prototype.forEach.call(this.beforeRequestCallbacks,(t=>t()));const t=this.retrieveParameters();this.I(t);const s=Q.toQuery(t);this.P(s),csArray.prototype.forEach.call(this.afterRequestCallbacks,(t=>t()))}P(t){const s=new window.Image(1,1);s.onload=H,s.onerror=H,csHTMLImageElementsrc.call(s,`${this.domainUri}${this.path?`/${this.path}`:""}?${t}`)}I(t){t.r=csString.prototype.slice.call(`${Math.random()}`,2,8)}}class st{constructor(t,s){this.V=t,this.C=s}init(){this.O=new tt(this.V.getLoggerUri()),this.O.setRequestParametersProviders(this,this.C)}send(t){this.N=t,this.O.send()}getRequestParameters(){return{a:this.N.app,l:this.N.level,m:this.N.message,s:this.N.stacktrace}}}const et=/[a-zA-Z0-9._%+-]+(?:@|%40|%2540)[a-zA-Z0-9.%-_]+((?:\.|%2[eE])[a-zA-Z0-9-]+)+/g,it=/[a-zA-Z0-9+_-](?:@|%40|%2540)/,nt="([-A-Za-z0-9+/=_]|=[^=]|={3,})+",rt=new csRegExp(`(ey${nt}\\.ey${nt}\\.${nt})`,"g"),ot=/[0-9]{4}/,ht=/(^|[^a-zA-Z0-9*.,-])([45*][0-9*]{3}([ -]?)[0-9*]{4}\3[0-9*]{4}\3[0-9*]{4})($|[^a-zA-Z0-9*.,-])/g,ct="CS_ANONYMIZED_PII",at=/\d+/g,ut=/([+(]{0,2}\d[-_ ()/]{0,4}){9,}/,lt=/(?:\d{1,3}\.){3}\d{1,3}/,dt=/(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}/;var ft;!function(t){t.replaceEmail=function(t){return csString.prototype.replace.call(t,et,"CS_ANONYMIZED_EMAIL")},t.replaceJWT=function(t){return csString.prototype.replace.call(t,rt,"CS_ANONYMIZED_JWT")},t.replaceCreditCardNumber=function(t,s){return csString.prototype.replace.call(t,ht,s)},t.replaceDigits=function(t){return csString.prototype.replace.call(t,at,ct)},t.replaceNumberSequence=function(t){return csString.prototype.replace.call(t,ut,ct)},t.mayHaveIPAddress=function(t){return lt.test(t)||dt.test(t)},t.mayHaveNumberSequence=function(t){return ut.test(t)},t.mayHaveCreditCardNumber=function(t){return ot.test(t)},t.mayHaveEmail=function(t){return it.test(t)}}(ft||(ft={}));class pt{hasPII(t,s){return t!==this.checkAndAnonymizePII(t,s)}checkAndAnonymizePII(t,s){let e=this.anonymizeCreditCard(this.anonymizeEmail(t));return!0===s?e=this.anonymizeAllDigits(e):!1===s&&(e=this.anonymizeNumberSequence(e)),e}anonymizePII(t){return"string"==typeof t&&(t=this.anonymizeEmail(t)),t}anonymizeEmail(t){return ft.mayHaveEmail(t)?ft.replaceEmail(t):t}anonymizeAllDigits(t){return ft.replaceDigits(t)}anonymizeNumberSequence(t){return ft.replaceNumberSequence(t)}anonymizeCreditCard(t){return ft.mayHaveCreditCardNumber(t)?ft.replaceCreditCardNumber(t,((t,s,e,i,n)=>{if(-1===csString.prototype.indexOf.call(e,"*")){const s=i.length?csArray.prototype.join.call(csString.prototype.split.call(e,i),""):e;if(!this.$(s))return t}return`${s}${ct}${n}`})):t}$(t){const s=parseInt(t[t.length-1]);let e=0;for(let s=t.length-2;s>=0;s--){let i=parseInt(t[s]);s%2==0&&(i*=2),e+=Math.floor(i/10)+i%10}return 10-e%10===s}anonymizeJwt(t){return ft.replaceJWT(t)}anonymizeFields(t,s){return csArray.prototype.forEach.call(s,(s=>{t[s]=this.anonymizeEmail(t[s])})),t}}const vt="15.21.0";function mt(){return{v:vt}}function wt(t){return At(t)&&("number"==typeof t||t instanceof Number)&&!isNaN(t)}function gt(t){return t===parseInt(t,10)}function yt(t){return At(t)&&("string"==typeof t||t instanceof csString)}function Et(t){return"object"==typeof t}function At(t){return void 0!==t}function _t(t){return At(t)&&null!==t}function Rt(t){return"function"==typeof t}function St(t){return t instanceof Element}function Tt(t){return t instanceof Error}const It={now:()=>void 0!==window.performance&&window.performance.now?window.performance.timing.navigationStart+Math.round(window.performance.now()):csDate.now()};function Pt(){return Math.floor(It.now()/1e3)}function bt(){return"function"==typeof window.Promise}function Vt(){var t,s;return"function"==typeof(null===(t=window.navigation)||void 0===t?void 0:t.addEventListener)&&"function"==typeof(null===(s=window.navigation)||void 0===s?void 0:s.removeEventListener)}function Ct(t,s){return 0===csString.prototype.lastIndexOf.call(t,s,0)}function kt(t,s){return-1!==csString.prototype.indexOf.call(t,s,t.length-s.length)}class Ot{constructor(t,s){this.L=t,this.M=s}getRequestParameters(){return{d:`${It.now()}`,p:this.M.anonymizePII(window.location.href),...this.L.getRequestParameters(),...mt()}}}const Nt="snippet-",xt="implementation-snippet-";var $t,Lt;!function(t){t.IMPLEMENTATION="implementation",t.DYNAMIC="dynamic"}($t||($t={})),function(t){t[t.debug=0]="debug",t[t.warn=1]="warn",t[t.error=2]="error",t[t.critical=3]="critical"}(Lt||(Lt={}));class Mt{constructor(t,s,e){this.D=s,this.M=new pt,this.U=Lt[Y.warn],this.U=Lt[t.minLogLevel||Y.warn],this.O=e||new st(t,new Ot(t,this.M)),this.B={[Y.debug]:[],[Y.warn]:[],[Y.error]:[],[Y.critical]:[]},this.F={implementation:{},dynamic:{}},this.O.init()}send(t,s="",e=Y.warn){if(!this.q(e,s))return;csArray.prototype.push.call(this.B[e],s||"");const i={message:this.H(t,s),stacktrace:this.j(t),app:"uxa",level:e};this.O.send(i)}H(t,s){let e=Tt(t)?this.M.anonymizePII(t.message||t.toString()):t;return s&&(e+=` ErrorCode: ${s}`),e}j(t){return Tt(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 e=this.D.getSessionService(),i=e&&e.getSession(),n={userId:s.id,sessionNumber:s.visitsCount,pageNumber:i&&i.pageNumber};return csJSON.stringify(n)}q(t,s){if(Lt[t]=5)&&(!s||!csArray.prototype.some.call(e,(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 Dt="undefined"==typeof window,Ut="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:process;const Bt=!Dt&&document.createElement("a"),Ft=/(:443|:80)$/;function qt(t){return Bt?(Bt.href=t,Bt.href):""}function Ht(t,s){return new csURL(t,s).href}function zt(t){const s=Zt(t);return null===s?"":decodeURIComponent(s.hostname)}function jt(t,s){return csArray.prototype.some.call(s,(s=>kt(t,`.${s}`)||t===s||""===s))}function Gt(t){return csString.prototype.replace.call(t,Ft,"")}function Zt(t){return Bt&&(Ct(t,"http://")||Ct(t,"https://"))?(Bt.href=t,{hash:Bt.hash,host:Gt(Bt.host),hostname:Bt.hostname,href:Bt.href,origin:Bt.origin?Bt.origin:Gt(`${Bt.protocol}//${Bt.host}`),pathname:(s=Bt.pathname,"/"===s[0]?s:`/${s}`),port:Bt.port,protocol:Bt.protocol,search:Bt.search}):null;var s}const Wt="CS_IFRAME_MESSAGE";var Jt,Kt,Yt,Qt;!function(t){t.AfterPageView="afterPageView",t.GetSessionKey="getSessionKey"}(Jt||(Jt={})),function(t){t.Parent="parent",t.Child="child"}(Kt||(Kt={})),function(t){t.Discovery="discovery",t.Stop="stop",t.RecordingStatus="recordingStatus",t.SensitiveStatus="sensitiveStatus",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"}(Yt||(Yt={})),function(t){t.buildBaseMessage=function(t,s,e,i){const n={type:t,from:s,pid:e,signature:Wt};return void 0!==i&&i>=0&&(n.id=i),n},t.isMessageValid=function(t,s,e,i){const n=zt(t.origin);return!!t.data&&!!t.data.type&&t.data.signature===Wt&&t.data.from===s&&t.data.pid===e&&jt(n,i)},t.sendPostMessage=function(t,s,e,i){i?t.postMessage(e,s,i):t.postMessage(e,s)},t.getNewChannelMessage=function(){return new MessageChannel},t.sendChannelMessage=function(t,s){t.postMessage(s)},t.closeChannelPort=function(t){t.close()}}(Qt||(Qt={}));class Xt{constructor(t){this.L=t}send(t,s="",e=Y.warn){const i={message:t,errorCode:s,level:e},n=Qt.buildBaseMessage(Yt.ChildLogMessage,Kt.Child,this.L.projectId);n.content=i,Qt.sendPostMessage(window.parent,"*",n)}}class ts{setContext(t,s){this.W=t,this.J=s}getVisitorService(){return this.W}getSessionService(){return this.J}}const ss=["t.contentsquare.net","clicktale"];window.addEventListener("error",(t=>{"string"!=typeof t.filename||!csArray.prototype.some.call(ss,(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||es.critical(`Uncaught jsError: filename: ${t.filename} - lineno: ${t.lineno} - colno: ${t.colno} - message: ${t.message} `)}));class es{constructor(){}static whiteListFilename(t){csArray.prototype.push.call(ss,t)}static setStrategy(t){es.K=t}static computeIsActive(t){es.Y=G.boolean(t),es.Y?es.X=G.boolean(10):es.X=!1}static isLoggingActive(){return es.Y}static getStrategy(){return es.K}static debug(t,s=""){es.Y&&this.K.send(t,s,Y.debug)}static warn(t,s=""){es.Y&&this.K.send(t,s,Y.warn)}static error(t,s=""){es.Y&&this.K.send(t,s,Y.error)}static critical(t,s=""){this.K.send(t,s,Y.critical)}static tryToExecute(t,s){return(...e)=>{try{const i=s(...e);return At(window.Promise)&&i instanceof window.Promise?i.then((t=>t),(s=>this.error(s,t))):i}catch(s){try{this.error(s,t)}catch{}}}}static isPerfLoggingActive(){return es.X}}es.Y=!1,es.X=!1;let is={debug(...t){},warn(...t){},error(...t){},critical(...t){},isPerfLoggingActive:()=>!1};const ns=t=>(s,e,i)=>{const n=(null==e?void 0:e.toString())||"",r=t||`${s.constructor&&s.constructor.name}.${n}`;if(i){const t=i.value;i.value=function(...s){return rs(r,t.bind(this))(...s)}}};function rs(t,s){return(...e)=>{try{const i=s(...e);return At(window.Promise)&&i instanceof window.Promise?i.then((t=>t),(s=>is.error(s,t))):i}catch(s){try{is.error(s,t)}catch{}}}}let os=!1;function hs(){return(t,s,e)=>{const i=e.value;e.value=function(t,s){!1===(null==t?void 0:t.isTrusted)&&os||i.call(this,t,s)}}}class cs{constructor(){this.tt=0}get length(){return this.tt}get isEmpty(){return!this.st}pushAll(t){for(let s=0;s=us&&csArray.prototype.push.call(ps,{mName:t,mDuration:+e.toFixed(2)}),csArray.prototype.pop.call(fs),0===fs.length&&(e>as&&ds.push(ps),ps=[])}function ws(t,s){return function(...e){if(!ls)return t.apply(this,e);vs(s);const i=t.apply(this,e);return ms(s),i}}const gs=function(t){return function(s,e,i){const n=i.value;i.value=function(){if(!ls)return i.value=n,n.apply(this,arguments);vs(t);const s=n.apply(this,arguments);return ms(t),s}}};function ys(t,s,e,i){var n,r=arguments.length,o=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(n=t[h])&&(o=(r<3?n(o):r>3?n(s,e,o):n(s,e))||o);return r>3&&o&&Object.defineProperty(s,e,o),o}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var Es,As,_s,Rs;!function(t){function s(t){const s=new csRegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(document.cookie);return s?decodeURIComponent(s[2]):null}function e(s,e,n,r,o,h){const c=encodeURIComponent(`${e}`),a=n===t.CURRENT_DOMAIN?void 0:n,u=i(r);let l=`${s}=${c}${u?`;expires=${u.toUTCString()}`:""};path=/${_t(a)?`;domain=${a}`:""}`;return At(o)&&o!==_s.NotSet&&(l=`${l};SameSite=${o}`),At(h)&&h===Rs.Yes&&(l=`${l};Secure`),document.cookie=l,!0}function i(t){return wt(t)?new csDate(It.now()+t):t}function n(t,i){s(t)&&e(t,"",i,new csDate(0)),s(t)&&e(t,"",i,new csDate(0),_s.None,Rs.Yes)}t.CURRENT_DOMAIN="CURRENT_DOMAIN",t.get=s,t.set=e,t.toExpireDate=i,t.remove=n,t.isCookiePresent=function(){return document.cookie.length>0},t.getRootDomain=function(t,i){const r="_cs_root-domain";let o=s(r);if(null!==o&&"1"!==o)return o;const h=csString.prototype.split.call(window.location.hostname,".");let c=csArray.prototype.pop.call(h);for(;h.length&&(null===o||"1"===o);)c=csArray.prototype.join.call([csArray.prototype.pop.call(h),c],"."),e(r,c,c,void 0,t,i),o=s(r);return n(r,c),c}}(Es||(Es={})),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}}(As||(As={})),function(t){t.None="None",t.Lax="Lax",t.NotSet="X"}(_s||(_s={})),function(t){t[t.Yes=1]="Yes",t[t.No=0]="No"}(Rs||(Rs={}));class Ss{constructor(t,s,e){this.L=t,this.it=s,this.nt=e,this.ot=!1,this.ht=_s.NotSet,this.ut=Rs.No}getSameSiteFlag(){return this.ht}getSecureFlag(){return this.ut}getDomain(){return this.lt}getRootDomain(){return this.ft}init(){if(this.L.cookielessTrackingEnabled)return;const t=this.vt(),s=this.wt();this.ot=this.gt(t,s),this.ot?(this.ht=t,this.ut=s):this.L.secureCookiesEnabled&&"https:"===this.it.getUrlProtocol()&&(this.ut=Rs.Yes),this.ft=this.yt(),this.lt=this.Et(this.ft)}gt(t,s){return!As.browserIsSafariV12()&&(Es.set(Ss.COOKIE_TEST_FOR_SAME_SITE,"Test same site",Ss.CURRENT_DOMAIN,void 0,t,s),!!Es.get(Ss.COOKIE_TEST_FOR_SAME_SITE)&&(Es.remove(Ss.COOKIE_TEST_FOR_SAME_SITE,Ss.CURRENT_DOMAIN),!0))}vt(){return"http:"===this.it.getUrlProtocol()?_s.Lax:this.nt.isSameSiteNoneSecureNeeded()||this.L.crossDomainTracking?_s.None:_s.Lax}wt(){return"http:"===this.it.getUrlProtocol()?Rs.No:this.L.secureCookiesEnabled||this.L.crossDomainTracking||this.nt.isSameSiteNoneSecureNeeded()?Rs.Yes:Rs.No}isSameSiteSupported(){return this.ot}set(t,s,e){const i=Es.toExpireDate(e);Es.set(t,s,this.lt,i,this.getSameSiteFlag(),this.getSecureFlag())}get(t){const s=new csRegExp(`(^|;)[ ]*${t}=([^;]*)`).exec(document.cookie);return s?decodeURIComponent(s[2]):null}delete(t,s){const e=s||this.lt;Es.remove(t,e)}yt(){const t=this.nt.isSameSiteNoneSecureNeeded()&&this.isSameSiteSupported(),s=t?_s.None:void 0,e=t?Rs.Yes:void 0;return Es.getRootDomain(s,e)}Et(t){return this.L.allowSubdomains?t:Es.CURRENT_DOMAIN}}Ss.CURRENT_DOMAIN="CURRENT_DOMAIN",Ss.COOKIE_TEST_FOR_SAME_SITE="_cs_same_site";const Ts="_cs_t";class Is{constructor(t,s){this.At=t,this.L=s,this._t=!1,this.Rt=!1}init(){if(!this.L.cookielessTrackingEnabled&&this.At.isTopWindowTracker()&&"cookie"in document){if(!this.At.isInIframeContext()&&Es.isCookiePresent())return this._t=!0,void(this.Rt=!1);if(Es.set(Ts,"1",Es.CURRENT_DOMAIN),null!==Es.get(Ts))return this._t=!0,this.Rt=!1,void Es.remove(Ts,Es.CURRENT_DOMAIN);Es.set(Ts,"1",Es.CURRENT_DOMAIN,void 0,_s.None,Rs.Yes),null!==Es.get(Ts)&&(this._t=!0,this.Rt=!0,Es.remove(Ts,Es.CURRENT_DOMAIN))}}areCookiesEnabled(){return this._t}isSameSiteNoneSecureNeeded(){return this.Rt}}class Ps{constructor(t,s){this.L=t,this.nt=s}canTrack(){return this.L.isProjectActive()&&this.St()&&this.Tt()&&this.It()}canTrackInChild(){return this.L.isProjectActive()&&this.Pt()&&(this.Tt()||this.bt())}It(){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.nt.areCookiesEnabled()}Tt(){return jt(window.location.hostname,this.L.hostnames)}St(){return!this.Vt()&&this.Ct()}Pt(){return!this.Vt()&&this.kt()}bt(){return z(window.location.href,"about:srcdoc")&&"about:"===window.location.protocol&&""===window.location.hostname}Vt(){return"visibilityState"in document&&"prerender"===document.visibilityState}Ct(){return this.Ot()&&this.Nt()}kt(){return this.Ot()}Nt(){try{return!!window.localStorage}catch{return!1}}Ot(){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 bs{constructor(t){this.xt=!1,this.$t=new Map,this.Lt=new Map,this.Mt=new Map,this.Dt="CS_WORKER_SIGNATURE";const s=`\n const algorithm = ${t.algorithm};\n const compressor = (${t.getCompressorSourceCode()})();\n (()=>{"use strict";var e;!function(e){e.UNCOMPRESSED="0",e.GZIP="2"}(e||(e={}));let t={debug(...e){},warn(...e){},error(...e){},critical(...e){},isPerfLoggingActive:()=>!1};class s{constructor(e){var t;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.mandatoryParameters=null!==(t=e.mandatoryParameters)&&void 0!==t?t:[],this.worker=!!e.worker,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(s,r){const a=r||{...this.queryParams},o=!("ct"in a),i="string"!=typeof s&&!this.isArrayBuffer(s);"ct"in a||(this.compressionOpts&&o?a.ct=this.compressionOpts.compressionType:a.ct=e.UNCOMPRESSED);const n=i?JSON.stringify(s):s,h=Object.keys(a).map((e=>\`\${encodeURIComponent(e)}=\${encodeURIComponent(a[e])}\`)).join("&"),c=\`\${this.endpoint}?\${h}\`;!function(e,t){const s=e.length;for(let r=0;rnull==a[e]))?this.compressionOpts&&o&&"string"==typeof n?this.compressionOpts.compressor(n,this.compressionOpts.compressionOutputType,(e=>this.doSend(c,a,e))):this.doSend(c,a,n):t.warn(\`[\${this.worker?"WORKER":"MAIN"}] All mandatory parameters are not present on \${c}\`)}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]}}var o;!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"}(o||(o={}));class i{constructor(e,t,s){this.storageName=e,this.onOpenError=s,this.cacheState=o.NOT_STARTED,this.toBeSavedBuffer=[],this.recoveryInProgress=0,this.origin=self.origin,this.context="object"==typeof window?"":"worker-",this.byteSizeCounter=new r(t),this.init()}async init(){await this.openCache(),this.cacheState===o.READY?this.flushToBeSavedBuffer():this.onOpenError(this.toBeSavedBuffer)}flushToBeSavedBuffer(){this.toBeSavedBuffer.forEach((e=>{this.save(e)})),this.toBeSavedBuffer=[]}async save(e){try{if(this.cacheState===o.OPEN_IN_PROGRESS)return void this.toBeSavedBuffer.push(e);if(this.cacheState!==o.READY)return;if(this.byteSizeCounter.isThresholdReached())return;const{key:t,metadata:s,events:r}=e;if(this.byteSizeCounter.addString(t),"string"==typeof r?this.byteSizeCounter.addString(r):this.byteSizeCounter.addArrayBuffer(r),this.byteSizeCounter.isThresholdReached())return;await this.cache.put(\`\${this.origin}/\${t}\`,new Response(r,{headers:s}))}catch{}}async recover(e){(this.cache||(await this.openCache(),this.cacheState===o.READY))&&this.doRecover(e)}async openCache(){try{this.cacheState=o.OPEN_IN_PROGRESS,this.cache=await self.caches.open(\`\${this.context}\${this.storageName}\`),this.cacheState=o.READY}catch{this.cacheState=o.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 n{constructor(e){try{this.initializeStorageStrategy(e)}catch(e){this.setRamStorageStrategy()}}initializeStorageStrategy(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 i(e,n.MAX_SIZE,(e=>{this.setRamStorageStrategy(e)}))}setRamStorageStrategy(e){this.storageStrategy=new a(n.MAX_SIZE),e&&e.forEach((e=>{this.storageStrategy.save(e)}))}}n.MAX_SIZE=16777216,function(){const e="CS_WORKER_SIGNATURE",t=new Map,r=new n("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,mandatoryParameters:h}=a,c={endpoint:o,mandatoryParameters:h,worker:!0};i&&(c.compressionOpts={compressor,compressionOutputType:i,compressionType:algorithm}),n&&(c.recoveryStorage=r);const d=new s(c);t.set(o,d),d.onLoad((t=>{const s={type:"onLoad",endpoint:o,response:t,WORKER_SIGNATURE:e};self.postMessage(s)})),d.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.Ut=this.Bt(s),this.xt=!0,this.Ft()&&(this.qt=new ReadableStream({start:t=>{this.Ht=t}}),this.Ut.postMessage(this.qt,[this.qt]),this.postMessage=this.postMessageAsTransferable)}catch(t){this.xt=!1}}postMessage(t){t.WORKER_SIGNATURE=this.Dt,this.Ut.postMessage(t)}postMessageAsTransferable(t){t.WORKER_SIGNATURE=this.Dt,this.Ht.enqueue(t)}Bt(t){const s=window.csURL||window.webkitURL,e=window.Blob,i=window.Worker,n=new e([t],{type:"application/javascript"}),r=s.createObjectURL(n);es.whiteListFilename(r);const o=new i(r);return o.onmessage=t=>{const{type:s,endpoint:e,WORKER_SIGNATURE:i}=t.data;if(i===this.Dt)if("onLoad"===s){const{response:s}=t.data,i=this.$t.get(e);i&&i(s)}else if("onError"===s){const{response:s}=t.data,i=this.Lt.get(e);i&&i(s)}else if("onTimeout"===s){const t=this.Mt.get(e);t&&t()}},o}registerOnLoadCallback(t,s){this.$t.set(t,s)}registerOnErrorCallback(t,s){this.Lt.set(t,s)}registerOnTimeoutCallback(t,s){this.Mt.set(t,s)}isSupported(){return this.xt}Ft(){try{const t=new ReadableStream;return structuredClone(t,{transfer:[t]}),!0}catch{return!1}}}class Vs{constructor(t){var s;this.zt={},this.jt=t.endpoint,this.Gt=t.networkWorker,this.Zt=t.compressionOutputType,this.Wt=t.useRetry,this.Gt.postMessage({type:"CreatePostRequest",endpoint:this.jt,compressionOutputType:this.Zt,useRetry:this.Wt,mandatoryParameters:null!==(s=t.mandatoryParameters)&&void 0!==s?s:[]})}setQueryParams(t){this.Gt.postMessage({type:"SetQueryParams",endpoint:this.jt,queryParams:t}),csArray.prototype.forEach.call(Object.keys(t),(s=>{this.zt[s]=t[s]}))}getQueryParams(){return this.zt}removeQueryParams(t){this.Gt.postMessage({type:"RemoveQueryParams",endpoint:this.jt,queryParams:t}),t&&csArray.prototype.forEach.call(t,(t=>{delete this.zt[t]}))}send(t,s){this.Gt.postMessage({type:"Send",endpoint:this.jt,payload:t,queryParams:s})}abort(){this.Gt.postMessage({type:"Abort",endpoint:this.jt})}onLoad(t){this.Gt.registerOnLoadCallback(this.jt,t)}onError(t){this.Gt.registerOnErrorCallback(this.jt,t)}setRequestHeader(t,s){this.Gt.postMessage({type:"SetHeader",endpoint:this.jt,headerName:t,headerValue:s})}onTimeout(t,s){this.Gt.registerOnTimeoutCallback(this.jt,t),this.Gt.postMessage({type:"SetTimeout",endpoint:this.jt,timeout:s})}}var Cs;!function(t){t.UNCOMPRESSED="0",t.GZIP="2"}(Cs||(Cs={}));class ks{constructor(t){this.onError=t}}function Os(t){var s;const e=null!==(s=t.length)&&void 0!==s?s:0,i=new csArray(e);for(let s=0;scsArray.prototype.push.call(e,t))),e}function $s(t,s){if(t.length>=0){const e=t.length;for(let i=0;icsArray.prototype.push.call(e,s?[i,t]:t))),e}class Fs{constructor(t){var s;this.zt={},this.Jt={},this.Kt=t=>{for(const s of t){const{metadata:t,events:e}=s;this.send(e,t)}},this.jt=t.endpoint,this.Yt=t.compressionOpts,this.Qt=t.recoveryStorage,this.mandatoryParameters=null!==(s=t.mandatoryParameters)&&void 0!==s?s:[],this.worker=!!t.worker,this.Qt&&this.Qt.recover(this.Kt)}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 e=s||{...this.zt},i=!("ct"in e),n="string"!=typeof t&&!this.Xt(t);"ct"in e||(this.Yt&&i?e.ct=this.Yt.compressionType:e.ct=Cs.UNCOMPRESSED);const r=n?JSON.stringify(t):t,o=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&"),h=`${this.jt}?${o}`;Ms(this.mandatoryParameters,(t=>null==e[t]))?is.warn(`[${this.worker?"WORKER":"MAIN"}] All mandatory parameters are not present on ${h}`):this.Yt&&i&&"string"==typeof r?this.Yt.compressor(r,this.Yt.compressionOutputType,(t=>this.ss(h,e,t))):this.ss(h,e,r)}onLoad(t){this.es=t}onError(t){this.ns=t}onTimeout(t,s){this.rs=t,this.hs=s}abort(){this.cs&&this.cs()}setRequestHeader(t,s){this.Jt[t]=s}getQueryParams(){return this.zt}Xt(t){return t&&void 0!==t.byteLength}ss(t,s,e){const i=new XMLHttpRequest,n=Object.keys(s).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(s[t])}`)).join("&");i.open("POST",t),i.onload=()=>{if(this.Qt&&this.Qt.recover(this.Kt),this.es){const t={params:s,responseText:i.responseText,status:i.status};this.es(t)}},i.onerror=()=>{this.Qt&&this.Qt.save({key:n,metadata:s,events:e}),this.ns&&this.ns({params:s})},this.hs&&this.rs&&(i.timeout=this.hs,i.ontimeout=()=>{this.rs()}),this.cs=()=>i.abort(),Object.keys(this.Jt).forEach((t=>{i.setRequestHeader(t,this.Jt[t])})),i.send(e)}}class qs{constructor(t){this.us=t,this.Gt=new bs(this.us)}create(t,s,e,i,n=[]){if(this.Gt.isSupported()&&s)return new Vs({networkWorker:this.Gt,endpoint:t,compressionOutputType:e,useRetry:!!i,mandatoryParameters:n});{const s=e?{compressor:this.us.compress,compressionOutputType:e,compressionType:this.us.algorithm}:void 0;return new Fs({endpoint:t,compressionOpts:s,recoveryStorage:i})}}}class Hs{constructor(t,s,e,i,n){this.W=t,this.J=s,this.ls=e,this.ds=i,this.L=n}get(){return{exclusion:this.ls.getAppliedTrackingDraw(),visitor:this.W.getVisitor(),session:this.J.getSession(),cvars:this.ds.getCustomVariablesSession()}}apply(t){t&&(t.exclusion?this.exclude():this.include(t))}exclude(){this.ls.exclude(this.L),this.W.removeVisitor(),this.J.removeSession(),this.ds.removeCustomVariablesSession()}include(t){this.ls.removeExclusion(),this.W.setVisitor(t.visitor),t.session?this.J.setSession(t.session):this.J.removeSession(),t.cvars?this.ds.setCustomVariableSession(t.cvars):this.ds.removeCustomVariablesSession()}}function zs(t,s,e,i){var n,r=arguments.length,o=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(n=t[h])&&(o=(r<3?n(o):r>3?n(s,e,o):n(s,e))||o);return r>3&&o&&Object.defineProperty(s,e,o),o}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var js,Gs;function Zs(t,s=Ks.SHOW_ALL){const e=s|Ks.SHOW_ELEMENT,i=[document.createTreeWalker(t,e,null,!1)];let n=Ws(t);n&&csArray.prototype.push.call(i,document.createTreeWalker(n,e,null,!1));let r=null;return{root:t,nextNode(){if(n){const t=n;return n=null,t}for(;i.length>0;){if(r){const t=r;return r=null,t}const t=i[i.length-1].nextNode();if(!t){csArray.prototype.pop.call(i);continue}const n=Ws(t);if(s&Ks.SHOW_DOCUMENT_FRAGMENT&&n&&(r=n),n&&csArray.prototype.push.call(i,document.createTreeWalker(n,e,null,!1)),Ys[t.nodeType]&s)return t}return null},visitAll(e){Ys[t.nodeType]&s&&e(t);let i=this.nextNode();for(;i;)Ys[i.nodeType]&s?(e(i),i=this.nextNode()):i=this.nextNode()},collectAll(t){const s=[];return this.visitAll((e=>csArray.prototype.push.call(s,t?t(e):e))),s}}}function Ws(t){return t&&T(t)?t.shadowRoot:null}const Js=null!==(js=Ut.Node)&&void 0!==js?js:{},Ks=null!==(Gs=Ut.NodeFilter)&&void 0!==Gs?Gs:{},Ys={2:Ks.SHOW_ATTRIBUTE,4:Ks.SHOW_CDATA_SECTION,8:Ks.SHOW_COMMENT,11:Ks.SHOW_DOCUMENT_FRAGMENT,9:Ks.SHOW_DOCUMENT,10:Ks.SHOW_DOCUMENT_TYPE,1:Ks.SHOW_ELEMENT,[Js.ENTITY_NODE]:Ks.SHOW_ENTITY,[Js.ENTITY_REFERENCE_NODE]:Ks.SHOW_ENTITY_REFERENCE,[Js.NOTATION_NODE]:Ks.SHOW_NOTATION,7:Ks.SHOW_PROCESSING_INSTRUCTION,3:Ks.SHOW_TEXT};function Qs(){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 e=function(t){return t.length>0?Xs(t[0]):""}(s);return""===e?"":(s=function(t,s){return csArray.prototype.filter.call(t,(t=>-1===csString.prototype.indexOf.call(t,s)))}(s,e),0===s.length?"":Xs(s[0]))}function Xs(t){let s,e="";var i;i=t,s=-1!==csString.prototype.indexOf.call(i,"@")?new csRegExp("@(.+):(\\d+):(\\d+)$"):new csRegExp("\\((.+):(\\d+):(\\d+)\\)");const n=s.exec(t);return n&&(e=n[1]),e}const te=t=>t;function se({target:t,methodName:s,hook:e,hookPrepareArgs:i=te,options:n}){var r;if(!(null===(r=Object.getOwnPropertyDescriptor(t,s))||void 0===r?void 0:r.writable))return is.warn(`Cannot intercept read only function '${csString(s)}' of object '${t}'`),null;let o=!1;const h=t[s];if("function"==typeof h){const r=function(){const t=i(arguments),s=h.apply(this,arguments);if(o){let i;n&&n.withCallerName&&(i=Qs());try{e({result:s,context:this,args:t,callerName:i})}catch(t){is.error(t)}}return s};a=h,(c=r).prototype=a.prototype,Object.defineProperty(c,"toString",{value:()=>a.toString()}),t[s]=r}var c,a;return{activate:()=>o=!0,deactivate:()=>o=!1}}function ee(t,s,e){let i=!1;const n=Object.getOwnPropertyDescriptor(t,s);if(n){if(!n.configurable)return is.warn(`Cannot intercept read only property '${csString(s)}' of object '${t}'`),null;const r=function(){const t=arguments,r=this[s],o=n.set.apply(this,t);if(i)try{e(this,t[0],r)}catch(t){is.error(t)}return o};Object.defineProperty(t,s,{set:r})}return{activate:()=>i=!0,deactivate:()=>i=!1}}var ie,ne;!function(t){t.isSupported=function(){return!!Element.prototype.attachShadow},t.getShadowRoot=function(t){return t&&T(t)?t.shadowRoot:null},t.getAllShadowHosts=ws((function(t){return Zs(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).collectAll((t=>t.host))}),"getAllShadowHosts")}(ie||(ie={}));class re{static fs(t){this.ps.forEach((s=>{t(s,"initial")}))}static vs(t){if(csArray.prototype.push.call(this.ws,t),!this.gs){this.gs=!0,this.ys.observe(document,this.Es);for(const t of ie.getAllShadowHosts(document)){const s=csElementshadowRoot.apply(t);this.ps.add(s),this.ys.observe(s,this.Es)}this.As||(this.As=se({target:Element.prototype,methodName:"attachShadow",hook:t=>t.result.isConnected&&this._s(t.result)})),this.As.activate()}this.fs(t)}static Rs(t){var s;this.ws=csArray.prototype.filter.call(this.ws,(s=>s!==t)),0===this.ws.length&&(this.ws=[],this.gs=!1,this.ys.disconnect(),null===(s=this.As)||void 0===s||s.deactivate(),this.ps.clear())}constructor(t){this.Ss=t,this.Ss=rs("DocumentShadowRootObserver:callback",((s,e)=>t(s,e)))}get shadowRoots(){return Bs(ne.ps)}takeRecords(){var t,s;return null!==(s=null===(t=ne.ys)||void 0===t?void 0:t.takeRecords())&&void 0!==s?s:[]}observe(){ie.isSupported()&&ne.vs(this.Ss)}disconnect(){ie.isSupported()&&ne.Rs(this.Ss)}}ne=re,re.ws=[],re.ps=new Set,re.gs=!1,re.Es={childList:!0,subtree:!0},re.ys=new csMutationObserver((t=>{for(const s of t)s.target.isConnected&&$s(s.addedNodes,ne.Ts),$s(s.removedNodes,ne.Is)})),re._s=t=>{ne.ps.has(t)||(ne.ys.observe(t,ne.Es),ne.ps.add(t),$s(ne.ws,(s=>s(t,"added"))))},re.Ts=t=>{Zs(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).visitAll(ne._s)},re.Is=t=>{t.isConnected||Zs(t,NodeFilter.SHOW_DOCUMENT_FRAGMENT).visitAll((t=>{ne.ps.has(t)&&(ne.ps.delete(t),$s(ne.ws,(s=>s(t,"removed"))))}))},zs([ns()],re.prototype,"observe",null),zs([ns()],re.prototype,"disconnect",null);function oe(t,s=true){t.boundElement.addEventListener(t.type,t.listener,s)}function he(t,s=true){t.boundElement.removeEventListener(t.type,t.listener,s)}function ce(t,s=0){const e=Math.pow(10,s);return Math.round(t*e)/e}function ae(t,s){"number"==typeof s&&(s={wait:s});const e=s.wait;if(s.ignoreThrottledCalls){let s=0;return function(...i){const n=It.now();if(n-s>e)return s=n,t.apply(this,i)}}let i,n,r=[],o=null,h=0;const c=()=>{h=It.now(),o=null,n=t.apply(i,r)},a=function(...s){const a=It.now(),u=e-(a-h);return i=null!=this?this:window,r=[...s],u<=0||u>e?(h=a,n=t.apply(i,r),o?(window.csClearTimeout(o),o=null):r=[]):o||(o=window.csSetTimeout(c,u)),n};return a.cancel=()=>{o&&(window.csClearTimeout(o),h=0,o=null,r=[])},a.flushPending=()=>{o&&(window.csClearTimeout(o),c())},a}var ue,le,de,fe,pe,ve;function me(t){const s=csEventtarget.apply(t);return s&&l(s)&&csElementshadowRoot.apply(s)&&t.composedPath?t.__csOriginalTarget||t.composedPath()[0]:s}!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",t[t.STYLESHEET_RULE_UPDATE=76]="STYLESHEET_RULE_UPDATE",t[t.ADOPTED_STYLESHEET_RULE_UPDATE=77]="ADOPTED_STYLESHEET_RULE_UPDATE",t[t.DEBUG=999]="DEBUG"}(ue||(ue={})),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"}(le||(le={})),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"}(de||(de={})),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"}(fe||(fe={})),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"}(pe||(pe={})),function(t){t[t.COPY=0]="COPY",t[t.CUT=1]="CUT",t[t.PASTE=2]="PASTE"}(ve||(ve={}));const we=!!window.chrome,ge="data-cs-scroll-container";var ye;!function(t){t.isEventOnScrollContainer=function(t){return!!(_t(t)&&function(t){try{if(_t(csEventtarget.apply(t)))return!0}catch{}return!1}(t)&&St(csEventtarget.apply(t))&&null!==csEventtarget.apply(t).getAttribute(ge))},t.getScrollContainer=function(){return window.csquerySelector[document.nodeType].call(document,`[${ge}]`)}}(ye||(ye={}));const Ee=function(){const t=csSymbol.for("propStore");return{getStore:s=>s[t],get(s,e){const i=s[t];return null==i?void 0:i[e]},set(s,e,i){let n=s[t];n||(n={},s[t]=n),n[e]=i}}}();var Ae;!function(t){function s(t,e,i){let n=!1;if(i(t,e,(()=>n=!0)),n)return;const r=t.shadowRoot;r&&s(r,t,i);const o=t.children;if(null==o?void 0:o.length)for(const e of o)if(e&&(s(e,t,i),n))break}t.setProperty=function(t,s,e){var i;t instanceof Node?Ee.set(t,s,e):(null!==(i=t.props)&&void 0!==i||(t.props={}),t.props[s]=e)},t.getProperty=function(t,s){var e;return t instanceof Node?Ee.get(t,s):null===(e=t.props)||void 0===e?void 0:e[s]},t.getProperties=function(t){return t instanceof Node?Ee.getStore(t):t.props},t.traverse=function(t,e){s(t,void 0,e)}}(Ae||(Ae={}));let _e=1,Re=csSymbol("nodeIdentifier");function Se(t){const s=Ae.getProperty(t,Re);return null!=s?s:(Ae.setProperty(t,Re,_e++),Ae.getProperty(t,Re))}var Te;const Ie=null!==(Te=Ut.Element)&&void 0!==Te?Te:{prototype:{}},Pe=window.csElementmatches||window.csElementmatchesSelector||window.csElementmozMatchesSelector||window.csElementmsMatchesSelector||window.csElementoMatchesSelector||window.csElementwebkitMatchesSelector,be=Ie.prototype.closest,Ve=document.createElement("div");function Ce(t){if(!(!!t&&yt(t)))return is.warn(`isValidSelector: invalid selector provided '${t}'`),!1;try{return Pe.call(Ve,t),!0}catch{return is.warn(`isValidSelector: invalid selector provided '${t}'`),!1}}function ke(t,s){if(be)return be.call(t,s);let e=t;do{if(Pe.call(e,s))return e;e=null==e?void 0:e.parentElement}while(null!==e&&1===e.nodeType);return null}var Oe;!function(t){let s;!function(t){t[t.NotMasked=0]="NotMasked",t[t.Parent=1]="Parent",t[t.Child=2]="Child"}(s=t.MaskedElementState||(t.MaskedElementState={})),t.maskedProp="masked",t.maskedAttributeProp="maskedAttribute",t.isSelectorUserInput=function(t){return!!(Et(t)&&"Attributes"in t&&"PIISelectors"in t)&&(t.Attributes instanceof Array&&t.PIISelectors instanceof Array)},t.sanitizeSelectorUserInput=function(t){return"Attributes"in t||(t.Attributes=[]),"PIISelectors"in t||(t.PIISelectors=[]),t},t.getMaskedElementDetails=function(e){var i;return null!==(i=Ae.getProperty(e,t.maskedProp))&&void 0!==i?i:{state:s.NotMasked}},t.getMaskedAttributeDetails=function(s){var e;return null!==(e=Ae.getProperty(s,t.maskedAttributeProp))&&void 0!==e?e:{attributes:[]}},t.isMaskedElement=function(e){const i=Ae.getProperty(e,t.maskedProp);return(null==i?void 0:i.state)===s.Parent},t.isMaskedElementChild=function(e){const i=Ae.getProperty(e,t.maskedProp);return(null==i?void 0:i.state)===s.Child},t.isMaskedAttribute=function(s,e){const i=Ae.getProperty(s,t.maskedAttributeProp);return(null==(null==i?void 0:i.attributes)?void 0:csArray.prototype.indexOf.call(null==i?void 0:i.attributes,e))>-1},t.setMaskedElementProperty=function(s,e){Ae.setProperty(s,t.maskedProp,e)},t.unsetMaskedElementProperty=function(s){Ae.setProperty(s,t.maskedProp,void 0)},t.setMaskedAttributeProperty=function(s,e){Ae.setProperty(s,t.maskedAttributeProp,e)},t.getComputedSelectorSettings=function(t,s){const e=csArray.prototype.filter.call(t.PIISelectors,(t=>Ce(t)));s.elementSelector.length>0&&csArray.prototype.push.call(e,...csString.prototype.split.call(s.elementSelector,","));const i=function(t){if(t.length<=1)return t;const s=[];for(const e of t){const t=csString.prototype.split.call(e,",");for(const e of t)-1===csArray.prototype.indexOf.call(s,e)&&csArray.prototype.push.call(s,e)}return s}([...e]),n={elementSelector:csArray.prototype.join.call(i,","),attrSelector:s.attrSelector,attrSelectors:s.attrSelectors};return csArray.prototype.forEach.call(t.Attributes,(t=>{(null==t?void 0:t.attrName)&&(null==t?void 0:t.selector)&&Ce(t.selector)&&!function(t,s){return csArray.prototype.some.call(t,(t=>t.selector===s.selector&&t.attrName===s.attrName))}(n.attrSelectors,t)&&csArray.prototype.push.call(n.attrSelectors,t)})),n.attrSelector=function(t){let s="";return csArray.prototype.forEach.call(t,(t=>{const e=csString.prototype.split.call(t.selector,",");csArray.prototype.forEach.call(e,(t=>{Ce(t)&&(s&&(s+=","),s+=t)}))})),s}(n.attrSelectors),n}}(Oe||(Oe={}));class Ne{constructor(){this.Ps=[],this.bs=[{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.Vs=[{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.Cs=[{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.ks=[{type:"scroll",listener:t=>this.scrollListener(csEventtarget.apply(t))}];const t=function(t){if(!yt(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.ks,{type:"mouseover",listener:t=>this.mouseOverListener(t)}),this.Os=new re(((t,s)=>{switch(s){case"initial":case"added":this.Ns(t);break;case"removed":this.xs(t)}}))}init(){this.$s(),this.Ls(),this.Ms()}onEvent(t){csArray.prototype.push.call(this.Ps,t)}Ds(t,s=!1){csArray.prototype.forEach.call(this.Ps,(e=>e(t,s)))}start(){this.Us(),this.Ns(document),this.Os.observe()}stop(){this.xs(document),this.Os.disconnect()}Ls(){this.Bs()&&csArray.prototype.push.call(this.Cs,...this.bs)}$s(){this.Fs()&&csArray.prototype.push.call(this.Cs,...this.Vs)}Ns(t){R(t)?csArray.prototype.forEach.call(this.Cs,(t=>oe(t))):csArray.prototype.forEach.call(this.ks,(s=>{oe({type:s.type,listener:s.listener,boundElement:t})}))}xs(t){R(t)?csArray.prototype.forEach.call(this.Cs,(t=>he(t))):csArray.prototype.forEach.call(this.ks,(s=>{he({type:s.type,listener:s.listener,boundElement:t})}))}Bs(){return"PointerEvent"in window&&"function"==typeof window.PointerEvent}Fs(){return"TouchEvent"in window&&"function"==typeof window.TouchEvent}Us(){this.qs()}qs(){const t=ye.getScrollContainer()||document,s=Se(t),e=this.Hs(t);if(0!==e.top||0!==e.left){const t={type:ue.SCROLL,args:[s,e.left,e.top],date:It.now()};this.Ds(t,!0)}}Hs(t){return t===document?{top:window.pageYOffset,left:window.pageXOffset}:{top:t.scrollTop,left:t.scrollLeft}}scrollListener(t){if(Oe.isMaskedElement(t)||Oe.isMaskedElementChild(t))return;const s=Se(t),e=this.Hs(t),i={type:ue.SCROLL,args:[s,e.left,e.top],date:It.now()};this.Ds(i)}mouseOverListener(t){if(Oe.isMaskedElementChild(t.target))return;const s=Se(t.target),e={type:ue.MOUSE_OVER,args:[s],date:It.now()};this.Ds(e)}clickListener(t){const s=me(t);if(Oe.isMaskedElementChild(s))return;const e=Se(s),i={type:ue.CLICK,args:[e],date:It.now()};this.Ds(i)}keyUpListener(t){const s=me(t);if(Oe.isMaskedElementChild(s))return;const e=Se(s),i=this.zs[t.key];if(void 0===i)return;const n={type:ue.KEY_UP,args:[e,i],date:It.now()};this.Ds(n)}keyDownListener(t){const s=me(t);if(Oe.isMaskedElementChild(s))return;const e=Se(s),i=this.zs[t.key];if(void 0===i)return;const n={type:ue.KEY_DOWN,args:[e,i],date:It.now()};this.Ds(n)}copyListener(t){const s=me(t);if(Oe.isMaskedElementChild(s))return;const e=Se(s),i={type:ue.CLIPBOARD_COMMAND,args:[e,ve.COPY],date:It.now()};this.Ds(i)}cutListener(t){const s=me(t);if(Oe.isMaskedElementChild(s))return;const e=Se(s),i={type:ue.CLIPBOARD_COMMAND,args:[e,ve.CUT],date:It.now()};this.Ds(i)}pasteListener(t){const s=me(t);if(Oe.isMaskedElementChild(s))return;const e=Se(s),i={type:ue.CLIPBOARD_COMMAND,args:[e,ve.PASTE],date:It.now()};this.Ds(i)}pointerUpListener(t){const s=me(t);if(Oe.isMaskedElementChild(s))return;const e=Se(s),i={type:ue.POINTER_UP,args:[t.pointerId,t.pointerType,ce(t.clientX,1),ce(t.clientY,1),e,t.button],date:It.now()};this.Ds(i)}pointerMoveListener(t){const s={type:ue.POINTER_MOVE,args:[t.pointerId,t.pointerType,ce(t.clientX,1),ce(t.clientY,1)],date:It.now()};this.Ds(s)}pointerDownListener(t){const s=me(t);if(Oe.isMaskedElementChild(s))return;const e=Se(s),i={type:ue.POINTER_DOWN,args:[t.pointerId,t.pointerType,ce(t.clientX,1),ce(t.clientY,1),e,t.button,{pageX:ce(t.pageX,1),pageY:ce(t.pageY,1)}],date:It.now()};this.Ds(i)}touchStartListener(t){if(!t.changedTouches)return;const{changedTouches:s}=t;for(let t=0;t{const i=e.value;return i&&(e.value=function(t){if(me(t)===csEventtarget.apply(t))return i.call(this,t)}),e}],Ne.prototype,"mouseOverListener",null),ys([ns("click"),hs()],Ne.prototype,"clickListener",null),ys([ns("Event handler type: keyup")],Ne.prototype,"keyUpListener",null),ys([ns("Event handler type: keydown")],Ne.prototype,"keyDownListener",null),ys([ns("Event handler type: copy")],Ne.prototype,"copyListener",null),ys([ns("Event handler type: cut")],Ne.prototype,"cutListener",null),ys([ns("Event handler type: paste")],Ne.prototype,"pasteListener",null),ys([ns("Event handler type: pointerup"),hs()],Ne.prototype,"pointerUpListener",null),ys([ns("Event handler type: pointermove"),hs(),(xe={wait:33,ignoreThrottledCalls:!1},(t,s,e)=>{e.value=ae(e.value,xe)})],Ne.prototype,"pointerMoveListener",null),ys([ns("Event handler type: pointerdown"),hs()],Ne.prototype,"pointerDownListener",null),ys([ns("Event handler type: touchstart"),hs()],Ne.prototype,"touchStartListener",null),ys([ns("Event handler type: touchmove"),hs()],Ne.prototype,"touchMoveListener",null),ys([ns("Event handler type: touchend-cancel"),hs()],Ne.prototype,"touchEndCancelListener",null);class $e{constructor(t){this.js=t,this.Gs=0}addString(t){this.Gs+=2*t.length}addArrayBuffer(t){this.Gs+=t.byteLength}isThresholdReached(){return this.Gs>this.js}reset(){this.Gs=0}}class Le{constructor(t=[],s=512e3){this.Zs=t,this.Ws=new $e(s)}addEvent(t){this.Ws.addString(W(t)),csArray.prototype.push.call(this.Zs,t)}addEventByTimestamp(t){let s=0;for(;s=t.date)break}csArray.prototype.splice.call(this.Zs,s,0,t)}eventsCount(){return this.Zs.length}clearEvents(){this.Ws.reset(),this.Zs=[]}isFull(){return this.eventsCount()>=200}isThresholdReached(){return this.Ws.isThresholdReached()}getEvents(){return this.Zs}extractEvents(...t){const s=[],e=[];return csArray.prototype.forEach.call(this.Zs,(i=>{-1!==csArray.prototype.indexOf.call(t,i.type)?csArray.prototype.push.call(s,i):csArray.prototype.push.call(e,i)})),this.Zs=e,s}stringifyEvents(){return W(this.Zs)}Js(t){t.type===ue.INITIAL_DOM&&(window.CSDomSerialized=window.CSDomSerialized?window.CSDomSerialized+1:1)}}ys([gs("RecordingBatch.addEvent")],Le.prototype,"addEvent",null);class Me{constructor(){this.Ks=1}getCurrentIndex(){return this.Ks}increment(){this.Ks+=1}reset(){this.Ks=1}getRequestParameters(){return{ri:`${this.Ks}`}}}class De{emit(t,s,e,i=document){const n=`${void 0!==e?`${e}`:`${De.Ys}`}${t}`,r=De.createEvent(n,{detail:s});null!==r&&i.dispatchEvent(r)}static createEvent(t,s={}){if("function"==typeof CustomEvent)return new CustomEvent(t,s);const e=this.Qs();if(null===e)return null;const{bubbles:i=!1,cancelable:n=!1,detail:r}=s;return e.initCustomEvent(t,i,n,r),e}static Qs(){try{return document.createEvent("CustomEvent")}catch{return null}}}De.Ys="cs.tracking.";class Ue{constructor(){this._isStarted=!1}get isStarted(){return this._isStarted}start(...t){this._isStarted||(this._isStarted=!0,this.onStart(...t))}stop(){this._isStarted&&(this._isStarted=!1,this.onStop())}restart(){this.stop(),this.start()}}var Be,Fe,qe,He,ze;!function(t){t.ANALYTICS_ONLY="0",t.TEMPORARILY="T",t.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED="B",t.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN="W",t.RECORDING_GLOBAL_SAMPLING="5",t.RECORDING_URL_SAMPLING="6",t.RECORDING_ETR_SAMPLING="7",t.RECORDING_RULES_TARGETING="8"}(Be||(Be={})),function(t){t.ETR_OFF="0",t.ETR_ON="1"}(Fe||(Fe={})),function(t){t.ETR_LEGACY="0",t.ETR_SESSION="1",t.ETR_PAGE="2"}(qe||(qe={})),function(t){t.Visible="visible",t.Hidden="hidden",t.Blur="blur",t.PagehideVisible="pagehideVisible",t.PagehideHidden="pagehideHidden",t.ExitPageByNavigate="exitPageByNavigate"}(He||(He={}));class je{constructor(){this.Xs=!1,this.te=t=>{try{switch(t.type){case"visibilitychange":if("hidden"===document.visibilityState)return this.se(He.Hidden);break;case"pagehide":return"hidden"===document.visibilityState?this.se(He.PagehideHidden):this.se(He.PagehideVisible);case"blur":return this.se(He.Blur);case"navigate":return this.ee(t)?this.se(He.ExitPageByNavigate):void 0;default:return}}catch{}}}start(){this.Xs||(this.Xs=!0,this.ie(),this.ne(),this.re(),Vt()&&this.oe())}stop(){this.Xs&&(this.Xs=!1,this.he(),this.ce(),this.ae(),Vt()&&this.ue())}onEvent(t){this.se=t}oe(){window.navigation.addEventListener("navigate",this.te)}ue(){window.navigation.removeEventListener("navigate",this.te)}ie(){document.addEventListener("visibilitychange",this.te)}he(){document.removeEventListener("visibilitychange",this.te)}ne(){window.addEventListener("pagehide",this.te)}ce(){window.removeEventListener("pagehide",this.te)}re(){window.addEventListener("blur",this.te)}ae(){window.removeEventListener("blur",this.te)}ee(t){return t instanceof NavigateEvent!=!1&&(!t.hashChange&&!t.downloadRequest&&!t.formData)}}let Ge="null",Ze=null;const We=[];function Je(t){null==Ze||Ze.postMessage(t)}!!(null===(ze=document.body)||void 0===ze?void 0:ze.getAttribute("data-cs-tag-extension"))&&(window._uxa?_uxa.push(["debugEvents",!0]):window._uxa=[["debugEvents",!0]],Ze=new BroadcastChannel("cs-tag"),document.addEventListener("cs.tracking.recordingEvent",(t=>{Je({type:"UXA_EVENT",event:t.detail})})),Ze.addEventListener("message",(t=>{if("CONNECT"===t.data.type){if(t.data.sessionId===Ge)return;Ge=t.data.sessionId,csArray.prototype.forEach.call(We,(t=>t())),null==Ze||Ze.postMessage({type:"CONNECTED",sessionId:Ge})}})));class Ke{constructor(t,s=""){this.name=t,this.format=s}}class Ye extends Ke{constructor(t){super(t,"Value: {count}"),this.count=0}increase(t=1){this.count+=t}decrease(){this.count>0&&this.count--}clear(){this.count=0}getData(){return{count:this.count}}}class Qe extends Ke{constructor(t,s){super(t,"Value: {count}"),this.le=s}getData(){return{count:this.le()}}}class Xe extends Ke{constructor(t){super(t,"Living intances: {instances}
Added: {added}
Removed: {removed}"),this.added=0,this.removed=0}get value(){return this.added-this.removed}increase(){this.added++}decrease(){this.removed++}getData(){return{added:this.added,removed:this.removed,instances:this.added-this.removed}}}class ti extends Ke{constructor(t){super(t,"Count: {count}
Average: {average}ms
Total: {total}ms"),this.total=0,this.count=0}get average(){return this.count?this.total/this.count:0}measure(t){const s=It.now();t(),this.count++,this.total+=It.now()-s}asyncMeasure(){const t=csDate.now();return()=>{this.count++,this.total+=csDate.now()-t}}getData(){return{total:this.total,count:this.count,average:this.average}}}let si=0;const ei={general:{category:"General",nbEvents:new Ye("Nb of Events"),pendingTasks:new Ye("Pending Tasks"),pendingEvents:new Ye("Pending Tasks"),nbOfMutationObservers:new Xe("Nb of Mutation Observers"),push(t){this["perf"+si++]=t}},mutations:{category:"Mutations",initialDOM:new ti("Initial DOM"),pendingMutations:new Ye("Nb of Mutations scheduled"),serializedMutations:new ti("Serialized Mutations"),count:new Ye("Mutation Count"),elementMutationObserved:new Xe("Nb of Elements Observed by MutationObserver"),unobserveGarbageCollection:new ti("Unobserve GC")},visibilityObserver:{category:"Visibility Observer",hiddenElements:new Ye("Nb of Hidden Elements "),nbElements:new Ye("Nb of Elements")}};var ii,ni;ii=()=>{const t=t=>Object.keys(t),s=csArray.prototype.map.call(t(ei),(t=>ei[t])),e=csArray.prototype.map.call(s,(s=>csArray.prototype.filter.call(csArray.prototype.map.call(t(s),(t=>s[t])),(t=>t instanceof Ke)))),i=csArray.prototype.map.call(s,((t,s)=>({category:t.category,performanceCounters:csArray.prototype.map.call(e[s],(t=>({name:t.name,format:t.format})))})));Je({type:"UXA_PERFORMANCE_COUNTER_SCHEMA",event:i}),setInterval((()=>{const t=xs(Ns(e,(t=>Ns(t,(t=>t.getData())))),(t=>t));Je({type:"UXA_PERFORMANCE_COUNTER",event:t})}),1e3)},null!==Ge&&ii(),csArray.prototype.push.call(We,ii),function(t){t[t.Active=0]="Active",t[t.Paused=1]="Paused",t[t.Stopped=2]="Stopped"}(ni||(ni={}));class ri{constructor(t,s,e=[]){this.de=t,this.fe=s,this.pe=e,this.ve=null,this.we=ni.Active,this.ge=[]}reset(){this.ve=null,this.ge=[],this.we=ni.Active}disconnect(){this.we=ni.Stopped}ye(){this.fe(ni.Paused),this.we=ni.Paused,csSetTimeout((()=>{this.we===ni.Paused&&this.Ee()}),ri.STOP_TIMEOUT)}Ae(){this.fe(ni.Active),this.we=ni.Active,$s(this.ge,this.de),this.ge=[]}Ee(){this.ge=[],this.fe(ni.Stopped),this.we=ni.Stopped}pushEvent(t,s){if(s.isUserEvent&&(this.ve=t.date,this.we!==ni.Active))return this.Ae(),void this.de(t);if(this._e(t))this.de(t);else switch(this.we){case ni.Active:if(this.Re(t,s))return this.ye(),void csArray.prototype.push.call(this.ge,t);this.de(t);break;case ni.Paused:csArray.prototype.push.call(this.ge,t);case ni.Stopped:}}Re(t,s){return!s.isUserEvent&&null!==this.ve&&t.date-this.ve>ri.INACTIVITY_TIMEOUT}_e(t){return csArray.prototype.indexOf.call(this.pe,t.type)>-1}}ri.INACTIVITY_TIMEOUT=5e3,ri.STOP_TIMEOUT=5e3;function oi(t,s,e,i){var n,r=arguments.length,o=r<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(n=t[h])&&(o=(r<3?n(o):r>3?n(s,e,o):n(s,e))||o);return r>3&&o&&Object.defineProperty(s,e,o),o}Object.create;Object.create;function hi(t){return Ct(t,"data:")}function ci(t){return Ct(t,"#")}function ai(t){return!!t&&kt(t,".css")}function ui(t){const s=csString.prototype.trim.call(t);if(""===t)return[];let[e,i]=(n=s,csString.prototype.split.call(n,/\s(.+)/));var n;return i?(kt(e,",")||(i=function(t){return csString.prototype.split.call(t,/,(.+)/)[1]||""}(i)),[li(e),...ui(i)]):[li(e)]}function li(t){return csString.prototype.split.call(t,/,$/)[0]}const di=/(@import\s*("([^"]+)"|'([^']+)'))|(url\s*\(\s*((("([^"\]]+)"|'([^'\]]+)')\s*)|([^)\]]+))\))/g;function fi(t,s){const e=csString.prototype.replace.call(t,di,((...t)=>{const e=t[3]||t[4],i=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,e,i)=>{if("\\"===s)return csString.prototype.slice.call(t,1);if(i)return i;const n=parseInt(e,16);return 55296<=n&&n<=57343||0===n||n>1114111?"�":csString.fromCodePoint(n)}))}((e||i).trim());return`${e?"@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 e}function pi(t){const s=new Set;return fi(t,(t=>{var e,i;return s.add(null!==(i=null===(e=csString.prototype.match.call(t,/^["|'](.*)?["|']$/))||void 0===e?void 0:e[1])&&void 0!==i?i:t),t})),Bs(s)}const vi=new Map,mi=!Dt&&document.implementation.createHTMLDocument("");function wi(t){if(!m(t))return null;const s=gi(t);if(null===s||0===s.length)return null;let e="";if(function(t){const s=t.length;for(let e=0;ee+=t.cssText));else{const i=function(t){if(!mi)return 0;let s=vi.get(t.textContent);if(s)return s;const e=t.cloneNode(!0);e.textContent=t.textContent,mi.head.appendChild(e);const i=gi(e);return s=i?i.length:0,vi.set(t.textContent,s),mi.head.removeChild(e),s}(t);if(i===s.length)return null;const n=new csArray(s.length-i);for(let t=i,e=0;te+=t.cssText))}return e}function gi(t){try{if(t.disabled)return null;const s=t.sheet;return s?s.cssRules||s.rules:null}catch(t){if("SecurityError"!==t.name&&"InvalidAccessError"!==t.name)throw t;return null}}const yi=t=>t instanceof HTMLFormElement?"form":t.localName;class Ei{constructor(t){this.csId=Se(t),this.props=Ee.getStore(t)}}class Ai extends Ei{constructor(t){super(t),this.nodeType=3,this.data=t.data}}class _i extends Ei{constructor(t){var s;super(t),this.attributes=[],this.nodeType=1,this.localName=yi(t),this.namespaceURI=null!==(s=t.namespaceURI)&&void 0!==s?s:void 0,this.children=[];const e=wi(t);if(e){this.children=new csArray(csNodechildNodes.apply(t).length);const s=document.createTextNode(e),i=new Ai(s);csArray.prototype.push.call(this.children,i)}E(t)&&Ae.setProperty(this,"SVG",!0)}static isElement(t){return 1===t.nodeType}static getAttribute(t,s){return Ls(t.attributes,(t=>t.name===s))}static getAttributeValue(t,s){var e;return null===(e=this.getAttribute(t,s))||void 0===e?void 0:e.value}}class Ri{constructor(t){this.type="asyncEvent",this.Se=!1,t&&t((t=>this.resolve(t)))}resolve(t){if(this.Se)throw new Error("AsyncEvent already resolve.");null==t.timestamp&&(t={...t,timestamp:this.timestamp}),this.Te=t,this.Se=!0,this.Ss&&this.Ss(this.Te)}complete(t){this.Se&&t(this.Te),this.Ss=t}wait(){return new Promise((t=>this.complete(t)))}}let Si=(Ti="queueMicrotask",Ii=csSetTimeout,void 0!==Ut[Ti]?Ut[Ti]:Ii);var Ti,Ii;"object"==typeof window&&Rt(window.csQueueMicrotask)&&(Si=window.csQueueMicrotask);const Pi=new cs,bi=new cs;let Vi=1;function Ci(t,s="high"){const e=Vi;Pi.isEmpty&&bi.isEmpty&&ki((()=>{if(Vi!==e)return;const t=ws((()=>{for(;!bi.isEmpty;){bi.pop()()}for(;!Pi.isEmpty;){Pi.pop()()}bi.isEmpty||t()}),"groupMicrotask.run");t()}));const i=rs(`groupMicrotask:${s}:${t.name||t.toString()}`,t);"high"===s?bi.push(i):Pi.push(i)}function ki(t,s=10){Si(0===s?t:()=>ki(t,s-1))}async function Oi(t=1){for(let s=0;sCi(t)))}var Ni,xi;!function(t){function s(){const t=[i()];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 e(){return document.documentElement.scrollWidth}function i(){return window.innerHeight}function n(){return window.innerWidth}function r(){const t=window.csScreen.width;return gt(t)&&t>0?t:window.screen.width}function o(){const t=window.csScreen.height;return gt(t)&&t>0?t:window.screen.height}t.documentHeight=s,t.documentWidth=e,t.windowHeight=i,t.windowWidth=n,t.screenWidth=r,t.screenHeight=o,t.windowOffsetX=function(){return window.pageXOffset},t.windowOffsetY=function(){return window.pageYOffset},t.getRequestParameters=function(){return{dw:`${e()}`,dh:`${s()}`,ww:`${n()}`,wh:`${i()}`,sw:`${r()}`,sh:`${o()}`}}}(Ni||(Ni={}));const $i=null!==(xi=Ut.Node)&&void 0!==xi?xi:Object;var Li;function Mi(){const t=new Set;return{add(s){t.add(s),1===t.size&&csSetTimeout((()=>{t.clear()}))},has:s=>t.has(s),del(s){t.delete(s)},clear(){t.clear()},values:()=>Bs(t),get count(){return t.size}}}function Di(t,s=!1){const e=Mi();return{push(i){if(0===e.count){(s?Ci:csSetTimeout)((()=>{t(e.values()),e.clear()}))}e.add(i)}}}!function(t){const s="isConnected"in $i.prototype?t=>t.isConnected:t=>!(t.ownerDocument&&t.ownerDocument.compareDocumentPosition(t)&t.DOCUMENT_POSITION_DISCONNECTED);t.forEachChild=function(t,s){for(let e=t;e;e=csNodenextSibling.apply(e))s(t)},t.isConnected=function(t){return s(t)},t.getAncestors=function(t,s){const e=[];for(const n of i(t,s))csArray.prototype.push.call(e,n);return e};const e=(t,s)=>{var e;return null!==(e=csNodeparentNode.apply(t))&&void 0!==e?e:s&&S(t)?t.host:null};function*i(t,s=!1){let i=t;for(;i;){yield i;const t=e(i,s);if(!t||t===i)break;i=t}}function n(s){var e;return s.parentElement?s.parentElement:t.getRootNode(s)?null===(e=t.getRootNode(s))||void 0===e?void 0:e.host:null}function r(t){var s,e;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 is.warn(`SUP-11432: Element doesn't have getBoundingClientRect. Node: ${t instanceof $i} Ctor: ${null===(e=null==t?void 0:t.constructor)||void 0===e?void 0:e.name}`),!1;const s=t.getBoundingClientRect();if(0==s.width&&0==s.height)return!0}const i=window.getComputedStyle(t);if(!i)return!0;var n;return"none"===i.display||"hidden"===i.visibility||"collapse"===i.visibility||"0"===i.opacity||"opacity(0)"===i.filter||"0px"===i.width&&"0px"===i.height||("transparent"===(n=i.color)||/^(rgba|hsla)\(\d+, \d+%?, \d+%?, 0\)$/.test(n))}function o(t){const s=t.getBoundingClientRect(),e=s.left+.5*s.width,i=s.top+.5*s.height;return h(document,e,i)}function h(s,e,i){const n=s.elementFromPoint(e,i);if(!n)return null;const r=ie.getShadowRoot(n);return r&&r!=t.getRootNode(document.body)&&r!==s?h(r,e,i):n}function c(t){const s=o(t);return null!==s&&(t===s||t.contains(s))}t.findAncestor=function(t,s,i=!1){let n=t;for(;n;){if(s(n))return n;const t=e(n,i);if(!t||t===n)break;n=t}return null},t.walkUp=i,t.isDescendantOf=function s(e,i){if(e===i||i.contains(e))return!0;const n=t.getParentElement(e);return!(!n||n===e)&&s(n,i)},t.getParentElement=n,t.findAllElements=function(t,s=document){const e=Os(window.csquerySelectorAll[s.nodeType].call(s,t)),i=ie.getAllShadowHosts(s);for(const s of i){const i=ie.getShadowRoot(s);if(!i)continue;const n=Os(window.csquerySelectorAll[i.nodeType].call(i,t));csArray.prototype.push.call(e,...n)}return e},t.getRootNode=(()=>{if("getRootNode"in $i.prototype)return(t,s)=>t.getRootNode(s);function t(e){const i=s(e);return S(i)?t(i.host):i}function s(t){return null!=csNodeparentNode.apply(t)?s(csNodeparentNode.apply(t)):t}return(e,i)=>"object"==typeof i&&Boolean(i.composed)?t(e):s(e)})(),t.isHiddenByCSS=r,t.areAncestorsHiddenByCSS=function t(s){if(r(s))return!0;const e=n(s);return null!=e&&t(e)},t.getTopAncestorHiddenByCSS=function(t){let s=null,e=t;do{if(!r(e))break;s=e}while(e=n(e));return s},t.getTopElement=o,t.getElementOnTop=function(s){if(!s.getBoundingClientRect)return null;const e=s.getBoundingClientRect(),i=e.x+e.width/2,n=e.y+e.height/2;return t.getTopElementFromPoint(document,i,n)},t.getTopElementFromPoint=h,t.isVisibleInDocument=function(t){return!function(t){const s=t.getBoundingClientRect();return s.right+Ni.windowOffsetX()<0||s.bottom+Ni.windowOffsetY()<0}(t)&&!r(t)&&!function(t){const s=o(t);return null!==s&&!t.contains(s)}(t)},t.isVisibleInViewportInForeground=function(t){return!r(t)&&c(t)},t.isInViewPort=c,t.getAttributeNS=function(t,s,e){const i=t.getAttributeNS(s,e);return""===i?t.hasAttributeNS(s,e)?i:null:i},t.isElementFocusable=function(t){return!!t.hasAttribute("tabIndex")||("true"===t.getAttribute("contentEditable")||(!(!p(t)||!t.hasAttribute("href"))||(!(!(A(t)||g(t)||w(t)||(s=t,l(s)&&"button"===s.localName))||t.hasAttribute("disabled"))||!(!function(t){return l(t)&&"details"===t.localName}(t)&&!function(t){return l(t)&&"summary"===t.localName}(t)))));var s}}(Li||(Li={}));const Ui=csSymbol();class Bi{constructor(t){var s,e,i,n,r,o,h,c;this.Ss=t,this.Ie=null,this.Pe=null,this.be=null,this.Ve=null,this.Ce=Di((t=>this.processUpdateRulesInATick(t))),this.Ss=s=>Ci((()=>t(s))),"function"==typeof(null===(e=null===(s=window.CSSStyleSheet)||void 0===s?void 0:s.prototype)||void 0===e?void 0:e.insertRule)&&(this.Ie=se({target:window.CSSStyleSheet.prototype,methodName:"insertRule",hook:({context:t,args:s})=>{this.processInsertRule(t,s)}})),"function"==typeof(null===(n=null===(i=window.CSSStyleSheet)||void 0===i?void 0:i.prototype)||void 0===n?void 0:n.deleteRule)&&(this.Pe=se({target:window.CSSStyleSheet.prototype,methodName:"deleteRule",hook:({context:t,args:s})=>{this.processDeleteRule(t,s)}})),"function"==typeof(null===(o=null===(r=window.CSSGroupingRule)||void 0===r?void 0:r.prototype)||void 0===o?void 0:o.insertRule)&&(this.be=se({target:window.CSSGroupingRule.prototype,methodName:"insertRule",hook:({context:t})=>this.processUpdateRule(t)})),"function"==typeof(null===(c=null===(h=window.CSSGroupingRule)||void 0===h?void 0:h.prototype)||void 0===c?void 0:c.deleteRule)&&(this.Ve=se({target:window.CSSGroupingRule.prototype,methodName:"deleteRule",hook:({context:t})=>this.processUpdateRule(t)}))}observe(){var t,s,e,i;null===(t=this.Ie)||void 0===t||t.activate(),null===(s=this.Pe)||void 0===s||s.activate(),null===(e=this.be)||void 0===e||e.activate(),null===(i=this.Ve)||void 0===i||i.activate()}disconnect(){var t,s,e,i;null===(t=this.Ie)||void 0===t||t.deactivate(),null===(s=this.Pe)||void 0===s||s.deactivate(),null===(e=this.be)||void 0===e||e.deactivate(),null===(i=this.Ve)||void 0===i||i.deactivate()}processInsertRule(t,[s,e]){if(null==t[Ui]&&!t.ownerNode)return;const i={type:"cssRuleInserted",sheet:t,rule:s,index:e};this.Ss(i)}processUpdateRule(t){let s=t;for(;null!==s.parentRule;)s=s.parentRule;null!==s.parentStyleSheet&&this.Ce.push(s)}processUpdateRulesInATick(t){for(const s of t){if(null===s.parentStyleSheet)return;const t=s.parentStyleSheet,e=csArray.prototype.indexOf.call(Os(t.cssRules),s);if(-1===e)return;const i={type:"cssRuleUpdated",sheet:t,rule:s.cssText,index:e};this.Ss(i)}}processDeleteRule(t,[s]){if(null==t[Ui]&&!t.ownerNode)return;const e={type:"cssRuleDeleted",sheet:t,index:s};this.Ss(e)}}zs([ns()],Bi.prototype,"observe",null),zs([ns()],Bi.prototype,"disconnect",null),zs([ns()],Bi.prototype,"processInsertRule",null),zs([ns()],Bi.prototype,"processUpdateRule",null),zs([ns()],Bi.prototype,"processUpdateRulesInATick",null),zs([ns()],Bi.prototype,"processDeleteRule",null);class Fi{constructor(t){this.ke=1,this.Oe=new Set,this.Ne=null,this.xe=null,this.$e=(t,s)=>{"initial"!==s&&"added"!==s||this.setStyleSheets(t,t.adoptedStyleSheets)},this.Le=t=>{const s=t.sheet;if(this.Oe.has(s))if("cssRuleInserted"===t.type){const e={type:"adoptedStyleSheetRuleInserted",sheetId:s[Ui],rule:t.rule,index:t.index};this.Ss(e)}else if("cssRuleDeleted"===t.type){const e={type:"adoptedStyleSheetRuleDeleted",sheetId:s[Ui],index:t.index};this.Ss(e)}else if("cssRuleUpdated"===t.type){const e={type:"adoptedStyleSheetRuleUpdated",sheetId:s[Ui],rule:t.rule,index:t.index};this.Ss(e)}},this.Ss=s=>Ci((async()=>{await Oi(2),t(s)})),this.Os=new re(this.$e),"adoptedStyleSheets"in Document.prototype&&(this.Ne=ee(window.Document.prototype,"adoptedStyleSheets",((t,s)=>{this.setStyleSheets(t,s)}))),"ShadowRoot"in window&&"adoptedStyleSheets"in window.ShadowRoot.prototype&&(this.xe=ee(window.ShadowRoot.prototype,"adoptedStyleSheets",((t,s)=>{this.setStyleSheets(t,s)}))),this.Me=new Bi(this.Le)}observe(){var t,s;this.setStyleSheets(document,document.adoptedStyleSheets),this.Os.observe(),null===(t=this.Ne)||void 0===t||t.activate(),null===(s=this.xe)||void 0===s||s.activate(),this.Me.observe()}disconnect(){var t,s;this.Oe.clear(),this.Os.disconnect(),null===(t=this.Ne)||void 0===t||t.deactivate(),null===(s=this.xe)||void 0===s||s.deactivate(),this.Me.disconnect()}setStyleSheets(t,s){if(!s.length)return;this.De(s);const e={type:"adoptedStyleSheetsSet",target:t,sheetsIds:Ns(s,(t=>t[Ui]))};this.Ss(e)}De(t){$s(t,(t=>{if(this.Oe.has(t))return;const s=this.ke++;t[Ui]=s,this.Oe.add(t);const e={type:"adoptedStyleSheetRegistered",sheetId:s,cssRules:this.Ue(t)};this.Ss(e)}))}Ue(t){let s=[];try{s=Ns(t.cssRules,(t=>t.cssText))}catch{}return s}}zs([ns()],Fi.prototype,"observe",null),zs([ns()],Fi.prototype,"disconnect",null),zs([ns()],Fi.prototype,"setStyleSheets",null);const qi=ws((function(t){const s=[],e=function(t){const s=new Map,e=t=>{let e=s.get(t);return e||s.set(t,e=[]),e},i=(t,s)=>{const i=e(t);i.length&&"insert"!==i[0].operation&&"remove"!==i[0].operation&&(i.length=0),csArray.prototype.push.call(i,s)};for(const s of t)switch(s.type){case"attributes":{const t=e(s.target);if(t.length&&"attribute"!==t[0].operation)continue;const i=csArray.prototype.findIndex.call(t,(t=>"attributes"===t.mutation.type&&t.mutation.attributeName===s.attributeName)),n={operation:"attribute",mutation:s};i>=0?t[i]=n:csArray.prototype.push.call(t,n)}break;case"characterData":{const t=e(s.target);if(t.length&&"characterData"!==t[0].operation)continue;t[0]={operation:"characterData",mutation:s}}break;case"childList":$s(s.removedNodes,(t=>i(t,{operation:"remove",mutation:s}))),$s(s.addedNodes,(t=>i(t,{operation:"insert",mutation:s})))}return s}(t=function(t){const s=t=>{switch(t.type){case"attributes":return t.target.getAttribute(t.attributeName);case"characterData":return t.target.data}throw new Error("not supported type")},e=csSymbol(),i=csSymbol(),n=t=>{let s;for(const n of Li.walkUp(t)){if(n[e]||n[i])return n;s=t}return s},r=[];for(const o of t){if("childList"===o.type){$s(o.addedNodes,(t=>t[e]=!0)),csArray.prototype.push.call(r,o);continue}if(s(o)===o.oldValue)continue;const t=n(o.target);(null==t?void 0:t[e])||(csNodeparentNode.apply(o.target)&&(csNodeparentNode.apply(o.target)[i]=!0),csArray.prototype.push.call(r,o))}return r}(t));for(const i of t)switch(i.type){case"attributes":case"characterData":csArray.prototype.push.call(s,i);break;case"childList":csArray.prototype.push.call(s,...ji(i,e))}return Ds(s,(t=>!function(t,s){if("attributes"===t.type||"characterData"===t.type){return!Ms(s.get(t.target),(s=>s.mutation===t))}if(t.addedNodes.length){if(t.target===document.body)return!1;const e=t=>{var e;return"insert"===(null===(e=s.get(t))||void 0===e?void 0:e[0].operation)};if(e(t.target))return!0;return null!==Li.findAncestor(t.target,e,!0)}return!1}(t,e)))}),"optimizeMutations");var Hi,zi;function ji(t,s){var e,i;if(t.addedNodes.length&&!t.removedNodes.length&&!Ms(t.addedNodes,Li.isConnected))return[];if(!(t=>Ms(t.addedNodes,(t=>s.get(t).length>1))||Ms(t.removedNodes,(t=>s.get(t).length>1)))(t)){const s=Zi(t),e=Wi(t);if(e||s!==t.nextSibling){const i=[];return csArray.prototype.push.call(i,{nextSibling:s,previousSibling:e,target:t.target,type:"childList",addedNodes:t.addedNodes,removedNodes:t.removedNodes}),i}return[t]}const n=function(t,s){return Ds(t.addedNodes,(e=>{const i=Ji(e,s),n=Ds(s.get(e),(t=>"insert"===t.operation));switch(i){case Hi.Insert:return t===n[n.length-1].mutation;case Hi.None:return!0;case Hi.Move:case Hi.Remove:case Hi.NoOp:return!1}}))}(t,s),r=function(t,s){return Ds(t.removedNodes,(e=>{const i=Ji(e,s),n=Ds(s.get(e),(t=>"remove"===t.operation));switch(i){case Hi.Remove:return t===n[n.length-1].mutation;case Hi.None:return!0;case Hi.Move:case Hi.Insert:case Hi.NoOp:return!1}}))}(t,s),o=function(t,s){return Ds(t.addedNodes,(e=>{const i=Ds(s.get(e),(t=>"insert"===t.operation));return Ji(e,s)===Hi.Move&&t===i[i.length-1].mutation}))}(t,s),h=Gi(n),c=Gi(o),a=[];if(h.length>1||c.length>1){const s=function(t,s,e,i){const n=[];let r=!0;return $s(t,(t=>{0!==t.length&&(csArray.prototype.push.call(n,{nextSibling:csNodenextSibling.apply(t[t.length-1]),previousSibling:t[0].previousSibling,target:e.target,type:"childList",addedNodes:t,removedNodes:r?i:[]}),r=!1)})),$s(s,(t=>{0!==t.length&&csArray.prototype.push.call(n,{nextSibling:csNodenextSibling.apply(t[t.length-1]),previousSibling:t[0].previousSibling,target:e.target,movedNodes:t,addedNodes:[],removedNodes:[],type:"childList"})})),function(t,s){const e=t=>{var s;return(null===(s=t.movedNodes)||void 0===s?void 0:s.length)?t.movedNodes[0]:t.addedNodes[0]},i=s=>function(t,s){const e=t.length;for(let i=0;it===e(s)));csArray.prototype.sort.call(s,((t,s)=>i(t)-i(s)))}(e,n),n}(h,c,t,r);return csArray.prototype.push.call(a,...s),a}return(n.length>0||r.length>0)&&csArray.prototype.push.call(a,{nextSibling:null!==(e=Zi(t))&&void 0!==e?e:t.nextSibling,previousSibling:null!==(i=Wi(t))&&void 0!==i?i:t.previousSibling,target:t.target,type:"childList",addedNodes:n,removedNodes:r}),o.length&&csArray.prototype.push.call(a,{nextSibling:csNodenextSibling.apply(o[0]),previousSibling:o[0].previousSibling,target:t.target,movedNodes:o,addedNodes:[],removedNodes:[],type:"childList"}),a}function Gi(t){if(t.length<=1)return[t];const s=[];let e=0;for(let i=0;i0&&csArray.prototype.push.call(s,csArray.prototype.slice.call(t,e,t.length)),s}function Zi(t){if(t.nextSibling&&!Li.isConnected(t.nextSibling)){if(t.addedNodes.length)return csNodenextSibling.apply(t.addedNodes[t.addedNodes.length-1]);if(t.removedNodes.length)return csNodenextSibling.apply(t.removedNodes[t.removedNodes.length-1])}else if(t.nextSibling&&t.addedNodes.length&&csNodenextSibling.apply(t.addedNodes[t.addedNodes.length-1])!==t.nextSibling)return null;return t.nextSibling}function Wi(t){if(t.previousSibling&&!Li.isConnected(t.previousSibling)){if(t.addedNodes.length)return t.addedNodes[0].previousSibling;if(t.removedNodes.length)return t.removedNodes[0].previousSibling}return null}function Ji(t,s){var e,i;const n=s.get(t);return!n||n.length<=1?Hi.None:`${null===(e=n[0])||void 0===e?void 0:e.operation}-${null===(i=n[n.length-1])||void 0===i?void 0:i.operation}`}!function(t){t.Move="remove-insert",t.Remove="remove-remove",t.NoOp="insert-remove",t.Insert="insert-insert",t.None="none"}(Hi||(Hi={}));const Ki={childList:!0,subtree:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,attributeOldValue:!0};class Yi{static setShadowRootFilter(t){csArray.prototype.push.call(zi.shadowRootFilters,t)}static Be(t){if(zi.shadowRootFilters.length>0&&S(t))for(let s=0;s{this.mutationObserver.observe(t,Ki)}))}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(ie.getAllShadowHosts(document),(t=>s(csElementshadowRoot.apply(t),"initial"))):(this.mutationObserver=new csMutationObserver(this.mutationCallback),this.Be(document),this.shadowRootObserver=new re(this.onShadowRoot),this.shadowRootObserver.observe(),this.started=!0,$s(this.shadowRootObserver.shadowRoots,(t=>{this.Be(t)})))}static disconnect(t,s){var e,i;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=[],zi.shadowRootFilters=[],null===(e=this.shadowRootObserver)||void 0===e||e.disconnect(),null===(i=this.mutationObserver)||void 0===i||i.disconnect(),this.observedTargets.clear(),this.started=!1)}constructor(t,s){this.Ss=t,this.Fe=s;const e=Di((s=>t(s,this)),!0);this.Ss=rs("DocumentMutationObserver:callback",(t=>{$s(t,(t=>e.push(t)))}))}get shadowRoots(){var t,s;return null!==(s=null===(t=zi.shadowRootObserver)||void 0===t?void 0:t.shadowRoots)&&void 0!==s?s:[]}takeRecords(){var t;const s=null===(t=zi.mutationObserver)||void 0===t?void 0:t.takeRecords(),e=zi.shadowRootObserver.takeRecords();return(null==s?void 0:s.length)&&e.length?function(t,s,e){const i=t.length+s.length+((null==e?void 0:e.length)||0),n=new csArray(i);let r=0;for(let s=0;s{ei.mutations.count.increase(t.length),csArray.prototype.forEach.call(zi.callbacks,(s=>s(t,zi.mutationObserver)))},Yi.onShadowRoot=(t,s)=>{$s(zi.shadowRootCallbacks,(e=>e(t,s))),"removed"!==s?zi.Be(t):zi.disconnectShadowRoot(t)},zs([ns()],Yi.prototype,"observe",null),zs([ns()],Yi.prototype,"disconnect",null);class Qi{constructor(t){this.Ss=t,this.qe=t=>{t.sheet.ownerNode&&("cssRuleInserted"===t.type?this.Ss({type:t.type,target:t.sheet.ownerNode,rule:t.rule,index:t.index}):"cssRuleDeleted"===t.type?this.Ss({type:t.type,target:t.sheet.ownerNode,index:t.index}):"cssRuleUpdated"===t.type&&this.Ss({type:t.type,target:t.sheet.ownerNode,rule:t.rule,index:t.index}))},this.Ss=s=>Ci((()=>t(s))),this.He=new Bi((t=>Ci((async()=>{await Oi(),this.qe(t)})))),"adoptedStyleSheets"in Document.prototype&&(this.ze=new Fi(t))}observe(){var t;this.ys=new Yi((t=>this.je(t)),((t,s)=>{"added"===s&&this.Ge(t)})),this.ys.observe(),this.He.observe(),null===(t=this.ze)||void 0===t||t.observe()}disconnect(){var t,s;null===(t=this.ys)||void 0===t||t.disconnect(),this.He.disconnect(),null===(s=this.ze)||void 0===s||s.disconnect()}static Ze(t,s,e){const i=csSymbol.for(e?`${s}:${e}`:s),n=It.now(),r=t[i];return!!(r&&nt))};this.Ss(s)}if(null===(e=t.movedNodes)||void 0===e?void 0:e.length){const s={type:"nodesMoved",target:t.target,nodes:t.movedNodes,previousSibling:t.movedNodes[0].previousSibling||void 0,nextSibling:csNodenextSibling.apply(t.movedNodes[t.movedNodes.length-1])||void 0};this.Ss(s)}if(null===(i=t.addedNodes)||void 0===i?void 0:i.length){const s=[];if($s(t.addedNodes,(t=>{csArray.prototype.push.call(s,t)})),0===s.length)return;const e={type:"nodesAdded",target:t.target,previousSibling:t.previousSibling,nextSibling:t.nextSibling,nodes:s};this.Ss(e)}}Ge(t){const s={type:"shadowRootAttached",target:t.host,shadowRoot:t};this.Ss(s)}}Qi.We=30,zs([ns()],Qi.prototype,"processAttributeChanged",null),zs([ns()],Qi.prototype,"processCharacterDataChanged",null),zs([ns()],Qi.prototype,"processChildListChanged",null);class Xi extends Ei{constructor(t){super(t),this.nodeType=4,this.data=t.data}}class tn extends Ei{constructor(t){super(t),this.nodeType=8,this.data=t.data}}class sn extends Ei{constructor(t){super(t),this.nodeType=10,this.name=t.name,this.publicId=t.publicId,this.systemId=t.systemId}}class en extends Ei{constructor(t){super(t),this.nodeType=9,this.baseURI=en.getBaseURI(t),this.children=[]}static getBaseURI(t){let s=t.baseURI;if(null==s){const e=t.getElementsByTagName("base");s=0!==e.length?e[0].href:t.URL}return s}}class nn extends Ei{constructor(t){super(t),this.nodeType=11,this.mode=t.mode,this.children=[]}}class rn{constructor(t,s,e){var i;"string"==typeof t?(this.name=t,this.value=s,this.namespaceURI=null!=e?e:""):(this.name=t.name,this.value=t.value,this.namespaceURI=null!==(i=t.namespaceURI)&&void 0!==i?i:"")}static create(t){var s,e;const i=t.attributes,n=new csArray(i.length);for(let r=0;re(t))),r=new cs,o=(s,e)=>{s.hasChildNodes()&&r.push({node:s,serializedNode:e});const i=s instanceof Element&&csElementshadowRoot.apply(s);if(i){const s=e.shadowRoot=un(i);t.async&&t.initialDOM&&Ae.setProperty(i,hn,!0),o(i,s)}};let h,c=!0,a=8;const u=rs("work",(()=>{var i;if(c)h=un(s),t.async&&t.initialDOM&&Ae.setProperty(s,hn,!0),o(s,h),c=!1;else if(r.isEmpty)return;const l=function(t){if(t<1)throw new Error("Precision should be >= 1");let s=0,e=performance.now();return{started:e,elapsed(){return++s%t==0&&(e=performance.now()),e-this.started}}}(100);for(;!r.isEmpty;){if(t.async&&l.elapsed()>=t.workTime)return void(--a<=0&&csSetTimeout(u));const{node:s,serializedNode:e}=r.pop(),n=null!==(i=e.children)&&void 0!==i?i:[];if(y(s))continue;let h=0;for(let e=csNodefirstChild.apply(s);e;e=csNodenextSibling.apply(e)){const s=un(e);t.async&&t.initialDOM&&Ae.setProperty(e,hn,!0),n[h++]=s,o(e,s)}}t.async?csSetTimeout((()=>n(h))):e(h)}));if(t.async)for(let t=0;ts(t))))}onStop(){}start(){this.isStarted||(this.isStarted=!0,this.onStart())}stop(){this.isStarted&&(this.isStarted=!1,this.onStop(),this.Je=[])}subscribe(t){return csArray.prototype.push.call(this.Je,t),()=>{const s=csArray.prototype.indexOf.call(this.Je,t);csArray.prototype.splice.call(this.Je,s,1)}}}const dn=cn();class fn extends ln{constructor(){super(...arguments),this.Ke=!1}onStart(){this.Ke=!0,this.Ss=function(t,s){let e=!1;const i=function(){if(!e)return t.apply(s,arguments)};return i.cancel=()=>e=!0,i}(this.Ye,this),this.Qe=new Qi(this.Ss),this.Qe.observe();const t=()=>{this.Ke=!1,hn=csSymbol("InitialDom");ei.mutations.initialDOM.asyncMeasure()()};this.produceEvent(new Ri((s=>dn(document,(e=>{t(),s({type:"DomEvent",domEvent:"initialDOM",initialDOM:e})})))))}stopForInactivity(){this.isStarted&&(this.isStarted=!1,this.onStop())}onStop(){var t,s;this.Ke=!1,null===(t=this.Ss)||void 0===t||t.cancel(),null===(s=this.Qe)||void 0===s||s.disconnect()}Xe(t,s){const e={type:"DomEvent",domEvent:s.type,target:0,targetProps:{}};return"target"in s&&(e.target=Se(s.target),e.targetProps=Ae.getProperties(s.target)),[s,e]}Ye(t){if(!this.ti(t))switch(t.type){case"attributeChanged":{const[s,e]=this.Xe(t.type,t);e.attribute=s.attribute,e.isSvg=E(s.target),e.namespace=s.namespace,e.newValue=s.newValue,e.oldValue=s.oldValue,e.localName=yi(s.target),e.linkRel=f(s.target)?s.target.rel:null,e.parentLocalName=s.target.parentElement?yi(s.target.parentElement):void 0,"input"===e.localName&&(e.inputType=s.target.getAttribute("type")),this.produceEvent(e)}break;case"characterDataChanged":{const[s,e]=this.Xe(t.type,t);e.newValue=s.newValue,e.oldValue=s.oldValue,e.targetNodeType=s.target.nodeType,e.parentLocalName=s.target.parentElement?yi(s.target.parentElement):null,e.parentProps=s.target.parentElement?Ae.getProperties(s.target.parentElement):void 0,this.produceEvent(e)}break;case"nodesAdded":{const[s,e]=this.Xe(t.type,t);e.targetLocalName=l(s.target)?yi(s.target):null,e.nextSibling=s.nextSibling?Se(s.nextSibling):null,e.previousSibling=s.previousSibling?Se(s.previousSibling):null,ei.mutations.serializedMutations.measure((()=>{e.nodes=Ns(s.nodes,an)})),this.produceEvent(e);break}case"nodesMoved":{const[s,e]=this.Xe(t.type,t);e.previousSibling=s.previousSibling?Se(s.previousSibling):null,e.nextSibling=s.nextSibling?Se(s.nextSibling):null,e.nodesIds=Ns(s.nodes,Se),this.produceEvent(e);break}case"nodesRemoved":{const[s,e]=this.Xe(t.type,t);e.nodesIds=Ns(s.nodes,Se),this.produceEvent(e);break}case"shadowRootAttached":{const[s,e]=this.Xe(t.type,t);e.shadowRoot=un(s.shadowRoot),this.produceEvent(e);break}case"cssRuleInserted":{const[s,e]=this.Xe(t.type,t);e.index=s.index,e.rule=s.rule,this.produceEvent(e);break}case"cssRuleDeleted":{const[s,e]=this.Xe(t.type,t);e.index=s.index,this.produceEvent(e);break}case"cssRuleUpdated":{const[s,e]=this.Xe(t.type,t);e.rule=s.rule,e.index=s.index,this.produceEvent(e);break}case"adoptedStyleSheetRegistered":{const[s,e]=this.Xe(t.type,t);e.sheetId=s.sheetId,e.cssRules=s.cssRules,this.produceEvent(e);break}case"adoptedStyleSheetsSet":{const[s,e]=this.Xe(t.type,t);e.sheetsIds=s.sheetsIds,this.produceEvent(e);break}case"adoptedStyleSheetRuleInserted":{const[s,e]=this.Xe(t.type,t);e.sheetId=s.sheetId,e.rule=s.rule,e.index=s.index,this.produceEvent(e);break}case"adoptedStyleSheetRuleDeleted":{const[s,e]=this.Xe(t.type,t);e.sheetId=s.sheetId,e.index=s.index,this.produceEvent(e);break}case"adoptedStyleSheetRuleUpdated":{const[s,e]=this.Xe(t.type,t);e.sheetId=s.sheetId,e.rule=s.rule,e.index=s.index,this.produceEvent(e);break}}}si(t){return this.Ke&&!Ae.getProperty(t,hn)}ti(t){switch(t.type){case"nodesAdded":case"nodesMoved":case"nodesRemoved":case"shadowRootAttached":return this.si(t.target)||Oe.isMaskedElement(t.target)||Oe.isMaskedElementChild(t.target);case"characterDataChanged":{const s=t.target.parentElement;return null!==s&&(this.si(s)||Oe.isMaskedElement(s)||Oe.isMaskedElementChild(s))}case"attributeChanged":return this.si(t.target)||Oe.isMaskedElementChild(t.target)||Oe.isMaskedAttribute(t.target,t.attribute);case"cssRuleInserted":case"cssRuleDeleted":case"cssRuleUpdated":return this.si(t.target)||Oe.isMaskedElementChild(t.target);default:return!1}}}var pn,vn;!function(t){t.isDOMEvent=function(t){return"DomEvent"===t.type}}(pn||(pn={}));class mn{constructor(){this.Je=[]}start(){}stop(){this.Je.length=0,this.Je=[]}pushEvent(t){if(mn.pendingEvents++,this.isListening(t)){const s=this.Je;csSetTimeout((()=>{const e=rs("Processor:processEvent",(t=>this.processEvent(t))),i=e(t);null!=i&&csArray.prototype.forEach.call(s,(t=>t(i))),mn.pendingEvents--}))}else csSetTimeout((()=>{csArray.prototype.forEach.call(this.Je,(s=>s(t)))}))}subscribe(t){return csArray.prototype.push.call(this.Je,t),()=>{this.Je=csArray.prototype.filter.call(this.Je,(s=>s!==t))}}emitEvent(t){Ci((()=>csArray.prototype.forEach.call(this.Je,(s=>s(t)))))}}function wn(t){const s=new ArrayBuffer(t.length),e=new Uint8Array(s);for(let s=0,i=t.length;scsString.prototype.padStart.call(t.toString(16),2,"0"))),"")}function An(t){const s=-1!==csString.prototype.indexOf.call(t,";base64,"),e=csString.prototype.indexOf.call(t,","),i=s?[csString.prototype.substring.call(t,0,e-7),csString.prototype.substring.call(t,e+1)]:[csString.prototype.substring.call(t,0,e),csString.prototype.substring.call(t,e+1)];if(!s&&/^%3Csvg/i.test(i[1]))try{i[1]=decodeURIComponent(i[1])}catch(t){is.warn(`${t}, calling decodeURIComponent on: ${i[1]}`)}const n=s?yn(i[1]):wn(i[1]);return new Blob([n],{type:csString.prototype.replace.call(i[0],"data:","")})}mn.pendingEvents=0,function(t){const s="replaceAll"in csString.prototype;t.ELLIPSIS="…",t.stringReplaceAll=function(t,e,i){if(s)return csString.prototype.replaceAll.call(t,e,i);const n=new csRegExp((r=e,csString.prototype.replace.call(r,/[.*+?^${}()|[\]\\]/g,"\\$&")),"g");var r;return csString.prototype.replace.call(t,n,i)},t.truncate=function(t,s,e=""){return t.length<=s?t:csString.prototype.slice.call(t,0,s-e.length)+e}}(vn||(vn={}));class _n{static async toStaticResourceEvent(t,s,e){const i=await _n.ei(t);if(!i)return null;const n=await _n.ii(i),r=hi(t)?void 0:t,o={type:"StaticResourceManagerEvent",timestamp:e,resourceId:s,resource:{hash:n,data:i}};return r&&(o.originalResourceName=r),o}static async toCSSStaticResourceEvent(t,s,e,i){const n=await _n.ni(t,i),r=qt(t),o=n.get(r);if(!o)return null;const h={type:"StaticResourceManagerEvent",timestamp:e,resourceId:s,resource:{hash:o.hash,data:o.data}};return n.delete(r),n.size&&(h.nestedResources=[],n.forEach((t=>{t&&csArray.prototype.push.call(h.nestedResources,{hash:t.hash,data:t.data})}))),h}static async ii(t){const s=await t.arrayBuffer();return En(await crypto.subtle.digest(this.oi,s))}static async ei(t){let s;if(hi(t)){const e=An(t);if(!e)return null;s=e}else{const e=await window.fetch(t);s=await e.blob()}return s}static async ni(t,s){const e=new Map,i=[{resourceRawPath:t,resourceAbsolutePath:qt(t)}];for(;i.length>0;){const t=csArray.prototype.pop.call(i);if(!s&&null!==t.resourceAbsolutePath&&!hi(t.resourceAbsolutePath))e.set(t.resourceAbsolutePath,null);else if(void 0===e.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=pi(t.data));let s=!1,n=!1;for(const r of t.nestedResources){const o=hi(r)?r:t.resourceAbsolutePath?Ht(r,t.resourceAbsolutePath):qt(r),h=e.get(o);if(void 0!==h){if(null!==h){const s=_n.hi(h,r);t.data=vn.stringReplaceAll(t.data,r,s)}continue}const c=void 0!==Ls(i,(t=>t.resourceAbsolutePath===o));c||(s=!0,n||(csArray.prototype.push.call(i,t),n=!0),csArray.prototype.push.call(i,{resourceRawPath:r,resourceAbsolutePath:o}))}if(!s){const s=await _n.ci(t.data);e.set(t.resourceAbsolutePath,{hash:s.hash,data:s.data})}}else{let s;if(hi(t.resourceAbsolutePath)){const i=An(t.resourceAbsolutePath);if(!i){e.set(t.resourceAbsolutePath,null);continue}s=i}else{const e=await fetch(t.resourceAbsolutePath);s=await e.blob()}const i=await _n.ii(s);e.set(t.resourceAbsolutePath,{hash:i,data:s})}}catch{e.set(t.resourceAbsolutePath,null)}}return e}static hi(t,s){let e=`cs://resources/${t.hash}`;return hi(s)||(e+=`?${_n.ai}=${s}`),e}static async ci(t){const s=new Blob([t],{type:"text/css"}),e=await s.arrayBuffer();return{data:s,hash:En(await crypto.subtle.digest(_n.oi,e))}}}_n.oi="SHA-256",_n.ai="original-resource-name";class Rn extends mn{constructor(){super(),this.ui="cssrm://",this.li=0,this.fi=!1}isListening(t){return!!Rn.isSupported()&&(!!pn.isDOMEvent(t)&&("initialDOM"===t.domEvent||"nodesAdded"===t.domEvent||"attributeChanged"===t.domEvent||"characterDataChanged"===t.domEvent))}processEvent(t){switch(t.domEvent){case"initialDOM":case"nodesAdded":this.pi(t);break;case"attributeChanged":this.mi(t);break;case"characterDataChanged":this.wi(t)}return t}disableOnlineAssets(){this.fi=!1}enableOnlineAssets(){this.fi=!0}isOnlineAssetsActivated(){return this.fi}pi(t){const s="initialDOM"===t.domEvent?[t.initialDOM]:t.nodes;for(const t of s)Ae.traverse(t,((t,s)=>{if(3===t.nodeType&&s)return void this.gi(t,s.localName);if(!_i.isElement(t))return;const e=Ls(t.attributes,(t=>"style"===t.name));if(e&&(e.value=this.yi(e.value)),this.Ei(t)||this.Ai(t,s)){const s=Ls(t.attributes,(t=>"src"===t.name));s&&s.value&&(s.value=this._i(s.value));const e=Ls(t.attributes,(t=>"srcset"===t.name));if(e)return void(e.value=this.Ri(e.value))}if(this.Si(t)&&this.fi){const s=Ls(t.attributes,(t=>"href"===t.name));if(!s||!s.value)return;this.li++,this.Ti(qt(s.value),this.li,!0),this.Ii(t,s,this.li)}}))}Ii(t,s,e){csArray.prototype.push.call(t.attributes,{name:"data-cs-original-href",namespaceURI:"",value:s.value}),s.value=this.ui+e}gi(t,s){if(!t||"style"!==s)return;const e=this.yi(t.data);null!==e&&(t.data=e)}wi(t){if("style"!==t.parentLocalName||!t.newValue)return;const s=this.yi(t.newValue);null!==s&&(t.newValue=s)}mi(t){if(!t.newValue||t.newValue===t.oldValue)return;const s="src"===t.attribute,e="srcset"===t.attribute;if("style"===t.attribute)return void(t.newValue=this.yi(t.newValue));if(!s&&!e)return;const i="img"===t.localName,n="source"===t.localName&&t.parentLocalName&&"picture"===t.parentLocalName;(i||n)&&(s&&(t.newValue=this._i(t.newValue)),e&&(t.newValue=this.Ri(t.newValue)))}_i(t){return hi(t)||this.fi?(this.li++,this.Ti(t,this.li,!1,It.now()),this.ui+this.li):t}Ri(t){if(!this.fi)return t;let s=t;const e=ui(t),i=It.now();for(const t of e)this.li++,this.Ti(qt(t),this.li,!1,i),s=csString.prototype.replace.call(s,t,this.ui+this.li);return s}yi(t){const s=pi(t);let e=t;const i=It.now();for(const t of s){const s=hi(t);if(!s&&!this.fi)continue;if(this.Pi(t))continue;this.li++,e=csString.prototype.replace.call(e,t,this.ui+this.li);const n=ai(t);s?this.Ti(t,this.li,!1,i):this.fi&&(n?this.Ti(t,this.li,!0,i):this.Ti(qt(t),this.li,!1,i))}return e}Ti(t,s,e,i=It.now()){const n=e?_n.toCSSStaticResourceEvent:_n.toStaticResourceEvent,r=new Ri((async e=>{try{const r=await n(t,s,i,this.fi);e(r||{type:"warning",message:`Failed to process static resource: ${t}`})}catch(t){e({type:"warning",message:t})}}));this.emitEvent(r)}Ei(t){return"img"===t.localName}Ai(t,s){return"source"===t.localName&&!!s&&"picture"===s.localName}Si(t){return"link"===t.localName&&csArray.prototype.some.call(t.attributes,(t=>"rel"===t.name&&"stylesheet"===t.value))}static isSupported(){return bt()&&function(){var t;return"undefined"!=typeof crypto&&Rt(null===(t=crypto.subtle)||void 0===t?void 0:t.digest)}()&&!!csArray.from}Pi(t){return 0===csString.prototype.replace.call(t,/['"]+/g,"").length}}oi([gs("StaticResourceManagerProcessor.processEvent")],Rn.prototype,"processEvent",null);class Sn extends Ue{constructor(t,s,e,i,n,r,o,h,c,a,u,l,d,f,p,v=[],m,w,g,y,E){super(),this.L=t,this.bi=s,this.Vi=e,this.Ci=i,this.ki=n,this.Oi=r,this.J=o,this.Ni=h,this.xi=c,this.$i=a,this.Li=u,this.Mi=l,this.Di=d,this.Ui=f,this.Bi=p,this.Fi=v,this.qi=m,this.Hi=w,this.zi=g,this.ji=y,this.Gi=E,this.Zi=0,this.Wi=new De,this.Ji={allowFromQuotaService:!0,allowFromSerialization:!0},this.Ki=ae((()=>{this.bi.eventsCount()>0&&this.Yi()}),2e3),this.Qi=t=>this.processBrowserEvent(t),this.Xi=t=>this.tn(t),this.en=0,this.nn=0,this.rn=new je,this.hn=!1,this.cn=51200,this.an=!1,this.un=!1,this.ln=[],this.dn=new ri((t=>this.fn(t)),(t=>{switch(t){case ni.Active:this.qi.start();break;case ni.Stopped:this.qi.stopForInactivity()}}),[ue.RESOURCE_HASHES]),this.vn=t=>{this.Di.removeBatchInProgress(`${t.params.sn}.${t.params.pn}.${t.params.ri}`)}}init(){this.mn(),this.Mi.onLoad(this.vn),this.Mi.onError(this.vn)}mn(){var t,s,e;this.Bi.onEvent(this.Qi,this.Xi),this.ki.onEvent(this.Xi),null===(t=this.Li)||void 0===t||t.onInputNodeToEncrypt(this.Xi),null===(s=this.Li)||void 0===s||s.onApiErrorToEncrypt((t=>{this.wn(t)})),null===(e=this.Li)||void 0===e||e.onUserIdentifierToEncrypt(this.Qi),this.rn.onEvent((t=>t===He.Blur?this.gn():this.hn?void 0:(this.hn=!0,csSetTimeout((()=>{this.hn=!1})),t===He.Hidden?this.gn():this.yn())))}isRecording(){return this.J.hasValidSession()&&this.isStarted}gn(){if(!this.canSendEvents())return;this.Bi.flush(),this.Di.saveBatchesInProgress(),$s(this.Fi,(t=>{var s,e;return $s(null!==(e=null===(s=t.getPendingEvents)||void 0===s?void 0:s.call(t))&&void 0!==e?e:[],(t=>this.bi.addEvent(t)))}));const t=this.bi.getEvents();if(0===t.length)return;this.bi.addEvent({date:It.now(),type:ue.RECORDING_INFO_EVENT,args:["pendingEvents",this.Bi.pendingEvents]});const s=this.Mi.getQueryParams();s.rst=this.getRecordingStartTimestamp(),s.let=this.getRecordingLastEventTimestamp();const e=this.Ci.getCurrentIndex();s.ri=e.toString(),this.Ui.removeQueryParams(),this.Ui.setQueryParams(s),this.nn=t[t.length-1].date;const i=this.bi.stringifyEvents();if(i.length>this.cn){const t=this.En();if(t.length>0){const e=W(t);this.Ui.send(e)||this.Di.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:e}),this.Ci.increment()}if(this.bi.eventsCount()>0){s.ri=this.Ci.getCurrentIndex().toString();const t=this.bi.stringifyEvents();this.Di.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:t}),this.Ci.increment()}}else{this.Ui.send(i)||this.Di.save({key:`${s.sn}.${s.pn}.${s.ri}.last`,metadata:{...s,datatype:"json"},events:i}),this.Ci.increment()}this.Ui.removeQueryParams(),this.bi.clearEvents()}yn(){if(!this.canSendEvents())return;this.Bi.flush();const t=this.Mi.getQueryParams();this.Di.saveBatchesInProgress(),t.rst=this.getRecordingStartTimestamp(),delete t.ri,t.hlm="true",this.Ui.removeQueryParams(),$s(this.Fi,(t=>{var s,e;return $s(null!==(e=null===(s=t.getPendingEvents)||void 0===s?void 0:s.call(t))&&void 0!==e?e:[],(t=>this.bi.addEvent(t)))}));const s=this.bi.getEvents();if(0===s.length)return delete t.let,delete t.rst,this.Ui.setQueryParams(t),this.Ui.send(),void this.Ui.removeQueryParams();this.bi.addEvent({date:It.now(),type:ue.RECORDING_INFO_EVENT,args:["pendingEvents",this.Bi.pendingEvents]}),this.nn=s[s.length-1].date,t.let=this.getRecordingLastEventTimestamp(),this.Ui.setQueryParams(t);const e=this.bi.stringifyEvents();if(e.length>this.cn){const s=this.En();if(s.length>0){const e=W(s);this.Ui.send(e)||this.Di.save({key:`${t.sn}.${t.pn}.last`,metadata:{...t,datatype:"json"},events:e})}else delete t.let,delete t.rst,delete t.ri,this.Ui.removeQueryParams(),this.Ui.setQueryParams(t),this.Ui.send(),this.Ui.removeQueryParams();if(this.bi.eventsCount()>0){t.rst=this.getRecordingStartTimestamp(),t.let=this.getRecordingLastEventTimestamp();const s=this.Ci.getCurrentIndex();t.ri=s.toString();const e=this.bi.stringifyEvents();this.Di.save({key:`${t.sn}.${t.pn}.${t.ri}.last`,metadata:{...t,datatype:"json"},events:e}),this.Ci.increment()}}else{this.Ui.send(e)||(this.Di.save({key:`${t.sn}.${t.pn}.${t.ri}.last`,metadata:{...t,datatype:"json"},events:e}),this.Ci.increment())}this.Ui.removeQueryParams(),this.bi.clearEvents()}blockSendingEventsFromQuotaService(){this.Ji.allowFromQuotaService=!1}allowSendingEventsFromQuotaService(){this.Ji.allowFromQuotaService=!0}blockSendingEventsFromSerialization(){this.Ji.allowFromSerialization=!1}allowSendingEventsFromSerialization(){this.Ji.allowFromSerialization=!0}canSendEvents(){return this.Ji.allowFromQuotaService&&this.Ji.allowFromSerialization}onIframeJavascriptError(t){var s;if(this.Ni&&this.ji){null===(s=this.Ni)||void 0===s||s.anonymize(t);const e=this.ji.translate({message:t.message,colno:t.colno,lineno:t.lineno,filename:t.filename,timestamp:It.now(),type:"JSError"});e&&this.Qi(e)}}onIframeCustomError(t){if(this.Gi){const s=this.Gi.translate({...t,timestamp:It.now(),type:"CustomError"});s&&this.Qi(s)}}onIframeDetailedApiError(t){this.An(t)}onIframeRecordingUserEvent(t){for(const s of t)this.tn(s)}onIframeRecordingBrowserEvent(t){if(this.isStarted)for(const s of t)this.processBrowserEvent(s)}processBrowserEvent(t){this.Oi.isCurrentPageviewValid()&&this.dn.pushEvent(t,{isUserEvent:!1})}tn(t){this.Oi.refreshSession(),this.Oi.isSessionValid()&&this.dn.pushEvent(t,{isUserEvent:!0})}fn(t){ei.general.nbEvents.increase(),this.bi.addEvent(t);this.bi.isThresholdReached()?this.pushEvents():this.bi.isFull()&&this.Ki(),this._n(t)}_n(t){this.L.emitDebugEvents&&this.Wi.emit("recordingEvent",{...t,typeName:ue[t.type]})}onStart(){this.dn.reset(),this.rn.start(),this.initStates(),this.Bi.start(),this.xi&&this.$i&&this.xi.subscribe(Sn.Rn,(t=>this.An(t)),{detailedEvent:!0}),this.L.emitDebugEvents&&this.Wi.emit("replayRecordingStarted"),csArray.prototype.forEach.call(this.ln,(t=>this.Sn(t))),this.ln=[]}onStop(){var t;this.dn.disconnect(),this.rn.stop(),this.ki.stop(),this.xi&&this.xi.unsubscribe(Sn.Rn),this.Bi.stop(),this.un=!1,null===(t=this.Hi)||void 0===t||t.disableOnlineAssets()}clearStates(){this.Bi.flush(),this.Ki.cancel(),this.pushEvents(),this.Mi.removeQueryParams()}initStates(){this.en=It.now(),this.Ci.reset(),this.Zi=0,this.Mi.setQueryParams(this.Vi.getRequestParameters())}pushEvents(){$s(this.Fi,(t=>{var s;return null===(s=t.flushEvents)||void 0===s?void 0:s.call(t)})),this.bi.eventsCount()>0&&(this.isStarted?this.Yi():this.bi.clearEvents())}Yi(){if(!this.canSendEvents())return;const t=this.bi.getEvents();this.nn=t[t.length-1].date;const s=this.Ci.getCurrentIndex();this.Mi.setQueryParams({ri:s.toString(),rst:this.getRecordingStartTimestamp(),let:this.getRecordingLastEventTimestamp()});const e=this.Mi.getQueryParams();this.Di.addBatchInProgress(`${e.sn}.${e.pn}.${s}`,this.Mi.getQueryParams(),t),this.Mi.send(t),this.Ci.increment(),this.bi.clearEvents(),this.Tn&&this.Tn()}addInitialDom(t){this.bi.addEventByTimestamp(t),this._n(t)}An(t){if(this.zi&&(t.plainCustomRequestHeaders||t.plainCustomResponseHeaders||t.requestBodyAttributes||t.responseBodyAttributes||t.customRequestHeaders||t.customResponseHeaders||t.queryParameters||t.requestBody||t.responseBody)){if(this.zi.truncate(t),this.Li)return void this.Li.registerApiErrorToEncrypt(t);t.customRequestHeaders="",t.customResponseHeaders="",t.requestBodyAttributes="",t.responseBodyAttributes="",t.queryParameters="",t.requestBody="",t.responseBody=""}this.wn(t)}wn(t){if(this.Zi{var s;return null===(s=t.releaseResources)||void 0===s?void 0:s.call(t)}))}En(){return this.bi.extractEvents(ue.API_ERROR,ue.JAVASCRIPT_ERROR,ue.CUSTOM_ERROR,ue.TEXT_VISIBILITY,ue.POINTER_DOWN)}}Sn.Rn="RecordingService",Sn.On=255,Sn.In=20,Sn.Cn="etrp",Sn.bn="etrs",Sn.Vn="1",ys([gs("addInitialDom")],Sn.prototype,"addInitialDom",null);class Tn extends Ue{constructor(t,s,e){super(),this.Qt=t,this.Ui=s,this.Mi=e,this.Nn=!1,this.xn={},this.$n=t=>{if(0!==t.length)for(const s of t){const{metadata:t,events:e}=s;this.Ln(t.rt)&&this.Mi.send(e,t)}},window.addEventListener("focus",(()=>{this.recover()}))}onStart(){this.xn={}}onStop(){}recover(){this.Qt.recover(this.$n)}addBatchInProgress(t,s,e){this.xn[t]={metadata:{...s},events:e}}removeBatchInProgress(t){delete this.xn[t]}blockSendingLastMessage(){this.Nn=!1}allowSendingLastMessage(){this.Nn=!0}sendLastMessageBeacon(){if(this.Nn){const{ri:t,rst:s,let:e,...i}=this.Mi.getQueryParams();i.hlm="true",this.Ui.setQueryParams(i),this.Ui.send()}}Ln(t){return!!t&&-1===csString.prototype.indexOf.call(t,Be.TEMPORARILY)}saveBatchesInProgress(){csArray.prototype.forEach.call(Object.keys(this.xn),(t=>{const{metadata:s,events:e}=this.xn[t];this.Qt.save({key:`${s.sn}.${s.pn}.${s.ri}`,metadata:{...s,datatype:"json"},events:csJSON.stringify(e)})}))}save(t){this.Qt.save(t)}}ys([ns("RecordingRecovery")],Tn.prototype,"recover",null);class In{constructor(...t){this.Mn=t}addProvider(t){csArray.prototype.push.call(this.Mn,t)}getRequestParameters(){return csArray.prototype.reduce.call(this.Mn,((t,s)=>({...s.getRequestParameters(),...t})),{})}}class Pn{constructor(t,s){this.Dn=t,this.M=s,this.Un=[{boundElement:window,type:"hashchange",listener:()=>this.hashChangeListener()},{boundElement:document,type:"visibilitychange",listener:()=>this.visibilityChangeListener()}]}onEvent(t){this.Bn=t}start(){this.Ns(),this.triggerInitialEvents()}stop(){this.xs()}Ns(){csArray.prototype.forEach.call(this.Un,(t=>oe(t)))}xs(){csArray.prototype.forEach.call(this.Un,(t=>he(t)))}triggerInitialEvents(){this.hashChangeListener()}hashChangeListener(){const t={type:ue.HASH_CHANGE,args:[this.M.anonymizePII(this.Dn.href)],date:It.now()};this.Bn(t)}visibilityChangeListener(){const t={type:ue.VISIBILITY_CHANGE,args:[document.visibilityState],date:It.now()};this.Bn(t)}}ys([ns("hashChange")],Pn.prototype,"hashChangeListener",null),ys([ns("visibilityChange")],Pn.prototype,"visibilityChangeListener",null);var bn,Vn;class Cn{constructor(t){this.Ss=t}observe(){if(this.Fn=bn.qn.subscribe((t=>this.Ss(t))),!bn.Hn){bn.Hn=!0,bn.zn.observe();Zs(document,NodeFilter.SHOW_ELEMENT).visitAll((t=>{bn.jn.add(t),bn.qn.next(t)}))}}disconnect(){bn.Hn&&(this.Fn(),bn.qn.hasObservers()||(bn.Hn=!1,bn.zn.disconnect(),bn.qn.clear(),bn.jn.clear()))}}bn=Cn,Cn.jn=Mi(),Cn.qn=new class{constructor(t=Number.POSITIVE_INFINITY){this.Gn=[],this.ge=[],this.Zn=t}next(t){this.ge.length===this.Zn&&csArray.prototype.shift.call(this.ge),csArray.prototype.push.call(this.ge,t),1===this.ge.length&&csSetTimeout((()=>this.clear()));for(const s of this.Gn)s(t)}subscribe(t){if(Ls(this.Gn,(s=>t===s)))return()=>{this.Gn=csArray.prototype.filter.call(this.Gn,(s=>s!==t))};csArray.prototype.push.call(this.Gn,t);for(const s of this.ge)t(s);return()=>{this.Gn=csArray.prototype.filter.call(this.Gn,(s=>s!==t))}}clear(){this.ge=[]}hasObservers(){return this.Gn.length>0}},Cn.Wn=ws((t=>{Ci((()=>{for(const s of t)"childList"===s.type&&$s(s.addedNodes,(t=>{Zs(t,NodeFilter.SHOW_ELEMENT).visitAll((t=>{bn.jn.has(t)||(bn.jn.add(t),bn.qn.next(t))}))}))}))}),"ElementObserver.findAllElements"),Cn.Hn=!1,Cn.zn=new Yi(bn.Wn),zs([ns()],Cn.prototype,"observe",null),zs([ns()],Cn.prototype,"disconnect",null);class kn{constructor(){this.gs=!1,this.Jn=new Bi((t=>"cssRuleInserted"===t.type&&this.onStyleSheetChange(t))),this.Kn=new Cn((t=>this.Yn(t))),this.ys=new Yi((t=>this.Qn(t)))}onStyleSheetChange(t){t.rule&&this.gs&&this.Xn(t.rule)}start(){this.gs||(this.gs=!0,this.Jn.observe(),this.Kn.observe(),this.ys.observe())}stop(){this.gs&&(this.Jn.disconnect(),this.Kn.disconnect(),this.ys.disconnect(),this.gs=!1)}onEvent(t){this.Bn=t}onAsset(t){this.tr=t}onStyleSheetFound(t){this.er=t}ir(t){d(t)&&csNodeparentNode.apply(t)&&m(csNodeparentNode.apply(t))&&this.Xn(t.data)}Xn(t){this.nr(pi(t))}Yn(t){this.gs&&Oe.getMaskedElementDetails(t).state===Oe.MaskedElementState.NotMasked&&this.rr(t)}rr(t,s){Oe.getMaskedElementDetails(t).state!==Oe.MaskedElementState.NotMasked||s&&Oe.isMaskedAttribute(t,s)||(m(t)?this.hr(t):this.cr(t,s)||(this.ar(t,s),this.ur(t,s),this.lr(t,s)))}cr(t,s){var e,i,n;if(v(t)&&(!s||"href"===s)&&t.href){const s=(null===(e=t.sheet)||void 0===e?void 0:e.href)||t.href,r={assetId:s,assetBasePath:window.location.href,assetRawPath:t.getAttribute("href")};return null===(i=this.er)||void 0===i||i.call(this,r),null===(n=this.tr)||void 0===n||n.call(this,r),this.pr(s),!0}return!1}hr(t){var s;const e=new Set;for(let s=0;s!this.mr(t))),(t=>!hi(t))),(t=>!ci(t))),(t=>({rawUrl:t,absoluteUrl:qt(t)}))),(t=>{var s;this.Bn&&this.pr(t.absoluteUrl),null===(s=this.tr)||void 0===s||s.call(this,{assetId:t.absoluteUrl,assetBasePath:window.location.href,assetRawPath:t.rawUrl})}))}Qn(t){for(const s of t)switch(s.type){case"attributes":this.rr(s.target,s.attributeName);break;case"characterData":this.ir(s.target)}}pr(t){var s;const e={date:It.now(),type:ue.STATIC_RESOURCE_URL,args:[t]};null===(s=this.Bn)||void 0===s||s.call(this,e)}mr(t){return/^https:\/\/\w+:\w+@/.test(t)}}class On{constructor(t){this.gr=[],this.yr=[],this.zt={},this.jt=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.gr,t)}onBeaconFailure(t){csArray.prototype.push.call(this.yr,t)}send(t){const s=Q.toQuery({...this.zt,ct:Cs.UNCOMPRESSED}),e=this.Er(s,t);return e?csArray.prototype.forEach.call(this.gr,(t=>t())):csArray.prototype.forEach.call(this.yr,(t=>t(this.zt))),e}Er(t,s){try{if("function"!=typeof csNavigatorsendBeacon)return!1;const e=csNavigatorsendBeacon(`${this.jt}?${t}`,s||"");if(e)return e}catch{}return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(`${this.jt}?${t}`,s||"")}}class Nn{constructor(t){this.Ar={},this._r=new $e(t)}save({key:t,metadata:s,events:e}){this._r.isThresholdReached()||(this._r.addString(t),"string"==typeof e?this._r.addString(e):this._r.addArrayBuffer(e),this._r.isThresholdReached()||(this.Ar[t]={metadata:s,events:e}))}recover(t){const s=[];csArray.prototype.forEach.call(this.Rr(),(t=>{const e=this.Ar[t];void 0!==e&&(delete e.metadata.datatype,csArray.prototype.push.call(s,e),this.Sr(t))})),0!==s.length&&(t(s),this._r.reset())}Rr(){return Object.keys(this.Ar)}Sr(t){delete this.Ar[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"}(Vn||(Vn={}));class xn{constructor(t,s,e){this.Tr=t,this.Ir=e,this.Pr=Vn.NOT_STARTED,this.br=[],this.Vr=0,this.Cr=self.origin,this.kr="object"==typeof window?"":"worker-",this._r=new $e(s),this.Or()}async Or(){await this.Nr(),this.Pr===Vn.READY?this.$r():this.Ir(this.br)}$r(){csArray.prototype.forEach.call(this.br,(t=>{this.save(t)})),this.br=[]}async save(t){try{if(this.Pr===Vn.OPEN_IN_PROGRESS)return void csArray.prototype.push.call(this.br,t);if(this.Pr!==Vn.READY)return;if(this._r.isThresholdReached())return;const{key:s,metadata:e,events:i}=t;if(this._r.addString(s),"string"==typeof i?this._r.addString(i):this._r.addArrayBuffer(i),this._r.isThresholdReached())return;await this.Lr.put(`${this.Cr}/${s}`,new Response(i,{headers:e}))}catch{}}async recover(t){(this.Lr||(await this.Nr(),this.Pr===Vn.READY))&&this.Mr(t)}async Nr(){try{this.Pr=Vn.OPEN_IN_PROGRESS,this.Lr=await self.caches.open(`${this.kr}${this.Tr}`),this.Pr=Vn.READY}catch{this.Pr=Vn.OPEN_FAILED}}async Mr(t){try{if(this.Vr++,this.Vr>1)return;const s=await this.Lr.keys();if(0===s.length)return;const e=await this.Lr.matchAll(),i=csArray.prototype.map.call(e,(t=>{const s={};t.headers.forEach(((t,e)=>{s[e]=t})),delete s["content-type"];const e=s.datatype;return delete s.datatype,"json"===e||"base64"===e?t.text().then((t=>({metadata:s,events:t}))):t.arrayBuffer().then((t=>({metadata:s,events:t})))})),n=await Promise.all(i);await Promise.all(csArray.prototype.map.call(s,(t=>this.Lr.delete(t)))),t(n),this._r.reset()}catch{}finally{this.Vr--}}}class $n{constructor(t){try{this.Dr(t)}catch(t){this.Ur()}}Dr(t){self.caches?this.Br(t):this.Ur()}save(t){this.Fr.save(t)}recover(t){this.Fr.recover(t)}Br(t){this.Fr=new xn(t,$n.qr,(t=>{this.Ur(t)}))}Ur(t){this.Fr=new Nn($n.qr),t&&csArray.prototype.forEach.call(t,(t=>{this.Fr.save(t)}))}}$n.qr=16777216;class Ln extends mn{isListening(t){return pn.isDOMEvent(t)&&("initialDOM"===t.domEvent||"nodesAdded"===t.domEvent)}processEvent(t){const s="initialDOM"===t.domEvent?[t.initialDOM]:t.nodes;for(const e of s){if(e instanceof _i){const t=Oe.getMaskedAttributeDetails(e);e.attributes=this.Hr(e,t)}if(Oe.getMaskedElementDetails(e).state!==Oe.MaskedElementState.Child)Ae.traverse(e,(t=>{if(t instanceof _i){const s=Oe.getMaskedAttributeDetails(t);t.attributes=this.Hr(t,s);const e=Oe.getMaskedElementDetails(t);e.state===Oe.MaskedElementState.Parent&&this.zr(t,e)}}));else{if("initialDOM"===t.domEvent)return null;t.nodes=csArray.prototype.filter.call(t.nodes,(t=>t!==e))}}return t}Hr(t,s){return 0===s.attributes.length?t.attributes:csArray.prototype.filter.call(t.attributes,(t=>-1===csArray.prototype.indexOf.call(s.attributes,t.name)))}zr(t,s){const e=`width: ${s.width}px !important; height: ${s.height}px !important;`;t.children=[],csArray.prototype.push.call(t.attributes,{name:"style",value:e,namespaceURI:""}),_i.getAttribute(t,"data-cs-mask")||csArray.prototype.push.call(t.attributes,{name:"data-cs-mask",value:"",namespaceURI:""})}}oi([gs("MaskedElementProcessor.processEvent")],Ln.prototype,"processEvent",null);const Mn=/[\u4E00-\u9FFF]|[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]/g,Dn=/[^a\s]/g;function Un(t){const s=csString.prototype.replace.call(t,Mn,"a");return csString.prototype.replace.call(s,Dn,"a")}csArray.prototype.reduce.call(["a","e","i","o","mi","id","ex","ut","eu","ac","in","et","sit","vel","sed","leo","amet","elit","orci","erat","quam","odio","eget","lorem","ipsum","dolor","nulla","vitae","purus","proin","neque","porta","augue","velit","lacus","justo","magna","mollis","nullam","turpis","tortor","lectus","luctus","dictum","integer","aliquam","viverra","rhoncus","posuere","egestas","laoreet","vivamus","euismod","sagittis","molestie","faucibus","pulvinar","ultrices","volutpat","ultricies","venenatis","vulputate","convallis","phasellus","adipiscing","vestibulum","consectetur","ullamcorper","sollicitudin"],((t,s)=>{var e;return t.set(s.length,[...null!==(e=t.get(s.length))&&void 0!==e?e:[],s]),t}),new Map);class Bn{get selectors(){return""===this.jr?null:this.jr}constructor(t,s={closest:!1}){this.Ss=t,this.Gr=s,this.jr="",this.Zr=Mi(),this.Qn=ws((t=>{if(""===this.jr)return;const s=[];for(const e of xs(t,(t=>t.addedNodes))){if(!(_(e)||this.Gr.closest&&d(e)))continue;Us(this.Gr.closest?this.Wr(e,this.jr):this.findMatchingElements(e,this.jr),s)}s.length&&this.Ss(s,"added")}),"SelectorObserver.processMutations"),this.Qe=new Yi(this.Qn)}observe(t){""===this.jr?this.Qe.observe():this.jr+=",",this.jr+=t;const s=this.findMatchingElements(document,t);s.length&&($s(s,(t=>{this.Zr.add(t)})),this.Ss(s,"initial"))}processPendingMutations(){this.Qn(this.Qe.takeRecords())}disconnect(){this.Qe.disconnect(),this.Zr.clear(),this.jr=""}Wr(t,s){const e=[];if(d(t)){if(t.parentElement){const i=ke(t.parentElement,s);i&&csArray.prototype.push.call(e,i)}return csArray.prototype.filter.call(e,(t=>!1===this.Zr.has(t)))}if(St(t)){const i=ke(t,s);if(i)return csArray.prototype.push.call(e,i),csArray.prototype.filter.call(e,(t=>!1===this.Zr.has(t)))}return this.findMatchingElements(t,s)}findMatchingElements(t,s){const e=xs(ie.getAllShadowHosts(t),(t=>window.csquerySelectorAll[t.shadowRoot.nodeType].call(t.shadowRoot,s)));return Us(window.csquerySelectorAll[t.nodeType].call(t,s),e),l(t)&&Pe.call(t,s)&&csArray.prototype.push.call(e,t),csArray.prototype.filter.call(e,(t=>!1===this.Zr.has(t)))}}var Fn;zs([ns()],Bn.prototype,"observe",null),zs([ns()],Bn.prototype,"disconnect",null),zs([gs("SelectorObserver.findMatchingElements")],Bn.prototype,"findMatchingElements",null),function(t){let s,e;t.ANONYMIZED_TEXT_STATUS_PROP="anonymizationStatus",t.CS_CAPTURE_ATTRIBUTE="data-cs-capture",t.WHITELISTED_STATUS="whitelisted",t.start=function(){s||(s=new Bn((s=>function(s){$s(s,(s=>{Zs(s).visitAll((s=>function(s){Ae.setProperty(s,t.ANONYMIZED_TEXT_STATUS_PROP,t.WHITELISTED_STATUS)}(s)))}))}(s))));const i=e?`[${t.CS_CAPTURE_ATTRIBUTE}], ${e}`:`[${t.CS_CAPTURE_ATTRIBUTE}]`;s.observe(i)},t.stop=function(){s&&s.disconnect()},t.setWhitelistedElementsSelector=function(t){e=t},t.getWhitelistedElementsSelector=function(){return e},t.isWhitelisted=function(s){return Ae.getProperty(s,t.ANONYMIZED_TEXT_STATUS_PROP)===t.WHITELISTED_STATUS}}(Fn||(Fn={}));class qn extends mn{constructor(t,s,e){super(),this.Jr=t,this.Kr=s,this.Yr=e}setAnonymization(t){this.Jr=t}isListening(t){return pn.isDOMEvent(t)&&("initialDOM"===t.domEvent||"nodesAdded"===t.domEvent||"attributeChanged"===t.domEvent||"characterDataChanged"===t.domEvent)}processEvent(t){switch(t.domEvent){case"initialDOM":case"nodesAdded":this.Qr(t);break;case"attributeChanged":this.Xr(t);break;case"characterDataChanged":this.so(t)}return t}Qr(t){const s="initialDOM"===t.domEvent?[t.initialDOM]:t.nodes;for(const t of s)Ae.traverse(t,((t,s)=>{if(t.anonymized=this.Jr,3===t.nodeType){let e=this.Jr;return s&&("style"===s.localName||Fn.isWhitelisted(s))&&(e=!1),t.anonymized=e,void(t.data=this.eo(e,t.data,null==s?void 0:s.localName,s?Ae.getProperties(s):void 0))}if(_i.isElement(t))return this.io(t);4!==t.nodeType||(t.data=this.Jr?Un(t.data):this.Yr(t.data))}))}io(t){if(Ae.getProperty(t,"SVG"))return;const s=csArray.prototype.some.call(t.attributes,(t=>"type"===t.name&&("submit"===t.value||"button"===t.value)));t.attributes=csArray.prototype.map.call(t.attributes,(e=>(e.anonymized=this.Jr,e.value=this.no(t.localName,this.Jr,e.name,e.value,s),e)))}Xr(t){if(t.isSvg)return;const s="submit"===t.inputType||"button"===t.inputType;t.newValue=this.no(t.localName,this.Jr,t.attribute,t.newValue,s)}no(t,s,e,i,n){return this.ro(e)&&!this.oo(e,i)||"svg"===t||"slot"===t?i:"value"===e&&"input"===t&&s&&n?Un(i):s?"":this.Yr(i)}ro(t){return this.Kr.allWhitelistedAttributes.has(t)}oo(t,s){return!(!this.Kr.attributesCheckers||!Rt(this.Kr.attributesCheckers[t]))&&this.Kr.attributesCheckers[t](s)}so(t){t.newValue=this.eo(this.Jr,t.newValue,t.parentLocalName,t.parentProps)}eo(t,s,e,i){if(e){if("style"===e)return s;if(t&&i&&i[Fn.ANONYMIZED_TEXT_STATUS_PROP]===Fn.WHITELISTED_STATUS)return this.Yr(s)}return t?Un(s):this.Yr(s)}}oi([gs("AnonymizedTextProcessor.processEvent")],qn.prototype,"processEvent",null);const Hn="textarea";class zn extends mn{isListening(t){return pn.isDOMEvent(t)&&("initialDOM"===t.domEvent||"nodesAdded"===t.domEvent||"characterDataChanged"===t.domEvent)}processEvent(t){switch(t.domEvent){case"initialDOM":this.ho(t);break;case"nodesAdded":this.co(t);break;case"characterDataChanged":this.ao(t)}return t}ho(t){Ae.traverse(t.initialDOM,((t,s)=>{this.uo(t,s)&&(t.data=this.lo(t.data))}))}co(t){for(const s of t.nodes)Ae.traverse(s,((s,e)=>{this.do(s,e,t)&&(s.data=this.lo(s.data))}))}ao(t){t.parentLocalName===Hn&&(t.newValue=this.lo(t.newValue))}lo(t){return csString.prototype.replace.call(t,/\S/g,"•")}do(t,s,e){return this.fo(t,e)||this.uo(t,s)}fo(t,s){return 3===t.nodeType&&s.targetLocalName===Hn}uo(t,s){return 3===t.nodeType&&At(s)&&s.localName===Hn}}oi([gs("AnonymizedTextAreaProcessor.processEvent")],zn.prototype,"processEvent",null);class jn extends ln{constructor(t){super(),this.po=t}onStart(){this.produceEvent({type:"Debug",key:"debugInfo",value:this.po})}}class Gn{constructor(t){this.Ss=t,this.vo={boundElement:window,type:"resize",listener:()=>this.resizeListener()},this.Ss=t}observe(){oe(this.vo),this.Us()}Us(){this.resizeListener()}disconnect(){he(this.vo)}resizeListener(){const t={width:Ni.windowWidth(),height:Ni.windowHeight()};this.Ss(t)}}var Zn,Wn,Jn,Kn,Yn,Qn,Xn;zs([ns("resize")],Gn.prototype,"resizeListener",null),function(t){t.PORTRAIT="Portrait",t.LANDSCAPE="Landscape"}(Zn||(Zn={})),function(t){t.PORTRAIT_PRIMARY="portrait-primary",t.PORTRAIT_SECONDARY="portrait-secondary",t.LANDSCAPE_PRIMARY="landscape-primary",t.LANDSCAPE_SECONDARY="landscape-secondary"}(Wn||(Wn={})),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"}(Jn||(Jn={})),function(t){function s(){return"orientation"in window.csScreen}function e(){return"orientation"in window}t.isScreenOrientationApiSupported=s,t.isDeprecatedScreenOrientationApiSupported=e;const i=s()?function(){switch(window.csScreen.orientation.type){case Wn.PORTRAIT_PRIMARY:case Wn.PORTRAIT_SECONDARY:return Zn.PORTRAIT;case Wn.LANDSCAPE_PRIMARY:case Wn.LANDSCAPE_SECONDARY:return Zn.LANDSCAPE;default:return Zn.PORTRAIT}}:e()?function(){switch(window.orientation){case Jn.PORTRAIT:case Jn.PORTRAIT_REVERSE:return Zn.PORTRAIT;case Jn.LANDSCAPE:case Jn.LANDSCAPE_REVERSE:return Zn.LANDSCAPE;default:return Zn.PORTRAIT}}:function(){return Zn.LANDSCAPE};t.getCurrentOrientation=function(){return i()}}(Kn||(Kn={}));class tr extends ln{constructor(){super(...arguments),this.mo=null,this.wo=null,this.yo=new Gn((t=>{this.produceEvent({...t,type:"viewportResize"}),this.onScreenPotentiallyChanged()}))}onScreenPotentiallyChanged(){const t=Kn.getCurrentOrientation(),{screenWidth:s,screenHeight:e}=this.Eo(t);if(s!==this.mo||e!==this.wo){this.mo=s,this.wo=e;const t={type:"screenResize",width:s,height:e};this.produceEvent(t)}}Eo(t){let s,e;const i=Ni.screenWidth(),n=Ni.screenHeight();return t===Zn.PORTRAIT?(s=i,e=n):(s=Math.max(i,n),e=Math.min(i,n)),{screenWidth:s,screenHeight:e}}onStart(){this.yo.observe()}onStop(){this.mo=null,this.wo=null,this.yo.disconnect()}}class sr extends ln{constructor(){super(),this.Ao="object"==typeof window.customElements&&"function"==typeof window.customElements.whenDefined&&"function"==typeof window.Promise,this._o=rs("CustomElementRegistrationProducer:onElementsFound",(t=>{for(const e of t)Oe.isMaskedElement(e)||Oe.isMaskedElementChild(e)||l(s=e)&&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(I,csString.prototype.toLocaleLowerCase.call(s.tagName))<0&&this.register(csString.prototype.toLowerCase.call(e.tagName));var s}));const t=Di(this._o);this.Kn=new Cn((s=>t.push(s))),this.Ro=new Set}onStart(){this.Ao&&this.Kn.observe()}onStop(){this.Ro.clear(),this.Kn.disconnect()}async register(t){this.Ro.has(t)||(this.Ro.add(t),await window.customElements.whenDefined(t),this.produceEvent({type:"CustomElementRegistration",tagName:csString.prototype.toLowerCase.call(t)}))}}oi([ns()],sr.prototype,"register",null),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}}(Yn||(Yn={}));class er{static So(){return new window.PerformanceObserver((t=>er.To(t)))}static To(t){const s=t.getEntriesByType("navigation")[0];s&&(this.Io=s,er.Po(s))}static vs(t){er.bo(t),er.Io&&t(er.Io),er.Vo||er.Co()}static bo(t){er.ko.add(t)}static Oo(t){er.ko.delete(t)}static Co(){if(!er.xo)return er.Io||(er.Io={requestStart:window.performance.timing.requestStart,domInteractive:window.performance.timing.domInteractive}),void er.Po(er.Io);er.xo.observe({type:"navigation",buffered:!0}),er.Vo=!0}static Po(t){er.ko.forEach((s=>{s(t)}))}static Rs(t){er.Oo(t),0===er.ko.size&&er.$o()}static $o(){var t;er.Vo&&(null===(t=er.xo)||void 0===t||t.disconnect(),er.Vo=!1,er.Io=null,er.xo=this.So())}constructor(t){this.Ss=t}observe(){er.vs(this.Ss)}disconnect(){er.Rs(this.Ss)}}er.xo=Yn.isNavigationTimingObserverSupported()?er.So():null,er.Vo=!1,er.ko=new Set,er.Io=null;class ir extends ln{constructor(){super(...arguments),this.Lo=null,this.Mo=new er((t=>{if(this.Lo)return;const s=this.Do(t);s&&(this.Lo=s,this.produceEvent(s))}))}onStart(){this.Lo?this.produceEvent(this.Lo):this.Mo.observe()}onStop(){this.Mo.disconnect()}Do(t){const s=Yn.getTimeOrigin();return{type:"PerformanceTiming",timings:{timeOrigin:s,requestStart:Math.floor(s+t.requestStart),domInteractive:Math.floor(s+t.domInteractive)},timestamp:It.now()}}}!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"}(Qn||(Qn={})),function(t){t[t.UP=1]="UP",t[t.DOWN=2]="DOWN",t[t.LEFT=3]="LEFT",t[t.RIGHT=4]="RIGHT"}(Xn||(Xn={}));class nr{compute(t,s){const e=this.Uo(s.x)-this.Uo(t.x),i=this.Uo(s.y)-this.Uo(t.y),n=s.time-t.time;return{duration:n,distance:this.Bo(e,i),direction:this.Fo(e,i),velocity:this.qo(e,i,n)}}computePinchMetrics(t,s){const e=this.Uo(s.x)-this.Uo(t.x),i=this.Uo(s.y)-this.Uo(t.y);return{duration:s.time-t.time,distance:this.Bo(e,i)}}getScale(t,s){return Math.abs(s/t-1)}Uo(t){return t/window.devicePixelRatio}Bo(t,s){return Math.round(Math.sqrt(t*t+s*s))}qo(t,s,e){const i=e/1e3,n=t/i,r=s/i;return Math.round(Math.abs(n)+Math.abs(r))}Fo(t,s){return Math.abs(t)>Math.abs(s)?t>0?Xn.RIGHT:Xn.LEFT:s>0?Xn.DOWN:Xn.UP}}class rr{constructor(){this.Ho={},this.zo=()=>{},this.jo=new nr,this.Go()}static isGestureDetectionSupported(){return void 0!==window.devicePixelRatio}onGesture(t){this.zo=t}isValidTouchEvent(t){return"touches"in t&&"changedTouches"in t}processActionDown(t){if(!this.Zo(t))return;this.Wo(t)&&this.Go();const s={x:t.touches[0].clientX,y:t.touches[0].clientY,time:It.now()};if(1===t.touches.length)this.Ho.startPinchTime=s.time,this.Ho.firstTouch=s;else if(2===t.touches.length&&(this.Ho.secondTouch={x:t.touches[1].clientX,y:t.touches[1].clientY,time:It.now()},this.Ho.firstTouch&&this.Ho.secondTouch)){const t=this.jo.computePinchMetrics(this.Ho.firstTouch,this.Ho.secondTouch);this.Jo=t.distance}csArray.prototype.push.call(this.Ko,s),this.Yo=me(t)}processActionMove(){this.Qo=!0}processActionUp(t){if(this.Xo(t)){if(csArray.prototype.push.call(this.Ko,{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY,time:It.now()}),this.th(t)&&this.Ho.startPinchTime){const s={x:t.touches[0].clientX,y:t.touches[0].clientY,time:this.Ho.startPinchTime},e={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY,time:It.now()};this.Ho.firstTouch&&(this.Ho.firstTouch=s,this.Ho.secondTouch=e),this.eh(t)}this.Jo||this.ih()&&this.nh(t)}}Go(){this.Ko=[],this.Yo=null,this.Qo=!1,this.Jo=null,this.rh=!0}nh(t){const s=this.jo.compute(this.Ko[0],this.Ko[1]);this.rh=t.isTrusted;const e=this.Qo?this.oh(s):this.hh(s);if(this.ah(e.type,t.changedTouches)){const s=t.changedTouches[0];e.pageX=ce(s.pageX,1),e.pageY=ce(s.pageY,1)}this.zo(e,t)}eh(t){if(!this.Ho.firstTouch||!this.Ho.secondTouch)return;const s=this.jo.computePinchMetrics(this.Ho.firstTouch,this.Ho.secondTouch);this.rh=t.isTrusted;const e=this.uh(s);e&&this.zo(e,t)}uh(t){if(!this.Jo)return;if(this.jo.getScale(this.Jo,t.distance)<.1)return;return{type:this.Jo>t.distance?Qn.PINCH_IN:Qn.PINCH_OUT,target:this.Yo,distance:t.distance,isTrusted:this.rh}}oh(t){return{type:t.velocity<100?Qn.DRAG:Qn.FLICK,target:this.Yo,velocity:t.velocity,distance:t.distance,direction:t.direction,isTrusted:this.rh}}hh(t){return{type:t.duration<1e3?Qn.TAP:Qn.LONG_PRESS,target:this.Yo,isTrusted:this.rh}}ah(t,s){return t===Qn.TAP&&s&&1===s.length}Wo(t){return 1===t.touches.length}ih(){return 2===this.Ko.length}Zo(t){return t.touches.length>0}Xo(t){return t.changedTouches.length>0}th(t){return this.Qo&&!!this.Jo&&1===t.changedTouches.length&&1===t.touches.length}}class or{constructor(t){this.Ss=t}observe(){or.fh&&or.ph(this.Ss)}disconnect(){or.fh&&or.mh(this.Ss)}static gh(t,s){or.ko.forEach((e=>e(t,s)))}static ph(t){or.ko.has(t)||(or.ko.add(t),1===or.ko.size&&(or.yh.onGesture(or.gh),csArray.prototype.forEach.call(or.Un,(t=>oe(t)))))}static mh(t){or.ko.delete(t),0===or.ko.size&&csArray.prototype.forEach.call(or.Un,(t=>he(t)))}static Eh(t){if(or.yh.isValidTouchEvent(t))switch(t.type){case"touchstart":or.yh.processActionDown(t);break;case"touchmove":or.yh.processActionMove();break;case"touchend":or.yh.processActionUp(t)}}}or.Un=[{boundElement:document,type:"touchstart",listener:t=>or.Eh(t)},{boundElement:document,type:"touchmove",listener:t=>or.Eh(t)},{boundElement:document,type:"touchend",listener:t=>or.Eh(t)}],or.fh=rr.isGestureDetectionSupported(),or.ko=new Set,or.yh=new rr;class hr extends ln{constructor(){super(),this.Ah=new or(this._h.bind(this))}onStart(){this.Ah.observe()}onStop(){this.Ah.disconnect()}_h(t){const s=this.Rh(t);s&&this.produceEvent(s)}Rh(t){if(!this.Sh(t))return null;const s=(e=t.target,Ae.getProperty(e,Re));var e;return s?{type:"Gesture",targetId:s,data:{type:t.type,direction:t.direction,distance:t.distance,velocity:t.velocity,pageX:t.pageX,pageY:t.pageY}}:null}Sh(t){return null!==t.target&&!(l(t.target)&&Oe.isMaskedElementChild(t.target))}}function cr(t){return"INPUT"===t.nodeName}function ar(t){return cr(t)&&"number"===t.type}function ur(t){return cr(t)&&("checkbox"===t.type||"radio"===t.type)}class lr extends ln{constructor(t){super(),this.Li=t,this.Th=Mi(),this.Ih=t=>this.inputHandler(t),this.Ph=[],this.bh(),this.Vh(),this.Ch=new Bn((t=>{for(const s of t)this.kh(s)&&Ci((()=>{this.Oh(s,Se(s))}))})),this.Os=new re(((t,s)=>{switch(s){case"initial":case"added":oe({type:"change",listener:this.Ih,boundElement:t});break;case"removed":he({type:"change",boundElement:t,listener:this.Ih})}}))}onStart(){oe({type:"keyup",boundElement:document,listener:this.Ih}),oe({type:"change",boundElement:document,listener:this.Ih}),$s(this.Ph,(t=>t.activate())),this.Ch.observe(csArray.prototype.join.call(lr.Nh,",")),this.Os.observe()}onStop(){he({type:"keyup",boundElement:document,listener:this.Ih}),he({type:"change",boundElement:document,listener:this.Ih}),$s(this.Ph,(t=>t.deactivate())),this.Ch.disconnect(),this.Os.disconnect(),this.Th.clear()}Oh(t,s){var e,i,n;if(this.Th.has(t))return;if(this.Th.add(t),function(t){return"SELECT"===t.nodeName}(t)){const s={type:"InputEvent",inputType:"select",target:Se(t),selectedIndex:t.selectedIndex,timestamp:It.now()};return void this.produceEvent(s)}if(ur(t)){const s={type:"InputEvent",inputType:"checkable",target:Se(t),checked:t.checked,timestamp:It.now()};return void this.produceEvent(s)}const r=function(t){return"TEXTAREA"===t.nodeName||cr(t)&&!ar(t)&&!ur(t)}(t),o=ar(t);if(r||o){const r=null!==(e=t.value)&&void 0!==e?e:"";if(null===(i=this.Li)||void 0===i?void 0:i.shouldEncrypt(t))return void(null===(n=this.Li)||void 0===n||n.registerInputNodeToEncrypt({targetId:s,targetValue:r,date:It.now()}));const h=o?"0":"•",c={type:"InputEvent",inputType:"text",target:Se(t),value:csString.prototype.replace.call(r,/\S/g,h),timestamp:It.now()};this.produceEvent(c)}}inputHandler(t){if(!this.isStarted)return;const s=me(t),e=Se(s);e&&this.kh(s)&&Li.isConnected(s)&&Ci((()=>{this.Oh(s,e)}))}bh(){this.trackChanges(HTMLInputElement,"checked"),this.trackChanges(HTMLInputElement,"value"),this.trackChanges(HTMLTextAreaElement,"value")}Vh(){this.trackChanges(HTMLSelectElement,"selectedIndex"),this.trackChanges(HTMLSelectElement,"value"),this.trackChanges(HTMLOptionElement,"selected",!0)}trackChanges(t,s,e=!1){const i=ee(t.prototype,s,((t,s,i)=>{if(i!==s&&Li.isConnected(t)){const s=e?t.parentElement:t;this.xh(s)}}));i&&csArray.prototype.push.call(this.Ph,i)}kh(t){return!Oe.isMaskedElement(t)&&!Oe.isMaskedElementChild(t)&&(w(t)||A(t)||g(t))}xh(t){if(this.isStarted&&Li.isConnected(t)){const s=Se(t);s&&this.kh(t)&&Ci((()=>{this.Oh(t,s)}))}}}lr.Nh=["textarea","input:not([type])",'input[type="text"]','input[type="email"]','input[type="search"]','input[type="tel"]','input[type="url"]','input[type="password"]','input[type="number"]','input[type="checkbox"]','input[type="radio"]',"select"],oi([hs()],lr.prototype,"inputHandler",null),oi([ns()],lr.prototype,"trackChanges",null);class dr{constructor(t){this.Ss=t,this.$h=!1,this.vo={boundElement:window,type:"error",listener:t=>this.Lh(t)}}observe(){oe(this.vo,this.$h)}disconnect(){he(this.vo,this.$h)}Lh(t){this.Ss(t)}}class fr extends ln{constructor(){super(...arguments),this.Mh=new dr((t=>this.Dh(t)))}Dh({message:t,filename:s,lineno:e,colno:i}){t=null!=t?t:"[NO ERROR MESSAGE]",this.produceEvent({type:"JSError",message:t,filename:s,lineno:e,colno:i})}onStart(){this.Mh.observe()}onStop(){this.Mh.disconnect()}}class pr extends mn{constructor(t){super(),this.Uh=t,this.Bh=1024}isListening(t){return"JSError"===t.type}processEvent(t){return t.message=vn.truncate(t.message,this.Bh,vn.ELLIPSIS),this.Uh(t)}}let vr=[],mr=!1;const wr=ws((function(){const t=csDate.now();for(let s=0;s=35)return vr=csArray.prototype.slice.call(vr,s+1),void csSetTimeout(wr);vr=[],mr=!1}),"executeTasks");var gr;!function(t){t[t.Started=0]="Started",t[t.Stopped=1]="Stopped",t[t.Processing=2]="Processing",t[t.Completed=3]="Completed"}(gr||(gr={}));class yr{constructor(){this.Fh=new cs,this.we=gr.Stopped,this.Ss=null,this.qh=t=>{this.we!==gr.Stopped&&t&&(this.Ss(t),this.Hh())}}get queueLength(){return this.Fh.length}start(t){if(this.Ss)throw new Error("callback already set");this.we=gr.Started,this.Ss=t}push(t){this.Fh.push(t),this.zh()}stop(){this.Ss=null,this.we=gr.Stopped,this.Fh.clear()}static pipe(t,s){let e=t;const i=new csArray;for(const t of s){const s=new yr;s.start((s=>{t.pushEvent(s)})),csArray.prototype.push.call(i,s),$s(e,(t=>t.subscribe((t=>s.push(t))))),e=[t]}const n=new Er(i);return $s(e,(t=>t.subscribe((t=>n.push(t))))),n}jh(){return this.we===gr.Stopped}Gh(){return this.we===gr.Processing}Hh(){this.jh()||(this.Fh.isEmpty?this.we=gr.Completed:(this.we=gr.Processing,function(t){if(csArray.prototype.push.call(vr,t),!mr){for(let t=0;t<3;t++)csSetTimeout(wr);mr=!0}}((()=>{const t=this.Fh.pop();t instanceof Ri?t.complete(this.qh):this.qh(t)}))))}zh(){this.jh()||this.Gh()||this.Hh()}}class Er extends yr{constructor(t){super(),this.Zh=t}get queueLength(){return csArray.prototype.reduce.call(this.Zh,((t,s)=>t+s.queueLength),0)}stop(){super.stop(),$s(this.Zh,(t=>t.stop()))}}class Ar{constructor(t,s=[]){this.producers=t,this.processors=s,this.gs=!1,this.ko=[]}get pendingEvents(){return this.Fh.queueLength}start(){if(this.gs)throw new Error("Recording is already started.");const t=this.ko;this.Fh=yr.pipe(this.producers,this.processors),this.Fh.start((s=>csArray.prototype.forEach.call(t,(t=>t(s))))),$s(this.producers,(t=>t.start())),$s(this.processors,(t=>t.start())),this.gs=!0}stop(){this.Fh.stop(),this.ko.length=0;for(const t of this.producers)t.stop();for(const t of this.processors)t.stop();this.gs=!1,this.ko=[]}subscribe(t){if(this.gs)throw new Error("Recording is already started.");return csArray.prototype.push.call(this.ko,t),()=>this.ko=csArray.prototype.filter.call(this.ko,(s=>s!==t))}}class _r extends ln{constructor(t){super(),this.Fi=t}subscribe(t){return super.subscribe(t)}onStart(){$s(this.Fi,(t=>{t.onEvent((t=>this.de(t)))})),$s(this.Fi,(t=>{var s;null===(s=t.start)||void 0===s||s.call(t)}))}onStop(){$s(this.Fi,(t=>{var s;return null===(s=t.stop)||void 0===s?void 0:s.call(t)}))}de(t){this.produceEvent({timestamp:It.now(),type:"Legacy",originalEvent:t})}}function Rr(t){const s=function(t){const s={type:Sr(t.type)};for(const e in t){const i=t[e];void 0!==i&&"type"!==e&&(s[e]=i)}return s}(t.data);return{type:ue.GESTURE_RECOGNITION,args:[t.targetId,s],date:t.timestamp}}function Sr(t){switch(t){case Qn.DRAG:case Qn.FLICK:return fe.SWIPE;case Qn.LONG_PRESS:return fe.LONG_PRESS;case Qn.TAP:return fe.TAP;case Qn.PINCH_IN:return fe.PINCH_IN;case Qn.PINCH_OUT:return fe.PINCH_OUT}}function Tr(t){return function(t,s){let e=[];return{push(t){csArray.prototype.push.call(e,t),e.length===s.batchSize&&this.flush()},flush(){if(!e.length)return;const s=e;e=[],t(s)}}}((s=>{const e={visibleInViewPort:s},i={type:ue.TEXT_VISIBILITY,date:It.now(),args:[e]};t(i)}),{batchSize:20})}var Ir;!function(t){t.REQUEST_START="requestStart",t.DOM_INTERACTIVE="domInteractive",t.TIME_ORIGIN="timeOrigin"}(Ir||(Ir={}));let Pr=0;class br{get pendingEvents(){return this.Wh.pendingEvents}constructor(t,s,e,i,n){this.Wh=t,this.Jh=s,this.Kh=e,this.ji=i,this.Gi=n,this.Yh=()=>{},this.Qh=()=>{},this.Xh=Tr((t=>this.Yh(t)))}start(){var t,s;this.tc={processEvent(t,s){if(t.originalEvent.type===ue.PERFORMANCE_RESOURCE_TIMING)return Pr>=500?null:(Pr+=1,s({...t.originalEvent,date:t.timestamp}));s(t.originalEvent)},reset(){Pr=0}},this.Wh.subscribe((t=>{var s,e,i,n,r;const o=t,{timestamp:h}=o;switch(o.type){case"Legacy":this.tc.processEvent(o,this.Yh);break;case"CustomElementRegistration":this.Yh({type:ue.CUSTOM_ELEMENT_REGISTRATION,date:h,args:[o.tagName]});break;case"DomEvent":!function(t,s,e){const{timestamp:i}=t;switch(t.domEvent){case"initialDOM":{const{initialDOM:s}=t,n={type:ue.INITIAL_DOM,date:i,args:[s]};e.emitInitialDomDone(n);break}case"nodesAdded":csArray.prototype.forEach.call(t.nodes,(e=>{s({type:ue.MUTATION_INSERT,date:i,args:[t.target,t.nextSibling,e]})}));break;case"nodesMoved":for(const e of t.nodesIds)s({type:ue.MUTATION_MOVE,date:i,args:[e,t.nextSibling,t.target]});break;case"nodesRemoved":csArray.prototype.forEach.call(t.nodesIds,(t=>{s({type:ue.MUTATION_REMOVE,date:i,args:[t]})}));break;case"attributeChanged":{const{target:e,namespace:n,attribute:r,newValue:o}=t;s({type:ue.MUTATION_ATTRIBUTE,date:i,args:[e,n,r,o]});break}case"characterDataChanged":{const{target:e,newValue:n}=t;s({type:ue.MUTATION_CHARACTER_DATA,date:i,args:[e,n]});break}case"cssRuleInserted":{const{target:e,rule:n,index:r}=t,o=At(r)?[e,n,r]:[e,n];s({type:ue.STYLESHEET_RULE_INSERT,date:i,args:o});break}case"cssRuleDeleted":{const{target:e,index:n}=t;s({type:ue.STYLESHEET_RULE_DELETE,date:i,args:[e,n]});break}case"cssRuleUpdated":{const{target:e,rule:n,index:r}=t;s({type:ue.STYLESHEET_RULE_UPDATE,date:i,args:[e,n,r]});break}case"shadowRootAttached":{const{target:e,shadowRoot:n}=t;s({type:ue.ATTACH_SHADOW,date:i,args:[e,n]});break}case"adoptedStyleSheetRegistered":{const{sheetId:e,cssRules:n}=t;s({type:ue.REGISTER_ADOPTED_STYLE_SHEET,date:i,args:[e,{cssRules:n}]});break}case"adoptedStyleSheetsSet":{const{target:e,sheetsIds:n}=t;s({type:ue.SET_ADOPTED_STYLE_SHEETS,date:i,args:[e,n]});break}case"adoptedStyleSheetRuleInserted":{const{sheetId:e,rule:n,index:r}=t,o=At(r)?[e,n,r]:[e,n];s({type:ue.ADOPTED_STYLESHEET_RULE_INSERT,date:i,args:o});break}case"adoptedStyleSheetRuleDeleted":{const{sheetId:e,index:n}=t;s({type:ue.ADOPTED_STYLESHEET_RULE_DELETE,date:i,args:[e,n]});break}case"adoptedStyleSheetRuleUpdated":{const{sheetId:e,rule:n,index:r}=t,o=[e,n,r];s({type:ue.ADOPTED_STYLESHEET_RULE_UPDATE,date:i,args:o});break}default:es.error("translateDOMEvent: DOMEvent not supported")}}(o,this.Yh,this.Jh);break;case"InputEvent":{const t=function(t){switch(t.inputType){case"text":return{type:ue.INPUT_TEXT,args:[t.target,t.value],date:t.timestamp};case"select":return{type:ue.INPUT_SELECT,args:[t.target,t.selectedIndex],date:t.timestamp};case"checkable":return{type:ue.INPUT_CHECKABLE,args:[t.target,t.checked],date:t.timestamp}}}(o);null===(s=this.Qh)||void 0===s||s.call(this,t);break}case"encryptedCharacterDataChanged":{const{target:t,rawData:s,encryptedData:e,encryptionMetadata:i}=o;this.Yh({type:ue.MUTATION_ENCRYPTED_CHARACTER_DATA,date:h,args:[t,s,e,i]});break}case"StaticResource":{const{url:t}=o;this.Yh({type:ue.STATIC_RESOURCE_URL,date:h,args:[t]});break}case"ResizeMaskedElement":{const{target:t,width:s,height:e}=o;this.Yh({type:ue.MUTATION_ATTRIBUTE,date:h,args:[t,"","style",`width:${s}px !important;height:${e}px !important;`]});break}case"Gesture":{const s=Rr(t);null===(e=this.Qh)||void 0===e||e.call(this,s);break}case"TextVisibility":this.Xh.push(o.text);break;case"StaticResourceManagerEvent":null===(i=this.Kh)||void 0===i||i.processEvent(o);break;case"screenResize":{const{width:t,height:s}=o,e={type:ue.SCREEN_RESIZE,date:h,args:[t,s]};this.Yh(e);break}case"viewportResize":{const{width:t,height:s}=o,e={type:ue.RESIZE,date:h,args:[t,s]};this.Yh(e);break}case"PerformanceTiming":this.Yh(function(t){return{type:ue.PERFORMANCE_TIMINGS,args:[{performanceTiming:Ir.REQUEST_START,timestamp:t.timings.requestStart},{performanceTiming:Ir.DOM_INTERACTIVE,timestamp:t.timings.domInteractive},{performanceTiming:Ir.TIME_ORIGIN,timestamp:t.timings.timeOrigin}],date:t.timestamp}}(o));break;case"CustomError":{const t=null===(n=this.Gi)||void 0===n?void 0:n.translate(o);t&&this.Yh(t);break}case"JSError":{const t=null===(r=this.ji)||void 0===r?void 0:r.translate(o);t&&this.Yh(t);break}case"Debug":this.Yh({type:ue.DEBUG,date:h,args:[o.key,o.value]});break;case"warning":es.warn(o.message);break;default:es.error(`WebRecorderEventTranslator: Event not supported (${o.type})`)}})),this.Jh.emitInitialDomStart(),null===(t=this.ji)||void 0===t||t.start(),null===(s=this.Gi)||void 0===s||s.start(),this.Wh.start()}stop(){var t,s,e;this.reset(),this.flush(),this.Wh.stop(),null===(t=this.Kh)||void 0===t||t.flushEvents(),null===(s=this.ji)||void 0===s||s.stop(),null===(e=this.Gi)||void 0===e||e.stop()}flush(){this.Xh.flush()}onEvent(t,s){var e;this.Yh=t,this.Qh=s,null===(e=this.Kh)||void 0===e||e.onEvent((t=>this.Yh(t)))}reset(){this.tc.reset()}}class Vr{constructor(t=100){this.sc=t,this.ec={},this.nc=null,this.ai="original-resource-name"}onEvent(t){this.rc=t}processEvent(t){this.oc(t.resourceId,t.resource.hash,t.originalResourceName),this.hc(t)}flushEvents(){this.nc&&csClearTimeout(this.nc),this.cc()}onSendStaticResource(t){this.hc=t}cc(){if(!Object.keys(this.ec).length)return;const t={type:ue.RESOURCE_HASHES,date:It.now(),args:[this.ec]};this.nc=null,this.ec={},this.rc(t)}oc(t,s,e){let i=s;e&&(i+=`?${this.ai}=${e}`),this.ec[t]=i,this.nc||(this.nc=window.csSetTimeout((()=>this.cc()),this.sc))}}function Cr(t,s){let e,i,n,r,o=null;const h=c=>{const a=It.now();if(!c&&null!==o){const t=s-(a-o);if(t>0)return void(i=window.csSetTimeout(h,t))}const u=a-n;i=null,o=null,n=null,r=t(u,...e)},c=(...t)=>{if(e=[...t],!n)return n=It.now(),i=window.csSetTimeout(h,s),r;o=It.now()};return c.flushPending=()=>{i&&(window.csClearTimeout(i),h(!0))},c.cancel=()=>{o=null,n=null,i&&(window.csClearTimeout(i),i=null)},c}function kr(t=0){return(s,e,i)=>{const n=i.value;let r=!1;i.value=function(...s){r||(r=!0,csSetTimeout((()=>{r=!1,n.apply(this,s)}),t))}}}var Or;!function(t){t[t.NOT_EXIST=2]="NOT_EXIST"}(Or||(Or={}));class Nr extends Ue{constructor(t,s,e){super(),this.Kh=t,this.ac=s,this.lc=e,this.fc={},this.vc=new Set,this.Gh=!1}initState(){bt()&&(this.mc=this.lc.getRequestParameters(),this.wc=`${this.ac}/exist?${Q.toQuery(this.mc)}`,this.gc=`${this.ac}/putTag?${Q.toQuery(this.mc)}`,this.yc=Cr((async()=>{if(this.Gh)this.yc();else{this.Gh=!0;try{await this.Ec()}finally{this.Gh=!1}}}),300),this.Kh.onSendStaticResource((t=>{this.Ac(t)})))}onStart(){}onStop(){}onIframeStaticResource(t){this.Ac(t)}Ac(t){this._c(t.resource.hash,t.resource.data),t.nestedResources&&t.nestedResources.length>0&&csArray.prototype.forEach.call(t.nestedResources,(t=>{this._c(t.hash,t.data)}))}_c(t,s){this.vc.has(t)||(this.vc.add(t),this.fc[t]=s,this.yc())}async Ec(){const t=this.fc;this.fc={};const s=await this.Rc(t);if(!s.length)return;const e=this.Sc(s);await Promise.all(csArray.prototype.map.call(e,(t=>window.fetch(this.gc,{method:"POST",body:t}))))}async Tc(t){try{const s=Object.keys(t);if(!s.length)return[];const e={projectId:this.mc.pid,filter:Or.NOT_EXIST,hashes:s,touch:!0},i=await window.fetch(this.wc,{method:"POST",body:csJSON.stringify(e)});return await i.json()}catch(t){return[]}}async Rc(t){const s=[],e=await this.Tc(t);return csArray.prototype.forEach.call(e,(e=>{const i=t[e];i?csArray.prototype.push.call(s,{hash:e,data:i}):es.warn("SRM: received unknown hash: "+e)})),s}Sc(t){let s=0;const e=[new FormData];for(const i of t){const{data:t,hash:n}=i,r=e.length-1;if(s+=t.size,s<8388608)e[r].append("",t,n);else{const i=new FormData;i.append("",t,n),s=t.size,csArray.prototype.push.call(e,i)}}return e}}class xr{constructor(t){this.Ic=t,this.Pc=20,this.bc=0,this.Xs=!1}translate(t){if(this.bc>=this.Pc)return this.Ic.stop(),null;this.bc+=1;const{filename:s,message:e,lineno:i,colno:n,timestamp:r}=t;return{type:ue.JAVASCRIPT_ERROR,date:r,args:[{errorType:"jsError",message:e,filename:s,lineno:i,colno:n}]}}start(){this.Xs||(this.bc=0,this.Xs=!0)}stop(){this.Xs=!1}}class $r{constructor(){this.Pc=20,this.Vc=0,this.Xs=!1}translate(t){if(this.Vc>=this.Pc)return null;this.Vc+=1;const{message:s,attributes:e,timestamp:i}=t;return{type:ue.CUSTOM_ERROR,date:i,args:[{errorType:"customError",message:s,attributes:e}]}}start(){this.Xs||(this.Vc=0,this.Xs=!0)}stop(){this.Xs=!1}}const Lr=["id","class","style","src","srcset","sizes","href","rel","type","width","height","media","align","dir","bgcolor","color","border","colspan","rowspan","cols","rows","size","start","slot",N],Mr=t=>{const s=new Set;csArray.prototype.forEach.call(Lr,(t=>{s.add(t)})),csArray.prototype.forEach.call(t.whitelistedAttributes,(t=>{s.add(t)}));const e=t.isSMB?{href:Dr}:void 0;return{allWhitelistedAttributes:s,attributesCheckers:e}},Dr=t=>!hi(t),Ur="v2/recording",Br=["setCapturedElementsSelector"],Fr=["isRecording"],qr=["replay:resourceManager:enableForOnlineResource:nextPageviewOnly","cssrm:onlineAssets:activateForNextPageview"],Hr=["replay:resourceManager:getStatus","cssrm:getStatus"];class zr{constructor(t,s,e,i,n,r,o,h,c,a,u,l,d,f,p,v,m,w,g){this.Cc=t,this.J=s,this.L=e,this.mc=i,this.kc=n,this.M=r,this.Oi=o,this.Oc=h,this.Ni=c,this.xi=a,this.$i=u,this.Jh=l,this.Nc=d,this.xc=f,this.$c=p,this.Lc=v,this.Mc=m,this.zi=w,this.Dc=g}init(){var t;const s=[],e=[];csArray.prototype.push.call(e,new Ln),this.Uc=new qn(this.Dc.shouldUseAnonymization(),Mr(this.L),(t=>this.M.checkAndAnonymizePII(t,this.L.anonymizeDigits))),this.Bc();const i=new $n("csPersisted");this.Fc(i);const n=new Me;this.bi=new Le;const r=new kn;csArray.prototype.push.call(s,r),this.L.useStaticResourceManager&&Rn.isSupported()&&(this.Hi=new Rn,this.Kh=new Vr,this.qc=new Nr(this.Kh,this.L.getStaticResourceManagerUri(),this.mc),this.xc.addListener(this.qc),csArray.prototype.push.call(e,this.Hi));const o=new In(n,this.mc,{getRequestParameters:()=>({let:this.recordingService.getRecordingLastEventTimestamp()})},{getRequestParameters:()=>({rst:this.recordingService.getRecordingStartTimestamp()})},{getRequestParameters:()=>({rt:csArray.prototype.join.call(this.J.getRecordingStates(),",")})}),h=new On(`${this.L.getRecordingUri()}/${Ur}`);csArray.prototype.push.call(e,this.Uc),csArray.prototype.push.call(e,new zn),this.ki=new Ne,this.ki.init(),this.Di=new Tn(i,h,this.Mi),csArray.prototype.push.call(s,new Pn(window.location,this.M));const c=new fn,a=[new jn({version:"15.21.0",visibilityState:document.visibilityState}),this.Oc,c,new _r(csArray.prototype.filter.call(s,(t=>t))),new tr,new sr,new ir,new hr,new lr(this.Li)];this.L.jsErrorsEnabled&&(this.Ic=new fr,this.Hc=new pr((t=>this.Ni.anonymize(t))),this.ji=new xr(this.Ic),csArray.prototype.push.call(a,this.Ic),csArray.prototype.push.call(e,this.Hc)),(null===(t=this.L.customErrors)||void 0===t?void 0:t.enabled)&&(this.Gi=new $r);const u=new Ar(a,e);ei.general.push(new Qe("Pending Events",(()=>u.pendingEvents)));const l=new br(u,this.Jh,this.Kh,this.ji,this.Gi);this.recordingService=new Sn(this.L,this.bi,o,n,this.ki,this.Oi,this.J,this.Ni,this.xi,this.$i,this.Li,this.Mi,this.Di,h,l,s,c,this.Hi,this.zi,this.ji,this.Gi),this.Nc.addListener(this.recordingService),this.xc.addListener(this.recordingService),this.recordingService.init(),this.kc.register(Fr,(()=>this.J.isReplayRecorded()&&!this.$c.isUrlExcludedForSessionReplay())),this.kc.register(qr,(()=>{this.recordingService.activateOnlineAssetsOnNextPageview(),this.Jh.emitRecordingStatusChange()})),this.kc.register(Hr,(()=>this.recordingService.getStaticResourceManagerStatus())),this.Cc.enableRecordingStatus(this.recordingService,this.J,this.Li)}onAfterNaturalPageView(){var t;null===(t=this.qc)||void 0===t||t.initState()}onStartTracking(){this.Di.recover(),this.Bc(),this.J.isReplayRecorded()&&!this.$c.isUrlExcludedForSessionReplay()&&(this.J.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.zc())}onArtificialPageViewEnd(){!this.J.isReplayRecorded()||this.$c.isUrlExcludedForSessionReplay()||this.J.isTemporarilyRecorded()||this.Di.sendLastMessageBeacon(),this.recordingService.clearStates()}onAfterArtificialPageView(){this.Bc(),this.J.isReplayRecorded()&&!this.$c.isUrlExcludedForSessionReplay()?(this.J.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.jc()):this.Gc()}onBeforeSessionRenewal(){this.recordingService.clearStates(),this.Gc()}onOptout(){this.Gc(),this.recordingService.onOptOut()}onReplayUnanonymizationConsentGranted(){this.Bc(),this.recordingService.triggerUnanonymizationConsentGranted(),this.Jh.emitRecordingStatusChange()}onReplayUnanonymizationConsentWithdrawn(){this.Bc(),this.recordingService.triggerUnanonymizationConsentWithdrawn(),this.Jh.emitRecordingStatusChange()}onCollectStateChange(t,s){t===Be.ANALYTICS_ONLY&&s===Fe.ETR_OFF?(this.recordingService.clearEvents(),this.Gc()):(this.Mi.setQueryParams({rt:csArray.prototype.join.call(this.J.getRecordingStates(),",")}),this.recordingService.allowSendingEventsFromQuotaService(),this.recordingService.pushEvents())}onInitialDomStart(){this.recordingService.blockSendingEventsFromSerialization(),this.Di.blockSendingLastMessage()}onInitialDomDone(t){this.recordingService.allowSendingEventsFromSerialization(),this.recordingService.addInitialDom(t),this.Di.allowSendingLastMessage(),this.ki.start(),this.recordingService.pushEvents()}onAfterReplayRecordingConsentGranted(){this.J.isReplayRecorded()&&!this.$c.isUrlExcludedForSessionReplay()&&(this.J.isTemporarilyRecorded()&&this.recordingService.blockSendingEventsFromQuotaService(),this.zc(),this.recordingService.triggerRecordingForSessionGranted())}onAfterReplayRecordingConsentWithdrawn(){this.recordingService.isRecording()&&(this.recordingService.triggerRecordingForSessionWithdrawn(),this.recordingService.clearStates(),this.Gc())}Zc(){var t,s,e,i;if(null===(s=null===(t=this.L.experimental.sessionReplay)||void 0===t?void 0:t.shadowRoot)||void 0===s?void 0:s.filterByHostSelector){$s(null===(i=null===(e=this.L.experimental.sessionReplay)||void 0===e?void 0:e.shadowRoot)||void 0===i?void 0:i.filterByHostSelector,(t=>{Ce(t)&&Yi.setShadowRootFilter((s=>{try{return Pe.call(s.host,t)}catch{return!1}}))}))}}zc(){this.Zc(),this.recordingService.updateStaticResourceManagerOnlineAssets(),this.recordingService.start(),this.Di.start(),this.Jh.emitRecordingStatusChange()}Gc(){!function(t=!1){t&&(_e=1),Re=csSymbol("nodeIdentifier")}(),this.recordingService.stop(),this.Di.stop(),this.Jh.emitRecordingStatusChange()}jc(){this.Gc(),this.zc()}Fc(t){this.Mi=this.Lc.create(`${this.L.getRecordingUri()}/${Ur}`,!0,"byteArray",t,["rt","v","pid","pn","sn","uu"])}Bc(){var t;const s=this.Dc.shouldUseAnonymization();this.Uc.setAnonymization(s),null===(t=this.Wc)||void 0===t||t.setAnonymization(s)}}var jr,Gr;ys([gs("Recording.onStartTracking")],zr.prototype,"onStartTracking",null),ys([gs("onInitialDomDone")],zr.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"}(jr||(jr={})),function(t){t.isReplayConsentNeeded=function(t){return t.replayConsentRequiredForSession},t.isRecordingBlockedByConsent=function(t){return t.collectState===Be.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED||t.collectState===Be.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN},t.isRecordingWithDrawn=function(t){return t.collectState===Be.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN}}(Gr||(Gr={}));class Zr{constructor(t,s,e,i){this.W=t,this.J=s,this.L=e,this.Jc=i,this.Kc=!1}isNaturalPageViewSent(){return this.Kc}setNaturalPageViewSent(t){this.Kc=t}getTrackingContext(){const t=this.J.getSession();if(!t)return null;const s=this.getSessionKey();if(!s)return null;const e=this.L.projectId,i=this.L.uxaDomain;return{projectId:e,sessionKey:s,pageNumber:t.pageNumber,pageViewType:this.Jc.getPageViewType(),isRecording:this.J.isReplayRecorded(),uxaDomain:i,recordingConsentState:this.Yc(t),...this.L.smbConfig}}getSessionKey(){const t=this.W.getVisitor();return t?`${t.id}.${t.visitsCount}`:null}Yc(t){return Gr.isReplayConsentNeeded(this.L)?t.collectState===Be.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED?jr.NOT_EXPRESSED:t.collectState===Be.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN?jr.WITHDRAWN:jr.GRANTED:jr.NOT_NEEDED}}class Wr{constructor(t){this.Qc=t,this.Xc=[]}handleCommand(t){if(Rt(t)&&(this.ta(t),this.Qc.isNaturalPageViewSent())){const s=this.Qc.getTrackingContext();null!==s&&this.sa(t,s)}}ta(t){csArray.prototype.push.call(this.Xc,t)}executeRegisteredCallbacks(){const t=this.Qc.getTrackingContext();null!==t&&csArray.prototype.map.call(this.Xc,(s=>this.sa(s,t)))}sa(t,s){csSetTimeout((()=>{t(s)}))}}class Jr{constructor(t){this.Qc=t,this.ea=[]}handleCommand(t){return this.Qc.isNaturalPageViewSent()?this.ia(t):void this.na(t)}ia(t){const s=this.Qc.getSessionKey();return this.ra(t)&&null!==s&&this.sa(t.callback,s),s}na(t){this.ra(t)&&csArray.prototype.push.call(this.ea,t.callback)}flushPendingCallbacks(){const t=this.Qc.getSessionKey();null!==t&&csArray.prototype.forEach.call(this.ea,(s=>{this.sa(s,t)})),this.ea=[]}ra(t){return t&&"function"==typeof t.callback}sa(t,s){csSetTimeout((()=>{t(s)}))}}class Kr{constructor(t,s){this.oa=t,this.Qc=s}onTrackingContextRequestCallback(t){const s=this.Qc.getTrackingContext();null!==s&&this.oa.sendToChildren(Yt.TrackingContextResultMessage,{...t,trackingContext:s})}onIframeIntegrationCallback(t){if(!this.Qc.isNaturalPageViewSent())return;const s=this.Qc.getTrackingContext();null!==s&&(t.trackingContext=s,this.oa.sendToChildren(Yt.IntegrationCallback,t))}sendAfterPageViewCallbackToChildren(){const t=this.Qc.getTrackingContext();if(null===t)return;const s={trackingContext:t,initiator:Jt.AfterPageView};this.oa.sendToChildren(Yt.IntegrationCallback,s)}}function Yr(t,s){const{isRecording:e,pageNumber:i,projectId:n,siteId:r,uxaDomain:o,csLiteDomain:h}=t,c=/^(.+)\.(\d+)$/.exec(t.sessionKey);let a;if(e&&c){const[,t,e]=c;a=r?`${h}/sites/${r}/player?uu=${t}&sn=${e}&pn=${i}&`:`${o}/quick-playback/index.html?pid=${n}&uu=${t}&sn=${e}&pvid=${i}&recordingType=cs`,s.withTimestamp&&(a+="&t="+(It.now()-s.recordingStartTimestamp))}return{replayLink:a,isRecording:e}}class Qr{constructor(t){this.Qc=t}handleCommand(t,s){Et(t)&&Rt(s)&&this.sa(t,s)}sa(t,s){csSetTimeout((()=>{const e=this.Qc.getTrackingContext();if(e){const i=Yr(e,t);s(i)}}))}}class Xr{constructor(){this.Xc=new Set}handleCommand(t,s){return Rt(t)?this.Xc.has(t)?null:(this.Xc.add(t),s&&(this.kr=s,this.ha(t,s)),()=>this.Xc.delete(t)):null}executeCallbacks(t){this.ca(t)&&(this.kr=t,this.Xc.forEach((s=>this.ha(s,t))))}ha(t,s){csSetTimeout((()=>{try{t(s)}catch(t){}}))}ca(t){const{isRecording:s,recordingStartTimestamp:e,etrState:i}=t;return this.kr&&(this.kr.isRecording!==s||this.kr.recordingStartTimestamp!==e||this.kr.etrState!==i)}}const to=["afterPageView"],so=["getSessionKey"],eo=["onRecordingStateChange"],io=["replay:link:generate"];class no{constructor(t,s,e,i,n,r,o,h){this.W=t,this.J=s,this.kc=e,this.aa=i,this.oa=n,this.L=r,this.Jc=o,this.Cc=h}init(){this.Qc=new Zr(this.W,this.J,this.L,this.Jc),this.ua=new Wr(this.Qc),this.da=new Jr(this.Qc),this.fa=new Xr,this.pa=new Qr(this.Qc),this.va=new Kr(this.oa,this.Qc),this.aa.addListener(this.va),this.kc.register(so,(t=>this.da.handleCommand(t))),this.kc.register(to,(t=>this.ua.handleCommand(t))),this.kc.register(eo,(t=>{this.fa.handleCommand(t,this.Cc.getRecordingStatus())})),this.kc.register(io,((t,s)=>{this.ma&&this.pa.handleCommand({...t,recordingStartTimestamp:this.Cc.getRecordingStatus().recordingStartTimestamp},s)}))}onAfterNaturalPageView(){this.Qc.setNaturalPageViewSent(!0),this.da.flushPendingCallbacks(),this.ua.executeRegisteredCallbacks(),this.va.sendAfterPageViewCallbackToChildren()}onAfterArtificialPageView(){this.ua.executeRegisteredCallbacks(),this.va.sendAfterPageViewCallbackToChildren()}onCollectStateChange(){this.fa.executeCallbacks(this.Cc.getRecordingStatus())}onRecordingStatusChange(){this.fa.executeCallbacks(this.Cc.getRecordingStatus())}setRecordingService(t){this.ma=t}}ys([kr()],no.prototype,"onCollectStateChange",null),ys([kr()],no.prototype,"onRecordingStatusChange",null);class ro{constructor(t,s){this.key=csString.prototype.slice.call(t,0,512),this.value=yt(s)?csString.prototype.slice.call(s,0,255):s}static isValid(t,s){return yt(t)&&(yt(s)||gt(s))}}class oo extends Ue{constructor(t,s){super(),this.wa=t,this.M=s,this.ga=[]}onStart(){csArray.prototype.forEach.call(this.ga,(t=>this.trackDynamicVariable(t.key,t.value))),this.ga=[]}onStop(){}trackDynamicVariable(t,s){this.isStarted?ro.isValid(t,s)&&this.wa.add(new ro(this.M.anonymizePII(t),this.M.anonymizePII(s))):csArray.prototype.push.call(this.ga,{key:t,value:s})}}class ho{constructor(t){this.ya=t,this.wa=[]}add(t){csArray.prototype.push.call(this.wa,t),this.setBatchReadyCall()}clear(){this.wa=[]}onBatchReady(t){this.Ea=t}getRequestParameters(){const t={};for(const s of this.wa)t[s.key]=s.value;return{dv:this.ya.compressSync(csJSON.stringify(t),"base64"),ct:this.ya.algorithm}}setBatchReadyCall(){this.Ea()}}ys([kr(),ns("dynamicVariablesBatchReady")],ho.prototype,"setBatchReadyCall",null);const co=["trackDynamicVariable"];class ao{constructor(t,s,e,i,n,r){this.kc=t,this.J=s,this.L=e,this.mc=i,this.ya=n,this.M=r,this.O=new tt(this.L.getTrackerUri(),"dvar"),this.wa=new ho(this.ya),this.Aa=new oo(this.wa,this.M)}init(){this.O.setRequestParametersProviders(this.mc,this.wa),this.J.setDynamicVariablesService(this.Aa),this.wa.onBatchReady((()=>this.O.send())),this.O.after((()=>this.wa.clear())),this.kc.register(co,(({key:t,value:s}={})=>{this.Aa.trackDynamicVariable(t,s)}))}onStartTracking(){this.Aa.start()}}class uo{constructor(t,s){this.id=t,this.revenue=s}static from(t){const s=new uo(t.id,parseFloat(t.revenue));return isNaN(parseFloat(t.tax))||(s.tax=parseFloat(t.tax)),isNaN(parseFloat(t.shipping))||(s.shipping=parseFloat(t.shipping)),yt(t.currency)&&t.currency.length<=10&&(s.currency=t.currency),s}hasValidRevenue(){return!isNaN(this.revenue)&&this.revenue>=0}static isValid(t){return _t(t)&&wt(t.revenue)&&yt(t.currency)&&t.currency.length<=10&&(!_t(t.id)||yt(t.id))}}class lo{constructor(t,s,e,i){this.id=t,this.name=s,this.price=e,this.quantity=i}static from(t){if(!lo._a(t))return null;const s=new lo(t.id,t.name,parseFloat(t.price),parseInt(t.quantity,10));return At(t.sku)&&(s.sku=t.sku),At(t.category)&&(s.category=t.category),At(t.merchant)&&t.merchant.length>0&&(s.merchant=t.merchant.slice(0,100)),s}static _a(t){return _t(t)&&yt(t.id)&&yt(t.name)&&wt(parseFloat(t.price))&>(parseInt(t.quantity,10))&&(!At(t.sku)||yt(t.sku))&&(!At(t.category)||yt(t.category))&&(!At(t.merchant)||yt(t.merchant))}}class fo{constructor(t,s,e){this.M=t,this.Ra=s,this.Oi=e,this.clear()}addTransaction(t){const s=this.M.anonymizeFields(t,["id"]);this.Sa=uo.from(s)}getTransaction(){return this.Sa}sendTransaction(){null!==this.Ra&&null!==this.Oi&&(this.Oi.refreshSession(),this.Oi.isSessionValid()&&(this.Sa.hasValidRevenue()?this.Ra.send():es.warn("Transaction Service: unable to send transaction with invalid parameters")))}addItem(t){if(Rt(t))return;const s=this.M.anonymizeFields(t,["id","name","sku","category"]),e=lo.from(s);null!==e&&csArray.prototype.push.call(this.Ta,e)}getItems(){return this.Ta}clear(){this.Sa=uo.from({revenue:NaN}),this.Ta=[]}getRequestParameters(){const t={id:this.Sa.id?`${this.Sa.id}`:"",revenue:`${this.Sa.revenue}`};return At(this.Sa.tax)&&(t.tax=`${this.Sa.tax}`),At(this.Sa.shipping)&&(t.shipping=`${this.Sa.shipping}`),At(this.Sa.currency)&&(t.cu=`${this.Sa.currency}`),t.items=window.csJSON.stringify(this.Ta),t}}class po{constructor(t,s){this.Ia=t,this.Oi=s,this.Pa=null}addToCart(t){const s={};yt(t.sku)&&(s.sku=csString.prototype.slice.call(t.sku,0,100)),yt(t.merchant)&&(s.merchant=csString.prototype.slice.call(t.merchant,0,100)),(s.sku||s.merchant)&&(this.Pa=s,this.sendCartItem())}getCartItem(){return this.Pa}sendCartItem(){this.Oi.refreshSession(),this.Oi.isSessionValid()&&this.Ia.send()}clear(){this.Pa=null}getRequestParameters(){if(!this.Pa)return{};const t={};return yt(this.Pa.sku)&&this.Pa.sku.length>0&&(t.sku=this.Pa.sku),yt(this.Pa.merchant)&&this.Pa.merchant.length>0&&(t.me=this.Pa.merchant),t}}const vo=["ecommerce:addToCart","ec:cart:add"],mo=["ecommerce:addTransaction","ec:transaction:create"],wo=["ecommerce:addItem","ec:transaction:items:add"],go=["ecommerce:send","ec:transaction:send"];class yo{constructor(t,s,e,i,n,r,o){this.L=t,this.lc=s,this.W=e,this.kc=i,this.M=n,this.Oi=r,this.it=o}init(){const t=new tt(this.L.getTrackerUri(),"transaction"),s=new tt(this.L.getTrackerUri(),"addtocart"),e=new fo(this.M,t,this.Oi),i=new po(s,this.Oi),n=new In(this.lc,this.W,this.it,e);t.setRequestParametersProviders(n),t.after((()=>{e.clear()}));const r=new In(this.lc,this.W,this.it,i);s.setRequestParametersProviders(r),s.after((()=>{i.clear()})),this.kc.register(mo,(t=>{e.addTransaction(t)})),this.kc.register(wo,(t=>e.addItem(t))),this.kc.register(go,(()=>e.sendTransaction())),this.kc.register(vo,(t=>{i.addToCart(t)}))}}class Eo{constructor(t){this.ba=t.performance}getRequestParameters(){if(this.Va())return{};const t=this.Ca();return{str:t.startRender,di:t.domInteractive,dc:t.domComplete,fl:t.fullyLoaded}}Ca(){const t=this.ba.timing;return{startRender:""+(t.domLoading-t.requestStart),domInteractive:""+(t.domInteractive-t.requestStart),domComplete:""+(t.domComplete-t.requestStart),fullyLoaded:""+(t.loadEventEnd-t.requestStart)}}Va(){return!(this.ba&&this.ba.timing&&this.ba.timing.loadEventEnd>0)}}var Ao,_o;function Ro(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",t[t.EXTERNAL_EVENT=35]="EXTERNAL_EVENT"}(Ao||(Ao={})),function(t){t.SUCCESS="success",t.FAILURE="failure",t.ATTEMPT="attempt"}(_o||(_o={}));class So{static build(t,s,e){return csArray.prototype.reduce.call(e,((s,e)=>e.enhanceAnalysisEvent(t,s)),s)}}class To{constructor(t,s,e){this.ka=t,this.Oa=s,this.Gr=e}processGesture(t,s){switch(t.type){case Qn.TAP:this.Na(s);break;case Qn.FLICK:this.xa(t,s);break;case Qn.DRAG:this.$a(t,s)}}Na(t){const s={type:Ao.TAP,ts:0,x:0,y:0,tgt:""},e=So.build(t,s,this.ka);e.tgt!==F.INVALID_ELEMENT&&this.Bn(e)}$a(t,s){var e,i;const n={type:Ao.DRAG,ts:0,fd:t.direction,tgt:""};(null===(e=this.Gr)||void 0===e?void 0:e.collectGestureDistance)&&(n.distance=t.distance),(null===(i=this.Gr)||void 0===i?void 0:i.collectGestureVelocity)&&(n.velocity=t.velocity);const r=So.build(s,n,this.ka);r.tgt!==F.INVALID_ELEMENT&&this.Bn(r)}xa(t,s){var e,i;const n={type:Ao.FLICK,ts:0,fd:t.direction,tgt:""};(null===(e=this.Gr)||void 0===e?void 0:e.collectGestureDistance)&&(n.distance=t.distance),(null===(i=this.Gr)||void 0===i?void 0:i.collectGestureVelocity)&&(n.velocity=t.velocity);const r=So.build(s,n,this.ka);r.tgt!==F.INVALID_ELEMENT&&this.Bn(r)}onEvent(t){this.Bn=t}start(){this.Oa.subscribe(To.La,((t,s)=>this.processGesture(t,s)))}stop(){this.Oa.unsubscribe(To.La)}}To.La="AnalysisGestureTracker",ys([hs()],To.prototype,"processGesture",null);class Io{constructor(t,s,e){this.ka=t,this.Ma=s,this.Da=e,this.Ua="select, select *, input, textarea",this.Ba="select, select *, input, textarea",this.Fa="a, a *, button, button *, select, select *, input, textarea",this.qa="input, select, textarea",this.Ha=150,this.za=400,this.ja=!1,this.Ga=Cr(((t,s)=>this.scrollListener(t,s)),this.Ha),this.Za=Cr((t=>this.resizeListener(t)),this.Ha),this.Wa=ae((t=>this.mouseMoveListener(t)),this.za),this.Ja=[{boundElement:window,type:"resize",listener:()=>this.Za()},{boundElement:document,type:"scroll",listener:t=>this.Ga(t)},{boundElement:window,type:"mousemove",listener:t=>{this.Wa(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.Ka=[{type:"change",listener:this.Da.on(this.Ba,(t=>this.changeListener(t)))}],this.Ya=[{boundElement:document,type:"mouseover",listener:this.Da.on(this.Fa,(t=>this.mouseOverListener(t)))},{boundElement:document,type:"mouseout",listener:this.Da.on(this.Fa,(t=>this.mouseOutListener(t)))},{boundElement:document,type:"focusin",listener:this.Da.on(this.Ua,(t=>this.focusInListener(t)))},{boundElement:document,type:"focusout",listener:this.Da.on(this.Ua,(t=>this.focusOutListener(t)))},{boundElement:document,type:"keyup",listener:this.Da.on(this.qa,(t=>this.keyUpListener(t)))},{boundElement:document,type:"keydown",listener:this.Da.on(this.qa,(t=>this.keyDownListener(t)))},{boundElement:document,type:"copy",listener:this.Da.on(this.qa,(t=>this.copyListener(t)))},{boundElement:document,type:"cut",listener:this.Da.on(this.qa,(t=>this.cutListener(t)))},{boundElement:document,type:"paste",listener:this.Da.on(this.qa,(t=>this.pasteListener(t)))},...csArray.prototype.map.call(this.Ka,(t=>({...t,boundElement:document})))],this.zs={},this.$e=(t,s)=>{switch(s){case"initial":case"added":this.Ns(t);break;case"removed":this.xs(t)}},this.Os=new re(this.$e),this.Ms()}Ns(t){if(R(t)){const t=this.Qa();csArray.prototype.forEach.call(t,(t=>oe(t)))}else{const s=this.Xa();csArray.prototype.forEach.call(s,(s=>{oe({...s,boundElement:t})}))}}xs(t){if(R(t)){const t=this.Qa();csArray.prototype.forEach.call(t,(t=>he(t)))}else{const s=this.Xa();csArray.prototype.forEach.call(s,(s=>{he({...s,boundElement:t})}))}}onEvent(t){this.Bn=t}start(){this.Os.observe(),this.Ns(document),this.resizeListener()}stop(){this.xs(document),this.Os.disconnect()}flushPendingDebouncedListeners(){this.Ga.flushPending(),this.Za.flushPending()}Xa(){return this.Da.isMatchesSelectorSupported()?this.Ka:(es.warn("Element.matches is not implemented yet"),[])}Qa(){return this.Da.isMatchesSelectorSupported()?[...this.Ja,...this.Ya]:(es.warn("Element.matches is not implemented yet"),this.Ja)}resizeListener(t){const s=ye.getScrollContainer(),e=St(s);e&&(this.ja=!0);const i={type:Ao.RESIZE,ts:0,x:e?s.clientWidth:Ni.windowWidth(),y:e?s.clientHeight:Ni.windowHeight()};void 0!==t&&(i.d=t),this.Bn(i)}scrollListener(t,s){const e=ye.isEventOnScrollContainer(s);!this.ja&&e&&this.resizeListener();const i={type:Ao.SCROLL,ts:0,x:e?csEventtarget.apply(s).scrollLeft:Ni.windowOffsetX(),y:e?csEventtarget.apply(s).scrollTop:Ni.windowOffsetY(),d:t},n=So.build(s,i,this.ka);this.Bn(n)}mouseMoveListener(t){const s={type:Ao.MOUSEMOVE,ts:0,x:t.pageX,y:t.pageY},e=So.build(t,s,this.ka);this.Bn(e)}mouseDownListener(t){const s={type:Ao.MOUSEDOWN,ts:0,x:t.pageX,y:t.pageY,tgt:""},e=So.build(t,s,this.ka);this.tu(e)}mouseUpListener(t){const s={type:Ao.MOUSEUP,ts:0,x:t.pageX,y:t.pageY,tgt:""},e=So.build(t,s,this.ka);this.tu(e)}clickListener(t){const s={type:Ao.CLICK,ts:0,x:t.pageX,y:t.pageY,tgt:""},e=So.build(t,s,this.ka);this.tu(e)}mouseOverListener(t){const s={type:Ao.MOUSEOVER,ts:0,x:t.pageX,y:t.pageY,tgt:""},e=So.build(t,s,this.ka);this.tu(e)}mouseOutListener(t){const s={type:Ao.MOUSEOUT,ts:0,x:t.pageX,y:t.pageY,tgt:this.Ma.getEventTargetPath(t)},e=So.build(t,s,this.ka);this.tu(e)}focusInListener(t){const s={type:Ao.FOCUSIN,ts:0,tgt:this.Ma.getEventTargetPath(t)},e=So.build(t,s,this.ka);this.tu(e)}focusOutListener(t){const s={type:Ao.FOCUSOUT,ts:0,tgt:this.Ma.getEventTargetPath(t)},e=So.build(t,s,this.ka);this.tu(e)}changeListener(t){const s={type:Ao.CHANGE,ts:0,tgt:this.Ma.getEventTargetPath(t)},e=So.build(t,s,this.ka);this.tu(e)}copyListener(t){const s={type:Ao.COMMAND,ts:0,tgt:this.Ma.getEventTargetPath(t),key:ve.COPY};this.tu(s)}cutListener(t){const s={type:Ao.COMMAND,ts:0,tgt:this.Ma.getEventTargetPath(t),key:ve.CUT};this.tu(s)}pasteListener(t){const s={type:Ao.COMMAND,ts:0,tgt:this.Ma.getEventTargetPath(t),key:ve.PASTE};this.tu(s)}keyUpListener(t){const s={type:Ao.KEYUP,ts:0,tgt:this.Ma.getEventTargetPath(t),key:this.su(t)};this.tu(s)}keyDownListener(t){const s={type:Ao.KEYDOWN,ts:0,tgt:this.Ma.getEventTargetPath(t),key:this.su(t)};this.tu(s)}su(t){const s=this.zs[t.key];return void 0===s?pe.ALPHANUMERICAL:s}tu(t){Ro(t)&&t.tgt!==F.INVALID_ELEMENT&&this.Bn(t)}Ms(){this.zs[" "]=pe.SPACE,this.zs.Spacebar=pe.SPACE,this.zs.Enter=pe.ENTER,this.zs.Backspace=pe.BACKSPACE,this.zs.Delete=pe.DELETE,this.zs.ArrowUp=pe.ARROWUP,this.zs.ArrowDown=pe.ARROWDOWN,this.zs.ArrowLeft=pe.ARROWLEFT,this.zs.ArrowRight=pe.ARROWRIGHT,this.zs.Up=pe.ARROWUP,this.zs.Down=pe.ARROWDOWN,this.zs.Left=pe.ARROWLEFT,this.zs.Right=pe.ARROWRIGHT,this.zs.CapsLock=pe.CAPSLOCK,this.zs.Shift=pe.SHIFT,this.zs.Tab=pe.TAB}}ys([ns("Event handler type: resize")],Io.prototype,"resizeListener",null),ys([ns("Event handler type: scroll")],Io.prototype,"scrollListener",null),ys([ns("Event handler type: mouseMove"),hs()],Io.prototype,"mouseMoveListener",null),ys([ns("Event handler type: mouseDown"),hs()],Io.prototype,"mouseDownListener",null),ys([ns("Event handler type: mouseUp"),hs()],Io.prototype,"mouseUpListener",null),ys([ns("Event handler type: click"),hs()],Io.prototype,"clickListener",null),ys([ns("Event handler type: mouseOver"),hs()],Io.prototype,"mouseOverListener",null),ys([ns("Event handler type: mouseOut"),hs()],Io.prototype,"mouseOutListener",null),ys([ns("Event handler type: focusIn")],Io.prototype,"focusInListener",null),ys([ns("Event handler type: focusOut")],Io.prototype,"focusOutListener",null),ys([ns("Event handler type: change")],Io.prototype,"changeListener",null),ys([ns("Event handler type: copy")],Io.prototype,"copyListener",null),ys([ns("Event handler type: cut")],Io.prototype,"cutListener",null),ys([ns("Event handler type: paste")],Io.prototype,"pasteListener",null),ys([ns("Event handler type: keyup")],Io.prototype,"keyUpListener",null),ys([ns("Event handler type: keydown")],Io.prototype,"keyDownListener",null);class Po{constructor(){this.eu=100,this.iu=0,this.nu=Ni.documentHeight(),this.ru={boundElement:document,type:"scroll",listener:t=>this.maxScrollRateListener(t)},this.iu=this.ou(ye.getScrollContainer()).maxScrollRate}onEvent(t){this.Bn=t}start(){oe(this.ru)}stop(){he(this.ru)}reset(){const t=ye.getScrollContainer(),{maxScrollRate:s,maxDocumentHeight:e}=this.ou(t);this.nu=e,this.iu=s,this.Bn()}ou(t){let s=0,e=0;if(null===t)e=Ni.documentHeight(),s=this.hu(e);else{const i=this.au(t);e=this.lu(t,i),s=this.du(t,i)}return{maxScrollRate:s,maxDocumentHeight:e}}maxScrollRateListener(t){let s=null;ye.isEventOnScrollContainer(t)&&(s=csEventtarget.apply(t));const{maxScrollRate:e,maxDocumentHeight:i}=this.ou(s);(e>this.iu||i>this.nu)&&(this.iu=e,i>this.nu&&(this.nu=i),this.Bn())}hu(t){const s=Math.round(this.fu()/t*100);return Math.min(s,this.eu)}fu(){const t=Ni.windowHeight();return Ni.windowOffsetY()+t}du(t,s){const e=t.scrollTop+t.clientHeight+t.getBoundingClientRect().top+s,i=this.lu(t,s),n=Math.round(e/i*100);return Math.min(n,this.eu)}au(t){const s=window.getComputedStyle(t).paddingTop||"0px";return parseInt(s,10)}lu(t,s){return t.scrollHeight+t.getBoundingClientRect().top+s}getRequestParameters(){return{sr:`${this.iu}`,mdh:`${this.nu}`}}}ys([ns("MaxScrollRate handler")],Po.prototype,"maxScrollRateListener",null);class bo{constructor(t,s,e,i,n,r,o,h,c,a,u,l,d,f,p,v,m,w,g,y,E){this.L=t,this.pu=s,this.Oa=e,this.vu=i,this.mu=n,this.wu=r,this.gu=o,this.yu=h,this.Oi=c,this.Qt=a,this.Eu=u,this.Au=l,this.rn=d,this.Mi=f,this._u=p,this.Ru=v,this.Su=m,this.Tu=w,this.Iu=g,this.Pu=y,this.bu=E,this.Wi=new De,this.Vu=!1}init(){var t,s,e,i,n,r,o;this.pu.onEvent((t=>this.tn(t))),this.Oa.onEvent((t=>this.tn(t))),this.vu.onEvent((()=>{const t=this.vu.getRequestParameters();this.Mi.setQueryParams(t),this.gu.setQueryParams(t)})),this.Au.onEvent((t=>this.Cu(t))),this.ku(),null===(t=this._u)||void 0===t||t.onEvent((t=>this.tn(t))),null===(s=this.Iu)||void 0===s||s.onEvent((t=>this.tn(t))),null===(e=this.Ru)||void 0===e||e.onEvent((t=>this.tn(t))),null===(i=this.Su)||void 0===i||i.onEvent((t=>this.tn(t))),this.Ou(),null===(n=this.Tu)||void 0===n||n.onEvent((t=>this.Cu(t))),null===(r=this.Pu)||void 0===r||r.onEvent((t=>this.Cu(t))),null===(o=this.bu)||void 0===o||o.onEvent((t=>this.Cu(t)))}Ou(){this.gu.onBeaconSuccess((()=>{this.wu.clearEvents()})),this.gu.onBeaconFailure((t=>{this.Nu(t)}))}initStates(){const t=this.yu.getRequestParameters(),s=this.mu.getRequestParameters(),e=this.vu.getRequestParameters();this.Mi.setQueryParams(t),this.Mi.setQueryParams(s),this.Mi.setQueryParams(e),this.gu.setQueryParams(t),this.gu.setQueryParams(s),this.gu.setQueryParams(e),this.xu()}clearStates(t){var s,e;this.pu.flushPendingDebouncedListeners(),null===(s=this.Ru)||void 0===s||s.flushPendingKeyboardNavigationEvent(),null===(e=this.Su)||void 0===e||e.flushPendingTextHighlightEvent(),t?(this.$u(),this.sendLastMessageBeacon()):this.sendEvents(),this.vu.reset(),this.Au.stop(),this.Mi.removeQueryParams()}start(t){var s,e,i,n,r,o,h;t||null===(s=this.Tu)||void 0===s||s.start(),this.rn.start(),this.pu.start(),this.vu.start(),this.Oa.start(),null===(e=this._u)||void 0===e||e.start(),null===(i=this.Su)||void 0===i||i.start(),t||this.Au.start(),null===(n=this.Ru)||void 0===n||n.start(),null===(r=this.Iu)||void 0===r||r.start(),null===(o=this.Pu)||void 0===o||o.start(),null===(h=this.bu)||void 0===h||h.start()}collectInitialEvents(){var t;null===(t=this._u)||void 0===t||t.collectInitialEvents()}onIframeAnalysisBrowserEvent(t){this.Cu(t)}onIframeAnalysisUserEvent(t){this.tn(t)}onExternalEvent(t){this.fn(t)}Cu(t){this.Oi.isCurrentPageviewValid()&&this.fn(t)}tn(t){this.Oi.refreshSession(),this.Oi.isSessionValid()&&this.fn(t)}fn(t){this.wu.addEvent(this.Lu(t)),this.wu.isFull()&&this.sendEvents(),this.L.emitDebugEvents&&this.Wi.emit("analysisEvent",{...t,typeName:Ao[t.type]})}Lu(t){return t.ts=this.Mu(),t}$u(){this.gu.setQueryParams({hlm:"true"}),this.Vu=!0}sendLastMessageBeacon(){this.gu.setQueryParams(this.mu.getRequestParameters()),this.gu.send(this.wu.stringifyEvents()),this.gu.removeQueryParams(["hlm"]),this.Vu=!1}sendEvents(){this.wu.isEmpty()||(this.Mi.setQueryParams(this.yu.getRequestParameters()),this.Mi.setQueryParams(this.mu.getRequestParameters()),this.Mi.send(this.wu.getEvents()),this.wu.clearEvents())}stop(){var t,s,e,i,n,r,o;this.rn.stop(),this.pu.stop(),this.vu.stop(),this.Oa.stop(),this.Au.stop(),null===(t=this._u)||void 0===t||t.stop(),null===(s=this.Ru)||void 0===s||s.stop(),null===(e=this.Su)||void 0===e||e.stop(),null===(i=this.Iu)||void 0===i||i.stop(),this.wu.empty(),null===(n=this.Tu)||void 0===n||n.stop(),null===(r=this.Pu)||void 0===r||r.stop(),null===(o=this.bu)||void 0===o||o.stop()}xu(){this.Du=It.now()}Mu(){return It.now()-this.Du}ku(){this.rn.onEvent((t=>{var s,e;null===(s=this.Ru)||void 0===s||s.flushPendingKeyboardNavigationEvent(),null===(e=this.Su)||void 0===e||e.flushPendingTextHighlightEvent(),t===He.PagehideVisible?this.$u():t===He.PagehideHidden?(this.$u(),this.sendLastMessageBeacon()):this.wu.isEmpty()&&!this.Vu||this.sendLastMessageBeacon()}))}Nu(t){try{this.wu.isEmpty()&&!this.Vu||this.Qt.save({requestParameters:t,events:this.wu.getEvents()})}catch{}}pushSubmitEvent(t,s){if(!function(t){return t===_o.SUCCESS||t===_o.FAILURE||t===_o.ATTEMPT}(t))return void es.warn(`AnalysisEvents Service: invalid submit status: ${t}`);if(!St(s))return void es.warn(`AnalysisEvents Service: invalid element: ${s}`);const e={status:t,type:Ao.SUBMIT,ts:0,tgt:this.Eu.getElementPath(s)};e.tgt!==F.INVALID_ELEMENT&&this.Cu(e)}}class Vo{constructor(t,s){this.Qt=t,this.Mi=s,this.Uu=()=>{"visible"===document.visibilityState&&this.Bu()}}start(){this.Bu(),this.ie()}stop(){this.he()}getRecoveryStorage(){return this.Qt}Bu(){const t=this.Qt.recover();if(null!==t){const{requestParameters:s,events:e}=t;this.Mi.send(e,s)}}ie(){document.addEventListener("visibilitychange",this.Uu)}he(){document.removeEventListener("visibilitychange",this.Uu)}}class Co{constructor(t){this.Tr=t}save(t){localStorage.setItem(this.Tr,csJSON.stringify(t))}clear(){localStorage.removeItem(this.Tr)}recover(){const t=localStorage.getItem(this.Tr);if(null===t)return null;let s=null;try{s=csJSON.parse(t)}catch{es.error(`Invalid item in localStorage.\n (key:${this.Tr}; value:${t})`)}finally{this.clear()}return s}}class ko{constructor(t){this.Fu=t,this.qu=t=>this.processMetric(t),this.Xs=!1}onEvent(t){this.Bn=t}start(){this.Xs||(this.Xs=!0,this.Fu.onFCP(this.qu),this.Fu.onCLS(this.qu),this.Fu.onFID(this.qu),this.Fu.onLCP(this.qu),this.Fu.onTTFB(this.qu),this.Fu.onINP(this.qu))}stop(){this.Xs=!1}processMetric(t){if(!this.Xs)return;const s={type:Ao.PERFORMANCE,name:t.name,val:t.value,ts:0};this.Bn(s)}}ys([ns("Performance metric handler")],ko.prototype,"processMetric",null);var Oo,No,xo,$o,Lo,Mo=-1,Do=function(t){addEventListener("pageshow",(function(s){s.persisted&&(Mo=s.timeStamp,t(s))}),!0)},Uo=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Bo=function(){var t=Uo();return t&&t.activationStart||0},Fo=function(t,s){var e=Uo(),i="navigate";return Mo>=0?i="back-forward-cache":e&&(document.prerendering||Bo()>0?i="prerender":document.wasDiscarded?i="restore":e.type&&(i=e.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:i}},qo=function(t,s,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var i=new PerformanceObserver((function(t){Promise.resolve().then((function(){s(t.getEntries())}))}));return i.observe(Object.assign({type:t,buffered:!0},e||{})),i}}catch(t){}},Ho=function(t,s,e,i){var n,r;return function(o){s.value>=0&&(o||i)&&((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,e),t(s))}},zo=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},jo=function(t){var s=function(s){"pagehide"!==s.type&&"hidden"!==document.visibilityState||t(s)};addEventListener("visibilitychange",s,!0),addEventListener("pagehide",s,!0)},Go=function(t){var s=!1;return function(e){s||(t(e),s=!0)}},Zo=-1,Wo=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Jo=function(t){"hidden"===document.visibilityState&&Zo>-1&&(Zo="visibilitychange"===t.type?t.timeStamp:0,Yo())},Ko=function(){addEventListener("visibilitychange",Jo,!0),addEventListener("prerenderingchange",Jo,!0)},Yo=function(){removeEventListener("visibilitychange",Jo,!0),removeEventListener("prerenderingchange",Jo,!0)},Qo=function(){return Zo<0&&(Zo=Wo(),Ko(),Do((function(){setTimeout((function(){Zo=Wo(),Ko()}),0)}))),{get firstHiddenTime(){return Zo}}},Xo=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},th=[1800,3e3],sh=function(t,s){s=s||{},Xo((function(){var e,i=Qo(),n=Fo("FCP"),r=qo("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(r.disconnect(),t.startTime=0&&No1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,s){var e=function(){rh(t,s),n()},i=function(){n()},n=function(){removeEventListener("pointerup",e,ih),removeEventListener("pointercancel",i,ih)};addEventListener("pointerup",e,ih),addEventListener("pointercancel",i,ih)}(s,t):rh(s,t)}},ch=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(s){return t(s,hh,ih)}))},ah=[100,300],uh=0,lh=1/0,dh=0,fh=function(t){t.forEach((function(t){t.interactionId&&(lh=Math.min(lh,t.interactionId),dh=Math.max(dh,t.interactionId),uh=dh?(dh-lh)/7+1:0)}))},ph=function(){return Lo?uh:performance.interactionCount||0},vh=function(){"interactionCount"in performance||Lo||(Lo=qo("event",fh,{type:"event",buffered:!0,durationThreshold:0}))},mh=[200,500],wh=0,gh=function(){return ph()-wh},yh=[],Eh={},Ah=function(t){var s=yh[yh.length-1],e=Eh[t.interactionId];if(e||yh.length<10||t.duration>s.latency){if(e)e.entries.push(t),e.latency=Math.max(e.latency,t.duration);else{var i={id:t.interactionId,latency:t.duration,entries:[t]};Eh[i.id]=i,yh.push(i)}yh.sort((function(t,s){return s.latency-t.latency})),yh.splice(10).forEach((function(t){delete Eh[t.id]}))}},_h=[2500,4e3],Rh={},Sh=[800,1800],Th=function t(s){document.prerendering?Xo((function(){return t(s)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(s)}),!0):setTimeout(s,0)},Ih=function(t,s){s=s||{};var e=Fo("TTFB"),i=Ho(t,e,Sh,s.reportAllChanges);Th((function(){var n=Uo();if(n){var r=n.responseStart;if(r<=0||r>performance.now())return;e.value=Math.max(r-Bo(),0),e.entries=[n],i(!0),Do((function(){e=Fo("TTFB",0),(i=Ho(t,e,Sh,s.reportAllChanges))(!0)}))}}))};class Ph{onFCP(t){sh(t,{reportAllChanges:!0})}onCLS(t){!function(t,s){s=s||{},sh(Go((function(){var e,i=Fo("CLS",0),n=0,r=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var s=r[0],e=r[r.length-1];n&&t.startTime-e.startTime<1e3&&t.startTime-s.startTime<5e3?(n+=t.value,r.push(t)):(n=t.value,r=[t])}})),n>i.value&&(i.value=n,i.entries=r,e())},h=qo("layout-shift",o);h&&(e=Ho(t,i,eh,s.reportAllChanges),jo((function(){o(h.takeRecords()),e(!0)})),Do((function(){n=0,i=Fo("CLS",0),e=Ho(t,i,eh,s.reportAllChanges),zo((function(){return e()}))})),setTimeout(e,0))})))}(t,{reportAllChanges:!0})}onFID(t){!function(t,s){s=s||{},Xo((function(){var e,i=Qo(),n=Fo("FID"),r=function(t){t.startTime0&&(n.value=0,n.entries=[]),i(!0)})),Do((function(){yh=[],wh=ph(),n=Fo("INP"),i=Ho(t,n,mh,s.reportAllChanges)})))}))}(t,{reportAllChanges:!0})}}class bh{constructor(t=[]){this.Zs=t}stringifyEvents(){return csJSON.stringify(this.Zs)}addEvent(t){csArray.prototype.push.call(this.Zs,t)}eventsCount(){return this.Zs.length}clearEvents(){this.Zs=[]}empty(){this.clearEvents()}isFull(){return this.eventsCount()>=50}isEmpty(){return 0===this.Zs.length}getEvents(){return this.Zs}}class Vh{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 Ch extends Vh{constructor(){super(...arguments),this.supportedEventTypes=[Ao.CHANGE],this.Hu=["text","email","number","search","tel","url","password"]}baseEnhanceAnalysisEvent(t,s){const e=me(t);return w(e)&&csArray.prototype.indexOf.call(this.Hu,e.type)>=0&&(s.isBlank=""===e.value),s}}class kh extends Vh{constructor(t){super(),this.Ma=t,this.supportedEventTypes=[Ao.MOUSEDOWN,Ao.MOUSEUP,Ao.CLICK,Ao.MOUSEOVER,Ao.TAP,Ao.DRAG,Ao.FLICK]}baseEnhanceAnalysisEvent(t,s){return s.tgt||(s.tgt=this.Ma.getEventTargetPath(t)),s}}var Oh,Nh;!function(t){t.getRelativePosition=function(t){const s=me(t);if(!(s&&l(s)&&Rt(s.getBoundingClientRect)&&_t(t.pageX)&&_t(t.pageY)))return{xRel:-1,yRel:-1,valid:!1};const e=s.getBoundingClientRect();let i=t.pageX-e.left-Ni.windowOffsetX(),n=t.pageY-e.top-Ni.windowOffsetY();s!==document.documentElement&&(i+=s.scrollLeft,n+=s.scrollTop);const r=Math.max(s.scrollWidth,e.width),o=Math.max(s.scrollHeight,e.height);return{xRel:Math.round(i/r*65535),yRel:Math.round(n/o*65535),valid:!0}}}(Oh||(Oh={}));class xh extends Vh{constructor(t,s){super(),this.V=t,this.Ma=s,this.supportedEventTypes=[Ao.MOUSEMOVE,Ao.CLICK],this.zu=""}baseEnhanceAnalysisEvent(t,s){const{valid:e,xRel:i,yRel:n}=Oh.getRelativePosition(t);if(e){const e=this.Ma.getEventTargetPath(t);e!==F.INVALID_ELEMENT&&(s.xRel=i,s.yRel=n,s.type===Ao.MOUSEMOVE&&(e!==this.zu||this.V.iframesTracking?(this.zu=e,s.tgtHM=e):s.tgtHM=""))}else s.type===Ao.MOUSEMOVE&&(this.zu="");return s}}!function(t){t[t.ANONYMIZED=0]="ANONYMIZED",t[t.CAPTURED=1]="CAPTURED",t[t.MASKED=2]="MASKED"}(Nh||(Nh={}));class $h extends Vh{constructor(t,s,e){super(),this.L=t,this.ju=s,this.M=e,this.supportedEventTypes=[Ao.TAP,Ao.CLICK]}Gu(t){let s="";const e=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let i=e.nextNode();for(;i;){if(s+=i.textContent,this.ju.getElementSensitiveStatus(i.parentElement)!==Nh.CAPTURED)return!0;if(csString.prototype.trim.call(s).length>=100)break;i=e.nextNode()}return!1}baseEnhanceAnalysisEvent(t,s){if(St(csEventtarget.apply(t))){const e=ke(csEventtarget.apply(t),"button,a");if(e&&yt(e.textContent)&&!this.Gu(e)&&!this.M.hasPII(e.textContent,this.L.anonymizeDigits)){const t=vn.truncate(csString.prototype.trim.call(e.textContent),100);t.length>0&&(s.text=t)}}return s}}function Lh(t,s,e){const i=[];return t.mouseMoveHeatmapEnabled&&csArray.prototype.push.call(i,new xh(t,s)),t.isClickedElementTextEnabled()&&csArray.prototype.push.call(i,new $h(t,e,new pt)),csArray.prototype.push.call(i,new Ch,new kh(s)),i}function Mh(t,s,e){const i=[];return t.isClickedElementTextEnabled()&&csArray.prototype.push.call(i,new $h(t,e,new pt)),csArray.prototype.push.call(i,new kh(s)),i}const Dh="v2/events",Uh=["submit"];class Bh{constructor(t,s,e,i,n,r,o,h,c,a,u,l){this.L=t,this.lc=s,this.W=e,this.Eu=i,this.Da=n,this.kc=r,this.Oi=o,this.Oa=h,this.aa=c,this.Lc=a,this.Nc=u,this.ju=l}init(){const t=new bh,s=this.Lc.create(`${this.L.getTrackerUri()}/${Dh}`,!0,"base64");this.Zu=this.Wu(s),this.Ju=this.Ku(t,this.Zu.getRecoveryStorage(),s),this.Ju.init(),this.Nc.addListener(this.Ju),this.aa.addListener(this.Ju),this.kc.register(Uh,((t,s)=>{this.Ju.pushSubmitEvent(t,s)}))}onStartTracking(t){this.Zu.start(),this.Ju.start(t)}onAfterNaturalPageView(){this.Ju.initStates()}onAfterArtificialPageView(){this.Ju.initStates(),this.Ju.collectInitialEvents()}onArtificialPageViewEnd(){this.Ju.clearStates(!0)}onBeforeSessionRenewal(){this.Ju.clearStates(),this.Ju.stop(),this.Zu.stop()}onOptout(){this.Ju.stop(),this.Zu.stop()}Ku(t,s,e){const i=new Eo(window),n=new Po,r=Lh(this.L,this.Eu,this.ju),o=new Io(r,this.Eu,this.Da),h=Mh(this.L,this.Eu,this.ju),c=new To(h,this.Oa),a=new ko(new Ph),u=new je;const l=new On(`${this.L.getTrackerUri()}/${Dh}`),d=new In(this.lc,this.W);return new bo(this.L,o,c,n,i,t,l,d,this.Oi,s,this.Eu,a,u,e,undefined,undefined,undefined,undefined,undefined,undefined,undefined)}Wu(t){return new Vo(new Co("csAnalysisEventsPersisted"),t)}}var Fh;!function(t){t.Artificial="a",t.Renewal="r",t.Natural="n"}(Fh||(Fh={}));class qh extends Ue{constructor(t,s,e,i){super(),this.Jh=t,this.Yu=s,this.it=e,this.Jc=i}init(){this.Qu()}onStart(t){t?this.Xu():this.tl()}onStop(){}triggerArtificialPageView(t,s){this.isStarted?this.sl(t,s):_t(t)&&this.it.overridePath(t,s)}tl(){this.Jc.setPageViewType(Fh.Natural),this.Jh.emitBeforeNaturalPageView(),this.Yu.send(),this.it.cleanupOverrideLifespan(),this.Jh.emitAfterNaturalPageView()}Xu(){this.Jc.setPageViewType(Fh.Renewal),this.Jh.emitBeforeNaturalPageView(),this.Yu.send(),this.Jh.emitAfterNaturalPageView()}sl(t,s){this.Jc.setPageViewType(Fh.Artificial),this.Jh.emitArtificialPageViewEnd(),_t(t)&&this.it.overridePath(t,s),this.Jh.emitBeforeArtificialPageView(),this.Yu.send(),this.it.cleanupOverrideLifespan(),this.Jh.emitAfterArtificialPageView()}Qu(){window.addEventListener("pageshow",(t=>{this.isStarted&&t.persisted&&this.sl()}))}}const Hh=window.navigator.language||window.navigator.userLanguage||window.navigator.browserLanguage||window.navigator.systemLanguage||"unknown";function zh(){return{la:Hh}}class jh{constructor(t){this.Mc=t,this.el=[],this.il=!1}getRequestParameters(){return{dr:this.nl()}}addUrlMaskingPattern(t){const s=this.Mc.getUrlMaskingPattern(t);csArray.prototype.push.call(this.el,s)}enableRemoveQueryString(){this.il=!0}disableRemoveQueryString(){this.il=!1}nl(){const t=this.il?this.Mc.removeQueryString(this.rl()):this.rl();return this.Mc.anonymizeUrl(t,this.el)}rl(){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 Gh{constructor(t){this.J=t,this.ol=this.hl()&&"currentScript"in document}cl(){const t=window.CSCurrentScript;if(!t)return null;const s=window.performance.getEntriesByName(t.src,"resource")[0];return!s||this.al(s)?null:Math.round(s.responseEnd-s.fetchStart)}al(t){const s=t.transferSize;return void 0!==s?0===s||300===s||s{yt(t)?this.vl(s)?this.pl.triggerArtificialPageView(t,s):this.pl.triggerArtificialPageView(t):this.pl.triggerArtificialPageView()})),this.kc.register(Wh,((t,s)=>{yt(t)&&(this.vl(s)?this.it.overridePath(t,s):this.it.overridePath(t))})),this.kc.register(Jh,((t,s)=>{yt(t)&&(this.vl(s)?this.it.overrideQuery(t,s):this.it.overrideQuery(t))})),this.kc.register(Kh,(t=>i.addUrlMaskingPattern(t))),this.kc.register(Yh,(()=>i.enableRemoveQueryString())),this.kc.register(Qh,(()=>i.disableRemoveQueryString()))}start(t){this.pl.start(t)}onBeforeSessionRenewal(){this.pl.stop()}vl(t){return Et(t)&&null!==t}}class tc{constructor(t){this.Ma=t}on(t,s){return e=>{this.Ma.hasValidEventTarget(e)&&this.ml(e,t)&&s(e)}}ml(t,s){const e=me(t);return C.call(e,s)}isMatchesSelectorSupported(){return!!C}}class sc{constructor(){}onLoad(t){this.es=t}onLoadCallbackExecute(){this.es()}start(){const t=this.onLoadCallbackExecute.bind(this);this.wl(t)}wl(t){function s(){document.removeEventListener("DOMContentLoaded",s),window.removeEventListener("load",s),t()}"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?csSetTimeout(t):(document.addEventListener("DOMContentLoaded",s),window.addEventListener("load",s))}}ys([ns("onLoad")],sc.prototype,"onLoadCallbackExecute",null);class ec{constructor(t,s,e){this.L=t,this.W=s,this.J=e,this.Du=It.now()}resetStartTime(){this.Du=It.now()}getSessionData(){const{projectId:t}=this.L,s=this.W.getVisitor();null==s&&es.warn("Visitor is null. This happens when a snippet tries to get Session Data before the tag was initialized.");const{id:e,visitsCount:i}=null!=s?s:{},n=this.J.getSession();null===n&&es.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:e,sessionNumber:i,pageNumber:r,relativeTimestamp:It.now()-this.Du}}}const ic=["clearSession"],nc=["extendSession"],rc=["getSessionData"],oc=["session:start:newVisitor"],hc=["session:clear:visitor"];class cc{constructor(t,s,e,i){this.L=t,this.W=s,this.J=e,this.kc=i}init(){this.gl=new ec(this.L,this.W,this.J),this.kc.register(ic,(()=>this.J.removeSession())),this.kc.register(nc,(()=>this.J.extendSessionPeriodically()),{disableApplyPending:!0}),this.kc.register(rc,(()=>this.gl.getSessionData()),{disableApplyPending:!0}),this.kc.register(oc,(()=>this.W.renewVisitor())),this.kc.register(hc,(()=>{this.W.resetVisitor()}),{disableApplyImmediate:!0})}onBeforeNaturalPageView(){this.W.createOrUpdateVisitor(),this.J.createOrUpdateSession()}onBeforeArtificialPageView(){this.J.abortQuotaServiceRequest(),this.W.createOrUpdateVisitor(),this.J.createOrUpdateSession()}onAfterNaturalPageView(){this.gl.resetStartTime()}onAfterArtificialPageView(){this.gl.resetStartTime()}onOptout(){this.W.removeVisitor(),this.J.removeSession()}onCollectStateChange(t,s){this.J.updateCollectState(t,s)}}class ac{constructor(t,s){this.J=t,this.W=s,this.yl=!1,this.El=ae((()=>this.J.refreshSession()),3e4)}onSessionExpired(t){this.Al=t}isSessionValid(){return!!this.yl||!!this.J.hasValidSession()&&(!this.J.pollCacheRefreshEvent()||!this.W.isSessionRenewed())}isCurrentPageviewValid(){const t=this.J.hasValidSession();return this.J.pollCacheRefreshEvent(!1)?!this.W.isSessionRenewed():t}refreshSession(){this.isSessionValid()?this.El():this._l()&&(this.Rl=It.now(),this.renewSession())}renewSession(){this.yl=!0,this.Al(),this.yl=!1}_l(){return!At(this.Rl)||It.now()-this.Rl>6e4}}var uc,lc;function dc(t){return t.tagDeploymentMode===uc.DualCollectionReview||t.tagDeploymentMode===uc.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"}(uc||(uc={})),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)}}(lc||(lc={}));const fc="RSA-OAEP",pc="AES-CTR";var vc;!function(t){var s;let e,i=!1,n=null;const r=window.TextEncoder?new window.TextEncoder:null;let o;function h(){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(!h()||i)return null;await e;let r=wn(s);r.byteLength>190&&(r=r.slice(0,190));try{return gn(await t.crypto.encrypt({name:fc},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!i},t.getCryptoKey=function(){return n},t.isSupported=h,t.importKey=async function(s){e=t.crypto.importKey("spki",yn(s),{name:fc,hash:"SHA-256"},!1,["encrypt"]).catch((()=>(i=!0,null))),n=await e,e=void 0,n||is.warn(`Fail to import public key '${s}'`)},t.asymmetricEncrypt=c,t.symmetricEncrypt=async function(s,e){if(!h()||i)return null;const n={counter:e.initializationVector,name:pc,length:64},o=r.encode(s);try{return gn(await t.crypto.encrypt(n,e.cryptoKey,o))}catch{return null}},t.encryptSecret=async function(s){const e=await async function(s){var e;if(!h())return null;try{return null!==(e=(await t.crypto.exportKey("jwk",s)).k)&&void 0!==e?e:null}catch{return null}}(s);if(!e)throw new Error("Export secret failed");const i=await c(e);if(!i)throw new Error("Encrypt secret failed");return i},t.generateSymmetricKey=async function(){if(!h()||i)return null;try{return{cryptoKey:await t.crypto.generateKey({name:pc,length:128},!0,["encrypt","decrypt"]),initializationVector:window.crypto.getRandomValues(new Uint8Array(16))}}catch{return null}},t.setDigestSalt=function(t){o=t},t.digest=async function(s){s=csString.prototype.toLocaleLowerCase.call(csString.prototype.trim.call(s)),o&&(s=`${s}:${o}`);const e=r.encode(s);try{return En(await t.crypto.digest("SHA-1",e))}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"])}}(vc||(vc={}));const mc="@user-identifier@";class wc extends Ue{constructor(t,s,e,i){super(),this.L=t,this.Sl=s,this.ya=e,this.Tl=i,this.Il=[],this.ln=[]}onStart(){csArray.prototype.forEach.call(this.Il,(t=>this.trackPageEvent(t))),this.Il=[],csArray.prototype.forEach.call(this.ln,(t=>this.trackEventTriggerRecording(t))),this.ln=[]}onStop(){}trackPageEvent(t){this.isStarted?wc.Pl(t)&&(this.bl(t)?vc.isSupported()&&this.Vl(t):this.Cl(t)):csArray.prototype.push.call(this.Il,t)}bl(t){return z(t,mc)}async Vl(t){if(!this.L.customHashIdEnabled)return;const s=csString.prototype.slice.call(t,17);if(s.length>vc.MAX_DIGEST_INPUT_SIZE)return void es.warn("UserIdentifier event: invalid user identifier");const e=await vc.digest(s);e?(this.kl={eventName:e,isETR:!1,isCustomHashId:!0},this.Ol()):es.warn("Page event: unable to compute customHashId"),this.L.encryptionEnabled&&this.Tl.emitUserIdentifierEvent(s)}Cl(t){this.Tl.emitPageEvent(t),this.kl={eventName:t,isETR:!1,isCustomHashId:!1},this.Ol(),this.L.tagDeploymentMode===uc.LoadClicktalePtc&&lc.sendPageEvent(t)}trackEventTriggerRecording(t){this.isStarted?wc.Pl(t)&&(this.L.malkaEtrEnabled?this.Nl(t):this.xl(t)):csArray.prototype.push.call(this.ln,t)}Nl(t){z(t,"@ETP@")?this.Tl.emitEventTriggerRecording(t,qe.ETR_PAGE):this.Tl.emitEventTriggerRecording(t,qe.ETR_SESSION),this.kl={eventName:t,isETR:!0,isCustomHashId:!1},this.Ol()}xl(t){var s;(dc(s=this.L)||s.tagDeploymentMode===uc.LoadClicktalePtc)&&(this.Tl.emitEventTriggerRecording(t,qe.ETR_LEGACY),this.kl={eventName:t,isETR:!0,isCustomHashId:!1},this.Ol(),this.L.tagDeploymentMode===uc.LoadClicktalePtc&&lc.sendEventTriggerRecording(t))}getRequestParameters(){return{value:this.ya.compressSync(this.kl.eventName,"base64"),ct:this.ya.algorithm,isETR:`${this.kl.isETR}`,isCustomHashId:`${this.kl.isCustomHashId}`}}Ol(){this.Sl.send()}static Pl(t){return yt(t)&&!!csString.prototype.trim.call(t)}}const gc=["trackPageEvent"],yc=["trackEventTriggerRecording"];class Ec{constructor(t,s,e,i,n){this.L=t,this.kc=s,this.ya=e,this.mc=i,this.Tl=n}init(){const t=new tt(this.L.getTrackerUri(),"pageEvent");this.$l=new wc(this.L,t,this.ya,this.Tl),t.setRequestParametersProviders(this.$l,this.mc),this.kc.register(gc,(t=>{this.$l.trackPageEvent(t)})),this.kc.register(yc,(t=>{this.$l.trackEventTriggerRecording(t)}))}onStartTracking(){this.$l.start()}}class Ac{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()}}class _c extends Ac{constructor(){super(),this.Qe=new dr((t=>this.errorListener(t)))}onStartTracking(){this.Qe.observe()}onStopTracking(){this.Qe.disconnect()}errorListener(t){const s=this.Ll(t);for(const t in this.subscriptions){(0,this.subscriptions[t])(s)}}Ml(t){return t=null!=t?t:"[NO ERROR MESSAGE]",vn.truncate(t,_c.Bh,vn.ELLIPSIS)}Ll(t){return{errorType:"jsError",message:this.Ml(t.message),filename:t.filename,lineno:t.lineno,colno:t.colno}}}_c.Bh=1024,ys([ns("Event handler type: error")],_c.prototype,"errorListener",null);const Rc=["[data-cs-mask]","#c1_card_info_id"];class Sc{constructor(t){this.L=t,this.Dl=[...Rc],this.Ul=[{selector:"input:not([type=button]):not([type=submit])",attrName:"value"}],this.Bl={PIISelectors:[".ctHidden,textarea",...Rc],Attributes:[{selector:".ctHidden,input:not([type=button]):not([type=submit])",attrName:"value"}]},this.Fl={elementSelector:"",attrSelector:"",attrSelectors:[]};const s={PIISelectors:[],Attributes:[]};dc(this.L)||(csArray.prototype.push.call(s.PIISelectors,...this.Dl),csArray.prototype.push.call(s.Attributes,...this.Ul)),this.Fl=Oe.getComputedSelectorSettings(s,this.Fl)}setMaskedElementSettingsFromCommand(t){t=Oe.sanitizeSelectorUserInput(t),Oe.isSelectorUserInput(t)&&this.ql(t)}setMaskedElementSettingsFromParent(t){const s={PIISelectors:csString.prototype.split.call(t.elementSelector,","),Attributes:t.attrSelectors};this.ql(s)}getMaskedElementSettings(){return this.Fl}initCTPII(){var t,s,e,i,n,r;const o=this.Bl;(null===(e=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)||void 0===e?void 0:e.Text)instanceof Array&&o.PIISelectors.push(...window.ClickTaleSettings.DOM.PII.Text),(null===(r=null===(n=null===(i=null===window||void 0===window?void 0:window.ClickTaleSettings)||void 0===i?void 0:i.DOM)||void 0===n?void 0:n.PII)||void 0===r?void 0:r.Attributes)instanceof Array&&window.ClickTaleSettings.DOM.PII.Attributes.forEach((t=>{yt(t.attr)&&yt(t.rule)&&o.Attributes.push({selector:t.rule,attrName:t.attr})})),this.ql(o)}ql(t){this.Fl=Oe.getComputedSelectorSettings(t,this.Fl)}}class Tc{constructor(t){this.kc=t}init(){this.Hl(Tc.zl,xt),this.Hl(Tc.jl,Nt)}Hl(t,s){this.kc.register([t],((t,e)=>{yt(t)&&(yt(e)||Tt(e))&&es.error(e,`${s}${t}`)}))}}Tc.jl="logSnippetError",Tc.zl="logImplementationSnippetError";class Ic{constructor(t,s,e,i,n){this.L=t,this.oa=s,this.Cc=e,this.ju=i,this.aa=n}init(){this.oa.onChildMessage(((t,s,e)=>this.aa.emitIframeEvent(t,s,e))),this.oa.setSentiveStatusCallback((()=>this.ju.getSensitiveStatus())),this.oa.setRecordingStatusCallback((()=>this.Cc.getRecordingStatus()))}onStartTracking(){this.L.iframesTracking&&this.oa.start()}onOptout(){this.L.iframesTracking&&this.oa.stop()}onSensitiveStatusChange(){if(this.L.iframesTracking){const t=this.ju.getSensitiveStatus();this.oa.onSensitiveStatusChange(t)}}onRecordingStatusChange(){if(this.L.iframesTracking){const t=this.Cc.getRecordingStatus();this.oa.onRecordingStatusChange(t)}}}class Pc extends Ue{constructor(t){super(),this.L=t,this.Gl=0,this.Zl=new Map,this.Wl={boundElement:window,type:"message",listener:t=>this.Jl(t)}}onChildMessage(t){this.Kl=t}setRecordingStatusCallback(t){this.Yl=t}setSentiveStatusCallback(t){this.Ql=t}onSensitiveStatusChange(t){const s=Qt.buildBaseMessage(Yt.SensitiveStatus,Kt.Parent,this.L.projectId);s.content=t;const e=Qt.buildBaseMessage(Yt.SensitiveStatus,Kt.Parent,this.L.projectId);e.content={...t,started:!1,useAnonymization:!0,capturedElementSelector:""},this.Zl.forEach((t=>{if(t.port){const i=this.Xl(t)?e:s;this.td(t,i)}}))}onRecordingStatusChange(t){const s=Qt.buildBaseMessage(Yt.RecordingStatus,Kt.Parent,this.L.projectId);s.content=t,this.Zl.forEach((t=>{!this.Xl(t)&&t.port&&this.td(t,s)}))}sendToChildren(t,s){const e=Qt.buildBaseMessage(t,Kt.Parent,this.L.projectId);e.content=s,this.sd(e)}onStart(){oe(this.Wl,!1),this.nd()}onStop(){this.rd(),he(this.Wl,!1),this.od()}nd(){const t=this.ad();this.ud(t),csArray.prototype.forEach.call(t,(t=>{if(null===this.ld(t)){const s={iframe:t};this.Zl.set(this.Gl,s),this.Gl+=1}})),this.dd()}ad(){return csArray.prototype.filter.call(Li.findAllElements("iframe"),(t=>this.pd(t)))}ud(t){this.Zl.forEach(((s,e)=>{s.iframe&&-1===csArray.prototype.indexOf.call(t,s.iframe)&&this.vd(e,s)}))}vd(t,s){s.port&&Qt.closeChannelPort(s.port),this.Zl.delete(t)}od(){this.Zl.forEach((t=>{t.port&&Qt.closeChannelPort(t.port)})),this.Zl.clear()}ld(t){let s=null;return this.Zl.forEach(((e,i)=>{null===s&&e.iframe===t&&(s=i)})),s}pd(t){return t.id!==i&&(!t.src||jt(zt(t.src),this.L.hostnames))}sd(t){this.Zl.forEach((s=>{this.td(s,t)}))}td(t,s){const e=s.type===Yt.SensitiveStatus||s.type===Yt.RecordingStatus;!t.port||e&&!t.initialStatusSent||Qt.sendChannelMessage(t.port,s)}dd(){this.Zl.forEach(((t,s)=>{if(t.iframe.contentWindow){const e=this.md(s);Qt.sendPostMessage(t.iframe.contentWindow,"*",e)}}))}rd(){const t=this.wd();this.Zl.forEach((s=>{s.port?Qt.sendChannelMessage(s.port,t):s.iframe.contentWindow&&Qt.sendPostMessage(s.iframe.contentWindow,"*",t)}))}md(t){return Qt.buildBaseMessage(Yt.Discovery,Kt.Parent,this.L.projectId,t)}wd(){return Qt.buildBaseMessage(Yt.Stop,Kt.Parent,this.L.projectId)}gd(t,s){const e=this.Zl.get(t);void 0!==e?(e.port=s,e.port.onmessage=t=>{this.yd(t,e)}):es.error(`Parent received channel messaging initialization from unknow child id : ${t} (${this.Gl})`)}Ed(t){if(!t.port)return;const s=Qt.buildBaseMessage(Yt.SensitiveStatus,Kt.Parent,this.L.projectId),e=this.Ql();this.Xl(t)&&(e.started=!1,e.capturedElementSelector="",e.useAnonymization=!0),s.content=e,Qt.sendChannelMessage(t.port,s)}Ad(t){if(!t.port)return;const s=Qt.buildBaseMessage(Yt.RecordingStatus,Kt.Parent,this.L.projectId),e=this.Yl();this.Xl(t)&&(e.isRecording=!1,e.isMutationTrackerStarted=!1),s.content=e,Qt.sendChannelMessage(t.port,s)}yd(t,s){if(void 0===s)return void es.error(`Parent received channelMessage from unknown child : ${csJSON.stringify(t.data)}`);const e=t.data.type,i=t.data.content;e===Yt.EndOfBufferedMessages?(this.Ed(s),this.Ad(s),s.initialStatusSent=!0):this.Kl(s.iframe,e,i)}Jl(t){if(Qt.isMessageValid(t,Kt.Child,this.L.projectId,this.L.hostnames))switch(t.data.type){case Yt.Discovery:if(void 0===t.data.id)return void this.nd();if(t.ports&&1===t.ports.length&&this.Zl.has(t.data.id))return void this.gd(t.data.id,t.ports[0]);es.error(`Parent received wrong channelMessage initialization : (${t.origin}) : ${csJSON.stringify(t.data)}`);break;case Yt.ChildLogMessage:this.Kl(null,Yt.ChildLogMessage,t.data.content);break;default:es.warn(`Parent received unexpected postMessage type from child (${t.origin}) : ${csJSON.stringify(t.data)}`)}}Xl(t){return Oe.isMaskedElement(t.iframe)||Oe.isMaskedElementChild(t.iframe)}}class bc{constructor(t){this._d=t}buildApiErrors(t,s){const e=this._d.collectDataPoints(t,s);if(null===e)return null;const i=this.Rd(t,e);if(s){return{apiError:i,detailedApiError:this.Sd(t,e)}}return{apiError:i}}Sd(t,s){const e=this.Td(t);return s.collectQueryParam&&t.queryParameters&&(e.queryParameters=t.queryParameters),s.collectRequestBody&&t.requestBody&&(e.requestBody=t.requestBody),s.collectResponseBody&&t.requestBody&&(e.responseBody=t.responseBody),Object.keys(s.standardRequestHeaders).length>0&&(e.standardRequestHeaders=s.standardRequestHeaders),Object.keys(s.standardResponseHeaders).length>0&&(e.standardResponseHeaders=s.standardResponseHeaders),Object.keys(s.customRequestHeaders).length>0&&(e.customRequestHeaders=csJSON.stringify(s.customRequestHeaders)),Object.keys(s.customResponseHeaders).length>0&&(e.customResponseHeaders=csJSON.stringify(s.customResponseHeaders)),Object.keys(s.plainCustomRequestHeaders).length>0&&(e.plainCustomRequestHeaders=s.plainCustomRequestHeaders),Object.keys(s.plainCustomResponseHeaders).length>0&&(e.plainCustomResponseHeaders=s.plainCustomResponseHeaders),s.plainResponseBodyAttributes&&Object.keys(s.plainResponseBodyAttributes).length>0&&(e.plainResponseBodyAttributes=s.plainResponseBodyAttributes),s.plainRequestBodyAttributes&&Object.keys(s.plainRequestBodyAttributes).length>0&&(e.plainRequestBodyAttributes=s.plainRequestBodyAttributes),Object.keys(s.responseBodyAttributes).length>0&&(e.responseBodyAttributes=csJSON.stringify(s.responseBodyAttributes)),Object.keys(s.requestBodyAttributes).length>0&&(e.requestBodyAttributes=csJSON.stringify(s.requestBodyAttributes)),e}Td(t){return{errorType:"apiError",url:t.url,method:t.method,requestTime:t.requestTime,responseTime:t.responseTime,statusCode:t.statusCode,library:t.library}}Rd(t,s){const e=this.Td(t);return s.matchingBodyContents.length>0&&(e.matchingBodyContents=s.matchingBodyContents),Object.keys(s.plainResponseBodyAttributes).length>0&&(e.plainBodyResponseAttributes=s.plainResponseBodyAttributes),e}}class Vc extends Ac{constructor(t,s,e){super(),this.Id=t,this.Pd=s,this.bd=e,this.Vd=0,this.Cd=new bc(e)}subscribe(t,s,e){(null==e?void 0:e.detailedEvent)&&(Object.defineProperty(s,"detailedEvent",{value:e.detailedEvent}),this.Vd++),super.subscribe(t,s)}unsubscribe(t){var s;(null===(s=this.subscriptions[t])||void 0===s?void 0:s.hasOwnProperty("detailedEvent"))&&this.Vd--,super.unsubscribe(t)}init(){const t=this.bd.computeApiErrorCollectionOptions();this.Id.setCollectionOptions(t),this.Id.onEvent((t=>this.kd(t))),this.Pd.setCollectionOptions(t),this.Pd.onEvent((t=>this.kd(t)))}onStartTracking(){this.Id.start(),this.Pd.start()}onStopTracking(){this.Id.stop(),this.Pd.stop()}kd(t){const s=this.Cd.buildApiErrors(t,0!==this.Vd);if(s)for(const t in this.subscriptions){const e=this.subscriptions[t];e.hasOwnProperty("detailedEvent")?s.detailedApiError&&e(s.detailedApiError):e(s.apiError)}}}class Cc{constructor(t){this.Mc=t,this.Od=new Set,this.el=[]}addUrlMaskingPattern(t){if(this.Od.has(t))return;this.Od.add(t);const s=this.Mc.getUrlMaskingPattern(t);csArray.prototype.push.call(this.el,s)}getUrlMaskingPatterns(){return this.el}anonymize(t){const s=this.Mc.removeQueryString(t.url);return{...t,url:this.Mc.anonymizeUrl(s,this.el),library:t.library?this.Mc.anonymizeUrl(t.library,this.el):void 0}}}class kc{constructor(t,s){this.M=t,this.it=s}anonymize(t){return yt(t.message)&&(t.message=this.Nd(t.message),t.message=this.M.anonymizePII(t.message)),yt(t.filename)&&(t.filename=this.it.computeOverriddenUrl(t.filename)),t}Nd(t){return csString.prototype.replace.call(t,/(value\s*=\s*".*"|value\s*=\s*'.*')/,"value='CS_ANONYMIZED_VALUE'")}}class Oc extends Ac{constructor(t){super(),this.xd=t,this.Un=[{boundElement:document,type:"touchstart",listener:t=>this.fn(t)},{boundElement:document,type:"touchmove",listener:t=>this.fn(t)},{boundElement:document,type:"touchend",listener:t=>this.fn(t)}],this.$d=new rr,this.$d.onGesture(((t,s)=>this._h(t,s)))}_h(t,s){for(const e in this.subscriptions){(0,this.subscriptions[e])(t,s)}}onStartTracking(){this.canDetectGesture()&&csArray.prototype.forEach.call(this.Un,(t=>oe(t)))}onStopTracking(){this.canDetectGesture()&&csArray.prototype.forEach.call(this.Un,(t=>he(t)))}canDetectGesture(){return void 0!==window.devicePixelRatio}fn(t){this.xd.tryToExecute("process gesture event",(()=>{if(this.$d.isValidTouchEvent(t))switch(t.type){case"touchstart":this.$d.processActionDown(t);break;case"touchmove":this.$d.processActionMove();break;case"touchend":this.$d.processActionUp(t)}}))()}static isSwipe(t){return t.type===Qn.FLICK||t.type===Qn.DRAG}}class Nc extends Ue{constructor(t,s){super(),this.Mi=t,this.Ld=s,this.Md=0}onStart(){es.isPerfLoggingActive()&&(this.Dd=window.setInterval((()=>this.Ud()),Nc.Bd))}onStop(){es.isPerfLoggingActive()&&(this.Ud(),clearInterval(this.Dd))}Ud(){if(ds.isEmpty||this.Md>=Nc.Fd)return;this.Md++;const t={a:Nc.qd,l:Nc.Hd,...this.Ld.getRequestParameters()},s=[];ds.forEach((e=>{csArray.prototype.forEach.call(e,(e=>{csArray.prototype.push.call(s,{...e,...t})}))})),this.Mi.send(s),ds.clear()}}Nc.qd="uxa",Nc.Hd="perf",Nc.Bd=5e3,Nc.Fd=5;class xc{constructor(t,s,e){this.L=t,this.Ld=s,this.Lc=e}init(){this.zd=new Nc(this.Lc.create(this.L.getLoggerUri(),!0),this.Ld)}onStartTracking(){this.zd.start()}onOptout(){this.zd.stop()}}class $c{constructor(t){this.ju=t,this.jd=!1}enableRecordingStatus(t,s,e){this.jd=!0,this.ma=t,this.J=s,this.Li=e}getRecordingStatus(){var t,s,e,i;if(!this.jd)return{isRecording:!1,recordingStartTimestamp:0,etrState:Fe.ETR_OFF};const n=this.ju.getSensitiveStatus();return{isRecording:this.ma.isRecording(),isMutationTrackerStarted:this.ma.isStarted,useAnonymization:n.useAnonymization,encryptionSelectors:null===(t=this.Li)||void 0===t?void 0:t.getEncryptionSelectors(),activateOnlineAssetsOnNextStart:null===(s=this.ma.getStaticResourceManagerStatus())||void 0===s?void 0:s.onlineAssets.enabledForChildrenOnNextStart,recordingStartTimestamp:parseInt(this.ma.getRecordingStartTimestamp(),10),etrState:null!==(i=null===(e=this.J.getSession())||void 0===e?void 0:e.etrState)&&void 0!==i?i:Fe.ETR_OFF}}}class Lc{static isRecordingSupported(){return"MutationObserver"in window&&"visibilityState"in document}static isAsyncSerializationSupported(){return"Promise"in window&&"findIndex"in csArray.prototype}}class Mc extends Ue{constructor(t,s,e,i){super(),this.xi=t,this.Gd=s,this.lc=e,this.$i=i,this.Zd=[],this.Zi=0}init(){this.xi.init()}initStates(){this.Wd(),this.Zd=[],this.Zi=0,this.xu()}xu(){this.Du=It.now()}Mu(){return It.now()-this.Du}onStart(){this.xi.subscribe(Mc.Rn,(t=>this.fn(t)))}onStop(){this.xi.unsubscribe(Mc.Rn)}onIframeApiError(t){this.fn(t)}fn(t){this.isStarted&&this.Zithis.$i.addUrlMaskingPattern(t)))}onStartTracking(){this.Kd.start()}onAfterNaturalPageView(){this.Kd.initStates()}onAfterArtificialPageView(){this.Kd.initStates()}onBeforeSessionRenewal(){this.Kd.stop()}onOptout(){this.Kd.stop()}}class Bc extends Ue{constructor(t,s,e,i,n,r){super(),this.Qd=t,this.Xd=s,this.lc=e,this.Ni=i,this.Nc=n,this.it=r,this.tf=[],this.bc=0,this.sf=[]}initStates(){this.Du=It.now(),this.Xd.removeQueryParams(),this.Xd.setQueryParams(this.lc.getRequestParameters()),this.tf=[],this.bc=0}onStart(){this.Qd.subscribe(Bc.Rn,(t=>this.fn(t))),this.ef()}onStop(){this.Qd.unsubscribe(Bc.Rn)}onIframeJavascriptError(t){this.fn(t)}trackCustomError(t){const s={errorType:"jsError",message:`Custom Error: ${t}`,lineno:1,colno:1,filename:"https://cserror.com/texterror.js"};this.if(s)}if(t){if(this.isStarted){const s=this.fn(t);s&&this.Nc.emitCustomJavaScriptErrorEvent(s)}else csArray.prototype.push.call(this.sf,t)}ef(){this.isStarted&&(csArray.prototype.forEach.call(this.sf,(t=>this.if(t))),this.sf=[])}fn(t){if(this.isStarted&&this.bc<20){const s={...t,pageUrl:this.it.getAnonymizedUrl(),rt:this.Mu()};return this.Ni.anonymize(s),csArray.prototype.push.call(this.tf,s),this.Jd(),s}return null}Mu(){return It.now()-this.Du}Jd(){this.Xd.send({errors:this.tf}),this.tf=[],this.bc+=1}}Bc.Rn="JavaScriptErrorsService";const Fc=["trackError"];class qc{constructor(t,s,e,i,n,r,o,h,c){this.Qd=t,this.Ni=s,this.L=e,this.lc=i,this.aa=n,this.kc=r,this.Nc=o,this.it=h,this.Lc=c}init(){const t=this.Lc.create(`${this.L.getTrackerUri()}/errors`,!0);this.nf=new Bc(this.Qd,t,this.lc,this.Ni,this.Nc,this.it),this.aa.addListener(this.nf),this.Yd()}Yd(){this.L.jsCustomErrorsEnabled&&!this.L.customErrors.enabled&&this.kc.register(Fc,(t=>{this.nf.trackCustomError(t)}))}onStartTracking(){this.nf.start()}onAfterNaturalPageView(){this.nf.initStates()}onAfterArtificialPageView(){this.nf.initStates()}onBeforeSessionRenewal(){this.nf.stop()}onOptout(){this.nf.stop()}}var Hc;!function(t){t.buildCustomErrorEvent=function(t,s,e=!1){const i={message:vn.truncate(t,300,vn.ELLIPSIS),errorType:"customError"};return(e||function(t){const s=Object.keys(t).length;return s>0&&s<=5}(s))&&(!function(t){for(const s in t){let e=t[s];if(t[s].length>30&&(e=vn.truncate(t[s],30,vn.ELLIPSIS),t[s]=e),s.length>30){const i=vn.truncate(s,30,vn.ELLIPSIS);delete t[s],t[i]=e}}}(s),i.attributes=s),i}}(Hc||(Hc={}));class zc extends Ue{constructor(t,s,e,i,n){super(),this.rf=t,this.lc=s,this.hf=e,this.Tl=i,this.cf=n,this.af=[],this.Vc=0,this.sf=[]}initStates(){var t;this.Wd(),this.Du=It.now(),this.af=[],this.Vc=0,null===(t=this.cf)||void 0===t||t.onEvent((t=>this.fn(t)))}trackCustomError(t,s={}){if(!yt(t)||!Et(s))return;const e=Hc.buildCustomErrorEvent(t,s);this.if(e)}onIframeCustomError(t){this.fn(t)}onStart(){var t;this.ef(),null===(t=this.cf)||void 0===t||t.start()}onStop(){var t;null===(t=this.cf)||void 0===t||t.stop()}ef(){this.isStarted&&(csArray.prototype.forEach.call(this.sf,(t=>this.if(t))),this.sf=[])}if(t){if(this.isStarted){const s=this.fn(t);s&&this.Tl.emitCustomErrorEvent(s)}else csArray.prototype.push.call(this.sf,t)}fn(t){if(this.isStarted&&this.Vc<20){const s=this.uf(t);return csArray.prototype.push.call(this.af,s),this.Jd(),s}return null}uf(t){const s={...t,rt:this.Mu()};return s.message=this.hf.anonymizePII(t.message),s}Wd(){this.rf.removeQueryParams(),this.rf.setQueryParams(this.lc.getRequestParameters())}Mu(){return It.now()-this.Du}Jd(){this.rf.send({errors:this.af}),this.af=[],this.Vc+=1}}class jc{constructor(t,s,e,i,n,r,o,h){this.hf=t,this.L=s,this.lc=e,this.kc=i,this.Nc=n,this.Lc=r,this.aa=o,this.cf=h}init(){const t=this.Lc.create(`${this.L.getTrackerUri()}/custom-errors`,!0);this.lf=new zc(t,this.lc,this.hf,this.Nc,this.cf),this.aa.addListener(this.lf),this.Yd()}Yd(){this.kc.register(Fc,((t,s)=>{this.lf.trackCustomError(t,s)}))}onStartTracking(){this.lf.start()}onAfterNaturalPageView(){this.lf.initStates()}onAfterArtificialPageView(){this.lf.initStates()}onBeforeSessionRenewal(){this.lf.stop()}onOptout(){this.lf.stop()}}class Gc{constructor(){this.df=Fh.Natural}setPageViewType(t){this.df=t}getPageViewType(){return this.df}getRequestParameters(){return{pvt:this.df}}}class Zc{constructor(t){this.Oi=t}onAfterVisitorRenewal(){this.Oi.renewSession()}}var Wc,Jc;!function(t){t.replayRecordingUnmaskedUrlRegex="replayRecordingUnmaskedUrlRegex",t.replayRecordingMaskedUrlRegex="replayRecordingMaskedUrlRegex",t.replayRecordingUnmaskedUrlRegexRules="replayRecordingUnmaskedUrlRegexRules",t.replayRecordingMaskedUrlRegexRules="replayRecordingMaskedUrlRegexRules"}(Wc||(Wc={})),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"}(Jc||(Jc={}));class Kc{constructor(t,s,e,i){this.ll=t,this.L=s,this.it=e,this.ff=i}init(){this.pf()}shouldUseAnonymization(){if(this.ll.isReplayUnanonymizedAllowedByConsent()){switch(this.L.anonymisationMethod){case null:case Wc.replayRecordingMaskedUrlRegex:return!(!this.L.replayRecordingMaskedUrlRegex||!this.L.replayRecordingMaskedUrlRegex.test(this.it.getAnonymizedUrl()));case Wc.replayRecordingMaskedUrlRegexRules:return this.ff.evaluateUrl(this.it.getAnonymizedUrl())}return!1}switch(this.L.anonymisationMethod){case null:case Wc.replayRecordingUnmaskedUrlRegex:return!(this.L.replayRecordingUnmaskedUrlRegex&&this.L.replayRecordingUnmaskedUrlRegex.test(this.it.getAnonymizedUrl()));case Wc.replayRecordingUnmaskedUrlRegexRules:return!this.ff.evaluateUrl(this.it.getAnonymizedUrl())}return!0}pf(){this.L.anonymisationMethod===Wc.replayRecordingMaskedUrlRegexRules&&this.L.replayRecordingMaskedUrlRegexRules?this.ff.setRegexRules(this.L.replayRecordingMaskedUrlRegexRules):this.L.anonymisationMethod===Wc.replayRecordingUnmaskedUrlRegexRules&&this.L.replayRecordingUnmaskedUrlRegexRules&&this.ff.setRegexRules(this.L.replayRecordingUnmaskedUrlRegexRules)}}class Yc{constructor(){this.vf=[]}setRegexRules(t){this.vf=csArray.prototype.map.call(t,(t=>this.mf(t)))}evaluateUrl(t){return csArray.prototype.some.call(this.vf,(s=>{var e,i;const n=this.wf(t,s);return(null==s?void 0:s.notOperator)?!(null===(e=s.regex)||void 0===e?void 0:e.test(n)):null===(i=s.regex)||void 0===i?void 0:i.test(n)}))}wf(t,s){const e=Zt(t);return e?s.ignoreQueryParams&&s.ignoreURIFragments?`${e.origin}${e.pathname}`:s.ignoreQueryParams?`${e.origin}${e.pathname}${e.hash}`:s.ignoreURIFragments?`${e.origin}${e.pathname}${e.search}`:t:t}gf(t){return t.ignoreCaseSensitivity?"i":""}mf(t){switch(t.operator){case Jc.NOT_START:t.notOperator=!0;case Jc.START:t.regex=new csRegExp(`^${t.value}`,this.gf(t));break;case Jc.NOT_END:t.notOperator=!0;case Jc.END:t.regex=new csRegExp(`${t.value}$`,this.gf(t));break;case Jc.NOT_CONTAIN:t.notOperator=!0;case Jc.CONTAIN:t.regex=new csRegExp(`${t.value}`,this.gf(t));break;case Jc.NOT_EXACT:t.notOperator=!0;case Jc.EXACT:t.regex=new csRegExp(`^${t.value}$`,this.gf(t));break;default:es.warn(`buildRegexWithRule, unknown type: ${t.operator}`)}return t}}class Qc{constructor(){this.yf=["application/json","application/graphql","application/xml","text/plain","text/csv","text/html","text/xml","text/javascript"]}setCollectionOptions(t){this.Ef=t}isValidBodyType(t){const s=t["content-type"];if(!s)return!1;const e=csString.prototype.toLocaleLowerCase.call(s);return Ms(this.yf,(t=>z(e,t)))}canCollect(t,s){return this.Af(t,s)&&this._f(s)}Af(t,s){return t>=400||t>=200&&t<300&&this.Ef.statusCodes.has(t)&&this.Rf(s)}Rf(t){return Ms(this.Ef.urls,(s=>-1!==csString.prototype.indexOf.call(t,s)))}_f(t){return function(t,s){const e=t.length;for(let i=0;i-1===csString.prototype.indexOf.call(t,s)))}}class Xc extends Qc{constructor(){super(),this.Sf=csSymbol("ApiCall"),this.Xs=!1,this.Tf=null,this.If=null,this.Pf=null,this.bf=({context:t,args:s,callerName:e})=>this.interceptOpen(t,s,e),this.Vf=({context:t,args:s})=>this.interceptSetRequestHeader(t,s),this.Cf=({context:t,args:s})=>this.interceptSend(t,s)}onEvent(t){this.Bn=t}start(){this.Xs||(this.kf(),this.Tf&&this.Tf.activate(),this.If&&this.If.activate(),this.Pf&&this.Pf.activate(),this.Xs=!0)}stop(){this.Xs&&(this.Tf&&this.Tf.deactivate(),this.If&&this.If.deactivate(),this.Xs=!1)}kf(){this.Tf||(this.Tf=se({target:XMLHttpRequest.prototype,methodName:"open",hook:this.bf,options:{withCallerName:!0}})),this.If||(this.If=se({target:XMLHttpRequest.prototype,methodName:"setRequestHeader",hook:this.Vf})),this.Pf||(this.Pf=se({target:XMLHttpRequest.prototype,methodName:"send",hook:this.Cf}))}interceptOpen(t,s,e){if(!s[1]||!yt(s[1]))return;const[i,n]=csString.prototype.split.call(s[1],"?");t[this.Sf]={library:e,requestTime:It.now(),method:s[0],url:qt(i),queryParameters:n,statusCode:0,responseHeaders:{},requestHeaders:{},responseBody:"",requestBody:""},t.addEventListener("readystatechange",(()=>this.readyStateChangeListener(t)))}readyStateChangeListener(t){t[this.Sf]&&t.readyState===XMLHttpRequest.DONE&&this.canCollect(t.status,t[this.Sf].url)&&(t[this.Sf].responseTime=It.now(),t[this.Sf].statusCode=t.status,t[this.Sf].responseHeaders=this.Of(t.getAllResponseHeaders()),!super.isValidBodyType(t[this.Sf].responseHeaders)||""!==t.responseType&&"text"!==t.responseType||(t[this.Sf].responseBody=t.responseText),this.Bn(t[this.Sf]))}interceptSetRequestHeader(t,s){if(!t[this.Sf])return;let e=s[0],i=csString.prototype.valueOf.call(new csString(s[1]));"string"==typeof e&&0!==i.length&&(e=csString.prototype.toLowerCase.call(csString.prototype.trim.call(e)),i=csString.prototype.trim.call(i),t[this.Sf].requestHeaders[e]?t[this.Sf].requestHeaders[e]+=`, ${i}`:t[this.Sf].requestHeaders[e]=i)}interceptSend(t,s){t[this.Sf]&&super.isValidBodyType(t[this.Sf].requestHeaders)&&"string"==typeof s[0]&&(t[this.Sf].requestBody=s[0])}Of(t){const s={};return csArray.prototype.forEach.call(csString.prototype.split.call(t,/[\r\n]+/),(t=>{const[e,i]=csString.prototype.split.call(t,/:\s*/);i&&(s[csString.prototype.toLowerCase.call(e)]=csString.prototype.trim.call(i))})),s}}ys([ns("XhrRequestTracker.interceptOpen")],Xc.prototype,"interceptOpen",null),ys([ns("XhrRequestTracker.readyStateChangeListener")],Xc.prototype,"readyStateChangeListener",null),ys([ns("XhrRequestTracker.interceptSetRequestHeader")],Xc.prototype,"interceptSetRequestHeader",null),ys([ns("XhrRequestTracker.interceptSend")],Xc.prototype,"interceptSend",null);class ta extends Qc{constructor(){super(),this.Xs=!1,this.Nf=null,this.xf=({result:t,args:s,callerName:e})=>{this.interceptFetch(t,s,e)}}onEvent(t){this.Bn=t}start(){this.Xs||this.$f()&&(this.Lf(),this.Nf&&this.Nf.activate(),this.Xs=!0)}stop(){this.Xs&&(this.Nf&&this.Nf.deactivate(),this.Xs=!1)}$f(){return!!window.fetch&&"function"==typeof window.fetch}Mf(t){if(t[0]&&"function"==typeof t[0].clone){const s=Os(t);return s[0]=t[0].clone(),s}return t}Lf(){this.Nf||(this.Nf=se({target:window,methodName:"fetch",hook:this.xf,hookPrepareArgs:this.Mf,options:{withCallerName:!0}}))}async interceptFetch(t,s,e){const i=s[0],n=s[1],r=new Request(i,n);if(!yt(r.url))return;const o=It.now();let h;try{h=await t}catch(t){if(this.Df(t)||this.Uf(t)||this.Bf(t))return;throw t}const[c,a]=csString.prototype.split.call(r.url,"?"),u=qt(c);if(super.canCollect(h.status,u)){const t={library:e,method:r.method,url:u,queryParameters:a,requestTime:o,responseTime:It.now(),statusCode:h.status,requestBody:"",responseBody:"",requestHeaders:this.Ff(r.headers),responseHeaders:this.Ff(h.headers)};!h.bodyUsed&&super.isValidBodyType(t.responseHeaders)&&(t.responseBody=await h.clone().text()),super.isValidBodyType(t.requestHeaders)&&(t.requestBody=await r.text()),this.Bn(t)}}Df(t){return t instanceof TypeError}Uf(t){return t instanceof DOMException&&"AbortError"===t.name}Bf(t){return t instanceof DOMException&&csArray.prototype.some.call(ta.qf,(s=>s===t.name))}Ff(t){const s={};return t.forEach(((t,e)=>{t&&(s[csString.prototype.toLowerCase.call(e)]=csString.prototype.trim.call(t))})),s}}ta.qf=["NoModificationAllowedError","InvalidStateError","OperationError"],ys([ns("FetchRequestTracker.interceptFetch")],ta.prototype,"interceptFetch",null);class sa{constructor(){this.Hf=64e3,this.zf=5e3,this.jf=2e3,this.Gf=8e3,this.Ao=!!self.TextEncoder,this.Ao&&(this.Zf=new TextEncoder)}Wf(t){return this.Zf.encode(t).byteLength}Jf(t,s,e){let i=0;t[s]&&(i+=this.Wf(t[s]),i>this.Gf&&(i=0,t[s]=vn.ELLIPSIS)),t[e]&&(i+=this.Wf(csJSON.stringify(t[e])),i>this.Gf&&(t[e]=sa.truncatedObjectMarker))}Kf(t){t.queryParameters&&this.Wf(t.queryParameters)>this.jf&&(t.queryParameters=vn.ELLIPSIS)}Yf(t){t.requestBody&&this.Wf(t.requestBody)>this.Hf&&(t.requestBody=vn.ELLIPSIS),t.responseBody&&this.Wf(t.responseBody)>this.zf&&(t.responseBody=vn.ELLIPSIS)}truncate(t){this.Ao?(this.Kf(t),this.Yf(t),this.Jf(t,"customResponseHeaders","plainCustomResponseHeaders"),this.Jf(t,"customRequestHeaders","plainCustomRequestHeaders")):(t.queryParameters="",t.requestBody="",t.responseBody="",t.customResponseHeaders="",t.customRequestHeaders="",t.plainCustomResponseHeaders={},t.plainCustomRequestHeaders={})}}var ea,ia;sa.truncatedObjectMarker={[vn.ELLIPSIS]:vn.ELLIPSIS},function(t){t.isValidJSONPath=function(t){if(!t)return!0;if(!function(t){const s=[];for(let e=0;e-1))return!1;csArray.prototype.pop.call(s)}return 0===s.length}(t))return!1;const s=csString.prototype.split.call(t,/[\[\]]/);return csArray.prototype.every.call(s,(t=>{const s=t[0],e=t[t.length-1];if(("'"===s||'"'===s)&&s!==e)return!1;const i=csString.prototype.split.call(t,".");return 0===i[0].length&&csArray.prototype.shift.call(i),csArray.prototype.every.call(i,(t=>{const s=/^\-?\d+$/.exec(t);return s?parseInt(s[0],10)>=0:"$"===t||/\w+/.test(t)}))}))},t.getJSONPathValue=function(t,s){if(!t)return;const e=csString.prototype.split.call(t,/[\$\[\]]/),i=[];csArray.prototype.forEach.call(e,(t=>{"'"!==t[0]&&'"'!==t[0]?csArray.prototype.push.call(i,...csArray.prototype.filter.call(csString.prototype.split.call(t,"."),(t=>t.length>0))):csArray.prototype.push.call(i,csString.prototype.substring.call(t,1,t.length-1))})),"$"===i[0]&&csArray.prototype.shift.call(i);let n=s;for(const t of i){if(void 0===n[t])return;n=n[t]}return n}}(ea||(ea={}));class na{constructor(){this.Qf=new Set(["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 this.Qf.has(t)}}class ra{constructor(){this.Xf=64e3,this.tp=100,this.sp={collectQueryParam:!1,collectRequestBody:!1,collectResponseBody:!1,matchingBodyContents:[],plainResponseBodyAttributes:{},plainRequestBodyAttributes:{},requestBodyAttributes:{},responseBodyAttributes:{},standardRequestHeaders:{},standardResponseHeaders:{},customRequestHeaders:{},customResponseHeaders:{},plainCustomRequestHeaders:{},plainCustomResponseHeaders:{}},this.ep=new na}ip(t){return t.length<=this.Xf}np(t){const s=t["content-type"];return void 0!==s&&(Ct(s,"application/json")||Ct(s,"application/graphql"))}rp(t,s){return t&&this.ip(t)&&this.np(s)}op(t,s,e,i){let n="request"===i?this.hp:this.cp;if(void 0!==n||this.rp(s,e)){if(void 0===n)try{n=csJSON.parse(s),"request"===i?this.hp=n:this.cp=n}catch{return}const e=ea.getJSONPathValue(t,n);if(void 0!==e&&(null===e||!Et(e))){const t=yt(e)?e:csJSON.stringify(e);return vn.truncate(t,this.tp,vn.ELLIPSIS)}}}isBodyAttributeValueFound(t,s){let e,i;return"request-response"!==s.type&&"response"!==s.type||(e=this.op(s.path,t.responseBody,t.responseHeaders,"response")),"request-response"!==s.type&&"request"!==s.type||(i=this.op(s.path,t.requestBody,t.requestHeaders,"request")),At(e)||At(i)}collectBodyAttribute(t,s,e){let i;"request-response"!==s.type&&"response"!==s.type||(i=this.op(s.path,t.responseBody,t.responseHeaders,"response"),i&&(s.encrypted?this.sp.responseBodyAttributes[s.path]=i:(i=e(i),this.sp.plainResponseBodyAttributes[s.path]=i))),"request-response"!==s.type&&"request"!==s.type||(i=this.op(s.path,t.requestBody,t.requestHeaders,"request"),i&&(s.encrypted?i&&(this.sp.requestBodyAttributes[s.path]=i):(i=e(i),this.sp.plainRequestBodyAttributes[s.path]=i)))}isBodyContentMatching(t,s){if(!t.responseBody)return!1;return!!new csRegExp(s,"i").test(t.responseBody)}collectBodyContent(t){-1===csArray.prototype.indexOf.call(this.sp.matchingBodyContents,t)&&csArray.prototype.push.call(this.sp.matchingBodyContents,t)}collectCustomHeaders(t,s,e){const i=csString.prototype.toLocaleLowerCase.call(s.headerName);!t.responseHeaders[i]||"request-response"!==s.type&&"response"!==s.type||(s.encrypted?this.sp.customResponseHeaders[i]=t.responseHeaders[i]:this.sp.plainCustomResponseHeaders[i]=e(t.responseHeaders[i])),!t.requestHeaders[i]||"request-response"!==s.type&&"request"!==s.type||(s.encrypted?this.sp.customRequestHeaders[i]=t.requestHeaders[i]:this.sp.plainCustomRequestHeaders[i]=e(t.requestHeaders[i]))}collectStandardHeaders(t){if(!(Object.keys(this.sp.standardRequestHeaders).length>0||Object.keys(this.sp.standardResponseHeaders).length>0)){for(const[s,e]of Object.entries(t.requestHeaders))this.ep.isValidStandardHeader(s)&&(this.sp.standardRequestHeaders[s]=e);for(const[s,e]of Object.entries(t.responseHeaders))this.ep.isValidStandardHeader(s)&&(this.sp.standardResponseHeaders[s]=e)}}setCollectQueryParam(t){t&&(this.sp.collectQueryParam=!0)}setCollectResponseBody(t){t&&(this.sp.collectResponseBody=!0)}setCollectRequestBody(t){t&&(this.sp.collectRequestBody=!0)}getCollectedDataPoints(){return this.sp}}!function(t){t.CONTENTSQUARE="contentsquare.net",t.CLICKTALE="clicktale.net",t.FAKE_TRACKER="fake-tracker.content-square.fr"}(ia||(ia={}));class oa{computeApiErrorCollectionOptions(){const t=new Set,s=[];if(this.rules)for(const e of this.rules)void 0!==e.statusCode&&t.add(e.statusCode),void 0!==e.url&&-1===csArray.prototype.indexOf.call(s,e.url)&&csArray.prototype.push.call(s,e.url);const e=[ia.CONTENTSQUARE,ia.CLICKTALE];return csArray.prototype.push.call(e,ia.FAKE_TRACKER),{statusCodes:t,urls:s,excludedDomains:e}}}class ha extends oa{constructor(t,s){super(),this.ap=t,this.M=s,this.rules=t.collectionRules}collectDataPoints(t,s){this.sp=new ra;let e=!1;if(this.ap.collectionRules)for(const i of this.ap.collectionRules)this.up(i,t)&&this.lp(i,t)&&this.dp(i,t)&&(e=!0,this.fp(t,i,s));return e||(e=this.pp(t)),e&&s&&this.ap.collectStandardHeaders&&this.sp.collectStandardHeaders(t),e?this.sp.getCollectedDataPoints():null}computeApiErrorCollectionOptions(){const t=this.ap.collectionRules||[],s=new Set,e=[];for(const i of t)void 0!==i.statusCode&&s.add(i.statusCode),void 0!==i.url&&-1===csArray.prototype.indexOf.call(e,i.url)&&csArray.prototype.push.call(e,i.url);const i=[ia.CONTENTSQUARE,ia.CLICKTALE];return csArray.prototype.push.call(i,ia.FAKE_TRACKER),{statusCodes:s,urls:e,excludedDomains:i}}up(t,s){return(!t.statusCode&&s.statusCode>=400||void 0!==t.statusCode&&t.statusCode===s.statusCode)&&(!t.url||-1!==csString.prototype.indexOf.call(s.url,t.url))}lp(t,s){return!t.bodyContent||this.sp.isBodyContentMatching(s,t.bodyContent)}dp(t,s){const e=csArray.prototype.find.call(t.bodyAttributePaths,(t=>t.primary));return void 0===e||this.sp.isBodyAttributeValueFound(s,e)}pp(t){return t.statusCode>=400}fp(t,s,e){s.bodyContent&&this.sp.collectBodyContent(s.bodyContent);const i=Ls(s.bodyAttributePaths,(t=>1===t.primary));if(i&&this.sp.collectBodyAttribute(t,i,(t=>this.M.anonymizePII(t))),e){this.sp.setCollectQueryParam(s.collectQueryParam),this.sp.setCollectResponseBody(s.collectResponseBody),this.sp.setCollectRequestBody(s.collectRequestBody);for(const e of s.customHeaders)this.sp.collectCustomHeaders(t,e,(t=>this.M.anonymizePII(t)));const e=Ds(s.bodyAttributePaths,(t=>!t.primary));for(const s of e)this.sp.collectBodyAttribute(t,s,(t=>this.M.anonymizePII(t)))}}}class ca extends oa{constructor(t,s){super(),this.ap=t,this.M=s,this.rules=t.configurableApiErrorRules}collectDataPoints(t,s){this.sp=new ra;const e=this.vp(t,this.ap.configurableApiErrorRules);return e.isMatching?(e.matchingBodyContents.length>0&&this.sp.collectBodyContent(e.matchingBodyContents[0]),s&&this.mp(t),this.sp.getCollectedDataPoints()):null}computeApiErrorCollectionOptions(){const t=this.ap.configurableApiErrorRules||[],s=new Set,e=[];for(const i of t)void 0!==i.statusCode&&s.add(i.statusCode),void 0!==i.url&&-1===csArray.prototype.indexOf.call(e,i.url)&&csArray.prototype.push.call(e,i.url);const i=[ia.CONTENTSQUARE,ia.CLICKTALE];return csArray.prototype.push.call(i,ia.FAKE_TRACKER),{statusCodes:s,urls:e,excludedDomains:i}}vp(t,s){if(t.statusCode>=400)return{isMatching:!0,matchingBodyContents:[]};if(s)for(const e of s)if(this.wp(t,e))return{isMatching:!0,matchingBodyContents:e.bodyContent?[e.bodyContent]:[]};return{isMatching:!1,matchingBodyContents:[]}}wp(t,s){return!(t.statusCode!==s.statusCode||-1===csString.prototype.indexOf.call(t.url,s.url)||s.bodyContent&&!this.sp.isBodyContentMatching(t,s.bodyContent))}mp(t){this.ap.collectStandardHeaders&&this.sp.collectStandardHeaders(t),this.ap.validCustomHeaders&&this.gp(t,this.ap.validCustomHeaders,Number(!0)),this.ap.plainCustomHeaders&&this.gp(t,this.ap.plainCustomHeaders,Number(!1)),this.Rf(t.url,this.ap.validUrls)&&(this.ap.collectQueryParam&&this.sp.setCollectQueryParam(Number(this.ap.collectQueryParam)),this.ap.collectResponseBody&&this.sp.setCollectResponseBody(Number(this.ap.collectResponseBody)),this.ap.collectRequestBody&&this.sp.setCollectRequestBody(Number(this.ap.collectRequestBody)))}gp(t,s,e){for(const i of s)this.sp.collectCustomHeaders(t,{headerName:i,encrypted:e,type:"request-response"},(t=>this.M.anonymizePII(t)))}Rf(t,s){return!!s&&csArray.prototype.some.call(s,(s=>-1!==csString.prototype.indexOf.call(t,s)))}}class aa extends ln{constructor(t){super(),this.Ch=null,this.yp=null,this.ys=null,this.yo=null,this.Ep=0,this.Ap=["value","checked","src","data","alt"],this._p={state:Oe.MaskedElementState.Child},this.Rp=t=>{for(const s of t){if(Oe.isMaskedElement(s.target)||Oe.isMaskedElementChild(s.target))for(let t=0;t"added"===s&&this.Cp(t)))),this.ys.observe(),csSetTimeout(this.Ip)}onStop(){var t,s,e;this.Ch&&(this.Tp(document),this.Ch.disconnect()),null===(t=this.yp)||void 0===t||t.disconnect(),null===(s=this.ys)||void 0===s||s.disconnect(),null===(e=this.yo)||void 0===e||e.disconnect()}Pp(){return window.ResizeObserver?new ResizeObserver((t=>{csArray.prototype.forEach.call(t,(t=>{this.resizeObserverCallback(t)}))})):null}bp(){return new Bn((t=>{csArray.prototype.forEach.call(t,(t=>{this.kp(t)?this.Sp(t):(this.Op(t),this.Np(t))}))}))}Vp(t){return new Bn((s=>{csArray.prototype.forEach.call(s,(s=>this.xp(s,t)))}))}resizeObserverCallback(t){const s=t.target.getBoundingClientRect(),e=Oe.getMaskedElementDetails(t.target);if(e.state!==Oe.MaskedElementState.Parent)return;if(s.width===e.width&&s.height===e.height)return;const i={state:Oe.MaskedElementState.Parent,width:s.width,height:s.height};Oe.setMaskedElementProperty(t.target,i),this.produceEvent({type:"ResizeMaskedElement",target:Se(t.target),width:s.width,height:s.height})}Np(t){this.yo&&l(t)&&!y(t)&&this.yo.observe(t)}kp(t){const s=csNodeparentNode.apply(t);return s?Oe.isMaskedElement(s)||Oe.isMaskedElementChild(s):!!S(t)&&(Oe.isMaskedElement(t.host)||Oe.isMaskedElementChild(t.host))}Cp(t){(Oe.isMaskedElement(t.host)||Oe.isMaskedElementChild(t.host))&&Oe.setMaskedElementProperty(t,this._p)}Tp(t){Zs(t,NodeFilter.SHOW_ELEMENT).visitAll((t=>{Oe.unsetMaskedElementProperty(t)}))}Op(t){const s=t.getBoundingClientRect(),e={state:Oe.MaskedElementState.Parent,width:s.width,height:s.height};Oe.setMaskedElementProperty(t,e),this.$p(t),Zs(t).visitAll((s=>s!=t&&Oe.setMaskedElementProperty(s,this._p)))}Sp(t){Oe.setMaskedElementProperty(t,this._p),Zs(t).visitAll((s=>s!=t&&Oe.setMaskedElementProperty(s,this._p)))}$p(t){var s;const e=null!==(s=Ae.getProperty(t,Oe.maskedAttributeProp))&&void 0!==s?s:{attributes:[]};for(let t=0;tcsString.prototype.indexOf.call(s.attrName,n)>-1&&Pe.call(t,s.selector)))&&csArray.prototype.push.call(i.attributes,n)}0!==i.attributes.length&&Oe.setMaskedAttributeProperty(t,i)}}oi([ns()],aa.prototype,"resizeObserverCallback",null);class ua{constructor(t,s,e){this.Dc=t,this.Lp=s,this.Mp=e}getSensitiveStatus(){return{started:this.Mp.isStarted,useAnonymization:this.Dc.shouldUseAnonymization(),capturedElementSelector:Fn.getWhitelistedElementsSelector(),maskedElementSettings:this.Lp.getMaskedElementSettings()}}getElementSensitiveStatus(t){const s=this.Mp.isStarted,e=this.Dc.shouldUseAnonymization();return s?Oe.isMaskedElement(t)||Oe.isMaskedElementChild(t)?Nh.MASKED:e?Fn.isWhitelisted(t)?Nh.CAPTURED:Nh.ANONYMIZED:Nh.CAPTURED:Nh.ANONYMIZED}}const la=["setPIISelectors"],da=["setCapturedElementsSelector"];class fa{constructor(t,s,e,i){this.Jh=t,this.kc=s,this.Lp=e,this.Mp=i}init(){this.Yd()}onStartTracking(t){this.Mp.start(),this.Jh.emitSensitiveStatusChange()}onBeforeArtificialPageView(){this.Mp.stop(),this.Jh.emitSensitiveStatusChange()}onAfterArtificialPageView(){this.Mp.start(),this.Jh.emitSensitiveStatusChange()}onBeforeSessionRenewal(){this.Mp.stop(),this.Jh.emitSensitiveStatusChange()}onOptout(){this.Mp.stop(),this.Jh.emitSensitiveStatusChange()}onReplayUnanonymizationConsentGranted(){this.Jh.emitSensitiveStatusChange()}onReplayUnanonymizationConsentWithdrawn(){this.Jh.emitSensitiveStatusChange()}Yd(){this.kc.register(la,(t=>{this.Lp.setMaskedElementSettingsFromCommand(t),this.Jh.emitSensitiveStatusChange()})),this.kc.register(da,(t=>{Fn.setWhitelistedElementsSelector(t),this.Jh.emitSensitiveStatusChange()}))}}class pa extends Ue{constructor(t,s){super(),this.Oc=t,this.Lp=s}onStart(){Fn.start(),this.Oc.setMaskedElementSettings(this.Lp.getMaskedElementSettings()),this.Oc.start()}onStop(){Fn.stop(),this.Oc.stop()}}class va{constructor(t,s,e,i,n,r,o,h,c,a,u,l,d,f,p,v,m,w,g,y,E,A,_,R,S,T,I){this.lc=t,this.ya=s,this.W=e,this.J=i,this.Jh=n,this.kc=r,this.Dp=o,this.L=h,this.Bp=c,this.Fp=a,this.qp=u,this.ll=l,this.M=d,this.Eu=f,this.Mc=p,this.it=v,this.Hp=m,this.Tl=w,this.aa=g,this.ds=y,this.zp=E,this.$c=A,this.jp=_,this.Gp=R,this.Lc=S,this.Zp=T,this.Wp=I,this.Jp=(t=!1)=>{this.Kp.start(t),this.Yp.start()}}start(){if(this.Bp.init(),this.Fp.init(),this.Fp.isActive())return;let t,s,e,i,n,r,o,h,c,a,u,l,d,f,p,v;this.Gp.schedule((()=>{l=new ac(this.J,this.W),v=new Zc(l),u=new tc(this.Eu),d=new Sc(this.L),f=new aa((()=>{}));const m=new pa(f,d);p=new ua(this.Qp(),d,m);const w=new fa(this.Jh,this.kc,d,m);w.init(),this.Jh.addListener(w),t=new Bh(this.L,this.lc,this.W,this.Eu,u,this.kc,l,new Oc(es),this.aa,this.Lc,this.Tl,p),s=new ao(this.kc,this.J,this.L,this.lc,this.ya,this.M),a=new $c(p);const g=new Pc(this.L);c=new Ic(this.L,g,a,p,this.aa),c.init();const y=new Gc;e=new no(this.W,this.J,this.kc,this.aa,g,this.L,y,a),i=new yo(this.L,this.lc,this.W,this.kc,this.M,l,this.it),this.Kp=new Xh(this.L,this.kc,this.Jh,this.lc,this.W,this.J,this.ll,this.ds,this.Mc,this.it,this.$c,y,this.dl),n=new cc(this.L,this.W,this.J,this.kc),r=new Ec(this.L,this.kc,this.ya,this.lc,this.Tl),o=new Tc(this.kc),h=new xc(this.L,new Ot(this.L,this.M),this.Lc),this.Yp=new sc})),this.L.apiErrors.enabled&&this.Gp.schedule((()=>{var t;let s;s=(null===(t=this.L.apiErrors.collectionRules)||void 0===t?void 0:t.length)?new ha(this.L.apiErrors,this.M):new ca(this.L.apiErrors,this.M),this.xi=new Vc(new Xc,new ta,s),this.$i=new Cc(this.Mc),this.zi=new sa;const e=new Uc(this.xi,this.$i,this.L,this.lc,this.aa,this.kc,this.Lc);e.init(),this.Jh.addListener(e)})),this.L.customErrors.enabled&&this.Gp.schedule((()=>{const t=new jc(this.M,this.L,this.lc,this.kc,this.Tl,this.Lc,this.aa,undefined);t.init(),this.Jh.addListener(t)})),this.L.jsErrorsEnabled&&this.Gp.schedule((()=>{this.Qd=new _c,this.Ni=new kc(this.M,this.it);const t=new qc(this.Qd,this.Ni,this.L,this.lc,this.aa,this.kc,this.Tl,this.it,this.Lc);t.init(),this.Jh.addListener(t)})),this.Gp.schedule((()=>{this.qp.init()})),this.Gp.schedule((()=>{e.init()})),this.Gp.schedule((()=>{s.init()})),this.Gp.schedule((()=>{i.init()})),this.Gp.schedule((()=>{this.zp.init()})),this.Gp.schedule((()=>{this.Kp.init()})),this.Gp.schedule((()=>{n.init()})),this.Gp.schedule((()=>{r.init()})),this.Gp.schedule((()=>{this.Hp.init()})),this.Gp.schedule((()=>{o.init()})),this.Gp.schedule((()=>{h.init()})),this.Gp.schedule((()=>{this.jp.init()})),this.Gp.schedule((()=>{this.Jh.addListener(n),this.Jh.addListener(this.Dp),this.Jh.addListener(t),this.Jh.addListener(this.qp),this.Jh.addListener(e),this.Jh.addListener(this.zp),this.Jh.addListener(this.Kp),this.Jh.addListener(r),this.Jh.addListener(s),this.Jh.addListener(c),this.Jh.addListener(h),this.Jh.addListener(v)})),Lc.isRecordingSupported()&&this.Gp.schedule((()=>{const t=new zr(a,this.J,this.L,this.lc,this.kc,this.M,l,f,this.Ni,this.xi,this.$i,this.Jh,this.Tl,this.aa,this.$c,this.Lc,this.Mc,this.zi,this.Qp());t.init(),this.Jh.addListener(t),e.setRecordingService(t.recordingService)})),this.Gp.schedule((()=>{t.init()})),this.Gp.schedule((()=>{l.onSessionExpired((()=>{this.Jh.emitBeforeSessionRenewal(),this.Xp(!0),this.Jh.emitAfterSessionRenewal()})),this.Xp()}))}Xp(t=!1){this.kc.start(),this.Yp.onLoad((()=>{this.Jh.emitStartTracking(t)})),dc(this.L)&&!t||this.Jp(t)}Qp(){if(this.Dc)return this.Dc;const t=new Yc;return this.Dc=new Kc(this.ll,this.L,this.it,t),this.Dc.init(),this.Dc}}class ma{constructor(t,s,e,i,n,r,o,h){this.L=t,this.W=s,this.ls=e,this.tv=i,this.sv=n,this.ev=r,this.iv=o,this.nv=h}compute(t){var s,e;this.L.crossDomainTracking&&!this.L.cookielessTrackingEnabled?this.L.crossDomainSingleIframeTracking?null===(s=this.iv)||void 0===s||s.start((()=>this.rv(t))):null===(e=this.ev)||void 0===e||e.applyUpToDate((()=>this.rv(t))):this.rv(t)}rv(t){this.sv.handle(),this.tv.clear(),this.ov()?(this.tv.restoreClearedVisitor(),t(!0)):(this.ls.exclude(this.L),t(!1))}ov(){const t=G.boolean(this.L.sampleRate);return this.nv.isForceIncluded()||!this.ls.isExcluded()&&this.W.doesVisitorExist()||!this.ls.isExcluded()&&t}}var wa;!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 e=0;e{const s=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?s:7&s|8).toString(16)}));return csString.prototype.replace.call(i,"hhhh",s)}}(wa||(wa={}));class ga{constructor(t,s,e,i){this.L=t,this.hv=s,this.J=e,this.Jh=i,this.cv=1e4}createOrUpdateVisitor(){let t=this.getVisitor();null===t&&(t=this.av(),this.J.removeSession()),this.uv(t),this.setVisitor(t)}av(){return{id:wa.generate(),visitsCount:0,appliedTrackingDraw:this.L.lastTrackingDraw,creationTimestamp:Pt(),lastVisitTimestamp:0,hitTimestamp:0,expires:It.now()+this.L.visitorCookieTimeout,allowSubdomains:this.L.allowSubdomains}}uv(t){const s=Pt();this.J.doesSessionExist()||(t.visitsCount+=1,t.lastVisitTimestamp=s),t.hitTimestamp=s,t.appliedTrackingDraw=this.L.lastTrackingDraw,this.lv=t.visitsCount}getRequestParameters(){const t=this.getVisitor();return t?{uu:t.id,sn:`${t.visitsCount}`,hd:`${t.hitTimestamp}`}:{}}getVisitor(){return this.hv.get()}setVisitor(t){this.hv.set(t)}doesVisitorExist(){return null!==this.hv.get()}resetVisitor(){this.fv(),this.Jh.emitAfterVisitorCleared()}removeVisitor(){this.hv.remove()}hasAllowSubdomainsChanged(){const t=this.getVisitor();if(!t)return!1;return t.allowSubdomains!==this.L.allowSubdomains}handleSubdomainChange(){this.hv.handleSubdomainChange()}isSessionRenewed(){const t=this.getVisitor();return null!==t&&void 0!==this.lv&&t.visitsCount!==this.lv}pv(){return!At(this.vv)||It.now()-this.vv>this.cv}renewVisitor(){this.pv()?(this.vv=It.now(),this.fv(),this.Jh.emitAfterVisitorRenewal()):es.warn("session:start:newVisitor is trying to renew visitor under time limit")}fv(){this.Jh.emitBeforeVisitorRenewal(),this.removeVisitor()}}const ya="_cs_s",Ea=18e5,Aa=/^(\d+\.[0135678TBW](\.[01])?)(\.\d+)?$/,_a=".";var Ra;!function(t){t[t.NOT_FOUND=0]="NOT_FOUND",t[t.EXPIRED=1]="EXPIRED",t[t.FOUND=2]="FOUND"}(Ra||(Ra={}));class Sa{constructor(t,s,e){this.L=t,this.Zp=s,this.mv=e,this.Lr=null,this.wv=!1}get(t){const s=this.getRawSession(t);return this.isValid(s)?Sa.fromString(s):null}getRawSession(t){if(t){const t=this.gv();return Sa.yv(t)}const{sessionString:s,status:e}=this.Ev(),i=Sa.yv(s);if(e!==Ra.EXPIRED)return i;if(this.L.cookielessTrackingEnabled)return null;const n=this.gv();if(!n)return null;const r=csString.prototype.split.call(n,_a);if(!Sa.Av(r))return n;const o=r[r.length-1],h=parseInt(o,10);return isNaN(h)||this._v(h),i}onCookieToSet(t){this.Rv=t}onCookieToRemove(t){this.Sv=t}set(t,s=18e5){var e;const i=It.now()+s;let n=this.toString(t);n+=`${_a}${i}`,this.Tv(n,i),this.L.cookielessTrackingEnabled?this.mv.setItem(ya,n):(this.Zp.set(ya,n,s),null===(e=this.Rv)||void 0===e||e.call(this,ya,n,s))}remove(){var t;this.L.cookielessTrackingEnabled?this.mv.removeItem(ya):(this.Zp.delete(ya),null===(t=this.Sv)||void 0===t||t.call(this,ya)),this.Iv()}handleSubdomainChange(){if(this.L.cookielessTrackingEnabled)return;const t=this.get(!0);t&&(this.L.allowSubdomains?this.Zp.delete(ya,Ss.CURRENT_DOMAIN):this.Zp.delete(ya,this.Zp.getRootDomain()),this.set(t))}isValid(t){return null!==t&&Sa.isValidSessionString(t)}toString(t){return csArray.prototype.join.call([t.pageNumber,t.collectState,t.etrState],_a)}Tv(t,s){this.Lr={sessionString:t,expires:s}}Ev(){return this.Lr?this.Lr&&It.now()<=this.Lr.expires?{sessionString:this.Lr.sessionString,status:Ra.FOUND}:{sessionString:this.Lr.sessionString,status:Ra.EXPIRED}:{sessionString:this.gv(),status:Ra.NOT_FOUND}}Iv(){this.Lr=null}_v(t){this.Lr&&(this.Lr.expires=t,this.wv=!0)}isCacheRefreshed(){return this.wv}resetCacheRefreshed(){this.wv=!1}gv(){if(this.L.cookielessTrackingEnabled){const t=this.mv.getItem(ya);return!t||this.Pv(t)?null:t}const t=this.Zp.get(ya);return!t||this.Pv(t)?null:t}Pv(t){const s=csString.prototype.split.call(t,_a);if(!Sa.Av(s))return!1;const e=parseInt(s[s.length-1],10);return!isNaN(e)&&It.now()>e}static Av(t){return 13===t[t.length-1].length}static yv(t){var s;if(!t)return null;const e=null===(s=csString.prototype.match.call(t,Aa))||void 0===s?void 0:s[1];return null!=e?e:null}static fromRawString(t){const s=Sa.yv(t);return null!==s?Sa.fromString(s):null}static fromString(t){var s;const[e,i,n]=csString.prototype.split.call(t,_a);return{collectState:i,etrState:null!==(s=n)&&void 0!==s?s:Fe.ETR_OFF,pageNumber:parseInt(e,10)}}static isValidSessionString(t){return Aa.test(t)}}var Ta;!function(t){t[t.NO=0]="NO",t[t.WITHDRAWN=1]="WITHDRAWN",t[t.GRANTED=2]="GRANTED"}(Ta||(Ta={}));class Ia{constructor(t,s){this.bv=t,this.Vv=s,this.Cv=null,this.kv=0,this.Ov=Ta.NO}setDynamicVariablesService(t){this.Nv=t}createOrUpdateSession(){this.xv(),this.$v=It.now(),this.kv=0;let t=this.Lv();null===t?(t=this.Mv(),this.Dv(t),this.Uv(t)):(t=this.Vv.sanitizeSessionCollectState(t),this.Dv(t),t.collectState=this.Vv.updateCollectState(t)),this.setSession(t)}grantReplayRecording(t){t.collectState=this.Vv.getInitialCollectState(),t.collectState=this.Vv.computeInitialCollectStateFromRecordingConsentGranted(t),this.setSession(t)}grantReplayRecordingBeforeSessionStart(){this.Ov=Ta.GRANTED}withdrawnReplayRecording(t){t.collectState=this.Vv.getRecordingConsentWithdrawn(),this.setSession(t)}withdrawnReplayRecordingBeforeSessionStart(){this.Ov=Ta.WITHDRAWN}Uv(t){this.Ov===Ta.WITHDRAWN?(t.collectState=this.Vv.getRecordingConsentWithdrawn(),this.setSession(t)):this.Ov===Ta.GRANTED?t.collectState=this.Vv.computeInitialCollectStateFromRecordingConsentGranted(t):t.collectState=this.Vv.computeInitialCollectState(t),this.Ov=Ta.NO}Mv(){return{pageNumber:0,collectState:this.Vv.getInitialCollectState(),etrState:Fe.ETR_OFF}}Dv(t){t.pageNumber+=1}isReplayRecorded(){const t=this.getSession();return!!t&&this.Vv.isReplayRecorded(t)}isTemporarilyRecorded(){const t=this.getSession();return(null==t?void 0:t.collectState)===Be.TEMPORARILY}abortQuotaServiceRequest(){this.Vv.abortQuotaServiceRequest()}getRequestParameters(){const t={},s=this.getSession();return null!==s&&(t.pn=`${s.pageNumber}`),t}getSession(){return this.bv.get()}Lv(){return this.bv.get(!0)}doesSessionExist(){return null!==this.bv.get()}setSession(t){this.bv.set(t)}refreshSession(){const t=this.Lv();t&&this.setSession(t)}removeSession(){this.bv.remove()}getRecordingStates(){const t=this.getSession(),s=[];return t&&(t.collectState!==Be.ANALYTICS_ONLY&&csArray.prototype.push.call(s,t.collectState),t.etrState===Fe.ETR_ON&&csArray.prototype.push.call(s,Be.RECORDING_ETR_SAMPLING)),s}updateCollectState(t,s){const e=this.getSession();null!==e&&(e.collectState=t,e.etrState=s,this.setSession(e))}hasValidSession(){const t=this.bv.getRawSession();return this.bv.isValid(t)}handleSubdomainChange(){this.bv.handleSubdomainChange()}pollCacheRefreshEvent(t=!0){const s=this.bv.isCacheRefreshed();return s&&t&&this.bv.resetCacheRefreshed(),s}extendSessionPeriodically(){this.Cv||this.Bv()}extendSession(){const t=this.getSession();return null===t?(es.warn("extendSession is trying to extend an expired session"),this.xv(),!1):(this.bv.set(t,Ea),!0)}Bv(){if(this.Fv())return void this.xv();this.extendSession()&&(this.qv(),this.Hv())}Hv(){this.Cv=window.csSetTimeout((()=>{this.Bv()}),174e4)}Fv(){return 1434e4-(It.now()+Ea-this.$v)<0}xv(){this.Cv&&(window.csClearTimeout(this.Cv),this.Cv=null)}qv(){this.kv+=1,this.Nv.trackDynamicVariable("session_expiry_update",this.kv)}}class Pa{constructor(t,s,e){this.L=t,this.W=s,this.ls=e}clear(){this.zv()&&(this.jv=this.W.getVisitor(),this.W.removeVisitor()),this.Gv()&&this.ls.removeExclusion()}zv(){return this.W.doesVisitorExist()&&this.W.getVisitor().appliedTrackingDraw!==this.L.lastTrackingDraw}Gv(){return this.ls.getAppliedTrackingDraw()!==this.L.lastTrackingDraw}restoreClearedVisitor(){this.jv&&this.W.setVisitor(this.jv)}}class ba{constructor(t,s,e){this.W=t,this.J=s,this.Zv=e}handle(){this.W.hasAllowSubdomainsChanged()&&(this.W.handleSubdomainChange(),this.J.handleSubdomainChange(),this.Zv.handleSubdomainChange())}}class Va{constructor(){this.listeners=[]}addListener(t){csArray.prototype.push.call(this.listeners,t)}}class Ca extends Va{constructor(t){super(),this.Gp=t}emitBeforeNaturalPageView(){for(const t of this.listeners)t.onBeforeNaturalPageView&&t.onBeforeNaturalPageView()}emitAfterNaturalPageView(){for(const t of this.listeners)t.onAfterNaturalPageView&&t.onAfterNaturalPageView()}emitInitTracking(){for(const t of this.listeners)t.onInitTracking&&t.onInitTracking()}emitStartTracking(t){for(const s of this.listeners)s.onStartTracking&&this.Gp.schedule((()=>s.onStartTracking(t)))}emitArtificialPageViewEnd(){for(const t of this.listeners)if(t.onArtificialPageViewEnd)try{t.onArtificialPageViewEnd()}catch(t){es.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()}emitCollectStateChange(t,s){for(const e of this.listeners)e.onCollectStateChange&&e.onCollectStateChange(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()}emitSensitiveStatusChange(){var t;for(const s of this.listeners)null===(t=s.onSensitiveStatusChange)||void 0===t||t.call(s)}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()}}ys([gs("emitStartTracking")],Ca.prototype,"emitStartTracking",null);const ka="_cs_c";var Oa;!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"}(Oa||(Oa={}));class Na{constructor(t,s,e){this.L=t,this.Zp=s,this.Wp=e}get(){let t;return t=this.L.cookielessTrackingEnabled?this.Wp.getItem(ka):this.Zp.get(ka),null===t?t:Number(t)}set(t){this.L.cookielessTrackingEnabled?this.Wp.setItem(ka,csString(t)):this.Zp.set(ka,csString(t),j)}remove(){this.L.cookielessTrackingEnabled?this.Wp.removeItem(ka):this.Zp.delete(ka)}handleSubdomainChange(){this.L.cookielessTrackingEnabled||(this.L.allowSubdomains?this.Zp.delete(ka,Ss.CURRENT_DOMAIN):this.Zp.delete(ka,this.Zp.getRootDomain()))}}class xa{constructor(t,s,e){this.L=t,this.J=s,this.Jh=e}grantReplayConsent(){if(!Gr.isReplayConsentNeeded(this.L))return;const t=this.J.getSession();t?Gr.isRecordingBlockedByConsent(t)&&(this.J.grantReplayRecording(t),this.Jh.emitAfterReplayRecordingConsentGranted()):this.J.grantReplayRecordingBeforeSessionStart()}withdrawReplayConsent(){if(!Gr.isReplayConsentNeeded(this.L))return;const t=this.J.getSession();t?Gr.isRecordingWithDrawn(t)||(this.J.withdrawnReplayRecording(t),this.Jh.emitAfterReplayRecordingConsentWithdrawn()):this.J.withdrawnReplayRecordingBeforeSessionStart()}}const $a=["replay:consent:unanonymized:granted","trackConsentGranted"],La=["replay:consent:unanonymized:withdrawn","trackConsentWithdrawn"],Ma=["replay:consent:startForSession:granted"],Da=["replay:consent:startForSession:withdrawn"];class Ua{constructor(t,s,e,i,n){this.L=t,this.kc=s,this.ll=e,this.J=i,this.Jh=n}init(){this.Wv=new xa(this.L,this.J,this.Jh),this.ll.setInitialConsent(),this.Yd()}Yd(){this.kc.register($a,(()=>{this.ll.grantReplayAnonymizationConsent()})),this.kc.register(La,(()=>{this.ll.withdrawReplayAnonymizationConsent()})),this.kc.register(Ma,(()=>{this.Wv.grantReplayConsent()})),this.kc.register(Da,(()=>{this.Wv.withdrawReplayConsent()}))}onOptout(){this.ll.removeAllConsents()}onBeforeVisitorRenewal(){this.ll.removeAllConsents()}onAfterVisitorRenewal(){this.ll.setInitialConsent()}onAfterVisitorCleared(){this.ll.setInitialConsent()}}class Ba{constructor(t,s,e){this.L=t,this.hv=s,this.Jh=e}setInitialConsent(){const t=this.hv.get();(null===t||this.hasConsentRequiredChanged(t))&&this.setDefaultReplayAnonymization()}hasConsentRequiredChanged(t){const s=this.L.consentRequired;return s&&t===Oa.NOT_REQUIRED||!s&&t!==Oa.NOT_REQUIRED}handleSubdomainChange(){this.hv.handleSubdomainChange()}setDefaultReplayAnonymization(){const t=this.L.consentRequired?Oa.NOT_EXPRESSED:Oa.NOT_REQUIRED;this.hv.set(t)}grantReplayAnonymizationConsent(){this.L.consentRequired&&(this.hv.set(Oa.GRANTED),this.Jh.emitReplayUnanonymizationConsentGranted())}withdrawReplayAnonymizationConsent(){this.L.consentRequired&&(this.hv.set(Oa.WITHDRAWN),this.Jh.emitReplayUnanonymizationConsentWithdrawn())}removeAllConsents(){this.hv.remove()}isReplayUnanonymizedAllowedByConsent(){return!this.L.consentRequired||this.hv.get()===Oa.GRANTED}getRequestParameters(){return{uc:`${this.hv.get()}`}}}class Fa{constructor(t,s,e,i,n,r,o){this.Jh=t,this.kc=s,this.Dp=e,this.Bp=i,this.Fp=n,this.Jv=r,this.qp=o}start(){this.Jh.addListener(this.Jv),this.Jh.addListener(this.qp),this.Jh.addListener(this.Dp),this.qp.init(),this.Bp.init(),this.Fp.init(),this.Fp.isActive()||this.kc.start()}}const qa="_cs_ex",Ha=2592e6,za=/^[0-9]+$/;class ja{constructor(t,s,e){this.L=t,this.Zp=s,this.mv=e}onCookieToSet(t){this.Rv=t}onCookieToRemove(t){this.Sv=t}get(){return this.L.cookielessTrackingEnabled?Number(this.mv.getItem(qa)):Number(this.Zp.get(qa))}set(t){var s;this.L.cookielessTrackingEnabled?this.mv.setItem(qa,t):(this.Zp.set(qa,t,Ha),null===(s=this.Rv)||void 0===s||s.call(this,qa,t,Ha))}remove(){var t;this.L.cookielessTrackingEnabled?this.mv.removeItem(qa):(this.Zp.delete(qa),null===(t=this.Sv)||void 0===t||t.call(this,qa))}static isValidExclusionString(t){return za.test(t)}}class Ga{constructor(t,s){this.Dn=t,this.hv=s}exclude(t){this.hv.set(csString(t.lastTrackingDraw))}removeExclusion(){this.hv.remove()}isExcluded(){return this.Kv()||this.Yv()}Kv(){return 0!==this.getAppliedTrackingDraw()}getAppliedTrackingDraw(){return this.hv.get()}Yv(){return csString.prototype.indexOf.call(this.Dn.href,qa)>0}}class Za{constructor(t){this.Aa=t}onOptout(){this.Aa.removeExclusion()}}var Wa;!function(t){t.SessionReplay="SR",t.None=""}(Wa||(Wa={}));class Ja{constructor(t){this.it=t,this.Qv=new csRegExp(".^")}setExcludeUrlForSessionReplay(t){this.Qv=new csRegExp(t)}Xv(){return this.Qv.test(this.it.getAnonymizedUrl())?Wa.SessionReplay:Wa.None}isUrlExcludedForSessionReplay(){return this.Xv()===Wa.SessionReplay}getRequestParameters(){return{ex:this.Xv()}}}const Ka=["excludeURLforReplay"];class Ya{constructor(t,s){this.Aa=t,this.kc=s}init(){this.kc.register(Ka,(t=>{yt(t)&&this.Aa.setExcludeUrlForSessionReplay(t)}))}}const Qa="_cs_inc";class Xa{constructor(t,s){this.Dn=t,this.Zp=s}isForceIncluded(){return this.tm()||this.sm()}isForceReplayRecorded(){return this.im(Be.RECORDING_GLOBAL_SAMPLING)}tm(){return null!==this.Zp.get(Qa)}im(t){return this.Zp.get(Qa)===t}sm(){return csString.prototype.indexOf.call(this.Dn.href,Qa)>0}}const tu="_cs_optout";class su{constructor(t,s,e){this.L=t,this.Zp=s,this.Wp=e}get(){return this.L.cookielessTrackingEnabled?this.Wp.getItem(tu):this.Zp.get(tu)}set(t){this.L.cookielessTrackingEnabled?this.Wp.setItem(tu,t):this.Zp.set(tu,t,j)}}class eu{constructor(t,s,e){this.Jh=t,this.Dn=s,this.hv=e}init(){!this.isActive()&&this.nm()&&this.activate()}isActive(){return"1"===this.hv.get()}activate(){this.Jh.emitOptout(),this.hv.set("1")}nm(){return csString.prototype.indexOf.call(this.Dn.href,tu)>0}}const iu=["optout"],nu=["optin"];class ru{constructor(t,s){this.kc=t,this.Fp=s}init(){this.kc.register(iu,(()=>{this.Fp.activate()}))}}class ou{constructor(t,s){this.kc=t,this.aa=s}init(){this.aa.addListener(this.kc)}onOptout(){this.kc.stop()}onBeforeSessionRenewal(){this.kc.stop()}}var hu,cu;!function(t){t.UXA="_uxa",t.WVT="cs_wvt"}(hu||(hu={}));class au extends Ue{constructor(t){super(),this.rm=t,this.om={}}register(t,s,e){for(const i of t)this.om[i]={callback:s,configuration:e},this.om}onStart(){this.hm(),this.am()}onStop(){for(const t of this.rm)window[t]=[]}applyFromIntegration(t,s,e){this.um(t,s,`Commands.apply.from.integration: ${e}`)}applyFromImplementation(t,s,e){this.um(t,s,`Commands.apply.from.implementation: ${e}`)}onIframeCommands(t){for(const s of t.commands)this.lm(s.name,s.params,t.iframePath)}um(t,s,e){this.isStarted?es.tryToExecute(e,(()=>{if(this.om[t])return this.om[t].callback(...s)}))():window._uxa.push([t,...s])}lm(t,s,e){es.tryToExecute(`Commands.apply.from.iframe: ${e}`,(()=>{if(this.om[t])return this.om[t].callback(...s)}))()}hm(){for(const t of this.rm)window[t].forEach((([t,...s])=>this.dm(t,s,!1)))}am(){for(const t of this.rm)window[t]={push:([t,...s])=>this.dm(t,s,!0)}}dm(t,s,e){var i,n;if(this.om[t]){if((null===(i=this.om[t].configuration)||void 0===i?void 0:i.disableApplyPending)&&!e||(null===(n=this.om[t].configuration)||void 0===n?void 0:n.disableApplyImmediate)&&e)return;try{return this.om[t].callback(...s)}catch(e){es.error(`Command ${t} failed - params: ${csJSON.stringify(s)}`,e)}}}}class uu{constructor(t,s,e,i){this.L=t,this.W=s,this.J=e,this.fm=i}getRequestParameters(){var t,s,e,i,n;const r={...mt(),...this.L.getRequestParameters()},o=this.J.getSession();o&&(r.pn=`${o.pageNumber}`);const h=this.W.getVisitor();if(h&&(r.sn=`${h.visitsCount}`,r.uu=`${h.id}`),(null===(t=this.fm)||void 0===t?void 0:t.hasSubProjectId())&&(r.subProjectID=`${this.fm.getSubProjectId()}`),window.heap)try{r.happid=window.heap.appid,r.hsid=null===(e=(s=window.heap).getSessionId)||void 0===e?void 0:e.call(s),r.huu=(null===(n=(i=window.heap).getUserId)||void 0===n?void 0:n.call(i))||window.heap.userId}catch{delete r.happid,delete r.hsid,delete r.huu}return r}}class lu{constructor(t,s){this.kc=t,this.V=s}init(){this.kc.register(["debugEvents"],(t=>{"boolean"==typeof t&&this.V.updateDynamicFields("emitDebugEvents",t)}))}}function du(t,s,e){if(!At(s)&&!At(e))return t.href;const i=At(s)?fu(s):t.pathname,n=At(e)?function(t){return z(t,"?")||""===t?t:`?${t}`}(e):t.search;return`${t.protocol}//${t.host}${i}${n}`}function fu(t){return z(t,"/")?t:`/${t}`}!function(t){t[t.page=1]="page",t[t.onNextPageviewOnly=2]="onNextPageviewOnly"}(cu||(cu={}));class pu{constructor(t,s){this.Dn=t,this.Mc=s,this.pm=10}overridePath(t,s){if(""===t)return void(this.vm=void 0);const e=this.wm(s);e&&(this.gm=e),this.vm=s?this.ym(t,s):t}overrideQuery(t,s){const e=this.wm(s);e&&(this.Em=e),this.Am=s?this.ym(t,s):t}computeOverriddenUrl(t){return this._m(t)?this.getAnonymizedUrl():t}Rm(t){return("string"==typeof t||"number"==typeof t)&&t in cu}_m(t){const s=this.Sm(this.Dn.href);return this.Sm(t)===s}Sm(t){return s=t,e="/",-1!==csString.prototype.indexOf.call(s,e,s.length-e.length)?csString.prototype.slice.call(t,0,-1):t;var s,e}wm(t){return At(null==t?void 0:t.lifespan)&&this.Rm(null==t?void 0:t.lifespan)?null==t?void 0:t.lifespan:null}Tm(){return this.gm&&this.gm in cu}Im(){return this.Em&&this.Em in cu}cleanupOverrideLifespan(){this.Tm()&&(this.vm=void 0,this.gm=void 0),this.Im()&&(this.Am=void 0,this.Em=void 0)}getAnonymizedUrl(){const t=du(this.Dn,this.vm,this.Am);return this.Mc.anonymizeUrl(t,[])}getAnonymizedPath(){const t=At(this.vm)?fu(this.vm):location.pathname;return this.Mc.anonymizeUrl(t,[])}getUrlProtocol(){return this.Dn.protocol}getRequestParameters(){return{url:this.getAnonymizedUrl()}}ym(t,s){return this.Pm(s)?this.bm(t):this.Vm(s)?this.Cm(t):t}Vm(t){return Boolean(t.decodeURI)}Cm(t){return this.km(t,1,!1)}Pm(t){return Boolean(t.decodeURIDeep)}bm(t){return this.km(t,this.pm,!0)}km(t,s,e){let i=t;for(let t=0;t0?(this.$m(t),Be.TEMPORARILY):Be.ANALYTICS_ONLY):Be.ANALYTICS_ONLY}updateCollectState(t){return Lc.isRecordingSupported()?Gr.isRecordingBlockedByConsent(t)?t.collectState===Be.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN?Be.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN:Be.RECORDING_BLOCKED_BY_CONSENT_NOT_EXPRESSED:t.collectState===Be.RECORDING_GLOBAL_SAMPLING?Be.RECORDING_GLOBAL_SAMPLING:(this.Nm=[],this.configuration.malkaUrlEnabled&&(csArray.prototype.push.call(this.Nm,Be.RECORDING_URL_SAMPLING),this.configuration.malkaEtrEnabled&&csArray.prototype.push.call(this.Nm,Be.RECORDING_ETR_SAMPLING)),this.Nm.length>0?(this.$m(t),Be.TEMPORARILY):Be.ANALYTICS_ONLY):Be.ANALYTICS_ONLY}$m(t){var s;const e=null===(s=this.W)||void 0===s?void 0:s.getVisitor();this.Om.send({recordingTypes:csArray.prototype.map.call(this.Nm,Number),url:this.it.getAnonymizedUrl(),projectId:this.configuration.projectId,uu:(null==e?void 0:e.id)||"",sn:(null==e?void 0:e.visitsCount)||"",pn:(null==t?void 0:t.pageNumber)||""})}abortQuotaServiceRequest(){this.Om.abort()}isReplayRecorded(t){return!Gr.isRecordingBlockedByConsent(t)&&(t.collectState===Be.TEMPORARILY||t.collectState===Be.RECORDING_GLOBAL_SAMPLING||t.collectState===Be.RECORDING_URL_SAMPLING||t.etrState===Fe.ETR_ON)}xm(){this.Om.onError((()=>this.quotaServiceErrorHandler("NetworkError"))),this.Om.onTimeout((()=>this.quotaServiceTimeoutHandler()),3e3),this.Om.onLoad((t=>this.quotaServiceLoadHandler(t)))}quotaServiceErrorHandler(t){this.Lm(`error - ${t}`)}quotaServiceTimeoutHandler(){this.Lm("timeout")}Lm(t){let s=Be.ANALYTICS_ONLY;this.Mm(this.Nm)?(s=Be.RECORDING_GLOBAL_SAMPLING,es.warn(`Quota Service: request ${t} - bypassed by GLOBAL_SAMPLING`)):es.warn(`Quota Service: request ${t}`),this.Jh.emitCollectStateChange(s,Fe.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 e=null==s.allowedRecordingTypes?void 0:csArray.prototype.map.call(s.allowedRecordingTypes,csString);if(!e)return void this.quotaServiceErrorHandler("recording types missing from quota service response");let i=Fe.ETR_OFF,n=Be.ANALYTICS_ONLY;this.Mm(e)?n=Be.RECORDING_GLOBAL_SAMPLING:this.Dm(e)&&(n=Be.RECORDING_URL_SAMPLING),this.Um(e)&&(i=Fe.ETR_ON),this.Jh.emitCollectStateChange(n,i)}Mm(t){return csArray.prototype.some.call(t,(t=>t===Be.RECORDING_GLOBAL_SAMPLING))}Dm(t){return csArray.prototype.some.call(t,(t=>t===Be.RECORDING_URL_SAMPLING))}Um(t){return csArray.prototype.some.call(t,(t=>t===Be.RECORDING_ETR_SAMPLING))}setVisitorService(t){this.W=t}getInitialCollectState(){return Be.ANALYTICS_ONLY}getRecordingConsentWithdrawn(){return Be.RECORDING_BLOCKED_BY_CONSENT_WITHDRAWN}}ys([ns("Quota Service: onerror")],mu.prototype,"quotaServiceErrorHandler",null),ys([ns("Quota Service: ontimeout")],mu.prototype,"quotaServiceTimeoutHandler",null),ys([ns("Quota Service: onload")],mu.prototype,"quotaServiceLoadHandler",null);const wu="|iframe|";class gu extends Va{constructor(t,s,e,i){super(),this.Bm=t,this.Fm=s,this.qm=e,this.Hm=i}emitIframeEvent(t,s,e){if(this.zm(s)&&null===t)es.error(`iframeEventEmitter received event ${s} with null iframe, content:${csJSON.stringify(e)}`);else switch(s){case Yt.ChildLogMessage:this.jm(e);break;case Yt.AnalysisEvent:{const s=e,i=this.Bm.transformEvent(t,s);i.isUserEvent?this.Gm(i.event):this.Zm(i.event);break}case Yt.RecordingEvent:{const s=e,i=this.Hm.transformEvents(t,s);if(0===i.events.length)return;i.containsUserEvent?this.Wm(i.events):this.Jm(i.events);break}case Yt.JavascriptError:this.Km(e);break;case Yt.ApiError:this.Ym(e);break;case Yt.DetailedApiError:this.Qm(e);break;case Yt.CustomError:this.Xm(e);break;case Yt.EmerchandisingMessage:{const s=this.qm.transformEvent(t,e);this.tw(s);break}case Yt.Commands:{const s=this.Fm.transformEvent(t,e);this.ew(s);break}case Yt.IntegrationCallback:this.iw(e);break;case Yt.StaticResource:this.nw(e);break;case Yt.TrackingContextRequestMessage:this.rw(e);break;default:es.error(`Parent received unknown data type from iframe : ${csJSON.stringify(e)}`)}}zm(t){const s=[Yt.AnalysisEvent,Yt.RecordingEvent,Yt.EmerchandisingMessage,Yt.Commands];return-1!==csArray.prototype.indexOf.call(s,t)}jm(t){const{message:s,errorCode:e,level:i}=t;switch(i){case Y.debug:es.debug(s,e);break;case Y.warn:es.warn(s,e);break;case Y.error:es.error(s,e);break;case Y.critical:es.critical(s,e)}}Gm(t){for(const s of this.listeners)s.onIframeAnalysisUserEvent&&s.onIframeAnalysisUserEvent(t)}Zm(t){for(const s of this.listeners)s.onIframeAnalysisBrowserEvent&&s.onIframeAnalysisBrowserEvent(t)}Wm(t){for(const s of this.listeners)s.onIframeRecordingUserEvent&&s.onIframeRecordingUserEvent(t)}Jm(t){for(const s of this.listeners)s.onIframeRecordingBrowserEvent&&s.onIframeRecordingBrowserEvent(t)}Km(t){for(const s of this.listeners)s.onIframeJavascriptError&&s.onIframeJavascriptError(t)}Ym(t){for(const s of this.listeners)s.onIframeApiError&&s.onIframeApiError(t)}Qm(t){for(const s of this.listeners)s.onIframeDetailedApiError&&s.onIframeDetailedApiError(t)}tw(t){for(const s of this.listeners)s.onIframeEmerchandisingMessage&&s.onIframeEmerchandisingMessage(t)}ew(t){for(const s of this.listeners)s.onIframeCommands&&s.onIframeCommands(t)}iw(t){for(const s of this.listeners)s.onIframeIntegrationCallback&&s.onIframeIntegrationCallback(t)}nw(t){for(const s of this.listeners)s.onIframeStaticResource&&s.onIframeStaticResource(t)}rw(t){for(const s of this.listeners)s.onTrackingContextRequestCallback&&s.onTrackingContextRequestCallback(t)}Xm(t){for(const s of this.listeners)s.onIframeCustomError&&s.onIframeCustomError(t)}}var yu;!function(t){t.COMPRESSION_DISABLED="compressionDisabled"}(yu||(yu={}));class Eu{constructor(){}static init(t){this.ow&&void 0===t||this.initFlags(t)}static initFlags(t=document.cookie){var s;const e=null===(s=/_cs_debug=((\w|\.|\:|=)+)/g.exec(t))||void 0===s?void 0:s[1];if(this.ow=new Map,e){const t=csString.prototype.split.call(e,".");for(let s=0;s{var n;const r=e.toString(),o=`${null===(n=s.constructor)||void 0===n?void 0:n.name}.${r}`,h=i.value;(function(t,s){var e;if(null==t)return!1;return t===s||!!(null===(e=csString.prototype.match.call(t,new csRegExp("(^|,)("+s+")(,|$)")))||void 0===e?void 0:e.length)})(Eu.getString("debugLog"),t)&&(i.value=function(...t){return console.log(o,...t),h.bind(this)(...t)})}}}function Au(){function t(t){let s=t.length;for(;--s>=0;)t[s]=0}const s=256,e=286,i=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]),o=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]),h=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 p=new Array(i);function v(t,s,e,i,n){this.static_tree=t,this.extra_bits=s,this.extra_base=e,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let m,w,g;function y(t,s){this.dyn_tree=t,this.max_code=0,this.stat_desc=s}t(p);const E=t=>t<256?l[t]:l[256+(t>>>7)],A=(t,s)=>{t.pending_buf[t.pending++]=255&s,t.pending_buf[t.pending++]=s>>>8&255},_=(t,s,e)=>{t.bi_valid>16-e?(t.bi_buf|=s<>16-t.bi_valid,t.bi_valid+=e-16):(t.bi_buf|=s<{_(t,e[2*s],e[2*s+1])},S=(t,s)=>{let e=0;do{e|=1&t,t>>>=1,e<<=1}while(--s>0);return e>>>1},T=(t,s,e)=>{const i=new Array(16);let r,o,h=0;for(r=1;r<=n;r++)i[r]=h=h+e[r-1]<<1;for(o=0;o<=s;o++){let s=t[2*o+1];0!==s&&(t[2*o]=S(i[s]++,s))}},I=t=>{let s;for(s=0;s{t.bi_valid>8?A(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,e,i)=>{const n=2*s,r=2*e;return t[n]{const i=t.heap[e];let n=e<<1;for(;n<=t.heap_len&&(n{let n,h,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],h=t.pending_buf[t.l_buf+u],u++,0===n?R(t,h,e):(c=d[h],R(t,c+s+1,e),a=r[c],0!==a&&(h-=f[c],_(t,h,a)),n--,c=E(n),R(t,c,i),a=o[c],0!==a&&(n-=p[c],_(t,n,a)))}while(u{const e=s.dyn_tree,i=s.stat_desc.static_tree,r=s.stat_desc.has_stree,o=s.stat_desc.elems;let h,c,a,u=-1;for(t.heap_len=0,t.heap_max=573,h=0;h>1;h>=1;h--)V(t,e,h);a=o;do{h=t.heap[1],t.heap[1]=t.heap[t.heap_len--],V(t,e,1),c=t.heap[1],t.heap[--t.heap_max]=h,t.heap[--t.heap_max]=c,e[2*a]=e[2*h]+e[2*c],t.depth[a]=(t.depth[h]>=t.depth[c]?t.depth[h]:t.depth[c])+1,e[2*h+1]=e[2*c+1]=a,t.heap[1]=a++,V(t,e,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,s)=>{const e=s.dyn_tree,i=s.max_code,r=s.stat_desc.static_tree,o=s.stat_desc.has_stree,h=s.stat_desc.extra_bits,c=s.stat_desc.extra_base,a=s.stat_desc.max_length;let u,l,d,f,p,v,m=0;for(f=0;f<=n;f++)t.bl_count[f]=0;for(e[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;u<573;u++)l=t.heap[u],f=e[2*e[2*l+1]+1]+1,f>a&&(f=a,m++),e[2*l+1]=f,l>i||(t.bl_count[f]++,p=0,l>=c&&(p=h[l-c]),v=e[2*l],t.opt_len+=v*(f+p),o&&(t.static_len+=v*(r[2*l+1]+p)));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>i||(e[2*d+1]!==f&&(t.opt_len+=(f-e[2*d+1])*e[2*d],e[2*d+1]=f),l--)}})(t,s),T(e,u,t.bl_count)},O=(t,s,e)=>{let i,n,r=-1,o=s[1],h=0,c=7,a=4;for(0===o&&(c=138,a=3),s[2*(e+1)+1]=65535,i=0;i<=e;i++)n=o,o=s[2*(i+1)+1],++h{let i,n,r=-1,o=s[1],h=0,c=7,a=4;for(0===o&&(c=138,a=3),i=0;i<=e;i++)if(n=o,o=s[2*(i+1)+1],!(++h{_(t,0+(i?1:0),3),((t,s,e,i)=>{P(t),i&&(A(t,e),A(t,~e)),t.pending_buf.set(t.window.subarray(s,s+e),t.pending),t.pending+=e})(t,s,e,!0)};var L=t=>{x||((()=>{let t,s,c,y,E;const A=new Array(16);for(c=0,y=0;y<28;y++)for(f[y]=c,t=0;t<1<>=7;y{let r,o,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let s;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),k(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,o=t.static_len+3+7>>>3,o<=r&&(r=o)):r=o=i+5,i+4<=r&&-1!==e?$(t,e,i,n):4===t.strategy||o===r?(_(t,2+(n?1:0),3),C(t,a,u)):(_(t,4+(n?1:0),3),((t,s,e,i)=>{let n;for(_(t,s-257,5),_(t,e-1,5),_(t,i-4,4),n=0;n(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(d[i]+s+1)]++,t.dyn_dtree[2*E(e)]++),t.last_lit===t.lit_bufsize-1),U=t=>{_(t,2,3),R(t,256,a),(t=>{16===t.bi_valid?(A(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)},B={_tr_init:L,_tr_stored_block:$,_tr_flush_block:M,_tr_tally:D,_tr_align:U};var F=(t,s,e,i)=>{let n=65535&t,r=t>>>16&65535,o=0;for(;0!==e;){o=e>2e3?2e3:e,e-=o;do{n=n+s[i++]|0,r=r+n|0}while(--o);n%=65521,r%=65521}return n|r<<16};const q=new Uint32Array((()=>{let t,s=[];for(var e=0;e<256;e++){t=e;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;s[e]=t}return s})());var H=(t,s,e,i)=>{const n=q,r=i+e;t^=-1;for(let e=i;e>>8^n[255&(t^s[e])];return~t},z={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}=B,{Z_NO_FLUSH:Y,Z_PARTIAL_FLUSH:Q,Z_FULL_FLUSH:X,Z_FINISH:tt,Z_BLOCK:st,Z_OK:et,Z_STREAM_END:it,Z_STREAM_ERROR:nt,Z_DATA_ERROR:rt,Z_BUF_ERROR:ot,Z_DEFAULT_COMPRESSION:ht,Z_FILTERED:ct,Z_HUFFMAN_ONLY:at,Z_RLE:ut,Z_FIXED:lt,Z_DEFAULT_STRATEGY:dt,Z_UNKNOWN:ft,Z_DEFLATED:pt}=j,vt=258,mt=262,wt=103,gt=113,yt=666,Et=(t,s)=>(t.msg=z[s],s),At=t=>(t<<1)-(t>4?9:0),_t=t=>{let s=t.length;for(;--s>=0;)t[s]=0};let Rt=(t,s,e)=>(s<{const s=t.state;let e=s.pending;e>t.avail_out&&(e=t.avail_out),0!==e&&(t.output.set(s.pending_buf.subarray(s.pending_out,s.pending_out+e),t.next_out),t.next_out+=e,s.pending_out+=e,t.total_out+=e,t.avail_out-=e,s.pending-=e,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,e,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,s.set(t.input.subarray(t.next_in,t.next_in+n),e),1===t.state.wrap?t.adler=F(t.adler,s,n,e):2===t.state.wrap&&(t.adler=H(t.adler,s,n,e)),t.next_in+=n,t.total_in+=n,n)},Vt=(t,s)=>{let e,i,n=t.max_chain_length,r=t.strstart,o=t.prev_length,h=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+vt;let f=a[r+o-1],p=a[r+o];t.prev_length>=t.good_match&&(n>>=2),h>t.lookahead&&(h=t.lookahead);do{if(e=s,a[e+o]===p&&a[e+o-1]===f&&a[e]===a[r]&&a[++e]===a[r+1]){r+=2,e++;do{}while(a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&a[++r]===a[++e]&&ro){if(t.match_start=s,o=i,i>=h)break;f=a[r+o-1],p=a[r+o]}}}while((s=l[s&u])>c&&0!=--n);return o<=t.lookahead?o:t.lookahead},Ct=t=>{const s=t.w_size;let e,i,n,r,o;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,i=t.hash_size,e=i;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--i);i=s,e=i;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--i);r+=s}if(0===t.strm.avail_in)break;if(i=bt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=i,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=Rt(t,t.ins_h,t.window[o+1]);t.insert&&(t.ins_h=Rt(t,t.ins_h,t.window[o+3-1]),t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let e,i;for(;;){if(t.lookahead=3&&(t.ins_h=Rt(t,t.ins_h,t.window[t.strstart+3-1]),e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==e&&t.strstart-e<=t.w_size-mt&&(t.match_length=Vt(t,e)),t.match_length>=3)if(i=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]),e=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 i=J(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(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},Ot=(t,s)=>{let e,i,n;for(;;){if(t.lookahead=3&&(t.ins_h=Rt(t,t.ins_h,t.window[t.strstart+3-1]),e=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!==e&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=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]),e=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++,i&&(Tt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=J(t,0,t.window[t.strstart-1]),i&&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&&(i=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 Nt(t,s,e,i,n){this.good_length=t,this.max_lazy=s,this.nice_length=e,this.max_chain=i,this.func=n}const xt=[new Nt(0,0,0,0,((t,s)=>{let e=65535;for(e>t.pending_buf_size-5&&(e=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ct(t),0===t.lookahead&&s===Y)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+e;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,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 Nt(4,4,8,4,kt),new Nt(4,5,16,8,kt),new Nt(4,6,32,32,kt),new Nt(4,4,16,16,Ot),new Nt(8,16,32,32,Ot),new Nt(8,16,128,128,Ot),new Nt(8,32,128,256,Ot),new Nt(32,128,258,1024,Ot),new Nt(32,258,258,4096,Ot)];function $t(){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=pt,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:gt,t.adler=2===s.wrap?0:1,s.last_flush=Y,G(s),et},Mt=t=>{const s=Lt(t);return s===et&&(t=>{t.window_size=2*t.w_size,_t(t.head),t.max_lazy_match=xt[t.level].max_lazy,t.good_match=xt[t.level].good_length,t.nice_match=xt[t.level].nice_length,t.max_chain_length=xt[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,e,i,n,r)=>{if(!t)return nt;let o=1;if(s===ht&&(s=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>9||e!==pt||i<8||i>15||s<0||s>9||r<0||r>lt)return Et(t,nt);8===i&&(i=9);const h=new $t;return t.state=h,h.strm=t,h.wrap=o,h.gzhead=null,h.w_bits=i,h.w_size=1<{let e,i;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===yt&&s!==tt)return Et(t,0===t.avail_out?ot: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=H(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=gt);else{let s=pt+(n.w_bits-8<<4)<<8,e=-1;e=n.strategy>=at||n.level<2?0:n.level<6?1:6===n.level?2:3,s|=e<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=gt,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(e=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>e&&(t.adler=H(t.adler,n.pending_buf,n.pending-e,e)),St(t),e=n.pending,n.pending!==n.pending_buf_size));)It(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>e&&(t.adler=H(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){e=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>e&&(t.adler=H(t.adler,n.pending_buf,n.pending-e,e)),St(t),e=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexe&&(t.adler=H(t.adler,n.pending_buf,n.pending-e,e)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){e=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>e&&(t.adler=H(t.adler,n.pending_buf,n.pending-e,e)),St(t),e=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexe&&(t.adler=H(t.adler,n.pending_buf,n.pending-e,e)),0===i&&(n.status=wt)}else n.status=wt;if(n.status===wt&&(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=gt)):n.status=gt),0!==n.pending){if(St(t),0===t.avail_out)return n.last_flush=-1,et}else if(0===t.avail_in&&At(s)<=At(r)&&s!==tt)return Et(t,ot);if(n.status===yt&&0!==t.avail_in)return Et(t,ot);if(0!==t.avail_in||0!==n.lookahead||s!==Y&&n.status!==yt){let e=n.strategy===at?((t,s)=>{let e;for(;;){if(0===t.lookahead&&(Ct(t),0===t.lookahead)){if(s===Y)return 1;break}if(t.match_length=0,e=J(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,e&&(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 e,i,n,r;const o=t.window;for(;;){if(t.lookahead<=vt){if(Ct(t),t.lookahead<=vt&&s===Y)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){r=t.strstart+vt;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(e=J(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(e=J(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),e&&(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):xt[n.level].func(n,s);if(3!==e&&4!==e||(n.status=yt),1===e||3===e)return 0===t.avail_out&&(n.last_flush=-1),et;if(2===e&&(s===Q?K(n):s!==st&&(Z(n,0,0,!1),s===X&&(_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,et}return s!==tt?et:n.wrap<=0?it:(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?et:it)},Bt=(t,s)=>{let e=s.length;if(!t||!t.state)return nt;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return nt;if(1===n&&(t.adler=F(t.adler,s,e,0)),i.wrap=0,e>=i.w_size){0===n&&(_t(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(s.subarray(e-i.w_size,e),0),s=t,e=i.w_size}const r=t.avail_in,o=t.next_in,h=t.input;for(t.avail_in=e,t.next_in=0,t.input=s,Ct(i);i.lookahead>=3;){let t=i.strstart,s=i.lookahead-2;do{i.ins_h=Rt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--s);i.strstart=t,i.lookahead=2,Ct(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=o,t.input=h,t.avail_in=r,i.wrap=n,et},Ft={deflateInit:(t,s)=>Dt(t,s,pt,15,8,dt),deflateInit2:Dt,deflateReset:Mt,deflateResetKeep:Lt,deflateSetHeader:(t,s)=>t&&t.state?2!==t.state.wrap?nt:(t.state.gzhead=s,et):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!==wt&&s!==gt&&s!==yt?Et(t,nt):(t.state=null,s===gt?Et(t,rt):et)},deflateSetDictionary:Bt,deflateInfo:"pako deflate (from Nodeca project)"};const qt=(t,s)=>Object.prototype.hasOwnProperty.call(t,s);var Ht=function(t){const s=Array.prototype.slice.call(arguments,1);for(;s.length;){const e=s.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(const s in e)qt(e,s)&&(t[s]=e[s])}}return t},zt=t=>{let s=0;for(let e=0,i=t.length;e=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Gt[254]=Gt[254]=1;const Zt=(t,s=t.length)=>{if(s<65534&&t.subarray&&jt)return String.fromCharCode.apply(null,t.length===s?t:t.subarray(0,s));let e="";for(let i=0;i{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let s,e,i,n,r,o=t.length,h=0;for(n=0;n>>6,s[r++]=128|63&e):e<65536?(s[r++]=224|e>>>12,s[r++]=128|e>>>6&63,s[r++]=128|63&e):(s[r++]=240|e>>>18,s[r++]=128|e>>>12&63,s[r++]=128|e>>>6&63,s[r++]=128|63&e);return s};var Jt=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 Kt=Object.prototype.toString,{Z_NO_FLUSH:Yt,Z_SYNC_FLUSH:Qt,Z_FULL_FLUSH:Xt,Z_FINISH:ts,Z_OK:ss,Z_STREAM_END:es,Z_DEFAULT_COMPRESSION:is,Z_DEFAULT_STRATEGY:ns,Z_DEFLATED:rs}=j;function os(t){this.options=Ht({level:is,method:rs,chunkSize:16384,windowBits:15,memLevel:8,strategy:ns},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 Jt,this.strm.avail_out=0;let e=Ft.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(e!==ss)throw new Error(z[e]);if(s.header&&Ft.deflateSetHeader(this.strm,s.header),s.dictionary){let t;if(t="string"==typeof s.dictionary?Wt(s.dictionary):"[object ArrayBuffer]"===Kt.call(s.dictionary)?new Uint8Array(s.dictionary):s.dictionary,e=Ft.deflateSetDictionary(this.strm,t),e!==ss)throw new Error(z[e]);this._dict_set=!0}}function hs(t,s){return(s=s||{}).gzip=!0,function(t,s){const e=new os(s=s||{});if(e.push(t,!0),e.err)throw e.msg||z[e.err];return e.result}(t,s)}return os.prototype.push=function(t,s){const e=this.strm,i=this.options.chunkSize;let n,r;if(this.ended)return!1;for(r=s===~~s?s:!0===s?ts:Yt,"string"==typeof t?e.input=Wt(t):"[object ArrayBuffer]"===Kt.call(t)?e.input=new Uint8Array(t):e.input=t,e.next_in=0,e.avail_in=e.input.length;;)if(0===e.avail_out&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(r===Qt||r===Xt)&&e.avail_out<=6)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else{if(n=Ft.deflate(e,r),n===es)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),n=Ft.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ss;if(0!==e.avail_out){if(r>0&&e.next_out>0)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else if(0===e.avail_in)break}else this.onData(e.output)}return!0},os.prototype.onData=function(t){this.chunks.push(t)},os.prototype.onEnd=function(t){t===ss&&(this.result=zt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},(t,s,e)=>{let i=hs(t);return i="base64"===s?btoa(Zt(i)):i.buffer,e&&e(i),i}}class _u extends ks{constructor(t){super(t),this.algorithm=Cs.GZIP,this.hw=Au(),this.aw=(t,s,e)=>{e(this.hw(t,s))},this.compress=Ru();"undefined"!=typeof CompressionStream&&we||(this.compress=this.aw,this.getCompressorSourceCode=()=>Au.toString())}compressSync(t,s){return this.hw(t,s)}getCompressorSourceCode(){return Ru.toString()}}function Ru(){return(t,s,e)=>{const i=new Response(t).body.pipeThrough(new CompressionStream("gzip")),n=new Response(i).arrayBuffer();"base64"!==s?n.then((t=>e(t))):n.then((t=>{return s=t,new Promise((t=>{const e=new FileReader;e.onload=s=>t(s.target.result.split(",")[1]),e.readAsDataURL(new Blob([s]))}));var s})).then((t=>e(t)))}}class Su extends ks{constructor(){super(...arguments),this.algorithm=Cs.UNCOMPRESSED}compress(t,s,e){e(this.compressSync(t,s))}compressSync(t,s){return t}getCompressorSourceCode(){return function(){return(t,s,e)=>e(t)}.toString()}}class Tu{static create(t,s=!0){return this.instance?this.instance:s&&!Eu.isCompressionEnabled()?new Su(t):this.instance=new _u(t)}}class Iu{setItem(t,s){window.sessionStorage.setItem(t,s)}getItem(t){return window.sessionStorage.getItem(t)}removeItem(t){window.sessionStorage.removeItem(t)}}class Pu{setItem(t,s){window.localStorage.setItem(t,s)}getItem(t){return window.localStorage.getItem(t)}removeItem(t){window.localStorage.removeItem(t)}}const bu="_cs_cvars";class Vu{constructor(t,s,e){this.L=t,this.Zp=s,this.mv=e}onCookieToSet(t){this.Rv=t}onCookieToRemove(t){this.Sv=t}get(){return this.L.cookielessTrackingEnabled?this.mv.getItem(bu):this.Zp.get(bu)}set(t){var s;this.L.cookielessTrackingEnabled?this.mv.setItem(bu,t):(this.Zp.set(bu,t),null===(s=this.Rv)||void 0===s||s.call(this,bu,t))}remove(){var t;this.L.cookielessTrackingEnabled?this.mv.removeItem(bu):(this.Zp.delete(bu),null===(t=this.Sv)||void 0===t||t.call(this,bu))}static isValidCustomVarString(t){return"string"==typeof t}}const Cu=["visit",2],ku=["page",3],Ou=["nextPageOnly",4];class Nu{constructor(t,s){this.M=t,this.hv=s,this.uw={},this.lw={}}set(t,s,e,i){let n,r;if(t>0&&_t(s)&&_t(e)&&!Rt(s)&&!Rt(e)){const o=this.M.anonymizePII(csString(s)),h=this.M.anonymizePII(csString(e));if(n=[csString.prototype.slice.call(o,0,512),csString.prototype.slice.call(h,0,255)],r=""!==e,!At(i)||csArray.prototype.indexOf.call(Cu,i)>=0){const s=this.getCustomVariablesSession();r?s[t]=n:delete s[t],this.setCustomVariableSession(s)}(!At(i)||csArray.prototype.indexOf.call(ku,i)>=0)&&(r?this.uw[t]=n:delete this.uw[t]),At(i)&&csArray.prototype.indexOf.call(Ou,i)>=0&&(r?this.lw[t]=n:delete this.lw[t])}}getCustomVariablesSession(){const t=this.hv.get();if(!t)return{};const s=window.csJSON.parse(t);return null!==s&&Et(s)?s:{}}setCustomVariableSession(t){this.hv.set(window.csJSON.stringify(t))}removeCustomVariablesSession(){this.hv.remove()}removeCustomVariablesPage(){this.uw={}}getRequestParameters(){const t=this.getCustomVariablesSession();for(const t in this.lw)this.lw.hasOwnProperty(t)&&(this.uw[t]=this.lw[t]);for(const s in this.uw)this.uw.hasOwnProperty(s)&&(t[s]=this.uw[s]);if(window.csJSON.stringify(t).length<=2)return{};const s={cvars:this.fw(t)};return this.uw&&window.csJSON.stringify(this.uw).length>2&&(s.cvarp=this.fw(this.uw)),s}deleteNextPageOnlyCustomVariables(){if(Object.keys(this.lw).length>0)for(const t in this.lw)this.lw[t]===this.uw[t]&&(delete this.uw[t],delete this.lw[t])}pw(t){for(const n in t)if(t.hasOwnProperty(n)){const r=parseInt(n,10),o=t[n],h=o[0],c=o[1];e=1,i=20,(!(gt(s=r)&&s>=e&&s<=i)||h.length>512||c.length>255)&&delete t[n]}var s,e,i}fw(t){this.pw(t);const s=function(t){let s;for(s in t)return!1;return!0}(t)?[]:t;return window.csJSON.stringify(s)}getAllValidCustomVars(){const t=this.getCustomVariablesSession();for(const t in this.lw)this.lw.hasOwnProperty(t)&&(this.uw[t]=this.lw[t]);for(const s in this.uw)this.uw.hasOwnProperty(s)&&(t[s]=this.uw[s]);return this.pw(t),t}}const xu=["setCustomVariable"];class $u{constructor(t,s){this.kc=t,this.ds=s}init(){this.kc.register(xu,((t,s,e,i)=>{this.ds.set(t,s,e,i)}))}onAfterArtificialPageView(){this.ds.deleteNextPageOnlyCustomVariables()}onAfterNaturalPageView(){this.ds.deleteNextPageOnlyCustomVariables()}onOptout(){this.ds.removeCustomVariablesSession()}onBeforeVisitorRenewal(){this.ds.removeCustomVariablesSession(),this.ds.removeCustomVariablesPage()}}const Lu="_cs_id",Mu=/^(([a-z0-9\-])+(\.[0-9]+){6})(\.(None|Lax|X)\.(0|1))?(\.[0-1])?$/;class Du{constructor(t,s,e){this.L=t,this.Zp=s,this.mv=e}onCookieToSet(t){this.Rv=t}onCookieToRemove(t){this.Sv=t}get(){let t;return t=this.L.cookielessTrackingEnabled?this.mv.getItem(Lu):this.Zp.get(Lu),t?Du.fromString(t):null}set(t){var s;const e=Du.toString(t);if(this.L.cookielessTrackingEnabled)this.mv.setItem(Lu,e);else{const i=new csDate(t.expires);this.Zp.set(Lu,e,i),null===(s=this.Rv)||void 0===s||s.call(this,Lu,e,i)}}remove(){var t;this.L.cookielessTrackingEnabled?this.mv.removeItem(Lu):(this.Zp.delete(Lu),null===(t=this.Sv)||void 0===t||t.call(this,Lu))}handleSubdomainChange(){if(this.L.cookielessTrackingEnabled)return;const t=this.get();t&&(t.allowSubdomains=this.L.allowSubdomains,this.L.allowSubdomains?this.Zp.delete(Lu,Ss.CURRENT_DOMAIN):this.Zp.delete(Lu,this.Zp.getRootDomain()),this.set(t))}static fromString(t){const[s,e,i,n,r,o,h,c]=csString.prototype.split.call(t,".");return{id:s,creationTimestamp:Number(e),visitsCount:Number(i),hitTimestamp:Number(n),lastVisitTimestamp:Number(r),appliedTrackingDraw:Number(o),expires:Number(h),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 Mu.test(t)}}class Uu{constructor(t){this.M=t}getUrlMaskingPattern(t){const s=[],e=csString.prototype.split.call(t,"/");for(const t of e)z(t,Uu.mw)?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 e=this.M.anonymizePII(t);return e=this.M.anonymizeJwt(e),s.length>0?this.gw(e,s):e}removeQueryString(t){const{path:s,queryString:e}=this.yw(t);return""!==e?`${s}?`:s}yw(t){const s=csString.prototype.indexOf.call(t,"?");let e="",i="";return-1!==s?(e=csString.prototype.slice.call(t,0,s),i=csString.prototype.slice.call(t,s,t.length)):e=t,{path:e,queryString:i}}gw(t,s){const{path:e,queryString:i}=this.yw(t),n=csString.prototype.split.call(e,"/");for(const t of s){const s=this.Ew(n,t);if(null!==s)return`${s}${i}`}return t}Ew(t,s){if(t.length=s.length)e+=`${t[i]}/`;else if(z(s[i].key,Uu.mw))e+=`${s[i].value}/`;else{if(t[i]!==s[i].key)return null;e+=`${t[i]}/`}return csString.prototype.slice.call(e,0,-1)}}Uu.mw=":";class Bu{constructor(t,s){this.Ma=t,this.L=s}getEventTargetPath(t){const s=me(t);return this.Ma.getElementPath(s,{dynamicIdRegex:this.L.dynamicIdRegex,...this.L.pathComputationRules})}getEventTargetPathAndTargetLink(t){const s=me(t),{path:e,firstAnchorParent:i}=this.Ma.getElementPathAndFirstAnchorParent(s,{dynamicIdRegex:this.L.dynamicIdRegex,...this.L.pathComputationRules});return{path:e,targetLink:this.Aw(i)?i.href:""}}hasValidEventTarget(t){const s=me(t);return this.Ma.isValidElement(s)}getElementPath(t){return this.Ma.getElementPath(t,{dynamicIdRegex:this.L.dynamicIdRegex,...this.L.pathComputationRules})}Aw(t){var s;return null!==t&&t.hasAttribute("href")&&!z(null!==(s=t.getAttribute("href"))&&void 0!==s?s:"","#")}}class Fu{constructor(t){this.Eu=t}transformEvent(t,s){this._w(t,s.event);const e=this.Eu.getElementPath(t);return this.Rw(e,s.event),s}_w(t,s){if(function(t){return void 0!==t.x&&void 0!==t.y}(s)){const e=t.getBoundingClientRect();s.x=Math.round(e.left+s.x+Ni.windowOffsetX()),s.y=Math.round(e.top+s.y+Ni.windowOffsetY())}}Rw(t,s){Ro(s)&&(s.tgt=`${t}${wu}${s.tgt}`),function(t){return void 0!==t.tgtHM}(s)&&(s.tgtHM=`${t}${wu}${s.tgtHM}`),function(t){return void 0!==t.tgtLk}(s)&&(s.tgtLk=`${t}${wu}${s.tgtLk}`)}}class qu{constructor(t){this.Eu=t}transformEvent(t,s){const e=this.Eu.getElementPath(t);return{iframePath:s.iframePath?`${e}${wu}${s.iframePath}`:e,commands:s.commands}}}class Hu{constructor(t){this.Eu=t}transformEvent(t,s){if(0===s.products.length)return s;const e=this.Eu.getElementPath(t),i=csArray.prototype.map.call(s.products,(t=>({...t,targetPath:`${e}${wu}${t.targetPath}`})));return{...s,products:i}}}class zu{constructor(){this.Sw={clientX:2,clientY:3},this.Tw={clientX:1,clientY:2},this.Iw=[ue.POINTER_DOWN,ue.POINTER_MOVE,ue.POINTER_UP],this.Pw=[ue.TOUCH_START,ue.TOUCH_MOVE,ue.TOUCH_END]}transformEvents(t,s){if(!Li.isConnected(t))return s.events=csArray.prototype.filter.call(s.events,(t=>t.type!==ue.VISIBILITY_CHANGE)),0===s.events.length||(es.warn(`IframeRecordingEventsTransformer received event ${Yt.RecordingEvent}\n from disconnected iframe, content:${csJSON.stringify(s.events)}`),s.events=[]),s;const e=Se(t);let i=null;csArray.prototype.some.call(s.events,(t=>this.bw(t)||this.Vw(t)))&&(i=t.getBoundingClientRect());for(const t of s.events)this.bw(t)?this.Cw(i,t):this.Vw(t)&&this.kw(i,t),t.context=t.context&&t.context.length>0?`${e}/${t.context}`:`${e}`;return s}kw(t,s){this.Ow(this.Tw,t,s)}Cw(t,s){this.Ow(this.Sw,t,s)}Ow(t,s,e){e.args&&(e.args[t.clientX]=Math.round(s.left+e.args[t.clientX]),e.args[t.clientY]=Math.round(s.top+e.args[t.clientY]))}bw(t){return-1!==csArray.prototype.indexOf.call(this.Iw,t.type)}Vw(t){return-1!==csArray.prototype.indexOf.call(this.Pw,t.type)}}class ju{constructor(t){this.Nw=t}start(){this.Nw.onEvent((t=>this.fn(t))),this.Nw.start()}stop(){this.Nw.stop()}fn(t){const s=`Content Security Policy error. Violated directive: ${t.violatedDirective} - Source file: ${t.sourceFile}`;es.warn(s)}}class Gu{constructor(){this.vo={boundElement:document,type:"securitypolicyviolation",listener:t=>this.securityPolicyViolationListener(t)}}start(){oe(this.vo)}stop(){he(this.vo)}onEvent(t){this.Bn=t}xw(t){if(!t)return!1;const s=t.disposition;return yt(t.sourceFile)&&csArray.prototype.some.call(Gu.$w,(s=>csString.prototype.indexOf.call(t.sourceFile,s)>0))&&"report"!==s}securityPolicyViolationListener(t){this.xw(t)&&this.Bn({violatedDirective:t.violatedDirective,sourceFile:t.sourceFile})}}Gu.$w=["contentsquare","cdnssl.clicktale.net"],ys([ns("Event handler type: securitypolicyviolation")],Gu.prototype,"securityPolicyViolationListener",null);class Zu{init(){this.Lw=new ju(new Gu),this.Lw.start()}onOptout(){this.Lw.stop()}}class Wu{constructor(t,s,e,i){this.L=t,this.nt=s,this.D=e,this.Gp=i}init(){let t,s,e,i,n,r,o,h,c,a,u,l,d,f,p,v,m,w,g,y,E,A,_,R,S,T,I,P,b,V,C,k,O;vc.isSupported()&&vc.setDigestSalt(this.L.projectId.toString()),this.Gp.schedule((()=>{t=new Ca(this.Gp),s=new pt,e=new Uu(s),n=new pu(window.location,e),i=new Ss(this.L,n,this.nt),i.init()})),this.Gp.schedule((()=>{r=new Iu,o=new Pu,w=new Xa(window.location,i);(new Zu).init(),g=Tu.create(es.warn),m=new qs(g);const s=m.create(`${this.L.getQuotaServiceUri()}/quota`,!0);a=new mu(this.L,s,t,w,n),a.init()})),this.Gp.schedule((()=>{h=new Sa(this.L,i,r),c=new Ia(h,a)})),this.Gp.schedule((()=>{u=new Du(this.L,i,r),l=new ga(this.L,u,c,t),this.D.setContext(l,c),a.setVisitorService(l)})),this.Gp.schedule((()=>{O=new Ba(this.L,new Na(this.L,i,o),t),d=new ba(l,c,O),f=new ja(this.L,i,r),p=new Ga(window.location,f),v=new Za(p),y=new Pa(this.L,l,p),C=new Bu(F,this.L),T=new Fu(C),I=new qu(C),P=new Hu(C),b=new zu,V=new gu(T,I,P,b),S=new au([hu.UXA]),E=new ou(S,V),A=new Ja(n),_=new Ya(A,S);const e=new Vu(this.L,i,r);k=new Nu(s,e),R=new $u(S,k);new Hs(l,c,p,k,this.L)})),this.Gp.schedule((()=>{new ma(this.L,l,p,y,d,undefined,undefined,w).compute((r=>{this.Gp.schedule((()=>{E.init();const h=new vu,a=new Ua(this.L,S,O,c,t),u=new su(this.L,i,o),d=new eu(t,window.location,u),f=new ru(S,d),p=new lu(S,this.L);const w=new uu(this.L,l,c,undefined);if(r){t.emitInitTracking();new va(w,g,l,c,t,S,E,this.L,f,d,a,O,s,C,e,n,p,h,V,k,R,A,_,this.Gp,m,i,o).start()}else{new Fa(t,S,E,f,d,v,a).start()}}))}))}))}}var Ju,Ku;!function(t){let s;const e={loadBundle(t){const r=t.source,o=t.data;if(i(o)){const i=()=>{const s=function(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)}("{domain}/tag/tag.bundle.js?v={version}",o);!function(t,s){const e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=t,e.onload=s,e.charset="utf-8",document.head.appendChild(e)}(s,(()=>r.postMessage("csBundleLoaded",t.origin)))};s=o.token,c(e.loadBundle),n(t.origin)&&i()}}};function i(t){return t&&"csBundleInjection"===t.type&&n(t.domain)&&o(t.version)&&r(t.token)}function n(s){return/^https?:\/\/[a-zA-Z0-9\.\-]+\.(content-square\.fr|contentsquare\.com|csq\.io)$/.test(s)||t.hjDomainRegex.test(s)}function r(t){return/^[a-zA-Z0-9]+$/.test(t)}function o(t){return/^[a-zA-Z0-9\.]+$/.test(t)}function h(t){window.addEventListener("message",t,!1)}function c(t){window.removeEventListener("message",t,!1)}t.getToken=function(){return s},t.isAuthorizedIncomingMessage=i,t.hjDomainRegex=/^https?:\/\/[a-zA-Z0-9\.\-]+\.hotjar\.com$/,t.isAuthorizedDomain=n,t.isAuthorizedToken=r,t.isAuthorizedTagVersion=o,t.isActivable=function(){const t=window.opener||window.parent;return window!==t&&window.addEventListener},t.waitForBundleInjection=function(){h(e.loadBundle)},t.listen=h,t.removeListener=c}(Ju||(Ju={})),function(t){const s=window.opener||window.parent,e=[/^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$/,Ju.hjDomainRegex];let i,n;const r={ping(t){if("ping"===t.data&&o(t.origin)){const s=Ju.hjDomainRegex.test(t.origin);i=s?"https://app.contentsquare.com":t.origin,n=s?t.origin:void 0,a(r.ping),c(r.insertMessageScript),h(`${"utils.js"}?cb=${(new csDate).getTime()}`)}},insertMessageScript:u((t=>{const s=t.data;"string"==typeof s&&"ping"!==s&&(a(r.insertMessageScript),h(s))}))};function o(t){return csArray.prototype.some.call(e,(s=>s.test(t)))}function h(t,s){const e=document.createElement("script");e.type="text/javascript",e.async=!0;const n=csString.prototype.replace.call(i,/^https?:/,"");e.src=`${n}/tag/${t}`,e.onload=s,e.charset="utf-8",document.getElementsByTagName("head")[0].appendChild(e),function(t){csString.prototype.includes.call(t,"&mode=")&&sessionStorage.setItem("_hjRetakerMode",csString.prototype.split.call(t,"&mode=")[1])}(t)}function c(t){window.addEventListener("message",t,!1)}function a(t){window.removeEventListener("message",t,!1)}function u(t){return function(s){(s.origin===i||n)&&t(s)}}t.getToken=function(){return Ju.getToken()},t.isActivable=function(){return window!==s&&window.addEventListener},t.isAuthorizedDomain=o,t.waitForConnection=function(){c(r.ping),Ju.waitForBundleInjection()},t.listen=c,t.removeListener=a,t.secureListener=u,t.post=function(t){n?s.postMessage(t,n):i&&s.postMessage(t,i)}}(Ku||(Ku={}));const Yu=window.CSFrameCommunication||Ku;class Qu extends Va{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)}emitParentSensitiveStatusChange(t){for(const s of this.listeners)s.onParentSensitiveStatusChange&&s.onParentSensitiveStatusChange(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 Xu=["trackTransaction"];class tl{constructor(t){this.Mw=t}init(){this.Mw.register(co),this.Mw.register(xu),this.Mw.register(Wh),this.Mw.register(Jh),this.Mw.register(Zh),this.Mw.register(vo),this.Mw.register(mo),this.Mw.register(wo),this.Mw.register(go),this.Mw.register(Xu),this.Mw.register(ic),this.Mw.register(nc),this.Mw.register(iu),this.Mw.register(nu),this.Mw.register(oc),this.Mw.register(gc),this.Mw.register(yc),this.Mw.register(qr),this.Mw.register($a),this.Mw.register(La),this.Mw.register(Ma),this.Mw.register(Da)}onStartTracking(){this.Mw.start()}onOptout(){this.Mw.stop()}}class sl extends Ue{constructor(t,s){super(),this.kc=t,this.Dw=s,this.wa=[]}onStart(){this.commandsBatchReady()}onStop(){this.wa=[]}register(t){for(const s of t)this.kc.register([s],((...t)=>this.send(s,t)))}send(t,s){csArray.prototype.push.call(this.wa,{name:t,params:s}),this.isStarted&&this.commandsBatchReady()}commandsBatchReady(){if(0===this.wa.length)return;const t={commands:this.wa};this.Dw.sendToParent(Yt.Commands,t),this.wa=[]}}ys([ns("Commands.iframe.commandsBatch.send")],sl.prototype,"send",null),ys([kr(),ns("send iframe commands batch")],sl.prototype,"commandsBatchReady",null);class el{constructor(t=25){this.Uw=t,this.Bw=[]}reset(){this.Bw=[]}getMessages(){return this.Bw}addMessage(t){this.Bw.lengththis.Jl(t)}}onStart(){oe(this.Gw,!1),this.Zw()}onStop(){he(this.Gw,!1),this.jw&&(Qt.closeChannelPort(this.jw),this.jw=null)}sendToParent(t,s){const e=this.buildChildBaseMessage(t,s);this.Ww(e)}Zw(){const t=this.buildChildBaseMessage(Yt.Discovery);Qt.sendPostMessage(window.parent,"*",t)}buildChildBaseMessage(t,s){const e=Qt.buildBaseMessage(t,Kt.Child,this.L.projectId);return s&&(e.content=s),e}Ww(t){null!==this.jw?Qt.sendChannelMessage(this.jw,t):this.buffer.addMessage(t)}Jw(t,s){const e=Qt.getNewChannelMessage();this.jw=e.port1,this.jw.onmessage=t=>{this.yd(t)};const i=this.buildChildBaseMessage(Yt.Discovery);i.id=s,Qt.sendPostMessage(window.parent,t,i,[e.port2]),this.sendAllMessagesFromBuffer()}yd(t){switch(t.data.type){case Yt.TrackingContextResultMessage:this.zw.emitTrackingContextResultMessage(t.data.content);break;case Yt.IntegrationCallback:{const s=t.data.content;s.initiator===Jt.AfterPageView?this.zw.emitAfterPageViewCallback(s):s.initiator===Jt.GetSessionKey?this.zw.emitIntegrationSessionKeyCallback(s):es.warn(`Iframe child received unknown IntegrationCallback type from parent : ${csJSON.stringify(t.data)}`);break}case Yt.Stop:this.Jh.emitOptout();break;case Yt.RecordingStatus:{const s=t.data.content;this.qw.setRecordingStatus(s),this.zw.emitParentRecordingStatusChange(s);break}case Yt.SensitiveStatus:{const s=t.data.content;this.Hw.setSensitiveStatus(s),this.zw.emitParentSensitiveStatusChange(s);break}default:es.warn(`Iframe child received unknown channelMessage type from parent : ${csJSON.stringify(t.data)}`)}}Jl(t){if(null===this.jw&&Qt.isMessageValid(t,Kt.Parent,this.L.projectId,this.L.hostnames))switch(t.data.type){case Yt.Stop:this.Jh.emitOptout();break;case Yt.Discovery:if(!gt(t.data.id)||t.data.id<0)return void es.warn(`Iframe child received discovery without valid id from parent (${t.origin}) : ${csJSON.stringify(t.data)}`);this.Jw(t.origin,t.data.id);break;default:es.warn(`Iframe child received unknown postMessage type from parent (${t.origin}) : ${csJSON.stringify(t.data)}`)}}sendAllMessagesFromBuffer(){if(null===this.jw)return;const t=this.buffer.getMessages();for(const s of t)Qt.sendChannelMessage(this.jw,s);this.Kw(),this.buffer.reset()}Kw(){const t=Qt.buildBaseMessage(Yt.EndOfBufferedMessages,Kt.Child,this.L.projectId);Qt.sendChannelMessage(this.jw,t)}}class rl{constructor(t){this.Dw=t}onStartTracking(){this.Dw.start()}onOptout(){this.Dw.stop()}}class ol{constructor(t,s,e,i,n){this.oa=t,this.aa=s,this.Dw=e,this.qw=i,this.Hw=n}init(){this.oa.onChildMessage(((t,s,e)=>this.aa.emitIframeEvent(t,s,e))),this.oa.setSentiveStatusCallback((()=>this.Hw.getSensitiveStatus())),this.oa.setRecordingStatusCallback((()=>this.qw.getRecordingStatus()))}onStartTracking(){this.oa.start()}onOptout(){this.oa.stop()}onIframeRecordingUserEvent(t){const s={events:t,containsUserEvent:!0};this.Dw.sendToParent(Yt.RecordingEvent,s)}onIframeRecordingBrowserEvent(t){const s={events:t,containsUserEvent:!1};this.Dw.sendToParent(Yt.RecordingEvent,s)}onIframeAnalysisUserEvent(t){const s={event:t,isUserEvent:!0};this.Dw.sendToParent(Yt.AnalysisEvent,s)}onIframeAnalysisBrowserEvent(t){const s={event:t,isUserEvent:!1};this.Dw.sendToParent(Yt.AnalysisEvent,s)}onIframeJavascriptError(t){this.Dw.sendToParent(Yt.JavascriptError,t)}onIframeApiError(t){this.Dw.sendToParent(Yt.ApiError,t)}onIframeDetailedApiError(t){this.Dw.sendToParent(Yt.DetailedApiError,t)}onIframeEmerchandisingMessage(t){this.Dw.sendToParent(Yt.EmerchandisingMessage,t)}onIframeCommands(t){this.Dw.sendToParent(Yt.Commands,t)}onIframeIntegrationCallback(t){this.Dw.sendToParent(Yt.IntegrationCallback,t)}onTrackingContextRequestCallback(t){this.Dw.sendToParent(Yt.TrackingContextRequestMessage,t)}onIframeStaticResource(t){this.Dw.sendToParent(Yt.StaticResource,t)}onIframeCustomError(t){this.Dw.sendToParent(Yt.CustomError,t)}onTrackingContextResultCallback(t){this.oa.sendToChildren(Yt.TrackingContextResultMessage,t)}onAfterPageViewCallback(t){this.oa.sendToChildren(Yt.IntegrationCallback,t)}onIntegrationSessionKeyCallback(t){this.oa.sendToChildren(Yt.IntegrationCallback,t)}onParentRecordingStatusChange(t){this.oa.sendToChildren(Yt.RecordingStatus,t)}onParentSensitiveStatusChange(t){this.oa.sendToChildren(Yt.SensitiveStatus,t)}}class hl extends Ue{constructor(t,s,e,i,n,r,o,h){super(),this.pu=t,this.Oa=s,this.Dw=e,this.Ru=i,this.Su=n,this.Iu=r,this.Pu=o,this.bu=h}init(){var t,s,e,i,n;this.pu.onEvent((t=>this.tn(t))),this.Oa.onEvent((t=>this.tn(t))),null===(t=this.Ru)||void 0===t||t.onEvent((t=>this.tn(t))),null===(s=this.Su)||void 0===s||s.onEvent((t=>this.tn(t))),null===(e=this.Iu)||void 0===e||e.onEvent((t=>this.tn(t))),null===(i=this.Pu)||void 0===i||i.onEvent((t=>this.Cu(t))),null===(n=this.bu)||void 0===n||n.onEvent((t=>this.Cu(t)))}onStart(){var t,s,e,i,n;this.pu.start(),this.Oa.start(),null===(t=this.Ru)||void 0===t||t.start(),null===(s=this.Su)||void 0===s||s.start(),null===(e=this.Iu)||void 0===e||e.start(),null===(i=this.Pu)||void 0===i||i.start(),null===(n=this.bu)||void 0===n||n.start()}onStop(){var t,s,e,i,n;this.pu.stop(),this.Oa.stop(),null===(t=this.Ru)||void 0===t||t.stop(),null===(s=this.Su)||void 0===s||s.stop(),null===(e=this.Iu)||void 0===e||e.stop(),null===(i=this.Pu)||void 0===i||i.stop(),null===(n=this.bu)||void 0===n||n.stop()}tn(t){const s={isUserEvent:!0,event:t};this.fn(s)}Cu(t){const s={isUserEvent:!1,event:t};this.fn(s)}fn(t){this.isStarted&&t.event.type!==Ao.RESIZE&&this.Dw.sendToParent(Yt.AnalysisEvent,t)}}const cl=["webview:analytics:start"],al=["webview:analytics:stop"];class ul{constructor(t,s,e,i,n,r,o,h,c){this.L=t,this.Eu=s,this.Da=e,this.Dw=i,this.At=n,this.Yw=r,this.kc=o,this.Oa=h,this.ju=c}init(){const t=Lh(this.L,this.Eu,this.ju),s=new Io(t,this.Eu,this.Da),e=this.At.isInWebViewContext()?{collectGestureVelocity:!0,collectGestureDistance:!0}:{collectGestureVelocity:!1,collectGestureDistance:!1},i=Mh(this.L,this.Eu,this.ju),n=new To(i,this.Oa,e);this.Qw=new hl(s,n,this.Dw,undefined,undefined,undefined,undefined,undefined),this.Qw.init(),this.At.isInWebViewContext()&&this.Xw()}onStartTracking(){this.Qw.start()}onOptout(){this.Qw.stop()}onStartAnalytics(){this.Qw.start()}onStopAnalytics(){this.Qw.stop()}Xw(){this.kc.register(cl,(()=>this.Yw.emitStartAnalytics()),{disableApplyPending:!0}),this.kc.register(al,(()=>{this.Yw.emitStopRecording(),this.Yw.emitStopAnalytics()}),{disableApplyPending:!0})}}class ll extends Ue{constructor(t,s,e,i,n,r=[],o){super(),this.L=t,this.ki=s,this.Li=e,this.Dw=i,this.Bi=n,this.Fi=r,this.Hi=o,this.tg=!1,this.Wi=new De,this.bi=[],this.sg=!1,this.Qi=t=>this.Cu(t),this.Xi=t=>this.tn(t)}init(){this.mn()}mn(){var t;this.Bi.onEvent(this.Qi,this.Xi),this.ki.onEvent(this.Xi),null===(t=this.Li)||void 0===t||t.onInputNodeToEncrypt(this.Xi)}activateOnlineAssetsOnNextStart(){this.tg=!0}getStaticResourceManagerStatus(){return this.Hi?{supported:Rn.isSupported(),onlineAssets:{activated:this.Hi.isOnlineAssetsActivated(),enableOnNextStart:this.tg}}:null}Cu(t){this.eg(t),this.ig()}tn(t){this.ng(t),this.ig()}ng(t){csArray.prototype.push.call(this.bi,t),this.sg=!0}eg(t){csArray.prototype.push.call(this.bi,t)}ig(){$s(this.Fi,(t=>{var s;return null===(s=t.flushEvents)||void 0===s?void 0:s.call(t)}));const t={containsUserEvent:this.sg,events:this.bi};this.Dw.sendToParent(Yt.RecordingEvent,t),this.bi=[],this.sg=!1}onStart(){this.Hi&&this.tg&&(this.Hi.enableOnlineAssets(),this.tg=!1),this.Bi.start(),this.L.emitDebugEvents&&this.Wi.emit("replayRecordingStarted"),$s(this.Fi,(t=>{t.start&&t.start()}))}onStop(){var t;this.Bi.stop(),this.ki.stop(),null===(t=this.Hi)||void 0===t||t.disableOnlineAssets(),$s(this.Fi,(t=>{t.stop&&t.stop()}))}addInitialDom(t){for(let s=0;s=t.date)return csArray.prototype.splice.call(this.bi,s,0,t),this.sg=!0,void this.ig()}this.ng(t),this.ig()}}class dl{constructor(t){this.L=t}isReplayUnanonymizedAllowedByConsent(){return!this.L.consentRequired}}class fl{static isWebViewLocalAssetsSupported(){return"URL"in window}}const pl=["webview:replay:start"],vl=["webview:replay:stop"];class ml{constructor(t,s,e,i,n,r,o,h){this.L=t,this.Yw=s,this.rg=e,this.og=i,this.hg=n,this.kc=r,this.it=o,this.Hw=h,this.cg=!1}init(){const t=new dl(this.L),s=new Yc;this.$c=new Ja(this.it);if(new Ya(this.$c,this.kc).init(),this.Dc=new Kc(t,this.L,this.it,s),this.Dc.init(),fl.isWebViewLocalAssetsSupported()){const t=t=>{this.ag(t)},s=t=>es.error("An error occurred while fetching a styleSheet: "+t),e=new Set,i=t=>!e.has(t),n=t=>{e.add(t.assetId),this.ag([t])};this.rg.onAsset((t=>{this.ug(t)})),this.rg.onStyleSheetFound((e=>{this.hg.getStyleSheetAssets(e.assetId,t,s,i,n)}))}this.lg()}onStartRecording(){if(this.cg=!0,!this.$c.isUrlExcludedForSessionReplay()){const t=this.Hw.getSensitiveStatus();this.Yw.emitParentRecordingStatusChange({isRecording:!0,isMutationTrackerStarted:!0,useAnonymization:t.useAnonymization})}}onStopRecording(){this.cg=!1,this.Yw.emitParentRecordingStatusChange({isRecording:!1,isMutationTrackerStarted:!1})}onArtificialPageViewEnd(){this.Yw.emitParentRecordingStatusChange({isRecording:!1})}onAfterArtificialPageView(){this.Xs()&&!this.$c.isUrlExcludedForSessionReplay()&&this.Yw.emitParentRecordingStatusChange({isRecording:!0})}Xs(){return this.cg}lg(){this.kc.register(pl,(()=>{this.Yw.emitStartAnalytics(),this.Yw.emitStartRecording()}),{disableApplyPending:!0}),this.kc.register(vl,(()=>this.Yw.emitStopRecording()),{disableApplyPending:!0})}ug(t){this.og.sendToParent(Yt.Assets,{assets:[t]})}ag(t){0!==t.length&&this.og.sendToParent(Yt.Assets,{assets:t})}}var wl,gl,yl=/(@import\s*("([^"]+)"|'([^']+)'))|(url\s*\(\s*((("([^"\]]+)"|'([^'\]]+)')\s*)|([^)\]]+))\))/g;function El(t,s){var e=t.replace(yl,(function(){for(var t=[],e=0;e1114111?"�":String.fromCodePoint(n)}));return(i?"@import ":"")+"url("+function(t){if(-1===t.indexOf('"'))return'"'+t+'"';if(-1===t.indexOf("'"))return"'"+t+"'";return t}(s(r)||r)+")"}));return e}class Al{constructor(t){this.dg=t}getStyleSheetAssets(t,s,e,i,n){const r=[];if(!ai(t))return;this.dg.getResourceContentText(t,((t,o)=>{const h=this.hr(t,o);csArray.prototype.forEach.call(h,(t=>{csArray.prototype.push.call(r,t),ai(t.assetId)&&i(t.assetId)&&(null==n||n(t),this.getStyleSheetAssets(t.assetId,s,e,i,n))})),s(r)}),(t=>e(t)))}hr(t,s){return this.fg(t,function(t){var s=[];return El(t,(function(t){return s.push(t),t})),s}(s))}fg(t,s){return csArray.prototype.map.call(csArray.prototype.filter.call(csArray.prototype.filter.call(s,(t=>!hi(t))),(t=>!ci(t))),(s=>({assetId:Ht(s,t),assetBasePath:t,assetRawPath:s})))}}class _l{getResourceContentText(t,s,e){const i=this.pg((e=>{s(t,e.responseText)}),e);i.open("GET",t),i.send()}pg(t,s){const e=new XMLHttpRequest;return e.onreadystatechange=function(){e.readyState===XMLHttpRequest.DONE&&(200===e.status?t(e):s(e.statusText))},e}}class Rl extends Ue{constructor(t,s){super(),this.Kh=t,this.Dw=s}onStart(){}onStop(){}init(){this.Kh.onSendStaticResource((t=>this.Dw.sendToParent(Yt.StaticResource,t)))}}!function(t){let s;function e(s){$s(s,(s=>{Zs(s).visitAll((s=>Ae.setProperty(s,t.nodeProp,!0)))}))}t.nodeProp="toEncrypt",t.stop=function(){null==s||s.disconnect(),s=null},t.addSelector=function(t){Ce(t)&&(null==s&&(s=new Bn(e)),s.observe(t))},t.shouldEncrypt=function(s){return!0===Ae.getProperty(s,t.nodeProp)},t.getSelectors=function(){return null==s?void 0:s.selectors}}(wl||(wl={}));class Sl{constructor(t,s,e,i,n,r,o,h,c,a,u){this.L=t,this.M=s,this.Oc=e,this.Jh=i,this.Dw=n,this.qw=r,this.kc=o,this.zw=h,this.At=c,this.it=a,this.Hw=u}init(){const t=[],s=this.qw.getRecordingStatus();this.Uc=new qn(!!s.useAnonymization,Mr(this.L),(t=>this.M.checkAndAnonymizePII(t,this.L.anonymizeDigits)));const e=[];csArray.prototype.push.call(e,new Ln,this.Uc);const i=new kn;csArray.prototype.push.call(t,i),!this.At.isInWebViewContext()&&this.L.useStaticResourceManager&&Rn.isSupported()&&(this.Hi=new Rn,csArray.prototype.push.call(e,this.Hi),this.Kh=new Vr,this.vg=new Rl(this.Kh,this.Dw),this.vg.init()),this.ki=new Ne,this.ki.init(),csArray.prototype.push.call(t,new Pn(window.location,this.M));const n=[this.Oc,new fn,new _r(csArray.prototype.filter.call(t,(t=>t))),new sr,new ir,new hr,new lr(this.Li)];const r=new Ar(n,e),o=new br(r,this.Jh,this.Kh);if(this.mg=new ll(this.L,this.ki,this.Li,this.Dw,o,t,this.Hi),this.kc.register(Fr,(()=>this.qw.getRecordingStatus().isRecording)),this.kc.register(Hr,(()=>this.mg.getStaticResourceManagerStatus())),this.mg.init(),this.At.isInWebViewContext()){const t=new Al(new _l);this.wg=new ml(this.L,this.zw,i,this.Dw,t,this.kc,this.it,this.Hw),this.zw.addListener(this.wg),this.Jh.addListener(this.wg),this.wg.init()}}onParentRecordingStatusChange(t){var s,e;void 0!==t.useAnonymization&&this.Bc(t.useAnonymization),t.encryptionSelectors&&(wl.addSelector(t.encryptionSelectors),this.Li.setEncryptionSelectors(t.encryptionSelectors)),t.activateOnlineAssetsOnNextStart&&this.mg.activateOnlineAssetsOnNextStart(),t.isRecording?(this.Zc(),this.mg.start(),null===(s=this.vg)||void 0===s||s.start()):(this.mg.stop(),null===(e=this.vg)||void 0===e||e.stop())}onInitialDomStart(){}onInitialDomDone(t){this.ki.start(),this.mg.addInitialDom(t)}Bc(t){var s;this.Uc.setAnonymization(t),null===(s=this.Wc)||void 0===s||s.setAnonymization(t)}onOptout(){this.mg.stop()}Zc(){var t,s,e,i;if(null===(s=null===(t=this.L.experimental.sessionReplay)||void 0===t?void 0:t.shadowRoot)||void 0===s?void 0:s.filterByHostSelector){$s(null===(i=null===(e=this.L.experimental.sessionReplay)||void 0===e?void 0:e.shadowRoot)||void 0===i?void 0:i.filterByHostSelector,(t=>{Ce(t)&&Yi.setShadowRootFilter((s=>{try{return Pe.call(s.host,t)}catch{return!1}}))}))}}}class Tl{constructor(t,s){this.og=t,this.gg=s}init(){this.og.onWebViewEvent(((t,s)=>{this.gg.emitWebviewEventToBridge(t,s)}))}onStartTracking(){this.og.start()}onOptout(){this.og.stop()}onStartAnalytics(){this.og.setAnalyticsStatus(!0)}onStopAnalytics(){this.og.setAnalyticsStatus(!1)}onParentRecordingStatusChange(t){this.gg.setSessionReplayStatus(t.isRecording)}}!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"}(gl||(gl={}));class Il{constructor(){this.yg=1}transformEvent(t){switch(t.type){case Ao.TAP:return{version:this.yg,type:gl.TAP,data:{path:t.tgt}};case Ao.DRAG:{const s=t;return{version:this.yg,type:gl.DRAG,data:{path:s.tgt,direction:s.fd,distance:s.distance,velocity:s.velocity}}}case Ao.FLICK:{const s=t;return{version:this.yg,type:gl.FLICK,data:{path:s.tgt,direction:s.fd,distance:s.distance,velocity:s.velocity}}}default:return null}}}class Pl{constructor(t,s,e,i){this.it=t,this.Ni=s,this.$i=e,this.M=i,this.yg=1}transformEvent(t,s){switch(t){case Yt.ApiError:case Yt.DetailedApiError:{const t=this.$i.anonymize(s);return{version:this.yg,data:t}}case Yt.JavascriptError:{const t={...s,pageUrl:this.it.getAnonymizedUrl()},e=this.Ni.anonymize(t);return{version:this.yg,data:{...e,date:It.now()}}}case Yt.CustomError:{const t=s;return t.message=this.M.anonymizePII(t.message),{version:this.yg,data:{...t,date:It.now()}}}default:return null}}}var bl;!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(wt(t))return t}catch(t){es.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,e){window.CSJavascriptBridge.sendTransaction(t,s,e)},t.sendAssets=function(t,s){if(window.CSJavascriptBridge.sendAssets){const e=csJSON.stringify(t);window.CSJavascriptBridge.sendAssets(e,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))}}(bl||(bl={}));class Vl{constructor(t,s,e,i,n,r,o,h){this.Eg=t,this.Ag=s,this._g=e,this.Rg=i,this.Sg=n,this.Jh=r,this.$i=o,this.it=h,this.Tg=!1}async emitWebviewEventToBridge(t,s){switch(t){case Yt.AnalysisEvent:{const t=this._g.transformEvent(s.event);t&&bl.sendAnalysisEvent(t);break}case Yt.RecordingEvent:bl.sendSREvent(s);break;case Yt.ChildLogMessage:bl.sendLog(s);break;case Yt.Commands:es.tryToExecute(`SDKMessageUtils.sendMessage.sendCommandMessage: ${s}`,(()=>{this.Ig(s)}))();break;case Yt.Assets:{const{assets:t,serializationId:e}=s,i=await this.Sg.getTransformedAssets(t,e);bl.sendAssets(i,e);break}case Yt.JavascriptError:{const t=this.Rg.transformEvent(Yt.JavascriptError,s);t&&(this.Tg&&bl.sendNativeSREvent({...t,type:gl.JAVASCRIPT_ERROR_SR}),bl.sendAnalysisEvent({...t,type:gl.JAVASCRIPT_ERROR_AN}));break}case Yt.ApiError:{const t=this.Rg.transformEvent(Yt.ApiError,s);t&&bl.sendAnalysisEvent({...t,type:gl.API_ERROR});break}case Yt.DetailedApiError:{const t=this.Rg.transformEvent(Yt.DetailedApiError,s);t&&bl.sendNativeSREvent({...t,type:gl.DETAILED_API_ERROR});break}}}setSessionReplayStatus(t){this.Tg=t}Ig(t){const s=t.commands;for(const t of s)switch(!0){case csArray.prototype.indexOf.call(nu,t.name)>=0:bl.sendOptIn();break;case csArray.prototype.indexOf.call(iu,t.name)>=0:this.Jh.emitOptout(),bl.sendOptOut();break;case csArray.prototype.indexOf.call(co,t.name)>=0:this.Pg(t);break;case csArray.prototype.indexOf.call(Zh,t.name)>=0:this.bg(t);break;case csArray.prototype.indexOf.call(mo,t.name)>=0:this.Vg(t);break;case csArray.prototype.indexOf.call(wo,t.name)>=0:break;case csArray.prototype.indexOf.call(go,t.name)>=0:this.Cg();break;case csArray.prototype.indexOf.call(Xu,t.name)>=0:this.Vg(t),this.Cg();break;case csArray.prototype.indexOf.call(Dc,t.name)>=0:this.$i.addUrlMaskingPattern(t.params[0]);break;case csArray.prototype.indexOf.call(Fc,t.name)>=0:this.kg(t);break;default:es.warn(`WebviewBridgeEventEmitter received an unknown command: ${csJSON.stringify(t)}`)}}Pg(t){if(1!==t.params.length)return;const s=t.params[0];if(ro.isValid(s.key,s.value)){const t=this.Eg.anonymizePII(s.key),e=this.Eg.anonymizePII(s.value);bl.sendDynamicVariable(t,e)}}bg(t){if(1!==t.params.length)return;const s=t.params[0];if(yt(s)){const t={type:gl.PAGE_VIEW,version:1,data:{url:s}};this.it.overridePath(s),this.Jh.emitArtificialPageViewEnd(),bl.sendAnalysisEvent(t),this.Jh.emitAfterArtificialPageView()}}Vg(t){if(1!==t.params.length)return;const[s]=t.params;s.value&&(s.revenue=s.value),this.Ag.addTransaction(s)}Cg(){const t=this.Ag.getTransaction();uo.isValid(t)&&(bl.sendTransaction(t.id?t.id:null,t.revenue,t.currency?t.currency:""),this.Ag.clear())}kg(t){if(t.params.length<1)return;const s=t.params[0],e=t.params[1]||{};if(!yt(s)||!Et(e))return;const i=Hc.buildCustomErrorEvent(s,e),n=this.Rg.transformEvent(Yt.CustomError,i);n&&(this.Tg&&bl.sendNativeSREvent({...n,type:gl.CUSTOM_ERROR_SR}),bl.sendAnalysisEvent({...n,type:gl.CUSTOM_ERROR_AN}))}}const Cl="LOCAL_ASSET",kl="NONE",Ol="ONLY_LOCAL_ASSETS",Nl="ALL";class xl{constructor(t){var s,e;this.Og=t,this.Ng=new Set,this.xg=kl;try{const t=null===(e=null===(s=window.CSJavascriptBridge)||void 0===s?void 0:s.getAssetTransformerMode)||void 0===e?void 0:e.call(s);t!==Ol&&t!==Nl||(this.xg=t)}catch{}}setAssetProcessingMode(t){this.xg=t}async getTransformedAssets(t,s){if(this.xg===kl)return t;const e=[];for(const i of t){const t=i.assetId,n=this.$g(t);if(this.xg===Nl||n===Cl){let n=t;if(this.Lg(t,s)&&(n=this.Mg(t,s)),this.Ng.has(n)){csArray.prototype.push.call(e,i);continue}try{const s=await this.Og.getAssetContent(t);if(this.Ng.has(n)){csArray.prototype.push.call(e,i);continue}csArray.prototype.push.call(e,{...i,retrievedAssetContent:s}),this.Ng.add(i.assetId)}catch(t){es.error(`an error occurred while getting data for asset: ${n}: ${t}`),csArray.prototype.push.call(e,i)}}else csArray.prototype.push.call(e,i)}return e}$g(t){const s=window.WEBVIEW_SERVER_URL||null;try{const{protocol:e}=new csURL(t);return"file:"===e||s&&csString.prototype.startsWith.call(t,s)?Cl:"REMOTE_ASSET"}catch(s){es.error(`Error constructing URL (${t}"): ${s.message}`)}return"UNKNOWN_ASSET_TYPE"}Lg(t,s){return s&&csString.prototype.endsWith.call(t,".css")||!1}Mg(t,s){return`${t}#${s}`}}class $l{constructor(){this.Dg=52428800,this.Ug=31457280,this.Bg=0,this.Fg=!1,this.qg=new Map,this.Fh=[]}async getAssetContent(t){const s=this.qg.get(t);return s||new Promise(((s,e)=>{csArray.prototype.push.call(this.Fh,{assetUrl:t,successCallback:s,errorCallback:e}),this.Fg||this.Hg()}))}async Hg(){for(this.Fg=!0;this.Fh.length>0;){const{assetUrl:t,successCallback:s,errorCallback:e}=csArray.prototype.shift.call(this.Fh),i=this.qg.get(t);if(i)s(i);else try{const i=(await this.zg("GET",t,"blob")).target;if(200===i.status){const n=i.getResponseHeader("Content-Type"),r=Number(i.getResponseHeader("Content-Length"));if(r&&Number(r)>this.Ug){e(`asset is too big, size = ${r} bytes`);continue}const o=new FileReader;o.onload=()=>{const e={data:csString.prototype.split.call(o.result,"base64,")[1],mimeType:null!=n?n:""};this.Bg+=r,this.Bg>this.Dg&&(this.Bg=0,this.qg.clear()),this.qg.set(t,e),s(e)},o.onerror=()=>{e("Error converting XHR response to base64")},o.readAsDataURL(i.response)}else e(`error downloading ${t}: ${i.statusText}`)}catch(s){const i=`Error downloading resource ${t}: ${s.message}`;e(i)}}this.Fg=!1}zg(t,s,e){return new Promise((function(i,n){const r=new XMLHttpRequest;r.open(t,s),r.responseType=e,r.onload=i,r.onerror=n,r.send()}))}}function Ll(t){if(null==t?void 0:t.length)return Ns(t,(t=>function(t){let s=[];try{s=Ns(t.cssRules,(t=>t.cssText))}catch{}return{cssRules:s}}(t)))}class Ml{constructor(t,s,e){this.Dw=t,this.hg=s,this.rg=e}handleCommand(t){const s=t&&t.withAssets,e=[],i=new Set,n=new Set,r=[];s&&fl.isWebViewLocalAssetsSupported()?(this.rg.onAsset((t=>{i.has(t.assetId)||(i.add(t.assetId),csArray.prototype.push.call(e,t))})),this.rg.onStyleSheetFound((t=>{n.has(t.assetId)||(n.add(t.assetId),csArray.prototype.push.call(r,t))})),this.rg.stop(),this.rg.start()):(this.rg.stop(),fl.isWebViewLocalAssetsSupported()||es.warn("Local asset is not supported on this browser"));const o=function(){Zs(document).visitAll((t=>{var s;if(S(t)&&(null===(s=t.adoptedStyleSheets)||void 0===s?void 0:s.length)>0){const s=Ll(t.adoptedStyleSheets);Ae.setProperty(t,"styles",s)}}));return t=function(t,s){let e;return cn({...s,async:!1})(t,(t=>e=t)),e}(document),Ae.traverse(t,(t=>{if(11===t.nodeType){const s=Ae.getProperty(t,"styles");s&&(t.adoptedStyleSheets=s)}})),t;var t}(),h=csJSON.stringify(o);if(s){const t=wa.generate();return this.jg(e,r,t),csJSON.stringify({serializedDom:h,serializationId:t})}return h}jg(t,s,e){0===s.length?this.ag(t,e):this.Gg(t,s,e,((t,s)=>this.ag(t,s)))}Gg(t,s,e,i){let n=0,r=0;const o=new Set(csArray.prototype.map.call(t,(t=>t.assetId))),h=t=>!o.has(t),c=e=>{o.has(e.assetId)||(o.add(e.assetId),csArray.prototype.push.call(s,e),csArray.prototype.push.call(t,e))},a=h=>{for(const s of h)o.has(s.assetId)||(o.add(s.assetId),csArray.prototype.push.call(t,s));n++,n+r===s.length&&i(t,e)},u=o=>{r++,es.error("An error occurred while fetching a styleSheet: "+o),n+r===s.length&&i(t,e)};csArray.prototype.forEach.call(s,(t=>{this.hg.getStyleSheetAssets(t.assetId,a,u,h,c)}))}ag(t,s){this.Dw.sendToParent(Yt.Assets,{assets:t,serializationId:s})}}class Dl{constructor(t){this.L=t,this.Zg=null}isSdkTrackingContext(t){return _t(t)&&Et(t)&&yt(t.sessionKey)&>(t.pageNumber)&&yt(t.pageViewType)&&"boolean"==typeof t.isRecording}update(t){if(!this.isSdkTrackingContext(t))return es.warn(`webViewTrackingContext.service received wrong sdkTrackingContext, content:${csJSON.stringify(t)}`),void(this.Zg=null);this.Zg={...t,recordingConsentState:jr.NOT_NEEDED,projectId:this.L.projectId,uxaDomain:this.L.uxaDomain,...this.L.smbConfig}}getTrackingContext(){return this.Zg}}class Ul{constructor(t){this.Wg=t,this.Xc=[]}handleCommand(t){if(!Rt(t))return;this.ta(t);const s=this.Wg.getTrackingContext();null!==s&&this.sa(t,s)}executeRegisteredCallbacks(t){const s=t.trackingContext;s&&csArray.prototype.map.call(this.Xc,(t=>this.sa(t,s)))}ta(t){csArray.prototype.push.call(this.Xc,t)}sa(t,s){csSetTimeout((()=>{t(s)}))}}class Bl{constructor(t,s){this.oa=t,this.Wg=s}onIframeIntegrationCallback(t){const s=this.Wg.getTrackingContext();null!==s&&(t.trackingContext=s,this.oa.sendToChildren(Yt.IntegrationCallback,t))}}class Fl{constructor(t){this.commandsService=t,this.fa=new Xr}registerChildCommands(){this.commandsService.register(eo,(t=>this.fa.handleCommand(t,this.Jg)))}onParentRecordingStatusChange(t){this.Jg={isRecording:t.isRecording,recordingStartTimestamp:t.recordingStartTimestamp||0,etrState:t.etrState||Fe.ETR_OFF},this.fa.executeCallbacks(this.Jg)}}ys([kr()],Fl.prototype,"onParentRecordingStatusChange",null);const ql=["serializeWebView","webview:serializeWebView"],Hl=["setAssetTransformerMode","webview:setAssetTransformerMode"],zl=["webview:onAfterScreenView"];class jl extends Fl{constructor(t,s,e,i,n,r,o){super(t),this.commandsService=t,this.Dw=s,this.oa=e,this.Sg=i,this.Kg=n,this.aa=r,this.L=o}init(){this.Wg=new Dl(this.L),this.Yg=new Bl(this.oa,this.Wg),this.aa.addListener(this.Yg),this.Qg=new Ul(this.Wg);const t=new Al(new _l),s=new kn;this.Xg=new Ml(this.Dw,t,s),this.Yd()}onAfterPageViewCallback(t){this.Qg.executeRegisteredCallbacks(t)}Yd(){super.registerChildCommands(),this.commandsService.register(to,(t=>{this.Qg.handleCommand(t)})),this.commandsService.register(zl,(t=>{this.Wg.update(t);const s=this.Wg.getTrackingContext();null!==s&&this.Kg.emitAfterPageViewCallback({initiator:Jt.AfterPageView,trackingContext:s})})),this.commandsService.register(ql,(t=>this.Xg.handleCommand(t))),this.commandsService.register(Hl,(t=>{t!==kl&&t!==Ol&&t!==Nl||this.Sg.setAssetProcessingMode(t)}))}}class Gl{constructor(t){this.Dw=t,this.Xc={}}handleCommand(t){Rt(t)&&this.ta(t)}executeRegisteredCallbacks(t){const s=t.trackingContext;if(s)if(t.callbackId){const e=this.Xc[t.callbackId];e&&this.sa(e,s)}else for(const t in this.Xc)this.sa(this.Xc[t],s)}ta(t){const s=G.integer(),e={callbackId:s,initiator:Jt.AfterPageView};this.Xc[s]=t,this.Dw.sendToParent(Yt.IntegrationCallback,e)}sa(t,s){csSetTimeout((()=>{t(s)}))}}class Zl{constructor(t){this.Dw=t,this.ea={}}handleCommand(t){Et(t)&&Rt(t.callback)&&this.na(t.callback)}executePendingCallbacks(t){const{trackingContext:s,callbackId:e}=t;if(!e||!s)return;const i=this.ea[e];i&&(delete this.ea[e],this.sa(i,s.sessionKey))}na(t){const s=G.integer(),e={callbackId:s,initiator:Jt.GetSessionKey};this.ea[s]=t,this.Dw.sendToParent(Yt.IntegrationCallback,e)}sa(t,s){csSetTimeout((()=>{t(s)}))}}class Wl{constructor(t,s){this.Dw=t,this.oa=s,this.ty={}}handleCommand(t,s){Et(t)&&Rt(s)&&this.na(t,s)}executePendingCommand(t){const{trackingContext:s,callbackId:e}=t;if(e&&s)if(this.ty[e]){const[t,i]=this.ty[e];t&&(delete this.ty[e],this.sa(s,t,i))}else this.oa.sendToChildren(Yt.TrackingContextResultMessage,t)}na(t,s){const e=G.integer();this.ty[e]=[t,s],this.Dw.sendToParent(Yt.TrackingContextRequestMessage,{callbackId:e})}sa(t,s,e){csSetTimeout((()=>{const i=Yr(t,s);e(i)}))}}class Jl extends Fl{constructor(t,s,e){super(t),this.commandsService=t,this.Dw=s,this.oa=e}init(){this.sy=new Gl(this.Dw),this.ey=new Zl(this.Dw),this.iy=new Wl(this.Dw,this.oa),this.Yd()}onAfterPageViewCallback(t){this.sy.executeRegisteredCallbacks(t)}onIntegrationSessionKeyCallback(t){this.ey.executePendingCallbacks(t)}onTrackingContextResultCallback(t){this.iy.executePendingCommand(t)}Yd(){super.registerChildCommands(),this.commandsService.register(to,(t=>{this.sy.handleCommand(t)})),this.commandsService.register(so,(t=>this.ey.handleCommand(t))),this.commandsService.register(io,((t,s)=>{this.iy.handleCommand(t,s)}))}}class Kl{constructor(t,s,e){this.kc=t,this.Lp=s,this.Oc=e}init(){this.Yd(),this.Mp=new pa(this.Oc,this.Lp)}ny(){this.Mp.start()}Ee(){this.Mp.stop()}onParentSensitiveStatusChange(t){t.maskedElementSettings&&this.Lp.setMaskedElementSettingsFromParent(t.maskedElementSettings),t.capturedElementSelector&&Fn.setWhitelistedElementsSelector(t.capturedElementSelector),t.started?this.ny():this.Ee()}Yd(){this.kc.register(Br,(t=>{Fn.setWhitelistedElementsSelector(t)})),this.kc.register(la,(t=>{this.Lp.setMaskedElementSettingsFromCommand(t)}))}}class Yl{constructor(t,s,e,i,n){this.Jh=t,this.kc=s,this.Lp=e,this.Oc=i,this.Dc=n,this.Mp=new pa(this.Oc,this.Lp)}init(){this.Dc.init(),this.Yd()}onStartAnalytics(){this.Xp()}onAfterArtificialPageView(){this.oy(),this.Xp()}onStopAnalytics(){this.oy()}Xp(){this.Mp.start(),this.Jh.emitSensitiveStatusChange()}oy(){this.Mp.stop(),this.Jh.emitSensitiveStatusChange()}Yd(){this.kc.register(Br,(t=>{Fn.setWhitelistedElementsSelector(t),this.Jh.emitSensitiveStatusChange()})),this.kc.register(la,(t=>{this.Lp.setMaskedElementSettingsFromCommand(t),this.Jh.emitSensitiveStatusChange()}))}}class Ql{constructor(t,s,e,i,n,r,o,h,c){this.Yw=t,this.Jh=s,this.L=e,this.Dw=i,this.qw=n,this.kc=r,this.At=o,this.Gp=h,this.Hw=c,this.Jp=()=>{this.kc.start(),this.Yp.start()}}start(){let t,s,e,i,n,r,o,h,c,a,u;this.Gp.schedule((()=>{if(n=new Sc(this.L),r=new aa((()=>{})),this.At.isInIframeContext()){const t=new Kl(this.kc,n,r);t.init(),this.Yw.addListener(t)}if(e=new pt,a=new Uu(e),u=new pu(window.location,a),this.At.isInWebViewContext()){const t=new dl(this.L),s=new Yc,e=new Kc(t,this.L,u,s),i=new Yl(this.Jh,this.kc,n,r,e);i.init(),this.Yw.addListener(i)}})),this.Gp.schedule((()=>{t=new Bu(F,this.L),s=new tc(t),i=new ul(this.L,t,s,this.Dw,this.At,this.Yw,this.kc,new Oc(es),this.Hw),this.Yw.addListener(i)})),Lc.isRecordingSupported()&&this.Gp.schedule((()=>{const t=new Sl(this.L,e,r,this.Jh,this.Dw,this.qw,this.kc,this.Yw,this.At,u,this.Hw);this.Jh.addListener(t),this.Yw.addListener(t),t.init()})),this.Gp.schedule((()=>{c=new Pc(this.L);const s=new Fu(t),e=new qu(t),i=new Hu(t),n=new zu;h=new gu(s,e,i,n),o=new ol(c,h,this.Dw,this.qw,this.Hw)})),this.Gp.schedule((()=>{h.addListener(o),this.Yw.addListener(o),this.Jh.addListener(o),this.Jh.addListener(i)})),this.Gp.schedule((()=>{let t;if(this.At.isInWebViewContext()){const s=new $l;this.Sg=new xl(s),t=new jl(this.kc,this.Dw,c,this.Sg,this.Yw,h,this.L)}else t=new Jl(this.kc,this.Dw,c);this.Yw.addListener(t),t.init()})),this.Gp.schedule((()=>{o.init(),i.init()})),this.Gp.schedule((()=>{if(this.At.isInWebViewContext()){const t=new Il,s=new kc(e,u),i=new Cc(a),n=new Pl(u,s,i,e),r=new Vl(e,new fo(e,null,null),t,n,this.Sg,this.Jh,i,u),o=new Tl(this.Dw,r);o.init(),this.Jh.addListener(o),this.Yw.addListener(o)}else{const t=new rl(this.Dw);this.Jh.addListener(t)}})),this.Yp=new sc,this.Gp.schedule((()=>{this.Yp.onLoad((()=>{this.Jh.emitStartTracking()})),this.Jp()}))}}class Xl extends il{constructor(t,s=500){super(2500),this.Yw=t,this.hy=s,this.uy=!1,this.ly=void 0,this.py=!0}onStart(){this.vy()}onStop(){this.buffer.reset(),this.my&&window.clearInterval(this.my)}sendToParent(t,s){var e;if(this.wy())null===(e=this.gy)||void 0===e||e.call(this,t,s);else if(this.yy(t)){const e=this.buildChildBaseMessage(t,s);this.buffer.addMessage(e)}}wy(){return this.uy&&this.py}yy(t){return!this.uy||t===Yt.Commands}onWebViewEvent(t){this.gy=t}setAnalyticsStatus(t){this.py=t,this.py&&this.Ey()}sendAllMessagesFromBuffer(){var t;const s=this.buffer.getMessages();for(const e of s)null===(t=this.gy)||void 0===t||t.call(this,e.type,e.content);this.buffer.reset()}Ey(){var t;if(!this.uy)return;const s=this.buffer.getMessages();for(const e of s)e.type===Yt.Commands&&(null===(t=this.gy)||void 0===t||t.call(this,e.type,e.content));this.buffer.reset()}buildChildBaseMessage(t,s){return{type:t,content:s}}vy(){this.uy=bl.isCSJavascriptBridgeDefined(),this.uy?this.Ay():this.my=window.setInterval((()=>{this.uy=bl.isCSJavascriptBridgeDefined(),this.uy&&(this.Ay(),window.clearInterval(this.my))}),this.hy)}Ay(){this.ly=bl.getBridgeVersion(),null===this.ly?this.sendAllMessagesFromBuffer():this.ly>=2?(this._y(),bl.notifyIsReadyForTracking()):es.warn(`bridge version ${this.ly} is not supported`)}_y(){this.Yw.emitStopAnalytics()}}class td{constructor(){this.Ry=null}getRecordingStatus(){return null===this.Ry?{isRecording:!1}:this.Ry}setRecordingStatus(t){this.Ry=t}}class sd extends Ue{constructor(t,s){super(),this.xi=t,this.Dw=s}onStart(){this.xi.subscribe(sd.Rn,(t=>this.fn(t)))}onStop(){this.xi.unsubscribe(sd.Rn)}fn(t){this.isStarted&&this.Dw.sendToParent(Yt.ApiError,t)}}sd.Rn="ChildApiErrorsService";class ed extends Ue{constructor(t,s){super(),this.xi=t,this.Dw=s}onStart(){this.xi.subscribe(ed.Rn,(t=>this.fn(t)),{detailedEvent:!0})}onStop(){this.xi.unsubscribe(ed.Rn)}fn(t){this.isStarted&&this.Dw.sendToParent(Yt.DetailedApiError,t)}}ed.Rn="ChildDetailedApiErrorsService";class id{constructor(t,s,e){this.L=t,this.Dw=s,this.Mw=e}init(){var t;const s=new pt;let e;e=(null===(t=this.L.apiErrors.collectionRules)||void 0===t?void 0:t.length)?new ha(this.L.apiErrors,s):new ca(this.L.apiErrors,s),this.xi=new Vc(new Xc,new ta,e),this.Sy=new sd(this.xi,this.Dw),this.Ty=new ed(this.xi,this.Dw),this.xi.init(),this.Yd()}Yd(){this.Mw.register(Dc)}onStartTracking(){this.Sy.start()}onParentRecordingStatusChange(t){t.isRecording?this.Ty.start():this.Ty.stop()}onOptout(){this.Sy.stop(),this.Ty.stop()}onStartAnalytics(){this.Sy.start()}onStopAnalytics(){this.Sy.stop()}}class nd extends Ue{constructor(t,s){super(),this.Qd=t,this.Dw=s}onStart(){this.Qd.subscribe(nd.Rn,(t=>this.fn(t)))}onStop(){this.Qd.unsubscribe(nd.Rn)}fn(t){this.isStarted&&this.Dw.sendToParent(Yt.JavascriptError,t)}}nd.Rn="ChildJavaScriptErrorsService";class rd{constructor(t,s,e){this.L=t,this.Dw=s,this.Mw=e}init(){const t=new _c;this.Iy=new nd(t,this.Dw),this.Yd()}onStartTracking(){this.Iy.start()}onOptout(){this.Iy.stop()}onStartAnalytics(){this.Iy.start()}onStopAnalytics(){this.Iy.stop()}Yd(){this.L.jsCustomErrorsEnabled&&!this.L.customErrors.enabled&&this.Mw.register(Fc)}}class od{constructor(t,s,e){this.L=t,this.Dw=s,this.Mw=e}init(){this.Yd()}onStartTracking(){var t;null===(t=this.Py)||void 0===t||t.start()}onOptout(){var t;null===(t=this.Py)||void 0===t||t.stop()}onStartAnalytics(){var t;null===(t=this.Py)||void 0===t||t.start()}onStopAnalytics(){var t;null===(t=this.Py)||void 0===t||t.stop()}Yd(){this.Mw.register(Fc)}}class hd{constructor(){this.by={started:!1,useAnonymization:!0}}getSensitiveStatus(){return this.by}setSensitiveStatus(t){this.by=t}getElementSensitiveStatus(t){return this.by.started?Oe.isMaskedElement(t)||Oe.isMaskedElementChild(t)?Nh.MASKED:this.by.useAnonymization?Fn.isWhitelisted(t)?Nh.CAPTURED:Nh.ANONYMIZED:Nh.CAPTURED:Nh.ANONYMIZED}}class cd{constructor(t,s,e){this.L=t,this.At=s,this.Gp=e}init(){let t,s,e,i,n,r,o,h;vc.isSupported()&&vc.setDigestSalt(this.L.projectId.toString()),this.Gp.schedule((()=>{t=new Ca(this.Gp),s=new Qu,e=new td,i=new hd;const o=[hu.UXA];this.At.isInWebViewContext()?(window.cs_wvt=window.cs_wvt||[],csArray.prototype.push.call(o,hu.WVT),n=new Xl(s)):n=new nl(this.L,t,e,i,s),r=new au(o)})),this.Gp.schedule((()=>{o=new sl(r,n),h=new tl(o)})),this.Gp.schedule((()=>{h.init()})),this.Gp.schedule((()=>{0})),this.Gp.schedule((()=>{if(this.L.apiErrors.enabled){const e=new id(this.L,n,o);e.init(),t.addListener(e),s.addListener(e)}if(this.L.jsErrorsEnabled){const e=new rd(this.L,n,o);e.init(),t.addListener(e),s.addListener(e)}if(this.L.customErrors.enabled){const e=new od(this.L,n,o);e.init(),t.addListener(e),s.addListener(e)}})),this.Gp.schedule((()=>{t.addListener(h)})),this.Gp.schedule((()=>{t.emitInitTracking()})),this.Gp.schedule((()=>{new Ql(s,t,this.L,n,e,r,this.At,this.Gp,i).start()}))}}class ad{constructor(t,s=30,e=0){this.Vy=t,this.Cy=s,this.ky=e,this.Oy=new cs,this.Y=!1,this.Ny=0,this.xy=()=>{for(this.Ny=0;this.Oy.length;){if(this.Ny>=this.Cy)return void csSetTimeout(this.xy,this.ky);const t=It.now(),s=this.Oy.pop();if(!s)break;this.runTask(s);const e=It.now()-t;this.Ny+=e}this.Y=!1}}schedule(t,s=!1){this.Vy&&!s?(ei.general.pendingTasks.increase(),this.Oy.push(t),this.$y()):t()}$y(){this.Y||(this.Y=!0,csSetTimeout((()=>{this.xy()})))}runTask(t){ei.general.pendingTasks.decrease(),t()}runPendingTasks(){this.Oy.forEach((t=>{this.runTask(t)})),this.Oy.clear()}clearQueue(){ei.general.pendingTasks.clear(),ei.mutations.pendingMutations.clear(),this.Oy.clear()}isEmpty(){return 0===this.Oy.length}}ys([ns("TaskScheduler"),gs("runTask")],ad.prototype,"runTask",null),ys([gs("runPendingTasks")],ad.prototype,"runPendingTasks",null);class ud{constructor(t,s,e){this.L=t,this.At=s,this.D=e}start(){var t,s,e,i,n;if(window.UXAnalytics)return;window.UXAnalytics={},window.CSCurrentScript=document.currentScript;const r=new ad(!!(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===(e=this.L.taskSchedulerOptions)||void 0===e?void 0:e.waitDuration),o=new Is(this.At,this.L);o.init();const h=new Ps(this.L,o);if(this.At.isTopWindowTracker()&&h.canTrack()){if((null===(i=window.CSProtectnativeFunctionsLogs)||void 0===i?void 0:i.Warning)&&es.warn(`protectNativeFunctions failed: ${window.CSProtectnativeFunctionsLogs.Warning}`),null===(n=window.CSProtectnativeFunctionsLogs)||void 0===n?void 0:n.Critical)return void es.error(`protectNativeFunctions failed: ${window.CSProtectnativeFunctionsLogs.Critical}`);new Wu(this.L,o,this.D,r).init()}else if(!this.At.isTopWindowTracker()&&h.canTrackInChild()){new cd(this.L,this.At,r).init()}window.UXAnalytics={Sensitive:{isNodeSensitive:t=>Oe.isMaskedElement(t)||Oe.isMaskedElementChild(t),isAttributeSensitive:(t,s)=>Oe.isMaskedAttribute(t,s),getSensitiveAttributes:t=>Ds(t.attributes,(s=>Oe.isMaskedAttribute(t,s.name)))}},!window.CSFrameCommunication&&Yu.isActivable()&&(window.CSFrameCommunication=Yu,Yu.waitForConnection())}}ys([gs("main.start"),ns("main.start")],ud.prototype,"start",null);class ld{constructor(){}send(t,s,e=Y.warn){const i={message:t,errorCode:s,level:e};bl.sendLog(i)}}try{const t=new J(window.CS_CONF);window._uxa=window._uxa||[],t.processOptionOverrides(window._uxa);const s=new K(window,t);s.init();const e=new ts;if(is=es,os=!0,es.computeIsActive(t.validationRate),s.isTopWindowTracker()){const s=new Mt(t,e);es.setStrategy(s)}else if(s.isInIframeContext()){const s=new Xt(t);es.setStrategy(s)}else if(s.isInWebViewContext()){const t=new ld;es.setStrategy(t)}!function(t=50,s=.1){ls=is.isPerfLoggingActive()&&function(){var t;if(!(null===(t=window.performance)||void 0===t?void 0:t.mark))return!1;const s="isPerformanceMeasureSupported",e=`${s}_a`;return performance.mark(e),void 0!==performance.measure(s,e)}(),ls&&(as=t,us=s)}();new ud(t,s,e).start()}catch{}})();