1import{n as X,i as fe,l as S,p as h,J as Le,ab as xe,r as Re,c as Z,H as ve,ac as q,w as v,P as A,ad as Ve,E as Q,b as I,L as Fe,M as k,ae as Ge,a1 as ee,g as _,q as Ye,A as ue,e as de,a7 as He,O as Be,m as qe,a as ze,af as Je,ag as We,u as G,f as te}from"./WEbFRKiA.js";import{U as Ke,W as x,X as ne,A as Xe,z as ge,Y as Ze,o as Qe,f as et,Z as tt,h as nt,_ as rt,$ as ot,l as pe,a0 as me,C as re,D as st,S as it,y as at}from"./nD01Mfmd.js";import{a as E,s as he}from"./BW4jDEoV.js";import{f as ct}from"./B54j9Xj4.js";import"./DikjsCuG.js";import"./CXzjbGTh.js";import"./xZ67Tfsh.js";import"./BrqVtR_Q.js";import"./CBI54uUg.js";import"./CccgUGka.js";const Y=new Map;function lt(e,r,t){if(t&&e){const o={};o.source=h(t.getSource)?t.getSource(e):t.source;const n=h(t.getValue)?t.getValue(e):e;if(fe(n)){const s={id:n,atype:t.atype};if(h(t.getUidExt)){const i=t.getUidExt(e);i&&(s.ext=i)}if(o.uids=[s],t.inserter||h(t.getInserter)){const i=h(t.getInserter)?t.getInserter(e):t.inserter;i!=null&&(o.inserter=i)}if(t.matcher||h(t.getMatcher)){const i=h(t.getMatcher)?t.getMatcher(e):t.matcher;i!=null&&(o.matcher=i)}if(t.mm!=null&&(o.mm=t.mm),h(t.getEidExt)){const i=t.getEidExt(e);i&&(o.ext=i)}return o}}return null}function ft(e,r=Y){const t={};function o(n){const s=JSON.stringify([n.source?.toLowerCase(),...Object.keys(n).filter(i=>!["uids","source"].includes(i)).sort().map(i=>n[i])]);t.hasOwnProperty(s)?t[s].uids.push(...n.uids):t[s]=n}return Object.entries(e).forEach(([n,s])=>{s=Array.isArray(s)?s:[s];const i=r.get(n);let a;if(n==="pubProvidedId")a=X(s);else if(typeof i=="function")try{a=X(i(s)),Array.isArray(a)||(a=[a]),a.forEach(c=>{c.uids=c.uids.filter(({id:l})=>fe(l))}),a=a.filter(({uids:c})=>c?.length>0)}catch(c){S(`Could not generate EID for "${n}"`,c)}else a=s.map(c=>lt(c,n,i));Array.isArray(a)&&a.filter(c=>c!=null).forEach(o)}),Object.values(t)}function N(e){const r=new Map,t={};return Object.entries(e).forEach(([o,n])=>{const s=n();if(s){t[o]=s.idObj[o];let i=s.submodule.eids?.[o];typeof i=="function"&&(i=(a=>(...c)=>a(...c,s.config))(i)),r.set(o,i)}}),ft(t,r)}const ut=Le("sync",()=>{}),y="User ID",C=it,U=st,oe="_pbjs_id_optout",j=Ke("userId"),ye={isAllowed:Je};let m=[],b,H=[],B={},w=[],dt,Se,z,O,V;const M=(()=>{let e;return()=>(e==null&&(e=ot()),e)})();function Ie(e){return M().fork().renameWith(r=>[`userId.mod.${r}`,`userId.mods.${e}.${r}`])}function Ee(e,r){r=r||e.storageMgr;const t=typeof e.submodule.domainOverride=="function"?e.submodule.domainOverride():null,o=e.config.storage.name;return function(s,i,a){r.setCookie(o+(s||""),i,a,"Lax",t)}}function gt(e,r,t){const o=e.config.storage,n=Ee(e);n(null,r,t),n("_cst",K(),t),typeof o.refreshInSeconds=="number"&&n("_last",new Date().toUTCString(),t)}function pt(e,r,t){const o=e.config.storage,n=e.storageMgr;n.setDataInLocalStorage(`${o.name}_exp`,t),n.setDataInLocalStorage(`${o.name}_cst`,K()),n.setDataInLocalStorage(o.name,encodeURIComponent(r)),typeof o.refreshInSeconds=="number"&&n.setDataInLocalStorage(`${o.name}_last`,new Date().toUTCString())}function be(e,r){const t=e.config.storage;try{const o=new Date(Date.now()+t.expires*864e5).toUTCString(),n=G(r)?JSON.stringify(r):r;e.enabledStorageTypes.forEach(s=>{switch(s){case C:gt(e,n,o);break;case U:pt(e,n,o);break}})}catch(o){S(o)}}const De=["","_last","_cst"];function mt(e){const r=Ee(e,j),t=new Date(Date.now()-1e3*60*60*24).toUTCString();De.forEach(o=>{try{r(o,"",t)}catch(n){S(n)}})}const Ae=["","_last","_exp","_cst"];function ht(e){Ae.forEach(r=>{try{j.removeDataFromLocalStorage(e.config.storage.name+r)}catch(t){S(t)}})}function yt(e){Me(e),e.enabledStorageTypes.forEach(r=>{switch(r){case C:mt(e);break;case U:ht(e);break}})}function St(e,r){return e.storageMgr.getCookie(r)}function It(e,r){const t=e.storageMgr,o=e.config.storage,n=t.getDataFromLocalStorage(`${o.name}_exp`);if(n==="")return t.getDataFromLocalStorage(r);if(n&&new Date(n).getTime()-Date.now()>0)return decodeURIComponent(t.getDataFromLocalStorage(r))}function L(e,r=void 0){const t=e.config.storage,o=r?`${t.name}_${r}`:t.name;let n;try{e.enabledStorageTypes.find(s=>{switch(s){case C:n=St(e,o);break;case U:n=It(e,o);break}return!!n}),typeof n=="string"&&n.trim().charAt(0)==="{"&&(n=JSON.parse(n))}catch(s){S(s)}return n}function se(e,r,t){r=M().fork().startTiming("userId.callbacks.total").stopBefore(r);const o=We(()=>{clearTimeout(dt),r()},e.length);e.forEach(function(n){const s=Ie(n.submodule.name).startTiming("callback").stopBefore(o);function i(a){a?(n.config.storage&&be(n,a),n.idObj=n.submodule.decode(a,n.config),t.refresh(),Ce(t)):I(`${y}: ${n.submodule.name} - request id responded with an empty value`),s()}try{n.callback(i,L.bind(null,n))}catch(a){S(`Error in userID module '${n.submodule.name}':`,a),s()}n.callback=void 0})}function Et(e){return Object.fromEntries(Object.entries(e).map(([r,t])=>[r,t()?.idObj?.[r]]).filter(([r,t])=>t!=null))}function bt(e){if(e.primaryIds)return e.primaryIds;const r=Object.keys(e.eids??{});if(r.length>1)throw new Error(`ID submodule ${e.name} can provide multiple IDs, but does not specify 'primaryIds'`);return r}function Oe(e,r,t){const o={};return e.forEach(n=>{const s=t(n),i=bt(s);
1r(n).forEach(a=>{const c=o[a]=o[a]??[],l=B[a]?.indexOf(s.name)??(i.includes(a)?0:-1),p=c.findIndex(([f])=>f<l);c.splice(p===-1?c.length:p,0,[l,n])})}),Object.fromEntries(Object.entries(o).map(([n,s])=>[n,s.map(([i,a])=>a)]))}function Dt(){const e={submodules:[],global:{},bidder:{},combined:{},refresh(t=[]){const o=new Set(t.map(n=>n.submodule));e.submodules=e.submodules.filter(n=>!o.has(n.submodule)).concat(t),r()},reset(){e.submodules=[],r()}};function r(){const t=Oe(e.submodules,a=>Object.keys(a.idObj??{}),a=>a.submodule),o={},n={};function s(a,c,l){return function(){for(const{allowed:p,bidders:f,module:d}of l){if(!ye.isAllowed(pe,me(k,d?.config?.name,{init:!1})))continue;if(d.idObj?.[a]!=null){if(p)return d;if(c){const g=P=>P.map(D=>D.module.submodule.name).join(", ");return _(`userID modules ${g(l)} provide the same ID ('${a}'); ${d.submodule.name} is the preferred source, but it's configured only for some bidders, unlike ${g(l.filter(P=>P.bidders==null))}. Other bidders will not see the "${a}" ID.`),null}else if(f==null)return null}}return null}}Object.entries(t).forEach(([a,c])=>{let l=!0;const p=new Set;c=c.map(f=>{let d=null;return Array.isArray(f.config.bidders)&&f.config.bidders.length>0?(d=f.config.bidders,d.forEach(u=>p.add(u))):l=!1,{module:f,bidders:d}}),l||(o[a]=s(a,!0,c.map(({bidders:f,module:d})=>({allowed:f==null,bidders:f,module:d})))),p.forEach(f=>{n[f]=n[f]??{},n[f][a]=s(a,!1,c.map(({bidders:d,module:u})=>({allowed:d?.includes(f),bidders:d,module:u})))})});const i=Object.values(n).concat([o]).reduce((a,c)=>Object.assign(a,c),{});Object.assign(e,{global:o,bidder:n,combined:i})}return e}function At(e){const{global:r,bidder:t}=e,{global:o,bidder:n}=b,s=N(o);return s.length>0&&te(r,"user.ext.eids",(r.user?.ext?.eids??[]).concat(s)),Object.entries(n).forEach(([i,a])=>{const c=N(a);c.length>0&&te(t,`${i}.user.ext.eids`,(t[i]?.user?.ext?.eids??[]).concat(c))}),e}function Ot({ortb2Fragments:e}){e=e??{global:{},bidder:{}},At(e)}const Te={};function Tt({mkDelay:e=q}={}){const r=v(),t=v();let o,n=!1,s=!1,i;function a(u){return i=M().fork(),o?.reject(Te),o=v(),A.race([u,o.promise]).finally(i.startTiming("userId.total"))}const c=b,l=m;function p(u){return function(...g){if(c===b&&l===m)return u(...g)}}function f(){return x.promise.finally(i.startTiming("userId.init.consent"))}let d=a(A.all([Ve,r.promise]).then(f).then(p(()=>{s=!0,ce(c,l)})).then(()=>t.promise.finally(i.startTiming("userId.callbacks.pending"))).then(p(()=>{const u=c.submodules.filter(g=>h(g.callback));if(u.length)return new A(g=>se(u,g,c))})));return function({refresh:u=!1,submoduleNames:g=null,ready:P=!1}={}){return P&&!n&&(n=!0,r.resolve(),z>0?t.resolve():Qe(Q.AUCTION_END,function D(){et(Q.AUCTION_END,D),e(Se).then(t.resolve)})),u&&s&&(d=a(d.catch(()=>null).then(f).then(p(()=>{const D=ce(c,l.filter($=>g==null||g.includes($.submodule.name)),!0).filter($=>$.callback!=null);if(D.length)return new A($=>se(D,$,c))})))),d}}let T;function we(e=J()||[]){const r=O&&e.find(t=>t.source===O);if(r&&typeof r?.uids?.[0]?.id=="string"){const t=r.uids[0].id.replace(/[\W_]/g,"");if(/^[0-9a-zA-Z+.=/_\-$,{}]{22,150}$/.test(t))return t;_(`User ID - Googletag Publisher Provided ID for ${O} doesn't match the PPID requirements - ${t}`)}}const _e=nt("userId",function(r,t,{mkDelay:o=q,getIds:n=W}={}){A.race([n().catch(()=>null),o(z)]).then(()=>{Ot(t),M().join(rt(t.metrics),{propagate:!1,includeGroups:!0}),r.call(this,t)})});function wt(e,r){r.forEach(t=>{t.bids.forEach(o=>Object.defineProperty(o,"userIdAsEids",{configurable:!0,get(){return t.ortb2.user?.ext?.eids??[]}}))}),e(r)}function _t(e,r){const t={},o=r.getFPD()?.global?.user?.ext?.eids??[];function n(s){return s==null?o:(t.hasOwnProperty(s)||(t[s]=qe({eids:[]},{eids:o},{eids:r.getFPD()?.bidder?.[s]?.user?.ext?.eids??[]}).eids),t[s])}r.getAdUnits().flatMap(s=>s.bids).forEach(s=>{const i=n(s.bidder);i.length>0&&(s.userIdAsEids=i)}),e(r)}function Pt(){return!!he.getHooks({hook:_e}).length}function Pe(){return Et(b.combined)}function J(){return N(b.combined)}function $e(e){return J().filter(r=>r.source===e)[0]}function ke(e,r,t){return R().then(()=>{const o={};if(h(t)){I(`${y} - Getting encrypted signal from custom function : ${t.name} & source : ${e} `);const n=t(e);o[e]=n?ie(n):null}else{const n=$e(e);I(`${y} - Getting encrypted signal for eids :${JSON.stringify(n)}`),ze(n)||(o[n.source]=r===!0?ie(n):n.uids[0].id)}return I(`${y} - Fetching encrypted eids: ${o[e]}`),o[e]})}function ie(e,r=1){let t="";return r===1&&(t=typeof e=="object"?window.btoa(JSON.stringify(e)):window.btoa(e)),`${r}||${t}`}function $t(){if(!ue())return;const e=de.getConfig("userSync.encryptedSignalSources");if(e){const r=e.registerDelay||0;setTimeout(()=>
1{e.sources&&e.sources.forEach(({source:t,encrypt:o,customFunc:n})=>{t.forEach(s=>{window.googletag.secureSignalProviders.push({id:s,collectorFunction:()=>ke(s,o,n)})})})},r)}else _(`${y} - ESP : encryptedSignalSources config not defined under userSync Object`)}function R(e){const r=T(e);return r.then(()=>T()===r?Pe():R(),t=>t===Te?Promise.resolve().then(W):(S("Error initializing userId",t),A.reject(t)))}function ae({submoduleNames:e}={},r){return R({refresh:!0,submoduleNames:e}).then(t=>(r&&h(r)&&r(),t))}function W(){return R()}function K(){let e=Number(x.hash);const r=[];for(;e>0;)r.push(String.fromCharCode(e&255)),e=e>>>8;return btoa(r.join(""))}function kt(e){const r=L(e,"cst");return!r||r!==K()}function Ct(e,r){const t=x.getConsentData();if(e.config.storage){let o=L(e),n,s=!1;if(typeof e.config.storage.refreshInSeconds=="number"){const i=new Date(L(e,"last"));s=i&&Date.now()-i.getTime()>e.config.storage.refreshInSeconds*1e3}if(!o||s||r||kt(e)){const i=Object.assign({enabledStorageTypes:e.enabledStorageTypes},e.config);n=e.submodule.getId(i,t,o)}else typeof e.submodule.extendId=="function"&&(n=e.submodule.extendId(e.config,t,o));G(n)&&(n.id&&(be(e,n.id),o=n.id),typeof n.callback=="function"&&(e.callback=n.callback)),o&&(e.idObj=e.submodule.decode(o,e.config))}else if(e.config.value)e.idObj=e.config.value;else{const o=e.submodule.getId(e.config,t);G(o)&&(typeof o.callback=="function"&&(e.callback=o.callback),o.id&&(e.idObj=e.submodule.decode(o.id,e.config)))}}function Ce(e){const r=N(e.combined);if(r.length&&O){const t=we(r);t&&(ue()?window.googletag.pubads().setPublisherProvidedId(t):(window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[],window.googletag.cmd.push(function(){window.googletag.pubads().setPublisherProvidedId(t)})))}}function Ut(){return j.getDataFromLocalStorage(oe)?(I(`${y} - opt-out localStorage found, userId disabled`),!0):j.getCookie(oe)?(I(`${y} - opt-out cookie found, userId disabled`),!0):!1}function ce(e,r,t=!1){return M().fork().measureTime("userId.init.modules",function(){if(Ut())return e.reset(),[];if(!r.length)return[];if(r.forEach(n=>Me(n)),r=r.filter(n=>(!n.config.storage||Rt(n))&&ye.isAllowed(pe,me(k,n.config.name))),!r.length)return _(`${y} - no ID module configured`),[];const o=r.reduce((n,s)=>Ie(s.submodule.name).measureTime("init",()=>{try{Ct(s,t),n.push(s)}catch(i){S(`Error in userID module '${s.submodule.name}':`,i)}return n}),[]);return e.refresh(o),Ce(e),o})}function Ue(e){return e?.storage?.type?.trim().split(/\s*&\s*/)||[]}function Mt(e){return Ue(e).every(t=>jt.has(t))}function Nt(e){function r(t,...o){_(`Invalid userSync.userId config: ${t}`,...o)}return Array.isArray(e)?e.filter(t=>{if(t?.name){if(t.storage){if(!t.storage.name||!t.storage.type)return r('must specify "storage.name" and "storage.type"',t);if(!Mt(t))return r('invalid "storage.type"',t);["expires","refreshInSeconds"].forEach(o=>{let n=t.storage[o];n!=null&&typeof n!="number"&&(n=Number(n),isNaN(n)?(r(`storage.${o} must be a number and will be ignored`,t),delete t.storage[o]):t.storage[o]=n)})}}else return r('must specify "name"',t);return!0}):(e!=null&&r("must be an array",e),[])}const jt=new Set([U,C]);function Lt(e){return!!e.storageMgr.localStorageIsEnabled()}function xt(e){return!!e.storageMgr.cookiesAreEnabled()}const le=[1,2,3,4,7];function Me(e){if(e.enabledStorageTypes)return;const r=Ue(e.config);e.enabledStorageTypes=r.filter(t=>{switch(t){case U:return Ae.forEach(o=>{re("userId",{type:"web",identifier:e.config.storage.name+o,purposes:le})}),Lt(e);case C:return De.forEach(o=>{re("userId",{type:"cookie",identifier:e.config.storage.name+o,purposes:le,maxAgeSeconds:(e.config.storage.expires??0)*24*60*60,cookieRefresh:!0})}),xt(e)}return!1})}function Rt(e){return!!e.enabledStorageTypes.length}function Ne(e){Y.clear(),Object.entries(Oe(e,r=>Object.keys(r.eids||{}),r=>r)).forEach(([r,t])=>Y.set(r,t[0].eids[r]))}function vt(e,r,t=m,o=w){const{autoRefresh:n,retainConfig:s}=e;return o.reduce((i,a)=>{const{name:c,aliasName:l}=a,p=u=>[c,l].some(g=>g?.toLowerCase()===u.toLowerCase()),f=r.find(u=>p(u.name));if(!f){if(!s)return i;const u=t.find(g=>p(g.config.name));return u?[...i,u]:i}const d={submodule:a,config:{...f,name:a.name}
1,callback:void 0,idObj:void 0,storageMgr:tt({moduleType:k,moduleName:f.name,advertiseKeys:!1})};if(n){const u=t.find(g=>p(g.config.name));d.refreshIds=!u||!He(d.config,u.config)}return[...i,d]},[])}function je(e={}){Ne(w);const r=Nt(H);if(!r.length)return;const t=vt(e,r);m.splice(0,m.length),m.push(...t),m.length&&(Pt()||(he.before(_e,100),ge.callDataDeletionRequest.before(Ft),ut.after(o=>o(we()))),I(`${y} - usersync config updated for ${m.length} submodules: `,m.map(o=>o.submodule.name)))}function Vt(e,r){if(e){const t={},o=new Map(r.map(n=>n.aliasName?[n.aliasName,n.name]:[]));Object.keys(e).forEach(n=>{const s=Ye(e[n])?[...e[n]].reverse():[];t[n]=s.map(i=>o.has(i)?o.get(i):i)}),B=t}else B={};b.refresh(),Ne(r)}function Ft(e,...r){I("UserID: received data deletion request; deleting all stored IDs..."),m.forEach(t=>{if(typeof t.submodule.onDataDeletionRequest=="function")try{t.submodule.onDataDeletionRequest(t.config,t.idObj,...r)}catch(o){S(`Error calling onDataDeletionRequest for ID submodule ${t.submodule.name}`,o)}yt(t)}),e.apply(this,r)}function Gt(e){e.findRootDomain=ct,(w||[]).find(r=>r.name===e.name)||(w.push(e),at.register(k,e.name,e.gvlid),je(),T({refresh:!0,submoduleNames:[e.name]}))}function F(e){return function(...r){return Promise.resolve(e.apply(this,r))}}const Yt=(e,r)=>t=>{if(t[Fe]!==k||!t[Ge])return;const o=s=>t[Be]?.toLowerCase()===s?.toLowerCase(),n=e.find(s=>o(s.name));if(!(!n||!n.storage)&&t[ee]!==n.storage.type){const s=`${n.name} attempts to store data in ${t[ee]} while configuration allows ${n.storage.type}.`;if(r)return{allow:!1,reason:s};_(s)}};function Ht(e,{mkDelay:r=q}={}){O=void 0,m=[],H=[],b=Dt(),T=Tt({mkDelay:r}),x.onChange(()=>{T({refresh:!0})}),V?.(),w=[];let t;V=e.getConfig("userSync",o=>{const n=o.userSync;if(n&&(O=n.ppid,n.userIds)){const{autoRefresh:s=!1,retainConfig:i=!0,enforceStorageType:a}=n;H=n.userIds,Se=Z(n.syncDelay)?n.syncDelay:ne.syncDelay,z=Z(n.auctionDelay)?n.auctionDelay:ne.auctionDelay,je({retainConfig:i,autoRefresh:s}),t?.(),t=ve(Xe,"enforceStorageTypeRule",Yt(m.map(({config:l})=>l),a)),Vt(n.idPriority,w),T({ready:!0});const c=m.filter(l=>l.refreshIds);c.length&&ae({submoduleNames:c.map(l=>l.submodule.name)})}}),ge.makeBidRequests.after(wt),Ze.before(_t),E("getUserIds",Pe),E("getUserIdsAsEids",J),E("getEncryptedEidsForSource",F(ke)),E("registerSignalSources",$t),E("refreshUserIds",F(ae)),E("getUserIdsAsync",F(W)),E("getUserIdsAsEidBySource",$e)}Ht(de);xe("userId",Gt,{postInstallAllowed:!0});Re("userId");
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.