5 lines
108 KiB
JavaScript
5 lines
108 KiB
JavaScript
/*! filer 2014-05-16 */
|
|
(function(t,n){"object"==typeof exports?module.exports=n():"function"==typeof define&&define.amd?define(n):t.Filer||(t.Filer=n())})(this,function(){var t,n,e;(function(r){function i(t,n){return w.call(t,n)}function o(t,n){var e,r,i,o,s,a,c,u,f,l,h=n&&n.split("/"),p=y.map,d=p&&p["*"]||{};if(t&&"."===t.charAt(0))if(n){for(h=h.slice(0,h.length-1),t=h.concat(t.split("/")),u=0;t.length>u;u+=1)if(l=t[u],"."===l)t.splice(u,1),u-=1;else if(".."===l){if(1===u&&(".."===t[2]||".."===t[0]))break;u>0&&(t.splice(u-1,2),u-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((h||d)&&p){for(e=t.split("/"),u=e.length;u>0;u-=1){if(r=e.slice(0,u).join("/"),h)for(f=h.length;f>0;f-=1)if(i=p[h.slice(0,f).join("/")],i&&(i=i[r])){o=i,s=u;break}if(o)break;!a&&d&&d[r]&&(a=d[r],c=u)}!o&&a&&(o=a,s=c),o&&(e.splice(0,s,o),t=e.join("/"))}return t}function s(t,n){return function(){return p.apply(r,b.call(arguments,0).concat([t,n]))}}function a(t){return function(n){return o(n,t)}}function c(t){return function(n){v[t]=n}}function u(t){if(i(m,t)){var n=m[t];delete m[t],E[t]=!0,h.apply(r,n)}if(!i(v,t)&&!i(E,t))throw Error("No "+t);return v[t]}function f(t){var n,e=t?t.indexOf("!"):-1;return e>-1&&(n=t.substring(0,e),t=t.substring(e+1,t.length)),[n,t]}function l(t){return function(){return y&&y.config&&y.config[t]||{}}}var h,p,d,g,v={},m={},y={},E={},w=Object.prototype.hasOwnProperty,b=[].slice;d=function(t,n){var e,r=f(t),i=r[0];return t=r[1],i&&(i=o(i,n),e=u(i)),i?t=e&&e.normalize?e.normalize(t,a(n)):o(t,n):(t=o(t,n),r=f(t),i=r[0],t=r[1],i&&(e=u(i))),{f:i?i+"!"+t:t,n:t,pr:i,p:e}},g={require:function(t){return s(t)},exports:function(t){var n=v[t];return n!==void 0?n:v[t]={}},module:function(t){return{id:t,uri:"",exports:v[t],config:l(t)}}},h=function(t,n,e,o){var a,f,l,h,p,y,w=[];if(o=o||t,"function"==typeof e){for(n=!n.length&&e.length?["require","exports","module"]:n,p=0;n.length>p;p+=1)if(h=d(n[p],o),f=h.f,"require"===f)w[p]=g.require(t);else if("exports"===f)w[p]=g.exports(t),y=!0;else if("module"===f)a=w[p]=g.module(t);else if(i(v,f)||i(m,f)||i(E,f))w[p]=u(f);else{if(!h.p)throw Error(t+" missing "+f);h.p.load(h.n,s(o,!0),c(f),{}),w[p]=v[f]}l=e.apply(v[t],w),t&&(a&&a.exports!==r&&a.exports!==v[t]?v[t]=a.exports:l===r&&y||(v[t]=l))}else t&&(v[t]=e)},t=n=p=function(t,n,e,i,o){return"string"==typeof t?g[t]?g[t](n):u(d(t,n).f):(t.splice||(y=t,n.splice?(t=n,n=e,e=null):t=r),n=n||function(){},"function"==typeof e&&(e=i,i=o),i?h(r,t,n,e):setTimeout(function(){h(r,t,n,e)},4),p)},p.config=function(t){return y=t,y.deps&&p(y.deps,y.callback),p},e=function(t,n,e){n.splice||(e=n,n=[]),i(v,t)||i(m,t)||(m[t]=[t,n,e])},e.amd={jQuery:!0}})(),e("build/almond",function(){}),e("nodash",["require"],function(){function t(t,n){return p.call(t,n)}function n(t){return null==t?0:t.length===+t.length?t.length:v(t).length}function e(t){return t}function r(t,n,e){var r,i;if(null!=t)if(u&&t.forEach===u)t.forEach(n,e);else if(t.length===+t.length){for(r=0,i=t.length;i>r;r++)if(n.call(e,t[r],r,t)===g)return}else{var o=o(t);for(r=0,i=o.length;i>r;r++)if(n.call(e,t[o[r]],o[r],t)===g)return}}function i(t,n,i){n||(n=e);var o=!1;return null==t?o:l&&t.some===l?t.some(n,i):(r(t,function(t,e,r){return o||(o=n.call(i,t,e,r))?g:void 0}),!!o)}function o(t,n){return null==t?!1:f&&t.indexOf===f?-1!=t.indexOf(n):i(t,function(t){return t===n})}function s(t){this.value=t}function a(t){return t&&"object"==typeof t&&!Array.isArray(t)&&p.call(t,"__wrapped__")?t:new s(t)}var c=Array.prototype,u=c.forEach,f=c.indexOf,l=c.some,h=Object.prototype,p=h.hasOwnProperty,d=Object.keys,g={},v=d||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var e=[];for(var r in n)t(n,r)&&e.push(r);return e};return s.prototype.has=function(n){return t(this.value,n)},s.prototype.contains=function(t){return o(this.value,t)},s.prototype.size=function(){return n(this.value)},a}),e("src/path",[],function(){function t(t,n){for(var e=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),e++):e&&(t.splice(r,1),e--)}if(n)for(;e--;e)t.unshift("..");return t}function n(){for(var n="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var i=r>=0?arguments[r]:"/";"string"==typeof i&&i&&(n=i+"/"+n,e="/"===i.charAt(0))}return n=t(n.split("/").filter(function(t){return!!t}),!e).join("/"),(e?"/":"")+n||"."}function e(n){var e="/"===n.charAt(0);return"/"===n.substr(-1),n=t(n.split("/").filter(function(t){return!!t}),!e).join("/"),n||e||(n="."),(e?"/":"")+n}function r(){var t=Array.prototype.slice.call(arguments,0);return e(t.filter(function(t){return t&&"string"==typeof t}).join("/"))}function i(t,n){function e(t){for(var n=0;t.length>n&&""===t[n];n++);for(var e=t.length-1;e>=0&&""===t[e];e--);return n>e?[]:t.slice(n,e-n+1)}t=exports.resolve(t).substr(1),n=exports.resolve(n).substr(1);for(var r=e(t.split("/")),i=e(n.split("/")),o=Math.min(r.length,i.length),s=o,a=0;o>a;a++)if(r[a]!==i[a]){s=a;break}for(var c=[],a=s;r.length>a;a++)c.push("..");return c=c.concat(i.slice(s)),c.join("/")}function o(t){var n=l(t),e=n[0],r=n[1];return e||r?(r&&(r=r.substr(0,r.length-1)),e+r):"."}function s(t,n){var e=l(t)[2];return n&&e.substr(-1*n.length)===n&&(e=e.substr(0,e.length-n.length)),""===e?"/":e}function a(t){return l(t)[3]}function c(t){return"/"===t.charAt(0)?!0:!1}function u(t){return-1!==(""+t).indexOf("\0")?!0:!1}var f=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,l=function(t){var n=f.exec(t);return[n[1]||"",n[2]||"",n[3]||"",n[4]||""]};return{normalize:e,resolve:n,join:r,relative:i,sep:"/",delimiter:":",dirname:o,basename:s,extname:a,isAbsolute:c,isNull:u}});var r=r||function(t,n){var e={},r=e.lib={},i=r.Base=function(){function t(){}return{extend:function(n){t.prototype=this;var e=new t;return n&&e.mixIn(n),e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.$super.extend(this)}}}(),o=r.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=e!=n?e:4*t.length},toString:function(t){return(t||a).stringify(this)},concat:function(t){var n=this.words,e=t.words,r=this.sigBytes,t=t.sigBytes;if(this.clamp(),r%4)for(var i=0;t>i;i++)n[r+i>>>2]|=(255&e[i>>>2]>>>24-8*(i%4))<<24-8*((r+i)%4);else if(e.length>65535)for(i=0;t>i;i+=4)n[r+i>>>2]=e[i>>>2];else n.push.apply(n,e);return this.sigBytes+=t,this},clamp:function(){var n=this.words,e=this.sigBytes;n[e>>>2]&=4294967295<<32-8*(e%4),n.length=t.ceil(e/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(n){for(var e=[],r=0;n>r;r+=4)e.push(0|4294967296*t.random());return o.create(e,n)}}),s=e.enc={},a=s.Hex={stringify:function(t){for(var n=t.words,t=t.sigBytes,e=[],r=0;t>r;r++){var i=255&n[r>>>2]>>>24-8*(r%4);e.push((i>>>4).toString(16)),e.push((15&i).toString(16))}return e.join("")},parse:function(t){for(var n=t.length,e=[],r=0;n>r;r+=2)e[r>>>3]|=parseInt(t.substr(r,2),16)<<24-4*(r%8);return o.create(e,n/2)}},c=s.Latin1={stringify:function(t){for(var n=t.words,t=t.sigBytes,e=[],r=0;t>r;r++)e.push(String.fromCharCode(255&n[r>>>2]>>>24-8*(r%4)));return e.join("")},parse:function(t){for(var n=t.length,e=[],r=0;n>r;r++)e[r>>>2]|=(255&t.charCodeAt(r))<<24-8*(r%4);return o.create(e,n)}},u=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(n){throw Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=o.create(),this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(n){var e=this._data,r=e.words,i=e.sigBytes,s=this.blockSize,a=i/(4*s),a=n?t.ceil(a):t.max((0|a)-this._minBufferSize,0),n=a*s,i=t.min(4*n,i);if(n){for(var c=0;n>c;c+=s)this._doProcessBlock(r,c);c=r.splice(0,n),e.sigBytes-=i}return o.create(c,i)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});r.Hasher=f.extend({init:function(){this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize(),this._hash},clone:function(){var t=f.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:16,_createHelper:function(t){return function(n,e){return t.create(e).finalize(n)}},_createHmacHelper:function(t){return function(n,e){return l.HMAC.create(t,e).finalize(n)}}});var l=e.algo={};return e}(Math);(function(t){var n=r,e=n.lib,i=e.WordArray,e=e.Hasher,o=n.algo,s=[],a=[];(function(){function n(n){for(var e=t.sqrt(n),r=2;e>=r;r++)if(!(n%r))return!1;return!0}function e(t){return 0|4294967296*(t-(0|t))}for(var r=2,i=0;64>i;)n(r)&&(8>i&&(s[i]=e(t.pow(r,.5))),a[i]=e(t.pow(r,1/3)),i++),r++})();var c=[],o=o.SHA256=e.extend({_doReset:function(){this._hash=i.create(s.slice(0))},_doProcessBlock:function(t,n){for(var e=this._hash.words,r=e[0],i=e[1],o=e[2],s=e[3],u=e[4],f=e[5],l=e[6],h=e[7],p=0;64>p;p++){if(16>p)c[p]=0|t[n+p];else{var d=c[p-15],g=c[p-2];c[p]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+c[p-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+c[p-16]}d=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&f^~u&l)+a[p]+c[p],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&o^i&o),h=l,l=f,f=u,u=0|s+d,s=o,o=i,i=r,r=0|d+g}e[0]=0|e[0]+r,e[1]=0|e[1]+i,e[2]=0|e[2]+o,e[3]=0|e[3]+s,e[4]=0|e[4]+u,e[5]=0|e[5]+f,e[6]=0|e[6]+l,e[7]=0|e[7]+h},_doFinalize:function(){var t=this._data,n=t.words,e=8*this._nDataBytes,r=8*t.sigBytes;n[r>>>5]|=128<<24-r%32,n[(r+64>>>9<<4)+15]=e,t.sigBytes=4*n.length,this._process()}});n.SHA256=e._createHelper(o),n.HmacSHA256=e._createHmacHelper(o)})(Math),e("crypto-js/rollups/sha256",function(){}),e("src/shared",["require","crypto-js/rollups/sha256"],function(t){function n(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=0|16*Math.random(),e="x"==t?n:8|3&n;return e.toString(16)}).toUpperCase()}function e(t){return s.SHA256(t).toString(s.enc.hex)}function i(){}function o(t){for(var n=[],e=t.length,r=0;e>r;r++)n[r]=t[r];return n}t("crypto-js/rollups/sha256");var s=r;return{guid:n,hash:e,u8toArray:o,nop:i}}),e("src/constants",["require"],function(){var t="READ",n="WRITE",e="CREATE",r="EXCLUSIVE",i="TRUNCATE",o="APPEND",s="CREATE",a="REPLACE";return{FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",MODE_FILE:"FILE",MODE_DIRECTORY:"DIRECTORY",MODE_SYMBOLIC_LINK:"SYMLINK",MODE_META:"META",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",O_READ:t,O_WRITE:n,O_CREATE:e,O_EXCLUSIVE:r,O_TRUNCATE:i,O_APPEND:o,O_FLAGS:{r:[t],"r+":[t,n],w:[n,e,i],"w+":[n,t,e,i],wx:[n,e,r,i],"wx+":[n,t,e,r,i],a:[n,e,o],"a+":[n,t,e,o],ax:[n,e,r,o],"ax+":[n,t,e,r,o]},XATTR_CREATE:s,XATTR_REPLACE:a,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",ENVIRONMENT:{TMP:"/tmp",PATH:""}}}),e("src/errors",["require"],function(){var t={};return["-1:UNKNOWN:unknown error","0:OK:success","1:EOF:end of file","2:EADDRINFO:getaddrinfo error","3:EACCES:permission denied","4:EAGAIN:resource temporarily unavailable","5:EADDRINUSE:address already in use","6:EADDRNOTAVAIL:address not available","7:EAFNOSUPPORT:address family not supported","8:EALREADY:connection already in progress","9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","11:ECONNABORTED:software caused connection abort","12:ECONNREFUSED:connection refused","13:ECONNRESET:connection reset by peer","14:EDESTADDRREQ:destination address required","15:EFAULT:bad address in system call argument","16:EHOSTUNREACH:host is unreachable","17:EINTR:interrupted system call","18:EINVAL:invalid argument","19:EISCONN:socket is already connected","20:EMFILE:too many open files","21:EMSGSIZE:message too long","22:ENETDOWN:network is down","23:ENETUNREACH:network is unreachable","24:ENFILE:file table overflow","25:ENOBUFS:no buffer space available","26:ENOMEM:not enough memory","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","29:ENONET:machine is not on the network","31:ENOTCONN:socket is not connected","32:ENOTSOCK:socket operation on non-socket","33:ENOTSUP:operation not supported on socket","34:ENOENT:no such file or directory","35:ENOSYS:function not implemented","36:EPIPE:broken pipe","37:EPROTO:protocol error","38:EPROTONOSUPPORT:protocol not supported","39:EPROTOTYPE:protocol wrong type for socket","40:ETIMEDOUT:connection timed out","41:ECHARSET:invalid Unicode character","42:EAIFAMNOSUPPORT:address family for hostname not supported","44:EAISERVICE:servname not supported for ai_socktype","45:EAISOCKTYPE:ai_socktype not supported","46:ESHUTDOWN:cannot send after transport endpoint shutdown","47:EEXIST:file already exists","48:ESRCH:no such process","49:ENAMETOOLONG:name too long","50:EPERM:operation not permitted","51:ELOOP:too many symbolic links encountered","52:EXDEV:cross-device link not permitted","53:ENOTEMPTY:directory not empty","54:ENOSPC:no space left on device","55:EIO:i/o error","56:EROFS:read-only file system","57:ENODEV:no such device","58:ESPIPE:invalid seek","59:ECANCELED:operation canceled","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(n){function e(t){this.message=t||o}n=n.split(":");var r=n[0],i=n[1],o=n[2],s=e.prototype=Error();s.errno=r,s.code=i,s.constructor=e,t[i]=t[r]=e}),t}),e("src/providers/indexeddb",["require","src/constants","src/constants","src/constants","src/constants","src/errors"],function(t){function n(t,n){var e=t.transaction(i,n);this.objectStore=e.objectStore(i)}function e(t){this.name=t||r,this.db=null}var r=t("src/constants").FILE_SYSTEM_NAME,i=t("src/constants").FILE_STORE_NAME,o=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,s=t("src/constants").IDB_RW;t("src/constants").IDB_RO;var a=t("src/errors");return n.prototype.clear=function(t){try{var n=this.objectStore.clear();n.onsuccess=function(){t()},n.onerror=function(n){t(n)}}catch(e){t(e)}},n.prototype.get=function(t,n){try{var e=this.objectStore.get(t);e.onsuccess=function(t){var e=t.target.result;n(null,e)},e.onerror=function(t){n(t)}}catch(r){n(r)}},n.prototype.put=function(t,n,e){try{var r=this.objectStore.put(n,t);r.onsuccess=function(t){var n=t.target.result;e(null,n)},r.onerror=function(t){e(t)}}catch(i){e(i)}},n.prototype.delete=function(t,n){try{var e=this.objectStore.delete(t);e.onsuccess=function(t){var e=t.target.result;n(null,e)},e.onerror=function(t){n(t)}}catch(r){n(r)}},e.isSupported=function(){return!!o},e.prototype.open=function(t){var n=this;if(n.db)return t(null,!1),void 0;var e=!1,r=o.open(n.name);r.onupgradeneeded=function(t){var n=t.target.result;n.objectStoreNames.contains(i)&&n.deleteObjectStore(i),n.createObjectStore(i),e=!0},r.onsuccess=function(r){n.db=r.target.result,t(null,e)},r.onerror=function(){t(new a.EINVAL("IndexedDB cannot be accessed. If private browsing is enabled, disable it."))}},e.prototype.getReadOnlyContext=function(){return new n(this.db,s)},e.prototype.getReadWriteContext=function(){return new n(this.db,s)},e}),e("src/providers/websql",["require","src/constants","src/constants","src/constants","src/constants","src/constants","src/shared","src/errors"],function(t){function n(t,n){var e=this;this.getTransaction=function(r){return e.transaction?(r(e.transaction),void 0):(t[n?"readTransaction":"transaction"](function(t){e.transaction=t,r(t)}),void 0)}}function e(t){this.name=t||r,this.db=null}var r=t("src/constants").FILE_SYSTEM_NAME,i=t("src/constants").FILE_STORE_NAME,o=t("src/constants").WSQL_VERSION,s=t("src/constants").WSQL_SIZE,a=t("src/constants").WSQL_DESC,c=t("src/shared").u8toArray,u=t("src/errors");return n.prototype.clear=function(t){function n(n,e){t(e)}function e(){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+i+";",[],e,n)})},n.prototype.get=function(t,n){function e(t,e){var r=0===e.rows.length?null:e.rows.item(0).data;try{r&&(r=JSON.parse(r),r.__isUint8Array&&(r=new Uint8Array(r.__array))),n(null,r)}catch(i){n(i)}}function r(t,e){n(e)}this.getTransaction(function(n){n.executeSql("SELECT data FROM "+i+" WHERE id = ?;",[t],e,r)})},n.prototype.put=function(t,n,e){function r(){e(null)}function o(t,n){e(n)}"[object Uint8Array]"===Object.prototype.toString.call(n)&&(n={__isUint8Array:!0,__array:c(n)}),n=JSON.stringify(n),this.getTransaction(function(e){e.executeSql("INSERT OR REPLACE INTO "+i+" (id, data) VALUES (?, ?);",[t,n],r,o)})},n.prototype.delete=function(t,n){function e(){n(null)}function r(t,e){n(e)}this.getTransaction(function(n){n.executeSql("DELETE FROM "+i+" WHERE id = ?;",[t],e,r)})},e.isSupported=function(){return!!window.openDatabase},e.prototype.open=function(t){function n(n,e){5===e.code&&t(new u.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),t(e)}function e(n){function e(n,e){var r=0===e.rows.item(0).count;t(null,r)}function o(n,e){t(e)}r.db=c,n.executeSql("SELECT COUNT(id) AS count FROM "+i+";",[],e,o)}var r=this;if(r.db)return t(null,!1),void 0;var c=window.openDatabase(r.name,o,a,s);return c?(c.transaction(function(t){function r(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+i+"_id"+" on "+i+" (id);",[],e,n)}t.executeSql("CREATE TABLE IF NOT EXISTS "+i+" (id unique, data TEXT);",[],r,n)}),void 0):(t("[WebSQL] Unable to open database."),void 0)},e.prototype.getReadOnlyContext=function(){return new n(this.db,!0)},e.prototype.getReadWriteContext=function(){return new n(this.db,!1)},e}),function(){function t(t){var e=!1;return function(){if(e)throw Error("Callback was already called.");e=!0,t.apply(n,arguments)}}var n,r,i={};n=this,null!=n&&(r=n.async),i.noConflict=function(){return n.async=r,i};var o=function(t,n){if(t.forEach)return t.forEach(n);for(var e=0;t.length>e;e+=1)n(t[e],e,t)},s=function(t,n){if(t.map)return t.map(n);var e=[];return o(t,function(t,r,i){e.push(n(t,r,i))}),e},a=function(t,n,e){return t.reduce?t.reduce(n,e):(o(t,function(t,r,i){e=n(e,t,r,i)}),e)},c=function(t){if(Object.keys)return Object.keys(t);var n=[];for(var e in t)t.hasOwnProperty(e)&&n.push(e);return n};"undefined"!=typeof process&&process.nextTick?(i.nextTick=process.nextTick,i.setImmediate="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:i.nextTick):"function"==typeof setImmediate?(i.nextTick=function(t){setImmediate(t)},i.setImmediate=i.nextTick):(i.nextTick=function(t){setTimeout(t,0)},i.setImmediate=i.nextTick),i.each=function(n,e,r){if(r=r||function(){},!n.length)return r();var i=0;o(n,function(o){e(o,t(function(t){t?(r(t),r=function(){}):(i+=1,i>=n.length&&r(null))}))})},i.forEach=i.each,i.eachSeries=function(t,n,e){if(e=e||function(){},!t.length)return e();var r=0,i=function(){n(t[r],function(n){n?(e(n),e=function(){}):(r+=1,r>=t.length?e(null):i())})};i()},i.forEachSeries=i.eachSeries,i.eachLimit=function(t,n,e,r){var i=u(n);i.apply(null,[t,e,r])},i.forEachLimit=i.eachLimit;var u=function(t){return function(n,e,r){if(r=r||function(){},!n.length||0>=t)return r();var i=0,o=0,s=0;(function a(){if(i>=n.length)return r();for(;t>s&&n.length>o;)o+=1,s+=1,e(n[o-1],function(t){t?(r(t),r=function(){}):(i+=1,s-=1,i>=n.length?r():a())})})()}},f=function(t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[i.each].concat(n))}},l=function(t,n){return function(){var e=Array.prototype.slice.call(arguments);return n.apply(null,[u(t)].concat(e))}},h=function(t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[i.eachSeries].concat(n))}},p=function(t,n,e,r){var i=[];n=s(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e,r){i[t.index]=r,n(e)})},function(t){r(t,i)})};i.map=f(p),i.mapSeries=h(p),i.mapLimit=function(t,n,e,r){return d(n)(t,e,r)};var d=function(t){return l(t,p)};i.reduce=function(t,n,e,r){i.eachSeries(t,function(t,r){e(n,t,function(t,e){n=e,r(t)})},function(t){r(t,n)})},i.inject=i.reduce,i.foldl=i.reduce,i.reduceRight=function(t,n,e,r){var o=s(t,function(t){return t}).reverse();i.reduce(o,n,e,r)},i.foldr=i.reduceRight;var g=function(t,n,e,r){var i=[];n=s(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e){e&&i.push(t),n()})},function(){r(s(i.sort(function(t,n){return t.index-n.index}),function(t){return t.value}))})};i.filter=f(g),i.filterSeries=h(g),i.select=i.filter,i.selectSeries=i.filterSeries;var v=function(t,n,e,r){var i=[];n=s(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e){e||i.push(t),n()})},function(){r(s(i.sort(function(t,n){return t.index-n.index}),function(t){return t.value}))})};i.reject=f(v),i.rejectSeries=h(v);var m=function(t,n,e,r){t(n,function(t,n){e(t,function(e){e?(r(t),r=function(){}):n()})},function(){r()})};i.detect=f(m),i.detectSeries=h(m),i.some=function(t,n,e){i.each(t,function(t,r){n(t,function(t){t&&(e(!0),e=function(){}),r()})},function(){e(!1)})},i.any=i.some,i.every=function(t,n,e){i.each(t,function(t,r){n(t,function(t){t||(e(!1),e=function(){}),r()})},function(){e(!0)})},i.all=i.every,i.sortBy=function(t,n,e){i.map(t,function(t,e){n(t,function(n,r){n?e(n):e(null,{value:t,criteria:r})})},function(t,n){if(t)return e(t);var r=function(t,n){var e=t.criteria,r=n.criteria;return r>e?-1:e>r?1:0};e(null,s(n.sort(r),function(t){return t.value}))})},i.auto=function(t,n){n=n||function(){};var e=c(t);if(!e.length)return n(null);var r={},s=[],u=function(t){s.unshift(t)},f=function(t){for(var n=0;s.length>n;n+=1)if(s[n]===t)return s.splice(n,1),void 0},l=function(){o(s.slice(0),function(t){t()})};u(function(){c(r).length===e.length&&(n(null,r),n=function(){})}),o(e,function(e){var s=t[e]instanceof Function?[t[e]]:t[e],h=function(t){var s=Array.prototype.slice.call(arguments,1);if(1>=s.length&&(s=s[0]),t){var a={};o(c(r),function(t){a[t]=r[t]}),a[e]=s,n(t,a),n=function(){}}else r[e]=s,i.setImmediate(l)},p=s.slice(0,Math.abs(s.length-1))||[],d=function(){return a(p,function(t,n){return t&&r.hasOwnProperty(n)},!0)&&!r.hasOwnProperty(e)};if(d())s[s.length-1](h,r);else{var g=function(){d()&&(f(g),s[s.length-1](h,r))};u(g)}})},i.waterfall=function(t,n){if(n=n||function(){},t.constructor!==Array){var e=Error("First argument to waterfall must be an array of functions");return n(e)}if(!t.length)return n();var r=function(t){return function(e){if(e)n.apply(null,arguments),n=function(){};else{var o=Array.prototype.slice.call(arguments,1),s=t.next();s?o.push(r(s)):o.push(n),i.setImmediate(function(){t.apply(null,o)})}}};r(i.iterator(t))()};var y=function(t,n,e){if(e=e||function(){},n.constructor===Array)t.map(n,function(t,n){t&&t(function(t){var e=Array.prototype.slice.call(arguments,1);1>=e.length&&(e=e[0]),n.call(null,t,e)})},e);else{var r={};t.each(c(n),function(t,e){n[t](function(n){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),r[t]=i,e(n)})},function(t){e(t,r)})}};i.parallel=function(t,n){y({map:i.map,each:i.each},t,n)},i.parallelLimit=function(t,n,e){y({map:d(n),each:u(n)},t,e)},i.series=function(t,n){if(n=n||function(){},t.constructor===Array)i.mapSeries(t,function(t,n){t&&t(function(t){var e=Array.prototype.slice.call(arguments,1);1>=e.length&&(e=e[0]),n.call(null,t,e)})},n);else{var e={};i.eachSeries(c(t),function(n,r){t[n](function(t){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),e[n]=i,r(t)})},function(t){n(t,e)})}},i.iterator=function(t){var n=function(e){var r=function(){return t.length&&t[e].apply(null,arguments),r.next()};return r.next=function(){return t.length-1>e?n(e+1):null},r};return n(0)},i.apply=function(t){var n=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,n.concat(Array.prototype.slice.call(arguments)))}};var E=function(t,n,e,r){var i=[];t(n,function(t,n){e(t,function(t,e){i=i.concat(e||[]),n(t)})},function(t){r(t,i)})};i.concat=f(E),i.concatSeries=h(E),i.whilst=function(t,n,e){t()?n(function(r){return r?e(r):(i.whilst(t,n,e),void 0)}):e()},i.doWhilst=function(t,n,e){t(function(r){return r?e(r):(n()?i.doWhilst(t,n,e):e(),void 0)})},i.until=function(t,n,e){t()?e():n(function(r){return r?e(r):(i.until(t,n,e),void 0)})},i.doUntil=function(t,n,e){t(function(r){return r?e(r):(n()?e():i.doUntil(t,n,e),void 0)})},i.queue=function(n,e){function r(t,n,r,s){n.constructor!==Array&&(n=[n]),o(n,function(n){var o={data:n,callback:"function"==typeof s?s:null};r?t.tasks.unshift(o):t.tasks.push(o),t.saturated&&t.tasks.length===e&&t.saturated(),i.setImmediate(t.process)})}void 0===e&&(e=1);var s=0,a={tasks:[],concurrency:e,saturated:null,empty:null,drain:null,push:function(t,n){r(a,t,!1,n)},unshift:function(t,n){r(a,t,!0,n)},process:function(){if(a.concurrency>s&&a.tasks.length){var e=a.tasks.shift();a.empty&&0===a.tasks.length&&a.empty(),s+=1;var r=function(){s-=1,e.callback&&e.callback.apply(e,arguments),a.drain&&0===a.tasks.length+s&&a.drain(),a.process()},i=t(r);n(e.data,i)}},length:function(){return a.tasks.length},running:function(){return s}};return a},i.cargo=function(t,n){var e=!1,r=[],a={tasks:r,payload:n,saturated:null,empty:null,drain:null,push:function(t,e){t.constructor!==Array&&(t=[t]),o(t,function(t){r.push({data:t,callback:"function"==typeof e?e:null}),a.saturated&&r.length===n&&a.saturated()}),i.setImmediate(a.process)},process:function c(){if(!e){if(0===r.length)return a.drain&&a.drain(),void 0;var i="number"==typeof n?r.splice(0,n):r.splice(0),u=s(i,function(t){return t.data});a.empty&&a.empty(),e=!0,t(u,function(){e=!1;var t=arguments;o(i,function(n){n.callback&&n.callback.apply(null,t)}),c()})}},length:function(){return r.length},running:function(){return e}};return a};var w=function(t){return function(n){var e=Array.prototype.slice.call(arguments,1);n.apply(null,e.concat([function(n){var e=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(n?console.error&&console.error(n):console[t]&&o(e,function(n){console[t](n)}))}]))}};i.log=w("log"),i.dir=w("dir"),i.memoize=function(t,n){var e={},r={};n=n||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),s=n.apply(null,i);s in e?o.apply(null,e[s]):s in r?r[s].push(o):(r[s]=[o],t.apply(null,i.concat([function(){e[s]=arguments;var t=r[s];delete r[s];for(var n=0,i=t.length;i>n;n++)t[n].apply(null,arguments)}])))};return i.memo=e,i.unmemoized=t,i},i.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},i.times=function(t,n,e){for(var r=[],o=0;t>o;o++)r.push(o);return i.map(r,n,e)},i.timesSeries=function(t,n,e){for(var r=[],o=0;t>o;o++)r.push(o);return i.mapSeries(r,n,e)},i.compose=function(){var t=Array.prototype.reverse.call(arguments);return function(){var n=this,e=Array.prototype.slice.call(arguments),r=e.pop();i.reduce(t,e,function(t,e,r){e.apply(n,t.concat([function(){var t=arguments[0],n=Array.prototype.slice.call(arguments,1);r(t,n)}]))},function(t,e){r.apply(n,[t].concat(e))})}};var b=function(t,n){var e=function(){var e=this,r=Array.prototype.slice.call(arguments),i=r.pop();return t(n,function(t,n){t.apply(e,r.concat([n]))},i)};if(arguments.length>2){var r=Array.prototype.slice.call(arguments,2);return e.apply(this,r)}return e};i.applyEach=f(b),i.applyEachSeries=h(b),i.forever=function(t,n){function e(r){if(r){if(n)return n(r);throw r}t(e)}e()},e!==void 0&&e.amd?e("async",[],function(){return i}):"undefined"!=typeof module&&module.exports?module.exports=i:n.async=i}(),e("src/providers/memory",["require","src/constants","async"],function(t){function n(t,n){this.readOnly=n,this.objectStore=t}function e(t){this.name=t||r,this.db={}}var r=t("src/constants").FILE_SYSTEM_NAME,i=t("async").nextTick;return n.prototype.clear=function(t){if(this.readOnly)return i(function(){t("[MemoryContext] Error: write operation on read only context")}),void 0;var n=this.objectStore;Object.keys(n).forEach(function(t){delete n[t]}),i(t)},n.prototype.get=function(t,n){var e=this;i(function(){n(null,e.objectStore[t])})},n.prototype.put=function(t,n,e){return this.readOnly?(i(function(){e("[MemoryContext] Error: write operation on read only context")}),void 0):(this.objectStore[t]=n,i(e),void 0)},n.prototype.delete=function(t,n){return this.readOnly?(i(function(){n("[MemoryContext] Error: write operation on read only context")}),void 0):(delete this.objectStore[t],i(n),void 0)},e.isSupported=function(){return!0},e.prototype.open=function(t){i(function(){t(null,!0)})},e.prototype.getReadOnlyContext=function(){return new n(this.db,!0)},e.prototype.getReadWriteContext=function(){return new n(this.db,!1)},e}),e("src/providers/providers",["require","src/providers/indexeddb","src/providers/websql","src/providers/memory"],function(t){var n=t("src/providers/indexeddb"),e=t("src/providers/websql"),r=t("src/providers/memory");return{IndexedDB:n,WebSQL:e,Memory:r,Default:n,Fallback:function(){function t(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return n.isSupported()?n:e.isSupported()?e:(t.isSupported=function(){return!1},t)}()}}),function(){function t(t){throw t}function n(t,n){var e=t.split("."),r=_;!(e[0]in r)&&r.execScript&&r.execScript("var "+e[0]);for(var i;e.length&&(i=e.shift());)e.length||n===w?r=r[i]?r[i]:r[i]={}:r[i]=n}function e(n,e){this.index="number"==typeof e?e:0,this.i=0,this.buffer=n instanceof(A?Uint8Array:Array)?n:new(A?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&t(Error("invalid index")),this.buffer.length<=this.index&&this.f()}function r(t){this.buffer=new(A?Uint16Array:Array)(2*t),this.length=0}function i(t){var n,e,r,i,o,s,a,c,u,f=t.length,l=0,h=Number.POSITIVE_INFINITY;for(c=0;f>c;++c)t[c]>l&&(l=t[c]),h>t[c]&&(h=t[c]);for(n=1<<l,e=new(A?Uint32Array:Array)(n),r=1,i=0,o=2;l>=r;){for(c=0;f>c;++c)if(t[c]===r){for(s=0,a=i,u=0;r>u;++u)s=s<<1|1&a,a>>=1;for(u=s;n>u;u+=o)e[u]=r<<16|c;++i}++r,i<<=1,o<<=1}return[e,l,h]}function o(t,n){this.h=D,this.w=0,this.input=A&&t instanceof Array?new Uint8Array(t):t,this.b=0,n&&(n.lazy&&(this.w=n.lazy),"number"==typeof n.compressionType&&(this.h=n.compressionType),n.outputBuffer&&(this.a=A&&n.outputBuffer instanceof Array?new Uint8Array(n.outputBuffer):n.outputBuffer),"number"==typeof n.outputIndex&&(this.b=n.outputIndex)),this.a||(this.a=new(A?Uint8Array:Array)(32768))}function s(t,n){this.length=t,this.G=n}function a(n,e){function r(n,e){var r,i=n.G,o=[],s=0;r=B[n.length],o[s++]=65535&r,o[s++]=255&r>>16,o[s++]=r>>24;var a;switch(b){case 1===i:a=[0,i-1,0];break;case 2===i:a=[1,i-2,0];break;case 3===i:a=[2,i-3,0];break;case 4===i:a=[3,i-4,0];break;case 6>=i:a=[4,i-5,1];break;case 8>=i:a=[5,i-7,1];break;case 12>=i:a=[6,i-9,2];break;case 16>=i:a=[7,i-13,2];break;case 24>=i:a=[8,i-17,3];break;case 32>=i:a=[9,i-25,3];break;case 48>=i:a=[10,i-33,4];break;case 64>=i:a=[11,i-49,4];break;case 96>=i:a=[12,i-65,5];break;case 128>=i:a=[13,i-97,5];break;case 192>=i:a=[14,i-129,6];break;case 256>=i:a=[15,i-193,6];break;case 384>=i:a=[16,i-257,7];break;case 512>=i:a=[17,i-385,7];break;case 768>=i:a=[18,i-513,8];break;case 1024>=i:a=[19,i-769,8];break;case 1536>=i:a=[20,i-1025,9];break;case 2048>=i:a=[21,i-1537,9];break;case 3072>=i:a=[22,i-2049,10];break;case 4096>=i:a=[23,i-3073,10];break;case 6144>=i:a=[24,i-4097,11];break;case 8192>=i:a=[25,i-6145,11];break;case 12288>=i:a=[26,i-8193,12];break;case 16384>=i:a=[27,i-12289,12];break;case 24576>=i:a=[28,i-16385,13];break;case 32768>=i:a=[29,i-24577,13];break;default:t("invalid distance")}r=a,o[s++]=r[0],o[s++]=r[1],o[s++]=r[2];var c,u;for(c=0,u=o.length;u>c;++c)g[v++]=o[c];y[o[0]]++,E[o[3]]++,m=n.length+e-1,h=null}var i,o,s,a,u,f,l,h,p,d={},g=A?new Uint16Array(2*e.length):[],v=0,m=0,y=new(A?Uint32Array:Array)(286),E=new(A?Uint32Array:Array)(30),_=n.w;
|
|
if(!A){for(s=0;285>=s;)y[s++]=0;for(s=0;29>=s;)E[s++]=0}for(y[256]=1,i=0,o=e.length;o>i;++i){for(s=u=0,a=3;a>s&&i+s!==o;++s)u=u<<8|e[i+s];if(d[u]===w&&(d[u]=[]),f=d[u],!(m-->0)){for(;f.length>0&&i-f[0]>32768;)f.shift();if(i+3>=o){for(h&&r(h,-1),s=0,a=o-i;a>s;++s)p=e[i+s],g[v++]=p,++y[p];break}f.length>0?(l=c(e,i,f),h?h.length<l.length?(p=e[i-1],g[v++]=p,++y[p],r(l,0)):r(h,-1):_>l.length?h=l:r(l,0)):h?r(h,-1):(p=e[i],g[v++]=p,++y[p])}f.push(i)}return g[v++]=256,y[256]++,n.L=y,n.K=E,A?g.subarray(0,v):g}function c(t,n,e){var r,i,o,a,c,u,f=0,l=t.length;a=0,u=e.length;t:for(;u>a;a++){if(r=e[u-a-1],o=3,f>3){for(c=f;c>3;c--)if(t[r+c-1]!==t[n+c-1])continue t;o=f}for(;258>o&&l>n+o&&t[r+o]===t[n+o];)++o;if(o>f&&(i=r,f=o),258===o)break}return new s(f,n-i)}function u(t,n){var e,i,o,s,a,c=t.length,u=new r(572),l=new(A?Uint8Array:Array)(c);if(!A)for(s=0;c>s;s++)l[s]=0;for(s=0;c>s;++s)t[s]>0&&u.push(s,t[s]);if(e=Array(u.length/2),i=new(A?Uint32Array:Array)(u.length/2),1===e.length)return l[u.pop().index]=1,l;for(s=0,a=u.length/2;a>s;++s)e[s]=u.pop(),i[s]=e[s].value;for(o=f(i,i.length,n),s=0,a=e.length;a>s;++s)l[e[s].index]=o[s];return l}function f(t,n,e){function r(t){var e=p[t][d[t]];e===n?(r(t+1),r(t+1)):--l[e],++d[t]}var i,o,s,a,c,u=new(A?Uint16Array:Array)(e),f=new(A?Uint8Array:Array)(e),l=new(A?Uint8Array:Array)(n),h=Array(e),p=Array(e),d=Array(e),g=(1<<e)-n,v=1<<e-1;for(u[e-1]=n,o=0;e>o;++o)v>g?f[o]=0:(f[o]=1,g-=v),g<<=1,u[e-2-o]=(0|u[e-1-o]/2)+n;for(u[0]=f[0],h[0]=Array(u[0]),p[0]=Array(u[0]),o=1;e>o;++o)u[o]>2*u[o-1]+f[o]&&(u[o]=2*u[o-1]+f[o]),h[o]=Array(u[o]),p[o]=Array(u[o]);for(i=0;n>i;++i)l[i]=e;for(s=0;u[e-1]>s;++s)h[e-1][s]=t[s],p[e-1][s]=s;for(i=0;e>i;++i)d[i]=0;for(1===f[e-1]&&(--l[0],++d[e-1]),o=e-2;o>=0;--o){for(a=i=0,c=d[o+1],s=0;u[o]>s;s++)a=h[o+1][c]+h[o+1][c+1],a>t[i]?(h[o][s]=a,p[o][s]=n,c+=2):(h[o][s]=t[i],p[o][s]=i,++i);d[o]=0,1===f[o]&&r(o)}return l}function l(t){var n,e,r,i,o=new(A?Uint16Array:Array)(t.length),s=[],a=[],c=0;for(n=0,e=t.length;e>n;n++)s[t[n]]=(0|s[t[n]])+1;for(n=1,e=16;e>=n;n++)a[n]=c,c+=0|s[n],c<<=1;for(n=0,e=t.length;e>n;n++)for(c=a[t[n]],a[t[n]]+=1,r=o[n]=0,i=t[n];i>r;r++)o[n]=o[n]<<1|1&c,c>>>=1;return o}function h(n,e){switch(this.l=[],this.m=32768,this.e=this.g=this.c=this.q=0,this.input=A?new Uint8Array(n):n,this.s=!1,this.n=F,this.B=!1,(e||!(e={}))&&(e.index&&(this.c=e.index),e.bufferSize&&(this.m=e.bufferSize),e.bufferType&&(this.n=e.bufferType),e.resize&&(this.B=e.resize)),this.n){case L:this.b=32768,this.a=new(A?Uint8Array:Array)(32768+this.m+258);break;case F:this.b=0,this.a=new(A?Uint8Array:Array)(this.m),this.f=this.J,this.t=this.H,this.o=this.I;break;default:t(Error("invalid inflate mode"))}}function p(n,e){for(var r,i=n.g,o=n.e,s=n.input,a=n.c;e>o;)r=s[a++],r===w&&t(Error("input buffer is broken")),i|=r<<o,o+=8;return r=i&(1<<e)-1,n.g=i>>>e,n.e=o-e,n.c=a,r}function d(t,n){for(var e,r,i,o=t.g,s=t.e,a=t.input,c=t.c,u=n[0],f=n[1];f>s&&(e=a[c++],e!==w);)o|=e<<s,s+=8;return r=u[o&(1<<f)-1],i=r>>>16,t.g=o>>i,t.e=s-i,t.c=c,65535&r}function g(t){function n(t,n,e){var r,i,o,s;for(s=0;t>s;)switch(r=d(this,n)){case 16:for(o=3+p(this,2);o--;)e[s++]=i;break;case 17:for(o=3+p(this,3);o--;)e[s++]=0;i=0;break;case 18:for(o=11+p(this,7);o--;)e[s++]=0;i=0;break;default:i=e[s++]=r}return e}var e,r,o,s,a=p(t,5)+257,c=p(t,5)+1,u=p(t,4)+4,f=new(A?Uint8Array:Array)(V.length);for(s=0;u>s;++s)f[V[s]]=p(t,3);e=i(f),r=new(A?Uint8Array:Array)(a),o=new(A?Uint8Array:Array)(c),t.o(i(n.call(t,a,e,r)),i(n.call(t,c,e,o)))}function v(t){if("string"==typeof t){var n,e,r=t.split("");for(n=0,e=r.length;e>n;n++)r[n]=(255&r[n].charCodeAt(0))>>>0;t=r}for(var i,o=1,s=0,a=t.length,c=0;a>0;){i=a>1024?1024:a,a-=i;do o+=t[c++],s+=o;while(--i);o%=65521,s%=65521}return(s<<16|o)>>>0}function m(n,e){var r,i;switch(this.input=n,this.c=0,(e||!(e={}))&&(e.index&&(this.c=e.index),e.verify&&(this.M=e.verify)),r=n[this.c++],i=n[this.c++],15&r){case rn:this.method=rn;break;default:t(Error("unsupported compression method"))}0!==((r<<8)+i)%31&&t(Error("invalid fcheck flag:"+((r<<8)+i)%31)),32&i&&t(Error("fdict flag is not supported")),this.A=new h(n,{index:this.c,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}function y(t,n){this.input=t,this.a=new(A?Uint8Array:Array)(32768),this.h=on.k;var e,r={};!n&&(n={})||"number"!=typeof n.compressionType||(this.h=n.compressionType);for(e in n)r[e]=n[e];r.outputBuffer=this.a,this.z=new o(this.input,r)}function E(t,e){var r,i,o,s;if(Object.keys)r=Object.keys(e);else for(i in r=[],o=0,e)r[o++]=i;for(o=0,s=r.length;s>o;++o)i=r[o],n(t+"."+i,e[i])}var w=void 0,b=!0,_=this,A="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array;e.prototype.f=function(){var t,n=this.buffer,e=n.length,r=new(A?Uint8Array:Array)(e<<1);if(A)r.set(n);else for(t=0;e>t;++t)r[t]=n[t];return this.buffer=r},e.prototype.d=function(t,n,e){var r,i=this.buffer,o=this.index,s=this.i,a=i[o];if(e&&n>1&&(t=n>8?(T[255&t]<<24|T[255&t>>>8]<<16|T[255&t>>>16]<<8|T[255&t>>>24])>>32-n:T[t]>>8-n),8>n+s)a=a<<n|t,s+=n;else for(r=0;n>r;++r)a=a<<1|1&t>>n-r-1,8===++s&&(s=0,i[o++]=T[a],a=0,o===i.length&&(i=this.f()));i[o]=a,this.buffer=i,this.i=s,this.index=o},e.prototype.finish=function(){var t,n=this.buffer,e=this.index;return this.i>0&&(n[e]<<=8-this.i,n[e]=T[n[e]],e++),A?t=n.subarray(0,e):(n.length=e,t=n),t};var x,O=new(A?Uint8Array:Array)(256);for(x=0;256>x;++x){for(var k=x,S=k,I=7,k=k>>>1;k;k>>>=1)S<<=1,S|=1&k,--I;O[x]=(255&S<<I)>>>0}var T=O;r.prototype.getParent=function(t){return 2*(0|(t-2)/4)},r.prototype.push=function(t,n){var e,r,i,o=this.buffer;for(e=this.length,o[this.length++]=n,o[this.length++]=t;e>0&&(r=this.getParent(e),o[e]>o[r]);)i=o[e],o[e]=o[r],o[r]=i,i=o[e+1],o[e+1]=o[r+1],o[r+1]=i,e=r;return this.length},r.prototype.pop=function(){var t,n,e,r,i,o=this.buffer;for(n=o[0],t=o[1],this.length-=2,o[0]=o[this.length],o[1]=o[this.length+1],i=0;(r=2*i+2,!(r>=this.length))&&(this.length>r+2&&o[r+2]>o[r]&&(r+=2),o[r]>o[i]);)e=o[i],o[i]=o[r],o[r]=e,e=o[i+1],o[i+1]=o[r+1],o[r+1]=e,i=r;return{index:t,value:n,length:this.length}};var N,D=2,R={NONE:0,r:1,k:D,N:3},C=[];for(N=0;288>N;N++)switch(b){case 143>=N:C.push([N+48,8]);break;case 255>=N:C.push([N-144+400,9]);break;case 279>=N:C.push([N-256+0,7]);break;case 287>=N:C.push([N-280+192,8]);break;default:t("invalid literal: "+N)}o.prototype.j=function(){var n,r,i,o,s=this.input;switch(this.h){case 0:for(i=0,o=s.length;o>i;){r=A?s.subarray(i,i+65535):s.slice(i,i+65535),i+=r.length;var c=r,f=i===o,h=w,p=w,d=w,g=w,v=w,m=this.a,y=this.b;if(A){for(m=new Uint8Array(this.a.buffer);m.length<=y+c.length+5;)m=new Uint8Array(m.length<<1);m.set(this.a)}if(h=f?1:0,m[y++]=0|h,p=c.length,d=65535&~p+65536,m[y++]=255&p,m[y++]=255&p>>>8,m[y++]=255&d,m[y++]=255&d>>>8,A)m.set(c,y),y+=c.length,m=m.subarray(0,y);else{for(g=0,v=c.length;v>g;++g)m[y++]=c[g];m.length=y}this.b=y,this.a=m}break;case 1:var E=new e(A?new Uint8Array(this.a.buffer):this.a,this.b);E.d(1,1,b),E.d(1,2,b);var _,x,O,k=a(this,s);for(_=0,x=k.length;x>_;_++)if(O=k[_],e.prototype.d.apply(E,C[O]),O>256)E.d(k[++_],k[++_],b),E.d(k[++_],5),E.d(k[++_],k[++_],b);else if(256===O)break;this.a=E.finish(),this.b=this.a.length;break;case D:var S,I,T,N,R,M,B,L,F,j,U,P,z,V,W,q=new e(A?new Uint8Array(this.a.buffer):this.a,this.b),H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Y=Array(19);for(S=D,q.d(1,1,b),q.d(S,2,b),I=a(this,s),M=u(this.L,15),B=l(M),L=u(this.K,7),F=l(L),T=286;T>257&&0===M[T-1];T--);for(N=30;N>1&&0===L[N-1];N--);var X,K,J,Q,Z,G,$=T,tn=N,nn=new(A?Uint32Array:Array)($+tn),en=new(A?Uint32Array:Array)(316),rn=new(A?Uint8Array:Array)(19);for(X=K=0;$>X;X++)nn[K++]=M[X];for(X=0;tn>X;X++)nn[K++]=L[X];if(!A)for(X=0,Q=rn.length;Q>X;++X)rn[X]=0;for(X=Z=0,Q=nn.length;Q>X;X+=K){for(K=1;Q>X+K&&nn[X+K]===nn[X];++K);if(J=K,0===nn[X])if(3>J)for(;J-->0;)en[Z++]=0,rn[0]++;else for(;J>0;)G=138>J?J:138,G>J-3&&J>G&&(G=J-3),10>=G?(en[Z++]=17,en[Z++]=G-3,rn[17]++):(en[Z++]=18,en[Z++]=G-11,rn[18]++),J-=G;else if(en[Z++]=nn[X],rn[nn[X]]++,J--,3>J)for(;J-->0;)en[Z++]=nn[X],rn[nn[X]]++;else for(;J>0;)G=6>J?J:6,G>J-3&&J>G&&(G=J-3),en[Z++]=16,en[Z++]=G-3,rn[16]++,J-=G}for(n=A?en.subarray(0,Z):en.slice(0,Z),j=u(rn,7),V=0;19>V;V++)Y[V]=j[H[V]];for(R=19;R>4&&0===Y[R-1];R--);for(U=l(j),q.d(T-257,5,b),q.d(N-1,5,b),q.d(R-4,4,b),V=0;R>V;V++)q.d(Y[V],3,b);for(V=0,W=n.length;W>V;V++)if(P=n[V],q.d(U[P],j[P],b),P>=16){switch(V++,P){case 16:z=2;break;case 17:z=3;break;case 18:z=7;break;default:t("invalid code: "+P)}q.d(n[V],z,b)}var on,sn,an,cn,un,fn,ln,hn,pn=[B,M],dn=[F,L];for(un=pn[0],fn=pn[1],ln=dn[0],hn=dn[1],on=0,sn=I.length;sn>on;++on)if(an=I[on],q.d(un[an],fn[an],b),an>256)q.d(I[++on],I[++on],b),cn=I[++on],q.d(ln[cn],hn[cn],b),q.d(I[++on],I[++on],b);else if(256===an)break;this.a=q.finish(),this.b=this.a.length;break;default:t("invalid compression type")}return this.a};var M=function(){function n(n){switch(b){case 3===n:return[257,n-3,0];case 4===n:return[258,n-4,0];case 5===n:return[259,n-5,0];case 6===n:return[260,n-6,0];case 7===n:return[261,n-7,0];case 8===n:return[262,n-8,0];case 9===n:return[263,n-9,0];case 10===n:return[264,n-10,0];case 12>=n:return[265,n-11,1];case 14>=n:return[266,n-13,1];case 16>=n:return[267,n-15,1];case 18>=n:return[268,n-17,1];case 22>=n:return[269,n-19,2];case 26>=n:return[270,n-23,2];case 30>=n:return[271,n-27,2];case 34>=n:return[272,n-31,2];case 42>=n:return[273,n-35,3];case 50>=n:return[274,n-43,3];case 58>=n:return[275,n-51,3];case 66>=n:return[276,n-59,3];case 82>=n:return[277,n-67,4];case 98>=n:return[278,n-83,4];case 114>=n:return[279,n-99,4];case 130>=n:return[280,n-115,4];case 162>=n:return[281,n-131,5];case 194>=n:return[282,n-163,5];case 226>=n:return[283,n-195,5];case 257>=n:return[284,n-227,5];case 258===n:return[285,n-258,0];default:t("invalid length: "+n)}}var e,r,i=[];for(e=3;258>=e;e++)r=n(e),i[e]=r[2]<<24|r[1]<<16|r[0];return i}(),B=A?new Uint32Array(M):M,L=0,F=1,j={D:L,C:F};h.prototype.p=function(){for(;!this.s;){var n=p(this,3);switch(1&n&&(this.s=b),n>>>=1){case 0:var e=this.input,r=this.c,i=this.a,o=this.b,s=w,a=w,c=w,u=i.length,f=w;switch(this.e=this.g=0,s=e[r++],s===w&&t(Error("invalid uncompressed block header: LEN (first byte)")),a=s,s=e[r++],s===w&&t(Error("invalid uncompressed block header: LEN (second byte)")),a|=s<<8,s=e[r++],s===w&&t(Error("invalid uncompressed block header: NLEN (first byte)")),c=s,s=e[r++],s===w&&t(Error("invalid uncompressed block header: NLEN (second byte)")),c|=s<<8,a===~c&&t(Error("invalid uncompressed block header: length verify")),r+a>e.length&&t(Error("input buffer is broken")),this.n){case L:for(;o+a>i.length;){if(f=u-o,a-=f,A)i.set(e.subarray(r,r+f),o),o+=f,r+=f;else for(;f--;)i[o++]=e[r++];this.b=o,i=this.f(),o=this.b}break;case F:for(;o+a>i.length;)i=this.f({v:2});break;default:t(Error("invalid inflate mode"))}if(A)i.set(e.subarray(r,r+a),o),o+=a,r+=a;else for(;a--;)i[o++]=e[r++];this.c=r,this.b=o,this.a=i;break;case 1:this.o(tn,en);break;case 2:g(this);break;default:t(Error("unknown BTYPE: "+n))}}return this.t()};var U,P,z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],V=A?new Uint16Array(z):z,W=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],q=A?new Uint16Array(W):W,H=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],Y=A?new Uint8Array(H):H,X=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],K=A?new Uint16Array(X):X,J=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Q=A?new Uint8Array(J):J,Z=new(A?Uint8Array:Array)(288);for(U=0,P=Z.length;P>U;++U)Z[U]=143>=U?8:255>=U?9:279>=U?7:8;var G,$,tn=i(Z),nn=new(A?Uint8Array:Array)(30);for(G=0,$=nn.length;$>G;++G)nn[G]=5;var en=i(nn);h.prototype.o=function(t,n){var e=this.a,r=this.b;this.u=t;for(var i,o,s,a,c=e.length-258;256!==(i=d(this,t));)if(256>i)r>=c&&(this.b=r,e=this.f(),r=this.b),e[r++]=i;else for(o=i-257,a=q[o],Y[o]>0&&(a+=p(this,Y[o])),i=d(this,n),s=K[i],Q[i]>0&&(s+=p(this,Q[i])),r>=c&&(this.b=r,e=this.f(),r=this.b);a--;)e[r]=e[r++-s];for(;this.e>=8;)this.e-=8,this.c--;this.b=r},h.prototype.I=function(t,n){var e=this.a,r=this.b;this.u=t;for(var i,o,s,a,c=e.length;256!==(i=d(this,t));)if(256>i)r>=c&&(e=this.f(),c=e.length),e[r++]=i;else for(o=i-257,a=q[o],Y[o]>0&&(a+=p(this,Y[o])),i=d(this,n),s=K[i],Q[i]>0&&(s+=p(this,Q[i])),r+a>c&&(e=this.f(),c=e.length);a--;)e[r]=e[r++-s];for(;this.e>=8;)this.e-=8,this.c--;this.b=r},h.prototype.f=function(){var t,n,e=new(A?Uint8Array:Array)(this.b-32768),r=this.b-32768,i=this.a;if(A)e.set(i.subarray(32768,e.length));else for(t=0,n=e.length;n>t;++t)e[t]=i[t+32768];if(this.l.push(e),this.q+=e.length,A)i.set(i.subarray(r,r+32768));else for(t=0;32768>t;++t)i[t]=i[r+t];return this.b=32768,i},h.prototype.J=function(t){var n,e,r,i,o=0|this.input.length/this.c+1,s=this.input,a=this.a;return t&&("number"==typeof t.v&&(o=t.v),"number"==typeof t.F&&(o+=t.F)),2>o?(e=(s.length-this.c)/this.u[2],i=0|258*(e/2),r=a.length>i?a.length+i:a.length<<1):r=a.length*o,A?(n=new Uint8Array(r),n.set(a)):n=a,this.a=n},h.prototype.t=function(){var t,n,e,r,i,o=0,s=this.a,a=this.l,c=new(A?Uint8Array:Array)(this.q+(this.b-32768));if(0===a.length)return A?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(n=0,e=a.length;e>n;++n)for(t=a[n],r=0,i=t.length;i>r;++r)c[o++]=t[r];for(n=32768,e=this.b;e>n;++n)c[o++]=s[n];return this.l=[],this.buffer=c},h.prototype.H=function(){var t,n=this.b;return A?this.B?(t=new Uint8Array(n),t.set(this.a.subarray(0,n))):t=this.a.subarray(0,n):(this.a.length>n&&(this.a.length=n),t=this.a),this.buffer=t},m.prototype.p=function(){var n,e,r=this.input;return n=this.A.p(),this.c=this.A.c,this.M&&(e=(r[this.c++]<<24|r[this.c++]<<16|r[this.c++]<<8|r[this.c++])>>>0,e!==v(n)&&t(Error("invalid adler-32 checksum"))),n};var rn=8,on=R;y.prototype.j=function(){var n,e,r,i,o,s,a,c=0;switch(a=this.a,n=rn){case rn:e=Math.LOG2E*Math.log(32768)-8;break;default:t(Error("invalid compression method"))}switch(r=e<<4|n,a[c++]=r,n){case rn:switch(this.h){case on.NONE:o=0;break;case on.r:o=1;break;case on.k:o=2;break;default:t(Error("unsupported compression type"))}break;default:t(Error("invalid compression method"))}return i=0|o<<6,a[c++]=i|31-(256*r+i)%31,s=v(this.input),this.z.b=c,a=this.z.j(),c=a.length,A&&(a=new Uint8Array(a.buffer),c+4>=a.length&&(this.a=new Uint8Array(a.length+4),this.a.set(a),a=this.a),a=a.subarray(0,c+4)),a[c++]=255&s>>24,a[c++]=255&s>>16,a[c++]=255&s>>8,a[c++]=255&s,a},n("Zlib.Inflate",m),n("Zlib.Inflate.prototype.decompress",m.prototype.p),E("Zlib.Inflate.BufferType",{ADAPTIVE:j.C,BLOCK:j.D}),n("Zlib.Deflate",y),n("Zlib.Deflate.compress",function(t,n){return new y(t,n).j()}),n("Zlib.Deflate.prototype.compress",y.prototype.j),E("Zlib.Deflate.CompressionType",{NONE:on.NONE,FIXED:on.r,DYNAMIC:on.k})}.call(this),e("zlib",function(){}),e("src/adapters/zlib",["require","zlib"],function(t){function n(t){return new o(t).decompress()}function e(t){return new s(t).compress()}function r(t){this.context=t}function i(t){this.provider=t}t("zlib");var o=Zlib.Inflate,s=Zlib.Deflate;return r.prototype.clear=function(t){this.context.clear(t)},r.prototype.get=function(t,e){this.context.get(t,function(t,r){return t?(e(t),void 0):(r&&(r=n(r)),e(null,r),void 0)})},r.prototype.put=function(t,n,r){n=e(n),this.context.put(t,n,r)},r.prototype.delete=function(t,n){this.context.delete(t,n)},i.isSupported=function(){return!0},i.prototype.open=function(t){this.provider.open(t)},i.prototype.getReadOnlyContext=function(){return new r(this.provider.getReadOnlyContext())},i.prototype.getReadWriteContext=function(){return new r(this.provider.getReadWriteContext())},i});var r=r||function(t,n){var e={},r=e.lib={},i=r.Base=function(){function t(){}return{extend:function(n){t.prototype=this;var e=new t;return n&&e.mixIn(n),e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.$super.extend(this)}}}(),o=r.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=e!=n?e:4*t.length},toString:function(t){return(t||a).stringify(this)},concat:function(t){var n=this.words,e=t.words,r=this.sigBytes,t=t.sigBytes;if(this.clamp(),r%4)for(var i=0;t>i;i++)n[r+i>>>2]|=(255&e[i>>>2]>>>24-8*(i%4))<<24-8*((r+i)%4);else if(e.length>65535)for(i=0;t>i;i+=4)n[r+i>>>2]=e[i>>>2];else n.push.apply(n,e);return this.sigBytes+=t,this},clamp:function(){var n=this.words,e=this.sigBytes;n[e>>>2]&=4294967295<<32-8*(e%4),n.length=t.ceil(e/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(n){for(var e=[],r=0;n>r;r+=4)e.push(0|4294967296*t.random());return o.create(e,n)}}),s=e.enc={},a=s.Hex={stringify:function(t){for(var n=t.words,t=t.sigBytes,e=[],r=0;t>r;r++){var i=255&n[r>>>2]>>>24-8*(r%4);e.push((i>>>4).toString(16)),e.push((15&i).toString(16))}return e.join("")},parse:function(t){for(var n=t.length,e=[],r=0;n>r;r+=2)e[r>>>3]|=parseInt(t.substr(r,2),16)<<24-4*(r%8);return o.create(e,n/2)}},c=s.Latin1={stringify:function(t){for(var n=t.words,t=t.sigBytes,e=[],r=0;t>r;r++)e.push(String.fromCharCode(255&n[r>>>2]>>>24-8*(r%4)));return e.join("")},parse:function(t){for(var n=t.length,e=[],r=0;n>r;r++)e[r>>>2]|=(255&t.charCodeAt(r))<<24-8*(r%4);return o.create(e,n)}},u=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(n){throw Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=o.create(),this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(n){var e=this._data,r=e.words,i=e.sigBytes,s=this.blockSize,a=i/(4*s),a=n?t.ceil(a):t.max((0|a)-this._minBufferSize,0),n=a*s,i=t.min(4*n,i);if(n){for(var c=0;n>c;c+=s)this._doProcessBlock(r,c);c=r.splice(0,n),e.sigBytes-=i}return o.create(c,i)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});r.Hasher=f.extend({init:function(){this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize(),this._hash},clone:function(){var t=f.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:16,_createHelper:function(t){return function(n,e){return t.create(e).finalize(n)}},_createHmacHelper:function(t){return function(n,e){return l.HMAC.create(t,e).finalize(n)}}});var l=e.algo={};return e}(Math);(function(){var t=r,n=t.lib.WordArray;t.enc.Base64={stringify:function(t){var n=t.words,e=t.sigBytes,r=this._map;t.clamp();for(var t=[],i=0;e>i;i+=3)for(var o=(255&n[i>>>2]>>>24-8*(i%4))<<16|(255&n[i+1>>>2]>>>24-8*((i+1)%4))<<8|255&n[i+2>>>2]>>>24-8*((i+2)%4),s=0;4>s&&e>i+.75*s;s++)t.push(r.charAt(63&o>>>6*(3-s)));if(n=r.charAt(64))for(;t.length%4;)t.push(n);return t.join("")},parse:function(t){var t=t.replace(/\s/g,""),e=t.length,r=this._map,i=r.charAt(64);i&&(i=t.indexOf(i),-1!=i&&(e=i));for(var i=[],o=0,s=0;e>s;s++)if(s%4){var a=r.indexOf(t.charAt(s-1))<<2*(s%4),c=r.indexOf(t.charAt(s))>>>6-2*(s%4);i[o>>>2]|=(a|c)<<24-8*(o%4),o++}return n.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(),function(t){function n(t,n,e,r,i,o,s){return t=t+(n&e|~n&r)+i+s,(t<<o|t>>>32-o)+n}function e(t,n,e,r,i,o,s){return t=t+(n&r|e&~r)+i+s,(t<<o|t>>>32-o)+n}function i(t,n,e,r,i,o,s){return t=t+(n^e^r)+i+s,(t<<o|t>>>32-o)+n}function o(t,n,e,r,i,o,s){return t=t+(e^(n|~r))+i+s,(t<<o|t>>>32-o)+n}var s=r,a=s.lib,c=a.WordArray,a=a.Hasher,u=s.algo,f=[];(function(){for(var n=0;64>n;n++)f[n]=0|4294967296*t.abs(t.sin(n+1))})(),u=u.MD5=a.extend({_doReset:function(){this._hash=c.create([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,r){for(var s=0;16>s;s++){var a=r+s,c=t[a];t[a]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}for(var a=this._hash.words,c=a[0],u=a[1],l=a[2],h=a[3],s=0;64>s;s+=4)16>s?(c=n(c,u,l,h,t[r+s],7,f[s]),h=n(h,c,u,l,t[r+s+1],12,f[s+1]),l=n(l,h,c,u,t[r+s+2],17,f[s+2]),u=n(u,l,h,c,t[r+s+3],22,f[s+3])):32>s?(c=e(c,u,l,h,t[r+(s+1)%16],5,f[s]),h=e(h,c,u,l,t[r+(s+6)%16],9,f[s+1]),l=e(l,h,c,u,t[r+(s+11)%16],14,f[s+2]),u=e(u,l,h,c,t[r+s%16],20,f[s+3])):48>s?(c=i(c,u,l,h,t[r+(3*s+5)%16],4,f[s]),h=i(h,c,u,l,t[r+(3*s+8)%16],11,f[s+1]),l=i(l,h,c,u,t[r+(3*s+11)%16],16,f[s+2]),u=i(u,l,h,c,t[r+(3*s+14)%16],23,f[s+3])):(c=o(c,u,l,h,t[r+3*s%16],6,f[s]),h=o(h,c,u,l,t[r+(3*s+7)%16],10,f[s+1]),l=o(l,h,c,u,t[r+(3*s+14)%16],15,f[s+2]),u=o(u,l,h,c,t[r+(3*s+5)%16],21,f[s+3]));a[0]=0|a[0]+c,a[1]=0|a[1]+u,a[2]=0|a[2]+l,a[3]=0|a[3]+h},_doFinalize:function(){var t=this._data,n=t.words,e=8*this._nDataBytes,r=8*t.sigBytes;for(n[r>>>5]|=128<<24-r%32,n[(r+64>>>9<<4)+14]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8),t.sigBytes=4*(n.length+1),this._process(),t=this._hash.words,n=0;4>n;n++)e=t[n],t[n]=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8)}}),s.MD5=a._createHelper(u),s.HmacMD5=a._createHmacHelper(u)}(Math),function(){var t=r,n=t.lib,e=n.Base,i=n.WordArray,n=t.algo,o=n.EvpKDF=e.extend({cfg:e.extend({keySize:4,hasher:n.MD5,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,n){for(var e=this.cfg,r=e.hasher.create(),o=i.create(),s=o.words,a=e.keySize,e=e.iterations;a>s.length;){c&&r.update(c);var c=r.update(t).finalize(n);r.reset();for(var u=1;e>u;u++)c=r.finalize(c),r.reset();o.concat(c)}return o.sigBytes=4*a,o}});t.EvpKDF=function(t,n,e){return o.create(e).compute(t,n)}}(),r.lib.Cipher||function(t){var n=r,e=n.lib,i=e.Base,o=e.WordArray,s=e.BufferedBlockAlgorithm,a=n.enc.Base64,c=n.algo.EvpKDF,u=e.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(t,n){return this.create(this._ENC_XFORM_MODE,t,n)},createDecryptor:function(t,n){return this.create(this._DEC_XFORM_MODE,t,n)},init:function(t,n,e){this.cfg=this.cfg.extend(e),this._xformMode=t,this._key=n,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){return function(t){return{encrypt:function(n,e,r){return("string"==typeof e?g:d).encrypt(t,n,e,r)},decrypt:function(n,e,r){return("string"==typeof e?g:d).decrypt(t,n,e,r)}}}}()});e.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=n.mode={},l=e.BlockCipherMode=i.extend({createEncryptor:function(t,n){return this.Encryptor.create(t,n)},createDecryptor:function(t,n){return this.Decryptor.create(t,n)},init:function(t,n){this._cipher=t,this._iv=n}}),f=f.CBC=function(){function n(n,e,r){var i=this._iv;i?this._iv=t:i=this._prevBlock;for(var o=0;r>o;o++)n[e+o]^=i[o]}var e=l.extend();return e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize;n.call(this,t,e,i),r.encryptBlock(t,e),this._prevBlock=t.slice(e,e+i)}}),e.Decryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,o=t.slice(e,e+i);r.decryptBlock(t,e),n.call(this,t,e,i),this._prevBlock=o}}),e}(),h=(n.pad={}).Pkcs7={pad:function(t,n){for(var e=4*n,e=e-t.sigBytes%e,r=e<<24|e<<16|e<<8|e,i=[],s=0;e>s;s+=4)i.push(r);e=o.create(i,e),t.concat(e)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}};e.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:h}),reset:function(){u.reset.call(this);var t=this.cfg,n=t.iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var e=t.createEncryptor;else e=t.createDecryptor,this._minBufferSize=1;this._mode=e.call(t,this,n&&n.words)},_doProcessBlock:function(t,n){this._mode.processBlock(t,n)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var n=this._process(!0)}else n=this._process(!0),t.unpad(n);return n},blockSize:4});var p=e.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),f=(n.format={}).OpenSSL={stringify:function(t){var n=t.ciphertext,t=t.salt,n=(t?o.create([1398893684,1701076831]).concat(t).concat(n):n).toString(a);return n=n.replace(/(.{64})/g,"$1\n")},parse:function(t){var t=a.parse(t),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var e=o.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return p.create({ciphertext:t,salt:e})}},d=e.SerializableCipher=i.extend({cfg:i.extend({format:f}),encrypt:function(t,n,e,r){var r=this.cfg.extend(r),i=t.createEncryptor(e,r),n=i.finalize(n),i=i.cfg;return p.create({ciphertext:n,key:e,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,n,e,r){return r=this.cfg.extend(r),n=this._parse(n,r.format),t.createDecryptor(e,r).finalize(n.ciphertext)},_parse:function(t,n){return"string"==typeof t?n.parse(t):t}}),n=(n.kdf={}).OpenSSL={compute:function(t,n,e,r){return r||(r=o.random(8)),t=c.create({keySize:n+e}).compute(t,r),e=o.create(t.words.slice(n),4*e),t.sigBytes=4*n,p.create({key:t,iv:e,salt:r})}},g=e.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:n}),encrypt:function(t,n,e,r){return r=this.cfg.extend(r),e=r.kdf.compute(e,t.keySize,t.ivSize),r.iv=e.iv,t=d.encrypt.call(this,t,n,e.key,r),t.mixIn(e),t},decrypt:function(t,n,e,r){return r=this.cfg.extend(r),n=this._parse(n,r.format),e=r.kdf.compute(e,t.keySize,t.ivSize,n.salt),r.iv=e.iv,d.decrypt.call(this,t,n,e.key,r)}})}(),function(){var t=r,n=t.lib.BlockCipher,e=t.algo,i=[],o=[],s=[],a=[],c=[],u=[],f=[],l=[],h=[],p=[];(function(){for(var t=[],n=0;256>n;n++)t[n]=128>n?n<<1:283^n<<1;for(var e=0,r=0,n=0;256>n;n++){var d=r^r<<1^r<<2^r<<3^r<<4,d=99^(d>>>8^255&d);i[e]=d,o[d]=e;var g=t[e],v=t[g],m=t[v],y=257*t[d]^16843008*d;s[e]=y<<24|y>>>8,a[e]=y<<16|y>>>16,c[e]=y<<8|y>>>24,u[e]=y,y=16843009*m^65537*v^257*g^16843008*e,f[d]=y<<24|y>>>8,l[d]=y<<16|y>>>16,h[d]=y<<8|y>>>24,p[d]=y,e?(e=g^t[t[t[m^g]]],r^=t[t[r]]):e=r=1}})();var d=[0,1,2,4,8,16,32,64,128,27,54],e=e.AES=n.extend({_doReset:function(){for(var t=this._key,n=t.words,e=t.sigBytes/4,t=4*((this._nRounds=e+6)+1),r=this._keySchedule=[],o=0;t>o;o++)if(e>o)r[o]=n[o];else{var s=r[o-1];o%e?e>6&&4==o%e&&(s=i[s>>>24]<<24|i[255&s>>>16]<<16|i[255&s>>>8]<<8|i[255&s]):(s=s<<8|s>>>24,s=i[s>>>24]<<24|i[255&s>>>16]<<16|i[255&s>>>8]<<8|i[255&s],s^=d[0|o/e]<<24),r[o]=r[o-e]^s}for(n=this._invKeySchedule=[],e=0;t>e;e++)o=t-e,s=e%4?r[o]:r[o-4],n[e]=4>e||4>=o?s:f[i[s>>>24]]^l[i[255&s>>>16]]^h[i[255&s>>>8]]^p[i[255&s]]},encryptBlock:function(t,n){this._doCryptBlock(t,n,this._keySchedule,s,a,c,u,i)},decryptBlock:function(t,n){var e=t[n+1];t[n+1]=t[n+3],t[n+3]=e,this._doCryptBlock(t,n,this._invKeySchedule,f,l,h,p,o),e=t[n+1],t[n+1]=t[n+3],t[n+3]=e},_doCryptBlock:function(t,n,e,r,i,o,s,a){for(var c=this._nRounds,u=t[n]^e[0],f=t[n+1]^e[1],l=t[n+2]^e[2],h=t[n+3]^e[3],p=4,d=1;c>d;d++)var g=r[u>>>24]^i[255&f>>>16]^o[255&l>>>8]^s[255&h]^e[p++],v=r[f>>>24]^i[255&l>>>16]^o[255&h>>>8]^s[255&u]^e[p++],m=r[l>>>24]^i[255&h>>>16]^o[255&u>>>8]^s[255&f]^e[p++],h=r[h>>>24]^i[255&u>>>16]^o[255&f>>>8]^s[255&l]^e[p++],u=g,f=v,l=m;g=(a[u>>>24]<<24|a[255&f>>>16]<<16|a[255&l>>>8]<<8|a[255&h])^e[p++],v=(a[f>>>24]<<24|a[255&l>>>16]<<16|a[255&h>>>8]<<8|a[255&u])^e[p++],m=(a[l>>>24]<<24|a[255&h>>>16]<<16|a[255&u>>>8]<<8|a[255&f])^e[p++],h=(a[h>>>24]<<24|a[255&u>>>16]<<16|a[255&f>>>8]<<8|a[255&l])^e[p++],t[n]=g,t[n+1]=v,t[n+2]=m,t[n+3]=h},keySize:8});t.AES=n._createHelper(e)}(),e("crypto-js/rollups/aes",function(){}),function(t){t["encoding-indexes"]=t["encoding-indexes"]||[]}(this),e("encoding-indexes-shim",function(){}),function(t){function n(t,n,e){return t>=n&&e>=t}function e(t,n){return Math.floor(t/n)}function r(t){var n=0;this.get=function(){return n>=t.length?j:Number(t[n])},this.offset=function(e){if(n+=e,0>n)throw Error("Seeking past start of the buffer");if(n>t.length)throw Error("Seeking past EOF")},this.match=function(e){if(e.length>n+t.length)return!1;var r;for(r=0;e.length>r;r+=1)if(Number(t[n+r])!==e[r])return!1;return!0}}function i(t){var n=0;this.emit=function(){var e,r=j;for(e=0;arguments.length>e;++e)r=Number(arguments[e]),t[n++]=r;return r}}function o(t){function e(t){for(var e=[],r=0,i=t.length;t.length>r;){var o=t.charCodeAt(r);if(n(o,55296,57343))if(n(o,56320,57343))e.push(65533);else if(r===i-1)e.push(65533);else{var s=t.charCodeAt(r+1);if(n(s,56320,57343)){var a=1023&o,c=1023&s;r+=1,e.push(65536+(a<<10)+c)}else e.push(65533)}else e.push(o);r+=1}return e}var r=0,i=e(t);this.offset=function(t){if(r+=t,0>r)throw Error("Seeking past start of the buffer");if(r>i.length)throw Error("Seeking past EOF")},this.get=function(){return r>=i.length?U:i[r]}}function s(){var t="";this.string=function(){return t},this.emit=function(n){65535>=n?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode(55296+(1023&n>>10)),t+=String.fromCharCode(56320+(1023&n)))}}function a(t){this.name="EncodingError",this.message=t,this.code=0}function c(t,n){if(t)throw new a("Decoder error");return n||65533}function u(t){throw new a("The code point "+t+" could not be encoded.")}function f(t){return t=(t+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(V,t)?V[t]:null}function l(t,n){return(n||[])[t]||null}function h(t,n){var e=n.indexOf(t);return-1===e?null:e}function p(n){if(!("encoding-indexes"in t))throw Error("Indexes missing. Did you forget to include encoding-indexes.js?");return t["encoding-indexes"][n]}function d(t){if(t>39419&&189e3>t||t>1237575)return null;var n,e=0,r=0,i=p("gb18030");for(n=0;i.length>n;++n){var o=i[n];if(!(t>=o[0]))break;e=o[0],r=o[1]}return r+t-e}function g(t){var n,e=0,r=0,i=p("gb18030");for(n=0;i.length>n;++n){var o=i[n];if(!(t>=o[1]))break;e=o[1],r=o[0]}return r+t-e}function v(t){var e=t.fatal,r=0,i=0,o=0,s=0;this.decode=function(t){var a=t.get();if(a===j)return 0!==i?c(e):U;if(t.offset(1),0===i){if(n(a,0,127))return a;if(n(a,194,223))i=1,s=128,r=a-192;else if(n(a,224,239))i=2,s=2048,r=a-224;else{if(!n(a,240,244))return c(e);i=3,s=65536,r=a-240}return r*=Math.pow(64,i),null}if(!n(a,128,191))return r=0,i=0,o=0,s=0,t.offset(-1),c(e);if(o+=1,r+=(a-128)*Math.pow(64,i-o),o!==i)return null;var u=r,f=s;return r=0,i=0,o=0,s=0,n(u,f,1114111)&&!n(u,55296,57343)?u:c(e)}}function m(t){t.fatal,this.encode=function(t,r){var i=r.get();if(i===U)return j;if(r.offset(1),n(i,55296,57343))return u(i);if(n(i,0,127))return t.emit(i);var o,s;n(i,128,2047)?(o=1,s=192):n(i,2048,65535)?(o=2,s=224):n(i,65536,1114111)&&(o=3,s=240);for(var a=t.emit(e(i,Math.pow(64,o))+s);o>0;){var c=e(i,Math.pow(64,o-1));a=t.emit(128+c%64),o-=1}return a}}function y(t,e){var r=e.fatal;this.decode=function(e){var i=e.get();if(i===j)return U;if(e.offset(1),n(i,0,127))return i;var o=t[i-128];return null===o?c(r):o}}function E(t,e){e.fatal,this.encode=function(e,r){var i=r.get();if(i===U)return j;if(r.offset(1),n(i,0,127))return e.emit(i);var o=h(i,t);return null===o&&u(i),e.emit(o+128)}}function w(t,e){var r=e.fatal,i=0,o=0,s=0;this.decode=function(e){var a=e.get();if(a===j&&0===i&&0===o&&0===s)return U;a!==j||0===i&&0===o&&0===s||(i=0,o=0,s=0,c(r)),e.offset(1);var u;if(0!==s)return u=null,n(a,48,57)&&(u=d(10*(126*(10*(i-129)+(o-48))+(s-129))+a-48)),i=0,o=0,s=0,null===u?(e.offset(-3),c(r)):u;if(0!==o)return n(a,129,254)?(s=a,null):(e.offset(-2),i=0,o=0,c(r));if(0!==i){if(n(a,48,57)&&t)return o=a,null;var f=i,h=null;i=0;var g=127>a?64:65;return(n(a,64,126)||n(a,128,254))&&(h=190*(f-129)+(a-g)),u=null===h?null:l(h,p("gbk")),null===h&&e.offset(-1),null===u?c(r):u}return n(a,0,127)?a:128===a?8364:n(a,129,254)?(i=a,null):c(r)}}function b(t,r){r.fatal,this.encode=function(r,i){var o=i.get();if(o===U)return j;if(i.offset(1),n(o,0,127))return r.emit(o);var s=h(o,p("gbk"));if(null!==s){var a=e(s,190)+129,c=s%190,f=63>c?64:65;return r.emit(a,c+f)}if(null===s&&!t)return u(o);s=g(o);
|
|
var l=e(e(e(s,10),126),10);s-=10*126*10*l;var d=e(e(s,10),126);s-=126*10*d;var v=e(s,10),m=s-10*v;return r.emit(l+129,d+48,v+129,m+48)}}function _(t){var e=t.fatal,r=!1,i=0;this.decode=function(t){var o=t.get();if(o===j&&0===i)return U;if(o===j&&0!==i)return i=0,c(e);if(t.offset(1),126===i)return i=0,123===o?(r=!0,null):125===o?(r=!1,null):126===o?126:10===o?null:(t.offset(-1),c(e));if(0!==i){var s=i;i=0;var a=null;return n(o,33,126)&&(a=l(190*(s-1)+(o+63),p("gbk"))),10===o&&(r=!1),null===a?c(e):a}return 126===o?(i=126,null):r?n(o,32,127)?(i=o,null):(10===o&&(r=!1),c(e)):n(o,0,127)?o:c(e)}}function A(t){t.fatal;var r=!1;this.encode=function(t,i){var o=i.get();if(o===U)return j;if(i.offset(1),n(o,0,127)&&r)return i.offset(-1),r=!1,t.emit(126,125);if(126===o)return t.emit(126,126);if(n(o,0,127))return t.emit(o);if(!r)return i.offset(-1),r=!0,t.emit(126,123);var s=h(o,p("gbk"));if(null===s)return u(o);var a=e(s,190)+1,c=s%190-63;return n(a,33,126)&&n(c,33,126)?t.emit(a,c):u(o)}}function x(t){var e=t.fatal,r=0,i=null;this.decode=function(t){if(null!==i){var o=i;return i=null,o}var s=t.get();if(s===j&&0===r)return U;if(s===j&&0!==r)return r=0,c(e);if(t.offset(1),0!==r){var a=r,u=null;r=0;var f=127>s?64:98;if((n(s,64,126)||n(s,161,254))&&(u=157*(a-129)+(s-f)),1133===u)return i=772,202;if(1135===u)return i=780,202;if(1164===u)return i=772,234;if(1166===u)return i=780,234;var h=null===u?null:l(u,p("big5"));return null===u&&t.offset(-1),null===h?c(e):h}return n(s,0,127)?s:n(s,129,254)?(r=s,null):c(e)}}function O(t){t.fatal,this.encode=function(t,r){var i=r.get();if(i===U)return j;if(r.offset(1),n(i,0,127))return t.emit(i);var o=h(i,p("big5"));if(null===o)return u(i);var s=e(o,157)+129,a=o%157,c=63>a?64:98;return t.emit(s,a+c)}}function k(t){var e=t.fatal,r=0,i=0;this.decode=function(t){var o=t.get();if(o===j)return 0===r&&0===i?U:(r=0,i=0,c(e));t.offset(1);var s,a;return 0!==i?(s=i,i=0,a=null,n(s,161,254)&&n(o,161,254)&&(a=l(94*(s-161)+o-161,p("jis0212"))),n(o,161,254)||t.offset(-1),null===a?c(e):a):142===r&&n(o,161,223)?(r=0,65377+o-161):143===r&&n(o,161,254)?(r=0,i=o,null):0!==r?(s=r,r=0,a=null,n(s,161,254)&&n(o,161,254)&&(a=l(94*(s-161)+o-161,p("jis0208"))),n(o,161,254)||t.offset(-1),null===a?c(e):a):n(o,0,127)?o:142===o||143===o||n(o,161,254)?(r=o,null):c(e)}}function S(t){t.fatal,this.encode=function(t,r){var i=r.get();if(i===U)return j;if(r.offset(1),n(i,0,127))return t.emit(i);if(165===i)return t.emit(92);if(8254===i)return t.emit(126);if(n(i,65377,65439))return t.emit(142,i-65377+161);var o=h(i,p("jis0208"));if(null===o)return u(i);var s=e(o,94)+161,a=o%94+161;return t.emit(s,a)}}function I(t){var e=t.fatal,r={ASCII:0,escape_start:1,escape_middle:2,escape_final:3,lead:4,trail:5,Katakana:6},i=r.ASCII,o=!1,s=0;this.decode=function(t){var a=t.get();switch(a!==j&&t.offset(1),i){default:case r.ASCII:return 27===a?(i=r.escape_start,null):n(a,0,127)?a:a===j?U:c(e);case r.escape_start:return 36===a||40===a?(s=a,i=r.escape_middle,null):(a!==j&&t.offset(-1),i=r.ASCII,c(e));case r.escape_middle:var u=s;return s=0,36!==u||64!==a&&66!==a?36===u&&40===a?(i=r.escape_final,null):40!==u||66!==a&&74!==a?40===u&&73===a?(i=r.Katakana,null):(a===j?t.offset(-1):t.offset(-2),i=r.ASCII,c(e)):(i=r.ASCII,null):(o=!1,i=r.lead,null);case r.escape_final:return 68===a?(o=!0,i=r.lead,null):(a===j?t.offset(-2):t.offset(-3),i=r.ASCII,c(e));case r.lead:return 10===a?(i=r.ASCII,c(e,10)):27===a?(i=r.escape_start,null):a===j?U:(s=a,i=r.trail,null);case r.trail:if(i=r.lead,a===j)return c(e);var f=null,h=94*(s-33)+a-33;return n(s,33,126)&&n(a,33,126)&&(f=o===!1?l(h,p("jis0208")):l(h,p("jis0212"))),null===f?c(e):f;case r.Katakana:return 27===a?(i=r.escape_start,null):n(a,33,95)?65377+a-33:a===j?U:c(e)}}}function T(t){t.fatal;var r={ASCII:0,lead:1,Katakana:2},i=r.ASCII;this.encode=function(t,o){var s=o.get();if(s===U)return j;if(o.offset(1),(n(s,0,127)||165===s||8254===s)&&i!==r.ASCII)return o.offset(-1),i=r.ASCII,t.emit(27,40,66);if(n(s,0,127))return t.emit(s);if(165===s)return t.emit(92);if(8254===s)return t.emit(126);if(n(s,65377,65439)&&i!==r.Katakana)return o.offset(-1),i=r.Katakana,t.emit(27,40,73);if(n(s,65377,65439))return t.emit(s-65377-33);if(i!==r.lead)return o.offset(-1),i=r.lead,t.emit(27,36,66);var a=h(s,p("jis0208"));if(null===a)return u(s);var c=e(a,94)+33,f=a%94+33;return t.emit(c,f)}}function N(t){var e=t.fatal,r=0;this.decode=function(t){var i=t.get();if(i===j&&0===r)return U;if(i===j&&0!==r)return r=0,c(e);if(t.offset(1),0!==r){var o=r;if(r=0,n(i,64,126)||n(i,128,252)){var s=127>i?64:65,a=160>o?129:193,u=l(188*(o-a)+i-s,p("jis0208"));return null===u?c(e):u}return t.offset(-1),c(e)}return n(i,0,128)?i:n(i,161,223)?65377+i-161:n(i,129,159)||n(i,224,252)?(r=i,null):c(e)}}function D(t){t.fatal,this.encode=function(t,r){var i=r.get();if(i===U)return j;if(r.offset(1),n(i,0,128))return t.emit(i);if(165===i)return t.emit(92);if(8254===i)return t.emit(126);if(n(i,65377,65439))return t.emit(i-65377+161);var o=h(i,p("jis0208"));if(null===o)return u(i);var s=e(o,188),a=31>s?129:193,c=o%188,f=63>c?64:65;return t.emit(s+a,c+f)}}function R(t){var e=t.fatal,r=0;this.decode=function(t){var i=t.get();if(i===j&&0===r)return U;if(i===j&&0!==r)return r=0,c(e);if(t.offset(1),0!==r){var o=r,s=null;if(r=0,n(o,129,198)){var a=178*(o-129);n(i,65,90)?s=a+i-65:n(i,97,122)?s=a+26+i-97:n(i,129,254)&&(s=a+26+26+i-129)}n(o,199,253)&&n(i,161,254)&&(s=12460+94*(o-199)+(i-161));var u=null===s?null:l(s,p("euc-kr"));return null===s&&t.offset(-1),null===u?c(e):u}return n(i,0,127)?i:n(i,129,253)?(r=i,null):c(e)}}function C(t){t.fatal,this.encode=function(t,r){var i=r.get();if(i===U)return j;if(r.offset(1),n(i,0,127))return t.emit(i);var o=h(i,p("euc-kr"));if(null===o)return u(i);var s,a;if(12460>o){s=e(o,178)+129,a=o%178;var c=26>a?65:52>a?71:77;return t.emit(s,a+c)}return o-=12460,s=e(o,94)+199,a=o%94+161,t.emit(s,a)}}function M(t,e){var r=e.fatal,i=null,o=null;this.decode=function(e){var s=e.get();if(s===j&&null===i&&null===o)return U;if(s===j&&(null!==i||null!==o))return c(r);if(e.offset(1),null===i)return i=s,null;var a;if(a=t?(i<<8)+s:(s<<8)+i,i=null,null!==o){var u=o;return o=null,n(a,56320,57343)?65536+1024*(u-55296)+(a-56320):(e.offset(-2),c(r))}return n(a,55296,56319)?(o=a,null):n(a,56320,57343)?c(r):a}}function B(t,r){r.fatal,this.encode=function(r,i){function o(n){var e=n>>8,i=255&n;return t?r.emit(e,i):r.emit(i,e)}var s=i.get();if(s===U)return j;if(i.offset(1),n(s,55296,57343)&&u(s),65535>=s)return o(s);var a=e(s-65536,1024)+55296,c=(s-65536)%1024+56320;return o(a),o(c)}}function L(t,n){if(!(this instanceof L))throw new TypeError("Constructor cannot be called as a function");if(t=t?t+"":W,n=Object(n),this._encoding=f(t),null===this._encoding||"utf-8"!==this._encoding.name&&"utf-16le"!==this._encoding.name&&"utf-16be"!==this._encoding.name)throw new TypeError("Unknown encoding: "+t);return this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(n.fatal)},Object.defineProperty?Object.defineProperty(this,"encoding",{get:function(){return this._encoding.name}}):this.encoding=this._encoding.name,this}function F(t,n){if(!(this instanceof F))throw new TypeError("Constructor cannot be called as a function");if(t=t?t+"":W,n=Object(n),this._encoding=f(t),null===this._encoding)throw new TypeError("Unknown encoding: "+t);return this._streaming=!1,this._decoder=null,this._options={fatal:Boolean(n.fatal)},Object.defineProperty?Object.defineProperty(this,"encoding",{get:function(){return this._encoding.name}}):this.encoding=this._encoding.name,this}var j=-1,U=-1;a.prototype=Error.prototype;var P=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"utf-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"ibm866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"iso-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"iso-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"iso-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"iso-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"iso-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"iso-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"iso-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"iso-8859-8-i"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"iso-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"iso-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"iso-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"iso-8859-15"},{labels:["iso-8859-16"],name:"iso-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"koi8-r"},{labels:["koi8-u"],name:"koi8-u"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"gbk"},{labels:["gb18030"],name:"gb18030"},{labels:["hz-gb-2312"],name:"hz-gb-2312"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"euc-jp"},{labels:["csiso2022jp","iso-2022-jp"],name:"iso-2022-jp"},{labels:["csshiftjis","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"shift_jis"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"euc-kr"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","iso-2022-kr","iso-2022-cn","iso-2022-cn-ext"],name:"replacement"},{labels:["utf-16be"],name:"utf-16be"},{labels:["utf-16","utf-16le"],name:"utf-16le"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],z={},V={};P.forEach(function(t){t.encodings.forEach(function(t){z[t.name]=t,t.labels.forEach(function(n){V[n]=t})})}),z["utf-8"].getEncoder=function(t){return new m(t)},z["utf-8"].getDecoder=function(t){return new v(t)},function(){P.forEach(function(t){"Legacy single-byte encodings"===t.heading&&t.encodings.forEach(function(t){var n=p(t.name);t.getDecoder=function(t){return new y(n,t)},t.getEncoder=function(t){return new E(n,t)}})})}(),z.gbk.getEncoder=function(t){return new b(!1,t)},z.gbk.getDecoder=function(t){return new w(!1,t)},z.gb18030.getEncoder=function(t){return new b(!0,t)},z.gb18030.getDecoder=function(t){return new w(!0,t)},z["hz-gb-2312"].getEncoder=function(t){return new A(t)},z["hz-gb-2312"].getDecoder=function(t){return new _(t)},z.big5.getEncoder=function(t){return new O(t)},z.big5.getDecoder=function(t){return new x(t)},z["euc-jp"].getEncoder=function(t){return new S(t)},z["euc-jp"].getDecoder=function(t){return new k(t)},z["iso-2022-jp"].getEncoder=function(t){return new T(t)},z["iso-2022-jp"].getDecoder=function(t){return new I(t)},z.shift_jis.getEncoder=function(t){return new D(t)},z.shift_jis.getDecoder=function(t){return new N(t)},z["euc-kr"].getEncoder=function(t){return new C(t)},z["euc-kr"].getDecoder=function(t){return new R(t)},z["utf-16le"].getEncoder=function(t){return new B(!1,t)},z["utf-16le"].getDecoder=function(t){return new M(!1,t)},z["utf-16be"].getEncoder=function(t){return new B(!0,t)},z["utf-16be"].getDecoder=function(t){return new M(!0,t)};var W="utf-8";L.prototype={encode:function(t,n){t=t?t+"":"",n=Object(n),this._streaming||(this._encoder=this._encoding.getEncoder(this._options)),this._streaming=Boolean(n.stream);for(var e=[],r=new i(e),s=new o(t);s.get()!==U;)this._encoder.encode(r,s);if(!this._streaming){var a;do a=this._encoder.encode(r,s);while(a!==j);this._encoder=null}return new Uint8Array(e)}},F.prototype={decode:function(t,n){if(t&&!("buffer"in t&&"byteOffset"in t&&"byteLength"in t))throw new TypeError("Expected ArrayBufferView");t||(t=new Uint8Array(0)),n=Object(n),this._streaming||(this._decoder=this._encoding.getDecoder(this._options),this._BOMseen=!1),this._streaming=Boolean(n.stream);for(var e,i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=new r(i),a=new s;o.get()!==j;)e=this._decoder.decode(o),null!==e&&e!==U&&a.emit(e);if(!this._streaming){do e=this._decoder.decode(o),null!==e&&e!==U&&a.emit(e);while(e!==U&&o.get()!=j);this._decoder=null}var c=a.string();return!this._BOMseen&&c.length&&(this._BOMseen=!0,-1!==["utf-8","utf-16le","utf-16be"].indexOf(this.encoding)&&65279===c.charCodeAt(0)&&(c=c.substring(1))),c}},t.TextEncoder=t.TextEncoder||L,t.TextDecoder=t.TextDecoder||F}(this),e("encoding",["encoding-indexes-shim"],function(){}),e("src/adapters/crypto",["require","crypto-js/rollups/aes","encoding"],function(t){function n(t){for(var n=t.length,e=[],r=0;n>r;r++)e[r>>>2]|=(255&t[r])<<24-8*(r%4);return a.create(e,n)}function e(t){return new TextEncoder("utf-8").encode(t)}function i(t){return new TextDecoder("utf-8").decode(t)}function o(t,n,e){this.context=t,this.encrypt=n,this.decrypt=e}function s(t,o){this.provider=o;var s=r.AES;this.encrypt=function(r){var i=n(r),o=s.encrypt(i,t),a=e(o);return a},this.decrypt=function(n){var o=i(n),a=s.decrypt(o,t),c=a.toString(r.enc.Utf8),u=e(c);return u}}t("crypto-js/rollups/aes");var a=r.lib.WordArray;return t("encoding"),o.prototype.clear=function(t){this.context.clear(t)},o.prototype.get=function(t,n){var e=this.decrypt;this.context.get(t,function(t,r){return t?(n(t),void 0):(r&&(r=e(r)),n(null,r),void 0)})},o.prototype.put=function(t,n,e){var r=this.encrypt(n);this.context.put(t,r,e)},o.prototype.delete=function(t,n){this.context.delete(t,n)},s.isSupported=function(){return!0},s.prototype.open=function(t){this.provider.open(t)},s.prototype.getReadOnlyContext=function(){return new o(this.provider.getReadOnlyContext(),this.encrypt,this.decrypt)},s.prototype.getReadWriteContext=function(){return new o(this.provider.getReadWriteContext(),this.encrypt,this.decrypt)},s}),e("src/adapters/adapters",["require","src/adapters/zlib","src/adapters/crypto"],function(t){return{Compression:t("src/adapters/zlib"),Encryption:t("src/adapters/crypto")}}),e("src/shell/environment",["require","src/constants"],function(t){function n(t){t=t||{},t.TMP=t.TMP||e.TMP,t.PATH=t.PATH||e.PATH,this.get=function(n){return t[n]},this.set=function(n,e){t[n]=e}}var e=t("src/constants").ENVIRONMENT;return n}),e("src/shell/shell",["require","src/path","src/errors","src/shell/environment","async"],function(t){function n(t,n){n=n||{};var o=new i(n.env),s="/";Object.defineProperty(this,"fs",{get:function(){return t},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return o},enumerable:!0}),this.cd=function(n,i){n=e.resolve(this.cwd,n),t.stat(n,function(t,e){return t?(i(new r.ENOTDIR),void 0):("DIRECTORY"===e.type?(s=n,i()):i(new r.ENOTDIR),void 0)})},this.pwd=function(){return s}}var e=t("src/path"),r=t("src/errors"),i=t("src/shell/environment"),o=t("async");return n.prototype.exec=function(t,n,r){var i=this.fs;"function"==typeof n&&(r=n,n=[]),n=n||[],r=r||function(){},t=e.resolve(this.cwd,t),i.readFile(t,"utf8",function(t,e){if(t)return r(t),void 0;try{var o=Function("fs","args","callback",e);o(i,n,r)}catch(s){r(s)}})},n.prototype.touch=function(t,n,r){function i(t){s.writeFile(t,"",r)}function o(t){var e=Date.now(),i=n.date||e,o=n.date||e;s.utimes(t,i,o,r)}var s=this.fs;"function"==typeof n&&(r=n,n={}),n=n||{},r=r||function(){},t=e.resolve(this.cwd,t),s.stat(t,function(e){e?n.updateOnly===!0?r():i(t):o(t)})},n.prototype.cat=function(t,n){function i(t,n){var r=e.resolve(this.cwd,t);s.readFile(r,"utf8",function(t,e){return t?(n(t),void 0):(a+=e+"\n",n(),void 0)})}var s=this.fs,a="";return n=n||function(){},t?(t="string"==typeof t?[t]:t,o.eachSeries(t,i,function(t){t?n(t):n(null,a.replace(/\n$/,""))}),void 0):(n(new r.EINVAL("Missing files argument")),void 0)},n.prototype.ls=function(t,n,i){function s(t,r){var i=e.resolve(this.cwd,t),c=[];a.readdir(i,function(t,u){function f(t,r){t=e.join(i,t),a.stat(t,function(o,a){if(o)return r(o),void 0;var u={path:e.basename(t),links:a.nlinks,size:a.size,modified:a.mtime,type:a.type};n.recursive&&"DIRECTORY"===a.type?s(e.join(i,u.path),function(t,n){return t?(r(t),void 0):(u.contents=n,c.push(u),r(),void 0)}):(c.push(u),r())})}return t?(r(t),void 0):(o.each(u,f,function(t){r(t,c)}),void 0)})}var a=this.fs;return"function"==typeof n&&(i=n,n={}),n=n||{},i=i||function(){},t?(s(t,i),void 0):(i(new r.EINVAL("Missing dir argument")),void 0)},n.prototype.rm=function(t,n,i){function s(t,i){t=e.resolve(this.cwd,t),a.stat(t,function(c,u){return c?(i(c),void 0):"FILE"===u.type?(a.unlink(t,i),void 0):(a.readdir(t,function(c,u){return c?(i(c),void 0):0===u.length?(a.rmdir(t,i),void 0):n.recursive?(u=u.map(function(n){return e.join(t,n)}),o.each(u,s,function(n){return n?(i(n),void 0):(a.rmdir(t,i),void 0)}),void 0):(i(new r.ENOTEMPTY),void 0)}),void 0)})}var a=this.fs;return"function"==typeof n&&(i=n,n={}),n=n||{},i=i||function(){},t?(s(t,i),void 0):(i(new r.EINVAL("Missing path argument")),void 0)},n.prototype.tempDir=function(t){var n=this.fs,e=this.env.get("TMP");t=t||function(){},n.mkdir(e,function(){t(null,e)})},n.prototype.mkdirp=function(t,n){function i(t,n){o.stat(t,function(s,a){if(a){if(a.isDirectory())return n(),void 0;if(a.isFile())return n(new r.ENOTDIR),void 0}else{if(s&&"ENOENT"!==s.code)return n(s),void 0;var c=e.dirname(t);"/"===c?o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(n(t),void 0):(n(),void 0)}):i(c,function(e){return e?n(e):(o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(n(t),void 0):(n(),void 0)}),void 0)})}})}var o=this.fs;return n=n||function(){},t?"/"===t?(n(),void 0):(i(t,n),void 0):(n(new r.EINVAL("Missing path argument")),void 0)},n}),e("eventemitter",["require"],function(){function t(t,n){for(var e=n.length-1;e>=0;e--)n[e]===t&&n.splice(e,1);return n}var n=function(){};n.createInterface=function(n){var e={};return e.on=function(t,e){this[n]===void 0&&(this[n]={}),this[n].hasOwnProperty(t)||(this[n][t]=[]),this[n][t].push(e)},e.off=function(e,r){void 0!==this[n]&&this[n].hasOwnProperty(e)&&t(r,this[n][e])},e.trigger=function(t){if(this[n]!==void 0&&this[n].hasOwnProperty(t))for(var e=Array.prototype.slice.call(arguments,1),r=0;this[n][t].length>r;r++)this[n][t][r].apply(this[n][t][r],e)},e.removeAllListeners=function(t){if(void 0!==this[n]){var e=this;e[n][t].forEach(function(n){e.off(t,n)})}},e};var e=n.createInterface("_handlers");n.prototype._on=e.on,n.prototype._off=e.off,n.prototype._trigger=e.trigger;var r=n.createInterface("handlers");return n.prototype.on=function(){r.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},n.prototype.off=r.off,n.prototype.trigger=r.trigger,n.prototype.removeAllListeners=r.removeAllListeners,n}),e("intercom",["require","eventemitter","src/shared"],function(t){function n(t,n){var e=0;return function(){var r=Date.now();r-e>t&&(e=r,n.apply(this,arguments))}}function e(t,n){if(void 0!==t&&t||(t={}),"object"==typeof n)for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e]);return t}function r(){var t=this,n=Date.now();this.origin=o(),this.lastMessage=n,this.receivedIDs={},this.previousValues={};var e=function(){t._onStorageEvent.apply(t,arguments)};document.attachEvent?document.attachEvent("onstorage",e):window.addEventListener("storage",e,!1)}var i=t("eventemitter"),o=t("src/shared").guid,s=function(t){return t.localStorage===void 0?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(this);r.prototype._transaction=function(t){function n(){if(!a){var l=Date.now(),h=0|s.getItem(u);if(h&&r>l-h)return c||(o._on("storage",n),c=!0),f=window.setTimeout(n,i),void 0;a=!0,s.setItem(u,l),t(),e()}}function e(){c&&o._off("storage",n),f&&window.clearTimeout(f),s.removeItem(u)}var r=1e3,i=20,o=this,a=!1,c=!1,f=null;n()},r.prototype._cleanup_emit=n(100,function(){var t=this;t._transaction(function(){var t,n=Date.now(),e=n-f,r=0;try{t=JSON.parse(s.getItem(a)||"[]")}catch(i){t=[]}for(var o=t.length-1;o>=0;o--)e>t[o].timestamp&&(t.splice(o,1),r++);r>0&&s.setItem(a,JSON.stringify(t))})}),r.prototype._cleanup_once=n(100,function(){var t=this;t._transaction(function(){var n,e;Date.now();var r=0;try{e=JSON.parse(s.getItem(c)||"{}")}catch(i){e={}}for(n in e)t._once_expired(n,e)&&(delete e[n],r++);r>0&&s.setItem(c,JSON.stringify(e))})}),r.prototype._once_expired=function(t,n){if(!n)return!0;if(!n.hasOwnProperty(t))return!0;if("object"!=typeof n[t])return!0;var e=n[t].ttl||l,r=Date.now(),i=n[t].timestamp;return r-e>i},r.prototype._localStorageChanged=function(t,n){if(t&&t.key)return t.key===n;var e=s.getItem(n);return e===this.previousValues[n]?!1:(this.previousValues[n]=e,!0)},r.prototype._onStorageEvent=function(t){t=t||window.event;var n=this;this._localStorageChanged(t,a)&&this._transaction(function(){var t,e=Date.now(),r=s.getItem(a);try{t=JSON.parse(r||"[]")}catch(i){t=[]}for(var o=0;t.length>o;o++)if(t[o].origin!==n.origin&&!(t[o].timestamp<n.lastMessage)){if(t[o].id){if(n.receivedIDs.hasOwnProperty(t[o].id))continue;n.receivedIDs[t[o].id]=!0}n.trigger(t[o].name,t[o].payload)}n.lastMessage=e}),this._trigger("storage",t)},r.prototype._emit=function(t,n,e){if(e="string"==typeof e||"number"==typeof e?e+"":null,e&&e.length){if(this.receivedIDs.hasOwnProperty(e))return;this.receivedIDs[e]=!0}var r={id:e,name:t,origin:this.origin,timestamp:Date.now(),payload:n},i=this;this._transaction(function(){var e=s.getItem(a)||"[]",o="[]"===e?"":",";e=[e.substring(0,e.length-1),o,JSON.stringify(r),"]"].join(""),s.setItem(a,e),i.trigger(t,n),window.setTimeout(function(){i._cleanup_emit()},50)})},r.prototype.emit=function(t,n){this._emit.apply(this,arguments),this._trigger("emit",t,n)},r.prototype.once=function(t,n,e){if(r.supported){var i=this;this._transaction(function(){var r;try{r=JSON.parse(s.getItem(c)||"{}")}catch(o){r={}}i._once_expired(t,r)&&(r[t]={},r[t].timestamp=Date.now(),"number"==typeof e&&(r[t].ttl=1e3*e),s.setItem(c,JSON.stringify(r)),n(),window.setTimeout(function(){i._cleanup_once()},50))})}},e(r.prototype,i.prototype),r.supported=s!==void 0;var a="intercom",c="intercom_once",u="intercom_lock",f=5e4,l=36e5;return r.destroy=function(){s.removeItem(u),s.removeItem(a),s.removeItem(c)},r.getInstance=function(){var t;return function(){return t||(t=new r),t}}(),r}),e("src/fs-watcher",["require","eventemitter","src/path","intercom"],function(t){function n(){function t(t){(n===t||s&&0===t.indexOf(n+"/"))&&o.trigger("change","change",t)}e.call(this);var n,o=this,s=!1;o.start=function(e,o,a){if(!n){if(r(e))throw Error("Path must be a string without null bytes.");n=e,s=a===!0;var c=i.getInstance();c.on("change",t)}},o.close=function(){var n=i.getInstance();n.off("change",t),o.removeAllListeners("change")}}var e=t("eventemitter"),r=t("src/path").isNull,i=t("intercom");return n.prototype=new e,n.prototype.constructor=n,n}),e("src/directory-entry",["src/constants"],function(t){return function(n,e){this.id=n,this.type=e||t.MODE_FILE}}),e("src/open-file-description",["require"],function(){return function(t,n,e,r){this.path=t,this.id=n,this.flags=e,this.position=r}}),e("src/super-node",["src/constants","src/shared"],function(t,n){return function(e,r,i){var o=Date.now();this.id=t.SUPER_NODE_ID,this.mode=t.MODE_META,this.atime=e||o,this.ctime=r||o,this.mtime=i||o,this.rnode=n.guid()}}),e("src/node",["src/constants","src/shared"],function(t,n){return function(e,r,i,o,s,a,c,u,f,l){var h=Date.now();this.id=e||n.guid(),this.mode=r||t.MODE_FILE,this.size=i||0,this.atime=o||h,this.ctime=s||h,this.mtime=a||h,this.flags=c||[],this.xattrs=u||{},this.nlinks=f||0,this.version=l||0,this.blksize=void 0,this.nblocks=1,this.data=n.guid()}}),e("src/stats",["src/constants"],function(t){function n(t,n){this.node=t.id,this.dev=n,this.size=t.size,this.nlinks=t.nlinks,this.atime=t.atime,this.mtime=t.mtime,this.ctime=t.ctime,this.type=t.mode}return n.prototype.isFile=function(){return this.type===t.MODE_FILE},n.prototype.isDirectory=function(){return this.type===t.MODE_DIRECTORY},n.prototype.isSymbolicLink=function(){return this.type===t.MODE_SYMBOLIC_LINK},n.prototype.isSocket=n.prototype.isFIFO=n.prototype.isCharacterDevice=n.prototype.isBlockDevice=function(){return!1},n}),e("src/filesystem/implementation",["require","encoding","nodash","src/path","src/path","src/path","src/path","src/path","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/constants","src/errors","src/directory-entry","src/open-file-description","src/super-node","src/node","src/stats"],function(t){function n(t){return function(n,e){n?t(n):t(null,e)}}function e(t,n,e,r,i){function o(e){t.changes.push({event:"change",path:n}),i(e)}var s=t.flags;fn(s).contains(Rn)&&delete r.ctime,fn(s).contains(Dn)&&delete r.mtime;var a=!1;r.ctime&&(e.ctime=r.ctime,e.atime=r.ctime,a=!0),r.atime&&(e.atime=r.atime,a=!0),r.mtime&&(e.mtime=r.mtime,a=!0),a?t.put(e.id,e,o):o()}function r(t,n,e){function i(n,r){n?e(n):r&&r.mode===En&&r.rnode?t.get(r.rnode,o):e(new Cn.EFILESYSTEMERROR)}function o(t,n){t?e(t):n?e(null,n):e(new Cn.ENOENT)}function s(n,r){n?e(n):r.mode===mn&&r.data?t.get(r.data,a):e(new Cn.ENOTDIR("a component of the path prefix is not a directory"))}function a(n,r){if(n)e(n);else if(fn(r).has(f)){var i=r[f].id;t.get(i,c)}else e(new Cn.ENOENT)}function c(t,n){t?e(t):n.mode==yn?(h++,h>_n?e(new Cn.ELOOP):u(n.data)):e(null,n)}function u(n){n=ln(n),l=hn(n),f=pn(n),wn==f?t.get(bn,i):r(t,l,s)}if(n=ln(n),!n)return e(new Cn.ENOENT("path is an empty string"));var f=pn(n),l=hn(n),h=0;wn==f?t.get(bn,i):r(t,l,s)}function i(t,n,i,o,s,a){function c(n,r){function c(n){n?a(n):e(t,u,r,{ctime:Date.now()},a)}r?r.xattrs[i]:null,n?a(n):s===Tn&&r.xattrs.hasOwnProperty(i)?a(new Cn.EEXIST("attribute already exists")):s!==Nn||r.xattrs.hasOwnProperty(i)?(r.xattrs[i]=o,t.put(r.id,r,c)):a(new Cn.ENOATTR)}var u;"string"==typeof n?(u=n,r(t,n,c)):"object"==typeof n&&"string"==typeof n.id?(u=n.path,t.get(n.id,c)):a(new Cn.EINVAL("path or file descriptor of wrong type"))}function o(t,n){function e(e,i){!e&&i?n(new Cn.EEXIST):!e||e instanceof Cn.ENOENT?(o=new Ln,t.put(o.id,o,r)):n(e)}function r(e){e?n(e):(s=new Fn(o.rnode,mn),s.nlinks+=1,t.put(s.id,s,i))}function i(e){e?n(e):(a={},t.put(s.data,a,n))}var o,s,a;t.get(bn,e)}function s(t,n,i){function o(n,e){!n&&e?i(new Cn.EEXIST):!n||n instanceof Cn.ENOENT?r(t,v,s):i(n)}function s(n,e){n?i(n):(p=e,t.get(p.data,a))}function a(n,e){n?i(n):(d=e,l=new Fn(void 0,mn),l.nlinks+=1,t.put(l.id,l,c))}function c(n){n?i(n):(h={},t.put(l.data,h,f))}function u(n){if(n)i(n);else{var r=Date.now();e(t,v,p,{mtime:r,ctime:r},i)}}function f(n){n?i(n):(d[g]=new Mn(l.id,mn),t.put(p.data,d,u))}n=ln(n);var l,h,p,d,g=pn(n),v=hn(n);r(t,n,o)}function a(t,n,i){function o(n,e){n?i(n):(g=e,t.get(g.data,s))}function s(n,e){n?i(n):wn==m?i(new Cn.EBUSY):fn(e).has(m)?(v=e,p=v[m].id,t.get(p,a)):i(new Cn.ENOENT)}function a(n,e){n?i(n):e.mode!=mn?i(new Cn.ENOTDIR):(p=e,t.get(p.data,c))}function c(t,n){t?i(t):(d=n,fn(d).size()>0?i(new Cn.ENOTEMPTY):f())}function u(n){if(n)i(n);else{var r=Date.now();e(t,y,g,{mtime:r,ctime:r},l)}}function f(){delete v[m],t.put(g.data,v,u)}function l(n){n?i(n):t.delete(p.id,h)}function h(n){n?i(n):t.delete(p.data,i)}n=ln(n);var p,d,g,v,m=pn(n),y=hn(n);r(t,y,o)}function c(t,n,i,o){function s(n,e){n?o(n):(v=e,t.get(v.data,a))}function a(n,e){n?o(n):(m=e,fn(m).has(b)?fn(i).contains(kn)?o(new Cn.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists")):(y=m[b],y.type==mn&&fn(i).contains(xn)?o(new Cn.EISDIR("the named file is a directory and O_WRITE is set")):t.get(y.id,c)):fn(i).contains(On)?l():o(new Cn.ENOENT("O_CREATE is not set and the named file does not exist")))}function c(t,n){if(t)o(t);else{var e=n;e.mode==yn?(A++,A>_n?o(new Cn.ELOOP):u(e.data)):f(void 0,e)}}function u(e){e=ln(e),_=hn(e),b=pn(e),wn==b&&(fn(i).contains(xn)?o(new Cn.EISDIR("the named file is a directory and O_WRITE is set")):r(t,n,f)),r(t,_,s)}function f(t,n){t?o(t):(E=n,o(null,E))}function l(){E=new Fn(void 0,vn),E.nlinks+=1,t.put(E.id,E,h)}function h(n){n?o(n):(w=new Uint8Array(0),t.put(E.data,w,d))}function p(n){if(n)o(n);else{var r=Date.now();e(t,_,v,{mtime:r,ctime:r},g)}}function d(n){n?o(n):(m[b]=new Mn(E.id,vn),t.put(v.data,m,p))}function g(t){t?o(t):o(null,E)}n=ln(n);var v,m,y,E,w,b=pn(n),_=hn(n),A=0;wn==b?fn(i).contains(xn)?o(new Cn.EISDIR("the named file is a directory and O_WRITE is set")):r(t,n,f):r(t,_,s)}function u(t,n,r,i,o,s){function a(t){t?s(t):s(null,o)}function c(r){if(r)s(r);else{var i=Date.now();e(t,n.path,l,{mtime:i,ctime:i},a)}}function u(n){n?s(n):t.put(l.id,l,c)}function f(e,a){if(e)s(e);else{l=a;var c=new Uint8Array(o),f=r.subarray(i,i+o);c.set(f),n.position=o,l.size=o,l.version+=1,t.put(l.data,c,u)}}var l;t.get(n.id,f)}function f(t,n,r,i,o,s,a){function c(t){t?a(t):a(null,o)}function u(r){if(r)a(r);else{var i=Date.now();e(t,n.path,p,{mtime:i,ctime:i},c)}}function f(n){n?a(n):t.put(p.id,p,u)}function l(e,c){if(e)a(e);else{d=c;var u=void 0!==s&&null!==s?s:n.position,l=Math.max(d.length,u+o),h=new Uint8Array(l);d&&h.set(d);var g=r.subarray(i,i+o);h.set(g,u),void 0===s&&(n.position+=o),p.size=l,p.version+=1,t.put(p.data,h,f)}}function h(n,e){n?a(n):(p=e,t.get(p.data,l))}var p,d;t.get(n.id,h)}function l(t,n,e,r,i,o,s){function a(t,a){if(t)s(t);else{f=a;var c=void 0!==o&&null!==o?o:n.position;i=c+i>e.length?i-c:i;var u=f.subarray(c,c+i);e.set(u,r),void 0===o&&(n.position+=i),s(null,i)}}function c(n,e){n?s(n):(u=e,t.get(u.data,a))}var u,f;t.get(n.id,c)}function h(t,e,i){e=ln(e),pn(e),r(t,e,n(i))}function p(t,e,r){t.get(e.id,n(r))}function d(t,e,i){function o(n,e){n?i(n):(a=e,t.get(a.data,s))}function s(e,r){e?i(e):(c=r,fn(c).has(u)?t.get(c[u].id,n(i)):i(new Cn.ENOENT("a component of the path does not name an existing file")))}e=ln(e);var a,c,u=pn(e),f=hn(e);wn==u?r(t,e,n(i)):r(t,f,o)}function g(t,n,i,o){function s(n){n?o(n):e(t,i,E,{ctime:Date.now()},o)
|
|
}function a(n,e){n?o(n):(E=e,E.nlinks+=1,t.put(E.id,E,s))}function c(n){n?o(n):t.get(y[w].id,a)}function u(n,e){n?o(n):(y=e,fn(y).has(w)?o(new Cn.EEXIST("newpath resolves to an existing file")):(y[w]=v[p],t.put(m.data,y,c)))}function f(n,e){n?o(n):(m=e,t.get(m.data,u))}function l(n,e){n?o(n):(v=e,fn(v).has(p)?r(t,b,f):o(new Cn.ENOENT("a component of either path prefix does not exist")))}function h(n,e){n?o(n):(g=e,t.get(g.data,l))}n=ln(n);var p=pn(n),d=hn(n);i=ln(i);var g,v,m,y,E,w=pn(i),b=hn(i);r(t,d,h)}function v(t,n,i){function o(n){n?i(n):(delete l[p],t.put(f.data,l,function(){var n=Date.now();e(t,d,f,{mtime:n,ctime:n},i)}))}function s(n){n?i(n):t.delete(h.data,o)}function a(r,a){r?i(r):(h=a,h.nlinks-=1,1>h.nlinks?t.delete(h.id,s):t.put(h.id,h,function(){e(t,n,h,{ctime:Date.now()},o)}))}function c(n,e){n?i(n):(l=e,fn(l).has(p)?t.get(l[p].id,a):i(new Cn.ENOENT("a component of the path does not name an existing file")))}function u(n,e){n?i(n):(f=e,t.get(f.data,c))}n=ln(n);var f,l,h,p=pn(n),d=hn(n);r(t,d,u)}function m(t,n,e){function i(t,n){if(t)e(t);else{a=n;var r=Object.keys(a);e(null,r)}}function o(n,r){n?e(n):(s=r,t.get(s.data,i))}n=ln(n),pn(n);var s,a;r(t,n,o)}function y(t,n,i,o){function s(n,e){n?o(n):(l=e,t.get(l.data,a))}function a(t,n){t?o(t):(h=n,fn(h).has(d)?o(new Cn.EEXIST):c())}function c(){p=new Fn(void 0,yn),p.nlinks+=1,p.size=n.length,p.data=n,t.put(p.id,p,f)}function u(n){if(n)o(n);else{var r=Date.now();e(t,g,l,{mtime:r,ctime:r},o)}}function f(n){n?o(n):(h[d]=new Mn(p.id,yn),t.put(l.data,h,u))}i=ln(i);var l,h,p,d=pn(i),g=hn(i);wn==d?o(new Cn.EEXIST):r(t,g,s)}function E(t,n,e){function i(n,r){n?e(n):(a=r,t.get(a.data,o))}function o(n,r){n?e(n):(c=r,fn(c).has(u)?t.get(c[u].id,s):e(new Cn.ENOENT("a component of the path does not name an existing file")))}function s(t,n){t?e(t):n.mode!=yn?e(new Cn.EINVAL("path not a symbolic link")):e(null,n.data)}n=ln(n);var a,c,u=pn(n),f=hn(n);r(t,f,i)}function w(t,n,i,o){function s(n,e){n?o(n):e.mode==mn?o(new Cn.EISDIR):(f=e,t.get(f.data,a))}function a(n,e){if(n)o(n);else{var r=new Uint8Array(i);e&&r.set(e.subarray(0,i)),t.put(f.data,r,u)}}function c(r){if(r)o(r);else{var i=Date.now();e(t,n,f,{mtime:i,ctime:i},o)}}function u(n){n?o(n):(f.size=i,f.version+=1,t.put(f.id,f,c))}n=ln(n);var f;0>i?o(new Cn.EINVAL("length cannot be negative")):r(t,n,s)}function b(t,n,r,i){function o(n,e){n?i(n):e.mode==mn?i(new Cn.EISDIR):(u=e,t.get(u.data,s))}function s(n,e){if(n)i(n);else{var o=new Uint8Array(r);e&&o.set(e.subarray(0,r)),t.put(u.data,o,c)}}function a(r){if(r)i(r);else{var o=Date.now();e(t,n.path,u,{mtime:o,ctime:o},i)}}function c(n){n?i(n):(u.size=r,u.version+=1,t.put(u.id,u,a))}var u;0>r?i(new Cn.EINVAL("length cannot be negative")):t.get(n.id,o)}function _(t,n,i,o,s){function a(r,a){r?s(r):e(t,n,a,{atime:i,ctime:o,mtime:o},s)}n=ln(n),"number"!=typeof i||"number"!=typeof o?s(new Cn.EINVAL("atime and mtime must be number")):0>i||0>o?s(new Cn.EINVAL("atime and mtime must be positive integers")):r(t,n,a)}function A(t,n,r,i,o){function s(s,a){s?o(s):e(t,n.path,a,{atime:r,ctime:i,mtime:i},o)}"number"!=typeof r||"number"!=typeof i?o(new Cn.EINVAL("atime and mtime must be a number")):0>r||0>i?o(new Cn.EINVAL("atime and mtime must be positive integers")):t.get(n.id,s)}function x(t,n,e,r,o,s){n=ln(n),"string"!=typeof e?s(new Cn.EINVAL("attribute name must be a string")):e?null!==o&&o!==Tn&&o!==Nn?s(new Cn.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):i(t,n,e,r,o,s):s(new Cn.EINVAL("attribute name cannot be an empty string"))}function O(t,n,e,r,o,s){"string"!=typeof e?s(new Cn.EINVAL("attribute name must be a string")):e?null!==o&&o!==Tn&&o!==Nn?s(new Cn.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):i(t,n,e,r,o,s):s(new Cn.EINVAL("attribute name cannot be an empty string"))}function k(t,n,e,i){function o(t,n){n?n.xattrs[e]:null,t?i(t):n.xattrs.hasOwnProperty(e)?i(null,n.xattrs[e]):i(new Cn.ENOATTR)}n=ln(n),"string"!=typeof e?i(new Cn.EINVAL("attribute name must be a string")):e?r(t,n,o):i(new Cn.EINVAL("attribute name cannot be an empty string"))}function S(t,n,e,r){function i(t,n){n?n.xattrs[e]:null,t?r(t):n.xattrs.hasOwnProperty(e)?r(null,n.xattrs[e]):r(new Cn.ENOATTR)}"string"!=typeof e?r(new Cn.EINVAL):e?t.get(n.id,i):r(new Cn.EINVAL("attribute name cannot be an empty string"))}function I(t,n,i,o){function s(r,s){function a(r){r?o(r):e(t,n,s,{ctime:Date.now()},o)}var c=s?s.xattrs:null;r?o(r):c.hasOwnProperty(i)?(delete s.xattrs[i],t.put(s.id,s,a)):o(new Cn.ENOATTR)}n=ln(n),"string"!=typeof i?o(new Cn.EINVAL("attribute name must be a string")):i?r(t,n,s):o(new Cn.EINVAL("attribute name cannot be an empty string"))}function T(t,n,r,i){function o(o,s){function a(r){r?i(r):e(t,n.path,s,{ctime:Date.now()},i)}o?i(o):s.xattrs.hasOwnProperty(r)?(delete s.xattrs[r],t.put(s.id,s,a)):i(new Cn.ENOATTR)}"string"!=typeof r?i(new Cn.EINVAL("attribute name must be a string")):r?t.get(n.id,o):i(new Cn.EINVAL("attribute name cannot be an empty string"))}function N(t){return fn(In).has(t)?In[t]:null}function D(t,n,e){return t?"function"==typeof t?t={encoding:n,flag:e}:"string"==typeof t&&(t={encoding:t,flag:e}):t={encoding:n,flag:e},t}function R(t,n){var e;return gn(t)?e=Error("Path must be a string without null bytes."):dn(t)||(e=Error("Path must be absolute.")),e?(n(e),!1):!0}function C(t,n,e,r,i,o){function s(n,i){if(n)o(n);else{var s;s=fn(r).contains(Sn)?i.size:0;var a=new Bn(e,i.id,r,s),c=t.allocDescriptor(a);o(null,c)}}o=arguments[arguments.length-1],R(e,o)&&(r=N(r),r||o(new Cn.EINVAL("flags is not valid")),c(n,e,r,s))}function M(t,n,e,r){fn(t.openFiles).has(e)?(t.releaseDescriptor(e),r(null)):r(new Cn.EBADF)}function B(t,e,r,i,o){o=arguments[arguments.length-1],R(r,o)&&s(e,r,n(o))}function L(t,e,r,i){R(r,i)&&a(e,r,n(i))}function F(t,n,e,r){function i(n,e){if(n)r(n);else{var i=new jn(e,t.name);r(null,i)}}R(e,r)&&h(n,e,i)}function j(t,n,e,r){function i(n,e){if(n)r(n);else{var i=new jn(e,t.name);r(null,i)}}var o=t.openFiles[e];o?p(n,o,i):r(new Cn.EBADF)}function U(t,e,r,i,o){R(r,o)&&R(i,o)&&g(e,r,i,n(o))}function P(t,e,r,i){R(r,i)&&v(e,r,n(i))}function z(t,e,r,i,o,s,a,c){function u(t,n){c(t,n||0,i)}o=void 0===o?0:o,s=void 0===s?i.length-o:s,c=arguments[arguments.length-1];var f=t.openFiles[r];f?fn(f.flags).contains(An)?l(e,f,i,o,s,a,n(u)):c(new Cn.EBADF("descriptor does not permit reading")):c(new Cn.EBADF)}function V(t,n,e,r,i){if(i=arguments[arguments.length-1],r=D(r,null,"r"),R(e,i)){var o=N(r.flag||"r");o||i(new Cn.EINVAL("flags is not valid")),c(n,e,o,function(s,a){if(s)return i(s);var c=new Bn(e,a.id,o,0),u=t.allocDescriptor(c);p(n,c,function(e,o){if(e)return i(e);var s=new jn(o,t.name),a=s.size,f=new Uint8Array(a);l(n,c,f,0,a,0,function(n){if(n)return i(n);t.releaseDescriptor(u);var e;e="utf8"===r.encoding?new TextDecoder("utf-8").decode(f):f,i(null,e)})})})}}function W(t,e,r,i,o,s,a,c){c=arguments[arguments.length-1],o=void 0===o?0:o,s=void 0===s?i.length-o:s;var u=t.openFiles[r];u?fn(u.flags).contains(xn)?s>i.length-o?c(new Cn.EIO("intput buffer is too small")):f(e,u,i,o,s,a,n(c)):c(new Cn.EBADF("descriptor does not permit writing")):c(new Cn.EBADF)}function q(t,n,e,r,i,o){if(o=arguments[arguments.length-1],i=D(i,"utf8","w"),R(e,o)){var s=N(i.flag||"w");s||o(new Cn.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=new TextEncoder("utf-8").encode(r)),c(n,e,s,function(i,a){if(i)return o(i);var c=new Bn(e,a.id,s,0),f=t.allocDescriptor(c);u(n,c,r,0,r.length,function(n){return n?o(n):(t.releaseDescriptor(f),o(null),void 0)})})}}function H(t,n,e,r,i,o){if(o=arguments[arguments.length-1],i=D(i,"utf8","a"),R(e,o)){var s=N(i.flag||"a");s||o(new Cn.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=new TextEncoder("utf-8").encode(r)),c(n,e,s,function(i,a){if(i)return o(i);var c=new Bn(e,a.id,s,a.size),u=t.allocDescriptor(c);f(n,c,r,0,r.length,c.position,function(n){return n?o(n):(t.releaseDescriptor(u),o(null),void 0)})})}}function Y(t,n,e,r){function i(t){r(t?!1:!0)}F(t,n,e,i)}function X(t,e,r,i,o){R(r,o)&&k(e,r,i,n(o))}function K(t,e,r,i,o){var s=t.openFiles[r];s?S(e,s,i,n(o)):o(new Cn.EBADF)}function J(t,e,r,i,o,s,a){"function"==typeof s&&(a=s,s=null),R(r,a)&&x(e,r,i,o,s,n(a))}function Q(t,e,r,i,o,s,a){"function"==typeof s&&(a=s,s=null);var c=t.openFiles[r];c?fn(c.flags).contains(xn)?O(e,c,i,o,s,n(a)):a(new Cn.EBADF("descriptor does not permit writing")):a(new Cn.EBADF)}function Z(t,e,r,i,o){R(r,o)&&I(e,r,i,n(o))}function G(t,e,r,i,o){var s=t.openFiles[r];s?fn(s.flags).contains(xn)?T(e,s,i,n(o)):o(new Cn.EBADF("descriptor does not permit writing")):o(new Cn.EBADF)}function $(t,n,e,r,i,o){function s(t,n){t?o(t):0>n.size+r?o(new Cn.EINVAL("resulting file offset would be negative")):(a.position=n.size+r,o(null,a.position))}var a=t.openFiles[e];a||o(new Cn.EBADF),"SET"===i?0>r?o(new Cn.EINVAL("resulting file offset would be negative")):(a.position=r,o(null,a.position)):"CUR"===i?0>a.position+r?o(new Cn.EINVAL("resulting file offset would be negative")):(a.position+=r,o(null,a.position)):"END"===i?p(n,a,s):o(new Cn.EINVAL("whence argument is not a proper value"))}function tn(t,e,r,i){R(r,i)&&m(e,r,n(i))}function nn(t,e,r,i,o,s){if(R(r,s)){var a=Date.now();i=i?i:a,o=o?o:a,_(e,r,i,o,n(s))}}function en(t,e,r,i,o,s){var a=Date.now();i=i?i:a,o=o?o:a;var c=t.openFiles[r];c?fn(c.flags).contains(xn)?A(e,c,i,o,n(s)):s(new Cn.EBADF("descriptor does not permit writing")):s(new Cn.EBADF)}function rn(t,e,r,i,o){function s(t){t?o(t):v(e,r,n(o))}R(r,o)&&R(i,o)&&g(e,r,i,s)}function on(t,e,r,i,o,s){s=arguments[arguments.length-1],R(r,s)&&R(i,s)&&y(e,r,i,n(s))}function sn(t,e,r,i){R(r,i)&&E(e,r,n(i))}function an(t,n,e,r){function i(n,e){if(n)r(n);else{var i=new jn(e,t.name);r(null,i)}}R(e,r)&&d(n,e,i)}function cn(t,e,r,i,o){o=arguments[arguments.length-1],i=i||0,R(r,o)&&w(e,r,i,n(o))}function un(t,e,r,i,o){o=arguments[arguments.length-1],i=i||0;var s=t.openFiles[r];s?fn(s.flags).contains(xn)?b(e,s,i,n(o)):o(new Cn.EBADF("descriptor does not permit writing")):o(new Cn.EBADF)}t("encoding");var fn=t("nodash"),ln=t("src/path").normalize,hn=t("src/path").dirname,pn=t("src/path").basename,dn=t("src/path").isAbsolute,gn=t("src/path").isNull,vn=t("src/constants").MODE_FILE,mn=t("src/constants").MODE_DIRECTORY,yn=t("src/constants").MODE_SYMBOLIC_LINK,En=t("src/constants").MODE_META,wn=t("src/constants").ROOT_DIRECTORY_NAME,bn=t("src/constants").SUPER_NODE_ID,_n=t("src/constants").SYMLOOP_MAX,An=t("src/constants").O_READ,xn=t("src/constants").O_WRITE,On=t("src/constants").O_CREATE,kn=t("src/constants").O_EXCLUSIVE;t("src/constants").O_TRUNCATE;var Sn=t("src/constants").O_APPEND,In=t("src/constants").O_FLAGS,Tn=t("src/constants").XATTR_CREATE,Nn=t("src/constants").XATTR_REPLACE,Dn=t("src/constants").FS_NOMTIME,Rn=t("src/constants").FS_NOCTIME,Cn=t("src/errors"),Mn=t("src/directory-entry"),Bn=t("src/open-file-description"),Ln=t("src/super-node"),Fn=t("src/node"),jn=t("src/stats");return{makeRootDirectory:o,open:C,close:M,mkdir:B,rmdir:L,unlink:P,stat:F,fstat:j,link:U,read:z,readFile:V,write:W,writeFile:q,appendFile:H,exists:Y,getxattr:X,fgetxattr:K,setxattr:J,fsetxattr:Q,removexattr:Z,fremovexattr:G,lseek:$,readdir:tn,utimes:nn,futimes:en,rename:rn,symlink:on,readlink:sn,lstat:an,truncate:cn,ftruncate:un}}),e("src/filesystem/interface",["require","nodash","src/path","src/shared","src/constants","src/constants","src/constants","src/constants","src/constants","src/providers/providers","src/adapters/adapters","src/shell/shell","intercom","src/fs-watcher","src/errors","src/filesystem/implementation"],function(t){function n(t){return"function"==typeof t?t:function(t){if(t)throw t}}function e(t,n){function e(){x.forEach(function(t){t.call(this)}.bind(b)),x=null}function h(t){if(t.length){var n=d.getInstance();t.forEach(function(t){n.emit(t.event,t.path)})}}t=t||{},n=n||o;var p=t.flags,y=t.provider||new l.Default(t.name||s),E=t.name||y.name,w=r(p).contains(a),b=this;b.readyState=u,b.name=E,b.error=null;var _={},A=1;Object.defineProperty(this,"openFiles",{get:function(){return _}}),this.allocDescriptor=function(t){var n=A++;return _[n]=t,n},this.releaseDescriptor=function(t){delete _[t]};var x=[];this.queueOrRun=function(t){var n;return c==b.readyState?t.call(b):f==b.readyState?n=new v.EFILESYSTEMERROR("unknown error"):x.push(t),n},this.watch=function(t,n,e){if(i(t))throw Error("Path must be a string without null bytes.");"function"==typeof n&&(e=n,n={}),n=n||{},e=e||o;var r=new g;return r.start(t,!1,n.recursive),r.on("change",e),r},y.open(function(t,r){function i(t){function r(t){var n=y[t]();return n.flags=p,n.changes=[],n.close=function(){var t=n.changes;h(t),t.length=0},n}b.provider={openReadWriteContext:function(){return r("getReadWriteContext")},openReadOnlyContext:function(){return r("getReadOnlyContext")}},t?b.readyState=f:(b.readyState=c,e()),n(t,b)}if(t)return i(t);if(!w&&!r)return i(null);var o=y.getReadWriteContext();o.clear(function(t){return t?(i(t),void 0):(m.makeRootDirectory(o,i),void 0)})})}var r=t("nodash"),i=t("src/path").isNull,o=t("src/shared").nop,s=t("src/constants").FILE_SYSTEM_NAME,a=t("src/constants").FS_FORMAT,c=t("src/constants").FS_READY,u=t("src/constants").FS_PENDING,f=t("src/constants").FS_ERROR,l=t("src/providers/providers"),h=t("src/adapters/adapters"),p=t("src/shell/shell"),d=t("intercom"),g=t("src/fs-watcher"),v=t("src/errors"),m=t("src/filesystem/implementation");return e.providers=l,e.adapters=h,["open","close","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(t){e.prototype[t]=function(){var e=this,r=Array.prototype.slice.call(arguments,0),i=r.length-1,o="function"!=typeof r[i],s=n(r[i]),a=e.queueOrRun(function(){function n(){a.close(),s.apply(e,arguments)}var a=e.provider.openReadWriteContext();o?r.push(n):r[i]=n;var c=[e,a].concat(r);m[t].apply(null,c)});a&&s(a)}}),e.prototype.Shell=function(t){return new p(this,t)},e}),e("src/index",["require","src/filesystem/interface","src/path","src/errors"],function(t){return{FileSystem:t("src/filesystem/interface"),Path:t("src/path"),Errors:t("src/errors")}});var i=n("src/index");return i}); |