PageSourceSearch

https://www.kayak.com/c/wp-content/plugins/r9-analytics/build/r9-analytics-travel3.js?ver=35848223867

js kayak.com collected 2026-09-24 07:33:55 UTC 30,169 bytes, 1 lines download raw bytes

1(()=>{"use strict";const e=new class{constructor(){this.reservedParamsList=["vertical","pageId","subPageId","originalReferrer","seoPlacementId","seoLanguage","seoCountry","tags"]}getOnlyValidParams(e,t){for(var n=[],i=0;i<e.length;i++)-1==t.indexOf(e[i].split("=")[0])&&n.push(e[i]);return n}removeUnnecessaryQueryStringChars(e){return"?"===e.charAt(0)?e.substr(1):e}get(){let e="",t=window.location&&window.location.search;if(t){t=this.removeUnnecessaryQueryStringChars(t);var n=this.getOnlyValidParams(t.split("&"),this.reservedParamsList);e=n.length>0?"&"+n.join("&")+"&seo=true":""}return e}};const t=class{constructor(t){t=t+"&originalReferrer="+encodeURIComponent(document.referrer)+e.get(),this.url=t,this.success.bind(this),this.error.bind(this),this.startSession()}getAjax(e,t,n){var i=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");return i.open("GET",e),i.onreadystatechange=function(){i.readyState>3&&200==i.status&&t(i.responseText),i.readyState>3&&200!=i.status&&n(i)},i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),i}startSession(){this.getAjax(this.url,this.success,this.error)}success(e){e=JSON.parse(e),window.r9AnalyticsSessionDetail=e,document.dispatchEvent(new CustomEvent("r9.analytics.session.success",{detail:e}))}error(){document.dispatchEvent(new CustomEvent("r9.analytics.session.error",{detail:{}}))}};var n,i,s,a;!function(e){e.VS="vs",e.FDUNIT="fdUnit",e.INIT="init",e.IMPRESSION="impression",e.LONG_IMPRESSION="longimpression",e.CLICK="click",e.RESULT_SNAPSHOT="result_snapshot",e.SEARCH_ID_UPDATE="searchIdUpdate",e.SHOW="show",e.PRICE_ALERT="pricealert",e.DESTINATION="destination",e.CONSENTED="consented",e.COLLAPSE="collapse",e.DIRECTIONS="directions",e.SURVEY="survey",e.HIDE="hide",e.APP_REVIEW_PROMPT="appReviewPrompt",e.MANUALLY_ACCESS_RESERVATIONS="manuallyaccessreservations",e.CAR_USAGE_CATEGORY="car_usage_category",e.CLOSE="close",e.GO_TO_SEARCH="goToSearch",e.RESULT_DETAIL_ATTRACTION="resultdetail_attraction",e.ICON_SELECTED="iconSelected",e.TRIPS_FD_ANONYMOUS="tripsFDanonymous",e.RENDER="render",e.SPLASH="splash",e.CHEDDAR="cheddar",e.LOADED="loaded",e.KRAYON_DRAWING="krayon-drawing",e.TOP_AMENITIES_CAROUSEL="top-amenities-carousel",e.UNCHECK="uncheck",e.SAVETOTRIP="savetotrip",e.OPEN="open",e.MULTI_PROVIDER_WINDOW_PROVIDERS_ORDER="multi-provider-window-providers-order",e.EXPAND="expand",e.SELECT="select",e.SIGNUPK4B="signupK4B",e.NOTIFICATION_CENTER="notificationCenter",e.CHECK="check",e.TRIPSMAP="tripsmap",e.RESULTCARD="resultcard",e.K4B_ONBOARDING_LEISURE="k4bOnboardingLeisure",e.FILTERS="filters",e.SHOPPING_CART="shoppingcart",e.MANAGE_YOUR_STAY="manageyourstay",e.SWITCH_TO_DESKTOP="switch-to-desktop",e.NEWSLETTER="newsletter",e.SIGNUP_K4B_FROM_LEISURE="signupK4BfromLeisure",e.DEVDEBUG="devdebug",e.RESULT_DETAIL="resultdetail",e.PRICE_FREEZE="pricefreeze",e.SUBMIT="submit",e.COOKIE_CATEGORY_BANNER="cookie-category-banner",e.IAB_TCF_BANNER="iab-tcf-banner",e.SEARCHEND="searchend",e.HOVER="hover",e.RESULT_IMPRESSION="resultimpression",e.FLIGHTS_GROUND_TRANSPORT="flightsgroundtransport",e.HOTEL_EMAIL_SIGNUP_UNIT="hotel-email-signup-unit",e.SCROLL="scroll",e.DYNAMIC_POLICY_SETUP="dynamicPolicySetup",e.TEST_GUEST_REQUEST="test-guest-request",e.CALENDAR_PICKER="calendarpicker",e.SCREENSHOT="screenshot",e.SMARTY="smarty",e.SITEPICKER="sitepicker",e.CURRENCY_PICKER="currencypicker",e.TEST_MOBILEKEYS="test-mobilekeys",e.WATCHLIST="watchlist",e.SORT_RESULTS="sortresults",e.PRICE_PREDICT="pricepredict",e.FEE_ASSISTANT="feeassistant",e.NEARBY_AIRPORT="nearbyairport",e.MEMBER_RATES="member-rates",e.SEARCH_FORM="searchform",e.SHARE="share",e.PROMOTED_HOTEL="promoted-hotel",e.CONTACT_FORM="contactform",e.MASTERCARD_PLANT_TREE="MastercardPlantTree",e.FLEX_MATRIX="flex-matrix",e.AI="ai",e.EMPTY_SLOT="empty-slot",e.VIEW_TIME="view_time",e.MOUSE_HOVER="mouse_hover",e.ENGAGEMENT_CLICK="engagement_click"}(n||(n={})),function(e){e.VIEW="view",e.EVENT="event",e.ACTION="action"}(i||(i={}));class r{constructor(e=3){this.retryCount=e}send(e,t){return this.sendWithRetry(e,t)}sendWithRetry(e,t,n=0){const i=new AbortController,s=n+1,a=setTimeout(()=>{i.abort()},s*s*3e3);return this.sendRequest(e,t,i.signal).catch(n=>(clearTimeout(a),this.retry(e,t,s,n))).then(e=>(clearTimeout(a),e))}retry(e,t,n=0,i){return new Promise((s,a)=>{n<this.retryCount?this.sendWithRetry(e,t,n).then(s).catch(a):a({retry:n,error:i})})}sendRequest(e,t,n){const i=JSON.stringify(t),s=(new TextEncoder).encode(i).length;return fetch(e,{method:"POST",headers:{"Content-type":"application/json; charset=utf-8","X-Requested-With":"XMLHttpRequest","X-Content-Type-Options":"nosniff"},keepalive:s<64e3,body:i,signal:n}).then(e=>e.ok?"done":Promise.reject({status:e.status,statusText:e.statusText,type:"HTTP_ERROR"})).catch(e=>"AbortError"===e.name?Promise.reject({status:null==e?void 0:e.status,statusText:null==e?void 0:e.statusText,type:"TIMEOUT_ERROR",error:e}):Promise.reject({status:null==e?void 0:e.status,statusText:null==e?void 0:e.statusText,type:"FETCH_FAILED_ERROR",error:e}))}}class o{static newInstance(e){return this._instance=new this({...o._DEFAULT_CONFIG,...e}),this._instance._beforeFlushCallbacks=[...(null==e?void 0:e.onBeforeFlush)||[],...this._pendingCallbacks],this._pendingCallbacks=[],this._instance}static registerBeforeFlush(e){return this._instance?(this._instance._beforeFlushCallbacks.push(e),()=>{const t=this._instance._beforeFlushCallbacks.indexOf(e);t>=0&&this._instance._beforeFlushCallbacks.splice(t,1)}
1):(this._pendingCallbacks.push(e),()=>{const t=this._pendingCallbacks.indexOf(e);if(t>=0&&this._pendingCallbacks.splice(t,1),this._instance){const t=this._instance._beforeFlushCallbacks.indexOf(e);t>=0&&this._instance._beforeFlushCallbacks.splice(t,1)}})}static getInstance(){return this._instance||console.error("Vestigo service not initialized"),this._instance}static registerListener(e){this._listener&&window.removeEventListener("visibilitychange",this._listener),this._listener=()=>{if("hidden"===document.visibilityState){for(const t of e._beforeFlushCallbacks.slice())try{t()}catch(e){console.error("[@r9/vestigo] onBeforeFlush callback error:",e)}e.hasPendingEvents()&&e.sendEvents(!0)}},window.addEventListener("visibilitychange",this._listener)}constructor(e){this._beforeFlushCallbacks=[],this._eventBatch=[],this._config=e,this._httpClient=new r(e.retryCount),o.registerListener(this)}measure(e,t=!1){this._isMeasureEnabled(e.eventType)&&(this._eventBatch.push(e),this.sendEvents(t))}hasPendingEvents(){return this._eventBatch.length>0}debugLogEvent(e){if(this._config.debugMode){const t="eventName"in e?e.eventName:e.elementClass;console.log(`[@r9/vestigo] Logged ${e.eventType} ${t}`,e)}}sendEvents(e){const t=()=>{clearTimeout(this._eventBatchTimer),this._eventBatchTimer=void 0;const e=this._eventBatch;this._eventBatch=[],this._send({headers:{clientRequestTime:(new Date).toISOString()},events:e}),e.forEach(e=>this.debugLogEvent(e))};e?t():this._eventBatchTimer||(this._eventBatchTimer=setTimeout(t,this._config.batchFrequency))}_isMeasureEnabled(e){return e===i.VIEW&&this._config.trackViews||e===i.EVENT&&this._config.trackEvents||e===i.ACTION&&this._config.trackActions}_send(e){return this._httpClient.send(this._config.url,e).catch(({retry:t,error:n})=>{this._config.onError(e,t,n)})}}o._DEFAULT_CONFIG={url:"/s/vestigo/measure",retryCount:3,batchFrequency:500,trackViews:!0,trackEvents:!0,trackActions:!0,debugMode:!1,onError:()=>{}},o._pendingCallbacks=[],function(e){e.desktop="desktop",e.gtm="gtm",e.mweb="mweb",e.tweb="tweb",e.ios="ios",e.android="android",e.react="react",e.unknown="unknown"}(s||(s={})),function(e){e.DARK="dark",e.LIGHT="light",e.NO_PREFERENCE="no-preference"}(a||(a={}));const c=/[~`!@#$%\^&*+=\[\]\\';,/{}|\\":<>\?]+/i,l=/[~`!@#$%\^&*+=\[\]\\';,{}|\\":<>\?]+/i,d=/^[0-9a-z]+([-_]?[0-9a-z])+$/i,u=/^[a-zA-Z0-9_-]{4,32}={0,2}$/i,h=/^[.$_a-zA-Z0-9]+$/i,g=/^[A-Za-z\d-_/ ]+(,[A-Za-z\d-_/ ]+)*$/i;function m(e="",t=!1,n=d){return!(!t||!y(e))||e&&n.test(e)}function y(e=""){return 0===(e||"").length}class w{constructor(e=void 0,t=!1){this._log=e,this.needsType=t}debug(...e){this._log&&this._log.debug&&(this.needsType?this._log.debug("dev",e):this._log.debug(e))}error(...e){this._log&&this._log.error&&(this.needsType?this._log.error("dev",e):this._log.error(e))}info(...e){this._log&&this._log.info&&(this.needsType?this._log.info("dev",e):this._log.info(e))}warn(...e){this._log&&this._log.warn&&(this.needsType?this._log.warn("dev",e):this._log.warn(e))}}const p="16.3.0";class v{constructor(e={}){this._sendImmediately=!1,this.getWindowSize=()=>this._windowSize,this._options=v._normalizeOptions(e),this._userInterfaceStyle=v._getUserInterfaceStyle(),"function"==typeof this._options.windowSizeCallback?this.getWindowSize=this._options.windowSizeCallback:(this._windowSize=v._loadWindowSize(),window.addEventListener("resize",()=>{this._windowSize=v._loadWindowSize()})),this._logger=new w(this._options.logger,this._options.loggerNeedsType)}view(e,t,n={}){this._measure(i.VIEW,"show",n,e,t)}action(e,t={},n){this._measure(i.ACTION,e,t,n)}structuredAction(e,t){this._measure(i.ACTION,e.eventName,{...e.payload,eventObject:e.eventObject},t)}structuredEvent(e,t){this._measure(i.EVENT,e.eventName,{...e.payload,eventObject:e.eventObject,eventValue:e.eventValue},t)}setSendImmediately(e=!0){return this._sendImmediately=e,this}elementAction(e,t,n,s,a,r){const c=o.getInstance();if(!c)return;if(!m(e,!1))return void this._logger.error("elementClass is invalid!",e);const l=this._resolveContext(e,r);if(!l)return;const d={};void 0!==s&&(d.element=s),void 0!==a&&(d.action=a);const u={eventType:i.ACTION,elementClass:e,elementInstance:t,action:n,payload:d,context:l,timestamp:(new Date).toISOString()};c.measure(u,this._sendImmediately)}_measure(e,t,n,i="",s=""){const a=o.getInstance();if(!a)return;
1if(!m(t,!1))return void this._logger.error("eventName is invalid!",t);const r=this._resolveContext(t,i,s);r&&a.measure({eventType:e,eventName:t,payload:n,context:r,timestamp:(new Date).toISOString()},this._sendImmediately)}_resolveContext(e,t,n){var i,a;const r=this._options.viewCodeCallback();if(t&&(r.subPageType=t),n&&(r.pageType=n),!function(e){for(const t in e)if(e.hasOwnProperty(t)){const n=e[t];let i=y(n);if(i=i||!m(n,!1,c),!i)return!1}return!0}(r))return this._logger.error(`viewCode for ${e} contains invalid values(s)!`,r.vertical,r.pageType,r.subPageType),null;const o=this._options.viewIdCallback(),d=this._options.searchIdCallback(),w=this._options.seoPlacementIdCallback(),_=this._options.seoPageTagsCallback();return function(e=""){return m(e,!0,h)}(o)?function(e=""){return m(e,!0,u)}(d)?function(e=""){let t=y(e);return t=t||!m(e,!0,l),t}(w)?function(e=""){return m(e,!0,g)}(_)?{viewId:o,searchId:d,domain:this._options.domain||"",client:{type:this._options.clientType||s.unknown,windowSize:this.getWindowSize(),userInterfaceStyle:this._userInterfaceStyle,npmPackageVersion:p},viewCode:r,location:v._getLocaton(),seoPlacementId:w,tags:_,devicePixelRatio:this._options.devicePixelRatio,activeIrisViewId:null===(a=(i=this._options).activeIrisViewIdCallback)||void 0===a?void 0:a.call(i)}
1:(this._logger.error("tags is invalid!",_),null):(this._logger.error("seoPlacementId is invalid!",w),null):(this._logger.error("searchId is invalid!",d),null):(this._logger.error("viewId is invalid!",o),null)}static _normalizeOptions(e){return{domain:"",clientType:s.unknown,viewCodeCallback:()=>({vertical:"unknown",pageType:"unknown",subPageType:""}),searchIdCallback:()=>{},viewIdCallback:()=>"",seoPlacementIdCallback:()=>"",seoPageTagsCallback:()=>"",logger:void 0,loggerNeedsType:!1,windowSizeCallback:void 0,activeIrisViewIdCallback:void 0,devicePixelRatio:void 0,...Object.fromEntries(Object.entries(null!=e?e:{}).filter(([,e])=>void 0!==e))}}static _loadWindowSize(){return{height:window.innerHeight,width:window.innerWidth}}static _getLocaton(){return{uri:document.location.pathname,queryString:encodeURIComponent(document.location.search),referrer:encodeURIComponent(document.referrer)}}static _getUserInterfaceStyle(){let e=a.NO_PREFERENCE;return window.matchMedia&&(window.matchMedia("(prefers-color-scheme: light)").matches?e=a.LIGHT:window.matchMedia("(prefers-color-scheme: dark)").matches&&(e=a.DARK)),e}}class _{constructor(e){this._vestigo=e}setSendImmediately(e){return this._vestigo.setSendImmediately(e),this}vs(e,t,i){this.logAction(n.VS,e,t,i)}click(e,t,i){this.logAction(n.CLICK,e,t,i)}impression(e,t,i){this.logAction(n.IMPRESSION,e,t,i)}hover(e,t,i){this.logAction(n.HOVER,e,t,i)}log(e,t,n,i){this._vestigo.structuredAction({eventName:e,eventObject:t,payload:n},i)}logAction(e,t,n,i){this._vestigo.structuredAction({eventName:e,eventObject:t,payload:n},i)}trackElementAction(e,t,n,i,s,a){this._vestigo.elementAction(e,t,n,i,s,a)}}const T={click:n.CLICK,goToSearch:n.GO_TO_SEARCH,contactform:n.CONTACT_FORM,newsletter:n.NEWSLETTER};class E{constructor(e){this.domain=e,o.newInstance({url:"https://"+this.domain+"/s/vestigo/v1/measure",trackViews:!0,trackEvents:!0,trackActions:!0}),this.vInstance=new v({domain:this.domain,clientType:"cms",viewCodeCallback:()=>this.getViewCode(),seoPlacementIdCallback:()=>this.getSeoPlacementId(),seoPageTagsCallback:()=>this.getSeoPageTags()}),this.vActions=new _(this.vInstance)}getViewCode(){return{vertical:window.R9AnalyticsTravel.data_layer.vertical,pageType:window.R9AnalyticsTravel.data_layer.screenId,subPageType:window.R9AnalyticsTravel.data_layer.subScreenId||"unknown"}}getSeoPlacementId(){const e=window.R9AnalyticsTravel&&window.R9AnalyticsTravel.data_layer;return e&&e.placement||""}getSeoPageTags(){const e=window.R9AnalyticsTravel&&window.R9AnalyticsTravel.data_layer;return e&&e.tags||""}buildActionPayload(e,t){const n=t?Object.assign({},t):{};return e&&(n.eventValue=e),n}withImmediateSend(e,t){e&&this.vInstance.setSendImmediately(!0);try{t()}finally{e&&this.vInstance.setSendImmediately(!1)}}sendView(e){void 0===e&&(e=!1),this.withImmediateSend(e,()=>{this.vInstance.view()})}sendEvent(e,t,n,i,s){void 0===s&&(s=!1);const a=this.buildActionPayload(n,i);this.withImmediateSend(s,()=>{this.vInstance.structuredEvent({eventName:e,eventObject:t,eventValue:n,payload:a})})}sendAction(e,t,n,i,s){void 0===s&&(s=!1);const a=this.buildActionPayload(n,i),r=T[e];this.withImmediateSend(s,()=>{r?this.vActions.logAction(r,t,a):this.vInstance.structuredAction({eventName:e,eventObject:t,payload:a})})}send(e,t,n,i,s,a){switch(void 0===a&&(a=!1),e){case"view":this.sendView(a);break;case"event":this.sendEvent(t,n,i,s,a);break;case"action":this.sendAction(t,n,i,s,a)}}}function f(e,...t){0}const A=class{constructor(e){this.containers=e,this.layers={},this.pendingMessages=[],this.maxPendingMessagesPerLayer=50,this.maxFlushRetries=20,this.flushRetryDelayMs=100,this.flushRetryCounts={},this.flushRetryTimers={},document.addEventListener("r9.analytics.gtm.loaded",e=>{this.flushPending(e.detail)})}initContainers(){Object.entries(this.containers).forEach(([e,t])=>{switch(t.type){case"iframe":this.initIframe(t);break;case"inline":this.initInline(t)}})}initDataLayers(){this.layers={},Object.entries(this.containers).forEach(([e,t])=>{this.layers[t.name]={layer:t.layer,type:t.type}})}initIframe(e){const t=document.getElementById("r9-analytics-"+e.name);if(!t)return void f(0,e.name);const n=t.getAttribute("data-src");f(0,e.name);const i=()=>{t.dataset.r9GtmLoaded||(t.dataset.r9GtmLoaded="1",f(0,e.name,Math.round(performance.now())),document.dispatchEvent(new CustomEvent("r9.analytics.gtm.loaded",{detail:e.name})))};t.addEventListener("load",i),t.setAttribute("src",n);try{t.contentDocument&&"complete"===t.contentDocument.readyState&&i()}catch(e){}}initInline(e){f(0,e.name),function(t,n,i,s,a){t[s]=t[s]||[],t[s].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var r=n.getElementsByTagName(i)[0],o=n.createElement(i),c=s!=e.layer?"&l="+s:"";o.async=!0,o.src="//www.googletagmanager.com/gtm.js?id="+a+c,r.parentNode.insertBefore(o,r)}(window,document,"script",e.layer,e.id),f(0,e.name,Math.round(performance.now())),document.dispatchEvent(new CustomEvent("r9.analytics.gtm.loaded",{detail:e.name}))}sendAllArguments(){const e=Array.from(arguments);
1Object.entries(this.containers).forEach(([t,n])=>{this.pushArguments(n.name,e)?n.name:(n.name,this.pendingMessages.push({layerName:n.name,argsArray:e}))})}pushLayerArguments(e,t,n){(function(){t.push(arguments)}).apply(e,n)}pushArguments(e,t){const n=this.layers[e];if(!n)return!1;if("iframe"===n.type){const i=document.getElementById("r9-analytics-"+e);if(!i||!i.contentWindow)return!1;const s=i.contentWindow,a=s[n.layer];if(!a)return!1;const r=s.gtag;return"function"==typeof r?(r.apply(s,t),!0):(this.pushLayerArguments(s,a,t),!0)}const i=this.getLayer(e);if(!i)return!1;const s=window.gtag;return"function"==typeof s?(s.apply(window,t),!0):(this.pushLayerArguments(window,i,t),!0)}sendAll(e){Object.entries(this.containers).forEach(([t,n])=>{this.send(n.name,e)})}getLayer(e){const t=this.layers[e];if(!t)return null;switch(t.type){case"iframe":{const n=document.getElementById("r9-analytics-"+e);return n&&n.contentWindow&&n.contentWindow[t.layer]||null}case"inline":return window[t.layer]=window[t.layer]||[],window[t.layer];default:return null}}send(e,t){const n=this.getLayer(e);if(!n){const n=this.pendingMessages.findIndex(t=>t.layerName===e);return this.pendingMessages.reduce((t,n)=>n.layerName===e?t+1:t,0)>=this.maxPendingMessagesPerLayer&&-1!==n&&this.pendingMessages.splice(n,1),void this.pendingMessages.push({layerName:e,data:t})}n.push(t)}flushPending(e){const t=[];this.pendingMessages.forEach(n=>{if(n.layerName!==e)return void t.push(n);const i=this.getLayer(e);if(i)if(n.argsArray){if(this.pushArguments(e,n.argsArray))return void n.argsArray;t.push(n)}else n.data,i.push(n.data);else t.push(n)}),this.pendingMessages=t;if(!this.pendingMessages.some(t=>t.layerName===e))return this.flushRetryCounts[e]=0,void(this.flushRetryTimers[e]&&(clearTimeout(this.flushRetryTimers[e]),delete this.flushRetryTimers[e]));const n=this.flushRetryCounts[e]||0;n>=this.maxFlushRetries||this.flushRetryTimers[e]||(this.flushRetryCounts[e]=n+1,this.flushRetryTimers[e]=setTimeout(()=>{delete this.flushRetryTimers[e],this.flushPending(e)},this.flushRetryDelayMs))}};function b(e){return e.replace(/(\r\n|\r|\n)/g," ").trim().substring(0,200)}class C{constructor(){this.init()}initBlogCTAs(){document.querySelectorAll(".le-grand-k2.single .entry-content").forEach(e=>{this.initBlogContentClicks(e,"blog-content")});document.querySelectorAll(".le-grand-k2.single .r9-related-posts-block").forEach(e=>{this.initBlogRelatedClicks(e,"blog-related")});document.querySelectorAll(".le-grand-k2 .header").forEach(e=>{this.initBlogHeaderClicks(e,"blog-header")});document.querySelectorAll(".le-grand-k2").forEach(e=>{this.initBlogGenericClicks(e,"blog-generic"),this.initCF7s(e,"blog-form"),this.initR9Searches(e,"blog-searchwidget"),this.initR9Newsletters(e,"blog-newsletter")})}initFlexiCTAs(){document.querySelectorAll(".r9-multi[data-r9-analytics-element-name],.r9-multi-prev[data-r9-analytics-element-name]").forEach(e=>{const t=e.getAttribute("data-r9-analytics-element-name");this.initDeals(e,t),this.initCards(e,t),this.initButtons(e,t),this.initLinks(e,t),this.initCF7s(e,t),this.initR9Searches(e,t),this.initR9Newsletters(e,t)})}init(){this.initBlogCTAs(),this.initFlexiCTAs(),this.bindClickListeners(),this.bindSubmitListeners()}getBlockType(e){let t=e.closest("[class*=wp-block-]").className.split(" ");t=t.filter(e=>e.startsWith("wp-block-"));let n,i=t.shift();switch(i){case"wp-block-post-content":n=e.closest(":not(span):not(strong):not(a):not(em):not(b):not(i):not(small):not(cite):not(code)").tagName,i="wp-block-"+n.toLowerCase();break;case"wp-block-button__link":i=this.getBlockType(e.parentNode)}return i}initDeals(e,t){e.querySelectorAll("a.card-link[data-deal-type], a.card-list-item-link[data-deal-type]").forEach((e,n)=>{let i=e.querySelector("h1,h2,h3,h5,h6");const s=e.getAttribute("data-deal-type");let a=s??"";i=i?i.textContent||i.innerText:"",i=b(i),a=a.trim();const r={index:n,eventType:"action",eventName:"click",objectName:t,eventValue:"click",payload:{name:i,position:n,type:a+"-deal"}};e.setAttribute("data-r9analytics-click",JSON.stringify(r))})}initCards(e,t){e.querySelectorAll("a.card-link:not([data-r9analytics-click])").forEach((e,n)=>{let i=e.querySelector("h1,h2,h3,h5,h6");i=i?i.textContent||i.innerText:"",i=b(i);const s={index:n,eventType:"action",eventName:"click",objectName:t,eventValue:"click",payload:{name:i,position:n,type:"card-item"}};e.setAttribute("data-r9analytics-click",JSON.stringify(s))})}initButtons(e,t){e.querySelectorAll("a.button:not([data-r9analytics-click])").forEach((e,n)=>{let i=e.textContent||e.innerText;i=b(i);const s={index:n,eventType:"action",eventName:"click",objectName:t,eventValue:"click",payload:{name:i,position:n,type:"button-item"}};e.setAttribute("data-r9analytics-click",JSON.stringify(s))})}initBlogContentClicks(e,t){e.querySelectorAll("a:not([data-r9analytics-click])").forEach((e,n)=>{let i=e.textContent||e.innerText;i=b(i);const s=e.getAttribute("href"),a=this.getBlockType(e),r={index:n,eventType:"action",eventName:"click",objectName:t,eventValue:"click",payload:{name:i,position:n,type:"link-item",target:s,blockType:a}};e.setAttribute("data-r9analytics-click",JSON.stringify(r))})}initBlogRelatedClicks(e,t){e.querySelectorAll("a:not([data-r9analytics-click])").forEach((e,n)=>{let i=e.textContent||e.innerText||e.closest(".post-card").innerText;i=b(i);const s=e.getAttribute("href"),a={index:n,eventType:"action",eventName:"click",objectName:t,eventValue:"click",payload:{name:i,position:n,type:"link-item",target:s}};e.setAttribute("data-r9analytics-click",JSON.stringify(a))})}initBlogHeaderClicks(e,t){e.querySelectorAll("a:not([data-r9analytics-click])").forEach((e,n)=>{let i=e.textContent||e.innerText;i=b(i);const s=e.getAttribute("href"),a={index:n,eventType:"action",eventName:"click",objectName:t,eventValue:"click",payload:{name:i,position:n,type:"link-item",target:s}};e.setAttribute("data-r9analytics-click",JSON.stringify(a))})}initBlogGenericClicks(e,t){e.querySelectorAll("a:not([data-r9analytics-click])").forEach((e,n)=>{let i=e.textContent||e.innerText;i=b(i);const s=e.getAttribute("href"),a={index:n,eventType:"action",eventName:"click",objectName:t,eventValue:"click",payload:{name:i,position:n,type:"link-item",target:s}};e.setAttribute("data-r9analytics-click",JSON.stringify(a))})}initLinks(e,t){e.querySelectorAll("a:not([data-r9analytics-click])").forEach((e,n)=>{let i=e.textContent||e.innerText;i=b(i);const s={index:n,eventType:"action",eventName:"click",objectName:t,eventValue:"click",payload:{name:i,position:n,type:"link-item"}};e.setAttribute("data-r9analytics-click",JSON.stringify(s))})}initR9Searches(e,t){e.querySelectorAll(".r9-product-search-widget").forEach((e,n)=>{let i=e.getAttribute("id")||"";i=b(i);const s={index:n,eventType:"action",eventName:"goToSearch",objectName:t,eventValue:"click",payload:{name:i,type:"button"}};e.setAttribute("data-r9analytics-submit",JSON.stringify(s))})}initCF7s(e,t){e.querySelectorAll(".wpcf7").forEach((e,n)=>{let i=e.getAttribute("id")||"";i=b(i);const s={index:n,eventType:"action",eventName:"contactform",objectName:t,eventValue:"submit",payload:{name:i,status:"success"}};e.setAttribute("data-r9analytics-submit",JSON.stringify(s))})}initR9Newsletters(e,t){e.querySelectorAll(".r9-newsletter-subscribe").forEach((e,n)=>{let i=e.getAttribute("data-source")||"";i=b(i);const s={index:n,eventType:"action",eventName:"newsletter",objectName:t,eventValue:"submit",payload:{name:i,status:"successfully submitted"}};e.setAttribute("data-r9analytics-submit",JSON.stringify(s))})}bindSubmitListeners(){document.querySelectorAll(".wpcf7[data-r9analytics-submit]").forEach(e
1=>{e.addEventListener("wpcf7mailsent",this.trackSubmit.bind(this))});document.querySelectorAll(".r9-newsletter-subscribe[data-r9analytics-submit]").forEach(e=>{e.addEventListener("r9newsletter:success",this.trackSubmit.bind(this))});document.querySelectorAll(".r9-product-search-widget[data-r9analytics-submit]").forEach(e=>{e.addEventListener("r9searchwidget:submit",this.trackSubmit.bind(this))})}bindClickListeners(){document.querySelectorAll("[data-r9analytics-click]").forEach(e=>{e.addEventListener("click",this.trackClick.bind(this))})}trackClick(e){let t=e.target.getAttribute("data-r9analytics-click")||e.target.closest("[data-r9analytics-click]").getAttribute("data-r9analytics-click");t=JSON.parse(t),this.track(t,!0)}trackSubmit(e){let t=e.target.getAttribute("data-r9analytics-submit")||e.target.closest("[data-r9analytics-submit]").getAttribute("data-r9analytics-submit");t=JSON.parse(t),this.track(t,!0)}track(e,t){if(void 0===t&&(t=!1),window.r9VestigoInstance&&window.r9VestigoInstance.send(e.eventType,e.eventName,e.objectName,e.eventValue,e.payload,t),window.r9GTMInstance){const t={event:"r9",eventName:"cta",vestigoEventName:e.eventName,eventType:e.eventType,objectName:e.objectName,eventValue:e.eventValue,payload:e.payload};window.r9GTMInstance.sendAll(t)}}}class I{constructor(){document.addEventListener("r9gdpr:hide",()=>{window.r9_analytics_push("unified",{event:"r9",eventName:"bannerHidden"})})}}const S="r9_geo_privacy_compliant";function R(e,...t){0}class k{constructor(){this.marketing="denied",this.functional="denied",this.isEUGeoIpCompliant=null,this._geoReceivedAt=null,this._constructedAt=performance.now(),R();try{const e=localStorage.getItem(S);null!==e?(R(0),this.applyGeolocation(JSON.parse(e)),R()):R()}catch(e){R(0)}}applyGeolocation(e){const t=performance.now();this._geoReceivedAt;this._geoReceivedAt=t,this.isEUGeoIpCompliant=e,!1===e&&(this.marketing="granted",this.functional="granted"),R(0,this.marketing,Math.round(t-this._constructedAt));try{localStorage.setItem(S,JSON.stringify(e))}catch(e){}}applyGeolocationError(){R(),this.isEUGeoIpCompliant=null}readConsentModes(){if(!1===this.isEUGeoIpCompliant)return;const e=this.getCookie("consent"),t=e??"";this.marketing=t.includes(".mc1")?"granted":"denied",this.functional=t.includes(".fc1")?"granted":"denied"}getConsentModes(){return this.readConsentModes(),{ad_personalization:this.marketing,ad_storage:this.marketing,ad_user_data:this.marketing,analytics_storage:this.functional}}getConsentModesGranted(){return{ad_personalization:"granted",ad_storage:"granted",ad_user_data:"granted",analytics_storage:"granted"}}getCookie(e){var t=new RegExp(e+"=([^;]+)").exec(document.cookie);return null!=t?unescape(t[1]):null}}let N=!1,O=!1,L=!1;function M(e,...t){0}function P(){const e=performance.getEntriesByType("navigation");if(e&&e.length)return e[0].type}function x(){window.r9GTMInstance&&window.R9AnalyticsTravel&&window.R9AnalyticsTravel.containers&&Object.entries(window.R9AnalyticsTravel.containers).forEach(e=>{const t=e[1],n=t.name,i=window.r9GTMInstance.getLayer(n);M(0,i?(i.length,i[i.length-1],i.slice()):(t.type,document.getElementById("r9-analytics-"+n)))})}function D(){return M(0,Math.round(performance.now())),window.r9GTMInstance&&window.R9AnalyticsTravel&&window.R9AnalyticsTravel.data_layer?(M(0,window.R9AnalyticsTravel.data_layer),window.r9GTMInstance.sendAll(window.R9AnalyticsTravel.data_layer),x(),window.r9VestigoInstance?(M(),window.r9VestigoInstance.sendView(!0)):M(),!0):(M(0,(window.r9GTMInstance,!window.R9AnalyticsTravel||window.R9AnalyticsTravel.data_layer)),!1)}function G(e){if(O)return M(0),void x();window.r9GTMInstance&&window.R9AnalyticsTravel&&window.R9AnalyticsTravel.data_layer?(O=!0,M(0,window.R9AnalyticsTravel.data_layer),window.r9GTMInstance.sendAll(window.R9AnalyticsTravel.data_layer),x()):M(0)}function V(){L?M():(L=!0,M(),document.addEventListener("r9.analytics.gtm.loaded",()=>{G()},{once:!0}),G(),setTimeout(()=>G(),100),setTimeout(()=>G(),500))}function U(e){!function(e){const t=(({presentation:e,affiliate:t,placement:n,tags:i})=>({presentation:e,affiliate:t,placement:n,tags:i}))(e);window.R9AnalyticsTravel.data_layer=Object.assign({},window.R9AnalyticsTravel.data_layer,t)}(e.detail||{}),window.r9VestigoInstance=new E(window.R9AnalyticsTravel.base_host),window.r9GTMInstance=new A(window.R9AnalyticsTravel.containers
1),window.r9GTMInstance.initDataLayers(),window.r9AnalyticsEvents=new C,window.r9_analytics_push=(e,t)=>window.r9GTMInstance.send(e,t),window.r9DMAConsentMode=new k;let t=null!==window.r9DMAConsentMode.isEUGeoIpCompliant,n=!1;const i=[];function s(){n||(n=!0,window.r9GTMInstance.sendAllArguments("consent","default",window.r9DMAConsentMode.getConsentModes()))}function a(){t=!0,s(),window.r9GTMInstance.initContainers(),i.forEach(e=>{window.r9GTMInstance.send(e,window.R9AnalyticsTravel.data_layer)}),i.length=0}if(document.addEventListener("r9.analytics.gtm.loaded",e=>{t?window.r9GTMInstance.send(e.detail,window.R9AnalyticsTravel.data_layer):i.push(e.detail)}),t)a();else{const e=setTimeout(()=>{t||a()},5e3);document.addEventListener("r9.geolocation.success",()=>clearTimeout(e),{once:!0}),document.addEventListener("r9.geolocation.error",()=>clearTimeout(e),{once:!0})}document.addEventListener("r9gdpr:hide",()=>{s(),window.r9GTMInstance.sendAllArguments("consent","update",window.r9DMAConsentMode.getConsentModes())}),document.addEventListener("r9.geolocation.success",e=>{if(!e||!e.detail)return;const n=t,i=window.r9DMAConsentMode.isEUGeoIpCompliant;window.r9DMAConsentMode.applyGeolocation(e.detail.isEUGeoIpCompliant),n?i!==e.detail.isEUGeoIpCompliant&&window.r9GTMInstance.sendAllArguments("consent","update",window.r9DMAConsentMode.getConsentModes()):a()}),document.addEventListener("r9.geolocation.error",()=>{window.r9DMAConsentMode.applyGeolocationError(),t||a()}),window.r9VestigoInstance.sendView(),window.r9ConsentClose=new I}!function(){if(N)return void M();N=!0,window.r9BfcacheRestore=D;const e=P();"back_forward"===e&&V(),window.addEventListener("pageshow",e=>{const t=P();M(0,e.persisted),e.persisted?D():"back_forward"===t&&V()}),M(0)}(),document.addEventListener("r9.analytics.session.success",U),document.addEventListener("r9.analytics.session.error",U),window.r9Session=new t(window.R9AnalyticsTravel.session_uri)})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.