{"ast":null,"code":"import React, { useContext, useRef } from 'react';\nimport classNames from 'classnames';\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport { ConfigContext } from '../../config-provider';\nimport { cloneElement } from '../reactNode';\nimport useStyle from './style';\nimport useWave from './useWave';\nconst Wave = props => {\n const {\n children,\n disabled,\n component\n } = props;\n const {\n getPrefixCls\n } = useContext(ConfigContext);\n const containerRef = useRef(null);\n // ============================== Style ===============================\n const prefixCls = getPrefixCls('wave');\n const [, hashId] = useStyle(prefixCls);\n // =============================== Wave ===============================\n const showWave = useWave(containerRef, classNames(prefixCls, hashId), component);\n // ============================== Effect ==============================\n React.useEffect(() => {\n const node = containerRef.current;\n if (!node || node.nodeType !== 1 || disabled) {\n return;\n }\n // Click handler\n const onClick = e => {\n // Fix radio button click twice\n if (!isVisible(e.target) ||\n // No need wave\n !node.getAttribute || node.getAttribute('disabled') || node.disabled || node.className.includes('disabled') || node.className.includes('-leave')) {\n return;\n }\n showWave(e);\n };\n // Bind events\n node.addEventListener('click', onClick, true);\n return () => {\n node.removeEventListener('click', onClick, true);\n };\n }, [disabled]);\n // ============================== Render ==============================\n if (! /*#__PURE__*/React.isValidElement(children)) {\n return children !== null && children !== void 0 ? children : null;\n }\n const ref = supportRef(children) ? composeRef(children.ref, containerRef) : containerRef;\n return cloneElement(children, {\n ref\n });\n};\nif (process.env.NODE_ENV !== 'production') {\n Wave.displayName = 'Wave';\n}\nexport default Wave;","map":{"version":3,"names":["React","useContext","useRef","classNames","isVisible","composeRef","supportRef","ConfigContext","cloneElement","useStyle","useWave","Wave","props","children","disabled","component","getPrefixCls","containerRef","prefixCls","hashId","showWave","useEffect","node","current","nodeType","onClick","e","target","getAttribute","className","includes","addEventListener","removeEventListener","isValidElement","ref","process","env","NODE_ENV","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/_util/wave/index.js"],"sourcesContent":["import React, { useContext, useRef } from 'react';\nimport classNames from 'classnames';\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport { ConfigContext } from '../../config-provider';\nimport { cloneElement } from '../reactNode';\nimport useStyle from './style';\nimport useWave from './useWave';\nconst Wave = props => {\n const {\n children,\n disabled,\n component\n } = props;\n const {\n getPrefixCls\n } = useContext(ConfigContext);\n const containerRef = useRef(null);\n // ============================== Style ===============================\n const prefixCls = getPrefixCls('wave');\n const [, hashId] = useStyle(prefixCls);\n // =============================== Wave ===============================\n const showWave = useWave(containerRef, classNames(prefixCls, hashId), component);\n // ============================== Effect ==============================\n React.useEffect(() => {\n const node = containerRef.current;\n if (!node || node.nodeType !== 1 || disabled) {\n return;\n }\n // Click handler\n const onClick = e => {\n // Fix radio button click twice\n if (!isVisible(e.target) ||\n // No need wave\n !node.getAttribute || node.getAttribute('disabled') || node.disabled || node.className.includes('disabled') || node.className.includes('-leave')) {\n return;\n }\n showWave(e);\n };\n // Bind events\n node.addEventListener('click', onClick, true);\n return () => {\n node.removeEventListener('click', onClick, true);\n };\n }, [disabled]);\n // ============================== Render ==============================\n if (! /*#__PURE__*/React.isValidElement(children)) {\n return children !== null && children !== void 0 ? children : null;\n }\n const ref = supportRef(children) ? composeRef(children.ref, containerRef) : containerRef;\n return cloneElement(children, {\n ref\n });\n};\nif (process.env.NODE_ENV !== 'production') {\n Wave.displayName = 'Wave';\n}\nexport default Wave;"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AACjD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,0BAA0B;AAChD,SAASC,UAAU,EAAEC,UAAU,QAAQ,gBAAgB;AACvD,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,YAAY,QAAQ,cAAc;AAC3C,OAAOC,QAAQ,MAAM,SAAS;AAC9B,OAAOC,OAAO,MAAM,WAAW;AAC/B,MAAMC,IAAI,GAAGC,KAAK,IA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