FrontPastel/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min...

2 lines
8.8 KiB
JavaScript
Raw Normal View History

2024-04-17 13:55:11 +00:00
import{rectToClientRect as t,autoPlacement as e,shift as n,flip as o,size as i,hide as r,arrow as c,inline as l,limitShift as s,computePosition as f}from"@floating-ui/core";export{detectOverflow,offset}from"@floating-ui/core";const u=Math.min,a=Math.max,d=Math.round,h=Math.floor,p=t=>({x:t,y:t});function m(t){return w(t)?(t.nodeName||"").toLowerCase():"#document"}function g(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function y(t){var e;return null==(e=(w(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function w(t){return t instanceof Node||t instanceof g(t).Node}function x(t){return t instanceof Element||t instanceof g(t).Element}function v(t){return t instanceof HTMLElement||t instanceof g(t).HTMLElement}function b(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof g(t).ShadowRoot)}function L(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function T(t){return["table","td","th"].includes(m(t))}function R(t){const e=E(),n=C(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function E(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function S(t){return["html","body","#document"].includes(m(t))}function C(t){return g(t).getComputedStyle(t)}function F(t){return x(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function O(t){if("html"===m(t))return t;const e=t.assignedSlot||t.parentNode||b(t)&&t.host||y(t);return b(e)?e.host:e}function D(t){const e=O(t);return S(e)?t.ownerDocument?t.ownerDocument.body:t.body:v(e)&&L(e)?e:D(e)}function H(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=D(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=g(i);return r?e.concat(c,c.visualViewport||[],L(i)?i:[],c.frameElement&&n?H(c.frameElement):[]):e.concat(i,H(i,[],n))}function W(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=v(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,l=d(n)!==r||d(o)!==c;return l&&(n=r,o=c),{width:n,height:o,$:l}}function M(t){return x(t)?t:t.contextElement}function z(t){const e=M(t);if(!v(e))return p(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=W(e);let c=(r?d(n.width):n.width)/o,l=(r?d(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const P=p(0);function V(t){const e=g(t);return E()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:P}function A(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),c=M(e);let l=p(1);n&&(i?x(i)&&(l=z(i)):l=z(e));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==g(t))&&e}(c,o,i)?V(c):p(0);let f=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,a=r.width/l.x,d=r.height/l.y;if(c){const t=g(c),e=i&&x(i)?g(i):i;let n=t,o=n.frameElement;for(;o&&i&&e!==n;){const t=z(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;f*=t.x,u*=t.y,a*=t.x,d*=t.y,f+=r,u+=c,n=g(o),o=n.frameElement}}return t({width:a,height:d,x:f,y:u})}const N=[":popover-open",":modal"];function B(t){return N.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function k(t){return A(y(t)).left+F(t).scrollLeft}function I(e,n,o){let i;if("viewport"===n)i=function(t,e){const n=g(t),o=y(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=E();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,s=i.offsetTop)}return{width:r,height:c,x:l,y:s}}(e,o);else if("document"===n)i=function(t){const e=y(t),n=F(t),o=t.ownerDocument.body,i=a(e.scrollWidth,e.clientWidth,o.scrollWi