import{A as e,Q as t,V as n,dt as r,h as i}from"./vue.runtime.esm-bundler-DAWRyTnP.js";import{b as a,g as o,m as s,v as c}from"./keyboard-BsJsGVTq.js";function l(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function u(){return/Android/gi.test(window.navigator.userAgent)}function d(){return l()||u()}function f(e,n,r){c.isServer||t(t=>{document.addEventListener(e,n,r),t(()=>document.removeEventListener(e,n,r))})}function p(e,n,r){c.isServer||t(t=>{window.addEventListener(e,n,r),t(()=>window.removeEventListener(e,n,r))})}function m(e,t,n=i(()=>!0)){function c(r,i){if(!n.value||r.defaultPrevented)return;let c=i(r);if(c===null||!c.getRootNode().contains(c))return;let l=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e);for(let e of l){if(e===null)continue;let t=e instanceof HTMLElement?e:a(e);if(t!=null&&t.contains(c)||r.composed&&r.composedPath().includes(t))return}return!o(c,s.Loose)&&c.tabIndex!==-1&&r.preventDefault(),t(r,c)}let l=r(null);f(`pointerdown`,e=>{n.value&&(l.value=e.composedPath?.call(e)?.[0]||e.target)},!0),f(`mousedown`,e=>{n.value&&(l.value=e.composedPath?.call(e)?.[0]||e.target)},!0),f(`click`,e=>{d()||(l.value&&=(c(e,()=>l.value),null))},!0),f(`touchend`,e=>c(e,()=>e.target instanceof HTMLElement?e.target:null),!0),p(`blur`,e=>c(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}var h=Symbol(`Context`),g=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(g||{});function _(){return v()!==null}function v(){return e(h,null)}function y(e){n(h,e)}export{m as a,y as i,v as n,p as o,_ as r,l as s,g as t};