1import{i as r,d as a}from"./CxzYtgGg.js";import{u as l}from"./DX-K58in.js";class h{static make(o){return{id:o.id,zone_code:o.ad_server_zone_code,zone_name:o.zone_name,is_active:o.is_active,is_desktop:o.is_desktop,is_mobile:o.is_mobile,sizes:{mobile:o.mobileSizes,desktop:o.desktopSizes},is_lazy_load:o.is_lazy_load,is_allowed_in_webview:o.is_allowed_in_webview===!0}}}const n=new Set;let d=null;const w=r("ads",{state:()=>({adZones:{},keywords:[l()||"",...a().getIsWebView?["webview"]:[],...a().IsDarkModeBool?["darkmode"]:[]],placeholderCount:3}),getters:{GetPlaceholderCount:e=>e.placeholderCount,GetKeywords:e=>e.keywords,GetAdZoneByZoneCode:e=>o=>e.adZones[o]||null},actions:{decreasePlaceholderCount(){this.placeholderCount--},setKeywords(e){this.keywords=[...this.keywords,...e]},addAdZone(e){this.adZones={...this.adZones,[e.slug]:e.adZone}},storeKeywords(e){this.keywords!==e&&this.setKeywords(e)},async fetchAdsBatch(e){const o=e.filter(t=>!this.GetAdZoneByZoneCode(t));if(!o.length)return;const i=await $fetch("/api/ads/batch",{query:{zones:o.join(",")}});for(const{code:t,data:c}of i){const s=h.make(c);this.addAdZone({slug:s.zone_code,adZone:s}),t!==s.zone_code&&this.addAdZone({slug:t,adZone:s})}},scheduleForBatch(e){return n.add(e),d||(d=Promise.resolve().then(async()=>{const o=[...n];if(n.clear(),d=null,o.length)try{await this.fetchAdsBatch(o)}catch(i){console.error("Ad batch fetch failed:",i)}})),d},async fetchAd(e){let o=this.GetAdZoneByZoneCode(e);return o||(await this.scheduleForBatch(e),this.GetAdZoneByZoneCode(e))}}});export{w as u};
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.