var MicrosoftClarity_RS=function(e){"use strict";const t={LOG:{value:0,method:console.log},INFO:{value:1,method:console.info},DEBUG:{value:2,method:console.debug},WARN:{value:3,method:console.warn},ERROR:{value:4,method:console.error}};const o=new class{constructor(e,o){this.level=+o||t.ERROR.value,this.scope=e||""}setLogLevel(e){if(e&&"string"==typeof e){const o=e.toUpperCase();this.level=t[o]?t[o].value:this.level}}setScope(e){this.scope=e||this.scope}log(...e){this.logBase(e,t.LOG.value)}info(...e){this.logBase(e,t.INFO.value)}debug(...e){this.logBase(e,t.DEBUG.value)}warn(...e){this.logBase(e,t.WARN.value)}error(...e){this.logBase(e,t.ERROR.value)}logBase(e,o){if(this.level<=o){Object.values(t).find((e=>e.value===o)).method(...this.getLogData(e))}}getLogData(e){if(Array.isArray(e)&&e.length>0){let t="%c RS SDK";this.scope&&(t=`${t} - ${this.scope}`);t=`${t} %c ${e[0].trim()}`;const o=[];return o.push(t),o.push("font-weight: bold; background: black; color: white;"),o.push("font-weight: normal;"),o.push(...e.slice(1)),o}return e}}("Microsoft Clarity");return e.MicrosoftClarity=class{constructor(e,t,s){t.logLevel&&o.setLogLevel(t.logLevel),this.analytics=t,this.name="MICROSOFT_CLARITY",this.projectId=e.projectId,this.cookieConsent=e.cookieConsent,({shouldApplyDeviceModeTransformation:this.shouldApplyDeviceModeTransformation,propagateEventsUntransformedOnError:this.propagateEventsUntransformedOnError,destinationId:this.destinationId}=null!=s?s:{})}loadScript(){var e,t,o,s,i,r,n,a,l;e=this.cookieConsent,t=this.projectId,o=window,s=document,r="script",n=t,o[i="clarity"]=o[i]||function(){(o[i].q=o[i].q||[]).push(arguments)},(a=s.createElement(r)).async=1,a.src="https://www.clarity.ms/tag/"+n,a.setAttribute("data-loader","RS_JS_SDK"),(l=s.getElementsByTagName(r)[0]).parentNode.insertBefore(a,l),e&&window.clarity("consent")}init(){this.loadScript()}isLoaded(){return!!window.clarity&&!window.clarity.q}isReady(){return this.isLoaded()}identify(e){var t;const{message:s}=e,{userId:i,context:r}=s;if(!i)return void o.error("userId is required for an identify call");let n,a;null!=r&&r.sessionId&&(n=r.sessionId),null!=r&&null!==(t=r.traits)&&void 0!==t&&t.customPageId&&(a=r.traits.customPageId);const l=window.clarity("identify",i,n,a);if("function"==typeof(null==l?void 0:l.then)&&l.catch((e=>{o.error('The "identify" promise was rejected',e)})),null!=r&&r.traits){const{traits:e}=r;Object.keys(e).forEach((t=>{window.clarity("set",t,e[t])}))}}},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({}); //# sourceMappingURL=MicrosoftClarity.min.js.map