"use strict";(self.webpackChunkcentreon=self.webpackChunkcentreon||[]).push([["8140"],{77120:function(e,t,n){n.d(t,{d:function(){return f}});var r=n(1975),c=n(6780),u=n(89581),i=n(65322),o=n(89037),s=n(52676);function l(e){return e.substring(2).toLowerCase()}function f(e){let{children:t,disableReactTree:n=!1,mouseEvent:f="onClick",onClickAway:d,touchEvent:m="onTouchEnd"}=e,a=r.useRef(!1),E=r.useRef(null),v=r.useRef(!1),h=r.useRef(!1);r.useEffect(()=>(setTimeout(()=>{v.current=!0},0),()=>{v.current=!1}),[]);let p=(0,c.Z)((0,o.Z)(t),E),L=(0,u.Z)(e=>{var t,r;let c;let u=h.current;h.current=!1;let o=(0,i.Z)(E.current);if(!!v.current&&!!E.current&&(!("clientX"in e)||(t=e,!((r=o).documentElement.clientWidth<t.clientX)&&!(r.documentElement.clientHeight<t.clientY)))){if(a.current){a.current=!1;return}!(c=e.composedPath?e.composedPath().indexOf(E.current)>-1:!o.documentElement.contains(e.target)||E.current.contains(e.target))&&(n||!u)&&d(e)}}),Z=e=>n=>{h.current=!0;let r=t.props[e];r&&r(n)},g={ref:p};return!1!==m&&(g[m]=Z(m)),r.useEffect(()=>{if(!1!==m){let e=l(m),t=(0,i.Z)(E.current),n=()=>{a.current=!0};return t.addEventListener(e,L),t.addEventListener("touchmove",n),()=>{t.removeEventListener(e,L),t.removeEventListener("touchmove",n)}}},[L,m]),!1!==f&&(g[f]=Z(f)),r.useEffect(()=>{if(!1!==f){let e=l(f),t=(0,i.Z)(E.current);return t.addEventListener(e,L),()=>{t.removeEventListener(e,L)}}},[L,f]),(0,s.jsx)(r.Fragment,{children:r.cloneElement(t,g)})}}}]);
//# sourceMappingURL=8140.2d8e0c368004fc1444f3.bb40cf54589f7bce1060.e8e7040a846d504f76a8.js.map