PageSourceSearch

https://www.reputationx.com/wp-content/cache/min/1/wp-content/them…/assets/js/contact-flow.js?ver=1790873036

js reputationx.com collected 2026-10-02 03:43:44 UTC 10,471 bytes, 36 lines download raw bytes

1(function(){'use strict';var CALENDLY_BASE_URL=(typeof repxSettings!=='undefined'&&repxSettings.calendlyUrl)?repxSettings.calendlyUrl:'https://calendly.com/mitch-reputationx/meeting-reputation-x?hide_gdpr_banner=1';var CALENDLY_URLS=(typeof repxSettings!=='undefined'&&repxSettings.calendlyUrls)||{};var currentFit='good';function calendlyUrlFor(fit){return CALENDLY_URLS[fit]||CALENDLY_BASE_URL}
2document.addEventListener('DOMContentLoaded',function(){var params=new URLSearchParams(window.location.search);if((params.get('prefill')||params.get('prefill_fn'))&&!params.get('intake')){var croService=params.get('prefill_service');if(croService){sessionStorage.setItem('repx_cro_service_preset',croService)}
3history.replaceState(null,'',window.location.pathname);var prefillInterval=setInterval(function(){var nextBtn=document.querySelector('#gform_page_4_1 .gform_next_button');if(!nextBtn)return;clearInterval(prefillInterval);setTimeout(function(){nextBtn.click()},600)},100);setTimeout(function(){clearInterval(prefillInterval)},5000)}else{var croPrefill=sessionStorage.getItem('repx_cro_prefill');if(croPrefill&&!params.get('intake')){try{var prefillData=JSON.parse(croPrefill);sessionStorage.removeItem('repx_cro_prefill');var legacyInterval=setInterval(function(){var firstNameField=document.getElementById('input_4_13_3');if(!firstNameField)return;clearInterval(legacyInterval);setFieldValue('input_4_13_3',prefillData.first_name);setFieldValue('input_4_13_6',prefillData.last_name);setFieldValue('input_4_2',prefillData.email);if(prefillData.inquiry_type){setSelectByText('input_4_8',prefillData.inquiry_type)}
4if(prefillData.service_type){sessionStorage.setItem('repx_cro_service_preset',prefillData.service_type)}
5var nextBtn=document.querySelector('#gform_page_4_1 .gform_next_button');if(nextBtn){setTimeout(function(){nextBtn.click()},600)}},100);setTimeout(function(){clearInterval(legacyInterval)},5000)}catch(e){sessionStorage.removeItem('repx_cro_prefill')}}}
6if(typeof jQuery!=='undefined'){jQuery(document).on('gform_page_loaded',function(e,formId,currentPage){if(parseInt(formId)!==4||parseInt(currentPage)!==2)return;var servicePreset=sessionStorage.getItem('repx_cro_service_preset');if(!servicePreset)return;sessionStorage.removeItem('repx_cro_service_preset');setSelectByText('input_4_11',servicePreset)})}
7if(params.get('intake')==='done'){var fit=params.get('fit');currentFit=(fit==='low'||fit==='none')?fit:'good';var token=params.get('t')||'';history.replaceState(null,'',window.location.pathname);completeStep(1);loadIntake(params,token,function(intake){if(intake.fn)sessionStorage.setItem('repx_contact_name',intake.fn);if(intake.ln)sessionStorage.setItem('repx_contact_lastname',intake.ln);if(intake.em)sessionStorage.setItem('repx_contact_email',intake.em);if(intake.svc)sessionStorage.setItem('repx_contact_svc',intake.svc);revealStep2(intake.fn,intake.ln,intake.em,'',intake.svc,currentFit);setTimeout(function(){var panel=document.getElementById('step-calendly');if(panel){panel.scrollIntoView({behavior:'smooth',block:'start'})}},350)});fireEvent('repx_intake_submitted',{form_type:'contact'});var lpSlug=params.get('lp_slug')||sessionStorage.getItem('repx_lp_slug')||'';if(lpSlug){sessionStorage.setItem('repx_lp_slug',lpSlug);fireEvent('repx_intake_complete',{lp_slug:lpSlug,form_type:'landing'})}
8var alreadyFired=sessionStorage.getItem('repx_initial_form_fired');sessionStorage.removeItem('repx_initial_form_fired');if(!alreadyFired){fireEvent('repx_initial_form_complete',{})}}
9var tyWidget=document.querySelector('.calendly-inline-widget[data-repx-fit]');if(tyWidget){currentFit=tyWidget.getAttribute('data-repx-fit')==='low'?'low':'good'}
10var sentTo=document.querySelector('[data-repx-sent-to]');var sentEm=sessionStorage.getItem('repx_contact_email');if(sentTo&&sentEm){var strong=sentTo.querySelector('strong');if(strong)strong.textContent=sentEm;sentTo.removeAttribute('hidden')}
11window.addEventListener('message',onCalendlyMessage);window.addEventListener('message',onCalendlyResize)});function onCalendlyResize(e){if(!e.data||e.data.event!=='calendly.page_height'){return}
12var container=document.getElementById('calendly-container');var height=e.data.payload&&e.data.payload.height;if(container&&height){container.style.height=height}}
13function onCalendlyMessage(e){if(!e.data||e.data.event!=='calendly.event_scheduled'){return}
14var intro=currentFit==='low';var dest=intro?'/thank-you?meeting=intro':'/thank-you?meeting=scheduled';fireEventThenNavigate(intro?'repx_intro_scheduled':'repx_meeting_scheduled',{},function(){window.location.href=dest});fireEvent('repx_flow_complete',{})}
15function completeStep(num){var el=document.querySelector('[data-step="'+num+'"]');if(el){el.classList.remove('flow-step--active');el.classList.add('flow-step--completed')}
16var next=document.querySelector('[data-step="'+(num+1)+'"]');if(next){next.classList.remove('flow-step--pending');next.classList.add('flow-step--active')}}
17function revealStep2(firstName,lastName,email,phone,svc,fit){var intakePanel=document.getElementById('step-intake');if(intakePanel){intakePanel.classList.remove('flow-step-panel--visible');intakePanel.classList.add('flow-step-panel--hidden');intakePanel.setAttribute('hidden','');intakePanel.setAttribute('aria-hidden','true')}
18var panel=document.getElementById('step-calendly');if(!panel)return;panel.removeAttribute('hidden');panel.removeAttribute('aria-hidden');panel.classList.remove('flow-step-panel--hidden');panel.classList.add('flow-step-panel--visible');var heading=panel.querySelector('.flow-step-panel__header h2');if(heading){heading.setAttribute('tabindex','-1');heading.focus({preventScroll:!0})}
19if(fit==='none'){var container=document.getElementById('calendly-container');var micro=panel.querySelector('.flow-step-panel__micro');if(heading)heading.textContent='Thanks, Mitch will email you shortly.';if(micro)micro.setAttribute('hidden','');if(container)container.setAttribute('hidden','');return}
20initCalendly(firstName,lastName,email,phone,svc)}
21function loadIntake(params,token,done){var fallback={fn:params.get('fn')||sessionStorage.getItem('repx_contact_name')||'',ln:params.get('ln')||sessionStorage.getItem('repx_contact_lastname')||'',em:params.get('em')||sessionStorage.getItem('repx_contact_email')||'',svc:params.get('svc')||sessionStorage.getItem('repx_contact_svc')||'',};var base=(typeof repxSettings!=='undefined'&&repxSettings.restUrl)?repxSettings.restUrl:'/wp-json/repx/v1/';if(!token||typeof fetch!=='function'){done(fallback);return}
22fetch(base+'intake-handoff?t='+encodeURIComponent(token),{credentials:'same-origin',cache:'no-store'}).then(function(r){return r.ok?r.json():{}}).then(function(d){done({fn:d.fn||fallback.fn,ln:d.ln||fallback.ln,em:d.em||fallback.em,svc:d.svc||fallback.svc,})}).catch(function(){done(fallback)})}
23var calendlyScriptState=0;var calendlyReadyQueue=[];function whenCalendlyReady(cb){if(calendlyScriptState===2||typeof Calendly!=='undefined'){cb();return}
24calendlyReadyQueue.push(cb);if(calendlyScriptState===1){return}
25calendlyScriptState=1;var s=document.createElement('script');s.src='https://assets.calendly.com/assets/external/widget.js';s.async=!0;s.onload=function(){calendlyScriptState=2;var queue=calendlyReadyQueue.splice(0);for(var i=0;i<queue.length;i++){queue[i]()}};document.head.appendChild(s)}
26function initCalendly(firstName,lastName,email,phone,svc){if(typeof Calendly==='undefined'){whenCalendlyReady(function(){initCalendly(firstName,lastName,email,phone,svc)});return}
27var container=document.getElementById('calendly-container');if(!container)return;var customAnswers={};if(svc&&currentFit==='low')customAnswers.a1=svc;var url=calendlyUrlFor(currentFit);var full=(firstName+' '+(lastName||'')).trim();var extra=currentFit==='low'?{name:full,email:email,a1:customAnswers.a1}:{first_name:firstName,last_name:lastName,email:email};Object.keys(extra).forEach(function(k){if(extra[k]){url+=(url.indexOf('?')===-1?'?':'&')+k+'='+encodeURIComponent(extra[k])}});Calendly.initInlineWidget({url:url,parentElement:container,prefill:{name:firstName+(lastName?' '+lastName:''),firstName:firstName,lastName:lastName,email:email,customAnswers:customAnswers,},})}
28function fireEvent(eventName,data){var payload=Object.assign({},data,{event:eventName});if(typeof dataLayer!=='undefined'&&Array.isArray(dataLayer)){dataLayer.push(payload)}else if(typeof gtag==='function'){gtag('event',eventName,data)}}
29function fireEventThenNavigate(eventName,data,next){var GTM_TIMEOUT_MS=2000;var NAV_FALLBACK_MS=2500;var done=!1;function once(){if(done)return;done=!0;clearTimeout(timer);next()}
30var timer=setTimeout(once,NAV_FALLBACK_MS);if(typeof dataLayer!=='undefined'&&Array.isArray(dataLayer)){dataLayer.push(Object.assign({},data,{event:eventName,eventCallback:once,eventTimeout:GTM_TIMEOUT_MS,}))}else if(typeof gtag==='function'){gtag('event',eventName,Object.assign({},data,{event_callback:once,event_timeout:GTM_TIMEOUT_MS,}))}else{once()}}
31function setFieldValue(id,value){var el=document.getElementById(id);if(el&&value){el.focus();var proto=el instanceof HTMLSelectElement?HTMLSelectElement.prototype:HTMLInputElement.prototype;var nativeSetter=Object.getOwnPropertyDescriptor(proto,'value');
31if(nativeSetter&&nativeSetter.set){nativeSetter.set.call(el,value)}else{el.value=value}
32el.dispatchEvent(new InputEvent('input',{bubbles:!0,inputType:'insertText',data:value,}));el.dispatchEvent(new Event('change',{bubbles:!0}));el.dispatchEvent(new Event('blur',{bubbles:!0}));if(typeof jQuery!=='undefined'){jQuery(el).trigger('change')}}}
33function setSelectByText(id,text){var el=document.getElementById(id);if(!el||!text)return;var lowerText=text.toLowerCase();function applySelection(selectEl,optionValue){selectEl.focus();var nativeSetter=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,'value');if(nativeSetter&&nativeSetter.set){nativeSetter.set.call(selectEl,optionValue)}else{selectEl.value=optionValue}
34selectEl.dispatchEvent(new Event('input',{bubbles:!0}));selectEl.dispatchEvent(new Event('change',{bubbles:!0}));selectEl.dispatchEvent(new Event('blur',{bubbles:!0}));if(typeof jQuery!=='undefined'){jQuery(selectEl).trigger('change')}}
35for(var i=0;i<el.options.length;i++){if(el.options[i].text.toLowerCase()===lowerText){applySelection(el,el.options[i].value);return}}
36for(var j=0;j<el.options.length;j++){if(el.options[j].text.toLowerCase().indexOf(lowerText)!==-1){applySelection(el,el.options[j].value);return}}}})()

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.