filer/dist/filer.min.js

4 lines
92 KiB
JavaScript

/*! filer 0.0.8 2014-05-28 */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.Filer=t()}}(function(){var t;return function n(t,e,r){function i(a,s){if(!e[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var c=e[a]={exports:{}};t[a][0].call(c.exports,function(n){var e=t[a][1][n];return i(e?e:n)},c,c.exports,n,t,e,r)}return e[a].exports}for(var o="function"==typeof require&&require,a=0;r.length>a;a++)i(r[a]);return i}({1:[function(n,e){(function(n){(function(){function r(t){var n=!1;return function(){if(n)throw Error("Callback was already called.");n=!0,t.apply(i,arguments)}}var i,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){return i.async=o,a};var s=function(t,n){if(t.forEach)return t.forEach(n);for(var e=0;t.length>e;e+=1)n(t[e],e,t)},u=function(t,n){if(t.map)return t.map(n);var e=[];return s(t,function(t,r,i){e.push(n(t,r,i))}),e},c=function(t,n,e){return t.reduce?t.reduce(n,e):(s(t,function(t,r,i){e=n(e,t,r,i)}),e)},f=function(t){if(Object.keys)return Object.keys(t);var n=[];for(var e in t)t.hasOwnProperty(e)&&n.push(e);return n};void 0!==n&&n.nextTick?(a.nextTick=n.nextTick,a.setImmediate="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:a.nextTick):"function"==typeof setImmediate?(a.nextTick=function(t){setImmediate(t)},a.setImmediate=a.nextTick):(a.nextTick=function(t){setTimeout(t,0)},a.setImmediate=a.nextTick),a.each=function(t,n,e){if(e=e||function(){},!t.length)return e();var i=0;s(t,function(o){n(o,r(function(n){n?(e(n),e=function(){}):(i+=1,i>=t.length&&e(null))}))})},a.forEach=a.each,a.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()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,n,e,r){var i=l(n);i.apply(null,[t,e,r])},a.forEachLimit=a.eachLimit;var l=function(t){return function(n,e,r){if(r=r||function(){},!n.length||0>=t)return r();var i=0,o=0,a=0;(function s(){if(i>=n.length)return r();for(;t>a&&n.length>o;)o+=1,a+=1,e(n[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=n.length?r():s())})})()}},h=function(t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[a.each].concat(n))}},p=function(t,n){return function(){var e=Array.prototype.slice.call(arguments);return n.apply(null,[l(t)].concat(e))}},d=function(t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[a.eachSeries].concat(n))}},g=function(t,n,e,r){var i=[];n=u(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)})};a.map=h(g),a.mapSeries=d(g),a.mapLimit=function(t,n,e,r){return v(n)(t,e,r)};var v=function(t){return p(t,g)};a.reduce=function(t,n,e,r){a.eachSeries(t,function(t,r){e(n,t,function(t,e){n=e,r(t)})},function(t){r(t,n)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,n,e,r){var i=u(t,function(t){return t}).reverse();a.reduce(i,n,e,r)},a.foldr=a.reduceRight;var m=function(t,n,e,r){var i=[];n=u(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(u(i.sort(function(t,n){return t.index-n.index}),function(t){return t.value}))})};a.filter=h(m),a.filterSeries=d(m),a.select=a.filter,a.selectSeries=a.filterSeries;var y=function(t,n,e,r){var i=[];n=u(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(u(i.sort(function(t,n){return t.index-n.index}),function(t){return t.value}))})};a.reject=h(y),a.rejectSeries=d(y);var E=function(t,n,e,r){t(n,function(t,n){e(t,function(e){e?(r(t),r=function(){}):n()})},function(){r()})};a.detect=h(E),a.detectSeries=d(E),a.some=function(t,n,e){a.each(t,function(t,r){n(t,function(t){t&&(e(!0),e=function(){}),r()})},function(){e(!1)})},a.any=a.some,a.every=function(t,n,e){a.each(t,function(t,r){n(t,function(t){t||(e(!1),e=function(){}),r()})},function(){e(!0)})},a.all=a.every,a.sortBy=function(t,n,e){a.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,u(n.sort(r),function(t){return t.value}))})},a.auto=function(t,n){n=n||function(){};var e=f(t);if(!e.length)return n(null);var r={},i=[],o=function(t){i.unshift(t)},u=function(t){for(var n=0;i.length>n;n+=1)if(i[n]===t)return i.splice(n,1),void 0},l=function(){s(i.slice(0),function(t){t()})};o(function(){f(r).length===e.length&&(n(null,r),n=function(){})}),s(e,function(e){var i=t[e]instanceof Function?[t[e]]:t[e],h=function(t){var i=Array.prototype.slice.call(arguments,1);if(1>=i.length&&(i=i[0]),t){var o={};s(f(r),function(t){o[t]=r[t]}),o[e]=i,n(t,o),n=function(){}}else r[e]=i,a.setImmediate(l)},p=i.slice(0,Math.abs(i.length-1))||[],d=function(){return c(p,function(t,n){return t&&r.hasOwnProperty(n)},!0)&&!r.hasOwnProperty(e)};if(d())i[i.length-1](h,r);else{var g=function(){d()&&(u(g),i[i.length-1](h,r))};o(g)}})},a.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 i=Array.prototype.slice.call(arguments,1),o=t.next();o?i.push(r(o)):i.push(n),a.setImmediate(function(){t.apply(null,i)})}}};r(a.iterator(t))()};var w=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(f(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)})}};a.parallel=function(t,n){w({map:a.map,each:a.each},t,n)},a.parallelLimit=function(t,n,e){w({map:v(n),each:l(n)},t,e)},a.series=function(t,n){if(n=n||function(){},t.constructor===Array)a.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={};a.eachSeries(f(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)})}},a.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)},a.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 b=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)})};a.concat=h(b),a.concatSeries=d(b),a.whilst=function(t,n,e){t()?n(function(r){return r?e(r):(a.whilst(t,n,e),void 0)}):e()},a.doWhilst=function(t,n,e){t(function(r){return r?e(r):(n()?a.doWhilst(t,n,e):e(),void 0)})},a.until=function(t,n,e){t()?e():n(function(r){return r?e(r):(a.until(t,n,e),void 0)})},a.doUntil=function(t,n,e){t(function(r){return r?e(r):(n()?e():a.doUntil(t,n,e),void 0)})},a.queue=function(t,n){function e(t,e,r,i){e.constructor!==Array&&(e=[e]),s(e,function(e){var o={data:e,callback:"function"==typeof i?i:null};r?t.tasks.unshift(o):t.tasks.push(o),t.saturated&&t.tasks.length===n&&t.saturated(),a.setImmediate(t.process)})}void 0===n&&(n=1);var i=0,o={tasks:[],concurrency:n,saturated:null,empty:null,drain:null,push:function(t,n){e(o,t,!1,n)},unshift:function(t,n){e(o,t,!0,n)},process:function(){if(o.concurrency>i&&o.tasks.length){var n=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),i+=1;var e=function(){i-=1,n.callback&&n.callback.apply(n,arguments),o.drain&&0===o.tasks.length+i&&o.drain(),o.process()},a=r(e);t(n.data,a)}},length:function(){return o.tasks.length},running:function(){return i}};return o},a.cargo=function(t,n){var e=!1,r=[],i={tasks:r,payload:n,saturated:null,empty:null,drain:null,push:function(t,e){t.constructor!==Array&&(t=[t]),s(t,function(t){r.push({data:t,callback:"function"==typeof e?e:null}),i.saturated&&r.length===n&&i.saturated()}),a.setImmediate(i.process)},process:function o(){if(!e){if(0===r.length)return i.drain&&i.drain(),void 0;var a="number"==typeof n?r.splice(0,n):r.splice(0),c=u(a,function(t){return t.data});i.empty&&i.empty(),e=!0,t(c,function(){e=!1;var t=arguments;s(a,function(n){n.callback&&n.callback.apply(null,t)}),o()})}},length:function(){return r.length},running:function(){return e}};return i};var A=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]&&s(e,function(n){console[t](n)}))}]))}};a.log=A("log"),a.dir=A("dir"),a.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(),a=n.apply(null,i);a in e?o.apply(null,e[a]):a in r?r[a].push(o):(r[a]=[o],t.apply(null,i.concat([function(){e[a]=arguments;var t=r[a];delete r[a];for(var n=0,i=t.length;i>n;n++)t[n].apply(null,arguments)}])))};return i.memo=e,i.unmemoized=t,i},a.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},a.times=function(t,n,e){for(var r=[],i=0;t>i;i++)r.push(i);return a.map(r,n,e)},a.timesSeries=function(t,n,e){for(var r=[],i=0;t>i;i++)r.push(i);return a.mapSeries(r,n,e)},a.compose=function(){var t=Array.prototype.reverse.call(arguments);return function(){var n=this,e=Array.prototype.slice.call(arguments),r=e.pop();a.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 O=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};a.applyEach=h(O),a.applyEachSeries=d(O),a.forever=function(t,n){function e(r){if(r){if(n)return n(r);throw r}t(e)}e()},t!==void 0&&t.amd?t([],function(){return a}):e!==void 0&&e.exports?e.exports=a:i.async=a})()}).call(this,n("FWaASH"))},{FWaASH:7}],2:[function(t,n){(function(t){"use strict";function e(t,n,e){return t>=n&&e>=t}function r(t,n){return Math.floor(t/n)}function i(t){var n=0;this.get=function(){return n>=t.length?v: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 o(t){var n=0;this.emit=function(){var e,r=v;for(e=0;arguments.length>e;++e)r=Number(arguments[e]),t[n++]=r;return r}}function a(t){function n(t){for(var n=[],r=0,i=t.length;t.length>r;){var o=t.charCodeAt(r);if(e(o,55296,57343))if(e(o,56320,57343))n.push(65533);else if(r===i-1)n.push(65533);else{var a=t.charCodeAt(r+1);if(e(a,56320,57343)){var s=1023&o,u=1023&a;r+=1,n.push(65536+(s<<10)+u)}else n.push(65533)}else n.push(o);r+=1}return n}var r=0,i=n(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?m: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 u(t){this.name="EncodingError",this.message=t,this.code=0}function c(t,n){if(t)throw new u("Decoder error");return n||65533}function f(t){throw new u("The code point "+t+" could not be encoded.")}function l(t){return t=(t+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(w,t)?w[t]:null}function h(t){var n=t.fatal,r=0,i=0,o=0,a=0;this.decode=function(t){var s=t.get();if(s===v)return 0!==i?c(n):m;if(t.offset(1),0===i){if(e(s,0,127))return s;if(e(s,194,223))i=1,a=128,r=s-192;else if(e(s,224,239))i=2,a=2048,r=s-224;else{if(!e(s,240,244))return c(n);i=3,a=65536,r=s-240}return r*=Math.pow(64,i),null}if(!e(s,128,191))return r=0,i=0,o=0,a=0,t.offset(-1),c(n);if(o+=1,r+=(s-128)*Math.pow(64,i-o),o!==i)return null;var u=r,f=a;return r=0,i=0,o=0,a=0,e(u,f,1114111)&&!e(u,55296,57343)?u:c(n)}}function p(t){t.fatal,this.encode=function(t,n){var i=n.get();if(i===m)return v;if(n.offset(1),e(i,55296,57343))return f(i);if(e(i,0,127))return t.emit(i);var o,a;e(i,128,2047)?(o=1,a=192):e(i,2048,65535)?(o=2,a=224):e(i,65536,1114111)&&(o=3,a=240);for(var s=t.emit(r(i,Math.pow(64,o))+a);o>0;){var u=r(i,Math.pow(64,o-1));s=t.emit(128+u%64),o-=1}return s}}function d(t,n){if(!(this instanceof d))throw new TypeError("Constructor cannot be called as a function");if(t=t?t+"":b,n=Object(n),this._encoding=l(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 g(t,n){if(!(this instanceof g))throw new TypeError("Constructor cannot be called as a function");if(t=t?t+"":b,n=Object(n),this._encoding=l(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 v=-1,m=-1;u.prototype=Error.prototype;var y=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"utf-8"}],heading:"The Encoding"}],E={},w={};y.forEach(function(t){t.encodings.forEach(function(t){E[t.name]=t,t.labels.forEach(function(n){w[n]=t})})}),E["utf-8"].getEncoder=function(t){return new p(t)},E["utf-8"].getDecoder=function(t){return new h(t)};var b="utf-8";d.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 o(e),i=new a(t);i.get()!==m;)this._encoder.encode(r,i);if(!this._streaming){var s;do s=this._encoder.encode(r,i);while(s!==v);this._encoder=null}return new Uint8Array(e)}},g.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,r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=new i(r),a=new s;o.get()!==v;)e=this._decoder.decode(o),null!==e&&e!==m&&a.emit(e);if(!this._streaming){do e=this._decoder.decode(o),null!==e&&e!==m&&a.emit(e);while(e!==m&&o.get()!=v);this._decoder=null}var u=a.string();return!this._BOMseen&&u.length&&(this._BOMseen=!0,-1!==["utf-8","utf-16le","utf-16be"].indexOf(this.encoding)&&65279===u.charCodeAt(0)&&(u=u.substring(1))),u}},n.exports={TextEncoder:t.TextEncoder||d,TextDecoder:t.TextDecoder||g}})(this)},{}],3:[function(t,n){function e(t,n){for(var e=n.length-1;e>=0;e--)n[e]===t&&n.splice(e,1);return n}var r=function(){};r.createInterface=function(t){var n={};return n.on=function(n,e){this[t]===void 0&&(this[t]={}),this[t].hasOwnProperty(n)||(this[t][n]=[]),this[t][n].push(e)},n.off=function(n,r){void 0!==this[t]&&this[t].hasOwnProperty(n)&&e(r,this[t][n])},n.trigger=function(n){if(this[t]!==void 0&&this[t].hasOwnProperty(n))for(var e=Array.prototype.slice.call(arguments,1),r=0;this[t][n].length>r;r++)this[t][n][r].apply(this[t][n][r],e)},n.removeAllListeners=function(n){if(void 0!==this[t]){var e=this;e[t][n].forEach(function(t){e.off(n,t)})}},n};var i=r.createInterface("_handlers");r.prototype._on=i.on,r.prototype._off=i.off,r.prototype._trigger=i.trigger;var o=r.createInterface("handlers");r.prototype.on=function(){o.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},r.prototype.off=o.off,r.prototype.trigger=o.trigger,r.prototype.removeAllListeners=o.removeAllListeners,n.exports=r},{}],4:[function(t,n){function e(t,n){var e=0;return function(){var r=Date.now();r-e>t&&(e=r,n.apply(this,arguments))}}function r(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 i(){var t=this,n=Date.now();this.origin=a(),this.lastMessage=n,this.receivedIDs={},this.previousValues={};var e=function(){t._onStorageEvent.apply(t,arguments)};"undefined"!=typeof window&&"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",e):window.addEventListener("storage",e,!1))}var o=t("./eventemitter.js"),a=t("../src/shared.js").guid,s=function(t){return t===void 0||t.localStorage===void 0?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(this);i.prototype._transaction=function(t){function n(){if(!a){var l=Date.now(),h=0|s.getItem(f);if(h&&r>l-h)return u||(o._on("storage",n),u=!0),c=setTimeout(n,i),void 0;a=!0,s.setItem(f,l),t(),e()}}function e(){u&&o._off("storage",n),c&&clearTimeout(c),s.removeItem(f)}var r=1e3,i=20,o=this,a=!1,u=!1,c=null;n()},i.prototype._cleanup_emit=e(100,function(){var t=this;t._transaction(function(){var t,n=Date.now(),e=n-l,r=0;try{t=JSON.parse(s.getItem(u)||"[]")}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(u,JSON.stringify(t))})}),i.prototype._cleanup_once=e(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))})}),i.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||h,r=Date.now(),i=n[t].timestamp;return r-e>i},i.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)},i.prototype._onStorageEvent=function(t){t=t||window.event;var n=this;this._localStorageChanged(t,u)&&this._transaction(function(){var t,e=Date.now(),r=s.getItem(u);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)},i.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(u)||"[]",o="[]"===e?"":",";e=[e.substring(0,e.length-1),o,JSON.stringify(r),"]"].join(""),s.setItem(u,e),i.trigger(t,n),setTimeout(function(){i._cleanup_emit()},50)})},i.prototype.emit=function(t,n){this._emit.apply(this,arguments),this._trigger("emit",t,n)},i.prototype.once=function(t,n,e){if(i.supported){var r=this;this._transaction(function(){var i;try{i=JSON.parse(s.getItem(c)||"{}")}catch(o){i={}}r._once_expired(t,i)&&(i[t]={},i[t].timestamp=Date.now(),"number"==typeof e&&(i[t].ttl=1e3*e),s.setItem(c,JSON.stringify(i)),n(),setTimeout(function(){r._cleanup_once()},50))})}},r(i.prototype,o.prototype),i.supported=s!==void 0;var u="intercom",c="intercom_once",f="intercom_lock",l=5e4,h=36e5;i.destroy=function(){s.removeItem(f),s.removeItem(u),s.removeItem(c)},i.getInstance=function(){var t;return function(){return t||(t=new i),t}}(),n.exports=i},{"../src/shared.js":23,"./eventemitter.js":3}],5:[function(t,n){function e(t,n){return g.call(t,n)}function r(t){return null==t?0:t.length===+t.length?t.length:y(t).length}function i(t){return t}function o(t,n,e){var r,i;if(null!=t)if(l&&t.forEach===l)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)===m)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)===m)return}}function a(t,n,e){n||(n=i);var r=!1;return null==t?r:p&&t.some===p?t.some(n,e):(o(t,function(t,i,o){return r||(r=n.call(e,t,i,o))?m:void 0}),!!r)}function s(t,n){return null==t?!1:h&&t.indexOf===h?-1!=t.indexOf(n):a(t,function(t){return t===n})}function u(t){this.value=t}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)&&g.call(t,"__wrapped__")?t:new u(t)}var f=Array.prototype,l=f.forEach,h=f.indexOf,p=f.some,d=Object.prototype,g=d.hasOwnProperty,v=Object.keys,m={},y=v||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var n=[];for(var r in t)e(t,r)&&n.push(r);return n};u.prototype.has=function(t){return e(this.value,t)},u.prototype.contains=function(t){return s(this.value,t)},u.prototype.size=function(){return r(this.value)},n.exports=c},{}],6:[function(t,n){var e={};(function(){"use strict";function t(t,n){var e=t.split("."),r=y;!(e[0]in r)&&r.execScript&&r.execScript("var "+e[0]);for(var i;e.length&&(i=e.shift());)e.length||n===v?r=r[i]?r[i]:r[i]={}:r[i]=n}function n(t,n){if(this.index="number"==typeof n?n:0,this.f=0,this.buffer=t instanceof(E?Uint8Array:Array)?t:new(E?Uint8Array:Array)(32768),2*this.buffer.length<=this.index)throw Error("invalid index");this.buffer.length<=this.index&&e(this)}function e(t){var n,e=t.buffer,r=e.length,i=new(E?Uint8Array:Array)(r<<1);if(E)i.set(e);else for(n=0;r>n;++n)i[n]=e[n];return t.buffer=i}function r(t){var n,e=v,r="number"==typeof e?e:e=0,i=t.length;for(n=-1,r=7&i;r--;++e)n=n>>>8^x[255&(n^t[e])];for(r=i>>3;r--;e+=8)n=n>>>8^x[255&(n^t[e])],n=n>>>8^x[255&(n^t[e+1])],n=n>>>8^x[255&(n^t[e+2])],n=n>>>8^x[255&(n^t[e+3])],n=n>>>8^x[255&(n^t[e+4])],n=n>>>8^x[255&(n^t[e+5])],n=n>>>8^x[255&(n^t[e+6])],n=n>>>8^x[255&(n^t[e+7])];return(4294967295^n)>>>0}function i(t){this.buffer=new(E?Uint16Array:Array)(2*t),this.length=0}function o(t,n){this.k=k,this.l=0,this.input=E&&t instanceof Array?new Uint8Array(t):t,this.e=0,n&&(n.lazy&&(this.l=n.lazy),"number"==typeof n.compressionType&&(this.k=n.compressionType),n.outputBuffer&&(this.c=E&&n.outputBuffer instanceof Array?new Uint8Array(n.outputBuffer):n.outputBuffer),"number"==typeof n.outputIndex&&(this.e=n.outputIndex)),this.c||(this.c=new(E?Uint8Array:Array)(32768))}function a(t,n){this.length=t,this.n=n}function s(t,n){function e(t,n){var e,r=t.n,i=[],o=0;e=R[t.length],i[o++]=65535&e,i[o++]=255&e>>16,i[o++]=e>>24;var a;switch(m){case 1===r:a=[0,r-1,0];break;case 2===r:a=[1,r-2,0];break;case 3===r:a=[2,r-3,0];break;case 4===r:a=[3,r-4,0];break;case 6>=r:a=[4,r-5,1];break;case 8>=r:a=[5,r-7,1];break;case 12>=r:a=[6,r-9,2];break;case 16>=r:a=[7,r-13,2];break;case 24>=r:a=[8,r-17,3];break;case 32>=r:a=[9,r-25,3];break;case 48>=r:a=[10,r-33,4];break;case 64>=r:a=[11,r-49,4];break;case 96>=r:a=[12,r-65,5];break;case 128>=r:a=[13,r-97,5];break;case 192>=r:a=[14,r-129,6];break;case 256>=r:a=[15,r-193,6];break;case 384>=r:a=[16,r-257,7];break;case 512>=r:a=[17,r-385,7];break;case 768>=r:a=[18,r-513,8];break;case 1024>=r:a=[19,r-769,8];break;case 1536>=r:a=[20,r-1025,9];break;case 2048>=r:a=[21,r-1537,9];break;case 3072>=r:a=[22,r-2049,10];break;case 4096>=r:a=[23,r-3073,10];break;case 6144>=r:a=[24,r-4097,11];break;case 8192>=r:a=[25,r-6145,11];break;case 12288>=r:a=[26,r-8193,12];break;case 16384>=r:a=[27,r-12289,12];break;case 24576>=r:a=[28,r-16385,13];break;case 32768>=r:a=[29,r-24577,13];break;default:throw"invalid distance"}e=a,i[o++]=e[0],i[o++]=e[1],i[o++]=e[2];var s,u;for(s=0,u=i.length;u>s;++s)d[g++]=i[s];w[i[0]]++,b[i[3]]++,y=t.length+n-1,l=null}var r,i,o,a,s,c,f,l,h,p={},d=E?new Uint16Array(2*n.length):[],g=0,y=0,w=new(E?Uint32Array:Array)(286),b=new(E?Uint32Array:Array)(30),A=t.l;if(!E){for(o=0;285>=o;)w[o++]=0;for(o=0;29>=o;)b[o++]=0}for(w[256]=1,r=0,i=n.length;i>r;++r){for(o=s=0,a=3;a>o&&r+o!==i;++o)s=s<<8|n[r+o];if(p[s]===v&&(p[s]=[]),c=p[s],!(y-->0)){for(;c.length>0&&r-c[0]>32768;)c.shift();if(r+3>=i){for(l&&e(l,-1),o=0,a=i-r;a>o;++o)h=n[r+o],d[g++]=h,++w[h];break}c.length>0?(f=u(n,r,c),l?l.length<f.length?(h=n[r-1],d[g++]=h,++w[h],e(f,0)):e(l,-1):A>f.length?l=f:e(f,0)):l?e(l,-1):(h=n[r],d[g++]=h,++w[h])}c.push(r)}return d[g++]=256,w[256]++,t.p=w,t.o=b,E?d.subarray(0,g):d}function u(t,n,e){var r,i,o,s,u,c,f=0,l=t.length;s=0,c=e.length;t:for(;c>s;s++){if(r=e[c-s-1],o=3,f>3){for(u=f;u>3;u--)if(t[r+u-1]!==t[n+u-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 a(f,n-i)}function c(t,n){var e,r,o,a,s,u=t.length,c=new i(572),l=new(E?Uint8Array:Array)(u);if(!E)for(a=0;u>a;a++)l[a]=0;for(a=0;u>a;++a)t[a]>0&&c.push(a,t[a]);if(e=Array(c.length/2),r=new(E?Uint32Array:Array)(c.length/2),1===e.length)return l[c.pop().index]=1,l;for(a=0,s=c.length/2;s>a;++a)e[a]=c.pop(),r[a]=e[a].value;for(o=f(r,r.length,n),a=0,s=e.length;s>a;++a)l[e[a].index]=o[a];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,a,s,u,c=new(E?Uint16Array:Array)(e),f=new(E?Uint8Array:Array)(e),l=new(E?Uint8Array:Array)(n),h=Array(e),p=Array(e),d=Array(e),g=(1<<e)-n,v=1<<e-1;for(c[e-1]=n,o=0;e>o;++o)v>g?f[o]=0:(f[o]=1,g-=v),g<<=1,c[e-2-o]=(0|c[e-1-o]/2)+n;for(c[0]=f[0],h[0]=Array(c[0]),p[0]=Array(c[0]),o=1;e>o;++o)c[o]>2*c[o-1]+f[o]&&(c[o]=2*c[o-1]+f[o]),h[o]=Array(c[o]),p[o]=Array(c[o]);for(i=0;n>i;++i)l[i]=e;for(a=0;c[e-1]>a;++a)h[e-1][a]=t[a],p[e-1][a]=a;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(s=i=0,u=d[o+1],a=0;c[o]>a;a++)s=h[o+1][u]+h[o+1][u+1],s>t[i]?(h[o][a]=s,p[o][a]=n,u+=2):(h[o][a]=t[i],p[o][a]=i,++i);d[o]=0,1===f[o]&&r(o)}return l}function l(t){var n,e,r,i,o=new(E?Uint16Array:Array)(t.length),a=[],s=[],u=0;for(n=0,e=t.length;e>n;n++)a[t[n]]=(0|a[t[n]])+1;for(n=1,e=16;e>=n;n++)s[n]=u,u+=0|a[n],u<<=1;for(n=0,e=t.length;e>n;n++)for(u=s[t[n]],s[t[n]]+=1,r=o[n]=0,i=t[n];i>r;r++)o[n]=o[n]<<1|1&u,u>>>=1;return o}function h(t){t=t||{},this.files=[],this.d=t.comment}function p(t,n){var e,r=2|65535&t[2];return e=255&r*(1^r)>>8,d(t,n),e^n}function d(t,n){t[0]=(x[255&(t[0]^n)]^t[0]>>>8)>>>0,t[1]=(6681*(20173*(t[1]+(255&t[0]))>>>0)>>>0)+1>>>0,t[2]=(x[255&(t[2]^t[1]>>>24)]^t[2]>>>8)>>>0}function g(n,e){var r,i,o,a;if(Object.keys)r=Object.keys(e);else for(i in r=[],o=0,e)r[o++]=i;for(o=0,a=r.length;a>o;++o)i=r[o],t(n+"."+i,e[i])}var v=void 0,m=!0,y=this,E="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;n.prototype.b=function(t,n,r){var i,o=this.buffer,a=this.index,s=this.f,u=o[a];if(r&&n>1&&(t=n>8?(I[255&t]<<24|I[255&t>>>8]<<16|I[255&t>>>16]<<8|I[255&t>>>24])>>32-n:I[t]>>8-n),8>n+s)u=u<<n|t,s+=n;else for(i=0;n>i;++i)u=u<<1|1&t>>n-i-1,8===++s&&(s=0,o[a++]=I[u],u=0,a===o.length&&(o=e(this)));o[a]=u,this.buffer=o,this.f=s,this.index=a},n.prototype.finish=function(){var t,n=this.buffer,e=this.index;return this.f>0&&(n[e]<<=8-this.f,n[e]=I[n[e]],e++),E?t=n.subarray(0,e):(n.length=e,t=n),t};var w,b=new(E?Uint8Array:Array)(256);for(w=0;256>w;++w){for(var A=w,O=A,T=7,A=A>>>1;A;A>>>=1)O<<=1,O|=1&A,--T;b[w]=(255&O<<T)>>>0}var I=b,S=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],x=E?new Uint32Array(S):S;i.prototype.getParent=function(t){return 2*(0|(t-2)/4)},i.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},i.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,k=2,_=[];for(N=0;288>N;N++)switch(m){case 143>=N:_.push([N+48,8]);break;case 255>=N:_.push([N-144+400,9]);break;case 279>=N:_.push([N-256+0,7]);break;case 287>=N:_.push([N-280+192,8]);break;default:throw"invalid literal: "+N}o.prototype.g=function(){var t,e,r,i,o=this.input;switch(this.k){case 0:for(r=0,i=o.length;i>r;){e=E?o.subarray(r,r+65535):o.slice(r,r+65535),r+=e.length;var a=e,u=r===i,f=v,h=v,p=v,d=v,g=v,y=this.c,w=this.e;if(E){for(y=new Uint8Array(this.c.buffer);y.length<=w+a.length+5;)y=new Uint8Array(y.length<<1);y.set(this.c)}if(f=u?1:0,y[w++]=0|f,h=a.length,p=65535&~h+65536,y[w++]=255&h,y[w++]=255&h>>>8,y[w++]=255&p,y[w++]=255&p>>>8,E)y.set(a,w),w+=a.length,y=y.subarray(0,w);else{for(d=0,g=a.length;g>d;++d)y[w++]=a[d];y.length=w}this.e=w,this.c=y}break;case 1:var b=new n(E?new Uint8Array(this.c.buffer):this.c,this.e);b.b(1,1,m),b.b(1,2,m);var A,O,T,I=s(this,o);for(A=0,O=I.length;O>A;A++)if(T=I[A],n.prototype.b.apply(b,_[T]),T>256)b.b(I[++A],I[++A],m),b.b(I[++A],5),b.b(I[++A],I[++A],m);
else if(256===T)break;this.c=b.finish(),this.e=this.c.length;break;case k:var S,x,N,D,R,j,L,M,F,U,C,P,V,B,z,Y=new n(E?new Uint8Array(this.c.buffer):this.c,this.e),W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],X=Array(19);for(S=k,Y.b(1,1,m),Y.b(S,2,m),x=s(this,o),j=c(this.p,15),L=l(j),M=c(this.o,7),F=l(M),N=286;N>257&&0===j[N-1];N--);for(D=30;D>1&&0===M[D-1];D--);var q,Z,H,J,G,Q,K=N,$=D,tn=new(E?Uint32Array:Array)(K+$),nn=new(E?Uint32Array:Array)(316),en=new(E?Uint8Array:Array)(19);for(q=Z=0;K>q;q++)tn[Z++]=j[q];for(q=0;$>q;q++)tn[Z++]=M[q];if(!E)for(q=0,J=en.length;J>q;++q)en[q]=0;for(q=G=0,J=tn.length;J>q;q+=Z){for(Z=1;J>q+Z&&tn[q+Z]===tn[q];++Z);if(H=Z,0===tn[q])if(3>H)for(;H-->0;)nn[G++]=0,en[0]++;else for(;H>0;)Q=138>H?H:138,Q>H-3&&H>Q&&(Q=H-3),10>=Q?(nn[G++]=17,nn[G++]=Q-3,en[17]++):(nn[G++]=18,nn[G++]=Q-11,en[18]++),H-=Q;else if(nn[G++]=tn[q],en[tn[q]]++,H--,3>H)for(;H-->0;)nn[G++]=tn[q],en[tn[q]]++;else for(;H>0;)Q=6>H?H:6,Q>H-3&&H>Q&&(Q=H-3),nn[G++]=16,nn[G++]=Q-3,en[16]++,H-=Q}for(t=E?nn.subarray(0,G):nn.slice(0,G),U=c(en,7),B=0;19>B;B++)X[B]=U[W[B]];for(R=19;R>4&&0===X[R-1];R--);for(C=l(U),Y.b(N-257,5,m),Y.b(D-1,5,m),Y.b(R-4,4,m),B=0;R>B;B++)Y.b(X[B],3,m);for(B=0,z=t.length;z>B;B++)if(P=t[B],Y.b(C[P],U[P],m),P>=16){switch(B++,P){case 16:V=2;break;case 17:V=3;break;case 18:V=7;break;default:throw"invalid code: "+P}Y.b(t[B],V,m)}var rn,on,an,sn,un,cn,fn,ln,hn=[L,j],pn=[F,M];for(un=hn[0],cn=hn[1],fn=pn[0],ln=pn[1],rn=0,on=x.length;on>rn;++rn)if(an=x[rn],Y.b(un[an],cn[an],m),an>256)Y.b(x[++rn],x[++rn],m),sn=x[++rn],Y.b(fn[sn],ln[sn],m),Y.b(x[++rn],x[++rn],m);else if(256===an)break;this.c=Y.finish(),this.e=this.c.length;break;default:throw"invalid compression type"}return this.c};var D=function(){function t(t){switch(m){case 3===t:return[257,t-3,0];case 4===t:return[258,t-4,0];case 5===t:return[259,t-5,0];case 6===t:return[260,t-6,0];case 7===t:return[261,t-7,0];case 8===t:return[262,t-8,0];case 9===t:return[263,t-9,0];case 10===t:return[264,t-10,0];case 12>=t:return[265,t-11,1];case 14>=t:return[266,t-13,1];case 16>=t:return[267,t-15,1];case 18>=t:return[268,t-17,1];case 22>=t:return[269,t-19,2];case 26>=t:return[270,t-23,2];case 30>=t:return[271,t-27,2];case 34>=t:return[272,t-31,2];case 42>=t:return[273,t-35,3];case 50>=t:return[274,t-43,3];case 58>=t:return[275,t-51,3];case 66>=t:return[276,t-59,3];case 82>=t:return[277,t-67,4];case 98>=t:return[278,t-83,4];case 114>=t:return[279,t-99,4];case 130>=t:return[280,t-115,4];case 162>=t:return[281,t-131,5];case 194>=t:return[282,t-163,5];case 226>=t:return[283,t-195,5];case 257>=t:return[284,t-227,5];case 258===t:return[285,t-258,0];default:throw"invalid length: "+t}}var n,e,r=[];for(n=3;258>=n;n++)e=t(n),r[n]=e[2]<<24|e[1]<<16|e[0];return r}(),R=E?new Uint32Array(D):D,j=[80,75,1,2],L=[80,75,3,4],M=[80,75,5,6];h.prototype.m=function(t,n){n=n||{};var e,i=t.length,a=0;if(E&&t instanceof Array&&(t=new Uint8Array(t)),"number"!=typeof n.compressionMethod&&(n.compressionMethod=8),n.compress)switch(n.compressionMethod){case 0:break;case 8:a=r(t),t=new o(t,n.deflateOption).g(),e=m;break;default:throw Error("unknown compression method:"+n.compressionMethod)}this.files.push({buffer:t,a:n,j:e,r:!1,size:i,h:a})},h.prototype.q=function(t){this.i=t},h.prototype.g=function(){var t,n,e,i,a,s,u,c,f,l,h,g,y,w,b,A,O,T,I,S,x,N,k,_,D=this.files,R=0,F=0;for(x=0,N=D.length;N>x;++x){if(t=D[x],y=t.a.filename?t.a.filename.length:0,w=t.a.comment?t.a.comment.length:0,!t.j)switch(t.h=r(t.buffer),t.a.compressionMethod){case 0:break;case 8:t.buffer=new o(t.buffer,t.a.deflateOption).g(),t.j=m;break;default:throw Error("unknown compression method:"+t.a.compressionMethod)}if(t.a.password!==v||this.i!==v){var U=t.a.password||this.i,C=[305419896,591751049,878082192],P=v,V=v;for(E&&(C=new Uint32Array(C)),P=0,V=U.length;V>P;++P)d(C,255&U[P]);for(S=C,T=t.buffer,E?(I=new Uint8Array(T.length+12),I.set(T,12),T=I):T.unshift(0,0,0,0,0,0,0,0,0,0,0,0),k=0;12>k;++k)T[k]=p(S,11===x?255&t.h:0|256*Math.random());for(_=T.length;_>k;++k)T[k]=p(S,T[k]);t.buffer=T}R+=30+y+t.buffer.length,F+=46+y+w}for(n=new(E?Uint8Array:Array)(R+F+(46+(this.d?this.d.length:0))),e=0,i=R,a=i+F,x=0,N=D.length;N>x;++x){if(t=D[x],y=t.a.filename?t.a.filename.length:0,w=t.a.comment?t.a.comment.length:0,s=e,n[e++]=L[0],n[e++]=L[1],n[e++]=L[2],n[e++]=L[3],n[i++]=j[0],n[i++]=j[1],n[i++]=j[2],n[i++]=j[3],n[i++]=20,n[i++]=t.a.os||0,n[e++]=n[i++]=20,u=n[e++]=n[i++]=0,(t.a.password||this.i)&&(u|=1),n[e++]=n[i++]=255&u,n[e++]=n[i++]=255&u>>8,c=t.a.compressionMethod,n[e++]=n[i++]=255&c,n[e++]=n[i++]=255&c>>8,f=t.a.date||new Date,n[e++]=n[i++]=0|((7&f.getMinutes())<<5|f.getSeconds()/2),n[e++]=n[i++]=f.getHours()<<3|f.getMinutes()>>3,n[e++]=n[i++]=(7&f.getMonth()+1)<<5|f.getDate(),n[e++]=n[i++]=(127&f.getFullYear()-1980)<<1|f.getMonth()+1>>3,l=t.h,n[e++]=n[i++]=255&l,n[e++]=n[i++]=255&l>>8,n[e++]=n[i++]=255&l>>16,n[e++]=n[i++]=255&l>>24,h=t.buffer.length,n[e++]=n[i++]=255&h,n[e++]=n[i++]=255&h>>8,n[e++]=n[i++]=255&h>>16,n[e++]=n[i++]=255&h>>24,g=t.size,n[e++]=n[i++]=255&g,n[e++]=n[i++]=255&g>>8,n[e++]=n[i++]=255&g>>16,n[e++]=n[i++]=255&g>>24,n[e++]=n[i++]=255&y,n[e++]=n[i++]=255&y>>8,n[e++]=n[i++]=0,n[e++]=n[i++]=0,n[i++]=255&w,n[i++]=255&w>>8,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=255&s,n[i++]=255&s>>8,n[i++]=255&s>>16,n[i++]=255&s>>24,b=t.a.filename)if(E)n.set(b,e),n.set(b,i),e+=y,i+=y;else for(k=0;y>k;++k)n[e++]=n[i++]=b[k];if(A=t.a.extraField)if(E)n.set(A,e),n.set(A,i),e+=0,i+=0;else for(k=0;w>k;++k)n[e++]=n[i++]=A[k];if(O=t.a.comment)if(E)n.set(O,i),i+=w;else for(k=0;w>k;++k)n[i++]=O[k];if(E)n.set(t.buffer,e),e+=t.buffer.length;else for(k=0,_=t.buffer.length;_>k;++k)n[e++]=t.buffer[k]}if(n[a++]=M[0],n[a++]=M[1],n[a++]=M[2],n[a++]=M[3],n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=255&N,n[a++]=255&N>>8,n[a++]=255&N,n[a++]=255&N>>8,n[a++]=255&F,n[a++]=255&F>>8,n[a++]=255&F>>16,n[a++]=255&F>>24,n[a++]=255&R,n[a++]=255&R>>8,n[a++]=255&R>>16,n[a++]=255&R>>24,w=this.d?this.d.length:0,n[a++]=255&w,n[a++]=255&w>>8,this.d)if(E)n.set(this.d,a);else for(k=0,_=w;_>k;++k)n[a++]=this.d[k];return n},t("Zlib.Zip",h),t("Zlib.Zip.prototype.addFile",h.prototype.m),t("Zlib.Zip.prototype.compress",h.prototype.g),t("Zlib.Zip.prototype.setPassword",h.prototype.q),g("Zlib.Zip.CompressionMethod",{STORE:0,DEFLATE:8}),g("Zlib.Zip.OperatingSystem",{MSDOS:0,UNIX:3,MACINTOSH:7})}).call(e),function(){"use strict";function t(t){throw t}function n(t,n){var e=t.split("."),r=g;!(e[0]in r)&&r.execScript&&r.execScript("var "+e[0]);for(var i;e.length&&(i=e.shift());)e.length||n===d?r=r[i]?r[i]:r[i]={}:r[i]=n}function e(t){var n,e,r,i,o,a,s,u,c,f,l=t.length,h=0,p=Number.POSITIVE_INFINITY;for(u=0;l>u;++u)t[u]>h&&(h=t[u]),p>t[u]&&(p=t[u]);for(n=1<<h,e=new(v?Uint32Array:Array)(n),r=1,i=0,o=2;h>=r;){for(u=0;l>u;++u)if(t[u]===r){for(a=0,s=i,c=0;r>c;++c)a=a<<1|1&s,s>>=1;for(f=r<<16|u,c=a;n>c;c+=o)e[c]=f;++i}++r,i<<=1,o<<=1}return[e,h,p]}function r(n,e){switch(this.l=[],this.m=32768,this.d=this.f=this.c=this.t=0,this.input=v?new Uint8Array(n):n,this.u=!1,this.n=S,this.L=!1,(e||!(e={}))&&(e.index&&(this.c=e.index),e.bufferSize&&(this.m=e.bufferSize),e.bufferType&&(this.n=e.bufferType),e.resize&&(this.L=e.resize)),this.n){case I:this.a=32768,this.b=new(v?Uint8Array:Array)(32768+this.m+258);break;case S:this.a=0,this.b=new(v?Uint8Array:Array)(this.m),this.e=this.X,this.B=this.S,this.q=this.W;break;default:t(Error("invalid inflate mode"))}}function i(n,e){for(var r,i=n.f,o=n.d,a=n.input,s=n.c,u=a.length;e>o;)s>=u&&t(Error("input buffer is broken")),i|=a[s++]<<o,o+=8;return r=i&(1<<e)-1,n.f=i>>>e,n.d=o-e,n.c=s,r}function o(t,n){for(var e,r,i=t.f,o=t.d,a=t.input,s=t.c,u=a.length,c=n[0],f=n[1];f>o&&!(s>=u);)i|=a[s++]<<o,o+=8;return e=c[i&(1<<f)-1],r=e>>>16,t.f=i>>r,t.d=o-r,t.c=s,65535&e}function a(t){function n(t,n,e){var r,a,s,u=this.K;for(s=0;t>s;)switch(r=o(this,n)){case 16:for(a=3+i(this,2);a--;)e[s++]=u;break;case 17:for(a=3+i(this,3);a--;)e[s++]=0;u=0;break;case 18:for(a=11+i(this,7);a--;)e[s++]=0;u=0;break;default:u=e[s++]=r}return this.K=u,e}var r,a,s,u,c=i(t,5)+257,f=i(t,5)+1,l=i(t,4)+4,h=new(v?Uint8Array:Array)(_.length);for(u=0;l>u;++u)h[_[u]]=i(t,3);if(!v)for(u=l,l=h.length;l>u;++u)h[_[u]]=0;r=e(h),a=new(v?Uint8Array:Array)(c),s=new(v?Uint8Array:Array)(f),t.K=0,t.q(e(n.call(t,c,r,a)),e(n.call(t,f,r,s)))}function s(t){t=t||{},this.files=[],this.v=t.comment}function u(t,n){n=n||{},this.input=v&&t instanceof Array?new Uint8Array(t):t,this.c=0,this.ca=n.verify||!1,this.j=n.password}function c(t,n){this.input=t,this.offset=n}function f(t,n){this.input=t,this.offset=n}function l(n){var e,r,i,o,a=[],s={};if(!n.i){if(n.o===d){var u,f=n.input;if(!n.D)t:{var l,h=n.input;for(l=h.length-12;l>0;--l)if(h[l]===H[0]&&h[l+1]===H[1]&&h[l+2]===H[2]&&h[l+3]===H[3]){n.D=l;break t}t(Error("End of Central Directory Record not found"))}u=n.D,(f[u++]!==H[0]||f[u++]!==H[1]||f[u++]!==H[2]||f[u++]!==H[3])&&t(Error("invalid signature")),n.ia=f[u++]|f[u++]<<8,n.ka=f[u++]|f[u++]<<8,n.la=f[u++]|f[u++]<<8,n.ba=f[u++]|f[u++]<<8,n.R=(f[u++]|f[u++]<<8|f[u++]<<16|f[u++]<<24)>>>0,n.o=(f[u++]|f[u++]<<8|f[u++]<<16|f[u++]<<24)>>>0,n.w=f[u++]|f[u++]<<8,n.v=v?f.subarray(u,u+n.w):f.slice(u,u+n.w)}for(e=n.o,i=0,o=n.ba;o>i;++i)r=new c(n.input,e),r.parse(),e+=r.length,a[i]=r,s[r.filename]=i;n.R<e-n.o&&t(Error("invalid file header size")),n.i=a,n.G=s}}function h(t,n,e){return e^=t.s(n),t.k(n,e),e}var p,d=void 0,g=this,v="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;new(v?Uint8Array:Array)(256);var m;for(m=0;256>m;++m)for(var y=m,E=7,y=y>>>1;y;y>>>=1)--E;var w,b=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],A=v?new Uint32Array(b):b,O=[];for(w=0;288>w;w++)switch(!0){case 143>=w:O.push([w+48,8]);break;case 255>=w:O.push([w-144+400,9]);break;case 279>=w:O.push([w-256+0,7]);break;case 287>=w:O.push([w-280+192,8]);break;default:t("invalid literal: "+w)}var T=function(){function n(n){switch(!0){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}();v&&new Uint32Array(T);var I=0,S=1;r.prototype.r=function(){for(;!this.u;){var n=i(this,3);switch(1&n&&(this.u=!0),n>>>=1){case 0:var e=this.input,r=this.c,o=this.b,s=this.a,u=e.length,c=d,f=d,l=o.length,h=d;switch(this.d=this.f=0,r+1>=u&&t(Error("invalid uncompressed block header: LEN")),c=e[r++]|e[r++]<<8,r+1>=u&&t(Error("invalid uncompressed block header: NLEN")),f=e[r++]|e[r++]<<8,c===~f&&t(Error("invalid uncompressed block header: length verify")),r+c>e.length&&t(Error("input buffer is broken")),this.n){case I:for(;s+c>o.length;){if(h=l-s,c-=h,v)o.set(e.subarray(r,r+h),s),s+=h,r+=h;else for(;h--;)o[s++]=e[r++];this.a=s,o=this.e(),s=this.a}break;case S:for(;s+c>o.length;)o=this.e({H:2});break;default:t(Error("invalid inflate mode"))}if(v)o.set(e.subarray(r,r+c),s),s+=c,r+=c;else for(;c--;)o[s++]=e[r++];this.c=r,this.a=s,this.b=o;break;case 1:this.q(z,W);break;case 2:a(this);break;default:t(Error("unknown BTYPE: "+n))}}return this.B()};var x,N,k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_=v?new Uint16Array(k):k,D=[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],R=v?new Uint16Array(D):D,j=[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],L=v?new Uint8Array(j):j,M=[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],F=v?new Uint16Array(M):M,U=[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],C=v?new Uint8Array(U):U,P=new(v?Uint8Array:Array)(288);for(x=0,N=P.length;N>x;++x)P[x]=143>=x?8:255>=x?9:279>=x?7:8;var V,B,z=e(P),Y=new(v?Uint8Array:Array)(30);for(V=0,B=Y.length;B>V;++V)Y[V]=5;var W=e(Y);p=r.prototype,p.q=function(t,n){var e=this.b,r=this.a;this.C=t;for(var a,s,u,c,f=e.length-258;256!==(a=o(this,t));)if(256>a)r>=f&&(this.a=r,e=this.e(),r=this.a),e[r++]=a;else for(s=a-257,c=R[s],L[s]>0&&(c+=i(this,L[s])),a=o(this,n),u=F[a],C[a]>0&&(u+=i(this,C[a])),r>=f&&(this.a=r,e=this.e(),r=this.a);c--;)e[r]=e[r++-u];for(;this.d>=8;)this.d-=8,this.c--;this.a=r},p.W=function(t,n){var e=this.b,r=this.a;this.C=t;for(var a,s,u,c,f=e.length;256!==(a=o(this,t));)if(256>a)r>=f&&(e=this.e(),f=e.length),e[r++]=a;else for(s=a-257,c=R[s],L[s]>0&&(c+=i(this,L[s])),a=o(this,n),u=F[a],C[a]>0&&(u+=i(this,C[a])),r+c>f&&(e=this.e(),f=e.length);c--;)e[r]=e[r++-u];for(;this.d>=8;)this.d-=8,this.c--;this.a=r},p.e=function(){var t,n,e=new(v?Uint8Array:Array)(this.a-32768),r=this.a-32768,i=this.b;if(v)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.t+=e.length,v)i.set(i.subarray(r,r+32768));else for(t=0;32768>t;++t)i[t]=i[r+t];return this.a=32768,i},p.X=function(t){var n,e,r,i,o=0|this.input.length/this.c+1,a=this.input,s=this.b;return t&&("number"==typeof t.H&&(o=t.H),"number"==typeof t.Q&&(o+=t.Q)),2>o?(e=(a.length-this.c)/this.C[2],i=0|258*(e/2),r=s.length>i?s.length+i:s.length<<1):r=s.length*o,v?(n=new Uint8Array(r),n.set(s)):n=s,this.b=n},p.B=function(){var t,n,e,r,i,o=0,a=this.b,s=this.l,u=new(v?Uint8Array:Array)(this.t+(this.a-32768));if(0===s.length)return v?this.b.subarray(32768,this.a):this.b.slice(32768,this.a);for(n=0,e=s.length;e>n;++n)for(t=s[n],r=0,i=t.length;i>r;++r)u[o++]=t[r];for(n=32768,e=this.a;e>n;++n)u[o++]=a[n];return this.l=[],this.buffer=u},p.S=function(){var t,n=this.a;return v?this.L?(t=new Uint8Array(n),t.set(this.b.subarray(0,n))):t=this.b.subarray(0,n):(this.b.length>n&&(this.b.length=n),t=this.b),this.buffer=t},s.prototype.M=function(t){this.j=t},s.prototype.s=function(t){var n=2|65535&t[2];return 255&n*(1^n)>>8},s.prototype.k=function(t,n){t[0]=(A[255&(t[0]^n)]^t[0]>>>8)>>>0,t[1]=(6681*(20173*(t[1]+(255&t[0]))>>>0)>>>0)+1>>>0,t[2]=(A[255&(t[2]^t[1]>>>24)]^t[2]>>>8)>>>0},s.prototype.U=function(t){var n,e,r=[305419896,591751049,878082192];for(v&&(r=new Uint32Array(r)),n=0,e=t.length;e>n;++n)this.k(r,255&t[n]);return r};var X={P:0,N:8},q=[80,75,1,2],Z=[80,75,3,4],H=[80,75,5,6];c.prototype.parse=function(){var n=this.input,e=this.offset;(n[e++]!==q[0]||n[e++]!==q[1]||n[e++]!==q[2]||n[e++]!==q[3])&&t(Error("invalid file header signature")),this.version=n[e++],this.ja=n[e++],this.$=n[e++]|n[e++]<<8,this.I=n[e++]|n[e++]<<8,this.A=n[e++]|n[e++]<<8,this.time=n[e++]|n[e++]<<8,this.V=n[e++]|n[e++]<<8,this.p=(n[e++]|n[e++]<<8|n[e++]<<16|n[e++]<<24)>>>0,this.z=(n[e++]|n[e++]<<8|n[e++]<<16|n[e++]<<24)>>>0,this.J=(n[e++]|n[e++]<<8|n[e++]<<16|n[e++]<<24)>>>0,this.h=n[e++]|n[e++]<<8,this.g=n[e++]|n[e++]<<8,this.F=n[e++]|n[e++]<<8,this.fa=n[e++]|n[e++]<<8,this.ha=n[e++]|n[e++]<<8,this.ga=n[e++]|n[e++]<<8|n[e++]<<16|n[e++]<<24,this.aa=(n[e++]|n[e++]<<8|n[e++]<<16|n[e++]<<24)>>>0,this.filename=String.fromCharCode.apply(null,v?n.subarray(e,e+=this.h):n.slice(e,e+=this.h)),this.Y=v?n.subarray(e,e+=this.g):n.slice(e,e+=this.g),this.v=v?n.subarray(e,e+this.F):n.slice(e,e+this.F),this.length=e-this.offset};var J={O:1,da:8,ea:2048};f.prototype.parse=function(){var n=this.input,e=this.offset;(n[e++]!==Z[0]||n[e++]!==Z[1]||n[e++]!==Z[2]||n[e++]!==Z[3])&&t(Error("invalid local file header signature")),this.$=n[e++]|n[e++]<<8,this.I=n[e++]|n[e++]<<8,this.A=n[e++]|n[e++]<<8,this.time=n[e++]|n[e++]<<8,this.V=n[e++]|n[e++]<<8,this.p=(n[e++]|n[e++]<<8|n[e++]<<16|n[e++]<<24)>>>0,this.z=(n[e++]|n[e++]<<8|n[e++]<<16|n[e++]<<24)>>>0,this.J=(n[e++]|n[e++]<<8|n[e++]<<16|n[e++]<<24)>>>0,this.h=n[e++]|n[e++]<<8,this.g=n[e++]|n[e++]<<8,this.filename=String.fromCharCode.apply(null,v?n.subarray(e,e+=this.h):n.slice(e,e+=this.h)),this.Y=v?n.subarray(e,e+=this.g):n.slice(e,e+=this.g),this.length=e-this.offset},p=u.prototype,p.Z=function(){var t,n,e,r=[];for(this.i||l(this),e=this.i,t=0,n=e.length;n>t;++t)r[t]=e[t].filename;return r},p.r=function(n,e){var i;this.G||l(this),i=this.G[n],i===d&&t(Error(n+" not found"));var o;o=e||{};var a,s,u,c,p,g,m,y,E=this.input,w=this.i;if(w||l(this),w[i]===d&&t(Error("wrong index")),s=w[i].aa,a=new f(this.input,s),a.parse(),s+=a.length,u=a.z,0!==(a.I&J.O)){for(!o.password&&!this.j&&t(Error("please set password")),g=this.T(o.password||this.j),m=s,y=s+12;y>m;++m)h(this,g,E[m]);for(s+=12,u-=12,m=s,y=s+u;y>m;++m)E[m]=h(this,g,E[m])}switch(a.A){case X.P:c=v?this.input.subarray(s,s+u):this.input.slice(s,s+u);break;case X.N:c=new r(this.input,{index:s,bufferSize:a.J}).r();break;default:t(Error("unknown compression type"))}if(this.ca){var b,O=d,T="number"==typeof O?O:O=0,I=c.length;for(b=-1,T=7&I;T--;++O)b=b>>>8^A[255&(b^c[O])];for(T=I>>3;T--;O+=8)b=b>>>8^A[255&(b^c[O])],b=b>>>8^A[255&(b^c[O+1])],b=b>>>8^A[255&(b^c[O+2])],b=b>>>8^A[255&(b^c[O+3])],b=b>>>8^A[255&(b^c[O+4])],b=b>>>8^A[255&(b^c[O+5])],b=b>>>8^A[255&(b^c[O+6])],b=b>>>8^A[255&(b^c[O+7])];p=(4294967295^b)>>>0,a.p!==p&&t(Error("wrong crc: file=0x"+a.p.toString(16)+", data=0x"+p.toString(16)))}return c},p.M=function(t){this.j=t},p.k=s.prototype.k,p.T=s.prototype.U,p.s=s.prototype.s,n("Zlib.Unzip",u),n("Zlib.Unzip.prototype.decompress",u.prototype.r),n("Zlib.Unzip.prototype.getFilenames",u.prototype.Z),n("Zlib.Unzip.prototype.setPassword",u.prototype.M)}.call(e),n.exports=e.Zlib},{}],7:[function(t,n){function e(){}var r=n.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(n){var e=[];return window.addEventListener("message",function(t){var n=t.source;if((n===window||null===n)&&"process-tick"===t.data&&(t.stopPropagation(),e.length>0)){var r=e.shift();r()}},!0),function(t){e.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=e,r.addListener=e,r.once=e,r.off=e,r.removeListener=e,r.removeAllListeners=e,r.emit=e,r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],8:[function(t,n){var e="READ",r="WRITE",i="CREATE",o="EXCLUSIVE",a="TRUNCATE",s="APPEND",u="CREATE",c="REPLACE";n.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",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:e,O_WRITE:r,O_CREATE:i,O_EXCLUSIVE:o,O_TRUNCATE:a,O_APPEND:s,O_FLAGS:{r:[e],"r+":[e,r],w:[r,i,a],"w+":[r,e,i,a],wx:[r,i,o,a],"wx+":[r,e,i,o,a],a:[r,i,s],"a+":[r,e,i,s],ax:[r,i,o,s],"ax+":[r,e,i,o,s]},XATTR_CREATE:u,XATTR_REPLACE:c,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""}}},{}],9:[function(t,n){var e=t("./constants.js").MODE_FILE;n.exports=function(t,n){this.id=t,this.type=n||e}},{"./constants.js":8}],10:[function(t,n){var e={};["-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(t){function n(t){this.message=t||o}t=t.split(":");var r=t[0],i=t[1],o=t[2],a=n.prototype=Error();a.errno=r,a.code=i,a.constructor=n,e[i]=e[r]=n}),n.exports=e},{}],11:[function(t,n){function e(t){return function(n,e){n?t(n):t(null,e)}}function r(t,n,e,r,i){function o(e){t.changes.push({event:"change",path:n}),i(e)}var a=t.flags;pn(a).contains(Pn)&&delete r.ctime,pn(a).contains(Cn)&&delete r.mtime;var s=!1;r.ctime&&(e.ctime=r.ctime,e.atime=r.ctime,s=!0),r.atime&&(e.atime=r.atime,s=!0),r.mtime&&(e.mtime=r.mtime,s=!0),s?t.put(e.id,e,o):o()}function i(t,n,e,i){function a(e,r){e?i(e):r.mode!==Tn?i(new Vn.ENOTDIR("a component of the path prefix is not a directory")):(l=r,o(t,n,s))}function s(n,e){!n&&e?i(new Vn.EEXIST("path name already exists")):!n||n instanceof Vn.ENOENT?t.get(l.data,u):i(n)}function u(n,r){n?i(n):(h=r,p=new Wn(void 0,e),p.nlinks+=1,t.put(p.id,p,f))}function c(n){if(n)i(n);else{var e=Date.now();r(t,g,p,{mtime:e,ctime:e},i)}}function f(n){n?i(n):(h[d]=new Bn(p.id,e),t.put(l.data,h,c))}if(e!==Tn&&e!==On)return i(new Vn.EINVAL("mode must be a directory or file"));n=mn(n);var l,h,p,d=En(n),g=yn(n);o(t,g,a)}function o(t,n,e){function r(n,r){n?e(n):r&&r.mode===Sn&&r.rnode?t.get(r.rnode,i):e(new Vn.EFILESYSTEMERROR)}function i(t,n){t?e(t):n?e(null,n):e(new Vn.ENOENT)}function a(n,r){n?e(n):r.mode===Tn&&r.data?t.get(r.data,s):e(new Vn.ENOTDIR("a component of the path prefix is not a directory"))}function s(n,r){if(n)e(n);else if(pn(r).has(f)){var i=r[f].id;t.get(i,u)}else e(new Vn.ENOENT)}function u(t,n){t?e(t):n.mode==In?(h++,h>kn?e(new Vn.ELOOP):c(n.data)):e(null,n)}function c(n){n=mn(n),l=yn(n),f=En(n),xn==f?t.get(Nn,r):o(t,l,a)}if(n=mn(n),!n)return e(new Vn.ENOENT("path is an empty string"));var f=En(n),l=yn(n),h=0;xn==f?t.get(Nn,r):o(t,l,a)}function a(t,n,e,i,a,s){function u(n,o){function u(n){n?s(n):r(t,c,o,{ctime:Date.now()},s)}o?o.xattrs[e]:null,n?s(n):a===Fn&&o.xattrs.hasOwnProperty(e)?s(new Vn.EEXIST("attribute already exists")):a!==Un||o.xattrs.hasOwnProperty(e)?(o.xattrs[e]=i,t.put(o.id,o,u)):s(new Vn.ENOATTR)}var c;"string"==typeof n?(c=n,o(t,n,u)):"object"==typeof n&&"string"==typeof n.id?(c=n.path,t.get(n.id,u)):s(new Vn.EINVAL("path or file descriptor of wrong type"))}function s(t,n){function e(e,i){!e&&i?n(new Vn.EEXIST):!e||e instanceof Vn.ENOENT?(o=new Yn,t.put(o.id,o,r)):n(e)}function r(e){e?n(e):(a=new Wn(o.rnode,Tn),a.nlinks+=1,t.put(a.id,a,i))}function i(e){e?n(e):(s={},t.put(a.data,s,n))}var o,a,s;t.get(Nn,e)}function u(t,n,e){function i(n,r){!n&&r?e(new Vn.EEXIST):!n||n instanceof Vn.ENOENT?o(t,v,a):e(n)}function a(n,r){n?e(n):(p=r,t.get(p.data,s))}function s(n,r){n?e(n):(d=r,l=new Wn(void 0,Tn),l.nlinks+=1,t.put(l.id,l,u))}function u(n){n?e(n):(h={},t.put(l.data,h,f))}function c(n){if(n)e(n);else{var i=Date.now();r(t,v,p,{mtime:i,ctime:i},e)}}function f(n){n?e(n):(d[g]=new Bn(l.id,Tn),t.put(p.data,d,c))}n=mn(n);var l,h,p,d,g=En(n),v=yn(n);o(t,n,i)}function c(t,n,e){function i(n,r){n?e(n):(g=r,t.get(g.data,a))}function a(n,r){n?e(n):xn==m?e(new Vn.EBUSY):pn(r).has(m)?(v=r,p=v[m].id,t.get(p,s)):e(new Vn.ENOENT)}function s(n,r){n?e(n):r.mode!=Tn?e(new Vn.ENOTDIR):(p=r,t.get(p.data,u))}function u(t,n){t?e(t):(d=n,pn(d).size()>0?e(new Vn.ENOTEMPTY):f())}function c(n){if(n)e(n);else{var i=Date.now();r(t,y,g,{mtime:i,ctime:i},l)}}function f(){delete v[m],t.put(g.data,v,c)}function l(n){n?e(n):t.delete(p.id,h)}function h(n){n?e(n):t.delete(p.data,e)}n=mn(n);var p,d,g,v,m=En(n),y=yn(n);o(t,y,i)}function f(t,n,e,i){function a(n,e){n?i(n):(v=e,t.get(v.data,s))}function s(n,r){n?i(n):(m=r,pn(m).has(b)?pn(e).contains(jn)?i(new Vn.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists")):(y=m[b],y.type==Tn&&pn(e).contains(Dn)?i(new Vn.EISDIR("the named file is a directory and O_WRITE is set")):t.get(y.id,u)):pn(e).contains(Rn)?l():i(new Vn.ENOENT("O_CREATE is not set and the named file does not exist")))}function u(t,n){if(t)i(t);else{var e=n;e.mode==In?(O++,O>kn?i(new Vn.ELOOP):c(e.data)):f(void 0,e)}}function c(r){r=mn(r),A=yn(r),b=En(r),xn==b&&(pn(e).contains(Dn)?i(new Vn.EISDIR("the named file is a directory and O_WRITE is set")):o(t,n,f)),o(t,A,a)}function f(t,n){t?i(t):(E=n,i(null,E))}function l(){E=new Wn(void 0,On),E.nlinks+=1,t.put(E.id,E,h)}function h(n){n?i(n):(w=new Uint8Array(0),t.put(E.data,w,d))}function p(n){if(n)i(n);else{var e=Date.now();r(t,A,v,{mtime:e,ctime:e},g)}}function d(n){n?i(n):(m[b]=new Bn(E.id,On),t.put(v.data,m,p))}function g(t){t?i(t):i(null,E)}n=mn(n);var v,m,y,E,w,b=En(n),A=yn(n),O=0;xn==b?pn(e).contains(Dn)?i(new Vn.EISDIR("the named file is a directory and O_WRITE is set")):o(t,n,f):o(t,A,a)}function l(t,n,e,i,o,a){function s(t){t?a(t):a(null,o)}function u(e){if(e)a(e);else{var i=Date.now();r(t,n.path,l,{mtime:i,ctime:i},s)}}function c(n){n?a(n):t.put(l.id,l,u)}function f(r,s){if(r)a(r);else{l=s;var u=new Uint8Array(o),f=e.subarray(i,i+o);u.set(f),n.position=o,l.size=o,l.version+=1,t.put(l.data,u,c)}}var l;t.get(n.id,f)}function h(t,n,e,i,o,a,s){function u(t){t?s(t):s(null,o)}function c(e){if(e)s(e);else{var i=Date.now();r(t,n.path,p,{mtime:i,ctime:i},u)}}function f(n){n?s(n):t.put(p.id,p,c)}function l(r,u){if(r)s(r);else{d=u;var c=void 0!==a&&null!==a?a:n.position,l=Math.max(d.length,c+o),h=new Uint8Array(l);d&&h.set(d);var g=e.subarray(i,i+o);h.set(g,c),void 0===a&&(n.position+=o),p.size=l,p.version+=1,t.put(p.data,h,f)}}function h(n,e){n?s(n):(p=e,t.get(p.data,l))}var p,d;t.get(n.id,h)}function p(t,n,e,r,i,o,a){function s(t,s){if(t)a(t);else{f=s;var u=void 0!==o&&null!==o?o:n.position;i=u+i>e.length?i-u:i;var c=f.subarray(u,u+i);e.set(c,r),void 0===o&&(n.position+=i),a(null,i)}}function u(n,e){n?a(n):(c=e,t.get(c.data,s))}var c,f;t.get(n.id,u)}function d(t,n,r){n=mn(n),En(n),o(t,n,e(r))}function g(t,n,r){t.get(n.id,e(r))}function v(t,n,r){function i(n,e){n?r(n):(s=e,t.get(s.data,a))}function a(n,i){n?r(n):(u=i,pn(u).has(c)?t.get(u[c].id,e(r)):r(new Vn.ENOENT("a component of the path does not name an existing file")))}n=mn(n);var s,u,c=En(n),f=yn(n);xn==c?o(t,n,e(r)):o(t,f,i)}function m(t,n,e,i){function a(n){n?i(n):r(t,e,E,{ctime:Date.now()},i)}function s(n,e){n?i(n):(E=e,E.nlinks+=1,t.put(E.id,E,a))}function u(n){n?i(n):t.get(y[w].id,s)}function c(n,e){n?i(n):(y=e,pn(y).has(w)?i(new Vn.EEXIST("newpath resolves to an existing file")):(y[w]=v[p],t.put(m.data,y,u)))}function f(n,e){n?i(n):(m=e,t.get(m.data,c))}function l(n,e){n?i(n):(v=e,pn(v).has(p)?o(t,b,f):i(new Vn.ENOENT("a component of either path prefix does not exist")))}function h(n,e){n?i(n):(g=e,t.get(g.data,l))}n=mn(n);var p=En(n),d=yn(n);e=mn(e);var g,v,m,y,E,w=En(e),b=yn(e);o(t,d,h)}function y(t,n,e){function i(n){n?e(n):(delete l[p],t.put(f.data,l,function(){var n=Date.now();r(t,d,f,{mtime:n,ctime:n},e)}))}function a(n){n?e(n):t.delete(h.data,i)}function s(o,s){o?e(o):(h=s,h.nlinks-=1,1>h.nlinks?t.delete(h.id,a):t.put(h.id,h,function(){r(t,n,h,{ctime:Date.now()},i)
}))}function u(n,r){n?e(n):(l=r,pn(l).has(p)?t.get(l[p].id,s):e(new Vn.ENOENT("a component of the path does not name an existing file")))}function c(n,r){n?e(n):(f=r,t.get(f.data,u))}n=mn(n);var f,l,h,p=En(n),d=yn(n);o(t,d,c)}function E(t,n,e){function r(t,n){if(t)e(t);else{s=n;var r=Object.keys(s);e(null,r)}}function i(n,i){n?e(n):(a=i,t.get(a.data,r))}n=mn(n),En(n);var a,s;o(t,n,i)}function w(t,n,e,i){function a(n,e){n?i(n):(l=e,t.get(l.data,s))}function s(t,n){t?i(t):(h=n,pn(h).has(d)?i(new Vn.EEXIST):u())}function u(){p=new Wn(void 0,In),p.nlinks+=1,p.size=n.length,p.data=n,t.put(p.id,p,f)}function c(n){if(n)i(n);else{var e=Date.now();r(t,g,l,{mtime:e,ctime:e},i)}}function f(n){n?i(n):(h[d]=new Bn(p.id,In),t.put(l.data,h,c))}e=mn(e);var l,h,p,d=En(e),g=yn(e);xn==d?i(new Vn.EEXIST):o(t,g,a)}function b(t,n,e){function r(n,r){n?e(n):(s=r,t.get(s.data,i))}function i(n,r){n?e(n):(u=r,pn(u).has(c)?t.get(u[c].id,a):e(new Vn.ENOENT("a component of the path does not name an existing file")))}function a(t,n){t?e(t):n.mode!=In?e(new Vn.EINVAL("path not a symbolic link")):e(null,n.data)}n=mn(n);var s,u,c=En(n),f=yn(n);o(t,f,r)}function A(t,n,e,i){function a(n,e){n?i(n):e.mode==Tn?i(new Vn.EISDIR):(f=e,t.get(f.data,s))}function s(n,r){if(n)i(n);else{var o=new Uint8Array(e);r&&o.set(r.subarray(0,e)),t.put(f.data,o,c)}}function u(e){if(e)i(e);else{var o=Date.now();r(t,n,f,{mtime:o,ctime:o},i)}}function c(n){n?i(n):(f.size=e,f.version+=1,t.put(f.id,f,u))}n=mn(n);var f;0>e?i(new Vn.EINVAL("length cannot be negative")):o(t,n,a)}function O(t,n,e,i){function o(n,e){n?i(n):e.mode==Tn?i(new Vn.EISDIR):(c=e,t.get(c.data,a))}function a(n,r){if(n)i(n);else{var o=new Uint8Array(e);r&&o.set(r.subarray(0,e)),t.put(c.data,o,u)}}function s(e){if(e)i(e);else{var o=Date.now();r(t,n.path,c,{mtime:o,ctime:o},i)}}function u(n){n?i(n):(c.size=e,c.version+=1,t.put(c.id,c,s))}var c;0>e?i(new Vn.EINVAL("length cannot be negative")):t.get(n.id,o)}function T(t,n,e,i,a){function s(o,s){o?a(o):r(t,n,s,{atime:e,ctime:i,mtime:i},a)}n=mn(n),"number"!=typeof e||"number"!=typeof i?a(new Vn.EINVAL("atime and mtime must be number")):0>e||0>i?a(new Vn.EINVAL("atime and mtime must be positive integers")):o(t,n,s)}function I(t,n,e,i,o){function a(a,s){a?o(a):r(t,n.path,s,{atime:e,ctime:i,mtime:i},o)}"number"!=typeof e||"number"!=typeof i?o(new Vn.EINVAL("atime and mtime must be a number")):0>e||0>i?o(new Vn.EINVAL("atime and mtime must be positive integers")):t.get(n.id,a)}function S(t,n,e,r,i,o){n=mn(n),"string"!=typeof e?o(new Vn.EINVAL("attribute name must be a string")):e?null!==i&&i!==Fn&&i!==Un?o(new Vn.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):a(t,n,e,r,i,o):o(new Vn.EINVAL("attribute name cannot be an empty string"))}function x(t,n,e,r,i,o){"string"!=typeof e?o(new Vn.EINVAL("attribute name must be a string")):e?null!==i&&i!==Fn&&i!==Un?o(new Vn.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):a(t,n,e,r,i,o):o(new Vn.EINVAL("attribute name cannot be an empty string"))}function N(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 Vn.ENOATTR)}n=mn(n),"string"!=typeof e?r(new Vn.EINVAL("attribute name must be a string")):e?o(t,n,i):r(new Vn.EINVAL("attribute name cannot be an empty string"))}function k(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 Vn.ENOATTR)}"string"!=typeof e?r(new Vn.EINVAL):e?t.get(n.id,i):r(new Vn.EINVAL("attribute name cannot be an empty string"))}function _(t,n,e,i){function a(o,a){function s(e){e?i(e):r(t,n,a,{ctime:Date.now()},i)}var u=a?a.xattrs:null;o?i(o):u.hasOwnProperty(e)?(delete a.xattrs[e],t.put(a.id,a,s)):i(new Vn.ENOATTR)}n=mn(n),"string"!=typeof e?i(new Vn.EINVAL("attribute name must be a string")):e?o(t,n,a):i(new Vn.EINVAL("attribute name cannot be an empty string"))}function D(t,n,e,i){function o(o,a){function s(e){e?i(e):r(t,n.path,a,{ctime:Date.now()},i)}o?i(o):a.xattrs.hasOwnProperty(e)?(delete a.xattrs[e],t.put(a.id,a,s)):i(new Vn.ENOATTR)}"string"!=typeof e?i(new Vn.EINVAL("attribute name must be a string")):e?t.get(n.id,o):i(new Vn.EINVAL("attribute name cannot be an empty string"))}function R(t){return pn(Mn).has(t)?Mn[t]:null}function j(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 L(t,n){var e;return bn(t)?e=Error("Path must be a string without null bytes."):wn(t)||(e=Error("Path must be absolute.")),e?(n(e),!1):!0}function M(t,n,e,r,i,o){function a(n,i){if(n)o(n);else{var a;a=pn(r).contains(Ln)?i.size:0;var s=new zn(e,i.id,r,a),u=t.allocDescriptor(s);o(null,u)}}o=arguments[arguments.length-1],L(e,o)&&(r=R(r),r||o(new Vn.EINVAL("flags is not valid")),f(n,e,r,a))}function F(t,n,e,r){pn(t.openFiles).has(e)?(t.releaseDescriptor(e),r(null)):r(new Vn.EBADF)}function U(t,n,e,r,o){L(e,o)&&i(n,e,r,o)}function C(t,n,r,i,o){o=arguments[arguments.length-1],L(r,o)&&u(n,r,e(o))}function P(t,n,r,i){L(r,i)&&c(n,r,e(i))}function V(t,n,e,r){function i(n,e){if(n)r(n);else{var i=new Xn(e,t.name);r(null,i)}}L(e,r)&&d(n,e,i)}function B(t,n,e,r){function i(n,e){if(n)r(n);else{var i=new Xn(e,t.name);r(null,i)}}var o=t.openFiles[e];o?g(n,o,i):r(new Vn.EBADF)}function z(t,n,r,i,o){L(r,o)&&L(i,o)&&m(n,r,i,e(o))}function Y(t,n,r,i){L(r,i)&&y(n,r,e(i))}function W(t,n,r,i,o,a,s,u){function c(t,n){u(t,n||0,i)}o=void 0===o?0:o,a=void 0===a?i.length-o:a,u=arguments[arguments.length-1];var f=t.openFiles[r];f?pn(f.flags).contains(_n)?p(n,f,i,o,a,s,e(c)):u(new Vn.EBADF("descriptor does not permit reading")):u(new Vn.EBADF)}function X(t,n,e,r,i){if(i=arguments[arguments.length-1],r=j(r,null,"r"),L(e,i)){var o=R(r.flag||"r");o||i(new Vn.EINVAL("flags is not valid")),f(n,e,o,function(a,s){if(a)return i(a);var u=new zn(e,s.id,o,0),c=t.allocDescriptor(u);g(n,u,function(e,o){if(e)return i(e);var a=new Xn(o,t.name),s=a.size,f=new Uint8Array(s);p(n,u,f,0,s,0,function(n){if(n)return i(n);t.releaseDescriptor(c);var e;e="utf8"===r.encoding?new dn("utf-8").decode(f):f,i(null,e)})})})}}function q(t,n,r,i,o,a,s,u){u=arguments[arguments.length-1],o=void 0===o?0:o,a=void 0===a?i.length-o:a;var c=t.openFiles[r];c?pn(c.flags).contains(Dn)?a>i.length-o?u(new Vn.EIO("intput buffer is too small")):h(n,c,i,o,a,s,e(u)):u(new Vn.EBADF("descriptor does not permit writing")):u(new Vn.EBADF)}function Z(t,n,e,r,i,o){if(o=arguments[arguments.length-1],i=j(i,"utf8","w"),L(e,o)){var a=R(i.flag||"w");a||o(new Vn.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=new gn("utf-8").encode(r)),f(n,e,a,function(i,s){if(i)return o(i);var u=new zn(e,s.id,a,0),c=t.allocDescriptor(u);l(n,u,r,0,r.length,function(n){return n?o(n):(t.releaseDescriptor(c),o(null),void 0)})})}}function H(t,n,e,r,i,o){if(o=arguments[arguments.length-1],i=j(i,"utf8","a"),L(e,o)){var a=R(i.flag||"a");a||o(new Vn.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=new gn("utf-8").encode(r)),f(n,e,a,function(i,s){if(i)return o(i);var u=new zn(e,s.id,a,s.size),c=t.allocDescriptor(u);h(n,u,r,0,r.length,u.position,function(n){return n?o(n):(t.releaseDescriptor(c),o(null),void 0)})})}}function J(t,n,e,r){function i(t){r(t?!1:!0)}V(t,n,e,i)}function G(t,n,r,i,o){L(r,o)&&N(n,r,i,e(o))}function Q(t,n,r,i,o){var a=t.openFiles[r];a?k(n,a,i,e(o)):o(new Vn.EBADF)}function K(t,n,r,i,o,a,s){"function"==typeof a&&(s=a,a=null),L(r,s)&&S(n,r,i,o,a,e(s))}function $(t,n,r,i,o,a,s){"function"==typeof a&&(s=a,a=null);var u=t.openFiles[r];u?pn(u.flags).contains(Dn)?x(n,u,i,o,a,e(s)):s(new Vn.EBADF("descriptor does not permit writing")):s(new Vn.EBADF)}function tn(t,n,r,i,o){L(r,o)&&_(n,r,i,e(o))}function nn(t,n,r,i,o){var a=t.openFiles[r];a?pn(a.flags).contains(Dn)?D(n,a,i,e(o)):o(new Vn.EBADF("descriptor does not permit writing")):o(new Vn.EBADF)}function en(t,n,e,r,i,o){function a(t,n){t?o(t):0>n.size+r?o(new Vn.EINVAL("resulting file offset would be negative")):(s.position=n.size+r,o(null,s.position))}var s=t.openFiles[e];s||o(new Vn.EBADF),"SET"===i?0>r?o(new Vn.EINVAL("resulting file offset would be negative")):(s.position=r,o(null,s.position)):"CUR"===i?0>s.position+r?o(new Vn.EINVAL("resulting file offset would be negative")):(s.position+=r,o(null,s.position)):"END"===i?g(n,s,a):o(new Vn.EINVAL("whence argument is not a proper value"))}function rn(t,n,r,i){L(r,i)&&E(n,r,e(i))}function on(t,n,r,i,o,a){if(L(r,a)){var s=Date.now();i=i?i:s,o=o?o:s,T(n,r,i,o,e(a))}}function an(t,n,r,i,o,a){var s=Date.now();i=i?i:s,o=o?o:s;var u=t.openFiles[r];u?pn(u.flags).contains(Dn)?I(n,u,i,o,e(a)):a(new Vn.EBADF("descriptor does not permit writing")):a(new Vn.EBADF)}function sn(t,n,r,i,o){function a(t){t?o(t):y(n,r,e(o))}L(r,o)&&L(i,o)&&m(n,r,i,a)}function un(t,n,r,i,o,a){a=arguments[arguments.length-1],L(r,a)&&L(i,a)&&w(n,r,i,e(a))}function cn(t,n,r,i){L(r,i)&&b(n,r,e(i))}function fn(t,n,e,r){function i(n,e){if(n)r(n);else{var i=new Xn(e,t.name);r(null,i)}}L(e,r)&&v(n,e,i)}function ln(t,n,r,i,o){o=arguments[arguments.length-1],i=i||0,L(r,o)&&A(n,r,i,e(o))}function hn(t,n,r,i,o){o=arguments[arguments.length-1],i=i||0;var a=t.openFiles[r];a?pn(a.flags).contains(Dn)?O(n,a,i,e(o)):o(new Vn.EBADF("descriptor does not permit writing")):o(new Vn.EBADF)}var pn=t("../../lib/nodash.js"),dn=t("../../lib/encoding.js").TextDecoder,gn=t("../../lib/encoding.js").TextEncoder,vn=t("../path.js"),mn=vn.normalize,yn=vn.dirname,En=vn.basename,wn=vn.isAbsolute,bn=vn.isNull,An=t("../constants.js"),On=An.MODE_FILE,Tn=An.MODE_DIRECTORY,In=An.MODE_SYMBOLIC_LINK,Sn=An.MODE_META,xn=An.ROOT_DIRECTORY_NAME,Nn=An.SUPER_NODE_ID,kn=An.SYMLOOP_MAX,_n=An.O_READ,Dn=An.O_WRITE,Rn=An.O_CREATE,jn=An.O_EXCLUSIVE;An.O_TRUNCATE;var Ln=An.O_APPEND,Mn=An.O_FLAGS,Fn=An.XATTR_CREATE,Un=An.XATTR_REPLACE,Cn=An.FS_NOMTIME,Pn=An.FS_NOCTIME,Vn=t("../errors.js"),Bn=t("../directory-entry.js"),zn=t("../open-file-description.js"),Yn=t("../super-node.js"),Wn=t("../node.js"),Xn=t("../stats.js");n.exports={makeRootDirectory:s,open:M,close:F,mknod:U,mkdir:C,rmdir:P,unlink:Y,stat:V,fstat:B,link:z,read:W,readFile:X,write:q,writeFile:Z,appendFile:H,exists:J,getxattr:G,fgetxattr:Q,setxattr:K,fsetxattr:$,removexattr:tn,fremovexattr:nn,lseek:en,readdir:rn,utimes:on,futimes:an,rename:sn,symlink:un,readlink:cn,lstat:fn,truncate:ln,ftruncate:hn}},{"../../lib/encoding.js":2,"../../lib/nodash.js":5,"../constants.js":8,"../directory-entry.js":9,"../errors.js":10,"../node.js":16,"../open-file-description.js":17,"../path.js":18,"../stats.js":26,"../super-node.js":27}],12:[function(t,n){function e(t){return"function"==typeof t?t:function(t){if(t)throw t}}function r(t,n){function e(){N.forEach(function(t){t.call(this)}.bind(I)),N=null}function r(t){if(t.length){var n=g.getInstance();t.forEach(function(t){n.emit(t.event,t.path)})}}t=t||{},n=n||a;var s=t.flags,d=t.provider||new p.Default(t.name||u),O=t.name||d.name,T=i(s).contains(c),I=this;I.readyState=l,I.name=O,I.error=null,I.stdin=y,I.stdout=E,I.stderr=w;var S={},x=b;Object.defineProperty(this,"openFiles",{get:function(){return S}}),this.allocDescriptor=function(t){var n=x++;return S[n]=t,n},this.releaseDescriptor=function(t){delete S[t]};var N=[];this.queueOrRun=function(t){var n;return f==I.readyState?t.call(I):h==I.readyState?n=new m.EFILESYSTEMERROR("unknown error"):N.push(t),n},this.watch=function(t,n,e){if(o(t))throw Error("Path must be a string without null bytes.");"function"==typeof n&&(e=n,n={}),n=n||{},e=e||a;var r=new v;return r.start(t,!1,n.recursive),r.on("change",e),r},d.open(function(t,i){function o(t){function i(t){var n=d[t]();return n.flags=s,n.changes=[],n.close=function(){var t=n.changes;r(t),t.length=0},n}I.provider={openReadWriteContext:function(){return i("getReadWriteContext")},openReadOnlyContext:function(){return i("getReadOnlyContext")}},t?I.readyState=h:(I.readyState=f,e()),n(t,I)}if(t)return o(t);if(!T&&!i)return o(null);var a=d.getReadWriteContext();a.clear(function(t){return t?(o(t),void 0):(A.makeRootDirectory(a,o),void 0)})})}var i=t("../../lib/nodash.js"),o=t("../path.js").isNull,a=t("../shared.js").nop,s=t("../constants.js"),u=s.FILE_SYSTEM_NAME,c=s.FS_FORMAT,f=s.FS_READY,l=s.FS_PENDING,h=s.FS_ERROR,p=t("../providers/index.js"),d=t("../shell/shell.js"),g=t("../../lib/intercom.js"),v=t("../fs-watcher.js"),m=t("../errors.js"),y=s.STDIN,E=s.STDOUT,w=s.STDERR,b=s.FIRST_DESCRIPTOR,A=t("./implementation.js");r.providers=p,["open","close","mknod","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){r.prototype[t]=function(){var n=this,r=Array.prototype.slice.call(arguments,0),i=r.length-1,o="function"!=typeof r[i],a=e(r[i]),s=n.queueOrRun(function(){function e(){s.close(),a.apply(n,arguments)}var s=n.provider.openReadWriteContext();o?r.push(e):r[i]=e;var u=[n,s].concat(r);A[t].apply(null,u)});s&&a(s)}}),r.prototype.Shell=function(t){return new d(this,t)},n.exports=r},{"../../lib/intercom.js":4,"../../lib/nodash.js":5,"../constants.js":8,"../errors.js":10,"../fs-watcher.js":13,"../path.js":18,"../providers/index.js":19,"../shared.js":23,"../shell/shell.js":25,"./implementation.js":11}],13:[function(t,n){function e(){function t(t){(n===t||a&&0===t.indexOf(n+"/"))&&e.trigger("change","change",t)}r.call(this);var n,e=this,a=!1;e.start=function(e,r,s){if(!n){if(i(e))throw Error("Path must be a string without null bytes.");n=e,a=s===!0;var u=o.getInstance();u.on("change",t)}},e.close=function(){var n=o.getInstance();n.off("change",t),e.removeAllListeners("change")}}var r=t("../lib/eventemitter.js"),i=t("./path.js").isNull,o=t("../lib/intercom.js");e.prototype=new r,e.prototype.constructor=e,n.exports=e},{"../lib/eventemitter.js":3,"../lib/intercom.js":4,"./path.js":18}],14:[function(t,n){n.exports={FileSystem:t("./filesystem/interface.js"),Path:t("./path.js"),Errors:t("./errors.js")}},{"./errors.js":10,"./filesystem/interface.js":12,"./path.js":18}],15:[function(t,n){function e(t,n){var e=new XMLHttpRequest;e.onload=function(){var t=200!=e.status?{message:e.statusText,code:e.status}:null,r=t?null:new Uint8Array(e.response);n(t,r)},e.open("GET",t),"withCredentials"in e&&(e.withCredentials=!0),e.responseType="arraybuffer",e.send()}function r(n,e){t("request")({url:n,method:"GET",encoding:null},function(t,n,r){var i,o,a,s=null,u=r&&r.length;if(n=n||null,o=n&&n.statusCode,a=200!=o?{message:t||"Not found!",code:o}:null)return e(a,null);if(i=u&&new ArrayBuffer(u),i&&200==o){s=new Uint8Array(i);for(var c=0;r.length>c;++c)s[c]=r[c]}e(null,s)})}n.exports.download=function(){return"undefined"==typeof XMLHttpRequest?r:e}()},{}],16:[function(t,n){var e=t("./constants.js").MODE_FILE,r=t("./shared.js").guid;n.exports=function(t,n,i,o,a,s,u,c,f,l){var h=Date.now();this.id=t||r(),this.mode=n||e,this.size=i||0,this.atime=o||h,this.ctime=a||h,this.mtime=s||h,this.flags=u||[],this.xattrs=c||{},this.nlinks=f||0,this.version=l||0,this.blksize=void 0,this.nblocks=1,this.data=r()}},{"./constants.js":8,"./shared.js":23}],17:[function(t,n){n.exports=function(t,n,e,r){this.path=t,this.id=n,this.flags=e,this.position=r}},{}],18:[function(t,n,e){function r(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 i(){for(var t="",n=!1,e=arguments.length-1;e>=-1&&!n;e--){var i=e>=0?arguments[e]:"/";"string"==typeof i&&i&&(t=i+"/"+t,n="/"===i.charAt(0))}return t=r(t.split("/").filter(function(t){return!!t}),!n).join("/"),(n?"/":"")+t||"."}function o(t){var n="/"===t.charAt(0);return"/"===t.substr(-1),t=r(t.split("/").filter(function(t){return!!t}),!n).join("/"),t||n||(t="."),(n?"/":"")+t}function a(){var t=Array.prototype.slice.call(arguments,0);return o(t.filter(function(t){return t&&"string"==typeof t}).join("/"))}function s(t,n){function r(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=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,u=0;a>u;u++)if(i[u]!==o[u]){s=u;break}for(var c=[],u=s;i.length>u;u++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")}function u(t){var n=d(t),e=n[0],r=n[1];return e||r?(r&&(r=r.substr(0,r.length-1)),e+r):"."}function c(t,n){var e=d(t)[2];return n&&e.substr(-1*n.length)===n&&(e=e.substr(0,e.length-n.length)),""===e?"/":e}function f(t){return d(t)[3]}function l(t){return"/"===t.charAt(0)?!0:!1}function h(t){return-1!==(""+t).indexOf("\0")?!0:!1}var p=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,d=function(t){var n=p.exec(t);return[n[1]||"",n[2]||"",n[3]||"",n[4]||""]};n.exports={normalize:o,resolve:i,join:a,relative:s,sep:"/",delimiter:":",dirname:u,basename:c,extname:f,isAbsolute:l,isNull:h}},{}],19:[function(t,n){var e=t("./indexeddb.js"),r=t("./websql.js"),i=t("./memory.js");n.exports={IndexedDB:e,WebSQL:r,Memory:i,Default:e,Fallback:function(){function t(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return e.isSupported()?e:r.isSupported()?r:(t.isSupported=function(){return!1},t)}()}},{"./indexeddb.js":20,"./memory.js":21,"./websql.js":22}],20:[function(t,n){(function(e){function r(t,n){var e=t.transaction(a,n);this.objectStore=e.objectStore(a)}function i(t){this.name=t||o,this.db=null}var o=t("../constants.js").FILE_SYSTEM_NAME,a=t("../constants.js").FILE_STORE_NAME,s=t("../constants.js").IDB_RW;t("../constants.js").IDB_RO;var u=t("../errors.js"),c=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB;r.prototype.clear=function(t){try{var n=this.objectStore.clear();n.onsuccess=function(){t()},n.onerror=function(n){t(n)}}catch(e){t(e)}},r.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)}},r.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)}},r.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)}},i.isSupported=function(){return!!c},i.prototype.open=function(t){var n=this;if(n.db)return t(null,!1),void 0;var e=!1,r=c.open(n.name);r.onupgradeneeded=function(t){var n=t.target.result;n.objectStoreNames.contains(a)&&n.deleteObjectStore(a),n.createObjectStore(a),e=!0},r.onsuccess=function(r){n.db=r.target.result,t(null,e)},r.onerror=function(){t(new u.EINVAL("IndexedDB cannot be accessed. If private browsing is enabled, disable it."))}},i.prototype.getReadOnlyContext=function(){return new r(this.db,s)},i.prototype.getReadWriteContext=function(){return new r(this.db,s)},n.exports=i})(this)},{"../constants.js":8,"../errors.js":10}],21:[function(t,n){function e(t,n){this.readOnly=n,this.objectStore=t}function r(t){this.name=t||i}var i=t("../constants.js").FILE_SYSTEM_NAME,o=t("../../lib/async.js").nextTick,a=function(){var t={};return function(n){var e=!t.hasOwnProperty(n);return e&&(t[n]={}),{firstAccess:e,db:t[n]}}}();e.prototype.clear=function(t){if(this.readOnly)return o(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]}),o(t)},e.prototype.get=function(t,n){var e=this;o(function(){n(null,e.objectStore[t])})},e.prototype.put=function(t,n,e){return this.readOnly?(o(function(){e("[MemoryContext] Error: write operation on read only context")}),void 0):(this.objectStore[t]=n,o(e),void 0)},e.prototype.delete=function(t,n){return this.readOnly?(o(function(){n("[MemoryContext] Error: write operation on read only context")}),void 0):(delete this.objectStore[t],o(n),void 0)},r.isSupported=function(){return!0},r.prototype.open=function(t){var n=a(this.name);this.db=n.db,o(function(){t(null,n.firstAccess)})},r.prototype.getReadOnlyContext=function(){return new e(this.db,!0)},r.prototype.getReadWriteContext=function(){return new e(this.db,!1)},n.exports=r},{"../../lib/async.js":1,"../constants.js":8}],22:[function(t,n){(function(e){function r(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 i(t){this.name=t||o,this.db=null}var o=t("../constants.js").FILE_SYSTEM_NAME,a=t("../constants.js").FILE_STORE_NAME,s=t("../constants.js").WSQL_VERSION,u=t("../constants.js").WSQL_SIZE,c=t("../constants.js").WSQL_DESC,f=t("../shared.js").u8toArray,l=t("../errors.js");r.prototype.clear=function(t){function n(n,e){t(e)}function e(){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+a+";",[],e,n)})},r.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 "+a+" WHERE id = ?;",[t],e,r)})},r.prototype.put=function(t,n,e){function r(){e(null)}function i(t,n){e(n)}"[object Uint8Array]"===Object.prototype.toString.call(n)&&(n={__isUint8Array:!0,__array:f(n)}),n=JSON.stringify(n),this.getTransaction(function(e){e.executeSql("INSERT OR REPLACE INTO "+a+" (id, data) VALUES (?, ?);",[t,n],r,i)})},r.prototype.delete=function(t,n){function e(){n(null)}function r(t,e){n(e)}this.getTransaction(function(n){n.executeSql("DELETE FROM "+a+" WHERE id = ?;",[t],e,r)})},i.isSupported=function(){return!!e.openDatabase},i.prototype.open=function(t){function n(n,e){5===e.code&&t(new l.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),t(e)}function r(n){function e(n,e){var r=0===e.rows.item(0).count;t(null,r)}function r(n,e){t(e)}i.db=o,n.executeSql("SELECT COUNT(id) AS count FROM "+a+";",[],e,r)}var i=this;if(i.db)return t(null,!1),void 0;var o=e.openDatabase(i.name,s,c,u);return o?(o.transaction(function(t){function e(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+a+"_id"+" on "+a+" (id);",[],r,n)}t.executeSql("CREATE TABLE IF NOT EXISTS "+a+" (id unique, data TEXT);",[],e,n)}),void 0):(t("[WebSQL] Unable to open database."),void 0)},i.prototype.getReadOnlyContext=function(){return new r(this.db,!0)},i.prototype.getReadWriteContext=function(){return new r(this.db,!1)},n.exports=i})(this)},{"../constants.js":8,"../errors.js":10,"../shared.js":23}],23:[function(t,n){function e(){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 r(){}function i(t){for(var n=[],e=t.length,r=0;e>r;r++)n[r]=t[r];return n}n.exports={guid:e,u8toArray:i,nop:r}},{}],24:[function(t,n){var e=t("../constants.js").ENVIRONMENT;n.exports=function(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}}},{"../constants.js":8}],25:[function(t,n){function e(t,n){n=n||{};var e=new o(n.env),a="/";Object.defineProperty(this,"fs",{get:function(){return t},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return e},enumerable:!0}),this.cd=function(n,e){n=r.resolve(this.cwd,n),t.stat(n,function(t,r){return t?(e(new i.ENOTDIR),void 0):("DIRECTORY"===r.type?(a=n,e()):e(new i.ENOTDIR),void 0)})},this.pwd=function(){return a}}var r=t("../path.js"),i=t("../errors.js"),o=t("./environment.js"),a=t("../../lib/async.js"),s=t("../network.js"),u=t("../../lib/zip-utils.js"),c=t("../../lib/encoding.js").TextEncoder;e.prototype.exec=function(t,n,e){var i=this.fs;"function"==typeof n&&(e=n,n=[]),n=n||[],e=e||function(){},t=r.resolve(this.cwd,t),i.readFile(t,"utf8",function(t,r){if(t)return e(t),void 0;try{var o=Function("fs","args","callback",r);o(i,n,e)}catch(a){e(a)}})},e.prototype.touch=function(t,n,e){function i(t){a.writeFile(t,"",e)}function o(t){var r=Date.now(),i=n.date||r,o=n.date||r;a.utimes(t,i,o,e)}var a=this.fs;"function"==typeof n&&(e=n,n={}),n=n||{},e=e||function(){},t=r.resolve(this.cwd,t),a.stat(t,function(r){r?n.updateOnly===!0?e():i(t):o(t)})},e.prototype.cat=function(t,n){function e(t,n){var e=r.resolve(this.cwd,t);o.readFile(e,"utf8",function(t,e){return t?(n(t),void 0):(s+=e+"\n",n(),void 0)})}var o=this.fs,s="";return n=n||function(){},t?(t="string"==typeof t?[t]:t,a.eachSeries(t,e,function(t){t?n(t):n(null,s.replace(/\n$/,""))}),void 0):(n(new i.EINVAL("Missing files argument")),void 0)},e.prototype.ls=function(t,n,e){function o(t,e){var i=r.resolve(this.cwd,t),u=[];s.readdir(i,function(t,c){function f(t,e){t=r.join(i,t),s.stat(t,function(a,s){if(a)return e(a),void 0;var c={path:r.basename(t),links:s.nlinks,size:s.size,modified:s.mtime,type:s.type};n.recursive&&"DIRECTORY"===s.type?o(r.join(i,c.path),function(t,n){return t?(e(t),void 0):(c.contents=n,u.push(c),e(),void 0)}):(u.push(c),e())})}return t?(e(t),void 0):(a.each(c,f,function(t){e(t,u)}),void 0)})}var s=this.fs;return"function"==typeof n&&(e=n,n={}),n=n||{},e=e||function(){},t?(o(t,e),void 0):(e(new i.EINVAL("Missing dir argument")),void 0)},e.prototype.rm=function(t,n,e){function o(t,e){t=r.resolve(this.cwd,t),s.stat(t,function(u,c){return u?(e(u),void 0):"FILE"===c.type?(s.unlink(t,e),void 0):(s.readdir(t,function(u,c){return u?(e(u),void 0):0===c.length?(s.rmdir(t,e),void 0):n.recursive?(c=c.map(function(n){return r.join(t,n)}),a.each(c,o,function(n){return n?(e(n),void 0):(s.rmdir(t,e),void 0)}),void 0):(e(new i.ENOTEMPTY),void 0)}),void 0)})}var s=this.fs;return"function"==typeof n&&(e=n,n={}),n=n||{},e=e||function(){},t?(o(t,e),void 0):(e(new i.EINVAL("Missing path argument")),void 0)},e.prototype.tempDir=function(t){var n=this.fs,e=this.env.get("TMP");t=t||function(){},n.mkdir(e,function(){t(null,e)})},e.prototype.mkdirp=function(t,n){function e(t,n){o.stat(t,function(a,s){if(s){if(s.isDirectory())return n(),void 0;if(s.isFile())return n(new i.ENOTDIR),void 0}else{if(a&&"ENOENT"!==a.code)return n(a),void 0;var u=r.dirname(t);"/"===u?o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(n(t),void 0):(n(),void 0)}):e(u,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):(e(t,n),void 0):(n(new i.EINVAL("Missing path argument")),void 0)},e.prototype.wget=function(t,n,e){function o(){e(Error("unable to get resource"))}var a=this.fs;if("function"==typeof n&&(e=n,n={}),n=n||{},e=e||function(){},!t)return e(new i.EINVAL("missing url argument")),void 0;var u=n.filename||t.split("/").pop();u=r.resolve(a.cwd,u),s.download(t,function(t,n){return t||!n?o():(a.writeFile(u,n,function(t){t?e(t):e(null,u)}),void 0)})},e.prototype.unzip=function(t,n,e){var o=this.fs,s=this;if("function"==typeof n&&(e=n,n={}),n=n||{},e=e||function(){},!t)return e(new i.EINVAL("missing zipfile argument")),void 0;var c=r.resolve(this.cwd,t),f=r.resolve(n.destination||this.cwd);o.readFile(c,function(t,n){function i(t,n){var e=c.decompress(t.zipFilename);t.isDirectory?s.mkdirp(t.fsFilename,n):o.writeFile(t.fsFilename,e,n)}if(t)return e(t);var c=new u.Unzip(n),l=c.getFilenames().map(function(t){return{zipFilename:t,fsFilename:r.join(f,t),isDirectory:/\/$/.test(t)}});a.eachSeries(l,i,e)})},e.prototype.zip=function(t,n,e,o){function s(t){return new c("utf8").encode(t)}function f(t,n){p.readFile(t,function(e,r){if(e)return n(e);var i=t.replace(/^\//,"");g.addFile(r,{filename:s(i)}),n()})}function l(t,n){p.readdir(t,function(i,o){g.addFile([],{filename:s(t+"/"),compressionMethod:u.Zip.CompressionMethod.STORE}),e.recursive||n(),a.eachSeries(o,function(n,e){h(r.join(t,n),e)},n)})}function h(t,n){t=r.resolve(d.cwd,t),p.stat(t,function(e,r){return e?n(e):(r.isDirectory()?l(t,n):f(t,n),void 0)})}var p=this.fs,d=this;if("function"==typeof e&&(o=e,e={}),e=e||{},o=o||function(){},!t)return o(new i.EINVAL("missing zipfile argument")),void 0;if(!n)return o(new i.EINVAL("missing paths argument")),void 0;"string"==typeof n&&(n=[n]),t=r.resolve(this.cwd,t);var g=new u.Zip;p.stat(t,function(e,r){return r?o(new i.EEXIST("zipfile already exists")):(a.eachSeries(n,h,function(n){if(n)return o(n);var e=g.compress();p.writeFile(t,e,o)}),void 0)})},n.exports=e},{"../../lib/async.js":1,"../../lib/encoding.js":2,"../../lib/zip-utils.js":6,"../errors.js":10,"../network.js":15,"../path.js":18,"./environment.js":24}],26:[function(t,n){function e(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}var r=t("./constants.js");e.prototype.isFile=function(){return this.type===r.MODE_FILE},e.prototype.isDirectory=function(){return this.type===r.MODE_DIRECTORY},e.prototype.isSymbolicLink=function(){return this.type===r.MODE_SYMBOLIC_LINK},e.prototype.isSocket=e.prototype.isFIFO=e.prototype.isCharacterDevice=e.prototype.isBlockDevice=function(){return!1},n.exports=e},{"./constants.js":8}],27:[function(t,n){var e=t("./constants.js"),r=t("./shared.js").guid;n.exports=function(t,n,i){var o=Date.now();this.id=e.SUPER_NODE_ID,this.mode=e.MODE_META,this.atime=t||o,this.ctime=n||o,this.mtime=i||o,this.rnode=r()}},{"./constants.js":8,"./shared.js":23}]},{},[14])(14)});