PageSourceSearch

https://www1.ru/build/assets/AdvManager-CjOw2rz9.js

js www1.ru collected 2026-10-02 04:35:34 UTC 50,611 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t}from"./vendor-react-Bjt1MqdS.js";import{B as n,C as r,S as i,x as a}from"./VideoPlayerMarker-BpJdS2ls.js";var o=e(t(),1),s=1024;function c(e){return e>=1024?`desktop`:e>=780?`tablet`:`phone`}function l(e,t){return e.reduce((e,n)=>n<=t&&n>e?n:e,0)}var u=`desktop`;function d(e,t){return e?`desktop`:t?`tablet`:`phone`}function f(){return typeof window>`u`?u:typeof window.matchMedia==`function`?d(window.matchMedia(`(min-width: ${s}px)`).matches,window.matchMedia(`(min-width: 780px)`).matches):c(window.innerWidth||document.documentElement.clientWidth||0)}function p(){return f()}var m=u,h=null,g=null,_=new Set;function v(){let e=f();e!==m&&(m=e,_.forEach(e=>e()))}function y(){h||typeof window>`u`||typeof window.matchMedia!=`function`||(h=window.matchMedia(`(min-width: ${s}px)`),g=window.matchMedia(`(min-width: 780px)`),m=d(h.matches,g.matches),h.addEventListener(`change`,v),g.addEventListener(`change`,v))}function ee(e){return y(),_.add(e),()=>{_.delete(e)}}function te(){return y(),m}function ne(){return typeof window>`u`?u:te()}function re(){return(0,o.useSyncExternalStore)(ee,te,ne)}var ie=[`phone`],ae=[`desktop`],oe=[`tablet`,`desktop`],se=[`phone`,`tablet`];function ce(e){switch(e){case`mobile`:case`indexm`:case`floor`:return ie;case`sidebar`:case`sidebartgb`:case`sidebar-button`:case`indexv`:return ae;case`desktop`:case`indexh`:return oe;case`mobile-button`:return se;default:return null}}function b(e,t){let n=ce(e);return n===null||n.includes(t)}var le=new Set([`horizontal`,`mobile`,`desktop`,`sidebar`]);function x(e){return le.has(e)}function S(e){return(e??[]).filter(e=>Array.isArray(e))}var ue=`[data-vads-ui-element="close"]`,de=`[data-vads-ui-element="adsContainer"]`,fe=1e3,pe=3e3,me=40;function he({zoneId:e,restartDelayMs:t,maxRestarts:n=1}){if(typeof window>`u`)return()=>{};let r=!1,i=!1,a=0,o=null,s=null,c=e=>{let t=e.target;t instanceof Element&&t.closest(ue)&&(i=!0)},l=()=>{s!==null&&(window.clearInterval(s),s=null)};function u(){l();let e=!1,t=null;s=window.setInterval(()=>{if(r||i){l();return}if(f()){e=!0,t=null;return}e&&(t??=Date.now(),Date.now()-t>=pe&&(l(),d()))},fe)}function d(){r||i||o!==null||a>=n||(l(),o=window.setTimeout(()=>{o=null,a+=1,p()},t))}function f(){let e=document.querySelector(de);if(!(e instanceof HTMLElement))return!1;let t=window.getComputedStyle(e);return t.display===`none`||t.visibility===`hidden`?!1:e.getBoundingClientRect().height>me}function p(){r||i||ge(t=>{if(r||i)return;let n=window.vadsLoaderCfg?.[e];n&&(n.restartOnClose=0,n.closeSingleTimer=!0),t.run([{zoneId:e,onComplete:d}]),u()})}return document.addEventListener(`click`,c,!0),p(),()=>{r=!0,l(),o!==null&&(window.clearTimeout(o),o=null),document.removeEventListener(`click`,c,!0)}}function ge(e){let t=window.vadsLoader;if(typeof t?.run==`function`){e(t);return}window.vadsLoaderQueue=window.vadsLoaderQueue??[],window.vadsLoaderQueue.push(()=>{let t=window.vadsLoader;typeof t?.run==`function`&&e(t)})}function C({thresholdPx:e,minDelayMs:t,onReady:n}){if(typeof window>`u`)return()=>{};let r=Math.max(0,e),i=Date.now()+Math.max(0,t),a=!0,o=null;function s(){l()}let c=()=>{a=!1,o!==null&&(window.clearTimeout(o),o=null),window.removeEventListener(`scroll`,s,!1)};function l(){if(!a||window.scrollY<r)return;let e=i-Date.now();if(e>0){o??=window.setTimeout(()=>{o=null,l()},e);return}c(),n()}return window.addEventListener(`scroll`,s,{passive:!0,capture:!1}),window.scrollY>=r&&l(),c}var _e=100;function ve(e){return`${e.type}:${e.order}`}function ye(e,t,n){if(!e.breakpoints)return e;let r=e.breakpoints.map(e=>{let r=t?.breakpoints?.find(({minWidth:t})=>t===e.minWidth)?.config,i={...e.config,...r??{}};return i.sizes=e.config.sizes,i.containerWidth=e.config.containerWidth,i.containerHeight=e.config.containerHeight,i.containerMinHeight=e.config.containerMinHeight,i.containerMaxHeight=e.config.containerMaxHeight,n>1&&r!==void 0&&!(`refresh`in r)&&delete i.refresh,(n>1||t!==void 0)&&(i.adfoxTargeting={...e.config.adfoxTargeting??{},...r?.adfoxTargeting??{},puid7:n}),{...e,config:i}});return{...e,breakpoints:r}}function be(e){let t=typeof e==`number`?e:Number(e??_e);return Number.isFinite(t)?Math.max(0,Math.trunc(t)):_e}function xe(e){let t=new URLSearchParams(e.startsWith(`?`)?e.slice(1):e).get(`split`)??``;if(t===``)return{};let n={};for(let e of t.split(`,`)){let t=e.trim().split(`:`);
1if(t.length!==3)continue;let[r,i,a]=t;r===``||!/^\d+$/.test(i)||!/^\d+$/.test(a)||Number(a)<1||(n[`${r}:${Number(i)}`]=Number(a))}return n}function Se(e,t,n){let r=e.length;if(n!==void 0&&n>=1&&n<=r)return n;let i=e.reduce((e,t)=>e+t,0);if(i<=0)return 1;let a=i/100*t,o=0;for(let t=0;t<r;t+=1)if(o+=e[t],a<=o)return t+1;return r}function Ce(e,t,n,r){return e.map(e=>{let i=ve(e),a=t?.[i];if(!a||a.length<2)return e;let o=Se(a.map(e=>be(e.weight)),n,r[i]),s=a[o-1]??{};if(e.breakpoints)return ye(e,s,o);let c={...e,...s};delete c.weight,o>1&&!(`refresh`in s)&&delete c.refresh;let l={...c.adfoxTargeting??{},puid7:o};return{...c,adfoxTargeting:l}})}function w(e,t){let n=`-bp${t}`;return`${e.replace(/-bp\d+$/,``)}${n}`}function we(e,t){if(!e.breakpoints?.length)return e;let n=l(e.breakpoints.map(({minWidth:e})=>e),t);return e.breakpoints.find(({minWidth:e})=>e===n)??e.breakpoints[0]??e}function Te(e){return e===`horizontal`||e===`sidebar`}function Ee(){return typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 1024px)`).matches?`desktop`:window.matchMedia(`(min-width: 780px)`).matches?`tablet`:`phone`:c(window.innerWidth||document.documentElement.clientWidth||0)}var De=`https://yandex.ru/ads/system/header-bidding.js`,T=`https://yandex.ru/ads/system/context.js`,E=`X-Page-Visit-ID`,D=new Map,O=new Map,k=new Map,Oe=6e4,ke=128,A=!1,j=!1;function M(){return j}function Ae(e){let t=Object.prototype.hasOwnProperty.call(e,`http`)?e.http:void 0,n=Object.prototype.hasOwnProperty.call(e,`router`)?e.router:void 0;if(typeof window>`u`||A||!t||!n)return;A=!0;let r=t.getClient(),i=new URL(window.location.href),a=e.navigateDocument??(e=>{e.href===window.location.href?window.location.reload():window.location.assign(e.href)});n.on(`before`,e=>{let t=e.detail.visit;if(t&&Me(t)){if(j)return!1;if(N()&&t.method.toLowerCase()===`get`&&!t.prefetch&&!t.only?.length&&!t.except?.length&&F(t.url,t.method)!==F(new URL(window.location.href),t.method))return j=!0,a(t.url),!1;t.headers={...t.headers,[E]:t.id}}}),window.addEventListener(`pageshow`,e=>{e.persisted&&(j=!1)}),window.addEventListener(`resize`,()=>{if(j||!je())return;let e=window.__advEarlyHbPayload,t=window.__advEarlySplit?.breakpoint;if(!e||t===void 0)return;let n=window.innerWidth||document.documentElement.clientWidth;Math.max(0,...(e.zones[Ee()]??[]).map(e=>we(e,n).minWidth??0))!==t&&(j=!0,a(new URL(window.location.href)))}),window.addEventListener(`popstate`,e=>{let t=new URL(window.location.href);!j&&N()&&F(t,`get`)!==F(i,`get`)&&(e.stopImmediatePropagation(),j=!0,a(t))},!0),n.on(`start`,e=>{let t=e.detail.visit;t&&Me(t)&&(D.set(t.id,{id:t.id,prefetch:t.prefetch,url:t.url,method:t.method}),t.headers={...t.headers,[E]:t.id})}),t.onRequest(e=>{if(!Ne(e))return e;let t=window.__pageRuntime;return{...e,headers:{...e.headers,...t?.provider?{"X-Page-Runtime":t.provider}:{}}}}),t.setClient({request:async e=>{let t=Pe(e),n=await r.request(Ie(e)),i=t?Le(t,n):null;return t&&i&&!Be(t.id)&&O.set(t.id,i),n}}),n.on(`success`,e=>{let t=e.detail.visitId;if(!t)return;let n=O.get(t);O.delete(t),k.delete(t),n&&Re(n.provider,n.country)}),n.on(`error`,e=>{let t=e.detail.visitId;t&&(O.delete(t),Fe(t))});let o=null;n.on(`navigate`,e=>{let t=e.detail.page?.url;if(typeof t!=`string`)return;let n=new URL(t,window.location.href),r=n.pathname+n.search,i=o!==null&&o!==r;
1o=r,i&&window.pbjs?.que?.push(()=>window.pbjs?.refreshPageViewId?.())}),n.on(`finish`,e=>{let t=e.detail.visit;if(!t)return;let n=t.id;O.delete(n),D.delete(n),(t.cancelled||t.interrupted)&&ze(n)})}function N(){return je()||P()&&document.querySelector(`script[src^="https://yandex.ru/ads/system/context.js"]`)!==null}function P(){return window.__pageRuntime?.provider===`adfox`}function je(){return P()&&!!window.YaHeaderBiddingSettings?.adUnits?.length}function Me(e){return e.url.origin===window.location.origin}function Ne(e){let t=new URL(e.url,window.location.href),n=e.headers??{};return t.origin===window.location.origin&&Object.keys(n).some(e=>e.toLowerCase()===`x-inertia`)}function Pe(e){if(!Ne(e))return null;let t=Ue(e.headers,E);if(!t)return null;let n=D.get(t);return!n||F(n.url,n.method)!==F(new URL(e.url,window.location.href),e.method)?(D.delete(t),null):(D.delete(t),n)}function Fe(e){D.delete(e)}function F(e,t){let n=new URL(e.href);return n.hash=``,`${t.toLowerCase()}:${n.origin}${n.pathname}${n.search}`}function Ie(e){let t={...e.headers};for(let e of Object.keys(t))e.toLowerCase()===E.toLowerCase()&&delete t[e];return{...e,headers:t}}function Le(e,t){if(e.prefetch||t.status!==200||!He(t.headers,`x-inertia`))return null;let n=I(t.headers,`x-page-runtime`),r=I(t.headers,`x-page-region`);return n!==`gpt`&&n!==`adfox`?null:{provider:n,country:r?.toUpperCase()??`XX`}}function Re(e,t){window.__pageRuntime={provider:e,country:t},window.__geo_country=t,window.is_gpt_geo=e===`gpt`,document.documentElement.dataset.pageRuntime=e,window.dispatchEvent(new CustomEvent(`page-runtime`))}function ze(e){for(Ve(),k.set(e,Date.now()+Oe);k.size>ke;){let e=k.keys().next().value;if(e===void 0)return;k.delete(e)}}function Be(e){return Ve(),k.has(e)}function Ve(){let e=Date.now();for(let[t,n]of k)n<=e&&k.delete(t)}function He(e,t){return Object.keys(e).some(e=>e.toLowerCase()===t)}function I(e,t){let n=Object.keys(e).find(e=>e.toLowerCase()===t);return(n?e[n]:void 0)?.trim()||void 0}function Ue(e,t){let n=Object.keys(e??{}).find(e=>e.toLowerCase()===t.toLowerCase()),r=n?e?.[n]:void 0;return typeof r==`string`&&r.trim()||void 0}function L(){return typeof window<`u`&&window.__consentState?.isEU===!0}function We(e){return L()?new Set(e??[]):null}function R(e,t){return t===null?[...e]:e.filter(e=>t.has(e.bidder))}function Ge(e,t){return t===null?e:Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))}var Ke=new Set([`indexm`,`indexh`,`indexv`,`menu`,`breadcrumbs`,`tgb`,`sidebartgb`]);function z(){return window.Ya}function qe(e,t,n){if(typeof window>`u`||M()||window.__pageRuntime?.provider===`gpt`)return;if(window.__advEarlyHb===!0&&window.YaHeaderBiddingSettings&&!H(e)){window.location.reload();return}Ze();let r=new Set,i=[],a=We(e.euAllowedBidders);for(let n of t){let t=e.places.find(e=>e.type===n.type&&e.order===n.order),o=n.type===`horizontal`?l((t?.breakpoints??[]).map(e=>e.minWidth),window.innerWidth):0,s=n.type===`horizontal`?n.breakpointIds?.[o]??w(n.containerId,o):n.containerId;if(!n.hbEligible||r.has(s)||!document.getElementById(s)&&!document.getElementById(n.containerId))continue;let c=et(t,o),u=R(c?.bids??[],a);if(!c||u.length===0||!Te(String(c.type))||!$e(c.type)||c.lazy!==!1)continue;let d=c.codeType;i.push({code:s,sizes:S(c.sizes),bids:u,...d?{codeType:d}:{}}),r.add(s)}let o=!!n&&(e.places??[]).some(e=>e.sendAnalytics===!0||e.breakpoints?.some(({config:e})=>e.sendAnalytics===!0));if(window.__advEarlyHb===!0&&window.YaHeaderBiddingSettings&&window.__advEarlyHbConsumed!==!0&&H(e))window.__advEarlyHbConsumed=!0,Je(i,o,n);else if(i.length>0){window.__advEarlyHb===!0&&(window.__advEarlyHbConsumed=!0);let t=window.YaHeaderBiddingSettings;t?(o&&(t.callbacks={onBidsReceived:e=>n?.trackHbBids(e)}),B(t,i)):window.YaHeaderBiddingSettings={biddersMap:Ge(e.biddersMap??{},a),biddersCpmAdjustmentMap:e.biddersCpmAdjustmentMap??{}
1,timeout:e.timeout??1e3,adUnits:i,...o?{callbacks:{onBidsReceived:e=>n?.trackHbBids(e)}}:{}};let r=R(e.syncPixels??[],a);r.length&&window.YaHeaderBiddingSettings&&(window.YaHeaderBiddingSettings.syncPixels=r)}Qe(n)}function Je(e,t,n){let r=window.YaHeaderBiddingSettings;if(!r)return;if(r.adUnits=r.adUnits.filter(e=>!Ye(e.code)),t){r.callbacks={onBidsReceived:e=>n?.trackHbBids(e)};let e=z()?.headerBidding?.getLastBidsReceived?.();Array.isArray(e)&&e.length>0&&n?.trackHbBids(e)}let i=r.adUnits.filter(e=>!Xe(e.code)).length;i>0&&n?.trackSdkError({script:`early-hb`,stage:`early-set-mismatch`,missing:i}),B(r,e)}function B(e,t){let n=new Set(e.adUnits.map(e=>e.code)),r=t.filter(e=>!n.has(e.code));r.length!==0&&(e.adUnits=[...e.adUnits,...r],z()?.headerBidding?.pushAdUnits?.(r.map(e=>({code:e.code,sizes:e.sizes??[],bids:e.bids,...e.codeType?{codeType:e.codeType}:{}}))))}function Ye(e){let t=e.match(/^ad-([^-]+)/)?.[1];return t!==void 0&&Ke.has(t)}function Xe(e){return document.getElementById(e)?!0:e.startsWith(`ad-horizontal-`)&&!!document.getElementById(w(e,0))}function Ze(){let e=window;e.Ya||={},window.yaContextCb||=[],e.Ya.adfoxCode||={},e.Ya.adfoxCode.hbCallbacks||=[]}function Qe(e){V(De,`header-bidding`,e),V(T,`context`,e)}function V(e,t,n){U(e,()=>{n?.trackSdkError({script:t,stage:`load-error`,attempt:1}),U(`${e}?r=1`,()=>{n?.trackSdkError({script:t,stage:`load-error`,attempt:2})})})}function $e(e){return e===`horizontal`||b(e,p())}function H(e){return(window.YaHeaderBiddingSettings?.adUnits??[]).every(({code:t})=>{let n=/^ad-horizontal-(\d+)-\d+-bp(\d+)$/.exec(t);if(!n)return!0;let r=e.places.find(e=>e.type===`horizontal`&&e.order===Number(n[1]));return r===void 0||Number(n[2])===l((r.breakpoints??[]).map(e=>e.minWidth),window.innerWidth)})}function U(e,t){if(document.querySelector(`script[src="${e}"]`))return;let n=document.createElement(`script`);n.src=e,n.async=!0,t&&(n.onerror=t),document.head.appendChild(n)}function et(e,t){if(!e||e.type!==`horizontal`||!e.breakpoints?.length)return e;let n=[...e.breakpoints].reverse().find(e=>e.minWidth<=t);return n?{...e,...n.config}:e}function tt(e){return e===`horizontal`||e===`sidebar`}var W=[],G=!1,K=new Set;function nt(){G||(G=!0,queueMicrotask(()=>{let e=W;W=[],G=!1;let t=e.filter(e=>e.isLive());t.length!==0&&z()?.adfoxCode?.hbCallbacks?.push(()=>{let e=t.filter(e=>e.isLive());if(e.length===0)return;let n=new Set((window.YaHeaderBiddingSettings?.adUnits??[]).map(e=>e.code)),r=e.filter(e=>!n.has(e.code)&&!K.has(e.code));if(r.length>0){r.forEach(e=>K.add(e.code));let e=L()?new Set(Object.keys(window.YaHeaderBiddingSettings?.biddersMap??{})):null;z()?.headerBidding?.pushAdUnits?.(r.map(t=>({code:t.code,sizes:t.sizes,bids:R(t.bids??[],e),...t.codeType?{codeType:t.codeType}:{}})))}e.forEach(e=>{window.yaContextCb?.push(()=>{e.isLive()&&e.createBanner()})})})}))}function rt(){return window.__consentState?.isEU===!0}function it(){return window.__consentState?.euCmpEnabled!==!1}function at(e){return!e||e.gdprApplies!==!0||typeof e.tcString!=`string`||e.tcString===``?!1:e.purpose?.consents?.[1]===!0}function ot(e,t){if(!rt()){t();return}let n=n=>{e.params[`gdpr-consent-flag`]=n,t()};if(!it()||typeof window.__tcfapi!=`function`){n(0);return}let r=!1,i=0,a=e=>{r||(r=!0,i!==0&&window.clearTimeout(i),n(e))};i=window.setTimeout(()=>a(0),1500);try{window.__tcfapi(`getTCData`,2,(e,t)=>{a(t===!0&&at(e)?1:0)})}catch{a(0)}}var q=class{adStats;destroyedContainers=new Set;handles=new Map;containerVersions=new Map;floorCleanups=new Map;constructor(e){this.adStats=e}prepareContainer(e){this.destroyedContainers.delete(e),this.containerVersions.set(e,(this.containerVersions.get(e)??0)+1)}createBanner({ownerId:e,containerId:t,place:n,targeting:r,useHeaderBidding:i,headerBiddingPremade:a,darkMode:o,stats:s}){if(n.type===`floor`){L()||this.renderFloor(t,n);return}let c=this.containerVersions.get(t)??0,l={ownerId:e,containerId:t,params:r,...s&&this.adStats?this.adStats.bannerCallbacks(s):{}};o&&(l.insertionCodeParams=n.type===`recommend`?{additionalClasses:[`dark`]}:{darkTheme:!0});let u=tt(n.type)&&b(n.type,p()),d=()=>{this.canCreate(t,c)&&ot(l,()=>{if(!this.canCreate(t,c))return;let e=z()?.adfoxCode?.create?.(l);e&&this.handles.set(t,e)})};if(i&&!a&&n.bids?.length&&u){W.push({code:t,sizes:S(n.sizes),bids:n.bids,codeType:n.codeType,isLive:()=>this.canCreate(t,c),createBanner:d}),nt();return}window.yaContextCb?.push(()=>{this.canCreate(t,c)&&d()})}hideBanner(e){return!this.floorCleanups.has(e)&&(z()?.adfoxCode?.hide?.(e),!0)}showBanner(e){z()?.adfoxCode?.show?.(e)}destroyBanner(e){this.destroyedContainers.add(e),this.containerVersions.set(e,(this.containerVersions.get(e)??0)+1);let t=this.floorCleanups.get(e);t&&t();let n=this.handles.get(e);if(this.handles.delete(e),n?.destroy){try{n.destroy()}catch{}return}let r=z()?.adfoxCode;if(r?.destroy)try{r.destroy(e)}catch{}}reloadBanner(e){if(this.destroyedContainers.has(e))return!1;let t=this.handles.get(e);if(!t?.reload)return!1;try{t.reload()}catch{return!1}return!0}renderFloor(e,t){if(typeof window>`u`)return;let n=typeof t.html==`string`?t.html.trim():``;if(n===``)return;let r=this.containerVersions.get(e)??0,i=()=>{};this.floorCleanups.set(e,()=>{i(),this.floorCleanups.delete(e)}),i=C({thresholdPx:t.threshold_px??600,minDelayMs:t.min_delay_ms??1e3,onReady:()=>{let i=this.canCreate(e,r);this.floorCleanups.delete(e),i&&(this.startVendorController(e,t),this.injectFloorHtml(e,n))}})}startVendorController(e,t){if(t.vendor!==`viadata`||typeof t.zone_id!=`number`)return;let n=he({zoneId:t.zone_id,restartDelayMs:t.restart_after_complete_ms??4e4,maxRestarts:t.restart_max_count??1});this.floorCleanups.set(e,()=>{n(),this.floorCleanups.delete(e)})}injectFloorHtml(e,t){let n=document.getElementById(e),r=document.createElement(`div`);
1r.innerHTML=t,Array.from(r.childNodes).forEach(e=>{if(e.nodeName&&e.nodeName.toLowerCase()===`script`){let t=document.createElement(`script`);Array.from(e.attributes??[]).forEach(e=>{t.setAttribute(e.name,e.value)}),e.src||(t.textContent=e.textContent??``),document.head.appendChild(t);return}n&&n.appendChild(e)})}canCreate(e,t){return!this.destroyedContainers.has(e)&&(this.containerVersions.get(e)??0)===t}};function J(){return typeof window<`u`&&window.__advDebug===!0}function st(){typeof window<`u`&&window.__advEarlyPrebidCancel?.()}function ct(e){let t=typeof window>`u`?void 0:window.__advEarlyPrebid;return t?.codes.delete(e)?t.result:null}var lt=`/api/advertising/prebid-currency`,ut=3e3,dt=5e3,ft=1e4,pt=3e4,mt=9e5,ht=new Set(`AT.BE.BG.HR.CY.CZ.DE.DK.EE.EL.ES.FI.FR.GR.HU.IE.IT.LT.LU.LV.MT.NL.PL.PT.RO.SE.SI.SK.ZZ`.split(`.`)),Y=null,gt=class{config;fetchImpl;sharesCurrency;loadScriptImpl;readiness=null;rubToUsd=null;currencyUsable=!1;currencyCheckedAt=0;currencyRefreshPromise=null;consentGranted=!1;consentDecision=`pending`;googleAtpConsents=new Set;consentDecisionWatchers=new Set;consentObserverCleanup=null;constructor(e,t={}){this.config=e,this.fetchImpl=t.fetch??globalThis.fetch.bind(globalThis),this.sharesCurrency=t.fetch===void 0,this.loadScriptImpl=t.loadScript??_t}timeoutMs(){return this.config?.timeoutMs??1e3}isConsentRequired(){return this.isEuCountry()}consentStatus(){return!this.isConsentRequired()||this.consentGranted?`granted`:this.consentDecision}onConsentDecision(e){return!this.isConsentRequired()||this.consentGranted?(queueMicrotask(()=>e(`granted`)),()=>void 0):this.consentDecision===`denied`?(queueMicrotask(()=>e(`denied`)),()=>void 0):(this.consentDecisionWatchers.add(e),this.startConsentObserver(),()=>{this.consentDecisionWatchers.delete(e),this.consentDecisionWatchers.size===0&&this.stopConsentObserver()})}async prepareBids(e){let t=await this.ensureReady();return t.status===`ready`?{readiness:t,bids:this.filterBids(e)}:{readiness:t,bids:[]}}async ensureReady(){if(this.readiness){let e=await this.readiness;if(e.status===`ready`){if(this.isConsentRequired()&&!await this.hasConsent()){let e={status:`blocked`,reason:`consent-unavailable`};
1return this.readiness=Promise.resolve(e),e}await this.refreshCurrencyIfStale()}if(e.status!==`blocked`)return e;this.readiness=this.initialize()}return this.readiness??=this.initialize()}filterBids(e){return e.filter(e=>this.isBidEligible(e))}isConsentGranted(){return!this.isConsentRequired()||this.consentGranted}dispose(){this.consentDecisionWatchers.clear(),this.stopConsentObserver(),this.readiness=null,this.consentGranted=!1,this.consentDecision=`pending`}async initialize(){if(this.isEuCountry()&&!await this.hasConsent())return{status:`blocked`,reason:`consent-unavailable`};if(!this.config||this.config.enabledBidders.length===0)return{status:`unavailable`,reason:`no-enabled-bidders`};if(await this.loadCurrency(),!this.isPrebidSdkReady()){let e=await this.resolveAssetUrl();if(!e)return{status:`unavailable`,reason:`prebid-manifest-unavailable`};try{await bt(this.loadScriptImpl(e),dt)}catch{return{status:`unavailable`,reason:`prebid-load-failed`}}}return this.isPrebidSdkReady()?(this.configurePrebid(),{status:`ready`}):{status:`unavailable`,reason:`prebid-global-unavailable`}}isBidResponseEligible(e){if(!vt(e))return!1;let t=typeof e.bidderCode==`string`?e.bidderCode:typeof e.bidder==`string`?e.bidder:null;if(!t||!this.config?.enabledBidders.includes(t))return!1;let n=this.config.bidderPolicies[t];if(!n||this.isEuCountry()&&n.euAllowed!==!0)return!1;let r=e.originalCurrency??e.currency??n.defaultCurrency;if(typeof r!=`string`)return!1;let i=r.toUpperCase(),a=typeof e.currency==`string`?e.currency.toUpperCase():null,o=typeof e.cpm==`number`?e.cpm:Number(e.cpm);return Number.isFinite(o)&&o>0&&a===this.config.currency.toUpperCase()&&n.allowedCurrencies.includes(i)&&(i!==`RUB`||this.currencyUsable)}isPrebidSdkReady(){let e=window.pbjs;return e?.libLoaded===!0&&Array.isArray(e.que)}async resolveAssetUrl(){let e=this.config?.assetUrl;if(e)return e;let t=this.config?.manifestUrl;if(!t)return null;let n=new AbortController,r=window.setTimeout(()=>n.abort(),ut);try{let e=await this.fetchImpl(t,{credentials:`same-origin`,headers:{Accept:`application/json`},signal:n.signal});if(!e.ok)return null;let r=await e.json(),i=r.url??r.assetUrl??r.asset??r.file??r.path;if(typeof i!=`string`||i===``)return null;let a=r.url?window.location.origin:new URL(t,window.location.origin).href;return new URL(i,a).href}catch{return null}finally{window.clearTimeout(r)}}async loadCurrency(){if(this.currencyRefreshPromise)return this.currencyRefreshPromise;this.currencyRefreshPromise=this.loadCurrencyNow();try{return await this.currencyRefreshPromise}finally{this.currencyRefreshPromise=null}}async loadCurrencyNow(){if(!new Set((this.config?.enabledBidders??[]).flatMap(e=>this.config?.bidderPolicies[e]?.allowedCurrencies??[])).has(`RUB`))return this.currencyUsable=!0,this.currencyCheckedAt=Date.now(),!0;this.rubToUsd=null,this.currencyUsable=!1,this.currencyCheckedAt=Date.now();let e=await this.fetchCurrencyPayload(this.config?.currencyUrl??lt),t=e?.conversions?.RUB?.USD,n=e?.freshness?.isUsable===!0&&this.isSourceDateUsable(e.sourceDate);return typeof t!=`number`||!Number.isFinite(t)||t<=0||!n?!1:(this.rubToUsd=t,this.currencyUsable=!0,this.currencyCheckedAt=Date.now(),!0)}fetchCurrencyPayload(e){let t=window,n=t.__advPrebidFx;if(this.sharesCurrency&&n?.url===e&&Date.now()-n.at<mt)return n.payload;let r=this.requestCurrencyPayload(e);if(this.sharesCurrency){let n={url:e,at:Date.now(),payload:r};t.__advPrebidFx=n,r.then(e=>{e===null&&t.__advPrebidFx===n&&delete t.__advPrebidFx})}return r}async requestCurrencyPayload(e){let t=new AbortController,n=window.setTimeout(()=>t.abort(),3e3);try{let n=await this.fetchImpl(e,{credentials:`same-origin`,headers:{Accept:`application/json`},signal:t.signal});return n.ok?await n.json():null}catch{return null}finally{window.clearTimeout(n)}}isSourceDateUsable(e){if(!e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=Date.parse(`${e}T00:00:00Z`);if(!Number.isFinite(t))return!1;let n=Date.parse(`${this.moscowCalendarDate()}T00:00:00Z`),r=Math.floor((n-t)/864e5);return r>=0&&r<=7}moscowCalendarDate(){let e=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Europe/Moscow`,year:`numeric`,month:`2-digit`,day:`2-digit`}).formatToParts(new Date),t=Object.fromEntries(e.map(({type:e,value:t})=>[e,t]));return`${t.year}-${t.month}-${t.day}`}async refreshCurrencyIfStale(){this.config?.enabledBidders.some(e=>this.config?.bidderPolicies[e]?.allowedCurrencies.includes(`RUB`))&&(Date.now()-this.currencyCheckedAt<mt||(await this.loadCurrency(),this.isPrebidSdkReady()&&this.configurePrebid()))}configurePrebid(){let e=window.pbjs;if(!e.setConfig||!this.config)return;let t={USD:{USD:1},...this.rubToUsd===null?{}:{RUB:{USD:this.rubToUsd}}},n=Object.fromEntries(Object.entries(this.config.bidderPolicies).filter(([,e])=>typeof e.defaultCurrency==`string`).map(([e,t])=>[e,t.defaultCurrency]));e.setConfig({gptPreAuction:{enabled:!0},currency:{adServerCurrency:this.config.currency,rates:t,bidderCurrencyDefault:n},priceGranularity:this.config.priceGranularity,cpmRoundingFunction:e=>{let t=Math.round(e);return Math.abs(e-t)<1e-9?t:Math.floor(e)},...this.isEuCountry()?{consentManagement:{gdpr:this.gdprConsentConfig()}}:{},...J()?{debug:!0}:{}}),yt(e),e.bidderSettings={...e.bidderSettings??{},standard:{...e.bidderSettings?.standard??{},allowZeroCpmBids:!1,bidCpmAdjustment:(e,t)=>
1this.adjustBidCpm(e,t)}}}gdprConsentConfig(){let e=(this.config?.enabledBidders??[]).filter(e=>{let t=this.config?.bidderPolicies[e]?.googleAtpId;return t!==void 0&&this.googleAtpConsents.has(t)});return{cmpApi:`iab`,timeout:500,actionTimeout:1e4,defaultGdprScope:!0,rules:[...[`storage`,`basicAds`,`personalizedAds`,`measurement`].map(t=>({purpose:t,enforcePurpose:!0,enforceVendor:!0,...e.length>0?{softVendorExceptions:e}:{}})),{purpose:`transmitPreciseGeo`,enforcePurpose:!0}]}}adjustBidCpm(e,t){return!Number.isFinite(e)||e<=0||typeof t!=`object`||!t?0:this.isBidResponseEligible({...t,cpm:e})?e:0}isBidEligible(e){if(!this.config?.enabledBidders.includes(e.bidder))return!1;let t=this.config.bidderPolicies[e.bidder];if(!t||this.isEuCountry()&&t.euAllowed!==!0)return!1;let n=this.resolveBidCurrency(e.params,t);return!n||!t.allowedCurrencies.includes(n)?!1:n!==`RUB`||this.currencyUsable}resolveBidCurrency(e,t){let n=e.cur??t.defaultCurrency;if(typeof n!=`string`)return null;let r=n.toUpperCase();return r===`USD`||r===`RUB`?r:null}isEuCountry(){let e=window.__pageRuntime,t=window.__consentGeoCountry??window.__consentState?.country??e?.country??window.__geo_country;return typeof t==`string`&&ht.has(t.toUpperCase())}hasConsent(){return this.isEuCountry()?window.__consentState?.isEU!==!0||window.__consentState.euCmpEnabled===!1?(this.markConsentPending(),Promise.resolve(!1)):new Promise(e=>{this.consentDecision=`pending`;let t=!1,r=null,i=0,a=n=>{t||(t=!0,window.clearTimeout(i),r?.(),n?this.markConsentGranted():this.markConsentPending(),e(n))};i=window.setTimeout(()=>a(!1),this.consentGranted?1e3:ft),r=n(e=>{if(this.googleAtpConsents=e.atpConsents,!e.success){a(!1);return}if(e.gdprApplies===!1){a(!0);return}e.gdprApplies===!0&&e.decided&&a(!0)}),t&&r()}):Promise.resolve(!0)}startConsentObserver(){if(this.consentObserverCleanup||!this.isConsentRequired())return;let e=!1,t=null,r=0,i=()=>{e||(e=!0,window.clearTimeout(r),t?.(),this.consentObserverCleanup===i&&(this.consentObserverCleanup=null))};r=window.setTimeout(i,pt),this.consentObserverCleanup=i,t=n(e=>{window.clearTimeout(r),e.success&&e.gdprApplies!==null&&(e.gdprApplies===!1||e.decided)&&this.markConsentGranted()}),e&&t()}stopConsentObserver(){this.consentObserverCleanup?.()}markConsentGranted(){if(this.consentGranted)return;this.consentGranted=!0,this.consentDecision=`granted`;let e=[...this.consentDecisionWatchers];this.consentDecisionWatchers.clear(),this.startConsentObserver(),e.forEach(e=>e(`granted`))}markConsentPending(){this.consentGranted=!1,this.consentDecision=`pending`}};function _t(e){if(typeof document>`u`)return Promise.reject(Error(`document is unavailable`));if(Y)return Y;let t=new URL(e,document.baseURI).href,n=Array.from(document.scripts).find(e=>e.src===t);return n?window.pbjs?.libLoaded===!0?Promise.resolve():(Y=new Promise((t,r)=>{n.addEventListener(`load`,()=>t(),{once:!0}),n.addEventListener(`error`,()=>{Y=null,r(Error(`Unable to load Prebid asset: ${e}`))},{once:!0})}),Y):(Y=new Promise((t,n)=>{let r=document.createElement(`script`);r.async=!0,r.src=e;let i=window.setTimeout(()=>{Y=null,n(Error(`Timed out loading Prebid asset: ${e}`))},dt);r.onload=()=>{window.clearTimeout(i),t()},r.onerror=()=>{window.clearTimeout(i),Y=null,n(Error(`Unable to load Prebid asset: ${e}`))},document.head.appendChild(r)}),Y)}function vt(e){if(typeof e.adUnitCode!=`string`||typeof e.width!=`number`||typeof e.height!=`number`)return!0;let t=(window.pbjs?.adUnits)?.filter(t=>t.code===e.adUnitCode).flatMap(e=>e.mediaTypes?.banner?.sizes??[])??[];return t.length===0||t.some(t=>Array.isArray(t)&&t[0]===e.width&&t[1]===e.height)}function yt(e){J()&&e.onEvent&&!e.__ixbtDebugSubscribed&&(e.__ixbtDebugSubscribed=!0,e.onEvent(`auctionEnd`,()=>console.info(`[prebid] auctionEnd`,{consent:e.getConsentMetadata?.(),consentManagement:e.getConfig?.(`consentManagement`)})),e.onEvent(`bidRejected`,e=>console.info(`[prebid] bidRejected`,e)),e.onEvent(`bidTimeout`,e=>console.info(`[prebid] bidTimeout`,e)))}function bt(e,t){return new Promise((n,r)=>{let i=window.setTimeout(()=>r(Error(`Prebid operation timed out`)),t);e.then(e=>{window.clearTimeout(i),n(e)},e=>{window.clearTimeout(i),r(e)})})}function xt(e){return new gt(e)}var St=640,Ct=10,wt=60;function Tt({code:e,projectSlug:t,sizes:n,bids:r,filterBids:i,type:a,order:o,minWidth:s,warnings:c=e=>console.warn(`[prebid] ${e}`)}){let l=Et(n);if(l.length===0)return c(`Skipping ${e}: breakpoint has no pixel sizes`),[];let u=t===`ixbt`&&a===`horizontal`&&typeof o==`number`&&o>=Ct&&o<=wt&&(s??0)>=St,d=new Map;return r.forEach(t=>{if(u&&t.sizes===void 0){c(`Skipping ${t.bidder} on ${e}: explicit sizes are required for iXBT horizontal ${o} at minWidth ${s}`);return}let n=t.sizes===void 0?l:Dt(Et(t.sizes),l);if(n.length===0){c(`Skipping ${t.bidder} on ${e}
1: bid sizes do not intersect breakpoint sizes`);return}let r=i([{bidder:t.bidder,params:t.params}]);if(r.length===0)return;let a=JSON.stringify(n),f=d.get(a);if(f){f.bids.push(...r);return}d.set(a,{code:e,mediaTypes:{banner:{sizes:n}},bids:[...r]})}),[...d.values()]}function Et(e){let t=new Set,n=[];return e.forEach(e=>{if(!Array.isArray(e)||e.length!==2)return;let[r,i]=e;if(!Number.isInteger(r)||!Number.isInteger(i)||r<=0||i<=0)return;let a=`${r}x${i}`;t.has(a)||(t.add(a),n.push([r,i]))}),n}function Dt(e,t){let n=new Set(e.map(([e,t])=>`${e}x${t}`));return t.filter(([e,t])=>n.has(`${e}x${t}`))}var X=new WeakMap,Ot=new Set([`hb_pb`,`hb_bidder`,`hb_adid`,`hb_size`,`hb_format`,`hb_source`,`hb_cache_id`]),kt=30,Z=class{disablePrebid;adStats;gptInitialLoad;projectSlug;destroyedContainers=new Set;statsByContainer=new Map;placesByContainer=new Map;generations=new Map;auctionEpochs=new Map;pendingConsent=new Map;pendingPrebidAuctions=[];prebidBatchScheduled=!1;pendingGptRefreshes=new Map;gptRefreshBatchScheduled=!1;servicesInitialized=!1;prebidRuntime;headerBiddingDisabled=!1;constructor(e,t,n,r=!1,i=``){this.disablePrebid=e,this.adStats=t,this.gptInitialLoad=r,this.projectSlug=i,this.prebidRuntime=xt(n)}prepareContainer(e){this.cancelPendingConsent(e),this.destroyedContainers.delete(e),this.generations.set(e,(this.generations.get(e)??0)+1)}setHeaderBiddingDisabled(e){if(this.headerBiddingDisabled!==e&&(this.headerBiddingDisabled=e,e)){let e=(window.googletag?.pubads?.())?.getSlots?.()??[];this.pendingPrebidAuctions=[];for(let t of this.placesByContainer.keys()){this.cancelPendingConsent(t);let n=e.find(e=>e.getSlotElementId()===t),r=this.placesByContainer.get(t),i=this.generations.get(t)??0;n&&r&&this.isLive(t,i)?this.requestHeaderBiddingForSlot({divId:t,slot:n,sizes:S(this.getSizes(r)),bids:[],generation:i,place:r}):this.auctionEpochs.set(t,(this.auctionEpochs.get(t)??0)+1)}}}ensureStatsListeners(){let e=window.googletag?.pubads?.();e?.addEventListener&&typeof e==`object`&&(X.set(e,this),e.__ixbtGptStatsListener!==!0&&(e.__ixbtGptStatsListener=!0,e.addEventListener(`slotRenderEnded`,t=>{let n=X.get(e),r=t.slot?.getSlotElementId?.(),i=r?n?.statsByContainer.get(r):void 0;i&&n?.adStats?.trackGptSlotRender(i,!!t.isEmpty)}),e.addEventListener(`impressionViewable`,t=>{let n=X.get(e),r=t.slot?.getSlotElementId?.(),i=r?n?.statsByContainer.get(r):void 0;i&&n?.adStats?.trackGptViewable(i)})))}createBanner({containerId:e,place:t,targeting:n,stats:r}){if(!window.googletag?.cmd||!t.googletag)return;let i=this.generations.get(e)??0;r&&this.statsByContainer.set(e,r),this.placesByContainer.set(e,t);let a=this.getSizes(t);window.googletag.cmd.push(()=>{if(!this.isLive(e,i))return;let r=window.googletag;if(!r||!t.googletag||!document.getElementById(e))return;this.ensureGptServices(r),this.ensureStatsListeners();let o=r.defineSlot(t.googletag,a,e);if(!o)return;let s=o.addService(r.pubads());this.applyTargeting(s,n),r.display(e),!this.gptInitialLoad&&this.requestHeaderBiddingForSlot({divId:e,slot:s,sizes:S(a),bids:x(t.type)?t.prebidBids??[]:[],generation:i,place:t})})}refreshSlot(e){if(this.destroyedContainers.has(e))return!1;let t=window.googletag?.pubads?.();if(!t?.getSlots)return!1;let n=t.getSlots().find(t=>t.getSlotElementId()===e),r=this.placesByContainer.get(e);if(!n||!r)return!1;let i=this.generations.get(e)??0;return this.requestHeaderBiddingForSlot({divId:e,slot:n,sizes:S(this.getSizes(r)),bids:x(r.type)?r.prebidBids??[]:[],generation:i,place:r}),!0}destroyBanner(e){if(this.destroyedContainers.add(e),this.cancelPendingConsent(e),this.generations.set(e,(this.generations.get(e)??0)+1),this.auctionEpochs.set(e,(this.auctionEpochs.get(e)??0)+1),this.statsByContainer.delete(e),this.placesByContainer.delete(e),this.placesByContainer.size===0&&this.prebidRuntime.dispose(),window.googletag?.pubads&&window.googletag?.destroySlots)try{let t=window.googletag.pubads().getSlots().find(t=>t.getSlotElementId()===e);t&&window.googletag.destroySlots([t])}catch{}if(window.pbjs?.que){let t=this.generations.get(e);window.pbjs.que.push(()=>{this.generations.get(e)===t&&window.pbjs?.removeAdUnit?.(e)})}}requestHeaderBiddingForSlot(e){let{divId:t,slot:n,bids:r,generation:i}=e;if(!window.googletag?.cmd||!n||!this.isLive(t,i))return;this.cancelPendingConsent(t);let a=(this.auctionEpochs.get(t)??0)+1;if(this.auctionEpochs.set(t,a),this.clearOwnTargeting(n),(this.disablePrebid||!r.length)&&!this.prebidRuntime.isConsentRequired()){this.finishAuction({divId:t,slot:n,generation:i,auctionEpoch:a,readiness:{status:`ready`}});return}if(this.headerBiddingDisabled){this.startOwnAuction({...e,bids:[]},n,a);return}let o=this.disablePrebid||!r.length?null:ct(t);if(o){let r=()=>{this.isCurrentAuction(t,i,a)&&this.startOwnAuction(e,n,a)};o.then(async o=>{let s=o.status===`ready`?await this.prebidRuntime.ensureReady():o;if(this.isCurrentAuction(t,i,a)){if(s.status!==`ready`){r();return}this.completeAuction({divId:t,slot:n,sizes:e.sizes,generation:i,auctionEpoch:a,responses:At(o.bids,t,o.auctionId)})}}).catch(r);return}this.startOwnAuction(e,n,a)}startOwnAuction(e,t,n){let{divId:r,sizes:i,bids:a,generation:o}=e;if(this.disablePrebid||this.headerBiddingDisabled||!a.length){this.startDirectGptAfterConsent({divId:r,slot:t,generation:o},n);return}this.prebidRuntime.prepareBids(a).then(({readiness:s,bids:c})=>{if(this.isCurrentAuction(r,o,n)){if(s.status===`blocked`){this.prebidRuntime.consentStatus()===`denied`?this.finishLimitedAds({divId:r,slot:t,generation:o,auctionEpoch:n}):this.waitForConsent({divId:r,slot:t,sizes:i,bids:a,generation:o,place:e.place},n);return}if(c.length===0){this.finishAuction({divId:r,slot:t,generation:o,auctionEpoch:n,readiness:s});return}window.pbjs?.que&&this.enqueuePrebidAuction({divId:r,slot:t,sizes:i,generation:o,auctionEpoch:n,filteredBids:c,place:e.place})}})}startDirectGptAfterConsent(e,t){let{divId:n,slot:r,generation:i}=e,a=e=>{this.isCurrentAuction(n,i,t)&&(e===`denied`?this.finishLimitedAds({divId:n,slot:r,generation:i,auctionEpoch:t}):this.finishAuction({divId:n,slot:r,generation:i,auctionEpoch:t,readiness:{status:`ready`}}))},o=this.prebidRuntime.consentStatus();if(o!==`pending`){a(o);return}this.cancelPendingConsent(n);let s=this.prebidRuntime.onConsentDecision(e=>{this.pendingConsent.delete(n),e!==`pending`&&a(e)});
1this.prebidRuntime.consentStatus()===`pending`?this.pendingConsent.set(n,{unsubscribe:s}):s()}waitForConsent(e,t){let{divId:n,generation:r}=e;this.cancelPendingConsent(n);let i=!1,a=()=>void 0;a=this.prebidRuntime.onConsentDecision(a=>{i=!0,this.pendingConsent.delete(n),a===`denied`?this.finishLimitedAds({divId:n,slot:e.slot,generation:r,auctionEpoch:t}):a===`granted`&&this.isLive(n,r)&&this.requestHeaderBiddingForSlot(e)}),i||this.pendingConsent.set(n,{unsubscribe:a})}enqueuePrebidAuction(e){this.isCurrentAuction(e.divId,e.generation,e.auctionEpoch)&&(this.pendingPrebidAuctions.push(e),!this.prebidBatchScheduled&&(this.prebidBatchScheduled=!0,queueMicrotask(()=>{this.prebidBatchScheduled=!1,this.flushPrebidAuctions()})))}flushPrebidAuctions(){let e=this.pendingPrebidAuctions;this.pendingPrebidAuctions=[];let t=window.pbjs,n=window.googletag,r=e.filter(({divId:e,generation:t,auctionEpoch:n})=>this.isCurrentAuction(e,t,n));r.length!==0&&t?.que&&n?.cmd&&t.que.push(()=>{let e=r.filter(({divId:e,generation:t,auctionEpoch:n})=>this.isCurrentAuction(e,t,n));if(e.length===0)return;e.forEach(({divId:e})=>t.removeAdUnit?.(e));let n=e.flatMap(({divId:e,sizes:t,filteredBids:n,place:r})=>Tt({code:e,projectSlug:this.projectSlug,sizes:t,bids:n,filterBids:e=>e,type:r.type,order:r.order,minWidth:Number(/-bp(\d+)$/.exec(e)?.[1]??0)}));if(n.length===0){e.forEach(({divId:e,slot:t,generation:n,auctionEpoch:r,sizes:i})=>{this.completeAuction({divId:e,slot:t,sizes:i,generation:n,auctionEpoch:r,responses:[]})});return}t.addAdUnits(n);let i=!1,a=(t,n)=>{i||(i=!0,e.forEach(({divId:r,slot:i,generation:a,auctionEpoch:o})=>{this.completeAuction({divId:r,slot:i,sizes:e.find(e=>e.divId===r)?.sizes??[],generation:a,auctionEpoch:o,responses:At(t,r,typeof n==`string`?n:void 0)})}))},o=window.setTimeout(()=>a(),Math.max(1,this.prebidRuntime.timeoutMs()));try{t.requestBids({adUnitCodes:[...new Set(e.map(({divId:e})=>e))],timeout:this.prebidRuntime?.timeoutMs()??1e3,bidsBackHandler:(e,t,n)=>{window.clearTimeout(o),a(e,n)}})}catch{window.clearTimeout(o),a()}})}finishLimitedAds({divId:e,slot:t,generation:n,auctionEpoch:r}){t&&this.isCurrentAuction(e,n,r)&&this.enqueueGptRefresh({divId:e,slot:t,generation:n,auctionEpoch:r})}completeAuction({divId:e,slot:t,sizes:n,generation:r,auctionEpoch:i,responses:a}){if(this.isCurrentAuction(e,r,i)){if(!this.prebidRuntime.isConsentGranted()){this.clearOwnTargeting(t),this.prebidRuntime.consentStatus()===`denied`&&this.finishLimitedAds({divId:e,slot:t,generation:r,auctionEpoch:i});return}if(this.resolveWinner(e,n,a))try{window.pbjs?.setTargetingForGPTAsync([e])}catch{}else this.clearOwnTargeting(t);this.finishAuction({divId:e,slot:t,generation:r,auctionEpoch:i,readiness:{status:`ready`}})}}resolveWinner(e,t,n){if(n.length===0)return null;let r;try{r=window.pbjs?.getHighestCpmBids?.(e)}catch{return null}let i=Array.isArray(r)?r:[];if(i.length!==1)return null;let a=i[0];return!a||!this.prebidRuntime.isBidResponseEligible(a)||typeof a.auctionId==`string`&&n.some(e=>typeof e.auctionId==`string`)&&!n.some(e=>e.auctionId===a.auctionId)||typeof a.width!=`number`||typeof a.height!=`number`||!t.some(([e,t])=>e===a.width&&t===a.height)?null:a}finishAuction({divId:e,slot:t,generation:n,auctionEpoch:r,readiness:i}){i.status!==`blocked`&&this.isCurrentAuction(e,n,r)&&this.prebidRuntime.isConsentGranted()&&this.enqueueGptRefresh({divId:e,slot:t,generation:n,auctionEpoch:r})}enqueueGptRefresh(e){this.isCurrentAuction(e.divId,e.generation,e.auctionEpoch)&&(this.pendingGptRefreshes.set(e.divId,e),!this.gptRefreshBatchScheduled&&(this.gptRefreshBatchScheduled=!0,queueMicrotask(()=>{this.gptRefreshBatchScheduled=!1;let e=[...this.pendingGptRefreshes.values()];this.pendingGptRefreshes.clear();let t=window.googletag;e.length!==0&&t?.cmd&&t.cmd.push(()=>{let n=e.filter(e=>{if(!this.isCurrentAuction(e.divId,e.generation,e.auctionEpoch)||!document.getElementById(e.divId))return!1;if(!this.prebidRuntime.isConsentRequired())return!0;let t=this.prebidRuntime.consentStatus();return t===`pending`?(this.clearOwnTargeting(e.slot),this.startDirectGptAfterConsent(e,e.auctionEpoch),!1):(t===`denied`&&this.clearOwnTargeting(e.slot),!0)});for(let e=0;e<n.length;e+=kt)t.pubads().refresh(n.slice(e,e+kt).map(({slot:e})=>e))})})))}ensureGptServices(e){if(this.servicesInitialized||window.__advGptServicesEnabled===!0){this.servicesInitialized=!0;return}e.setConfig({disableInitialLoad:!0}),e.enableServices?.(),window.__advGptServicesEnabled=!0,this.servicesInitialized=!0}clearOwnTargeting(e){let t=e.getTargetingMap?.()??{},n=new Set([...Ot,...Object.keys(t).filter(e=>e.startsWith(`hb_`))]);n.size>0&&e.setConfig({targeting:Object.fromEntries([...n].map(e=>[e,null]))})}isLive(e,t){return!this.destroyedContainers.has(e)&&(this.generations.get(e)??0)===t&&document.getElementById(e)!==null}isCurrentAuction(e,t,n){return this.isLive(e,t)&&this.auctionEpochs.get(e)===n}cancelPendingConsent(e){let t=this.pendingConsent.get(e);t&&(t.unsubscribe(),this.pendingConsent.delete(e))}applyTargeting(e,t){Object.keys(t).length>0&&e.setConfig({targeting:t})}getSizes(e){return e.sizes?.length?e.sizes:e.type===`desktop`?[[728,90],[970,90],[970,
1120],[970,160]]:e.type===`sidebar`?[[300,600],[300,250],[160,600],[120,600],[240,400]]:[[300,250],[336,280],[300,300],[240,400]]}};function At(e,t,n){let r=Array.isArray(e)?e:typeof e==`object`&&e?e[t]:void 0;return(Array.isArray(r)?r:typeof r==`object`&&r&&Array.isArray(r.bids)?r.bids:[]).filter(e=>{if(typeof e!=`object`||!e)return!1;let r=e,i=typeof r.adUnitCode!=`string`||r.adUnitCode===t,a=!n||typeof r.auctionId!=`string`||r.auctionId===n;return i&&a})}var Q=263225,jt=2e3,Mt=3e4,Nt=new Set([`recommend`,`floor`,`indexm`,`indexh`,`indexv`,`breadcrumbs`,`tgb`,`sidebartgb`,`wheretobuy`,`sidebar-button`,`mobile-button`,`slider`,`menu`]);function Pt(){if(typeof document>`u`)return!0;let e=document.hidden===!0,t=typeof document.hasFocus!=`function`||document.hasFocus();return!e&&t}var Ft=class{config;adStats;renderedRounds={};adfoxRenderer;gptRenderer;pendingLazyUnsubscribe=new Map;statsUnsubscribe=new Map;refreshUnsubscribe=new Map;refreshCounts=new Map;generations=new Map;headerBiddingDisabled=!1;bannerSdkByContainer=new Map;rendererByContainer=new Map;constructor(e){this.adStats=e;let t=window.__advConfig;if(!t){J()&&console.info(`[AdvManager] window.__advConfig not found - страница без рекламы, no-op`),this.config={projectSlug:``,ownerId:Q,places:[],disablePrebid:!1,darkMode:!1,geoRoutingEnabled:!0},this.adfoxRenderer=new q(e),this.gptRenderer=new Z(this.config.disablePrebid,e,this.config.prebid,this.config.gptInitialLoad??!1,this.config.projectSlug);return}this.config=t,this.adfoxRenderer=new q(e),this.gptRenderer=new Z(this.config.disablePrebid,e,this.config.prebid,this.config.gptInitialLoad??!1,this.config.projectSlug)}createBanner(e,t,n={},r={}){if(!this.shouldShowAd(e))return;let i=r&&typeof r==`object`?r:{},a=this.parseContainerOrder(t),o=a===null?this.getNextPlace(e):this.config.places.find(t=>t.type===e&&t.order===a)??null;if(!o||o.disabled){J()&&console.warn(`[AdvManager] place not found for "${t}" (${e})`);return}let s=this.resolveResponsivePlace(o);if(!s)return;let c=(this.generations.get(t)??0)+1;this.generations.set(t,c),this.renderResolvedBanner(e,t,s,n,i,c)}resolveResponsivePlace(e){if(e.type!==`horizontal`)return e;let t=[...e.breakpoints??[]].reverse().find(e=>window.matchMedia(`(min-width: ${e.minWidth}px)`).matches);return t?{...e,...t.config}:null}renderResolvedBanner(e,t,n,r,a,o){let s=a.lazy??n.lazy??!0,c=this.resolveSdk(n);if(c===`gpt`&&this.config.gptSoloSlot&&`${n.type}:${n.order}`!==this.config.gptSoloSlot)return;if(!c){Nt.has(e)||console.warn(`[AdvManager] Banner type "${e}" skipped in GPT geo: googletag is missing`);return}if(!(c===`adfox`&&n.type!==`floor`&&s)){this.createBannerNow(e,t,n,r,a,c,s,!1,o);return}let l=document.getElementById(t);if(!l){J()&&console.warn(`[AdvManager] lazy container "${t}" not found in DOM, creating immediately`),this.createBannerNow(e,t,n,r,a,c,s,!1,o);return}let u=i(l,{rootMargin:`${jt}px`,thresholds:[0],onEnter:()=>{this.pendingLazyUnsubscribe.delete(t),u(),this.generations.get(t)===o&&this.createBannerNow(e,t,n,r,a,c,s,!0,o)}});this.pendingLazyUnsubscribe.set(t,u)}createBannerNow(e,t,n,r,i,a,o,s,c){if(this.generations.get(t)!==c)return;let l=n.order,u=!!n.hbRounds?.includes(t),d=!this.headerBiddingDisabled&&!s&&(i.headerBiddingPremade??u)&&(e!==`horizontal`||!!window.YaHeaderBiddingSettings?.adUnits?.some(e=>e.code===t)),f=this.getRenderer(a);f.prepareContainer(t),window.__advInited=window.__advInited||{},window.__advInited[t]={type:e,order:l,sdk:a,lazy:o,ts:Date.now()};let p=!this.headerBiddingDisabled&&a===`adfox`&&(n.bids?.length||0)>0,m=this.adStats&&n.sendAnalytics===!0?{placeType:e,placeOrder:l,containerId:t,p1:n.p1,sdk:a,lazy:o,hb:a===`gpt`?`none`:d?`premade`:p?`dynamic`:`none`}:null;if(m&&this.adStats?.trackAdRequest(m),this.bannerSdkByContainer.set(t,a),this.rendererByContainer.set(t,{sdk:a,renderer:f}),a===`gpt`){f.createBanner({containerId:t,place:n,targeting:this.buildGptTargeting(r),lazy:o,stats:m??void 0}),this.attachStatsTracking(t,m),this.attachRefreshTracking(t,n,m,c);return}f.createBanner({ownerId:this.config.ownerId??Q,containerId:t,place:n,targeting:this.buildAdfoxTargeting(e,l,n,r),useHeaderBidding:p,lazy:o,headerBiddingPremade:d,darkMode:this.config.darkMode,stats:m??void 0}),this.attachStatsTracking(t,m),this.attachRefreshTracking(t,n,m,c)}attachStatsTracking(e,t){if(!t)return;let n=document.getElementById(e);if(!n||!this.adStats)return;let r=this.adStats.trackShowAd(n,t),i=this.adStats.trackRedeemedView(n,t);this.statsUnsubscribe.set(e,()=>{r(),i()}),a(e)}attachRefreshTracking(e,t,n,i){let o=t.refresh;if(!o||o.maxCount<=0)return;let s=document.getElementById(e);if(!s)return;let c=o.budgetMs??Mt,l=o.maxCount,u=r(s,{containerId:e,mode:`cumulative`,threshold:.5,budgetMs:c,onBudget:()=>
1{if(this.generations.get(e)!==i||!Pt()||(this.refreshCounts.get(e)??0)>=l||(a(e),n&&this.adStats?.trackAdRequest(n),!Pt()))return;let t=this.rendererByContainer.get(e);if(!(t?.sdk===`gpt`?t.renderer.refreshSlot(e):t?.sdk===`adfox`&&t.renderer.reloadBanner(e)))return;let r=(this.refreshCounts.get(e)??0)+1;this.refreshCounts.set(e,r),n&&this.adStats?.trackAdRefresh(n,{refreshCount:r,dwellBudgetMs:c}),r>=l&&(this.refreshUnsubscribe.get(e)?.(),this.refreshUnsubscribe.delete(e))}});this.refreshUnsubscribe.set(e,u)}destroyBanner(e){this.generations.set(e,(this.generations.get(e)??0)+1),this.bannerSdkByContainer.delete(e);let t=this.pendingLazyUnsubscribe.get(e);t&&(t(),this.pendingLazyUnsubscribe.delete(e));let n=this.statsUnsubscribe.get(e);n&&(n(),this.statsUnsubscribe.delete(e)),this.adStats?.resetContainer(e);let r=this.refreshUnsubscribe.get(e);r&&(r(),this.refreshUnsubscribe.delete(e)),this.refreshCounts.delete(e);let i=window.__advInited?.[e],a=this.rendererByContainer.get(e);a?(a.renderer.destroyBanner(e),this.rendererByContainer.delete(e)):i?this.getRenderer(i.sdk).destroyBanner(e):(this.gptRenderer.destroyBanner(e),this.adfoxRenderer.destroyBanner(e)),window.__advInited&&delete window.__advInited[e]}hideBanner(e){if(this.bannerSdkByContainer.get(e)===`gpt`){let t=document.getElementById(e);return t&&(t.style.display=`none`),!0}let t=this.rendererByContainer.get(e);return t?.sdk===`adfox`&&t.renderer.hideBanner(e)}showBanner(e){if(this.bannerSdkByContainer.get(e)===`gpt`){let t=document.getElementById(e);t&&(t.style.display=``);return}let t=this.rendererByContainer.get(e);t?.sdk===`adfox`&&t.renderer.showBanner(e)}configure(e,t){this.config=e,t&&(this.adStats=t),this.adStats?.setEnabled((e.places??[]).some(e=>e.sendAnalytics===!0||e.breakpoints?.some(({config:e})=>e.sendAnalytics===!0))),this.adfoxRenderer=new q(this.adStats),this.gptRenderer=new Z(this.config.disablePrebid,this.adStats,this.config.prebid,this.config.gptInitialLoad??!1,this.config.projectSlug),this.gptRenderer.setHeaderBiddingDisabled(this.headerBiddingDisabled)}setHeaderBiddingDisabled(e){this.headerBiddingDisabled=e,e&&st(),this.gptRenderer.setHeaderBiddingDisabled(e)}getOwnerId(){return this.config.ownerId??Q}isGptGeo(){return window.__pageRuntime?.provider===`gpt`}resolveSdk(e){return this.isGptGeo()?e.googletag?`gpt`:null:`adfox`}getRenderer(e){return e===`gpt`?this.gptRenderer:this.adfoxRenderer}shouldShowAd(e){return b(e,p())}canShowAd(e){return this.shouldShowAd(e)}getNextPlace(e){let t=this.config.places.filter(t=>t.type===e);if(!t.length)return null;let n=t[0],r=2**53-1;return t.forEach(t=>{let i=this.renderedRounds[e]?.[t.order]??0;i<r&&(r=i,n=t)}),this.renderedRounds[e]||(this.renderedRounds[e]={}),this.renderedRounds[e][n.order]=(this.renderedRounds[e][n.order]||0)+1,n}parseContainerOrder(e){let t=/^ad-[a-z][a-z-]*-(\d+)-\d+(?:-bp\d+)?$/.exec(e);return t?parseInt(t[1],10):null}getTypePrefix(e){return{mobile:`m`,desktop:`h`,horizontal:p()===`phone`?`m`:`h`,sidebar:`v`,menu:`mn`,tgb:`t`,recommend:`r`,indexm:`im`,indexh:`ih`,indexv:`iv`,breadcrumbs:`b`,"sidebar-button":`sb`,"mobile-button":`mb`,touch:`to`,pad:`p`,floor:`fl`,slider:`sl`}[e]||e.substring(0,2)}buildAdfoxTargeting(e,t,n,r){let i={p1:n.p1,p2:n.p2,puid5:this.getTypePrefix(e)+t,puid10:this.config.projectSlug,puid9:window.__app?.settings?`login`:`anon`,puid14:Math.floor(Math.random()*10)};return Object.entries(r).forEach(([e,t])=>{if(t!==null&&t!==``&&e!==`branding_placement_id`){if(e===`partner_stat_id`){i[`partner-stat-id`]=t;return}i[e]=t}}),Object.entries(n.adfoxTargeting??{}).forEach(([e,t])=>{t!==null&&t!==``&&(i[e]=t)}),i}buildGptTargeting(e){let t={},n=new Set([`branding_placement_id`,`puid10`,`puid3`,`puid9`,`puid14`,`ld`,`dl`,`partner-stat-id`,`partner_stat_id`]);return Object.entries(e).forEach(([e,r])=>{r===null||r===``||n.has(e)||e.startsWith(`hb_`)||(t[e]=r)}),t}},It=null;function $(){return It||=new Ft,It}function Lt(e,t){let n=e;if(typeof window<`u`&&e.splitCandidates){let t=window.__advEarlySplit?.seed??Math.floor(Math.random()*100)+1,r=xe(window.location.search);n={...e,places:Ce(e.places,e.splitCandidates,t,r)}}return $().configure(n,t),n}function Rt(e){$().setHeaderBiddingDisabled(e)}function zt(e){return $().hideBanner(e)}function Bt(e){$().showBanner(e)}function Vt(e,t,n={},r={}){$().createBanner(e,t,n,r)}function Ht(e){$().destroyBanner(e)}function Ut(){return $().getOwnerId()}export{re as _,zt as a,U as c,Ae as d,M as f,b as g,x as h,Ut as i,qe as l,C as m,Vt as n,Rt as o,T as p,Ht as r,Bt as s,Lt as t,z as u,l as v};

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.