1if(typeof(rtfl_jquery)==='undefined'){rtfl_jquery=jQuery.noConflict()} 2rtfl=window.rtfl||{};(function(rtfl){let Url=retainful_localize_data?.ajax_url??'';function validateEmail(value){var valid=!0;if(!value||value.trim()===''){return!1} 3if(value.indexOf('@')===-1){valid=!1}else{var parts=value.split('@');if(parts.length!==2||!parts[0]||!parts[1]){valid=!1}else{var domain=parts[1];if(domain.indexOf('.')===-1){valid=!1}else{var domainParts=domain.split('.');var ext=domainParts[domainParts.length-1];if(!ext||ext.length>14||ext.length<2){valid=!1}}}} 4return valid} 5function validatePhone(value){if(!value||value.trim()===''){return!1} 6var cleaned=value.replace(/[\s\-\(\)\+]/g,'');return/^\d+$/.test(cleaned)&&cleaned.length>=7&&cleaned.length<=15} 7function updateCheckout(email,phone,guestData){if(!Url){return} 8if(email&&email.trim()!==''&&!validateEmail(email)){return} 9if(email&&validateEmail(email)){var previous=sessionStorage.getItem('rtfl_customer_email');sessionStorage.setItem('rtfl_customer_email',email);if(previous!==email){rtfl_jquery(document).trigger('rtfl:customer_identified',[email])}} 10if(phone&&phone.trim()!==''&&!validatePhone(phone)){return} 11if(typeof retainful_localize_data!=='undefined'&&retainful_localize_data.nonce){guestData.nonce=retainful_localize_data.nonce} 12rtfl_jquery.ajax({url:Url,type:"POST",dataType:'json',data:guestData,success:function(response){if(response&&response.success){}},error:function(xhr,status,error){console.error('Retainful: Failed to track user data',error)}})} 13rtfl_jquery(document).on('change','input#billing_email,input#billing_first_name,input#billing_last_name,input#billing_phone,input#rtfl_allow_gdpr,input#rnoc_allow_gdpr,input#rtfl_sms_consent',function(){var rnoc_phone=rtfl_jquery("#billing_phone").val();var rnoc_email=rtfl_jquery("#billing_email").val();var ship_to_bill=rtfl_jquery("#ship-to-different-address-checkbox:checked").length;var marketing_consent_checkbox=rtfl_jquery('input#rtfl_allow_gdpr');if(marketing_consent_checkbox.length===0){marketing_consent_checkbox=rtfl_jquery('input#rnoc_allow_gdpr')} 14var allow_gdpr=marketing_consent_checkbox.is(':checked');var sms_consent_checkbox=rtfl_jquery('input#rtfl_sms_consent');var sms_consent=sms_consent_checkbox.is(':checked');var guest_data={billing_first_name:rtfl_jquery('#billing_first_name').val(),billing_last_name:rtfl_jquery('#billing_last_name').val(),billing_company:rtfl_jquery('#billing_company').val(),billing_address_1:rtfl_jquery('#billing_address_1').val(),billing_address_2:rtfl_jquery('#billing_address_2').val(),billing_city:rtfl_jquery('#billing_city').val(),billing_state:rtfl_jquery('#billing_state').val(),billing_postcode:rtfl_jquery('#billing_postcode').val(),billing_country:rtfl_jquery('#billing_country').val(),billing_phone:rtfl_jquery('#billing_phone').val()||rtfl_jquery('input[type="tel"]').val(),billing_email:rtfl_jquery('#billing_email').val(),ship_to_billing:ship_to_bill,order_notes:rtfl_jquery('#order_comments').val(),shipping_first_name:rtfl_jquery('#shipping_first_name').val(),shipping_last_name:rtfl_jquery('#shipping_last_name').val(),shipping_company:rtfl_jquery('#shipping_company').val(),shipping_address_1:rtfl_jquery('#shipping_address_1').val(),shipping_address_2:rtfl_jquery('#shipping_address_2').val(),shipping_city:rtfl_jquery('#shipping_city').val(),shipping_state:rtfl_jquery('#shipping_state').val(),shipping_postcode:rtfl_jquery('#shipping_postcode').val(),shipping_country:rtfl_jquery('#shipping_country').val(),allow_gdpr:allow_gdpr,sms_consent:sms_consent,cart_token:localStorage.getItem('retainful_ac_cart_token'),action:'rnoc_track_user_data'};updateCheckout(rnoc_email,rnoc_phone,guest_data)});rtfl_jquery(document).on('change','.wp-block-woocommerce-checkout input[type="email"],.wp-block-woocommerce-checkout input[type="tel"],.wp-block-woocommerce-checkout input[name*="rtfl"],.wp-block-woocommerce-checkout input[name*="rnoc"],.wp-block-woocommerce-checkout input[id*="rtfl"],.wp-block-woocommerce-checkout input[id*="rnoc"]',function(){var rnoc_email=rtfl_jquery(".wp-block-woocommerce-checkout input[type='email']").first().val();
14var rnoc_phone=rtfl_jquery(".wp-block-woocommerce-checkout input[type='tel']").first().val();var marketing_consent_checkbox=rtfl_jquery('.wp-block-woocommerce-checkout #contact-rtfl-allow_gdpr').length?rtfl_jquery('.wp-block-woocommerce-checkout #contact-rtfl-allow_gdpr'):rtfl_jquery('.wp-block-woocommerce-checkout #order-rtfl-allow_gdpr');var allow_gdpr=marketing_consent_checkbox.is(':checked');var sms_consent_checkbox=rtfl_jquery('.wp-block-woocommerce-checkout #billing-rtfl-sms_consent').length?rtfl_jquery('.wp-block-woocommerce-checkout #billing-rtfl-sms_consent'):rtfl_jquery('.wp-block-woocommerce-checkout #order-rtfl-sms_consent');var sms_consent=sms_consent_checkbox.is(':checked');var guest_data={billing_first_name:rtfl_jquery('.wp-block-woocommerce-checkout #billing-first_name').first().val()||'',billing_last_name:rtfl_jquery('.wp-block-woocommerce-checkout #billing-last_name').first().val()||'',billing_address_1:rtfl_jquery('.wp-block-woocommerce-checkout #billing-address_1').first().val()||'',billing_address_2:rtfl_jquery('.wp-block-woocommerce-checkout #billing-address_2').first().val()||'',billing_city:rtfl_jquery('.wp-block-woocommerce-checkout #billing-city').first().val()||'',billing_postcode:rtfl_jquery('.wp-block-woocommerce-checkout #billing-postcode').first().val()||'',billing_phone:rnoc_phone||'',billing_email:rnoc_email||'',allow_gdpr:allow_gdpr,sms_consent:sms_consent,ship_to_billing:1,cart_token:localStorage.getItem('retainful_ac_cart_token'),action:'rnoc_track_user_data'};updateCheckout(rnoc_email,rnoc_phone,guest_data)});rtfl_jquery(document).on("retainful-form-submitted",function(e,email){if(e.email===undefined){return} 15var guest_data={action:'rnoc_track_user_data',billing_email:e.email};updateCheckout(e.email,'',guest_data)});rtfl_jquery(document).ready(function(){maybeTrack()});var trackingConfig=(typeof retainful_localize_data!=='undefined')?retainful_localize_data.viewed_product_tracking:null;if(!trackingConfig||!trackingConfig.enabled)return;var viewedProduct=(typeof retainful_localize_data!=='undefined')?retainful_localize_data.viewed_product:null;if(!viewedProduct||!viewedProduct.product_id)return;var productId=parseInt(viewedProduct.product_id,10);var dedupMinutes=parseInt(trackingConfig.dedup_window||30,10);function getIdentifiedEmail(){if(trackingConfig.customer_email&&trackingConfig.customer_email!==''){return trackingConfig.customer_email} 16return sessionStorage.getItem('rtfl_customer_email')||''} 17function isProductTrackEnabled(){return trackingConfig&&trackingConfig.enabled} 18function isDuplicate(email,productId){var key='rtfl_pv_'+hashString(email)+'_'+productId;var last=sessionStorage.getItem(key);if(!last)return!1;var elapsed=(Date.now()-parseInt(last,10))/1000/60;return elapsed<dedupMinutes} 19function markAsSent(email,productId){var key='rtfl_pv_'+hashString(email)+'_'+productId;sessionStorage.setItem(key,Date.now().toString())} 20function hashString(str){var h=0;for(var i=0;i<str.length;i++){h=(Math.imul(31,h)+str.charCodeAt(i))|0} 21return Math.abs(h).toString(36)} 22function sendViewedProductEvent(email){if(!Url||!email)return;var isEnabled=isProductTrackEnabled();if(!isEnabled)return;rtfl_jquery.ajax({url:Url,type:'POST',dataType:'json',data:{action:'rtfl_track_product_viewed',nonce:retainful_localize_data.nonce,product_id:productId,email:email,},success:function(response){if(response&&response.success){markAsSent(email,productId)}},error:function(){}})} 23function maybeTrack(){var isEnabled=isProductTrackEnabled();if(!isEnabled)return;var email=getIdentifiedEmail();if(email&&!isDuplicate(email,productId)){if(typeof productId=='undefined')return;sendViewedProductEvent(email);return}}})(rtfl_jquery)
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.