!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIUtilsDOM={})}(this,(function(e){"use strict";function n(e){return r(e)?(e.nodeName||"").toLowerCase():"#document"}function t(e){var n;return(null==e||null==(n=e.ownerDocument)?void 0:n.defaultView)||window}function o(e){var n;return null==(n=(r(e)?e.ownerDocument:e.document)||window.document)?void 0:n.documentElement}function r(e){return e instanceof Node||e instanceof t(e).Node}function i(e){return e instanceof Element||e instanceof t(e).Element}function l(e){return e instanceof HTMLElement||e instanceof t(e).HTMLElement}function c(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof t(e).ShadowRoot)}function u(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=a(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function s(e){const n=f(),t=a(e);return"none"!==t.transform||"none"!==t.perspective||!!t.containerType&&"normal"!==t.containerType||!n&&!!t.backdropFilter&&"none"!==t.backdropFilter||!n&&!!t.filter&&"none"!==t.filter||["transform","perspective","filter"].some((e=>(t.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(t.contain||"").includes(e)))}function f(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function d(e){return["html","body","#document"].includes(n(e))}function a(e){return t(e).getComputedStyle(e)}function m(e){if("html"===n(e))return e;const t=e.assignedSlot||e.parentNode||c(e)&&e.host||o(e);return c(t)?t.host:t}function p(e){const n=m(e);return d(n)?e.ownerDocument?e.ownerDocument.body:e.body:l(n)&&u(n)?n:p(n)}e.getComputedStyle=a,e.getContainingBlock=function(e){let n=m(e);for(;l(n)&&!d(n);){if(s(n))return n;n=m(n)}return null},e.getDocumentElement=o,e.getNearestOverflowAncestor=p,e.getNodeName=n,e.getNodeScroll=function(e){return i(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}},e.getOverflowAncestors=function e(n,o,r){var i;void 0===o&&(o=[]),void 0===r&&(r=!0);const l=p(n),c=l===(null==(i=n.ownerDocument)?void 0:i.body),s=t(l);return c?o.concat(s,s.visualViewport||[],u(l)?l:[],s.frameElement&&r?e(s.frameElement):[]):o.concat(l,e(l,[],r))},e.getParentNode=m,e.getWindow=t,e.isContainingBlock=s,e.isElement=i,e.isHTMLElement=l,e.isLastTraversableNode=d,e.isNode=r,e.isOverflowElement=u,e.isShadowRoot=c,e.isTableElement=function(e){return["table","td","th"].includes(n(e))},e.isWebKit=f}));