You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
12 KiB

{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _QRCode = require(\"qr.js/lib/QRCode\");\n\nvar _QRCode2 = _interopRequireDefault(_QRCode);\n\nvar _ErrorCorrectLevel = require(\"qr.js/lib/ErrorCorrectLevel\");\n\nvar _ErrorCorrectLevel2 = _interopRequireDefault(_ErrorCorrectLevel);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _QRCodeCell = require(\"./components/QRCodeCell\");\n\nvar _QRCodeCell2 = _interopRequireDefault(_QRCodeCell);\n\nvar _QRCodeSurface = require(\"./components/QRCodeSurface\");\n\nvar _QRCodeSurface2 = _interopRequireDefault(_QRCodeSurface);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n} // A `qr.js` doesn't handle error level of zero (M) so we need to do it right, thus the deep require.\n\n\nvar propTypes = {\n bgColor: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.string]),\n fgColor: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.string]),\n level: _propTypes2.default.oneOf([\"L\", \"M\", \"Q\", \"H\"]),\n size: _propTypes2.default.number,\n value: _propTypes2.default.string.isRequired\n};\nvar defaultProps = {\n bgColor: \"#FFFFFF\",\n fgColor: \"#000000\",\n level: \"L\",\n size: 256\n};\n\nvar QRCode = function QRCode(_ref) {\n var bgColor = _ref.bgColor,\n fgColor = _ref.fgColor,\n level = _ref.level,\n size = _ref.size,\n value = _ref.value,\n props = _objectWithoutProperties(_ref, [\"bgColor\", \"fgColor\", \"level\", \"size\", \"value\"]); // We'll use type === -1 to force QRCode to automatically pick the best type.\n\n\n var qrcode = new _QRCode2.default(-1, _ErrorCorrectLevel2.default[level]);\n qrcode.addData(value);\n qrcode.make();\n var cells = qrcode.modules;\n var tileSize = size / cells.length;\n return _react2.default.createElement(_QRCodeSurface2.default, _extends({}, props, {\n size: size\n }), cells.map(function (row, rowIndex) {\n return row.map(function (cell, cellIndex) {\n var transformX = Math.round(cellIndex * tileSize);\n var transformY = Math.round(rowIndex * tileSize);\n var qrItemWidth = Math.round((cellIndex + 1) * tileSize) - transformX;\n var qrItemHeight = Math.round((rowIndex + 1) * tileSize) - transformY;\n return _react2.default.createElement(_QRCodeCell2.default\n /* eslint-disable react/no-array-index-key */\n , {\n key: \"rectangle-\" + rowIndex + \"-\" + cellIndex\n /* eslint-enable react/no-array-index-key */\n ,\n d: \"M 0 0 L \" + qrItemWidth + \" 0 L \" + qrItemWidth + \" \" + qrItemHeight + \" L 0 \" + qrItemHeight + \" Z\",\n fill: cell ? fgColor : bgColor,\n transformX: transformX,\n transformY: transformY\n });\n });\n }));\n};\n\nQRCode.propTypes = propTypes;\nQRCode.defaultProps = defaultProps;\nexports.default = (0, _react.memo)(QRCode);","map":{"version":3,"names":["Object","defineProperty","exports","value","_extends","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","_QRCode","require","_QRCode2","_interopRequireDefault","_ErrorCorrectLevel","_ErrorCorrectLevel2","_propTypes","_propTypes2","_react","_react2","_QRCodeCell","_QRCodeCell2","_QRCodeSurface","_QRCodeSurface2","obj","__esModule","default","_objectWithoutProperties","keys","indexOf","propTypes","bgColor","oneOfType","object","string","fgColor","level","oneOf","size","number","isRequired","defaultProps","QRCode","_ref","props","qrcode","addData","make","cells","modules","tileSize","createElement","map","row","rowIndex","cell","cellIndex","transformX","Math","round","transformY","qrItemWidth","qrItemHeight","d","fill","memo"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-qr-code/lib/index.js"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _QRCode = require(\"qr.js/lib/QRCode\");\n\nvar _QRCode2 = _interopRequireDefault(_QRCode);\n\nvar _ErrorCorrectLevel = require(\"qr.js/lib/ErrorCorrectLevel\");\n\nvar _ErrorCorrectLevel2 = _interopRequireDefault(_ErrorCorrectLevel);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _QRCodeCell = require(\"./components/QRCodeCell\");\n\nvar _QRCodeCell2 = _interopRequireDefault(_QRCodeCell);\n\nvar _QRCodeSurface = require(\"./components/QRCodeSurface\");\n\nvar _QRCodeSurface2 = _interopRequireDefault(_QRCodeSurface);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } // A `qr.js` doesn't handle error level of zero (M) so we need to do it right, thus the deep require.\n\n\nvar propTypes = {\n bgColor: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.string]),\n fgColor: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.string]),\n level: _propTypes2.default.oneOf([\"L\", \"M\", \"Q\", \"H\"]),\n size: _propTypes2.default.number,\n value: _propTypes2.default.string.isRequired\n};\n\nvar defaultProps = {\n bgColor: \"#FFFFFF\",\n fgColor: \"#000000\",\n level: \"L\",\n size: 256\n};\n\nvar QRCode = function QRCode(_ref) {\n var bgColor = _ref.bgColor,\n fgColor = _ref.fgColor,\n level = _ref.level,\n size = _ref.size,\n value = _ref.value,\n props = _objectWithoutProperties(_ref, [\"bgColor\", \"fgColor\", \"level\", \"size\", \"value\"]);\n\n // We'll use type === -1 to force QRCode to automatically pick the best type.\n var qrcode = new _QRCode2.default(-1, _ErrorCorrectLevel2.default[level]);\n qrcode.addData(value);\n qrcode.make();\n var cells = qrcode.modules;\n var tileSize = size / cells.length;\n return _react2.default.createElement(\n _QRCodeSurface2.default,\n _extends({}, props, { size: size }),\n cells.map(function (row, rowIndex) {\n return row.map(function (cell, cellIndex) {\n var transformX = Math.round(cellIndex * tileSize);\n var transformY = Math.round(rowIndex * tileSize);\n var qrItemWidth = Math.round((cellIndex + 1) * tileSize) - transformX;\n var qrItemHeight = Math.round((rowIndex + 1) * tileSize) - transformY;\n return _react2.default.createElement(_QRCodeCell2.default\n /* eslint-disable react/no-array-index-key */\n , { key: \"rectangle-\" + rowIndex + \"-\" + cellIndex\n /* eslint-enable react/no-array-index-key */\n , d: \"M 0 0 L \" + qrItemWidth + \" 0 L \" + qrItemWidth + \" \" + qrItemHeight + \" L 0 \" + qrItemHeight + \" Z\",\n fill: cell ? fgColor : bgColor,\n transformX: transformX,\n transformY: transformY\n });\n });\n })\n );\n};\n\nQRCode.propTypes = propTypes;\nQRCode.defaultProps = defaultProps;\n\nexports.default = (0, _react.memo)(QRCode);"],"mappings":"AAAA;;AAEAA,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;EAC3CC,KAAK,EAAE;AADoC,CAA7C;;AAIA,IAAIC,QAAQ,GAAGJ,MAAM,CAACK,MAAP,IAAiB,UAAUC,MAAV,EAAkB;EAAE,KAAK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