import{m,j as p,k as v,l as f}from"./engine-DyHa3vHM.js";let l=!1;function y(){return l?Promise.resolve(null):(l=!0,new Promise(n=>{const t=document.createElement("div");t.style.cssText=["position:fixed","pointer-events:none","z-index:2147483647","border:2px solid #4870a8","background:rgba(72,112,168,0.12)","border-radius:3px","transition:all 40ms ease","display:none"].join(";"),document.documentElement.appendChild(t);let c=null;const r=()=>{l=!1,t.remove(),document.removeEventListener("mousemove",s,!0),document.removeEventListener("click",u,!0),document.removeEventListener("keydown",d,!0),document.removeEventListener("contextmenu",a,!0)},s=e=>{const o=document.elementFromPoint(e.clientX,e.clientY);if(!o||o===t)return;c=o;const i=o.getBoundingClientRect();t.style.display="block",t.style.left=`${i.left}px`,t.style.top=`${i.top}px`,t.style.width=`${i.width}px`,t.style.height=`${i.height}px`},u=e=>{e.preventDefault(),e.stopPropagation();const o=c??document.elementFromPoint(e.clientX,e.clientY);r(),n(o?g(o):null)},d=e=>{e.key==="Escape"&&(e.preventDefault(),r(),n(null))},a=e=>{e.preventDefault(),r(),n(null)};document.addEventListener("mousemove",s,!0),document.addEventListener("click",u,!0),document.addEventListener("keydown",d,!0),document.addEventListener("contextmenu",a,!0)}))}function g(n){const t=m(n),c=n.tagName.toLowerCase(),r=p(n)||v(n)||f(n)||"",s=r?`${c} · ${r.slice(0,40)}`:c;return{candidates:t,label:s}}export{y as pickElement};
