{"ast":null,"code":"\"use client\";\n\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport React from 'react';\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport classNames from 'classnames';\nimport Button from '../button';\nimport { useLocale } from '../locale';\nimport defaultLocale from '../locale/en_US';\nfunction isValidNode(node) {\n return node !== undefined && node !== null;\n}\n// Due to the independent design of Panel, it will be too coupled to put in rc-tour,\n// so a set of Panel logic is implemented separately in antd.\nconst TourPanel = props => {\n var _a, _b;\n const {\n stepProps,\n current,\n type,\n indicatorsRender\n } = props;\n const {\n prefixCls,\n total = 1,\n title,\n onClose,\n onPrev,\n onNext,\n onFinish,\n cover,\n description,\n nextButtonProps,\n prevButtonProps,\n type: stepType,\n closable\n } = stepProps;\n const mergedType = stepType !== null && stepType !== void 0 ? stepType : type;\n const mergedCloseIcon = /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onClose,\n className: `${prefixCls}-close`\n }, (closable === null || closable === void 0 ? void 0 : closable.closeIcon) || /*#__PURE__*/React.createElement(CloseOutlined, {\n className: `${prefixCls}-close-icon`\n }));\n const isLastStep = current === total - 1;\n const prevBtnClick = () => {\n var _a;\n onPrev === null || onPrev === void 0 ? void 0 : onPrev();\n (_a = prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(prevButtonProps);\n };\n const nextBtnClick = () => {\n var _a;\n if (isLastStep) {\n onFinish === null || onFinish === void 0 ? void 0 : onFinish();\n } else {\n onNext === null || onNext === void 0 ? void 0 : onNext();\n }\n (_a = nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(nextButtonProps);\n };\n const headerNode = isValidNode(title) ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-header`\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-title`\n }, title))) : null;\n const descriptionNode = isValidNode(description) ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-description`\n }, description)) : null;\n const coverNode = isValidNode(cover) ? /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-cover`\n }, cover) : null;\n let mergedIndicatorNode;\n if (indicatorsRender) {\n mergedIndicatorNode = indicatorsRender(current, total);\n } else {\n mergedIndicatorNode = _toConsumableArray(Array.from({\n length: total\n }).keys()).map((stepItem, index) => ( /*#__PURE__*/React.createElement(\"span\", {\n key: stepItem,\n className: classNames(index === current && `${prefixCls}-indicator-active`, `${prefixCls}-indicator`)\n })));\n }\n const mainBtnType = mergedType === 'primary' ? 'default' : 'primary';\n const secondaryBtnProps = {\n type: 'default',\n ghost: mergedType === 'primary'\n };\n const [contextLocale] = useLocale('Tour', defaultLocale.Tour);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-content`\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-inner`\n }, closable && mergedCloseIcon, coverNode, headerNode, descriptionNode, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-footer`\n }, total > 1 && /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-indicators`\n }, mergedIndicatorNode), /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-buttons`\n }, current !== 0 ? ( /*#__PURE__*/React.createElement(Button, Object.assign({}, secondaryBtnProps, prevButtonProps, {\n onClick: prevBtnClick,\n size: \"small\",\n className: classNames(`${prefixCls}-prev-btn`, prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.className)\n }), (_a = prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.children) !== null && _a !== void 0 ? _a : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Previous)) : null, /*#__PURE__*/React.createElement(Button, Object.assign({\n type: mainBtnType\n }, nextButtonProps, {\n onClick: nextBtnClick,\n size: \"small\",\n className: classNames(`${prefixCls}-next-btn`, nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.className)\n }), (_b = nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.children) !== null && _b !== void 0 ? _b : isLastStep ? contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Finish : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Next)))));\n};\nexport default TourPanel;","map":{"version":3,"names":["_toConsumableArray","React","CloseOutlined","classNames","Button","useLocale","defaultLocale","isValidNode","node","undefined","TourPanel","props","_a","_b","stepProps","current","type","indicatorsRender","prefixCls","total","title","onClose","onPrev","onNext","onFinish","cover","description","nextButtonProps","prevButtonProps","stepType","closable","mergedType","mergedCloseIcon","createElement","onClick","className","closeIcon","isLastStep","prevBtnClick","call","nextBtnClick","headerNode","descriptionNode","coverNode","mergedIndicatorNode","Array","from","length","keys","map","stepItem","index","key","mainBtnType","secondaryBtnProps","ghost","contextLocale","Tour","Object","assign","size","children","Previous","Finish","Next"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/tour/panelRender.js"],"sourcesContent":["\"use client\";\n\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport React from 'react';\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport classNames from 'classnames';\nimport Button from '../button';\nimport { useLocale } from '../locale';\nimport defaultLocale from '../locale/en_US';\nfunction isValidNode(node) {\n return node !== undefined && node !== null;\n}\n// Due to the independent design of Panel, it will be too coupled to put in rc-tour,\n// so a set of Panel logic is implemented separately in antd.\nconst TourPanel = props => {\n var _a, _b;\n const {\n stepProps,\n current,\n type,\n indicatorsRender\n } = props;\n const {\n prefixCls,\n total = 1,\n title,\n onClose,\n onPrev,\n onNext,\n onFinish,\n cover,\n description,\n nextButtonProps,\n prevButtonProps,\n type: stepType,\n closable\n } = stepProps;\n const mergedType = stepType !== null && stepType !== void 0 ? stepType : type;\n const mergedCloseIcon = /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: onClose,\n className: `${prefixCls}-close`\n }, (closable === null || closable === void 0 ? void 0 : closable.closeIcon) || /*#__PURE__*/React.createElement(CloseOutlined, {\n className: `${prefixCls}-close-icon`\n }));\n const isLastStep = current === total - 1;\n const prevBtnClick = () => {\n var _a;\n onPrev === null || onPrev === void 0 ? void 0 : onPrev();\n (_a = prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(prevButtonProps);\n };\n const nextBtnClick = () => {\n var _a;\n if (isLastStep) {\n onFinish === null || onFinish === void 0 ? void 0 : onFinish();\n } else {\n onNext === null || onNext === void 0 ? void 0 : onNext();\n }\n (_a = nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(nextButtonProps);\n };\n const headerNode = isValidNode(title) ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-header`\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-title`\n }, title))) : null;\n const descriptionNode = isValidNode(description) ? ( /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-description`\n }, description)) : null;\n const coverNode = isValidNode(cover) ? /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-cover`\n }, cover) : null;\n let mergedIndicatorNode;\n if (indicatorsRender) {\n mergedIndicatorNode = indicatorsRender(current, total);\n } else {\n mergedIndicatorNode = _toConsumableArray(Array.from({\n length: total\n }).keys()).map((stepItem, index) => ( /*#__PURE__*/React.createElement(\"span\", {\n key: stepItem,\n className: classNames(index === current && `${prefixCls}-indicator-active`, `${prefixCls}-indicator`)\n })));\n }\n const mainBtnType = mergedType === 'primary' ? 'default' : 'primary';\n const secondaryBtnProps = {\n type: 'default',\n ghost: mergedType === 'primary'\n };\n const [contextLocale] = useLocale('Tour', defaultLocale.Tour);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-content`\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-inner`\n }, closable && mergedCloseIcon, coverNode, headerNode, descriptionNode, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-footer`\n }, total > 1 && /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-indicators`\n }, mergedIndicatorNode), /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-buttons`\n }, current !== 0 ? ( /*#__PURE__*/React.createElement(Button, Object.assign({}, secondaryBtnProps, prevButtonProps, {\n onClick: prevBtnClick,\n size: \"small\",\n className: classNames(`${prefixCls}-prev-btn`, prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.className)\n }), (_a = prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.children) !== null && _a !== void 0 ? _a : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Previous)) : null, /*#__PURE__*/React.createElement(Button, Object.assign({\n type: mainBtnType\n }, nextButtonProps, {\n onClick: nextBtnClick,\n size: \"small\",\n className: classNames(`${prefixCls}-next-btn`, nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.className)\n }), (_b = nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.children) !== null && _b !== void 0 ? _b : isLastStep ? contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Finish : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Next)))));\n};\nexport default TourPanel;"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,SAASC,WAAWA,CAACC,IAAI,EAAE;EACzB,OAAOA,IAAI,KAAKC,SAAS,IAAID,IAAI,KAAK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