try{const t=new URL(location.href).searchParams.get("_jp1m_param"),e=atob(t||""),r=JSON.parse(e||"{}");for(const t in r){const e="jp1_ad_ccv_"+t,o={expires:r[t].expires,key:r[t].key},n=new Date(1e3*r[t].expires);document.cookie=`${e}=${JSON.stringify(o)};expires=${n.toUTCString()};path=/;`}}catch(t){console.error("[jp1-ad]",t)}try{const t="https://server.jp1media.com",e=document.currentScript,r=(()=>{const t=new URL(e.src);return new URLSearchParams(t.search).get("adv")||e.getAttribute("data-adv")})(),o=(()=>{let t=null;try{"undefined"!=typeof window&&window.location.href&&(t=window.location.href,t.length>1500&&(t=t.substring(0,1500)))}catch(t){}return t})();window.AX_AD_DMP=(()=>{const n=1023533,c=()=>{const e=JSON.stringify(i()),c=btoa(e).replace(/=/g,""),s=r?`&advertiser_id=${r}`:"",a=(()=>{try{if(/(?:^|;\s*)_im_vid=optout(?:;|$)/.test(document.cookie))return"";if(window.__GAM_IMUID)return String(window.__GAM_IMUID);const t=window.localStorage&&localStorage.getItem("_im_uid."+n);return t?String(t):""}catch(t){return""}})(),d=a?`&imuid=${encodeURIComponent(a)}`:"";o&&p(`${t}/dmp?url=${encodeURIComponent(o)}${s}&ccv_data=${c}${d}`)},i=()=>{const t={},e=document.cookie.split("; ");for(let r=0;r{if(t){(()=>{const t=document.cookie.split("; ");for(let e=0;e{if(!t)return;const e=new Date(Date.now()+0);for(const r in t){const o=btoa(JSON.stringify(t[r]));d("jp1_ad_freq_ccv_"+r,o,e.toUTCString())}},p=t=>{const r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("async","true"),r.setAttribute("src",t),e.after(r)},d=(t,e,r)=>{document.cookie=`${t}=${e};expires=${r};path=/;`};return{init:()=>{(()=>{const t=new URL(location.href).searchParams.get("_jp1m_param"),e=atob(t||""),r=JSON.parse(e||"{}");for(const t in r){const e="jp1_ad_ccv_"+t,o={expires:r[t].expires,key:r[t].key},n=new Date(1e3*r[t].expires);document.cookie=`${e}=${JSON.stringify(o)};expires=${n.toUTCString()};path=/;`}})(),(()=>{try{const t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("async","true"),t.setAttribute("src","https://dmp.im-apps.net/sdk/im-uid.js"),e.after(t)}catch(t){}})(),(()=>{try{window.IMUIDRequest=window.IMUIDRequest||[],window.IMUIDRequest.push({customerId:n,callback:t=>{t&&!0!==t.optouted&&t.uid&&(window.__GAM_IMUID=String(t.uid))},callbackTimeout:2e3})}catch(t){}})(),c()},responseCcvCookie:t=>{s(t.preserve),a(t.freq_ccv)},responseDmp:t=>{(t=>{if(t)for(const e of t){const t=document.createElement("iframe");t.setAttribute("style","display:none !important;visibility:hidden !important;width:0px !important;height:0px !important;"),t.setAttribute("src",e),document.body.append(t),t.addEventListener("load",function(){t.remove()})}})(t.sync_urls),s(t.ccv_cookie_data?.preserve),a(t.ccv_cookie_data?.freq_ccv)}}})(),window.AX_AD_DMP.init()}catch(t){console.error("[jp1-ad]",t)}