Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

indexeddb-fs

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indexeddb-fs - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

dist/core/create-fs/parts/details-decorator/details-decorator.function.d.ts

5

dist/core/create-fs/create-fs.types.d.ts

@@ -21,6 +21,9 @@ import { FileEntry, DirectoryEntry } from "../../types";

removeDirectory: (fullPath: string) => Promise<void>;
readFile: <TData = any>(fullPath: string) => Promise<TData>;
createDirectory: (fullPath: string) => Promise<DirectoryEntry>;
readFile: <TData = any>(fullPath: string) => Promise<FileEntry<TData>>;
directoryDetails: (fullPath: string) => Promise<DirectoryEntry>;
details: (fullPath: string) => Promise<FileEntry<any> | DirectoryEntry>;
fileDetails: <TData = any>(fullPath: string) => Promise<FileEntry<TData>>;
readDirectory: (fullPath: string) => Promise<ReadDirectoryDecoratorOutput>;
writeFile: <TData = any>(fullPath: string, data: TData) => Promise<FileEntry<TData>>;
}

2

dist/core/create-fs/parts/create-directory-decorator/create-directory-decorator.function.d.ts
import { DirectoryEntry } from "../../../../types";
import { CreateDirectoryDecoratorProps } from './create-directory-decorator.types';
export declare const createDirectoryDecorator: ({ isDirectory, rootDirectoryName, initializeObjectStore }: CreateDirectoryDecoratorProps) => (fullPath: string) => Promise<DirectoryEntry>;
export declare const createDirectoryDecorator: ({ isFile, isDirectory, rootDirectoryName, initializeObjectStore, }: CreateDirectoryDecoratorProps) => (fullPath: string) => Promise<DirectoryEntry>;
export interface CreateDirectoryDecoratorProps {
rootDirectoryName: string;
isFile: (fullPath: string) => Promise<boolean>;
isDirectory: (fullPath: string) => Promise<boolean>;
initializeObjectStore: (type: IDBTransactionMode) => Promise<IDBObjectStore>;
}
export * from './exists-decorator/exists-decorator.function';
export * from './remove-decorator/remove-decorator.function';
export * from './details-decorator/details-decorator.function';
export * from './is-file-decorator/is-file-decorator.function';

@@ -8,6 +9,8 @@ export * from './read-file-decorator/read-file-decorator.function';

export * from './is-directory-decorator/is-directory-decorator.function';
export * from './file-details-decorator/file-details-decorator.function';
export * from './read-directory-decorator/read-directory-decorator.function';
export * from './create-directory-decorator/create-directory-decorator.function';
export * from './remove-directory-decorator/remove-directory-decorator.function';
export * from './directory-details-decorator/directory-details-decorator.function';
export * from './create-root-directory-decorator/create-root-directory-decorator.function';
export * from './read-directory-decorator/read-directory-decorator.types';

@@ -1,3 +0,2 @@

import { FileEntry } from "../../../../types";
import { ReadFileDecoratorProps } from './read-file-decorator.types';
export declare const readFileDecorator: ({ isFile, rootDirectoryName, initializeObjectStore }: ReadFileDecoratorProps) => <TData = any>(fullPath: string) => Promise<FileEntry<TData>>;
export declare const readFileDecorator: ({ fileDetails }: ReadFileDecoratorProps) => <TData = any>(fullPath: string) => Promise<TData>;

@@ -0,5 +1,4 @@

import { FileEntry } from "../../../../types";
export interface ReadFileDecoratorProps {
rootDirectoryName: string;
isFile: (fullPath: string) => Promise<boolean>;
initializeObjectStore: (type: IDBTransactionMode) => Promise<IDBObjectStore>;
fileDetails: <TData = any>(fullPath: string) => Promise<FileEntry<TData>>;
}
import { FileEntry } from "../../../../types";
import { WriteFileDecoratorProps } from './write-file-decorator.types';
export declare const writeFileDecorator: ({ exists, rootDirectoryName, initializeObjectStore }: WriteFileDecoratorProps) => <TData = any>(fullPath: string, data: TData) => Promise<FileEntry<TData>>;
export declare const writeFileDecorator: ({ isDirectory, rootDirectoryName, initializeObjectStore }: WriteFileDecoratorProps) => <TData = any>(fullPath: string, data: TData) => Promise<FileEntry<TData>>;
export interface WriteFileDecoratorProps {
rootDirectoryName: string;
exists: (fullPath: string) => Promise<boolean>;
isDirectory: (fullPath: string) => Promise<boolean>;
initializeObjectStore: (type: IDBTransactionMode) => Promise<IDBObjectStore>;
}

