(()=>{var G=Object.defineProperty,r=(e,t,r)=>(r=r,(t="symbol"!=typeof t?t+"":t)in(e=e)?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r),B=null!=(H=null==console?void 0:console.log)&&H.bind?console.log.bind(console):()=>{},M={},i=class i{constructor(e){this.serviceName=e}static forComponent(e){let t=M[e];return t||(t=new i(e),M[e]=t),t}log(e,t,r,a,n){let s;if(t&&!i.showDebugLogs){if(1<e)return;s=""}else s=" "+r;n?B("%c [UTS] ["+i.scriptId+"] ["+this.serviceName+"]"+s,"color: "+a+";",n):B("%c [UTS] ["+i.scriptId+"] ["+this.serviceName+"]"+s,"color: "+a+";")}info(e,t){this.log(2,t,""+e,"green")}warn(e,t,r){this.log(1,t,e,"#ff9966",r)}error(e,t,r){this.log(0,t,e,"red",r)}debugInfo(e){this.info(e,!0)}debugWarn(e,t){this.warn(e,!0,t)}debugError(e,t){this.error(e,!0,t)}debugObject(e,t){i.showDebugLogs&&this.log(2,!0,e,"green",t)}},a=(r(i,"showDebugLogs",!1),r(i,"scriptId",""),i),e=null,H=!1;function o(){if(e)return e;throw new Error("[EnvContext] Environment not initialized. Call initEnv() before using getEnv(). This usually means the entrypoint did not initialize the environment.")}var i=class{async get(e){var e=("; "+document.cookie).split("; "+e+"=");return 2===e.length&&null!=(e=null==(e=e.pop())?void 0:e.split(";").shift())?e:null}async set(e,t,r){e=[encodeURIComponent(e)+"="+encodeURIComponent(t)];null!=r&&r.expires&&e.push("expires="+r.expires.toUTCString()),void 0!==(null==r?void 0:r.maxAge)&&e.push("max-age="+r.maxAge),e.push("path="+((null==r?void 0:r.path)||"/")),null!=r&&r.domain&&e.push("domain="+r.domain),null!=r&&r.secure&&e.push("secure"),null!=r&&r.sameSite&&e.push("samesite="+r.sameSite),document.cookie=e.join("; ")}async delete(e){document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}async getAll(){let r={};return document.cookie&&document.cookie.split("; ").forEach(e=>{var[e,...t]=e.split("=");e&&(t=t.join("="),r[decodeURIComponent(e)]=decodeURIComponent(t))}),r}async exists(e){return null!==await this.get(e)}async getByPattern(e){var e=document.cookie.match(e);return e&&0<e.length&&null!=(e=e.pop())?e:null}},x=class{constructor(){r(this,"logger",a.forComponent("lc")),r(this,"cachedHref"),r(this,"cachedDocumentUrl"),r(this,"cachedReferrer"),r(this,"useCachedValues",!1),this.cachedHref=window.location.href,this.cachedDocumentUrl=document.URL,this.cachedReferrer=document.referrer}enableCachedValues(){this.useCachedValues=!0}get href(){return this.useCachedValues?this.cachedHref:window.location.href}get origin(){return window.location.origin}get pathname(){return window.location.pathname}get search(){return(this.useCachedValues?new URL(this.cachedHref):window.location).search}get hash(){return window.location.hash}get hostname(){return window.location.hostname}get referrer(){return this.useCachedValues?this.cachedReferrer:document.referrer}replaceState(e){try{this.enableCachedValues(),history.replaceState({},document.title,e)}catch(e){this.logger.debugWarn("replaceState failed:",e)}}getUrlParam(e,t=!0,r){r=r||this.href,e=e.replace(/[[\]]/g,"\\$&").replace(/ /g,"\\+"),e=new RegExp("[\\?&]"+e+'=([^&#,"]*)').exec(r);if(!e||!e[1])return null;let a=e[1];return a=t?this.decodeUrlParam(a):a}getAllUrlParams(t){t=t||this.href;let r={};try{new URL(t,window.location.origin).searchParams.forEach((e,t)=>{r[t]=e})}catch(e){(t.split("?")[1]||"").split("&").forEach(e=>{var[e,t]=e.split("=");e&&(r[decodeURIComponent(e)]=decodeURIComponent(t||""))})}return r}getUrlParams(r,t){t=t||this.href;let a=[];try{new URL(t,window.location.origin).searchParams.getAll(r).forEach(e=>{a.push(e)})}catch(e){(t.split("?")[1]||"").split("&").forEach(e=>{var[e,t]=e.split("=");e===r&&a.push(decodeURIComponent(t||""))})}return a}parseUrl(t){try{var r=new URL(t,window.location.origin);return{href:r.href,origin:r.origin,pathname:r.pathname,search:r.search,hash:r.hash,hostname:r.hostname,port:r.port,protocol:r.protocol}}catch(e){return{href:t,origin:"",pathname:t.split("?")[0],search:t.includes("?")?"?"+(null==(r=t.split("?")[1])?void 0:r.split("#")[0]):"",hash:t.includes("#")?"#"+t.split("#")[1]:"",hostname:"",port:"",protocol:""}}}buildUrl(e,t){if(!t||0===Object.keys(t).length)return e;let r=new URLSearchParams;Object.entries(t).forEach(([e,t])=>{null!=t&&r.append(e,t)});t=e.includes("?")?"&":"?";return e+t+r.toString()}getPreviousUrl(){var e=this.useCachedValues?this.cachedDocumentUrl:document.URL;if(!e||"about:blank"===e||"about:srcdoc"===e)try{return parent.document?parent.document.URL:this.referrer}catch(e){}return this.referrer}getReferrerUrl(){var e=this.useCachedValues?this.cachedDocumentUrl:document.URL;let t;if(e&&"about:blank"!==e&&"about:srcdoc"!==e)t=e;else try{t=parent.document?parent.document.URL:this.referrer}catch(e){t=this.referrer}return this.isEncoded(t)?t:encodeURI(t)}decodeUrlParam(e){if(!e)return e;let t=e,r="";for(;t!==r;){r=t;try{t=decodeURIComponent(r)}catch(e){return r}}return t}isEncoded(e){if(!e)return!1;try{return e!==decodeURIComponent(e)}catch(e){return!0}}},V=class{constructor(){r(this,"logger",a.forComponent("s_c")),r(this,"session",{get:async e=>{try{return sessionStorage.getItem(e)}catch(e){return null}},set:async(t,e)=>{try{sessionStorage.setItem(t,e)}catch(e){this.logger.debugWarn("[session] Error setting key:",{key:t,error:e})}},remove:async t=>{try{sessionStorage.removeItem(t)}catch(e){this.logger.debugWarn("[session] Error removing key:",{key:t,error:e})}},clear:async()=>{try{sessionStorage.clear()}catch(e){this.logger.debugWarn("[session] Error clearing storage:",e)}},has:async e=>{try{return null!==sessionStorage.getItem(e)}catch(e){return!1}},keys:async()=>{try{var t=[];for(let e=0;e<sessionStorage.length;e++){var r=sessionStorage.key(e);r&&t.push(r)}return t}catch(e){return[]}}})}async get(t){try{return localStorage.getItem(t)}catch(e){return this.logger.debugWarn("Error getting key:",{key:t,error:e}),null}}async set(t,e){try{localStorage.setItem(t,e)}catch(e){this.logger.debugWarn("Error setting key:",{key:t,error:e})}}async remove(t){try{localStorage.removeItem(t)}catch(e){this.logger.debugWarn("Error removing key:",{key:t,error:e})}}async clear(){try{localStorage.clear()}catch(e){this.logger.debugWarn("Error clearing storage:",e)}}async has(e){try{return null!==localStorage.getItem(e)}catch(e){return!1}}async keys(){try{var t=[];for(let e=0;e<localStorage.length;e++){var r=localStorage.key(e);r&&t.push(r)}return t}catch(e){return this.logger.debugWarn("Error getting keys:",e),[]}}async getAll(){try{var t={};for(let e=0;e<localStorage.length;e++){var r,a=localStorage.key(e);a&&null!==(r=localStorage.getItem(a))&&(t[a]=r)}return t}catch(e){return this.logger.debugWarn("Error getting all items:",e),{}}}async getJson(t){var e=await this.get(t);if(!e)return null;try{return JSON.parse(e)}catch(e){return this.logger.debugWarn("Error parsing JSON for key:",{key:t,error:e}),null}}async setJson(t,e){try{await this.set(t,JSON.stringify(e))}catch(e){this.logger.debugWarn("Error stringifying JSON for key:",{key:t,error:e})}}async removeByPrefix(t){try{var e,r=(await this.keys()).filter(e=>e.startsWith(t));for(e of r)await this.remove(e);return r.length}catch(e){return this.logger.debugWarn("Error removing by prefix:",{prefix:t,error:e}),0}}async getSize(){try{let r=0;var e=await this.getAll(),t=Object.keys(e).length;return Object.entries(e).forEach(([e,t])=>{r+=2*(e.length+t.length)}),{count:t,bytes:r}}catch(e){return{count:0,bytes:0}}}},K=class{constructor(){r(this,"logger",a.forComponent("p_c")),r(this,"observers",[])}getEntriesByType(e){try{return performance.getEntriesByType(e).map(e=>this.mapEntry(e))}catch(e){return this.logger.debugWarn("getEntriesByType failed:",e),[]}}getEntriesByName(e,t){try{return(t?performance.getEntriesByName(e,t):performance.getEntriesByName(e)).map(e=>this.mapEntry(e))}catch(e){return this.logger.debugWarn("getEntriesByName failed:",e),[]}}observe(e,r){try{let t=new PerformanceObserver(e=>{var t=e.getEntries().map(e=>this.mapEntry(e)),e=null!=(e=e.droppedEntriesCount)?e:0;r(t,e)});return this.performSafeObserve(t,e),this.observers.push(t),()=>{t.disconnect();var e=this.observers.indexOf(t);-1<e&&this.observers.splice(e,1)}}catch(e){return this.logger.debugWarn("observe failed:",e),()=>{}}}performSafeObserve(t,r){try{t.observe({type:r.type,buffered:r.buffered})}catch(e){if(!(e instanceof TypeError&&e.message.includes("entryTypes")))throw e;t.observe({entryTypes:[r.type]})}}now(){return performance.now()}getNavigationEntries(){try{return performance.getEntriesByType("navigation").map(e=>this.mapNavigationEntry(e))}catch(e){return this.logger.debugWarn("getNavigationEntries failed:",e),[]}}isObserverSupported(){return"undefined"!=typeof PerformanceObserver}isEntryTypeSupported(e){try{return PerformanceObserver.supportedEntryTypes?PerformanceObserver.supportedEntryTypes.includes(e):!0}catch(e){return!0}}mark(e){try{performance.mark(e)}catch(e){this.logger.debugWarn("mark failed:",e)}}measure(e,t,r){try{r?performance.measure(e,t,r):performance.measure(e,t)}catch(e){this.logger.debugWarn("measure failed:",e)}}clearEntries(e,t){try{t&&e?"mark"===e?performance.clearMarks(t):"measure"===e&&performance.clearMeasures(t):e&&("mark"===e?performance.clearMarks():"measure"===e?performance.clearMeasures():"resource"===e&&performance.clearResourceTimings&&performance.clearResourceTimings())}catch(e){this.logger.debugWarn("clearEntries failed:",e)}}mapEntry(e){return{name:e.name,entryType:e.entryType,startTime:e.startTime,duration:e.duration,initiatorType:e.initiatorType,decodedBodySize:e.decodedBodySize,encodedBodySize:e.encodedBodySize,transferSize:e.transferSize,nextHopProtocol:e.nextHopProtocol,responseStatus:e.responseStatus}}mapNavigationEntry(e){return{name:e.name,entryType:e.entryType,startTime:e.startTime,duration:e.duration,initiatorType:e.initiatorType,type:e.type,redirectCount:e.redirectCount,domInteractive:e.domInteractive,domContentLoadedEventEnd:e.domContentLoadedEventEnd,loadEventEnd:e.loadEventEnd}}},W=class{constructor(){r(this,"originalSendBeacon",null),r(this,"intercepting",!1),r(this,"logger",a.forComponent("bc")),r(this,"genericCallbacks",new Set)}startIntercepting(){this.intercepting||(this.originalSendBeacon=navigator.sendBeacon.bind(navigator),navigator.sendBeacon=(e,t)=>{try{this.processBeacon(e,t)}catch(e){}return this.originalSendBeacon(e,t)},this.intercepting=!0)}stopIntercepting(){this.intercepting&&this.originalSendBeacon&&(navigator.sendBeacon=this.originalSendBeacon,this.originalSendBeacon=null,this.intercepting=!1)}isIntercepting(){return this.intercepting}onBeacon(e){return this.genericCallbacks.add(e),()=>{this.genericCallbacks.delete(e)}}sendBeacon(e,t){return(this.originalSendBeacon||navigator.sendBeacon.bind(navigator))(e,"string"==typeof t?t:JSON.stringify(t))}processBeacon(e,t){var r=Date.now();let a;if(t)try{var n="string"==typeof t?t:t.toString();a=JSON.parse(n)}catch(e){}let s={url:e,rawData:t,parsedData:a,timestamp:r};this.genericCallbacks.forEach(e=>{try{e(s)}catch(e){this.logger.debugWarn("Generic callback error:",e)}})}};function q(e){if(!e)return e;try{return JSON.parse(e)}catch{return e}}var j=class{constructor(){r(this,"kind","xhr")}supports(){return"undefined"!=typeof XMLHttpRequest}execute(i){return new Promise(t=>{var r,a;try{let e=new XMLHttpRequest;e.open(i.method,i.url,!0),e.withCredentials=null!=(r=i.withCredentials)&&r,void 0!==i.timeout&&(e.timeout=i.timeout);for(var[n,s]of Object.entries(null!=(a=i.headers)?a:{}))e.setRequestHeader(n,s);e.onload=()=>t({type:"http-response",status:e.status,rawBody:e.responseText,data:q(e.responseText),headers:(e=>{var t,r={};for(t of e.trim().split(/[\r\n]+/)){var a,n=t.indexOf(":");-1!==n&&(a=t.slice(0,n).trim().toLowerCase(),n=t.slice(n+1).trim(),r[a]=n)}return r})(e.getAllResponseHeaders())}),e.onerror=()=>t({type:"transport-error",message:"xhr request failed"}),e.ontimeout=()=>t({type:"transport-error",message:"xhr request timed out"}),e.send(i.body)}catch(e){t({type:"transport-error",message:"xhr threw synchronously",cause:e})}})}};async function z(t,e,r){let a=new AbortController;var n=void 0!==e.timeout?setTimeout(()=>a.abort(),e.timeout):void 0;try{var s=await fetch(e.url,{...r,method:e.method,headers:e.headers,body:e.body,credentials:e.withCredentials?"include":"same-origin",signal:a.signal}),i=await s.text();return{type:"http-response",status:s.status,rawBody:i,data:q(i),headers:(e=>{let r={};return e.forEach((e,t)=>{r[t.toLowerCase()]=e}),r})(s.headers)}}catch(e){return{type:"transport-error",message:a.signal.aborted?t+" request timed out":t+" request failed",cause:e}}finally{void 0!==n&&clearTimeout(n)}}var Y=class{constructor(){r(this,"kind","fetch")}supports(){return"function"==typeof fetch}execute(e){return z(this.kind,e,{})}};function J(e,t=65536){return(null!=(e=null==(e=e.body)?void 0:e.length)?e:0)>t}var $=class{constructor(){r(this,"kind","fetchKeepAlive")}supports(e){return"function"==typeof fetch&&!J(e)}execute(e){return z(this.kind,e,{keepalive:!0})}},X=class{constructor(){r(this,"kind","sendBeacon")}supports(e){return"function"==typeof(null==navigator?void 0:navigator.sendBeacon)&&!J(e)}async execute(e){var t;try{return navigator.sendBeacon(e.url,null!=(t=e.body)?t:"")?{type:"beacon-queued"}:{type:"transport-error",message:"sendBeacon rejected the payload"}}catch(e){return{type:"transport-error",message:"sendBeacon threw synchronously",cause:e}}}};var Z=class{constructor(e){this.registry=e}async execute(e,t){let r,a,n,s=!1;for(var i of t){var o=this.registry.get(i);if(null!=o&&o.supports(e)){s=!0;var l,c,o=await o.execute(e);if("http-response"===o.type)return l=o.status,c=o.rawBody,d=l,u=e.acceptedStatusCodes,200<=d&&d<300||null!=(u=null==u?void 0:u.includes(d))&&u?{ok:!0,type:"response",response:{status:l,rawBody:c,data:o.data,headers:null!=(r=o.headers)?r:{},transport:i}}:{ok:!1,error:{type:"response-error",transport:i,status:l,rawBody:c}};if("beacon-queued"===o.type)return{ok:!0,type:"beacon-queued",transport:"sendBeacon"};n={type:"transport-error",transport:i,message:null!=(a=o.message)?a:"transport failed",cause:o.cause}}}var d,u;return{ok:!1,error:null!=n?n:{type:"transport-error",transport:t[0],message:s?"transport chain exhausted":"no transport in chain supports this request"}}}},Q=class{constructor(e,t){this.rules=e,this.defaultTransports=t}resolve(t){var e=this.rules.find(e=>this.matches(e,t));return{transports:null!=(e=null==e?void 0:e.transports)?e:this.defaultTransports[t.method]}}matches(e,t){return!(e.methods&&!e.methods.includes(t.method))&&this.matchesPath(e.path,t.pathname)}matchesPath(e,t){return"string"==typeof e?t===e:e instanceof RegExp?e.test(t):e(t)}},ee=class{constructor(e,t,r,a,n,s,i){this.baseUrl=e,this.resolver=t,this.executor=r,this.fireAndForgetTransports=a,this.defaultHeaders=n,this.defaultParams=s,this.defaultTimeout=i}get(e,t){return this.send("GET",e,void 0,t)}post(e,t,r){return this.send("POST",e,t,r)}put(e,t,r){return this.send("PUT",e,t,r)}patch(e,t,r){return this.send("PATCH",e,t,r)}fireAndForget(e,t,r){e=this.buildRequest("POST",e,t,r);return this.executor.execute(e,this.fireAndForgetTransports)}send(e,t,r,a){e=this.buildRequest(e,t,r,a),t=this.resolver.resolve(e);return this.executor.execute(e,t.transports)}buildRequest(e,t,r,a){var n,s,t=t.startsWith("/")?t.slice(1):t,i=new URL(t,this.baseUrl),o=i.searchParams;for([n,s]of Object.entries(this.defaultParams))o.set(n,s);return{method:e,url:i.toString(),pathname:"/"+t.split("?")[0],headers:{...this.defaultHeaders,...null==a?void 0:a.headers},body:void 0===r?void 0:JSON.stringify(r),withCredentials:null==a?void 0:a.withCredentials,timeout:null!=(e=null==a?void 0:a.timeout)?e:this.defaultTimeout,acceptedStatusCodes:null==a?void 0:a.acceptedStatusCodes}}};var te=(e=>(e.TRACKING_URL="https://hy.benzinga.com/v1/lst",e.FRONTEND_URL="https://app.hyros.com",e.LEAD_GEN_URL="https://lg.hyr.so/v1/lst",e.ORIGIN="REGULAR",e.PRODUCT_HASH="7593c3f33de6d45f5f44ba8a8675f9cd36f6bdd0805cd3a313da557f724052e0",e.CUSTOM_TAG="\!clicked",e.SESSION_ID="",e.PREVIOUS_OVERRIDE="",e.REFERER_OVERRIDE="",e.CALL_TRACKING_POOL_HASH="",e.FINGERPRINT_SCRIPT="",e.DEVICE_FINGERPRINT="dvfp",e.THIRD_PARTY_TRACKING_PROVIDER="bdex-pixel",e.DISABLE_PARAM_TRACKING="",e.DEFAULT_SERVER_PARAMS="",e.INTERACT_TRACKERS_LIST="",e))({}),re=(e=>(e.PRODUCT_ID=208686,e))({}),ae=(e=>(e.SPA_ENABLED=false,e.IGNORE_PREVIOUS_URL=false,e.EMBED_SCRIPTS_ON_IFRAME=false,e.CALL_TRACKING_ENABLED=false,e.FINGERPRINT_ENABLED=false,e.FETCH_KEEP_ALIVE_ENABLED=true,e.SHOPIFY_POST_PURCHASE_ENABLED=false,e.NO_SWAP_NUMBERS_ENABLED=false,e.DELETE_TRACKING_PARAMS_ENABLED=false,e.FB_EVENT_ID_RETRIEVAL=false,e.PHONE_OPT_IN_ENABLED=true,e.TIME_SPENT_TRACKING=true,e.THIRD_PARTY_TRACKING=false,e.UNIFIED_CLICK_EVENT=false,e))({}),s=(()=>{var e=[...Object.keys(ae),...Object.keys(te),...Object.keys(re)];let t={};return e.forEach(e=>{e in ae?t[e]=ae[e]:e in te?t[e]=te[e]:e in re&&(t[e]=re[e])}),t})(),l=class{constructor(){}},n=(r(l,"id",s.PRODUCT_ID),r(l,"hash",s.PRODUCT_HASH),class{static get processClickWithBase(){return this.trackingBase+this.processClick}static get generateUUIDWithBase(){return this.trackingBase+this.generateUUID}static get generateLeadGenSessionIdWithBase(){return this.leadGenBase+this.generateLeadGenSessionId}static get matchingTriggerWithBase(){return this.trackingBase+this.matchingTrigger}}),c=(r(n,"trackingBase",s.TRACKING_URL),r(n,"leadGenBase",s.LEAD_GEN_URL),r(n,"processClick","/pc"),r(n,"generateUUID","/gusid"),r(n,"errorEndpoint","/error"),r(n,"unifiedEvent","/hte"),r(n,"clickUpdate","/pcu"),r(n,"pingPongRequest","/../sv"),r(n,"customActionProcessing","/cap"),r(n,"dniRequest","/cte"),r(n,"matchingTrigger","/tpten"),r(n,"generateLeadGenSessionId","/session"),class{static get href(){return o().location.href}static get documentUrl(){return o().location.href}static get documentReferrer(){return o().location.referrer}constructor(){}}),ne=(r(c,"product",l),r(c,"config",null),r(c,"endpoints",n),r(c,"shopHref",""),{"Access-Control-Allow-Headers":"*","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8"}),se=class{constructor(e){var t;r(this,"trackingBaseUrl"),r(this,"leadGenBaseUrl"),r(this,"defaultTimeout"),r(this,"defaultHeaders"),r(this,"logger",a.forComponent("hc")),r(this,"supportedTransportsCandidates",new Map([["xhr",new j],["fetch",new Y],["fetchKeepAlive",new $],["sendBeacon",new X]])),this.trackingBaseUrl=e.trackingBaseUrl||"",this.leadGenBaseUrl=e.leadGenBaseUrl||"",this.defaultTimeout=null!=(t=e.defaultTimeout)?t:3e4,this.defaultHeaders={...ne,...e.defaultHeaders}}createDefaultHttpClient(e){return this.createHttpClient({baseUrl:e,transportFallbackConfig:{GET:c.config.useFetchKeepAlive?["fetchKeepAlive","xhr","fetch"]:["xhr","fetch"],POST:["xhr","fetch"],PUT:["xhr","fetch"],PATCH:["xhr","fetch"],fireAndForget:c.config.useFetchKeepAlive?["fetchKeepAlive","sendBeacon"]:["sendBeacon"]},defaultParams:c.config.defaultServerParams})}createHttpClient(i){{var o=this.supportedTransportsCandidates;let e,t,r,a,{fireAndForget:n,...s}=i.transportFallbackConfig;var l,c=new Q(null!=(e=i.fallbackPolicies)?e:[],s),o=new Z(o);return new ee((l=i.baseUrl).endsWith("/")?l:l+"/",c,o,n,null!=(t=i.defaultHeaders)?t:{},null!=(r=i.defaultParams)?r:{},null!=(a=i.defaultTimeout)?a:3e4)}}async get(e,t){return this.xhrRequest("GET",e,null,t)}async post(e,t,r){return this.xhrRequest("POST",e,t,r)}async put(e,t,r){return this.xhrRequest("PUT",e,t,r)}sendBeacon(e,t){try{var r=this.resolveUrl(e),a="string"==typeof t?t:JSON.stringify(t);return navigator.sendBeacon(r,a)}catch(e){return this.logger.debugWarn("sendBeacon failed:",e),!1}}async keepAliveFetch(e,t,r,a){e=this.resolveUrl(e),a={method:t,headers:this.mergeHeadersAsObject(null==a?void 0:a.headers),credentials:!1!==(null==a?void 0:a.withCredentials)?"include":"omit",keepalive:!0};"GET"!==t&&void 0!==r&&(a.body="string"==typeof r?r:JSON.stringify(r));try{var n=await fetch(e,a);return this.parseFetchResponse(n)}catch(e){throw new Error("[WebHttp] keepAliveFetch failed: "+e)}}getTrackingUrl(e){return this.trackingBaseUrl+e}getLeadGenUrl(e){return this.leadGenBaseUrl+e}createSessionHeaders(e,t,r){e=[{key:"Access-Control-Allow-Headers",value:"*"},{key:"Access-Control-Allow-Origin",value:"*"},{key:"Content-Type",value:"application/json; charset=utf-8"},{key:"Session-ID",value:e},{key:"Product-ID",value:String(t)}];return r&&e.push({key:"L-Gen-ID",value:r}),e}createFetchHeaders(e,t,r){e={"Access-Control-Allow-Headers":"*","Access-Control-Allow-Origin":"*","Content-Type":"application/json; charset=utf-8","Session-ID":e,"Product-ID":String(t)};return r&&(e["L-Gen-ID"]=r),e}parseHeaders(e){let r={};return e&&e.trim().split(/[\r\n]+/).forEach(e=>{var e=e.split(": "),t=null==(t=e.shift())?void 0:t.trim().toLowerCase(),e=e.join(": ").trim();t&&(r[t]=e)}),r}setBaseUrls(e){e.trackingBaseUrl&&(this.trackingBaseUrl=e.trackingBaseUrl),e.leadGenBaseUrl&&(this.leadGenBaseUrl=e.leadGenBaseUrl)}xhrRequest(o,l,c,d){return new Promise((r,a)=>{var e,t=this.resolveUrl(l),n=this.mergeHeaders(null==d?void 0:d.headers),s=!1!==(null==d?void 0:d.withCredentials);let i=new XMLHttpRequest;i.open(o,t,!0),i.withCredentials=s,(null!=d&&d.timeout||this.defaultTimeout)&&(i.timeout=null!=(t=null==d?void 0:d.timeout)?t:this.defaultTimeout);for(e of n)i.setRequestHeader(e.key,e.value);i.onload=()=>{var t=200<=i.status&&i.status<300,e=null==(e=null==d?void 0:d.acceptedStatusCodes)?void 0:e.includes(i.status);if(t||e)try{let e=null;i.responseText&&"undefined"!==i.responseText&&""!==i.responseText&&(e=JSON.parse(i.responseText)),r({data:e,status:i.status,headers:this.parseHeaders(i.getAllResponseHeaders()),ok:t})}catch(e){a(new Error("Failed to parse response: "+e))}else a(new Error(`HTTP error ${i.status}: `+i.responseText))},i.onerror=()=>{a(new Error("XMLHttpRequest error: "+(i.responseText||"Network request failed")))},i.ontimeout=()=>{a(new Error(`Request timeout after ${i.timeout}ms`))},"GET"===o||null==c?i.send():(s=this.encodeBody(c),i.send(s))})}async parseFetchResponse(e){let r={},t=(e.headers.forEach((e,t)=>{r[t.toLowerCase()]=e}),null);var a=await e.text();if(a&&"undefined"!==a&&""!==a)try{if((t=JSON.parse(a))&&"object"==typeof t&&"status"in t){var n=t;if("error"===n.status)throw new Error("API error: "+(n.body||"Unknown error"))}}catch(e){if(!(e instanceof SyntaxError))throw e;t=a}return{data:t,status:e.status,headers:r,ok:e.ok}}resolveUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:this.trackingBaseUrl+e}encodeBody(e){return"string"==typeof e?e:e&&"object"==typeof e?(this.defaultHeaders["Content-Type"]||"").includes("application/json")?JSON.stringify(e):Object.entries(e).map(([e,t])=>encodeURIComponent(e)+"="+encodeURIComponent(String(null!=t?t:""))).join("&"):""}mergeHeaders(e){e={...this.defaultHeaders,...e};return Object.entries(e).map(([e,t])=>({key:e,value:t}))}mergeHeadersAsObject(e){return{...this.defaultHeaders,...e}}};function ie(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var oe=class{constructor(){r(this,"notified",!1),r(this,"visibilitySources",[{target:document,eventName:"visibilitychange",visibilityState:()=>"visible"===document.visibilityState?"v":"n",enabled:()=>!0},{target:window,eventName:"pagehide",visibilityState:()=>"n",enabled:ie}])}subscribe(r,a){let n=this.visibilitySources.filter(e=>e.enabled()).map(t=>{var e=e=>{e.isTrusted&&(this.notified?this.notified=!1:t.visibilityState()===a&&(r(),this.notified=!0))};return t.target.addEventListener(t.eventName,e),{source:t,listener:e}});return()=>{for(var{source:e,listener:t}of n)e.target.removeEventListener(e.eventName,t)}}},le=class{constructor(){r(this,"logger",a.forComponent("ec")),r(this,"initialPageViewFired",!1)}onPageView(e){let t=()=>({url:window.location.href,referrer:document.referrer,title:document.title,timestamp:Date.now()});"complete"===document.readyState||"interactive"===document.readyState?this.initialPageViewFired||(this.initialPageViewFired=!0,setTimeout(()=>e(t()),0)):document.addEventListener("DOMContentLoaded",()=>{this.initialPageViewFired||(this.initialPageViewFired=!0,e(t()))});let r=()=>e(t()),a=(window.addEventListener("popstate",r),()=>e(t()));return window.addEventListener("locationchange",a),()=>{window.removeEventListener("popstate",r),window.removeEventListener("locationchange",a)}}onEmailCaptured(t){let e=e=>{e=null==(e=e.detail)?void 0:e.email;e&&t(e,"hyros_email_event")};return window.addEventListener("hyros_email",e),()=>window.removeEventListener("hyros_email",e)}onPhoneCaptured(t){let e=e=>{e=null==(e=e.detail)?void 0:e.phone;e&&t(e,"hyros_phone_event")};return window.addEventListener("hyros_phone",e),()=>window.removeEventListener("hyros_phone",e)}onCheckoutStarted(t){let e=e=>{t(e.detail||{})};return window.addEventListener("hyros_checkout_started",e),()=>window.removeEventListener("hyros_checkout_started",e)}onCheckoutContactSubmitted(t){let e=e=>{t(e.detail||{})};return window.addEventListener("hyros_checkout_contact",e),()=>window.removeEventListener("hyros_checkout_contact",e)}onCheckoutCompleted(t){let e=e=>{t(e.detail||{})};return window.addEventListener("hyros_checkout_completed",e),()=>window.removeEventListener("hyros_checkout_completed",e)}onInputChanged(t){let e=e=>{e=e.target;!e||"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName&&"SELECT"!==e.tagName||t({elementType:e.type||"",elementId:e.id||"",elementName:e.name,elementClasses:e.className?e.className.split(" ").filter(Boolean):[],value:e.value,tagName:e.tagName})};return document.addEventListener("change",e,!0),document.addEventListener("input",e,!0),()=>{document.removeEventListener("change",e,!0),document.removeEventListener("input",e,!0)}}onPageVisibilityState(e,t){return(new oe).subscribe(e,t)}onProductViewed(t){let e=e=>{t(e.detail||{})};return window.addEventListener("hyros_product_viewed",e),()=>window.removeEventListener("hyros_product_viewed",e)}onCustomEvent(e,r){let t=e=>{var t;r(null!=(t=e.detail)?t:e)};return window.addEventListener(e,t),()=>window.removeEventListener(e,t)}dispatchEvent(e,t){try{var r=new CustomEvent(e,{detail:t});return window.dispatchEvent(r)}catch(e){return this.logger.debugWarn("dispatchEvent failed:",e),!1}}onDomReady(e){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(e,0):document.addEventListener("DOMContentLoaded",e)}setInterval(e,t){let r=window.setInterval(e,t);return()=>window.clearInterval(r)}setTimeout(e,t){let r=window.setTimeout(e,t);return()=>window.clearTimeout(r)}},ce=class Zt{constructor(e){r(this,"native"),this.native=e}get id(){return this.native.id}get tagName(){return this.native.tagName}get innerText(){return this.native.innerText||""}get textContent(){return this.native.textContent||""}get className(){return this.native.className}get href(){return this.native.href||void 0}get src(){return this.native.src||void 0}get value(){return this.native.value||void 0}get type(){return this.native.type||void 0}get name(){return this.native.name||void 0}getAttribute(e){return this.native.getAttribute(e)}setAttribute(e,t){this.native.setAttribute(e,t)}hasClass(e){return this.native.classList.contains(e)}querySelectorAll(e){e=this.native.querySelectorAll(e);return Array.from(e).map(e=>new Zt(e))}querySelector(e){e=this.native.querySelector(e);return e?new Zt(e):null}},de=class{constructor(){r(this,"logger",a.forComponent("d_c"))}getElementById(e){e=document.getElementById(e);return e?this.wrapElement(e):null}querySelector(e){try{var t=document.querySelector(e);return t?this.wrapElement(t):null}catch(e){return this.logger.debugWarn("querySelector error:",e),null}}querySelectorAll(e){try{var t=document.querySelectorAll(e);return Array.from(t).map(e=>this.wrapElement(e))}catch(e){return this.logger.debugWarn("querySelectorAll error:",e),[]}}getElementsByTagName(e){return Array.from(document.getElementsByTagName(e))}getElementsByClassName(e){e=document.getElementsByClassName(e);return Array.from(e).map(e=>this.wrapElement(e))}createElement(e){e=document.createElement(e);return this.wrapElement(e)}appendToBody(e){e=e.native;e&&document.body.appendChild(e)}appendToHead(e){e=e.native;e&&document.head.appendChild(e)}injectScript(e,t,r,a,n){var s=document.createElement("script");s.type="text/javascript",s.src=t,s.async=null==r||r,a&&(s.onload=a),n&&(s.onerror=()=>n(new Error("Failed to load script: "+t))),e.appendChild(s)}injectInlineScript(e){var t=document.createElement("script");t.type="text/javascript",t.text=e,document.head.appendChild(t)}get readyState(){return document.readyState}get userAgent(){return navigator.userAgent}get title(){return document.title}isReady(){return"complete"===document.readyState||"interactive"===document.readyState}onReady(e){this.isReady()?setTimeout(e,0):document.addEventListener("DOMContentLoaded",e)}getTextById(e){e=document.getElementById(e);return(null==e?void 0:e.innerText)||""}getTextBySelector(e){try{var t=document.querySelector(e);return(null==t?void 0:t.innerText)||""}catch(e){return""}}getInputValues(e){try{var t=document.querySelectorAll(e);return Array.from(t).filter(e=>e.value).map(e=>({element:this.wrapElement(e),value:e.value}))}catch(e){return[]}}getTextNodes(e){try{var t=document.querySelector(e);if(!t)return[];let r=[],a=e=>{var t;e.nodeType===Node.TEXT_NODE?(t=null==(t=e.textContent)?void 0:t.trim())&&r.push(t):e.childNodes.forEach(a)};return a(t),r}catch(e){return[]}}wrapElement(e){return new ce(e)}},ue=(e=>(e.GRANTED="GRANTED",e.DENIED="DENIED",e.UNSPECIFIED="UNSPECIFIED",e))({});var pe=(e=>(e.ADD_LEAD_TAG="addLeadTag",e.ADD_LEAD_PHONE="addLeadPhone",e.ADD_CONSENT="addConsent",e.ADD_LEAD_STAGE="addLeadStage",e))({}),d={lead:{email:"",phoneNumbers:[],tag:"",tags:[],firstName:"",lastName:"",adOptimizationConsent:"UNSPECIFIED",leadStage:"",contact:"",leadAddress:"",leadCity:"",leadStreet:"",leadState:"",leadCountry:"",leadZipCode:""},source:{sourceLinkTags:"",fbAdsetId:0,googleAdId:0,bingAdGroupId:0,hyrosCampaignId:0,gClickId:"",wBraId:"",gBraId:"",fbClickId:"",tiktokAdGroupId:0,snapchatAdSetId:0,twitterAdgroupId:0,linkedinCampaignId:0,ttClickId:"",rdtAdGroupId:"",rdtClickId:"",bingSpecialCampaign:!1,gSpecialCampaign:!1,gAdgroupId:0,pinterestAdgroupId:0},config:{cookieEnabled:!0,origin:"",sessionId:"",prevUrl:"",refUrl:"",userEventUrl:"",leadGenSessionId:"",dvfp:"",fingerprintData:"",spaPrevUrl:"",cartId:null,generatedClickInfo:void 0,uniqueCheckoutUpdateSent:!1,thirdPartyTrackingHash:"",tpsFromCache:"",uiFramework:"",platform:""},checkout:{paypalUniqueCheckoutId:"",uniqueCheckoutId:0},conversionInfo:[],processedData:{catcherSent:!1,email:null,domEmail:null,isEmailSource:!1,isEmailTraffic:!1,processedInputs:[],processedEmails:[],processedPhones:[],processedTags:[],processedCoupons:[],processedAddresses:[],processedStreets:[],processedCountries:[],processedStates:[],processedCities:[],processedZipCodes:[],processedFirstNames:[],processedLastNames:[],processedLeadStage:"",possibleEventIdFound:!1,filteredIframes:[],fingerprintLoadPromise:null,dniPhoneNumber:null,dniPhoneNumberFullReplacement:!0,reservedNumbers:[],noSwapNumbers:[],customHTETriggered:!1,cachedCAPEvent:null}},he=(e=>(e.HYROS_FIRST_NAME="hyros-first-name",e.FIRST_NAME="firstname",e.NAME="name",e.FIRST_NAME_DASHED="first-name",e.F_NAME_DASHED="f-name",e.FIRST_NAME_SNAKE="first_name",e.F_NAME_SNAKE="f_name",e.FIRST_NAME_SPACED="first name",e.F_NAME_SPACED="f name",e))({}),ge=(e=>(e.HYROS_LAST_NAME="hyros-last-name",e.LAST_NAME="lastname",e.LAST_NAME_DASHED="last-name",e.L_NAME_DASHED="l-name",e.LAST_NAME_SNAKE="last_name",e.L_NAME_SNAKE="l_name",e.LAST_NAME_SPACED="last name",e.L_NAME_SPACED="l name",e))({}),me=(e=>(e.HYROS_FULL_NAME="hyros-full-name",e.FULL_NAME_DASHED="full-name",e.FULL_NAME_SNAKE="full_name",e.FULL_NAME_SPACED="full name",e.FULL_NAME_SINGLE="fullname",e.FULL_NAME_ELLIPSIS="full name...",e.COMPLETE_NAME_DASHED="complete-name",e.COMPLETE_NAME_SNAKE="complete_name",e.COMPLETE_NAME_SPACED="complete name",e.COMPLETE_NAME_SINGLE="completename",e.INVITEE_FULL_NAME="invitee_full_name",e.ICLOSED_NAME="iclosedName",e))({}),fe=(e=>(e.EMAIL="Email",e.EMAIL_LOWER="email",e.INVITEE_EMAIL="invitee_email",e.HEMAIL="hemail",e.HE="he",e.CEMAIL="cemail",e.PAYER_EMAIL="payer_email",e.CHECKOUTEMAIL="checkoutemail",e.CUSTOMER_EMAIL="customer_email",e.EMAIL_ADDRESS_LEAD="email-address-lead",e.EMAIL_LEAD="email-lead",e.BUYER_EMAIL="buyer_email",e.INF_FIELD_EMAIL="inf_field_Email",e.EMAIL_FORM1="email_form1",e.WJ_LEAD_EMAIL="wj_lead_email",e.EW_EMAIL="ew_email",e.PERSONEMAIL="PersonEmail",e.M="m",e.ICLOSED_EMAIL="iclosedEmail",e))({});function Ie(){return Object.values(fe)}var u=class{};r(u,"SOURCE_LINK","sl"),r(u,"FB_AD_SET_ID","fbc_id"),r(u,"G_CAMPAIGN_ID","gc_id"),r(u,"G_ADGROUP_ID","h_ga_id"),r(u,"G_SPECIAL_CAMPAIGN","CustomGSpecialCampaign"),r(u,"G_CLICK_ID","gclid"),r(u,"W_BRA_ID","wbraid"),r(u,"G_BRA_ID","gbraid"),r(u,"FB_CLICK_ID","fbclid"),r(u,"EMAIL_SOURCE","el"),r(u,"EMAIL_TRAFFIC","he"),r(u,"HYROS_AD_ID","h_ad_id"),r(u,"BING_AD_GROUP_ID","bng_id"),r(u,"BING_SPECIAL_CAMPAIGN","CustomBingSpecialCampaign"),r(u,"HYROS_CAMPAIGN_ID","h_campaign_id"),r(u,"MANY_CHAT_PARAMS","mch"),r(u,"TT_AD_GROUP_ID","ttc_id"),r(u,"SN_AD_SET_ID","snc_id"),r(u,"LNK_CAMPAIGN_ID","lnk_id"),r(u,"TWT_ADGROUP_ID","twt_id"),r(u,"PNT_AD_GROUP_ID","pnt_id"),r(u,"TT_CLICK_ID","ttclid"),r(u,"RDT_AD_GROUP_ID","rdt_id"),r(u,"RDT_CLICK_ID","rdt_clid"),r(u,"PAYPAL_UNIQUE_CHECKOUT_ID","tx"),r(u,"HYROS_TRAFFIC_SOURCE","htrafficsource"),r(u,"HYROS_CATEGORY","hcategory"),r(u,"HYROS_GOAL","hgoal"),r(u,"HYROS_KEYWORD_ID","h_keyword_id"),r(u,"HYROS_KEYWORD","h_keyword"),r(u,"HYROS_PLACEMENT","h_placement"),r(u,"HYROS_AD_NAME","h_ad_name"),r(u,"APL_CAMPAIGN_ID","apl_id"),r(u,"WHOP_AD_ID","waid"),r(u,"WHOP_AD_GROUP_ID","wasid"),r(u,"WHOP_CAMPAIGN_ID","wacid"),r(u,"HYROS_CAMPAIGN_NAME","h_campaign_name");var Ce=(e=>(e.SOURCE_LINK="sl",e.FB_AD_SET_ID="fbc_id",e.G_CAMPAIGN_ID="gc_id",e.G_ADGROUP_ID="h_ga_id",e.G_CLICK_ID="gclid",e.G_SPECIAL_CAMPAIGN="g_special_campaign",e.W_BRA_ID="wbraid",e.G_BRA_ID="gbraid",e.FB_CLICK_ID="fbclid",e.EMAIL_SOURCE="el",e.EMAIL_TRAFFIC="he",e.HYROS_AD_ID="h_ad_id",e.BING_AD_GROUP_ID="bng_id",e.BING_SPECIAL_CAMPAIGN="bng_special_campaign",e.HYROS_CAMPAIGN_ID="h_campaign_id",e.MANY_CHAT_PARAMS="mch",e.TT_AD_GROUP_ID="ttc_id",e.SN_AD_SET_ID="snc_id",e.LNK_CAMPAIGN_ID="lnk_id",e.TWT_ADGROUP_ID="twt_id",e.PNT_AD_GROUP_ID="pnt_id",e.TT_CLICK_ID="ttclid",e.RDT_AD_GROUP_ID="rdt_id",e.RDT_CLICK_ID="rdt_clid",e.PAYPAL_UNIQUE_CHECKOUT_ID="tx",e.HYROS_TRAFFIC_SOURCE="htrafficsource",e.HYROS_CATEGORY="hcategory",e.HYROS_GOAL="hgoal",e.HYROS_KEYWORD_ID="h_keyword_id",e.HYROS_KEYWORD="h_keyword",e.HYROS_PLACEMENT="h_placement",e.HYROS_AD_NAME="h_ad_name",e.APL_CAMPAIGN_ID="apl_id",e.WHOP_AD_ID="waid",e.WHOP_AD_GROUP_ID="wasid",e.WHOP_CAMPAIGN_ID="wacid",e.HYROS_CAMPAIGN_NAME="h_campaign_name",e))({});function Ee(){return Object.values(Ce)}var p=class p{constructor(){}static decodeUrlParam(r){if(null===r)return r;{let e=r,t="";for(;e!==t;){t=e;try{e=decodeURIComponent(t)}catch(e){return this.logger.debugWarn("[DCD] Fail during decoding: "+t+" , error: "+e),t}}return e}}static tryGetCachedVariable(e,t,r){try{return c.config.deleteParams?e:t}catch(e){return this.logger.debugError(r+e),c.config.deleteParams=!1,t}}static getBrowserHref(){return o().location.href}static getDocumentUrl(){return o().location.href}static getDocumentReferrer(){return o().location.referrer}static getUrlParam(e,t,r,a){r=r||this.getBrowserHref(),e="[\\?&]"+(e=(e=e.toString().replace(/[[]/,"\\[").replace(/[\]]/,"\\]")).toString().replace(/ /g,"\\+"))+'=([^&#,"]*)',e=new RegExp(e).exec(r);let n=e?e[1]:null;return n=null!==n&&(t&&(n=p.decodeUrlParam(n)),a)?n&&n.replace(/["},]/g,""):n}static getUrlParams(e,t,r){for(var a,n=r||p.getBrowserHref(),r="[\\?&]"+(e=e.toString().replace(/[[]/,"\\[").replace(/[\]]/,"\\]"))+"=([^&#]*)",s=new RegExp(r,"g"),i=[];null!==(a=s.exec(n));){let e=a[1];t&&(e=p.decodeUrlParam(e)),i.push(e)}return i}static tryGetDocumentVariables(){this.getBrowserHref(),this.getDocumentUrl(),this.getDocumentReferrer()}static getUrlValueFromCustomParam(e,t,r,a){var n;e=e||[];for(n of[t,...Array.isArray(e)?e:e.split(",").map(e=>e.trim())].filter(e=>e&&!c.config.disableParamTracking.has(e)))try{var s=p.getUrlParam(n,r,a,!0);if(s)return s}catch(e){var i=e instanceof Error?e.message:"unknown thrown value";this.logger.debugError(`[gUVFCP][e_cp] param: ${n}, error: `+i)}return null}static getNumberUrlValueFromCustomParam(e,t,r,a){e=Array.isArray(e)?e:[e],e=p.getUrlValueFromCustomParam(e,t,r,a);return e?Number(e):null}static getBooleanUrlValueFromCustomParam(e,t,r,a){e=Array.isArray(e)?e:[e],e=p.getUrlValueFromCustomParam(e,t,r,a);return e?Boolean(e):null}static searchElementsInUrlParams(e,t){for(var r of e){r=this.getUrlParam(r,!0,t);if(r)return r}return null}static getAllUrlParams(){var t={},r=o().location.search.substring(1).split("&");for(let e=0;e<r.length;e++){var a=r[e].split("=");2===a.length&&(p.isEncoded(a[1])?t[a[0]]=decodeURIComponent(a[1]):t[a[0]]=a[1])}return t}static isEncoded(e){try{return decodeURIComponent(e),!0}catch(e){return!1}}static getSourceTagIfPresent(e){let t=p.getUrlValueFromCustomParam(u.SOURCE_LINK,"sl",!1,e);return t||(t=p.getUrlValueFromCustomParam(u.EMAIL_SOURCE,"el",!1,e),d.processedData.isEmailSource=!!t),t}},h=(r(p,"logger",a.forComponent("paru")),r(p,"isMatchingCustomParam",(e,t)=>e.split(",").map(e=>e.trim().toLowerCase()).includes(t.toLowerCase())),p),g=class{constructor(){}static getElementContentById(e,t=!1){e=o().dom.getElementById(e);return e?t?e.textContent:e.innerText:""}static getElementContentByIdFromShadowRoot(e,t,r=!1){return this.getInnerTextOfElement(e.getElementById(t),r)}static getElementByTagName(e){return o().dom.getElementsByTagName(e)}static getFirstNameFromDom(){return o().dom.getTextBySelector(".hyros-first-name:not(input)")}static getLastNameFromDom(){return o().dom.getTextBySelector(".hyros-last-name:not(input)")}static getFullNameFromDom(){return o().dom.getTextBySelector(".hyros-full-name:not(input)")}static getInnerTextOfElement(e,t=!1){return null!==e?t?e.textContent:e.innerText:""}static getBySelector(e){e=o().dom.querySelector(e);return e&&e.native||null}static getTextNodes(e){for(var t,r=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);t=a.nextNode();)r.push(t);return r}static findShadowRoots(){return"undefined"==typeof document?[]:Array.from(document.querySelectorAll("*")).filter(e=>e.shadowRoot).map(e=>e.shadowRoot)}},_e=class Qt{async getEmail(){var e,t=g.getElementContentById("hyros-email",!0);if(t)return t;for(e of g.findShadowRoots()){var r=g.getElementContentByIdFromShadowRoot(e,"hyros-email",!0);if(r)return r}return""}getAllInputs(){var e=Array.from(g.getElementByTagName("input")),t=g.findShadowRoots().flatMap(e=>[...e.querySelectorAll("input")]);return[...e,...t]}static create(e){return new("SHOPIFY"!==e?Qt:ve)}},ve=class extends _e{constructor(){super(...arguments),r(this,"logger",a.forComponent("emlh"))}async getEmail(){return this.getEmailFromTagName("p")||this.getEmailFromTagName("span")||await this.getEmailFromShopifyCookie()||""}elementHasEmail(e){e=e.trim();return e.includes("@")&&!e.includes(" ")}getEmailFromTagName(e){var t;for(t of g.getElementByTagName(e)){var r=t.innerText.trim();if(this.elementHasEmail(r))return r}}async getEmailFromShopifyCookie(){var e=await o().cookies.get("hyrosEmail")||await o().cookies.get("hyrosemail");return e?(this.logger.debugInfo("[h_email] "+e),e):null}},ye=null,Te=null;function Pe(){return ye&&Te===c.config.origin||(Te=c.config.origin,ye=_e.create(Te)),ye}var m=class{constructor(){}static sanitizeEmail(e){return e?e.trim():""}static isValidEmail(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())}static async parseByOriginType(){var e=await Pe().getEmail();return this.sanitizeEmail(e)}static getEmailParamIfPresent(){return h.searchElementsInUrlParams(Ie())}},f=class{constructor(){}static getNameVariants(e){return{[0]:Object.values(he),1:Object.values(ge),2:Object.values(me)}[e]||[]}static getNameParamIfPresent(e){e=this.getNameVariants(e);return h.searchElementsInUrlParams(e)}},Ae=(e=>(e.HYROS_PHONE="hyrosphone",e.HYROS_PHONE_SNAKE="hyros_phone",e.HYROS_PHONE_DASHED="hyros-phone",e.HYROS_PHONE_SPACED="hyros phone",e.HYROS_PHONE_NUMBER_SNAKE="hyros_phone_number",e.HYROS_PHONE_NUMBER_DASHED="hyros-phone-number",e.HYROS_PHONE_NUMBER_SPACED="hyros phone number",e))({});function be(){return Object.values(Ae)}var I={AddressOptions:["h-address"],StreetOptions:["h-street"],CountryOptions:["h-country"],CityOptions:["h-city"],StateOptions:["h-state"],ZipCodeOptions:["h-zip-code"]},Se=(e=>(e.HCONTACT="hcontact",e))(Se||{});function ke(){return Object.values(Se)}var we=(e=>(e.TEXT_REMINDER_NUMBER="text_reminder_number",e.SMS_NUMBER="sms_number",e.ANSWER="answer_",e.ANSWER_1="answer_1",e.EVENT_START_TIME="event_start_time",e.INF_CUSTOM_PHONE_NUMBER_OR_SKYPE_ID="inf_custom_PhonenumberorSkypeID",e.INF_FIELD_PHONE1="inf_field_Phone1",e.PHONE1="Phone1",e.PHONE="phone",e.MOBILE="mobile",e.CUSTOMER_VALID_PHONE="customer_valid_phone",e.TEL="tel",e.ICLOSED_PHONE="iclosedPhone",e))(we||{});var Re=["%"],Ne="===",C=class{constructor(){}static sanitizeString(e){return e.trim().replace(/\s+/g," ")}static sanitizeFullName(e){var t;return e?1==(e=e.trim().split(/[ +]+/).filter(e=>0<e.length)).length?e:(t=e.pop(),[e.join(" "),t]):[]}static sanitizeFirstOrLastName(e){return e?e.trim().replace(/[^a-zA-Z]/g,""):""}static sanitizeCoupon(e){return e?e.trim():""}static preprocessClickId(t){var r=Re;if(null!=t)for(let e=0;e<r.length;e++){var a=t.indexOf(r[e]);-1!=a&&(this.logger.debugWarn("[fbclid][IC]: "+t[a]),t=t.substring(0,a))}return t}static includesAnyPattern(t,r){for(let e=0;e<r.length;e++)if(0===t.indexOf(r[e]))return!0;return!1}static isUndefined(e){return null==e||"undefined"===e||"string"==typeof e&&0===e.trim().length}static getFirstNumberValue(e){for(var t of e)if(/^\d+$/.test(t))return t;return null}static getFirstNonNumberValue(e){for(var t of e)if(!/^\d+$/.test(t))return t;return null}static getSubstringBetween(e,t,r){if(""==e)return"";var a=e.indexOf(t);if(!(0<=a))return"";if(e=e.substring(a+t.length),r){if(!(0<=(a=e.indexOf(r))))return"";e=e.substring(0,a)}return e}},E=(r(C,"logger",a.forComponent("stru")),class{constructor(){}static getReferrerUrl(){return o().location.getReferrerUrl()}static normalizeVerificationUrl(e){e=new URL(e);return e.pathname.endsWith("/")||(e.pathname+="/"),e.href}static isValidURL(e){if(!e)return!1;try{return new URL(e),!0}catch{return!1}}}),_=(r(E,"getPreviousUrl",function(){return c.config.spaEnabled&&d.config.spaPrevUrl?d.config.spaPrevUrl:o().location.getPreviousUrl()}),class{constructor(){}static getDefaultHeaders(e=!1){var t=[{key:"Access-Control-Allow-Headers",value:"*"},{key:"Access-Control-Allow-Origin",value:"*"},{key:"Content-type",value:"application/json; charset=utf-8"},{key:"UI-Framework",value:d.config.uiFramework},{key:"Platform",value:d.config.platform}];return e?t.reduce((e,{key:t,value:r})=>(e[t]=r,e),{}):t}static getProductIdHeaders(){return[{key:"Access-Control-Allow-Headers",value:"Product-ID"},{key:"Access-Control-Allow-Origin",value:"*"},{key:"Product-ID",value:c.product.id}]}static getFetchProductIdHeaders(){return this.getProductIdHeaders().reduce((e,{key:t,value:r})=>(e[t]=String(r),e),{})}static getIdHeaders(e=!1){var t=[{key:"Access-Control-Allow-Headers",value:"*"},{key:"Access-Control-Allow-Origin",value:"*"},{key:"Content-type",value:"application/json; charset=utf-8"},{key:"Session-ID",value:d.config.sessionId},{key:"Product-ID",value:c.product.id},{key:"L-Gen-ID",value:d.config.leadGenSessionId},{key:"UI-Framework",value:d.config.uiFramework},{key:"Platform",value:d.config.platform}];return e?t.reduce((e,{key:t,value:r})=>(e[t]=r,e),{}):t}static getFetchIdHeaders(){return this.getIdHeaders(!0)}static getGUSIDFetchHeaders(e){return{"Product-ID":String(c.product.id),"Ref-Url":c.config.refOverride||E.getReferrerUrl(),fp:e,"fp-data":d.config.fingerprintData,"UI-Framework":d.config.uiFramework,Platform:d.config.platform}}static parseHeaders(e){let r={};return e.trim().split(/[\r\n]+/).forEach(e=>{var e=e.split(": "),t=null==(t=e.shift())?void 0:t.trim(),e=e.join(": ").trim();t&&(r[t]=e)}),r}}),De=class{post(e,t,r,a){return this.doBodyRequest("POST",e,t,r,a)}put(e,t,r,a){return this.doBodyRequest("PUT",e,t,r,a)}get(a,n,s=!1,i,o){return new Promise((e,t)=>{var r=this.initRequest("GET",a,!0,n,s);this.configXmlHttp(r,e,t,null,i,o)})}doBodyRequest(n,s,i,o,l){return new Promise((e,t)=>{var r="string"==typeof i?i:Object.keys(i).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(i[e])}).join("&"),a=this.initRequest(n,s,!0,o,l);this.configXmlHttp(a,e,t,r)})}initRequest(e,t,r,a,n){a=C.isUndefined(a)?_.getDefaultHeaders():a;var s,i=new XMLHttpRequest;i.open(e,t,r),i.withCredentials=n;for(s of a=Array.isArray(a)?a:[a])i.setRequestHeader(s.key,s.value);return i}keepAliveFetch(a,n,s,i,o){return new Promise((t,r)=>{i=C.isUndefined(i)?_.getDefaultHeaders(!0):i;var e={method:n,headers:i,credentials:o?"include":"omit",keepalive:!0};"GET"!==n&&(e.body=s),fetch(a,e).then(function(e){return e.text()}).then(function(e){(e=e?JSON.parse(e):{})&&"error"===e.status?r(new Error("KeepAliveFetch Error: "+(e.body||"Network request failed"))):t(e)}).catch(r)})}configXmlHttp(r,a,n,e,s,i=!1){r.onload=function(){if(200===r.status||null!=s&&s.includes(r.status))try{let e=null;if(r.responseText&&"undefined"!==r.responseText&&""!==r.responseText&&(e=JSON.parse(r.responseText)),!i)return a(e);var t=_.parseHeaders(r.getAllResponseHeaders());a({data:e,headers:t})}catch(e){t=e instanceof Error?e.message:JSON.stringify(e);n("ERROR Processing Response: "+t)}else n("HTTP error status: "+r.status+" - "+r.responseText)},r.onerror=function(){n("XMLHttpRequest Error: "+(r.responseText||"Network request failed"))},r.send(e)}},v={id:null,sessionId:null,productId:null,creationDate:null,dvfp:null,uniqueCheckoutId:null,cartId:null,phoneNumber:null,couponCode:null,firstName:null,lastName:null,leadCity:null,leadAddress:null,leadStreet:null,leadState:null,leadCountry:null,leadZipCode:null,dniNumber:null,timeSpent:null,pixelEvents:null,thirdPartySessionId:null,tpsFromCache:null};function Oe(e,t){var r;return{id:null==(r=d.config.generatedClickInfo)?void 0:r.clickId,productId:c.product.id,[e]:t,creationDate:null==(r=d.config.generatedClickInfo)?void 0:r.creationDate}}var y=new class er{constructor(){r(this,"loggerPCU",a.forComponent("pcu")),r(this,"httpClient",new De)}createHTE(e,t={}){var r=o().http.getTrackingUrl(n.unifiedEvent),a={headers:_.getFetchIdHeaders(),withCredentials:!0};return this.shouldUseKeepAliveFetch(t)?o().http.keepAliveFetch(r,"POST",e,a):o().http.post(r,e,a).then(e=>e.data)}shouldUseKeepAliveFetch(e={}){return(c.config.useFetchKeepAlive||!(null==e||!e.forceKeepAlive))&&this.supportsKeepAliveFetch()}supportsKeepAliveFetch(){if("function"!=typeof fetch||"function"!=typeof Request)return!1;try{return!0===new Request("https://example.com",{method:"POST",body:"",keepalive:!0}).keepalive}catch{return!1}}updateClick(t){if(!c.config.useFetchKeepAlive)return this.updateClickWithXHR(t);let e;return(e=o().http.keepAliveFetch(o().http.getTrackingUrl(c.endpoints.clickUpdate),"PUT",t,{headers:_.getFetchIdHeaders(),withCredentials:!0})).catch(e=>{if(er.isKeepAliveTransportError(e))return this.loggerPCU.debugWarn(er.getErrorMessage(e)),this.updateClickWithXHR(t);throw e})}updateClickOnClose(e){let t;(t=o().http.sendBeacon(c.endpoints.clickUpdate,e))&&this.loggerPCU.info("")}updateClickWithXHR(e){return o().http.put(o().http.getTrackingUrl(c.endpoints.clickUpdate),e,{headers:_.getFetchIdHeaders(),withCredentials:!0})}static isKeepAliveTransportError(e){var t=(e instanceof Error?e.name:"").toLowerCase(),e=er.getErrorMessage(e).toLowerCase();return!e.includes("keepalivefetch error")&&!e.includes("response is not ok")&&("aborterror"===t||e.includes("load failed")||e.includes("failed to fetch")||e.includes("networkerror"))}static getErrorMessage(e){return e instanceof Error?e.message:"string"==typeof e?e:"object"==typeof e?"Unknown object error":String(e)}flushCachedClickUpdate(){var e=d.config.generatedClickInfo;null!=e&&e.clickId&&(v.id=e.clickId,v.productId=c.product.id,v.creationDate=e.creationDate,v.sessionId=d.config.sessionId,v.tpsFromCache=d.config.tpsFromCache,this.updateClickOnClose(v),Object.keys(v).forEach(e=>{v[e]=null}))}processClick(e){e=c.endpoints.processClick+e;return c.config.useFetchKeepAlive?this.httpClient.keepAliveFetch(e,"GET",{},_.getIdHeaders(!0),!0):this.httpClient.get(e,_.getIdHeaders(),!0)}retrieveDNI(e){var t=o().http.getTrackingUrl(n.dniRequest),r={headers:_.getFetchIdHeaders(),withCredentials:!1};return c.config.useFetchKeepAlive?o().http.keepAliveFetch(t,"POST",e,r).then(e=>e.data):o().http.post(t,e,r).then(e=>e.data)}scriptValidation(e){return o().http.put(o().http.getTrackingUrl(n.pingPongRequest+"/verify"),e,{headers:_.getFetchIdHeaders(),withCredentials:!0})}sendCustomActionEvent(e){return o().http.keepAliveFetch(o().http.getTrackingUrl(n.customActionProcessing),"POST",e,{headers:_.getFetchIdHeaders(),withCredentials:!1})}sendError(e,t){t=c.endpoints.errorEndpoint+"?"+t.toString(),e=JSON.stringify(e);return o().http.post(o().http.getTrackingUrl(t),e,{headers:_.getFetchIdHeaders(),withCredentials:!0})}},T=new class{constructor(){r(this,"reportedInvalidPayloadReasons",new Set)}async initAndReportOnError(t,r){try{return await r(),!0}catch(e){r=e instanceof Error?e:new Error(String(e));return r.message="Service Failed to Start: "+r.message,this.sendErrorReport(r,t,{serviceWhereErrorOriginated:"UNIFIED_TRACKING_SCRIPT",errorType:"COULD_NOT_INIT_SERVICES"}),!1}}async sendErrorReport(e,t,r={}){await this.errorLogger(e,"["+t+"]",r)}reportInvalidPayload(e,t,r,a,n){this.reportedInvalidPayloadReasons.has(a)||(this.reportedInvalidPayloadReasons.add(a),r=this.describeBodyShape(r),this.sendErrorReport(`[${e}] ${t.split("?")[0]} body=${r} reason=`+a,e,n))}describeBodyShape(e){var t;return null==e?String(e):(t=null!=(t=null==(t=null==e?void 0:e.constructor)?void 0:t.name)?t:typeof e,"string"==typeof e?`${t} (${e.length})`:t)}async errorLogger(e,t,r){r={serviceWhereErrorOriginated:r.serviceWhereErrorOriginated,errorType:r.errorType,dataString:t+" - "+this.formatErrorMessage(e)},e=new URLSearchParams;e.append("script","UNIFIED_TRACKING_SCRIPT");try{await y.sendError(r,e)}catch(e){a.forComponent(t).debugError("Unexpected error when reporting to backend: ",e)}}formatErrorMessage(e){return e instanceof Error?e.stack||e.message||"Unexpected error":JSON.stringify(e)}},Le=class{constructor(){}static sanitize(e,t){e=null==(e=C.preprocessClickId(e))?void 0:e.trim();return e?this.VALID_FBC_ID_REGEX.test(e)?e:(T.sendErrorReport(t=`[fbclid][INV] ${t}: `+e,"fbcu",{serviceWhereErrorOriginated:"TRACKING_PARAM_CAPTURE",errorType:"INVALID_VALUE"}),this.logger.debugWarn(t),null):null}},P=(r(Le,"logger",a.forComponent("fbcu")),r(Le,"VALID_FBC_ID_REGEX",/^[A-Za-z0-9._-]+$/),class{constructor(){}static async primeCookieCache(t){let r={};await Promise.all(this.CLICK_ID_COOKIE_NAMES.map(async e=>{r[e]=null!=(e=await t(e))?e:null})),this.cookieCache=r}static __resetCookieCacheForTesting(){this.cookieCache=null}static fbcFallback(e){var e=Le.sanitize(e,"url");return e||(e=this.extractFbclidFromFbc(this.getFirstCookieValue(["_fbc"])),Le.sanitize(e,"_fbc cookie"))}static googleClickIdFallback(e){return this.isMissing(e)?this.extractGclidFromGcl(this.getFirstCookieValue(["_gcl_aw","_gcl_dc"])):e}static tiktokClickIdFallback(e){return this.isMissing(e)?this.decodeCookieValue(this.getFirstCookieValue(["ttclid"])):e}static rdtClickIdFallback(e){return this.isMissing(e)?this.decodeCookieValue(this.getFirstCookieValue(["rdt_clid","rdt_cid"])):e}static extractFbclidFromFbc(e){var t,e=this.decodeCookieValue(e);return!e||(e=e.split(".")).length<4||"fb"!==e[0].toLowerCase()||(t=Number.parseInt(e[2],10),Number.isNaN(t))||Date.now()-t>this.MAX_CLICK_ID_AGE_MS?null:(t=e.slice(3).join("."),this.normalizeClickId(t))}static extractGclidFromGcl(e){var t,r,e=this.decodeCookieValue(e);return!e||(e=e.split(".")).length<3||([e,t,...r]=e,"gcl"!==e.toLowerCase())||(e=Number.parseInt(t,10),Number.isNaN(e))||Date.now()-1e3*e>this.MAX_CLICK_ID_AGE_MS?null:this.normalizeClickId(r.join("."))}static getFirstCookieValue(e){for(var t of e){t=this.readCookieFromDocument(t);if(this.normalizeClickId(t))return t}return null}static readCookieFromDocument(e){var t;return this.cookieCache?null!=(t=this.cookieCache[e])?t:null:"undefined"!=typeof document&&2===(t=("; "+document.cookie).split("; "+e+"=")).length&&null!=(t=null==(e=t.pop())?void 0:e.split(";").shift())?t:null}static decodeCookieValue(e){e=this.normalizeClickId(e);if(!e)return null;let t=e,r="";for(;t!==r;){r=t;try{t=decodeURIComponent(r)}catch{break}}return this.normalizeClickId(t)}static isMissing(e){return"string"!=typeof e||""===e.trim()}static normalizeClickId(e){return"string"!=typeof e||!(e=e.trim())||/\s/.test(e)||"deleted"===e.toLowerCase()?null:e}}),Ue=(r(P,"MAX_CLICK_ID_AGE_MS",6048e5),r(P,"CLICK_ID_COOKIE_NAMES",["_fbc","_gcl_aw","_gcl_dc","ttclid","rdt_clid","rdt_cid"]),r(P,"cookieCache",null),(e,t)=>{d.processedData.processedEmails.push(e),d.processedData.email=e,d.lead.email=e,o().features.canParseLeadFromUrl&&(d.lead.leadAddress=h.searchElementsInUrlParams(I.AddressOptions)||d.lead.leadAddress,d.lead.leadStreet=h.searchElementsInUrlParams(I.StreetOptions)||d.lead.leadStreet,d.lead.leadCity=h.searchElementsInUrlParams(I.CityOptions)||d.lead.leadCity,d.lead.leadState=h.searchElementsInUrlParams(I.StateOptions)||d.lead.leadState,d.lead.leadCountry=h.searchElementsInUrlParams(I.CountryOptions)||d.lead.leadCountry,d.lead.leadZipCode=h.searchElementsInUrlParams(I.ZipCodeOptions)||d.lead.leadZipCode,d.lead.phoneNumbers=Fe()||d.lead.phoneNumbers,d.lead.firstName=f.getNameParamIfPresent(0)||d.lead.firstName,d.lead.lastName=f.getNameParamIfPresent(1)||d.lead.lastName),d.lead.tag=c.config.customTag,d.lead.tags=(()=>{const e=d.processedData.processedTags;if(!e.includes(c["config"]["customTag"]))e.push(c["config"]["customTag"]);return e})(),d.lead.leadStage=d.processedData.processedLeadStage,d.lead.contact=h.searchElementsInUrlParams(ke())||d.lead.contact||h.searchElementsInUrlParams(ke(),c.shopHref),d.source.sourceLinkTags=t,d.source.fbAdsetId=h.getNumberUrlValueFromCustomParam(u.FB_AD_SET_ID,"fbc_id",!0),d.source.bingAdGroupId=h.getNumberUrlValueFromCustomParam(u.BING_AD_GROUP_ID,"bng_id",!0),d.source.bingSpecialCampaign=h.getBooleanUrlValueFromCustomParam(u.BING_SPECIAL_CAMPAIGN,"bng_special_campaign",!0),d.source.hyrosCampaignId=h.getNumberUrlValueFromCustomParam(u.HYROS_CAMPAIGN_ID,"h_campaign_id",!0),d.source.googleAdId=h.getNumberUrlValueFromCustomParam(u.G_CAMPAIGN_ID,"gc_id",!0),d.source.gAdgroupId=h.getNumberUrlValueFromCustomParam(u.G_ADGROUP_ID,"h_ga_id",!0),d.source.gSpecialCampaign=h.getBooleanUrlValueFromCustomParam(u.G_SPECIAL_CAMPAIGN,"g_special_campaign",!0),d.source.gClickId=h.getUrlValueFromCustomParam(u.G_CLICK_ID,"gclid",!0),d.source.wBraId=h.getUrlValueFromCustomParam(u.W_BRA_ID,"wbraid",!0),d.source.gBraId=h.getUrlValueFromCustomParam(u.G_BRA_ID,"gbraid",!0),d.source.fbClickId=C.preprocessClickId(h.getUrlValueFromCustomParam(u.FB_CLICK_ID,"fbclid",!0)),d.source.tiktokAdGroupId=h.getNumberUrlValueFromCustomParam(u.TT_AD_GROUP_ID,"ttc_id",!0),d.source.snapchatAdSetId=h.getNumberUrlValueFromCustomParam(u.SN_AD_SET_ID,"snc_id",!0),d.source.twitterAdgroupId=h.getNumberUrlValueFromCustomParam(u.TWT_ADGROUP_ID,"twt_id",!0),d.source.pinterestAdgroupId=h.getNumberUrlValueFromCustomParam(u.PNT_AD_GROUP_ID,"pnt_id",!0),d.source.linkedinCampaignId=h.getNumberUrlValueFromCustomParam(u.LNK_CAMPAIGN_ID,"lnk_id",!0),d.source.ttClickId=h.getUrlValueFromCustomParam(u.TT_CLICK_ID,"ttclid",!0),d.source.rdtClickId=h.getUrlValueFromCustomParam(u.RDT_CLICK_ID,"rdt_clid",!0),d.source.fbClickId=P.fbcFallback(d.source.fbClickId),d.source.gClickId=P.googleClickIdFallback(d.source.gClickId),d.source.ttClickId=P.tiktokClickIdFallback(d.source.ttClickId),d.source.rdtClickId=P.rdtClickIdFallback(d.source.rdtClickId),d.checkout.paypalUniqueCheckoutId=h.getUrlValueFromCustomParam(u.PAYPAL_UNIQUE_CHECKOUT_ID,"tx",!0),d.config.cookieEnabled=navigator.cookieEnabled,d.config.refUrl=E.getReferrerUrl(),d.config.prevUrl=h.getDocumentReferrer()}),Fe=()=>{var t,r=h.getAllUrlParams(),e=Object.values(we);for(t in r)if(C.includesAnyPattern(t,e)){let e=r[t];t.includes("answer_")&&(e=A.sanitizeCalendlyPhone(e)),A.isPhoneNumber(e)&&A.isValidPhone(e)&&(e=A.sanitizePhone(e),d.processedData.processedPhones.includes(e)||d.processedData.processedPhones.push(e))}var a=A.sanitizePhone(A.getPhoneFromDom());return A.isValidPhone(a)&&!d.processedData.processedPhones.includes(a)&&d.processedData.processedPhones.push(a),d.processedData.processedPhones},t=class t{constructor(){}static isPhoneNumber(e){return/^\+?\d{1,4}?[-.\s]?\d{1,4}?[-.\s]?\(?\d{1,4}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}$/.test(e)}static isCallTrackingPhoneNumber(e){return/^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$/.test(e)}static sanitizePhone(e){return e?e.trim().replace(/[^\d+,]/g,""):""}static isValidPhone(e){return!!e&&8<=(e=this.sanitizePhone(e)).length&&e.length<=15}static sanitizeCalendlyPhone(e){try{return(e=decodeURIComponent(e))?"+"+e.trim().replace(/\+/g,"").replace(/\s/g,""):""}catch(e){return this.logger.debugError(e.toString()),""}}static isCleanedPhoneNumber(e){e=this.sanitizePhone(e);return!!this.isCallTrackingPhoneNumber(e)&&8<=e.length&&e.length<=15}static containsNumber(t,r){let a=!1;for(let e=0;e<t.length&&!a;e++){var n=this.formatPhoneNumberByClientPhone(t[e],r);a=n===r}return a}static getFormat(e){for(var t of this.phoneFormats)if(t.regex.test(e))return t.format;return""}static formatPhoneNumberByClientPhone(e,t){var r=this.getFormat(t),a=(""+e).replace(/\D/g,"").match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);if(!a)return null;switch(r){case"FORMAT1":return[a[2],"-",a[3],"-",a[4]].join("");case"FORMAT2":return["(",a[2],") ",a[3],"-",a[4]].join("");case"FORMAT3":return["(",a[2],") ",a[3]," ",a[4]].join("");case"FORMAT4":return["+","1"===t[1]?"1":"",a[2],a[3],a[4]].join("");case"FORMAT5":return[a[2],"-",a[3],a[4]].join("");case"FORMAT6":return[a[2],"/",a[3],"-",a[4]].join("");default:return["(",a[2],") ",a[3],"-",a[4],r.toString()].join("")}}static getPhoneFromDom(){var e=g.getBySelector("#hyros-phone:not(input)");return null!==(e=null!=e?e:g.getBySelector(".hyros-phone:not(input)"))?e.innerText:""}static inputContainsClassOrIdOrPlaceholderPhoneNumber(e){var t,r=be();if(e.className){var a,n=[...e.classList].map(e=>e.toLowerCase());for(a of r)if(n.includes(a))return!0}return r.includes(null==(t=e.id)?void 0:t.toLowerCase())||r.includes(null==(t=e.placeholder)?void 0:t.toLowerCase())||this.isTelInput(e)}static isTelInput(e){return!!e&&("tel"===e.inputMode||"tel"===e.type)}static shouldIgnorePhoneNumber(e){return t.isPhoneNumber(e)&&(!t.isValidPhone(e)||!c.config.phoneOptInEnabled||0<d.processedData.processedEmails.length)}},A=(r(t,"logger",a.forComponent("phu")),r(t,"phoneFormats",[{format:"FORMAT1",regex:/^\d{3}-\d{3}-\d{4,}$/},{format:"FORMAT2",regex:/^\(\d{3}\) \d{3}-\d{4,}$/},{format:"FORMAT3",regex:/^\(\d{3}\) \d{3} \d{4,}$/},{format:"FORMAT4",regex:/^\+\d{4,}$/},{format:"FORMAT5",regex:/^\d{3}-\d{7}$/},{format:"FORMAT6",regex:/^\d{3}\/\d{3}-\d{4}$/}]),t),Ge=(e=>(e.BURL="BURL",e.BIP="BIP",e))({});function Be(){return Object.values(Ge)}var Me=class{constructor(){}static responseHasError(e,t,r={}){return!(c.config.useFetchKeepAlive||!e||(Be().includes(e.body)?(this.logger.debugWarn("[WARN]["+e.body+"]"),0):"error"!==e.status||(T.sendErrorReport(e.body,t,r),0)))}};r(Me,"logger",a.forComponent("resu"));var b=new class{constructor(){r(this,"logger",a.forComponent("pcu")),r(this,"errorPcu",e=>{T.sendErrorReport(e,"pcu",{serviceWhereErrorOriginated:"CLICK_PROCESSING_SERVICE",errorType:"ENDPOINT_DID_NOT_RETURN_200"})})}updateClickRequest(e,t){var r;!t&&(c.config.timeSpentTrackingEnabled||c.config.thirdPartyTracking||c.config.unifiedClickEvent)?(t=e,r=v.pixelEvents,Object.assign(v,t),r&&(v.pixelEvents=[...r,...t.pixelEvents||[]])):e.id&&y.updateClick(JSON.stringify(e)).then(()=>this.logger.info("")).catch(this.errorPcu)}updateClickField(e,t,r){e&&this.updateClickRequest(Oe(t,e),r)}updateClickFieldOnClose(e,t){e&&d.config.generatedClickInfo&&y.updateClickOnClose(Oe(t,e))}updateLeadAndClickField(e,t,r){t&&(d.lead[e]=t,this.updateClickField(t,r))}addPhoneNumberToClick(e){var t;e&&!d.processedData.processedPhones.includes(e)&&(A.isPhoneNumber(e)&&A.isValidPhone(e)&&(t=A.sanitizePhone(e),d.lead.phoneNumbers=[t]),this.updateClickField(e,"phoneNumber"))}addCouponToClick(e){this.updateClickField(e,"couponCode")}addFirstNameToClick(e){this.updateLeadAndClickField("firstName",e,"firstName")}addLastNameToClick(e){this.updateLeadAndClickField("lastName",e,"lastName")}addCityToClick(e){this.updateLeadAndClickField("leadCity",e,"leadCity")}addAddressToClick(e){this.updateLeadAndClickField("leadAddress",e,"leadAddress")}addStreetToClick(e){this.updateLeadAndClickField("leadStreet",e,"leadStreet")}addStateToClick(e){this.updateLeadAndClickField("leadState",e,"leadState")}addCountryToClick(e){this.updateLeadAndClickField("leadCountry",e,"leadCountry")}addZipCodeToClick(e){this.updateLeadAndClickField("leadZipCode",e,"leadZipCode")}addCartIdToClick(e){e&&this.updateClickField(e,"cartId")}addPixelEventsToClick(e,t,r){e&&0<e.length&&(r?this.updateClickFieldOnClose(e,"pixelEvents"):this.updateClickField(e,"pixelEvents",t))}addTpsFromCacheToClick(e){d.config.tpsFromCache=e,this.updateClickField(e,"tpsFromCache")}addFbpIdToClick(e){if(e){this.logger.debugInfo("[_fbp_c] "+e);var t,r,a=[];for(t of e)t.startsWith("fb.")&&((r={}).fbpId=t,r.adspendType="FACEBOOK",a.push(r));this.addPixelEventsToClick(a)}}addDniToClick(e){this.updateClickField(e,"dniNumber")}},He=new class{constructor(){r(this,"logger",a.forComponent("cap")),r(this,"resetStageandConsent",function(){d.processedData.processedLeadStage="",d.lead.adOptimizationConsent="UNSPECIFIED",d.lead.leadStage=""})}async sendEvent(e,t){try{var r=this.stringifyCAPEvent(e,t);await y.sendCustomActionEvent(r),this.resetStageandConsent()}catch(e){this.logger.debugError("[CAP]: "+e)}}stringifyCAPEvent(e,t){return JSON.stringify({type:e,value:Array.isArray(t)?[...t]:[t]})}},S=new class{constructor(){r(this,"logger",a.forComponent("ldp")),r(this,"successHte",e=>{Me.responseHasError(e,"hte",{serviceWhereErrorOriginated:"LEAD_PROCESSING_SERVICE",errorType:"BACKEND_REJECTED_REQUEST"})||this.logger.info("[hte].")})}processInputValue(e,t){({[0]:e=>this.processEmail(e),1:e=>setTimeout(()=>this.processPhoneNumber(e),500),2:e=>this.processCoupon(e),3:e=>this.processFirstName(e),4:e=>this.processLastName(e),5:e=>this.processFullName(e),6:e=>this.processAddress(e),7:e=>this.processStreet(e),8:e=>this.processCity(e),9:e=>this.processState(e),10:e=>this.processCountry(e),11:e=>this.processZipCode(e)})[t](e)}processLeadUpdateListener(e){var e=e.detail,t=e.value,e=e.type;switch(e){case"addLeadTag":this.processLeadTag(t);break;case"addLeadPhone":this.processPhoneNumber(t);break;case"addConsent":this.processConsentEvent(t);break;case"addLeadStage":this.processLeadStage(t);break;default:return void this.logger.debugError("[LU_UT]")}this.sendTrackingEventIfPossible(e,t)}sendTrackingEventIfPossible(e,t){let r=d.processedData.email||d.processedData.domEmail;if(r&&m.isValidEmail(r))return d.config.sessionId?(d.processedData.processedEmails.includes(r)&&(d.processedData.processedEmails=d.processedData.processedEmails.filter(e=>e!==r)),void this.sendLeadEvent(r,h.getSourceTagIfPresent())):void(d.processedData.customHTETriggered=!0);e&&t&&(e=class{constructor(){}static getKeyByValue(t,r){return Object.keys(t).find(e=>t[e]===r)}}.getKeyByValue(pe,e),d.config.sessionId?He.sendEvent(e,t):(d.processedData.cachedCAPEvent={typeKey:e,value:t},this.logger.debugInfo("[CAP] Event cached")))}processPhoneNumber(e,t={}){e=A.sanitizePhone(e),A.isValidPhone(e)&&!d.processedData.processedPhones.includes(e)&&(d.config.generatedClickInfo&&(b.addPhoneNumberToClick(e),d.processedData.processedPhones.push(e)),this.sendLeadEvent(e,h.getSourceTagIfPresent(),t))}sendLeadEvent(e,t,r={}){this.pupulateStateIfNeeded(e,t)&&(d.config.sessionId?Number(c.product.id)?y.createHTE(JSON.stringify({productId:c.product.id,firstName:d.lead.firstName,lastName:d.lead.lastName,contact:d.lead.contact,email:d.lead.email,phoneNumbers:d.lead.phoneNumbers,tag:c.config.customTag,tags:d.lead.tags,leadStage:d.lead.leadStage,adOptimizationConsent:d.lead.adOptimizationConsent,leadAddress:d.lead.leadAddress,leadStreet:d.lead.leadStreet,leadCity:d.lead.leadCity,leadState:d.lead.leadState,leadCountry:d.lead.leadCountry,leadZipCode:d.lead.leadZipCode,sourceLinkTags:d.source.sourceLinkTags,fbAdsetId:d.source.fbAdsetId,bingAdGroupId:d.source.bingAdGroupId,bingSpecialCampaign:d.source.bingSpecialCampaign,hyrosCampaignId:d.source.hyrosCampaignId,googleAdId:d.source.googleAdId,gAdgroupId:d.source.gAdgroupId,gSpecialCampaign:d.source.gSpecialCampaign,gClickId:d.source.gClickId,wBraId:d.source.wBraId,gBraId:d.source.gBraId,fbClickId:d.source.fbClickId,rdtAdGroupId:d.source.rdtAdGroupId,tiktokAdGroupId:d.source.tiktokAdGroupId,snapchatAdSetId:d.source.snapchatAdSetId,twitterAdgroupId:d.source.twitterAdgroupId,pinterestAdgroupId:d.source.pinterestAdgroupId,linkedinCampaignId:d.source.linkedinCampaignId,ttClickId:d.source.ttClickId,rdtClickId:d.source.rdtClickId,paypalUniqueCheckoutId:d.checkout.paypalUniqueCheckoutId,origin:d.config.origin,cookieEnabled:d.config.cookieEnabled,refUrl:d.config.refUrl,dvfp:d.config.deviceFingerprint,prevUrl:d.config.prevUrl,sessionId:d.config.sessionId,leadGenSessionId:d.config.leadGenSessionId,uniqueCheckoutId:d.checkout.uniqueCheckoutId}),r).then(this.successHte).catch(e=>T.sendErrorReport(e,"hte",{serviceWhereErrorOriginated:"LEAD_PROCESSING_SERVICE",errorType:"FAILED_TO_CREATE_HTE"})):T.sendErrorReport("[HTE] Aborted - pid not set","hte",{serviceWhereErrorOriginated:"LEAD_PROCESSING_SERVICE",errorType:"FAILED_TO_CREATE_HTE"}):T.sendErrorReport("[HTE] Aborted - sid not set","hte",{serviceWhereErrorOriginated:"LEAD_PROCESSING_SERVICE",errorType:"FAILED_TO_CREATE_HTE"}))}pupulateStateIfNeeded(e,t){return!d.processedData.processedEmails.includes(e)&&!A.shouldIgnorePhoneNumber(e)&&(Ue(e,t),d.lead.firstName&&d.lead.lastName||this.processFullName(f.getNameParamIfPresent(2)),!0)}async processLeadInfoFromCookies(){var e,t,r;for([e,t,r]of[["hyrosPhone","[h_phone]",e=>this.processPhoneNumber(e)],["hyrosFirstName","[h_firstName]",e=>this.processFirstName(e)],["hyrosLastName","[h_lastName]",e=>this.processLastName(e)],["hyrosName","[h_name]",e=>this.processFullName(e)],["hyrosCountry","[h_country]",e=>this.processCountry(e)],["hyrosState","[h_state]",e=>this.processState(e)],["hyrosAddress","[h_address]",e=>this.processAddress(e)],["hyrosZip","[h_zip]",e=>this.processZipCode(e)],["hyrosCity","[h_city]",e=>this.processCity(e)]]){var a=await o().cookies.get(e);a&&(this.logger.debugInfo(t+" "+a),r(a))}}processLeadTag(e){d.processedData.processedTags.includes(e)||d.processedData.processedTags.push(e)}processCoupon(e){e=C.sanitizeCoupon(e),d.config.generatedClickInfo&&(b.addCouponToClick(e),d.processedData.processedCoupons.push(e))}processEmail(e){e=m.sanitizeEmail(e),m.isValidEmail(e)&&this.sendLeadEvent(e,h.getSourceTagIfPresent())}processFirstName(e){var t;d.config.generatedClickInfo&&(e=C.sanitizeFirstOrLastName(e),t=d.config.generatedClickInfo.clickId,d.processedData.processedFirstNames.includes(e+t)||(b.addFirstNameToClick(e),d.processedData.processedFirstNames.push(e+t)))}processLastName(e){var t;d.config.generatedClickInfo&&(e=C.sanitizeFirstOrLastName(e),t=d.config.generatedClickInfo.clickId,d.processedData.processedLastNames.includes(e+t)||(b.addLastNameToClick(e),d.processedData.processedLastNames.push(e+t)))}processFullName(e){e=C.sanitizeFullName(e);0<e.length&&this.processFirstName(e[0]),1<e.length&&this.processLastName(e[1])}processDniNumber(e){d.config.generatedClickInfo&&(e={id:d.config.generatedClickInfo.clickId,productId:c.product.id,dniNumber:e,creationDate:d.config.generatedClickInfo.creationDate},b.updateClickRequest(e))}processConsentEvent(e){Object.values(ue).includes(e)&&e!==d.lead.adOptimizationConsent&&(d.lead.adOptimizationConsent=e,c.config.clientUseCustomConsentEvent=!0)}processLeadStage(e){d.processedData.processedLeadStage!==e&&(d.processedData.processedLeadStage=e)}processCity(e){var t;d.config.generatedClickInfo&&(e=C.sanitizeString(e),t=d.config.generatedClickInfo.clickId,d.processedData.processedCities.includes(e+t)||(b.addCityToClick(e),d.processedData.processedCities.push(e+t)))}processCountry(e){var t;d.config.generatedClickInfo&&(e=C.sanitizeString(e),t=d.config.generatedClickInfo.clickId,d.processedData.processedCountries.includes(e+t)||(b.addCountryToClick(e),d.processedData.processedCountries.push(e+t)))}processState(e){var t;d.config.generatedClickInfo&&(e=C.sanitizeString(e),t=d.config.generatedClickInfo.clickId,d.processedData.processedStates.includes(e+t)||(b.addStateToClick(e),d.processedData.processedStates.push(e+t)))}processStreet(e){var t;d.config.generatedClickInfo&&(e=C.sanitizeString(e),t=d.config.generatedClickInfo.clickId,d.processedData.processedStreets.includes(e+t)||(b.addStreetToClick(e),d.processedData.processedStreets.push(e+t)))}processZipCode(e){var t;d.config.generatedClickInfo&&(e=C.sanitizeString(e),t=d.config.generatedClickInfo.clickId,d.processedData.processedZipCodes.includes(e+t)||(b.addZipCodeToClick(e),d.processedData.processedZipCodes.push(e+t)))}processAddress(e){var t;d.config.generatedClickInfo&&(e=C.sanitizeString(e),t=d.config.generatedClickInfo.clickId,d.processedData.processedAddresses.includes(e+t)||(b.addAddressToClick(e),d.processedData.processedAddresses.push(e+t)))}},xe=new class{initCustomListeners(){this.customListener("leadUpdate",e=>S.processLeadUpdateListener(e))}customListener(e,t){o().events.onCustomEvent(e,e=>t({detail:e}))}},Ve=new class{init(){window.hrs=(()=>{let t=(e,t,r="leadUpdate")=>{t={value:t,type:e};o().events.dispatchEvent(r,t)};return{addLeadTag:function(e){t("addLeadTag",e)},addLeadPhone:function(e){t("addLeadPhone",e)},addLeadConsent:function(e){t("addConsent",e)},addLeadStage:function(e){t("addLeadStage",e)}}})()}},Ke=class{constructor(){r(this,"browserClock"),r(this,"zero"),"undefined"!=typeof performance&&performance.now?(this.browserClock=performance,this.zero=performance.now()):(this.browserClock=Date,this.zero=Date.now())}now(){return this.browserClock.now()-this.zero}nowSec(){return Math.floor((this.browserClock.now()-this.zero)/1e3)}},We=new class{constructor(){r(this,"totalTimeSpentMs"),r(this,"lastActivityTimeMs"),r(this,"clock"),r(this,"lastReportedTimeSpent"),r(this,"isPageActive")}resetTimer(){this.clock=new Ke,this.totalTimeSpentMs=0,this.lastActivityTimeMs=this.clock.now(),this.lastReportedTimeSpent=null,this.isPageActive="visible"===document.visibilityState&&document.hasFocus()}getTotalTimeSpentSec(){var e=Math.floor(this.totalTimeSpentMs/1e3);return 16e8<e?0:e}attachMouseMovementListener(){if(c.config.timeSpentTrackingEnabled){this.resetTimer();var e=["mousemove","wheel","keydown","click","touchstart"];let r=()=>{var e,t;this.isPageActive&&(t=(e=this.clock.now())-this.lastActivityTimeMs,this.lastActivityTimeMs=e,t<3e3)&&(this.totalTimeSpentMs+=t)};{let t=o();e.forEach(e=>t.events.onCustomEvent(e,r)),t.events.onPageVisibilityState(()=>this.markPageInactive(),"n"),t.events.onPageVisibilityState(()=>this.markPageActive(),"v")}}}reportTimeSpent(){var e=this.getTotalTimeSpentSec();null!==this.lastReportedTimeSpent&&this.lastReportedTimeSpent===e||(this.clock.nowSec()<e?T.sendErrorReport("Reporting time spent inconsistent","ar",{errorType:"INVALID_TIME",serviceWhereErrorOriginated:"ACTIVITY"}):(v.timeSpent=e.toString(),y.flushCachedClickUpdate(),this.lastReportedTimeSpent=e))}markPageActive(){this.isPageActive=!0,this.lastActivityTimeMs=this.clock.now()}markPageInactive(){this.isPageActive=!1}},qe=(e=>(e.GOOGLE="wickedsource",e.FACEBOOK="WickedSource",e))({}),je=(e=>(e.GOOGLE="wickedid",e.FACEBOOK="WickedID",e))({}),ze=(e=>(e.SNAPCHAT="snapchat",e))({}),Ye=(e=>(e.FACEBOOK="fbadid",e.GOOGLE="gadid",e.TIKTOK="ttadid",e.TIKTOK_OR_FACEBOOK="tw_adid",e))({});var Je=(e=>(e.SOURCE_LINK_TAG="sourceLinkTag",e.FB_AD_SET_ID="fbAdSetId",e.BING_AD_GROUP_ID="bingAdGroupId",e.HYROS_CAMPAIGN_ID="hyrosCampaignId",e.GOOGLE_CAMPAIGN_ID="googleCampaignId",e.GOOGLE_ADGROUP_ID="googleAdgroupId",e.HYROS_AD_ID="hyrosAdId",e.TIKTOK_AD_GROUP_ID="tiktokAdGroupId",e.SNAPCHAT_AD_SET_ID="snapchatAdSetId",e.LINKEDIN_CAMPAIGN_ID="linkedinCampaignId",e.TWITTER_ADGROUP_ID="twitterAdgroupId",e.PINTEREST_AD_GROUP_ID="pinterestAdGroupId",e.WR_AD_ID="wrAdId",e.TW_AD_ID="twAdId",e.HYROS_AD_NAME="hyrosAdName",e.WHOP_AD_GROUP_ID="whopAdGroupId",e.WHOP_AD_ID="whopAdId",e))({});var $e=new class{constructor(){r(this,"logger",a.forComponent("brwr"))}normalizeBrowserUrl(){h.tryGetDocumentVariables();try{c.config.deleteParams&&o().location.replaceState(this.getNormalizedBrowserUrl())}catch(e){c.config.deleteParams=!1,this.logger.debugError("E_P: "+(e instanceof Error?e.message:e))}}parseHyrosParams(){var t,r={};if(r.previousUrl=c.config.prevOverride||E.getPreviousUrl(),r.userAgent=o().dom.userAgent,r.uniqueCheckoutId=d.checkout.uniqueCheckoutId,r.embedScriptOnIframes=c.config.embedScriptOnIframes,r.refUrl=c.config.refOverride||E.getReferrerUrl(),E.isValidURL(d.config.userEventUrl)&&this.getAdspendParams(r,d.config.userEventUrl),this.ifAnyAdspendParamExists(r)||this.getAdspendParams(r,h.getBrowserHref()),this.ifAnyAdspendParamExists(r)||r.refUrl===h.getBrowserHref()||this.getAdspendParams(r,r.refUrl),c.config.ignorePrevUrl||this.ifAnyAdspendParamExists(r)||this.getAdspendParams(r,r.previousUrl),this.ifAnyAdspendParamExists(r)||0<(n=o().performance.getEntriesByType("navigation").filter(t=>Ee().some(function(e){return t.name.includes(e)}))).length&&(r.refUrl=encodeURI(n[0].name),this.getAdspendParams(r,r.refUrl)),r.fbClickId=C.preprocessClickId(r.fbClickId),!this.ifAnyAdspendParamExists(r)){var a,n=h.getUrlValueFromCustomParam(u.MANY_CHAT_PARAMS,"mch");let e=[];for(a of e=null!==n?decodeURIComponent(n).split(Ne):e){var s=a.split("=")[0],i=a.split("=")[1];"sl"!==s&&!h.isMatchingCustomParam(u.SOURCE_LINK,s)||(r.sourceLinkTag=i),"el"!==s&&!h.isMatchingCustomParam(u.EMAIL_SOURCE,s)||(r.sourceLinkTag=i),r.isEmailSource="el"===s||h.isMatchingCustomParam(u.EMAIL_SOURCE,s),"fbc_id"!==s&&!h.isMatchingCustomParam(u.FB_AD_SET_ID,s)||(r.fbAdSetId=i),"bng_id"!==s&&!h.isMatchingCustomParam(u.BING_AD_GROUP_ID,s)||(r.bingAdGroupId=i),"bng_special_campaign"!==s&&!h.isMatchingCustomParam(u.BING_SPECIAL_CAMPAIGN,s)||(r.bingSpecialCampaign="true"===i),"h_campaign_id"!==s&&!h.isMatchingCustomParam(u.HYROS_CAMPAIGN_ID,s)||(r.hyrosCampaignId=i),"gc_id"!==s&&!h.isMatchingCustomParam(u.G_CAMPAIGN_ID,s)||(r.googleCampaignId=i),"h_ga_id"!==s&&!h.isMatchingCustomParam(u.G_ADGROUP_ID,s)||(r.googleAdGroupId=i),"g_special_campaign"!==s&&!h.isMatchingCustomParam(u.G_SPECIAL_CAMPAIGN,s)||(r.gSpecialCampaign="true"===i),"fbclid"!==s&&!h.isMatchingCustomParam(u.FB_CLICK_ID,s)||(r.fbClickId=null!=(t=Le.sanitize(i,"manychat"))?t:r.fbClickId),"gclid"!==s&&!h.isMatchingCustomParam(u.G_CLICK_ID,s)||(r.googleClickId=i),"wbraid"!==s&&!h.isMatchingCustomParam(u.W_BRA_ID,s)||(r.wBraId=i),"gbraid"!==s&&!h.isMatchingCustomParam(u.G_BRA_ID,s)||(r.gBraId=i),"h_ad_id"!==s&&!h.isMatchingCustomParam(u.HYROS_AD_ID,s)||(r.hyrosAdId=i),"ttclid"!==s&&!h.isMatchingCustomParam(u.TT_CLICK_ID,s)||(window.tiktokClickId=i),"rdt_id"!==s&&!h.isMatchingCustomParam(u.RDT_AD_GROUP_ID,s)||(window.rdtAdGroupId=i),"rdt_clid"!==s&&!h.isMatchingCustomParam(u.RDT_CLICK_ID,s)||(r.rdtClickId=i),"fb_cl_id"==s&&(r.fbClickId=null!=(t=Le.sanitize(i,"manychat"))?t:r.fbClickId),"g_cl_id"==s&&(r.googleClickId=i),"is_el"==s&&(r.isEmailSource="true"==i),"ttclid"==s&&(window.tiktokClickId=i),"rdt_clid"==s&&(r.rdtClickId=i),"apl_id"==s&&(r.aplCampaignId=i)}}return this.ifAnyAdspendParamExists(r)||(r.wrSource=this.getWRSource(),r.wrAdId=this.getWRAdId(r)),this.ifAnyAdspendParamExists(r)||this.getTwParams(r,h.getBrowserHref())||c.config.ignorePrevUrl||this.getTwParams(r,h.getDocumentReferrer()),r.fbClickId=P.fbcFallback(r.fbClickId),r.googleClickId=P.googleClickIdFallback(r.googleClickId),r.tiktokClickId=P.tiktokClickIdFallback(r.tiktokClickId),r.rdtClickId=P.rdtClickIdFallback(r.rdtClickId),r.isEmailSource=d.processedData.isEmailSource,r}attachUserUrlEventListener(){let r=this.logger;window.addEventListener("hyros_url",function(e){var t,e=e.detail;!e||(t=e.productHash)&&t!==l.hash||(E.isValidURL(t=e.url)?d.config.userEventUrl!==t&&(d.config.userEventUrl=t):r.debugError("[HTS] User passed URL not valid"))}),window.dispatchEvent(new CustomEvent("hyros_user_url_listener_attached"))}getNormalizedBrowserUrl(){var e=o().location.href.replace("/?","?"),[e,t]=e.substring(e.lastIndexOf("/")+1).split("?");let r=new URLSearchParams(t);return Ee().forEach(e=>r.delete(e)),Object.values(u).forEach(e=>{e.split(",").map(e=>e.trim()).filter(Boolean).forEach(e=>r.delete(e))}),e+((r.toString()&&"?")+decodeURIComponent(r.toString()))}getTwParams(e,t){var r,a=this.getTwAdSource(t);return!(!a||((r=this.getTWAdId(t))?(e.twSource=a,e.twAdId=r,0):"google"!==a||!(r=h.getUrlParam("tw_campaign",!1,t))||(e.twSource=a,e.hyrosCampaignId=r,0)))}getTwAdSource(e){e=e||h.getBrowserHref();return e.includes("fbadid")?"facebook":e.includes("gadid")?"google":e.includes("ttadid")?"tiktok":e.includes("tw_adid")?this.getTwSourceByParam("tw_source",e)||this.getTwSourceByParam("utm_source",e):""}getTwSourceByParam(e,t){e=h.getUrlParam(e,!1,t);return"fb"===e||"ig"===e||"instagram"===e||"facebook_instagram"===e||"msg"===e||"an"===e?"facebook":"tiktok"===e||"facebook"===e||"google"===e?e:""}getTWAdId(e){var t,r;for(r of Object.values(Ye))if(t=h.getUrlParam(r,!1,e))return t;return null}getAdspendParams(e,t){e.sourceLinkTag=h.getSourceTagIfPresent(t),e.fbAdSetId=h.getUrlValueFromCustomParam(u.FB_AD_SET_ID,"fbc_id",!0,t),e.bingAdGroupId=h.getUrlValueFromCustomParam(u.BING_AD_GROUP_ID,"bng_id",!0,t),e.bingSpecialCampaign="true"==h.getUrlValueFromCustomParam(u.BING_SPECIAL_CAMPAIGN,"bng_special_campaign",!0,t),e.hyrosCampaignId=h.getUrlValueFromCustomParam(u.HYROS_CAMPAIGN_ID,"h_campaign_id",!0,t),e.googleCampaignId=h.getUrlValueFromCustomParam(u.G_CAMPAIGN_ID,"gc_id",!0,t),e.googleAdGroupId=h.getUrlValueFromCustomParam(u.G_ADGROUP_ID,"h_ga_id",!0,t),e.gSpecialCampaign="true"==h.getUrlValueFromCustomParam(u.G_SPECIAL_CAMPAIGN,"g_special_campaign",!0,t),e.fbClickId=h.getUrlValueFromCustomParam(u.FB_CLICK_ID,"fbclid",!0,t),e.googleClickId=h.getUrlValueFromCustomParam(u.G_CLICK_ID,"gclid",!0,t),e.wBraId=h.getUrlValueFromCustomParam(u.W_BRA_ID,"wbraid",!0,t),e.gBraId=h.getUrlValueFromCustomParam(u.G_BRA_ID,"gbraid",!0,t),e.hyrosAdId=h.getUrlValueFromCustomParam(u.HYROS_AD_ID,"h_ad_id",!0,t),e.tiktokAdGroupId=h.getUrlValueFromCustomParam(u.TT_AD_GROUP_ID,"ttc_id",!0,t),e.rdtAdGroupId=h.getUrlValueFromCustomParam(u.RDT_AD_GROUP_ID,"rdt_id",!0,t),e.rdtClickId=h.getUrlValueFromCustomParam(u.RDT_CLICK_ID,"rdt_clid",!0,t),e.snapchatAdSetId=h.getUrlValueFromCustomParam(u.SN_AD_SET_ID,"snc_id",!0,t),e.linkedinCampaignId=h.getUrlValueFromCustomParam(u.LNK_CAMPAIGN_ID,"lnk_id",!0,t),e.tiktokClickId=h.getUrlValueFromCustomParam(u.TT_CLICK_ID,"ttclid",!0,t),e.twitterAdgroupId=h.getUrlValueFromCustomParam(u.TWT_ADGROUP_ID,"twt_id",!0,t),e.pinterestAdgroupId=h.getUrlValueFromCustomParam(u.PNT_AD_GROUP_ID,"pnt_id",!0,t),e.paypalUniqueCheckoutId=h.getUrlValueFromCustomParam(u.PAYPAL_UNIQUE_CHECKOUT_ID,"tx",!0,t),e.hyrosKeyword=h.getUrlValueFromCustomParam(u.HYROS_KEYWORD,"h_keyword",!0,t),e.hyrosPlacement=h.getUrlValueFromCustomParam(u.HYROS_PLACEMENT,"h_placement",!0,t),e.hyrosAdName=h.getUrlValueFromCustomParam(u.HYROS_AD_NAME,"h_ad_name",!0,t),e.aplCampaignId=h.getUrlValueFromCustomParam(u.APL_CAMPAIGN_ID,"apl_id",!0,t),e.whopAdGroupId=h.getUrlValueFromCustomParam(u.WHOP_AD_GROUP_ID,"wasid",!0,t),e.whopAdId=h.getUrlValueFromCustomParam(u.WHOP_AD_ID,"waid",!0,t),e.whopCampaignId=h.getUrlValueFromCustomParam(u.WHOP_CAMPAIGN_ID,"wacid",!0,t),e.hyrosCampaignName=h.getUrlValueFromCustomParam(u.HYROS_CAMPAIGN_NAME,"h_campaign_name",!0,t);var r=h.getUrlValueFromCustomParam(u.HYROS_KEYWORD_ID,"h_keyword_id",!0,t);r&&(r=new RegExp("kwd-(\\d+)").exec(r),e.hyrosKeywordId=r?r[1]:null),this.getMiscSourcesParams(e,t)}getMiscSourcesParams(e,t){var r={...e};delete r.sourceLinkTag,this.ifAnyAdspendParamExists(r)||null===e.sourceLinkTag||(e.hyrosTrafficSource=h.getUrlValueFromCustomParam(u.HYROS_TRAFFIC_SOURCE,"htrafficsource",!1,t),e.hyrosCategory=h.getUrlValueFromCustomParam(u.HYROS_CATEGORY,"hcategory",!1,t),e.hyrosGoal=h.getUrlValueFromCustomParam(u.HYROS_GOAL,"hgoal",!1,t))}getWRAdId(e){switch(e.wrSource){case"google":var t=h.getUrlParams("wickedid");return null===e.googleClickId&&(e.googleClickId=C.getFirstNonNumberValue(t)),C.getFirstNumberValue(t);case"Facebook":{let e;for(var r of Object.values(je))if(e=h.getUrlParam(r))return e;return e}default:return null}}getWRSource(){var e=this.getWickedSource();return e||this.getUTMSource()}getWickedSource(){var e,t;for(t of Object.values(qe))if(e=h.getUrlParam(t))return e;return null}getUTMSource(){var e,t=h.getUrlParam("utm_source");for(e of Object.values(ze))if(t===e)return t;return null}ifAnyAdspendParamExists(e){return 0<Object.entries(e).filter(([e,t])=>Object.values(Je).includes(e)&&null!==t).length}},Xe=new class{constructor(){r(this,"logger",a.forComponent("cart"))}setCartIdInterval(){let t=setInterval(async()=>{try{var e;d.config.cartId?clearInterval(t):(e=await this.getCartId())&&(clearInterval(t),b.addCartIdToClick(e))}catch(e){this.logger.debugError(String(e instanceof Error?e.stack:e))}},3e3)}async getCartId(){var e=await o().cookies.get("cart"),e=null==e?void 0:e.split("%3Fkey")[0].split("?key")[0];return e?(this.logger.info(e),d.config.cartId=e):null}},k=class k{static appendFingerprintingScript(){c.config.trackDeviceFingerprint&&"undefined"==typeof HyrosFP&&(s.FINGERPRINT_SCRIPT?d.processedData.fingerprintLoadPromise=new Promise((t,r)=>{var a=document.createElement("script");if(null!=(n=globalThis.URL)&&n.createObjectURL){var n=new Blob([s.FINGERPRINT_SCRIPT],{type:"text/javascript"});let e=URL.createObjectURL(n);a.src=e,a.onload=()=>{URL.revokeObjectURL(e),t()},a.onerror=()=>{URL.revokeObjectURL(e),r(new Error("object url script tag error"))}}else a.src="data:text/javascript;base64,"+btoa(s.FINGERPRINT_SCRIPT),a.onload=()=>t(),a.onerror=()=>r(new Error("code in script.src tag error"));document.head.appendChild(a)}).then(()=>k.waitForGlobalFp()).then(e=>new e.Thumbmark).catch(e=>{T.sendErrorReport(e,"fp",{serviceWhereErrorOriginated:"FINGERPRINT",errorType:"LOAD_FAILED"}),c.config.trackDeviceFingerprint=!1}):(T.sendErrorReport("Fingerprinting is enabled but no fingerprint script is available","fp",{serviceWhereErrorOriginated:"FINGERPRINT",errorType:"LOAD_FAILED"}),c.config.trackDeviceFingerprint=!1))}static waitForGlobalFp(n=50){return new Promise((e,t)=>{let r=3,a=()=>{"undefined"!=typeof HyrosFP?e(HyrosFP):r<1?t(new Error('Max Retries exceeded waiting for "HyrosFP" global')):(r--,setTimeout(a,n))};a()})}static async generateDeviceFingerprint(){try{var e,t,r;return c.config.trackDeviceFingerprint?0<d.config.dvfp.length?d.config.dvfp:(e=await d.processedData.fingerprintLoadPromise)?(r=(t=await e.get()).thumbmark,d.config.dvfp=r,d.config.fingerprintData=btoa(JSON.stringify(t)),t.error&&T.sendErrorReport(JSON.stringify(t.error),"fp",{serviceWhereErrorOriginated:"FINGERPRINT",errorType:"COMPUTATION"}),this.logger.info(""),r):null:null}catch(e){return T.sendErrorReport(e instanceof Error?e:String(e),"fp",{serviceWhereErrorOriginated:"FINGERPRINT",errorType:"COMPUTATION_UNEXPECTED"}),null}}static async generateSecondFingerprint(){try{var e,t,r;c.config.trackDeviceFingerprint&&(e=d.config.dvfp,d.config.deviceFingerprint="",null!=(t=await k.generateDeviceFingerprint()))&&t!==e&&(d.config.dvfp=t,r={id:d.config.generatedClickInfo.clickId,productId:c.product.id,creationDate:d.config.generatedClickInfo.creationDate,dvfp:t},b.updateClickRequest(r))}catch(e){this.logger.debugError("[fp2] "+(e instanceof Error?e.stack:e))}}},Ze=(r(k,"logger",a.forComponent("fp")),k),w=new class{constructor(){r(this,"logger",a.forComponent("pc")),r(this,"clickProcessedSubscribers",[]),r(this,"httpClient")}getClient(){var e;return this.httpClient||(e=o().http,this.httpClient=e.createDefaultHttpClient(e.getTrackingUrl(""))),this.httpClient}async processClick(){var e=await this.generateProcessClickRequest(),t={headers:_.getFetchIdHeaders(),withCredentials:!0};try{var r,a=await this.getClient().get(e,t);if(!a.ok&&a.error)throw r="transport-error"===a.error.type?a.error.message:a.error.rawBody,new Error(a.error.type+": "+r);c.config.useFetchKeepAlive&&o().events.dispatchEvent("hClickDoneEvent",{success:void 0,productHash:l.hash});var n=a.response;if("body"in n.data)throw this.debugResponseError(n.data),new Error("Backend rejected click request");this.logger.info(""),d.config.generatedClickInfo=n.data,this.emitClickProcessed({success:!0,clickInfo:d.config.generatedClickInfo}),o().events.dispatchEvent("hClickDoneEvent",{success:!0,productHash:l.hash}),this.trySendCachedCAPEvent()}catch(e){this.emitClickProcessed({success:!1,error:e}),T.sendErrorReport(e instanceof Error?e:String(e),"pc",{serviceWhereErrorOriginated:"CLICK_B_SERVICE",errorType:"ENDPOINT_DID_NOT_RETURN_200"}),o().events.dispatchEvent("hClickDoneEvent",{success:!1,productHash:l.hash})}}onClickProcessed(t){return this.clickProcessedSubscribers.push(t),()=>{this.clickProcessedSubscribers=this.clickProcessedSubscribers.filter(e=>e!==t)}}whenClickSucceeds(e,t){return t&&d.config.generatedClickInfo?Promise.resolve(d.config.generatedClickInfo):new Promise(t=>{let r,a=this.onClickProcessed(e=>{e.success&&(a(),clearTimeout(r),t(e.clickInfo))});null!=e&&(r=setTimeout(()=>{a(),t(void 0)},e))})}emitClickProcessed(e){for(var t of[...this.clickProcessedSubscribers])try{t(e)}catch(e){this.logger.error(e instanceof Error?e.stack:String(e))}}trySendCachedCAPEvent(){var e,t;null!==d.processedData.cachedCAPEvent&&({typeKey:e,value:t}=d.processedData.cachedCAPEvent,He.sendEvent(e,t),d.processedData.cachedCAPEvent=null,this.logger.debugInfo("[CAP] Cached event sent"))}debugResponseError(e){Be().includes(e.body)?this.logger.debugWarn("[pc]"+e.body):"error"===e.status&&T.sendErrorReport(e.body,"pc",{serviceWhereErrorOriginated:"CLICK_B_SERVICE",errorType:"BACKEND_REJECTED_REQUEST"})}async generateProcessClickRequest(){var e=$e.parseHyrosParams(),t=new URLSearchParams,r=c.endpoints.processClick,e=(e.fbAdSetId&&t.append("fbc_id",e.fbAdSetId),e.bingAdGroupId&&t.append("bng_id",e.bingAdGroupId),e.bingSpecialCampaign&&t.append("bng_special_campaign",""+e.bingSpecialCampaign),e.hyrosCampaignId&&t.append("h_campaign_id",e.hyrosCampaignId),e.googleCampaignId&&t.append("gc_id",e.googleCampaignId),e.googleAdGroupId&&t.append("h_ga_id",e.googleAdGroupId),e.gSpecialCampaign&&t.append("g_special_campaign",""+e.gSpecialCampaign),e.hyrosAdId&&(e.fbAdSetId||e.googleCampaignId||e.googleAdGroupId||e.tiktokAdGroupId||e.pinterestAdgroupId||e.snapchatAdSetId||e.bingAdGroupId||e.hyrosCampaignId||e.rdtAdGroupId||e.linkedinCampaignId||e.aplCampaignId)&&t.append("h_ad_id",e.hyrosAdId),e.fbClickId&&t.append("fb_cl_id",e.fbClickId),e.googleClickId&&t.append("g_cl_id",e.googleClickId),e.wBraId&&t.append("w_bra_id",e.wBraId),e.gBraId&&t.append("g_bra_id",e.gBraId),e.sourceLinkTag&&t.append("sl",""+e.sourceLinkTag),e.isEmailSource&&t.append("is_el",""+e.isEmailSource),e.previousUrl&&t.append("prev_url",e.previousUrl),e.refUrl&&t.append("ref_url",e.refUrl),e.userAgent&&t.append("u_agent",e.userAgent),e.tiktokAdGroupId&&t.append("ttc_id",e.tiktokAdGroupId),e.uniqueCheckoutId&&t.append("u_ch_id",""+e.uniqueCheckoutId),e.snapchatAdSetId&&t.append("snc_id",e.snapchatAdSetId),e.twitterAdgroupId&&t.append("twt_id",e.twitterAdgroupId),e.pinterestAdgroupId&&t.append("pnt_id",e.pinterestAdgroupId),e.embedScriptOnIframes&&t.append("embed",""+e.embedScriptOnIframes),e.linkedinCampaignId&&t.append("lnk_id",e.linkedinCampaignId),e.tiktokClickId&&t.append("ttclid",e.tiktokClickId),e.rdtAdGroupId&&t.append("rdt_id",e.rdtAdGroupId),e.rdtClickId&&t.append("rdt_clid",e.rdtClickId),e.wrSource&&t.append("wr_source",e.wrSource),e.wrAdId&&t.append("wr_ad_id",e.wrAdId),e.twAdId&&t.append("tw_ad_id",e.twAdId),e.twSource&&t.append("tw_source",e.twSource),e.paypalUniqueCheckoutId&&t.append("u_ch_id",e.paypalUniqueCheckoutId),e.hyrosTrafficSource&&t.append("h_traffic_source",e.hyrosTrafficSource),e.hyrosCategory&&t.append("h_category",e.hyrosCategory),e.hyrosGoal&&t.append("h_goal",e.hyrosGoal),e.hyrosKeyword&&t.append("h_keyword",e.hyrosKeyword),e.hyrosKeywordId&&t.append("h_keyword_id",e.hyrosKeywordId),e.hyrosPlacement&&t.append("h_placement",e.hyrosPlacement),e.hyrosAdName&&t.append("h_ad_name",e.hyrosAdName),e.aplCampaignId&&t.append("apl_id",e.aplCampaignId),e.whopAdGroupId&&t.append("wasid",e.whopAdGroupId),e.whopAdId&&t.append("waid",e.whopAdId),e.whopCampaignId&&t.append("wacid",e.whopCampaignId),e.hyrosCampaignName&&t.append("h_campaign_name",e.hyrosCampaignName),d.processedData.dniPhoneNumber&&t.append("dni_number",d.processedData.dniPhoneNumber),await Ze.generateDeviceFingerprint());return null!=e&&t.append("fp",e),d.config.cartId?t.append("h_cart_id",d.config.cartId):(e=await Xe.getCartId())&&t.append("h_cart_id",e),h.getUrlValueFromCustomParam(u.EMAIL_TRAFFIC,"he",!1)&&h.getUrlValueFromCustomParam(u.EMAIL_SOURCE,"el",!1)&&t.append("is_he","true"),r+"?"+t.toString()}attachClickTimeProcessingListeners(){(c.config.timeSpentTrackingEnabled||c.config.thirdPartyTracking||c.config.unifiedClickEvent)&&(document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(c.config.timeSpentTrackingEnabled?We.reportTimeSpent():y.flushCachedClickUpdate())}),We.attachMouseMovementListener())}},Qe=new class{constructor(){r(this,"logger",a.forComponent("shpt"))}appendShopifyPostPurchasePageScriptIfNecessary(){var e;c.config.shopifyPostPurchasePageScript&&(window.Shopify&&window.Shopify.on&&(window.fbq||window.gtag)&&!window.isShopifyCheckoutAmendedListenerSetUp?(window.isShopifyCheckoutAmendedListenerSetUp=!0,window.Shopify.on("CheckoutAmended",(e,t)=>{t=t.order||t;let r=new Set(t.lineItems.map(e=>e.id));t=e.lineItems.filter(e=>r.has(e.id));0!==t.length&&this.generatePurchaseConversion(t[0].finalLinePrice,e.currency)}),window.Shopify.wasPostPurchasePageSeen||(e=window.Shopify.order,this.generatePurchaseConversion(e.totalPrice,e.currency))):this.logger.debugWarn("[NTPF]"))}generatePurchaseConversion(e,t){window.fbq&&(fbq("track","Purchase",{value:e,currency:t},{eventID:Math.random().toString(36).substr(2,15)}),this.logger.info("[fbq]")),window.gtag&&(gtag("event","Purchase",{value:e,currency:t}),this.logger.info("[gtag]"))}},et=new class{constructor(){r(this,"logger",a.forComponent("othr"))}attachUniqueCheckoutIdListener(){for(let t of[{name:"kartraReferenceIdLoaded",data:null}])o().events.onCustomEvent(t.name,e=>{this.uniqueCheckoutIdListenerHandler(t.data)({detail:e})})}attachUrlChangeListener(){let a=o();if(c.config.spaEnabled&&a.features.canReplaceUrl){let t=encodeURI(h.getDocumentUrl()),r=async e=>{(null==(e=e.detail)?void 0:e.productHash)==l.hash&&(d.config.spaPrevUrl=t,c.config.timeSpentTrackingEnabled&&(We.reportTimeSpent(),We.resetTimer()),await w.processClick().then(()=>a.service.emailTrackingBService.processEmailTrackingAndLeadCreation()).catch(()=>a.service.emailTrackingBService.processEmailTrackingAndLeadCreation()),t=E.getReferrerUrl())};o().events.onCustomEvent("locationchange",e=>{r({detail:e})}),o().events.onCustomEvent("popstate",()=>{o().events.dispatchEvent("locationchange",{productHash:l.hash})}),history.pushState=(t=>function(){var e=t.apply(this,arguments);return o().events.dispatchEvent("pushState",{productHash:l.hash}),o().events.dispatchEvent("locationchange",{productHash:l.hash}),e})(history.pushState)}}uniqueCheckoutIdListenerHandler(t){return async e=>{var e=t?e.detail[t]:e.detail;this.logger.debugInfo("[uCId]"),d.checkout.uniqueCheckoutId=e,d.config.generatedClickInfo&&(d.config.uniqueCheckoutUpdateSent?await w.processClick():(e={id:d.config.generatedClickInfo.clickId,productId:c.product.id,uniqueCheckoutId:d.checkout.uniqueCheckoutId,creationDate:d.config.generatedClickInfo.creationDate},d.config.uniqueCheckoutUpdateSent=!0,b.updateClickRequest(e)))}}},tt=new class{constructor(){r(this,"logger",a.forComponent("bolt"))}attachBoltEventListener(){let t=1,r=this.logger,a=setInterval(function(){var e;try{"undefined"==typeof BoltCheckout?15<t++&&clearInterval(a):(clearInterval(a),window.BoltCheckout.setClientCustomCallbacks?window.BoltCheckout.setClientCustomCallbacks({onEmailEnter:function(e){o().events.dispatchEvent("hyros_email",{email:e})},success:function(e,t){t()}}):null!=(e=window.bolt_callbacks)&&e.onEmailEnter&&void 0===window.hyros_bolt_callback_on_email_enter&&(window.hyros_bolt_callback_on_email_enter=window.bolt_callbacks.onEmailEnter,window.bolt_callbacks.onEmailEnter=function(e){o().events.dispatchEvent("hyros_email",{email:e}),window.hyros_bolt_callback_on_email_enter(e)}))}catch(e){r.debugError(String(e instanceof Error?e.message:e)),clearInterval(a)}},200)}},rt=new class{constructor(){r(this,"logger",a.forComponent("gle"))}attachGlobalECheckoutEventListener(){let t=1,r=this.logger,a=setInterval(function(){try{var e;void 0===window.glegem?15<t++&&clearInterval(a):(e=window.glegem||function(...e){window.glegem.q=window.glegem.q||[],window.glegem.q.push(e)},clearInterval(a),e("OnCheckoutStepLoaded",function(e){r.debugInfo("Recv: "+JSON.stringify(e)),"undefined"!==e.StepId&&e.StepId===e.Steps.CONFIRMATION&&!0===e.IsSuccess&&!0!==e.IsPageReload&&null!==(e=e.details.CustomerDetails.BillingAddress.BillingEmail)&&S.sendLeadEvent(e,h.getSourceTagIfPresent())}))}catch(e){r.debugError(String(e instanceof Error?e.stack:e)),clearInterval(a)}},200)}},at=["onFormSubmit","onBeforeFormSubmit","onFormSubmitted"],nt=[[0,Ie().map(e=>e.toLowerCase())],[1,[...be(),"phone","phonenumber","phone_number","mobilephone","mobile_phone","mobile"]],[5,f.getNameVariants(2)],[4,f.getNameVariants(1)],[3,f.getNameVariants(0)],[6,[...I.AddressOptions,"address","address1","street_address"]],[7,[...I.StreetOptions,"street","address2"]],[8,[...I.CityOptions,"city"]],[9,[...I.StateOptions,"state","region"]],[10,[...I.CountryOptions,"country"]],[11,[...I.ZipCodeOptions,"zip","zipcode","postal_code","postcode"]]],st=[3,4,5,6,7,8,9,10,11,1,0],it=new class{constructor(){r(this,"logger",a.forComponent("hsf"))}attachHubSpotFormListener(){o().events.onCustomEvent("message",e=>this.handleWindowMessage(e))}handleWindowMessage(e){var t;try{var r=null!=(t=null==e?void 0:e.data)?t:e;this.processFormCallback(r)}catch(e){this.logger.debugError("Couldn't process HubSpot form event: "+(e instanceof Error?e.message:JSON.stringify(e)))}}processFormCallback(e){var t;e&&"hsFormCallback"===e.type&&at.includes(e.eventName)&&0!==(t=this.extractFields(e.data)).length&&(this.logger.debugInfo("[hsf] "+e.eventName+" with "+t.length+" field(s)"),this.processFields(t))}extractFields(e){var t,r,e=this.extractSubmissionValues(e),a=[];for([t,r]of Object.entries(e)){var n=this.resolveFieldType(t);null!==n&&"string"==typeof r&&r.trim()&&a.push([n,r.trim()])}return a.sort(([e],[t])=>st.indexOf(e)-st.indexOf(t))}extractSubmissionValues(e){return Array.isArray(e)?e.reduce((e,t)=>(null!=t&&t.name&&(e[t.name]=t.value),e),{}):(null==e?void 0:e.submissionValues)||(e&&"object"==typeof e?e:{})}resolveFieldType(e){var t=this.normalizeFieldName(e);if(t)for(var[r,a]of nt)if(a.includes(t))return r;return null}normalizeFieldName(e){return e?(e=e.toLowerCase().trim().split("/"))[e.length-1].split(".").pop():""}processFields(e){for(var[t,r]of e)try{S.processInputValue(r,t)}catch(e){this.logger.debugError("Couldn't process HubSpot field of type "+t+": "+(e instanceof Error?e.message:String(e)))}}},ot=new class{interceptGoogleTagEvents(){window.dataLayer=window.dataLayer||[];let t=window.dataLayer.push.bind(window.dataLayer);window.dataLayer.push=(...e)=>{e=Array.prototype.slice.apply(e,[0]);return this.processGoogleTagEvent(e),t(...e)}}processGoogleTagEvent(e){e.forEach(e=>{"consent"!==e[0]||"update"!==e[1]&&"default"!==e[1]||c.config.clientUseCustomConsentEvent||(e="granted"===e[2].ad_user_data&&"granted"===e[2].ad_personalization?"GRANTED":"DENIED",lt.updateConsentValue(e))})}},lt=new class{constructor(){r(this,"logger",a.forComponent("cnst")),r(this,"cookieManagers",[{name:"Cookiebot",checkConsent:()=>{var e;return"undefined"!=typeof Cookiebot&&(null==(e=Cookiebot.consent)?void 0:e.marketing)}},{name:"CookiePro",checkConsent:()=>"undefined"!=typeof CookiePro&&CookiePro.GetConsent()}])}checkAllConsents(){let t=!1;this.cookieManagers.forEach(e=>{e.checkConsent()&&(t=!0,this.logger.debugInfo("Cookie consent given through "+e.name),this.updateConsentValue("GRANTED"))}),t||ot.processGoogleTagEvent(window.dataLayer||[])}updateConsentValue(e){e!==d.lead.adOptimizationConsent&&(d.lead.adOptimizationConsent=e,S.sendTrackingEventIfPossible())}},R=class{constructor(){}static checkSpecialClassesForNames(e,t){return e.some(e=>t.includes(e))}static containsClass(e,t){return null==(e=null==e?void 0:e.classList)?void 0:e.contains(t)}static containsClassOrIdOrPlaceholder(e,t,r=[]){if(e.className){var a=[...Array.from(e.classList)].map(e=>e.toLowerCase());if(r.length&&this.checkSpecialClassesForNames(r,a.join("_")))return!0;if(a.some(e=>t.includes(e)))return!0}return t.includes(null!=(a=null==(r=e.id)?void 0:r.toLowerCase())?a:"")||t.includes(null!=(a=null==(r=e.placeholder)?void 0:r.toLowerCase())?a:"")}},N=class{constructor(){}static containsFirstName(e){return R.containsClassOrIdOrPlaceholder(e,f.getNameVariants(0),["f_name","first_name"])}static containsLastName(e){return R.containsClassOrIdOrPlaceholder(e,f.getNameVariants(1),["l_name","last_name"])}static containsFullName(e){return R.containsClassOrIdOrPlaceholder(e,f.getNameVariants(2),["complete_name","full_name"])}static containsAddress(e){return R.containsClassOrIdOrPlaceholder(e,I.AddressOptions)}static containsStreet(e){return R.containsClassOrIdOrPlaceholder(e,I.StreetOptions)}static containsCity(e){return R.containsClassOrIdOrPlaceholder(e,I.CityOptions)}static containsState(e){return R.containsClassOrIdOrPlaceholder(e,I.StateOptions)}static containsCountry(e){return R.containsClassOrIdOrPlaceholder(e,I.CountryOptions)}static containsZipCode(e){return R.containsClassOrIdOrPlaceholder(e,I.ZipCodeOptions)}},ct=new class{constructor(){r(this,"logger",a.forComponent("evl")),r(this,"submitListenerAttached",!1),r(this,"handleFormSubmit",e=>{var e=e.target;"FORM"===(null==e?void 0:e.tagName)&&(e=this.getSubmitPhoneInput(e))&&S.processPhoneNumber(e.value,{forceKeepAlive:!0})})}attachEphemeralInputListeners(){for(var e of["focusout","change","blur"])document.addEventListener(e,({target:e})=>{e instanceof HTMLInputElement&&("email"!==e.type&&"text"!==e.type||R.containsClass(e,"hyros-ignore")||S.processEmail(e.value))},!0)}attachLeadListeners(){var e;this.attachSubmitListener();for(e of Pe().getAllInputs())R.containsClass(e,"hyros-ignore")||this.attachLeadListener(e)}attachLeadListener(e){N.containsFullName(e)?this.attachListener(e,5):N.containsLastName(e)?this.attachListener(e,4):N.containsFirstName(e)?this.attachListener(e,3):N.containsAddress(e)?this.attachListener(e,6):N.containsStreet(e)?this.attachListener(e,7):N.containsCity(e)?this.attachListener(e,8):N.containsState(e)?this.attachListener(e,9):N.containsCountry(e)?this.attachListener(e,10):(N.containsZipCode(e)&&this.attachListener(e,11),A.inputContainsClassOrIdOrPlaceholderPhoneNumber(e)?this.attachListener(e,1):R.containsClass(e,"hyros-coupon")?this.attachListener(e,2):"text"!==e.type&&"email"!==e.type||this.attachListener(e,0))}attachListener(t,r){d.processedData.processedInputs.includes(t)||(S.processInputValue(t.value,r),t.addEventListener("change",function(e){S.processInputValue(t.value,r)}),d.processedData.processedInputs.push(t))}attachSubmitListener(){this.submitListenerAttached||(document.addEventListener("submit",this.handleFormSubmit,!0),this.submitListenerAttached=!0)}getSubmitPhoneInput(e){var t=document.activeElement;if(this.isEligibleSubmitPhoneInput(t,e))return t;var r,t=e.querySelectorAll("input");for(r of Array.from(t))if(this.isEligibleSubmitPhoneInput(r,e))return r;return null}isEligibleSubmitPhoneInput(e,t){return e instanceof HTMLInputElement&&e.form===t&&!(R.containsClass(e,"hyros-ignore")||e.disabled||"hidden"===e.type||!e.value||!A.inputContainsClassOrIdOrPlaceholderPhoneNumber(e)||!A.isValidPhone(e.value))&&this.isVisibleInput(e)}isVisibleInput(e){var t;return!e.hidden&&!e.closest('[hidden], [aria-hidden="true"]')&&"none"!==(null==(t=null==(t=globalThis.getComputedStyle)?void 0:t.call(globalThis,e))?void 0:t.display)&&"hidden"!==(null==t?void 0:t.visibility)}setupNinjaFormsListener(e){let r=null;this.logger.debugInfo("Ninja Forms detected. Adding dedicated listeners...");e.addEventListener("keyup",e=>{var t=e.target;t&&"INPUT"===t.tagName&&"keyup"===e.type&&A.inputContainsClassOrIdOrPlaceholderPhoneNumber(t)&&(e.stopImmediatePropagation(),e.preventDefault(),e=new CustomEvent("ninjaforms_keyup",{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed,detail:{originalEvent:e,value:"value"in t?t.value:null}}),t.dispatchEvent(e))},!0),e.addEventListener("ninjaforms_keyup",e=>{let t=e;e=t.target;"INPUT"===(null==e?void 0:e.tagName)&&"ninjaforms_keyup"===t.type&&A.inputContainsClassOrIdOrPlaceholderPhoneNumber(e)&&(r&&clearTimeout(r),r=setTimeout(()=>{S.processInputValue(t.detail.value,1)},3e3))},!0)}},D=class D{constructor(){r(this,"logger",a.forComponent("blkp"))}processNinjaFormPlugin(){let n=0;new Promise((t,r)=>{let a=()=>{n++;var e=o().dom.querySelectorAll(".nf-form-cont form");0<e.length?(this.logger.info("Ninja Forms plugin found."),t(e)):15<=n?r(new Error(D.NO_NF_ON_PAGE_ERROR)):setTimeout(a,1e3)};a()}).then(e=>e.forEach(e=>ct.setupNinjaFormsListener(e))).catch(e=>{e.message!==D.NO_NF_ON_PAGE_ERROR&&this.logger.error(e.message)})}processBlockingPlugin(){this.processNinjaFormPlugin()}};r(D,"NO_NF_ON_PAGE_ERROR","No NF on page");var dt=new D,p=new class{constructor(){r(this,"framework","Angular"),r(this,"globalVariableTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1};return t.found=e.ng&&"function"==typeof(null==(e=e.ng)?void 0:e.probe),t}),r(this,"constantDOMTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1},e=e.querySelector("[ng-version]");return e&&(t.found=!0,t.version=e.getAttribute("ng-version")),t})}},t=new class{constructor(){r(this,"framework","Ember.js"),r(this,"globalVariableTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1},e=e.Ember||e.Em;return null!=e&&e.GUID_KEY&&(t.version=e.VERSION,t.found=!0),t})}},k=new class{constructor(){r(this,"framework","Gatsby"),r(this,"constantDOMTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1};return t.found=!!e.querySelector("#___gatsby"),t})}},D=new class{constructor(){r(this,"framework","jQuery"),r(this,"globalVariableTest",e=>{var t,r={type:0,framework:this.framework,version:void 0,found:!1},e=e.jQuery||e.$;return null!=(t=null==e?void 0:e.fn)&&t.jquery&&(r.version=e.fn.jquery.replaceAll(/[^\d+.]/g,""),r.found=!0),r})}},ut=new class{constructor(){r(this,"framework","Next.js"),r(this,"globalVariableTest",e=>{var t,r={type:0,framework:this.framework,version:void 0,found:!1};return null!=(t=e.__NEXT_DATA__)&&t.buildId&&(r.version=null==(t=e.next)?void 0:t.version,r.found=!0),r}),r(this,"dynamicDOMTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1};return("__next"===(null==e?void 0:e.id)||"SCRIPT"===(null==e?void 0:e.tagName)&&"__NEXT_DATA__"===e.id)&&(t.found=!0),t})}},pt=new class{constructor(){r(this,"framework","Nuxt"),r(this,"globalVariableTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1},r=!(!e.__NUXT__&&!e.$nuxt);return t.version=(null==(e=null==(e=e.$nuxt)?void 0:e.constructor)?void 0:e.version)||void 0,t.found=r,t}),r(this,"constantDOMTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1},e=!!e.querySelector("#__nuxt");return t.found=e,t}),r(this,"dynamicDOMTest",e=>{var t,r={type:0,framework:this.framework,version:void 0,found:!1};return r.found=!(null==(t=e.__vue__)||!t.$nuxt)||!(null==(t=e.__vue__)||!t.nuxt),r})}},ht=new class{constructor(){r(this,"framework","React"),r(this,"isReactContainer",e=>{if(e){if(e._reactRootContainer)return!0;for(var t in e)if(t.startsWith("__reactContainer"))return!0}return!1}),r(this,"globalVariableTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1},r=!(null==(r=e.React)||!r.Component);return t.version=null==(e=e.React)?void 0:e.version,t.found=r,t}),r(this,"constantDOMTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1},r=!!e.querySelector("#react-root, [data-reactroot]"),e=this.isReactContainer(e.body)||this.isReactContainer(e.body.firstElementChild);return t.found=r||e,t}),r(this,"dynamicDOMTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1};return t.found=this.isReactContainer(e),t})}},gt=new class{constructor(){r(this,"framework","Remix"),r(this,"globalVariableTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1};return e.__remixContext&&(t.version=null,t.found=!0),t}),r(this,"dynamicDOMTest",e=>{var t={type:0,framework:this.framework,version:void 0,found:!1};return"META"===(null==e?void 0:e.tagName)&&"string"==typeof e.name&&e.name.startsWith("remix-")&&(t.found=!0),t})}},mt=new class{constructor(){r(this,"platform","Drupal"),r(this,"globalVariableTest",e=>{var t={type:1,platform:this.platform,found:!1};return null!=(e=e.Drupal)&&e.behaviors&&(t.found=!0),t}),r(this,"constantDOMTest",e=>{var t={type:1,platform:this.platform,found:!1},r=e.querySelector('meta[name="generator"][content^="Drupal"]');let a=/\/sites\/(?:default|all)\/(?:themes|modules|files)/;e=Array.from(e.querySelectorAll("link, style, script")||[]).some(e=>a.test(e.src)||a.test(e.href));return(r||e)&&(t.found=!0),t})}},ft=new class{constructor(){r(this,"platform","Shopify"),r(this,"globalVariableTest",e=>{var t={type:1,platform:this.platform,found:!1};return null!=(e=e.Shopify)&&e.shop&&(t.found=!0),t})}},It=new class{constructor(){r(this,"platform","Wix"),r(this,"globalVariableTest",e=>{var t,r={type:1,platform:this.platform,found:!1};return(null!=(t=e.wixPerformanceMeasurements)&&t.info||null!=(t=e.wixBiSession)&&t.info)&&(r.found=!0),r}),r(this,"constantDOMTest",e=>{var t={type:1,platform:this.platform,found:!1},r=!!e.querySelector("[data-wix-site-id], [data-wix-rendered]"),e=!!e.querySelector('script[src*="wix.com"], script[src*="wixstatic.com"]');return(r||e)&&(t.found=!0),t}),r(this,"dynamicDOMTest",e=>{var t={type:1,platform:this.platform,found:!1};return e instanceof HTMLElement&&(e.dataset.wixSiteId||e.dataset.wixRendered)&&(t.found=!0),t})}},Ct=new class{constructor(){r(this,"platform","Wiz"),r(this,"globalVariableTest",e=>{var t={type:1,platform:this.platform,found:!1};return null!=(e=e.document)&&e.__wizdispatcher&&(t.found=!0),t})}},Et=new class{constructor(){r(this,"platform","WooCommerce"),r(this,"globalVariableTest",e=>{var t={type:1,platform:this.platform,found:!1};return(e.wc_add_to_cart_params||e.wc_cart_fragments_params||e.woocommerce_params)&&(t.found=!0),t}),r(this,"constantDOMTest",e=>{var t={type:1,platform:this.platform,found:!1},r=!(null==(r=e.body)||!r.classList.contains("woocommerce"))||!(null==(r=e.body)||!r.classList.contains("woocommerce-page")),a=!!e.querySelector('link[href*="woocommerce"], script[src*="woocommerce"]'),e=!!e.querySelector(".woocommerce, .woocommerce-cart, .woocommerce-checkout");return(r||a||e)&&(t.found=!0),t}),r(this,"dynamicDOMTest",e=>{var t={type:1,platform:this.platform,found:!1};return null!=e&&e.classList&&(e.classList.contains("woocommerce")||e.classList.contains("woocommerce-cart")||e.classList.contains("woocommerce-checkout"))&&(t.found=!0),t})}},_t=new class{constructor(){r(this,"platform","WordPress"),r(this,"constantDOMTest",e=>{var t={type:1,platform:this.platform,found:!1},r=!!e.querySelector('link[rel="https://api.w.org/"]'),e=0<e.querySelectorAll('link[href*="wp-includes"], script[src*="wp-includes"]').length;return(r||e)&&(t.found=!0),t})}},O=new class{constructor(e){r(this,"channels",{[0]:[],1:[],2:[]}),r(this,"getCheckerResultsForData",(e,t)=>this.channels[e].map(e=>({groupId:e.groupId,...e.subscriber(t)}))),r(this,"unsubscribeFromAll",r=>{Object.values(this.channels).forEach((e,t)=>{this.channels[t]=e.filter(e=>e.groupId!==r)})}),r(this,"unsubscribeAll",()=>{Object.values(this.channels).forEach((e,t)=>{this.channels[t]=[]})}),r(this,"getCheckersCountForChannel",e=>this.channels[e].length),this.channels=e}}({[0]:[{groupId:ht.framework,subscriber:ht.globalVariableTest},{groupId:p.framework,subscriber:p.globalVariableTest},{groupId:t.framework,subscriber:t.globalVariableTest},{groupId:D.framework,subscriber:D.globalVariableTest},{groupId:ut.framework,subscriber:ut.globalVariableTest},{groupId:pt.framework,subscriber:pt.globalVariableTest},{groupId:gt.framework,subscriber:gt.globalVariableTest},{groupId:1..toString(),subscriber:ft.globalVariableTest},{groupId:1..toString(),subscriber:mt.globalVariableTest},{groupId:1..toString(),subscriber:It.globalVariableTest},{groupId:1..toString(),subscriber:Ct.globalVariableTest},{groupId:1..toString(),subscriber:Et.globalVariableTest}],1:[{groupId:ht.framework,subscriber:ht.constantDOMTest},{groupId:p.framework,subscriber:p.constantDOMTest},{groupId:k.framework,subscriber:k.constantDOMTest},{groupId:pt.framework,subscriber:pt.constantDOMTest},{groupId:1..toString(),subscriber:mt.constantDOMTest},{groupId:1..toString(),subscriber:It.constantDOMTest},{groupId:1..toString(),subscriber:Et.constantDOMTest},{groupId:1..toString(),subscriber:_t.constantDOMTest}],2:[{groupId:ht.framework,subscriber:ht.dynamicDOMTest},{groupId:ut.framework,subscriber:ut.dynamicDOMTest},{groupId:pt.framework,subscriber:pt.dynamicDOMTest},{groupId:gt.framework,subscriber:gt.dynamicDOMTest},{groupId:1..toString(),subscriber:It.dynamicDOMTest},{groupId:1..toString(),subscriber:Et.dynamicDOMTest}]}),vt=new class{constructor(e){r(this,"nextHandler"),r(this,"foundPlatform",""),r(this,"handle",e=>{var t;1!==e.type?null!=(t=this.nextHandler)&&t.handle(e):e.found&&""===this.foundPlatform&&(this.foundPlatform=e.platform,O.unsubscribeFromAll(e.groupId),d.config.platform=encodeURIComponent(this.foundPlatform))}),r(this,"didFindPlatform",()=>""!=this.foundPlatform),this.nextHandler=e}},yt=new class{constructor(e){r(this,"nextHandler"),r(this,"foundTechnologies",new Set),r(this,"handle",e=>{var t;0!==e.type?null!=(t=this.nextHandler)&&t.handle(e):e.found&&(this.foundTechnologies.add(e.framework),O.unsubscribeFromAll(e.groupId))}),r(this,"getNumberOfFoundTechnologies",()=>this.foundTechnologies.size),r(this,"updateHeaders",()=>{d.config.uiFramework=Array.from(this.foundTechnologies).map(e=>encodeURIComponent(e)).join(",")}),this.nextHandler=e}}(vt),Tt=new class{async checkSiteUIFramework(){let t=yt;0<O.getCheckersCountForChannel(0)&&O.getCheckerResultsForData(0,globalThis).forEach(e=>t.handle(e)),0<O.getCheckersCountForChannel(1)&&O.getCheckerResultsForData(1,document).forEach(e=>t.handle(e)),yt.updateHeaders(),"requestIdleCallback"in globalThis&&0<O.getCheckersCountForChannel(2)&&0===yt.getNumberOfFoundTechnologies()&&await this.walkDOMInIdleTime(e=>{O.getCheckerResultsForData(2,e).forEach(e=>t.handle(e))},()=>{var e=0===O.getCheckersCountForChannel(2),t=0<yt.getNumberOfFoundTechnologies()&&vt.didFindPlatform();return e||t}),yt.updateHeaders(),O.unsubscribeAll()}async walkDOMInIdleTime(r,a){let n=0,s=document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT),i;var e=new Promise(e=>{i=e});let o=e=>{for(;n<3e3&&0<e.timeRemaining();){var t=s.nextNode();if(!t)return i();if(r(t),n++,a())return i()}n<3e3?globalThis.requestIdleCallback(o):i()};return globalThis.requestIdleCallback(o),e}},L=class L{constructor(){}static isReservedNumber(e){return A.containsNumber(d.processedData.reservedNumbers,e)||L.containsCleanedNumber(d.processedData.reservedNumbers,e)}static containsCleanedNumber(e,t){return e.includes(A.sanitizePhone(t.startsWith("+1")?t:"+1"+t))}static isNoSwapNumber(e){return A.containsNumber(d.processedData.noSwapNumbers,e)||L.containsCleanedNumber(d.processedData.noSwapNumbers,e)}static shouldNumberHrefBeUpdated(e){e=e.getAttribute("href");return e&&e.includes("tel:")&&!L.isReservedNumber(e.split(":")[1])&&!L.isNoSwapNumber(e.split(":")[1])}static concatenateNumbers(e){var t=Array.from(e),r=/[0-9()\s]/;for(let e=0;e<t.length;e++){var a=0===e?e:e-1,n=e===t.length-1?e:e+1;t[e].match(/[^a-zA-Z0-9]/)&&t[a].match(r)&&t[n].match(r)&&(t.splice(e,1),e-=1)}return t.join("")}static processNode(e){try{var r=L.concatenateNumbers(e.data);let t=!1;var a,n=r.split(" ");for(let e=0;e<n.length;e++)A.isCallTrackingPhoneNumber(n[e])&&(!(a=A.formatPhoneNumberByClientPhone(d.processedData.dniPhoneNumber,n[e]))||L.isReservedNumber(n[e])||L.isNoSwapNumber(n[e])||(n[e]=a,t=!0));t&&(e.data=n.join(" "))}catch(e){this.logger.debugError("error processing node. continuing...")}}static searchInnerElement(t){var e;if(t.getAttribute("href")&&t.getAttribute("href").includes("tel:")&&t.setAttribute("href","tel:"+d.processedData.dniPhoneNumber),0===t.childElementCount)t.innerHTML&&A.isCleanedPhoneNumber(t.innerHTML)&&(e=A.formatPhoneNumberByClientPhone(d.processedData.dniPhoneNumber,t.innerHTML))&&(t.innerHTML=e);else for(let e=0;e<t.children.length;e++)L.searchInnerElement(t.children[e])}static getDniNumberByClass(){var t=o().dom.getElementsByClassName("external-dni");for(let e=0;e<t.length;e++){var r=t[e].native,a=g.getTextNodes(r);for(let e=0;e<a.length;e++){var n=a[e];if(n.data&&A.isCleanedPhoneNumber(n.data)&&!L.isNoSwapNumber(n.data))return A.sanitizePhone(n.data)}}return null}static getDniNumberById(){var e=A.sanitizePhone(g.getElementContentById("hyros-noswap-dni")),t=A.sanitizePhone(g.getElementContentById("hyros-dni"));return!A.isValidPhone(e)||!A.isValidPhone(t)||e===t||L.isNoSwapNumber(t)?null:t}},Pt=(r(L,"logger",a.forComponent("cte")),L),At=new class{constructor(){r(this,"logger",a.forComponent("cte")),r(this,"processDniNumber",function(e){d.config.generatedClickInfo&&b.addDniToClick(e)})}async startDNIchain(){var e=0<o().dom.getElementsByClassName("hyros-dni").length;if((c.config.callTrackingEnabled||c.config.noSwapNumbersEnabled)&&!c.config.refOverride)try{var t=await y.retrieveDNI(JSON.stringify({previousUrl:E.getPreviousUrl(),referrerUrl:E.getReferrerUrl(),callTrackingPoolHash:c.config.callTrackingPoolHash,replacementEnabled:e}));Me.responseHasError(t,"cte",{serviceWhereErrorOriginated:"CALL_TRACKING_SERVICE",errorType:"COULD_NOT_RETRIEVE_DNI_NUMBER"})||t.error?this.logger.debugWarn("[cte] "+t.error):this.processDniResponse(t)}catch(e){T.sendErrorReport(e instanceof Error?e:String(e),"cte",{serviceWhereErrorOriginated:"CALL_TRACKING_SERVICE",errorType:"COULD_NOT_RETRIEVE_DNI_NUMBER"})}}processDniResponse(e){var t=e.dnum;if(t&&(this.logger.debugInfo("[cte] "+t),d.processedData.dniPhoneNumber=t),d.processedData.dniPhoneNumberFullReplacement=!!e.fullNumberReplacement,null!=(t=e.reservedNumbers)&&t.length)for(var r of e.reservedNumbers)d.processedData.reservedNumbers.push(r);if(null!=(t=e.noSwapNumbers)&&t.length)for(var a of e.noSwapNumbers)d.processedData.noSwapNumbers.push(a);c.config.callTrackingEnabled&&this.replacePhoneNumber()}fullPhoneReplacement(){var t=o().dom.getElementsByTagName("a");for(let e=0;e<t.length;e++){var r,a=t[e];a.classList.contains("external-dni")||(Pt.shouldNumberHrefBeUpdated(a)&&a.setAttribute("href","tel:"+d.processedData.dniPhoneNumber),(r=a.getAttribute("phone"))&&!Pt.isReservedNumber(r)&&null!==(r=A.formatPhoneNumberByClientPhone(d.processedData.dniPhoneNumber,r))&&a.setAttribute("phone",r))}this.searchAndReplacePhoneNumbers()}replacePhoneNumber(){if(d.processedData.dniPhoneNumber)if(d.processedData.dniPhoneNumberFullReplacement)this.fullPhoneReplacement();else{var t=o().dom.getElementsByClassName("hyros-dni").map(e=>e.native).filter(Boolean);for(let e=0;e<t.length;e++)Pt.searchInnerElement(t[e])}}searchAndReplacePhoneNumbers(){var t=g.getTextNodes(document.body);for(let e=0;e<t.length;e++){var r=t[e],a=r.parentElement;a&&a.closest(".external-dni")||r.data&&Pt.processNode(r)}}executeDniNumberProcessing(){let e=Pt.getDniNumberById();(e=e||Pt.getDniNumberByClass())&&this.processDniNumber(e)}},bt=globalThis,St=new class{constructor(){r(this,"logger",a.forComponent("mnyc")),r(this,"retryCount",0)}enrichManyChatRefLink(e,t){var r,a,n,s=e.getAttribute("href");s&&(a=/([?&]ref=)([^&]+)/.exec(s))&&(r=a[1],n=(a=a[2]).split("--")[0],s=s.replace(r+a,r+n+"--"+t),e.setAttribute("href",s))}propagateParametersToManyChatRefLinks(r){try{var e=o().dom.querySelectorAll('a[href*="m.me/"]');if(0===e.length)return 5<=this.retryCount?void 0:(this.retryCount++,void setTimeout(()=>this.propagateParametersToManyChatRefLinks(this.populateManyChatURLParams()),300));if(this.retryCount=0,r&&d.config.sessionId){let t=encodeURIComponent(r.replace(new RegExp(Ne+"$"),""));e.forEach(e=>{this.enrichManyChatRefLink(e,t)})}}catch(e){r=e instanceof Error?e.message:JSON.stringify(e);this.logger.debugError("Couldn't propagate params to ManyChat: "+r)}}propagateParametersToManyChat(){let r=this.populateManyChatURLParams();if(this.propagateParametersToManyChatRefLinks(r),bt.MC){let t=bt.MC;o().dom.getElementsByClassName("mcwidget-embed").forEach(e=>t.getWidget(e).setPayload(r)),o().dom.getElementsByClassName("mcwidget-overlay").forEach(e=>t.getWidget(e).setPayload(r))}else bt.mcAsyncInit=()=>this.propagateParametersToManyChat()}populateManyChatURLParams(){var e=$e.parseHyrosParams(),t=d.config.sessionId,r=Ne;let a="";return e.fbAdSetId&&(a+="fbc_id="+e.fbAdSetId+r),e.bingAdGroupId&&(a+="bng_id="+e.bingAdGroupId+r),e.hyrosCampaignId&&(a+="h_campaign_id="+e.hyrosCampaignId+r),e.googleCampaignId&&(a+="gc_id="+e.googleCampaignId+r),e.hyrosAdId&&(e.fbAdSetId||e.googleCampaignId)&&(a+="h_ad_id="+e.hyrosAdId+r),e.fbClickId&&(a+="fb_cl_id="+e.fbClickId+r),e.googleClickId&&(a+="g_cl_id="+e.googleClickId+r),e.wBraId&&(a+="w_bra_id="+e.wBraId+r),e.gBraId&&(a+="g_bra_id="+e.gBraId+r),e.sourceLinkTag&&(a+="sl="+e.sourceLinkTag+r),e.isEmailSource&&(a+="is_el="+e.isEmailSource+r),t&&(a+="usid="+t+r),e.tiktokClickId&&(a+="ttclid="+e.tiktokClickId+r),e.rdtAdGroupId&&(a+="rdt_id="+e.rdtAdGroupId+r),e.aplCampaignId&&(a+="apl_id="+e.aplCampaignId+r),e.rdtClickId&&(a+="rdt_clid="+e.rdtClickId+r),e.hyrosCampaignName&&(a+="h_ad_id="+e.hyrosCampaignName+r),c.config.customTag&&(1===c.config.customTag.split("!").length?a+="tag="+c.config.customTag+r:a+="tag="+c.config.customTag.split("!")[1]+r),a}},kt=new class extends class{processEmailTrackingAndLeadCreation(){var e=decodeURIComponent(m.getEmailParamIfPresent()),t=Fe(),r=h.searchElementsInUrlParams(ke()),a=d.processedData.customHTETriggered&&d.processedData.email;e&&m.isValidEmail(e)||a?(e=m.isValidEmail(e)?e:d.processedData.email,S.sendLeadEvent(e,h.getSourceTagIfPresent()),d.processedData.email=e,d.processedData.customHTETriggered=!1):0<t.length&&c.config.phoneOptInEnabled?S.sendLeadEvent(t[0],h.getSourceTagIfPresent()):r?S.sendLeadEvent(r,h.getSourceTagIfPresent()):this.attemptLeadCreationFallback(),St.propagateParametersToManyChat(),setTimeout(Ze.generateSecondFingerprint,2e3)}}{constructor(){super(...arguments),r(this,"logger",a.forComponent("emlt")),r(this,"checkDocumentAndParseDom",async()=>{var e;o().dom.isReady()?(e=await m.parseByOriginType(),S.processPhoneNumber(A.getPhoneFromDom()),S.processFirstName(g.getFirstNameFromDom()),S.processLastName(g.getLastNameFromDom()),S.processFullName(g.getFullNameFromDom()),setTimeout(At.executeDniNumberProcessing,1e3),this.processEmailDom(e)):(this.logger.debugWarn("[WARN][US] Document not ready: "+o().dom.readyState),setTimeout(this.checkDocumentAndParseDom,1e3))}),r(this,"processEmailDom",e=>{m.isValidEmail(e)&&(d.processedData.domEmail=e,d.config.sessionId?S.sendLeadEvent(e,h.getSourceTagIfPresent()):(d.processedData.customHTETriggered=!0,d.processedData.email=e))})}setupEmailTrackingAndLeadCreation(){ct.attachEphemeralInputListeners(),setInterval(()=>ct.attachLeadListeners(),3e3),setInterval(()=>At.replacePhoneNumber,3e3),setInterval(async()=>{var e=await m.parseByOriginType();this.processEmailDom(e)},3e3),this.processEmailTrackingAndLeadCreation()}attemptLeadCreationFallback(){this.checkDocumentAndParseDom()}attachEmailEventListener(){let t=e=>{e&&m.isValidEmail(e)&&(d.processedData.email=e,d.config.sessionId?S.sendLeadEvent(e,h.getSourceTagIfPresent()):d.processedData.customHTETriggered=!0)};o().events.onEmailCaptured(e=>t(e))}},wt=class tr extends class extends class{}{constructor(){super(...arguments),r(this,"PIXEL_SCRIPT_URL","https://static.icexyz.com/whm/assets/pixel.js")}getSessionId(){return null}buildPixelKwargs(){return{client_id:"2d3ae57f-04f6-4a66-b0ec-75a9bb09a1a7",site_id:this.SITE_ID,h_s_id:d.config.sessionId,h_p_id:""+c.product.id,skip_3rd_party:this.SKIP_THIRD_PARTY}}onPixelError(e){let t;t=e instanceof Error?e.message:null!=e?String(e):void 0;e=`error on BDEX pixel with productId: ${c.product.id}, sessionId: ${d.config.sessionId} on site: `+o().location.href,e=new Error(t?e+" - "+t:e);T.sendErrorReport(e,"tps",{serviceWhereErrorOriginated:"THIRD_PARTY_TRACKING_SCRIPT",errorType:"SCRIPT_FAILED"})}}{constructor(){super(...arguments),r(this,"SITE_ID","9788657e-ddd6-4c28-8e5c-38ee01897742"),r(this,"SKIP_THIRD_PARTY",!1)}inject(e){window._bdex_queue=window._bdex_queue||[],window._is_bdex_queue_logic_setup||(tr.setUpQueueLogic(),window._is_bdex_queue_logic_setup=!0),window._bdex_queue.push(()=>{window.pixel_results=null,this.injectPixelScript(e)}),tr.processNext()}injectPixelScript(e){try{window.pixel_kwargs={...window.pixel_kwargs||{},...this.buildPixelKwargs()},o().dom.injectScript(document.head,this.PIXEL_SCRIPT_URL,!0,()=>e(window.pixel_kwargs.h_s_id),()=>this.onScriptLoadFailure())}catch{this.onScriptLoadFailure()}}onScriptLoadFailure(){this.onPixelError(),window._is_bdex_running=!1,tr.processNext()}static setUpQueueLogic(){window._is_bdex_running=!1;let e=window.pixel_results,n=()=>{window._is_bdex_running=!1,tr.processNext()};Object.defineProperty(window,"pixel_results",{configurable:!0,get:()=>e,set:a=>{if(e=a,Array.isArray(a)){if(a.length)return n();let t=a.push,r=!1;a.push=(...e)=>{e=t.call(a,...e);return r||(r=!0,n()),e}}}})}static processNext(){var e;window._is_bdex_running||null!=(e=window._bdex_queue)&&e.length&&(window._is_bdex_running=!0,e.shift()())}};var Rt=class Rt{reportInteraction(e,t){return o().http.post(Rt.endpoint,e,{headers:_.getFetchProductIdHeaders(),withCredentials:!0}).catch(e=>T.sendErrorReport(e,t))}};r(Rt,"endpoint","/lit");var Nt=new Rt;var U=class U{constructor(){r(this,"client",Nt),r(this,"trackedInputs",new WeakSet)}enabled(){return c.config.interactionTrackersEnabled.has("sp")}getComponent(){return"st"}async startCapturing(){this.attachToSearchInputs(),setInterval(()=>this.attachToSearchInputs(),U.RESCAN_INTERVAL_MS)}attachToSearchInputs(){for(var e of Pe().getAllInputs())!this.trackedInputs.has(e)&&this.isEligibleSearchInput(e)&&(this.trackedInputs.add(e),e.addEventListener("input",((t,r)=>{let a;return(...e)=>{a&&clearTimeout(a),a=setTimeout(()=>t(...e),r)}})(e=>{this.reportSearch(e.target,e.target.value)},U.REPORT_DEBOUNCE_MS)))}reportSearch(e,t){var r,a,t=t.trim();t.length<U.MIN_QUERY_LENGTH||this.client.reportInteraction({type:"sp",context:(r=e,{occurredAt:(new Date).getTime(),productId:c.product.id,sessionId:d.config.sessionId,appWideSessionId:d.config.leadGenSessionId,clickId:null==(a=d.config.generatedClickInfo)?void 0:a.clickId,interactionLocation:{id:r.id,tagName:r.tagName,className:r.className}}),query:t,inputType:e.type},this.getComponent())}isEligibleSearchInput(e){return this.isVisible(e)&&this.isSearchInput(e)}isSearchInput(e){var t;return"search"===e.type||"searchbox"===e.getAttribute("role")||!!U.SEARCH_KEYWORDS.includes(e.name.toLowerCase())||!!R.containsClassOrIdOrPlaceholder(e,U.SEARCH_KEYWORDS,["search"])||(t=null!=(t=null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase())?t:"",e.placeholder.toLowerCase().includes("search"))||t.includes("search")}isVisible(e){var t;return!(e.hidden||e.disabled||e.closest('[hidden], [aria-hidden="true"]'))&&"none"!==(null==(t=null==(t=globalThis.getComputedStyle)?void 0:t.call(globalThis,e))?void 0:t.display)&&"hidden"!==(null==t?void 0:t.visibility)}},Dt=(r(U,"SEARCH_KEYWORDS",["search","q","s","query","searchbox","searchterm","search_term","search-term","find"]),r(U,"REPORT_DEBOUNCE_MS",500),r(U,"RESCAN_INTERVAL_MS",2e3),r(U,"MIN_QUERY_LENGTH",2),U);function Ot(e){return new Set(e.split(",").map(e=>e.trim()).filter(e=>""!==e))}function Lt(){c.config={origin:s.ORIGIN,customTag:s.CUSTOM_TAG,callTrackingPoolHash:s.CALL_TRACKING_POOL_HASH,sessionId:s.SESSION_ID,prevOverride:s.PREVIOUS_OVERRIDE,refOverride:s.REFERER_OVERRIDE,disableParamTracking:Ot(s.DISABLE_PARAM_TRACKING),interactionTrackersEnabled:Ot(s.INTERACT_TRACKERS_LIST),defaultServerParams:s.DEFAULT_SERVER_PARAMS.split(",").reduce((e,t)=>{var r,t=t.split("=");return 2<t.length?a.forComponent("ix").debugError("[conf] unexpected parsing error"):([t,r]=t,r&&(e[t]=r)),e},{}),facebookEventIdRetrieval:s.FB_EVENT_ID_RETRIEVAL,spaEnabled:s.SPA_ENABLED,ignorePrevUrl:s.IGNORE_PREVIOUS_URL,embedScriptOnIframes:s.EMBED_SCRIPTS_ON_IFRAME,trackDeviceFingerprint:s.FINGERPRINT_ENABLED,useFetchKeepAlive:s.FETCH_KEEP_ALIVE_ENABLED,callTrackingEnabled:s.CALL_TRACKING_ENABLED,shopifyPostPurchasePageScript:s.SHOPIFY_POST_PURCHASE_ENABLED,noSwapNumbersEnabled:s.NO_SWAP_NUMBERS_ENABLED,clientUseCustomConsentEvent:!1,deleteParams:s.DELETE_TRACKING_PARAMS_ENABLED,phoneOptInEnabled:s.PHONE_OPT_IN_ENABLED,timeSpentTrackingEnabled:s.TIME_SPENT_TRACKING,thirdPartyTracking:s.THIRD_PARTY_TRACKING,unifiedClickEvent:s.UNIFIED_CLICK_EVENT}}t=new class{constructor(){r(this,"interactionTrackers",[new Dt]),r(this,"emailTrackingBService",kt)}createThirdPartyPixel(e){return"bdex-pixel"===e?new wt:null}loadScriptConfig(){Lt()}shouldInitScript(){var e="mh_script_"+c.product.id;if(window[e]){try{T.sendErrorReport("Duplicate script load","sup",{serviceWhereErrorOriginated:"UNIFIED_TRACKING_SCRIPT",errorType:"DUPLICATE_SCRIPT_LOAD"})}catch{}return!1}return window[e]=!0}startDomDependentOperations(){T.initAndReportOnError("hrs",()=>Ve.init()),T.initAndReportOnError("pc",()=>w.attachClickTimeProcessingListeners()),T.initAndReportOnError("shpt",()=>Qe.appendShopifyPostPurchasePageScriptIfNecessary()),T.initAndReportOnError("othr",()=>et.attachUniqueCheckoutIdListener()),T.initAndReportOnError("emlt",()=>this.emailTrackingBService.attachEmailEventListener()),T.initAndReportOnError("bolt",()=>tt.attachBoltEventListener()),T.initAndReportOnError("gle",()=>rt.attachGlobalECheckoutEventListener()),T.initAndReportOnError("hsf",()=>it.attachHubSpotFormListener()),T.initAndReportOnError("cls",()=>xe.initCustomListeners()),T.initAndReportOnError("cnst",()=>lt.checkAllConsents()),T.initAndReportOnError("gtag",()=>ot.interceptGoogleTagEvents()),T.initAndReportOnError("blkp",()=>dt.processBlockingPlugin()),T.initAndReportOnError("envt",()=>Tt.checkSiteUIFramework()),this.interactionTrackers.forEach(e=>{e.enabled()&&T.initAndReportOnError(e.getComponent(),()=>e.startCapturing())})}};var F=class F{static isIgnorableEvent(e){return F.discardedEvents[e.adspendType].includes(e.name)}static discardEvent(e,t){return F.isIgnorableEvent(e)||(null==t?void 0:t.includes(e))}static logDedupParams(e){this.logger.debugObject(F.dudupLogPrefix+" ["+F.adspendPrefix[e.adspendType]+"]",e)}},Ut=(r(F,"logger",a.forComponent("convu")),r(F,"discardedEvents",{FACEBOOK:["AddPaymentInfo","AddToWishlist","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","InitiateCheckout","Schedule","Search","StartTrial","SubmitApplication","Subscribe","ViewContent","PageView","Login"],GOOGLE:["page_view","add_to_cart","begin_checkout","add_to_wishlist","add_payment_info","add_shipping_info","view_item","view_item_list","select_item","disqualify_lead","qualify_lead","close_convert_lead","remove_from_cart","search","sign_up","login","exception","select_promotion","view_search_results","working_lead","view_promotion","share","view_cart","refund","earn_virtual_currency","spend_virtual_currency","tutorial_begin","tutorial_complete","level_up","select_content","unlock_achievement","join_group","complete_registration","start_trial","post_score","subscribe"],TIKTOK:["AddPaymentInfo","AddToCart","AddToWishlist","ClickButton","CompleteRegistration","Download","InitiateCheckout","ApplicationApproval","Search","SubmitForm","Subscribe","ViewContent","PageView","FindLocation","CustomizeProduct","Schedule","StartTrial","SubmitApplication"],REDDIT:["PageVisit","ViewContent","Search","AddToCart","AddToWishlist","InitiateCheckout","AddPaymentInfo","Purchase"],SNAPCHAT:["PAGE_VIEW","VIEW_CONTENT","ADD_CART","START_CHECKOUT","APP_OPEN","ADD_BILLING","SIGN_UP","SEARCH","SAVE","COMPLETE_REGISTRATION","CUSTOMIZE_PRODUCT","SUBSCRIBE","START_TRIAL","COMPLETE_TUTORIAL","INVITE","LOGIN","SHARE","RESERVE","ACHIEVE_LEVEL","AD_CLICK","LEVEL_COMPLETE","AD_VIEW","ACHIEVEMENT_UNLOCKED","ADD_TO_WISHLIST","SPENT_CREDITS","RATE","LIST_VIEW"]}),r(F,"adspendPrefix",{FACEBOOK:["FB"],GOOGLE:["GG"],TIKTOK:["TT"],REDDIT:["RD"],SNAPCHAT:["SN"]}),r(F,"dudupLogPrefix","[DD]"),F),D=class{constructor(e){this.loggerName=e,r(this,"uniquePixelEvents",[]),r(this,"digestPixelEventsTimerId"),r(this,"pendingThirdPartyEvents",[]),r(this,"pendingEventsStorageKey"),r(this,"logger"),r(this,"hasStartedObserving",!1),r(this,"hasRecoveredPersistedEvents",!1),this.pendingEventsStorageKey=`h_p_e_${e}_`+c.product.id,this.logger=a.forComponent(e)}processInvalidForThisPlatform(e){}reportInvalidPixelPayload(e,t){this.logger.debugObject("[val-fail] "+t.reason,e),t.reportToBackend&&T.reportInvalidPayload(this.loggerName,e.name,null==(e=e.payload)?void 0:e.raw,t.reason,{serviceWhereErrorOriginated:"PIXEL_REQ_OBSERVER",errorType:"EVENT_SIGNATURE_CHANGED"})}startObserving(){this.hasStartedObserving||(this.hasStartedObserving=!0,o().features.canAccessDom&&o().events.onPageVisibilityState(()=>{var e;null!=(e=d.config.generatedClickInfo)&&e.clickId&&this.flushPixelEvents(!0)},"n"))}async recoverPersistedEvents(){if(!this.hasRecoveredPersistedEvents){this.hasRecoveredPersistedEvents=!0;var t=await o().storage.session.get(this.pendingEventsStorageKey);if(t)try{var r=JSON.parse(t);r&&r.forEach(e=>this.processEntry(e))}catch(e){r=e instanceof Error?e:new Error(String(e));T.sendErrorReport(`[recover] events: "${t}" - Error: `+r,this.loggerName)}}}persistPendingEvent(e){this.pendingThirdPartyEvents.push({initiatorType:e.initiatorType,name:e.name}),o().storage.session.set(this.pendingEventsStorageKey,JSON.stringify(this.pendingThirdPartyEvents))}flushPixelEvents(e){b.addPixelEventsToClick(this.uniquePixelEvents,!0,e),this.uniquePixelEvents=[],this.pendingThirdPartyEvents=[],o().storage.session.remove(this.pendingEventsStorageKey)}disgestBatch(){clearTimeout(this.digestPixelEventsTimerId),this.digestPixelEventsTimerId=window.setTimeout(()=>{var e;null!=(e=d.config.generatedClickInfo)&&e.clickId?this.flushPixelEvents(!1):w.whenClickSucceeds(3e3,!0).then(e=>{e?this.flushPixelEvents(!1):this.logger.debugError(`[${this.loggerName}] disgest failure`)})},1e3)}processEntry(t){if(this.canProcessEvent(t)){var r,a=this.extractPixelEventDTO(t);if(a){let e=!1;for(r of Array.isArray(a)?a:[a])r&&!Ut.discardEvent(r,this.uniquePixelEvents)&&(this.uniquePixelEvents.push(r),Ut.logDedupParams(r),e=!0);e&&(this.persistPendingEvent(t),this.disgestBatch())}}else this.processInvalidForThisPlatform(t)}},Ft=class extends D{constructor(){super("febs")}canProcessEvent(e){return c.config.facebookEventIdRetrieval&&["img","fetch","xmlhttprequest"].includes(e.initiatorType)&&e.name.includes("facebook")&&(e.name.includes("/tr/")||e.name.includes("/tr?"))&&e.name.includes("eid=")}extractPixelEventDTO(e){var e=e.name,t={};return t.eventId=h.getUrlParam("eid",!1,e),t.fbpId=h.getUrlParam("fbp",!1,e),t.pixelId=h.getUrlParam("id",!1,e),t.name=h.getUrlParam("ev",!1,e),t.adspendType="FACEBOOK",t}},Gt=class extends D{constructor(){super("gebs")}canProcessEvent(e){return e.name.includes("googleadservices")&&e.name.includes("&oid=")&&e.name.includes("conversion/")}extractPixelEventDTO(e){var t,e=e.name,r=h.getUrlParam("data",!0,e);let a=null;return null===(a=null===(a=r?new URLSearchParams(r.replace(";","&")).get("event"):a)?h.getUrlParam("bttype",!0,e):a)?(T.sendErrorReport("Event value not found: "+e,"gl_url",{serviceWhereErrorOriginated:"GOOGLE_PIXEL_EVENT",errorType:"INVALID_EVENT_URL"}),null):null===(r=h.getUrlParam("oid",!0,e))||r.includes("{{")||r.includes("}}")?(T.sendErrorReport("TransactionId param not valid: "+e,"gl_url",{serviceWhereErrorOriginated:"GOOGLE_PIXEL_EVENT",errorType:"INVALID_EVENT_URL"}),null):null===(t=C.getSubstringBetween(e,"conversion/","/"))||0===t.length?(T.sendErrorReport("PixelId not found: "+e,"gl_url",{serviceWhereErrorOriginated:"GOOGLE_PIXEL_EVENT",errorType:"INVALID_EVENT_URL"}),null):((e={}).transactionId=r,e.name=a,e.pixelId=t,e.adspendType="GOOGLE",e)}},Bt=class extends D{constructor(){super("rebs")}canProcessEvent(e){return"img"===e.initiatorType&&e.name.includes("reddit")&&e.name.includes("/rp.gif")}extractPixelEventDTO(e){var t="external_id",r="m.conversionId",e=e.name,a={},n=h.getUrlParam(t,!1,e),t=(this.isDefaultValue(n,t)||(a.transactionId=n),h.getUrlParam("uuid",!1,e)),n=(this.isDefaultValue(t,"uuid")||(a.redditUUID=t),h.getUrlParam(r,!1,e)),t=(this.isDefaultValue(n,r)||(a.redditConversionId=n),h.getUrlParam("event",!1,e)),r=(this.isDefaultValue(t,"event")||(a.name=t),h.getUrlParam("id",!1,e));return this.isDefaultValue(r,"id")||(a.pixelId=r),a.adspendType="REDDIT",a}isDefaultValue(e,t){return"0000000000000000000000000000000000000000000000000000000000000001"===e&&(this.logger.debugError("Default placeholders are being used. Invalid param: "+t),!0)}},Mt=class extends D{constructor(){super("ttbs"),r(this,"networkConfirmed",!1),r(this,"pendingBeaconEvents",[])}isTikTokPixelUrl(e){return e.includes("tiktok")&&e.includes("/pixel")&&!e.includes("/act")}validatePayload(e){return void 0===e?{ok:!1,reason:"payload missing or not valid JSON",reportToBackend:!0}:e.event_id?e.event?null!=(e=null==(e=e.context)?void 0:e.pixel)&&e.code?{ok:!0}:{ok:!1,reason:"context.pixel.code missing",reportToBackend:!0}:{ok:!1,reason:"event missing"}:{ok:!1,reason:"event_id missing"}}processEntry(e){e.payload?!this.networkConfirmed&&this.canProcessEvent(e)?this.pendingBeaconEvents.push(e):super.processEntry(e):this.isTikTokPixelUrl(e.name)&&(this.networkConfirmed=!0,e=this.pendingBeaconEvents,this.pendingBeaconEvents=[],e.forEach(e=>super.processEntry(e)))}processInvalidForThisPlatform(e){var t;this.isTikTokPixelUrl(e.name)&&!1===(t=this.validatePayload(e.payload.parsed)).ok&&this.reportInvalidPixelPayload(e,t)}canProcessEvent(e){var t=null==(t=e.payload)?void 0:t.parsed;return this.isTikTokPixelUrl(e.name)&&this.validatePayload(t).ok}extractPixelEventDTO(e){var e=e.payload.parsed,t={};return t.eventId=e.event_id,t.pixelId=e.context.pixel.code,t.name=e.event.toString(),t.adspendType="TIKTOK",t}},Ht="https://tr.snapchat.com/p",xt=class extends D{constructor(){super("scbs")}validatePayload(e){return void 0===e?{ok:!1,reason:"payload missing or not valid JSON"}:Array.isArray(e.req)?{ok:!0}:{ok:!1,reason:"req is missing or not an array",reportToBackend:!0}}canProcessEvent(e){var t=null==(t=e.payload)?void 0:t.parsed;return e.name===Ht&&this.validatePayload(t).ok}processInvalidForThisPlatform(e){var t;e.name===Ht&&e.payload&&!1===(t=this.validatePayload(e.payload.parsed)).ok&&this.reportInvalidPixelPayload(e,t)}extractPixelEventDTO(e){return e.payload.parsed.req.filter(e=>e.t).map(e=>{var t={};return t.clientDedupId=e.t.cdid,t.transactionId=e.t.e_tid,t.name=e.t.ev,t.pixelId=e.t.pid,t.adspendType="SNAPCHAT",t})}},Vt=class{constructor(e){this.newObservers=e,r(this,"logger",a.forComponent("po"))}eventsObserver(e,t,r){e.getEntries().forEach(e=>{for(var t of this.newObservers)t.processEntry(e)}),0<r&&this.logger.warn(r+" entries were dropped because the buffer was full.")}startObserving(){for(var e of this.newObservers)e.startObserving(),e.recoverPersistedEvents();o().performance.observe({type:"resource",buffered:!0},e=>{e.forEach(e=>{for(var t of this.newObservers)t.processEntry(e)})})}},Kt=class{constructor(e){this.newObservers=e}tryParseJson(e){try{return JSON.parse(e)}catch{}}startObserving(){for(var e of this.newObservers)e.startObserving(),e.recoverPersistedEvents();o().beacon.startIntercepting(),o().beacon.onBeacon(({url:e,rawData:t,parsedData:r})=>{var a,n={initiatorType:"beacon",name:e};t&&(n.payload={raw:String(t),parsed:r});for(a of this.newObservers)a.processEntry(n)})}},Wt=new class{constructor(){r(this,"logger",a.forComponent("evti")),r(this,"observers");var e=new Mt;this.observers=[new Vt([new Ft,new Bt,new Gt,e]),new Kt([e,new xt])]}startObservingPlatformEvents(){for(var e of this.observers)try{e.startObserving()}catch(e){T.sendErrorReport(e instanceof Error?e:String(e),"evti")}}async getFbEventExtraInfo(){this.setFbpIdInterval()}setFbpIdInterval(){let r=setInterval(async()=>{try{var e=await((t=await o().cookies.get("_fbp"))?[t]:null);e&&0<e.length&&(clearInterval(r),b.addFbpIdToClick(e))}catch(e){this.logger.debugError("[fbp]"+(e instanceof Error?e.message:e))}var t},3e3)}},qt=new class{constructor(){r(this,"logger",a.forComponent("ifrm")),r(this,"reportedInjectError",!1)}embedScriptOnIframes(){c.config.embedScriptOnIframes&&setInterval(()=>this.addScriptToIframe(),2e3)}addScriptToIframe(){var e,t,r=this.generateScriptSrc();for(e of this.returnFilteredIframes())try{null===e.contentDocument?d.processedData.filteredIframes.push(e):null===(t=e.contentDocument.querySelector("head"))?d.processedData.filteredIframes.push(e):(o().dom.injectScript(t,r,!0),d.processedData.filteredIframes.push(e),this.logger.info(""))}catch(e){var a=e instanceof Error?e.message:e;this.logger.debugWarn("Couldn't embed: "+a),this.reportErrorOnce(a)}}reportErrorOnce(e){this.reportedInjectError||(T.sendErrorReport(e,"ifrm"),this.reportedInjectError=!0)}generateScriptSrc(){var e=c.config.customTag?"&tag="+c.config.customTag:"",t=c.config.spaEnabled?"&spa=true":"",r=c.config.ignorePrevUrl?"&ignorePrevUrl=true":"",a="SHOPIFY"===c.config.origin?"&origin=SHOPIFY":"",n=c.config.embedScriptOnIframes?"&embed=true":"";return c.endpoints.trackingBase+"/universal-script?ph="+c.product.hash+e+a+t+r+n}returnFilteredIframes(){var e,t=[];for(e of o().dom.getElementsByTagName("iframe"))d.processedData.filteredIframes.includes(e)||t.push(e);return t}},jt=(e=>(e.EUIP="EUIP",e.BLCK="BLCK",e))({});var zt=new class{async locationHasActiveFlow(e){e=new URLSearchParams({href:e}),e=c.endpoints.matchingTriggerWithBase+"?"+e;return(await o().http.get(e,{headers:_.getFetchProductIdHeaders(),withCredentials:!1})).data}},Yt=new class{constructor(){r(this,"logger",a.forComponent("tps")),r(this,"SESSION_ID_FIELD","thirdPartySessionId")}async attemptTrackLead(t){if(c.config.thirdPartyTracking){try{if(!await zt.locationHasActiveFlow(c.href))return}catch(e){T.sendErrorReport(e instanceof Error?e:String(e),"tps")}let e=o().service.createThirdPartyPixel(t);if(e)try{w.whenClickSucceeds(9e3,!0).then(()=>this.trackLead(e))}catch{this.logger.debugError("init err")}else this.logger.debugError("[tps] invalid id")}}async trackLead(t){if(d.config.thirdPartyTrackingHash)this.logger.info("Skip Bc."),b.addTpsFromCacheToClick("true"),b.updateClickField(d.config.thirdPartyTrackingHash,this.SESSION_ID_FIELD);else{var e=t.getSessionId();if(e)b.updateClickField(e,this.SESSION_ID_FIELD);else{let e=!0;try{e=await zt.locationHasActiveFlow(c.href)}catch(e){T.sendErrorReport(e instanceof Error?e:String(e),"tps")}e&&(this.logger.info("No Bc - Inject"),b.addTpsFromCacheToClick("false"),t.inject(e=>{b.updateClickField(e,this.SESSION_ID_FIELD),this.logger.info("Built")}))}}}},Jt=new class{constructor(){r(this,"getErrMsg",e=>e instanceof Error?e.message:String(e)),r(this,"logger",a.forComponent("gusid"))}async startSessionsRequestChain(){try{var e=await this.getGUSID();e&&(et.attachUrlChangeListener(),this.appendSessionIdToD24Event(e),Yt.attemptTrackLead(s.THIRD_PARTY_TRACKING_PROVIDER),await this.getLeadGenSessionId(),await At.startDNIchain(),await w.processClick(),o().service.emailTrackingBService.setupEmailTrackingAndLeadCreation())}catch(e){this.processErrorResponse(this.getErrMsg(e))}}async getGUSID(){var e,t=new URLSearchParams,r=h.getUrlParam("hyros");return r&&t.append("hyros",r),Number(c.product.id)?(r=await Ze.generateDeviceFingerprint(),r=_.getGUSIDFetchHeaders(r),t=t.toString()?"?"+t.toString():"",t=c.endpoints.generateUUIDWithBase+t,{headers:t,data:r}=await o().http.get(t,{headers:r,withCredentials:!0,acceptedStatusCodes:[304]}),(e=t["third-party-tracking-hash"])&&(d.config.thirdPartyTrackingHash=e),"disabled"===(null==r?void 0:r.body)?(this.logger.info("HS disabled"),null):(e=t["session-id"])&&"undefined"!==e&&"null"!==e?(d.config.sessionId=e,this.logger.info(e),e):(this.processErrorResponse(JSON.stringify(r)),null)):(T.sendErrorReport("pid not set","gusid",{serviceWhereErrorOriginated:"SESSION_B_SERVICE"}),null)}async getLeadGenSessionId(){var e=c.endpoints.generateLeadGenSessionIdWithBase,t=e=>e&&"undefined"!==e&&"null"!==e;let r="";try{var a=(await o().http.get(e,{withCredentials:!0,acceptedStatusCodes:[304]})).headers["l-gen-id"];if(t(a))return void(d.config.leadGenSessionId=a);throw new Error("Invalid or missing l-gen-id in primary response")}catch(e){r=this.getErrMsg(e)}try{if("shopify"===o().metadata.name)throw new Error("not made because it's Shopify (already uses fetch)");var n=await(async(e,t)=>{if((e=await fetch(e,{method:"GET",credentials:"include"})).ok||304===e.status)return e.headers.get(t);throw t=await e.text().catch(()=>"Response body error"),new Error(`http status: ${e.status} - `+t)})(e,"L-Gen-ID");if(!t(n))throw new Error("Invalid or missing L-Gen-ID header in fallback response");d.config.leadGenSessionId=n}catch(e){T.sendErrorReport(`Error HTTP: ${r}, Fallback Fetch Error: `+this.getErrMsg(e),"session",{serviceWhereErrorOriginated:"SESSION_B_SERVICE",errorType:"FAILED_TO_GET_LEAD_GEN_SESSION_ID"})}}processErrorResponse(e){try{var t=JSON.parse(e);return Object.values(jt).includes(t.body)?this.logger.debugError("["+t.body+"]"):Be().includes(t.body)?this.logger.debugWarn(t.body):void T.sendErrorReport(e,"gusid",{serviceWhereErrorOriginated:"SESSION_B_SERVICE"})}catch{T.sendErrorReport(e,"gusid",{serviceWhereErrorOriginated:"SESSION_B_SERVICE",errorType:"ERROR_COULD_NOT_BE_PARSED_INTO_JSON"})}}appendSessionIdToD24Event(e){var t,r;e&&(t=g.getElementByTagName("button"),r=g.getElementByTagName("a"),this.appendSessionIdToD24Url(e,t,"button"),this.appendSessionIdToD24Url(e,r,"tag"),setInterval(()=>this.appendSessionIdToIframeInD24(e),900))}appendSessionIdToD24Url(e,t,r){for(var a in t){a=t[a];try{var n,s,i=a.href;null!=i&&i.includes("https://www.digistore24.com/product/")&&(i.includes("custom=")?(n=this.getD24UrlParamsToReplace(i,e),a.href=n.toString()):(s=i.includes("?")?"&":"?",a.href=i+s+"custom=sessionId="+e),this.logger.debugInfo("[hyros-url] A "+r+", new href: "+a.href))}catch(e){this.logger.debugWarn("[hyros-url] A "+r+", error: "+e)}}}appendSessionIdToIframeInD24(e){var t,r=g.getElementByTagName("my-order-form");if(null!==r&&0!==r.length)for(var a in r)try{var n,s,i=null==(t=r[a])?void 0:t._iframe.src;null!=i&&i.includes("https://www.digistore24.com/product/")&&(i.includes("custom=")?(n=this.getD24UrlParamsToReplace(i,e),r[a]._iframe.src=n.toString()):(s=i.includes("?")?"&":"?",r[a].href=i+s+"custom=sessionId="+e),this.logger.debugInfo("[hyros-url] A iframe, new href: "+r[a]._iframe.src))}catch(e){this.logger.debugWarn("[hyros-url] A iframe error, "+e)}}getD24UrlParamsToReplace(e,t){var r,e=new URL(e),a="custom=".replace("=","");return e.searchParams.has(a)&&(r=e.searchParams.get(a),e.searchParams.set(a,r+":sessionId="+t)),e}},$t=new class{constructor(){r(this,"logger",a.forComponent("pp"))}pingPongRequest(){var e,t=Number.parseInt(h.getUrlParam("hpp-pid")),r=h.getUrlParam("hpp-ver-code");r&&t&&(e=c.product.id,r={domain:o().location.href,verificationCode:r,productId:t,scriptProductId:e},y.scriptValidation(JSON.stringify(r)).then(()=>this.logger.debugInfo("")).catch(e=>T.sendErrorReport(e,"pp",{serviceWhereErrorOriginated:"H_TRACKING_B_SERVICE",errorType:"UNABLE_TO_VERIFY_SCRIPT"})))}},Xt=!1;a.scriptId=(null==(ft=s.PRODUCT_HASH)?void 0:ft.slice(0,5))||"unk",Ct={trackingBaseUrl:s.TRACKING_URL,leadGenBaseUrl:s.LEAD_GEN_URL},p={cookies:new i,location:new x,storage:new V,performance:new K,beacon:new W,http:new se({trackingBaseUrl:(null==Ct?void 0:Ct.trackingBaseUrl)||"",leadGenBaseUrl:(null==Ct?void 0:Ct.leadGenBaseUrl)||""}),events:new le,dom:new de,features:{canAccessDom:!0,canReplaceUrl:!0,canUseLocalStorage:!0,canDispatchEvents:!0,supportsCallTracking:!0,supportsFingerprinting:!0,supportsIframeEmbed:!0,supportsThirdPartyScripts:!0,supportsFormInterception:!0,usesShopifyAnalytics:!1,requiresRuntimeConfig:!1,canParseLeadFromUrl:!0},metadata:{name:"web",version:"1.0.0",initializedAt:Date.now()},service:t},k=a.forComponent("e_c"),H?k.warn("already exists. Ignoring"):(e=p,H=!0,k.info(`Initialized: ${p.metadata.name} v`+p.metadata.version)),a.showDebugLogs="true"===h.getUrlParam("h_d"+a.scriptId,!0),(async()=>{let e=o();await e.service.loadScriptConfig(),T.initAndReportOnError("evti",()=>Wt.startObservingPlatformEvents()),Xt||e.service.shouldInitScript()&&(Xt=!0,T.initAndReportOnError("sup",()=>e.service.startDomDependentOperations()),e.features.canReplaceUrl&&T.initAndReportOnError("brwr",()=>$e.normalizeBrowserUrl()),e.features.supportsThirdPartyScripts&&T.initAndReportOnError("fp",()=>Ze.appendFingerprintingScript()),e.features.supportsIframeEmbed&&T.initAndReportOnError("ifrm",()=>qt.embedScriptOnIframes()),T.initAndReportOnError("cart",()=>Xe.setCartIdInterval()),T.initAndReportOnError("gusid",async()=>{await Jt.startSessionsRequestChain()}),w.onClickProcessed(e=>{e.success&&T.initAndReportOnError("evti",()=>{Wt.getFbEventExtraInfo()})}),T.initAndReportOnError("pp",()=>$t.pingPongRequest()))})()})();