filer/dist/idbfs.min.js

5 lines
600 KiB
JavaScript
Raw Normal View History

/*! idbfs 2013-12-01 */
(function(l,n){"object"==typeof exports?module.exports=n():"function"==typeof define&&define.amd?define(n):l.IDBFS||(l.IDBFS=n())})(this,function(){var l,n,u;(function(t){function e(l,n){return b.call(l,n)}function r(l,n){var u,t,e,r,i,o,s,a,c,f,p=n&&n.split("/"),h=_.map,d=h&&h["*"]||{};if(l&&"."===l.charAt(0))if(n){for(p=p.slice(0,p.length-1),l=p.concat(l.split("/")),a=0;l.length>a;a+=1)if(f=l[a],"."===f)l.splice(a,1),a-=1;else if(".."===f){if(1===a&&(".."===l[2]||".."===l[0]))break;a>0&&(l.splice(a-1,2),a-=2)}l=l.join("/")}else 0===l.indexOf("./")&&(l=l.substring(2));if((p||d)&&h){for(u=l.split("/"),a=u.length;a>0;a-=1){if(t=u.slice(0,a).join("/"),p)for(c=p.length;c>0;c-=1)if(e=h[p.slice(0,c).join("/")],e&&(e=e[t])){r=e,i=a;break}if(r)break;!o&&d&&d[t]&&(o=d[t],s=a)}!r&&o&&(r=o,i=s),r&&(u.splice(0,i,r),l=u.join("/"))}return l}function i(l,n){return function(){return h.apply(t,x.call(arguments,0).concat([l,n]))}}function o(l){return function(n){return r(n,l)}}function s(l){return function(n){v[l]=n}}function a(l){if(e(y,l)){var n=y[l];delete y[l],m[l]=!0,p.apply(t,n)}if(!e(v,l)&&!e(m,l))throw Error("No "+l);return v[l]}function c(l){var n,u=l?l.indexOf("!"):-1;return u>-1&&(n=l.substring(0,u),l=l.substring(u+1,l.length)),[n,l]}function f(l){return function(){return _&&_.config&&_.config[l]||{}}}var p,h,d,g,v={},y={},_={},m={},b=Object.prototype.hasOwnProperty,x=[].slice;d=function(l,n){var u,t=c(l),e=t[0];return l=t[1],e&&(e=r(e,n),u=a(e)),e?l=u&&u.normalize?u.normalize(l,o(n)):r(l,n):(l=r(l,n),t=c(l),e=t[0],l=t[1],e&&(u=a(e))),{f:e?e+"!"+l:l,n:l,pr:e,p:u}},g={require:function(l){return i(l)},exports:function(l){var n=v[l];return n!==void 0?n:v[l]={}},module:function(l){return{id:l,uri:"",exports:v[l],config:f(l)}}},p=function(l,n,u,r){var o,c,f,p,h,_,b=[];if(r=r||l,"function"==typeof u){for(n=!n.length&&u.length?["require","exports","module"]:n,h=0;n.length>h;h+=1)if(p=d(n[h],r),c=p.f,"require"===c)b[h]=g.require(l);else if("exports"===c)b[h]=g.exports(l),_=!0;else if("module"===c)o=b[h]=g.module(l);else if(e(v,c)||e(y,c)||e(m,c))b[h]=a(c);else{if(!p.p)throw Error(l+" missing "+c);p.p.load(p.n,i(r,!0),s(c),{}),b[h]=v[c]}f=u.apply(v[l],b),l&&(o&&o.exports!==t&&o.exports!==v[l]?v[l]=o.exports:f===t&&_||(v[l]=f))}else l&&(v[l]=u)},l=n=h=function(l,n,u,e,r){return"string"==typeof l?g[l]?g[l](n):a(d(l,n).f):(l.splice||(_=l,n.splice?(l=n,n=u,u=null):l=t),n=n||function(){},"function"==typeof u&&(u=e,e=r),e?p(t,l,n,u):setTimeout(function(){p(t,l,n,u)},4),h)},h.config=function(l){return _=l,_.deps&&h(_.deps,_.callback),h},u=function(l,n,u){n.splice||(u=n,n=[]),e(v,l)||e(y,l)||(y[l]=[l,n,u])},u.amd={jQuery:!0}})(),u("build/almond",function(){}),function(l,n){function t(l){return l&&l.__wrapped__?l:this instanceof t?(this.__wrapped__=l,n):new t(l)}function e(l,n,u){n||(n=0);var t=l.length,e=t-n>=(u||In),r=e?{}:l;if(e)for(var i,o=n-1;t>++o;)i=l[o]+"",(Qn.call(r,i)?r[i]:r[i]=[]).push(l[o]);return function(l){if(e){var u=l+"";return Qn.call(r,u)&&F(r[u],l)>-1}return F(r,l,n)>-1}}function r(l,u){var t=l.index,e=u.index;if(l=l.criteria,u=u.criteria,l!==u){if(l>u||l===n)return 1;if(u>l||u===n)return-1}return e>t?-1:1}function i(l,n,u){function t(){var o=arguments,s=r?this:n;if(e||(l=n[i]),u.length&&(o=o.length?u.concat(Jn.call(o)):u),this instanceof t){f.prototype=l.prototype,s=new f;var a=l.apply(s,o);return a&&ju[typeof a]?a:s}return l.apply(s,o)}var e=d(l),r=!u,i=l;return r&&(u=n),t}function o(l,u){return l?"function"!=typeof l?function(n){return n[l]}:u!==n?function(n,t,e){return l.call(u,n,t,e)}:l:hn}function s(){for(var l=-1,n=arguments.length,u={bottom:"",hasDontEnumBug:Dn,isKeysFast:Ou,noArgsEnum:bu,noCharByIndex:Eu,shadowed:Xn,top:"",useHas:!0,useStrict:Cu,arrayBranch:{},objectBranch:{}};n>++l;){var t=arguments[l];for(var e in t){var i=t[e];/beforeLoop|inLoop/.test(e)?("string"==typeof i&&(i={array:i,object:i}),u.arrayBranch[e]=i.array,u.objectBranch[e]=i.object):u[e]=i}}var s=u.args,a=/^[^,]+/.exec(s)[0],c=u.init;u.firstArg=a,u.init=null==c?a:c,"collection"==a&&u.arrayBranch.inLoop||(u.arrayBranch=null);var f=Function("array
}function u(l,n){return Math.floor(l/n)}function t(l){var n=0;this.get=function(){return n>=l.length?T:Number(l[n])},this.offset=function(u){if(n+=u,0>n)throw Error("Seeking past start of the buffer");if(n>l.length)throw Error("Seeking past EOF")},this.match=function(u){if(u.length>n+l.length)return!1;var t;for(t=0;u.length>t;t+=1)if(Number(l[n+t])!==u[t])return!1;return!0}}function e(l){var n=0;this.emit=function(){var u,t=T;for(u=0;arguments.length>u;++u)t=Number(arguments[u]),l[n++]=t;return t}}function r(l){function u(l){for(var u=[],t=0,e=l.length;l.length>t;){var r=l.charCodeAt(t);if(n(r,55296,57343))if(n(r,56320,57343))u.push(65533);else if(t===e-1)u.push(65533);else{var i=l.charCodeAt(t+1);if(n(i,56320,57343)){var o=1023&r,s=1023&i;t+=1,u.push(65536+(o<<10)+s)}else u.push(65533)}else u.push(r);t+=1}return u}var t=0,e=u(l);this.offset=function(l){if(t+=l,0>t)throw Error("Seeking past start of the buffer");if(t>e.length)throw Error("Seeking past EOF")},this.get=function(){return t>=e.length?N:e[t]}}function i(){var l="";this.string=function(){return l},this.emit=function(n){65535>=n?l+=String.fromCharCode(n):(n-=65536,l+=String.fromCharCode(55296+(1023&n>>10)),l+=String.fromCharCode(56320+(1023&n)))}}function o(l){this.name="EncodingError",this.message=l,this.code=0}function s(l,n){if(l)throw new o("Decoder error");return n||65533}function a(l){throw new o("The code point "+l+" could not be encoded.")}function c(l){return l=(l+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(W,l)?W[l]:null}function f(l,n){return(n||[])[l]||null}function p(l,n){var u=n.indexOf(l);return-1===u?null:u}function h(n){if(!("encoding-indexes"in l))throw Error("Indexes missing. Did you forget to include encoding-indexes.js?");return l["encoding-indexes"][n]}function d(l){if(l>39419&&189e3>l||l>1237575)return null;var n,u=0,t=0,e=h("gb18030");for(n=0;e.length>n;++n){var r=e[n];if(!(l>=r[0]))break;u=r[0],t=r[1]}return t+l-u}function g(l){var n,u=0,t=0,e=h("gb18030");for(n=0;e.length>n;++n){var r=e[n];if(!(l>=r[1]))break;u=r[1],t=r[0]}return t+l-u}function v(l){var u=l.fatal,t=0,e=0,r=0,i=0;this.decode=function(l){var o=l.get();if(o===T)return 0!==e?s(u):N;if(l.offset(1),0===e){if(n(o,0,127))return o;if(n(o,194,223))e=1,i=128,t=o-192;else if(n(o,224,239))e=2,i=2048,t=o-224;else{if(!n(o,240,244))return s(u);e=3,i=65536,t=o-240}return t*=Math.pow(64,e),null}if(!n(o,128,191))return t=0,e=0,r=0,i=0,l.offset(-1),s(u);if(r+=1,t+=(o-128)*Math.pow(64,e-r),r!==e)return null;var a=t,c=i;return t=0,e=0,r=0,i=0,n(a,c,1114111)&&!n(a,55296,57343)?a:s(u)}}function y(l){l.fatal,this.encode=function(l,t){var e=t.get();if(e===N)return T;if(t.offset(1),n(e,55296,57343))return a(e);if(n(e,0,127))return l.emit(e);var r,i;n(e,128,2047)?(r=1,i=192):n(e,2048,65535)?(r=2,i=224):n(e,65536,1114111)&&(r=3,i=240);for(var o=l.emit(u(e,Math.pow(64,r))+i);r>0;){var s=u(e,Math.pow(64,r-1));o=l.emit(128+s%64),r-=1}return o}}function _(l,u){var t=u.fatal;this.decode=function(u){var e=u.get();if(e===T)return N;if(u.offset(1),n(e,0,127))return e;var r=l[e-128];return null===r?s(t):r}}function m(l,u){u.fatal,this.encode=function(u,t){var e=t.get();if(e===N)return T;if(t.offset(1),n(e,0,127))return u.emit(e);var r=p(e,l);return null===r&&a(e),u.emit(r+128)}}function b(l,u){var t=u.fatal,e=0,r=0,i=0;this.decode=function(u){var o=u.get();if(o===T&&0===e&&0===r&&0===i)return N;o!==T||0===e&&0===r&&0===i||(e=0,r=0,i=0,s(t)),u.offset(1);var a;if(0!==i)return a=null,n(o,48,57)&&(a=d(10*(126*(10*(e-129)+(r-48))+(i-129))+o-48)),e=0,r=0,i=0,null===a?(u.offset(-3),s(t)):a;if(0!==r)return n(o,129,254)?(i=o,null):(u.offset(-2),e=0,r=0,s(t));if(0!==e){if(n(o,48,57)&&l)return r=o,null;var c=e,p=null;e=0;var g=127>o?64:65;return(n(o,64,126)||n(o,128,254))&&(p=190*(c-129)+(o-g)),a=null===p?null:f(p,h("gbk")),null===p&&u.offset(-1),null===a?s(t):a}return n(o,0,127)?o:128===o?8364:n(o,129,254)?(e=o,null):s(t)}}function x(l,t){t.fatal,this.encode=function(t,e){var r=e.get();if(r===N)return T;if(e.offset(1),n(r,0,127))return t.emit(r);var i=p(r,h("gbk"));if(null!==i){var o=u(i,190)+129,
}}}(),r=t.WordArray=e.extend({init:function(l,u){l=this.words=l||[],this.sigBytes=u!=n?u:4*l.length},toString:function(l){return(l||o).stringify(this)},concat:function(l){var n=this.words,u=l.words,t=this.sigBytes,l=l.sigBytes;if(this.clamp(),t%4)for(var e=0;l>e;e++)n[t+e>>>2]|=(255&u[e>>>2]>>>24-8*(e%4))<<24-8*((t+e)%4);else if(u.length>65535)for(e=0;l>e;e+=4)n[t+e>>>2]=u[e>>>2];else n.push.apply(n,u);return this.sigBytes+=l,this},clamp:function(){var n=this.words,u=this.sigBytes;n[u>>>2]&=4294967295<<32-8*(u%4),n.length=l.ceil(u/4)},clone:function(){var l=e.clone.call(this);return l.words=this.words.slice(0),l},random:function(n){for(var u=[],t=0;n>t;t+=4)u.push(0|4294967296*l.random());return r.create(u,n)}}),i=u.enc={},o=i.Hex={stringify:function(l){for(var n=l.words,l=l.sigBytes,u=[],t=0;l>t;t++){var e=255&n[t>>>2]>>>24-8*(t%4);u.push((e>>>4).toString(16)),u.push((15&e).toString(16))}return u.join("")},parse:function(l){for(var n=l.length,u=[],t=0;n>t;t+=2)u[t>>>3]|=parseInt(l.substr(t,2),16)<<24-4*(t%8);return r.create(u,n/2)}},s=i.Latin1={stringify:function(l){for(var n=l.words,l=l.sigBytes,u=[],t=0;l>t;t++)u.push(String.fromCharCode(255&n[t>>>2]>>>24-8*(t%4)));return u.join("")},parse:function(l){for(var n=l.length,u=[],t=0;n>t;t++)u[t>>>2]|=(255&l.charCodeAt(t))<<24-8*(t%4);return r.create(u,n)}},a=i.Utf8={stringify:function(l){try{return decodeURIComponent(escape(s.stringify(l)))}catch(n){throw Error("Malformed UTF-8 data")}},parse:function(l){return s.parse(unescape(encodeURIComponent(l)))}},c=t.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=r.create(),this._nDataBytes=0},_append:function(l){"string"==typeof l&&(l=a.parse(l)),this._data.concat(l),this._nDataBytes+=l.sigBytes},_process:function(n){var u=this._data,t=u.words,e=u.sigBytes,i=this.blockSize,o=e/(4*i),o=n?l.ceil(o):l.max((0|o)-this._minBufferSize,0),n=o*i,e=l.min(4*n,e);if(n){for(var s=0;n>s;s+=i)this._doProcessBlock(t,s);s=t.splice(0,n),u.sigBytes-=e}return r.create(s,e)},clone:function(){var l=e.clone.call(this);return l._data=this._data.clone(),l},_minBufferSize:0});t.Hasher=c.extend({init:function(){this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(l){return this._append(l),this._process(),this},finalize:function(l){return l&&this._append(l),this._doFinalize(),this._hash},clone:function(){var l=c.clone.call(this);return l._hash=this._hash.clone(),l},blockSize:16,_createHelper:function(l){return function(n,u){return l.create(u).finalize(n)}},_createHmacHelper:function(l){return function(n,u){return f.HMAC.create(l,u).finalize(n)}}});var f=u.algo={};return u}(Math);(function(){var l=t,n=l.lib.WordArray;l.enc.Base64={stringify:function(l){var n=l.words,u=l.sigBytes,t=this._map;l.clamp();for(var l=[],e=0;u>e;e+=3)for(var r=(255&n[e>>>2]>>>24-8*(e%4))<<16|(255&n[e+1>>>2]>>>24-8*((e+1)%4))<<8|255&n[e+2>>>2]>>>24-8*((e+2)%4),i=0;4>i&&u>e+.75*i;i++)l.push(t.charAt(63&r>>>6*(3-i)));if(n=t.charAt(64))for(;l.length%4;)l.push(n);return l.join("")},parse:function(l){var l=l.replace(/\s/g,""),u=l.length,t=this._map,e=t.charAt(64);e&&(e=l.indexOf(e),-1!=e&&(u=e));for(var e=[],r=0,i=0;u>i;i++)if(i%4){var o=t.indexOf(l.charAt(i-1))<<2*(i%4),s=t.indexOf(l.charAt(i))>>>6-2*(i%4);e[r>>>2]|=(o|s)<<24-8*(r%4),r++}return n.create(e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(),function(l){function n(l,n,u,t,e,r,i){return l=l+(n&u|~n&t)+e+i,(l<<r|l>>>32-r)+n}function u(l,n,u,t,e,r,i){return l=l+(n&t|u&~t)+e+i,(l<<r|l>>>32-r)+n}function e(l,n,u,t,e,r,i){return l=l+(n^u^t)+e+i,(l<<r|l>>>32-r)+n}function r(l,n,u,t,e,r,i){return l=l+(u^(n|~t))+e+i,(l<<r|l>>>32-r)+n}var i=t,o=i.lib,s=o.WordArray,o=o.Hasher,a=i.algo,c=[];(function(){for(var n=0;64>n;n++)c[n]=0|4294967296*l.abs(l.sin(n+1))})(),a=a.MD5=o.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(l,t){for(var i=0;16>i;i++){var o=t+i,s=l[o];l[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}for(var o=this._hash.words,s=o[0],a=o[1],f=o[2],p=o[3],i=0;64>i;i+=4)16>i?(s=n
}}}(),r=t.WordArray=e.extend({init:function(l,u){l=this.words=l||[],this.sigBytes=u!=n?u:4*l.length},toString:function(l){return(l||o).stringify(this)},concat:function(l){var n=this.words,u=l.words,t=this.sigBytes,l=l.sigBytes;if(this.clamp(),t%4)for(var e=0;l>e;e++)n[t+e>>>2]|=(255&u[e>>>2]>>>24-8*(e%4))<<24-8*((t+e)%4);else if(u.length>65535)for(e=0;l>e;e+=4)n[t+e>>>2]=u[e>>>2];else n.push.apply(n,u);return this.sigBytes+=l,this},clamp:function(){var n=this.words,u=this.sigBytes;n[u>>>2]&=4294967295<<32-8*(u%4),n.length=l.ceil(u/4)},clone:function(){var l=e.clone.call(this);return l.words=this.words.slice(0),l},random:function(n){for(var u=[],t=0;n>t;t+=4)u.push(0|4294967296*l.random());return r.create(u,n)}}),i=u.enc={},o=i.Hex={stringify:function(l){for(var n=l.words,l=l.sigBytes,u=[],t=0;l>t;t++){var e=255&n[t>>>2]>>>24-8*(t%4);u.push((e>>>4).toString(16)),u.push((15&e).toString(16))}return u.join("")},parse:function(l){for(var n=l.length,u=[],t=0;n>t;t+=2)u[t>>>3]|=parseInt(l.substr(t,2),16)<<24-4*(t%8);return r.create(u,n/2)}},s=i.Latin1={stringify:function(l){for(var n=l.words,l=l.sigBytes,u=[],t=0;l>t;t++)u.push(String.fromCharCode(255&n[t>>>2]>>>24-8*(t%4)));return u.join("")},parse:function(l){for(var n=l.length,u=[],t=0;n>t;t++)u[t>>>2]|=(255&l.charCodeAt(t))<<24-8*(t%4);return r.create(u,n)}},a=i.Utf8={stringify:function(l){try{return decodeURIComponent(escape(s.stringify(l)))}catch(n){throw Error("Malformed UTF-8 data")}},parse:function(l){return s.parse(unescape(encodeURIComponent(l)))}},c=t.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=r.create(),this._nDataBytes=0},_append:function(l){"string"==typeof l&&(l=a.parse(l)),this._data.concat(l),this._nDataBytes+=l.sigBytes},_process:function(n){var u=this._data,t=u.words,e=u.sigBytes,i=this.blockSize,o=e/(4*i),o=n?l.ceil(o):l.max((0|o)-this._minBufferSize,0),n=o*i,e=l.min(4*n,e);if(n){for(var s=0;n>s;s+=i)this._doProcessBlock(t,s);s=t.splice(0,n),u.sigBytes-=e}return r.create(s,e)},clone:function(){var l=e.clone.call(this);return l._data=this._data.clone(),l},_minBufferSize:0});t.Hasher=c.extend({init:function(){this.reset()},reset:function(){c.reset.call(this),this._doReset()},update:function(l){return this._append(l),this._process(),this},finalize:function(l){return l&&this._append(l),this._doFinalize(),this._hash},clone:function(){var l=c.clone.call(this);return l._hash=this._hash.clone(),l},blockSize:16,_createHelper:function(l){return function(n,u){return l.create(u).finalize(n)}},_createHmacHelper:function(l){return function(n,u){return f.HMAC.create(l,u).finalize(n)}}});var f=u.algo={};return u}(Math);(function(){var l=t,n=l.lib.WordArray;l.enc.Base64={stringify:function(l){var n=l.words,u=l.sigBytes,t=this._map;l.clamp();for(var l=[],e=0;u>e;e+=3)for(var r=(255&n[e>>>2]>>>24-8*(e%4))<<16|(255&n[e+1>>>2]>>>24-8*((e+1)%4))<<8|255&n[e+2>>>2]>>>24-8*((e+2)%4),i=0;4>i&&u>e+.75*i;i++)l.push(t.charAt(63&r>>>6*(3-i)));if(n=t.charAt(64))for(;l.length%4;)l.push(n);return l.join("")},parse:function(l){var l=l.replace(/\s/g,""),u=l.length,t=this._map,e=t.charAt(64);e&&(e=l.indexOf(e),-1!=e&&(u=e));for(var e=[],r=0,i=0;u>i;i++)if(i%4){var o=t.indexOf(l.charAt(i-1))<<2*(i%4),s=t.indexOf(l.charAt(i))>>>6-2*(i%4);e[r>>>2]|=(o|s)<<24-8*(r%4),r++}return n.create(e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(),function(l){function n(l,n,u,t,e,r,i){return l=l+(n&u|~n&t)+e+i,(l<<r|l>>>32-r)+n}function u(l,n,u,t,e,r,i){return l=l+(n&t|u&~t)+e+i,(l<<r|l>>>32-r)+n}function e(l,n,u,t,e,r,i){return l=l+(n^u^t)+e+i,(l<<r|l>>>32-r)+n}function r(l,n,u,t,e,r,i){return l=l+(u^(n|~t))+e+i,(l<<r|l>>>32-r)+n}var i=t,o=i.lib,s=o.WordArray,o=o.Hasher,a=i.algo,c=[];(function(){for(var n=0;64>n;n++)c[n]=0|4294967296*l.abs(l.sin(n+1))})(),a=a.MD5=o.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(l,t){for(var i=0;16>i;i++){var o=t+i,s=l[o];l[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}for(var o=this._hash.words,s=o[0],a=o[1],f=o[2],p=o[3],i=0;64>i;i+=4)16>i?(s=n