3dmol
Version:
Object oriented Javascript molecular visualization library
1 lines • 351 kB
JavaScript
!function(e,t){!function(e){"use strict";function t(e,t,r){e.byteLength;for(var o=0,i=r.length;o<i;o++){var n=r.charCodeAt(o);if(n<128)e.setUint8(t++,n>>>0&127|0);else if(n<2048)e.setUint8(t++,n>>>6&31|192),e.setUint8(t++,n>>>0&63|128);else if(n<65536)e.setUint8(t++,n>>>12&15|224),e.setUint8(t++,n>>>6&63|128),e.setUint8(t++,n>>>0&63|128);else{if(!(n<1114112))throw new Error("bad codepoint "+n);e.setUint8(t++,n>>>18&7|240),e.setUint8(t++,n>>>12&63|128),e.setUint8(t++,n>>>6&63|128),e.setUint8(t++,n>>>0&63|128)}}}function r(e){for(var t=0,r=0,o=e.length;r<o;r++){var i=e.charCodeAt(r);if(i<128)t+=1;else if(i<2048)t+=2;else if(i<65536)t+=3;else{if(!(i<1114112))throw new Error("bad codepoint "+i);t+=4}}return t}function o(e){var o=new ArrayBuffer(function e(t){var o=typeof t;if("string"===o){var i=r(t);if(i<32)return 1+i;if(i<256)return 2+i;if(i<65536)return 3+i;if(i<4294967296)return 5+i}if(t instanceof Uint8Array){var i=t.byteLength;if(i<256)return 2+i;if(i<65536)return 3+i;if(i<4294967296)return 5+i}if("number"===o){if(Math.floor(t)!==t)return 9;if(t>=0){if(t<128)return 1;if(t<256)return 2;if(t<65536)return 3;if(t<4294967296)return 5;throw new Error("Number too big 0x"+t.toString(16))}if(t>=-32)return 1;if(t>=-128)return 2;if(t>=-32768)return 3;if(t>=-2147483648)return 5;throw new Error("Number too small -0x"+t.toString(16).substr(1))}if("boolean"===o||null===t)return 1;if("object"===o){var n=0;if(Array.isArray(t)){i=t.length;for(var a=0;a<i;a++)n+=e(t[a])}else{var s=Object.keys(t);i=s.length;for(var a=0;a<i;a++){var l=s[a];n+=e(l)+e(t[l])}}if(i<16)return 1+n;if(i<65536)return 3+n;if(i<4294967296)return 5+n;throw new Error("Array or object too long 0x"+i.toString(16))}throw new Error("Unknown type "+o)}(e)),i=new DataView(o);return function e(o,i,n){var a=typeof o;if("string"===a){var s=r(o);if(s<32)return i.setUint8(n,160|s),t(i,n+1,o),1+s;if(s<256)return i.setUint8(n,217),i.setUint8(n+1,s),t(i,n+2,o),2+s;if(s<65536)return i.setUint8(n,218),i.setUint16(n+1,s),t(i,n+3,o),3+s;if(s<4294967296)return i.setUint8(n,219),i.setUint32(n+1,s),t(i,n+5,o),5+s}if(o instanceof Uint8Array){var s=o.byteLength,l=new Uint8Array(i.buffer);if(s<256)return i.setUint8(n,196),i.setUint8(n+1,s),l.set(o,n+2),2+s;if(s<65536)return i.setUint8(n,197),i.setUint16(n+1,s),l.set(o,n+3),3+s;if(s<4294967296)return i.setUint8(n,198),i.setUint32(n+1,s),l.set(o,n+5),5+s}if("number"===a){if(!isFinite(o))throw new Error("Number not finite: "+o);if(Math.floor(o)!==o)return i.setUint8(n,203),i.setFloat64(n+1,o),9;if(o>=0){if(o<128)return i.setUint8(n,o),1;if(o<256)return i.setUint8(n,204),i.setUint8(n+1,o),2;if(o<65536)return i.setUint8(n,205),i.setUint16(n+1,o),3;if(o<4294967296)return i.setUint8(n,206),i.setUint32(n+1,o),5;throw new Error("Number too big 0x"+o.toString(16))}if(o>=-32)return i.setInt8(n,o),1;if(o>=-128)return i.setUint8(n,208),i.setInt8(n+1,o),2;if(o>=-32768)return i.setUint8(n,209),i.setInt16(n+1,o),3;if(o>=-2147483648)return i.setUint8(n,210),i.setInt32(n+1,o),5;throw new Error("Number too small -0x"+(-o).toString(16).substr(1))}if(null===o)return i.setUint8(n,192),1;if("boolean"===a)return i.setUint8(n,o?195:194),1;if("object"===a){var c=0,h=Array.isArray(o);if(h)s=o.length;else{var u=Object.keys(o);s=u.length}if(s<16?(i.setUint8(n,s|(h?144:128)),c=1):s<65536?(i.setUint8(n,h?220:222),i.setUint16(n+1,s),c=3):s<4294967296&&(i.setUint8(n,h?221:223),i.setUint32(n+1,s),c=5),h)for(var f=0;f<s;f++)c+=e(o[f],i,n+c);else for(var f=0;f<s;f++){var d=u[f];c+=e(d,i,n+c),c+=e(o[d],i,n+c)}return c}throw new Error("Unknown type "+a)}(e,i,0),new Uint8Array(o)}var i=["mmtfVersion","mmtfProducer","unitCell","spaceGroup","structureId","title","depositionDate","releaseDate","experimentalMethods","resolution","rFree","rWork","bioAssemblyList","ncsOperatorList","entityList","groupList","numBonds","numAtoms","numGroups","numChains","numModels","groupsPerChain","chainsPerModel"],n=i.concat(["xCoordList","yCoordList","zCoordList","groupIdList","groupTypeList","chainIdList","bFactorList","atomIdList","altLocList","occupancyList","secStructList","insCodeList","sequenceIndexList","chainNameList","bondAtomList","bondOrderList"]);function a(e,t,r){return t?new e(t.buffer,t.byteOffset,t.byteLength/(r||1)):void 0}function s(e){return a(DataView,e)}function l(e){return a(Uint8Array,e)}function c(e){return a(Int8Array,e)}function h(e){return a(Int32Array,e,4)}function u(e,t){var r=e.length/2;t||(t=new Int16Array(r));for(var o=0,i=0;o<r;++o,i+=2)t[o]=e[i]<<8^e[i+1]<<0;return t}function f(e,t){var r=e.length/4;t||(t=new Int32Array(r));for(var o=0,i=0;o<r;++o,i+=4)t[o]=e[i]<<24^e[i+1]<<16^e[i+2]<<8^e[i+3]<<0;return t}function d(e,t){var r=e.length;t||(t=new Uint8Array(4*r));for(var o=s(t),i=0;i<r;++i)o.setInt32(4*i,e[i]);return l(t)}function m(e,t,r){var o=e.length,i=1/t;r||(r=new Float32Array(o));for(var n=0;n<o;++n)r[n]=e[n]*i;return r}function p(e,t,r){var o=e.length;r||(r=new Int32Array(o));for(var i=0;i<o;++i)r[i]=Math.round(e[i]*t);return r}function v(e,t){var r,o;if(!t){var i=0;for(r=0,o=e.length;r<o;r+=2)i+=e[r+1];t=new e.constructor(i)}var n=0;for(r=0,o=e.length;r<o;r+=2)for(var a=e[r],s=e[r+1],l=0;l<s;++l)t[n]=a,++n;return t}function g(e){if(0===e.length)return new Int32Array;var t,r,o=2;for(t=1,r=e.length;t<r;++t)e[t-1]!==e[t]&&(o+=2);var i=new Int32Array(o),n=0,a=1;for(t=1,r=e.length;t<r;++t)e[t-1]!==e[t]?(i[n]=e[t-1],i[n+1]=a,a=1,n+=2):++a;return i[n]=e[e.length-1],i[n+1]=a,i}function y(e,t){var r=e.length;t||(t=new e.constructor(r)),r&&(t[0]=e[0]);for(var o=1;o<r;++o)t[o]=e[o]+t[o-1];return t}function b(e,t){var r=e.length;t||(t=new e.constructor(r)),t[0]=e[0];for(var o=1;o<r;++o)t[o]=e[o]-e[o-1];return t}function x(e,t){var r,o,i=e instanceof Int8Array?127:32767,n=-i-1,a=e.length;if(!t){var s=0;for(r=0;r<a;++r)e[r]<i&&e[r]>n&&++s;t=new Int32Array(s)}for(r=0,o=0;r<a;){for(var l=0;e[r]===i||e[r]===n;)l+=e[r],++r;l+=e[r],++r,t[o]=l,++o}return t}function w(e,t,r){return m(x(e,h(r)),t,r)}function D(e,t,r){var o=x(e,h(r));return function(e,t,r){return m(y(e,h(r)),t,r)}(o,t,a(Float32Array,o,4))}function A(e,t,r){return function(e,t){var r,o=t?127:32767,i=-o-1,n=e.length,a=0;for(r=0;r<n;++r){var s=e[r];0===s?++a:a+=s===o||s===i?2:s>0?Math.ceil(s/o):Math.ceil(s/i)}var l=t?new Int8Array(a):new Int16Array(a),c=0;for(r=0;r<n;++r){var s=e[r];if(s>=0)for(;s>=o;)l[c]=o,++c,s-=o;else for(;s<=i;)l[c]=i,++c,s-=i;l[c]=s,++c}return l}(function(e,t,r){return b(p(e,t),r)}(e,t),r)}function $(e,t,r,o){var i=new ArrayBuffer(12+o.byteLength),n=new Uint8Array(i),a=new DataView(i);return a.setInt32(0,e),a.setInt32(4,t),r&&n.set(r,8),n.set(o,12),n}function C(e){var t=e.length,r=l(e);return $(2,t,void 0,r)}function S(e){var t=e.length,r=d(e);return $(4,t,void 0,r)}function _(e,t){var r=e.length/t,o=d([t]),i=l(e);return $(5,r,o,i)}function M(e){var t=e.length,r=d(g(e));return $(6,t,void 0,r)}function z(e){var t=e.length,r=d(g(b(e)));return $(8,t,void 0,r)}function L(e,t){var r=e.length,o=d([t]),i=d(function(e,t){return g(p(e,t))}(e,t));return $(9,r,o,i)}function T(e,t){var r=e.length,o=d([t]),i=function(e,t){var r=e.length;t||(t=new Uint8Array(2*r));for(var o=s(t),i=0;i<r;++i)o.setInt16(2*i,e[i]);return l(t)}(A(e,t));return $(10,r,o,i)}function E(e){var t={};return i.forEach(function(r){void 0!==e[r]&&(t[r]=e[r])}),e.bondAtomList&&(t.bondAtomList=S(e.bondAtomList)),e.bondOrderList&&(t.bondOrderList=C(e.bondOrderList)),t.xCoordList=T(e.xCoordList,1e3),t.yCoordList=T(e.yCoordList,1e3),t.zCoordList=T(e.zCoordList,1e3),e.bFactorList&&(t.bFactorList=T(e.bFactorList,100)),e.atomIdList&&(t.atomIdList=z(e.atomIdList)),e.altLocList&&(t.altLocList=M(e.altLocList)),e.occupancyList&&(t.occupancyList=L(e.occupancyList,100)),t.groupIdList=z(e.groupIdList),t.groupTypeList=S(e.groupTypeList),e.secStructList&&(t.secStructList=C(e.secStructList)),e.insCodeList&&(t.insCodeList=M(e.insCodeList)),e.sequenceIndexList&&(t.sequenceIndexList=z(e.sequenceIndexList)),t.chainIdList=_(e.chainIdList,4),e.chainNameList&&(t.chainNameList=_(e.chainNameList,4)),t}function F(e){var t=0,r=new DataView(e.buffer);function o(e){for(var t={},r=0;r<e;r++){var o=s();t[o]=s()}return t}function i(r){var o=e.subarray(t,t+r);return t+=r,o}function n(r){var o=e.subarray(t,t+r);t+=r;if(r>65535){for(var i=[],n=0;n<o.length;n+=65535)i.push(String.fromCharCode.apply(null,o.subarray(n,n+65535)));return i.join("")}return String.fromCharCode.apply(null,o)}function a(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=s();return t}function s(){var s,l,c=e[t];if(0==(128&c))return t++,c;if(128==(240&c))return t++,o(l=15&c);if(144==(240&c))return t++,a(l=15&c);if(160==(224&c))return t++,n(l=31&c);if(224==(224&c))return s=r.getInt8(t),t++,s;switch(c){case 192:return t++,null;case 194:return t++,!1;case 195:return t++,!0;case 196:return l=r.getUint8(t+1),t+=2,i(l);case 197:return l=r.getUint16(t+1),t+=3,i(l);case 198:return l=r.getUint32(t+1),t+=5,i(l);case 202:return s=r.getFloat32(t+1),t+=5,s;case 203:return s=r.getFloat64(t+1),t+=9,s;case 204:return s=e[t+1],t+=2,s;case 205:return s=r.getUint16(t+1),t+=3,s;case 206:return s=r.getUint32(t+1),t+=5,s;case 208:return s=r.getInt8(t+1),t+=2,s;case 209:return s=r.getInt16(t+1),t+=3,s;case 210:return s=r.getInt32(t+1),t+=5,s;case 217:return l=r.getUint8(t+1),t+=2,n(l);case 218:return l=r.getUint16(t+1),t+=3,n(l);case 219:return l=r.getUint32(t+1),t+=5,n(l);case 220:return l=r.getUint16(t+1),t+=3,a(l);case 221:return l=r.getUint32(t+1),t+=5,a(l);case 222:return l=r.getUint16(t+1),t+=3,o(l);case 223:return l=r.getUint32(t+1),t+=5,o(l)}throw new Error("Unknown type 0x"+c.toString(16))}return s()}function I(e,t,r,o){switch(e){case 1:return function(e,t){var r=e.length;t||(t=new Float32Array(r/4));for(var o=s(t),i=s(e),n=0,a=0,l=r/4;n<l;++n,a+=4)o.setFloat32(a,i.getFloat32(a),!0);return t}(t);case 2:return c(t);case 3:return u(t);case 4:return f(t);case 5:return l(t);case 6:return v(f(t),new Uint8Array(r));case 7:return v(f(t));case 8:return y(v(f(t)),i);case 9:return function(e,t,r){return m(v(e,h(r)),t,r)}(f(t),f(o)[0]);case 10:return D(u(t),f(o)[0]);case 11:return m(u(t),f(o)[0]);case 12:return w(u(t),f(o)[0]);case 13:return w(c(t),f(o)[0]);case 14:return x(u(t));case 15:return x(c(t))}var i}function P(e,t){var r=(t=t||{}).ignoreFields,o={};return n.forEach(function(t){var i,n,a,l,c,h=!!r&&-1!==r.indexOf(t),u=e[t];h||void 0===u||(u instanceof Uint8Array?o[t]=I.apply(null,(n=s(i=u),a=n.getInt32(0),l=n.getInt32(4),c=i.subarray(8,12),i=i.subarray(12),[a,i,l,c])):o[t]=u)}),o}function R(e){return String.fromCharCode.apply(null,e).replace(/\0/g,"")}var O="http://mmtf.rcsb.org/v1.0/",k=O+"full/",V=O+"reduced/";function U(e,t){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),P(e instanceof Uint8Array?F(e):e,t)}function N(e,t,r,o){var i=new XMLHttpRequest;i.addEventListener("load",function(){try{var e=U(i.response);r(e)}catch(e){o(e)}},!0),i.addEventListener("error",o,!0),i.responseType="arraybuffer",i.open("GET",t+e.toUpperCase()),i.send()}e.encode=function(e){return o(E(e))},e.decode=U,e.traverse=function(e,t,r){var o,i,n,a,s,l,c=(r=r||{}).firstModelOnly,h=t.onModel,u=t.onChain,f=t.onGroup,d=t.onAtom,m=t.onBond,p=0,v=0,g=0,y=0,b=0,x=-1,w=e.chainNameList,D=e.secStructList,A=e.insCodeList,$=e.sequenceIndexList,C=e.atomIdList,S=e.bFactorList,_=e.altLocList,M=e.occupancyList,z=e.bondAtomList,L=e.bondOrderList;for(o=0,i=e.chainsPerModel.length;o<i&&!(c&&p>0);++o){var T=e.chainsPerModel[p];for(h&&h({chainCount:T,modelIndex:p}),n=0;n<T;++n){var E=e.groupsPerChain[v];if(u){var F=R(e.chainIdList.subarray(4*v,4*v+4)),I=null;w&&(I=R(w.subarray(4*v,4*v+4))),u({groupCount:E,chainIndex:v,modelIndex:p,chainId:F,chainName:I})}for(a=0;a<E;++a){var P=e.groupList[e.groupTypeList[g]],O=P.atomNameList.length;if(f){var k=null;D&&(k=D[g]);var V=null;e.insCodeList&&(V=String.fromCharCode(A[g]));var U=null;$&&(U=$[g]),f({atomCount:O,groupIndex:g,chainIndex:v,modelIndex:p,groupId:e.groupIdList[g],groupType:e.groupTypeList[g],groupName:P.groupName,singleLetterCode:P.singleLetterCode,chemCompType:P.chemCompType,secStruct:k,insCode:V,sequenceIndex:U})}for(s=0;s<O;++s){if(d){var N=null;C&&(N=C[y]);var B=null;S&&(B=S[y]);var G=null;_&&(G=String.fromCharCode(_[y]));var j=null;M&&(j=M[y]),d({atomIndex:y,groupIndex:g,chainIndex:v,modelIndex:p,atomId:N,element:P.elementList[s],atomName:P.atomNameList[s],formalCharge:P.formalChargeList[s],xCoord:e.xCoordList[y],yCoord:e.yCoordList[y],zCoord:e.zCoordList[y],bFactor:B,altLoc:G,occupancy:j})}y+=1}if(m){var H=P.bondAtomList;for(s=0,l=P.bondOrderList.length;s<l;++s)m({atomIndex1:y-O+H[2*s],atomIndex2:y-O+H[2*s+1],bondOrder:P.bondOrderList[s]})}g+=1}v+=1}if(b=x+1,x=y-1,m&&z)for(s=0,l=z.length;s<l;s+=2){var W=z[s],Y=z[s+1];(W>=b&&W<=x||Y>=b&&Y<=x)&&m({atomIndex1:W,atomIndex2:Y,bondOrder:L?L[s/2]:null})}p+=1}},e.fetch=function(e,t,r){N(e,k,t,r)},e.fetchReduced=function(e,t,r){N(e,V,t,r)},e.version="v1.0.0",e.fetchUrl=k,e.fetchReducedUrl=V,e.encodeMsgpack=o,e.encodeMmtf=E,e.decodeMsgpack=F,e.decodeMmtf=P,Object.defineProperty(e,"__esModule",{value:!0})}(e.MMTF=e.MMTF||{})}(this),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("pako",[],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=e()}}(function(){return function e(t,r,o){function i(a,s){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(n)return n(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[a]={exports:{}};t[a][0].call(h.exports,function(e){var r=t[a][1][e];return i(r||e)},h,h.exports,e,t,r,o)}return r[a].exports}for(var n="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(e,t,r){"use strict";var o="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var o in r)r.hasOwnProperty(o)&&(e[o]=r[o])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,o,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+o),i);else for(var n=0;n<o;n++)e[i+n]=t[r+n]},flattenChunks:function(e){var t,r,o,i,n,a;for(o=0,t=0,r=e.length;t<r;t++)o+=e[t].length;for(a=new Uint8Array(o),i=0,t=0,r=e.length;t<r;t++)n=e[t],a.set(n,i),i+=n.length;return a}},n={arraySet:function(e,t,r,o,i){for(var n=0;n<o;n++)e[i+n]=t[r+n]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,n))},r.setTyped(o)},{}],2:[function(e,t,r){"use strict";var o=e("./common"),i=!0,n=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){n=!1}for(var a=new o.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65537&&(e.subarray&&n||!e.subarray&&i))return String.fromCharCode.apply(null,o.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,r.string2buf=function(e){var t,r,i,n,a,s=e.length,l=0;for(n=0;n<s;n++)55296==(64512&(r=e.charCodeAt(n)))&&n+1<s&&56320==(64512&(i=e.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(i-56320),n++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new o.Buf8(l),a=0,n=0;a<l;n++)55296==(64512&(r=e.charCodeAt(n)))&&n+1<s&&56320==(64512&(i=e.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(i-56320),n++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new o.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,o,i,n,s=t||e.length,c=new Array(2*s);for(o=0,r=0;r<s;)if((i=e[r++])<128)c[o++]=i;else if((n=a[i])>4)c[o++]=65533,r+=n-1;else{for(i&=2===n?31:3===n?15:7;n>1&&r<s;)i=i<<6|63&e[r++],n--;n>1?c[o++]=65533:i<65536?c[o++]=i:(i-=65536,c[o++]=55296|i>>10&1023,c[o++]=56320|1023&i)}return l(c,o)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+a[e[r]]>t?r:t}},{"./common":1}],3:[function(e,t,r){"use strict";t.exports=function(e,t,r,o){for(var i=65535&e|0,n=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{n=n+(i=i+t[o++]|0)|0}while(--a);i%=65521,n%=65521}return i|n<<16|0}},{}],4:[function(e,t,r){t.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}},{}],5:[function(e,t,r){"use strict";var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var o=0;o<8;o++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=o,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^n[255&(e^t[s])];return-1^e}},{}],6:[function(e,t,r){"use strict";t.exports=function(){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}},{}],7:[function(e,t,r){"use strict";t.exports=function(e,t){var r,o,i,n,a,s,l,c,h,u,f,d,m,p,v,g,y,b,x,w,D,A,$,C,S;r=e.state,o=e.next_in,C=e.input,i=o+(e.avail_in-5),n=e.next_out,S=e.output,a=n-(t-e.avail_out),s=n+(e.avail_out-257),l=r.dmax,c=r.wsize,h=r.whave,u=r.wnext,f=r.window,d=r.hold,m=r.bits,p=r.lencode,v=r.distcode,g=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;e:do{m<15&&(d+=C[o++]<<m,m+=8,d+=C[o++]<<m,m+=8),b=p[d&g];t:for(;;){if(d>>>=x=b>>>24,m-=x,0===(x=b>>>16&255))S[n++]=65535&b;else{if(!(16&x)){if(0==(64&x)){b=p[(65535&b)+(d&(1<<x)-1)];continue t}if(32&x){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&b,(x&=15)&&(m<x&&(d+=C[o++]<<m,m+=8),w+=d&(1<<x)-1,d>>>=x,m-=x),m<15&&(d+=C[o++]<<m,m+=8,d+=C[o++]<<m,m+=8),b=v[d&y];r:for(;;){if(d>>>=x=b>>>24,m-=x,!(16&(x=b>>>16&255))){if(0==(64&x)){b=v[(65535&b)+(d&(1<<x)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(D=65535&b,m<(x&=15)&&(d+=C[o++]<<m,(m+=8)<x&&(d+=C[o++]<<m,m+=8)),(D+=d&(1<<x)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=x,m-=x,D>(x=n-a)){if((x=D-x)>h&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,$=f,0===u){if(A+=c-x,x<w){w-=x;do{S[n++]=f[A++]}while(--x);A=n-D,$=S}}else if(u<x){if(A+=c+u-x,(x-=u)<w){w-=x;do{S[n++]=f[A++]}while(--x);if(A=0,u<w){w-=x=u;do{S[n++]=f[A++]}while(--x);A=n-D,$=S}}}else if(A+=u-x,x<w){w-=x;do{S[n++]=f[A++]}while(--x);A=n-D,$=S}for(;w>2;)S[n++]=$[A++],S[n++]=$[A++],S[n++]=$[A++],w-=3;w&&(S[n++]=$[A++],w>1&&(S[n++]=$[A++]))}else{A=n-D;do{S[n++]=S[A++],S[n++]=S[A++],S[n++]=S[A++],w-=3}while(w>2);w&&(S[n++]=S[A++],w>1&&(S[n++]=S[A++]))}break}}break}}while(o<i&&n<s);o-=w=m>>3,d&=(1<<(m-=w<<3))-1,e.next_in=o,e.next_out=n,e.avail_in=o<i?i-o+5:5-(o-i),e.avail_out=n<s?s-n+257:257-(n-s),r.hold=d,r.bits=m}},{}],8:[function(e,t,r){"use strict";var o=e("../utils/common"),i=e("./adler32"),n=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),l=0,c=1,h=2,u=4,f=5,d=6,m=0,p=1,v=2,g=-2,y=-3,b=-4,x=-5,w=8,D=1,A=2,$=3,C=4,S=5,_=6,M=7,z=8,L=9,T=10,E=11,F=12,I=13,P=14,R=15,O=16,k=17,V=18,U=19,N=20,B=21,G=22,j=23,H=24,W=25,Y=26,q=27,Z=28,X=29,Q=30,K=31,J=32,ee=852,te=592,re=15;function oe(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ie(){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 o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ne(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=D,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new o.Buf32(ee),t.distcode=t.distdyn=new o.Buf32(te),t.sane=1,t.back=-1,m):g}function ae(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ne(e)):g}function se(e,t){var r,o;return e&&e.state?(o=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==o.window&&o.wbits!==t&&(o.window=null),o.wrap=r,o.wbits=t,ae(e))):g}function le(e,t){var r,o;return e?(o=new ie,e.state=o,o.window=null,(r=se(e,t))!==m&&(e.state=null),r):g}var ce,he,ue=!0;function fe(e){if(ue){var t;for(ce=new o.Buf32(512),he=new o.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(c,e.lens,0,288,ce,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(h,e.lens,0,32,he,0,e.work,{bits:5}),ue=!1}e.lencode=ce,e.lenbits=9,e.distcode=he,e.distbits=5}r.inflateReset=ae,r.inflateReset2=se,r.inflateResetKeep=ne,r.inflateInit=function(e){return le(e,re)},r.inflateInit2=le,r.inflate=function(e,t){var r,ee,te,re,ie,ne,ae,se,le,ce,he,ue,de,me,pe,ve,ge,ye,be,xe,we,De,Ae,$e,Ce=0,Se=new o.Buf8(4),_e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return g;(r=e.state).mode===F&&(r.mode=I),ie=e.next_out,te=e.output,ae=e.avail_out,re=e.next_in,ee=e.input,ne=e.avail_in,se=r.hold,le=r.bits,ce=ne,he=ae,De=m;e:for(;;)switch(r.mode){case D:if(0===r.wrap){r.mode=I;break}for(;le<16;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(2&r.wrap&&35615===se){r.check=0,Se[0]=255&se,Se[1]=se>>>8&255,r.check=n(r.check,Se,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((15&se)!==w){e.msg="unknown compression method",r.mode=Q;break}if(le-=4,we=8+(15&(se>>>=4)),0===r.wbits)r.wbits=we;else if(we>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<<we,e.adler=r.check=1,r.mode=512&se?T:F,se=0,le=0;break;case A:for(;le<16;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(r.flags=se,(255&r.flags)!==w){e.msg="unknown compression method",r.mode=Q;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Q;break}r.head&&(r.head.text=se>>8&1),512&r.flags&&(Se[0]=255&se,Se[1]=se>>>8&255,r.check=n(r.check,Se,2,0)),se=0,le=0,r.mode=$;case $:for(;le<32;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}r.head&&(r.head.time=se),512&r.flags&&(Se[0]=255&se,Se[1]=se>>>8&255,Se[2]=se>>>16&255,Se[3]=se>>>24&255,r.check=n(r.check,Se,4,0)),se=0,le=0,r.mode=C;case C:for(;le<16;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}r.head&&(r.head.xflags=255&se,r.head.os=se>>8),512&r.flags&&(Se[0]=255&se,Se[1]=se>>>8&255,r.check=n(r.check,Se,2,0)),se=0,le=0,r.mode=S;case S:if(1024&r.flags){for(;le<16;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}r.length=se,r.head&&(r.head.extra_len=se),512&r.flags&&(Se[0]=255&se,Se[1]=se>>>8&255,r.check=n(r.check,Se,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=_;case _:if(1024&r.flags&&((ue=r.length)>ne&&(ue=ne),ue&&(r.head&&(we=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),o.arraySet(r.head.extra,ee,re,ue,we)),512&r.flags&&(r.check=n(r.check,ee,ue,re)),ne-=ue,re+=ue,r.length-=ue),r.length))break e;r.length=0,r.mode=M;case M:if(2048&r.flags){if(0===ne)break e;ue=0;do{we=ee[re+ue++],r.head&&we&&r.length<65536&&(r.head.name+=String.fromCharCode(we))}while(we&&ue<ne);if(512&r.flags&&(r.check=n(r.check,ee,ue,re)),ne-=ue,re+=ue,we)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=z;case z:if(4096&r.flags){if(0===ne)break e;ue=0;do{we=ee[re+ue++],r.head&&we&&r.length<65536&&(r.head.comment+=String.fromCharCode(we))}while(we&&ue<ne);if(512&r.flags&&(r.check=n(r.check,ee,ue,re)),ne-=ue,re+=ue,we)break e}else r.head&&(r.head.comment=null);r.mode=L;case L:if(512&r.flags){for(;le<16;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(se!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Q;break}se=0,le=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=F;break;case T:for(;le<32;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}e.adler=r.check=oe(se),se=0,le=0,r.mode=E;case E:if(0===r.havedict)return e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=ne,r.hold=se,r.bits=le,v;e.adler=r.check=1,r.mode=F;case F:if(t===f||t===d)break e;case I:if(r.last){se>>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}switch(r.last=1&se,le-=1,3&(se>>>=1)){case 0:r.mode=P;break;case 1:if(fe(r),r.mode=N,t===d){se>>>=2,le-=2;break e}break;case 2:r.mode=k;break;case 3:e.msg="invalid block type",r.mode=Q}se>>>=2,le-=2;break;case P:for(se>>>=7&le,le-=7≤le<32;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if((65535&se)!=(se>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=65535&se,se=0,le=0,r.mode=R,t===d)break e;case R:r.mode=O;case O:if(ue=r.length){if(ue>ne&&(ue=ne),ue>ae&&(ue=ae),0===ue)break e;o.arraySet(te,ee,re,ue,ie),ne-=ue,re+=ue,ae-=ue,ie+=ue,r.length-=ue;break}r.mode=F;break;case k:for(;le<14;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(r.nlen=257+(31&se),se>>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=V;case V:for(;r.have<r.ncode;){for(;le<3;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}r.lens[_e[r.have++]]=7&se,se>>>=3,le-=3}for(;r.have<19;)r.lens[_e[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ae={bits:r.lenbits},De=s(l,r.lens,0,19,r.lencode,0,r.work,Ae),r.lenbits=Ae.bits,De){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=U;case U:for(;r.have<r.nlen+r.ndist;){for(;ve=(Ce=r.lencode[se&(1<<r.lenbits)-1])>>>16&255,ge=65535&Ce,!((pe=Ce>>>24)<=le);){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(ge<16)se>>>=pe,le-=pe,r.lens[r.have++]=ge;else{if(16===ge){for($e=pe+2;le<$e;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(se>>>=pe,le-=pe,0===r.have){e.msg="invalid bit length repeat",r.mode=Q;break}we=r.lens[r.have-1],ue=3+(3&se),se>>>=2,le-=2}else if(17===ge){for($e=pe+3;le<$e;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}le-=pe,we=0,ue=3+(7&(se>>>=pe)),se>>>=3,le-=3}else{for($e=pe+7;le<$e;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}le-=pe,we=0,ue=11+(127&(se>>>=pe)),se>>>=7,le-=7}if(r.have+ue>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;ue--;)r.lens[r.have++]=we}}if(r.mode===Q)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,Ae={bits:r.lenbits},De=s(c,r.lens,0,r.nlen,r.lencode,0,r.work,Ae),r.lenbits=Ae.bits,De){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,Ae={bits:r.distbits},De=s(h,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ae),r.distbits=Ae.bits,De){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=N,t===d)break e;case N:r.mode=B;case B:if(ne>=6&&ae>=258){e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=ne,r.hold=se,r.bits=le,a(e,he),ie=e.next_out,te=e.output,ae=e.avail_out,re=e.next_in,ee=e.input,ne=e.avail_in,se=r.hold,le=r.bits,r.mode===F&&(r.back=-1);break}for(r.back=0;ve=(Ce=r.lencode[se&(1<<r.lenbits)-1])>>>16&255,ge=65535&Ce,!((pe=Ce>>>24)<=le);){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(ve&&0==(240&ve)){for(ye=pe,be=ve,xe=ge;ve=(Ce=r.lencode[xe+((se&(1<<ye+be)-1)>>ye)])>>>16&255,ge=65535&Ce,!(ye+(pe=Ce>>>24)<=le);){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}se>>>=ye,le-=ye,r.back+=ye}if(se>>>=pe,le-=pe,r.back+=pe,r.length=ge,0===ve){r.mode=Y;break}if(32&ve){r.back=-1,r.mode=F;break}if(64&ve){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=15&ve,r.mode=G;case G:if(r.extra){for($e=r.extra;le<$e;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}r.length+=se&(1<<r.extra)-1,se>>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=j;case j:for(;ve=(Ce=r.distcode[se&(1<<r.distbits)-1])>>>16&255,ge=65535&Ce,!((pe=Ce>>>24)<=le);){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(0==(240&ve)){for(ye=pe,be=ve,xe=ge;ve=(Ce=r.distcode[xe+((se&(1<<ye+be)-1)>>ye)])>>>16&255,ge=65535&Ce,!(ye+(pe=Ce>>>24)<=le);){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}se>>>=ye,le-=ye,r.back+=ye}if(se>>>=pe,le-=pe,r.back+=pe,64&ve){e.msg="invalid distance code",r.mode=Q;break}r.offset=ge,r.extra=15&ve,r.mode=H;case H:if(r.extra){for($e=r.extra;le<$e;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}r.offset+=se&(1<<r.extra)-1,se>>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=W;case W:if(0===ae)break e;if(ue=he-ae,r.offset>ue){if((ue=r.offset-ue)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}ue>r.wnext?(ue-=r.wnext,de=r.wsize-ue):de=r.wnext-ue,ue>r.length&&(ue=r.length),me=r.window}else me=te,de=ie-r.offset,ue=r.length;ue>ae&&(ue=ae),ae-=ue,r.length-=ue;do{te[ie++]=me[de++]}while(--ue);0===r.length&&(r.mode=B);break;case Y:if(0===ae)break e;te[ie++]=r.length,ae--,r.mode=B;break;case q:if(r.wrap){for(;le<32;){if(0===ne)break e;ne--,se|=ee[re++]<<le,le+=8}if(he-=ae,e.total_out+=he,r.total+=he,he&&(e.adler=r.check=r.flags?n(r.check,te,he,ie-he):i(r.check,te,he,ie-he)),he=ae,(r.flags?se:oe(se))!==r.check){e.msg="incorrect data check",r.mode=Q;break}se=0,le=0}r.mode=Z;case Z:if(r.wrap&&r.flags){for(;le<32;){if(0===ne)break e;ne--,se+=ee[re++]<<le,le+=8}if(se!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Q;break}se=0,le=0}r.mode=X;case X:De=p;break e;case Q:De=y;break e;case K:return b;case J:default:return g}return e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=ne,r.hold=se,r.bits=le,(r.wsize||he!==e.avail_out&&r.mode<Q&&(r.mode<q||t!==u))&&function(e,t,r,i){var n,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new o.Buf8(a.wsize)),i>=a.wsize?(o.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((n=a.wsize-a.wnext)>i&&(n=i),o.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(o.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0}(e,e.output,e.next_out,he-e.avail_out)?(r.mode=K,b):(ce-=e.avail_in,he-=e.avail_out,e.total_in+=ce,e.total_out+=he,r.total+=he,r.wrap&&he&&(e.adler=r.check=r.flags?n(r.check,te,he,e.next_out-he):i(r.check,te,he,e.next_out-he)),e.data_type=r.bits+(r.last?64:0)+(r.mode===F?128:0)+(r.mode===N||r.mode===R?256:0),(0===ce&&0===he||t===u)&&De===m&&(De=x),De)},r.inflateEnd=function(e){if(!e||!e.state)return g;var t=e.state;return t.window&&(t.window=null),e.state=null,m},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?g:(r.head=t,t.done=!1,m):g},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,r){"use strict";var o=e("../utils/common"),i=[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],n=[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],a=[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],s=[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];t.exports=function(e,t,r,l,c,h,u,f){var d,m,p,v,g,y,b,x,w,D=f.bits,A=0,$=0,C=0,S=0,_=0,M=0,z=0,L=0,T=0,E=0,F=null,I=0,P=new o.Buf16(16),R=new o.Buf16(16),O=null,k=0;for(A=0;A<=15;A++)P[A]=0;for($=0;$<l;$++)P[t[r+$]]++;for(_=D,S=15;S>=1&&0===P[S];S--);if(_>S&&(_=S),0===S)return c[h++]=20971520,c[h++]=20971520,f.bits=1,0;for(C=1;C<S&&0===P[C];C++);for(_<C&&(_=C),L=1,A=1;A<=15;A++)if(L<<=1,(L-=P[A])<0)return-1;if(L>0&&(0===e||1!==S))return-1;for(R[1]=0,A=1;A<15;A++)R[A+1]=R[A]+P[A];for($=0;$<l;$++)0!==t[r+$]&&(u[R[t[r+$]]++]=$);if(0===e?(F=O=u,y=19):1===e?(F=i,I-=257,O=n,k-=257,y=256):(F=a,O=s,y=-1),E=0,$=0,A=C,g=h,M=_,z=0,p=-1,v=(T=1<<_)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){0,b=A-z,u[$]<y?(x=0,w=u[$]):u[$]>y?(x=O[k+u[$]],w=F[I+u[$]]):(x=96,w=0),d=1<<A-z,C=m=1<<M;do{c[g+(E>>z)+(m-=d)]=b<<24|x<<16|w|0}while(0!==m);for(d=1<<A-1;E&d;)d>>=1;if(0!==d?(E&=d-1,E+=d):E=0,$++,0==--P[A]){if(A===S)break;A=t[r+u[$]]}if(A>_&&(E&v)!==p){for(0===z&&(z=_),g+=C,L=1<<(M=A-z);M+z<S&&!((L-=P[M+z])<=0);)M++,L<<=1;if(T+=1<<M,1===e&&T>852||2===e&&T>592)return 1;c[p=E&v]=_<<24|M<<16|g-h|0}}return 0!==E&&(c[g+E]=A-z<<24|64<<16|0),f.bits=_,0}},{"../utils/common":1}],10:[function(e,t,r){"use strict";t.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"}},{}],11:[function(e,t,r){"use strict";t.exports=function(){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}},{}],"/lib/inflate.js":[function(e,t,r){"use strict";var o=e("./zlib/inflate.js"),i=e("./utils/common"),n=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),h=Object.prototype.toString,u=function(e){this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=o.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);this.header=new c,o.inflateGetHeader(this.strm,this.header)};function f(e,t){var r=new u(t);if(r.push(e,!0),r.err)throw r.msg;return r.result}u.prototype.push=function(e,t){var r,s,l,c,u,f=this.strm,d=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?f.input=n.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(d),f.next_out=0,f.avail_out=d),(r=o.inflate(f,a.Z_NO_FLUSH))!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&r!==a.Z_STREAM_END&&(0!==f.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=n.utf8border(f.output,f.next_out),c=f.next_out-l,u=n.buf2string(f.output,l),f.next_out=c,f.avail_out=d-c,c&&i.arraySet(f.output,f.output,l,c,0),this.onData(u)):this.onData(i.shrinkBuf(f.output,f.next_out))))}while(f.avail_in>0&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=o.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),f.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=u,r.inflate=f,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},r.ungzip=f},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate.js":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("netcdfjs",[],t):"object"==typeof exports?exports.netcdfjs=t():e.netcdfjs=t()}(this,function(){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t,r){"use strict";function o(e){e.offset%4!=0&&e.skip(4-e.offset%4)}e.exports.notNetcdf=function(e,t){if(e)throw new TypeError("Not a valid NetCDF v3.x file: "+t)},e.exports.padding=o,e.exports.readName=function(e){var t=e.readUint32(),r=e.readChars(t);return o(e),r}},function(e,t,r){"use strict";const o=r(0).notNetcdf,i={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function n(e,t){if(1!==e){for(var r=new Array(e),o=0;o<e;o++)r[o]=t();return r}return t()}e.exports=i,e.exports.num2str=function(e){switch(Number(e)){case i.BYTE:return"byte";case i.CHAR:return"char";case i.SHORT:return"short";case i.INT:return"int";case i.FLOAT:return"float";case i.DOUBLE:return"double";default:return"undefined"}},e.exports.num2bytes=function(e){switch(Number(e)){case i.BYTE:case i.CHAR:return 1;case i.SHORT:return 2;case i.INT:case i.FLOAT:return 4;case i.DOUBLE:return 8;default:return-1}},e.exports.str2num=function(e){switch(String(e)){case"byte":return i.BYTE;case"char":return i.CHAR;case"short":return i.SHORT;case"int":return i.INT;case"float":return i.FLOAT;case"double":return i.DOUBLE;default:return-1}},e.exports.readType=function(e,t,r){switch(t){case i.BYTE:return e.readBytes(r);case i.CHAR:return 0===(a=e.readChars(r)).charCodeAt(a.length-1)?a.substring(0,a.length-1):a;case i.SHORT:return n(r,e.readInt16.bind(e));case i.INT:return n(r,e.readInt32.bind(e));case i.FLOAT:return n(r,e.readFloat32.bind(e));case i.DOUBLE:return n(r,e.readFloat64.bind(e));default:return void o(!0,"non valid type "+t)}var a}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";const o=r(1);e.exports.nonRecord=function(e,t){const r=o.str2num(t.type);for(var i=t.size/o.num2bytes(r),n=new Array(i),a=0;a<i;a++)n[a]=o.readType(e,r,1);return n},e.exports.record=function(e,t,r){const i=o.str2num(t.type),n=t.size?t.size/o.num2bytes(i):1;var a=r.length,s=new Array(a);const l=r.recordStep;for(var c=0;c<a;c++){var h=e.offset;s[c]=o.readType(e,i,n),e.seek(h+l)}return s}},function(e,t,r){"use strict";const o=r(0),i=r(1),n=0,a=10,s=11,l=12;function c(e){const t=e.readUint32();if(t===n)return o.notNetcdf(e.readUint32()!==n,"wrong empty tag for list of attributes"),[];{o.notNetcdf(t!==l,"wrong tag for list of attributes");const n=e.readUint32();for(var r=new Array(n),a=0;a<n;a++){var s=o.readName(e),c=e.readUint32();o.notNetcdf(c<1||c>6,"non valid type "+c);var h=e.readUint32(),u=i.readType(e,c,h);o.padding(e),r[a]={name:s,type:i.num2str(c),value:u}}}return r}e.exports=function(e,t){var r={recordDimension:{length:e.readUint32()}};r.version=t;var l=function(e){var t,r;const i=e.readUint32();if(i===n)return o.notNetcdf(e.readUint32()!==n,"wrong empty tag for list of dimensions"),[];{o.notNetcdf(i!==a,"wrong tag for list of dimensions");const n=e.readUint32();for(var s=new Array(n),l=0;l<n;l++){var c=o.readName(e);const i=e.readUint32();0===i&&(t=l,r=c),s[l]={name:c,size:i}}}return{dimensions:s,recordId:t,recordName:r}}(e);r.recordDimension.id=l.recordId,r.recordDimension.name=l.recordName,r.dimensions=l.dimensions,r.globalAttributes=c(e);var h=function(e,t,r){const a=e.readUint32();var l=0;if(a===n)return o.notNetcdf(e.readUint32()!==n,"wrong empty tag for list of variables"),[];{o.notNetcdf(a!==s,"wrong tag for list of variables");const n=e.readUint32();for(var h=new Array(n),u=0;u<n;u++){var f=o.readName(e);const n=e.readUint32();for(var d=new Array(n),m=0;m<n;m++)d[m]=e.readUint32();var p=c(e),v=e.readUint32();o.notNetcdf(v<1&&v>6,"non valid type "+v);const a=e.readUint32();var g=e.readUint32();2===r&&(o.notNetcdf(g>0,"offsets larger than 4GB not supported"),g=e.readUint32()),d[0]===t&&(l+=a),h[u]={name:f,dimensions:d,attributes:p,type:i.num2str(v),size:a,offset:g,record:d[0]===t}}}return{variables:h,recordStep:l}}(e,l.recordId,t);return r.variables=h.variables,r.recordDimension.recordStep=h.recordStep,r}},function(e,t,r){"use strict";(function(t){const o=r(11),i=8192,n=[];e.exports=class{constructor(e,t){t=t||{};var r=!1;void 0===e&&(e=i),"number"==typeof e?e=new ArrayBuffer(e):(r=!0,this._lastWrittenByte=e.byteLength);const o=t.offset?t.offset>>>0:0;let n=e.byteLength-o,a=o;e.buffer&&(e.byteLength!==e.buffer.byteLength&&(a=e.byteOffset+o),e=e.buffer),this._lastWrittenByte=r?n:0,this.buffer=e,this.length=n,this.byteLength=n,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,n),this._mark=0,this._marks=[]}available(e){return void 0===e&&(e=1),this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e){return void 0===e&&(e=1),this.offset+=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e){if(void 0===e&&(e=1),!this.available(e)){const t=2*(this.offset+e),r=new Uint8Array(t);r.set(new Uint8Array(this.buffer)),this.buffer=r.buffer,this.length=this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e){void 0===e&&(e=1);for(var t=new Uint8Array(e),r=0;r<e;r++)t[r]=this.readByte();return t}readInt16(){var e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){var e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){var e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){var e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){var e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){var e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e){void 0===e&&(e=1),n.length=e;for(var t=0;t<e;t++)n[t]=this.readChar();return n.join("")}readUtf8(e){void 0===e&&(e=1);const t=this.readChars(e);return o.decode(t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(var t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(var t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){const t=o.encode(e);return this.writeChars(t)}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this._lastWrittenByte)}getBuffer(){return void 0!==t?t.from(this.toArray()):this.toArray()}_updateLastWrittenByte(){this.offset>this._lastWrittenByte&&(this._lastWrittenByte=this.offset)}}}).call(t,r(8).Buffer)},function(e,t,r){"use strict";const o=r(5),i=r(0),n=r(3),a=r(4);e.exports=class{constructor(e){const t=new o(e);t.setBigEndian(),i.notNetcdf("CDF"!==t.readChars(3),"should start with CDF");const r=t.readByte();i.notNetcdf(r>2,"unknown version"),this.header=a(t,r),this.buffer=t}get version(){return 1===this.header.version?"classic format":"64-bit offset format"}get recordDimension(){return this.header.recordDimension}get dimensions(){return this.header.dimensions}get globalAttributes(){return this.header.globalAttributes}get variables(){return this.header.variables}getDataVariable(e){var t;return t="string"==typeof e?this.header.variables.find(function(t){return t.name===e}):e,i.notNetcdf(void 0===t,"variable not found"),this.buffer.seek(t.offset),t.record?n.record(this.buffer,t,this.header.recordDimension):n.nonRecord(this.buffer,t)}}},function(e,t,r){"use strict";t.byteLength=function(e){return 3*e.length/4-c(e)},t.toByteArray=function(e){var t,r,o,a,s,l,h=e.length;s=c(e),l=new n(3*h/4-s),o=s>0?h-4:h;var u=0;for(t=0,r=0;t<o;t+=4,r+=3)a=i[e.charCodeAt(t)]<<18|i[e.charCodeAt(t+1)]<<12|i[e.charCodeAt(t+2)]<<6|i[e.charCodeAt(t+3)],l[u++]=a>>16&255,l[u++]=a>>8&255,l[u++]=255&a;2===s?(a=i[e.charCodeAt(t)]<<2|i[e.charCodeAt(t+1)]>>4,l[u++]=255&a):1===s&&(a=i[e.charCodeAt(t)]<<10|i[e.charCodeAt(t+1)]<<4|i[e.charCodeAt(t+2)]>>2,l[u++]=a>>8&255,l[u++]=255&a);return l},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n="",a=[],s=0,l=r-i;s<l;s+=16383)a.push(h(e,s,s+16383>l?l:s+16383));1===i?(t=e[r-1],n+=o[t>>2],n+=o[t<<4&63],n+="=="):2===i&&(t=(e[r-2]<<8)+e[r-1],n+=o[t>>10],n+=o[t>>4&63],n+=o[t<<2&63],n+="=");return a.push(n),a.join("")};for(var o=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)o[s]=a[s],i[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function h(e,t,r){for(var i,n,a=[],s=t;s<r;s+=3)i=(e[s]<<16)+(e[s+1]<<8)+e[s+2],a.push(o[(n=i)>>18&63]+o[n>>12&63]+o[n>>6&63]+o[63&n]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,r){"use strict";(function(e){var o=r(7),i=r(9),n=r(10);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,r){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return c(this,e,t,r)}function c(e,t,r,o){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,o){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(o||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===o?new Uint8Array(t):void 0===o?new Uint8Array(t,r):new Uint8Array(t,r,o);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=f(e,t);return e}(e,t,r,o):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var o=0|m(t,r),i=(e=s(e,o)).write(t,r);i!==o&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(l.isBuffer(t)){var r=0|d(t.length);return 0===(e=s(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(o=t.length)!=o?s(e,0):f(e,t);if("Buffer"===t.type&&n(t.data))return f(e,t.data)}var o;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t){if(h(t),e=s(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function f(e,t){var r=t.length<0?0:0|d(t.length);e=s(e,r);for(var o=0;o<r;o+=1)e[o]=255&t[o];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(e).length;default:if(o)return N(e).length;t=(""+t).toLowerCase(),o=!0}}function p(e,t