import{_ as x,d as g,w as k,cn as y,x as b,o as l,c as u,F as C,D as B,B as T,L as D}from"./index.56c69f5a.js";const E={fixed:"","p-5":"","text-sm":"","font-bold":""},w=["onClick"],N=g({__name:"anchor",props:{map:{type:Map,required:!0}},setup(i){const n=i,r=k(null),{y:o}=y(r);b(()=>{r.value=document.getElementsByClassName("el-scrollbar__wrap")[1]});function d(s){const{top:e}=n.map.get(s);r.value.scrollTo({top:Number(e)})}function m(s){let e=0,t=0;const a=[...n.map.entries()],{top:v,index:c}=n.map.get(s);return a.forEach(([A,{index:p,top:_}])=>{const f=c+1===p,h=c-1===p;f&&(e=_),h&&(t=_)}),c===0?o.value>=0&&o.value<e:o.value>t&&o.value<e&&o.value>=v}return(s,e)=>(l(),u("ul",E,[(l(!0),u(C,null,B(i.map.entries(),([t],a)=>(l(),u("li",{class:T(["hover:text-blue hover:bg-#f7f7f7 cursor-pointer duration-200ms p-1.5 m-1 rounded",{"is-active":m(t)}]),onClick:()=>d(t),key:a},D(t),11,w))),128))]))}});var I=x(N,[["__scopeId","data-v-5d3b9dd1"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/search/standBook/components/anchor.vue"]]);export{I as default};
