function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function microtaskDebounce(a){var b=!1;return function(){b||(b=!0,window.Promise.resolve().then(function(){b=!1,a()}))}}function taskDebounce(a){var b=!1;return function(){b||(b=!0,setTimeout(function(){b=!1,a()},timeoutDuration))}}function isFunction(a){var b={};return a&&"[object Function]"===b.toString.call(a)}function getStyleComputedProperty(a,b){if(1!==a.nodeType)return[];var c=getComputedStyle(a,null);return b?c[b]:c}function getParentNode(a){return"HTML"===a.nodeName?a:a.parentNode||a.host}function getScrollParent(a){if(!a)return document.body;switch(a.nodeName){case"HTML":case"BODY":return a.ownerDocument.body;case"#document":return a.body}var b=getStyleComputedProperty(a),c=b.overflow,d=b.overflowX;return/(auto|scroll|overlay)/.test(c+b.overflowY+d)?a:getScrollParent(getParentNode(a))}function isIE(a){return 11===a?isIE11:10===a?isIE10:isIE11||isIE10}function getOffsetParent(a){if(!a)return document.documentElement;for(var b=isIE(10)?document.body:null,c=a.offsetParent;c===b&&a.nextElementSibling;)c=(a=a.nextElementSibling).offsetParent;var d=c&&c.nodeName;return d&&"BODY"!==d&&"HTML"!==d?-1!==["TD","TABLE"].indexOf(c.nodeName)&&"static"===getStyleComputedProperty(c,"position")?getOffsetParent(c):c:a?a.ownerDocument.documentElement:document.documentElement}function isOffsetContainer(a){var b=a.nodeName;return"BODY"!==b&&("HTML"===b||getOffsetParent(a.firstElementChild)===a)}function getRoot(a){return null!==a.parentNode?getRoot(a.parentNode):a}function findCommonOffsetParent(a,b){if(!(a&&a.nodeType&&b&&b.nodeType))return document.documentElement;var c=a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING,d=c?a:b,e=c?b:a,f=document.createRange();f.setStart(d,0),f.setEnd(e,0);var g=f.commonAncestorContainer;if(a!==g&&b!==g||d.contains(e))return isOffsetContainer(g)?g:getOffsetParent(g);var h=getRoot(a);return h.host?findCommonOffsetParent(h.host,b):findCommonOffsetParent(a,getRoot(b).host)}function getScroll(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",c="top"===b?"scrollTop":"scrollLeft",d=a.nodeName;if("BODY"===d||"HTML"===d){var e=a.ownerDocument.documentElement;return(a.ownerDocument.scrollingElement||e)[c]}return a[c]}function includeScroll(a,b){var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=getScroll(b,"top"),e=getScroll(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 getBordersSize(a,b){var c="x"===b?"Left":"Top",d="Left"===c?"Right":"Bottom";return parseFloat(a["border"+c+"Width"],10)+parseFloat(a["border"+d+"Width"],10)}function getSize(a,b,c,d){return Math.max(b["offset"+a],b["scroll"+a],c["client"+a],c["offset"+a],c["scroll"+a],isIE(10)?c["offset"+a]+d["margin"+("Height"===a?"Top":"Left")]+d["margin"+("Height"===a?"Bottom":"Right")]:0)}function getWindowSizes(){var a=document.body,b=document.documentElement,c=isIE(10)&&getComputedStyle(b);return{height:getSize("Height",a,b,c),width:getSize("Width",a,b,c)}}function getClientRect(a){return _extends({},a,{right:a.left+a.width,bottom:a.top+a.height})}function getBoundingClientRect(a){var b={};try{if(isIE(10)){b=a.getBoundingClientRect();var c=getScroll(a,"top"),d=getScroll(a,"left");b.top+=c,b.left+=d,b.bottom+=c,b.right+=d}else b=a.getBoundingClientRect()}catch(a){}var e={left:b.left,top:b.top,width:b.right-b.left,height:b.bottom-b.top},f="HTML"===a.nodeName?getWindowSizes():{},g=f.width||a.clientWidth||e.right-e.left,h=f.height||a.clientHeight||e.bottom-e.top,i=a.offsetWidth-g,j=a.offsetHeight-h;if(i||j){var k=getStyleComputedProperty(a);i-=getBordersSize(k,"x"),j-=getBordersSize(k,"y"),e.width-=i,e.height-=j}return getClientRect(e)}function getOffsetRectRelativeToArbitraryNode(a,b){var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=isIE(10),e="HTML"===b.nodeName,f=getBoundingClientRect(a),g=getBoundingClientRect(b),h=getScrollParent(a),i=getStyleComputedProperty(b),j=parseFloat(i.borderTopWidth,10),k=parseFloat(i.borderLeftWidth,10);c&&"HTML"===b.nodeName&&(g.top=Math.max(g.top,0),g.left=Math.max(g.left,0));var l=getClientRect({top:f.top-g.top-j,left:f.left-g.left-k,width:f.width,height:f.height});if(l.marginTop=0,l.marginLeft=0,!d&&e){var m=parseFloat(i.marginTop,10),n=parseFloat(i.marginLeft,10);l.top-=j-m,l.bottom-=j-m,l.left-=k-n,l.right-=k-n,l.marginTop=m,l.marginLeft=n}return(d&&!c?b.contains(h):b===h&&"BODY"!==h.nodeName)&&(l=includeScroll(l,b)),l}function getViewportOffsetRectRelativeToArtbitraryNode(a){var b=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=a.ownerDocument.documentElement,d=getOffsetRectRelativeToArbitraryNode(a,c),e=Math.max(c.clientWidth,window.innerWidth||0),f=Math.max(c.clientHeight,window.innerHeight||0),g=b?0:getScroll(c),h=b?0:getScroll(c,"left");return getClientRect({top:g-d.top+d.marginTop,left:h-d.left+d.marginLeft,width:e,height:f})}function isFixed(a){var b=a.nodeName;return"BODY"!==b&&"HTML"!==b&&("fixed"===getStyleComputedProperty(a,"position")||isFixed(getParentNode(a)))}function getFixedPositionOffsetParent(a){if(!a||!a.parentElement||isIE())return document.documentElement;for(var b=a.parentElement;b&&"none"===getStyleComputedProperty(b,"transform");)b=b.parentElement;return b||document.documentElement}function getBoundaries(a,b,c,d){var e=arguments.length>4&&void 0!==arguments[4]&&arguments[4],f={top:0,left:0},g=e?getFixedPositionOffsetParent(a):findCommonOffsetParent(a,b);if("viewport"===d)f=getViewportOffsetRectRelativeToArtbitraryNode(g,e);else{var h=void 0;"scrollParent"===d?(h=getScrollParent(getParentNode(b)),"BODY"===h.nodeName&&(h=a.ownerDocument.documentElement)):h="window"===d?a.ownerDocument.documentElement:d;var i=getOffsetRectRelativeToArbitraryNode(h,g,e);if("HTML"!==h.nodeName||isFixed(g))f=i;else{var j=getWindowSizes(),k=j.height,l=j.width;f.top+=i.top-i.marginTop,f.bottom=k+i.top,f.left+=i.left-i.marginLeft,f.right=l+i.left}}return f.left+=c,f.top+=c,f.right-=c,f.bottom-=c,f}function getArea(a){return a.width*a.height}function computeAutoPlacement(a,b,c,d,e){var f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===a.indexOf("auto"))return a;var g=getBoundaries(c,d,f,e),h={top:{width:g.width,height:b.top-g.top},right:{width:g.right-b.right,height:g.height},bottom:{width:g.width,height:g.bottom-b.bottom},left:{width:b.left-g.left,height:g.height}},i=Object.keys(h).map(function(a){return _extends({key:a},h[a],{area:getArea(h[a])})}).sort(function(a,b){return b.area-a.area}),j=i.filter(function(a){var b=a.width,d=a.height;return b>=c.clientWidth&&d>=c.clientHeight}),k=j.length>0?j[0].key:i[0].key,l=a.split("-")[1];return k+(l?"-"+l:"")}function getReferenceOffsets(a,b,c){var d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return getOffsetRectRelativeToArbitraryNode(c,d?getFixedPositionOffsetParent(b):findCommonOffsetParent(b,c),d)}function getOuterSizes(a){var b=getComputedStyle(a),c=parseFloat(b.marginTop)+parseFloat(b.marginBottom),d=parseFloat(b.marginLeft)+parseFloat(b.marginRight);return{width:a.offsetWidth+d,height:a.offsetHeight+c}}function getOppositePlacement(a){var b={left:"right",right:"left",bottom:"top",top:"bottom"};return a.replace(/left|right|bottom|top/g,function(a){return b[a]})}function getPopperOffsets(a,b,c){c=c.split("-")[0];var d=getOuterSizes(a),e={width:d.width,height:d.height},f=-1!==["right","left"].indexOf(c),g=f?"top":"left",h=f?"left":"top",i=f?"height":"width",j=f?"width":"height";return e[g]=b[g]+b[i]/2-d[i]/2,e[h]=c===h?b[h]-d[j]:b[getOppositePlacement(h)],e}function find(a,b){return Array.prototype.find?a.find(b):a.filter(b)[0]}function findIndex(a,b,c){if(Array.prototype.findIndex)return a.findIndex(function(a){return a[b]===c});var d=find(a,function(a){return a[b]===c});return a.indexOf(d)}function runModifiers(a,b,c){return(void 0===c?a:a.slice(0,findIndex(a,"name",c))).forEach(function(a){a.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var c=a.function||a.fn;a.enabled&&isFunction(c)&&(b.offsets.popper=getClientRect(b.offsets.popper),b.offsets.reference=getClientRect(b.offsets.reference),b=c(b,a))}),b}function _update(){if(!this.state.isDestroyed){var a={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};a.offsets.reference=getReferenceOffsets(this.state,this.popper,this.reference,this.options.positionFixed),a.placement=computeAutoPlacement(this.options.placement,a.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),a.originalPlacement=a.placement,a.positionFixed=this.options.positionFixed,a.offsets.popper=getPopperOffsets(this.popper,a.offsets.reference,a.placement),a.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",a=runModifiers(this.modifiers,a),this.state.isCreated?this.options.onUpdate(a):(this.state.isCreated=!0,this.options.onCreate(a))}}function isModifierEnabled(a,b){return a.some(function(a){var c=a.name;return a.enabled&&c===b})}function getSupportedPropertyName(a){for(var b=[!1,"ms","Webkit","Moz","O"],c=a.charAt(0).toUpperCase()+a.slice(1),d=0;dg[n]&&(a.offsets.popper[l]+=h[l]+o-g[n]),a.offsets.popper=getClientRect(a.offsets.popper);var p=h[l]+h[j]/2-o/2,q=getStyleComputedProperty(a.instance.popper),r=parseFloat(q["margin"+k],10),s=parseFloat(q["border"+k+"Width"],10),t=p-a.offsets.popper[l]-r-s;return t=Math.max(Math.min(g[j]-o,t),0),a.arrowElement=d,a.offsets.arrow=(c={},c[l]=Math.round(t),c[m]="",c),a}function getOppositeVariation(a){return"end"===a?"start":"start"===a?"end":a}function clockwise(a){var b=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=validPlacements.indexOf(a),d=validPlacements.slice(c+1).concat(validPlacements.slice(0,c));return b?d.reverse():d}function flip(a,b){if(isModifierEnabled(a.instance.modifiers,"inner"))return a;if(a.flipped&&a.placement===a.originalPlacement)return a;var c=getBoundaries(a.instance.popper,a.instance.reference,b.padding,b.boundariesElement,a.positionFixed),d=a.placement.split("-")[0],e=getOppositePlacement(d),f=a.placement.split("-")[1]||"",g=[];switch(b.behavior){case BEHAVIORS.FLIP:g=[d,e];break;case BEHAVIORS.CLOCKWISE:g=clockwise(d);break;case BEHAVIORS.COUNTERCLOCKWISE:g=clockwise(d,!0);break;default:g=b.behavior}return g.forEach(function(h,i){if(d!==h||g.length===i+1)return a;d=a.placement.split("-")[0],e=getOppositePlacement(d);var j=a.offsets.popper,k=a.offsets.reference,l=Math.floor,m="left"===d&&l(j.right)>l(k.left)||"right"===d&&l(j.left)l(k.top)||"bottom"===d&&l(j.top)l(c.right),p=l(j.top)l(c.bottom),r="left"===d&&n||"right"===d&&o||"top"===d&&p||"bottom"===d&&q,s=-1!==["top","bottom"].indexOf(d),t=!!b.flipVariations&&(s&&"start"===f&&n||s&&"end"===f&&o||!s&&"start"===f&&p||!s&&"end"===f&&q);(m||r||t)&&(a.flipped=!0,(m||r)&&(d=g[i+1]),t&&(f=getOppositeVariation(f)),a.placement=d+(f?"-"+f:""),a.offsets.popper=_extends({},a.offsets.popper,getPopperOffsets(a.instance.popper,a.offsets.reference,a.placement)),a=runModifiers(a.instance.modifiers,a,"flip"))}),a}function keepTogether(a){var b=a.offsets,c=b.popper,d=b.reference,e=a.placement.split("-")[0],f=Math.floor,g=-1!==["top","bottom"].indexOf(e),h=g?"right":"bottom",i=g?"left":"top",j=g?"width":"height";return c[h]f(d[h])&&(a.offsets.popper[i]=f(d[h])),a}function toValue(a,b,c,d){var e=a.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),f=+e[1],g=e[2];if(!f)return a;if(0===g.indexOf("%")){var h=void 0;switch(g){case"%p":h=c;break;case"%":case"%r":default:h=d}return getClientRect(h)[b]/100*f}if("vh"===g||"vw"===g){return("vh"===g?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*f}return f}function parseOffset(a,b,c,d){var e=[0,0],f=-1!==["right","left"].indexOf(d),g=a.split(/(\+|\-)/).map(function(a){return a.trim()}),h=g.indexOf(find(g,function(a){return-1!==a.search(/,|\s/)}));g[h]&&-1===g[h].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var i=/\s*,\s*|\s+/,j=-1!==h?[g.slice(0,h).concat([g[h].split(i)[0]]),[g[h].split(i)[1]].concat(g.slice(h+1))]:[g];return j=j.map(function(a,d){var e=(1===d?!f:f)?"height":"width",g=!1;return a.reduce(function(a,b){return""===a[a.length-1]&&-1!==["+","-"].indexOf(b)?(a[a.length-1]=b,g=!0,a):g?(a[a.length-1]+=b,g=!1,a):a.concat(b)},[]).map(function(a){return toValue(a,e,b,c)})}),j.forEach(function(a,b){a.forEach(function(c,d){isNumeric(c)&&(e[b]+=c*("-"===a[d-1]?-1:1))})}),e}function offset(a,b){var c=b.offset,d=a.placement,e=a.offsets,f=e.popper,g=e.reference,h=d.split("-")[0],i=void 0;return i=isNumeric(+c)?[+c,0]:parseOffset(c,f,g,h),"left"===h?(f.top+=i[0],f.left-=i[1]):"right"===h?(f.top+=i[0],f.left+=i[1]):"top"===h?(f.left+=i[0],f.top-=i[1]):"bottom"===h&&(f.left+=i[0],f.top+=i[1]),a.popper=f,a}function preventOverflow(a,b){var c=b.boundariesElement||getOffsetParent(a.instance.popper);a.instance.reference===c&&(c=getOffsetParent(c));var d=getSupportedPropertyName("transform"),e=a.instance.popper.style,f=e.top,g=e.left,h=e[d];e.top="",e.left="",e[d]="";var i=getBoundaries(a.instance.popper,a.instance.reference,b.padding,c,a.positionFixed);e.top=f,e.left=g,e[d]=h,b.boundaries=i;var j=b.priority,k=a.offsets.popper,l={primary:function(a){var c,d=k[a];return k[a]i[a]&&!b.escapeWithReference&&(e=Math.min(k[d],i[a]-("right"===a?k.width:k.height))),c={},c[d]=e,c}};return j.forEach(function(a){var b=-1!==["left","top"].indexOf(a)?"primary":"secondary";k=_extends({},k,l[b](a))}),a.offsets.popper=k,a}function shift(a){var b=a.placement,c=b.split("-")[0],d=b.split("-")[1];if(d){var e,f,g=a.offsets,h=g.reference,i=g.popper,j=-1!==["bottom","top"].indexOf(c),k=j?"left":"top",l=j?"width":"height",m={start:(e={},e[k]=h[k],e),end:(f={},f[k]=h[k]+h[l]-i[l],f)};a.offsets.popper=_extends({},i,m[d])}return a}function hide(a){if(!isModifierRequired(a.instance.modifiers,"hide","preventOverflow"))return a;var b=a.offsets.reference,c=find(a.instance.modifiers,function(a){return"preventOverflow"===a.name}).boundaries;if(b.bottomc.right||b.top>c.bottom||b.right=0){timeoutDuration=1;break}var supportsMicroTasks=isBrowser&&window.Promise,debounce=supportsMicroTasks?microtaskDebounce:taskDebounce,isIE11=isBrowser&&!(!window.MSInputMethodContext||!document.documentMode),isIE10=isBrowser&&/MSIE 10/.test(navigator.userAgent),_extends=Object.assign||function(a){for(var b=1;b2&&void 0!==arguments[2]?arguments[2]:{};_classCallCheck(this,a),this.scheduleUpdate=function(){return requestAnimationFrame(d.update)},this.update=debounce(this.update.bind(this)),this.options=_extends({},a.Defaults,e),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=b&&b.jquery?b[0]:b,this.popper=c&&c.jquery?c[0]:c,this.options.modifiers={},Object.keys(_extends({},a.Defaults.modifiers,e.modifiers)).forEach(function(b){d.options.modifiers[b]=_extends({},a.Defaults.modifiers[b]||{},e.modifiers?e.modifiers[b]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return _extends({name:a},d.options.modifiers[a])}).sort(function(a,b){return a.order-b.order}),this.modifiers.forEach(function(a){a.enabled&&isFunction(a.onLoad)&&a.onLoad(d.reference,d.popper,d.options,a,d.state)}),this.update();var f=this.options.eventsEnabled;f&&this.enableEventListeners(),this.state.eventsEnabled=f}return a.prototype.update=function(){return _update.call(this)},a.prototype.destroy=function(){return _destroy.call(this)},a.prototype.enableEventListeners=function(){return _enableEventListeners.call(this)},a.prototype.disableEventListeners=function(){return _disableEventListeners.call(this)},a}();Popper.Utils=("undefined"!=typeof window?window:global).PopperUtils,Popper.placements=placements,Popper.Defaults=Defaults;