@floating-ui/dom
Advanced tools
@@ -1,1 +0,1 @@ | ||
| import{rectToClientRect as t,arrow as e,autoPlacement as n,detectOverflow as o,flip as i,hide as r,inline as c,limitShift as l,offset as s,shift as f,size as u,computePosition as a}from"@floating-ui/core";const h=Math.min,d=Math.max,p=Math.round,g=Math.floor,m=t=>({x:t,y:t});function y(){return"undefined"!=typeof window}function w(t){return b(t)?(t.nodeName||"").toLowerCase():"#document"}function x(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function v(t){var e;return null==(e=(b(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function b(t){return!!y()&&(t instanceof Node||t instanceof x(t).Node)}function L(t){return!!y()&&(t instanceof Element||t instanceof x(t).Element)}function R(t){return!!y()&&(t instanceof HTMLElement||t instanceof x(t).HTMLElement)}function T(t){return!(!y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof x(t).ShadowRoot)}function C(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function S(t){return/^(table|td|th)$/.test(w(t))}function E(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const F=/transform|translate|scale|rotate|perspective|filter/,D=/paint|layout|strict|content/,W=t=>!!t&&"none"!==t;let O;function H(t){const e=L(t)?z(t):t;return W(e.transform)||W(e.translate)||W(e.scale)||W(e.rotate)||W(e.perspective)||!M()&&(W(e.backdropFilter)||W(e.filter))||F.test(e.willChange||"")||D.test(e.contain||"")}function M(){return null==O&&(O="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),O}function P(t){return/^(html|body|#document)$/.test(w(t))}function z(t){return x(t).getComputedStyle(t)}function B(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function V(t){if("html"===w(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||v(t);return T(e)?e.host:e}function A(t){const e=V(t);return P(e)?t.ownerDocument?t.ownerDocument.body:t.body:R(e)&&C(e)?e:A(e)}function N(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=A(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=x(i);if(r){const t=$(c);return e.concat(c,c.visualViewport||[],C(i)?i:[],t&&n?N(t):[])}return e.concat(i,N(i,[],n))}function $(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function k(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=R(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,l=p(n)!==r||p(o)!==c;return l&&(n=r,o=c),{width:n,height:o,$:l}}function I(t){return L(t)?t:t.contextElement}function q(t){const e=I(t);if(!R(e))return m(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=k(e);let c=(r?p(n.width):n.width)/o,l=(r?p(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const X=m(0);function Y(t){const e=x(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:X}function _(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),c=I(e);let l=m(1);n&&(i?L(i)&&(l=q(i)):l=q(e));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==x(t))&&e}(c,o,i)?Y(c):m(0);let f=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,a=r.width/l.x,h=r.height/l.y;if(c){const t=x(c),e=i&&L(i)?x(i):i;let n=t,o=$(n);for(;o&&i&&e!==n;){const t=q(o),e=o.getBoundingClientRect(),i=z(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;f*=t.x,u*=t.y,a*=t.x,h*=t.y,f+=r,u+=c,n=x(o),o=$(n)}}return t({width:a,height:h,x:f,y:u})}function j(t,e){const n=B(t).scrollLeft;return e?e.left+n:_(v(t)).left+n}function G(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-j(t,n),y:n.top+e.scrollTop}}function J(e,n,o){let i;if("viewport"===n)i=function(t,e){const n=x(t),o=v(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,s=0;if(i){r=i.width,c=i.height;const t=M();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,s=i.offsetTop)}const f=j(o);if(f<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,c=Math.abs(o.clientWidth-e.clientWidth-i);c<=25&&(r-=c)}else f<=25&&(r+=f);return{width:r,height:c,x:l,y:s}}(e,o);else if("document"===n)i=function(t){const e=v(t),n=B(t),o=t.ownerDocument.body,i=d(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=d(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+j(t);const l=-n.scrollTop;return"rtl"===z(o).direction&&(c+=d(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:c,y:l}}(v(e));else if(L(n))i=function(t,e){const n=_(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=R(t)?q(t):m(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,o);else{const t=Y(e);i={x:n.x-t.x,y:n.y-t.y,width:n.width,height:n.height}}return t(i)}function K(t,e){const n=V(t);return!(n===e||!L(n)||P(n))&&("fixed"===z(n).position||K(n,e))}function Q(t,e,n){const o=R(e),i=v(e),r="fixed"===n,c=_(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const s=m(0);function f(){s.x=j(i)}if(o||!o&&!r)if(("body"!==w(e)||C(i))&&(l=B(e)),o){const t=_(e,!0,r,e);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else i&&f();r&&!o&&i&&f();const u=!i||o||r?m(0):G(i,l);return{x:c.left+l.scrollLeft-s.x-u.x,y:c.top+l.scrollTop-s.y-u.y,width:c.width,height:c.height}}function U(t){return"static"===z(t).position}function Z(t,e){if(!R(t)||"fixed"===z(t).position)return null;if(e)return e(t);let n=t.offsetParent;return v(t)===n&&(n=n.ownerDocument.body),n}function tt(t,e){const n=x(t);if(E(t))return n;if(!R(t)){let e=V(t);for(;e&&!P(e);){if(L(e)&&!U(e))return e;e=V(e)}return n}let o=Z(t,e);for(;o&&S(o)&&U(o);)o=Z(o,e);return o&&P(o)&&U(o)&&!H(o)?n:o||function(t){let e=V(t);for(;R(e)&&!P(e);){if(H(e))return e;if(E(e))return null;e=V(e)}return null}(t)||n}const et={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,c=v(o),l=!!e&&E(e.floating);if(o===c||l&&r)return n;let s={scrollLeft:0,scrollTop:0},f=m(1);const u=m(0),a=R(o);if((a||!a&&!r)&&(("body"!==w(o)||C(c))&&(s=B(o)),a)){const t=_(o);f=q(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!c||a||r?m(0):G(c,s);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-s.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-s.scrollTop*f.y+u.y+h.y}},getDocumentElement:v,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?E(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=N(t,[],!1).filter((t=>L(t)&&"body"!==w(t))),i=null;const r="fixed"===z(t).position;let c=r?V(t):t;for(;L(c)&&!P(c);){const e=z(c),n=H(c);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||C(c)&&!n&&K(t,c))?o=o.filter((t=>t!==c)):i=e,c=V(c)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=J(e,r[0],i);let l=c.top,s=c.right,f=c.bottom,u=c.left;for(let t=1;t<r.length;t++){const n=J(e,r[t],i);l=d(n.top,l),s=h(n.right,s),f=h(n.bottom,f),u=d(n.left,u)}return{width:s-u,height:f-l,x:u,y:l}},getOffsetParent:tt,getElementRects:async function(t){const e=this.getOffsetParent||tt,n=this.getDimensions,o=await n(t.floating);return{reference:Q(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=k(t);return{width:e,height:n}},getScale:q,isElement:L,isRTL:function(t){return"rtl"===z(t).direction}};function nt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ot(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,f=I(t),u=i||r?[...f?N(f):[],...e?N(e):[]]:[];u.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const a=f&&l?function(t,e){let n,o=null;const i=v(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function c(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),r();const f=t.getBoundingClientRect(),{left:u,top:a,width:p,height:m}=f;if(l||e(),!p||!m)return;const y={rootMargin:-g(a)+"px "+-g(i.clientWidth-(u+p))+"px "+-g(i.clientHeight-(a+m))+"px "+-g(u)+"px",threshold:d(0,h(1,s))||1};let w=!0;function x(e){const o=e[0].intersectionRatio;if(o!==s){if(!w)return c();o?c(!1,o):n=setTimeout((()=>{c(!1,1e-7)}),1e3)}1!==o||nt(f,t.getBoundingClientRect())||c(),w=!1}try{o=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(x,y)}o.observe(t)}(!0),r}(f,n):null;let p,m=-1,y=null;c&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===f&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),f&&!s&&y.observe(f),e&&y.observe(e));let w=s?_(t):null;return s&&function e(){const o=_(t);w&&!nt(w,o)&&n();w=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==a||a(),null==(t=y)||t.disconnect(),y=null,s&&cancelAnimationFrame(p)}}const it=o,rt=s,ct=n,lt=f,st=i,ft=u,ut=r,at=e,ht=c,dt=l,pt=(t,e,n)=>{const o=new Map,i={platform:et,...n},r={...i.platform,_c:o};return a(t,e,{...i,platform:r})};export{at as arrow,ct as autoPlacement,ot as autoUpdate,pt as computePosition,it as detectOverflow,st as flip,N as getOverflowAncestors,ut as hide,ht as inline,dt as limitShift,rt as offset,et as platform,lt as shift,ft as size}; | ||
| import{rectToClientRect as t,arrow as e,autoPlacement as n,detectOverflow as o,flip as i,hide as r,inline as c,limitShift as l,offset as s,shift as f,size as u,computePosition as a}from"@floating-ui/core";const h=Math.min,d=Math.max,p=Math.round,g=Math.floor,m=t=>({x:t,y:t});function y(){return"undefined"!=typeof window}function w(t){return b(t)?(t.nodeName||"").toLowerCase():"#document"}function v(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function x(t){var e;return null==(e=(b(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function b(t){return!!y()&&(t instanceof Node||t instanceof v(t).Node)}function L(t){return!!y()&&(t instanceof Element||t instanceof v(t).Element)}function R(t){return!!y()&&(t instanceof HTMLElement||t instanceof v(t).HTMLElement)}function T(t){return!(!y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof v(t).ShadowRoot)}function C(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=V(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function S(t){return/^(table|td|th)$/.test(w(t))}function E(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const F=/transform|translate|scale|rotate|perspective|filter/,W=/paint|layout|strict|content/,D=t=>!!t&&"none"!==t;let O;function H(t){const e=L(t)?V(t):t;return D(e.transform)||D(e.translate)||D(e.scale)||D(e.rotate)||D(e.perspective)||!M()&&(D(e.backdropFilter)||D(e.filter))||F.test(e.willChange||"")||W.test(e.contain||"")}function M(){return null==O&&(O="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),O}function z(t){return/^(html|body|#document)$/.test(w(t))}function V(t){return v(t).getComputedStyle(t)}function P(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if("html"===w(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||x(t);return T(e)?e.host:e}function A(t){const e=B(t);return z(e)?(t.ownerDocument||t).body:R(e)&&C(e)?e:A(e)}function N(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=A(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=v(i);if(r){const t=$(c);return e.concat(c,c.visualViewport||[],C(i)?i:[],t&&n?N(t):[])}return e.concat(i,N(i,[],n))}function $(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function k(t){const e=V(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=R(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,l=p(n)!==r||p(o)!==c;return l&&(n=r,o=c),{width:n,height:o,$:l}}function I(t){return L(t)?t:t.contextElement}function q(t){const e=I(t);if(!R(e))return m(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=k(e);let c=(r?p(n.width):n.width)/o,l=(r?p(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const X=m(0);function Y(t){const e=v(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:X}function _(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),c=I(e);let l=m(1);n&&(i?L(i)&&(l=q(i)):l=q(e));const s=function(t,e,n){return void 0===e&&(e=!1),!!n&&e&&n===v(t)}(c,o,i)?Y(c):m(0);let f=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,a=r.width/l.x,h=r.height/l.y;if(c&&i){const t=v(c),e=L(i)?v(i):i;let n=t,o=$(n);for(;o&&e!==n;){const t=q(o),e=o.getBoundingClientRect(),i=V(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;f*=t.x,u*=t.y,a*=t.x,h*=t.y,f+=r,u+=c,n=v(o),o=$(n)}}return t({width:a,height:h,x:f,y:u})}function j(t,e){const n=P(t).scrollLeft;return e?e.left+n:_(x(t)).left+n}function G(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-j(t,n),y:n.top+e.scrollTop}}function J(e,n,o){let i;if("viewport"===n||"layoutViewport"===n)i=function(t,e,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,i=v(t),r=x(t),c=i.visualViewport;let l=r.clientWidth,s=r.clientHeight,f=0,u=0;if(c){const t=!M()||"fixed"===e;o?t||(f=-c.offsetLeft,u=-c.offsetTop):(l=c.width,s=c.height,t&&(f=c.offsetLeft,u=c.offsetTop))}if(j(r)<=0){const t=r.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-e.clientWidth-o),c="stable both-edges"===getComputedStyle(r).scrollbarGutter?i/2:i;c<=25&&(l-=c)}return{width:l,height:s,x:f,y:u}}(e,o,n);else if("document"===n)i=function(t){const e=P(t),n=t.ownerDocument.body,o=d(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=d(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+j(t);const c=-e.scrollTop;return"rtl"===V(n).direction&&(r+=d(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:r,y:c}}(x(e));else if(L(n))i=function(t,e){const n=_(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=q(t);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,o);else{const t=Y(e);i={x:n.x-t.x,y:n.y-t.y,width:n.width,height:n.height}}return t(i)}function K(t,e,n){const o=R(e),i=x(e),r="fixed"===n,c=_(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const s=m(0);if((o||!r)&&(("body"!==w(e)||C(i))&&(l=P(e)),o)){const t=_(e,!0,r,e);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}!o&&i&&(s.x=j(i));const f=!i||o||r?m(0):G(i,l);return{x:c.left+l.scrollLeft-s.x-f.x,y:c.top+l.scrollTop-s.y-f.y,width:c.width,height:c.height}}function Q(t){return"static"===V(t).position}function U(t,e){if(!R(t)||"fixed"===V(t).position)return null;if(e)return e(t);let n=t.offsetParent;return x(t)===n&&(n=n.ownerDocument.body),n}function Z(t,e){const n=v(t);if(E(t))return n;if(!R(t)){let e=B(t);for(;e&&!z(e);){if(L(e)&&!Q(e))return e;e=B(e)}return n}let o=U(t,e);for(;o&&S(o)&&Q(o);)o=U(o,e);return o&&z(o)&&Q(o)&&!H(o)?n:o||function(t){let e=B(t);for(;R(e)&&!z(e);){if(H(e))return e;if(E(e))return null;e=B(e)}return null}(t)||n}const tt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,c=x(o),l=!!e&&E(e.floating);if(o===c||l&&r)return n;let s={scrollLeft:0,scrollTop:0},f=m(1);const u=m(0),a=R(o);if((a||!r)&&(("body"!==w(o)||C(c))&&(s=P(o)),a)){const t=_(o);f=q(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!c||a||r?m(0):G(c,s);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-s.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-s.scrollTop*f.y+u.y+h.y}},getDocumentElement:x,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?E(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=N(t,[],!1).filter((t=>L(t)&&"body"!==w(t))),i=null;const r="fixed"===V(t).position;let c=r?B(t):t;for(;L(c)&&!z(c);){const t=V(c),e=H(c),n=i?i.position:r?"fixed":"";e||"fixed"!==n&&("absolute"!==n||"static"!==t.position)?i=t:o=o.filter((t=>t!==c)),c=B(c)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=J(e,r[0],i);let l=c.top,s=c.right,f=c.bottom,u=c.left;for(let t=1;t<r.length;t++){const n=J(e,r[t],i);l=d(n.top,l),s=h(n.right,s),f=h(n.bottom,f),u=d(n.left,u)}return{width:s-u,height:f-l,x:u,y:l}},getOffsetParent:Z,getElementRects:async function(t){const e=this.getOffsetParent||Z,n=this.getDimensions,o=await n(t.floating);return{reference:K(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:n}=k(t);return{width:e,height:n}},getScale:q,isElement:L,isRTL:function(t){return"rtl"===V(t).direction}};function et(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function nt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,f=I(t),u=i||r?[...f?N(f):[],...e?N(e):[]]:[];u.forEach((t=>{i&&t.addEventListener("scroll",n),r&&t.addEventListener("resize",n)}));const a=f&&l?function(t,e,n){let o,i=null;const r=x(t);function c(){var t;clearTimeout(o),null==(t=i)||t.disconnect(),i=null}function l(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),c();const f=t.getBoundingClientRect(),{left:u,top:a,width:p,height:m}=f;if(n||e(),!p||!m)return;const y={rootMargin:-g(a)+"px "+-g(r.clientWidth-(u+p))+"px "+-g(r.clientHeight-(a+m))+"px "+-g(u)+"px",threshold:d(0,h(1,s))||1};let w=!0;function v(e){const n=e[0].intersectionRatio;if(!et(f,t.getBoundingClientRect()))return l();if(n!==s){if(!w)return l();n?l(!1,n):o=setTimeout((()=>{l(!1,1e-7)}),1e3)}w=!1}try{i=new IntersectionObserver(v,{...y,root:r.ownerDocument})}catch(t){i=new IntersectionObserver(v,y)}i.observe(t)}const s=v(t),f=()=>l(n);return s.addEventListener("resize",f),l(!0),()=>{s.removeEventListener("resize",f),c()}}(f,n,r):null;let p,m=-1,y=null;c&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===f&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),f&&!s&&y.observe(f),e&&y.observe(e));let w=s?_(t):null;return s&&function e(){const o=_(t);w&&!et(w,o)&&n();w=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==a||a(),null==(t=y)||t.disconnect(),y=null,s&&cancelAnimationFrame(p)}}const ot=o,it=s,rt=n,ct=f,lt=i,st=u,ft=r,ut=e,at=c,ht=l,dt=(t,e,n)=>{const o=new Map,i=null!=n?n:{},r={...tt,...i.platform,_c:o};return a(t,e,{...i,platform:r})};export{ut as arrow,rt as autoPlacement,nt as autoUpdate,dt as computePosition,ot as detectOverflow,lt as flip,N as getOverflowAncestors,ft as hide,at as inline,ht as limitShift,it as offset,tt as platform,ct as shift,st as size}; |
@@ -152,3 +152,3 @@ import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| if (isLastTraversableNode(parentNode)) { | ||
| return node.ownerDocument ? node.ownerDocument.body : node.body; | ||
| return (node.ownerDocument || node).body; | ||
| } | ||
@@ -250,6 +250,3 @@ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { | ||
| } | ||
| if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { | ||
| return false; | ||
| } | ||
| return isFixed; | ||
| return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); | ||
| } | ||
@@ -281,8 +278,8 @@ | ||
| let height = clientRect.height / scale.y; | ||
| if (domElement) { | ||
| if (domElement && offsetParent) { | ||
| const win = getWindow(domElement); | ||
| const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | ||
| const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | ||
| let currentWin = win; | ||
| let currentIFrame = getFrameElement(currentWin); | ||
| while (currentIFrame && offsetParent && offsetWin !== currentWin) { | ||
| while (currentIFrame && offsetWin !== currentWin) { | ||
| const iframeScale = getScale(currentIFrame); | ||
@@ -351,3 +348,3 @@ const iframeRect = currentIFrame.getBoundingClientRect(); | ||
| const isOffsetParentAnElement = isHTMLElement(offsetParent); | ||
| if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | ||
| if (isOffsetParentAnElement || !isFixed) { | ||
| if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { | ||
@@ -373,3 +370,3 @@ scroll = getNodeScroll(offsetParent); | ||
| function getClientRects(element) { | ||
| return Array.from(element.getClientRects()); | ||
| return element.getClientRects ? Array.from(element.getClientRects()) : []; | ||
| } | ||
@@ -379,9 +376,8 @@ | ||
| // of the `<html>` and `<body>` rect bounds if horizontally scrollable. | ||
| function getDocumentRect(element) { | ||
| const html = getDocumentElement(element); | ||
| const scroll = getNodeScroll(element); | ||
| const body = element.ownerDocument.body; | ||
| function getDocumentRect(html) { | ||
| const scroll = getNodeScroll(html); | ||
| const body = html.ownerDocument.body; | ||
| const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); | ||
| const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); | ||
| let x = -scroll.scrollLeft + getWindowScrollBarX(element); | ||
| let x = -scroll.scrollLeft + getWindowScrollBarX(html); | ||
| const y = -scroll.scrollTop; | ||
@@ -403,3 +399,7 @@ if (getComputedStyle$1(body).direction === 'rtl') { | ||
| const SCROLLBAR_MAX = 25; | ||
| function getViewportRect(element, strategy) { | ||
| function getViewportRect(element, strategy, rootBoundary) { | ||
| if (rootBoundary === void 0) { | ||
| rootBoundary = 'viewport'; | ||
| } | ||
| const isLayoutViewport = rootBoundary === 'layoutViewport'; | ||
| const win = getWindow(element); | ||
@@ -413,14 +413,28 @@ const html = getDocumentElement(element); | ||
| if (visualViewport) { | ||
| width = visualViewport.width; | ||
| height = visualViewport.height; | ||
| const visualViewportBased = isWebKit(); | ||
| if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { | ||
| x = visualViewport.offsetLeft; | ||
| y = visualViewport.offsetTop; | ||
| // Client coordinates are relative to the layout viewport, except in | ||
| // WebKit with an `absolute` strategy, where they are relative to the | ||
| // visual viewport. | ||
| const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed'; | ||
| if (isLayoutViewport) { | ||
| if (!layoutRelativeClientCoords) { | ||
| x = -visualViewport.offsetLeft; | ||
| y = -visualViewport.offsetTop; | ||
| } | ||
| } else { | ||
| width = visualViewport.width; | ||
| height = visualViewport.height; | ||
| if (layoutRelativeClientCoords) { | ||
| x = visualViewport.offsetLeft; | ||
| y = visualViewport.offsetTop; | ||
| } | ||
| } | ||
| } | ||
| const windowScrollbarX = getWindowScrollBarX(html); | ||
| // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the | ||
| // visual width of the <html> but this is not considered in the size | ||
| // of `html.clientWidth`. | ||
| // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks | ||
| // the visual width but isn't reflected in `html.clientWidth`, so subtract it. | ||
| // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also | ||
| // reserves an empty inline-start gutter that clips nothing, so exclude just | ||
| // the one scrollbar-side gutter — halve the measured (two-gutter) total. A | ||
| // left-side scrollbar (`windowScrollbarX > 0`) is already handled by | ||
| // `getHTMLOffset`/`visualViewport.width`; skip it here. | ||
| if (windowScrollbarX <= 0) { | ||
@@ -431,10 +445,7 @@ const doc = html.ownerDocument; | ||
| const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; | ||
| const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | ||
| if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { | ||
| width -= clippingStableScrollbarWidth; | ||
| const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | ||
| const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth; | ||
| if (gutter <= SCROLLBAR_MAX) { | ||
| width -= gutter; | ||
| } | ||
| } else if (windowScrollbarX <= SCROLLBAR_MAX) { | ||
| // If the <body> scrollbar is on the left, the width needs to be extended | ||
| // by the scrollbar amount so there isn't extra space on the right. | ||
| width += windowScrollbarX; | ||
| } | ||
@@ -454,3 +465,3 @@ return { | ||
| const left = clientRect.left + element.clientLeft; | ||
| const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); | ||
| const scale = getScale(element); | ||
| const width = element.clientWidth * scale.x; | ||
@@ -469,4 +480,4 @@ const height = element.clientHeight * scale.y; | ||
| let rect; | ||
| if (clippingAncestor === 'viewport') { | ||
| rect = getViewportRect(element, strategy); | ||
| if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') { | ||
| rect = getViewportRect(element, strategy, clippingAncestor); | ||
| } else if (clippingAncestor === 'document') { | ||
@@ -487,9 +498,2 @@ rect = getDocumentRect(getDocumentElement(element)); | ||
| } | ||
| function hasFixedPositionAncestor(element, stopNode) { | ||
| const parentNode = getParentNode(element); | ||
| if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { | ||
| return false; | ||
| } | ||
| return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); | ||
| } | ||
@@ -505,3 +509,3 @@ // A "clipping ancestor" is an `overflow` element with the characteristic of | ||
| let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); | ||
| let currentContainingBlockComputedStyle = null; | ||
| let lastKeptComputedStyle = null; | ||
| const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; | ||
@@ -514,6 +518,10 @@ let currentNode = elementIsFixed ? getParentNode(element) : element; | ||
| const currentNodeIsContaining = isContainingBlock(currentNode); | ||
| if (!currentNodeIsContaining && computedStyle.position === 'fixed') { | ||
| currentContainingBlockComputedStyle = null; | ||
| } | ||
| const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); | ||
| // Position of the containing block chain below the current node. A fixed | ||
| // element whose containing block hasn't been found yet is a fixed chain. | ||
| const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : ''; | ||
| // A non-containing ancestor does not clip the element when the chain | ||
| // below it escapes it: a fixed chain escapes all ancestors up to the | ||
| // next containing block, an absolute chain escapes static ancestors. | ||
| const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static'); | ||
| if (shouldDropCurrentNode) { | ||
@@ -523,4 +531,4 @@ // Drop non-containing blocks. | ||
| } else { | ||
| // Record last containing block for next iteration. | ||
| currentContainingBlockComputedStyle = computedStyle; | ||
| // The kept node carries the chain position for the next iteration. | ||
| lastKeptComputedStyle = computedStyle; | ||
| } | ||
@@ -585,9 +593,3 @@ currentNode = getParentNode(currentNode); | ||
| const offsets = createCoords(0); | ||
| // If the <body> scrollbar appears on the left (e.g. RTL systems). Use | ||
| // Firefox with layout.scrollbar.side = 3 in about:config to test this. | ||
| function setLeftRTLScrollbarOffset() { | ||
| offsets.x = getWindowScrollBarX(documentElement); | ||
| } | ||
| if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | ||
| if (isOffsetParentAnElement || !isFixed) { | ||
| if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { | ||
@@ -600,8 +602,9 @@ scroll = getNodeScroll(offsetParent); | ||
| offsets.y = offsetRect.y + offsetParent.clientTop; | ||
| } else if (documentElement) { | ||
| setLeftRTLScrollbarOffset(); | ||
| } | ||
| } | ||
| if (isFixed && !isOffsetParentAnElement && documentElement) { | ||
| setLeftRTLScrollbarOffset(); | ||
| // If the <body> scrollbar appears on the left (e.g. RTL systems). Use | ||
| // Firefox with layout.scrollbar.side = 3 in about:config to test this. | ||
| if (!isOffsetParentAnElement && documentElement) { | ||
| offsets.x = getWindowScrollBarX(documentElement); | ||
| } | ||
@@ -706,3 +709,3 @@ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); | ||
| // https://samthor.au/2021/observing-dom/ | ||
| function observeMove(element, onMove) { | ||
| function observeMove(element, onMove, ancestorResize) { | ||
| let io = null; | ||
@@ -750,2 +753,11 @@ let timeoutId; | ||
| const ratio = entries[0].intersectionRatio; | ||
| // The entry is a snapshot, so the reference may have moved since the | ||
| // intersection was computed (under performance constraints, or between | ||
| // consecutive frames of a multi-frame layout shift). The reported ratio | ||
| // and the observed area are stale in that case and cannot be trusted to | ||
| // detect subsequent movement, so refresh regardless of the ratio. | ||
| if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | ||
| return refresh(); | ||
| } | ||
| if (ratio !== threshold) { | ||
@@ -756,4 +768,4 @@ if (!isFirstUpdate) { | ||
| if (!ratio) { | ||
| // If the reference is clipped, the ratio is 0. Throttle the refresh | ||
| // to prevent an infinite loop of updates. | ||
| // If the reference is clipped in place, the ratio is 0. Throttle | ||
| // the refresh to prevent an infinite loop of updates. | ||
| timeoutId = setTimeout(() => { | ||
@@ -766,12 +778,2 @@ refresh(false, 1e-7); | ||
| } | ||
| if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | ||
| // It's possible that even though the ratio is reported as 1, the | ||
| // element is not actually fully within the IntersectionObserver's root | ||
| // area anymore. This can happen under performance constraints. This may | ||
| // be a bug in the browser's IntersectionObserver implementation. To | ||
| // work around this, we compare the element's bounding rect now with | ||
| // what it was at the time we created the IntersectionObserver. If they | ||
| // are not equal then the element moved, so we refresh. | ||
| refresh(); | ||
| } | ||
| isFirstUpdate = false; | ||
@@ -793,4 +795,14 @@ } | ||
| } | ||
| const win = getWindow(element); | ||
| // The window is a resize ancestor, so when `ancestorResize` is enabled its | ||
| // listener already runs the update on resize. Here we only need to rebuild | ||
| // the `IntersectionObserver` for the new root size, skipping a redundant | ||
| // update. When `ancestorResize` is disabled, this becomes the sole update. | ||
| const handleResize = () => refresh(ancestorResize); | ||
| win.addEventListener('resize', handleResize); | ||
| refresh(true); | ||
| return cleanup; | ||
| return () => { | ||
| win.removeEventListener('resize', handleResize); | ||
| cleanup(); | ||
| }; | ||
| } | ||
@@ -820,8 +832,6 @@ | ||
| ancestors.forEach(ancestor => { | ||
| ancestorScroll && ancestor.addEventListener('scroll', update, { | ||
| passive: true | ||
| }); | ||
| ancestorScroll && ancestor.addEventListener('scroll', update); | ||
| ancestorResize && ancestor.addEventListener('resize', update); | ||
| }); | ||
| const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; | ||
| const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null; | ||
| let reobserveFrame = -1; | ||
@@ -965,7 +975,5 @@ let resizeObserver = null; | ||
| const cache = new Map(); | ||
| const mergedOptions = { | ||
| platform, | ||
| ...options | ||
| }; | ||
| const mergedOptions = options != null ? options : {}; | ||
| const platformWithCache = { | ||
| ...platform, | ||
| ...mergedOptions.platform, | ||
@@ -972,0 +980,0 @@ _c: cache |
@@ -75,3 +75,3 @@ import { AlignedPlacement } from '@floating-ui/core'; | ||
| */ | ||
| ancestorScroll?: boolean; | ||
| ancestorScroll?: boolean | undefined; | ||
| /** | ||
@@ -82,3 +82,3 @@ * Whether to update the position when an overflow ancestor is resized. This | ||
| */ | ||
| ancestorResize?: boolean; | ||
| ancestorResize?: boolean | undefined; | ||
| /** | ||
@@ -89,3 +89,3 @@ * Whether to update the position when either the reference or floating | ||
| */ | ||
| elementResize?: boolean; | ||
| elementResize?: boolean | undefined; | ||
| /** | ||
@@ -96,3 +96,3 @@ * Whether to update the position when the reference relocated on the screen | ||
| */ | ||
| layoutShift?: boolean; | ||
| layoutShift?: boolean | undefined; | ||
| /** | ||
@@ -103,3 +103,3 @@ * Whether to update on every animation frame if necessary. Only use if you | ||
| */ | ||
| animationFrame?: boolean; | ||
| animationFrame?: boolean | undefined; | ||
| } | ||
@@ -109,2 +109,6 @@ | ||
| declare type BivariantCallback<T extends (...args: any[]) => any> = { | ||
| bivariance(...args: Parameters<T>): ReturnType<T>; | ||
| }['bivariance']; | ||
| /** | ||
@@ -128,7 +132,7 @@ * The clipping boundary area of the floating element. | ||
| */ | ||
| middleware?: Array<Middleware | null | undefined | false>; | ||
| middleware?: Array<Middleware | null | undefined | false> | undefined; | ||
| /** | ||
| * Custom or extended platform object. | ||
| */ | ||
| platform?: Platform; | ||
| platform?: Platform | undefined; | ||
| }>; | ||
@@ -153,3 +157,3 @@ | ||
| export declare type DetectOverflowOptions = Prettify<Omit<DetectOverflowOptions_2, 'boundary'> & { | ||
| boundary?: Boundary; | ||
| boundary?: Boundary | undefined; | ||
| }>; | ||
@@ -252,3 +256,3 @@ | ||
| */ | ||
| mainAxis?: number; | ||
| mainAxis?: number | undefined; | ||
| /** | ||
@@ -259,3 +263,3 @@ * The axis that runs along the alignment of the floating element. | ||
| */ | ||
| crossAxis?: number; | ||
| crossAxis?: number | undefined; | ||
| /** | ||
@@ -271,3 +275,3 @@ * The same axis as `crossAxis` but applies only to aligned placements | ||
| */ | ||
| alignmentAxis?: number | null; | ||
| alignmentAxis?: number | null | undefined; | ||
| }; | ||
@@ -293,3 +297,3 @@ | ||
| convertOffsetParentRelativeRectToViewportRelativeRect: (args: { | ||
| elements?: Elements; | ||
| elements?: Elements | undefined; | ||
| rect: Rect; | ||
@@ -308,3 +312,3 @@ offsetParent: Element; | ||
| }>; | ||
| detectOverflow?: typeof detectOverflow_2; | ||
| detectOverflow?: typeof detectOverflow_2 | undefined; | ||
| } | ||
@@ -353,6 +357,6 @@ | ||
| */ | ||
| apply?(args: MiddlewareState & { | ||
| apply?: BivariantCallback<(args: MiddlewareState & { | ||
| availableWidth: number; | ||
| availableHeight: number; | ||
| }): Promisable<void>; | ||
| }) => Promisable<void>> | undefined; | ||
| }>; | ||
@@ -368,6 +372,6 @@ | ||
| getBoundingClientRect(): ClientRectObject; | ||
| getClientRects?(): Array<ClientRectObject> | DOMRectList; | ||
| contextElement?: Element; | ||
| getClientRects?: (() => Array<ClientRectObject> | DOMRectList) | undefined; | ||
| contextElement?: Element | undefined; | ||
| } | ||
| export { } |
@@ -75,3 +75,3 @@ import { AlignedPlacement } from '@floating-ui/core'; | ||
| */ | ||
| ancestorScroll?: boolean; | ||
| ancestorScroll?: boolean | undefined; | ||
| /** | ||
@@ -82,3 +82,3 @@ * Whether to update the position when an overflow ancestor is resized. This | ||
| */ | ||
| ancestorResize?: boolean; | ||
| ancestorResize?: boolean | undefined; | ||
| /** | ||
@@ -89,3 +89,3 @@ * Whether to update the position when either the reference or floating | ||
| */ | ||
| elementResize?: boolean; | ||
| elementResize?: boolean | undefined; | ||
| /** | ||
@@ -96,3 +96,3 @@ * Whether to update the position when the reference relocated on the screen | ||
| */ | ||
| layoutShift?: boolean; | ||
| layoutShift?: boolean | undefined; | ||
| /** | ||
@@ -103,3 +103,3 @@ * Whether to update on every animation frame if necessary. Only use if you | ||
| */ | ||
| animationFrame?: boolean; | ||
| animationFrame?: boolean | undefined; | ||
| } | ||
@@ -109,2 +109,6 @@ | ||
| declare type BivariantCallback<T extends (...args: any[]) => any> = { | ||
| bivariance(...args: Parameters<T>): ReturnType<T>; | ||
| }['bivariance']; | ||
| /** | ||
@@ -128,7 +132,7 @@ * The clipping boundary area of the floating element. | ||
| */ | ||
| middleware?: Array<Middleware | null | undefined | false>; | ||
| middleware?: Array<Middleware | null | undefined | false> | undefined; | ||
| /** | ||
| * Custom or extended platform object. | ||
| */ | ||
| platform?: Platform; | ||
| platform?: Platform | undefined; | ||
| }>; | ||
@@ -153,3 +157,3 @@ | ||
| export declare type DetectOverflowOptions = Prettify<Omit<DetectOverflowOptions_2, 'boundary'> & { | ||
| boundary?: Boundary; | ||
| boundary?: Boundary | undefined; | ||
| }>; | ||
@@ -252,3 +256,3 @@ | ||
| */ | ||
| mainAxis?: number; | ||
| mainAxis?: number | undefined; | ||
| /** | ||
@@ -259,3 +263,3 @@ * The axis that runs along the alignment of the floating element. | ||
| */ | ||
| crossAxis?: number; | ||
| crossAxis?: number | undefined; | ||
| /** | ||
@@ -271,3 +275,3 @@ * The same axis as `crossAxis` but applies only to aligned placements | ||
| */ | ||
| alignmentAxis?: number | null; | ||
| alignmentAxis?: number | null | undefined; | ||
| }; | ||
@@ -293,3 +297,3 @@ | ||
| convertOffsetParentRelativeRectToViewportRelativeRect: (args: { | ||
| elements?: Elements; | ||
| elements?: Elements | undefined; | ||
| rect: Rect; | ||
@@ -308,3 +312,3 @@ offsetParent: Element; | ||
| }>; | ||
| detectOverflow?: typeof detectOverflow_2; | ||
| detectOverflow?: typeof detectOverflow_2 | undefined; | ||
| } | ||
@@ -353,6 +357,6 @@ | ||
| */ | ||
| apply?(args: MiddlewareState & { | ||
| apply?: BivariantCallback<(args: MiddlewareState & { | ||
| availableWidth: number; | ||
| availableHeight: number; | ||
| }): Promisable<void>; | ||
| }) => Promisable<void>> | undefined; | ||
| }>; | ||
@@ -368,6 +372,6 @@ | ||
| getBoundingClientRect(): ClientRectObject; | ||
| getClientRects?(): Array<ClientRectObject> | DOMRectList; | ||
| contextElement?: Element; | ||
| getClientRects?: (() => Array<ClientRectObject> | DOMRectList) | undefined; | ||
| contextElement?: Element | undefined; | ||
| } | ||
| export { } |
@@ -74,6 +74,3 @@ import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| } | ||
| if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { | ||
| return false; | ||
| } | ||
| return isFixed; | ||
| return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); | ||
| } | ||
@@ -105,8 +102,8 @@ | ||
| let height = clientRect.height / scale.y; | ||
| if (domElement) { | ||
| if (domElement && offsetParent) { | ||
| const win = getWindow(domElement); | ||
| const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | ||
| const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | ||
| let currentWin = win; | ||
| let currentIFrame = getFrameElement(currentWin); | ||
| while (currentIFrame && offsetParent && offsetWin !== currentWin) { | ||
| while (currentIFrame && offsetWin !== currentWin) { | ||
| const iframeScale = getScale(currentIFrame); | ||
@@ -175,3 +172,3 @@ const iframeRect = currentIFrame.getBoundingClientRect(); | ||
| const isOffsetParentAnElement = isHTMLElement(offsetParent); | ||
| if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | ||
| if (isOffsetParentAnElement || !isFixed) { | ||
| if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { | ||
@@ -197,3 +194,3 @@ scroll = getNodeScroll(offsetParent); | ||
| function getClientRects(element) { | ||
| return Array.from(element.getClientRects()); | ||
| return element.getClientRects ? Array.from(element.getClientRects()) : []; | ||
| } | ||
@@ -203,9 +200,8 @@ | ||
| // of the `<html>` and `<body>` rect bounds if horizontally scrollable. | ||
| function getDocumentRect(element) { | ||
| const html = getDocumentElement(element); | ||
| const scroll = getNodeScroll(element); | ||
| const body = element.ownerDocument.body; | ||
| function getDocumentRect(html) { | ||
| const scroll = getNodeScroll(html); | ||
| const body = html.ownerDocument.body; | ||
| const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); | ||
| const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); | ||
| let x = -scroll.scrollLeft + getWindowScrollBarX(element); | ||
| let x = -scroll.scrollLeft + getWindowScrollBarX(html); | ||
| const y = -scroll.scrollTop; | ||
@@ -227,3 +223,7 @@ if (getComputedStyle$1(body).direction === 'rtl') { | ||
| const SCROLLBAR_MAX = 25; | ||
| function getViewportRect(element, strategy) { | ||
| function getViewportRect(element, strategy, rootBoundary) { | ||
| if (rootBoundary === void 0) { | ||
| rootBoundary = 'viewport'; | ||
| } | ||
| const isLayoutViewport = rootBoundary === 'layoutViewport'; | ||
| const win = getWindow(element); | ||
@@ -237,14 +237,28 @@ const html = getDocumentElement(element); | ||
| if (visualViewport) { | ||
| width = visualViewport.width; | ||
| height = visualViewport.height; | ||
| const visualViewportBased = isWebKit(); | ||
| if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { | ||
| x = visualViewport.offsetLeft; | ||
| y = visualViewport.offsetTop; | ||
| // Client coordinates are relative to the layout viewport, except in | ||
| // WebKit with an `absolute` strategy, where they are relative to the | ||
| // visual viewport. | ||
| const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed'; | ||
| if (isLayoutViewport) { | ||
| if (!layoutRelativeClientCoords) { | ||
| x = -visualViewport.offsetLeft; | ||
| y = -visualViewport.offsetTop; | ||
| } | ||
| } else { | ||
| width = visualViewport.width; | ||
| height = visualViewport.height; | ||
| if (layoutRelativeClientCoords) { | ||
| x = visualViewport.offsetLeft; | ||
| y = visualViewport.offsetTop; | ||
| } | ||
| } | ||
| } | ||
| const windowScrollbarX = getWindowScrollBarX(html); | ||
| // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the | ||
| // visual width of the <html> but this is not considered in the size | ||
| // of `html.clientWidth`. | ||
| // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks | ||
| // the visual width but isn't reflected in `html.clientWidth`, so subtract it. | ||
| // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also | ||
| // reserves an empty inline-start gutter that clips nothing, so exclude just | ||
| // the one scrollbar-side gutter — halve the measured (two-gutter) total. A | ||
| // left-side scrollbar (`windowScrollbarX > 0`) is already handled by | ||
| // `getHTMLOffset`/`visualViewport.width`; skip it here. | ||
| if (windowScrollbarX <= 0) { | ||
@@ -255,10 +269,7 @@ const doc = html.ownerDocument; | ||
| const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; | ||
| const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | ||
| if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { | ||
| width -= clippingStableScrollbarWidth; | ||
| const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | ||
| const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth; | ||
| if (gutter <= SCROLLBAR_MAX) { | ||
| width -= gutter; | ||
| } | ||
| } else if (windowScrollbarX <= SCROLLBAR_MAX) { | ||
| // If the <body> scrollbar is on the left, the width needs to be extended | ||
| // by the scrollbar amount so there isn't extra space on the right. | ||
| width += windowScrollbarX; | ||
| } | ||
@@ -278,3 +289,3 @@ return { | ||
| const left = clientRect.left + element.clientLeft; | ||
| const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); | ||
| const scale = getScale(element); | ||
| const width = element.clientWidth * scale.x; | ||
@@ -293,4 +304,4 @@ const height = element.clientHeight * scale.y; | ||
| let rect; | ||
| if (clippingAncestor === 'viewport') { | ||
| rect = getViewportRect(element, strategy); | ||
| if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') { | ||
| rect = getViewportRect(element, strategy, clippingAncestor); | ||
| } else if (clippingAncestor === 'document') { | ||
@@ -311,9 +322,2 @@ rect = getDocumentRect(getDocumentElement(element)); | ||
| } | ||
| function hasFixedPositionAncestor(element, stopNode) { | ||
| const parentNode = getParentNode(element); | ||
| if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { | ||
| return false; | ||
| } | ||
| return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); | ||
| } | ||
@@ -329,3 +333,3 @@ // A "clipping ancestor" is an `overflow` element with the characteristic of | ||
| let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); | ||
| let currentContainingBlockComputedStyle = null; | ||
| let lastKeptComputedStyle = null; | ||
| const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; | ||
@@ -338,6 +342,10 @@ let currentNode = elementIsFixed ? getParentNode(element) : element; | ||
| const currentNodeIsContaining = isContainingBlock(currentNode); | ||
| if (!currentNodeIsContaining && computedStyle.position === 'fixed') { | ||
| currentContainingBlockComputedStyle = null; | ||
| } | ||
| const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); | ||
| // Position of the containing block chain below the current node. A fixed | ||
| // element whose containing block hasn't been found yet is a fixed chain. | ||
| const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : ''; | ||
| // A non-containing ancestor does not clip the element when the chain | ||
| // below it escapes it: a fixed chain escapes all ancestors up to the | ||
| // next containing block, an absolute chain escapes static ancestors. | ||
| const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static'); | ||
| if (shouldDropCurrentNode) { | ||
@@ -347,4 +355,4 @@ // Drop non-containing blocks. | ||
| } else { | ||
| // Record last containing block for next iteration. | ||
| currentContainingBlockComputedStyle = computedStyle; | ||
| // The kept node carries the chain position for the next iteration. | ||
| lastKeptComputedStyle = computedStyle; | ||
| } | ||
@@ -409,9 +417,3 @@ currentNode = getParentNode(currentNode); | ||
| const offsets = createCoords(0); | ||
| // If the <body> scrollbar appears on the left (e.g. RTL systems). Use | ||
| // Firefox with layout.scrollbar.side = 3 in about:config to test this. | ||
| function setLeftRTLScrollbarOffset() { | ||
| offsets.x = getWindowScrollBarX(documentElement); | ||
| } | ||
| if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | ||
| if (isOffsetParentAnElement || !isFixed) { | ||
| if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { | ||
@@ -424,8 +426,9 @@ scroll = getNodeScroll(offsetParent); | ||
| offsets.y = offsetRect.y + offsetParent.clientTop; | ||
| } else if (documentElement) { | ||
| setLeftRTLScrollbarOffset(); | ||
| } | ||
| } | ||
| if (isFixed && !isOffsetParentAnElement && documentElement) { | ||
| setLeftRTLScrollbarOffset(); | ||
| // If the <body> scrollbar appears on the left (e.g. RTL systems). Use | ||
| // Firefox with layout.scrollbar.side = 3 in about:config to test this. | ||
| if (!isOffsetParentAnElement && documentElement) { | ||
| offsets.x = getWindowScrollBarX(documentElement); | ||
| } | ||
@@ -530,3 +533,3 @@ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); | ||
| // https://samthor.au/2021/observing-dom/ | ||
| function observeMove(element, onMove) { | ||
| function observeMove(element, onMove, ancestorResize) { | ||
| let io = null; | ||
@@ -574,2 +577,11 @@ let timeoutId; | ||
| const ratio = entries[0].intersectionRatio; | ||
| // The entry is a snapshot, so the reference may have moved since the | ||
| // intersection was computed (under performance constraints, or between | ||
| // consecutive frames of a multi-frame layout shift). The reported ratio | ||
| // and the observed area are stale in that case and cannot be trusted to | ||
| // detect subsequent movement, so refresh regardless of the ratio. | ||
| if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | ||
| return refresh(); | ||
| } | ||
| if (ratio !== threshold) { | ||
@@ -580,4 +592,4 @@ if (!isFirstUpdate) { | ||
| if (!ratio) { | ||
| // If the reference is clipped, the ratio is 0. Throttle the refresh | ||
| // to prevent an infinite loop of updates. | ||
| // If the reference is clipped in place, the ratio is 0. Throttle | ||
| // the refresh to prevent an infinite loop of updates. | ||
| timeoutId = setTimeout(() => { | ||
@@ -590,12 +602,2 @@ refresh(false, 1e-7); | ||
| } | ||
| if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | ||
| // It's possible that even though the ratio is reported as 1, the | ||
| // element is not actually fully within the IntersectionObserver's root | ||
| // area anymore. This can happen under performance constraints. This may | ||
| // be a bug in the browser's IntersectionObserver implementation. To | ||
| // work around this, we compare the element's bounding rect now with | ||
| // what it was at the time we created the IntersectionObserver. If they | ||
| // are not equal then the element moved, so we refresh. | ||
| refresh(); | ||
| } | ||
| isFirstUpdate = false; | ||
@@ -617,4 +619,14 @@ } | ||
| } | ||
| const win = getWindow(element); | ||
| // The window is a resize ancestor, so when `ancestorResize` is enabled its | ||
| // listener already runs the update on resize. Here we only need to rebuild | ||
| // the `IntersectionObserver` for the new root size, skipping a redundant | ||
| // update. When `ancestorResize` is disabled, this becomes the sole update. | ||
| const handleResize = () => refresh(ancestorResize); | ||
| win.addEventListener('resize', handleResize); | ||
| refresh(true); | ||
| return cleanup; | ||
| return () => { | ||
| win.removeEventListener('resize', handleResize); | ||
| cleanup(); | ||
| }; | ||
| } | ||
@@ -644,8 +656,6 @@ | ||
| ancestors.forEach(ancestor => { | ||
| ancestorScroll && ancestor.addEventListener('scroll', update, { | ||
| passive: true | ||
| }); | ||
| ancestorScroll && ancestor.addEventListener('scroll', update); | ||
| ancestorResize && ancestor.addEventListener('resize', update); | ||
| }); | ||
| const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; | ||
| const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null; | ||
| let reobserveFrame = -1; | ||
@@ -789,7 +799,5 @@ let resizeObserver = null; | ||
| const cache = new Map(); | ||
| const mergedOptions = { | ||
| platform, | ||
| ...options | ||
| }; | ||
| const mergedOptions = options != null ? options : {}; | ||
| const platformWithCache = { | ||
| ...platform, | ||
| ...mergedOptions.platform, | ||
@@ -796,0 +804,0 @@ _c: cache |
+89
-81
@@ -74,6 +74,3 @@ import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| } | ||
| if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { | ||
| return false; | ||
| } | ||
| return isFixed; | ||
| return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); | ||
| } | ||
@@ -105,8 +102,8 @@ | ||
| let height = clientRect.height / scale.y; | ||
| if (domElement) { | ||
| if (domElement && offsetParent) { | ||
| const win = getWindow(domElement); | ||
| const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | ||
| const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | ||
| let currentWin = win; | ||
| let currentIFrame = getFrameElement(currentWin); | ||
| while (currentIFrame && offsetParent && offsetWin !== currentWin) { | ||
| while (currentIFrame && offsetWin !== currentWin) { | ||
| const iframeScale = getScale(currentIFrame); | ||
@@ -175,3 +172,3 @@ const iframeRect = currentIFrame.getBoundingClientRect(); | ||
| const isOffsetParentAnElement = isHTMLElement(offsetParent); | ||
| if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | ||
| if (isOffsetParentAnElement || !isFixed) { | ||
| if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { | ||
@@ -197,3 +194,3 @@ scroll = getNodeScroll(offsetParent); | ||
| function getClientRects(element) { | ||
| return Array.from(element.getClientRects()); | ||
| return element.getClientRects ? Array.from(element.getClientRects()) : []; | ||
| } | ||
@@ -203,9 +200,8 @@ | ||
| // of the `<html>` and `<body>` rect bounds if horizontally scrollable. | ||
| function getDocumentRect(element) { | ||
| const html = getDocumentElement(element); | ||
| const scroll = getNodeScroll(element); | ||
| const body = element.ownerDocument.body; | ||
| function getDocumentRect(html) { | ||
| const scroll = getNodeScroll(html); | ||
| const body = html.ownerDocument.body; | ||
| const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); | ||
| const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); | ||
| let x = -scroll.scrollLeft + getWindowScrollBarX(element); | ||
| let x = -scroll.scrollLeft + getWindowScrollBarX(html); | ||
| const y = -scroll.scrollTop; | ||
@@ -227,3 +223,7 @@ if (getComputedStyle$1(body).direction === 'rtl') { | ||
| const SCROLLBAR_MAX = 25; | ||
| function getViewportRect(element, strategy) { | ||
| function getViewportRect(element, strategy, rootBoundary) { | ||
| if (rootBoundary === void 0) { | ||
| rootBoundary = 'viewport'; | ||
| } | ||
| const isLayoutViewport = rootBoundary === 'layoutViewport'; | ||
| const win = getWindow(element); | ||
@@ -237,14 +237,28 @@ const html = getDocumentElement(element); | ||
| if (visualViewport) { | ||
| width = visualViewport.width; | ||
| height = visualViewport.height; | ||
| const visualViewportBased = isWebKit(); | ||
| if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { | ||
| x = visualViewport.offsetLeft; | ||
| y = visualViewport.offsetTop; | ||
| // Client coordinates are relative to the layout viewport, except in | ||
| // WebKit with an `absolute` strategy, where they are relative to the | ||
| // visual viewport. | ||
| const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed'; | ||
| if (isLayoutViewport) { | ||
| if (!layoutRelativeClientCoords) { | ||
| x = -visualViewport.offsetLeft; | ||
| y = -visualViewport.offsetTop; | ||
| } | ||
| } else { | ||
| width = visualViewport.width; | ||
| height = visualViewport.height; | ||
| if (layoutRelativeClientCoords) { | ||
| x = visualViewport.offsetLeft; | ||
| y = visualViewport.offsetTop; | ||
| } | ||
| } | ||
| } | ||
| const windowScrollbarX = getWindowScrollBarX(html); | ||
| // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the | ||
| // visual width of the <html> but this is not considered in the size | ||
| // of `html.clientWidth`. | ||
| // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks | ||
| // the visual width but isn't reflected in `html.clientWidth`, so subtract it. | ||
| // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also | ||
| // reserves an empty inline-start gutter that clips nothing, so exclude just | ||
| // the one scrollbar-side gutter — halve the measured (two-gutter) total. A | ||
| // left-side scrollbar (`windowScrollbarX > 0`) is already handled by | ||
| // `getHTMLOffset`/`visualViewport.width`; skip it here. | ||
| if (windowScrollbarX <= 0) { | ||
@@ -255,10 +269,7 @@ const doc = html.ownerDocument; | ||
| const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; | ||
| const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | ||
| if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { | ||
| width -= clippingStableScrollbarWidth; | ||
| const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | ||
| const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth; | ||
| if (gutter <= SCROLLBAR_MAX) { | ||
| width -= gutter; | ||
| } | ||
| } else if (windowScrollbarX <= SCROLLBAR_MAX) { | ||
| // If the <body> scrollbar is on the left, the width needs to be extended | ||
| // by the scrollbar amount so there isn't extra space on the right. | ||
| width += windowScrollbarX; | ||
| } | ||
@@ -278,3 +289,3 @@ return { | ||
| const left = clientRect.left + element.clientLeft; | ||
| const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); | ||
| const scale = getScale(element); | ||
| const width = element.clientWidth * scale.x; | ||
@@ -293,4 +304,4 @@ const height = element.clientHeight * scale.y; | ||
| let rect; | ||
| if (clippingAncestor === 'viewport') { | ||
| rect = getViewportRect(element, strategy); | ||
| if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') { | ||
| rect = getViewportRect(element, strategy, clippingAncestor); | ||
| } else if (clippingAncestor === 'document') { | ||
@@ -311,9 +322,2 @@ rect = getDocumentRect(getDocumentElement(element)); | ||
| } | ||
| function hasFixedPositionAncestor(element, stopNode) { | ||
| const parentNode = getParentNode(element); | ||
| if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { | ||
| return false; | ||
| } | ||
| return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); | ||
| } | ||
@@ -329,3 +333,3 @@ // A "clipping ancestor" is an `overflow` element with the characteristic of | ||
| let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); | ||
| let currentContainingBlockComputedStyle = null; | ||
| let lastKeptComputedStyle = null; | ||
| const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; | ||
@@ -338,6 +342,10 @@ let currentNode = elementIsFixed ? getParentNode(element) : element; | ||
| const currentNodeIsContaining = isContainingBlock(currentNode); | ||
| if (!currentNodeIsContaining && computedStyle.position === 'fixed') { | ||
| currentContainingBlockComputedStyle = null; | ||
| } | ||
| const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); | ||
| // Position of the containing block chain below the current node. A fixed | ||
| // element whose containing block hasn't been found yet is a fixed chain. | ||
| const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : ''; | ||
| // A non-containing ancestor does not clip the element when the chain | ||
| // below it escapes it: a fixed chain escapes all ancestors up to the | ||
| // next containing block, an absolute chain escapes static ancestors. | ||
| const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static'); | ||
| if (shouldDropCurrentNode) { | ||
@@ -347,4 +355,4 @@ // Drop non-containing blocks. | ||
| } else { | ||
| // Record last containing block for next iteration. | ||
| currentContainingBlockComputedStyle = computedStyle; | ||
| // The kept node carries the chain position for the next iteration. | ||
| lastKeptComputedStyle = computedStyle; | ||
| } | ||
@@ -409,9 +417,3 @@ currentNode = getParentNode(currentNode); | ||
| const offsets = createCoords(0); | ||
| // If the <body> scrollbar appears on the left (e.g. RTL systems). Use | ||
| // Firefox with layout.scrollbar.side = 3 in about:config to test this. | ||
| function setLeftRTLScrollbarOffset() { | ||
| offsets.x = getWindowScrollBarX(documentElement); | ||
| } | ||
| if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | ||
| if (isOffsetParentAnElement || !isFixed) { | ||
| if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { | ||
@@ -424,8 +426,9 @@ scroll = getNodeScroll(offsetParent); | ||
| offsets.y = offsetRect.y + offsetParent.clientTop; | ||
| } else if (documentElement) { | ||
| setLeftRTLScrollbarOffset(); | ||
| } | ||
| } | ||
| if (isFixed && !isOffsetParentAnElement && documentElement) { | ||
| setLeftRTLScrollbarOffset(); | ||
| // If the <body> scrollbar appears on the left (e.g. RTL systems). Use | ||
| // Firefox with layout.scrollbar.side = 3 in about:config to test this. | ||
| if (!isOffsetParentAnElement && documentElement) { | ||
| offsets.x = getWindowScrollBarX(documentElement); | ||
| } | ||
@@ -530,3 +533,3 @@ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); | ||
| // https://samthor.au/2021/observing-dom/ | ||
| function observeMove(element, onMove) { | ||
| function observeMove(element, onMove, ancestorResize) { | ||
| let io = null; | ||
@@ -574,2 +577,11 @@ let timeoutId; | ||
| const ratio = entries[0].intersectionRatio; | ||
| // The entry is a snapshot, so the reference may have moved since the | ||
| // intersection was computed (under performance constraints, or between | ||
| // consecutive frames of a multi-frame layout shift). The reported ratio | ||
| // and the observed area are stale in that case and cannot be trusted to | ||
| // detect subsequent movement, so refresh regardless of the ratio. | ||
| if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | ||
| return refresh(); | ||
| } | ||
| if (ratio !== threshold) { | ||
@@ -580,4 +592,4 @@ if (!isFirstUpdate) { | ||
| if (!ratio) { | ||
| // If the reference is clipped, the ratio is 0. Throttle the refresh | ||
| // to prevent an infinite loop of updates. | ||
| // If the reference is clipped in place, the ratio is 0. Throttle | ||
| // the refresh to prevent an infinite loop of updates. | ||
| timeoutId = setTimeout(() => { | ||
@@ -590,12 +602,2 @@ refresh(false, 1e-7); | ||
| } | ||
| if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | ||
| // It's possible that even though the ratio is reported as 1, the | ||
| // element is not actually fully within the IntersectionObserver's root | ||
| // area anymore. This can happen under performance constraints. This may | ||
| // be a bug in the browser's IntersectionObserver implementation. To | ||
| // work around this, we compare the element's bounding rect now with | ||
| // what it was at the time we created the IntersectionObserver. If they | ||
| // are not equal then the element moved, so we refresh. | ||
| refresh(); | ||
| } | ||
| isFirstUpdate = false; | ||
@@ -617,4 +619,14 @@ } | ||
| } | ||
| const win = getWindow(element); | ||
| // The window is a resize ancestor, so when `ancestorResize` is enabled its | ||
| // listener already runs the update on resize. Here we only need to rebuild | ||
| // the `IntersectionObserver` for the new root size, skipping a redundant | ||
| // update. When `ancestorResize` is disabled, this becomes the sole update. | ||
| const handleResize = () => refresh(ancestorResize); | ||
| win.addEventListener('resize', handleResize); | ||
| refresh(true); | ||
| return cleanup; | ||
| return () => { | ||
| win.removeEventListener('resize', handleResize); | ||
| cleanup(); | ||
| }; | ||
| } | ||
@@ -644,8 +656,6 @@ | ||
| ancestors.forEach(ancestor => { | ||
| ancestorScroll && ancestor.addEventListener('scroll', update, { | ||
| passive: true | ||
| }); | ||
| ancestorScroll && ancestor.addEventListener('scroll', update); | ||
| ancestorResize && ancestor.addEventListener('resize', update); | ||
| }); | ||
| const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; | ||
| const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null; | ||
| let reobserveFrame = -1; | ||
@@ -789,7 +799,5 @@ let resizeObserver = null; | ||
| const cache = new Map(); | ||
| const mergedOptions = { | ||
| platform, | ||
| ...options | ||
| }; | ||
| const mergedOptions = options != null ? options : {}; | ||
| const platformWithCache = { | ||
| ...platform, | ||
| ...mergedOptions.platform, | ||
@@ -796,0 +804,0 @@ _c: cache |
@@ -156,3 +156,3 @@ (function (global, factory) { | ||
| if (isLastTraversableNode(parentNode)) { | ||
| return node.ownerDocument ? node.ownerDocument.body : node.body; | ||
| return (node.ownerDocument || node).body; | ||
| } | ||
@@ -254,6 +254,3 @@ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { | ||
| } | ||
| if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { | ||
| return false; | ||
| } | ||
| return isFixed; | ||
| return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); | ||
| } | ||
@@ -285,8 +282,8 @@ | ||
| let height = clientRect.height / scale.y; | ||
| if (domElement) { | ||
| if (domElement && offsetParent) { | ||
| const win = getWindow(domElement); | ||
| const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | ||
| const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | ||
| let currentWin = win; | ||
| let currentIFrame = getFrameElement(currentWin); | ||
| while (currentIFrame && offsetParent && offsetWin !== currentWin) { | ||
| while (currentIFrame && offsetWin !== currentWin) { | ||
| const iframeScale = getScale(currentIFrame); | ||
@@ -355,3 +352,3 @@ const iframeRect = currentIFrame.getBoundingClientRect(); | ||
| const isOffsetParentAnElement = isHTMLElement(offsetParent); | ||
| if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | ||
| if (isOffsetParentAnElement || !isFixed) { | ||
| if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { | ||
@@ -377,3 +374,3 @@ scroll = getNodeScroll(offsetParent); | ||
| function getClientRects(element) { | ||
| return Array.from(element.getClientRects()); | ||
| return element.getClientRects ? Array.from(element.getClientRects()) : []; | ||
| } | ||
@@ -383,9 +380,8 @@ | ||
| // of the `<html>` and `<body>` rect bounds if horizontally scrollable. | ||
| function getDocumentRect(element) { | ||
| const html = getDocumentElement(element); | ||
| const scroll = getNodeScroll(element); | ||
| const body = element.ownerDocument.body; | ||
| function getDocumentRect(html) { | ||
| const scroll = getNodeScroll(html); | ||
| const body = html.ownerDocument.body; | ||
| const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); | ||
| const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); | ||
| let x = -scroll.scrollLeft + getWindowScrollBarX(element); | ||
| let x = -scroll.scrollLeft + getWindowScrollBarX(html); | ||
| const y = -scroll.scrollTop; | ||
@@ -407,3 +403,7 @@ if (getComputedStyle$1(body).direction === 'rtl') { | ||
| const SCROLLBAR_MAX = 25; | ||
| function getViewportRect(element, strategy) { | ||
| function getViewportRect(element, strategy, rootBoundary) { | ||
| if (rootBoundary === void 0) { | ||
| rootBoundary = 'viewport'; | ||
| } | ||
| const isLayoutViewport = rootBoundary === 'layoutViewport'; | ||
| const win = getWindow(element); | ||
@@ -417,14 +417,28 @@ const html = getDocumentElement(element); | ||
| if (visualViewport) { | ||
| width = visualViewport.width; | ||
| height = visualViewport.height; | ||
| const visualViewportBased = isWebKit(); | ||
| if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { | ||
| x = visualViewport.offsetLeft; | ||
| y = visualViewport.offsetTop; | ||
| // Client coordinates are relative to the layout viewport, except in | ||
| // WebKit with an `absolute` strategy, where they are relative to the | ||
| // visual viewport. | ||
| const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed'; | ||
| if (isLayoutViewport) { | ||
| if (!layoutRelativeClientCoords) { | ||
| x = -visualViewport.offsetLeft; | ||
| y = -visualViewport.offsetTop; | ||
| } | ||
| } else { | ||
| width = visualViewport.width; | ||
| height = visualViewport.height; | ||
| if (layoutRelativeClientCoords) { | ||
| x = visualViewport.offsetLeft; | ||
| y = visualViewport.offsetTop; | ||
| } | ||
| } | ||
| } | ||
| const windowScrollbarX = getWindowScrollBarX(html); | ||
| // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the | ||
| // visual width of the <html> but this is not considered in the size | ||
| // of `html.clientWidth`. | ||
| // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks | ||
| // the visual width but isn't reflected in `html.clientWidth`, so subtract it. | ||
| // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also | ||
| // reserves an empty inline-start gutter that clips nothing, so exclude just | ||
| // the one scrollbar-side gutter — halve the measured (two-gutter) total. A | ||
| // left-side scrollbar (`windowScrollbarX > 0`) is already handled by | ||
| // `getHTMLOffset`/`visualViewport.width`; skip it here. | ||
| if (windowScrollbarX <= 0) { | ||
@@ -435,10 +449,7 @@ const doc = html.ownerDocument; | ||
| const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; | ||
| const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | ||
| if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { | ||
| width -= clippingStableScrollbarWidth; | ||
| const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | ||
| const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth; | ||
| if (gutter <= SCROLLBAR_MAX) { | ||
| width -= gutter; | ||
| } | ||
| } else if (windowScrollbarX <= SCROLLBAR_MAX) { | ||
| // If the <body> scrollbar is on the left, the width needs to be extended | ||
| // by the scrollbar amount so there isn't extra space on the right. | ||
| width += windowScrollbarX; | ||
| } | ||
@@ -458,3 +469,3 @@ return { | ||
| const left = clientRect.left + element.clientLeft; | ||
| const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); | ||
| const scale = getScale(element); | ||
| const width = element.clientWidth * scale.x; | ||
@@ -473,4 +484,4 @@ const height = element.clientHeight * scale.y; | ||
| let rect; | ||
| if (clippingAncestor === 'viewport') { | ||
| rect = getViewportRect(element, strategy); | ||
| if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') { | ||
| rect = getViewportRect(element, strategy, clippingAncestor); | ||
| } else if (clippingAncestor === 'document') { | ||
@@ -491,9 +502,2 @@ rect = getDocumentRect(getDocumentElement(element)); | ||
| } | ||
| function hasFixedPositionAncestor(element, stopNode) { | ||
| const parentNode = getParentNode(element); | ||
| if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { | ||
| return false; | ||
| } | ||
| return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); | ||
| } | ||
@@ -509,3 +513,3 @@ // A "clipping ancestor" is an `overflow` element with the characteristic of | ||
| let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); | ||
| let currentContainingBlockComputedStyle = null; | ||
| let lastKeptComputedStyle = null; | ||
| const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; | ||
@@ -518,6 +522,10 @@ let currentNode = elementIsFixed ? getParentNode(element) : element; | ||
| const currentNodeIsContaining = isContainingBlock(currentNode); | ||
| if (!currentNodeIsContaining && computedStyle.position === 'fixed') { | ||
| currentContainingBlockComputedStyle = null; | ||
| } | ||
| const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); | ||
| // Position of the containing block chain below the current node. A fixed | ||
| // element whose containing block hasn't been found yet is a fixed chain. | ||
| const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : ''; | ||
| // A non-containing ancestor does not clip the element when the chain | ||
| // below it escapes it: a fixed chain escapes all ancestors up to the | ||
| // next containing block, an absolute chain escapes static ancestors. | ||
| const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static'); | ||
| if (shouldDropCurrentNode) { | ||
@@ -527,4 +535,4 @@ // Drop non-containing blocks. | ||
| } else { | ||
| // Record last containing block for next iteration. | ||
| currentContainingBlockComputedStyle = computedStyle; | ||
| // The kept node carries the chain position for the next iteration. | ||
| lastKeptComputedStyle = computedStyle; | ||
| } | ||
@@ -589,9 +597,3 @@ currentNode = getParentNode(currentNode); | ||
| const offsets = createCoords(0); | ||
| // If the <body> scrollbar appears on the left (e.g. RTL systems). Use | ||
| // Firefox with layout.scrollbar.side = 3 in about:config to test this. | ||
| function setLeftRTLScrollbarOffset() { | ||
| offsets.x = getWindowScrollBarX(documentElement); | ||
| } | ||
| if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | ||
| if (isOffsetParentAnElement || !isFixed) { | ||
| if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { | ||
@@ -604,8 +606,9 @@ scroll = getNodeScroll(offsetParent); | ||
| offsets.y = offsetRect.y + offsetParent.clientTop; | ||
| } else if (documentElement) { | ||
| setLeftRTLScrollbarOffset(); | ||
| } | ||
| } | ||
| if (isFixed && !isOffsetParentAnElement && documentElement) { | ||
| setLeftRTLScrollbarOffset(); | ||
| // If the <body> scrollbar appears on the left (e.g. RTL systems). Use | ||
| // Firefox with layout.scrollbar.side = 3 in about:config to test this. | ||
| if (!isOffsetParentAnElement && documentElement) { | ||
| offsets.x = getWindowScrollBarX(documentElement); | ||
| } | ||
@@ -710,3 +713,3 @@ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); | ||
| // https://samthor.au/2021/observing-dom/ | ||
| function observeMove(element, onMove) { | ||
| function observeMove(element, onMove, ancestorResize) { | ||
| let io = null; | ||
@@ -754,2 +757,11 @@ let timeoutId; | ||
| const ratio = entries[0].intersectionRatio; | ||
| // The entry is a snapshot, so the reference may have moved since the | ||
| // intersection was computed (under performance constraints, or between | ||
| // consecutive frames of a multi-frame layout shift). The reported ratio | ||
| // and the observed area are stale in that case and cannot be trusted to | ||
| // detect subsequent movement, so refresh regardless of the ratio. | ||
| if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | ||
| return refresh(); | ||
| } | ||
| if (ratio !== threshold) { | ||
@@ -760,4 +772,4 @@ if (!isFirstUpdate) { | ||
| if (!ratio) { | ||
| // If the reference is clipped, the ratio is 0. Throttle the refresh | ||
| // to prevent an infinite loop of updates. | ||
| // If the reference is clipped in place, the ratio is 0. Throttle | ||
| // the refresh to prevent an infinite loop of updates. | ||
| timeoutId = setTimeout(() => { | ||
@@ -770,12 +782,2 @@ refresh(false, 1e-7); | ||
| } | ||
| if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | ||
| // It's possible that even though the ratio is reported as 1, the | ||
| // element is not actually fully within the IntersectionObserver's root | ||
| // area anymore. This can happen under performance constraints. This may | ||
| // be a bug in the browser's IntersectionObserver implementation. To | ||
| // work around this, we compare the element's bounding rect now with | ||
| // what it was at the time we created the IntersectionObserver. If they | ||
| // are not equal then the element moved, so we refresh. | ||
| refresh(); | ||
| } | ||
| isFirstUpdate = false; | ||
@@ -797,4 +799,14 @@ } | ||
| } | ||
| const win = getWindow(element); | ||
| // The window is a resize ancestor, so when `ancestorResize` is enabled its | ||
| // listener already runs the update on resize. Here we only need to rebuild | ||
| // the `IntersectionObserver` for the new root size, skipping a redundant | ||
| // update. When `ancestorResize` is disabled, this becomes the sole update. | ||
| const handleResize = () => refresh(ancestorResize); | ||
| win.addEventListener('resize', handleResize); | ||
| refresh(true); | ||
| return cleanup; | ||
| return () => { | ||
| win.removeEventListener('resize', handleResize); | ||
| cleanup(); | ||
| }; | ||
| } | ||
@@ -824,8 +836,6 @@ | ||
| ancestors.forEach(ancestor => { | ||
| ancestorScroll && ancestor.addEventListener('scroll', update, { | ||
| passive: true | ||
| }); | ||
| ancestorScroll && ancestor.addEventListener('scroll', update); | ||
| ancestorResize && ancestor.addEventListener('resize', update); | ||
| }); | ||
| const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; | ||
| const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null; | ||
| let reobserveFrame = -1; | ||
@@ -969,7 +979,5 @@ let resizeObserver = null; | ||
| const cache = new Map(); | ||
| const mergedOptions = { | ||
| platform, | ||
| ...options | ||
| }; | ||
| const mergedOptions = options != null ? options : {}; | ||
| const platformWithCache = { | ||
| ...platform, | ||
| ...mergedOptions.platform, | ||
@@ -976,0 +984,0 @@ _c: cache |
@@ -1,1 +0,1 @@ | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,c=t=>({x:t,y:t});function l(){return"undefined"!=typeof window}function s(t){return a(t)?(t.nodeName||"").toLowerCase():"#document"}function f(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function u(t){var e;return null==(e=(a(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function a(t){return!!l()&&(t instanceof Node||t instanceof f(t).Node)}function d(t){return!!l()&&(t instanceof Element||t instanceof f(t).Element)}function h(t){return!!l()&&(t instanceof HTMLElement||t instanceof f(t).HTMLElement)}function p(t){return!(!l()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof f(t).ShadowRoot)}function g(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function m(t){return/^(table|td|th)$/.test(s(t))}function y(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const w=/transform|translate|scale|rotate|perspective|filter/,x=/paint|layout|strict|content/,v=t=>!!t&&"none"!==t;let b;function L(t){const e=d(t)?C(t):t;return v(e.transform)||v(e.translate)||v(e.scale)||v(e.rotate)||v(e.perspective)||!R()&&(v(e.backdropFilter)||v(e.filter))||w.test(e.willChange||"")||x.test(e.contain||"")}function R(){return null==b&&(b="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function T(t){return/^(html|body|#document)$/.test(s(t))}function C(t){return f(t).getComputedStyle(t)}function S(t){return d(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function E(t){if("html"===s(t))return t;const e=t.assignedSlot||t.parentNode||p(t)&&t.host||u(t);return p(e)?e.host:e}function F(t){const e=E(t);return T(e)?t.ownerDocument?t.ownerDocument.body:t.body:h(e)&&g(e)?e:F(e)}function O(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=F(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=f(i);if(r){const t=D(c);return e.concat(c,c.visualViewport||[],g(i)?i:[],t&&n?O(t):[])}return e.concat(i,O(i,[],n))}function D(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function W(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=h(t),c=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=i(n)!==c||i(o)!==l;return s&&(n=c,o=l),{width:n,height:o,$:s}}function M(t){return d(t)?t:t.contextElement}function H(t){const e=M(t);if(!h(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:l}=W(e);let s=(l?i(n.width):n.width)/o,f=(l?i(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}const P=c(0);function z(t){const e=f(t);return R()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:P}function A(t,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),l=M(t);let s=c(1);n&&(i?d(i)&&(s=H(i)):s=H(t));const u=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==f(t))&&e}(l,o,i)?z(l):c(0);let a=(r.left+u.x)/s.x,h=(r.top+u.y)/s.y,p=r.width/s.x,g=r.height/s.y;if(l){const t=f(l),e=i&&d(i)?f(i):i;let n=t,o=D(n);for(;o&&i&&e!==n;){const t=H(o),e=o.getBoundingClientRect(),i=C(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;a*=t.x,h*=t.y,p*=t.x,g*=t.y,a+=r,h+=c,n=f(o),o=D(n)}}return e.rectToClientRect({width:p,height:g,x:a,y:h})}function B(t,e){const n=S(t).scrollLeft;return e?e.left+n:A(u(t)).left+n}function V(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-B(t,n),y:n.top+e.scrollTop}}function N(t,n,i){let r;if("viewport"===n)r=function(t,e){const n=f(t),o=u(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,s=0;if(i){r=i.width,c=i.height;const t=R();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,s=i.offsetTop)}const a=B(o);if(a<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,c=Math.abs(o.clientWidth-e.clientWidth-i);c<=25&&(r-=c)}else a<=25&&(r+=a);return{width:r,height:c,x:l,y:s}}(t,i);else if("document"===n)r=function(t){const e=u(t),n=S(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),c=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+B(t);const s=-n.scrollTop;return"rtl"===C(i).direction&&(l+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:c,x:l,y:s}}(u(t));else if(d(n))r=function(t,e){const n=A(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=h(t)?H(t):c(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,i);else{const e=z(t);r={x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}return e.rectToClientRect(r)}function I(t,e){const n=E(t);return!(n===e||!d(n)||T(n))&&("fixed"===C(n).position||I(n,e))}function $(t,e,n){const o=h(e),i=u(e),r="fixed"===n,l=A(t,!0,r,e);let f={scrollLeft:0,scrollTop:0};const a=c(0);function d(){a.x=B(i)}if(o||!o&&!r)if(("body"!==s(e)||g(i))&&(f=S(e)),o){const t=A(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&d();r&&!o&&i&&d();const p=!i||o||r?c(0):V(i,f);return{x:l.left+f.scrollLeft-a.x-p.x,y:l.top+f.scrollTop-a.y-p.y,width:l.width,height:l.height}}function k(t){return"static"===C(t).position}function q(t,e){if(!h(t)||"fixed"===C(t).position)return null;if(e)return e(t);let n=t.offsetParent;return u(t)===n&&(n=n.ownerDocument.body),n}function U(t,e){const n=f(t);if(y(t))return n;if(!h(t)){let e=E(t);for(;e&&!T(e);){if(d(e)&&!k(e))return e;e=E(e)}return n}let o=q(t,e);for(;o&&m(o)&&k(o);)o=q(o,e);return o&&T(o)&&k(o)&&!L(o)?n:o||function(t){let e=E(t);for(;h(e)&&!T(e);){if(L(e))return e;if(y(e))return null;e=E(e)}return null}(t)||n}const j={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,l=u(o),f=!!e&&y(e.floating);if(o===l||f&&r)return n;let a={scrollLeft:0,scrollTop:0},d=c(1);const p=c(0),m=h(o);if((m||!m&&!r)&&(("body"!==s(o)||g(l))&&(a=S(o)),m)){const t=A(o);d=H(o),p.x=t.x+o.clientLeft,p.y=t.y+o.clientTop}const w=!l||m||r?c(0):V(l,a);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+p.x+w.x,y:n.y*d.y-a.scrollTop*d.y+p.y+w.y}},getDocumentElement:u,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:c}=t;const l=[..."clippingAncestors"===i?y(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=O(t,[],!1).filter((t=>d(t)&&"body"!==s(t))),i=null;const r="fixed"===C(t).position;let c=r?E(t):t;for(;d(c)&&!T(c);){const e=C(c),n=L(c);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||g(c)&&!n&&I(t,c))?o=o.filter((t=>t!==c)):i=e,c=E(c)}return e.set(t,o),o}(e,this._c):[].concat(i),r],f=N(e,l[0],c);let u=f.top,a=f.right,h=f.bottom,p=f.left;for(let t=1;t<l.length;t++){const i=N(e,l[t],c);u=o(i.top,u),a=n(i.right,a),h=n(i.bottom,h),p=o(i.left,p)}return{width:a-p,height:h-u,x:p,y:u}},getOffsetParent:U,getElementRects:async function(t){const e=this.getOffsetParent||U,n=this.getDimensions,o=await n(t.floating);return{reference:$(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=W(t);return{width:e,height:n}},getScale:H,isElement:d,isRTL:function(t){return"rtl"===C(t).direction}};function X(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const Y=e.detectOverflow,_=e.offset,G=e.autoPlacement,J=e.shift,K=e.flip,Q=e.size,Z=e.hide,tt=e.arrow,et=e.inline,nt=e.limitShift;t.arrow=tt,t.autoPlacement=G,t.autoUpdate=function(t,e,i,c){void 0===c&&(c={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:f="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:d=!1}=c,h=M(t),p=l||s?[...h?O(h):[],...e?O(e):[]]:[];p.forEach((t=>{l&&t.addEventListener("scroll",i,{passive:!0}),s&&t.addEventListener("resize",i)}));const g=h&&a?function(t,e){let i,c=null;const l=u(t);function s(){var t;clearTimeout(i),null==(t=c)||t.disconnect(),c=null}return function f(u,a){void 0===u&&(u=!1),void 0===a&&(a=1),s();const d=t.getBoundingClientRect(),{left:h,top:p,width:g,height:m}=d;if(u||e(),!g||!m)return;const y={rootMargin:-r(p)+"px "+-r(l.clientWidth-(h+g))+"px "+-r(l.clientHeight-(p+m))+"px "+-r(h)+"px",threshold:o(0,n(1,a))||1};let w=!0;function x(e){const n=e[0].intersectionRatio;if(n!==a){if(!w)return f();n?f(!1,n):i=setTimeout((()=>{f(!1,1e-7)}),1e3)}1!==n||X(d,t.getBoundingClientRect())||f(),w=!1}try{c=new IntersectionObserver(x,{...y,root:l.ownerDocument})}catch(t){c=new IntersectionObserver(x,y)}c.observe(t)}(!0),s}(h,i):null;let m,y=-1,w=null;f&&(w=new ResizeObserver((t=>{let[n]=t;n&&n.target===h&&w&&e&&(w.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{var t;null==(t=w)||t.observe(e)}))),i()})),h&&!d&&w.observe(h),e&&w.observe(e));let x=d?A(t):null;return d&&function e(){const n=A(t);x&&!X(x,n)&&i();x=n,m=requestAnimationFrame(e)}(),i(),()=>{var t;p.forEach((t=>{l&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)})),null==g||g(),null==(t=w)||t.disconnect(),w=null,d&&cancelAnimationFrame(m)}},t.computePosition=(t,n,o)=>{const i=new Map,r={platform:j,...o},c={...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:c})},t.detectOverflow=Y,t.flip=K,t.getOverflowAncestors=O,t.hide=Z,t.inline=et,t.limitShift=nt,t.offset=_,t.platform=j,t.shift=J,t.size=Q})); | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,l=t=>({x:t,y:t});function c(){return"undefined"!=typeof window}function s(t){return a(t)?(t.nodeName||"").toLowerCase():"#document"}function f(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function u(t){var e;return null==(e=(a(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function a(t){return!!c()&&(t instanceof Node||t instanceof f(t).Node)}function d(t){return!!c()&&(t instanceof Element||t instanceof f(t).Element)}function h(t){return!!c()&&(t instanceof HTMLElement||t instanceof f(t).HTMLElement)}function p(t){return!(!c()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof f(t).ShadowRoot)}function g(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function m(t){return/^(table|td|th)$/.test(s(t))}function y(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const w=/transform|translate|scale|rotate|perspective|filter/,v=/paint|layout|strict|content/,x=t=>!!t&&"none"!==t;let b;function L(t){const e=d(t)?C(t):t;return x(e.transform)||x(e.translate)||x(e.scale)||x(e.rotate)||x(e.perspective)||!R()&&(x(e.backdropFilter)||x(e.filter))||w.test(e.willChange||"")||v.test(e.contain||"")}function R(){return null==b&&(b="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function T(t){return/^(html|body|#document)$/.test(s(t))}function C(t){return f(t).getComputedStyle(t)}function S(t){return d(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function E(t){if("html"===s(t))return t;const e=t.assignedSlot||t.parentNode||p(t)&&t.host||u(t);return p(e)?e.host:e}function F(t){const e=E(t);return T(e)?(t.ownerDocument||t).body:h(e)&&g(e)?e:F(e)}function O(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=F(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=f(i);if(r){const t=D(l);return e.concat(l,l.visualViewport||[],g(i)?i:[],t&&n?O(t):[])}return e.concat(i,O(i,[],n))}function D(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function W(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=h(t),l=r?t.offsetWidth:n,c=r?t.offsetHeight:o,s=i(n)!==l||i(o)!==c;return s&&(n=l,o=c),{width:n,height:o,$:s}}function M(t){return d(t)?t:t.contextElement}function z(t){const e=M(t);if(!h(e))return l(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:c}=W(e);let s=(c?i(n.width):n.width)/o,f=(c?i(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}const H=l(0);function P(t){const e=f(t);return R()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:H}function V(t,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),c=M(t);let s=l(1);n&&(i?d(i)&&(s=z(i)):s=z(t));const u=function(t,e,n){return void 0===e&&(e=!1),!!n&&e&&n===f(t)}(c,o,i)?P(c):l(0);let a=(r.left+u.x)/s.x,h=(r.top+u.y)/s.y,p=r.width/s.x,g=r.height/s.y;if(c&&i){const t=f(c),e=d(i)?f(i):i;let n=t,o=D(n);for(;o&&e!==n;){const t=z(o),e=o.getBoundingClientRect(),i=C(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,l=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;a*=t.x,h*=t.y,p*=t.x,g*=t.y,a+=r,h+=l,n=f(o),o=D(n)}}return e.rectToClientRect({width:p,height:g,x:a,y:h})}function A(t,e){const n=S(t).scrollLeft;return e?e.left+n:V(u(t)).left+n}function B(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-A(t,n),y:n.top+e.scrollTop}}function N(t,n,i){let r;if("viewport"===n||"layoutViewport"===n)r=function(t,e,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,i=f(t),r=u(t),l=i.visualViewport;let c=r.clientWidth,s=r.clientHeight,a=0,d=0;if(l){const t=!R()||"fixed"===e;o?t||(a=-l.offsetLeft,d=-l.offsetTop):(c=l.width,s=l.height,t&&(a=l.offsetLeft,d=l.offsetTop))}if(A(r)<=0){const t=r.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-e.clientWidth-o),l="stable both-edges"===getComputedStyle(r).scrollbarGutter?i/2:i;l<=25&&(c-=l)}return{width:c,height:s,x:a,y:d}}(t,i,n);else if("document"===n)r=function(t){const e=S(t),n=t.ownerDocument.body,i=o(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=o(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-e.scrollLeft+A(t);const c=-e.scrollTop;return"rtl"===C(n).direction&&(l+=o(t.clientWidth,n.clientWidth)-i),{width:i,height:r,x:l,y:c}}(u(t));else if(d(n))r=function(t,e){const n=V(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=z(t);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,i);else{const e=P(t);r={x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}return e.rectToClientRect(r)}function I(t,e,n){const o=h(e),i=u(e),r="fixed"===n,c=V(t,!0,r,e);let f={scrollLeft:0,scrollTop:0};const a=l(0);if((o||!r)&&(("body"!==s(e)||g(i))&&(f=S(e)),o)){const t=V(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}!o&&i&&(a.x=A(i));const d=!i||o||r?l(0):B(i,f);return{x:c.left+f.scrollLeft-a.x-d.x,y:c.top+f.scrollTop-a.y-d.y,width:c.width,height:c.height}}function $(t){return"static"===C(t).position}function k(t,e){if(!h(t)||"fixed"===C(t).position)return null;if(e)return e(t);let n=t.offsetParent;return u(t)===n&&(n=n.ownerDocument.body),n}function q(t,e){const n=f(t);if(y(t))return n;if(!h(t)){let e=E(t);for(;e&&!T(e);){if(d(e)&&!$(e))return e;e=E(e)}return n}let o=k(t,e);for(;o&&m(o)&&$(o);)o=k(o,e);return o&&T(o)&&$(o)&&!L(o)?n:o||function(t){let e=E(t);for(;h(e)&&!T(e);){if(L(e))return e;if(y(e))return null;e=E(e)}return null}(t)||n}const U={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,c=u(o),f=!!e&&y(e.floating);if(o===c||f&&r)return n;let a={scrollLeft:0,scrollTop:0},d=l(1);const p=l(0),m=h(o);if((m||!r)&&(("body"!==s(o)||g(c))&&(a=S(o)),m)){const t=V(o);d=z(o),p.x=t.x+o.clientLeft,p.y=t.y+o.clientTop}const w=!c||m||r?l(0):B(c,a);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+p.x+w.x,y:n.y*d.y-a.scrollTop*d.y+p.y+w.y}},getDocumentElement:u,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:l}=t;const c=[..."clippingAncestors"===i?y(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=O(t,[],!1).filter((t=>d(t)&&"body"!==s(t))),i=null;const r="fixed"===C(t).position;let l=r?E(t):t;for(;d(l)&&!T(l);){const t=C(l),e=L(l),n=i?i.position:r?"fixed":"";e||"fixed"!==n&&("absolute"!==n||"static"!==t.position)?i=t:o=o.filter((t=>t!==l)),l=E(l)}return e.set(t,o),o}(e,this._c):[].concat(i),r],f=N(e,c[0],l);let u=f.top,a=f.right,h=f.bottom,p=f.left;for(let t=1;t<c.length;t++){const i=N(e,c[t],l);u=o(i.top,u),a=n(i.right,a),h=n(i.bottom,h),p=o(i.left,p)}return{width:a-p,height:h-u,x:p,y:u}},getOffsetParent:q,getElementRects:async function(t){const e=this.getOffsetParent||q,n=this.getDimensions,o=await n(t.floating);return{reference:I(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:n}=W(t);return{width:e,height:n}},getScale:z,isElement:d,isRTL:function(t){return"rtl"===C(t).direction}};function j(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const X=e.detectOverflow,Y=e.offset,_=e.autoPlacement,G=e.shift,J=e.flip,K=e.size,Q=e.hide,Z=e.arrow,tt=e.inline,et=e.limitShift;t.arrow=Z,t.autoPlacement=_,t.autoUpdate=function(t,e,i,l){void 0===l&&(l={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:d="function"==typeof IntersectionObserver,animationFrame:h=!1}=l,p=M(t),g=c||s?[...p?O(p):[],...e?O(e):[]]:[];g.forEach((t=>{c&&t.addEventListener("scroll",i),s&&t.addEventListener("resize",i)}));const m=p&&d?function(t,e,i){let l,c=null;const s=u(t);function a(){var t;clearTimeout(l),null==(t=c)||t.disconnect(),c=null}function d(i,f){void 0===i&&(i=!1),void 0===f&&(f=1),a();const u=t.getBoundingClientRect(),{left:h,top:p,width:g,height:m}=u;if(i||e(),!g||!m)return;const y={rootMargin:-r(p)+"px "+-r(s.clientWidth-(h+g))+"px "+-r(s.clientHeight-(p+m))+"px "+-r(h)+"px",threshold:o(0,n(1,f))||1};let w=!0;function v(e){const n=e[0].intersectionRatio;if(!j(u,t.getBoundingClientRect()))return d();if(n!==f){if(!w)return d();n?d(!1,n):l=setTimeout((()=>{d(!1,1e-7)}),1e3)}w=!1}try{c=new IntersectionObserver(v,{...y,root:s.ownerDocument})}catch(t){c=new IntersectionObserver(v,y)}c.observe(t)}const h=f(t),p=()=>d(i);return h.addEventListener("resize",p),d(!0),()=>{h.removeEventListener("resize",p),a()}}(p,i,s):null;let y,w=-1,v=null;a&&(v=new ResizeObserver((t=>{let[n]=t;n&&n.target===p&&v&&e&&(v.unobserve(e),cancelAnimationFrame(w),w=requestAnimationFrame((()=>{var t;null==(t=v)||t.observe(e)}))),i()})),p&&!h&&v.observe(p),e&&v.observe(e));let x=h?V(t):null;return h&&function e(){const n=V(t);x&&!j(x,n)&&i();x=n,y=requestAnimationFrame(e)}(),i(),()=>{var t;g.forEach((t=>{c&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)})),null==m||m(),null==(t=v)||t.disconnect(),v=null,h&&cancelAnimationFrame(y)}},t.computePosition=(t,n,o)=>{const i=new Map,r=null!=o?o:{},l={...U,...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:l})},t.detectOverflow=X,t.flip=J,t.getOverflowAncestors=O,t.hide=Q,t.inline=tt,t.limitShift=et,t.offset=Y,t.platform=U,t.shift=G,t.size=K})); |
+5
-4
| { | ||
| "name": "@floating-ui/dom", | ||
| "version": "1.7.6", | ||
| "version": "1.8.0", | ||
| "description": "Floating UI for the web", | ||
@@ -46,4 +46,4 @@ "publishConfig": { | ||
| "dependencies": { | ||
| "@floating-ui/core": "^1.7.5", | ||
| "@floating-ui/utils": "^0.2.11" | ||
| "@floating-ui/core": "^1.8.0", | ||
| "@floating-ui/utils": "^0.2.12" | ||
| }, | ||
@@ -61,3 +61,3 @@ "devDependencies": { | ||
| "lint": "eslint .", | ||
| "format": "prettier --write .", | ||
| "format": "prettier --ignore-path ../../.gitignore --write .", | ||
| "clean": "rimraf dist out-tsc test-results", | ||
@@ -69,2 +69,3 @@ "dev": "vite", | ||
| "test:watch": "vitest watch", | ||
| "test:browser": "TEST_ENV=browser vitest --browser", | ||
| "publint": "publint", | ||
@@ -71,0 +72,0 @@ "playwright": "playwright test ./test/functional", |
174208
1.69%3721
0.62%Updated
Updated