1import{r as e,j as s}from"./react-vendor-aB1sdbVA.js";import{b as r,B as a,J as t,K as o}from"./App-DpIodTGb.js";import{I as l}from"./input-nVowlkmz.js";import{B as i}from"./badge-Cj7WL9LW.js";import{cZ as n,cN as d,ax as c,D as m,b9 as x,c_ as h,W as p,b7 as u,a8 as b,X as j,t as f,m as y}from"./icons-B9AP7C-1.js";import{m as g,A as v}from"./framer-motion-BmJtgIHn.js";import"./index-DIdR5dKn.js";import"./ui-core-eVDMez39.js";import"./react-query-DNT5yJit.js";const N=()=>{const{isRTL:N,t:w}=r(),[T,k]=e.useState([]),[C,$]=e.useState(""),[A,z]=e.useState(""),S=()=>{if(!C.trim())return;if(t(C))return void z(o(N));if(T.length>=5)return void z(w("domain.comparisonTool.max5Domains"));const{name:e,tld:s}=(e=>{const s=e.toLowerCase().trim().replace(/^https?:\/\//,"").replace(/^www\./,"").split("/")[0],r=s.match(/(\.[a-z]{2,})$/);return r?{name:s.replace(r[0],""),tld:r[0]}:{name:s,tld:".com"}})(C);if(e.length<2)return void z(w("domain.comparisonTool.domainTooShort"));const r=e+s;if(T.some(e=>e.full===r))return void z(w("domain.comparisonTool.alreadyAdded"));const{score:a,analysis:l}=((e,s)=>{const r=e.length,a=/\d/.test(e),t=/-/.test(e),o=(e=>{if((e=e.toLowerCase()).length<=3)return 1;const s=(e=(e=e.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"")).replace(/^y/,"")).match(/[aeiouy]{1,2}/g);return s?s.length:1})(e);let l=100;l=r<4?60:r<6?80:r<=10?100:r<=14?75:r<=18?50:30;let i=100;a&&(i-=15),t&&(i-=20),o>4?i-=20:o>3&&(i-=10),r>12&&(i-=15),i=Math.max(20,i);let n=85;r>=5&&r<=8?n=100:r<5?n=70:r>12&&(n=50),a&&(n-=20),t&&(n-=25);const d=(e.match(/[aeiou]/gi)||[]).length;d>0&&d/e.length>=.25&&(n+=5),n=Math.min(100,Math.max(20,n));let c=80;return c=[".com",".net",".org",".co"].includes(s)?100:[".io",".app",".dev",".ai"].includes(s)?85:65,r<=10&&(c+=5),a||t||(c+=5),c=Math.min(100,c),{score:{overall:Math.round(.25*l+.25*i+.3*n+.2*c),length:l,memorability:i,brandability:n,seo:c},analysis:{charCount:r,hasNumbers:a,hasHyphens:t,syllables:o}}})(e,s);k(t=>[...t,{id:crypto.randomUUID(),name:e,tld:s,full:r,score:a,analysis:l}]),$(""),z("")},B=e=>e>=85?"text-emerald-500":e>=70?"text-primary":e>=50?"text-amber-500":"text-destructive",D=T.length<2?null:T.reduce((e,s)=>s.score.overall>e.score.overall?s:e),M=[{key:"length",icon:n,label:w("domain.comparisonTool.length"),color:"from-blue-500 to-cyan-500"},{key:"memorability",icon:d,label:w("domain.comparisonTool.memorability"),color:"from-purple-500 to-pink-500"},{key:"brandability",icon:c,label:w("domain.comparisonTool.brandability"),color:"from-orange-500 to-amber-500"},{key:"seo",icon:m,label:w("domain.comparisonTool.seoScore"),color:"from-emerald-500 to-teal-500"}];return s.jsx(g.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"py-20 bg-gradient-to-b from-muted/30 to-background",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsxs(g.div,{initial:{opacity:0,scale:.9},whileInView:{opacity:1,scale:1},viewport:{once:!0},className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-6",children:[s.jsx(x,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-sm font-medium text-primary",children:w("domain.comparisonTool.badge")})]}),s.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-foreground mb-4",children:w("domain.comparisonTool.title")}),s.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:w("domain.comparisonTool.subtitle")})]}),s.jsxs(g.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:.1},className:"max-w-xl mx-auto mb-8",children:[s.jsxs("div",{className:"flex gap-3",children:[s.jsx("div",{className:"flex-1 relative",children:s.jsx(l,{type:"text",placeholder:w("domain.comparisonTool.placeholder"),value:C,onChange:e=>{$(e.target.value),z("")},onKeyDown:e=>"Enter"===e.key&&S(),className:"h-14 text-lg px-5 "+(N?"text-right":"")})}),s.jsxs(a,{onClick:S,size:"lg",className:"h-14 px-6 bg-gradient-to-r from-primary to-primary/80",disabled:!C.trim()||T.length>=5,children:[s.jsx(h,{size:20,className:"mr-1"}),w("domain.comparisonTool.add")]})]}),s.jsx(v,{children:A&&s.jsxs(g.p,{initial:{opacity:0,y:-5}
1,animate:{opacity:1,y:0},exit:{opacity:0},className:"mt-2 text-sm text-destructive flex items-center gap-1 "+(N?"flex-row-reverse":""),children:[s.jsx(p,{size:14}),A]})}),s.jsx("p",{className:"mt-2 text-xs text-muted-foreground text-center",children:`${T.length}/5 ${w("domain.comparisonTool.domainsAdded")} ⢠${w("domain.comparisonTool.pressEnter")}`})]}),0===T.length&&s.jsxs(g.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-16 bg-card/50 rounded-3xl border border-dashed border-border",children:[s.jsx(x,{className:"w-16 h-16 text-muted-foreground/30 mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:w("domain.comparisonTool.addAtLeast2")}),s.jsx("div",{className:"flex flex-wrap justify-center gap-2 mt-4",children:["startup.io","mybrand.com","techflow.dev"].map(e=>s.jsx("button",{onClick:()=>$(e),className:"px-3 py-1.5 text-sm bg-muted rounded-full hover:bg-muted/80 transition-colors",children:e},e))})]}),T.length>0&&s.jsxs(g.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-6",children:[s.jsx(v,{children:D&&T.length>=2&&s.jsx(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"p-5 bg-gradient-to-r from-amber-500/10 via-yellow-500/10 to-amber-500/10 border border-amber-500/30 rounded-2xl",children:s.jsxs("div",{className:"flex items-center justify-between "+(N?"flex-row-reverse":""),children:[s.jsxs("div",{className:"flex items-center gap-4 "+(N?"flex-row-reverse":""),children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-amber-400 to-yellow-500 flex items-center justify-center shadow-lg shadow-amber-500/30",children:s.jsx(u,{className:"w-7 h-7 text-white"})}),s.jsxs("div",{className:N?"text-right":"",children:[s.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400 font-medium",children:w("domain.comparisonTool.bestChoice")}),s.jsx("p",{className:"text-2xl font-bold text-foreground",children:D.full})]})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:`text-4xl font-bold ${B(D.score.overall)}`,children:D.score.overall}),s.jsx("p",{className:"text-xs text-muted-foreground",children:w("domain.comparisonTool.score")})]})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[s.jsx(v,{children:T.map((e,r)=>{return s.jsxs(g.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9,transition:{duration:.2}},transition:{delay:.05*r},className:"relative bg-card border-2 rounded-2xl p-5 transition-all duration-300 "+(D?.id===e.id?"border-amber-500/50 shadow-xl shadow-amber-500/10":"border-border hover:border-primary/30"),children:[D?.id===e.id&&T.length>=2&&s.jsx("div",{className:"absolute -top-3 "+(N?"left-4":"right-4"),children:s.jsxs(i,{className:"bg-gradient-to-r from-amber-400 to-yellow-500 text-white shadow-md",children:[s.jsx(b,{className:"w-3 h-3 mr-1"}),w("domain.comparisonTool.winner")]})}),s.jsx("button",{onClick:()=>{return s=e.id,void k(e=>e.filter(e=>e.id!==s));var s},className:`absolute top-3 ${N?"left-3":"right-3"} p-1.5 rounded-full bg-muted hover:bg-destructive/20 hover:text-destructive transition-colors`,children:s.jsx(j,{size:14})}),s.jsxs("div",{className:"mb-4 "+(N?"text-right":""),children:[s.jsxs("p",{className:"text-xl font-bold text-foreground truncate pr-8",children:[e.name,s.jsx("span",{className:"text-primary",children:e.tld})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground "+(N?"flex-row-reverse":""),children:[s.jsxs("span",{children:[e.analysis.charCount," ",w("domain.comparisonTool.chars")]}),s.jsx("span",{children:"â¢"}),s.jsxs("span",{children:[e.analysis.syllables," ",w("domain.comparisonTool.syllables")]}),e.analysis.hasNumbers&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"â¢"}),s.jsx("span",{className:"text-amber-500",children:w("domain.comparisonTool.numbers")})]}),e.analysis.hasHyphens&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"â¢"}),s.jsx("span",{className:"text-amber-500",children:w("domain.comparisonTool.hyphens")})]})]})]}),s.jsxs("div",{className:"flex items-center gap-4 mb-5 p-4 bg-muted/50 rounded-xl",children:[s.jsxs("div",{className:"relative w-16 h-16",children:[s.jsxs("svg",{className:"w-16 h-16 -rotate-90",viewBox:"0 0 64 64",children:[s.jsx("circle",{cx:"32",cy:"32",r:"28",fill:"none",stroke:"currentColor",strokeWidth:"6",className:"text-muted"}),s.jsx("circle",{cx:"32",cy:"32",r:"28",fill:"none",stroke:"url
1(#scoreGradient)",strokeWidth:"6",strokeLinecap:"round",strokeDasharray:e.score.overall/100*176+" 176"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:"scoreGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",stopColor:"hsl(var(--primary))"}),s.jsx("stop",{offset:"100%",stopColor:"hsl(152 69% 55%)"})]})})]}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("span",{className:`text-lg font-bold ${B(e.score.overall)}`,children:(a=e.score.overall,a>=90?"A+":a>=85?"A":a>=80?"A-":a>=75?"B+":a>=70?"B":a>=65?"B-":a>=60?"C+":a>=55?"C":a>=50?"C-":"D")})})]}),s.jsxs("div",{className:N?"text-right":"",children:[s.jsx("p",{className:`text-3xl font-bold ${B(e.score.overall)}`,children:e.score.overall}),s.jsx("p",{className:"text-xs text-muted-foreground",children:w("domain.comparisonTool.overallScore")})]})]}),s.jsx("div",{className:"space-y-3",children:M.map(r=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between text-sm mb-1 "+(N?"flex-row-reverse":""),children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground "+(N?"flex-row-reverse":""),children:[s.jsx(r.icon,{size:14}),r.label]}),s.jsx("span",{className:"font-semibold text-foreground",children:e.score[r.key]})]}),s.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:s.jsx(g.div,{initial:{width:0},animate:{width:`${e.score[r.key]}%`},transition:{duration:.5,delay:.2},className:`h-full rounded-full bg-gradient-to-r ${r.color}`})})]},r.key))})]},e.id);var a})}),T.length<5&&T.length>0&&s.jsxs(g.button,{initial:{opacity:0}
1,animate:{opacity:1},onClick:()=>document.querySelector('input[placeholder*="domain"]')?.focus(),className:"flex flex-col items-center justify-center gap-3 p-8 bg-muted/30 border-2 border-dashed border-border rounded-2xl hover:border-primary/50 hover:bg-muted/50 transition-all min-h-[300px]",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center",children:s.jsx(h,{className:"w-7 h-7 text-primary"})}),s.jsx("span",{className:"text-muted-foreground font-medium",children:w("domain.comparisonTool.addAnother")})]})]}),T.length>=2&&s.jsxs(g.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"mt-8 bg-card border border-border rounded-2xl overflow-hidden",children:[s.jsx("div",{className:"p-5 border-b border-border bg-muted/30",children:s.jsxs("h3",{className:"text-lg font-bold text-foreground flex items-center gap-2 "+(N?"flex-row-reverse":""),children:[s.jsx(f,{className:"w-5 h-5 text-primary"}),w("domain.comparisonTool.comparisonSummary")]})}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"p-4 text-sm font-semibold text-muted-foreground "+(N?"text-right":"text-left"),children:w("domain.comparisonTool.criteria")}),T.map(e=>s.jsxs("th",{className:"p-4 text-center",children:[s.jsx("span",{className:"font-bold text-foreground",children:e.name}),s.jsx("span",{className:"text-primary",children:e.tld})]},e.id))]})}),s.jsxs("tbody",{children:[M.map(e=>{const r=Math.max(...T.map(s=>s.score[e.key]));return s.jsxs("tr",{className:"border-b border-border last:border-0",children:[s.jsx("td",{className:"p-4 "+(N?"text-right":""),children:s.jsxs("span",{className:"flex items-center gap-2 text-sm "+(N?"flex-row-reverse":""),children:[s.jsx(e.icon,{size:16,className:"text-muted-foreground"}),e.label]})}),T.map(a=>s.jsx("td",{className:"p-4 text-center",children:s.jsxs("span",{className:"inline-flex items-center gap-1 font-semibold "+(a.score[e.key]===r?"text-emerald-500":"text-foreground"),children:[a.score[e.key]===r&&s.jsx(y,{size:12}),a.score[e.key]]})},a.id))]},e.key)}),s.jsxs("tr",{className:"bg-muted/50",children:[s.jsx("td",{className:"p-4 font-bold "+(N?"text-right":""),children:w("domain.comparisonTool.overall")}),T.map(e=>s.jsx("td",{className:"p-4 text-center",children:s.jsx("span",{className:`text-xl font-bold ${B(e.score.overall)}`,children:e.score.overall})},e.id))]})]})]})})]})]})]})})})};export{N 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.