tailtip 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,9 @@
11
11
  </p>
12
12
  </div>
13
13
 
14
- ------
14
+ ---
15
+
16
+ [![Versoly - Tailwind page builder](docs/assets/versoly.png)](https://versoly.com/tailwind-page-builder?utm_source=github&utm_medium=repo&utm_campaign=image&utm_term=tailtip)
15
17
 
16
18
  ## Demo
17
19
 
@@ -31,10 +33,31 @@ Add the CDN script or download and paste right before the closing `</body>` tag
31
33
  <script src="https://unpkg.com/tailtip@1.0.3/dist/tailtip.js"></script>
32
34
  ```
33
35
 
36
+ ## Frequently Asked Questions
37
+
38
+ ### Why create Tailtip?
39
+
40
+ It shouldn't require a large library to create tooltips.
41
+
42
+ By combining Floating UI and Tailwind CSS, Tailtip allows you to create tooltips with a small bundle size and without the need for additional CSS.
43
+
44
+ ### Why not just use CSS?
45
+
46
+ CSS tooltips are not interactive and have many limitations.
47
+
48
+ Tailtip uses Floating UI under the hood for positioning and middleware which allows for interactive tooltips that can be triggered on click, hover, focus, etc. It also handles edge cases such as flipping the tooltip when it goes out of the viewport.
49
+
50
+ ### Why not use a slider library?
51
+
52
+ There are many tooltip libraries out there but none of them are built with Tailwind CSS in mind. They include their own way of animating tooltips which adds bloat that Tailwind can handle with its utility classes.
53
+
54
+ Tailtip allows you to add animations such as opacity with Tailwind CSS utility classes.
55
+
56
+
34
57
  ## Roadmap
35
58
 
36
59
  - Middleware offset + padding options
37
- - init attr on script tag
60
+ - init attr on script tag
38
61
 
39
62
  ## Community
40
63
 
package/dist/tailtip.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Nt=Object.defineProperty,Vt=Object.defineProperties;var Bt=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var gt=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable;var pt=(t,e,n)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,b=(t,e)=>{for(var n in e||(e={}))gt.call(e,n)&&pt(t,n,e[n]);if(Z)for(var n of Z(e))ht.call(e,n)&&pt(t,n,e[n]);return t},P=(t,e)=>Vt(t,Bt(e));var rt=(t,e)=>{var n={};for(var o in t)gt.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&Z)for(var o of Z(t))e.indexOf(o)<0&&ht.call(t,o)&&(n[o]=t[o]);return n};const K=Math.min,j=Math.max,tt=Math.round,V=t=>({x:t,y:t}),Ft={left:"right",right:"left",bottom:"top",top:"bottom"},Wt={start:"end",end:"start"};function ct(t,e,n){return j(t,K(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function $(t){return t.split("-")[0]}function Q(t){return t.split("-")[1]}function vt(t){return t==="x"?"y":"x"}function at(t){return t==="y"?"height":"width"}function ot(t){return["top","bottom"].includes($(t))?"y":"x"}function ut(t){return vt(ot(t))}function Mt(t,e,n){n===void 0&&(n=!1);const o=Q(t),i=ut(t),r=at(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=et(s)),[s,et(s)]}function Ht(t){const e=et(t);return[lt(t),e,lt(e)]}function lt(t){return t.replace(/start|end/g,e=>Wt[e])}function $t(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}function jt(t,e,n,o){const i=Q(t);let r=$t($(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(lt)))),r}function et(t){return t.replace(/left|right|bottom|top/g,e=>Ft[e])}function _t(t){return b({top:0,right:0,bottom:0,left:0},t)}function At(t){return typeof t!="number"?_t(t):{top:t,right:t,bottom:t,left:t}}function nt(t){return P(b({},t),{top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height})}function wt(t,e,n){let{reference:o,floating:i}=t;const r=ot(e),s=ut(e),c=at(s),l=$(e),f=r==="y",p=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let a;switch(l){case"top":a={x:p,y:o.y-i.height};break;case"bottom":a={x:p,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:d};break;case"left":a={x:o.x-i.width,y:d};break;default:a={x:o.x,y:o.y}}switch(Q(e)){case"start":a[s]-=m*(n&&f?-1:1);break;case"end":a[s]+=m*(n&&f?-1:1);break}return a}const Xt=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:d}=wt(f,o,l),m=o,a={},u=0;for(let g=0;g<c.length;g++){const{name:w,fn:h}=c[g],{x:y,y:x,data:A,reset:v}=await h({x:p,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:a,rects:f,platform:s,elements:{reference:t,floating:e}});if(p=y!=null?y:p,d=x!=null?x:d,a=P(b({},a),{[w]:b(b({},a[w]),A)}),v&&u<=50){u++,typeof v=="object"&&(v.placement&&(m=v.placement),v.rects&&(f=v.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:p,y:d}=wt(f,m,l)),g=-1;continue}}return{x:p,y:d,placement:m,strategy:i,middlewareData:a}};async function Et(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:m=!1,padding:a=0}=J(e,t),u=At(a),w=c[m?d==="floating"?"reference":"floating":d],h=nt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(w)))==null||n?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:l})),y=d==="floating"?P(b({},s.floating),{x:o,y:i}):s.reference,x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),A=await(r.isElement==null?void 0:r.isElement(x))?await(r.getScale==null?void 0:r.getScale(x))||{x:1,y:1}:{x:1,y:1},v=nt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:x,strategy:l}):y);return{top:(h.top-v.top+u.top)/A.y,bottom:(v.bottom-h.bottom+u.bottom)/A.y,left:(h.left-v.left+u.left)/A.x,right:(v.right-h.right+u.right)/A.x}}const Yt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:l}=e,{element:f,padding:p=0}=J(t,e)||{};if(f==null)return{};const d=At(p),m={x:n,y:o},a=ut(i),u=at(a),g=await s.getDimensions(f),w=a==="y",h=w?"top":"left",y=w?"bottom":"right",x=w?"clientHeight":"clientWidth",A=r.reference[u]+r.reference[a]-m[a]-r.floating[u],v=m[a]-r.reference[a],W=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let O=W?W[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(W)))&&(O=c.floating[x]||r.floating[u]);const M=A/2-v/2,Y=O/2-g[u]/2-1,q=K(d[h],Y),I=K(d[y],Y),H=q,T=O-g[u]-I,R=O/2-g[u]/2+M,D=ct(H,R,T),L=!l.arrow&&Q(i)!=null&&R!=D&&r.reference[u]/2-(R<H?q:I)-g[u]/2<0,S=L?R<H?R-H:R-T:0;return{[a]:m[a]+S,data:b({[a]:D,centerOffset:R-D-S},L&&{alignmentOffset:S}),reset:L}}}),qt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:l,elements:f}=e,H=J(t,e),{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:a="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:g=!0}=H,w=rt(H,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const h=$(i),y=$(c)===c,x=await(l.isRTL==null?void 0:l.isRTL(f.floating)),A=m||(y||!g?[et(c)]:Ht(c));!m&&u!=="none"&&A.push(...jt(c,g,u,x));const v=[c,...A],W=await Et(e,w),O=[];let M=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&O.push(W[h]),d){const T=Mt(i,s,x);O.push(W[T[0]],W[T[1]])}if(M=[...M,{placement:i,overflows:O}],!O.every(T=>T<=0)){var Y,q;const T=(((Y=r.flip)==null?void 0:Y.index)||0)+1,R=v[T];if(R)return{data:{index:T,overflows:M},reset:{placement:R}};let D=(q=M.filter(L=>L.overflows[0]<=0).sort((L,S)=>L.overflows[1]-S.overflows[1])[0])==null?void 0:q.placement;if(!D)switch(a){case"bestFit":{var I;const L=(I=M.map(S=>[S.placement,S.overflows.filter(z=>z>0).reduce((z,Dt)=>z+Dt,0)]).sort((S,z)=>S[1]-z[1])[0])==null?void 0:I[0];L&&(D=L);break}case"initialPlacement":D=c;break}if(i!==D)return{reset:{placement:D}}}return{}}}};async function It(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=$(n),c=Q(n),l=ot(n)==="y",f=["left","top"].includes(s)?-1:1,p=r&&l?-1:1,d=J(e,t);let{mainAxis:m,crossAxis:a,alignmentAxis:u}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:b({mainAxis:0,crossAxis:0,alignmentAxis:null},d);return c&&typeof u=="number"&&(a=c==="end"?u*-1:u),l?{x:a*p,y:m*f}:{x:m*f,y:a*p}}const zt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=e,l=await It(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:P(b({},l),{placement:s})}}}},Kt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,w=J(t,e),{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:h=>{let{x:y,y:x}=h;return{x:y,y:x}}}}=w,l=rt(w,["mainAxis","crossAxis","limiter"]),f={x:n,y:o},p=await Et(e,l),d=ot($(i)),m=vt(d);let a=f[m],u=f[d];if(r){const h=m==="y"?"top":"left",y=m==="y"?"bottom":"right",x=a+p[h],A=a-p[y];a=ct(x,a,A)}if(s){const h=d==="y"?"top":"left",y=d==="y"?"bottom":"right",x=u+p[h],A=u-p[y];u=ct(x,u,A)}const g=c.fn(P(b({},e),{[m]:a,[d]:u}));return P(b({},g),{data:{x:g.x-n,y:g.y-o}})}}};function B(t){return Ct(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function F(t){var e;return(e=(Ct(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ct(t){return t instanceof Node||t instanceof E(t).Node}function N(t){return t instanceof Element||t instanceof E(t).Element}function k(t){return t instanceof HTMLElement||t instanceof E(t).HTMLElement}function xt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function U(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Gt(t){return["table","td","th"].includes(B(t))}function dt(t){const e=mt(),n=C(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Jt(t){let e=X(t);for(;k(e)&&!it(e);){if(dt(e))return e;e=X(e)}return null}function mt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function it(t){return["html","body","#document"].includes(B(t))}function C(t){return E(t).getComputedStyle(t)}function st(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function X(t){if(B(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xt(t)&&t.host||F(t);return xt(e)?e.host:e}function Ot(t){const e=X(t);return it(e)?t.ownerDocument?t.ownerDocument.body:t.body:k(e)&&U(e)?e:Ot(e)}function ft(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ot(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=E(i);return r?e.concat(s,s.visualViewport||[],U(i)?i:[],s.frameElement&&n?ft(s.frameElement):[]):e.concat(i,ft(i,[],n))}function Tt(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=k(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=tt(n)!==r||tt(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Rt(t){return N(t)?t:t.contextElement}function _(t){const e=Rt(t);if(!k(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Tt(e);let s=(r?tt(n.width):n.width)/o,c=(r?tt(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Qt=V(0);function Lt(t){const e=E(t);return!mt()||!e.visualViewport?Qt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ut(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(t)?!1:e}function G(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Rt(t);let s=V(1);e&&(o?N(o)&&(s=_(o)):s=_(t));const c=Ut(r,n,o)?Lt(r):V(0);let l=(i.left+c.x)/s.x,f=(i.top+c.y)/s.y,p=i.width/s.x,d=i.height/s.y;if(r){const m=E(r),a=o&&N(o)?E(o):o;let u=m.frameElement;for(;u&&o&&a!==m;){const g=_(u),w=u.getBoundingClientRect(),h=C(u),y=w.left+(u.clientLeft+parseFloat(h.paddingLeft))*g.x,x=w.top+(u.clientTop+parseFloat(h.paddingTop))*g.y;l*=g.x,f*=g.y,p*=g.x,d*=g.y,l+=y,f+=x,u=E(u).frameElement}}return nt({width:p,height:d,x:l,y:f})}function Zt(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=k(n),r=F(n);if(n===r)return e;let s={scrollLeft:0,scrollTop:0},c=V(1);const l=V(0);if((i||!i&&o!=="fixed")&&((B(n)!=="body"||U(r))&&(s=st(n)),k(n))){const f=G(n);c=_(n),l.x=f.x+n.clientLeft,l.y=f.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-s.scrollLeft*c.x+l.x,y:e.y*c.y-s.scrollTop*c.y+l.y}}function te(t){return Array.from(t.getClientRects())}function St(t){return G(F(t)).left+st(t).scrollLeft}function ee(t){const e=F(t),n=st(t),o=t.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+St(t);const c=-n.scrollTop;return C(o).direction==="rtl"&&(s+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function ne(t,e){const n=E(t),o=F(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,l=0;if(i){r=i.width,s=i.height;const f=mt();(!f||f&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:r,height:s,x:c,y:l}}function oe(t,e){const n=G(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=k(t)?_(t):V(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=i*r.x,f=o*r.y;return{width:s,height:c,x:l,y:f}}function yt(t,e,n){let o;if(e==="viewport")o=ne(t,n);else if(e==="document")o=ee(F(t));else if(N(e))o=oe(e,n);else{const i=Lt(t);o=P(b({},e),{x:e.x-i.x,y:e.y-i.y})}return nt(o)}function Pt(t,e){const n=X(t);return n===e||!N(n)||it(n)?!1:C(n).position==="fixed"||Pt(n,e)}function ie(t,e){const n=e.get(t);if(n)return n;let o=ft(t,[],!1).filter(c=>N(c)&&B(c)!=="body"),i=null;const r=C(t).position==="fixed";let s=r?X(t):t;for(;N(s)&&!it(s);){const c=C(s),l=dt(s);!l&&c.position==="fixed"&&(i=null),(r?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||U(s)&&!l&&Pt(t,s))?o=o.filter(p=>p!==s):i=c,s=X(s)}return e.set(t,o),o}function se(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?ie(e,this._c):[].concat(n),o],c=s[0],l=s.reduce((f,p)=>{const d=yt(e,p,i);return f.top=j(d.top,f.top),f.right=K(d.right,f.right),f.bottom=K(d.bottom,f.bottom),f.left=j(d.left,f.left),f},yt(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function re(t){return Tt(t)}function ce(t,e,n){const o=k(e),i=F(e),r=n==="fixed",s=G(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const l=V(0);if(o||!o&&!r)if((B(e)!=="body"||U(i))&&(c=st(e)),o){const f=G(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=St(i));return{x:s.left+c.scrollLeft-l.x,y:s.top+c.scrollTop-l.y,width:s.width,height:s.height}}function bt(t,e){return!k(t)||C(t).position==="fixed"?null:e?e(t):t.offsetParent}function kt(t,e){const n=E(t);if(!k(t))return n;let o=bt(t,e);for(;o&&Gt(o)&&C(o).position==="static";)o=bt(o,e);return o&&(B(o)==="html"||B(o)==="body"&&C(o).position==="static"&&!dt(o))?n:o||Jt(t)||n}const le=async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||kt,r=this.getDimensions;return{reference:ce(e,await i(n),o),floating:b({x:0,y:0},await r(n))}};function fe(t){return C(t).direction==="rtl"}const ae={convertOffsetParentRelativeRectToViewportRelativeRect:Zt,getDocumentElement:F,getClippingRect:se,getOffsetParent:kt,getElementRects:le,getClientRects:te,getDimensions:re,getScale:_,isElement:N,isRTL:fe},ue=(t,e,n)=>{const o=new Map,i=b({platform:ae},n),r=P(b({},i.platform),{_c:o});return Xt(t,e,P(b({},i),{platform:r}))},de=function(t,e={}){const n=t.nextElementSibling,o=n.querySelector(".tooltip-arrow"),i=[zt(6),qt(),Kt({padding:5})];o&&i.push(Yt({element:o}));function r(){ue(t,n,{placement:e.placement||"top",middleware:i}).then(({x:m,y:a,placement:u,middlewareData:g})=>{if(Object.assign(n.style,{left:"".concat(m,"px"),top:"".concat(a,"px")}),g.arrow){const{x:w,y:h}=g.arrow,y={top:"bottom",right:"left",bottom:"top",left:"right"}[u.split("-")[0]];Object.assign(o.style,{left:w!=null?"".concat(w,"px"):"",top:h!=null?"".concat(h,"px"):"",right:"",bottom:"",[y]:"-4px"})}})}const s=()=>{n.style.display="block",requestAnimationFrame(()=>{n.classList.add("opacity-100","visible")}),r()},c=()=>{n.style.display="",n.classList.remove("opacity-100","visible")},l=()=>{if(n.style.display==="block"){c();return}s()};let f=["mouseenter","focus"],p=["mouseleave","blur"],d=[];e.trigger==="click"&&(f=[],p=["blur"],d=["click"]),f.forEach(m=>{t.addEventListener(m,s)}),p.forEach(m=>{t.addEventListener(m,c)}),d.forEach(m=>{t.addEventListener(m,l)})};module.exports=de;
1
+ var e=Math.min,t=Math.max,n=Math.round,r=e=>({x:e,y:e}),i={left:`right`,right:`left`,bottom:`top`,top:`bottom`},a={start:`end`,end:`start`};function o(n,r,i){return t(n,e(r,i))}function s(e,t){return typeof e==`function`?e(t):e}function c(e){return e.split(`-`)[0]}function l(e){return e.split(`-`)[1]}function u(e){return e===`x`?`y`:`x`}function d(e){return e===`y`?`height`:`width`}var f=new Set([`top`,`bottom`]);function p(e){return f.has(c(e))?`y`:`x`}function m(e){return u(p(e))}function h(e,t,n){n===void 0&&(n=!1);let r=l(e),i=m(e),a=d(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=C(o)),[o,C(o)]}function g(e){let t=C(e);return[_(e),t,_(t)]}function _(e){return e.replace(/start|end/g,e=>a[e])}var v=[`left`,`right`],y=[`right`,`left`],b=[`top`,`bottom`],x=[`bottom`,`top`];function S(e,t,n){switch(e){case`top`:case`bottom`:return n?t?y:v:t?v:y;case`left`:case`right`:return t?b:x;default:return[]}}function ee(e,t,n,r){let i=l(e),a=S(c(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_)))),a}function C(e){return e.replace(/left|right|bottom|top/g,e=>i[e])}function w(e){return{top:0,right:0,bottom:0,left:0,...e}}function T(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:w(e)}function E(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function D(e,t,n){let{reference:r,floating:i}=e,a=p(t),o=m(t),s=d(o),u=c(t),f=a===`y`,h=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,_=r[s]/2-i[s]/2,v;switch(u){case`top`:v={x:h,y:r.y-i.height};break;case`bottom`:v={x:h,y:r.y+r.height};break;case`right`:v={x:r.x+r.width,y:g};break;case`left`:v={x:r.x-i.width,y:g};break;default:v={x:r.x,y:r.y}}switch(l(t)){case`start`:v[o]-=_*(n&&f?-1:1);break;case`end`:v[o]+=_*(n&&f?-1:1);break}return v}async function O(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=s(t,e),m=T(p),h=o[f?d===`floating`?`reference`:`floating`:d],g=E(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(h))??!0?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=E(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var k=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=D(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??O},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=D(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},A=t=>({name:`arrow`,options:t,async fn(n){let{x:r,y:i,placement:a,rects:c,platform:u,elements:f,middlewareData:p}=n,{element:h,padding:g=0}=s(t,n)||{};if(h==null)return{};let _=T(g),v={x:r,y:i},y=m(a),b=d(y),x=await u.getDimensions(h),S=y===`y`,ee=S?`top`:`left`,C=S?`bottom`:`right`,w=S?`clientHeight`:`clientWidth`,E=c.reference[b]+c.reference[y]-v[y]-c.floating[b],D=v[y]-c.reference[y],O=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h)),k=O?O[w]:0;(!k||!await(u.isElement==null?void 0:u.isElement(O)))&&(k=f.floating[w]||c.floating[b]);let A=E/2-D/2,j=k/2-x[b]/2-1,te=e(_[ee],j),M=e(_[C],j),N=te,P=k-x[b]-M,F=k/2-x[b]/2+A,I=o(N,F,P),L=!p.arrow&&l(a)!=null&&F!==I&&c.reference[b]/2-(F<N?te:M)-x[b]/2<0,R=L?F<N?F-N:F-P:0;return{[y]:v[y]+R,data:{[y]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),j=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:_=`bestFit`,fallbackAxisSideDirection:v=`none`,flipAlignment:y=!0,...b}=s(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let x=c(r),S=p(o),w=c(o)===o,T=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=m||(w||!y?[C(o)]:g(o)),D=v!==`none`;!m&&D&&E.push(...ee(o,y,v,T));let O=[o,...E],k=await l.detectOverflow(t,b),A=[],j=i.flip?.overflows||[];if(d&&A.push(k[x]),f){let e=h(r,a,T);A.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:r,overflows:A}],!A.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=O[e];if(t&&(!(f===`alignment`&&S!==p(t))||j.every(e=>p(e.placement)===S?e.overflows[0]>0:!0)))return{data:{index:e,overflows:j},reset:{placement:t}};let n=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(_){case`bestFit`:{let e=j.filter(e=>{if(D){let t=p(e.placement);return t===S||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},te=new Set([`left`,`top`]);async function M(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=c(n),u=l(n),d=p(n)===`y`,f=te.has(o)?-1:1,m=a&&d?-1:1,h=s(t,e),{mainAxis:g,crossAxis:_,alignmentAxis:v}=typeof h==`number`?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return u&&typeof v==`number`&&(_=u===`end`?v*-1:v),d?{x:_*m,y:g*f}:{x:g*f,y:_*m}}var N=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await M(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},P=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:d=!1,limiter:f={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...m}=s(e,t),h={x:n,y:r},g=await a.detectOverflow(t,m),_=p(c(i)),v=u(_),y=h[v],b=h[_];if(l){let e=v===`y`?`top`:`left`,t=v===`y`?`bottom`:`right`,n=y+g[e],r=y-g[t];y=o(n,y,r)}if(d){let e=_===`y`?`top`:`left`,t=_===`y`?`bottom`:`right`,n=b+g[e],r=b-g[t];b=o(n,b,r)}let x=f.fn({...t,[v]:y,[_]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:l,[_]:d}}}}}};function F(){return typeof window<`u`}function I(e){return ne(e)?(e.nodeName||``).toLowerCase():`#document`}function L(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function R(e){return((ne(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ne(e){return F()?e instanceof Node||e instanceof L(e).Node:!1}function z(e){return F()?e instanceof Element||e instanceof L(e).Element:!1}function B(e){return F()?e instanceof HTMLElement||e instanceof L(e).HTMLElement:!1}function re(e){return!F()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof L(e).ShadowRoot}var ie=new Set([`inline`,`contents`]);function V(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ie.has(i)}var ae=new Set([`table`,`td`,`th`]);function oe(e){return ae.has(I(e))}var se=[`:popover-open`,`:modal`];function H(e){return se.some(t=>{try{return e.matches(t)}catch{return!1}})}var ce=[`transform`,`translate`,`scale`,`rotate`,`perspective`],le=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],ue=[`paint`,`layout`,`strict`,`content`];function U(e){let t=W(),n=z(e)?K(e):e;return ce.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||le.some(e=>(n.willChange||``).includes(e))||ue.some(e=>(n.contain||``).includes(e))}function de(e){let t=J(e);for(;B(t)&&!G(t);){if(U(t))return t;if(H(t))return null;t=J(t)}return null}function W(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var fe=new Set([`html`,`body`,`#document`]);function G(e){return fe.has(I(e))}function K(e){return L(e).getComputedStyle(e)}function q(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(I(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||re(e)&&e.host||R(e);return re(t)?t.host:t}function pe(e){let t=J(e);return G(t)?e.ownerDocument?e.ownerDocument.body:e.body:B(t)&&V(t)?t:pe(t)}function Y(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=pe(e),i=r===e.ownerDocument?.body,a=L(r);if(i){let e=X(a);return t.concat(a,a.visualViewport||[],V(r)?r:[],e&&n?Y(e):[])}return t.concat(r,Y(r,[],n))}function X(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function me(e){let t=K(e),r=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=B(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:i,c=n(r)!==o||n(i)!==s;return c&&(r=o,i=s),{width:r,height:i,$:c}}function he(e){return z(e)?e:e.contextElement}function Z(e){let t=he(e);if(!B(t))return r(1);let i=t.getBoundingClientRect(),{width:a,height:o,$:s}=me(t),c=(s?n(i.width):i.width)/a,l=(s?n(i.height):i.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}var ge=r(0);function _e(e){let t=L(e);return!W()||!t.visualViewport?ge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ve(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==L(e)?!1:t}function Q(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=he(e),s=r(1);t&&(i?z(i)&&(s=Z(i)):s=Z(e));let c=ve(o,n,i)?_e(o):r(0),l=(a.left+c.x)/s.x,u=(a.top+c.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=L(o),t=i&&z(i)?L(i):i,n=e,r=X(n);for(;r&&i&&t!==n;){let e=Z(r),t=r.getBoundingClientRect(),i=K(r),a=t.left+(r.clientLeft+parseFloat(i.paddingLeft))*e.x,o=t.top+(r.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=a,u+=o,n=L(r),r=X(n)}}return E({width:d,height:f,x:l,y:u})}function $(e,t){let n=q(e).scrollLeft;return t?t.left+n:Q(R(e)).left+n}function ye(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-$(e,n),y:n.top+t.scrollTop}}function be(e){let{elements:t,rect:n,offsetParent:i,strategy:a}=e,o=a===`fixed`,s=R(i),c=t?H(t.floating):!1;if(i===s||c&&o)return n;let l={scrollLeft:0,scrollTop:0},u=r(1),d=r(0),f=B(i);if((f||!f&&!o)&&((I(i)!==`body`||V(s))&&(l=q(i)),B(i))){let e=Q(i);u=Z(i),d.x=e.x+i.clientLeft,d.y=e.y+i.clientTop}let p=s&&!f&&!o?ye(s,l):r(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function xe(e){return Array.from(e.getClientRects())}function Se(e){let n=R(e),r=q(e),i=e.ownerDocument.body,a=t(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),o=t(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),s=-r.scrollLeft+$(e),c=-r.scrollTop;return K(i).direction===`rtl`&&(s+=t(n.clientWidth,i.clientWidth)-a),{width:a,height:o,x:s,y:c}}var Ce=25;function we(e,t){let n=L(e),r=R(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=W();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=$(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ce&&(a-=o)}else l<=Ce&&(a+=l);return{width:a,height:o,x:s,y:c}}var Te=new Set([`absolute`,`fixed`]);function Ee(e,t){let n=Q(e,!0,t===`fixed`),i=n.top+e.clientTop,a=n.left+e.clientLeft,o=B(e)?Z(e):r(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:i*o.y}}function De(e,t,n){let r;if(t===`viewport`)r=we(e,n);else if(t===`document`)r=Se(R(e));else if(z(t))r=Ee(t,n);else{let n=_e(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return E(r)}function Oe(e,t){let n=J(e);return n===t||!z(n)||G(n)?!1:K(n).position===`fixed`||Oe(n,t)}function ke(e,t){let n=t.get(e);if(n)return n;let r=Y(e,[],!1).filter(e=>z(e)&&I(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?J(e):e;for(;z(o)&&!G(o);){let t=K(o),n=U(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Te.has(i.position)||V(o)&&!n&&Oe(e,o))?r=r.filter(e=>e!==o):i=t,o=J(o)}return t.set(e,r),r}function Ae(n){let{element:r,boundary:i,rootBoundary:a,strategy:o}=n,s=[...i===`clippingAncestors`?H(r)?[]:ke(r,this._c):[].concat(i),a],c=s[0],l=s.reduce((n,i)=>{let a=De(r,i,o);return n.top=t(a.top,n.top),n.right=e(a.right,n.right),n.bottom=e(a.bottom,n.bottom),n.left=t(a.left,n.left),n},De(r,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function je(e){let{width:t,height:n}=me(e);return{width:t,height:n}}function Me(e,t,n){let i=B(t),a=R(t),o=n===`fixed`,s=Q(e,!0,o,t),c={scrollLeft:0,scrollTop:0},l=r(0);function u(){l.x=$(a)}if(i||!i&&!o)if((I(t)!==`body`||V(a))&&(c=q(t)),i){let e=Q(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&u();o&&!i&&a&&u();let d=a&&!i&&!o?ye(a,c):r(0);return{x:s.left+c.scrollLeft-l.x-d.x,y:s.top+c.scrollTop-l.y-d.y,width:s.width,height:s.height}}function Ne(e){return K(e).position===`static`}function Pe(e,t){if(!B(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return R(e)===n&&(n=n.ownerDocument.body),n}function Fe(e,t){let n=L(e);if(H(e))return n;if(!B(e)){let t=J(e);for(;t&&!G(t);){if(z(t)&&!Ne(t))return t;t=J(t)}return n}let r=Pe(e,t);for(;r&&oe(r)&&Ne(r);)r=Pe(r,t);return r&&G(r)&&Ne(r)&&!U(r)?n:r||de(e)||n}var Ie=async function(e){let t=this.getOffsetParent||Fe,n=this.getDimensions,r=await n(e.floating);return{reference:Me(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Le(e){return K(e).direction===`rtl`}var Re={convertOffsetParentRelativeRectToViewportRelativeRect:be,getDocumentElement:R,getClippingRect:Ae,getOffsetParent:Fe,getElementRects:Ie,getClientRects:xe,getDimensions:je,getScale:Z,isElement:z,isRTL:Le},ze=N,Be=P,Ve=j,He=A,Ue=(e,t,n)=>{let r=new Map,i={platform:Re,...n},a={...i.platform,_c:r};return k(e,t,{...i,platform:a})},We=function(e,t={}){let n=e.nextElementSibling,r=n.querySelector(`.tooltip-arrow`),i=[ze(6),Ve(),Be({padding:5})];r&&i.push(He({element:r}));function a(){Ue(e,n,{placement:t.placement||`top`,middleware:i}).then(({x:e,y:t,placement:i,middlewareData:a})=>{if(Object.assign(n.style,{left:`${e}px`,top:`${t}px`}),a.arrow){let{x:e,y:t}=a.arrow,n={top:`bottom`,right:`left`,bottom:`top`,left:`right`}[i.split(`-`)[0]];Object.assign(r.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,right:``,bottom:``,[n]:`-4px`})}})}n.style.display=`block`,a(),requestAnimationFrame(()=>{n.style.display=``});let o=()=>{n.style.display=`block`,requestAnimationFrame(()=>{n.style.opacity=`1`,n.style.visibility=`visible`}),a()},s=()=>{n.style.display=``,n.style.opacity=``,n.style.visibility=``},c=()=>{if(n.style.display===`block`){s();return}o()},l=[`mouseenter`,`focus`],u=[`mouseleave`,`blur`],d=[];if(t.trigger===`click`&&(l=[],u=[`blur`],d=[`click`]),d.includes(`click`)){let t=r=>{!n.contains(r.target)&&!e.contains(r.target)&&(s(),document.removeEventListener(`click`,t))};e.addEventListener(`click`,()=>{document.addEventListener(`click`,t)})}l.forEach(t=>{e.addEventListener(t,o)}),u.forEach(t=>{e.addEventListener(t,s)}),d.forEach(t=>{e.addEventListener(t,c)})};module.exports=We;
@@ -0,0 +1 @@
1
+ var Tailtip=(function(){var e=Math.min,t=Math.max,n=Math.round,r=e=>({x:e,y:e}),i={left:`right`,right:`left`,bottom:`top`,top:`bottom`},a={start:`end`,end:`start`};function o(n,r,i){return t(n,e(r,i))}function s(e,t){return typeof e==`function`?e(t):e}function c(e){return e.split(`-`)[0]}function l(e){return e.split(`-`)[1]}function u(e){return e===`x`?`y`:`x`}function d(e){return e===`y`?`height`:`width`}var f=new Set([`top`,`bottom`]);function p(e){return f.has(c(e))?`y`:`x`}function m(e){return u(p(e))}function h(e,t,n){n===void 0&&(n=!1);let r=l(e),i=m(e),a=d(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=C(o)),[o,C(o)]}function g(e){let t=C(e);return[_(e),t,_(t)]}function _(e){return e.replace(/start|end/g,e=>a[e])}var v=[`left`,`right`],y=[`right`,`left`],b=[`top`,`bottom`],x=[`bottom`,`top`];function S(e,t,n){switch(e){case`top`:case`bottom`:return n?t?y:v:t?v:y;case`left`:case`right`:return t?b:x;default:return[]}}function ee(e,t,n,r){let i=l(e),a=S(c(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_)))),a}function C(e){return e.replace(/left|right|bottom|top/g,e=>i[e])}function w(e){return{top:0,right:0,bottom:0,left:0,...e}}function T(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:w(e)}function E(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function D(e,t,n){let{reference:r,floating:i}=e,a=p(t),o=m(t),s=d(o),u=c(t),f=a===`y`,h=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,_=r[s]/2-i[s]/2,v;switch(u){case`top`:v={x:h,y:r.y-i.height};break;case`bottom`:v={x:h,y:r.y+r.height};break;case`right`:v={x:r.x+r.width,y:g};break;case`left`:v={x:r.x-i.width,y:g};break;default:v={x:r.x,y:r.y}}switch(l(t)){case`start`:v[o]-=_*(n&&f?-1:1);break;case`end`:v[o]+=_*(n&&f?-1:1);break}return v}async function O(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=s(t,e),m=T(p),h=o[f?d===`floating`?`reference`:`floating`:d],g=E(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(h))??!0?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=E(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var k=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=D(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??O},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=D(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},A=t=>({name:`arrow`,options:t,async fn(n){let{x:r,y:i,placement:a,rects:c,platform:u,elements:f,middlewareData:p}=n,{element:h,padding:g=0}=s(t,n)||{};if(h==null)return{};let _=T(g),v={x:r,y:i},y=m(a),b=d(y),x=await u.getDimensions(h),S=y===`y`,ee=S?`top`:`left`,C=S?`bottom`:`right`,w=S?`clientHeight`:`clientWidth`,E=c.reference[b]+c.reference[y]-v[y]-c.floating[b],D=v[y]-c.reference[y],O=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h)),k=O?O[w]:0;(!k||!await(u.isElement==null?void 0:u.isElement(O)))&&(k=f.floating[w]||c.floating[b]);let A=E/2-D/2,j=k/2-x[b]/2-1,te=e(_[ee],j),M=e(_[C],j),N=te,P=k-x[b]-M,F=k/2-x[b]/2+A,I=o(N,F,P),L=!p.arrow&&l(a)!=null&&F!==I&&c.reference[b]/2-(F<N?te:M)-x[b]/2<0,R=L?F<N?F-N:F-P:0;return{[y]:v[y]+R,data:{[y]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),j=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:_=`bestFit`,fallbackAxisSideDirection:v=`none`,flipAlignment:y=!0,...b}=s(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let x=c(r),S=p(o),w=c(o)===o,T=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=m||(w||!y?[C(o)]:g(o)),D=v!==`none`;!m&&D&&E.push(...ee(o,y,v,T));let O=[o,...E],k=await l.detectOverflow(t,b),A=[],j=i.flip?.overflows||[];if(d&&A.push(k[x]),f){let e=h(r,a,T);A.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:r,overflows:A}],!A.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=O[e];if(t&&(!(f===`alignment`&&S!==p(t))||j.every(e=>p(e.placement)===S?e.overflows[0]>0:!0)))return{data:{index:e,overflows:j},reset:{placement:t}};let n=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(_){case`bestFit`:{let e=j.filter(e=>{if(D){let t=p(e.placement);return t===S||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},te=new Set([`left`,`top`]);async function M(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=c(n),u=l(n),d=p(n)===`y`,f=te.has(o)?-1:1,m=a&&d?-1:1,h=s(t,e),{mainAxis:g,crossAxis:_,alignmentAxis:v}=typeof h==`number`?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return u&&typeof v==`number`&&(_=u===`end`?v*-1:v),d?{x:_*m,y:g*f}:{x:g*f,y:_*m}}var N=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await M(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},P=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:d=!1,limiter:f={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...m}=s(e,t),h={x:n,y:r},g=await a.detectOverflow(t,m),_=p(c(i)),v=u(_),y=h[v],b=h[_];if(l){let e=v===`y`?`top`:`left`,t=v===`y`?`bottom`:`right`,n=y+g[e],r=y-g[t];y=o(n,y,r)}if(d){let e=_===`y`?`top`:`left`,t=_===`y`?`bottom`:`right`,n=b+g[e],r=b-g[t];b=o(n,b,r)}let x=f.fn({...t,[v]:y,[_]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:l,[_]:d}}}}}};function F(){return typeof window<`u`}function I(e){return ne(e)?(e.nodeName||``).toLowerCase():`#document`}function L(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function R(e){return((ne(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ne(e){return F()?e instanceof Node||e instanceof L(e).Node:!1}function z(e){return F()?e instanceof Element||e instanceof L(e).Element:!1}function B(e){return F()?e instanceof HTMLElement||e instanceof L(e).HTMLElement:!1}function re(e){return!F()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof L(e).ShadowRoot}var ie=new Set([`inline`,`contents`]);function V(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ie.has(i)}var ae=new Set([`table`,`td`,`th`]);function oe(e){return ae.has(I(e))}var se=[`:popover-open`,`:modal`];function H(e){return se.some(t=>{try{return e.matches(t)}catch{return!1}})}var ce=[`transform`,`translate`,`scale`,`rotate`,`perspective`],le=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],ue=[`paint`,`layout`,`strict`,`content`];function U(e){let t=W(),n=z(e)?K(e):e;return ce.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||le.some(e=>(n.willChange||``).includes(e))||ue.some(e=>(n.contain||``).includes(e))}function de(e){let t=J(e);for(;B(t)&&!G(t);){if(U(t))return t;if(H(t))return null;t=J(t)}return null}function W(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var fe=new Set([`html`,`body`,`#document`]);function G(e){return fe.has(I(e))}function K(e){return L(e).getComputedStyle(e)}function q(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(I(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||re(e)&&e.host||R(e);return re(t)?t.host:t}function pe(e){let t=J(e);return G(t)?e.ownerDocument?e.ownerDocument.body:e.body:B(t)&&V(t)?t:pe(t)}function Y(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=pe(e),i=r===e.ownerDocument?.body,a=L(r);if(i){let e=X(a);return t.concat(a,a.visualViewport||[],V(r)?r:[],e&&n?Y(e):[])}return t.concat(r,Y(r,[],n))}function X(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function me(e){let t=K(e),r=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=B(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:i,c=n(r)!==o||n(i)!==s;return c&&(r=o,i=s),{width:r,height:i,$:c}}function he(e){return z(e)?e:e.contextElement}function Z(e){let t=he(e);if(!B(t))return r(1);let i=t.getBoundingClientRect(),{width:a,height:o,$:s}=me(t),c=(s?n(i.width):i.width)/a,l=(s?n(i.height):i.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}var ge=r(0);function _e(e){let t=L(e);return!W()||!t.visualViewport?ge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ve(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==L(e)?!1:t}function Q(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=he(e),s=r(1);t&&(i?z(i)&&(s=Z(i)):s=Z(e));let c=ve(o,n,i)?_e(o):r(0),l=(a.left+c.x)/s.x,u=(a.top+c.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=L(o),t=i&&z(i)?L(i):i,n=e,r=X(n);for(;r&&i&&t!==n;){let e=Z(r),t=r.getBoundingClientRect(),i=K(r),a=t.left+(r.clientLeft+parseFloat(i.paddingLeft))*e.x,o=t.top+(r.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=a,u+=o,n=L(r),r=X(n)}}return E({width:d,height:f,x:l,y:u})}function $(e,t){let n=q(e).scrollLeft;return t?t.left+n:Q(R(e)).left+n}function ye(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-$(e,n),y:n.top+t.scrollTop}}function be(e){let{elements:t,rect:n,offsetParent:i,strategy:a}=e,o=a===`fixed`,s=R(i),c=t?H(t.floating):!1;if(i===s||c&&o)return n;let l={scrollLeft:0,scrollTop:0},u=r(1),d=r(0),f=B(i);if((f||!f&&!o)&&((I(i)!==`body`||V(s))&&(l=q(i)),B(i))){let e=Q(i);u=Z(i),d.x=e.x+i.clientLeft,d.y=e.y+i.clientTop}let p=s&&!f&&!o?ye(s,l):r(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function xe(e){return Array.from(e.getClientRects())}function Se(e){let n=R(e),r=q(e),i=e.ownerDocument.body,a=t(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),o=t(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),s=-r.scrollLeft+$(e),c=-r.scrollTop;return K(i).direction===`rtl`&&(s+=t(n.clientWidth,i.clientWidth)-a),{width:a,height:o,x:s,y:c}}var Ce=25;function we(e,t){let n=L(e),r=R(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=W();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=$(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ce&&(a-=o)}else l<=Ce&&(a+=l);return{width:a,height:o,x:s,y:c}}var Te=new Set([`absolute`,`fixed`]);function Ee(e,t){let n=Q(e,!0,t===`fixed`),i=n.top+e.clientTop,a=n.left+e.clientLeft,o=B(e)?Z(e):r(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:i*o.y}}function De(e,t,n){let r;if(t===`viewport`)r=we(e,n);else if(t===`document`)r=Se(R(e));else if(z(t))r=Ee(t,n);else{let n=_e(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return E(r)}function Oe(e,t){let n=J(e);return n===t||!z(n)||G(n)?!1:K(n).position===`fixed`||Oe(n,t)}function ke(e,t){let n=t.get(e);if(n)return n;let r=Y(e,[],!1).filter(e=>z(e)&&I(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?J(e):e;for(;z(o)&&!G(o);){let t=K(o),n=U(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Te.has(i.position)||V(o)&&!n&&Oe(e,o))?r=r.filter(e=>e!==o):i=t,o=J(o)}return t.set(e,r),r}function Ae(n){let{element:r,boundary:i,rootBoundary:a,strategy:o}=n,s=[...i===`clippingAncestors`?H(r)?[]:ke(r,this._c):[].concat(i),a],c=s[0],l=s.reduce((n,i)=>{let a=De(r,i,o);return n.top=t(a.top,n.top),n.right=e(a.right,n.right),n.bottom=e(a.bottom,n.bottom),n.left=t(a.left,n.left),n},De(r,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function je(e){let{width:t,height:n}=me(e);return{width:t,height:n}}function Me(e,t,n){let i=B(t),a=R(t),o=n===`fixed`,s=Q(e,!0,o,t),c={scrollLeft:0,scrollTop:0},l=r(0);function u(){l.x=$(a)}if(i||!i&&!o)if((I(t)!==`body`||V(a))&&(c=q(t)),i){let e=Q(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&u();o&&!i&&a&&u();let d=a&&!i&&!o?ye(a,c):r(0);return{x:s.left+c.scrollLeft-l.x-d.x,y:s.top+c.scrollTop-l.y-d.y,width:s.width,height:s.height}}function Ne(e){return K(e).position===`static`}function Pe(e,t){if(!B(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return R(e)===n&&(n=n.ownerDocument.body),n}function Fe(e,t){let n=L(e);if(H(e))return n;if(!B(e)){let t=J(e);for(;t&&!G(t);){if(z(t)&&!Ne(t))return t;t=J(t)}return n}let r=Pe(e,t);for(;r&&oe(r)&&Ne(r);)r=Pe(r,t);return r&&G(r)&&Ne(r)&&!U(r)?n:r||de(e)||n}var Ie=async function(e){let t=this.getOffsetParent||Fe,n=this.getDimensions,r=await n(e.floating);return{reference:Me(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Le(e){return K(e).direction===`rtl`}var Re={convertOffsetParentRelativeRectToViewportRelativeRect:be,getDocumentElement:R,getClippingRect:Ae,getOffsetParent:Fe,getElementRects:Ie,getClientRects:xe,getDimensions:je,getScale:Z,isElement:z,isRTL:Le},ze=N,Be=P,Ve=j,He=A,Ue=(e,t,n)=>{let r=new Map,i={platform:Re,...n},a={...i.platform,_c:r};return k(e,t,{...i,platform:a})};return function(e,t={}){let n=e.nextElementSibling,r=n.querySelector(`.tooltip-arrow`),i=[ze(6),Ve(),Be({padding:5})];r&&i.push(He({element:r}));function a(){Ue(e,n,{placement:t.placement||`top`,middleware:i}).then(({x:e,y:t,placement:i,middlewareData:a})=>{if(Object.assign(n.style,{left:`${e}px`,top:`${t}px`}),a.arrow){let{x:e,y:t}=a.arrow,n={top:`bottom`,right:`left`,bottom:`top`,left:`right`}[i.split(`-`)[0]];Object.assign(r.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,right:``,bottom:``,[n]:`-4px`})}})}n.style.display=`block`,a(),requestAnimationFrame(()=>{n.style.display=``});let o=()=>{n.style.display=`block`,requestAnimationFrame(()=>{n.style.opacity=`1`,n.style.visibility=`visible`}),a()},s=()=>{n.style.display=``,n.style.opacity=``,n.style.visibility=``},c=()=>{if(n.style.display===`block`){s();return}o()},l=[`mouseenter`,`focus`],u=[`mouseleave`,`blur`],d=[];if(t.trigger===`click`&&(l=[],u=[`blur`],d=[`click`]),d.includes(`click`)){let t=r=>{!n.contains(r.target)&&!e.contains(r.target)&&(s(),document.removeEventListener(`click`,t))};e.addEventListener(`click`,()=>{document.addEventListener(`click`,t)})}l.forEach(t=>{e.addEventListener(t,o)}),u.forEach(t=>{e.addEventListener(t,s)}),d.forEach(t=>{e.addEventListener(t,c)})}})();