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K,IAAI,KAAO,EACd,EAAW,GAAO,EAAI,eAAe,IAAQ,KAAK,OAAO,EAAI,IAAQ,IAAI,EAAM,EAAI,IAAM,QAAU,EAAI,GAGzG,OAAO,CACT,EAEA,EAAO,YAAc,SAAqB,GACxC,IAAI,EAAQ,KAEZ,OAAO,EAAK,QAAO,SAAU,EAAQ,GAEnC,OAAY,OAAR,GAA+B,iBAAR,GAAoB,EAAI,cAAgB,QAAW,MAAM,QAAQ,GAEjF,EAAM,OAAO,GACf,GAAG,OAAO,EAAQ,CAAC,IAAI,EAAM,GAAK,UAGpC,GAAG,OAAO,EAAQ,CAAC,IALjB,GAAG,OAAO,EAAQ,CAAC,EAAM,aAAa,IAMjD,GAAG,GACL,EAEA,EAAO,MAAQ,WACb,IAAI,EAAS,KAET,EAAc,KAAK,MACnB,EAAe,EAAY,GAC3B,EAAO,EAAa,GACpB,EAAW,EAAa,MAAM,GAC9B,EAAQ,EAAY,MAAM,GAE9B,IAAK,IAAS,IAAI,GAChB,MAAM,IAAI,MAAM,QAAU,EAAO,mBAGnC,IAAI,EAAe,KAAK,YAAY,GAChC,EAAU,IAAI,GAAM,MAAM,IAAK,GAenC,OAdA,EAAM,SAAQ,SAAU,GACtB,IAAI,EAEA,EAAK,EAAK,GACV,EAAO,EAAK,MAAM,GAEtB,IAAK,IAAO,EAAQ,GAClB,MAAM,IAAI,MAAM,UAAY,EAAK,mBAGnC,IAAI,EAAO,EAAO,YAAY,GAE9B,GAAW,EAAW,GAAS,GAAI,MAAM,EAAU,EACrD,IACO,CACT,EAEO,CACT,CAzEyB,GA2EzB,QAAiB,QAAI,MACrB,OAAO,QAAU,QAAQ","file":"/npm/yup-schema@1.0.0-alpha.2/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/yup-schema@1.0.0-alpha.2/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\n\nvar yup = _interopRequireWildcard(require(\"yup\"));\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nvar Rules = /*#__PURE__*/function () {\n  function Rules(rules) {\n    this.rules = [].concat(rules);\n  }\n\n  var _proto = Rules.prototype;\n\n  _proto.isRule = function isRule(arg) {\n    if (Array.isArray(arg) && Array.isArray(arg[0]) && yup[arg[0][0]]) {\n      return true;\n    }\n\n    return false;\n  };\n\n  _proto.handleObject = function handleObject(obj) {\n    var handledObj = {};\n\n    for (var key in obj) {\n      handledObj[key] = obj.hasOwnProperty(key) && this.isRule(obj[key]) ? new Rules(obj[key]).toYup() : obj[key];\n    }\n\n    return handledObj;\n  };\n\n  _proto.processArgs = function processArgs(args) {\n    var _this = this;\n\n    return args.reduce(function (result, arg) {\n      // test for arg !== null, because typeof null === \"object\", but null.constructor is Uncaught TypeError\n      if (arg !== null && typeof arg === 'object' && arg.constructor === Object && !Array.isArray(arg)) {\n        return [].concat(result, [_this.handleObject(arg)]);\n      } else if (_this.isRule(arg)) {\n        return [].concat(result, [new Rules(arg).toYup()]);\n      }\n\n      return [].concat(result, [arg]);\n    }, []);\n  };\n\n  _proto.toYup = function toYup() {\n    var _this2 = this;\n\n    var _this$rules = this.rules,\n        _this$rules$ = _this$rules[0],\n        type = _this$rules$[0],\n        typeArgs = _this$rules$.slice(1),\n        rules = _this$rules.slice(1);\n\n    if (!type || !yup[type]) {\n      throw new Error('Type ' + type + ' does not exist');\n    }\n\n    var ruleTypeArgs = this.processArgs(typeArgs);\n    var yupRule = yup[type].apply(yup, ruleTypeArgs);\n    rules.forEach(function (_ref) {\n      var _yupRule;\n\n      var fn = _ref[0],\n          rule = _ref.slice(1);\n\n      if (!fn || !yupRule[fn]) {\n        throw new Error('Method ' + fn + ' does not exist');\n      }\n\n      var args = _this2.processArgs(rule);\n\n      yupRule = (_yupRule = yupRule)[fn].apply(_yupRule, args);\n    });\n    return yupRule;\n  };\n\n  return Rules;\n}();\n\nexports[\"default\"] = Rules;\nmodule.exports = exports.default;"]}