{"ast":null,"code":"\"use client\";\n\nimport React, { useContext } from 'react';\nimport ReloadOutlined from \"@ant-design/icons/es/icons/ReloadOutlined\";\nimport classNames from 'classnames';\nimport { QRCodeCanvas, QRCodeSVG } from 'qrcode.react';\nimport { devUseWarning } from '../_util/warning';\nimport Button from '../button';\nimport { ConfigContext } from '../config-provider';\nimport { useLocale } from '../locale';\nimport Spin from '../spin';\nimport { useToken } from '../theme/internal';\nimport useStyle from './style/index';\nconst QRCode = props => {\n  const [, token] = useToken();\n  const {\n    value,\n    type = 'canvas',\n    icon = '',\n    size = 160,\n    iconSize = 40,\n    color = token.colorText,\n    errorLevel = 'M',\n    status = 'active',\n    bordered = true,\n    onRefresh,\n    style,\n    className,\n    rootClassName,\n    prefixCls: customizePrefixCls,\n    bgColor = 'transparent'\n  } = props;\n  const {\n    getPrefixCls\n  } = useContext(ConfigContext);\n  const prefixCls = getPrefixCls('qrcode', customizePrefixCls);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const imageSettings = {\n    src: icon,\n    x: undefined,\n    y: undefined,\n    height: iconSize,\n    width: iconSize,\n    excavate: true\n  };\n  const qrCodeProps = {\n    value,\n    size: size - (token.paddingSM + token.lineWidth) * 2,\n    level: errorLevel,\n    bgColor,\n    fgColor: color,\n    imageSettings: icon ? imageSettings : undefined\n  };\n  const [locale] = useLocale('QRCode');\n  if (process.env.NODE_ENV !== 'production') {\n    const warning = devUseWarning('QRCode');\n    process.env.NODE_ENV !== \"production\" ? warning(!!value, 'usage', 'need to receive `value` props') : void 0;\n    process.env.NODE_ENV !== \"production\" ? warning(!(icon && errorLevel === 'L'), 'usage', 'ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.') : void 0;\n  }\n  if (!value) {\n    return null;\n  }\n  const cls = classNames(prefixCls, className, rootClassName, hashId, {\n    [`${prefixCls}-borderless`]: !bordered\n  });\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", {\n    style: Object.assign(Object.assign({}, style), {\n      width: size,\n      height: size,\n      backgroundColor: bgColor\n    }),\n    className: cls\n  }, status !== 'active' && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-mask`\n  }, status === 'loading' && /*#__PURE__*/React.createElement(Spin, null), status === 'expired' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"p\", {\n    className: `${prefixCls}-expired`\n  }, locale === null || locale === void 0 ? void 0 : locale.expired), onRefresh && /*#__PURE__*/React.createElement(Button, {\n    type: \"link\",\n    icon: /*#__PURE__*/React.createElement(ReloadOutlined, null),\n    onClick: onRefresh\n  }, locale === null || locale === void 0 ? void 0 : locale.refresh))), type === 'canvas' ? /*#__PURE__*/React.createElement(QRCodeCanvas, Object.assign({}, qrCodeProps)) : /*#__PURE__*/React.createElement(QRCodeSVG, Object.assign({}, qrCodeProps))));\n};\nif (process.env.NODE_ENV !== 'production') {\n  QRCode.displayName = 'QRCode';\n}\nexport default QRCode;","map":{"version":3,"names":["React","useContext","ReloadOutlined","classNames","QRCodeCanvas","QRCodeSVG","devUseWarning","Button","ConfigContext","useLocale","Spin","useToken","useStyle","QRCode","props","token","value","type","icon","size","iconSize","color","colorText","errorLevel","status","bordered","onRefresh","style","className","rootClassName","prefixCls","customizePrefixCls","bgColor","getPrefixCls","wrapSSR","hashId","imageSettings","src","x","undefined","y","height","width","excavate","qrCodeProps","paddingSM","lineWidth","level","fgColor","locale","process","env","NODE_ENV","warning","cls","createElement","Object","assign","backgroundColor","Fragment","expired","onClick","refresh","displayName"],"sources":["/var/www/gavt/node_modules/antd/es/qr-code/index.js"],"sourcesContent":["\"use client\";\n\nimport React, { useContext } from 'react';\nimport ReloadOutlined from \"@ant-design/icons/es/icons/ReloadOutlined\";\nimport classNames from 'classnames';\nimport { QRCodeCanvas, QRCodeSVG } from 'qrcode.react';\nimport { devUseWarning } from '../_util/warning';\nimport Button from '../button';\nimport { ConfigContext } from '../config-provider';\nimport { useLocale } from '../locale';\nimport Spin from '../spin';\nimport { useToken } from '../theme/internal';\nimport useStyle from './style/index';\nconst QRCode = props => {\n  const [, token] = useToken();\n  const {\n    value,\n    type = 'canvas',\n    icon = '',\n    size = 160,\n    iconSize = 40,\n    color = token.colorText,\n    errorLevel = 'M',\n    status = 'active',\n    bordered = true,\n    onRefresh,\n    style,\n    className,\n    rootClassName,\n    prefixCls: customizePrefixCls,\n    bgColor = 'transparent'\n  } = props;\n  const {\n    getPrefixCls\n  } = useContext(ConfigContext);\n  const prefixCls = getPrefixCls('qrcode', customizePrefixCls);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const imageSettings = {\n    src: icon,\n    x: undefined,\n    y: undefined,\n    height: iconSize,\n    width: iconSize,\n    excavate: true\n  };\n  const qrCodeProps = {\n    value,\n    size: size - (token.paddingSM + token.lineWidth) * 2,\n    level: errorLevel,\n    bgColor,\n    fgColor: color,\n    imageSettings: icon ? imageSettings : undefined\n  };\n  const [locale] = useLocale('QRCode');\n  if (process.env.NODE_ENV !== 'production') {\n    const warning = devUseWarning('QRCode');\n    process.env.NODE_ENV !== \"production\" ? warning(!!value, 'usage', 'need to receive `value` props') : void 0;\n    process.env.NODE_ENV !== \"production\" ? warning(!(icon && errorLevel === 'L'), 'usage', 'ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.') : void 0;\n  }\n  if (!value) {\n    return null;\n  }\n  const cls = classNames(prefixCls, className, rootClassName, hashId, {\n    [`${prefixCls}-borderless`]: !bordered\n  });\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", {\n    style: Object.assign(Object.assign({}, style), {\n      width: size,\n      height: size,\n      backgroundColor: bgColor\n    }),\n    className: cls\n  }, status !== 'active' && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-mask`\n  }, status === 'loading' && /*#__PURE__*/React.createElement(Spin, null), status === 'expired' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"p\", {\n    className: `${prefixCls}-expired`\n  }, locale === null || locale === void 0 ? void 0 : locale.expired), onRefresh && /*#__PURE__*/React.createElement(Button, {\n    type: \"link\",\n    icon: /*#__PURE__*/React.createElement(ReloadOutlined, null),\n    onClick: onRefresh\n  }, locale === null || locale === void 0 ? void 0 : locale.refresh))), type === 'canvas' ? /*#__PURE__*/React.createElement(QRCodeCanvas, Object.assign({}, qrCodeProps)) : /*#__PURE__*/React.createElement(QRCodeSVG, Object.assign({}, qrCodeProps))));\n};\nif (process.env.NODE_ENV !== 'production') {\n  QRCode.displayName = 'QRCode';\n}\nexport default QRCode;"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,cAAc,MAAM,2CAA2C;AACtE,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,YAAY,EAAEC,SAAS,QAAQ,cAAc;AACtD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,OAAOC,QAAQ,MAAM,eAAe;AACpC,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM,GAAGC,KAAK,CAAC,GAAGJ,QAAQ,CAAC,CAAC;EAC5B,MAAM;IACJK,KAAK;IACLC,IAAI,GAAG,QAAQ;IACfC,IAAI,GAAG,EAAE;IACTC,IAAI,GAAG,GAAG;IACVC,QAAQ,GAAG,EAAE;IACbC,KAAK,GAAGN,KAAK,CAACO,SAAS;IACvBC,UAAU,GAAG,GAAG;IAChBC,MAAM,GAAG,QAAQ;IACjBC,QAAQ,GAAG,IAAI;IACfC,SAAS;IACTC,KAAK;IACLC,SAAS;IACTC,aAAa;IACbC,SAAS,EAAEC,kBAAkB;IAC7BC,OAAO,GAAG;EACZ,CAAC,GAAGlB,KAAK;EACT,MAAM;IACJmB;EACF,CAAC,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