{"version":3,"sources":["webpack://jrs-ui/./runtime_dependencies/tv4/tv4.js"],"names":["define","hasOwnProperty","hasDontEnumBug","dontEnums","dontEnumsLength","Object","keys","prototype","toString","propertyIsEnumerable","length","obj","TypeError","result","prop","call","push","i","create","F","o","arguments","Error","Array","isArray","vArg","indexOf","searchElement","this","t","len","n","Number","Infinity","Math","floor","abs","k","max","isFrozen","key","random","e","uriTemplateGlobalModifiers","uriTemplateSuffices","notReallyPercentEncode","string","encodeURI","replace","doubleEncoded","substring","uriTemplateSubstitution","spec","modifier","charAt","separator","prefix","shouldEscape","showVariables","trimEmptyString","varNames","varList","split","varSpecs","varSpecMap","varName","truncate","parts","parseInt","suffices","varSpec","name","subFunction","valueFunction","startIndex","value","j","encodeURIComponent","first","substitution","UriTemplate","template","textParts","shift","prefixes","substitutions","part","remainder","funcs","concat","fill","fillFromObject","ValidatorContext","parent","collectMultiple","errorReporter","checkRecursive","trackUnknownProperties","missing","missingMap","formatValidators","schemas","errors","handleError","collectError","returnError","scanned","scannedFrozen","scannedFrozenSchemas","scannedFrozenValidationErrors","validatedSchemasKey","validationErrorsKey","knownPropertyPaths","unknownPropertyPaths","defaultErrorReporter","definedKeywords","slice","recursiveCompare","A","B","undefined","defineKeyword","keyword","keywordFunction","createError","code","messageParams","dataPath","schemaPath","subErrors","data","schema","error","ValidationError","message","prefixErrors","prefixWith","banUnknownProperties","unknownPath","ErrorCodes","UNKNOWN_PROPERTY","path","addFormat","format","validator","resolveRefs","urlHistory","CIRCULAR_REFERENCE","urls","join","getSchema","url","baseUrl","fragment","pointerPath","decodeURIComponent","component","searchSchemas","id","isTrustedUrl","uri","getDocumentUri","addSchema","normSchema","getSchemaMap","map","getSchemaUris","filterRegExp","list","test","getMissingUris","dropSchemas","reset","validateAll","dataPathParts","schemaPathParts","dataPointerPath","topLevel","frozenIndex","startErrorCount","scannedFrozenSchemaIndex","scannedSchemasIndex","schemaIndex","frozenSchemaIndex","defineProperty","configurable","errorCount","validateBasic","validateNumeric","validateString","validateArray","validateObject","validateCombinations","validateHypermedia","validateFormat","validateDefinedKeywords","pop","dataPart","schemaPart","errorMessage","FORMAT_CUSTOM","validationFunctions","func","KEYWORD_CUSTOM","validateType","validateEnum","type","dataType","allowedTypes","INVALID_TYPE","expected","ENUM_MISMATCH","JSON","stringify","validateMultipleOf","validateMinMax","validateNaN","CLOSE_ENOUGH_LOW","pow","CLOSE_ENOUGH_HIGH","parseURI","m","String","match","href","protocol","authority","host","hostname","port","pathname","search","hash","resolveUrl","base","removeDotSegments","input","output","p","lastIndexOf","baseUri","language","errorMessages","languages","messageTemplate","ErrorMessagesDefault","params","whole","subValue","multipleOf","divisibleBy","NUMBER_MULTIPLE_OF","minimum","NUMBER_MINIMUM","exclusiveMinimum","NUMBER_MINIMUM_EXCLUSIVE","maximum","NUMBER_MAXIMUM","exclusiveMaximum","NUMBER_MAXIMUM_EXCLUSIVE","isNaN","NUMBER_NOT_A_NUMBER","validateStringLength","validateStringPattern","minLength","STRING_LENGTH_SHORT","maxLength","STRING_LENGTH_LONG","pattern","RegExp","regexp","body","flags","literal","STRING_PATTERN","validateArrayLength","validateArrayUniqueItems","validateArrayItems","minItems","ARRAY_LENGTH_SHORT","maxItems","ARRAY_LENGTH_LONG","uniqueItems","ARRAY_UNIQUE","match1","match2","items","additionalItems","ARRAY_ADDITIONAL_ITEMS","validateObjectMinMaxProperties","validateObjectRequiredProperties","validateObjectProperties","validateObjectDependencies","minProperties","OBJECT_PROPERTIES_MINIMUM","propertyCount","maxProperties","OBJECT_PROPERTIES_MAXIMUM","required","OBJECT_REQUIRED","keyPointerPath","foundMatch","properties","patternProperties","patternKey","additionalProperties","OBJECT_ADDITIONAL_PROPERTIES","dependencies","depKey","dep","OBJECT_DEPENDENCY_KEY","requiredKey","validateAllOf","validateAnyOf","validateOneOf","validateNot","allOf","subSchema","anyOf","oldUnknownPropertyPaths","oldKnownPropertyPaths","errorAtEnd","knownKey","unknownKey","ANY_OF_MISSING","oneOf","validIndex","ONE_OF_MULTIPLE","index1","index2","ONE_OF_MISSING","not","oldErrorCount","notErrors","NOT_PASSED","links","ldo","rel","allPresent","ErrorCodeLookup","err","stack","stacktrace","testUrl","constructor","dataPrefix","schemaPrefix","createApi","currentLanguage","customErrorReporter","globalContext","api","setErrorReporter","reporter","apply","addLanguage","messageMap","rootCode","freshApi","validate","def","context","valid","validateResult","validateMultiple","defineError","codeName","codeNumber","defaultMessage","langCode","errorCodes","tv4"],"mappings":"oUAWIA,EAAO,QAAD,4BAQF,WAIQ,IACVC,EACHC,EACAC,EASAC,EAbEC,OAAOC,OACXD,OAAOC,MACFL,EAAiBI,OAAOE,UAAUN,eACrCC,GAAmB,CAACM,SAAU,MAAOC,qBAAqB,YAU1DL,GATAD,EAAY,CACX,WACA,iBACA,UACA,iBACA,gBACA,uBACA,gBAE2BO,OAEtB,SAAUC,GAChB,GAAmB,WAAf,EAAOA,IAAmC,mBAARA,GAA8B,OAARA,EAC3D,MAAM,IAAIC,UAAU,oCAGrB,IAAIC,EAAS,GAEb,IAAK,IAAIC,KAAQH,EACZV,EAAec,KAAKJ,EAAKG,IAC5BD,EAAOG,KAAKF,GAId,GAAIZ,EACH,IAAK,IAAIe,EAAE,EAAGA,EAAIb,EAAiBa,IAC9BhB,EAAec,KAAKJ,EAAKR,EAAUc,KACtCJ,EAAOG,KAAKb,EAAUc,IAIzB,OAAOJ,KAKLR,OAAOa,SACXb,OAAOa,OAAU,WAChB,SAASC,KAET,OAAO,SAASC,GACf,GAAyB,IAArBC,UAAUX,OACb,MAAM,IAAIY,MAAM,4DAGjB,OADAH,EAAEZ,UAAYa,EACP,IAAID,GARI,IAadI,MAAMC,UACTD,MAAMC,QAAU,SAAUC,GACzB,MAAgD,mBAAzCpB,OAAOE,UAAUC,SAASO,KAAKU,KAInCF,MAAMhB,UAAUmB,UACpBH,MAAMhB,UAAUmB,QAAU,SAAUC,GACnC,GAAa,OAATC,KACH,MAAM,IAAIhB,UAEX,IAAIiB,EAAIxB,OAAOuB,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AA2C,IAAhC3B,EAAgB4B,GAC1B,MAAM,IAAIzV,MAAM,4BAA8B6T,EAAgB4B,GAAc,OAASA,GAKtF,IAAK,IAAIE,KAHTtO,EAAWmO,GAAYC,EACvB5B,EAAgB4B,GAAcD,EAC9BzH,EAAqByH,GAAYzH,EAAqB0H,GAAcC,EAC/C7H,EAAW,CAC/B,IAAIF,EAAWE,EAAU8H,GACrBhI,EAAS6H,KACZ7H,EAAS8H,GAAc9H,EAAS8H,IAAe9H,EAAS6H,MAI3DlM,MAAO,WACNkL,EAAclL,QACdhJ,KAAKwG,MAAQ,KACbxG,KAAKsE,QAAU,GACftE,KAAK8U,OAAQ,GAEdxQ,QAAS,GACTkC,MAAO,KACPsO,OAAO,EACPvM,WAAYA,EACZsE,WAAYA,EACZxE,eAAgBA,EAChBiN,WAAYvO,GAGb,OADAoN,EAAI9G,SAASA,GAAY,MAClB8G,EAGR,IAAIoB,EAAMxB,IAMV,OALAwB,EAAIhB,YAAY,QAAS9G,GAGzB8H,EAAIA,IAAMA,EAEHA,IA/nDG","file":"_chunks/chunk.583.js","sourcesContent":["/*\nAuthor: Geraint Luff and others\nYear: 2013\n\nThis code is released into the \"public domain\" by its author(s). Anybody may use, alter and distribute the code without restriction. The author makes no guarantees, and takes no liability of any kind for use of this code.\n\nIf you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory.\n*/\n(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof module !== 'undefined' && module.exports){\n // CommonJS. Define export.\n module.exports = factory();\n } else {\n // Browser globals\n global.tv4 = factory();\n }\n}(this, function () {\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys\nif (!Object.keys) {\n\tObject.keys = (function () {\n\t\tvar hasOwnProperty = Object.prototype.hasOwnProperty,\n\t\t\thasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),\n\t\t\tdontEnums = [\n\t\t\t\t'toString',\n\t\t\t\t'toLocaleString',\n\t\t\t\t'valueOf',\n\t\t\t\t'hasOwnProperty',\n\t\t\t\t'isPrototypeOf',\n\t\t\t\t'propertyIsEnumerable',\n\t\t\t\t'constructor'\n\t\t\t],\n\t\t\tdontEnumsLength = dontEnums.length;\n\n\t\treturn function (obj) {\n\t\t\tif (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) {\n\t\t\t\tthrow new TypeError('Object.keys called on non-object');\n\t\t\t}\n\n\t\t\tvar result = [];\n\n\t\t\tfor (var prop in obj) {\n\t\t\t\tif (hasOwnProperty.call(obj, prop)) {\n\t\t\t\t\tresult.push(prop);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hasDontEnumBug) {\n\t\t\t\tfor (var i=0; i < dontEnumsLength; i++) {\n\t\t\t\t\tif (hasOwnProperty.call(obj, dontEnums[i])) {\n\t\t\t\t\t\tresult.push(dontEnums[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t})();\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create\nif (!Object.create) {\n\tObject.create = (function(){\n\t\tfunction F(){}\n\n\t\treturn function(o){\n\t\t\tif (arguments.length !== 1) {\n\t\t\t\tthrow new Error('Object.create implementation only accepts one parameter.');\n\t\t\t}\n\t\t\tF.prototype = o;\n\t\t\treturn new F();\n\t\t};\n\t})();\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FisArray\nif(!Array.isArray) {\n\tArray.isArray = function (vArg) {\n\t\treturn Object.prototype.toString.call(vArg) === \"[object Array]\";\n\t};\n}\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf\nif (!Array.prototype.indexOf) {\n\tArray.prototype.indexOf = function (searchElement /*, fromIndex */ ) {\n\t\tif (this === null) {\n\t\t\tthrow new TypeError();\n\t\t}\n\t\tvar t = Object(this);\n\t\tvar len = t.length >>> 0;\n\n\t\tif (len === 0) {\n\t\t\treturn -1;\n\t\t}\n\t\tvar n = 0;\n\t\tif (arguments.length > 1) {\n\t\t\tn = Number(arguments[1]);\n\t\t\tif (n !== n) { // shortcut for verifying if it's NaN\n\t\t\t\tn = 0;\n\t\t\t} else if (n !== 0 && n !== Infinity && n !== -Infinity) {\n\t\t\t\tn = (n > 0 || -1) * Math.floor(Math.abs(n));\n\t\t\t}\n\t\t}\n\t\tif (n >= len) {\n\t\t\treturn -1;\n\t\t}\n\t\tvar k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\n\t\tfor (; k < len; k++) {\n\t\t\tif (k in t && t[k] === searchElement) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t};\n}\n\n// Grungey Object.isFrozen hack\nif (!Object.isFrozen) {\n\tObject.isFrozen = function (obj) {\n\t\tvar key = \"tv4_test_frozen_key\";\n\t\twhile (obj.hasOwnProperty(key)) {\n\t\t\tkey += Math.random();\n\t\t}\n\t\ttry {\n\t\t\tobj[key] = true;\n\t\t\tdelete obj[key];\n\t\t\treturn false;\n\t\t} catch (e) {\n\t\t\treturn true;\n\t\t}\n\t};\n}\n// Based on: https://github.com/geraintluff/uri-templates, but with all the de-substitution stuff removed\n\nvar uriTemplateGlobalModifiers = {\n\t\"+\": true,\n\t\"#\": true,\n\t\".\": true,\n\t\"/\": true,\n\t\";\": true,\n\t\"?\": true,\n\t\"&\": true\n};\nvar uriTemplateSuffices = {\n\t\"*\": true\n};\n\nfunction notReallyPercentEncode(string) {\n\treturn encodeURI(string).replace(/%25[0-9][0-9]/g, function (doubleEncoded) {\n\t\treturn \"%\" + doubleEncoded.substring(3);\n\t});\n}\n\nfunction uriTemplateSubstitution(spec) {\n\tvar modifier = \"\";\n\tif (uriTemplateGlobalModifiers[spec.charAt(0)]) {\n\t\tmodifier = spec.charAt(0);\n\t\tspec = spec.substring(1);\n\t}\n\tvar separator = \"\";\n\tvar prefix = \"\";\n\tvar shouldEscape = true;\n\tvar showVariables = false;\n\tvar trimEmptyString = false;\n\tif (modifier === '+') {\n\t\tshouldEscape = false;\n\t} else if (modifier === \".\") {\n\t\tprefix = \".\";\n\t\tseparator = \".\";\n\t} else if (modifier === \"/\") {\n\t\tprefix = \"/\";\n\t\tseparator = \"/\";\n\t} else if (modifier === '#') {\n\t\tprefix = \"#\";\n\t\tshouldEscape = false;\n\t} else if (modifier === ';') {\n\t\tprefix = \";\";\n\t\tseparator = \";\";\n\t\tshowVariables = true;\n\t\ttrimEmptyString = true;\n\t} else if (modifier === '?') {\n\t\tprefix = \"?\";\n\t\tseparator = \"&\";\n\t\tshowVariables = true;\n\t} else if (modifier === '&') {\n\t\tprefix = \"&\";\n\t\tseparator = \"&\";\n\t\tshowVariables = true;\n\t}\n\n\tvar varNames = [];\n\tvar varList = spec.split(\",\");\n\tvar varSpecs = [];\n\tvar varSpecMap = {};\n\tfor (var i = 0; i < varList.length; i++) {\n\t\tvar varName = varList[i];\n\t\tvar truncate = null;\n\t\tif (varName.indexOf(\":\") !== -1) {\n\t\t\tvar parts = varName.split(\":\");\n\t\t\tvarName = parts[0];\n\t\t\ttruncate = parseInt(parts[1], 10);\n\t\t}\n\t\tvar suffices = {};\n\t\twhile (uriTemplateSuffices[varName.charAt(varName.length - 1)]) {\n\t\t\tsuffices[varName.charAt(varName.length - 1)] = true;\n\t\t\tvarName = varName.substring(0, varName.length - 1);\n\t\t}\n\t\tvar varSpec = {\n\t\t\ttruncate: truncate,\n\t\t\tname: varName,\n\t\t\tsuffices: suffices\n\t\t};\n\t\tvarSpecs.push(varSpec);\n\t\tvarSpecMap[varName] = varSpec;\n\t\tvarNames.push(varName);\n\t}\n\tvar subFunction = function (valueFunction) {\n\t\tvar result = \"\";\n\t\tvar startIndex = 0;\n\t\tfor (var i = 0; i < varSpecs.length; i++) {\n\t\t\tvar varSpec = varSpecs[i];\n\t\t\tvar value = valueFunction(varSpec.name);\n\t\t\tif (value === null || value === undefined || (Array.isArray(value) && value.length === 0) || (typeof value === 'object' && Object.keys(value).length === 0)) {\n\t\t\t\tstartIndex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i === startIndex) {\n\t\t\t\tresult += prefix;\n\t\t\t} else {\n\t\t\t\tresult += (separator || \",\");\n\t\t\t}\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tif (showVariables) {\n\t\t\t\t\tresult += varSpec.name + \"=\";\n\t\t\t\t}\n\t\t\t\tfor (var j = 0; j < value.length; j++) {\n\t\t\t\t\tif (j > 0) {\n\t\t\t\t\t\tresult += varSpec.suffices['*'] ? (separator || \",\") : \",\";\n\t\t\t\t\t\tif (varSpec.suffices['*'] && showVariables) {\n\t\t\t\t\t\t\tresult += varSpec.name + \"=\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(value[j]).replace(/!/g, \"%21\") : notReallyPercentEncode(value[j]);\n\t\t\t\t}\n\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\tif (showVariables && !varSpec.suffices['*']) {\n\t\t\t\t\tresult += varSpec.name + \"=\";\n\t\t\t\t}\n\t\t\t\tvar first = true;\n\t\t\t\tfor (var key in value) {\n\t\t\t\t\tif (!first) {\n\t\t\t\t\t\tresult += varSpec.suffices['*'] ? (separator || \",\") : \",\";\n\t\t\t\t\t}\n\t\t\t\t\tfirst = false;\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(key).replace(/!/g, \"%21\") : notReallyPercentEncode(key);\n\t\t\t\t\tresult += varSpec.suffices['*'] ? '=' : \",\";\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(value[key]).replace(/!/g, \"%21\") : notReallyPercentEncode(value[key]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (showVariables) {\n\t\t\t\t\tresult += varSpec.name;\n\t\t\t\t\tif (!trimEmptyString || value !== \"\") {\n\t\t\t\t\t\tresult += \"=\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (varSpec.truncate != null) {\n\t\t\t\t\tvalue = value.substring(0, varSpec.truncate);\n\t\t\t\t}\n\t\t\t\tresult += shouldEscape ? encodeURIComponent(value).replace(/!/g, \"%21\"): notReallyPercentEncode(value);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t};\n\tsubFunction.varNames = varNames;\n\treturn {\n\t\tprefix: prefix,\n\t\tsubstitution: subFunction\n\t};\n}\n\nfunction UriTemplate(template) {\n\tif (!(this instanceof UriTemplate)) {\n\t\treturn new UriTemplate(template);\n\t}\n\tvar parts = template.split(\"{\");\n\tvar textParts = [parts.shift()];\n\tvar prefixes = [];\n\tvar substitutions = [];\n\tvar varNames = [];\n\twhile (parts.length > 0) {\n\t\tvar part = parts.shift();\n\t\tvar spec = part.split(\"}\")[0];\n\t\tvar remainder = part.substring(spec.length + 1);\n\t\tvar funcs = uriTemplateSubstitution(spec);\n\t\tsubstitutions.push(funcs.substitution);\n\t\tprefixes.push(funcs.prefix);\n\t\ttextParts.push(remainder);\n\t\tvarNames = varNames.concat(funcs.substitution.varNames);\n\t}\n\tthis.fill = function (valueFunction) {\n\t\tvar result = textParts[0];\n\t\tfor (var i = 0; i < substitutions.length; i++) {\n\t\t\tvar substitution = substitutions[i];\n\t\t\tresult += substitution(valueFunction);\n\t\t\tresult += textParts[i + 1];\n\t\t}\n\t\treturn result;\n\t};\n\tthis.varNames = varNames;\n\tthis.template = template;\n}\nUriTemplate.prototype = {\n\ttoString: function () {\n\t\treturn this.template;\n\t},\n\tfillFromObject: function (obj) {\n\t\treturn this.fill(function (varName) {\n\t\t\treturn obj[varName];\n\t\t});\n\t}\n};\nvar ValidatorContext = function ValidatorContext(parent, collectMultiple, errorReporter, checkRecursive, trackUnknownProperties) {\n\tthis.missing = [];\n\tthis.missingMap = {};\n\tthis.formatValidators = parent ? Object.create(parent.formatValidators) : {};\n\tthis.schemas = parent ? Object.create(parent.schemas) : {};\n\tthis.collectMultiple = collectMultiple;\n\tthis.errors = [];\n\tthis.handleError = collectMultiple ? this.collectError : this.returnError;\n\tif (checkRecursive) {\n\t\tthis.checkRecursive = true;\n\t\tthis.scanned = [];\n\t\tthis.scannedFrozen = [];\n\t\tthis.scannedFrozenSchemas = [];\n\t\tthis.scannedFrozenValidationErrors = [];\n\t\tthis.validatedSchemasKey = 'tv4_validation_id';\n\t\tthis.validationErrorsKey = 'tv4_validation_errors_id';\n\t}\n\tif (trackUnknownProperties) {\n\t\tthis.trackUnknownProperties = true;\n\t\tthis.knownPropertyPaths = {};\n\t\tthis.unknownPropertyPaths = {};\n\t}\n\tthis.errorReporter = errorReporter || defaultErrorReporter('en');\n\tif (typeof this.errorReporter === 'string') {\n\t\tthrow new Error('debug');\n\t}\n\tthis.definedKeywords = {};\n\tif (parent) {\n\t\tfor (var key in parent.definedKeywords) {\n\t\t\tthis.definedKeywords[key] = parent.definedKeywords[key].slice(0);\n\t\t}\n\t}\n};\nValidatorContext.prototype.defineKeyword = function (keyword, keywordFunction) {\n\tthis.definedKeywords[keyword] = this.definedKeywords[keyword] || [];\n\tthis.definedKeywords[keyword].push(keywordFunction);\n};\nValidatorContext.prototype.createError = function (code, messageParams, dataPath, schemaPath, subErrors, data, schema) {\n\tvar error = new ValidationError(code, messageParams, dataPath, schemaPath, subErrors);\n\terror.message = this.errorReporter(error, data, schema);\n\treturn error;\n};\nValidatorContext.prototype.returnError = function (error) {\n\treturn error;\n};\nValidatorContext.prototype.collectError = function (error) {\n\tif (error) {\n\t\tthis.errors.push(error);\n\t}\n\treturn null;\n};\nValidatorContext.prototype.prefixErrors = function (startIndex, dataPath, schemaPath) {\n\tfor (var i = startIndex; i < this.errors.length; i++) {\n\t\tthis.errors[i] = this.errors[i].prefixWith(dataPath, schemaPath);\n\t}\n\treturn this;\n};\nValidatorContext.prototype.banUnknownProperties = function (data, schema) {\n\tfor (var unknownPath in this.unknownPropertyPaths) {\n\t\tvar error = this.createError(ErrorCodes.UNKNOWN_PROPERTY, {path: unknownPath}, unknownPath, \"\", null, data, schema);\n\t\tvar result = this.handleError(error);\n\t\tif (result) {\n\t\t\treturn result;\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.addFormat = function (format, validator) {\n\tif (typeof format === 'object') {\n\t\tfor (var key in format) {\n\t\t\tthis.addFormat(key, format[key]);\n\t\t}\n\t\treturn this;\n\t}\n\tthis.formatValidators[format] = validator;\n};\nValidatorContext.prototype.resolveRefs = function (schema, urlHistory) {\n\tif (schema['$ref'] !== undefined) {\n\t\turlHistory = urlHistory || {};\n\t\tif (urlHistory[schema['$ref']]) {\n\t\t\treturn this.createError(ErrorCodes.CIRCULAR_REFERENCE, {urls: Object.keys(urlHistory).join(', ')}, '', '', null, undefined, schema);\n\t\t}\n\t\turlHistory[schema['$ref']] = true;\n\t\tschema = this.getSchema(schema['$ref'], urlHistory);\n\t}\n\treturn schema;\n};\nValidatorContext.prototype.getSchema = function (url, urlHistory) {\n\tvar schema;\n\tif (this.schemas[url] !== undefined) {\n\t\tschema = this.schemas[url];\n\t\treturn this.resolveRefs(schema, urlHistory);\n\t}\n\tvar baseUrl = url;\n\tvar fragment = \"\";\n\tif (url.indexOf('#') !== -1) {\n\t\tfragment = url.substring(url.indexOf(\"#\") + 1);\n\t\tbaseUrl = url.substring(0, url.indexOf(\"#\"));\n\t}\n\tif (typeof this.schemas[baseUrl] === 'object') {\n\t\tschema = this.schemas[baseUrl];\n\t\tvar pointerPath = decodeURIComponent(fragment);\n\t\tif (pointerPath === \"\") {\n\t\t\treturn this.resolveRefs(schema, urlHistory);\n\t\t} else if (pointerPath.charAt(0) !== \"/\") {\n\t\t\treturn undefined;\n\t\t}\n\t\tvar parts = pointerPath.split(\"/\").slice(1);\n\t\tfor (var i = 0; i < parts.length; i++) {\n\t\t\tvar component = parts[i].replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n\t\t\tif (schema[component] === undefined) {\n\t\t\t\tschema = undefined;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tschema = schema[component];\n\t\t}\n\t\tif (schema !== undefined) {\n\t\t\treturn this.resolveRefs(schema, urlHistory);\n\t\t}\n\t}\n\tif (this.missing[baseUrl] === undefined) {\n\t\tthis.missing.push(baseUrl);\n\t\tthis.missing[baseUrl] = baseUrl;\n\t\tthis.missingMap[baseUrl] = baseUrl;\n\t}\n};\nValidatorContext.prototype.searchSchemas = function (schema, url) {\n\tif (Array.isArray(schema)) {\n\t\tfor (var i = 0; i < schema.length; i++) {\n\t\t\tthis.searchSchemas(schema[i], url);\n\t\t}\n\t} else if (schema && typeof schema === \"object\") {\n\t\tif (typeof schema.id === \"string\") {\n\t\t\tif (isTrustedUrl(url, schema.id)) {\n\t\t\t\tif (this.schemas[schema.id] === undefined) {\n\t\t\t\t\tthis.schemas[schema.id] = schema;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (var key in schema) {\n\t\t\tif (key !== \"enum\") {\n\t\t\t\tif (typeof schema[key] === \"object\") {\n\t\t\t\t\tthis.searchSchemas(schema[key], url);\n\t\t\t\t} else if (key === \"$ref\") {\n\t\t\t\t\tvar uri = getDocumentUri(schema[key]);\n\t\t\t\t\tif (uri && this.schemas[uri] === undefined && this.missingMap[uri] === undefined) {\n\t\t\t\t\t\tthis.missingMap[uri] = uri;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\nValidatorContext.prototype.addSchema = function (url, schema) {\n\t//overload\n\tif (typeof url !== 'string' || typeof schema === 'undefined') {\n\t\tif (typeof url === 'object' && typeof url.id === 'string') {\n\t\t\tschema = url;\n\t\t\turl = schema.id;\n\t\t}\n\t\telse {\n\t\t\treturn;\n\t\t}\n\t}\n\tif (url === getDocumentUri(url) + \"#\") {\n\t\t// Remove empty fragment\n\t\turl = getDocumentUri(url);\n\t}\n\tthis.schemas[url] = schema;\n\tdelete this.missingMap[url];\n\tnormSchema(schema, url);\n\tthis.searchSchemas(schema, url);\n};\n\nValidatorContext.prototype.getSchemaMap = function () {\n\tvar map = {};\n\tfor (var key in this.schemas) {\n\t\tmap[key] = this.schemas[key];\n\t}\n\treturn map;\n};\n\nValidatorContext.prototype.getSchemaUris = function (filterRegExp) {\n\tvar list = [];\n\tfor (var key in this.schemas) {\n\t\tif (!filterRegExp || filterRegExp.test(key)) {\n\t\t\tlist.push(key);\n\t\t}\n\t}\n\treturn list;\n};\n\nValidatorContext.prototype.getMissingUris = function (filterRegExp) {\n\tvar list = [];\n\tfor (var key in this.missingMap) {\n\t\tif (!filterRegExp || filterRegExp.test(key)) {\n\t\t\tlist.push(key);\n\t\t}\n\t}\n\treturn list;\n};\n\nValidatorContext.prototype.dropSchemas = function () {\n\tthis.schemas = {};\n\tthis.reset();\n};\nValidatorContext.prototype.reset = function () {\n\tthis.missing = [];\n\tthis.missingMap = {};\n\tthis.errors = [];\n};\n\nValidatorContext.prototype.validateAll = function (data, schema, dataPathParts, schemaPathParts, dataPointerPath) {\n\tvar topLevel;\n\tschema = this.resolveRefs(schema);\n\tif (!schema) {\n\t\treturn null;\n\t} else if (schema instanceof ValidationError) {\n\t\tthis.errors.push(schema);\n\t\treturn schema;\n\t}\n\n\tvar startErrorCount = this.errors.length;\n\tvar frozenIndex, scannedFrozenSchemaIndex = null, scannedSchemasIndex = null;\n\tif (this.checkRecursive && data && typeof data === 'object') {\n\t\ttopLevel = !this.scanned.length;\n\t\tif (data[this.validatedSchemasKey]) {\n\t\t\tvar schemaIndex = data[this.validatedSchemasKey].indexOf(schema);\n\t\t\tif (schemaIndex !== -1) {\n\t\t\t\tthis.errors = this.errors.concat(data[this.validationErrorsKey][schemaIndex]);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\tif (Object.isFrozen(data)) {\n\t\t\tfrozenIndex = this.scannedFrozen.indexOf(data);\n\t\t\tif (frozenIndex !== -1) {\n\t\t\t\tvar frozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].indexOf(schema);\n\t\t\t\tif (frozenSchemaIndex !== -1) {\n\t\t\t\t\tthis.errors = this.errors.concat(this.scannedFrozenValidationErrors[frozenIndex][frozenSchemaIndex]);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.scanned.push(data);\n\t\tif (Object.isFrozen(data)) {\n\t\t\tif (frozenIndex === -1) {\n\t\t\t\tfrozenIndex = this.scannedFrozen.length;\n\t\t\t\tthis.scannedFrozen.push(data);\n\t\t\t\tthis.scannedFrozenSchemas.push([]);\n\t\t\t}\n\t\t\tscannedFrozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].length;\n\t\t\tthis.scannedFrozenSchemas[frozenIndex][scannedFrozenSchemaIndex] = schema;\n\t\t\tthis.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = [];\n\t\t} else {\n\t\t\tif (!data[this.validatedSchemasKey]) {\n\t\t\t\ttry {\n\t\t\t\t\tObject.defineProperty(data, this.validatedSchemasKey, {\n\t\t\t\t\t\tvalue: [],\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t});\n\t\t\t\t\tObject.defineProperty(data, this.validationErrorsKey, {\n\t\t\t\t\t\tvalue: [],\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t});\n\t\t\t\t} catch (e) {\n\t\t\t\t\t//IE 7/8 workaround\n\t\t\t\t\tdata[this.validatedSchemasKey] = [];\n\t\t\t\t\tdata[this.validationErrorsKey] = [];\n\t\t\t\t}\n\t\t\t}\n\t\t\tscannedSchemasIndex = data[this.validatedSchemasKey].length;\n\t\t\tdata[this.validatedSchemasKey][scannedSchemasIndex] = schema;\n\t\t\tdata[this.validationErrorsKey][scannedSchemasIndex] = [];\n\t\t}\n\t}\n\n\tvar errorCount = this.errors.length;\n\tvar error = this.validateBasic(data, schema, dataPointerPath)\n\t\t|| this.validateNumeric(data, schema, dataPointerPath)\n\t\t|| this.validateString(data, schema, dataPointerPath)\n\t\t|| this.validateArray(data, schema, dataPointerPath)\n\t\t|| this.validateObject(data, schema, dataPointerPath)\n\t\t|| this.validateCombinations(data, schema, dataPointerPath)\n\t\t|| this.validateHypermedia(data, schema, dataPointerPath)\n\t\t|| this.validateFormat(data, schema, dataPointerPath)\n\t\t|| this.validateDefinedKeywords(data, schema, dataPointerPath)\n\t\t|| null;\n\n\tif (topLevel) {\n\t\twhile (this.scanned.length) {\n\t\t\tvar item = this.scanned.pop();\n\t\t\tdelete item[this.validatedSchemasKey];\n\t\t}\n\t\tthis.scannedFrozen = [];\n\t\tthis.scannedFrozenSchemas = [];\n\t}\n\n\tif (error || errorCount !== this.errors.length) {\n\t\twhile ((dataPathParts && dataPathParts.length) || (schemaPathParts && schemaPathParts.length)) {\n\t\t\tvar dataPart = (dataPathParts && dataPathParts.length) ? \"\" + dataPathParts.pop() : null;\n\t\t\tvar schemaPart = (schemaPathParts && schemaPathParts.length) ? \"\" + schemaPathParts.pop() : null;\n\t\t\tif (error) {\n\t\t\t\terror = error.prefixWith(dataPart, schemaPart);\n\t\t\t}\n\t\t\tthis.prefixErrors(errorCount, dataPart, schemaPart);\n\t\t}\n\t}\n\n\tif (scannedFrozenSchemaIndex !== null) {\n\t\tthis.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = this.errors.slice(startErrorCount);\n\t} else if (scannedSchemasIndex !== null) {\n\t\tdata[this.validationErrorsKey][scannedSchemasIndex] = this.errors.slice(startErrorCount);\n\t}\n\n\treturn this.handleError(error);\n};\nValidatorContext.prototype.validateFormat = function (data, schema) {\n\tif (typeof schema.format !== 'string' || !this.formatValidators[schema.format]) {\n\t\treturn null;\n\t}\n\tvar errorMessage = this.formatValidators[schema.format].call(null, data, schema);\n\tif (typeof errorMessage === 'string' || typeof errorMessage === 'number') {\n\t\treturn this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage}, '', '/format', null, data, schema);\n\t} else if (errorMessage && typeof errorMessage === 'object') {\n\t\treturn this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage.message || \"?\"}, errorMessage.dataPath || '', errorMessage.schemaPath || \"/format\", null, data, schema);\n\t}\n\treturn null;\n};\nValidatorContext.prototype.validateDefinedKeywords = function (data, schema, dataPointerPath) {\n\tfor (var key in this.definedKeywords) {\n\t\tif (typeof schema[key] === 'undefined') {\n\t\t\tcontinue;\n\t\t}\n\t\tvar validationFunctions = this.definedKeywords[key];\n\t\tfor (var i = 0; i < validationFunctions.length; i++) {\n\t\t\tvar func = validationFunctions[i];\n\t\t\tvar result = func(data, schema[key], schema, dataPointerPath);\n\t\t\tif (typeof result === 'string' || typeof result === 'number') {\n\t\t\t\treturn this.createError(ErrorCodes.KEYWORD_CUSTOM, {key: key, message: result}, '', '', null, data, schema).prefixWith(null, key);\n\t\t\t} else if (result && typeof result === 'object') {\n\t\t\t\tvar code = result.code;\n\t\t\t\tif (typeof code === 'string') {\n\t\t\t\t\tif (!ErrorCodes[code]) {\n\t\t\t\t\t\tthrow new Error('Undefined error code (use defineError): ' + code);\n\t\t\t\t\t}\n\t\t\t\t\tcode = ErrorCodes[code];\n\t\t\t\t} else if (typeof code !== 'number') {\n\t\t\t\t\tcode = ErrorCodes.KEYWORD_CUSTOM;\n\t\t\t\t}\n\t\t\t\tvar messageParams = (typeof result.message === 'object') ? result.message : {key: key, message: result.message || \"?\"};\n\t\t\t\tvar schemaPath = result.schemaPath || (\"/\" + key.replace(/~/g, '~0').replace(/\\//g, '~1'));\n\t\t\t\treturn this.createError(code, messageParams, result.dataPath || null, schemaPath, null, data, schema);\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\nfunction recursiveCompare(A, B) {\n\tif (A === B) {\n\t\treturn true;\n\t}\n\tif (A && B && typeof A === \"object\" && typeof B === \"object\") {\n\t\tif (Array.isArray(A) !== Array.isArray(B)) {\n\t\t\treturn false;\n\t\t} else if (Array.isArray(A)) {\n\t\t\tif (A.length !== B.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (var i = 0; i < A.length; i++) {\n\t\t\t\tif (!recursiveCompare(A[i], B[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tvar key;\n\t\t\tfor (key in A) {\n\t\t\t\tif (B[key] === undefined && A[key] !== undefined) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (key in B) {\n\t\t\t\tif (A[key] === undefined && B[key] !== undefined) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (key in A) {\n\t\t\t\tif (!recursiveCompare(A[key], B[key])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nValidatorContext.prototype.validateBasic = function validateBasic(data, schema, dataPointerPath) {\n\tvar error;\n\tif (error = this.validateType(data, schema, dataPointerPath)) {\n\t\treturn error.prefixWith(null, \"type\");\n\t}\n\tif (error = this.validateEnum(data, schema, dataPointerPath)) {\n\t\treturn error.prefixWith(null, \"type\");\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateType = function validateType(data, schema) {\n\tif (schema.type === undefined) {\n\t\treturn null;\n\t}\n\tvar dataType = typeof data;\n\tif (data === null) {\n\t\tdataType = \"null\";\n\t} else if (Array.isArray(data)) {\n\t\tdataType = \"array\";\n\t}\n\tvar allowedTypes = schema.type;\n\tif (!Array.isArray(allowedTypes)) {\n\t\tallowedTypes = [allowedTypes];\n\t}\n\n\tfor (var i = 0; i < allowedTypes.length; i++) {\n\t\tvar type = allowedTypes[i];\n\t\tif (type === dataType || (type === \"integer\" && dataType === \"number\" && (data % 1 === 0))) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn this.createError(ErrorCodes.INVALID_TYPE, {type: dataType, expected: allowedTypes.join(\"/\")}, '', '', null, data, schema);\n};\n\nValidatorContext.prototype.validateEnum = function validateEnum(data, schema) {\n\tif (schema[\"enum\"] === undefined) {\n\t\treturn null;\n\t}\n\tfor (var i = 0; i < schema[\"enum\"].length; i++) {\n\t\tvar enumVal = schema[\"enum\"][i];\n\t\tif (recursiveCompare(data, enumVal)) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn this.createError(ErrorCodes.ENUM_MISMATCH, {value: (typeof JSON !== 'undefined') ? JSON.stringify(data) : data}, '', '', null, data, schema);\n};\n\nValidatorContext.prototype.validateNumeric = function validateNumeric(data, schema, dataPointerPath) {\n\treturn this.validateMultipleOf(data, schema, dataPointerPath)\n\t\t|| this.validateMinMax(data, schema, dataPointerPath)\n\t\t|| this.validateNaN(data, schema, dataPointerPath)\n\t\t|| null;\n};\n\nvar CLOSE_ENOUGH_LOW = Math.pow(2, -51);\nvar CLOSE_ENOUGH_HIGH = 1 - CLOSE_ENOUGH_LOW;\nValidatorContext.prototype.validateMultipleOf = function validateMultipleOf(data, schema) {\n\tvar multipleOf = schema.multipleOf || schema.divisibleBy;\n\tif (multipleOf === undefined) {\n\t\treturn null;\n\t}\n\tif (typeof data === \"number\") {\n\t\tvar remainder = (data/multipleOf)%1;\n\t\tif (remainder >= CLOSE_ENOUGH_LOW && remainder < CLOSE_ENOUGH_HIGH) {\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MULTIPLE_OF, {value: data, multipleOf: multipleOf}, '', '', null, data, schema);\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema) {\n\tif (typeof data !== \"number\") {\n\t\treturn null;\n\t}\n\tif (schema.minimum !== undefined) {\n\t\tif (data < schema.minimum) {\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MINIMUM, {value: data, minimum: schema.minimum}, '', '/minimum', null, data, schema);\n\t\t}\n\t\tif (schema.exclusiveMinimum && data === schema.minimum) {\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MINIMUM_EXCLUSIVE, {value: data, minimum: schema.minimum}, '', '/exclusiveMinimum', null, data, schema);\n\t\t}\n\t}\n\tif (schema.maximum !== undefined) {\n\t\tif (data > schema.maximum) {\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MAXIMUM, {value: data, maximum: schema.maximum}, '', '/maximum', null, data, schema);\n\t\t}\n\t\tif (schema.exclusiveMaximum && data === schema.maximum) {\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MAXIMUM_EXCLUSIVE, {value: data, maximum: schema.maximum}, '', '/exclusiveMaximum', null, data, schema);\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateNaN = function validateNaN(data, schema) {\n\tif (typeof data !== \"number\") {\n\t\treturn null;\n\t}\n\tif (isNaN(data) === true || data === Infinity || data === -Infinity) {\n\t\treturn this.createError(ErrorCodes.NUMBER_NOT_A_NUMBER, {value: data}, '', '/type', null, data, schema);\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateString = function validateString(data, schema, dataPointerPath) {\n\treturn this.validateStringLength(data, schema, dataPointerPath)\n\t\t|| this.validateStringPattern(data, schema, dataPointerPath)\n\t\t|| null;\n};\n\nValidatorContext.prototype.validateStringLength = function validateStringLength(data, schema) {\n\tif (typeof data !== \"string\") {\n\t\treturn null;\n\t}\n\tif (schema.minLength !== undefined) {\n\t\tif (data.length < schema.minLength) {\n\t\t\treturn this.createError(ErrorCodes.STRING_LENGTH_SHORT, {length: data.length, minimum: schema.minLength}, '', '/minLength', null, data, schema);\n\t\t}\n\t}\n\tif (schema.maxLength !== undefined) {\n\t\tif (data.length > schema.maxLength) {\n\t\t\treturn this.createError(ErrorCodes.STRING_LENGTH_LONG, {length: data.length, maximum: schema.maxLength}, '', '/maxLength', null, data, schema);\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateStringPattern = function validateStringPattern(data, schema) {\n\tif (typeof data !== \"string\" || (typeof schema.pattern !== \"string\" && !(schema.pattern instanceof RegExp))) {\n\t\treturn null;\n\t}\n\tvar regexp;\n\tif (schema.pattern instanceof RegExp) {\n\t regexp = schema.pattern;\n\t}\n\telse {\n\t var body, flags = '';\n\t // Check for regular expression literals\n\t // @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.5\n\t var literal = schema.pattern.match(/^\\/(.+)\\/([img]*)$/);\n\t if (literal) {\n\t body = literal[1];\n\t flags = literal[2];\n\t }\n\t else {\n\t body = schema.pattern;\n\t }\n\t regexp = new RegExp(body, flags);\n\t}\n\tif (!regexp.test(data)) {\n\t\treturn this.createError(ErrorCodes.STRING_PATTERN, {pattern: schema.pattern}, '', '/pattern', null, data, schema);\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateArray = function validateArray(data, schema, dataPointerPath) {\n\tif (!Array.isArray(data)) {\n\t\treturn null;\n\t}\n\treturn this.validateArrayLength(data, schema, dataPointerPath)\n\t\t|| this.validateArrayUniqueItems(data, schema, dataPointerPath)\n\t\t|| this.validateArrayItems(data, schema, dataPointerPath)\n\t\t|| null;\n};\n\nValidatorContext.prototype.validateArrayLength = function validateArrayLength(data, schema) {\n\tvar error;\n\tif (schema.minItems !== undefined) {\n\t\tif (data.length < schema.minItems) {\n\t\t\terror = this.createError(ErrorCodes.ARRAY_LENGTH_SHORT, {length: data.length, minimum: schema.minItems}, '', '/minItems', null, data, schema);\n\t\t\tif (this.handleError(error)) {\n\t\t\t\treturn error;\n\t\t\t}\n\t\t}\n\t}\n\tif (schema.maxItems !== undefined) {\n\t\tif (data.length > schema.maxItems) {\n\t\t\terror = this.createError(ErrorCodes.ARRAY_LENGTH_LONG, {length: data.length, maximum: schema.maxItems}, '', '/maxItems', null, data, schema);\n\t\t\tif (this.handleError(error)) {\n\t\t\t\treturn error;\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateArrayUniqueItems = function validateArrayUniqueItems(data, schema) {\n\tif (schema.uniqueItems) {\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tfor (var j = i + 1; j < data.length; j++) {\n\t\t\t\tif (recursiveCompare(data[i], data[j])) {\n\t\t\t\t\tvar error = this.createError(ErrorCodes.ARRAY_UNIQUE, {match1: i, match2: j}, '', '/uniqueItems', null, data, schema);\n\t\t\t\t\tif (this.handleError(error)) {\n\t\t\t\t\t\treturn error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateArrayItems = function validateArrayItems(data, schema, dataPointerPath) {\n\tif (schema.items === undefined) {\n\t\treturn null;\n\t}\n\tvar error, i;\n\tif (Array.isArray(schema.items)) {\n\t\tfor (i = 0; i < data.length; i++) {\n\t\t\tif (i < schema.items.length) {\n\t\t\t\tif (error = this.validateAll(data[i], schema.items[i], [i], [\"items\", i], dataPointerPath + \"/\" + i)) {\n\t\t\t\t\treturn error;\n\t\t\t\t}\n\t\t\t} else if (schema.additionalItems !== undefined) {\n\t\t\t\tif (typeof schema.additionalItems === \"boolean\") {\n\t\t\t\t\tif (!schema.additionalItems) {\n\t\t\t\t\t\terror = (this.createError(ErrorCodes.ARRAY_ADDITIONAL_ITEMS, {}, '/' + i, '/additionalItems', null, data, schema));\n\t\t\t\t\t\tif (this.handleError(error)) {\n\t\t\t\t\t\t\treturn error;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (error = this.validateAll(data[i], schema.additionalItems, [i], [\"additionalItems\"], dataPointerPath + \"/\" + i)) {\n\t\t\t\t\treturn error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < data.length; i++) {\n\t\t\tif (error = this.validateAll(data[i], schema.items, [i], [\"items\"], dataPointerPath + \"/\" + i)) {\n\t\t\t\treturn error;\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateObject = function validateObject(data, schema, dataPointerPath) {\n\tif (typeof data !== \"object\" || data === null || Array.isArray(data)) {\n\t\treturn null;\n\t}\n\treturn this.validateObjectMinMaxProperties(data, schema, dataPointerPath)\n\t\t|| this.validateObjectRequiredProperties(data, schema, dataPointerPath)\n\t\t|| this.validateObjectProperties(data, schema, dataPointerPath)\n\t\t|| this.validateObjectDependencies(data, schema, dataPointerPath)\n\t\t|| null;\n};\n\nValidatorContext.prototype.validateObjectMinMaxProperties = function validateObjectMinMaxProperties(data, schema) {\n\tvar keys = Object.keys(data);\n\tvar error;\n\tif (schema.minProperties !== undefined) {\n\t\tif (keys.length < schema.minProperties) {\n\t\t\terror = this.createError(ErrorCodes.OBJECT_PROPERTIES_MINIMUM, {propertyCount: keys.length, minimum: schema.minProperties}, '', '/minProperties', null, data, schema);\n\t\t\tif (this.handleError(error)) {\n\t\t\t\treturn error;\n\t\t\t}\n\t\t}\n\t}\n\tif (schema.maxProperties !== undefined) {\n\t\tif (keys.length > schema.maxProperties) {\n\t\t\terror = this.createError(ErrorCodes.OBJECT_PROPERTIES_MAXIMUM, {propertyCount: keys.length, maximum: schema.maxProperties}, '', '/maxProperties', null, data, schema);\n\t\t\tif (this.handleError(error)) {\n\t\t\t\treturn error;\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateObjectRequiredProperties = function validateObjectRequiredProperties(data, schema) {\n\tif (schema.required !== undefined) {\n\t\tfor (var i = 0; i < schema.required.length; i++) {\n\t\t\tvar key = schema.required[i];\n\t\t\tif (data[key] === undefined) {\n\t\t\t\tvar error = this.createError(ErrorCodes.OBJECT_REQUIRED, {key: key}, '', '/required/' + i, null, data, schema);\n\t\t\t\tif (this.handleError(error)) {\n\t\t\t\t\treturn error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateObjectProperties = function validateObjectProperties(data, schema, dataPointerPath) {\n\tvar error;\n\tfor (var key in data) {\n\t\tvar keyPointerPath = dataPointerPath + \"/\" + key.replace(/~/g, '~0').replace(/\\//g, '~1');\n\t\tvar foundMatch = false;\n\t\tif (schema.properties !== undefined && schema.properties[key] !== undefined) {\n\t\t\tfoundMatch = true;\n\t\t\tif (error = this.validateAll(data[key], schema.properties[key], [key], [\"properties\", key], keyPointerPath)) {\n\t\t\t\treturn error;\n\t\t\t}\n\t\t}\n\t\tif (schema.patternProperties !== undefined) {\n\t\t\tfor (var patternKey in schema.patternProperties) {\n\t\t\t\tvar regexp = new RegExp(patternKey);\n\t\t\t\tif (regexp.test(key)) {\n\t\t\t\t\tfoundMatch = true;\n\t\t\t\t\tif (error = this.validateAll(data[key], schema.patternProperties[patternKey], [key], [\"patternProperties\", patternKey], keyPointerPath)) {\n\t\t\t\t\t\treturn error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!foundMatch) {\n\t\t\tif (schema.additionalProperties !== undefined) {\n\t\t\t\tif (this.trackUnknownProperties) {\n\t\t\t\t\tthis.knownPropertyPaths[keyPointerPath] = true;\n\t\t\t\t\tdelete this.unknownPropertyPaths[keyPointerPath];\n\t\t\t\t}\n\t\t\t\tif (typeof schema.additionalProperties === \"boolean\") {\n\t\t\t\t\tif (!schema.additionalProperties) {\n\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_ADDITIONAL_PROPERTIES, {key: key}, '', '/additionalProperties', null, data, schema).prefixWith(key, null);\n\t\t\t\t\t\tif (this.handleError(error)) {\n\t\t\t\t\t\t\treturn error;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (error = this.validateAll(data[key], schema.additionalProperties, [key], [\"additionalProperties\"], keyPointerPath)) {\n\t\t\t\t\t\treturn error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (this.trackUnknownProperties && !this.knownPropertyPaths[keyPointerPath]) {\n\t\t\t\tthis.unknownPropertyPaths[keyPointerPath] = true;\n\t\t\t}\n\t\t} else if (this.trackUnknownProperties) {\n\t\t\tthis.knownPropertyPaths[keyPointerPath] = true;\n\t\t\tdelete this.unknownPropertyPaths[keyPointerPath];\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateObjectDependencies = function validateObjectDependencies(data, schema, dataPointerPath) {\n\tvar error;\n\tif (schema.dependencies !== undefined) {\n\t\tfor (var depKey in schema.dependencies) {\n\t\t\tif (data[depKey] !== undefined) {\n\t\t\t\tvar dep = schema.dependencies[depKey];\n\t\t\t\tif (typeof dep === \"string\") {\n\t\t\t\t\tif (data[dep] === undefined) {\n\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: dep}, '', '', null, data, schema).prefixWith(null, depKey).prefixWith(null, \"dependencies\");\n\t\t\t\t\t\tif (this.handleError(error)) {\n\t\t\t\t\t\t\treturn error;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (Array.isArray(dep)) {\n\t\t\t\t\tfor (var i = 0; i < dep.length; i++) {\n\t\t\t\t\t\tvar requiredKey = dep[i];\n\t\t\t\t\t\tif (data[requiredKey] === undefined) {\n\t\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: requiredKey}, '', '/' + i, null, data, schema).prefixWith(null, depKey).prefixWith(null, \"dependencies\");\n\t\t\t\t\t\t\tif (this.handleError(error)) {\n\t\t\t\t\t\t\t\treturn error;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (error = this.validateAll(data, dep, [], [\"dependencies\", depKey], dataPointerPath)) {\n\t\t\t\t\t\treturn error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateCombinations = function validateCombinations(data, schema, dataPointerPath) {\n\treturn this.validateAllOf(data, schema, dataPointerPath)\n\t\t|| this.validateAnyOf(data, schema, dataPointerPath)\n\t\t|| this.validateOneOf(data, schema, dataPointerPath)\n\t\t|| this.validateNot(data, schema, dataPointerPath)\n\t\t|| null;\n};\n\nValidatorContext.prototype.validateAllOf = function validateAllOf(data, schema, dataPointerPath) {\n\tif (schema.allOf === undefined) {\n\t\treturn null;\n\t}\n\tvar error;\n\tfor (var i = 0; i < schema.allOf.length; i++) {\n\t\tvar subSchema = schema.allOf[i];\n\t\tif (error = this.validateAll(data, subSchema, [], [\"allOf\", i], dataPointerPath)) {\n\t\t\treturn error;\n\t\t}\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateAnyOf = function validateAnyOf(data, schema, dataPointerPath) {\n\tif (schema.anyOf === undefined) {\n\t\treturn null;\n\t}\n\tvar errors = [];\n\tvar startErrorCount = this.errors.length;\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\n\tif (this.trackUnknownProperties) {\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\n\t}\n\tvar errorAtEnd = true;\n\tfor (var i = 0; i < schema.anyOf.length; i++) {\n\t\tif (this.trackUnknownProperties) {\n\t\t\tthis.unknownPropertyPaths = {};\n\t\t\tthis.knownPropertyPaths = {};\n\t\t}\n\t\tvar subSchema = schema.anyOf[i];\n\n\t\tvar errorCount = this.errors.length;\n\t\tvar error = this.validateAll(data, subSchema, [], [\"anyOf\", i], dataPointerPath);\n\n\t\tif (error === null && errorCount === this.errors.length) {\n\t\t\tthis.errors = this.errors.slice(0, startErrorCount);\n\n\t\t\tif (this.trackUnknownProperties) {\n\t\t\t\tfor (var knownKey in this.knownPropertyPaths) {\n\t\t\t\t\toldKnownPropertyPaths[knownKey] = true;\n\t\t\t\t\tdelete oldUnknownPropertyPaths[knownKey];\n\t\t\t\t}\n\t\t\t\tfor (var unknownKey in this.unknownPropertyPaths) {\n\t\t\t\t\tif (!oldKnownPropertyPaths[unknownKey]) {\n\t\t\t\t\t\toldUnknownPropertyPaths[unknownKey] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// We need to continue looping so we catch all the property definitions, but we don't want to return an error\n\t\t\t\terrorAtEnd = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t\tif (error) {\n\t\t\terrors.push(error.prefixWith(null, \"\" + i).prefixWith(null, \"anyOf\"));\n\t\t}\n\t}\n\tif (this.trackUnknownProperties) {\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\n\t}\n\tif (errorAtEnd) {\n\t\terrors = errors.concat(this.errors.slice(startErrorCount));\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\n\t\treturn this.createError(ErrorCodes.ANY_OF_MISSING, {}, \"\", \"/anyOf\", errors, data, schema);\n\t}\n};\n\nValidatorContext.prototype.validateOneOf = function validateOneOf(data, schema, dataPointerPath) {\n\tif (schema.oneOf === undefined) {\n\t\treturn null;\n\t}\n\tvar validIndex = null;\n\tvar errors = [];\n\tvar startErrorCount = this.errors.length;\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\n\tif (this.trackUnknownProperties) {\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\n\t}\n\tfor (var i = 0; i < schema.oneOf.length; i++) {\n\t\tif (this.trackUnknownProperties) {\n\t\t\tthis.unknownPropertyPaths = {};\n\t\t\tthis.knownPropertyPaths = {};\n\t\t}\n\t\tvar subSchema = schema.oneOf[i];\n\n\t\tvar errorCount = this.errors.length;\n\t\tvar error = this.validateAll(data, subSchema, [], [\"oneOf\", i], dataPointerPath);\n\n\t\tif (error === null && errorCount === this.errors.length) {\n\t\t\tif (validIndex === null) {\n\t\t\t\tvalidIndex = i;\n\t\t\t} else {\n\t\t\t\tthis.errors = this.errors.slice(0, startErrorCount);\n\t\t\t\treturn this.createError(ErrorCodes.ONE_OF_MULTIPLE, {index1: validIndex, index2: i}, \"\", \"/oneOf\", null, data, schema);\n\t\t\t}\n\t\t\tif (this.trackUnknownProperties) {\n\t\t\t\tfor (var knownKey in this.knownPropertyPaths) {\n\t\t\t\t\toldKnownPropertyPaths[knownKey] = true;\n\t\t\t\t\tdelete oldUnknownPropertyPaths[knownKey];\n\t\t\t\t}\n\t\t\t\tfor (var unknownKey in this.unknownPropertyPaths) {\n\t\t\t\t\tif (!oldKnownPropertyPaths[unknownKey]) {\n\t\t\t\t\t\toldUnknownPropertyPaths[unknownKey] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t}\n\tif (this.trackUnknownProperties) {\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\n\t}\n\tif (validIndex === null) {\n\t\terrors = errors.concat(this.errors.slice(startErrorCount));\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\n\t\treturn this.createError(ErrorCodes.ONE_OF_MISSING, {}, \"\", \"/oneOf\", errors, data, schema);\n\t} else {\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateNot = function validateNot(data, schema, dataPointerPath) {\n\tif (schema.not === undefined) {\n\t\treturn null;\n\t}\n\tvar oldErrorCount = this.errors.length;\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\n\tif (this.trackUnknownProperties) {\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\n\t\tthis.unknownPropertyPaths = {};\n\t\tthis.knownPropertyPaths = {};\n\t}\n\tvar error = this.validateAll(data, schema.not, null, null, dataPointerPath);\n\tvar notErrors = this.errors.slice(oldErrorCount);\n\tthis.errors = this.errors.slice(0, oldErrorCount);\n\tif (this.trackUnknownProperties) {\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\n\t}\n\tif (error === null && notErrors.length === 0) {\n\t\treturn this.createError(ErrorCodes.NOT_PASSED, {}, \"\", \"/not\", null, data, schema);\n\t}\n\treturn null;\n};\n\nValidatorContext.prototype.validateHypermedia = function validateCombinations(data, schema, dataPointerPath) {\n\tif (!schema.links) {\n\t\treturn null;\n\t}\n\tvar error;\n\tfor (var i = 0; i < schema.links.length; i++) {\n\t\tvar ldo = schema.links[i];\n\t\tif (ldo.rel === \"describedby\") {\n\t\t\tvar template = new UriTemplate(ldo.href);\n\t\t\tvar allPresent = true;\n\t\t\tfor (var j = 0; j < template.varNames.length; j++) {\n\t\t\t\tif (!(template.varNames[j] in data)) {\n\t\t\t\t\tallPresent = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (allPresent) {\n\t\t\t\tvar schemaUrl = template.fillFromObject(data);\n\t\t\t\tvar subSchema = {\"$ref\": schemaUrl};\n\t\t\t\tif (error = this.validateAll(data, subSchema, [], [\"links\", i], dataPointerPath)) {\n\t\t\t\t\treturn error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// parseURI() and resolveUrl() are from https://gist.github.com/1088850\n// - released as public domain by author (\"Yaffle\") - see comments on gist\n\nfunction parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}\n\nfunction resolveUrl(base, href) {// RFC 3986\n\n\tfunction removeDotSegments(input) {\n\t\tvar output = [];\n\t\tinput.replace(/^(\\.\\.?(\\/|$))+/, '')\n\t\t\t.replace(/\\/(\\.(\\/|$))+/g, '/')\n\t\t\t.replace(/\\/\\.\\.$/, '/../')\n\t\t\t.replace(/\\/?[^\\/]*/g, function (p) {\n\t\t\t\tif (p === '/..') {\n\t\t\t\t\toutput.pop();\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(p);\n\t\t\t\t}\n\t\t});\n\t\treturn output.join('').replace(/^\\//, input.charAt(0) === '/' ? '/' : '');\n\t}\n\n\thref = parseURI(href || '');\n\tbase = parseURI(base || '');\n\n\treturn !href || !base ? null : (href.protocol || base.protocol) +\n\t\t(href.protocol || href.authority ? href.authority : base.authority) +\n\t\tremoveDotSegments(href.protocol || href.authority || href.pathname.charAt(0) === '/' ? href.pathname : (href.pathname ? ((base.authority && !base.pathname ? '/' : '') + base.pathname.slice(0, base.pathname.lastIndexOf('/') + 1) + href.pathname) : base.pathname)) +\n\t\t(href.protocol || href.authority || href.pathname ? href.search : (href.search || base.search)) +\n\t\thref.hash;\n}\n\nfunction getDocumentUri(uri) {\n\treturn uri.split('#')[0];\n}\nfunction normSchema(schema, baseUri) {\n\tif (schema && typeof schema === \"object\") {\n\t\tif (baseUri === undefined) {\n\t\t\tbaseUri = schema.id;\n\t\t} else if (typeof schema.id === \"string\") {\n\t\t\tbaseUri = resolveUrl(baseUri, schema.id);\n\t\t\tschema.id = baseUri;\n\t\t}\n\t\tif (Array.isArray(schema)) {\n\t\t\tfor (var i = 0; i < schema.length; i++) {\n\t\t\t\tnormSchema(schema[i], baseUri);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof schema['$ref'] === \"string\") {\n\t\t\t\tschema['$ref'] = resolveUrl(baseUri, schema['$ref']);\n\t\t\t}\n\t\t\tfor (var key in schema) {\n\t\t\t\tif (key !== \"enum\") {\n\t\t\t\t\tnormSchema(schema[key], baseUri);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction defaultErrorReporter(language) {\n\tlanguage = language || 'en';\n\n\tvar errorMessages = languages[language];\n\n\treturn function (error) {\n\t\tvar messageTemplate = errorMessages[error.code] || ErrorMessagesDefault[error.code];\n\t\tif (typeof messageTemplate !== 'string') {\n\t\t\treturn \"Unknown error code \" + error.code + \": \" + JSON.stringify(error.messageParams);\n\t\t}\n\t\tvar messageParams = error.params;\n\t\t// Adapted from Crockford's supplant()\n\t\treturn messageTemplate.replace(/\\{([^{}]*)\\}/g, function (whole, varName) {\n\t\t\tvar subValue = messageParams[varName];\n\t\t\treturn typeof subValue === 'string' || typeof subValue === 'number' ? subValue : whole;\n\t\t});\n\t};\n}\n\nvar ErrorCodes = {\n\tINVALID_TYPE: 0,\n\tENUM_MISMATCH: 1,\n\tANY_OF_MISSING: 10,\n\tONE_OF_MISSING: 11,\n\tONE_OF_MULTIPLE: 12,\n\tNOT_PASSED: 13,\n\t// Numeric errors\n\tNUMBER_MULTIPLE_OF: 100,\n\tNUMBER_MINIMUM: 101,\n\tNUMBER_MINIMUM_EXCLUSIVE: 102,\n\tNUMBER_MAXIMUM: 103,\n\tNUMBER_MAXIMUM_EXCLUSIVE: 104,\n\tNUMBER_NOT_A_NUMBER: 105,\n\t// String errors\n\tSTRING_LENGTH_SHORT: 200,\n\tSTRING_LENGTH_LONG: 201,\n\tSTRING_PATTERN: 202,\n\t// Object errors\n\tOBJECT_PROPERTIES_MINIMUM: 300,\n\tOBJECT_PROPERTIES_MAXIMUM: 301,\n\tOBJECT_REQUIRED: 302,\n\tOBJECT_ADDITIONAL_PROPERTIES: 303,\n\tOBJECT_DEPENDENCY_KEY: 304,\n\t// Array errors\n\tARRAY_LENGTH_SHORT: 400,\n\tARRAY_LENGTH_LONG: 401,\n\tARRAY_UNIQUE: 402,\n\tARRAY_ADDITIONAL_ITEMS: 403,\n\t// Custom/user-defined errors\n\tFORMAT_CUSTOM: 500,\n\tKEYWORD_CUSTOM: 501,\n\t// Schema structure\n\tCIRCULAR_REFERENCE: 600,\n\t// Non-standard validation options\n\tUNKNOWN_PROPERTY: 1000\n};\nvar ErrorCodeLookup = {};\nfor (var key in ErrorCodes) {\n\tErrorCodeLookup[ErrorCodes[key]] = key;\n}\nvar ErrorMessagesDefault = {\n\tINVALID_TYPE: \"Invalid type: {type} (expected {expected})\",\n\tENUM_MISMATCH: \"No enum match for: {value}\",\n\tANY_OF_MISSING: \"Data does not match any schemas from \\\"anyOf\\\"\",\n\tONE_OF_MISSING: \"Data does not match any schemas from \\\"oneOf\\\"\",\n\tONE_OF_MULTIPLE: \"Data is valid against more than one schema from \\\"oneOf\\\": indices {index1} and {index2}\",\n\tNOT_PASSED: \"Data matches schema from \\\"not\\\"\",\n\t// Numeric errors\n\tNUMBER_MULTIPLE_OF: \"Value {value} is not a multiple of {multipleOf}\",\n\tNUMBER_MINIMUM: \"Value {value} is less than minimum {minimum}\",\n\tNUMBER_MINIMUM_EXCLUSIVE: \"Value {value} is equal to exclusive minimum {minimum}\",\n\tNUMBER_MAXIMUM: \"Value {value} is greater than maximum {maximum}\",\n\tNUMBER_MAXIMUM_EXCLUSIVE: \"Value {value} is equal to exclusive maximum {maximum}\",\n\tNUMBER_NOT_A_NUMBER: \"Value {value} is not a valid number\",\n\t// String errors\n\tSTRING_LENGTH_SHORT: \"String is too short ({length} chars), minimum {minimum}\",\n\tSTRING_LENGTH_LONG: \"String is too long ({length} chars), maximum {maximum}\",\n\tSTRING_PATTERN: \"String does not match pattern: {pattern}\",\n\t// Object errors\n\tOBJECT_PROPERTIES_MINIMUM: \"Too few properties defined ({propertyCount}), minimum {minimum}\",\n\tOBJECT_PROPERTIES_MAXIMUM: \"Too many properties defined ({propertyCount}), maximum {maximum}\",\n\tOBJECT_REQUIRED: \"Missing required property: {key}\",\n\tOBJECT_ADDITIONAL_PROPERTIES: \"Additional properties not allowed\",\n\tOBJECT_DEPENDENCY_KEY: \"Dependency failed - key must exist: {missing} (due to key: {key})\",\n\t// Array errors\n\tARRAY_LENGTH_SHORT: \"Array is too short ({length}), minimum {minimum}\",\n\tARRAY_LENGTH_LONG: \"Array is too long ({length}), maximum {maximum}\",\n\tARRAY_UNIQUE: \"Array items are not unique (indices {match1} and {match2})\",\n\tARRAY_ADDITIONAL_ITEMS: \"Additional items not allowed\",\n\t// Format errors\n\tFORMAT_CUSTOM: \"Format validation failed ({message})\",\n\tKEYWORD_CUSTOM: \"Keyword failed: {key} ({message})\",\n\t// Schema structure\n\tCIRCULAR_REFERENCE: \"Circular $refs: {urls}\",\n\t// Non-standard validation options\n\tUNKNOWN_PROPERTY: \"Unknown property (not in schema)\"\n};\n\nfunction ValidationError(code, params, dataPath, schemaPath, subErrors) {\n\tError.call(this);\n\tif (code === undefined) {\n\t\tthrow new Error (\"No error code supplied: \" + schemaPath);\n\t}\n\tthis.message = '';\n\tthis.params = params;\n\tthis.code = code;\n\tthis.dataPath = dataPath || \"\";\n\tthis.schemaPath = schemaPath || \"\";\n\tthis.subErrors = subErrors || null;\n\n\tvar err = new Error(this.message);\n\tthis.stack = err.stack || err.stacktrace;\n\tif (!this.stack) {\n\t\ttry {\n\t\t\tthrow err;\n\t\t}\n\t\tcatch(err) {\n\t\t\tthis.stack = err.stack || err.stacktrace;\n\t\t}\n\t}\n}\nValidationError.prototype = Object.create(Error.prototype);\nValidationError.prototype.constructor = ValidationError;\nValidationError.prototype.name = 'ValidationError';\n\nValidationError.prototype.prefixWith = function (dataPrefix, schemaPrefix) {\n\tif (dataPrefix !== null) {\n\t\tdataPrefix = dataPrefix.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n\t\tthis.dataPath = \"/\" + dataPrefix + this.dataPath;\n\t}\n\tif (schemaPrefix !== null) {\n\t\tschemaPrefix = schemaPrefix.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n\t\tthis.schemaPath = \"/\" + schemaPrefix + this.schemaPath;\n\t}\n\tif (this.subErrors !== null) {\n\t\tfor (var i = 0; i < this.subErrors.length; i++) {\n\t\t\tthis.subErrors[i].prefixWith(dataPrefix, schemaPrefix);\n\t\t}\n\t}\n\treturn this;\n};\n\nfunction isTrustedUrl(baseUrl, testUrl) {\n\tif(testUrl.substring(0, baseUrl.length) === baseUrl){\n\t\tvar remainder = testUrl.substring(baseUrl.length);\n\t\tif ((testUrl.length > 0 && testUrl.charAt(baseUrl.length - 1) === \"/\")\n\t\t\t|| remainder.charAt(0) === \"#\"\n\t\t\t|| remainder.charAt(0) === \"?\") {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nvar languages = {};\nfunction createApi(language) {\n\tvar globalContext = new ValidatorContext();\n\tvar currentLanguage;\n\tvar customErrorReporter;\n\tvar api = {\n\t\tsetErrorReporter: function (reporter) {\n\t\t\tif (typeof reporter === 'string') {\n\t\t\t\treturn this.language(reporter);\n\t\t\t}\n\t\t\tcustomErrorReporter = reporter;\n\t\t\treturn true;\n\t\t},\n\t\taddFormat: function () {\n\t\t\tglobalContext.addFormat.apply(globalContext, arguments);\n\t\t},\n\t\tlanguage: function (code) {\n\t\t\tif (!code) {\n\t\t\t\treturn currentLanguage;\n\t\t\t}\n\t\t\tif (!languages[code]) {\n\t\t\t\tcode = code.split('-')[0]; // fall back to base language\n\t\t\t}\n\t\t\tif (languages[code]) {\n\t\t\t\tcurrentLanguage = code;\n\t\t\t\treturn code; // so you can tell if fall-back has happened\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\taddLanguage: function (code, messageMap) {\n\t\t\tvar key;\n\t\t\tfor (key in ErrorCodes) {\n\t\t\t\tif (messageMap[key] && !messageMap[ErrorCodes[key]]) {\n\t\t\t\t\tmessageMap[ErrorCodes[key]] = messageMap[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar rootCode = code.split('-')[0];\n\t\t\tif (!languages[rootCode]) { // use for base language if not yet defined\n\t\t\t\tlanguages[code] = messageMap;\n\t\t\t\tlanguages[rootCode] = messageMap;\n\t\t\t} else {\n\t\t\t\tlanguages[code] = Object.create(languages[rootCode]);\n\t\t\t\tfor (key in messageMap) {\n\t\t\t\t\tif (typeof languages[rootCode][key] === 'undefined') {\n\t\t\t\t\t\tlanguages[rootCode][key] = messageMap[key];\n\t\t\t\t\t}\n\t\t\t\t\tlanguages[code][key] = messageMap[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\tfreshApi: function (language) {\n\t\t\tvar result = createApi();\n\t\t\tif (language) {\n\t\t\t\tresult.language(language);\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\tvalidate: function (data, schema, checkRecursive, banUnknownProperties) {\n\t\t\tvar def = defaultErrorReporter(currentLanguage);\n\t\t\tvar errorReporter = customErrorReporter ? function (error, data, schema) {\n\t\t\t\treturn customErrorReporter(error, data, schema) || def(error, data, schema);\n\t\t\t} : def;\n\t\t\tvar context = new ValidatorContext(globalContext, false, errorReporter, checkRecursive, banUnknownProperties);\n\t\t\tif (typeof schema === \"string\") {\n\t\t\t\tschema = {\"$ref\": schema};\n\t\t\t}\n\t\t\tcontext.addSchema(\"\", schema);\n\t\t\tvar error = context.validateAll(data, schema, null, null, \"\");\n\t\t\tif (!error && banUnknownProperties) {\n\t\t\t\terror = context.banUnknownProperties(data, schema);\n\t\t\t}\n\t\t\tthis.error = error;\n\t\t\tthis.missing = context.missing;\n\t\t\tthis.valid = (error === null);\n\t\t\treturn this.valid;\n\t\t},\n\t\tvalidateResult: function () {\n\t\t\tvar result = {};\n\t\t\tthis.validate.apply(result, arguments);\n\t\t\treturn result;\n\t\t},\n\t\tvalidateMultiple: function (data, schema, checkRecursive, banUnknownProperties) {\n\t\t\tvar def = defaultErrorReporter(currentLanguage);\n\t\t\tvar errorReporter = customErrorReporter ? function (error, data, schema) {\n\t\t\t\treturn customErrorReporter(error, data, schema) || def(error, data, schema);\n\t\t\t} : def;\n\t\t\tvar context = new ValidatorContext(globalContext, true, errorReporter, checkRecursive, banUnknownProperties);\n\t\t\tif (typeof schema === \"string\") {\n\t\t\t\tschema = {\"$ref\": schema};\n\t\t\t}\n\t\t\tcontext.addSchema(\"\", schema);\n\t\t\tcontext.validateAll(data, schema, null, null, \"\");\n\t\t\tif (banUnknownProperties) {\n\t\t\t\tcontext.banUnknownProperties(data, schema);\n\t\t\t}\n\t\t\tvar result = {};\n\t\t\tresult.errors = context.errors;\n\t\t\tresult.missing = context.missing;\n\t\t\tresult.valid = (result.errors.length === 0);\n\t\t\treturn result;\n\t\t},\n\t\taddSchema: function () {\n\t\t\treturn globalContext.addSchema.apply(globalContext, arguments);\n\t\t},\n\t\tgetSchema: function () {\n\t\t\treturn globalContext.getSchema.apply(globalContext, arguments);\n\t\t},\n\t\tgetSchemaMap: function () {\n\t\t\treturn globalContext.getSchemaMap.apply(globalContext, arguments);\n\t\t},\n\t\tgetSchemaUris: function () {\n\t\t\treturn globalContext.getSchemaUris.apply(globalContext, arguments);\n\t\t},\n\t\tgetMissingUris: function () {\n\t\t\treturn globalContext.getMissingUris.apply(globalContext, arguments);\n\t\t},\n\t\tdropSchemas: function () {\n\t\t\tglobalContext.dropSchemas.apply(globalContext, arguments);\n\t\t},\n\t\tdefineKeyword: function () {\n\t\t\tglobalContext.defineKeyword.apply(globalContext, arguments);\n\t\t},\n\t\tdefineError: function (codeName, codeNumber, defaultMessage) {\n\t\t\tif (typeof codeName !== 'string' || !/^[A-Z]+(_[A-Z]+)*$/.test(codeName)) {\n\t\t\t\tthrow new Error('Code name must be a string in UPPER_CASE_WITH_UNDERSCORES');\n\t\t\t}\n\t\t\tif (typeof codeNumber !== 'number' || codeNumber%1 !== 0 || codeNumber < 10000) {\n\t\t\t\tthrow new Error('Code number must be an integer > 10000');\n\t\t\t}\n\t\t\tif (typeof ErrorCodes[codeName] !== 'undefined') {\n\t\t\t\tthrow new Error('Error already defined: ' + codeName + ' as ' + ErrorCodes[codeName]);\n\t\t\t}\n\t\t\tif (typeof ErrorCodeLookup[codeNumber] !== 'undefined') {\n\t\t\t\tthrow new Error('Error code already used: ' + ErrorCodeLookup[codeNumber] + ' as ' + codeNumber);\n\t\t\t}\n\t\t\tErrorCodes[codeName] = codeNumber;\n\t\t\tErrorCodeLookup[codeNumber] = codeName;\n\t\t\tErrorMessagesDefault[codeName] = ErrorMessagesDefault[codeNumber] = defaultMessage;\n\t\t\tfor (var langCode in languages) {\n\t\t\t\tvar language = languages[langCode];\n\t\t\t\tif (language[codeName]) {\n\t\t\t\t\tlanguage[codeNumber] = language[codeNumber] || language[codeName];\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\treset: function () {\n\t\t\tglobalContext.reset();\n\t\t\tthis.error = null;\n\t\t\tthis.missing = [];\n\t\t\tthis.valid = true;\n\t\t},\n\t\tmissing: [],\n\t\terror: null,\n\t\tvalid: true,\n\t\tnormSchema: normSchema,\n\t\tresolveUrl: resolveUrl,\n\t\tgetDocumentUri: getDocumentUri,\n\t\terrorCodes: ErrorCodes\n\t};\n\tapi.language(language || 'en');\n\treturn api;\n}\n\nvar tv4 = createApi();\ntv4.addLanguage('en-gb', ErrorMessagesDefault);\n\n//legacy property\ntv4.tv4 = tv4;\n\nreturn tv4; // used by _header.js to globalise.\n\n}));"],"sourceRoot":""}