react-tooltip 5.1.0 → 5.1.2

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.
Files changed (32) hide show
  1. package/dist/react-tooltip.cjs.js +1 -1
  2. package/dist/react-tooltip.cjs.min.js +1 -1
  3. package/dist/react-tooltip.d.ts +2 -3
  4. package/dist/react-tooltip.esm.js +1 -1
  5. package/dist/react-tooltip.esm.min.js +1 -1
  6. package/dist/react-tooltip.umd.js +1 -1
  7. package/dist/react-tooltip.umd.min.js +1 -1
  8. package/package.json +1 -1
  9. package/src/App.tsx +119 -0
  10. package/src/components/Tooltip/Tooltip.tsx +226 -0
  11. package/src/components/Tooltip/TooltipTypes.d.ts +47 -0
  12. package/src/components/Tooltip/index.ts +1 -0
  13. package/src/components/Tooltip/styles.module.css +62 -0
  14. package/src/components/TooltipContent/TooltipContent.tsx +8 -0
  15. package/src/components/TooltipContent/TooltipContentTypes.d.ts +3 -0
  16. package/src/components/TooltipContent/index.ts +1 -0
  17. package/src/components/TooltipController/TooltipController.tsx +187 -0
  18. package/src/components/TooltipController/TooltipControllerTypes.d.ts +46 -0
  19. package/src/components/TooltipController/index.ts +1 -0
  20. package/src/components/TooltipProvider/TooltipProvider.tsx +110 -0
  21. package/src/components/TooltipProvider/TooltipProviderTypes.d.ts +33 -0
  22. package/src/components/TooltipProvider/TooltipWrapper.tsx +48 -0
  23. package/src/components/TooltipProvider/index.ts +2 -0
  24. package/src/index-dev.tsx +16 -0
  25. package/src/index.tsx +4 -0
  26. package/src/styles.module.css +5 -0
  27. package/src/test/__snapshots__/index.spec.js.snap +102 -0
  28. package/src/test/index.spec.js +143 -0
  29. package/src/tokens.css +8 -0
  30. package/src/utils/compute-positions-types.d.ts +8 -0
  31. package/src/utils/compute-positions.ts +65 -0
  32. package/src/utils/debounce.ts +27 -0
@@ -2890,7 +2890,7 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
2890
2890
  return () => {
2891
2891
  mounted = false;
2892
2892
  };
