(function(root,factory){var modules={},_require=function(deps,callback){var args,len,i;if(typeof deps==='string'){return getModule(deps)}else{args=[];for(len=deps.length,i=0;i1024){size=size/1024}return(unit==='B'?size:size.toFixed(pointLength||2))+unit}}});define('mediator',['base'],function(Base){var $=Base.$,slice=[].slice,separator=/\s+/,protos;function findHandlers(arr,name,callback,context){return $.grep(arr,function(handler){return handler&&(!name||handler.e===name)&&(!callback||handler.cb===callback||handler.cb._cb===callback)&&(!context||handler.ctx===context)})}function eachEvent(events,callback,iterator){$.each((events||'').split(separator),function(_,key){iterator(key,callback)})}function triggerHanders(events,args){var stoped=false,i=-1,len=events.length,handler;while(++i1){if($.isPlainObject(val)&&$.isPlainObject(opts[key])){$.extend(opts[key],val)}else{opts[key]=val}}else{return key?opts[key]:opts}},getStats:function(){var stats=this.request('get-stats');return stats?{successNum:stats.numOfSuccess,progressNum:stats.numOfProgress,cancelNum:stats.numOfCancel,invalidNum:stats.numOfInvalid,uploadFailNum:stats.numOfUploadFailed,queueNum:stats.numOfQueue,interruptNum:stats.numOfInterrupt}:{}},trigger:function(type){var args=[].slice.call(arguments,1),opts=this.options,name='on'+type.substring(0,1).toUpperCase()+type.substring(1);if(Mediator.trigger.apply(this,arguments)===false||$.isFunction(opts[name])&&opts[name].apply(this,args)===false||$.isFunction(this[name])&&this[name].apply(this,args)===false||Mediator.trigger.apply(Mediator,[this,type].concat(args))===false){return false}return true},destroy:function(){this.request('destroy',arguments);this.off()},request:Base.noop});Base.create=Uploader.create=function(opts){return new Uploader(opts)};Base.Uploader=Uploader;return Uploader});define('runtime/runtime',['base','mediator'],function(Base,Mediator){var $=Base.$,factories={},getFirstKey=function(obj){for(var key in obj){if(obj.hasOwnProperty(key)){return key}}return null};function Runtime(options){this.options=$.extend({container:document.body},options);this.uid=Base.guid('rt_')}$.extend(Runtime.prototype,{getContainer:function(){var opts=this.options,parent,container;if(this._container){return this._container}parent=$(opts.container||document.body);container=$(document.createElement('div'));container.attr('id','rt_'+this.uid);container.css({position:'absolute',top:'0px',left:'0px',width:'1px',height:'1px',overflow:'hidden'});parent.append(container);parent.addClass('webuploader-container');this._container=container;this._parent=parent;return container},init:Base.noop,exec:Base.noop,destroy:function(){this._container&&this._container.remove();this._parent&&this._parent.removeClass('webuploader-container');this.off()}});Runtime.orders='html5,flash';Runtime.addRuntime=function(type,factory){factories[type]=factory};Runtime.hasRuntime=function(type){return!!(type?factories[type]:getFirstKey(factories))};Runtime.create=function(opts,orders){var type,runtime;orders=orders||Runtime.orders;$.each(orders.split(/\s*,\s*/g),function(){if(factories[this]){type=this;return false}});type=type||getFirstKey(factories);if(!type){throw new Error('Runtime Error');}runtime=new factories[type](opts);return runtime};Mediator.installTo(Runtime.prototype);return Runtime});define('runtime/client',['base','mediator','runtime/runtime'],function(Base,Mediator,Runtime){var cache;cache=(function(){var obj={};return{add:function(runtime){obj[runtime.uid]=runtime},get:function(ruid,standalone){var i;if(ruid){return obj[ruid]}for(i in obj){if(standalone&&obj[i].__standalone){continue}return obj[i]}return null},remove:function(runtime){delete obj[runtime.uid]}}})();function RuntimeClient(component,standalone){var deferred=Base.Deferred(),runtime;this.uid=Base.guid('client_');this.runtimeReady=function(cb){return deferred.done(cb)};this.connectRuntime=function(opts,cb){if(runtime){throw new Error('already connected!');}deferred.done(cb);if(typeof opts==='string'&&cache.get(opts)){runtime=cache.get(opts)}runtime=runtime||cache.get(null,standalone);if(!runtime){runtime=Runtime.create(opts,opts.runtimeOrder);runtime.__promise=deferred.promise();runtime.once('ready',deferred.resolve);runtime.init();cache.add(runtime);runtime.__client=1}else{Base.$.extend(runtime.options,opts);runtime.__promise.then(deferred.resolve);runtime.__client++}standalone&&(runtime.__standalone=standalone);return runtime};this.getRuntime=function(){return runtime};this.disconnectRuntime=function(){if(!runtime){return}runtime.__client--;if(runtime.__client<=0){cache.remove(runtime);delete runtime.__promise;runtime.destroy()}runtime=null};this.exec=function(){if(!runtime){return}var args=Base.slice(arguments);component&&args.unshift(component);return runtime.exec.apply(this,args)};this.getRuid=function(){return runtime&&runtime.uid};this.destroy=(function(destroy){return function(){destroy&&destroy.apply(this,arguments);this.trigger('destroy');this.off();this.exec('destroy');this.disconnectRuntime()}})(this.destroy)}Mediator.installTo(RuntimeClient.prototype);return RuntimeClient});define('lib/dnd',['base','mediator','runtime/client'],function(Base,Mediator,RuntimeClent){var $=Base.$;function DragAndDrop(opts){opts=this.options=$.extend({},DragAndDrop.options,opts);opts.container=$(opts.container);if(!opts.container.length){return}RuntimeClent.call(this,'DragAndDrop')}DragAndDrop.options={accept:null,disableGlobalDnd:false};Base.inherits(RuntimeClent,{constructor:DragAndDrop,init:function(){var me=this;me.connectRuntime(me.options,function(){me.exec('init');me.trigger('ready')})}});Mediator.installTo(DragAndDrop.prototype);return DragAndDrop});define('widgets/widget',['base','uploader'],function(Base,Uploader){var $=Base.$,_init=Uploader.prototype._init,_destroy=Uploader.prototype.destroy,IGNORE={},widgetClass=[];function isArrayLike(obj){if(!obj){return false}var length=obj.length,type=$.type(obj);if(obj.nodeType===1&&length){return true}return type==='array'||type!=='function'&&type!=='string'&&(length===0||typeof length==='number'&&length>0&&(length-1)in obj)}function Widget(uploader){this.owner=uploader;this.options=uploader.options}$.extend(Widget.prototype,{init:Base.noop,invoke:function(apiName,args){var map=this.responseMap;if(!map||!(apiName in map)||!(map[apiName]in this)||!$.isFunction(this[map[apiName]])){return IGNORE}return this[map[apiName]].apply(this,args)},request:function(){return this.owner.request.apply(this.owner,arguments)}});$.extend(Uploader.prototype,{_init:function(){var me=this,widgets=me._widgets=[],deactives=me.options.disableWidgets||'';$.each(widgetClass,function(_,klass){(!deactives||!~deactives.indexOf(klass._name))&&widgets.push(new klass(me))});return _init.apply(me,arguments)},request:function(apiName,args,callback){var i=0,widgets=this._widgets,len=widgets&&widgets.length,rlts=[],dfds=[],widget,rlt,promise,key;args=isArrayLike(args)?args:[args];for(;i0){width=file._info.width*width}if(height<=1&&height>0){height=file._info.height*height}image.resize(width,height)});image.once('complete',function(){cb(false,image.getAsDataUrl(opts.type));image.destroy()});image.once('error',function(reason){cb(reason||true);image.destroy()});throttle(image,file.source.size,function(){file._info&&image.info(file._info);file._meta&&image.meta(file._meta);image.loadFromBlob(file.source)})},beforeSendFile:function(file){var opts=this.options.compress||this.options.resize,compressSize=opts&&opts.compressSize||0,noCompressIfLarger=opts&&opts.noCompressIfLarger||false,image,deferred;file=this.request('get-file',file);if(!opts||!~'image/jpeg,image/jpg'.indexOf(file.type)||file.size0){width=file._info.width*width}if(height<=1&&height>0){height=file._info.height*height}image.resize(width,height)});image.once('complete',function(){var blob,size;try{blob=image.getAsBlob(opts.type);size=file.size;if(!noCompressIfLarger||blob.size=0;i--){if(this._queue[i]==file){this._queue.splice(i,1);break}}},_onFileStatusChange:function(curStatus,preStatus){var stats=this.stats;switch(preStatus){case STATUS.PROGRESS:stats.numOfProgress--;break;case STATUS.QUEUED:stats.numOfQueue--;break;case STATUS.ERROR:stats.numOfUploadFailed--;break;case STATUS.INVALID:stats.numOfInvalid--;break;case STATUS.INTERRUPT:stats.numOfInterrupt--;break}switch(curStatus){case STATUS.QUEUED:stats.numOfQueue++;break;case STATUS.PROGRESS:stats.numOfProgress++;break;case STATUS.ERROR:stats.numOfUploadFailed++;break;case STATUS.COMPLETE:stats.numOfSuccess++;break;case STATUS.CANCELLED:stats.numOfCancel++;break;case STATUS.INVALID:stats.numOfInvalid++;break;case STATUS.INTERRUPT:stats.numOfInterrupt++;break}}});Mediator.installTo(Queue.prototype);return Queue});define('widgets/queue',['base','uploader','queue','file','lib/file','runtime/client','widgets/widget'],function(Base,Uploader,Queue,WUFile,File,RuntimeClient){var $=Base.$,rExt=/\.\w+$/,Status=WUFile.Status;return Uploader.register({name:'queue',init:function(opts){var me=this,deferred,len,i,item,arr,accept,runtime;if($.isPlainObject(opts.accept)){opts.accept=[opts.accept]}if(opts.accept){arr=[];for(i=0,len=opts.accept.length;i1&&~'http,abort,server'.indexOf(type.replace(/-.*/,''))&&block.retried1&&$.extend(data,{chunks:block.chunks,chunk:block.chunk});owner.trigger('uploadBeforeSend',block,data,headers);tr.appendBlob(opts.fileVal,block.blob,file.name);tr.append(data);tr.setRequestHeader(headers);tr.send()},_finishFile:function(file,ret,hds){var owner=this.owner;return owner.request('after-send-file',arguments,function(){file.setStatus(Status.COMPLETE);owner.trigger('uploadSuccess',file,ret,hds)}).fail(function(reason){if(file.getStatus()===Status.PROGRESS){file.setStatus(Status.ERROR,reason)}owner.trigger('uploadError',file,reason)}).always(function(){owner.trigger('uploadComplete',file)})},updateFileProgress:function(file){var totalPercent=0,uploaded=0;if(!file.blocks){return}$.each(file.blocks,function(_,v){uploaded+=(v.percentage||0)*(v.end-v.start)});totalPercent=uploaded/file.size;this.owner.trigger('uploadProgress',file,totalPercent||0)},destroy:function(){clearTimeout(this.retryTimer)}})});define('widgets/validator',['base','uploader','file','widgets/widget'],function(Base,Uploader,WUFile){var $=Base.$,validators={},api;api={addValidator:function(type,cb){validators[type]=cb},removeValidator:function(type){delete validators[type]}};Uploader.register({name:'validator',init:function(){var me=this;Base.nextTick(function(){$.each(validators,function(){this.call(me.owner)})})}});api.addValidator('fileNumLimit',function(){var uploader=this,opts=uploader.options,count=0,max=parseInt(opts.fileNumLimit,10),flag=true;if(!max){return}uploader.on('beforeFileQueued',function(file){if(!this.trigger('beforeFileQueuedCheckfileNumLimit',file,count)){return false}if(count>=max&&flag){flag=false;this.trigger('error','Q_EXCEED_NUM_LIMIT',max,file);setTimeout(function(){flag=true},1)}return count>=max?false:true});uploader.on('fileQueued',function(){count++});uploader.on('fileDequeued',function(){count--});uploader.on('reset',function(){count=0})});api.addValidator('fileSizeLimit',function(){var uploader=this,opts=uploader.options,count=0,max=parseInt(opts.fileSizeLimit,10),flag=true;if(!max){return}uploader.on('beforeFileQueued',function(file){var invalid=count+file.size>max;if(invalid&&flag){flag=false;this.trigger('error','Q_EXCEED_SIZE_LIMIT',max,file);setTimeout(function(){flag=true},1)}return invalid?false:true});uploader.on('fileQueued',function(file){count+=file.size});uploader.on('fileDequeued',function(file){count-=file.size});uploader.on('reset',function(){count=0})});api.addValidator('fileSingleSizeLimit',function(){var uploader=this,opts=uploader.options,max=opts.fileSingleSizeLimit;if(!max){return}uploader.on('beforeFileQueued',function(file){if(file.size>max){file.setStatus(WUFile.Status.INVALID,'exceed_size');this.trigger('error','F_EXCEED_SIZE',max,file);return false}})});api.addValidator('duplicate',function(){var uploader=this,opts=uploader.options,mapping={};if(opts.duplicate){return}function hashString(str){var hash=0,i=0,len=str.length,_char;for(;i0){arr=[];for(i=0,len=opts.accept.length;i=0xffe0&&markerBytes<=0xffef||markerBytes===0xfffe){markerLength=dataview.getUint16(offset+2)+2;if(offset+markerLength>dataview.byteLength){break}parsers=api.parsers[markerBytes];if(!noParse&&parsers){for(i=0;i6){if(buffer.slice){ret.imageHead=buffer.slice(2,headLength)}else{ret.imageHead=new Uint8Array(buffer).subarray(2,headLength)}}}return ret},updateImageHead:function(buffer,head){var data=this._parse(buffer,true),buf1,buf2,bodyoffset;bodyoffset=2;if(data.imageHead){bodyoffset=2+data.imageHead.byteLength}if(buffer.slice){buf2=buffer.slice(bodyoffset)}else{buf2=new Uint8Array(buffer).subarray(bodyoffset)}buf1=new Uint8Array(head.byteLength+2+buf2.byteLength);buf1[0]=0xFF;buf1[1]=0xD8;buf1.set(new Uint8Array(head),2);buf1.set(new Uint8Array(buf2),head.byteLength+2);return buf1.buffer}};Util.parseMeta=function(){return api.parse.apply(api,arguments)};Util.updateImageHead=function(){return api.updateImageHead.apply(api,arguments)};return api});define('runtime/html5/imagemeta/exif',['base','runtime/html5/imagemeta'],function(Base,ImageMeta){var EXIF={};EXIF.ExifMap=function(){return this};EXIF.ExifMap.prototype.map={'Orientation':0x0112};EXIF.ExifMap.prototype.get=function(id){return this[id]||this[this.map[id]]};EXIF.exifTagTypes={1:{getValue:function(dataView,dataOffset){return dataView.getUint8(dataOffset)},size:1},2:{getValue:function(dataView,dataOffset){return String.fromCharCode(dataView.getUint8(dataOffset))},size:1,ascii:true},3:{getValue:function(dataView,dataOffset,littleEndian){return dataView.getUint16(dataOffset,littleEndian)},size:2},4:{getValue:function(dataView,dataOffset,littleEndian){return dataView.getUint32(dataOffset,littleEndian)},size:4},5:{getValue:function(dataView,dataOffset,littleEndian){return dataView.getUint32(dataOffset,littleEndian)/dataView.getUint32(dataOffset+4,littleEndian)},size:8},9:{getValue:function(dataView,dataOffset,littleEndian){return dataView.getInt32(dataOffset,littleEndian)},size:4},10:{getValue:function(dataView,dataOffset,littleEndian){return dataView.getInt32(dataOffset,littleEndian)/dataView.getInt32(dataOffset+4,littleEndian)},size:8}};EXIF.exifTagTypes[7]=EXIF.exifTagTypes[1];EXIF.getExifValue=function(dataView,tiffOffset,offset,type,length,littleEndian){var tagType=EXIF.exifTagTypes[type],tagSize,dataOffset,values,i,str,c;if(!tagType){Base.log('Invalid Exif data: Invalid tag type.');return}tagSize=tagType.size*length;dataOffset=tagSize>4?tiffOffset+dataView.getUint32(offset+8,littleEndian):(offset+8);if(dataOffset+tagSize>dataView.byteLength){Base.log('Invalid Exif data: Invalid data offset.');return}if(length===1){return tagType.getValue(dataView,dataOffset,littleEndian)}values=[];for(i=0;idataView.byteLength){Base.log('Invalid Exif data: Invalid directory offset.');return}tagsNumber=dataView.getUint16(dirOffset,littleEndian);dirEndOffset=dirOffset+2+12*tagsNumber;if(dirEndOffset+4>dataView.byteLength){Base.log('Invalid Exif data: Invalid directory size.');return}for(i=0;idataView.byteLength){Base.log('Invalid Exif data: Invalid segment size.');return}if(dataView.getUint16(offset+8)!==0x0000){Base.log('Invalid Exif data: Missing byte alignment offset.');return}switch(dataView.getUint16(tiffOffset)){case 0x4949:littleEndian=true;break;case 0x4D4D:littleEndian=false;break;default:Base.log('Invalid Exif data: Invalid byte alignment marker.');return}if(dataView.getUint16(tiffOffset+2,littleEndian)!==0x002A){Base.log('Invalid Exif data: Missing TIFF marker.');return}dirOffset=dataView.getUint32(tiffOffset+4,littleEndian);data.exif=new EXIF.ExifMap();dirOffset=EXIF.parseExifTags(dataView,tiffOffset,tiffOffset+dirOffset,littleEndian,data)};ImageMeta.parsers[0xffe1].push(EXIF.parseExifData);return EXIF});define('runtime/html5/image',['base','runtime/html5/runtime','runtime/html5/util'],function(Base,Html5Runtime,Util){var BLANK='data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D';return Html5Runtime.register('Image',{modified:false,init:function(){var me=this,img=new Image();img.onload=function(){me._info={type:me.type,width:this.width,height:this.height};if(!me._metas&&'image/jpeg'===me.type){Util.parseMeta(me._blob,function(error,ret){me._metas=ret;me.owner.trigger('load')})}else{me.owner.trigger('load')}};img.onerror=function(){me.owner.trigger('error')};me._img=img},loadFromBlob:function(blob){var me=this,img=me._img;me._blob=blob;me.type=blob.type;img.src=Util.createObjectURL(blob.getSource());me.owner.once('load',function(){Util.revokeObjectURL(img.src)})},resize:function(width,height){var canvas=this._canvas||(this._canvas=document.createElement('canvas'));this._resize(this._img,canvas,width,height);this._blob=null;this.modified=true;this.owner.trigger('complete','resize')},crop:function(x,y,w,h,s){var cvs=this._canvas||(this._canvas=document.createElement('canvas')),opts=this.options,img=this._img,iw=img.naturalWidth,ih=img.naturalHeight,orientation=this.getOrientation();s=s||1;cvs.width=w;cvs.height=h;opts.preserveHeaders||this._rotate2Orientaion(cvs,orientation);this._renderImageToCanvas(cvs,img,-x,-y,iw*s,ih*s);this._blob=null;this.modified=true;this.owner.trigger('complete','crop')},getAsBlob:function(type){var blob=this._blob,opts=this.options,canvas;type=type||this.type;if(this.modified||this.type!==type){canvas=this._canvas;if(type==='image/jpeg'){blob=Util.canvasToDataUrl(canvas,type,opts.quality);if(opts.preserveHeaders&&this._metas&&this._metas.imageHead){blob=Util.dataURL2ArrayBuffer(blob);blob=Util.updateImageHead(blob,this._metas.imageHead);blob=Util.arrayBufferToBlob(blob,type);return blob}}else{blob=Util.canvasToDataUrl(canvas,type)}blob=Util.dataURL2Blob(blob)}return blob},getAsDataUrl:function(type){var opts=this.options;type=type||this.type;if(type==='image/jpeg'){return Util.canvasToDataUrl(this._canvas,type,opts.quality)}else{return this._canvas.toDataURL(type)}},getOrientation:function(){return this._metas&&this._metas.exif&&this._metas.exif.get('Orientation')||1},info:function(val){if(val){this._info=val;return this}return this._info},meta:function(val){if(val){this._metas=val;return this}return this._metas},destroy:function(){var canvas=this._canvas;this._img.onload=null;if(canvas){canvas.getContext('2d').clearRect(0,0,canvas.width,canvas.height);canvas.width=canvas.height=0;this._canvas=null}this._img.src=BLANK;this._img=this._blob=null},_resize:function(img,cvs,width,height){var opts=this.options,naturalWidth=img.width,naturalHeight=img.height,orientation=this.getOrientation(),scale,w,h,x,y;if(~[5,6,7,8].indexOf(orientation)){width^=height;height^=width;width^=height}scale=Math[opts.crop?'max':'min'](width/naturalWidth,height/naturalHeight);opts.allowMagnify||(scale=Math.min(1,scale));w=naturalWidth*scale;h=naturalHeight*scale;if(opts.crop){cvs.width=width;cvs.height=height}else{cvs.width=w;cvs.height=h}x=(cvs.width-w)/2;y=(cvs.height-h)/2;opts.preserveHeaders||this._rotate2Orientaion(cvs,orientation);this._renderImageToCanvas(cvs,img,x,y,w,h)},_rotate2Orientaion:function(canvas,orientation){var width=canvas.width,height=canvas.height,ctx=canvas.getContext('2d');switch(orientation){case 5:case 6:case 7:case 8:canvas.width=height;canvas.height=width;break}switch(orientation){case 2:ctx.translate(width,0);ctx.scale(-1,1);break;case 3:ctx.translate(width,height);ctx.rotate(Math.PI);break;case 4:ctx.translate(0,height);ctx.scale(1,-1);break;case 5:ctx.rotate(0.5*Math.PI);ctx.scale(1,-1);break;case 6:ctx.rotate(0.5*Math.PI);ctx.translate(0,-height);break;case 7:ctx.rotate(0.5*Math.PI);ctx.translate(width,-height);ctx.scale(-1,1);break;case 8:ctx.rotate(-0.5*Math.PI);ctx.translate(-width,0);break}},_renderImageToCanvas:(function(){if(!Base.os.ios){return function(canvas){var args=Base.slice(arguments,1),ctx=canvas.getContext('2d');ctx.drawImage.apply(ctx,args)}}function detectVerticalSquash(img,iw,ih){var canvas=document.createElement('canvas'),ctx=canvas.getContext('2d'),sy=0,ey=ih,py=ih,data,alpha,ratio;canvas.width=1;canvas.height=ih;ctx.drawImage(img,0,0);data=ctx.getImageData(0,0,1,ih).data;while(py>sy){alpha=data[(py-1)*4+3];if(alpha===0){ey=py}else{sy=py}py=(ey+sy)>>1}ratio=(py/ih);return(ratio===0)?1:ratio}if(Base.os.ios>=7){return function(canvas,img,x,y,w,h){var iw=img.naturalWidth,ih=img.naturalHeight,vertSquashRatio=detectVerticalSquash(img,iw,ih);return canvas.getContext('2d').drawImage(img,0,0,iw*vertSquashRatio,ih*vertSquashRatio,x,y,w,h)}}function detectSubsampling(img){var iw=img.naturalWidth,ih=img.naturalHeight,canvas,ctx;if(iw*ih>1024*1024){canvas=document.createElement('canvas');canvas.width=canvas.height=1;ctx=canvas.getContext('2d');ctx.drawImage(img,-iw+1,0);return ctx.getImageData(0,0,1,1).data[3]===0}else{return false}}return function(canvas,img,x,y,width,height){var iw=img.naturalWidth,ih=img.naturalHeight,ctx=canvas.getContext('2d'),subsampled=detectSubsampling(img),doSquash=this.type==='image/jpeg',d=1024,sy=0,dy=0,tmpCanvas,tmpCtx,vertSquashRatio,dw,dh,sx,dx;if(subsampled){iw/=2;ih/=2}ctx.save();tmpCanvas=document.createElement('canvas');tmpCanvas.width=tmpCanvas.height=d;tmpCtx=tmpCanvas.getContext('2d');vertSquashRatio=doSquash?detectVerticalSquash(img,iw,ih):1;dw=Math.ceil(d*width/iw);dh=Math.ceil(d*height/ih/vertSquashRatio);while(sy=200&&xhr.status<300){me._response=xhr.responseText;me._headers=me._parseHeader(xhr.getAllResponseHeaders());return me.trigger('load')}else if(xhr.status>=500&&xhr.status<600){me._response=xhr.responseText;me._headers=me._parseHeader(xhr.getAllResponseHeaders());return me.trigger('error','server'+status)}return me.trigger('error',me._status?'http'+status:'abort')};me._xhr=xhr;return xhr},_setRequestHeader:function(xhr,headers){$.each(headers,function(key,val){xhr.setRequestHeader(key,val)})},_parseJson:function(str){var json;try{json=JSON.parse(str)}catch(ex){json={}}return json}})});define('preset/html5only',['base','widgets/filednd','widgets/filepaste','widgets/filepicker','widgets/image','widgets/queue','widgets/runtime','widgets/upload','widgets/validator','runtime/html5/blob','runtime/html5/dnd','runtime/html5/filepaste','runtime/html5/filepicker','runtime/html5/imagemeta/exif','runtime/html5/image','runtime/html5/transport'],function(Base){return Base});define('webuploader',['preset/html5only'],function(preset){return preset});return require('webuploader')});