1 line
34 KiB
JSON
1 line
34 KiB
JSON
{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport RawAsyncValidator from '@rc-component/async-validator';\nimport * as React from 'react';\nimport warning from \"rc-util/es/warning\";\nimport { defaultValidateMessages } from \"./messages\";\nimport { merge } from \"rc-util/es/utils/set\";\n\n// Remove incorrect original ts define\nvar AsyncValidator = RawAsyncValidator;\n\n/**\n * Replace with template.\n * `I'm ${name}` + { name: 'bamboo' } = I'm bamboo\n */\nfunction replaceMessage(template, kv) {\n return template.replace(/\\$\\{\\w+\\}/g, function (str) {\n var key = str.slice(2, -1);\n return kv[key];\n });\n}\nvar CODE_LOGIC_ERROR = 'CODE_LOGIC_ERROR';\nfunction validateRule(_x, _x2, _x3, _x4, _x5) {\n return _validateRule.apply(this, arguments);\n}\n/**\n * We use `async-validator` to validate the value.\n * But only check one value in a time to avoid namePath validate issue.\n */\nfunction _validateRule() {\n _validateRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(name, value, rule, options, messageVariables) {\n var cloneRule, originValidator, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n cloneRule = _objectSpread({}, rule); // Bug of `async-validator`\n // https://github.com/react-component/field-form/issues/316\n // https://github.com/react-component/field-form/issues/313\n delete cloneRule.ruleIndex;\n\n // https://github.com/ant-design/ant-design/issues/40497#issuecomment-1422282378\n AsyncValidator.warning = function () {\n return void 0;\n };\n if (cloneRule.validator) {\n originValidator = cloneRule.validator;\n cloneRule.validator = function () {\n try {\n return originValidator.apply(void 0, arguments);\n } catch (error) {\n console.error(error);\n return Promise.reject(CODE_LOGIC_ERROR);\n }\n };\n }\n\n // We should special handle array validate\n subRuleField = null;\n if (cloneRule && cloneRule.type === 'array' && cloneRule.defaultField) {\n subRuleField = cloneRule.defaultField;\n delete cloneRule.defaultField;\n }\n validator = new AsyncValidator(_defineProperty({}, name, [cloneRule]));\n messages = merge(defaultValidateMessages, options.validateMessages);\n validator.messages(messages);\n result = [];\n _context2.prev = 10;\n _context2.next = 13;\n return Promise.resolve(validator.validate(_defineProperty({}, name, value), _objectSpread({}, options)));\n case 13:\n _context2.next = 18;\n break;\n case 15:\n _context2.prev = 15;\n _context2.t0 = _context2[\"catch\"](10);\n if (_context2.t0.errors) {\n result = _context2.t0.errors.map(function (_ref4, index) {\n var message = _ref4.message;\n var mergedMessage = message === CODE_LOGIC_ERROR ? messages.default : message;\n return /*#__PURE__*/React.isValidElement(mergedMessage) ? /*#__PURE__*/\n // Wrap ReactNode with `key`\n React.cloneElement(mergedMessage, {\n key: \"error_\".concat(index)\n }) : mergedMessage;\n });\n }\n case 18:\n if (!(!result.length && subRuleField)) {\n _context2.next = 23;\n break;\n }\n _context2.next = 21;\n return Promise.all(value.map(function (subValue, i) {\n return validateRule(\"\".concat(name, \".\").concat(i), subValue, subRuleField, options, messageVariables);\n }));\n case 21:\n subResults = _context2.sent;\n return _context2.abrupt(\"return\", subResults.reduce(function (prev, errors) {\n return [].concat(_toConsumableArray(prev), _toConsumableArray(errors));\n }, []));\n case 23:\n // Replace message with variables\n kv = _objectSpread(_objectSpread({}, rule), {}, {\n name: name,\n enum: (rule.enum || []).join(', ')\n }, messageVariables);\n fillVariableResult = result.map(function (error) {\n if (typeof error === 'string') {\n return replaceMessage(error, kv);\n }\n return error;\n });\n return _context2.abrupt(\"return\", fillVariableResult);\n case 26:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[10, 15]]);\n }));\n return _validateRule.apply(this, arguments);\n}\nexport function validateRules(namePath, value, rules, options, validateFirst, messageVariables) {\n var name = namePath.join('.');\n\n // Fill rule with context\n var filledRules = rules.map(function (currentRule, ruleIndex) {\n var originValidatorFunc = currentRule.validator;\n var cloneRule = _objectSpread(_objectSpread({}, currentRule), {}, {\n ruleIndex: ruleIndex\n });\n\n // Replace validator if needed\n if (originValidatorFunc) {\n cloneRule.validator = function (rule, val, callback) {\n var hasPromise = false;\n\n // Wrap callback only accept when promise not provided\n var wrappedCallback = function wrappedCallback() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // Wait a tick to make sure return type is a promise\n Promise.resolve().then(function () {\n warning(!hasPromise, 'Your validator function has already return a promise. `callback` will be ignored.');\n if (!hasPromise) {\n callback.apply(void 0, args);\n }\n });\n };\n\n // Get promise\n var promise = originValidatorFunc(rule, val, wrappedCallback);\n hasPromise = promise && typeof promise.then === 'function' && typeof promise.catch === 'function';\n\n /**\n * 1. Use promise as the first priority.\n * 2. If promise not exist, use callback with warning instead\n */\n warning(hasPromise, '`callback` is deprecated. Please return a promise instead.');\n if (hasPromise) {\n promise.then(function () {\n callback();\n }).catch(function (err) {\n callback(err || ' ');\n });\n }\n };\n }\n return cloneRule;\n }).sort(function (_ref, _ref2) {\n var w1 = _ref.warningOnly,\n i1 = _ref.ruleIndex;\n var w2 = _ref2.warningOnly,\n i2 = _ref2.ruleIndex;\n if (!!w1 === !!w2) {\n // Let keep origin order\n return i1 - i2;\n }\n if (w1) {\n return 1;\n }\n return -1;\n });\n\n // Do validate rules\n var summaryPromise;\n if (validateFirst === true) {\n // >>>>> Validate by serialization\n summaryPromise = new Promise( /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {\n var i, rule, errors;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < filledRules.length)) {\n _context.next = 12;\n break;\n }\n rule = filledRules[i];\n _context.next = 5;\n return validateRule(name, value, rule, options, messageVariables);\n case 5:\n errors = _context.sent;\n if (!errors.length) {\n _context.next = 9;\n break;\n }\n reject([{\n errors: errors,\n rule: rule\n }]);\n return _context.abrupt(\"return\");\n case 9:\n i += 1;\n _context.next = 1;\n break;\n case 12:\n /* eslint-enable */\n\n resolve([]);\n case 13:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x6, _x7) {\n return _ref3.apply(this, arguments);\n };\n }());\n } else {\n // >>>>> Validate by parallel\n var rulePromises = filledRules.map(function (rule) {\n return validateRule(name, value, rule, options, messageVariables).then(function (errors) {\n return {\n errors: errors,\n rule: rule\n };\n });\n });\n summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then(function (errors) {\n // Always change to rejection for Field to catch\n return Promise.reject(errors);\n });\n }\n\n // Internal catch error to avoid console error log.\n summaryPromise.catch(function (e) {\n return e;\n });\n return summaryPromise;\n}\nfunction finishOnAllFailed(_x8) {\n return _finishOnAllFailed.apply(this, arguments);\n}\nfunction _finishOnAllFailed() {\n _finishOnAllFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(rulePromises) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", Promise.all(rulePromises).then(function (errorsList) {\n var _ref5;\n var errors = (_ref5 = []).concat.apply(_ref5, _toConsumableArray(errorsList));\n return errors;\n }));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _finishOnAllFailed.apply(this, arguments);\n}\nfunction finishOnFirstFailed(_x9) {\n return _finishOnFirstFailed.apply(this, arguments);\n}\nfunction _finishOnFirstFailed() {\n _finishOnFirstFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(rulePromises) {\n var count;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n count = 0;\n return _context4.abrupt(\"return\", new Promise(function (resolve) {\n rulePromises.forEach(function (promise) {\n promise.then(function (ruleError) {\n if (ruleError.errors.length) {\n resolve([ruleError]);\n }\n count += 1;\n if (count === rulePromises.length) {\n resolve([]);\n }\n });\n });\n }));\n case 2:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _finishOnFirstFailed.apply(this, arguments);\n}","map":{"version":3,"names":["_toConsumableArray","_defineProperty","_regeneratorRuntime","_objectSpread","_asyncToGenerator","RawAsyncValidator","React","warning","defaultValidateMessages","merge","AsyncValidator","replaceMessage","template","kv","replace","str","key","slice","CODE_LOGIC_ERROR","validateRule","_x","_x2","_x3","_x4","_x5","_validateRule","apply","arguments","mark","_callee2","name","value","rule","options","messageVariables","cloneRule","originValidator","subRuleField","validator","messages","result","subResults","fillVariableResult","wrap","_callee2$","_context2","prev","next","ruleIndex","error","console","Promise","reject","type","defaultField","validateMessages","resolve","validate","t0","errors","map","_ref4","index","message","mergedMessage","default","isValidElement","cloneElement","concat","length","all","subValue","i","sent","abrupt","reduce","enum","join","stop","validateRules","namePath","rules","validateFirst","filledRules","currentRule","originValidatorFunc","val","callback","hasPromise","wrappedCallback","_len","args","Array","_key","then","promise","catch","err","sort","_ref","_ref2","w1","warningOnly","i1","w2","i2","summaryPromise","_ref3","_callee","_callee$","_context","_x6","_x7","rulePromises","finishOnFirstFailed","finishOnAllFailed","e","_x8","_finishOnAllFailed","_callee3","_callee3$","_context3","errorsList","_ref5","_x9","_finishOnFirstFailed","_callee4","count","_callee4$","_context4","forEach","ruleError"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-field-form/es/utils/validateUtil.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport RawAsyncValidator from '@rc-component/async-validator';\nimport * as React from 'react';\nimport warning from \"rc-util/es/warning\";\nimport { defaultValidateMessages } from \"./messages\";\nimport { merge } from \"rc-util/es/utils/set\";\n\n// Remove incorrect original ts define\nvar AsyncValidator = RawAsyncValidator;\n\n/**\n * Replace with template.\n * `I'm ${name}` + { name: 'bamboo' } = I'm bamboo\n */\nfunction replaceMessage(template, kv) {\n return template.replace(/\\$\\{\\w+\\}/g, function (str) {\n var key = str.slice(2, -1);\n return kv[key];\n });\n}\nvar CODE_LOGIC_ERROR = 'CODE_LOGIC_ERROR';\nfunction validateRule(_x, _x2, _x3, _x4, _x5) {\n return _validateRule.apply(this, arguments);\n}\n/**\n * We use `async-validator` to validate the value.\n * But only check one value in a time to avoid namePath validate issue.\n */\nfunction _validateRule() {\n _validateRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(name, value, rule, options, messageVariables) {\n var cloneRule, originValidator, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n cloneRule = _objectSpread({}, rule); // Bug of `async-validator`\n // https://github.com/react-component/field-form/issues/316\n // https://github.com/react-component/field-form/issues/313\n delete cloneRule.ruleIndex;\n\n // https://github.com/ant-design/ant-design/issues/40497#issuecomment-1422282378\n AsyncValidator.warning = function () {\n return void 0;\n };\n if (cloneRule.validator) {\n originValidator = cloneRule.validator;\n cloneRule.validator = function () {\n try {\n return originValidator.apply(void 0, arguments);\n } catch (error) {\n console.error(error);\n return Promise.reject(CODE_LOGIC_ERROR);\n }\n };\n }\n\n // We should special handle array validate\n subRuleField = null;\n if (cloneRule && cloneRule.type === 'array' && cloneRule.defaultField) {\n subRuleField = cloneRule.defaultField;\n delete cloneRule.defaultField;\n }\n validator = new AsyncValidator(_defineProperty({}, name, [cloneRule]));\n messages = merge(defaultValidateMessages, options.validateMessages);\n validator.messages(messages);\n result = [];\n _context2.prev = 10;\n _context2.next = 13;\n return Promise.resolve(validator.validate(_defineProperty({}, name, value), _objectSpread({}, options)));\n case 13:\n _context2.next = 18;\n break;\n case 15:\n _context2.prev = 15;\n _context2.t0 = _context2[\"catch\"](10);\n if (_context2.t0.errors) {\n result = _context2.t0.errors.map(function (_ref4, index) {\n var message = _ref4.message;\n var mergedMessage = message === CODE_LOGIC_ERROR ? messages.default : message;\n return /*#__PURE__*/React.isValidElement(mergedMessage) ?\n /*#__PURE__*/\n // Wrap ReactNode with `key`\n React.cloneElement(mergedMessage, {\n key: \"error_\".concat(index)\n }) : mergedMessage;\n });\n }\n case 18:\n if (!(!result.length && subRuleField)) {\n _context2.next = 23;\n break;\n }\n _context2.next = 21;\n return Promise.all(value.map(function (subValue, i) {\n return validateRule(\"\".concat(name, \".\").concat(i), subValue, subRuleField, options, messageVariables);\n }));\n case 21:\n subResults = _context2.sent;\n return _context2.abrupt(\"return\", subResults.reduce(function (prev, errors) {\n return [].concat(_toConsumableArray(prev), _toConsumableArray(errors));\n }, []));\n case 23:\n // Replace message with variables\n kv = _objectSpread(_objectSpread({}, rule), {}, {\n name: name,\n enum: (rule.enum || []).join(', ')\n }, messageVariables);\n fillVariableResult = result.map(function (error) {\n if (typeof error === 'string') {\n return replaceMessage(error, kv);\n }\n return error;\n });\n return _context2.abrupt(\"return\", fillVariableResult);\n case 26:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[10, 15]]);\n }));\n return _validateRule.apply(this, arguments);\n}\nexport function validateRules(namePath, value, rules, options, validateFirst, messageVariables) {\n var name = namePath.join('.');\n\n // Fill rule with context\n var filledRules = rules.map(function (currentRule, ruleIndex) {\n var originValidatorFunc = currentRule.validator;\n var cloneRule = _objectSpread(_objectSpread({}, currentRule), {}, {\n ruleIndex: ruleIndex\n });\n\n // Replace validator if needed\n if (originValidatorFunc) {\n cloneRule.validator = function (rule, val, callback) {\n var hasPromise = false;\n\n // Wrap callback only accept when promise not provided\n var wrappedCallback = function wrappedCallback() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n // Wait a tick to make sure return type is a promise\n Promise.resolve().then(function () {\n warning(!hasPromise, 'Your validator function has already return a promise. `callback` will be ignored.');\n if (!hasPromise) {\n callback.apply(void 0, args);\n }\n });\n };\n\n // Get promise\n var promise = originValidatorFunc(rule, val, wrappedCallback);\n hasPromise = promise && typeof promise.then === 'function' && typeof promise.catch === 'function';\n\n /**\n * 1. Use promise as the first priority.\n * 2. If promise not exist, use callback with warning instead\n */\n warning(hasPromise, '`callback` is deprecated. Please return a promise instead.');\n if (hasPromise) {\n promise.then(function () {\n callback();\n }).catch(function (err) {\n callback(err || ' ');\n });\n }\n };\n }\n return cloneRule;\n }).sort(function (_ref, _ref2) {\n var w1 = _ref.warningOnly,\n i1 = _ref.ruleIndex;\n var w2 = _ref2.warningOnly,\n i2 = _ref2.ruleIndex;\n if (!!w1 === !!w2) {\n // Let keep origin order\n return i1 - i2;\n }\n if (w1) {\n return 1;\n }\n return -1;\n });\n\n // Do validate rules\n var summaryPromise;\n if (validateFirst === true) {\n // >>>>> Validate by serialization\n summaryPromise = new Promise( /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {\n var i, rule, errors;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n i = 0;\n case 1:\n if (!(i < filledRules.length)) {\n _context.next = 12;\n break;\n }\n rule = filledRules[i];\n _context.next = 5;\n return validateRule(name, value, rule, options, messageVariables);\n case 5:\n errors = _context.sent;\n if (!errors.length) {\n _context.next = 9;\n break;\n }\n reject([{\n errors: errors,\n rule: rule\n }]);\n return _context.abrupt(\"return\");\n case 9:\n i += 1;\n _context.next = 1;\n break;\n case 12:\n /* eslint-enable */\n\n resolve([]);\n case 13:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x6, _x7) {\n return _ref3.apply(this, arguments);\n };\n }());\n } else {\n // >>>>> Validate by parallel\n var rulePromises = filledRules.map(function (rule) {\n return validateRule(name, value, rule, options, messageVariables).then(function (errors) {\n return {\n errors: errors,\n rule: rule\n };\n });\n });\n summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then(function (errors) {\n // Always change to rejection for Field to catch\n return Promise.reject(errors);\n });\n }\n\n // Internal catch error to avoid console error log.\n summaryPromise.catch(function (e) {\n return e;\n });\n return summaryPromise;\n}\nfunction finishOnAllFailed(_x8) {\n return _finishOnAllFailed.apply(this, arguments);\n}\nfunction _finishOnAllFailed() {\n _finishOnAllFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(rulePromises) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", Promise.all(rulePromises).then(function (errorsList) {\n var _ref5;\n var errors = (_ref5 = []).concat.apply(_ref5, _toConsumableArray(errorsList));\n return errors;\n }));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _finishOnAllFailed.apply(this, arguments);\n}\nfunction finishOnFirstFailed(_x9) {\n return _finishOnFirstFailed.apply(this, arguments);\n}\nfunction _finishOnFirstFailed() {\n _finishOnFirstFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(rulePromises) {\n var count;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n count = 0;\n return _context4.abrupt(\"return\", new Promise(function (resolve) {\n rulePromises.forEach(function (promise) {\n promise.then(function (ruleError) {\n if (ruleError.errors.length) {\n resolve([ruleError]);\n }\n count += 1;\n if (count === rulePromises.length) {\n resolve([]);\n }\n });\n });\n }));\n case 2:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _finishOnFirstFailed.apply(this, arguments);\n}"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,mBAAmB,MAAM,+CAA+C;AAC/E,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,iBAAiB,MAAM,6CAA6C;AAC3E,OAAOC,iBAAiB,MAAM,+BAA+B;AAC7D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,uBAAuB,QAAQ,YAAY;AACpD,SAASC,KAAK,QAAQ,sBAAsB;;AAE5C;AACA,IAAIC,cAAc,GAAGL,iBAAiB;;AAEtC;AACA;AACA;AACA;AACA,SAASM,cAAcA,CAACC,QAAQ,EAAEC,EAAE,EAAE;EACpC,OAAOD,QAAQ,CAACE,OAAO,CAAC,YAAY,EAAE,UAAUC,GAAG,EAAE;IACnD,IAAIC,GAAG,GAAGD,GAAG,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,OAAOJ,EAAE,CAACG,GAAG,CAAC;EAChB,CAAC,CAAC;AACJ;AACA,IAAIE,gBAAgB,GAAG,kBAAkB;AACzC,SAASC,YAAYA,CAACC,EAAE,EAAEC,GAAG,EAAEC,GAAG,EAAEC,GAAG,EAAEC,GAAG,EAAE;EAC5C,OAAOC,aAAa,CAACC,KAAK,CAAC,IAAI,EAAEC,SAAS,CAAC;AAC7C;AACA;AACA;AACA;AACA;AACA,SAASF,aAAaA,CAAA,EAAG;EACvBA,aAAa,GAAGrB,iBAAiB,EAAE,aAAaF,mBAAmB,CAAC,CAAC,CAAC0B,IAAI,CAAC,SAASC,QAAQA,CAACC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAO,EAAEC,gBAAgB,EAAE;IACzI,IAAIC,SAAS,EAAEC,eAA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