(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.tippy=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var a=getComputedStyle(e,null);return t?a[t]:a}function a(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function r(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var p=t(e),o=p.overflow,i=p.overflowX,n=p.overflowY;return /(auto|scroll|overlay)/.test(o+n+i)?e:r(a(e))}function p(e){return 11===e?fe:10===e?he:fe||he}function o(e){if(!e)return document.documentElement;for(var a=p(10)?document.body:null,r=e.offsetParent;r===a&&e.nextElementSibling;)r=(e=e.nextElementSibling).offsetParent;var i=r&&r.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(r.nodeName)&&'static'===t(r,'position')?o(r):r:e?e.ownerDocument.documentElement:document.documentElement}function n(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||o(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function l(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var a=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=a?e:t,p=a?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(p,0);var d=i.commonAncestorContainer;if(e!==d&&t!==d||r.contains(p))return n(d)?d:o(d);var c=s(e);return c.host?l(c.host,t):l(e,s(t).host)}function d(e){var t=1=a.clientWidth&&r>=a.clientHeight}),d=0l[e]&&!t.escapeWithReference&&(r=J(c[a],l[e]-('right'===e?c.width:c.height))),ue({},a,r)}};return d.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';c=ge({},c,m[t](e))}),e.offsets.popper=c,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,a=t.popper,r=t.reference,p=e.placement.split('-')[0],o=te,i=-1!==['top','bottom'].indexOf(p),n=i?'right':'bottom',s=i?'left':'top',l=i?'width':'height';return a[n]o(r[n])&&(e.offsets.popper[s]=o(r[n])),e}},arrow:{order:500,enabled:!0,fn:function(e,a){var r;if(!F(e.instance.modifiers,'arrow','keepTogether'))return e;var p=a.element;if('string'==typeof p){if(p=e.instance.popper.querySelector(p),!p)return e;}else if(!e.instance.popper.contains(p))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var o=e.placement.split('-')[0],i=e.offsets,n=i.popper,s=i.reference,l=-1!==['left','right'].indexOf(o),d=l?'height':'width',c=l?'Top':'Left',m=c.toLowerCase(),f=l?'left':'top',h=l?'bottom':'right',y=L(p)[d];s[h]-yn[h]&&(e.offsets.popper[m]+=s[m]+y-n[h]),e.offsets.popper=b(e.offsets.popper);var u=s[m]+s[d]/2-y/2,g=t(e.instance.popper),x=parseFloat(g['margin'+c],10),w=parseFloat(g['border'+c+'Width'],10),v=u-e.offsets.popper[m]-x-w;return v=ae(J(n[d]-y,v),0),e.arrowElement=p,e.offsets.arrow=(r={},ue(r,m,ee(v)),ue(r,f,''),r),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(D(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var a=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split('-')[0],p=C(r),o=e.placement.split('-')[1]||'',i=[];switch(t.behavior){case ve.FLIP:i=[r,p];break;case ve.CLOCKWISE:i=q(r);break;case ve.COUNTERCLOCKWISE:i=q(r,!0);break;default:i=t.behavior;}return i.forEach(function(n,s){if(r!==n||i.length===s+1)return e;r=e.placement.split('-')[0],p=C(r);var l=e.offsets.popper,d=e.offsets.reference,c=te,m='left'===r&&c(l.right)>c(d.left)||'right'===r&&c(l.left)c(d.top)||'bottom'===r&&c(l.top)c(a.right),b=c(l.top)c(a.bottom),u='left'===r&&f||'right'===r&&h||'top'===r&&b||'bottom'===r&&y,g=-1!==['top','bottom'].indexOf(r),x=!!t.flipVariations&&(g&&'start'===o&&f||g&&'end'===o&&h||!g&&'start'===o&&b||!g&&'end'===o&&y);(m||u||x)&&(e.flipped=!0,(m||u)&&(r=i[s+1]),x&&(o=V(o)),e.placement=r+(o?'-'+o:''),e.offsets.popper=ge({},e.offsets.popper,T(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,a=t.split('-')[0],r=e.offsets,p=r.popper,o=r.reference,i=-1!==['left','right'].indexOf(a),n=-1===['top','left'].indexOf(a);return p[i?'left':'top']=o[a]-(n?p[i?'width':'height']:0),e.placement=C(t),e.offsets.popper=b(p),e}},hide:{order:800,enabled:!0,fn:function(e){if(!F(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,a=A(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottoma.right||t.top>a.bottom||t.right')):t.className='tippy-arrow',t},We=function(){var e=Xe();return e.className='tippy-backdrop',e.setAttribute('data-state','hidden'),e},ze=function(e,t){e.setAttribute('tabindex','-1'),t.setAttribute('data-interactive','')},Me=function(e,t){e.removeAttribute('tabindex'),t.removeAttribute('data-interactive')},_e=function(e){e.setAttribute('data-inertia','')},Ue=function(e){e.removeAttribute('data-inertia')},Fe=function(e,t){var a=Xe();a.className='tippy-popper',a.setAttribute('role','tooltip'),a.id='tippy-'+e,a.style.zIndex=t.zIndex;var r=Xe();r.className='tippy-tooltip',r.setAttribute('data-size',t.size),r.setAttribute('data-animation',t.animation),r.setAttribute('data-state','hidden'),t.theme.split(' ').forEach(function(e){r.classList.add(e+'-theme')});var p=Xe();return p.className='tippy-content',p.setAttribute('data-state','hidden'),t.interactive&&ze(a,r),t.arrow&&r.appendChild(Be(t.arrowType)),t.animateFill&&(r.appendChild(We()),r.setAttribute('data-animatefill','')),t.inertia&&r.setAttribute('data-inertia',''),Ae(p,t),r.appendChild(p),a.appendChild(r),a.addEventListener('focusout',function(t){t.relatedTarget&&a._tippy&&!Ze(t.relatedTarget,function(e){return e===a})&&t.relatedTarget!==a._tippy.reference&&a._tippy.props.shouldPopperHideOnBlur(t)&&a._tippy.hide()}),a},Ve=function(e,t,a){var r=Se(e),p=r.tooltip,o=r.content,i=r.backdrop,n=r.arrow;e.style.zIndex=a.zIndex,p.setAttribute('data-size',a.size),p.setAttribute('data-animation',a.animation),t.content!==a.content&&Ae(o,a),!t.animateFill&&a.animateFill?(p.appendChild(We()),p.setAttribute('data-animatefill','')):t.animateFill&&!a.animateFill&&(p.removeChild(i),p.removeAttribute('data-animatefill')),!t.arrow&&a.arrow?p.appendChild(Be(a.arrowType)):t.arrow&&!a.arrow&&p.removeChild(n),t.arrow&&a.arrow&&t.arrowType!==a.arrowType&&p.replaceChild(Be(a.arrowType),n),!t.interactive&&a.interactive?ze(e,p):t.interactive&&!a.interactive&&Me(e,p),!t.inertia&&a.inertia?_e(p):t.inertia&&!a.inertia&&Ue(p),t.theme!==a.theme&&(t.theme.split(' ').forEach(function(e){p.classList.remove(e+'-theme')}),a.theme.split(' ').forEach(function(e){p.classList.add(e+'-theme')}))},qe=function(e){Te(document.querySelectorAll(Ee.POPPER)).forEach(function(t){var a=t._tippy;a&&!0===a.props.hideOnClick&&(!e||t!==e.popper)&&a.hide()})},je=function(e){return Object.keys(ie).reduce(function(t,a){var r=(e.getAttribute('data-tippy-'+a)||'').trim();return r?(t[a]='true'===r||'false'!==r&&(He(r)?+r:'target'!==a&&'['===r[0]?JSON.parse(r):r),t):t},{})},Ke=function(e){var t={isVirtual:!0,attributes:e.attributes||{},setAttribute:function(t,a){e.attributes[t]=a},getAttribute:function(t){return e.attributes[t]},removeAttribute:function(t){delete e.attributes[t]},hasAttribute:function(t){return t in e.attributes},addEventListener:function(){},removeEventListener:function(){},classList:{classNames:{},add:function(t){e.classList.classNames[t]=!0},remove:function(t){delete e.classList.classNames[t]},contains:function(t){return t in e.classList.classNames}}};for(var a in t)e[a]=t[a];return e},Ge=function(){if(Le){var t=Element.prototype;return t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector}}(),Qe=function(e,t){return(Element.prototype.closest||function(e){for(var t=this;t;){if(Ge.call(t,e))return t;t=t.parentElement}}).call(e,t)},Ze=function(e,t){for(;e;){if(t(e))return e;e=e.parentElement}},$e=function(e){var t=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset;e.focus(),scroll(t,a)},Je=function(e){void e.offsetHeight},et=function(e,t){return(t?e:{X:'Y',Y:'X'}[e])||''},tt=function(e,t,r,p){var o=t[0],i=t[1];if(!o&&!i)return'';var n={scale:function(){return i?r?o+', '+i:i+', '+o:''+o}(),translate:function(){return i?r?p?o+'px, '+-i+'px':o+'px, '+i+'px':p?-i+'px, '+o+'px':i+'px, '+o+'px':p?-o+'px':o+'px'}()};return n[e]},at=function(e,t){var a=e.match(new RegExp(t+'([XY])'));return a?a[1]:''},rt=function(e,t){var a=e.match(t);return a?a[1].split(',').map(parseFloat):[]},pt={translate:/translateX?Y?\(([^)]+)\)/,scale:/scaleX?Y?\(([^)]+)\)/},ot=function(e,t){var a=mt(Qe(e,Ee.POPPER)),r='top'===a||'bottom'===a,p='right'===a||'bottom'===a,o={translate:{axis:at(t,'translate'),numbers:rt(t,pt.translate)},scale:{axis:at(t,'scale'),numbers:rt(t,pt.scale)}},i=t.replace(pt.translate,'translate'+et(o.translate.axis,r)+'('+tt('translate',o.translate.numbers,r,p)+')').replace(pt.scale,'scale'+et(o.scale.axis,r)+'('+tt('scale',o.scale.numbers,r,p)+')');e.style[nt('transform')]=i},it=function(e,t){e.filter(Boolean).forEach(function(e){e.setAttribute('data-state',t)})},nt=function(e){for(var t=['','webkit'],a=e[0].toUpperCase()+e.slice(1),r=0;r('top'===e?i+n:i),l=o-t.bottom>('bottom'===e?i+n:i),d=t.left-p>('left'===e?i+n:i),c=p-t.right>('right'===e?i+n:i);return s||l||d||c},ct=function(e,t){return-(e-t)+'px'},mt=function(e){var t=e.getAttribute('x-placement');return t?t.split('-')[0]:''},ft=function(e,t){var a=oe({},t,t.performance?{}:je(e));return a.arrow&&(a.animateFill=!1),'function'==typeof a.appendTo&&(a.appendTo=t.appendTo(e)),'function'==typeof a.content&&(a.content=t.content(e)),a},ht=function(e,t,a){e[t+'EventListener']('transitionend',a)},bt=function(e,t){var a;return function(){var r=this,p=arguments;clearTimeout(a),a=setTimeout(function(){return e.apply(r,p)},t)}},yt=function(e,t){for(var a in e||{})if(!(a in t))throw Error('[tippy]: `'+a+'` is not a valid option')},ut=Le?navigator:{},gt=Le?window:{},xt=/MSIE |Trident\//.test(ut.userAgent),wt=/iPhone|iPad|iPod/.test(ut.platform)&&!gt.MSStream,vt='ontouchstart'in gt,kt=!1,Et=function(){kt||(kt=!0,wt&&document.body.classList.add('tippy-iOS'),window.performance&&document.addEventListener('mousemove',Lt))},Ot=0,Lt=function e(){var t=performance.now();20>t-Ot&&(kt=!1,document.removeEventListener('mousemove',e),!wt&&document.body.classList.remove('tippy-iOS')),Ot=t},Ct=function(e){var t=e.target;if(!(t instanceof Element))return qe();var a=Qe(t,Ee.POPPER);if(!(a&&a._tippy&&a._tippy.props.interactive)){var r=Ze(t,function(e){return e._tippy&&e._tippy.reference===e});if(r){var p=r._tippy,o=-1