PageSourceSearch

https://www.purina.es/modules/custom/nppe_ttt_datalayer/assets/js/…UsEnquiryFormEvents.208e01309933ea3185d6.js

js purina.es collected 2026-10-02 11:45:07 UTC 6,806 bytes, 1 lines download raw bytes

1export const __webpack_esm_id__=989;export const __webpack_esm_ids__=[989];export const __webpack_esm_modules__={717(e,t,n){n.r(t),n.d(t,{default:()=>y});const s={questions:{name:"questions",type:"select",step:"step_01"},petType01:{name:"pets_01",type:"select",step:"step_01_01"},tellUsMore:{name:"tell_us_more",type:"textarea",step:"step_01_01"},giveACall01:{name:"give_a_call_01",type:"select",step:"step_01_02"},phoneNumber01:{name:"phone_number_01",type:"input",step:"step_01_02"},tellAboutPet03:{name:"tell_about_pet_03",type:"textarea",step:"step_03_01"},howCanWeHelp03:{name:"how_can_we_help_03",type:"textarea",step:"step_03_02"},giveACall03:{name:"give_a_call_03",type:"select",step:"step_03_02"},phoneNumber03:{name:"phone_number_03",type:"input",step:"step_03_02"},needs04:{name:"needs_04",type:"select",step:"step_04_01"},pets0401:{name:"pets_04_01",type:"select",step:"step_04_01"},pets0402:{name:"pets_04_02",type:"select",step:"step_04_02"},feeding0402:{name:"feeding_04_02",type:"textarea",step:"step_04_02"},tellAboutPet0402:{name:"tell_about_pet_04_02",type:"textarea",step:"step_04_02"},giveACall04:{name:"give_a_call_04",type:"select",step:"step_04_03"},phoneNumber04:{name:"phone_number_04",type:"input",step:"step_04_03"},brands:{name:"brands",type:"select",step:"step_06_01"},packSize:{name:"pack_size",type:"input",step:"step_06_01"},tellAboutExperience:{name:"tell_about_experience",type:"textarea",step:"step_06_02"},whereBuy:{name:"where_buy",type:"input",step:"step_06_02"},batchCode:{name:"batch_code",type:"input",step:"step_06_02"},onlineSupport:{name:"online_support",type:"select",step:"step_07_01"},howCanWeHelp0701:{name:"how_can_we_help_07_01",type:"textarea",step:"step_07_01"},howCanWeHelp0702:{name:"how_can_we_help_07_02",type:"textarea",step:"step_07_01"},howCanWeHelp08:{name:"how_can_we_help_08",type:"textarea",step:"step_08_01"}},r={step_01_01:{step_number:2,fields:["petType01","tellUsMore"]},step_01_02:{step_number:3,fields:["giveACall01","phoneNumber01"]},step_03_01:{step_number:2,fields:["tellAboutPet03"]},step_03_02:{step_number:3,fields:["howCanWeHelp03","giveACall03","phoneNumber03"]},step_04_01:{step_number:2,fields:["needs04","pets0401"]},step_04_02:{step_number:3,fields:["pets0402","feeding0402","tellAboutPet0402"]},step_04_03:{step_number:4,fields:["giveACall04","phoneNumber04"]},step_06_01:{step_number:2,fields:["brands","packSize"]},step_06_02:{step_number:3,fields:["tellAboutExperience","whereBuy","batchCode"]},step_07_01:{step_number:2,fields:["onlineSupport","howCanWeHelp0701","howCanWeHelp0702"]},step_08_01:{step_number:2,fields:["howCanWeHelp08"]}};let p=null;const a={pushedStartEvent:!1,fieldsSeparator:"|",currentStep:0},_={user_id:"undefined",start_timestamp:null,param_location:"component_page",form_id:"undefined",form_name:"Contact Us Hub",form_type:"Drupal",module_id:"nppe_ttt_datalayer",module_name:"NPPE TTT Datalayer",module_version:"3.1.0"},o=e=>{if(!e.value)return;const t=e.querySelector(`option[value="${e.value}"]`);return t?.innerText||""},i=e=>{const t=window.getComputedStyle(e.parentElement.parentElement);return"none"!==t.display&&"hidden"!==t.visibility},l=()=>{_?.start_timestamp||(_.start_timestamp=(new Date).toISOString(),_.user_id=drupalSettings?.nppe_ttt_datalayer?.baseline?.user_info?.user_id||"N/A"),a.currentStep=1;const e={..._,event:"contact_interaction",event_name:"contactus_start",step_name:s.questions.questionText||"N/A",step_result:s.questions.getAnswer()||"N/A",step_number:a.currentStep.toString()};window.dataLayer.push(e)},u=(e,t,n)=>{const s={..._,event:"contact_interaction",event_name:"contactus_progress",step_name:e,step_number:t.toString(),step_result:n};window.dataLayer.push(s)},c=e=>{const t=document.querySelectorAll(".form-item--error-message");t.length>0?(e=>{const t=Array.from(e).map(e=>e.innerText.trim()),n={..._,event:"contact_error",event_name:"contactus_submit_error",error_name:t.join(a.fieldsSeparator),error_code:t.join(a.fieldsSeparator)};window.dataLayer.push(n)})(t):d(e)},d=async e=>{const t=e.querySelector('input[name="email"]')?.value||e.querySelector('input[name="email_address"]')?.value||e.querySelector('input[name="mail"]')?.value||"";let n="undefined";if(t&&(n=await b(t)),"undefined"===n)return;const r={..._,event:"contact_interaction",event_name:"contactus_submit",cdp_user_id:n,step_name:"A bit about you",step_number:(a.currentStep+1).toString(),step_result:"N/A",topic:s.questions.getAnswer()||"N/A"};window.dataLayer.push(r)},m=(e,t)=>
1{e.forEach(e=>{0===e.addedNodes.length&&0===e.removedNodes.length||(e.addedNodes.forEach(e=>{e.classList&&e.classList.contains("ajax-progress")&&document.querySelectorAll(".form-item--error-message").forEach(e=>e.remove())}),e.removedNodes.forEach(e=>{e.classList&&e.classList.contains("ajax-progress")&&(p=setTimeout(()=>c(t),45))}))})};function y(e){const t=e?.detail?.form,n=t.parentNode;_.form_id=t.getAttribute("id")||"",_.user_id=drupalSettings?.nppe_ttt_datalayer?.baseline?.user_info?.user_id||"N/A";for(const e in s){const n=s[e],r=t.querySelector(`${n.type}[name="${n.name}"]`),p=t.querySelector(`label[for="${r?.getAttribute("id")}"]`);n.element=r||null,n.isRequired=r?.getAttribute("required")||!1,n.label=p||null,n.getAnswer=()=>r?"select"===n.type?o(r):r.value||"":"",p&&(n.questionText=p.innerText||"")}for(const e in r){const n=r[e],p="next_"+e.slice(5);n.stepButton=t.querySelector(`input[name="${p}"]`)||null,n.stepButtonLabel=t.querySelector(`label[for="${n.stepButton?.getAttribute("id")}"]`)||null,n.pushEvent=()=>{if(!n.isStepButtonPushed())return;const e=n.getQuestions().join(a.fieldsSeparator)||"N/A";a.currentStep=n.step_number;const t=n.getAnswers().join(a.fieldsSeparator)||"N/A";u(e,a.currentStep,t)},n.isStepButtonPushed=()=>{if(!n.stepButton)return!1;const e=i(n.stepButton)||!1,t=n.stepButton.checked||!1;return e&&t},n.getQuestions=()=>{const e=[];return n.fields.forEach(t=>{const n=s[t];e.push(n.questionText||"")}),e},n.getAnswers=()=>{const e=[];return n.fields.forEach(t=>{const n=s[t];e.push(n.getAnswer())}),e},n.fields.forEach(e=>{const t=s[e];t.element?.addEventListener("change",()=>{n.stepButton.checked=!1,n.stepButton.dispatchEvent(new Event("change")),n.pushEvent()})}),n.stepButton?.addEventListener("click",n.pushEvent)}new MutationObserver(e=>m(e,t)).observe(n,{childList:!0,subtree:!0}),s.questions.element?.addEventListener("change",l)}const b=async e=>{const t=drupalSettings?.nppe_ttt_datalayer?.variables.cdp_id_crypto_salt,n=drupalSettings?.nppe_ttt_datalayer?.variables.cdp_id_crypto_start,s=t+e.toLowerCase();if(window?.crypto?.subtle){const e=(new TextEncoder).encode(s),t=await window.crypto.subtle.digest("SHA-256",e);return n+Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}return n+CryptoJS.SHA256(s).toString()}}};

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.