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.2.4 to 1.2.5

dist/utils/functions/get-directory-name/get-directory-name.function.d.ts

4

dist/index.umd.min.js

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

@@ -6,2 +6,3 @@ export * from './is-string/is-string.function';

export * from './starts-with-slash/starts-with-slash.function';
export * from './get-directory-name/get-directory-name.function';
export * from './validate-create-fs-props/validate-create-fs-props.function';

@@ -8,0 +9,0 @@ export * from './has-root-directory-prefix/has-root-directory-prefix.function';

import { CreateFsProps } from "../../../framework/create-fs.types";
export declare function validateCreateFSProps(props: Required<CreateFsProps>): boolean;
export declare function validateCreateFsProps(props: Required<CreateFsProps>): boolean;

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

export * from './to-match-snapshot.function';
export * from './function-import-test.function';
export * from './to-match-snapshot/to-match-snapshot.function';
export * from './function-import-test/function-import-test.function';
{
"name": "indexeddb-fs",
"version": "1.2.4",
"version": "1.2.5",
"description": "An 'fs' kind of library dedicated to the browser",

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

@@ -57,2 +57,59 @@ # indexeddb-fs

## A bit more complex with copy, move, remove and rename files
```js
import {
isFile,
exists,
copyFile,
moveFile,
readFile,
writeFile,
removeFile,
renameFile,
fileDetails,
readDirectory,
createDirectory,
removeDirectory,
rootDirectoryName,
} from 'indexeddb-fs';
await createDirectory('files');
await createDirectory('copied_files');
await writeFile('files/file.txt', 'content');
await copyFile('files/file.txt', 'copied_files/copied_file.txt');
await expect(isFile('files/file.txt')).resolves.toBeTruthy();
await expect(isFile('copied_files/copied_file.txt')).resolves.toBeTruthy();
await removeFile('files/file.txt');
await renameFile('copied_files/copied_file.txt', 'file.txt');
await expect(exists('copied_files/file.txt')).resolves.toBeTruthy();
await expect(exists('copied_files/copied_file.txt')).resolves.toBeFalsy();
await moveFile('copied_files/file.txt', 'files/file.txt');
await expect(isFile('files/file.txt')).resolves.toBeTruthy();
await expect(exists('copied_files/file.txt')).resolves.toBeFalsy();
await moveFile('files/file.txt', 'file.txt');
await removeDirectory('files');
await removeDirectory('copied_files');
const { filesCount, directoriesCount } = await readDirectory(rootDirectoryName);
expect(filesCount).toEqual(1);
expect(directoriesCount).toEqual(0);
const details = await fileDetails('file.txt');
expect(details.type).toEqual('file');
expect(details.data).toEqual('content');
expect(details.name).toEqual('file.txt');
expect(details.fullPath).toEqual('root/file.txt');
expect(details.directory).toEqual(rootDirectoryName);
await expect(readFile('file.txt')).resolves.toEqual('content');
```
### Custom fs object

@@ -59,0 +116,0 @@

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