mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-15 15:16:29 +01:00
44db7e4f6f
On further investigation, Plupload changed it’s license to a non-GPL compatible license. The newest, GPL compatible version is being used already in Core. Unprops desrosj. See #48277. Built from https://develop.svn.wordpress.org/trunk@46638 git-svn-id: http://core.svn.wordpress.org/trunk@46438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
86 KiB
JavaScript
1 line
86 KiB
JavaScript
var MXI_DEBUG=!1;!function(a,v){"use strict";var s={};function e(e,t,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(t===v)throw"invalid module definition, dependencies must be specified";if(i===v)throw"invalid module definition, definition function must be specified";!function(e,t){for(var i,n=[],r=0;r<e.length;++r){if(!(i=s[e[r]]||o(e[r])))throw"module definition dependecy not found: "+e[r];n.push(i)}t.apply(null,n)}(t,function(){s[e]=i.apply(null,arguments)})}function o(e){for(var t=a,i=e.split(/[.\/]/),n=0;n<i.length;++n){if(!t[i[n]])return;t=t[i[n]]}return t}e("moxie/core/utils/Basic",[],function(){function o(e){return void 0===e?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()}var n,r=function(i){return s(arguments,function(e,t){0<t&&s(e,function(e,t){void 0!==e&&(o(i[t])===o(e)&&~a(o(e),["array","object"])?r(i[t],e):i[t]=e)})}),i},s=function(e,t){var i,n,r;if(e)if("number"===o(e.length)){for(r=0,i=e.length;r<i;r++)if(!1===t(e[r],r))return}else if("object"===o(e))for(n in e)if(e.hasOwnProperty(n)&&!1===t(e[n],n))return},a=function(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i}return-1};return{guid:(n=0,function(e){var t,i=(new Date).getTime().toString(32);for(t=0;t<5;t++)i+=Math.floor(65535*Math.random()).toString(32);return(e||"o_")+i+(n++).toString(32)}),typeOf:o,extend:r,each:s,isEmptyObj:function(e){var t;if(!e||"object"!==o(e))return!0;for(t in e)return!1;return!0},inSeries:function(e,n){var r=e.length;"function"!==o(n)&&(n=function(){}),e&&e.length||n(),function t(i){"function"===o(e[i])&&e[i](function(e){++i<r&&!e?t(i):n(e)})}(0)},inParallel:function(e,n){var r=0,o=e.length,a=new Array(o);s(e,function(e,i){e(function(e){if(e)return n(e);var t=[].slice.call(arguments);t.shift(),a[i]=t,++r===o&&(a.unshift(null),n.apply(this,a))})})},inArray:a,arrayDiff:function(e,t){var i=[];for(var n in"array"!==o(e)&&(e=[e]),"array"!==o(t)&&(t=[t]),e)-1===a(e[n],t)&&i.push(e[n]);return!!i.length&&i},arrayIntersect:function(e,t){var i=[];return s(e,function(e){-1!==a(e,t)&&i.push(e)}),i.length?i:null},toArray:function(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i},trim:function(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e},sprintf:function(e){var t=[].slice.call(arguments,1);return e.replace(/%[a-z]/g,function(){var e=t.shift();return"undefined"!==o(e)?e:""})},parseSizeStr:function(e){if("string"!=typeof e)return e;var t,i={t:1099511627776,g:1073741824,m:1048576,k:1024};return t=(e=/^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g,"")))[2],e=+e[1],i.hasOwnProperty(t)&&(e*=i[t]),Math.floor(e)}}}),e("moxie/core/utils/Env",["moxie/core/utils/Basic"],function(n){var d,h,m,e,t,r,i,o,a,s=(h="function",m="object",r=function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},a={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[e="name",t="version"],[/\s(opr)\/([\w\.]+)/i],[[e,"Opera"],t],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[e,t],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[e,"IE"],t],[/(edge)\/((\d+)?[\w\.]+)/i],[e,t],[/(yabrowser)\/([\w\.]+)/i],[[e,"Yandex"],t],[/(comodo_dragon)\/([\w\.]+)/i],[[e,/_/g," "],t],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[e,t],[/(dolfin)\/([\w\.]+)/i],[[e,"Dolphin"],t],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[e,"Chrome"],t],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[t,[e,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[t,[e,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[t,[e,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[t,[e,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[t,e],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[e,[t,(i={rgx:function(){for(var e,t,i,n,r,o,a,s=0,u=arguments;s<u.length;s+=2){var c=u[s],l=u[s+1];if(void 0===e)for(n in e={},l)typeof(r=l[n])==m?e[r[0]]=d:e[r]=d;for(t=i=0;t<c.length;t++)if(o=c[t].exec(this.getUA())){for(n=0;n<l.length;n++)a=o[++i],typeof(r=l[n])==m&&0<r.length?2==r.length?typeof r[1]==h?e[r[0]]=r[1].call(this,a):e[r[0]]=r[1]:3==r.length?typeof r[1]!=h||r[1].exec&&r[1].test?e[r[0]]=a?a.replace(r[1],r[2]):d:e[r[0]]=a?r[1].call(this,a,r[2]):d:4==r.length&&(e[r[0]]=a?r[3].call(this,a.replace(r[1],r[2])):d):e[r]=a||d;break}if(o)break}return e},str:function(e,t){for(var i in t)if(typeof t[i]==m&&0<t[i].length){for(var n=0;n<t[i].length;n++)if(r(t[i][n],e))return"?"===i?d:i}else if(r(t[i],e))return"?"===i?d:i;return e}}).str,(o={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}}).browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[e,t],[/(navigator|netscape)\/([\w\.-]+)/i],[[e,"Netscape"],t],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[e,t]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[t,[e,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[e,t],[/rv\:([\w\.]+).*(gecko)/i],[t,e]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[e,t],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[e,[t,i.str,o.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[e,"Windows"],[t,i.str,o.os.windows.version]],[/\((bb)(10);/i],[[e,"BlackBerry"],t],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[e,t],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[e,"Symbian"],t],[/\((series40);/i],[e],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[e,"Firefox OS"],t],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[e,t],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[e,"Chromium OS"],t],[/(sunos)\s?([\w\.]+\d)*/i],[[e,"Solaris"],t],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[e,t],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[e,"iOS"],[t,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[e,"Mac OS"],[t,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[e,t]]},function(e){var t=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:"");this.getBrowser=function(){return i.rgx.apply(this,a.browser)},this.getEngine=function(){return i.rgx.apply(this,a.engine)},this.getOS=function(){return i.rgx.apply(this,a.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return t},this.setUA=function(e){return t=e,this},this.setUA(t)});var u,c,l,f=(l={define_property:!1,create_canvas:(c=document.createElement("canvas"),!(!c.getContext||!c.getContext("2d"))),return_response_type:function(e){try{if(-1!==n.inArray(e,["","text","document"]))return!0;if(window.XMLHttpRequest){var t=new XMLHttpRequest;if(t.open("get","/"),"responseType"in t)return t.responseType=e,t.responseType===e}}catch(e){}return!1},use_data_uri:(u=new Image,u.onload=function(){l.use_data_uri=1===u.width&&1===u.height},setTimeout(function(){u.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1),use_data_uri_over32kb:function(){return l.use_data_uri&&("IE"!==g.browser||9<=g.version)},use_data_uri_of:function(e){return l.use_data_uri&&e<33e3||l.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}},function(e){var t=[].slice.call(arguments);return t.shift(),"function"===n.typeOf(l[e])?l[e].apply(this,t):!!l[e]}),p=(new s).getResult(),g={can:f,uaParser:s,browser:p.browser.name,version:p.browser.version,os:p.os.name,osVersion:p.os.version,verComp:function(e,t,i){function n(e){return(e=(e=(""+e).replace(/[_\-+]/g,".")).replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".")).length?e.split("."):[-8]}function r(e){return e?isNaN(e)?u[e]||-7:parseInt(e,10):0}var o,a=0,s=0,u={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1};for(e=n(e),t=n(t),o=Math.max(e.length,t.length),a=0;a<o;a++)if(e[a]!=t[a]){if(e[a]=r(e[a]),t[a]=r(t[a]),e[a]<t[a]){s=-1;break}if(e[a]>t[a]){s=1;break}}if(!i)return s;switch(i){case">":case"gt":return 0<s;case">=":case"ge":return 0<=s;case"<=":case"le":return s<=0;case"==":case"=":case"eq":return 0===s;case"<>":case"!=":case"ne":return 0!==s;case"":case"<":case"lt":return s<0;default:return null}},global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return g.OS=g.os,MXI_DEBUG&&(g.debug={runtime:!0,events:!1},g.log=function(){var e,t=arguments[0];if("string"===n.typeOf(t)&&(t=n.sprintf.apply(this,arguments)),window&&window.console&&window.console.log)window.console.log(t);else if(document){var i=document.getElementById("moxie-console");i||((i=document.createElement("pre")).id="moxie-console",document.body.appendChild(i)),-1!==n.inArray(n.typeOf(t),["object","array"])?(e=t,i.appendChild(document.createTextNode(e+"\n"))):i.appendChild(document.createTextNode(t+"\n"))}}),g}),e("moxie/core/I18n",["moxie/core/utils/Basic"],function(i){var t={};return{addI18n:function(e){return i.extend(t,e)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(e){var t=[].slice.call(arguments,1);return e.replace(/%[a-z]/g,function(){var e=t.shift();return"undefined"!==i.typeOf(e)?e:""})}}}),e("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(s,n){var e={mimes:{},extensions:{},addMimeType:function(e){var t,i,n,r=e.split(/,/);for(t=0;t<r.length;t+=2){for(n=r[t+1].split(/ /),i=0;i<n.length;i++)this.mimes[n[i]]=r[t];this.extensions[r[t]]=n}},extList2mimes:function(e,t){var i,n,r,o,a=[];for(n=0;n<e.length;n++)for(i=e[n].extensions.split(/\s*,\s*/),r=0;r<i.length;r++){if("*"===i[r])return[];if((o=this.mimes[i[r]])&&-1===s.inArray(o,a)&&a.push(o),t&&/^\w+$/.test(i[r]))a.push("."+i[r]);else if(!o)return[]}return a},mimes2exts:function(e){var n=this,r=[];return s.each(e,function(e){if("*"===e)return!(r=[]);var i=e.match(/^(\w+)\/(\*|\w+)$/);i&&("*"===i[2]?s.each(n.extensions,function(e,t){new RegExp("^"+i[1]+"/").test(t)&&[].push.apply(r,n.extensions[t])}):n.extensions[e]&&[].push.apply(r,n.extensions[e]))}),r},mimes2extList:function(e){var t=[],i=[];return"string"===s.typeOf(e)&&(e=s.trim(e).split(/\s*,\s*/)),i=this.mimes2exts(e),t.push({title:n.translate("Files"),extensions:i.length?i.join(","):"*"}),t.mimes=e,t},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return e.addMimeType("application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe"),e}),e("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(c){function i(e,t){return!!e.className&&new RegExp("(^|\\s+)"+t+"(\\s+|$)").test(e.className)}return{get:function(e){return"string"!=typeof e?e:document.getElementById(e)},hasClass:i,addClass:function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},removeClass:function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},getStyle:function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},getPos:function(e,t){var i,n,r,o=0,a=0,s=document;function u(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}if(e=e,t=t||s.body,e&&e.getBoundingClientRect&&"IE"===c.browser&&(!s.documentMode||s.documentMode<8))return n=u(e),r=u(t),{x:n.x-r.x,y:n.y-r.y};for(i=e;i&&i!=t&&i.nodeType;)o+=i.offsetLeft||0,a+=i.offsetTop||0,i=i.offsetParent;for(i=e.parentNode;i&&i!=t&&i.nodeType;)o-=i.scrollLeft||0,a-=i.scrollTop||0,i=i.parentNode;return{x:o,y:a}},getSize:function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}}}}),e("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:(s={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4},e.extend(d,s),d.prototype=Error.prototype,d),OperationNotAllowedException:(e.extend(l,{NOT_ALLOWED_ERR:1}),l.prototype=Error.prototype,l),ImageError:(a={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3},e.extend(c,a),c.prototype=Error.prototype,c),FileException:(o={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8},e.extend(u,o),u.prototype=Error.prototype,u),DOMException:(r={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},e.extend(n,r),n.prototype=Error.prototype,n),EventException:(e.extend(i,{UNSPECIFIED_EVENT_TYPE_ERR:0}),i.prototype=Error.prototype,i)};function i(e){this.code=e,this.name="EventException"}function n(e){this.code=e,this.name=t(r,e),this.message=this.name+": DOMException "+this.code}var r,o,a,s;function u(e){this.code=e,this.name=t(o,e),this.message=this.name+": FileException "+this.code}function c(e){this.code=e,this.name=t(a,e),this.message=this.name+": ImageError "+this.code}function l(e){this.code=e,this.name="OperationNotAllowedException"}function d(e){this.code=e,this.name=t(s,e),this.message=this.name+": RuntimeError "+this.code}}),e("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(l,d,h){function e(){var c={};h.extend(this,{uid:null,init:function(){this.uid||(this.uid=h.guid("uid_"))},addEventListener:function(e,t,i,n){var r,o=this;this.hasOwnProperty("uid")||(this.uid=h.guid("uid_")),e=h.trim(e),/\s/.test(e)?h.each(e.split(/\s+/),function(e){o.addEventListener(e,t,i,n)}):(e=e.toLowerCase(),i=parseInt(i,10)||0,(r=c[this.uid]&&c[this.uid][e]||[]).push({fn:t,priority:i,scope:n||this}),c[this.uid]||(c[this.uid]={}),c[this.uid][e]=r)},hasEventListener:function(e){var t=e?c[this.uid]&&c[this.uid][e]:c[this.uid];return t||!1},removeEventListener:function(e,t){e=e.toLowerCase();var i,n=c[this.uid]&&c[this.uid][e];if(n){if(t){for(i=n.length-1;0<=i;i--)if(n[i].fn===t){n.splice(i,1);break}}else n=[];n.length||(delete c[this.uid][e],h.isEmptyObj(c[this.uid])&&delete c[this.uid])}},removeAllEventListeners:function(){c[this.uid]&&delete c[this.uid]},dispatchEvent:function(e){var t,i,n,r,o,a={},s=!0;if("string"!==h.typeOf(e)){if(r=e,"string"!==h.typeOf(r.type))throw new d.EventException(d.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=r.type,void 0!==r.total&&void 0!==r.loaded&&(a.total=r.total,a.loaded=r.loaded),a.async=r.async||!1}if(-1!==e.indexOf("::")?(o=e.split("::"),t=o[0],e=o[1]):t=this.uid,e=e.toLowerCase(),i=c[t]&&c[t][e]){i.sort(function(e,t){return t.priority-e.priority}),(n=[].slice.call(arguments)).shift(),a.type=e,n.unshift(a),MXI_DEBUG&&l.debug.events&&l.log("Event '%s' fired on %u",a.type,t);var u=[];h.each(i,function(t){n[0].target=t.scope,a.async?u.push(function(e){setTimeout(function(){e(!1===t.fn.apply(t.scope,n))},1)}):u.push(function(e){e(!1===t.fn.apply(t.scope,n))})}),u.length&&h.inSeries(u,function(e){s=!e})}return s},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===h.typeOf(this[t])&&this[t].apply(this,arguments)}),h.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===h.typeOf(t[e])&&(t[e]=null)})}})}return e.instance=new e,e}),e("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(l,d,h,i){var n={},m={};function f(e,t,r,i,n){var o,a,s=this,u=d.guid(t+"_"),c=n||"browser";e=e||{},m[u]=this,r=d.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},r),e.preferred_caps&&(c=f.getMode(i,e.preferred_caps,c)),MXI_DEBUG&&l.debug.runtime&&l.log("\tdefault mode: %s",c),a={},o={exec:function(e,t,i,n){if(o[t]&&(a[e]||(a[e]={context:this,instance:new o[t]}),a[e].instance[i]))return a[e].instance[i].apply(this,n)},removeInstance:function(e){delete a[e]},removeAllInstances:function(){var i=this;d.each(a,function(e,t){"function"===d.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(t)})}},d.extend(this,{initialized:!1,uid:u,type:t,mode:f.getMode(i,e.required_caps,c),shimid:u+"_container",clients:0,options:e,can:function(e,t){var i=arguments[2]||r;if("string"===d.typeOf(e)&&"undefined"===d.typeOf(t)&&(e=f.parseCaps(e)),"object"!==d.typeOf(e))return"function"===d.typeOf(i[e])?i[e].call(this,t):t===i[e];for(var n in e)if(!this.can(n,e[n],i))return!1;return!0},getShimContainer:function(){var e,t=h.get(this.shimid);return t||(e=this.options.container?h.get(this.options.container):document.body,(t=document.createElement("div")).id=this.shimid,t.className="moxie-shim moxie-shim-"+this.type,d.extend(t.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(t),e=null),t},getShim:function(){return o},shimExec:function(e,t){var i=[].slice.call(arguments,2);return s.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return s[e]&&s[e][t]?s[e][t].apply(this,i):s.shimExec.apply(this,arguments)},destroy:function(){if(s){var e=h.get(this.shimid);e&&e.parentNode.removeChild(e),o&&o.removeAllInstances(),this.unbindAll(),delete m[this.uid],this.uid=null,u=s=o=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}return f.order="html5,html4",f.getRuntime=function(e){return!!m[e]&&m[e]},f.addConstructor=function(e,t){t.prototype=i.instance,n[e]=t},f.getConstructor=function(e){return n[e]||null},f.getInfo=function(e){var t=f.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},f.parseCaps=function(e){var t={};return"string"!==d.typeOf(e)?e||{}:(d.each(e.split(","),function(e){t[e]=!0}),t)},f.can=function(e,t){var i,n,r=f.getConstructor(e);return!!r&&(n=(i=new r({required_caps:t})).mode,i.destroy(),!!n)},f.thatCan=function(e,t){var i=(t||f.order).split(/\s*,\s*/);for(var n in i)if(f.can(i[n],e))return i[n];return null},f.getMode=function(n,e,t){var r=null;if("undefined"===d.typeOf(t)&&(t="browser"),e&&!d.isEmptyObj(n)){if(d.each(e,function(e,t){if(n.hasOwnProperty(t)){var i=n[t](e);if("string"==typeof i&&(i=[i]),r){if(!(r=d.arrayIntersect(r,i)))return MXI_DEBUG&&l.debug.runtime&&l.log("\t\t%c: %v (conflicting mode requested: %s)",t,e,i),r=!1}else r=i}MXI_DEBUG&&l.debug.runtime&&l.log("\t\t%c: %v (compatible modes: %s)",t,e,r)}),r)return-1!==d.inArray(t,r)?t:r[0];if(!1===r)return!1}return t},f.capTrue=function(){return!0},f.capFalse=function(){return!1},f.capTest=function(e){return function(){return!!e}},f}),e("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(s,u,t,c){return function(){var a;t.extend(this,{connectRuntime:function(r){var e,o=this;if("string"===t.typeOf(r)?e=r:"string"===t.typeOf(r.ruid)&&(e=r.ruid),e){if(a=c.getRuntime(e))return a.clients++,a;throw new u.RuntimeError(u.RuntimeError.NOT_INIT_ERR)}!function e(t){var i,n;if(!t.length)return o.trigger("RuntimeError",new u.RuntimeError(u.RuntimeError.NOT_INIT_ERR)),void(a=null);i=t.shift().toLowerCase(),(n=c.getConstructor(i))?(MXI_DEBUG&&s.debug.runtime&&(s.log("Trying runtime: %s",i),s.log(r)),(a=new n(r)).bind("Init",function(){a.initialized=!0,MXI_DEBUG&&s.debug.runtime&&s.log("Runtime '%s' initialized",a.type),setTimeout(function(){a.clients++,o.trigger("RuntimeInit",a)},1)}),a.bind("Error",function(){MXI_DEBUG&&s.debug.runtime&&s.log("Runtime '%s' failed to initialize",a.type),a.destroy(),e(t)}),MXI_DEBUG&&s.debug.runtime&&s.log("\tselected mode: %s",a.mode),a.mode?a.init():a.trigger("Error")):e(t)}((r.runtime_order||c.order).split(/\s*,\s*/))},disconnectRuntime:function(){a&&--a.clients<=0&&a.destroy(),a=null},getRuntime:function(){return a&&a.uid?a:a=null},exec:function(){return a?a.exec.apply(this,arguments):null}})}}),e("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(a,r,s,u,c,e,l,d,h){var m=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];function t(o){MXI_DEBUG&&r.log("Instantiating FileInput...");var e,t,i,n=this;if(-1!==a.inArray(a.typeOf(o),["string","node"])&&(o={browse_button:o}),!(t=u.get(o.browse_button)))throw new c.DOMException(c.DOMException.NOT_FOUND_ERR);i={accept:[{title:l.translate("All Files"),extensions:"*"}],name:"file",multiple:!1,required_caps:!1,container:t.parentNode||document.body},"string"==typeof(o=a.extend({},i,o)).required_caps&&(o.required_caps=d.parseCaps(o.required_caps)),"string"==typeof o.accept&&(o.accept=s.mimes2extList(o.accept)),e=(e=u.get(o.container))||document.body,"static"===u.getStyle(e,"position")&&(e.style.position="relative"),e=t=null,h.call(n),a.extend(n,{uid:a.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){n.bind("RuntimeInit",function(e,r){n.ruid=r.uid,n.shimid=r.shimid,n.bind("Ready",function(){n.trigger("Refresh")},999),n.bind("Refresh",function(){var e,t,i,n;i=u.get(o.browse_button),n=u.get(r.shimid),i&&(e=u.getPos(i,u.get(o.container)),t=u.getSize(i),n&&a.extend(n.style,{top:e.y+"px",left:e.x+"px",width:t.w+"px",height:t.h+"px"})),n=i=null}),r.exec.call(n,"FileInput","init",o)}),n.connectRuntime(a.extend({},o,{required_caps:{select_file:!0}}))},disable:function(e){var t=this.getRuntime();t&&t.exec.call(this,"FileInput","disable","undefined"===a.typeOf(e)||e)},refresh:function(){n.trigger("Refresh")},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===a.typeOf(this.files)&&a.each(this.files,function(e){e.destroy()}),this.files=null,this.unbindAll()}}),this.handleEventProps(m)}return t.prototype=e.instance,t}),e("moxie/core/utils/Encode",[],function(){function m(e){return unescape(encodeURIComponent(e))}function f(e){return decodeURIComponent(escape(e))}return{utf8_encode:m,utf8_decode:f,atob:function(e,t){if("function"==typeof window.atob)return t?f(window.atob(e)):window.atob(e);var i,n,r,o,a,s,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,d=0,h=[];if(!e)return e;for(e+="";i=(s=c.indexOf(e.charAt(l++))<<18|c.indexOf(e.charAt(l++))<<12|(o=c.indexOf(e.charAt(l++)))<<6|(a=c.indexOf(e.charAt(l++))))>>16&255,n=s>>8&255,r=255&s,h[d++]=64==o?String.fromCharCode(i):64==a?String.fromCharCode(i,n):String.fromCharCode(i,n,r),l<e.length;);return u=h.join(""),t?f(u):u},btoa:function(e,t){if(t&&(e=m(e)),"function"==typeof window.btoa)return window.btoa(e);var i,n,r,o,a,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=0,c=0,l="",d=[];if(!e)return e;for(;i=(a=e.charCodeAt(u++)<<16|e.charCodeAt(u++)<<8|e.charCodeAt(u++))>>18&63,n=a>>12&63,r=a>>6&63,o=63&a,d[c++]=s.charAt(i)+s.charAt(n)+s.charAt(r)+s.charAt(o),u<e.length;);l=d.join("");var h=e.length%3;return(h?l.slice(0,h-3):l)+"===".slice(h||3)}}}),e("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(a,i,n){var s={};return function o(e,t){n.call(this),e&&this.connectRuntime(e),t?"string"===a.typeOf(t)&&(t={data:t}):t={},a.extend(this,{uid:t.uid||a.guid("uid_"),ruid:e,size:t.size||0,type:t.type||"",slice:function(e,t,i){return this.isDetached()?function(e,t,i){var n,r=s[this.uid];return"string"===a.typeOf(r)&&r.length?((n=new o(null,{type:i,size:t-e})).detach(r.substr(e,n.size)),n):null}.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return s[this.uid]?s[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),"data:"==(e=e||"").substr(0,5)){var t=e.indexOf(";base64,");this.type=e.substring(5,t),e=i.atob(e.substring(t+8))}this.size=e.length,s[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===a.typeOf(s[this.uid])},destroy:function(){this.detach(),delete s[this.uid]}}),t.data?this.detach(t.data):s[this.uid]=t}}),e("moxie/file/File",["moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/file/Blob"],function(r,o,a){function e(e,t){var i;if(t=t||{},a.apply(this,arguments),this.type||(this.type=o.getFileMime(t.name)),t.name)i=(i=t.name.replace(/\\/g,"/")).substr(i.lastIndexOf("/")+1);else if(this.type){var n=this.type.split("/")[0];i=r.guid((""!==n?n:"file")+"_"),o.extensions[this.type]&&(i+="."+o.extensions[this.type][0])}r.extend(this,{name:i||r.guid("file_"),relativePath:"",lastModifiedDate:t.lastModifiedDate||(new Date).toLocaleString()})}return e.prototype=a.prototype,e}),e("moxie/file/FileDrop",["moxie/core/I18n","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/core/utils/Env","moxie/file/File","moxie/runtime/RuntimeClient","moxie/core/EventTarget","moxie/core/utils/Mime"],function(t,r,e,o,a,i,s,n,u){var c=["ready","dragenter","dragleave","drop","error"];function l(i){MXI_DEBUG&&a.log("Instantiating FileDrop...");var e,n=this;"string"==typeof i&&(i={drop_zone:i}),e={accept:[{title:t.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},(i="object"==typeof i?o.extend({},e,i):e).container=r.get(i.drop_zone)||document.body,"static"===r.getStyle(i.container,"position")&&(i.container.style.position="relative"),"string"==typeof i.accept&&(i.accept=u.mimes2extList(i.accept)),s.call(n),o.extend(n,{uid:o.guid("uid_"),ruid:null,files:null,init:function(){n.bind("RuntimeInit",function(e,t){n.ruid=t.uid,t.exec.call(n,"FileDrop","init",i),n.dispatchEvent("ready")}),n.connectRuntime(i)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null,this.unbindAll()}}),this.handleEventProps(c)}return l.prototype=n.instance,l}),e("moxie/file/FileReader",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/Exceptions","moxie/core/EventTarget","moxie/file/Blob","moxie/runtime/RuntimeClient"],function(e,n,r,t,o,i){var a=["loadstart","progress","load","abort","error","loadend"];function s(){function t(e,t){if(this.trigger("loadstart"),this.readyState===s.LOADING)return this.trigger("error",new r.DOMException(r.DOMException.INVALID_STATE_ERR)),void this.trigger("loadend");if(!(t instanceof o))return this.trigger("error",new r.DOMException(r.DOMException.NOT_FOUND_ERR)),void this.trigger("loadend");if(this.result=null,this.readyState=s.LOADING,t.isDetached()){var i=t.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=i;break;case"readAsDataURL":this.result="data:"+t.type+";base64,"+n.btoa(i)}this.readyState=s.DONE,this.trigger("load"),this.trigger("loadend")}else this.connectRuntime(t.ruid),this.exec("FileReader","read",e,t)}i.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:s.EMPTY,result:null,error:null,readAsBinaryString:function(e){t.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){t.call(this,"readAsDataURL",e)},readAsText:function(e){t.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[s.EMPTY,s.DONE])&&(this.readyState===s.LOADING&&(this.readyState=s.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),this.exec("FileReader","destroy"),this.disconnectRuntime(),this.unbindAll()}}),this.handleEventProps(a),this.bind("Error",function(e,t){this.readyState=s.DONE,this.error=t},999),this.bind("Load",function(e){this.readyState=s.DONE},999)}return s.EMPTY=0,s.LOADING=1,s.DONE=2,s.prototype=t.instance,s}),e("moxie/core/utils/Url",[],function(){var s=function(e,t){for(var i=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],n=i.length,r={},o=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/.exec(e||"");n--;)o[n]&&(r[i[n]]=o[n]);if(!r.scheme){t&&"string"!=typeof t||(t=s(t||document.location.href)),r.scheme=t.scheme,r.host=t.host,r.port=t.port;var a="";/^[^\/]/.test(r.path)&&(a=t.path,a=/\/[^\/]*\.[^\/]*$/.test(a)?a.replace(/\/[^\/]+$/,"/"):a.replace(/\/?$/,"/")),r.path=a+(r.path||"")}return r.port||(r.port={http:80,https:443}[r.scheme]||80),r.port=parseInt(r.port,10),r.path||(r.path="/"),delete r.source,r};return{parseUrl:s,resolveUrl:function(e){var t="object"==typeof e?e:s(e);return t.scheme+"://"+t.host+(t.port!=={http:80,https:443}[t.scheme]?":"+t.port:"")+t.path+(t.query?t.query:"")},hasSameOrigin:function(e){function t(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof e&&(e=s(e)),t(s())===t(e)}}}),e("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i){function n(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return n.prototype=i.instance,n}),e("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(e,i,s){return function(){function t(e,t){if(!t.isDetached()){var i=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),i}var n=t.getSource();switch(e){case"readAsBinaryString":return n;case"readAsDataURL":return"data:"+t.type+";base64,"+s.btoa(n);case"readAsText":for(var r="",o=0,a=n.length;o<a;o++)r+=String.fromCharCode(n[o]);return r}}i.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return t.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return t.call(this,"readAsDataURL",e)},readAsText:function(e){return t.call(this,"readAsText",e)}})}}),e("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,a,s){return function(){var r,o=[];a.extend(this,{append:function(i,e){var n=this,t=a.typeOf(e);e instanceof s?r={name:i,value:e}:"array"===t?(i+="[]",a.each(e,function(e){n.append(i,e)})):"object"===t?a.each(e,function(e,t){n.append(i+"["+t+"]",e)}):"null"===t||"undefined"===t||"number"===t&&isNaN(e)?n.append(i,"false"):o.push({name:i,value:e.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return r&&r.value||null},getBlobName:function(){return r&&r.name||null},each:function(t){a.each(o,function(e){t(e.value,e.name)}),r&&t(r.value,r.name)},destroy:function(){r=null,o=[]}})}}),e("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(_,b,e,A,I,T,S,O,t,D,N,C){var M={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};function L(){this.uid=_.guid("uid_")}L.prototype=e.instance;var F=["loadstart","progress","abort","error","load","timeout","loadend"];function B(){var a,s,u,c,o,i,n=this,r={timeout:0,readyState:B.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},l=!0,d={},h=null,m=null,f=!1,p=!1,g=!1,x=!1,E=!1,v=!1,y={},w="";function R(e,t){if(r.hasOwnProperty(e))return 1===arguments.length?N.can("define_property")?r[e]:n[e]:void(N.can("define_property")?r[e]=t:n[e]=t)}_.extend(this,r,{uid:_.guid("uid_"),upload:new L,open:function(e,t,i,n,r){var o;if(!e||!t)throw new b.DOMException(b.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(e)||A.utf8_encode(e)!==e)throw new b.DOMException(b.DOMException.SYNTAX_ERR);if(~_.inArray(e.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(s=e.toUpperCase()),~_.inArray(s,["CONNECT","TRACE","TRACK"]))throw new b.DOMException(b.DOMException.SECURITY_ERR);if(t=A.utf8_encode(t),o=I.parseUrl(t),v=I.hasSameOrigin(o),a=I.resolveUrl(t),(n||r)&&!v)throw new b.DOMException(b.DOMException.INVALID_ACCESS_ERR);if(u=n||o.user,c=r||o.pass,!1===(l=i||!0)&&(R("timeout")||R("withCredentials")||""!==R("responseType")))throw new b.DOMException(b.DOMException.INVALID_ACCESS_ERR);f=!l,p=!1,d={},function(){R("responseText",""),R("responseXML",null),R("response",null),R("status",0),R("statusText",""),null}.call(this),R("readyState",B.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(e,t){if(R("readyState")!==B.OPENED||p)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(e)||A.utf8_encode(e)!==e)throw new b.DOMException(b.DOMException.SYNTAX_ERR);return e=_.trim(e).toLowerCase(),!~_.inArray(e,["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"])&&!/^(proxy\-|sec\-)/.test(e)&&(d[e]?d[e]+=", "+t:d[e]=t,!0)},getAllResponseHeaders:function(){return w||""},getResponseHeader:function(e){return e=e.toLowerCase(),E||~_.inArray(e,["set-cookie","set-cookie2"])?null:w&&""!==w&&(i||(i={},_.each(w.split(/\r\n/),function(e){var t=e.split(/:\s+/);2===t.length&&(t[0]=_.trim(t[0]),i[t[0].toLowerCase()]={header:t[0],value:_.trim(t[1])})})),i.hasOwnProperty(e))?i[e].header+": "+i[e].value:null},overrideMimeType:function(e){var t,i;if(~_.inArray(R("readyState"),[B.LOADING,B.DONE]))throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);if(e=_.trim(e.toLowerCase()),/;/.test(e)&&(t=e.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(e=t[1],t[2]&&(i=t[2])),!C.mimes[e])throw new b.DOMException(b.DOMException.SYNTAX_ERR);e,i},send:function(e,t){if(y="string"===_.typeOf(t)?{ruid:t}:t||{},this.readyState!==B.OPENED||p)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);if(e instanceof O)y.ruid=e.ruid,m=e.type||"application/octet-stream";else if(e instanceof D){if(e.hasBlob()){var i=e.getBlob();y.ruid=i.ruid,m=i.type||"application/octet-stream"}}else"string"==typeof e&&(h="UTF-8",m="text/plain;charset=UTF-8",e=A.utf8_encode(e));this.withCredentials||(this.withCredentials=y.required_caps&&y.required_caps.send_browser_cookies&&!v),g=!f&&this.upload.hasEventListener(),E=!1,x=!e,f||(p=!0),function(e){var i=this;function n(){o&&(o.destroy(),o=null),i.dispatchEvent("loadend"),i=null}function r(t){o.bind("LoadStart",function(e){R("readyState",B.LOADING),i.dispatchEvent("readystatechange"),i.dispatchEvent(e),g&&i.upload.dispatchEvent(e)}),o.bind("Progress",function(e){R("readyState")!==B.LOADING&&(R("readyState",B.LOADING),i.dispatchEvent("readystatechange")),i.dispatchEvent(e)}),o.bind("UploadProgress",function(e){g&&i.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),o.bind("Load",function(e){R("readyState",B.DONE),R("status",Number(t.exec.call(o,"XMLHttpRequest","getStatus")||0)),R("statusText",M[R("status")]||""),R("response",t.exec.call(o,"XMLHttpRequest","getResponse",R("responseType"))),~_.inArray(R("responseType"),["text",""])?R("responseText",R("response")):"document"===R("responseType")&&R("responseXML",R("response")),w=t.exec.call(o,"XMLHttpRequest","getAllResponseHeaders"),i.dispatchEvent("readystatechange"),0<R("status")?(g&&i.upload.dispatchEvent(e),i.dispatchEvent(e)):(E=!0,i.dispatchEvent("error")),n()}),o.bind("Abort",function(e){i.dispatchEvent(e),n()}),o.bind("Error",function(e){E=!0,R("readyState",B.DONE),i.dispatchEvent("readystatechange"),x=!0,i.dispatchEvent(e),n()}),t.exec.call(o,"XMLHttpRequest","send",{url:a,method:s,async:l,user:u,password:c,headers:d,mimeType:m,encoding:h,responseType:i.responseType,withCredentials:i.withCredentials,options:y},e)}(new Date).getTime(),o=new S,"string"==typeof y.required_caps&&(y.required_caps=T.parseCaps(y.required_caps));y.required_caps=_.extend({},y.required_caps,{return_response_type:i.responseType}),e instanceof D&&(y.required_caps.send_multipart=!0);_.isEmptyObj(d)||(y.required_caps.send_custom_headers=!0);v||(y.required_caps.do_cors=!0);y.ruid?r(o.connectRuntime(y)):(o.bind("RuntimeInit",function(e,t){r(t)}),o.bind("RuntimeError",function(e,t){i.dispatchEvent("RuntimeError",t)}),o.connectRuntime(y))}.call(this,e)},abort:function(){if(f=!(E=!0),~_.inArray(R("readyState"),[B.UNSENT,B.OPENED,B.DONE]))R("readyState",B.UNSENT);else{if(R("readyState",B.DONE),p=!1,!o)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);o.getRuntime().exec.call(o,"XMLHttpRequest","abort",x),x=!0}},destroy:function(){o&&("function"===_.typeOf(o.destroy)&&o.destroy(),o=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(F.concat(["readystatechange"])),this.upload.handleEventProps(F)}return B.UNSENT=0,B.OPENED=1,B.HEADERS_RECEIVED=2,B.LOADING=3,B.DONE=4,B.prototype=e.instance,B}),e("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(h,i,e,t){function m(){var o,n,a,s,r,u;function c(){s=r=0,a=this.result=null}function l(e,t){var i=this;n=t,i.bind("TransportingProgress",function(e){(r=e.loaded)<s&&-1===h.inArray(i.state,[m.IDLE,m.DONE])&&d.call(i)},999),i.bind("TransportingComplete",function(){r=s,i.state=m.DONE,a=null,i.result=n.exec.call(i,"Transporter","getAsBlob",e||"")},999),i.state=m.BUSY,i.trigger("TransportingStarted"),d.call(i)}function d(){var e,t=s-r;t<u&&(u=t),e=i.btoa(a.substr(r,u)),n.exec.call(this,"Transporter","receive",e,s)}e.call(this),h.extend(this,{uid:h.guid("uid_"),state:m.IDLE,result:null,transport:function(e,i,t){var n=this;if(t=h.extend({chunk_size:204798},t),(o=t.chunk_size%3)&&(t.chunk_size+=3-o),u=t.chunk_size,c.call(this),s=(a=e).length,"string"===h.typeOf(t)||t.ruid)l.call(n,i,this.connectRuntime(t));else{var r=function(e,t){n.unbind("RuntimeInit",r),l.call(n,i,t)};this.bind("RuntimeInit",r),this.connectRuntime(t)}},abort:function(){this.state=m.IDLE,n&&(n.exec.call(this,"Transporter","clear"),this.trigger("TransportingAborted")),c.call(this)},destroy:function(){this.unbindAll(),n=null,this.disconnectRuntime(),c.call(this)}})}return m.IDLE=0,m.BUSY=1,m.DONE=2,m.prototype=t.instance,m}),e("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(c,i,l,e,a,s,t,d,h,n,u,m,f){var p=["progress","load","error","resize","embedded"];function g(){function n(e,t){var i=this.connectRuntime(e.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",e,"undefined"===c.typeOf(t)||t)}function r(t,e){var i=this;function n(e){i.ruid=e.uid,e.exec.call(i,"Image","loadFromBlob",t)}i.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),e&&"string"==typeof e.required_caps&&(e.required_caps=s.parseCaps(e.required_caps)),this.connectRuntime(c.extend({required_caps:{access_image_binary:!0,resize_image:!0}},e))):n(this.connectRuntime(t.ruid))}function o(e,t){var i,n=this;(i=new a).open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){r.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}t.call(this),c.extend(this,{uid:c.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){(function e(t){var i=c.typeOf(t);try{if(t instanceof g){if(!t.size)throw new l.DOMException(l.DOMException.INVALID_STATE_ERR);n.apply(this,arguments)}else if(t instanceof u){if(!~c.inArray(t.type,["image/jpeg","image/png"]))throw new l.ImageError(l.ImageError.WRONG_FORMAT);r.apply(this,arguments)}else if(-1!==c.inArray(i,["blob","file"]))e.call(this,new m(null,t),arguments[1]);else if("string"===i)"data:"===t.substr(0,5)?e.call(this,new u(null,{data:t}),arguments[1]):o.apply(this,arguments);else{if("node"!==i||"img"!==t.nodeName.toLowerCase())throw new l.DOMException(l.DOMException.TYPE_MISMATCH_ERR);e.call(this,t.src,arguments[1])}}catch(e){this.trigger("error",e.code)}}).apply(this,arguments)},downsize:function(e){var t={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,preserveHeaders:!0,resample:!1};e="object"==typeof e?c.extend(t,e):c.extend(t,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});try{if(!this.size)throw new l.DOMException(l.DOMException.INVALID_STATE_ERR);if(this.width>g.MAX_RESIZE_WIDTH||this.height>g.MAX_RESIZE_HEIGHT)throw new l.ImageError(l.ImageError.MAX_RESOLUTION_ERR);this.exec("Image","downsize",e.width,e.height,e.crop,e.preserveHeaders)}catch(e){this.trigger("error",e.code)}},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!h.can("create_canvas"))throw new l.RuntimeError(l.RuntimeError.NOT_SUPPORTED_ERR);return this.connectRuntime(this.ruid).exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new l.DOMException(l.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new l.DOMException(l.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return f.atob(i.substring(i.indexOf("base64,")+7))},embed:function(a,e){var s,u=this;e=c.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},e||{});try{if(!(a=i.get(a)))throw new l.DOMException(l.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new l.DOMException(l.DOMException.INVALID_STATE_ERR);this.width>g.MAX_RESIZE_WIDTH||this.height;var t=new g;return t.bind("Resize",function(){(function(e,t){var i=this;if(h.can("create_canvas")){var n=i.getAsCanvas();if(n)return a.appendChild(n),n=null,i.destroy(),void u.trigger("embedded")}var r=i.getAsDataURL(e,t);if(!r)throw new l.ImageError(l.ImageError.WRONG_FORMAT);if(h.can("use_data_uri_of",r.length))a.innerHTML='<img src="'+r+'" width="'+i.width+'" height="'+i.height+'" />',i.destroy(),u.trigger("embedded");else{var o=new d;o.bind("TransportingComplete",function(){s=u.connectRuntime(this.result.ruid),u.bind("Embedded",function(){c.extend(s.getShimContainer().style,{top:"0px",left:"0px",width:i.width+"px",height:i.height+"px"}),s=null},999),s.exec.call(u,"ImageView","display",this.result.uid,width,height),i.destroy()}),o.transport(f.atob(r.substring(r.indexOf("base64,")+7)),e,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:a})}}).call(this,e.type,e.quality)}),t.bind("Load",function(){t.downsize(e)}),this.meta.thumb&&this.meta.thumb.width>=e.width&&this.meta.thumb.height>=e.height?t.load(this.meta.thumb.data):t.clone(this,!1),t}catch(e){this.trigger("error",e.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(p),this.bind("Load Resize",function(){(function(e){e=e||this.exec("Image","getInfo");this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}).call(this)},999)}return g.MAX_RESIZE_WIDTH=8192,g.MAX_RESIZE_HEIGHT=8192,g.prototype=n.instance,g}),e("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(s,e,u,c){var l={};return u.addConstructor("html5",function(e){var t,i,n=this,r=u.capTest,o=u.capTrue,a=s.extend({access_binary:r(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return n.can("access_binary")&&!!l.Image},display_media:r(c.can("create_canvas")||c.can("use_data_uri_over32kb")),do_cors:r(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:r((t=document.createElement("div"),("draggable"in t||"ondragstart"in t&&"ondrop"in t)&&("IE"!==c.browser||c.verComp(c.version,9,">")))),filter_by_extension:r("Chrome"===c.browser&&c.verComp(c.version,28,">=")||"IE"===c.browser&&c.verComp(c.version,10,">=")||"Safari"===c.browser&&c.verComp(c.version,7,">=")),return_response_headers:o,return_response_type:function(e){return!("json"!==e||!window.JSON)||c.can("return_response_type",e)},return_status_code:o,report_upload_progress:r(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return n.can("access_binary")&&c.can("create_canvas")},select_file:function(){return c.can("use_fileinput")&&window.File},select_folder:function(){return n.can("select_file")&&"Chrome"===c.browser&&c.verComp(c.version,21,">=")},select_multiple:function(){return n.can("select_file")&&!("Safari"===c.browser&&"Windows"===c.os)&&!("iOS"===c.os&&c.verComp(c.osVersion,"7.0.0",">")&&c.verComp(c.osVersion,"8.0.0","<"))},send_binary_string:r(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:r(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||n.can("send_binary_string")},slice_blob:r(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return n.can("slice_blob")&&n.can("send_multipart")},summon_file_dialog:function(){return n.can("select_file")&&("Firefox"===c.browser&&c.verComp(c.version,4,">=")||"Opera"===c.browser&&c.verComp(c.version,12,">=")||"IE"===c.browser&&c.verComp(c.version,10,">=")||!!~s.inArray(c.browser,["Chrome","Safari"]))},upload_filesize:o},arguments[2]);u.call(this,e,arguments[1]||"html5",a),s.extend(this,{init:function(){this.trigger("Init")},destroy:(i=this.destroy,function(){i.call(n),i=n=null})}),s.extend(this.getShim(),l)}),l}),e("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(a){var s={},u="moxie_"+a.guid();function c(){this.returnValue=!1}function l(){this.cancelBubble=!0}function r(t,e,i){var n;if(e=e.toLowerCase(),t[u]&&s[t[u]]&&s[t[u]][e]){for(var r=(n=s[t[u]][e]).length-1;0<=r&&(n[r].orig!==i&&n[r].key!==i||(t.removeEventListener?t.removeEventListener(e,n[r].func,!1):t.detachEvent&&t.detachEvent("on"+e,n[r].func),n[r].orig=null,n[r].func=null,n.splice(r,1),void 0===i));r--);if(n.length||delete s[t[u]][e],a.isEmptyObj(s[t[u]])){delete s[t[u]];try{delete t[u]}catch(e){t[u]=void 0}}}}return{addEvent:function(e,t,i,n){var r,o;t=t.toLowerCase(),e.addEventListener?(r=i,e.addEventListener(t,r,!1)):e.attachEvent&&(r=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=c,e.stopPropagation=l,i(e)},e.attachEvent("on"+t,r)),e[u]||(e[u]=a.guid()),s.hasOwnProperty(e[u])||(s[e[u]]={}),(o=s[e[u]]).hasOwnProperty(t)||(o[t]=[]),o[t].push({func:r,orig:i,key:n})},removeEvent:r,removeAllEvents:function(i,n){i&&i[u]&&a.each(s[i[u]],function(e,t){r(i,t,n)})}}}),e("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,l,d,h,m,f,p){return e.FileInput=function(){var c;d.extend(this,{init:function(e){var t,i,n,r,o,a,s=this,u=s.getRuntime();n=(c=e).accept.mimes||f.extList2mimes(c.accept,u.can("filter_by_extension")),(i=u.getShimContainer()).innerHTML='<input id="'+u.uid+'" type="file" style="font-size:999px;opacity:0;"'+(c.multiple&&u.can("select_multiple")?"multiple":"")+(c.directory&&u.can("select_folder")?"webkitdirectory directory":"")+(n?' accept="'+n.join(",")+'"':"")+" />",t=h.get(u.uid),d.extend(t.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),r=h.get(c.browse_button),u.can("summon_file_dialog")&&("static"===h.getStyle(r,"position")&&(r.style.position="relative"),o=parseInt(h.getStyle(r,"z-index"),10)||1,r.style.zIndex=o,i.style.zIndex=o-1,m.addEvent(r,"click",function(e){var t=h.get(u.uid);t&&!t.disabled&&t.click(),e.preventDefault()},s.uid)),a=u.can("summon_file_dialog")?r:i,m.addEvent(a,"mouseover",function(){s.trigger("mouseenter")},s.uid),m.addEvent(a,"mouseout",function(){s.trigger("mouseleave")},s.uid),m.addEvent(a,"mousedown",function(){s.trigger("mousedown")},s.uid),m.addEvent(h.get(c.container),"mouseup",function(){s.trigger("mouseup")},s.uid),t.onchange=function e(t){if(s.files=[],d.each(this.files,function(e){var t="";if(c.directory&&"."==e.name)return!0;e.webkitRelativePath&&(t="/"+e.webkitRelativePath.replace(/^\//,"")),(e=new l(u.uid,e)).relativePath=t,s.files.push(e)}),"IE"!==p.browser&&"IEMobile"!==p.browser)this.value="";else{var i=this.cloneNode(!0);this.parentNode.replaceChild(i,this),i.onchange=e}s.files.length&&s.trigger("change")},s.trigger({type:"ready",async:!0}),i=null},disable:function(e){var t,i=this.getRuntime();(t=h.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer();m.removeAllEvents(i,this.uid),m.removeAllEvents(c&&h.get(c.container),this.uid),m.removeAllEvents(c&&h.get(c.browse_button),this.uid),i&&(i.innerHTML=""),t.removeInstance(this.uid),c=i=t=null}})}}),e("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){return e.Blob=function(){this.slice=function(){return new t(this.getRuntime().uid,function(t,i,n){var e;if(!window.File.prototype.slice)return(e=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?e.call(t,i,n):null;try{return t.slice(),t.slice(i,n)}catch(e){return t.slice(i,n-i)}}.apply(this,arguments))}}}),e("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,l,d,t,h,m){return e.FileDrop=function(){var n,r,o=[],a=[];function s(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=d.toArray(e.dataTransfer.types||[]);return-1!==d.inArray("Files",t)||-1!==d.inArray("public.file-url",t)||-1!==d.inArray("application/x-moz-file",t)}function u(e,t){if(function(e){if(!a.length)return!0;var t=m.getFileExtension(e.name);return!t||-1!==d.inArray(t,a)}(e)){var i=new l(r,e);i.relativePath=t||"",o.push(i)}}function c(e,t){var i=[];d.each(e,function(t){i.push(function(e){!function(t,i){t.isFile?t.file(function(e){u(e,t.fullPath),i()},function(){i()}):t.isDirectory?function(e,t){var n=[],r=e.createReader();!function t(i){r.readEntries(function(e){e.length?([].push.apply(n,e),t(i)):i()},i)}(function(){c(n,t)})}(t,i):i()}(t,e)})}),d.inSeries(i,function(){t()})}d.extend(this,{init:function(e){var t,i=this;n=e,r=i.ruid,a=function(e){for(var t=[],i=0;i<e.length;i++)[].push.apply(t,e[i].extensions.split(/\s*,\s*/));return-1===d.inArray("*",t)?t:[]}(n.accept),t=n.container,h.addEvent(t,"dragover",function(e){s(e)&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},i.uid),h.addEvent(t,"drop",function(e){s(e)&&(e.preventDefault(),o=[],e.dataTransfer.items&&e.dataTransfer.items[0].webkitGetAsEntry?function(e,t){var i=[];d.each(e,function(e){var t=e.webkitGetAsEntry();t&&(t.isFile?u(e.getAsFile(),t.fullPath):i.push(t))}),i.length?c(i,t):t()}(e.dataTransfer.items,function(){i.files=o,i.trigger("drop")}):(d.each(e.dataTransfer.files,function(e){u(e)}),i.files=o,i.trigger("drop")))},i.uid),h.addEvent(t,"dragenter",function(e){i.trigger("dragenter")},i.uid),h.addEvent(t,"dragleave",function(e){i.trigger("dragleave")},i.uid)},destroy:function(){h.removeAllEvents(n&&t.get(n.container),this.uid),r=o=a=n=null}})}}),e("moxie/runtime/html5/file/FileReader",["moxie/runtime/html5/Runtime","moxie/core/utils/Encode","moxie/core/utils/Basic"],function(e,o,a){return e.FileReader=function(){var n,r=!1;a.extend(this,{read:function(e,t){var i=this;i.result="",(n=new window.FileReader).addEventListener("progress",function(e){i.trigger(e)}),n.addEventListener("load",function(e){i.result=r?function(e){return o.atob(e.substring(e.indexOf("base64,")+7))}(n.result):n.result,i.trigger(e)}),n.addEventListener("error",function(e){i.trigger(e,n.error)}),n.addEventListener("loadend",function(e){n=null,i.trigger(e)}),"function"===a.typeOf(n[e])?(r=!1,n[e](t.getSource())):"readAsBinaryString"===e&&(r=!0,n.readAsDataURL(t.getSource()))},abort:function(){n&&n.abort()},destroy:function(){n=null}})}}),e("moxie/runtime/html5/xhr/XMLHttpRequest",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/core/utils/Url","moxie/file/File","moxie/file/Blob","moxie/xhr/FormData","moxie/core/Exceptions","moxie/core/utils/Env"],function(e,l,o,d,a,h,m,f,p){return e.XMLHttpRequest=function(){var s,u,c=this;l.extend(this,{send:function(e,i){var n=this,t="Mozilla"===p.browser&&p.verComp(p.version,4,">=")&&p.verComp(p.version,7,"<"),r="Android Browser"===p.browser,o=!1;if(u=e.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),(s=!window.XMLHttpRequest||"IE"===p.browser&&p.verComp(p.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(e){}}():new window.XMLHttpRequest).open(e.method,e.url,e.async,e.user,e.password),i instanceof h)i.isDetached()&&(o=!0),i=i.getSource();else if(i instanceof m){if(i.hasBlob())if(i.getBlob().isDetached())i=function(e){var i="----moxieboundary"+(new Date).getTime(),n="\r\n",r="";if(this.getRuntime().can("send_binary_string"))return s.setRequestHeader("Content-Type","multipart/form-data; boundary="+i),e.each(function(e,t){r+=e instanceof h?"--"+i+n+'Content-Disposition: form-data; name="'+t+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+n+"Content-Type: "+(e.type||"application/octet-stream")+n+n+e.getSource()+n:"--"+i+n+'Content-Disposition: form-data; name="'+t+'"'+n+n+unescape(encodeURIComponent(e))+n}),r+="--"+i+"--"+n;throw new f.RuntimeError(f.RuntimeError.NOT_SUPPORTED_ERR)}.call(n,i),o=!0;else if((t||r)&&"blob"===l.typeOf(i.getBlob().getSource())&&window.FileReader)return void function(e,t){var i,n,r=this;i=t.getBlob().getSource(),(n=new window.FileReader).onload=function(){t.append(t.getBlobName(),new h(null,{type:i.type,data:n.result})),c.send.call(r,e,t)},n.readAsBinaryString(i)}.call(n,e,i);if(i instanceof m){var a=new window.FormData;i.each(function(e,t){e instanceof h?a.append(t,e.getSource()):a.append(t,e)}),i=a}}s.upload?(e.withCredentials&&(s.withCredentials=!0),s.addEventListener("load",function(e){n.trigger(e)}),s.addEventListener("error",function(e){n.trigger(e)}),s.addEventListener("progress",function(e){n.trigger(e)}),s.upload.addEventListener("progress",function(e){n.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):s.onreadystatechange=function(){switch(s.readyState){case 1:case 2:break;case 3:var t,i;try{d.hasSameOrigin(e.url)&&(t=s.getResponseHeader("Content-Length")||0),s.responseText&&(i=s.responseText.length)}catch(e){t=i=0}n.trigger({type:"progress",lengthComputable:!!t,total:parseInt(t,10),loaded:i});break;case 4:s.onreadystatechange=function(){},0===s.status?n.trigger("error"):n.trigger("load")}},l.isEmptyObj(e.headers)||l.each(e.headers,function(e,t){s.setRequestHeader(t,e)}),""!==e.responseType&&"responseType"in s&&("json"!==e.responseType||p.can("return_response_type","json")?s.responseType=e.responseType:s.responseType="text"),o?s.sendAsBinary?s.sendAsBinary(i):function(){for(var e=new Uint8Array(i.length),t=0;t<i.length;t++)e[t]=255&i.charCodeAt(t);s.send(e.buffer)}():s.send(i),n.trigger("loadstart")},getStatus:function(){try{if(s)return s.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var i=new a(t.uid,s.response),n=s.getResponseHeader("Content-Disposition");if(n){var r=n.match(/filename=([\'\"'])([^\1]+)\1/);r&&(u=r[2])}return i.name=u,i.type||(i.type=o.getFileMime(u)),i;case"json":return p.can("return_response_type","json")?s.response:200===s.status&&window.JSON?JSON.parse(s.responseText):null;case"document":return function(e){var t=e.responseXML,i=e.responseText;"IE"===p.browser&&i&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&((t=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,t.validateOnParse=!1,t.loadXML(i));if(t&&("IE"===p.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName))return null;return t}(s);default:return""!==s.responseText?s.responseText:null}}catch(e){return null}},getAllResponseHeaders:function(){try{return s.getAllResponseHeaders()}catch(e){}return""},abort:function(){s&&s.abort()},destroy:function(){c=u=null}})}}),e("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(t){function e(e){e instanceof ArrayBuffer?function(r){var o=new DataView(r);t.extend(this,{readByteAt:function(e){return o.getUint8(e)},writeByteAt:function(e,t){o.setUint8(e,t)},SEGMENT:function(e,t,i){switch(arguments.length){case 2:return r.slice(e,e+t);case 1:return r.slice(e);case 3:if(null===i&&(i=new ArrayBuffer),i instanceof ArrayBuffer){var n=new Uint8Array(this.length()-t+i.byteLength);0<e&&n.set(new Uint8Array(r.slice(0,e)),0),n.set(new Uint8Array(i),e),n.set(new Uint8Array(r.slice(e+t)),e+i.byteLength),this.clear(),r=n.buffer,o=new DataView(r);break}default:return r}},length:function(){return r?r.byteLength:0},clear:function(){o=r=null}})}.apply(this,arguments):function(n){function r(e,t,i){i=3===arguments.length?i:n.length-t-1,n=n.substr(0,t)+e+n.substr(i+t)}t.extend(this,{readByteAt:function(e){return n.charCodeAt(e)},writeByteAt:function(e,t){r(String.fromCharCode(t),e,1)},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return n.substr(e);case 2:return n.substr(e,t);case 3:r(null!==i?i:"",e,t);break;default:return n}},length:function(){return n?n.length:0},clear:function(){n=null}})}.apply(this,arguments)}return t.extend(e.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),i=r=0;r<t;r++)i|=this.readByteAt(e+r)<<Math.abs(n+8*r);return i},write:function(e,t,i){var n,r;if(e>this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;r<i;r++)this.writeByteAt(e+r,t>>Math.abs(n+8*r)&255)},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return 2147483647<t?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;r<i;r++)n[r]=this[e](t+r);return n}}),e}),e("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(s,u){return function o(e){var t,r,i,a=[],n=0;if(65496!==(t=new s(e)).SHORT(0))throw t.clear(),new u.ImageError(u.ImageError.WRONG_FORMAT);for(r=2;r<=t.length();)if(65488<=(i=t.SHORT(r))&&i<=65495)r+=2;else{if(65498===i||65497===i)break;n=t.SHORT(r+2)+2,65505<=i&&i<=65519&&a.push({hex:i,name:"APP"+(15&i),start:r,length:n,segment:t.SEGMENT(r,n)}),r+=n}return t.clear(),{headers:a,restore:function(e){var t,i,n;for(n=new s(e),r=65504==n.SHORT(2)?4+n.SHORT(4):2,i=0,t=a.length;i<t;i++)n.SEGMENT(r,0,a[i].segment),r+=a[i].length;return e=n.SEGMENT(),n.clear(),e},strip:function(e){var t,i,n,r;for(i=(n=new o(e)).headers,n.purge(),t=new s(e),r=i.length;r--;)t.SEGMENT(i[r].start,i[r].length,"");return e=t.SEGMENT(),t.clear(),e},get:function(e){for(var t=[],i=0,n=a.length;i<n;i++)a[i].name===e.toUpperCase()&&t.push(a[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=a.length;i<r&&(a[i].name===e.toUpperCase()&&(a[i].segment=o[n],a[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=a=[]}}}}),e("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(x,a,E){function s(e){var t,l,p,g,i,n;if(a.call(this,e),l={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},p={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},i=(g={tiffHeader:10}).tiffHeader,t={clear:this.clear},x.extend(this,{read:function(){try{return s.prototype.read.apply(this,arguments)}catch(e){throw new E.ImageError(E.ImageError.INVALID_META_ERR)}},write:function(){try{return s.prototype.write.apply(this,arguments)}catch(e){throw new E.ImageError(E.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return n||null},EXIF:function(){var e=null;if(g.exifIFD){try{e=o.call(this,g.exifIFD,l.exif)}catch(e){return null}if(e.ExifVersion&&"array"===x.typeOf(e.ExifVersion)){for(var t=0,i="";t<e.ExifVersion.length;t++)i+=String.fromCharCode(e.ExifVersion[t]);e.ExifVersion=i}}return e},GPS:function(){var e=null;if(g.gpsIFD){try{e=o.call(this,g.gpsIFD,l.gps)}catch(e){return null}e.GPSVersionID&&"array"===x.typeOf(e.GPSVersionID)&&(e.GPSVersionID=e.GPSVersionID.join("."))}return e},thumb:function(){if(g.IFD1)try{var e=o.call(this,g.IFD1,l.thumb);if("JPEGInterchangeFormat"in e)return this.SEGMENT(g.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(e){}return null},setExif:function(e,t){return("PixelXDimension"===e||"PixelYDimension"===e)&&function(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=l[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=g[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var c=0;c<r;c++)if(o=n+12*c+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(e){return!1}return!0}.call(this,"exif",e,t)},clear:function(){t.clear(),e=l=p=n=g=t=null}}),65505!==this.SHORT(0)||"EXIF\0"!==this.STRING(4,5).toUpperCase())throw new E.ImageError(E.ImageError.INVALID_META_ERR);if(this.littleEndian=18761==this.SHORT(i),42!==this.SHORT(i+=2))throw new E.ImageError(E.ImageError.INVALID_META_ERR);g.IFD0=g.tiffHeader+this.LONG(i+=2),"ExifIFDPointer"in(n=o.call(this,g.IFD0,l.tiff))&&(g.exifIFD=g.tiffHeader+n.ExifIFDPointer,delete n.ExifIFDPointer),"GPSInfoIFDPointer"in n&&(g.gpsIFD=g.tiffHeader+n.GPSInfoIFDPointer,delete n.GPSInfoIFDPointer),x.isEmptyObj(n)&&(n=null);var r=this.LONG(g.IFD0+12*this.SHORT(g.IFD0)+2);function o(e,t){var i,n,r,o,a,s,u,c,l=this,d=[],h={},m={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},f={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(i=l.SHORT(e),n=0;n<i;n++)if(d=[],u=e+2+12*n,(r=t[l.SHORT(u)])!==v){if(o=m[l.SHORT(u+=2)],a=l.LONG(u+=2),!(s=f[o]))throw new E.ImageError(E.ImageError.INVALID_META_ERR);if(u+=4,4<s*a&&(u=l.LONG(u)+g.tiffHeader),u+s*a>=this.length())throw new E.ImageError(E.ImageError.INVALID_META_ERR);"ASCII"!==o?(d=l.asArray(o,u,a),c=1==a?d[0]:d,p.hasOwnProperty(r)&&"object"!=typeof c?h[r]=p[r][c]:h[r]=c):h[r]=x.trim(l.STRING(u,a).replace(/\0$/,""))}return h}r&&(g.IFD1=g.tiffHeader+r)}return s.prototype=a.prototype,s}),e("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(a,s,u,c,l){return function(e){var r,i,n,t;if(65496!==(r=new c(e)).SHORT(0))throw new s.ImageError(s.ImageError.WRONG_FORMAT);i=new u(e);try{n=new l(i.get("app1")[0])}catch(e){}function o(e){var t,i,n=0;for(e=e||r;n<=e.length();){if(65472<=(t=e.SHORT(n+=2))&&t<=65475)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}t=o.call(this),a.extend(this,{type:"image/jpeg",size:r.length(),width:t&&t.width||0,height:t&&t.height||0,setExif:function(e,t){if(!n)return!1;"object"===a.typeOf(e)?a.each(e,function(e,t){n.setExif(t,e)}):n.setExif(e,t),i.set("app1",n.SEGMENT())},writeHeaders:function(){return arguments.length?i.restore(arguments[0]):i.restore(e)},stripHeaders:function(e){return i.strip(e)},purge:function(){(function(){if(!n||!i||!r)return;n.clear(),i.purge(),r.clear(),t=i=n=r=null}).call(this)}}),n&&(this.meta={tiff:n.TIFF(),exif:n.EXIF(),gps:n.GPS(),thumb:function(){var e,t,i=n.thumb();if(i&&(e=new c(i),t=o(e),e.clear(),t))return t.data=i,t;return null}()})}}),e("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(n,r,a){return function(e){var o,t;function i(){o&&(o.clear(),e=t=o=null)}o=new a(e),function(){var e=0,t=0,i=[35152,20039,3338,6666];for(t=0;t<i.length;t++,e+=2)if(i[t]!=o.SHORT(e))throw new n.ImageError(n.ImageError.WRONG_FORMAT)}(),t=function(){var e,t;return"IHDR"==(e=function(e){var t,i,n,r;return t=o.LONG(e),i=o.STRING(e+=4,4),n=e+=4,r=o.LONG(e+t),{length:t,type:i,start:n,CRC:r}}.call(this,8)).type?(t=e.start,{width:o.LONG(t),height:o.LONG(t+=4)}):null}.call(this),r.extend(this,{type:"image/png",size:o.length(),width:t.width,height:t.height,purge:function(){i.call(this)}}),i.call(this)}}),e("moxie/runtime/html5/image/ImageInfo",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEG","moxie/runtime/html5/image/PNG"],function(n,r,o,a){return function(t){var e,i=[o,a];e=function(){for(var e=0;e<i.length;e++)try{return new i[e](t)}catch(e){}throw new r.ImageError(r.ImageError.WRONG_FORMAT)}(),n.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){t=null}}),n.extend(this,e),this.purge=function(){e.purge(),e=null}}}),e("moxie/runtime/html5/image/MegaPixel",[],function(){function R(e){var t=e.naturalWidth;if(1048576<t*e.naturalHeight){var i=document.createElement("canvas");i.width=i.height=1;var n=i.getContext("2d");return n.drawImage(e,1-t,0),0===n.getImageData(0,0,1,1).data[3]}return!1}return{isSubsampled:R,renderTo:function(e,t,i){var n=e.naturalWidth,r=e.naturalHeight,o=i.width,a=i.height,s=i.x||0,u=i.y||0,c=t.getContext("2d");R(e)&&(n/=2,r/=2);var l=1024,d=document.createElement("canvas");d.width=d.height=l;for(var h=d.getContext("2d"),m=function(e,t,i){var n=document.createElement("canvas");n.width=1,n.height=i;var r=n.getContext("2d");r.drawImage(e,0,0);var o=r.getImageData(0,0,1,i).data,a=0,s=i,u=i;for(;a<u;){0===o[4*(u-1)+3]?s=u:a=u,u=s+a>>1}n=null;var c=u/i;return 0==c?1:c}(e,0,r),f=0;f<r;){for(var p=r<f+l?r-f:l,g=0;g<n;){var x=n<g+l?n-g:l;h.clearRect(0,0,l,l),h.drawImage(e,-g,-f);var E=g*o/n+s<<0,v=Math.ceil(x*o/n),y=f*a/r/m+u<<0,w=Math.ceil(p*a/r/m);c.drawImage(d,0,0,x,p,E,y,v,w),g+=l}f+=l}d=h=null}}}),e("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/MegaPixel","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,g,d,x,E,v,y,w,R,_){return e.Image=function(){var i,n,h,r,o,a=this,m=!1,f=!0;function p(){if(!h&&!i)throw new d.ImageError(d.DOMException.INVALID_STATE_ERR);return h||i}function s(e){return x.atob(e.substring(e.indexOf("base64,")+7))}function u(e){var t=this;(i=new Image).onerror=function(){l.call(this),t.trigger("error",d.ImageError.WRONG_FORMAT)},i.onload=function(){t.trigger("load")},i.src="data:"==e.substr(0,5)?e:function(e,t){return"data:"+(t||"")+";base64,"+x.btoa(e)}(e,o.type)}function c(e,t,i,n){var r,o,a,s,u,c=0,l=0;if(f=n,u=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==g.inArray(u,[5,6,7,8])){var d=e;e=t,t=d}o=p(),1<(r=i?(e=Math.min(e,o.width),t=Math.min(t,o.height),Math.max(e/o.width,t/o.height)):Math.min(e/o.width,t/o.height))&&!i&&n||(h=h||document.createElement("canvas"),a=Math.round(o.width*r),s=Math.round(o.height*r),i?(h.width=e,h.height=t,e<a&&(c=Math.round((a-e)/2)),t<s&&(l=Math.round((s-t)/2))):(h.width=a,h.height=s),f||function(e,t,i){switch(i){case 5:case 6:case 7:case 8:h.width=t,h.height=e;break;default:h.width=e,h.height=t}var n=h.getContext("2d");switch(i){case 2:n.translate(e,0),n.scale(-1,1);break;case 3:n.translate(e,t),n.rotate(Math.PI);break;case 4:n.translate(0,t),n.scale(1,-1);break;case 5:n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:n.rotate(.5*Math.PI),n.translate(0,-t);break;case 7:n.rotate(.5*Math.PI),n.translate(e,-t),n.scale(-1,1);break;case 8:n.rotate(-.5*Math.PI),n.translate(-e,0)}}(h.width,h.height,u),function(e,t,i,n,r,o){if("iOS"===_.OS)w.renderTo(e,t,{width:r,height:o,x:i,y:n});else{t.getContext("2d").drawImage(e,i,n,r,o)}}.call(this,o,h,-c,-l,a,s),this.width=h.width,this.height=h.height,m=!0),this.trigger("Resize")}function l(){n&&(n.purge(),n=null),r=i=h=o=null,m=!1}g.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),n=!(1<arguments.length)||arguments[1];if(!i.can("access_binary"))throw new d.RuntimeError(d.RuntimeError.NOT_SUPPORTED_ERR);if((o=e).isDetached())return r=e.getSource(),void u.call(this,r);(function(e,t){var i,n=this;{if(!window.FileReader)return t(e.getAsDataURL());(i=new FileReader).onload=function(){t(this.result)},i.onerror=function(){n.trigger("error",d.ImageError.WRONG_FORMAT)},i.readAsDataURL(e)}}).call(this,e.getSource(),function(e){n&&(r=s(e)),u.call(t,e)})},loadFromImage:function(e,t){this.meta=e.meta,o=new v(null,{name:e.name,size:e.size,type:e.type}),u.call(this,t?r=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var e,t=this.getRuntime();return!n&&r&&t.can("access_image_binary")&&(n=new y(r)),!(e={width:p().width||0,height:p().height||0,type:o.type||R.getFileMime(o.name),size:r&&r.length||o.size||0,name:o.name||"",meta:n&&n.meta||this.meta||{}}).meta||!e.meta.thumb||e.meta.thumb.data instanceof E||(e.meta.thumb.data=new E(null,{type:"image/jpeg",data:e.meta.thumb.data})),e},downsize:function(){c.apply(this,arguments)},getAsCanvas:function(){return h&&(h.id=this.uid+"_canvas"),h},getAsBlob:function(e,t){return e!==this.type&&c.call(this,this.width,this.height,!1),new v(null,{name:o.name||"",type:e,data:a.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!m)return i.src;if("image/jpeg"!==e)return h.toDataURL("image/png");try{return h.toDataURL("image/jpeg",t/100)}catch(e){return h.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!m)return r=r||s(a.getAsDataURL(e,t));if("image/jpeg"!==e)r=s(a.getAsDataURL(e,t));else{var i;t=t||90;try{i=h.toDataURL("image/jpeg",t/100)}catch(e){i=h.toDataURL("image/jpeg")}r=s(i),n&&(r=n.stripHeaders(r),f&&(n.meta&&n.meta.exif&&n.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),r=n.writeHeaders(r)),n.purge(),n=null)}return m=!1,r},destroy:function(){a=null,l.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}}),e("moxie/runtime/flash/Runtime",[],function(){return{}}),e("moxie/runtime/silverlight/Runtime",[],function(){return{}}),e("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(o,e,a,s){var u={};return a.addConstructor("html4",function(e){var t,i=this,n=a.capTest,r=a.capTrue;a.call(this,e,"html4",{access_binary:n(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:n(u.Image&&(s.can("create_canvas")||s.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,filter_by_extension:n("Chrome"===s.browser&&s.verComp(s.version,28,">=")||"IE"===s.browser&&s.verComp(s.version,10,">=")||"Safari"===s.browser&&s.verComp(s.version,7,">=")),resize_image:function(){return u.Image&&i.can("access_binary")&&s.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(e){return!("json"!==e||!window.JSON)||!!~o.inArray(e,["text","document",""])},return_status_code:function(e){return!o.arrayDiff(e,[200,404])},select_file:function(){return s.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return i.can("select_file")},summon_file_dialog:function(){return i.can("select_file")&&("Firefox"===s.browser&&s.verComp(s.version,4,">=")||"Opera"===s.browser&&s.verComp(s.version,12,">=")||"IE"===s.browser&&s.verComp(s.version,10,">=")||!!~o.inArray(s.browser,["Chrome","Safari"]))},upload_filesize:r,use_http_method:function(e){return!o.arrayDiff(e,["GET","POST"])}}),o.extend(this,{init:function(){this.trigger("Init")},destroy:(t=this.destroy,function(){t.call(i),t=i=null})}),o.extend(this.getShim(),u)}),u}),e("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,h,m,f,p,s,g){return e.FileInput=function(){var c,l,d=[];m.extend(this,{init:function(e){var t,i,n,r,o=this,a=o.getRuntime();d=(l=e).accept.mimes||s.extList2mimes(e.accept,a.can("filter_by_extension")),t=a.getShimContainer(),i=f.get(e.browse_button),a.can("summon_file_dialog")&&("static"===f.getStyle(i,"position")&&(i.style.position="relative"),n=parseInt(f.getStyle(i,"z-index"),10)||1,i.style.zIndex=n,t.style.zIndex=n-1),r=a.can("summon_file_dialog")?i:t,p.addEvent(r,"mouseover",function(){o.trigger("mouseenter")},o.uid),p.addEvent(r,"mouseout",function(){o.trigger("mouseleave")},o.uid),p.addEvent(r,"mousedown",function(){o.trigger("mousedown")},o.uid),p.addEvent(f.get(e.container),"mouseup",function(){o.trigger("mouseup")},o.uid),i=null,function t(){var e,i,n,r,o,a,s=this,u=s.getRuntime();a=m.guid("uid_"),e=u.getShimContainer(),c&&(n=f.get(c+"_form"))&&m.extend(n.style,{top:"100%"}),(r=document.createElement("form")).setAttribute("id",a+"_form"),r.setAttribute("method","post"),r.setAttribute("enctype","multipart/form-data"),r.setAttribute("encoding","multipart/form-data"),m.extend(r.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),(o=document.createElement("input")).setAttribute("id",a),o.setAttribute("type","file"),o.setAttribute("name",l.name||"Filedata"),o.setAttribute("accept",d.join(",")),m.extend(o.style,{fontSize:"999px",opacity:0}),r.appendChild(o),e.appendChild(r),m.extend(o.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===g.browser&&g.verComp(g.version,10,"<")&&m.extend(o.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),o.onchange=function(){var e;if(this.value){if(this.files){if(0===(e=this.files[0]).size)return void r.parentNode.removeChild(r)}else e={name:this.value};e=new h(u.uid,e),this.onchange=function(){},t.call(s),s.files=[e],o.setAttribute("id",e.uid),r.setAttribute("id",e.uid+"_form"),s.trigger("change"),o=r=null}},u.can("summon_file_dialog")&&(i=f.get(l.browse_button),p.removeEvent(i,"click",s.uid),p.addEvent(i,"click",function(e){o&&!o.disabled&&o.click(),e.preventDefault()},s.uid)),c=a,e=n=i=null}.call(this),t=null,o.trigger({type:"ready",async:!0})},disable:function(e){var t;(t=f.get(c))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer();p.removeAllEvents(i,this.uid),p.removeAllEvents(l&&f.get(l.container),this.uid),p.removeAllEvents(l&&f.get(l.browse_button),this.uid),i&&(i.innerHTML=""),t.removeInstance(this.uid),c=d=l=i=t=null}})}}),e("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),e("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,f,p,g,x,E,v,y){return e.XMLHttpRequest=function(){var l,d,h;function m(t){var e,i,n,r,o=this,a=!1;if(h){if(e=h.id.replace(/_iframe$/,""),i=p.get(e+"_form")){for(r=(n=i.getElementsByTagName("input")).length;r--;)switch(n[r].getAttribute("type")){case"hidden":n[r].parentNode.removeChild(n[r]);break;case"file":a=!0}n=[],a||i.parentNode.removeChild(i),i=null}setTimeout(function(){E.removeEvent(h,"load",o.uid),h.parentNode&&h.parentNode.removeChild(h);var e=o.getRuntime().getShimContainer();e.children.length||e.parentNode.removeChild(e),e=h=null,t()},1)}}f.extend(this,{send:function(t,e){var i,n,r,o,a,s,u=this,c=u.getRuntime();if(l=d=null,e instanceof y&&e.hasBlob()){if(o=e.getBlob(),i=o.uid,r=p.get(i),!(n=p.get(i+"_form")))throw new x.DOMException(x.DOMException.NOT_FOUND_ERR)}else i=f.guid("uid_"),(n=document.createElement("form")).setAttribute("id",i+"_form"),n.setAttribute("method",t.method),n.setAttribute("enctype","multipart/form-data"),n.setAttribute("encoding","multipart/form-data"),c.getShimContainer().appendChild(n);n.setAttribute("target",i+"_iframe"),e instanceof y&&e.each(function(e,t){if(e instanceof v)r&&r.setAttribute("name",t);else{var i=document.createElement("input");f.extend(i,{type:"hidden",name:t,value:e}),r?n.insertBefore(i,r):n.appendChild(i)}}),n.setAttribute("action",t.url),a=c.getShimContainer()||document.body,(s=document.createElement("div")).innerHTML='<iframe id="'+i+'_iframe" name="'+i+'_iframe" src="javascript:""" style="display:none"></iframe>',h=s.firstChild,a.appendChild(h),E.addEvent(h,"load",function(){var e;try{e=h.contentWindow.document||h.contentDocument||window.frames[h.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(e.title)?l=e.title.replace(/^(\d+).*$/,"$1"):(l=200,d=f.trim(e.body.innerHTML),u.trigger({type:"progress",loaded:d.length,total:d.length}),o&&u.trigger({type:"uploadprogress",loaded:o.size||1025,total:o.size||1025}))}catch(e){if(!g.hasSameOrigin(t.url))return void m.call(u,function(){u.trigger("error")});l=404}m.call(u,function(){u.trigger("load")})},u.uid),n.submit(),u.trigger("loadstart")},getStatus:function(){return l},getResponse:function(e){if("json"===e&&"string"===f.typeOf(d)&&window.JSON)try{return JSON.parse(d.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}return d},abort:function(){var e=this;h&&h.contentWindow&&(h.contentWindow.stop?h.contentWindow.stop():h.contentWindow.document.execCommand?h.contentWindow.document.execCommand("Stop"):h.src="about:blank"),m.call(this,function(){e.dispatchEvent("abort")})}})}}),e("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),function(e){for(var t=0;t<e.length;t++){for(var i=a,n=e[t],r=n.split(/[.\/]/),o=0;o<r.length-1;++o)i[r[o]]===v&&(i[r[o]]={}),i=i[r[o]];i[r[r.length-1]]=s[n]}}(["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/FileInput","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"])}(this),function(e){"use strict";var r={},o=e.moxie.core.utils.Basic.inArray;(function e(t){var i,n;for(i in t)"object"!=(n=typeof t[i])||~o(i,["Exceptions","Env","Mime"])?"function"==n&&(r[i]=t[i]):e(t[i])})(e.moxie),r.Env=e.moxie.core.utils.Env,r.Mime=e.moxie.core.utils.Mime,r.Exceptions=e.moxie.core.Exceptions,e.mOxie=r,e.o||(e.o=r)}(this); |