1import{c as i,r as p,G as k,S as P,j as e,X as E}from"./index-C0be5Gnz.js";import{S as R}from"./shield-check-B9dtRn4L.js";import{L as z}from"./lock-hX9XrVXV.js";import{S as T}from"./server-DWcrFYVa.js";import{E as $}from"./eye-a0ql8xWp.js";import{A as G}from"./activity-CifMurdj.js";import{L as O}from"./loader-circle-DR-djD9N.js";import{C as w}from"./circle-x-DrRSV6p2.js";import{C}from"./chevron-down-DqFWFJeP.js";const q=i("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const F=i("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const H=i("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const L=i("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);const B=i("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
1],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);const I=i("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const U=i("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);const _=i("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);const V=i("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);const W=i("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);const Z=i("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const X=i("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),g=[{id:1,name:"India",icon:k,url:"https://coednssecurity.in/healthmediator/top25"},{id:2,name:"World",icon:L,url:"https://coednssecurity.in/healthmediator/world25"},{id:3,name:"Canada",icon:P,url:"https://coednssecurity.in/healthmediator/top25canada"},{id:4,name:"USA",icon:R,url:"https://coednssecurity.in/healthmediator/top25usa"},{id:5,name:"Banking",icon:z,url:"https://coednssecurity.in/healthmediator/top25bank"},{id:6,name:"Payments",icon:T,url:"https://coednssecurity.in/healthmediator/upi"},{id:7,name:"Cab Booking",icon:$,url:"https://coednssecurity.in/healthmediator/travel"},{id:8,name:"Travel & Transport",icon:X,url:"https://coednssecurity.in/healthmediator/ticket"},{id:9,name:"Examination",icon:G,url:"https://coednssecurity.in/healthmediator/result"},{id:10,name:"Entertainment",icon:V,url:"https://coednssecurity.in/healthmediator/ott"},{id:11,name:"Food Delivery",icon:W,url:"https://coednssecurity.in/healthmediator/ordering"},{id:12,name:"Daily Essentials",icon:I,url:"https://coednssecurity.in/healthmediator/essential"},{id:13,name:"Certifying Auth.",icon:Z,url:"https://coednssecurity.in/healthmediator/crypto"},{id:14,name:"Courier Delivery",icon:U,url:"https://coednssecurity.in/healthmediator/courier"},{id:15,name:"Gaming",icon:B,url:"https://coednssecurity.in/healthmediator/gaming"},{id:16,name:"Broadband",icon:_,url:"https://coednssecurity.in/healthmediator/broadband"}],f=8,v=10,N={};function K(t){const o=Object.keys(t)[0];if(!o)return[];const a=t[o];return Array.isArray(a)?a.map(r=>{const n=Object.keys(r)[0],x=r[n].map(l=>{const d=Object.keys(l)[0],m=l[d];return{nsName:d,score:m[0],data:m[1]}});return{domainName:n,nameservers:x}}):[]}function M(t){return t>=6?"bg-green-500/10 border-green-500/30 text-green-500":t>=4?"bg-yellow-500/10 border-yellow-500/30 text-yellow-500":"bg-red-500/10 border-red-500/30 text-red-500"}const J=({value:t})=>t===void 0||t===""||t==="NA"?e.jsx("div",{className:"text-muted-foreground font-medium text-[10px]",children:"NA"}):t==="pass"?e.jsx(H,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):e.jsx(w,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),Q=({rtt:t,absrtt:o})=>{const a=Math.abs(t-o).toFixed(2);return t>o?e.jsxs("span",{className:"flex items-center gap-1 text-green-500 font-medium text-sm",children:[e.jsx(F,{className:"w-3.5 h-3.5"}),t.toFixed(2),"ms",e.jsxs("span",{className:"text-xs opacity-70",children:["(+",a,")"]})]}):e.jsxs("span",{className:"flex items-center gap-1 text-red-500 font-medium text-sm",children:[e.jsx(q,{className:"w-3.5 h-3.5"}),t.toFixed(2),"ms",e.jsxs("span",{className:"text-xs opacity-70",children:["(-",a,")"]})]})},Y=()=>e.jsx("div",{className:"space-y-3",children:Array.from({length:6}).map((t,o)=>e.jsx("div",{className:"h-12 rounded-xl bg-gradient-to-r from-muted/40 via-muted/70 to-muted/40 animate-pulse",style:{animationDelay:`${o*.08}s`}},o))}),ee=({ns:t})=>{const o=[{label:"Availability",value:t.data.availability},{label:"TCP v4",value:t.data.tcpv4},{label:"TCP v6",value:t.data.tcpv6},{label:"UDP v4",value:t.data.udpv4},{label:"UDP v6",value:t.data.udpv6},{label:"SW Abstraction",value:t.data.sobs},{label:"Zone Transfer",value:t.data.zt},{label:"Recursion",value:t.data.rq},{label:"DNSSEC",value:t.data.dnssec}];return e.jsxs("div",{className:"bg-background/50 border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[e.jsx("span",{className:"flex-1 text-xs font-mono text-foreground truncate",children:t.nsName}),e.jsxs("span",{className:`text-xs font-semibold border rounded-full px-2 py-0.5 ${M(t.score)}`,children:[t.score,"/9"]})]}),e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-5 lg:grid-cols-9 gap-x-2 gap-y-3",children:o.map(a=>e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground text-center leading-tight whitespace-nowrap",children:a.label}),e.jsx(J,{value:a.value})]},a.label))}),e.jsxs("div",{className:"flex items-center gap-3 mt-3 pt-3 border-t border-border/50",children:[e.jsx("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:"Round Trip Time"}),e.jsx(Q,{rtt:t.data.rtt,absrtt:t.data.absrtt})]})]})]})},te=({nameservers:t})=>{const[o,a]=p.useState(null);return e.jsx("div",{className:"space-y-2 px-4 pb-4 pt-2",children:t.map(r=>{const n=o===r.nsName;return e.jsxs("div",{className:"border border-border rounded-xl overflow-hidden",children:[e.jsxs("button",{className:"w-full flex items-center gap-3 px-4 py-2.5 bg-background/50 hover:bg-primary/5 transition-colors text-left",onClick:()=>a(n?null:r.nsName),children:[e.jsx("span",{className:"flex-1 text-xs font-mono text-foreground truncate",children:r.nsName}),e.jsxs("span",{className:`text-xs font-semibold border rounded-full px-2 py-0.5 ${M(r.score)}`,children:[r.score,"/9"]}),e.jsx(C,{className:`w-4 h-4 text-muted-foreground flex-shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&e.jsx("div",{className:"p-3 bg-background/30 border-t border-border",children:e.jsx(ee,{ns:r})})]},r.nsName)})})},re=({domains:t})=>{const[o,a]=p.useState(null),[r,n]=p.useState(0),c=Math.ceil(t.length/v),x=t.slice(r*v,(r+1)*v),l=d=>{n(d),a(null)};return e.jsxs("div",{children:[e.jsx("div",{className:"space-y-2 mb-4",children:x.map(d=>{const m=o===d.domainName;return e.jsxs("div",{className:"border border-border rounded-xl overflow-hidden",children:[e.jsxs("button",{className:"w-full flex items-center gap-3 px-4 py-3 bg-card-gradient hover:bg-primary/5 transition-colors text-left",onClick:()=>a(m?null:d.domainName),children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-foreground",children:d.domainName}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-muted/50 px-2 py-0.5 rounded-full",children:[d.nameservers.length," NS"]}),e.jsx(C,{className:`w-4 h-4 text-muted-foreground flex-shrink-0 transition-transform duration-200 ${m?"rotate-180":""}`})]}),m&&e.jsx(te,{nameservers:d.nameservers})]},d.domainName)})}),c>1&&e.jsxs("div",{className:"flex items-center justify-center gap-3 pt-3 border-t border-border",children:[e.jsx("button",{onClick:()=>l(Math.max(0,r-1)),disabled:r===0,className:"px-3 py-1.5 rounded-lg border border-border text-xs font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed hover:bg-primary/10",children:"Previous"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[r+1," / ",c,e.jsxs("span",{className:"ml-1.5 opacity-60",children:["(",t.length," total)"]})]}),e.jsx("button",{onClick:()=>l(Math.min(c-1,r+1)),disabled:r>=c-1,className:"px-3 py-1.5 rounded-lg border border-border text-xs font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed hover:bg-primary/10",children:"Next"})]})]})},xe=()=>
1{const[t,o]=p.useState(null),[a,r]=p.useState(!1),[n,c]=p.useState(null),[x,l]=p.useState([]),[d,m]=p.useState(0),b=Math.ceil(g.length/f),A=g.slice(d*f,(d+1)*f),S=async s=>{if(t!==s.id){if(o(s.id),c(null),N[s.id]){l(N[s.id]);return}r(!0),l([]);try{const h=await fetch(s.url);if(!h.ok)throw new Error(`HTTP ${h.status}`);const u=await h.json(),j=K(u);N[s.id]=j,l(j)}catch(h){c(h instanceof Error?h.message:"Failed to load data")}finally{r(!1)}}},D=()=>{o(null),l([]),c(null)},y=g.find(s=>s.id===t);return e.jsxs("div",{children:[e.jsxs("div",{className:"bg-card-gradient rounded-2xl border border-border p-6 mb-6 shadow-card",children:[e.jsx("h2",{className:"text-xl font-bold mb-2",children:"Health Report of Popular Nameservers"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Select a category to view live DNS health data. Expand domains and nameservers to inspect individual checks."})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:A.map(s=>{const h=s.icon,u=t===s.id;return e.jsxs("button",{onClick:()=>S(s),className:`flex flex-col items-center gap-2 p-4 rounded-2xl border transition-all duration-200 text-center shadow-card cursor-pointer 2 ${u?"border-primary/50 bg-primary/5 shadow-md":"border-border bg-card-gradient hover:border-primary/30 hover:bg-primary/5"}`,children:[e.jsx("div",{className:`p-2.5 rounded-xl border ${u?"bg-primary/10 border-primary/30":"bg-muted/40 border-border"}`,children:e.jsx(h,{className:`w-5 h-5 ${u?"text-primary":"text-muted-foreground"}`})}),e.jsx("span",{className:`text-xs font-medium leading-tight ${u?"text-primary":"text-foreground"}`,children:s.name})]},s.id)})}),e.jsxs("div",{className:"flex items-center justify-center gap-3 mb-6",children:[e.jsx("button",{onClick:()=>m(s=>Math.max(0,s-1)),disabled:d===0,className:"px-4 py-2 rounded-xl border border-border text-sm font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed hover:bg-primary/10",children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[d+1," / ",b]}),e.jsx("button",{onClick:()=>m(s=>Math.min(b-1,s+1)),disabled:d>=b-1,className:"px-4 py-2 rounded-xl border border-border text-sm font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed hover:bg-primary/10",children:"Next"})]}),t&&e.jsxs("div",{className:"bg-card-gradient rounded-2xl border border-border p-6 shadow-card",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[y&&e.jsx("div",{className:"p-2 rounded-xl bg-primary/10 border border-primary/20",children:e.jsx(y.icon,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-base font-bold",children:y?.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a?"Fetching data...":n?"Error loading data":`${x.length} domains`})]}),a&&e.jsx(O,{className:"w-4 h-4 text-muted-foreground animate-spin"}),e.jsxs("button",{onClick:D,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl border border-border text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",children:[e.jsx(E,{className:"w-3.5 h-3.5"}),"Close"]})]}),a&&e.jsx(Y,{}),n&&e.jsxs("div",{className:"flex items-center gap-3 p-4 bg-red-500/10 border border-red-500/30 rounded-xl text-red-500 text-sm",children:[e.jsx(w,{className:"w-4 h-4 flex-shrink-0"}),n]}),!a&&!n&&x.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No data available for this category."}),!a&&!n&&x.length>0&&e.jsx(re,{domains:x})]}),!t&&e.jsxs("div",{className:"bg-card-gradient rounded-2xl border border-border p-10 shadow-card text-center",children:[e.jsx(k,{className:"w-8 h-8 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a category above to load its nameserver health report."})]})]})};export{xe as NameserverHealthReport};
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.