6 lines
9.8 KiB
JavaScript
6 lines
9.8 KiB
JavaScript
|
|
/*
|
||
|
|
Copyright (C) Federico Zivolo 2018
|
||
|
|
Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
|
||
|
|
*/function a(a,b){if(1!==a.nodeType)return[];const c=getComputedStyle(a,null);return b?c[b]:c}function b(a){return'HTML'===a.nodeName?a:a.parentNode||a.host}function c(d){if(!d)return document.body;switch(d.nodeName){case'HTML':case'BODY':return d.ownerDocument.body;case'#document':return d.body;}const{overflow:e,overflowX:f,overflowY:g}=a(d);return /(auto|scroll|overlay)/.test(e+g+f)?d:c(b(d))}const d={};var e=function(a='all'){return(a=a.toString(),d.hasOwnProperty(a))?d[a]:('11'===a?d[a]=-1!==navigator.userAgent.indexOf('Trident'):'10'===a?d[a]=-1!==navigator.appVersion.indexOf('MSIE 10'):'all'===a?d[a]=-1!==navigator.userAgent.indexOf('Trident')||-1!==navigator.userAgent.indexOf('MSIE'):void 0,d.all=d.all||Object.keys(d).some((a)=>d[a]),d[a])};function f(b){if(!b)return document.documentElement;const c=e(10)?document.body:null;let d=b.offsetParent;for(;d===c&&b.nextElementSibling;)d=(b=b.nextElementSibling).offsetParent;const g=d&&d.nodeName;return g&&'BODY'!==g&&'HTML'!==g?-1!==['TD','TABLE'].indexOf(d.nodeName)&&'static'===a(d,'position')?f(d):d:b?b.ownerDocument.documentElement:document.documentElement}function g(a){const{nodeName:b}=a;return'BODY'!==b&&('HTML'===b||f(a.firstElementChild)===a)}function h(a){return null===a.parentNode?a:h(a.parentNode)}function i(a,b){if(!a||!a.nodeType||!b||!b.nodeType)return document.documentElement;const c=a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING,d=c?a:b,e=c?b:a,j=document.createRange();j.setStart(d,0),j.setEnd(e,0);const{commonAncestorContainer:k}=j;if(a!==k&&b!==k||d.contains(e))return g(k)?k:f(k);const l=h(a);return l.host?i(l.host,b):i(a,h(b).host)}function j(a,b='top'){const c='top'===b?'scrollTop':'scrollLeft',d=a.nodeName;if('BODY'===d||'HTML'===d){const b=a.ownerDocument.documentElement,d=a.ownerDocument.scrollingElement||b;return d[c]}return a[c]}function k(a,b,c=!1){const d=j(b,'top'),e=j(b,'left'),f=c?-1:1;return a.top+=d*f,a.bottom+=d*f,a.left+=e*f,a.right+=e*f,a}function l(a,b){const c='x'===b?'Left':'Top',d='Left'==c?'Right':'Bottom';return parseFloat(a[`border${c}Width`],10)+parseFloat(a[`border${d}Width`],10)}function m(a,b,c,d){return Math.max(b[`offset${a}`],b[`scroll${a}`],c[`client${a}`],c[`offset${a}`],c[`scroll${a}`],e(10)?c[`offset${a}`]+d[`margin${'Height'===a?'Top':'Left'}`]+d[`margin${'Height'===a?'Bottom':'Right'}`]:0)}function n(){const a=document.body,b=document.documentElement,c=e(10)&&getComputedStyle(b);return{height:m('Height',a,b,c),width:m('Width',a,b,c)}}var o=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a};function p(a){return o({},a,{right:a.left+a.width,bottom:a.top+a.height})}function q(b){let c={};try{if(e(10)){c=b.getBoundingClientRect();const a=j(b,'top'),d=j(b,'left');c.top+=a,c.left+=d,c.bottom+=a,c.right+=d}else c=b.getBoundingClientRect()}catch(a){}const d={left:c.left,top:c.top,width:c.right-c.left,height:c.bottom-c.top},f='HTML'===b.nodeName?n():{},g=f.width||b.clientWidth||d.right-d.left,h=f.height||b.clientHeight||d.bottom-d.top;let i=b.offsetWidth-g,k=b.offsetHeight-h;if(i||k){const c=a(b);i-=l(c,'x'),k-=l(c,'y'),d.width-=i,d.height-=k}return p(d)}function r(b,d,f=!1){var g=Math.max;const h=e(10),i='HTML'===d.nodeName,j=q(b),l=q(d),m=c(b),n=a(d),o=parseFloat(n.borderTopWidth,10),r=parseFloat(n.borderLeftWidth,10);f&&'HTML'===d.nodeName&&(l.top=g(l.top,0),l.left=g(l.left,0));let s=p({top:j.top-l.top-o,left:j.left-l.left-r,width:j.width,height:j.height});if(s.marginTop=0,s.marginLeft=0,!h&&i){const a=parseFloat(n.marginTop,10),b=parseFloat(n.marginLeft,10);s.top-=o-a,s.bottom-=o-a,s.left-=r-b,s.right-=r-b,s.marginTop=a,s.marginLeft=b}return(h&&!f?d.contains(m):d===m&&'BODY'!==m.nodeName)&&(s=k(s,d)),s}function s(a,b=!1){var c=Math.max;const d=a.ownerDocument.documentElement,e=r(a,d),f=c(d.clientWidth,window.innerWidth||0),g=c(d.clientHeight,window.innerHeight||0),h=b?0:j(d),i=b?0:j(d,'left'),k={top:h-e.top+e.marginTop,left:i-e.left+e.marginLeft,width:f,height:g};return p(k)}function t(c){const d=c.
|
||
|
|
//# sourceMappingURL=popper-utils.min.js.map
|