1import{u as A,j as e}from"./query-vendor-B_C8B5sB.js";import{r as u,L as y}from"./react-vendor-B23zaUj-.js";import{c as S,u as f,a as c,b as h,F as C,A as M,g as F,L as T,G as N,B as E,M as L,U as P,d as p,e as _,f as q,E as R,Z as O,P as v,T as D,S as z,p as B}from"./index-I1ewQokE.js";import{A as U}from"./AddDomainModal-BEVjpB2m.js";import{o as $}from"./freeReportView-BVv26I_W.js";import{p as I,M as H}from"./MonitorEye-CWoGjtzB.js";import{C as Q}from"./clock-DxpF_8-g.js";import{P as G}from"./PageHeader-B38YcIvl.js";import{M as K}from"./MinimalFooter-Bf5GYT28.js";import{u as W,M as Z}from"./SwitchOnChargeNote-uSqb0iOs.js";import"./ui-vendor-CYC2HZ_g.js";import"./supabase-vendor-BeaikSuM.js";import"./checkbox-AL6oUHsm.js";import"./index-BSJGTuI0.js";import"./select-DuInoiSZ.js";import"./alert-ZrDf5Rai.js";import"./usePageRestored-L5SnzlLY.js";import"./domainValidation-CsYHwi51.js";import"./circle-alert-CmWFjub3.js";import"./monitorSelection-D6HJyx1c.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const V=S("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);function Y({offer:s,serverOffsetMs:t,clientNowMs:a}
6){if(s){const i=$({expires_at:s.expires_at,expired:!1},t,a);if(!i.expired)return{kind:"offer",domain:s.domain,price:s.offer_price,window:i}}return null}const J=["free-report","active-offer"];function X(){const{t:s}=f("dashboard"),t=A({queryKey:J,queryFn:F}),[a,i]=u.useState(0),r=t.data??null,l=r?Date.parse(r.server_now)-t.dataUpdatedAt:0,n=t.isPending?null:Y({offer:r,serverOffsetMs:l,clientNowMs:Date.now()}),o=n?n.window.nextChangeMs:null;if(u.useEffect(()=>{if(o===null)return;const m=setTimeout(()=>i(x=>x+1),Math.min(o,6e4));return()=>clearTimeout(m)},[a,o]),n===null)return null;const{window:d}=n;return e.jsxs(y,{to:`/free-report/${n.domain}`,className:c(h,"p-4 mb-6 flex flex-col sm:flex-row sm:items-center gap-3 group hover:border-violet-300 dark:hover:border-violet-600"),children:[e.jsx(C,{className:"h-5 w-5 text-violet-600 dark:text-violet-400 shrink-0"}),e.jsx("span",{className:"flex-1 min-w-0 text-sm font-medium text-slate-900 dark:text-white",children:d.lastDay?s("index.freeReportCard.offerLastDay",{domain:n.domain,price:n.price,hours:d.hoursLeft,minutes:d.minutesLeft}):s("index.freeReportCard.offer",{domain:n.domain,price:n.price,count:d.daysLeft})}),e.jsx(M,{className:"h-4 w-4 text-slate-400 group-hover:text-violet-600 shrink-0"})]})}const ee=({domain:s})=>{var n,o,d,m,x,g,b,j;const{t}=f("dashboard"),[a,i]=u.useState(!1),r=I(s.postureScore,s.status),l=r.state==="queued"?{icon:e.jsx(V,{className:"h-3.5 w-3.5"}),label:t("domainCard.status.queued"),style:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border-indigo-500/30"}:r.state==="analyzing"?{icon:e.jsx(T,{className:"h-3.5 w-3.5 animate-spin"}),label:((n=s.analysisProgress)==null?void 0:n.phase)||t("domainCard.status.analyzing"),style:"bg-slate-500/10 text-slate-500 dark:text-slate-400 border-slate-500/30"}:null;return e.jsxs("div",{className:c(h,"p-5 group cursor-pointer"),onClick:()=>{},children:[e.jsxs(y,{to:`/domain/${s.name}`,className:"block",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center shadow-md shadow-blue-500/20 group-hover:shadow-lg group-hover:shadow-blue-500/30 transition-shadow duration-300 overflow-hidden",children:a?e.jsx(N,{className:"h-5 w-5 text-white"}):e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${s.name}&sz=64`,alt:"",className:"w-8 h-8",onError:()=>i(!0)})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:s.name}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500 dark:text-slate-400",children:[e.jsx(Q,{className:"h-3 w-3"}),e.jsx("span",{children:s.lastScanned})]})]})]}),l&&e.jsxs(E,{variant:"outline",className:c("flex items-center gap-1.5 px-2.5 py-1 text-xs font-semibold border",l.style),children:[l.icon,l.label]})]}),e.jsx("div",{className:"mb-4",children:r.state==="queued"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-between items-center text-sm mb-2",children:e.jsx("span",{className:"text-indigo-600 dark:text-indigo-400 font-medium",children:t("domainCard.queuedMessage","Waiting in queue...")})}),e.jsx("div",{className:"h-2 bg-indigo-100 dark:bg-indigo-900/30 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full w-full rounded-full bg-gradient-to-r from-indigo-400/40 to-indigo-500/40 animate-pulse"})})]}):r.state==="analyzing"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center text-sm mb-2",children:[e.jsx("span",{className:"text-slate-600 dark:text-slate-400 font-medium",children:((o=s.analysisProgress)==null?void 0:o.phase)||t("domainCard.status.analyzing")}),e.jsxs("span",{className:"text-slate-500 dark:text-slate-400 font-semibold text-xs",children:[((d=s.analysisProgress)==null?void 0:d.percentage)??0,"%"]})]}),e.jsx("div",{className:"h-2 bg-slate-100 dark:bg-slate-700/50 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-700 ease-out bg-gradient-to-r from-blue-500 to-purple-500",style:{width:`${((m=s.analysisProgress)==null?void 0:m.percentage)??0}%`}})})]}):r.state==="unscored"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center text-sm mb-2",children:[e.jsx("span",{className:"text-slate-600 dar
6k:text-slate-400 font-medium",children:t("domainCard.postureScore")}),e.jsx("span",{className:"text-slate-400 dark:text-slate-500 font-medium text-xs",children:t("domainCard.status.unscored")})]}),e.jsx("div",{className:"h-2 bg-slate-100 dark:bg-slate-700/50 rounded-full overflow-hidden"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center text-sm mb-2",children:[e.jsx("span",{className:"text-slate-600 dark:text-slate-400 font-medium",children:t("domainCard.postureScore")}),e.jsxs("span",{className:"font-bold text-slate-900 dark:text-white",children:[r.score,e.jsx("span",{className:"text-slate-400 font-normal",children:"/100"})]})]}),e.jsx("div",{className:"h-2 bg-slate-100 dark:bg-slate-700/50 rounded-full overflow-hidden",children:e.jsx("div",{className:c("h-full rounded-full transition-all duration-700 ease-out bg-gradient-to-r",r.gradient),style:{width:`${r.score}%`}})})]})}),e.jsxs("div",{className:"flex items-center justify-between py-3 px-3 -mx-1 rounded-lg bg-slate-50/80 dark:bg-slate-900/40 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-600 dark:text-slate-300",children:[e.jsx(L,{className:"h-3.5 w-3.5 text-blue-500"}),e.jsx("span",{className:"font-semibold",children:((x=s.counts)==null?void 0:x.emails)??"â"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-600 dark:text-slate-300",children:[e.jsx(P,{className:"h-3.5 w-3.5 text-emerald-500"}),e.jsx("span",{className:"font-semibold",children:((g=s.counts)==null?void 0:g.people)??"â"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-600 dark:text-slate-300",children:[e.jsx(C,{className:"h-3.5 w-3.5 text-amber-500"}),e.jsx("span",{className:"font-semibold",children:((b=s.counts)==null?void 0:b.files)??"â"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-600 dark:text-slate-300",children:[e.jsx(N,{className:"h-3.5 w-3.5 text-purple-500"}),e.jsx("span",{className:"font-semibold",children:((j=s.counts)==null?void 0:j.subdomains)??"â"})]})]}),e.jsxs("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:[e.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-200",children:s.entitiesFound.toLocaleString()})," ",t("domainCard.entities")]})]}),e.jsxs(p,{variant:"ghost",className:"w-full justify-between text-sm font-medium text-slate-600 dark:text-slate-300 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50/50 dark:hover:bg-blue-900/20 group/btn",children:[e.jsx("span",{children:t("domainCard.viewDetails")}),e.jsx(M,{className:"h-4 w-4 transition-transform duration-300 group-hover/btn:translate-x-1"})]})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-slate-200/60 dark:border-slate-700/60 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t("domainCard.monitor.title")}),e.jsx(H,{domain:s.name})]})]})},w="text-slate-600 dark:text-slate-400 bg-slate-100/60 dark:bg-slate-800/60 border-slate-200/50 dark:border-slate-700/40",k="inline-flex items-center gap-2 px-3 py-1.5 rounded-full border text-xs font-medium transition-colors cursor-pointer hover:opacity-80";function se(){const{t:s}=f("dashboard"),{open:t}=_(),{loading:a,status:i,monitoring:r,oneShot:l}=q();if(a||!i)return null;const n=r.active,o=l.credits>0;return!n&&!o?null:e.jsxs("div",{className:"flex items-center gap-2",children:[n&&e.jsxs("button",{type:"button",onClick:()=>t({reason:"upgrade"}),className:c(k,w),children:[e.jsx(R,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:s("quota.monitoringLabel")}),e.jsx("span",{className:"font-semibold tabular-nums",children:r.count})]}),o&&e.jsxs("button",{type:"button",onClick:()=>t({reason:"upgrade"}),className:c(k,w),children:[e.jsx(O,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:s("quota.oneShotLabel")}),e.jsx("span",{className:"font-semibold tabular-nums",children:l.credits})]})]})}const te=(s,t)=>{const a=[];return s.emails>0&&a.push(t("index.exposureTypes.emails",{ns:"dashboard"})),s.people>0&&a.push(t("index.exposureTypes.people",{ns:"dashboard"})),s.subdomains>0&&a.push(t("index.exposureTypes.subdomains",{ns:"dashboard"})),s.files>0&&a.push(t("index.exposureTypes.files",{ns:"dashboard"})),s.usernames>0&&a.push(t("index.exposureTypes.usernames",{ns:"dashboard"})),a},ae=(s,t)=>{const a=new Date(s),r=new Date().getTime()-a.getTime(),l=Math.floor(r/(1e3*60*60*24)),n=Math.floor(r/(1e3*60*60)),o=Math.floor(r/(1e3*60));return o<60?t("index.timeAgo.minutesAgo",{count:o,ns:"dashboard"}):n<24?t("index.timeAgo.hoursAgo",{count:n,ns:"dashboard"}):l===1?t("index.timeAgo.oneDayAgo",{ns:"dashboard"}):l<7?t("index.timeAgo.daysAgo",{count:l,ns:"dashboard"}):a.toLocaleDateString()},re=(s,t)=>{const a=s.counts.emails+s.counts.people+s.counts.subdomains+s.counts.files+s.counts.usernames;return{id:s.domain,name:s.domain,status:s.status,postureScore:s.posture_score,lastScanned:s.last_analyzed?ae(s.last_analyzed,t):t("index.timeAgo.never",{ns:"dashboard"}),entitiesFound:a,exposureTypes:te(s.counts,t),counts:{emails:s.counts.emails,people:s.counts.people,subdomains:s.counts.subdomains,files:s.counts.files},analysisProgress:s.analysis_progress}},Ce=()=>{const{t:s}=f("dashboard"),[t,a]=u.useState(!1),{domains:i,loading:r,error:l,refetch:n}=W(),o=u.useCallback(x=>re(x,s),[s]),d=u.useMemo(()=>i.map(o),[i,o]),m=()=>{n()};return e.jsx(Z,{children:e.jsxs("div",{className:c(B,"min-h-screen flex flex-col"),children:[e.jsx(G,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{}),e.jsxs(p,{onClick:()=>a(!0),className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-500 hover:to-purple-500 text-white shadow-lg shadow-blue-500/25 hover:shadow-xl hover:shadow-blue-500/30 transition-all duration-300",children:[e.jsx(v,{className:"h-4 w-4 mr-2"}),s("index.addDomain")]})]})}),e.jsxs("div",{className:"flex-1 p-6 max-w-7xl mx-auto w-full",children:[e.jsx(X,{}),r?e.jsxs("div",{className:c(h,"p-12 text-center"),children:[e.jsx(T,{className:"h-12 w-12 animate-spin text-blue-600 mx-auto mb-4"}
6),e.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:s("index.loading")})]}):l?e.jsxs("div",{className:c(h,"p-12 text-center"),children:[e.jsx(D,{className:"h-12 w-12 text-orange-500 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white mb-2",children:s("index.errorTitle")}),e.jsx("p",{className:"text-slate-600 dark:text-slate-400 mb-4",children:l}),e.jsx(p,{onClick:n,variant:"outline",children:s("index.tryAgain")})]}):d.length===0?e.jsxs("div",{className:c(h,"p-12 text-center"),children:[e.jsx(z,{className:"h-12 w-12 text-slate-400 dark:text-slate-500 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white mb-2",children:s("index.emptyTitle")}),e.jsx("p",{className:"text-slate-600 dark:text-slate-400 mb-4",children:s("index.emptyDescription")}),e.jsxs(p,{onClick:()=>a(!0),className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-500 hover:to-purple-500 text-white",children:[e.jsx(v,{className:"h-4 w-4 mr-2"}),s("index.addFirstDomain")]})]}):e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:d.map(x=>e.jsx(ee,{domain:x},x.id))})]}),e.jsx(K,{}),e.jsx(U,{isOpen:t,onClose:()=>a(!1),onAdd:m})]})})};export{Ce as default}; 7//# sourceMappingURL=Index-BhTZfZQM.js.map
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.