10 lines
16 KiB
JavaScript
10 lines
16 KiB
JavaScript
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-20ce9dba"],{"0e5c":function(t,r,e){e.d(r,"a",(function(){return i}));var n=e("c7eb"),o=e("1da1"),u=(r=(e("fb6a"),e("b0c0"),e("d3b7"),e("8237")),e.n(r)),c=e("91b6"),i=function(t){var r,e,i,a,s,h=t.file,d=t.pieceSize,f=t.success,p=t.error,_=t.uploading;h&&(r="",e=1024*(void 0===d?2:d)*1024,i=Math.ceil(h.size/e),a=(()=>{var t=Object(o.a)(Object(n.a)().mark((function t(){var r,o;return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(r<i)return o=((t,r,e)=>(r*=e,e=Math.min(t.size,r+e),{start:r,end:e,chunk:t.slice(r,e)}))(h,r,e),o=o.chunk,t.next=7,s({chunk:o,currentChunk:r,chunkCount:i});t.next=10;break;case 7:r++,t.next=1;break;case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}})(),s=function(t){return new Promise((function(n,o){var u=new FormData;u.append("chunkNumber",t.currentChunk+1),u.append("chunkSize",e),u.append("currentChunkSize",t.chunk.size),u.append("file",t.chunk),u.append("filename",h.name),u.append("totalChunks",t.chunkCount),u.append("md5",r),Object(c.b)(u,{headers:{"Content-Type":"multipart/form-data"}}).then((function(r){1==r.data.code?(_(t.currentChunk+1,t.chunkCount),n(!0)):2!=r.data.code||t.currentChunk<t.chunkCount-1||t.currentChunk+1==t.chunkCount&&f(r.data)})).catch((function(t){p&&p(t)}))}))},(t=new FileReader).readAsBinaryString(h),t.addEventListener("load",(function(t){t=t.target.result,r=u()(t),a()})))}},"3c35":function(t,r){(function(r){t.exports=r}).call(this,{})},8237:function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;
|
||
|
/**
|
||
|
* [js-md5]{@link https://github.com/emn178/js-md5}
|
||
|
*
|
||
|
* @namespace md5
|
||
|
* @version 0.7.3
|
||
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||
|
* @copyright Chen, Yi-Cyuan 2014-2017
|
||
|
* @license MIT
|
||
|
*/!function(){var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{},WEB_WORKER=(root.JS_MD5_NO_WINDOW&&(WINDOW=!1),!WINDOW&&"object"==typeof self),NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node,COMMON_JS=(NODE_JS?root=global:WEB_WORKER&&(root=self),!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports),AMD=__webpack_require__("3c35"),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8,buffer,buffer8,blocks,createOutputMethod=(ARRAY_BUFFER&&(buffer=new ArrayBuffer(68),buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)),!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer}),function(t){return function(r){return new Md5(!0).update(r)[t]()}}),createMethod=function(){var t=createOutputMethod("hex");(t=NODE_JS?nodeWrap(t):t).create=function(){return new Md5},t.update=function(r){return t.create().update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var e=OUTPUT_TYPES[r];t[e]=createOutputMethod(e)}return t},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(t){if("string"==typeof t)return crypto.createHash("md5").update(t,"utf8").digest("hex");if(null==t)throw ERROR;return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash("md5").update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod};function Md5(t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8):ARRAY_BUFFER?(t=new ArrayBuffer(68),this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(t){if(!this.finalized){var r,e=typeof t;if("string"!=e){if("object"!=e)throw ERROR;if(null===t)throw ERROR;if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw ERROR;r=!0}for(var n,o,u=0,c=t.length,i=this.blocks,a=this.buffer8;u<c;){if(this.hashed&&(this.hashed=!1,i[0]=i[16],i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),r)if(ARRAY_BUFFER)for(o=this.start;u<c&&o<64;++u)a[o++]=t[u];else for(o=this.start;u<c&&o<64;++u)i[o>>2]|=t[u]<<SHIFT[3&o++];else if(ARRAY_BUFFER)for(o=this.start;u<c&&o<64;++u)(n=t.charCodeAt(u))<128?a[o++]=n:(n<2048?a[o++]=192|n>>6:(n<55296||57344<=n?a[o++]=224|n>>12:(n=65536+((1023&n)<<10|1023&t.charCodeAt(++u)),a[o++]=240|n>>18,a[o++]=128|n>>12&63),a[o++]=128|n>>6&63),a[o++]=128|63&n);else for(o=this.start;u<c&&o<64;++u)(n=t.charCodeAt(u))<128?i[o>>2]|=n<<SHIFT[3&o++]:(n<2048?i[o>>2]|=(192|n>>6)<<SHIFT[3&o++]:(n<55296||57344<=n?i[o>>2]|=(224|n>>12)<<SHIFT[3&o++]:(n=65536+((1023&n)<<10|1023&t.charCodeAt(++u)),i[o>>2]|=(240|n>>18)<<SHIFT[3&o++],i[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++]),i[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++]),i[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,64<=o?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return 4294967295<this.bytes&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){var t,r;this.finalized||(this.finalized=!0,(t=this.blocks)[(r=this.lastByteI
|