UNPKG

openapi-gui

Version:

GUI / visual editor for creating and editing OpenApi / Swagger definitions

30 lines 626 kB
/*! * jsoneditor.js * * @brief * JSONEditor is a web-based tool to view, edit, format, and validate JSON. * It has various modes such as a tree editor, a code editor, and a plain text * editor. * * Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+ * * @license * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. * * Copyright (c) 2011-2017 Jos de Jong, http://jsoneditoronline.org * * @author Jos de Jong, <wjosdejong@gmail.com> * @version 5.7.2 * @date 2017-06-27 */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONEditor=t():e.JSONEditor=t()}(this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";function n(e,t,i){if(!(this instanceof n))throw new Error('JSONEditor constructor called without "new".');var r=a.getInternetExplorerVersion();if(-1!=r&&r<9)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");if(t&&(t.error&&(console.warn('Option "error" has been renamed to "onError"'),t.onError=t.error,delete t.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,delete t.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,delete t.editable),t)){var o=["ace","theme","ajv","schema","templates","onChange","onEditable","onError","onModeChange","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys"];Object.keys(t).forEach(function(e){-1===o.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')})}arguments.length&&this._create(e,t,i)}var r;try{r=i(1)}catch(e){}var o=i(54),s=i(65),a=i(57);n.modes={},n.prototype.DEBOUNCE_INTERVAL=150,n.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};var n=this.options.mode||"tree";this.setMode(n)},n.prototype.destroy=function(){},n.prototype.set=function(e){this.json=e},n.prototype.get=function(){return this.json},n.prototype.setText=function(e){this.json=a.parse(e)},n.prototype.getText=function(){return JSON.stringify(this.json)},n.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},n.prototype.getName=function(){return this.options&&this.options.name},n.prototype.setMode=function(e){var t,i,r=this.container,o=a.extend({},this.options),s=o.mode;o.mode=e;var l=n.modes[e];if(!l)throw new Error('Unknown mode "'+o.mode+'"');try{var c="text"==l.data;if(i=this.getName(),t=this[c?"getText":"get"](),this.destroy(),a.clear(this),a.extend(this,l.mixin),this.create(r,o),this.setName(i),this[c?"setText":"set"](t),"function"==typeof l.load)try{l.load.call(this)}catch(e){console.error(e)}if("function"==typeof o.onModeChange&&e!==s)try{o.onModeChange(e,s)}catch(e){console.error(e)}}catch(e){this._onError(e)}},n.prototype.getMode=function(){return this.options.mode},n.prototype._onError=function(e){if(!this.options||"function"!=typeof this.options.onError)throw e;this.options.onError(e)},n.prototype.setSchema=function(e){if(e){var t;try{t=this.options.ajv||r({allErrors:!0,verbose:!0})}catch(e){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}t&&(this.validateSchema=t.compile(e),this.options.schema=e,this.validate()),this.refresh()}else this.validateSchema=null,this.options.schema=null,this.validate(),this.refresh()},n.prototype.validate=function(){},n.prototype.refresh=function(){},n.registerMode=function(e){var t,i;if(a.isArray(e))for(t=0;t<e.length;t++)n.registerMode(e[t]);else{if(!("mode"in e))throw new Error('Property "mode" missing');if(!("mixin"in e))throw new Error('Property "mixin" missing');if(!("data"in e))throw new Error('Property "data" missing');var r=e.mode;if(r in n.modes)throw new Error('Mode "'+r+'" already registered');if("function"!=typeof e.mixin.create)throw new Error('Required function "create" missing on mixin');var o=["setMode","registerMode","modes"];for(t=0;t<o.length;t++)if((i=o[t])in e.mixin)throw new Error('Reserved property "'+i+'" not allowed in mixin');n.modes[r]=e}},n.registerMode(o),n.registerMode(s),e.exports=n},function(e,t,i){"use strict";function n(e){if(!(this instanceof n))return new n(e);e=this._opts=O.copy(e)||{},this._schemas={},this._refs={},this._fragments={},this._formats=R(e.format);var t=this._schemaUriFormat=this._formats["uri-reference"];this._schemaUriFormatFunc=function(e){return t.test(e)},this._cache=e.cache||new B,this._loadingSchemas={},this._compilations=[],this.RULES=T(),this._getId=v(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=L),this._metaOpts=$(this),e.formats&&x(this),b(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),F(this),e.patternGroups&&M(this)}function r(e,t){var i;if("string"==typeof e){if(!(i=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var n=this._addSchema(e);i=n.validate||this._compile(n)}var r=i(t);return!0===i.$async?"*"==this._opts.async?N(r):r:(this.errors=i.errors,r)}function o(e,t){var i=this._addSchema(e,void 0,t);return i.validate||this._compile(i)}function s(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addSchema(e[r],void 0,i,n);else{var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");t=k.normalizeId(t||o),S(this,t),this._schemas[t]=this._addSchema(e,i,n,!0)}}function a(e,t,i){this.addSchema(e,t,i,!0)}function l(e,t){var i=e.$schema;if(void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(!(i=i||this._opts.defaultMeta||c(this)))return console.warn("meta-schema not available"),this.errors=null,!0;var n=this._formats.uri;this._formats.uri="function"==typeof n?this._schemaUriFormatFunc:this._schemaUriFormat;var r;try{r=this.validate(i,e)}finally{this._formats.uri=n}if(!r&&t){var o="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(o);console.error(o)}return r}function c(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(W)?W:void 0,e._opts.defaultMeta}function h(e){var t=d(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return u(this,e)}}function u(e,t){var i=k.schema.call(e,{schema:{}},t);if(i){var n=i.schema,r=i.root,o=i.baseId,s=D.call(e,n,r,void 0,o);return e._fragments[t]=new _({ref:t,fragment:!0,schema:n,root:r,baseId:o,validate:s}),s}}function d(e,t){return t=k.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function f(e){if(e instanceof RegExp)return p(this,this._schemas,e),void p(this,this._refs,e);switch(typeof e){case"undefined":return p(this,this._schemas),p(this,this._refs),void this._cache.clear();case"string":var t=d(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],void delete this._refs[e];case"object":var i=this._opts.serialize,n=i?i(e):e;this._cache.del(n);var r=this._getId(e);r&&(r=k.normalizeId(r),delete this._schemas[r],delete this._refs[r])}}function p(e,t,i){for(var n in t){var r=t[n];r.meta||i&&!i.test(n)||(e._cache.del(r.cacheKey),delete t[n])}}function g(e,t,i,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var r=this._opts.serialize,o=r?r(e):e,s=this._cache.get(o);if(s)return s;n=n||!1!==this._opts.addUsedSchema;var a=k.normalizeId(this._getId(e));a&&n&&S(this,a);var l,c=!1!==this._opts.validateSchema&&!t;c&&!(l=a&&a==k.normalizeId(e.$schema))&&this.validateSchema(e,!0);var h=k.ids.call(this,e),u=new _({id:a,schema:e,localRefs:h,cacheKey:o,meta:i});return"#"!=a[0]&&n&&(this._refs[a]=u),this._cache.put(o,u),c&&l&&this.validateSchema(e,!0),u}function m(e,t){function i(){var t=e.validate,n=t.apply(null,arguments);return i.errors=t.errors,n}if(e.compiling)return e.validate=i,i.schema=e.schema,i.errors=null,i.root=t||i,!0===e.schema.$async&&(i.$async=!0),i;e.compiling=!0;var n;e.meta&&(n=this._opts,this._opts=this._metaOpts);var r;try{r=D.call(this,e.schema,t,e.localRefs)}finally{e.compiling=!1,e.meta&&(this._opts=n)}return e.validate=r,e.refs=r.refs,e.refVal=r.refVal,e.root=r.root,r}function v(e){switch(e.schemaId){case"$id":return y;case"id":return w;default:return A}}function w(e){return e.$id&&console.warn("schema $id ignored",e.$id),e.id}function y(e){return e.id&&console.warn("schema id ignored",e.id),e.$id}function A(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function C(e,t){if(!(e=e||this.errors))return"No errors";t=t||{};for(var i=void 0===t.separator?", ":t.separator,n=void 0===t.dataVar?"data":t.dataVar,r="",o=0;o<e.length;o++){var s=e[o];s&&(r+=n+s.dataPath+" "+s.message+i)}return r.slice(0,-i.length)}function E(e,t){"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t}function b(e){var t;if(e._opts.$data&&(t=i(52),e.addMetaSchema(t,t.$id,!0)),!1!==e._opts.meta){var n=i(53);e._opts.$data&&(n=P(n,V)),e.addMetaSchema(n,W,!0),e._refs["http://json-schema.org/schema"]=W}}function F(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var i in t)e.addSchema(t[i],i)}function x(e){for(var t in e._opts.formats){var i=e._opts.formats[t];e.addFormat(t,i)}}function S(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function $(e){for(var t=O.copy(e._opts),i=0;i<H.length;i++)delete t[H[i]];return t}var D=i(2),k=i(3),B=i(22),_=i(13),L=i(16),R=i(23),T=i(24),P=i(47),M=i(48),O=i(11),N=i(21);e.exports=n,n.prototype.validate=r,n.prototype.compile=o,n.prototype.addSchema=s,n.prototype.addMetaSchema=a,n.prototype.validateSchema=l,n.prototype.getSchema=h,n.prototype.removeSchema=f,n.prototype.addFormat=E,n.prototype.errorsText=C,n.prototype._addSchema=g,n.prototype._compile=m,n.prototype.compileAsync=i(49);var I=i(50);n.prototype.addKeyword=I.add,n.prototype.getKeyword=I.get,n.prototype.removeKeyword=I.remove;var j=i(15);n.ValidationError=j.Validation,n.MissingRefError=j.MissingRef,n.$dataMetaSchema=P;var W="http://json-schema.org/draft-06/schema",H=["removeAdditional","useDefaults","coerceTypes"],V=["/properties"]},function(e,t,i){"use strict";function n(e,t,i,s){function C(){var e=j.validate,t=e.apply(null,arguments);return C.errors=e.errors,t}function E(e,i,r,o){var s=!i||i&&i.schema==e;if(i.schema!=t.schema)return n.call(B,e,i,r,o);var g=!0===e.$async,C=m({isTop:!0,schema:e,isRoot:s,baseId:o,root:i,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:p.MissingRef,RULES:H,validate:m,util:f,resolve:d,resolveRef:b,usePattern:$,useDefault:D,useCustomRule:k,opts:_,formats:W,self:B});C=u(L,c)+u(T,a)+u(M,l)+u(N,h)+C,_.processCode&&(C=_.processCode(C));var E;try{E=new Function("self","RULES","formats","root","refVal","defaults","customRules","co","equal","ucs2length","ValidationError",C)(B,H,W,t,L,M,N,v,y,w,A),L[0]=E}catch(e){throw console.error("Error compiling schema, function code:",C),e}return E.schema=e,E.errors=null,E.refs=R,E.refVal=L,E.root=s?E:i,g&&(E.$async=!0),!0===_.sourceCode&&(E.source={code:C,patterns:T,defaults:M}),E}function b(e,r,o){r=d.url(e,r);var s,a,l=R[r];if(void 0!==l)return s=L[l],a="refVal["+l+"]",S(s,a);if(!o&&t.refs){var c=t.refs[r];if(void 0!==c)return s=t.refVal[c],a=F(r,s),S(s,a)}a=F(r);var h=d.call(B,E,t,r);if(void 0===h){var u=i&&i[r];u&&(h=d.inlineRef(u,_.inlineRefs)?u:n.call(B,u,t,i,e))}return void 0!==h?(x(r,h),S(h,a)):void 0}function F(e,t){var i=L.length;return L[i]=t,R[e]=i,"refVal"+i}function x(e,t){var i=R[e];L[i]=t}function S(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&e.$async}}function $(e){var t=P[e];return void 0===t&&(t=P[e]=T.length,T[t]=e),"pattern"+t}function D(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return f.toQuotedString(e);case"object":if(null===e)return"null";var t=g(e),i=O[t];return void 0===i&&(i=O[t]=M.length,M[i]=e),"default"+i}}function k(e,t,i,n){var r=e.definition.validateSchema;if(r&&!1!==B._opts.validateSchema){if(!r(t)){var o="keyword schema is invalid: "+B.errorsText(r.errors);if("log"!=B._opts.validateSchema)throw new Error(o);console.error(o)}}var s,a=e.definition.compile,l=e.definition.inline,c=e.definition.macro;if(a)s=a.call(B,t,i,n);else if(c)s=c.call(B,t,i,n),!1!==_.validateSchema&&B.validateSchema(s,!0);else if(l)s=l.call(B,n,e.keyword,t,i);else if(!(s=e.definition.validate))return;if(void 0===s)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=N.length;return N[h]=s,{code:"customRule"+h,validate:s}}var B=this,_=this._opts,L=[void 0],R={},T=[],P={},M=[],O={},N=[];t=t||{schema:e,refVal:L,refs:R};var I=r.call(this,e,t,s),j=this._compilations[I.index];if(I.compiling)return j.callValidate=C;var W=this._formats,H=this.RULES;try{var V=E(e,t,i,s);j.validate=V;var z=j.callValidate;return z&&(z.schema=V.schema,z.errors=null,z.refs=V.refs,z.refVal=V.refVal,z.root=V.root,z.$async=V.$async,_.sourceCode&&(z.source=V.source)),V}finally{o.call(this,e,t,s)}}function r(e,t,i){var n=s.call(this,e,t,i);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:i},{index:n,compiling:!1})}function o(e,t,i){var n=s.call(this,e,t,i);n>=0&&this._compilations.splice(n,1)}function s(e,t,i){for(var n=0;n<this._compilations.length;n++){var r=this._compilations[n];if(r.schema==e&&r.root==t&&r.baseId==i)return n}return-1}function a(e,t){return"var pattern"+e+" = new RegExp("+f.toQuotedString(t[e])+");"}function l(e){return"var default"+e+" = defaults["+e+"];"}function c(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function h(e){return"var customRule"+e+" = customRules["+e+"];"}function u(e,t){if(!e.length)return"";for(var i="",n=0;n<e.length;n++)i+=t(n,e);return i}var d=i(3),f=i(11),p=i(15),g=i(16),m=i(20),v=i(21),w=f.ucs2length,y=i(10),A=p.Validation;e.exports=n},function(e,t,i){"use strict";function n(e,t,i){var o=this._refs[i];if("string"==typeof o){if(!this._refs[o])return n.call(this,e,t,o);o=this._refs[o]}if((o=o||this._schemas[i])instanceof w)return a(o.schema,this._opts.inlineRefs)?o.schema:o.validate||this._compile(o);var s,l,c,h=r.call(this,t,i);return h&&(s=h.schema,t=h.root,c=h.baseId),s instanceof w?l=s.validate||e.call(this,s.schema,t,void 0,c):void 0!==s&&(l=a(s,this._opts.inlineRefs)?s:e.call(this,s,t,void 0,c)),l}function r(e,t){var i=g.parse(t,!1,!0),n=u(i),r=h(this._getId(e.schema));if(n!==r){var a=d(n),l=this._refs[a];if("string"==typeof l)return o.call(this,e,l,i);if(l instanceof w)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[a])instanceof w))return;if(l.validate||this._compile(l),a==d(t))return{schema:l,root:e,baseId:r};e=l}if(!e.schema)return;r=h(this._getId(e.schema))}return s.call(this,i,r,e.schema,e)}function o(e,t,i){var n=r.call(this,e,t);if(n){var o=n.schema,a=n.baseId;e=n.root;var l=this._getId(o);return l&&(a=f(a,l)),s.call(this,i,a,o,e)}}function s(e,t,i,n){if(e.hash=e.hash||"","#/"==e.hash.slice(0,2)){for(var o=e.hash.split("/"),s=1;s<o.length;s++){var a=o[s];if(a){if(a=v.unescapeFragment(a),void 0===(i=i[a]))break;var l;if(!A[a]&&(l=this._getId(i),l&&(t=f(t,l)),i.$ref)){var c=f(t,i.$ref),h=r.call(this,n,c);h&&(i=h.schema,n=h.root,t=h.baseId)}}}return void 0!==i&&i!==n.schema?{schema:i,root:n,baseId:t}:void 0}}function a(e,t){return!1!==t&&(void 0===t||!0===t?l(e):t?c(e)<=t:void 0)}function l(e){var t;if(Array.isArray(e)){for(var i=0;i<e.length;i++)if("object"==typeof(t=e[i])&&!l(t))return!1}else for(var n in e){if("$ref"==n)return!1;if("object"==typeof(t=e[n])&&!l(t))return!1}return!0}function c(e){var t,i=0;if(Array.isArray(e)){for(var n=0;n<e.length;n++)if(t=e[n],"object"==typeof t&&(i+=c(t)),i==1/0)return 1/0}else for(var r in e){if("$ref"==r)return 1/0;if(C[r])i++;else if(t=e[r],"object"==typeof t&&(i+=c(t)+1),i==1/0)return 1/0}return i}function h(e,t){return!1!==t&&(e=d(e)),u(g.parse(e,!1,!0))}function u(e){var t=e.protocol||"//"==e.href.slice(0,2)?"//":"";return(e.protocol||"")+t+(e.host||"")+(e.path||"")+"#"}function d(e){return e?e.replace(E,""):""}function f(e,t){return t=d(t),g.resolve(e,t)}function p(e){var t=d(this._getId(e)),i={"":t},n={"":h(t,!1)},r={},o=this;return y(e,{allKeys:!0},function(e,t,s,a,l,c,h){if(""!==t){var u=o._getId(e),f=i[a],p=n[a]+"/"+l;if(void 0!==h&&(p+="/"+("number"==typeof h?h:v.escapeFragment(h))),"string"==typeof u){u=f=d(f?g.resolve(f,u):u);var w=o._refs[u];if("string"==typeof w&&(w=o._refs[w]),w&&w.schema){if(!m(e,w.schema))throw new Error('id "'+u+'" resolves to more than one schema')}else if(u!=d(p))if("#"==u[0]){if(r[u]&&!m(e,r[u]))throw new Error('id "'+u+'" resolves to more than one schema');r[u]=e}else o._refs[u]=p}i[t]=f,n[t]=p}}),r}var g=i(4),m=i(10),v=i(11),w=i(13),y=i(14);e.exports=n,n.normalizeId=d,n.fullPath=h,n.url=f,n.ids=p,n.inlineRef=a,n.schema=r;var A=v.toHash(["properties","patternProperties","enum","dependencies","definitions"]),C=v.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]),E=/#\/?$/},function(e,t,i){function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function r(e,t,i){if(e&&c(e)&&e instanceof n)return e;var r=new n;return r.parse(e,t,i),r}function o(e){return l(e)&&(e=r(e)),e instanceof n?e.format():n.prototype.format.call(e)}function s(e,t){return r(e,!1,!0).resolve(t)}function a(e,t){return e?r(e,!1,!0).resolveObject(t):t}function l(e){return"string"==typeof e}function c(e){return"object"==typeof e&&null!==e}function h(e){return null===e}function u(e){return null==e}var d=i(5);t.parse=r,t.resolve=s,t.resolveObject=a,t.format=o,t.Url=n;var f=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,g=["<",">",'"',"`"," ","\r","\n","\t"],m=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(m),w=["%","/","?",";","#"].concat(v),y=["/","?","#"],A={javascript:!0,"javascript:":!0},C={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=i(7);n.prototype.parse=function(e,t,i){if(!l(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e;n=n.trim();var r=f.exec(n);if(r){r=r[0];var o=r.toLowerCase();this.protocol=o,n=n.substr(r.length)}if(i||r||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===n.substr(0,2);!s||r&&C[r]||(n=n.substr(2),this.slashes=!0)}if(!C[r]&&(s||r&&!E[r])){for(var a=-1,c=0;c<y.length;c++){var h=n.indexOf(y[c]);-1!==h&&(-1===a||h<a)&&(a=h)}var u,p;p=-1===a?n.lastIndexOf("@"):n.lastIndexOf("@",a),-1!==p&&(u=n.slice(0,p),n=n.slice(p+1),this.auth=decodeURIComponent(u)),a=-1;for(var c=0;c<w.length;c++){var h=n.indexOf(w[c]);-1!==h&&(-1===a||h<a)&&(a=h)}-1===a&&(a=n.length),this.host=n.slice(0,a),n=n.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var m=this.hostname.split(/\./),c=0,F=m.length;c<F;c++){var x=m[c];if(x&&!x.match(/^[a-z0-9A-Z_-]{0,63}$/)){for(var S="",$=0,D=x.length;$<D;$++)x.charCodeAt($)>127?S+="x":S+=x[$];if(!S.match(/^[a-z0-9A-Z_-]{0,63}$/)){var k=m.slice(0,c),B=m.slice(c+1),_=x.match(/^([a-z0-9A-Z_-]{0,63})(.*)$/);_&&(k.push(_[1]),B.unshift(_[2])),B.length&&(n="/"+B.join(".")+n),this.hostname=k.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!g){for(var L=this.hostname.split("."),R=[],c=0;c<L.length;++c){var T=L[c];R.push(T.match(/[^A-Za-z0-9_-]/)?"xn--"+d.encode(T):T)}this.hostname=R.join(".")}var P=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==n[0]&&(n="/"+n))}if(!A[o])for(var c=0,F=v.length;c<F;c++){var O=v[c],N=encodeURIComponent(O);N===O&&(N=escape(O)),n=n.split(O).join(N)}var I=n.indexOf("#");-1!==I&&(this.hash=n.substr(I),n=n.slice(0,I));var j=n.indexOf("?");if(-1!==j?(this.search=n.substr(j),this.query=n.substr(j+1),t&&(this.query=b.parse(this.query)),n=n.slice(0,j)):t&&(this.search="",this.query={}),n&&(this.pathname=n),E[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var P=this.pathname||"",T=this.search||"";this.path=P+T}return this.href=this.format(),this},n.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",i=this.pathname||"",n=this.hash||"",r=!1,o="";this.host?r=e+this.host:this.hostname&&(r=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||E[t])&&!1!==r?(r="//"+(r||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):r||(r=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),i=i.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+r+i+s+n},n.prototype.resolve=function(e){return this.resolveObject(r(e,!1,!0)).format()},n.prototype.resolveObject=function(e){if(l(e)){var t=new n;t.parse(e,!1,!0),e=t}var i=new n;if(Object.keys(this).forEach(function(e){i[e]=this[e]},this),i.hash=e.hash,""===e.href)return i.href=i.format(),i;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(i[t]=e[t])}),E[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i;if(e.protocol&&e.protocol!==i.protocol){if(!E[e.protocol])return Object.keys(e).forEach(function(t){i[t]=e[t]}),i.href=i.format(),i;if(i.protocol=e.protocol,e.host||C[e.protocol])i.pathname=e.pathname;else{for(var r=(e.pathname||"").split("/");r.length&&!(e.host=r.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),i.pathname=r.join("/")}if(i.search=e.search,i.query=e.query,i.host=e.host||"",i.auth=e.auth,i.hostname=e.hostname||e.host,i.port=e.port,i.pathname||i.search){var o=i.pathname||"",s=i.search||"";i.path=o+s}return i.slashes=i.slashes||e.slashes,i.href=i.format(),i}var a=i.pathname&&"/"===i.pathname.charAt(0),c=e.host||e.pathname&&"/"===e.pathname.charAt(0),d=c||a||i.host&&e.pathname,f=d,p=i.pathname&&i.pathname.split("/")||[],r=e.pathname&&e.pathname.split("/")||[],g=i.protocol&&!E[i.protocol];if(g&&(i.hostname="",i.port=null,i.host&&(""===p[0]?p[0]=i.host:p.unshift(i.host)),i.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),d=d&&(""===r[0]||""===p[0])),c)i.host=e.host||""===e.host?e.host:i.host,i.hostname=e.hostname||""===e.hostname?e.hostname:i.hostname,i.search=e.search,i.query=e.query,p=r;else if(r.length)p||(p=[]),p.pop(),p=p.concat(r),i.search=e.search,i.query=e.query;else if(!u(e.search)){if(g){i.hostname=i.host=p.shift();var m=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@");m&&(i.auth=m.shift(),i.host=i.hostname=m.shift())}return i.search=e.search,i.query=e.query,h(i.pathname)&&h(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!p.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var v=p.slice(-1)[0],w=(i.host||e.host)&&("."===v||".."===v)||""===v,y=0,A=p.length;A>=0;A--)v=p[A],"."==v?p.splice(A,1):".."===v?(p.splice(A,1),y++):y&&(p.splice(A,1),y--);if(!d&&!f)for(;y--;y)p.unshift("..");!d||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),w&&"/"!==p.join("/").substr(-1)&&p.push("");var b=""===p[0]||p[0]&&"/"===p[0].charAt(0);if(g){i.hostname=i.host=b?"":p.length?p.shift():"";var m=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@");m&&(i.auth=m.shift(),i.host=i.hostname=m.shift())}return d=d||i.host&&p.length,d&&!b&&p.unshift(""),p.length?i.pathname=p.join("/"):(i.pathname=null,i.path=null),h(i.pathname)&&h(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},n.prototype.parseHost=function(){var e=this.host,t=p.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,i){var n;(function(e,r){!function(o){function s(e){throw RangeError(L[e])}function a(e,t){for(var i=e.length,n=[];i--;)n[i]=t(e[i]);return n}function l(e,t){var i=e.split("@"),n="";return i.length>1&&(n=i[0]+"@",e=i[1]),e=e.replace(_,"."),n+a(e.split("."),t).join(".")}function c(e){for(var t,i,n=[],r=0,o=e.length;r<o;)t=e.charCodeAt(r++),t>=55296&&t<=56319&&r<o?(i=e.charCodeAt(r++),56320==(64512&i)?n.push(((1023&t)<<10)+(1023&i)+65536):(n.push(t),r--)):n.push(t);return n}function h(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=P(e>>>10&1023|55296),e=56320|1023&e),t+=P(e)}).join("")}function u(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:C}function d(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function f(e,t,i){var n=0;for(e=i?T(e/x):e>>1,e+=T(e/t);e>R*b>>1;n+=C)e=T(e/R);return T(n+(R+1)*e/(e+F))}function p(e){var t,i,n,r,o,a,l,c,d,p,g=[],m=e.length,v=0,w=$,y=S;for(i=e.lastIndexOf(D),i<0&&(i=0),n=0;n<i;++n)e.charCodeAt(n)>=128&&s("not-basic"),g.push(e.charCodeAt(n));for(r=i>0?i+1:0;r<m;){for(o=v,a=1,l=C;r>=m&&s("invalid-input"),c=u(e.charCodeAt(r++)),(c>=C||c>T((A-v)/a))&&s("overflow"),v+=c*a,d=l<=y?E:l>=y+b?b:l-y,!(c<d);l+=C)p=C-d,a>T(A/p)&&s("overflow"),a*=p;t=g.length+1,y=f(v-o,t,0==o),T(v/t)>A-w&&s("overflow"),w+=T(v/t),v%=t,g.splice(v++,0,w)}return h(g)}function g(e){var t,i,n,r,o,a,l,h,u,p,g,m,v,w,y,F=[];for(e=c(e),m=e.length,t=$,i=0,o=S,a=0;a<m;++a)(g=e[a])<128&&F.push(P(g));for(n=r=F.length,r&&F.push(D);n<m;){for(l=A,a=0;a<m;++a)(g=e[a])>=t&&g<l&&(l=g);for(v=n+1,l-t>T((A-i)/v)&&s("overflow"),i+=(l-t)*v,t=l,a=0;a<m;++a)if(g=e[a],g<t&&++i>A&&s("overflow"),g==t){for(h=i,u=C;p=u<=o?E:u>=o+b?b:u-o,!(h<p);u+=C)y=h-p,w=C-p,F.push(P(d(p+y%w,0))),h=T(y/w);F.push(P(d(h,0))),o=f(i,v,n==r),i=0,++n}++i,++t}return F.join("")}function m(e){return l(e,function(e){return k.test(e)?p(e.slice(4).toLowerCase()):e})}function v(e){return l(e,function(e){return B.test(e)?"xn--"+g(e):e})}var w=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof r&&r);var y,A=2147483647,C=36,E=1,b=26,F=38,x=700,S=72,$=128,D="-",k=/^xn--/,B=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=C-E,T=Math.floor,P=String.fromCharCode;y={version:"1.3.2",ucs2:{decode:c,encode:h},decode:p,encode:g,toASCII:v,toUnicode:m},void 0!==(n=function(){return y}.call(t,i,t,e))&&(e.exports=n)}()}).call(t,i(6)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,i){"use strict";t.decode=t.parse=i(8),t.encode=t.stringify=i(9)},function(e,t){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,r){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;e=e.split(t);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=e.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var c,h,u,d,f=e[l].replace(/\+/g,"%20"),p=f.indexOf(n);p>=0?(c=f.substr(0,p),h=f.substr(p+1)):(c=f,h=""),u=decodeURIComponent(c),d=decodeURIComponent(h),i(o,u)?Array.isArray(o[u])?o[u].push(d):o[u]=[o[u],d]:o[u]=d}return o}},function(e,t){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var o=encodeURIComponent(i(r))+n;return Array.isArray(e[r])?e[r].map(function(e){return o+encodeURIComponent(i(e))}).join(t):o+encodeURIComponent(i(e[r]))}).join(t):r?encodeURIComponent(i(r))+n+encodeURIComponent(i(e)):""}},function(e,t){"use strict";e.exports=function e(t,i){if(t===i)return!0;var n,r=Array.isArray(t),o=Array.isArray(i);if(r&&o){if(t.length!=i.length)return!1;for(n=0;n<t.length;n++)if(!e(t[n],i[n]))return!1;return!0}if(r!=o)return!1;if(t&&i&&"object"==typeof t&&"object"==typeof i){var s=Object.keys(t);if(s.length!==Object.keys(i).length)return!1;var a=t instanceof Date,l=i instanceof Date;if(a&&l)return t.getTime()==i.getTime();if(a!=l)return!1;var c=t instanceof RegExp,h=i instanceof RegExp;if(c&&h)return t.toString()==i.toString();if(c!=h)return!1;for(n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(i,s[n]))return!1;for(n=0;n<s.length;n++)if(!e(t[s[n]],i[s[n]]))return!1;return!0}return!1}},function(e,t,i){"use strict";function n(e,t){t=t||{};for(var i in e)t[i]=e[i];return t}function r(e,t,i){var n=i?" !== ":" === ",r=i?" || ":" && ",o=i?"!":"",s=i?"":"!";switch(e){case"null":return t+n+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+r+"typeof "+t+n+'"object"'+r+s+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+r+s+"("+t+" % 1)"+r+t+n+t+")";default:return"typeof "+t+n+'"'+e+'"'}}function o(e,t){switch(e.length){case 1:return r(e[0],t,!0);default:var i="",n=a(e);n.array&&n.object&&(i=n.null?"(":"(!"+t+" || ",i+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer;for(var o in n)i+=(i?" && ":"")+r(o,t,!0);return i}}function s(e,t){if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++){var r=t[n];x[r]?i[i.length]=r:"array"===e&&"array"===r&&(i[i.length]=r)}if(i.length)return i}else{if(x[t])return[t];if("array"===e&&"array"===t)return["array"]}}function a(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;return t}function l(e){return"number"==typeof e?"["+e+"]":S.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace($,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function h(e,t){t+="[^0-9]";var i=e.match(new RegExp(t,"g"));return i?i.length:0}function u(e,t,i){return t+="([^0-9])",i=i.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),i+"$1")}function d(e){return e.replace(D,"").replace(k,"").replace(B,"if (!($1))")}function f(e,t){var i=e.match(_);return i&&2==i.length&&(e=t?e.replace(R,"").replace(M,O):e.replace(L,"").replace(T,P)),i=e.match(N),i&&3===i.length?e.replace(I,""):e}function p(e,t){if("boolean"==typeof e)return!e;for(var i in e)if(t[i])return!0}function g(e,t,i){if("boolean"==typeof e)return!e&&"not"!=i;for(var n in e)if(n!=i&&t[n])return!0}function m(e){return"'"+c(e)+"'"}function v(e,t,i,n){return A(e,i?"'/' + "+t+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")}function w(e,t,i){return A(e,m(i?"/"+b(t):l(t)))}function y(e,t,i){var n,r,o,s;if(""===e)return"rootData";if("/"==e[0]){if(!j.test(e))throw new Error("Invalid JSON-pointer: "+e);r=e,o="rootData"}else{if(!(s=e.match(W)))throw new Error("Invalid JSON-pointer: "+e);if(n=+s[1],"#"==(r=s[2])){if(n>=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return i[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(o="data"+(t-n||""),!r)return o}for(var a=o,c=r.split("/"),h=0;h<c.length;h++){var u=c[h];u&&(o+=l(F(u)),a+=" && "+o)}return a}function A(e,t){return'""'==e?t:(e+" + "+t).replace(/' \+ '/g,"")}function C(e){return F(decodeURIComponent(e))}function E(e){return encodeURIComponent(b(e))}function b(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function F(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}e.exports={copy:n,checkDataType:r,checkDataTypes:o,coerceToTypes:s,toHash:a,getProperty:l,escapeQuotes:c,equal:i(10),ucs2length:i(12),varOccurences:h,varReplace:u,cleanUpCode:d,finalCleanUpCode:f,schemaHasRules:p,schemaHasRulesExcept:g,toQuotedString:m,getPathExpr:v,getPath:w,getData:y,unescapeFragment:C,escapeFragment:E,escapeJsonPointer:b};var x=a(["string","number","integer","boolean","null"]),S=/^[a-z$_][a-z$_0-9]*$/i,$=/'|\\/g,D=/else\s*{\s*}/g,k=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,B=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g,_=/[^v\.]errors/g,L=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,R=/var errors = 0;|var vErrors = null;/g,T="return errors === 0;",P="validate.errors = null; return true;",M=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,O="return data;",N=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,I=/if \(rootData === undefined\) rootData = data;/,j=/^\/(?:[^~]|~0|~1)*$/,W=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/},function(e,t){"use strict";e.exports=function(e){for(var t,i=0,n=e.length,r=0;r<n;)i++,(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<n&&56320==(64512&(t=e.charCodeAt(r)))&&r++;return i}},function(e,t,i){"use strict";function n(e){r.copy(e,this)}var r=i(11);e.exports=n},function(e,t){"use strict";function i(e,t,o,s,a,l,c,h,u){if(o&&"object"==typeof o&&!Array.isArray(o)){t(o,s,a,l,c,h,u);for(var d in o){var f=o[d];if(Array.isArray(f)){if(d in r.arrayKeywords)for(var p=0;p<f.length;p++)i(e,t,f[p],s+"/"+d+"/"+p,a,s,d,o,p)}else if(d in r.propsKeywords){if(f&&"object"==typeof f)for(var g in f)i(e,t,f[g],s+"/"+d+"/"+n(g),a,s,d,o,g)}else(d in r.keywords||e.allKeys&&!(d in r.skipKeywords))&&i(e,t,f,s+"/"+d,a,s,d,o)}}}function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var r=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),i(t,n,e,"",e)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},function(e,t,i){"use strict";function n(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}function r(e,t,i){this.message=i||r.message(e,t),this.missingRef=s.url(e,t),this.missingSchema=s.normalizeId(s.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var s=i(3);e.exports={Validation:o(n),MissingRef:o(r)},r.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},function(e,t,i){var n="undefined"!=typeof JSON?JSON:i(17);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var i=t.space||"";"number"==typeof i&&(i=Array(i+1).join(" "));var s="boolean"==typeof t.cycles&&t.cycles,a=t.replacer||function(e,t){return t},l=t.cmp&&function(e){return function(t){return function(i,n){var r={key:i,value:t[i]},o={key:n,value:t[n]};return e(r,o)}}}(t.cmp),c=[];return function e(t,h,u,d){var f=i?"\n"+new Array(d+1).join(i):"",p=i?": ":":";if(u&&u.toJSON&&"function"==typeof u.toJSON&&(u=u.toJSON()),void 0!==(u=a.call(t,h,u))){if("object"!=typeof u||null===u)return n.stringify(u);if(r(u)){for(var g=[],m=0;m<u.length;m++){var v=e(u,m,u[m],d+1)||n.stringify(null);g.push(f+i+v)}return"["+g.join(",")+f+"]"}if(-1!==c.indexOf(u)){if(s)return n.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}c.push(u);for(var w=o(u).sort(l&&l(u)),g=[],m=0;m<w.length;m++){var h=w[m],y=e(u,h,u[h],d+1);if(y){var A=n.stringify(h)+p+y;g.push(f+i+A)}}return c.splice(c.indexOf(u),1),"{"+g.join(",")+f+"}"}}({"":e},"",e,0)};var r=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},o=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},i=[];for(var n in e)t.call(e,n)&&i.push(n);return i}},function(e,t,i){t.parse=i(18),t.stringify=i(19)},function(e,t){var i,n,r,o,s={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},a=function(e){throw{name:"SyntaxError",message:e,at:i,text:r}},l=function(e){return e&&e!==n&&a("Expected '"+e+"' instead of '"+n+"'"),n=r.charAt(i),i+=1,n},c=function(){var e,t="";for("-"===n&&(t="-",l("-"));n>="0"&&n<="9";)t+=n,l();if("."===n)for(t+=".";l()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,l(),"-"!==n&&"+"!==n||(t+=n,l());n>="0"&&n<="9";)t+=n,l();if(e=+t,isFinite(e))return e;a("Bad number")},h=function(){var e,t,i,r="";if('"'===n)for(;l();){if('"'===n)return l(),r;if("\\"===n)if(l(),"u"===n){for(i=0,t=0;t<4&&(e=parseInt(l(),16),isFinite(e));t+=1)i=16*i+e;r+=String.fromCharCode(i)}else{if("string"!=typeof s[n])break;r+=s[n]}else r+=n}a("Bad string")},u=function(){for(;n&&n<=" ";)l()},d=function(){switch(n){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}a("Unexpected '"+n+"'")},f=function(){var e=[];if("["===n){if(l("["),u(),"]"===n)return l("]"),e;for(;n;){if(e.push(o()),u(),"]"===n)return l("]"),e;l(","),u()}}a("Bad array")},p=function(){var e,t={};if("{"===n){if(l("{"),u(),"}"===n)return l("}"),t;for(;n;){if(e=h(),u(),l(":"),Object.hasOwnProperty.call(t,e)&&a('Duplicate key "'+e+'"'),t[e]=o(),u(),"}"===n)return l("}"),t;l(","),u()}}a("Bad object")};o=function(){switch(u(),n){case"{":return p();case"[":return f();case'"':return h();case"-":return c();default:return n>="0"&&n<="9"?c():d()}},e.exports=function(e,t){var s;return r=e,i=0,n=" ",s=o(),u(),n&&a("Syntax error"),"function"==typeof t?function e(i,n){var r,o,s=i[n];if(s&&"object"==typeof s)for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(o=e(s,r),void 0!==o?s[r]=o:delete s[r]);return t.call(i,n,s)}({"":s},""):s}},function(e,t){function i(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,function(e){var t=l[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function n(e,t){var a,l,c,h,u,d=r,f=t[e];switch(f&&"object"==typeof f&&"function"==typeof f.toJSON&&(f=f.toJSON(e)),"function"==typeof s&&(f=s.call(t,e,f)),typeof f){case"string":return i(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(r+=o,u=[],"[object Array]"===Object.prototype.toString.apply(f)){for(h=f.length,a=0;a<h;a+=1)u[a]=n(a,f)||"null";return c=0===u.length?"[]":r?"[\n"+r+u.join(",\n"+r)+"\n"+d+"]":"["+u.join(",")+"]",r=d,c}if(s&&"object"==typeof s)for(h=s.length,a=0;a<h;a+=1)"string"==typeof(l=s[a])&&(c=n(l,f))&&u.push(i(l)+(r?": ":":")+c);else for(l in f)Object.prototype.hasOwnProperty.call(f,l)&&(c=n(l,f))&&u.push(i(l)+(r?": ":":")+c);return c=0===u.length?"{}":r?"{\n"+r+u.join(",\n"+r)+"\n"+d+"}":"{"+u.join(",")+"}",r=d,c}}var r,o,s,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};e.exports=function(e,t,i){var a;if(r="",o="","number"==typeof i)for(a=0;a<i;a+=1)o+=" ";else"string"==typeof i&&(o=i);if(s=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return n("",{"":e})}},function(e,t){"use strict";e.exports=function(e,t,i){function n(e){for(var t=e.rules,i=0;i<t.length;i++)if(r(t[i]))return!0}function r(t){return void 0!==e.schema[t.keyword]||t.implements&&o(t)}function o(t){for(var i=t.implements,n=0;n<i.length;n++)if(void 0!==e.schema[i[n]])return!0}var s="",a=!0===e.schema.$async,l=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),c=e.self._getId(e.schema);if(e.isTop){if(a){e.async=!0;var h="es7"==e.opts.async;e.yieldAwait=h?"await":"yield"}s+=" var validate = ",a?h?s+=" (async function ":("*"!=e.opts.async&&(s+="co.wrap"),s+="(function* "):s+=" (function ",s+=" (data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",c&&(e.opts.sourceCode||e.opts.processCode)&&(s+=" /*# sourceURL="+c+" */ ")}if("boolean"==typeof e.schema||!l&&!e.schema.$ref){var u,d=e.level,f=e.dataLevel,p=e.schema["false schema"],g=e.schemaPath+e.util.getProperty("false schema"),m=e.errSchemaPath+"/false schema",v=!e.opts.allErrors,w="data"+(f||""),y="valid"+d;if(!1===e.schema){e.isTop?v=!0:s+=" var "+y+" = false; ";var A=A||[];A.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(u||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: 'boolean schema is false' "),e.opts.verbose&&(s+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+w+" "),s+=" } "):s+=" {} ";var C=s;s=A.pop(),!e.compositeRule&&v?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?s+=a?" return data; ":" validate.errors = null; return true; ":s+=" var "+y+" = true; ";return e.isTop&&(s+=" }); return validate; "),s}if(e.isTop){var E=e.isTop,d=e.level=0,f=e.dataLevel=0,w="data";e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],s+=" var vErrors = null; ",s+=" var errors = 0; ",s+=" if (rootData === undefined) rootData = data; "}else{var d=e.level,f=e.dataLevel,w="data"+(f||"");if(c&&(e.baseId=e.resolve.url(e.baseId,c)),a&&!e.async)throw new Error("async schema in sync schema");s+=" var errs_"+d+" = errors;"}var u,y="valid"+d,v=!e.opts.allErrors,b="",F="",x=e.schema.type,S=Array.isArray(x);if(S&&1==x.length&&(x=x[0],S=!1),e.schema.$ref&&l){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(l=!1,console.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(x){if(e.opts.coerceTypes)var $=e.util.coerceToTypes(e.opts.coerceTypes,x);var D=e.RULES.types[x];if($||S||!0===D||D&&!n(D)){var g=e.schemaPath+".type",m=e.errSchemaPath+"/type",g=e.schemaPath+".type",m=e.errSchemaPath+"/type",k=S?"checkDataTypes":"checkDataType";if(s+=" if ("+e.util[k](x,w,!0)+") { ",$){var B="dataType"+d,_="coerced"+d;s+=" var "+B+" = typeof "+w+"; ","array"==e.opts.coerceTypes&&(s+=" if ("+B+" == 'object' && Array.isArray("+w+")) "+B+" = 'array'; "),s+=" var "+_+" = undefined; ";var L="",R=$;if(R)for(var T,P=-1,M=R.length-1;P<M;)T=R[P+=1],P&&(s+=" if ("+_+" === undefined) { ",L+="}"),"array"==e.opts.coerceTypes&&"array"!=T&&(s+=" if ("+B+" == 'array' && "+w+".length == 1) { "+_+" = "+w+" = "+w+"[0]; "+B+" = typeof "+w+"; } "),"string"==T?s+=" if ("+B+" == 'number' || "+B+" == 'boolean') "+_+" = '' + "+w+"; else if ("+w+" === null) "+_+" = ''; ":"number"==T||"integer"==T?(s+=" if ("+B+" == 'boolean' || "+w+" === null || ("+B+" == 'string' && "+w+" && "+w+" == +"+w+" ","integer"==T&&(s+=" && !("+w+" % 1)"),s+=")) "+_+" = +"+w+"; "):"boolean"==T?s+=" if ("+w+" === 'false' || "+w+" === 0 || "+w+" === null) "+_+" = false; else if ("+w+" === 'true' || "+w+" === 1) "+_+" = true; ":"null"==T?s+=" if ("+w+" === '' || "+w+" === 0 || "+w+" === false) "+_+" = null; ":"array"==e.opts.coerceTypes&&"array"==T&&(s+=" if ("+B+" == 'string' || "+B+" == 'number' || "+B+" == 'boolean' || "+w+" == null) "+_+" = ["+w+"]; ");s+=" "+L+" if ("+_+" === undefined) { ";var A=A||[];A.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(u||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: { type: '",s+=S?""+x.join(","):""+x,s+="' } ",!1!==e.opts.messages&&(s+=" , message: 'should be ",s+=S?""+x.join(","):""+x,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+w+" "),s+=" } "):s+=" {} ";var C=s;s=A.pop(),!e.compositeRule&&v?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else { ";var O=f?"data"+(f-1||""):"parentData",N=f?e.dataPathArr[f]:"parentDataProperty";s+=" "+w+" = "+_+"; ",f||(s+="if ("+O+" !== undefined)"),s+=" "+O+"["+N+"] = "+_+"; } "}else{var A=A||[];A.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(u||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: { type: '",s+=S?""+x.join(","):""+x,s+="' } ",!1!==e.opts.messages&&(s+=" , message: 'should be ",s+=S?""+x.join(","):""+x,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+w+" "),s+=" } "):s+=" {} ";var C=s;s=A.pop(),!e.compositeRule&&v?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}s+=" } "}}if(e.schema.$ref&&!l)s+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",v&&(s+=" } if (errors === ",s+=E?"0":"errs_"+d,s+=") { ",F+="}");else{e.opts.v5&&e.schema.patternGroups&&console.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.');var I=e.RULES;if(I)for(var D,j=-1,W=I.length-1;j<W;)if(D=I[j+=1],n(D)){if(D.type&&(s+=" if ("+e.util.checkDataType(D.type,w)+") { "),e.opts.useDefaults&&!e.compositeRule)if("object"==D.type&&e.schema.properties){var p=e.schema.properties,H=Object.keys(p),V=H;if(V)for(var z,U=-1,K=V.length-1;U<K;){z=V[U+=1];var G=p[z];if(void 0!==G.default){var q=w+e.util.getProperty(z);s+=" if ("+q+" === undefined) "+q+" = ","shared"==e.opts.useDefaults?s+=" "+e.useDefault(G.default)+" ":s+=" "+JSON.stringify(G.default)+" ",s+="; "}}}else if("array"==D.type&&Array.isArray(e.schema.items)){var Q=e.schema.items;if(Q)for(var G,P=-1,Y=Q.length-1;P<Y;)if(G=Q[P+=1],void 0!==G.default){var q=w+"["+P+"]";s+=" if ("+q+" === undefined) "+q+" = ","shared"==e.opts.useDefaults?s+=" "+e.useDefault(G.default)+" ":s+=" "+JSON.stringify(G.default)+" ",s+="; "}}var J=D.rules;if(J)for(var X,Z=-1,ee=J.length-1;Z<ee;)if(X=J[Z+=1],r(X)){var te=X.code(e,X.keyword,D.type);te&&(s+=" "+te+" ",v&&(b+="}"))}if(v&&(s+=" "+b+" ",b=""),D.type&&(s+=" } ",x&&x===D.type&&!$)){s+=" else { ";var g=e.schemaPath+".type",m=e.errSchemaPath+"/type",A=A||[];A.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(u||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: { type: '",s+=S?""+x.join(","):""+x,s+="' } ",!1!==e.opts.messages&&(s+=" , message: 'should be ",s+=S?""+x.join(","):""+x,s+="' "),e.opts.verbose&&(s+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+w+" "),s+=" } "):s+=" {} ";var C=s;s=A.pop(),!e.compositeRule&&v?e.async?s+=" throw new ValidationError(["+C+"]); ":s+=" validate.errors = ["+C+"]; return false; ":s+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } "}v&&(s+=" if (errors === ",s+=E?"0":"errs_"+d,s+=") { ",F+="}")}}return v&&(s+=" "+F+" "),E?(a?(s+=" if (errors === 0) return data; ",s+=" else throw new ValidationError(vErrors); "):(s+=" validate.errors = vErrors; ",s+=" return errors === 0; "),s+=" }); return validate;"):s+=" var "+y+" = errors === errs_"+d+";",s=e.util.cleanUpCode(s),E&&(s=e.util.finalCleanUpCode(s,a)),s}},function(e,t){function i(e){var t=this,i=u.call(arguments,1);return new Promise(function(r,o){function s(t){var i;try{i=e.next(t)}catch(e){return o(e)}c(i)}function l(t){var i;try{i=e.throw(t)}catch(e){return o(e)}c(i)}function c(e){if(e.done)return r(e.value);var i=n.call(t,e.value);return i&&a(i)?i.then(s,l):l(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(e.value)+'"'))}if("function"==typeof e&&(e=e.apply(t,i)),!e||"function"!=typeof e.next)return r(e);s()})}function n(e){return e?a(e)?e:c(e)||l(e)?i.call(this,e):"function"==typeof e?r.call(this,e):Array.isArray(e)?o.call(this,e):h(e)?s.call(this,e):e:e}function r(e){var t=this;return new Promise(function(i,n){e.call(t,function(e,t){if(e)return n(e);arguments.length>2&&(t=u.call(arguments,1)),i(t)})})}function o(e){return Promise.all(e.map(n,this))}function s(e){for(var t=new e.constructor,i=Object.keys(e),r=[],o=0;o<i.length;o++){var s=i[o],l=n.call(this,e[s]);l&&a(l)?function(e,i){t[i]=void 0,r.push(e.then(function(e){t[i]=e}))}(l,s):t[s]=e[s]}return Promise.all(r).then(function(){return t})}function a(e){return"function"==typeof e.then}function l(e){return"function"==typeof e.next&&"function"==typeof e.throw}function c(e){var t=e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName||l(t.prototype))}function h(e){return Object==e.constructor}var u=Array.prototype.slice;e.exports=i.default=i.co=i,i.wrap=function(e){function t(){return i.call(this,e.apply(this,arguments))}return t.__generatorFunction__=e,t}},f