(("undefined"!==typeof self?self:this)["webpackJsonpxmgissupermaptemplate"]=("undefined"!==typeof self?self:this)["webpackJsonpxmgissupermaptemplate"]||[]).push([[3],{"852f":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return u}));var r=n("b3f7");const o=9,i=256,s=257,l=12;function f(e,t,n){const r=t%8,o=Math.floor(t/8),i=8-r,l=t+n-8*(o+1);let f=8*(o+2)-(t+n);const c=8*(o+2)-t;if(f=Math.max(0,f),o>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),s;let a=e[o]&2**(8-r)-1;a<<=n-i;let u=a;if(o+1<e.length){let t=e[o+1]>>>f;t<<=Math.max(0,n-c),u+=t}if(l>8&&o+2<e.length){const r=8*(o+3)-(t+n),i=e[o+2]>>>r;u+=i}return u}function c(e,t){for(let n=t.length-1;n>=0;n--)e.push(t[n]);return e}function a(e){const t=new Uint16Array(4093),n=new Uint8Array(4093);for(let o=0;o<=257;o++)t[o]=4096,n[o]=o;let r=258,a=o,u=0;function h(){r=258,a=o}function d(e){const t=f(e,u,a);return u+=a,t}function w(e,o){return n[r]=o,t[r]=e,r++,r-1}function p(e){const r=[];for(let o=e;4096!==o;o=t[o])r.push(n[o]);return r}const g=[];h();const m=new Uint8Array(e);let b,y=d(m);while(y!==s){if(y===i){h(),y=d(m);while(y===i)y=d(m);if(y===s)break;if(y>i)throw new Error("corrupted code at scanline "+y);{const e=p(y);c(g,e),b=y}}else if(y<r){const e=p(y);c(g,e),w(b,e[e.length-1]),b=y}else{const e=p(b);if(!e)throw new Error(`Bogus entry. Not in dictionary, ${b} / ${r}, position: ${u}`);c(g,e),g.push(e[e.length-1]),w(b,e[e.length-1]),b=y}r+1>=2**a&&(a===l?b=void 0:a++),y=d(m)}return new Uint8Array(g)}class u extends r["a"]{decodeBlock(e){return a(e,!1).buffer}}},b3f7:function(e,t,n){"use strict";function r(e,t){let n=e.length-t,r=0;do{for(let n=t;n>0;n--)e[r+t]+=e[r],r++;n-=t}while(n>0)}function o(e,t,n){let r=0,o=e.length;const i=o/n;while(o>t){for(let n=t;n>0;--n)e[r+t]+=e[r],++r;o-=t}const s=e.slice();for(let l=0;l<i;++l)for(let t=0;t<n;++t)e[n*l+t]=s[(n-t-1)*i+l]}function i(e,t,n,i,s,l){if(!t||1===t)return e;for(let r=0;r<s.length;++r){if(s[r]%8!==0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(s[r]!==s[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const f=s[0]/8,c=2===l?1:s.length;for(let a=0;a<i;++a){if(a*c*n*f>=e.byteLength)break;let i;if(2===t){switch(s[0]){case 8:i=new Uint8Array(e,a*c*n*f,c*n*f);break;case 16:i=new Uint16Array(e,a*c*n*f,c*n*f/2);break;case 32:i=new Uint32Array(e,a*c*n*f,c*n*f/4);break;default:throw new Error(`Predictor 2 not allowed with ${s[0]} bits per sample.`)}r(i,c,f)}else 3===t&&(i=new Uint8Array(e,a*c*n*f,c*n*f),o(i,c,f))}return e}n.d(t,"a",(function(){return s}));class s{async decode(e,t){const n=await this.decodeBlock(t),r=e.Predictor||1;if(1!==r){const t=!e.StripOffsets,o=t?e.TileWidth:e.ImageWidth,s=t?e.TileLength:e.RowsPerStrip||e.ImageLength;return i(n,r,o,s,e.BitsPerSample,e.PlanarConfiguration)}return n}}}}]);
//# sourceMappingURL=xmgissupermaptemplate.umd.min.3.js.map