Comparing version 1.4.2 to 2.0.0-beta.2
@@ -1,1 +0,1 @@ | ||
(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 t(e){Ie.forEach(function(t){var o=t.popper,i=t.tippyInstance,n=t.settings,r=n.appendTo,s=n.hideOnClick,a=n.trigger;if(r.contains(o)){var p=!0===s||-1!==a.indexOf('focus'),l=!e||o!==e.popper;p&&l&&i.hide(o)}})}function o(t,o){var i=Element.prototype.closest||function(t){for(var o=this;o;){if(e.call(o,t))return o;o=o.parentElement}};return i.call(t,o)}function n(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function r(){var i=function(){De.touch=!0,De.iOS()&&document.body.classList.add('tippy-touch'),De.dynamicInputDetection&&window.performance&&document.addEventListener('mousemove',r)},r=function(){var e;return function(){var t=performance.now();20>t-e&&(De.touch=!1,document.removeEventListener('mousemove',r),!De.iOS()&&document.body.classList.remove('tippy-touch')),e=t}}();document.addEventListener('click',function(e){if(!(e.target instanceof Element))return t();var i=o(e.target,He.TOOLTIPPED_EL),r=o(e.target,He.POPPER);if(r){var s=n(Ie,function(e){return e.popper===r}),a=s.settings.interactive;if(a)return}if(i){var p=n(Ie,function(e){return e.el===i}),l=p.settings,d=l.hideOnClick,c=l.multiple,f=l.trigger;if(!c&&De.touch||!c&&-1!==f.indexOf('click'))return t(p);if(!0!==d||-1!==f.indexOf('click'))return}o(e.target,He.CONTROLLER)||!document.querySelector(He.POPPER)||t()}),document.addEventListener('touchstart',i),window.addEventListener('blur',function(){var t=document,o=t.activeElement;o&&o.blur&&e.call(o,He.TOOLTIPPED_EL)&&o.blur()}),!De.SUPPORTS_TOUCH&&(0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&document.addEventListener('pointerdown',i)}function s(){return!s.done&&(s.done=!0,r(),!0)}function a(e){window.requestAnimationFrame(function(){setTimeout(e,0)})}function p(e){for(var t=[!1,'webkit'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function l(e,t){return Array.prototype.findIndex?e.findIndex(t):e.indexOf(n(e,t))}function d(e){var t=e.getAttribute('title');t&&e.setAttribute('data-original-title',t),e.removeAttribute('title')}function c(e){var t=e.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function f(e,t){t?window.getComputedStyle(t)[p('transform')]:window.getComputedStyle(e).opacity}function m(e,t){e.forEach(function(e){e&&t(e.classList)})}function h(e){return{tooltip:e.querySelector(He.TOOLTIP),circle:e.querySelector(He.CIRCLE),content:e.querySelector(He.CONTENT)}}function u(t,o){t.forEach(function(t){if(t){var i=e.call(t,He.CONTENT),n=i?Ce(o/1.3):o;t.style[p('transitionDuration')]=n+'ms'}})}function g(e){return'visible'===e.style.visibility}function b(){}function y(e){return!!e&&'[object Object]'===e.toString()}function v(e){return e.replace(/-.+/,'')}function E(t){var e,o,i=this,r=n(Ie,function(e){return e.el===i}),s=r.popper,a=r.settings.offset,l=v(s.getAttribute('x-placement')),d=Ce(s.offsetWidth/2),c=Ce(s.offsetHeight/2),f=5,m=document.documentElement.offsetWidth||document.body.offsetWidth,h=t.pageX,u=t.pageY;'top'===l?(e=h-d+a,o=u-2*c):'bottom'===l?(e=h-d+a,o=u+10):'left'===l?(e=h-2*d,o=u-c+a):'right'===l?(e=h+5,o=u-c+a):void 0;('top'===l||'bottom'===l)&&(h+f+d+a>m&&(e=m-f-2*d),0>h-f-d+a&&(e=f)),s.style[p('transform')]='translate3d('+e+'px, '+o+'px, 0)'}function w(e){if(e instanceof Element||y(e))return[e];if(e instanceof NodeList)return[].slice.call(e);if(Array.isArray(e))return e;try{return[].slice.call(document.querySelectorAll(e))}catch(e){return[]}}function O(e,t,o){if(!t)return o();var i=h(e.popper),n=i.tooltip,r=!1,s=function(e){n[e+'EventListener']('webkitTransitionEnd',a),n[e+'EventListener']('transitionend',a)},a=function(t){t.target!==n||r||(r=!0,s('remove'),o())};s('add'),clearTimeout(e._transitionendTimeout),e._transitionendTimeout=setTimeout(function(){r||(s('remove'),o())},t)}function L(e){return e&&'[object Function]'==={}.toString.call(e)}function T(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function S(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function k(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var t=T(e),o=t.overflow,i=t.overflowX,n=t.overflowY;return /(auto|scroll)/.test(o+n+i)?e:k(S(e))}function A(e){var t=e&&e.offsetParent,o=t&&t.nodeName;return o&&'BODY'!==o&&'HTML'!==o?-1!==['TD','TABLE'].indexOf(t.nodeName)&&'static'===T(t,'position')?A(t):t:e?e.ownerDocument.documentElement:document.documentElement}function x(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||A(e.firstElementChild)===e)}function P(e){return null===e.parentNode?e:P(e.parentNode)}function C(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,r=document.createRange();r.setStart(i,0),r.setEnd(n,0);var s=r.commonAncestorContainer;if(e!==s&&t!==s||i.contains(n))return x(s)?s:A(s);var a=P(e);return a.host?C(a.host,t):C(e,P(t).host)}function D(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',i=e.nodeName;if('BODY'===i||'HTML'===i){var n=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||n;return r[o]}return e[o]}function I(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=D(t,'top'),n=D(t,'left'),r=o?-1:1;return e.top+=i*r,e.bottom+=i*r,e.left+=n*r,e.right+=n*r,e}function H(e,t){var o='x'===t?'Left':'Top',i='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'],10)+parseFloat(e['border'+i+'Width'],10)}function R(e,t,o,i){return Pe(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],ze()?o['offset'+e]+i['margin'+('Height'===e?'Top':'Left')]+i['margin'+('Height'===e?'Bottom':'Right')]:0)}function N(){var e=document.body,t=document.documentElement,o=ze()&&getComputedStyle(t);return{height:R('Height',e,t,o),width:R('Width',e,t,o)}}function B(e){return Ge({},e,{right:e.left+e.width,bottom:e.top+e.height})}function W(e){var t={};if(ze())try{t=e.getBoundingClientRect();var o=D(e,'top'),i=D(e,'left');t.top+=o,t.left+=i,t.bottom+=o,t.right+=i}catch(e){}else t=e.getBoundingClientRect();var n={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},r='HTML'===e.nodeName?N():{},s=r.width||e.clientWidth||n.right-n.left,a=r.height||e.clientHeight||n.bottom-n.top,p=e.offsetWidth-s,l=e.offsetHeight-a;if(p||l){var d=T(e);p-=H(d,'x'),l-=H(d,'y'),n.width-=p,n.height-=l}return B(n)}function M(e,t){var o=ze(),i='HTML'===t.nodeName,n=W(e),r=W(t),s=k(e),a=T(t),p=parseFloat(a.borderTopWidth,10),l=parseFloat(a.borderLeftWidth,10),d=B({top:n.top-r.top-p,left:n.left-r.left-l,width:n.width,height:n.height});if(d.marginTop=0,d.marginLeft=0,!o&&i){var c=parseFloat(a.marginTop,10),f=parseFloat(a.marginLeft,10);d.top-=p-c,d.bottom-=p-c,d.left-=l-f,d.right-=l-f,d.marginTop=c,d.marginLeft=f}return(o?t.contains(s):t===s&&'BODY'!==s.nodeName)&&(d=I(d,t)),d}function U(e){var t=e.ownerDocument.documentElement,o=M(e,t),i=Pe(t.clientWidth,window.innerWidth||0),n=Pe(t.clientHeight,window.innerHeight||0),r=D(t),s=D(t,'left'),a={top:r-o.top+o.marginTop,left:s-o.left+o.marginLeft,width:i,height:n};return B(a)}function _(e){var t=e.nodeName;return'BODY'===t||'HTML'===t?!1:'fixed'===T(e,'position')||_(S(e))}function F(e,t,o,i){var n={top:0,left:0},r=C(e,t);if('viewport'===i)n=U(r);else{var s;'scrollParent'===i?(s=k(S(t)),'BODY'===s.nodeName&&(s=e.ownerDocument.documentElement)):'window'===i?s=e.ownerDocument.documentElement:s=i;var a=M(s,r);if('HTML'===s.nodeName&&!_(r)){var p=N(),l=p.height,d=p.width;n.top+=a.top-a.marginTop,n.bottom=l+a.top,n.left+=a.left-a.marginLeft,n.right=d+a.left}else n=a}return n.left+=o,n.top+=o,n.right-=o,n.bottom-=o,n}function q(e){var t=e.width,o=e.height;return t*o}function Y(e,t,o,i,n){var r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var s=F(o,i,r,n),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},p=Object.keys(a).map(function(e){return Ge({key:e},a[e],{area:q(a[e])})}).sort(function(e,t){return t.area-e.area}),l=p.filter(function(e){var t=e.width,i=e.height;return t>=o.clientWidth&&i>=o.clientHeight}),d=0<l.length?l[0].key:p[0].key,c=e.split('-')[1];return d+(c?'-'+c:'')}function z(e,t,o){var i=C(t,o);return M(o,i)}function j(e){var t=getComputedStyle(e),o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight),n={width:e.offsetWidth+i,height:e.offsetHeight+o};return n}function V(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function K(e,t,o){o=o.split('-')[0];var i=j(e),n={width:i.width,height:i.height},r=-1!==['right','left'].indexOf(o),s=r?'top':'left',a=r?'left':'top',p=r?'height':'width',l=r?'width':'height';return n[s]=t[s]+t[p]/2-i[p]/2,n[a]=o===a?t[a]-i[l]:t[V(a)],n}function G(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function X(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var i=G(e,function(e){return e[t]===o});return e.indexOf(i)}function Q(e,t,o){var i=void 0===o?e:e.slice(0,X(e,'name',o));return i.forEach(function(e){e['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var o=e['function']||e.fn;e.enabled&&L(o)&&(t.offsets.popper=B(t.offsets.popper),t.offsets.reference=B(t.offsets.reference),t=o(t,e))}),t}function J(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=z(this.state,this.popper,this.reference),e.placement=Y(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=K(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position='absolute',e=Q(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function Z(e,t){return e.some(function(e){var o=e.name,i=e.enabled;return i&&o===t})}function $(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length-1;n++){var i=t[n],r=i?''+i+o:e;if('undefined'!=typeof document.body.style[r])return r}return null}function ee(){return this.state.isDestroyed=!0,Z(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.left='',this.popper.style.position='',this.popper.style.top='',this.popper.style[$('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function te(e){var t=e.ownerDocument;return t?t.defaultView:window}function oe(e,t,o,i){var n='BODY'===e.nodeName,r=n?e.ownerDocument.defaultView:e;r.addEventListener(t,o,{passive:!0}),n||oe(k(r.parentNode),t,o,i),i.push(r)}function ie(e,t,o,i){o.updateBound=i,te(e).addEventListener('resize',o.updateBound,{passive:!0});var n=k(e);return oe(n,'scroll',o.updateBound,o.scrollParents),o.scrollElement=n,o.eventsEnabled=!0,o}function ne(){this.state.eventsEnabled||(this.state=ie(this.reference,this.options,this.state,this.scheduleUpdate))}function re(e,t){return te(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function se(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=re(this.reference,this.state))}function ae(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function pe(e,t){Object.keys(t).forEach(function(o){var i='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&ae(t[o])&&(i='px'),e.style[o]=t[o]+i})}function le(e,t){Object.keys(t).forEach(function(o){var i=t[o];!1===i?e.removeAttribute(o):e.setAttribute(o,t[o])})}function de(e,t,o){var i=G(e,function(e){var o=e.name;return o===t}),n=!!i&&e.some(function(e){return e.name===o&&e.enabled&&e.order<i.order});if(!n){var r='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+r+' modifier in order to work, be sure to include it before '+r+'!')}return n}function ce(e){return'end'===e?'start':'start'===e?'end':e}function fe(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=Qe.indexOf(e),i=Qe.slice(o+1).concat(Qe.slice(0,o));return t?i.reverse():i}function me(e,t,o,i){var n=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+n[1],s=n[2];if(!r)return e;if(0===s.indexOf('%')){var a;switch(s){case'%p':a=o;break;case'%':case'%r':default:a=i;}var p=B(a);return p[t]/100*r}if('vh'===s||'vw'===s){var l;return l='vh'===s?Pe(document.documentElement.clientHeight,window.innerHeight||0):Pe(document.documentElement.clientWidth,window.innerWidth||0),l/100*r}return r}function he(e,t,o,i){var n=[0,0],r=-1!==['right','left'].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(G(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var p=/\s*,\s*|\s+/,l=-1===a?[s]:[s.slice(0,a).concat([s[a].split(p)[0]]),[s[a].split(p)[1],s.slice(a+1)]];return l=l.map(function(e,i){var n=(1===i?!r:r)?'height':'width',s=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return me(e,n,t,o)})}),l.forEach(function(e,t){e.forEach(function(o,i){ae(o)&&(n[t]+=o*('-'===e[i-1]?-1:1))})}),n}function ue(e){return-(e-Re.distance)+'px'}function ge(e){var t=e.el,o=e.popper,i=e.settings,n=i.position,r=i.popperOptions,s=i.offset,l=i.distance,d=i.flipDuration,c=h(o),f=c.tooltip,m=tt({placement:n},r||{},{modifiers:tt({},r?r.modifiers:{},{flip:tt({padding:l+5},r&&r.modifiers?r.modifiers.flip:{}),offset:tt({offset:s},r&&r.modifiers?r.modifiers.offset:{})}),onUpdate:function(){var e=f.style;e.top='',e.bottom='',e.left='',e.right='',e[v(o.getAttribute('x-placement'))]=ue(l)}});if(window.MutationObserver){var u=o.style,g=new MutationObserver(function(){u[p('transitionDuration')]='0ms',e.popperInstance.update(),a(function(){u[p('transitionDuration')]=d+'ms'})});g.observe(o,{childList:!0,subtree:!0,characterData:!0}),e._mutationObservers.push(g)}return new Ze(t,o,m)}function be(e){var t=e.el,o=e.popper,i=e.settings,n=i.appendTo,r=i.followCursor;n.contains(o)||(n.appendChild(o),e.popperInstance?(e.popperInstance.update(),(!r||De.touch)&&e.popperInstance.enableEventListeners()):e.popperInstance=ge(e),r&&!De.touch&&(t.addEventListener('mousemove',E),e.popperInstance.disableEventListeners()))}function ye(e){var t=e.popper,o=e.popperInstance,i=e.settings.stickyDuration,n=function(){return t.style[p('transitionDuration')]=i+'ms'},r=function(){return t.style[p('transitionDuration')]=''};a(function e(){o&&o.scheduleUpdate(),n(),g(t)?window.requestAnimationFrame(e):r()})}function ve(e,t){var o=Ne.reduce(function(o,i){var n=e.getAttribute('data-'+i.toLowerCase())||t[i];return'false'===n&&(n=!1),'true'===n&&(n=!0),isFinite(n)&&!isNaN(parseFloat(n))&&(n=parseFloat(n)),'string'==typeof n&&'['===n.trim().charAt(0)&&(n=JSON.parse(n)),o[i]=n,o},{});return tt({},t,o)}function Ee(e,t,o){var i=o.position,n=o.distance,r=o.arrow,s=o.animateFill,a=o.inertia,p=o.animation,l=o.arrowSize,d=o.size,c=o.theme,f=o.html,m=o.zIndex,h=o.interactive,u=document.createElement('div');u.setAttribute('class','tippy-popper'),u.setAttribute('role','tooltip'),u.setAttribute('aria-hidden','true'),u.setAttribute('id','tippy-tooltip-'+e),u.style.zIndex=m;var g=document.createElement('div');if(g.setAttribute('class','tippy-tooltip tippy-tooltip--'+d+' leave'),g.setAttribute('data-animation',p),c.split(' ').forEach(function(e){g.classList.add(e+'-theme')}),r){var b=document.createElement('div');b.setAttribute('class','arrow-'+l),b.setAttribute('x-arrow',''),g.appendChild(b)}if(s){g.setAttribute('data-animatefill','');var y=document.createElement('div');y.setAttribute('class','leave'),y.setAttribute('x-circle',''),g.appendChild(y)}a&&g.setAttribute('data-inertia',''),h&&g.setAttribute('data-interactive','');var E=document.createElement('div');if(E.setAttribute('class','tippy-tooltip-content'),f){var w;f instanceof Element?(E.appendChild(f),w='#'+f.id||'tippy-html-template'):(E.innerHTML=document.getElementById(f.replace('#','')).innerHTML,w=f),u.classList.add('html-template'),h&&u.setAttribute('tabindex','-1'),g.setAttribute('data-template-id',w)}else E.innerHTML=t;return g.style[v(i)]=ue(n),g.appendChild(E),u.appendChild(g),u}function we(e,t,o,i){var n=[];return'manual'===e?n:(t.addEventListener(e,o.handleTrigger),n.push({event:e,handler:o.handleTrigger}),'mouseenter'===e&&(De.SUPPORTS_TOUCH&&i&&(t.addEventListener('touchstart',o.handleTrigger),n.push({event:'touchstart',handler:o.handleTrigger}),t.addEventListener('touchend',o.handleMouseleave),n.push({event:'touchend',handler:o.handleMouseleave})),t.addEventListener('mouseleave',o.handleMouseleave),n.push({event:'mouseleave',handler:o.handleMouseleave})),'focus'===e&&(t.addEventListener('blur',o.handleBlur),n.push({event:'blur',handler:o.handleBlur})),n)}function Oe(e,t,o){if(!t.getAttribute('x-placement'))return!0;var i=e.clientX,n=e.clientY,r=o.interactiveBorder,s=o.distance,a=t.getBoundingClientRect(),p=v(t.getAttribute('x-placement')),l=r+s,d={top:a.top-n>r,bottom:n-a.bottom>r,left:a.left-i>r,right:i-a.right>r};return'top'===p?d.top=a.top-n>l:'bottom'===p?d.bottom=n-a.bottom>l:'left'===p?d.left=a.left-i>l:'right'===p?d.right=i-a.right>l:void 0,d.top||d.bottom||d.left||d.right}function Le(e,t,i){var n,r,s=this,a=i.position,p=i.delay,l=i.duration,d=i.interactive,c=i.interactiveBorder,f=i.distance,m=i.hideOnClick,h=i.trigger,u=i.touchHold,b=i.touchWait,y=function(){clearTimeout(n),clearTimeout(r)},v=function(){if(y(),!g(t)){var e=Array.isArray(p)?p[0]:p;p?n=setTimeout(function(){return s.show(t)},e):s.show(t)}},E=function(e){return s.callbacks.wait?s.callbacks.wait.call(t,v,e):v()},w=function(){y();var e=Array.isArray(p)?p[1]:p;p?r=setTimeout(function(){return s.hide(t)},e):s.hide(t)};return{handleTrigger:function(o){var i='mouseenter'===o.type&&De.SUPPORTS_TOUCH&&De.touch;if(!(i&&u)){var n='click'===o.type;n&&g(t)&&'persistent'!==m?w():E(o),i&&De.iOS()&&e.click&&e.click()}},handleMouseleave:function(n){if(!('mouseleave'===n.type&&De.SUPPORTS_TOUCH&&De.touch&&u)){if(d){var r=function n(r){var s=function(){document.body.removeEventListener('mouseleave',w),document.removeEventListener('mousemove',n),w()},a=o(r.target,He.TOOLTIPPED_EL),p=o(r.target,He.POPPER)===t,l=-1!==h.indexOf('click');return a&&a!==e?s():void(p||a===e||l||Oe(r,t,i)&&s())};return document.body.addEventListener('mouseleave',w),void document.addEventListener('mousemove',r)}w()}},handleBlur:function(e){!e.relatedTarget||De.touch||o(e.relatedTarget,He.POPPER)||w()}}}function Te(e){return e.arrow&&(e.animateFill=!1),e.appendTo&&'function'==typeof e.appendTo&&(e.appendTo=e.appendTo()),e}function Se(e){var t=this;return e.reduce(function(e,o){var i=ot,n=tt({},Te(t.settings.performance?t.settings:ve(o,t.settings)));'function'==typeof n.html&&(n.html=n.html(o));var r=n.html,s=n.trigger,a=n.touchHold,p=n.dynamicTitle,l=o.getAttribute('title');if(!l&&!r)return e;o.setAttribute('data-tooltipped',''),o.setAttribute('aria-describedby','tippy-tooltip-'+i),d(o);var c=Ee(i,l,n),f=Le.call(t,o,c,n),m=[];s.trim().split(' ').forEach(function(e){return m=m.concat(we(e,o,f,a))});var u;if(p&&window.MutationObserver){var g=h(c),b=g.content;u=new MutationObserver(function(){var e=o.getAttribute('title');e&&(b.innerHTML=e,d(o))}),u.observe(o,{attributes:!0})}return e.push({id:i,el:o,popper:c,settings:n,listeners:m,tippyInstance:t,_mutationObservers:[u]}),ot++,e},[])}function ke(e,t){return y(e)&&(e={refObj:!0,attributes:e.attributes||{},getBoundingClientRect:e.getBoundingClientRect,clientWidth:e.clientWidth,clientHeight:e.clientHeight,setAttribute:function(t,o){e.attributes[t]=o},getAttribute:function(t){return e.attributes[t]},removeAttribute:function(t){delete e.attributes[t]},addEventListener:function(){},removeEventListener:function(){},classList:{classNames:{},add:function(t){e.classList.classNames[t]=!0},remove:function(t){return e.classList.classNames[t]=!1,!0},contains:function(t){return!!e.classList.classNames[t]}}}),new it(e,t)}var Ae=Math.min,xe=Math.floor,Pe=Math.max,Ce=Math.round,De={};'undefined'!=typeof window&&(De.SUPPORTED='requestAnimationFrame'in window,De.SUPPORTS_TOUCH='ontouchstart'in window,De.touch=!1,De.dynamicInputDetection=!0,De.iOS=function(){return /iPhone|iPad|iPod/.test(navigator.userAgent)&&!window.MSStream});var Ie=[],He={POPPER:'.tippy-popper',TOOLTIP:'.tippy-tooltip',CONTENT:'.tippy-tooltip-content',CIRCLE:'[x-circle]',ARROW:'[x-arrow]',TOOLTIPPED_EL:'[data-tooltipped]',CONTROLLER:'[data-tippy-controller]'},Re={html:!1,position:'top',animation:'shift',animateFill:!0,arrow:!1,arrowSize:'regular',delay:0,trigger:'mouseenter focus',duration:350,interactive:!1,interactiveBorder:2,theme:'dark',size:'regular',distance:10,offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,flipDuration:350,sticky:!1,stickyDuration:200,appendTo:function(){return document.body},zIndex:9999,touchHold:!1,performance:!1,dynamicTitle:!1,popperOptions:{}},Ne=De.SUPPORTED&&Object.keys(Re),Be={};if('undefined'!=typeof Element){var We=Element.prototype;Be=We.matches||We.matchesSelector||We.webkitMatchesSelector||We.mozMatchesSelector||We.msMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=t.length;0<=--o&&t.item(o)!==this;);return-1<o}}for(var e=Be,Me='undefined'!=typeof window&&'undefined'!=typeof document,Ue=['Edge','Trident','Firefox'],_e=0,Fe=0;Fe<Ue.length;Fe+=1)if(Me&&0<=navigator.userAgent.indexOf(Ue[Fe])){_e=1;break}var i,qe=Me&&window.Promise,Ye=qe?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},_e))}},ze=function(){return void 0==i&&(i=-1!==navigator.appVersion.indexOf('MSIE 10')),i},je=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},Ve=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),Ke=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},Ge=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Xe=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],Qe=Xe.slice(3),Je={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},Ze=function(){function e(t,o){var i=this,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};je(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Ye(this.update.bind(this)),this.options=Ge({},e.Defaults,n),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=o&&o.jquery?o[0]:o,this.options.modifiers={},Object.keys(Ge({},e.Defaults.modifiers,n.modifiers)).forEach(function(t){i.options.modifiers[t]=Ge({},e.Defaults.modifiers[t]||{},n.modifiers?n.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Ge({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&L(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return Ve(e,[{key:'update',value:function(){return J.call(this)}},{key:'destroy',value:function(){return ee.call(this)}},{key:'enableEventListeners',value:function(){return ne.call(this)}},{key:'disableEventListeners',value:function(){return se.call(this)}}]),e}();Ze.Utils=('undefined'==typeof window?global:window).PopperUtils,Ze.placements=Xe,Ze.Defaults={placement:'bottom',eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],i=t.split('-')[1];if(i){var n=e.offsets,r=n.reference,s=n.popper,a=-1!==['bottom','top'].indexOf(o),p=a?'left':'top',l=a?'width':'height',d={start:Ke({},p,r[p]),end:Ke({},p,r[p]+r[l]-s[l])};e.offsets.popper=Ge({},s,d[i])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var o,i=t.offset,n=e.placement,r=e.offsets,s=r.popper,a=r.reference,p=n.split('-')[0];return o=ae(+i)?[+i,0]:he(i,s,a,p),'left'===p?(s.top+=o[0],s.left-=o[1]):'right'===p?(s.top+=o[0],s.left+=o[1]):'top'===p?(s.left+=o[0],s.top-=o[1]):'bottom'===p&&(s.left+=o[0],s.top+=o[1]),e.popper=s,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||A(e.instance.popper);e.instance.reference===o&&(o=A(o));var i=F(e.instance.popper,e.instance.reference,t.padding,o);t.boundaries=i;var n=t.priority,r=e.offsets.popper,s={primary:function(e){var o=r[e];return r[e]<i[e]&&!t.escapeWithReference&&(o=Pe(r[e],i[e])),Ke({},e,o)},secondary:function(e){var o='right'===e?'left':'top',n=r[o];return r[e]>i[e]&&!t.escapeWithReference&&(n=Ae(r[o],i[e]-('right'===e?r.width:r.height))),Ke({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';r=Ge({},r,s[t](e))}),e.offsets.popper=r,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=xe,s=-1!==['top','bottom'].indexOf(n),a=s?'right':'bottom',p=s?'left':'top',l=s?'width':'height';return o[a]<r(i[p])&&(e.offsets.popper[p]=r(i[p])-o[l]),o[p]>r(i[a])&&(e.offsets.popper[p]=r(i[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var o;if(!de(e.instance.modifiers,'arrow','keepTogether'))return e;var i=t.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var n=e.placement.split('-')[0],r=e.offsets,s=r.popper,a=r.reference,p=-1!==['left','right'].indexOf(n),l=p?'height':'width',d=p?'Top':'Left',c=d.toLowerCase(),f=p?'left':'top',m=p?'bottom':'right',h=j(i)[l];a[m]-h<s[c]&&(e.offsets.popper[c]-=s[c]-(a[m]-h)),a[c]+h>s[m]&&(e.offsets.popper[c]+=a[c]+h-s[m]),e.offsets.popper=B(e.offsets.popper);var u=a[c]+a[l]/2-h/2,g=T(e.instance.popper),b=parseFloat(g['margin'+d],10),y=parseFloat(g['border'+d+'Width'],10),v=u-e.offsets.popper[c]-b-y;return v=Pe(Ae(s[l]-h,v),0),e.arrowElement=i,e.offsets.arrow=(o={},Ke(o,c,Ce(v)),Ke(o,f,''),o),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(Z(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=F(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=V(i),r=e.placement.split('-')[1]||'',s=[];switch(t.behavior){case Je.FLIP:s=[i,n];break;case Je.CLOCKWISE:s=fe(i);break;case Je.COUNTERCLOCKWISE:s=fe(i,!0);break;default:s=t.behavior;}return s.forEach(function(a,p){if(i!==a||s.length===p+1)return e;i=e.placement.split('-')[0],n=V(i);var l=e.offsets.popper,d=e.offsets.reference,c=xe,f='left'===i&&c(l.right)>c(d.left)||'right'===i&&c(l.left)<c(d.right)||'top'===i&&c(l.bottom)>c(d.top)||'bottom'===i&&c(l.top)<c(d.bottom),m=c(l.left)<c(o.left),h=c(l.right)>c(o.right),u=c(l.top)<c(o.top),g=c(l.bottom)>c(o.bottom),b='left'===i&&m||'right'===i&&h||'top'===i&&u||'bottom'===i&&g,y=-1!==['top','bottom'].indexOf(i),v=!!t.flipVariations&&(y&&'start'===r&&m||y&&'end'===r&&h||!y&&'start'===r&&u||!y&&'end'===r&&g);(f||b||v)&&(e.flipped=!0,(f||b)&&(i=s[p+1]),v&&(r=ce(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=Ge({},e.offsets.popper,K(e.instance.popper,e.offsets.reference,e.placement)),e=Q(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,s=-1!==['left','right'].indexOf(o),a=-1===['top','left'].indexOf(o);return n[s?'left':'top']=r[o]-(a?n[s?'width':'height']:0),e.placement=V(t),e.offsets.popper=B(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!de(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=G(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,i=t.y,n=e.offsets.popper,r=G(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==r&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,a,p=void 0===r?t.gpuAcceleration:r,l=A(e.instance.popper),d=W(l),c={position:n.position},f={left:xe(n.left),top:xe(n.top),bottom:xe(n.bottom),right:xe(n.right)},m='bottom'===o?'top':'bottom',h='right'===i?'left':'right',u=$('transform');if(a='bottom'==m?-d.height+f.bottom:f.top,s='right'==h?-d.width+f.right:f.left,p&&u)c[u]='translate3d('+s+'px, '+a+'px, 0)',c[m]=0,c[h]=0,c.willChange='transform';else{var g='bottom'==m?-1:1,b='right'==h?-1:1;c[m]=a*g,c[h]=s*b,c.willChange=m+', '+h}var y={"x-placement":e.placement};return e.attributes=Ge({},y,e.attributes),e.styles=Ge({},c,e.styles),e.arrowStyles=Ge({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return pe(e.instance.popper,e.styles),le(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&pe(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,i,n){var r=z(n,t,e),s=Y(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',s),pe(t,{position:'absolute'}),o},gpuAcceleration:void 0}}};var $e=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},et=function(){function e(e,t){for(var o,n=0;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),tt=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ot=1,it=function(){function e(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};$e(this,e),De.SUPPORTED&&(s(),this.state={destroyed:!1},this.selector=t,this.settings=tt({},Re,o),(o.show||o.shown||o.hide||o.hidden)&&console.warn('Callbacks without the `on` prefix are deprecated (with the exception of `wait`). Use onShow, onShown, onHide, and onHidden instead.'),this.callbacks={wait:o.wait,show:o.onShow||o.show||b,shown:o.onShown||o.shown||b,hide:o.onHide||o.hide||b,hidden:o.onHidden||o.hidden||b},this.store=Se.call(this,w(t)),Ie.push.apply(Ie,this.store))}return et(e,[{key:'getPopperElement',value:function(e){try{return n(this.store,function(t){return t.el===e}).popper}catch(t){console.error('[getPopperElement]: Element passed as the argument does not exist in the instance')}}},{key:'getReferenceElement',value:function(e){try{return n(this.store,function(t){return t.popper===e}).el}catch(t){console.error('[getReferenceElement]: Popper passed as the argument does not exist in the instance')}}},{key:'getReferenceData',value:function(e){return n(this.store,function(t){return t.el===e||t.popper===e})}},{key:'show',value:function(e,t){var o=this;if(!this.state.destroyed){var i=n(this.store,function(t){return t.popper===e}),r=h(e),s=r.tooltip,p=r.circle,l=r.content;if(!this.selector.refObj&&!document.body.contains(i.el))return void this.destroy(e);this.callbacks.show.call(e);var d=i.el,c=i.settings,b=c.appendTo,y=c.sticky,v=c.interactive,E=c.followCursor,w=c.flipDuration,L=c.duration,T=void 0===t?Array.isArray(L)?L[0]:L:t;u([e,s,p],0),be(i),e.style.visibility='visible',e.setAttribute('aria-hidden','false'),a(function(){g(e)&&((!E||De.touch)&&(i.popperInstance.update(),u([e],w)),u([s,p],T),p&&(l.style.opacity=1),v&&d.classList.add('active'),y&&ye(i),f(s,p),m([s,p],function(e){e.contains('tippy-notransition')&&e.remove('tippy-notransition'),e.remove('leave'),e.add('enter')}),O(i,T,function(){!g(e)||i._onShownFired||(v&&e.focus(),s.classList.add('tippy-notransition'),i._onShownFired=!0,o.callbacks.shown.call(e))}))})}}},{key:'hide',value:function(e,t){var o=this;if(!this.state.destroyed){this.callbacks.hide.call(e);var i=n(this.store,function(t){return t.popper===e}),r=h(e),s=r.tooltip,a=r.circle,p=r.content,l=i.el,d=i.settings,f=d.appendTo,b=d.sticky,y=d.interactive,v=d.followCursor,w=d.html,L=d.trigger,T=d.duration,S=void 0===t?Array.isArray(T)?T[1]:T:t;i._onShownFired=!1,y&&l.classList.remove('active'),e.style.visibility='hidden',e.setAttribute('aria-hidden','true'),u([s,a,a?p:null],S),a&&(p.style.opacity=0),m([s,a],function(e){e.contains('tippy-tooltip')&&e.remove('tippy-notransition'),e.remove('enter'),e.add('leave')}),w&&-1!==L.indexOf('click')&&c(l)&&l.focus(),O(i,S,function(){g(e)||!f.contains(e)||'1'===getComputedStyle(s).opacity||(l.removeEventListener('mousemove',E),i.popperInstance.disableEventListeners(),f.removeChild(e),o.callbacks.hidden.call(e))})}}},{key:'update',value:function(e){if(!this.state.destroyed){var t=n(this.store,function(t){return t.popper===e}),o=h(e),i=o.content,r=t.el,s=t.settings.html;return s instanceof Element?void console.warn('Aborted: update() should not be used if `html` is a DOM element'):void(i.innerHTML=s?document.getElementById(s.replace('#','')).innerHTML:r.getAttribute('title')||r.getAttribute('data-original-title'),!s&&d(r))}}},{key:'destroy',value:function(e,t){var o=this;if(!this.state.destroyed){var i=n(this.store,function(t){return t.popper===e}),r=i.el,s=i.popperInstance,a=i.listeners,p=i._mutationObservers;g(e)&&this.hide(e,0),a.forEach(function(e){return r.removeEventListener(e.event,e.handler)}),r.setAttribute('title',r.getAttribute('data-original-title')),r.removeAttribute('data-original-title'),r.removeAttribute('data-tooltipped'),r.removeAttribute('aria-describedby'),s&&s.destroy(),p.forEach(function(e){e&&e.disconnect()}),Ie.splice(l(Ie,function(t){return t.popper===e}),1),(void 0===t||t)&&(this.store=Ie.filter(function(e){return e.tippyInstance===o}))}}},{key:'destroyAll',value:function(){var e=this;if(!this.state.destroyed){var t=this.store.length;this.store.forEach(function(o,i){var n=o.popper;e.destroy(n,i===t-1)}),this.store=null,this.state.destroyed=!0}}}]),e}();return ke.Browser=De,ke.Defaults=Re,ke.disableDynamicInputDetection=function(){return De.dynamicInputDetection=!1},ke.enableDynamicInputDetection=function(){return De.dynamicInputDetection=!0},ke}); | ||
(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 t(e){return'[object Object]'===Object.prototype.toString.call(e)}function o(e){if(e instanceof Element||t(e))return[e];if(e instanceof NodeList)return[].slice.call(e);if(Array.isArray(e))return e;try{return[].slice.call(document.querySelectorAll(e))}catch(e){return[]}}function r(e,t){var o=Ie.reduce(function(o,i){var r=e.getAttribute('data-tippy-'+i.toLowerCase())||t[i];return'false'===r&&(r=!1),'true'===r&&(r=!0),isFinite(r)&&!isNaN(parseFloat(r))&&(r=parseFloat(r)),'string'==typeof r&&'['===r.trim().charAt(0)&&(r=JSON.parse(r)),o[i]=r,o},{});return We({},t,o)}function n(e){for(var t=[!1,'webkit'],o=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var i=t[r],n=i?''+i+o:e;if('undefined'!=typeof document.body.style[n])return n}return null}function s(e,t,o){var i=o.placement,r=o.distance,s=o.arrow,a=o.arrowType,p=o.arrowTransform,l=o.animateFill,d=o.inertia,c=o.animation,f=o.size,m=o.theme,h=o.html,u=o.zIndex,g=o.interactive,b=o.maxWidth,y=document.createElement('div');y.setAttribute('class','tippy-popper'),y.setAttribute('role','tooltip'),y.setAttribute('id','tippy-'+e),y.style.zIndex=u,y.style.maxWidth=b;var v=document.createElement('div');if(v.setAttribute('class','tippy-tooltip'),v.setAttribute('data-size',f),v.setAttribute('data-animation',c),v.setAttribute('data-state','hidden'),m.split(' ').forEach(function(e){v.classList.add(e+'-theme')}),s){var E=document.createElement('div');E.style[n('transform')]=p,'round'===a?(E.classList.add('tippy-roundarrow'),E.innerHTML='\n <svg width="100%" height="100%" viewBox="0 0 64 20" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">\n <g transform="matrix(1.04009,0,0,1.45139,-1.26297,-65.9145)">\n <path d="M1.214,59.185C1.214,59.185 12.868,59.992 21.5,51.55C29.887,43.347 33.898,43.308 42.5,51.55C51.352,60.031 62.747,59.185 62.747,59.185L1.214,59.185Z"/>\n </g>\n </svg>'):E.classList.add('tippy-arrow'),v.appendChild(E)}if(l){v.setAttribute('data-animatefill','');var w=document.createElement('div');w.setAttribute('data-state','hidden'),w.classList.add('tippy-backdrop'),v.appendChild(w)}d&&v.setAttribute('data-inertia',''),g&&v.setAttribute('data-interactive','');var L=document.createElement('div');if(L.setAttribute('class','tippy-content'),h){var O;h instanceof Element?(L.appendChild(h),O='#'+h.id||'tippy-html-template'):(L.innerHTML=document.querySelector(h).innerHTML,O=h),y.setAttribute('data-html',''),g&&y.setAttribute('tabindex','-1'),v.setAttribute('data-template-id',O)}else L.innerHTML=t;return v.appendChild(L),y.appendChild(v),y}function a(e){return e&&'[object Function]'==={}.toString.call(e)}function p(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function l(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function d(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var t=p(e),o=t.overflow,i=t.overflowX,r=t.overflowY;return /(auto|scroll)/.test(o+r+i)?e:d(l(e))}function c(e){var t=e&&e.offsetParent,o=t&&t.nodeName;return o&&'BODY'!==o&&'HTML'!==o?-1!==['TD','TABLE'].indexOf(t.nodeName)&&'static'===p(t,'position')?c(t):t:e?e.ownerDocument.documentElement:document.documentElement}function f(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||c(e.firstElementChild)===e)}function m(e){return null===e.parentNode?e:m(e.parentNode)}function h(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,r=o?t:e,n=document.createRange();n.setStart(i,0),n.setEnd(r,0);var s=n.commonAncestorContainer;if(e!==s&&t!==s||i.contains(r))return f(s)?s:c(s);var a=m(e);return a.host?h(a.host,t):h(e,m(t).host)}function u(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',o='top'===t?'scrollTop':'scrollLeft',i=e.nodeName;if('BODY'===i||'HTML'===i){var r=e.ownerDocument.documentElement,n=e.ownerDocument.scrollingElement||r;return n[o]}return e[o]}function g(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=u(t,'top'),r=u(t,'left'),n=o?-1:1;return e.top+=i*n,e.bottom+=i*n,e.left+=r*n,e.right+=r*n,e}function b(e,t){var o='x'===t?'Left':'Top',i='Left'==o?'Right':'Bottom';return parseFloat(e['border'+o+'Width'],10)+parseFloat(e['border'+i+'Width'],10)}function y(e,t,o,i){return Se(t['offset'+e],t['scroll'+e],o['client'+e],o['offset'+e],o['scroll'+e],je()?o['offset'+e]+i['margin'+('Height'===e?'Top':'Left')]+i['margin'+('Height'===e?'Bottom':'Right')]:0)}function v(){var e=document.body,t=document.documentElement,o=je()&&getComputedStyle(t);return{height:y('Height',e,t,o),width:y('Width',e,t,o)}}function E(e){return Ve({},e,{right:e.left+e.width,bottom:e.top+e.height})}function w(e){var t={};if(je())try{t=e.getBoundingClientRect();var o=u(e,'top'),i=u(e,'left');t.top+=o,t.left+=i,t.bottom+=o,t.right+=i}catch(e){}else t=e.getBoundingClientRect();var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},n='HTML'===e.nodeName?v():{},s=n.width||e.clientWidth||r.right-r.left,a=n.height||e.clientHeight||r.bottom-r.top,l=e.offsetWidth-s,d=e.offsetHeight-a;if(l||d){var c=p(e);l-=b(c,'x'),d-=b(c,'y'),r.width-=l,r.height-=d}return E(r)}function L(e,t){var o=je(),i='HTML'===t.nodeName,r=w(e),n=w(t),s=d(e),a=p(t),l=parseFloat(a.borderTopWidth,10),c=parseFloat(a.borderLeftWidth,10),f=E({top:r.top-n.top-l,left:r.left-n.left-c,width:r.width,height:r.height});if(f.marginTop=0,f.marginLeft=0,!o&&i){var m=parseFloat(a.marginTop,10),h=parseFloat(a.marginLeft,10);f.top-=l-m,f.bottom-=l-m,f.left-=c-h,f.right-=c-h,f.marginTop=m,f.marginLeft=h}return(o?t.contains(s):t===s&&'BODY'!==s.nodeName)&&(f=g(f,t)),f}function O(e){var t=e.ownerDocument.documentElement,o=L(e,t),i=Se(t.clientWidth,window.innerWidth||0),r=Se(t.clientHeight,window.innerHeight||0),n=u(t),s=u(t,'left'),a={top:n-o.top+o.marginTop,left:s-o.left+o.marginLeft,width:i,height:r};return E(a)}function T(e){var t=e.nodeName;return'BODY'===t||'HTML'===t?!1:'fixed'===p(e,'position')||T(l(e))}function x(e,t,o,i){var r={top:0,left:0},n=h(e,t);if('viewport'===i)r=O(n);else{var s;'scrollParent'===i?(s=d(l(t)),'BODY'===s.nodeName&&(s=e.ownerDocument.documentElement)):'window'===i?s=e.ownerDocument.documentElement:s=i;var a=L(s,n);if('HTML'===s.nodeName&&!T(n)){var p=v(),c=p.height,f=p.width;r.top+=a.top-a.marginTop,r.bottom=c+a.top,r.left+=a.left-a.marginLeft,r.right=f+a.left}else r=a}return r.left+=o,r.top+=o,r.right-=o,r.bottom-=o,r}function k(e){var t=e.width,o=e.height;return t*o}function A(e,t,o,i,r){var n=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var s=x(o,i,n,r),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},p=Object.keys(a).map(function(e){return Ve({key:e},a[e],{area:k(a[e])})}).sort(function(e,t){return t.area-e.area}),l=p.filter(function(e){var t=e.width,i=e.height;return t>=o.clientWidth&&i>=o.clientHeight}),d=0<l.length?l[0].key:p[0].key,c=e.split('-')[1];return d+(c?'-'+c:'')}function C(e,t,o){var i=h(t,o);return L(o,i)}function S(e){var t=getComputedStyle(e),o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight),r={width:e.offsetWidth+i,height:e.offsetHeight+o};return r}function P(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function D(e,t,o){o=o.split('-')[0];var i=S(e),r={width:i.width,height:i.height},n=-1!==['right','left'].indexOf(o),s=n?'top':'left',a=n?'left':'top',p=n?'height':'width',l=n?'width':'height';return r[s]=t[s]+t[p]/2-i[p]/2,r[a]=o===a?t[a]-i[l]:t[P(a)],r}function N(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function R(e,t,o){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===o});var i=N(e,function(e){return e[t]===o});return e.indexOf(i)}function I(e,t,o){var i=void 0===o?e:e.slice(0,R(e,'name',o));return i.forEach(function(e){e['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var o=e['function']||e.fn;e.enabled&&a(o)&&(t.offsets.popper=E(t.offsets.popper),t.offsets.reference=E(t.offsets.reference),t=o(t,e))}),t}function B(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=C(this.state,this.popper,this.reference),e.placement=A(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=D(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position='absolute',e=I(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function H(e,t){return e.some(function(e){var o=e.name,i=e.enabled;return i&&o===t})}function W(e){for(var t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length-1;r++){var i=t[r],n=i?''+i+o:e;if('undefined'!=typeof document.body.style[n])return n}return null}function M(){return this.state.isDestroyed=!0,H(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.left='',this.popper.style.position='',this.popper.style.top='',this.popper.style[W('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function _(e){var t=e.ownerDocument;return t?t.defaultView:window}function U(e,t,o,i){var r='BODY'===e.nodeName,n=r?e.ownerDocument.defaultView:e;n.addEventListener(t,o,{passive:!0}),r||U(d(n.parentNode),t,o,i),i.push(n)}function Y(e,t,o,i){o.updateBound=i,_(e).addEventListener('resize',o.updateBound,{passive:!0});var r=d(e);return U(r,'scroll',o.updateBound,o.scrollParents),o.scrollElement=r,o.eventsEnabled=!0,o}function F(){this.state.eventsEnabled||(this.state=Y(this.reference,this.options,this.state,this.scheduleUpdate))}function q(e,t){return _(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function j(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=q(this.reference,this.state))}function z(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function K(e,t){Object.keys(t).forEach(function(o){var i='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&z(t[o])&&(i='px'),e.style[o]=t[o]+i})}function X(e,t){Object.keys(t).forEach(function(o){var i=t[o];!1===i?e.removeAttribute(o):e.setAttribute(o,t[o])})}function V(e,t,o){var i=N(e,function(e){var o=e.name;return o===t}),r=!!i&&e.some(function(e){return e.name===o&&e.enabled&&e.order<i.order});if(!r){var n='`'+t+'`';console.warn('`'+o+'`'+' modifier is required by '+n+' modifier in order to work, be sure to include it before '+n+'!')}return r}function G(e){return'end'===e?'start':'start'===e?'end':e}function Z(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=Ze.indexOf(e),i=Ze.slice(o+1).concat(Ze.slice(0,o));return t?i.reverse():i}function J(e,t,o,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),n=+r[1],s=r[2];if(!n)return e;if(0===s.indexOf('%')){var a;switch(s){case'%p':a=o;break;case'%':case'%r':default:a=i;}var p=E(a);return p[t]/100*n}if('vh'===s||'vw'===s){var l;return l='vh'===s?Se(document.documentElement.clientHeight,window.innerHeight||0):Se(document.documentElement.clientWidth,window.innerWidth||0),l/100*n}return n}function Q(e,t,o,i){var r=[0,0],n=-1!==['right','left'].indexOf(i),s=e.split(/(\+|\-)/).map(function(e){return e.trim()}),a=s.indexOf(N(s,function(e){return-1!==e.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var p=/\s*,\s*|\s+/,l=-1===a?[s]:[s.slice(0,a).concat([s[a].split(p)[0]]),[s[a].split(p)[1],s.slice(a+1)]];return l=l.map(function(e,i){var r=(1===i?!n:n)?'height':'width',s=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,s=!0,e):s?(e[e.length-1]+=t,s=!1,e):e.concat(t)},[]).map(function(e){return J(e,r,t,o)})}),l.forEach(function(e,t){e.forEach(function(o,i){z(o)&&(r[t]+=o*('-'===e[i-1]?-1:1))})}),r}function $(e,t,o,i){if(!t.length)return'';var r={scale:function(){return 1===t.length?''+t[0]:o?t[0]+', '+t[1]:t[1]+', '+t[0]}(),translate:function(){return 1===t.length?i?-t[0]+'px':t[0]+'px':o?i?t[0]+'px, '+-t[1]+'px':t[0]+'px, '+t[1]+'px':i?-t[1]+'px, '+t[0]+'px':t[1]+'px, '+t[0]+'px'}()};return r[e]}function ee(e,t){if(!e)return'';return t?e:{X:'Y',Y:'X'}[e]}function te(e){return e.getAttribute('x-placement').replace(/-.+/,'')}function oe(e,t,o){var i=te(e),r='top'===i||'bottom'===i,s='right'===i||'bottom'===i,a=function(e){var t=o.match(e);return t?t[1]:''},p=function(e){var t=o.match(e);return t?t[1].split(',').map(parseFloat):[]},l={translate:/translateX?Y?\(([^)]+)\)/,scale:/scaleX?Y?\(([^)]+)\)/},d={translate:{axis:a(/translate([XY])/),numbers:p(l.translate)},scale:{axis:a(/scale([XY])/),numbers:p(l.scale)}},c=o.replace(l.translate,'translate'+ee(d.translate.axis,r)+'('+$('translate',d.translate.numbers,r,s)+')').replace(l.scale,'scale'+ee(d.scale.axis,r)+'('+$('scale',d.scale.numbers,r,s)+')');t.style[n('transform')]=c}function ie(e){requestAnimationFrame(function(){setTimeout(e,0)})}function re(e){return{tooltip:e.querySelector(Ne.TOOLTIP),backdrop:e.querySelector(Ne.BACKDROP),content:e.querySelector(Ne.CONTENT)}}function ne(e){return-(e-Re.distance)+'px'}function se(e){var t=e.tippy,o=e.target,i=e.callback,r=e.options;if(window.MutationObserver){var n=new MutationObserver(i);n.observe(o,r),t._mutationObservers.push(n)}}function ae(e){var t=e.reference,o=e.popper,i=e.options,r=i.placement,s=i.popperOptions,a=i.offset,p=i.distance,l=i.updateDuration,d=i.flip,c=i.flipBehavior,f=i.arrowType,m=i.arrowTransform,h=i.sticky,u=re(o),g=u.tooltip,b='round'===f?Ne.ROUND_ARROW:Ne.ARROW,y=g.querySelector(b),v=We({placement:r},s||{},{modifiers:We({},s?s.modifiers:{},{arrow:We({element:b},s&&s.modifiers?s.modifiers.arrow:{}),flip:We({enabled:d,padding:p+5,behavior:c},s&&s.modifiers?s.modifiers.flip:{}),offset:We({offset:a},s&&s.modifiers?s.modifiers.offset:{})}),onCreate:function(){g.style[te(o)]=ne(p),y&&m&&oe(o,y,m)},onUpdate:function(){if(!e.state.visible&&!h&&'0'===getComputedStyle(g).opacity)return e.hide(0);var t=g.style;t.top='',t.bottom='',t.left='',t.right='',t[te(o)]=ne(p),y&&m&&oe(o,y,m)}});return se({tippy:e,target:o,callback:function(){var t=o.style;t[n('transitionDuration')]='0ms',e.popperInstance.update(),ie(function(){t[n('transitionDuration')]=l+'ms'})},options:{childList:!0,subtree:!0,characterData:!0}}),new Qe(t,o,v)}function pe(e,t,o,i){var r=[];return'manual'===e?r:(t.addEventListener(e,o.handleTrigger),r.push({event:e,handler:o.handleTrigger}),'mouseenter'===e&&(De.supportsTouch&&i&&(t.addEventListener('touchstart',o.handleTrigger),r.push({event:'touchstart',handler:o.handleTrigger}),t.addEventListener('touchend',o.handleMouseleave),r.push({event:'touchend',handler:o.handleMouseleave})),t.addEventListener('mouseleave',o.handleMouseleave),r.push({event:'mouseleave',handler:o.handleMouseleave})),'focus'===e&&(t.addEventListener('blur',o.handleBlur),r.push({event:'blur',handler:o.handleBlur})),r)}function le(t,o){var i=Element.prototype.closest||function(t){for(var o=this;o;){if(e.call(o,t))return o;o=o.parentElement}};return i.call(t,o)}function de(e,t,o){if(!t.getAttribute('x-placement'))return!0;var i=e.clientX,r=e.clientY,n=o.interactiveBorder,s=o.distance,a=t.getBoundingClientRect(),p=te(t),l=n+s,d={top:a.top-r>n,bottom:r-a.bottom>n,left:a.left-i>n,right:i-a.right>n};return'top'===p?d.top=a.top-r>l:'bottom'===p?d.bottom=r-a.bottom>l:'left'===p?d.left=a.left-i>l:'right'===p?d.right=i-a.right>l:void 0,d.top||d.bottom||d.left||d.right}function ce(e,t){var o,i,r=e.popper,n=e.reference,s=e.options,a=s.delay,p=s.duration,l=s.interactive,d=s.interactiveBorder,c=s.hideOnClick,f=s.trigger,m=s.touchHold,h=function(){clearTimeout(o),clearTimeout(i)},u=function(){if(h(),!e.state.visible){var t=Array.isArray(a)?a[0]:a;a?o=setTimeout(function(){return e.show()},t):e.show()}},g=function(t){e.options.wait?e.options.wait.call(r,u,t):u()},b=function(){if(h(),!!e.state.visible){var t=Array.isArray(a)?a[1]:a;a?i=setTimeout(function(){e.state.visible&&e.hide()},t):e.hide()}};return{handleTrigger:function(t){var o=De.supportsTouch&&De.usingTouch&&('mouseenter'===t.type||'focus'===t.type);if(!(o&&m)){e._lastTriggerEvent=t.type;var i='click'===t.type;i&&e.state.visible&&'persistent'!==c?b():g(t),o&&De.iOS&&n.click&&n.click()}},handleMouseleave:function(e){if(!('mouseleave'===e.type&&De.supportsTouch&&De.usingTouch&&m)){if(l){var o=function e(o){var i=le(o.target,Ne.REFERENCE),s=le(o.target,Ne.POPPER)===r;s||i===n||de(o,r,t)&&(document.body.removeEventListener('mouseleave',b),document.removeEventListener('mousemove',e),b())};return document.body.addEventListener('mouseleave',b),void document.addEventListener('mousemove',o)}b()}},handleBlur:function(e){!e.relatedTarget||De.usingTouch||le(e.relatedTarget,Ne.POPPER)||b()}}}function fe(e,t){return t.arrow&&(t.animateFill=!1),t.appendTo&&'function'==typeof t.appendTo&&(t.appendTo=t.appendTo()),'function'==typeof t.html&&(t.html=t.html(e)),t}function me(e){var t=e.getAttribute('title');t&&e.setAttribute('data-original-title',t),e.removeAttribute('title')}function he(t){var e=function(o){if('focus'!==t._lastTriggerEvent){var e,i,r=t.popper,s=t.options.offset,a=te(r),p=ke(r.offsetWidth/2),l=ke(r.offsetHeight/2),d=5,c=document.documentElement.offsetWidth||document.body.offsetWidth,f=o.pageX,m=o.pageY;'top'===a?(e=f-p+s,i=m-2*l):'bottom'===a?(e=f-p+s,i=m+10):'left'===a?(e=f-2*p,i=m-l+s):'right'===a?(e=f+5,i=m-l+s):void 0;('top'===a||'bottom'===a)&&(f+d+p+s>c&&(e=c-d-2*p),0>f-d-p+s&&(e=d)),r.style[n('transform')]='translate3d('+e+'px, '+i+'px, 0)'}};return t._followCursorListener=e,e}function ue(e){var t=e.popper,o=e.reference,i=e.options,r=i.placement,n=i.appendTo,s=i.followCursor,a=e.popperInstance;n.contains(t)||(n.appendChild(t),a?(a.update(),(!s||De.usingTouch)&&a.enableEventListeners()):a=e.popperInstance=ae(e),s&&!De.usingTouch&&(document.addEventListener('mousemove',he(e)),a.disableEventListeners()))}function ge(e){var t=function(){e.popper.style[n('transitionDuration')]=e.options.updateDuration+'ms'},o=function(){e.popper.style[n('transitionDuration')]=''};ie(function i(){e.popperInstance&&e.popperInstance.scheduleUpdate(),t(),e.state.visible?requestAnimationFrame(i):o()})}function be(e,t,o){if(!t)return o();var i=re(e.popper),r=i.tooltip,n=function(e,t){t&&r[e+'EventListener']('ontransitionend'in window?'transitionend':'webkitTransitionEnd',t)},s=function t(i){i.target===r&&(n('remove',t),o())};n('remove',e._transitionendListener),n('add',s),e._transitionendListener=s}function ye(e){var t=e.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function ve(e,t){return Array.isArray(e)?e[t]:e}function Ee(e,t){e.forEach(function(e){e&&e.setAttribute('data-state',t)})}function we(t,o){t.forEach(function(t){if(t){var i=e.call(t,Ne.CONTENT),r=i?ke(o/1.3):o;t.style[n('transitionDuration')]=r+'ms'}})}function Le(e,t){return e.reduce(function(e,o){var i=ot,n=fe(o,t.performance?t:r(o,t)),a=n.html,p=n.trigger,l=n.touchHold,d=n.dynamicTitle,c=n.createPopperInstanceOnInit,f=o.getAttribute('title');if(!f&&!a)return e;o.setAttribute('data-tippy',''),o.setAttribute('aria-describedby','tippy-'+i),me(o);var m=s(i,f,n),h=new tt({id:i,reference:o,popper:m,options:n,_mutationObservers:[]});h.popperInstance=c?ae(h):null;var u=ce(h,n);return h.listeners=p.trim().split(' ').reduce(function(e,t){return e.concat(pe(t,o,u,l))},[]),d&&se({tippy:h,target:o,callback:function(){var e=re(m),t=e.content,i=o.getAttribute('title');i&&(t.innerHTML=i,me(o))},options:{attributes:!0}}),o._tippy=h,m._reference=o,e.push(h),ot++,e},[])}function Oe(e){var t=[].slice.call(document.querySelectorAll(Ne.POPPER));t.forEach(function(t){var o=t._reference._tippy,i=o.options;(!0===i.hideOnClick||-1<i.trigger.indexOf('focus'))&&(!e||t!==e.popper)&&o.hide()})}function Te(){var t=function(){De.usingTouch||(De.usingTouch=!0,De.iOS&&document.body.classList.add('tippy-touch'),De.dynamicInputDetection&&window.performance&&document.addEventListener('mousemove',o),De.onUserInputChange('touch'))},o=function(){var e;return function(){var t=performance.now();20>t-e&&(De.usingTouch=!1,document.removeEventListener('mousemove',o),!De.iOS&&document.body.classList.remove('tippy-touch'),De.onUserInputChange('mouse')),e=t}}();document.addEventListener('click',function(e){if(!(e.target instanceof Element))return Oe();var t=le(e.target,Ne.REFERENCE),o=le(e.target,Ne.POPPER);if(!(o&&o._reference._tippy.options.interactive)){if(t){var i=t._tippy.options;if(!i.multiple&&De.usingTouch||!i.multiple&&-1<i.trigger.indexOf('click'))return Oe(t._tippy);if(!0!==i.hideOnClick||-1<i.trigger.indexOf('click'))return}Oe()}}),document.addEventListener('touchstart',t),window.addEventListener('blur',function(){var t=document,o=t.activeElement;o&&o.blur&&e.call(o,Ne.REFERENCE)&&o.blur()}),!De.supportsTouch&&(navigator.maxTouchPoints||navigator.msMaxTouchPoints)&&document.addEventListener('pointerdown',t)}function xe(e,i){return De.supported&&!De.eventsBound&&(Te(),De.eventsBound=!0),t(e)&&(e.refObj=!0,e.attributes=e.attributes||{},e.setAttribute=function(t,o){e.attributes[t]=o},e.getAttribute=function(t){return e.attributes[t]},e.removeAttribute=function(t){delete e.attributes[t]},e.addEventListener=function(){},e.removeEventListener=function(){},e.classList={classNames:{},add:function(t){return e.classList.classNames[t]=!0},remove:function(t){return delete e.classList.classNames[t],!0},contains:function(t){return!!e.classList.classNames[t]}}),i=We({},Re,i),{selector:e,options:i,tooltips:De.supported?Le(o(e),i):[],destroyAll:function(){this.tooltips.forEach(function(e){return e.destroy()})}}}var ke=Math.round,Ae=Math.min,Ce=Math.floor,Se=Math.max,Pe='undefined'!=typeof window,De={};Pe&&(De.supported='requestAnimationFrame'in window,De.supportsTouch='ontouchstart'in window,De.usingTouch=!1,De.eventsBound=!1,De.dynamicInputDetection=!0,De.iOS=/iPhone|iPad|iPod/.test(navigator.platform)&&!window.MSStream,De.onUserInputChange=function(){});for(var Ne={POPPER:'.tippy-popper',TOOLTIP:'.tippy-tooltip',CONTENT:'.tippy-content',BACKDROP:'.tippy-backdrop',ARROW:'.tippy-arrow',ROUND_ARROW:'.tippy-roundarrow',REFERENCE:'[data-tippy]'},Re={placement:'top',trigger:'mouseenter focus',animation:'shift-away',html:!1,animateFill:!0,arrow:!1,delay:0,duration:[350,300],interactive:!1,interactiveBorder:2,theme:'dark',size:'regular',distance:10,offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,updateDuration:350,sticky:!1,appendTo:function(){return document.body},zIndex:9999,touchHold:!1,performance:!1,dynamicTitle:!1,flip:!0,flipBehavior:'flip',arrowType:'sharp',arrowTransform:'',maxWidth:'',popperOptions:{},createPopperInstanceOnInit:!1,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){}},Ie=De.supported&&Object.keys(Re),Be=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},He=function(){function e(e,t){for(var o,r=0;r<t.length;r++)o=t[r],o.enumerable=o.enumerable||!1,o.configurable=!0,('value'in o)&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),We=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Me='undefined'!=typeof window&&'undefined'!=typeof document,_e=['Edge','Trident','Firefox'],Ue=0,Ye=0;Ye<_e.length;Ye+=1)if(Me&&0<=navigator.userAgent.indexOf(_e[Ye])){Ue=1;break}var i,Fe=Me&&window.Promise,qe=Fe?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},Ue))}},je=function(){return void 0==i&&(i=-1!==navigator.appVersion.indexOf('MSIE 10')),i},ze=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},Ke=function(){function e(e,t){for(var o,r=0;r<t.length;r++)o=t[r],o.enumerable=o.enumerable||!1,o.configurable=!0,'value'in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}(),Xe=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},Ve=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ge=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],Ze=Ge.slice(3),Je={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},Qe=function(){function e(t,o){var i=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};ze(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=qe(this.update.bind(this)),this.options=Ve({},e.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=o&&o.jquery?o[0]:o,this.options.modifiers={},Object.keys(Ve({},e.Defaults.modifiers,r.modifiers)).forEach(function(t){i.options.modifiers[t]=Ve({},e.Defaults.modifiers[t]||{},r.modifiers?r.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Ve({name:e},i.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&a(e.onLoad)&&e.onLoad(i.reference,i.popper,i.options,e,i.state)}),this.update();var n=this.options.eventsEnabled;n&&this.enableEventListeners(),this.state.eventsEnabled=n}return Ke(e,[{key:'update',value:function(){return B.call(this)}},{key:'destroy',value:function(){return M.call(this)}},{key:'enableEventListeners',value:function(){return F.call(this)}},{key:'disableEventListeners',value:function(){return j.call(this)}}]),e}();Qe.Utils=('undefined'==typeof window?global:window).PopperUtils,Qe.placements=Ge,Qe.Defaults={placement:'bottom',eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split('-')[0],i=t.split('-')[1];if(i){var r=e.offsets,n=r.reference,s=r.popper,a=-1!==['bottom','top'].indexOf(o),p=a?'left':'top',l=a?'width':'height',d={start:Xe({},p,n[p]),end:Xe({},p,n[p]+n[l]-s[l])};e.offsets.popper=Ve({},s,d[i])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var o,i=t.offset,r=e.placement,n=e.offsets,s=n.popper,a=n.reference,p=r.split('-')[0];return o=z(+i)?[+i,0]:Q(i,s,a,p),'left'===p?(s.top+=o[0],s.left-=o[1]):'right'===p?(s.top+=o[0],s.left+=o[1]):'top'===p?(s.left+=o[0],s.top-=o[1]):'bottom'===p&&(s.left+=o[0],s.top+=o[1]),e.popper=s,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||c(e.instance.popper);e.instance.reference===o&&(o=c(o));var i=x(e.instance.popper,e.instance.reference,t.padding,o);t.boundaries=i;var r=t.priority,n=e.offsets.popper,s={primary:function(e){var o=n[e];return n[e]<i[e]&&!t.escapeWithReference&&(o=Se(n[e],i[e])),Xe({},e,o)},secondary:function(e){var o='right'===e?'left':'top',r=n[o];return n[e]>i[e]&&!t.escapeWithReference&&(r=Ae(n[o],i[e]-('right'===e?n.width:n.height))),Xe({},o,r)}};return r.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';n=Ve({},n,s[t](e))}),e.offsets.popper=n,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,r=e.placement.split('-')[0],n=Ce,s=-1!==['top','bottom'].indexOf(r),a=s?'right':'bottom',p=s?'left':'top',l=s?'width':'height';return o[a]<n(i[p])&&(e.offsets.popper[p]=n(i[p])-o[l]),o[p]>n(i[a])&&(e.offsets.popper[p]=n(i[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var o;if(!V(e.instance.modifiers,'arrow','keepTogether'))return e;var i=t.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],n=e.offsets,s=n.popper,a=n.reference,l=-1!==['left','right'].indexOf(r),d=l?'height':'width',c=l?'Top':'Left',f=c.toLowerCase(),m=l?'left':'top',h=l?'bottom':'right',u=S(i)[d];a[h]-u<s[f]&&(e.offsets.popper[f]-=s[f]-(a[h]-u)),a[f]+u>s[h]&&(e.offsets.popper[f]+=a[f]+u-s[h]),e.offsets.popper=E(e.offsets.popper);var g=a[f]+a[d]/2-u/2,b=p(e.instance.popper),y=parseFloat(b['margin'+c],10),v=parseFloat(b['border'+c+'Width'],10),w=g-e.offsets.popper[f]-y-v;return w=Se(Ae(s[d]-u,w),0),e.arrowElement=i,e.offsets.arrow=(o={},Xe(o,f,ke(w)),Xe(o,m,''),o),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(H(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=x(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],r=P(i),n=e.placement.split('-')[1]||'',s=[];switch(t.behavior){case Je.FLIP:s=[i,r];break;case Je.CLOCKWISE:s=Z(i);break;case Je.COUNTERCLOCKWISE:s=Z(i,!0);break;default:s=t.behavior;}return s.forEach(function(a,p){if(i!==a||s.length===p+1)return e;i=e.placement.split('-')[0],r=P(i);var l=e.offsets.popper,d=e.offsets.reference,c=Ce,f='left'===i&&c(l.right)>c(d.left)||'right'===i&&c(l.left)<c(d.right)||'top'===i&&c(l.bottom)>c(d.top)||'bottom'===i&&c(l.top)<c(d.bottom),m=c(l.left)<c(o.left),h=c(l.right)>c(o.right),u=c(l.top)<c(o.top),g=c(l.bottom)>c(o.bottom),b='left'===i&&m||'right'===i&&h||'top'===i&&u||'bottom'===i&&g,y=-1!==['top','bottom'].indexOf(i),v=!!t.flipVariations&&(y&&'start'===n&&m||y&&'end'===n&&h||!y&&'start'===n&&u||!y&&'end'===n&&g);(f||b||v)&&(e.flipped=!0,(f||b)&&(i=s[p+1]),v&&(n=G(n)),e.placement=i+(n?'-'+n:''),e.offsets.popper=Ve({},e.offsets.popper,D(e.instance.popper,e.offsets.reference,e.placement)),e=I(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,r=i.popper,n=i.reference,s=-1!==['left','right'].indexOf(o),a=-1===['top','left'].indexOf(o);return r[s?'left':'top']=n[o]-(a?r[s?'width':'height']:0),e.placement=P(t),e.offsets.popper=E(r),e}},hide:{order:800,enabled:!0,fn:function(e){if(!V(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=N(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,i=t.y,r=e.offsets.popper,n=N(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==n&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var s,a,p=void 0===n?t.gpuAcceleration:n,l=c(e.instance.popper),d=w(l),f={position:r.position},m={left:Ce(r.left),top:Ce(r.top),bottom:Ce(r.bottom),right:Ce(r.right)},h='bottom'===o?'top':'bottom',u='right'===i?'left':'right',g=W('transform');if(a='bottom'==h?-d.height+m.bottom:m.top,s='right'==u?-d.width+m.right:m.left,p&&g)f[g]='translate3d('+s+'px, '+a+'px, 0)',f[h]=0,f[u]=0,f.willChange='transform';else{var b='bottom'==h?-1:1,y='right'==u?-1:1;f[h]=a*b,f[u]=s*y,f.willChange=h+', '+u}var v={"x-placement":e.placement};return e.attributes=Ve({},v,e.attributes),e.styles=Ve({},f,e.styles),e.arrowStyles=Ve({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return K(e.instance.popper,e.styles),X(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&K(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,i,r){var n=C(r,t,e),s=A(o.placement,n,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',s),K(t,{position:'absolute'}),o},gpuAcceleration:void 0}}};var $e={};if(Pe){var et=Element.prototype;$e=et.matches||et.matchesSelector||et.webkitMatchesSelector||et.mozMatchesSelector||et.msMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=t.length;0<=--o&&t.item(o)!==this;);return-1<o}}var e=$e,tt=function(){function e(t){for(var o in Be(this,e),t)this[o]=t[o];this.state={destroyed:!1,visible:!1,enabled:!0}}return He(e,[{key:'enable',value:function(){this.state.enabled=!0}},{key:'disable',value:function(){this.state.enabled=!1}},{key:'show',value:function(e){var t=this;if(!this.state.destroyed&&this.state.enabled){var o=this.popper,i=this.reference,r=this.options,n=re(o),s=n.tooltip,a=n.backdrop,p=n.content;return i.refObj||document.body.contains(i)?void(r.onShow.call(o),e=ve(void 0===e?r.duration:e,0),we([o,s,a],0),ue(this),o.style.visibility='visible',this.state.visible=!0,ie(function(){t.state.visible&&((!r.followCursor||De.usingTouch)&&(t.popperInstance.update(),we([o],r.updateDuration)),we([s,a],e),a&&(p.style.opacity=1,a.offsetHeight),r.interactive&&i.classList.add('tippy-active'),r.sticky&&ge(t),Ee([s,a],'visible'),be(t,e,function(){t.state.visible&&(!r.updateDuration&&s.classList.add('tippy-notransition'),r.interactive&&o.focus(),r.onShown.call(o))}))})):void this.destroy()}}},{key:'hide',value:function(e){var t=this;if(!this.state.destroyed&&this.state.enabled){var o=this.popper,i=this.reference,r=this.options,n=re(o),s=n.tooltip,a=n.backdrop,p=n.content;r.onHide.call(o),e=ve(void 0===e?r.duration:e,1),r.updateDuration||s.classList.remove('tippy-notransition'),r.interactive&&i.classList.remove('tippy-active'),o.style.visibility='hidden',this.state.visible=!1,we([s,a,a?p:null],e),a&&(p.style.opacity=0),Ee([s,a],'hidden'),r.interactive&&-1<r.trigger.indexOf('click')&&ye(i)&&i.focus(),be(this,e,function(){t.state.visible||'1'===getComputedStyle(s).opacity||(t.popperInstance.disableEventListeners(),document.removeEventListener('mousemove',t._followCursorListener),r.appendTo.removeChild(o),r.onHidden.call(o))})}}},{key:'destroy',value:function(){var e=this;this.state.destroyed||(this.state.visible&&this.hide(0),this.listeners.forEach(function(t){e.reference.removeEventListener(t.event,t.handler)}),this.reference.setAttribute('title',this.reference.getAttribute('data-original-title')),delete this.reference._tippy,['data-original-title','data-tippy','aria-describedby'].forEach(function(t){e.reference.removeAttribute(t)}),this.popperInstance&&this.popperInstance.destroy(),this._mutationObservers.forEach(function(e){e.disconnect()}),this.state.destroyed=!0)}}]),e}(),ot=1;return xe.browser=De,xe.defaults=Re,xe}); |
@@ -1,1 +0,1526 @@ | ||
(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?module.exports=b(require('popper.js')):'function'==typeof define&&define.amd?define(['popper.js'],b):a.tippy=b(a.Popper)})(this,function(a){'use strict';function b(a){L.forEach(function(b){var c=b.popper,d=b.tippyInstance,e=b.settings,f=e.appendTo,g=e.hideOnClick,h=e.trigger;if(f.contains(c)){var i=!0===g||-1!==h.indexOf('focus'),j=!a||c!==a.popper;i&&j&&d.hide(c)}})}function c(a,b){var c=Element.prototype.closest||function(a){for(var b=this;b;){if(e.call(b,a))return b;b=b.parentElement}};return c.call(a,b)}function d(a,b){return Array.prototype.find?a.find(b):a.filter(b)[0]}function f(){var a=function(){K.touch=!0,K.iOS()&&document.body.classList.add('tippy-touch'),K.dynamicInputDetection&&window.performance&&document.addEventListener('mousemove',f)},f=function(){var a;return function(){var b=performance.now();20>b-a&&(K.touch=!1,document.removeEventListener('mousemove',f),!K.iOS()&&document.body.classList.remove('tippy-touch')),a=b}}();document.addEventListener('click',function(a){if(!(a.target instanceof Element))return b();var e=c(a.target,M.TOOLTIPPED_EL),f=c(a.target,M.POPPER);if(f){var g=d(L,function(a){return a.popper===f}),h=g.settings.interactive;if(h)return}if(e){var i=d(L,function(a){return a.el===e}),j=i.settings,k=j.hideOnClick,l=j.multiple,m=j.trigger;if(!l&&K.touch||!l&&-1!==m.indexOf('click'))return b(i);if(!0!==k||-1!==m.indexOf('click'))return}c(a.target,M.CONTROLLER)||!document.querySelector(M.POPPER)||b()}),document.addEventListener('touchstart',a),window.addEventListener('blur',function(){var a=document,b=a.activeElement;b&&b.blur&&e.call(b,M.TOOLTIPPED_EL)&&b.blur()}),!K.SUPPORTS_TOUCH&&(0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&document.addEventListener('pointerdown',a)}function g(){return!g.done&&(g.done=!0,f(),!0)}function h(a){window.requestAnimationFrame(function(){setTimeout(a,0)})}function i(a){for(var b=[!1,'webkit'],c=a.charAt(0).toUpperCase()+a.slice(1),d=0;d<b.length;d++){var e=b[d],f=e?''+e+c:a;if('undefined'!=typeof window.document.body.style[f])return f}return null}function j(a,b){return Array.prototype.findIndex?a.findIndex(b):a.indexOf(d(a,b))}function k(a){var b=a.getAttribute('title');b&&a.setAttribute('data-original-title',b),a.removeAttribute('title')}function l(a){var b=a.getBoundingClientRect();return 0<=b.top&&0<=b.left&&b.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&b.right<=(window.innerWidth||document.documentElement.clientWidth)}function m(a,b){b?window.getComputedStyle(b)[i('transform')]:window.getComputedStyle(a).opacity}function n(a,b){a.forEach(function(a){a&&b(a.classList)})}function o(a){return{tooltip:a.querySelector(M.TOOLTIP),circle:a.querySelector(M.CIRCLE),content:a.querySelector(M.CONTENT)}}function p(a,b){a.forEach(function(a){if(a){var c=e.call(a,M.CONTENT),d=c?J(b/1.3):b;a.style[i('transitionDuration')]=d+'ms'}})}function q(a){return'visible'===a.style.visibility}function r(){}function s(a){return!!a&&'[object Object]'===a.toString()}function t(a){return a.replace(/-.+/,'')}function u(a){var b,c,e=this,f=d(L,function(a){return a.el===e}),g=f.popper,h=f.settings.offset,j=t(g.getAttribute('x-placement')),k=J(g.offsetWidth/2),l=J(g.offsetHeight/2),m=5,n=document.documentElement.offsetWidth||document.body.offsetWidth,o=a.pageX,p=a.pageY;'top'===j?(b=o-k+h,c=p-2*l):'bottom'===j?(b=o-k+h,c=p+10):'left'===j?(b=o-2*k,c=p-l+h):'right'===j?(b=o+5,c=p-l+h):void 0;('top'===j||'bottom'===j)&&(o+m+k+h>n&&(b=n-m-2*k),0>o-m-k+h&&(b=m)),g.style[i('transform')]='translate3d('+b+'px, '+c+'px, 0)'}function v(a){if(a instanceof Element||s(a))return[a];if(a instanceof NodeList)return[].slice.call(a);if(Array.isArray(a))return a;try{return[].slice.call(document.querySelectorAll(a))}catch(a){return[]}}function w(a,b,c){if(!b)return c();var d=o(a.popper),f=d.tooltip,g=!1,h=function(a){f[a+'EventListener']('webkitTransitionEnd',e),f[a+'EventListener']('transitionend',e)},e=function(a){a.target!==f||g||(g=!0,h('remove'),c())};h('add'),clearTimeout(a._transitionendTimeout),a._transitionendTimeout=setTimeout(function(){g||(h('remove'),c())},b)}function x(a){return-(a-N.distance)+'px'}function y(b){var c=b.el,d=b.popper,e=b.settings,f=e.position,g=e.popperOptions,j=e.offset,k=e.distance,l=e.flipDuration,m=o(d),n=m.tooltip,p=T({placement:f},g||{},{modifiers:T({},g?g.modifiers:{},{flip:T({padding:k+5},g&&g.modifiers?g.modifiers.flip:{}),offset:T({offset:j},g&&g.modifiers?g.modifiers.offset:{})}),onUpdate:function(){var a=n.style;a.top='',a.bottom='',a.left='',a.right='',a[t(d.getAttribute('x-placement'))]=x(k)}});if(window.MutationObserver){var q=d.style,r=new MutationObserver(function(){q[i('transitionDuration')]='0ms',b.popperInstance.update(),h(function(){q[i('transitionDuration')]=l+'ms'})});r.observe(d,{childList:!0,subtree:!0,characterData:!0}),b._mutationObservers.push(r)}return new a(c,d,p)}function z(a){var b=a.el,c=a.popper,d=a.settings,e=d.appendTo,f=d.followCursor;e.contains(c)||(e.appendChild(c),a.popperInstance?(a.popperInstance.update(),(!f||K.touch)&&a.popperInstance.enableEventListeners()):a.popperInstance=y(a),f&&!K.touch&&(b.addEventListener('mousemove',u),a.popperInstance.disableEventListeners()))}function A(a){var b=a.popper,c=a.popperInstance,d=a.settings.stickyDuration,e=function(){return b.style[i('transitionDuration')]=d+'ms'},f=function(){return b.style[i('transitionDuration')]=''};h(function a(){c&&c.scheduleUpdate(),e(),q(b)?window.requestAnimationFrame(a):f()})}function B(a,b){var c=O.reduce(function(c,d){var e=a.getAttribute('data-'+d.toLowerCase())||b[d];return'false'===e&&(e=!1),'true'===e&&(e=!0),isFinite(e)&&!isNaN(parseFloat(e))&&(e=parseFloat(e)),'string'==typeof e&&'['===e.trim().charAt(0)&&(e=JSON.parse(e)),c[d]=e,c},{});return T({},b,c)}function C(a,b,c){var d=c.position,e=c.distance,f=c.arrow,g=c.animateFill,h=c.inertia,i=c.animation,j=c.arrowSize,k=c.size,l=c.theme,m=c.html,n=c.zIndex,o=c.interactive,p=document.createElement('div');p.setAttribute('class','tippy-popper'),p.setAttribute('role','tooltip'),p.setAttribute('aria-hidden','true'),p.setAttribute('id','tippy-tooltip-'+a),p.style.zIndex=n;var q=document.createElement('div');if(q.setAttribute('class','tippy-tooltip tippy-tooltip--'+k+' leave'),q.setAttribute('data-animation',i),l.split(' ').forEach(function(a){q.classList.add(a+'-theme')}),f){var r=document.createElement('div');r.setAttribute('class','arrow-'+j),r.setAttribute('x-arrow',''),q.appendChild(r)}if(g){q.setAttribute('data-animatefill','');var s=document.createElement('div');s.setAttribute('class','leave'),s.setAttribute('x-circle',''),q.appendChild(s)}h&&q.setAttribute('data-inertia',''),o&&q.setAttribute('data-interactive','');var u=document.createElement('div');if(u.setAttribute('class','tippy-tooltip-content'),m){var v;m instanceof Element?(u.appendChild(m),v='#'+m.id||'tippy-html-template'):(u.innerHTML=document.getElementById(m.replace('#','')).innerHTML,v=m),p.classList.add('html-template'),o&&p.setAttribute('tabindex','-1'),q.setAttribute('data-template-id',v)}else u.innerHTML=b;return q.style[t(d)]=x(e),q.appendChild(u),p.appendChild(q),p}function D(a,b,c,d){var e=[];return'manual'===a?e:(b.addEventListener(a,c.handleTrigger),e.push({event:a,handler:c.handleTrigger}),'mouseenter'===a&&(K.SUPPORTS_TOUCH&&d&&(b.addEventListener('touchstart',c.handleTrigger),e.push({event:'touchstart',handler:c.handleTrigger}),b.addEventListener('touchend',c.handleMouseleave),e.push({event:'touchend',handler:c.handleMouseleave})),b.addEventListener('mouseleave',c.handleMouseleave),e.push({event:'mouseleave',handler:c.handleMouseleave})),'focus'===a&&(b.addEventListener('blur',c.handleBlur),e.push({event:'blur',handler:c.handleBlur})),e)}function E(a,b,c){if(!b.getAttribute('x-placement'))return!0;var d=a.clientX,e=a.clientY,f=c.interactiveBorder,g=c.distance,h=b.getBoundingClientRect(),i=t(b.getAttribute('x-placement')),j=f+g,k={top:h.top-e>f,bottom:e-h.bottom>f,left:h.left-d>f,right:d-h.right>f};return'top'===i?k.top=h.top-e>j:'bottom'===i?k.bottom=e-h.bottom>j:'left'===i?k.left=h.left-d>j:'right'===i?k.right=d-h.right>j:void 0,k.top||k.bottom||k.left||k.right}function F(a,b,d){var e,f,g=this,h=d.position,i=d.delay,j=d.duration,k=d.interactive,l=d.interactiveBorder,m=d.distance,n=d.hideOnClick,o=d.trigger,p=d.touchHold,r=d.touchWait,s=function(){clearTimeout(e),clearTimeout(f)},t=function(){if(s(),!q(b)){var a=Array.isArray(i)?i[0]:i;i?e=setTimeout(function(){return g.show(b)},a):g.show(b)}},u=function(a){return g.callbacks.wait?g.callbacks.wait.call(b,t,a):t()},v=function(){s();var a=Array.isArray(i)?i[1]:i;i?f=setTimeout(function(){return g.hide(b)},a):g.hide(b)};return{handleTrigger:function(c){var d='mouseenter'===c.type&&K.SUPPORTS_TOUCH&&K.touch;if(!(d&&p)){var e='click'===c.type;e&&q(b)&&'persistent'!==n?v():u(c),d&&K.iOS()&&a.click&&a.click()}},handleMouseleave:function(e){if(!('mouseleave'===e.type&&K.SUPPORTS_TOUCH&&K.touch&&p)){if(k){var f=function e(f){var g=function(){document.body.removeEventListener('mouseleave',v),document.removeEventListener('mousemove',e),v()},h=c(f.target,M.TOOLTIPPED_EL),i=c(f.target,M.POPPER)===b,j=-1!==o.indexOf('click');return h&&h!==a?g():void(i||h===a||j||E(f,b,d)&&g())};return document.body.addEventListener('mouseleave',v),void document.addEventListener('mousemove',f)}v()}},handleBlur:function(a){!a.relatedTarget||K.touch||c(a.relatedTarget,M.POPPER)||v()}}}function G(a){return a.arrow&&(a.animateFill=!1),a.appendTo&&'function'==typeof a.appendTo&&(a.appendTo=a.appendTo()),a}function H(a){var b=this;return a.reduce(function(a,c){var d=U,e=T({},G(b.settings.performance?b.settings:B(c,b.settings)));'function'==typeof e.html&&(e.html=e.html(c));var f=e.html,g=e.trigger,h=e.touchHold,i=e.dynamicTitle,j=c.getAttribute('title');if(!j&&!f)return a;c.setAttribute('data-tooltipped',''),c.setAttribute('aria-describedby','tippy-tooltip-'+d),k(c);var l=C(d,j,e),m=F.call(b,c,l,e),n=[];g.trim().split(' ').forEach(function(a){return n=n.concat(D(a,c,m,h))});var p;if(i&&window.MutationObserver){var q=o(l),r=q.content;p=new MutationObserver(function(){var a=c.getAttribute('title');a&&(r.innerHTML=a,k(c))}),p.observe(c,{attributes:!0})}return a.push({id:d,el:c,popper:l,settings:e,listeners:n,tippyInstance:b,_mutationObservers:[p]}),U++,a},[])}function I(a,b){return s(a)&&(a={refObj:!0,attributes:a.attributes||{},getBoundingClientRect:a.getBoundingClientRect,clientWidth:a.clientWidth,clientHeight:a.clientHeight,setAttribute:function(b,c){a.attributes[b]=c},getAttribute:function(b){return a.attributes[b]},removeAttribute:function(b){delete a.attributes[b]},addEventListener:function(){},removeEventListener:function(){},classList:{classNames:{},add:function(b){a.classList.classNames[b]=!0},remove:function(b){return a.classList.classNames[b]=!1,!0},contains:function(b){return!!a.classList.classNames[b]}}}),new V(a,b)}var J=Math.round;a=a&&a.hasOwnProperty('default')?a['default']:a;var K={};'undefined'!=typeof window&&(K.SUPPORTED='requestAnimationFrame'in window,K.SUPPORTS_TOUCH='ontouchstart'in window,K.touch=!1,K.dynamicInputDetection=!0,K.iOS=function(){return /iPhone|iPad|iPod/.test(navigator.userAgent)&&!window.MSStream});var L=[],M={POPPER:'.tippy-popper',TOOLTIP:'.tippy-tooltip',CONTENT:'.tippy-tooltip-content',CIRCLE:'[x-circle]',ARROW:'[x-arrow]',TOOLTIPPED_EL:'[data-tooltipped]',CONTROLLER:'[data-tippy-controller]'},N={html:!1,position:'top',animation:'shift',animateFill:!0,arrow:!1,arrowSize:'regular',delay:0,trigger:'mouseenter focus',duration:350,interactive:!1,interactiveBorder:2,theme:'dark',size:'regular',distance:10,offset:0,hideOnClick:!0,multiple:!1,followCursor:!1,inertia:!1,flipDuration:350,sticky:!1,stickyDuration:200,appendTo:function(){return document.body},zIndex:9999,touchHold:!1,performance:!1,dynamicTitle:!1,popperOptions:{}},O=K.SUPPORTED&&Object.keys(N),P={};if('undefined'!=typeof Element){var Q=Element.prototype;P=Q.matches||Q.matchesSelector||Q.webkitMatchesSelector||Q.mozMatchesSelector||Q.msMatchesSelector||function(a){for(var b=(this.document||this.ownerDocument).querySelectorAll(a),c=b.length;0<=--c&&b.item(c)!==this;);return-1<c}}var e=P,R=function(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')},S=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),T=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},U=1,V=function(){function a(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};R(this,a),K.SUPPORTED&&(g(),this.state={destroyed:!1},this.selector=b,this.settings=T({},N,c),(c.show||c.shown||c.hide||c.hidden)&&console.warn('Callbacks without the `on` prefix are deprecated (with the exception of `wait`). Use onShow, onShown, onHide, and onHidden instead.'),this.callbacks={wait:c.wait,show:c.onShow||c.show||r,shown:c.onShown||c.shown||r,hide:c.onHide||c.hide||r,hidden:c.onHidden||c.hidden||r},this.store=H.call(this,v(b)),L.push.apply(L,this.store))}return S(a,[{key:'getPopperElement',value:function(a){try{return d(this.store,function(b){return b.el===a}).popper}catch(a){console.error('[getPopperElement]: Element passed as the argument does not exist in the instance')}}},{key:'getReferenceElement',value:function(a){try{return d(this.store,function(b){return b.popper===a}).el}catch(a){console.error('[getReferenceElement]: Popper passed as the argument does not exist in the instance')}}},{key:'getReferenceData',value:function(a){return d(this.store,function(b){return b.el===a||b.popper===a})}},{key:'show',value:function(a,b){var c=this;if(!this.state.destroyed){var e=d(this.store,function(b){return b.popper===a}),f=o(a),g=f.tooltip,i=f.circle,j=f.content;if(!this.selector.refObj&&!document.body.contains(e.el))return void this.destroy(a);this.callbacks.show.call(a);var k=e.el,l=e.settings,r=l.appendTo,s=l.sticky,t=l.interactive,u=l.followCursor,v=l.flipDuration,x=l.duration,y=void 0===b?Array.isArray(x)?x[0]:x:b;p([a,g,i],0),z(e),a.style.visibility='visible',a.setAttribute('aria-hidden','false'),h(function(){q(a)&&((!u||K.touch)&&(e.popperInstance.update(),p([a],v)),p([g,i],y),i&&(j.style.opacity=1),t&&k.classList.add('active'),s&&A(e),m(g,i),n([g,i],function(a){a.contains('tippy-notransition')&&a.remove('tippy-notransition'),a.remove('leave'),a.add('enter')}),w(e,y,function(){!q(a)||e._onShownFired||(t&&a.focus(),g.classList.add('tippy-notransition'),e._onShownFired=!0,c.callbacks.shown.call(a))}))})}}},{key:'hide',value:function(a,b){var c=this;if(!this.state.destroyed){this.callbacks.hide.call(a);var e=d(this.store,function(b){return b.popper===a}),f=o(a),g=f.tooltip,h=f.circle,i=f.content,j=e.el,k=e.settings,m=k.appendTo,r=k.sticky,s=k.interactive,t=k.followCursor,v=k.html,x=k.trigger,y=k.duration,z=void 0===b?Array.isArray(y)?y[1]:y:b;e._onShownFired=!1,s&&j.classList.remove('active'),a.style.visibility='hidden',a.setAttribute('aria-hidden','true'),p([g,h,h?i:null],z),h&&(i.style.opacity=0),n([g,h],function(a){a.contains('tippy-tooltip')&&a.remove('tippy-notransition'),a.remove('enter'),a.add('leave')}),v&&-1!==x.indexOf('click')&&l(j)&&j.focus(),w(e,z,function(){q(a)||!m.contains(a)||'1'===getComputedStyle(g).opacity||(j.removeEventListener('mousemove',u),e.popperInstance.disableEventListeners(),m.removeChild(a),c.callbacks.hidden.call(a))})}}},{key:'update',value:function(a){if(!this.state.destroyed){var b=d(this.store,function(b){return b.popper===a}),c=o(a),e=c.content,f=b.el,g=b.settings.html;return g instanceof Element?void console.warn('Aborted: update() should not be used if `html` is a DOM element'):void(e.innerHTML=g?document.getElementById(g.replace('#','')).innerHTML:f.getAttribute('title')||f.getAttribute('data-original-title'),!g&&k(f))}}},{key:'destroy',value:function(a,b){var c=this;if(!this.state.destroyed){var e=d(this.store,function(b){return b.popper===a}),f=e.el,g=e.popperInstance,h=e.listeners,i=e._mutationObservers;q(a)&&this.hide(a,0),h.forEach(function(a){return f.removeEventListener(a.event,a.handler)}),f.setAttribute('title',f.getAttribute('data-original-title')),f.removeAttribute('data-original-title'),f.removeAttribute('data-tooltipped'),f.removeAttribute('aria-describedby'),g&&g.destroy(),i.forEach(function(a){a&&a.disconnect()}),L.splice(j(L,function(b){return b.popper===a}),1),(void 0===b||b)&&(this.store=L.filter(function(a){return a.tippyInstance===c}))}}},{key:'destroyAll',value:function(){var a=this;if(!this.state.destroyed){var b=this.store.length;this.store.forEach(function(c,d){var e=c.popper;a.destroy(e,d===b-1)}),this.store=null,this.state.destroyed=!0}}}]),a}();return I.Browser=K,I.Defaults=N,I.disableDynamicInputDetection=function(){return K.dynamicInputDetection=!1},I.enableDynamicInputDetection=function(){return K.dynamicInputDetection=!0},I}); | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('popper.js')) : | ||
typeof define === 'function' && define.amd ? define(['popper.js'], factory) : | ||
(global.tippy = factory(global.Popper)); | ||
}(this, (function (Popper) { 'use strict'; | ||
Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; | ||
var isBrowser = typeof window !== 'undefined'; | ||
var browser = {}; | ||
if (isBrowser) { | ||
browser.supported = 'requestAnimationFrame' in window; | ||
browser.supportsTouch = 'ontouchstart' in window; | ||
browser.usingTouch = false; | ||
browser.eventsBound = false; | ||
browser.dynamicInputDetection = true; | ||
browser.iOS = /iPhone|iPad|iPod/.test(navigator.platform) && !window.MSStream; | ||
browser.onUserInputChange = function () {}; | ||
} | ||
/** | ||
* Selector constants used for grabbing elements | ||
*/ | ||
var selectors = { | ||
POPPER: '.tippy-popper', | ||
TOOLTIP: '.tippy-tooltip', | ||
CONTENT: '.tippy-content', | ||
BACKDROP: '.tippy-backdrop', | ||
ARROW: '.tippy-arrow', | ||
ROUND_ARROW: '.tippy-roundarrow', | ||
REFERENCE: '[data-tippy]' | ||
/** | ||
* The default options applied to each instance | ||
*/ | ||
};var defaults = { | ||
placement: 'top', | ||
trigger: 'mouseenter focus', | ||
animation: 'shift-away', | ||
html: false, | ||
animateFill: true, | ||
arrow: false, | ||
delay: 0, | ||
duration: [350, 300], | ||
interactive: false, | ||
interactiveBorder: 2, | ||
theme: 'dark', | ||
size: 'regular', | ||
distance: 10, | ||
offset: 0, | ||
hideOnClick: true, | ||
multiple: false, | ||
followCursor: false, | ||
inertia: false, | ||
updateDuration: 350, | ||
sticky: false, | ||
appendTo: function appendTo() { | ||
return document.body; | ||
}, | ||
zIndex: 9999, | ||
touchHold: false, | ||
performance: false, | ||
dynamicTitle: false, | ||
flip: true, | ||
flipBehavior: 'flip', | ||
arrowType: 'sharp', | ||
arrowTransform: '', | ||
maxWidth: '', | ||
popperOptions: {}, | ||
createPopperInstanceOnInit: false, | ||
onShow: function onShow() {}, | ||
onShown: function onShown() {}, | ||
onHide: function onHide() {}, | ||
onHidden: function onHidden() {} | ||
}; | ||
/** | ||
* The keys of the defaults object for reducing down into a new object | ||
* Used in `getIndividualOptions()` | ||
*/ | ||
var defaultsKeys = browser.supported && Object.keys(defaults); | ||
/** | ||
* Determines if a value is an object literal | ||
* @param {*} value | ||
* @return {Boolean} | ||
*/ | ||
function isObjectLiteral(value) { | ||
return Object.prototype.toString.call(value) === '[object Object]'; | ||
} | ||
/** | ||
* Returns an array of elements based on the selector input | ||
* @param {String|Element|Element[]|NodeList|Object} selector | ||
* @return {Element[]} | ||
*/ | ||
function getArrayOfElements(selector) { | ||
if (selector instanceof Element || isObjectLiteral(selector)) { | ||
return [selector]; | ||
} | ||
if (selector instanceof NodeList) { | ||
return [].slice.call(selector); | ||
} | ||
if (Array.isArray(selector)) { | ||
return selector; | ||
} | ||
try { | ||
return [].slice.call(document.querySelectorAll(selector)); | ||
} catch (_) { | ||
return []; | ||
} | ||
} | ||
var classCallCheck = function (instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
}; | ||
var createClass = function () { | ||
function defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
return function (Constructor, protoProps, staticProps) { | ||
if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
}; | ||
}(); | ||
var _extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
/** | ||
* Returns an object of settings to override global settings | ||
* @param {Element} reference | ||
* @param {Object} instanceOptions | ||
* @return {Object} - individual options | ||
*/ | ||
function getIndividualOptions(reference, instanceOptions) { | ||
var options = defaultsKeys.reduce(function (acc, key) { | ||
var val = reference.getAttribute('data-tippy-' + key.toLowerCase()) || instanceOptions[key]; | ||
// Convert strings to booleans | ||
if (val === 'false') val = false; | ||
if (val === 'true') val = true; | ||
// Convert number strings to true numbers | ||
if (isFinite(val) && !isNaN(parseFloat(val))) { | ||
val = parseFloat(val); | ||
} | ||
// Convert array strings to actual arrays | ||
if (typeof val === 'string' && val.trim().charAt(0) === '[') { | ||
val = JSON.parse(val); | ||
} | ||
acc[key] = val; | ||
return acc; | ||
}, {}); | ||
return _extends({}, instanceOptions, options); | ||
} | ||
/** | ||
* Returns the supported prefixed property - only `webkit` is needed, `moz`, `ms` and `o` are obsolete | ||
* @param {String} property | ||
* @return {String} - browser supported prefixed property | ||
*/ | ||
function prefix(property) { | ||
var prefixes = [false, 'webkit']; | ||
var upperProp = property.charAt(0).toUpperCase() + property.slice(1); | ||
for (var i = 0; i < prefixes.length; i++) { | ||
var _prefix = prefixes[i]; | ||
var prefixedProp = _prefix ? '' + _prefix + upperProp : property; | ||
if (typeof document.body.style[prefixedProp] !== 'undefined') { | ||
return prefixedProp; | ||
} | ||
} | ||
return null; | ||
} | ||
/** | ||
* Creates a popper element then returns it | ||
* @param {Number} id - the popper id | ||
* @param {String} title - the tooltip's `title` attribute | ||
* @param {Object} options - individual options | ||
* @return {Element} - the popper element | ||
*/ | ||
function createPopperElement(id, title, options) { | ||
var placement = options.placement, | ||
distance = options.distance, | ||
arrow = options.arrow, | ||
arrowType = options.arrowType, | ||
arrowTransform = options.arrowTransform, | ||
animateFill = options.animateFill, | ||
inertia = options.inertia, | ||
animation = options.animation, | ||
size = options.size, | ||
theme = options.theme, | ||
html = options.html, | ||
zIndex = options.zIndex, | ||
interactive = options.interactive, | ||
maxWidth = options.maxWidth; | ||
var popper = document.createElement('div'); | ||
popper.setAttribute('class', 'tippy-popper'); | ||
popper.setAttribute('role', 'tooltip'); | ||
popper.setAttribute('id', 'tippy-' + id); | ||
popper.style.zIndex = zIndex; | ||
popper.style.maxWidth = maxWidth; | ||
var tooltip = document.createElement('div'); | ||
tooltip.setAttribute('class', 'tippy-tooltip'); | ||
tooltip.setAttribute('data-size', size); | ||
tooltip.setAttribute('data-animation', animation); | ||
tooltip.setAttribute('data-state', 'hidden'); | ||
theme.split(' ').forEach(function (t) { | ||
tooltip.classList.add(t + '-theme'); | ||
}); | ||
if (arrow) { | ||
var _arrow = document.createElement('div'); | ||
_arrow.style[prefix('transform')] = arrowTransform; | ||
if (arrowType === 'round') { | ||
_arrow.classList.add('tippy-roundarrow'); | ||
_arrow.innerHTML = '\n <svg width="100%" height="100%" viewBox="0 0 64 20" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">\n <g transform="matrix(1.04009,0,0,1.45139,-1.26297,-65.9145)">\n <path d="M1.214,59.185C1.214,59.185 12.868,59.992 21.5,51.55C29.887,43.347 33.898,43.308 42.5,51.55C51.352,60.031 62.747,59.185 62.747,59.185L1.214,59.185Z"/>\n </g>\n </svg>'; | ||
} else { | ||
_arrow.classList.add('tippy-arrow'); | ||
} | ||
tooltip.appendChild(_arrow); | ||
} | ||
if (animateFill) { | ||
// Create animateFill circle element for animation | ||
tooltip.setAttribute('data-animatefill', ''); | ||
var circle = document.createElement('div'); | ||
circle.setAttribute('data-state', 'hidden'); | ||
circle.classList.add('tippy-backdrop'); | ||
tooltip.appendChild(circle); | ||
} | ||
if (inertia) { | ||
// Change transition timing function cubic bezier | ||
tooltip.setAttribute('data-inertia', ''); | ||
} | ||
if (interactive) { | ||
tooltip.setAttribute('data-interactive', ''); | ||
} | ||
var content = document.createElement('div'); | ||
content.setAttribute('class', 'tippy-content'); | ||
if (html) { | ||
var templateId = void 0; | ||
if (html instanceof Element) { | ||
content.appendChild(html); | ||
templateId = '#' + html.id || 'tippy-html-template'; | ||
} else { | ||
content.innerHTML = document.querySelector(html).innerHTML; | ||
templateId = html; | ||
} | ||
popper.setAttribute('data-html', ''); | ||
interactive && popper.setAttribute('tabindex', '-1'); | ||
tooltip.setAttribute('data-template-id', templateId); | ||
} else { | ||
content.innerHTML = title; | ||
} | ||
tooltip.appendChild(content); | ||
popper.appendChild(tooltip); | ||
return popper; | ||
} | ||
/** | ||
* Transforms the `arrowTransform` numbers based on the placement axis | ||
* @param {String} type 'scale' or 'translate' | ||
* @param {Number[]} numbers | ||
* @param {Boolean} isVertical | ||
* @param {Boolean} isReverse | ||
* @return {String} | ||
*/ | ||
function transformNumbersBasedOnPlacementAxis(type, numbers, isVertical, isReverse) { | ||
if (!numbers.length) return ''; | ||
var transforms = { | ||
scale: function () { | ||
if (numbers.length === 1) { | ||
return '' + numbers[0]; | ||
} else { | ||
return isVertical ? numbers[0] + ', ' + numbers[1] : numbers[1] + ', ' + numbers[0]; | ||
} | ||
}(), | ||
translate: function () { | ||
if (numbers.length === 1) { | ||
return isReverse ? -numbers[0] + 'px' : numbers[0] + 'px'; | ||
} else { | ||
if (isVertical) { | ||
return isReverse ? numbers[0] + 'px, ' + -numbers[1] + 'px' : numbers[0] + 'px, ' + numbers[1] + 'px'; | ||
} else { | ||
return isReverse ? -numbers[1] + 'px, ' + numbers[0] + 'px' : numbers[1] + 'px, ' + numbers[0] + 'px'; | ||
} | ||
} | ||
}() | ||
}; | ||
return transforms[type]; | ||
} | ||
/** | ||
* Transforms the `arrowTransform` x or y axis based on the placement axis | ||
* @param {String} axis 'X', 'Y', '' | ||
* @param {Boolean} isVertical | ||
* @return {String} | ||
*/ | ||
function transformAxis(axis, isVertical) { | ||
if (!axis) return ''; | ||
var map = { | ||
'X': 'Y', | ||
'Y': 'X' | ||
}; | ||
return isVertical ? axis : map[axis]; | ||
} | ||
/** | ||
* Returns the core placement ('top', 'bottom', 'left', 'right') of a popper | ||
* @param {Element} popper | ||
* @return {String} | ||
*/ | ||
function getPopperPlacement(popper) { | ||
return popper.getAttribute('x-placement').replace(/-.+/, ''); | ||
} | ||
/** | ||
* Computes and applies the necessary arrow transform | ||
* @param {Element} popper | ||
* @param {Element} arrow | ||
* @param {String} arrowTransform | ||
*/ | ||
function computeArrowTransform(popper, arrow, arrowTransform) { | ||
var placement = getPopperPlacement(popper); | ||
var isVertical = placement === 'top' || placement === 'bottom'; | ||
var isReverse = placement === 'right' || placement === 'bottom'; | ||
var getAxis = function getAxis(re) { | ||
var match = arrowTransform.match(re); | ||
return match ? match[1] : ''; | ||
}; | ||
var getNumbers = function getNumbers(re) { | ||
var match = arrowTransform.match(re); | ||
return match ? match[1].split(',').map(parseFloat) : []; | ||
}; | ||
var re = { | ||
translate: /translateX?Y?\(([^)]+)\)/, | ||
scale: /scaleX?Y?\(([^)]+)\)/ | ||
}; | ||
var matches = { | ||
translate: { | ||
axis: getAxis(/translate([XY])/), | ||
numbers: getNumbers(re.translate) | ||
}, | ||
scale: { | ||
axis: getAxis(/scale([XY])/), | ||
numbers: getNumbers(re.scale) | ||
} | ||
}; | ||
var computedTransform = arrowTransform.replace(re.translate, 'translate' + transformAxis(matches.translate.axis, isVertical) + '(' + transformNumbersBasedOnPlacementAxis('translate', matches.translate.numbers, isVertical, isReverse) + ')').replace(re.scale, 'scale' + transformAxis(matches.scale.axis, isVertical) + '(' + transformNumbersBasedOnPlacementAxis('scale', matches.scale.numbers, isVertical, isReverse) + ')'); | ||
arrow.style[prefix('transform')] = computedTransform; | ||
} | ||
/** | ||
* Waits until next repaint to execute a fn | ||
* @param {Function} fn | ||
*/ | ||
function defer(fn) { | ||
requestAnimationFrame(function () { | ||
setTimeout(fn, 0); | ||
}); | ||
} | ||
/** | ||
* Returns inner elements of the popper element | ||
* @param {Element} popper | ||
* @return {Object} | ||
*/ | ||
function getInnerElements(popper) { | ||
return { | ||
tooltip: popper.querySelector(selectors.TOOLTIP), | ||
backdrop: popper.querySelector(selectors.BACKDROP), | ||
content: popper.querySelector(selectors.CONTENT) | ||
}; | ||
} | ||
/** | ||
* Returns the distance taking into account the default distance due to | ||
* the transform: translate setting in CSS | ||
* @param {Number} distance | ||
* @return {String} | ||
*/ | ||
function getOffsetDistanceInPx(distance) { | ||
return -(distance - defaults.distance) + 'px'; | ||
} | ||
/** | ||
* Adds a mutation observer to an element and stores it in the instance | ||
* @param {Object} | ||
*/ | ||
function addMutationObserver(_ref) { | ||
var tippy = _ref.tippy, | ||
target = _ref.target, | ||
callback = _ref.callback, | ||
options = _ref.options; | ||
if (!window.MutationObserver) return; | ||
var observer = new MutationObserver(callback); | ||
observer.observe(target, options); | ||
tippy._mutationObservers.push(observer); | ||
} | ||
/** | ||
* Creates a new popper instance | ||
* @param {Tippy} tippy | ||
* @return {Popper} | ||
*/ | ||
function createPopperInstance(tippy) { | ||
var reference = tippy.reference, | ||
popper = tippy.popper, | ||
_tippy$options = tippy.options, | ||
placement = _tippy$options.placement, | ||
popperOptions = _tippy$options.popperOptions, | ||
offset = _tippy$options.offset, | ||
distance = _tippy$options.distance, | ||
updateDuration = _tippy$options.updateDuration, | ||
flip = _tippy$options.flip, | ||
flipBehavior = _tippy$options.flipBehavior, | ||
arrowType = _tippy$options.arrowType, | ||
arrowTransform = _tippy$options.arrowTransform, | ||
sticky = _tippy$options.sticky; | ||
var _getInnerElements = getInnerElements(popper), | ||
tooltip = _getInnerElements.tooltip; | ||
var arrowSelector = arrowType === 'round' ? selectors.ROUND_ARROW : selectors.ARROW; | ||
var arrow = tooltip.querySelector(arrowSelector); | ||
var config = _extends({ | ||
placement: placement | ||
}, popperOptions || {}, { | ||
modifiers: _extends({}, popperOptions ? popperOptions.modifiers : {}, { | ||
arrow: _extends({ | ||
element: arrowSelector | ||
}, popperOptions && popperOptions.modifiers ? popperOptions.modifiers.arrow : {}), | ||
flip: _extends({ | ||
enabled: flip, | ||
padding: distance + 5 /* 5px from viewport boundary */ | ||
, behavior: flipBehavior | ||
}, popperOptions && popperOptions.modifiers ? popperOptions.modifiers.flip : {}), | ||
offset: _extends({ | ||
offset: offset | ||
}, popperOptions && popperOptions.modifiers ? popperOptions.modifiers.offset : {}) | ||
}), | ||
onCreate: function onCreate() { | ||
tooltip.style[getPopperPlacement(popper)] = getOffsetDistanceInPx(distance); | ||
if (arrow && arrowTransform) { | ||
computeArrowTransform(popper, arrow, arrowTransform); | ||
} | ||
}, | ||
onUpdate: function onUpdate() { | ||
if (!tippy.state.visible && !sticky && getComputedStyle(tooltip).opacity === '0') { | ||
return tippy.hide(0); | ||
} | ||
var styles = tooltip.style; | ||
styles.top = ''; | ||
styles.bottom = ''; | ||
styles.left = ''; | ||
styles.right = ''; | ||
styles[getPopperPlacement(popper)] = getOffsetDistanceInPx(distance); | ||
if (arrow && arrowTransform) { | ||
computeArrowTransform(popper, arrow, arrowTransform); | ||
} | ||
} | ||
}); | ||
addMutationObserver({ | ||
tippy: tippy, | ||
target: popper, | ||
callback: function callback() { | ||
var styles = popper.style; | ||
styles[prefix('transitionDuration')] = '0ms'; | ||
tippy.popperInstance.update(); | ||
defer(function () { | ||
styles[prefix('transitionDuration')] = updateDuration + 'ms'; | ||
}); | ||
}, | ||
options: { | ||
childList: true, | ||
subtree: true, | ||
characterData: true | ||
} | ||
}); | ||
return new Popper(reference, popper, config); | ||
} | ||
/** | ||
* Creates a trigger by adding the necessary event listeners to the reference element | ||
* @param {String} eventType - the custom event specified in the `trigger` setting | ||
* @param {Element} reference | ||
* @param {Object} handlers - the handlers for each event | ||
* @param {Boolean} touchHold | ||
* @return {Array} - array of listener objects | ||
*/ | ||
function createTrigger(eventType, reference, handlers, touchHold) { | ||
var listeners = []; | ||
if (eventType === 'manual') return listeners; | ||
// Show | ||
reference.addEventListener(eventType, handlers.handleTrigger); | ||
listeners.push({ | ||
event: eventType, | ||
handler: handlers.handleTrigger | ||
}); | ||
// Hide | ||
if (eventType === 'mouseenter') { | ||
if (browser.supportsTouch && touchHold) { | ||
reference.addEventListener('touchstart', handlers.handleTrigger); | ||
listeners.push({ | ||
event: 'touchstart', | ||
handler: handlers.handleTrigger | ||
}); | ||
reference.addEventListener('touchend', handlers.handleMouseleave); | ||
listeners.push({ | ||
event: 'touchend', | ||
handler: handlers.handleMouseleave | ||
}); | ||
} | ||
reference.addEventListener('mouseleave', handlers.handleMouseleave); | ||
listeners.push({ | ||
event: 'mouseleave', | ||
handler: handlers.handleMouseleave | ||
}); | ||
} | ||
if (eventType === 'focus') { | ||
reference.addEventListener('blur', handlers.handleBlur); | ||
listeners.push({ | ||
event: 'blur', | ||
handler: handlers.handleBlur | ||
}); | ||
} | ||
return listeners; | ||
} | ||
var matches = {}; | ||
if (isBrowser) { | ||
var e = Element.prototype; | ||
matches = e.matches || e.matchesSelector || e.webkitMatchesSelector || e.mozMatchesSelector || e.msMatchesSelector || function (s) { | ||
var matches = (this.document || this.ownerDocument).querySelectorAll(s); | ||
var i = matches.length; | ||
while (--i >= 0 && matches.item(i) !== this) {} | ||
return i > -1; | ||
}; | ||
} | ||
var matches$1 = matches; | ||
/** | ||
* Ponyfill to get the closest parent element | ||
* @param {Element} element - child of parent to be returned | ||
* @param {String} parentSelector - selector to match the parent if found | ||
* @return {Element} | ||
*/ | ||
function closest(element, parentSelector) { | ||
var fn = Element.prototype.closest || function (selector) { | ||
var el = this; | ||
while (el) { | ||
if (matches$1.call(el, selector)) { | ||
return el; | ||
} | ||
el = el.parentElement; | ||
} | ||
}; | ||
return fn.call(element, parentSelector); | ||
} | ||
/** | ||
* Determines if the mouse's cursor is outside the interactive border | ||
* @param {MouseEvent} event | ||
* @param {Element} popper | ||
* @param {Object} options | ||
* @return {Boolean} | ||
*/ | ||
function cursorIsOutsideInteractiveBorder(event, popper, options) { | ||
if (!popper.getAttribute('x-placement')) return true; | ||
var x = event.clientX, | ||
y = event.clientY; | ||
var interactiveBorder = options.interactiveBorder, | ||
distance = options.distance; | ||
var rect = popper.getBoundingClientRect(); | ||
var placement = getPopperPlacement(popper); | ||
var borderWithDistance = interactiveBorder + distance; | ||
var exceeds = { | ||
top: rect.top - y > interactiveBorder, | ||
bottom: y - rect.bottom > interactiveBorder, | ||
left: rect.left - x > interactiveBorder, | ||
right: x - rect.right > interactiveBorder | ||
}; | ||
switch (placement) { | ||
case 'top': | ||
exceeds.top = rect.top - y > borderWithDistance; | ||
break; | ||
case 'bottom': | ||
exceeds.bottom = y - rect.bottom > borderWithDistance; | ||
break; | ||
case 'left': | ||
exceeds.left = rect.left - x > borderWithDistance; | ||
break; | ||
case 'right': | ||
exceeds.right = x - rect.right > borderWithDistance; | ||
break; | ||
} | ||
return exceeds.top || exceeds.bottom || exceeds.left || exceeds.right; | ||
} | ||
/** | ||
* Returns relevant listeners for each Tippy instance | ||
* @param {Tippy} tippy | ||
* @param {Object} options | ||
* @return {Object} of listeners | ||
*/ | ||
function getEventListeners(tippy, options) { | ||
var popper = tippy.popper, | ||
reference = tippy.reference, | ||
_tippy$options = tippy.options, | ||
delay = _tippy$options.delay, | ||
duration = _tippy$options.duration, | ||
interactive = _tippy$options.interactive, | ||
interactiveBorder = _tippy$options.interactiveBorder, | ||
hideOnClick = _tippy$options.hideOnClick, | ||
trigger = _tippy$options.trigger, | ||
touchHold = _tippy$options.touchHold; | ||
var showDelay = void 0, | ||
hideDelay = void 0; | ||
var clearTimeouts = function clearTimeouts() { | ||
clearTimeout(showDelay); | ||
clearTimeout(hideDelay); | ||
}; | ||
var _show = function _show() { | ||
clearTimeouts(); | ||
if (tippy.state.visible) return; | ||
var _delay = Array.isArray(delay) ? delay[0] : delay; | ||
if (delay) { | ||
showDelay = setTimeout(function () { | ||
return tippy.show(); | ||
}, _delay); | ||
} else { | ||
tippy.show(); | ||
} | ||
}; | ||
var show = function show(event) { | ||
tippy.options.wait ? tippy.options.wait.call(popper, _show, event) : _show(); | ||
}; | ||
var hide = function hide() { | ||
clearTimeouts(); | ||
if (!tippy.state.visible) return; | ||
var _delay = Array.isArray(delay) ? delay[1] : delay; | ||
if (delay) { | ||
hideDelay = setTimeout(function () { | ||
if (!tippy.state.visible) return; | ||
tippy.hide(); | ||
}, _delay); | ||
} else { | ||
tippy.hide(); | ||
} | ||
}; | ||
var handleTrigger = function handleTrigger(event) { | ||
var shouldStopEvent = browser.supportsTouch && browser.usingTouch && (event.type === 'mouseenter' || event.type === 'focus'); | ||
if (shouldStopEvent && touchHold) return; | ||
tippy._lastTriggerEvent = event.type; | ||
// Toggle show/hide when clicking click-triggered tooltips | ||
var isClick = event.type === 'click'; | ||
var isNotPersistent = hideOnClick !== 'persistent'; | ||
isClick && tippy.state.visible && isNotPersistent ? hide() : show(event); | ||
// iOS prevents click events from firing | ||
if (shouldStopEvent && browser.iOS && reference.click) { | ||
reference.click(); | ||
} | ||
}; | ||
var handleMouseleave = function handleMouseleave(event) { | ||
if (event.type === 'mouseleave' && browser.supportsTouch && browser.usingTouch && touchHold) return; | ||
if (interactive) { | ||
// Temporarily handle mousemove to check if the mouse left somewhere other than the popper | ||
var handleMousemove = function handleMousemove(event) { | ||
var referenceCursorIsOver = closest(event.target, selectors.REFERENCE); | ||
var cursorIsOverPopper = closest(event.target, selectors.POPPER) === popper; | ||
var cursorIsOverReference = referenceCursorIsOver === reference; | ||
if (cursorIsOverPopper || cursorIsOverReference) return; | ||
if (cursorIsOutsideInteractiveBorder(event, popper, options)) { | ||
document.body.removeEventListener('mouseleave', hide); | ||
document.removeEventListener('mousemove', handleMousemove); | ||
hide(); | ||
} | ||
}; | ||
document.body.addEventListener('mouseleave', hide); | ||
document.addEventListener('mousemove', handleMousemove); | ||
return; | ||
} | ||
hide(); | ||
}; | ||
var handleBlur = function handleBlur(event) { | ||
if (!event.relatedTarget || browser.usingTouch) return; | ||
if (closest(event.relatedTarget, selectors.POPPER)) return; | ||
hide(); | ||
}; | ||
return { | ||
handleTrigger: handleTrigger, | ||
handleMouseleave: handleMouseleave, | ||
handleBlur: handleBlur | ||
}; | ||
} | ||
/** | ||
* Evaluates/modifies the options object for appropriate behavior | ||
* @param {Element|Object} reference | ||
* @param {Object} options | ||
* @return {Object} modified/evaluated options | ||
*/ | ||
function evaluateOptions(reference, options) { | ||
// animateFill is disabled if an arrow is true | ||
if (options.arrow) { | ||
options.animateFill = false; | ||
} | ||
if (options.appendTo && typeof options.appendTo === 'function') { | ||
options.appendTo = options.appendTo(); | ||
} | ||
if (typeof options.html === 'function') { | ||
options.html = options.html(reference); | ||
} | ||
return options; | ||
} | ||
/** | ||
* Removes the title from an element, setting `data-original-title` | ||
* appropriately | ||
* @param {Element} el | ||
*/ | ||
function removeTitle(el) { | ||
var title = el.getAttribute('title'); | ||
// Only set `data-original-title` attr if there is a title | ||
if (title) { | ||
el.setAttribute('data-original-title', title); | ||
} | ||
el.removeAttribute('title'); | ||
} | ||
/** | ||
* Ponyfill for Array.prototype.find | ||
* @param {Array} arr | ||
* @param {Function} fn | ||
* @return item in the array | ||
*/ | ||
/** | ||
* Creates a mousemove event listener function for `followCursor` option | ||
* @param {Tippy} tippy | ||
* @return {Function} the event listener | ||
*/ | ||
function createFollowCursorListener(tippy) { | ||
var listener = function listener(e) { | ||
if (tippy._lastTriggerEvent === 'focus') return; | ||
var popper = tippy.popper, | ||
offset = tippy.options.offset; | ||
var placement = getPopperPlacement(popper); | ||
var halfPopperWidth = Math.round(popper.offsetWidth / 2); | ||
var halfPopperHeight = Math.round(popper.offsetHeight / 2); | ||
var viewportPadding = 5; | ||
var pageWidth = document.documentElement.offsetWidth || document.body.offsetWidth; | ||
var pageX = e.pageX, | ||
pageY = e.pageY; | ||
var x = void 0, | ||
y = void 0; | ||
switch (placement) { | ||
case 'top': | ||
x = pageX - halfPopperWidth + offset; | ||
y = pageY - 2 * halfPopperHeight; | ||
break; | ||
case 'bottom': | ||
x = pageX - halfPopperWidth + offset; | ||
y = pageY + 10; | ||
break; | ||
case 'left': | ||
x = pageX - 2 * halfPopperWidth; | ||
y = pageY - halfPopperHeight + offset; | ||
break; | ||
case 'right': | ||
x = pageX + 5; | ||
y = pageY - halfPopperHeight + offset; | ||
break; | ||
} | ||
var isRightOverflowing = pageX + viewportPadding + halfPopperWidth + offset > pageWidth; | ||
var isLeftOverflowing = pageX - viewportPadding - halfPopperWidth + offset < 0; | ||
// Prevent left/right overflow | ||
if (placement === 'top' || placement === 'bottom') { | ||
if (isRightOverflowing) { | ||
x = pageWidth - viewportPadding - 2 * halfPopperWidth; | ||
} | ||
if (isLeftOverflowing) { | ||
x = viewportPadding; | ||
} | ||
} | ||
popper.style[prefix('transform')] = 'translate3d(' + x + 'px, ' + y + 'px, 0)'; | ||
}; | ||
tippy._followCursorListener = listener; | ||
return listener; | ||
} | ||
/** | ||
* Appends the popper and creates a popper instance if one does not exist | ||
* Also updates its position if need be and enables event listeners | ||
* @param {Tippy} tippy | ||
*/ | ||
function mountPopper(tippy) { | ||
var popper = tippy.popper, | ||
reference = tippy.reference, | ||
_tippy$options = tippy.options, | ||
placement = _tippy$options.placement, | ||
appendTo = _tippy$options.appendTo, | ||
followCursor = _tippy$options.followCursor; | ||
var popperInstance = tippy.popperInstance; | ||
// Already on the DOM | ||
if (appendTo.contains(popper)) return; | ||
appendTo.appendChild(popper); | ||
if (!popperInstance) { | ||
popperInstance = tippy.popperInstance = createPopperInstance(tippy); | ||
} else { | ||
popperInstance.update(); | ||
if (!followCursor || browser.usingTouch) { | ||
popperInstance.enableEventListeners(); | ||
} | ||
} | ||
// Since touch is determined dynamically, followCursor is set on mount | ||
if (followCursor && !browser.usingTouch) { | ||
document.addEventListener('mousemove', createFollowCursorListener(tippy)); | ||
popperInstance.disableEventListeners(); | ||
} | ||
} | ||
/** | ||
* Updates a popper's position on each animation frame to make it stick to a moving element | ||
* @param {Tippy} tippy | ||
*/ | ||
function makeSticky(tippy) { | ||
var applyTransitionDuration = function applyTransitionDuration() { | ||
tippy.popper.style[prefix('transitionDuration')] = tippy.options.updateDuration + 'ms'; | ||
}; | ||
var removeTransitionDuration = function removeTransitionDuration() { | ||
tippy.popper.style[prefix('transitionDuration')] = ''; | ||
}; | ||
var updatePosition = function updatePosition() { | ||
tippy.popperInstance && tippy.popperInstance.scheduleUpdate(); | ||
applyTransitionDuration(); | ||
tippy.state.visible ? requestAnimationFrame(updatePosition) : removeTransitionDuration(); | ||
}; | ||
// Wait until Popper's position has been updated initially | ||
defer(updatePosition); | ||
} | ||
/** | ||
* Prepares the callback functions for `show` and `hide` methods | ||
* @param {Tippy} tippy | ||
* @param {Number} duration | ||
* @param {Function} callback - callback function to fire once transition completes | ||
*/ | ||
function onTransitionEnd(tippy, duration, callback) { | ||
// Make callback synchronous if duration is 0 | ||
if (!duration) { | ||
return callback(); | ||
} | ||
var _getInnerElements = getInnerElements(tippy.popper), | ||
tooltip = _getInnerElements.tooltip; | ||
var toggleListeners = function toggleListeners(action, listener) { | ||
if (!listener) return; | ||
tooltip[action + 'EventListener']('ontransitionend' in window ? 'transitionend' : 'webkitTransitionEnd', listener); | ||
}; | ||
var listener = function listener(e) { | ||
if (e.target === tooltip) { | ||
toggleListeners('remove', listener); | ||
callback(); | ||
} | ||
}; | ||
toggleListeners('remove', tippy._transitionendListener); | ||
toggleListeners('add', listener); | ||
tippy._transitionendListener = listener; | ||
} | ||
/** | ||
* Determines if an element is visible in the viewport | ||
* @param {Element} el | ||
* @return {Boolean} | ||
*/ | ||
function elementIsInViewport(el) { | ||
var rect = el.getBoundingClientRect(); | ||
return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth); | ||
} | ||
/** | ||
* Returns duration taking into account the option being either a number or array | ||
* @param {Number} duration | ||
* @param {Number} index | ||
* @return {Number} | ||
*/ | ||
function getDuration(duration, index) { | ||
return Array.isArray(duration) ? duration[index] : duration; | ||
} | ||
/** | ||
* Sets the visibility state of an element for transition to begin | ||
* @param {Element[]} els - array of elements | ||
* @param {String} type - 'visible' or 'hidden' | ||
*/ | ||
function setVisibilityState(els, type) { | ||
els.forEach(function (el) { | ||
if (!el) return; | ||
el.setAttribute('data-state', type); | ||
}); | ||
} | ||
/** | ||
* Applies the transition duration to each element | ||
* @param {Element[]} els - Array of elements | ||
* @param {Number} duration | ||
*/ | ||
function applyTransitionDuration(els, duration) { | ||
els.forEach(function (el) { | ||
if (!el) return; | ||
var isContent = matches$1.call(el, selectors.CONTENT); | ||
var _duration = isContent ? Math.round(duration / 1.3) : duration; | ||
el.style[prefix('transitionDuration')] = _duration + 'ms'; | ||
}); | ||
} | ||
var Tippy = function () { | ||
function Tippy(config) { | ||
classCallCheck(this, Tippy); | ||
for (var prop in config) { | ||
this[prop] = config[prop]; | ||
} | ||
this.state = { | ||
destroyed: false, | ||
visible: false, | ||
enabled: true | ||
}; | ||
} | ||
/** | ||
* Enables the tooltip to allow it to show or hide | ||
*/ | ||
createClass(Tippy, [{ | ||
key: 'enable', | ||
value: function enable() { | ||
this.state.enabled = true; | ||
} | ||
/** | ||
* Disables the tooltip from showing or hiding, but does not destroy it | ||
*/ | ||
}, { | ||
key: 'disable', | ||
value: function disable() { | ||
this.state.enabled = false; | ||
} | ||
/** | ||
* Shows the tooltip | ||
* @param {Number} duration in milliseconds | ||
*/ | ||
}, { | ||
key: 'show', | ||
value: function show(duration) { | ||
var _this = this; | ||
if (this.state.destroyed || !this.state.enabled) return; | ||
var popper = this.popper, | ||
reference = this.reference, | ||
options = this.options; | ||
var _getInnerElements = getInnerElements(popper), | ||
tooltip = _getInnerElements.tooltip, | ||
backdrop = _getInnerElements.backdrop, | ||
content = _getInnerElements.content; | ||
// Destroy tooltip if the reference element is no longer on the DOM | ||
if (!reference.refObj && !document.body.contains(reference)) { | ||
this.destroy(); | ||
return; | ||
} | ||
options.onShow.call(popper); | ||
duration = getDuration(duration !== undefined ? duration : options.duration, 0); | ||
// Prevent a transition when popper changes position | ||
applyTransitionDuration([popper, tooltip, backdrop], 0); | ||
mountPopper(this); | ||
popper.style.visibility = 'visible'; | ||
this.state.visible = true; | ||
// Wait for popper's position to update by deferring the callback, so | ||
// that the position update doesn't transition, only the normal animation | ||
defer(function () { | ||
// ~20ms can elapse before this defer callback is run, so the hide() method | ||
// may have been invoked -- check if the popper is still visible and cancel | ||
// this callback if not | ||
if (!_this.state.visible) return; | ||
if (!options.followCursor || browser.usingTouch) { | ||
_this.popperInstance.update(); | ||
applyTransitionDuration([popper], options.updateDuration); | ||
} | ||
// Re-apply transition durations | ||
applyTransitionDuration([tooltip, backdrop], duration); | ||
// Make content fade out a bit faster than the tooltip if `animateFill` is true | ||
if (backdrop) { | ||
content.style.opacity = 1; | ||
backdrop.offsetHeight; | ||
} | ||
if (options.interactive) { | ||
reference.classList.add('tippy-active'); | ||
} | ||
if (options.sticky) { | ||
makeSticky(_this); | ||
} | ||
setVisibilityState([tooltip, backdrop], 'visible'); | ||
onTransitionEnd(_this, duration, function () { | ||
if (_this.state.visible) { | ||
if (!options.updateDuration) { | ||
tooltip.classList.add('tippy-notransition'); | ||
} | ||
options.interactive && popper.focus(); | ||
options.onShown.call(popper); | ||
} | ||
}); | ||
}); | ||
} | ||
/** | ||
* Hides the tooltip | ||
* @param {Number} duration in milliseconds | ||
*/ | ||
}, { | ||
key: 'hide', | ||
value: function hide(duration) { | ||
var _this2 = this; | ||
if (this.state.destroyed || !this.state.enabled) return; | ||
var popper = this.popper, | ||
reference = this.reference, | ||
options = this.options; | ||
var _getInnerElements2 = getInnerElements(popper), | ||
tooltip = _getInnerElements2.tooltip, | ||
backdrop = _getInnerElements2.backdrop, | ||
content = _getInnerElements2.content; | ||
options.onHide.call(popper); | ||
duration = getDuration(duration !== undefined ? duration : options.duration, 1); | ||
if (!options.updateDuration) { | ||
tooltip.classList.remove('tippy-notransition'); | ||
} | ||
if (options.interactive) { | ||
reference.classList.remove('tippy-active'); | ||
} | ||
popper.style.visibility = 'hidden'; | ||
this.state.visible = false; | ||
applyTransitionDuration([tooltip, backdrop, backdrop ? content : null], duration); | ||
if (backdrop) { | ||
content.style.opacity = 0; | ||
} | ||
setVisibilityState([tooltip, backdrop], 'hidden'); | ||
if (options.interactive && options.trigger.indexOf('click') > -1 && elementIsInViewport(reference)) { | ||
reference.focus(); | ||
} | ||
onTransitionEnd(this, duration, function () { | ||
if (!_this2.state.visible && getComputedStyle(tooltip).opacity !== '1') { | ||
_this2.popperInstance.disableEventListeners(); | ||
document.removeEventListener('mousemove', _this2._followCursorListener); | ||
options.appendTo.removeChild(popper); | ||
options.onHidden.call(popper); | ||
} | ||
}); | ||
} | ||
/** | ||
* Destroys the tooltip | ||
*/ | ||
}, { | ||
key: 'destroy', | ||
value: function destroy() { | ||
var _this3 = this; | ||
if (this.state.destroyed) return; | ||
// Ensure the popper is hidden | ||
if (this.state.visible) { | ||
this.hide(0); | ||
} | ||
this.listeners.forEach(function (listener) { | ||
_this3.reference.removeEventListener(listener.event, listener.handler); | ||
}); | ||
// Restore title | ||
this.reference.setAttribute('title', this.reference.getAttribute('data-original-title')); | ||
delete this.reference._tippy;['data-original-title', 'data-tippy', 'aria-describedby'].forEach(function (attr) { | ||
_this3.reference.removeAttribute(attr); | ||
}); | ||
if (this.popperInstance) { | ||
this.popperInstance.destroy(); | ||
} | ||
this._mutationObservers.forEach(function (observer) { | ||
observer.disconnect(); | ||
}); | ||
this.state.destroyed = true; | ||
} | ||
}]); | ||
return Tippy; | ||
}(); | ||
var idCounter = 1; | ||
/** | ||
* Creates tooltips for each reference element | ||
* @param {Element[]} els | ||
* @param {Object} config | ||
* @return {Tippy[]} Array of Tippy instances | ||
*/ | ||
function createTooltips(els, config) { | ||
return els.reduce(function (acc, reference) { | ||
var id = idCounter; | ||
var options = evaluateOptions(reference, config.performance ? config : getIndividualOptions(reference, config)); | ||
var html = options.html, | ||
trigger = options.trigger, | ||
touchHold = options.touchHold, | ||
dynamicTitle = options.dynamicTitle, | ||
createPopperInstanceOnInit = options.createPopperInstanceOnInit; | ||
var title = reference.getAttribute('title'); | ||
if (!title && !html) return acc; | ||
reference.setAttribute('data-tippy', ''); | ||
reference.setAttribute('aria-describedby', 'tippy-' + id); | ||
removeTitle(reference); | ||
var popper = createPopperElement(id, title, options); | ||
var tippy = new Tippy({ | ||
id: id, | ||
reference: reference, | ||
popper: popper, | ||
options: options, | ||
_mutationObservers: [] | ||
}); | ||
tippy.popperInstance = createPopperInstanceOnInit ? createPopperInstance(tippy) : null; | ||
var listeners = getEventListeners(tippy, options); | ||
tippy.listeners = trigger.trim().split(' ').reduce(function (acc, eventType) { | ||
return acc.concat(createTrigger(eventType, reference, listeners, touchHold)); | ||
}, []); | ||
// Update tooltip content whenever the title attribute on the reference changes | ||
if (dynamicTitle) { | ||
addMutationObserver({ | ||
tippy: tippy, | ||
target: reference, | ||
callback: function callback() { | ||
var _getInnerElements = getInnerElements(popper), | ||
content = _getInnerElements.content; | ||
var title = reference.getAttribute('title'); | ||
if (title) { | ||
content.innerHTML = title; | ||
removeTitle(reference); | ||
} | ||
}, | ||
options: { | ||
attributes: true | ||
} | ||
}); | ||
} | ||
// Shortcuts | ||
reference._tippy = tippy; | ||
popper._reference = reference; | ||
acc.push(tippy); | ||
idCounter++; | ||
return acc; | ||
}, []); | ||
} | ||
/** | ||
* Hides all poppers | ||
* @param {Tippy} excludeTippy - tippy to exclude if needed | ||
*/ | ||
function hideAllPoppers(excludeTippy) { | ||
var poppers = [].slice.call(document.querySelectorAll(selectors.POPPER)); | ||
poppers.forEach(function (popper) { | ||
var tippy = popper._reference._tippy; | ||
var options = tippy.options; | ||
if ((options.hideOnClick === true || options.trigger.indexOf('focus') > -1) && (!excludeTippy || popper !== excludeTippy.popper)) { | ||
tippy.hide(); | ||
} | ||
}); | ||
} | ||
/** | ||
* Adds the needed event listeners | ||
*/ | ||
function bindEventListeners() { | ||
var touchHandler = function touchHandler() { | ||
if (browser.usingTouch) return; | ||
browser.usingTouch = true; | ||
if (browser.iOS) { | ||
document.body.classList.add('tippy-touch'); | ||
} | ||
if (browser.dynamicInputDetection && window.performance) { | ||
document.addEventListener('mousemove', mousemoveHandler); | ||
} | ||
browser.onUserInputChange('touch'); | ||
}; | ||
var mousemoveHandler = function () { | ||
var time = void 0; | ||
return function () { | ||
var now = performance.now(); | ||
// Chrome 60+ is 1 mousemove per animation frame, use 20ms time difference | ||
if (now - time < 20) { | ||
browser.usingTouch = false; | ||
document.removeEventListener('mousemove', mousemoveHandler); | ||
if (!browser.iOS) { | ||
document.body.classList.remove('tippy-touch'); | ||
} | ||
browser.onUserInputChange('mouse'); | ||
} | ||
time = now; | ||
}; | ||
}(); | ||
var clickHandler = function clickHandler(event) { | ||
// Simulated events dispatched on the document | ||
if (!(event.target instanceof Element)) { | ||
return hideAllPoppers(); | ||
} | ||
var reference = closest(event.target, selectors.REFERENCE); | ||
var popper = closest(event.target, selectors.POPPER); | ||
if (popper && popper._reference._tippy.options.interactive) return; | ||
if (reference) { | ||
var options = reference._tippy.options; | ||
// Hide all poppers except the one belonging to the element that was clicked IF | ||
// `multiple` is false AND they are a touch user, OR | ||
// `multiple` is false AND it's triggered by a click | ||
if (!options.multiple && browser.usingTouch || !options.multiple && options.trigger.indexOf('click') > -1) { | ||
return hideAllPoppers(reference._tippy); | ||
} | ||
if (options.hideOnClick !== true || options.trigger.indexOf('click') > -1) return; | ||
} | ||
hideAllPoppers(); | ||
}; | ||
var blurHandler = function blurHandler(event) { | ||
var _document = document, | ||
el = _document.activeElement; | ||
if (el && el.blur && matches$1.call(el, selectors.REFERENCE)) { | ||
el.blur(); | ||
} | ||
}; | ||
document.addEventListener('click', clickHandler); | ||
document.addEventListener('touchstart', touchHandler); | ||
window.addEventListener('blur', blurHandler); | ||
if (!browser.supportsTouch && (navigator.maxTouchPoints || navigator.msMaxTouchPoints)) { | ||
document.addEventListener('pointerdown', touchHandler); | ||
} | ||
} | ||
/** | ||
* Instantiates tooltips | ||
* @param {String|Element|Element[]|NodeList|Object} selector | ||
* @param {Object} options | ||
* @return {Object} | ||
*/ | ||
function tippy$2(selector, options) { | ||
if (browser.supported && !browser.eventsBound) { | ||
bindEventListeners(); | ||
browser.eventsBound = true; | ||
} | ||
if (isObjectLiteral(selector)) { | ||
selector.refObj = true; | ||
selector.attributes = selector.attributes || {}; | ||
selector.setAttribute = function (key, val) { | ||
selector.attributes[key] = val; | ||
}; | ||
selector.getAttribute = function (key) { | ||
return selector.attributes[key]; | ||
}; | ||
selector.removeAttribute = function (key) { | ||
delete selector.attributes[key]; | ||
}; | ||
selector.addEventListener = function () {}; | ||
selector.removeEventListener = function () {}; | ||
selector.classList = { | ||
classNames: {}, | ||
add: function add(key) { | ||
return selector.classList.classNames[key] = true; | ||
}, | ||
remove: function remove(key) { | ||
delete selector.classList.classNames[key]; | ||
return true; | ||
}, | ||
contains: function contains(key) { | ||
return !!selector.classList.classNames[key]; | ||
} | ||
}; | ||
} | ||
options = _extends({}, defaults, options); | ||
return { | ||
selector: selector, | ||
options: options, | ||
tooltips: browser.supported ? createTooltips(getArrayOfElements(selector), options) : [], | ||
destroyAll: function destroyAll() { | ||
this.tooltips.forEach(function (tooltip) { | ||
return tooltip.destroy(); | ||
}); | ||
} | ||
}; | ||
} | ||
tippy$2.browser = browser; | ||
tippy$2.defaults = defaults; | ||
return tippy$2; | ||
}))); |
@@ -1,4 +0,7 @@ | ||
import './src/scss/tippy.scss' | ||
import tippy from './src/js/tippy.js' | ||
import styles from './dist/tippy.css' | ||
import tippy from './src/js/tippy' | ||
import injectCSS from './src/js/utils/injectCSS' | ||
injectCSS(styles) | ||
export default tippy |
{ | ||
"name": "tippy.js", | ||
"version": "1.4.2", | ||
"version": "2.0.0-beta.2", | ||
"description": "Vanilla JS Tooltip Library", | ||
"main": "dist/tippy.js", | ||
"main": "dist/tippy.all.js", | ||
"scripts": { | ||
"dev": "rollup -c scripts/rollup.dev.config.js --watch", | ||
"build": "npm run standalone && npm run bundle && npm run bundle-minify", | ||
"bundle": "rollup -c scripts/rollup.bundle.config.js", | ||
"standalone": "rollup -c scripts/rollup.standalone.config.js", | ||
"bundle-minify": "rollup -c scripts/rollup.bundle.min.config.js", | ||
"css": "rollup -c scripts/rollup.css.config.js --watch", | ||
"build": "npm run standalone && npm run bundle && npm run all", | ||
"all": "rollup -c scripts/rollup.all.config.js && rollup -c scripts/rollup.all.min.config.js", | ||
"bundle": "rollup -c scripts/rollup.bundle.config.js && rollup -c scripts/rollup.bundle.min.config.js", | ||
"standalone": "rollup -c scripts/rollup.standalone.config.js && rollup -c scripts/rollup.standalone.min.config.js", | ||
"themes": "rollup -c scripts/rollup.themes.config.js", | ||
"test": "rollup -c scripts/rollup.tests.config.js --format es && karma start karma.conf.js" | ||
@@ -32,2 +34,5 @@ }, | ||
"postcss": "^5.2.16", | ||
"postcss-cssnext": "^3.0.2", | ||
"postcss-nested": "^2.1.2", | ||
"postcss-simple-vars": "^4.1.0", | ||
"rollup": "^0.47.6", | ||
@@ -37,2 +42,3 @@ "rollup-plugin-babel": "^2.7.1", | ||
"rollup-plugin-commonjs": "^8.0.2", | ||
"rollup-plugin-css-only": "^0.2.0", | ||
"rollup-plugin-livereload": "^0.4.0", | ||
@@ -39,0 +45,0 @@ "rollup-plugin-node-resolve": "^3.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
422496
8561
28
15
3