2893
- }, [show, isOpen, anchorId, activeAnchor, place, offset, positionStrategy]);
2893
+ }, [show, isOpen, anchorId, activeAnchor, content, place, offset, positionStrategy]);
2894
2894
  require$$0.useEffect(() => {
2895
2895
  return () => {
2896
2896
  if (tooltipShowDelayTimerRef.current) {
@@ -3,4 +3,4 @@
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */i=a,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}return n.join(" ")}i.exports?(t.default=t,i.exports=t):window.classNames=t}();var l=a.exports;const s=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},c=({content:e})=>r.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),u={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},f=Object.assign((()=>u),u),p=e.createContext(f);function d(){return e.useContext(p)}function y(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return["top","bottom"].includes(y(e))?"x":"y"}function g(e){return"y"===e?"height":"width"}function v(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=h(t),s=g(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(y(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(m(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function b(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function w(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function x(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=b(d),m=l[p?"floating"===f?"reference":"floating":f],h=w(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=w(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const S=Math.min,_=Math.max;function R(e,t,n){return _(e,S(t,n))}const k={left:"right",right:"left",bottom:"top",top:"bottom"};function T(e){return e.replace(/left|right|bottom|top/g,(e=>k[e]))}const j={start:"end",end:"start"};function O(e){return e.replace(/start|end/g,(e=>j[e]))}const E=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:d=!0,...v}=e,b=y(r),w=f||(b===a||!d?[T(a)]:function(e){const t=T(e);return[O(e),t,O(t)]}(a)),S=[a,...w],_=await x(t,v),R=[];let k=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&R.push(_[b]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=m(e),o=h(e),i=g(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=T(a)),{main:a,cross:T(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));R.push(_[e],_[t])}if(k=[...k,{placement:r,overflows:R}],!R.every((e=>e<=0))){var j,E;const e=(null!=(j=null==(E=o.flip)?void 0:E.index)?j:0)+1,t=S[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var A;const e=null==(A=k.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const A=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=y(n),l=m(n),s="x"===h(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:d,alignmentAxis:g}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof g&&(d="end"===l?-1*g:g),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function P(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function N(e){if(null==e)return window;if(!P(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return N(e).getComputedStyle(e)}function L(e){return P(e)?"":e?(e.nodeName||"").toLowerCase():""}function $(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function D(e){return e instanceof N(e).HTMLElement}function W(e){return e instanceof N(e).Element}function I(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof N(e).ShadowRoot||e instanceof ShadowRoot}function F(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=C(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function H(e){return["table","td","th"].includes(L(e))}function M(e){const t=/firefox/i.test($()),n=C(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function U(){return!/^((?!chrome|android).)*safari/i.test($())}function B(e){return["html","body","#document"].includes(L(e))}const V=Math.min,z=Math.max,q=Math.round;function Y(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&D(e)&&(s=e.offsetWidth>0&&q(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&q(l.height)/e.offsetHeight||1);const u=W(e)?N(e):window,f=!U()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function X(e){return(t=e,(t instanceof N(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function J(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function K(e){return Y(X(e)).left+J(e).scrollLeft}function Z(e,t,n){const r=D(t),o=X(t),i=Y(e,r&&function(e){const t=Y(e);return q(t.width)!==e.offsetWidth||q(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==L(t)||F(o))&&(a=J(t)),D(t)){const e=Y(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=K(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function G(e){if("html"===L(e))return e;const t=e.assignedSlot||e.parentNode||(I(e)?e.host:null)||X(e);return I(t)?t.host:t}function Q(e){return D(e)&&"fixed"!==C(e).position?e.offsetParent:null}function ee(e){const t=N(e);let n=Q(e);for(;n&&H(n)&&"static"===C(n).position;)n=Q(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===C(n).position&&!M(n))?t:n||function(e){let t=G(e);for(;D(t)&&!B(t);){if(M(t))return t;t=G(t)}return null}(e)||t}function te(e){if(D(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Y(e);return{width:t.width,height:t.height}}function ne(e){const t=G(e);return B(t)?e.ownerDocument.body:D(t)&&F(t)?t:ne(t)}function re(e,t){var n;void 0===t&&(t=[]);const r=ne(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=N(r),a=o?[i].concat(i.visualViewport||[],F(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(re(a))}function oe(e,t,n){return"viewport"===t?w(function(e,t){const n=N(e),r=X(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=U();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):W(t)?function(e,t){const n=Y(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):w(function(e){var t;const n=X(e),r=J(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=z(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=z(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+K(e);const s=-r.scrollTop;return"rtl"===C(o||n).direction&&(l+=z(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(X(e)))}const ie={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=re(e).filter((e=>W(e)&&"body"!==L(e))),n=e,r=null;for(;W(n)&&!B(n);){const e=C(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!M(n)?t=t.filter((e=>e!==n)):r=e,n=G(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=oe(t,n,o);return e.top=z(r.top,e.top),e.right=V(r.right,e.right),e.bottom=V(r.bottom,e.bottom),e.left=z(r.left,e.left),e}),oe(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=D(n),i=X(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==L(n)||F(i))&&(a=J(n)),D(n))){const e=Y(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:W,getDimensions:te,getOffsetParent:ee,getDocumentElement:X,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Z(t,ee(n),r),floating:{...te(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===C(e).direction},ae=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=v(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:g,data:b,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=g?g:f,d={...d,[i]:{...d[i],...b}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&y<=50&&(y++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=v(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:ie,...n}),le=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const a=[A(Number(o)),E(),(l={padding:5},void 0===l&&(l={}),{name:"shift",options:l,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=l,c={x:t,y:n},u=await x(e,s),f=h(y(r)),p="x"===f?"y":"x";let d=c[f],m=c[p];if(o){const e="y"===f?"bottom":"right";d=R(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";m=R(m+u["y"===p?"top":"left"],m,m-u[e])}const g=a.fn({...e,[f]:d,[p]:m});return{...g,data:{x:g.x-t,y:g.y-n}}}})];var l;return n?(a.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=b(r),u={x:o,y:i},f=h(a),p=m(a),d=g(f),y=await s.getDimensions(n),v="y"===f?"top":"left",w="y"===f?"bottom":"right",x=l.reference[d]+l.reference[f]-u[f]-l.floating[d],S=u[f]-l.reference[f],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let k=_?"y"===f?_.clientHeight||0:_.clientWidth||0:0;0===k&&(k=l.floating[d]);const T=x/2-S/2,j=c[v],O=k-y[d]-c[w],E=k/2-y[d]/2+T,A=R(j,E,O),P=("start"===p?c[v]:c[w])>0&&E!==A&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(P?E<j?j-E:O-E:0),data:{[f]:A,centerOffset:E-A}}}}))({element:n})),ae(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const a={left:`${e}px`,top:`${t}px`},{x:l,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:a,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):ae(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var se={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ce=({id:t,className:n,classNameArrow:o,variant:i="dark",anchorId:a,place:u="top",offset:f=10,events:p=["hover"],positionStrategy:y="absolute",wrapper:m="div",children:h=null,delayShow:g=0,delayHide:v=0,style:b,isHtmlContent:w=!1,content:x,isOpen:S,setIsOpen:_})=>{const R=e.useRef(null),k=e.useRef(null),T=e.useRef(null),j=e.useRef(null),[O,E]=e.useState({}),[A,P]=e.useState({}),[N,C]=e.useState(!1),[L,$]=e.useState(!1),{anchorRefs:D,setActiveAnchor:W}=d()(t),[I,F]=e.useState({current:null}),H=e=>{_?_(e):void 0===S&&C(e)},M=()=>{_?_(!S):void 0===S&&C((e=>!e))},U=s((e=>{e&&(g?(T.current&&clearTimeout(T.current),T.current=setTimeout((()=>{H(!0)}),g)):H(!0),F((t=>t.current===e.target?t:{current:e.target})),W({current:e.target}),j.current&&clearTimeout(j.current))}),50),B=s((()=>{v?(j.current&&clearTimeout(j.current),j.current=setTimeout((()=>{H(!1)}),v)):H(!1),T.current&&clearTimeout(T.current)}),50);return e.useEffect((()=>{const e=new Set(D),t=document.querySelector(`[id='${a}']`);if(t&&(F((e=>e.current===t?e:{current:t})),e.add({current:t})),!e.size)return()=>{};const n=[];return p.find((e=>"click"===e))&&n.push({event:"click",listener:M}),p.find((e=>"hover"===e))&&n.push({event:"mouseenter",listener:U},{event:"mouseleave",listener:B},{event:"focus",listener:U},{event:"blur",listener:B}),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.addEventListener(t,n)}))})),()=>{n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.removeEventListener(t,n)}))}))}}),[D,a,p,v,g]),e.useEffect((()=>{let e=I.current;a&&(e=document.querySelector(`[id='${a}']`)),$(!0);let t=!0;return le({place:u,offset:f,elementReference:e,tooltipReference:R.current,tooltipArrowReference:k.current,strategy:y}).then((e=>{t&&($(!1),Object.keys(e.tooltipStyles).length&&E(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&P(e.tooltipArrowStyles))})),()=>{t=!1}}),[N,S,a,I,u,f,y]),e.useEffect((()=>()=>{T.current&&clearTimeout(T.current),j.current&&clearTimeout(j.current)}),[]),r.exports.jsxs(m,{id:t,role:"tooltip",className:l(se.tooltip,se[i],n,{[se.show]:!L&&(S||N),[se.fixed]:"fixed"===y}),style:{...b,...O},ref:R,children:[h||(w?r.exports.jsx(c,{content:x}):x),r.exports.jsx("div",{className:l(se.arrow,o),style:A,ref:k})]})};exports.Tooltip=({id:t,anchorId:n,content:o,html:i,className:a,classNameArrow:l,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:g=0,style:v,isOpen:b,setIsOpen:w})=>{const[x,S]=e.useState(o||i),[_,R]=e.useState(c),[k,T]=e.useState(s),[j,O]=e.useState(u),[E,A]=e.useState(h),[P,N]=e.useState(g),[C,L]=e.useState(f),[$,D]=e.useState(y),[W,I]=e.useState(m),[F,H]=e.useState(Boolean(i)),{anchorRefs:M,activeAnchor:U}=d()(t),B=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),V=e=>{const t={place:e=>{var t;R(null!==(t=e)&&void 0!==t?t:c)},content:e=>{H(!1),S(null!=e?e:o)},html:e=>{var t;H(!!e),S(null!==(t=null!=e?e:i)&&void 0!==t?t:o)},variant:e=>{var t;T(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{O(null===e?u:Number(e))},wrapper:e=>{var t;L(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");D(null!=t?t:y)},"position-strategy":e=>{var t;I(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{A(null===e?h:Number(e))},"delay-hide":e=>{N(null===e?g:Number(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};e.useEffect((()=>{o&&S(o),i&&S(i)}),[o,i]),e.useEffect((()=>{var e;const t=new Set(M),r=document.querySelector(`[id='${n}']`);if(r&&t.add({current:r}),!t.size)return()=>{};const o=new MutationObserver((e=>{e.forEach((e=>{var t;if(!U.current||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=B(U.current);V(n)}))})),i={attributes:!0,childList:!1,subtree:!1},a=null!==(e=U.current)&&void 0!==e?e:r;if(a){const e=B(a);V(e),o.observe(a,i)}return()=>{o.disconnect()}}),[M,U,n]);const z={id:t,anchorId:n,className:a,classNameArrow:l,content:x,isHtmlContent:F,place:_,variant:k,offset:j,wrapper:C,events:$,positionStrategy:W,delayShow:E,delayHide:P,style:v,isOpen:b,setIsOpen:w};return p?r.exports.jsx(ce,{...z,children:p}):r.exports.jsx(ce,{...z})},exports.TooltipProvider=({children:t})=>{const n=e.useId(),[o,i]=e.useState({[n]:new Set}),[a,l]=e.useState({[n]:{current:null}}),s=(e,...t)=>{i((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},c=(e,...t)=>{i((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},u=e.useCallback((e=>{var t,r;return{anchorRefs:null!==(t=o[null!=e?e:n])&&void 0!==t?t:new Set,activeAnchor:null!==(r=a[null!=e?e:n])&&void 0!==r?r:{current:null},attach:(...t)=>s(null!=e?e:n,...t),detach:(...t)=>c(null!=e?e:n,...t),setActiveAnchor:t=>((e,t)=>{l((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(null!=e?e:n,t)}}),[n,o,a,s,c]),f=e.useMemo((()=>{const e=u(n);return Object.assign((e=>u(e)),e)}),[u]);return r.exports.jsx(p.Provider,{value:f,children:t})},exports.TooltipWrapper=({tooltipId:t,children:n,place:o,content:i,html:a,variant:l,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:p,delayHide:y})=>{const{attach:m,detach:h}=d()(t),g=e.useRef(null);return e.useEffect((()=>(m(g),()=>{h(g)})),[]),r.exports.jsx("span",{ref:g,"data-tooltip-place":o,"data-tooltip-content":i,"data-tooltip-html":a,"data-tooltip-variant":l,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":y,children:n})};
6
+ */i=a,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}return n.join(" ")}i.exports?(t.default=t,i.exports=t):window.classNames=t}();var l=a.exports;const s=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},c=({content:e})=>r.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),u={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},f=Object.assign((()=>u),u),p=e.createContext(f);function d(){return e.useContext(p)}function y(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return["top","bottom"].includes(y(e))?"x":"y"}function g(e){return"y"===e?"height":"width"}function v(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=h(t),s=g(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(y(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(m(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function b(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function w(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function x(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=b(d),m=l[p?"floating"===f?"reference":"floating":f],h=w(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=w(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const S=Math.min,_=Math.max;function R(e,t,n){return _(e,S(t,n))}const k={left:"right",right:"left",bottom:"top",top:"bottom"};function T(e){return e.replace(/left|right|bottom|top/g,(e=>k[e]))}const j={start:"end",end:"start"};function O(e){return e.replace(/start|end/g,(e=>j[e]))}const E=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:d=!0,...v}=e,b=y(r),w=f||(b===a||!d?[T(a)]:function(e){const t=T(e);return[O(e),t,O(t)]}(a)),S=[a,...w],_=await x(t,v),R=[];let k=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&R.push(_[b]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=m(e),o=h(e),i=g(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=T(a)),{main:a,cross:T(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));R.push(_[e],_[t])}if(k=[...k,{placement:r,overflows:R}],!R.every((e=>e<=0))){var j,E;const e=(null!=(j=null==(E=o.flip)?void 0:E.index)?j:0)+1,t=S[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var A;const e=null==(A=k.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const A=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=y(n),l=m(n),s="x"===h(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:d,alignmentAxis:g}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof g&&(d="end"===l?-1*g:g),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function P(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function N(e){if(null==e)return window;if(!P(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return N(e).getComputedStyle(e)}function L(e){return P(e)?"":e?(e.nodeName||"").toLowerCase():""}function $(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function D(e){return e instanceof N(e).HTMLElement}function W(e){return e instanceof N(e).Element}function I(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof N(e).ShadowRoot||e instanceof ShadowRoot}function F(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=C(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function H(e){return["table","td","th"].includes(L(e))}function M(e){const t=/firefox/i.test($()),n=C(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function U(){return!/^((?!chrome|android).)*safari/i.test($())}function B(e){return["html","body","#document"].includes(L(e))}const V=Math.min,z=Math.max,q=Math.round;function Y(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&D(e)&&(s=e.offsetWidth>0&&q(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&q(l.height)/e.offsetHeight||1);const u=W(e)?N(e):window,f=!U()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function X(e){return(t=e,(t instanceof N(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function J(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function K(e){return Y(X(e)).left+J(e).scrollLeft}function Z(e,t,n){const r=D(t),o=X(t),i=Y(e,r&&function(e){const t=Y(e);return q(t.width)!==e.offsetWidth||q(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==L(t)||F(o))&&(a=J(t)),D(t)){const e=Y(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=K(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function G(e){if("html"===L(e))return e;const t=e.assignedSlot||e.parentNode||(I(e)?e.host:null)||X(e);return I(t)?t.host:t}function Q(e){return D(e)&&"fixed"!==C(e).position?e.offsetParent:null}function ee(e){const t=N(e);let n=Q(e);for(;n&&H(n)&&"static"===C(n).position;)n=Q(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===C(n).position&&!M(n))?t:n||function(e){let t=G(e);for(;D(t)&&!B(t);){if(M(t))return t;t=G(t)}return null}(e)||t}function te(e){if(D(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Y(e);return{width:t.width,height:t.height}}function ne(e){const t=G(e);return B(t)?e.ownerDocument.body:D(t)&&F(t)?t:ne(t)}function re(e,t){var n;void 0===t&&(t=[]);const r=ne(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=N(r),a=o?[i].concat(i.visualViewport||[],F(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(re(a))}function oe(e,t,n){return"viewport"===t?w(function(e,t){const n=N(e),r=X(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=U();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):W(t)?function(e,t){const n=Y(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):w(function(e){var t;const n=X(e),r=J(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=z(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=z(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+K(e);const s=-r.scrollTop;return"rtl"===C(o||n).direction&&(l+=z(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(X(e)))}const ie={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=re(e).filter((e=>W(e)&&"body"!==L(e))),n=e,r=null;for(;W(n)&&!B(n);){const e=C(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!M(n)?t=t.filter((e=>e!==n)):r=e,n=G(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=oe(t,n,o);return e.top=z(r.top,e.top),e.right=V(r.right,e.right),e.bottom=V(r.bottom,e.bottom),e.left=z(r.left,e.left),e}),oe(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=D(n),i=X(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==L(n)||F(i))&&(a=J(n)),D(n))){const e=Y(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:W,getDimensions:te,getOffsetParent:ee,getDocumentElement:X,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Z(t,ee(n),r),floating:{...te(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===C(e).direction},ae=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=v(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:g,data:b,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=g?g:f,d={...d,[i]:{...d[i],...b}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&y<=50&&(y++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=v(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:ie,...n}),le=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const a=[A(Number(o)),E(),(l={padding:5},void 0===l&&(l={}),{name:"shift",options:l,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=l,c={x:t,y:n},u=await x(e,s),f=h(y(r)),p="x"===f?"y":"x";let d=c[f],m=c[p];if(o){const e="y"===f?"bottom":"right";d=R(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";m=R(m+u["y"===p?"top":"left"],m,m-u[e])}const g=a.fn({...e,[f]:d,[p]:m});return{...g,data:{x:g.x-t,y:g.y-n}}}})];var l;return n?(a.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=b(r),u={x:o,y:i},f=h(a),p=m(a),d=g(f),y=await s.getDimensions(n),v="y"===f?"top":"left",w="y"===f?"bottom":"right",x=l.reference[d]+l.reference[f]-u[f]-l.floating[d],S=u[f]-l.reference[f],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let k=_?"y"===f?_.clientHeight||0:_.clientWidth||0:0;0===k&&(k=l.floating[d]);const T=x/2-S/2,j=c[v],O=k-y[d]-c[w],E=k/2-y[d]/2+T,A=R(j,E,O),P=("start"===p?c[v]:c[w])>0&&E!==A&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(P?E<j?j-E:O-E:0),data:{[f]:A,centerOffset:E-A}}}}))({element:n})),ae(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const a={left:`${e}px`,top:`${t}px`},{x:l,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:a,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):ae(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var se={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ce=({id:t,className:n,classNameArrow:o,variant:i="dark",anchorId:a,place:u="top",offset:f=10,events:p=["hover"],positionStrategy:y="absolute",wrapper:m="div",children:h=null,delayShow:g=0,delayHide:v=0,style:b,isHtmlContent:w=!1,content:x,isOpen:S,setIsOpen:_})=>{const R=e.useRef(null),k=e.useRef(null),T=e.useRef(null),j=e.useRef(null),[O,E]=e.useState({}),[A,P]=e.useState({}),[N,C]=e.useState(!1),[L,$]=e.useState(!1),{anchorRefs:D,setActiveAnchor:W}=d()(t),[I,F]=e.useState({current:null}),H=e=>{_?_(e):void 0===S&&C(e)},M=()=>{_?_(!S):void 0===S&&C((e=>!e))},U=s((e=>{e&&(g?(T.current&&clearTimeout(T.current),T.current=setTimeout((()=>{H(!0)}),g)):H(!0),F((t=>t.current===e.target?t:{current:e.target})),W({current:e.target}),j.current&&clearTimeout(j.current))}),50),B=s((()=>{v?(j.current&&clearTimeout(j.current),j.current=setTimeout((()=>{H(!1)}),v)):H(!1),T.current&&clearTimeout(T.current)}),50);return e.useEffect((()=>{const e=new Set(D),t=document.querySelector(`[id='${a}']`);if(t&&(F((e=>e.current===t?e:{current:t})),e.add({current:t})),!e.size)return()=>{};const n=[];return p.find((e=>"click"===e))&&n.push({event:"click",listener:M}),p.find((e=>"hover"===e))&&n.push({event:"mouseenter",listener:U},{event:"mouseleave",listener:B},{event:"focus",listener:U},{event:"blur",listener:B}),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.addEventListener(t,n)}))})),()=>{n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.removeEventListener(t,n)}))}))}}),[D,a,p,v,g]),e.useEffect((()=>{let e=I.current;a&&(e=document.querySelector(`[id='${a}']`)),$(!0);let t=!0;return le({place:u,offset:f,elementReference:e,tooltipReference:R.current,tooltipArrowReference:k.current,strategy:y}).then((e=>{t&&($(!1),Object.keys(e.tooltipStyles).length&&E(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&P(e.tooltipArrowStyles))})),()=>{t=!1}}),[N,S,a,I,x,u,f,y]),e.useEffect((()=>()=>{T.current&&clearTimeout(T.current),j.current&&clearTimeout(j.current)}),[]),r.exports.jsxs(m,{id:t,role:"tooltip",className:l(se.tooltip,se[i],n,{[se.show]:!L&&(S||N),[se.fixed]:"fixed"===y}),style:{...b,...O},ref:R,children:[h||(w?r.exports.jsx(c,{content:x}):x),r.exports.jsx("div",{className:l(se.arrow,o),style:A,ref:k})]})};exports.Tooltip=({id:t,anchorId:n,content:o,html:i,className:a,classNameArrow:l,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:g=0,style:v,isOpen:b,setIsOpen:w})=>{const[x,S]=e.useState(o||i),[_,R]=e.useState(c),[k,T]=e.useState(s),[j,O]=e.useState(u),[E,A]=e.useState(h),[P,N]=e.useState(g),[C,L]=e.useState(f),[$,D]=e.useState(y),[W,I]=e.useState(m),[F,H]=e.useState(Boolean(i)),{anchorRefs:M,activeAnchor:U}=d()(t),B=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),V=e=>{const t={place:e=>{var t;R(null!==(t=e)&&void 0!==t?t:c)},content:e=>{H(!1),S(null!=e?e:o)},html:e=>{var t;H(!!e),S(null!==(t=null!=e?e:i)&&void 0!==t?t:o)},variant:e=>{var t;T(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{O(null===e?u:Number(e))},wrapper:e=>{var t;L(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");D(null!=t?t:y)},"position-strategy":e=>{var t;I(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{A(null===e?h:Number(e))},"delay-hide":e=>{N(null===e?g:Number(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};e.useEffect((()=>{o&&S(o),i&&S(i)}),[o,i]),e.useEffect((()=>{var e;const t=new Set(M),r=document.querySelector(`[id='${n}']`);if(r&&t.add({current:r}),!t.size)return()=>{};const o=new MutationObserver((e=>{e.forEach((e=>{var t;if(!U.current||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=B(U.current);V(n)}))})),i={attributes:!0,childList:!1,subtree:!1},a=null!==(e=U.current)&&void 0!==e?e:r;if(a){const e=B(a);V(e),o.observe(a,i)}return()=>{o.disconnect()}}),[M,U,n]);const z={id:t,anchorId:n,className:a,classNameArrow:l,content:x,isHtmlContent:F,place:_,variant:k,offset:j,wrapper:C,events:$,positionStrategy:W,delayShow:E,delayHide:P,style:v,isOpen:b,setIsOpen:w};return p?r.exports.jsx(ce,{...z,children:p}):r.exports.jsx(ce,{...z})},exports.TooltipProvider=({children:t})=>{const n=e.useId(),[o,i]=e.useState({[n]:new Set}),[a,l]=e.useState({[n]:{current:null}}),s=(e,...t)=>{i((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},c=(e,...t)=>{i((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},u=e.useCallback((e=>{var t,r;return{anchorRefs:null!==(t=o[null!=e?e:n])&&void 0!==t?t:new Set,activeAnchor:null!==(r=a[null!=e?e:n])&&void 0!==r?r:{current:null},attach:(...t)=>s(null!=e?e:n,...t),detach:(...t)=>c(null!=e?e:n,...t),setActiveAnchor:t=>((e,t)=>{l((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(null!=e?e:n,t)}}),[n,o,a,s,c]),f=e.useMemo((()=>{const e=u(n);return Object.assign((e=>u(e)),e)}),[u]);return r.exports.jsx(p.Provider,{value:f,children:t})},exports.TooltipWrapper=({tooltipId:t,children:n,place:o,content:i,html:a,variant:l,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:p,delayHide:y})=>{const{attach:m,detach:h}=d()(t),g=e.useRef(null);return e.useEffect((()=>(m(g),()=>{h(g)})),[]),r.exports.jsx("span",{ref:g,"data-tooltip-place":o,"data-tooltip-content":i,"data-tooltip-html":a,"data-tooltip-variant":l,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":y,children:n})};
@@ -1,4 +1,4 @@
1
- import React, { ElementType, Element, ReactNode, CSSProperties, MutableRefObject, ReactElement, PropsWithChildren } from 'react';
1
+ import React, { ElementType, Element, ReactNode, CSSProperties, PropsWithChildren } from 'react';
2
2
 
3
3
  type PlacesType = 'top' | 'right' | 'bottom' | 'left'
4
4
 
@@ -52,8 +52,7 @@ declare const TooltipController: ({ id, anchorId, content, html, className, clas
52
52
 
53
53
  interface ITooltipWrapper {
54
54
  tooltipId?: string
55
- forwardRef?: MutableRefObject<HTMLElement | null>
56
- children: ReactElement
55
+ children: ReactNode
57
56
 
58
57
  place?: ITooltipController['place']
59
58
  content?: ITooltipController['content']
@@ -2882,7 +2882,7 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
2882
2882
  return () => {
2883
2883
  mounted = false;
2884
2884
  };
2885
- }, [show, isOpen, anchorId, activeAnchor, place, offset, positionStrategy]);
2885
+ }, [show, isOpen, anchorId, activeAnchor, content, place, offset, positionStrategy]);
2886
2886
  useEffect(() => {
2887
2887
  return () => {
2888
2888
  if (tooltipShowDelayTimerRef.current) {
@@ -3,4 +3,4 @@ import e,{createContext as t,useId as n,useState as r,useCallback as o,useMemo a
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */f=p,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}return n.join(" ")}f.exports?(t.default=t,f.exports=t):window.classNames=t}();var d=p.exports;const y=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},m=({content:e})=>c.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),h={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},g=t(Object.assign((()=>h),h)),v=({children:e})=>{const t=n(),[a,l]=r({[t]:new Set}),[s,u]=r({[t]:{current:null}}),f=(e,...t)=>{l((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},p=(e,...t)=>{l((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},d=o((e=>{var n,r;return{anchorRefs:null!==(n=a[null!=e?e:t])&&void 0!==n?n:new Set,activeAnchor:null!==(r=s[null!=e?e:t])&&void 0!==r?r:{current:null},attach:(...n)=>f(null!=e?e:t,...n),detach:(...n)=>p(null!=e?e:t,...n),setActiveAnchor:n=>((e,t)=>{u((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(null!=e?e:t,n)}}),[t,a,s,f,p]),y=i((()=>{const e=d(t);return Object.assign((e=>d(e)),e)}),[d]);return c.exports.jsx(g.Provider,{value:y,children:e})};function b(){return a(g)}const w=({tooltipId:e,children:t,place:n,content:r,html:o,variant:i,offset:a,wrapper:u,events:f,positionStrategy:p,delayShow:d,delayHide:y})=>{const{attach:m,detach:h}=b()(e),g=l(null);return s((()=>(m(g),()=>{h(g)})),[]),c.exports.jsx("span",{ref:g,"data-tooltip-place":n,"data-tooltip-content":r,"data-tooltip-html":o,"data-tooltip-variant":i,"data-tooltip-offset":a,"data-tooltip-wrapper":u,"data-tooltip-events":f,"data-tooltip-position-strategy":p,"data-tooltip-delay-show":d,"data-tooltip-delay-hide":y,children:t})};function x(e){return e.split("-")[0]}function S(e){return e.split("-")[1]}function _(e){return["top","bottom"].includes(x(e))?"x":"y"}function R(e){return"y"===e?"height":"width"}function k(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=_(t),s=R(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(x(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(S(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function T(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function j(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function O(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=T(d),m=l[p?"floating"===f?"reference":"floating":f],h=j(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=j(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const E=Math.min,A=Math.max;function P(e,t,n){return A(e,E(t,n))}const N={left:"right",right:"left",bottom:"top",top:"bottom"};function L(e){return e.replace(/left|right|bottom|top/g,(e=>N[e]))}const C={start:"end",end:"start"};function $(e){return e.replace(/start|end/g,(e=>C[e]))}const D=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:d=!0,...y}=e,m=x(r),h=f||(m===a||!d?[L(a)]:function(e){const t=L(e);return[$(e),t,$(t)]}(a)),g=[a,...h],v=await O(t,y),b=[];let w=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&b.push(v[m]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=S(e),o=_(e),i=R(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=L(a)),{main:a,cross:L(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));b.push(v[e],v[t])}if(w=[...w,{placement:r,overflows:b}],!b.every((e=>e<=0))){var k,T;const e=(null!=(k=null==(T=o.flip)?void 0:T.index)?k:0)+1,t=g[e];if(t)return{data:{index:e,overflows:w},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var j;const e=null==(j=w.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:j[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const W=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=x(n),l=S(n),s="x"===_(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:d,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof y&&(d="end"===l?-1*y:y),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function F(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function I(e){if(null==e)return window;if(!F(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return I(e).getComputedStyle(e)}function U(e){return F(e)?"":e?(e.nodeName||"").toLowerCase():""}function M(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function B(e){return e instanceof I(e).HTMLElement}function V(e){return e instanceof I(e).Element}function z(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof I(e).ShadowRoot||e instanceof ShadowRoot}function Y(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=H(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function q(e){return["table","td","th"].includes(U(e))}function X(e){const t=/firefox/i.test(M()),n=H(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function J(){return!/^((?!chrome|android).)*safari/i.test(M())}function K(e){return["html","body","#document"].includes(U(e))}const Z=Math.min,G=Math.max,Q=Math.round;function ee(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&B(e)&&(s=e.offsetWidth>0&&Q(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Q(l.height)/e.offsetHeight||1);const u=V(e)?I(e):window,f=!J()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function te(e){return(t=e,(t instanceof I(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function ne(e){return V(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function re(e){return ee(te(e)).left+ne(e).scrollLeft}function oe(e,t,n){const r=B(t),o=te(t),i=ee(e,r&&function(e){const t=ee(e);return Q(t.width)!==e.offsetWidth||Q(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==U(t)||Y(o))&&(a=ne(t)),B(t)){const e=ee(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=re(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function ie(e){if("html"===U(e))return e;const t=e.assignedSlot||e.parentNode||(z(e)?e.host:null)||te(e);return z(t)?t.host:t}function ae(e){return B(e)&&"fixed"!==H(e).position?e.offsetParent:null}function le(e){const t=I(e);let n=ae(e);for(;n&&q(n)&&"static"===H(n).position;)n=ae(n);return n&&("html"===U(n)||"body"===U(n)&&"static"===H(n).position&&!X(n))?t:n||function(e){let t=ie(e);for(;B(t)&&!K(t);){if(X(t))return t;t=ie(t)}return null}(e)||t}function se(e){if(B(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=ee(e);return{width:t.width,height:t.height}}function ce(e){const t=ie(e);return K(t)?e.ownerDocument.body:B(t)&&Y(t)?t:ce(t)}function ue(e,t){var n;void 0===t&&(t=[]);const r=ce(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=I(r),a=o?[i].concat(i.visualViewport||[],Y(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(ue(a))}function fe(e,t,n){return"viewport"===t?j(function(e,t){const n=I(e),r=te(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=J();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):V(t)?function(e,t){const n=ee(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):j(function(e){var t;const n=te(e),r=ne(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=G(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=G(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+re(e);const s=-r.scrollTop;return"rtl"===H(o||n).direction&&(l+=G(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(te(e)))}const pe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=ue(e).filter((e=>V(e)&&"body"!==U(e))),n=e,r=null;for(;V(n)&&!K(n);){const e=H(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!X(n)?t=t.filter((e=>e!==n)):r=e,n=ie(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=fe(t,n,o);return e.top=G(r.top,e.top),e.right=Z(r.right,e.right),e.bottom=Z(r.bottom,e.bottom),e.left=G(r.left,e.left),e}),fe(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=B(n),i=te(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==U(n)||Y(i))&&(a=ne(n)),B(n))){const e=ee(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:V,getDimensions:se,getOffsetParent:le,getDocumentElement:te,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:oe(t,le(n),r),floating:{...se(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===H(e).direction},de=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=k(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:g,data:v,reset:b}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=g?g:f,d={...d,[i]:{...d[i],...v}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),b&&y<=50&&(y++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:f}=k(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:pe,...n}),ye=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const a=[W(Number(o)),D(),(l={padding:5},void 0===l&&(l={}),{name:"shift",options:l,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=l,c={x:t,y:n},u=await O(e,s),f=_(x(r)),p="x"===f?"y":"x";let d=c[f],y=c[p];if(o){const e="y"===f?"bottom":"right";d=P(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";y=P(y+u["y"===p?"top":"left"],y,y-u[e])}const m=a.fn({...e,[f]:d,[p]:y});return{...m,data:{x:m.x-t,y:m.y-n}}}})];var l;return n?(a.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=T(r),u={x:o,y:i},f=_(a),p=S(a),d=R(f),y=await s.getDimensions(n),m="y"===f?"top":"left",h="y"===f?"bottom":"right",g=l.reference[d]+l.reference[f]-u[f]-l.floating[d],v=u[f]-l.reference[f],b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let w=b?"y"===f?b.clientHeight||0:b.clientWidth||0:0;0===w&&(w=l.floating[d]);const x=g/2-v/2,k=c[m],j=w-y[d]-c[h],O=w/2-y[d]/2+x,E=P(k,O,j),A=("start"===p?c[m]:c[h])>0&&O!==E&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(A?O<k?k-O:j-O:0),data:{[f]:E,centerOffset:O-E}}}}))({element:n})),de(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const a={left:`${e}px`,top:`${t}px`},{x:l,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:a,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):de(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var me={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const he=({id:e,className:t,classNameArrow:n,variant:o="dark",anchorId:i,place:a="top",offset:u=10,events:f=["hover"],positionStrategy:p="absolute",wrapper:h="div",children:g=null,delayShow:v=0,delayHide:w=0,style:x,isHtmlContent:S=!1,content:_,isOpen:R,setIsOpen:k})=>{const T=l(null),j=l(null),O=l(null),E=l(null),[A,P]=r({}),[N,L]=r({}),[C,$]=r(!1),[D,W]=r(!1),{anchorRefs:F,setActiveAnchor:I}=b()(e),[H,U]=r({current:null}),M=e=>{k?k(e):void 0===R&&$(e)},B=()=>{k?k(!R):void 0===R&&$((e=>!e))},V=y((e=>{e&&(v?(O.current&&clearTimeout(O.current),O.current=setTimeout((()=>{M(!0)}),v)):M(!0),U((t=>t.current===e.target?t:{current:e.target})),I({current:e.target}),E.current&&clearTimeout(E.current))}),50),z=y((()=>{w?(E.current&&clearTimeout(E.current),E.current=setTimeout((()=>{M(!1)}),w)):M(!1),O.current&&clearTimeout(O.current)}),50);return s((()=>{const e=new Set(F),t=document.querySelector(`[id='${i}']`);if(t&&(U((e=>e.current===t?e:{current:t})),e.add({current:t})),!e.size)return()=>{};const n=[];return f.find((e=>"click"===e))&&n.push({event:"click",listener:B}),f.find((e=>"hover"===e))&&n.push({event:"mouseenter",listener:V},{event:"mouseleave",listener:z},{event:"focus",listener:V},{event:"blur",listener:z}),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.addEventListener(t,n)}))})),()=>{n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.removeEventListener(t,n)}))}))}}),[F,i,f,w,v]),s((()=>{let e=H.current;i&&(e=document.querySelector(`[id='${i}']`)),W(!0);let t=!0;return ye({place:a,offset:u,elementReference:e,tooltipReference:T.current,tooltipArrowReference:j.current,strategy:p}).then((e=>{t&&(W(!1),Object.keys(e.tooltipStyles).length&&P(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&L(e.tooltipArrowStyles))})),()=>{t=!1}}),[C,R,i,H,a,u,p]),s((()=>()=>{O.current&&clearTimeout(O.current),E.current&&clearTimeout(E.current)}),[]),c.exports.jsxs(h,{id:e,role:"tooltip",className:d(me.tooltip,me[o],t,{[me.show]:!D&&(R||C),[me.fixed]:"fixed"===p}),style:{...x,...A},ref:T,children:[g||(S?c.exports.jsx(m,{content:_}):_),c.exports.jsx("div",{className:d(me.arrow,n),style:N,ref:j})]})},ge=({id:e,anchorId:t,content:n,html:o,className:i,classNameArrow:a,variant:l="dark",place:u="top",offset:f=10,wrapper:p="div",children:d=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:g=0,style:v,isOpen:w,setIsOpen:x})=>{const[S,_]=r(n||o),[R,k]=r(u),[T,j]=r(l),[O,E]=r(f),[A,P]=r(h),[N,L]=r(g),[C,$]=r(p),[D,W]=r(y),[F,I]=r(m),[H,U]=r(Boolean(o)),{anchorRefs:M,activeAnchor:B}=b()(e),V=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),z=e=>{const t={place:e=>{var t;k(null!==(t=e)&&void 0!==t?t:u)},content:e=>{U(!1),_(null!=e?e:n)},html:e=>{var t;U(!!e),_(null!==(t=null!=e?e:o)&&void 0!==t?t:n)},variant:e=>{var t;j(null!==(t=e)&&void 0!==t?t:l)},offset:e=>{E(null===e?f:Number(e))},wrapper:e=>{var t;$(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");W(null!=t?t:y)},"position-strategy":e=>{var t;I(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{P(null===e?h:Number(e))},"delay-hide":e=>{L(null===e?g:Number(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};s((()=>{n&&_(n),o&&_(o)}),[n,o]),s((()=>{var e;const n=new Set(M),r=document.querySelector(`[id='${t}']`);if(r&&n.add({current:r}),!n.size)return()=>{};const o=new MutationObserver((e=>{e.forEach((e=>{var t;if(!B.current||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=V(B.current);z(n)}))})),i={attributes:!0,childList:!1,subtree:!1},a=null!==(e=B.current)&&void 0!==e?e:r;if(a){const e=V(a);z(e),o.observe(a,i)}return()=>{o.disconnect()}}),[M,B,t]);const Y={id:e,anchorId:t,className:i,classNameArrow:a,content:S,isHtmlContent:H,place:R,variant:T,offset:O,wrapper:C,events:D,positionStrategy:F,delayShow:A,delayHide:N,style:v,isOpen:w,setIsOpen:x};return d?c.exports.jsx(he,{...Y,children:d}):c.exports.jsx(he,{...Y})};export{ge as Tooltip,v as TooltipProvider,w as TooltipWrapper};
6
+ */f=p,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}return n.join(" ")}f.exports?(t.default=t,f.exports=t):window.classNames=t}();var d=p.exports;const y=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},m=({content:e})=>c.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),h={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},g=t(Object.assign((()=>h),h)),v=({children:e})=>{const t=n(),[a,l]=r({[t]:new Set}),[s,u]=r({[t]:{current:null}}),f=(e,...t)=>{l((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},p=(e,...t)=>{l((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},d=o((e=>{var n,r;return{anchorRefs:null!==(n=a[null!=e?e:t])&&void 0!==n?n:new Set,activeAnchor:null!==(r=s[null!=e?e:t])&&void 0!==r?r:{current:null},attach:(...n)=>f(null!=e?e:t,...n),detach:(...n)=>p(null!=e?e:t,...n),setActiveAnchor:n=>((e,t)=>{u((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(null!=e?e:t,n)}}),[t,a,s,f,p]),y=i((()=>{const e=d(t);return Object.assign((e=>d(e)),e)}),[d]);return c.exports.jsx(g.Provider,{value:y,children:e})};function b(){return a(g)}const w=({tooltipId:e,children:t,place:n,content:r,html:o,variant:i,offset:a,wrapper:u,events:f,positionStrategy:p,delayShow:d,delayHide:y})=>{const{attach:m,detach:h}=b()(e),g=l(null);return s((()=>(m(g),()=>{h(g)})),[]),c.exports.jsx("span",{ref:g,"data-tooltip-place":n,"data-tooltip-content":r,"data-tooltip-html":o,"data-tooltip-variant":i,"data-tooltip-offset":a,"data-tooltip-wrapper":u,"data-tooltip-events":f,"data-tooltip-position-strategy":p,"data-tooltip-delay-show":d,"data-tooltip-delay-hide":y,children:t})};function x(e){return e.split("-")[0]}function S(e){return e.split("-")[1]}function _(e){return["top","bottom"].includes(x(e))?"x":"y"}function R(e){return"y"===e?"height":"width"}function k(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=_(t),s=R(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(x(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(S(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function T(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function j(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function O(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=T(d),m=l[p?"floating"===f?"reference":"floating":f],h=j(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=j(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const E=Math.min,A=Math.max;function P(e,t,n){return A(e,E(t,n))}const N={left:"right",right:"left",bottom:"top",top:"bottom"};function L(e){return e.replace(/left|right|bottom|top/g,(e=>N[e]))}const C={start:"end",end:"start"};function $(e){return e.replace(/start|end/g,(e=>C[e]))}const D=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:d=!0,...y}=e,m=x(r),h=f||(m===a||!d?[L(a)]:function(e){const t=L(e);return[$(e),t,$(t)]}(a)),g=[a,...h],v=await O(t,y),b=[];let w=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&b.push(v[m]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=S(e),o=_(e),i=R(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=L(a)),{main:a,cross:L(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));b.push(v[e],v[t])}if(w=[...w,{placement:r,overflows:b}],!b.every((e=>e<=0))){var k,T;const e=(null!=(k=null==(T=o.flip)?void 0:T.index)?k:0)+1,t=g[e];if(t)return{data:{index:e,overflows:w},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var j;const e=null==(j=w.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:j[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const W=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=x(n),l=S(n),s="x"===_(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:d,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof y&&(d="end"===l?-1*y:y),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function F(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function I(e){if(null==e)return window;if(!F(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return I(e).getComputedStyle(e)}function U(e){return F(e)?"":e?(e.nodeName||"").toLowerCase():""}function M(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function B(e){return e instanceof I(e).HTMLElement}function V(e){return e instanceof I(e).Element}function z(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof I(e).ShadowRoot||e instanceof ShadowRoot}function Y(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=H(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function q(e){return["table","td","th"].includes(U(e))}function X(e){const t=/firefox/i.test(M()),n=H(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function J(){return!/^((?!chrome|android).)*safari/i.test(M())}function K(e){return["html","body","#document"].includes(U(e))}const Z=Math.min,G=Math.max,Q=Math.round;function ee(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&B(e)&&(s=e.offsetWidth>0&&Q(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Q(l.height)/e.offsetHeight||1);const u=V(e)?I(e):window,f=!J()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function te(e){return(t=e,(t instanceof I(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function ne(e){return V(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function re(e){return ee(te(e)).left+ne(e).scrollLeft}function oe(e,t,n){const r=B(t),o=te(t),i=ee(e,r&&function(e){const t=ee(e);return Q(t.width)!==e.offsetWidth||Q(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==U(t)||Y(o))&&(a=ne(t)),B(t)){const e=ee(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=re(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function ie(e){if("html"===U(e))return e;const t=e.assignedSlot||e.parentNode||(z(e)?e.host:null)||te(e);return z(t)?t.host:t}function ae(e){return B(e)&&"fixed"!==H(e).position?e.offsetParent:null}function le(e){const t=I(e);let n=ae(e);for(;n&&q(n)&&"static"===H(n).position;)n=ae(n);return n&&("html"===U(n)||"body"===U(n)&&"static"===H(n).position&&!X(n))?t:n||function(e){let t=ie(e);for(;B(t)&&!K(t);){if(X(t))return t;t=ie(t)}return null}(e)||t}function se(e){if(B(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=ee(e);return{width:t.width,height:t.height}}function ce(e){const t=ie(e);return K(t)?e.ownerDocument.body:B(t)&&Y(t)?t:ce(t)}function ue(e,t){var n;void 0===t&&(t=[]);const r=ce(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=I(r),a=o?[i].concat(i.visualViewport||[],Y(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(ue(a))}function fe(e,t,n){return"viewport"===t?j(function(e,t){const n=I(e),r=te(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=J();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):V(t)?function(e,t){const n=ee(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):j(function(e){var t;const n=te(e),r=ne(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=G(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=G(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+re(e);const s=-r.scrollTop;return"rtl"===H(o||n).direction&&(l+=G(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(te(e)))}const pe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=ue(e).filter((e=>V(e)&&"body"!==U(e))),n=e,r=null;for(;V(n)&&!K(n);){const e=H(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!X(n)?t=t.filter((e=>e!==n)):r=e,n=ie(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=fe(t,n,o);return e.top=G(r.top,e.top),e.right=Z(r.right,e.right),e.bottom=Z(r.bottom,e.bottom),e.left=G(r.left,e.left),e}),fe(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=B(n),i=te(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==U(n)||Y(i))&&(a=ne(n)),B(n))){const e=ee(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:V,getDimensions:se,getOffsetParent:le,getDocumentElement:te,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:oe(t,le(n),r),floating:{...se(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===H(e).direction},de=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=k(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:g,data:v,reset:b}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=g?g:f,d={...d,[i]:{...d[i],...v}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),b&&y<=50&&(y++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:f}=k(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:pe,...n}),ye=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const a=[W(Number(o)),D(),(l={padding:5},void 0===l&&(l={}),{name:"shift",options:l,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=l,c={x:t,y:n},u=await O(e,s),f=_(x(r)),p="x"===f?"y":"x";let d=c[f],y=c[p];if(o){const e="y"===f?"bottom":"right";d=P(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";y=P(y+u["y"===p?"top":"left"],y,y-u[e])}const m=a.fn({...e,[f]:d,[p]:y});return{...m,data:{x:m.x-t,y:m.y-n}}}})];var l;return n?(a.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=T(r),u={x:o,y:i},f=_(a),p=S(a),d=R(f),y=await s.getDimensions(n),m="y"===f?"top":"left",h="y"===f?"bottom":"right",g=l.reference[d]+l.reference[f]-u[f]-l.floating[d],v=u[f]-l.reference[f],b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let w=b?"y"===f?b.clientHeight||0:b.clientWidth||0:0;0===w&&(w=l.floating[d]);const x=g/2-v/2,k=c[m],j=w-y[d]-c[h],O=w/2-y[d]/2+x,E=P(k,O,j),A=("start"===p?c[m]:c[h])>0&&O!==E&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(A?O<k?k-O:j-O:0),data:{[f]:E,centerOffset:O-E}}}}))({element:n})),de(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const a={left:`${e}px`,top:`${t}px`},{x:l,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:a,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):de(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var me={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const he=({id:e,className:t,classNameArrow:n,variant:o="dark",anchorId:i,place:a="top",offset:u=10,events:f=["hover"],positionStrategy:p="absolute",wrapper:h="div",children:g=null,delayShow:v=0,delayHide:w=0,style:x,isHtmlContent:S=!1,content:_,isOpen:R,setIsOpen:k})=>{const T=l(null),j=l(null),O=l(null),E=l(null),[A,P]=r({}),[N,L]=r({}),[C,$]=r(!1),[D,W]=r(!1),{anchorRefs:F,setActiveAnchor:I}=b()(e),[H,U]=r({current:null}),M=e=>{k?k(e):void 0===R&&$(e)},B=()=>{k?k(!R):void 0===R&&$((e=>!e))},V=y((e=>{e&&(v?(O.current&&clearTimeout(O.current),O.current=setTimeout((()=>{M(!0)}),v)):M(!0),U((t=>t.current===e.target?t:{current:e.target})),I({current:e.target}),E.current&&clearTimeout(E.current))}),50),z=y((()=>{w?(E.current&&clearTimeout(E.current),E.current=setTimeout((()=>{M(!1)}),w)):M(!1),O.current&&clearTimeout(O.current)}),50);return s((()=>{const e=new Set(F),t=document.querySelector(`[id='${i}']`);if(t&&(U((e=>e.current===t?e:{current:t})),e.add({current:t})),!e.size)return()=>{};const n=[];return f.find((e=>"click"===e))&&n.push({event:"click",listener:B}),f.find((e=>"hover"===e))&&n.push({event:"mouseenter",listener:V},{event:"mouseleave",listener:z},{event:"focus",listener:V},{event:"blur",listener:z}),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.addEventListener(t,n)}))})),()=>{n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.removeEventListener(t,n)}))}))}}),[F,i,f,w,v]),s((()=>{let e=H.current;i&&(e=document.querySelector(`[id='${i}']`)),W(!0);let t=!0;return ye({place:a,offset:u,elementReference:e,tooltipReference:T.current,tooltipArrowReference:j.current,strategy:p}).then((e=>{t&&(W(!1),Object.keys(e.tooltipStyles).length&&P(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&L(e.tooltipArrowStyles))})),()=>{t=!1}}),[C,R,i,H,_,a,u,p]),s((()=>()=>{O.current&&clearTimeout(O.current),E.current&&clearTimeout(E.current)}),[]),c.exports.jsxs(h,{id:e,role:"tooltip",className:d(me.tooltip,me[o],t,{[me.show]:!D&&(R||C),[me.fixed]:"fixed"===p}),style:{...x,...A},ref:T,children:[g||(S?c.exports.jsx(m,{content:_}):_),c.exports.jsx("div",{className:d(me.arrow,n),style:N,ref:j})]})},ge=({id:e,anchorId:t,content:n,html:o,className:i,classNameArrow:a,variant:l="dark",place:u="top",offset:f=10,wrapper:p="div",children:d=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:g=0,style:v,isOpen:w,setIsOpen:x})=>{const[S,_]=r(n||o),[R,k]=r(u),[T,j]=r(l),[O,E]=r(f),[A,P]=r(h),[N,L]=r(g),[C,$]=r(p),[D,W]=r(y),[F,I]=r(m),[H,U]=r(Boolean(o)),{anchorRefs:M,activeAnchor:B}=b()(e),V=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),z=e=>{const t={place:e=>{var t;k(null!==(t=e)&&void 0!==t?t:u)},content:e=>{U(!1),_(null!=e?e:n)},html:e=>{var t;U(!!e),_(null!==(t=null!=e?e:o)&&void 0!==t?t:n)},variant:e=>{var t;j(null!==(t=e)&&void 0!==t?t:l)},offset:e=>{E(null===e?f:Number(e))},wrapper:e=>{var t;$(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");W(null!=t?t:y)},"position-strategy":e=>{var t;I(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{P(null===e?h:Number(e))},"delay-hide":e=>{L(null===e?g:Number(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};s((()=>{n&&_(n),o&&_(o)}),[n,o]),s((()=>{var e;const n=new Set(M),r=document.querySelector(`[id='${t}']`);if(r&&n.add({current:r}),!n.size)return()=>{};const o=new MutationObserver((e=>{e.forEach((e=>{var t;if(!B.current||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=V(B.current);z(n)}))})),i={attributes:!0,childList:!1,subtree:!1},a=null!==(e=B.current)&&void 0!==e?e:r;if(a){const e=V(a);z(e),o.observe(a,i)}return()=>{o.disconnect()}}),[M,B,t]);const Y={id:e,anchorId:t,className:i,classNameArrow:a,content:S,isHtmlContent:H,place:R,variant:T,offset:O,wrapper:C,events:D,positionStrategy:F,delayShow:A,delayHide:N,style:v,isOpen:w,setIsOpen:x};return d?c.exports.jsx(he,{...Y,children:d}):c.exports.jsx(he,{...Y})};export{ge as Tooltip,v as TooltipProvider,w as TooltipWrapper};
@@ -2890,7 +2890,7 @@
2890
2890
  return () => {
2891
2891
  mounted = false;
2892
2892
  };
2893
- }, [show, isOpen, anchorId, activeAnchor, place, offset, positionStrategy]);
2893
+ }, [show, isOpen, anchorId, activeAnchor, content, place, offset, positionStrategy]);
2894
2894
  require$$0.useEffect(() => {
2895
2895
  return () => {
2896
2896
  if (tooltipShowDelayTimerRef.current) {
@@ -3,4 +3,4 @@
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&e.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var l in o)t.call(o,l)&&o[l]&&e.push(l)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(a);var l=a.exports;const s=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},c=({content:e})=>o.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),u={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},f=Object.assign((()=>u),u),p=t.createContext(f);function d(){return t.useContext(p)}function y(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return["top","bottom"].includes(y(e))?"x":"y"}function g(e){return"y"===e?"height":"width"}function v(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=h(t),s=g(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(y(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(m(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function b(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function w(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function x(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=b(d),m=l[p?"floating"===f?"reference":"floating":f],h=w(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=w(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const S=Math.min,R=Math.max;function _(e,t,n){return R(e,S(t,n))}const T={left:"right",right:"left",bottom:"top",top:"bottom"};function k(e){return e.replace(/left|right|bottom|top/g,(e=>T[e]))}const j={start:"end",end:"start"};function O(e){return e.replace(/start|end/g,(e=>j[e]))}const E=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:d=!0,...v}=e,b=y(r),w=f||(b===a||!d?[k(a)]:function(e){const t=k(e);return[O(e),t,O(t)]}(a)),S=[a,...w],R=await x(t,v),_=[];let T=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&_.push(R[b]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=m(e),o=h(e),i=g(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=k(a)),{main:a,cross:k(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));_.push(R[e],R[t])}if(T=[...T,{placement:r,overflows:_}],!_.every((e=>e<=0))){var j,E;const e=(null!=(j=null==(E=o.flip)?void 0:E.index)?j:0)+1,t=S[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var A;const e=null==(A=T.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const A=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=y(n),l=m(n),s="x"===h(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:d,alignmentAxis:g}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof g&&(d="end"===l?-1*g:g),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function P(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function N(e){if(null==e)return window;if(!P(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return N(e).getComputedStyle(e)}function L(e){return P(e)?"":e?(e.nodeName||"").toLowerCase():""}function $(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function D(e){return e instanceof N(e).HTMLElement}function W(e){return e instanceof N(e).Element}function I(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof N(e).ShadowRoot||e instanceof ShadowRoot}function F(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=C(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function H(e){return["table","td","th"].includes(L(e))}function M(e){const t=/firefox/i.test($()),n=C(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function U(){return!/^((?!chrome|android).)*safari/i.test($())}function B(e){return["html","body","#document"].includes(L(e))}const V=Math.min,z=Math.max,q=Math.round;function Y(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&D(e)&&(s=e.offsetWidth>0&&q(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&q(l.height)/e.offsetHeight||1);const u=W(e)?N(e):window,f=!U()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function X(e){return(t=e,(t instanceof N(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function J(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function K(e){return Y(X(e)).left+J(e).scrollLeft}function Z(e,t,n){const r=D(t),o=X(t),i=Y(e,r&&function(e){const t=Y(e);return q(t.width)!==e.offsetWidth||q(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==L(t)||F(o))&&(a=J(t)),D(t)){const e=Y(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=K(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function G(e){if("html"===L(e))return e;const t=e.assignedSlot||e.parentNode||(I(e)?e.host:null)||X(e);return I(t)?t.host:t}function Q(e){return D(e)&&"fixed"!==C(e).position?e.offsetParent:null}function ee(e){const t=N(e);let n=Q(e);for(;n&&H(n)&&"static"===C(n).position;)n=Q(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===C(n).position&&!M(n))?t:n||function(e){let t=G(e);for(;D(t)&&!B(t);){if(M(t))return t;t=G(t)}return null}(e)||t}function te(e){if(D(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Y(e);return{width:t.width,height:t.height}}function ne(e){const t=G(e);return B(t)?e.ownerDocument.body:D(t)&&F(t)?t:ne(t)}function re(e,t){var n;void 0===t&&(t=[]);const r=ne(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=N(r),a=o?[i].concat(i.visualViewport||[],F(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(re(a))}function oe(e,t,n){return"viewport"===t?w(function(e,t){const n=N(e),r=X(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=U();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):W(t)?function(e,t){const n=Y(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):w(function(e){var t;const n=X(e),r=J(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=z(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=z(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+K(e);const s=-r.scrollTop;return"rtl"===C(o||n).direction&&(l+=z(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(X(e)))}const ie={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=re(e).filter((e=>W(e)&&"body"!==L(e))),n=e,r=null;for(;W(n)&&!B(n);){const e=C(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!M(n)?t=t.filter((e=>e!==n)):r=e,n=G(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=oe(t,n,o);return e.top=z(r.top,e.top),e.right=V(r.right,e.right),e.bottom=V(r.bottom,e.bottom),e.left=z(r.left,e.left),e}),oe(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=D(n),i=X(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==L(n)||F(i))&&(a=J(n)),D(n))){const e=Y(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:W,getDimensions:te,getOffsetParent:ee,getDocumentElement:X,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Z(t,ee(n),r),floating:{...te(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===C(e).direction},ae=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=v(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:g,data:b,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=g?g:f,d={...d,[i]:{...d[i],...b}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&y<=50&&(y++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=v(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:ie,...n}),le=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const a=[A(Number(o)),E(),(l={padding:5},void 0===l&&(l={}),{name:"shift",options:l,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=l,c={x:t,y:n},u=await x(e,s),f=h(y(r)),p="x"===f?"y":"x";let d=c[f],m=c[p];if(o){const e="y"===f?"bottom":"right";d=_(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";m=_(m+u["y"===p?"top":"left"],m,m-u[e])}const g=a.fn({...e,[f]:d,[p]:m});return{...g,data:{x:g.x-t,y:g.y-n}}}})];var l;return n?(a.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=b(r),u={x:o,y:i},f=h(a),p=m(a),d=g(f),y=await s.getDimensions(n),v="y"===f?"top":"left",w="y"===f?"bottom":"right",x=l.reference[d]+l.reference[f]-u[f]-l.floating[d],S=u[f]-l.reference[f],R=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let T=R?"y"===f?R.clientHeight||0:R.clientWidth||0:0;0===T&&(T=l.floating[d]);const k=x/2-S/2,j=c[v],O=T-y[d]-c[w],E=T/2-y[d]/2+k,A=_(j,E,O),P=("start"===p?c[v]:c[w])>0&&E!==A&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(P?E<j?j-E:O-E:0),data:{[f]:A,centerOffset:E-A}}}}))({element:n})),ae(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const a={left:`${e}px`,top:`${t}px`},{x:l,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:a,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):ae(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var se={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ce=({id:e,className:n,classNameArrow:r,variant:i="dark",anchorId:a,place:u="top",offset:f=10,events:p=["hover"],positionStrategy:y="absolute",wrapper:m="div",children:h=null,delayShow:g=0,delayHide:v=0,style:b,isHtmlContent:w=!1,content:x,isOpen:S,setIsOpen:R})=>{const _=t.useRef(null),T=t.useRef(null),k=t.useRef(null),j=t.useRef(null),[O,E]=t.useState({}),[A,P]=t.useState({}),[N,C]=t.useState(!1),[L,$]=t.useState(!1),{anchorRefs:D,setActiveAnchor:W}=d()(e),[I,F]=t.useState({current:null}),H=e=>{R?R(e):void 0===S&&C(e)},M=()=>{R?R(!S):void 0===S&&C((e=>!e))},U=s((e=>{e&&(g?(k.current&&clearTimeout(k.current),k.current=setTimeout((()=>{H(!0)}),g)):H(!0),F((t=>t.current===e.target?t:{current:e.target})),W({current:e.target}),j.current&&clearTimeout(j.current))}),50),B=s((()=>{v?(j.current&&clearTimeout(j.current),j.current=setTimeout((()=>{H(!1)}),v)):H(!1),k.current&&clearTimeout(k.current)}),50);return t.useEffect((()=>{const e=new Set(D),t=document.querySelector(`[id='${a}']`);if(t&&(F((e=>e.current===t?e:{current:t})),e.add({current:t})),!e.size)return()=>{};const n=[];return p.find((e=>"click"===e))&&n.push({event:"click",listener:M}),p.find((e=>"hover"===e))&&n.push({event:"mouseenter",listener:U},{event:"mouseleave",listener:B},{event:"focus",listener:U},{event:"blur",listener:B}),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.addEventListener(t,n)}))})),()=>{n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.removeEventListener(t,n)}))}))}}),[D,a,p,v,g]),t.useEffect((()=>{let e=I.current;a&&(e=document.querySelector(`[id='${a}']`)),$(!0);let t=!0;return le({place:u,offset:f,elementReference:e,tooltipReference:_.current,tooltipArrowReference:T.current,strategy:y}).then((e=>{t&&($(!1),Object.keys(e.tooltipStyles).length&&E(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&P(e.tooltipArrowStyles))})),()=>{t=!1}}),[N,S,a,I,u,f,y]),t.useEffect((()=>()=>{k.current&&clearTimeout(k.current),j.current&&clearTimeout(j.current)}),[]),o.exports.jsxs(m,{id:e,role:"tooltip",className:l(se.tooltip,se[i],n,{[se.show]:!L&&(S||N),[se.fixed]:"fixed"===y}),style:{...b,...O},ref:_,children:[h||(w?o.exports.jsx(c,{content:x}):x),o.exports.jsx("div",{className:l(se.arrow,r),style:A,ref:T})]})};e.Tooltip=({id:e,anchorId:n,content:r,html:i,className:a,classNameArrow:l,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:g=0,style:v,isOpen:b,setIsOpen:w})=>{const[x,S]=t.useState(r||i),[R,_]=t.useState(c),[T,k]=t.useState(s),[j,O]=t.useState(u),[E,A]=t.useState(h),[P,N]=t.useState(g),[C,L]=t.useState(f),[$,D]=t.useState(y),[W,I]=t.useState(m),[F,H]=t.useState(Boolean(i)),{anchorRefs:M,activeAnchor:U}=d()(e),B=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),V=e=>{const t={place:e=>{var t;_(null!==(t=e)&&void 0!==t?t:c)},content:e=>{H(!1),S(null!=e?e:r)},html:e=>{var t;H(!!e),S(null!==(t=null!=e?e:i)&&void 0!==t?t:r)},variant:e=>{var t;k(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{O(null===e?u:Number(e))},wrapper:e=>{var t;L(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");D(null!=t?t:y)},"position-strategy":e=>{var t;I(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{A(null===e?h:Number(e))},"delay-hide":e=>{N(null===e?g:Number(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};t.useEffect((()=>{r&&S(r),i&&S(i)}),[r,i]),t.useEffect((()=>{var e;const t=new Set(M),r=document.querySelector(`[id='${n}']`);if(r&&t.add({current:r}),!t.size)return()=>{};const o=new MutationObserver((e=>{e.forEach((e=>{var t;if(!U.current||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=B(U.current);V(n)}))})),i={attributes:!0,childList:!1,subtree:!1},a=null!==(e=U.current)&&void 0!==e?e:r;if(a){const e=B(a);V(e),o.observe(a,i)}return()=>{o.disconnect()}}),[M,U,n]);const z={id:e,anchorId:n,className:a,classNameArrow:l,content:x,isHtmlContent:F,place:R,variant:T,offset:j,wrapper:C,events:$,positionStrategy:W,delayShow:E,delayHide:P,style:v,isOpen:b,setIsOpen:w};return p?o.exports.jsx(ce,{...z,children:p}):o.exports.jsx(ce,{...z})},e.TooltipProvider=({children:e})=>{const n=t.useId(),[r,i]=t.useState({[n]:new Set}),[a,l]=t.useState({[n]:{current:null}}),s=(e,...t)=>{i((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},c=(e,...t)=>{i((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},u=t.useCallback((e=>{var t,o;return{anchorRefs:null!==(t=r[null!=e?e:n])&&void 0!==t?t:new Set,activeAnchor:null!==(o=a[null!=e?e:n])&&void 0!==o?o:{current:null},attach:(...t)=>s(null!=e?e:n,...t),detach:(...t)=>c(null!=e?e:n,...t),setActiveAnchor:t=>((e,t)=>{l((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(null!=e?e:n,t)}}),[n,r,a,s,c]),f=t.useMemo((()=>{const e=u(n);return Object.assign((e=>u(e)),e)}),[u]);return o.exports.jsx(p.Provider,{value:f,children:e})},e.TooltipWrapper=({tooltipId:e,children:n,place:r,content:i,html:a,variant:l,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:p,delayHide:y})=>{const{attach:m,detach:h}=d()(e),g=t.useRef(null);return t.useEffect((()=>(m(g),()=>{h(g)})),[]),o.exports.jsx("span",{ref:g,"data-tooltip-place":r,"data-tooltip-content":i,"data-tooltip-html":a,"data-tooltip-variant":l,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":y,children:n})},Object.defineProperty(e,"__esModule",{value:!0})}));
6
+ */!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&e.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var l in o)t.call(o,l)&&o[l]&&e.push(l)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(a);var l=a.exports;const s=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},c=({content:e})=>o.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),u={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},f=Object.assign((()=>u),u),p=t.createContext(f);function d(){return t.useContext(p)}function y(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return["top","bottom"].includes(y(e))?"x":"y"}function g(e){return"y"===e?"height":"width"}function v(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=h(t),s=g(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(y(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(m(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function b(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function w(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function x(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=b(d),m=l[p?"floating"===f?"reference":"floating":f],h=w(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=w(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const S=Math.min,R=Math.max;function _(e,t,n){return R(e,S(t,n))}const T={left:"right",right:"left",bottom:"top",top:"bottom"};function k(e){return e.replace(/left|right|bottom|top/g,(e=>T[e]))}const j={start:"end",end:"start"};function O(e){return e.replace(/start|end/g,(e=>j[e]))}const E=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:d=!0,...v}=e,b=y(r),w=f||(b===a||!d?[k(a)]:function(e){const t=k(e);return[O(e),t,O(t)]}(a)),S=[a,...w],R=await x(t,v),_=[];let T=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&_.push(R[b]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=m(e),o=h(e),i=g(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=k(a)),{main:a,cross:k(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));_.push(R[e],R[t])}if(T=[...T,{placement:r,overflows:_}],!_.every((e=>e<=0))){var j,E;const e=(null!=(j=null==(E=o.flip)?void 0:E.index)?j:0)+1,t=S[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var A;const e=null==(A=T.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const A=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=y(n),l=m(n),s="x"===h(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:d,alignmentAxis:g}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof g&&(d="end"===l?-1*g:g),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function P(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function N(e){if(null==e)return window;if(!P(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function C(e){return N(e).getComputedStyle(e)}function L(e){return P(e)?"":e?(e.nodeName||"").toLowerCase():""}function $(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function D(e){return e instanceof N(e).HTMLElement}function W(e){return e instanceof N(e).Element}function I(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof N(e).ShadowRoot||e instanceof ShadowRoot}function F(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=C(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function H(e){return["table","td","th"].includes(L(e))}function M(e){const t=/firefox/i.test($()),n=C(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function U(){return!/^((?!chrome|android).)*safari/i.test($())}function B(e){return["html","body","#document"].includes(L(e))}const V=Math.min,z=Math.max,q=Math.round;function Y(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&D(e)&&(s=e.offsetWidth>0&&q(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&q(l.height)/e.offsetHeight||1);const u=W(e)?N(e):window,f=!U()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function X(e){return(t=e,(t instanceof N(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function J(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function K(e){return Y(X(e)).left+J(e).scrollLeft}function Z(e,t,n){const r=D(t),o=X(t),i=Y(e,r&&function(e){const t=Y(e);return q(t.width)!==e.offsetWidth||q(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==L(t)||F(o))&&(a=J(t)),D(t)){const e=Y(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=K(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function G(e){if("html"===L(e))return e;const t=e.assignedSlot||e.parentNode||(I(e)?e.host:null)||X(e);return I(t)?t.host:t}function Q(e){return D(e)&&"fixed"!==C(e).position?e.offsetParent:null}function ee(e){const t=N(e);let n=Q(e);for(;n&&H(n)&&"static"===C(n).position;)n=Q(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===C(n).position&&!M(n))?t:n||function(e){let t=G(e);for(;D(t)&&!B(t);){if(M(t))return t;t=G(t)}return null}(e)||t}function te(e){if(D(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Y(e);return{width:t.width,height:t.height}}function ne(e){const t=G(e);return B(t)?e.ownerDocument.body:D(t)&&F(t)?t:ne(t)}function re(e,t){var n;void 0===t&&(t=[]);const r=ne(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=N(r),a=o?[i].concat(i.visualViewport||[],F(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(re(a))}function oe(e,t,n){return"viewport"===t?w(function(e,t){const n=N(e),r=X(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=U();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):W(t)?function(e,t){const n=Y(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):w(function(e){var t;const n=X(e),r=J(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=z(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=z(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+K(e);const s=-r.scrollTop;return"rtl"===C(o||n).direction&&(l+=z(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(X(e)))}const ie={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=re(e).filter((e=>W(e)&&"body"!==L(e))),n=e,r=null;for(;W(n)&&!B(n);){const e=C(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!M(n)?t=t.filter((e=>e!==n)):r=e,n=G(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=oe(t,n,o);return e.top=z(r.top,e.top),e.right=V(r.right,e.right),e.bottom=V(r.bottom,e.bottom),e.left=z(r.left,e.left),e}),oe(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=D(n),i=X(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==L(n)||F(i))&&(a=J(n)),D(n))){const e=Y(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:W,getDimensions:te,getOffsetParent:ee,getDocumentElement:X,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Z(t,ee(n),r),floating:{...te(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===C(e).direction},ae=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=v(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:g,data:b,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=g?g:f,d={...d,[i]:{...d[i],...b}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&y<=50&&(y++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=v(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:ie,...n}),le=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const a=[A(Number(o)),E(),(l={padding:5},void 0===l&&(l={}),{name:"shift",options:l,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=l,c={x:t,y:n},u=await x(e,s),f=h(y(r)),p="x"===f?"y":"x";let d=c[f],m=c[p];if(o){const e="y"===f?"bottom":"right";d=_(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";m=_(m+u["y"===p?"top":"left"],m,m-u[e])}const g=a.fn({...e,[f]:d,[p]:m});return{...g,data:{x:g.x-t,y:g.y-n}}}})];var l;return n?(a.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=b(r),u={x:o,y:i},f=h(a),p=m(a),d=g(f),y=await s.getDimensions(n),v="y"===f?"top":"left",w="y"===f?"bottom":"right",x=l.reference[d]+l.reference[f]-u[f]-l.floating[d],S=u[f]-l.reference[f],R=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let T=R?"y"===f?R.clientHeight||0:R.clientWidth||0:0;0===T&&(T=l.floating[d]);const k=x/2-S/2,j=c[v],O=T-y[d]-c[w],E=T/2-y[d]/2+k,A=_(j,E,O),P=("start"===p?c[v]:c[w])>0&&E!==A&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(P?E<j?j-E:O-E:0),data:{[f]:A,centerOffset:E-A}}}}))({element:n})),ae(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const a={left:`${e}px`,top:`${t}px`},{x:l,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:a,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):ae(e,t,{placement:"bottom",strategy:i,middleware:a}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var se={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ce=({id:e,className:n,classNameArrow:r,variant:i="dark",anchorId:a,place:u="top",offset:f=10,events:p=["hover"],positionStrategy:y="absolute",wrapper:m="div",children:h=null,delayShow:g=0,delayHide:v=0,style:b,isHtmlContent:w=!1,content:x,isOpen:S,setIsOpen:R})=>{const _=t.useRef(null),T=t.useRef(null),k=t.useRef(null),j=t.useRef(null),[O,E]=t.useState({}),[A,P]=t.useState({}),[N,C]=t.useState(!1),[L,$]=t.useState(!1),{anchorRefs:D,setActiveAnchor:W}=d()(e),[I,F]=t.useState({current:null}),H=e=>{R?R(e):void 0===S&&C(e)},M=()=>{R?R(!S):void 0===S&&C((e=>!e))},U=s((e=>{e&&(g?(k.current&&clearTimeout(k.current),k.current=setTimeout((()=>{H(!0)}),g)):H(!0),F((t=>t.current===e.target?t:{current:e.target})),W({current:e.target}),j.current&&clearTimeout(j.current))}),50),B=s((()=>{v?(j.current&&clearTimeout(j.current),j.current=setTimeout((()=>{H(!1)}),v)):H(!1),k.current&&clearTimeout(k.current)}),50);return t.useEffect((()=>{const e=new Set(D),t=document.querySelector(`[id='${a}']`);if(t&&(F((e=>e.current===t?e:{current:t})),e.add({current:t})),!e.size)return()=>{};const n=[];return p.find((e=>"click"===e))&&n.push({event:"click",listener:M}),p.find((e=>"hover"===e))&&n.push({event:"mouseenter",listener:U},{event:"mouseleave",listener:B},{event:"focus",listener:U},{event:"blur",listener:B}),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.addEventListener(t,n)}))})),()=>{n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.removeEventListener(t,n)}))}))}}),[D,a,p,v,g]),t.useEffect((()=>{let e=I.current;a&&(e=document.querySelector(`[id='${a}']`)),$(!0);let t=!0;return le({place:u,offset:f,elementReference:e,tooltipReference:_.current,tooltipArrowReference:T.current,strategy:y}).then((e=>{t&&($(!1),Object.keys(e.tooltipStyles).length&&E(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&P(e.tooltipArrowStyles))})),()=>{t=!1}}),[N,S,a,I,x,u,f,y]),t.useEffect((()=>()=>{k.current&&clearTimeout(k.current),j.current&&clearTimeout(j.current)}),[]),o.exports.jsxs(m,{id:e,role:"tooltip",className:l(se.tooltip,se[i],n,{[se.show]:!L&&(S||N),[se.fixed]:"fixed"===y}),style:{...b,...O},ref:_,children:[h||(w?o.exports.jsx(c,{content:x}):x),o.exports.jsx("div",{className:l(se.arrow,r),style:A,ref:T})]})};e.Tooltip=({id:e,anchorId:n,content:r,html:i,className:a,classNameArrow:l,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:g=0,style:v,isOpen:b,setIsOpen:w})=>{const[x,S]=t.useState(r||i),[R,_]=t.useState(c),[T,k]=t.useState(s),[j,O]=t.useState(u),[E,A]=t.useState(h),[P,N]=t.useState(g),[C,L]=t.useState(f),[$,D]=t.useState(y),[W,I]=t.useState(m),[F,H]=t.useState(Boolean(i)),{anchorRefs:M,activeAnchor:U}=d()(e),B=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),V=e=>{const t={place:e=>{var t;_(null!==(t=e)&&void 0!==t?t:c)},content:e=>{H(!1),S(null!=e?e:r)},html:e=>{var t;H(!!e),S(null!==(t=null!=e?e:i)&&void 0!==t?t:r)},variant:e=>{var t;k(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{O(null===e?u:Number(e))},wrapper:e=>{var t;L(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");D(null!=t?t:y)},"position-strategy":e=>{var t;I(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{A(null===e?h:Number(e))},"delay-hide":e=>{N(null===e?g:Number(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};t.useEffect((()=>{r&&S(r),i&&S(i)}),[r,i]),t.useEffect((()=>{var e;const t=new Set(M),r=document.querySelector(`[id='${n}']`);if(r&&t.add({current:r}),!t.size)return()=>{};const o=new MutationObserver((e=>{e.forEach((e=>{var t;if(!U.current||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=B(U.current);V(n)}))})),i={attributes:!0,childList:!1,subtree:!1},a=null!==(e=U.current)&&void 0!==e?e:r;if(a){const e=B(a);V(e),o.observe(a,i)}return()=>{o.disconnect()}}),[M,U,n]);const z={id:e,anchorId:n,className:a,classNameArrow:l,content:x,isHtmlContent:F,place:R,variant:T,offset:j,wrapper:C,events:$,positionStrategy:W,delayShow:E,delayHide:P,style:v,isOpen:b,setIsOpen:w};return p?o.exports.jsx(ce,{...z,children:p}):o.exports.jsx(ce,{...z})},e.TooltipProvider=({children:e})=>{const n=t.useId(),[r,i]=t.useState({[n]:new Set}),[a,l]=t.useState({[n]:{current:null}}),s=(e,...t)=>{i((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},c=(e,...t)=>{i((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},u=t.useCallback((e=>{var t,o;return{anchorRefs:null!==(t=r[null!=e?e:n])&&void 0!==t?t:new Set,activeAnchor:null!==(o=a[null!=e?e:n])&&void 0!==o?o:{current:null},attach:(...t)=>s(null!=e?e:n,...t),detach:(...t)=>c(null!=e?e:n,...t),setActiveAnchor:t=>((e,t)=>{l((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(null!=e?e:n,t)}}),[n,r,a,s,c]),f=t.useMemo((()=>{const e=u(n);return Object.assign((e=>u(e)),e)}),[u]);return o.exports.jsx(p.Provider,{value:f,children:e})},e.TooltipWrapper=({tooltipId:e,children:n,place:r,content:i,html:a,variant:l,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:p,delayHide:y})=>{const{attach:m,detach:h}=d()(e),g=t.useRef(null);return t.useEffect((()=>(m(g),()=>{h(g)})),[]),o.exports.jsx("span",{ref:g,"data-tooltip-place":r,"data-tooltip-content":i,"data-tooltip-html":a,"data-tooltip-variant":l,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":y,children:n})},Object.defineProperty(e,"__esModule",{value:!0})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-tooltip",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
4
4
  "description": "react tooltip component",
5
5
  "scripts": {
6
6
  "dev": "node ./cli.js --env=development && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.dev.js --watch",
package/src/App.tsx ADDED
@@ -0,0 +1,119 @@
1
+ import { TooltipController as Tooltip } from 'components/TooltipController'
2
+ import { TooltipProvider, TooltipWrapper } from 'components/TooltipProvider'
3
+ import { useState } from 'react'
4
+ import styles from './styles.module.css'
5
+
6
+ function WithProviderMinimal() {
7
+ return (
8
+ <section style={{ marginTop: '100px' }}>
9
+ <p>
10
+ <TooltipWrapper place="bottom" content="Shared Global Tooltip">
11
+ <button>Minimal 1</button>
12
+ </TooltipWrapper>
13
+ <TooltipWrapper place="right" content="Shared Global Tooltip">
14
+ <button>Minimal 2</button>
15
+ </TooltipWrapper>
16
+ </p>
17
+ <Tooltip />
18
+ </section>
19
+ )
20
+ }
21
+
22
+ function WithProviderMultiple() {
23
+ return (
24
+ <section style={{ marginTop: '100px' }}>
25
+ <p>
26
+ <TooltipWrapper tooltipId="tooltip-1" place="bottom">
27
+ <button>Multiple 1</button>
28
+ </TooltipWrapper>
29
+ <TooltipWrapper tooltipId="tooltip-2" place="right">
30
+ <button>Multiple 2</button>
31
+ </TooltipWrapper>
32
+ </p>
33
+ <Tooltip id="tooltip-1" content="Tooltip 1" />
34
+ <Tooltip id="tooltip-2" content="Tooltip 2" />
35
+ </section>
36
+ )
37
+ }
38
+
39
+ function App() {
40
+ const [anchorId, setAnchorId] = useState('button')
41
+ const [isDarkOpen, setIsDarkOpen] = useState(false)
42
+
43
+ return (
44
+ <main className={styles['main']}>
45
+ <button
46
+ id="button"
47
+ aria-describedby="tooltip"
48
+ data-tooltip-content="My big tooltip content 1"
49
+ onClick={() => {
50
+ setAnchorId('button')
51
+ }}
52
+ >
53
+ My button
54
+ </button>
55
+ <Tooltip
56
+ place="bottom"
57
+ anchorId={anchorId}
58
+ // only shown if `data-tooltip-content` is unset
59
+ content={`Showing tooltip on ${anchorId}`}
60
+ isOpen={isDarkOpen}
61
+ setIsOpen={setIsDarkOpen}
62
+ />
63
+ <Tooltip
64
+ place="top"
65
+ variant="success"
66
+ anchorId="button2"
67
+ isOpen={isDarkOpen}
68
+ setIsOpen={setIsDarkOpen}
69
+ />
70
+ <Tooltip
71
+ place="top"
72
+ variant="info"
73
+ anchorId="button3"
74
+ isOpen={isDarkOpen}
75
+ setIsOpen={setIsDarkOpen}
76
+ />
77
+ <Tooltip
78
+ place="right"
79
+ variant="info"
80
+ anchorId="button3"
81
+ content="My big tooltip content"
82
+ isOpen={isDarkOpen}
83
+ setIsOpen={setIsDarkOpen}
84
+ style={{ backgroundColor: '#ff00ff' }}
85
+ />
86
+
87
+ <section style={{ marginTop: '100px' }}>
88
+ <p>
89
+ <button
90
+ id="button2"
91
+ data-tooltip-content="Hello World from a Tooltip 2"
92
+ onClick={() => {
93
+ setAnchorId('button2')
94
+ }}
95
+ >
96
+ Hover or focus me
97
+ </button>
98
+ <button
99
+ id="button3"
100
+ data-tooltip-content="Hello World from a Tooltip 3"
101
+ onClick={() => {
102
+ setAnchorId('button3')
103
+ }}
104
+ >
105
+ Hover or focus me 2
106
+ </button>
107
+ </p>
108
+ </section>
109
+ <TooltipProvider>
110
+ <WithProviderMinimal />
111
+ </TooltipProvider>
112
+ <TooltipProvider>
113
+ <WithProviderMultiple />
114
+ </TooltipProvider>
115
+ </main>
116
+ )
117
+ }
118
+
119
+ export default App