text: //>>built
  require({cache:{"url:epi/cms/widget/templates/MultipleFileUpload.html":"<div class=\"epi-multiFileUpload\">\r\n    <form method=\"post\" action=\"\" enctype=\"multipart/form-data\">\r\n        <div data-dojo-attach-point=\"breadcrumbBar\" data-dojo-type=\"epi.cms.widget.Breadcrumb\"></div>\r\n        <div data-dojo-attach-point=\"uploadToolbar\" class=\"epi-toolbar-unwrapped\">\r\n            <span title=\"${res.uploadform.addfiles}\" >\r\n                <input type=\"file\" multiple=\"true\" uploadOnSelect=\"true\" data-dojo-type=\"dojox.form.Uploader\" data-dojo-attach-point=\"uploaderInput\" \r\n                    data-dojo-props=\"iconClass:'epi-iconPlus', showLabel: false\" />\r\n            </span>\r\n            <div data-dojo-attach-point=\"toolbarDisableLayer\"></div>\r\n        </div>\r\n        <div data-dojo-attach-point=\"fileList\" data-dojo-type=\"epi.cms.widget.FileList\"></div>\r\n    </form>\r\n</div>"}});define("epi/cms/widget/MultipleFileUpload",["dojo/_base/declare","dojo/_base/lang","dojo/_base/connect","dojo/_base/array","dojo/dom-class","dojo/dom-geometry","dojo/dom-construct","dojo/dom-attr","dojo/dom-style","dojo/aspect","dojo/Evented","dijit/_Widget","dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin","dijit/Toolbar","dojox/form/Uploader","dojox/form/uploader/plugins/Flash","epi/routes","epi/shell/widget/dialog/Confirmation","epi/cms/widget/FileList","epi/cms/widget/UploadUtil","epi/cms/widget/Breadcrumb","epi/cms/widget/viewmodel/FileListViewModel","dojo/text!./templates/MultipleFileUpload.html","epi/i18n!epi/cms/nls/episerver.cms.widget.uploadmultiplefiles"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19){return _1("epi.cms.widget.MultipleFileUpload",[_c,_d,_e,_b],{res:_19,_isCompleted:true,_uploadStatus:[],templateString:_18,postCreate:function(){this.inherited(arguments);this._setupUploader();this._setupFileList();},upload:function(_1a){this._resetUploader();if(!_1a||_1a.length===0){return;}this.uploaderInput._files=_1a;this.uploaderInput.onChange([{uploadDirectory:this.get("uploadDirectory")}]);},close:function(){var _1b=_2.hitch(this,function(_1c){this.set("disableToolbar",false);this.emit("close",_1c);});if(this._isCompleted||this.uploaderInput.getFileList().length<=0){_1b(false);}else{var _1d=new _13({title:_19.confirmdialog.title,description:_19.confirmdialog.description,onAction:_2.hitch(this,function(_1e){if(_1e){_1b(true);}})});_1d.show();}},_setupUploader:function(){this._setupUploaderDefault();this._setupUploaderHTML5Plugin();this._setupUploaderFlashPlugin();},_setupUploaderDefault:function(){this.uploaderInput.uploadUrl=_12.getActionPath({moduleArea:"CMS",controller:"FileUpload",action:"Upload"});_a.before(this.uploaderInput,"onChange",_2.hitch(this,function(_1f){this._isCompleted=false;this.set("disableToolbar",true);return [[{uploadDirectory:this.get("uploadDirectory")}]];}));},_setupUploaderHTML5Plugin:function(){if(!_15.supportNativeDndFiles()){return;}this.uploaderInput.on("error",_2.hitch(this,function(err){if(err.statusCode===404){this.set("uploadStatus",_15.StatusScope.All,"",_19.uploadform.errormessage);this._onUploadComplete();}}));},_setupUploaderFlashPlugin:function(){if(_15.supportNativeDndFiles()){return;}this.uploaderInput.uploadOnSelect=false;this._setFlashUploaderSize();this._setFocusOnFlash();this.uploaderInput.on("error",_2.hitch(this,function(err){this.set("uploadStatus",_15.StatusScope.Single,err.target.name,_19.uploadform.errormessage);}));},_setFlashUploaderSize:function(){var _20=null;var _21=_a.before(this.uploaderInput,"_createInput",function(){_20=_2.clone(this.btnSize);this.btnSize.w+=10;this.btnSize.h+=10;_21.remove();});var _22=_a.after(this.uploaderInput,"_createInput",function(){this.btnSize=_20;_22.remove();});},_setFocusOnFlash:function(){_4.forEach(["focus","load"],function(_23){this.uploaderInput.on(_23,_2.hitch(this,function(){setTimeout(_2.hitch(this,function(){var swf=this.uploaderInput.flashMovie;if(swf){swf.focus();}return;}),1);}));},this);},_setupFileList:function(){this._fileListModel=new _17();this.fileList.set("model",this._fileListModel);this.uploaderInput.on("change",_2.hitch(this,function(){this._clearUploadStatus();var _24=this.uploaderInput.getFileList();if(_24&&_24.length>0){this._fileListModel.set("uploadFiles",_24);}}));this.uploaderInput.on("begin",_2.hitch(this,function(_25){if(_25&&_25.length>0){this._fileListModel.set("showProgressBar",true);}}));this.uploaderInput.on("progress",_2.hitch(this,function(_26){this._fileListModel.set("progress",_26);}));this.connect(this.uploaderInput,"reset",_2.hitch(this,function(){this._fileListModel.clear();}));this.uploaderInput.onComplete=_2.hitch(this,this._onUploadComplete);},_setUploadStatusAttr:function(_27,_28,_29){this._uploadStatus=_15.addStatus(this._uploadStatus,_27,_28,_29);},_getUploadStatusAttr:function(){return this._uploadStatus;},_setBreadcrumbAttr:function(_2a){this.breadcrumbBar._cleanUp();this.breadcrumbBar._availableWidth=_6.getContentBox(this.breadcrumbBar.domNode).w;var _2b=_2a?_2a.length:0;if(_2b>0){for(var i=0;i<_2b-1;i++){this.breadcrumbBar._createItem({name:_2a[i]},true);}this.breadcrumbBar._createItem({name:_2a[_2b-1]},false);}},_setDisableToolbarAttr:function(_2c){if(_15.supportNativeDndFiles()){this.uploaderInput.set("disabled",_2c);if(!_2c){this.uploaderInput.set("tabindex",0);}}else{_5.toggle(this.toolbarDisableLayer,"epi-uploadToolbarOverlay",_2c);_15.toggleVisibility(this.toolbarDisableLayer,_2c);if(this.uploaderInput.flashMovie){_2c===false?this.uploaderInput.flashMovie.focus():this.uploaderInput.flashMovie.blur();}if(_2c===true&&!this._toolbarSize){this._toolbarSize=_6.position(this.uploadToolbar);_9.set(this.toolbarDisableLayer,{width:this._toolbarSize.w+"px",height:this._toolbarSize.h+"px"});}}},_clearUploadStatus:function(){this._uploadStatus=[];},_clearUploadFiles:function(){this.uploaderInput._files=[];},_resetUploader:function(){this._fileListModel.set("showProgressBar",false);var _2d=_2.hitch(this,function(){this.uploaderInput.reset();});if(_15.supportNativeDndFiles()){_2d();return;}if(this.uploaderInput.flashMovie&&this.uploaderInput.flashMovie["reset"]){_2d();}},_onUploadComplete:function(evt){this._isCompleted=true;if(evt){if(_2.isArray(evt)){_4.forEach(evt,function(_2e){if(_2e.error!=="server timeout"){if(!_15.supportNativeDndFiles()&&_2e.additionalParams&&_2e.additionalParams.replaceChar){_15.setAltCommaChar(_2e.additionalParams.replaceChar);}this.set("uploadStatus",_2e.index?_15.StatusScope.Single:_15.StatusScope.All,(_2e.fileName||_2e.name),(_2e.errorMessage||_2e.error));}},this);}else{if((evt.isValid&&evt.isValid===false)&&(evt.saved&&evt.saved===false)){this.set("uploadStatus",_15.StatusScope.All,"",evt.error);}}}this._fileListModel.set("uploadStatus",this.get("uploadStatus"));this.set("disableToolbar",false);this._clearUploadFiles();this.emit("uploadComplete");}});});