PageSourceSearch

https://panel.eroadvertising.com/assets/Volumes-BIt6UB8y.js

js eroadvertising.com collected 2026-10-09 17:33:22 UTC 8,983 bytes, 1 lines download raw bytes

1import{G as ee,u as te,T as le,d as ae,r as u,c as oe,aa as se,o as ne,e as m,k as d,x as v,bw as M,D as c,g as s,h as V,i as t,f as w,ai as ue,m as f,t as r,a6 as re,y as k,F as I,N as E,$ as ie,M as de,p as ce,a5 as ve,v as me,ag as pe}from"./index-KZr-FxSz.js";import{u as ye}from"./useTableStyles-evsaLHIa.js";import{u as fe}from"./useListingSearch-CPnyVSir.js";import{_ as _e}from"./ThemedTableCard-BXdLH2dS.js";import{F as S}from"./FilterDropdown-CZqX-W7x.js";import{_ as J,a as T}from"./ListingDataCell-Bl8EYHf5.js";import"./HelpTip-DeOY9iAw.js";const be={class:"p-4 sm:p-6 lg:p-8"},ge=["aria-label","placeholder"],he={id:"tour-volumes-filters",class:"flex flex-wrap items-center gap-2 px-4 py-3 border-b border-border bg-muted/30"},xe=["disabled","aria-busy"],we=["disabled"],Ve={class:"overflow-x-auto bg-card"},ke={id:"tour-volumes-data",class:"ui-table w-full divide-y divide-border"},Se={class:"sr-only"},Te={class:"divide-y divide-border"},Ce={key:1},Fe={colspan:"2",role:"alert",class:"px-4 py-8 text-center text-muted-foreground"},De={class:"text-sm font-medium text-foreground"},Ne={class:"text-xs mt-1"},Oe={key:2},$e={colspan:"2",role:"status",class:"px-4 py-8 text-center text-muted-foreground"},Ae={key:3},Ke={colspan:"2",role:"status",class:"px-4 py-8 text-center text-muted-foreground"},Le={__name:"Volumes",setup(Re){const{t:l}=te(),A=le(),{titleStyle:j,searchStyle:z,theadStyle:G,rowStyle:H}=ye();ae([{id:"tour-volumes-table",title:l("volumes.tour_table","Traffic Volumes"),description:l("volumes.tour_table_desc","View available traffic volumes by country. See how much inventory is available for your targeting criteria."),side:"bottom"},{id:"tour-volumes-filters",title:l("volumes.tour_filters","Volume Filters"),description:l("volumes.tour_filters_desc","Filter volumes by ad type, device type, and connection type to estimate reach for your campaigns."),side:"bottom"},{id:"tour-volumes-data",title:l("volumes.tour_data","Volume Data"),description:l("volumes.tour_data_desc","Daily impression volumes by country. Use this to plan budgets and set realistic campaign goals."),side:"bottom"}]);const i=u(!0),C=u(!1),F=u([]),K=u(!1),_=u([]),b=u([]),g=u([]),D=u(!1),p=u([]),o=u({adtypeid:null,device_typeid:null,connection_typeid:0,paytype:1}),N=u({}),h=u("country_name"),y=u("asc"),L=oe(()=>{const n=[...F.value],a=h.value,e=y.value==="asc"?1:-1;return n.sort((Y,Z)=>{let $=Y[a],q=Z[a];return typeof $=="string"?e*$.localeCompare(q):e*(($||0)-(q||0))}),n}),{globalSearch:O,filteredItems:R,hasActiveSearch:P}=fe(L,{columns:[{key:"country_name"},{key:"volume"}]});function U(n){h.value===n?y.value=y.value==="asc"?"desc":"asc":(h.value=n,y.value=n==="volume"?"desc":"asc")}async function Q(){try{const a=(await M.filters()).data;_.value=(a.ad_types||[]).map(e=>({...e,label:l("settings_options."+e.key.toLowerCase(),e.name)})),b.value=(a.device_types||[]).map(e=>({...e,label:e.name})),g.value=(a.connection_types||[]).map(e=>({...e,label:e.name})),D.value=a.has_connection_types&&g.value.length>0,p.value=(a.pay_types||[]).map(e=>({...e,label:l("global."+e.name.toLowerCase(),e.name)})),_.value.length>0&&(o.value.adtypeid=_.value[0].id),b.value.length>0&&(o.value.device_typeid=b.value[0].id),D.value&&g.value.length>0&&(o.value.connection_typeid=g.value[0].id),p.value.length>0&&!p.value.some(e=>e.id===o.value.paytype)&&(o.value.paytype=p.value[0].id),N.value={...o.value},K.value=!0}catch(n){console.error("Failed to load volume filters:",n),A.error(l("volumes.filters_error","Failed to load filter options")),i.value=!1}}async function x(){if(!K.value){i.value=!1;return}i.value=!0,C.value=!1;try{const n=await M.list({adtypeid:o.value.adtypeid,device_typeid:o.value.device_typeid,connection_typeid:o.value.connection_typeid,paytype:o.value.paytype});F.value=n.data.data||[]}catch(n){console.error("Failed to load volume data:",n),C.value=!0,A.error(l("volumes.fetch_error","Failed to load volume data"))}finally{i.value=!1}}const B=u(!1);se(()=>[o.value.adtypeid,o.value.device_typeid,o.value.connection_typeid,o.value.paytype],()=>{B.value&&x()});function W(){const n=JSON.stringify(o.value)!==JSON.stringify(N.value);o.value={...N.value},n||x()}function X(n){return!n&&n!==0?"0":pe(Math.round(Number(n)))}return ne(async()=>{await Q(),await x(),B.value=!0}),(n,a)=>(c(),m("div",be,[d(_e,{id:"tour-volumes-table",loading:i.value},{"header-left":v(()=>[s("div",{class:"table-search flex items-center rounded-md border border-input bg-card overflow-hidden",style:k(t(z))},[s("span",{class:"table-title px-4 py-1.5 text-sm font-medium text-card-foreground bg-muted",style:k(t(j))},r(t(l)("volumes.traffic_volumes","Traffic Volumes")),5),ce(s("input",{"onUpdate:modelValue":a[0]||(a[0]=e=>ve(O)?O.value=e:null),type:"search",inputmode:"search",autocomplete:"off",spellcheck:"false","aria-label":t(l)("advertiser_volumes.search_aria","Search volumes"),placeholder:t(l)("global.search","Search..."),class:"px-3 py-1.5 text-sm bg-transparent border-0 focus:outline-none flex-1 min-w-[120px]"},null,8,ge),[[me,t(O)]])],4)]),default:v(()=>[s("div",he,[_.value.length>0?(c(),V(S,{key:0,label:t(l)("volumes.adtype","Ad Type"),options:_.value,modelValue:o.value.adtypeid,showAllOption:!1,required:"",labelKey:"label",valueKey:"id","onUpdate:modelValue":a[1]||(a[1]=e=>o.value.adtypeid=e)},null,8,["label","options","modelValue"])):w("",!0),b.value.length>0?(c(),V(S,{key:1,label:t(l)("volumes.device_type","Device Type"),options:b.value,modelValue:o.value.device_typeid,showAllOption:!1,required:"",labelKey:"label",valueKey:"id","onUpdate:modelValue":a[2]||(a[2]=e=>o.value.device_typeid=e)},null,8,["label","options","modelValue"])):w("",!0),p.value.length>1?(c(),V(S,{key:2,label:t(l)("volumes.pay_type","Pay Type"),options:p.value,modelValue:o.value.paytype,showAllOption:!1,required:"",labelKey:"label",valueKey:"id","onUpdate:modelValue":a[3]||(a[3]=e=>o.value.paytype=e)},null,8,["label","options","modelValue"])):w("",!0),D.value?(c(),V(S,{key:3,label:t(l)("volumes.connection_type","Connection Type"),options:g.value,modelValue:o.value.connection_typeid,showAllOption:!1,required:"",labelKey:"label",valueKey:"id","onUpdate:modelValue":a[4]||(a[4]=e=>o.value.connection_typeid=e)},null,8,["label","options","modelValue"])):w("",!0),s("button",{type:"button",class:"ui-btn-primary flex items-center gap-1 text-sm",disabled:i.value,"aria-busy":i.value,onClick:x},[d(t(ue),{class:"h-4 w-4","aria-hidden":"true"}),f(" "+r(t(l)("global.search","Search")),1)],8,xe),s("button",{type:"button",class:"ui-btn-ghost flex items-center gap-1 text-sm",disabled:i.value,onClick:W},[d(t(re),{class:"h-4 w-4","aria-hidden":"true"}),f(" "+r(t(l)("global.reset_filters","Reset")),1)],8,we)]),s("div",Ve,[s("table",ke,[s("caption",Se,r(t(l)("volumes.traffic_volumes","Traffic Volumes")),1),s("thead",{class:"bg-muted",style:k(t(G))},[s("tr",null,[d(J,{sortable:!0,sortDirection:h.value==="country_name"?y.value:null,align:"center",style:{width:"50%"},onSort:a[5]||(a[5]=e=>U("country_name"))},{default:v(()=>[f(r(t(l)("volumes.country","Country")),1)]),_:1},8,["sortDirection"]),d(J,{sortable:!0,sortDirection:h.value==="volume"?y.value:null,align:"center",style:{width:"50%"},onSort:a[6]||(a[6]=e=>U("volume"))},{default:v(()=>[f(r(t(l)("volumes.volume","Volume")),1)]),_:1},8,["sortDirection"])])],4),s("tbody",Te,[i.value&&F.value.length===0?(c(),m(I,{key:0},E(10,e=>s("tr",{key:"skel-"+e,class:"animate-pulse","aria-hidden":"true"},[d(T,{align:"center"},{default:v(()=>
1[...a[7]||(a[7]=[s("div",{class:"h-4 w-28 bg-muted-foreground/20 rounded mx-auto"},null,-1)])]),_:1}),d(T,{align:"center"},{default:v(()=>[...a[8]||(a[8]=[s("div",{class:"h-4 w-16 bg-muted-foreground/20 rounded mx-auto"},null,-1)])]),_:1})])),64)):!i.value&&C.value?(c(),m("tr",Ce,[s("td",Fe,[d(t(ie),{class:"h-8 w-8 mx-auto mb-2 text-destructive","aria-hidden":"true"}),s("p",De,r(t(l)("volumes.load_error_title","Could not load volume data")),1),s("p",Ne,r(t(l)("volumes.load_error_desc","Something went wrong fetching the volume data. Check your connection and try again.")),1),s("button",{type:"button",class:"ui-btn-primary mt-3 inline-flex items-center focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",onClick:x},r(t(l)("global.retry","Retry")),1)])])):!i.value&&L.value.length===0?(c(),m("tr",Oe,[s("td",$e,r(t(l)("volumes.no_volumes","No volume data available. Try adjusting filters and click Search.")),1)])):!i.value&&t(R).length===0&&t(P)?(c(),m("tr",Ae,[s("td",Ke,r(t(l)("global.no_results","No results found")),1)])):w("",!0),(c(!0),m(I,null,E(t(R),e=>(c(),m("tr",{key:e.country,class:"table-row",style:k(t(H))},[d(T,{align:"center"},{default:v(()=>[d(de,{code:e.country,class:"me-1"},null,8,["code"]),f(r(e.country_name),1)]),_:2},1024),d(T,{align:"center",class:"tabular-nums"},{default:v(()=>[f(r(X(e.volume)),1)]),_:2},1024)],4))),128))])])])]),_:1},8,["loading"])]))}},je=ee(Le,[["__scopeId","data-v-c3f006a9"]]);export{je as default};

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.