PageSourceSearch

https://www.akero.io/_nuxt/CqraMFTb.js

js akero.io collected 2026-10-07 20:31:37 UTC 9,390 bytes, 1 lines download raw bytes

1import{_ as I}from"./B7e1ll80.js";import{u as O,_ as G}from"./D7mTohK5.js";import{_ as H,u as Z,r as M}from"./BygKNeGB.js";import{_ as z}from"./BYxjajm6.js";import{z as J,cZ as W,k as K,n as Q,B as X,o as p,e as S,w as c,d as i,t as $,b as o,aq as D,$ as L,f as e,r as tt,q as C,c as q,F as et,K as at,cM as N,j as k,l as rt,U as ot,s as st,p as nt,a as it,G as ct}from"./CR3eISA3.js";import{u as mt}from"./CQDINvM2.js";import{u as lt}from"./BoRk4VT-.js";import{_ as ut}from"./CDdfcnNp.js";import{V as dt}from"./DjU3eLAU.js";import{V as pt}from"./CGx8-qZ_.js";import{V as B}from"./DDPkRzHX.js";import{V,_ as ft}from"./J0SplvpU.js";import{V as ht}from"./DoQyVBA7.js";import{_ as _t}from"./CyBZwnlJ.js";import{u as yt}from"./gt7f9XhT.js";import{u as gt}from"./-zUutANJ.js";import{u as bt}from"./CzAd0iWC.js";import{u as vt}from"./CB_961Sp.js";import{u as xt}from"./B5p0Xu-s.js";import{u as $t}from"./Bb673TAv.js";import{V as wt}from"./BYQPw3Ym.js";import"./DS9s7794.js";import"./DkvWPPj_.js";import"./BHV6bh81.js";import"./DjewqQNH.js";import"./5Kfy3naG.js";import"./mCXMDzh0.js";import"./DaZ3KIMZ.js";import"./gUs-dsFi.js";import"./B36uCgyD.js";import"./QjJsDpFa.js";import"./uZTS-jtw.js";import"./C6w0P088.js";import"./CswdlJwV.js";const kt={class:"d-flex justify-space-between mb-2"},St='<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:rgba(0,0,0,0.2);"></span>',Ct={__name:"performance",props:{name:{type:String,default:"Performance Graph"},tooltip:{show:!0},days:{type:Array,required:!0},metric:{type:Array,required:!0},estimateLowerBounds:{type:Array,required:!0},estimateUpperBounds:{type:Array,required:!0},forecast:{type:Array,required:!0},smooth:{type:Boolean,default:!1},initHeight:{type:Number,default:600},initWidth:{type:Number,default:1024},dateFormatter:{type:Function,required:!0}},setup(a){const r=J("akero.io/theme"),{themes:s}=W(),t=a,h=C(()=>({height:t.initHeight,width:t.initWidth,renderer:"canvas",locale:"EN"})),_=tt(),y=C(()=>({grid:{top:30,left:85,right:30},legend:{top:0,data:[t.name,"Forecast"]},tooltip:{trigger:"axis",formatter:([u,m,l,d])=>{const f=[`Date: ${m.name}`];return f.push(`${St} Estimated ${l.seriesName}: ${parseInt(u.value).toLocaleString()} - ${parseInt(u.value+m.value).toLocaleString()}`),f.push(`${l.marker} ${l.seriesName}: ${l.value!==void 0?l.value.toLocaleString():"-"}`),d&&f.push(`${d.marker} ${d.seriesName}: ${d.value!==void 0?d.value.toLocaleString():"-"}`),f.join("<br>")}},xAxis:{type:"category",data:t.days.map(u=>t.dateFormatter(new Date(u))),axisLabel:{interval:u=>new Date(t.days[u]).getDate()===1}},yAxis:{type:"value",axisLabel:{}},dataZoom:[{type:"slider"}],series:[{id:"lower",name:`Estimated ${t.name} Lower Bounds`,data:t.estimateLowerBounds,type:"line",stack:"bounds",symbol:"none",smooth:t.smooth,lineStyle:{opacity:0}},{id:"upper",name:`Estimated ${t.name} Upper Bounds`,stack:"bounds",data:t.estimateUpperBounds.map((u,m)=>u-t.estimateLowerBounds[m]),type:"line",smooth:t.smooth,symbol:"none",lineStyle:{opacity:0},areaStyle:{color:mt("blue-grey",50)}},{id:"metric",name:t.name,data:t.metric,type:"line",smooth:t.smooth,symbol:"none"},{id:"forecast",name:"Forecast",data:t.forecast,type:"line",smooth:t.smooth,symbol:"none",lineStyle:{type:[4,6],width:1}}]}));K(async()=>{await Q(),_.value.resize({width:"auto",height:"auto"})});const g=()=>{lt(`${t.name}.png`,_.value.getDataURL({type:"png",backgroundColor:"#ffffff",excludeComponents:["dataZoom"]}))},v=()=>{_.value.dispatchAction({type:"restore"})};return(u,m)=>{const l=X("v-btn-icon-action"),d=H,f=z;return p(),S(f,null,{default:c(()=>[i("div",kt,[i("h2",null,$(a.name),1),i("div",null,[o(D,{text:"Download Graph"},{activator:c(({props:w})=>[o(l,L(w,{icon:"mdi-download-box",color:"primary",density:"comfortable",onClick:g}),null,16)]),_:1}),o(D,{text:"Restore Graph Zoom"},{activator:c(({props:w})=>[o(l,L(w,{icon:"mdi-restore",color:"primary",density:"comfortable",onClick:v}),null,16)]),_:1})])]),o(d,{ref_key:"chart",ref:_,option:e(y),autoresize:"","init-options":e(h),class:"echart rounded",theme:e(r)},null,8,["option","init-options","theme"])]),_:1})}}},Vt={class:"v-data-table__td"},qt={class:"v-data-table__td"},Ft={class:"v-data-table__td"},At={class:"v-data-table__td"},Mt={class:"v-data-table__td"},Dt={__name:"platform-table",props:{data:{type:Array,required:!1,default:()=>[]},count:{type:String,required:!0},metric:{type:String,required:!0},formatMetric:{type:Function,required:!1,default:a=>a}},setup(a){return(r,s)=>(p(),S(dt,{density:"comfortable",hover:!1,height:600,class:"v-data-table"},{default:c(()=>[i("thead",null,[i("tr",null,[s[0]||(s[0]=i("th",{class:"v-data-table__td"},"Platform",-1)),i("th",Vt,$(a.count),1),i("th",qt,$(a.metric),1)])]),i("tbody",null,[(p(!0),q(et,null,at(a.data,t=>(p(),q("tr",{key:t.platform,class:"v-data-table__tr"}
1,[i("td",Ft,$(t.platform),1),i("td",At,$(t.count.toLocaleString()),1),i("td",Mt,$(a.formatMetric(t.metric)),1)]))),128)),s[1]||(s[1]=i("tr",{style:{height:"0px",border:"0px"}},[i("td",{style:{height:"0px",border:"0px"}})],-1))])]),_:1}))}},Lt={__name:"section-performance",props:{name:{type:String,required:!0},metric:{type:String,required:!0},chart:{type:Object,required:!0},stats:{type:Object,required:!0},platforms:{type:Array,required:!0},dateFormatter:{type:Function,required:!0},currencyFormatter:{type:Function,required:!0}},setup(a){const r=["January","February","March","April","May","June","July","August","September","October","November","December"],s=C(()=>r[new Date().getMonth()]),t=C(()=>{const h=new Date().getMonth()-1;return h<0?r[11]:r[h]});return(h,_)=>{const y=Ct,g=ut,v=Dt;return p(),S(ht,{class:"pa-2"},{default:c(()=>[o(pt,null,{default:c(()=>[o(B,null,{default:c(()=>[o(V,{class:"minHeight",cols:"12",lg:"8"},{default:c(()=>[o(y,{metric:a.chart.metric,days:a.chart.days,"estimate-lower-bounds":a.chart.estimatesLower,"estimate-upper-bounds":a.chart.estimatesUpper,forecast:a.chart.forecast,"date-formatter":a.dateFormatter,name:a.name,smooth:""},null,8,["metric","days","estimate-lower-bounds","estimate-upper-bounds","forecast","date-formatter","name"])]),_:1}),o(V,{class:"minHeight padTop",cols:"12",lg:"4"},{default:c(()=>[o(B,{class:"mb-4"},{default:c(()=>[o(V,{cols:"12",md:"6"},{default:c(()=>[o(g,{title:`${e(t)} ${a.metric}`,detail:a.stats.lastMonth,format:a.currencyFormatter},null,8,["title","detail","format"])]),_:1}),o(V,{cols:"16",md:"6"},{default:c(()=>[o(g,{title:`${e(s)} ${a.metric}`,detail:a.stats.currentMonth,format:a.currencyFormatter},null,8,["title","detail","format"])]),_:1})]),_:1}),o(v,{data:a.platforms,count:a.name,metric:a.metric,"format-metric":a.currencyFormatter},null,8,["data","count","metric","format-metric"])]),_:1})]),_:1})]),_:1})]),_:1})}}},Bt=N(Lt,[["__scopeId","data-v-3beea869"]]),Nt={class:"d-flex ga-4"},Pt={key:0,class:"d-flex flex-column ga-10 pt-0"},Rt={key:1},Tt={__name:"performance",async setup(a){let r,s;const{$loading:t,$toast:h,$api:_}=([r,s]=k(()=>st()),r=await r,s(),r),{params:{organisationId:y}}=rt(),{organisation:g}=([r,s]=k(()=>nt()),r=await r,s(),r),v=yt().toString(g.academicYearStartMonth,new Date),u=gt().reports(y,v);bt("report");const m=O({},["academicYear"],!0),l=([r,s]=k(()=>vt()),r=await r,s(),r),d=([r,s]=k(()=>xt()),r=await r,s(),r).format,{light:f,dark:w}=Z();M("light",f),M("dark",w);const{data:n,status:P}=([r,s]=k(()=>$t("performance-report",()=>_(`/report/${y}/performance`,{params:{...m.value}}),{watch:[m],deep:!0})),r=await r,s(),r),R=C(()=>{var b;return Object.values(((b=n.value)==null?void 0:b.platforms)??{}).some(x=>x==null?void 0:x.length)});return ot(P,b=>{b==="pending"?t(!0,"Generating Performance Report"):b==="success"?t(!1):b==="error"?(t(!1),h.error("Error generating performance report")):t(!1)}),(b,x)=>{const T=I,E=G,F=Bt,Y=_t,U=ft;return p(),S(U,{title:`Performance ${e(v)}`,description:"Performance Report",tabs:e(u),"top-only":""},{actions:c(()=>{var A;return[i("div",Nt,[e(n)?(p(),S(T,{key:0,disabled:!e(n).filters.platform.length,"organisation-id":e(y),"academic-year":e(n).filters.academicYear,academicYearStartMonth:e(g).academicYearStartMonth},null,8,["disabled","organisation-id","academic-year","academicYearStartMonth"])):it("",!0),o(E,{options:(A=e(n))==null?void 0:A.filters,"academic-year":!1,modelValue:e(m),"onUpdate:modelValue":x[0]||(x[0]=j=>ct(m)?m.value=j:null)},null,8,["options","modelValue"])])]}),default:c(()=>[e(n)&&e(R)?(p(),q("div",Pt,[o(F,{name:"Impressions",metric:"CPM",chart:e(n).charts.impressions,platforms:e(n).platforms.impressions,stats:e(n).stats.impressions,"date-formatter":e(l),"currency-formatter":e(d)},null,8,["chart","platforms","stats","date-formatter","currency-formatter"]),o(F,{name:"Clicks",metric:"CPC",chart:e(n).charts.clicks,platforms:e(n).platforms.clicks,stats:e(n).stats.clicks,"date-formatter":e(l),"currency-formatter":e(d)},null,8,["chart","platforms","stats","date-formatter","currency-formatter"]),o(F,{name:"Results",metric:"CPR",chart:e(n).charts.results,platforms:e(n).platforms.results,stats:e(n).stats.results,"date-formatter":e(l),"currency-formatter":e(d)},null,8,["chart","platforms","stats","date-formatter","currency-formatter"])])):(p(),q("div",Rt,[o(Y,null,{default:c(()=>[o(wt,{title:"This report is currently not available"})]),_:1})]))]),_:1},8,["title","tabs"])}}}
1,be=N(Tt,[["__scopeId","data-v-cbd002e0"]]);export{be 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.