moxiecode / plupload

Plupload is JavaScript API for building file uploaders. It supports multiple file selection, file filtering, chunked upload, client side image downsizing and when necessary can fallback to alternative runtimes, like Flash and Silverlight.
http://www.plupload.com
GNU Affero General Public License v3.0
5.63k stars 1.43k forks source link

Plupload not working in IE - javascript error #977

Closed usbhimani closed 10 years ago

usbhimani commented 10 years ago

Plupload is not working on IE. It is giving me the following error:

Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; MS-RTC LM 8; .NET4.0E; InfoPath.3; EIE10;ENUSMCM) Timestamp: Fri, 20 Dec 2013 14:53:11 UTC

Message: Unable to set property 'exec' of undefined or null reference Line: 48 Char: 3 Code: 0 URI: XXXXXXXXXXXXXXXXXXXXXXXXXXXX

Message: Unable to set property 'isOccupied' of undefined or null reference Line: 48 Char: 3 Code: 0 URI: XXXXXXXXXXXXXXXXXXXXXXXX

Message: Unable to get property 'SetReturnValue' of undefined or null reference Line: 1 Char: 212 Code: 0 URI: XXXXXXXXXXXXXXXXXXXXXXXXX

Message: Invalid pointer Line: 15 Char: 11368 Code: 0 URI: ../javascript/plupload.full.min.js

jayarjo commented 10 years ago

Looks like flash component either doesn't exist or is hidden in your case. Could you describe your scenario or perhaps post a code?

usbhimani commented 10 years ago

Flash component exists for sure, as I am able to upload files for first 1-2 instances and then I get the above javascript error.

jayarjo commented 10 years ago

I do not have IE7 here at the moment, but it works properly in IE6. Do you manipulate uploader or it's container in anyway? Maybe you're hiding it or something.

usbhimani commented 10 years ago

Once the below function is called and the file.status == plupload.DONE, I call a custom function that adds the files to a custom HTML table, but no manipulation of the uploader or container

function handleStatus(file) { var actionClass; if (file.status == plupload.DONE) { actionClass = 'plupload_done'; uploadComplete(file); } .... }

Is there anything wrong in calling a custom function here:

Also, I get the following javascript error while working on IE 7+

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.3; MS-RTC LM 8; .NET4.0C; .NET4.0E) Timestamp: Mon, 23 Dec 2013 12:04:53 UTC

Message: Invalid pointer

Line: 15 Char: 11368 Code: 0 URI: ../javascript/plupload.full.min.js

jayarjo commented 10 years ago

But why would you put your function call into the widget's code? Can't you simply hook up onto FileUploaded event?

You didn't mention that you are using the Queue Widget btw. And I should say that we do not support custom tweaks to the source in general.

jayarjo commented 10 years ago

Try to include the dev versions (non-minified ones - they come with the package) at least to get more meaningful reference to the troubled line in the code.

usbhimani commented 10 years ago

I have put the custom function in jquery.plupload.queue.js once the file is uploaded. Is there something still missing or wrong?

The widget code is as below:

jayarjo commented 10 years ago

Remove chunk_size option and see if it affects anything.

usbhimani commented 10 years ago

Hi,

I did try to remove the chunk_size option, but still it does'nt seem to work consistently.

The file upload works

There is a following javascript error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8) Timestamp: Thu, 16 Jan 2014 07:46:02 UTC

Message: 'r' is null or not an object Line: 13 Char: 19039 Code: 0 URI: /plupload.full.min.js

Regards, Umesh Bhimani

jayarjo commented 10 years ago

Errors from minified files are not exactly descriptive, if you could include non-minified versions of the scripts (they also come in package: moxie.js and plupload.dev.js), that could be more helpful.

jayarjo commented 10 years ago

Also in your case - since you have tampered original files. It would be better if you post a link to your case online, so that I could see what is actually happening.

We do not observe any such errors in IE8 on our side.

usbhimani commented 10 years ago

It will not be possible to share the case online.

However, I have emailed you the minified file of plupload which I am using

Also, the error what I suspect is :

setTimeout(function(){r.clients++,s.trigger("RuntimeInit",r)},1)})

Message: 'r' is null or not an object

usbhimani commented 10 years ago

I am using the below plupload version

