File "order-attribution.min.js"
Full Path: /home/jlklyejr/public_html/wp-content-20241030122153/plugins/woocommerce/assets/js/frontend/order-attribution.min.js
File size: 1.47 KB
MIME-type: text/plain
Charset: utf-8
!function(n){"use strict";const t=n.params,o=document.querySelector.bind(document),e=(n,t)=>t.split(".").reduce((n,t)=>n&&n[t],n),i=()=>null,c="wc/store/checkout";function s(){const o=t.allowTracking?e:i,c=Object.entries(n.fields).map(([n,t])=>[n,o(sbjs.get,t)]);return Object.fromEntries(c)}function a(e){if(o(`input[name^="${t.prefix}"]`))for(const i of Object.keys(n.fields))o(`input[name="${t.prefix}${i}"]`).value=e&&e[i]||""}function d(n){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).__internalSetExtensionData("woocommerce/order-attribution",n,!0)}if(n.setOrderTracking=function(n){t.allowTracking=n,n?sbjs.init({lifetime:Number(t.lifetime),session_length:Number(t.session),timezone_offset:"0"}):function(){const n=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(t=>{document.cookie=`${t}=; path=/; max-age=-999; domain=.${n};`})}();const o=s();a(o),d(o)},n.setOrderTracking(t.allowTracking),null!==o("form.woocommerce-checkout")){const n=document.body.oninit_checkout;document.body.oninit_checkout=(()=>{a(s()),n&&n()})}function r(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const n=window.wp.data.subscribe(function(){n(),d(s())},c)}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r()}(window.wc_order_attribution);