1import c from"./Filters-bWcviPjW.js";import{_ as m,o as h,c as g,a as t,t as r,i}from"./app-DVhk9hEg.js";import"./dialog-B1KZN6xf.js";import"./keyboard-BzxerdJT.js";import"./transition-CLaDrR5O.js";import"./XMarkIcon-B221X_Ru.js";import"./listbox-BkFxtIHv.js";import"./use-resolve-button-type-CpPrrBwU.js";/* empty css */const p={name:"Statistics",components:{Filters:c},props:["leads"],data(){return{lastweek:null,secondweek:null,today:null,persentToday:null,persentWeek:null,yesterday:null,date:null}},methods:{getDayOnlyDate(s){return s.split(" ")[0]},todayDate(){const s=new Date,e=s.getFullYear(),o=String(s.getMonth()+1).padStart(2,"0"),n=String(s.getDate()).padStart(2,"0");return`${e}-${o}-${n}`},yesterdayDate(){const s=new Date;s.setDate(s.getDate()-1);const e=s.getFullYear(),o=String(s.getMonth()+1).padStart(2,"0"),n=String(s.getDate()).padStart(2,"0");return`${e}-${o}-${n}`},percentDate(s,e){return s==0|e==0?0:e/s},oneDay(s){let e=0,o=0;const n=this.todayDate(),a=this.yesterdayDate();s.forEach(l=>{let d=this.getDayOnlyDate(l.created_at);n==d&&(e+=1),a==d&&(o+=1)}),this.today=e,this.yesterday=o},secondWeek(s){let e=0;const o=new Date,n=new Date(o);n.setDate(n.getDate()-14),s.forEach(a=>{let l=new Date(this.getDayOnlyDate(a.created_at));l>=n&&l<=o&&(e+=1)}),this.secondweek=e},oneWeek(s){let e=0;const o=new Date,n=new Date(o);n.setDate(n.getDate()-7),s.forEach(a=>{let l=new Date(this.getDayOnlyDate(a.created_at));l>=n&&l<=o&&(e+=1)}),this.lastweek=e}},mounted(){const s=this.leads.data;this.oneDay(s),this.oneWeek(s),this.secondWeek(s),this.persentToday=this.percentDate(this.today,this.yesterday),this.persentWeek=this.percentDate(this.lastweek,this.secondweek)}},v={class:"mt-6 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3"},x={class:"rounded-2xl border border-gray-200 bg-white p-6 shadow-sm transition-all duration-300 hover:shadow-md"},w={class:"flex items-center justify-between"},y={class:"flex items-center gap-4"},f={class:"text-sm font-medium text-gray-500"},u={class:"mt-1 text-2xl font-bold tracking-tight text-gray-900"},k={class:"flex flex-col items-end"},D={class:"inline-flex items-center gap-1 rounded-full bg-green-100 px-2.5 py-1 text-sm font-semibold text-green-600"},_={class:"rounded-2xl border border-gray-200 bg-white p-6 shadow-sm transition-all duration-300 hover:shadow-md"},b={class:"flex items-center justify-between"},A={class:"flex items-center gap-4"},M={class:"text-sm font-medium text-gray-500"},Z={class:"mt-1 text-2xl font-bold tracking-tight text-gray-900"},V={class:"flex flex-col items-end"},W={class:"inline-flex items-center gap-1 rounded-full bg-green-100 px-2.5 py-1 text-sm font-semibold text-green-600"},S={class:"rounded-2xl border border-gray-200 bg-white p-6 shadow-sm transition-all duration-300 hover:shadow-md"},$={class:"flex items-center justify-between"},H={class:"flex items-center gap-4"},j={class:"text-sm font-medium text-gray-500"},B={class:"mt-1 text-2xl font-bold tracking-tight text-gray-900"},O={class:"flex flex-col items-end"},C={class:"inline-flex items-center gap-1 rounded-full bg-green-100 px-2.5 py-1 text-sm font-semibold text-green-600"};function L(s,e,o,n,a,l){return h(),g("dl",v,[t("div",x,[t("div",w,[t("div",y,[e[0]||(e[0]=t("div",{class:"flex h-14 w-14 items-center justify-center rounded-xl bg-indigo-50"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-7 w-7 text-indigo-600"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3v11.25A2.25 2.25 0 0 0 6 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0 1 18 16.5h-2.25m-7.5 0h7.5m-7.5 0-1 3m8.5-3 1 3m0 0 .5 1.5m-.5-1.5h-9.5m0 0-.5 1.5M9 11.25v1.5M12 9v3.75m3-6v6"})])],-1)),t("div",null,[t("p",f,r(s.$page.props.translations.messages.total_records),1),t("h2",u,r(o.leads.meta.total),1)])]),t("div",k,[t("div",D,[e[1]||(e[1]=t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20"},[t("path",{"fill-rule":"evenodd",d:"M10 17a.75.75 0 01-.75-.75V5.61L5.29 9.77a.75.75 0 11-1.08-1.04l5.25-5.5a.75.75 0 011.08 0l5.25 5.5a.75.75 0 01-1.08 1.04L10.75 5.6v10.65A.75.75 0 0110 17z","clip-rule":"evenodd"})],-1)),i(" "+r(`${a.persentWeek}
1`.slice(0,4))+"% ",1)]),e[2]||(e[2]=t("span",{class:"mt-2 text-xs text-gray-400 pr-2"}," all time ",-1))])])]),t("div",_,[t("div",b,[t("div",A,[e[3]||(e[3]=t("div",{class:"flex h-14 w-14 items-center justify-center rounded-xl bg-violet-50"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"h-7 w-7 text-violet-600",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})])],-1)),t("div",null,[t("p",M,r(s.$page.props.translations.messages.week),1),t("h2",Z,r(a.lastweek),1)])]),t("div",V,[t("div",W,[e[4]||(e[4]=t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20"},[t("path",{"fill-rule":"evenodd",d:"M10 17a.75.75 0 01-.75-.75V5.61L5.29 9.77a.75.75 0 11-1.08-1.04l5.25-5.5a.75.75 0 011.08 0l5.25 5.5a.75.75 0 01-1.08 1.04L10.75 5.6v10.65A.75.75 0 0110 17z","clip-rule":"evenodd"})],-1)),i(" "+r(`${a.persentWeek}`.slice(0,4))+"% ",1)]),e[5]||(e[5]=t("span",{class:"mt-2 text-xs text-gray-400 pr-2"}," last week ",-1))])])]),t("div",S,[t("div",$,[t("div",H,[e[6]||(e[6]=t("div",{class:"flex h-14 w-14 items-center justify-center rounded-xl bg-orange-50"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-7 w-7 text-orange-500",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 14.25v2.25m3-4.5v4.5m3-6.75v6.75m3-9v9M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"})])],-1)),t("div",null,[t("p",j,r(s.$page.props.translations.messages.today),1),t("h2",B,r(a.today),1)])]),t("div",O,[t("div",C,[e[7]||(e[7]=t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20"},[t("path",{"fill-rule":"evenodd",d:"M10 17a.75.75 0 01-.75-.75V5.61L5.29 9.77a.75.75 0 11-1.08-1.04l5.25-5.5a.75.75 0 011.08 0l5.25 5.5a.75.75 0 01-1.08 1.04L10.75 5.6v10.65A.75.75 0 0110 17z","clip-rule":"evenodd"})],-1)),i(" "+r(`${a.persentToday}`.slice(0,4))+"% ",1)]),e[8]||(e[8]=t("span",{class:"mt-2 text-xs text-gray-400 pr-2"}," today ",-1))])])])])}const I=m(p,[["render",L]]);export{I 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.