filer/dist/filer.min.js

81 lines
87 KiB
JavaScript
Raw Normal View History

parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"c0Ea":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.promisify=e;var r="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__";function e(n){if("function"!=typeof n)throw new TypeError("Argument to promisify must be a function");var o=n[r],t=e.Promise||Promise;if("function"!=typeof t)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var r=this,e=arguments.length,i=new Array(e),f=0;f<e;f++)i[f]=arguments[f];return new t(function(e,t){i.push(function(r){if(r)return t(r);for(var n=arguments.length,i=new Array(n>1?n-1:0),f=1;f<n;f++)i[f-1]=arguments[f];if(1===i.length||!o)return e(i[0]);var u={};i.forEach(function(r,e){var n=o[e];n&&(u[n]=r)}),e(u)}),n.apply(r,i)})}}e.argumentNames=r,e.Promise=void 0;
},{}],"pBGv":[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],"UUq2":[function(require,module,exports) {
var process = require("process");
var r=require("process");function t(r,t){for(var e=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}function e(r){"string"!=typeof r&&(r+="");var t,e=0,n=-1,o=!0;for(t=r.length-1;t>=0;--t)if(47===r.charCodeAt(t)){if(!o){e=t+1;break}}else-1===n&&(o=!1,n=t+1);return-1===n?"":r.slice(e,n)}function n(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n<r.length;n++)t(r[n],n,r)&&e.push(r[n]);return e}exports.resolve=function(){for(var e="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var i=s>=0?arguments[s]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,o="/"===i.charAt(0))}return(o?"/":"")+(e=t(n(e.split("/"),function(r){return!!r}),!o).join("/"))||"."},exports.normalize=function(r){var e=exports.isAbsolute(r),s="/"===o(r,-1);return(r=t(n(r.split("/"),function(r){return!!r}),!e).join("/"))||e||(r="."),r&&s&&(r+="/"),(e?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(n(r,function(r,t){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split("/")),o=e(t.split("/")),s=Math.min(n.length,o.length),i=s,u=0;u<s;u++)if(n[u]!==o[u]){i=u;break}var f=[];for(u=i;u<n.length;u++)f.push("..");return(f=f.concat(o.slice(i))).join("/")},exports.sep="/",exports.delimiter=":",exports.dirname=function(r){if("string"!=typeof r&&(r+=""),0===r.length)return".";for(var t=r.charCodeAt(0),e=47===t,n=-1,o=!0,s=r.length-1;s>=1;--s)if(47===(t=r.charCodeAt(s))){if(!o){n=s;break}}else o=!1;return-1===n?e?"/":".":e&&1===n?"/":r.slice(0,n)},exports.basename=function(r,t){var n=e(r);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},exports.extname=function(r){"string"!=typeof r&&(r+="");for(var t=-1,e=0,n=-1,o=!0,s=0,i=r.length-1;i>=0;--i){var u=r.charCodeAt(i);if(47!==u)-1===n&&(o=!1,n=i+1),46===u?-1===t?t=i:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){e=i+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===e+1?"":r.slice(t,n)};var o="b"==="ab".substr(-1)?function(r,t,e){return r.substr(t,e)}:function(r,t,e){return t<0&&(t=r.length+t),r.substr(t,e)};
},{"process":"pBGv"}],"UzoP":[function(require,module,exports) {
var process = require("process");
var e=require("process");e.cwd=function(){return"/"};var r=require("path"),n=Object.create(r);n.basename=function(e,n){var i=r.basename(e,n);return""===i?"/":i},n.normalize=function(e){return"/"===(e=r.normalize(e))?e:n.removeTrailing(e)},n.isNull=function(e){return-1!==(""+e).indexOf("\0")},n.addTrailing=function(e){return e.replace(/\/*$/,"/")},n.removeTrailing=function(e){return""===(e=e.replace(/\/*$/,""))?"/":e},module.exports=n;
},{"path":"UUq2","process":"pBGv"}],"iJA9":[function(require,module,exports) {
var _="READ",E="WRITE",O="CREATE",R="EXCLUSIVE",I="TRUNCATE",S="APPEND",T="CREATE",N="REPLACE";module.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",NODE_TYPE_FILE:"FILE",NODE_TYPE_DIRECTORY:"DIRECTORY",NODE_TYPE_SYMBOLIC_LINK:"SYMLINK",NODE_TYPE_META:"META",DEFAULT_DIR_PERMISSIONS:493,DEFAULT_FILE_PERMISSIONS:420,FULL_READ_WRITE_EXEC_PERMISSIONS:511,READ_WRITE_PERMISSIONS:438,SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",FS_NODUPEIDCHECK:"FS_NODUPEIDCHECK",O_READ:_,O_WRITE:E,O_CREATE:O,O_EXCLUSIVE:R,O_TRUNCATE:I,O_APPEND:S,O_FLAGS:{r:[_],"r+":[_,E],w:[E,O,I],"w+":[E,_,O,I],wx:[E,O,R,I],"wx+":[E,_,O,R,I],a:[E,O,S],"a+":[E,_,O,S],ax:[E,O,R,S],"ax+":[E,_,O,R,S]},XATTR_CREATE:T,XATTR_REPLACE:N,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""},fsConstants:{O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_DSYNC:4194304,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_COPYFILE_EXCL:1,COPYFILE_EXCL:1}};
},{}],"yh9p":[function(require,module,exports) {
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
},{}],"JgNJ":[function(require,module,exports) {
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],"REa7":[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],"dskh":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.
},{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"REa7","buffer":"dskh"}],"QO4x":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
2019-02-07 21:38:32 +00:00
var global = arguments[3];
var t=require("buffer").Buffer,e=arguments[3],r=require("../constants.js").FILE_SYSTEM_NAME,n=require("../constants.js").FILE_STORE_NAME,o=require("../constants.js").IDB_RW,u=require("../constants.js").IDB_RO;function c(t,e){this.db=t,this.mode=e}function i(t){this.name=t||r,this.db=null}c.prototype._getObjectStore=function(){if(this.objectStore)return this.objectStore;var t=this.db.transaction(n,this.mode);return this.objectStore=t.objectStore(n),this.objectStore},c.prototype.clear=function(t){try{var e=this._getObjectStore().clear();e.onsuccess=function(){t()},e.onerror=function(e){e.preventDefault(),t(e.error)}}catch(r){t(r)}},c.prototype._get=function(t,e){try{var r=this._getObjectStore().get(t);r.onsuccess=function(t){var r=t.target.result;e(null,r)},r.onerror=function(t){t.preventDefault(),e(t.error)}}catch(n){e(n)}},c.prototype.getObject=function(t,e){this._get(t,e)},c.prototype.getBuffer=function(e,r){this._get(e,function(e,n){if(e)return r(e);r(null,t.from(n))})},c.prototype._put=function(t,e,r){try{var n=this._getObjectStore().put(e,t);n.onsuccess=function(t){var e=t.target.result;r(null,e)},n.onerror=function(t){t.preventDefault(),r(t.error)}}catch(o){r(o)}},c.prototype.putObject=function(t,e,r){this._put(t,e,r)},c.prototype.putBuffer=function(t,e,r){var n=e.buffer;this._put(t,n,r)},c.prototype.delete=function(t,e){try{var r=this._getObjectStore().delete(t);r.onsuccess=function(t){var r=t.target.result;e(null,r)},r.onerror=function(t){t.preventDefault(),e(t.error)}}catch(n){e(n)}},i.isSupported=function(){return!!(e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB)},i.prototype.open=function(t){var r=this;if(r.db)return t();try{var o=(e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB).open(r.name);o.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(n)&&e.deleteObjectStore(n),e.createObjectStore(n)},o.onsuccess=function(e){r.db=e.target.result,t()},o.onerror=function(e){e.preventDefault(),t(e.error)}}catch(u){t(u)}},i.prototype.getReadOnlyContext=function(){return new c(this.db,u)},i.prototype.getReadWriteContext=function(){return new c(this.db,o)},module.exports=i;
},{"../constants.js":"iJA9","buffer":"dskh"}],"u4Zs":[function(require,module,exports) {
var process = require("process");
var define;
var e,t=require("process");!function(){var n={};void 0!==t&&t.nextTick?(n.nextTick=t.nextTick,"undefined"!=typeof setImmediate?n.setImmediate=function(e){setImmediate(e)}:n.setImmediate=n.nextTick):"function"==typeof setImmediate?(n.nextTick=function(e){setImmediate(e)},n.setImmediate=n.nextTick):(n.nextTick=function(e){setTimeout(e,0)},n.setImmediate=n.nextTick),n.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var i=0;!function o(){t(e[i],function(t){t?(n(t),n=function(){}):(i+=1)>=e.length?n():o()})}()},n.forEachSeries=n.eachSeries,void 0!==e&&e.amd?e([],function(){return n}):"undefined"!=typeof module&&module.exports?module.exports=n:root.async=n}();
},{"process":"pBGv"}],"OWym":[function(require,module,exports) {
var t=require("../constants.js").FILE_SYSTEM_NAME,e=require("../../lib/async.js").setImmediate,o=function(){var t={};return function(e){return Object.prototype.hasOwnProperty.call(t,e)||(t[e]={}),t[e]}}();function n(t,e){this.readOnly=e,this.objectStore=t}function r(e){this.name=e||t}n.prototype.clear=function(t){if(this.readOnly)e(function(){t("[MemoryContext] Error: write operation on read only context")});else{var o=this.objectStore;Object.keys(o).forEach(function(t){delete o[t]}),e(t)}},n.prototype.getObject=n.prototype.getBuffer=function(t,o){var n=this;e(function(){o(null,n.objectStore[t])})},n.prototype.putObject=n.prototype.putBuffer=function(t,o,n){this.readOnly?e(function(){n("[MemoryContext] Error: write operation on read only context")}):(this.objectStore[t]=o,e(n))},n.prototype.delete=function(t,o){this.readOnly?e(function(){o("[MemoryContext] Error: write operation on read only context")}):(delete this.objectStore[t],e(o))},r.isSupported=function(){return!0},r.prototype.open=function(t){this.db=o(this.name),e(t)},r.prototype.getReadOnlyContext=function(){return new n(this.db,!0)},r.prototype.getReadWriteContext=function(){return new n(this.db,!1)},module.exports=r;
},{"../constants.js":"iJA9","../../lib/async.js":"u4Zs"}],"AiW7":[function(require,module,exports) {
2019-01-03 04:12:19 +00:00
var e=require("./indexeddb.js"),r=require("./memory.js");module.exports={IndexedDB:e,Default:e,Memory:r};
},{"./indexeddb.js":"QO4x","./memory.js":"OWym"}],"p8GN":[function(require,module,exports) {
2019-01-03 04:12:19 +00:00
var t={};["3:EACCES:permission denied","9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","18:EINVAL:invalid argument","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","34:ENOENT:no such file or directory","47:EEXIST:file already exists","50:EPERM:operation not permitted","51:ELOOP:too many symbolic links encountered","53:ENOTEMPTY:directory not empty","55:EIO:i/o error","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(e){var o=+(e=e.split(":"))[0],r=e[1],i=e[2];function s(t,e){Error.call(this),this.name=r,this.code=r,this.errno=o,this.message=t||i,e&&(this.path=e),this.stack=new Error(this.message).stack}s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s.prototype.toString=function(){var t=this.path?", '"+this.path+"'":"";return this.name+": "+this.message+t},t[r]=t[o]=s}),module.exports=t;
},{}],"QMiB":[function(require,module,exports) {
2019-02-07 21:38:32 +00:00
"use strict";var t=require("../constants.js").ENVIRONMENT;module.exports=function(n){(n=n||{}).TMP=n.TMP||t.TMP,n.PATH=n.PATH||t.PATH,this.get=function(t){return n[t]},this.set=function(t,s){n[t]=s}};
},{"../constants.js":"iJA9"}],"bQx9":[function(require,module,exports) {
module.exports=function(t,o){for(var a=[],e=0;e<t.length;e++){var n=o(t[e],e);r(n)?a.push.apply(a,n):a.push(n)}return a};var r=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};
},{}],"D9yG":[function(require,module,exports) {
"use strict";function e(e,r,i){e instanceof RegExp&&(e=n(e,i)),r instanceof RegExp&&(r=n(r,i));var o=t(e,r,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+e.length,o[1]),post:i.slice(o[1]+r.length)}}function n(e,n){var t=n.match(e);return t?t[0]:null}function t(e,n,t){var r,i,o,f,l,s=t.indexOf(e),c=t.indexOf(n,s+1),p=s;if(s>=0&&c>0){for(r=[],o=t.length;p>=0&&!l;)p==s?(r.push(p),s=t.indexOf(e,p+1)):1==r.length?l=[r.pop(),c]:((i=r.pop())<o&&(o=i,f=c),c=t.indexOf(n,p+1)),p=s<c&&s>=0?s:c;r.length&&(l=[o,f])}return l}module.exports=e,e.range=t;
},{}],"dwXQ":[function(require,module,exports) {
var t=require("concat-map"),r=require("balanced-match");module.exports=f;var n="\0SLASH"+Math.random()+"\0",e="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",a="\0PERIOD"+Math.random()+"\0";function s(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function p(t){return t.split("\\\\").join(n).split("\\{").join(e).split("\\}").join(i).split("\\,").join(o).split("\\.").join(a)}function u(t){return t.split(n).join("\\").split(e).join("{").split(i).join("}").split(o).join(",").split(a).join(".")}function l(t){if(!t)return[""];var n=[],e=r("{","}",t);if(!e)return t.split(",");var i=e.pre,o=e.body,a=e.post,s=i.split(",");s[s.length-1]+="{"+o+"}";var p=l(a);return a.length&&(s[s.length-1]+=p.shift(),s.push.apply(s,p)),n.push.apply(n,s),n}function f(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),m(p(t),!0).map(u)):[]}function h(t){return t}function d(t){return"{"+t+"}"}function c(t){return/^-?0\d/.test(t)}function v(t,r){return t<=r}function g(t,r){return t>=r}function m(n,e){var o=[],a=r("{","}",n);if(!a||/\$$/.test(a.pre))return[n];var p,u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),h=u||f,b=a.body.indexOf(",")>=0;if(!h&&!b)return a.post.match(/,.*\}/)?m(n=a.pre+"{"+a.body+i+a.post):[n];if(h)p=a.body.split(/\.\./);else if(1===(p=l(a.body)).length&&1===(p=m(p[0],!1).map(d)).length)return(M=a.post.length?m(a.post,!1):[""]).map(function(t){return a.pre+p[0]+t});var j,y=a.pre,M=a.post.length?m(a.post,!1):[""];if(h){var A=s(p[0]),C=s(p[1]),O=Math.max(p[0].length,p[1].length),S=3==p.length?Math.abs(s(p[2])):1,$=v;C<A&&(S*=-1,$=g);var x=p.some(c);j=[];for(var E=A;$(E,C);E+=S){var I;if(f)"\\"===(I=String.fromCharCode(E))&&(I="");else if(I=String(E),x){var q=O-I.length;if(q>0){var z=new Array(q+1).join("0");I=E<0?"-"+z+I.slice(1):z+I}}j.push(I)}}else j=t(p,function(t){return m(t,!1)});for(var L=0;L<j.length;L++)for(var P=0;P<M.length;P++){var Z=y+j[L]+M[P];(!e||h||Z)&&o.push(Z)}return o}
},{"concat-map":"bQx9","balanced-match":"D9yG"}],"NtKi":[function(require,module,exports) {
module.exports=g,g.Minimatch=l;var t={sep:"/"};try{t=require("path")}catch(O){}var e=g.GLOBSTAR=l.GLOBSTAR={},n=require("brace-expansion"),r={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},i="[^/]",s=i+"*?",a="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",o="(?:(?!(?:\\/|^)\\.).)*?",h=c("().*{}+?[]^$\\!");function c(t){return t.split("").reduce(function(t,e){return t[e]=!0,t},{})}var u=/\/+/;function p(t,e){return e=e||{},function(n,r,i){return g(n,t,e)}}function f(t,e){t=t||{},e=e||{};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}function g(t,e,n){if("string"!=typeof e)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===e.charAt(0))&&(""===e.trim()?""===t:new l(e,n).match(t))}function l(e,n){if(!(this instanceof l))return new l(e,n);if("string"!=typeof e)throw new TypeError("glob pattern string required");n||(n={}),e=e.trim(),"/"!==t.sep&&(e=e.split(t.sep).join("/")),this.options=n,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function d(){if(!this._made){var t=this.pattern,e=this.options;if(e.nocomment||"#"!==t.charAt(0))if(t){this.parseNegate();var n=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,n),n=this.globParts=n.map(function(t){return t.split(u)}),this.debug(this.pattern,n),n=n.map(function(t,e,n){return t.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(t){return-1===t.indexOf(!1)}),this.debug(this.pattern,n),this.set=n}else this.empty=!0;else this.comment=!0}}function b(){var t=this.pattern,e=!1,n=0;if(!this.options.nonegate){for(var r=0,i=t.length;r<i&&"!"===t.charAt(r);r++)e=!e,n++;n&&(this.pattern=t.substr(n)),this.negate=e}}function m(t,e){if(e||(e=this instanceof l?this.options:{}),void 0===(t=void 0===t?this.pattern:t))throw new TypeError("undefined pattern");return e.nobrace||!t.match(/\{.*\}/)?[t]:n(t)}g.filter=p,g.defaults=function(t){if(!t||!Object.keys(t).length)return g;var e=g,n=function(n,r,i){return e.minimatch(n,r,f(t,i))};return n.Minimatch=function(n,r){return new e.Minimatch(n,f(t,r))},n},l.defaults=function(t){return t&&Object.keys(t).length?g.defaults(t).Minimatch:l},l.prototype.debug=function(){},l.prototype.make=d,l.prototype.parseNegate=b,g.braceExpand=function(t,e){return m(t,e)},l.prototype.braceExpand=m,l.prototype.parse=y;var v={};function y(t,n){if(t.length>65536)throw new TypeError("pattern is too long");var a=this.options;if(!a.noglobstar&&"**"===t)return e;if(""===t)return"";var o,c="",u=!!a.nocase,p=!1,f=[],g=[],l=!1,d=-1,b=-1,m="."===t.charAt(0)?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=this;function w(){if(o){switch(o){case"*":c+=s,u=!0;break;case"?":c+=i,u=!0;break;default:c+="\\"+o}y.debug("clearStateChar %j %j",o,c),o=!1}}for(var x,j=0,k=t.length;j<k&&(x=t.charAt(j));j++)if(this.debug("%s\t%s %s %j",t,j,c,x),p&&h[x])c+="\\"+x,p=!1;else switch(x){case"/":return!1;case"\\":w(),p=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,j,c,x),l){this.debug(" in class"),"!"===x&&j===b+1&&(x="^"),c+=x;continue}y.debug("call clearStateChar %j",o),w(),o=x,a.noext&&w();continue;case"(":if(l){c+="(";continue}if(!o){c+="\\(";continue}f.push({type:o,start:j-1,reStart:c.length,open:r[o].open,close:r[o].close}),c+="!"===o?"(?:(?!(?:":"(?:",this.debug("plType %j %j",o,c),o=!1;continue;case")":if(l||!f.length){c+="\\)";continue}w(),u=!0;var A=f.pop();c+=A.close,"!"===A.type&&g.push(A),A.reEnd=c.length;continue;case"|":if(l||!f.length||p){c+="\\|",p=!1;continue}w(),c+="|";continue;case"[":if(w(),l){c+="\\"+x;continue}l=!0,b=j,d=c.length,c+=x;continue;case"]":if(j===b+1||!l){c+="\\"+x,p=!1;continue}if(l){var S=t.substring(b+1,j);try{RegExp("["+S+"]")}catch(O){var $=this.parse(S,v);c=c.substr(0,d)+"\\["+$[0]+"\\]",u=u||$[1],l=!1;continue}}u=!0,l=!1,c+=x;continue;default:w(),p?p=!1:!h[x]||"^"===x&&l||(c+="\\"),c+
},{"path":"UUq2","brace-expansion":"dwXQ"}],"D1Ra":[function(require,module,exports) {
var n=require("es6-promisify"),t=n.promisify,e=require("../path.js"),i=require("../errors.js"),r=require("./environment.js"),o=require("../../lib/async.js"),u=require("minimatch");function c(n,o){var u=this,c=new r((o=o||{}).env),f="/";Object.defineProperty(this,"fs",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return c},enumerable:!0}),this.cd=function(t,r){t=e.resolve(f,t),n.stat(t,function(n,e){n?r(new i.ENOTDIR(null,t)):"DIRECTORY"===e.type?(f=t,r()):r(new i.ENOTDIR(null,t))})},this.pwd=function(){return f},this.promises={},["cd","exec","touch","cat","ls","rm","tempDir","mkdirp","find"].forEach(function(n){u.promises[n]=t(u[n].bind(u))})}c.prototype.exec=function(n,t,i){var r=this.fs;"function"==typeof t&&(i=t,t=[]),t=t||[],i=i||function(){},n=e.resolve(this.pwd(),n),r.readFile(n,"utf8",function(n,e){if(n)i(n);else try{new Function("fs","args","callback",e)(r,t,i)}catch(o){i(o)}})},c.prototype.touch=function(n,t,i){var r=this.fs;"function"==typeof t&&(i=t,t={}),t=t||{},i=i||function(){},n=e.resolve(this.pwd(),n),r.stat(n,function(e){e?!0===t.updateOnly?i():function(n){r.writeFile(n,"",i)}(n):function(n){var e=Date.now(),o=t.date||e,u=t.date||e;r.utimes(n,o,u,i)}(n)})},c.prototype.cat=function(n,t){var r=this,u=r.fs,c="";t=t||function(){},n?(n="string"==typeof n?[n]:n,o.eachSeries(n,function(n,t){var i=e.resolve(r.pwd(),n);u.readFile(i,"utf8",function(n,e){n?t(n):(c+=e+"\n",t())})},function(n){n?t(n):t(null,c.replace(/\n$/,""))})):t(new i.EINVAL("Missing files argument"))},c.prototype.ls=function(n,t,r){var u=this,c=u.fs;"function"==typeof t&&(r=t,t={}),t=t||{},r=r||function(){},n?function n(i,r){var f=e.resolve(u.pwd(),i),s=[];c.readdir(f,function(i,u){i?r(i):o.eachSeries(u,function(i,r){i=e.join(f,i),c.stat(i,function(i,o){if(i)r(i);else{var u=o;t.recursive&&"DIRECTORY"===o.type?n(e.join(f,u.name),function(n,t){n?r(n):(u.contents=t,s.push(u),r())}):(s.push(u),r())}})},function(n){r(n,s)})})}(n,r):r(new i.EINVAL("Missing dir argument"))},c.prototype.rm=function(n,t,r){var u=this,c=u.fs;"function"==typeof t&&(r=t,t={}),t=t||{},r=r||function(){},n?function n(r,f){r=e.resolve(u.pwd(),r),c.stat(r,function(u,s){u?f(u):"FILE"!==s.type?c.readdir(r,function(u,s){u?f(u):0!==s.length?t.recursive?(s=s.map(function(n){return e.join(r,n)}),o.eachSeries(s,n,function(n){n?f(n):c.rmdir(r,f)})):f(new i.ENOTEMPTY(null,r)):c.rmdir(r,f)}):c.unlink(r,f)})}(n,r):r(new i.EINVAL("Missing path argument"))},c.prototype.tempDir=function(n){var t=this.fs,e=this.env.get("TMP");n=n||function(){},t.mkdir(e,function(){n(null,e)})},c.prototype.mkdirp=function(n,t){var r=this.fs;t=t||function(){},n?"/"!==(n=e.resolve(this.pwd(),n))?function n(t,o){r.stat(t,function(u,c){if(c){if(c.isDirectory())return void o();if(c.isFile())return void o(new i.ENOTDIR(null,t))}else{if(u&&"ENOENT"!==u.code)return void o(u);var f=e.dirname(t);"/"===f?r.mkdir(t,function(n){n&&"EEXIST"!==n.code?o(n):o()}):n(f,function(n){if(n)return o(n);r.mkdir(t,function(n){n&&"EEXIST"!==n.code?o(n):o()})})}})}(n,t):t():t(new i.EINVAL("Missing path argument"))},c.prototype.find=function(n,t,r){var c=this,f=c.fs;"function"==typeof t&&(r=t,t={}),r=r||function(){};var s=(t=t||{}).exec||function(n,t){t()},a=[];function p(n,i){var r=e.removeTrailing(n);!t.regex||t.regex.test(r)?t.name&&!u(e.basename(r),t.name)||t.path&&!u(e.dirname(r),t.path)?i():function(n,t){s(n,function(e){e?t(e):(a.push(n),t())})}(n,i):i()}function d(n,t){n=e.resolve(c.pwd(),n),f.readdir(n,function(i,r){i?"ENOTDIR"===i.code?p(n,t):t(i):p(e.addTrailing(n),function(i){i?t(i):(r=r.map(function(t){return e.join(n,t)}),o.eachSeries(r,d,function(n){t(n,a)}))})})}n?f.stat(n,function(t,e){t?r(t):e.isDirectory()?d(n,r):r(new i.ENOTDIR(null,n))}):r(new i.EINVAL("Missing path argument"))},module.exports=c;
},{"es6-promisify":"c0Ea","../path.js":"UzoP","../errors.js":"p8GN","./environment.js":"QMiB","../../lib/async.js":"u4Zs","minimatch":"NtKi"}],"J4Qg":[function(require,module,exports) {
function t(t,r){for(var o=r.length-1;o>=0;o--)r[o]===t&&r.splice(o,1);return r}var r=function(){};r.createInterface=function(r){var o={on:function(t,o){void 0===this[r]&&(this[r]={}),this[r].hasOwnProperty(t)||(this[r][t]=[]),this[r][t].push(o)},off:function(o,e){void 0!==this[r]&&this[r].hasOwnProperty(o)&&t(e,this[r][o])},trigger:function(t){if(void 0!==this[r]&&this[r].hasOwnProperty(t))for(var o=Array.prototype.slice.call(arguments,1),e=0;e<this[r][t].length;e++)this[r][t][e].apply(this[r][t][e],o)},removeAllListeners:function(t){if(void 0!==this[r]){var o=this;o[r][t].forEach(function(r){o.off(t,r)})}}};return o};var o=r.createInterface("_handlers");r.prototype._on=o.on,r.prototype._off=o.off,r.prototype._trigger=o.trigger;var e=r.createInterface("handlers");r.prototype.on=function(){e.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},r.prototype.off=e.off,r.prototype.trigger=e.trigger,r.prototype.removeAllListeners=e.removeAllListeners,module.exports=r;
},{}],"zBMa":[function(require,module,exports) {
2019-02-07 21:38:32 +00:00
function x(x){return x.replace(/[xy]/g,function(x){var n=16*Math.random()|0;return("x"===x?n:3&n|8).toString(16)})}function n(){return x("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").toUpperCase()}function r(n){return x("x".repeat(n=n||6))}function t(){}module.exports={guid:n,nop:t,randomChars:r};
},{}],"u7Jv":[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3];function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n=require("./eventemitter.js"),o=require("../src/shared.js").guid;function r(t,e){var n=0;return function(){var o=Date.now();o-n>t&&(n=o,e.apply(this,arguments))}}function i(t,n){if(void 0!==t&&t||(t={}),"object"===e(n))for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);return t}var a=function(t){return void 0===t||void 0===t.localStorage?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(t);function s(){var e=this,n=Date.now();this.origin=o(),this.lastMessage=n,this.receivedIDs={},this.previousValues={};var r=function(){e._onStorageEvent.apply(e,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",r):t.addEventListener("storage",r,!1))}s.prototype._transaction=function(t){var e=1e3,n=20,o=this,r=!1,i=!1,s=null;function c(){if(!r){var u=Date.now(),f=0|a.getItem(p);if(f&&u-f<e)return i||(o._on("storage",c),i=!0),void(s=setTimeout(c,n));r=!0,a.setItem(p,u),t(),function(){i&&o._off("storage",c);s&&clearTimeout(s);a.removeItem(p)}()}}c()},s.prototype._cleanup_emit=r(100,function(){this._transaction(function(){var t,e=Date.now()-f,n=0;try{t=JSON.parse(a.getItem(c)||"[]")}catch(r){t=[]}for(var o=t.length-1;o>=0;o--)t[o].timestamp<e&&(t.splice(o,1),n++);n>0&&a.setItem(c,JSON.stringify(t))})}),s.prototype._cleanup_once=r(100,function(){var t=this;t._transaction(function(){Date.now();var e,n,o=0;try{n=JSON.parse(a.getItem(u)||"{}")}catch(r){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],o++);o>0&&a.setItem(u,JSON.stringify(n))})}),s.prototype._once_expired=function(t,n){if(!n)return!0;if(!n.hasOwnProperty(t))return!0;if("object"!==e(n[t]))return!0;var o=n[t].ttl||m,r=Date.now();return n[t].timestamp<r-o},s.prototype._localStorageChanged=function(t,e){if(t&&t.key)return t.key===e;var n=a.getItem(e);return n!==this.previousValues[e]&&(this.previousValues[e]=n,!0)},s.prototype._onStorageEvent=function(e){e=e||t.event;var n=this;this._localStorageChanged(e,c)&&this._transaction(function(){var t,e=Date.now(),o=a.getItem(c);try{t=JSON.parse(o||"[]")}catch(i){t=[]}for(var r=0;r<t.length;r++)if(t[r].origin!==n.origin&&!(t[r].timestamp<n.lastMessage)){if(t[r].id){if(n.receivedIDs.hasOwnProperty(t[r].id))continue;n.receivedIDs[t[r].id]=!0}n.trigger(t[r].name,t[r].payload)}n.lastMessage=e}),this._trigger("storage",e)},s.prototype._emit=function(t,e,n){if((n="string"==typeof n||"number"==typeof n?String(n):null)&&n.length){if(this.receivedIDs.hasOwnProperty(n))return;this.receivedIDs[n]=!0}var o={id:n,name:t,origin:this.origin,timestamp:Date.now(),payload:e},r=this;this._transaction(function(){var n=a.getItem(c)||"[]",i="[]"===n?"":",";n=[n.substring(0,n.length-1),i,JSON.stringify(o),"]"].join(""),a.setItem(c,n),r.trigger(t,e),setTimeout(function(){r._cleanup_emit()},50)})},s.prototype.emit=function(t,e){this._emit.apply(this,arguments),this._trigger("emit",t,e)},s.prototype.once=function(t,e,n){if(s.supported){var o=this;this._transaction(function(){var r;try{r=JSON.parse(a.getItem(u)||"{}")}catch(i){r={}}o._once_expired(t,r)&&(r[t]={},r[t].timestamp=Date.now(),"number"==typeof n&&(r[t].ttl=1e3*n),a.setItem(u,JSON.stringify(r)),e(),setTimeout(function(){o._cleanup_once()},50))})}},i(s.prototype,n.prototype),s.supported=void 0!==a;var c="intercom",u="intercom_once",p="intercom_lock",f=5e4,m=36e5;s.destroy=function(){a.removeItem(p),a.removeItem(c),a.removeItem(u)},s.getInstance=function(){var t;return function(){return t||(t=new s),t}}(),module.exports=s;
},{"./eventemitter.js":"J4Qg","../src/shared.js":"zBMa"}],"VLEe":[function(require,module,exports) {
var e=require("../lib/eventemitter.js"),t=require("./path.js"),n=require("../lib/intercom.js");function r(){e.call(this);var r,i,o=this,s=!1;function c(e){(i===e||s&&0===e.indexOf(r))&&o.trigger("change","change",e)}o.start=function(e,o,a){if(!i){if(t.isNull(e))throw new Error("Path must be a string without null bytes.");i=t.normalize(e),(s=!0===a)&&(r="/"===i?"/":i+"/"),n.getInstance().on("change",c)}},o.close=function(){n.getInstance().off("change",c),o.removeAllListeners("change")}}r.prototype=new e,r.prototype.constructor=r,module.exports=r;
},{"../lib/eventemitter.js":"J4Qg","./path.js":"UzoP","../lib/intercom.js":"u7Jv"}],"ZECt":[function(require,module,exports) {
var t=require("./constants.js").NODE_TYPE_FILE;module.exports=function(s,e){this.id=s,this.type=e||t};
},{"./constants.js":"iJA9"}],"osLK":[function(require,module,exports) {
2019-01-03 04:12:19 +00:00
var r=require("./constants"),e=r.FIRST_DESCRIPTOR,n={},t=function(){for(var r=e;o(r);)r++;return r},o=function(r){return n[r]},i=function(r){var e=t();return n[e]=r,e},u=function(r){return delete n[r]};module.exports={allocDescriptor:i,releaseDescriptor:u,getOpenFileDescription:o};
},{"./constants":"iJA9"}],"KKNo":[function(require,module,exports) {
function t(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function i(t,i){for(var s=0;s<i.length;s++){var e=i[s];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function s(t,s,e){return s&&i(t.prototype,s),e&&i(t,e),t}var e=require("./constants"),n=e.NODE_TYPE_FILE,r=e.NODE_TYPE_DIRECTORY,a=e.NODE_TYPE_SYMBOLIC_LINK,o=e.DEFAULT_FILE_PERMISSIONS,u=e.DEFAULT_DIR_PERMISSIONS,h=require("./constants").fsConstants,c=h.S_IFREG,f=h.S_IFDIR,m=h.S_IFLNK;function d(t,i,s){if(t[i])return s();t.guid(function(e,n){if(e)return s(e);t[i]=n,s()})}function l(t,i){switch(t){case r:return(i||u)|f;case a:return(i||o)|m;case n:default:return(i||o)|c}}var p=function(){function i(s){t(this,i);var e=Date.now();this.id=s.id,this.data=s.data,this.size=s.size||0,this.atime=s.atime||e,this.ctime=s.ctime||e,this.mtime=s.mtime||e,this.flags=s.flags||[],this.xattrs=s.xattrs||{},this.nlinks=s.nlinks||0,"string"==typeof s.type?this.type=s.type:"string"==typeof s.mode?this.type=s.mode:this.type=n,this.permissions=s.permissions||l(this.type),this.uid=s.uid||0,this.gid=s.gid||0}return s(i,[{key:"toJSON",value:function(){return{id:this.id,data:this.data,size:this.size,atime:this.atime,ctime:this.ctime,mtime:this.ctime,flags:this.flags,xattrs:this.xattrs,nlinks:this.nlinks,mode:this.type,permissions:this.permissions,uid:this.uid,gid:this.gid}}},{key:"mode",get:function(){return l(this.type,this.permissions)},set:function(t){this.permissions=t}}]),i}();module.exports.create=function(t,i){d(t,"id",function(s){if(s)return i(s);d(t,"data",function(s){if(s)return i(s);i(null,new p(t))})})};
},{"./constants":"iJA9"}],"XWaV":[function(require,module,exports) {
var e=require("./errors.js"),t=require("./node");function i(e,t,i,r){this.path=e,this.id=t,this.flags=i,this.position=r}i.prototype.getNode=function(i,r){var o=this.id,n=this.path;i.getObject(o,function(i,o){return i?r(i):o?void t.create(o,r):r(new e.EBADF("file descriptor refers to unknown node",n))})},module.exports=i;
},{"./errors.js":"p8GN","./node":"KKNo"}],"JEp0":[function(require,module,exports) {
var t=require("./constants.js");function e(e){var i=Date.now();this.id=t.SUPER_NODE_ID,this.type=t.NODE_TYPE_META,this.atime=e.atime||i,this.ctime=e.ctime||i,this.mtime=e.mtime||i,this.rnode=e.rnode}e.create=function(t,i){t.guid(function(n,o){n?i(n):(t.rnode=t.rnode||o,i(null,new e(t)))})},module.exports=e;
},{"./constants.js":"iJA9"}],"dsCT":[function(require,module,exports) {
2019-02-07 21:38:32 +00:00
"use strict";var t=require("./constants.js"),i=require("./path.js");function e(t){return new Date(Number(t))}function s(t,s,o){this.dev=o,this.node=s.id,this.type=s.type,this.size=s.size,this.nlinks=s.nlinks,this.atime=e(s.atime),this.mtime=e(s.mtime),this.ctime=e(s.ctime),this.atimeMs=s.atime,this.mtimeMs=s.mtime,this.ctimeMs=s.ctime,this.version=s.version,this.mode=s.mode,this.uid=s.uid,this.gid=s.gid,this.name=i.basename(t)}s.prototype.isFile=function(){return this.type===t.NODE_TYPE_FILE},s.prototype.isDirectory=function(){return this.type===t.NODE_TYPE_DIRECTORY},s.prototype.isSymbolicLink=function(){return this.type===t.NODE_TYPE_SYMBOLIC_LINK},s.prototype.isSocket=s.prototype.isFIFO=s.prototype.isCharacterDevice=s.prototype.isBlockDevice=function(){return!1},module.exports=s;
},{"./constants.js":"iJA9","./path.js":"UzoP"}],"bsBG":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer;function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=require("../path.js"),i=n.normalize,o=n.dirname,r=n.basename,u=n.isAbsolute,a=require("../shared.js"),c=require("../constants.js"),f=c.NODE_TYPE_FILE,l=c.NODE_TYPE_DIRECTORY,s=c.NODE_TYPE_SYMBOLIC_LINK,p=c.NODE_TYPE_META,d=c.FULL_READ_WRITE_EXEC_PERMISSIONS,m=c.ROOT_DIRECTORY_NAME,E=c.SUPER_NODE_ID,g=c.SYMLOOP_MAX,w=c.O_READ,O=c.O_WRITE,b=c.O_CREATE,y=c.O_EXCLUSIVE,v=c.O_APPEND,N=c.O_FLAGS,I=c.XATTR_CREATE,h=c.XATTR_REPLACE,A=c.FS_NOMTIME,D=c.FS_NOCTIME,j=require("../errors.js"),T=require("../directory-entry.js"),L=require("../open-files.js"),R=require("../open-file-description.js"),_=require("../super-node.js"),F=require("../node.js"),V=require("../stats.js");function S(e,t,n,i,o){var r=e.flags;r.includes(D)&&delete i.ctime,r.includes(A)&&delete i.mtime;var u=!1;function a(n){e.changes.push({event:"change",path:t}),o(n)}i.ctime&&(n.ctime=i.ctime,n.atime=i.ctime,u=!0),i.atime&&(n.atime=i.atime,u=!0),i.mtime&&(n.mtime=i.mtime,u=!0),u?e.putObject(n.id,n,a):a()}function B(e,t,n,u){if(n!==l&&n!==f)return u(new j.EINVAL("type must be a directory or file",t));t=i(t);var a,c,s,p=r(t),d=o(t);function m(n,i){!n&&i?u(new j.EEXIST("path name already exists",t)):!n||n instanceof j.ENOENT?e.getObject(a.data,E):u(n)}function E(t,i){t?u(t):(c=i,F.create({guid:e.guid,type:n},function(t,n){t?u(t):((s=n).nlinks+=1,e.putObject(s.id,s,w))}))}function g(t){if(t)u(t);else{var n=Date.now();S(e,d,s,{mtime:n,ctime:n},u)}}function w(t){t?u(t):(c[p]=new T(s.id,n),e.putObject(a.data,c,g))}P(e,d,function(n,i){n?u(n):i.type!==l?u(new j.ENOTDIR("a component of the path prefix is not a directory",t)):(a=i,P(e,t,m))})}function P(e,t,n){if(!(t=i(t)))return n(new j.ENOENT("path is an empty string"));var u=r(t),a=o(t),c=0;function f(t,i){if(t)return n(t);var o=new _(i);o&&o.type===p&&o.rnode?e.getObject(o.rnode,d):n(new j.EFILESYSTEMERROR)}function d(e,t){e?n(e):t?F.create(t,n):n(new j.ENOENT)}function w(i,o){i?n(i):o.type===l&&o.data?e.getObject(o.data,O):n(new j.ENOTDIR("a component of the path prefix is not a directory",t))}function O(i,o){if(i)n(i);else if(Object.prototype.hasOwnProperty.call(o,u)){var r=o[u].id;e.getObject(r,b)}else n(new j.ENOENT(null,t))}function b(e,t){if(e)return n(e);F.create(t,y)}function y(l,p){var d;l?n(l):p.type===s?++c>g?n(new j.ELOOP(null,t)):(d=p.data,d=i(d),a=o(d),u=r(d),m===u?e.getObject(E,f):P(e,a,w)):n(null,p)}m===u?e.getObject(E,f):P(e,a,w)}function x(e,t,n,i,o,r,u){var a=n.xattrs;r===I&&Object.prototype.hasOwnProperty.call(a,i)?u(new j.EEXIST("attribute already exists",t)):r!==h||Object.prototype.hasOwnProperty.call(a,i)?(a[i]=o,e.putObject(n.id,n,function(i){i?u(i):S(e,t,n,{ctime:Date.now()},u)})):u(new j.ENOATTR(null,t))}function k(e,t){var n,i,o;function r(o){o?t(o):F.create({guid:e.guid,id:n.rnode,type:l},function(n,o){n?t(n):((i=o).nlinks+=1,e.putObject(i.id,i,u))})}function u(n){n?t(n):(o={},e.putObject(i.data,o,t))}e.getObject(E,function(i,o){!i&&o?t():!i||i instanceof j.ENOENT?_.create({guid:e.guid},function(i,o){i?t(i):(n=o,e.putObject(n.id,n,r))}):t(i)})}function C(e,t,n){t=i(t);var u,a,c,f,s=r(t),p=o(t);function d(t,i){t?n(t):(c=i,e.getObject(c.data,m))}function m(t,i){t?n(t):(f=i,F.create({guid:e.guid,type:l},function(t,i){t?n(t):((u=i).nlinks+=1,e.putObject(u.id,u,E))}))}function E(t){t?n(t):(a={},e.putObject(u.data,a,w))}function g(t){if(t)n(t);else{var i=Date.now();S(e,p,c,{mtime:i,ctime:i},n)}}function w(t){t?n(t):(f[s]=new T(u.id,l),e.putObject(c.data,f,g))}P(e,t,function(i,o){!i&&o?n(new j.EEXIST(null,t)):!i||i instanceof j.ENOENT?P(e,p,d):n(i)})}function X(e,t,n,o){var r=c.fsConstants,u=r.F_OK,a=r.R_OK,f=r.W_OK,l=r.X_OK,s=r.S_IXUSR,p=r.S_IXGRP,d=r.S_IXOTH;P(e,t=i(t),function(e,i){if(e)return o(e);if(n===u)return o(null);var r=Ve(i.mode,o);return r?n&(a|f)?o(null):n&l&&r&(s|p|d)?o(null):void o(new j.EACCES("permission denied",t)):void 0}
},{"../path.js":"UzoP","../shared.js":"zBMa","../constants.js":"iJA9","../errors.js":"p8GN","../directory-entry.js":"ZECt","../open-files.js":"osLK","../open-file-description.js":"XWaV","../super-node.js":"JEp0","../node.js":"KKNo","../stats.js":"dsCT","buffer":"dskh"}],"GMi4":[function(require,module,exports) {
2019-01-03 04:12:19 +00:00
var Buffer = require("buffer").Buffer;
2019-02-07 21:38:32 +00:00
var e=require("buffer").Buffer,r=require("es6-promisify"),t=r.promisify,n=require("../path.js"),a=require("../providers/index.js"),s=require("../shell/shell.js"),o=require("../../lib/intercom.js"),i=require("../fs-watcher.js"),u=require("../errors.js"),m=require("../shared.js"),c=m.nop,f=m.guid,l=require("../constants.js"),h=l.fsConstants,p=l.FILE_SYSTEM_NAME,d=l.FS_FORMAT,g=l.FS_READY,b=l.FS_PENDING,A=l.FS_ERROR,P=l.FS_NODUPEIDCHECK,v=l.STDIN,y=l.STDOUT,E=l.STDERR,R=require("./implementation.js");function w(e){return"function"==typeof e?e:function(e){if(e)throw e}}function S(e){e&&console.error("Filer error: ",e)}function O(e){if(!(e&&e.protocol&&e.pathname))return e;if("file:"!==e.protocol)throw new u.EINVAL("only file: URLs are supported for paths",e);for(var r=e.pathname,t=0;t<r.length;t++)if("%"===r[t]){var n=32|r.codePointAt(t+2);if("2"===r[t+1]&&102===n)throw new u.EINVAL("file: URLs must not include encoded / characters",e)}return decodeURIComponent(r)}function x(r){return e.isBuffer(r)?r.toString():r}function F(e,r){return e?n.isNull(e)?new u.EINVAL("Path must be a string without null bytes.",e):r||n.isAbsolute(e)?void 0:new u.EINVAL("Path must be absolute.",e):new u.EINVAL("Path must be a string",e)}function _(e,r,t){var n=e[r],a=F(n=x(n=O(n)),t);if(a)throw a;e[r]=n}function q(e,r){r=r||S;var m=(e=e||{}).flags||[],l=e.guid?e.guid:f,O=e.provider||new a.Default(e.name||p),x=e.name||O.name,F=m.includes(d),I=this;I.readyState=b,I.name=x,I.error=null,I.stdin=v,I.stdout=y,I.stderr=E,I.constants=h,I.F_OK=h.F_OK,I.R_OK=h.R_OK,I.W_OK=h.W_OK,I.X_OK=h.X_OK,this.Shell=s.bind(void 0,this);var N=[];function j(e){return function(r){m.includes(P)?r(null,l()):function r(t){var n=l();e.getObject(n,function(e,a){e?t(e):a?r(t):t(null,n)})}(r)}}this.queueOrRun=function(e){var r;return g===I.readyState?e.call(I):A===I.readyState?r=new u.EFILESYSTEMERROR("unknown error"):N.push(e),r},this.watch=function(e,r,t){if(n.isNull(e))throw new Error("Path must be a string without null bytes.");"function"==typeof r&&(t=r,r={}),r=r||{},t=t||c;var a=new i;return a.start(e,!1,r.recursive),a.on("change",t),a},O.open(function(e){function t(e){function t(e){var r=O[e]();return r.name=x,r.flags=m,r.changes=[],r.guid=j(r),r.close=function(){var e=r.changes;!function(e){if(e.length){var r=o.getInstance();e.forEach(function(e){r.emit(e.event,e.path)})}}(e),e.length=0},r}I.provider={openReadWriteContext:function(){return t("getReadWriteContext")},openReadOnlyContext:function(){return t("getReadOnlyContext")}},I.readyState=e?A:g,N.forEach(function(e){e.call(this)}.bind(I)),N=null,r(e,I)}if(e)return t(e);var n=O.getReadWriteContext();n.guid=j(n),F?n.clear(function(e){if(e)return t(e);R.ensureRootDirectory(n,t)}):R.ensureRootDirectory(n,t)}),q.prototype.promises={},[{name:"appendFile",promises:!0,absPathArgs:[0]},{name:"access",promises:!0,absPathArgs:[0]},{name:"chown",promises:!0,absPathArgs:[0]},{name:"chmod",promises:!0,absPathArgs:[0]},{name:"close"},{name:"exists",absPathArgs:[0]},{name:"fchown"},{name:"fchmod"},{name:"fgetxattr"},{name:"fremovexattr"},{name:"fsetxattr"},{name:"fstat"},{name:"fsync"},{name:"ftruncate"},{name:"futimes"},{name:"getxattr",promises:!0,absPathArgs:[0]},{name:"link",promises:!0,absPathArgs:[0,1]},{name:"lseek"},{name:"lstat",promises:!0},{name:"mkdir",promises:!0,absPathArgs:[0]},{name:"mkdtemp",promises:!0},{name:"mknod",promises:!0,absPathArgs:[0]},{name:"open",promises:!0,absPathArgs:[0]},{name:"readdir",promises:!0,absPathArgs:[0]},{name:"read"},{name:"readFile",promises:!0,absPathArgs:[0]},{name:"readlink",promises:!0,absPathArgs:[0]},{name:"removexattr",promises:!0,absPathArgs:[0]},{name:"rename",promises:!0,absPathArgs:[0,1]},{name:"rmdir",promises:!0,absPathArgs:[0]},{name:"setxattr",promises:!0,absPathArgs:[0]},{name:"stat",promises:!0,absPathArgs:[0]},{name:"symlink",promises:!0,relPathArgs:[0],absPathArgs:[1]},{name:"truncate",promises:!0,absPathArgs:[0]},{name:"unlink",promises:!0,absPathArgs:[0]},{name:"utimes",promises:!0,absPathArgs:[0]},{name:"writeFile",promises:!0,absPathArgs:[0]},{name:"write"}].forEach(
},{"es6-promisify":"c0Ea","../path.js":"UzoP","../providers/index.js":"AiW7","../shell/shell.js":"D1Ra","../../lib/intercom.js":"u7Jv","../fs-watcher.js":"VLEe","../errors.js":"p8GN","../shared.js":"zBMa","../constants.js":"iJA9","./implementation.js":"bsBG","buffer":"dskh"}],"Focm":[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
2019-01-03 04:12:19 +00:00
var e=require("buffer").Buffer,r=null,l=null;module.exports=l={FileSystem:require("./filesystem/interface.js"),Buffer:e,Path:require("./path.js"),path:require("./path.js"),Errors:require("./errors.js"),Shell:require("./shell/shell.js")},Object.defineProperty(l,"fs",{enumerable:!0,get:function(){return r||(r=new l.FileSystem),r}});
},{"./filesystem/interface.js":"GMi4","./path.js":"UzoP","./errors.js":"p8GN","./shell/shell.js":"D1Ra","buffer":"dskh"}]},{},["Focm"], "Filer")
//# sourceMappingURL=/filer.min.js.map