/**

usbhimani commented 10 years ago

Hi,

I did try to remove the chunk_size option, but still it does'nt seem to work consistently.

The file upload works

There is a following javascript error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8)

Timestamp: Thu, 16 Jan 2014 07:46:02 UTC

Message: 'r' is null or not an object

Line: 13

Char: 19039

Code: 0

URI: /plupload.full.min.js

Regards,

Umesh Bhimani

On 27 December 2013 16:41, Davit Barbakadze notifications@github.comwrote:

Remove chunk_size option and see if it affects anything.

— Reply to this email directly or view it on GitHubhttps://github.com/moxiecode/plupload/issues/977#issuecomment-31256703 .

/**

  • mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
  • v1.0a *
  • Copyright 2013, Moxiecode Systems AB
  • Released under GPL License. *
  • License: http://www.plupload.com/license
  • Contributing: http://www.plupload.com/contributing *
  • Date: 2012-11-13 / (function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;e.length>r;++r){if(n=s[e[r]]||o(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(i,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var n=e,i=t.split(/[.\/]/),r=0;i.length>r;++r){if(!n[i[r]])return;n=n[i[r]]}return n}function a(n){for(var i=0;n.length>i;i++){for(var r=e,o=n[i],a=o.split(/[.\/]/),u=0;a.length-1>u;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={},u="moxie/core/utils/Basic",c="moxie/core/I18n",l="moxie/core/utils/Mime",d="moxie/core/utils/Env",f="moxie/core/utils/Dom",h="moxie/core/Exceptions",p="moxie/core/EventTarget",m="moxie/core/utils/Encode",g="moxie/runtime/Runtime",v="moxie/runtime/RuntimeClient",y="moxie/file/Blob",E="moxie/file/File",R="moxie/file/FileInput",="moxie/file/FileDrop",x="moxie/file/FileReader",w="moxie/core/utils/Url",b="moxie/runtime/RuntimeTarget",A="moxie/file/FileReaderSync",S="moxie/xhr/FormData",T="moxie/xhr/XMLHttpRequest",O="moxie/runtime/Transporter",I="moxie/core/JSON",D="moxie/image/Image",L="moxie/runtime/html5/Runtime",N="moxie/runtime/html5/file/Blob",M="moxie/core/utils/Events",C="moxie/runtime/html5/file/FileInput",F="moxie/runtime/html5/file/FileDrop",P="moxie/runtime/html5/file/FileReader",H="moxie/runtime/html5/xhr/XMLHttpRequest",B="moxie/runtime/html5/utils/BinaryReader",G="moxie/runtime/html5/image/JPEGHeaders",U="moxie/runtime/html5/image/ExifParser",z="moxie/runtime/html5/image/JPEG",k="moxie/runtime/html5/image/PNG",q="moxie/runtime/html5/image/ImageInfo",j="moxie/runtime/html5/image/MegaPixel",X="moxie/runtime/html5/image/Image",V="moxie/runtime/flash/Runtime",W="moxie/runtime/flash/file/Blob",Y="moxie/runtime/flash/file/FileInput",$="moxie/runtime/flash/file/FileReader",K="moxie/runtime/flash/file/FileReaderSync",J="moxie/runtime/flash/xhr/XMLHttpRequest",Z="moxie/runtime/flash/runtime/Transporter",Q="moxie/runtime/flash/image/Image",et="moxie/runtime/silverlight/Runtime",tt="moxie/runtime/silverlight/file/Blob",nt="moxie/runtime/silverlight/file/FileInput",it="moxie/runtime/silverlight/file/FileDrop",rt="moxie/runtime/silverlight/file/FileReader",ot="moxie/runtime/silverlight/file/FileReaderSync",at="moxie/runtime/silverlight/xhr/XMLHttpRequest",st="moxie/runtime/silverlight/runtime/Transporter",ut="moxie/runtime/silverlight/image/Image",ct="moxie/runtime/html4/Runtime",lt="moxie/runtime/html4/file/FileInput",dt="moxie/runtime/html4/file/FileReader",ft="moxie/runtime/html4/xhr/XMLHttpRequest",ht="moxie/runtime/html4/image/Image";i(u,[],function(){var e=function(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},t=function(i){var r;return n(arguments,function(a,s){s>0&&n(a,function(n,a){n!==r&&(e(i[a])===e(n)&&~o(e(n),["array","object"])?t(i[a],n):i[a]=n)})}),i},n=function(e,t){var n,i,r,o;if(e){try{n=e.length}catch(a){n=o}if(n===o){for(i in e)if(e.hasOwnProperty(i)&&t(e[i],i)===!1)return}else for(r=0;n>r;r++)if(t(e[r],r)===!1)return}},i=function(t){var n;if(!t||"object"!==e(t))return!0;for(n in t)return!1;return!0},r=function(t,n){function i(r){"function"===e(t[r])&&tr}var r=0,o=t.length;"function"!==e(n)&&(n=function(){}),t&&t.length||n(),i(r)},o=function(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n}return-1},a=function(t,n){var i=[];"array"!==e(t)&&(t=[t]),"array"!==e(n)&&(n=[n]);for(var r in t)-1===o(t[r],n)&&i.push(t[r]);return i.length?i:!1},s=function(e){var t,n=[];for(t=0;e.length>t;t++)n[t]=e[t];return n},u=function(){var e=0;return function(t){var n=(new Date).getTime().toString(32),i;for(i=0;5>i;i++)n+=Math.floor(65535Math.random()).toString(32);return(t||"o")+n+(e++).toString(32)}}(),c=function(e){return e?String.prototype.trim?String.prototype.trim.call(e):(""+e).replace(/^\s/,"").replace(/\s$/,""):e},l=function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},n;return e=/^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g,"")),n=e[2],e=+e[1],t.hasOwnProperty(n)&&(e=t[n]),e};return{guid:u,typeOf:e,extend:t,each:n,isEmptyObj:i,inSeries:r,inArray:o,arrayDiff:a,toArray:s,trim:c,parseSizeStr:l}}),i(c,[u],function(e){var t={};return{addI18n:function(n){return e.extend(t,n)},translate:function(e){return t[e]||e},:function(e){return this.translate(e)},sprintf:function(e){var t=[].slice.call(arguments,1),n="";return e.split(/%[sdf]/).forEach(function(e){n+=e,t.length&&(n+=t.shift())}),n}}}),i(l,[u,c],function(e,t){var n="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/mp4,m4a,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,3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",i={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;t.length>n;n+=2){for(r=t[n+1].split(/ /),i=0;r.length>i;i++)this.mimes[r[i]]=t[n];this.extensions[t[n]]=r}},extList2mimes:function(t){var n=this,i,r,o,a,s=[];e:for(r=0;t.length>r;r++)for(i=t[r].extensions.split(/\s,\s/),o=0;i.length>o;o++){if(""===i[o]){s=[];break e}a=n.mimes[i[o]],a&&!~e.inArray(a,s)&&s.push(a)}return s},mimes2extList:function(n){var i=this,r=[],o=[];return n=e.trim(n).split(/\s,\s/),""!==n&&e.each(n,function(t){var n=t.match(/^(\w+)\/(_|\w+)$/);n&&(""===n[2]?e.each(i.extensions,function(e,t){RegExp("^"+n[1]+"/").test(t)&&[].push.apply(r,i.extensions[t])}):i.extensions[t]&&[].push.apply(r,i.extensions[t]))}),o.push({title:t.translate("Files"),extensions:r.length?r.join(","):""}),o.mimes=n,o},getFileExtension:function(e){var t=e&&e.match(/.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return i.addMimeType(n),i}),i(d,[u],function(e){function t(e){for(var t,n,i=0;e.length>i;i++)if(t=e[i].s1,n=e[i].prop,o=e[i].sv||e[i].id,t){if(-1!=t.indexOf(e[i].s2))return e[i].id}else if(n)return e[i].id}function n(e){var t=e.indexOf(o);if(-1!=t)return parseFloat(e.substring(t+o.length+1))}var i=[{s1:navigator.userAgent,s2:"Android",id:"Android Browser",sv:"Version"},{s1:navigator.userAgent,s2:"Chrome",id:"Chrome"},{s1:navigator.vendor,s2:"Apple",id:"Safari",sv:"Version"},{prop:window.opera&&window.opera.buildNumber,id:"Opera",sv:"Version"},{s1:navigator.vendor,s2:"KDE",id:"Konqueror"},{s1:navigator.userAgent,s2:"Firefox",id:"Firefox"},{s1:navigator.vendor,s2:"Camino",id:"Camino"},{s1:navigator.userAgent,s2:"Netscape",id:"Netscape"},{s1:navigator.userAgent,s2:"MSIE",id:"IE",sv:"MSIE"},{s1:navigator.userAgent,s2:"Gecko",id:"Mozilla",sv:"rv"}],r=[{s1:navigator.platform,s2:"Win",id:"Windows"},{s1:navigator.platform,s2:"Mac",id:"Mac"},{s1:navigator.userAgent,s2:"iPhone",id:"iOS"},{s1:navigator.userAgent,s2:"iPad",id:"iOS"},{s1:navigator.userAgent,s2:"Android",id:"Android"},{s1:navigator.platform,s2:"Linux",id:"Linux"}],o,a=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){if(!window.XMLHttpRequest)return!1;try{var n=new XMLHttpRequest;if("undefined"!==e.typeOf(n.responseType))return n.open("get","infinity-8.me"),n.responseType=t,n.responseType!==t?!1:!0}catch(i){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==s.browser||s.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(n){var i=[].slice.call(arguments);return i.shift(),"function"===e.typeOf(t[n])?t[n].apply(this,i):!!t[n]}}(),s={can:a,browser:t(i),version:n(navigator.userAgent)||n(navigator.appVersion),OS:t(r),swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return s}),i(f,[d],function(e){var n=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){var n;return""===e.className?!1:(n=RegExp("(^|\s+)"+t+"(\s+|$)"),n.test(e.className))},r=function(e,t){i(e,t)||(e.className=""===e.className?t:e.className.replace(/\s+$/,"")+" "+t)},o=function(e,t){var n=RegExp("(^|\s+)"+t+"(\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})},a=function(e,n){return e.currentStyle?e.currentStyle[n]:window.getComputedStyle?window.getComputedStyle(e,null)[n]:t},s=function(t,n){function i(e){var t,n,i=0,r=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,i=n.left+t.scrollLeft,r=n.top+t.scrollTop),{x:i,y:r}}var r=0,o=0,a,s=document,u,c;if(t=t,n=n||s.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!s.documentMode||8>s.documentMode))return u=i(t),c=i(n),{x:u.x-c.x,y:u.y-c.y};for(a=t;a&&a!=n&&a.nodeType;)r+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=t.parentNode;a&&a!=n&&a.nodeType;)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;return{x:r,y:o}},u=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:n,hasClass:i,addClass:r,removeClass:o,getStyle:a,getPos:s,getSize:u}}),i(h,[u],function(e){function t(e,t){var n;for(n in e)if(e[n]===t)return n;return null}return{RuntimeError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": RuntimeError "+this.code}var i={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(n,i),n.prototype=Error.prototype,n}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": ImageError "+this.code}var i={WRONG_FORMAT:1};return e.extend(n,i),n.prototype=Error.prototype,n}(),FileException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": FileException "+this.code}var i={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};return e.extend(n,i),n.prototype=Error.prototype,n}(),DOMException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": DOMException "+this.code}var i={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};return e.extend(n,i),n.prototype=Error.prototype,n}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPEERR:0}),t.prototype=Error.prototype,t}()}}),i(p,[h,u],function(e,n){function i(){var i={};n.extend(this,{uid:null,init:function(){this.uid||(this.uid=n.guid("uid"))},addEventListener:function(e,r,o,a){var s=this,u;return e=n.trim(e),/\s/.test(e)?(n.each(e.split(/\s+/),function(e){s.addEventListener(e,r,o,a)}),t):(e=e.toLowerCase(),o=parseInt(o,10)||0,u=i[this.uid]&&i[this.uid][e]||[],u.push({fn:r,priority:o,scope:a||this}),i[this.uid]||(i[this.uid]={}),i[this.uid][e]=u,t)},hasEventListener:function(e){return e?!(!i[this.uid]||!i[this.uid][e]):!!i[this.uid]},removeEventListener:function(e,t){e=e.toLowerCase();var r=i[this.uid]&&i[this.uid][e],o;if(r){if(t){for(o=r.length-1;o>=0;o--)if(r[o].fn===t){r.splice(o,1);break}}else r=[];r.length||(delete i[this.uid][e],n.isEmptyObj(i[this.uid])&&delete i[this.uid])}},removeAllEventListeners:function(){i[this.uid]&&delete i[this.uid]},dispatchEvent:function(t){var r,o,a,s,u={};if("string"!==n.typeOf(t)){if(s=t,"string"!==n.typeOf(s.type))throw new e.EventException(e.EventException.UNSPECIFIED_EVENT_TYPE_ERR);t=s.type,s.total&&s.loaded&&(u.total=s.total,u.loaded=s.loaded)}if(-1!==t.indexOf("::")?function(e){r=e[0],t=e[1]}(t.split("::")):r=this.uid,t=t.toLowerCase(),o=i[r]&&i[r][t]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=t,a.unshift(u);var c=[];n.each(o,function(e){a[0].target=e.scope,u.async?c.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):c.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),c.length&&n.inSeries(c)}return!0},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){this.dispatchEvent.apply(this,arguments)},convertEventPropsToHandlers:function(e){var i;"array"!==n.typeOf(e)&&(e=[e]);for(var r=0;e.length>r;r++)i="on"+e[r],"function"===n.typeOf(this[i])?this.addEventListener(e[r],this[i]):this[i]===t&&(this[i]=null)}})}return i.instance=new i,i}),i(m,[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},n=function(e,n){if("function"==typeof window.atob)return n?t(window.atob(e)):window.atob(e);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,h=0,p="",m=[];if(!e)return e;e+="";do s=i.indexOf(e.charAt(f++)),u=i.indexOf(e.charAt(f++)),c=i.indexOf(e.charAt(f++)),l=i.indexOf(e.charAt(f++)),d=s<<18|u<<12|c<<6|l,r=255&d>>16,o=255&d>>8,a=255&d,m[h++]=64==c?String.fromCharCode(r):64==l?String.fromCharCode(r,o):String.fromCharCode(r,o,a);while(e.length>f);return p=m.join(""),n?t(p):p},i=function(t,n){if(n&&e(t),"function"==typeof window.btoa)return window.btoa(t);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,h=0,p="",m=[];if(!t)return t;do r=t.charCodeAt(f++),o=t.charCodeAt(f++),a=t.charCodeAt(f++),d=r<<16|o<<8|a,s=63&d>>18,u=63&d>>12,c=63&d>>6,l=63&d,m[h++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l);while(t.length>f);p=m.join("");var g=t.length%3;return(g?p.slice(0,g-3):p)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:n,btoa:i}}),i(g,[u,f,p],function(e,n,i){function r(i,r,o,s,u){function c(n,r){var o=this,a=i&&i.requiredcaps;return null!==h?h:(a&&!e.isEmptyObj(n)&&e.each(a,function(e,t){if(n.hasOwnProperty(t)){var i=o.can(t,e,n)?"client":"browser";if(h&&h!==i)return h=!1;h=i}}),null===h&&(h=r||"browser"),h&&a&&!this.can(a)&&(h=!1),t)}var l=this,d,f=e.guid(r+""),h=null;a[f]=this,o=e.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!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},o),d=function(){var n={};return{exec:function(e,i,r,o){return d[i]&&(n[e]||(n[e]={context:this,instance:new d[i]}),n[e].instance[r])?n[e].instance[r].apply(this,o):t},removeInstance:function(e){delete n[e]},removeAllInstances:function(){var t=this;e.each(n,function(n,i){"function"===e.typeOf(n.instance.destroy)&&n.instance.destroy.call(n.context),t.removeInstance(i)})}}}(),e.extend(this,{initialized:!1,uid:f,type:r,shimid:f+"_container",clients:0,options:i,can:function(t,n){var i=arguments[2]||o;if("string"===e.typeOf(t)&&"undefined"===e.typeOf(n)&&(t=function(t){var n={};return e.each(t,function(e){n[e]=!0}),n}(t.split(","))),"object"===e.typeOf(t)){for(var r in t)if(!this.can(r,t[r],i))return!1;return!0}var a;return a="function"===e.typeOf(i[t])?i[t].call(this,n):i[t],"boolean"===e.typeOf(n)?a===n:a},getMode:function(){return h||!1},getShimContainer:function(){var t,i=n.get(this.shimid);return i||(t=this.options.container?n.get(this.options.container):document.body,i=document.createElement("div"),i.id=this.shimid,i.className="moxie-shim moxie-shim-"+this.type,e.extend(i.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),t.appendChild(i),t=null),i},getShim:function(){return d},shimExec:function(e,t){var n=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,n)},exec:function(e,t){var n=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,n):l.shimExec.apply(this,arguments)},destroy:function(){var e=n.get(this.shimid);e&&e.parentNode.removeChild(e),d&&d.removeAllInstances(),this.unbindAll(),delete a[this.uid],f=l=d=h=e=null}}),c.call(this,s,u)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=i.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,can:t.can}:null},r}),i(v,[h,u,g],function(e,n,i){return function r(){var r;n.extend(this,{connectRuntime:function(o){function a(n){var u,c;return n.length?(u=n.shift(),(c=i.getConstructor(u))?(r=new c(o),r.bind("Init",function(){r.initialized=!0,setTimeout(function(){r.clients++,s.trigger("RuntimeInit",r)},1)}),r.bind("Error",function(){r.destroy(),a(n)}),r.getMode()?(r.init(),t):(r.trigger("Error"),t)):(a(n),t)):(s.trigger("RuntimeError",new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)),r=null,t)}var s=this,u;if("string"===n.typeOf(o)?u=o:"string"===n.typeOf(o.ruid)&&(u=o.ruid),u){if(r=i.getRuntime(u))return r.clients++,r;throw new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)}a((o.runtimeorder||i.order).split(/\s,\s/))},getRuntime:function(){return r||null},disconnectRuntime:function(){r&&0>=--r.clients&&(r.destroy(),r=null)}})}}),i(y,[u,m,v],function(e,t,n){function i(o,a){function s(t,n,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new i(null,{type:o,size:n-t}),a.detach(s.substr(t,a.size)),a):null}o&&(n.call(this),this.connectRuntime(o)),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,n){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,n)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy",r[this.uid]),this.disconnectRuntime(),this.ruid=null),e=e||"";var n=e.match(/^data:([^;]);base64,/);n&&(this.type=n[1],e=t.atob(e.substring(e.indexOf("base64,")+7))),this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return i}),i(E,[u,l,y],function(e,t,n){function i(i,r){var o,a;if(r||(r={}),a=r.type&&""!==r.type?r.type:t.getFileMime(r.name),r.name)o=r.name.replace(/\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else{var s=a.split("/")[0];o=e.guid((""!==s?s:"file")+""),t.extensions[a]&&(o+="."+t.extensions[a][0])}n.apply(this,arguments),e.extend(this,{type:a||"",name:o||e.guid("file_"),lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return i.prototype=n.prototype,i}),i(R,[u,l,f,h,p,c,E,v],function(e,n,i,r,o,a,s,u){function c(o){var c=this,d,f,h;if(-1!==e.inArray(e.typeOf(o),["string","node"])&&(o={browse_button:o}),f=i.get(o.browse_button),!f)throw new r.DOMException(r.DOMException.NOT_FOUNDERR);h={accept:[{title:a.translate("All Files"),extensions:""}],name:"file",multiple:!1,requiredcaps:!1,container:f.parentNode||document.body},o="object"==typeof o?e.extend({},h,o):h,"string"==typeof o.accept&&(o.accept=n.mimes2extList(o.accept)),d=i.get(o.container),d||(d=document.body),"static"===i.getStyle(d,"position")&&(d.style.position="relative"),d=f=null,u.call(c),e.extend(c,{uid:e.guid("uid"),ruid:null,files:null,init:function(){c.convertEventPropsToHandlers(l),c.bind("RuntimeInit",function(t,n){c.ruid=n.uid,c.bind("Ready",function(){c.trigger("Refresh")},999),c.bind("Change",function(){var t=n.exec.call(c,"FileInput","getFiles");c.files=[],e.each(t,function(e){c.files.push(new s(c.ruid,e))})},999),c.bind("Refresh",function(){var t,r,a,s;a=i.get(o.browsebutton),s=i.get(n.shimid),a&&(t=i.getPos(a,i.get(o.container)),r=i.getSize(a),s&&e.extend(s.style,{top:t.y+"px",left:t.x+"px",width:r.w+"px",height:r.h+"px"})),s=a=null}),n.exec.call(c,"FileInput","init",o)}),c.connectRuntime(o)},disable:function(e){var n=this.getRuntime();n&&n.exec.call(this,"FileInput","disable",e===t?!0:e)}})}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=o.instance,c}),i(,[c,f,h,u,E,v,p,l],function(e,t,n,i,r,o,a,s){function u(n){var a=this,u;"string"==typeof n&&(n={drop_zone:n}),u={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},n="object"==typeof n?i.extend({},u,n):u,n.container=t.get(n.dropzone)||document.body,"static"===t.getStyle(n.container,"position")&&(n.container.style.position="relative"),"string"==typeof n.accept&&(n.accept=s.mimes2extList(n.accept)),o.call(a),i.extend(a,{uid:i.guid("uid"),ruid:null,files:null,init:function(){a.convertEventPropsToHandlers(c),a.bind("RuntimeInit",function(e,t){a.ruid=t.uid,a.bind("Drop",function(){var e=t.exec.call(a,"FileDrop","getFiles");a.files=[],i.each(e,function(e){a.files.push(new r(a.ruid,e))})},999),t.exec.call(a,"FileDrop","init",n),a.dispatchEvent("ready")}),a.connectRuntime(n)}})}var c=["ready","dragenter","dragleave","drop","error"];return u.prototype=a.instance,u}),i(x,[u,h,p,v],function(e,t,n,i){function r(){function n(e,n){if(this.readyState=r.EMPTY,this.error=null,this.readyState===r.LOADING||!n.ruid||!n.uid)throw new t.DOMException(t.DOMException.INVALID_STATEERR);this.convertEventPropsToHandlers(o),this.bind("Error",function(e,t){this.readyState=r.DONE,this.result=null,this.error=t,this.trigger("loadend")},999),this.bind("LoadStart",function(){this.readyState=r.LOADING},999),this.bind("Load",function(){this.readyState=r.DONE,this.trigger("loadend")},999),this.connectRuntime(n.ruid).exec.call(this,"FileReader","read",e,n)}i.call(this),e.extend(this,{uid:e.guid("uid"),readyState:r.EMPTY,result:null,error:null,readAsBinaryString:function(e){this.result="",n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){n.call(this,"readAsDataURL",e)},readAsArrayBuffer:function(e){n.call(this,"readAsArrayBuffer",e)},readAsText:function(e){n.call(this,"readAsText",e)},abort:function(){if(this.result=null,!~e.inArray(this.readyState,[r.EMPTY,r.DONE])){this.readyState===r.LOADING&&(this.readyState=r.DONE);var t=this.getRuntime();t&&t.exec.call(this,"FileReader","abort"),this.bind("Abort",function(){this.trigger("loadend")})}},destroy:function(){this.abort();var e=this.getRuntime();e&&(e.exec.call(this,"FileReader","destroy"),this.disconnectRuntime())}})}var o=["loadstart","progress","load","abort","error","loadend"];return r.EMPTY=0,r.LOADING=1,r.DONE=2,r.prototype=n.instance,r}),i(w,[],function(){var e=function(e){for(var t=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],n=t.length,i={http:80,https:443},r={},o=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]):?([^:@]))?@)?([^:\/?#])(?::(\d))?))?()(?:(()(?:(?:[^?#\/]\/))()(?:[^?#]))(?:\?([^#]))?(?:#(.))?)/,a=o.exec(e||"");n--;)a[n]&&(r[t[n]]=a[n]);if(/^[^\/]/.test(r.path)&&!r.scheme){var s=document.location.pathname;/(\/|\/[^.]+)$/.test(s)||(s=s.replace(/[^\/]+$/,"")),r.host=document.location.hostname,r.path=s+(r.path||"")}return r.scheme||(r.scheme=document.location.protocol.replace(/:$/,"")),r.host||(r.host=document.location.hostname),r.port||(r.port=document.location.port||i[r.scheme]||80),r.port=parseInt(r.port,10),r.path||(r.path="/"),delete r.source,r},t=function(t){var n={http:80,https:443},i=e(t);return i.scheme+"://"+i.host+(i.port!==n[i.scheme]?":"+i.port:"")+i.path+(i.query?i.query:"")},n=function(t){function n(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),n(e())===n(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:n}}),i(b,[u,v,p],function(e,t,n){function i(){this.uid=e.guid("uid"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return i.prototype=n.instance,i}),i(A,[u,v,m],function(e,t,n){return function(){function i(e,t){if(!t.isDetached()){var i=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),i}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+n.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid"),readAsBinaryString:function(e){return i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return i.call(this,"readAsDataURL",e)},readAsText:function(e){return i.call(this,"readAsText",e)}})}}),i(S,[h,u,y],function(e,t,n){function i(){var e,i={},r="";t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof n?(e&&delete i[e],e=r,i[r]=[o]):"array"===s?(r+="[]",t.each(o,function(e){a.append.call(a,r,e)})):"object"===s?t.each(o,function(e,t){a.append.call(a,r+"["+t+"]",e)}):(o=""+o,i[r]||(i[r]=[]),i[r].push(o))},hasBlob:function(){return!!e},getBlob:function(){return i[e]&&i[e][0]||null},getBlobName:function(){return e||null},each:function(e){t.each(i,function(n,i){t.each(n,function(t){e(t,i)})})},destroy:function(){e=null,r="",i={}}})}return i}),i(T,[u,h,p,m,w,b,y,A,S,d,l],function(e,n,i,r,o,a,s,u,c,l,d){function f(){this.uid=e.guid("uid")}function h(){function i(e,n){return A.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?A[e]:b[e]:(l.can("define_property")?A[e]=n:b[e]=n,t):t}function u(){return!window.XMLHttpRequest||"IE"===l.browser&&8>l.version?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;e.length>t;t++)try{return new ActiveXObject(e[t])}catch(n){}}():new window.XMLHttpRequest}function y(e){var t=e.responseXML,n=e.responseText;return"IE"===l.browser&&n&&t&&!t.documentElement&&/[^\/]+\/[^+]++xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(n)),t&&("IE"===l.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function E(){var t=this,n=0;Y=g,X=u(),X.onreadystatechange=function r(){switch(i("readyState")>h.HEADERS_RECEIVED&&(i("status",X.status),i("statusText",X.statusText)),i("readyState",X.readyState),X.readyState!==h.OPENED&&t.dispatchEvent("readystatechange"),i("readyState")){case h.OPENED:r.loadstartDispatched||(t.dispatchEvent("loadstart"),r.loadstartDispatched=!0);break;case h.HEADERS_RECEIVED:try{G&&(n=X.getResponseHeader("Content-Length")||0)}catch(e){}break;case h.LOADING:var o=0;try{X.responseText&&(o=X.responseText.length)}catch(e){o=0}t.dispatchEvent({type:"progress",lengthComputable:!!n,total:parseInt(n,10),loaded:o});break;case h.DONE:X.onreadystatechange=function(){},0===X.status?(B=!0,t.dispatchEvent("error")):(i("responseText",X.responseText),i("responseXML",y(X)),i("response","document"===i("responseType")?i("responseXML"):i("responseText")),V=X.getAllResponseHeaders(),t.dispatchEvent("load")),X=null,t.dispatchEvent("loadend")}},X.open(O,T,S,D,L),e.isEmptyObj(I)||e.each(I,function(e,t){X.setRequestHeader(t,e)}),X.send()}function R(t){function n(){X.destroy(),X=null,o.dispatchEvent("loadend"),o=null}function r(r){X.bind("LoadStart",function(e){i("readyState",h.LOADING),o.dispatchEvent(e),P&&o.upload.dispatchEvent(e)}),X.bind("Progress",function(e){i("readyState",h.LOADING),o.dispatchEvent("readystatechange"),o.dispatchEvent(e)}),X.bind("UploadProgress",function(e){P&&o.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),X.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(X,"XMLHttpRequest","getStatus")||0)),i("statusText",p[i("status")]||""),i("response",r.exec.call(X,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),V=r.exec.call(X,"XMLHttpRequest","getAllResponseHeaders"),o.dispatchEvent("readystatechange"),i("status")>0?(P&&o.upload.dispatchEvent(t),o.dispatchEvent(t)):(B=!0,o.dispatchEvent("error")),n()}),X.bind("Abort",function(e){o.dispatchEvent(e),n()}),X.bind("Error",function(e){B=!0,i("readyState",h.DONE),o.dispatchEvent("readystatechange"),H=!0,o.dispatchEvent(e),n()}),r.exec.call(X,"XMLHttpRequest","send",{url:T,method:O,async:S,user:D,password:L,headers:I,mimeType:M,encoding:N,responseType:o.responseType,withCredentials:o.withCredentials,options:j},t)}var o=this;Y=v,X=new a,j.required_caps=e.extend({},j.required_caps,{return_responsetype:o.responseType}),j.ruid?r(X.connectRuntime(j)):(X.bind("RuntimeInit",function(e,t){r(t)}),X.bind("RuntimeError",function(e,t){o.dispatchEvent("RuntimeError",t)}),X.connectRuntime(j))}function (e){U=(new Date).getTime(),x.call(this)?E.call(this,e):R.call(this,e)}function x(){return G&&("HEAD"===O||"GET"===O&&!!~e.inArray(i("responseType"),["","text","document"])||"POST"===O&&"application/x-www-form-urlencoded"===I["Content-Type"])}function w(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),U=z=null}var b=this,A={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},S=!0,T,O,I={},D,L,N=null,M=null,C=!1,F=!1,P=!1,H=!1,B=!1,G=!1,U,z,k=null,q=null,j={},X,V="",W,Y=g;e.extend(this,A,{uid:e.guid("uid_"),upload:new f,open:function(t,a,s,u,c){var l;if(!t||!a)throw new n.DOMException(n.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(t)||r.utf8_encode(t)!==t)throw new n.DOMException(n.DOMException.SYNTAX_ERR);if(~e.inArray(t.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(O=t.toUpperCase()),~e.inArray(O,["CONNECT","TRACE","TRACK"]))throw new n.DOMException(n.DOMException.SECURITY_ERR); if(a=r.utf8_encode(a),l=o.parseUrl(a),G=o.hasSameOrigin(l),T=o.resolveUrl(a),(u||c)&&!G)throw new n.DOMException(n.DOMException.INVALID_ACCESS_ERR);if(D=u||l.user,L=c||l.pass,S=s||!0,S===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new n.DOMException(n.DOMException.INVALID_ACCESS_ERR);C=!S,F=!1,I={},w.call(this),i("readyState",h.OPENED),this.convertEventPropsToHandlers(["readystatechange"]),this.dispatchEvent("readystatechange")},setRequestHeader:function(t,o){var a=["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"];if(i("readyState")!==h.OPENED||F)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(t)||r.utf8_encode(t)!==t)throw new n.DOMException(n.DOMException.SYNTAX_ERR);return t=e.trim(t).toLowerCase(),~e.inArray(t,a)||/^(proxy-|sec-)/.test(t)?!1:(I[t]?I[t]+=", "+o:I[t]=o,!0)},getAllResponseHeaders:function(){return V||""},getResponseHeader:function(t){return t=t.toLowerCase(),B||~e.inArray(t,["set-cookie","set-cookie2"])?null:V&&""!==V&&(W||(W={},e.each(V.split(/\r\n/),function(t){var n=t.split(/:\s+/);2===n.length&&(n[0]=e.trim(n[0]),W[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),W.hasOwnProperty(t))?W[t].header+": "+W[t].value:null},overrideMimeType:function(t){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new n.DOMException(n.DOMException.INVALID_STATEERR);if(t=e.trim(t.toLowerCase()),/;/.test(t)&&(r=t.match(/^([^;]+)(?:;\scharset\=)?(.)$/))&&(t=r[1],r[2]&&(o=r[2])),!d.mimes[t])throw new n.DOMException(n.DOMException.SYNTAX_ERR);k=t,q=o},send:function(t,i){if(j="string"===e.typeOf(i)?{ruid:i}:i?i:{},this.convertEventPropsToHandlers(m),this.upload.convertEventPropsToHandlers(m),this.readyState!==h.OPENED||F)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(!x())if(t instanceof s)j.ruid=t.ruid,M=t.type;else if(t instanceof c){if(t.hasBlob()){var o=t.getBlob();j.ruid=o.ruid,M=o.type}}else"string"==typeof t&&(N="UTF-8",M="text/plain;charset=UTF-8",t=r.utf8_encode(t));this.withCredentials||(this.withCredentials=j.required_caps&&j.required_caps.send_browsercookies&&!G),P=!C&&this.upload.hasEventListener(),B=!1,H=!t,C||(F=!0),.call(this,t)},abort:function(){var t;if(B=!0,C=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),F=!1,Y===g)X.abort(),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort"),this.dispatchEvent("loadend"),H||(this.upload.dispatchEvent("abort"),this.upload.dispatchEvent("loadend"));else{if("function"!==e.typeOf(X.getRuntime)||!(t=X.getRuntime()))throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);t.exec.call(X,"XMLHttpRequest","abort",H)}H=!0}},destroy:function(){X&&("function"===e.typeOf(X.destroy)&&X.destroy(),X=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}})}var p={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"};f.prototype=i.instance;var m=["loadstart","progress","abort","error","load","timeout","loadend"],g=1,v=2;return h.UNSENT=0,h.OPENED=1,h.HEADERSRECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),i(O,[u,m,v,p],function(e,t,n,i){function r(){function i(){l=d=0,c=this.result=null}function o(t,n){var i=this;u=n,i.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(i.state,[r.IDLE,r.DONE])&&a.call(i)},999),i.bind("TransportingComplete",function(){d=l,i.state=r.DONE,c=null,i.result=u.exec.call(i,"Transporter","getAsBlob",t||"")},999),i.state=r.BUSY,i.trigger("TransportingStarted"),a.call(i)}function a(){var e=this,n,i=l-d;f>i&&(f=i),n=t.btoa(c.substr(d,f)),u.exec.call(e,"Transporter","receive",n,l)}var s,u,c,l,d,f;n.call(this),e.extend(this,{uid:e.guid("uid"),state:r.IDLE,result:null,transport:function(t,n,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),f=r.chunk_size,i.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,n,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,n,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),i.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),i.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=i.instance,r}),i(I,[],function(){return!!window.JSON&&JSON.parse||function(){var e,n,i={'"':'"',"\":"\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},r,o=function(t){throw{name:"SyntaxError",message:t,at:e,text:r}},a=function(t){return t&&t!==n&&o("Expected '"+t+"' instead of '"+n+"'"),n=r.charAt(e),e+=1,n},s=function(){var e,i="";for("-"===n&&(i="-",a("-"));n>="0"&&"9">=n;)i+=n,a();if("."===n)for(i+=".";a()&&n>="0"&&"9">=n;)i+=n;if("e"===n||"E"===n)for(i+=n,a(),("-"===n||"+"===n)&&(i+=n,a());n>="0"&&"9">=n;)i+=n,a();return e=+i,isFinite(e)?e:(o("Bad number"),t)},u=function(){var e,t,r="",s;if('"'===n)for(;a();){if('"'===n)return a(),r;if("\"===n)if(a(),"u"===n){for(s=0,t=0;4>t&&(e=parseInt(a(),16),isFinite(e));t+=1)s=16_s+e;r+=String.fromCharCode(s)}else{if("string"!=typeof i[n])break;r+=i[n]}else r+=n}o("Bad string")},c=function(){for(;n&&" ">=n;)a()},l=function(){switch(n){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o("Unexpected '"+n+"'")},d,f=function(){var e=[];if("["===n){if(a("["),c(),"]"===n)return a("]"),e;for(;n;){if(e.push(d()),c(),"]"===n)return a("]"),e;a(","),c()}}o("Bad array")},h=function(){var e,t={};if("{"===n){if(a("{"),c(),"}"===n)return a("}"),t;for(;n;){if(e=u(),c(),a(":"),Object.hasOwnProperty.call(t,e)&&o('Duplicate key "'+e+'"'),t[e]=d(),c(),"}"===n)return a("}"),t;a(","),c()}}o("Bad object")};return d=function(){switch(c(),n){case"{":return h();case"[":return f();case'"':return u();case"-":return s();default:return n>="0"&&"9">=n?s():l()}},function(i,a){var s;return r=i,e=0,n=" ",s=d(),c(),n&&o("Syntax error"),"function"==typeof a?function u(e,n){var i,r,o=e[n];if(o&&"object"==typeof o)for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r=u(o,i),r!==t?o[i]=r:delete o[i]);return a.call(e,n,o)}({"":s},""):s}}()}),i(D,[u,f,h,A,T,v,O,d,p,y,E,m,I],function(e,n,i,r,o,a,s,u,c,l,d,f,h){function p(){function r(t){if(t||(t=this.getRuntime().exec.call(this,"Image","getInfo")),t)if("string"===e.typeOf(t.meta))try{this.meta=h(t.meta)}catch(n){}else this.meta=t.meta;e.extend(this,{size:parseInt(t.size,10),width:parseInt(t.width,10),height:parseInt(t.height,10),type:t.type}),""===this.name&&(this.name=t.name)}function c(t){var n=e.typeOf(t);try{if(t instanceof p){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);g.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONGFORMAT);v.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)/^data:[^;];base64,/.test(t)?c.call(this,new l(null,{data:t}),arguments[1]):y.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName)throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error")}}function g(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)?!0:n)}function v(t,n){function i(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){i(t)}),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resizeimage:!0}},n))):i(this.connectRuntime(t.ruid))}function y(e,t){var n=this,i;i=new o,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){v.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)}a.call(this),e.extend(this,{uid:e.guid("uid"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){r.call(this)},999),this.convertEventPropsToHandlers(m),c.apply(this,arguments)},downsize:function(t,n,r,o){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);(!t&&!n||"undefined"===e.typeOf(r))&&(r=!1),t=t||this.width,n=n||this.height,o="undefined"===e.typeOf(o)?!0:!!o,this.getRuntime().exec.call(this,"Image","downsize",t,n,r,o)},crop:function(e,t,n){this.downsize(e,t,!0,n)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return e||(e="image/jpeg"),"image/jpeg"!==e||t||(t=90),this.getRuntime().exec.call(this,"Image","getAsBlob",e,t)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.getRuntime().exec.call(this,"Image","getAsDataURL",e,t)},getAsBinaryString:function(e,t){var n=this.getAsDataURL(e,t);return f.atob(n.substring(n.indexOf("base64,")+7))},embed:function(r){function o(){if(u.can("create_canvas")){var n=c.getAsCanvas();if(n)return r.appendChild(n),n=null,c.destroy(),a.trigger("embedded"),t}var o=c.getAsDataURL(l,d);if(!o)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",o.length))r.innerHTML='',c.destroy(),a.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){y=a.connectRuntime(this.result.ruid),a.bind("Embedded",function(){e.extend(y.getShimContainer().style,{top:"0px",left:"0px",width:c.width+"px",height:c.height+"px"}),y=null},999),y.exec.call(a,"ImageView","display",this.result.uid,g,v),c.destroy()}),h.transport(f.atob(o.substring(o.indexOf("base64,")+7)),l,e.extend({},m,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:r}))}}var a=this,c,l,d,h,m=arguments[1]||{},g=this.width,v=this.height,y;if(!(r=n.get(r)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(l=m.type||this.type||"image/jpeg",d=m.quality||90,h="undefined"!==e.typeOf(m.crop)?m.crop:!1,m.width)g=m.width,v=m.height||g;else{var E=n.getSize(r);E.w&&E.h&&(g=E.w,v=E.h)}return c=new p,c.bind("Resize",function(){o.call(a)}),c.bind("Load",function(){c.downsize(g,v,h,!1)}),c.clone(this,!1),c},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}})}var m=["progress","load","error","resize","embedded"];return p.prototype=c.instance,p}),i(L,[u,h,g,d],function(e,n,i,r){function o(o){var u=this,c=e.extend({access_binary:!!(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return u.can("access_binary")&&!!s.Image},display_media:r.can("create_canvas")||r.can("use_data_uri_over32kb"),do_cors:function(){return!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest)},drag_and_drop:function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==r.browser||r.version>9)}(),return_response_headers:!0,return_response_type:function(e){return"json"===e?!0:r.can("return_response_type",e)},report_upload_progress:function(){return!(!window.XMLHttpRequest||!(new XMLHttpRequest).upload)},resize_image:function(){return u.can("access_binary")&&r.can("create_canvas")},select_folder:"Chrome"===r.browser&&r.version>=21,select_multiple:!("Safari"===r.browser&&"Windows"===r.OS),send_binary_string:!(!window.XMLHttpRequest||!((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:!!window.XMLHttpRequest,send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||u.can("send_binary_string")},slice_blob:!(!window.File||!(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return u.can("slice_blob")&&u.can("send_multipart")},summon_file_dialog:function(){return"Firefox"===r.browser&&r.version>=4||"Opera"===r.browser&&r.version>=12||!!~e.inArray(r.browser,["Chrome","Safari"])}(),upload_filesize:!0},arguments[2]);i.call(this,o,arguments[1]||a,c),e.extend(this,{init:function(){return window.File&&r.can("use_fileinput")?(this.trigger("Init"),t):(this.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INITERR)),t)},destroy:function(e){return function(){e.call(u),e=u=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),i(N,[L,y],function(e,t){function n(){function e(e,t,n){var i;if(!window.File.prototype.slice)return(i=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(r){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(M,[u],function(e){function n(){this.returnValue=!1}function i(){this.cancelBubble=!0}var r={},o="moxie"+e.guid(),a=function(t,a,s){var u,c,l;l=arguments[3],a=a.toLowerCase(),t.addEventListener?(u=s,t.addEventListener(a,u,!1)):t.attachEvent&&(u=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=n,e.stopPropagation=i,s(e)},t.attachEvent("on"+a,u)),t[o]||(t[o]=e.guid()),r.hasOwnProperty(t[o])||(r[t[o]]={}),c=r[t[o]],c.hasOwnProperty(a)||(c[a]=[]),c[a].push({func:u,orig:s,key:l})},s=function(n,i){var a,s,u;if("function"==typeof arguments[2]?s=arguments[2]:u=arguments[2],i=i.toLowerCase(),n[o]&&r[n[o]]&&r[n[o]][i]){a=r[n[o]][i];for(var c=a.length-1;c>=0&&(a[c].key!==u&&a[c].orig!==s||(n.removeEventListener?n.removeEventListener(i,a[c].func,!1):n.detachEvent&&n.detachEvent("on"+i,a[c].func),a[c].orig=null,a[c].func=null,a.splice(c,1),s===t));c--);if(a.length||delete r[n[o]][i],e.isEmptyObj(r[n[o]])){delete r[n[o]];try{delete n[o]}catch(l){n[o]=t}}}},u=function(t){var n=arguments[1];t&&t[o]&&e.each(r[t[o]],function(e,i){s(t,i,n)})};return{addEvent:a,removeEvent:s,removeAllEvents:u}}),i(C,[L,u,f,M,l],function(e,t,n,i,r){function o(){var e=[],o;t.extend(this,{init:function(a){var s=this,u=s.getRuntime(),c,l,d;o=a,e=[],d=o.accept.mimes||r.extList2mimes(o.accept),l=u.getShimContainer(),l.innerHTML='<input id="'+u.uid+'" type="file" style="font-size:999px;opacity:0;"'+(o.multiple&&u.can("select_multiple")?"multiple":"")+(o.directory&&u.can("select_folder")?"webkitdirectory directory":"")+' accept="'+d.join(",")+'" />',c=n.get(u.uid),t.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),function(){var e,t,r;e=n.get(o.browse_button),u.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),t=parseInt(n.getStyle(e,"z-index"),10)||1,e.style.zIndex=t,l.style.zIndex=t-1,i.addEvent(e,"click",function(e){c&&!c.disabled&&c.click(),e.preventDefault()},s.uid)),r=u.can("summon_file_dialog")?e:l,i.addEvent(r,"mouseover",function(){s.trigger("mouseenter")},s.uid),i.addEvent(r,"mouseout",function(){s.trigger("mouseleave")},s.uid),i.addEvent(r,"mousedown",function(){s.trigger("mousedown")},s.uid),i.addEvent(n.get(o.container),"mouseup",function(){s.trigger("mouseup")},s.uid)}(),c.onchange=function(){e=[],o.directory?t.each(this.files,function(t){"."!==t.name&&e.push(t)}):e=[].slice.call(this.files),this.value="",s.trigger("change")},s.trigger("ready")},getFiles:function(){return e},disable:function(e){var t=this.getRuntime(),i;(i=n.get(t.uid))&&(i.disabled=!!e)},destroy:function(){var t=this.getRuntime(),r=t.getShimContainer();i.removeAllEvents(r,this.uid),i.removeAllEvents(n.get(o.container),this.uid),i.removeAllEvents(n.get(o.browse_button),this.uid),r.innerHTML="",e=o=null}})}return e.FileInput=o}),i(F,[L,u,f,M,l],function(e,t,n,i,r){function o(){function e(e){var n=u.accept.mimes||r.extList2mimes(u.accept),i=e.type||r.getFileMime(e.name)||"";return n.length&&-1===t.inArray(i,n)?!1:!0}function n(e,n){var i=[];t.each(e,function(e){i.push(function(t){o(e,t)})}),t.inSeries(i,function(){n()})}function o(t,n){t.isFile?t.file(function(t){e(t)&&s.push(t),n()},function(){n()}):t.isDirectory?a(t,n):n()}function a(e,t){function i(e){o.readEntries(function(t){t.length?([].push.apply(r,t),i(e)):e()},e)}var r=[],o=e.createReader();i(function(){n(r,t)})}var s=[],u;t.extend(this,{init:function(r){var o=this,a;u=r,a=u.container,i.addEvent(a,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},o.uid),i.addEvent(a,"drop",function(i){if(i.preventDefault(),i.stopPropagation(),s=[],i.dataTransfer.items&&i.dataTransfer.items[0].webkitGetAsEntry){var r=[];t.each(i.dataTransfer.items,function(e){r.push(e.webkitGetAsEntry())}),n(r,function(){o.trigger("drop")})}else t.each(i.dataTransfer.files,function(t){e(t)&&s.push(t)}),o.trigger("drop")},o.uid),i.addEvent(a,"dragenter",function(e){e.preventDefault(),e.stopPropagation(),o.trigger("dragenter")},o.uid),i.addEvent(a,"dragleave",function(e){e.preventDefault(),e.stopPropagation(),o.trigger("dragleave")},o.uid)},getFiles:function(){return s}})}return e.FileDrop=o}),i(P,[L,u],function(e,t){function n(){this.read=function(e,n){var i=this,r=new window.FileReader;(function(){function e(e){~t.inArray(e.type,["progress","load"])&&(i.result=r.result),i.trigger(e)}function n(){t.each(o,function(t){r.removeEventListener(t,e)}),r.removeEventListener("loadend",n)}var o=["loadstart","progress","load","abort","error"];t.each(o,function(t){r.addEventListener(t,e)}),r.addEventListener("loadend",n)})(),"function"===t.typeOf(r[e])&&re}}return e.FileReader=n}),i(H,[L,u,E,y,S,h,d,I],function(e,n,i,r,o,a,s,u){function c(){function e(e){var t="----moxieboundary"+(new Date).getTime(),n="--",i="\r\n",o="",s=this.getRuntime();if(!s.can("send_binary_string"))throw new a.RuntimeError(a.RuntimeError.NOT_SUPPORTED_ERR);return l.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){o+=e instanceof r?n+t+i+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+i+"Content-Type: "+e.type+i+i+e.getSource()+i:n+t+i+'Content-Disposition: form-data; name="'+a+'"'+i+i+unescape(encodeURIComponent(e))+i}),o+=n+t+n+i}var c=this,l,d;n.extend(this,{send:function(i,a){var u=this,f=!1,h,p,m,g="Mozilla"===s.browser&&s.version>=4&&7>s.version,v="Android Browser"===s.browser;return(g||v)&&a instanceof o&&a.hasBlob()&&!a.getBlob().isDetached()&&(p=a.getBlob().getSource(),p instanceof window.Blob&&window.FileReader)?(m=new window.FileReader,m.onload=function(){a.append(a.getBlobName(),new r(null,{type:p.type,data:m.result})),c.send.call(u,i,a)},m.readAsBinaryString(p),t):(l=new window.XMLHttpRequest,d=i.url.replace(/^.+?\/([\w-.]+)$/,"$1").toLowerCase(),l.open(i.method,i.url,i.async,i.user,i.password),n.isEmptyObj(i.headers)||n.each(i.headers,function(e,t){l.setRequestHeader(t,e)}),""!==i.responseType&&(l.responseType="json"!==i.responseType||s.can("return_response_type","json")?i.responseType:"text"),i.withCredentials&&(l.withCredentials=!0),function(){function e(e){u.trigger(e)}function t(e){u.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})}function i(){n.each(r,function(t){l.removeEventListener(t,e)}),l.removeEventListener("loadend",i),l.upload&&l.upload.removeEventListener("progress",t),l=null}var r=["loadstart","progress","abort","error","load","timeout"];n.each(r,function(t){l.addEventListener(t,e)}),l.upload&&l.upload.addEventListener("progress",t),l.addEventListener("loadend",i)}(),a instanceof r?(a.isDetached()&&(f=!0),a=a.getSource()):a instanceof o&&(a.hasBlob()&&a.getBlob().isDetached()?(a=e.call(u,a),f=!0):(h=new window.FormData,a.each(function(e,t){e instanceof r?h.append(t,e.getSource()):h.append(t,e)}),a=h)),f?l.sendAsBinary?l.sendAsBinary(a):function(){for(var e=new Uint8Array(a.length),t=0;a.length>t;t++)e[t]=255&a.charCodeAt(t);l.send(e.buffer)}():l.send(a),t)},getStatus:function(){try{if(l)return l.status}catch(e){}},getResponse:function(e){var t=this.getRuntime();try{if(l){if("blob"===e){var n=new i(t.uid,l.response);try{var r=l.getResponseHeader("Content-Disposition");if(r){var o=r.match(/filename=([\'\"'])([^\1]+)\1/);o&&(d=o[2])}}catch(a){}return n.name=d,n}return"json"!==e||s.can("return_responsetype","json")?l.response:200===l.status?u(l.response):null}}catch(a){}},getAllResponseHeaders:function(){try{return l.getAllResponseHeaders()}catch(e){}return""},abort:function(){l&&l.abort()},destroy:function(){c=d=null}})}return e.XMLHttpRequest=c}),i(B,[],function(){return function(){function e(e,t){var n=r?0:-8(t-1),i=0,a;for(a=0;t>a;a++)i|=o.charCodeAt(e+a)<<Math.abs(n+8a);return i}function n(e,t,n){n=3===arguments.length?n:o.length-t-1,o=o.substr(0,t)+e+o.substr(n+t)}function i(e,t,i){var o="",a=r?0:-8(i-1),s;for(s=0;i>s;s++)o+=String.fromCharCode(255&t>>Math.abs(a+8_s));n(o,e,i)}var r=!1,o;return{II:function(e){return e===t?r:(r=e,t)},init:function(e){r=!1,o=e},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return o.substr(e,o.length-e-1);case 2:return o.substr(e,t);case 3:n(i,e,t);break;default:return o}},BYTE:function(t){return e(t,1)},SHORT:function(t){return e(t,2)},LONG:function(n,r){return r===t?e(n,4):(i(n,r,4),t)},SLONG:function(t){var n=e(t,4);return n>2147483647?n-4294967296:n},STRING:function(t,n){var i="";for(n+=t;n>t;t++)i+=String.fromCharCode(e(t,1));return i}}}}),i(G,[B],function(e){return function t(n){var i=[],r,o,a,s=0;if(r=new e,r.init(n),65496===r.SHORT(0)){for(o=2;n.length>=o;)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;s=r.SHORT(o+2)+2,a>=65505&&65519>=a&&i.push({hex:a,name:"APP"+(15&a),start:o,length:s,segment:r.SEGMENT(o,s)}),o+=s}return r.init(null),{headers:i,restore:function(e){var t,n;for(r.init(e),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,t=i.length;t>n;n++)r.SEGMENT(o,0,i[n].segment),o+=i[n].length;return e=r.SEGMENT(),r.init(null),e},strip:function(e){var n,i,o;for(i=new t(e),n=i.headers,i.purge(),r.init(e),o=n.length;o--;)r.SEGMENT(n[o].start,n[o].length,"");return e=r.SEGMENT(),r.init(null),e},get:function(e){for(var t=[],n=0,r=i.length;r>n;n++)i[n].name===e.toUpperCase()&&t.push(i[n].segment);return t},set:function(e,t){var n=[],r,o,a;for("string"==typeof t?n.push(t):n=t,r=o=0,a=i.length;a>r&&(i[r].name===e.toUpperCase()&&(i[r].segment=n[o],i[r].length=n[o].length,o++),!(o>=n.length));r++);},purge:function(){i=[],r.init(null),r=null}}}}}),i(U,[u,B],function(e,n){return function i(){function i(e,n){var i=a.SHORT(e),r,o,s,u,d,f,h,p,m=[],g={};for(r=0;i>r;r++)if(h=f=e+12_r+2,s=n[a.SHORT(h)],s!==t){switch(u=a.SHORT(h+=2),d=a.LONG(h+=2),h+=4,m=[],u){case 1:case 7:for(d>4&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.BYTE(h+o);break;case 2:d>4&&(h=a.LONG(h)+c.tiffHeader),g[s]=a.STRING(h,d-1);continue;case 3:for(d>2&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.SHORT(h+2_o);break;case 4:for(d>1&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.LONG(h+4_o);break;case 5:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.LONG(h+4_o)/a.LONG(h+4_o+4);break;case 9:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4_o);break;case 10:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4_o)/a.SLONG(h+4_o+4);break;default:continue}p=1==d?m[0]:m,g[s]=l.hasOwnProperty(s)&&"object"!=typeof p?l[s][p]:p}return g}function r(){var e=c.tiffHeader;return a.II(18761==a.SHORT(e)),42!==a.SHORT(e+=2)?!1:(c.IFD0=c.tiffHeader+a.LONG(e+=2),u=i(c.IFD0,s.tiff),"ExifIFDPointer"in u&&(c.exifIFD=c.tiffHeader+u.ExifIFDPointer,delete u.ExifIFDPointer),"GPSInfoIFDPointer"in u&&(c.gpsIFD=c.tiffHeader+u.GPSInfoIFDPointer,delete u.GPSInfoIFDPointer),!0)}function o(e,t,n){var i,r,o,u=0;if("string"==typeof t){var l=s[e.toLowerCase()];for(var d in l)if(l[d]===t){t=d;break}}i=c[e.toLowerCase()+"IFD"],r=a.SHORT(i);for(var f=0;r>f;f++)if(o=i+12_f+2,a.SHORT(o)==t){u=o+8;break}return u?(a.LONG(u,n),!0):!1}var a,s,u,c={},l;return a=new n,s={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"}},l={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"}},{init:function(e){return c={tiffHeader:10},e!==t&&e.length?(a.init(e),65505===a.SHORT(0)&&"EXIF\0"===a.STRING(4,5).toUpperCase()?r():!1):!1},TIFF:function(){return u},EXIF:function(){var t;if(t=i(c.exifIFD,s.exif),t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";t.ExifVersion.length>n;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}return t},GPS:function(){var t;return t=i(c.gpsIFD,s.gps),t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join(".")),t},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:o("exif",e,t)},getBinary:function(){return a.SEGMENT()},purge:function(){a.init(null),a=u=null,c={}}}}}),i(z,[u,h,G,B,U],function(e,n,i,r,o){function a(a){function s(){for(var e=0,t,n;c.length>=e;){if(t=l.SHORT(e+=2),t>=65472&&65475>=t)return e+=5,{height:l.SHORT(e),width:l.SHORT(e+=2)};n=l.SHORT(e+=2),e+=n-2}return null}function u(){f&&d&&l&&(f.purge(),d.purge(),l.init(null),c=h=d=f=l=null)}var c,l,d,f,h,p;if(c=a,l=new r,l.init(c),65496!==l.SHORT(0))throw new n.ImageError(n.ImageError.WRONG_FORMAT);d=new i(a),f=new o,p=!!f.init(d.get("app1")[0]),h=s.call(this),e.extend(this,{type:"image/jpeg",size:c.length,width:h&&h.width||0,height:h&&h.height||0,setExif:function(n,i){return p?("object"===e.typeOf(n)?e.each(n,function(e,t){f.setExif(t,e)}):f.setExif(n,i),d.set("app1",f.getBinary()),t):!1},writeHeaders:function(){return arguments.length?d.restore(arguments[0]):c=d.restore(c)},stripHeaders:function(e){return d.strip(e)},purge:function(){u.call(this)}}),p&&(this.meta={tiff:f.TIFF(),exif:f.EXIF(),gps:f.GPS()})}return a}),i(k,[h,u,B],function(e,t,n){function i(i){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:u.LONG(t),height:u.LONG(t+=4)}):null}function o(){u&&(u.init(null),s=d=c=l=u=null)}function a(e){var t,n,i,r;return t=u.LONG(e),n=u.STRING(e+=4,4),i=e+=4,r=u.LONG(e+t),{length:t,type:n,start:i,CRC:r}}var s,u,c,l,d;s=i,u=new n,u.init(s),function(){var t=0,n=0,i=[35152,20039,3338,6666];for(n=0;i.length>n;n++,t+=2)if(i[n]!=u.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),d=r.call(this),t.extend(this,{type:"image/png",size:s.length,width:d.width,height:d.height,purge:function(){o.call(this)}}),o.call(this)}return i}),i(q,[u,h,z,k],function(e,t,n,i){return function(r){var o=[n,i],a;a=function(){for(var e=0;o.length>e;e++)try{return new oe}catch(n){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){}}),e.extend(this,a),this.purge=function(){a.purge(),a=null}}}),i(j,[],function(){function e(e,i,r){var o=e.naturalWidth,a=e.naturalHeight,s=r.width,u=r.height,c=r.x||0,l=r.y||0,d=i.getContext("2d");t(e)&&(o/=2,a/=2);var f=1024,h=document.createElement("canvas");h.width=h.height=f;for(var p=h.getContext("2d"),m=n(e,o,a),g=0;a>g;){for(var v=g+f>a?a-g:f,y=0;o>y;){var E=y+f>o?o-y:f;p.clearRect(0,0,f,f),p.drawImage(e,-y,-g);var R=ys/o+c<<0,=Math.ceil(Es/o),x=gu/a/m+l<<0,w=Math.ceil(vu/a/m);d.drawImage(h,0,0,E,v,R,x,_,w),y+=f}g+=f}h=p=null}function t(e){var t=e.naturalWidth,n=e.naturalHeight;if(tn>1048576){var i=document.createElement("canvas");i.width=i.height=1;var r=i.getContext("2d");return r.drawImage(e,-t+1,0),0===r.getImageData(0,0,1,1).data[3]}return!1}function n(e,t,n){var i=document.createElement("canvas");i.width=1,i.height=n;var r=i.getContext("2d");r.drawImage(e,0,0);for(var o=r.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1 }i=null;var l=u/n;return 0===l?1:l}return{isSubsampled:t,renderTo:e}}),i(X,[L,u,h,m,y,q,j,l,d],function(e,n,i,r,o,a,s,u,c){function l(){function e(){if(!_&&!E)throw new i.ImageError(i.DOMException.INVALID_STATEERR);return ||E}functio
jayarjo commented 10 years ago

This is not helpful. You either organize a test case online with dev versions of the scripts, or we won't be able to troubleshoot this. It doesn't have to be your actual website. Just a case, failing with the error that you mention. Sorry.