{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport ConfigProvider, { ConfigContext } from '../config-provider';\nexport function withPureRenderTheme(Component) {\n return props => ( /*#__PURE__*/React.createElement(ConfigProvider, {\n theme: {\n token: {\n motion: false,\n zIndexPopupBase: 0\n }\n }\n }, /*#__PURE__*/React.createElement(Component, Object.assign({}, props))));\n}\n/* istanbul ignore next */\nconst genPurePanel = (Component, defaultPrefixCls, getDropdownCls, postProps) => {\n const PurePanel = props => {\n const {\n prefixCls: customizePrefixCls,\n style\n } = props;\n const holderRef = React.useRef(null);\n const [popupHeight, setPopupHeight] = React.useState(0);\n const [popupWidth, setPopupWidth] = React.useState(0);\n const [open, setOpen] = useMergedState(false, {\n value: props.open\n });\n const {\n getPrefixCls\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls(defaultPrefixCls || 'select', customizePrefixCls);\n React.useEffect(() => {\n // We do not care about ssr\n setOpen(true);\n if (typeof ResizeObserver !== 'undefined') {\n const resizeObserver = new ResizeObserver(entries => {\n const element = entries[0].target;\n setPopupHeight(element.offsetHeight + 8);\n setPopupWidth(element.offsetWidth);\n });\n const interval = setInterval(() => {\n var _a;\n const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`;\n const popup = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(dropdownCls);\n if (popup) {\n clearInterval(interval);\n resizeObserver.observe(popup);\n }\n }, 10);\n return () => {\n clearInterval(interval);\n resizeObserver.disconnect();\n };\n }\n }, []);\n let mergedProps = Object.assign(Object.assign({}, props), {\n style: Object.assign(Object.assign({}, style), {\n margin: 0\n }),\n open,\n visible: open,\n getPopupContainer: () => holderRef.current\n });\n if (postProps) {\n mergedProps = postProps(mergedProps);\n }\n const mergedStyle = {\n paddingBottom: popupHeight,\n position: 'relative',\n minWidth: popupWidth\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: holderRef,\n style: mergedStyle\n }, /*#__PURE__*/React.createElement(Component, Object.assign({}, mergedProps)));\n };\n return withPureRenderTheme(PurePanel);\n};\nexport default genPurePanel;","map":{"version":3,"names":["React","useMergedState","ConfigProvider","ConfigContext","withPureRenderTheme","Component","props","createElement","theme","token","motion","zIndexPopupBase","Object","assign","genPurePanel","defaultPrefixCls","getDropdownCls","postProps","PurePanel","prefixCls","customizePrefixCls","style","holderRef","useRef","popupHeight","setPopupHeight","useState","popupWidth","setPopupWidth","open","setOpen","value","getPrefixCls","useContext","useEffect","ResizeObserver","resizeObserver","entries","element","target","offsetHeight","offsetWidth","interval","setInterval","_a","dropdownCls","popup","current","querySelector","clearInterval","observe","disconnect","mergedProps","margin","visible","getPopupContainer","mergedStyle","paddingBottom","position","minWidth","ref"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/_util/PurePanel.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport ConfigProvider, { ConfigContext } from '../config-provider';\nexport function withPureRenderTheme(Component) {\n return props => ( /*#__PURE__*/React.createElement(ConfigProvider, {\n theme: {\n token: {\n motion: false,\n zIndexPopupBase: 0\n }\n }\n }, /*#__PURE__*/React.createElement(Component, Object.assign({}, props))));\n}\n/* istanbul ignore next */\nconst genPurePanel = (Component, defaultPrefixCls, getDropdownCls, postProps) => {\n const PurePanel = props => {\n const {\n prefixCls: customizePrefixCls,\n style\n } = props;\n const holderRef = React.useRef(null);\n const [popupHeight, setPopupHeight] = React.useState(0);\n const [popupWidth, setPopupWidth] = React.useState(0);\n const [open, setOpen] = useMergedState(false, {\n value: props.open\n });\n const {\n getPrefixCls\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls(defaultPrefixCls || 'select', customizePrefixCls);\n React.useEffect(() => {\n // We do not care about ssr\n setOpen(true);\n if (typeof ResizeObserver !== 'undefined') {\n const resizeObserver = new ResizeObserver(entries => {\n const element = entries[0].target;\n setPopupHeight(element.offsetHeight + 8);\n setPopupWidth(element.offsetWidth);\n });\n const interval = setInterval(() => {\n var _a;\n const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`;\n const popup = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(dropdownCls);\n if (popup) {\n clearInterval(interval);\n resizeObserver.observe(popup);\n }\n }, 10);\n return () => {\n clearInterval(interval);\n resizeObserver.disconnect();\n };\n }\n }, []);\n let mergedProps = Object.assign(Object.assign({}, props), {\n style: Object.assign(Object.assign({}, style), {\n margin: 0\n }),\n open,\n visible: open,\n getPopupContainer: () => holderRef.current\n });\n if (postProps) {\n mergedProps = postProps(mergedProps);\n }\n const mergedStyle = {\n paddingBottom: popupHeight,\n position: 'relative',\n minWidth: popupWidth\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: holderRef,\n style: mergedStyle\n }, /*#__PURE__*/React.createElement(Component, Object.assign({}, mergedProps)));\n };\n return withPureRenderTheme(PurePanel);\n};\nexport default genPurePanel;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,cAAc,MAAM,iCAAiC;AAC5D,OAAOC,cAAc,IAAIC,aAAa,QAAQ,oBAAoB;AAClE,OAAO,SAASC,mBAAmBA,CAACC,SAAS,EAAE;EAC7C,OAAOC,KAAK,MAAM,aAAaN,KAAK,CAACO,aAAa,CAACL,cAAc,EAAE;IACjEM,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,MAAM,EAAE,KAAK;QACbC,eAAe,EAAE;MACnB;IACF;EACF,CAAC,EAAE,aAAaX,KAAK,CAACO,aAAa,CAACF,SAAS,EAAEO,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEP,KAAK,CAAC,CAAC,CAAC,CAAC;AAC5E;AACA;AACA,MAAMQ,YAAY,GAAGA,CAACT,SAAS,EAAEU,gBAAgB,EAAEC,cAAc,EAAEC,S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