"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 _chunkMWGJDHZMcjs = require('./chunk-MWGJDHZM.cjs');var _chunkT5P4M4B5cjs = require('./chunk-T5P4M4B5.cjs');var _chunkX26E67JFcjs = require('./chunk-X26E67JF.cjs');var _chunkQLDZ7HKUcjs = require('./chunk-QLDZ7HKU.cjs');var _chunk5NXYDZPPcjs = require('./chunk-5NXYDZPP.cjs');var _react = require('react');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var S=_chunkQLDZ7HKUcjs.a.call(void 0, "EulPopover",["root","anchor","content","open"]),h=e=>_chunkX26E67JFcjs.e.call(void 0, "EulPopover",{anchor:["anchor"],content:["content"],root:["root",e.open&&"open"]}),D= exports.a =S;var _jsxruntime = require('react/jsx-runtime');var l=_react.forwardRef.call(void 0, (e,E)=>{let{children:t,className:x,content:o,id:N,isPanel:T,open:p,placement:k}=e,[a,w]=_react.useState.call(void 0, null),[c,m]=_react.useState.call(void 0, !1),B=_chunkX26E67JFcjs.i.call(void 0, t.props.ref,w,E),s=h({open:c}),A=()=>{m(!0),_optionalChain([e, 'access', _ => _.onOpen, 'optionalCall', _2 => _2()])},L=()=>{m(!1),_optionalChain([e, 'access', _3 => _3.onClose, 'optionalCall', _4 => _4()])},O=t&&_react.cloneElement.call(void 0, t,{...t.props,className:_clsx2.default.call(void 0, t.props.className,s.anchor),key:"popover-child",onClick:A,ref:B}),R=o&&_react.isValidElement.call(void 0, o)?_react.cloneElement.call(void 0, o,{...o.props,className:_clsx2.default.call(void 0, o.props.className,s.content),key:"popover-content"}):o;return _jsxruntime.jsx.call(void 0, _chunkT5P4M4B5cjs.a,{onClickAway:L,children:_jsxruntime.jsx.call(void 0, _chunk5NXYDZPPcjs.s,{className:_clsx2.default.call(void 0, s.root),children:_jsxruntime.jsx.call(void 0, _chunkMWGJDHZMcjs.b,{anchorEl:a,className:x,content:R,id:N,isPanel:T,open:(typeof p<"u"?p:c)&&Boolean(a),placement:k,children:O})})})});l.displayName="Popover";l.defaultProps={placement:"bottom",touchDelay:700,touchEndDelay:1500};var b=l;exports.a = D; exports.b = b;
