OwlCyberSecurity - MANAGER
Edit File: LicenseConditions.D0P8U_He.js
import{b as k}from"./_baseClone.BiVlRo9x.js";import{u as D,e as x,D as m,x as p,g as d}from"./links.w575jfOL.js";import{n}from"./numbers.BT5e8rgb.js";import{C as F}from"./Tooltip.u2Cos2P_.js";import{_ as C}from"./_plugin-vue_export-helper.BN1snXvA.js";import{o as a,c as f,G as l,a as u,v as S,k as _,b as h,x as y,t as g,l as w,C as B}from"./runtime-dom.esm-bundler.CWn9hmRK.js";import{l as $}from"./license.BWlasdzY.js";var L=4;function z(t){return k(t,L)}const R={methods:{formatStatistic(t,e){return t==="ctr"?`${Math.abs(e)}%`:t==="position"?Math.abs(e).toFixed(0):t==="decay"?this.$t.sprintf(this.$t.__("%1$s Points",this.$td),n.numberFormat(e,0)):t==="decayPercent"?`${e}%`:(e=Math.abs(e),n.compactNumber(e))}}},v={props:{direction:{type:String,default(){return"down"}}}},N=u("path",{d:"M0.25 5.07812L5.25 0.078125L10.25 5.07812H0.25Z",fill:"currentColor"},null,-1),I=[N];function P(t,e,s,r,i,o){return a(),f("svg",{viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:l(["aioseo-caret-solid","aioseo-caret-solid--"+s.direction])},I,2)}const T=C(v,[["render",P]]),U={setup(){return{rootStore:D(),searchStatisticsStore:x()}},components:{CoreTooltip:F,SvgCaretSolid:T},mixins:[R],props:{total:[Number,String],difference:[Number,String],showCurrent:{type:Boolean,default(){return!0}},showDifference:{type:Boolean,default(){return!0}},showZeroValues:{type:Boolean,default(){return!1}},type:{type:String,required:!0},tooltipOffset:{type:String,default(){return"0,0"}}},computed:{differenceRounded(){return this.type==="position"?parseInt(Math.round(this.difference)):this.difference}},methods:{compareDescription(t,e){const s=e==="up"?this.$t.__("Up",this.$td):this.$t.__("Down",this.$td),r=this.searchStatisticsStore.shouldShowSampleReports?m.now().minus({days:14}).toFormat("yyyy-MM-dd"):this.searchStatisticsStore.range.compareStart,i=this.searchStatisticsStore.shouldShowSampleReports?m.now().minus({days:7}).toFormat("yyyy-MM-dd"):this.searchStatisticsStore.range.compareEnd,o=new Date(`${r} 00:00:00`),c=new Date(`${i} 00:00:00`);return this.$t.sprintf(this.$t.__("%1$s %2$s %3$s compared to the previous period (%4$s - %5$s)",this.$td),s,"<strong>"+this.points(t)+"</strong>",this.type==="position"?this.$t.__("in search results",this.$td):"","<strong>"+p(o,this.rootStore.aioseo.data.dateFormat)+"</strong>","<strong>"+p(c,this.rootStore.aioseo.data.dateFormat)+"</strong>")},points(t){switch(this.type){case"clicks":return this.$t.sprintf(this.$t._n("%s click","%s clicks",parseInt(this.formatStatistic("clicks",t)),this.$td),n.compactNumber(t));case"impressions":return this.$t.sprintf(this.$t._n("%s impression","%s impressions",parseInt(this.formatStatistic("impressions",t)),this.$td),n.compactNumber(t));case"ctr":return this.formatStatistic("ctr",t);case"position":return t=parseInt(Math.round(t)),this.$t.sprintf(this.$t._n("%s spot","%s spots",parseInt(this.formatStatistic("position",t)),this.$td),t);case"keywords":return this.$t.sprintf(this.$t._n("%s keyword","%s keywords",parseInt(this.formatStatistic("keywords",t)),this.$td),n.compactNumber(t));case"decay":case"diffDecay":return this.$t.sprintf(this.$t._n("%s point","%s points",parseInt(this.formatStatistic("keywords",t)),this.$td),n.compactNumber(t));default:return""}}}},V={key:0},A=["innerHTML"];function E(t,e,s,r,i,o){const c=S("svg-caret-solid"),M=S("core-tooltip");return a(),f("div",{class:l(["statistic",[{"no-margin":!s.showCurrent},`statistic-${s.type}`]])},[s.showCurrent&&(s.total||s.showZeroValues)?(a(),f("span",V,[u("span",{class:l(["statistic-direction",{up:0<s.total,down:0>s.total}])},[s.total!==0&&s.type==="decayPercent"?(a(),_(c,{key:0,direction:0<s.total?"up":"down"},null,8,["direction"])):h("",!0),y(" "+g(t.formatStatistic(s.type,s.total)),1)],2)])):h("",!0),s.showDifference&&o.differenceRounded!==0?(a(),_(M,{key:1,offset:s.tooltipOffset},{tooltip:w(()=>[u("span",{innerHTML:o.compareDescription(Math.abs(o.differenceRounded),0<o.differenceRounded?"up":"down")},null,8,A)]),default:w(()=>[u("span",{class:l(["statistic-direction",{up:0<o.differenceRounded,down:0>=o.differenceRounded}])},[B(c,{direction:0<o.differenceRounded?"up":"down"},null,8,["direction"]),y(" "+g(t.formatStatistic(s.type,o.differenceRounded)),1)],2)]),_:1},8,["offset"])):h("",!0)],2)}const Y=C(U,[["render",E]]),J={data(){return{orderBy:"clicks",orderDir:"desc",resultsPerPage:10,selectedFilters:{}}},methods:{getSeries(t){var r,i;if(2>((r=t.graph)==null?void 0:r.length))return[];const e=[];if(t.graph.forEach(o=>{e.includes(o.position)||e.push(o.position)}),e.length===1)return[];const s=D();return[{name:this.strings.position,data:(i=t.graph)==null?void 0:i.map(o=>({x:p(new Date(o.date+" 00:00:00"),s.aioseo.data.dateFormat),y:o.position}))}]},openPostDetail(t){this.$router.push({name:"post-detail",query:{postId:t.objectId,previousRoute:this.$route.name}})},processFilter(t){const e=d();this.showUpsell=(!this.$isPro||e.isUnlicensed)&&t.slug!=="all",this.processFilterTable(t)},processAdditionaFilterOptionSelected({name:t,selectedValue:e}){this.selectedFilters[t]=e}},mounted(){var t,e;this.orderBy=((t=this.defaultSorting)==null?void 0:t.orderBy)||this.orderBy,this.orderDir=((e=this.defaultSorting)==null?void 0:e.orderDir)||this.orderDir}},K={computed:{shouldShowLite(){return d().isUnlicensed}},methods:{shouldShowMain(t,e){return!d().isUnlicensed&&$.hasCoreFeature(t,e)},shouldShowUpgrade(t,e){return!d().isUnlicensed&&!$.hasCoreFeature(t,e)}}};export{K as L,Y as S,J as T,R as a,z as c};