import{p as z,b as S,f as y,i as F,e as o,g as j,A as ve,B as V,F as O,q as t,u as H,m as Q,o as Ge,s as U,aX as Tt,au as He,ay as vt,aY as Mt,ab as D,a as I,h as x,j as te,r as W,k as v,n as Y,l as le,w as Rt,x as $,aZ as At,a_ as zt,a$ as ut,b0 as jt,a4 as ge,a6 as me,b1 as Et,Y as Qe,b2 as Nt,b3 as Lt,b4 as Dt,b5 as Kt,Q as Xe,at as Ht,b6 as Ve,ac as ne,aW as _t,ap as Ot,aP as Vt,N as Fe,Z as B,b7 as yt,_ as J,a9 as ue,aa as ft,a8 as Oe,ag as Gt,R as Ut,b8 as Wt,b9 as qt,ba as Jt,aq as Yt,am as Zt,bb as Qt,bc as Xt,bd as ea,be as ta,bf as aa}from"./vendor-BQRQ0M_C.js";import{c as ae,I as xt,B as $e,a as kt,b as Ze,n as Pt,k as ot}from"./index-BHBd4SjD.js";class St{component;props;constructor(e,n={}){this.component=e,this.props=n}}class ra{snippet;params;constructor(e,n){this.snippet=e,this.params=n}}function lt(i,e){return new St(i,e)}function it(i,e){z(e,!0);var n=S(),d=y(n);{var a=r=>{var u=ve();V(()=>O(u,e.content)),o(r,u)},l=(r,u)=>{{var f=_=>{var g=S();const s=H(()=>e.content(e.context));var c=y(g);{var m=h=>{var b=S();const R=H(()=>{const{component:w,props:p}=t(s);return{Component:w,props:p}});var T=y(b);Q(T,()=>t(R).Component,(w,p)=>{p(w,Ge(()=>t(R).props))}),o(h,b)},k=(h,b)=>{{var R=w=>{var p=S();const M=H(()=>{const{snippet:C,params:Z}=t(s);return{snippet:C,params:Z}});var N=y(p);U(N,()=>t(M).snippet,()=>t(M).params),o(w,p)},T=w=>{var p=ve();V(()=>O(p,t(s))),o(w,p)};F(h,w=>{t(s)instanceof ra?w(R):w(T,!1)},b)}};F(c,h=>{t(s)instanceof St?h(m):h(k,!1)})}o(_,g)};F(r,_=>{e.content instanceof Function&&_(f)},u)}};F(d,r=>{typeof e.content=="string"?r(a):r(l,!1)})}o(i,n),j()}function na(i){const e=Ke({state:{},onStateChange(){},renderFallbackValue:null,mergeOptions:(l,r)=>Ke(l,r)},i),n=Tt(e);let d=He(vt(n.initialState));function a(){n.setOptions(l=>Ke(l,i,{state:Ke(t(d),i.state||{}),onStateChange:r=>{r instanceof Function?D(d,r(t(d)),!0):D(d,Ke(t(d),r),!0),i.onStateChange?.(r)}}))}return a(),Mt(()=>{a()}),n}function Ke(...i){const e={};for(let n=0;n<i.length;n++){let d=i[n];if(typeof d=="function"&&(d=d()),d){const a=Object.getOwnPropertyDescriptors(d);for(const l in a)l in e||Object.defineProperty(e,l,{enumerable:!0,get(){for(let r=i.length-1;r>=0;r--){let u=i[r];typeof u=="function"&&(u=u());const f=(u||{})[l];if(f!==void 0)return f}}})}}return e}var sa=x('<div class="relative w-full overflow-auto"><table><!></table></div>');function oa(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=sa(),l=v(a);te(l,u=>({class:u,...d}),[()=>ae("w-full caption-bottom text-sm",e.class)]);var r=v(l);U(r,()=>e.children??Y),le(l,u=>n(u),()=>n()),o(i,a),j()}var la=x("<tbody><!></tbody>");function ia(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=la();te(a,r=>({class:r,...d}),[()=>ae("[&_tr:last-child]:border-0",e.class)]);var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}var da=x("<td><!></td>");function bt(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=da();te(a,r=>({class:r,...d}),[()=>ae("p-4 align-middle [&:has([role=checkbox])]:pr-0",e.class)]);var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}var ca=x("<th><!></th>");function va(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=ca();te(a,r=>({class:r,...d}),[()=>ae("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",e.class)]);var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}var ua=x("<thead><!></thead>");function fa(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=ua();te(a,r=>({class:r,...d}),[()=>ae("[&_tr]:border-b",e.class)]);var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}var ga=x("<tr><!></tr>");function dt(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=ga();te(a,r=>({class:r,...d}),[()=>ae("hover:bg-secondary/20 hover:text-secondary-foreground data-[state=selected]:bg-muted border-b transition-colors",e.class)]);var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}const pt="passdb-table-settings",Ye={pageSize:15};function ma(){const i=(()=>{if(typeof window<"u")try{const l=localStorage.getItem(pt);if(l){const r=JSON.parse(l);return{...Ye,...r}}}catch(l){console.warn("Failed to parse table settings from localStorage:",l)}return Ye})(),{subscribe:e,set:n,update:d}=Rt(i);function a(l){if(typeof window<"u")try{localStorage.setItem(pt,JSON.stringify(l))}catch(r){console.warn("Failed to save table settings to localStorage:",r)}}return{subscribe:e,setPageSize:l=>{d(r=>{const u={...r,pageSize:l};return a(u),u})},reset:()=>{a(Ye),n(Ye)}}}const wt=ma();var ha=x('<div class="text-sm text-muted-foreground flex-shrink-0"><!></div>'),_a=x("<!> <!>",1),xa=x("<!> <!>",1),ba=x('<div class="space-y-4"><div class="flex items-center justify-between gap-4 flex-wrap"><div class="flex-1 max-w-sm min-w-0"><!></div> <!> <div class="flex items-center space-x-2 flex-shrink-0"><!> <!> <span class="text-sm text-muted-foreground"> </span> <!> <!></div></div> <div class="bg-card rounded-lg shadow-md border-border overflow-hidden"><!></div> <div class="flex items-center justify-end gap-2"><span class="text-sm text-muted-foreground">Items per page:</span> <!></div></div>');function pa(i,e){z(e,!0);const[n,d]=Qe(),a=()=>Xe(wt,"$tableSettings",n),l=H(()=>e.pageSize||a().pageSize);let r=He(""),u=He(vt([])),f=He(vt([])),_=He(0);const g=H(()=>({pageIndex:t(_),pageSize:t(l)})),s=na({get data(){return e.data},get columns(){return e.columns},getCoreRowModel:Kt(),getSortedRowModel:Dt(),getFilteredRowModel:Lt(),getPaginationRowModel:Nt(),state:{get globalFilter(){return t(r)},get sorting(){return t(u)},get columnFilters(){return t(f)},get pagination(){return t(g)}},onGlobalFilterChange:P=>{D(r,typeof P=="function"?P(t(r)):P,!0),D(_,0)},onSortingChange:P=>{D(u,typeof P=="function"?P(t(u)):P,!0)},onColumnFiltersChange:P=>{D(f,typeof P=="function"?P(t(f)):P,!0)},onPaginationChange:P=>{const A=typeof P=="function"?P(t(g)):P;D(_,A.pageIndex,!0)},globalFilterFn:"includesString"});function c(P){const A=P.target;s.setGlobalFilter(A.value)}var m=ba(),k=v(m),h=v(k),b=v(h);const R=H(()=>s.getState().globalFilter??"");xt(b,{placeholder:"Filter results...",get value(){return t(R)},oninput:c,class:"w-full","data-filter-input":!0});var T=$(h,2);{var w=P=>{var A=ha(),G=v(A);{var we=L=>{var K=ve();V((ee,se)=>O(K,`Showing ${ee??""} of ${se??""} results`),[()=>s.getFilteredRowModel().rows.length,()=>s.getCoreRowModel().rows.length]),o(L,K)},re=L=>{var K=ve("No results found for current filter");o(L,K)};F(G,L=>{s.getFilteredRowModel().rows.length>0?L(we):L(re,!1)})}o(P,A)};F(T,P=>{s.getState().globalFilter&&s.getState().globalFilter.length>0&&P(w)})}var p=$(T,2),M=v(p);const N=H(()=>!s.getCanPreviousPage());$e(M,{variant:"outline",size:"sm",onclick:()=>s.setPageIndex(0),get disabled(){return t(N)},children:(P,A)=>{At(P,{class:"h-4 w-4"})},$$slots:{default:!0}});var C=$(M,2);const Z=H(()=>!s.getCanPreviousPage());$e(C,{variant:"outline",size:"sm",onclick:()=>s.previousPage(),get disabled(){return t(Z)},"data-pagination-prev":!0,children:(P,A)=>{zt(P,{class:"h-4 w-4"})},$$slots:{default:!0}});var X=$(C,2),be=v(X),ie=$(X,2);const Ie=H(()=>!s.getCanNextPage());$e(ie,{variant:"outline",size:"sm",onclick:()=>s.nextPage(),get disabled(){return t(Ie)},"data-pagination-next":!0,children:(P,A)=>{ut(P,{class:"h-4 w-4"})},$$slots:{default:!0}});var Be=$(ie,2);const E=H(()=>!s.getCanNextPage());$e(Be,{variant:"outline",size:"sm",onclick:()=>s.setPageIndex(s.getPageCount()-1),get disabled(){return t(E)},children:(P,A)=>{jt(P,{class:"h-4 w-4"})},$$slots:{default:!0}});var he=$(k,2),_e=v(he);Q(_e,()=>oa,(P,A)=>{A(P,{children:(G,we)=>{var re=xa(),L=y(re);Q(L,()=>fa,(ee,se)=>{se(ee,{class:"bg-muted/50",children:(ce,ye)=>{var xe=S(),Te=y(xe);ge(Te,17,()=>s.getHeaderGroups(),me,(Me,Re)=>{var q=S(),de=y(q);Q(de,()=>dt,(fe,Ae)=>{Ae(fe,{class:" border-border hover:bg-transparent bg-background",children:(ze,We)=>{var ke=S(),Pe=y(ke);ge(Pe,17,()=>t(Re).headers,me,(je,oe)=>{var Se=S(),qe=y(Se);Q(qe,()=>va,(Ee,Ne)=>{Ne(Ee,{class:"text-card-foreground font-semibold",children:(et,tt)=>{var Le=S(),at=y(Le);{var rt=De=>{var Je=S(),gt=y(Je);{var nt=Ce=>{const st=H(()=>t(oe).column.getToggleSortingHandler());$e(Ce,{variant:"ghost",get onclick(){return t(st)},class:"h-auto p-0 font-semibold hover:bg-secondary hover:text-secondary-foreground",children:(Ft,Ir)=>{var mt=_a(),ht=y(mt);const It=H(()=>t(oe).getContext());it(ht,{get content(){return t(oe).column.columnDef.header},get context(){return t(It)}});var Bt=$(ht,2);Et(Bt,{class:"ml-2 h-4 w-4"}),o(Ft,mt)},$$slots:{default:!0}})},$t=Ce=>{const st=H(()=>t(oe).getContext());it(Ce,{get content(){return t(oe).column.columnDef.header},get context(){return t(st)}})};F(gt,Ce=>{t(oe).column.getCanSort()?Ce(nt):Ce($t,!1)})}o(De,Je)};F(at,De=>{t(oe).isPlaceholder||De(rt)})}o(et,Le)},$$slots:{default:!0}})}),o(je,Se)}),o(ze,ke)},$$slots:{default:!0}})}),o(Me,q)}),o(ce,xe)},$$slots:{default:!0}})});var K=$(L,2);Q(K,()=>ia,(ee,se)=>{se(ee,{children:(ce,ye)=>{var xe=S(),Te=y(xe);{var Me=q=>{var de=S(),fe=y(de);ge(fe,17,()=>s.getRowModel().rows,me,(Ae,ze,We)=>{var ke=S(),Pe=y(ke);Q(Pe,()=>dt,(je,oe)=>{oe(je,{class:`border-b border-border/50 transition-colors ${We%2===0?"bg-background/75 hover:bg-secondary/20":"bg-background/90 hover:bg-secondary/30"}`,"data-table-row":!0,children:(Se,qe)=>{var Ee=S(),Ne=y(Ee);ge(Ne,17,()=>t(ze).getVisibleCells(),me,(et,tt)=>{var Le=S(),at=y(Le);Q(at,()=>bt,(rt,De)=>{De(rt,{class:"text-card-foreground","data-table-cell":!0,children:(Je,gt)=>{const nt=H(()=>t(tt).getContext());it(Je,{get content(){return t(tt).column.columnDef.cell},get context(){return t(nt)}})},$$slots:{default:!0}})}),o(et,Le)}),o(Se,Ee)},$$slots:{default:!0}})}),o(Ae,ke)}),o(q,de)},Re=q=>{var de=S(),fe=y(de);Q(fe,()=>dt,(Ae,ze)=>{ze(Ae,{children:(We,ke)=>{var Pe=S(),je=y(Pe);Q(je,()=>bt,(oe,Se)=>{Se(oe,{get colspan(){return e.columns.length},class:"h-24 text-center",children:(qe,Ee)=>{var Ne=ve("No results found.");o(qe,Ne)},$$slots:{default:!0}})}),o(We,Pe)},$$slots:{default:!0}})}),o(q,de)};F(Te,q=>{s.getRowModel().rows?.length?q(Me):q(Re,!1)})}o(ce,xe)},$$slots:{default:!0}})}),o(G,re)},$$slots:{default:!0}})});var Ue=$(he,2),pe=$(v(Ue),2);xt(pe,{type:"number",min:"1",max:"1000",get value(){return s.getState().pagination.pageSize},oninput:P=>{const A=P.target,G=parseInt(A.value);G>0&&G<=1e3&&(s.setPageSize(G),wt.setPageSize(G))},class:"w-20 h-8 text-center"}),V((P,A)=>O(be,`Page ${P??""} of ${A??""}`),[()=>s.getState().pagination.pageIndex+1,()=>Math.max(1,s.getPageCount())]),o(i,m),j(),d()}var wa=(i,e,n)=>e(`/email/${n.username}@${n.domain}`,`Email: ${n.username}@${n.domain}`),ya=x('<button class="text-muted-foreground hover:text-secondary-foreground transition-colors" title="View email breach info"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></button>'),ka=x('<div class="w-4 h-4"></div>'),Pa=(i,e,n)=>e(`/username/${n.username}`,`Username: ${n.username}`),Sa=x('<button class="text-primary hover:text-secondary-foreground hover:underline cursor-pointer transition-colors"> </button>'),Ca=x('<span class="text-muted-foreground">-</span>'),$a=x('<div class="flex items-center gap-2"><!> <!></div>'),Fa=(i,e,n)=>e(`/domain/${n.domain}`,`Domain: ${n.domain}`),Ia=x('<button class="text-primary hover:text-primary/80 hover:underline cursor-pointer transition-colors"> </button>'),Ba=x('<span class="text-muted-foreground">-</span>'),Ta=(i,e,n)=>e(`/password/${n.password}`,`Password: ${n.password.length>20?n.password.substring(0,20)+"...":n.password}`),Ma=x('<button class="text-primary hover:text-secondary-foreground hover:underline cursor-pointer transition-colors block truncate hover:whitespace-normal hover:break-all"> </button>'),Ra=x('<span class="text-muted-foreground">-</span>'),Aa=x('<div class="font-mono max-w-xs"><!></div>');function ct(i,e){z(e,!0);const[n,d]=Qe(),a=()=>Xe(kt,"$currentRoute",n);let l=I(e,"showEmailLink",3,!1);function r(s,c){Ze.addBreadcrumb(c,s),Pt(s)}var u=S(),f=y(u);{var _=s=>{var c=$a(),m=v(c);{var k=w=>{var p=ya();p.__click=[wa,r,e],V(()=>Ve(p,"aria-label",`View email breach info for ${e.username??""}@${e.domain??""}`)),o(w,p)},h=(w,p)=>{{var M=N=>{var C=ka();o(N,C)};F(w,N=>{l()&&!a().match("/email/")&&N(M)},p)}};F(m,w=>{l()&&!a().match("/email/")&&e.username&&e.username!=="-"&&e.domain&&e.domain!=="-"?w(k):w(h,!1)})}var b=$(m,2);{var R=w=>{var p=Sa();p.__click=[Pa,r,e];var M=v(p);V(()=>O(M,e.username)),o(w,p)},T=w=>{var p=Ca();o(w,p)};F(b,w=>{e.username&&e.username!=="-"?w(R):w(T,!1)})}o(s,c)},g=(s,c)=>{{var m=h=>{var b=S(),R=y(b);{var T=p=>{var M=Ia();M.__click=[Fa,r,e];var N=v(M);V(()=>O(N,e.domain)),o(p,M)},w=p=>{var M=Ba();o(p,M)};F(R,p=>{e.domain&&e.domain!=="-"?p(T):p(w,!1)})}o(h,b)},k=(h,b)=>{{var R=T=>{var w=Aa(),p=v(w);{var M=C=>{var Z=Ma();Z.__click=[Ta,r,e];var X=v(Z);V(()=>{Ve(Z,"title",e.password),O(X,e.password)}),o(C,Z)},N=C=>{var Z=Ra();o(C,Z)};F(p,C=>{e.password&&e.password!=="-"?C(M):C(N,!1)})}o(T,w)};F(h,T=>{e.type==="password"&&T(R)},b)}};F(s,h=>{e.type==="domain"?h(m):h(k,!1)},c)}};F(f,s=>{e.type==="username"?s(_):s(g,!1)})}o(i,u),j(),d()}Ht(["click"]);const za=[{accessorKey:"username",header:"Username",enableSorting:!0,enableGlobalFilter:!0,cell:({row:i})=>{const e=i.getValue("username"),n=i.original.domain;return lt(ct,{type:"username",username:e,domain:n,showEmailLink:!0})}},{accessorKey:"domain",header:"Domain",enableSorting:!0,enableGlobalFilter:!0,cell:({row:i})=>{const e=i.getValue("domain");return lt(ct,{type:"domain",domain:e})}},{accessorKey:"password",header:"Password",enableSorting:!1,enableGlobalFilter:!0,cell:({row:i})=>{const e=i.getValue("password");return lt(ct,{type:"password",password:e})}}];var ja=x('<div class="max-w-4xl mx-auto"><!></div>');function Ea(i,e){z(e,!1);let n="";typeof window<"u"&&(n=window.location.search.substring(1));let d=I(e,"results",8);const a=(n||"").split("&").filter(Boolean),l=ne(a.reduce((f,_)=>{const[g,s]=_.split("=");return g&&s&&(f[g]=s),f},{}));_t(l,t(l).page=t(l).page?parseInt(String(t(l).page)):1),_t(l,t(l).per_page=t(l).per_page?parseInt(String(t(l).per_page)):void 0),Ot(()=>{ot.setupResultsShortcuts(),ot.setupTableShortcuts()}),Vt(()=>{ot.setContext("global")}),Fe();var r=ja(),u=v(r);pa(u,{get columns(){return za},get data(){return d()},get pageSize(){return t(l),B(()=>t(l).per_page)}}),o(i,r),j()}var Na=x('<p class="mt-4 text-muted-foreground"> </p>'),La=x('<div class="flex flex-col items-center justify-center p-8"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-primary"></div> <!></div>'),Da=x('<div class="animate-pulse"><div class="h-4 bg-muted rounded w-3/4 mb-2"></div> <div class="h-4 bg-muted rounded w-1/2"></div></div>'),Ka=x('<div class="space-y-4 p-4"></div>'),Ha=x('<div class="flex items-center justify-center space-x-2 p-8"><div class="w-3 h-3 bg-primary rounded-full animate-bounce" style="animation-delay: 0ms"></div> <div class="w-3 h-3 bg-primary rounded-full animate-bounce" style="animation-delay: 150ms"></div> <div class="w-3 h-3 bg-primary rounded-full animate-bounce" style="animation-delay: 300ms"></div></div>');function Ct(i,e){let n=I(e,"type",3,"spinner"),d=I(e,"message",3,"");var a=S(),l=y(a);{var r=f=>{var _=La(),g=$(v(_),2);{var s=c=>{var m=Na(),k=v(m);V(()=>O(k,d())),o(c,m)};F(g,c=>{d()&&c(s)})}o(f,_)},u=(f,_)=>{{var g=c=>{var m=Ka();ge(m,20,()=>Array(3),me,(k,h)=>{var b=Da();o(k,b)}),o(c,m)},s=(c,m)=>{{var k=h=>{var b=Ha();o(h,b)};F(c,h=>{n()==="dots"&&h(k)},m)}};F(f,c=>{n()==="skeleton"?c(g):c(s,!1)},_)}};F(l,f=>{n()==="spinner"?f(r):f(u,!1)})}o(i,a)}var Oa=x('<div class="max-w-4xl mx-auto"><div class="text-center py-12"><svg class="mx-auto h-12 w-12 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <h3 class="mt-2 text-sm font-medium text-foreground">No results found</h3> <p class="mt-1 text-sm text-muted-foreground">Try adjusting your search terms</p></div></div>'),Va=x('<div class="max-w-4xl mx-auto"><div class="bg-destructive/10 border border-destructive/30 rounded-lg p-6"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-destructive" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div> <div class="ml-3"><h3 class="text-sm font-medium text-destructive">Failed to fetch results</h3> <p class="mt-2 text-sm text-destructive"> </p> <p class="mt-2 text-sm text-destructive">Please check your API host configuration and try again.</p></div></div></div></div>'),Ga=x('<div class="px-4 py-8"><!></div>');function Ua(i,e){z(e,!1);let n=I(e,"endpoint",8),d=localStorage.getItem("host")||"http://localhost:4567",a=0;const l=3;async function r(_){try{const g=await fetch(`${d}${_}`);if(!g.ok){let c=`HTTP ${g.status}`;try{const m=await g.text();m?c+=`: ${m}`:c+=` - ${g.statusText}`}catch{c+=` - ${g.statusText}`}throw new Error(c)}const s=await g.json();return a=0,s}catch(g){if(a<l)return a++,await new Promise(s=>setTimeout(s,1e3*Math.pow(2,a))),r(_);throw g instanceof Error?g:new Error(`Network error: ${String(g)}`)}}Fe();var u=Ga(),f=v(u);yt(f,()=>(J(n()),B(()=>r(n()))),_=>{Ct(_,{type:"spinner",message:"Searching database..."})},(_,g)=>{var s=S(),c=y(s);{var m=h=>{var b=Oa();o(h,b)},k=h=>{Ea(h,{get results(){return t(g)}})};F(c,h=>{J(t(g)),B(()=>t(g).length===0)?h(m):h(k,!1)})}o(_,s)},(_,g)=>{var s=Va(),c=v(s),m=v(c),k=$(v(m),2),h=$(v(k),2),b=v(h);V(()=>O(b,(J(t(g)),B(()=>t(g).message)))),o(_,s)}),o(i,u),j()}var Wa=x("<nav><!></nav>");function qa(i,e){z(e,!0);let n=I(e,"ref",15),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Wa();te(a,()=>({class:e.class,"aria-label":"breadcrumb",...d}));var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}var Ja=x("<li><!></li>");function Ya(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Ja();te(a,r=>({class:r,...d}),[()=>ae("inline-flex items-center gap-1.5",e.class)]);var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}var Za=x("<li><!></li>");function Qa(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Za();te(a,f=>({role:"presentation","aria-hidden":"true",class:f,...d}),[()=>ae("[&>svg]:size-3.5",e.class)]);var l=v(a);{var r=f=>{var _=S(),g=y(_);U(g,()=>e.children??Y),o(f,_)},u=f=>{ut(f,{})};F(l,f=>{e.children?f(r):f(u,!1)})}le(a,f=>n(f),()=>n()),o(i,a),j()}var Xa=x("<ol><!></ol>");function er(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=Xa();te(a,r=>({class:r,...d}),[()=>ae("text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5",e.class)]);var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}var tr=x("<span><!></span>");function ar(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=tr();te(a,r=>({role:"link","aria-disabled":"true","aria-current":"page",class:r,...d}),[()=>ae("text-foreground font-normal",e.class)]);var l=v(a);U(l,()=>e.children??Y),le(a,r=>n(r),()=>n()),o(i,a),j()}var rr=x('<div class="px-2 py-1.5 text-sm font-bold text-muted-foreground bg-muted/30 rounded border border-border/20 flex items-center justify-center min-w-[32px]">...</div>'),nr=x("<button> </button>"),sr=x("<!> <!>",1),or=x('<div class="max-w-4xl mx-auto mt-6 mb-6 px-4"><div class="bg-muted/20 rounded-md py-2 px-3 border border-border/30"><!></div></div>');function lr(i,e){z(e,!1);const[n,d]=Qe(),a=()=>Xe(Ze,"$breadcrumbs",n),l=ne(),r=ne(),u=ne();function f(c,m){Ze.navigateToBreadcrumb(c),Pt(m)}ue(()=>a(),()=>{D(l,(()=>{const c=a().length;if(c<=4)return a().map((m,k)=>({...m,originalIndex:k,showEllipsis:!1}));{const m=[];return m.push({...a()[0],originalIndex:0,showEllipsis:!1}),m.push({label:"...",path:"",timestamp:0,originalIndex:-1,showEllipsis:!0}),a().slice(-3).forEach((h,b)=>{m.push({...h,originalIndex:c-3+b,showEllipsis:!1})}),m}})())}),ue(()=>a(),()=>{D(r,(()=>{const c=a().length;return c<=3?"text-sm px-3 py-1.5":c<=4?"text-sm px-2.5 py-1.5":"text-xs px-2 py-1.5"})())}),ue(()=>a(),()=>{D(u,a().length>4)}),ft(),Fe();var _=S(),g=y(_);{var s=c=>{var m=or(),k=v(m),h=v(k);qa(h,{children:(b,R)=>{er(b,{class:"gap-1 flex-nowrap overflow-hidden",children:(T,w)=>{var p=S(),M=y(p);ge(M,1,()=>t(l),me,(N,C,Z)=>{var X=sr(),be=y(X);const ie=Oe(()=>t(u)?"flex-shrink min-w-0":"flex-shrink-0");Ya(be,{get class(){return t(ie)},children:(E,he)=>{var _e=S(),Ue=y(_e);{var pe=A=>{var G=rr();o(A,G)},P=(A,G)=>{{var we=L=>{const K=Oe(()=>t(r)),ee=Oe(()=>t(u)?"truncate max-w-[200px]":"");ar(L,{get class(){return`${t(K)??""} font-medium text-foreground bg-background/40 rounded border border-border/40 ${t(ee)??""}`},get title(){return t(C),B(()=>t(C).label)},children:(se,ce)=>{var ye=ve();V(()=>O(ye,(t(C),B(()=>t(C).label)))),o(se,ye)},$$slots:{default:!0}})},re=L=>{var K=nr(),ee=v(K);V(()=>{Gt(K,1,`${t(r)??""} text-muted-foreground hover:text-secondary-foreground hover:bg-secondary/60 transition-all duration-200 cursor-pointer rounded border border-transparent hover:border-border/40 ${t(u)?"truncate max-w-[200px]":""}`),Ve(K,"title",(t(C),B(()=>t(C).label))),O(ee,(t(C),B(()=>t(C).label)))}),Ut("click",K,()=>f(t(C).originalIndex,t(C).path)),o(L,K)};F(A,L=>{t(C),a(),B(()=>t(C).originalIndex===a().length-1)?L(we):L(re,!1)},G)}};F(Ue,A=>{t(C),B(()=>t(C).showEllipsis)?A(pe):A(P,!1)})}o(E,_e)},$$slots:{default:!0}});var Ie=$(be,2);{var Be=E=>{Qa(E,{class:"mx-1 flex-shrink-0",children:(he,_e)=>{ut(he,{class:"h-3 w-3 text-muted-foreground/50"})},$$slots:{default:!0}})};F(Ie,E=>{t(l),B(()=>Z<t(l).length-1)&&E(Be)})}o(N,X)}),o(T,p)},$$slots:{default:!0}})},$$slots:{default:!0}}),o(c,m)};F(g,c=>{a(),B(()=>a().length>1)&&c(s)})}o(i,_),j(),d()}var ir=x('<div class="space-y-8"><!> <div class="px-4 py-8 space-y-8"><!> <!></div></div>');function dr(i,e){z(e,!1);const n=ne(),d=ne();let a=ne("");typeof window<"u"&&D(a,window.location.search.substring(1));let l=I(e,"params",24,()=>({})),r=I(e,"apiPath",8),u=I(e,"paramKey",8),f=I(e,"breadcrumbLabel",8),_=I(e,"formatBreadcrumb",8,h=>h);ue(()=>(J(l()),J(u())),()=>{D(n,l()[u()])}),ue(()=>(J(r()),t(n),t(a)),()=>{D(d,`/api/v1/${r()}/${t(n)}?${t(a)}`)}),ue(()=>(t(n),J(_()),J(f())),()=>{if(t(n)){const h=_()(decodeURIComponent(t(n)));Ze.addFromLocation(`${f()}: ${h}`)}}),ft(),Fe();var g=ir(),s=v(g);lr(s,{});var c=$(s,2),m=v(c);Ua(m,{get endpoint(){return t(d)}});var k=$(m,2);Wt(k,e,"default",{}),o(i,g),j()}var cr=x('<div class="pb-4 pt-0"><!></div>');function vr(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class","children"]);var a=S(),l=y(a);const r=H(()=>ae("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all",e.class));Q(l,()=>qt,(u,f)=>{f(u,Ge({get class(){return t(r)}},()=>d,{get ref(){return n()},set ref(_){n(_)},children:(_,g)=>{var s=cr(),c=v(s);U(c,()=>e.children??Y),o(_,s)},$$slots:{default:!0}}))}),o(i,a),j()}function ur(i,e){z(e,!0);let n=I(e,"ref",15,null),d=W(e,["$$slots","$$events","$$legacy","ref","class"]);var a=S(),l=y(a);const r=H(()=>ae("border-b",e.class));Q(l,()=>Jt,(u,f)=>{f(u,Ge({get class(){return t(r)}},()=>d,{get ref(){return n()},set ref(_){n(_)}}))}),o(i,a),j()}/**
 * @license @lucide/svelte v0.482.0 - ISC
 *
 * ISC License
 * 
 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
 * 
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 * 
 */const fr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var gr=Yt("<svg><!><!></svg>");function mr(i,e){z(e,!0);const n=I(e,"color",3,"currentColor"),d=I(e,"size",3,24),a=I(e,"strokeWidth",3,2),l=I(e,"absoluteStrokeWidth",3,!1),r=I(e,"iconNode",19,()=>[]),u=W(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var f=gr();te(f,s=>({...fr,...u,width:d(),height:d(),stroke:n(),"stroke-width":s,class:["lucide-icon lucide",e.name&&`lucide-${e.name}`,e.class]}),[()=>l()?Number(a())*24/Number(d()):a()]);var _=v(f);ge(_,17,r,me,(s,c)=>{var m=H(()=>Qt(t(c),2));let k=()=>t(m)[0],h=()=>t(m)[1];var b=S(),R=y(b);Zt(R,k,!0,(T,w)=>{te(T,()=>({...h()}))}),o(s,b)});var g=$(_);U(g,()=>e.children??Y),o(i,f),j()}function hr(i,e){z(e,!0);let n=W(e,["$$slots","$$events","$$legacy"]);const d=[["path",{d:"m6 9 6 6 6-6"}]];mr(i,Ge({name:"chevron-down"},()=>n,{get iconNode(){return d},children:(a,l)=>{var r=S(),u=y(r);U(u,()=>e.children??Y),o(a,r)},$$slots:{default:!0}})),j()}var _r=x("<!> <!>",1);function xr(i,e){z(e,!0);let n=I(e,"ref",15,null),d=I(e,"level",3,3),a=W(e,["$$slots","$$events","$$legacy","ref","class","level","children"]);var l=S(),r=y(l);Q(r,()=>ea,(u,f)=>{f(u,{get level(){return d()},class:"flex",children:(_,g)=>{var s=S(),c=y(s);const m=H(()=>ae("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e.class));Q(c,()=>Xt,(k,h)=>{h(k,Ge({get class(){return t(m)}},()=>a,{get ref(){return n()},set ref(b){n(b)},children:(b,R)=>{var T=_r(),w=y(T);U(w,()=>e.children??Y);var p=$(w,2);hr(p,{class:"size-4 shrink-0 transition-transform duration-200"}),o(b,T)},$$slots:{default:!0}}))}),o(_,s)},$$slots:{default:!0}})}),o(i,l),j()}const br=ta;var pr=x('<div class="flex-shrink-0"><img class="w-16 h-16 rounded-lg object-contain shadow-sm"/></div>'),wr=x('<div class="flex items-end space-x-4 flex-1 pr-20"><!> <div class="flex-1 text-left flex flex-col justify-between h-16 no-underline"><h4 class="text-lg font-medium text-card-foreground no-underline"> </h4> <span class="text-sm text-muted-foreground flex items-center"><svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3a4 4 0 118 0v4m-4 6v8m-6 0h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"></path></svg> </span></div></div> <span class="absolute bottom-4 right-6 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-destructive/10 text-destructive"> </span>',1),yr=x('<div class="space-y-3 pt-2"><div class="flex items-center space-x-4 text-sm text-muted-foreground"><span class="flex items-center"><svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 0l-3-3m3 3l-3 3"></path></svg> </span></div> <div class="text-sm text-card-foreground prose prose-sm dark:prose-invert max-w-none prose-a:text-primary prose-a:no-underline hover:prose-a:underline"><!></div></div>'),kr=x("<!> <!>",1),Pr=x('<div class="max-w-4xl mx-auto mt-8 bg-accent/10"><div class="px-6 py-4 border-border rounded-t-lg"><div class="flex items-center justify-between"><div><h3 class="text-lg font-semibold text-card-foreground">Data Breaches</h3> <p class="text-sm text-muted-foreground"> </p></div> <!></div></div> <!></div>'),Sr=x('<div class="max-w-4xl mx-auto mt-8 text-center py-6"><svg class="mx-auto h-12 w-12 text-emerald-600 dark:text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <h3 class="mt-2 text-sm font-medium text-foreground">No breaches found</h3> <p class="mt-1 text-sm text-muted-foreground"><!></p></div>'),Cr=x('<div class="max-w-4xl mx-auto"><div class="mt-8 bg-accent/10 border border-accent/30 rounded-lg p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-amber-600 dark:text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg></div> <div class="ml-3"><h3 class="text-sm font-medium text-accent-foreground">Unable to check breaches</h3> <p class="mt-1 text-sm text-accent-foreground"> </p></div></div></div></div>'),$r=x('<div class="max-w-4xl mx-auto mt-8"><!></div>');function Fr(i,e){z(e,!1);let n=I(e,"email",8),d=localStorage.getItem("host"),a=ne([]),l=ne(!1);async function r(g){const s=await fetch(`${d}/api/v1/breaches/${g}`);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const c=await s.json();if(typeof c=="string")try{const m=JSON.parse(c);return Array.isArray(m)?m:[]}catch(m){return console.error("Failed to parse string response:",m),[]}return Array.isArray(c)?c:[]}function u(g){t(l)?D(a,[]):D(a,g.map((s,c)=>`item-${c}`)),D(l,!t(l))}Fe();var f=S(),_=y(f);yt(_,()=>(J(n()),B(()=>r(n()))),g=>{var s=$r(),c=v(s);Ct(c,{type:"spinner",message:"Checking breach databases..."}),o(g,s)},(g,s)=>{var c=S(),m=y(c);{var k=b=>{var R=Pr(),T=v(R),w=v(T),p=v(w),M=$(v(p),2),N=v(M),C=$(p,2);$e(C,{variant:"outline",size:"sm",onclick:()=>u(t(s)),children:(X,be)=>{var ie=ve();V(()=>O(ie,t(l)?"Collapse All":"Expand All")),o(X,ie)},$$slots:{default:!0}});var Z=$(T,2);br(Z,{type:"multiple",class:"w-full p-4 space-y-2 bg-background",get value(){return t(a)},set value(X){D(a,X)},children:(X,be)=>{var ie=S(),Ie=y(ie);ge(Ie,1,()=>t(s),me,(Be,E,he)=>{ur(Be,{value:`item-${he}`,class:"border border-border rounded-lg overflow-hidden bg-muted/50",children:(_e,Ue)=>{var pe=kr(),P=y(pe);xr(P,{class:"flex items-start justify-between w-full px-6 py-4 hover:bg-accent/50 transition-colors relative",children:(G,we)=>{var re=wr(),L=y(re),K=v(L);{var ee=q=>{var de=pr(),fe=v(de);V(()=>{Ve(fe,"src",(t(E),B(()=>t(E).LogoPath))),Ve(fe,"alt",(t(E),B(()=>t(E).Title)))}),o(q,de)};F(K,q=>{t(E),B(()=>t(E).LogoPath)&&q(ee)})}var se=$(K,2),ce=v(se),ye=v(ce),xe=$(ce,2),Te=$(v(xe)),Me=$(L,2),Re=v(Me);V(q=>{O(ye,(t(E),B(()=>t(E).Title))),O(Te,` ${t(E),B(()=>t(E).Date)??""}`),O(Re,`${q??""} accounts`)},[()=>(t(E),B(()=>Number(t(E).Count).toLocaleString()))],Oe),o(G,re)},$$slots:{default:!0}});var A=$(P,2);vr(A,{class:"px-6 pb-4",children:(G,we)=>{var re=yr(),L=v(re),K=v(L),ee=$(v(K)),se=$(L,2),ce=v(se);aa(ce,()=>(t(E),B(()=>t(E).Description))),V(()=>O(ee,` ${t(E),B(()=>t(E).Domain)??""}`)),o(G,re)},$$slots:{default:!0}}),o(_e,pe)},$$slots:{default:!0}})}),o(X,ie)},$$slots:{default:!0},$$legacy:!0}),V(()=>O(N,`Found ${J(t(s)),B(()=>t(s).length)??""} breach${J(t(s)),B(()=>t(s).length!==1?"es":"")??""} for this
                            email`)),o(b,R)},h=b=>{var R=Sr(),T=$(v(R),4),w=v(T);{var p=N=>{var C=ve("Unable to parse breach data from the API");o(N,C)},M=N=>{var C=ve("This email hasn't been found in any known data breaches");o(N,C)};F(w,N=>{J(t(s)),B(()=>!t(s)||!Array.isArray(t(s)))?N(p):N(M,!1)})}o(b,R)};F(m,b=>{J(t(s)),B(()=>t(s)&&Array.isArray(t(s))&&t(s).length>0)?b(k):b(h,!1)})}o(g,c)},(g,s)=>{var c=Cr(),m=v(c),k=v(m),h=$(v(k),2),b=$(v(h),2),R=v(b);V(()=>O(R,(J(t(s)),B(()=>t(s).message)))),o(g,c)}),o(i,f),j()}function Mr(i,e){z(e,!1);const[n,d]=Qe(),a=()=>Xe(kt,"$currentRoute",n),l=ne(),r=ne(),u=ne();let f=I(e,"params",24,()=>({}));function _(k){return k.length>20?k.substring(0,20)+"...":k}const g={email:{apiPath:"emails",paramKey:"email",label:"Email",hasHIBP:!0,formatter:void 0},domain:{apiPath:"domains",paramKey:"domain",label:"Domain",hasHIBP:!1,formatter:void 0},password:{apiPath:"passwords",paramKey:"password",label:"Password",hasHIBP:!1,formatter:_},username:{apiPath:"usernames",paramKey:"name",label:"Username",hasHIBP:!1,formatter:void 0}};ue(()=>a(),()=>{D(l,a().split("/")[1])}),ue(()=>t(l),()=>{D(r,g[t(l)])}),ue(()=>(J(f()),t(r)),()=>{D(u,f()[t(r)?.paramKey])}),ft(),Fe();var s=S(),c=y(s);{var m=k=>{const h=Oe(()=>(t(r),B(()=>t(r).formatter||(b=>b))));dr(k,{get params(){return f()},get apiPath(){return t(r),B(()=>t(r).apiPath)},get paramKey(){return t(r),B(()=>t(r).paramKey)},get breadcrumbLabel(){return t(r),B(()=>t(r).label)},get formatBreadcrumb(){return t(h)},children:(b,R)=>{var T=S(),w=y(T);{var p=M=>{Fr(M,{get email(){return t(u)}})};F(w,M=>{t(r),t(u),B(()=>t(r).hasHIBP&&t(u))&&M(p)})}o(b,T)},$$slots:{default:!0}})};F(c,k=>{t(r)&&k(m)})}o(i,s),j(),d()}export{Mr as default};
//# sourceMappingURL=SearchRoute-CqmG9KLN.js.map
