PageSourceSearch

https://www.d2l.com/wp-content/themes/bigdrop-theme/dist/chunks/geo-target.0-_zSf2wZm.min.js

js d2l.com collected 2026-09-24 08:43:07 UTC 2,697 bytes, 1 lines download raw bytes

1import{a as n,s as d}from"../js/global.BTePb3dLqj.min.js";function k(){const{ajaxvars:y={}}=window,{ajaxurl:i="",geo_target_nonce_token:s=""}=y,_=document.getElementById("pardot-form"),u=new CustomEvent("load_marketing_form",{detail:{formEl:_}});!sessionStorage.getItem("country")&&i&&s?fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`action=geo_target&_ajax_nonce=${s}`}).then(e=>e.json()).then(e=>{const{country:o={iso_code:""},region:r={name:""}}=e,{iso_code:t=""}=o,{name:c=""}=r,m="d2l.com";let f=location.hostname.indexOf(m)===-1?location.hostname:m;sessionStorage.setItem("country",t),n.set("country",t,{path:"/",domain:f}),c!==null&&c!=="Undefined"&&(sessionStorage.setItem("region",c),n.set("region",c,{path:"/",domain:f}))}).finally(()=>{console.log("load form event dispatched 1"),document.dispatchEvent(u)}):(console.log("load form event dispatched 2"),document.dispatchEvent(u));const a=document.querySelector("dialog#regional-popup");if(!a||typeof sessionStorage.getItem("hideRegionalPopup")=="string"||n.get("preferred-country")===a.dataset.preferredCountry||document.querySelector("body.logged-in"))return;let l=sessionStorage.getItem("preferred-country");typeof n.get("preferred-country")=="string"&&n.get("preferred-country")!==""&&(l=n.get("preferred-country"));const g=a.querySelector("#accept-button"),h=g.dataset.preferredCountry,p=g.href;if(l===h){d({event:"regional_popup",promo_type:"region popup",promo_status:"interacted",interaction_type:"redirected",promoted_page:p}),window.location.href=p;return}typeof a.showModal=="function"&&a.showModal(),d({event:"regional_popup",promo_type:"region popup",promo_status:"displayed",promoted_page:p}),document.querySelector("#regional-popup a.btn").addEventListener("click",e=>{let o="";const r=document.querySelector("#toggle-preferred-language"),t=e.target;r.checked&&(n.set("preferred-country",t.dataset.preferredCountry,{expires:7}),o="-preferred"),d({event:"regional_popup",promo_type:"region popup",promo_status:"interacted",interaction_type:`accepted${o}`,promoted_page:p})}),document.querySelectorAll("dialog#regional-popup button").forEach(e=>{e.addEventListener("click",o=>{o.preventDefault();const r=o.target,t=document.querySelector("dialog#regional-popup");t.close(),v(r.value,t.dataset.preferredCountry)})});function v(e,o){let r="";const t=document.querySelector("#toggle-preferred-language");sessionStorage.setItem("hideRegionalPopup","true"),t.checked&&e==="interacted"&&(n.set("preferred-country",o,{expires:7}),r="-preferred"),d({event:"regional_popup",promo_type:"region popup",promo_status:e,interaction_type:`declined${r}`,promoted_page:p})}}export{k as geoTarget};

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.