{"version":3,"file":"vendor.json2typescript.35b7aed2085c367e.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,6BAA6B,mBAAO,CAAC,KAAwB;AAC7D,YAAY,mBAAO,CAAC,KAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,mFAAmF;AACxH,wDAAwD,4BAA4B;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;;;;;;;ACnKa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,WAAW;AACX;;;;;;;ACXa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C,qBAAqB,KAAK;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0DAA0D,4BAA4B,KAAK;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oDAAoD,yBAAyB,KAAK;AACnF;AACA;;;;;;;;ACnDa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,2BAA2B,mBAAO,CAAC,KAAsB;AACzD,6BAA6B,mBAAO,CAAC,KAAwB;AAC7D,YAAY,mBAAO,CAAC,KAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gBAAgB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B,oBAAoB,OAAO;AAC3B,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA,yCAAyC,gBAAgB;AACzD;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA,qDAAqD,gBAAgB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B,oBAAoB,OAAO;AAC3B,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA,kDAAkD,yBAAyB;AAC3E;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4JAA4J;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,4BAA4B,6BAA6B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mBAAmB;AACnB;;;;;;;;AC35Ba;AACb,6BAA6C,EAAE,aAAa,CAAC;AAC7D,qBAAqB,mBAAO,CAAC,KAAoC;AACjE,UAAmB;AACnB,2BAA2B,mBAAO,CAAC,KAA0C;AAC7E,yBAAyB;AACzB,yBAAqB;AACrB,gCAAgC,mBAAO,CAAC,IAA+C;AACvF,UAAkB;AAClB,UAAoB;AACpB,UAAqB;AACrB,YAAY,mBAAO,CAAC,KAA2B;AAC/C,UAAW;AACX;;;;;;;ACba;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,sBAAsB;AACtB","sources":["webpack://admin/./node_modules/json2typescript/src/json2typescript/json-convert-decorators.js","webpack://admin/./node_modules/json2typescript/src/json2typescript/any.js","webpack://admin/./node_modules/json2typescript/src/json2typescript/json-convert-enums.js","webpack://admin/./node_modules/json2typescript/src/json2typescript/json-convert.js","webpack://admin/./node_modules/json2typescript/index.js","webpack://admin/./node_modules/json2typescript/src/json2typescript/json-convert-options.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar json_convert_options_1 = require(\"./json-convert-options\");\nvar any_1 = require(\"./any\");\n/**\n * Decorator of a class that is a custom converter.\n *\n * @param target the class\n */\nfunction JsonConverter(target) {\n target[json_convert_options_1.Settings.MAPPER_PROPERTY] = \"\";\n}\nexports.JsonConverter = JsonConverter;\n/**\n * Decorator of a class that comes from a JSON object.\n *\n * @param target the class identifier or the class\n *\n * @returns\n *\n * @throws Error\n */\nfunction JsonObject(target) {\n // target is the constructor or the custom class name\n var classIdentifier = \"\";\n var decorator = function (target) {\n target.prototype[json_convert_options_1.Settings.CLASS_IDENTIFIER] = classIdentifier.length > 0 ? classIdentifier : target.name;\n var mapping = target.prototype[json_convert_options_1.Settings.MAPPING_PROPERTY];\n // Make sure we replace the mapping names of all properties of this class\n if (!mapping)\n return;\n var unmappedKeys = Object.keys(mapping)\n .filter(function (val) { return val.indexOf(json_convert_options_1.Settings.CLASS_IDENTIFIER + \".\") === 0; });\n for (var _i = 0, unmappedKeys_1 = unmappedKeys; _i < unmappedKeys_1.length; _i++) {\n var key = unmappedKeys_1[_i];\n mapping[key.replace(json_convert_options_1.Settings.CLASS_IDENTIFIER, target.prototype[json_convert_options_1.Settings.CLASS_IDENTIFIER])] =\n mapping[key];\n // We must delete the mapping without associated class since it will\n // cause issues with inheritance of mappings and overrides.\n delete mapping[key];\n }\n };\n var type = typeof target;\n switch (type) {\n // Decorator was @JsonObject(classId)\n case \"string\":\n classIdentifier = target;\n return decorator;\n // Decorator was @JsonObject\n // Decorator was @JsonObject()\n // Decorator was @JsonObject(123)\n case \"function\":\n case \"undefined\":\n default:\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"It is mandatory to pass a string as parameter in the @JsonObject decorator.\\n\\n\" +\n \"Use @JsonObject(classId) where classId is a string.\\n\\n\");\n }\n}\nexports.JsonObject = JsonObject;\n/**\n * Decorator of a class property that comes from a JSON object.\n *\n * The second param can be either a type or a class of a custom converter.\n *\n * Use the following notation for the type:\n * - Primitive type: String|Number|Boolean\n * - Custom type: YourClassName\n * - Array type: [String|Number|Boolean|YourClassName]\n *\n * If you decide to use a custom converter, make sure this class implements the interface JsonCustomConvert from this package.\n *\n * @param jsonPropertyName optional param (default: classPropertyName) the property name in the expected JSON object\n * @param conversionOption optional param (default: Any), should be either the expected type (String|Boolean|Number|etc) or a custom converter class implementing JsonCustomConvert\n * @param isOptional optional param (default: false), if true, the json property does not have to be present in the object\n *\n * @returns\n *\n * @throws Error\n */\nfunction JsonProperty() {\n var params = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n params[_i] = arguments[_i];\n }\n return function (target, classPropertyName) {\n // target is the class\n var jsonPropertyName = classPropertyName;\n var conversionOption = any_1.Any;\n var isOptional = false;\n switch (params.length) {\n case 1:\n if (params[0] === undefined)\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"It is not allowed to explicitly pass \\\"undefined\\\" as first parameter in the @JsonProperty decorator.\\n\\n\" +\n \"\\tClass property: \\n\" +\n \"\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"Leave the decorator parameters empty if you do not wish to pass the first parameter.\\n\\n\");\n jsonPropertyName = params[0];\n break;\n case 2:\n if (params[0] === undefined)\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"It is not allowed to explicitly pass \\\"undefined\\\" as first parameter in the @JsonProperty decorator.\\n\\n\" +\n \"\\tClass property: \\n\" +\n \"\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"Leave the decorator parameters empty if you do not wish to pass the first parameter.\\n\\n\");\n if (params[1] === undefined)\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"It is not allowed to explicitly pass \\\"undefined\\\" as second parameter in the @JsonProperty decorator.\\n\\n\" +\n \"\\tClass property: \\n\" +\n \"\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"Use \\\"Any\\\" to allow any type. You can import this class from \\\"json2typescript\\\".\\n\\n\");\n jsonPropertyName = params[0];\n conversionOption = params[1];\n break;\n case 3:\n if (params[0] === undefined)\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"It is not allowed to explicitly pass \\\"undefined\\\" as first parameter in the @JsonProperty decorator.\\n\\n\" +\n \"\\tClass property: \\n\" +\n \"\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"Leave the decorator parameters empty if you do not wish to pass the first parameter.\\n\\n\");\n if (params[1] === undefined)\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"It is not allowed to explicitly pass \\\"undefined\\\" as second parameter in the @JsonProperty decorator.\\n\\n\" +\n \"\\tClass property: \\n\" +\n \"\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"Use \\\"Any\\\" to allow any type. You can import this class from \\\"json2typescript\\\".\\n\\n\");\n jsonPropertyName = params[0];\n conversionOption = params[1];\n isOptional = params[2];\n break;\n default:\n break;\n }\n if (typeof (target[json_convert_options_1.Settings.MAPPING_PROPERTY]) === \"undefined\") {\n target[json_convert_options_1.Settings.MAPPING_PROPERTY] = [];\n }\n var jsonPropertyMappingOptions = new json_convert_options_1.MappingOptions();\n jsonPropertyMappingOptions.classPropertyName = classPropertyName;\n jsonPropertyMappingOptions.jsonPropertyName = jsonPropertyName;\n jsonPropertyMappingOptions.isOptional = isOptional ? isOptional : false;\n // Check if conversionOption is a type or a custom converter.\n if (typeof (conversionOption) !== \"undefined\" && conversionOption !== null && typeof (conversionOption[json_convert_options_1.Settings.MAPPER_PROPERTY]) !== \"undefined\") {\n jsonPropertyMappingOptions.customConverter = new conversionOption();\n }\n else {\n jsonPropertyMappingOptions.expectedJsonType = conversionOption;\n }\n // Save the mapping info\n if (typeof (target[json_convert_options_1.Settings.MAPPING_PROPERTY][json_convert_options_1.Settings.CLASS_IDENTIFIER + \".\" + classPropertyName]) === \"undefined\") {\n target[json_convert_options_1.Settings.MAPPING_PROPERTY][json_convert_options_1.Settings.CLASS_IDENTIFIER + \".\" + classPropertyName] = jsonPropertyMappingOptions;\n }\n else {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"It is not allowed to add multiple decorators for the same property.\\n\\n\" +\n \"\\tClass property: \\n\" +\n \"\\t\\t\" + classPropertyName + \"\\n\\n\");\n }\n };\n}\nexports.JsonProperty = JsonProperty;\n//# sourceMappingURL=json-convert-decorators.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Virtual any type for the property decorator.\n */\nvar Any = /** @class */ (function () {\n function Any() {\n }\n return Any;\n}());\nexports.Any = Any;\n//# sourceMappingURL=any.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Enum for the operation mode of a JsonConvert instance.\n *\n * The values should be used as follows:\n * - DISABLE: json2typescript will be disabled, no type checking or mapping is done\n * - ENABLE: json2typescript is enabled, but only errors are logged\n * - LOGGING: json2typescript is enabled and detailed information is logged\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\nvar OperationMode;\n(function (OperationMode) {\n OperationMode[OperationMode[\"DISABLE\"] = 0] = \"DISABLE\";\n OperationMode[OperationMode[\"ENABLE\"] = 1] = \"ENABLE\";\n OperationMode[OperationMode[\"LOGGING\"] = 2] = \"LOGGING\";\n})(OperationMode = exports.OperationMode || (exports.OperationMode = {}));\n;\n/**\n * Enum for the property matching mode of a JsonConvert instance.\n *\n * The values should be used as follows:\n * - CASE_STRICT: JSON properties need to match exactly the names in the decorators\n * - CASE_INSENSITIVE: JSON properties need to match names in the decorators, but names they are not case sensitive\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\nvar PropertyMatchingRule;\n(function (PropertyMatchingRule) {\n PropertyMatchingRule[PropertyMatchingRule[\"CASE_STRICT\"] = 1] = \"CASE_STRICT\";\n PropertyMatchingRule[PropertyMatchingRule[\"CASE_INSENSITIVE\"] = 2] = \"CASE_INSENSITIVE\";\n})(PropertyMatchingRule = exports.PropertyMatchingRule || (exports.PropertyMatchingRule = {}));\n;\n/**\n * Enum for the value checking mode of a JsonConvert instance.\n *\n * The values should be used as follows:\n * - ALLOW_NULL: all given values in the JSON are allowed to be null\n * - ALLOW_OBJECT_NULL: objects in the JSON are allowed to be null, primitive types are not allowed to be null\n * - DISALLOW_NULL: no null values are tolerated in the JSON\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\nvar ValueCheckingMode;\n(function (ValueCheckingMode) {\n ValueCheckingMode[ValueCheckingMode[\"ALLOW_NULL\"] = 1] = \"ALLOW_NULL\";\n ValueCheckingMode[ValueCheckingMode[\"ALLOW_OBJECT_NULL\"] = 2] = \"ALLOW_OBJECT_NULL\";\n ValueCheckingMode[ValueCheckingMode[\"DISALLOW_NULL\"] = 3] = \"DISALLOW_NULL\";\n})(ValueCheckingMode = exports.ValueCheckingMode || (exports.ValueCheckingMode = {}));\n;\n//# sourceMappingURL=json-convert-enums.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar json_convert_enums_1 = require(\"./json-convert-enums\");\nvar json_convert_options_1 = require(\"./json-convert-options\");\nvar any_1 = require(\"./any\");\n/**\n * Offers a simple API for mapping JSON objects to TypeScript/JavaScript classes and vice versa.\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation on NPM\n */\nvar JsonConvert = /** @class */ (function () {\n /////////////////\n // CONSTRUCTOR //\n /////////////////\n /**\n * Constructor.\n *\n * To learn more about the params, check the documentation of the equally named class properties.\n *\n * @param operationMode optional param (default: OperationMode.ENABLE)\n * @param valueCheckingMode optional param (default: ValueCheckingMode.ALLOW_OBJECT_NULL)\n * @param ignorePrimitiveChecks optional param (default: false)\n * @param propertyMatchingRule optional param (default: PropertyMatchingRule.CASE_STRICT)\n */\n function JsonConvert(operationMode, valueCheckingMode, ignorePrimitiveChecks, propertyMatchingRule) {\n ////////////////\n // PROPERTIES //\n ////////////////\n /**\n * Determines how the JsonConvert class instance should operate.\n *\n * You may assign three different values:\n * - OperationMode.DISABLE: json2typescript will be disabled, no type checking or mapping is done\n * - OperationMode.ENABLE: json2typescript is enabled, but only errors are logged\n * - OperationMode.LOGGING: json2typescript is enabled and detailed information is logged\n */\n this._operationMode = json_convert_enums_1.OperationMode.ENABLE;\n /**\n * Determines which types are allowed to be null.\n *\n * You may assign three different values:\n * - ValueCheckingMode.ALLOW_NULL: all given values in the JSON are allowed to be null\n * - ValueCheckingMode.ALLOW_OBJECT_NULL: objects in the JSON are allowed to be null, primitive types are not allowed to be null\n * - ValueCheckingMode.DISALLOW_NULL: no null values are tolerated in the JSON\n */\n this._valueCheckingMode = json_convert_enums_1.ValueCheckingMode.ALLOW_OBJECT_NULL;\n /**\n * Determines whether primitive types should be checked.\n * If true, it will be allowed to assign primitive to other primitive types.\n */\n this._ignorePrimitiveChecks = false;\n /**\n * Determines the rule of how JSON properties shall be matched with class properties during deserialization.\n *\n * You may assign the following values:\n * - PropertyMatchingRule.CASE_STRICT: JSON properties need to match exactly the names in the decorators\n * - PropertyMatchingRule.CASE_INSENSITIVE: JSON properties need to match names in the decorators, but names they are not case sensitive\n */\n this._propertyMatchingRule = json_convert_enums_1.PropertyMatchingRule.CASE_STRICT;\n /**\n * Determines whether the check for \"required\" properties should be ignored, making all\n * mapped values optional, whether or not the isOptional property mapping parameter is set.\n * If true, any missing properties when serializing or deserializing will be ignored, as if they\n * were marked optional.\n */\n this._ignoreRequiredCheck = false;\n if (operationMode !== undefined && operationMode in json_convert_enums_1.OperationMode)\n this.operationMode = operationMode;\n if (valueCheckingMode !== undefined && valueCheckingMode in json_convert_enums_1.ValueCheckingMode)\n this.valueCheckingMode = valueCheckingMode;\n if (ignorePrimitiveChecks !== undefined)\n this.ignorePrimitiveChecks = ignorePrimitiveChecks;\n if (propertyMatchingRule !== undefined)\n this.propertyMatchingRule = propertyMatchingRule;\n }\n Object.defineProperty(JsonConvert.prototype, \"operationMode\", {\n /**\n * Determines how the JsonConvert class instance should operate.\n *\n * You may assign three different values:\n * - OperationMode.DISABLE: json2typescript will be disabled, no type checking or mapping is done\n * - OperationMode.ENABLE: json2typescript is enabled, but only errors are logged\n * - OperationMode.LOGGING: json2typescript is enabled and detailed information is logged\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n get: function () {\n return this._operationMode;\n },\n /**\n * Determines how the JsonConvert class instance should operate.\n *\n * You may assign three different values:\n * - OperationMode.DISABLE: json2typescript will be disabled, no type checking or mapping is done\n * - OperationMode.ENABLE: json2typescript is enabled, but only errors are logged\n * - OperationMode.LOGGING: json2typescript is enabled and detailed information is logged\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n set: function (value) {\n if (value in json_convert_enums_1.OperationMode)\n this._operationMode = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(JsonConvert.prototype, \"valueCheckingMode\", {\n /**\n * Determines which types are allowed to be null.\n *\n * You may assign three different values:\n * - ValueCheckingMode.ALLOW_NULL: all given values in the JSON are allowed to be null\n * - ValueCheckingMode.ALLOW_OBJECT_NULL: objects in the JSON are allowed to be null, primitive types are not allowed to be null\n * - ValueCheckingMode.DISALLOW_NULL: no null values are tolerated in the JSON\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n get: function () {\n return this._valueCheckingMode;\n },\n /**\n * Determines which types are allowed to be null.\n *\n * You may assign three different values:\n * - ValueCheckingMode.ALLOW_NULL: all given values in the JSON are allowed to be null\n * - ValueCheckingMode.ALLOW_OBJECT_NULL: objects in the JSON are allowed to be null, primitive types are not allowed to be null\n * - ValueCheckingMode.DISALLOW_NULL: no null values are tolerated in the JSON\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n set: function (value) {\n if (value in json_convert_enums_1.ValueCheckingMode)\n this._valueCheckingMode = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(JsonConvert.prototype, \"ignorePrimitiveChecks\", {\n /**\n * Determines whether primitive types should be checked.\n * If true, it will be allowed to assign primitive to other primitive types.\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n get: function () {\n return this._ignorePrimitiveChecks;\n },\n /**\n * Determines whether primitive types should be checked.\n * If true, it will be allowed to assign primitive to other primitive types.\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n set: function (value) {\n this._ignorePrimitiveChecks = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(JsonConvert.prototype, \"propertyMatchingRule\", {\n /**\n * Determines the rule of how JSON properties shall be matched with class properties during deserialization.\n *\n * You may assign the following values:\n * - PropertyMatchingRule.CASE_STRICT: JSON properties need to match exactly the names in the decorators\n * - PropertyMatchingRule.CASE_INSENSITIVE: JSON properties need to match names in the decorators, but names they are not case sensitive\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n get: function () {\n return this._propertyMatchingRule;\n },\n /**\n * Determines the rule of how JSON properties shall be matched with class properties during deserialization.\n *\n * You may assign the following values:\n * - PropertyMatchingRule.CASE_STRICT: JSON properties need to match exactly the names in the decorators\n * - PropertyMatchingRule.CASE_INSENSITIVE: JSON properties need to match names in the decorators, but names they are not case sensitive\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n set: function (value) {\n if (value in json_convert_enums_1.PropertyMatchingRule)\n this._propertyMatchingRule = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(JsonConvert.prototype, \"ignoreRequiredCheck\", {\n /**\n * Determines whether the check for \"required\" properties should be ignored, making all\n * mapped values optional, whether or not the isOptional property mapping parameter is set.\n * If true, any missing properties (undefined) when serializing or deserializing will be\n * ignored, as if they were marked optional.\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n get: function () {\n return this._ignoreRequiredCheck;\n },\n /**\n * Determines whether the check for \"required\" properties should be ignored, making all\n * mapped values optional, whether or not the isOptional property mapping parameter is set.\n * If true, any missing properties (undefined) when serializing or deserializing will be\n * ignored, as if they were marked optional.\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n set: function (value) {\n this._ignoreRequiredCheck = value;\n },\n enumerable: true,\n configurable: true\n });\n ////////////////////\n // PUBLIC METHODS //\n ////////////////////\n /**\n * Tries to serialize a TypeScript object or array of objects to JSON using the mappings defined on\n * the specified class reference. Note that if a class reference is provided, it will be used as\n * the source of property mapping for serialization, even if the object or one of its elements is\n * an instance of a different class with its own mappings. Also, ONLY the properties from the\n * class reference will be serialized - any additional properties on the object(s) will be silently\n * ignored.\n *\n * @param data object or array of objects\n * @param classReference the class reference which provides the property mappings to use\n *\n * @returns the JSON object\n *\n * @throws an Error in case of failure\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n JsonConvert.prototype.serialize = function (data, classReference) {\n if (this.operationMode === json_convert_enums_1.OperationMode.DISABLE) {\n return data;\n }\n // Call the appropriate method depending on the type\n if (data instanceof Array) {\n return this.serializeArray(data, classReference);\n }\n else if (typeof data === \"object\") { // careful: an array is an object in TypeScript!\n return this.serializeObject(data, classReference);\n }\n else {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter data in JsonConvert.serialize() is not in valid format (object or array).\" +\n \"\\n\");\n }\n };\n /**\n * Tries to serialize a TypeScript object to a JSON object using either the mappings on the\n * provided class reference, if present, or on the provided object. Note that if a class\n * reference is provided, it will be used as the source of property mapping for serialization,\n * even if the object is itself an instance of a different class with its own mappings.\n * Also, ONLY the properties from the class reference will be serialized - any additional\n * properties on the object will be silently ignored.\n *\n * @param data object containing the values to be mapped to a JSON object, must be an\n * instance of a class with JSON mappings if no class reference is provided\n * @param classReference optional class reference which provides the property mappings to use\n *\n * @returns the JSON object\n *\n * @throws an Error in case of failure\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n JsonConvert.prototype.serializeObject = function (data, classReference) {\n if (this.operationMode === json_convert_enums_1.OperationMode.DISABLE) {\n return data;\n }\n // Check if the passed type is allowed\n if (data === undefined) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter instance in JsonConvert.serializeObject() is undefined. This is not a valid JSON format.\" +\n \"\\n\");\n }\n else if (data === null) {\n if (this.valueCheckingMode === json_convert_enums_1.ValueCheckingMode.DISALLOW_NULL) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter instance in JsonConvert.serializeObject() is undefined. You have specified to disallow null values.\" +\n \"\\n\");\n }\n else {\n return data;\n }\n }\n else if (typeof (data) !== \"object\" || data instanceof Array) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter instance in JsonConvert.serializeObject() is not of type object.\" +\n \"\\n\");\n }\n // Now serialize and return the plain object\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"----------\");\n console.log(\"Receiving JavaScript instance:\");\n console.log(data);\n }\n var jsonObject = {};\n var instance;\n if (!!classReference) {\n instance = new classReference();\n }\n else {\n instance = data;\n }\n // Loop through all initialized class properties on the mapping instance\n for (var _i = 0, _a = Object.keys(instance); _i < _a.length; _i++) {\n var propertyKey = _a[_i];\n try {\n this.serializeObject_loopProperty(data, instance, propertyKey, jsonObject);\n }\n catch (ex) {\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"Failed to serialize property:\");\n console.log(ex);\n console.log(\"----------\");\n }\n throw ex;\n }\n }\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"Returning JSON object:\");\n console.log(jsonObject);\n console.log(\"----------\");\n }\n return jsonObject;\n };\n /**\n * Tries to serialize a TypeScript array to a JSON array using either the mappings on the\n * provided class reference, if present, or on the provided object. Note that if a class\n * reference is provided, ALL objects in the array will be serialized using the mappings\n * from that class reference, even if they're actually instances of a different class.\n * Also, ONLY the properties from the class reference will be serialized - any additional\n * properties on the objects will be silently ignored.\n *\n * @param dataArray array of objects containing the values to be mapped to a JSON object, which\n * must be instances of classes with JSON mappings if no class reference is provided\n * @param classReference optional class reference which provides the property mappings to use\n *\n * @returns the JSON array\n *\n * @throws an Error in case of failure\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n JsonConvert.prototype.serializeArray = function (dataArray, classReference) {\n if (this.operationMode === json_convert_enums_1.OperationMode.DISABLE) {\n return dataArray;\n }\n // Check if the passed type is allowed\n if (dataArray === undefined) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter instanceArray in JsonConvert.serializeArray() is undefined. This is not a valid JSON format.\" +\n \"\\n\");\n }\n else if (dataArray === null) {\n if (this.valueCheckingMode === json_convert_enums_1.ValueCheckingMode.DISALLOW_NULL) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter instanceArray in JsonConvert.serializeArray() is undefined. You have specified to disallow null values.\" +\n \"\\n\");\n }\n else {\n return dataArray;\n }\n }\n else if (typeof (dataArray) !== \"object\" || dataArray instanceof Array === false) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter instanceArray in JsonConvert.serializeArray() is not of type array.\" +\n \"\\n\");\n }\n // Now serialize and return the plain object\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"----------\");\n console.log(\"Receiving JavaScript array:\");\n console.log(dataArray);\n }\n var jsonArray = [];\n // Loop through all array elements\n for (var _i = 0, _a = dataArray; _i < _a.length; _i++) {\n var dataObject = _a[_i];\n jsonArray.push(this.serializeObject(dataObject, classReference));\n }\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"Returning JSON array:\");\n console.log(jsonArray);\n console.log(\"----------\");\n }\n return jsonArray;\n };\n /**\n * Tries to deserialize given JSON to a TypeScript object or array of objects.\n *\n * @param json the JSON as object or array\n * @param classReference the class reference\n *\n * @returns the deserialized data (TypeScript instance or array of TypeScript instances)\n *\n * @throws an Error in case of failure\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n JsonConvert.prototype.deserialize = function (json, classReference) {\n if (this.operationMode === json_convert_enums_1.OperationMode.DISABLE) {\n return json;\n }\n // Call the appropriate method depending on the type\n if (json instanceof Array) {\n return this.deserializeArray(json, classReference);\n }\n else if (typeof json === \"object\") { // careful: an array is an object in TypeScript!\n return this.deserializeObject(json, classReference);\n }\n else {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter json in JsonConvert.deserialize() is not in valid JSON format (object or array).\" +\n \"\\n\");\n }\n };\n /**\n * Tries to deserialize a JSON object to a TypeScript object.\n *\n * @param jsonObject the JSON object\n * @param classReference the class reference\n *\n * @returns the deserialized TypeScript instance\n *\n * @throws an Error in case of failure\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n JsonConvert.prototype.deserializeObject = function (jsonObject, classReference) {\n if (this.operationMode === json_convert_enums_1.OperationMode.DISABLE) {\n return jsonObject;\n }\n // Check if the passed type is allowed\n if (jsonObject === undefined) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter jsonObject in JsonConvert.deserializeObject() is undefined. This is not a valid JSON format.\" +\n \"\\n\");\n }\n else if (jsonObject === null) {\n if (this.valueCheckingMode === json_convert_enums_1.ValueCheckingMode.DISALLOW_NULL) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter jsonObject in JsonConvert.deserializeObject() is undefined. You have specified to disallow null values.\" +\n \"\\n\");\n }\n else {\n return jsonObject;\n }\n }\n else if (typeof (jsonObject) !== \"object\" || jsonObject instanceof Array) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter jsonObject in JsonConvert.deserializeObject() is not of type object.\" +\n \"\\n\");\n }\n // Now deserialize and return the instance\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"----------\");\n console.log(\"Receiving JSON object:\");\n console.log(jsonObject);\n }\n var instance = new classReference();\n // Loop through all initialized class properties\n for (var _i = 0, _a = Object.keys(instance); _i < _a.length; _i++) {\n var propertyKey = _a[_i];\n try {\n this.deserializeObject_loopProperty(instance, propertyKey, jsonObject);\n }\n catch (ex) {\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"Failed to deserialize property:\");\n console.log(ex);\n console.log(\"----------\");\n }\n throw ex;\n }\n }\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"Returning CLASS instance:\");\n console.log(instance);\n console.log(\"----------\");\n }\n return instance;\n };\n /**\n * Tries to deserialize a JSON array to a TypeScript array.\n *\n * @param jsonArray the JSON array\n * @param classReference the object class\n *\n * @returns the deserialized array of TypeScript instances\n *\n * @throws an Error in case of failure\n *\n * @see https://www.npmjs.com/package/json2typescript full documentation\n */\n JsonConvert.prototype.deserializeArray = function (jsonArray, classReference) {\n if (this.operationMode === json_convert_enums_1.OperationMode.DISABLE) {\n return jsonArray;\n }\n // Check if the passed type is allowed\n if (jsonArray === undefined) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter jsonArray in JsonConvert.deserializeObject() is undefined. This is not a valid JSON format.\" +\n \"\\n\");\n }\n else if (jsonArray === null) {\n if (this.valueCheckingMode === json_convert_enums_1.ValueCheckingMode.DISALLOW_NULL) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter jsonArray in JsonConvert.deserializeObject() is undefined. You have specified to disallow null values.\" +\n \"\\n\");\n }\n else {\n return jsonArray;\n }\n }\n else if (typeof (jsonArray) !== \"object\" || jsonArray instanceof Array === false) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Passed parameter jsonArray in JsonConvert.deserializeArray() is not of type array.\" +\n \"\\n\");\n }\n // Now deserialize and return the array\n if (this.operationMode === json_convert_enums_1.OperationMode.DISABLE) {\n return jsonArray;\n }\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"----------\");\n console.log(\"Receiving JSON array:\");\n console.log(jsonArray);\n }\n var array = [];\n // Loop through all array elements\n for (var _i = 0, jsonArray_1 = jsonArray; _i < jsonArray_1.length; _i++) {\n var jsonObject = jsonArray_1[_i];\n array.push(this.deserializeObject(jsonObject, classReference));\n }\n if (this.operationMode === json_convert_enums_1.OperationMode.LOGGING) {\n console.log(\"Returning array of CLASS instances:\");\n console.log(array);\n console.log(\"----------\");\n }\n return array;\n };\n /////////////////////\n // PRIVATE METHODS //\n /////////////////////\n /**\n * Tries to find the JSON mapping for a given class property from the given instance used for mapping,\n * and finally assign the value from the given dataObject\n *\n * @param dataObject the object containing the value to be assigned\n * @param instance the instance of the class used for mapping\n * @param classPropertyName the property name\n * @param json the JSON object\n * @throws throws an Error in case of failure\n */\n JsonConvert.prototype.serializeObject_loopProperty = function (dataObject, instance, classPropertyName, json) {\n // Check if a JSON-object mapping is possible for a property\n var mappingOptions = this.getClassPropertyMappingOptions(instance, classPropertyName);\n if (mappingOptions === null) {\n return;\n }\n // Get expected and real values\n var jsonPropertyName = mappingOptions.jsonPropertyName;\n var expectedJsonType = mappingOptions.expectedJsonType;\n var isOptional = mappingOptions.isOptional;\n var customConverter = mappingOptions.customConverter;\n var classInstancePropertyValue = dataObject[classPropertyName];\n // Check if the class property value exists\n if (typeof (classInstancePropertyValue) === \"undefined\") {\n if (isOptional || this._ignoreRequiredCheck)\n return;\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Failed to map the JavaScript instance of class \\\"\" + instance[json_convert_options_1.Settings.CLASS_IDENTIFIER] + \"\\\" to JSON because the defined class property \\\"\" + classPropertyName + \"\\\" does not exist or is not defined:\\n\\n\" +\n \"\\tClass property: \\n\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"\\tJSON property: \\n\\t\\t\" + jsonPropertyName + \"\\n\\n\");\n }\n // Check if the property is optional\n // If the json value is null, we don't assign it in that case\n if (isOptional && classInstancePropertyValue === null)\n return;\n // Map the property\n try {\n json[jsonPropertyName] = customConverter !== null ? customConverter.serialize(classInstancePropertyValue) : this.verifyProperty(expectedJsonType, classInstancePropertyValue, true);\n }\n catch (e) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Failed to map the JavaScript instance of class \\\"\" + instance[json_convert_options_1.Settings.CLASS_IDENTIFIER] + \"\\\" to JSON because of a type error.\\n\\n\" +\n \"\\tClass property: \\n\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"\\tClass property value: \\n\\t\\t\" + classInstancePropertyValue + \"\\n\\n\" +\n \"\\tExpected type: \\n\\t\\t\" + this.getExpectedType(expectedJsonType) + \"\\n\\n\" +\n \"\\tRuntime type: \\n\\t\\t\" + this.getTrueType(classInstancePropertyValue) + \"\\n\\n\" +\n \"\\tJSON property: \\n\\t\\t\" + jsonPropertyName + \"\\n\\n\" +\n e.message + \"\\n\");\n }\n };\n /**\n * Tries to find the JSON mapping for a given class property and finally assign the value.\n *\n * @param instance the instance of the class\n * @param classPropertyName the property name\n * @param json the JSON object\n *\n * @throws throws an Error in case of failure\n */\n JsonConvert.prototype.deserializeObject_loopProperty = function (instance, classPropertyName, json) {\n var mappingOptions = this.getClassPropertyMappingOptions(instance, classPropertyName);\n if (mappingOptions === null) {\n return;\n }\n // Get expected and real values\n var jsonPropertyName = mappingOptions.jsonPropertyName;\n var expectedJsonType = mappingOptions.expectedJsonType;\n var isOptional = mappingOptions.isOptional;\n var customConverter = mappingOptions.customConverter;\n var jsonValue = undefined;\n try {\n jsonValue = this.getObjectValue(json, jsonPropertyName);\n }\n catch (_a) {\n }\n // Check if the json value exists\n if (typeof (jsonValue) === \"undefined\") {\n if (isOptional || this._ignoreRequiredCheck)\n return;\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Failed to map the JSON object to the class \\\"\" + instance[json_convert_options_1.Settings.CLASS_IDENTIFIER] + \"\\\" because the defined JSON property \\\"\" + jsonPropertyName + \"\\\" does not exist:\\n\\n\" +\n \"\\tClass property: \\n\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"\\tJSON property: \\n\\t\\t\" + jsonPropertyName + \"\\n\\n\");\n }\n // Check if the property is optional\n // If the json value is null, we don't assign it in that case\n if (isOptional && jsonValue === null)\n return;\n // Map the property\n try {\n instance[classPropertyName] = customConverter !== null ? customConverter.deserialize(jsonValue) : this.verifyProperty(expectedJsonType, jsonValue);\n }\n catch (e) {\n throw new Error(\"Fatal error in JsonConvert. \" +\n \"Failed to map the JSON object to the class \\\"\" + instance[json_convert_options_1.Settings.CLASS_IDENTIFIER] + \"\\\" because of a type error.\\n\\n\" +\n \"\\tClass property: \\n\\t\\t\" + classPropertyName + \"\\n\\n\" +\n \"\\tExpected type: \\n\\t\\t\" + this.getExpectedType(expectedJsonType) + \"\\n\\n\" +\n \"\\tJSON property: \\n\\t\\t\" + jsonPropertyName + \"\\n\\n\" +\n \"\\tJSON type: \\n\\t\\t\" + this.getJsonType(jsonValue) + \"\\n\\n\" +\n \"\\tJSON value: \\n\\t\\t\" + JSON.stringify(jsonValue) + \"\\n\\n\" +\n e.message + \"\\n\");\n }\n };\n ////////////////////\n // HELPER METHODS //\n ////////////////////\n /**\n * Gets the mapping options of a given class property.\n *\n * @param instance any class instance\n * @param {string} propertyName any property name\n *\n * @returns {MappingOptions|null}\n */\n JsonConvert.prototype.getClassPropertyMappingOptions = function (instance, propertyName) {\n var mappings = instance[json_convert_options_1.Settings.MAPPING_PROPERTY];\n // Check if mapping is defined\n if (typeof (mappings) === \"undefined\")\n return null;\n /* Find mapping by iterating up the prototype chain to find a matching mapping, rather than\n * just searching by property name. */\n var prototype = Object.getPrototypeOf(instance);\n /* According to documentation, we'll hit null when we've iterated all the way up to the base\n * Object, but check for undefined as well in case prototype has been manually set to\n * undefined. Note that javascript detects circular prototype references and will cause a\n * TypeError, so no need to check for self, the prototype chain will eventually terminate. */\n while (prototype !== null && prototype !== undefined) {\n var classIdentifier = prototype[json_convert_options_1.Settings.CLASS_IDENTIFIER];\n if (!!classIdentifier) {\n var mappingName = classIdentifier + \".\" + propertyName;\n if (typeof (mappings[mappingName]) !== \"undefined\") {\n return mappings[mappingName];\n }\n }\n prototype = Object.getPrototypeOf(prototype);\n }\n return null;\n };\n /**\n * Compares the type of a given value with an internal expected json type.\n * Either returns the resulting value or throws an exception.\n *\n * @param expectedJsonType the expected json type for the property\n * @param value the property value to verify\n * @param serialize optional param (default: false), if given, we are in serialization mode\n *\n * @returns returns the resulted mapped property\n *\n * @throws an error in case of failure\n */\n JsonConvert.prototype.verifyProperty = function (expectedJsonType, value, serialize) {\n // Map immediately if we don't care about the type\n if (expectedJsonType === any_1.Any || expectedJsonType === null || expectedJsonType === Object) {\n return value;\n }\n // Check if attempt and expected was 1-d\n if (expectedJsonType instanceof Array === false && value instanceof Array === false) {\n // Check the type\n if (typeof (expectedJsonType) !== \"undefined\" && expectedJsonType.prototype.hasOwnProperty(json_convert_options_1.Settings.CLASS_IDENTIFIER)) { // only decorated custom objects have this injected property\n // Check if we have null value\n if (value === null) {\n if (this.valueCheckingMode !== json_convert_enums_1.ValueCheckingMode.DISALLOW_NULL)\n return null;\n else\n throw new Error(\"\\tReason: Given value is null.\");\n }\n if (serialize)\n return this.serializeObject(value, expectedJsonType);\n else\n return this.deserializeObject(value, expectedJsonType);\n }\n else if (expectedJsonType === any_1.Any || expectedJsonType === null || expectedJsonType === Object) { // general object\n // Check if we have null value\n if (value === null) {\n if (this.valueCheckingMode !== json_convert_enums_1.ValueCheckingMode.DISALLOW_NULL)\n return null;\n else\n throw new Error(\"\\tReason: Given value is null.\");\n }\n return value;\n }\n else if (expectedJsonType === String || expectedJsonType === Number || expectedJsonType === Boolean) { // otherwise check for a primitive type\n // Check if we have null value\n if (value === null) {\n if (this.valueCheckingMode === json_convert_enums_1.ValueCheckingMode.ALLOW_NULL)\n return null;\n else\n throw new Error(\"\\tReason: Given value is null.\");\n }\n // Check if the types match\n if ( // primitive types match\n (expectedJsonType === String && typeof (value) === \"string\") ||\n (expectedJsonType === Number && typeof (value) === \"number\") ||\n (expectedJsonType === Boolean && typeof (value) === \"boolean\")) {\n return value;\n }\n else { // primitive types mismatch\n if (this.ignorePrimitiveChecks)\n return value;\n throw new Error(\"\\tReason: Given object does not match the expected primitive type.\");\n }\n }\n else { // other weird types\n throw new Error(\"\\tReason: Expected type is unknown. There might be multiple reasons for this:\\n\" +\n \"\\t- You are missing the decorator @JsonObject (for object mapping)\\n\" +\n \"\\t- You are missing the decorator @JsonConverter (for custom mapping) before your class definition\\n\" +\n \"\\t- Your given class is undefined in the decorator because of circular dependencies\");\n }\n }\n // Check if attempt and expected was n-d\n if (expectedJsonType instanceof Array && value instanceof Array) {\n var array = [];\n // No data given, so return empty value\n if (value.length === 0) {\n return array;\n }\n // We obviously don't care about the type, so return the value as is\n if (expectedJsonType.length === 0) {\n return value;\n }\n // Loop through the data. Both type and value are at least of length 1\n var autofillType = expectedJsonType.length < value.length;\n for (var i = 0; i < value.length; i++) {\n if (autofillType && i >= expectedJsonType.length)\n expectedJsonType[i] = expectedJsonType[i - 1];\n array[i] = this.verifyProperty(expectedJsonType[i], value[i], serialize);\n }\n return array;\n }\n // Check if attempt was 1-d and expected was n-d\n if (expectedJsonType instanceof Array && value instanceof Object) {\n var array = [];\n // No data given, so return empty value\n if (value.length === 0) {\n return array;\n }\n // We obviously don't care about the type, so return the json value as is\n if (expectedJsonType.length === 0) {\n return value;\n }\n // Loop through the data. Both type and value are at least of length 1\n var autofillType = expectedJsonType.length < Object.keys(value).length;\n var i = 0;\n for (var key in value) {\n if (autofillType && i >= expectedJsonType.length)\n expectedJsonType[i] = expectedJsonType[i - 1];\n array[key] = this.verifyProperty(expectedJsonType[i], value[key]);\n i++;\n }\n return array;\n }\n // Check if attempt was 1-d and expected was n-d\n if (expectedJsonType instanceof Array) {\n if (value === null) {\n if (this.valueCheckingMode !== json_convert_enums_1.ValueCheckingMode.DISALLOW_NULL)\n return null;\n else\n throw new Error(\"\\tReason: Given value is null.\");\n }\n throw new Error(\"\\tReason: Expected type is array, but given value is non-array.\");\n }\n // Check if attempt was n-d and expected as 1-d\n if (value instanceof Array) {\n throw new Error(\"\\tReason: Given value is array, but expected a non-array type.\");\n }\n // All other attempts are fatal\n throw new Error(\"\\tReason: Mapping failed because of an unknown error.\");\n };\n /**\n * Gets the value of an object for a given value.\n * If the object does not have the specific key, an Error is thrown.\n *\n * @param data\n * @param key\n *\n * @returns returns the value\n *\n * @throws an Error in case of the key was not found in the object\n */\n JsonConvert.prototype.getObjectValue = function (data, key) {\n // If we do not care about the case of the key, ad\n if (this.propertyMatchingRule === json_convert_enums_1.PropertyMatchingRule.CASE_INSENSITIVE) {\n // Create a mapping of the keys: keys[lowercase]=normalcase\n var keyMapping = Object.keys(data).reduce(function (keys, key) {\n keys[key.toLowerCase()] = key;\n return keys;\n }, {});\n // Define the new key\n key = keyMapping[key.toLowerCase()];\n }\n // Throw an error if the key is not in the object\n if (key in data === false) {\n throw new Error();\n }\n return data[key];\n };\n ///////////////////////////\n // JSON2TYPESCRIPT TYPES //\n ///////////////////////////\n /**\n * Returns a string representation of the expected json type.\n *\n * @param expectedJsonType the expected type given from the decorator\n *\n * @returns {string} the string representation\n */\n JsonConvert.prototype.getExpectedType = function (expectedJsonType) {\n var type = \"\";\n if (expectedJsonType instanceof Array) {\n type = \"[\";\n for (var i = 0; i < expectedJsonType.length; i++) {\n if (i > 0)\n type += \",\";\n type += this.getExpectedType(expectedJsonType[i]);\n }\n type += \"]\";\n return type;\n }\n else {\n if (expectedJsonType === any_1.Any || expectedJsonType === null || expectedJsonType === Object) {\n return \"any\";\n }\n else if (expectedJsonType === String || expectedJsonType === Boolean || expectedJsonType === Number) {\n return (new expectedJsonType()).constructor.name.toLowerCase();\n }\n else if (typeof expectedJsonType === \"function\") {\n return (new expectedJsonType()).constructor.name;\n }\n else if (expectedJsonType === undefined) {\n return \"undefined\";\n }\n else {\n return \"?????\";\n }\n }\n };\n /**\n * Returns a string representation of the JSON value type.\n *\n * @param jsonValue the JSON value\n *\n * @returns {string} the string representation\n */\n JsonConvert.prototype.getJsonType = function (jsonValue) {\n if (jsonValue === null)\n return \"null\";\n var type = \"\";\n if (jsonValue instanceof Array) {\n type = \"[\";\n for (var i = 0; i < jsonValue.length; i++) {\n if (i > 0)\n type += \",\";\n type += this.getJsonType(jsonValue[i]);\n }\n type += \"]\";\n return type;\n }\n else {\n return typeof (jsonValue);\n }\n };\n /**\n * Returns a string representation of the true TypeScript type.\n *\n * @param trueValue the true value\n *\n * @returns {string} the string representation\n */\n JsonConvert.prototype.getTrueType = function (trueValue) {\n return typeof (trueValue);\n };\n return JsonConvert;\n}());\nexports.JsonConvert = JsonConvert;\n//# sourceMappingURL=json-convert.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar json_convert_1 = require(\"./src/json2typescript/json-convert\");\nexports.JsonConvert = json_convert_1.JsonConvert;\nvar json_convert_enums_1 = require(\"./src/json2typescript/json-convert-enums\");\nexports.ValueCheckingMode = json_convert_enums_1.ValueCheckingMode;\nexports.OperationMode = json_convert_enums_1.OperationMode;\nvar json_convert_decorators_1 = require(\"./src/json2typescript/json-convert-decorators\");\nexports.JsonObject = json_convert_decorators_1.JsonObject;\nexports.JsonProperty = json_convert_decorators_1.JsonProperty;\nexports.JsonConverter = json_convert_decorators_1.JsonConverter;\nvar any_1 = require(\"./src/json2typescript/any\");\nexports.Any = any_1.Any;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Internal constants.\n */\nvar Settings = /** @class */ (function () {\n function Settings() {\n }\n Settings.MAPPING_PROPERTY = \"__jsonconvert__mapping__\";\n Settings.MAPPER_PROPERTY = \"__jsonconvert__mapper__\";\n Settings.CLASS_IDENTIFIER = \"__jsonconvert__class_identifier__\";\n return Settings;\n}());\nexports.Settings = Settings;\n;\n/**\n * Internal mapping options for a property.\n */\nvar MappingOptions = /** @class */ (function () {\n function MappingOptions() {\n this.classPropertyName = \"\";\n this.jsonPropertyName = \"\";\n this.expectedJsonType = undefined;\n this.isOptional = false;\n this.customConverter = null;\n }\n return MappingOptions;\n}());\nexports.MappingOptions = MappingOptions;\n//# sourceMappingURL=json-convert-options.js.map"],"names":[],"sourceRoot":""}