"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
var _chunkT5P4M4B5cjs = require('./chunk-T5P4M4B5.cjs');var _chunkKWVOYVQNcjs = require('./chunk-KWVOYVQN.cjs');var _chunkX26E67JFcjs = require('./chunk-X26E67JF.cjs');var _chunkQLDZ7HKUcjs = require('./chunk-QLDZ7HKU.cjs');var _react = require('react');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var X=_chunkQLDZ7HKUcjs.a.call(void 0, "EulTooltip",["anchorEl","content","open","panel","placementBottom","placementBottomEnd","placementBottomStart","placementLeft","placementLeftEnd","placementLeftStart","placementRight","placementRightEnd","placementRightStart","placementTop","placementTopEnd","placementTopStart","popper","root","tip"]),b=t=>_chunkX26E67JFcjs.e.call(void 0, "EulTooltip",{anchorEl:["anchorEl"],content:["content"],popper:["popper",t.placement&&`placement${_chunkQLDZ7HKUcjs.d.call(void 0, _chunkQLDZ7HKUcjs.c.call(void 0, t.placement))}`,_optionalChain([t, 'access', _2 => _2.placement, 'optionalAccess', _3 => _3.indexOf, 'call', _4 => _4("bottom")])!==-1&&"placementBottom",_optionalChain([t, 'access', _5 => _5.placement, 'optionalAccess', _6 => _6.indexOf, 'call', _7 => _7("top")])!==-1&&"placementTop",_optionalChain([t, 'access', _8 => _8.placement, 'optionalAccess', _9 => _9.indexOf, 'call', _10 => _10("left")])!==-1&&"placementLeft",_optionalChain([t, 'access', _11 => _11.placement, 'optionalAccess', _12 => _12.indexOf, 'call', _13 => _13("right")])!==-1&&"placementRight",t.isPanel&&"panel"],root:["root",t.open&&"open"],tip:["tip"]}),a= exports.a =X;var _jsxruntime = require('react/jsx-runtime');var G=_react.forwardRef.call(void 0, ({className:t},i)=>{let o=_chunkQLDZ7HKUcjs.n.call(void 0, );return _jsxruntime.jsxs.call(void 0, "svg",{className:t,fill:"none",height:"10",ref:i,viewBox:"0 0 34 10",width:"34",xmlns:"http://www.w3.org/2000/svg",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M0 0H34H26.8873C26.0072 0 25.1715 0.386467 24.6015 1.05705L19.2858 7.3108C18.0878 8.72021 15.9122 8.72021 14.7142 7.3108L9.3985 1.05706C8.8285 0.386469 7.99278 0 7.11268 0H0Z",fill:o.palette.background[500]}),_jsxruntime.jsx.call(void 0, "path",{d:"M7.11268 1H6V0H7.11268C7.96751 0 8.78047 0.364595 9.34875 1C9.36555 1.01878 9.38213 1.0378 9.3985 1.05706L14.7142 7.3108C15.9122 8.72021 18.0878 8.72021 19.2858 7.3108L24.6015 1.05705C24.6179 1.0378 24.6345 1.01878 24.6513 1C25.2195 0.364594 26.0325 0 26.8873 0H28V1H26.8873C26.3006 1 25.7434 1.25765 25.3634 1.7047L20.0478 7.95845C18.4504 9.83766 15.5496 9.83766 13.9522 7.95845L8.63656 1.7047C8.25656 1.25765 7.69942 1 7.11268 1Z",fill:o.palette.background[600]})]})});G.displayName="Tip";var P=G;var _react3 = require('@emotion/react');var I=_chunkQLDZ7HKUcjs.m.call(void 0, "div")`
  .${a.anchorEl} {
    cursor: pointer;
  }
`,z=_chunkQLDZ7HKUcjs.m.call(void 0, "div")(({theme:t})=>_react3.css`
    position: relative;
    display: flex;
    gap: ${t.spacing(4)};
    padding: ${t.spacing(2)} ${t.spacing(3)};
    color: ${t.palette.background[900]};
    font-size: ${t.typography.pxToRem(12)};
    line-height: ${t.typography.pxToRem(16)};
    background: ${t.palette.background[500]};
    border: 1px solid ${t.palette.background[600]};
    border-radius: ${t.spacing(1.5)};

    > svg {
      position: absolute;

      .${a.popper}[data-popper-placement*="top"]  & {
        top: 100%;
      }

      .${a.popper}[data-popper-placement*="bottom"] & {
        bottom: 100%;
        transform: rotate(180deg);
      }

      .${a.popper}[data-popper-placement*="left"] & {
        left: calc(100% - 12px);
        transform: rotate(-90deg);
      }

      .${a.popper}[data-popper-placement*="right"] & {
        right: calc(100% - 12px);
        transform: rotate(90deg);
      }
    }

    .${a.popper}[data-popper-placement*="top"] & {
      margin-bottom: ${t.spacing(3)};
    }

    .${a.popper}[data-popper-placement*="bottom"] & {
      margin-top: ${t.spacing(3)};
    }

    .${a.popper}[data-popper-placement*="left"] & {
      margin-right: ${t.spacing(3)};
    }

    .${a.popper}[data-popper-placement*="right"] & {
      margin-left: ${t.spacing(3)};
    }

    .${a.popper}.${a.panel} & {
      padding: ${t.spacing(3)};
      margin: ${t.spacing(1)} 0 0;
      background: ${t.palette.background[300]};
      border: 1px solid ${t.palette.background[500]};
      border-radius: ${t.spacing(2)};
    }
  `),W=_chunkQLDZ7HKUcjs.m.call(void 0, (0, _chunkT5P4M4B5cjs.c))(({theme:t})=>({zIndex:t.zIndex.tooltip}));var ot=t=>{let{anchorEl:i,children:o,className:S,content:p,id:h,isPanel:c=!1,open:u=!1,placement:l="bottom"}=t,T=_chunkQLDZ7HKUcjs.n.call(void 0, ),r=b(t),g=n=>{setTimeout(()=>{if(i&&_optionalChain([n, 'optionalAccess', _14 => _14.parentElement, 'optionalAccess', _15 => _15.parentElement])){let d=i.getBoundingClientRect(),e=n.parentElement.parentElement.getBoundingClientRect(),f=n.getBoundingClientRect(),s;n.style.opacity="0",l.includes("bottom")||l.includes("top")?(s=d.left+d.width/2-(e.left+f.width/2),s=Math.max(8,s),s=Math.min(e.width-f.width-8,s),n.style.left=`${s}px`):(s=d.top+d.height/2-(e.top+f.height/2),s=Math.min(e.height-f.height/2-5,Math.max(s,f.height/2+5)),n.style.top=`${s}px`),n.style.opacity="1"}},100)},E=_react.cloneElement.call(void 0, o,{...o.props,className:_clsx2.default.call(void 0, o.props.className,r.anchorEl)}),m=p&&_react.isValidElement.call(void 0, p)?_react.cloneElement.call(void 0, p,{...p.props,className:_clsx2.default.call(void 0, p.props.className,r.content)}):p;return _jsxruntime.jsxs.call(void 0, I,{className:_clsx2.default.call(void 0, r.root),children:[E,_jsxruntime.jsx.call(void 0, W,{anchorEl:i,className:_clsx2.default.call(void 0, r.popper,S),open:u,placement:l,transition:!0,children:({TransitionProps:n})=>_jsxruntime.jsx.call(void 0, _chunkKWVOYVQNcjs.a,{timeout:T.transitions.duration.shorter,...n,children:_jsxruntime.jsxs.call(void 0, z,{className:_clsx2.default.call(void 0, r.content),id:h,children:[m,!c&&_jsxruntime.jsx.call(void 0, P,{className:_clsx2.default.call(void 0, r.tip),ref:g})]})})})]})},$= exports.b =ot;function N({onClose:t,onOpen:i,touchDelay:o,touchEndDelay:S}){let[p,h]=_react.useState.call(void 0, !1),c=_react.useRef.call(void 0, "initial"),u=_react.useRef.call(void 0, !1),l=_react.useRef.call(void 0, ),T=_react.useRef.call(void 0, ),r=_react.useCallback.call(void 0, ()=>{c.current!=="initial"&&(document.body.style.webkitUserSelect=c.current,c.current="initial"),clearTimeout(T.current)},[]);_react.useEffect.call(void 0, ()=>()=>{clearTimeout(l.current),r()},[r]);let g=e=>{h(!0),_optionalChain([i, 'optionalCall', _16 => _16(e)])},E=e=>{h(!1),u.current=!1,_optionalChain([t, 'optionalCall', _17 => _17(e)])},m=e=>{u.current&&e.type!=="touchstart"||(clearTimeout(l.current),g(e))};return{handleClose:E,handleEnter:m,handleTouchEnd:e=>{r(),clearTimeout(l.current),l.current=setTimeout(()=>{E(e)},S)},handleTouchStart:e=>{u.current=!0,clearTimeout(l.current),r(),c.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",T.current=setTimeout(()=>{document.body.style.webkitUserSelect=c.current,m(e)},o)},open:p}}var k=_react.forwardRef.call(void 0, (t,i)=>{let{children:o,className:S,content:p,id:h,isPanel:c,open:u,persistOnHover:l,placement:T}=t,r=_chunkX26E67JFcjs.j.call(void 0, ),[g,E]=_react.useState.call(void 0, null),{handleClose:m,handleEnter:n,handleTouchEnd:d,handleTouchStart:e,open:f}=N(t),s=_chunkX26E67JFcjs.i.call(void 0, o.props.ref,E,i),q=b(t),J=l&&_react.isValidElement.call(void 0, p)?_react.cloneElement.call(void 0, p,{...p.props,onMouseEnter:n,onMouseLeave:m}):p,K=o&&_react.cloneElement.call(void 0, o,{...o.props,className:_clsx2.default.call(void 0, o.props.className,q.anchorEl),key:"tooltip-child",onBlur:m,onFocus:Q=>{r==="keyboard"&&n(Q)},onMouseEnter:n,onMouseLeave:l?d:m,onTouchEnd:d,onTouchStart:e,ref:s});return _jsxruntime.jsx.call(void 0, $,{anchorEl:g,className:S,content:J,id:h,isPanel:c,open:u||f&&Boolean(g),placement:T,children:K})});k.displayName="Tooltip";k.defaultProps={placement:"bottom",touchDelay:700,touchEndDelay:1500};var ct=k;exports.a = a; exports.b = $; exports.c = ct;
