(function(m){function l(){function l(a,b){"undefined"==typeof a&&(a={});for(var c in b)a[c]=b[c];return a}function m(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")}function n(a){var b={"3gp":"video/3gpp",aif:"audio/x-aiff",aifc:"audio/x-aiff",aiff:"audio/x-aiff",asf:"video/x-ms-asf",asr:"video/x-ms-asf",asx:"video/x-ms-asf",au:"audio/basic",avi:"video/x-msvideo",bin:"application/octet-stream",bmp:"image/bmp",c:"text/plain", "class":"application/octet-stream",cmx:"image/x-cmx",cod:"image/cis-cod",css:"text/css",exe:"application/octet-stream",flv:"video/x-flv",f4v:"video/x-flv",gif:"image/gif",gtar:"application/x-gtar",gz:"application/x-gzip",h:"text/plain",htm:"text/html",html:"text/html",ico:"image/x-icon",ief:"image/ief",jfif:"image/pipeg",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/x-javascript",lsf:"video/x-la-asf",lsx:"video/x-la-asf",m3u:"audio/x-mpegurl",m4v:"video/x-m4v",mid:"audio/mid", mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"video/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"video/mpeg",mpv2:"video/mpeg",mxf:"video/mxf",ogg:"audio/ogg",pbm:"image/x-portable-bitmap",pdf:"application/pdf",pgm:"image/x-portable-graymap",png:"image/png",ppm:"image/x-portable-pixmap",qt:"video/quicktime",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",ras:"image/x-cmu-raster",rgb:"image/x-rgb",rmi:"audio/mid",rtx:"text/richtext",sh:"application/x-sh", snd:"audio/basic",srt:"text/plain",stm:"text/html",svg:"image/svg+xml",swf:"application/x-shockwave-flash",tar:"application/x-tar",tex:"application/x-tex",tgz:"application/x-compressed",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",uls:"text/iuls",wav:"audio/x-wav",webm:"video/webm",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",z:"application/x-compress",zip:"application/zip"};a=a.name.split(".");a=2<=a.length?""==a[0]?"n/a": a[a.length-1]:"n/a";a&&(a=a.toLowerCase());return a in b?b[a]:"n/a"}function q(a){switch(n(a).split("/")[0]){case "video":return"VIDEO";case "audio":return"AUDIO";case "image":return"IMAGE";case "text":return"CAPTION";default:return"OTHER"}}var h=function(a){this.LIQUID_BASE_URL="//api.sambavideos.sambatech.com/v1";this.LIQUID_CREATE_MEDIA="/medias/widget";this.QUALIFIER_MAP={AUDIO:[],VIDEO:[]};this.ERROR_MAP={onCreateMedia:"Could not create media. Please try again",onUploadId:"Could not initialize the upload to our servers. Please try again", onPartSendEndAttemp:"Could not send the file to our servers. Please try again",onPartSend:"Could not send one of the file's part to our servers. Trying again in 5 seconds"};this.TIMEOUT=6E5;this.wEvents=k;this.options=l({maxConcurrentParts:5,retries:3,template:"bootstrap",progressIntervalMS:500},a);this.multipartSupported=!("undefined"==typeof File||"undefined"==typeof Blob||!(Blob.prototype.webkitSlice||Blob.prototype.mozSlice||Blob.prototype.slice));if(!0!==this.multipartSupported)return alert("Browser isn't supported. Please update to Chrome 15+ or Firefox 14+"), !1;this.wFiles=[];this.concurrentParts=0;this.mustCalculateConcurrentParts=!0;this._init()};h.prototype._init=function(){for(var a=document.getElementsByTagName("script"),b=a.length;b--;)null!==a[b].getAttribute("samba-upload-widget")&&this._appendWidget(a[b].parentNode);"bootstrap"===this.options.template&&this._events()};h.prototype._appendWidget=function(a){var b=this,c=document.createElement("div");c.innerHTML="bootstrap"===b.options.template?b._getBootstrapTemplate():b._getSimpleTemplate();a.appendChild(c); document.querySelector("#samba-upload").addEventListener("change",function(a){for(var c=a.target.files.length;c--;)b._add(a.target.files[c])})};h.prototype._getBootstrapTemplate=function(){return'
'};h.prototype._getSimpleTemplate=function(){return''}; h.prototype._events=function(){"bootstrap"===this.options.template&&(k.addEventListener("media_created",function(a){document.querySelector("div.samba-progress-container").innerHTML=document.querySelector("div.samba-progress-container").innerHTML+'