!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){"use strict";n.r(t),n.d(t,"registerAsyncComputation",function(){return i});
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const r=new Map;function i(e,t){r.set(e.id,t)}self.onmessage=(e=>{const{t:t,id:n,args:i}=e.data;r.get(t)(...i).then(({value:e,transfer:t})=>self.postMessage({id:n,value:e},t),e=>self.postMessage({id:n,error:e.message}))})},function(e,t,n){"use strict";
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function r(e){return{id:e}}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(e[r]=n[r])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r,i,a,s;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(s=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],s.set(a,i),i+=a.length;return s}},s={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,a)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(r)},function(e,t,n){"use strict";function r(e,t=1){let n=e.length,r=new Array(n),i=r[0]=t;for(let t=1;t<n;++t)i*=e[t-1],r[t]=i;return r}function i(e,t,n){let r=new e.constructor(e.length);for(let i=0;i<t*n;i+=n)for(let a=0;a<n;a++){r[a*t+i/n]=e[i+a]}return r}n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i})},function(e,t,n){"use strict";var r={};(0,n(2).assign)(r,n(14),n(17),n(11)),e.exports=r},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(4);function i(e){let t;
/**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
return function(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return t.length>2&&31===t[0]&&139===t[1]}(t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength))?Object(r.inflate)(t):t}},function(e,t,n){"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"}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{a=a+(i=i+t[r++]|0)|0}while(--s);i%=65521,a%=65521}return i|a<<16|0}},function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();e.exports=function(e,t,n,i){var a=r,s=i+n;e^=-1;for(var o=i;o<s;o++)e=e>>>8^a[255&(e^t[o])];return-1^e}},function(e,t,n){"use strict";var r=n(2),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var s=new r.Buf8(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",s=0;s<t;s++)n+=String.fromCharCode(e[s]);return n}s[254]=s[254]=1,t.string2buf=function(e){var t,n,i,a,s,o=e.length,l=0;for(a=0;a<o;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(l),s=0,a=0;s<l;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[s++]=n:n<2048?(t[s++]=192|n>>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},t.buf2string=function(e,t){var n,r,i,a,o=t||e.length,h=new Array(2*o);for(r=0,n=0;n<o;)if((i=e[n++])<128)h[r++]=i;else if((a=s[i])>4)h[r++]=65533,n+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&n<o;)i=i<<6|63&e[n++],a--;a>1?h[r++]=65533:i<65536?h[r++]=i:(i-=65536,h[r++]=55296|i>>10&1023,h[r++]=56320|1023&i)}return l(h,r)},t.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+s[e[n]]>t?n:t}},function(e,t,n){"use strict";e.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}},function(e,t,n){"use strict";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}},function(e,t,n){var r,i=function(){function e(){this._src=null,this._parser=new r.JpegImage,this.onload=null}return e.prototype={get src(){return this._src},set src(e){this.load(e)},get width(){return this._parser.width},get height(){return this._parser.height},load:function(e){this._src=e,
/**
 * @license
 * Copyright 2015 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e,t){if(0!==e.indexOf("data:")){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){t(n.response)},n.send(null)}else{for(var r=e.indexOf("base64,")+7,i=atob(e.substring(r)),a=new Uint8Array(i.length),s=i.length-1;s>=0;s--)a[s]=i.charCodeAt(s);t(a.buffer)}}(e,function(e){this.parse(new Uint8Array(e)),this.onload&&this.onload()}.bind(this))},parse:function(e){this._parser.parse(e)},getData:function(e,t){return this._parser.getData(e,t,!1)},copyToImageData:function(e){if(2===this._parser.numComponents||this._parser.numComponents>4)throw new Error("Unsupported amount of components");var t,n,r=e.width,i=e.height,a=r*i*4,s=e.data;if(1!==this._parser.numComponents){var o=this._parser.getData(r,i,!0);for(t=0,n=0;t<a;)s[t++]=o[n++],s[t++]=o[n++],s[t++]=o[n++],s[t++]=255}else{var l=this._parser.getData(r,i,!1);for(t=0,n=0;t<a;){var h=l[n++];s[t++]=h,s[t++]=h,s[t++]=h,s[t++]=255}}}},e}();!function(e){"use strict";var t=function(){var e=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,n=799,r=3406,i=2276,a=1567,s=3784,o=5793,l=2896;function h(){}function c(e,t){for(var n,r,i=0,a=[],s=16;s>0&&!e[s-1];)s--;a.push({children:[],index:0});var o,l=a[0];for(n=0;n<s;n++){for(r=0;r<e[n];r++){for((l=a.pop()).children[l.index]=t[i];l.index>0;)l=a.pop();for(l.index++,a.push(l);a.length<=n;)a.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o;i++}n+1<s&&(a.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o)}return a[0].children}function f(e,t,n){return 64*((e.blocksPerLine+1)*t+n)}function u(t,n,r,i,a,s,o,l,h){r.precision,r.samplesPerLine,r.scanLines;var c=r.mcusPerLine,u=r.progressive,d=(r.maxH,r.maxV,n),p=0,m=0;function g(){if(m>0)return p>>--m&1;if(255===(p=t[n++])){var e=t[n++];if(e)throw"unexpected marker: "+(p<<8|e).toString(16)}return m=7,p>>>7}function b(e){for(var t=e;;){if("number"==typeof(t=t[g()]))return t;if("object"!=typeof t)throw"invalid huffman sequence"}}function v(e){for(var t=0;e>0;)t=t<<1|g(),e--;return t}function _(e){if(1===e)return 1===g()?1:-1;var t=v(e);return t>=1<<e-1?t:t+(-1<<e)+1}var w=0;var y,x=0;function k(e,t,n,r,i){var a=n%c;t(e,f(e,(n/c|0)*e.v+r,a*e.h+i))}function C(e,t,n){t(e,f(e,n/e.blocksPerLine|0,n%e.blocksPerLine))}var A,z,S,I,P,T,O=i.length;T=u?0===s?0===l?function(e,t){var n=b(e.huffmanTableDC),r=0===n?0:_(n)<<h;e.blockData[t]=e.pred+=r}:function(e,t){e.blockData[t]|=g()<<h}:0===l?function(t,n){if(w>0)w--;else for(var r=s,i=o;r<=i;){var a=b(t.huffmanTableAC),l=15&a,c=a>>4;if(0!==l){var f=e[r+=c];t.blockData[n+f]=_(l)*(1<<h),r++}else{if(c<15){w=v(c)+(1<<c)-1;break}r+=16}}}:function(t,n){for(var r,i,a=s,l=o,c=0;a<=l;){var f=e[a];switch(x){case 0:if(c=(i=b(t.huffmanTableAC))>>4,0==(r=15&i))c<15?(w=v(c)+(1<<c),x=4):(c=16,x=1);else{if(1!==r)throw"invalid ACn encoding";y=_(r),x=c?2:3}continue;case 1:case 2:t.blockData[n+f]?t.blockData[n+f]+=g()<<h:0==--c&&(x=2===x?3:0);break;case 3:t.blockData[n+f]?t.blockData[n+f]+=g()<<h:(t.blockData[n+f]=y<<h,x=0);break;case 4:t.blockData[n+f]&&(t.blockData[n+f]+=g()<<h)}a++}4===x&&0==--w&&(x=0)}:function(t,n){var r=b(t.huffmanTableDC),i=0===r?0:_(r);t.blockData[n]=t.pred+=i;for(var a=1;a<64;){var s=b(t.huffmanTableAC),o=15&s,l=s>>4;if(0!==o){var h=e[a+=l];t.blockData[n+h]=_(o),a++}else{if(l<15)break;a+=16}}};var E,M,B,D,L=0;for(M=1===O?i[0].blocksPerLine*i[0].blocksPerColumn:c*r.mcusPerColumn,a||(a=M);L<M;){for(z=0;z<O;z++)i[z].pred=0;if(w=0,1===O)for(A=i[0],P=0;P<a;P++)C(A,T,L),L++;else for(P=0;P<a;P++){for(z=0;z<O;z++)for(B=(A=i[z]).h,D=A.v,S=0;S<D;S++)for(I=0;I<B;I++)k(A,T,L,S,I);L++}if(m=0,(E=t[n]<<8|t[n+1])<=65280)throw"marker was not found";if(!(E>=65488&&E<=65495))break;n+=2}return n-d}function d(e,h,c){for(var f,u,d,p,m,g,b,v,_,w,y,x,k,C,A,z,S,I=e.quantizationTable,P=e.blockData,T=0;T<64;T+=8)_=P[h+T],w=P[h+T+1],y=P[h+T+2],x=P[h+T+3],k=P[h+T+4],C=P[h+T+5],A=P[h+T+6],z=P[h+T+7],_*=I[T],0!=(w|y|x|k|C|A|z)?(w*=I[T+1],y*=I[T+2],x*=I[T+3],k*=I[T+4],C*=I[T+5],A*=I[T+6],z*=I[T+7],u=(f=(f=o*_+128>>8)+(u=o*k+128>>8)+1>>1)-u,S=(d=y)*s+(p=A)*a+128>>8,d=d*a-p*s+128>>8,b=(m=(m=l*(w-z)+128>>8)+(b=C<<4)+1>>1)-b,g=(v=(v=l*(w+z)+128>>8)+(g=x<<4)+1>>1)-g,p=(f=f+(p=S)+1>>1)-p,d=(u=u+d+1>>1)-d,S=m*i+v*r+2048>>12,m=m*r-v*i+2048>>12,v=S,S=g*n+b*t+2048>>12,g=g*t-b*n+2048>>12,b=S,c[T]=f+v,c[T+7]=f-v,c[T+1]=u+b,c[T+6]=u-b,c[T+2]=d+g,c[T+5]=d-g,c[T+3]=p+m,c[T+4]=p-m):(S=o*_+512>>10,c[T]=S,c[T+1]=S,c[T+2]=S,c[T+3]=S,c[T+4]=S,c[T+5]=S,c[T+6]=S,c[T+7]=S);for(var O=0;O<8;++O)_=c[O],0!=((w=c[O+8])|(y=c[O+16])|(x=c[O+24])|(k=c[O+32])|(C=c[O+40])|(A=c[O+48])|(z=c[O+56]))?(u=(f=4112+((f=o*_+2048>>12)+(u=o*k+2048>>12)+1>>1))-u,S=(d=y)*s+(p=A)*a+2048>>12,d=d*a-p*s+2048>>12,p=S,b=(m=(m=l*(w-z)+2048>>12)+(b=C)+1>>1)-b,g=(v=(v=l*(w+z)+2048>>12)+(g=x)+1>>1)-g,S=m*i+v*r+2048>>12,m=m*r-v*i+2048>>12,v=S,S=g*n+b*t+2048>>12,g=g*t-b*n+2048>>12,_=(_=(f=f+p+1>>1)+v)<16?0:_>=4080?255:_>>4,w=(w=(u=u+d+1>>1)+(b=S))<16?0:w>=4080?255:w>>4,y=(y=(d=u-d)+g)<16?0:y>=4080?255:y>>4,x=(x=(p=f-p)+m)<16?0:x>=4080?255:x>>4,k=(k=p-m)<16?0:k>=4080?255:k>>4,C=(C=d-g)<16?0:C>=4080?255:C>>4,A=(A=u-b)<16?0:A>=4080?255:A>>4,z=(z=f-v)<16?0:z>=4080?255:z>>4,P[h+O]=_,P[h+O+8]=w,P[h+O+16]=y,P[h+O+24]=x,P[h+O+32]=k,P[h+O+40]=C,P[h+O+48]=A,P[h+O+56]=z):(S=(S=o*_+8192>>14)<-2040?0:S>=2024?255:S+2056>>4,P[h+O]=S,P[h+O+8]=S,P[h+O+16]=S,P[h+O+24]=S,P[h+O+32]=S,P[h+O+40]=S,P[h+O+48]=S,P[h+O+56]=S)}function p(e,t){for(var n=t.blocksPerLine,r=t.blocksPerColumn,i=new Int16Array(64),a=0;a<r;a++)for(var s=0;s<n;s++){d(t,f(t,a,s),i)}return t.blockData}function m(e){return e<=0?0:e>=255?255:e}return h.prototype={parse:function(t){function n(){var e=t[o]<<8|t[o+1];return o+=2,e}function r(){var e=n(),r=t.subarray(o,o+e-2);return o+=r.length,r}function i(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),n=Math.ceil(e.scanLines/8/e.maxV),r=0;r<e.components.length;r++){L=e.components[r];var i=Math.ceil(Math.ceil(e.samplesPerLine/8)*L.h/e.maxH),a=Math.ceil(Math.ceil(e.scanLines/8)*L.v/e.maxV),s=t*L.h,o=64*(n*L.v)*(s+1);L.blockData=new Int16Array(o),L.blocksPerLine=i,L.blocksPerColumn=a}e.mcusPerLine=t,e.mcusPerColumn=n}var a,s,o=0,l=(t.length,null),h=null,f=[],d=[],m=[],g=n();if(65496!==g)throw"SOI not found";for(g=n();65497!==g;){var b,v,_;switch(g){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var w=r();65504===g&&74===w[0]&&70===w[1]&&73===w[2]&&70===w[3]&&0===w[4]&&(l={version:{major:w[5],minor:w[6]},densityUnits:w[7],xDensity:w[8]<<8|w[9],yDensity:w[10]<<8|w[11],thumbWidth:w[12],thumbHeight:w[13],thumbData:w.subarray(14,14+3*w[12]*w[13])}),65518===g&&65===w[0]&&100===w[1]&&111===w[2]&&98===w[3]&&101===w[4]&&0===w[5]&&(h={version:w[6],flags0:w[7]<<8|w[8],flags1:w[9]<<8|w[10],transformCode:w[11]});break;case 65499:for(var y=n()+o-2;o<y;){var x=t[o++],k=new Uint16Array(64);if(x>>4==0)for(v=0;v<64;v++)k[e[v]]=t[o++];else{if(x>>4!=1)throw"DQT: invalid table spec";for(v=0;v<64;v++)k[e[v]]=n()}f[15&x]=k}break;case 65472:case 65473:case 65474:if(a)throw"Only single frame JPEGs supported";n(),(a={}).extended=65473===g,a.progressive=65474===g,a.precision=t[o++],a.scanLines=n(),a.samplesPerLine=n(),a.components=[],a.componentIds={};var C,A=t[o++],z=0,S=0;for(b=0;b<A;b++){C=t[o];var I=t[o+1]>>4,P=15&t[o+1];z<I&&(z=I),S<P&&(S=P);var T=t[o+2];_=a.components.push({h:I,v:P,quantizationTable:f[T]}),a.componentIds[C]=_-1,o+=3}a.maxH=z,a.maxV=S,i(a);break;case 65476:var O=n();for(b=2;b<O;){var E=t[o++],M=new Uint8Array(16),B=0;for(v=0;v<16;v++,o++)B+=M[v]=t[o];var D=new Uint8Array(B);for(v=0;v<B;v++,o++)D[v]=t[o];b+=17+B,(E>>4==0?m:d)[15&E]=c(M,D)}break;case 65501:n(),s=n();break;case 65498:n();var L,U=t[o++],F=[];for(b=0;b<U;b++){var R=a.componentIds[t[o++]];L=a.components[R];var N=t[o++];L.huffmanTableDC=m[N>>4],L.huffmanTableAC=d[15&N],F.push(L)}var Z=t[o++],H=t[o++],q=t[o++],J=u(t,o,a,F,s,Z,H,q>>4,15&q);o+=J;break;case 65535:255!==t[o]&&o--;break;default:if(255===t[o-3]&&t[o-2]>=192&&t[o-2]<=254){o-=3;break}throw"unknown JPEG marker "+g.toString(16)}g=n()}for(this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=l,this.adobe=h,this.components=[],b=0;b<a.components.length;b++)L=a.components[b],this.components.push({output:p(0,L),scaleX:L.h/a.maxH,scaleY:L.v/a.maxV,blocksPerLine:L.blocksPerLine,blocksPerColumn:L.blocksPerColumn});this.numComponents=this.components.length},_getLinearizedBlockData:function(e,t){var n,r,i,a,s,o,l,h,c,f,u,d=this.width/e,p=this.height/t,m=0,g=this.components.length,b=e*t*g,v=new Uint8Array(b),_=new Uint32Array(e);for(l=0;l<g;l++){for(r=(n=this.components[l]).scaleX*d,i=n.scaleY*p,m=l,u=n.output,a=n.blocksPerLine+1<<3,s=0;s<e;s++)h=0|s*r,_[s]=(4294967288&h)<<3|7&h;for(o=0;o<t;o++)for(f=a*(4294967288&(h=0|o*i))|(7&h)<<3,s=0;s<e;s++)v[m]=u[f+_[s]],m+=g}var w=this.decodeTransform;if(w)for(l=0;l<b;)for(h=0,c=0;h<g;h++,l++,c+=2)v[l]=(v[l]*w[c]>>8)+w[c+1];return v},_isColorConversionNeeded:function(){return!(!this.adobe||!this.adobe.transformCode)||3===this.numComponents},_convertYccToRgb:function(e){for(var t,n,r,i=0,a=e.length;i<a;i+=3)t=e[i],n=e[i+1],r=e[i+2],e[i]=m(t-179.456+1.402*r),e[i+1]=m(t+135.459-.344*n-.714*r),e[i+2]=m(t-226.816+1.772*n);return e},_convertYcckToRgb:function(e){for(var t,n,r,i,a=0,s=0,o=e.length;s<o;s+=4){t=e[s];var l=(n=e[s+1])*(-660635669420364e-19*n+.000437130475926232*(r=e[s+2])-54080610064599e-18*t+.00048449797120281*(i=e[s+3])-.154362151871126)-122.67195406894+r*(-.000957964378445773*r+.000817076911346625*t-.00477271405408747*i+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*i+.48357088451265)+i*(-.000336197177618394*i+.484791561490776),h=107.268039397724+n*(219927104525741e-19*n-.000640992018297945*r+.000659397001245577*t+.000426105652938837*i-.176491792462875)+r*(-.000778269941513683*r+.00130872261408275*t+.000770482631801132*i-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*i+.25802910206845)+i*(-.000318913117588328*i-.213742400323665),c=n*(-.000570115196973677*n-263409051004589e-19*r+.0020741088115012*t-.00288260236853442*i+.814272968359295)-20.810012546947+r*(-153496057440975e-19*r-.000132689043961446*t+.000560833691242812*i-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*i+.116935020465145)+i*(-.000343531996510555*i+.24165260232407);e[a++]=m(l),e[a++]=m(h),e[a++]=m(c)}return e},_convertYcckToCmyk:function(e){for(var t,n,r,i=0,a=e.length;i<a;i+=4)t=e[i],n=e[i+1],r=e[i+2],e[i]=m(434.456-t-1.402*r),e[i+1]=m(119.541-t+.344*n+.714*r),e[i+2]=m(481.816-t-1.772*n);return e},_convertCmykToRgb:function(e){for(var t,n,r,i,a=0,s=-16581375,o=0,l=e.length;o<l;o+=4){var h=(t=e[o])*(-4.387332384609988*t+54.48615194189176*(n=e[o+1])+18.82290502165302*(r=e[o+2])+212.25662451639585*(i=e[o+3])-72734.4411664936)+n*(1.7149763477362134*n-5.6096736904047315*r-17.873870861415444*i-1401.7366389350734)+r*(-2.5217340131683033*r-21.248923337353073*i+4465.541406466231)-i*(21.86122147463605*i+48317.86113160301),c=t*(8.841041422036149*t+60.118027045597366*n+6.871425592049007*r+31.159100130055922*i-20220.756542821975)+n*(-15.310361306967817*n+17.575251261109482*r+131.35250912493976*i-48691.05921601825)+r*(4.444339102852739*r+9.8632861493405*i-6341.191035517494)-i*(20.737325471181034*i+47890.15695978492),f=t*(.8842522430003296*t+8.078677503112928*n+30.89978309703729*r-.23883238689178934*i-3616.812083916688)+n*(10.49593273432072*n+63.02378494754052*r+50.606957656360734*i-28620.90484698408)+r*(.03296041114873217*r+115.60384449646641*i-49363.43385999684)-i*(22.33816807309886*i+45932.16563550634);e[a++]=h>=0?255:h<=s?0:255+h*(1/255/255)|0,e[a++]=c>=0?255:c<=s?0:255+c*(1/255/255)|0,e[a++]=f>=0?255:f<=s?0:255+f*(1/255/255)|0}return e},getData:function(e,t,n){if(this.numComponents>4)throw"Unsupported color mode";var r=this._getLinearizedBlockData(e,t);if(3===this.numComponents)return this._convertYccToRgb(r);if(4===this.numComponents){if(this._isColorConversionNeeded())return n?this._convertYcckToRgb(r):this._convertYcckToCmyk(r);if(n)return this._convertCmykToRgb(r)}return r}},h}(),n=function(){var e=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];function t(e,t,n){this.data=e,this.bp=t,this.dataEnd=n,this.chigh=e[t],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}return t.prototype={byteIn:function(){var e=this.data,t=this.bp;255===e[t]?e[t+1]>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t):(t++,this.clow+=t<this.dataEnd?e[t]<<8:65280,this.ct=8,this.bp=t);this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(t,n){var r,i=t[n]>>1,a=1&t[n],s=e[i],o=s.qe,l=this.a-o;if(this.chigh<o)l<o?(l=o,r=a,i=s.nmps):(l=o,r=1^a,1===s.switchFlag&&(a=r),i=s.nlps);else{if(this.chigh-=o,0!=(32768&l))return this.a=l,a;l<o?(r=1^a,1===s.switchFlag&&(a=r),i=s.nlps):(r=a,i=s.nmps)}do{0===this.ct&&this.byteIn(),l<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--}while(0==(32768&l));return this.a=l,t[n]=i<<1|a,r}},t}(),r=function(){var e={LL:0,LH:1,HL:1,HH:2};function t(){this.failOnCorruptedImage=!1}function r(e,t){e.x0=Math.ceil(t.XOsiz/e.XRsiz),e.x1=Math.ceil(t.Xsiz/e.XRsiz),e.y0=Math.ceil(t.YOsiz/e.YRsiz),e.y1=Math.ceil(t.Ysiz/e.YRsiz),e.width=e.x1-e.x0,e.height=e.y1-e.y0}function i(e,t){for(var n,r=e.SIZ,i=[],a=Math.ceil((r.Xsiz-r.XTOsiz)/r.XTsiz),s=Math.ceil((r.Ysiz-r.YTOsiz)/r.YTsiz),o=0;o<s;o++)for(var l=0;l<a;l++)(n={}).tx0=Math.max(r.XTOsiz+l*r.XTsiz,r.XOsiz),n.ty0=Math.max(r.YTOsiz+o*r.YTsiz,r.YOsiz),n.tx1=Math.min(r.XTOsiz+(l+1)*r.XTsiz,r.Xsiz),n.ty1=Math.min(r.YTOsiz+(o+1)*r.YTsiz,r.Ysiz),n.width=n.tx1-n.tx0,n.height=n.ty1-n.ty0,n.components=[],i.push(n);e.tiles=i;for(var h=0,c=r.Csiz;h<c;h++)for(var f=t[h],u=0,d=i.length;u<d;u++){var p={};n=i[u],p.tcx0=Math.ceil(n.tx0/f.XRsiz),p.tcy0=Math.ceil(n.ty0/f.YRsiz),p.tcx1=Math.ceil(n.tx1/f.XRsiz),p.tcy1=Math.ceil(n.ty1/f.YRsiz),p.width=p.tcx1-p.tcx0,p.height=p.tcy1-p.tcy0,n.components[h]=p}}function s(e,t,n){var r=t.codingStyleParameters,i={};return r.entropyCoderWithCustomPrecincts?(i.PPx=r.precinctsSizes[n].PPx,i.PPy=r.precinctsSizes[n].PPy):(i.PPx=15,i.PPy=15),i.xcb_=n>0?Math.min(r.xcb,i.PPx-1):Math.min(r.xcb,i.PPx),i.ycb_=n>0?Math.min(r.ycb,i.PPy-1):Math.min(r.ycb,i.PPy),i}function h(e,t,n){var r=1<<n.PPx,i=1<<n.PPy,a=0===t.resLevel,s=1<<n.PPx+(a?0:-1),o=1<<n.PPy+(a?0:-1),l=t.trx1>t.trx0?Math.ceil(t.trx1/r)-Math.floor(t.trx0/r):0,h=t.try1>t.try0?Math.ceil(t.try1/i)-Math.floor(t.try0/i):0,c=l*h;t.precinctParameters={precinctWidth:r,precinctHeight:i,numprecinctswide:l,numprecinctshigh:h,numprecincts:c,precinctWidthInSubband:s,precinctHeightInSubband:o}}function c(e,t,n){var r,i,a,s,o=n.xcb_,l=n.ycb_,h=1<<o,c=1<<l,f=t.tbx0>>o,u=t.tby0>>l,d=t.tbx1+h-1>>o,p=t.tby1+c-1>>l,m=t.resolution.precinctParameters,g=[],b=[];for(i=u;i<p;i++)for(r=f;r<d;r++){if((a={cbx:r,cby:i,tbx0:h*r,tby0:c*i,tbx1:h*(r+1),tby1:c*(i+1)}).tbx0_=Math.max(t.tbx0,a.tbx0),a.tby0_=Math.max(t.tby0,a.tby0),a.tbx1_=Math.min(t.tbx1,a.tbx1),a.tby1_=Math.min(t.tby1,a.tby1),s=Math.floor((a.tbx0_-t.tbx0)/m.precinctWidthInSubband)+Math.floor((a.tby0_-t.tby0)/m.precinctHeightInSubband)*m.numprecinctswide,a.precinctNumber=s,a.subbandType=t.type,a.Lblock=3,!(a.tbx1_<=a.tbx0_||a.tby1_<=a.tby0_)){g.push(a);var v=b[s];void 0!==v?(r<v.cbxMin?v.cbxMin=r:r>v.cbxMax&&(v.cbxMax=r),i<v.cbyMin?v.cbxMin=i:i>v.cbyMax&&(v.cbyMax=i)):b[s]=v={cbxMin:r,cbyMin:i,cbxMax:r,cbyMax:i},a.precinct=v}}t.codeblockParameters={codeblockWidth:o,codeblockHeight:l,numcodeblockwide:d-f+1,numcodeblockhigh:p-u+1},t.codeblocks=g,t.precincts=b}function d(e,t,n){for(var r=[],i=e.subbands,a=0,s=i.length;a<s;a++)for(var o=i[a].codeblocks,l=0,h=o.length;l<h;l++){var c=o[l];c.precinctNumber===t&&r.push(c)}return{layerNumber:n,codeblocks:r}}function p(e){for(var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=r.codingStyleDefaultParameters.layersCount,a=t.Csiz,s=0,o=0;o<a;o++)s=Math.max(s,r.components[o].codingStyleParameters.decompositionLevelsCount);var l=0,h=0,c=0,f=0;this.nextPacket=function(){for(;l<i;l++){for(;h<=s;h++){for(;c<a;c++){var e=r.components[c];if(!(h>e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[h],n=t.precinctParameters.numprecincts;f<n;){var o=d(t,f,l);return f++,o}f=0}}c=0}h=0}throw new Error("JPX Error: Out of packets")}}function m(e){for(var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=r.codingStyleDefaultParameters.layersCount,a=t.Csiz,s=0,o=0;o<a;o++)s=Math.max(s,r.components[o].codingStyleParameters.decompositionLevelsCount);var l=0,h=0,c=0,f=0;this.nextPacket=function(){for(;l<=s;l++){for(;h<i;h++){for(;c<a;c++){var e=r.components[c];if(!(l>e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[l],n=t.precinctParameters.numprecincts;f<n;){var o=d(t,f,h);return f++,o}f=0}}c=0}h=0}throw new Error("JPX Error: Out of packets")}}function g(e){var t,n,r,i,a=e.SIZ,s=e.currentTile.index,o=e.tiles[s],l=o.codingStyleDefaultParameters.layersCount,h=a.Csiz,c=0;for(r=0;r<h;r++){var f=o.components[r];c=Math.max(c,f.codingStyleParameters.decompositionLevelsCount)}var u=new Int32Array(c+1);for(n=0;n<=c;++n){var p=0;for(r=0;r<h;++r){var m=o.components[r].resolutions;n<m.length&&(p=Math.max(p,m[n].precinctParameters.numprecincts))}u[n]=p}t=0,n=0,r=0,i=0,this.nextPacket=function(){for(;n<=c;n++){for(;i<u[n];i++){for(;r<h;r++){var e=o.components[r];if(!(n>e.codingStyleParameters.decompositionLevelsCount)){var a=e.resolutions[n],s=a.precinctParameters.numprecincts;if(!(i>=s)){for(;t<l;){var f=d(a,i,t);return t++,f}t=0}}}r=0}i=0}throw new Error("JPX Error: Out of packets")}}function b(e){var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=r.codingStyleDefaultParameters.layersCount,a=t.Csiz,s=w(r),o=s,l=0,h=0,c=0,f=0,u=0;this.nextPacket=function(){for(;u<o.maxNumHigh;u++){for(;f<o.maxNumWide;f++){for(;c<a;c++){for(var e=r.components[c],t=e.codingStyleParameters.decompositionLevelsCount;h<=t;h++){var n=e.resolutions[h],p=s.components[c].resolutions[h],m=_(f,u,p,o,n);if(null!==m){for(;l<i;){var g=d(n,m,l);return l++,g}l=0}}h=0}c=0}f=0}throw new Error("JPX Error: Out of packets")}}function v(e){var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=r.codingStyleDefaultParameters.layersCount,a=t.Csiz,s=w(r),o=0,l=0,h=0,c=0,f=0;this.nextPacket=function(){for(;h<a;++h){for(var e=r.components[h],t=s.components[h],n=e.codingStyleParameters.decompositionLevelsCount;f<t.maxNumHigh;f++){for(;c<t.maxNumWide;c++){for(;l<=n;l++){var u=e.resolutions[l],p=t.resolutions[l],m=_(c,f,p,t,u);if(null!==m){for(;o<i;){var g=d(u,m,o);return o++,g}o=0}}l=0}c=0}f=0}throw new Error("JPX Error: Out of packets")}}function _(e,t,n,r,i){var a=e*r.minWidth,s=t*r.minHeight;if(a%n.width!=0||s%n.height!=0)return null;var o=s/n.width*i.precinctParameters.numprecinctswide;return a/n.height+o}function w(e){for(var t=e.components.length,n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=0,a=0,s=new Array(t),o=0;o<t;o++){for(var l=e.components[o],h=l.codingStyleParameters.decompositionLevelsCount,c=new Array(h+1),f=Number.MAX_VALUE,u=Number.MAX_VALUE,d=0,p=0,m=1,g=h;g>=0;--g){var b=l.resolutions[g],v=m*b.precinctParameters.precinctWidth,_=m*b.precinctParameters.precinctHeight;f=Math.min(f,v),u=Math.min(u,_),d=Math.max(d,b.precinctParameters.numprecinctswide),p=Math.max(p,b.precinctParameters.numprecinctshigh),c[g]={width:v,height:_},m<<=1}n=Math.min(n,f),r=Math.min(r,u),i=Math.max(i,d),a=Math.max(a,p),s[o]={resolutions:c,minWidth:f,minHeight:u,maxNumWide:d,maxNumHigh:p}}return{components:s,minWidth:n,minHeight:r,maxNumWide:i,maxNumHigh:a}}function y(e){for(var t=e.SIZ,n=e.currentTile.index,r=e.tiles[n],i=t.Csiz,a=0;a<i;a++){for(var o=r.components[a],l=o.codingStyleParameters.decompositionLevelsCount,f=[],u=[],d=0;d<=l;d++){var _,w=s(0,o,d),y={},x=1<<l-d;if(y.trx0=Math.ceil(o.tcx0/x),y.try0=Math.ceil(o.tcy0/x),y.trx1=Math.ceil(o.tcx1/x),y.try1=Math.ceil(o.tcy1/x),y.resLevel=d,h(0,y,w),f.push(y),0===d)(_={}).type="LL",_.tbx0=Math.ceil(o.tcx0/x),_.tby0=Math.ceil(o.tcy0/x),_.tbx1=Math.ceil(o.tcx1/x),_.tby1=Math.ceil(o.tcy1/x),_.resolution=y,c(0,_,w),u.push(_),y.subbands=[_];else{var k=1<<l-d+1,C=[];(_={}).type="HL",_.tbx0=Math.ceil(o.tcx0/k-.5),_.tby0=Math.ceil(o.tcy0/k),_.tbx1=Math.ceil(o.tcx1/k-.5),_.tby1=Math.ceil(o.tcy1/k),_.resolution=y,c(0,_,w),u.push(_),C.push(_),(_={}).type="LH",_.tbx0=Math.ceil(o.tcx0/k),_.tby0=Math.ceil(o.tcy0/k-.5),_.tbx1=Math.ceil(o.tcx1/k),_.tby1=Math.ceil(o.tcy1/k-.5),_.resolution=y,c(0,_,w),u.push(_),C.push(_),(_={}).type="HH",_.tbx0=Math.ceil(o.tcx0/k-.5),_.tby0=Math.ceil(o.tcy0/k-.5),_.tbx1=Math.ceil(o.tcx1/k-.5),_.tby1=Math.ceil(o.tcy1/k-.5),_.resolution=y,c(0,_,w),u.push(_),C.push(_),y.subbands=C}}o.resolutions=f,o.subbands=u}var A=r.codingStyleDefaultParameters.progressionOrder;switch(A){case 0:r.packetsIterator=new p(e);break;case 1:r.packetsIterator=new m(e);break;case 2:r.packetsIterator=new g(e);break;case 3:r.packetsIterator=new b(e);break;case 4:r.packetsIterator=new v(e);break;default:throw new Error("JPX Error: Unsupported progression order "+A)}}function x(e,t,n,r){var i,s=0,o=0,l=!1;function h(e){for(;o<e;){var r=t[n+s];s++,l?(i=i<<7|r,o+=7,l=!1):(i=i<<8|r,o+=8),255===r&&(l=!0)}return i>>>(o-=e)&(1<<e)-1}function c(e){return 255===t[n+s-1]&&t[n+s]===e?(f(1),!0):255===t[n+s]&&t[n+s+1]===e&&(f(2),!0)}function f(e){s+=e}function u(){o=0,l&&(s++,l=!1)}function d(){if(0===h(1))return 1;if(0===h(1))return 2;var e=h(2);return e<3?e+3:(e=h(5))<31?e+6:(e=h(7))+37}for(var p=e.currentTile.index,m=e.tiles[p],g=e.COD.sopMarkerUsed,b=e.COD.ephMarkerUsed,v=m.packetsIterator;s<r;){u(),g&&c(145)&&f(4);var _=v.nextPacket();if(h(1)){for(var w,y=_.layerNumber,x=[],k=0,C=_.codeblocks.length;k<C;k++){var A=(w=_.codeblocks[k]).precinct,I=w.cbx-A.cbxMin,P=w.cby-A.cbyMin,T=!1,O=!1;if(void 0!==w.included)T=!!h(1);else{var E,M;if(void 0!==(A=w.precinct).inclusionTree)E=A.inclusionTree;else{var B=A.cbxMax-A.cbxMin+1,D=A.cbyMax-A.cbyMin+1;E=new S(B,D,y),M=new z(B,D),A.inclusionTree=E,A.zeroBitPlanesTree=M}if(E.reset(I,P,y))for(;;){if(!h(1)){E.incrementValue(y);break}if(!E.nextLevel()){w.included=!0,T=O=!0;break}}}if(T){if(O){for((M=A.zeroBitPlanesTree).reset(I,P);;)if(h(1)){if(!M.nextLevel())break}else M.incrementValue();w.zeroBitPlanes=M.value}for(var L=d();h(1);)w.Lblock++;var U=a(L),F=h((L<1<<U?U-1:U)+w.Lblock);x.push({codeblock:w,codingpasses:L,dataLength:F})}}for(u(),b&&c(146);x.length>0;){var R=x.shift();void 0===(w=R.codeblock).data&&(w.data=[]),w.data.push({data:t,start:n+s,end:n+s+R.dataLength,codingpasses:R.codingpasses}),s+=R.dataLength}}}return s}function k(e,t,r,i,a,s,o,l){for(var h=i.tbx0,c=i.tby0,f=i.tbx1-i.tbx0,u=i.codeblocks,d="H"===i.type.charAt(0)?1:0,p="H"===i.type.charAt(1)?t:0,m=0,g=u.length;m<g;++m){var b=u[m],v=b.tbx1_-b.tbx0_,_=b.tby1_-b.tby0_;if(0!==v&&0!==_&&void 0!==b.data){var w,y;w=new I(v,_,b.subbandType,b.zeroBitPlanes,s),y=2;var x,k,C,A=b.data,z=0,S=0;for(x=0,k=A.length;x<k;x++)z+=(C=A[x]).end-C.start,S+=C.codingpasses;var P=new Uint8Array(z),T=0;for(x=0,k=A.length;x<k;x++){var O=(C=A[x]).data.subarray(C.start,C.end);P.set(O,T),T+=O.length}var E=new n(P,0,z);for(w.setDecoder(E),x=0;x<S;x++){switch(y){case 0:w.runSignificancePropogationPass();break;case 1:w.runMagnitudeRefinementPass();break;case 2:w.runCleanupPass(),l&&w.checkSegmentationSymbol()}y=(y+1)%3}var M,B,D,L=b.tbx0_-h+(b.tby0_-c)*f,U=w.coefficentsSign,F=w.coefficentsMagnitude,R=w.bitsDecoded,N=o?0:.5;T=0;var Z="LL"!==i.type;for(x=0;x<_;x++){var H=2*(L/f|0)*(t-f)+d+p;for(M=0;M<v;M++){if(0!==(B=F[T])){B=(B+N)*a,0!==U[T]&&(B=-B),D=R[T];var q=Z?H+(L<<1):L;e[q]=o&&D>=s?B:B*(1<<s-D)}L++,T++}L+=f-v}}}}function C(t,n,r){for(var i=n.components[r],a=i.codingStyleParameters,s=i.quantizationParameters,o=a.decompositionLevelsCount,l=s.SPqcds,h=s.scalarExpounded,c=s.guardBits,f=a.segmentationSymbolUsed,u=t.components[r].precision,d=a.reversibleTransformation,p=d?new O:new T,m=[],g=0,b=0;b<=o;b++){for(var v=i.resolutions[b],_=v.trx1-v.trx0,w=v.try1-v.try0,y=new Float32Array(_*w),x=0,C=v.subbands.length;x<C;x++){var A,z;h?(A=l[g].mu,z=l[g].epsilon,g++):(A=l[0].mu,z=l[0].epsilon+(b>0?1-b:0));var S=v.subbands[x],I=e[S.type];k(y,_,0,S,d?1:Math.pow(2,u+I-z)*(1+A/2048),c+z-1,d,f)}m.push({width:_,height:w,items:y})}var P=p.calculate(m,i.tcx0,i.tcy0);return{left:i.tcx0,top:i.tcy0,width:P.width,height:P.height,items:P.items}}function A(e,t){for(var n=e.SIZ.Csiz,r=e.tiles[t],i=0;i<n;i++){var a=r.components[i],s=void 0!==e.currentTile.QCC[i]?e.currentTile.QCC[i]:e.currentTile.QCD;a.quantizationParameters=s;var o=void 0!==e.currentTile.COC[i]?e.currentTile.COC[i]:e.currentTile.COD;a.codingStyleParameters=o}r.codingStyleDefaultParameters=e.currentTile.COD}t.prototype={parse:function(e){if(65359!==o(e,0))for(var t=0,n=e.length;t<n;){var r=8,i=l(e,t),a=l(e,t+4);if(t+=r,1===i&&(i=4294967296*l(e,t)+l(e,t+4),t+=8,r+=8),0===i&&(i=n-t+r),i<r)throw new Error("JPX Error: Invalid box field size");var s=i-r,h=!0;switch(a){case 1785737832:h=!1;break;case 1668246642:var c=e[t];e[t+1],e[t+2];if(1===c){var d=l(e,t+3);switch(d){case 16:case 17:case 18:break;default:f("Unknown colorspace "+d)}}else 2===c&&u("ICC profile not supported");break;case 1785737827:this.parseCodestream(e,t,t+s);break;case 1783636e3:218793738!==l(e,t)&&f("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var p=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);f("Unsupported header type "+a+" ("+p+")")}h&&(t+=s)}else this.parseCodestream(e,0,e.length)},parseImageProperties:function(e){for(var t=e.getByte();t>=0;){if(65361===(t<<8|(t=e.getByte()))){e.skip(4);var n=e.getInt32()>>>0,r=e.getInt32()>>>0,i=e.getInt32()>>>0,a=e.getInt32()>>>0;e.skip(16);var s=e.getUint16();return this.width=n-i,this.height=r-a,this.componentsCount=s,void(this.bitsPerComponent=8)}}throw new Error("JPX Error: No size marker found in JPX stream")},parseCodestream:function(e,t,n){var a={};try{for(var s=!1,h=t;h+1<n;){var c=o(e,h);h+=2;var u,d,p,m,g,b,v=0;switch(c){case 65359:a.mainHeader=!0;break;case 65497:break;case 65361:v=o(e,h);var _={};_.Xsiz=l(e,h+4),_.Ysiz=l(e,h+8),_.XOsiz=l(e,h+12),_.YOsiz=l(e,h+16),_.XTsiz=l(e,h+20),_.YTsiz=l(e,h+24),_.XTOsiz=l(e,h+28),_.YTOsiz=l(e,h+32);var w=o(e,h+36);_.Csiz=w;var k=[];u=h+38;for(var z=0;z<w;z++){var S={precision:1+(127&e[u]),isSigned:!!(128&e[u]),XRsiz:e[u+1],YRsiz:e[u+1]};r(S,_),k.push(S)}a.SIZ=_,a.components=k,i(a,k),a.QCC=[],a.COC=[];break;case 65372:v=o(e,h);var I={};switch(u=h+2,31&(d=e[u++])){case 0:m=8,g=!0;break;case 1:m=16,g=!1;break;case 2:m=16,g=!0;break;default:throw new Error("JPX Error: Invalid SQcd value "+d)}for(I.noQuantization=8===m,I.scalarExpounded=g,I.guardBits=d>>5,p=[];u<v+h;){var P={};8===m?(P.epsilon=e[u++]>>3,P.mu=0):(P.epsilon=e[u]>>3,P.mu=(7&e[u])<<8|e[u+1],u+=2),p.push(P)}I.SPqcds=p,a.mainHeader?a.QCD=I:(a.currentTile.QCD=I,a.currentTile.QCC=[]);break;case 65373:v=o(e,h);var T,O={};switch(u=h+2,a.SIZ.Csiz<257?T=e[u++]:(T=o(e,u),u+=2),31&(d=e[u++])){case 0:m=8,g=!0;break;case 1:m=16,g=!1;break;case 2:m=16,g=!0;break;default:throw new Error("JPX Error: Invalid SQcd value "+d)}for(O.noQuantization=8===m,O.scalarExpounded=g,O.guardBits=d>>5,p=[];u<v+h;)P={},8===m?(P.epsilon=e[u++]>>3,P.mu=0):(P.epsilon=e[u]>>3,P.mu=(7&e[u])<<8|e[u+1],u+=2),p.push(P);O.SPqcds=p,a.mainHeader?a.QCC[T]=O:a.currentTile.QCC[T]=O;break;case 65362:v=o(e,h);var E={};u=h+2;var M=e[u++];E.entropyCoderWithCustomPrecincts=!!(1&M),E.sopMarkerUsed=!!(2&M),E.ephMarkerUsed=!!(4&M),E.progressionOrder=e[u++],E.layersCount=o(e,u),u+=2,E.multipleComponentTransform=e[u++],E.decompositionLevelsCount=e[u++],E.xcb=2+(15&e[u++]),E.ycb=2+(15&e[u++]);var B=e[u++];if(E.selectiveArithmeticCodingBypass=!!(1&B),E.resetContextProbabilities=!!(2&B),E.terminationOnEachCodingPass=!!(4&B),E.verticalyStripe=!!(8&B),E.predictableTermination=!!(16&B),E.segmentationSymbolUsed=!!(32&B),E.reversibleTransformation=e[u++],E.entropyCoderWithCustomPrecincts){for(var D=[];u<v+h;){var L=e[u++];D.push({PPx:15&L,PPy:L>>4})}E.precinctsSizes=D}var U=[];if(E.selectiveArithmeticCodingBypass&&U.push("selectiveArithmeticCodingBypass"),E.resetContextProbabilities&&U.push("resetContextProbabilities"),E.terminationOnEachCodingPass&&U.push("terminationOnEachCodingPass"),E.verticalyStripe&&U.push("verticalyStripe"),E.predictableTermination&&U.push("predictableTermination"),U.length>0)throw s=!0,new Error("JPX Error: Unsupported COD options ("+U.join(", ")+")");a.mainHeader?a.COD=E:(a.currentTile.COD=E,a.currentTile.COC=[]);break;case 65424:v=o(e,h),(b={}).index=o(e,h+2),b.length=l(e,h+4),b.dataEnd=b.length+h-2,b.partIndex=e[h+8],b.partsCount=e[h+9],a.mainHeader=!1,0===b.partIndex&&(b.COD=a.COD,b.COC=a.COC.slice(0),b.QCD=a.QCD,b.QCC=a.QCC.slice(0)),a.currentTile=b;break;case 65427:0===(b=a.currentTile).partIndex&&(A(a,b.index),y(a)),x(a,e,h,v=b.dataEnd-h);break;case 65365:case 65367:case 65368:case 65380:v=o(e,h);break;case 65363:throw new Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("JPX Error: Unknown codestream code: "+c.toString(16))}h+=v}}catch(e){if(s||this.failOnCorruptedImage)throw e;f("Trying to recover from "+e.message)}this.tiles=function(e){for(var t=e.SIZ,n=e.components,r=t.Csiz,i=[],a=0,s=e.tiles.length;a<s;a++){var o,l=e.tiles[a],h=[];for(o=0;o<r;o++)h[o]=C(e,l,o);var c,f,u,d,p,m,g,b,v,_,w,y,x,k,A,z=h[0],S=new Uint8Array(z.items.length*r),I={left:z.left,top:z.top,width:z.width,height:z.height,items:S},P=0;if(l.codingStyleDefaultParameters.multipleComponentTransform){var T=4===r,O=h[0].items,E=h[1].items,M=h[2].items,B=T?h[3].items:null;c=n[0].precision-8,f=.5+(128<<c),d=-(p=.5*(u=255*(1<<c)));var D=l.components[0],L=r-3;if(g=O.length,D.codingStyleParameters.reversibleTransformation)for(m=0;m<g;m++,P+=L)b=O[m]+f,v=E[m],_=M[m],w=(y=b-(_+v>>2))+_,x=y+v,S[P++]=w<=0?0:w>=u?255:w>>c,S[P++]=y<=0?0:y>=u?255:y>>c,S[P++]=x<=0?0:x>=u?255:x>>c;else for(m=0;m<g;m++,P+=L)b=O[m]+f,v=E[m],_=M[m],w=b+1.402*_,y=b-.34413*v-.71414*_,x=b+1.772*v,S[P++]=w<=0?0:w>=u?255:w>>c,S[P++]=y<=0?0:y>=u?255:y>>c,S[P++]=x<=0?0:x>=u?255:x>>c;if(T)for(m=0,P=3;m<g;m++,P+=4)k=B[m],S[P]=k<=d?0:k>=p?255:k+f>>c}else for(o=0;o<r;o++){var U=h[o].items;for(c=n[o].precision-8,f=.5+(128<<c),d=-(u=127.5*(1<<c)),P=o,m=0,g=U.length;m<g;m++)A=U[m],S[P]=A<=d?0:A>=u?255:A+f>>c,P+=r}i.push(I)}return i}(a),this.width=a.SIZ.Xsiz-a.SIZ.XOsiz,this.height=a.SIZ.Ysiz-a.SIZ.YOsiz,this.componentsCount=a.SIZ.Csiz}};var z=function(){function e(e,t){var n=a(Math.max(e,t))+1;this.levels=[];for(var r=0;r<n;r++){var i={width:e,height:t,items:[]};this.levels.push(i),e=Math.ceil(e/2),t=Math.ceil(t/2)}}return e.prototype={reset:function(e,t){for(var n,r=0,i=0;r<this.levels.length;){var a=e+t*(n=this.levels[r]).width;if(void 0!==n.items[a]){i=n.items[a];break}n.index=a,e>>=1,t>>=1,r++}r--,(n=this.levels[r]).items[n.index]=i,this.currentLevel=r,delete this.value},incrementValue:function(){var e=this.levels[this.currentLevel];e.items[e.index]++},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],n=t.items[t.index];return--e<0?(this.value=n,!1):(this.currentLevel=e,(t=this.levels[e]).items[t.index]=n,!0)}},e}(),S=function(){function e(e,t,n){var r=a(Math.max(e,t))+1;this.levels=[];for(var i=0;i<r;i++){for(var s=new Uint8Array(e*t),o=0,l=s.length;o<l;o++)s[o]=n;var h={width:e,height:t,items:s};this.levels.push(h),e=Math.ceil(e/2),t=Math.ceil(t/2)}}return e.prototype={reset:function(e,t,n){for(var r=0;r<this.levels.length;){var i=this.levels[r],a=e+t*i.width;i.index=a;var s=i.items[a];if(255===s)break;if(s>n)return this.currentLevel=r,this.propagateValues(),!1;e>>=1,t>>=1,r++}return this.currentLevel=r-1,!0},incrementValue:function(e){var t=this.levels[this.currentLevel];t.items[t.index]=e+1,this.propagateValues()},propagateValues:function(){for(var e=this.currentLevel,t=this.levels[e],n=t.items[t.index];--e>=0;)(t=this.levels[e]).items[t.index]=n},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],n=t.items[t.index];return t.items[t.index]=255,!(--e<0)&&(this.currentLevel=e,(t=this.levels[e]).items[t.index]=n,!0)}},e}(),I=function(){var e=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),t=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),n=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function r(r,i,a,s,o){this.width=r,this.height=i,this.contextLabelTable="HH"===a?n:"HL"===a?t:e;var l=r*i;this.neighborsSignificance=new Uint8Array(l),this.coefficentsSign=new Uint8Array(l),this.coefficentsMagnitude=o>14?new Uint32Array(l):o>6?new Uint16Array(l):new Uint8Array(l),this.processingFlags=new Uint8Array(l);var h=new Uint8Array(l);if(0!==s)for(var c=0;c<l;c++)h[c]=s;this.bitsDecoded=h,this.reset()}return r.prototype={setDecoder:function(e){this.decoder=e},reset:function(){this.contexts=new Int8Array(19),this.contexts[0]=8,this.contexts[17]=92,this.contexts[18]=6},setNeighborsSignificance:function(e,t,n){var r,i=this.neighborsSignificance,a=this.width,s=this.height,o=t>0,l=t+1<a;e>0&&(r=n-a,o&&(i[r-1]+=16),l&&(i[r+1]+=16),i[r]+=4),e+1<s&&(r=n+a,o&&(i[r-1]+=16),l&&(i[r+1]+=16),i[r]+=4),o&&(i[n-1]+=1),l&&(i[n+1]+=1),i[n]|=128},runSignificancePropogationPass:function(){for(var e=this.decoder,t=this.width,n=this.height,r=this.coefficentsMagnitude,i=this.coefficentsSign,a=this.neighborsSignificance,s=this.processingFlags,o=this.contexts,l=this.contextLabelTable,h=this.bitsDecoded,c=0;c<n;c+=4)for(var f=0;f<t;f++)for(var u=c*t+f,d=0;d<4;d++,u+=t){var p=c+d;if(p>=n)break;if(s[u]&=-2,!r[u]&&a[u]){var m=l[a[u]];if(e.readBit(o,m)){var g=this.decodeSignBit(p,f,u);i[u]=g,r[u]=1,this.setNeighborsSignificance(p,f,u),s[u]|=2}h[u]++,s[u]|=1}}},decodeSignBit:function(e,t,n){var r,i,a,s,o,l,h=this.width,c=this.height,f=this.coefficentsMagnitude,u=this.coefficentsSign;s=t>0&&0!==f[n-1],t+1<h&&0!==f[n+1]?(a=u[n+1],r=s?1-a-(i=u[n-1]):1-a-a):r=s?1-(i=u[n-1])-i:0;var d=3*r;return s=e>0&&0!==f[n-h],e+1<c&&0!==f[n+h]?(a=u[n+h],r=s?1-a-(i=u[n-h])+d:1-a-a+d):r=s?1-(i=u[n-h])-i+d:d,r>=0?(o=9+r,l=this.decoder.readBit(this.contexts,o)):(o=9-r,l=1^this.decoder.readBit(this.contexts,o)),l},runMagnitudeRefinementPass:function(){for(var e,t=this.decoder,n=this.width,r=this.height,i=this.coefficentsMagnitude,a=this.neighborsSignificance,s=this.contexts,o=this.bitsDecoded,l=this.processingFlags,h=n*r,c=4*n,f=0;f<h;f=e){e=Math.min(h,f+c);for(var u=0;u<n;u++)for(var d=f+u;d<e;d+=n)if(i[d]&&0==(1&l[d])){var p=16;if(0!=(2&l[d]))l[d]^=2,p=0===(127&a[d])?15:14;var m=t.readBit(s,p);i[d]=i[d]<<1|m,o[d]++,l[d]|=1}}},runCleanupPass:function(){for(var e,t=this.decoder,n=this.width,r=this.height,i=this.neighborsSignificance,a=this.coefficentsMagnitude,s=this.coefficentsSign,o=this.contexts,l=this.contextLabelTable,h=this.bitsDecoded,c=this.processingFlags,f=n,u=2*n,d=3*n,p=0;p<r;p=e){e=Math.min(p+4,r);for(var m=p*n,g=p+3<r,b=0;b<n;b++){var v,_=m+b,w=0,y=_,x=p;if(g&&0===c[_]&&0===c[_+f]&&0===c[_+u]&&0===c[_+d]&&0===i[_]&&0===i[_+f]&&0===i[_+u]&&0===i[_+d]){if(!t.readBit(o,18)){h[_]++,h[_+f]++,h[_+u]++,h[_+d]++;continue}0!==(w=t.readBit(o,17)<<1|t.readBit(o,17))&&(x=p+w,y+=w*n),v=this.decodeSignBit(x,b,y),s[y]=v,a[y]=1,this.setNeighborsSignificance(x,b,y),c[y]|=2,y=_;for(var k=p;k<=x;k++,y+=n)h[y]++;w++}for(x=p+w;x<e;x++,y+=n)if(!a[y]&&0==(1&c[y])){var C=l[i[y]];1===t.readBit(o,C)&&(v=this.decodeSignBit(x,b,y),s[y]=v,a[y]=1,this.setNeighborsSignificance(x,b,y),c[y]|=2),h[y]++}}}},checkSegmentationSymbol:function(){var e=this.decoder,t=this.contexts;if(10!==(e.readBit(t,17)<<3|e.readBit(t,17)<<2|e.readBit(t,17)<<1|e.readBit(t,17)))throw new Error("JPX Error: Invalid segmentation symbol")}},r}(),P=function(){function e(){}return e.prototype.calculate=function(e,t,n){for(var r=e[0],i=1,a=e.length;i<a;i++)r=this.iterate(r,e[i],t,n);return r},e.prototype.extend=function(e,t,n){var r=t-1,i=t+1,a=t+n-2,s=t+n;e[r--]=e[i++],e[s++]=e[a--],e[r--]=e[i++],e[s++]=e[a--],e[r--]=e[i++],e[s++]=e[a--],e[r]=e[i],e[s]=e[a]},e.prototype.iterate=function(e,t,n,r){var i,a,s,o,l,h,c=e.width,f=e.height,u=e.items,d=t.width,p=t.height,m=t.items;for(s=0,i=0;i<f;i++)for(o=2*i*d,a=0;a<c;a++,s++,o+=2)m[o]=u[s];u=e.items=null;var g=new Float32Array(d+8);if(1===d){if(0!=(1&n))for(h=0,s=0;h<p;h++,s+=d)m[s]*=.5}else for(h=0,s=0;h<p;h++,s+=d)g.set(m.subarray(s,s+d),4),this.extend(g,4,d),this.filter(g,4,d),m.set(g.subarray(4,4+d),s);var b=16,v=[];for(i=0;i<b;i++)v.push(new Float32Array(p+8));var _,w=0;if(e=4+p,1===p){if(0!=(1&r))for(l=0;l<d;l++)m[l]*=.5}else for(l=0;l<d;l++){if(0===w){for(b=Math.min(d-l,b),s=l,o=4;o<e;s+=d,o++)for(_=0;_<b;_++)v[_][o]=m[s+_];w=b}var y=v[--w];if(this.extend(y,4,p),this.filter(y,4,p),0===w)for(s=l-b+1,o=4;o<e;s+=d,o++)for(_=0;_<b;_++)m[s+_]=v[_][o]}return{width:d,height:p,items:m}},e}(),T=function(){function e(){P.call(this)}return e.prototype=Object.create(P.prototype),e.prototype.filter=function(e,t,n){var r,i,a,s,o=n>>1,l=-1.586134342059924,h=-.052980118572961,c=.882911075530934,f=.443506852043971,u=1.230174104914001;for(r=(t|=0)-3,i=o+4;i--;r+=2)e[r]*=.8128930661159609;for(a=f*e[(r=t-2)-1],i=o+3;i--&&(s=f*e[r+1],e[r]=u*e[r]-a-s,i--);r+=2)a=f*e[(r+=2)+1],e[r]=u*e[r]-a-s;for(a=c*e[(r=t-1)-1],i=o+2;i--&&(s=c*e[r+1],e[r]-=a+s,i--);r+=2)a=c*e[(r+=2)+1],e[r]-=a+s;for(a=h*e[(r=t)-1],i=o+1;i--&&(s=h*e[r+1],e[r]-=a+s,i--);r+=2)a=h*e[(r+=2)+1],e[r]-=a+s;if(0!==o)for(a=l*e[(r=t+1)-1],i=o;i--&&(s=l*e[r+1],e[r]-=a+s,i--);r+=2)a=l*e[(r+=2)+1],e[r]-=a+s},e}(),O=function(){function e(){P.call(this)}return e.prototype=Object.create(P.prototype),e.prototype.filter=function(e,t,n){var r,i,a=n>>1;for(r=t|=0,i=a+1;i--;r+=2)e[r]-=e[r-1]+e[r+1]+2>>2;for(r=t+1,i=a;i--;r+=2)e[r]+=e[r-1]+e[r+1]>>1},e}();return t}(),i=function(){function e(){}function t(e,t,n){this.data=e,this.start=t,this.end=n}function r(e,t,n){var r=e.getContexts(t),i=1;function a(e){for(var t=0,a=0;a<e;a++){var s=n.readBit(r,i);i=i<256?i<<1|s:511&(i<<1|s)|256,t=t<<1|s}return t>>>0}var s=a(1),o=a(1)?a(1)?a(1)?a(1)?a(1)?a(32)+4436:a(12)+340:a(8)+84:a(6)+20:a(4)+4:a(2);return 0===s?o:o>0?-o:null}function i(e,t,n){for(var r=e.getContexts("IAID"),i=1,a=0;a<n;a++){i=i<<1|t.readBit(r,i)}return n<31?i&(1<<n)-1:2147483647&i}e.prototype={getContexts:function(e){return e in this?this[e]:this[e]=new Int8Array(65536)}},t.prototype={get decoder(){return h(this,"decoder",new n(this.data,this.start,this.end))},get contextCache(){return h(this,"contextCache",new e)}};var f=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"patternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],u=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],d=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],p=[39717,1941,229,405],m=[32,8];function g(e,t,n,r,i,a,s,o){if(e&&c("JBIG2 error: MMR encoding is not supported"),0===r&&!a&&!i&&4===s.length&&3===s[0].x&&-1===s[0].y&&-3===s[1].x&&-1===s[1].y&&2===s[2].x&&-2===s[2].y&&-2===s[3].x&&-2===s[3].y)return function(e,t,n){var r,i,a,s,o,l,h,c=n.decoder,f=n.contextCache.getContexts("GB"),u=[];for(i=0;i<t;i++)for(o=u[i]=new Uint8Array(e),l=i<1?o:u[i-1],r=(h=i<2?o:u[i-2])[0]<<13|h[1]<<12|h[2]<<11|l[0]<<7|l[1]<<6|l[2]<<5|l[3]<<4,a=0;a<e;a++)o[a]=s=c.readBit(f,r),r=(31735&r)<<1|(a+3<e?h[a+3]<<11:0)|(a+4<e?l[a+4]<<4:0)|s;return u}(t,n,o);var l=!!a,h=u[r].concat(s);h.sort(function(e,t){return e.y-t.y||e.x-t.x});var f,d,m=h.length,g=new Int8Array(m),b=new Int8Array(m),v=[],_=0,w=0,y=0,x=0;for(d=0;d<m;d++)g[d]=h[d].x,b[d]=h[d].y,w=Math.min(w,h[d].x),y=Math.max(y,h[d].x),x=Math.min(x,h[d].y),d<m-1&&h[d].y===h[d+1].y&&h[d].x===h[d+1].x-1?_|=1<<m-1-d:v.push(d);var k=v.length,C=new Int8Array(k),A=new Int8Array(k),z=new Uint16Array(k);for(f=0;f<k;f++)d=v[f],C[f]=h[d].x,A[f]=h[d].y,z[f]=1<<m-1-d;for(var S,I,P,T,O,E=-w,M=-x,B=t-y,D=p[r],L=new Uint8Array(t),U=[],F=o.decoder,R=o.contextCache.getContexts("GB"),N=0,Z=0,H=0;H<n;H++){if(i)if(N^=F.readBit(R,D)){U.push(L);continue}for(L=new Uint8Array(L),U.push(L),S=0;S<t;S++)if(l&&a[H][S])L[S]=0;else{if(S>=E&&S<B&&H>=M)for(Z=Z<<1&_,d=0;d<k;d++)I=H+A[d],P=S+C[d],(T=U[I][P])&&(Z|=T=z[d]);else for(Z=0,O=m-1,d=0;d<m;d++,O--)(P=S+g[d])>=0&&P<t&&(I=H+b[d])>=0&&(T=U[I][P])&&(Z|=T<<O);var q=F.readBit(R,Z);L[S]=q}}return U}function b(e,t,n,r,i,a,s,o,l){var h=d[n].coding;0===n&&(h=h.concat([o[0]]));var f,u=h.length,p=new Int32Array(u),g=new Int32Array(u);for(f=0;f<u;f++)p[f]=h[f].x,g[f]=h[f].y;var b=d[n].reference;0===n&&(b=b.concat([o[1]]));var v=b.length,_=new Int32Array(v),w=new Int32Array(v);for(f=0;f<v;f++)_[f]=b[f].x,w[f]=b[f].y;for(var y=r[0].length,x=r.length,k=m[n],C=[],A=l.decoder,z=l.contextCache.getContexts("GR"),S=0,I=0;I<t;I++){if(s)(S^=A.readBit(z,k))&&c("JBIG2 error: prediction is not supported");var P=new Uint8Array(e);C.push(P);for(var T=0;T<e;T++){var O,E,M=0;for(f=0;f<u;f++)O=I+g[f],E=T+p[f],O<0||E<0||E>=e?M<<=1:M=M<<1|C[O][E];for(f=0;f<v;f++)O=I+w[f]+a,E=T+_[f]+i,O<0||O>=x||E<0||E>=y?M<<=1:M=M<<1|r[O][E];var B=A.readBit(z,M);P[T]=B}}return C}function v(e,t,n,a,s,o,l,h,f,u,d,p,m,g,v,_,w){e&&c("JBIG2 error: huffman is not supported");var y,x,k=[];for(y=0;y<a;y++){if(x=new Uint8Array(n),s)for(var C=0;C<n;C++)x[C]=s;k.push(x)}var A=w.decoder,z=w.contextCache,S=-r(z,"IADT",A),I=0;for(y=0;y<o;){S+=r(z,"IADT",A);for(var P=I+=r(z,"IAFS",A);;){var T=l*S+(1===l?0:r(z,"IAIT",A)),O=i(z,A,f),E=t&&r(z,"IARI",A),M=h[O],B=M[0].length,D=M.length;if(E){var L=r(z,"IARDW",A),U=r(z,"IARDH",A);M=b(B+=L,D+=U,v,M,(L>>1)+r(z,"IARDX",A),(U>>1)+r(z,"IARDY",A),!1,_,w)}var F,R,N,Z=T-(1&p?0:D),H=P-(2&p?B:0);if(u){for(F=0;F<D;F++)if(x=k[H+F]){N=M[F];var q=Math.min(n-Z,B);switch(m){case 0:for(R=0;R<q;R++)x[Z+R]|=N[R];break;case 2:for(R=0;R<q;R++)x[Z+R]^=N[R];break;default:c("JBIG2 error: operator "+m+" is not supported")}}P+=D-1}else{for(R=0;R<D;R++)if(x=k[Z+R])switch(N=M[R],m){case 0:for(F=0;F<B;F++)x[H+F]|=N[F];break;case 2:for(F=0;F<B;F++)x[H+F]^=N[F];break;default:c("JBIG2 error: operator "+m+" is not supported")}P+=B-1}y++;var J=r(z,"IADS",A);if(null===J)break;P+=J+d}}return k}function _(e,t){var n={};n.number=l(e,t);var r=e[t+4],i=63&r;f[i]||c("JBIG2 error: invalid segment type: "+i),n.type=i,n.typeName=f[i],n.deferredNonRetain=!!(128&r);var a=!!(64&r),s=e[t+5],h=s>>5&7,u=[31&s],d=t+6;if(7===s){h=536870911&l(e,d-1),d+=3;var p=h+7>>3;for(u[0]=e[d++];--p>0;)u.push(e[d++])}else 5!==s&&6!==s||c("JBIG2 error: invalid referred-to flags");n.retainBits=u;var m,g,b=n.number<=256?1:n.number<=65536?2:4,v=[];for(m=0;m<h;m++){var _=1===b?e[d]:2===b?o(e,d):l(e,d);v.push(_),d+=b}if(n.referredTo=v,a?(n.pageAssociation=l(e,d),d+=4):n.pageAssociation=e[d++],n.length=l(e,d),d+=4,4294967295===n.length)if(38===i){var w=y(e,d),k=!!(1&e[d+x]),C=new Uint8Array(6);for(k||(C[0]=255,C[1]=172),C[2]=w.height>>>24&255,C[3]=w.height>>16&255,C[4]=w.height>>8&255,C[5]=255&w.height,m=d,g=e.length;m<g;m++){for(var A=0;A<6&&C[A]===e[m+A];)A++;if(6===A){n.length=m+6;break}}4294967295===n.length&&c("JBIG2 error: segment end was not found")}else c("JBIG2 error: invalid unknown segment length");return n.headerEnd=d,n}function w(e,t,n,r){for(var i=[],a=n;a<r;){var s=_(t,a);a=s.headerEnd;var o={header:s,data:t};if(e.randomAccess||(o.start=a,a+=s.length,o.end=a),i.push(o),51===s.type)break}if(e.randomAccess)for(var l=0,h=i.length;l<h;l++)i[l].start=a,a+=i[l].header.length,i[l].end=a;return i}function y(e,t){return{width:l(e,t),height:l(e,t+4),x:l(e,t+8),y:l(e,t+12),combinationOperator:7&e[t+16]}}var x=17;function k(e,t){var n,r,i,a,h=e.header,f=e.data,u=e.start,d=e.end;switch(h.type){case 0:var p={},m=o(f,u);if(p.huffman=!!(1&m),p.refinement=!!(2&m),p.huffmanDHSelector=m>>2&3,p.huffmanDWSelector=m>>4&3,p.bitmapSizeSelector=m>>6&1,p.aggregationInstancesSelector=m>>7&1,p.bitmapCodingContextUsed=!!(256&m),p.bitmapCodingContextRetained=!!(512&m),p.template=m>>10&3,p.refinementTemplate=m>>12&1,u+=2,!p.huffman){for(a=0===p.template?4:1,r=[],i=0;i<a;i++)r.push({x:s(f,u),y:s(f,u+1)}),u+=2;p.at=r}if(p.refinement&&!p.refinementTemplate){for(r=[],i=0;i<2;i++)r.push({x:s(f,u),y:s(f,u+1)}),u+=2;p.refinementAt=r}p.numberOfExportedSymbols=l(f,u),u+=4,p.numberOfNewSymbols=l(f,u),u+=4,n=[p,h.number,h.referredTo,f,u,d];break;case 6:case 7:var g={};g.info=y(f,u);var b=o(f,u+=x);if(u+=2,g.huffman=!!(1&b),g.refinement=!!(2&b),g.stripSize=1<<(b>>2&3),g.referenceCorner=b>>4&3,g.transposed=!!(64&b),g.combinationOperator=b>>7&3,g.defaultPixelValue=b>>9&1,g.dsOffset=b<<17>>27,g.refinementTemplate=b>>15&1,g.huffman){var v=o(f,u);u+=2,g.huffmanFS=3&v,g.huffmanDS=v>>2&3,g.huffmanDT=v>>4&3,g.huffmanRefinementDW=v>>6&3,g.huffmanRefinementDH=v>>8&3,g.huffmanRefinementDX=v>>10&3,g.huffmanRefinementDY=v>>12&3,g.huffmanRefinementSizeSelector=!!(14&v)}if(g.refinement&&!g.refinementTemplate){for(r=[],i=0;i<2;i++)r.push({x:s(f,u),y:s(f,u+1)}),u+=2;g.refinementAt=r}g.numberOfSymbolInstances=l(f,u),u+=4,g.huffman&&c("JBIG2 error: huffman is not supported"),n=[g,h.referredTo,f,u,d];break;case 38:case 39:var _={};_.info=y(f,u),u+=x;var w=f[u++];if(_.mmr=!!(1&w),_.template=w>>1&3,_.prediction=!!(8&w),!_.mmr){for(a=0===_.template?4:1,r=[],i=0;i<a;i++)r.push({x:s(f,u),y:s(f,u+1)}),u+=2;_.at=r}n=[_,f,u,d];break;case 48:var k={width:l(f,u),height:l(f,u+4),resolutionX:l(f,u+8),resolutionY:l(f,u+12)};4294967295===k.height&&delete k.height;var C=f[u+16];o(f,u+17);k.lossless=!!(1&C),k.refinement=!!(2&C),k.defaultPixelValue=C>>2&1,k.combinationOperator=C>>3&3,k.requiresBuffer=!!(32&C),k.combinationOperatorOverride=!!(64&C),n=[k];break;case 49:case 50:case 51:case 62:break;default:c("JBIG2 error: segment type "+h.typeName+"("+h.type+") is not implemented")}var A="on"+h.typeName;A in t&&t[A].apply(t,n)}function C(e,t){for(var n=0,r=e.length;n<r;n++)k(e[n],t)}function A(){}function z(){}return A.prototype={onPageInformation:function(e){this.currentPageInfo=e;var t=e.width+7>>3,n=new Uint8Array(t*e.height);if(e.defaultPixelValue)for(var r=0,i=n.length;r<i;r++)n[r]=255;this.buffer=n},drawBitmap:function(e,t){var n,r,i,a,s=this.currentPageInfo,o=e.width,l=e.height,h=s.width+7>>3,f=s.combinationOperatorOverride?e.combinationOperator:s.combinationOperator,u=this.buffer,d=128>>(7&e.x),p=e.y*h+(e.x>>3);switch(f){case 0:for(n=0;n<l;n++){for(i=d,a=p,r=0;r<o;r++)t[n][r]&&(u[a]|=i),(i>>=1)||(i=128,a++);p+=h}break;case 2:for(n=0;n<l;n++){for(i=d,a=p,r=0;r<o;r++)t[n][r]&&(u[a]^=i),(i>>=1)||(i=128,a++);p+=h}break;default:c("JBIG2 error: operator "+f+" is not supported")}},onImmediateGenericRegion:function(e,n,r,i){var a=e.info,s=new t(n,r,i),o=g(e.mmr,a.width,a.height,e.template,e.prediction,null,e.at,s);this.drawBitmap(a,o)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(e,n,s,o,l,h){e.huffman&&c("JBIG2 error: huffman is not supported");var f=this.symbols;f||(this.symbols=f={});for(var u=[],d=0,p=s.length;d<p;d++)u=u.concat(f[s[d]]);var m=new t(o,l,h);f[n]=function(e,t,n,s,o,l,h,f,u,d,p){e&&c("JBIG2 error: huffman is not supported");for(var m=[],_=0,w=a(n.length+s),y=p.decoder,x=p.contextCache;m.length<s;){_+=r(x,"IADH",y);for(var k=0;;){var C,A=r(x,"IADW",y);if(null===A)break;if(k+=A,t){var z=r(x,"IAAI",y);if(z>1)C=v(e,t,k,_,0,z,1,n.concat(m),w,0,0,1,0,0,u,d,p);else{var S=i(x,y,w),I=r(x,"IARDX",y),P=r(x,"IARDY",y);C=b(k,_,u,S<n.length?n[S]:m[S-n.length],I,P,!1,d,p)}}else C=g(!1,k,_,h,!1,null,f,p);m.push(C)}}for(var T=[],O=[],E=!1,M=n.length+s;O.length<M;){for(var B=r(x,"IAEX",y);B--;)O.push(E);E=!E}for(var D=0,L=n.length;D<L;D++)O[D]&&T.push(n[D]);for(var U=0;U<s;D++,U++)O[D]&&T.push(m[U]);return T}(e.huffman,e.refinement,u,e.numberOfNewSymbols,e.numberOfExportedSymbols,0,e.template,e.at,e.refinementTemplate,e.refinementAt,m)},onImmediateTextRegion:function(e,n,r,i,s){for(var o=e.info,l=this.symbols,h=[],c=0,f=n.length;c<f;c++)h=h.concat(l[n[c]]);var u=a(h.length),d=new t(r,i,s),p=v(e.huffman,e.refinement,o.width,o.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,h,u,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,0,e.refinementTemplate,e.refinementAt,d);this.drawBitmap(o,p)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,arguments)}},z.prototype={parseChunks:function(e){return function(e){for(var t=new A,n=0,r=e.length;n<r;n++){var i=e[n];C(w({},i.data,i.start,i.end),t)}return t}(e)}},z}();function a(e){for(var t=1,n=0;e>t;)t<<=1,n++;return n}function s(e,t){return e[t]<<24>>24}function o(e,t){return e[t]<<8|e[t+1]}function l(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function h(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}var c=function(){throw console.error.apply(console,arguments),new Error("PDFJS error: "+arguments[0])},f=function(){console.warn.apply(console,arguments)},u=function(){console.info.apply(console,arguments)};i.prototype.parse=function(e){var t=0,n=e.length;151===e[t]&&74===e[t+1]&&66===e[t+2]&&50===e[t+3]&&13===e[t+4]&&10===e[t+5]&&26===e[t+6]&&10===e[t+7]||c("JBIG2 error: invalid header");var r={};t+=8;var i=e[t++];r.randomAccess=!(1&i),2&i||(r.numberOfPages=l(e,t),t+=4);for(var a=this.parseChunks([{data:e,start:t,end:n}]),s=a.currentPageInfo.width,o=a.currentPageInfo.height,h=a.buffer,f=(e=new Uint8Array(s*o),0),u=0,d=0;d<o;d++)for(var p,m=0,g=0;g<s;g++)m||(m=128,p=h[u++]),e[f++]=p&m?0:255,m>>=1;this.width=s,this.height=o,this.data=e},e.JpegImage=t,e.JpxImage=r,e.Jbig2Image=i}(r||(r={}));var a=r.JpegImage,s=r.JpxImage,o=r.Jbig2Image;e.exports={JpegImage:i,JpegDecoder:a,JpxDecoder:s,Jbig2Decoder:o}},function(e,t,n){n(0),n(22),n(25),n(26),n(23),e.exports=n(24)},function(e,t,n){"use strict";var r=n(15),i=n(2),a=n(9),s=n(6),o=n(10),l=Object.prototype.toString,h=0,c=-1,f=0,u=8;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({level:c,method:u,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h)throw new Error(s[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,p))!==h)throw new Error(s[n]);this._dict_set=!0}}function p(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}d.prototype.push=function(e,t){var n,s,o=this.strm,c=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?o.input=a.string2buf(e):"[object ArrayBuffer]"===l.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new i.Buf8(c),o.next_out=0,o.avail_out=c),1!==(n=r.deflate(o,s))&&n!==h)return this.onEnd(n),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(o.output,o.next_out))):this.onData(i.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==n);return 4===s?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===h):2!==s||(this.onEnd(h),o.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===h&&("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},t.Deflate=d,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,n){"use strict";var r,i=n(2),a=n(16),s=n(7),o=n(8),l=n(6),h=0,c=1,f=3,u=4,d=5,p=0,m=1,g=-2,b=-3,v=-5,_=-1,w=1,y=2,x=3,k=4,C=0,A=2,z=8,S=9,I=15,P=8,T=286,O=30,E=19,M=2*T+1,B=15,D=3,L=258,U=L+D+1,F=32,R=42,N=69,Z=73,H=91,q=103,J=113,X=666,j=1,Y=2,G=3,V=4,$=3;function K(e,t){return e.msg=l[t],t}function W(e){return(e<<1)-(e>4?9:0)}function Q(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function te(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function ne(e,t){e.pending_buf[e.pending++]=t}function re(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ie(e,t){var n,r,i=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-U?e.strstart-(e.w_size-U):0,h=e.window,c=e.w_mask,f=e.prev,u=e.strstart+L,d=h[a+s-1],p=h[a+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(h[(n=t)+s]===p&&h[n+s-1]===d&&h[n]===h[a]&&h[++n]===h[a+1]){a+=2,n++;do{}while(h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&a<u);if(r=L-(u-a),a=u-L,r>s){if(e.match_start=t,s=r,r>=o)break;d=h[a+s-1],p=h[a+s]}}}while((t=f[t&c])>l&&0!=--i);return s<=e.lookahead?s:e.lookahead}function ae(e){var t,n,r,a,l,h,c,f,u,d,p=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-U)){i.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=p?r-p:0}while(--n);t=n=p;do{r=e.prev[--t],e.prev[t]=r>=p?r-p:0}while(--n);a+=p}if(0===e.strm.avail_in)break;if(h=e.strm,c=e.window,f=e.strstart+e.lookahead,u=a,d=void 0,(d=h.avail_in)>u&&(d=u),n=0===d?0:(h.avail_in-=d,i.arraySet(c,h.input,h.next_in,d,f),1===h.state.wrap?h.adler=s(h.adler,c,d,f):2===h.state.wrap&&(h.adler=o(h.adler,c,d,f)),h.next_in+=d,h.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=D)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+D-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<D)););}while(e.lookahead<U&&0!==e.strm.avail_in)}function se(e,t){for(var n,r;;){if(e.lookahead<U){if(ae(e),e.lookahead<U&&t===h)return j;if(0===e.lookahead)break}if(n=0,e.lookahead>=D&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-U&&(e.match_length=ie(e,n)),e.match_length>=D)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-D),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=D){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(te(e,!1),0===e.strm.avail_out))return j}return e.insert=e.strstart<D-1?e.strstart:D-1,t===u?(te(e,!0),0===e.strm.avail_out?G:V):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?j:Y}function oe(e,t){for(var n,r,i;;){if(e.lookahead<U){if(ae(e),e.lookahead<U&&t===h)return j;if(0===e.lookahead)break}if(n=0,e.lookahead>=D&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=D-1,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-U&&(e.match_length=ie(e,n),e.match_length<=5&&(e.strategy===w||e.match_length===D&&e.strstart-e.match_start>4096)&&(e.match_length=D-1)),e.prev_length>=D&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-D,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-D),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=D-1,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return j}else if(e.match_available){if((r=a._tr_tally(e,0,e.window[e.strstart-1]))&&te(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return j}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<D-1?e.strstart:D-1,t===u?(te(e,!0),0===e.strm.avail_out?G:V):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?j:Y}function le(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function he(){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=z,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*M),this.dyn_dtree=new i.Buf16(2*(2*O+1)),this.bl_tree=new i.Buf16(2*(2*E+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(B+1),this.heap=new i.Buf16(2*T+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*T+1),Q(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 ce(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=A,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?R:J,e.adler=2===t.wrap?0:1,t.last_flush=h,a._tr_init(t),p):K(e,g)}function fe(e){var t,n=ce(e);return n===p&&((t=e.state).window_size=2*t.w_size,Q(t.head),t.max_lazy_match=r[t.level].max_lazy,t.good_match=r[t.level].good_length,t.nice_match=r[t.level].nice_length,t.max_chain_length=r[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=D-1,t.match_available=0,t.ins_h=0),n}function ue(e,t,n,r,a,s){if(!e)return g;var o=1;if(t===_&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),a<1||a>S||n!==z||r<8||r>15||t<0||t>9||s<0||s>k)return K(e,g);8===r&&(r=9);var l=new he;return e.state=l,l.strm=e,l.wrap=o,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+D-1)/D),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=s,l.method=n,fe(e)}r=[new le(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ae(e),0===e.lookahead&&t===h)return j;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,te(e,!1),0===e.strm.avail_out))return j;if(e.strstart-e.block_start>=e.w_size-U&&(te(e,!1),0===e.strm.avail_out))return j}return e.insert=0,t===u?(te(e,!0),0===e.strm.avail_out?G:V):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),j)}),new le(4,4,8,4,se),new le(4,5,16,8,se),new le(4,6,32,32,se),new le(4,4,16,16,oe),new le(8,16,32,32,oe),new le(8,16,128,128,oe),new le(8,32,128,256,oe),new le(32,128,258,1024,oe),new le(32,258,258,4096,oe)],t.deflateInit=function(e,t){return ue(e,t,z,I,P,C)},t.deflateInit2=ue,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,p):g},t.deflate=function(e,t){var n,i,s,l;if(!e||!e.state||t>d||t<0)return e?K(e,g):g;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===X&&t!==u)return K(e,0===e.avail_out?v:g);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===R)if(2===i.wrap)e.adler=0,ne(i,31),ne(i,139),ne(i,8),i.gzhead?(ne(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ne(i,255&i.gzhead.time),ne(i,i.gzhead.time>>8&255),ne(i,i.gzhead.time>>16&255),ne(i,i.gzhead.time>>24&255),ne(i,9===i.level?2:i.strategy>=y||i.level<2?4:0),ne(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(ne(i,255&i.gzhead.extra.length),ne(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=o(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=N):(ne(i,0),ne(i,0),ne(i,0),ne(i,0),ne(i,0),ne(i,9===i.level?2:i.strategy>=y||i.level<2?4:0),ne(i,$),i.status=J);else{var b=z+(i.w_bits-8<<4)<<8;b|=(i.strategy>=y||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(b|=F),b+=31-b%31,i.status=J,re(i,b),0!==i.strstart&&(re(i,e.adler>>>16),re(i,65535&e.adler)),e.adler=1}if(i.status===N)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending!==i.pending_buf_size));)ne(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Z)}else i.status=Z;if(i.status===Z)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,ne(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),0===l&&(i.gzindex=0,i.status=H)}else i.status=H;if(i.status===H)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,ne(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),0===l&&(i.status=q)}else i.status=q;if(i.status===q&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ee(e),i.pending+2<=i.pending_buf_size&&(ne(i,255&e.adler),ne(i,e.adler>>8&255),e.adler=0,i.status=J)):i.status=J),0!==i.pending){if(ee(e),0===e.avail_out)return i.last_flush=-1,p}else if(0===e.avail_in&&W(t)<=W(n)&&t!==u)return K(e,v);if(i.status===X&&0!==e.avail_in)return K(e,v);if(0!==e.avail_in||0!==i.lookahead||t!==h&&i.status!==X){var _=i.strategy===y?function(e,t){for(var n;;){if(0===e.lookahead&&(ae(e),0===e.lookahead)){if(t===h)return j;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(te(e,!1),0===e.strm.avail_out))return j}return e.insert=0,t===u?(te(e,!0),0===e.strm.avail_out?G:V):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?j:Y}(i,t):i.strategy===x?function(e,t){for(var n,r,i,s,o=e.window;;){if(e.lookahead<=L){if(ae(e),e.lookahead<=L&&t===h)return j;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=D&&e.strstart>0&&(r=o[i=e.strstart-1])===o[++i]&&r===o[++i]&&r===o[++i]){s=e.strstart+L;do{}while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<s);e.match_length=L-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=D?(n=a._tr_tally(e,1,e.match_length-D),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(te(e,!1),0===e.strm.avail_out))return j}return e.insert=0,t===u?(te(e,!0),0===e.strm.avail_out?G:V):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?j:Y}(i,t):r[i.level].func(i,t);if(_!==G&&_!==V||(i.status=X),_===j||_===G)return 0===e.avail_out&&(i.last_flush=-1),p;if(_===Y&&(t===c?a._tr_align(i):t!==d&&(a._tr_stored_block(i,0,0,!1),t===f&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ee(e),0===e.avail_out))return i.last_flush=-1,p}return t!==u?p:i.wrap<=0?m:(2===i.wrap?(ne(i,255&e.adler),ne(i,e.adler>>8&255),ne(i,e.adler>>16&255),ne(i,e.adler>>24&255),ne(i,255&e.total_in),ne(i,e.total_in>>8&255),ne(i,e.total_in>>16&255),ne(i,e.total_in>>24&255)):(re(i,e.adler>>>16),re(i,65535&e.adler)),ee(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==R&&t!==N&&t!==Z&&t!==H&&t!==q&&t!==J&&t!==X?K(e,g):(e.state=null,t===J?K(e,b):p):g},t.deflateSetDictionary=function(e,t){var n,r,a,o,l,h,c,f,u=t.length;if(!e||!e.state)return g;if(2===(o=(n=e.state).wrap)||1===o&&n.status!==R||n.lookahead)return g;for(1===o&&(e.adler=s(e.adler,t,u,0)),n.wrap=0,u>=n.w_size&&(0===o&&(Q(n.head),n.strstart=0,n.block_start=0,n.insert=0),f=new i.Buf8(n.w_size),i.arraySet(f,t,u-n.w_size,n.w_size,0),t=f,u=n.w_size),l=e.avail_in,h=e.next_in,c=e.input,e.avail_in=u,e.next_in=0,e.input=t,ae(n);n.lookahead>=D;){r=n.strstart,a=n.lookahead-(D-1);do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+D-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++}while(--a);n.strstart=r,n.lookahead=D-1,ae(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=D-1,n.match_available=0,e.next_in=h,e.input=c,e.avail_in=l,n.wrap=o,p},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,n){"use strict";var r=n(2),i=4,a=0,s=1,o=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var h=0,c=1,f=2,u=29,d=256,p=d+1+u,m=30,g=19,b=2*p+1,v=15,_=16,w=7,y=256,x=16,k=17,C=18,A=[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],z=[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],S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=new Array(2*(p+2));l(P);var T=new Array(2*m);l(T);var O=new Array(512);l(O);var E=new Array(256);l(E);var M=new Array(u);l(M);var B,D,L,U=new Array(m);function F(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function R(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function N(e){return e<256?O[e]:O[256+(e>>>7)]}function Z(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function H(e,t,n){e.bi_valid>_-n?(e.bi_buf|=t<<e.bi_valid&65535,Z(e,e.bi_buf),e.bi_buf=t>>_-e.bi_valid,e.bi_valid+=n-_):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function q(e,t,n){H(e,n[2*t],n[2*t+1])}function J(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function X(e,t,n){var r,i,a=new Array(v+1),s=0;for(r=1;r<=v;r++)a[r]=s=s+n[r-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=J(a[o]++,o))}}function j(e){var t;for(t=0;t<p;t++)e.dyn_ltree[2*t]=0;for(t=0;t<m;t++)e.dyn_dtree[2*t]=0;for(t=0;t<g;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*y]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Y(e){e.bi_valid>8?Z(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function G(e,t,n,r){var i=2*t,a=2*n;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function V(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&G(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!G(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function $(e,t,n){var r,i,a,s,o=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],i=e.pending_buf[e.l_buf+o],o++,0===r?q(e,i,t):(q(e,(a=E[i])+d+1,t),0!==(s=A[a])&&H(e,i-=M[a],s),q(e,a=N(--r),n),0!==(s=z[a])&&H(e,r-=U[a],s))}while(o<e.last_lit);q(e,y,t)}function K(e,t){var n,r,i,a=t.dyn_tree,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.elems,h=-1;for(e.heap_len=0,e.heap_max=b,n=0;n<l;n++)0!==a[2*n]?(e.heap[++e.heap_len]=h=n,e.depth[n]=0):a[2*n+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=h<2?++h:0)]=1,e.depth[i]=0,e.opt_len--,o&&(e.static_len-=s[2*i+1]);for(t.max_code=h,n=e.heap_len>>1;n>=1;n--)V(e,a,n);i=l;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,V(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,s,o,l=t.dyn_tree,h=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<b;n++)(a=l[2*l[2*(r=e.heap[n])+1]+1]+1)>p&&(a=p,m++),l[2*r+1]=a,r>h||(e.bl_count[a]++,s=0,r>=d&&(s=u[r-d]),o=l[2*r],e.opt_len+=o*(a+s),f&&(e.static_len+=o*(c[2*r+1]+s)));if(0!==m){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(r=e.bl_count[a];0!==r;)(i=e.heap[--n])>h||(l[2*i+1]!==a&&(e.opt_len+=(a-l[2*i+1])*l[2*i],l[2*i+1]=a),r--)}}(e,t),X(a,h,e.bl_count)}function W(e,t,n){var r,i,a=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=s,s=t[2*(r+1)+1],++o<l&&i===s||(o<h?e.bl_tree[2*i]+=o:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*x]++):o<=10?e.bl_tree[2*k]++:e.bl_tree[2*C]++,o=0,a=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4))}function Q(e,t,n){var r,i,a=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),r=0;r<=n;r++)if(i=s,s=t[2*(r+1)+1],!(++o<l&&i===s)){if(o<h)do{q(e,i,e.bl_tree)}while(0!=--o);else 0!==i?(i!==a&&(q(e,i,e.bl_tree),o--),q(e,x,e.bl_tree),H(e,o-3,2)):o<=10?(q(e,k,e.bl_tree),H(e,o-3,3)):(q(e,C,e.bl_tree),H(e,o-11,7));o=0,a=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}}l(U);var ee=!1;function te(e,t,n,i){H(e,(h<<1)+(i?1:0),3),function(e,t,n,i){Y(e),i&&(Z(e,n),Z(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}t._tr_init=function(e){ee||(function(){var e,t,n,r,i,a=new Array(v+1);for(n=0,r=0;r<u-1;r++)for(M[r]=n,e=0;e<1<<A[r];e++)E[n++]=r;for(E[n-1]=r,i=0,r=0;r<16;r++)for(U[r]=i,e=0;e<1<<z[r];e++)O[i++]=r;for(i>>=7;r<m;r++)for(U[r]=i<<7,e=0;e<1<<z[r]-7;e++)O[256+i++]=r;for(t=0;t<=v;t++)a[t]=0;for(e=0;e<=143;)P[2*e+1]=8,e++,a[8]++;for(;e<=255;)P[2*e+1]=9,e++,a[9]++;for(;e<=279;)P[2*e+1]=7,e++,a[7]++;for(;e<=287;)P[2*e+1]=8,e++,a[8]++;for(X(P,p+1,a),e=0;e<m;e++)T[2*e+1]=5,T[2*e]=J(e,5);B=new F(P,A,d+1,p,v),D=new F(T,z,0,m,v),L=new F(new Array(0),S,0,g,w)}(),ee=!0),e.l_desc=new R(e.dyn_ltree,B),e.d_desc=new R(e.dyn_dtree,D),e.bl_desc=new R(e.bl_tree,L),e.bi_buf=0,e.bi_valid=0,j(e)},t._tr_stored_block=te,t._tr_flush_block=function(e,t,n,r){var l,h,u=0;e.level>0?(e.strm.data_type===o&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return a;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return s;for(t=32;t<d;t++)if(0!==e.dyn_ltree[2*t])return s;return a}(e)),K(e,e.l_desc),K(e,e.d_desc),u=function(e){var t;for(W(e,e.dyn_ltree,e.l_desc.max_code),W(e,e.dyn_dtree,e.d_desc.max_code),K(e,e.bl_desc),t=g-1;t>=3&&0===e.bl_tree[2*I[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(h=e.static_len+3+7>>>3)<=l&&(l=h)):l=h=n+5,n+4<=l&&-1!==t?te(e,t,n,r):e.strategy===i||h===l?(H(e,(c<<1)+(r?1:0),3),$(e,P,T)):(H(e,(f<<1)+(r?1:0),3),function(e,t,n,r){var i;for(H(e,t-257,5),H(e,n-1,5),H(e,r-4,4),i=0;i<r;i++)H(e,e.bl_tree[2*I[i]+1],3);Q(e,e.dyn_ltree,t-1),Q(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),$(e,e.dyn_ltree,e.dyn_dtree)),j(e),r&&Y(e)},t._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(E[n]+d+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){H(e,c<<1,3),q(e,y,P),function(e){16===e.bi_valid?(Z(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,n){"use strict";var r=n(18),i=n(2),a=n(9),s=n(11),o=n(6),l=n(10),h=n(21),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(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 n=r.inflateInit2(this.strm,t.windowBits);if(n!==s.Z_OK)throw new Error(o[n]);if(this.header=new h,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(o[n])}function u(e,t){var n=new f(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}f.prototype.push=function(e,t){var n,o,l,h,f,u=this.strm,d=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?u.input=a.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?u.input=new Uint8Array(e):u.input=e,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new i.Buf8(d),u.next_out=0,u.avail_out=d),(n=r.inflate(u,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(n=r.inflateSetDictionary(this.strm,p)),n===s.Z_BUF_ERROR&&!0===m&&(n=s.Z_OK,m=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;u.next_out&&(0!==u.avail_out&&n!==s.Z_STREAM_END&&(0!==u.avail_in||o!==s.Z_FINISH&&o!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=a.utf8border(u.output,u.next_out),h=u.next_out-l,f=a.buf2string(u.output,l),u.next_out=h,u.avail_out=d-h,h&&i.arraySet(u.output,u.output,l,h,0),this.onData(f)):this.onData(i.shrinkBuf(u.output,u.next_out)))),0===u.avail_in&&0===u.avail_out&&(m=!0)}while((u.avail_in>0||0===u.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(o=s.Z_FINISH),o===s.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):o!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),u.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===s.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},t.Inflate=f,t.inflate=u,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,u(e,t)},t.ungzip=u},function(e,t,n){"use strict";var r=n(2),i=n(7),a=n(8),s=n(19),o=n(20),l=0,h=1,c=2,f=4,u=5,d=6,p=0,m=1,g=2,b=-2,v=-3,_=-4,w=-5,y=8,x=1,k=2,C=3,A=4,z=5,S=6,I=7,P=8,T=9,O=10,E=11,M=12,B=13,D=14,L=15,U=16,F=17,R=18,N=19,Z=20,H=21,q=22,J=23,X=24,j=25,Y=26,G=27,V=28,$=29,K=30,W=31,Q=32,ee=852,te=592,ne=15;function re(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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ae(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=x,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(ee),t.distcode=t.distdyn=new r.Buf32(te),t.sane=1,t.back=-1,p):b}function se(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ae(e)):b}function oe(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?b:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,se(e))):b}function le(e,t){var n,r;return e?(r=new ie,e.state=r,r.window=null,(n=oe(e,t))!==p&&(e.state=null),n):b}var he,ce,fe=!0;function ue(e){if(fe){var t;for(he=new r.Buf32(512),ce=new r.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(o(h,e.lens,0,288,he,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=he,e.lenbits=9,e.distcode=ce,e.distbits=5}function de(e,t,n,i){var a,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new r.Buf8(s.wsize)),i>=s.wsize?(r.arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((a=s.wsize-s.wnext)>i&&(a=i),r.arraySet(s.window,t,n-i,a,s.wnext),(i-=a)?(r.arraySet(s.window,t,n-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0}t.inflateReset=se,t.inflateReset2=oe,t.inflateResetKeep=ae,t.inflateInit=function(e){return le(e,ne)},t.inflateInit2=le,t.inflate=function(e,t){var n,ee,te,ne,ie,ae,se,oe,le,he,ce,fe,pe,me,ge,be,ve,_e,we,ye,xe,ke,Ce,Ae,ze=0,Se=new r.Buf8(4),Ie=[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 b;(n=e.state).mode===M&&(n.mode=B),ie=e.next_out,te=e.output,se=e.avail_out,ne=e.next_in,ee=e.input,ae=e.avail_in,oe=n.hold,le=n.bits,he=ae,ce=se,ke=p;e:for(;;)switch(n.mode){case x:if(0===n.wrap){n.mode=B;break}for(;le<16;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(2&n.wrap&&35615===oe){n.check=0,Se[0]=255&oe,Se[1]=oe>>>8&255,n.check=a(n.check,Se,2,0),oe=0,le=0,n.mode=k;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&oe)<<8)+(oe>>8))%31){e.msg="incorrect header check",n.mode=K;break}if((15&oe)!==y){e.msg="unknown compression method",n.mode=K;break}if(le-=4,xe=8+(15&(oe>>>=4)),0===n.wbits)n.wbits=xe;else if(xe>n.wbits){e.msg="invalid window size",n.mode=K;break}n.dmax=1<<xe,e.adler=n.check=1,n.mode=512&oe?O:M,oe=0,le=0;break;case k:for(;le<16;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(n.flags=oe,(255&n.flags)!==y){e.msg="unknown compression method",n.mode=K;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=K;break}n.head&&(n.head.text=oe>>8&1),512&n.flags&&(Se[0]=255&oe,Se[1]=oe>>>8&255,n.check=a(n.check,Se,2,0)),oe=0,le=0,n.mode=C;case C:for(;le<32;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}n.head&&(n.head.time=oe),512&n.flags&&(Se[0]=255&oe,Se[1]=oe>>>8&255,Se[2]=oe>>>16&255,Se[3]=oe>>>24&255,n.check=a(n.check,Se,4,0)),oe=0,le=0,n.mode=A;case A:for(;le<16;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}n.head&&(n.head.xflags=255&oe,n.head.os=oe>>8),512&n.flags&&(Se[0]=255&oe,Se[1]=oe>>>8&255,n.check=a(n.check,Se,2,0)),oe=0,le=0,n.mode=z;case z:if(1024&n.flags){for(;le<16;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}n.length=oe,n.head&&(n.head.extra_len=oe),512&n.flags&&(Se[0]=255&oe,Se[1]=oe>>>8&255,n.check=a(n.check,Se,2,0)),oe=0,le=0}else n.head&&(n.head.extra=null);n.mode=S;case S:if(1024&n.flags&&((fe=n.length)>ae&&(fe=ae),fe&&(n.head&&(xe=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,ee,ne,fe,xe)),512&n.flags&&(n.check=a(n.check,ee,fe,ne)),ae-=fe,ne+=fe,n.length-=fe),n.length))break e;n.length=0,n.mode=I;case I:if(2048&n.flags){if(0===ae)break e;fe=0;do{xe=ee[ne+fe++],n.head&&xe&&n.length<65536&&(n.head.name+=String.fromCharCode(xe))}while(xe&&fe<ae);if(512&n.flags&&(n.check=a(n.check,ee,fe,ne)),ae-=fe,ne+=fe,xe)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=P;case P:if(4096&n.flags){if(0===ae)break e;fe=0;do{xe=ee[ne+fe++],n.head&&xe&&n.length<65536&&(n.head.comment+=String.fromCharCode(xe))}while(xe&&fe<ae);if(512&n.flags&&(n.check=a(n.check,ee,fe,ne)),ae-=fe,ne+=fe,xe)break e}else n.head&&(n.head.comment=null);n.mode=T;case T:if(512&n.flags){for(;le<16;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(oe!==(65535&n.check)){e.msg="header crc mismatch",n.mode=K;break}oe=0,le=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=M;break;case O:for(;le<32;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}e.adler=n.check=re(oe),oe=0,le=0,n.mode=E;case E:if(0===n.havedict)return e.next_out=ie,e.avail_out=se,e.next_in=ne,e.avail_in=ae,n.hold=oe,n.bits=le,g;e.adler=n.check=1,n.mode=M;case M:if(t===u||t===d)break e;case B:if(n.last){oe>>>=7&le,le-=7&le,n.mode=G;break}for(;le<3;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}switch(n.last=1&oe,le-=1,3&(oe>>>=1)){case 0:n.mode=D;break;case 1:if(ue(n),n.mode=Z,t===d){oe>>>=2,le-=2;break e}break;case 2:n.mode=F;break;case 3:e.msg="invalid block type",n.mode=K}oe>>>=2,le-=2;break;case D:for(oe>>>=7&le,le-=7&le;le<32;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if((65535&oe)!=(oe>>>16^65535)){e.msg="invalid stored block lengths",n.mode=K;break}if(n.length=65535&oe,oe=0,le=0,n.mode=L,t===d)break e;case L:n.mode=U;case U:if(fe=n.length){if(fe>ae&&(fe=ae),fe>se&&(fe=se),0===fe)break e;r.arraySet(te,ee,ne,fe,ie),ae-=fe,ne+=fe,se-=fe,ie+=fe,n.length-=fe;break}n.mode=M;break;case F:for(;le<14;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(n.nlen=257+(31&oe),oe>>>=5,le-=5,n.ndist=1+(31&oe),oe>>>=5,le-=5,n.ncode=4+(15&oe),oe>>>=4,le-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=K;break}n.have=0,n.mode=R;case R:for(;n.have<n.ncode;){for(;le<3;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}n.lens[Ie[n.have++]]=7&oe,oe>>>=3,le-=3}for(;n.have<19;)n.lens[Ie[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ce={bits:n.lenbits},ke=o(l,n.lens,0,19,n.lencode,0,n.work,Ce),n.lenbits=Ce.bits,ke){e.msg="invalid code lengths set",n.mode=K;break}n.have=0,n.mode=N;case N:for(;n.have<n.nlen+n.ndist;){for(;be=(ze=n.lencode[oe&(1<<n.lenbits)-1])>>>16&255,ve=65535&ze,!((ge=ze>>>24)<=le);){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(ve<16)oe>>>=ge,le-=ge,n.lens[n.have++]=ve;else{if(16===ve){for(Ae=ge+2;le<Ae;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(oe>>>=ge,le-=ge,0===n.have){e.msg="invalid bit length repeat",n.mode=K;break}xe=n.lens[n.have-1],fe=3+(3&oe),oe>>>=2,le-=2}else if(17===ve){for(Ae=ge+3;le<Ae;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}le-=ge,xe=0,fe=3+(7&(oe>>>=ge)),oe>>>=3,le-=3}else{for(Ae=ge+7;le<Ae;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}le-=ge,xe=0,fe=11+(127&(oe>>>=ge)),oe>>>=7,le-=7}if(n.have+fe>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=K;break}for(;fe--;)n.lens[n.have++]=xe}}if(n.mode===K)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=K;break}if(n.lenbits=9,Ce={bits:n.lenbits},ke=o(h,n.lens,0,n.nlen,n.lencode,0,n.work,Ce),n.lenbits=Ce.bits,ke){e.msg="invalid literal/lengths set",n.mode=K;break}if(n.distbits=6,n.distcode=n.distdyn,Ce={bits:n.distbits},ke=o(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ce),n.distbits=Ce.bits,ke){e.msg="invalid distances set",n.mode=K;break}if(n.mode=Z,t===d)break e;case Z:n.mode=H;case H:if(ae>=6&&se>=258){e.next_out=ie,e.avail_out=se,e.next_in=ne,e.avail_in=ae,n.hold=oe,n.bits=le,s(e,ce),ie=e.next_out,te=e.output,se=e.avail_out,ne=e.next_in,ee=e.input,ae=e.avail_in,oe=n.hold,le=n.bits,n.mode===M&&(n.back=-1);break}for(n.back=0;be=(ze=n.lencode[oe&(1<<n.lenbits)-1])>>>16&255,ve=65535&ze,!((ge=ze>>>24)<=le);){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(be&&0==(240&be)){for(_e=ge,we=be,ye=ve;be=(ze=n.lencode[ye+((oe&(1<<_e+we)-1)>>_e)])>>>16&255,ve=65535&ze,!(_e+(ge=ze>>>24)<=le);){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}oe>>>=_e,le-=_e,n.back+=_e}if(oe>>>=ge,le-=ge,n.back+=ge,n.length=ve,0===be){n.mode=Y;break}if(32&be){n.back=-1,n.mode=M;break}if(64&be){e.msg="invalid literal/length code",n.mode=K;break}n.extra=15&be,n.mode=q;case q:if(n.extra){for(Ae=n.extra;le<Ae;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}n.length+=oe&(1<<n.extra)-1,oe>>>=n.extra,le-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=J;case J:for(;be=(ze=n.distcode[oe&(1<<n.distbits)-1])>>>16&255,ve=65535&ze,!((ge=ze>>>24)<=le);){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(0==(240&be)){for(_e=ge,we=be,ye=ve;be=(ze=n.distcode[ye+((oe&(1<<_e+we)-1)>>_e)])>>>16&255,ve=65535&ze,!(_e+(ge=ze>>>24)<=le);){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}oe>>>=_e,le-=_e,n.back+=_e}if(oe>>>=ge,le-=ge,n.back+=ge,64&be){e.msg="invalid distance code",n.mode=K;break}n.offset=ve,n.extra=15&be,n.mode=X;case X:if(n.extra){for(Ae=n.extra;le<Ae;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}n.offset+=oe&(1<<n.extra)-1,oe>>>=n.extra,le-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=K;break}n.mode=j;case j:if(0===se)break e;if(fe=ce-se,n.offset>fe){if((fe=n.offset-fe)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=K;break}fe>n.wnext?(fe-=n.wnext,pe=n.wsize-fe):pe=n.wnext-fe,fe>n.length&&(fe=n.length),me=n.window}else me=te,pe=ie-n.offset,fe=n.length;fe>se&&(fe=se),se-=fe,n.length-=fe;do{te[ie++]=me[pe++]}while(--fe);0===n.length&&(n.mode=H);break;case Y:if(0===se)break e;te[ie++]=n.length,se--,n.mode=H;break;case G:if(n.wrap){for(;le<32;){if(0===ae)break e;ae--,oe|=ee[ne++]<<le,le+=8}if(ce-=se,e.total_out+=ce,n.total+=ce,ce&&(e.adler=n.check=n.flags?a(n.check,te,ce,ie-ce):i(n.check,te,ce,ie-ce)),ce=se,(n.flags?oe:re(oe))!==n.check){e.msg="incorrect data check",n.mode=K;break}oe=0,le=0}n.mode=V;case V:if(n.wrap&&n.flags){for(;le<32;){if(0===ae)break e;ae--,oe+=ee[ne++]<<le,le+=8}if(oe!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=K;break}oe=0,le=0}n.mode=$;case $:ke=m;break e;case K:ke=v;break e;case W:return _;case Q:default:return b}return e.next_out=ie,e.avail_out=se,e.next_in=ne,e.avail_in=ae,n.hold=oe,n.bits=le,(n.wsize||ce!==e.avail_out&&n.mode<K&&(n.mode<G||t!==f))&&de(e,e.output,e.next_out,ce-e.avail_out)?(n.mode=W,_):(he-=e.avail_in,ce-=e.avail_out,e.total_in+=he,e.total_out+=ce,n.total+=ce,n.wrap&&ce&&(e.adler=n.check=n.flags?a(n.check,te,ce,e.next_out-ce):i(n.check,te,ce,e.next_out-ce)),e.data_type=n.bits+(n.last?64:0)+(n.mode===M?128:0)+(n.mode===Z||n.mode===L?256:0),(0===he&&0===ce||t===f)&&ke===p&&(ke=w),ke)},t.inflateEnd=function(e){if(!e||!e.state)return b;var t=e.state;return t.window&&(t.window=null),e.state=null,p},t.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?b:(n.head=t,t.done=!1,p):b},t.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&n.mode!==E?b:n.mode===E&&i(1,t,r,0)!==n.check?v:de(e,t,r,r)?(n.mode=W,_):(n.havedict=1,p):b},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,a,s,o,l,h,c,f,u,d,p,m,g,b,v,_,w,y,x,k,C,A,z;n=e.state,r=e.next_in,A=e.input,i=r+(e.avail_in-5),a=e.next_out,z=e.output,s=a-(t-e.avail_out),o=a+(e.avail_out-257),l=n.dmax,h=n.wsize,c=n.whave,f=n.wnext,u=n.window,d=n.hold,p=n.bits,m=n.lencode,g=n.distcode,b=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{p<15&&(d+=A[r++]<<p,p+=8,d+=A[r++]<<p,p+=8),_=m[d&b];t:for(;;){if(d>>>=w=_>>>24,p-=w,0===(w=_>>>16&255))z[a++]=65535&_;else{if(!(16&w)){if(0==(64&w)){_=m[(65535&_)+(d&(1<<w)-1)];continue t}if(32&w){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}y=65535&_,(w&=15)&&(p<w&&(d+=A[r++]<<p,p+=8),y+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=A[r++]<<p,p+=8,d+=A[r++]<<p,p+=8),_=g[d&v];n:for(;;){if(d>>>=w=_>>>24,p-=w,!(16&(w=_>>>16&255))){if(0==(64&w)){_=g[(65535&_)+(d&(1<<w)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(x=65535&_,p<(w&=15)&&(d+=A[r++]<<p,(p+=8)<w&&(d+=A[r++]<<p,p+=8)),(x+=d&(1<<w)-1)>l){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=w,p-=w,x>(w=a-s)){if((w=x-w)>c&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(k=0,C=u,0===f){if(k+=h-w,w<y){y-=w;do{z[a++]=u[k++]}while(--w);k=a-x,C=z}}else if(f<w){if(k+=h+f-w,(w-=f)<y){y-=w;do{z[a++]=u[k++]}while(--w);if(k=0,f<y){y-=w=f;do{z[a++]=u[k++]}while(--w);k=a-x,C=z}}}else if(k+=f-w,w<y){y-=w;do{z[a++]=u[k++]}while(--w);k=a-x,C=z}for(;y>2;)z[a++]=C[k++],z[a++]=C[k++],z[a++]=C[k++],y-=3;y&&(z[a++]=C[k++],y>1&&(z[a++]=C[k++]))}else{k=a-x;do{z[a++]=z[k++],z[a++]=z[k++],z[a++]=z[k++],y-=3}while(y>2);y&&(z[a++]=z[k++],y>1&&(z[a++]=z[k++]))}break}}break}}while(r<i&&a<o);r-=y=p>>3,d&=(1<<(p-=y<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=a<o?o-a+257:257-(a-o),n.hold=d,n.bits=p}},function(e,t,n){"use strict";var r=n(2),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],a=[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],s=[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],o=[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(e,t,n,l,h,c,f,u){var d,p,m,g,b,v,_,w,y,x=u.bits,k=0,C=0,A=0,z=0,S=0,I=0,P=0,T=0,O=0,E=0,M=null,B=0,D=new r.Buf16(16),L=new r.Buf16(16),U=null,F=0;for(k=0;k<=15;k++)D[k]=0;for(C=0;C<l;C++)D[t[n+C]]++;for(S=x,z=15;z>=1&&0===D[z];z--);if(S>z&&(S=z),0===z)return h[c++]=20971520,h[c++]=20971520,u.bits=1,0;for(A=1;A<z&&0===D[A];A++);for(S<A&&(S=A),T=1,k=1;k<=15;k++)if(T<<=1,(T-=D[k])<0)return-1;if(T>0&&(0===e||1!==z))return-1;for(L[1]=0,k=1;k<15;k++)L[k+1]=L[k]+D[k];for(C=0;C<l;C++)0!==t[n+C]&&(f[L[t[n+C]]++]=C);if(0===e?(M=U=f,v=19):1===e?(M=i,B-=257,U=a,F-=257,v=256):(M=s,U=o,v=-1),E=0,C=0,k=A,b=c,I=S,P=0,m=-1,g=(O=1<<S)-1,1===e&&O>852||2===e&&O>592)return 1;for(;;){_=k-P,f[C]<v?(w=0,y=f[C]):f[C]>v?(w=U[F+f[C]],y=M[B+f[C]]):(w=96,y=0),d=1<<k-P,A=p=1<<I;do{h[b+(E>>P)+(p-=d)]=_<<24|w<<16|y|0}while(0!==p);for(d=1<<k-1;E&d;)d>>=1;if(0!==d?(E&=d-1,E+=d):E=0,C++,0==--D[k]){if(k===z)break;k=t[n+f[C]]}if(k>S&&(E&g)!==m){for(0===P&&(P=S),b+=A,T=1<<(I=k-P);I+P<z&&!((T-=D[I+P])<=0);)I++,T<<=1;if(O+=1<<I,1===e&&O>852||2===e&&O>592)return 1;h[m=E&g]=S<<24|I<<16|b-c|0}}return 0!==E&&(h[b+E]=k-P<<24|64<<16|0),u.bits=S,0}},function(e,t,n){"use strict";e.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}},function(e,t,n){"use strict";n.r(t);var r=n(1);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const i=Object(r.a)("encodeCompressedSegmentationUint32"),a=Object(r.a)("encodeCompressedSegmentationUint64");var s=n(0);
/**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const o=2;function l(e,t,n,r,i,a,s,o,l){let h;if(1===i)h=0;else for(h=1;1<<h<i;)h*=2;let c=Math.ceil(h*r/32),f=e.length,u=c,d=!1,p=Array.prototype.join.call(a.subarray(0,i*l),","),m=n.get(p);void 0===m&&(d=!0,u+=i*l,m=f+c-t,n.set(p,m)),e.resize(f+u);let g=e.data;if(function(e,t,n,r,i,a){if(i>0)switch(i){case 1:for(let i=0,s=0;i<a;++i){let a=0;a|=r[n[s+0]]<<0,a|=r[n[s+1]]<<1,a|=r[n[s+2]]<<2,a|=r[n[s+3]]<<3,a|=r[n[s+4]]<<4,a|=r[n[s+5]]<<5,a|=r[n[s+6]]<<6,a|=r[n[s+7]]<<7,a|=r[n[s+8]]<<8,a|=r[n[s+9]]<<9,a|=r[n[s+10]]<<10,a|=r[n[s+11]]<<11,a|=r[n[s+12]]<<12,a|=r[n[s+13]]<<13,a|=r[n[s+14]]<<14,a|=r[n[s+15]]<<15,a|=r[n[s+16]]<<16,a|=r[n[s+17]]<<17,a|=r[n[s+18]]<<18,a|=r[n[s+19]]<<19,a|=r[n[s+20]]<<20,a|=r[n[s+21]]<<21,a|=r[n[s+22]]<<22,a|=r[n[s+23]]<<23,a|=r[n[s+24]]<<24,a|=r[n[s+25]]<<25,a|=r[n[s+26]]<<26,a|=r[n[s+27]]<<27,a|=r[n[s+28]]<<28,a|=r[n[s+29]]<<29,a|=r[n[s+30]]<<30,a|=r[n[s+31]]<<31,e[t+i]=a,s+=32}break;case 2:for(let i=0,s=0;i<a;++i){let a=0;a|=r[n[s+0]]<<0,a|=r[n[s+1]]<<2,a|=r[n[s+2]]<<4,a|=r[n[s+3]]<<6,a|=r[n[s+4]]<<8,a|=r[n[s+5]]<<10,a|=r[n[s+6]]<<12,a|=r[n[s+7]]<<14,a|=r[n[s+8]]<<16,a|=r[n[s+9]]<<18,a|=r[n[s+10]]<<20,a|=r[n[s+11]]<<22,a|=r[n[s+12]]<<24,a|=r[n[s+13]]<<26,a|=r[n[s+14]]<<28,a|=r[n[s+15]]<<30,e[t+i]=a,s+=16}break;case 4:for(let i=0,s=0;i<a;++i){let a=0;a|=r[n[s+0]]<<0,a|=r[n[s+1]]<<4,a|=r[n[s+2]]<<8,a|=r[n[s+3]]<<12,a|=r[n[s+4]]<<16,a|=r[n[s+5]]<<20,a|=r[n[s+6]]<<24,a|=r[n[s+7]]<<28,e[t+i]=a,s+=8}break;case 8:for(let i=0,s=0;i<a;++i){let a=0;a|=r[n[s+0]]<<0,a|=r[n[s+1]]<<8,a|=r[n[s+2]]<<16,a|=r[n[s+3]]<<24,e[t+i]=a,s+=4}break;case 16:for(let i=0,s=0;i<a;++i){let a=0;a|=r[n[s+0]]<<0,a|=r[n[s+1]]<<16,e[t+i]=a,s+=2}break;case 32:for(let i=0,s=0;i<a;++i){let a=0;a|=r[n[s+0]]<<0,e[t+i]=a,s+=1}}}(g,f,s,o,h,c),d){let e=f+c;for(let t=0,n=i*l;t<n;++t)g[e++]=a[t]}return[h,m]}function h(e,t,n,r,i,a,s){let l=new Map,h=new Array(3),c=o;for(let e=0;e<3;++e){c*=h[e]=Math.ceil(r[e]/t[e])}const f=h[0],u=h[1],d=h[2],p=r[0],m=r[1],g=r[2],b=t[0],v=t[1],_=t[2],w=e.length;let y=w;const x=[0,0,0];e.resize(w+c);let k=a[0],C=a[1],A=a[2];for(let r=0;r<d;++r){x[2]=Math.min(_,g-r*_);for(let o=0;o<u;++o){x[1]=Math.min(v,m-o*v);for(let h=0;h<f;++h){x[0]=Math.min(b,p-h*b);let c=r*_*A+o*v*C+h*b*k,f=e.length-w,[u,d]=s(n,i+c,a,t,x,w,l,e),m=e.data;m[y++]=d|u<<24,m[y++]=f}}}}function c(e,t,n,r,i,a,s){let o=e.length;const l=r[3];e.resize(o+l);for(let c=0;c<l;++c)e.data[o+c]=e.length,h(e,t,n,r,i+a[3]*c,a,s)}var f=n(3);
/**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let u,d,p,m,g;const b=1;function v(e,t,n,r,i,a,s,o){const h=i[0],c=i[1],f=i[2],v=r[0],_=r[1],w=r[2];let y=n[0],x=n[1],k=n[2];if(k-=x*c,x-=y*h,h*c*f==0)return[0,0];let C=v*_*w+31;(void 0===u||u.length<C)&&(u=new Uint32Array(C),d=new Uint32Array(C*b),p=new Uint32Array(C*b),m=new Uint32Array(C),g=new Uint32Array(C));const A=u.subarray(0,C);A.fill(0);const z=d,S=p,I=m,P=g;let T=0;{let n=e[t]+1>>>0,r=t,i=0,a=v-h,s=v*_-v*c;for(let t=0;t<f;++t,r+=k,i+=s)for(let t=0;t<c;++t,r+=x,i+=a)for(let t=0;t<h;++t,r+=y){let t=e[r];t!==n&&(n=z[1*T]=t,I[T]=T++),A[i++]=T}}I.subarray(0,T).sort((e,t)=>z[e]-z[t]);let O=-1;{let e=z[I[0]*b]+1>>>0;for(let t=0;t<T;++t){let n=I[t],r=z[n*b];if(r!==e){e=S[++O*b]=r}P[n+1]=O}++O}return l(o,a,s,v*_*w,O,S,A,P,b)}
/**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
let _,w,y,x,k;const C=2;function A(e,t,n,r,i,a,s,o){const h=i[0],c=i[1],f=i[2],u=r[0],d=r[1],p=r[2];let m=n[0],g=n[1],b=n[2];if(b-=g*c,g-=m*h,h*c*f==0)return[0,0];let v=u*d*p+31;(void 0===_||_.length<v)&&(_=new Uint32Array(v),w=new Uint32Array(v*C),y=new Uint32Array(v*C),x=new Uint32Array(v),k=new Uint32Array(v));const A=_.subarray(0,v);A.fill(0);const z=w,S=y,I=x,P=k;let T=0;{let n=e[t]+1>>>0,r=0,i=t,a=0,s=u-h,o=u*d-u*c;for(let t=0;t<f;++t,i+=b,a+=o)for(let t=0;t<c;++t,i+=g,a+=s)for(let t=0;t<h;++t,i+=m){let t=e[i],s=e[i+1];t===n&&s===r||(n=z[2*T]=t,r=z[2*T+1]=s,I[T]=T++),A[a++]=T}}I.subarray(0,T).sort((e,t)=>{let n=z[2*e+1],r=z[2*t+1],i=z[2*e],a=z[2*t];return n-r||i-a});let O=-1;{let e=z[I[0]*C]+1>>>0,t=0;for(let n=0;n<T;++n){let r=I[n],i=r*C,a=z[i],s=z[i+1];if(a!==e||s!==t){let n=++O*C;e=S[n]=a,t=S[n+1]=s}P[r+1]=O}++O}return l(o,a,s,u*d*p,O,S,A,P,C)}
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const z=new
/**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class{constructor(e=16){this.length=0,this.data=new Uint32Array(e)}resize(e){let{data:t}=this;if(e>t.length){let n=new Uint32Array(Math.max(e,2*t.length));n.set(t.subarray(0,this.length)),this.data=n}this.length=e}get view(){let{data:e}=this;return new Uint32Array(e.buffer,e.byteOffset,this.length)}shrinkToFit(){this.data=new Uint32Array(this.view)}clear(){this.length=0}appendArray(e){let{length:t}=this;this.resize(t+e.length),this.data.set(e,t)}eraseRange(e,t){this.data.copyWithin(e,t,this.length),this.length-=t-e}}(2e4);Object(s.registerAsyncComputation)(i,async function(e,t,n){return z.clear(),function(e,t,n,r,i=0,a=Object(f.a)(r,1)){c(e,t,n,r,i,a,v)}(z,n,e,t),{value:z.view}}),Object(s.registerAsyncComputation)(a,async function(e,t,n){return z.clear(),function(e,t,n,r,i=0,a=Object(f.a)(r,2)){c(e,t,n,r,i,a,A)}(z,n,e,t),{value:z.view}})},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n(1);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const a=Object(i.a)("parseVTKFromArrayBuffer"),s=1e3,o=/^[ \t]*#[ \t]+vtk[ \t]+DataFile[ \t]+Version[ \t]+([^\s]+)[ \t]*\n(.*)\n[ \t]*(ASCII|BINARY)[ \t]*\n[ \t]*DATASET[ \t]+([^ ]+)[ \t]*\n/,l=/^[ \t]*POINT_DATA[ \t]+([0-9]+)[ \t]*$/,h=/^[ \t]*POINTS[ \t]+([0-9]+)[ \t]+([^\s]+)[ \t]*$/,c=/^[ \t]*SCALARS[ \t]+([^\s]+)[ \t]+([^\s]+)(?:[ \t]+([0-9]+))?[ \t]*$/,f=/^[ \t]*LOOKUP_TABLE[ \t]+([^\s]+)[ \t]*$/,u=/^[ \t]*POLYGONS[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,d=/^[ \t]*3[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,p=/^[ \t]*$/;
/**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class m{constructor(e,t,n,r,i,a){this.header=e,this.numVertices=t,this.vertexPositions=n,this.numTriangles=r,this.indices=i,this.vertexAttributes=a}}function g(e){let t=e.vertexPositions.byteLength+e.indices.byteLength;for(const n of e.vertexAttributes)t+=n.data.byteLength;return t}const b=new Map([["POLYDATA",function(e,t){const n=(new TextDecoder).decode(t).split("\n"),r=n.length;let i=0,a=-1,s=void 0,o=-1,g=void 0,b=new Array;function v(e,t,a,s){let o=RegExp("^[ \t]*"+"([^s]+)[ \t]+".repeat(a-1)+"([^s]+)[ \t]*$");if(r-i<t)throw new Error(`VTK data ended unexpectedly while parsing ${e}.`);let l=new Float32Array(t*a),h=0;for(let r=0;r<t;++r){const t=n[i++],s=t.match(o);if(null===s)throw new Error(`Failed to parse ${e} line ${r}: ${JSON.stringify(t)}.`);for(let e=0;e<a;++e)l[h++]=parseFloat(s[e+1])}return l}function _(e,t){if(void 0!==g)throw new Error("POINTS specified more than once.");a=e,s=v("POINTS",e,3)}function w(e,t){if(void 0!==g)throw new Error("VERTICES specified more than once.");if(r-i<e)throw new Error("VTK data ended unexpectedly");if(t!==4*e)throw new Error("Only triangular faces are supported.");o=e,g=new Uint32Array(3*e);let a=0;for(let t=0;t<e;++t){let e=n[i++].match(d);if(null===e)throw new Error(`Failed to parse indices for face ${t}`);g[a++]=parseInt(e[1],10),g[a++]=parseInt(e[2],10),g[a++]=parseInt(e[3],10)}}function y(e,t,s){if(i===r)throw new Error("Expected LOOKUP_TABLE directive.");let o=n[i++],l=o.match(f);if(null===l)throw new Error(`Expected LOOKUP_TABLE directive in ${JSON.stringify(o)}.`);let h=l[1];const c=v(`SCALARS(${e})`,a,s);b.push({name:e,data:c,numComponents:s,dataType:t,tableName:h})}function x(e){if(a!==e)throw new Error(`Number of vertices specified in POINT_DATA section (${e}) `+`must match number of points (${a}).`);for(;i<r;){let e,t=n[i];if(t.match(p))++i;else if(null===(e=t.match(c)));else{let t;t=void 0===e[3]?1:parseInt(e[3],10),++i,y(e[1],e[2],t)}}}for(;i<r;){let e,t=n[i];if(t.match(p))++i;else if(null===(e=t.match(h))){if(null===(e=t.match(u))){if(null!==(e=t.match(l))){++i,x(parseInt(e[1],10));break}throw new Error(`Failed to parse VTK line ${JSON.stringify(t)}.`)}++i,w(parseInt(e[1],10),parseInt(e[2],10))}else++i,_(parseInt(e[1],10),e[2])}if(void 0===s)throw new Error("Vertex positions not specified.");if(void 0===g)throw new Error("Indices not specified.");return new m(e,a,s,o,g,b)}]]);var v=n(5);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */Object(r.registerAsyncComputation)(a,async function(e){const t=function(e){const t=(new TextDecoder).decode(new Uint8Array(e.buffer,e.byteOffset,Math.min(e.byteLength,s))).match(o);if(null===t)throw new Error("Failed to parse VTK file header.");const n=t[0].length,r=t[4],i=t[3],a={version:t[1],comment:t[2],datasetType:r,dataFormat:i},l=new Uint8Array(e.buffer,e.byteOffset+n,e.byteLength-n);if("ASCII"===i){const e=b.get(r);if(void 0===e)throw new Error(`VTK dataset type ${JSON.stringify(r)} is not supported.`);return e(a,l)}throw new Error(`VTK data format ${JSON.stringify(i)} is not supported.`)}(Object(v.a)(e));return{value:{data:t,size:g(t)},transfer:[t.indices.buffer,t.vertexPositions.buffer,...Array.from(t.vertexAttributes.values()).map(e=>e.data.buffer)]}})},function(e,t,n){"use strict";n.r(t);var r=n(1);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const i=Object(r.a)("parseCSVFromArrayBuffer");var a,s=n(0);
/**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */!function(e){e[e.UINT8=0]="UINT8",e[e.UINT16=1]="UINT16",e[e.UINT32=2]="UINT32",e[e.UINT64=3]="UINT64",e[e.FLOAT32=4]="FLOAT32"}(a||(a={}));const o=[];o[a.UINT8]=1,o[a.UINT16]=2,o[a.UINT32]=4,o[a.UINT64]=8,o[a.FLOAT32]=4;var l=n(5);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */Object(s.registerAsyncComputation)(i,async function(e){let t=(new TextDecoder).decode(Object(l.a)(e)).trim().split(/\n+/);if(!t)throw new Error("CSV file is empty.");let n=t[0].split(","),r=n.map(e=>({name:e.trim(),dataType:a.FLOAT32,numComponents:1})),i=t.length-1,s=n.length,o=n.map(()=>new Float32Array(i));for(let e=0;e<i;++e){let n=t[e+1].split(",");for(let t=0;t<s;++t)o[t][e]=parseFloat(n[t])}return{value:{data:{numVertices:i,attributeInfo:r,attributes:o},size:i*s*4},transfer:o.map(e=>e.buffer)}})},function(e,t,n){"use strict";n.r(t);var r=n(12),i=n(1);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const a=Object(i.a)("decodeJpeg");var s=n(0),o=n(3);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Object(s.registerAsyncComputation)(a,async function(e,t,n,i){let a,s=new r.JpegDecoder;if(s.parse(e),s.width!==t||s.height!==n)throw new Error("JPEG data does not have the expected dimensions: "+`width=${s.width}, height=${s.height}, `+`expected width=${s.width}, expected height=${s.height}`);if(s.numComponents!==i)throw new Error("JPEG data does not have the expected number of components: "+`components=${s.numComponents}, expected=${i}`);if(1===s.numComponents)a=s.getData(s.width,s.height,!1);else{if(3!==s.numComponents)throw new Error(`JPEG data has an unsupported number of components: components=${s.numComponents}`);a=s.getData(s.width,s.height,!1),a=Object(o.b)(a,s.width*s.height,3)}return{value:a,transfer:[a.buffer]}})},function(e,t,n){"use strict";n.r(t);var r=n(1);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const i=Object(r.a)("decodeGzip");var a=n(0),s=n(4);
/**
 * @license
 * Copyright 2019 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Object(a.registerAsyncComputation)(i,async function(e){const t=Object(s.inflate)(e);return{value:t,transfer:[t.buffer]}})}]);
//# sourceMappingURL=async_computation.bundle.js.map