{"ast":null,"code":"\"use client\";\n\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { ConfigContext } from '../../config-provider';\nimport defaultLocale from '../../locale/en_US';\nimport useLocale from '../../locale/useLocale';\nimport ConfirmDialog from '../ConfirmDialog';\nconst HookModal = (_a, ref) => {\n var _b;\n var {\n afterClose: hookAfterClose,\n config\n } = _a,\n restProps = __rest(_a, [\"afterClose\", \"config\"]);\n const [open, setOpen] = React.useState(true);\n const [innerConfig, setInnerConfig] = React.useState(config);\n const {\n direction,\n getPrefixCls\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('modal');\n const rootPrefixCls = getPrefixCls();\n const afterClose = () => {\n var _a;\n hookAfterClose();\n (_a = innerConfig.afterClose) === null || _a === void 0 ? void 0 : _a.call(innerConfig);\n };\n const close = function () {\n var _a;\n setOpen(false);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n const triggerCancel = args.some(param => param === null || param === void 0 ? void 0 : param.triggerCancel);\n if (triggerCancel) {\n var _a2;\n (_a = innerConfig.onCancel) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [innerConfig, () => {}].concat(_toConsumableArray(args.slice(1))));\n }\n };\n React.useImperativeHandle(ref, () => ({\n destroy: close,\n update: newConfig => {\n setInnerConfig(originConfig => Object.assign(Object.assign({}, originConfig), newConfig));\n }\n }));\n const mergedOkCancel = (_b = innerConfig.okCancel) !== null && _b !== void 0 ? _b : innerConfig.type === 'confirm';\n const [contextLocale] = useLocale('Modal', defaultLocale.Modal);\n return /*#__PURE__*/React.createElement(ConfirmDialog, Object.assign({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls\n }, innerConfig, {\n close: close,\n open: open,\n afterClose: afterClose,\n okText: innerConfig.okText || (mergedOkCancel ? contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.okText : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.justOkText),\n direction: innerConfig.direction || direction,\n cancelText: innerConfig.cancelText || (contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.cancelText)\n }, restProps));\n};\nexport default /*#__PURE__*/React.forwardRef(HookModal);","map":{"version":3,"names":["_toConsumableArray","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","ConfigContext","defaultLocale","useLocale","ConfirmDialog","HookModal","_a","ref","_b","afterClose","hookAfterClose","config","restProps","open","setOpen","useState","innerConfig","setInnerConfig","direction","getPrefixCls","useContext","prefixCls","rootPrefixCls","close","_len","arguments","args","Array","_key","triggerCancel","some","param","_a2","onCancel","apply","concat","slice","useImperativeHandle","destroy","update","newConfig","originConfig","assign","mergedOkCancel","okCancel","type","contextLocale","Modal","createElement","okText","justOkText","cancelText","forwardRef"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/modal/useModal/HookModal.js"],"sourcesContent":["\"use client\";\n\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport { ConfigContext } from '../../config-provider';\nimport defaultLocale from '../../locale/en_US';\nimport useLocale from '../../locale/useLocale';\nimport ConfirmDialog from '../ConfirmDialog';\nconst HookModal = (_a, ref) => {\n var _b;\n var {\n afterClose: hookAfterClose,\n config\n } = _a,\n restProps = __rest(_a, [\"afterClose\", \"config\"]);\n const [open, setOpen] = React.useState(true);\n const [innerConfig, setInnerConfig] = React.useState(config);\n const {\n direction,\n getPrefixCls\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('modal');\n const rootPrefixCls = getPrefixCls();\n const afterClose = () => {\n var _a;\n hookAfterClose();\n (_a = innerConfig.afterClose) === null || _a === void 0 ? void 0 : _a.call(innerConfig);\n };\n const close = function () {\n var _a;\n setOpen(false);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n const triggerCancel = args.some(param => param === null || param === void 0 ? void 0 : param.triggerCancel);\n if (triggerCancel) {\n var _a2;\n (_a = innerConfig.onCancel) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [innerConfig, () => {}].concat(_toConsumableArray(args.slice(1))));\n }\n };\n React.useImperativeHandle(ref, () => ({\n destroy: close,\n update: newConfig => {\n setInnerConfig(originConfig => Object.assign(Object.assign({}, originConfig), newConfig));\n }\n }));\n const mergedOkCancel = (_b = innerConfig.okCancel) !== null && _b !== void 0 ? _b : innerConfig.type === 'confirm';\n const [contextLocale] = useLocale('Modal', defaultLocale.Modal);\n return /*#__PURE__*/React.createElement(ConfirmDialog, Object.assign({\n prefixCls: prefixCls,\n rootPrefixCls: rootPrefixCls\n }, innerConfig, {\n close: close,\n open: open,\n afterClose: afterClose,\n okText: innerConfig.okText || (mergedOkCancel ? contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.okText : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.justOkText),\n direction: innerConfig.direction || direction,\n cancelText: innerConfig.cancelText || (contextLocale === null || contextLocale === void 0 ? void 0 : cont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