Welcome to mirror list, hosted at ThFree Co, Russian Federation.

popper-base.min.js « umd « dist « package « popperjs - github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1d1229e96c0ee337305147106e675f647c98b0eb (plain)
1
2
3
4
5
6
/**
 * @popperjs/core v2.11.0 - MIT License
 */

"use strict";!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Popper={})}(this,(function(t){function e(t){return null==t?window:"[object Window]"!==t.toString()?(t=t.ownerDocument)&&t.defaultView||window:t}function o(t){return t instanceof e(t).Element||t instanceof Element}function n(t){return t instanceof e(t).HTMLElement||t instanceof HTMLElement}function i(t){return"undefined"!=typeof ShadowRoot&&(t instanceof e(t).ShadowRoot||t instanceof ShadowRoot)}function r(t,e){void 0===e&&(e=!1);var o=t.getBoundingClientRect(),i=1,r=1;return n(t)&&e&&(e=t.offsetHeight,0<(t=t.offsetWidth)&&(i=j(o.width)/t||1),0<e&&(r=j(o.height)/e||1)),{width:o.width/i,height:o.height/r,top:o.top/r,right:o.right/i,bottom:o.bottom/r,left:o.left/i,x:o.left/i,y:o.top/r}}function f(t){return{scrollLeft:(t=e(t)).pageXOffset,scrollTop:t.pageYOffset}}function a(t){return t?(t.nodeName||"").toLowerCase():null}function c(t){return((o(t)?t.ownerDocument:t.document)||window.document).documentElement}function s(t){return r(c(t)).left+f(t).scrollLeft}function l(t){return e(t).getComputedStyle(t)}function d(t){return t=l(t),/auto|scroll|overlay|hidden/.test(t.overflow+t.overflowY+t.overflowX)}function u(t,o,i){void 0===i&&(i=!1);var l,u=n(o);if(l=n(o)){var p=o.getBoundingClientRect();l=j(p.width)/o.offsetWidth||1,p=j(p.height)/o.offsetHeight||1,l=1!==l||1!==p}p=l,l=c(o),t=r(t,p),p={scrollLeft:0,scrollTop:0};var h={x:0,y:0};return(u||!u&&!i)&&(("body"!==a(o)||d(l))&&(p=o!==e(o)&&n(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:f(o)),n(o)?((h=r(o,!0)).x+=o.clientLeft,h.y+=o.clientTop):l&&(h.x=s(l))),{x:t.left+p.scrollLeft-h.x,y:t.top+p.scrollTop-h.y,width:t.width,height:t.height}}function p(t){var e=r(t),o=t.offsetWidth,n=t.offsetHeight;return 1>=Math.abs(e.width-o)&&(o=e.width),1>=Math.abs(e.height-n)&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:o,height:n}}function h(t){return"html"===a(t)?t:t.assignedSlot||t.parentNode||(i(t)?t.host:null)||c(t)}function m(t){return 0<=["html","body","#document"].indexOf(a(t))?t.ownerDocument.body:n(t)&&d(t)?t:m(h(t))}function g(t,o){var n;void 0===o&&(o=[]);var i=m(t);return t=i===(null==(n=t.ownerDocument)?void 0:n.body),n=e(i),i=t?[n].concat(n.visualViewport||[],d(i)?i:[]):i,o=o.concat(i),t?o:o.concat(g(h(i)))}function v(t){return n(t)&&"fixed"!==l(t).position?t.offsetParent:null}function b(t){for(var o=e(t),i=v(t);i&&0<=["table","td","th"].indexOf(a(i))&&"static"===l(i).position;)i=v(i);if(i&&("html"===a(i)||"body"===a(i)&&"static"===l(i).position))return o;if(!i)t:{if(i=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!n(t)||"fixed"!==l(t).position)for(t=h(t);n(t)&&0>["html","body"].indexOf(a(t));){var r=l(t);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||i&&"filter"===r.willChange||i&&r.filter&&"none"!==r.filter){i=t;break t}t=t.parentNode}i=null}return i||o}function w(t){function e(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){n.has(t)||(t=o.get(t))&&e(t)})),i.push(t)}var o=new Map,n=new Set,i=[];return t.forEach((function(t){o.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||e(t)})),i}function y(t){var e;return function(){return e||(e=new Promise((function(o){Promise.resolve().then((function(){e=void 0,o(t())}))}))),e}}function x(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function O(t,n){if("viewport"===n){n=e(t);var i=c(t);n=n.visualViewport;var a=i.clientWidth;i=i.clientHeight;var d=0,u=0;n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(d=n.offsetLeft,u=n.offsetTop)),t=x(t={width:a,height:i,x:d+s(t),y:u})}else o(n)?((t=r(n)).top+=n.clientTop,t.left+=n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top):(u=c(t),t=c(u),a=f(u),n=null==(i=u.ownerDocument)?void 0:i.body,i=T(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),d=T(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),u=-a.scrollLeft+s(u),a=-a.scrollTop,"rtl"===l(n||t).direction&&(u+=T(t.clientWidth,n?n.clientWidth:0)-i),t=x({width:i,height:d,x:u,y:a}));return t}function M(t,e,r){return e="clippingParents"===e?function(t){var e=g(h(t)),r=0<=["absolute","fixed"].indexOf(l(t).position),f=r&&n(t)?b(t):t;return o(f)?e.filter((function(t){var e;if(e=o(t))t:if(e=f.getRootNode&&f.getRootNode(),t.contains(f))e=!0;else{if(e&&i(e)){e=f;do{if(e&&t.isSameNode(e)){e=!0;break t}e=e.parentNode||e.host}while(e)}e=!1}return e&&"body"!==a(t)&&(!r||"static"!==l(t).position)})):[]}(t):[].concat(e),(r=(r=[].concat(e,[r])).reduce((function(e,o){return o=O(t,o),e.top=T(o.top,e.top),e.right=W(o.right,e.right),e.bottom=W(o.bottom,e.bottom),e.left=T(o.left,e.left),e}),O(t,r[0]))).width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function E(){for(var t=arguments.length,e=Array(t),o=0;o<t;o++)e[o]=arguments[o];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function L(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,i=void 0===(t=t.defaultOptions)?R:t;return function(t,e,r){function f(){c.forEach((function(t){return t()})),c=[]}void 0===r&&(r=i);var a={placement:"bottom",orderedModifiers:[],options:Object.assign({},R,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],s=!1,l={state:a,setOptions:function(r){return r="function"==typeof r?r(a.options):r,f(),a.options=Object.assign({},i,a.options,r),a.scrollParents={reference:o(t)?g(t):t.contextElement?g(t.contextElement):[],popper:g(e)},r=function(t){var e=w(t);return P.reduce((function(t,o){return t.concat(e.filter((function(t){return t.phase===o})))}),[])}(function(t){var e=t.reduce((function(t,e){var o=t[e.name];return t[e.name]=o?Object.assign({},o,e,{options:Object.assign({},o.options,e.options),data:Object.assign({},o.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}([].concat(n,a.options.modifiers))),a.orderedModifiers=r.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,o=t.options;o=void 0===o?{}:o,"function"==typeof(t=t.effect)&&(e=t({state:a,name:e,instance:l,options:o}),c.push(e||function(){}))})),l.update()},forceUpdate:function(){if(!s){var t=a.elements,e=t.reference;if(E(e,t=t.popper))for(a.rects={reference:u(e,b(t),"fixed"===a.options.strategy),popper:p(t)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)})),e=0;e<a.orderedModifiers.length;e++)if(!0===a.reset)a.reset=!1,e=-1;else{var o=a.orderedModifiers[e];t=o.fn;var n=o.options;n=void 0===n?{}:n,o=o.name,"function"==typeof t&&(a=t({state:a,options:n,name:o,instance:l})||a)}}},update:y((function(){return new Promise((function(t){l.forceUpdate(),t(a)}))})),destroy:function(){f(),s=!0}};return E(t,e)?(l.setOptions(r).then((function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)})),l):l}}var T=Math.max,W=Math.min,j=Math.round,H=["top","bottom","right","left"],P="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),R={placement:"bottom",modifiers:[],strategy:"absolute"},k=L();t.createPopper=k,t.detectOverflow=function(t,e){void 0===e&&(e={});var n=e;e=void 0===(e=n.placement)?t.placement:e;var i=n.boundary,f=void 0===i?"clippingParents":i,a=void 0===(i=n.rootBoundary)?"viewport":i;i=void 0===(i=n.elementContext)?"popper":i;var s=n.altBoundary,l=void 0!==s&&s;n=void 0===(n=n.padding)?0:n,n=Object.assign({},{top:0,right:0,bottom:0,left:0},"number"!=typeof n?n:function(t,e){return e.reduce((function(e,o){return e[o]=t,e}),{})}(n,H)),s=t.rects.popper,f=M(o(l=t.elements[l?"popper"===i?"reference":"popper":i])?l:l.contextElement||c(t.elements.popper),f,a),l=function(t){var e=t.reference,o=t.element,n=(t=t.placement)?t.split("-")[0]:null;t=t?t.split("-")[1]:null;var i=e.x+e.width/2-o.width/2,r=e.y+e.height/2-o.height/2;switch(n){case"top":i={x:i,y:e.y-o.height};break;case"bottom":i={x:i,y:e.y+e.height};break;case"right":i={x:e.x+e.width,y:r};break;case"left":i={x:e.x-o.width,y:r};break;default:i={x:e.x,y:e.y}}if(null!=(n=n?0<=["top","bottom"].indexOf(n)?"x":"y":null))switch(r="y"===n?"height":"width",t){case"start":i[n]-=e[r]/2-o[r]/2;break;case"end":i[n]+=e[r]/2-o[r]/2}return i}({reference:a=r(t.elements.reference),element:s,strategy:"absolute",placement:e}),s=x(Object.assign({},s,l)),a="popper"===i?s:a;var d={top:f.top-a.top+n.top,bottom:a.bottom-f.bottom+n.bottom,left:f.left-a.left+n.left,right:a.right-f.right+n.right};if(t=t.modifiersData.offset,"popper"===i&&t){var u=t[e];Object.keys(d).forEach((function(t){var e=0<=["right","bottom"].indexOf(t)?1:-1,o=0<=["top","bottom"].indexOf(t)?"y":"x";d[t]+=u[o]*e}))}return d},t.popperGenerator=L,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=popper-base.min.js.map