!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=12)}([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 instanceof Error?e.message:e.toString()}))}},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(13),n(16),n(10)),e.exports=r},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]);function t(){}function n(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 r(e,t,n){return 64*((e.blocksPerLine+1)*t+n)}function i(t,n,i,a,s,o,l,h,c){i.precision,i.samplesPerLine,i.scanLines;var f=i.mcusPerLine,u=i.progressive,d=(i.maxH,i.maxV,n),p=0,m=0;function g(){if(m>0)return m--,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,i,a){var s=n%f;t(e,r(e,(n/f|0)*e.v+i,s*e.h+a))}function C(e,t,n){t(e,r(e,n/e.blocksPerLine|0,n%e.blocksPerLine))}var z,A,S,I,P,T,O=a.length;T=u?0===o?0===h?function(e,t){var n=b(e.huffmanTableDC),r=0===n?0:_(n)<<c;e.blockData[t]=e.pred+=r}:function(e,t){e.blockData[t]|=g()<<c}:0===h?function(t,n){if(w>0)w--;else for(var r=o,i=l;r<=i;){var a=b(t.huffmanTableAC),s=15&a,h=a>>4;if(0!==s){var f=e[r+=h];t.blockData[n+f]=_(s)*(1<<c),r++}else{if(h<15){w=v(h)+(1<<h)-1;break}r+=16}}}:function(t,n){for(var r,i,a=o,s=l,h=0;a<=s;){var f=e[a];switch(x){case 0:if(h=(i=b(t.huffmanTableAC))>>4,0===(r=15&i))h<15?(w=v(h)+(1<<h),x=4):(h=16,x=1);else{if(1!==r)throw"invalid ACn encoding";y=_(r),x=h?2:3}continue;case 1:case 2:t.blockData[n+f]?t.blockData[n+f]+=g()<<c:0===--h&&(x=2===x?3:0);break;case 3:t.blockData[n+f]?t.blockData[n+f]+=g()<<c:(t.blockData[n+f]=y<<c,x=0);break;case 4:t.blockData[n+f]&&(t.blockData[n+f]+=g()<<c)}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?a[0].blocksPerLine*a[0].blocksPerColumn:f*i.mcusPerColumn,s||(s=M);L<M;){for(A=0;A<O;A++)a[A].pred=0;if(w=0,1===O)for(z=a[0],P=0;P<s;P++)C(z,T,L),L++;else for(P=0;P<s;P++){for(A=0;A<O;A++)for(B=(z=a[A]).h,D=z.v,S=0;S<D;S++)for(I=0;I<B;I++)k(z,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 a(e,t,n){for(var r,i,a,s,o,l,h,c,f,u,d,p,m,g,b,v,_,w=e.quantizationTable,y=e.blockData,x=0;x<64;x+=8)f=y[t+x],u=y[t+x+1],d=y[t+x+2],p=y[t+x+3],m=y[t+x+4],g=y[t+x+5],b=y[t+x+6],v=y[t+x+7],f*=w[x],0!=(u|d|p|m|g|b|v)?(u*=w[x+1],d*=w[x+2],p*=w[x+3],m*=w[x+4],g*=w[x+5],i=(r=(r=5793*f+128>>8)+(i=5793*m+128>>8)+1>>1)-i,_=3784*(a=d)+1567*(s=b*=w[x+6])+128>>8,a=1567*a-3784*s+128>>8,h=(o=(o=2896*(u-(v*=w[x+7]))+128>>8)+(h=g<<4)+1>>1)-h,l=(c=(c=2896*(u+v)+128>>8)+(l=p<<4)+1>>1)-l,s=(r=r+(s=_)+1>>1)-s,a=(i=i+a+1>>1)-a,_=2276*o+3406*c+2048>>12,o=3406*o-2276*c+2048>>12,c=_,_=799*l+4017*h+2048>>12,l=4017*l-799*h+2048>>12,h=_,n[x]=r+c,n[x+7]=r-c,n[x+1]=i+h,n[x+6]=i-h,n[x+2]=a+l,n[x+5]=a-l,n[x+3]=s+o,n[x+4]=s-o):(_=5793*f+512>>10,n[x]=_,n[x+1]=_,n[x+2]=_,n[x+3]=_,n[x+4]=_,n[x+5]=_,n[x+6]=_,n[x+7]=_);for(var k=0;k<8;++k)f=n[k],0!=((u=n[k+8])|(d=n[k+16])|(p=n[k+24])|(m=n[k+32])|(g=n[k+40])|(b=n[k+48])|(v=n[k+56]))?(i=(r=4112+((r=5793*f+2048>>12)+(i=5793*m+2048>>12)+1>>1))-i,_=3784*(a=d)+1567*(s=b)+2048>>12,a=1567*a-3784*s+2048>>12,s=_,h=(o=(o=2896*(u-v)+2048>>12)+(h=g)+1>>1)-h,l=(c=(c=2896*(u+v)+2048>>12)+(l=p)+1>>1)-l,_=2276*o+3406*c+2048>>12,o=3406*o-2276*c+2048>>12,c=_,_=799*l+4017*h+2048>>12,l=4017*l-799*h+2048>>12,f=(f=(r=r+s+1>>1)+c)<16?0:f>=4080?255:f>>4,u=(u=(i=i+a+1>>1)+(h=_))<16?0:u>=4080?255:u>>4,d=(d=(a=i-a)+l)<16?0:d>=4080?255:d>>4,p=(p=(s=r-s)+o)<16?0:p>=4080?255:p>>4,m=(m=s-o)<16?0:m>=4080?255:m>>4,g=(g=a-l)<16?0:g>=4080?255:g>>4,b=(b=i-h)<16?0:b>=4080?255:b>>4,v=(v=r-c)<16?0:v>=4080?255:v>>4,y[t+k]=f,y[t+k+8]=u,y[t+k+16]=d,y[t+k+24]=p,y[t+k+32]=m,y[t+k+40]=g,y[t+k+48]=b,y[t+k+56]=v):(_=(_=5793*f+8192>>14)<-2040?0:_>=2024?255:_+2056>>4,y[t+k]=_,y[t+k+8]=_,y[t+k+16]=_,y[t+k+24]=_,y[t+k+32]=_,y[t+k+40]=_,y[t+k+48]=_,y[t+k+56]=_)}function s(e,t){for(var n=t.blocksPerLine,i=t.blocksPerColumn,s=new Int16Array(64),o=0;o<i;o++)for(var l=0;l<n;l++){a(t,r(t,o,l),s)}return t.blockData}function o(e){return e<=0?0:e>=255?255:e}return t.prototype={parse:function(t){function r(){var e=t[c]<<8|t[c+1];return c+=2,e}function a(){var e=r(),n=t.subarray(c,c+e-2);return c+=n.length,n}function o(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 l,h,c=0,f=(t.length,null),u=null,d=[],p=[],m=[],g=r();if(65496!==g)throw"SOI not found";for(g=r();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=a();65504===g&&74===w[0]&&70===w[1]&&73===w[2]&&70===w[3]&&0===w[4]&&(f={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]&&(u={version:w[6],flags0:w[7]<<8|w[8],flags1:w[9]<<8|w[10],transformCode:w[11]});break;case 65499:for(var y=r()+c-2;c<y;){var x=t[c++],k=new Uint16Array(64);if(x>>4==0)for(v=0;v<64;v++)k[e[v]]=t[c++];else{if(x>>4!=1)throw"DQT: invalid table spec";for(v=0;v<64;v++)k[e[v]]=r()}d[15&x]=k}break;case 65472:case 65473:case 65474:if(l)throw"Only single frame JPEGs supported";r(),(l={}).extended=65473===g,l.progressive=65474===g,l.precision=t[c++],l.scanLines=r(),l.samplesPerLine=r(),l.components=[],l.componentIds={};var C,z=t[c++],A=0,S=0;for(b=0;b<z;b++){C=t[c];var I=t[c+1]>>4,P=15&t[c+1];A<I&&(A=I),S<P&&(S=P);var T=t[c+2];_=l.components.push({h:I,v:P,quantizationTable:d[T]}),l.componentIds[C]=_-1,c+=3}l.maxH=A,l.maxV=S,o(l);break;case 65476:var O=r();for(b=2;b<O;){var E=t[c++],M=new Uint8Array(16),B=0;for(v=0;v<16;v++,c++)B+=M[v]=t[c];var D=new Uint8Array(B);for(v=0;v<B;v++,c++)D[v]=t[c];b+=17+B,(E>>4==0?m:p)[15&E]=n(M,D)}break;case 65501:r(),h=r();break;case 65498:r();var L,U=t[c++],R=[];for(b=0;b<U;b++){var F=l.componentIds[t[c++]];L=l.components[F];var N=t[c++];L.huffmanTableDC=m[N>>4],L.huffmanTableAC=p[15&N],R.push(L)}var Z=t[c++],H=t[c++],q=t[c++],J=i(t,c,l,R,h,Z,H,q>>4,15&q);c+=J;break;case 65535:255!==t[c]&&c--;break;default:if(255===t[c-3]&&t[c-2]>=192&&t[c-2]<=254){c-=3;break}throw"unknown JPEG marker "+g.toString(16)}g=r()}for(this.width=l.samplesPerLine,this.height=l.scanLines,this.jfif=f,this.adobe=u,this.components=[],b=0;b<l.components.length;b++)L=l.components[b],this.components.push({output:s(0,L),scaleX:L.h/l.maxH,scaleY:L.v/l.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]=o(t-179.456+1.402*r),e[i+1]=o(t+135.459-.344*n-.714*r),e[i+2]=o(t-226.816+1.772*n);return e},_convertYcckToRgb:function(e){for(var t,n,r,i,a=0,s=0,l=e.length;s<l;s+=4){t=e[s];var h=(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),c=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),f=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++]=o(h),e[a++]=o(c),e[a++]=o(f)}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]=o(434.456-t-1.402*r),e[i+1]=o(119.541-t+.344*n+.714*r),e[i+2]=o(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}},t}(),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 z=r.codingStyleDefaultParameters.progressionOrder;switch(z){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 "+z)}}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 z=(w=_.codeblocks[k]).precinct,I=w.cbx-z.cbxMin,P=w.cby-z.cbyMin,T=!1,O=!1;if(void 0!==w.included)T=!!h(1);else{var E,M;if(void 0!==(z=w.precinct).inclusionTree)E=z.inclusionTree;else{var B=z.cbxMax-z.cbxMin+1,D=z.cbyMax-z.cbyMin+1;E=new S(B,D,y),M=new A(B,D),z.inclusionTree=E,z.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=z.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),R=h((L<1<<U?U-1:U)+w.Lblock);x.push({codeblock:w,codingpasses:L,dataLength:R})}}for(u(),b&&c(146);x.length>0;){var F=x.shift();void 0===(w=F.codeblock).data&&(w.data=[]),w.data.push({data:t,start:n+s,end:n+s+F.dataLength,codingpasses:F.codingpasses}),s+=F.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,z=b.data,A=0,S=0;for(x=0,k=z.length;x<k;x++)A+=(C=z[x]).end-C.start,S+=C.codingpasses;var P=new Uint8Array(A),T=0;for(x=0,k=z.length;x<k;x++){var O=(C=z[x]).data.subarray(C.start,C.end);P.set(O,T),T+=O.length}var E=new n(P,0,A);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,R=w.coefficentsMagnitude,F=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=R[T])){B=(B+N)*a,0!==U[T]&&(B=-B),D=F[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 z,A;h?(z=l[g].mu,A=l[g].epsilon,g++):(z=l[0].mu,A=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-A)*(1+z/2048),c+A-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 z(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 A=0;A<w;A++){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&&(z(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,z,A=h[0],S=new Uint8Array(A.items.length*r),I={left:A.left,top:A.top,width:A.width,height:A.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++)z=U[m],S[P]=z<=d?0:z>=u?255:z+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 A=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),z=new Int8Array(k),A=new Uint16Array(k);for(f=0;f<k;f++)d=v[f],C[f]=h[d].x,z[f]=h[d].y,A[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=[],R=o.decoder,F=o.contextCache.getContexts("GB"),N=0,Z=0,H=0;H<n;H++){if(i)if(N^=R.readBit(F,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+z[d],P=S+C[d],(T=U[I][P])&&(Z|=T=A[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=R.readBit(F,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=[],z=l.decoder,A=l.contextCache.getContexts("GR"),S=0,I=0;I<t;I++){if(s)(S^=z.readBit(A,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=z.readBit(A,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 z=w.decoder,A=w.contextCache,S=-r(A,"IADT",z),I=0;for(y=0;y<o;){S+=r(A,"IADT",z);for(var P=I+=r(A,"IAFS",z);;){var T=l*S+(1===l?0:r(A,"IAIT",z)),O=i(A,z,f),E=t&&r(A,"IARI",z),M=h[O],B=M[0].length,D=M.length;if(E){var L=r(A,"IARDW",z),U=r(A,"IARDH",z);M=b(B+=L,D+=U,v,M,(L>>1)+r(A,"IARDX",z),(U>>1)+r(A,"IARDY",z),!1,_,w)}var R,F,N,Z=T-(1&p?0:D),H=P-(2&p?B:0);if(u){for(R=0;R<D;R++)if(x=k[H+R]){N=M[R];var q=Math.min(n-Z,B);switch(m){case 0:for(F=0;F<q;F++)x[Z+F]|=N[F];break;case 2:for(F=0;F<q;F++)x[Z+F]^=N[F];break;default:c("JBIG2 error: operator "+m+" is not supported")}}P+=D-1}else{for(F=0;F<D;F++)if(x=k[Z+F])switch(N=M[F],m){case 0:for(R=0;R<B;R++)x[H+R]|=N[R];break;case 2:for(R=0;R<B;R++)x[H+R]^=N[R];break;default:c("JBIG2 error: operator "+m+" is not supported")}P+=B-1}y++;var J=r(A,"IADS",z);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 z=0;z<6&&C[z]===e[m+z];)z++;if(6===z){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 z="on"+h.typeName;z in t&&t[z].apply(t,n)}function C(e,t){for(var n=0,r=e.length;n<r;n++)k(e[n],t)}function z(){}function A(){}return z.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,z=r(x,"IADW",y);if(null===z)break;if(k+=z,t){var A=r(x,"IAAI",y);if(A>1)C=v(e,t,k,_,0,A,1,n.concat(m),w,0,0,1,0,l,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,void 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)}},A.prototype={parseChunks:function(e){return function(e){for(var t=new z,n=0,r=e.length;n<r;n++){var i=e[n];C(w({},i.data,i.start,i.end),t)}return t}(e)}},A}();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(21),n(23),n(24),e.exports=n(22)},function(e,t,n){"use strict";var r=n(14),i=n(2),a=n(8),s=n(5),o=n(9),l=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,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(0!==n)throw new Error(s[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var c;if(c="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=r.deflateSetDictionary(this.strm,c)))throw new Error(s[n]);this._dict_set=!0}}function c(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(e,t){var n,s,o=this.strm,h=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(h),o.next_out=0,o.avail_out=h),1!==(n=r.deflate(o,s))&&0!==n)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,0===n):2!==s||(this.onEnd(0),o.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){0===e&&("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=h,t.deflate=c,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,c(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,c(e,t)}},function(e,t,n){"use strict";var r,i=n(2),a=n(15),s=n(6),o=n(7),l=n(5);function h(e,t){return e.msg=l[t],t}function c(e){return(e<<1)-(e>4?9:0)}function f(e){for(var t=e.length;--t>=0;)e[t]=0}function u(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 d(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,u(e.strm)}function p(e,t){e.pending_buf[e.pending++]=t}function m(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function g(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-262?e.strstart-(e.w_size-262):0,h=e.window,c=e.w_mask,f=e.prev,u=e.strstart+258,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=258-(u-a),a=u-258,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 b(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-262)){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>=3)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+3-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<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function v(e,t){for(var n,r;;){if(e.lookahead<262){if(b(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-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-262&&(e.match_length=g(e,n)),e.match_length>=3)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-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&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}function _(e,t){for(var n,r,i;;){if(e.lookahead<262){if(b(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-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=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=g(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),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+3-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=2,e.strstart++,r&&(d(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=a._tr_tally(e,0,e.window[e.strstart-1]))&&d(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}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<2?e.strstart:2,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}function w(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 y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,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(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),f(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 x(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=0,a._tr_init(t),0):h(e,-2)}function k(e){var t,n=x(e);return 0===n&&((t=e.state).window_size=2*t.w_size,f(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=2,t.match_available=0,t.ins_h=0),n}function C(e,t,n,r,a,s){if(!e)return-2;var o=1;if(-1===t&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),a<1||a>9||8!==n||r<8||r>15||t<0||t>9||s<0||s>4)return h(e,-2);8===r&&(r=9);var l=new y;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+3-1)/3),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,k(e)}r=[new w(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(b(e),0===e.lookahead&&0===t)return 1;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,d(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(d(e,!1),e.strm.avail_out),1)})),new w(4,4,8,4,v),new w(4,5,16,8,v),new w(4,6,32,32,v),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],t.deflateInit=function(e,t){return C(e,t,8,15,8,0)},t.deflateInit2=C,t.deflateReset=k,t.deflateResetKeep=x,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},t.deflate=function(e,t){var n,i,s,l;if(!e||!e.state||t>5||t<0)return e?h(e,-2):-2;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return h(e,0===e.avail_out?-5:-2);if(i.strm=e,n=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,p(i,31),p(i,139),p(i,8),i.gzhead?(p(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)),p(i,255&i.gzhead.time),p(i,i.gzhead.time>>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(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=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,3),i.status=113);else{var g=8+(i.w_bits-8<<4)<<8;g|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(g|=32),g+=31-g%31,i.status=113,m(i,g),0!==i.strstart&&(m(i,e.adler>>>16),m(i,65535&e.adler)),e.adler=1}if(69===i.status)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)),u(e),s=i.pending,i.pending!==i.pending_buf_size));)p(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=73)}else i.status=73;if(73===i.status)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)),u(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,p(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=91)}else i.status=91;if(91===i.status)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)),u(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,p(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=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&u(e),i.pending+2<=i.pending_buf_size&&(p(i,255&e.adler),p(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(u(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&c(t)<=c(n)&&4!==t)return h(e,-5);if(666===i.status&&0!==e.avail_in)return h(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var v=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(b(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var n,r,i,s,o=e.window;;){if(e.lookahead<=258){if(b(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=o[i=e.strstart-1])===o[++i]&&r===o[++i]&&r===o[++i]){s=e.strstart+258;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=258-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=a._tr_tally(e,1,e.match_length-3),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&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(i,t):r[i.level].func(i,t);if(3!==v&&4!==v||(i.status=666),1===v||3===v)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===v&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(f(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),u(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&e.adler),p(i,e.adler>>8&255),p(i,e.adler>>16&255),p(i,e.adler>>24&255),p(i,255&e.total_in),p(i,e.total_in>>8&255),p(i,e.total_in>>16&255),p(i,e.total_in>>24&255)):(m(i,e.adler>>>16),m(i,65535&e.adler)),u(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?h(e,-2):(e.state=null,113===t?h(e,-3):0):-2},t.deflateSetDictionary=function(e,t){var n,r,a,o,l,h,c,u,d=t.length;if(!e||!e.state)return-2;if(2===(o=(n=e.state).wrap)||1===o&&42!==n.status||n.lookahead)return-2;for(1===o&&(e.adler=s(e.adler,t,d,0)),n.wrap=0,d>=n.w_size&&(0===o&&(f(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new i.Buf8(n.w_size),i.arraySet(u,t,d-n.w_size,n.w_size,0),t=u,d=n.w_size),l=e.avail_in,h=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,b(n);n.lookahead>=3;){r=n.strstart,a=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-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=2,b(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=h,e.input=c,e.avail_in=l,n.wrap=o,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,n){"use strict";var r=n(2);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var 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],s=[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],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=new Array(576);i(h);var c=new Array(60);i(c);var f=new Array(512);i(f);var u=new Array(256);i(u);var d=new Array(29);i(d);var p,m,g,b=new Array(30);function v(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 _(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function w(e){return e<256?f[e]:f[256+(e>>>7)]}function y(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function x(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,y(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function k(e,t,n){x(e,n[2*t],n[2*t+1])}function C(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function z(e,t,n){var r,i,a=new Array(16),s=0;for(r=1;r<=15;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]=C(a[o]++,o))}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function S(e){e.bi_valid>8?y(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 I(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 P(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&I(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!I(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function T(e,t,n){var r,i,o,l,h=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*h]<<8|e.pending_buf[e.d_buf+2*h+1],i=e.pending_buf[e.l_buf+h],h++,0===r?k(e,i,t):(k(e,(o=u[i])+256+1,t),0!==(l=a[o])&&x(e,i-=d[o],l),k(e,o=w(--r),n),0!==(l=s[o])&&x(e,r-=b[o],l))}while(h<e.last_lit);k(e,256,t)}function O(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=573,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--)P(e,a,n);i=l;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],P(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++,P(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<=15;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;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),z(a,h,e.bl_count)}function E(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[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,a=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4))}function M(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{k(e,i,e.bl_tree)}while(0!=--o);else 0!==i?(i!==a&&(k(e,i,e.bl_tree),o--),k(e,16,e.bl_tree),x(e,o-3,2)):o<=10?(k(e,17,e.bl_tree),x(e,o-3,3)):(k(e,18,e.bl_tree),x(e,o-11,7));o=0,a=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}}i(b);var B=!1;function D(e,t,n,i){x(e,0+(i?1:0),3),function(e,t,n,i){S(e),i&&(y(e,n),y(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){B||(!function(){var e,t,n,r,i,l=new Array(16);for(n=0,r=0;r<28;r++)for(d[r]=n,e=0;e<1<<a[r];e++)u[n++]=r;for(u[n-1]=r,i=0,r=0;r<16;r++)for(b[r]=i,e=0;e<1<<s[r];e++)f[i++]=r;for(i>>=7;r<30;r++)for(b[r]=i<<7,e=0;e<1<<s[r]-7;e++)f[256+i++]=r;for(t=0;t<=15;t++)l[t]=0;for(e=0;e<=143;)h[2*e+1]=8,e++,l[8]++;for(;e<=255;)h[2*e+1]=9,e++,l[9]++;for(;e<=279;)h[2*e+1]=7,e++,l[7]++;for(;e<=287;)h[2*e+1]=8,e++,l[8]++;for(z(h,287,l),e=0;e<30;e++)c[2*e+1]=5,c[2*e]=C(e,5);p=new v(h,a,257,286,15),m=new v(c,s,0,30,15),g=new v(new Array(0),o,0,19,7)}(),B=!0),e.l_desc=new _(e.dyn_ltree,p),e.d_desc=new _(e.dyn_dtree,m),e.bl_desc=new _(e.bl_tree,g),e.bi_buf=0,e.bi_valid=0,A(e)},t._tr_stored_block=D,t._tr_flush_block=function(e,t,n,r){var i,a,s=0;e.level>0?(2===e.strm.data_type&&(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 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),O(e,e.l_desc),O(e,e.d_desc),s=function(e){var t;for(E(e,e.dyn_ltree,e.l_desc.max_code),E(e,e.dyn_dtree,e.d_desc.max_code),O(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*l[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==t?D(e,t,n,r):4===e.strategy||a===i?(x(e,2+(r?1:0),3),T(e,h,c)):(x(e,4+(r?1:0),3),function(e,t,n,r){var i;for(x(e,t-257,5),x(e,n-1,5),x(e,r-4,4),i=0;i<r;i++)x(e,e.bl_tree[2*l[i]+1],3);M(e,e.dyn_ltree,t-1),M(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),T(e,e.dyn_ltree,e.dyn_dtree)),A(e),r&&S(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*(u[n]+256+1)]++,e.dyn_dtree[2*w(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){x(e,2,3),k(e,256,h),function(e){16===e.bi_valid?(y(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(17),i=n(2),a=n(8),s=n(10),o=n(5),l=n(9),h=n(20),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(6),a=n(7),s=n(18),o=n(19);function l(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){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 c(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=1,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(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):-2}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,c(e)):-2}function u(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)?-2:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,f(e))):-2}function d(e,t){var n,r;return e?(r=new h,e.state=r,r.window=null,0!==(n=u(e,t))&&(e.state=null),n):-2}var p,m,g=!0;function b(e){if(g){var t;for(p=new r.Buf32(512),m=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(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(2,e.lens,0,32,m,0,e.work,{bits:5}),g=!1}e.lencode=p,e.lenbits=9,e.distcode=m,e.distbits=5}function v(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=f,t.inflateReset2=u,t.inflateResetKeep=c,t.inflateInit=function(e){return d(e,15)},t.inflateInit2=d,t.inflate=function(e,t){var n,h,c,f,u,d,p,m,g,_,w,y,x,k,C,z,A,S,I,P,T,O,E,M,B=0,D=new r.Buf8(4),L=[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-2;12===(n=e.state).mode&&(n.mode=13),u=e.next_out,c=e.output,p=e.avail_out,f=e.next_in,h=e.input,d=e.avail_in,m=n.hold,g=n.bits,_=d,w=p,O=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;g<16;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(2&n.wrap&&35615===m){n.check=0,D[0]=255&m,D[1]=m>>>8&255,n.check=a(n.check,D,2,0),m=0,g=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&m)){e.msg="unknown compression method",n.mode=30;break}if(g-=4,T=8+(15&(m>>>=4)),0===n.wbits)n.wbits=T;else if(T>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<T,e.adler=n.check=1,n.mode=512&m?10:12,m=0,g=0;break;case 2:for(;g<16;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(n.flags=m,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=m>>8&1),512&n.flags&&(D[0]=255&m,D[1]=m>>>8&255,n.check=a(n.check,D,2,0)),m=0,g=0,n.mode=3;case 3:for(;g<32;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}n.head&&(n.head.time=m),512&n.flags&&(D[0]=255&m,D[1]=m>>>8&255,D[2]=m>>>16&255,D[3]=m>>>24&255,n.check=a(n.check,D,4,0)),m=0,g=0,n.mode=4;case 4:for(;g<16;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}n.head&&(n.head.xflags=255&m,n.head.os=m>>8),512&n.flags&&(D[0]=255&m,D[1]=m>>>8&255,n.check=a(n.check,D,2,0)),m=0,g=0,n.mode=5;case 5:if(1024&n.flags){for(;g<16;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}n.length=m,n.head&&(n.head.extra_len=m),512&n.flags&&(D[0]=255&m,D[1]=m>>>8&255,n.check=a(n.check,D,2,0)),m=0,g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((y=n.length)>d&&(y=d),y&&(n.head&&(T=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,h,f,y,T)),512&n.flags&&(n.check=a(n.check,h,y,f)),d-=y,f+=y,n.length-=y),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===d)break e;y=0;do{T=h[f+y++],n.head&&T&&n.length<65536&&(n.head.name+=String.fromCharCode(T))}while(T&&y<d);if(512&n.flags&&(n.check=a(n.check,h,y,f)),d-=y,f+=y,T)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===d)break e;y=0;do{T=h[f+y++],n.head&&T&&n.length<65536&&(n.head.comment+=String.fromCharCode(T))}while(T&&y<d);if(512&n.flags&&(n.check=a(n.check,h,y,f)),d-=y,f+=y,T)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;g<16;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(m!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}m=0,g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;g<32;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}e.adler=n.check=l(m),m=0,g=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=u,e.avail_out=p,e.next_in=f,e.avail_in=d,n.hold=m,n.bits=g,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){m>>>=7&g,g-=7&g,n.mode=27;break}for(;g<3;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}switch(n.last=1&m,g-=1,3&(m>>>=1)){case 0:n.mode=14;break;case 1:if(b(n),n.mode=20,6===t){m>>>=2,g-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}m>>>=2,g-=2;break;case 14:for(m>>>=7&g,g-=7&g;g<32;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if((65535&m)!=(m>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&m,m=0,g=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(y=n.length){if(y>d&&(y=d),y>p&&(y=p),0===y)break e;r.arraySet(c,h,f,y,u),d-=y,f+=y,p-=y,u+=y,n.length-=y;break}n.mode=12;break;case 17:for(;g<14;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(n.nlen=257+(31&m),m>>>=5,g-=5,n.ndist=1+(31&m),m>>>=5,g-=5,n.ncode=4+(15&m),m>>>=4,g-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;g<3;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}n.lens[L[n.have++]]=7&m,m>>>=3,g-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},O=o(0,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,O){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;z=(B=n.lencode[m&(1<<n.lenbits)-1])>>>16&255,A=65535&B,!((C=B>>>24)<=g);){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(A<16)m>>>=C,g-=C,n.lens[n.have++]=A;else{if(16===A){for(M=C+2;g<M;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(m>>>=C,g-=C,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}T=n.lens[n.have-1],y=3+(3&m),m>>>=2,g-=2}else if(17===A){for(M=C+3;g<M;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}g-=C,T=0,y=3+(7&(m>>>=C)),m>>>=3,g-=3}else{for(M=C+7;g<M;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}g-=C,T=0,y=11+(127&(m>>>=C)),m>>>=7,g-=7}if(n.have+y>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;y--;)n.lens[n.have++]=T}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,E={bits:n.lenbits},O=o(1,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,O){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},O=o(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,O){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(d>=6&&p>=258){e.next_out=u,e.avail_out=p,e.next_in=f,e.avail_in=d,n.hold=m,n.bits=g,s(e,w),u=e.next_out,c=e.output,p=e.avail_out,f=e.next_in,h=e.input,d=e.avail_in,m=n.hold,g=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;z=(B=n.lencode[m&(1<<n.lenbits)-1])>>>16&255,A=65535&B,!((C=B>>>24)<=g);){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(z&&0==(240&z)){for(S=C,I=z,P=A;z=(B=n.lencode[P+((m&(1<<S+I)-1)>>S)])>>>16&255,A=65535&B,!(S+(C=B>>>24)<=g);){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}m>>>=S,g-=S,n.back+=S}if(m>>>=C,g-=C,n.back+=C,n.length=A,0===z){n.mode=26;break}if(32&z){n.back=-1,n.mode=12;break}if(64&z){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&z,n.mode=22;case 22:if(n.extra){for(M=n.extra;g<M;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}n.length+=m&(1<<n.extra)-1,m>>>=n.extra,g-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;z=(B=n.distcode[m&(1<<n.distbits)-1])>>>16&255,A=65535&B,!((C=B>>>24)<=g);){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(0==(240&z)){for(S=C,I=z,P=A;z=(B=n.distcode[P+((m&(1<<S+I)-1)>>S)])>>>16&255,A=65535&B,!(S+(C=B>>>24)<=g);){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}m>>>=S,g-=S,n.back+=S}if(m>>>=C,g-=C,n.back+=C,64&z){e.msg="invalid distance code",n.mode=30;break}n.offset=A,n.extra=15&z,n.mode=24;case 24:if(n.extra){for(M=n.extra;g<M;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}n.offset+=m&(1<<n.extra)-1,m>>>=n.extra,g-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===p)break e;if(y=w-p,n.offset>y){if((y=n.offset-y)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}y>n.wnext?(y-=n.wnext,x=n.wsize-y):x=n.wnext-y,y>n.length&&(y=n.length),k=n.window}else k=c,x=u-n.offset,y=n.length;y>p&&(y=p),p-=y,n.length-=y;do{c[u++]=k[x++]}while(--y);0===n.length&&(n.mode=21);break;case 26:if(0===p)break e;c[u++]=n.length,p--,n.mode=21;break;case 27:if(n.wrap){for(;g<32;){if(0===d)break e;d--,m|=h[f++]<<g,g+=8}if(w-=p,e.total_out+=w,n.total+=w,w&&(e.adler=n.check=n.flags?a(n.check,c,w,u-w):i(n.check,c,w,u-w)),w=p,(n.flags?m:l(m))!==n.check){e.msg="incorrect data check",n.mode=30;break}m=0,g=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;g<32;){if(0===d)break e;d--,m+=h[f++]<<g,g+=8}if(m!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}m=0,g=0}n.mode=29;case 29:O=1;break e;case 30:O=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=u,e.avail_out=p,e.next_in=f,e.avail_in=d,n.hold=m,n.bits=g,(n.wsize||w!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&v(e,e.output,e.next_out,w-e.avail_out)?(n.mode=31,-4):(_-=e.avail_in,w-=e.avail_out,e.total_in+=_,e.total_out+=w,n.total+=w,n.wrap&&w&&(e.adler=n.check=n.flags?a(n.check,c,w,e.next_out-w):i(n.check,c,w,e.next_out-w)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===_&&0===w||4===t)&&0===O&&(O=-5),O)},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?-2:(n.head=t,t.done=!1,0):-2},t.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?-2:11===n.mode&&i(1,t,r,0)!==n.check?-3:v(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},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,z,A;n=e.state,r=e.next_in,z=e.input,i=r+(e.avail_in-5),a=e.next_out,A=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+=z[r++]<<p,p+=8,d+=z[r++]<<p,p+=8),_=m[d&b];t:for(;;){if(d>>>=w=_>>>24,p-=w,0===(w=_>>>16&255))A[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+=z[r++]<<p,p+=8),y+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=z[r++]<<p,p+=8,d+=z[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+=z[r++]<<p,(p+=8)<w&&(d+=z[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{A[a++]=u[k++]}while(--w);k=a-x,C=A}}else if(f<w){if(k+=h+f-w,(w-=f)<y){y-=w;do{A[a++]=u[k++]}while(--w);if(k=0,f<y){y-=w=f;do{A[a++]=u[k++]}while(--w);k=a-x,C=A}}}else if(k+=f-w,w<y){y-=w;do{A[a++]=u[k++]}while(--w);k=a-x,C=A}for(;y>2;)A[a++]=C[k++],A[a++]=C[k++],A[a++]=C[k++],y-=3;y&&(A[a++]=C[k++],y>1&&(A[a++]=C[k++]))}else{k=a-x;do{A[a++]=A[k++],A[a++]=A[k++],A[a++]=A[k++],y-=3}while(y>2);y&&(A[a++]=A[k++],y>1&&(A[a++]=A[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,z=0,A=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,R=0;for(k=0;k<=15;k++)D[k]=0;for(C=0;C<l;C++)D[t[n+C]]++;for(S=x,A=15;A>=1&&0===D[A];A--);if(S>A&&(S=A),0===A)return h[c++]=20971520,h[c++]=20971520,u.bits=1,0;for(z=1;z<A&&0===D[z];z++);for(S<z&&(S=z),T=1,k=1;k<=15;k++)if(T<<=1,(T-=D[k])<0)return-1;if(T>0&&(0===e||1!==A))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,R-=257,v=256):(M=s,U=o,v=-1),E=0,C=0,k=z,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[R+f[C]],y=M[B+f[C]]):(w=96,y=0),d=1<<k-P,z=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===A)break;k=t[n+f[C]]}if(k>S&&(E&g)!==m){for(0===P&&(P=S),b+=z,T=1<<(I=k-P);I+P<A&&!((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.
 */function o(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 l(e,t,n,r,i,a,s){let o=new Map,l=new Array(3),h=2;for(let e=0;e<3;++e){h*=l[e]=Math.ceil(r[e]/t[e])}const c=l[0],f=l[1],u=l[2],d=r[0],p=r[1],m=r[2],g=t[0],b=t[1],v=t[2],_=e.length;let w=_;const y=[0,0,0];e.resize(_+h);let x=a[0],k=a[1],C=a[2];for(let r=0;r<u;++r){y[2]=Math.min(v,m-r*v);for(let l=0;l<f;++l){y[1]=Math.min(b,p-l*b);for(let h=0;h<c;++h){y[0]=Math.min(g,d-h*g);let c=r*v*C+l*b*k+h*g*x,f=e.length-_,[u,p]=s(n,i+c,a,t,y,_,o,e),m=e.data;m[w++]=p|u<<24,m[w++]=f}}}}function h(e,t,n,r,i,a,s){let o=e.length;const h=r[3];e.resize(o+h);for(let c=0;c<h;++c)e.data[o+c]=e.length,l(e,t,n,r,i+a[3]*c,a,s)}var c=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 f,u,d,p,m;function g(e,t,n,r,i,a,s,l){const h=i[0],c=i[1],g=i[2],b=r[0],v=r[1],_=r[2];let w=n[0],y=n[1],x=n[2];if(x-=y*c,y-=w*h,h*c*g==0)return[0,0];let k=b*v*_+31;(void 0===f||f.length<k)&&(f=new Uint32Array(k),u=new Uint32Array(1*k),d=new Uint32Array(1*k),p=new Uint32Array(k),m=new Uint32Array(k));const C=f.subarray(0,k);C.fill(0);const z=u,A=d,S=p,I=m;let P=0;{let n=e[t]+1>>>0,r=t,i=0,a=b-h,s=b*v-b*c;for(let t=0;t<g;++t,r+=x,i+=s)for(let t=0;t<c;++t,r+=y,i+=a)for(let t=0;t<h;++t,r+=w){let t=e[r];t!==n&&(n=z[1*P]=t,S[P]=P++),C[i++]=P}}S.subarray(0,P).sort((e,t)=>z[e]-z[t]);let T=-1;{let e=z[1*S[0]]+1>>>0;for(let t=0;t<P;++t){let n=S[t],r=z[1*n];if(r!==e){++T,e=A[1*T]=r}I[n+1]=T}++T}return o(l,a,s,b*v*_,T,A,C,I,1)}
/**
 * @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 b,v,_,w,y;function x(e,t,n,r,i,a,s,l){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],x=n[2];if(x-=g*c,g-=m*h,h*c*f==0)return[0,0];let k=u*d*p+31;(void 0===b||b.length<k)&&(b=new Uint32Array(k),v=new Uint32Array(2*k),_=new Uint32Array(2*k),w=new Uint32Array(k),y=new Uint32Array(k));const C=b.subarray(0,k);C.fill(0);const z=v,A=_,S=w,I=y;let P=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+=x,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*P]=t,r=z[2*P+1]=s,S[P]=P++),C[a++]=P}}S.subarray(0,P).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 T=-1;{let e=z[2*S[0]]+1>>>0,t=0;for(let n=0;n<P;++n){let r=S[n],i=2*r,a=z[i],s=z[i+1];if(a!==e||s!==t){++T;let n=2*T;e=A[n]=a,t=A[n+1]=s}I[r+1]=T}++T}return o(l,a,s,u*d*p,T,A,C,I,2)}
/**
 * @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 k=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 k.clear(),function(e,t,n,r,i=0,a=Object(c.a)(r,1)){h(e,t,n,r,i,a,g)}(k,n,e,t),{value:k.view}})),Object(s.registerAsyncComputation)(a,(async function(e,t,n){return k.clear(),function(e,t,n,r,i=0,a=Object(c.a)(r,2)){h(e,t,n,r,i,a,x)}(k,n,e,t),{value:k.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=/^[ \t]*#[ \t]+vtk[ \t]+DataFile[ \t]+Version[ \t]+([^\s]+)[ \t]*\n(.*)\n[ \t]*(ASCII|BINARY)[ \t]*\n[ \t]*DATASET[ \t]+([^ ]+)[ \t]*\n/,o=/^[ \t]*POINT_DATA[ \t]+([0-9]+)[ \t]*$/,l=/^[ \t]*POINTS[ \t]+([0-9]+)[ \t]+([^\s]+)[ \t]*$/,h=/^[ \t]*SCALARS[ \t]+([^\s]+)[ \t]+([^\s]+)(?:[ \t]+([0-9]+))?[ \t]*$/,c=/^[ \t]*LOOKUP_TABLE[ \t]+([^\s]+)[ \t]*$/,f=/^[ \t]*POLYGONS[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,u=/^[ \t]*3[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]*$/,d=/^[ \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 p{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 m(e){let t=e.vertexPositions.byteLength+e.indices.byteLength;for(const n of e.vertexAttributes)t+=n.data.byteLength;return t}const g=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,m=-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.");m=e,g=new Uint32Array(3*e);let a=0;for(let t=0;t<e;++t){let e=n[i++].match(u);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(c);if(null===l)throw new Error(`Expected LOOKUP_TABLE directive in ${JSON.stringify(o)}.`);let h=l[1];const f=v(`SCALARS(${e})`,a,s);b.push({name:e,data:f,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(d))++i;else if(e=t.match(h),null===e);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(d))++i;else if(e=t.match(l),null===e){if(e=t.match(f),null===e){if(e=t.match(o),null!==e){++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 p(e,a,s,m,g,b)}]]);var b=n(4);
/**
 * @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 v(e){let t;return t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),function(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return t.length>2&&31===t[0]&&139===t[1]}(t)?Object(b.inflate)(t):t}
/**
 * @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,1e3))).match(s);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},o=new Uint8Array(e.buffer,e.byteOffset+n,e.byteLength-n);if("ASCII"===i){const e=g.get(r);if(void 0===e)throw new Error(`VTK dataset type ${JSON.stringify(r)} is not supported.`);return e(a,o)}throw new Error(`VTK data format ${JSON.stringify(i)} is not supported.`)}(v(e));return{value:{data:t,size:m(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(11),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,a){let s,l=new r.JpegDecoder;if(l.parse(e),l.width*l.height!=t*n)throw new Error("JPEG data does not have the expected dimensions: "+`width=${l.width}, height=${l.height}, `+`expected width=${t}, expected height=${n}`);if(l.numComponents!==i)throw new Error("JPEG data does not have the expected number of components: "+`components=${l.numComponents}, expected=${i}`);if(1===l.numComponents)s=l.getData(l.width,l.height,!1);else{if(3!==l.numComponents)throw new Error(`JPEG data has an unsupported number of components: components=${l.numComponents}`);if(s=l.getData(l.width,l.height,!1),a){const e=t*n,r=new Uint8Array(e);for(let t=0;t<e;++t)r[t]=s[3*t];s=r}else s=Object(o.b)(s,l.width*l.height,3)}return{value:s,transfer:[s.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