(window.webpackJsonpvtex_styleguide_9_146_13=window.webpackJsonpvtex_styleguide_9_146_13||[]).push([["Tooltip"],{0:function(t,e){t.exports=React},13:function(t,e){t.exports=Classnames},1513:function(t,e,n){"use strict";n.r(e),function(t){var e=n(8);n.p=Object(e.getPublicPath)("vtex.styleguide@9.146.13");var r=Object(e.register)((function(){return n(1523)}),t,"vtex.styleguide@9.146.13","vtex.styleguide@9.x","Tooltip");r.renderHotReload,r.setupHMR}.call(this,n(16)(t))},1523:function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return X}));var r=n(10),o=n(29),i=n(0),a=n.n(i),c=n(13),u=n.n(c),l=n(3),f=n.n(l),s=n(22),p=n.n(s);function d(t,e){"function"==typeof t?t(e):t&&(t.current=e)}var h="undefined"!=typeof window?a.a.useLayoutEffect:a.a.useEffect,g={children:f.a.node,container:f.a.oneOfType([f.a.func,f.a.instanceOf(a.a.Component),f.a.instanceOf("undefined"==typeof Element?Object:Element)]),onRendered:f.a.func},v=function(t,e){var n=t.children,r=t.container,i=t.onRendered,c=a.a.useState(null),u=Object(o.a)(c,2),l=u[0],f=u[1];return h((function(){f(function(t){return t="function"==typeof t?t():t,p.a.findDOMNode(t)}(r)||document.body)}),[r]),h((function(){if(l)return d(e,l),function(){d(e,null)}}),[e,l]),h((function(){i&&l&&i()}),[i,l]),l?p.a.createPortal(n,l):l},b=a.a.forwardRef(v);b.propTypes=g;var w=b,m=n(56),O=n.n(m),y=["width","height","top","right","bottom","left"],j=new Map,x=null,E=function t(){j.forEach((function(t){t.hasRectChanged&&(t.callbacks.forEach((function(e){return e(t.rect)})),t.hasRectChanged=!1)})),setTimeout((function(){j.forEach((function(t,e){if(e){var n=e.getBoundingClientRect();(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y.some((function(n){return t[n]!==e[n]}))})(n,t.rect)&&(t.hasRectChanged=!0,t.rect=n)}}))}),0),x=requestAnimationFrame(t)},R=function(t,e){return{observe:function(){var n=0===j.size;j.has(t)?j.get(t).callbacks.push(e):j.set(t,{rect:void 0,hasRectChanged:!0,callbacks:[e]}),n&&E()},unobserve:function(){var n=j.get(t);if(n){var r=n.callbacks.indexOf(e);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||j.delete(t),j.size||cancelAnimationFrame(x)}}}};function k(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Object(i.useState)(null),r=Object(o.a)(n,2),a=r[0],c=r[1],u=Object(i.useRef)(null);return Object(i.useLayoutEffect)((function(){return!u.current&&t.current&&(u.current=R(t.current,c)),u.current&&e&&u.current.observe(),function(){return u.current&&u.current.unobserve()}}),[e,t]),a}var M=n(241),C=n(557),P=n.n(C),T=function(t){return t&&t.width&&t.height};var _=function(t){var e=t.container,n=t.position,r=t.size,c=t.fallbackPosition,l=t.label,f=t.visible,s=t.delay,p=t.duration,d=t.timmingFn,h=t.childRef,g=t.wordBreak,v=Object(i.useState)(f),b=Object(o.a)(v,2),m=b[0],O=b[1],y=Object(i.useRef)(),j=k(h,f),x=k(y,f);Object(i.useEffect)((function(){f&&O(!0)}),[f]);var E=u()("absolute pv3 ph4 bg-base--inverted c-on-base--inverted br2 shadow-4 mw5 overflow-hidden",P.a.popup,(!f||!m||!j||!x)&&"dn",(!f||!T(x))&&"o-0",f&&T(x)&&"o-100",{mini:"t-mini",small:"t-small"}[r]),R=A(null!=e?e:document.body,j,x,n,c);return a.a.createElement(w,{container:e},a.a.createElement("div",{role:"tooltip",className:E,style:Object.assign(Object.assign({},R),{zIndex:M.a.tooltip,transition:"opacity ".concat(p,"ms ").concat(d," ").concat(s,"ms"),wordBreak:g}),ref:y,onTransitionEnd:function(){return O(f)}},l))},A=function(t,e,n,r,o){return e&&n&&window&&T(n)?B(t,e,n,r,o):{top:0,left:0}},F={top:"right",right:"bottom",bottom:"left",left:"top"},B=function(t,e,n,r,o){return S(t,e,n,r,o,r)},S=function t(e,n,r,o,i,a){var c=Math.min(window.innerWidth,e.clientWidth)+window.pageXOffset-8,u=Math.min(window.innerHeight,e.clientHeight)+window.pageYOffset-8,l={left:n.left+window.pageXOffset+(n.width-r.width)/2+("right"===o?(n.width+r.width)/2+8:0)-("left"===o?(n.width+r.width)/2+8:0),top:n.top+window.pageYOffset-("top"===o?r.height+8:0)+("bottom"===o?n.height+8:0)+("right"===o||"left"===o?(n.height-r.height)/2:0)};if({top:l.topc,bottom:l.top+r.height>u,left:l.left0&&void 0!==arguments[0]?arguments[0]:{},e=t.trigger,n=Object(i.useRef)(),r=Object(i.useState)(!1),a=Object(o.a)(r,2),c=a[0],u=a[1],l=function(t){return Object.assign(Object.assign({ref:function(e){e&&d(n,e),d(t.ref,e)}},"hover"===e?{onMouseEnter:function(){u(!0);var e=O()(t,"props.onMouseEnter");if(e){for(var n=arguments.length,r=new Array(n),o=0;o