https://www.bosscoderacademy.com/_next/static/chunks/pages/admin/email-open-rate-9b81b0974aeb75ec.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[23709],{6257:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/email-open-rate",function(){return r(23206)}])},59813:function(e,t,r){"use strict";var a=r(85893);t.Z=function(){return(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-400 hover:text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}},15150:function(e,t,r){"use strict";r.d(t,{l:function(){return s}});var a=r(85893),l=r(59813);r(67294);let s=e=>{let{label:t,options:r,value:s,onChange:n,multiple:o=!1,className:i="",placeholder:d="Select an option",required:c=!1,tooltip:u,disabled:x=!1}=e,m=!r.some(e=>e.value===s);return(0,a.jsxs)("div",{className:i,children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:[t,c&&(0,a.jsx)("span",{className:"text-red-500",children:" *"})]}),u&&(0,a.jsxs)("div",{className:"group relative ml-2",children:[(0,a.jsx)(l.Z,{}),(0,a.jsx)("div",{className:"absolute z-10 hidden w-64 rounded border border-gray-300 bg-white p-2 text-xs text-gray-600 shadow-lg group-hover:block",children:u})]})]}),(0,a.jsxs)("select",{multiple:o,value:s,onChange:e=>{n(e.target.value)},disabled:x,className:"mt-1 block w-full rounded-md border border-gray-300 p-2 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm ".concat(x?"cursor-not-allowed bg-gray-100 text-gray-500":""),required:c,children:[(0,a.jsx)("option",{value:"",disabled:!0,hidden:!m,children:d}),r.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))]})]})}},99886:function(e,t,r){"use strict";r.d(t,{W:function(){return l}});var a=r(85893);r(67294);let l=e=>{let{label:t,value:r,onChange:l,required:s=!1,className:n="",tooltip:o}=e;return(0,a.jsxs)("div",{className:"flex flex-col ".concat(n),children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsxs)("label",{className:"text-sm font-semibold text-gray-700",children:[t,s&&(0,a.jsx)("span",{className:"text-red-500",children:" *"})]}),o&&(0,a.jsxs)("div",{className:"group relative ml-2",children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 cursor-pointer text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M12 20h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,a.jsx)("div",{className:"absolute z-10 hidden w-64 rounded border border-gray-300 bg-white p-2 text-xs text-gray-600 shadow-lg group-hover:block",children:o})]})]}),(0,a.jsx)("input",{type:"date",value:r||"",onChange:e=>l(e.target.value),required:s,className:"mt-1 rounded-lg border border-gray-300 p-2 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 sm:text-sm"})]})}},31134:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var a=r(67294);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),n=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},o=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()};var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let d=(0,a.forwardRef)((e,t)=>{let{color:r="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:d="",children:c,iconNode:u,...x}=e;return(0,a.createElement)("svg",{ref:t,...i,width:l,height:l,stroke:r,strokeWidth:n?24*Number(s)/Number(l):s,className:o("lucide",d),...x},[...u.map(e=>{let[t,r]=e;return(0,a.createElement)(t,r)}),...Array.isArray(c)?c:[c]])}),c=(e,t)=>{let r=(0,a.forwardRef)((r,s)=>{let{className:i,...c}=r;return(0,a.createElement)(d,{ref:s,iconNode:t,className:o("lucide-".concat(l(n(e))),"lucide-".concat(e),i),...c})});return r.displayName=n(e),r}},78497:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});let a=(0,r(31134).Z)("menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},23206:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return x}});var a=r(85893),l=r(67294),s=r(97629),n=r(1672),o=r(9008),i=r.n(o),d=r(15150),c=r(99886);let u=[{value:"All",label:"All Categories"},{value:"Evolve",label:"Evolve"},{value:"Transformer",label:"Transformer"},{value:"Data Analytics",label:"Data Analytics"},{value:"Data Science",label:"Data Science"},{value:"Data Engineer",label:"Data Engineer"},{value:"US Lead - Elite",label:"US Lead - Elite"}];function x(){let[e,t]=(0,l.useState)(!1),[r,s]=(0,l.useState)(null),[o,x]=(0,l.useState)(null),[m,h]=(0,l.useState)(""),[p,g]=(0,l.useState)(null),b=async()=>
1{if(r&&o&&m){t(!0),g(null);try{let e=new URLSearchParams({startDate:r,endDate:o,category:m}),t=await fetch("/api/admin/email-open-rate?".concat(e.toString()));if(!t.ok)throw Error("Failed to fetch summary");let a=await t.json();g(a)}catch(e){console.error("Error fetching summary:",e),g(null)}finally{t(!1)}}},v=!r||!o||!m;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i(),{children:[(0,a.jsx)("title",{children:"Email Open Rate Dashboard | Bosscoder Academy"}),(0,a.jsx)("meta",{name:"description",content:"View detailed analytics of sent and opened emails per category and date range."})]}),(0,a.jsxs)("div",{className:"mx-auto max-w-6xl p-8",children:[(0,a.jsx)("h1",{className:"mb-8 text-3xl font-extrabold tracking-tight text-blue-700",children:"Bosscoder Academy â Email Analytics Dashboard"}),(0,a.jsxs)("div",{className:"mb-8 flex flex-wrap items-end gap-5 rounded-xl bg-blue-50 p-5 shadow-sm",children:[(0,a.jsx)(d.l,{label:"Category",options:u,value:m,onChange:h,placeholder:"Select Category",className:"w-56",required:!0,tooltip:"Choose a category or pick 'All Categories' to aggregate everything."}),(0,a.jsx)(c.W,{label:"Start Date",value:r,onChange:s,required:!0,className:"w-40",tooltip:"Select the start date for your analytics range."}),(0,a.jsx)(c.W,{label:"End Date",value:o,onChange:x,required:!0,className:"w-40",tooltip:"Select the end date for your analytics range."}),(0,a.jsx)("button",{onClick:b,disabled:v,className:"".concat(v?"cursor-not-allowed bg-gray-400":"bg-blue-600 hover:bg-blue-700"," mt-6 rounded-lg px-6 py-2.5 font-semibold text-white shadow transition-all duration-300"),children:"Fetch Stats"})]}),e&&(0,a.jsx)("div",{className:"mb-6 h-2 w-full overflow-hidden rounded-full bg-gray-200",children:(0,a.jsx)(n.E.div,{className:"h-2 bg-blue-600",initial:{width:0},animate:{width:"100%"},transition:{duration:1.5,repeat:1/0,repeatType:"reverse"}})}),!e&&p&&(0,a.jsxs)("div",{className:"mb-6 grid grid-cols-1 gap-6 sm:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-blue-100 bg-white p-6 shadow-sm",children:[(0,a.jsx)("p",{className:"mb-1 font-medium text-gray-500",children:"\uD83D\uDCE8 Total Emails Sent"}),(0,a.jsx)("p",{className:"text-3xl font-extrabold text-blue-700",children:p.totalEmailSent})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-green-100 bg-white p-6 shadow-sm",children:[(0,a.jsx)("p",{className:"mb-1 font-medium text-gray-500",children:"\uD83D\uDCEC Total Emails Opened"}),(0,a.jsx)("p",{className:"text-3xl font-extrabold text-green-700",children:p.totalEmailOpened})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-purple-100 bg-white p-6 shadow-sm",children:[(0,a.jsx)("p",{className:"mb-1 font-medium text-gray-500",children:"\uD83D\uDCC8 Overall Open Rate"}),(0,a.jsx)("p",{className:"text-3xl font-extrabold text-purple-700",children:p.overallOpenRate})]})]}),!e&&p&&(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full table-auto border-collapse rounded-lg border border-gray-200",children:[(0,a.jsx)("thead",{className:"bg-blue-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"border px-4 py-2",children:"Email"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Sent Count"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Opened Count"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Open Rate"})]})}),(0,a.jsx)("tbody",{children:Object.entries(p.perEmailStats).map(e=>{let[t,r]=e,l=r.sent>0?(r.opened/r.sent*100).toFixed(2)+"%":"0%";return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"border px-4 py-2",children:t}),(0,a.jsx)("td",{className:"border px-4 py-2",children:r.sent}),(0,a.jsx)("td",{className:"border px-4 py-2",children:r.opened}),(0,a.jsx)("td",{className:"border px-4 py-2",children:l})]},t)})})]})}),!e&&!p&&(0,a.jsx)("div",{className:"mt-8 text-center text-gray-500",children:"Select a category and date range to view analytics."})]})]})}x.getLayout=e=>(0,a.jsx)(s.Z,{children:e})}},function(e){e.O(0,[25675,1672,97629,92888,49774,40179],function(){return e(e.s=6257)}),_N_E=e.O()}]);
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.