{"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 [wrapCSSVar, hashId, cssVarCls] = 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,\n    level: errorLevel,\n    bgColor,\n    fgColor: color,\n    style: {\n      width: undefined,\n      height: undefined\n    },\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 mergedCls = classNames(prefixCls, className, rootClassName, hashId, cssVarCls, {\n    [`${prefixCls}-borderless`]: !bordered\n  });\n  const mergedStyle = Object.assign({\n    width: size,\n    height: size,\n    backgroundColor: bgColor\n  }, style);\n  return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", {\n    className: mergedCls,\n    style: mergedStyle\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)))), status === 'scanned' && /*#__PURE__*/React.createElement(\"p\", {\n    className: `${prefixCls}-scanned`\n  }, locale === null || locale === void 0 ? void 0 : locale.scanned))), 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","wrapCSSVar","hashId","cssVarCls","imageSettings","src","x","undefined","y","height","width","excavate","qrCodeProps","level","fgColor","locale","process","env","NODE_ENV","warning","mergedCls","mergedStyle","Object","assign","backgroundColor","createElement","Fragment","expired","onClick","refresh","scanned","displayName"],"sources":["/Users/shanyi/Desktop/Projects/UC_Trains_Voice/react-demo/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 [wrapCSSVar, hashId, cssVarCls] = 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,\n    level: errorLevel,\n    bgColor,\n    fgColor: color,\n    style: {\n      width: undefined,\n      height: undefined\n    },\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 mergedCls = classNames(prefixCls, className, rootClassName, hashId, cssVarCls, {\n    [`${prefixCls}-borderless`]: !bordered\n  });\n  const mergedStyle = Object.assign({\n    width: size,\n    height: size,\n    backgroundColor: bgColor\n  }, style);\n  return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", {\n    className: mergedCls,\n    style: mergedStyle\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)))), status === 'scanned' && /*#__PURE__*/React.createElement(\"p\", {\n    className: `${prefixCls}-scanned`\n  }, locale === null || locale === void 0 ? void 0 : locale.scanned))), 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,QAA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