{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport { render } from \"rc-util/es/React/render\";\nimport ConfigProvider, { globalConfig, warnContext } from '../config-provider';\nimport PurePanel from './PurePanel';\nimport useNotification, { useInternalNotification } from './useNotification';\nlet notification = null;\nlet act = callback => callback();\nlet taskQueue = [];\nlet defaultGlobalConfig = {};\nfunction getGlobalContext() {\n  const {\n    prefixCls: globalPrefixCls,\n    getContainer: globalGetContainer,\n    rtl,\n    maxCount,\n    top,\n    bottom\n  } = defaultGlobalConfig;\n  const mergedPrefixCls = globalPrefixCls !== null && globalPrefixCls !== void 0 ? globalPrefixCls : globalConfig().getPrefixCls('notification');\n  const mergedContainer = (globalGetContainer === null || globalGetContainer === void 0 ? void 0 : globalGetContainer()) || document.body;\n  return {\n    prefixCls: mergedPrefixCls,\n    getContainer: () => mergedContainer,\n    rtl,\n    maxCount,\n    top,\n    bottom\n  };\n}\nconst GlobalHolder = /*#__PURE__*/React.forwardRef((_, ref) => {\n  const [notificationConfig, setNotificationConfig] = React.useState(getGlobalContext);\n  const [api, holder] = useInternalNotification(notificationConfig);\n  const global = globalConfig();\n  const rootPrefixCls = global.getRootPrefixCls();\n  const rootIconPrefixCls = global.getIconPrefixCls();\n  const theme = global.getTheme();\n  const sync = () => {\n    setNotificationConfig(getGlobalContext);\n  };\n  React.useEffect(sync, []);\n  React.useImperativeHandle(ref, () => {\n    const instance = Object.assign({}, api);\n    Object.keys(instance).forEach(method => {\n      instance[method] = function () {\n        sync();\n        return api[method].apply(api, arguments);\n      };\n    });\n    return {\n      instance,\n      sync\n    };\n  });\n  return /*#__PURE__*/React.createElement(ConfigProvider, {\n    prefixCls: rootPrefixCls,\n    iconPrefixCls: rootIconPrefixCls,\n    theme: theme\n  }, holder);\n});\nfunction flushNotice() {\n  if (!notification) {\n    const holderFragment = document.createDocumentFragment();\n    const newNotification = {\n      fragment: holderFragment\n    };\n    notification = newNotification;\n    // Delay render to avoid sync issue\n    act(() => {\n      render( /*#__PURE__*/React.createElement(GlobalHolder, {\n        ref: node => {\n          const {\n            instance,\n            sync\n          } = node || {};\n          Promise.resolve().then(() => {\n            if (!newNotification.instance && instance) {\n              newNotification.instance = instance;\n              newNotification.sync = sync;\n              flushNotice();\n            }\n          });\n        }\n      }), holderFragment);\n    });\n    return;\n  }\n  // Notification not ready\n  if (!notification.instance) {\n    return;\n  }\n  // >>> Execute task\n  taskQueue.forEach(task => {\n    // eslint-disable-next-line default-case\n    switch (task.type) {\n      case 'open':\n        {\n          act(() => {\n            notification.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task.config));\n          });\n          break;\n        }\n      case 'destroy':\n        act(() => {\n          notification === null || notification === void 0 ? void 0 : notification.instance.destroy(task.key);\n        });\n        break;\n    }\n  });\n  // Clean up\n  taskQueue = [];\n}\n// ==============================================================================\n// ==                                  Export                                  ==\n// ==============================================================================\nfunction setNotificationGlobalConfig(config) {\n  defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config);\n  // Trigger sync for it\n  act(() => {\n    var _a;\n    (_a = notification === null || notification === void 0 ? void 0 : notification.sync) === null || _a === void 0 ? void 0 : _a.call(notification);\n  });\n}\nfunction open(config) {\n  // Warning if exist theme\n  if (process.env.NODE_ENV !== 'production') {\n    warnContext('notification');\n  }\n  taskQueue.push({\n    type: 'open',\n    config\n  });\n  flushNotice();\n}\nfunction destroy(key) {\n  taskQueue.push({\n    type: 'destroy',\n    key\n  });\n  flushNotice();\n}\nconst methods = ['success', 'info', 'warning', 'error'];\nconst baseStaticMethods = {\n  open,\n  destroy,\n  config: setNotificationGlobalConfig,\n  useNotification,\n  _InternalPanelDoNotUseOrYouWillBeFired: PurePanel\n};\nconst staticMethods = baseStaticMethods;\nmethods.forEach(type => {\n  staticMethods[type] = config => open(Object.assign(Object.assign({}, config), {\n    type\n  }));\n});\n// ==============================================================================\n// ==                                   Test                                   ==\n// ==============================================================================\nconst noop = () => {};\n/** @internal Only Work in test env */\n// eslint-disable-next-line import/no-mutable-exports\nexport let actWrapper = noop;\nif (process.env.NODE_ENV === 'test') {\n  actWrapper = wrapper => {\n    act = wrapper;\n  };\n}\nexport default staticMethods;","map":{"version":3,"names":["React","render","ConfigProvider","globalConfig","warnContext","PurePanel","useNotification","useInternalNotification","notification","act","callback","taskQueue","defaultGlobalConfig","getGlobalContext","prefixCls","globalPrefixCls","getContainer","globalGetContainer","rtl","maxCount","top","bottom","mergedPrefixCls","getPrefixCls","mergedContainer","document","body","GlobalHolder","forwardRef","_","ref","notificationConfig","setNotificationConfig","useState","api","holder","global","rootPrefixCls","getRootPrefixCls","rootIconPrefixCls","getIconPrefixCls","theme","getTheme","sync","useEffect","useImperativeHandle","instance","Object","assign","keys","forEach","method","apply","arguments","createElement","iconPrefixCls","flushNotice","holderFragment","createDocumentFragment","newNotification","fragment","node","Promise","resolve","then","task","type","open","config","destroy","key","setNotificationGlobalConfig","_a","call","process","env","NODE_ENV","push","methods","baseStaticMethods","_InternalPanelDoNotUseOrYouWillBeFired","staticMethods","noop","actWrapper","wrapper"],"sources":["/var/www/gavt/node_modules/antd/es/notification/index.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport { render } from \"rc-util/es/React/render\";\nimport ConfigProvider, { globalConfig, warnContext } from '../config-provider';\nimport PurePanel from './PurePanel';\nimport useNotification, { useInternalNotification } from './useNotification';\nlet notification = null;\nlet act = callback => callback();\nlet taskQueue = [];\nlet defaultGlobalConfig = {};\nfunction getGlobalContext() {\n  const {\n    prefixCls: globalPrefixCls,\n    getContainer: globalGetContainer,\n    rtl,\n    maxCount,\n    top,\n    bottom\n  } = defaultGlobalConfig;\n  const mergedPrefixCls = globalPrefixCls !== null && globalPrefixCls !== void 0 ? globalPrefixCls : globalConfig().getPrefixCls('notification');\n  const mergedContainer = (globalGetContainer === null || globalGetContainer === void 0 ? void 0 : globalGetContainer()) || document.body;\n  return {\n    prefixCls: mergedPrefixCls,\n    getContainer: () => mergedContainer,\n    rtl,\n    maxCount,\n    top,\n    bottom\n  };\n}\nconst GlobalHolder = /*#__PURE__*/React.forwardRef((_, ref) => {\n  const [notificationConfig, setNotificationConfig] = React.useState(getGlobalContext);\n  const [api, holder] = useInternalNotification(notificationConfig);\n  const global = globalConfig();\n  const rootPrefixCls = global.getRootPrefixCls();\n  const rootIconPrefixCls = global.getIconPrefixCls();\n  const theme = global.getTheme();\n  const sync = () => {\n    setNotificationConfig(getGlobalContext);\n  };\n  React.useEffect(sync, []);\n  React.useImperativeHandle(ref, () => {\n    const instance = Object.assign({}, api);\n    Object.keys(instance).forEach(method => {\n      instance[method] = function () {\n        sync();\n        return api[method].apply(api, arguments);\n      };\n    });\n    return {\n      instance,\n      sync\n    };\n  });\n  return /*#__PURE__*/React.createElement(ConfigProvider, {\n    prefixCls: rootPrefixCls,\n    iconPrefixCls: rootIconPrefixCls,\n    theme: theme\n  }, holder);\n});\nfunction flushNotice() {\n  if (!notification) {\n    const holderFragment = document.createDocumentFragment();\n    const newNotification = {\n      fragment: holderFragment\n    };\n    notification = newNotification;\n    // Delay render to avoid sync issue\n    act(() => {\n      render( /*#__PURE__*/React.createElement(GlobalHolder, {\n        ref: node => {\n          const {\n            instance,\n            sync\n          } = node || {};\n          Promise.resolve().then(() => {\n            if (!newNotification.instance && instance) {\n              newNotification.instance = instance;\n              newNotification.sync = sync;\n              flushNotice();\n            }\n          });\n        }\n      }), holderFragment);\n    });\n    return;\n  }\n  // Notification not ready\n  if (!notification.instance) {\n    return;\n  }\n  // >>> Execute task\n  taskQueue.forEach(task => {\n    // eslint-disable-next-line default-case\n    switch (task.type) {\n      case 'open':\n        {\n          act(() => {\n            notification.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task.config));\n          });\n          break;\n        }\n      case 'destroy':\n        act(() => {\n          notification === null || notification === void 0 ? void 0 : notification.instance.destroy(task.key);\n        });\n        break;\n    }\n  });\n  // Clean up\n  taskQueue = [];\n}\n// ==============================================================================\n// ==                                  Export                                  ==\n// ==============================================================================\nfunction setNotificationGlobalConfig(config) {\n  defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config);\n  // Trigger sync for it\n  act(() => {\n    var _a;\n    (_a = notification === null || notification === void 0 ? void 0 : notification.sync) === null || _a === void 0 ? void 0 : _a.call(notification);\n  });\n}\nfunction open(config) {\n  // Warning if exist theme\n  if (process.env.NODE_ENV !== 'production') {\n    warnContext('notification');\n  }\n  taskQueue.push({\n    type: 'open',\n    config\n  });\n  flushNotice();\n}\nfunction destroy(key) {\n  taskQueue.push({\n    type: 'destroy',\n    key\n  });\n  flushNotice();\n}\nconst methods = ['success', 'info', 'warning', 'error'];\nconst baseStaticMethods = {\n  open,\n  destroy,\n  config: setNotificationGlobalConfig,\n  useNotification,\n  _InternalPanelDoNotUseOrYouWillBeFired: PurePanel\n};\nconst staticMethods = baseStaticMethods;\nmethods.forEach(type => {\n  staticMethods[type] = config => open(Object.assign(Object.assign({}, config), {\n    type\n  }));\n});\n// ==============================================================================\n// ==                                   Test                                   ==\n// ==============================================================================\nconst noop = () => {};\n/** @internal Only Work in test env */\n// eslint-disable-next-line import/no-mutable-exports\nexport let actWrapper = noop;\nif (process.env.NODE_ENV === 'test') {\n  actWrapper = wrapper => {\n    act = wrapper;\n  };\n}\nexport default staticMethods;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,OAAOC,cAAc,IAAIC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;AAC9E,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,eAAe,IAAIC,uBAAuB,QAAQ,mBAAmB;AAC5E,IAAIC,YAAY,GAAG,IAAI;AACvB,IAAIC,GAAG,GAAGC,QAAQ,IAAIA,QAAQ,CAAC,CAAC;AAChC,IAAIC,SAAS,GAAG,EAAE;AAClB,IAAIC,mBAAmB,GAAG,CAAC,CAAC;AAC5B,SAASC,gBAAgBA,CAAA,EAAG;EAC1B,MAAM;IACJC,SA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