1(function($){'use strict';if(typeof wpvr_analytics==='undefined'){return} 2var config=wpvr_analytics;function generateUUIDv4(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=(Math.random()*16)|0;var v=c==='x'?r:(r&0x3)|0x8;return v.toString(16)})} 3function getCookie(name){var match=document.cookie.match(new RegExp('(?:^|; )'+name.replace(/([.$?*|{}()[\]\\/+^])/g,'\\$1')+'=([^;]*)'));return match?decodeURIComponent(match[1]):null} 4function setCookie(name,value,seconds){var expires=new Date(Date.now()+seconds*1000).toUTCString();document.cookie=name+'='+encodeURIComponent(value)+'; expires='+expires+'; path=/; SameSite=Lax'} 5var sessionToken=config.session_token||getCookie('wpvr_session_token');if(!sessionToken||!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(sessionToken)){sessionToken=generateUUIDv4();setCookie('wpvr_session_token',sessionToken,30*60)} 6var eventBuffer=[];function track(eventData){if(!eventData||!eventData.event_type){return} 7eventData.tour_id=parseInt(config.tour_id,10);eventData.timestamp=Date.now();eventBuffer.push(eventData)} 8function flushBuffer(){if(!eventBuffer.length){return} 9if(!parseInt(config.tour_id,10)){return} 10var payload=eventBuffer.slice();eventBuffer=[];$.post(config.ajax_url,{action:'wpvr_track_analytics_event',security:config.nonce,session_token:sessionToken,events:payload})} 11function flushBeacon(){if(!eventBuffer.length){return} 12if(typeof navigator.sendBeacon!=='function'){flushBuffer();return} 13var body=new URLSearchParams();body.append('action','wpvr_track_analytics_event');body.append('security',config.nonce);body.append('session_token',sessionToken);for(var i=0;i<eventBuffer.length;i++){body.append('events[]',JSON.stringify(eventBuffer[i]))} 14navigator.sendBeacon(config.ajax_url,body);eventBuffer=[]} 15var flushInterval=setInterval(flushBuffer,config.heartbeat_interval||5000);window.addEventListener('beforeunload',flushBeacon);document.addEventListener('visibilitychange',function(){if(document.visibilityState==='hidden'){flushBeacon()}});var currentSceneId=null;var dwellTimer=null;var dwellSeconds=0;var dwellPaused=!1;var dwellStartTime=null;var inactiveSince=null;var MAX_INACTIVE_SECS=30*60;var lastHeartbeatAt=null;var sceneEnteredAt=null;function startDwell(){if(dwellTimer){return} 16dwellStartTime=Date.now();lastHeartbeatAt=Date.now();dwellTimer=setInterval(function(){if(dwellPaused){return} 17dwellSeconds+=5;lastHeartbeatAt=Date.now();if(inactiveSince&&(Date.now()-inactiveSince)/1000>=MAX_INACTIVE_SECS){stopDwell();return} 18track({event_type:'dwell_heartbeat',dwell_seconds:5,scene_id:currentSceneId})},5000)} 19function pauseDwell(){dwellPaused=!0;if(!inactiveSince){inactiveSince=Date.now()}} 20function resumeDwell(){dwellPaused=!1;inactiveSince=null} 21function stopDwell(){if(dwellTimer){clearInterval(dwellTimer);dwellTimer=null}} 22document.addEventListener('visibilitychange',function(){if(document.visibilityState==='hidden'){pauseDwell()}else{resumeDwell()}});window.addEventListener('blur',pauseDwell);window.addEventListener('focus',resumeDwell);document.addEventListener('wpvr:tour_loaded',function(e){var detail=(e&&e.detail)||{};if(detail.tour_id){config.tour_id=parseInt(detail.tour_id,10)} 23track({event_type:'tour_load'});sceneEnteredAt=Date.now();lastHeartbeatAt=Date.now();startDwell()});document.addEventListener('wpvr:scene_changed',function(e){var detail=(e.detail)||{};if(detail.from&¤tSceneId&&!dwellPaused){var ref=lastHeartbeatAt||sceneEnteredAt||dwellStartTime;if(ref){var partialSec=Math.round((Date.now()-ref)/1000);if(partialSec>=1){track({event_type:'dwell_heartbeat',dwell_seconds:partialSec,scene_id:detail.from});lastHeartbeatAt=Date.now()}}} 24if(detail.to){sceneEnteredAt=Date.now();lastHeartbeatAt=Date.now();currentSceneId=detail.to;track({event_type:'scene_view',scene_id:detail.to})} 25if(detail.from&&detail.to){track({event_type:'scene_transition',scene_id:detail.to,source_scene_id:detail.from})}});document.addEventListener('wpvr:hotspot_hovered',function(e){var detail=(e.detail)||{};track({event_type:'hotspot_hover',hotspot_id:detail.hotspot_id||null,scene_id:detail.scene_id||null})});document.addEventListener('wpvr:hotspot_clicked',function(e){var detail=(e.detail)||{};track({event_type:'hotspot_click',hotspot_id:detail.hotspot_id||null,scene_id:detail.scene_id||null,hotspot_type:detail.hotspot_type||null})});document.addEventListener('wpvr:hotspot_clicked',function(e){var detail=(e.detail)||{};if(!detail.url){return} 26var url=detail.url;var isCTA=/^(https?:|tel:|mailto:)/i.test(url);if(isCTA&&detail.hotspot_type==='url'){track({event_type:'cta_click',hotspot_id:detail.hotspot_id||null,scene_id:detail.scene_id||null})}});var lastWcHotspot=null;var lastWcScene=null;document.addEventListener('wpvr:hotspot_clicked',function(e){var detail=(e.detail)||{};if(detail.hotspot_type==='wc_product'){lastWcHotspot=detail.hotspot_id||null;lastWcScene=detail.scene_id||null}});if(typeof wc_add_to_cart_params!=='undefined'){$(document).on('added_to_cart',function(){if(lastWcHotspot){track({event_type:'add_to_cart',hotspot_id:lastWcHotspot,scene_id:lastWcScene});lastWcHotspot=null;lastWcScene=null}})} 27document.addEventListener('wpvr:lead_captured',function(e){var detail=(e.detail)||{};track({event_type:'lead_capture',hotspot_id:detail.hotspot_id||null,scene_id:detail.scene_id||null})});var pannellumViewer=null;setInterval(function(){if(!pannellumViewer&&window._wpvrViewers){if(config.tour_id){pannellumViewer=window._wpvrViewers[
27config.tour_id]||null} 28if(!pannellumViewer){var keys=Object.keys(window._wpvrViewers);if(keys.length){pannellumViewer=window._wpvrViewers[keys[0]]||null;if(pannellumViewer&&!parseInt(config.tour_id,10)){config.tour_id=parseInt(keys[0],10)}}}} 29if(!pannellumViewer||typeof pannellumViewer.getPitch!=='function'){return} 30var pitch=pannellumViewer.getPitch();var yaw=pannellumViewer.getYaw();var pitchBucket=Math.floor(pitch/10)*10;var yawBucket=Math.floor(yaw/10)*10;pitchBucket=Math.max(-90,Math.min(80,pitchBucket));yawBucket=Math.max(-180,Math.min(170,yawBucket));track({event_type:'dwell_heartbeat',dwell_seconds:0,scene_id:currentSceneId,pitch_bucket:pitchBucket,yaw_bucket:yawBucket})},5000);window.wpvrTracker={track:track,flush:flushBuffer}}(jQuery)) 31;
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.