-
Notifications
You must be signed in to change notification settings - Fork 0
/
2.app.bundle.js
2 lines (2 loc) · 10 KB
/
2.app.bundle.js
1
2
(this.webpackJsonp=this.webpackJsonp||[]).push([[2],{484:function(e,n,t){"use strict";function r(e,n){let t=e.length-n,r=0;do{for(let t=n;t>0;t--)e[r+n]+=e[r],r++;t-=n}while(t>0)}function s(e,n,t){let r=0,s=e.length;const o=s/t;for(;s>n;){for(let t=n;t>0;--t)e[r+n]+=e[r],++r;s-=n}const a=e.slice();for(let n=0;n<o;++n)for(let r=0;r<t;++r)e[t*n+r]=a[(t-r-1)*o+n]}t.d(n,"a",(function(){return o}));class o{async decode(e,n){const t=await this.decodeBlock(n),o=e.Predictor||1;if(1!==o){const n=!e.StripOffsets;return function(e,n,t,o,a,i){if(!n||1===n)return e;for(let e=0;e<a.length;++e){if(a[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(a[e]!==a[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const c=a[0]/8,l=2===i?1:a.length;for(let i=0;i<o&&!(i*l*t*c>=e.byteLength);++i){let o;if(2===n){switch(a[0]){case 8:o=new Uint8Array(e,i*l*t*c,l*t*c);break;case 16:o=new Uint16Array(e,i*l*t*c,l*t*c/2);break;case 32:o=new Uint32Array(e,i*l*t*c,l*t*c/4);break;default:throw new Error(`Predictor 2 not allowed with ${a[0]} bits per sample.`)}r(o,l)}else 3===n&&(o=new Uint8Array(e,i*l*t*c,l*t*c),s(o,l,c))}return e}(t,o,n?e.TileWidth:e.ImageWidth,n?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return t}}},489:function(e,n,t){"use strict";t.r(n),t.d(n,"default",(function(){return l}));var r=t(484);const s=new Int32Array([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 o(e,n){let t=0;const r=[];let s=16;for(;s>0&&!e[s-1];)--s;r.push({children:[],index:0});let o,a=r[0];for(let i=0;i<s;i++){for(let s=0;s<e[i];s++){for(a=r.pop(),a.children[a.index]=n[t];a.index>0;)a=r.pop();for(a.index++,r.push(a);r.length<=i;)r.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o;t++}i+1<s&&(r.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o)}return r[0].children}function a(e,n,t,r,o,a,i,c,l){const{mcusPerLine:f,progressive:h}=t,u=n;let d=n,m=0,p=0;function b(){if(p>0)return p--,m>>p&1;if(m=e[d++],255===m){const n=e[d++];if(n)throw new Error("unexpected marker: "+(m<<8|n).toString(16))}return p=7,m>>>7}function w(e){let n,t=e;for(;null!==(n=b());){if(t=t[n],"number"==typeof t)return t;if("object"!=typeof t)throw new Error("invalid huffman sequence")}return null}function k(e){let n=e,t=0;for(;n>0;){const e=b();if(null===e)return;t=t<<1|e,--n}return t}function g(e){const n=k(e);return n>=1<<e-1?n:n+(-1<<e)+1}let y=0;let P,T=0;function A(e,n,t,r,s){const o=t%f,a=(t/f|0)*e.v+r,i=o*e.h+s;n(e,e.blocks[a][i])}function C(e,n,t){const r=t/e.blocksPerLine|0,s=t%e.blocksPerLine;n(e,e.blocks[r][s])}const v=r.length;let x,L,E,I,U,D;D=h?0===a?0===c?function(e,n){const t=w(e.huffmanTableDC),r=0===t?0:g(t)<<l;e.pred+=r,n[0]=e.pred}:function(e,n){n[0]|=b()<<l}:0===c?function(e,n){if(y>0)return void y--;let t=a;const r=i;for(;t<=r;){const r=w(e.huffmanTableAC),o=15&r,a=r>>4;if(0===o){if(a<15){y=k(a)+(1<<a)-1;break}t+=16}else{t+=a;n[s[t]]=g(o)*(1<<l),t++}}}:function(e,n){let t=a;const r=i;let o=0;for(;t<=r;){const r=s[t],a=n[r]<0?-1:1;switch(T){case 0:{const n=w(e.huffmanTableAC),t=15&n;if(o=n>>4,0===t)o<15?(y=k(o)+(1<<o),T=4):(o=16,T=1);else{if(1!==t)throw new Error("invalid ACn encoding");P=g(t),T=o?2:3}continue}case 1:case 2:n[r]?n[r]+=(b()<<l)*a:(o--,0===o&&(T=2===T?3:0));break;case 3:n[r]?n[r]+=(b()<<l)*a:(n[r]=P<<l,T=0);break;case 4:n[r]&&(n[r]+=(b()<<l)*a)}t++}4===T&&(y--,0===y&&(T=0))}:function(e,n){const t=w(e.huffmanTableDC),r=0===t?0:g(t);e.pred+=r,n[0]=e.pred;let o=1;for(;o<64;){const t=w(e.huffmanTableAC),r=15&t,a=t>>4;if(0===r){if(a<15)break;o+=16}else{o+=a;n[s[o]]=g(r),o++}}};let q,z,O=0;z=1===v?r[0].blocksPerLine*r[0].blocksPerColumn:f*t.mcusPerColumn;const M=o||z;for(;O<z;){for(L=0;L<v;L++)r[L].pred=0;if(y=0,1===v)for(x=r[0],U=0;U<M;U++)C(x,D,O),O++;else for(U=0;U<M;U++){for(L=0;L<v;L++){x=r[L];const{h:e,v:n}=x;for(E=0;E<n;E++)for(I=0;I<e;I++)A(x,D,O,E,I)}if(O++,O===z)break}if(p=0,q=e[d]<<8|e[d+1],q<65280)throw new Error("marker was not found");if(!(q>=65488&&q<=65495))break;d+=2}return d-u}function i(e,n){const t=[],{blocksPerLine:r,blocksPerColumn:s}=n,o=r<<3,a=new Int32Array(64),i=new Uint8Array(64);function c(e,t,r){const s=n.quantizationTable;let o,a,i,c,l,f,h,u,d;const m=r;let p;for(p=0;p<64;p++)m[p]=e[p]*s[p];for(p=0;p<8;++p){const e=8*p;0!==m[1+e]||0!==m[2+e]||0!==m[3+e]||0!==m[4+e]||0!==m[5+e]||0!==m[6+e]||0!==m[7+e]?(o=5793*m[0+e]+128>>8,a=5793*m[4+e]+128>>8,i=m[2+e],c=m[6+e],l=2896*(m[1+e]-m[7+e])+128>>8,u=2896*(m[1+e]+m[7+e])+128>>8,f=m[3+e]<<4,h=m[5+e]<<4,d=o-a+1>>1,o=o+a+1>>1,a=d,d=3784*i+1567*c+128>>8,i=1567*i-3784*c+128>>8,c=d,d=l-h+1>>1,l=l+h+1>>1,h=d,d=u+f+1>>1,f=u-f+1>>1,u=d,d=o-c+1>>1,o=o+c+1>>1,c=d,d=a-i+1>>1,a=a+i+1>>1,i=d,d=2276*l+3406*u+2048>>12,l=3406*l-2276*u+2048>>12,u=d,d=799*f+4017*h+2048>>12,f=4017*f-799*h+2048>>12,h=d,m[0+e]=o+u,m[7+e]=o-u,m[1+e]=a+h,m[6+e]=a-h,m[2+e]=i+f,m[5+e]=i-f,m[3+e]=c+l,m[4+e]=c-l):(d=5793*m[0+e]+512>>10,m[0+e]=d,m[1+e]=d,m[2+e]=d,m[3+e]=d,m[4+e]=d,m[5+e]=d,m[6+e]=d,m[7+e]=d)}for(p=0;p<8;++p){const e=p;0!==m[8+e]||0!==m[16+e]||0!==m[24+e]||0!==m[32+e]||0!==m[40+e]||0!==m[48+e]||0!==m[56+e]?(o=5793*m[0+e]+2048>>12,a=5793*m[32+e]+2048>>12,i=m[16+e],c=m[48+e],l=2896*(m[8+e]-m[56+e])+2048>>12,u=2896*(m[8+e]+m[56+e])+2048>>12,f=m[24+e],h=m[40+e],d=o-a+1>>1,o=o+a+1>>1,a=d,d=3784*i+1567*c+2048>>12,i=1567*i-3784*c+2048>>12,c=d,d=l-h+1>>1,l=l+h+1>>1,h=d,d=u+f+1>>1,f=u-f+1>>1,u=d,d=o-c+1>>1,o=o+c+1>>1,c=d,d=a-i+1>>1,a=a+i+1>>1,i=d,d=2276*l+3406*u+2048>>12,l=3406*l-2276*u+2048>>12,u=d,d=799*f+4017*h+2048>>12,f=4017*f-799*h+2048>>12,h=d,m[0+e]=o+u,m[56+e]=o-u,m[8+e]=a+h,m[48+e]=a-h,m[16+e]=i+f,m[40+e]=i-f,m[24+e]=c+l,m[32+e]=c-l):(d=5793*r[p+0]+8192>>14,m[0+e]=d,m[8+e]=d,m[16+e]=d,m[24+e]=d,m[32+e]=d,m[40+e]=d,m[48+e]=d,m[56+e]=d)}for(p=0;p<64;++p){const e=128+(m[p]+8>>4);t[p]=e<0?0:e>255?255:e}}for(let e=0;e<s;e++){const s=e<<3;for(let e=0;e<8;e++)t.push(new Uint8Array(o));for(let o=0;o<r;o++){c(n.blocks[e][o],i,a);let r=0;const l=o<<3;for(let e=0;e<8;e++){const n=t[s+e];for(let e=0;e<8;e++)n[l+e]=i[r++]}}}return t}class c{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let n=0;function t(){const t=e[n]<<8|e[n+1];return n+=2,t}function r(){const r=t(),s=e.subarray(n,n+r-2);return n+=s.length,s}function i(e){let n,t,r=0,s=0;for(t in e.components)e.components.hasOwnProperty(t)&&(n=e.components[t],r<n.h&&(r=n.h),s<n.v&&(s=n.v));const o=Math.ceil(e.samplesPerLine/8/r),a=Math.ceil(e.scanLines/8/s);for(t in e.components)if(e.components.hasOwnProperty(t)){n=e.components[t];const i=Math.ceil(Math.ceil(e.samplesPerLine/8)*n.h/r),c=Math.ceil(Math.ceil(e.scanLines/8)*n.v/s),l=o*n.h,f=a*n.v,h=[];for(let e=0;e<f;e++){const e=[];for(let n=0;n<l;n++)e.push(new Int32Array(64));h.push(e)}n.blocksPerLine=i,n.blocksPerColumn=c,n.blocks=h}e.maxH=r,e.maxV=s,e.mcusPerLine=o,e.mcusPerColumn=a}let c=t();if(65496!==c)throw new Error("SOI not found");for(c=t();65497!==c;){switch(c){case 65280:break;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:{const e=r();65504===c&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(this.jfif={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),65518===c&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&0===e[5]&&(this.adobe={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{const r=t()+n-2;for(;n<r;){const r=e[n++],o=new Int32Array(64);if(r>>4==0)for(let t=0;t<64;t++){o[s[t]]=e[n++]}else{if(r>>4!=1)throw new Error("DQT: invalid table spec");for(let e=0;e<64;e++){o[s[e]]=t()}}this.quantizationTables[15&r]=o}break}case 65472:case 65473:case 65474:{t();const r={extended:65473===c,progressive:65474===c,precision:e[n++],scanLines:t(),samplesPerLine:t(),components:{},componentsOrder:[]},s=e[n++];let o;for(let t=0;t<s;t++){o=e[n];const t=e[n+1]>>4,s=15&e[n+1],a=e[n+2];r.componentsOrder.push(o),r.components[o]={h:t,v:s,quantizationIdx:a},n+=3}i(r),this.frames.push(r);break}case 65476:{const r=t();for(let t=2;t<r;){const r=e[n++],s=new Uint8Array(16);let a=0;for(let t=0;t<16;t++,n++)s[t]=e[n],a+=s[t];const i=new Uint8Array(a);for(let t=0;t<a;t++,n++)i[t]=e[n];t+=17+a,r>>4==0?this.huffmanTablesDC[15&r]=o(s,i):this.huffmanTablesAC[15&r]=o(s,i)}break}case 65501:t(),this.resetInterval=t();break;case 65498:{t();const r=e[n++],s=[],o=this.frames[0];for(let t=0;t<r;t++){const t=o.components[e[n++]],r=e[n++];t.huffmanTableDC=this.huffmanTablesDC[r>>4],t.huffmanTableAC=this.huffmanTablesAC[15&r],s.push(t)}const i=e[n++],c=e[n++],l=e[n++],f=a(e,n,o,s,this.resetInterval,i,c,l>>4,15&l);n+=f;break}case 65535:255!==e[n]&&n--;break;default:if(255===e[n-3]&&e[n-2]>=192&&e[n-2]<=254){n-=3;break}throw new Error("unknown JPEG marker "+c.toString(16))}c=t()}}getResult(){const{frames:e}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let e=0;e<this.frames.length;e++){const n=this.frames[e].components;for(const e of Object.keys(n))n[e].quantizationTable=this.quantizationTables[n[e].quantizationIdx],delete n[e].quantizationIdx}const n=e[0],{components:t,componentsOrder:r}=n,s=[],o=n.samplesPerLine,a=n.scanLines;for(let e=0;e<r.length;e++){const o=t[r[e]];s.push({lines:i(0,o),scaleX:o.h/n.maxH,scaleY:o.v/n.maxV})}const c=new Uint8Array(o*a*s.length);let l=0;for(let e=0;e<a;++e)for(let n=0;n<o;++n)for(let t=0;t<s.length;++t){const r=s[t];c[l]=r.lines[0|e*r.scaleY][0|n*r.scaleX],++l}return c}}class l extends r.a{constructor(e){super(),this.reader=new c,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}}}]);
//# sourceMappingURL=2.app.bundle.js.map