- • ${Tn.properties.advert.node_name||"Unknown Node"} (${Tn.properties.advert.contact_type})
-
`).join("");ha.bindPopup(`
+ `),we.value.push(pi)},200)};ps()},ra)},ea=()=>{if(!Ct||!re)return;const Eo=Ct.getBounds(),ys=Math.floor(Ct.getZoom());ae.value.forEach(Do=>{Ct&&Do.remove()}),ae.value.clear(),we.value.forEach(Do=>{Ct&&Do.remove()}),we.value.length=0,re.getClusters([Eo.getWest(),Eo.getSouth(),Eo.getEast(),Eo.getNorth()],ys).forEach(Do=>{const[ra,za]=Do.geometry.coordinates,Ea=Do.properties;if(Ea.cluster){const ca=Em.marker([za,ra],{icon:ti(Ea.point_count||0)}).addTo(Ct);ca.on("click",()=>{if(Ct&&re){const Sn=re.getClusterExpansionZoom(Ea.cluster_id);Ct.setView([za,ra],Sn)}});const ho=re.getLeaves(Ea.cluster_id,1/0).map(Sn=>`
+ • ${Sn.properties.advert.node_name||"Unknown Node"} (${Sn.properties.advert.contact_type})
+
`).join("");ca.bindPopup(`
No valid coordinates available
Configure base station location to view map
',1)]))),mr.value&&Yn.adverts.length>0?(yn(),Cn("button",{key:2,onClick:dt,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[li[1]||(li[1]=jt("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[jt("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),jt("span",Zst,On(Yn.showLegend?"Hide":"Show"),1)])):lo("",!0),mr.value&&Yn.adverts.length>0&&Yn.showLegend?(yn(),Cn("div",Gst,[li[2]||(li[2]=Ch('(yn(),Cn("tr",{key:Yn.id,class:"hover:bg-white/5 transition-colors",onMouseenter:li=>Gn(Yn.pubkey),onMouseleave:li=>ei(Yn.pubkey)},[jt("td",{class:Qa(on())},[bl(uP,{neighbor:Yn,onPing:Si,onDelete:ji},null,8,["neighbor"])],2),jt("td",{class:Qa(`${on()} text-white text-sm`)},On(Yn.node_name||"Unknown"),3),jt("td",{class:Qa(`${on()} text-white text-sm font-mono`)},[jt("button",{onClick:li=>Yr(Yn.pubkey),class:Qa(["text-white hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60",C.value===Yn.pubkey?"text-green-400 decoration-green-400/60":""]),title:C.value===Yn.pubkey?"Copied!":"Click to copy full public key"},[Ll(On(xt(Yn.pubkey))+" ",1),C.value===Yn.pubkey?(yn(),Cn("span",dlt,"✓")):lo("",!0)],10,flt)],2),jt("td",{class:Qa(`${on()} text-white text-sm`)},[Yn.latitude!==null&&Yn.longitude!==null?(yn(),Cn("div",plt,[jt("span",mlt,On(Yn.latitude.toFixed(4))+", "+On(Yn.longitude.toFixed(4)),1),jt("div",glt,[jt("button",{onClick:li=>mr(Yn.latitude,Yn.longitude),class:"text-white/60 hover:text-white transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},yi[2]||(yi[2]=[jt("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[jt("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),jt("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,vlt),jt("button",{onClick:li=>Sr(Yn.latitude,Yn.longitude),class:"text-white/60 hover:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},yi[3]||(yi[3]=[jt("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[jt("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),jt("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,ylt)])])):(yn(),Cn("span",xlt,"Unknown"))],2),jt("td",{class:Qa(`${on()} text-white text-sm`)},On(we(Yn)),3),jt("td",{class:Qa(`${on()} text-white text-sm`)},[jt("span",{class:Qa(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",Ct(Yn.route_type).bgColor,Ct(Yn.route_type).borderColor,Ct(Yn.route_type).textColor])},On(Ct(Yn.route_type).text),3)],2),jt("td",{class:Qa(`${on()} text-white text-sm`)},[jt("span",{class:Qa(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",Yn.zero_hop?"bg-green-500/20 border-green-400/30 text-green-400":"bg-orange-500/20 border-orange-400/30 text-orange-400"])},On(Yn.zero_hop?"Zero Hop":"Multi-Hop"),3)],2),jt("td",{class:Qa(`${on()} text-white text-sm`)},[jt("div",_lt,[jt("div",blt,[(yn(),Cn(_l,null,Fu(5,li=>jt("div",{key:li,class:Qa(["w-1 transition-colors",li<=zt(Yn.rssi).bars?zt(Yn.rssi).color:"text-gray-600"]),style:X0({height:`${4+li*2}px`})},yi[4]||(yi[4]=[jt("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),jt("span",{class:Qa(zt(Yn.rssi).color)},On(Ut(Yn.rssi)),3)])],2),jt("td",{class:Qa(`${on()} text-white text-sm`)},On(re(Yn.snr)),3),jt("td",{class:Qa(`${on()} text-white text-sm`)},[jt("div",wlt,[jt("div",{class:Qa(["w-2 h-2 rounded-full",Tr(Yn.last_seen).color==="text-green-400"?"bg-green-400":"",Tr(Yn.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",Tr(Yn.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),jt("span",{class:Qa([Tr(Yn.last_seen).color,"cursor-help"]),title:dt(Yn.last_seen)},On(fr(Yn.last_seen)),11,klt)])],2),jt("td",{class:Qa(`${on()} text-white text-sm`)},[jt("span",{title:dt(Yn.first_seen),class:"cursor-help"},On(fr(Yn.first_seen)),9,Tlt)],2),jt("td",{class:Qa(`${on()} text-white text-sm text-center`)},On(Yn.advert_count),3)],40,hlt))),128))])])]),jt("div",Alt,[(yn(!0),Cn(_l,null,Fu(nn.adverts,Yn=>(yn(),Cn("div",{key:Yn.id,class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 hover:bg-white/5 transition-colors",onClick:li=>Gn(Yn.pubkey)},[jt("div",Slt,[jt("div",Clt,[jt("h4",Elt,On(Yn.node_name||"Unknown Node"),1),jt("div",Llt,[jt("span",{class:Qa(["inline-block px-2 py-1 rounded-full text-xs border",Ct(Yn.route_type).bgColor,Ct(Yn.route_type).borderColor,Ct(Yn.route_type).textColor])},On(Ct(Yn.route_type).text),3),jt("span",{class:Qa(["inline-block px-2 py-1 rounded-full text-xs border",Yn.zero_hop?"bg-green-500/20 border-green-400/30 text-green-400":"bg-orange-500/20 border-orange-400/30 text-orange-400"])},On(Yn.zero_hop?"Zero Hop":"Multi-Hop"),3)])]),bl(uP,{neighbor:Yn,onPing:Si,onDelete:ji},null,8,["neighbor"])]),jt("div",Plt,[jt("div",zlt,[jt("div",null,[yi[5]||(yi[5]=jt("div",{class:"text-dark-text text-xs mb-1"},"Public Key",-1)),jt("button",{onClick:li=>Yr(Yn.pubkey),class:Qa(["text-white hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60 break-all",C.value===Yn.pubkey?"text-green-400 decoration-green-400/60":""]),title:C.value===Yn.pubkey?"Copied!":"Click to copy full public key"},[Ll(On(xt(Yn.pubkey))+" ",1),C.value===Yn.pubkey?(yn(),Cn("span",Olt,"✓")):lo("",!0)],10,Ilt)]),jt("div",null,[yi[7]||(yi[7]=jt("div",{class:"text-dark-text text-xs mb-1"},"Signal",-1)),jt("div",Dlt,[jt("div",Flt,[(yn(),Cn(_l,null,Fu(5,li=>jt("div",{key:li,class:Qa(["w-1.5 transition-colors",li<=zt(Yn.rssi).bars?zt(Yn.rssi).color:"text-gray-600"]),style:X0({height:`${6+li*2}px`})},yi[6]||(yi[6]=[jt("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),jt("span",{class:Qa(`${zt(Yn.rssi).color} text-sm font-medium`)},On(Ut(Yn.rssi)),3)])])]),jt("div",Rlt,[jt("div",null,[yi[8]||(yi[8]=jt("div",{class:"text-dark-text text-xs mb-1"},"Last Seen",-1)),jt("div",Blt,[jt("div",{class:Qa(["w-2 h-2 rounded-full",Tr(Yn.last_seen).color==="text-green-400"?"bg-green-400":"",Tr(Yn.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",Tr(Yn.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),jt("span",{class:Qa(`${Tr(Yn.last_seen).color} text-sm`),title:dt(Yn.last_seen)},On(fr(Yn.last_seen)),11,Nlt)])]),jt("div",null,[yi[9]||(yi[9]=jt("div",{class:"text-dark-text text-xs mb-1"},"Distance",-1)),jt("span",jlt,On(we(Yn)),1)])]),Yn.latitude!==null&&Yn.longitude!==null?(yn(),Cn("div",Ult,[yi[12]||(yi[12]=jt("div",{class:"text-dark-text text-xs mb-1"},"Location",-1)),jt("div",Vlt,[jt("span",Hlt,On(Yn.latitude.toFixed(4))+", "+On(Yn.longitude.toFixed(4)),1),jt("div",Wlt,[jt("button",{onClick:li=>mr(Yn.latitude,Yn.longitude),class:"text-white/60 hover:text-white transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Copy coordinates"},yi[10]||(yi[10]=[jt("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[jt("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),jt("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,$lt),jt("button",{onClick:li=>Sr(Yn.latitude,Yn.longitude),class:"text-white/60 hover:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},yi[11]||(yi[11]=[jt("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[jt("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),jt("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,qlt)])])])):lo("",!0),jt("div",Zlt,[jt("div",Glt,[yi[13]||(yi[13]=jt("div",{class:"text-dark-text text-xs mb-1"},"SNR",-1)),jt("span",Ylt,On(re(Yn.snr)),1)]),jt("div",Klt,[yi[14]||(yi[14]=jt("div",{class:"text-dark-text text-xs mb-1"},"Adverts",-1)),jt("span",Xlt,On(Yn.advert_count),1)]),jt("div",Jlt,[yi[15]||(yi[15]=jt("div",{class:"text-dark-text text-xs mb-1"},"First Seen",-1)),jt("span",{class:"text-white text-sm",title:dt(Yn.first_seen)},On(fr(Yn.first_seen)),9,Qlt)])])])],8,Mlt))),128))])]))}}),eut={class:"space-y-6"},rut={key:0,class:"flex items-center justify-center py-12"},nut={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},iut={class:"flex items-center gap-3"},aut={class:"text-accent-red/80 text-sm"},out={key:0,class:""},sut={class:"flex items-center justify-between"},lut={class:"flex items-center gap-3"},uut={class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 mb p-1"},cut={class:"flex items-center gap-2"},hut={key:0,class:"ml-1 bg-accent-blue/20 text-accent-blue border border-accent-blue/30 text-xs px-1.5 py-0.5 rounded-full font-medium"},fut={class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 mt-4 space-y-4"},dut={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},put={key:1,class:"text-center py-12"},mut={key:2,class:"text-center py-12"},gut=dc({name:"NeighborsView",__name:"Neighbors",setup(d){const o=mm(),C={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},B={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},Y=ca({}),dt=ca(!0),xt=ca(null),Ct=ca(!1),Ut=ca(typeof window<"u"?window.innerWidth>=1024:!0),re=ca(!1),ae=ca({zeroHop:"all",routeType:"all",searchText:""}),we=ca(!1),Xe=ca(null),fr=Bo(()=>{if(!Xe.value)return null;const Li=Xe.value;return{id:Li.id,pubkey:Li.pubkey,node_name:Li.node_name,contact_type:Li.contact_type,latitude:Li.latitude,longitude:Li.longitude,rssi:Li.rssi,snr:Li.snr,route_type:Li.route_type,last_seen:Li.last_seen,first_seen:Li.first_seen,advert_count:Li.advert_count,timestamp:Li.timestamp,is_repeater:Li.is_repeater,is_new_neighbor:Li.is_new_neighbor,zero_hop:Li.zero_hop}}),Tr=Bo(()=>o.stats?.config?.repeater?.latitude),mr=Bo(()=>o.stats?.config?.repeater?.longitude),Sr=Li=>Li.filter(Ln=>{if(ae.value.zeroHop!=="all"){const Kn=Ln.zero_hop;if(ae.value.zeroHop==="true"&&!Kn||ae.value.zeroHop==="false"&&Kn)return!1}if(ae.value.routeType!=="all"){const Kn=Ln.route_type;if(ae.value.routeType==="direct"&&Kn!==2||ae.value.routeType==="transport_direct"&&Kn!==3||ae.value.routeType==="flood"&&Kn!==1||ae.value.routeType==="transport_flood"&&Kn!==0)return!1}if(ae.value.searchText){const Kn=ae.value.searchText.toLowerCase(),pa=Ln.node_name?.toLowerCase()||"",rl=Ln.pubkey.toLowerCase();if(!pa.includes(Kn)&&!rl.includes(Kn))return!1}return!0}),Yr=()=>{ae.value={zeroHop:"all",routeType:"all",searchText:""}},zt=Bo(()=>ae.value.zeroHop!=="all"||ae.value.routeType!=="all"||ae.value.searchText!==""),on=Bo(()=>{const Li={};for(const[Ln,Kn]of Object.entries(Y.value))Li[Ln]=Sr(Kn);return Li}),ti=Bo(()=>Object.entries(C).filter(([Li])=>on.value[Li]?.length>0).sort(([Li],[Ln])=>parseInt(Li)-parseInt(Ln))),Gn=Bo(()=>Object.values(Y.value).flat().filter(Li=>{const Ln=Li.latitude,Kn=Li.longitude;return Ln!=null&&Ln!==0&&Kn!==null&&Kn!==void 0&&Kn!==0&&typeof Ln=="number"&&typeof Kn=="number"&&!isNaN(Ln)&&!isNaN(Kn)})),ei=async Li=>{try{const Ln=await Ou.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(Li)}&hours=168`);return Ln.success&&Array.isArray(Ln.data)?Ln.data:[]}catch(Ln){return console.error(`Error fetching adverts for contact type ${Li}:`,Ln),[]}},Si=async()=>{dt.value=!0,xt.value=null;try{Y.value={};for(const[Li,Ln]of Object.entries(C)){const Kn=await ei(Ln);Kn.length>0&&(Y.value[Li]=Kn)}}catch(Li){console.error("Error loading adverts:",Li),xt.value=Li instanceof Error?Li.message:"Failed to load neighbor data"}finally{dt.value=!1}},ji=ca(),nn=Li=>{ji.value?.highlightNode(Li)},yi=Li=>{ji.value?.unhighlightNode(Li)},Yn=async Li=>{const Ln=Li;try{const Kn=await Ou.post("/ping_neighbor",{pubkey:Ln.pubkey});Kn.success?console.log("Ping sent successfully"):console.error("Failed to ping neighbor:",Kn.error)}catch(Kn){console.error("Error pinging neighbor:",Kn)}},li=Li=>{Xe.value=Li,we.value=!0},jn=()=>{we.value=!1,Xe.value=null},$n=async Li=>{try{await Ou.deleteAdvert(Li),await Si(),jn()}catch(Ln){console.error("Error deleting neighbor:",Ln)}};return Vd(async()=>{await Si()}),(Li,Ln)=>(yn(),Cn("div",eut,[dt.value?(yn(),Cn("div",rut,Ln[7]||(Ln[7]=[jt("div",{class:"text-center"},[jt("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),jt("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):xt.value?(yn(),Cn("div",nut,[jt("div",iut,[Ln[9]||(Ln[9]=jt("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[jt("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-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),jt("div",null,[Ln[8]||(Ln[8]=jt("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),jt("p",aut,On(xt.value),1)])])])):(yn(),Cn(_l,{key:2},[bl(Jst,{ref_key:"networkMapRef",ref:ji,adverts:Gn.value,"base-latitude":Tr.value,"base-longitude":mr.value,"show-legend":Ut.value,"onUpdate:showLegend":Ln[0]||(Ln[0]=Kn=>Ut.value=Kn)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),Object.keys(Y.value).length>0?(yn(),Cn("div",out,[jt("div",sut,[Ln[14]||(Ln[14]=jt("span",{class:"text-white text-lg font-semibold"},null,-1)),jt("div",lut,[jt("div",uut,[jt("button",{onClick:Ln[1]||(Ln[1]=Kn=>Ct.value=!1),class:Qa(["p-2 rounded-md transition-colors",Ct.value?"text-white/60 hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},Ln[10]||(Ln[10]=[jt("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[jt("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),jt("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),jt("button",{onClick:Ln[2]||(Ln[2]=Kn=>Ct.value=!0),class:Qa(["p-2 rounded-md transition-colors",Ct.value?"bg-primary/20 text-primary border border-primary/30":"text-white/60 hover:text-primary hover:bg-primary/10"]),title:"Compact view"},Ln[11]||(Ln[11]=[jt("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[jt("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),jt("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),jt("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)]),jt("div",cut,[jt("button",{onClick:Ln[3]||(Ln[3]=Kn=>re.value=!re.value),class:Qa(["px-3 py-1.5 text-xs rounded-lg transition-colors border",zt.value?"bg-primary/20 text-primary border-primary/30":"bg-white/10 text-white border-white/20 hover:bg-white/20"])},[Ln[12]||(Ln[12]=jt("svg",{class:"w-4 h-4 inline mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[jt("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707v6.586a1 1 0 01-1.447.894l-4-2A1 1 0 717 18.586V13.414a1 1 0 00-.293-.707L.293 6.293A1 1 0 010 5.586V3a1 1 0 011-1z"})],-1)),Ln[13]||(Ln[13]=Ll(" Filters ",-1)),zt.value?(yn(),Cn("span",hut," Active ")):lo("",!0)],2),zt.value?(yn(),Cn("button",{key:0,onClick:Yr,class:"px-3 py-1.5 text-xs rounded-lg bg-white/10 text-white border border-white/20 hover:bg-white/20 transition-colors"}," Clear Filters ")):lo("",!0)])])]),Lc(jt("div",fut,[jt("div",dut,[jt("div",null,[Ln[16]||(Ln[16]=jt("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Zero Hop",-1)),Lc(jt("select",{"onUpdate:modelValue":Ln[4]||(Ln[4]=Kn=>ae.value.zeroHop=Kn),class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none"},Ln[15]||(Ln[15]=[jt("option",{value:"all"},"All Nodes",-1),jt("option",{value:"true"},"Zero Hop Only",-1),jt("option",{value:"false"},"Multi-Hop Only",-1)]),512),[[__,ae.value.zeroHop]])]),jt("div",null,[Ln[18]||(Ln[18]=jt("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Route Type",-1)),Lc(jt("select",{"onUpdate:modelValue":Ln[5]||(Ln[5]=Kn=>ae.value.routeType=Kn),class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none"},Ln[17]||(Ln[17]=[Ch('',5)]),512),[[__,ae.value.routeType]])]),jt("div",null,[Ln[19]||(Ln[19]=jt("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Search",-1)),Lc(jt("input",{"onUpdate:modelValue":Ln[6]||(Ln[6]=Kn=>ae.value.searchText=Kn),type:"text",placeholder:"Node name or pubkey...",class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none placeholder-white/40"},null,512),[[op,ae.value.searchText]])])])],512),[[u_,re.value]])])):lo("",!0),(yn(!0),Cn(_l,null,Fu(ti.value,([Kn,pa])=>(yn(),Cn("div",{key:Kn,class:"space-y-6"},[bl(tut,{"contact-type":pa,"contact-type-key":Kn,adverts:on.value[Kn],"original-count":Y.value[Kn]?.length||0,color:B[parseInt(Kn)],"base-latitude":Tr.value,"base-longitude":mr.value,"is-compact-view":Ct.value,"is-first-table":!1,"show-view-toggle":!1,onHighlightNode:nn,onUnhighlightNode:yi,onMenuPing:Yn,onMenuDelete:li},null,8,["contact-type","contact-type-key","adverts","original-count","color","base-latitude","base-longitude","is-compact-view"])]))),128)),ti.value.length===0&&Object.keys(Y.value).length===0?(yn(),Cn("div",put,[Ln[20]||(Ln[20]=Ch('No Neighbors Found
No mesh neighbors have been discovered in your area yet.
',3)),jt("button",{onClick:Si,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):ti.value.length===0&&zt.value?(yn(),Cn("div",mut,[Ln[21]||(Ln[21]=Ch('No neighbors match your filters
Try adjusting your filter criteria to see more results.
',3)),jt("button",{onClick:Yr,class:"px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Clear Filters ")])):lo("",!0)],64)),bl(Rst,{show:we.value,neighbor:fr.value,onClose:jn,onDelete:$n},null,8,["show","neighbor"])]))}});/*!
+ `);Ut.value.set(za.pubkey,Xo);const Ba=Xo.getElement();Ba&&(Ba.style.opacity="0",Ba.style.transition="opacity 0.5s ease-out"),Wn(za,Eo,ys,Ea,vo),setTimeout(()=>{Ba&&(Ba.style.opacity="1")},vo+1e3),vo+=100}})};if(Xe.value&&B.adverts.length>0)try{const Eo=_i(B.adverts);oi(Eo);const ys=Math.min(14,Ct.getZoom());Ct.setZoom(ys),setTimeout(()=>{try{ea()}catch(vo){console.warn("Error updating clusters:",vo),Ds(Hn,si)}},100),Ct.on("moveend",()=>{try{ea()}catch(vo){console.warn("Error updating clusters on move:",vo)}}),Ct.on("zoomend",()=>{try{ea()}catch(vo){console.warn("Error updating clusters on zoom:",vo)}})}catch(Eo){console.warn("Error initializing clustering:",Eo),Ds(Hn,si)}else Ds(Hn,si);setTimeout(()=>{Ct&&Ct.invalidateSize()},1e3)}catch(Yn){console.error("Error initializing map:",Yn)}};return o({highlightNode:Hn=>{const si=Ut.value.get(Hn);if(si){const Yn=si.getElement();if(Yn){const ti=Yn.querySelector("div");ti&&ti.classList.add("marker-highlight")}}},unhighlightNode:Hn=>{const si=Ut.value.get(Hn);if(si){const Yn=si.getElement();if(Yn){const ti=Yn.querySelector("div");ti&&ti.classList.remove("marker-highlight")}}},initializeOpenStreetMap:Kn}),Pm(()=>B.adverts,()=>{Ct&&mr.value&&setTimeout(()=>{Kn()},100)},{immediate:!1}),Vd(()=>{mr.value&&B.adverts.length>0&&setTimeout(()=>{Kn()},300)}),Fy(()=>{dn()}),(Hn,si)=>(yn(),An("div",flt,[mr.value?(yn(),An("div",{key:1,ref_key:"mapContainer",ref:xt,class:"leaflet-map-container h-96 w-full bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden",style:{"min-height":"384px",position:"relative"}},null,512)):(yn(),An("div",dlt,si[0]||(si[0]=[Ch('No valid coordinates available
Configure base station location to view map
',1)]))),mr.value&&Hn.adverts.length>0?(yn(),An("button",{key:2,onClick:dt,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[si[1]||(si[1]=Nt("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Nt("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),Nt("span",plt,Pn(Hn.showLegend?"Hide":"Show"),1)])):ro("",!0),mr.value&&Hn.adverts.length>0&&Hn.showLegend?(yn(),An("div",mlt,[si[2]||(si[2]=Ch('',2)),Nt("div",glt,Pn(Hn.adverts.length)+" node"+Pn(Hn.adverts.length!==1?"s":"")+" visible ",1)])):ro("",!0),mr.value?(yn(),An("div",vlt," © OpenStreetMap contributors © CARTO ")):ro("",!0)]))}}),xlt=Bf(ylt,[["__scopeId","data-v-9c7dd490"]]),_lt={class:"relative","data-menu-container":""},uP=dc({__name:"NeighborMenu",props:{neighbor:{},canPing:{type:Boolean}},emits:["ping","delete"],setup(d,{emit:o}){const C=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:Tr=>{if(C.activeMenu&&C.activeMenu!==Tr)try{C.activeMenu.closeMenu()}catch(mr){console.warn("Error closing previous menu:",mr)}C.activeMenu=Tr}};window.__neighborMenuManager=C;const B=d,Y=o,dt=da(!1),xt=da(),Ct=da({top:0,left:0}),Ut=()=>{dt.value=!1,document.removeEventListener("click",we,!0),document.removeEventListener("keydown",Xe),C.activeMenu===re&&(C.activeMenu=null)},re={closeMenu:Ut},ae=()=>{Ut(),Y("delete",B.neighbor)},we=Tr=>{Tr.target.closest("[data-menu-container]")||Ut()},Xe=Tr=>{Tr.key==="Escape"&&Ut()},fr=async()=>{if(!dt.value&&xt.value){C.setActiveMenu(re);const Tr=xt.value.getBoundingClientRect(),mr=window.innerWidth,Sr=144,Yr=mr<1024,Rt=Tr.left+Sr>mr-16;let ai=Tr.left;Yr&&Rt&&(ai=Tr.right-Sr),ai=Math.max(8,ai),Ct.value={top:Tr.bottom+4,left:ai},dt.value=!0,await L0(),document.addEventListener("click",we,!0),document.addEventListener("keydown",Xe)}else Ut()};return Fy(()=>{Ut()}),(Tr,mr)=>(yn(),An("div",_lt,[Nt("button",{ref_key:"buttonRef",ref:xt,onClick:fr,class:Xa(["p-1 rounded hover:bg-white/10 transition-colors text-white/60 hover:text-white/80",{"bg-white/10 text-white/80":dt.value}]),"data-menu-container":""},mr[0]||(mr[0]=[Nt("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Nt("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})],-1)]),2),(yn(),Rp(r7,{to:"body"},[dt.value?(yn(),An("div",{key:0,class:"fixed w-36 bg-dark-card/90 backdrop-blur-lg border border-white/20 rounded-[15px] shadow-2xl z-[999999]",style:P0({top:Ct.value.top+"px",left:Ct.value.left+"px"}),"data-menu-container":""},[Nt("div",{class:"py-2"},[Nt("button",{onClick:ae,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors"},mr[1]||(mr[1]=[Nt("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Nt("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),Nt("span",{class:"font-medium"},"Delete",-1)]))])],4)):ro("",!0)]))]))}}),blt={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},wlt={class:"flex items-center justify-between mb-4"},klt={class:"flex items-center gap-3"},Tlt={class:"text-white text-lg font-semibold"},Alt={class:"bg-white/10 text-white text-xs px-2 py-1 rounded-full"},Mlt={key:0,class:"text-white/60"},Slt={key:0,class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 p-1"},Clt={class:"hidden lg:block overflow-x-auto"},Elt={class:"w-full"},Llt={class:"bg-dark-bg/50"},Plt={class:"bg-dark-bg/30"},zlt=["onMouseenter","onMouseleave"],Ilt=["onClick","title"],Olt={key:0,class:"ml-1 text-xs"},Dlt={key:0,class:"flex items-center gap-3"},Flt={class:"text-white/70"},Rlt={class:"flex gap-1"},Blt=["onClick"],Nlt=["onClick"],jlt={key:1,class:"text-dark-text"},Ult={class:"flex items-center gap-2"},Vlt={class:"flex items-end gap-0.5"},Hlt={class:"flex items-center gap-2"},Wlt=["title"],$lt=["title"],qlt={class:"lg:hidden space-y-3"},Zlt=["onClick"],Glt={class:"flex items-center justify-between mb-3"},Ylt={class:"flex items-center gap-3"},Klt={class:"text-white font-medium text-base"},Xlt={class:"flex items-center gap-2"},Jlt={class:"grid grid-cols-1 gap-3"},Qlt={class:"grid grid-cols-2 gap-4"},tut=["onClick","title"],eut={key:0,class:"ml-1 text-xs"},rut={class:"flex items-center gap-2 justify-end"},nut={class:"flex items-end gap-0.5"},iut={class:"grid grid-cols-2 gap-4"},aut={class:"flex items-center gap-2"},out=["title"],sut={class:"text-white text-sm block text-right"},lut={key:0,class:"border-t border-white/10 pt-3"},uut={class:"flex items-center justify-between"},cut={class:"text-white/70 text-sm font-mono"},hut={class:"flex gap-2"},fut=["onClick"],dut=["onClick"],put={class:"grid grid-cols-3 gap-4 pt-3 border-t border-white/10"},mut={class:"text-center"},gut={class:"text-white text-sm font-medium"},vut={class:"text-center"},yut={class:"text-white text-sm font-medium"},xut={class:"text-center"},_ut=["title"],but=dc({__name:"NeighborTable",props:{contactType:{},contactTypeKey:{},adverts:{},originalCount:{default:0},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:["highlight-node","unhighlight-node","menu-ping","menu-delete","toggle-view"],setup(d,{emit:o}){const C=da(null),B=d,Y=o,dt=qr=>new Date(qr*1e3).toLocaleString(),xt=qr=>`${qr.slice(0,4)}...${qr.slice(-4)}`,Ct=qr=>{switch(qr){case 2:return{text:"Direct",bgColor:"bg-green-500/20",borderColor:"border-green-400/30",textColor:"text-green-400"};case 3:return{text:"Transport Direct",bgColor:"bg-green-600/20",borderColor:"border-green-500/30",textColor:"text-green-500"};case 1:return{text:"Flood",bgColor:"bg-yellow-500/20",borderColor:"border-yellow-400/30",textColor:"text-yellow-400"};case 0:return{text:"Transport Flood",bgColor:"bg-orange-500/20",borderColor:"border-orange-400/30",textColor:"text-orange-400"};default:return{text:"Unknown",bgColor:"bg-gray-500/20",borderColor:"border-gray-400/30",textColor:"text-gray-400"}}},Ut=qr=>qr?`${qr} dBm`:"N/A",re=qr=>qr?`${qr} dB`:"N/A",ae=(qr,hi,Hn,si)=>{const ti=(Hn-qr)*Math.PI/180,Pi=(si-hi)*Math.PI/180,Dn=Math.sin(ti/2)*Math.sin(ti/2)+Math.cos(qr*Math.PI/180)*Math.cos(Hn*Math.PI/180)*Math.sin(Pi/2)*Math.sin(Pi/2);return 6371*(2*Math.atan2(Math.sqrt(Dn),Math.sqrt(1-Dn)))},we=qr=>B.baseLatitude===null||B.baseLongitude===null||qr.latitude===null||qr.longitude===null?"N/A":`${ae(B.baseLatitude,B.baseLongitude,qr.latitude,qr.longitude).toFixed(1)} km`,Xe=async qr=>{try{return await navigator.clipboard.writeText(qr),!0}catch{const hi=document.createElement("textarea");return hi.value=qr,document.body.appendChild(hi),hi.select(),document.execCommand("copy"),document.body.removeChild(hi),!0}},fr=qr=>{const hi=Date.now(),Hn=qr*1e3,si=hi-Hn,Yn=Math.floor(si/1e3),ti=Math.floor(Yn/60),Pi=Math.floor(ti/60),Dn=Math.floor(Pi/24);return Yn<60?`${Yn}s ago`:ti<60?`${ti}m ago`:Pi<24?`${Pi}h ago`:`${Dn}d ago`},Tr=qr=>{const hi=Date.now(),Hn=qr*1e3,si=hi-Hn,Yn=Math.floor(si/(1e3*60*60));return Yn<1?{color:"text-green-400"}:Yn<26?{color:"text-yellow-400"}:{color:"text-red-400"}},mr=async(qr,hi)=>{const Hn=`${qr.toFixed(6)}, ${hi.toFixed(6)}`;await Xe(Hn)},Sr=(qr,hi)=>{const Hn=`https://www.google.com/maps?q=${qr},${hi}`;window.open(Hn,"_blank")},Yr=async qr=>{await Xe(qr),C.value=qr,setTimeout(()=>{C.value=null},2e3)},Rt=qr=>qr?qr>=-50?{bars:5,color:"text-green-400"}:qr>=-60?{bars:4,color:"text-green-300"}:qr>=-70?{bars:3,color:"text-yellow-400"}:qr>=-80?{bars:2,color:"text-orange-400"}:qr>=-90?{bars:1,color:"text-red-400"}:{bars:0,color:"text-red-500"}:{bars:0,color:"text-gray-400"},ai=()=>B.isCompactView?"py-2 px-2":"py-4 px-3",fn=()=>{Y("toggle-view")},dn=qr=>{Y("highlight-node",qr)},_i=qr=>{Y("unhighlight-node",qr)},oi=qr=>{Y("menu-ping",qr)},Kn=qr=>{Y("menu-delete",qr)};return(qr,hi)=>(yn(),An("div",blt,[Nt("div",wlt,[Nt("div",klt,[Nt("div",{class:"w-3 h-3 rounded-full border border-white/20",style:P0({backgroundColor:qr.color})},null,4),Nt("h3",Tlt,Pn(qr.contactType),1),Nt("span",Alt,[Sl(Pn(qr.adverts.length)+" ",1),qr.originalCount>0&&qr.adverts.length(yn(),An("tr",{key:Hn.id,class:"hover:bg-white/5 transition-colors",onMouseenter:si=>dn(Hn.pubkey),onMouseleave:si=>_i(Hn.pubkey)},[Nt("td",{class:Xa(ai())},[bl(uP,{neighbor:Hn,onPing:oi,onDelete:Kn},null,8,["neighbor"])],2),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},Pn(Hn.node_name||"Unknown"),3),Nt("td",{class:Xa(`${ai()} text-white text-sm font-mono`)},[Nt("button",{onClick:si=>Yr(Hn.pubkey),class:Xa(["text-white hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60",C.value===Hn.pubkey?"text-green-400 decoration-green-400/60":""]),title:C.value===Hn.pubkey?"Copied!":"Click to copy full public key"},[Sl(Pn(xt(Hn.pubkey))+" ",1),C.value===Hn.pubkey?(yn(),An("span",Olt,"✓")):ro("",!0)],10,Ilt)],2),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},[Hn.latitude!==null&&Hn.longitude!==null?(yn(),An("div",Dlt,[Nt("span",Flt,Pn(Hn.latitude.toFixed(4))+", "+Pn(Hn.longitude.toFixed(4)),1),Nt("div",Rlt,[Nt("button",{onClick:si=>mr(Hn.latitude,Hn.longitude),class:"text-white/60 hover:text-white transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},hi[2]||(hi[2]=[Nt("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Nt("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),Nt("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Blt),Nt("button",{onClick:si=>Sr(Hn.latitude,Hn.longitude),class:"text-white/60 hover:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},hi[3]||(hi[3]=[Nt("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Nt("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),Nt("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Nlt)])])):(yn(),An("span",jlt,"Unknown"))],2),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},Pn(we(Hn)),3),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},[Nt("span",{class:Xa(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",Ct(Hn.route_type).bgColor,Ct(Hn.route_type).borderColor,Ct(Hn.route_type).textColor])},Pn(Ct(Hn.route_type).text),3)],2),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},[Nt("span",{class:Xa(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",Hn.zero_hop?"bg-green-500/20 border-green-400/30 text-green-400":"bg-orange-500/20 border-orange-400/30 text-orange-400"])},Pn(Hn.zero_hop?"Zero Hop":"Multi-Hop"),3)],2),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},[Nt("div",Ult,[Nt("div",Vlt,[(yn(),An(vl,null,Du(5,si=>Nt("div",{key:si,class:Xa(["w-1 transition-colors",si<=Rt(Hn.rssi).bars?Rt(Hn.rssi).color:"text-gray-600"]),style:P0({height:`${4+si*2}px`})},hi[4]||(hi[4]=[Nt("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),Nt("span",{class:Xa(Rt(Hn.rssi).color)},Pn(Ut(Hn.rssi)),3)])],2),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},Pn(re(Hn.snr)),3),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},[Nt("div",Hlt,[Nt("div",{class:Xa(["w-2 h-2 rounded-full",Tr(Hn.last_seen).color==="text-green-400"?"bg-green-400":"",Tr(Hn.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",Tr(Hn.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),Nt("span",{class:Xa([Tr(Hn.last_seen).color,"cursor-help"]),title:dt(Hn.last_seen)},Pn(fr(Hn.last_seen)),11,Wlt)])],2),Nt("td",{class:Xa(`${ai()} text-white text-sm`)},[Nt("span",{title:dt(Hn.first_seen),class:"cursor-help"},Pn(fr(Hn.first_seen)),9,$lt)],2),Nt("td",{class:Xa(`${ai()} text-white text-sm text-center`)},Pn(Hn.advert_count),3)],40,zlt))),128))])])]),Nt("div",qlt,[(yn(!0),An(vl,null,Du(qr.adverts,Hn=>(yn(),An("div",{key:Hn.id,class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 hover:bg-white/5 transition-colors",onClick:si=>dn(Hn.pubkey)},[Nt("div",Glt,[Nt("div",Ylt,[Nt("h4",Klt,Pn(Hn.node_name||"Unknown Node"),1),Nt("div",Xlt,[Nt("span",{class:Xa(["inline-block px-2 py-1 rounded-full text-xs border",Ct(Hn.route_type).bgColor,Ct(Hn.route_type).borderColor,Ct(Hn.route_type).textColor])},Pn(Ct(Hn.route_type).text),3),Nt("span",{class:Xa(["inline-block px-2 py-1 rounded-full text-xs border",Hn.zero_hop?"bg-green-500/20 border-green-400/30 text-green-400":"bg-orange-500/20 border-orange-400/30 text-orange-400"])},Pn(Hn.zero_hop?"Zero Hop":"Multi-Hop"),3)])]),bl(uP,{neighbor:Hn,onPing:oi,onDelete:Kn},null,8,["neighbor"])]),Nt("div",Jlt,[Nt("div",Qlt,[Nt("div",null,[hi[5]||(hi[5]=Nt("div",{class:"text-dark-text text-xs mb-1"},"Public Key",-1)),Nt("button",{onClick:si=>Yr(Hn.pubkey),class:Xa(["text-white hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60 break-all",C.value===Hn.pubkey?"text-green-400 decoration-green-400/60":""]),title:C.value===Hn.pubkey?"Copied!":"Click to copy full public key"},[Sl(Pn(xt(Hn.pubkey))+" ",1),C.value===Hn.pubkey?(yn(),An("span",eut,"✓")):ro("",!0)],10,tut)]),Nt("div",null,[hi[7]||(hi[7]=Nt("div",{class:"text-dark-text text-xs mb-1"},"Signal",-1)),Nt("div",rut,[Nt("div",nut,[(yn(),An(vl,null,Du(5,si=>Nt("div",{key:si,class:Xa(["w-1.5 transition-colors",si<=Rt(Hn.rssi).bars?Rt(Hn.rssi).color:"text-gray-600"]),style:P0({height:`${6+si*2}px`})},hi[6]||(hi[6]=[Nt("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),Nt("span",{class:Xa(`${Rt(Hn.rssi).color} text-sm font-medium`)},Pn(Ut(Hn.rssi)),3)])])]),Nt("div",iut,[Nt("div",null,[hi[8]||(hi[8]=Nt("div",{class:"text-dark-text text-xs mb-1"},"Last Seen",-1)),Nt("div",aut,[Nt("div",{class:Xa(["w-2 h-2 rounded-full",Tr(Hn.last_seen).color==="text-green-400"?"bg-green-400":"",Tr(Hn.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",Tr(Hn.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),Nt("span",{class:Xa(`${Tr(Hn.last_seen).color} text-sm`),title:dt(Hn.last_seen)},Pn(fr(Hn.last_seen)),11,out)])]),Nt("div",null,[hi[9]||(hi[9]=Nt("div",{class:"text-dark-text text-xs mb-1"},"Distance",-1)),Nt("span",sut,Pn(we(Hn)),1)])]),Hn.latitude!==null&&Hn.longitude!==null?(yn(),An("div",lut,[hi[12]||(hi[12]=Nt("div",{class:"text-dark-text text-xs mb-1"},"Location",-1)),Nt("div",uut,[Nt("span",cut,Pn(Hn.latitude.toFixed(4))+", "+Pn(Hn.longitude.toFixed(4)),1),Nt("div",hut,[Nt("button",{onClick:si=>mr(Hn.latitude,Hn.longitude),class:"text-white/60 hover:text-white transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Copy coordinates"},hi[10]||(hi[10]=[Nt("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Nt("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),Nt("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,fut),Nt("button",{onClick:si=>Sr(Hn.latitude,Hn.longitude),class:"text-white/60 hover:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},hi[11]||(hi[11]=[Nt("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Nt("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),Nt("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,dut)])])])):ro("",!0),Nt("div",put,[Nt("div",mut,[hi[13]||(hi[13]=Nt("div",{class:"text-dark-text text-xs mb-1"},"SNR",-1)),Nt("span",gut,Pn(re(Hn.snr)),1)]),Nt("div",vut,[hi[14]||(hi[14]=Nt("div",{class:"text-dark-text text-xs mb-1"},"Adverts",-1)),Nt("span",yut,Pn(Hn.advert_count),1)]),Nt("div",xut,[hi[15]||(hi[15]=Nt("div",{class:"text-dark-text text-xs mb-1"},"First Seen",-1)),Nt("span",{class:"text-white text-sm",title:dt(Hn.first_seen)},Pn(fr(Hn.first_seen)),9,_ut)])])])],8,Zlt))),128))])]))}}),wut={class:"space-y-6"},kut={key:0,class:"flex items-center justify-center py-12"},Tut={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},Aut={class:"flex items-center gap-3"},Mut={class:"text-accent-red/80 text-sm"},Sut={key:0,class:""},Cut={class:"flex items-center justify-between"},Eut={class:"flex items-center gap-3"},Lut={class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 mb p-1"},Put={class:"flex items-center gap-2"},zut={key:0,class:"ml-1 bg-accent-blue/20 text-accent-blue border border-accent-blue/30 text-xs px-1.5 py-0.5 rounded-full font-medium"},Iut={class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 mt-4 space-y-4"},Out={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Dut={key:1,class:"text-center py-12"},Fut={key:2,class:"text-center py-12"},Rut=dc({name:"NeighborsView",__name:"Neighbors",setup(d){const o=mm(),C={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},B={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},Y=da({}),dt=da(!0),xt=da(null),Ct=da(!1),Ut=da(typeof window<"u"?window.innerWidth>=1024:!0),re=da(!1),ae=da({zeroHop:"all",routeType:"all",searchText:""}),we=da(!1),Xe=da(null),fr=Bo(()=>{if(!Xe.value)return null;const Pi=Xe.value;return{id:Pi.id,pubkey:Pi.pubkey,node_name:Pi.node_name,contact_type:Pi.contact_type,latitude:Pi.latitude,longitude:Pi.longitude,rssi:Pi.rssi,snr:Pi.snr,route_type:Pi.route_type,last_seen:Pi.last_seen,first_seen:Pi.first_seen,advert_count:Pi.advert_count,timestamp:Pi.timestamp,is_repeater:Pi.is_repeater,is_new_neighbor:Pi.is_new_neighbor,zero_hop:Pi.zero_hop}}),Tr=Bo(()=>o.stats?.config?.repeater?.latitude),mr=Bo(()=>o.stats?.config?.repeater?.longitude),Sr=Pi=>Pi.filter(Dn=>{if(ae.value.zeroHop!=="all"){const Wn=Dn.zero_hop;if(ae.value.zeroHop==="true"&&!Wn||ae.value.zeroHop==="false"&&Wn)return!1}if(ae.value.routeType!=="all"){const Wn=Dn.route_type;if(ae.value.routeType==="direct"&&Wn!==2||ae.value.routeType==="transport_direct"&&Wn!==3||ae.value.routeType==="flood"&&Wn!==1||ae.value.routeType==="transport_flood"&&Wn!==0)return!1}if(ae.value.searchText){const Wn=ae.value.searchText.toLowerCase(),ea=Dn.node_name?.toLowerCase()||"",Ds=Dn.pubkey.toLowerCase();if(!ea.includes(Wn)&&!Ds.includes(Wn))return!1}return!0}),Yr=()=>{ae.value={zeroHop:"all",routeType:"all",searchText:""}},Rt=Bo(()=>ae.value.zeroHop!=="all"||ae.value.routeType!=="all"||ae.value.searchText!==""),ai=Bo(()=>{const Pi={};for(const[Dn,Wn]of Object.entries(Y.value))Pi[Dn]=Sr(Wn);return Pi}),fn=Bo(()=>Object.entries(C).filter(([Pi])=>ai.value[Pi]?.length>0).sort(([Pi],[Dn])=>parseInt(Pi)-parseInt(Dn))),dn=Bo(()=>Object.values(Y.value).flat().filter(Pi=>{const Dn=Pi.latitude,Wn=Pi.longitude;return Dn!=null&&Dn!==0&&Wn!==null&&Wn!==void 0&&Wn!==0&&typeof Dn=="number"&&typeof Wn=="number"&&!isNaN(Dn)&&!isNaN(Wn)})),_i=async Pi=>{try{const Dn=await Ou.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(Pi)}&hours=168`);return Dn.success&&Array.isArray(Dn.data)?Dn.data:[]}catch(Dn){return console.error(`Error fetching adverts for contact type ${Pi}:`,Dn),[]}},oi=async()=>{dt.value=!0,xt.value=null;try{Y.value={};for(const[Pi,Dn]of Object.entries(C)){const Wn=await _i(Dn);Wn.length>0&&(Y.value[Pi]=Wn)}}catch(Pi){console.error("Error loading adverts:",Pi),xt.value=Pi instanceof Error?Pi.message:"Failed to load neighbor data"}finally{dt.value=!1}},Kn=da(),qr=Pi=>{Kn.value?.highlightNode(Pi)},hi=Pi=>{Kn.value?.unhighlightNode(Pi)},Hn=async Pi=>{const Dn=Pi;try{const Wn=await Ou.post("/ping_neighbor",{pubkey:Dn.pubkey});Wn.success?console.log("Ping sent successfully"):console.error("Failed to ping neighbor:",Wn.error)}catch(Wn){console.error("Error pinging neighbor:",Wn)}},si=Pi=>{Xe.value=Pi,we.value=!0},Yn=()=>{we.value=!1,Xe.value=null},ti=async Pi=>{try{await Ou.deleteAdvert(Pi),await oi(),Yn()}catch(Dn){console.error("Error deleting neighbor:",Dn)}};return Vd(async()=>{await oi()}),(Pi,Dn)=>(yn(),An("div",wut,[dt.value?(yn(),An("div",kut,Dn[7]||(Dn[7]=[Nt("div",{class:"text-center"},[Nt("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),Nt("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):xt.value?(yn(),An("div",Tut,[Nt("div",Aut,[Dn[9]||(Dn[9]=Nt("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Nt("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-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Nt("div",null,[Dn[8]||(Dn[8]=Nt("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),Nt("p",Mut,Pn(xt.value),1)])])])):(yn(),An(vl,{key:2},[bl(xlt,{ref_key:"networkMapRef",ref:Kn,adverts:dn.value,"base-latitude":Tr.value,"base-longitude":mr.value,"show-legend":Ut.value,"onUpdate:showLegend":Dn[0]||(Dn[0]=Wn=>Ut.value=Wn)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),Object.keys(Y.value).length>0?(yn(),An("div",Sut,[Nt("div",Cut,[Dn[14]||(Dn[14]=Nt("span",{class:"text-white text-lg font-semibold"},null,-1)),Nt("div",Eut,[Nt("div",Lut,[Nt("button",{onClick:Dn[1]||(Dn[1]=Wn=>Ct.value=!1),class:Xa(["p-2 rounded-md transition-colors",Ct.value?"text-white/60 hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},Dn[10]||(Dn[10]=[Nt("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Nt("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),Nt("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),Nt("button",{onClick:Dn[2]||(Dn[2]=Wn=>Ct.value=!0),class:Xa(["p-2 rounded-md transition-colors",Ct.value?"bg-primary/20 text-primary border border-primary/30":"text-white/60 hover:text-primary hover:bg-primary/10"]),title:"Compact view"},Dn[11]||(Dn[11]=[Nt("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Nt("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),Nt("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),Nt("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)]),Nt("div",Put,[Nt("button",{onClick:Dn[3]||(Dn[3]=Wn=>re.value=!re.value),class:Xa(["px-3 py-1.5 text-xs rounded-lg transition-colors border",Rt.value?"bg-primary/20 text-primary border-primary/30":"bg-white/10 text-white border-white/20 hover:bg-white/20"])},[Dn[12]||(Dn[12]=Nt("svg",{class:"w-4 h-4 inline mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Nt("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707v6.586a1 1 0 01-1.447.894l-4-2A1 1 0 717 18.586V13.414a1 1 0 00-.293-.707L.293 6.293A1 1 0 010 5.586V3a1 1 0 011-1z"})],-1)),Dn[13]||(Dn[13]=Sl(" Filters ",-1)),Rt.value?(yn(),An("span",zut," Active ")):ro("",!0)],2),Rt.value?(yn(),An("button",{key:0,onClick:Yr,class:"px-3 py-1.5 text-xs rounded-lg bg-white/10 text-white border border-white/20 hover:bg-white/20 transition-colors"}," Clear Filters ")):ro("",!0)])])]),Lc(Nt("div",Iut,[Nt("div",Out,[Nt("div",null,[Dn[16]||(Dn[16]=Nt("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Zero Hop",-1)),Lc(Nt("select",{"onUpdate:modelValue":Dn[4]||(Dn[4]=Wn=>ae.value.zeroHop=Wn),class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none"},Dn[15]||(Dn[15]=[Nt("option",{value:"all"},"All Nodes",-1),Nt("option",{value:"true"},"Zero Hop Only",-1),Nt("option",{value:"false"},"Multi-Hop Only",-1)]),512),[[__,ae.value.zeroHop]])]),Nt("div",null,[Dn[18]||(Dn[18]=Nt("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Route Type",-1)),Lc(Nt("select",{"onUpdate:modelValue":Dn[5]||(Dn[5]=Wn=>ae.value.routeType=Wn),class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none"},Dn[17]||(Dn[17]=[Ch('',5)]),512),[[__,ae.value.routeType]])]),Nt("div",null,[Dn[19]||(Dn[19]=Nt("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Search",-1)),Lc(Nt("input",{"onUpdate:modelValue":Dn[6]||(Dn[6]=Wn=>ae.value.searchText=Wn),type:"text",placeholder:"Node name or pubkey...",class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none placeholder-white/40"},null,512),[[op,ae.value.searchText]])])])],512),[[u_,re.value]])])):ro("",!0),(yn(!0),An(vl,null,Du(fn.value,([Wn,ea])=>(yn(),An("div",{key:Wn,class:"space-y-6"},[bl(but,{"contact-type":ea,"contact-type-key":Wn,adverts:ai.value[Wn],"original-count":Y.value[Wn]?.length||0,color:B[parseInt(Wn)],"base-latitude":Tr.value,"base-longitude":mr.value,"is-compact-view":Ct.value,"is-first-table":!1,"show-view-toggle":!1,onHighlightNode:qr,onUnhighlightNode:hi,onMenuPing:Hn,onMenuDelete:si},null,8,["contact-type","contact-type-key","adverts","original-count","color","base-latitude","base-longitude","is-compact-view"])]))),128)),fn.value.length===0&&Object.keys(Y.value).length===0?(yn(),An("div",Dut,[Dn[20]||(Dn[20]=Ch('No Neighbors Found
No mesh neighbors have been discovered in your area yet.
',3)),Nt("button",{onClick:oi,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):fn.value.length===0&&Rt.value?(yn(),An("div",Fut,[Dn[21]||(Dn[21]=Ch('No neighbors match your filters
Try adjusting your filter criteria to see more results.
',3)),Nt("button",{onClick:Yr,class:"px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Clear Filters ")])):ro("",!0)],64)),bl(ilt,{show:we.value,neighbor:fr.value,onClose:Yn,onDelete:ti},null,8,["show","neighbor"])]))}});/*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
- */function hw(d){return d+.5|0}const p1=(d,o,C)=>Math.max(Math.min(d,C),o);function b2(d){return p1(hw(d*2.55),0,255)}function _1(d){return p1(hw(d*255),0,255)}function ev(d){return p1(hw(d/2.55)/100,0,1)}function cP(d){return p1(hw(d*100),0,100)}const um={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zA=[..."0123456789ABCDEF"],vut=d=>zA[d&15],yut=d=>zA[(d&240)>>4]+zA[d&15],B5=d=>(d&240)>>4===(d&15),xut=d=>B5(d.r)&&B5(d.g)&&B5(d.b)&&B5(d.a);function _ut(d){var o=d.length,C;return d[0]==="#"&&(o===4||o===5?C={r:255&um[d[1]]*17,g:255&um[d[2]]*17,b:255&um[d[3]]*17,a:o===5?um[d[4]]*17:255}:(o===7||o===9)&&(C={r:um[d[1]]<<4|um[d[2]],g:um[d[3]]<<4|um[d[4]],b:um[d[5]]<<4|um[d[6]],a:o===9?um[d[7]]<<4|um[d[8]]:255})),C}const but=(d,o)=>d<255?o(d):"";function wut(d){var o=xut(d)?vut:yut;return d?"#"+o(d.r)+o(d.g)+o(d.b)+but(d.a,o):void 0}const kut=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function oD(d,o,C){const B=o*Math.min(C,1-C),Y=(dt,xt=(dt+d/30)%12)=>C-B*Math.max(Math.min(xt-3,9-xt,1),-1);return[Y(0),Y(8),Y(4)]}function Tut(d,o,C){const B=(Y,dt=(Y+d/60)%6)=>C-C*o*Math.max(Math.min(dt,4-dt,1),0);return[B(5),B(3),B(1)]}function Aut(d,o,C){const B=oD(d,1,.5);let Y;for(o+C>1&&(Y=1/(o+C),o*=Y,C*=Y),Y=0;Y<3;Y++)B[Y]*=1-o-C,B[Y]+=o;return B}function Mut(d,o,C,B,Y){return d===Y?(o-C)/B+(o.5?ae/(2-dt-xt):ae/(dt+xt),Ut=Mut(C,B,Y,ae,dt),Ut=Ut*60+.5),[Ut|0,re||0,Ct]}function x7(d,o,C,B){return(Array.isArray(o)?d(o[0],o[1],o[2]):d(o,C,B)).map(_1)}function _7(d,o,C){return x7(oD,d,o,C)}function Sut(d,o,C){return x7(Aut,d,o,C)}function Cut(d,o,C){return x7(Tut,d,o,C)}function sD(d){return(d%360+360)%360}function Eut(d){const o=kut.exec(d);let C=255,B;if(!o)return;o[5]!==B&&(C=o[6]?b2(+o[5]):_1(+o[5]));const Y=sD(+o[2]),dt=+o[3]/100,xt=+o[4]/100;return o[1]==="hwb"?B=Sut(Y,dt,xt):o[1]==="hsv"?B=Cut(Y,dt,xt):B=_7(Y,dt,xt),{r:B[0],g:B[1],b:B[2],a:C}}function Lut(d,o){var C=y7(d);C[0]=sD(C[0]+o),C=_7(C),d.r=C[0],d.g=C[1],d.b=C[2]}function Put(d){if(!d)return;const o=y7(d),C=o[0],B=cP(o[1]),Y=cP(o[2]);return d.a<255?`hsla(${C}, ${B}%, ${Y}%, ${ev(d.a)})`:`hsl(${C}, ${B}%, ${Y}%)`}const hP={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},fP={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function zut(){const d={},o=Object.keys(fP),C=Object.keys(hP);let B,Y,dt,xt,Ct;for(B=0;B>16&255,dt>>8&255,dt&255]}return d}let N5;function Iut(d){N5||(N5=zut(),N5.transparent=[0,0,0,0]);const o=N5[d.toLowerCase()];return o&&{r:o[0],g:o[1],b:o[2],a:o.length===4?o[3]:255}}const Out=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Dut(d){const o=Out.exec(d);let C=255,B,Y,dt;if(o){if(o[7]!==B){const xt=+o[7];C=o[8]?b2(xt):p1(xt*255,0,255)}return B=+o[1],Y=+o[3],dt=+o[5],B=255&(o[2]?b2(B):p1(B,0,255)),Y=255&(o[4]?b2(Y):p1(Y,0,255)),dt=255&(o[6]?b2(dt):p1(dt,0,255)),{r:B,g:Y,b:dt,a:C}}}function Fut(d){return d&&(d.a<255?`rgba(${d.r}, ${d.g}, ${d.b}, ${ev(d.a)})`:`rgb(${d.r}, ${d.g}, ${d.b})`)}const $8=d=>d<=.0031308?d*12.92:Math.pow(d,1/2.4)*1.055-.055,a_=d=>d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4);function Rut(d,o,C){const B=a_(ev(d.r)),Y=a_(ev(d.g)),dt=a_(ev(d.b));return{r:_1($8(B+C*(a_(ev(o.r))-B))),g:_1($8(Y+C*(a_(ev(o.g))-Y))),b:_1($8(dt+C*(a_(ev(o.b))-dt))),a:d.a+C*(o.a-d.a)}}function j5(d,o,C){if(d){let B=y7(d);B[o]=Math.max(0,Math.min(B[o]+B[o]*C,o===0?360:1)),B=_7(B),d.r=B[0],d.g=B[1],d.b=B[2]}}function lD(d,o){return d&&Object.assign(o||{},d)}function dP(d){var o={r:0,g:0,b:0,a:255};return Array.isArray(d)?d.length>=3&&(o={r:d[0],g:d[1],b:d[2],a:255},d.length>3&&(o.a=_1(d[3]))):(o=lD(d,{r:0,g:0,b:0,a:1}),o.a=_1(o.a)),o}function But(d){return d.charAt(0)==="r"?Dut(d):Eut(d)}class G2{constructor(o){if(o instanceof G2)return o;const C=typeof o;let B;C==="object"?B=dP(o):C==="string"&&(B=_ut(o)||Iut(o)||But(o)),this._rgb=B,this._valid=!!B}get valid(){return this._valid}get rgb(){var o=lD(this._rgb);return o&&(o.a=ev(o.a)),o}set rgb(o){this._rgb=dP(o)}rgbString(){return this._valid?Fut(this._rgb):void 0}hexString(){return this._valid?wut(this._rgb):void 0}hslString(){return this._valid?Put(this._rgb):void 0}mix(o,C){if(o){const B=this.rgb,Y=o.rgb;let dt;const xt=C===dt?.5:C,Ct=2*xt-1,Ut=B.a-Y.a,re=((Ct*Ut===-1?Ct:(Ct+Ut)/(1+Ct*Ut))+1)/2;dt=1-re,B.r=255&re*B.r+dt*Y.r+.5,B.g=255&re*B.g+dt*Y.g+.5,B.b=255&re*B.b+dt*Y.b+.5,B.a=xt*B.a+(1-xt)*Y.a,this.rgb=B}return this}interpolate(o,C){return o&&(this._rgb=Rut(this._rgb,o._rgb,C)),this}clone(){return new G2(this.rgb)}alpha(o){return this._rgb.a=_1(o),this}clearer(o){const C=this._rgb;return C.a*=1-o,this}greyscale(){const o=this._rgb,C=hw(o.r*.3+o.g*.59+o.b*.11);return o.r=o.g=o.b=C,this}opaquer(o){const C=this._rgb;return C.a*=1+o,this}negate(){const o=this._rgb;return o.r=255-o.r,o.g=255-o.g,o.b=255-o.b,this}lighten(o){return j5(this._rgb,2,o),this}darken(o){return j5(this._rgb,2,-o),this}saturate(o){return j5(this._rgb,1,o),this}desaturate(o){return j5(this._rgb,1,-o),this}rotate(o){return Lut(this._rgb,o),this}}/*!
+ */function hw(d){return d+.5|0}const p1=(d,o,C)=>Math.max(Math.min(d,C),o);function b2(d){return p1(hw(d*2.55),0,255)}function _1(d){return p1(hw(d*255),0,255)}function ev(d){return p1(hw(d/2.55)/100,0,1)}function cP(d){return p1(hw(d*100),0,100)}const um={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zA=[..."0123456789ABCDEF"],But=d=>zA[d&15],Nut=d=>zA[(d&240)>>4]+zA[d&15],B5=d=>(d&240)>>4===(d&15),jut=d=>B5(d.r)&&B5(d.g)&&B5(d.b)&&B5(d.a);function Uut(d){var o=d.length,C;return d[0]==="#"&&(o===4||o===5?C={r:255&um[d[1]]*17,g:255&um[d[2]]*17,b:255&um[d[3]]*17,a:o===5?um[d[4]]*17:255}:(o===7||o===9)&&(C={r:um[d[1]]<<4|um[d[2]],g:um[d[3]]<<4|um[d[4]],b:um[d[5]]<<4|um[d[6]],a:o===9?um[d[7]]<<4|um[d[8]]:255})),C}const Vut=(d,o)=>d<255?o(d):"";function Hut(d){var o=jut(d)?But:Nut;return d?"#"+o(d.r)+o(d.g)+o(d.b)+Vut(d.a,o):void 0}const Wut=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function oD(d,o,C){const B=o*Math.min(C,1-C),Y=(dt,xt=(dt+d/30)%12)=>C-B*Math.max(Math.min(xt-3,9-xt,1),-1);return[Y(0),Y(8),Y(4)]}function $ut(d,o,C){const B=(Y,dt=(Y+d/60)%6)=>C-C*o*Math.max(Math.min(dt,4-dt,1),0);return[B(5),B(3),B(1)]}function qut(d,o,C){const B=oD(d,1,.5);let Y;for(o+C>1&&(Y=1/(o+C),o*=Y,C*=Y),Y=0;Y<3;Y++)B[Y]*=1-o-C,B[Y]+=o;return B}function Zut(d,o,C,B,Y){return d===Y?(o-C)/B+(o.5?ae/(2-dt-xt):ae/(dt+xt),Ut=Zut(C,B,Y,ae,dt),Ut=Ut*60+.5),[Ut|0,re||0,Ct]}function x7(d,o,C,B){return(Array.isArray(o)?d(o[0],o[1],o[2]):d(o,C,B)).map(_1)}function _7(d,o,C){return x7(oD,d,o,C)}function Gut(d,o,C){return x7(qut,d,o,C)}function Yut(d,o,C){return x7($ut,d,o,C)}function sD(d){return(d%360+360)%360}function Kut(d){const o=Wut.exec(d);let C=255,B;if(!o)return;o[5]!==B&&(C=o[6]?b2(+o[5]):_1(+o[5]));const Y=sD(+o[2]),dt=+o[3]/100,xt=+o[4]/100;return o[1]==="hwb"?B=Gut(Y,dt,xt):o[1]==="hsv"?B=Yut(Y,dt,xt):B=_7(Y,dt,xt),{r:B[0],g:B[1],b:B[2],a:C}}function Xut(d,o){var C=y7(d);C[0]=sD(C[0]+o),C=_7(C),d.r=C[0],d.g=C[1],d.b=C[2]}function Jut(d){if(!d)return;const o=y7(d),C=o[0],B=cP(o[1]),Y=cP(o[2]);return d.a<255?`hsla(${C}, ${B}%, ${Y}%, ${ev(d.a)})`:`hsl(${C}, ${B}%, ${Y}%)`}const hP={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},fP={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Qut(){const d={},o=Object.keys(fP),C=Object.keys(hP);let B,Y,dt,xt,Ct;for(B=0;B>16&255,dt>>8&255,dt&255]}return d}let N5;function tct(d){N5||(N5=Qut(),N5.transparent=[0,0,0,0]);const o=N5[d.toLowerCase()];return o&&{r:o[0],g:o[1],b:o[2],a:o.length===4?o[3]:255}}const ect=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rct(d){const o=ect.exec(d);let C=255,B,Y,dt;if(o){if(o[7]!==B){const xt=+o[7];C=o[8]?b2(xt):p1(xt*255,0,255)}return B=+o[1],Y=+o[3],dt=+o[5],B=255&(o[2]?b2(B):p1(B,0,255)),Y=255&(o[4]?b2(Y):p1(Y,0,255)),dt=255&(o[6]?b2(dt):p1(dt,0,255)),{r:B,g:Y,b:dt,a:C}}}function nct(d){return d&&(d.a<255?`rgba(${d.r}, ${d.g}, ${d.b}, ${ev(d.a)})`:`rgb(${d.r}, ${d.g}, ${d.b})`)}const $8=d=>d<=.0031308?d*12.92:Math.pow(d,1/2.4)*1.055-.055,a_=d=>d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4);function ict(d,o,C){const B=a_(ev(d.r)),Y=a_(ev(d.g)),dt=a_(ev(d.b));return{r:_1($8(B+C*(a_(ev(o.r))-B))),g:_1($8(Y+C*(a_(ev(o.g))-Y))),b:_1($8(dt+C*(a_(ev(o.b))-dt))),a:d.a+C*(o.a-d.a)}}function j5(d,o,C){if(d){let B=y7(d);B[o]=Math.max(0,Math.min(B[o]+B[o]*C,o===0?360:1)),B=_7(B),d.r=B[0],d.g=B[1],d.b=B[2]}}function lD(d,o){return d&&Object.assign(o||{},d)}function dP(d){var o={r:0,g:0,b:0,a:255};return Array.isArray(d)?d.length>=3&&(o={r:d[0],g:d[1],b:d[2],a:255},d.length>3&&(o.a=_1(d[3]))):(o=lD(d,{r:0,g:0,b:0,a:1}),o.a=_1(o.a)),o}function act(d){return d.charAt(0)==="r"?rct(d):Kut(d)}class G2{constructor(o){if(o instanceof G2)return o;const C=typeof o;let B;C==="object"?B=dP(o):C==="string"&&(B=Uut(o)||tct(o)||act(o)),this._rgb=B,this._valid=!!B}get valid(){return this._valid}get rgb(){var o=lD(this._rgb);return o&&(o.a=ev(o.a)),o}set rgb(o){this._rgb=dP(o)}rgbString(){return this._valid?nct(this._rgb):void 0}hexString(){return this._valid?Hut(this._rgb):void 0}hslString(){return this._valid?Jut(this._rgb):void 0}mix(o,C){if(o){const B=this.rgb,Y=o.rgb;let dt;const xt=C===dt?.5:C,Ct=2*xt-1,Ut=B.a-Y.a,re=((Ct*Ut===-1?Ct:(Ct+Ut)/(1+Ct*Ut))+1)/2;dt=1-re,B.r=255&re*B.r+dt*Y.r+.5,B.g=255&re*B.g+dt*Y.g+.5,B.b=255&re*B.b+dt*Y.b+.5,B.a=xt*B.a+(1-xt)*Y.a,this.rgb=B}return this}interpolate(o,C){return o&&(this._rgb=ict(this._rgb,o._rgb,C)),this}clone(){return new G2(this.rgb)}alpha(o){return this._rgb.a=_1(o),this}clearer(o){const C=this._rgb;return C.a*=1-o,this}greyscale(){const o=this._rgb,C=hw(o.r*.3+o.g*.59+o.b*.11);return o.r=o.g=o.b=C,this}opaquer(o){const C=this._rgb;return C.a*=1+o,this}negate(){const o=this._rgb;return o.r=255-o.r,o.g=255-o.g,o.b=255-o.b,this}lighten(o){return j5(this._rgb,2,o),this}darken(o){return j5(this._rgb,2,-o),this}saturate(o){return j5(this._rgb,1,o),this}desaturate(o){return j5(this._rgb,1,-o),this}rotate(o){return Xut(this._rgb,o),this}}/*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
- */function Xg(){}const Nut=(()=>{let d=0;return()=>d++})();function Uh(d){return d==null}function Xd(d){if(Array.isArray&&Array.isArray(d))return!0;const o=Object.prototype.toString.call(d);return o.slice(0,7)==="[object"&&o.slice(-6)==="Array]"}function Pc(d){return d!==null&&Object.prototype.toString.call(d)==="[object Object]"}function r0(d){return(typeof d=="number"||d instanceof Number)&&isFinite(+d)}function sg(d,o){return r0(d)?d:o}function fc(d,o){return typeof d>"u"?o:d}const jut=(d,o)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100:+d/o,uD=(d,o)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100*o:+d;function Rf(d,o,C){if(d&&typeof d.call=="function")return d.apply(C,o)}function tf(d,o,C,B){let Y,dt,xt;if(Xd(d))for(dt=d.length,Y=0;Yd,x:d=>d.x,y:d=>d.y};function Hut(d){const o=d.split("."),C=[];let B="";for(const Y of o)B+=Y,B.endsWith("\\")?B=B.slice(0,-1)+".":(C.push(B),B="");return C}function Wut(d){const o=Hut(d);return C=>{for(const B of o){if(B==="")break;C=C&&C[B]}return C}}function Oy(d,o){return(pP[o]||(pP[o]=Wut(o)))(d)}function b7(d){return d.charAt(0).toUpperCase()+d.slice(1)}const K2=d=>typeof d<"u",k1=d=>typeof d=="function",mP=(d,o)=>{if(d.size!==o.size)return!1;for(const C of d)if(!o.has(C))return!1;return!0};function $ut(d){return d.type==="mouseup"||d.type==="click"||d.type==="contextmenu"}const ef=Math.PI,ld=2*ef,qut=ld+ef,A4=Number.POSITIVE_INFINITY,Zut=ef/180,sp=ef/2,my=ef/4,gP=ef*2/3,hD=Math.log10,vg=Math.sign;function O2(d,o,C){return Math.abs(d-o)Y-dt).pop(),o}function Yut(d){return typeof d=="symbol"||typeof d=="object"&&d!==null&&!(Symbol.toPrimitive in d||"toString"in d||"valueOf"in d)}function X2(d){return!Yut(d)&&!isNaN(parseFloat(d))&&isFinite(d)}function Kut(d,o){const C=Math.round(d);return C-o<=d&&C+o>=d}function Xut(d,o,C){let B,Y,dt;for(B=0,Y=d.length;BUt&&re=Math.min(o,C)-B&&d<=Math.max(o,C)+B}function w7(d,o,C){C=C||(xt=>d[xt]1;)dt=Y+B>>1,C(dt)?Y=dt:B=dt;return{lo:Y,hi:B}}const My=(d,o,C,B)=>w7(d,C,B?Y=>{const dt=d[Y][o];return dtd[Y][o]w7(d,C,B=>d[B][o]>=C);function rct(d,o,C){let B=0,Y=d.length;for(;BB&&d[Y-1]>C;)Y--;return B>0||Y{const B="_onData"+b7(C),Y=d[C];Object.defineProperty(d,C,{configurable:!0,enumerable:!1,value(...dt){const xt=Y.apply(this,dt);return d._chartjs.listeners.forEach(Ct=>{typeof Ct[B]=="function"&&Ct[B](...dt)}),xt}})})}function xP(d,o){const C=d._chartjs;if(!C)return;const B=C.listeners,Y=B.indexOf(o);Y!==-1&&B.splice(Y,1),!(B.length>0)&&(dD.forEach(dt=>{delete d[dt]}),delete d._chartjs)}function pD(d){const o=new Set(d);return o.size===d.length?d:Array.from(o)}const mD=function(){return typeof window>"u"?function(d){return d()}:window.requestAnimationFrame}();function gD(d,o){let C=[],B=!1;return function(...Y){C=Y,B||(B=!0,mD.call(window,()=>{B=!1,d.apply(o,C)}))}}function ict(d,o){let C;return function(...B){return o?(clearTimeout(C),C=setTimeout(d,o,B)):d.apply(this,B),o}}const k7=d=>d==="start"?"left":d==="end"?"right":"center",Gp=(d,o,C)=>d==="start"?o:d==="end"?C:(o+C)/2,act=(d,o,C,B)=>d===(B?"left":"right")?C:d==="center"?(o+C)/2:o;function oct(d,o,C){const B=o.length;let Y=0,dt=B;if(d._sorted){const{iScale:xt,vScale:Ct,_parsed:Ut}=d,re=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null,ae=xt.axis,{min:we,max:Xe,minDefined:fr,maxDefined:Tr}=xt.getUserBounds();if(fr){if(Y=Math.min(My(Ut,ae,we).lo,C?B:My(o,ae,xt.getPixelForValue(we)).lo),re){const mr=Ut.slice(0,Y+1).reverse().findIndex(Sr=>!Uh(Sr[Ct.axis]));Y-=Math.max(0,mr)}Y=t0(Y,0,B-1)}if(Tr){let mr=Math.max(My(Ut,xt.axis,Xe,!0).hi+1,C?0:My(o,ae,xt.getPixelForValue(Xe),!0).hi+1);if(re){const Sr=Ut.slice(mr-1).findIndex(Yr=>!Uh(Yr[Ct.axis]));mr+=Math.max(0,Sr)}dt=t0(mr,Y,B)-Y}else dt=B-Y}return{start:Y,count:dt}}function sct(d){const{xScale:o,yScale:C,_scaleRanges:B}=d,Y={xmin:o.min,xmax:o.max,ymin:C.min,ymax:C.max};if(!B)return d._scaleRanges=Y,!0;const dt=B.xmin!==o.min||B.xmax!==o.max||B.ymin!==C.min||B.ymax!==C.max;return Object.assign(B,Y),dt}const U5=d=>d===0||d===1,_P=(d,o,C)=>-(Math.pow(2,10*(d-=1))*Math.sin((d-o)*ld/C)),bP=(d,o,C)=>Math.pow(2,-10*d)*Math.sin((d-o)*ld/C)+1,D2={linear:d=>d,easeInQuad:d=>d*d,easeOutQuad:d=>-d*(d-2),easeInOutQuad:d=>(d/=.5)<1?.5*d*d:-.5*(--d*(d-2)-1),easeInCubic:d=>d*d*d,easeOutCubic:d=>(d-=1)*d*d+1,easeInOutCubic:d=>(d/=.5)<1?.5*d*d*d:.5*((d-=2)*d*d+2),easeInQuart:d=>d*d*d*d,easeOutQuart:d=>-((d-=1)*d*d*d-1),easeInOutQuart:d=>(d/=.5)<1?.5*d*d*d*d:-.5*((d-=2)*d*d*d-2),easeInQuint:d=>d*d*d*d*d,easeOutQuint:d=>(d-=1)*d*d*d*d+1,easeInOutQuint:d=>(d/=.5)<1?.5*d*d*d*d*d:.5*((d-=2)*d*d*d*d+2),easeInSine:d=>-Math.cos(d*sp)+1,easeOutSine:d=>Math.sin(d*sp),easeInOutSine:d=>-.5*(Math.cos(ef*d)-1),easeInExpo:d=>d===0?0:Math.pow(2,10*(d-1)),easeOutExpo:d=>d===1?1:-Math.pow(2,-10*d)+1,easeInOutExpo:d=>U5(d)?d:d<.5?.5*Math.pow(2,10*(d*2-1)):.5*(-Math.pow(2,-10*(d*2-1))+2),easeInCirc:d=>d>=1?d:-(Math.sqrt(1-d*d)-1),easeOutCirc:d=>Math.sqrt(1-(d-=1)*d),easeInOutCirc:d=>(d/=.5)<1?-.5*(Math.sqrt(1-d*d)-1):.5*(Math.sqrt(1-(d-=2)*d)+1),easeInElastic:d=>U5(d)?d:_P(d,.075,.3),easeOutElastic:d=>U5(d)?d:bP(d,.075,.3),easeInOutElastic(d){return U5(d)?d:d<.5?.5*_P(d*2,.1125,.45):.5+.5*bP(d*2-1,.1125,.45)},easeInBack(d){return d*d*((1.70158+1)*d-1.70158)},easeOutBack(d){return(d-=1)*d*((1.70158+1)*d+1.70158)+1},easeInOutBack(d){let o=1.70158;return(d/=.5)<1?.5*(d*d*(((o*=1.525)+1)*d-o)):.5*((d-=2)*d*(((o*=1.525)+1)*d+o)+2)},easeInBounce:d=>1-D2.easeOutBounce(1-d),easeOutBounce(d){return d<1/2.75?7.5625*d*d:d<2/2.75?7.5625*(d-=1.5/2.75)*d+.75:d<2.5/2.75?7.5625*(d-=2.25/2.75)*d+.9375:7.5625*(d-=2.625/2.75)*d+.984375},easeInOutBounce:d=>d<.5?D2.easeInBounce(d*2)*.5:D2.easeOutBounce(d*2-1)*.5+.5};function T7(d){if(d&&typeof d=="object"){const o=d.toString();return o==="[object CanvasPattern]"||o==="[object CanvasGradient]"}return!1}function wP(d){return T7(d)?d:new G2(d)}function q8(d){return T7(d)?d:new G2(d).saturate(.5).darken(.1).hexString()}const lct=["x","y","borderWidth","radius","tension"],uct=["color","borderColor","backgroundColor"];function cct(d){d.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),d.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:o=>o!=="onProgress"&&o!=="onComplete"&&o!=="fn"}),d.set("animations",{colors:{type:"color",properties:uct},numbers:{type:"number",properties:lct}}),d.describe("animations",{_fallback:"animation"}),d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:o=>o|0}}}})}function hct(d){d.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const kP=new Map;function fct(d,o){o=o||{};const C=d+JSON.stringify(o);let B=kP.get(C);return B||(B=new Intl.NumberFormat(d,o),kP.set(C,B)),B}function A7(d,o,C){return fct(o,C).format(d)}const dct={values(d){return Xd(d)?d:""+d},numeric(d,o,C){if(d===0)return"0";const B=this.chart.options.locale;let Y,dt=d;if(C.length>1){const re=Math.max(Math.abs(C[0].value),Math.abs(C[C.length-1].value));(re<1e-4||re>1e15)&&(Y="scientific"),dt=pct(d,C)}const xt=hD(Math.abs(dt)),Ct=isNaN(xt)?1:Math.max(Math.min(-1*Math.floor(xt),20),0),Ut={notation:Y,minimumFractionDigits:Ct,maximumFractionDigits:Ct};return Object.assign(Ut,this.options.ticks.format),A7(d,B,Ut)}};function pct(d,o){let C=o.length>3?o[2].value-o[1].value:o[1].value-o[0].value;return Math.abs(C)>=1&&d!==Math.floor(d)&&(C=d-Math.floor(d)),C}var vD={formatters:dct};function mct(d){d.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(o,C)=>C.lineWidth,tickColor:(o,C)=>C.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:vD.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),d.route("scale.ticks","color","","color"),d.route("scale.grid","color","","borderColor"),d.route("scale.border","color","","borderColor"),d.route("scale.title","color","","color"),d.describe("scale",{_fallback:!1,_scriptable:o=>!o.startsWith("before")&&!o.startsWith("after")&&o!=="callback"&&o!=="parser",_indexable:o=>o!=="borderDash"&&o!=="tickBorderDash"&&o!=="dash"}),d.describe("scales",{_fallback:"scale"}),d.describe("scale.ticks",{_scriptable:o=>o!=="backdropPadding"&&o!=="callback",_indexable:o=>o!=="backdropPadding"})}const Dy=Object.create(null),OA=Object.create(null);function F2(d,o){if(!o)return d;const C=o.split(".");for(let B=0,Y=C.length;BB.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(B,Y)=>q8(Y.backgroundColor),this.hoverBorderColor=(B,Y)=>q8(Y.borderColor),this.hoverColor=(B,Y)=>q8(Y.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(o),this.apply(C)}set(o,C){return Z8(this,o,C)}get(o){return F2(this,o)}describe(o,C){return Z8(OA,o,C)}override(o,C){return Z8(Dy,o,C)}route(o,C,B,Y){const dt=F2(this,o),xt=F2(this,B),Ct="_"+C;Object.defineProperties(dt,{[Ct]:{value:dt[C],writable:!0},[C]:{enumerable:!0,get(){const Ut=this[Ct],re=xt[Y];return Pc(Ut)?Object.assign({},re,Ut):fc(Ut,re)},set(Ut){this[Ct]=Ut}}})}apply(o){o.forEach(C=>C(this))}}var Bd=new gct({_scriptable:d=>!d.startsWith("on"),_indexable:d=>d!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cct,hct,mct]);function vct(d){return!d||Uh(d.size)||Uh(d.family)?null:(d.style?d.style+" ":"")+(d.weight?d.weight+" ":"")+d.size+"px "+d.family}function TP(d,o,C,B,Y){let dt=o[Y];return dt||(dt=o[Y]=d.measureText(Y).width,C.push(Y)),dt>B&&(B=dt),B}function gy(d,o,C){const B=d.currentDevicePixelRatio,Y=C!==0?Math.max(C/2,.5):0;return Math.round((o-Y)*B)/B+Y}function AP(d,o){!o&&!d||(o=o||d.getContext("2d"),o.save(),o.resetTransform(),o.clearRect(0,0,d.width,d.height),o.restore())}function DA(d,o,C,B){yD(d,o,C,B,null)}function yD(d,o,C,B,Y){let dt,xt,Ct,Ut,re,ae,we,Xe;const fr=o.pointStyle,Tr=o.rotation,mr=o.radius;let Sr=(Tr||0)*Zut;if(fr&&typeof fr=="object"&&(dt=fr.toString(),dt==="[object HTMLImageElement]"||dt==="[object HTMLCanvasElement]")){d.save(),d.translate(C,B),d.rotate(Sr),d.drawImage(fr,-fr.width/2,-fr.height/2,fr.width,fr.height),d.restore();return}if(!(isNaN(mr)||mr<=0)){switch(d.beginPath(),fr){default:Y?d.ellipse(C,B,Y/2,mr,0,0,ld):d.arc(C,B,mr,0,ld),d.closePath();break;case"triangle":ae=Y?Y/2:mr,d.moveTo(C+Math.sin(Sr)*ae,B-Math.cos(Sr)*mr),Sr+=gP,d.lineTo(C+Math.sin(Sr)*ae,B-Math.cos(Sr)*mr),Sr+=gP,d.lineTo(C+Math.sin(Sr)*ae,B-Math.cos(Sr)*mr),d.closePath();break;case"rectRounded":re=mr*.516,Ut=mr-re,xt=Math.cos(Sr+my)*Ut,we=Math.cos(Sr+my)*(Y?Y/2-re:Ut),Ct=Math.sin(Sr+my)*Ut,Xe=Math.sin(Sr+my)*(Y?Y/2-re:Ut),d.arc(C-we,B-Ct,re,Sr-ef,Sr-sp),d.arc(C+Xe,B-xt,re,Sr-sp,Sr),d.arc(C+we,B+Ct,re,Sr,Sr+sp),d.arc(C-Xe,B+xt,re,Sr+sp,Sr+ef),d.closePath();break;case"rect":if(!Tr){Ut=Math.SQRT1_2*mr,ae=Y?Y/2:Ut,d.rect(C-ae,B-Ut,2*ae,2*Ut);break}Sr+=my;case"rectRot":we=Math.cos(Sr)*(Y?Y/2:mr),xt=Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,Xe=Math.sin(Sr)*(Y?Y/2:mr),d.moveTo(C-we,B-Ct),d.lineTo(C+Xe,B-xt),d.lineTo(C+we,B+Ct),d.lineTo(C-Xe,B+xt),d.closePath();break;case"crossRot":Sr+=my;case"cross":we=Math.cos(Sr)*(Y?Y/2:mr),xt=Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,Xe=Math.sin(Sr)*(Y?Y/2:mr),d.moveTo(C-we,B-Ct),d.lineTo(C+we,B+Ct),d.moveTo(C+Xe,B-xt),d.lineTo(C-Xe,B+xt);break;case"star":we=Math.cos(Sr)*(Y?Y/2:mr),xt=Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,Xe=Math.sin(Sr)*(Y?Y/2:mr),d.moveTo(C-we,B-Ct),d.lineTo(C+we,B+Ct),d.moveTo(C+Xe,B-xt),d.lineTo(C-Xe,B+xt),Sr+=my,we=Math.cos(Sr)*(Y?Y/2:mr),xt=Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,Xe=Math.sin(Sr)*(Y?Y/2:mr),d.moveTo(C-we,B-Ct),d.lineTo(C+we,B+Ct),d.moveTo(C+Xe,B-xt),d.lineTo(C-Xe,B+xt);break;case"line":xt=Y?Y/2:Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,d.moveTo(C-xt,B-Ct),d.lineTo(C+xt,B+Ct);break;case"dash":d.moveTo(C,B),d.lineTo(C+Math.cos(Sr)*(Y?Y/2:mr),B+Math.sin(Sr)*mr);break;case!1:d.closePath();break}d.fill(),o.borderWidth>0&&d.stroke()}}function Q2(d,o,C){return C=C||.5,!o||d&&d.x>o.left-C&&d.xo.top-C&&d.y0&&dt.strokeColor!=="";let Ut,re;for(d.save(),d.font=Y.string,_ct(d,dt),Ut=0;Ut+d||0;function M7(d,o){const C={},B=Pc(o),Y=B?Object.keys(o):o,dt=Pc(d)?B?xt=>fc(d[xt],d[o[xt]]):xt=>d[xt]:()=>d;for(const xt of Y)C[xt]=Mct(dt(xt));return C}function xD(d){return M7(d,{top:"y",right:"x",bottom:"y",left:"x"})}function m_(d){return M7(d,["topLeft","topRight","bottomLeft","bottomRight"])}function pm(d){const o=xD(d);return o.width=o.left+o.right,o.height=o.top+o.bottom,o}function e0(d,o){d=d||{},o=o||Bd.font;let C=fc(d.size,o.size);typeof C=="string"&&(C=parseInt(C,10));let B=fc(d.style,o.style);B&&!(""+B).match(Tct)&&(console.warn('Invalid font style specified: "'+B+'"'),B=void 0);const Y={family:fc(d.family,o.family),lineHeight:Act(fc(d.lineHeight,o.lineHeight),C),size:C,style:B,weight:fc(d.weight,o.weight),string:""};return Y.string=vct(Y),Y}function V5(d,o,C,B){let Y,dt,xt;for(Y=0,dt=d.length;YC&&Ct===0?0:Ct+Ut;return{min:xt(B,-Math.abs(dt)),max:xt(Y,dt)}}function Ry(d,o){return Object.assign(Object.create(d),o)}function S7(d,o=[""],C,B,Y=()=>d[0]){const dt=C||d;typeof B>"u"&&(B=kD("_fallback",d));const xt={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:d,_rootScopes:dt,_fallback:B,_getTarget:Y,override:Ct=>S7([Ct,...d],o,dt,B)};return new Proxy(xt,{deleteProperty(Ct,Ut){return delete Ct[Ut],delete Ct._keys,delete d[0][Ut],!0},get(Ct,Ut){return bD(Ct,Ut,()=>Dct(Ut,o,d,Ct))},getOwnPropertyDescriptor(Ct,Ut){return Reflect.getOwnPropertyDescriptor(Ct._scopes[0],Ut)},getPrototypeOf(){return Reflect.getPrototypeOf(d[0])},has(Ct,Ut){return SP(Ct).includes(Ut)},ownKeys(Ct){return SP(Ct)},set(Ct,Ut,re){const ae=Ct._storage||(Ct._storage=Y());return Ct[Ut]=ae[Ut]=re,delete Ct._keys,!0}})}function T_(d,o,C,B){const Y={_cacheable:!1,_proxy:d,_context:o,_subProxy:C,_stack:new Set,_descriptors:_D(d,B),setContext:dt=>T_(d,dt,C,B),override:dt=>T_(d.override(dt),o,C,B)};return new Proxy(Y,{deleteProperty(dt,xt){return delete dt[xt],delete d[xt],!0},get(dt,xt,Ct){return bD(dt,xt,()=>Ect(dt,xt,Ct))},getOwnPropertyDescriptor(dt,xt){return dt._descriptors.allKeys?Reflect.has(d,xt)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(d,xt)},getPrototypeOf(){return Reflect.getPrototypeOf(d)},has(dt,xt){return Reflect.has(d,xt)},ownKeys(){return Reflect.ownKeys(d)},set(dt,xt,Ct){return d[xt]=Ct,delete dt[xt],!0}})}function _D(d,o={scriptable:!0,indexable:!0}){const{_scriptable:C=o.scriptable,_indexable:B=o.indexable,_allKeys:Y=o.allKeys}=d;return{allKeys:Y,scriptable:C,indexable:B,isScriptable:k1(C)?C:()=>C,isIndexable:k1(B)?B:()=>B}}const Cct=(d,o)=>d?d+b7(o):o,C7=(d,o)=>Pc(o)&&d!=="adapters"&&(Object.getPrototypeOf(o)===null||o.constructor===Object);function bD(d,o,C){if(Object.prototype.hasOwnProperty.call(d,o)||o==="constructor")return d[o];const B=C();return d[o]=B,B}function Ect(d,o,C){const{_proxy:B,_context:Y,_subProxy:dt,_descriptors:xt}=d;let Ct=B[o];return k1(Ct)&&xt.isScriptable(o)&&(Ct=Lct(o,Ct,d,C)),Xd(Ct)&&Ct.length&&(Ct=Pct(o,Ct,d,xt.isIndexable)),C7(o,Ct)&&(Ct=T_(Ct,Y,dt&&dt[o],xt)),Ct}function Lct(d,o,C,B){const{_proxy:Y,_context:dt,_subProxy:xt,_stack:Ct}=C;if(Ct.has(d))throw new Error("Recursion detected: "+Array.from(Ct).join("->")+"->"+d);Ct.add(d);let Ut=o(dt,xt||B);return Ct.delete(d),C7(d,Ut)&&(Ut=E7(Y._scopes,Y,d,Ut)),Ut}function Pct(d,o,C,B){const{_proxy:Y,_context:dt,_subProxy:xt,_descriptors:Ct}=C;if(typeof dt.index<"u"&&B(d))return o[dt.index%o.length];if(Pc(o[0])){const Ut=o,re=Y._scopes.filter(ae=>ae!==Ut);o=[];for(const ae of Ut){const we=E7(re,Y,d,ae);o.push(T_(we,dt,xt&&xt[d],Ct))}}return o}function wD(d,o,C){return k1(d)?d(o,C):d}const zct=(d,o)=>d===!0?o:typeof d=="string"?Oy(o,d):void 0;function Ict(d,o,C,B,Y){for(const dt of o){const xt=zct(C,dt);if(xt){d.add(xt);const Ct=wD(xt._fallback,C,Y);if(typeof Ct<"u"&&Ct!==C&&Ct!==B)return Ct}else if(xt===!1&&typeof B<"u"&&C!==B)return null}return!1}function E7(d,o,C,B){const Y=o._rootScopes,dt=wD(o._fallback,C,B),xt=[...d,...Y],Ct=new Set;Ct.add(B);let Ut=MP(Ct,xt,C,dt||C,B);return Ut===null||typeof dt<"u"&&dt!==C&&(Ut=MP(Ct,xt,dt,Ut,B),Ut===null)?!1:S7(Array.from(Ct),[""],Y,dt,()=>Oct(o,C,B))}function MP(d,o,C,B,Y){for(;C;)C=Ict(d,o,C,B,Y);return C}function Oct(d,o,C){const B=d._getTarget();o in B||(B[o]={});const Y=B[o];return Xd(Y)&&Pc(C)?C:Y||{}}function Dct(d,o,C,B){let Y;for(const dt of o)if(Y=kD(Cct(dt,d),C),typeof Y<"u")return C7(d,Y)?E7(C,B,d,Y):Y}function kD(d,o){for(const C of o){if(!C)continue;const B=C[d];if(typeof B<"u")return B}}function SP(d){let o=d._keys;return o||(o=d._keys=Fct(d._scopes)),o}function Fct(d){const o=new Set;for(const C of d)for(const B of Object.keys(C).filter(Y=>!Y.startsWith("_")))o.add(B);return Array.from(o)}const Rct=Number.EPSILON||1e-14,A_=(d,o)=>od==="x"?"y":"x";function Bct(d,o,C,B){const Y=d.skip?o:d,dt=o,xt=C.skip?o:C,Ct=IA(dt,Y),Ut=IA(xt,dt);let re=Ct/(Ct+Ut),ae=Ut/(Ct+Ut);re=isNaN(re)?0:re,ae=isNaN(ae)?0:ae;const we=B*re,Xe=B*ae;return{previous:{x:dt.x-we*(xt.x-Y.x),y:dt.y-we*(xt.y-Y.y)},next:{x:dt.x+Xe*(xt.x-Y.x),y:dt.y+Xe*(xt.y-Y.y)}}}function Nct(d,o,C){const B=d.length;let Y,dt,xt,Ct,Ut,re=A_(d,0);for(let ae=0;ae!re.skip)),o.cubicInterpolationMode==="monotone")Uct(d,Y);else{let re=B?d[d.length-1]:d[0];for(dt=0,xt=d.length;dtd.ownerDocument.defaultView.getComputedStyle(d,null);function Wct(d,o){return r6(d).getPropertyValue(o)}const $ct=["top","right","bottom","left"];function Ly(d,o,C){const B={};C=C?"-"+C:"";for(let Y=0;Y<4;Y++){const dt=$ct[Y];B[dt]=parseFloat(d[o+"-"+dt+C])||0}return B.width=B.left+B.right,B.height=B.top+B.bottom,B}const qct=(d,o,C)=>(d>0||o>0)&&(!C||!C.shadowRoot);function Zct(d,o){const C=d.touches,B=C&&C.length?C[0]:d,{offsetX:Y,offsetY:dt}=B;let xt=!1,Ct,Ut;if(qct(Y,dt,d.target))Ct=Y,Ut=dt;else{const re=o.getBoundingClientRect();Ct=B.clientX-re.left,Ut=B.clientY-re.top,xt=!0}return{x:Ct,y:Ut,box:xt}}function xy(d,o){if("native"in d)return d;const{canvas:C,currentDevicePixelRatio:B}=o,Y=r6(C),dt=Y.boxSizing==="border-box",xt=Ly(Y,"padding"),Ct=Ly(Y,"border","width"),{x:Ut,y:re,box:ae}=Zct(d,C),we=xt.left+(ae&&Ct.left),Xe=xt.top+(ae&&Ct.top);let{width:fr,height:Tr}=o;return dt&&(fr-=xt.width+Ct.width,Tr-=xt.height+Ct.height),{x:Math.round((Ut-we)/fr*C.width/B),y:Math.round((re-Xe)/Tr*C.height/B)}}function Gct(d,o,C){let B,Y;if(o===void 0||C===void 0){const dt=d&&P7(d);if(!dt)o=d.clientWidth,C=d.clientHeight;else{const xt=dt.getBoundingClientRect(),Ct=r6(dt),Ut=Ly(Ct,"border","width"),re=Ly(Ct,"padding");o=xt.width-re.width-Ut.width,C=xt.height-re.height-Ut.height,B=S4(Ct.maxWidth,dt,"clientWidth"),Y=S4(Ct.maxHeight,dt,"clientHeight")}}return{width:o,height:C,maxWidth:B||A4,maxHeight:Y||A4}}const m1=d=>Math.round(d*10)/10;function Yct(d,o,C,B){const Y=r6(d),dt=Ly(Y,"margin"),xt=S4(Y.maxWidth,d,"clientWidth")||A4,Ct=S4(Y.maxHeight,d,"clientHeight")||A4,Ut=Gct(d,o,C);let{width:re,height:ae}=Ut;if(Y.boxSizing==="content-box"){const Xe=Ly(Y,"border","width"),fr=Ly(Y,"padding");re-=fr.width+Xe.width,ae-=fr.height+Xe.height}return re=Math.max(0,re-dt.width),ae=Math.max(0,B?re/B:ae-dt.height),re=m1(Math.min(re,xt,Ut.maxWidth)),ae=m1(Math.min(ae,Ct,Ut.maxHeight)),re&&!ae&&(ae=m1(re/2)),(o!==void 0||C!==void 0)&&B&&Ut.height&&ae>Ut.height&&(ae=Ut.height,re=m1(Math.floor(ae*B))),{width:re,height:ae}}function CP(d,o,C){const B=o||1,Y=m1(d.height*B),dt=m1(d.width*B);d.height=m1(d.height),d.width=m1(d.width);const xt=d.canvas;return xt.style&&(C||!xt.style.height&&!xt.style.width)&&(xt.style.height=`${d.height}px`,xt.style.width=`${d.width}px`),d.currentDevicePixelRatio!==B||xt.height!==Y||xt.width!==dt?(d.currentDevicePixelRatio=B,xt.height=Y,xt.width=dt,d.ctx.setTransform(B,0,0,B,0,0),!0):!1}const Kct=function(){let d=!1;try{const o={get passive(){return d=!0,!1}};L7()&&(window.addEventListener("test",null,o),window.removeEventListener("test",null,o))}catch{}return d}();function EP(d,o){const C=Wct(d,o),B=C&&C.match(/^(\d+)(\.\d+)?px$/);return B?+B[1]:void 0}function _y(d,o,C,B){return{x:d.x+C*(o.x-d.x),y:d.y+C*(o.y-d.y)}}function Xct(d,o,C,B){return{x:d.x+C*(o.x-d.x),y:B==="middle"?C<.5?d.y:o.y:B==="after"?C<1?d.y:o.y:C>0?o.y:d.y}}function Jct(d,o,C,B){const Y={x:d.cp2x,y:d.cp2y},dt={x:o.cp1x,y:o.cp1y},xt=_y(d,Y,C),Ct=_y(Y,dt,C),Ut=_y(dt,o,C),re=_y(xt,Ct,C),ae=_y(Ct,Ut,C);return _y(re,ae,C)}const Qct=function(d,o){return{x(C){return d+d+o-C},setWidth(C){o=C},textAlign(C){return C==="center"?C:C==="right"?"left":"right"},xPlus(C,B){return C-B},leftForLtr(C,B){return C-B}}},tht=function(){return{x(d){return d},setWidth(d){},textAlign(d){return d},xPlus(d,o){return d+o},leftForLtr(d,o){return d}}};function g_(d,o,C){return d?Qct(o,C):tht()}function AD(d,o){let C,B;(o==="ltr"||o==="rtl")&&(C=d.canvas.style,B=[C.getPropertyValue("direction"),C.getPropertyPriority("direction")],C.setProperty("direction",o,"important"),d.prevTextDirection=B)}function MD(d,o){o!==void 0&&(delete d.prevTextDirection,d.canvas.style.setProperty("direction",o[0],o[1]))}function SD(d){return d==="angle"?{between:J2,compare:Qut,normalize:Y0}:{between:ov,compare:(o,C)=>o-C,normalize:o=>o}}function LP({start:d,end:o,count:C,loop:B,style:Y}){return{start:d%C,end:o%C,loop:B&&(o-d+1)%C===0,style:Y}}function eht(d,o,C){const{property:B,start:Y,end:dt}=C,{between:xt,normalize:Ct}=SD(B),Ut=o.length;let{start:re,end:ae,loop:we}=d,Xe,fr;if(we){for(re+=Ut,ae+=Ut,Xe=0,fr=Ut;XeUt(Y,on,Yr)&&Ct(Y,on)!==0,Gn=()=>Ct(dt,Yr)===0||Ut(dt,on,Yr),ei=()=>mr||ti(),Si=()=>!mr||Gn();for(let ji=ae,nn=ae;ji<=we;++ji)zt=o[ji%xt],!zt.skip&&(Yr=re(zt[B]),Yr!==on&&(mr=Ut(Yr,Y,dt),Sr===null&&ei()&&(Sr=Ct(Yr,Y)===0?ji:nn),Sr!==null&&Si()&&(Tr.push(LP({start:Sr,end:ji,loop:Xe,count:xt,style:fr})),Sr=null),nn=ji,on=Yr));return Sr!==null&&Tr.push(LP({start:Sr,end:we,loop:Xe,count:xt,style:fr})),Tr}function ED(d,o){const C=[],B=d.segments;for(let Y=0;YY&&d[dt%o].skip;)dt--;return dt%=o,{start:Y,end:dt}}function nht(d,o,C,B){const Y=d.length,dt=[];let xt=o,Ct=d[o],Ut;for(Ut=o+1;Ut<=C;++Ut){const re=d[Ut%Y];re.skip||re.stop?Ct.skip||(B=!1,dt.push({start:o%Y,end:(Ut-1)%Y,loop:B}),o=xt=re.stop?Ut:null):(xt=Ut,Ct.skip&&(o=Ut)),Ct=re}return xt!==null&&dt.push({start:o%Y,end:xt%Y,loop:B}),dt}function iht(d,o){const C=d.points,B=d.options.spanGaps,Y=C.length;if(!Y)return[];const dt=!!d._loop,{start:xt,end:Ct}=rht(C,Y,dt,B);if(B===!0)return PP(d,[{start:xt,end:Ct,loop:dt}],C,o);const Ut=Ct{let d=0;return()=>d++})();function Uh(d){return d==null}function Xd(d){if(Array.isArray&&Array.isArray(d))return!0;const o=Object.prototype.toString.call(d);return o.slice(0,7)==="[object"&&o.slice(-6)==="Array]"}function Pc(d){return d!==null&&Object.prototype.toString.call(d)==="[object Object]"}function r0(d){return(typeof d=="number"||d instanceof Number)&&isFinite(+d)}function sg(d,o){return r0(d)?d:o}function fc(d,o){return typeof d>"u"?o:d}const sct=(d,o)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100:+d/o,uD=(d,o)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100*o:+d;function Rf(d,o,C){if(d&&typeof d.call=="function")return d.apply(C,o)}function tf(d,o,C,B){let Y,dt,xt;if(Xd(d))for(dt=d.length,Y=0;Yd,x:d=>d.x,y:d=>d.y};function cct(d){const o=d.split("."),C=[];let B="";for(const Y of o)B+=Y,B.endsWith("\\")?B=B.slice(0,-1)+".":(C.push(B),B="");return C}function hct(d){const o=cct(d);return C=>{for(const B of o){if(B==="")break;C=C&&C[B]}return C}}function Oy(d,o){return(pP[o]||(pP[o]=hct(o)))(d)}function b7(d){return d.charAt(0).toUpperCase()+d.slice(1)}const K2=d=>typeof d<"u",k1=d=>typeof d=="function",mP=(d,o)=>{if(d.size!==o.size)return!1;for(const C of d)if(!o.has(C))return!1;return!0};function fct(d){return d.type==="mouseup"||d.type==="click"||d.type==="contextmenu"}const ef=Math.PI,ld=2*ef,dct=ld+ef,A4=Number.POSITIVE_INFINITY,pct=ef/180,sp=ef/2,my=ef/4,gP=ef*2/3,hD=Math.log10,vg=Math.sign;function O2(d,o,C){return Math.abs(d-o)Y-dt).pop(),o}function gct(d){return typeof d=="symbol"||typeof d=="object"&&d!==null&&!(Symbol.toPrimitive in d||"toString"in d||"valueOf"in d)}function X2(d){return!gct(d)&&!isNaN(parseFloat(d))&&isFinite(d)}function vct(d,o){const C=Math.round(d);return C-o<=d&&C+o>=d}function yct(d,o,C){let B,Y,dt;for(B=0,Y=d.length;BUt&&re=Math.min(o,C)-B&&d<=Math.max(o,C)+B}function w7(d,o,C){C=C||(xt=>d[xt]1;)dt=Y+B>>1,C(dt)?Y=dt:B=dt;return{lo:Y,hi:B}}const My=(d,o,C,B)=>w7(d,C,B?Y=>{const dt=d[Y][o];return dtd[Y][o]w7(d,C,B=>d[B][o]>=C);function kct(d,o,C){let B=0,Y=d.length;for(;BB&&d[Y-1]>C;)Y--;return B>0||Y{const B="_onData"+b7(C),Y=d[C];Object.defineProperty(d,C,{configurable:!0,enumerable:!1,value(...dt){const xt=Y.apply(this,dt);return d._chartjs.listeners.forEach(Ct=>{typeof Ct[B]=="function"&&Ct[B](...dt)}),xt}})})}function xP(d,o){const C=d._chartjs;if(!C)return;const B=C.listeners,Y=B.indexOf(o);Y!==-1&&B.splice(Y,1),!(B.length>0)&&(dD.forEach(dt=>{delete d[dt]}),delete d._chartjs)}function pD(d){const o=new Set(d);return o.size===d.length?d:Array.from(o)}const mD=function(){return typeof window>"u"?function(d){return d()}:window.requestAnimationFrame}();function gD(d,o){let C=[],B=!1;return function(...Y){C=Y,B||(B=!0,mD.call(window,()=>{B=!1,d.apply(o,C)}))}}function Act(d,o){let C;return function(...B){return o?(clearTimeout(C),C=setTimeout(d,o,B)):d.apply(this,B),o}}const k7=d=>d==="start"?"left":d==="end"?"right":"center",Gp=(d,o,C)=>d==="start"?o:d==="end"?C:(o+C)/2,Mct=(d,o,C,B)=>d===(B?"left":"right")?C:d==="center"?(o+C)/2:o;function Sct(d,o,C){const B=o.length;let Y=0,dt=B;if(d._sorted){const{iScale:xt,vScale:Ct,_parsed:Ut}=d,re=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null,ae=xt.axis,{min:we,max:Xe,minDefined:fr,maxDefined:Tr}=xt.getUserBounds();if(fr){if(Y=Math.min(My(Ut,ae,we).lo,C?B:My(o,ae,xt.getPixelForValue(we)).lo),re){const mr=Ut.slice(0,Y+1).reverse().findIndex(Sr=>!Uh(Sr[Ct.axis]));Y-=Math.max(0,mr)}Y=t0(Y,0,B-1)}if(Tr){let mr=Math.max(My(Ut,xt.axis,Xe,!0).hi+1,C?0:My(o,ae,xt.getPixelForValue(Xe),!0).hi+1);if(re){const Sr=Ut.slice(mr-1).findIndex(Yr=>!Uh(Yr[Ct.axis]));mr+=Math.max(0,Sr)}dt=t0(mr,Y,B)-Y}else dt=B-Y}return{start:Y,count:dt}}function Cct(d){const{xScale:o,yScale:C,_scaleRanges:B}=d,Y={xmin:o.min,xmax:o.max,ymin:C.min,ymax:C.max};if(!B)return d._scaleRanges=Y,!0;const dt=B.xmin!==o.min||B.xmax!==o.max||B.ymin!==C.min||B.ymax!==C.max;return Object.assign(B,Y),dt}const U5=d=>d===0||d===1,_P=(d,o,C)=>-(Math.pow(2,10*(d-=1))*Math.sin((d-o)*ld/C)),bP=(d,o,C)=>Math.pow(2,-10*d)*Math.sin((d-o)*ld/C)+1,D2={linear:d=>d,easeInQuad:d=>d*d,easeOutQuad:d=>-d*(d-2),easeInOutQuad:d=>(d/=.5)<1?.5*d*d:-.5*(--d*(d-2)-1),easeInCubic:d=>d*d*d,easeOutCubic:d=>(d-=1)*d*d+1,easeInOutCubic:d=>(d/=.5)<1?.5*d*d*d:.5*((d-=2)*d*d+2),easeInQuart:d=>d*d*d*d,easeOutQuart:d=>-((d-=1)*d*d*d-1),easeInOutQuart:d=>(d/=.5)<1?.5*d*d*d*d:-.5*((d-=2)*d*d*d-2),easeInQuint:d=>d*d*d*d*d,easeOutQuint:d=>(d-=1)*d*d*d*d+1,easeInOutQuint:d=>(d/=.5)<1?.5*d*d*d*d*d:.5*((d-=2)*d*d*d*d+2),easeInSine:d=>-Math.cos(d*sp)+1,easeOutSine:d=>Math.sin(d*sp),easeInOutSine:d=>-.5*(Math.cos(ef*d)-1),easeInExpo:d=>d===0?0:Math.pow(2,10*(d-1)),easeOutExpo:d=>d===1?1:-Math.pow(2,-10*d)+1,easeInOutExpo:d=>U5(d)?d:d<.5?.5*Math.pow(2,10*(d*2-1)):.5*(-Math.pow(2,-10*(d*2-1))+2),easeInCirc:d=>d>=1?d:-(Math.sqrt(1-d*d)-1),easeOutCirc:d=>Math.sqrt(1-(d-=1)*d),easeInOutCirc:d=>(d/=.5)<1?-.5*(Math.sqrt(1-d*d)-1):.5*(Math.sqrt(1-(d-=2)*d)+1),easeInElastic:d=>U5(d)?d:_P(d,.075,.3),easeOutElastic:d=>U5(d)?d:bP(d,.075,.3),easeInOutElastic(d){return U5(d)?d:d<.5?.5*_P(d*2,.1125,.45):.5+.5*bP(d*2-1,.1125,.45)},easeInBack(d){return d*d*((1.70158+1)*d-1.70158)},easeOutBack(d){return(d-=1)*d*((1.70158+1)*d+1.70158)+1},easeInOutBack(d){let o=1.70158;return(d/=.5)<1?.5*(d*d*(((o*=1.525)+1)*d-o)):.5*((d-=2)*d*(((o*=1.525)+1)*d+o)+2)},easeInBounce:d=>1-D2.easeOutBounce(1-d),easeOutBounce(d){return d<1/2.75?7.5625*d*d:d<2/2.75?7.5625*(d-=1.5/2.75)*d+.75:d<2.5/2.75?7.5625*(d-=2.25/2.75)*d+.9375:7.5625*(d-=2.625/2.75)*d+.984375},easeInOutBounce:d=>d<.5?D2.easeInBounce(d*2)*.5:D2.easeOutBounce(d*2-1)*.5+.5};function T7(d){if(d&&typeof d=="object"){const o=d.toString();return o==="[object CanvasPattern]"||o==="[object CanvasGradient]"}return!1}function wP(d){return T7(d)?d:new G2(d)}function q8(d){return T7(d)?d:new G2(d).saturate(.5).darken(.1).hexString()}const Ect=["x","y","borderWidth","radius","tension"],Lct=["color","borderColor","backgroundColor"];function Pct(d){d.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),d.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:o=>o!=="onProgress"&&o!=="onComplete"&&o!=="fn"}),d.set("animations",{colors:{type:"color",properties:Lct},numbers:{type:"number",properties:Ect}}),d.describe("animations",{_fallback:"animation"}),d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:o=>o|0}}}})}function zct(d){d.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const kP=new Map;function Ict(d,o){o=o||{};const C=d+JSON.stringify(o);let B=kP.get(C);return B||(B=new Intl.NumberFormat(d,o),kP.set(C,B)),B}function A7(d,o,C){return Ict(o,C).format(d)}const Oct={values(d){return Xd(d)?d:""+d},numeric(d,o,C){if(d===0)return"0";const B=this.chart.options.locale;let Y,dt=d;if(C.length>1){const re=Math.max(Math.abs(C[0].value),Math.abs(C[C.length-1].value));(re<1e-4||re>1e15)&&(Y="scientific"),dt=Dct(d,C)}const xt=hD(Math.abs(dt)),Ct=isNaN(xt)?1:Math.max(Math.min(-1*Math.floor(xt),20),0),Ut={notation:Y,minimumFractionDigits:Ct,maximumFractionDigits:Ct};return Object.assign(Ut,this.options.ticks.format),A7(d,B,Ut)}};function Dct(d,o){let C=o.length>3?o[2].value-o[1].value:o[1].value-o[0].value;return Math.abs(C)>=1&&d!==Math.floor(d)&&(C=d-Math.floor(d)),C}var vD={formatters:Oct};function Fct(d){d.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(o,C)=>C.lineWidth,tickColor:(o,C)=>C.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:vD.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),d.route("scale.ticks","color","","color"),d.route("scale.grid","color","","borderColor"),d.route("scale.border","color","","borderColor"),d.route("scale.title","color","","color"),d.describe("scale",{_fallback:!1,_scriptable:o=>!o.startsWith("before")&&!o.startsWith("after")&&o!=="callback"&&o!=="parser",_indexable:o=>o!=="borderDash"&&o!=="tickBorderDash"&&o!=="dash"}),d.describe("scales",{_fallback:"scale"}),d.describe("scale.ticks",{_scriptable:o=>o!=="backdropPadding"&&o!=="callback",_indexable:o=>o!=="backdropPadding"})}const Dy=Object.create(null),OA=Object.create(null);function F2(d,o){if(!o)return d;const C=o.split(".");for(let B=0,Y=C.length;BB.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(B,Y)=>q8(Y.backgroundColor),this.hoverBorderColor=(B,Y)=>q8(Y.borderColor),this.hoverColor=(B,Y)=>q8(Y.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(o),this.apply(C)}set(o,C){return Z8(this,o,C)}get(o){return F2(this,o)}describe(o,C){return Z8(OA,o,C)}override(o,C){return Z8(Dy,o,C)}route(o,C,B,Y){const dt=F2(this,o),xt=F2(this,B),Ct="_"+C;Object.defineProperties(dt,{[Ct]:{value:dt[C],writable:!0},[C]:{enumerable:!0,get(){const Ut=this[Ct],re=xt[Y];return Pc(Ut)?Object.assign({},re,Ut):fc(Ut,re)},set(Ut){this[Ct]=Ut}}})}apply(o){o.forEach(C=>C(this))}}var Bd=new Rct({_scriptable:d=>!d.startsWith("on"),_indexable:d=>d!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Pct,zct,Fct]);function Bct(d){return!d||Uh(d.size)||Uh(d.family)?null:(d.style?d.style+" ":"")+(d.weight?d.weight+" ":"")+d.size+"px "+d.family}function TP(d,o,C,B,Y){let dt=o[Y];return dt||(dt=o[Y]=d.measureText(Y).width,C.push(Y)),dt>B&&(B=dt),B}function gy(d,o,C){const B=d.currentDevicePixelRatio,Y=C!==0?Math.max(C/2,.5):0;return Math.round((o-Y)*B)/B+Y}function AP(d,o){!o&&!d||(o=o||d.getContext("2d"),o.save(),o.resetTransform(),o.clearRect(0,0,d.width,d.height),o.restore())}function DA(d,o,C,B){yD(d,o,C,B,null)}function yD(d,o,C,B,Y){let dt,xt,Ct,Ut,re,ae,we,Xe;const fr=o.pointStyle,Tr=o.rotation,mr=o.radius;let Sr=(Tr||0)*pct;if(fr&&typeof fr=="object"&&(dt=fr.toString(),dt==="[object HTMLImageElement]"||dt==="[object HTMLCanvasElement]")){d.save(),d.translate(C,B),d.rotate(Sr),d.drawImage(fr,-fr.width/2,-fr.height/2,fr.width,fr.height),d.restore();return}if(!(isNaN(mr)||mr<=0)){switch(d.beginPath(),fr){default:Y?d.ellipse(C,B,Y/2,mr,0,0,ld):d.arc(C,B,mr,0,ld),d.closePath();break;case"triangle":ae=Y?Y/2:mr,d.moveTo(C+Math.sin(Sr)*ae,B-Math.cos(Sr)*mr),Sr+=gP,d.lineTo(C+Math.sin(Sr)*ae,B-Math.cos(Sr)*mr),Sr+=gP,d.lineTo(C+Math.sin(Sr)*ae,B-Math.cos(Sr)*mr),d.closePath();break;case"rectRounded":re=mr*.516,Ut=mr-re,xt=Math.cos(Sr+my)*Ut,we=Math.cos(Sr+my)*(Y?Y/2-re:Ut),Ct=Math.sin(Sr+my)*Ut,Xe=Math.sin(Sr+my)*(Y?Y/2-re:Ut),d.arc(C-we,B-Ct,re,Sr-ef,Sr-sp),d.arc(C+Xe,B-xt,re,Sr-sp,Sr),d.arc(C+we,B+Ct,re,Sr,Sr+sp),d.arc(C-Xe,B+xt,re,Sr+sp,Sr+ef),d.closePath();break;case"rect":if(!Tr){Ut=Math.SQRT1_2*mr,ae=Y?Y/2:Ut,d.rect(C-ae,B-Ut,2*ae,2*Ut);break}Sr+=my;case"rectRot":we=Math.cos(Sr)*(Y?Y/2:mr),xt=Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,Xe=Math.sin(Sr)*(Y?Y/2:mr),d.moveTo(C-we,B-Ct),d.lineTo(C+Xe,B-xt),d.lineTo(C+we,B+Ct),d.lineTo(C-Xe,B+xt),d.closePath();break;case"crossRot":Sr+=my;case"cross":we=Math.cos(Sr)*(Y?Y/2:mr),xt=Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,Xe=Math.sin(Sr)*(Y?Y/2:mr),d.moveTo(C-we,B-Ct),d.lineTo(C+we,B+Ct),d.moveTo(C+Xe,B-xt),d.lineTo(C-Xe,B+xt);break;case"star":we=Math.cos(Sr)*(Y?Y/2:mr),xt=Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,Xe=Math.sin(Sr)*(Y?Y/2:mr),d.moveTo(C-we,B-Ct),d.lineTo(C+we,B+Ct),d.moveTo(C+Xe,B-xt),d.lineTo(C-Xe,B+xt),Sr+=my,we=Math.cos(Sr)*(Y?Y/2:mr),xt=Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,Xe=Math.sin(Sr)*(Y?Y/2:mr),d.moveTo(C-we,B-Ct),d.lineTo(C+we,B+Ct),d.moveTo(C+Xe,B-xt),d.lineTo(C-Xe,B+xt);break;case"line":xt=Y?Y/2:Math.cos(Sr)*mr,Ct=Math.sin(Sr)*mr,d.moveTo(C-xt,B-Ct),d.lineTo(C+xt,B+Ct);break;case"dash":d.moveTo(C,B),d.lineTo(C+Math.cos(Sr)*(Y?Y/2:mr),B+Math.sin(Sr)*mr);break;case!1:d.closePath();break}d.fill(),o.borderWidth>0&&d.stroke()}}function Q2(d,o,C){return C=C||.5,!o||d&&d.x>o.left-C&&d.xo.top-C&&d.y0&&dt.strokeColor!=="";let Ut,re;for(d.save(),d.font=Y.string,Uct(d,dt),Ut=0;Ut+d||0;function M7(d,o){const C={},B=Pc(o),Y=B?Object.keys(o):o,dt=Pc(d)?B?xt=>fc(d[xt],d[o[xt]]):xt=>d[xt]:()=>d;for(const xt of Y)C[xt]=Zct(dt(xt));return C}function xD(d){return M7(d,{top:"y",right:"x",bottom:"y",left:"x"})}function m_(d){return M7(d,["topLeft","topRight","bottomLeft","bottomRight"])}function pm(d){const o=xD(d);return o.width=o.left+o.right,o.height=o.top+o.bottom,o}function e0(d,o){d=d||{},o=o||Bd.font;let C=fc(d.size,o.size);typeof C=="string"&&(C=parseInt(C,10));let B=fc(d.style,o.style);B&&!(""+B).match($ct)&&(console.warn('Invalid font style specified: "'+B+'"'),B=void 0);const Y={family:fc(d.family,o.family),lineHeight:qct(fc(d.lineHeight,o.lineHeight),C),size:C,style:B,weight:fc(d.weight,o.weight),string:""};return Y.string=Bct(Y),Y}function V5(d,o,C,B){let Y,dt,xt;for(Y=0,dt=d.length;YC&&Ct===0?0:Ct+Ut;return{min:xt(B,-Math.abs(dt)),max:xt(Y,dt)}}function Ry(d,o){return Object.assign(Object.create(d),o)}function S7(d,o=[""],C,B,Y=()=>d[0]){const dt=C||d;typeof B>"u"&&(B=kD("_fallback",d));const xt={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:d,_rootScopes:dt,_fallback:B,_getTarget:Y,override:Ct=>S7([Ct,...d],o,dt,B)};return new Proxy(xt,{deleteProperty(Ct,Ut){return delete Ct[Ut],delete Ct._keys,delete d[0][Ut],!0},get(Ct,Ut){return bD(Ct,Ut,()=>rht(Ut,o,d,Ct))},getOwnPropertyDescriptor(Ct,Ut){return Reflect.getOwnPropertyDescriptor(Ct._scopes[0],Ut)},getPrototypeOf(){return Reflect.getPrototypeOf(d[0])},has(Ct,Ut){return SP(Ct).includes(Ut)},ownKeys(Ct){return SP(Ct)},set(Ct,Ut,re){const ae=Ct._storage||(Ct._storage=Y());return Ct[Ut]=ae[Ut]=re,delete Ct._keys,!0}})}function T_(d,o,C,B){const Y={_cacheable:!1,_proxy:d,_context:o,_subProxy:C,_stack:new Set,_descriptors:_D(d,B),setContext:dt=>T_(d,dt,C,B),override:dt=>T_(d.override(dt),o,C,B)};return new Proxy(Y,{deleteProperty(dt,xt){return delete dt[xt],delete d[xt],!0},get(dt,xt,Ct){return bD(dt,xt,()=>Kct(dt,xt,Ct))},getOwnPropertyDescriptor(dt,xt){return dt._descriptors.allKeys?Reflect.has(d,xt)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(d,xt)},getPrototypeOf(){return Reflect.getPrototypeOf(d)},has(dt,xt){return Reflect.has(d,xt)},ownKeys(){return Reflect.ownKeys(d)},set(dt,xt,Ct){return d[xt]=Ct,delete dt[xt],!0}})}function _D(d,o={scriptable:!0,indexable:!0}){const{_scriptable:C=o.scriptable,_indexable:B=o.indexable,_allKeys:Y=o.allKeys}=d;return{allKeys:Y,scriptable:C,indexable:B,isScriptable:k1(C)?C:()=>C,isIndexable:k1(B)?B:()=>B}}const Yct=(d,o)=>d?d+b7(o):o,C7=(d,o)=>Pc(o)&&d!=="adapters"&&(Object.getPrototypeOf(o)===null||o.constructor===Object);function bD(d,o,C){if(Object.prototype.hasOwnProperty.call(d,o)||o==="constructor")return d[o];const B=C();return d[o]=B,B}function Kct(d,o,C){const{_proxy:B,_context:Y,_subProxy:dt,_descriptors:xt}=d;let Ct=B[o];return k1(Ct)&&xt.isScriptable(o)&&(Ct=Xct(o,Ct,d,C)),Xd(Ct)&&Ct.length&&(Ct=Jct(o,Ct,d,xt.isIndexable)),C7(o,Ct)&&(Ct=T_(Ct,Y,dt&&dt[o],xt)),Ct}function Xct(d,o,C,B){const{_proxy:Y,_context:dt,_subProxy:xt,_stack:Ct}=C;if(Ct.has(d))throw new Error("Recursion detected: "+Array.from(Ct).join("->")+"->"+d);Ct.add(d);let Ut=o(dt,xt||B);return Ct.delete(d),C7(d,Ut)&&(Ut=E7(Y._scopes,Y,d,Ut)),Ut}function Jct(d,o,C,B){const{_proxy:Y,_context:dt,_subProxy:xt,_descriptors:Ct}=C;if(typeof dt.index<"u"&&B(d))return o[dt.index%o.length];if(Pc(o[0])){const Ut=o,re=Y._scopes.filter(ae=>ae!==Ut);o=[];for(const ae of Ut){const we=E7(re,Y,d,ae);o.push(T_(we,dt,xt&&xt[d],Ct))}}return o}function wD(d,o,C){return k1(d)?d(o,C):d}const Qct=(d,o)=>d===!0?o:typeof d=="string"?Oy(o,d):void 0;function tht(d,o,C,B,Y){for(const dt of o){const xt=Qct(C,dt);if(xt){d.add(xt);const Ct=wD(xt._fallback,C,Y);if(typeof Ct<"u"&&Ct!==C&&Ct!==B)return Ct}else if(xt===!1&&typeof B<"u"&&C!==B)return null}return!1}function E7(d,o,C,B){const Y=o._rootScopes,dt=wD(o._fallback,C,B),xt=[...d,...Y],Ct=new Set;Ct.add(B);let Ut=MP(Ct,xt,C,dt||C,B);return Ut===null||typeof dt<"u"&&dt!==C&&(Ut=MP(Ct,xt,dt,Ut,B),Ut===null)?!1:S7(Array.from(Ct),[""],Y,dt,()=>eht(o,C,B))}function MP(d,o,C,B,Y){for(;C;)C=tht(d,o,C,B,Y);return C}function eht(d,o,C){const B=d._getTarget();o in B||(B[o]={});const Y=B[o];return Xd(Y)&&Pc(C)?C:Y||{}}function rht(d,o,C,B){let Y;for(const dt of o)if(Y=kD(Yct(dt,d),C),typeof Y<"u")return C7(d,Y)?E7(C,B,d,Y):Y}function kD(d,o){for(const C of o){if(!C)continue;const B=C[d];if(typeof B<"u")return B}}function SP(d){let o=d._keys;return o||(o=d._keys=nht(d._scopes)),o}function nht(d){const o=new Set;for(const C of d)for(const B of Object.keys(C).filter(Y=>!Y.startsWith("_")))o.add(B);return Array.from(o)}const iht=Number.EPSILON||1e-14,A_=(d,o)=>od==="x"?"y":"x";function aht(d,o,C,B){const Y=d.skip?o:d,dt=o,xt=C.skip?o:C,Ct=IA(dt,Y),Ut=IA(xt,dt);let re=Ct/(Ct+Ut),ae=Ut/(Ct+Ut);re=isNaN(re)?0:re,ae=isNaN(ae)?0:ae;const we=B*re,Xe=B*ae;return{previous:{x:dt.x-we*(xt.x-Y.x),y:dt.y-we*(xt.y-Y.y)},next:{x:dt.x+Xe*(xt.x-Y.x),y:dt.y+Xe*(xt.y-Y.y)}}}function oht(d,o,C){const B=d.length;let Y,dt,xt,Ct,Ut,re=A_(d,0);for(let ae=0;ae!re.skip)),o.cubicInterpolationMode==="monotone")lht(d,Y);else{let re=B?d[d.length-1]:d[0];for(dt=0,xt=d.length;dtd.ownerDocument.defaultView.getComputedStyle(d,null);function hht(d,o){return r6(d).getPropertyValue(o)}const fht=["top","right","bottom","left"];function Ly(d,o,C){const B={};C=C?"-"+C:"";for(let Y=0;Y<4;Y++){const dt=fht[Y];B[dt]=parseFloat(d[o+"-"+dt+C])||0}return B.width=B.left+B.right,B.height=B.top+B.bottom,B}const dht=(d,o,C)=>(d>0||o>0)&&(!C||!C.shadowRoot);function pht(d,o){const C=d.touches,B=C&&C.length?C[0]:d,{offsetX:Y,offsetY:dt}=B;let xt=!1,Ct,Ut;if(dht(Y,dt,d.target))Ct=Y,Ut=dt;else{const re=o.getBoundingClientRect();Ct=B.clientX-re.left,Ut=B.clientY-re.top,xt=!0}return{x:Ct,y:Ut,box:xt}}function xy(d,o){if("native"in d)return d;const{canvas:C,currentDevicePixelRatio:B}=o,Y=r6(C),dt=Y.boxSizing==="border-box",xt=Ly(Y,"padding"),Ct=Ly(Y,"border","width"),{x:Ut,y:re,box:ae}=pht(d,C),we=xt.left+(ae&&Ct.left),Xe=xt.top+(ae&&Ct.top);let{width:fr,height:Tr}=o;return dt&&(fr-=xt.width+Ct.width,Tr-=xt.height+Ct.height),{x:Math.round((Ut-we)/fr*C.width/B),y:Math.round((re-Xe)/Tr*C.height/B)}}function mht(d,o,C){let B,Y;if(o===void 0||C===void 0){const dt=d&&P7(d);if(!dt)o=d.clientWidth,C=d.clientHeight;else{const xt=dt.getBoundingClientRect(),Ct=r6(dt),Ut=Ly(Ct,"border","width"),re=Ly(Ct,"padding");o=xt.width-re.width-Ut.width,C=xt.height-re.height-Ut.height,B=S4(Ct.maxWidth,dt,"clientWidth"),Y=S4(Ct.maxHeight,dt,"clientHeight")}}return{width:o,height:C,maxWidth:B||A4,maxHeight:Y||A4}}const m1=d=>Math.round(d*10)/10;function ght(d,o,C,B){const Y=r6(d),dt=Ly(Y,"margin"),xt=S4(Y.maxWidth,d,"clientWidth")||A4,Ct=S4(Y.maxHeight,d,"clientHeight")||A4,Ut=mht(d,o,C);let{width:re,height:ae}=Ut;if(Y.boxSizing==="content-box"){const Xe=Ly(Y,"border","width"),fr=Ly(Y,"padding");re-=fr.width+Xe.width,ae-=fr.height+Xe.height}return re=Math.max(0,re-dt.width),ae=Math.max(0,B?re/B:ae-dt.height),re=m1(Math.min(re,xt,Ut.maxWidth)),ae=m1(Math.min(ae,Ct,Ut.maxHeight)),re&&!ae&&(ae=m1(re/2)),(o!==void 0||C!==void 0)&&B&&Ut.height&&ae>Ut.height&&(ae=Ut.height,re=m1(Math.floor(ae*B))),{width:re,height:ae}}function CP(d,o,C){const B=o||1,Y=m1(d.height*B),dt=m1(d.width*B);d.height=m1(d.height),d.width=m1(d.width);const xt=d.canvas;return xt.style&&(C||!xt.style.height&&!xt.style.width)&&(xt.style.height=`${d.height}px`,xt.style.width=`${d.width}px`),d.currentDevicePixelRatio!==B||xt.height!==Y||xt.width!==dt?(d.currentDevicePixelRatio=B,xt.height=Y,xt.width=dt,d.ctx.setTransform(B,0,0,B,0,0),!0):!1}const vht=function(){let d=!1;try{const o={get passive(){return d=!0,!1}};L7()&&(window.addEventListener("test",null,o),window.removeEventListener("test",null,o))}catch{}return d}();function EP(d,o){const C=hht(d,o),B=C&&C.match(/^(\d+)(\.\d+)?px$/);return B?+B[1]:void 0}function _y(d,o,C,B){return{x:d.x+C*(o.x-d.x),y:d.y+C*(o.y-d.y)}}function yht(d,o,C,B){return{x:d.x+C*(o.x-d.x),y:B==="middle"?C<.5?d.y:o.y:B==="after"?C<1?d.y:o.y:C>0?o.y:d.y}}function xht(d,o,C,B){const Y={x:d.cp2x,y:d.cp2y},dt={x:o.cp1x,y:o.cp1y},xt=_y(d,Y,C),Ct=_y(Y,dt,C),Ut=_y(dt,o,C),re=_y(xt,Ct,C),ae=_y(Ct,Ut,C);return _y(re,ae,C)}const _ht=function(d,o){return{x(C){return d+d+o-C},setWidth(C){o=C},textAlign(C){return C==="center"?C:C==="right"?"left":"right"},xPlus(C,B){return C-B},leftForLtr(C,B){return C-B}}},bht=function(){return{x(d){return d},setWidth(d){},textAlign(d){return d},xPlus(d,o){return d+o},leftForLtr(d,o){return d}}};function g_(d,o,C){return d?_ht(o,C):bht()}function AD(d,o){let C,B;(o==="ltr"||o==="rtl")&&(C=d.canvas.style,B=[C.getPropertyValue("direction"),C.getPropertyPriority("direction")],C.setProperty("direction",o,"important"),d.prevTextDirection=B)}function MD(d,o){o!==void 0&&(delete d.prevTextDirection,d.canvas.style.setProperty("direction",o[0],o[1]))}function SD(d){return d==="angle"?{between:J2,compare:_ct,normalize:K0}:{between:ov,compare:(o,C)=>o-C,normalize:o=>o}}function LP({start:d,end:o,count:C,loop:B,style:Y}){return{start:d%C,end:o%C,loop:B&&(o-d+1)%C===0,style:Y}}function wht(d,o,C){const{property:B,start:Y,end:dt}=C,{between:xt,normalize:Ct}=SD(B),Ut=o.length;let{start:re,end:ae,loop:we}=d,Xe,fr;if(we){for(re+=Ut,ae+=Ut,Xe=0,fr=Ut;Xe