filer/dist/filer.min.js

6 lines
131 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! filer 0.0.9 2014-06-09 */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Filer=t()}}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[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=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;r.length>a;a++)i(r[a]);return i}({1:[function(e,n){(function(e){(function(){function r(t){var e=!1;return function(){if(e)throw Error("Callback was already called.");e=!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,e){if(t.forEach)return t.forEach(e);for(var n=0;t.length>n;n+=1)e(t[n],n,t)},u=function(t,e){if(t.map)return t.map(e);var n=[];return s(t,function(t,r,i){n.push(e(t,r,i))}),n},c=function(t,e,n){return t.reduce?t.reduce(e,n):(s(t,function(t,r,i){n=e(n,t,r,i)}),n)},f=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e};void 0!==e&&e.nextTick?(a.nextTick=e.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,e,n){if(n=n||function(){},!t.length)return n();var i=0;s(t,function(o){e(o,r(function(e){e?(n(e),n=function(){}):(i+=1,i>=t.length&&n(null))}))})},a.forEach=a.each,a.eachSeries=function(t,e,n){if(n=n||function(){},!t.length)return n();var r=0,i=function(){e(t[r],function(e){e?(n(e),n=function(){}):(r+=1,r>=t.length?n(null):i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,e,n,r){var i=l(e);i.apply(null,[t,n,r])},a.forEachLimit=a.eachLimit;var l=function(t){return function(e,n,r){if(r=r||function(){},!e.length||0>=t)return r();var i=0,o=0,a=0;(function s(){if(i>=e.length)return r();for(;t>a&&e.length>o;)o+=1,a+=1,n(e[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=e.length?r():s())})})()}},d=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[a.each].concat(e))}},h=function(t,e){return function(){var n=Array.prototype.slice.call(arguments);return e.apply(null,[l(t)].concat(n))}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[a.eachSeries].concat(e))}},m=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n,r){i[t.index]=r,e(n)})},function(t){r(t,i)})};a.map=d(m),a.mapSeries=p(m),a.mapLimit=function(t,e,n,r){return g(e)(t,n,r)};var g=function(t){return h(t,m)};a.reduce=function(t,e,n,r){a.eachSeries(t,function(t,r){n(e,t,function(t,n){e=n,r(t)})},function(t){r(t,e)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,e,n,r){var i=u(t,function(t){return t}).reverse();a.reduce(i,e,n,r)},a.foldr=a.reduceRight;var v=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n&&i.push(t),e()})},function(){r(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};a.filter=d(v),a.filterSeries=p(v),a.select=a.filter,a.selectSeries=a.filterSeries;var _=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n||i.push(t),e()})},function(){r(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};a.reject=d(_),a.rejectSeries=p(_);var y=function(t,e,n,r){t(e,function(t,e){n(t,function(n){n?(r(t),r=function(){}):e()})},function(){r()})};a.detect=d(y),a.detectSeries=p(y),a.some=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t&&(n(!0),n=function(){}),r()})},function(){n(!1)})},a.any=a.some,a.every=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t||(n(!1),n=function(){}),r()})},function(){n(!0)})},a.all=a.every,a.sortBy=function(t,e,n){a.map(t,function(t,n){e(t,function(e,r){e?n(e):n(null,{value:t,criteria:r})})},function(t,e){if(t)return n(t);var r=function(t,e){var n=t.criteria,r=e.criteria;return r>n?-1:n>r?1:0};n(null,u(e.sort(r),function(t){return t.value}))})},a.auto=function(t,e){e=e||function(){};var n=f(t);if(!n.length)return e(null);var r={},i=[],o=function(t){i.unshift(t)},u=function(t){for(var e=0;i.length>e;e+=1)if(i[e]===t)return i.splice(e,1),void 0},l=function(){s(i.slice(0),function(t){t()})};o(function(){f(r).length===n.length&&(e(null,r),e=function(){})}),s(n,function(n){var i=t[n]instanceof Function?[t[n]]:t[n],d=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[n]=i,e(t,o),e=function(){}}else r[n]=i,a.setImmediate(l)},h=i.slice(0,Math.abs(i.length-1))||[],p=function(){return c(h,function(t,e){return t&&r.hasOwnProperty(e)},!0)&&!r.hasOwnProperty(n)};if(p())i[i.length-1](d,r);else{var m=function(){p()&&(u(m),i[i.length-1](d,r))};o(m)}})},a.waterfall=function(t,e){if(e=e||function(){},t.constructor!==Array){var n=Error("First argument to waterfall must be an array of functions");return e(n)}if(!t.length)return e();var r=function(t){return function(n){if(n)e.apply(null,arguments),e=function(){};else{var i=Array.prototype.slice.call(arguments,1),o=t.next();o?i.push(r(o)):i.push(e),a.setImmediate(function(){t.apply(null,i)})}}};r(a.iterator(t))()};var b=function(t,e,n){if(n=n||function(){},e.constructor===Array)t.map(e,function(t,e){t&&t(function(t){var n=Array.prototype.slice.call(arguments,1);1>=n.length&&(n=n[0]),e.call(null,t,n)})},n);else{var r={};t.each(f(e),function(t,n){e[t](function(e){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),r[t]=i,n(e)})},function(t){n(t,r)})}};a.parallel=function(t,e){b({map:a.map,each:a.each},t,e)},a.parallelLimit=function(t,e,n){b({map:g(e),each:l(e)},t,n)},a.series=function(t,e){if(e=e||function(){},t.constructor===Array)a.mapSeries(t,function(t,e){t&&t(function(t){var n=Array.prototype.slice.call(arguments,1);1>=n.length&&(n=n[0]),e.call(null,t,n)})},e);else{var n={};a.eachSeries(f(t),function(e,r){t[e](function(t){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),n[e]=i,r(t)})},function(t){e(t,n)})}},a.iterator=function(t){var e=function(n){var r=function(){return t.length&&t[n].apply(null,arguments),r.next()};return r.next=function(){return t.length-1>n?e(n+1):null},r};return e(0)},a.apply=function(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e.concat(Array.prototype.slice.call(arguments)))}};var w=function(t,e,n,r){var i=[];t(e,function(t,e){n(t,function(t,n){i=i.concat(n||[]),e(t)})},function(t){r(t,i)})};a.concat=d(w),a.concatSeries=p(w),a.whilst=function(t,e,n){t()?e(function(r){return r?n(r):(a.whilst(t,e,n),void 0)}):n()},a.doWhilst=function(t,e,n){t(function(r){return r?n(r):(e()?a.doWhilst(t,e,n):n(),void 0)})},a.until=function(t,e,n){t()?n():e(function(r){return r?n(r):(a.until(t,e,n),void 0)})},a.doUntil=function(t,e,n){t(function(r){return r?n(r):(e()?n():a.doUntil(t,e,n),void 0)})},a.queue=function(t,e){function n(t,n,r,i){n.constructor!==Array&&(n=[n]),s(n,function(n){var o={data:n,callback:"function"==typeof i?i:null};r?t.tasks.unshift(o):t.tasks.push(o),t.saturated&&t.tasks.length===e&&t.saturated(),a.setImmediate(t.process)})}void 0===e&&(e=1);var i=0,o={tasks:[],concurrency:e,saturated:null,empty:null,drain:null,push:function(t,e){n(o,t,!1,e)},unshift:function(t,e){n(o,t,!0,e)},process:function(){if(o.concurrency>i&&o.tasks.length){var e=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),i+=1;var n=function(){i-=1,e.callback&&e.callback.apply(e,arguments),o.drain&&0===o.tasks.length+i&&o.drain(),o.process()},a=r(n);t(e.data,a)}},length:function(){return o.tasks.length},running:function(){return i}};return o},a.cargo=function(t,e){var n=!1,r=[],i={tasks:r,payload:e,saturated:null,empty:null,drain:null,push:function(t,n){t.constructor!==Array&&(t=[t]),s(t,function(t){r.push({data:t,callback:"function"==typeof n?n:null}),i.saturated&&r.length===e&&i.saturated()}),a.setImmediate(i.process)},process:function o(){if(!n){if(0===r.length)return i.drain&&i.drain(),void 0;var a="number"==typeof e?r.splice(0,e):r.splice(0),c=u(a,function(t){return t.data});i.empty&&i.empty(),n=!0,t(c,function(){n=!1;var t=arguments;s(a,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return r.length},running:function(){return n}};return i};var E=function(t){return function(e){var n=Array.prototype.slice.call(arguments,1);e.apply(null,n.concat([function(e){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&s(n,function(e){console[t](e)}))}]))}};a.log=E("log"),a.dir=E("dir"),a.memoize=function(t,e){var n={},r={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in n?o.apply(null,n[a]):a in r?r[a].push(o):(r[a]=[o],t.apply(null,i.concat([function(){n[a]=arguments;var t=r[a];delete r[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=n,i.unmemoized=t,i},a.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},a.times=function(t,e,n){for(var r=[],i=0;t>i;i++)r.push(i);return a.map(r,e,n)},a.timesSeries=function(t,e,n){for(var r=[],i=0;t>i;i++)r.push(i);return a.mapSeries(r,e,n)},a.compose=function(){var t=Array.prototype.reverse.call(arguments);return function(){var e=this,n=Array.prototype.slice.call(arguments),r=n.pop();a.reduce(t,n,function(t,n,r){n.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);r(t,e)}]))},function(t,n){r.apply(e,[t].concat(n))})}};var x=function(t,e){var n=function(){var n=this,r=Array.prototype.slice.call(arguments),i=r.pop();return t(e,function(t,e){t.apply(n,r.concat([e]))},i)};if(arguments.length>2){var r=Array.prototype.slice.call(arguments,2);return n.apply(this,r)}return n};a.applyEach=d(x),a.applyEachSeries=p(x),a.forever=function(t,e){function n(r){if(r){if(e)return e(r);throw r}t(n)}n()},t!==void 0&&t.amd?t([],function(){return a}):n!==void 0&&n.exports?n.exports=a:i.async=a})()}).call(this,e("FWaASH"))},{FWaASH:6}],2:[function(t,e){function n(t,e){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1);return e}var r=function(){};r.createInterface=function(t){var e={};return e.on=function(e,n){this[t]===void 0&&(this[t]={}),this[t].hasOwnProperty(e)||(this[t][e]=[]),this[t][e].push(n)},e.off=function(e,r){void 0!==this[t]&&this[t].hasOwnProperty(e)&&n(r,this[t][e])},e.trigger=function(e){if(this[t]!==void 0&&this[t].hasOwnProperty(e))for(var n=Array.prototype.slice.call(arguments,1),r=0;this[t][e].length>r;r++)this[t][e][r].apply(this[t][e][r],n)},e.removeAllListeners=function(e){if(void 0!==this[t]){var n=this;n[t][e].forEach(function(t){n.off(e,t)})}},e};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,e.exports=r},{}],3:[function(t,e){function n(t,e){var n=0;return function(){var r=Date.now();r-n>t&&(n=r,e.apply(this,arguments))}}function r(t,e){if(void 0!==t&&t||(t={}),"object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function i(){var t=this,e=Date.now();this.origin=a(),this.lastMessage=e,this.receivedIDs={},this.previousValues={};var n=function(){t._onStorageEvent.apply(t,arguments)};"undefined"!=typeof window&&"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",n):window.addEventListener("storage",n,!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 e(){if(!a){var l=Date.now(),d=0|s.getItem(f);if(d&&r>l-d)return u||(o._on("storage",e),u=!0),c=setTimeout(e,i),void 0;a=!0,s.setItem(f,l),t(),n()}}function n(){u&&o._off("storage",e),c&&clearTimeout(c),s.removeItem(f)}var r=1e3,i=20,o=this,a=!1,u=!1,c=null;e()},i.prototype._cleanup_emit=n(100,function(){var t=this;t._transaction(function(){var t,e=Date.now(),n=e-l,r=0;try{t=JSON.parse(s.getItem(u)||"[]")}catch(i){t=[]}for(var o=t.length-1;o>=0;o--)n>t[o].timestamp&&(t.splice(o,1),r++);r>0&&s.setItem(u,JSON.stringify(t))})}),i.prototype._cleanup_once=n(100,function(){var t=this;t._transaction(function(){var e,n;Date.now();var r=0;try{n=JSON.parse(s.getItem(c)||"{}")}catch(i){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],r++);r>0&&s.setItem(c,JSON.stringify(n))})}),i.prototype._once_expired=function(t,e){if(!e)return!0;if(!e.hasOwnProperty(t))return!0;if("object"!=typeof e[t])return!0;var n=e[t].ttl||d,r=Date.now(),i=e[t].timestamp;return r-n>i},i.prototype._localStorageChanged=function(t,e){if(t&&t.key)return t.key===e;var n=s.getItem(e);return n===this.previousValues[e]?!1:(this.previousValues[e]=n,!0)},i.prototype._onStorageEvent=function(t){t=t||window.event;var e=this;this._localStorageChanged(t,u)&&this._transaction(function(){var t,n=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!==e.origin&&!(t[o].timestamp<e.lastMessage)){if(t[o].id){if(e.receivedIDs.hasOwnProperty(t[o].id))continue;e.receivedIDs[t[o].id]=!0}e.trigger(t[o].name,t[o].payload)}e.lastMessage=n}),this._trigger("storage",t)},i.prototype._emit=function(t,e,n){if(n="string"==typeof n||"number"==typeof n?n+"":null,n&&n.length){if(this.receivedIDs.hasOwnProperty(n))return;this.receivedIDs[n]=!0}var r={id:n,name:t,origin:this.origin,timestamp:Date.now(),payload:e},i=this;this._transaction(function(){var n=s.getItem(u)||"[]",o="[]"===n?"":",";n=[n.substring(0,n.length-1),o,JSON.stringify(r),"]"].join(""),s.setItem(u,n),i.trigger(t,e),setTimeout(function(){i._cleanup_emit()},50)})},i.prototype.emit=function(t,e){this._emit.apply(this,arguments),this._trigger("emit",t,e)},i.prototype.once=function(t,e,n){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 n&&(i[t].ttl=1e3*n),s.setItem(c,JSON.stringify(i)),e(),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,d=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}}(),e.exports=i},{"../src/shared.js":56,"./eventemitter.js":2}],4:[function(t,e){function n(t,e){return m.call(t,e)}function r(t){return null==t?0:t.length===+t.length?t.length:_(t).length}function i(t){return t}function o(t,e,n){var r,i;if(null!=t)if(l&&t.forEach===l)t.forEach(e,n);else if(t.length===+t.length){for(r=0,i=t.length;i>r;r++)if(e.call(n,t[r],r,t)===v)return}else{var o=o(t);for(r=0,i=o.length;i>r;r++)if(e.call(n,t[o[r]],o[r],t)===v)return}}function a(t,e,n){e||(e=i);var r=!1;return null==t?r:h&&t.some===h?t.some(e,n):(o(t,function(t,i,o){return r||(r=e.call(n,t,i,o))?v:void 0}),!!r)}function s(t,e){return null==t?!1:d&&t.indexOf===d?-1!=t.indexOf(e):a(t,function(t){return t===e})}function u(t){this.value=t}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)&&m.call(t,"__wrapped__")?t:new u(t)}var f=Array.prototype,l=f.forEach,d=f.indexOf,h=f.some,p=Object.prototype,m=p.hasOwnProperty,g=Object.keys,v={},_=g||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var r in t)n(t,r)&&e.push(r);return e};u.prototype.has=function(t){return n(this.value,t)},u.prototype.contains=function(t){return s(this.value,t)},u.prototype.size=function(){return r(this.value)},e.exports=c},{}],5:[function(t,e){(function(t){function n(t,e){if("function"!=typeof e)throw Error("Bad callback given: "+e);if(!t)throw Error("No options given");var a=t.onResponse;if(t="string"==typeof t?{uri:t}:JSON.parse(JSON.stringify(t)),t.onResponse=a,t.verbose&&(n.log=o()),t.url&&(t.uri=t.url,delete t.url),!t.uri&&""!==t.uri)throw Error("options.uri is a required argument");if("string"!=typeof t.uri)throw Error("options.uri must be a string");for(var s=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],c=0;s.length>c;c++)if(t[s[c]])throw Error("options."+s[c]+" is not supported");if(t.callback=e,t.method=t.method||"GET",t.headers=t.headers||{},t.body=t.body||null,t.timeout=t.timeout||n.DEFAULT_TIMEOUT,t.headers.host)throw Error("Options.headers.host is not supported");t.json&&(t.headers.accept=t.headers.accept||"application/json","GET"!==t.method&&(t.headers["content-type"]="application/json"),"boolean"!=typeof t.json?t.body=JSON.stringify(t.json):"string"!=typeof t.body&&(t.body=JSON.stringify(t.body)));var f=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")};if(t.qs){var l="string"==typeof t.qs?t.qs:f(t.qs);t.uri=-1!==t.uri.indexOf("?")?t.uri+"&"+l:t.uri+"?"+l}var d=function(t){var e={};e.boundry="-------------------------------"+Math.floor(1e9*Math.random());var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push("--"+e.boundry+"\n"+'Content-Disposition: form-data; name="'+r+'"'+"\n"+"\n"+t[r]+"\n");return n.push("--"+e.boundry+"--"),e.body=n.join(""),e.length=e.body.length,e.type="multipart/form-data; boundary="+e.boundry,e};if(t.form){if("string"==typeof t.form)throw"form name unsupported";if("POST"===t.method){var h=(t.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(t.headers["content-type"]=h,h){case"application/x-www-form-urlencoded":t.body=f(t.form).replace(/%20/g,"+");break;case"multipart/form-data":var p=d(t.form);t.body=p.body,t.headers["content-type"]=p.type;break;default:throw Error("unsupported encoding:"+h)}}}return t.onResponse=t.onResponse||i,t.onResponse===!0&&(t.onResponse=e,t.callback=i),!t.headers.authorization&&t.auth&&(t.headers.authorization="Basic "+u(t.auth.username+":"+t.auth.password)),r(t)}function r(e){function r(){d=!0;var t=Error("ETIMEDOUT");return t.code="ETIMEDOUT",t.duration=e.timeout,n.log.error("Timeout",{id:f._id,milliseconds:e.timeout}),e.callback(t,f)}function i(){if(d)return n.log.debug("Ignoring timed out state change",{state:f.readyState,id:f.id});if(n.log.debug("State change",{state:f.readyState,id:f.id,timed_out:d}),f.readyState===c.OPENED){n.log.debug("Request started",{id:f.id});for(var t in e.headers)f.setRequestHeader(t,e.headers[t])}else f.readyState===c.HEADERS_RECEIVED?o():f.readyState===c.LOADING?(o(),a()):f.readyState===c.DONE&&(o(),a(),u())}function o(){if(!g.response){if(g.response=!0,n.log.debug("Got response",{id:f.id,status:f.status}),clearTimeout(f.timeoutTimer),f.statusCode=f.status,h&&0==f.statusCode){var t=Error("CORS request rejected: "+e.uri);return t.cors="rejected",g.loading=!0,g.end=!0,e.callback(t,f)}e.onResponse(null,f)}}function a(){g.loading||(g.loading=!0,n.log.debug("Response body loading",{id:f.id}))}function u(){if(!g.end){if(g.end=!0,n.log.debug("Request done",{id:f.id}),null===e.encoding)f.body=new t(new Uint8Array(f.response));else if(f.body=f.responseText,e.json)try{f.body=JSON.parse(f.responseText)}catch(r){return e.callback(r,f)}e.callback(null,f,f.body)}}var f=new c,d=!1,h=s(e.uri),p="withCredentials"in f;if(l+=1,f.seq_id=l,f.id=l+": "+e.method+" "+e.uri,f._id=f.id,h&&!p){var m=Error("Browser does not support cross-origin request: "+e.uri);return m.cors="unsupported",e.callback(m,f)}f.timeoutTimer=setTimeout(r,e.timeout);var g={response:!1,loading:!1,end:!1};return f.onreadystatechange=i,f.open(e.method,e.uri,!0),null===e.encoding&&(f.responseType="arraybuffer"),h&&(f.withCredentials=!!e.withCredentials),f.send(e.body),f}function i(){}function o(){var t,e,n={},r=["trace","debug","info","warn","error"];for(e=0;r.length>e;e++)t=r[e],n[t]=i,"undefined"!=typeof console&&console&&console[t]&&(n[t]=a(console,t));return n}function a(t,e){function n(n,r){return"object"==typeof r&&(n+=" "+JSON.stringify(r)),t[e].call(t,n)}return n}function s(t){var e,n=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/;try{e=location.href}catch(r){e=document.createElement("a"),e.href="",e=e.href}var i=n.exec(e.toLowerCase())||[],o=n.exec(t.toLowerCase()),a=!(!o||o[1]==i[1]&&o[2]==i[2]&&(o[3]||("http:"===o[1]?80:443))==(i[3]||("http:"===i[1]?80:443)));return a}function u(t){var e,n,r,i,o,a,s,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,l=0,d="",h=[];if(!t)return t;do e=t.charCodeAt(f++),n=t.charCodeAt(f++),r=t.charCodeAt(f++),u=e<<16|n<<8|r,i=63&u>>18,o=63&u>>12,a=63&u>>6,s=63&u,h[l++]=c.charAt(i)+c.charAt(o)+c.charAt(a)+c.charAt(s);while(t.length>f);switch(d=h.join(""),t.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d}var c=XMLHttpRequest;if(!c)throw Error("missing XMLHttpRequest");n.log={trace:i,debug:i,info:i,warn:i,error:i};var f=18e4,l=0;n.withCredentials=!1,n.DEFAULT_TIMEOUT=f,n.defaults=function(t){var e=function(e){var n=function(n,r){n="string"==typeof n?{uri:n}:JSON.parse(JSON.stringify(n));for(var i in t)void 0===n[i]&&(n[i]=t[i]);return e(n,r)};return n},r=e(n);return r.get=e(n.get),r.post=e(n.post),r.put=e(n.put),r.head=e(n.head),r};var d=["get","put","post","head"];d.forEach(function(t){var e=t.toUpperCase(),r=t.toLowerCase();n[r]=function(t){"string"==typeof t?t={method:e,uri:t}:(t=JSON.parse(JSON.stringify(t)),t.method=e);var r=[t].concat(Array.prototype.slice.apply(arguments,[1]));return n.apply(this,r)}}),n.couch=function(t,e){function r(t,n,r){if(t)return e(t,n,r);if((200>n.statusCode||n.statusCode>299)&&r.error){t=Error("CouchDB error: "+(r.error.reason||r.error.error));for(var i in r)t[i]=r[i];return e(t,n,r)}return e(t,n,r)}"string"==typeof t&&(t={uri:t}),t.json=!0,t.body&&(t.json=t.body),delete t.body,e=e||i;var o=n(t,r);return o},e.exports=n}).call(this,t("buffer").Buffer)},{}],6:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],7:[function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(t){for(var e,n,i,o,a,s,u,c="",f=0;t.length>f;)e=t.charCodeAt(f++),n=t.charCodeAt(f++),i=t.charCodeAt(f++),o=e>>2,a=(3&e)<<4|n>>4,s=(15&n)<<2|i>>6,u=63&i,isNaN(n)?s=u=64:isNaN(i)&&(u=64),c=c+r.charAt(o)+r.charAt(a)+r.charAt(s)+r.charAt(u);return c},n.decode=function(t){var e,n,i,o,a,s,u,c="",f=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");t.length>f;)o=r.indexOf(t.charAt(f++)),a=r.indexOf(t.charAt(f++)),s=r.indexOf(t.charAt(f++)),u=r.indexOf(t.charAt(f++)),e=o<<2|a>>4,n=(15&a)<<4|s>>2,i=(3&s)<<6|u,c+=String.fromCharCode(e),64!=s&&(c+=String.fromCharCode(n)),64!=u&&(c+=String.fromCharCode(i));return c}},{}],8:[function(t,e){"use strict";function n(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}n.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},e.exports=n},{}],9:[function(t,e,n){"use strict";n.STORE={magic:"\0\0",compress:function(t){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null},n.DEFLATE=t("./flate")},{"./flate":12}],10:[function(t,e){"use strict";function n(){this.data=null,this.length=0,this.index=0}var r=t("./utils");n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(t>this.length||0>t)throw Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return r.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date((127&t>>25)+1980,(15&t>>21)-1,31&t>>16,31&t>>11,63&t>>5,(31&t)<<1)}},e.exports=n},{"./utils":22}],11:[function(t,e,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.date=null,n.compression=null},{}],12:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako");n.uncompressInputType=r?"uint8array":"array",n.compressInputType=r?"uint8array":"array",n.magic="\b\0",n.compress=function(t){return i.deflateRaw(t)},n.uncompress=function(t){return i.inflateRaw(t)}},{pako:25}],13:[function(t,e){"use strict";function n(t,e){return this instanceof n?(this.files={},this.root="",t&&this.load(t,e),this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t},void 0):new n(t,e)}n.prototype=t("./object"),n.prototype.load=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.utils=t("./utils"),n.base64=t("./base64"),n.compressions=t("./compressions"),e.exports=n},{"./base64":7,"./compressions":9,"./defaults":11,"./load":14,"./object":17,"./support":20,"./utils":22}],14:[function(t,e){"use strict";var n=t("./base64"),r=t("./zipEntries");e.exports=function(t,e){var i,o,a,s;for(e=e||{},e.base64&&(t=n.decode(t)),o=new r(t,e),i=o.files,a=0;i.length>a;a++)s=i[a],this.file(s.fileName,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir});return this}},{"./base64":7,"./zipEntries":23}],15:[function(t,e){(function(t){"use strict";e.exports=function(e,n){return new t(e,n)},e.exports.test=function(e){return t.isBuffer(e)}}).call(this,t("buffer").Buffer)},{}],16:[function(t,e){"use strict";function n(t){this.data=t,this.length=this.data.length,this.index=0}var r=t("./uint8ArrayReader");n.prototype=new r,n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./uint8ArrayReader":21}],17:[function(t,e){"use strict";var n,r,i=t("./support"),o=t("./utils"),a=t("./signature"),s=t("./defaults"),u=t("./base64"),c=t("./compressions"),f=t("./compressedObject"),l=t("./nodeBuffer");i.uint8array&&"function"==typeof TextEncoder&&"function"==typeof TextDecoder&&(n=new TextEncoder("utf-8"),r=new TextDecoder("utf-8"));var d=function(t){if(t._data instanceof f&&(t._data=t._data.getContent(),t.options.binary=!0,t.options.base64=!1,"uint8array"===o.getTypeOf(t._data))){var e=t._data;t._data=new Uint8Array(e.length),0!==e.length&&t._data.set(e,0)}return t._data},h=function(t){var e=d(t),r=o.getTypeOf(e);if("string"===r){if(!t.options.binary){if(n)return n.encode(e);if(i.nodebuffer)return l(e,"utf-8")}return t.asBinary()}return e},p=function(t){var e=d(this);return null===e||e===void 0?"":(this.options.base64&&(e=u.decode(e)),e=t&&this.options.binary?S.utf8decode(e):o.transformTo("string",e),t||this.options.binary||(e=S.utf8encode(e)),e)},m=function(t,e,n){this.name=t,this._data=e,this.options=n};m.prototype={asText:function(){return p.call(this,!0)},asBinary:function(){return p.call(this,!1)},asNodeBuffer:function(){var t=h(this);return o.transformTo("nodebuffer",t)},asUint8Array:function(){var t=h(this);return o.transformTo("uint8array",t)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var g=function(t,e){var n,r="";for(n=0;e>n;n++)r+=String.fromCharCode(255&t),t>>>=8;return r},v=function(){var t,e,n={};for(t=0;arguments.length>t;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&n[e]===void 0&&(n[e]=arguments[t][e]);return n},_=function(t){return t=t||{},t.base64!==!0||null!==t.binary&&void 0!==t.binary||(t.binary=!0),t=v(t,s),t.date=t.date||new Date,null!==t.compression&&(t.compression=t.compression.toUpperCase()),t},y=function(t,e,n){var r=o.getTypeOf(e);if(n=_(n),n.dir||null===e||e===void 0)n.base64=!1,n.binary=!1,e=null;else if("string"===r)n.binary&&!n.base64&&n.optimizedBinaryString!==!0&&(e=o.string2binary(e));else{if(n.base64=!1,n.binary=!0,!(r||e instanceof f))throw Error("The data of '"+t+"' is in an unsupported format !");"arraybuffer"===r&&(e=o.transformTo("uint8array",e))}var i=new m(t,e,n);return this.files[t]=i,i},b=function(t){return"/"!=t.slice(-1)&&(t+="/"),this.files[t]||y.call(this,t,null,{dir:!0}),this.files[t]},w=function(t,e){var n,r=new f;return t._data instanceof f?(r.uncompressedSize=t._data.uncompressedSize,r.crc32=t._data.crc32,0===r.uncompressedSize||t.options.dir?(e=c.STORE,r.compressedContent="",r.crc32=0):t._data.compressionMethod===e.magic?r.compressedContent=t._data.getCompressedContent():(n=t._data.getContent(),r.compressedContent=e.compress(o.transformTo(e.compressInputType,n)))):(n=h(t),(!n||0===n.length||t.options.dir)&&(e=c.STORE,n=""),r.uncompressedSize=n.length,r.crc32=this.crc32(n),r.compressedContent=e.compress(o.transformTo(e.compressInputType,n))),r.compressedSize=r.compressedContent.length,r.compressionMethod=e.magic,r},E=function(t,e,n,r){var i,o,s=(n.compressedContent,this.utf8encode(e.name)),u=s!==e.name,c=e.options,f="",l="";i=c.date.getHours(),i<<=6,i|=c.date.getMinutes(),i<<=5,i|=c.date.getSeconds()/2,o=c.date.getFullYear()-1980,o<<=4,o|=c.date.getMonth()+1,o<<=5,o|=c.date.getDate(),u&&(l=g(1,1)+g(this.crc32(s),4)+s,f+="up"+g(l.length,2)+l);var d="";d+="\n\0",d+=u?"\0\b":"\0\0",d+=n.compressionMethod,d+=g(i,2),d+=g(o,2),d+=g(n.crc32,4),d+=g(n.compressedSize,4),d+=g(n.uncompressedSize,4),d+=g(s.length,2),d+=g(f.length,2);var h=a.LOCAL_FILE_HEADER+d+s+f,p=a.CENTRAL_FILE_HEADER+"\0"+d+"\0\0"+"\0\0"+"\0\0"+(e.options.dir===!0?"\0\0\0":"\0\0\0\0")+g(r,4)+s+f;return{fileRecord:h,dirRecord:p,compressedObject:n}},x=function(){this.data=[]};x.prototype={append:function(t){t=o.transformTo("string",t),this.data.push(t)},finalize:function(){return this.data.join("")}};var k=function(t){this.data=new Uint8Array(t),this.index=0};k.prototype={append:function(t){0!==t.length&&(t=o.transformTo("uint8array",t),this.data.set(t,this.index),this.index+=t.length)},finalize:function(){return this.data}};var S={load:function(){throw Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(t){var e,n,r,i,o=[];for(e in this.files)this.files.hasOwnProperty(e)&&(r=this.files[e],i=new m(r.name,r._data,v(r.options)),n=e.slice(this.root.length,e.length),e.slice(0,this.root.length)===this.root&&t(n,i)&&o.push(i));return o},file:function(t,e,n){if(1===arguments.length){if(o.isRegExp(t)){var r=t;return this.filter(function(t,e){return!e.options.dir&&r.test(t)})}return this.filter(function(e,n){return!n.options.dir&&e===t})[0]||null}return t=this.root+t,y.call(this,t,e,n),this},folder:function(t){if(!t)return this;if(o.isRegExp(t))return this.filter(function(e,n){return n.options.dir&&t.test(e)
});var e=this.root+t,n=b.call(this,e),r=this.clone();return r.root=n.name,r},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!=t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.options.dir)delete this.files[t];else for(var n=this.filter(function(e,n){return n.name.slice(0,t.length)===t}),r=0;n.length>r;r++)delete this.files[n[r].name];return this},generate:function(t){t=v(t||{},{base64:!0,compression:"STORE",type:"base64"}),o.checkSupport(t.type);var e,n,r=[],i=0,s=0;for(var f in this.files)if(this.files.hasOwnProperty(f)){var l=this.files[f],d=l.options.compression||t.compression.toUpperCase(),h=c[d];if(!h)throw Error(d+" is not a valid compression method !");var p=w.call(this,l,h),m=E.call(this,f,l,p,i);i+=m.fileRecord.length+p.compressedSize,s+=m.dirRecord.length,r.push(m)}var _="";_=a.CENTRAL_DIRECTORY_END+"\0\0"+"\0\0"+g(r.length,2)+g(r.length,2)+g(s,4)+g(i,4)+"\0\0";var y=t.type.toLowerCase();for(e="uint8array"===y||"arraybuffer"===y||"blob"===y||"nodebuffer"===y?new k(i+s+_.length):new x(i+s+_.length),n=0;r.length>n;n++)e.append(r[n].fileRecord),e.append(r[n].compressedObject.compressedContent);for(n=0;r.length>n;n++)e.append(r[n].dirRecord);e.append(_);var b=e.finalize();switch(t.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return o.transformTo(t.type.toLowerCase(),b);case"blob":return o.arrayBuffer2Blob(o.transformTo("arraybuffer",b));case"base64":return t.base64?u.encode(b):b;default:return b}},crc32:function(t,e){if(t===void 0||!t.length)return 0;var n="string"!==o.getTypeOf(t),r=[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];e===void 0&&(e=0);var i=0,a=0,s=0;e=-1^e;for(var u=0,c=t.length;c>u;u++)s=n?t[u]:t.charCodeAt(u),a=255&(e^s),i=r[a],e=e>>>8^i;return-1^e},utf8encode:function(t){if(n){var e=n.encode(t);return o.transformTo("string",e)}if(i.nodebuffer)return o.transformTo("string",l(t,"utf-8"));for(var r=[],a=0,s=0;t.length>s;s++){var u=t.charCodeAt(s);128>u?r[a++]=String.fromCharCode(u):u>127&&2048>u?(r[a++]=String.fromCharCode(192|u>>6),r[a++]=String.fromCharCode(128|63&u)):(r[a++]=String.fromCharCode(224|u>>12),r[a++]=String.fromCharCode(128|63&u>>6),r[a++]=String.fromCharCode(128|63&u))}return r.join("")},utf8decode:function(t){var e=[],n=0,a=o.getTypeOf(t),s="string"!==a,u=0,c=0,f=0,l=0;if(r)return r.decode(o.transformTo("uint8array",t));if(i.nodebuffer)return o.transformTo("nodebuffer",t).toString("utf-8");for(;t.length>u;)c=s?t[u]:t.charCodeAt(u),128>c?(e[n++]=String.fromCharCode(c),u++):c>191&&224>c?(f=s?t[u+1]:t.charCodeAt(u+1),e[n++]=String.fromCharCode((31&c)<<6|63&f),u+=2):(f=s?t[u+1]:t.charCodeAt(u+1),l=s?t[u+2]:t.charCodeAt(u+2),e[n++]=String.fromCharCode((15&c)<<12|(63&f)<<6|63&l),u+=3);return e.join("")}};e.exports=S},{"./base64":7,"./compressedObject":8,"./compressions":9,"./defaults":11,"./nodeBuffer":15,"./signature":18,"./support":20,"./utils":22}],18:[function(t,e,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],19:[function(t,e){"use strict";function n(t,e){this.data=t,e||(this.data=i.string2binary(this.data)),this.length=this.data.length,this.index=0}var r=t("./dataReader"),i=t("./utils");n.prototype=new r,n.prototype.byteAt=function(t){return this.data.charCodeAt(t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./dataReader":10,"./utils":22}],20:[function(t,e,n){(function(t){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=t!==void 0,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var e=new ArrayBuffer(0);try{n.blob=0===new Blob([e],{type:"application/zip"}).size}catch(r){try{var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new i;o.append(e),n.blob=0===o.getBlob("application/zip").size}catch(r){n.blob=!1}}}}).call(this,t("buffer").Buffer)},{}],21:[function(t,e){"use strict";function n(t){t&&(this.data=t,this.length=this.data.length,this.index=0)}var r=t("./dataReader");n.prototype=new r,n.prototype.byteAt=function(t){return this.data[t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),n=t.charCodeAt(1),r=t.charCodeAt(2),i=t.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===r&&this.data[o+3]===i)return o;return-1},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.subarray(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./dataReader":10}],22:[function(t,e,n){"use strict";function r(t){return t}function i(t,e){for(var n=0;t.length>n;++n)e[n]=255&t.charCodeAt(n);return e}function o(t){var e=65536,r=[],i=t.length,o=n.getTypeOf(t),a=0,s=!0;try{switch(o){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,c(0))}}catch(u){s=!1}if(!s){for(var f="",l=0;t.length>l;l++)f+=String.fromCharCode(t[l]);return f}for(;i>a&&e>1;)try{"array"===o||"nodebuffer"===o?r.push(String.fromCharCode.apply(null,t.slice(a,Math.min(a+e,i)))):r.push(String.fromCharCode.apply(null,t.subarray(a,Math.min(a+e,i)))),a+=e}catch(u){e=Math.floor(e/2)}return r.join("")}function a(t,e){for(var n=0;t.length>n;n++)e[n]=t[n];return e}var s=t("./support"),u=t("./compressions"),c=t("./nodeBuffer");n.string2binary=function(t){for(var e="",n=0;t.length>n;n++)e+=String.fromCharCode(255&t.charCodeAt(n));return e},n.string2Uint8Array=function(t){return n.transformTo("uint8array",t)},n.uint8Array2String=function(t){return n.transformTo("string",t)},n.string2Blob=function(t){var e=n.transformTo("arraybuffer",t);return n.arrayBuffer2Blob(e)},n.arrayBuffer2Blob=function(t){n.checkSupport("blob");try{return new Blob([t],{type:"application/zip"})}catch(e){try{var r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,i=new r;return i.append(t),i.getBlob("application/zip")}catch(e){throw Error("Bug : can't construct the Blob.")}}};var f={};f.string={string:r,array:function(t){return i(t,Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return i(t,new Uint8Array(t.length))},nodebuffer:function(t){return i(t,c(t.length))}},f.array={string:o,array:r,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return c(t)}},f.arraybuffer={string:function(t){return o(new Uint8Array(t))},array:function(t){return a(new Uint8Array(t),Array(t.byteLength))},arraybuffer:r,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return c(new Uint8Array(t))}},f.uint8array={string:o,array:function(t){return a(t,Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:r,nodebuffer:function(t){return c(t)}},f.nodebuffer={string:o,array:function(t){return a(t,Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return a(t,new Uint8Array(t.length))},nodebuffer:r},n.transformTo=function(t,e){if(e||(e=""),!t)return e;n.checkSupport(t);var r=n.getTypeOf(e),i=f[r][t](e);return i},n.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":s.nodebuffer&&c.test(t)?"nodebuffer":s.uint8array&&t instanceof Uint8Array?"uint8array":s.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(t){var e=s[t.toLowerCase()];if(!e)throw Error(t+" is not supported by this browser")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(t){var e,n,r="";for(n=0;(t||"").length>n;n++)e=t.charCodeAt(n),r+="\\x"+(16>e?"0":"")+e.toString(16).toUpperCase();return r},n.findCompression=function(t){for(var e in u)if(u.hasOwnProperty(e)&&u[e].magic===t)return u[e];return null},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}},{"./compressions":9,"./nodeBuffer":15,"./support":20}],23:[function(t,e){"use strict";function n(t,e){this.files=[],this.loadOptions=e,t&&this.load(t)}var r=t("./stringReader"),i=t("./nodeBufferReader"),o=t("./uint8ArrayReader"),a=t("./utils"),s=t("./signature"),u=t("./zipEntry"),c=t("./support");n.prototype={checkSignature:function(t){var e=this.reader.readString(4);if(e!==t)throw Error("Corrupted zip or bug : unexpected signature ("+a.pretty(e)+", expected "+a.pretty(t)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,n,r=this.zip64EndOfCentralSize-44,i=0;r>i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readString(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;this.files.length>t;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===s.CENTRAL_FILE_HEADER;)t=new u({zip64:this.zip64},this.loadOptions),t.readCentralPart(this.reader),this.files.push(t)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(-1===t)throw Error("Corrupted zip : can't find end of central directory");if(this.reader.setIndex(t),this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),-1===t)throw Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(t){var e=a.getTypeOf(t);this.reader="string"!==e||c.uint8array?"nodebuffer"===e?new i(t):new o(a.transformTo("uint8array",t)):new r(t,this.loadOptions.optimizedBinaryString)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=n},{"./nodeBufferReader":16,"./signature":18,"./stringReader":19,"./support":20,"./uint8ArrayReader":21,"./utils":22,"./zipEntry":24}],24:[function(t,e){"use strict";function n(t,e){this.options=t,this.loadOptions=e}var r=t("./stringReader"),i=t("./utils"),o=t("./compressedObject"),a=t("./object");n.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},prepareCompressedContent:function(t,e,n){return function(){var r=t.index;t.setIndex(e);var i=t.readData(n);return t.setIndex(r),i}},prepareContent:function(t,e,n,r,o){return function(){var t=i.transformTo(r.uncompressInputType,this.getCompressedContent()),e=r.uncompress(t);if(e.length!==o)throw Error("Bug : uncompressed data size mismatch");return e}},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readString(this.fileNameLength),t.skip(n),-1==this.compressedSize||-1==this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(e=i.findCompression(this.compressionMethod),null===e)throw Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new o,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,e),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,e,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=i.transformTo("string",this.decompressed.getContent()),a.crc32(this.decompressed)!==this.crc32))throw Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readString(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");this.fileName=t.readString(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readString(this.fileCommentLength),this.dir=16&this.externalFileAttributes?!0:!1},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=new r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,n,r,i=t.index;for(this.extraFields=this.extraFields||{};t.index<i+this.extraFieldsLength;)e=t.readInt(2),n=t.readInt(2),r=t.readString(n),this.extraFields[e]={id:e,length:n,value:r}},handleUTF8:function(){if(this.useUTF8())this.fileName=a.utf8decode(this.fileName),this.fileComment=a.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();null!==t&&(this.fileName=t)}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=new r(t.value);return 1!==e.readInt(1)?null:a.crc32(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readString(t.length-5))}return null}},e.exports=n},{"./compressedObject":8,"./object":17,"./stringReader":19,"./utils":22}],25:[function(t,e){"use strict";var n=t("./lib/utils/common").assign,r=t("./lib/deflate"),i=t("./lib/inflate"),o=t("./lib/zlib/constants"),a={};n(a,r,i,o),e.exports=a},{"./lib/deflate":26,"./lib/inflate":27,"./lib/utils/common":28,"./lib/zlib/constants":31}],26:[function(t,e,n){"use strict";function r(t,e){var n=new _(e);if(n.push(t,!0),n.err)throw n.msg;return n.result}function i(t,e){return e=e||{},e.raw=!0,r(t,e)}function o(t,e){return e=e||{},e.gzip=!0,r(t,e)}var a=t("./zlib/deflate.js"),s=t("./utils/common"),u=t("./utils/strings"),c=t("./zlib/messages"),f=t("./zlib/zstream"),l=0,d=4,h=0,p=1,m=-1,g=0,v=8,_=function(t){this.options=s.assign({level:m,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&16>e.windowBits&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var n=a.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==h)throw Error(c[n]);e.header&&a.deflateSetHeader(this.strm,e.header)};_.prototype.push=function(t,e){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:e===!0?d:l,i.input="string"==typeof t?u.string2buf(t):t,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new s.Buf8(o),i.next_out=0,i.avail_out=o),n=a.deflate(i,r),n!==p&&n!==h)return this.onEnd(n),this.ended=!0,!1;(0===i.avail_out||0===i.avail_in&&r===d)&&("string"===this.options.to?this.onData(u.buf2binstring(s.shrinkBuf(i.output,i.next_out))):this.onData(s.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&n!==p);return r===d?(n=a.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===h):!0},_.prototype.onData=function(t){this.chunks.push(t)},_.prototype.onEnd=function(t){t===h&&(this.result="string"===this.options.to?this.chunks.join(""):s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=_,n.deflate=r,n.deflateRaw=i,n.gzip=o},{"./utils/common":28,"./utils/strings":29,"./zlib/deflate.js":33,"./zlib/messages":38,"./zlib/zstream":40}],27:[function(t,e,n){"use strict";function r(t,e){var n=new d(e);if(n.push(t,!0),n.err)throw n.msg;return n.result}function i(t,e){return e=e||{},e.raw=!0,r(t,e)}var o=t("./zlib/inflate.js"),a=t("./utils/common"),s=t("./utils/strings"),u=t("./zlib/constants"),c=t("./zlib/messages"),f=t("./zlib/zstream"),l=t("./zlib/gzheader"),d=function(t){this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&16>e.windowBits&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&16>e.windowBits)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&48>e.windowBits&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var n=o.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw Error(c[n]);this.header=new l,o.inflateGetHeader(this.strm,this.header)};d.prototype.push=function(t,e){var n,r,i,c,f,l=this.strm,d=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:e===!0?u.Z_FINISH:u.Z_NO_FLUSH,l.input="string"==typeof t?s.binstring2buf(t):t,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new a.Buf8(d),l.next_out=0,l.avail_out=d),n=o.inflate(l,u.Z_NO_FLUSH),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;l.next_out&&(0===l.avail_out||n===u.Z_STREAM_END||0===l.avail_in&&r===u.Z_FINISH)&&("string"===this.options.to?(i=s.utf8border(l.output,l.next_out),c=l.next_out-i,f=s.buf2string(l.output,i),l.next_out=c,l.avail_out=d-c,c&&a.arraySet(l.output,l.output,i,c,0),this.onData(f)):this.onData(a.shrinkBuf(l.output,l.next_out)))}while((l.avail_in>0||0===l.avail_out)&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(r=u.Z_FINISH),r===u.Z_FINISH?(n=o.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):!0},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===u.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=d,n.inflate=r,n.inflateRaw=i,n.ungzip=r},{"./utils/common":28,"./utils/strings":29,"./zlib/constants":31,"./zlib/gzheader":34,"./zlib/inflate.js":36,"./zlib/messages":38,"./zlib/zstream":40}],28:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)return t.set(e.subarray(n,n+r),i),void 0;for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,a;for(r=0,e=0,n=t.length;n>e;e++)r+=t[e].length;for(a=new Uint8Array(r),i=0,e=0,n=t.length;n>e;e++)o=t[e],a.set(o,i),i+=o.length;return a}},o={arraySet:function(t,e,n,r,i){for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],29:[function(t,e,n){"use strict";function r(t,e){if(65537>e&&(t.subarray&&a||!t.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",r=0;e>r;r++)n+=String.fromCharCode(t[r]);return n}var i=t("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(s){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(s){a=!1}for(var u=new i.Buf8(256),c=0;256>c;c++)u[c]=c>=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;u[254]=u[254]=1,n.string2buf=function(t){var e,n,r,o,a,s=t.length,u=0;for(o=0;s>o;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),u+=128>n?1:2048>n?2:65536>n?3:4;for(e=new i.Buf8(u),a=0,o=0;u>a;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),128>n?e[a++]=n:2048>n?(e[a++]=192|n>>>6,e[a++]=128|63&n):65536>n?(e[a++]=224|n>>>12,e[a++]=128|63&n>>>6,e[a++]=128|63&n):(e[a++]=240|n>>>18,e[a++]=128|63&n>>>12,e[a++]=128|63&n>>>6,e[a++]=128|63&n);return e},n.buf2binstring=function(t){return r(t,t.length)},n.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;r>n;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,i,o,a,s=e||t.length,c=Array(2*s);for(i=0,n=0;s>n;)if(o=t[n++],128>o)c[i++]=o;else if(a=u[o],a>4)c[i++]=65533,n+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&s>n;)o=o<<6|63&t[n++],a--;a>1?c[i++]=65533:65536>o?c[i++]=o:(o-=65536,c[i++]=55296|1023&o>>10,c[i++]=56320|1023&o)}return r(c,i)},n.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return 0>n?e:0===n?e:n+u[t[n]]>e?n:e}},{"./common":28}],30:[function(t,e){"use strict";function n(t,e,n,r){for(var i=0|65535&t,o=0|65535&t>>>16,a=0;0!==n;){a=n>2e3?2e3:n,n-=a;do i=0|i+e[r++],o=0|o+i;while(--a);i%=65521,o%=65521}return 0|(i|o<<16)}e.exports=n},{}],31:[function(t,e){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],32:[function(t,e){"use strict";function n(){for(var t,e=[],n=0;256>n;n++){t=n;for(var r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function r(t,e,n,r){var o=i,a=r+n;t=-1^t;for(var s=r;a>s;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}var i=n();e.exports=r},{}],33:[function(t,e,n){"use strict";function r(t,e){return t.msg=N[e],e}function i(t){return(t<<1)-(t>4?9:0)}function o(t){for(var e=t.length;--e>=0;)t[e]=0}function a(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(I.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function s(t,e){T._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,a(t.strm)}function u(t,e){t.pending_buf[t.pending++]=e}function c(t,e){t.pending_buf[t.pending++]=255&e>>>8,t.pending_buf[t.pending++]=255&e}function f(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,I.arraySet(e,t.input,t.next_in,i,n),1===t.state.wrap?t.adler=R(t.adler,e,i,n):2===t.state.wrap&&(t.adler=C(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)}function l(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-ce?t.strstart-(t.w_size-ce):0,c=t.window,f=t.w_mask,l=t.prev,d=t.strstart+ue,h=c[o+a-1],p=c[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,c[n+a]===p&&c[n+a-1]===h&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do;while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&d>o);if(r=ue-(d-o),o=d-ue,r>a){if(t.match_start=e,a=r,r>=s)break;h=c[o+a-1],p=c[o+a]}}while((e=l[e&f])>u&&0!==--i);return t.lookahead>=a?a:t.lookahead}function d(t){var e,n,r,i,o,a=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-ce)){I.arraySet(t.window,t.window,a,a,0),t.match_start-=a,t.strstart-=a,t.block_start-=a,n=t.hash_size,e=n;do r=t.head[--e],t.head[e]=r>=a?r-a:0;while(--n);n=a,e=n;do r=t.prev[--e],t.prev[e]=r>=a?r-a:0;while(--n);i+=a}if(0===t.strm.avail_in)break;if(n=f(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=se)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+se-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(se>t.lookahead+t.insert)););}while(ce>t.lookahead&&0!==t.strm.avail_in)}function h(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(1>=t.lookahead){if(d(t),0===t.lookahead&&e===D)return _e;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,s(t,!1),0===t.strm.avail_out))return _e;if(t.strstart-t.block_start>=t.w_size-ce&&(s(t,!1),0===t.strm.avail_out))return _e}return t.insert=0,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.strstart>t.block_start&&(s(t,!1),0===t.strm.avail_out)?_e:_e}function p(t,e){for(var n,r;;){if(ce>t.lookahead){if(d(t),ce>t.lookahead&&e===D)return _e;if(0===t.lookahead)break}if(n=0,t.lookahead>=se&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+se-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-ce&&(t.match_length=l(t,n)),t.match_length>=se)if(r=T._tr_tally(t,t.strstart-t.match_start,t.match_length-se),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=se){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+se-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(s(t,!1),0===t.strm.avail_out))return _e}return t.insert=se-1>t.strstart?t.strstart:se-1,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?_e:ye}function m(t,e){for(var n,r,i;;){if(ce>t.lookahead){if(d(t),ce>t.lookahead&&e===D)return _e;if(0===t.lookahead)break}if(n=0,t.lookahead>=se&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+se-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=se-1,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-ce&&(t.match_length=l(t,n),5>=t.match_length&&(t.strategy===Y||t.match_length===se&&t.strstart-t.match_start>4096)&&(t.match_length=se-1)),t.prev_length>=se&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-se,r=T._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-se),t.lookahead-=t.prev_length-1,t.prev_length-=2;do i>=++t.strstart&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+se-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!==--t.prev_length);if(t.match_available=0,t.match_length=se-1,t.strstart++,r&&(s(t,!1),0===t.strm.avail_out))return _e}else if(t.match_available){if(r=T._tr_tally(t,0,t.window[t.strstart-1]),r&&s(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return _e}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=T._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=se-1>t.strstart?t.strstart:se-1,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?_e:ye}function g(t,e){for(var n,r,i,o,a=t.window;;){if(ue>=t.lookahead){if(d(t),ue>=t.lookahead&&e===D)return _e;if(0===t.lookahead)break
}if(t.match_length=0,t.lookahead>=se&&t.strstart>0&&(i=t.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=t.strstart+ue;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&o>i);t.match_length=ue-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=se?(n=T._tr_tally(t,1,t.match_length-se),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(s(t,!1),0===t.strm.avail_out))return _e}return t.insert=0,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?_e:ye}function v(t,e){for(var n;;){if(0===t.lookahead&&(d(t),0===t.lookahead)){if(e===D)return _e;break}if(t.match_length=0,n=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(s(t,!1),0===t.strm.avail_out))return _e}return t.insert=0,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?_e:ye}function _(t){t.window_size=2*t.w_size,o(t.head),t.max_lazy_match=O[t.level].max_lazy,t.good_match=O[t.level].good_length,t.nice_match=O[t.level].nice_length,t.max_chain_length=O[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=se-1,t.match_available=0,t.ins_h=0}function y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=J,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new I.Buf16(2*oe),this.dyn_dtree=new I.Buf16(2*(2*re+1)),this.bl_tree=new I.Buf16(2*(2*ie+1)),o(this.dyn_ltree),o(this.dyn_dtree),o(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new I.Buf16(ae+1),this.heap=new I.Buf16(2*ne+1),o(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new I.Buf16(2*ne+1),o(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function b(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=K,e=t.state,e.pending=0,e.pending_out=0,0>e.wrap&&(e.wrap=-e.wrap),e.status=e.wrap?le:ge,t.adler=2===e.wrap?0:1,e.last_flush=D,T._tr_init(e),F):r(t,P)}function w(t){var e=b(t);return e===F&&_(t.state),e}function E(t,e){return t&&t.state?2!==t.state.wrap?P:(t.state.gzhead=e,F):P}function x(t,e,n,i,o,a){if(!t)return P;var s=1;if(e===Z&&(e=6),0>i?(s=0,i=-i):i>15&&(s=2,i-=16),1>o||o>G||n!==J||8>i||i>15||0>e||e>9||0>a||a>W)return r(t,P);8===i&&(i=9);var u=new y;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=i,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+se-1)/se),u.window=new I.Buf8(2*u.w_size),u.head=new I.Buf16(u.hash_size),u.prev=new I.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new I.Buf8(u.pending_buf_size),u.d_buf=u.lit_bufsize>>1,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=a,u.method=n,w(t)}function k(t,e){return x(t,e,J,Q,$,q)}function S(t,e){var n,s,f,l;if(!t||!t.state||e>B||0>e)return t?r(t,P):P;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||s.status===ve&&e!==j)return r(t,0===t.avail_out?V:P);if(s.strm=t,n=s.last_flush,s.last_flush=e,s.status===le)if(2===s.wrap)t.adler=0,u(s,31),u(s,139),u(s,8),s.gzhead?(u(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),u(s,255&s.gzhead.time),u(s,255&s.gzhead.time>>8),u(s,255&s.gzhead.time>>16),u(s,255&s.gzhead.time>>24),u(s,9===s.level?2:s.strategy>=X||2>s.level?4:0),u(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(u(s,255&s.gzhead.extra.length),u(s,255&s.gzhead.extra.length>>8)),s.gzhead.hcrc&&(t.adler=C(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=de):(u(s,0),u(s,0),u(s,0),u(s,0),u(s,0),u(s,9===s.level?2:s.strategy>=X||2>s.level?4:0),u(s,Ee),s.status=ge);else{var d=J+(s.w_bits-8<<4)<<8,h=-1;h=s.strategy>=X||2>s.level?0:6>s.level?1:6===s.level?2:3,d|=h<<6,0!==s.strstart&&(d|=fe),d+=31-d%31,s.status=ge,c(s,d),0!==s.strstart&&(c(s,t.adler>>>16),c(s,65535&t.adler)),t.adler=1}if(s.status===de)if(s.gzhead.extra){for(f=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),a(t),f=s.pending,s.pending!==s.pending_buf_size));)u(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=he)}else s.status=he;if(s.status===he)if(s.gzhead.name){f=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),a(t),f=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindex<s.gzhead.name.length?255&s.gzhead.name.charCodeAt(s.gzindex++):0,u(s,l)}while(0!==l);s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),0===l&&(s.gzindex=0,s.status=pe)}else s.status=pe;if(s.status===pe)if(s.gzhead.comment){f=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),a(t),f=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindex<s.gzhead.comment.length?255&s.gzhead.comment.charCodeAt(s.gzindex++):0,u(s,l)}while(0!==l);s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),0===l&&(s.status=me)}else s.status=me;if(s.status===me&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&a(t),s.pending+2<=s.pending_buf_size&&(u(s,255&t.adler),u(s,255&t.adler>>8),t.adler=0,s.status=ge)):s.status=ge),0!==s.pending){if(a(t),0===t.avail_out)return s.last_flush=-1,F}else if(0===t.avail_in&&i(e)<=i(n)&&e!==j)return r(t,V);if(s.status===ve&&0!==t.avail_in)return r(t,V);if(0!==t.avail_in||0!==s.lookahead||e!==D&&s.status!==ve){var p=s.strategy===X?v(s,e):s.strategy===H?g(s,e):O[s.level].func(s,e);if((p===be||p===we)&&(s.status=ve),p===_e||p===be)return 0===t.avail_out&&(s.last_flush=-1),F;if(p===ye&&(e===z?T._tr_align(s):e!==B&&(T._tr_stored_block(s,0,0,!1),e===L&&(o(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),a(t),0===t.avail_out))return s.last_flush=-1,F}return e!==j?F:0>=s.wrap?M:(2===s.wrap?(u(s,255&t.adler),u(s,255&t.adler>>8),u(s,255&t.adler>>16),u(s,255&t.adler>>24),u(s,255&t.total_in),u(s,255&t.total_in>>8),u(s,255&t.total_in>>16),u(s,255&t.total_in>>24)):(c(s,t.adler>>>16),c(s,65535&t.adler)),a(t),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?F:M)}function A(t){var e;return t&&t.state?(e=t.state.status,e!==le&&e!==de&&e!==he&&e!==pe&&e!==me&&e!==ge&&e!==ve?r(t,P):(t.state=null,e===ge?r(t,U):F)):P}var O,I=t("../utils/common"),T=t("./trees"),R=t("./adler32"),C=t("./crc32"),N=t("./messages"),D=0,z=1,L=3,j=4,B=5,F=0,M=1,P=-2,U=-3,V=-5,Z=-1,Y=1,X=2,H=3,W=4,q=0,K=2,J=8,G=9,Q=15,$=8,te=29,ee=256,ne=ee+1+te,re=30,ie=19,oe=2*ne+1,ae=15,se=3,ue=258,ce=ue+se+1,fe=32,le=42,de=69,he=73,pe=91,me=103,ge=113,ve=666,_e=1,ye=2,be=3,we=4,Ee=3,xe=function(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i};O=[new xe(0,0,0,0,h),new xe(4,4,8,4,p),new xe(4,5,16,8,p),new xe(4,6,32,32,p),new xe(4,4,16,16,m),new xe(8,16,32,32,m),new xe(8,16,128,128,m),new xe(8,32,128,256,m),new xe(32,128,258,1024,m),new xe(32,258,258,4096,m)],n.deflateInit=k,n.deflateInit2=x,n.deflateReset=w,n.deflateResetKeep=b,n.deflateSetHeader=E,n.deflate=S,n.deflateEnd=A,n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":28,"./adler32":30,"./crc32":32,"./messages":38,"./trees":39}],34:[function(t,e){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=n},{}],35:[function(t,e){"use strict";var n=30,r=12;e.exports=function(t,e){var i,o,a,s,u,c,f,l,d,h,p,m,g,v,_,y,b,w,E,x,k,S,A,O,I;i=t.state,o=t.next_in,O=t.input,a=o+(t.avail_in-5),s=t.next_out,I=t.output,u=s-(e-t.avail_out),c=s+(t.avail_out-257),f=i.dmax,l=i.wsize,d=i.whave,h=i.wnext,p=i.window,m=i.hold,g=i.bits,v=i.lencode,_=i.distcode,y=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;t:do{15>g&&(m+=O[o++]<<g,g+=8,m+=O[o++]<<g,g+=8),w=v[m&y];e:for(;;){if(E=w>>>24,m>>>=E,g-=E,E=255&w>>>16,0===E)I[s++]=65535&w;else{if(!(16&E)){if(0===(64&E)){w=v[(65535&w)+(m&(1<<E)-1)];continue e}if(32&E){i.mode=r;break t}t.msg="invalid literal/length code",i.mode=n;break t}x=65535&w,E&=15,E&&(E>g&&(m+=O[o++]<<g,g+=8),x+=m&(1<<E)-1,m>>>=E,g-=E),15>g&&(m+=O[o++]<<g,g+=8,m+=O[o++]<<g,g+=8),w=_[m&b];n:for(;;){if(E=w>>>24,m>>>=E,g-=E,E=255&w>>>16,!(16&E)){if(0===(64&E)){w=_[(65535&w)+(m&(1<<E)-1)];continue n}t.msg="invalid distance code",i.mode=n;break t}if(k=65535&w,E&=15,E>g&&(m+=O[o++]<<g,g+=8,E>g&&(m+=O[o++]<<g,g+=8)),k+=m&(1<<E)-1,k>f){t.msg="invalid distance too far back",i.mode=n;break t}if(m>>>=E,g-=E,E=s-u,k>E){if(E=k-E,E>d&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(S=0,A=p,0===h){if(S+=l-E,x>E){x-=E;do I[s++]=p[S++];while(--E);S=s-k,A=I}}else if(E>h){if(S+=l+h-E,E-=h,x>E){x-=E;do I[s++]=p[S++];while(--E);if(S=0,x>h){E=h,x-=E;do I[s++]=p[S++];while(--E);S=s-k,A=I}}}else if(S+=h-E,x>E){x-=E;do I[s++]=p[S++];while(--E);S=s-k,A=I}for(;x>2;)I[s++]=A[S++],I[s++]=A[S++],I[s++]=A[S++],x-=3;x&&(I[s++]=A[S++],x>1&&(I[s++]=A[S++]))}else{S=s-k;do I[s++]=I[S++],I[s++]=I[S++],I[s++]=I[S++],x-=3;while(x>2);x&&(I[s++]=I[S++],x>1&&(I[s++]=I[S++]))}break}}break}}while(a>o&&c>s);x=g>>3,o-=x,g-=x<<3,m&=(1<<g)-1,t.next_in=o,t.next_out=s,t.avail_in=a>o?5+(a-o):5-(o-a),t.avail_out=c>s?257+(c-s):257-(s-c),i.hold=m,i.bits=g}},{}],36:[function(t,e,n){"use strict";function r(t){return(255&t>>>24)+(65280&t>>>8)+((65280&t)<<8)+((255&t)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new v.Buf16(320),this.work=new v.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=j,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new v.Buf32(pe),e.distcode=e.distdyn=new v.Buf32(me),e.sane=1,e.back=-1,I):C}function a(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):C}function s(t,e){var n,r;return t&&t.state?(r=t.state,0>e?(n=0,e=-e):(n=(e>>4)+1,48>e&&(e&=15)),e&&(8>e||e>15)?C:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,a(t))):C}function u(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=s(t,e),n!==I&&(t.state=null),n):C}function c(t){return u(t,ve)}function f(t){if(_e){var e;for(m=new v.Buf32(512),g=new v.Buf32(32),e=0;144>e;)t.lens[e++]=8;for(;256>e;)t.lens[e++]=9;for(;280>e;)t.lens[e++]=7;for(;288>e;)t.lens[e++]=8;for(w(x,t.lens,0,288,m,0,t.work,{bits:9}),e=0;32>e;)t.lens[e++]=5;w(k,t.lens,0,32,g,0,t.work,{bits:5}),_e=!1}t.lencode=m,t.lenbits=9,t.distcode=g,t.distbits=5}function l(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new v.Buf8(o.wsize)),r>=o.wsize?(v.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),v.arraySet(o.window,e,n-r,i,o.wnext),r-=i,r?(v.arraySet(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function d(t,e){var n,i,o,a,s,u,c,d,h,p,m,g,pe,me,ge,ve,_e,ye,be,we,Ee,xe,ke,Se,Ae=0,Oe=new v.Buf8(4),Ie=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return C;n=t.state,n.mode===W&&(n.mode=q),s=t.next_out,o=t.output,c=t.avail_out,a=t.next_in,i=t.input,u=t.avail_in,d=n.hold,h=n.bits,p=u,m=c,xe=I;t:for(;;)switch(n.mode){case j:if(0===n.wrap){n.mode=q;break}for(;16>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(2&n.wrap&&35615===d){n.check=0,Oe[0]=255&d,Oe[1]=255&d>>>8,n.check=y(n.check,Oe,2,0),d=0,h=0,n.mode=B;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){t.msg="incorrect header check",n.mode=le;break}if((15&d)!==L){t.msg="unknown compression method",n.mode=le;break}if(d>>>=4,h-=4,Ee=(15&d)+8,0===n.wbits)n.wbits=Ee;else if(Ee>n.wbits){t.msg="invalid window size",n.mode=le;break}n.dmax=1<<Ee,t.adler=n.check=1,n.mode=512&d?X:W,d=0,h=0;break;case B:for(;16>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(n.flags=d,(255&n.flags)!==L){t.msg="unknown compression method",n.mode=le;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=le;break}n.head&&(n.head.text=1&d>>8),512&n.flags&&(Oe[0]=255&d,Oe[1]=255&d>>>8,n.check=y(n.check,Oe,2,0)),d=0,h=0,n.mode=F;case F:for(;32>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}n.head&&(n.head.time=d),512&n.flags&&(Oe[0]=255&d,Oe[1]=255&d>>>8,Oe[2]=255&d>>>16,Oe[3]=255&d>>>24,n.check=y(n.check,Oe,4,0)),d=0,h=0,n.mode=M;case M:for(;16>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}n.head&&(n.head.xflags=255&d,n.head.os=d>>8),512&n.flags&&(Oe[0]=255&d,Oe[1]=255&d>>>8,n.check=y(n.check,Oe,2,0)),d=0,h=0,n.mode=P;case P:if(1024&n.flags){for(;16>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}n.length=d,n.head&&(n.head.extra_len=d),512&n.flags&&(Oe[0]=255&d,Oe[1]=255&d>>>8,n.check=y(n.check,Oe,2,0)),d=0,h=0}else n.head&&(n.head.extra=null);n.mode=U;case U:if(1024&n.flags&&(g=n.length,g>u&&(g=u),g&&(n.head&&(Ee=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),v.arraySet(n.head.extra,i,a,g,Ee)),512&n.flags&&(n.check=y(n.check,i,g,a)),u-=g,a+=g,n.length-=g),n.length))break t;n.length=0,n.mode=V;case V:if(2048&n.flags){if(0===u)break t;g=0;do Ee=i[a+g++],n.head&&Ee&&65536>n.length&&(n.head.name+=String.fromCharCode(Ee));while(Ee&&u>g);if(512&n.flags&&(n.check=y(n.check,i,g,a)),u-=g,a+=g,Ee)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=Z;case Z:if(4096&n.flags){if(0===u)break t;g=0;do Ee=i[a+g++],n.head&&Ee&&65536>n.length&&(n.head.comment+=String.fromCharCode(Ee));while(Ee&&u>g);if(512&n.flags&&(n.check=y(n.check,i,g,a)),u-=g,a+=g,Ee)break t}else n.head&&(n.head.comment=null);n.mode=Y;case Y:if(512&n.flags){for(;16>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(d!==(65535&n.check)){t.msg="header crc mismatch",n.mode=le;break}d=0,h=0}n.head&&(n.head.hcrc=1&n.flags>>9,n.head.done=!0),t.adler=n.check=0,n.mode=W;break;case X:for(;32>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}t.adler=n.check=r(d),d=0,h=0,n.mode=H;case H:if(0===n.havedict)return t.next_out=s,t.avail_out=c,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,R;t.adler=n.check=1,n.mode=W;case W:if(e===A||e===O)break t;case q:if(n.last){d>>>=7&h,h-=7&h,n.mode=ue;break}for(;3>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}switch(n.last=1&d,d>>>=1,h-=1,3&d){case 0:n.mode=K;break;case 1:if(f(n),n.mode=ee,e===O){d>>>=2,h-=2;break t}break;case 2:n.mode=Q;break;case 3:t.msg="invalid block type",n.mode=le}d>>>=2,h-=2;break;case K:for(d>>>=7&h,h-=7&h;32>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if((65535&d)!==(65535^d>>>16)){t.msg="invalid stored block lengths",n.mode=le;break}if(n.length=65535&d,d=0,h=0,n.mode=J,e===O)break t;case J:n.mode=G;case G:if(g=n.length){if(g>u&&(g=u),g>c&&(g=c),0===g)break t;v.arraySet(o,i,a,g,s),u-=g,a+=g,c-=g,s+=g,n.length-=g;break}n.mode=W;break;case Q:for(;14>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(n.nlen=(31&d)+257,d>>>=5,h-=5,n.ndist=(31&d)+1,d>>>=5,h-=5,n.ncode=(15&d)+4,d>>>=4,h-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=le;break}n.have=0,n.mode=$;case $:for(;n.have<n.ncode;){for(;3>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}n.lens[Ie[n.have++]]=7&d,d>>>=3,h-=3}for(;19>n.have;)n.lens[Ie[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,ke={bits:n.lenbits},xe=w(E,n.lens,0,19,n.lencode,0,n.work,ke),n.lenbits=ke.bits,xe){t.msg="invalid code lengths set",n.mode=le;break}n.have=0,n.mode=te;case te:for(;n.have<n.nlen+n.ndist;){for(;Ae=n.lencode[d&(1<<n.lenbits)-1],ge=Ae>>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ge);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(16>_e)d>>>=ge,h-=ge,n.lens[n.have++]=_e;else{if(16===_e){for(Se=ge+2;Se>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(d>>>=ge,h-=ge,0===n.have){t.msg="invalid bit length repeat",n.mode=le;break}Ee=n.lens[n.have-1],g=3+(3&d),d>>>=2,h-=2}else if(17===_e){for(Se=ge+3;Se>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}d>>>=ge,h-=ge,Ee=0,g=3+(7&d),d>>>=3,h-=3}else{for(Se=ge+7;Se>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}d>>>=ge,h-=ge,Ee=0,g=11+(127&d),d>>>=7,h-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=le;break}for(;g--;)n.lens[n.have++]=Ee}}if(n.mode===le)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=le;break}if(n.lenbits=9,ke={bits:n.lenbits},xe=w(x,n.lens,0,n.nlen,n.lencode,0,n.work,ke),n.lenbits=ke.bits,xe){t.msg="invalid literal/lengths set",n.mode=le;break}if(n.distbits=6,n.distcode=n.distdyn,ke={bits:n.distbits},xe=w(k,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,ke),n.distbits=ke.bits,xe){t.msg="invalid distances set",n.mode=le;break}if(n.mode=ee,e===O)break t;case ee:n.mode=ne;case ne:if(u>=6&&c>=258){t.next_out=s,t.avail_out=c,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,b(t,m),s=t.next_out,o=t.output,c=t.avail_out,a=t.next_in,i=t.input,u=t.avail_in,d=n.hold,h=n.bits,n.mode===W&&(n.back=-1);break}for(n.back=0;Ae=n.lencode[d&(1<<n.lenbits)-1],ge=Ae>>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ge);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(ve&&0===(240&ve)){for(ye=ge,be=ve,we=_e;Ae=n.lencode[we+((d&(1<<ye+be)-1)>>ye)],ge=Ae>>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ye+ge);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}d>>>=ye,h-=ye,n.back+=ye}if(d>>>=ge,h-=ge,n.back+=ge,n.length=_e,0===ve){n.mode=se;break}if(32&ve){n.back=-1,n.mode=W;break}if(64&ve){t.msg="invalid literal/length code",n.mode=le;break}n.extra=15&ve,n.mode=re;case re:if(n.extra){for(Se=n.extra;Se>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}n.length+=d&(1<<n.extra)-1,d>>>=n.extra,h-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ie;case ie:for(;Ae=n.distcode[d&(1<<n.distbits)-1],ge=Ae>>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ge);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(0===(240&ve)){for(ye=ge,be=ve,we=_e;Ae=n.distcode[we+((d&(1<<ye+be)-1)>>ye)],ge=Ae>>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ye+ge);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}d>>>=ye,h-=ye,n.back+=ye}if(d>>>=ge,h-=ge,n.back+=ge,64&ve){t.msg="invalid distance code",n.mode=le;break}n.offset=_e,n.extra=15&ve,n.mode=oe;case oe:if(n.extra){for(Se=n.extra;Se>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}n.offset+=d&(1<<n.extra)-1,d>>>=n.extra,h-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=le;break}n.mode=ae;case ae:if(0===c)break t;if(g=m-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=le;break}g>n.wnext?(g-=n.wnext,pe=n.wsize-g):pe=n.wnext-g,g>n.length&&(g=n.length),me=n.window}else me=o,pe=s-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do o[s++]=me[pe++];while(--g);0===n.length&&(n.mode=ne);break;case se:if(0===c)break t;o[s++]=n.length,c--,n.mode=ne;break;case ue:if(n.wrap){for(;32>h;){if(0===u)break t;u--,d|=i[a++]<<h,h+=8}if(m-=c,t.total_out+=m,n.total+=m,m&&(t.adler=n.check=n.flags?y(n.check,o,m,s-m):_(n.check,o,m,s-m)),m=c,(n.flags?d:r(d))!==n.check){t.msg="incorrect data check",n.mode=le;break}d=0,h=0}n.mode=ce;case ce:if(n.wrap&&n.flags){for(;32>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(d!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=le;break}d=0,h=0}n.mode=fe;case fe:xe=T;break t;case le:xe=N;break t;case de:return D;case he:default:return C}return t.next_out=s,t.avail_out=c,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,(n.wsize||m!==t.avail_out&&le>n.mode&&(ue>n.mode||e!==S))&&l(t,t.output,t.next_out,m-t.avail_out)?(n.mode=de,D):(p-=t.avail_in,m-=t.avail_out,t.total_in+=p,t.total_out+=m,n.total+=m,n.wrap&&m&&(t.adler=n.check=n.flags?y(n.check,o,m,t.next_out-m):_(n.check,o,m,t.next_out-m)),t.data_type=n.bits+(n.last?64:0)+(n.mode===W?128:0)+(n.mode===ee||n.mode===J?256:0),(0===p&&0===m||e===S)&&xe===I&&(xe=z),xe)}function h(t){if(!t||!t.state)return C;var e=t.state;return e.window&&(e.window=null),t.state=null,I}function p(t,e){var n;return t&&t.state?(n=t.state,0===(2&n.wrap)?C:(n.head=e,e.done=!1,I)):C}var m,g,v=t("../utils/common"),_=t("./adler32"),y=t("./crc32"),b=t("./inffast"),w=t("./inftrees"),E=0,x=1,k=2,S=4,A=5,O=6,I=0,T=1,R=2,C=-2,N=-3,D=-4,z=-5,L=8,j=1,B=2,F=3,M=4,P=5,U=6,V=7,Z=8,Y=9,X=10,H=11,W=12,q=13,K=14,J=15,G=16,Q=17,$=18,te=19,ee=20,ne=21,re=22,ie=23,oe=24,ae=25,se=26,ue=27,ce=28,fe=29,le=30,de=31,he=32,pe=852,me=592,ge=15,ve=ge,_e=!0;n.inflateReset=a,n.inflateReset2=s,n.inflateResetKeep=o,n.inflateInit=c,n.inflateInit2=u,n.inflate=d,n.inflateEnd=h,n.inflateGetHeader=p,n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":28,"./adler32":30,"./crc32":32,"./inffast":35,"./inftrees":37}],37:[function(t,e){"use strict";var n=t("../utils/common"),r=15,i=852,o=592,a=0,s=1,u=2,c=[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,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[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,0,0],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,h,p,m,g,v,_){var y,b,w,E,x,k,S,A,O,I=_.bits,T=0,R=0,C=0,N=0,D=0,z=0,L=0,j=0,B=0,F=0,M=null,P=0,U=new n.Buf16(r+1),V=new n.Buf16(r+1),Z=null,Y=0;for(T=0;r>=T;T++)U[T]=0;for(R=0;p>R;R++)U[e[h+R]]++;for(D=I,N=r;N>=1&&0===U[N];N--);if(D>N&&(D=N),0===N)return m[g++]=20971520,m[g++]=20971520,_.bits=1,0;for(C=1;N>C&&0===U[C];C++);for(C>D&&(D=C),j=1,T=1;r>=T;T++)if(j<<=1,j-=U[T],0>j)return-1;if(j>0&&(t===a||1!==N))return-1;for(V[1]=0,T=1;r>T;T++)V[T+1]=V[T]+U[T];for(R=0;p>R;R++)0!==e[h+R]&&(v[V[e[h+R]]++]=R);switch(t){case a:M=Z=v,k=19;break;case s:M=c,P-=257,Z=f,Y-=257,k=256;break;default:M=l,Z=d,k=-1}if(F=0,R=0,T=C,x=g,z=D,L=0,w=-1,B=1<<D,E=B-1,t===s&&B>i||t===u&&B>o)return 1;for(var X=0;;){X++,S=T-L,k>v[R]?(A=0,O=v[R]):v[R]>k?(A=Z[Y+v[R]],O=M[P+v[R]]):(A=96,O=0),y=1<<T-L,b=1<<z,C=b;do b-=y,m[x+(F>>L)+b]=0|(S<<24|A<<16|O);while(0!==b);for(y=1<<T-1;F&y;)y>>=1;if(0!==y?(F&=y-1,F+=y):F=0,R++,0===--U[T]){if(T===N)break;T=e[h+v[R]]}if(T>D&&(F&E)!==w){for(0===L&&(L=D),x+=C,z=T-L,j=1<<z;N>z+L&&(j-=U[z+L],!(0>=j));)z++,j<<=1;if(B+=1<<z,t===s&&B>i||t===u&&B>o)return 1;w=F&E,m[w]=0|(D<<24|z<<16|x-g)}}return 0!==F&&(m[x+F]=0|(T-L<<24|64<<16)),_.bits=D,0}},{"../utils/common":28}],38:[function(t,e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],39:[function(t,e,n){"use strict";function r(t){for(var e=t.length;--e>=0;)t[e]=0}function i(t){return 256>t?ae[t]:ae[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=255&e>>>8}function a(t,e,n){t.bi_valid>W-n?(t.bi_buf|=65535&e<<t.bi_valid,o(t,t.bi_buf),t.bi_buf=e>>W-t.bi_valid,t.bi_valid+=n-W):(t.bi_buf|=65535&e<<t.bi_valid,t.bi_valid+=n)}function s(t,e,n){a(t,n[2*e],n[2*e+1])}function u(t,e){var n=0;do n|=1&t,t>>>=1,n<<=1;while(--e>0);return n>>>1}function c(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function f(t,e){var n,r,i,o,a,s,u=e.dyn_tree,c=e.max_code,f=e.stat_desc.static_tree,l=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(o=0;H>=o;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;X>n;n++)r=t.heap[n],o=u[2*u[2*r+1]+1]+1,o>p&&(o=p,m++),u[2*r+1]=o,r>c||(t.bl_count[o]++,a=0,r>=h&&(a=d[r-h]),s=u[2*r],t.opt_len+=s*(o+a),l&&(t.static_len+=s*(f[2*r+1]+a)));if(0!==m){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)i=t.heap[--n],i>c||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}function l(t,e,n){var r,i,o=Array(H+1),a=0;for(r=1;H>=r;r++)o[r]=a=a+n[r-1]<<1;for(i=0;e>=i;i++){var s=t[2*i+1];0!==s&&(t[2*i]=u(o[s]++,s))}}function d(){var t,e,n,r,i,o=Array(H+1);for(n=0,r=0;P-1>r;r++)for(ue[r]=n,t=0;1<<$[r]>t;t++)se[n++]=r;for(se[n-1]=r,i=0,r=0;16>r;r++)for(ce[r]=i,t=0;1<<te[r]>t;t++)ae[i++]=r;for(i>>=7;Z>r;r++)for(ce[r]=i<<7,t=0;1<<te[r]-7>t;t++)ae[256+i++]=r;for(e=0;H>=e;e++)o[e]=0;for(t=0;143>=t;)ie[2*t+1]=8,t++,o[8]++;for(;255>=t;)ie[2*t+1]=9,t++,o[9]++;for(;279>=t;)ie[2*t+1]=7,t++,o[7]++;for(;287>=t;)ie[2*t+1]=8,t++,o[8]++;for(l(ie,V+1,o),t=0;Z>t;t++)oe[2*t+1]=5,oe[2*t]=u(t,5);fe=new he(ie,$,U+1,V,H),le=new he(oe,te,0,Z,H),de=new he(Array(0),ee,0,Y,q)}function h(t){var e;for(e=0;V>e;e++)t.dyn_ltree[2*e]=0;for(e=0;Z>e;e++)t.dyn_dtree[2*e]=0;for(e=0;Y>e;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*K]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function p(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,n,r){p(t),r&&(o(t,n),o(t,~n)),R.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function g(t,e,n,r){var i=2*e,o=2*n;return t[i]<t[o]||t[i]===t[o]&&r[e]<=r[n]}function v(t,e,n){for(var r=t.heap[n],i=n<<1;t.heap_len>=i&&(t.heap_len>i&&g(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!g(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function _(t,e,n){var r,o,u,c,f=0;if(0!==t.last_lit)do r=t.pending_buf[t.d_buf+2*f]<<8|t.pending_buf[t.d_buf+2*f+1],o=t.pending_buf[t.l_buf+f],f++,0===r?s(t,o,e):(u=se[o],s(t,u+U+1,e),c=$[u],0!==c&&(o-=ue[u],a(t,o,c)),r--,u=i(r),s(t,u,n),c=te[u],0!==c&&(r-=ce[u],a(t,r,c)));while(t.last_lit>f);s(t,K,e)}function y(t,e){var n,r,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,u=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=X,n=0;u>n;n++)0!==o[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):o[2*n+1]=0;for(;2>t.heap_len;)i=t.heap[++t.heap_len]=2>c?++c:0,o[2*i]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=c,n=t.heap_len>>1;n>=1;n--)v(t,o,n);i=u;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],v(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,v(t,o,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],f(t,e),l(o,c,t.bl_count)}function b(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),e[2*(n+1)+1]=65535,r=0;n>=r;r++)i=a,a=e[2*(r+1)+1],u>++s&&i===a||(c>s?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[2*J]++):10>=s?t.bl_tree[2*G]++:t.bl_tree[2*Q]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function w(t,e,n){var r,i,o=-1,u=e[1],c=0,f=7,l=4;for(0===u&&(f=138,l=3),r=0;n>=r;r++)if(i=u,u=e[2*(r+1)+1],!(f>++c&&i===u)){if(l>c){do s(t,i,t.bl_tree);while(0!==--c)}else 0!==i?(i!==o&&(s(t,i,t.bl_tree),c--),s(t,J,t.bl_tree),a(t,c-3,2)):10>=c?(s(t,G,t.bl_tree),a(t,c-3,3)):(s(t,Q,t.bl_tree),a(t,c-11,7));c=0,o=i,0===u?(f=138,l=3):i===u?(f=6,l=3):(f=7,l=4)}}function E(t){var e;for(b(t,t.dyn_ltree,t.l_desc.max_code),b(t,t.dyn_dtree,t.d_desc.max_code),y(t,t.bl_desc),e=Y-1;e>=3&&0===t.bl_tree[2*ne[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function x(t,e,n,r){var i;for(a(t,e-257,5),a(t,n-1,5),a(t,r-4,4),i=0;r>i;i++)a(t,t.bl_tree[2*ne[i]+1],3);w(t,t.dyn_ltree,e-1),w(t,t.dyn_dtree,n-1)}function k(t){var e,n=4093624447;for(e=0;31>=e;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return N;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return D;for(e=32;U>e;e++)if(0!==t.dyn_ltree[2*e])return D;return N}function S(t){me||(d(),me=!0),t.l_desc=new pe(t.dyn_ltree,fe),t.d_desc=new pe(t.dyn_dtree,le),t.bl_desc=new pe(t.bl_tree,de),t.bi_buf=0,t.bi_valid=0,h(t)}function A(t,e,n,r){a(t,(L<<1)+(r?1:0),3),m(t,e,n,!0)}function O(t){a(t,j<<1,3),s(t,K,ie),c(t)}function I(t,e,n,r){var i,o,s=0;t.level>0?(t.strm.data_type===z&&(t.strm.data_type=k(t)),y(t,t.l_desc),y(t,t.d_desc),s=E(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,i>=o&&(i=o)):i=o=n+5,i>=n+4&&-1!==e?A(t,e,n,r):t.strategy===C||o===i?(a(t,(j<<1)+(r?1:0),3),_(t,ie,oe)):(a(t,(B<<1)+(r?1:0),3),x(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),_(t,t.dyn_ltree,t.dyn_dtree)),h(t),r&&p(t)}function T(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=255&e>>>8,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(se[n]+U+1)]++,t.dyn_dtree[2*i(e)]++),t.last_lit===t.lit_bufsize-1}var R=t("../utils/common"),C=4,N=0,D=1,z=2,L=0,j=1,B=2,F=3,M=258,P=29,U=256,V=U+1+P,Z=30,Y=19,X=2*V+1,H=15,W=16,q=7,K=256,J=16,G=17,Q=18,$=[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],te=[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],ee=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],re=512,ie=Array(2*(V+2));r(ie);var oe=Array(2*Z);r(oe);var ae=Array(re);r(ae);var se=Array(M-F+1);r(se);var ue=Array(P);r(ue);var ce=Array(Z);r(ce);var fe,le,de,he=function(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length},pe=function(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e},me=!1;n._tr_init=S,n._tr_stored_block=A,n._tr_flush_block=I,n._tr_tally=T,n._tr_align=O},{"../utils/common":28}],40:[function(t,e){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=n},{}],41:[function(t,e){var n="READ",r="WRITE",i="CREATE",o="EXCLUSIVE",a="TRUNCATE",s="APPEND",u="CREATE",c="REPLACE";e.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:n,O_WRITE:r,O_CREATE:i,O_EXCLUSIVE:o,O_TRUNCATE:a,O_APPEND:s,O_FLAGS:{r:[n],"r+":[n,r],w:[r,i,a],"w+":[r,n,i,a],wx:[r,i,o,a],"wx+":[r,n,i,o,a],a:[r,i,s],"a+":[r,n,i,s],ax:[r,i,o,s],"ax+":[r,n,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:""}}},{}],42:[function(t,e){var n=t("./constants.js").MODE_FILE;e.exports=function(t,e){this.id=t,this.type=e||n}},{"./constants.js":41}],43:[function(t,e){(function(t){function n(t){return t.toString("utf8")}function r(e){return new t(e,"utf8")}e.exports={encode:r,decode:n}}).call(this,t("buffer").Buffer)},{}],44:[function(t,e){var n={};["-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 e(t){this.message=t||o
}t=t.split(":");var r=t[0],i=t[1],o=t[2],a=e.prototype=Error();a.errno=r,a.code=i,a.constructor=e,n[i]=n[r]=e}),e.exports=n},{}],45:[function(t,e){(function(n){function r(t){return function(e,n){e?t(e):t(null,n)}}function i(t,e,n,r,i){function o(n){t.changes.push({event:"change",path:e}),i(n)}var a=t.flags;he(a).contains(Be)&&delete r.ctime,he(a).contains(je)&&delete r.mtime;var s=!1;r.ctime&&(n.ctime=r.ctime,n.atime=r.ctime,s=!0),r.atime&&(n.atime=r.atime,s=!0),r.mtime&&(n.mtime=r.mtime,s=!0),s?t.put(n.id,n,o):o()}function o(t,e,n,r){function o(n,i){n?r(n):i.mode!==Ee?r(new Me.ENOTDIR("a component of the path prefix is not a directory")):(l=i,a(t,e,s))}function s(e,n){!e&&n?r(new Me.EEXIST("path name already exists")):!e||e instanceof Me.ENOENT?t.get(l.data,u):r(e)}function u(e,i){e?r(e):(d=i,h=new Ze(void 0,n),h.nlinks+=1,t.put(h.id,h,f))}function c(e){if(e)r(e);else{var n=Date.now();i(t,m,h,{mtime:n,ctime:n},r)}}function f(e){e?r(e):(d[p]=new Pe(h.id,n),t.put(l.data,d,c))}if(n!==Ee&&n!==we)return r(new Me.EINVAL("mode must be a directory or file"));e=me(e);var l,d,h,p=ve(e),m=ge(e);a(t,m,o)}function a(t,e,n){function r(e,r){e?n(e):r&&r.mode===ke&&r.rnode?t.get(r.rnode,i):n(new Me.EFILESYSTEMERROR)}function i(t,e){t?n(t):e?n(null,e):n(new Me.ENOENT)}function o(e,r){e?n(e):r.mode===Ee&&r.data?t.get(r.data,s):n(new Me.ENOTDIR("a component of the path prefix is not a directory"))}function s(e,r){if(e)n(e);else if(he(r).has(f)){var i=r[f].id;t.get(i,u)}else n(new Me.ENOENT)}function u(t,e){t?n(t):e.mode==xe?(d++,d>Oe?n(new Me.ELOOP):c(e.data)):n(null,e)}function c(e){e=me(e),l=ge(e),f=ve(e),Se==f?t.get(Ae,r):a(t,l,o)}if(e=me(e),!e)return n(new Me.ENOENT("path is an empty string"));var f=ve(e),l=ge(e),d=0;Se==f?t.get(Ae,r):a(t,l,o)}function s(t,e,n,r,o,s){function u(e,a){function u(e){e?s(e):i(t,c,a,{ctime:Date.now()},s)}a?a.xattrs[n]:null,e?s(e):o===ze&&a.xattrs.hasOwnProperty(n)?s(new Me.EEXIST("attribute already exists")):o!==Le||a.xattrs.hasOwnProperty(n)?(a.xattrs[n]=r,t.put(a.id,a,u)):s(new Me.ENOATTR)}var c;"string"==typeof e?(c=e,a(t,e,u)):"object"==typeof e&&"string"==typeof e.id?(c=e.path,t.get(e.id,u)):s(new Me.EINVAL("path or file descriptor of wrong type"))}function u(t,e){function n(n,i){!n&&i?e(new Me.EEXIST):!n||n instanceof Me.ENOENT?(o=new Ve,t.put(o.id,o,r)):e(n)}function r(n){n?e(n):(a=new Ze(o.rnode,Ee),a.nlinks+=1,t.put(a.id,a,i))}function i(n){n?e(n):(s={},t.put(a.data,s,e))}var o,a,s;t.get(Ae,n)}function c(t,e,n){function r(e,r){!e&&r?n(new Me.EEXIST):!e||e instanceof Me.ENOENT?a(t,g,o):n(e)}function o(e,r){e?n(e):(h=r,t.get(h.data,s))}function s(e,r){e?n(e):(p=r,l=new Ze(void 0,Ee),l.nlinks+=1,t.put(l.id,l,u))}function u(e){e?n(e):(d={},t.put(l.data,d,f))}function c(e){if(e)n(e);else{var r=Date.now();i(t,g,h,{mtime:r,ctime:r},n)}}function f(e){e?n(e):(p[m]=new Pe(l.id,Ee),t.put(h.data,p,c))}e=me(e);var l,d,h,p,m=ve(e),g=ge(e);a(t,e,r)}function f(t,e,n){function r(e,r){e?n(e):(m=r,t.get(m.data,o))}function o(e,r){e?n(e):Se==v?n(new Me.EBUSY):he(r).has(v)?(g=r,h=g[v].id,t.get(h,s)):n(new Me.ENOENT)}function s(e,r){e?n(e):r.mode!=Ee?n(new Me.ENOTDIR):(h=r,t.get(h.data,u))}function u(t,e){t?n(t):(p=e,he(p).size()>0?n(new Me.ENOTEMPTY):f())}function c(e){if(e)n(e);else{var r=Date.now();i(t,_,m,{mtime:r,ctime:r},l)}}function f(){delete g[v],t.put(m.data,g,c)}function l(e){e?n(e):t.delete(h.id,d)}function d(e){e?n(e):t.delete(h.data,n)}e=me(e);var h,p,m,g,v=ve(e),_=ge(e);a(t,_,r)}function l(t,e,r,o){function s(e,n){e?o(e):(v=n,t.get(v.data,u))}function u(e,n){e?o(e):(_=n,he(_).has(E)?he(r).contains(Ce)?o(new Me.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists")):(y=_[E],y.type==Ee&&he(r).contains(Te)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):t.get(y.id,c)):he(r).contains(Re)?d():o(new Me.ENOENT("O_CREATE is not set and the named file does not exist")))}function c(t,e){if(t)o(t);else{var n=e;n.mode==xe?(k++,k>Oe?o(new Me.ELOOP):f(n.data)):l(void 0,n)}}function f(n){n=me(n),x=ge(n),E=ve(n),Se==E&&(he(r).contains(Te)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):a(t,e,l)),a(t,x,s)}function l(t,e){t?o(t):(b=e,o(null,b))}function d(){b=new Ze(void 0,we),b.nlinks+=1,t.put(b.id,b,h)}function h(e){e?o(e):(w=new n(0),w.fill(0),t.put(b.data,w,m))}function p(e){if(e)o(e);else{var n=Date.now();i(t,x,v,{mtime:n,ctime:n},g)}}function m(e){e?o(e):(_[E]=new Pe(b.id,we),t.put(v.data,_,p))}function g(t){t?o(t):o(null,b)}e=me(e);var v,_,y,b,w,E=ve(e),x=ge(e),k=0;Se==E?he(r).contains(Te)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):a(t,e,l):a(t,x,s)}function d(t,e,r,o,a,s){function u(t){t?s(t):s(null,a)}function c(n){if(n)s(n);else{var r=Date.now();i(t,e.path,d,{mtime:r,ctime:r},u)}}function f(e){e?s(e):t.put(d.id,d,c)}function l(i,u){if(i)s(i);else{d=u;var c=new n(a);c.fill(0),r.copy(c,0,o,o+a),e.position=a,d.size=a,d.version+=1,t.put(d.data,c,f)}}var d;t.get(e.id,l)}function h(t,e,r,o,a,s,u){function c(t){t?u(t):u(null,a)}function f(n){if(n)u(n);else{var r=Date.now();i(t,e.path,p,{mtime:r,ctime:r},c)}}function l(e){e?u(e):t.put(p.id,p,f)}function d(i,c){if(i)u(i);else{m=c;var f=void 0!==s&&null!==s?s:e.position,d=Math.max(m.length,f+a),h=new n(d);h.fill(0),m&&m.copy(h),r.copy(h,f,o,o+a),void 0===s&&(e.position+=a),p.size=d,p.version+=1,t.put(p.data,h,l)}}function h(e,n){e?u(e):(p=n,t.get(p.data,d))}var p,m;t.get(e.id,h)}function p(t,e,n,r,i,o,a){function s(t,s){if(t)a(t);else{f=s;var u=void 0!==o&&null!==o?o:e.position;i=u+i>n.length?i-u:i,f.copy(n,r,u,u+i),void 0===o&&(e.position+=i),a(null,i)}}function u(e,n){e?a(e):(c=n,t.get(c.data,s))}var c,f;t.get(e.id,u)}function m(t,e,n){e=me(e),ve(e),a(t,e,r(n))}function g(t,e,n){t.get(e.id,r(n))}function v(t,e,n){function i(e,r){e?n(e):(s=r,t.get(s.data,o))}function o(e,i){e?n(e):(u=i,he(u).has(c)?t.get(u[c].id,r(n)):n(new Me.ENOENT("a component of the path does not name an existing file")))}e=me(e);var s,u,c=ve(e),f=ge(e);Se==c?a(t,e,r(n)):a(t,f,i)}function _(t,e,n,r){function o(e){e?r(e):i(t,n,y,{ctime:Date.now()},r)}function s(e,n){e?r(e):(y=n,y.nlinks+=1,t.put(y.id,y,o))}function u(e){e?r(e):t.get(_[b].id,s)}function c(e,n){e?r(e):(_=n,he(_).has(b)?r(new Me.EEXIST("newpath resolves to an existing file")):(_[b]=g[h],t.put(v.data,_,u)))}function f(e,n){e?r(e):(v=n,t.get(v.data,c))}function l(e,n){e?r(e):(g=n,he(g).has(h)?a(t,w,f):r(new Me.ENOENT("a component of either path prefix does not exist")))}function d(e,n){e?r(e):(m=n,t.get(m.data,l))}e=me(e);var h=ve(e),p=ge(e);n=me(n);var m,g,v,_,y,b=ve(n),w=ge(n);a(t,p,d)}function y(t,e,n){function r(e){e?n(e):(delete l[h],t.put(f.data,l,function(){var e=Date.now();i(t,p,f,{mtime:e,ctime:e},n)}))}function o(e){e?n(e):t.delete(d.data,r)}function s(a,s){a?n(a):(d=s,d.nlinks-=1,1>d.nlinks?t.delete(d.id,o):t.put(d.id,d,function(){i(t,e,d,{ctime:Date.now()},r)}))}function u(e,r){e?n(e):(l=r,he(l).has(h)?t.get(l[h].id,s):n(new Me.ENOENT("a component of the path does not name an existing file")))}function c(e,r){e?n(e):(f=r,t.get(f.data,u))}e=me(e);var f,l,d,h=ve(e),p=ge(e);a(t,p,c)}function b(t,e,n){function r(t,e){if(t)n(t);else{s=e;var r=Object.keys(s);n(null,r)}}function i(e,i){e?n(e):(o=i,t.get(o.data,r))}e=me(e),ve(e);var o,s;a(t,e,i)}function w(t,e,n,r){function o(e,n){e?r(e):(l=n,t.get(l.data,s))}function s(t,e){t?r(t):(d=e,he(d).has(p)?r(new Me.EEXIST):u())}function u(){h=new Ze(void 0,xe),h.nlinks+=1,h.size=e.length,h.data=e,t.put(h.id,h,f)}function c(e){if(e)r(e);else{var n=Date.now();i(t,m,l,{mtime:n,ctime:n},r)}}function f(e){e?r(e):(d[p]=new Pe(h.id,xe),t.put(l.data,d,c))}n=me(n);var l,d,h,p=ve(n),m=ge(n);Se==p?r(new Me.EEXIST):a(t,m,o)}function E(t,e,n){function r(e,r){e?n(e):(s=r,t.get(s.data,i))}function i(e,r){e?n(e):(u=r,he(u).has(c)?t.get(u[c].id,o):n(new Me.ENOENT("a component of the path does not name an existing file")))}function o(t,e){t?n(t):e.mode!=xe?n(new Me.EINVAL("path not a symbolic link")):n(null,e.data)}e=me(e);var s,u,c=ve(e),f=ge(e);a(t,f,r)}function x(t,e,r,o){function s(e,n){e?o(e):n.mode==Ee?o(new Me.EISDIR):(l=n,t.get(l.data,u))}function u(e,i){if(e)o(e);else{var a=new n(r);a.fill(0),i&&i.copy(a),t.put(l.data,a,f)}}function c(n){if(n)o(n);else{var r=Date.now();i(t,e,l,{mtime:r,ctime:r},o)}}function f(e){e?o(e):(l.size=r,l.version+=1,t.put(l.id,l,c))}e=me(e);var l;0>r?o(new Me.EINVAL("length cannot be negative")):a(t,e,s)}function k(t,e,r,o){function a(e,n){e?o(e):n.mode==Ee?o(new Me.EISDIR):(f=n,t.get(f.data,s))}function s(e,i){if(e)o(e);else{var a;i?a=i.slice(0,r):(a=new n(r),a.fill(0)),t.put(f.data,a,c)}}function u(n){if(n)o(n);else{var r=Date.now();i(t,e.path,f,{mtime:r,ctime:r},o)}}function c(e){e?o(e):(f.size=r,f.version+=1,t.put(f.id,f,u))}var f;0>r?o(new Me.EINVAL("length cannot be negative")):t.get(e.id,a)}function S(t,e,n,r,o){function s(a,s){a?o(a):i(t,e,s,{atime:n,ctime:r,mtime:r},o)}e=me(e),"number"!=typeof n||"number"!=typeof r?o(new Me.EINVAL("atime and mtime must be number")):0>n||0>r?o(new Me.EINVAL("atime and mtime must be positive integers")):a(t,e,s)}function A(t,e,n,r,o){function a(a,s){a?o(a):i(t,e.path,s,{atime:n,ctime:r,mtime:r},o)}"number"!=typeof n||"number"!=typeof r?o(new Me.EINVAL("atime and mtime must be a number")):0>n||0>r?o(new Me.EINVAL("atime and mtime must be positive integers")):t.get(e.id,a)}function O(t,e,n,r,i,o){e=me(e),"string"!=typeof n?o(new Me.EINVAL("attribute name must be a string")):n?null!==i&&i!==ze&&i!==Le?o(new Me.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):s(t,e,n,r,i,o):o(new Me.EINVAL("attribute name cannot be an empty string"))}function I(t,e,n,r,i,o){"string"!=typeof n?o(new Me.EINVAL("attribute name must be a string")):n?null!==i&&i!==ze&&i!==Le?o(new Me.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):s(t,e,n,r,i,o):o(new Me.EINVAL("attribute name cannot be an empty string"))}function T(t,e,n,r){function i(t,e){e?e.xattrs[n]:null,t?r(t):e.xattrs.hasOwnProperty(n)?r(null,e.xattrs[n]):r(new Me.ENOATTR)}e=me(e),"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?a(t,e,i):r(new Me.EINVAL("attribute name cannot be an empty string"))}function R(t,e,n,r){function i(t,e){e?e.xattrs[n]:null,t?r(t):e.xattrs.hasOwnProperty(n)?r(null,e.xattrs[n]):r(new Me.ENOATTR)}"string"!=typeof n?r(new Me.EINVAL):n?t.get(e.id,i):r(new Me.EINVAL("attribute name cannot be an empty string"))}function C(t,e,n,r){function o(o,a){function s(n){n?r(n):i(t,e,a,{ctime:Date.now()},r)}var u=a?a.xattrs:null;o?r(o):u.hasOwnProperty(n)?(delete a.xattrs[n],t.put(a.id,a,s)):r(new Me.ENOATTR)}e=me(e),"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?a(t,e,o):r(new Me.EINVAL("attribute name cannot be an empty string"))}function N(t,e,n,r){function o(o,a){function s(n){n?r(n):i(t,e.path,a,{ctime:Date.now()},r)}o?r(o):a.xattrs.hasOwnProperty(n)?(delete a.xattrs[n],t.put(a.id,a,s)):r(new Me.ENOATTR)}"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?t.get(e.id,o):r(new Me.EINVAL("attribute name cannot be an empty string"))}function D(t){return he(De).has(t)?De[t]:null}function z(t,e,n){return t?"function"==typeof t?t={encoding:e,flag:n}:"string"==typeof t&&(t={encoding:t,flag:n}):t={encoding:e,flag:n},t}function L(t,e){var n;return ye(t)?n=Error("Path must be a string without null bytes."):_e(t)||(n=Error("Path must be absolute.")),n?(e(n),!1):!0}function j(t,e,n,r,i,o){function a(e,i){if(e)o(e);else{var a;a=he(r).contains(Ne)?i.size:0;var s=new Ue(n,i.id,r,a),u=t.allocDescriptor(s);o(null,u)}}o=arguments[arguments.length-1],L(n,o)&&(r=D(r),r||o(new Me.EINVAL("flags is not valid")),l(e,n,r,a))}function B(t,e,n,r){he(t.openFiles).has(n)?(t.releaseDescriptor(n),r(null)):r(new Me.EBADF)}function F(t,e,n,r,i){L(n,i)&&o(e,n,r,i)}function M(t,e,n,i,o){o=arguments[arguments.length-1],L(n,o)&&c(e,n,r(o))}function P(t,e,n,i){L(n,i)&&f(e,n,r(i))}function U(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}L(n,r)&&m(e,n,i)}function V(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}var o=t.openFiles[n];o?g(e,o,i):r(new Me.EBADF)}function Z(t,e,n,i,o){L(n,o)&&L(i,o)&&_(e,n,i,r(o))}function Y(t,e,n,i){L(n,i)&&y(e,n,r(i))}function X(t,e,n,i,o,a,s,u){function c(t,e){u(t,e||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[n];f?he(f.flags).contains(Ie)?p(e,f,i,o,a,s,r(c)):u(new Me.EBADF("descriptor does not permit reading")):u(new Me.EBADF)}function H(t,e,r,i,o){if(o=arguments[arguments.length-1],i=z(i,null,"r"),L(r,o)){var a=D(i.flag||"r");a||o(new Me.EINVAL("flags is not valid")),l(e,r,a,function(s,u){if(s)return o(s);var c=new Ue(r,u.id,a,0),f=t.allocDescriptor(c);g(e,c,function(r,a){if(r)return o(r);var s=new Ye(a,t.name),u=s.size,l=new n(u);l.fill(0),p(e,c,l,0,u,0,function(e){if(e)return o(e);t.releaseDescriptor(f);var n;n="utf8"===i.encoding?Fe.decode(l):l,o(null,n)})})})}}function W(t,e,n,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[n];c?he(c.flags).contains(Te)?a>i.length-o?u(new Me.EIO("intput buffer is too small")):h(e,c,i,o,a,s,r(u)):u(new Me.EBADF("descriptor does not permit writing")):u(new Me.EBADF)}function q(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=z(i,"utf8","w"),L(n,o)){var a=D(i.flag||"w");a||o(new Me.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Fe.encode(r)),l(e,n,a,function(i,s){if(i)return o(i);var u=new Ue(n,s.id,a,0),c=t.allocDescriptor(u);d(e,u,r,0,r.length,function(e){return e?o(e):(t.releaseDescriptor(c),o(null),void 0)})})}}function K(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=z(i,"utf8","a"),L(n,o)){var a=D(i.flag||"a");a||o(new Me.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Fe.encode(r)),l(e,n,a,function(i,s){if(i)return o(i);var u=new Ue(n,s.id,a,s.size),c=t.allocDescriptor(u);h(e,u,r,0,r.length,u.position,function(e){return e?o(e):(t.releaseDescriptor(c),o(null),void 0)})})}}function J(t,e,n,r){function i(t){r(t?!1:!0)}U(t,e,n,i)}function G(t,e,n,i,o){L(n,o)&&T(e,n,i,r(o))}function Q(t,e,n,i,o){var a=t.openFiles[n];a?R(e,a,i,r(o)):o(new Me.EBADF)}function $(t,e,n,i,o,a,s){"function"==typeof a&&(s=a,a=null),L(n,s)&&O(e,n,i,o,a,r(s))}function te(t,e,n,i,o,a,s){"function"==typeof a&&(s=a,a=null);var u=t.openFiles[n];u?he(u.flags).contains(Te)?I(e,u,i,o,a,r(s)):s(new Me.EBADF("descriptor does not permit writing")):s(new Me.EBADF)}function ee(t,e,n,i,o){L(n,o)&&C(e,n,i,r(o))}function ne(t,e,n,i,o){var a=t.openFiles[n];a?he(a.flags).contains(Te)?N(e,a,i,r(o)):o(new Me.EBADF("descriptor does not permit writing")):o(new Me.EBADF)}function re(t,e,n,r,i,o){function a(t,e){t?o(t):0>e.size+r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position=e.size+r,o(null,s.position))}var s=t.openFiles[n];s||o(new Me.EBADF),"SET"===i?0>r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position=r,o(null,s.position)):"CUR"===i?0>s.position+r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position+=r,o(null,s.position)):"END"===i?g(e,s,a):o(new Me.EINVAL("whence argument is not a proper value"))}function ie(t,e,n,i){L(n,i)&&b(e,n,r(i))}function oe(t,e,n,i,o,a){if(L(n,a)){var s=Date.now();i=i?i:s,o=o?o:s,S(e,n,i,o,r(a))}}function ae(t,e,n,i,o,a){var s=Date.now();i=i?i:s,o=o?o:s;var u=t.openFiles[n];u?he(u.flags).contains(Te)?A(e,u,i,o,r(a)):a(new Me.EBADF("descriptor does not permit writing")):a(new Me.EBADF)}function se(t,e,n,i,o){function a(t){t?o(t):y(e,n,r(o))}L(n,o)&&L(i,o)&&_(e,n,i,a)}function ue(t,e,n,i,o,a){a=arguments[arguments.length-1],L(n,a)&&L(i,a)&&w(e,n,i,r(a))}function ce(t,e,n,i){L(n,i)&&E(e,n,r(i))}function fe(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}L(n,r)&&v(e,n,i)}function le(t,e,n,i,o){o=arguments[arguments.length-1],i=i||0,L(n,o)&&x(e,n,i,r(o))}function de(t,e,n,i,o){o=arguments[arguments.length-1],i=i||0;var a=t.openFiles[n];a?he(a.flags).contains(Te)?k(e,a,i,r(o)):o(new Me.EBADF("descriptor does not permit writing")):o(new Me.EBADF)}var he=t("../../lib/nodash.js"),pe=t("../path.js"),me=pe.normalize,ge=pe.dirname,ve=pe.basename,_e=pe.isAbsolute,ye=pe.isNull,be=t("../constants.js"),we=be.MODE_FILE,Ee=be.MODE_DIRECTORY,xe=be.MODE_SYMBOLIC_LINK,ke=be.MODE_META,Se=be.ROOT_DIRECTORY_NAME,Ae=be.SUPER_NODE_ID,Oe=be.SYMLOOP_MAX,Ie=be.O_READ,Te=be.O_WRITE,Re=be.O_CREATE,Ce=be.O_EXCLUSIVE;be.O_TRUNCATE;var Ne=be.O_APPEND,De=be.O_FLAGS,ze=be.XATTR_CREATE,Le=be.XATTR_REPLACE,je=be.FS_NOMTIME,Be=be.FS_NOCTIME,Fe=t("../encoding.js"),Me=t("../errors.js"),Pe=t("../directory-entry.js"),Ue=t("../open-file-description.js"),Ve=t("../super-node.js"),Ze=t("../node.js"),Ye=t("../stats.js");e.exports={makeRootDirectory:u,open:j,close:B,mknod:F,mkdir:M,rmdir:P,unlink:Y,stat:U,fstat:V,link:Z,read:X,readFile:H,write:W,writeFile:q,appendFile:K,exists:J,getxattr:G,fgetxattr:Q,setxattr:$,fsetxattr:te,removexattr:ee,fremovexattr:ne,lseek:re,readdir:ie,utimes:oe,futimes:ae,rename:se,symlink:ue,readlink:ce,lstat:fe,truncate:le,ftruncate:de}}).call(this,t("buffer").Buffer)},{"../../lib/nodash.js":4,"../constants.js":41,"../directory-entry.js":42,"../encoding.js":43,"../errors.js":44,"../node.js":49,"../open-file-description.js":50,"../path.js":51,"../stats.js":60,"../super-node.js":61}],46:[function(t,e){function n(t){return"function"==typeof t?t:function(t){if(t)throw t}}function r(t,e){function n(){I.forEach(function(t){t.call(this)}.bind(S)),I=null}function r(t){if(t.length){var e=m.getInstance();t.forEach(function(t){e.emit(t.event,t.path)})}}t=t||{},e=e||a;var s=t.flags,p=t.provider||new h.Default(t.name||u),x=t.name||p.name,k=i(s).contains(c),S=this;S.readyState=l,S.name=x,S.error=null,S.stdin=_,S.stdout=y,S.stderr=b;var A={},O=w;Object.defineProperty(this,"openFiles",{get:function(){return A}}),this.allocDescriptor=function(t){var e=O++;return A[e]=t,e},this.releaseDescriptor=function(t){delete A[t]};var I=[];this.queueOrRun=function(t){var e;return f==S.readyState?t.call(S):d==S.readyState?e=new v.EFILESYSTEMERROR("unknown error"):I.push(t),e},this.watch=function(t,e,n){if(o(t))throw Error("Path must be a string without null bytes.");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||a;var r=new g;return r.start(t,!1,e.recursive),r.on("change",n),r},p.open(function(t,i){function o(t){function i(t){var e=p[t]();return e.flags=s,e.changes=[],e.close=function(){var t=e.changes;r(t),t.length=0},e}S.provider={openReadWriteContext:function(){return i("getReadWriteContext")},openReadOnlyContext:function(){return i("getReadOnlyContext")}},t?S.readyState=d:(S.readyState=f,n()),e(t,S)}if(t)return o(t);if(!k&&!i)return o(null);var a=p.getReadWriteContext();a.clear(function(t){return t?(o(t),void 0):(E.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,d=s.FS_ERROR,h=t("../providers/index.js"),p=t("../shell/shell.js"),m=t("../../lib/intercom.js"),g=t("../fs-watcher.js"),v=t("../errors.js"),_=s.STDIN,y=s.STDOUT,b=s.STDERR,w=s.FIRST_DESCRIPTOR,E=t("./implementation.js");r.providers=h,["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 e=this,r=Array.prototype.slice.call(arguments,0),i=r.length-1,o="function"!=typeof r[i],a=n(r[i]),s=e.queueOrRun(function(){function n(){s.close(),a.apply(e,arguments)}var s=e.provider.openReadWriteContext();o?r.push(n):r[i]=n;var u=[e,s].concat(r);E[t].apply(null,u)});s&&a(s)}}),r.prototype.Shell=function(t){return new p(this,t)},e.exports=r},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":41,"../errors.js":44,"../fs-watcher.js":47,"../path.js":51,"../providers/index.js":52,"../shared.js":56,"../shell/shell.js":59,"./implementation.js":45}],47:[function(t,e){function n(){function t(t){(e===t||a&&0===t.indexOf(e+"/"))&&n.trigger("change","change",t)}r.call(this);var e,n=this,a=!1;n.start=function(n,r,s){if(!e){if(i(n))throw Error("Path must be a string without null bytes.");e=n,a=s===!0;var u=o.getInstance();u.on("change",t)}},n.close=function(){var e=o.getInstance();e.off("change",t),n.removeAllListeners("change")}}var r=t("../lib/eventemitter.js"),i=t("./path.js").isNull,o=t("../lib/intercom.js");n.prototype=new r,n.prototype.constructor=n,e.exports=n},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":51}],48:[function(t,e){(function(n){e.exports={FileSystem:t("./filesystem/interface.js"),Buffer:n,Path:t("./path.js"),Errors:t("./errors.js")}}).call(this,t("buffer").Buffer)},{"./errors.js":44,"./filesystem/interface.js":46,"./path.js":51}],49:[function(t,e){var n=t("./constants.js").MODE_FILE,r=t("./shared.js").guid;e.exports=function(t,e,i,o,a,s,u,c,f,l){var d=Date.now();this.id=t||r(),this.mode=e||n,this.size=i||0,this.atime=o||d,this.ctime=a||d,this.mtime=s||d,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":41,"./shared.js":56}],50:[function(t,e){e.exports=function(t,e,n,r){this.path=t,this.id=e,this.flags=n,this.position=r}},{}],51:[function(t,e,n){function r(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var i=n>=0?arguments[n]:"/";"string"==typeof i&&i&&(t=i+"/"+t,e="/"===i.charAt(0))}return t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."}function o(t){var e="/"===t.charAt(0);return"/"===t.substr(-1),t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),t||e||(t="."),(e?"/":"")+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,e){function r(t){for(var e=0;t.length>e&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.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 e=p(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function c(t,e){var n=p(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),""===n?"/":n}function f(t){return p(t)[3]}function l(t){return"/"===t.charAt(0)?!0:!1}function d(t){return-1!==(""+t).indexOf("\0")?!0:!1}var h=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,p=function(t){var e=h.exec(t);return[e[1]||"",e[2]||"",e[3]||"",e[4]||""]};e.exports={normalize:o,resolve:i,join:a,relative:s,sep:"/",delimiter:":",dirname:u,basename:c,extname:f,isAbsolute:l,isNull:d}},{}],52:[function(t,e){var n=t("./indexeddb.js"),r=t("./websql.js"),i=t("./memory.js");e.exports={IndexedDB:n,WebSQL:r,Memory:i,Default:n,Fallback:function(){function t(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return n.isSupported()?n:r.isSupported()?r:(t.isSupported=function(){return!1},t)}()}},{"./indexeddb.js":53,"./memory.js":54,"./websql.js":55}],53:[function(t,e){(function(n){function r(t,e){var n=t.transaction(a,e);this.objectStore=n.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=n.indexedDB||n.mozIndexedDB||n.webkitIndexedDB||n.msIndexedDB;r.prototype.clear=function(t){try{var e=this.objectStore.clear();e.onsuccess=function(){t()},e.onerror=function(e){t(e)}}catch(n){t(n)}},r.prototype.get=function(t,e){try{var n=this.objectStore.get(t);n.onsuccess=function(t){var n=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(r){e(r)}},r.prototype.put=function(t,e,n){try{var r=this.objectStore.put(e,t);r.onsuccess=function(t){var e=t.target.result;n(null,e)},r.onerror=function(t){n(t)}}catch(i){n(i)}},r.prototype.delete=function(t,e){try{var n=this.objectStore.delete(t);n.onsuccess=function(t){var n=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(r){e(r)}},i.isSupported=function(){return!!c},i.prototype.open=function(t){var e=this;if(e.db)return t(null,!1),void 0;var n=!1,r=c.open(e.name);r.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(a)&&e.deleteObjectStore(a),e.createObjectStore(a),n=!0},r.onsuccess=function(r){e.db=r.target.result,t(null,n)},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)},e.exports=i})(this)},{"../constants.js":41,"../errors.js":44}],54:[function(t,e){function n(t,e){this.readOnly=e,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(e){var n=!t.hasOwnProperty(e);return n&&(t[e]={}),{firstAccess:n,db:t[e]}}}();n.prototype.clear=function(t){if(this.readOnly)return o(function(){t("[MemoryContext] Error: write operation on read only context")}),void 0;var e=this.objectStore;Object.keys(e).forEach(function(t){delete e[t]}),o(t)},n.prototype.get=function(t,e){var n=this;o(function(){e(null,n.objectStore[t])})},n.prototype.put=function(t,e,n){return this.readOnly?(o(function(){n("[MemoryContext] Error: write operation on read only context")}),void 0):(this.objectStore[t]=e,o(n),void 0)},n.prototype.delete=function(t,e){return this.readOnly?(o(function(){e("[MemoryContext] Error: write operation on read only context")}),void 0):(delete this.objectStore[t],o(e),void 0)},r.isSupported=function(){return!0},r.prototype.open=function(t){var e=a(this.name);this.db=e.db,o(function(){t(null,e.firstAccess)})},r.prototype.getReadOnlyContext=function(){return new n(this.db,!0)},r.prototype.getReadWriteContext=function(){return new n(this.db,!1)},e.exports=r},{"../../lib/async.js":1,"../constants.js":41}],55:[function(t,e){(function(n){function r(t,e){var n=this;this.getTransaction=function(r){return n.transaction?(r(n.transaction),void 0):(t[e?"readTransaction":"transaction"](function(t){n.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 e(e,n){t(n)}function n(){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+a+";",[],n,e)})},r.prototype.get=function(t,e){function n(t,n){var r=0===n.rows.length?null:n.rows.item(0).data;try{r&&(r=JSON.parse(r),r.__isUint8Array&&(r=new Uint8Array(r.__array))),e(null,r)}catch(i){e(i)}}function r(t,n){e(n)}this.getTransaction(function(e){e.executeSql("SELECT data FROM "+a+" WHERE id = ?;",[t],n,r)})},r.prototype.put=function(t,e,n){function r(){n(null)}function i(t,e){n(e)}"[object Uint8Array]"===Object.prototype.toString.call(e)&&(e={__isUint8Array:!0,__array:f(e)}),e=JSON.stringify(e),this.getTransaction(function(n){n.executeSql("INSERT OR REPLACE INTO "+a+" (id, data) VALUES (?, ?);",[t,e],r,i)})},r.prototype.delete=function(t,e){function n(){e(null)}function r(t,n){e(n)}this.getTransaction(function(e){e.executeSql("DELETE FROM "+a+" WHERE id = ?;",[t],n,r)})},i.isSupported=function(){return!!n.openDatabase},i.prototype.open=function(t){function e(e,n){5===n.code&&t(new l.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),t(n)}function r(e){function n(e,n){var r=0===n.rows.item(0).count;t(null,r)}function r(e,n){t(n)}i.db=o,e.executeSql("SELECT COUNT(id) AS count FROM "+a+";",[],n,r)}var i=this;if(i.db)return t(null,!1),void 0;var o=n.openDatabase(i.name,s,c,u);return o?(o.transaction(function(t){function n(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+a+"_id"+" on "+a+" (id);",[],r,e)}t.executeSql("CREATE TABLE IF NOT EXISTS "+a+" (id unique, data TEXT);",[],n,e)}),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)},e.exports=i})(this)},{"../constants.js":41,"../errors.js":44,"../shared.js":56}],56:[function(t,e){function n(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=0|16*Math.random(),n="x"==t?e:8|3&e;return n.toString(16)}).toUpperCase()}function r(){}function i(t){for(var e=[],n=t.length,r=0;n>r;r++)e[r]=t[r];return e}e.exports={guid:n,u8toArray:i,nop:r}},{}],57:[function(t,e){var n=t("../constants.js").ENVIRONMENT;e.exports=function(t){t=t||{},t.TMP=t.TMP||n.TMP,t.PATH=t.PATH||n.PATH,this.get=function(e){return t[e]},this.set=function(e,n){t[e]=n}}},{"../constants.js":41}],58:[function(t,e){var n=t("request");e.exports.download=function(t,e){n({url:t,method:"GET",encoding:null},function(t,n,r){var i,o;return n=n||null,i=n&&n.statusCode,(o=200!==i?{message:t||"Not found!",code:i}:null)?(e(o,null),void 0):(e(null,r),void 0)})}},{request:5}],59:[function(t,e){function n(t,e){e=e||{};var n=new o(e.env),a="/";Object.defineProperty(this,"fs",{get:function(){return t},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return n},enumerable:!0}),this.cd=function(e,n){e=r.resolve(this.cwd,e),t.stat(e,function(t,r){return t?(n(new i.ENOTDIR),void 0):("DIRECTORY"===r.type?(a=e,n()):n(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");t("../encoding.js");var u=t("jszip");n.prototype.exec=function(t,e,n){var i=this.fs;"function"==typeof e&&(n=e,e=[]),e=e||[],n=n||function(){},t=r.resolve(this.cwd,t),i.readFile(t,"utf8",function(t,r){if(t)return n(t),void 0;try{var o=Function("fs","args","callback",r);o(i,e,n)}catch(a){n(a)}})},n.prototype.touch=function(t,e,n){function i(t){a.writeFile(t,"",n)}function o(t){var r=Date.now(),i=e.date||r,o=e.date||r;a.utimes(t,i,o,n)}var a=this.fs;"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t=r.resolve(this.cwd,t),a.stat(t,function(r){r?e.updateOnly===!0?n():i(t):o(t)})},n.prototype.cat=function(t,e){function n(t,e){var n=r.resolve(this.cwd,t);o.readFile(n,"utf8",function(t,n){return t?(e(t),void 0):(s+=n+"\n",e(),void 0)})}var o=this.fs,s="";return e=e||function(){},t?(t="string"==typeof t?[t]:t,a.eachSeries(t,n,function(t){t?e(t):e(null,s.replace(/\n$/,""))}),void 0):(e(new i.EINVAL("Missing files argument")),void 0)},n.prototype.ls=function(t,e,n){function o(t,n){var i=r.resolve(this.cwd,t),u=[];s.readdir(i,function(t,c){function f(t,n){t=r.join(i,t),s.stat(t,function(a,s){if(a)return n(a),void 0;var c={path:r.basename(t),links:s.nlinks,size:s.size,modified:s.mtime,type:s.type};e.recursive&&"DIRECTORY"===s.type?o(r.join(i,c.path),function(t,e){return t?(n(t),void 0):(c.contents=e,u.push(c),n(),void 0)}):(u.push(c),n())})}return t?(n(t),void 0):(a.each(c,f,function(t){n(t,u)}),void 0)})}var s=this.fs;return"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t?(o(t,n),void 0):(n(new i.EINVAL("Missing dir argument")),void 0)},n.prototype.rm=function(t,e,n){function o(t,n){t=r.resolve(this.cwd,t),s.stat(t,function(u,c){return u?(n(u),void 0):"FILE"===c.type?(s.unlink(t,n),void 0):(s.readdir(t,function(u,c){return u?(n(u),void 0):0===c.length?(s.rmdir(t,n),void 0):e.recursive?(c=c.map(function(e){return r.join(t,e)
}),a.each(c,o,function(e){return e?(n(e),void 0):(s.rmdir(t,n),void 0)}),void 0):(n(new i.ENOTEMPTY),void 0)}),void 0)})}var s=this.fs;return"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t?(o(t,n),void 0):(n(new i.EINVAL("Missing path argument")),void 0)},n.prototype.tempDir=function(t){var e=this.fs,n=this.env.get("TMP");t=t||function(){},e.mkdir(n,function(){t(null,n)})},n.prototype.mkdirp=function(t,e){function n(t,e){o.stat(t,function(a,s){if(s){if(s.isDirectory())return e(),void 0;if(s.isFile())return e(new i.ENOTDIR),void 0}else{if(a&&"ENOENT"!==a.code)return e(a),void 0;var u=r.dirname(t);"/"===u?o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(e(t),void 0):(e(),void 0)}):n(u,function(n){return n?e(n):(o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(e(t),void 0):(e(),void 0)}),void 0)})}})}var o=this.fs;return e=e||function(){},t?"/"===t?(e(),void 0):(n(t,e),void 0):(e(new i.EINVAL("Missing path argument")),void 0)},n.prototype.wget=function(t,e,n){function o(){n(Error("unable to get resource"))}var a=this.fs;if("function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},!t)return n(new i.EINVAL("missing url argument")),void 0;var u=e.filename||t.split("/").pop();u=r.resolve(a.cwd,u),s.download(t,function(t,e){return t||!e?o():(a.writeFile(u,e,function(t){t?n(t):n(null,u)}),void 0)})},n.prototype.unzip=function(t,e,n){var o=this.fs,s=this;if("function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},!t)return n(new i.EINVAL("missing zipfile argument")),void 0;var c=r.resolve(this.cwd,t),f=r.resolve(e.destination||this.cwd);o.readFile(c,function(t,e){function i(t,e){t.isDirectory?s.mkdirp(t.absPath,e):o.writeFile(t.absPath,t.data,e)}if(t)return n(t);var c=new u(e),l=[];c.filter(function(t,e){var n=e.options.dir,i=n?null:e.asNodeBuffer();l.push({absPath:r.join(f,e.name),isDirectory:n,data:i})}),a.eachSeries(l,i,n)})},n.prototype.zip=function(t,e,n,o){function s(t){return t.replace(/^\//,"")}function c(t,e){d.readFile(t,function(n,r){return n?e(n):(p.file(s(t),r,{binary:!0}),e(),void 0)})}function f(t,e){d.readdir(t,function(i,o){p.folder(s(t)),n.recursive||e(),a.eachSeries(o,function(e,n){l(r.join(t,e),n)},e)})}function l(t,e){t=r.resolve(h.cwd,t),d.stat(t,function(n,r){return n?e(n):(r.isDirectory()?f(t,e):c(t,e),void 0)})}var d=this.fs,h=this;if("function"==typeof n&&(o=n,n={}),n=n||{},o=o||function(){},!t)return o(new i.EINVAL("missing zipfile argument")),void 0;if(!e)return o(new i.EINVAL("missing paths argument")),void 0;"string"==typeof e&&(e=[e]),t=r.resolve(this.cwd,t);var p=new u;d.stat(t,function(n,r){return r?o(new i.EEXIST("zipfile already exists")):(a.eachSeries(e,l,function(e){if(e)return o(e);var n;n=p.generate({type:"nodebuffer"}),d.writeFile(t,n,o)}),void 0)})},e.exports=n},{"../../lib/async.js":1,"../encoding.js":43,"../errors.js":44,"../path.js":51,"./environment.js":57,"./network.js":58,jszip:13}],60:[function(t,e){function n(t,e){this.node=t.id,this.dev=e,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");n.prototype.isFile=function(){return this.type===r.MODE_FILE},n.prototype.isDirectory=function(){return this.type===r.MODE_DIRECTORY},n.prototype.isSymbolicLink=function(){return this.type===r.MODE_SYMBOLIC_LINK},n.prototype.isSocket=n.prototype.isFIFO=n.prototype.isCharacterDevice=n.prototype.isBlockDevice=function(){return!1},e.exports=n},{"./constants.js":41}],61:[function(t,e){var n=t("./constants.js"),r=t("./shared.js").guid;e.exports=function(t,e,i){var o=Date.now();this.id=n.SUPER_NODE_ID,this.mode=n.MODE_META,this.atime=t||o,this.ctime=e||o,this.mtime=i||o,this.rnode=r()}},{"./constants.js":41,"./shared.js":56}]},{},[48])(48)});