6 lines
150 KiB
JavaScript
6 lines
150 KiB
JavaScript
/*! filer 0.0.15 2014-07-15 */
|
||
!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 f=n[a]={exports:{}};t[a][0].call(f.exports,function(e){var n=t[a][1][e];return i(n?n:e)},f,f.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},f=function(t,e,n){return t.reduce?t.reduce(e,n):(s(t,function(t,r,i){n=e(n,t,r,i)}),n)},c=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))}},g=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(g),a.mapSeries=p(g),a.mapLimit=function(t,e,n,r){return m(e)(t,n,r)};var m=function(t){return h(t,g)};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 y=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(y),a.rejectSeries=p(y);var b=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(b),a.detectSeries=p(b),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=c(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(){c(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(c(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 f(h,function(t,e){return t&&r.hasOwnProperty(e)},!0)&&!r.hasOwnProperty(n)};if(p())i[i.length-1](d,r);else{var g=function(){p()&&(u(g),i[i.length-1](d,r))};o(g)}})},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 _=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(c(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){_({map:a.map,each:a.each},t,e)},a.parallelLimit=function(t,e,n){_({map:m(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(c(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),f=u(a,function(t){return t.data});i.empty&&i.empty(),n=!0,t(f,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 I=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(I),a.applyEachSeries=p(I),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("JkpR2F"))},{JkpR2F:9}],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(c);if(d&&r>l-d)return u||(o._on("storage",e),u=!0),f=setTimeout(e,i),void 0;a=!0,s.setItem(c,l),t(),n()}}function n(){u&&o._off("storage",e),f&&clearTimeout(f),s.removeItem(c)}var r=1e3,i=20,o=this,a=!1,u=!1,f=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(f)||"{}")}catch(i){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],r++);r>0&&s.setItem(f,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(f)||"{}")}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(f,JSON.stringify(i)),e(),setTimeout(function(){r._cleanup_once()},50))})}},r(i.prototype,o.prototype),i.supported=s!==void 0;var u="intercom",f="intercom_once",c="intercom_lock",l=5e4,d=36e5;i.destroy=function(){s.removeItem(c),s.removeItem(u),s.removeItem(f)},i.getInstance=function(){var t;return function(){return t||(t=new i),t}}(),e.exports=i},{"../src/shared.js":59,"./eventemitter.js":2}],4:[function(t,e){function n(t,e){return g.call(t,e)}function r(t){return null==t?0:t.length===+t.length?t.length:y(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 f(t){return t&&"object"==typeof t&&!Array.isArray(t)&&g.call(t,"__wrapped__")?t:new u(t)}var c=Array.prototype,l=c.forEach,d=c.indexOf,h=c.some,p=Object.prototype,g=p.hasOwnProperty,m=Object.keys,v={},y=m||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=f},{}],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"],f=0;s.length>f;f++)if(t[s[f]])throw Error("options."+s[f]+" 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 c=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:c(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=c(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:c._id,milliseconds:e.timeout}),e.callback(t,c)}function i(){if(d)return n.log.debug("Ignoring timed out state change",{state:c.readyState,id:c.id});if(n.log.debug("State change",{state:c.readyState,id:c.id,timed_out:d}),c.readyState===f.OPENED){n.log.debug("Request started",{id:c.id});for(var t in e.headers)c.setRequestHeader(t,e.headers[t])}else c.readyState===f.HEADERS_RECEIVED?o():c.readyState===f.LOADING?(o(),a()):c.readyState===f.DONE&&(o(),a(),u())}function o(){if(!m.response){if(m.response=!0,n.log.debug("Got response",{id:c.id,status:c.status}),clearTimeout(c.timeoutTimer),c.statusCode=c.status,h&&0==c.statusCode){var t=Error("CORS request rejected: "+e.uri);return t.cors="rejected",m.loading=!0,m.end=!0,e.callback(t,c)}e.onResponse(null,c)}}function a(){m.loading||(m.loading=!0,n.log.debug("Response body loading",{id:c.id}))}function u(){if(!m.end){if(m.end=!0,n.log.debug("Request done",{id:c.id}),null===e.encoding)c.body=new t(new Uint8Array(c.response));else if(c.body=c.responseText,e.json)try{c.body=JSON.parse(c.responseText)}catch(r){return e.callback(r,c)}e.callback(null,c,c.body)}}var c=new f,d=!1,h=s(e.uri),p="withCredentials"in c;if(l+=1,c.seq_id=l,c.id=l+": "+e.method+" "+e.uri,c._id=c.id,h&&!p){var g=Error("Browser does not support cross-origin request: "+e.uri);return g.cors="unsupported",e.callback(g,c)}c.timeoutTimer=setTimeout(r,e.timeout);var m={response:!1,loading:!1,end:!1};return c.onreadystatechange=i,c.open(e.method,e.uri,!0),null===e.encoding&&(c.responseType="arraybuffer"),h&&(c.withCredentials=!!e.withCredentials),c.send(e.body),c}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,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,d="",h=[];if(!t)return t;do e=t.charCodeAt(c++),n=t.charCodeAt(c++),r=t.charCodeAt(c++),u=e<<16|n<<8|r,i=63&u>>18,o=63&u>>12,a=63&u>>6,s=63&u,h[l++]=f.charAt(i)+f.charAt(o)+f.charAt(a)+f.charAt(s);while(t.length>c);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 f=XMLHttpRequest;if(!f)throw Error("missing XMLHttpRequest");n.log={trace:i,debug:i,info:i,warn:i,error:i};var c=18e4,l=0;n.withCredentials=!1,n.DEFAULT_TIMEOUT=c,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)},{buffer:6}],6:[function(t,e,n){function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);var i=typeof t;"base64"===e&&"string"===i&&(t=O(t));var o;if("number"===i)o=R(t);else if("string"===i)o=r.byteLength(t,e);else{if("object"!==i)throw Error("First argument needs to be a number, array or string.");o=R(t.length)}var a;r._useTypedArrays?a=r._augment(new Uint8Array(o)):(a=this,a.length=o,a._isBuffer=!0);var s;if(r._useTypedArrays&&"number"==typeof t.byteLength)a._set(t);else if(D(t))if(r.isBuffer(t))for(s=0;o>s;s++)a[s]=t.readUInt8(s);else for(s=0;o>s;s++)a[s]=(t[s]%256+256)%256;else if("string"===i)a.write(t,0,e);else if("number"===i&&!r._useTypedArrays&&!n)for(s=0;o>s;s++)a[s]=0;return a}function i(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;Y(0===o%2,"Invalid hex string"),r>o/2&&(r=o/2);for(var a=0;r>a;a++){var s=parseInt(e.substr(2*a,2),16);Y(!isNaN(s),"Invalid hex string"),t[n+a]=s}return a}function o(t,e,n,r){var i=M(L(e),t,n,r);return i}function a(t,e,n,r){var i=M(z(e),t,n,r);return i}function s(t,e,n,r){return a(t,e,n,r)}function u(t,e,n,r){var i=M(F(e),t,n,r);return i}function f(t,e,n,r){var i=M(j(e),t,n,r);return i}function c(t,e,n){return 0===e&&n===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(e,n))}function l(t,e,n){var r="",i="";n=Math.min(t.length,n);for(var o=e;n>o;o++)127>=t[o]?(r+=U(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return r+U(i)}function d(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(t[i]);return r}function h(t,e,n){return d(t,e,n)}function p(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=B(t[o]);return i}function g(t,e,n){for(var r=t.slice(e,n),i="",o=0;r.length>o;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function m(t,e,n,r){r||(Y("boolean"==typeof n,"missing or invalid endian"),Y(void 0!==e&&null!==e,"missing offset"),Y(t.length>e+1,"Trying to read beyond buffer length"));var i=t.length;if(!(e>=i)){var o;return n?(o=t[e],i>e+1&&(o|=t[e+1]<<8)):(o=t[e]<<8,i>e+1&&(o|=t[e+1])),o}}function v(t,e,n,r){r||(Y("boolean"==typeof n,"missing or invalid endian"),Y(void 0!==e&&null!==e,"missing offset"),Y(t.length>e+3,"Trying to read beyond buffer length"));var i=t.length;if(!(e>=i)){var o;return n?(i>e+2&&(o=t[e+2]<<16),i>e+1&&(o|=t[e+1]<<8),o|=t[e],i>e+3&&(o+=t[e+3]<<24>>>0)):(i>e+1&&(o=t[e+1]<<16),i>e+2&&(o|=t[e+2]<<8),i>e+3&&(o|=t[e+3]),o+=t[e]<<24>>>0),o}}function y(t,e,n,r){r||(Y("boolean"==typeof n,"missing or invalid endian"),Y(void 0!==e&&null!==e,"missing offset"),Y(t.length>e+1,"Trying to read beyond buffer length"));var i=t.length;if(!(e>=i)){var o=m(t,e,n,!0),a=32768&o;return a?-1*(65535-o+1):o}}function b(t,e,n,r){r||(Y("boolean"==typeof n,"missing or invalid endian"),Y(void 0!==e&&null!==e,"missing offset"),Y(t.length>e+3,"Trying to read beyond buffer length"));var i=t.length;if(!(e>=i)){var o=v(t,e,n,!0),a=2147483648&o;return a?-1*(4294967295-o+1):o}}function _(t,e,n,r){return r||(Y("boolean"==typeof n,"missing or invalid endian"),Y(t.length>e+3,"Trying to read beyond buffer length")),H.read(t,e,n,23,4)}function w(t,e,n,r){return r||(Y("boolean"==typeof n,"missing or invalid endian"),Y(t.length>e+7,"Trying to read beyond buffer length")),H.read(t,e,n,52,8)}function E(t,e,n,r,i){i||(Y(void 0!==e&&null!==e,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(void 0!==n&&null!==n,"missing offset"),Y(t.length>n+1,"trying to write beyond buffer length"),P(e,65535));var o=t.length;if(!(n>=o)){for(var a=0,s=Math.min(o-n,2);s>a;a++)t[n+a]=(e&255<<8*(r?a:1-a))>>>8*(r?a:1-a);return n+2}}function I(t,e,n,r,i){i||(Y(void 0!==e&&null!==e,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(void 0!==n&&null!==n,"missing offset"),Y(t.length>n+3,"trying to write beyond buffer length"),P(e,4294967295));var o=t.length;if(!(n>=o)){for(var a=0,s=Math.min(o-n,4);s>a;a++)t[n+a]=255&e>>>8*(r?a:3-a);return n+4}}function x(t,e,n,r,i){i||(Y(void 0!==e&&null!==e,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(void 0!==n&&null!==n,"missing offset"),Y(t.length>n+1,"Trying to write beyond buffer length"),V(e,32767,-32768));var o=t.length;if(!(n>=o))return e>=0?E(t,e,n,r,i):E(t,65535+e+1,n,r,i),n+2}function k(t,e,n,r,i){i||(Y(void 0!==e&&null!==e,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(void 0!==n&&null!==n,"missing offset"),Y(t.length>n+3,"Trying to write beyond buffer length"),V(e,2147483647,-2147483648));var o=t.length;if(!(n>=o))return e>=0?I(t,e,n,r,i):I(t,4294967295+e+1,n,r,i),n+4}function A(t,e,n,r,i){i||(Y(void 0!==e&&null!==e,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(void 0!==n&&null!==n,"missing offset"),Y(t.length>n+3,"Trying to write beyond buffer length"),Z(e,3.4028234663852886e38,-3.4028234663852886e38));var o=t.length;if(!(n>=o))return H.write(t,e,n,r,23,4),n+4}function S(t,e,n,r,i){i||(Y(void 0!==e&&null!==e,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(void 0!==n&&null!==n,"missing offset"),Y(t.length>n+7,"Trying to write beyond buffer length"),Z(e,1.7976931348623157e308,-1.7976931348623157e308));var o=t.length;if(!(n>=o))return H.write(t,e,n,r,52,8),n+8}function O(t){for(t=T(t).replace(q,"");0!==t.length%4;)t+="=";return t}function T(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function C(t,e,n){return"number"!=typeof t?n:(t=~~t,t>=e?e:t>=0?t:(t+=e,t>=0?t:0))}function R(t){return t=~~Math.ceil(+t),0>t?0:t}function N(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function D(t){return N(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function B(t){return 16>t?"0"+t.toString(16):t.toString(16)}function L(t){for(var e=[],n=0;t.length>n;n++){var r=t.charCodeAt(n);if(127>=r)e.push(r);else{var i=n;r>=55296&&57343>=r&&n++;for(var o=encodeURIComponent(t.slice(i,n+1)).substr(1).split("%"),a=0;o.length>a;a++)e.push(parseInt(o[a],16))}}return e}function z(t){for(var e=[],n=0;t.length>n;n++)e.push(255&t.charCodeAt(n));return e}function j(t){for(var e,n,r,i=[],o=0;t.length>o;o++)e=t.charCodeAt(o),n=e>>8,r=e%256,i.push(r),i.push(n);return i}function F(t){return X.toByteArray(t)}function M(t,e,n,r){for(var i=0;r>i&&!(i+n>=e.length||i>=t.length);i++)e[i+n]=t[i];return i}function U(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function P(t,e){Y("number"==typeof t,"cannot write a non-number as a number"),Y(t>=0,"specified a negative value for writing an unsigned value"),Y(e>=t,"value is larger than maximum value for type"),Y(Math.floor(t)===t,"value has a fractional component")}function V(t,e,n){Y("number"==typeof t,"cannot write a non-number as a number"),Y(e>=t,"value larger than maximum allowed value"),Y(t>=n,"value smaller than minimum allowed value"),Y(Math.floor(t)===t,"value has a fractional component")}function Z(t,e,n){Y("number"==typeof t,"cannot write a non-number as a number"),Y(e>=t,"value larger than maximum allowed value"),Y(t>=n,"value smaller than minimum allowed value")}function Y(t,e){if(!t)throw Error(e||"Failed assertion")}var X=t("base64-js"),H=t("ieee754");n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192,r._useTypedArrays=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(n){return!1}}(),r.isEncoding=function(t){switch((t+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.isBuffer=function(t){return!(null===t||void 0===t||!t._isBuffer)},r.byteLength=function(t,e){var n;switch(t=""+t,e||"utf8"){case"hex":n=t.length/2;break;case"utf8":case"utf-8":n=L(t).length;break;case"ascii":case"binary":case"raw":n=t.length;break;case"base64":n=F(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;default:throw Error("Unknown encoding")}return n},r.concat=function(t,e){if(Y(N(t),"Usage: Buffer.concat(list[, length])"),0===t.length)return new r(0);if(1===t.length)return t[0];var n;if(void 0===e)for(e=0,n=0;t.length>n;n++)e+=t[n].length;var i=new r(e),o=0;for(n=0;t.length>n;n++){var a=t[n];a.copy(i,o),o+=a.length}return i},r.compare=function(t,e){Y(r.isBuffer(t)&&r.isBuffer(e),"Arguments must be Buffers");for(var n=t.length,i=e.length,o=0,a=Math.min(n,i);a>o&&t[o]===e[o];o++);return o!==a&&(n=t[o],i=e[o]),i>n?-1:n>i?1:0},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var c=r;r=e,e=n,n=c}e=Number(e)||0;var l=this.length-e;n?(n=Number(n),n>l&&(n=l)):n=l,r=((r||"utf8")+"").toLowerCase();var d;switch(r){case"hex":d=i(this,t,e,n);break;case"utf8":case"utf-8":d=o(this,t,e,n);break;case"ascii":d=a(this,t,e,n);break;case"binary":d=s(this,t,e,n);break;case"base64":d=u(this,t,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=f(this,t,e,n);break;default:throw Error("Unknown encoding")}return d},r.prototype.toString=function(t,e,n){var r=this;if(t=((t||"utf8")+"").toLowerCase(),e=Number(e)||0,n=void 0===n?r.length:Number(n),n===e)return"";var i;switch(t){case"hex":i=p(r,e,n);break;case"utf8":case"utf-8":i=l(r,e,n);break;case"ascii":i=d(r,e,n);break;case"binary":i=h(r,e,n);break;case"base64":i=c(r,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(r,e,n);
|
||
break;default:throw Error("Unknown encoding")}return i},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.equals=function(t){return Y(r.isBuffer(t),"Argument must be a Buffer"),0===r.compare(this,t)},r.prototype.compare=function(t){return Y(r.isBuffer(t),"Argument must be a Buffer"),r.compare(this,t)},r.prototype.copy=function(t,e,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),e||(e=0),i!==n&&0!==t.length&&0!==o.length){Y(i>=n,"sourceEnd < sourceStart"),Y(e>=0&&t.length>e,"targetStart out of bounds"),Y(n>=0&&o.length>n,"sourceStart out of bounds"),Y(i>=0&&o.length>=i,"sourceEnd out of bounds"),i>this.length&&(i=this.length),i-n>t.length-e&&(i=t.length-e+n);var a=i-n;if(100>a||!r._useTypedArrays)for(var s=0;a>s;s++)t[s+e]=this[s+n];else t._set(this.subarray(n,n+a),e)}},r.prototype.slice=function(t,e){var n=this.length;if(t=C(t,n,0),e=C(e,n,n),r._useTypedArrays)return r._augment(this.subarray(t,e));for(var i=e-t,o=new r(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+t];return o},r.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},r.prototype.readUInt8=function(t,e){return e||(Y(void 0!==t&&null!==t,"missing offset"),Y(this.length>t,"Trying to read beyond buffer length")),t>=this.length?void 0:this[t]},r.prototype.readUInt16LE=function(t,e){return m(this,t,!0,e)},r.prototype.readUInt16BE=function(t,e){return m(this,t,!1,e)},r.prototype.readUInt32LE=function(t,e){return v(this,t,!0,e)},r.prototype.readUInt32BE=function(t,e){return v(this,t,!1,e)},r.prototype.readInt8=function(t,e){if(e||(Y(void 0!==t&&null!==t,"missing offset"),Y(this.length>t,"Trying to read beyond buffer length")),!(t>=this.length)){var n=128&this[t];return n?-1*(255-this[t]+1):this[t]}},r.prototype.readInt16LE=function(t,e){return y(this,t,!0,e)},r.prototype.readInt16BE=function(t,e){return y(this,t,!1,e)},r.prototype.readInt32LE=function(t,e){return b(this,t,!0,e)},r.prototype.readInt32BE=function(t,e){return b(this,t,!1,e)},r.prototype.readFloatLE=function(t,e){return _(this,t,!0,e)},r.prototype.readFloatBE=function(t,e){return _(this,t,!1,e)},r.prototype.readDoubleLE=function(t,e){return w(this,t,!0,e)},r.prototype.readDoubleBE=function(t,e){return w(this,t,!1,e)},r.prototype.writeUInt8=function(t,e,n){return n||(Y(void 0!==t&&null!==t,"missing value"),Y(void 0!==e&&null!==e,"missing offset"),Y(this.length>e,"trying to write beyond buffer length"),P(t,255)),e>=this.length?void 0:(this[e]=t,e+1)},r.prototype.writeUInt16LE=function(t,e,n){return E(this,t,e,!0,n)},r.prototype.writeUInt16BE=function(t,e,n){return E(this,t,e,!1,n)},r.prototype.writeUInt32LE=function(t,e,n){return I(this,t,e,!0,n)},r.prototype.writeUInt32BE=function(t,e,n){return I(this,t,e,!1,n)},r.prototype.writeInt8=function(t,e,n){return n||(Y(void 0!==t&&null!==t,"missing value"),Y(void 0!==e&&null!==e,"missing offset"),Y(this.length>e,"Trying to write beyond buffer length"),V(t,127,-128)),e>=this.length?void 0:(t>=0?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n),e+1)},r.prototype.writeInt16LE=function(t,e,n){return x(this,t,e,!0,n)},r.prototype.writeInt16BE=function(t,e,n){return x(this,t,e,!1,n)},r.prototype.writeInt32LE=function(t,e,n){return k(this,t,e,!0,n)},r.prototype.writeInt32BE=function(t,e,n){return k(this,t,e,!1,n)},r.prototype.writeFloatLE=function(t,e,n){return A(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){return A(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){return S(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){return S(this,t,e,!1,n)},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),Y(n>=e,"end < start"),n!==e&&0!==this.length){Y(e>=0&&this.length>e,"start out of bounds"),Y(n>=0&&this.length>=n,"end out of bounds");var r;if("number"==typeof t)for(r=e;n>r;r++)this[r]=t;else{var i=L(""+t),o=i.length;for(r=e;n>r;r++)this[r]=i[r%o]}return this}},r.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=B(this[r]),r===n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r._useTypedArrays)return new r(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw Error("Buffer.toArrayBuffer not supported in this browser")};var W=r.prototype;r._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=W.get,t.set=W.set,t.write=W.write,t.toString=W.toString,t.toLocaleString=W.toString,t.toJSON=W.toJSON,t.equals=W.equals,t.compare=W.compare,t.copy=W.copy,t.slice=W.slice,t.readUInt8=W.readUInt8,t.readUInt16LE=W.readUInt16LE,t.readUInt16BE=W.readUInt16BE,t.readUInt32LE=W.readUInt32LE,t.readUInt32BE=W.readUInt32BE,t.readInt8=W.readInt8,t.readInt16LE=W.readInt16LE,t.readInt16BE=W.readInt16BE,t.readInt32LE=W.readInt32LE,t.readInt32BE=W.readInt32BE,t.readFloatLE=W.readFloatLE,t.readFloatBE=W.readFloatBE,t.readDoubleLE=W.readDoubleLE,t.readDoubleBE=W.readDoubleBE,t.writeUInt8=W.writeUInt8,t.writeUInt16LE=W.writeUInt16LE,t.writeUInt16BE=W.writeUInt16BE,t.writeUInt32LE=W.writeUInt32LE,t.writeUInt32BE=W.writeUInt32BE,t.writeInt8=W.writeInt8,t.writeInt16LE=W.writeInt16LE,t.writeInt16BE=W.writeInt16BE,t.writeInt32LE=W.writeInt32LE,t.writeInt32BE=W.writeInt32BE,t.writeFloatLE=W.writeFloatLE,t.writeFloatBE=W.writeFloatBE,t.writeDoubleLE=W.writeDoubleLE,t.writeDoubleBE=W.writeDoubleBE,t.fill=W.fill,t.inspect=W.inspect,t.toArrayBuffer=W.toArrayBuffer,t};var q=/[^+\/0-9A-z]/g},{"base64-js":7,ieee754:8}],7:[function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===a?62:e===s?63:u>e?-1:u+10>e?e-u+26+26:c+26>e?e-c:f+26>e?e-f+26:void 0}function n(t){function n(t){f[l++]=t}var r,i,a,s,u,f;if(t.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var c=t.length;u="="===t.charAt(c-2)?2:"="===t.charAt(c-1)?1:0,f=new o(3*t.length/4-u),a=u>0?t.length-4:t.length;var l=0;for(r=0,i=0;a>r;r+=4,i+=3)s=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===u?(s=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&s)):1===u&&(s=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(255&s>>8),n(255&s)),f}function i(t){function e(t){return r.charAt(t)}function n(t){return e(63&t>>18)+e(63&t>>12)+e(63&t>>6)+e(63&t)}var i,o,a,s=t.length%3,u="";for(i=0,a=t.length-s;a>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(s){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(63&o<<4),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(63&o>>4),u+=e(63&o<<2),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),f="a".charCodeAt(0),c="A".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i})(n===void 0?this.base64js={}:n)},{}],8:[function(t,e,n){n.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,f=u>>1,c=-7,l=n?i-1:0,d=n?-1:1,h=t[e+l];for(l+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+t[e+l],l+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+l],l+=d,c-=8);if(0===o)o=1-f;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),o-=f}return(h?-1:1)*a*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var a,s,u,f=8*o-i-1,c=(1<<f)-1,l=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),1>e*(u=Math.pow(2,-a))&&(a--,u*=2),e+=a+l>=1?d/u:d*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[n+h]=255&a,h+=p,a/=256,f-=8);t[n+h-p]|=128*g}},{}],9:[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")}},{}],10:[function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(t){for(var e,n,i,o,a,s,u,f="",c=0;t.length>c;)e=t.charCodeAt(c++),n=t.charCodeAt(c++),i=t.charCodeAt(c++),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),f=f+r.charAt(o)+r.charAt(a)+r.charAt(s)+r.charAt(u);return f},n.decode=function(t){var e,n,i,o,a,s,u,f="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");t.length>c;)o=r.indexOf(t.charAt(c++)),a=r.indexOf(t.charAt(c++)),s=r.indexOf(t.charAt(c++)),u=r.indexOf(t.charAt(c++)),e=o<<2|a>>4,n=(15&a)<<4|s>>2,i=(3&s)<<6|u,f+=String.fromCharCode(e),64!=s&&(f+=String.fromCharCode(n)),64!=u&&(f+=String.fromCharCode(i));return f}},{}],11:[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},{}],12:[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":15}],13:[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":25}],14:[function(t,e,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.date=null,n.compression=null},{}],15:[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:28}],16:[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":10,"./compressions":12,"./defaults":14,"./load":17,"./object":20,"./support":23,"./utils":25}],17:[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":10,"./zipEntries":26}],18:[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)},{buffer:6}],19:[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":24}],20:[function(t,e){"use strict";var n,r,i=t("./support"),o=t("./utils"),a=t("./signature"),s=t("./defaults"),u=t("./base64"),f=t("./compressions"),c=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 c&&(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?k.utf8decode(e):o.transformTo("string",e),t||this.options.binary||(e=k.utf8encode(e)),e)},g=function(t,e,n){this.name=t,this._data=e,this.options=n};g.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 m=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},y=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},b=function(t,e,n){var r=o.getTypeOf(e);if(n=y(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 c))throw Error("The data of '"+t+"' is in an unsupported format !");"arraybuffer"===r&&(e=o.transformTo("uint8array",e))}var i=new g(t,e,n);return this.files[t]=i,i},_=function(t){return"/"!=t.slice(-1)&&(t+="/"),this.files[t]||b.call(this,t,null,{dir:!0}),this.files[t]},w=function(t,e){var n,r=new c;return t._data instanceof c?(r.uncompressedSize=t._data.uncompressedSize,r.crc32=t._data.crc32,0===r.uncompressedSize||t.options.dir?(e=f.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=f.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,f=e.options,c="",l="";i=f.date.getHours(),i<<=6,i|=f.date.getMinutes(),i<<=5,i|=f.date.getSeconds()/2,o=f.date.getFullYear()-1980,o<<=4,o|=f.date.getMonth()+1,o<<=5,o|=f.date.getDate(),u&&(l=m(1,1)+m(this.crc32(s),4)+s,c+="up"+m(l.length,2)+l);var d="";d+="\n\0",d+=u?"\0\b":"\0\0",d+=n.compressionMethod,d+=m(i,2),d+=m(o,2),d+=m(n.crc32,4),d+=m(n.compressedSize,4),d+=m(n.uncompressedSize,4),d+=m(s.length,2),d+=m(c.length,2);var h=a.LOCAL_FILE_HEADER+d+s+c,p=a.CENTRAL_FILE_HEADER+"\0"+d+"\0\0"+"\0\0"+"\0\0"+(e.options.dir===!0?"\0\0\0":"\0\0\0\0")+m(r,4)+s+c;return{fileRecord:h,dirRecord:p,compressedObject:n}},I=function(){this.data=[]};I.prototype={append:function(t){t=o.transformTo("string",t),this.data.push(t)},finalize:function(){return this.data.join("")}};var x=function(t){this.data=new Uint8Array(t),this.index=0};x.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 k={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 g(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,b.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=_.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 c in this.files)if(this.files.hasOwnProperty(c)){var l=this.files[c],d=l.options.compression||t.compression.toUpperCase(),h=f[d];if(!h)throw Error(d+" is not a valid compression method !");var p=w.call(this,l,h),g=E.call(this,c,l,p,i);i+=g.fileRecord.length+p.compressedSize,s+=g.dirRecord.length,r.push(g)}var y="";y=a.CENTRAL_DIRECTORY_END+"\0\0"+"\0\0"+m(r.length,2)+m(r.length,2)+m(s,4)+m(i,4)+"\0\0";var b=t.type.toLowerCase();for(e="uint8array"===b||"arraybuffer"===b||"blob"===b||"nodebuffer"===b?new x(i+s+y.length):new I(i+s+y.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(y);var _=e.finalize();switch(t.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return o.transformTo(t.type.toLowerCase(),_);case"blob":return o.arrayBuffer2Blob(o.transformTo("arraybuffer",_));case"base64":return t.base64?u.encode(_):_;default:return _}},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,f=t.length;f>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,f=0,c=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;)f=s?t[u]:t.charCodeAt(u),128>f?(e[n++]=String.fromCharCode(f),u++):f>191&&224>f?(c=s?t[u+1]:t.charCodeAt(u+1),e[n++]=String.fromCharCode((31&f)<<6|63&c),u+=2):(c=s?t[u+1]:t.charCodeAt(u+1),l=s?t[u+2]:t.charCodeAt(u+2),e[n++]=String.fromCharCode((15&f)<<12|(63&c)<<6|63&l),u+=3);return e.join("")}};e.exports=k},{"./base64":10,"./compressedObject":11,"./compressions":12,"./defaults":14,"./nodeBuffer":18,"./signature":21,"./support":23,"./utils":25}],21:[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"},{}],22:[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":13,"./utils":25}],23:[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)},{buffer:6}],24:[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":13}],25:[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,f(0))}}catch(u){s=!1}if(!s){for(var c="",l=0;t.length>l;l++)c+=String.fromCharCode(t[l]);return c}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"),f=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 c={};c.string={string:r,array:function(t){return i(t,Array(t.length))},arraybuffer:function(t){return c.string.uint8array(t).buffer},uint8array:function(t){return i(t,new Uint8Array(t.length))},nodebuffer:function(t){return i(t,f(t.length))}},c.array={string:o,array:r,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return f(t)}},c.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 f(new Uint8Array(t))}},c.uint8array={string:o,array:function(t){return a(t,Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:r,nodebuffer:function(t){return f(t)}},c.nodebuffer={string:o,array:function(t){return a(t,Array(t.length))},arraybuffer:function(t){return c.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=c[r][t](e);return i},n.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":s.nodebuffer&&f.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":12,"./nodeBuffer":18,"./support":23}],26:[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"),f=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||f.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":19,"./signature":21,"./stringReader":22,"./support":23,"./uint8ArrayReader":24,"./utils":25,"./zipEntry":27}],27:[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":11,"./object":20,"./stringReader":22,"./utils":25}],28:[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":29,"./lib/inflate":30,"./lib/utils/common":31,"./lib/zlib/constants":34}],29:[function(t,e,n){"use strict";function r(t,e){var n=new y(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"),f=t("./zlib/messages"),c=t("./zlib/zstream"),l=0,d=4,h=0,p=1,g=-1,m=0,v=8,y=function(t){this.options=s.assign({level:g,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,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 c,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(f[n]);e.header&&a.deflateSetHeader(this.strm,e.header)};y.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},y.prototype.onData=function(t){this.chunks.push(t)},y.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=y,n.deflate=r,n.deflateRaw=i,n.gzip=o},{"./utils/common":31,"./utils/strings":32,"./zlib/deflate.js":36,"./zlib/messages":41,"./zlib/zstream":43}],30:[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"),f=t("./zlib/messages"),c=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 c,this.strm.avail_out=0;var n=o.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw Error(f[n]);this.header=new l,o.inflateGetHeader(this.strm,this.header)};d.prototype.push=function(t,e){var n,r,i,f,c,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),f=l.next_out-i,c=s.buf2string(l.output,i),l.next_out=f,l.avail_out=d-f,f&&a.arraySet(l.output,l.output,i,f,0),this.onData(c)):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":31,"./utils/strings":32,"./zlib/constants":34,"./zlib/gzheader":37,"./zlib/inflate.js":39,"./zlib/messages":41,"./zlib/zstream":43}],31:[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)},{}],32:[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),f=0;256>f;f++)u[f]=f>=252?6:f>=248?5:f>=240?4:f>=224?3:f>=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,f=Array(2*s);for(i=0,n=0;s>n;)if(o=t[n++],128>o)f[i++]=o;else if(a=u[o],a>4)f[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?f[i++]=65533:65536>o?f[i++]=o:(o-=65536,f[i++]=55296|1023&o>>10,f[i++]=56320|1023&o)}return r(f,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":31}],33:[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},{}],34:[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}},{}],35:[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},{}],36:[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&&(O.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 f(t,e){t.pending_buf[t.pending++]=255&e>>>8,t.pending_buf[t.pending++]=255&e}function c(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,O.arraySet(e,t.input,t.next_in,i,n),1===t.state.wrap?t.adler=C(t.adler,e,i,n):2===t.state.wrap&&(t.adler=R(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-fe?t.strstart-(t.w_size-fe):0,f=t.window,c=t.w_mask,l=t.prev,d=t.strstart+ue,h=f[o+a-1],p=f[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,f[n+a]===p&&f[n+a-1]===h&&f[n]===f[o]&&f[++n]===f[o+1]){o+=2,n++;do;while(f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&d>o);if(r=ue-(d-o),o=d-ue,r>a){if(t.match_start=e,a=r,r>=s)break;h=f[o+a-1],p=f[o+a]}}while((e=l[e&c])>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-fe)){O.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=c(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(fe>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 ye;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 ye;if(t.strstart-t.block_start>=t.w_size-fe&&(s(t,!1),0===t.strm.avail_out))return ye}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.strstart>t.block_start&&(s(t,!1),0===t.strm.avail_out)?ye:ye}function p(t,e){for(var n,r;;){if(fe>t.lookahead){if(d(t),fe>t.lookahead&&e===D)return ye;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-fe&&(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 ye}return t.insert=se-1>t.strstart?t.strstart:se-1,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?ye:be}function g(t,e){for(var n,r,i;;){if(fe>t.lookahead){if(d(t),fe>t.lookahead&&e===D)return ye;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-fe&&(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 ye}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 ye}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===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?ye:be}function m(t,e){for(var n,r,i,o,a=t.window;;){if(ue>=t.lookahead){if(d(t),ue>=t.lookahead&&e===D)return ye;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 ye}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?ye:be}function v(t,e){for(var n;;){if(0===t.lookahead&&(d(t),0===t.lookahead)){if(e===D)return ye;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 ye}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?ye:be}function y(t){t.window_size=2*t.w_size,o(t.head),t.max_lazy_match=S[t.level].max_lazy,t.good_match=S[t.level].good_length,t.nice_match=S[t.level].nice_length,t.max_chain_length=S[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 b(){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 O.Buf16(2*oe),this.dyn_dtree=new O.Buf16(2*(2*re+1)),this.bl_tree=new O.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 O.Buf16(ae+1),this.heap=new O.Buf16(2*ne+1),o(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new O.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 _(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:me,t.adler=2===e.wrap?0:1,e.last_flush=D,T._tr_init(e),F):r(t,U)}function w(t){var e=_(t);return e===F&&y(t.state),e}function E(t,e){return t&&t.state?2!==t.state.wrap?U:(t.state.gzhead=e,F):U}function I(t,e,n,i,o,a){if(!t)return U;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,U);8===i&&(i=9);var u=new b;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 O.Buf8(2*u.w_size),u.head=new O.Buf16(u.hash_size),u.prev=new O.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new O.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 x(t,e){return I(t,e,J,Q,$,q)}function k(t,e){var n,s,c,l;if(!t||!t.state||e>j||0>e)return t?r(t,U):U;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||s.status===ve&&e!==z)return r(t,0===t.avail_out?V:U);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=R(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=me);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|=ce),d+=31-d%31,s.status=me,f(s,d),0!==s.strstart&&(f(s,t.adler>>>16),f(s,65535&t.adler)),t.adler=1}if(s.status===de)if(s.gzhead.extra){for(c=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=s.pending,s.pending!==s.pending_buf_size));)u(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=he)}else s.status=he;if(s.status===he)if(s.gzhead.name){c=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=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>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),0===l&&(s.gzindex=0,s.status=pe)}else s.status=pe;if(s.status===pe)if(s.gzhead.comment){c=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=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>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),0===l&&(s.status=ge)}else s.status=ge;if(s.status===ge&&(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=me)):s.status=me),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!==z)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?m(s,e):S[s.level].func(s,e);if((p===_e||p===we)&&(s.status=ve),p===ye||p===_e)return 0===t.avail_out&&(s.last_flush=-1),F;if(p===be&&(e===B?T._tr_align(s):e!==j&&(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!==z?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)):(f(s,t.adler>>>16),f(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!==ge&&e!==me&&e!==ve?r(t,U):(t.state=null,e===me?r(t,P):F)):U}var S,O=t("../utils/common"),T=t("./trees"),C=t("./adler32"),R=t("./crc32"),N=t("./messages"),D=0,B=1,L=3,z=4,j=5,F=0,M=1,U=-2,P=-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,fe=ue+se+1,ce=32,le=42,de=69,he=73,pe=91,ge=103,me=113,ve=666,ye=1,be=2,_e=3,we=4,Ee=3,Ie=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};S=[new Ie(0,0,0,0,h),new Ie(4,4,8,4,p),new Ie(4,5,16,8,p),new Ie(4,6,32,32,p),new Ie(4,4,16,16,g),new Ie(8,16,32,32,g),new Ie(8,16,128,128,g),new Ie(8,32,128,256,g),new Ie(32,128,258,1024,g),new Ie(32,258,258,4096,g)],n.deflateInit=x,n.deflateInit2=I,n.deflateReset=w,n.deflateResetKeep=_,n.deflateSetHeader=E,n.deflate=k,n.deflateEnd=A,n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":31,"./adler32":33,"./crc32":35,"./messages":41,"./trees":42}],37:[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},{}],38:[function(t,e){"use strict";var n=30,r=12;e.exports=function(t,e){var i,o,a,s,u,f,c,l,d,h,p,g,m,v,y,b,_,w,E,I,x,k,A,S,O;i=t.state,o=t.next_in,S=t.input,a=o+(t.avail_in-5),s=t.next_out,O=t.output,u=s-(e-t.avail_out),f=s+(t.avail_out-257),c=i.dmax,l=i.wsize,d=i.whave,h=i.wnext,p=i.window,g=i.hold,m=i.bits,v=i.lencode,y=i.distcode,b=(1<<i.lenbits)-1,_=(1<<i.distbits)-1;t:do{15>m&&(g+=S[o++]<<m,m+=8,g+=S[o++]<<m,m+=8),w=v[g&b];e:for(;;){if(E=w>>>24,g>>>=E,m-=E,E=255&w>>>16,0===E)O[s++]=65535&w;else{if(!(16&E)){if(0===(64&E)){w=v[(65535&w)+(g&(1<<E)-1)];continue e}if(32&E){i.mode=r;break t}t.msg="invalid literal/length code",i.mode=n;break t}I=65535&w,E&=15,E&&(E>m&&(g+=S[o++]<<m,m+=8),I+=g&(1<<E)-1,g>>>=E,m-=E),15>m&&(g+=S[o++]<<m,m+=8,g+=S[o++]<<m,m+=8),w=y[g&_];n:for(;;){if(E=w>>>24,g>>>=E,m-=E,E=255&w>>>16,!(16&E)){if(0===(64&E)){w=y[(65535&w)+(g&(1<<E)-1)];continue n}t.msg="invalid distance code",i.mode=n;break t}if(x=65535&w,E&=15,E>m&&(g+=S[o++]<<m,m+=8,E>m&&(g+=S[o++]<<m,m+=8)),x+=g&(1<<E)-1,x>c){t.msg="invalid distance too far back",i.mode=n;break t}if(g>>>=E,m-=E,E=s-u,x>E){if(E=x-E,E>d&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(k=0,A=p,0===h){if(k+=l-E,I>E){I-=E;do O[s++]=p[k++];while(--E);k=s-x,A=O}}else if(E>h){if(k+=l+h-E,E-=h,I>E){I-=E;do O[s++]=p[k++];while(--E);if(k=0,I>h){E=h,I-=E;do O[s++]=p[k++];while(--E);k=s-x,A=O}}}else if(k+=h-E,I>E){I-=E;do O[s++]=p[k++];while(--E);k=s-x,A=O}for(;I>2;)O[s++]=A[k++],O[s++]=A[k++],O[s++]=A[k++],I-=3;I&&(O[s++]=A[k++],I>1&&(O[s++]=A[k++]))}else{k=s-x;do O[s++]=O[k++],O[s++]=O[k++],O[s++]=O[k++],I-=3;while(I>2);I&&(O[s++]=O[k++],I>1&&(O[s++]=O[k++]))}break}}break}}while(a>o&&f>s);I=m>>3,o-=I,m-=I<<3,g&=(1<<m)-1,t.next_in=o,t.next_out=s,t.avail_in=a>o?5+(a-o):5-(o-a),t.avail_out=f>s?257+(f-s):257-(s-f),i.hold=g,i.bits=m}},{}],39:[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=z,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(ge),e.sane=1,e.back=-1,O):R}function a(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):R}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)?R:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,a(t))):R}function u(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=s(t,e),n!==O&&(t.state=null),n):R}function f(t){return u(t,ve)}function c(t){if(ye){var e;for(g=new v.Buf32(512),m=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(I,t.lens,0,288,g,0,t.work,{bits:9}),e=0;32>e;)t.lens[e++]=5;w(x,t.lens,0,32,m,0,t.work,{bits:5}),ye=!1}t.lencode=g,t.lenbits=9,t.distcode=m,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,f,d,h,p,g,m,pe,ge,me,ve,ye,be,_e,we,Ee,Ie,xe,ke,Ae=0,Se=new v.Buf8(4),Oe=[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 R;n=t.state,n.mode===W&&(n.mode=q),s=t.next_out,o=t.output,f=t.avail_out,a=t.next_in,i=t.input,u=t.avail_in,d=n.hold,h=n.bits,p=u,g=f,Ie=O;t:for(;;)switch(n.mode){case z: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,Se[0]=255&d,Se[1]=255&d>>>8,n.check=b(n.check,Se,2,0),d=0,h=0,n.mode=j;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 j: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&&(Se[0]=255&d,Se[1]=255&d>>>8,n.check=b(n.check,Se,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&&(Se[0]=255&d,Se[1]=255&d>>>8,Se[2]=255&d>>>16,Se[3]=255&d>>>24,n.check=b(n.check,Se,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&&(Se[0]=255&d,Se[1]=255&d>>>8,n.check=b(n.check,Se,2,0)),d=0,h=0,n.mode=U;case U: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&&(Se[0]=255&d,Se[1]=255&d>>>8,n.check=b(n.check,Se,2,0)),d=0,h=0}else n.head&&(n.head.extra=null);n.mode=P;case P:if(1024&n.flags&&(m=n.length,m>u&&(m=u),m&&(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,m,Ee)),512&n.flags&&(n.check=b(n.check,i,m,a)),u-=m,a+=m,n.length-=m),n.length))break t;n.length=0,n.mode=V;case V:if(2048&n.flags){if(0===u)break t;m=0;do Ee=i[a+m++],n.head&&Ee&&65536>n.length&&(n.head.name+=String.fromCharCode(Ee));
|
||
while(Ee&&u>m);if(512&n.flags&&(n.check=b(n.check,i,m,a)),u-=m,a+=m,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;m=0;do Ee=i[a+m++],n.head&&Ee&&65536>n.length&&(n.head.comment+=String.fromCharCode(Ee));while(Ee&&u>m);if(512&n.flags&&(n.check=b(n.check,i,m,a)),u-=m,a+=m,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=f,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,C;t.adler=n.check=1,n.mode=W;case W:if(e===A||e===S)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(c(n),n.mode=ee,e===S){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===S)break t;case J:n.mode=G;case G:if(m=n.length){if(m>u&&(m=u),m>f&&(m=f),0===m)break t;v.arraySet(o,i,a,m,s),u-=m,a+=m,f-=m,s+=m,n.length-=m;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[Oe[n.have++]]=7&d,d>>>=3,h-=3}for(;19>n.have;)n.lens[Oe[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,xe={bits:n.lenbits},Ie=w(E,n.lens,0,19,n.lencode,0,n.work,xe),n.lenbits=xe.bits,Ie){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],me=Ae>>>24,ve=255&Ae>>>16,ye=65535&Ae,!(h>=me);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(16>ye)d>>>=me,h-=me,n.lens[n.have++]=ye;else{if(16===ye){for(ke=me+2;ke>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(d>>>=me,h-=me,0===n.have){t.msg="invalid bit length repeat",n.mode=le;break}Ee=n.lens[n.have-1],m=3+(3&d),d>>>=2,h-=2}else if(17===ye){for(ke=me+3;ke>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}d>>>=me,h-=me,Ee=0,m=3+(7&d),d>>>=3,h-=3}else{for(ke=me+7;ke>h;){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}d>>>=me,h-=me,Ee=0,m=11+(127&d),d>>>=7,h-=7}if(n.have+m>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=le;break}for(;m--;)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,xe={bits:n.lenbits},Ie=w(I,n.lens,0,n.nlen,n.lencode,0,n.work,xe),n.lenbits=xe.bits,Ie){t.msg="invalid literal/lengths set",n.mode=le;break}if(n.distbits=6,n.distcode=n.distdyn,xe={bits:n.distbits},Ie=w(x,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,xe),n.distbits=xe.bits,Ie){t.msg="invalid distances set",n.mode=le;break}if(n.mode=ee,e===S)break t;case ee:n.mode=ne;case ne:if(u>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,_(t,g),s=t.next_out,o=t.output,f=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],me=Ae>>>24,ve=255&Ae>>>16,ye=65535&Ae,!(h>=me);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(ve&&0===(240&ve)){for(be=me,_e=ve,we=ye;Ae=n.lencode[we+((d&(1<<be+_e)-1)>>be)],me=Ae>>>24,ve=255&Ae>>>16,ye=65535&Ae,!(h>=be+me);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}d>>>=be,h-=be,n.back+=be}if(d>>>=me,h-=me,n.back+=me,n.length=ye,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(ke=n.extra;ke>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],me=Ae>>>24,ve=255&Ae>>>16,ye=65535&Ae,!(h>=me);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}if(0===(240&ve)){for(be=me,_e=ve,we=ye;Ae=n.distcode[we+((d&(1<<be+_e)-1)>>be)],me=Ae>>>24,ve=255&Ae>>>16,ye=65535&Ae,!(h>=be+me);){if(0===u)break t;u--,d+=i[a++]<<h,h+=8}d>>>=be,h-=be,n.back+=be}if(d>>>=me,h-=me,n.back+=me,64&ve){t.msg="invalid distance code",n.mode=le;break}n.offset=ye,n.extra=15&ve,n.mode=oe;case oe:if(n.extra){for(ke=n.extra;ke>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===f)break t;if(m=g-f,n.offset>m){if(m=n.offset-m,m>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=le;break}m>n.wnext?(m-=n.wnext,pe=n.wsize-m):pe=n.wnext-m,m>n.length&&(m=n.length),ge=n.window}else ge=o,pe=s-n.offset,m=n.length;m>f&&(m=f),f-=m,n.length-=m;do o[s++]=ge[pe++];while(--m);0===n.length&&(n.mode=ne);break;case se:if(0===f)break t;o[s++]=n.length,f--,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(g-=f,t.total_out+=g,n.total+=g,g&&(t.adler=n.check=n.flags?b(n.check,o,g,s-g):y(n.check,o,g,s-g)),g=f,(n.flags?d:r(d))!==n.check){t.msg="incorrect data check",n.mode=le;break}d=0,h=0}n.mode=fe;case fe: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=ce;case ce:Ie=T;break t;case le:Ie=N;break t;case de:return D;case he:default:return R}return t.next_out=s,t.avail_out=f,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,(n.wsize||g!==t.avail_out&&le>n.mode&&(ue>n.mode||e!==k))&&l(t,t.output,t.next_out,g-t.avail_out)?(n.mode=de,D):(p-=t.avail_in,g-=t.avail_out,t.total_in+=p,t.total_out+=g,n.total+=g,n.wrap&&g&&(t.adler=n.check=n.flags?b(n.check,o,g,t.next_out-g):y(n.check,o,g,t.next_out-g)),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===g||e===k)&&Ie===O&&(Ie=B),Ie)}function h(t){if(!t||!t.state)return R;var e=t.state;return e.window&&(e.window=null),t.state=null,O}function p(t,e){var n;return t&&t.state?(n=t.state,0===(2&n.wrap)?R:(n.head=e,e.done=!1,O)):R}var g,m,v=t("../utils/common"),y=t("./adler32"),b=t("./crc32"),_=t("./inffast"),w=t("./inftrees"),E=0,I=1,x=2,k=4,A=5,S=6,O=0,T=1,C=2,R=-2,N=-3,D=-4,B=-5,L=8,z=1,j=2,F=3,M=4,U=5,P=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,fe=28,ce=29,le=30,de=31,he=32,pe=852,ge=592,me=15,ve=me,ye=!0;n.inflateReset=a,n.inflateReset2=s,n.inflateResetKeep=o,n.inflateInit=f,n.inflateInit2=u,n.inflate=d,n.inflateEnd=h,n.inflateGetHeader=p,n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":31,"./adler32":33,"./crc32":35,"./inffast":38,"./inftrees":40}],40:[function(t,e){"use strict";var n=t("../utils/common"),r=15,i=852,o=592,a=0,s=1,u=2,f=[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],c=[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,g,m,v,y){var b,_,w,E,I,x,k,A,S,O=y.bits,T=0,C=0,R=0,N=0,D=0,B=0,L=0,z=0,j=0,F=0,M=null,U=0,P=new n.Buf16(r+1),V=new n.Buf16(r+1),Z=null,Y=0;for(T=0;r>=T;T++)P[T]=0;for(C=0;p>C;C++)P[e[h+C]]++;for(D=O,N=r;N>=1&&0===P[N];N--);if(D>N&&(D=N),0===N)return g[m++]=20971520,g[m++]=20971520,y.bits=1,0;for(R=1;N>R&&0===P[R];R++);for(R>D&&(D=R),z=1,T=1;r>=T;T++)if(z<<=1,z-=P[T],0>z)return-1;if(z>0&&(t===a||1!==N))return-1;for(V[1]=0,T=1;r>T;T++)V[T+1]=V[T]+P[T];for(C=0;p>C;C++)0!==e[h+C]&&(v[V[e[h+C]]++]=C);switch(t){case a:M=Z=v,x=19;break;case s:M=f,U-=257,Z=c,Y-=257,x=256;break;default:M=l,Z=d,x=-1}if(F=0,C=0,T=R,I=m,B=D,L=0,w=-1,j=1<<D,E=j-1,t===s&&j>i||t===u&&j>o)return 1;for(var X=0;;){X++,k=T-L,x>v[C]?(A=0,S=v[C]):v[C]>x?(A=Z[Y+v[C]],S=M[U+v[C]]):(A=96,S=0),b=1<<T-L,_=1<<B,R=_;do _-=b,g[I+(F>>L)+_]=0|(k<<24|A<<16|S);while(0!==_);for(b=1<<T-1;F&b;)b>>=1;if(0!==b?(F&=b-1,F+=b):F=0,C++,0===--P[T]){if(T===N)break;T=e[h+v[C]]}if(T>D&&(F&E)!==w){for(0===L&&(L=D),I+=R,B=T-L,z=1<<B;N>B+L&&(z-=P[B+L],!(0>=z));)B++,z<<=1;if(j+=1<<B,t===s&&j>i||t===u&&j>o)return 1;w=F&E,g[w]=0|(D<<24|B<<16|I-m)}}return 0!==F&&(g[I+F]=0|(T-L<<24|64<<16)),y.bits=D,0}},{"../utils/common":31}],41:[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"}},{}],42:[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 f(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 c(t,e){var n,r,i,o,a,s,u=e.dyn_tree,f=e.max_code,c=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,g=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,g++),u[2*r+1]=o,r>f||(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*(c[2*r+1]+a)));if(0!==g){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]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)i=t.heap[--n],i>f||(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;U-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(fe[r]=i,t=0;1<<te[r]>t;t++)ae[i++]=r;for(i>>=7;Z>r;r++)for(fe[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);ce=new he(ie,$,P+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 g(t,e,n,r){p(t),r&&(o(t,n),o(t,~n)),C.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function m(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&&m(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!m(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function y(t,e,n){var r,o,u,f,c=0;if(0!==t.last_lit)do r=t.pending_buf[t.d_buf+2*c]<<8|t.pending_buf[t.d_buf+2*c+1],o=t.pending_buf[t.l_buf+c],c++,0===r?s(t,o,e):(u=se[o],s(t,u+P+1,e),f=$[u],0!==f&&(o-=ue[u],a(t,o,f)),r--,u=i(r),s(t,u,n),f=te[u],0!==f&&(r-=fe[u],a(t,r,f)));while(t.last_lit>c);s(t,K,e)}function b(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,f=-1;for(t.heap_len=0,t.heap_max=X,n=0;u>n;n++)0!==o[2*n]?(t.heap[++t.heap_len]=f=n,t.depth[n]=0):o[2*n+1]=0;for(;2>t.heap_len;)i=t.heap[++t.heap_len]=2>f?++f:0,o[2*i]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=f,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],c(t,e),l(o,f,t.bl_count)}function _(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),e[2*(n+1)+1]=65535,r=0;n>=r;r++)i=a,a=e[2*(r+1)+1],u>++s&&i===a||(f>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,f=3):i===a?(u=6,f=3):(u=7,f=4))}function w(t,e,n){var r,i,o=-1,u=e[1],f=0,c=7,l=4;for(0===u&&(c=138,l=3),r=0;n>=r;r++)if(i=u,u=e[2*(r+1)+1],!(c>++f&&i===u)){if(l>f){do s(t,i,t.bl_tree);while(0!==--f)}else 0!==i?(i!==o&&(s(t,i,t.bl_tree),f--),s(t,J,t.bl_tree),a(t,f-3,2)):10>=f?(s(t,G,t.bl_tree),a(t,f-3,3)):(s(t,Q,t.bl_tree),a(t,f-11,7));f=0,o=i,0===u?(c=138,l=3):i===u?(c=6,l=3):(c=7,l=4)}}function E(t){var e;for(_(t,t.dyn_ltree,t.l_desc.max_code),_(t,t.dyn_dtree,t.d_desc.max_code),b(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 I(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 x(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;P>e;e++)if(0!==t.dyn_ltree[2*e])return D;return N}function k(t){ge||(d(),ge=!0),t.l_desc=new pe(t.dyn_ltree,ce),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),g(t,e,n,!0)}function S(t){a(t,z<<1,3),s(t,K,ie),f(t)}function O(t,e,n,r){var i,o,s=0;t.level>0?(t.strm.data_type===B&&(t.strm.data_type=x(t)),b(t,t.l_desc),b(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===R||o===i?(a(t,(z<<1)+(r?1:0),3),y(t,ie,oe)):(a(t,(j<<1)+(r?1:0),3),I(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),y(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]+P+1)]++,t.dyn_dtree[2*i(e)]++),t.last_lit===t.lit_bufsize-1}var C=t("../utils/common"),R=4,N=0,D=1,B=2,L=0,z=1,j=2,F=3,M=258,U=29,P=256,V=P+1+U,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(U);r(ue);var fe=Array(Z);r(fe);var ce,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},ge=!1;n._tr_init=k,n._tr_stored_block=A,n._tr_flush_block=O,n._tr_tally=T,n._tr_align=S},{"../utils/common":31}],43:[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},{}],44:[function(t,e){var n="READ",r="WRITE",i="CREATE",o="EXCLUSIVE",a="TRUNCATE",s="APPEND",u="CREATE",f="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",FS_NODUPEIDCHECK:"FS_NODUPEIDCHECK",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:f,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:""}}},{}],45:[function(t,e){var n=t("./constants.js").MODE_FILE;e.exports=function(t,e){this.id=t,this.type=e||n}},{"./constants.js":44}],46:[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)},{buffer:6}],47:[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},{}],48:[function(t,e){(function(n){function r(t){return function(e,n){e?t(e):t(null,n)}}function i(t){if(!t)return null;if(n.isBuffer(t))return t;try{return new n(t)}catch(e){return null}}function o(t,e,n,r,i){function o(n){t.changes.push({event:"change",path:e}),i(n)}var a=t.flags;pe(a).contains(Fe)&&delete r.ctime,pe(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 a(t,e,n,r){function i(n,i){n?r(n):i.mode!==Ie?r(new Ue.ENOTDIR("a component of the path prefix is not a directory")):(l=i,s(t,e,a))}function a(e,n){!e&&n?r(new Ue.EEXIST("path name already exists")):!e||e instanceof Ue.ENOENT?t.get(l.data,u):r(e)}function u(e,i){e?r(e):(d=i,Ye.create({guid:t.guid,mode:n},function(e,n){return e?(r(e),void 0):(h=n,h.nlinks+=1,t.put(h.id,h,c),void 0)}))}function f(e){if(e)r(e);else{var n=Date.now();o(t,g,h,{mtime:n,ctime:n},r)}}function c(e){e?r(e):(d[p]=new Pe(h.id,n),t.put(l.data,d,f))}if(n!==Ie&&n!==Ee)return r(new Ue.EINVAL("mode must be a directory or file"));e=me(e);var l,d,h,p=ye(e),g=ve(e);s(t,g,i)}function s(t,e,n){function r(e,r){e?n(e):r&&r.mode===ke&&r.rnode?t.get(r.rnode,i):n(new Ue.EFILESYSTEMERROR)}function i(t,e){t?n(t):e?n(null,e):n(new Ue.ENOENT)}function o(e,r){e?n(e):r.mode===Ie&&r.data?t.get(r.data,a):n(new Ue.ENOTDIR("a component of the path prefix is not a directory"))}function a(e,r){if(e)n(e);else if(pe(r).has(c)){var i=r[c].id;t.get(i,u)}else n(new Ue.ENOENT)}function u(t,e){t?n(t):e.mode==xe?(d++,d>Oe?n(new Ue.ELOOP):f(e.data)):n(null,e)}function f(e){e=me(e),l=ve(e),c=ye(e),Ae==c?t.get(Se,r):s(t,l,o)}if(e=me(e),!e)return n(new Ue.ENOENT("path is an empty string"));var c=ye(e),l=ve(e),d=0;Ae==c?t.get(Se,r):s(t,l,o)}function u(t,e,n,r,i,a){function u(e,s){function u(e){e?a(e):o(t,f,s,{ctime:Date.now()},a)}s?s.xattrs[n]:null,e?a(e):i===Le&&s.xattrs.hasOwnProperty(n)?a(new Ue.EEXIST("attribute already exists")):i!==ze||s.xattrs.hasOwnProperty(n)?(s.xattrs[n]=r,t.put(s.id,s,u)):a(new Ue.ENOATTR)}var f;"string"==typeof e?(f=e,s(t,e,u)):"object"==typeof e&&"string"==typeof e.id?(f=e.path,t.get(e.id,u)):a(new Ue.EINVAL("path or file descriptor of wrong type"))}function f(t,e){function n(n,i){!n&&i?e(new Ue.EEXIST):!n||n instanceof Ue.ENOENT?Ze.create({guid:t.guid},function(n,i){return n?(e(n),void 0):(o=i,t.put(o.id,o,r),void 0)}):e(n)}function r(n){n?e(n):Ye.create({guid:t.guid,id:o.rnode,mode:Ie},function(n,r){return n?(e(n),void 0):(a=r,a.nlinks+=1,t.put(a.id,a,i),void 0)})}function i(n){n?e(n):(s={},t.put(a.data,s,e))}var o,a,s;t.get(Se,n)}function c(t,e,n){function r(e,r){!e&&r?n(new Ue.EEXIST):!e||e instanceof Ue.ENOENT?s(t,m,i):n(e)}function i(e,r){e?n(e):(h=r,t.get(h.data,a))}function a(e,r){e?n(e):(p=r,Ye.create({guid:t.guid,mode:Ie},function(e,r){return e?(n(e),void 0):(l=r,l.nlinks+=1,t.put(l.id,l,u),void 0)}))}function u(e){e?n(e):(d={},t.put(l.data,d,c))}function f(e){if(e)n(e);else{var r=Date.now();o(t,m,h,{mtime:r,ctime:r},n)}}function c(e){e?n(e):(p[g]=new Pe(l.id,Ie),t.put(h.data,p,f))}e=me(e);var l,d,h,p,g=ye(e),m=ve(e);s(t,e,r)}function l(t,e,n){function r(e,r){e?n(e):(g=r,t.get(g.data,i))}function i(e,r){e?n(e):Ae==v?n(new Ue.EBUSY):pe(r).has(v)?(m=r,h=m[v].id,t.get(h,a)):n(new Ue.ENOENT)}function a(e,r){e?n(e):r.mode!=Ie?n(new Ue.ENOTDIR):(h=r,t.get(h.data,u))}function u(t,e){t?n(t):(p=e,pe(p).size()>0?n(new Ue.ENOTEMPTY):c())}function f(e){if(e)n(e);else{var r=Date.now();o(t,y,g,{mtime:r,ctime:r},l)}}function c(){delete m[v],t.put(g.data,m,f)}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,g,m,v=ye(e),y=ve(e);s(t,y,r)}function d(t,e,r,i){function a(e,n){e?i(e):(v=n,t.get(v.data,u))}function u(e,n){e?i(e):(y=n,pe(y).has(E)?pe(r).contains(Ne)?i(new Ue.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists")):(b=y[E],b.type==Ie&&pe(r).contains(Ce)?i(new Ue.EISDIR("the named file is a directory and O_WRITE is set")):t.get(b.id,f)):pe(r).contains(Re)?d():i(new Ue.ENOENT("O_CREATE is not set and the named file does not exist")))}function f(t,e){if(t)i(t);else{var n=e;n.mode==xe?(x++,x>Oe?i(new Ue.ELOOP):c(n.data)):l(void 0,n)}}function c(n){n=me(n),I=ve(n),E=ye(n),Ae==E&&(pe(r).contains(Ce)?i(new Ue.EISDIR("the named file is a directory and O_WRITE is set")):s(t,e,l)),s(t,I,a)}function l(t,e){t?i(t):(_=e,i(null,_))}function d(){Ye.create({guid:t.guid,mode:Ee},function(e,n){return e?(i(e),void 0):(_=n,_.nlinks+=1,t.put(_.id,_,h),void 0)})}function h(e){e?i(e):(w=new n(0),w.fill(0),t.put(_.data,w,g))}function p(e){if(e)i(e);else{var n=Date.now();o(t,I,v,{mtime:n,ctime:n},m)}}function g(e){e?i(e):(y[E]=new Pe(_.id,Ee),t.put(v.data,y,p))}function m(t){t?i(t):i(null,_)}e=me(e);var v,y,b,_,w,E=ye(e),I=ve(e),x=0;Ae==E?pe(r).contains(Ce)?i(new Ue.EISDIR("the named file is a directory and O_WRITE is set")):s(t,e,l):s(t,I,a)}function h(t,e,r,i,a,s){function u(t){t?s(t):s(null,a)}function f(n){if(n)s(n);else{var r=Date.now();o(t,e.path,d,{mtime:r,ctime:r},u)}}function c(e){e?s(e):t.put(d.id,d,f)}function l(o,u){if(o)s(o);else{d=u;var f=new n(a);f.fill(0),r.copy(f,0,i,i+a),e.position=a,d.size=a,d.version+=1,t.put(d.data,f,c)}}var d;t.get(e.id,l)}function p(t,e,r,a,s,u,f){function c(t){t?f(t):f(null,s)}function l(n){if(n)f(n);else{var r=Date.now();o(t,e.path,g,{mtime:r,ctime:r},c)}}function d(e){e?f(e):t.put(g.id,g,l)}function h(o,c){if(o)f(o);else{if(m=i(c),!m)return f(new Ue.EIO("Expected Buffer"));var l=void 0!==u&&null!==u?u:e.position,h=Math.max(m.length,l+s),p=new n(h);p.fill(0),m&&m.copy(p),r.copy(p,l,a,a+s),void 0===u&&(e.position+=s),g.size=h,g.version+=1,t.put(g.data,p,d)}}function p(e,n){e?f(e):(g=n,t.get(g.data,h))}var g,m;t.get(e.id,p)}function g(t,e,n,r,o,a,s){function u(t,u){if(t)s(t);else{if(l=i(u),!l)return s(new Ue.EIO("Expected Buffer"));var f=void 0!==a&&null!==a?a:e.position;o=f+o>n.length?o-f:o,l.copy(n,r,f,f+o),void 0===a&&(e.position+=o),s(null,o)}}function f(e,n){e?s(e):(c=n,t.get(c.data,u))}var c,l;t.get(e.id,f)}function m(t,e,n){e=me(e),ye(e),s(t,e,r(n))}function v(t,e,n){t.get(e.id,r(n))}function y(t,e,n){function i(e,r){e?n(e):(a=r,t.get(a.data,o))}function o(e,i){e?n(e):(u=i,pe(u).has(f)?t.get(u[f].id,r(n)):n(new Ue.ENOENT("a component of the path does not name an existing file")))}e=me(e);var a,u,f=ye(e),c=ve(e);Ae==f?s(t,e,r(n)):s(t,c,i)}function b(t,e,n,r){function i(e){e?r(e):o(t,n,b,{ctime:Date.now()},r)}function a(e,n){e?r(e):(b=n,b.nlinks+=1,t.put(b.id,b,i))}function u(e){e?r(e):t.get(y[_].id,a)}function f(e,n){e?r(e):(y=n,pe(y).has(_)?r(new Ue.EEXIST("newpath resolves to an existing file")):(y[_]=m[h],t.put(v.data,y,u)))}function c(e,n){e?r(e):(v=n,t.get(v.data,f))}function l(e,n){e?r(e):(m=n,pe(m).has(h)?s(t,w,c):r(new Ue.ENOENT("a component of either path prefix does not exist")))}function d(e,n){e?r(e):(g=n,t.get(g.data,l))}e=me(e);var h=ye(e),p=ve(e);n=me(n);var g,m,v,y,b,_=ye(n),w=ve(n);s(t,p,d)}function _(t,e,n){function r(e){e?n(e):(delete l[h],t.put(c.data,l,function(){var e=Date.now();o(t,p,c,{mtime:e,ctime:e},n)}))}function i(e){e?n(e):t.delete(d.data,r)}function a(a,s){a?n(a):(d=s,d.nlinks-=1,1>d.nlinks?t.delete(d.id,i):t.put(d.id,d,function(){o(t,e,d,{ctime:Date.now()},r)}))}function u(e,r){e?n(e):(l=r,pe(l).has(h)?t.get(l[h].id,a):n(new Ue.ENOENT("a component of the path does not name an existing file")))}function f(e,r){e?n(e):(c=r,t.get(c.data,u))}e=me(e);var c,l,d,h=ye(e),p=ve(e);s(t,p,f)}function w(t,e,n){function r(t,e){if(t)n(t);else{a=e;var r=Object.keys(a);n(null,r)}}function i(e,i){e?n(e):(o=i,t.get(o.data,r))}e=me(e),ye(e);var o,a;s(t,e,i)}function E(t,e,n,r){function i(e,n){e?r(e):(l=n,t.get(l.data,a))}function a(t,e){t?r(t):(d=e,pe(d).has(p)?r(new Ue.EEXIST):u())}function u(){Ye.create({guid:t.guid,mode:xe},function(n,i){return n?(r(n),void 0):(h=i,h.nlinks+=1,h.size=e.length,h.data=e,t.put(h.id,h,c),void 0)})}function f(e){if(e)r(e);else{var n=Date.now();o(t,g,l,{mtime:n,ctime:n},r)}}function c(e){e?r(e):(d[p]=new Pe(h.id,xe),t.put(l.data,d,f))}n=me(n);var l,d,h,p=ye(n),g=ve(n);Ae==p?r(new Ue.EEXIST):s(t,g,i)}function I(t,e,n){function r(e,r){e?n(e):(a=r,t.get(a.data,i))}function i(e,r){e?n(e):(u=r,pe(u).has(f)?t.get(u[f].id,o):n(new Ue.ENOENT("a component of the path does not name an existing file")))}function o(t,e){t?n(t):e.mode!=xe?n(new Ue.EINVAL("path not a symbolic link")):n(null,e.data)}e=me(e);var a,u,f=ye(e),c=ve(e);s(t,c,r)}function x(t,e,r,a){function u(e,n){e?a(e):n.mode==Ie?a(new Ue.EISDIR):(d=n,t.get(d.data,f))}function f(e,o){if(e)a(e);else{if(o=i(o),!o)return a(new Ue.EIO("Expected Buffer"));var s=new n(r);s.fill(0),o&&o.copy(s),t.put(d.data,s,l)}}function c(n){if(n)a(n);else{var r=Date.now();o(t,e,d,{mtime:r,ctime:r},a)}}function l(e){e?a(e):(d.size=r,d.version+=1,t.put(d.id,d,c))}e=me(e);var d;0>r?a(new Ue.EINVAL("length cannot be negative")):s(t,e,u)}function k(t,e,r,a){function s(e,n){e?a(e):n.mode==Ie?a(new Ue.EISDIR):(l=n,t.get(l.data,u))}function u(e,o){if(e)a(e);else{var s;if(o=i(o),!o)return a(new Ue.EIO("Expected Buffer"));o?s=o.slice(0,r):(s=new n(r),s.fill(0)),t.put(l.data,s,c)}}function f(n){if(n)a(n);else{var r=Date.now();o(t,e.path,l,{mtime:r,ctime:r},a)}}function c(e){e?a(e):(l.size=r,l.version+=1,t.put(l.id,l,f))}var l;0>r?a(new Ue.EINVAL("length cannot be negative")):t.get(e.id,s)}function A(t,e,n,r,i){function a(a,s){a?i(a):o(t,e,s,{atime:n,ctime:r,mtime:r},i)}e=me(e),"number"!=typeof n||"number"!=typeof r?i(new Ue.EINVAL("atime and mtime must be number")):0>n||0>r?i(new Ue.EINVAL("atime and mtime must be positive integers")):s(t,e,a)}function S(t,e,n,r,i){function a(a,s){a?i(a):o(t,e.path,s,{atime:n,ctime:r,mtime:r},i)}"number"!=typeof n||"number"!=typeof r?i(new Ue.EINVAL("atime and mtime must be a number")):0>n||0>r?i(new Ue.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 Ue.EINVAL("attribute name must be a string")):n?null!==i&&i!==Le&&i!==ze?o(new Ue.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):u(t,e,n,r,i,o):o(new Ue.EINVAL("attribute name cannot be an empty string"))}function T(t,e,n,r,i,o){"string"!=typeof n?o(new Ue.EINVAL("attribute name must be a string")):n?null!==i&&i!==Le&&i!==ze?o(new Ue.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):u(t,e,n,r,i,o):o(new Ue.EINVAL("attribute name cannot be an empty string"))}function C(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 Ue.ENOATTR)}e=me(e),"string"!=typeof n?r(new Ue.EINVAL("attribute name must be a string")):n?s(t,e,i):r(new Ue.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 Ue.ENOATTR)}"string"!=typeof n?r(new Ue.EINVAL):n?t.get(e.id,i):r(new Ue.EINVAL("attribute name cannot be an empty string"))}function N(t,e,n,r){function i(i,a){function s(n){n?r(n):o(t,e,a,{ctime:Date.now()},r)}var u=a?a.xattrs:null;i?r(i):u.hasOwnProperty(n)?(delete a.xattrs[n],t.put(a.id,a,s)):r(new Ue.ENOATTR)}e=me(e),"string"!=typeof n?r(new Ue.EINVAL("attribute name must be a string")):n?s(t,e,i):r(new Ue.EINVAL("attribute name cannot be an empty string"))}function D(t,e,n,r){function i(i,a){function s(n){n?r(n):o(t,e.path,a,{ctime:Date.now()},r)}i?r(i):a.xattrs.hasOwnProperty(n)?(delete a.xattrs[n],t.put(a.id,a,s)):r(new Ue.ENOATTR)}"string"!=typeof n?r(new Ue.EINVAL("attribute name must be a string")):n?t.get(e.id,i):r(new Ue.EINVAL("attribute name cannot be an empty string"))}function B(t){return pe(Be).has(t)?Be[t]:null}function L(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 z(t,e){var n;return _e(t)?n=Error("Path must be a string without null bytes."):be(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=pe(r).contains(De)?i.size:0;var s=new Ve(n,i.id,r,a),u=t.allocDescriptor(s);o(null,u)
|
||
}}o=arguments[arguments.length-1],z(n,o)&&(r=B(r),r||o(new Ue.EINVAL("flags is not valid")),d(e,n,r,a))}function F(t,e,n,r){pe(t.openFiles).has(n)?(t.releaseDescriptor(n),r(null)):r(new Ue.EBADF)}function M(t,e,n,r,i){z(n,i)&&a(e,n,r,i)}function U(t,e,n,i,o){o=arguments[arguments.length-1],z(n,o)&&c(e,n,r(o))}function P(t,e,n,i){z(n,i)&&l(e,n,r(i))}function V(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Xe(n,t.name);r(null,i)}}z(n,r)&&m(e,n,i)}function Z(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Xe(n,t.name);r(null,i)}}var o=t.openFiles[n];o?v(e,o,i):r(new Ue.EBADF)}function Y(t,e,n,i,o){z(n,o)&&z(i,o)&&b(e,n,i,r(o))}function X(t,e,n,i){z(n,i)&&_(e,n,r(i))}function H(t,e,n,i,o,a,s,u){function f(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 c=t.openFiles[n];c?pe(c.flags).contains(Te)?g(e,c,i,o,a,s,r(f)):u(new Ue.EBADF("descriptor does not permit reading")):u(new Ue.EBADF)}function W(t,e,r,i,o){if(o=arguments[arguments.length-1],i=L(i,null,"r"),z(r,o)){var a=B(i.flag||"r");a||o(new Ue.EINVAL("flags is not valid")),d(e,r,a,function(s,u){if(s)return o(s);var f=new Ve(r,u.id,a,0),c=t.allocDescriptor(f);v(e,f,function(r,a){if(r)return o(r);var s=new Xe(a,t.name),u=s.size,l=new n(u);l.fill(0),g(e,f,l,0,u,0,function(e){if(e)return o(e);t.releaseDescriptor(c);var n;n="utf8"===i.encoding?Me.decode(l):l,o(null,n)})})})}}function q(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 f=t.openFiles[n];f?pe(f.flags).contains(Ce)?a>i.length-o?u(new Ue.EIO("intput buffer is too small")):p(e,f,i,o,a,s,r(u)):u(new Ue.EBADF("descriptor does not permit writing")):u(new Ue.EBADF)}function K(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=L(i,"utf8","w"),z(n,o)){var a=B(i.flag||"w");a||o(new Ue.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Me.encode(r)),d(e,n,a,function(i,s){if(i)return o(i);var u=new Ve(n,s.id,a,0),f=t.allocDescriptor(u);h(e,u,r,0,r.length,function(e){return e?o(e):(t.releaseDescriptor(f),o(null),void 0)})})}}function J(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=L(i,"utf8","a"),z(n,o)){var a=B(i.flag||"a");a||o(new Ue.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Me.encode(r)),d(e,n,a,function(i,s){if(i)return o(i);var u=new Ve(n,s.id,a,s.size),f=t.allocDescriptor(u);p(e,u,r,0,r.length,u.position,function(e){return e?o(e):(t.releaseDescriptor(f),o(null),void 0)})})}}function G(t,e,n,r){function i(t){r(t?!1:!0)}V(t,e,n,i)}function Q(t,e,n,i,o){z(n,o)&&C(e,n,i,r(o))}function $(t,e,n,i,o){var a=t.openFiles[n];a?R(e,a,i,r(o)):o(new Ue.EBADF)}function te(t,e,n,i,o,a,s){"function"==typeof a&&(s=a,a=null),z(n,s)&&O(e,n,i,o,a,r(s))}function ee(t,e,n,i,o,a,s){"function"==typeof a&&(s=a,a=null);var u=t.openFiles[n];u?pe(u.flags).contains(Ce)?T(e,u,i,o,a,r(s)):s(new Ue.EBADF("descriptor does not permit writing")):s(new Ue.EBADF)}function ne(t,e,n,i,o){z(n,o)&&N(e,n,i,r(o))}function re(t,e,n,i,o){var a=t.openFiles[n];a?pe(a.flags).contains(Ce)?D(e,a,i,r(o)):o(new Ue.EBADF("descriptor does not permit writing")):o(new Ue.EBADF)}function ie(t,e,n,r,i,o){function a(t,e){t?o(t):0>e.size+r?o(new Ue.EINVAL("resulting file offset would be negative")):(s.position=e.size+r,o(null,s.position))}var s=t.openFiles[n];s||o(new Ue.EBADF),"SET"===i?0>r?o(new Ue.EINVAL("resulting file offset would be negative")):(s.position=r,o(null,s.position)):"CUR"===i?0>s.position+r?o(new Ue.EINVAL("resulting file offset would be negative")):(s.position+=r,o(null,s.position)):"END"===i?v(e,s,a):o(new Ue.EINVAL("whence argument is not a proper value"))}function oe(t,e,n,i){z(n,i)&&w(e,n,r(i))}function ae(t,e,n,i,o,a){if(z(n,a)){var s=Date.now();i=i?i:s,o=o?o:s,A(e,n,i,o,r(a))}}function se(t,e,n,i,o,a){var s=Date.now();i=i?i:s,o=o?o:s;var u=t.openFiles[n];u?pe(u.flags).contains(Ce)?S(e,u,i,o,r(a)):a(new Ue.EBADF("descriptor does not permit writing")):a(new Ue.EBADF)}function ue(t,e,n,i,o){function a(t){t?o(t):_(e,n,r(o))}z(n,o)&&z(i,o)&&b(e,n,i,a)}function fe(t,e,n,i,o,a){a=arguments[arguments.length-1],z(n,a)&&z(i,a)&&E(e,n,i,r(a))}function ce(t,e,n,i){z(n,i)&&I(e,n,r(i))}function le(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Xe(n,t.name);r(null,i)}}z(n,r)&&y(e,n,i)}function de(t,e,n,i,o){o=arguments[arguments.length-1],i=i||0,z(n,o)&&x(e,n,i,r(o))}function he(t,e,n,i,o){o=arguments[arguments.length-1],i=i||0;var a=t.openFiles[n];a?pe(a.flags).contains(Ce)?k(e,a,i,r(o)):o(new Ue.EBADF("descriptor does not permit writing")):o(new Ue.EBADF)}var pe=t("../../lib/nodash.js"),ge=t("../path.js"),me=ge.normalize,ve=ge.dirname,ye=ge.basename,be=ge.isAbsolute,_e=ge.isNull,we=t("../constants.js"),Ee=we.MODE_FILE,Ie=we.MODE_DIRECTORY,xe=we.MODE_SYMBOLIC_LINK,ke=we.MODE_META,Ae=we.ROOT_DIRECTORY_NAME,Se=we.SUPER_NODE_ID,Oe=we.SYMLOOP_MAX,Te=we.O_READ,Ce=we.O_WRITE,Re=we.O_CREATE,Ne=we.O_EXCLUSIVE;we.O_TRUNCATE;var De=we.O_APPEND,Be=we.O_FLAGS,Le=we.XATTR_CREATE,ze=we.XATTR_REPLACE,je=we.FS_NOMTIME,Fe=we.FS_NOCTIME,Me=t("../encoding.js"),Ue=t("../errors.js"),Pe=t("../directory-entry.js"),Ve=t("../open-file-description.js"),Ze=t("../super-node.js"),Ye=t("../node.js"),Xe=t("../stats.js");e.exports={makeRootDirectory:f,open:j,close:F,mknod:M,mkdir:U,rmdir:P,unlink:X,stat:V,fstat:Z,link:Y,read:H,readFile:W,write:q,writeFile:K,appendFile:J,exists:G,getxattr:Q,fgetxattr:$,setxattr:te,fsetxattr:ee,removexattr:ne,fremovexattr:re,lseek:ie,readdir:oe,utimes:ae,futimes:se,rename:ue,symlink:fe,readlink:ce,lstat:le,truncate:de,ftruncate:he}}).call(this,t("buffer").Buffer)},{"../../lib/nodash.js":4,"../constants.js":44,"../directory-entry.js":45,"../encoding.js":46,"../errors.js":47,"../node.js":52,"../open-file-description.js":53,"../path.js":54,"../stats.js":63,"../super-node.js":64,buffer:6}],49:[function(t,e){function n(t){return"function"==typeof t?t:function(t){if(t)throw t}}function r(t,e){function n(){N.forEach(function(t){t.call(this)}.bind(T)),N=null}function r(t){return function(e){function n(e){var r=k();t.get(r,function(t,i){return t?(e(t),void 0):(i?n(e):e(null,r),void 0)})}return i(g).contains(h)?(e(null,k()),void 0):(n(e),void 0)}}function s(t){if(t.length){var e=m.getInstance();t.forEach(function(t){e.emit(t.event,t.path)})}}t=t||{},e=e||a;var g=t.flags,k=t.guid?t.guid:b,A=t.provider||new p.Default(t.name||u),S=t.name||A.name,O=i(g).contains(f),T=this;T.readyState=l,T.name=S,T.error=null,T.stdin=_,T.stdout=w,T.stderr=E;var C={},R=I;Object.defineProperty(this,"openFiles",{get:function(){return C}}),this.allocDescriptor=function(t){var e=R++;return C[e]=t,e},this.releaseDescriptor=function(t){delete C[t]};var N=[];this.queueOrRun=function(t){var e;return c==T.readyState?t.call(T):d==T.readyState?e=new y.EFILESYSTEMERROR("unknown error"):N.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 v;return r.start(t,!1,e.recursive),r.on("change",n),r},A.open(function(t,i){function o(t){function i(t){var e=A[t]();return e.flags=g,e.changes=[],e.guid=r(e),e.close=function(){var t=e.changes;s(t),t.length=0},e}T.provider={openReadWriteContext:function(){return i("getReadWriteContext")},openReadOnlyContext:function(){return i("getReadOnlyContext")}},t?T.readyState=d:(T.readyState=c,n()),e(t,T)}if(t)return o(t);if(!O&&!i)return o(null);var a=A.getReadWriteContext();a.guid=r(a),a.clear(function(t){return t?(o(t),void 0):(x.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,f=s.FS_FORMAT,c=s.FS_READY,l=s.FS_PENDING,d=s.FS_ERROR,h=s.FS_NODUPEIDCHECK,p=t("../providers/index.js"),g=t("../shell/shell.js"),m=t("../../lib/intercom.js"),v=t("../fs-watcher.js"),y=t("../errors.js"),b=t("../shared.js").guid,_=s.STDIN,w=s.STDOUT,E=s.STDERR,I=s.FIRST_DESCRIPTOR,x=t("./implementation.js");r.providers=p,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(t){r.prototype[t]=function(){var 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);x[t].apply(null,u)});s&&a(s)}}),r.prototype.Shell=function(t){return new g(this,t)},e.exports=r},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":44,"../errors.js":47,"../fs-watcher.js":50,"../path.js":54,"../providers/index.js":55,"../shared.js":59,"../shell/shell.js":62,"./implementation.js":48}],50:[function(t,e){function n(){function t(t){(n===t||s&&0===t.indexOf(e))&&a.trigger("change","change",t)}r.call(this);var e,n,a=this,s=!1;a.start=function(r,a,u){if(!n){if(i.isNull(r))throw Error("Path must be a string without null bytes.");n=i.normalize(r),s=u===!0,s&&(e="/"===n?"/":n+"/");var f=o.getInstance();f.on("change",t)}},a.close=function(){var e=o.getInstance();e.off("change",t),a.removeAllListeners("change")}}var r=t("../lib/eventemitter.js"),i=t("./path.js"),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":54}],51:[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":47,"./filesystem/interface.js":49,"./path.js":54,buffer:6}],52:[function(t,e){function n(t){var e=Date.now();this.id=t.id,this.mode=t.mode||i,this.size=t.size||0,this.atime=t.atime||e,this.ctime=t.ctime||e,this.mtime=t.mtime||e,this.flags=t.flags||[],this.xattrs=t.xattrs||{},this.nlinks=t.nlinks||0,this.version=t.version||0,this.blksize=void 0,this.nblocks=1,this.data=t.data}function r(t,e,n){t[e]?n(null):t.guid(function(r,i){t[e]=i,n(r)})}var i=t("./constants.js").MODE_FILE;n.create=function(t,e){r(t,"id",function(i){return i?(e(i),void 0):(r(t,"data",function(r){return r?(e(r),void 0):(e(null,new n(t)),void 0)}),void 0)})},e.exports=n},{"./constants.js":44}],53:[function(t,e){e.exports=function(t,e,n,r){this.path=t,this.id=e,this.flags=n,this.position=r}},{}],54:[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 f=[],u=s;i.length>u;u++)f.push("..");return f=f.concat(o.slice(s)),f.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 f(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 c(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:f,extname:c,isAbsolute:l,isNull:d}},{}],55:[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":56,"./memory.js":57,"./websql.js":58}],56:[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"),f=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!!f},i.prototype.open=function(t){var e=this;if(e.db)return t(null,!1),void 0;var n=!1,r=f.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}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants.js":44,"../errors.js":47}],57:[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":44}],58:[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,f=t("../constants.js").WSQL_DESC,c=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:c(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,f,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}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants.js":44,"../errors.js":47,"../shared.js":59}],59:[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}},{}],60:[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":44}],61:[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}],62:[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,f){function c(t,n){t=r.join(i,t),s.stat(t,function(a,s){if(a)return n(a),void 0;var f={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,f.path),function(t,e){return t?(n(t),void 0):(f.contents=e,u.push(f),n(),void 0)}):(u.push(f),n())})}return t?(n(t),void 0):(a.each(f,c,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,f){return u?(n(u),void 0):"FILE"===f.type?(s.unlink(t,n),void 0):(s.readdir(t,function(u,f){return u?(n(u),void 0):0===f.length?(s.rmdir(t,n),void 0):e.recursive?(f=f.map(function(e){return r.join(t,e)}),a.each(f,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 f=r.resolve(this.cwd,t),c=r.resolve(e.destination||this.cwd);o.readFile(f,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 f=new u(e),l=[];f.filter(function(t,e){var n=e.options.dir,i=n?null:e.asNodeBuffer();l.push({absPath:r.join(c,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 f(t,e){d.readFile(t,function(n,r){return n?e(n):(p.file(s(t),r,{binary:!0}),e(),void 0)})}function c(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()?c(t,e):f(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":46,"../errors.js":47,"../path.js":54,"./environment.js":60,"./network.js":61,jszip:16}],63:[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":44}],64:[function(t,e){function n(t){var e=Date.now();this.id=r.SUPER_NODE_ID,this.mode=r.MODE_META,this.atime=t.atime||e,this.ctime=t.ctime||e,this.mtime=t.mtime||e,this.rnode=t.rnode}var r=t("./constants.js");n.create=function(t,e){t.guid(function(r,i){return r?(e(r),void 0):(t.rnode=t.rnode||i,e(null,new n(t)),void 0)})},e.exports=n},{"./constants.js":44}]},{},[51])(51)}); |