var t;function n(){if(t==null){let o=typeof document<"u"?document.head:null;t=!!(o&&(o.createShadowRoot||o.attachShadow))}return t}function d(o){if(n()){let e=o.getRootNode?o.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function r(o){return o.composedPath?o.composedPath()[0]:o.target}function c(o){return Array.isArray(o)?o:[o]}export{d as a,r as b,c};