1( function () { 2 'use strict'; 3 4 // Set order attribution on consent change. 5 document.addEventListener( 'wp_listen_for_consent_change', ( e ) => { 6 const changedConsentCategory = e.detail; 7 for ( const key in changedConsentCategory ) { 8 if ( changedConsentCategory.hasOwnProperty( key ) && key === window.wc_order_attribution.params.consentCategory ) { 9 window.wc_order_attribution.setOrderTracking( changedConsentCategory[ key ] === 'allow' ); 10 } 11 } 12 } ); 13 14 // Set order attribution as soon as consent type is defined. 15 document.addEventListener( 'wp_consent_type_defined', () => { 16 window.wc_order_attribution.setOrderTracking( wp_has_consent( window.wc_order_attribution.params.consentCategory ) ); 17 } ); 18}() ); 19
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.