UNPKG

tippy.js

Version:

Highly customizable tooltip and popover library

3 lines (2 loc) 21.3 kB
var tippy=function(e){"use strict";function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}e=e&&e.hasOwnProperty("default")?e.default:e;var n="5.0.3",r={allowHTML:!0,animation:"fade",appendTo:function(){return document.body},aria:"describedby",arrow:!0,boundary:"scrollParent",content:"",delay:0,distance:10,duration:[300,250],flip:!0,flipBehavior:"flip",flipOnUpdate:!1,hideOnClick:!0,ignoreAttributes:!1,inertia:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,lazy:!0,maxWidth:350,multiple:!1,offset:0,onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},placement:"top",popperOptions:{},role:"tooltip",showOnCreate:!1,theme:"",touch:!0,trigger:"mouseenter focus",triggerTarget:null,updateDuration:0,zIndex:9999},i=["arrow","boundary","distance","flip","flipBehavior","flipOnUpdate","offset","placement","popperOptions"];function o(e,n){return t({},e,{},n.reduce(function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t},{}))}var a={passive:!0},u="tippy-iOS",s="tippy-popper",c="tippy-tooltip",p="tippy-content",f="tippy-backdrop",l="tippy-arrow",d="tippy-svg-arrow",v="."+s,m="."+c,h="."+p,g="."+l,b="."+d,y={isTouch:!1},w=0;function E(){y.isTouch||(y.isTouch=!0,window.performance&&document.addEventListener("mousemove",T))}function T(){var e=performance.now();e-w<20&&(y.isTouch=!1,document.removeEventListener("mousemove",T)),w=e}function A(){var e=document.activeElement,t=e._tippy;e&&e.blur&&t&&!t.state.isVisible&&e.blur()}var C="undefined"!=typeof window&&"undefined"!=typeof document,I=C?navigator.userAgent:"",O=/MSIE |Trident\//.test(I),L=/UCBrowser\//.test(I),D=C&&/iPhone|iPad|iPod/.test(navigator.platform);function M(e){var t=e&&D&&y.isTouch;document.body.classList[t?"add":"remove"](u)}var P=Object.keys(r);function V(e,t){return{}.hasOwnProperty.call(e,t)}function x(e){return S(e)?[e]:function(e){return B(e,"NodeList")}(e)?X(e):Array.isArray(e)?e:X(document.querySelectorAll(e))}function U(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function k(e,t){return e&&e.modifiers&&e.modifiers[t]}function B(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function S(e){return B(e,"Element")}function H(e){return B(e,"MouseEvent")}function N(e,t){return"function"==typeof e?e.apply(void 0,t):e}function R(e,t){e.filter(function(e){return"flip"===e.name})[0].enabled=t}function q(){return document.createElement("div")}function z(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function j(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function _(e,n,i){var a=t({},n,{content:N(n.content,[e])},n.ignoreAttributes?{}:function(e,t){return(t?Object.keys(o(r,t)):P).reduce(function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t},{})}(e,i));return a.interactive&&(a.aria=null),a}function W(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)};var n}function F(e,t,n){e&&e!==t&&e.apply(void 0,n)}function X(e){return[].slice.call(e)}function Y(e,t){for(;e;){if(t(e))return e;e=e.parentElement}return null}function J(e,t){return e.indexOf(t)>-1}function G(e){return e.split(/\s+/).filter(Boolean)}function K(e,t){return void 0!==e?e:t}function Q(e){return[].concat(e)}function Z(e){var t=Q(e)[0];return t&&t.ownerDocument||document}function $(e,t){-1===e.indexOf(t)&&e.push(t)}function ee(e){return"number"==typeof e?e+"px":e}function te(e,t){e.innerHTML=S(t)?t.innerHTML:t}function ne(e,t){if(S(t.content))te(e,""),e.appendChild(t.content);else if("function"!=typeof t.content){e[t.allowHTML?"innerHTML":"textContent"]=t.content}}function re(e){return{tooltip:e.querySelector(m),content:e.querySelector(h),arrow:e.querySelector(g)||e.querySelector(b)}}function ie(e){e.setAttribute("data-inertia","")}function oe(e){var t=q();return!0===e?t.className=l:(t.className=d,S(e)?t.appendChild(e):te(t,e)),t}function ae(e){e.setAttribute("data-interactive","")}function ue(e,t,n){var r=L&&void 0!==document.body.style.webkitTransition?"webkitTransitionEnd":"transitionend";e[t+"EventListener"](r,n)}function se(e){return e.split("-")[0]}function ce(e,t,n){G(n).forEach(function(n){e.classList[t](n+"-theme")})}function pe(e,t){var n=q();n.className=s,n.style.position="absolute",n.style.top="0",n.style.left="0";var r=q();r.className=c,r.id="tippy-"+e,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1"),ce(r,"add",t.theme);var i=q();return i.className=p,i.setAttribute("data-state","hidden"),t.interactive&&ae(r),t.arrow&&(r.setAttribute("data-arrow",""),r.appendChild(oe(t.arrow))),t.inertia&&ie(r),ne(i,t),r.appendChild(i),n.appendChild(r),fe(n,t,t),n}function fe(e,t,n){var r=re(e),i=r.tooltip,o=r.content,a=r.arrow;e.style.zIndex=""+n.zIndex,i.setAttribute("data-animation",n.animation),i.style.maxWidth=ee(n.maxWidth),n.role?i.setAttribute("role",n.role):i.removeAttribute("role"),t.content!==n.content&&ne(o,n),!t.arrow&&n.arrow?(i.appendChild(oe(n.arrow)),i.setAttribute("data-arrow","")):t.arrow&&!n.arrow?(i.removeChild(a),i.removeAttribute("data-arrow")):t.arrow!==n.arrow&&(i.removeChild(a),i.appendChild(oe(n.arrow))),!t.interactive&&n.interactive?ae(i):t.interactive&&!n.interactive&&function(e){e.removeAttribute("data-interactive")}(i),!t.inertia&&n.inertia?ie(i):t.inertia&&!n.inertia&&function(e){e.removeAttribute("data-inertia")}(i),t.theme!==n.theme&&(ce(i,"remove",t.theme),ce(i,"add",n.theme))}var le=[],de=1,ve=[];function me(n,u,s){void 0===s&&(s=[]);var c,p,f,l=o(_(n,u,s),s);if(!l.multiple&&n._tippy)return null;var d,m,h,g,b=!1,w=!1,E=0,T=[],A=W(Ie,l.interactiveDebounce),C=Z(l.triggerTarget||n),I=de++,L=pe(I,l),D=re(L),P=D.tooltip,x=D.content,B=[P,x],S={id:I,reference:n,popper:L,popperChildren:D,popperInstance:null,props:l,state:{currentPlacement:null,isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:s,clearDelayTimeouts:function(){clearTimeout(c),clearTimeout(p),cancelAnimationFrame(f)},setProps:function(e){if(S.state.isDestroyed)return;ae("onBeforeUpdate",[S,e]),Ae();var r=S.props,o=_(n,t({},S.props,{},e,{ignoreAttributes:!0}),s);o.ignoreAttributes=K(e.ignoreAttributes,r.ignoreAttributes),S.props=o,Te(),r.interactiveDebounce!==o.interactiveDebounce&&(he(),A=W(Ie,o.interactiveDebounce));fe(L,r,o),S.popperChildren=re(L),r.triggerTarget&&!o.triggerTarget?Q(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):o.triggerTarget&&n.removeAttribute("aria-expanded");me(),S.popperInstance&&(i.some(function(t){return V(e,t)&&e[t]!==r[t]})?(S.popperInstance.destroy(),Me(),S.state.isVisible&&S.popperInstance.enableEventListeners()):S.popperInstance.update());ae("onAfterUpdate",[S,e])},setContent:function(e){S.setProps({content:e})},show:function(e){void 0===e&&(e=U(S.props.duration,0,r.duration));var t=S.state.isVisible,n=S.state.isDestroyed,i=!S.state.isEnabled,o=y.isTouch&&!S.props.touch;if(t||n||i||o)return;if(ie().hasAttribute("disabled"))return;if(ae("onShow",[S],!1),!1===S.props.onShow(S))return;be(),L.style.visibility="visible",S.state.isVisible=!0,S.state.isMounted||z(B.concat(L),0);m=function(){S.state.isVisible&&(z([L],S.props.updateDuration),z(B,e),j(B,"visible"),ce(),me(),$(le,S),M(!0),S.state.isMounted=!0,ae("onMount",[S]),function(e,t){we(e,t)}(e,function(){S.state.isShown=!0,ae("onShown",[S])}))},function(){E=0;var e,t=S.props.appendTo,n=ie();e=S.props.interactive&&t===r.appendTo||"parent"===t?n.parentNode:N(t,[n]);e.contains(L)||e.appendChild(L);S.popperInstance?(R(S.popperInstance.modifiers,S.props.flip),S.popperInstance.enableEventListeners(),S.popperInstance.update()):(Me(),S.popperInstance.enableEventListeners())}()},hide:function(e){void 0===e&&(e=U(S.props.duration,1,r.duration));var t=!S.state.isVisible&&!b,n=S.state.isDestroyed,i=!S.state.isEnabled&&!b;if(t||n||i)return;if(ae("onHide",[S],!1),!1===S.props.onHide(S)&&!b)return;ye(),L.style.visibility="hidden",S.state.isVisible=!1,S.state.isShown=!1,z(B,e),j(B,"hidden"),ce(),me(),function(e,t){we(e,function(){!S.state.isVisible&&L.parentNode&&L.parentNode.contains(L)&&t()})}(e,function(){S.popperInstance.disableEventListeners(),S.popperInstance.options.placement=S.props.placement,L.parentNode.removeChild(L),0===(le=le.filter(function(e){return e!==S})).length&&M(!1),S.state.isMounted=!1,ae("onHidden",[S])})},enable:function(){S.state.isEnabled=!0},disable:function(){S.hide(),S.state.isEnabled=!1},destroy:function(){if(S.state.isDestroyed)return;b=!0,S.clearDelayTimeouts(),S.hide(0),Ae(),delete n._tippy,S.popperInstance&&S.popperInstance.destroy();b=!1,S.state.isDestroyed=!0,ae("onDestroy",[S])}};n._tippy=S,L._tippy=S;var q=s.map(function(e){return e.fn(S)});return Te(),me(),l.lazy||Me(),ae("onCreate",[S]),l.showOnCreate&&Ve(),L.addEventListener("mouseenter",function(){S.props.interactive&&S.state.isVisible&&S.clearDelayTimeouts()}),L.addEventListener("mouseleave",function(){S.props.interactive&&J(S.props.trigger,"mouseenter")&&C.addEventListener("mousemove",A)}),S;function te(){var e=S.props.touch;return Array.isArray(e)?e:[e,0]}function ne(){return"hold"===te()[0]}function ie(){return g||n}function oe(e){return S.state.isMounted&&!S.state.isVisible||y.isTouch||!d||"focus"===d.type?0:U(S.props.delay,e?0:1,r.delay)}function ae(e,t,n){var r;(void 0===n&&(n=!0),q.forEach(function(n){V(n,e)&&n[e].apply(n,t)}),n)&&(r=S.props)[e].apply(r,t)}function ce(){var e=S.props.aria;if(e){var t="aria-"+e,r=P.id;Q(S.props.triggerTarget||n).forEach(function(e){var n=e.getAttribute(t);if(S.state.isVisible)e.setAttribute(t,n?n+" "+r:r);else{var i=n&&n.replace(r,"").trim();i?e.setAttribute(t,i):e.removeAttribute(t)}})}}function me(){Q(S.props.triggerTarget||n).forEach(function(e){S.props.interactive?e.setAttribute("aria-expanded",S.state.isVisible&&e===ie()?"true":"false"):e.removeAttribute("aria-expanded")})}function he(){C.body.removeEventListener("mouseleave",xe),C.removeEventListener("mousemove",A),ve=ve.filter(function(e){return e!==A})}function ge(e){if(!S.props.interactive||!L.contains(e.target)){if(ie().contains(e.target)){if(y.isTouch)return;if(S.state.isVisible&&J(S.props.trigger,"click"))return}!0===S.props.hideOnClick&&(S.clearDelayTimeouts(),S.hide(),w=!0,setTimeout(function(){w=!1}),S.state.isMounted||ye())}}function be(){C.addEventListener("mousedown",ge,!0)}function ye(){C.removeEventListener("mousedown",ge,!0)}function we(e,t){function n(e){e.target===P&&(ue(P,"remove",n),t())}if(0===e)return t();ue(P,"remove",h),ue(P,"add",n),h=n}function Ee(e,t,r){void 0===r&&(r=!1),Q(S.props.triggerTarget||n).forEach(function(n){n.addEventListener(e,t,r),T.push({node:n,eventType:e,handler:t,options:r})})}function Te(){ne()&&(Ee("touchstart",Ce,a),Ee("touchend",Oe,a)),G(S.props.trigger).forEach(function(e){if("manual"!==e)switch(Ee(e,Ce),e){case"mouseenter":Ee("mouseleave",Oe);break;case"focus":Ee(O?"focusout":"blur",Le)}})}function Ae(){T.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),T=[]}function Ce(e){if(S.state.isEnabled&&!De(e)&&!w)if(d=e,g=e.currentTarget,me(),!S.state.isVisible&&H(e)&&ve.forEach(function(t){return t(e)}),"click"===e.type&&!1!==S.props.hideOnClick&&S.state.isVisible)xe(e);else{var t=te(),n=t[0],r=t[1];y.isTouch&&"hold"===n&&r?c=setTimeout(function(){Ve(e)},r):Ve(e)}}function Ie(e){Y(e.target,function(e){return e===n||e===L})||function(e,t){var n=t.clientX,r=t.clientY;return e.every(function(e){var t=e.popperRect,i=e.interactiveBorder,o=t.top>r+i,a=t.bottom<r-i,u=t.left>n+i,s=t.right<n-i;return o||a||u||s})}(X(L.querySelectorAll(v)).concat(L).map(function(e){return{popperRect:e.getBoundingClientRect(),interactiveBorder:e._tippy.props.interactiveBorder}}),e)&&(he(),xe(e))}function Oe(e){if(!De(e))return S.props.interactive?(C.body.addEventListener("mouseleave",xe),C.addEventListener("mousemove",A),void $(ve,A)):void xe(e)}function Le(e){e.target===ie()&&(S.props.interactive&&e.relatedTarget&&L.contains(e.relatedTarget)||xe(e))}function De(e){var t="ontouchstart"in window,n=J(e.type,"touch"),r=ne();return t&&y.isTouch&&r&&!n||y.isTouch&&!r&&n}function Me(){var r=S.props.popperOptions,i=S.popperChildren.arrow;function o(e){S.state.currentPlacement=e.placement,S.props.flip&&!S.props.flipOnUpdate&&(e.flipped&&(S.popperInstance.options.placement=e.placement),R(S.popperInstance.modifiers,!1)),P.setAttribute("data-placement",e.placement),!1!==e.attributes["x-out-of-boundaries"]?P.setAttribute("data-out-of-boundaries",""):P.removeAttribute("data-out-of-boundaries");var t=se(e.placement),n=ee(S.props.distance),r={bottom:n+" 0 0 0",left:"0 "+n+" 0 0",top:"0 0 "+n+" 0",right:"0 0 0 "+n};L.style.padding=r[t]}var a=t({eventsEnabled:!1,placement:S.props.placement},r,{modifiers:t({},r&&r.modifiers,{preventOverflow:t({boundariesElement:S.props.boundary},k(r,"preventOverflow")),arrow:t({element:i,enabled:!!i},k(r,"arrow")),flip:t({enabled:S.props.flip,behavior:S.props.flipBehavior},k(r,"flip")),offset:t({offset:S.props.offset},k(r,"offset"))}),onCreate:function(e){o(e),F(r&&r.onCreate,a.onCreate,[e]),Pe()},onUpdate:function(e){o(e),F(r&&r.onUpdate,a.onUpdate,[e]),Pe()}});S.popperInstance=new e(n,L,a)}function Pe(){0===E?(E++,S.popperInstance.update()):m&&1===E&&(E++,function(e){e.offsetHeight}(L),m())}function Ve(e){S.clearDelayTimeouts(),S.popperInstance||Me(),e&&ae("onTrigger",[S,e]),be();var t=oe(!0);t?c=setTimeout(function(){S.show()},t):S.show()}function xe(e){if(S.clearDelayTimeouts(),ae("onUntrigger",[S,e]),S.state.isVisible){var t=oe(!1);t?p=setTimeout(function(){S.state.isVisible&&S.hide()},t):f=requestAnimationFrame(function(){S.hide()})}else ye()}}function he(e,n,i){void 0===i&&(i=[]),document.addEventListener("touchstart",E,t({},a,{capture:!0})),window.addEventListener("blur",A);var o=t({},r,{},n),u=x(e).reduce(function(e,t){var n=t&&me(t,o,i);return n&&e.push(n),e},[]);return S(e)?u[0]:u}function ge(e){Object.keys(e).forEach(function(t){r[t]=e[t]})}he.version=n,he.defaultProps=r,he.setDefaultProps=ge,he.currentInput=y;var be={mouseover:"mouseenter",focusin:"focus",click:"click"};function ye(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}var we,Ee,Te=(we=[{name:"animateFill",defaultValue:!1,fn:function(e){var t=e.popperChildren,n=t.tooltip,r=t.content,i=e.props.animateFill&&!L?function(){var e=q();return e.className=f,j([e],"hidden"),e}():null;function o(){e.popperChildren.backdrop=i}return{onCreate:function(){i&&(o(),n.insertBefore(i,n.firstElementChild),n.setAttribute("data-animatefill",""),n.style.overflow="hidden",e.setProps({animation:"shift-away",arrow:!1}))},onMount:function(){if(i){var e=n.style.transitionDuration,t=Number(e.replace("ms",""));r.style.transitionDelay=Math.round(t/10)+"ms",i.style.transitionDuration=e,j([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&j([i],"hidden")},onAfterUpdate:function(){o()}}}},{name:"followCursor",defaultValue:!1,fn:function(e){var t,n=e.reference,r=e.popper,i=Z(e.props.triggerTarget||n),o=null,a=!1,u=e.props;function s(){var t=u.placement;if(t){var n=t.split("-")[1];a=!0,e.setProps({placement:c()&&n?t.replace(n,"start"===n?"end":"start"):t}),a=!1}}function c(){return e.props.followCursor&&H(o)&&!(0===o.clientX&&0===o.clientY)}function p(){return y.isTouch||"initial"===e.props.followCursor&&e.state.isVisible}function f(){e.popperInstance&&(e.popperInstance.reference=n)}function l(){e.popperInstance&&c()&&(p()||!0!==e.props.followCursor)&&e.popperInstance.disableEventListeners()}function d(){c()&&m(t)}function v(){i.removeEventListener("mousemove",m)}function m(i){var o=t=i,a=o.clientX,u=o.clientY;if(e.popperInstance&&e.state.currentPlacement){var s=Y(i.target,function(e){return e===n}),c=n.getBoundingClientRect(),f=e.props.followCursor,l="horizontal"===f,d="vertical"===f,m=J(["top","bottom"],se(e.state.currentPlacement)),h=function(e,t){var n=t?e.offsetWidth:e.offsetHeight;return{size:n,x:t?n:0,y:t?0:n}}(r,m),g=h.size,b=h.x,y=h.y;!s&&e.props.interactive||(e.popperInstance.reference={referenceNode:n,clientWidth:0,clientHeight:0,getBoundingClientRect:function(){return{width:m?g:0,height:m?0:g,top:(l?c.top:u)-y,bottom:(l?c.bottom:u)+y,left:(d?c.left:a)-b,right:(d?c.right:a)+b}}},e.popperInstance.update()),p()&&v()}}return{onAfterUpdate:function(e,t){var n;a||(n=t,Object.keys(n).forEach(function(e){u[e]=K(n[e],u[e])}),t.placement&&s()),t.placement&&l(),requestAnimationFrame(d)},onMount:function(){d(),l()},onTrigger:function(n,r){o||(o=r,H(r)&&(t=r),c()&&p()?(a=!0,e.setProps({flipOnUpdate:!0}),a=!1):e.setProps({flipOnUpdate:u.flipOnUpdate}),s(),c()?r===o&&i.addEventListener("mousemove",m):f())},onUntrigger:function(){e.state.isVisible||(v(),o=null)},onHidden:function(){v(),f(),o=null}}}},{name:"inlinePositioning",defaultValue:!1,fn:function(e){var t=e.reference;function n(){return e.props.inlinePositioning}return{onHidden:function(){n()&&(e.popperInstance.reference=t)},onTrigger:function(){n()&&(e.popperInstance.reference={referenceNode:t,clientWidth:0,clientHeight:0,getBoundingClientRect:function(){return function(e,t,n){if(n.length<2||null===e)return t;var r;switch(e){case"top":case"bottom":var i=n[0],o=n[n.length-1],a="top"===e,u=i.top,s=o.bottom,c=a?i.left:o.left,p=a?i.right:o.right;r={top:u,bottom:s,left:c,right:p,width:p-c,height:s-u};break;case"left":case"right":var f=Math.min.apply(Math,n.map(function(e){return e.left})),l=Math.max.apply(Math,n.map(function(e){return e.right})),d=n.filter(function(t){return"left"===e?t.left===f:t.right===l}),v=d[0].top,m=d[d.length-1].bottom;r={top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};break;default:r=t}return r}(e.state.currentPlacement&&se(e.state.currentPlacement),t.getBoundingClientRect(),X(t.getClientRects()))}})}}}},{name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function r(t){return!0===e.props.sticky||e.props.sticky===t}var i=null,o=null;function a(){var u=r("reference")?t.getBoundingClientRect():null,s=r("popper")?n.getBoundingClientRect():null;(u&&ye(i,u)||s&&ye(o,s))&&e.popperInstance.update(),i=u,o=s,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}}],(Ee=function(e,t,n){return void 0===n&&(n=[]),he(e,t,[].concat(we,n))}).version=n,Ee.defaultProps=r,Ee.setDefaultProps=ge,Ee.currentInput=y,Ee);return Te.createSingleton=function(e,n,i){var o,a;void 0===i&&(i=[]),e.forEach(function(e){e.disable()});var u={};function s(e){Object.keys(e).forEach(function(t){u[t]=K(e[t],u[t])})}function c(e,t,n){o&&(n&&!t?a.setAttribute("aria-"+o,e):a.removeAttribute("aria-"+o))}s(t({},r,{},n));var p=e.map(function(e){return e.reference}),f=t({},n,{aria:null,triggerTarget:p,onMount:function(e){F(u.onMount,e.props.onMount,[e]),c(e.popperChildren.tooltip.id,e.props.interactive,!0)},onUntrigger:function(e,t){F(u.onUntrigger,e.props.onUntrigger,[e,t]),c(e.popperChildren.tooltip.id,e.props.interactive,!1)},onTrigger:function(t,n){F(u.onTrigger,t.props.onTrigger,[t,n]);var r=n.currentTarget,i=p.indexOf(r);a=r,o=u.aria,t.state.isVisible&&c(t.popperChildren.tooltip.id,t.props.interactive,!0),t.setContent(e[i].props.content),t.popperInstance.reference={referenceNode:r,clientHeight:0,clientWidth:0,getBoundingClientRect:function(){return r.getBoundingClientRect()}}},onAfterUpdate:function(e,t){F(u.onAfterUpdate,e.props.onAfterUpdate,[e,t]),s(t)},onDestroy:function(t){F(u.onDestroy,t.props.onDestroy,[t]),e.forEach(function(e){e.enable()})}});return he(document.createElement("div"),f,i)},Te.delegate=function(e,n,i){void 0===i&&(i=[]);var o=[],a=[],u=n.target,s=function(e,n){var r=t({},e);return n.forEach(function(e){delete r[e]}),r}(n,["target"]),c=t({},s,{trigger:"manual"}),p=t({},s,{showOnCreate:!0}),f=he(e,c,i);function l(e){if(e.target){var t=e.target.closest(u);if(t)if(J(t.getAttribute("data-tippy-trigger")||n.trigger||r.trigger,be[e.type])){var o=he(t,p,i);o&&(a=a.concat(o))}}}function d(e,t,n,r){void 0===r&&(r=!1),e.addEventListener(t,n,r),o.push({element:e,eventType:t,listener:n,options:r})}return Q(f).forEach(function(e){var t=e.destroy;e.destroy=function(e){void 0===e&&(e=!0),e&&a.forEach(function(e){e.destroy()}),a=[],o.forEach(function(e){var t=e.element,n=e.eventType,r=e.listener,i=e.options;t.removeEventListener(n,r,i)}),o=[],t()},function(e){var t=e.reference;d(t,"mouseover",l),d(t,"focusin",l),d(t,"click",l)}(e)}),f},Te.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;le.forEach(function(e){var t,i=!1;n&&(i=(t=n)&&t._tippy&&t._tippy.reference===t?e.reference===n:e.popper===n.popper),i||e.hide(r)})},Te.roundArrow='<svg viewBox="0 0 18 7" xmlns="http://www.w3.org/2000/svg"><path d="M0 7s2.021-.015 5.253-4.218C6.584 1.051 7.797.007 9 0c1.203-.007 2.416 1.035 3.761 2.782C16.012 7.005 18 7 18 7H0z"/></svg>',Te}(Popper); //# sourceMappingURL=tippy.iife.min.js.map