import{_ as x,d as y,x as g,dS as k,y as C,o as l,c as u,F as b,E,C as T,L as B}from"./index.js";const D={fixed:"","p-5":"","text-sm":"","font-bold":""},N=["onClick"],S=y({__name:"anchor",props:{map:{type:Map,required:!0}},setup(i){const r=i,n=g(null),{y:o}=k(n);C(()=>{n.value=document.getElementsByClassName("el-scrollbar__wrap")[1]});function d(s){const{top:e}=r.map.get(s);n.value.scrollTo({top:Number(e)})}function m(s){let e=0,t=0;const a=[...r.map.entries()],{top:v,index:c}=r.map.get(s);return a.forEach(([w,{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",D,[(l(!0),u(b,null,E(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},B(t),11,N))),128))]))}});var F=x(S,[["__scopeId","data-v-5d3b9dd1"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/search/standBook/components/anchor.vue"]]);export{F as default};