@@ -15,3 +15,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["indexeddb-fs"]={})}(this,(function(e){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function t(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))}function r(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var n=function(e){return"string"==typeof e||e instanceof String},a=new RegExp("^([A-Za-z]:|[A-Za-z0-9_-]+(.[A-Za-z0-9_-]+)*)((/[A-Za-z0-9_.-]+)+)$");function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}
/*! https://mths.be/punycode v1.4.1 by @mathias */var i=2147483647,s=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,f=String.fromCharCode;function l(e){throw new RangeError(c[e])}function m(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=36)e=h(e/35);return h(n+36*e/(e+38))}function d(e){return function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var a=function(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}((e=e.replace(u,".")).split("."),t).join(".");return n+a}(e,(function(e){return s.test(e)?"xn--"+function(e){var t,r,n,a,o,s,u,c,d,v,y,b,g,w,A,x=[];for(b=(e=function(e){for(var t,r,n=[],a=0,o=e.length;a<o;)(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<o?56320==(64512&(r=e.charCodeAt(a++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),a--):n.push(t);return n}(e)).length,t=128,r=0,o=72,s=0;s<b;++s)(y=e[s])<128&&x.push(f(y));for(n=a=x.length,a&&x.push("-");n<b;){for(u=i,s=0;s<b;++s)(y=e[s])>=t&&y<u&&(u=y);for(u-t>h((i-r)/(g=n+1))&&l("overflow"),r+=(u-t)*g,t=u,s=0;s<b;++s)if((y=e[s])<t&&++r>i&&l("overflow"),y==t){for(c=r,d=36;!(c<(v=d<=o?1:d>=o+26?26:d-o));d+=36)A=c-v,w=36-v,x.push(f(m(v+A%w,0))),c=h(A/w);x.push(f(m(c,0))),o=p(r,g,n==a),r=0,++n}++r,++t}return x.join("")}(e):e}))}function v(e){return null===e}function y(e){return"string"==typeof e}function b(e){return"object"==typeof e&&null!==e}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var w=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function A(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function x(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var E=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t};function O(e,t,r,n){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var o=/\+/g;e=e.split(t);var i=1e3;n&&"number"==typeof n.maxKeys&&(i=n.maxKeys);var s=e.length;i>0&&s>i&&(s=i);for(var u=0;u<s;++u){var c,h,f,l,m=e[u].replace(o,"%20"),p=m.indexOf(r);p>=0?(c=m.substr(0,p),h=m.substr(p+1)):(c=m,h=""),f=decodeURIComponent(c),l=decodeURIComponent(h),g(a,f)?w(a[f])?a[f].push(l):a[f]=[a[f],l]:a[f]=l}return a}var j={parse:q,resolve:T,resolveObject:U,format:V,Url:S};function S(){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}var F=/^([a-z0-9.+-]+:)/i,z=/:[0-9]*$/,P=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,N=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),$=["'"].concat(N),Z=["%","/","?",";","#"].concat($),D=["/","?","#"],R=/^[+a-z0-9A-Z_-]{0,63}$/,C=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,I={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function q(e,t,r){if(e&&b(e)&&e instanceof S)return e;var n=new S;return n.parse(e,t,r),n}function M(e,t,r,n){if(!y(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),o=-1!==a&&a<t.indexOf("#")?"?":"#",i=t.split(o);i[0]=i[0].replace(/\\/g,"/");var s=t=i.join(o);if(s=s.trim(),!n&&1===t.split("#").length){var u=P.exec(s);if(u)return e.path=s,e.href=s,e.pathname=u[1],u[2]?(e.search=u[2],e.query=r?O(e.search.substr(1)):e.search.substr(1)):r&&(e.search="",e.query={}),e}var c,h,f,l,m=F.exec(s);if(m){var p=(m=m[0]).toLowerCase();e.protocol=p,s=s.substr(m.length)}if(n||m||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===s.substr(0,2);!v||m&&k[m]||(s=s.substr(2),e.slashes=!0)}if(!k[m]&&(v||m&&!_[m])){var b,g,w=-1;for(c=0;c<D.length;c++)-1!==(h=s.indexOf(D[c]))&&(-1===w||h<w)&&(w=h);for(-1!==(g=-1===w?s.lastIndexOf("@"):s.lastIndexOf("@",w))&&(b=s.slice(0,g),s=s.slice(g+1),e.auth=decodeURIComponent(b)),w=-1,c=0;c<Z.length;c++)-1!==(h=s.indexOf(Z[c]))&&(-1===w||h<w)&&(w=h);-1===w&&(w=s.length),e.host=s.slice(0,w),s=s.slice(w),B(e),e.hostname=e.hostname||"";var A="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!A){var x=e.hostname.split(/\./);for(c=0,f=x.length;c<f;c++){var E=x[c];if(E&&!E.match(R)){for(var j="",S=0,z=E.length;S<z;S++)E.charCodeAt(S)>127?j+="x":j+=E[S];if(!j.match(R)){var N=x.slice(0,c),q=x.slice(c+1),M=E.match(C);M&&(N.push(M[1]),q.unshift(M[2])),q.length&&(s="/"+q.join(".")+s),e.hostname=N.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),A||(e.hostname=d(e.hostname)),l=e.port?":"+e.port:"";var V=e.hostname||"";e.host=V+l,e.href+=e.host,A&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!I[p])for(c=0,f=$.length;c<f;c++){var T=$[c];if(-1!==s.indexOf(T)){var U=encodeURIComponent(T);U===T&&(U=escape(T)),s=s.split(T).join(U)}}var J=s.indexOf("#");-1!==J&&(e.hash=s.substr(J),s=s.slice(0,J));var Y=s.indexOf("?");if(-1!==Y?(e.search=s.substr(Y),e.query=s.substr(Y+1),r&&(e.query=O(e.query)),s=s.slice(0,Y)):r&&(e.search="",e.query={}),s&&(e.pathname=s),_[p]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){l=e.pathname||"";var G=e.search||"";e.path=l+G}return e.href=L(e),e}function V(e){return y(e)&&(e=M({},e)),L(e)}function L(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",a=e.hash||"",o=!1,i="";e.host?o=t+e.host:e.hostname&&(o=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&b(e.query)&&Object.keys(e.query).length&&(i=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?x(E(e),(function(n){var a=encodeURIComponent(A(n))+r;return w(e[n])?x(e[n],(function(e){return a+encodeURIComponent(A(e))})).join(t):a+encodeURIComponent(A(e[n]))})).join(t):n?encodeURIComponent(A(n))+r+encodeURIComponent(A(e)):""}(e.query));var s=e.search||i&&"?"+i||"";return r&&":"!==r.substr(-1)&&(r+=":"),e.slashes||(!r||_[r])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),a&&"#"!==a.charAt(0)&&(a="#"+a),s&&"?"!==s.charAt(0)&&(s="?"+s),r+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+a}function T(e,t){return q(e,!1,!0).resolve(t)}function U(e,t){return e?q(e,!1,!0).resolveObject(t):t}function B(e){var t=e.host,r=z.exec(t);r&&(":"!==(r=r[0])&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}S.prototype.parse=function(e,t,r){return M(this,e,t,r)},S.prototype.format=function(){return L(this)},S.prototype.resolve=function(e){return this.resolveObject(q(e,!1,!0)).format()},S.prototype.resolveObject=function(e){if(y(e)){var t=new S;t.parse(e,!1,!0),e=t}for(var r,n=new S,a=Object.keys(this),o=0;o<a.length;o++){var i=a[o];n[i]=this[i]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return _[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!_[e.protocol]){for(var h=Object.keys(e),f=0;f<h.length;f++){var l=h[f];n[l]=e[l]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||k[e.protocol])n.pathname=e.pathname;else{for(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(""),n.pathname=r.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",p=n.search||"";n.path=m+p}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var d,b=n.pathname&&"/"===n.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=g||b||n.host&&e.pathname,A=w,x=n.pathname&&n.pathname.split("/")||[],E=n.protocol&&!_[n.protocol];if(r=e.pathname&&e.pathname.split("/")||[],E&&(n.hostname="",n.port=null,n.host&&(""===x[0]?x[0]=n.host:x.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),w=w&&(""===r[0]||""===x[0])),g)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,x=r;else if(r.length)x||(x=[]),x.pop(),x=x.concat(r),n.search=e.search,n.query=e.query;else if(null!=e.search)return E&&(n.hostname=n.host=x.shift(),(d=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=d.shift(),n.host=n.hostname=d.shift())),n.search=e.search,n.query=e.query,v(n.pathname)&&v(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=x.slice(-1)[0],j=(n.host||e.host||x.length>1)&&("."===O||".."===O)||""===O,F=0,z=x.length;z>=0;z--)"."===(O=x[z])?x.splice(z,1):".."===O?(x.splice(z,1),F++):F&&(x.splice(z,1),F--);if(!w&&!A)for(;F--;F)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),j&&"/"!==x.join("/").substr(-1)&&x.push("");var P=""===x[0]||x[0]&&"/"===x[0].charAt(0);return E&&(n.hostname=n.host=P?"":x.length?x.shift():"",(d=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=d.shift(),n.host=n.hostname=d.shift())),(w=w||n.host&&x.length)&&!P&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),v(n.pathname)&&v(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},S.prototype.parseHost=function(){return B(this)};var J=o(Object.freeze({__proto__:null,parse:q,resolve:T,resolveObject:U,format:V,default:j,Url:S})),Y={},G=J,K=Y.ValidationError=function(e,t,r,n,a,o){if(Array.isArray(n)?(this.path=n,this.property=n.reduce((function(e,t){return e+re(t)}),"instance")):void 0!==n&&(this.property=n),e&&(this.message=e),r){var i=r.$id||r.id;this.schema=i||r}void 0!==t&&(this.instance=t),this.name=a,this.argument=o,this.stack=this.toString()};K.prototype.toString=function(){return this.property+" "+this.message};var H=Y.ValidatorResult=function(e,t,r,n){this.instance=e,this.schema=t,this.options=r,this.path=n.path,this.propertyPath=n.propertyPath,this.errors=[],this.throwError=r&&r.throwError,this.throwFirst=r&&r.throwFirst,this.throwAll=r&&r.throwAll,this.disableFormat=r&&!0===r.disableFormat};function W(e,t){return t+": "+e.toString()+"\n"}function X(e){Error.captureStackTrace&&Error.captureStackTrace(this,X),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}H.prototype.addError=function(e){var t;if("string"==typeof e)t=new K(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");t=new K(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(t),this.throwFirst)throw new X(this);if(this.throwError)throw t;return t},H.prototype.importErrors=function(e){"string"==typeof e||e&&e.validatorType?this.addError(e):e&&e.errors&&Array.prototype.push.apply(this.errors,e.errors)},H.prototype.toString=function(e){return this.errors.map(W).join("")},Object.defineProperty(H.prototype,"valid",{get:function(){return!this.errors.length}}),Y.ValidatorResultError=X,X.prototype=new Error,X.prototype.constructor=X,X.prototype.name="Validation Error";var Q=Y.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),Error.captureStackTrace(this,e)};Q.prototype=Object.create(Error.prototype,{constructor:{value:Q,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var ee=Y.SchemaContext=function(e,t,r,n,a){this.schema=e,this.options=t,Array.isArray(r)?(this.path=r,this.propertyPath=r.reduce((function(e,t){return e+re(t)}),"instance")):this.propertyPath=r,this.base=n,this.schemas=a};ee.prototype.resolve=function(e){return G.resolve(this.base,e)},ee.prototype.makeChild=function(e,t){var r=void 0===t?this.path:this.path.concat([t]),n=e.$id||e.id,a=G.resolve(this.base,n||""),o=new ee(e,this.options,r,a,Object.create(this.schemas));return n&&!o.schemas[a]&&(o.schemas[a]=e),o};var te=Y.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/,"utc-millisec":function(e){return"string"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var t=!0;try{new RegExp(e)}catch(e){t=!1}return t},style:/\s*(.+?):\s*([^;]+);?/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/};te.regexp=te.regex,te.pattern=te.regex,te.ipv4=te["ip-address"],Y.isFormat=function(e,t,r){if("string"==typeof e&&void 0!==te[t]){if(te[t]instanceof RegExp)return te[t].test(e);if("function"==typeof te[t])return te[t](e)}else if(r&&r.customFormats&&"function"==typeof r.customFormats[t])return r.customFormats[t](e);return!0};var re=Y.makeSuffix=function(e){return(e=e.toString()).match(/[.\s\[\]]/)||e.match(/^[\d]/)?e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]":"."+e};function ne(e,t,r,n){"object"==typeof r?t[n]=ie(e[n],r):-1===e.indexOf(r)&&t.push(r)}function ae(e,t,r){t[r]=e[r]}function oe(e,t,r,n){"object"==typeof t[n]&&t[n]&&e[n]?r[n]=ie(e[n],t[n]):r[n]=t[n]}function ie(e,t){var r=Array.isArray(t),n=r&&[]||{};return r?(e=e||[],n=n.concat(e),t.forEach(ne.bind(null,e,n))):(e&&"object"==typeof e&&Object.keys(e).forEach(ae.bind(null,e,n)),Object.keys(t).forEach(oe.bind(null,e,t,n))),n}function se(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}Y.deepCompareStrict=function e(t,r){if(typeof t!=typeof r)return!1;if(Array.isArray(t))return!!Array.isArray(r)&&(t.length===r.length&&t.every((function(n,a){return e(t[a],r[a])})));if("object"==typeof t){if(!t||!r)return t===r;var n=Object.keys(t),a=Object.keys(r);return n.length===a.length&&n.every((function(n){return e(t[n],r[n])}))}return t===r},Y.deepMerge=ie,Y.objectGetPath=function(e,t){for(var r,n=t.split("/").slice(1);"string"==typeof(r=n.shift());){var a=decodeURIComponent(r.replace(/~0/,"~").replace(/~1/g,"/"));if(!(a in e))return;e=e[a]}return e},Y.encodePath=function(e){return e.map(se).join("")},Y.getDecimalPlaces=function(e){var t=0;if(isNaN(e))return t;"number"!=typeof e&&(e=Number(e));var r=e.toString().split("e");if(2===r.length){if("-"!==r[1][0])return t;t=Number(r[1].slice(1))}var n=r[0].split(".");return 2===n.length&&(t+=n[1].length),t},Y.isSchema=function(e){return"object"==typeof e&&e||"boolean"==typeof e};var ue=Y,ce=ue.ValidatorResult,he=ue.SchemaError,fe={ignoreProperties:{id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0}},le=fe.validators={};function me(e,t,r,n,a){var o=t.throwError,i=t.throwAll;t.throwError=!1,t.throwAll=!1;var s=this.validateSchema(e,a,t,r);return t.throwError=o,t.throwAll=i,!s.valid&&n instanceof Function&&n(s),s.valid}function pe(e,t){if(Object.hasOwnProperty.call(e,t))return e[t];if(t in e)for(;e=Object.getPrototypeOf(e);)if(Object.propertyIsEnumerable.call(e,t))return e[t]}function de(e,t,r,n,a,o){if(this.types.object(e)&&(!t.properties||void 0===t.properties[a]))if(!1===t.additionalProperties)o.addError({name:"additionalProperties",argument:a,message:"is not allowed to have the additional property "+JSON.stringify(a)});else{var i=t.additionalProperties||{};"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,a,i,r,n);var s=this.validateSchema(e[a],i,r,n.makeChild(i,a));s.instance!==o.instance[a]&&(o.instance[a]=s.instance),o.importErrors(s)}}le.type=function(e,t,r,n){if(void 0===e)return null;var a=new ce(e,t,r,n),o=Array.isArray(t.type)?t.type:[t.type];if(!o.some(this.testType.bind(this,e,t,r,n))){var i=o.map((function(e){if(e){var t=e.$id||e.id;return t?"<"+t+">":e+""}}));a.addError({name:"type",argument:i,message:"is not of a type(s) "+i})}return a},le.anyOf=function(e,t,r,n){if(void 0===e)return null;var a=new ce(e,t,r,n),o=new ce(e,t,r,n);if(!Array.isArray(t.anyOf))throw new he("anyOf must be an array");if(!t.anyOf.some(me.bind(this,e,r,n,(function(e){o.importErrors(e)})))){var i=t.anyOf.map((function(e,t){var r=e.$id||e.id;return r?"<"+r+">":e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));r.nestedErrors&&a.importErrors(o),a.addError({name:"anyOf",argument:i,message:"is not any of "+i.join(",")})}return a},le.allOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.allOf))throw new he("allOf must be an array");var a=new ce(e,t,r,n),o=this;return t.allOf.forEach((function(t,i){var s=o.validateSchema(e,t,r,n);if(!s.valid){var u=t.$id||t.id||t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+i+"]";a.addError({name:"allOf",argument:{id:u,length:s.errors.length,valid:s},message:"does not match allOf schema "+u+" with "+s.errors.length+" error[s]:"}),a.importErrors(s)}})),a},le.oneOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.oneOf))throw new he("oneOf must be an array");var a=new ce(e,t,r,n),o=new ce(e,t,r,n),i=t.oneOf.filter(me.bind(this,e,r,n,(function(e){o.importErrors(e)}))).length,s=t.oneOf.map((function(e,t){return e.$id||e.id||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));return 1!==i&&(r.nestedErrors&&a.importErrors(o),a.addError({name:"oneOf",argument:s,message:"is not exactly one from "+s.join(",")})),a},le.if=function(e,t,r,n){if(void 0===e)return null;if(!ue.isSchema(t.if))throw new Error('Expected "if" keyword to be a schema');var a,o=me.call(this,e,r,n,null,t.if),i=new ce(e,t,r,n);if(o){if(void 0===t.then)return;if(!ue.isSchema(t.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,t.then,r,n.makeChild(t.then)),i.importErrors(a)}else{if(void 0===t.else)return;if(!ue.isSchema(t.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,t.else,r,n.makeChild(t.else)),i.importErrors(a)}return i},le.propertyNames=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n),o=void 0!==t.propertyNames?t.propertyNames:{};if(!ue.isSchema(o))throw new he('Expected "propertyNames" to be a schema (object or boolean)');for(var i in e)if(void 0!==pe(e,i)){var s=this.validateSchema(i,o,r,n.makeChild(o));a.importErrors(s)}return a}},le.properties=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n),o=t.properties||{};for(var i in o){var s=o[i];if(void 0!==s){if(null===s)throw new he('Unexpected null, expected schema in "properties"');"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,s,r,n);var u=pe(e,i),c=this.validateSchema(u,s,r,n.makeChild(s,i));c.instance!==a.instance[i]&&(a.instance[i]=c.instance),a.importErrors(c)}}return a}},le.patternProperties=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n),o=t.patternProperties||{};for(var i in e){var s=!0;for(var u in o){var c=o[u];if(void 0!==c){if(null===c)throw new he('Unexpected null, expected schema in "patternProperties"');try{var h=new RegExp(u,"u")}catch(e){h=new RegExp(u)}if(h.test(i)){s=!1,"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,c,r,n);var f=this.validateSchema(e[i],c,r,n.makeChild(c,i));f.instance!==a.instance[i]&&(a.instance[i]=f.instance),a.importErrors(f)}}}s&&de.call(this,e,t,r,n,i,a)}return a}},le.additionalProperties=function(e,t,r,n){if(this.types.object(e)){if(t.patternProperties)return null;var a=new ce(e,t,r,n);for(var o in e)de.call(this,e,t,r,n,o,a);return a}},le.minProperties=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n);return Object.keys(e).length>=t.minProperties||a.addError({name:"minProperties",argument:t.minProperties,message:"does not meet minimum property length of "+t.minProperties}),a}},le.maxProperties=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n);return Object.keys(e).length<=t.maxProperties||a.addError({name:"maxProperties",argument:t.maxProperties,message:"does not meet maximum property length of "+t.maxProperties}),a}},le.items=function(e,t,r,n){var a=this;if(this.types.array(e)&&t.items){var o=new ce(e,t,r,n);return e.every((function(e,i){var s=Array.isArray(t.items)?t.items[i]||t.additionalItems:t.items;if(void 0===s)return!0;if(!1===s)return o.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=a.validateSchema(e,s,r,n.makeChild(s,i));return u.instance!==o.instance[i]&&(o.instance[i]=u.instance),o.importErrors(u),!0})),o}},le.minimum=function(e,t,r,n){if(this.types.number(e)){var a=new ce(e,t,r,n);return t.exclusiveMinimum&&!0===t.exclusiveMinimum?e>t.minimum||a.addError({name:"minimum",argument:t.minimum,message:"must be greater than "+t.minimum}):e>=t.minimum||a.addError({name:"minimum",argument:t.minimum,message:"must be greater than or equal to "+t.minimum}),a}},le.maximum=function(e,t,r,n){if(this.types.number(e)){var a=new ce(e,t,r,n);return t.exclusiveMaximum&&!0===t.exclusiveMaximum?e<t.maximum||a.addError({name:"maximum",argument:t.maximum,message:"must be less than "+t.maximum}):e<=t.maximum||a.addError({name:"maximum",argument:t.maximum,message:"must be less than or equal to "+t.maximum}),a}},le.exclusiveMinimum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var a=new ce(e,t,r,n);return e>t.exclusiveMinimum||a.addError({name:"exclusiveMinimum",argument:t.exclusiveMinimum,message:"must be strictly greater than "+t.exclusiveMinimum}),a}},le.exclusiveMaximum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var a=new ce(e,t,r,n);return e<t.exclusiveMaximum||a.addError({name:"exclusiveMaximum",argument:t.exclusiveMaximum,message:"must be strictly less than "+t.exclusiveMaximum}),a}};var ve=function(e,t,r,n,a,o){if(this.types.number(e)){var i=t[a];if(0==i)throw new he(a+" cannot be zero");var s=new ce(e,t,r,n),u=ue.getDecimalPlaces(e),c=ue.getDecimalPlaces(i),h=Math.max(u,c),f=Math.pow(10,h);return Math.round(e*f)%Math.round(i*f)!=0&&s.addError({name:a,argument:i,message:o+JSON.stringify(i)}),s}};function ye(e,t,r){var n,a=r.length;for(n=t+1;n<a;n++)if(ue.deepCompareStrict(e,r[n]))return!1;return!0}le.multipleOf=function(e,t,r,n){return ve.call(this,e,t,r,n,"multipleOf","is not a multiple of (divisible by) ")},le.divisibleBy=function(e,t,r,n){return ve.call(this,e,t,r,n,"divisibleBy","is not divisible by (multiple of) ")},le.required=function(e,t,r,n){var a=new ce(e,t,r,n);return void 0===e&&!0===t.required?a.addError({name:"required",message:"is required"}):this.types.object(e)&&Array.isArray(t.required)&&t.required.forEach((function(t){void 0===pe(e,t)&&a.addError({name:"required",argument:t,message:"requires property "+JSON.stringify(t)})})),a},le.pattern=function(e,t,r,n){if(this.types.string(e)){var a=new ce(e,t,r,n),o=t.pattern;try{var i=new RegExp(o,"u")}catch(e){i=new RegExp(o)}return e.match(i)||a.addError({name:"pattern",argument:t.pattern,message:"does not match pattern "+JSON.stringify(t.pattern.toString())}),a}},le.format=function(e,t,r,n){if(void 0!==e){var a=new ce(e,t,r,n);return a.disableFormat||ue.isFormat(e,t.format,this)||a.addError({name:"format",argument:t.format,message:"does not conform to the "+JSON.stringify(t.format)+" format"}),a}},le.minLength=function(e,t,r,n){if(this.types.string(e)){var a=new ce(e,t,r,n),o=e.match(/[\uDC00-\uDFFF]/g);return e.length-(o?o.length:0)>=t.minLength||a.addError({name:"minLength",argument:t.minLength,message:"does not meet minimum length of "+t.minLength}),a}},le.maxLength=function(e,t,r,n){if(this.types.string(e)){var a=new ce(e,t,r,n),o=e.match(/[\uDC00-\uDFFF]/g);return e.length-(o?o.length:0)<=t.maxLength||a.addError({name:"maxLength",argument:t.maxLength,message:"does not meet maximum length of "+t.maxLength}),a}},le.minItems=function(e,t,r,n){if(this.types.array(e)){var a=new ce(e,t,r,n);return e.length>=t.minItems||a.addError({name:"minItems",argument:t.minItems,message:"does not meet minimum length of "+t.minItems}),a}},le.maxItems=function(e,t,r,n){if(this.types.array(e)){var a=new ce(e,t,r,n);return e.length<=t.maxItems||a.addError({name:"maxItems",argument:t.maxItems,message:"does not meet maximum length of "+t.maxItems}),a}},le.uniqueItems=function(e,t,r,n){if(!0===t.uniqueItems&&this.types.array(e)){var a=new ce(e,t,r,n);return e.every(ye)||a.addError({name:"uniqueItems",message:"contains duplicate item"}),a}},le.dependencies=function(e,t,r,n){if(this.types.object(e)){var a=new ce(e,t,r,n);for(var o in t.dependencies)if(void 0!==e[o]){var i=t.dependencies[o],s=n.makeChild(i,o);if("string"==typeof i&&(i=[i]),Array.isArray(i))i.forEach((function(t){void 0===e[t]&&a.addError({name:"dependencies",argument:s.propertyPath,message:"property "+t+" not found, required by "+s.propertyPath})}));else{var u=this.validateSchema(e,i,r,s);a.instance!==u.instance&&(a.instance=u.instance),u&&u.errors.length&&(a.addError({name:"dependencies",argument:s.propertyPath,message:"does not meet dependency required by "+s.propertyPath}),a.importErrors(u))}}return a}},le.enum=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.enum))throw new he("enum expects an array",t);var a=new ce(e,t,r,n);return t.enum.some(ue.deepCompareStrict.bind(null,e))||a.addError({name:"enum",argument:t.enum,message:"is not one of enum values: "+t.enum.map(String).join(",")}),a},le.const=function(e,t,r,n){if(void 0===e)return null;var a=new ce(e,t,r,n);return ue.deepCompareStrict(t.const,e)||a.addError({name:"const",argument:t.const,message:"does not exactly match expected constant: "+t.const}),a},le.not=le.disallow=function(e,t,r,n){var a=this;if(void 0===e)return null;var o=new ce(e,t,r,n),i=t.not||t.disallow;return i?(Array.isArray(i)||(i=[i]),i.forEach((function(i){if(a.testType(e,t,r,n,i)){var s=i&&(i.$id||i.id)||i;o.addError({name:"not",argument:s,message:"is of prohibited type "+s})}})),o):null};var be=fe,ge={},we=J,Ae=Y;function xe(e,t){this.id=e,this.ref=t}ge.SchemaScanResult=xe,ge.scan=function(e,t){function r(e,t){if(t&&"object"==typeof t)if(t.$ref){var s=we.resolve(e,t.$ref);i[s]=i[s]?i[s]+1:0}else{var u=t.$id||t.id,c=u?we.resolve(e,u):e;if(c){if(c.indexOf("#")<0&&(c+="#"),o[c]){if(!Ae.deepCompareStrict(o[c],t))throw new Error("Schema <"+c+"> already exists with different definition");return o[c]}o[c]=t,"#"==c[c.length-1]&&(o[c.substring(0,c.length-1)]=t)}n(c+"/items",Array.isArray(t.items)?t.items:[t.items]),n(c+"/extends",Array.isArray(t.extends)?t.extends:[t.extends]),r(c+"/additionalItems",t.additionalItems),a(c+"/properties",t.properties),r(c+"/additionalProperties",t.additionalProperties),a(c+"/definitions",t.definitions),a(c+"/patternProperties",t.patternProperties),a(c+"/dependencies",t.dependencies),n(c+"/disallow",t.disallow),n(c+"/allOf",t.allOf),n(c+"/anyOf",t.anyOf),n(c+"/oneOf",t.oneOf),r(c+"/not",t.not)}}function n(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)r(e+"/"+n,t[n])}function a(e,t){if(t&&"object"==typeof t)for(var n in t)r(e+"/"+n,t[n])}var o={},i={};return r(e,t),new xe(o,i)};var Ee=J,Oe=be,je=Y,Se=ge.scan,Fe=je.ValidatorResult,ze=je.ValidatorResultError,Pe=je.SchemaError,Ne=je.SchemaContext,$e=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(De),this.attributes=Object.create(Oe.validators)};function Ze(e){var t="string"==typeof e?e:e.$ref;return"string"==typeof t&&t}$e.prototype.customFormats={},$e.prototype.schemas=null,$e.prototype.types=null,$e.prototype.attributes=null,$e.prototype.unresolvedRefs=null,$e.prototype.addSchema=function(e,t){var r=this;if(!e)return null;var n=Se(t||"/",e),a=t||e.$id||e.id;for(var o in n.id)this.schemas[o]=n.id[o];for(var o in n.ref)this.unresolvedRefs.push(o);return this.unresolvedRefs=this.unresolvedRefs.filter((function(e){return void 0===r.schemas[e]})),this.schemas[a]},$e.prototype.addSubSchemaArray=function(e,t){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addSubSchema(e,t[r])},$e.prototype.addSubSchemaObject=function(e,t){if(t&&"object"==typeof t)for(var r in t)this.addSubSchema(e,t[r])},$e.prototype.setSchemas=function(e){this.schemas=e},$e.prototype.getSchema=function(e){return this.schemas[e]},$e.prototype.validate=function(e,t,r,n){if("boolean"!=typeof t&&"object"!=typeof t||null===t)throw new Pe("Expected `schema` to be an object or boolean");r||(r={});var a,o=t.$id||t.id,i=Ee.resolve(r.base||"/",o||"");if(!n){(n=new Ne(t,r,[],i,Object.create(this.schemas))).schemas[i]||(n.schemas[i]=t);var s=Se(i,t);for(var u in s.id){var c=s.id[u];n.schemas[u]=c}}if(r.required&&void 0===e)return(a=new Fe(e,t,r,n)).addError("is required, but is undefined"),a;if(!(a=this.validateSchema(e,t,r,n)))throw new Error("Result undefined");if(r.throwAll&&a.errors.length)throw new ze(a);return a},$e.prototype.validateSchema=function(e,t,r,n){var a=new Fe(e,t,r,n);if("boolean"==typeof t)!0===t?t={}:!1===t&&(t={type:[]});else if(!t)throw new Error("schema is undefined");if(t.extends)if(Array.isArray(t.extends)){var o={schema:t,ctx:n};t.extends.forEach(this.schemaTraverser.bind(this,o)),t=o.schema,o.schema=null,o.ctx=null,o=null}else t=je.deepMerge(t,this.superResolve(t.extends,n));var i=Ze(t);if(i){var s=this.resolve(t,i,n),u=new Ne(s.subschema,r,n.path,s.switchSchema,n.schemas);return this.validateSchema(e,s.subschema,r,u)}var c=r&&r.skipAttributes||[];for(var h in t)if(!Oe.ignoreProperties[h]&&c.indexOf(h)<0){var f=null,l=this.attributes[h];if(l)f=l.call(this,e,t,r,n);else if(!1===r.allowUnknownAttributes)throw new Pe("Unsupported attribute: "+h,t);f&&a.importErrors(f)}if("function"==typeof r.rewrite){var m=r.rewrite.call(this,e,t,r,n);a.instance=m}return a},$e.prototype.schemaTraverser=function(e,t){e.schema=je.deepMerge(e.schema,this.superResolve(t,e.ctx))},$e.prototype.superResolve=function(e,t){var r=Ze(e);return r?this.resolve(e,r,t).subschema:e},$e.prototype.resolve=function(e,t,r){if(t=r.resolve(t),r.schemas[t])return{subschema:r.schemas[t],switchSchema:t};var n=Ee.parse(t),a=n&&n.hash,o=a&&a.length&&t.substr(0,t.length-a.length);if(!o||!r.schemas[o])throw new Pe("no such schema <"+t+">",e);var i=je.objectGetPath(r.schemas[o],a.substr(1));if(void 0===i)throw new Pe("no such schema "+a+" located in <"+o+">",e);return{subschema:i,switchSchema:t}},$e.prototype.testType=function(e,t,r,n,a){if(void 0!==a){if(null===a)throw new Pe('Unexpected null in "type" keyword');if("function"==typeof this.types[a])return this.types[a].call(this,e);if(a&&"object"==typeof a){var o=this.validateSchema(e,a,r,n);return void 0===o||!(o&&o.errors.length)}return!0}};var De=$e.prototype.types={};De.string=function(e){return"string"==typeof e},De.number=function(e){return"number"==typeof e&&isFinite(e)},De.integer=function(e){return"number"==typeof e&&e%1==0},De.boolean=function(e){return"boolean"==typeof e},De.array=function(e){return Array.isArray(e)},De.null=function(e){return null===e},De.date=function(e){return e instanceof Date},De.any=function(e){return!0},De.object=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof Date)};var Re=$e,Ce="^[a-zA-Z0-9_.-]*$",Ie={type:"object",id:"/CreateFsPropsSchema",properties:{databaseName:{minLength:4,maxLength:50,type:"string",pattern:Ce},objectStoreName:{minLength:1,maxLength:20,type:"string",pattern:Ce},rootDirectoryName:{minLength:1,maxLength:20,type:"string",pattern:Ce},databaseVersion:{minimum:1,maximum:100,type:"integer"}},required:["databaseName","databaseVersion","objectStoreName","rootDirectoryName"]};function ke(e){var t,r,n,a=(t=e,r=Ie,(new Re).validate(t,r,n)),o=a.valid,i=a.errors;if(o)return o;var s=JSON.stringify(i);throw new Error("Props passed to createFS function are invalid:\n"+s)}function _e(e,t){return""===e?t:function(e,t){if(!n(e)||!n(t)||""===t)return!1;var r=t+"/";return e.startsWith(r)}(e,t)?e:t+(function(e){return!(!n(e)||0===e.length)&&"/"===e[0]}(e)?"":"/")+e}function qe(e,t){if(!n(t)||""===t)throw new Error("rootDirectoryName parameter was not provided");if(!n(e))throw new Error("fullPath parameter was not provided");if(e===t)return t;var r=_e(e,t);if(!r||!function(e){return!!n(e)&&a.test(e)}(r))throw new Error('"'+e+'" path is invalid.');return r}var Me="directory";function Ve(e){return e?e.result:null}function Le(e,t){t||e(new Error("Something went wrong and the database transaction was not opened."))}var Te,Ue=function(e){var t=e.databaseName,r=e.databaseVersion,n=e.objectStoreName;return new Promise((function(e,a){var o=Be(t,r);o.onupgradeneeded=function(e){var t=Ve(e.target);Le(a,t),t.createObjectStore(n,{keyPath:"fullPath"}).createIndex(Me,Me,{unique:!1})},o.onsuccess=function(t){var r=t.target,n=Ve(r);Le(a,n),e(Ve(r))},o.onerror=a}))},Be=function(e,t){return indexedDB.open(e,t)};!function(e){e.FILE="file",e.DIRECTORY="directory"}(Te||(Te={}));function Je(e,t){for(var r=0,n=e.length-1;n>=0;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var Ye=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Ge=function(e){return Ye.exec(e).slice(1)};function Ke(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=Je(Qe(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function He(e){var t=We(e),r="/"===et(e,-1);return(e=Je(Qe(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function We(e){return"/"===e.charAt(0)}var Xe={extname:function(e){return Ge(e)[3]},basename:function(e,t){var r=Ge(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},dirname:function(e){var t=Ge(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},sep:"/",delimiter:":",relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Ke(e).substr(1),t=Ke(t).substr(1);for(var n=r(e.split("/")),a=r(t.split("/")),o=Math.min(n.length,a.length),i=o,s=0;s<o;s++)if(n[s]!==a[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(a.slice(i))).join("/")},join:function(){var e=Array.prototype.slice.call(arguments,0);return He(Qe(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:We,normalize:He,resolve:Ke};function Qe(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var et="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)},tt=function(e){var n=e.isDirectory,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(e)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a directory.');return[4,o("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.index(Me),a=IDBKeyRange.only(t),o=n.openCursor(a);o.onerror=r;var s=[],u=[];o.onsuccess=function(t){var r=t.target.result;if(r){var n=r.value;if(n.type===Te.FILE){n.data;var a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}(n,["data"]);s.push(a)}else n.type!==Te.DIRECTORY||n.isRoot||u.push(n);r.continue()}else{var o=s.length,i=u.length;e({isEmpty:0===o&&0===i,filesCount:o,directoriesCount:i,files:s,directories:u})}}}))]}}))}))}},rt={databaseVersion:1,objectStoreName:"files",rootDirectoryName:"root",databaseName:"indexeddb-fs"};function nt(e){var n=this,a=void 0===e?rt:e,o=a.databaseName,i=void 0===o?rt.databaseName:o,s=a.databaseVersion,u=void 0===s?rt.databaseVersion:s,c=a.objectStoreName,h=void 0===c?rt.objectStoreName:c,f=a.rootDirectoryName,l=void 0===f?rt.rootDirectoryName:f;var m=function(e){var n=e.databaseName,a=e.databaseVersion,o=e.objectStoreName;return function(e){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,Ue({databaseName:n,databaseVersion:a,objectStoreName:o})];case 1:return[2,t.sent().transaction(o,e).objectStore(o)]}}))}))}}({databaseName:i,databaseVersion:u,objectStoreName:h}),p=function(e){var n=e.rootDirectoryName,a=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,o;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,n),[4,a("readonly")];case 1:return o=r.sent(),[2,new Promise((function(e){var r=o.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean(null==r?void 0:r.createdAt))}}))]}}))}))}}({rootDirectoryName:l,initializeObjectStore:m}),d=function(e){var n=e.exists,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" file does not exist.');return[4,o("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e){var r=i.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean((null==r?void 0:r.type)===Te.FILE))}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:m}),v=function(e){var n=e.exists,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" file or directory does not exist.');return[4,o("readwrite")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.delete(t);n.onerror=r,n.onsuccess=function(){return e()}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:m}),y=function(e){var n=e.isFile,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(e)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a file.');return[4,o("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.get(t);n.onerror=r,n.onsuccess=function(t){var r=t.target.result;e(null==r?void 0:r.data)}}))]}}))}))}}({isFile:d,rootDirectoryName:l,initializeObjectStore:m}),b=function(e){var n=e.exists,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e,i){return t(void 0,void 0,void 0,(function(){var t,s,u,c;return r(this,(function(r){switch(r.label){case 0:if((t=qe(e,a))===a)throw new Error('Root directory: "'+t+'" cannot be a file.');return s=Xe.basename(t),u=Xe.dirname(t),[4,n(u)];case 1:if(!r.sent())throw new Error('"'+u+'" directory does not exist.');return[4,o("readwrite")];case 2:return c=r.sent(),[2,new Promise((function(e,r){var n={data:i,directory:u,name:s,type:Te.FILE,createdAt:Date.now(),fullPath:t},a=c.put(n);a.onerror=r,a.onsuccess=function(){return e(n)}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:m}),g=function(e){var n=e.isFile,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a file.');return[4,o("readwrite")];case 2:return i=r.sent(),[2,new Promise((function(e,r){var n=i.delete(t);n.onerror=r,n.onsuccess=function(){return e()}}))]}}))}))}}({isFile:d,rootDirectoryName:l,initializeObjectStore:m}),w=function(e){var n=e.exists,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,a),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" directory does not exist.');return[4,o("readonly")];case 2:return i=r.sent(),[2,new Promise((function(e){var r=i.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean((null==r?void 0:r.type)===Te.DIRECTORY))}}))]}}))}))}}({exists:p,rootDirectoryName:l,initializeObjectStore:m}),A=tt({isDirectory:w,rootDirectoryName:l,initializeObjectStore:m}),x=function(e){var n=e.isDirectory,a=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,i,s,u;return r(this,(function(r){switch(r.label){case 0:if((t=qe(e,a))===a)throw new Error('Root directory: "'+t+'" already exist.');return i=Xe.basename(t),s=Xe.dirname(t),[4,n(s)];case 1:if(!r.sent())throw new Error('"'+s+'" is not a directory.');return[4,o("readwrite")];case 2:return u=r.sent(),[2,new Promise((function(e,r){var n={directory:s,isRoot:!1,name:i,createdAt:Date.now(),type:Te.DIRECTORY,fullPath:t},a=u.put(n);a.onerror=r,a.onsuccess=function(){return e(n)}}))]}}))}))}}({isDirectory:w,rootDirectoryName:l,initializeObjectStore:m}),E=function(e){var n=e.remove,a=e.isDirectory,o=e.readDirectory,i=e.rootDirectoryName;function s(e){return t(this,void 0,void 0,(function(){var t,a,u,c,h,f,l,m,p,d,v,y;return r(this,(function(r){switch(r.label){case 0:return t=qe(e,i),[4,o(t)];case 1:if(a=r.sent(),u=a.filesCount,c=a.directoriesCount,h=a.files,f=a.directories,!(u>0))return[3,5];l=0,m=h,r.label=2;case 2:return l<m.length?(p=m[l],[4,n(p.fullPath)]):[3,5];case 3:r.sent(),r.label=4;case 4:return l++,[3,2];case 5:return c?[3,7]:[4,n(e)];case 6:return r.sent(),[2];case 7:d=0,v=f,r.label=8;case 8:return d<v.length?(y=v[d]).isRoot?[3,10]:[4,s(y.fullPath)]:[3,14];case 9:r.sent(),r.label=10;case 10:return r.trys.push([10,12,,13]),[4,n(y.fullPath)];case 11:case 12:return r.sent(),[3,13];case 13:return d++,[3,8];case 14:return[2]}}))}))}return function(e){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,a(e)];case 1:if(!t.sent())throw new Error('"'+e+'" is not a directory.');return[4,s(e)];case 2:return t.sent(),e===i?[3,4]:[4,n(e)];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))}}({remove:v,isDirectory:w,readDirectory:A,rootDirectoryName:l}),O=function(e){var n=e.rootDirectoryName,a=e.initializeObjectStore;return function(){return t(void 0,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return[4,a("readwrite")];case 1:return e=t.sent(),[2,new Promise((function(t,r){var a={isRoot:!0,createdAt:Date.now(),name:n,type:Te.DIRECTORY,fullPath:n,directory:n},o=e.put(a);o.onerror=r,o.onsuccess=function(){return t(a)}}))]}}))}))}}({rootDirectoryName:l,initializeObjectStore:m});function j(){return t(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,p(l)];case 1:return e.sent()?[3,3]:[4,O()];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))}var S=function(e){return function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return t(n,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,j()];case 1:return t.sent(),[2,e.apply(void 0,a)]}}))}))}};return function(){if(!Boolean(indexedDB))throw new Error("Your browser does not support indexedDB.")}(),ke({databaseName:i,objectStoreName:h,databaseVersion:u,rootDirectoryName:l}),{databaseName:i,databaseVersion:u,objectStoreName:h,rootDirectoryName:l,exists:S(p),isFile:S(d),remove:S(v),readFile:S(y),writeFile:S(b),removeFile:S(g),isDirectory:S(w),readDirectory:S(A),createDirectory:S(x),removeDirectory:S(E)}}var at=nt();e.createFs=nt,e.default=at,Object.defineProperty(e,"__esModule",{value:!0})}));
***************************************************************************** */function t(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function r(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var n=function(e){return"string"==typeof e||e instanceof String},i=function(e,n){return t(void 0,void 0,void 0,(function(){var t;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e()];case 1:return[2,r.sent()];case 2:return t=r.sent(),n&&n(t),[3,3];case 3:return[2,null]}}))}))},o=new RegExp("^([A-Za-z]:|[A-Za-z0-9_-]+(.[A-Za-z0-9_-]+)*)((/[A-Za-z0-9_.-]+)+)$");function a(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}
/*! https://mths.be/punycode v1.4.1 by @mathias */var s=2147483647,u=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,l=String.fromCharCode;function m(e){throw new RangeError(f[e])}function d(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=36)e=h(e/35);return h(n+36*e/(e+38))}function v(e){return function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var i=function(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}((e=e.replace(c,".")).split("."),t).join(".");return n+i}(e,(function(e){return u.test(e)?"xn--"+function(e){var t,r,n,i,o,a,u,c,f,v,y,b,g,w,A,x=[];for(b=(e=function(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}(e)).length,t=128,r=0,o=72,a=0;a<b;++a)(y=e[a])<128&&x.push(l(y));for(n=i=x.length,i&&x.push("-");n<b;){for(u=s,a=0;a<b;++a)(y=e[a])>=t&&y<u&&(u=y);for(u-t>h((s-r)/(g=n+1))&&m("overflow"),r+=(u-t)*g,t=u,a=0;a<b;++a)if((y=e[a])<t&&++r>s&&m("overflow"),y==t){for(c=r,f=36;!(c<(v=f<=o?1:f>=o+26?26:f-o));f+=36)A=c-v,w=36-v,x.push(l(d(v+A%w,0))),c=h(A/w);x.push(l(d(c,0))),o=p(r,g,n==i),r=0,++n}++r,++t}return x.join("")}(e):e}))}function y(e){return null===e}function b(e){return"string"==typeof e}function g(e){return"object"==typeof e&&null!==e}function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var A=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function x(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function E(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var O=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t};function j(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u<s;++u){var c,f,h,l,m=e[u].replace(o,"%20"),d=m.indexOf(r);d>=0?(c=m.substr(0,d),f=m.substr(d+1)):(c=m,f=""),h=decodeURIComponent(c),l=decodeURIComponent(f),w(i,h)?A(i[h])?i[h].push(l):i[h]=[i[h],l]:i[h]=l}return i}var S={parse:M,resolve:U,resolveObject:B,format:L,Url:F};function F(){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}var z=/^([a-z0-9.+-]+:)/i,D=/:[0-9]*$/,P=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,N=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),$=["'"].concat(N),Z=["%","/","?",";","#"].concat($),R=["/","?","#"],I=/^[+a-z0-9A-Z_-]{0,63}$/,C=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,k={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function M(e,t,r){if(e&&g(e)&&e instanceof F)return e;var n=new F;return n.parse(e,t,r),n}function V(e,t,r,n){if(!b(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&i<t.indexOf("#")?"?":"#",a=t.split(o);a[0]=a[0].replace(/\\/g,"/");var s=t=a.join(o);if(s=s.trim(),!n&&1===t.split("#").length){var u=P.exec(s);if(u)return e.path=s,e.href=s,e.pathname=u[1],u[2]?(e.search=u[2],e.query=r?j(e.search.substr(1)):e.search.substr(1)):r&&(e.search="",e.query={}),e}var c,f,h,l,m=z.exec(s);if(m){var d=(m=m[0]).toLowerCase();e.protocol=d,s=s.substr(m.length)}if(n||m||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var p="//"===s.substr(0,2);!p||m&&_[m]||(s=s.substr(2),e.slashes=!0)}if(!_[m]&&(p||m&&!q[m])){var y,g,w=-1;for(c=0;c<R.length;c++)-1!==(f=s.indexOf(R[c]))&&(-1===w||f<w)&&(w=f);for(-1!==(g=-1===w?s.lastIndexOf("@"):s.lastIndexOf("@",w))&&(y=s.slice(0,g),s=s.slice(g+1),e.auth=decodeURIComponent(y)),w=-1,c=0;c<Z.length;c++)-1!==(f=s.indexOf(Z[c]))&&(-1===w||f<w)&&(w=f);-1===w&&(w=s.length),e.host=s.slice(0,w),s=s.slice(w),J(e),e.hostname=e.hostname||"";var A="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!A){var x=e.hostname.split(/\./);for(c=0,h=x.length;c<h;c++){var E=x[c];if(E&&!E.match(I)){for(var O="",S=0,F=E.length;S<F;S++)E.charCodeAt(S)>127?O+="x":O+=E[S];if(!O.match(I)){var D=x.slice(0,c),N=x.slice(c+1),M=E.match(C);M&&(D.push(M[1]),N.unshift(M[2])),N.length&&(s="/"+N.join(".")+s),e.hostname=D.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),A||(e.hostname=v(e.hostname)),l=e.port?":"+e.port:"";var V=e.hostname||"";e.host=V+l,e.href+=e.host,A&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!k[d])for(c=0,h=$.length;c<h;c++){var L=$[c];if(-1!==s.indexOf(L)){var U=encodeURIComponent(L);U===L&&(U=escape(L)),s=s.split(L).join(U)}}var B=s.indexOf("#");-1!==B&&(e.hash=s.substr(B),s=s.slice(0,B));var Y=s.indexOf("?");if(-1!==Y?(e.search=s.substr(Y),e.query=s.substr(Y+1),r&&(e.query=j(e.query)),s=s.slice(0,Y)):r&&(e.search="",e.query={}),s&&(e.pathname=s),q[d]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){l=e.pathname||"";var G=e.search||"";e.path=l+G}return e.href=T(e),e}function L(e){return b(e)&&(e=V({},e)),T(e)}function T(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",i=e.hash||"",o=!1,a="";e.host?o=t+e.host:e.hostname&&(o=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&g(e.query)&&Object.keys(e.query).length&&(a=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?E(O(e),(function(n){var i=encodeURIComponent(x(n))+r;return A(e[n])?E(e[n],(function(e){return i+encodeURIComponent(x(e))})).join(t):i+encodeURIComponent(x(e[n]))})).join(t):n?encodeURIComponent(x(n))+r+encodeURIComponent(x(e)):""}(e.query));var s=e.search||a&&"?"+a||"";return r&&":"!==r.substr(-1)&&(r+=":"),e.slashes||(!r||q[r])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+i}function U(e,t){return M(e,!1,!0).resolve(t)}function B(e,t){return e?M(e,!1,!0).resolveObject(t):t}function J(e){var t=e.host,r=D.exec(t);r&&(":"!==(r=r[0])&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}F.prototype.parse=function(e,t,r){return V(this,e,t,r)},F.prototype.format=function(){return T(this)},F.prototype.resolve=function(e){return this.resolveObject(M(e,!1,!0)).format()},F.prototype.resolveObject=function(e){if(b(e)){var t=new F;t.parse(e,!1,!0),e=t}for(var r,n=new F,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return q[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!q[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var l=f[h];n[l]=e[l]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||_[e.protocol])n.pathname=e.pathname;else{for(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(""),n.pathname=r.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",d=n.search||"";n.path=m+d}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var p,v=n.pathname&&"/"===n.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=g||v||n.host&&e.pathname,A=w,x=n.pathname&&n.pathname.split("/")||[],E=n.protocol&&!q[n.protocol];if(r=e.pathname&&e.pathname.split("/")||[],E&&(n.hostname="",n.port=null,n.host&&(""===x[0]?x[0]=n.host:x.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),w=w&&(""===r[0]||""===x[0])),g)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,x=r;else if(r.length)x||(x=[]),x.pop(),x=x.concat(r),n.search=e.search,n.query=e.query;else if(null!=e.search)return E&&(n.hostname=n.host=x.shift(),(p=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=p.shift(),n.host=n.hostname=p.shift())),n.search=e.search,n.query=e.query,y(n.pathname)&&y(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=x.slice(-1)[0],j=(n.host||e.host||x.length>1)&&("."===O||".."===O)||""===O,S=0,z=x.length;z>=0;z--)"."===(O=x[z])?x.splice(z,1):".."===O?(x.splice(z,1),S++):S&&(x.splice(z,1),S--);if(!w&&!A)for(;S--;S)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),j&&"/"!==x.join("/").substr(-1)&&x.push("");var D=""===x[0]||x[0]&&"/"===x[0].charAt(0);return E&&(n.hostname=n.host=D?"":x.length?x.shift():"",(p=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=p.shift(),n.host=n.hostname=p.shift())),(w=w||n.host&&x.length)&&!D&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),y(n.pathname)&&y(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},F.prototype.parseHost=function(){return J(this)};var Y=a(Object.freeze({__proto__:null,parse:M,resolve:U,resolveObject:B,format:L,default:S,Url:F})),G={},K=Y,H=G.ValidationError=function(e,t,r,n,i,o){if(Array.isArray(n)?(this.path=n,this.property=n.reduce((function(e,t){return e+ne(t)}),"instance")):void 0!==n&&(this.property=n),e&&(this.message=e),r){var a=r.$id||r.id;this.schema=a||r}void 0!==t&&(this.instance=t),this.name=i,this.argument=o,this.stack=this.toString()};H.prototype.toString=function(){return this.property+" "+this.message};var W=G.ValidatorResult=function(e,t,r,n){this.instance=e,this.schema=t,this.options=r,this.path=n.path,this.propertyPath=n.propertyPath,this.errors=[],this.throwError=r&&r.throwError,this.throwFirst=r&&r.throwFirst,this.throwAll=r&&r.throwAll,this.disableFormat=r&&!0===r.disableFormat};function X(e,t){return t+": "+e.toString()+"\n"}function Q(e){Error.captureStackTrace&&Error.captureStackTrace(this,Q),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}W.prototype.addError=function(e){var t;if("string"==typeof e)t=new H(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");t=new H(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(t),this.throwFirst)throw new Q(this);if(this.throwError)throw t;return t},W.prototype.importErrors=function(e){"string"==typeof e||e&&e.validatorType?this.addError(e):e&&e.errors&&Array.prototype.push.apply(this.errors,e.errors)},W.prototype.toString=function(e){return this.errors.map(X).join("")},Object.defineProperty(W.prototype,"valid",{get:function(){return!this.errors.length}}),G.ValidatorResultError=Q,Q.prototype=new Error,Q.prototype.constructor=Q,Q.prototype.name="Validation Error";var ee=G.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),Error.captureStackTrace(this,e)};ee.prototype=Object.create(Error.prototype,{constructor:{value:ee,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var te=G.SchemaContext=function(e,t,r,n,i){this.schema=e,this.options=t,Array.isArray(r)?(this.path=r,this.propertyPath=r.reduce((function(e,t){return e+ne(t)}),"instance")):this.propertyPath=r,this.base=n,this.schemas=i};te.prototype.resolve=function(e){return K.resolve(this.base,e)},te.prototype.makeChild=function(e,t){var r=void 0===t?this.path:this.path.concat([t]),n=e.$id||e.id,i=K.resolve(this.base,n||""),o=new te(e,this.options,r,i,Object.create(this.schemas));return n&&!o.schemas[i]&&(o.schemas[i]=e),o};var re=G.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/,"utc-millisec":function(e){return"string"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var t=!0;try{new RegExp(e)}catch(e){t=!1}return t},style:/\s*(.+?):\s*([^;]+);?/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/};re.regexp=re.regex,re.pattern=re.regex,re.ipv4=re["ip-address"],G.isFormat=function(e,t,r){if("string"==typeof e&&void 0!==re[t]){if(re[t]instanceof RegExp)return re[t].test(e);if("function"==typeof re[t])return re[t](e)}else if(r&&r.customFormats&&"function"==typeof r.customFormats[t])return r.customFormats[t](e);return!0};var ne=G.makeSuffix=function(e){return(e=e.toString()).match(/[.\s\[\]]/)||e.match(/^[\d]/)?e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]":"."+e};function ie(e,t,r,n){"object"==typeof r?t[n]=se(e[n],r):-1===e.indexOf(r)&&t.push(r)}function oe(e,t,r){t[r]=e[r]}function ae(e,t,r,n){"object"==typeof t[n]&&t[n]&&e[n]?r[n]=se(e[n],t[n]):r[n]=t[n]}function se(e,t){var r=Array.isArray(t),n=r&&[]||{};return r?(e=e||[],n=n.concat(e),t.forEach(ie.bind(null,e,n))):(e&&"object"==typeof e&&Object.keys(e).forEach(oe.bind(null,e,n)),Object.keys(t).forEach(ae.bind(null,e,t,n))),n}function ue(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}G.deepCompareStrict=function e(t,r){if(typeof t!=typeof r)return!1;if(Array.isArray(t))return!!Array.isArray(r)&&(t.length===r.length&&t.every((function(n,i){return e(t[i],r[i])})));if("object"==typeof t){if(!t||!r)return t===r;var n=Object.keys(t),i=Object.keys(r);return n.length===i.length&&n.every((function(n){return e(t[n],r[n])}))}return t===r},G.deepMerge=se,G.objectGetPath=function(e,t){for(var r,n=t.split("/").slice(1);"string"==typeof(r=n.shift());){var i=decodeURIComponent(r.replace(/~0/,"~").replace(/~1/g,"/"));if(!(i in e))return;e=e[i]}return e},G.encodePath=function(e){return e.map(ue).join("")},G.getDecimalPlaces=function(e){var t=0;if(isNaN(e))return t;"number"!=typeof e&&(e=Number(e));var r=e.toString().split("e");if(2===r.length){if("-"!==r[1][0])return t;t=Number(r[1].slice(1))}var n=r[0].split(".");return 2===n.length&&(t+=n[1].length),t},G.isSchema=function(e){return"object"==typeof e&&e||"boolean"==typeof e};var ce=G,fe=ce.ValidatorResult,he=ce.SchemaError,le={ignoreProperties:{id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0}},me=le.validators={};function de(e,t,r,n,i){var o=t.throwError,a=t.throwAll;t.throwError=!1,t.throwAll=!1;var s=this.validateSchema(e,i,t,r);return t.throwError=o,t.throwAll=a,!s.valid&&n instanceof Function&&n(s),s.valid}function pe(e,t){if(Object.hasOwnProperty.call(e,t))return e[t];if(t in e)for(;e=Object.getPrototypeOf(e);)if(Object.propertyIsEnumerable.call(e,t))return e[t]}function ve(e,t,r,n,i,o){if(this.types.object(e)&&(!t.properties||void 0===t.properties[i]))if(!1===t.additionalProperties)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var a=t.additionalProperties||{};"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,a,r,n);var s=this.validateSchema(e[i],a,r,n.makeChild(a,i));s.instance!==o.instance[i]&&(o.instance[i]=s.instance),o.importErrors(s)}}me.type=function(e,t,r,n){if(void 0===e)return null;var i=new fe(e,t,r,n),o=Array.isArray(t.type)?t.type:[t.type];if(!o.some(this.testType.bind(this,e,t,r,n))){var a=o.map((function(e){if(e){var t=e.$id||e.id;return t?"<"+t+">":e+""}}));i.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return i},me.anyOf=function(e,t,r,n){if(void 0===e)return null;var i=new fe(e,t,r,n),o=new fe(e,t,r,n);if(!Array.isArray(t.anyOf))throw new he("anyOf must be an array");if(!t.anyOf.some(de.bind(this,e,r,n,(function(e){o.importErrors(e)})))){var a=t.anyOf.map((function(e,t){var r=e.$id||e.id;return r?"<"+r+">":e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));r.nestedErrors&&i.importErrors(o),i.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return i},me.allOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.allOf))throw new he("allOf must be an array");var i=new fe(e,t,r,n),o=this;return t.allOf.forEach((function(t,a){var s=o.validateSchema(e,t,r,n);if(!s.valid){var u=t.$id||t.id||t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+a+"]";i.addError({name:"allOf",argument:{id:u,length:s.errors.length,valid:s},message:"does not match allOf schema "+u+" with "+s.errors.length+" error[s]:"}),i.importErrors(s)}})),i},me.oneOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.oneOf))throw new he("oneOf must be an array");var i=new fe(e,t,r,n),o=new fe(e,t,r,n),a=t.oneOf.filter(de.bind(this,e,r,n,(function(e){o.importErrors(e)}))).length,s=t.oneOf.map((function(e,t){return e.$id||e.id||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));return 1!==a&&(r.nestedErrors&&i.importErrors(o),i.addError({name:"oneOf",argument:s,message:"is not exactly one from "+s.join(",")})),i},me.if=function(e,t,r,n){if(void 0===e)return null;if(!ce.isSchema(t.if))throw new Error('Expected "if" keyword to be a schema');var i,o=de.call(this,e,r,n,null,t.if),a=new fe(e,t,r,n);if(o){if(void 0===t.then)return;if(!ce.isSchema(t.then))throw new Error('Expected "then" keyword to be a schema');i=this.validateSchema(e,t.then,r,n.makeChild(t.then)),a.importErrors(i)}else{if(void 0===t.else)return;if(!ce.isSchema(t.else))throw new Error('Expected "else" keyword to be a schema');i=this.validateSchema(e,t.else,r,n.makeChild(t.else)),a.importErrors(i)}return a},me.propertyNames=function(e,t,r,n){if(this.types.object(e)){var i=new fe(e,t,r,n),o=void 0!==t.propertyNames?t.propertyNames:{};if(!ce.isSchema(o))throw new he('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(void 0!==pe(e,a)){var s=this.validateSchema(a,o,r,n.makeChild(o));i.importErrors(s)}return i}},me.properties=function(e,t,r,n){if(this.types.object(e)){var i=new fe(e,t,r,n),o=t.properties||{};for(var a in o){var s=o[a];if(void 0!==s){if(null===s)throw new he('Unexpected null, expected schema in "properties"');"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,a,s,r,n);var u=pe(e,a),c=this.validateSchema(u,s,r,n.makeChild(s,a));c.instance!==i.instance[a]&&(i.instance[a]=c.instance),i.importErrors(c)}}return i}},me.patternProperties=function(e,t,r,n){if(this.types.object(e)){var i=new fe(e,t,r,n),o=t.patternProperties||{};for(var a in e){var s=!0;for(var u in o){var c=o[u];if(void 0!==c){if(null===c)throw new he('Unexpected null, expected schema in "patternProperties"');try{var f=new RegExp(u,"u")}catch(e){f=new RegExp(u)}if(f.test(a)){s=!1,"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,a,c,r,n);var h=this.validateSchema(e[a],c,r,n.makeChild(c,a));h.instance!==i.instance[a]&&(i.instance[a]=h.instance),i.importErrors(h)}}}s&&ve.call(this,e,t,r,n,a,i)}return i}},me.additionalProperties=function(e,t,r,n){if(this.types.object(e)){if(t.patternProperties)return null;var i=new fe(e,t,r,n);for(var o in e)ve.call(this,e,t,r,n,o,i);return i}},me.minProperties=function(e,t,r,n){if(this.types.object(e)){var i=new fe(e,t,r,n);return Object.keys(e).length>=t.minProperties||i.addError({name:"minProperties",argument:t.minProperties,message:"does not meet minimum property length of "+t.minProperties}),i}},me.maxProperties=function(e,t,r,n){if(this.types.object(e)){var i=new fe(e,t,r,n);return Object.keys(e).length<=t.maxProperties||i.addError({name:"maxProperties",argument:t.maxProperties,message:"does not meet maximum property length of "+t.maxProperties}),i}},me.items=function(e,t,r,n){var i=this;if(this.types.array(e)&&t.items){var o=new fe(e,t,r,n);return e.every((function(e,a){var s=Array.isArray(t.items)?t.items[a]||t.additionalItems:t.items;if(void 0===s)return!0;if(!1===s)return o.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=i.validateSchema(e,s,r,n.makeChild(s,a));return u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u),!0})),o}},me.minimum=function(e,t,r,n){if(this.types.number(e)){var i=new fe(e,t,r,n);return t.exclusiveMinimum&&!0===t.exclusiveMinimum?e>t.minimum||i.addError({name:"minimum",argument:t.minimum,message:"must be greater than "+t.minimum}):e>=t.minimum||i.addError({name:"minimum",argument:t.minimum,message:"must be greater than or equal to "+t.minimum}),i}},me.maximum=function(e,t,r,n){if(this.types.number(e)){var i=new fe(e,t,r,n);return t.exclusiveMaximum&&!0===t.exclusiveMaximum?e<t.maximum||i.addError({name:"maximum",argument:t.maximum,message:"must be less than "+t.maximum}):e<=t.maximum||i.addError({name:"maximum",argument:t.maximum,message:"must be less than or equal to "+t.maximum}),i}},me.exclusiveMinimum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var i=new fe(e,t,r,n);return e>t.exclusiveMinimum||i.addError({name:"exclusiveMinimum",argument:t.exclusiveMinimum,message:"must be strictly greater than "+t.exclusiveMinimum}),i}},me.exclusiveMaximum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var i=new fe(e,t,r,n);return e<t.exclusiveMaximum||i.addError({name:"exclusiveMaximum",argument:t.exclusiveMaximum,message:"must be strictly less than "+t.exclusiveMaximum}),i}};var ye=function(e,t,r,n,i,o){if(this.types.number(e)){var a=t[i];if(0==a)throw new he(i+" cannot be zero");var s=new fe(e,t,r,n),u=ce.getDecimalPlaces(e),c=ce.getDecimalPlaces(a),f=Math.max(u,c),h=Math.pow(10,f);return Math.round(e*h)%Math.round(a*h)!=0&&s.addError({name:i,argument:a,message:o+JSON.stringify(a)}),s}};function be(e,t,r){var n,i=r.length;for(n=t+1;n<i;n++)if(ce.deepCompareStrict(e,r[n]))return!1;return!0}me.multipleOf=function(e,t,r,n){return ye.call(this,e,t,r,n,"multipleOf","is not a multiple of (divisible by) ")},me.divisibleBy=function(e,t,r,n){return ye.call(this,e,t,r,n,"divisibleBy","is not divisible by (multiple of) ")},me.required=function(e,t,r,n){var i=new fe(e,t,r,n);return void 0===e&&!0===t.required?i.addError({name:"required",message:"is required"}):this.types.object(e)&&Array.isArray(t.required)&&t.required.forEach((function(t){void 0===pe(e,t)&&i.addError({name:"required",argument:t,message:"requires property "+JSON.stringify(t)})})),i},me.pattern=function(e,t,r,n){if(this.types.string(e)){var i=new fe(e,t,r,n),o=t.pattern;try{var a=new RegExp(o,"u")}catch(e){a=new RegExp(o)}return e.match(a)||i.addError({name:"pattern",argument:t.pattern,message:"does not match pattern "+JSON.stringify(t.pattern.toString())}),i}},me.format=function(e,t,r,n){if(void 0!==e){var i=new fe(e,t,r,n);return i.disableFormat||ce.isFormat(e,t.format,this)||i.addError({name:"format",argument:t.format,message:"does not conform to the "+JSON.stringify(t.format)+" format"}),i}},me.minLength=function(e,t,r,n){if(this.types.string(e)){var i=new fe(e,t,r,n),o=e.match(/[\uDC00-\uDFFF]/g);return e.length-(o?o.length:0)>=t.minLength||i.addError({name:"minLength",argument:t.minLength,message:"does not meet minimum length of "+t.minLength}),i}},me.maxLength=function(e,t,r,n){if(this.types.string(e)){var i=new fe(e,t,r,n),o=e.match(/[\uDC00-\uDFFF]/g);return e.length-(o?o.length:0)<=t.maxLength||i.addError({name:"maxLength",argument:t.maxLength,message:"does not meet maximum length of "+t.maxLength}),i}},me.minItems=function(e,t,r,n){if(this.types.array(e)){var i=new fe(e,t,r,n);return e.length>=t.minItems||i.addError({name:"minItems",argument:t.minItems,message:"does not meet minimum length of "+t.minItems}),i}},me.maxItems=function(e,t,r,n){if(this.types.array(e)){var i=new fe(e,t,r,n);return e.length<=t.maxItems||i.addError({name:"maxItems",argument:t.maxItems,message:"does not meet maximum length of "+t.maxItems}),i}},me.uniqueItems=function(e,t,r,n){if(!0===t.uniqueItems&&this.types.array(e)){var i=new fe(e,t,r,n);return e.every(be)||i.addError({name:"uniqueItems",message:"contains duplicate item"}),i}},me.dependencies=function(e,t,r,n){if(this.types.object(e)){var i=new fe(e,t,r,n);for(var o in t.dependencies)if(void 0!==e[o]){var a=t.dependencies[o],s=n.makeChild(a,o);if("string"==typeof a&&(a=[a]),Array.isArray(a))a.forEach((function(t){void 0===e[t]&&i.addError({name:"dependencies",argument:s.propertyPath,message:"property "+t+" not found, required by "+s.propertyPath})}));else{var u=this.validateSchema(e,a,r,s);i.instance!==u.instance&&(i.instance=u.instance),u&&u.errors.length&&(i.addError({name:"dependencies",argument:s.propertyPath,message:"does not meet dependency required by "+s.propertyPath}),i.importErrors(u))}}return i}},me.enum=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.enum))throw new he("enum expects an array",t);var i=new fe(e,t,r,n);return t.enum.some(ce.deepCompareStrict.bind(null,e))||i.addError({name:"enum",argument:t.enum,message:"is not one of enum values: "+t.enum.map(String).join(",")}),i},me.const=function(e,t,r,n){if(void 0===e)return null;var i=new fe(e,t,r,n);return ce.deepCompareStrict(t.const,e)||i.addError({name:"const",argument:t.const,message:"does not exactly match expected constant: "+t.const}),i},me.not=me.disallow=function(e,t,r,n){var i=this;if(void 0===e)return null;var o=new fe(e,t,r,n),a=t.not||t.disallow;return a?(Array.isArray(a)||(a=[a]),a.forEach((function(a){if(i.testType(e,t,r,n,a)){var s=a&&(a.$id||a.id)||a;o.addError({name:"not",argument:s,message:"is of prohibited type "+s})}})),o):null};var ge=le,we={},Ae=Y,xe=G;function Ee(e,t){this.id=e,this.ref=t}we.SchemaScanResult=Ee,we.scan=function(e,t){function r(e,t){if(t&&"object"==typeof t)if(t.$ref){var s=Ae.resolve(e,t.$ref);a[s]=a[s]?a[s]+1:0}else{var u=t.$id||t.id,c=u?Ae.resolve(e,u):e;if(c){if(c.indexOf("#")<0&&(c+="#"),o[c]){if(!xe.deepCompareStrict(o[c],t))throw new Error("Schema <"+c+"> already exists with different definition");return o[c]}o[c]=t,"#"==c[c.length-1]&&(o[c.substring(0,c.length-1)]=t)}n(c+"/items",Array.isArray(t.items)?t.items:[t.items]),n(c+"/extends",Array.isArray(t.extends)?t.extends:[t.extends]),r(c+"/additionalItems",t.additionalItems),i(c+"/properties",t.properties),r(c+"/additionalProperties",t.additionalProperties),i(c+"/definitions",t.definitions),i(c+"/patternProperties",t.patternProperties),i(c+"/dependencies",t.dependencies),n(c+"/disallow",t.disallow),n(c+"/allOf",t.allOf),n(c+"/anyOf",t.anyOf),n(c+"/oneOf",t.oneOf),r(c+"/not",t.not)}}function n(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)r(e+"/"+n,t[n])}function i(e,t){if(t&&"object"==typeof t)for(var n in t)r(e+"/"+n,t[n])}var o={},a={};return r(e,t),new Ee(o,a)};var Oe=Y,je=ge,Se=G,Fe=we.scan,ze=Se.ValidatorResult,De=Se.ValidatorResultError,Pe=Se.SchemaError,Ne=Se.SchemaContext,$e=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Re),this.attributes=Object.create(je.validators)};function Ze(e){var t="string"==typeof e?e:e.$ref;return"string"==typeof t&&t}$e.prototype.customFormats={},$e.prototype.schemas=null,$e.prototype.types=null,$e.prototype.attributes=null,$e.prototype.unresolvedRefs=null,$e.prototype.addSchema=function(e,t){var r=this;if(!e)return null;var n=Fe(t||"/",e),i=t||e.$id||e.id;for(var o in n.id)this.schemas[o]=n.id[o];for(var o in n.ref)this.unresolvedRefs.push(o);return this.unresolvedRefs=this.unresolvedRefs.filter((function(e){return void 0===r.schemas[e]})),this.schemas[i]},$e.prototype.addSubSchemaArray=function(e,t){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addSubSchema(e,t[r])},$e.prototype.addSubSchemaObject=function(e,t){if(t&&"object"==typeof t)for(var r in t)this.addSubSchema(e,t[r])},$e.prototype.setSchemas=function(e){this.schemas=e},$e.prototype.getSchema=function(e){return this.schemas[e]},$e.prototype.validate=function(e,t,r,n){if("boolean"!=typeof t&&"object"!=typeof t||null===t)throw new Pe("Expected `schema` to be an object or boolean");r||(r={});var i,o=t.$id||t.id,a=Oe.resolve(r.base||"/",o||"");if(!n){(n=new Ne(t,r,[],a,Object.create(this.schemas))).schemas[a]||(n.schemas[a]=t);var s=Fe(a,t);for(var u in s.id){var c=s.id[u];n.schemas[u]=c}}if(r.required&&void 0===e)return(i=new ze(e,t,r,n)).addError("is required, but is undefined"),i;if(!(i=this.validateSchema(e,t,r,n)))throw new Error("Result undefined");if(r.throwAll&&i.errors.length)throw new De(i);return i},$e.prototype.validateSchema=function(e,t,r,n){var i=new ze(e,t,r,n);if("boolean"==typeof t)!0===t?t={}:!1===t&&(t={type:[]});else if(!t)throw new Error("schema is undefined");if(t.extends)if(Array.isArray(t.extends)){var o={schema:t,ctx:n};t.extends.forEach(this.schemaTraverser.bind(this,o)),t=o.schema,o.schema=null,o.ctx=null,o=null}else t=Se.deepMerge(t,this.superResolve(t.extends,n));var a=Ze(t);if(a){var s=this.resolve(t,a,n),u=new Ne(s.subschema,r,n.path,s.switchSchema,n.schemas);return this.validateSchema(e,s.subschema,r,u)}var c=r&&r.skipAttributes||[];for(var f in t)if(!je.ignoreProperties[f]&&c.indexOf(f)<0){var h=null,l=this.attributes[f];if(l)h=l.call(this,e,t,r,n);else if(!1===r.allowUnknownAttributes)throw new Pe("Unsupported attribute: "+f,t);h&&i.importErrors(h)}if("function"==typeof r.rewrite){var m=r.rewrite.call(this,e,t,r,n);i.instance=m}return i},$e.prototype.schemaTraverser=function(e,t){e.schema=Se.deepMerge(e.schema,this.superResolve(t,e.ctx))},$e.prototype.superResolve=function(e,t){var r=Ze(e);return r?this.resolve(e,r,t).subschema:e},$e.prototype.resolve=function(e,t,r){if(t=r.resolve(t),r.schemas[t])return{subschema:r.schemas[t],switchSchema:t};var n=Oe.parse(t),i=n&&n.hash,o=i&&i.length&&t.substr(0,t.length-i.length);if(!o||!r.schemas[o])throw new Pe("no such schema <"+t+">",e);var a=Se.objectGetPath(r.schemas[o],i.substr(1));if(void 0===a)throw new Pe("no such schema "+i+" located in <"+o+">",e);return{subschema:a,switchSchema:t}},$e.prototype.testType=function(e,t,r,n,i){if(void 0!==i){if(null===i)throw new Pe('Unexpected null in "type" keyword');if("function"==typeof this.types[i])return this.types[i].call(this,e);if(i&&"object"==typeof i){var o=this.validateSchema(e,i,r,n);return void 0===o||!(o&&o.errors.length)}return!0}};var Re=$e.prototype.types={};Re.string=function(e){return"string"==typeof e},Re.number=function(e){return"number"==typeof e&&isFinite(e)},Re.integer=function(e){return"number"==typeof e&&e%1==0},Re.boolean=function(e){return"boolean"==typeof e},Re.array=function(e){return Array.isArray(e)},Re.null=function(e){return null===e},Re.date=function(e){return e instanceof Date},Re.any=function(e){return!0},Re.object=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof Date)};var Ie=$e,Ce="^[a-zA-Z0-9_.-]*$",ke={type:"object",id:"/CreateFsPropsSchema",properties:{databaseName:{minLength:4,maxLength:50,type:"string",pattern:Ce},objectStoreName:{minLength:1,maxLength:20,type:"string",pattern:Ce},rootDirectoryName:{minLength:1,maxLength:20,type:"string",pattern:Ce},databaseVersion:{minimum:1,maximum:100,type:"integer"}},required:["databaseName","databaseVersion","objectStoreName","rootDirectoryName"]};function _e(e){var t,r,n,i=(t=e,r=ke,(new Ie).validate(t,r,n)),o=i.valid,a=i.errors;if(o)return o;var s=JSON.stringify(a);throw new Error("Props passed to createFS function are invalid:\n"+s)}function qe(e,t){return""===e?t:function(e,t){if(!n(e)||!n(t)||""===t)return!1;var r=t+"/";return e.startsWith(r)}(e,t)?e:t+(function(e){return!(!n(e)||0===e.length)&&"/"===e[0]}(e)?"":"/")+e}function Me(e,t){if(!n(t)||""===t)throw new Error("rootDirectoryName parameter was not provided");if(!n(e))throw new Error("fullPath parameter was not provided");if(e===t)return t;var r=qe(e,t);if(!r||!function(e){return!!n(e)&&o.test(e)}(r))throw new Error('"'+e+'" path is invalid.');return r}var Ve="directory";function Le(e){return e?e.result:null}function Te(e,t){t||e(new Error("Something went wrong and the database transaction was not opened."))}var Ue,Be=function(e){var t=e.databaseName,r=e.databaseVersion,n=e.objectStoreName;return new Promise((function(e,i){var o=Je(t,r);o.onupgradeneeded=function(e){var t=Le(e.target);Te(i,t),t.createObjectStore(n,{keyPath:"fullPath"}).createIndex(Ve,Ve,{unique:!1})},o.onsuccess=function(t){var r=t.target,n=Le(r);Te(i,n),e(Le(r))},o.onerror=i}))},Je=function(e,t){return indexedDB.open(e,t)};!function(e){e.FILE="file",e.DIRECTORY="directory"}(Ue||(Ue={}));function Ye(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var Ge=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Ke=function(e){return Ge.exec(e).slice(1)};function He(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=Ye(et(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function We(e){var t=Xe(e),r="/"===tt(e,-1);return(e=Ye(et(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Xe(e){return"/"===e.charAt(0)}var Qe={extname:function(e){return Ke(e)[3]},basename:function(e,t){var r=Ke(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},dirname:function(e){var t=Ke(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},sep:"/",delimiter:":",relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=He(e).substr(1),t=He(t).substr(1);for(var n=r(e.split("/")),i=r(t.split("/")),o=Math.min(n.length,i.length),a=o,s=0;s<o;s++)if(n[s]!==i[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(i.slice(a))).join("/")},join:function(){var e=Array.prototype.slice.call(arguments,0);return We(et(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:Xe,normalize:We,resolve:He};function et(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var tt="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)},rt=function(e){var n=e.isDirectory,i=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,i),[4,n(e)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a directory.');return[4,o("readonly")];case 2:return a=r.sent(),[2,new Promise((function(e,r){var n=a.index(Ve),i=IDBKeyRange.only(t),o=n.openCursor(i);o.onerror=r;var s=[],u=[];o.onsuccess=function(t){var r=t.target.result;if(r){var n=r.value;if(n.type===Ue.FILE){n.data;var i=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(n,["data"]);s.push(i)}else n.type!==Ue.DIRECTORY||n.isRoot||u.push(n);r.continue()}else{var o=s.length,a=u.length;e({isEmpty:0===o&&0===a,filesCount:o,directoriesCount:a,files:s,directories:u})}}}))]}}))}))}},nt={databaseVersion:1,objectStoreName:"files",rootDirectoryName:"root",databaseName:"indexeddb-fs"};function it(e){var n=this,o=void 0===e?nt:e,a=o.databaseName,s=void 0===a?nt.databaseName:a,u=o.databaseVersion,c=void 0===u?nt.databaseVersion:u,f=o.objectStoreName,h=void 0===f?nt.objectStoreName:f,l=o.rootDirectoryName,m=void 0===l?nt.rootDirectoryName:l;var d=function(e){var n=e.databaseName,i=e.databaseVersion,o=e.objectStoreName;return function(e){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,Be({databaseName:n,databaseVersion:i,objectStoreName:o})];case 1:return[2,t.sent().transaction(o,e).objectStore(o)]}}))}))}}({databaseName:s,databaseVersion:c,objectStoreName:h}),p=function(e){var n=e.rootDirectoryName,i=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,o;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,n),[4,i("readonly")];case 1:return o=r.sent(),[2,new Promise((function(e){var r=o.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean(null==r?void 0:r.createdAt))}}))]}}))}))}}({rootDirectoryName:m,initializeObjectStore:d}),v=function(e){var n=e.exists,i=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,i),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" file does not exist.');return[4,o("readonly")];case 2:return a=r.sent(),[2,new Promise((function(e){var r=a.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean((null==r?void 0:r.type)===Ue.FILE))}}))]}}))}))}}({exists:p,rootDirectoryName:m,initializeObjectStore:d}),y=function(e){var n=e.exists,i=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,i),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" file or directory does not exist.');return[4,o("readwrite")];case 2:return a=r.sent(),[2,new Promise((function(e,r){var n=a.delete(t);n.onerror=r,n.onsuccess=function(){return e()}}))]}}))}))}}({exists:p,rootDirectoryName:m,initializeObjectStore:d}),b=function(e){var n=e.isFile,i=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,i),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a file.');return[4,o("readonly")];case 2:return a=r.sent(),[2,new Promise((function(e,r){var n=a.getAll(t);n.onerror=r,n.onsuccess=function(t){var r=t.target.result.find((function(e){return e.type===Ue.FILE}));e(r)}}))]}}))}))}}({isFile:v,rootDirectoryName:m,initializeObjectStore:d}),g=function(e){var n=e.fileDetails;return function(e){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,n(e)];case 1:return[2,t.sent().data]}}))}))}}({fileDetails:b}),w=function(e){var n=e.isFile,i=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,i),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a file.');return[4,o("readwrite")];case 2:return a=r.sent(),[2,new Promise((function(e,r){var n=a.delete(t);n.onerror=r,n.onsuccess=function(){return e()}}))]}}))}))}}({isFile:v,rootDirectoryName:m,initializeObjectStore:d}),A=function(e){var n=e.exists,i=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,i),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" directory does not exist.');return[4,o("readonly")];case 2:return a=r.sent(),[2,new Promise((function(e){var r=a.get(t);r.onerror=function(){return e(!1)},r.onsuccess=function(t){var r=t.target.result;e(Boolean((null==r?void 0:r.type)===Ue.DIRECTORY))}}))]}}))}))}}({exists:p,rootDirectoryName:m,initializeObjectStore:d}),x=function(e){var n=e.isDirectory,o=e.rootDirectoryName,a=e.initializeObjectStore;return function(e,s){return t(void 0,void 0,void 0,(function(){var t,u,c,f;return r(this,(function(r){switch(r.label){case 0:if((t=Me(e,o))===o)throw new Error('Root directory: "'+t+'" cannot be a file.');return u=Qe.basename(t),c=Qe.dirname(t),[4,n(c)];case 1:if(!r.sent())throw new Error('"'+c+'" directory does not exist.');return[4,i((function(){return n(t)}),(function(){return!1}))];case 2:if(r.sent())throw new Error('"'+t+'" you cannot create a file with the same name as the directory.');return[4,a("readwrite")];case 3:return f=r.sent(),[2,new Promise((function(e,r){var n={data:s,directory:c,name:u,type:Ue.FILE,createdAt:Date.now(),fullPath:t},i=f.put(n);i.onerror=r,i.onsuccess=function(){return e(n)}}))]}}))}))}}({isDirectory:A,rootDirectoryName:m,initializeObjectStore:d}),E=rt({isDirectory:A,rootDirectoryName:m,initializeObjectStore:d}),O=function(e){var n=e.isFile,o=e.isDirectory,a=e.rootDirectoryName,s=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,u,c,f;return r(this,(function(r){switch(r.label){case 0:if((t=Me(e,a))===a)throw new Error('Root directory: "'+t+'" already exist.');return u=Qe.basename(t),c=Qe.dirname(t),[4,o(c)];case 1:if(!r.sent())throw new Error('"'+c+'" is not a directory.');return[4,i((function(){return n(t)}),(function(){return!1}))];case 2:if(r.sent())throw new Error('"'+t+'" you cannot create a directory with the same name as the file.');return[4,s("readwrite")];case 3:return f=r.sent(),[2,new Promise((function(e,r){var n={directory:c,isRoot:!1,name:u,createdAt:Date.now(),type:Ue.DIRECTORY,fullPath:t},i=f.put(n);i.onerror=r,i.onsuccess=function(){return e(n)}}))]}}))}))}}({isFile:v,isDirectory:A,rootDirectoryName:m,initializeObjectStore:d}),j=function(e){var n=e.remove,o=e.isDirectory,a=e.readDirectory,s=e.rootDirectoryName;function u(e){return t(this,void 0,void 0,(function(){var t,o,c,f,h,l,m,d,p,v,y,b,g;return r(this,(function(w){switch(w.label){case 0:return t=Me(e,s),[4,a(t)];case 1:if(o=w.sent(),c=o.filesCount,f=o.directoriesCount,h=o.files,l=o.directories,!(c>0))return[3,5];m=0,d=h,w.label=2;case 2:return m<d.length?(p=d[m],[4,n(p.fullPath)]):[3,5];case 3:w.sent(),w.label=4;case 4:return m++,[3,2];case 5:return f?[3,7]:[4,n(e)];case 6:return w.sent(),[2];case 7:v=function(e){return r(this,(function(t){switch(t.label){case 0:return e.isRoot?[3,2]:[4,u(e.fullPath)];case 1:t.sent(),t.label=2;case 2:return[4,i((function(){return n(e.fullPath)}))];case 3:return t.sent(),[2]}}))},y=0,b=l,w.label=8;case 8:return y<b.length?(g=b[y],[5,v(g)]):[3,11];case 9:w.sent(),w.label=10;case 10:return y++,[3,8];case 11:return[2]}}))}))}return function(e){return t(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,o(e)];case 1:if(!t.sent())throw new Error('"'+e+'" is not a directory.');return[4,u(e)];case 2:return t.sent(),e===s?[3,4]:[4,n(e)];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))}}({remove:y,isDirectory:A,readDirectory:E,rootDirectoryName:m}),S=function(e){var n=e.isDirectory,i=e.rootDirectoryName,o=e.initializeObjectStore;return function(e){return t(void 0,void 0,void 0,(function(){var t,a;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,i),[4,n(e)];case 1:if(!r.sent())throw new Error('"'+t+'" is not a directory.');return[4,o("readonly")];case 2:return a=r.sent(),[2,new Promise((function(e,r){var n=a.getAll(t);n.onerror=r,n.onsuccess=function(t){var r=t.target.result.find((function(e){return e.type===Ue.DIRECTORY}));e(r)}}))]}}))}))}}({isDirectory:A,rootDirectoryName:m,initializeObjectStore:d}),F=function(e){var n=e.exists,i=e.isFile,o=e.isDirectory,a=e.fileDetails,s=e.directoryDetails,u=e.rootDirectoryName;return function(e){return t(void 0,void 0,void 0,(function(){var t,c,f;return r(this,(function(r){switch(r.label){case 0:return t=Me(e,u),[4,n(t)];case 1:if(!r.sent())throw new Error('"'+t+'" file or directory does not exist.');return[4,i(t)];case 2:return c=r.sent(),[4,o(t)];case 3:if(f=r.sent(),c&&f)throw new Error('"'+t+'" is a path of file and directory.');return c?[2,a(t)]:[2,s(t)]}}))}))}}({isFile:v,exists:p,isDirectory:A,fileDetails:b,directoryDetails:S,rootDirectoryName:m}),z=function(e){var n=e.rootDirectoryName,i=e.initializeObjectStore;return function(){return t(void 0,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return[4,i("readwrite")];case 1:return e=t.sent(),[2,new Promise((function(t,r){var i={isRoot:!0,createdAt:Date.now(),name:n,type:Ue.DIRECTORY,fullPath:n,directory:n},o=e.put(i);o.onerror=r,o.onsuccess=function(){return t(i)}}))]}}))}))}}({rootDirectoryName:m,initializeObjectStore:d});function D(){return t(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,p(m)];case 1:return e.sent()?[3,3]:[4,z()];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))}var P=function(e){return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return t(n,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,D()];case 1:return t.sent(),[2,e.apply(void 0,i)]}}))}))}};return function(){if(!Boolean(indexedDB))throw new Error("Your browser does not support indexedDB.")}(),_e({databaseName:s,objectStoreName:h,databaseVersion:c,rootDirectoryName:m}),{databaseName:s,databaseVersion:c,objectStoreName:h,rootDirectoryName:m,exists:P(p),isFile:P(v),remove:P(y),details:P(F),readFile:P(g),writeFile:P(x),removeFile:P(w),fileDetails:P(b),isDirectory:P(A),readDirectory:P(E),createDirectory:P(O),removeDirectory:P(j),directoryDetails:P(S)}}var ot=it();e.createFs=it,e.default=ot,Object.defineProperty(e,"__esModule",{value:!0})}));
export * from './is-string/is-string.function';
export * from './is-function/is-function.function';
export * from './try-catch-wrapper/try-catch-wrapper.function';
{
"name": "indexeddb-fs",
"version": "1.0.1",
"version": "1.1.0",
"description": "An 'fs' kind of library dedicated for the browser. It works based on indexed-db.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -5,2 +5,6 @@ # indexeddb-fs

## Motivation
Any other solutions I've found didn't work correctly.
## Super quick start

@@ -13,17 +17,183 @@

```js
import { isFile, writeFile, isDirectory, createDirectory, rootDirectoryName } from 'indexeddb-fs';
import fs from 'indexeddb-fs';
await createDirectory('files');
await createDirectory('/files/private');
await createDirectory('root/files/public');
await fs.createDirectory('files');
await fs.createDirectory('/files/private');
await fs.createDirectory('root/files/public');
console.log(await isDirectory('root')); // true
console.log(await isDirectory('files')); // true
console.log(await isDirectory('/files/private')); // true
console.log(await fs.isDirectory('root')); // true
console.log(await fs.isDirectory('files')); // true
console.log(await fs.isDirectory('/files/private')); // true
await writeFile('files/public/file.txt', 'content');
console.log(await isFile('files/public/file.txt')); // true
console.log(await isDirectory('files/public/file.txt')); // false
await fs.writeFile('files/public/file.txt', 'content');
await removeDirectory(rootDirectoryName);
console.log(await fs.isFile('files/public/file.txt')); // true
console.log(await fs.isDirectory('files/public/file.txt')); // false
await fs.removeDirectory(rootDirectoryName);
```
## API
All methods return a Promise. Unfortunately, indexedDB is not a synchronous API :(
Every function returns an error when an error occurs. The Promise will be rejected with an `Error` object.
# fs.exists(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<boolean>`
Returns true if the path exists, false otherwise.
# fs.isFile(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<boolean>`
Returns true if the path contains a file, false otherwise.
Throws an error when the path does not contain anything.
# fs.isDirectory(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<boolean>`
Returns true if the path contains a directory, false otherwise.
Throws an error when the path does not contain anything.
# fs.remove(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<void>`
Removes files and directories. It does not remove directories recursively!
Throws an error when the path does not contain anything.
# fs.details(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<FileEntry<any> | DirectoryEntry>`
Returns an object with details about the file or directory.
Throws an error when the path does not contain anything.
Example result for `FileEntry<any>` type:
```object
{
type: 'file',
name: 'file.txt',
directory: 'root',
data: 'test 2 content',
createdAt: 1626882161631,
fullPath: 'root/file.txt'
}
```
Example result for `DirectoryEntry` type:
```object
{
isRoot: false,
directory: 'root',
type: 'directory',
name: 'directory',
createdAt: 1626882291087,
fullPath: 'root/directory'
}
```
# fs.writeFile(fullPath, data)
Parameters: [`fullPath`: string, `data`: TData]
Returns: `Promise<FileEntry<TData>>`
Writes `data` to the file, replacing the file if it already exists. `data` can be everything that you want.
Throws an error when the destination directory of the file does not exist.
Throws an error when the path contains a directory with the same name.
Example result for `FileEntry<TData>` type:
```object
{
type: 'file',
name: 'file.txt',
directory: 'root',
data: 'test 2 content',
createdAt: 1626882161631,
fullPath: 'root/file.txt'
}
```
# fs.readFile(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<TData>`
Reads the entire contents of a file. The returned data type has the same type with which it was saved.
Throws an error when the destination file does not exist.
Throws an error when the destination file is not a file.
# fs.removeFile(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<void>`
Throws an error when the path does not contain anything.
Throws an error when the destination file is not a file.
# fs.createDirectory(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<DirectoryEntry>`
Creates a directory at `fullPath` and returns a Promise.
Throws an error when the destination directory of the directory does not exist.
Throws an error when the path contains a file with the same name.
Example result for `DirectoryEntry` type:
```object
{
isRoot: false,
directory: 'root',
type: 'directory',
name: 'directory',
createdAt: 1626882291087,
fullPath: 'root/directory'
}
```
# fs.readDirectory(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<ReadDirectoryDecoratorOutput>`
Reads the entire contents of a directory.
Throws an error when the destination directory does not exist.
Throws an error when the destination directory is not a directory.
Example result for `ReadDirectoryDecoratorOutput` type:
```object
{
files: [],
filesCount: 0,
isEmpty: true,
directories: [],
directoriesCount: 0,
}
```
# fs.removeDirectory(fullPath)
Parameters: [`fullPath`: string]
Returns: `Promise<void>`
Removes the directory, recursively removing any files/subdirectories contained within.
Throws an error when the destination directory does not exist.
Throws an error when the destination directory is not a directory.
## License
MIT

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc