This commit is contained in:
Igor Nazarenko 2015-03-26 15:31:48 -07:00
parent f529962fa7
commit e3da0071b6
11 changed files with 658 additions and 380 deletions

View File

@ -6,24 +6,24 @@ Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.le
var b="array"==b?[]:{},c;for(c in a)b[c]=sa(a[c]);return b}return a},ta="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),ua=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var g=0;g<ta.length;g++)c=ta[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}},va=function(a){var b=arguments.length;if(1==b&&n(arguments[0]))return va.apply(null,arguments[0]);for(var c={},d=0;d<b;d++)c[arguments[d]]=
!0;return c};var x=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,x);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};v(x,Error);x.prototype.name="CustomError";var wa=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")},xa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},ya=function(a,b){return a<b?-1:a>b?1:0};var za=function(a,b){b.unshift(a);x.call(this,wa.apply(null,b));b.shift()};v(za,x);za.prototype.name="AssertionError";
var Aa=function(a,b,c,d){var e="Assertion failed";if(c)var e=e+(": "+c),g=d;else a&&(e+=": "+a,g=b);throw new za(""+e,g||[]);},y=function(a,b,c){a||Aa("",null,b,Array.prototype.slice.call(arguments,2));return a},Ba=function(a,b){throw new za("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));},Ca=function(a,b,c){q(a)||Aa("Expected function but got %s: %s.",[ca(a),a],b,Array.prototype.slice.call(arguments,2))};var z=Array.prototype,Da=z.indexOf?function(a,b,c){y(null!=a.length);return z.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(p(a))return p(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},Ea=z.forEach?function(a,b,c){y(null!=a.length);z.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,g=0;g<d;g++)g in e&&b.call(c,e[g],g,a)},Fa=z.map?function(a,b,c){y(null!=a.length);return z.map.call(a,b,c)}:
function(a,b,c){for(var d=a.length,e=Array(d),g=p(a)?a.split(""):a,f=0;f<d;f++)f in g&&(e[f]=b.call(c,g[f],f,a));return e},Ga=z.some?function(a,b,c){y(null!=a.length);return z.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&b.call(c,e[g],g,a))return!0;return!1},Ia=function(a){var b;t:{b=Ha;for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break t}b=-1}return 0>b?null:p(a)?a.charAt(b):a[b]},Ja=function(a,b){var c=
function(a,b,c){for(var d=a.length,e=Array(d),g=p(a)?a.split(""):a,f=0;f<d;f++)f in g&&(e[f]=b.call(c,g[f],f,a));return e},Ga=z.some?function(a,b,c){y(null!=a.length);return z.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,g=0;g<d;g++)if(g in e&&b.call(c,e[g],g,a))return!0;return!1},Ia=function(a){var b;a:{b=Ha;for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:p(a)?a.charAt(b):a[b]},Ja=function(a,b){var c=
Da(a,b),d;if(d=0<=c)y(null!=a.length),z.splice.call(a,c,1);return d},Ka=function(a){return z.concat.apply(z,arguments)},La=function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(da(d)){var e=a.length||0,g=d.length||0;a.length=e+g;for(var f=0;f<g;f++)a[e+f]=d[f]}else a.push(d)}},Ma=function(a,b,c){y(null!=a.length);return 2>=arguments.length?z.slice.call(a,b):z.slice.call(a,b,c)},Na=function(a){for(var b={},c=0,d=0;d<a.length;){var e=a[d++],g=r(e)?"o"+(e[fa]||(e[fa]=++ga)):(typeof e).charAt(0)+
e;Object.prototype.hasOwnProperty.call(b,g)||(b[g]=!0,a[c++]=e)}a.length=c};var Oa=function(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},Pa=function(a){return eval("("+a+")")},Ra=function(a){this.qa=a};Ra.prototype.h=function(a){var b=[];Sa(this,a,b);return b.join("")};
e;Object.prototype.hasOwnProperty.call(b,g)||(b[g]=!0,a[c++]=e)}a.length=c};var Oa=function(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},Pa=function(a){return eval("("+a+")")},Qa=function(a){this.qa=a};Qa.prototype.h=function(a){var b=[];Sa(this,a,b);return b.join("")};
var Sa=function(a,b,c){switch(typeof b){case "string":Ta(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(n(b)){var d=b.length;c.push("[");for(var e="",g=0;g<d;g++)c.push(e),e=b[g],Sa(a,a.qa?a.qa.call(b,String(g),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(e=b[g],"function"!=typeof e&&(c.push(d),Ta(g,
c),c.push(":"),Sa(a,a.qa?a.qa.call(b,g,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}},Ua={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Va=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Ta=function(a,b){b.push('"',a.replace(Va,function(a){if(a in Ua)return Ua[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return Ua[a]=
e+b.toString(16)}),'"')};va("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));va("action","cite","data","formaction","href","manifest","poster","src");va("embed","iframe","link","object","script","style","template");var A;t:{var Wa=k.navigator;if(Wa){var Xa=Wa.userAgent;if(Xa){A=Xa;break t}}A=""};var Ya=function(){return-1!=A.indexOf("Edge")||-1!=A.indexOf("Trident")||-1!=A.indexOf("MSIE")};var Za=function(){return-1!=A.indexOf("Edge")};var $a=-1!=A.indexOf("Opera")||-1!=A.indexOf("OPR"),B=Ya(),ab=-1!=A.indexOf("Gecko")&&!(-1!=A.toLowerCase().indexOf("webkit")&&!Za())&&!(-1!=A.indexOf("Trident")||-1!=A.indexOf("MSIE"))&&!Za(),bb=-1!=A.toLowerCase().indexOf("webkit")&&!Za(),cb=function(){var a=A;if(ab)return/rv\:([^\);]+)(\)|;)/.exec(a);if(B&&Za())return/Edge\/([\d\.]+)/.exec(a);if(B)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(bb)return/WebKit\/(\S+)/.exec(a)},db=function(){var a=k.document;return a?a.documentMode:void 0},
eb=function(){if($a&&k.opera){var a=k.opera.version;return q(a)?a():a}var a="",b=cb();b&&(a=b?b[1]:"");return B&&!Za()&&(b=db(),b>parseFloat(a))?String(b):a}(),fb={},C=function(a){var b;if(!(b=fb[a])){b=0;for(var c=xa(String(eb)).split("."),d=xa(String(a)).split("."),e=Math.max(c.length,d.length),g=0;0==b&&g<e;g++){var f=c[g]||"",m=d[g]||"",P=RegExp("(\\d*)(\\D*)","g"),ha=RegExp("(\\d*)(\\D*)","g");do{var T=P.exec(f)||["","",""],Qa=ha.exec(m)||["","",""];if(0==T[0].length&&0==Qa[0].length)break;b=
ya(0==T[1].length?0:parseInt(T[1],10),0==Qa[1].length?0:parseInt(Qa[1],10))||ya(0==T[2].length,0==Qa[2].length)||ya(T[2],Qa[2])}while(0==b)}b=fb[a]=0<=b}return b},gb=k.document,hb=db(),ib=!gb||!B||!hb&&Za()?void 0:hb||("CSS1Compat"==gb.compatMode?parseInt(eb,10):5);!ab&&!B||B&&B&&(Za()||9<=ib)||ab&&C("1.9.1");B&&C("9");var kb=function(a,b){la(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in jb?a.setAttribute(jb[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})},jb={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};var lb=function(a){k.setTimeout(function(){throw a;},0)},mb,nb=function(){var a=k.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&-1==A.indexOf("Presto")&&(a=function(){var a=document.createElement("iframe");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+
"//"+b.location.host,a=t(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!Ya()){var b=new a,c={},d=c;b.port1.onmessage=function(){if(l(c.next)){c=c.next;var a=c.Za;c.Za=null;a()}};return function(a){d.next={Za:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?
function(a){var b=document.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){k.setTimeout(a,0)}};var ob=function(a,b,c){this.Wb=c;this.Db=a;this.ic=b;this.na=0;this.ka=null};ob.prototype.get=function(){var a;0<this.na?(this.na--,a=this.ka,this.ka=a.next,a.next=null):a=this.Db();return a};ob.prototype.put=function(a){this.ic(a);this.na<this.Wb&&(this.na++,a.next=this.ka,this.ka=a)};var pb=function(){this.ya=this.H=null},rb=new ob(function(){return new qb},function(a){a.reset()},100);pb.prototype.add=function(a,b){var c=rb.get();c.set(a,b);this.ya?this.ya.next=c:(y(!this.H),this.H=c);this.ya=c};pb.prototype.remove=function(){var a=null;this.H&&(a=this.H,this.H=this.H.next,this.H||(this.ya=null),a.next=null);return a};var qb=function(){this.next=this.scope=this.Ja=null};qb.prototype.set=function(a,b){this.Ja=a;this.scope=b;this.next=null};
qb.prototype.reset=function(){this.next=this.scope=this.Ja=null};var wb=function(a,b){sb||tb();ub||(sb(),ub=!0);vb.add(a,b)},sb,tb=function(){if(k.Promise&&k.Promise.resolve){var a=k.Promise.resolve();sb=function(){a.then(xb)}}else sb=function(){var a=xb;!q(k.setImmediate)||k.Window&&k.Window.prototype&&k.Window.prototype.setImmediate==k.setImmediate?(mb||(mb=nb()),mb(a)):k.setImmediate(a)}},ub=!1,vb=new pb;[].push(function(){ub=!1;vb=new pb});var xb=function(){for(var a=null;a=vb.remove();){try{a.Ja.call(a.scope)}catch(b){lb(b)}rb.put(a)}ub=!1};var yb=function(a){a.prototype.then=a.prototype.then;a.prototype.$goog_Thenable=!0},zb=function(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};var Db=function(a,b){this.l=0;this.w=void 0;this.I=this.u=this.e=null;this.ia=this.Ia=!1;if(a==Ab)Bb(this,2,b);else try{var c=this;a.call(b,function(a){Bb(c,2,a)},function(a){if(!(a instanceof Cb))try{if(a instanceof Error)throw a;throw Error("Promise rejected.");}catch(b){}Bb(c,3,a)})}catch(d){Bb(this,3,d)}},Eb=function(){this.next=this.context=this.aa=this.L=this.D=null;this.Ba=!1};Eb.prototype.reset=function(){this.context=this.aa=this.L=this.D=null;this.Ba=!1};
var Fb=new ob(function(){return new Eb},function(a){a.reset()},100),Gb=function(a,b,c){var d=Fb.get();d.L=a;d.aa=b;d.context=c;return d},Ab=function(){};Db.prototype.then=function(a,b,c){null!=a&&Ca(a,"opt_onFulfilled should be a function.");null!=b&&Ca(b,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?");return Hb(this,q(a)?a:null,q(b)?b:null,c)};yb(Db);
e+b.toString(16)}),'"')};va("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));var A;a:{var Wa=k.navigator;if(Wa){var Xa=Wa.userAgent;if(Xa){A=Xa;break a}}A=""};var Ya=function(){return-1!=A.indexOf("Edge")||-1!=A.indexOf("Trident")||-1!=A.indexOf("MSIE")};var Za=function(){return-1!=A.indexOf("Edge")};var $a=-1!=A.indexOf("Opera")||-1!=A.indexOf("OPR"),B=Ya(),ab=-1!=A.indexOf("Gecko")&&!(-1!=A.toLowerCase().indexOf("webkit")&&!Za())&&!(-1!=A.indexOf("Trident")||-1!=A.indexOf("MSIE"))&&!Za(),bb=-1!=A.toLowerCase().indexOf("webkit")&&!Za(),cb=function(){var a=A;if(ab)return/rv\:([^\);]+)(\)|;)/.exec(a);if(B&&Za())return/Edge\/([\d\.]+)/.exec(a);if(B)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(bb)return/WebKit\/(\S+)/.exec(a)},db=function(){var a=k.document;return a?a.documentMode:void 0},
eb=function(){if($a&&k.opera){var a=k.opera.version;return q(a)?a():a}var a="",b=cb();b&&(a=b?b[1]:"");return B&&!Za()&&(b=db(),b>parseFloat(a))?String(b):a}(),fb={},C=function(a){var b;if(!(b=fb[a])){b=0;for(var c=xa(String(eb)).split("."),d=xa(String(a)).split("."),e=Math.max(c.length,d.length),g=0;0==b&&g<e;g++){var f=c[g]||"",m=d[g]||"",K=RegExp("(\\d*)(\\D*)","g"),ha=RegExp("(\\d*)(\\D*)","g");do{var U=K.exec(f)||["","",""],Ra=ha.exec(m)||["","",""];if(0==U[0].length&&0==Ra[0].length)break;b=
ya(0==U[1].length?0:parseInt(U[1],10),0==Ra[1].length?0:parseInt(Ra[1],10))||ya(0==U[2].length,0==Ra[2].length)||ya(U[2],Ra[2])}while(0==b)}b=fb[a]=0<=b}return b},gb=k.document,hb=db(),ib=!gb||!B||!hb&&Za()?void 0:hb||("CSS1Compat"==gb.compatMode?parseInt(eb,10):5);!ab&&!B||B&&B&&(Za()||9<=ib)||ab&&C("1.9.1");B&&C("9");var kb=function(a,b){la(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in jb?a.setAttribute(jb[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})},jb={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};var lb=function(a,b,c){this.Wb=c;this.Db=a;this.ic=b;this.na=0;this.ka=null};lb.prototype.get=function(){var a;0<this.na?(this.na--,a=this.ka,this.ka=a.next,a.next=null):a=this.Db();return a};lb.prototype.put=function(a){this.ic(a);this.na<this.Wb&&(this.na++,a.next=this.ka,this.ka=a)};var mb=function(a){k.setTimeout(function(){throw a;},0)},nb,ob=function(){var a=k.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&-1==A.indexOf("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+
"//"+b.location.host,a=t(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!Ya()){var b=new a,c={},d=c;b.port1.onmessage=function(){if(l(c.next)){c=c.next;var a=c.Za;c.Za=null;a()}};return function(a){d.next={Za:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?
function(a){var b=document.createElement("SCRIPT");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){k.setTimeout(a,0)}};var pb=function(){this.ya=this.H=null},rb=new lb(function(){return new qb},function(a){a.reset()},100);pb.prototype.add=function(a,b){var c=rb.get();c.set(a,b);this.ya?this.ya.next=c:(y(!this.H),this.H=c);this.ya=c};pb.prototype.remove=function(){var a=null;this.H&&(a=this.H,this.H=this.H.next,this.H||(this.ya=null),a.next=null);return a};var qb=function(){this.next=this.scope=this.Ja=null};qb.prototype.set=function(a,b){this.Ja=a;this.scope=b;this.next=null};
qb.prototype.reset=function(){this.next=this.scope=this.Ja=null};var wb=function(a,b){sb||tb();ub||(sb(),ub=!0);vb.add(a,b)},sb,tb=function(){if(k.Promise&&k.Promise.resolve){var a=k.Promise.resolve();sb=function(){a.then(xb)}}else sb=function(){var a=xb;!q(k.setImmediate)||k.Window&&k.Window.prototype&&k.Window.prototype.setImmediate==k.setImmediate?(nb||(nb=ob()),nb(a)):k.setImmediate(a)}},ub=!1,vb=new pb;[].push(function(){ub=!1;vb=new pb});var xb=function(){for(var a=null;a=vb.remove();){try{a.Ja.call(a.scope)}catch(b){mb(b)}rb.put(a)}ub=!1};var yb=function(a){a.prototype.then=a.prototype.then;a.prototype.$goog_Thenable=!0},zb=function(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};var Db=function(a,b){this.l=0;this.w=void 0;this.I=this.u=this.e=null;this.ia=this.Ia=!1;if(a==Ab)Bb(this,2,b);else try{var c=this;a.call(b,function(a){Bb(c,2,a)},function(a){if(!(a instanceof Cb))try{if(a instanceof Error)throw a;throw Error("Promise rejected.");}catch(b){}Bb(c,3,a)})}catch(d){Bb(this,3,d)}},Eb=function(){this.next=this.context=this.aa=this.L=this.D=null;this.Ba=!1};Eb.prototype.reset=function(){this.context=this.aa=this.L=this.D=null;this.Ba=!1};
var Fb=new lb(function(){return new Eb},function(a){a.reset()},100),Gb=function(a,b,c){var d=Fb.get();d.L=a;d.aa=b;d.context=c;return d},Ab=function(){};Db.prototype.then=function(a,b,c){null!=a&&Ca(a,"opt_onFulfilled should be a function.");null!=b&&Ca(b,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?");return Hb(this,q(a)?a:null,q(b)?b:null,c)};yb(Db);
Db.prototype.cancel=function(a){0==this.l&&wb(function(){var b=new Cb(a);Ib(this,b)},this)};
var Ib=function(a,b){if(0==a.l)if(a.e){var c=a.e;if(c.u){for(var d=0,e=null,g=null,f=c.u;f&&(f.Ba||(d++,f.D==a&&(e=f),!(e&&1<d)));f=f.next)e||(g=f);e&&(0==c.l&&1==d?Ib(c,b):(g?(d=g,y(c.u),y(null!=d),d.next==c.I&&(c.I=d),d.next=d.next.next):Jb(c),Kb(c,e,3,b)))}a.e=null}else Bb(a,3,b)},Mb=function(a,b){a.u||2!=a.l&&3!=a.l||Lb(a);y(null!=b.L);a.I?a.I.next=b:a.u=b;a.I=b},Hb=function(a,b,c,d){var e=Gb(null,null,null);e.D=new Db(function(a,f){e.L=b?function(c){try{var e=b.call(d,c);a(e)}catch(ha){f(ha)}}:
a;e.aa=c?function(b){try{var e=c.call(d,b);!l(e)&&b instanceof Cb?f(b):a(e)}catch(ha){f(ha)}}:f});e.D.e=a;Mb(a,e);return e.D};Db.prototype.sb=function(a){y(1==this.l);this.l=0;Bb(this,2,a)};Db.prototype.tb=function(a){y(1==this.l);this.l=0;Bb(this,3,a)};
var Bb=function(a,b,c){if(0==a.l){if(a==c)b=3,c=new TypeError("Promise cannot resolve to itself");else{if(zb(c)){a.l=1;b=c;c=a.sb;var d=a.tb;b instanceof Db?(null!=c&&Ca(c,"opt_onFulfilled should be a function."),null!=d&&Ca(d,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?"),Mb(b,Gb(c||ba,d||null,a))):b.then(c,d,a);return}if(r(c))try{if(d=c.then,q(d)){Nb(a,c,d);return}}catch(e){b=3,c=e}}a.w=c;a.l=b;a.e=null;Lb(a);3!=b||c instanceof Cb||
Ob(a,c)}},Nb=function(a,b,c){a.l=1;var d=!1,e=function(b){d||(d=!0,a.sb(b))},g=function(b){d||(d=!0,a.tb(b))};try{c.call(b,e,g)}catch(f){g(f)}},Lb=function(a){a.Ia||(a.Ia=!0,wb(a.Ib,a))},Jb=function(a){var b=null;a.u&&(b=a.u,a.u=b.next,b.next=null);a.u||(a.I=null);null!=b&&y(null!=b.L);return b};Db.prototype.Ib=function(){for(var a=null;a=Jb(this);)Kb(this,a,this.l,this.w);this.Ia=!1};
var Kb=function(a,b,c,d){b.D&&(b.D.e=null);if(2==c)b.L.call(b.context,d);else if(null!=b.aa){if(!b.Ba)for(;a&&a.ia;a=a.e)a.ia=!1;b.aa.call(b.context,d)}Fb.put(b)},Ob=function(a,b){a.ia=!0;wb(function(){a.ia&&Pb.call(null,b)})},Pb=lb,Cb=function(a){x.call(this,a)};v(Cb,x);Cb.prototype.name="cancel";/*
var Kb=function(a,b,c,d){b.D&&(b.D.e=null);if(2==c)b.L.call(b.context,d);else if(null!=b.aa){if(!b.Ba)for(;a&&a.ia;a=a.e)a.ia=!1;b.aa.call(b.context,d)}Fb.put(b)},Ob=function(a,b){a.ia=!0;wb(function(){a.ia&&Pb.call(null,b)})},Pb=mb,Cb=function(a){x.call(this,a)};v(Cb,x);Cb.prototype.name="cancel";/*
Portions of this code are from MochiKit, received by
The Closure Authors under the MIT license. All other code is Copyright
2005-2009 The Closure Authors. All Rights Reserved.
@ -31,19 +31,19 @@ var Kb=function(a,b,c,d){b.D&&(b.D.e=null);if(2==c)b.L.call(b.context,d);else if
var Qb=function(a,b){this.ra=[];this.jb=a;this.ab=b||null;this.X=this.K=!1;this.w=void 0;this.Ua=this.Xa=this.Ca=!1;this.va=0;this.e=null;this.Da=0};Qb.prototype.cancel=function(a){if(this.K)this.w instanceof Qb&&this.w.cancel();else{if(this.e){var b=this.e;delete this.e;a?b.cancel(a):(b.Da--,0>=b.Da&&b.cancel())}this.jb?this.jb.call(this.ab,this):this.Ua=!0;this.K||Rb(this,new Sb)}};Qb.prototype.$a=function(a,b){this.Ca=!1;Tb(this,a,b)};
var Tb=function(a,b,c){a.K=!0;a.w=c;a.X=!b;Ub(a)},Wb=function(a){if(a.K){if(!a.Ua)throw new Vb;a.Ua=!1}},Rb=function(a,b){Wb(a);Xb(b);Tb(a,!1,b)},Xb=function(a){y(!(a instanceof Qb),"An execution sequence may not be initiated with a blocking Deferred.")},Yb=function(a,b,c){y(!a.Xa,"Blocking Deferreds can not be re-used");a.ra.push([b,c,void 0]);a.K&&Ub(a)};
Qb.prototype.then=function(a,b,c){var d,e,g=new Db(function(a,b){d=a;e=b});Yb(this,d,function(a){a instanceof Sb?g.cancel():e(a)});return g.then(a,b,c)};yb(Qb);
var Zb=function(a){return Ga(a.ra,function(a){return q(a[1])})},Ub=function(a){if(a.va&&a.K&&Zb(a)){var b=a.va,c=$b[b];c&&(k.clearTimeout(c.Y),delete $b[b]);a.va=0}a.e&&(a.e.Da--,delete a.e);for(var b=a.w,d=c=!1;a.ra.length&&!a.Ca;){var e=a.ra.shift(),g=e[0],f=e[1],e=e[2];if(g=a.X?f:g)try{var m=g.call(e||a.ab,b);l(m)&&(a.X=a.X&&(m==b||m instanceof Error),a.w=b=m);zb(b)&&(d=!0,a.Ca=!0)}catch(P){b=P,a.X=!0,Zb(a)||(c=!0)}}a.w=b;d&&(m=t(a.$a,a,!0),d=t(a.$a,a,!1),b instanceof Qb?(Yb(b,m,d),b.Xa=!0):b.then(m,
var Zb=function(a){return Ga(a.ra,function(a){return q(a[1])})},Ub=function(a){if(a.va&&a.K&&Zb(a)){var b=a.va,c=$b[b];c&&(k.clearTimeout(c.Y),delete $b[b]);a.va=0}a.e&&(a.e.Da--,delete a.e);for(var b=a.w,d=c=!1;a.ra.length&&!a.Ca;){var e=a.ra.shift(),g=e[0],f=e[1],e=e[2];if(g=a.X?f:g)try{var m=g.call(e||a.ab,b);l(m)&&(a.X=a.X&&(m==b||m instanceof Error),a.w=b=m);zb(b)&&(d=!0,a.Ca=!0)}catch(K){b=K,a.X=!0,Zb(a)||(c=!0)}}a.w=b;d&&(m=t(a.$a,a,!0),d=t(a.$a,a,!1),b instanceof Qb?(Yb(b,m,d),b.Xa=!0):b.then(m,
d));c&&(b=new ac(b),$b[b.Y]=b,a.va=b.Y)},Vb=function(){x.call(this)};v(Vb,x);Vb.prototype.message="Deferred has already fired";Vb.prototype.name="AlreadyCalledError";var Sb=function(){x.call(this)};v(Sb,x);Sb.prototype.message="Deferred was canceled";Sb.prototype.name="CanceledError";var ac=function(a){this.Y=k.setTimeout(t(this.kc,this),0);this.ha=a};ac.prototype.kc=function(){y($b[this.Y],"Cannot throw an error that is not scheduled.");delete $b[this.Y];throw this.ha;};var $b={};var fc=function(a){var b={},c=b.document||document,d=document.createElement("SCRIPT"),e={nb:d,ba:void 0},g=new Qb(bc,e),f=null,m=null!=b.timeout?b.timeout:5E3;0<m&&(f=window.setTimeout(function(){cc(d,!0);Rb(g,new dc(1,"Timeout reached for loading script "+a))},m),e.ba=f);d.onload=d.onreadystatechange=function(){d.readyState&&"loaded"!=d.readyState&&"complete"!=d.readyState||(cc(d,b.tc||!1,f),Wb(g),Xb(null),Tb(g,!0,null))};d.onerror=function(){cc(d,!0,f);Rb(g,new dc(0,"Error while loading script "+
a))};kb(d,{type:"text/javascript",charset:"UTF-8",src:a});ec(c).appendChild(d)},ec=function(a){var b=a.getElementsByTagName("HEAD");return b&&0!=b.length?b[0]:a.documentElement},bc=function(){if(this&&this.nb){var a=this.nb;a&&"SCRIPT"==a.tagName&&cc(a,!0,this.ba)}},cc=function(a,b,c){null!=c&&k.clearTimeout(c);a.onload=ba;a.onerror=ba;a.onreadystatechange=ba;b&&window.setTimeout(function(){a&&a.parentNode&&a.parentNode.removeChild(a)},0)},dc=function(a,b){var c="Jsloader error (code #"+a+")";b&&
(c+=": "+b);x.call(this,c);this.code=a};v(dc,x);var gc=function(){this.U=this.U;this.oa=this.oa};gc.prototype.U=!1;gc.prototype.Fb=function(){this.U||(this.U=!0,this.T())};gc.prototype.T=function(){if(this.oa)for(;this.oa.length;)this.oa.shift()()};var hc=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.M=!1;this.mb=!0};hc.prototype.preventDefault=function(){this.defaultPrevented=!0;this.mb=!1};var ic=function(a){ic[" "](a);return a};ic[" "]=ba;var jc=!B||B&&(Za()||9<=ib),kc=B&&!C("9");!bb||C("528");ab&&C("1.9b")||B&&C("8")||$a&&C("9.5")||bb&&C("528");ab&&!C("8")||B&&C("9");var lc=function(a,b){hc.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.bb=this.state=null;if(a){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(ab){var e;t:{try{ic(d.nodeName);e=!0;break t}catch(g){}e=!1}e||(d=null)}}else"mouseover"==
(c+=": "+b);x.call(this,c);this.code=a};v(dc,x);var gc=function(){this.U=this.U;this.oa=this.oa};gc.prototype.U=!1;gc.prototype.Fb=function(){this.U||(this.U=!0,this.T())};gc.prototype.T=function(){if(this.oa)for(;this.oa.length;)this.oa.shift()()};var hc=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.M=!1;this.mb=!0};hc.prototype.preventDefault=function(){this.defaultPrevented=!0;this.mb=!1};var ic=function(a){ic[" "](a);return a};ic[" "]=ba;var jc=!B||B&&(Za()||9<=ib),kc=B&&!C("9");!bb||C("528");ab&&C("1.9b")||B&&C("8")||$a&&C("9.5")||bb&&C("528");ab&&!C("8")||B&&C("9");var lc=function(a,b){hc.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.bb=this.state=null;if(a){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(ab){var e;a:{try{ic(d.nodeName);e=!0;break a}catch(g){}e=!1}e||(d=null)}}else"mouseover"==
c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=bb||void 0!==a.offsetX?a.offsetX:a.layerX;this.offsetY=bb||void 0!==a.offsetY?a.offsetY:a.layerY;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;
this.metaKey=a.metaKey;this.state=a.state;this.bb=a;a.defaultPrevented&&this.preventDefault()}};v(lc,hc);lc.prototype.preventDefault=function(){lc.p.preventDefault.call(this);var a=this.bb;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,kc)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};var mc="closure_listenable_"+(1E6*Math.random()|0),nc=0;var oc=function(a,b,c,d,e){this.G=a;this.pa=null;this.src=b;this.type=c;this.fa=!!d;this.ja=e;this.key=++nc;this.N=this.ea=!1},pc=function(a){a.N=!0;a.G=null;a.pa=null;a.src=null;a.ja=null};var qc=function(a){this.src=a;this.k={};this.ca=0};qc.prototype.add=function(a,b,c,d,e){var g=a.toString();a=this.k[g];a||(a=this.k[g]=[],this.ca++);var f=rc(a,b,d,e);-1<f?(b=a[f],c||(b.ea=!1)):(b=new oc(b,this.src,g,!!d,e),b.ea=c,a.push(b));return b};qc.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.k))return!1;var e=this.k[a];b=rc(e,b,c,d);return-1<b?(pc(e[b]),y(null!=e.length),z.splice.call(e,b,1),0==e.length&&(delete this.k[a],this.ca--),!0):!1};
var sc=function(a,b){var c=b.type;c in a.k&&Ja(a.k[c],b)&&(pc(b),0==a.k[c].length&&(delete a.k[c],a.ca--))};qc.prototype.hc=function(){var a=0,b;for(b in this.k){for(var c=this.k[b],d=0;d<c.length;d++)++a,pc(c[d]);delete this.k[b];this.ca--}};qc.prototype.Ma=function(a,b,c,d){a=this.k[a.toString()];var e=-1;a&&(e=rc(a,b,c,d));return-1<e?a[e]:null};var rc=function(a,b,c,d){for(var e=0;e<a.length;++e){var g=a[e];if(!g.N&&g.G==b&&g.fa==!!c&&g.ja==d)return e}return-1};var tc="closure_lm_"+(1E6*Math.random()|0),uc={},vc=0,wc=function(a,b,c,d,e){if(n(b))for(var g=0;g<b.length;g++)wc(a,b[g],c,d,e);else if(c=xc(c),a&&a[mc])a.ib(b,c,d,e);else{if(!b)throw Error("Invalid event type");var g=!!d,f=yc(a);f||(a[tc]=f=new qc(a));c=f.add(b,c,!1,d,e);c.pa||(d=zc(),c.pa=d,d.src=a,d.G=c,a.addEventListener?a.addEventListener(b.toString(),d,g):a.attachEvent(Ac(b.toString()),d),vc++)}},zc=function(){var a=Bc,b=jc?function(c){return a.call(b.src,b.G,c)}:function(c){c=a.call(b.src,
b.G,c);if(!c)return c};return b},Cc=function(a,b,c,d,e){if(n(b))for(var g=0;g<b.length;g++)Cc(a,b[g],c,d,e);else c=xc(c),a&&a[mc]?a.lc(b,c,d,e):a&&(a=yc(a))&&(b=a.Ma(b,c,!!d,e))&&Dc(b)},Dc=function(a){if(!ea(a)&&a&&!a.N){var b=a.src;if(b&&b[mc])sc(b.r,a);else{var c=a.type,d=a.pa;b.removeEventListener?b.removeEventListener(c,d,a.fa):b.detachEvent&&b.detachEvent(Ac(c),d);vc--;(c=yc(b))?(sc(c,a),0==c.ca&&(c.src=null,b[tc]=null)):pc(a)}}},Ac=function(a){return a in uc?uc[a]:uc[a]="on"+a},Fc=function(a,
b,c,d){var e=!0;if(a=yc(a))if(b=a.k[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var g=b[a];g&&g.fa==c&&!g.N&&(g=Ec(g,d),e=e&&!1!==g)}return e},Ec=function(a,b){var c=a.G,d=a.ja||a.src;a.ea&&Dc(a);return c.call(d,b)},Bc=function(a,b){if(a.N)return!0;if(!jc){var c;if(!(c=b))t:{c=["window","event"];for(var d=k,e;e=c.shift();)if(null!=d[e])d=d[e];else{c=null;break t}c=d}e=c;c=new lc(e,this);d=!0;if(!(0>e.keyCode||void 0!=e.returnValue)){t:{var g=!1;if(0==e.keyCode)try{e.keyCode=-1;break t}catch(f){g=
!0}if(g||void 0==e.returnValue)e.returnValue=!0}e=[];for(g=c.currentTarget;g;g=g.parentNode)e.push(g);for(var g=a.type,m=e.length-1;!c.M&&0<=m;m--){c.currentTarget=e[m];var P=Fc(e[m],g,!0,c),d=d&&P}for(m=0;!c.M&&m<e.length;m++)c.currentTarget=e[m],P=Fc(e[m],g,!1,c),d=d&&P}return d}return Ec(a,new lc(b,this))},yc=function(a){a=a[tc];return a instanceof qc?a:null},Gc="__closure_events_fn_"+(1E9*Math.random()>>>0),xc=function(a){y(a,"Listener can not be null.");if(q(a))return a;y(a.handleEvent,"An object listener must have handleEvent method.");
b,c,d){var e=!0;if(a=yc(a))if(b=a.k[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var g=b[a];g&&g.fa==c&&!g.N&&(g=Ec(g,d),e=e&&!1!==g)}return e},Ec=function(a,b){var c=a.G,d=a.ja||a.src;a.ea&&Dc(a);return c.call(d,b)},Bc=function(a,b){if(a.N)return!0;if(!jc){var c;if(!(c=b))a:{c=["window","event"];for(var d=k,e;e=c.shift();)if(null!=d[e])d=d[e];else{c=null;break a}c=d}e=c;c=new lc(e,this);d=!0;if(!(0>e.keyCode||void 0!=e.returnValue)){a:{var g=!1;if(0==e.keyCode)try{e.keyCode=-1;break a}catch(f){g=
!0}if(g||void 0==e.returnValue)e.returnValue=!0}e=[];for(g=c.currentTarget;g;g=g.parentNode)e.push(g);for(var g=a.type,m=e.length-1;!c.M&&0<=m;m--){c.currentTarget=e[m];var K=Fc(e[m],g,!0,c),d=d&&K}for(m=0;!c.M&&m<e.length;m++)c.currentTarget=e[m],K=Fc(e[m],g,!1,c),d=d&&K}return d}return Ec(a,new lc(b,this))},yc=function(a){a=a[tc];return a instanceof qc?a:null},Gc="__closure_events_fn_"+(1E9*Math.random()>>>0),xc=function(a){y(a,"Listener can not be null.");if(q(a))return a;y(a.handleEvent,"An object listener must have handleEvent method.");
a[Gc]||(a[Gc]=function(b){return a.handleEvent(b)});return a[Gc]};var Hc=function(){gc.call(this);this.r=new qc(this);this.wb=this;this.Sa=null};v(Hc,gc);Hc.prototype[mc]=!0;h=Hc.prototype;h.addEventListener=function(a,b,c,d){wc(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){Cc(this,a,b,c,d)};
h.dispatchEvent=function(a){Ic(this);var b,c=this.Sa;if(c){b=[];for(var d=1;c;c=c.Sa)b.push(c),y(1E3>++d,"infinite loop")}c=this.wb;d=a.type||a;if(p(a))a=new hc(a,c);else if(a instanceof hc)a.target=a.target||c;else{var e=a;a=new hc(d,c);ua(a,e)}var e=!0,g;if(b)for(var f=b.length-1;!a.M&&0<=f;f--)g=a.currentTarget=b[f],e=Jc(g,d,!0,a)&&e;a.M||(g=a.currentTarget=c,e=Jc(g,d,!0,a)&&e,a.M||(e=Jc(g,d,!1,a)&&e));if(b)for(f=0;!a.M&&f<b.length;f++)g=a.currentTarget=b[f],e=Jc(g,d,!1,a)&&e;return e};
h.T=function(){Hc.p.T.call(this);this.r&&this.r.hc();this.Sa=null};h.ib=function(a,b,c,d){Ic(this);this.r.add(String(a),b,!1,c,d)};h.Xb=function(a){this.r.add("ready",a,!0,void 0,void 0)};h.lc=function(a,b,c,d){this.r.remove(String(a),b,c,d)};var Jc=function(a,b,c,d){b=a.r.k[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,g=0;g<b.length;++g){var f=b[g];if(f&&!f.N&&f.fa==c){var m=f.G,P=f.ja||f.src;f.ea&&sc(a.r,f);e=!1!==m.call(P,d)&&e}}return e&&0!=d.mb};
h.T=function(){Hc.p.T.call(this);this.r&&this.r.hc();this.Sa=null};h.ib=function(a,b,c,d){Ic(this);this.r.add(String(a),b,!1,c,d)};h.Xb=function(a){this.r.add("ready",a,!0,void 0,void 0)};h.lc=function(a,b,c,d){this.r.remove(String(a),b,c,d)};var Jc=function(a,b,c,d){b=a.r.k[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,g=0;g<b.length;++g){var f=b[g];if(f&&!f.N&&f.fa==c){var m=f.G,K=f.ja||f.src;f.ea&&sc(a.r,f);e=!1!==m.call(K,d)&&e}}return e&&0!=d.mb};
Hc.prototype.Ma=function(a,b,c,d){return this.r.Ma(String(a),b,c,d)};var Ic=function(a){y(a.r,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};var Kc="StopIteration"in k?k.StopIteration:Error("StopIteration"),Lc=function(){};Lc.prototype.next=function(){throw Kc;};Lc.prototype.vb=function(){return this};var Mc=function(a,b){this.s={};this.i=[];this.xa=this.j=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.xb(a)};Mc.prototype.v=function(){Nc(this);for(var a=[],b=0;b<this.i.length;b++)a.push(this.s[this.i[b]]);return a};Mc.prototype.B=function(){Nc(this);return this.i.concat()};Mc.prototype.S=function(a){return Oc(this.s,a)};
Mc.prototype.remove=function(a){return Oc(this.s,a)?(delete this.s[a],this.j--,this.xa++,this.i.length>2*this.j&&Nc(this),!0):!1};var Nc=function(a){if(a.j!=a.i.length){for(var b=0,c=0;b<a.i.length;){var d=a.i[b];Oc(a.s,d)&&(a.i[c++]=d);b++}a.i.length=c}if(a.j!=a.i.length){for(var e={},c=b=0;b<a.i.length;)d=a.i[b],Oc(e,d)||(a.i[c++]=d,e[d]=1),b++;a.i.length=c}};h=Mc.prototype;h.get=function(a,b){return Oc(this.s,a)?this.s[a]:b};
h.set=function(a,b){Oc(this.s,a)||(this.j++,this.i.push(a),this.xa++);this.s[a]=b};h.xb=function(a){var b;a instanceof Mc?(b=a.B(),a=a.v()):(b=qa(a),a=pa(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.forEach=function(a,b){for(var c=this.B(),d=0;d<c.length;d++){var e=c[d],g=this.get(e);a.call(b,g,e,this)}};h.clone=function(){return new Mc(this)};
@ -57,9 +57,9 @@ this.headers.clone();d&&Qc(d,function(a,b){g.set(b,a)});d=Ia(g.B());c=k.FormData
this.Q,this.a.ontimeout=t(this.ba,this)):this.sa=cd(this.ba,this.Q,this)),bd(this.o,sd(this,"Sending request")),this.la=!0,this.a.send(a),this.la=!1}catch(f){bd(this.o,sd(this,"Send error: "+f.message)),this.ha(5,f)}};var ud=function(a){return B&&C(9)&&ea(a.timeout)&&l(a.ontimeout)},Ha=function(a){return"content-type"==a.toLowerCase()};
E.prototype.ba=function(){"undefined"!=typeof aa&&this.a&&(this.Z="Timed out after "+this.Q+"ms, aborting",bd(this.o,sd(this,this.Z)),this.dispatchEvent("timeout"),this.abort(8))};E.prototype.ha=function(a,b){this.A=!1;this.a&&(this.F=!0,this.a.abort(),this.F=!1);this.Z=b;vd(this);wd(this)};var vd=function(a){a.Ha||(a.Ha=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};
E.prototype.abort=function(){this.a&&this.A&&(bd(this.o,sd(this,"Aborting")),this.A=!1,this.F=!0,this.a.abort(),this.F=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),wd(this))};E.prototype.T=function(){this.a&&(this.A&&(this.A=!1,this.F=!0,this.a.abort(),this.F=!1),wd(this,!0));E.p.T.call(this)};E.prototype.kb=function(){this.U||(this.Na||this.la||this.F?xd(this):this.fc())};E.prototype.fc=function(){xd(this)};
var xd=function(a){if(a.A&&"undefined"!=typeof aa)if(a.za[1]&&4==yd(a)&&2==a.getStatus())bd(a.o,sd(a,"Local request error detected and ignored"));else if(a.la&&4==yd(a))cd(a.kb,0,a);else if(a.dispatchEvent("readystatechange"),4==yd(a)){bd(a.o,sd(a,"Request complete"));a.A=!1;try{var b=a.getStatus(),c;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break t;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var g=fd(String(a.ma))[1]||null;if(!g&&self.location)var f=self.location.protocol,
g=f.substr(0,f.length-1);e=!nd.test(g?g.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");else{var m;try{m=2<yd(a)?a.a.statusText:""}catch(P){bd(a.o,"Can not get status: "+P.message),m=""}a.Z=m+" ["+a.getStatus()+"]";vd(a)}}finally{wd(a)}}},wd=function(a,b){if(a.a){td(a);var c=a.a,d=a.za[0]?ba:null;a.a=null;a.za=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(c=a.o)&&c.log(Vc,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}},
td=function(a){a.a&&a.wa&&(a.a.ontimeout=null);ea(a.sa)&&(k.clearTimeout(a.sa),a.sa=null)},yd=function(a){return a.a?a.a.readyState:0};E.prototype.getStatus=function(){try{return 2<yd(this)?this.a.status:-1}catch(a){return-1}};var sd=function(a,b){return b+" ["+a.hb+" "+a.ma+" "+a.getStatus()+"]"};var zd=function(a,b,c){this.q=a||null;this.Sb=!!c},Ad=function(a){a.d||(a.d=new Mc,a.j=0,a.q&&gd(a.q,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))};h=zd.prototype;h.d=null;h.j=null;h.add=function(a,b){Ad(this);this.q=null;a=Bd(this,a);var c=this.d.get(a);c||this.d.set(a,c=[]);c.push(b);this.j++;return this};h.remove=function(a){Ad(this);a=Bd(this,a);return this.d.S(a)?(this.q=null,this.j-=this.d.get(a).length,this.d.remove(a)):!1};h.S=function(a){Ad(this);a=Bd(this,a);return this.d.S(a)};
var xd=function(a){if(a.A&&"undefined"!=typeof aa)if(a.za[1]&&4==yd(a)&&2==a.getStatus())bd(a.o,sd(a,"Local request error detected and ignored"));else if(a.la&&4==yd(a))cd(a.kb,0,a);else if(a.dispatchEvent("readystatechange"),4==yd(a)){bd(a.o,sd(a,"Request complete"));a.A=!1;try{var b=a.getStatus(),c;a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var g=fd(String(a.ma))[1]||null;if(!g&&self.location)var f=self.location.protocol,
g=f.substr(0,f.length-1);e=!nd.test(g?g.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");else{var m;try{m=2<yd(a)?a.a.statusText:""}catch(K){bd(a.o,"Can not get status: "+K.message),m=""}a.Z=m+" ["+a.getStatus()+"]";vd(a)}}finally{wd(a)}}},wd=function(a,b){if(a.a){td(a);var c=a.a,d=a.za[0]?ba:null;a.a=null;a.za=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(c=a.o)&&c.log(Vc,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}},
td=function(a){a.a&&a.wa&&(a.a.ontimeout=null);ea(a.sa)&&(k.clearTimeout(a.sa),a.sa=null)},yd=function(a){return a.a?a.a.readyState:0};E.prototype.getStatus=function(){try{return 2<yd(this)?this.a.status:-1}catch(a){return-1}};E.prototype.getResponseHeader=function(a){return this.a&&4==yd(this)?this.a.getResponseHeader(a):void 0};var sd=function(a,b){return b+" ["+a.hb+" "+a.ma+" "+a.getStatus()+"]"};var zd=function(a,b,c){this.j=this.d=null;this.q=a||null;this.Sb=!!c},Ad=function(a){a.d||(a.d=new Mc,a.j=0,a.q&&gd(a.q,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))};h=zd.prototype;h.add=function(a,b){Ad(this);this.q=null;a=Bd(this,a);var c=this.d.get(a);c||this.d.set(a,c=[]);c.push(b);this.j++;return this};h.remove=function(a){Ad(this);a=Bd(this,a);return this.d.S(a)?(this.q=null,this.j-=this.d.get(a).length,this.d.remove(a)):!1};h.S=function(a){Ad(this);a=Bd(this,a);return this.d.S(a)};
h.B=function(){Ad(this);for(var a=this.d.v(),b=this.d.B(),c=[],d=0;d<b.length;d++)for(var e=a[d],g=0;g<e.length;g++)c.push(b[d]);return c};h.v=function(a){Ad(this);var b=[];if(p(a))this.S(a)&&(b=Ka(b,this.d.get(Bd(this,a))));else{a=this.d.v();for(var c=0;c<a.length;c++)b=Ka(b,a[c])}return b};h.set=function(a,b){Ad(this);this.q=null;a=Bd(this,a);this.S(a)&&(this.j-=this.d.get(a).length);this.d.set(a,[b]);this.j++;return this};
h.get=function(a,b){var c=a?this.v(a):[];return 0<c.length?String(c[0]):b};h.toString=function(){if(this.q)return this.q;if(!this.d)return"";for(var a=[],b=this.d.B(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.v(d),g=0;g<d.length;g++){var f=e;""!==d[g]&&(f+="="+encodeURIComponent(String(d[g])));a.push(f)}return this.q=a.join("&")};h.clone=function(){var a=new zd;a.q=this.q;this.d&&(a.d=this.d.clone(),a.j=this.j);return a};
var Bd=function(a,b){var c=String(b);a.Sb&&(c=c.toLowerCase());return c};var Cd=null,Dd=null,Ed=null,Fd=null,Gd=null,Hd=[],Id=!1,qd=0,Jd={oc:"CANCEL",rc:"UPDATE"},Kd=function(a,b,c){null!=a?Cd=a:Id||(Cd="/api");null!=b?Dd=b:Id||(Dd="https://earthengine.googleapis.com");l(c)&&(Ed=c);Id=!0};
@ -68,11 +68,11 @@ u("ee.data.getXsrfToken",function(){return Ed});u("ee.data.getInfo",function(a,b
u("ee.data.getTileUrl",function(a,b,c,d){var e=Math.pow(2,d);b%=e;0>b&&(b+=e);return[Dd,"map",a.mapid,d,b,c].join("/")+"?token="+a.token});var Nd=function(a,b){a=w(a);return F("/value",G(a),b)};u("ee.data.getValue",Nd);var Od=function(a,b){a=w(a);n(a.size)&&(a.size=a.size.join("x"));var c=G(a).add("getid","1");return F("/thumb",c,b)};u("ee.data.getThumbId",Od);var Pd=function(a){return Dd+"/api/thumb?thumbid="+a.thumbid+"&token="+a.token};u("ee.data.makeThumbUrl",Pd);
var Qd=function(a,b){a=w(a);return F("/download",G(a),b)};u("ee.data.getDownloadId",Qd);var Rd=function(a){return Dd+"/api/download?docid="+a.docid+"&token="+a.token};u("ee.data.makeDownloadUrl",Rd);var Sd=function(a,b){a=w(a);return F("/table",G(a),b)};u("ee.data.getTableDownloadId",Sd);var Td=function(a){return Dd+"/api/table?docid="+a.docid+"&token="+a.token};u("ee.data.makeTableDownloadUrl",Td);
u("ee.data.createAsset",function(a,b,c,d){a={value:a};void 0!==b&&(a.id=b);a.force=c||!1;return F("/create",G(a),d)});u("ee.data.createFolder",function(a,b,c){return F("/createfolder",G({id:a,force:b||!1}),c)});u("ee.data.newTaskId",function(a,b){var c={};ea(a)&&(c.count=a);return F("/newtaskid",G(c),b)});u("ee.data.getTaskStatus",function(a,b){if(p(a))a=[a];else if(!n(a))throw Error("Invalid taskId: expected a string or an array of strings.");return F("/taskstatus?q="+a.join(),null,b,"GET")});
u("ee.data.getTaskList",function(a){return F("/tasklist",null,a,"GET")});u("ee.data.cancelTask",function(a,b){return Ud(a,"CANCEL",b)});var Ud=function(a,b,c){if(p(a))a=[a];else if(!n(a))throw Error("Invalid taskId: expected a string or an array of strings.");var d;t:{for(d in Jd)if(Jd[d]==b){d=!0;break t}d=!1}if(!d)throw Error("Invalid action: "+b);return F("/updatetask",G({id:a,action:b}),c,"POST")};u("ee.data.updateTask",Ud);
u("ee.data.prepareValue",function(a,b,c){b=w(b);b.tid=a;return F("/prepare",G(b),c)});u("ee.data.startProcessing",function(a,b,c){b=w(b);b.id=a;return F("/processingrequest",G(b),c)});u("ee.data.startImport",function(a,b,c){a={id:a,request:(new Ra(void 0)).h(b)};return F("/import",G(a),c)});
var F=function(a,b,c,d){Kd();d=d||"POST";var e={"Content-Type":"application/x-www-form-urlencoded"};null!=Fd&&(e.Authorization=Fd);null!=Ed&&("GET"==d?(a+=-1!=a.indexOf("?")?"&":"?",a+="xsrfToken="+Ed):(b||(b=new zd),b.add("xsrfToken",Ed)));var g=function(a,b,c){var d,e,g;try{d=Pa(b),e=d.data}catch(f){g="Invalid JSON: "+b}r(d)?"error"in d&&"message"in d.error?g=d.error.message:"data"in d||(g="Malformed response: "+b):300<=a.status&&(g="HTTP "+a.status+": "+(b||a.statusText));if(c)return c(e,g),null;
if(!g)return e;throw Error(g);};a=Cd+a;b=b?b.toString():"";if(c)return rd(a,function(a){var b;var d=a.target;try{b=d.a?d.a.responseText:""}catch(e){bd(d.o,"Can not get responseText: "+e.message),b=""}return g(a.target,b,c)},d,b,e),null;var f=D();f.open(d,a,!1);la(e,function(a,b){f.setRequestHeader(b,a)});f.send(b);return g(f,f.responseText,null)},Ld=function(a,b){var c={client_id:Gd,immediate:!0,scope:Hd.join(" ")},d=function(c){c.access_token?(Fd=c.token_type+" "+c.access_token,setTimeout(Ld,1E3*
c.expires_in/2),a&&a()):b&&b(c.error||"Unknown error.")},e=k.gapi.auth.authorize;e(c,function(a){"immediate_failed"==a.error?(c.immediate=!1,e(c,d)):d(a)})},G=function(a){var b=new zd,c;for(c in a)b.set(c,a[c]);return b};var Vd=function(){};var Wd=function(){this.t=-1};var Xd=function(){this.t=-1;this.t=64;this.g=Array(4);this.zb=Array(this.t);this.ta=this.R=0;this.reset()};v(Xd,Wd);Xd.prototype.reset=function(){this.g[0]=1732584193;this.g[1]=4023233417;this.g[2]=2562383102;this.g[3]=271733878;this.ta=this.R=0};
u("ee.data.getTaskList",function(a){return F("/tasklist",null,a,"GET")});u("ee.data.cancelTask",function(a,b){return Ud(a,"CANCEL",b)});var Ud=function(a,b,c){if(p(a))a=[a];else if(!n(a))throw Error("Invalid taskId: expected a string or an array of strings.");var d;a:{for(d in Jd)if(Jd[d]==b){d=!0;break a}d=!1}if(!d)throw Error("Invalid action: "+b);return F("/updatetask",G({id:a,action:b}),c,"POST")};u("ee.data.updateTask",Ud);
u("ee.data.prepareValue",function(a,b,c){b=w(b);b.tid=a;return F("/prepare",G(b),c)});u("ee.data.startProcessing",function(a,b,c){b=w(b);b.id=a;return F("/processingrequest",G(b),c)});u("ee.data.startIngestion",function(a,b,c){a={id:a,request:(new Qa(void 0)).h(b)};return F("/ingestionrequest",G(a),c)});
var F=function(a,b,c,d){Kd();d=d||"POST";var e={"Content-Type":"application/x-www-form-urlencoded"};null!=Fd&&(e.Authorization=Fd);null!=Ed&&("GET"==d?(a+=-1!=a.indexOf("?")?"&":"?",a+="xsrfToken="+Ed):(b||(b=new zd),b.add("xsrfToken",Ed)));var g=function(a,b,c,d){var e,g,f;if("application/json"===b.split(";")[0]||"text/json"===b.split(";")[0])try{e=Pa(c),g=e.data}catch(m){f="Invalid JSON: "+c}else f="Response was unexpectedly not JSON, but "+b;r(e)?"error"in e&&"message"in e.error?f=e.error.message:
"data"in e||(f="Malformed response: "+c):300<=a&&(f="Server returned HTTP code: "+a);if(d)return d(g,f),null;if(!f)return g;throw Error(f);};a=Cd+a;b=b?b.toString():"";if(c)return rd(a,function(a){a=a.target;var b=a.getStatus(),d=a.getResponseHeader("Content-Type"),e;try{e=a.a?a.a.responseText:""}catch(f){bd(a.o,"Can not get responseText: "+f.message),e=""}return g(b,d,e,c)},d,b,e),null;var f=D();f.open(d,a,!1);la(e,function(a,b){f.setRequestHeader(b,a)});f.send(b);var m;try{m=f.getResponseHeader("Content-Type")}catch(K){m=
"application/json"}return g(f.status,m,f.responseText,null)},Ld=function(a,b){var c={client_id:Gd,immediate:!0,scope:Hd.join(" ")},d=function(c){c.access_token?(Fd=c.token_type+" "+c.access_token,setTimeout(Ld,1E3*c.expires_in/2),a&&a()):b&&b(c.error||"Unknown error.")},e=k.gapi.auth.authorize;e(c,function(a){"immediate_failed"==a.error?(c.immediate=!1,e(c,d)):d(a)})},G=function(a){var b=new zd,c;for(c in a)b.set(c,a[c]);return b};var Vd=function(){};var Wd=function(){this.t=-1};var Xd=function(){this.t=-1;this.t=64;this.g=Array(4);this.zb=Array(this.t);this.ta=this.R=0;this.reset()};v(Xd,Wd);Xd.prototype.reset=function(){this.g[0]=1732584193;this.g[1]=4023233417;this.g[2]=2562383102;this.g[3]=271733878;this.ta=this.R=0};
var Yd=function(a,b,c){c||(c=0);var d=Array(16);if(p(b))for(var e=0;16>e;++e)d[e]=b.charCodeAt(c++)|b.charCodeAt(c++)<<8|b.charCodeAt(c++)<<16|b.charCodeAt(c++)<<24;else for(e=0;16>e;++e)d[e]=b[c++]|b[c++]<<8|b[c++]<<16|b[c++]<<24;b=a.g[0];c=a.g[1];var e=a.g[2],g=a.g[3],f=0,f=b+(g^c&(e^g))+d[0]+3614090360&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[1]+3905402710&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[2]+606105819&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&
(g^b))+d[3]+3250441966&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[4]+4118548399&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[5]+1200080426&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[6]+2821735955&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[7]+4249261313&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[8]+1770035416&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[9]+2336552879&4294967295;g=b+(f<<12&4294967295|f>>>20);f=
e+(c^g&(b^c))+d[10]+4294925233&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[11]+2304563134&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[12]+1804603682&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[13]+4254626195&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[14]+2792965006&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[15]+1236535329&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(e^g&(c^e))+d[1]+4129170786&4294967295;b=c+(f<<5&4294967295|
@ -84,7 +84,7 @@ g=b+(f<<11&4294967295|f>>>21);f=e+(g^b^c)+d[15]+530742520&4294967295;e=g+(f<<16&
(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[3]+2399980690&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[10]+4293915773&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[1]+2240044497&4294967295;c=e+(f<<21&4294967295|f>>>11);f=b+(e^(c|~g))+d[8]+1873313359&4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[15]+4264355552&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[6]+2734768916&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[13]+1309151649&4294967295;
c=e+(f<<21&4294967295|f>>>11);f=b+(e^(c|~g))+d[4]+4149444226&4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[11]+3174756917&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[2]+718787259&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[9]+3951481745&4294967295;a.g[0]=a.g[0]+b&4294967295;a.g[1]=a.g[1]+(e+(f<<21&4294967295|f>>>11))&4294967295;a.g[2]=a.g[2]+e&4294967295;a.g[3]=a.g[3]+g&4294967295};
Xd.prototype.update=function(a,b){l(b)||(b=a.length);for(var c=b-this.t,d=this.zb,e=this.R,g=0;g<b;){if(0==e)for(;g<=c;)Yd(this,a,g),g+=this.t;if(p(a))for(;g<b;){if(d[e++]=a.charCodeAt(g++),e==this.t){Yd(this,d);e=0;break}}else for(;g<b;)if(d[e++]=a[g++],e==this.t){Yd(this,d);e=0;break}}this.R=e;this.ta+=b};
var $d=function(){var a=Zd,b=Array((56>a.R?a.t:2*a.t)-a.R);b[0]=128;for(var c=1;c<b.length-8;++c)b[c]=0;for(var d=8*a.ta,c=b.length-8;c<b.length;++c)b[c]=d&255,d/=256;a.update(b);b=Array(16);for(c=d=0;4>c;++c)for(var e=0;32>e;e+=8)b[d++]=a.g[c]>>>e&255;return b};var ae=function(a){this.da="__ee_hash__";this.Pa=!1!==a;this.O=[];this.J={};this.Wa=[]};u("ee.Serializer",ae);var be=new Ra,Zd=new Xd,de=function(a,b){return ce(new ae(l(b)?b:!0),a)};u("ee.Serializer.encode",de);var fe=function(a){return be.h(de(a))};u("ee.Serializer.toJSON",fe);var ge=function(a){a=ce(new ae(!1),a);return"JSON"in k?k.JSON.stringify(a,null," "):be.h(a)};u("ee.Serializer.toReadableJSON",ge);
var $d=function(){var a=Zd,b=Array((56>a.R?a.t:2*a.t)-a.R);b[0]=128;for(var c=1;c<b.length-8;++c)b[c]=0;for(var d=8*a.ta,c=b.length-8;c<b.length;++c)b[c]=d&255,d/=256;a.update(b);b=Array(16);for(c=d=0;4>c;++c)for(var e=0;32>e;e+=8)b[d++]=a.g[c]>>>e&255;return b};var ae=function(a){this.da="__ee_hash__";this.Pa=!1!==a;this.O=[];this.J={};this.Wa=[]};u("ee.Serializer",ae);var be=new Qa,Zd=new Xd,de=function(a,b){return ce(new ae(l(b)?b:!0),a)};u("ee.Serializer.encode",de);var fe=function(a){return be.h(de(a))};u("ee.Serializer.toJSON",fe);var ge=function(a){a=ce(new ae(!1),a);return"JSON"in k?k.JSON.stringify(a,null," "):be.h(a)};u("ee.Serializer.toReadableJSON",ge);
var ce=function(a,b){var c=a.ga(b);a.Pa&&(c=r(c)&&"ValueRef"==c.type&&1==a.O.length?a.O[0][1]:{type:"CompoundValue",scope:a.O,value:c},a.O=[],Ea(a.Wa,t(function(a){delete a[this.da]},a)),a.Wa=[],a.J={});return c};
ae.prototype.ga=function(a){if(!l(a))throw Error("Can't encode an undefined value.");var b,c=r(a)?a[this.da]:null;if(this.Pa&&null!=c&&this.J[c])return{type:"ValueRef",value:this.J[c]};if(null===a||"boolean"==typeof a||ea(a)||p(a))return a;if(r(a)&&"function"==typeof a.getFullYear)return{type:"Invocation",functionName:"Date",arguments:{value:Math.floor(a.getTime())}};if(a instanceof Vd){if(b=a.encode(t(this.ga,this)),!(n(b)||r(b)&&"ArgumentRef"!=b.type))return b}else if(n(a))b=Fa(a,function(a){return this.ga(a)},
this);else if(r(a)&&!q(a))b=oa(a,function(a){if(!q(a))return this.ga(a)},this),ra(b,this.da),b={type:"Dictionary",value:b};else throw Error("Can't encode object: "+a);if(this.Pa){Zd.reset();Zd.update(be.h(b));var c=$d().toString(),d;this.J[c]?d=this.J[c]:(d=String(this.O.length),this.O.push([d,b]),this.J[c]=d);a[this.da]=c;this.Wa.push(a);return{type:"ValueRef",value:d}}return b};var H=function(a,b,c){if(!(this instanceof H))return I(H,arguments);if(c&&(a||b))throw Error('When "opt_varName" is specified, "func" and "args" must be null.');if(a&&!b)throw Error('When "func" is specified, "args" must not be null.');this.b=a;this.c=b;this.f=c||null};v(H,Vd);u("ee.ComputedObject",H);H.prototype.m=function(a){return Nd({json:this.h()},a)};u("ee.ComputedObject.prototype.getInfo",H.prototype.m);
@ -94,61 +94,61 @@ a instanceof H&&"Number"==a.name()},me=function(a){return p(a)||a instanceof H&&
var re=function(a,b,c){var d=l(b),e=a.n(),g=!1;if(1==c.length&&ne(c[0])){var f=e.args;d&&(f=f.slice(1));f.length&&(g=!((1==f.length||f[1].optional)&&"Dictionary"==f[0].type))}if(g){if(c=w(c[0]),d){d=e.args[0].name;if(d in c)throw Error("Named args for "+e.name+" can't contain keyword "+d);c[d]=b}}else c=pe(a,d?[b].concat(c):c);return a.apply(c)},qe=function(a,b){for(var c=a.n().args,d={},e={},g=0;g<c.length;g++){var f=c[g].name;if(f in b&&l(b[f]))d[f]=oe(b[f],c[g].type);else if(!c[g].optional)throw Error("Required argument ("+
f+") missing to function: "+a);e[f]=!0}var c=[],m;for(m in b)e[m]||c.push(m);if(0<c.length)throw Error("Unrecognized arguments ("+c+") to function: "+a);return d},pe=function(a,b){var c=a.n().args;if(c.length<b.length)throw Error("Too many ("+b.length+") arguments to function: "+a);for(var d={},e=0;e<b.length;e++)d[c[e].name]=b[e];return d};
J.prototype.toString=function(a,b){var c=this.n(),d=[];d.push(a||c.name);d.push("(");d.push(Fa(c.args.slice(b?1:0),function(a){return a.name}).join(", "));d.push(")\n");d.push("\n");c.description?d.push(c.description):d.push("Undocumented.");d.push("\n");if(c.args.length){d.push("\nArgs:\n");for(var e=0;e<c.args.length;e++){b&&0==e?d.push(" this:"):d.push("\n ");var g=c.args[e];d.push(g.name);d.push(" (");d.push(g.type);g.optional&&d.push(", optional");d.push("): ");g.description?d.push(g.description):
d.push("Undocumented.")}}return d.join("")};J.prototype.h=function(){return fe(this)};var K=function(a,b){if(!l(b))return se(a);if(!(this instanceof K))return I(K,arguments);this.P=sa(b);this.P.name=a};v(K,J);u("ee.ApiFunction",K);var L=function(a,b){return J.prototype.call.apply(se(a),Array.prototype.slice.call(arguments,1))};u("ee.ApiFunction._call",L);var te=function(a,b){return se(a).apply(b)};u("ee.ApiFunction._apply",te);K.prototype.encode=function(){return this.P.name};K.prototype.n=function(){return this.P};
d.push("Undocumented.")}}return d.join("")};J.prototype.h=function(){return fe(this)};var L=function(a,b){if(!l(b))return se(a);if(!(this instanceof L))return I(L,arguments);this.P=sa(b);this.P.name=a};v(L,J);u("ee.ApiFunction",L);var M=function(a,b){return J.prototype.call.apply(se(a),Array.prototype.slice.call(arguments,1))};u("ee.ApiFunction._call",M);var te=function(a,b){return se(a).apply(b)};u("ee.ApiFunction._apply",te);L.prototype.encode=function(){return this.P.name};L.prototype.n=function(){return this.P};
var ma=null,ue={},we=function(){ve();return oa(ma,function(a){return a.n()})},xe=function(){ve();return na(function(a,b){return!ue[b]})},se=function(a){var b=ye(a);if(!b)throw Error("Unknown built-in function name: "+a);return b};u("ee.ApiFunction.lookup",se);
var ye=function(a){ve();return ma[a]||null},ve=function(a,b){if(ma)a&&a();else{var c=function(c,e){e?b&&b(Error(e)):(ma=oa(c,function(a,b){a.returns=a.returns.replace(/<.*>/,"");for(var c=0;c<a.args.length;c++)a.args[c].type=a.args[c].type.replace(/<.*>/,"");return new K(b,a)}),a&&a())};a?F("/algorithms",null,c,"GET"):c(F("/algorithms",null,void 0,"GET"))}},M=function(a,b,c,d){ve();var e=d||"";la(ma,function(d,f){var m=f.split(".");if(2==m.length&&m[0]==b){var m=e+m[1],P=d.n();ue[f]=!0;var ha=!1;
if(P.args.length)var T=P.args[0].type,ha="Object"!=T&&ke(T,c);T=ha?a.prototype:a;m in T||(T[m]=function(a){return re(d,ha?this:void 0,Array.prototype.slice.call(arguments,0))},T[m].toString=t(d.toString,d,m,ha),T[m].signature=P)}})},N=function(a){var b=function(a){for(var b in a)q(a[b])&&a[b].signature&&delete a[b]};b(a);b(a.prototype)};var O=function(a,b,c){H.call(this,a,b,c);ze()};v(O,H);u("ee.Element",O);var Ae=!1,ze=function(){Ae||(M(O,"Element","Element"),Ae=!0)};O.prototype.name=function(){return"Element"};
O.prototype.set=function(a){var b;if(1>=arguments.length){var c=arguments[0];if(b=ne(c))t:{b=qa(c);var d=["properties"];if(da(b)&&da(d)&&b.length==d.length){for(var e=b.length,g=0;g<e;g++)if(b[g]!==d[g]){b=!1;break t}b=!0}else b=!1}b&&r(c.properties)&&(c=c.properties);if(ne(c)){b=this;for(var f in c)d=c[f],b=L("Element.set",b,f,d)}else if(c instanceof H&&ye("Element.setMulti"))b=L("Element.setMulti",this,c);else throw Error("When Element.set() is passed one argument, it must be a dictionary.");}else{if(0!=
arguments.length%2)throw Error("When Element.set() is passed multiple arguments, there must be an even number of them.");b=this;for(c=0;c<arguments.length;c+=2)f=arguments[c],d=arguments[c+1],b=L("Element.set",b,f,d)}return he(this,b)};u("ee.Element.prototype.set",O.prototype.set);var Q=function(a){if(!(this instanceof Q))return I(Q,arguments);if(a instanceof Q)return a;Be();if(n(a)){if(0==a.length)throw Error("Empty list specified for ee.Filter().");if(1==a.length)return new Q(a[0]);H.call(this,new K("Filter.and"),{filters:a});this.V=a}else if(a instanceof H)H.call(this,a.b,a.c,a.f),this.V=[a];else{if(l(a))throw Error("Invalid argument specified for ee.Filter(): "+a);H.call(this,null,null);this.V=[]}};v(Q,H);u("ee.Filter",Q);
var Ce=!1,Be=function(){Ce||(M(Q,"Filter","Filter"),Ce=!0)},De={equals:"equals",less_than:"lessThan",greater_than:"greaterThan",contains:"stringContains",starts_with:"stringStartsWith",ends_with:"stringEndsWith"};Q.prototype.length=function(){return this.V.length};Q.prototype.length=Q.prototype.length;var R=function(a,b){var c=a.V.slice(0);b instanceof Q?La(c,b.V):b instanceof Array?La(c,b):c.push(b);return new Q(c)};Q.prototype.C=function(){return L("Filter.not",this)};Q.prototype.not=Q.prototype.C;
var Ee=function(a,b,c){b=b.toLowerCase();var d=!1;0==b.lastIndexOf("not_",0)&&(d=!0,b=b.substring(4));if(!(b in De))throw Error("Unknown filtering operator: "+b);a=L("Filter."+De[b],a,c);return d?a.C():a};Q.metadata=Ee;var Fe=function(a,b){return L("Filter.equals",a,b)};Q.eq=Fe;var Ge=function(a,b){return Fe(a,b).C()};Q.neq=Ge;var He=function(a,b){return L("Filter.lessThan",a,b)};Q.lt=He;var Ie=function(a,b){return He(a,b).C()};Q.gte=Ie;var Je=function(a,b){return L("Filter.greaterThan",a,b)};
Q.gt=Je;var Ke=function(a,b){return Je(a,b).C()};Q.lte=Ke;var Le=function(a,b){return L("Filter.stringContains",a,b)};Q.contains=Le;var Me=function(a,b){return Le(a,b).C()};Q.not_contains=Me;var Ne=function(a,b){return L("Filter.stringStartsWith",a,b)};Q.starts_with=Ne;var Oe=function(a,b){return Ne(a,b).C()};Q.not_starts_with=Oe;var Pe=function(a,b){return L("Filter.stringEndsWith",a,b)};Q.ends_with=Pe;var Qe=function(a,b){return Pe(a,b).C()};Q.not_ends_with=Qe;
var Re=function(a){return L("Filter.and",Array.prototype.slice.call(arguments))};Q.and=Re;Q.or=function(a){return L("Filter.or",Array.prototype.slice.call(arguments))};var Se=function(a,b){var c=L("DateRange",a,b);return te("Filter.dateRangeContains",{leftValue:c,rightField:"system:time_start"})};Q.date=Se;var Te=function(a,b,c,d){return te("Filter.listContains",{leftField:c,rightValue:d,rightField:a,leftValue:b})};Q.inList=Te;
var Ue=function(a,b){return te("Filter.intersects",{leftField:".all",rightValue:L("Feature",a),maxError:b})};Q.bounds=Ue;Q.prototype.Hb=function(a){return R(this,Fe.apply(null,[].slice.call(arguments)))};Q.prototype.eq=Q.prototype.Hb;Q.prototype.bc=function(a){return R(this,Ge.apply(null,[].slice.call(arguments)))};Q.prototype.neq=Q.prototype.bc;Q.prototype.Yb=function(a){return R(this,He.apply(null,[].slice.call(arguments)))};Q.prototype.lt=Q.prototype.Yb;
var ye=function(a){ve();return ma[a]||null},ve=function(a,b){if(ma)a&&a();else{var c=function(c,e){e?b&&b(Error(e)):(ma=oa(c,function(a,b){a.returns=a.returns.replace(/<.*>/,"");for(var c=0;c<a.args.length;c++)a.args[c].type=a.args[c].type.replace(/<.*>/,"");return new L(b,a)}),a&&a())};a?F("/algorithms",null,c,"GET"):c(F("/algorithms",null,void 0,"GET"))}},N=function(a,b,c,d){ve();var e=d||"";la(ma,function(d,f){var m=f.split(".");if(2==m.length&&m[0]==b){var m=e+m[1],K=d.n();ue[f]=!0;var ha=!1;
if(K.args.length)var U=K.args[0].type,ha="Object"!=U&&ke(U,c);U=ha?a.prototype:a;m in U||(U[m]=function(a){return re(d,ha?this:void 0,Array.prototype.slice.call(arguments,0))},U[m].toString=t(d.toString,d,m,ha),U[m].signature=K)}})},O=function(a){var b=function(a){for(var b in a)q(a[b])&&a[b].signature&&delete a[b]};b(a);b(a.prototype)};var P=function(a,b,c){H.call(this,a,b,c);ze()};v(P,H);u("ee.Element",P);var Ae=!1,ze=function(){Ae||(N(P,"Element","Element"),Ae=!0)};P.prototype.name=function(){return"Element"};
P.prototype.set=function(a){var b;if(1>=arguments.length){var c=arguments[0];if(b=ne(c))a:{b=qa(c);var d=["properties"];if(da(b)&&da(d)&&b.length==d.length){for(var e=b.length,g=0;g<e;g++)if(b[g]!==d[g]){b=!1;break a}b=!0}else b=!1}b&&r(c.properties)&&(c=c.properties);if(ne(c)){b=this;for(var f in c)d=c[f],b=M("Element.set",b,f,d)}else if(c instanceof H&&ye("Element.setMulti"))b=M("Element.setMulti",this,c);else throw Error("When Element.set() is passed one argument, it must be a dictionary.");}else{if(0!=
arguments.length%2)throw Error("When Element.set() is passed multiple arguments, there must be an even number of them.");b=this;for(c=0;c<arguments.length;c+=2)f=arguments[c],d=arguments[c+1],b=M("Element.set",b,f,d)}return he(this,b)};u("ee.Element.prototype.set",P.prototype.set);var Q=function(a){if(!(this instanceof Q))return I(Q,arguments);if(a instanceof Q)return a;Be();if(n(a)){if(0==a.length)throw Error("Empty list specified for ee.Filter().");if(1==a.length)return new Q(a[0]);H.call(this,new L("Filter.and"),{filters:a});this.V=a}else if(a instanceof H)H.call(this,a.b,a.c,a.f),this.V=[a];else{if(l(a))throw Error("Invalid argument specified for ee.Filter(): "+a);H.call(this,null,null);this.V=[]}};v(Q,H);u("ee.Filter",Q);
var Ce=!1,Be=function(){Ce||(N(Q,"Filter","Filter"),Ce=!0)},De={equals:"equals",less_than:"lessThan",greater_than:"greaterThan",contains:"stringContains",starts_with:"stringStartsWith",ends_with:"stringEndsWith"};Q.prototype.length=function(){return this.V.length};Q.prototype.length=Q.prototype.length;var R=function(a,b){var c=a.V.slice(0);b instanceof Q?La(c,b.V):b instanceof Array?La(c,b):c.push(b);return new Q(c)};Q.prototype.C=function(){return M("Filter.not",this)};Q.prototype.not=Q.prototype.C;
var Ee=function(a,b,c){b=b.toLowerCase();var d=!1;0==b.lastIndexOf("not_",0)&&(d=!0,b=b.substring(4));if(!(b in De))throw Error("Unknown filtering operator: "+b);a=M("Filter."+De[b],a,c);return d?a.C():a};Q.metadata=Ee;var Fe=function(a,b){return M("Filter.equals",a,b)};Q.eq=Fe;var Ge=function(a,b){return Fe(a,b).C()};Q.neq=Ge;var He=function(a,b){return M("Filter.lessThan",a,b)};Q.lt=He;var Ie=function(a,b){return He(a,b).C()};Q.gte=Ie;var Je=function(a,b){return M("Filter.greaterThan",a,b)};
Q.gt=Je;var Ke=function(a,b){return Je(a,b).C()};Q.lte=Ke;var Le=function(a,b){return M("Filter.stringContains",a,b)};Q.contains=Le;var Me=function(a,b){return Le(a,b).C()};Q.not_contains=Me;var Ne=function(a,b){return M("Filter.stringStartsWith",a,b)};Q.starts_with=Ne;var Oe=function(a,b){return Ne(a,b).C()};Q.not_starts_with=Oe;var Pe=function(a,b){return M("Filter.stringEndsWith",a,b)};Q.ends_with=Pe;var Qe=function(a,b){return Pe(a,b).C()};Q.not_ends_with=Qe;
var Re=function(a){return M("Filter.and",Array.prototype.slice.call(arguments))};Q.and=Re;Q.or=function(a){return M("Filter.or",Array.prototype.slice.call(arguments))};var Se=function(a,b){var c=M("DateRange",a,b);return te("Filter.dateRangeContains",{leftValue:c,rightField:"system:time_start"})};Q.date=Se;var Te=function(a,b,c,d){return te("Filter.listContains",{leftField:c,rightValue:d,rightField:a,leftValue:b})};Q.inList=Te;
var Ue=function(a,b){return te("Filter.intersects",{leftField:".all",rightValue:M("Feature",a),maxError:b})};Q.bounds=Ue;Q.prototype.Hb=function(a){return R(this,Fe.apply(null,[].slice.call(arguments)))};Q.prototype.eq=Q.prototype.Hb;Q.prototype.bc=function(a){return R(this,Ge.apply(null,[].slice.call(arguments)))};Q.prototype.neq=Q.prototype.bc;Q.prototype.Yb=function(a){return R(this,He.apply(null,[].slice.call(arguments)))};Q.prototype.lt=Q.prototype.Yb;
Q.prototype.Rb=function(a){return R(this,Ie.apply(null,[].slice.call(arguments)))};Q.prototype.gte=Q.prototype.Rb;Q.prototype.Qb=function(a){return R(this,Je.apply(null,[].slice.call(arguments)))};Q.prototype.gt=Q.prototype.Qb;Q.prototype.Zb=function(a){return R(this,Ke.apply(null,[].slice.call(arguments)))};Q.prototype.lte=Q.prototype.Zb;Q.prototype.contains=function(a){return R(this,Le.apply(null,[].slice.call(arguments)))};Q.prototype.contains=Q.prototype.contains;
Q.prototype.cc=function(a){return R(this,Me.apply(null,[].slice.call(arguments)))};Q.prototype.not_contains=Q.prototype.cc;Q.prototype.jc=function(a){return R(this,Ne.apply(null,[].slice.call(arguments)))};Q.prototype.starts_with=Q.prototype.jc;Q.prototype.ec=function(a){return R(this,Oe.apply(null,[].slice.call(arguments)))};Q.prototype.not_starts_with=Q.prototype.ec;Q.prototype.Gb=function(a){return R(this,Pe.apply(null,[].slice.call(arguments)))};Q.prototype.ends_with=Q.prototype.Gb;
Q.prototype.dc=function(a){return R(this,Qe.apply(null,[].slice.call(arguments)))};Q.prototype.not_ends_with=Q.prototype.dc;Q.prototype.yb=function(a){return R(this,Re.apply(null,[].slice.call(arguments)))};Q.prototype.and=Q.prototype.yb;Q.prototype.Eb=function(a){return R(this,Se.apply(null,[].slice.call(arguments)))};Q.prototype.date=Q.prototype.Eb;Q.prototype.Tb=function(a){return R(this,Te.apply(null,[].slice.call(arguments)))};Q.prototype.inList=Q.prototype.Tb;
Q.prototype.bounds=function(a){return R(this,Ue.apply(null,[].slice.call(arguments)))};Q.prototype.bounds=Q.prototype.bounds;Q.prototype.name=function(){return"Filter"};var S=function(a,b,c){O.call(this,a,b,c);Ve()};v(S,O);u("ee.Collection",S);var We=!1,Ve=function(){We||(M(S,"Collection","Collection"),M(S,"AggregateFeatureCollection","Collection","aggregate_"),We=!0)};S.prototype.filter=function(a){if(!a)throw Error("Empty filters.");return he(this,L("Collection.filter",this,a))};u("ee.Collection.prototype.filter",S.prototype.filter);S.prototype.Mb=function(a,b,c){return this.filter(Ee(a,b,c))};u("ee.Collection.prototype.filterMetadata",S.prototype.Mb);
S.prototype.Kb=function(a){return this.filter(Ue(a))};u("ee.Collection.prototype.filterBounds",S.prototype.Kb);S.prototype.Lb=function(a,b){return this.filter(Se(a,b))};u("ee.Collection.prototype.filterDate",S.prototype.Lb);S.prototype.limit=function(a,b,c){return he(this,L("Collection.limit",this,a,b,c))};u("ee.Collection.prototype.limit",S.prototype.limit);S.prototype.sort=function(a,b){return he(this,L("Collection.limit",this,void 0,a,b))};u("ee.Collection.prototype.sort",S.prototype.sort);
S.prototype.name=function(){return"Collection"};S.prototype.elementType=function(){return O};S.prototype.map=function(a){var b=this.elementType();return he(this,L("Collection.map",this,function(c){return a(new b(c))}))};u("ee.Collection.prototype.map",S.prototype.map);S.prototype.Vb=function(a,b){var c=l(b)?b:null,d=this.elementType();return L("Collection.iterate",this,function(b,c){return a(new d(b),c)},c)};u("ee.Collection.prototype.iterate",S.prototype.Vb);var Xe=function(a){if(!(this instanceof Xe))return I(Xe,arguments);if(a instanceof Xe)return a;Ye();if(ea(a))H.call(this,null,null),this.Ra=a;else if(a instanceof H)H.call(this,a.b,a.c,a.f),this.Ra=null;else throw Error("Invalid argument specified for ee.Number(): "+a);};v(Xe,H);u("ee.Number",Xe);var Ze=!1,Ye=function(){Ze||(M(Xe,"Number","Number"),Ze=!0)};Xe.prototype.encode=function(a){return ea(this.Ra)?this.Ra:Xe.p.encode.call(this,a)};Xe.prototype.name=function(){return"Number"};var U=function(a){if(!(this instanceof U))return I(U,arguments);if(a instanceof U)return a;$e();if(p(a))H.call(this,null,null),this.Va=a;else if(a instanceof H)this.Va=null,a.b&&"String"==a.b.n().returns?H.call(this,a.b,a.c,a.f):H.call(this,new K("String"),{input:a},null);else throw Error("Invalid argument specified for ee.String(): "+a);};v(U,H);u("ee.String",U);var af=!1,$e=function(){af||(M(U,"String","String"),af=!0)};
U.prototype.encode=function(a){return p(this.Va)?this.Va:U.p.encode.call(this,a)};U.prototype.name=function(){return"String"};var bf=function(a,b){if(!(this instanceof bf))return I(bf,arguments);for(var c=[],d=a.args,e=0;e<d.length;e++){var g=d[e],f=g.type;c.push(cf(f in ie?ie[f]:null,g.name))}if(!l(b.apply(null,c)))throw Error("User-defined methods must return a value.");this.P=df(a,c,b);this.Ab=b.apply(null,c)};v(bf,J);u("ee.CustomFunction",bf);bf.prototype.encode=function(a){return{type:"Function",argumentNames:Fa(this.P.args,function(a){return a.name}),body:a(this.Ab)}};bf.prototype.n=function(){return this.P};
var cf=function(a,b){a=a||Object;if(!(a.prototype instanceof H))if(a&&a!=Object)if(a==String)a=U;else if(a==Number)a=Xe;else if(a==Array)a=k.ee.List;else throw Error("Variables must be of an EE type, e.g. ee.Image or ee.Number.");else a=H;var c=function(){};c.prototype=a.prototype;c=new c;c.b=null;c.c=null;c.f=b;return c},ef=function(a,b){var c=Fa(b,function(a){return{name:null,type:p(a)?a:je(a)}}),c={name:"",returns:p("Object")?"Object":je("Object"),args:c};return new bf(c,a)},df=function(a,b,c){for(var d=
[],e=0;e<b.length;e++)null===b[e].f&&d.push(e);if(0==d.length)return a;var g=function(a){var b=0;r(a)&&!q(a)&&("Function"==a.type&&b++,la(a,function(a){b+=g(a)}));return b},e=de(c.apply(null,b));c="_MAPPING_VAR_"+g(e)+"_";for(e=0;e<d.length;e++){var f=d[e],m=c+e;b[f].f=m;a.args[f].name=m}return a};var ff=function(a,b){if(!(this instanceof ff))return I(ff,arguments);if(a instanceof ff)return a;gf();var c=new K("Date"),d={},e=null;if(me(a)){if(d.value=a,b)if(me(b))d.timeZone=b;else throw Error("Invalid argument specified for ee.Date(..., opt_tz): "+b);}else if(le(a))d.value=a;else if(r(a)&&"function"==typeof a.getFullYear)d.value=Math.floor(a.getTime());else if(a instanceof H)a.b&&"Date"==a.b.n().returns?(c=a.b,d=a.c,e=a.f):d.value=a;else throw Error("Invalid argument specified for ee.Date(): "+
a);H.call(this,c,d,e)};v(ff,H);u("ee.Date",ff);var hf=!1,gf=function(){hf||(M(ff,"Date","Date"),hf=!0)};ff.prototype.name=function(){return"Date"};var V=function(a,b,c){if(!(this instanceof V))return I(V,arguments);jf();var d=null!=b||null!=c;if(a instanceof H&&!(a instanceof V&&a.ua)){if(d)throw Error("Setting the CRS or geodesic on a computed Geometry is not suported. Use Geometry.transform().");H.call(this,a.b,a.c,a.f)}else{a instanceof V&&(a=a.encode());if(3<arguments.length)throw Error("The Geometry constructor takes at most 3 arguments ("+arguments.length+" given)");if(!kf(a))throw Error("Invalid GeoJSON geometry: "+JSON.stringify(a));
H.call(this,null,null);this.ua=a.type;this.Cb=a.coordinates||null;this.Nb=a.geometries||null;if(null!=b)this.Ta=b;else if("crs"in a)if(r(a.crs)&&"name"==a.crs.type&&r(a.crs.properties)&&p(a.crs.properties.name))this.Ta=a.crs.properties.name;else throw Error("Invalid CRS declaration in GeoJSON: "+(new Ra).h(a.crs));this.Ka=c;!l(c)&&"geodesic"in a&&(this.Ka=Boolean(a.geodesic))}};v(V,H);u("ee.Geometry",V);
var lf=!1,jf=function(){lf||(M(V,"Geometry","Geometry"),lf=!0)},mf=function(a,b){if(!(this instanceof mf))return nf(mf,arguments);if(2<arguments.length)throw Error("The Geometry.Point constructor takes at most 2 arguments ("+arguments.length+" given)");if(1==arguments.length&&n(arguments[0])&&2==arguments[0].length){var c=arguments[0];a=c[0];b=c[1]}V.call(this,{type:"Point",coordinates:[a,b]})};v(mf,V);V.Point=mf;
Q.prototype.bounds=function(a){return R(this,Ue.apply(null,[].slice.call(arguments)))};Q.prototype.bounds=Q.prototype.bounds;Q.prototype.name=function(){return"Filter"};var S=function(a,b,c){P.call(this,a,b,c);Ve()};v(S,P);u("ee.Collection",S);var We=!1,Ve=function(){We||(N(S,"Collection","Collection"),N(S,"AggregateFeatureCollection","Collection","aggregate_"),We=!0)};S.prototype.filter=function(a){if(!a)throw Error("Empty filters.");return he(this,M("Collection.filter",this,a))};u("ee.Collection.prototype.filter",S.prototype.filter);S.prototype.Mb=function(a,b,c){return this.filter(Ee(a,b,c))};u("ee.Collection.prototype.filterMetadata",S.prototype.Mb);
S.prototype.Kb=function(a){return this.filter(Ue(a))};u("ee.Collection.prototype.filterBounds",S.prototype.Kb);S.prototype.Lb=function(a,b){return this.filter(Se(a,b))};u("ee.Collection.prototype.filterDate",S.prototype.Lb);S.prototype.limit=function(a,b,c){return he(this,M("Collection.limit",this,a,b,c))};u("ee.Collection.prototype.limit",S.prototype.limit);S.prototype.sort=function(a,b){return he(this,M("Collection.limit",this,void 0,a,b))};u("ee.Collection.prototype.sort",S.prototype.sort);
S.prototype.name=function(){return"Collection"};S.prototype.elementType=function(){return P};S.prototype.map=function(a){var b=this.elementType();return he(this,M("Collection.map",this,function(c){return a(new b(c))}))};u("ee.Collection.prototype.map",S.prototype.map);S.prototype.Vb=function(a,b){var c=l(b)?b:null,d=this.elementType();return M("Collection.iterate",this,function(b,c){return a(new d(b),c)},c)};u("ee.Collection.prototype.iterate",S.prototype.Vb);var Xe=function(a){if(!(this instanceof Xe))return I(Xe,arguments);if(a instanceof Xe)return a;Ye();if(ea(a))H.call(this,null,null),this.Ra=a;else if(a instanceof H)H.call(this,a.b,a.c,a.f),this.Ra=null;else throw Error("Invalid argument specified for ee.Number(): "+a);};v(Xe,H);u("ee.Number",Xe);var Ze=!1,Ye=function(){Ze||(N(Xe,"Number","Number"),Ze=!0)};Xe.prototype.encode=function(a){return ea(this.Ra)?this.Ra:Xe.p.encode.call(this,a)};Xe.prototype.name=function(){return"Number"};var T=function(a){if(!(this instanceof T))return I(T,arguments);if(a instanceof T)return a;$e();if(p(a))H.call(this,null,null),this.Va=a;else if(a instanceof H)this.Va=null,a.b&&"String"==a.b.n().returns?H.call(this,a.b,a.c,a.f):H.call(this,new L("String"),{input:a},null);else throw Error("Invalid argument specified for ee.String(): "+a);};v(T,H);u("ee.String",T);var af=!1,$e=function(){af||(N(T,"String","String"),af=!0)};
T.prototype.encode=function(a){return p(this.Va)?this.Va:T.p.encode.call(this,a)};T.prototype.name=function(){return"String"};var bf=function(a,b){if(!(this instanceof bf))return I(bf,arguments);for(var c=[],d=a.args,e=0;e<d.length;e++){var g=d[e],f=g.type;c.push(cf(f in ie?ie[f]:null,g.name))}if(!l(b.apply(null,c)))throw Error("User-defined methods must return a value.");this.P=df(a,c,b);this.Ab=b.apply(null,c)};v(bf,J);u("ee.CustomFunction",bf);bf.prototype.encode=function(a){return{type:"Function",argumentNames:Fa(this.P.args,function(a){return a.name}),body:a(this.Ab)}};bf.prototype.n=function(){return this.P};
var cf=function(a,b){a=a||Object;if(!(a.prototype instanceof H))if(a&&a!=Object)if(a==String)a=T;else if(a==Number)a=Xe;else if(a==Array)a=k.ee.List;else throw Error("Variables must be of an EE type, e.g. ee.Image or ee.Number.");else a=H;var c=function(){};c.prototype=a.prototype;c=new c;c.b=null;c.c=null;c.f=b;return c},ef=function(a,b){var c=Fa(b,function(a){return{name:null,type:p(a)?a:je(a)}}),c={name:"",returns:p("Object")?"Object":je("Object"),args:c};return new bf(c,a)},df=function(a,b,c){for(var d=
[],e=0;e<b.length;e++)null===b[e].f&&d.push(e);if(0==d.length)return a;var g=function(a){var b=0;r(a)&&!q(a)&&("Function"==a.type&&b++,la(a,function(a){b+=g(a)}));return b},e=de(c.apply(null,b));c="_MAPPING_VAR_"+g(e)+"_";for(e=0;e<d.length;e++){var f=d[e],m=c+e;b[f].f=m;a.args[f].name=m}return a};var ff=function(a,b){if(!(this instanceof ff))return I(ff,arguments);if(a instanceof ff)return a;gf();var c=new L("Date"),d={},e=null;if(me(a)){if(d.value=a,b)if(me(b))d.timeZone=b;else throw Error("Invalid argument specified for ee.Date(..., opt_tz): "+b);}else if(le(a))d.value=a;else if(r(a)&&"function"==typeof a.getFullYear)d.value=Math.floor(a.getTime());else if(a instanceof H)a.b&&"Date"==a.b.n().returns?(c=a.b,d=a.c,e=a.f):d.value=a;else throw Error("Invalid argument specified for ee.Date(): "+
a);H.call(this,c,d,e)};v(ff,H);u("ee.Date",ff);var hf=!1,gf=function(){hf||(N(ff,"Date","Date"),hf=!0)};ff.prototype.name=function(){return"Date"};var V=function(a,b,c){if(!(this instanceof V))return I(V,arguments);jf();var d=null!=b||null!=c;if(a instanceof H&&!(a instanceof V&&a.ua)){if(d)throw Error("Setting the CRS or geodesic on a computed Geometry is not suported. Use Geometry.transform().");H.call(this,a.b,a.c,a.f)}else{a instanceof V&&(a=a.encode());if(3<arguments.length)throw Error("The Geometry constructor takes at most 3 arguments ("+arguments.length+" given)");if(!kf(a))throw Error("Invalid GeoJSON geometry: "+JSON.stringify(a));
H.call(this,null,null);this.ua=a.type;this.Cb=a.coordinates||null;this.Nb=a.geometries||null;if(null!=b)this.Ta=b;else if("crs"in a)if(r(a.crs)&&"name"==a.crs.type&&r(a.crs.properties)&&p(a.crs.properties.name))this.Ta=a.crs.properties.name;else throw Error("Invalid CRS declaration in GeoJSON: "+(new Qa).h(a.crs));this.Ka=c;!l(c)&&"geodesic"in a&&(this.Ka=Boolean(a.geodesic))}};v(V,H);u("ee.Geometry",V);
var lf=!1,jf=function(){lf||(N(V,"Geometry","Geometry"),lf=!0)},mf=function(a,b){if(!(this instanceof mf))return nf(mf,arguments);if(2<arguments.length)throw Error("The Geometry.Point constructor takes at most 2 arguments ("+arguments.length+" given)");if(1==arguments.length&&n(arguments[0])&&2==arguments[0].length){var c=arguments[0];a=c[0];b=c[1]}V.call(this,{type:"Point",coordinates:[a,b]})};v(mf,V);V.Point=mf;
var of=function(a){if(!(this instanceof of))return nf(of,arguments);V.call(this,{type:"MultiPoint",coordinates:pf(a,2,arguments)})};v(of,V);V.MultiPoint=of;var qf=function(a,b,c,d){if(!(this instanceof qf))return I(qf,arguments);if(4<arguments.length)throw Error("The Geometry.Rectangle constructor takes at most 4 arguments ("+arguments.length+" given)");if(n(a)){var e=a;a=e[0];b=e[1];c=e[2];d=e[3]}V.call(this,{type:"Polygon",coordinates:[[[a,d],[a,b],[c,b],[c,d]]]})};v(qf,V);V.Rectangle=qf;
var rf=function(a){if(!(this instanceof rf))return nf(rf,arguments);V.call(this,{type:"LineString",coordinates:pf(a,2,arguments)})};v(rf,V);V.LineString=rf;var sf=function(a){if(!(this instanceof sf))return nf(sf,arguments);V.call(this,{type:"LinearRing",coordinates:pf(a,2,arguments)})};v(sf,V);V.LinearRing=sf;var tf=function(a){if(!(this instanceof tf))return nf(tf,arguments);V.call(this,{type:"MultiLineString",coordinates:pf(a,3,arguments)})};v(tf,V);V.MultiLineString=tf;
var uf=function(a){if(!(this instanceof uf))return nf(uf,arguments);V.call(this,{type:"Polygon",coordinates:pf(a,3,arguments)})};v(uf,V);V.Polygon=uf;var vf=function(a){if(!(this instanceof vf))return nf(vf,arguments);V.call(this,{type:"MultiPolygon",coordinates:pf(a,4,arguments)})};v(vf,V);V.MultiPolygon=vf;
V.prototype.encode=function(a){if(!this.ua){if(!a)throw Error("Must specify an encode function when encoding a computed geometry.");return H.prototype.encode.call(this,a)}a={type:this.ua};"GeometryCollection"==this.ua?a.geometries=this.Nb:a.coordinates=this.Cb;null!=this.Ta&&(a.crs={type:"name",properties:{name:this.Ta}});null!=this.Ka&&(a.geodesic=this.Ka);return a};V.prototype.qb=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return this.encode()};
V.prototype.toGeoJSON=V.prototype.qb;V.prototype.rb=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return(new Ra).h(this.qb())};V.prototype.toGeoJSONString=V.prototype.rb;V.prototype.h=function(){return fe(this)};V.prototype.serialize=V.prototype.h;V.prototype.toString=function(){return"ee.Geometry("+this.rb()+")"};
V.prototype.toGeoJSON=V.prototype.qb;V.prototype.rb=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return(new Qa).h(this.qb())};V.prototype.toGeoJSONString=V.prototype.rb;V.prototype.h=function(){return fe(this)};V.prototype.serialize=V.prototype.h;V.prototype.toString=function(){return"ee.Geometry("+this.rb()+")"};
var kf=function(a){var b=a.type;if("GeometryCollection"==b){b=a.geometries;if(!n(b))return!1;for(a=0;a<b.length;a++)if(!kf(b[a]))return!1;return!0}a=wf(a.coordinates);return"Point"==b&&1==a||"MultiPoint"==b&&2==a||"LineString"==b&&2==a||"LinearRing"==b&&2==a||"MultiLineString"==b&&3==a||"Polygon"==b&&3==a||"MultiPolygon"==b&&4==a},wf=function(a){if(!n(a))return-1;if(n(a[0])){for(var b=wf(a[0]),c=1;c<a.length;c++)if(wf(a[c])!=b)return-1;return b+1}for(c=0;c<a.length;c++)if(!ea(a[c]))return-1;return 0==
a.length%2?1:-1},pf=function(a,b,c){if(2>b||4<b)throw Error("Unexpected nesting level.");if(!n(a)&&c&&(a=Array.prototype.slice.call(c),"number"==typeof a[0])){if(0!=a.length%2)throw Error("Invalid number of coordinates: "+a.length);c=[];for(var d=0;d<a.length;d+=2)c.push([a[d],a[d+1]]);a=c}c=a;for(d=0;n(c);)c=c[0],d++;for(;d<b;)a=[a],d++;if(wf(a)!=b)throw Error("Invalid geometry");return a},nf=function(a,b){var c=function(){};c.prototype=a.prototype;var c=new c,d=a.apply(c,b);return void 0!==d?d:
c};V.prototype.name=function(){return"Geometry"};u("ee.Deserializer",function(){});u("ee.Deserializer.fromJSON",function(a){return xf(Oa(a))});var xf=function(a){var b={};if(r(a)&&"CompoundValue"==a.type){for(var c=a.scope,d=0;d<c.length;d++){var e=c[d][0],g=c[d][1];if(e in b)throw Error('Duplicate scope key "'+e+'" in scope #'+d+".");b[e]=yf(g,b)}a=a.value}return yf(a,b)};u("ee.Deserializer.decode",xf);
var yf=function(a,b){if(null===a||ea(a)||"boolean"==typeof a||p(a))return a;if(n(a))return Fa(a,function(a){return yf(a,b)});if(!r(a)||q(a))throw Error("Cannot decode object: "+a);var c=a.type;switch(c){case "ValueRef":if(a.value in b)return b[a.value];throw Error("Unknown ValueRef: "+a);case "ArgumentRef":c=a.value;if(!p(c))throw Error("Invalid variable name: "+c);return cf(Object,c);case "Date":c=a.value;if(!ea(c))throw Error("Invalid date value: "+c);return new ff(c/1E3);case "Bytes":return c=
new Vd,c.encode=function(){return a},c;case "Invocation":var c="functionName"in a?se(a.functionName):yf(a["function"],b),d=oa(a.arguments,function(a){return yf(a,b)});if(c instanceof J)return c.apply(d);if(c instanceof H)return new H(c,d);throw Error("Invalid function value: "+a["function"]);case "Dictionary":return oa(a.value,function(a){return yf(a,b)});case "Function":var e=yf(a.body,b),c={name:"",args:Fa(a.argumentNames,function(a){return{name:a,type:"Object",optional:!1}}),returns:"Object"};
return new bf(c,function(){return e});case "Point":case "MultiPoint":case "LineString":case "MultiLineString":case "Polygon":case "MultiPolygon":case "LinearRing":case "GeometryCollection":return new V(a);case "CompoundValue":throw Error("Nested CompoundValues are disallowed.");default:throw Error("Unknown encoded object type: "+c);}};var zf=function(a){if(!(this instanceof zf))return I(zf,arguments);if(a instanceof zf)return a;Af();if(ne(a))H.call(this,null,null),this.Ga=a;else if(a instanceof H)H.call(this,a.b,a.c,a.f),this.Ga=null;else throw Error("Invalid argument specified for ee.Dictionary(): "+a);};v(zf,H);u("ee.Dictionary",zf);var Bf=!1,Af=function(){Bf||(M(zf,"Dictionary","Dictionary"),Bf=!0)};zf.prototype.encode=function(a){return null===this.Ga?zf.p.encode.call(this,a):a(this.Ga)};zf.prototype.name=function(){return"Dictionary"};var W=function(a,b){if(!(this instanceof W))return I(W,arguments);if(a instanceof W){if(b)throw Error("Can't create Feature out of a Feature and properties.");return a}if(2<arguments.length)throw Error("The Feature constructor takes at most 2 arguments ("+arguments.length+" given)");Cf();if(a instanceof V||null===a)O.call(this,new K("Feature"),{geometry:a,metadata:b||null});else if(a instanceof H)O.call(this,a.b,a.c,a.f);else if("Feature"==a.type){var c=a.properties||{};if("id"in a){if("system:index"in
c)throw Error('Can\'t specify both "id" and "system:index".');c=w(c);c["system:index"]=a.id}O.call(this,new K("Feature"),{geometry:new V(a.geometry),metadata:c})}else O.call(this,new K("Feature"),{geometry:new V(a),metadata:b||null})};v(W,O);u("ee.Feature",W);var Df=!1,Cf=function(){Df||(M(W,"Feature","Feature"),Df=!0)};W.prototype.m=function(a){return W.p.m.call(this,a)};W.prototype.getInfo=W.prototype.m;W.prototype.getMap=function(a,b){return L("Collection",[this]).getMap(a,b)};
return new bf(c,function(){return e});case "Point":case "MultiPoint":case "LineString":case "MultiLineString":case "Polygon":case "MultiPolygon":case "LinearRing":case "GeometryCollection":return new V(a);case "CompoundValue":throw Error("Nested CompoundValues are disallowed.");default:throw Error("Unknown encoded object type: "+c);}};var zf=function(a){if(!(this instanceof zf))return I(zf,arguments);if(a instanceof zf)return a;Af();if(ne(a))H.call(this,null,null),this.Ga=a;else if(a instanceof H)H.call(this,a.b,a.c,a.f),this.Ga=null;else throw Error("Invalid argument specified for ee.Dictionary(): "+a);};v(zf,H);u("ee.Dictionary",zf);var Bf=!1,Af=function(){Bf||(N(zf,"Dictionary","Dictionary"),Bf=!0)};zf.prototype.encode=function(a){return null===this.Ga?zf.p.encode.call(this,a):a(this.Ga)};zf.prototype.name=function(){return"Dictionary"};var W=function(a,b){if(!(this instanceof W))return I(W,arguments);if(a instanceof W){if(b)throw Error("Can't create Feature out of a Feature and properties.");return a}if(2<arguments.length)throw Error("The Feature constructor takes at most 2 arguments ("+arguments.length+" given)");Cf();if(a instanceof V||null===a)P.call(this,new L("Feature"),{geometry:a,metadata:b||null});else if(a instanceof H)P.call(this,a.b,a.c,a.f);else if("Feature"==a.type){var c=a.properties||{};if("id"in a){if("system:index"in
c)throw Error('Can\'t specify both "id" and "system:index".');c=w(c);c["system:index"]=a.id}P.call(this,new L("Feature"),{geometry:new V(a.geometry),metadata:c})}else P.call(this,new L("Feature"),{geometry:new V(a),metadata:b||null})};v(W,P);u("ee.Feature",W);var Df=!1,Cf=function(){Df||(N(W,"Feature","Feature"),Df=!0)};W.prototype.m=function(a){return W.p.m.call(this,a)};W.prototype.getInfo=W.prototype.m;W.prototype.getMap=function(a,b){return M("Collection",[this]).getMap(a,b)};
W.prototype.getMap=W.prototype.getMap;W.Point=function(a,b){return mf.apply(null,arguments)};W.MultiPoint=function(a){return of.apply(null,arguments)};W.Rectangle=function(a,b,c,d){return new qf(a,b,c,d)};W.LineString=function(a){return rf.apply(null,arguments)};W.LinearRing=function(a){return sf.apply(null,arguments)};W.MultiLine=function(a){return tf.apply(null,arguments)};W.Polygon=function(a){return uf.apply(null,arguments)};W.MultiPolygon=function(a){return vf.apply(null,arguments)};
W.prototype.name=function(){return"Feature"};var Ef=function(a){if(!(this instanceof Ef))return I(Ef,arguments);if(a instanceof Ef)return a;Ff();if(n(a))H.call(this,null,null),this.Qa=a;else if(a instanceof H)H.call(this,a.b,a.c,a.f),this.Qa=null;else throw Error("Invalid argument specified for ee.List(): "+a);};v(Ef,H);u("ee.List",Ef);var Gf=!1,Ff=function(){Gf||(M(Ef,"List","List"),Gf=!0)};Ef.prototype.encode=function(a){return n(this.Qa)?Fa(this.Qa,function(b){return a(b)}):Ef.p.encode.call(this,a)};Ef.prototype.name=function(){return"List"};var X=function(a,b){if(!(this instanceof X))return I(X,arguments);if(a instanceof X)return a;if(2<arguments.length)throw Error("The FeatureCollection constructor takes at most 2 arguments ("+arguments.length+" given)");Hf();a instanceof V&&(a=new W(a));a instanceof W&&(a=[a]);if(le(a)||me(a)){var c={tableId:a};b&&(c.geometryColumn=b);S.call(this,new K("Collection.loadTable"),c)}else if(n(a))S.call(this,new K("Collection"),{features:Fa(a,function(a){return new W(a)})});else if(a instanceof Ef)S.call(this,
new K("Collection"),{features:a});else if(a instanceof H)S.call(this,a.b,a.c,a.f);else throw Error("Unrecognized argument type to convert to a FeatureCollection: "+a);};v(X,S);u("ee.FeatureCollection",X);var If=!1,Hf=function(){If||(M(X,"FeatureCollection","FeatureCollection"),If=!0)};X.prototype.getMap=function(a,b){var c=te("Collection.draw",{collection:this,color:(a||{}).color||"000000"});if(b)c.getMap(null,b);else return c.getMap()};X.prototype.getMap=X.prototype.getMap;
W.prototype.name=function(){return"Feature"};var Ef=function(a){if(!(this instanceof Ef))return I(Ef,arguments);if(a instanceof Ef)return a;Ff();if(n(a))H.call(this,null,null),this.Qa=a;else if(a instanceof H)H.call(this,a.b,a.c,a.f),this.Qa=null;else throw Error("Invalid argument specified for ee.List(): "+a);};v(Ef,H);u("ee.List",Ef);var Gf=!1,Ff=function(){Gf||(N(Ef,"List","List"),Gf=!0)};Ef.prototype.encode=function(a){return n(this.Qa)?Fa(this.Qa,function(b){return a(b)}):Ef.p.encode.call(this,a)};Ef.prototype.name=function(){return"List"};var X=function(a,b){if(!(this instanceof X))return I(X,arguments);if(a instanceof X)return a;if(2<arguments.length)throw Error("The FeatureCollection constructor takes at most 2 arguments ("+arguments.length+" given)");Hf();a instanceof V&&(a=new W(a));a instanceof W&&(a=[a]);if(le(a)||me(a)){var c={tableId:a};b&&(c.geometryColumn=b);S.call(this,new L("Collection.loadTable"),c)}else if(n(a))S.call(this,new L("Collection"),{features:Fa(a,function(a){return new W(a)})});else if(a instanceof Ef)S.call(this,
new L("Collection"),{features:a});else if(a instanceof H)S.call(this,a.b,a.c,a.f);else throw Error("Unrecognized argument type to convert to a FeatureCollection: "+a);};v(X,S);u("ee.FeatureCollection",X);var If=!1,Hf=function(){If||(N(X,"FeatureCollection","FeatureCollection"),If=!0)};X.prototype.getMap=function(a,b){var c=te("Collection.draw",{collection:this,color:(a||{}).color||"000000"});if(b)c.getMap(null,b);else return c.getMap()};X.prototype.getMap=X.prototype.getMap;
X.prototype.m=function(a){return X.p.m.call(this,a)};X.prototype.getInfo=X.prototype.m;X.prototype.La=function(a,b,c,d){var e={};e.table=this.h();a&&(e.format=a.toUpperCase());c&&(e.filename=c);b&&(e.selectors=b);if(d)Sd(e,function(a,b){a?d(Td(a)):d(null,b)});else return Td(Sd(e))};X.prototype.getDownloadURL=X.prototype.La;X.prototype.select=function(a,b){var c=arguments;return this.map(function(a){return a.select.apply(a,c)})};X.prototype.select=X.prototype.select;X.prototype.name=function(){return"FeatureCollection"};
X.prototype.elementType=function(){return W};var Y=function(a){if(!(this instanceof Y))return I(Y,arguments);if(a instanceof Y)return a;Jf();var b=arguments.length;if(0==b||1==b&&!l(a))O.call(this,new K("Image.mask"),{image:new Y(0),mask:new Y(0)});else if(1==b)if(le(a))O.call(this,new K("Image.constant"),{value:a});else if(me(a))O.call(this,new K("Image.load"),{id:a});else{if(n(a))return Kf(Fa(a,function(a){return new Y(a)}));if(a instanceof H)"Array"==a.name()?O.call(this,new K("Image.constant"),{value:a}):O.call(this,a.b,a.c,a.f);else throw Error("Unrecognized argument type to convert to an Image: "+
a);}else if(2==b){var b=arguments[0],c=arguments[1];if(me(b)&&le(c))O.call(this,new K("Image.load"),{id:b,version:c});else throw Error("Unrecognized argument types to convert to an Image: "+arguments);}else throw Error("The Image constructor takes at most 2 arguments ("+b+" given)");};v(Y,O);u("ee.Image",Y);var Lf=!1,Jf=function(){Lf||(M(Y,"Image","Image"),M(Y,"Window","Image","focal_"),Lf=!0)};Y.prototype.m=function(a){return Y.p.m.call(this,a)};Y.prototype.getInfo=Y.prototype.m;
X.prototype.elementType=function(){return W};var Y=function(a){if(!(this instanceof Y))return I(Y,arguments);if(a instanceof Y)return a;Jf();var b=arguments.length;if(0==b||1==b&&!l(a))P.call(this,new L("Image.mask"),{image:new Y(0),mask:new Y(0)});else if(1==b)if(le(a))P.call(this,new L("Image.constant"),{value:a});else if(me(a))P.call(this,new L("Image.load"),{id:a});else{if(n(a))return Kf(Fa(a,function(a){return new Y(a)}));if(a instanceof H)"Array"==a.name()?P.call(this,new L("Image.constant"),{value:a}):P.call(this,a.b,a.c,a.f);else throw Error("Unrecognized argument type to convert to an Image: "+
a);}else if(2==b){var b=arguments[0],c=arguments[1];if(me(b)&&le(c))P.call(this,new L("Image.load"),{id:b,version:c});else throw Error("Unrecognized argument types to convert to an Image: "+arguments);}else throw Error("The Image constructor takes at most 2 arguments ("+b+" given)");};v(Y,P);u("ee.Image",Y);var Lf=!1,Jf=function(){Lf||(N(Y,"Image","Image"),N(Y,"Window","Image","focal_"),Lf=!0)};Y.prototype.m=function(a){return Y.p.m.call(this,a)};Y.prototype.getInfo=Y.prototype.m;
Y.prototype.getMap=function(a,b){var c=a?w(a):{};c.image=this.h();if(b)Md(c,t(function(a,c){a&&(a.image=this);b(a,c)},this));else return c=Md(c),c.image=this,c};Y.prototype.getMap=Y.prototype.getMap;Y.prototype.La=function(a,b){var c=a?w(a):{};c.image=this.h();if(b)Qd(c,function(a,c){a?b(Rd(a)):b(null,c)});else return Rd(Qd(c))};Y.prototype.getDownloadURL=Y.prototype.La;
Y.prototype.Pb=function(a,b){var c=a?w(a):{};c.image=this.h();if(c.region)if(n(c.region)||ne(c.region))c.region=(new Ra(void 0)).h(c.region);else if(!p(c.region))throw Error("The region parameter must be an array or a GeoJSON object.");if(b)Od(c,function(a){b(Pd(a))});else return Pd(Od(c))};Y.prototype.getThumbURL=Y.prototype.Pb;Y.rgb=function(a,b,c){return Kf([a,b,c],["vis-red","vis-green","vis-blue"])};Y.cat=function(a){return Kf(Array.prototype.slice.call(arguments),null)};
var Kf=function(a,b){if(0==a.length)throw Error("Can't combine 0 images.");for(var c=new Y(a[0]),d=1;d<a.length;d++)c=L("Image.addBands",c,a[d]);b&&(c=c.select([".*"],b));return c};
Y.prototype.Pb=function(a,b){var c=a?w(a):{};c.image=this.h();if(c.region)if(n(c.region)||ne(c.region))c.region=(new Qa(void 0)).h(c.region);else if(!p(c.region))throw Error("The region parameter must be an array or a GeoJSON object.");if(b)Od(c,function(a){b(Pd(a))});else return Pd(Od(c))};Y.prototype.getThumbURL=Y.prototype.Pb;Y.rgb=function(a,b,c){return Kf([a,b,c],["vis-red","vis-green","vis-blue"])};Y.cat=function(a){return Kf(Array.prototype.slice.call(arguments),null)};
var Kf=function(a,b){if(0==a.length)throw Error("Can't combine 0 images.");for(var c=new Y(a[0]),d=1;d<a.length;d++)c=M("Image.addBands",c,a[d]);b&&(c=c.select([".*"],b));return c};
Y.prototype.select=function(a){var b=Array.prototype.slice.call(arguments),c={input:this,bandSelectors:b[0]||[]};if(2<b.length||me(b[0])||le(b[0])){for(var d=0;d<b.length;d++)if(!(me(b[d])||le(b[d])||b[d]instanceof H))throw Error("Illegal argument to select(): "+b[d]);c.bandSelectors=b}else b[1]&&(c.newNames=b[1]);return te("Image.select",c)};Y.prototype.select=Y.prototype.select;
Y.prototype.Jb=function(a,b){var c=["DEFAULT_EXPRESSION_IMAGE"],d={DEFAULT_EXPRESSION_IMAGE:this};if(b)for(var e in b)c.push(e),d[e]=new Y(b[e]);var g=L("Image.parseExpression",a,"DEFAULT_EXPRESSION_IMAGE",c);e=new J;e.encode=function(a){return g.encode(a)};e.n=function(){return{name:"",args:Fa(c,function(a){return{name:a,type:"Image",optional:!1}},this),returns:"Image"}};return e.apply(d)};Y.prototype.expression=Y.prototype.Jb;
Y.prototype.clip=function(a){try{a=new V(a)}catch(b){}return L("Image.clip",this,a)};Y.prototype.clip=Y.prototype.clip;Y.prototype.name=function(){return"Image"};var Z=function(a){if(!(this instanceof Z))return I(Z,arguments);if(a instanceof Z)return a;if(1!=arguments.length)throw Error("The ImageCollection constructor takes exactly 1 argument ("+arguments.length+" given)");Mf();a instanceof Y&&(a=[a]);if(me(a))S.call(this,new K("ImageCollection.load"),{id:a});else if(n(a))S.call(this,new K("ImageCollection.fromImages"),{images:Fa(a,function(a){return new Y(a)})});else if(a instanceof H)S.call(this,a.b,a.c,a.f);else throw Error("Unrecognized argument type to convert to an ImageCollection: "+
a);};v(Z,S);u("ee.ImageCollection",Z);var Nf=!1,Mf=function(){Nf||(M(Z,"ImageCollection","ImageCollection"),M(Z,"reduce","ImageCollection"),Nf=!0)};Z.prototype.getMap=function(a,b){var c=L("ImageCollection.mosaic",this);if(b)c.getMap(a,b);else return c.getMap(a)};Z.prototype.getMap=Z.prototype.getMap;Z.prototype.m=function(a){return Z.p.m.call(this,a)};Z.prototype.getInfo=Z.prototype.m;Z.prototype.select=function(a,b){var c=arguments;return this.map(function(a){return a.select.apply(a,c)})};
Z.prototype.select=Z.prototype.select;Z.prototype.name=function(){return"ImageCollection"};Z.prototype.elementType=function(){return Y};var Of={};u("ee.Terrain",Of);Of.Oa=!1;Of.Ub=function(){Of.Oa||(M(Of,"Terrain","Terrain"),Of.Oa=!0)};Of.reset=function(){N(Of);Of.Oa=!1};u("ee.initialize",function(a,b,c,d,e){if("ready"!=Pf||a||b){var g=null!=c;if(d)if(g)Qf.push(d);else throw Error("Can't pass an error callback without a success callback.");if("loading"==Pf&&g)Rf.push(c);else if(Pf="loading",Kd(a,b,e),g)Rf.push(c),ve(Sf,Tf);else try{ve(),Sf()}catch(f){throw Tf(f),f;}}else c&&c()});
u("ee.reset",function(){Pf="not_ready";Gd=Ed=Dd=Cd=null;Hd=[];Fd=null;Id=!1;ma=null;ue={};N(ff);hf=!1;N(zf);Bf=!1;N(O);Ae=!1;N(Y);Lf=!1;N(W);Df=!1;N(S);We=!1;N(Z);Nf=!1;N(X);If=!1;N(Q);Ce=!1;N(V);lf=!1;N(Ef);Gf=!1;N(Xe);Ze=!1;N(U);af=!1;Of.reset();for(var a=k.ee,b=0;b<Uf.length;b++){var c=Uf[b];N(a[c]);delete a[c]}Uf=[];ie=a;var a=Vf,d;for(d in a)delete a[d]});u("ee.InitState",{pc:"not_ready",LOADING:"loading",qc:"ready"});u("ee.InitState.NOT_READY","not_ready");u("ee.InitState.LOADING","loading");
u("ee.InitState.READY","ready");var Pf="not_ready",Rf=[],Qf=[];u("ee.TILE_SIZE",256);var Uf=[],Vf={};u("ee.Algorithms",Vf);u("ee.call",function(a,b){p(a)&&(a=new K(a));return J.prototype.call.apply(a,Array.prototype.slice.call(arguments,1))});u("ee.apply",function(a,b){p(a)&&(a=new K(a));return a.apply(b)});
Y.prototype.Jb=function(a,b){var c=["DEFAULT_EXPRESSION_IMAGE"],d={DEFAULT_EXPRESSION_IMAGE:this};if(b)for(var e in b)c.push(e),d[e]=new Y(b[e]);var g=M("Image.parseExpression",a,"DEFAULT_EXPRESSION_IMAGE",c);e=new J;e.encode=function(a){return g.encode(a)};e.n=function(){return{name:"",args:Fa(c,function(a){return{name:a,type:"Image",optional:!1}},this),returns:"Image"}};return e.apply(d)};Y.prototype.expression=Y.prototype.Jb;
Y.prototype.clip=function(a){try{a=new V(a)}catch(b){}return M("Image.clip",this,a)};Y.prototype.clip=Y.prototype.clip;Y.prototype.name=function(){return"Image"};var Z=function(a){if(!(this instanceof Z))return I(Z,arguments);if(a instanceof Z)return a;if(1!=arguments.length)throw Error("The ImageCollection constructor takes exactly 1 argument ("+arguments.length+" given)");Mf();a instanceof Y&&(a=[a]);if(me(a))S.call(this,new L("ImageCollection.load"),{id:a});else if(n(a))S.call(this,new L("ImageCollection.fromImages"),{images:Fa(a,function(a){return new Y(a)})});else if(a instanceof H)S.call(this,a.b,a.c,a.f);else throw Error("Unrecognized argument type to convert to an ImageCollection: "+
a);};v(Z,S);u("ee.ImageCollection",Z);var Nf=!1,Mf=function(){Nf||(N(Z,"ImageCollection","ImageCollection"),N(Z,"reduce","ImageCollection"),Nf=!0)};Z.prototype.getMap=function(a,b){var c=M("ImageCollection.mosaic",this);if(b)c.getMap(a,b);else return c.getMap(a)};Z.prototype.getMap=Z.prototype.getMap;Z.prototype.m=function(a){return Z.p.m.call(this,a)};Z.prototype.getInfo=Z.prototype.m;Z.prototype.select=function(a,b){var c=arguments;return this.map(function(a){return a.select.apply(a,c)})};
Z.prototype.select=Z.prototype.select;Z.prototype.name=function(){return"ImageCollection"};Z.prototype.elementType=function(){return Y};var Of={};u("ee.Terrain",Of);Of.Oa=!1;Of.Ub=function(){Of.Oa||(N(Of,"Terrain","Terrain"),Of.Oa=!0)};Of.reset=function(){O(Of);Of.Oa=!1};u("ee.initialize",function(a,b,c,d,e){if("ready"!=Pf||a||b){var g=null!=c;if(d)if(g)Qf.push(d);else throw Error("Can't pass an error callback without a success callback.");if("loading"==Pf&&g)Rf.push(c);else if(Pf="loading",Kd(a,b,e),g)Rf.push(c),ve(Sf,Tf);else try{ve(),Sf()}catch(f){throw Tf(f),f;}}else c&&c()});
u("ee.reset",function(){Pf="not_ready";Gd=Ed=Dd=Cd=null;Hd=[];Fd=null;Id=!1;ma=null;ue={};O(ff);hf=!1;O(zf);Bf=!1;O(P);Ae=!1;O(Y);Lf=!1;O(W);Df=!1;O(S);We=!1;O(Z);Nf=!1;O(X);If=!1;O(Q);Ce=!1;O(V);lf=!1;O(Ef);Gf=!1;O(Xe);Ze=!1;O(T);af=!1;Of.reset();for(var a=k.ee,b=0;b<Uf.length;b++){var c=Uf[b];O(a[c]);delete a[c]}Uf=[];ie=a;var a=Vf,d;for(d in a)delete a[d]});u("ee.InitState",{pc:"not_ready",LOADING:"loading",qc:"ready"});u("ee.InitState.NOT_READY","not_ready");u("ee.InitState.LOADING","loading");
u("ee.InitState.READY","ready");var Pf="not_ready",Rf=[],Qf=[];u("ee.TILE_SIZE",256);var Uf=[],Vf={};u("ee.Algorithms",Vf);u("ee.call",function(a,b){p(a)&&(a=new L(a));return J.prototype.call.apply(a,Array.prototype.slice.call(arguments,1))});u("ee.apply",function(a,b){p(a)&&(a=new L(a));return a.apply(b)});
var Sf=function(){if("loading"==Pf){try{gf();Af();ze();Jf();Cf();Ve();Mf();Hf();Be();jf();Ff();Ye();$e();Of.Ub();var a=we(),b={},c={},d;for(d in a){b[-1!=d.indexOf(".")?d.slice(0,d.indexOf(".")):d]=!0;var e=a[d].returns.replace(/<.*>/,"");c[e]=!0}var g=k.ee,f;for(f in b)f in c&&!(f in g)&&(g[f]=Wf(f),Uf.push(f),a[f]?(g[f].signature=a[f],g[f].signature.isConstructor=!0,ue[f]=!0):g[f].signature={});ie=g;Xf()}catch(m){Tf(m);return}Pf="ready";for(Qf=[];0<Rf.length;)Rf.shift()()}},Tf=function(a){if("loading"==
Pf)for(Pf="not_ready",Rf=[];0<Qf.length;)Qf.shift()(a)},Xf=function(){var a=xe();qa(a).sort().forEach(function(b){var c=a[b],d=c.n();if(!d.hidden){b=b.split(".");var e=Vf;for(e.signature={};1<b.length;){var g=b[0];g in e||(e[g]={signature:{}});e=e[g];b=Ma(b,1)}g=function(a){return re(c,void 0,Array.prototype.slice.call(arguments,0))};g.signature=d;g.toString=t(c.toString,c);e[b[0]]=g}})},Wf=function(a){var b=function(b){var d=k.ee[a],e=Array.prototype.slice.call(arguments),g=1==e.length;if(g&&e[0]instanceof
d)return e[0];if(!(this instanceof d))return I(d,e);var d=ye(a),f=!(e[0]instanceof H),m=!1;d&&(g?f?m=!0:e[0].b!=d&&(m=!0):m=!0);if(m)H.call(this,d,qe(d,pe(d,e)));else{if(!g)throw Error("Too many arguments for ee."+a+"(): "+e);if(f)throw Error("Invalid argument for ee."+a+"(): "+e+". Must be a ComputedObject.");e=e[0];H.call(this,e.b,e.c,e.f)}};v(b,H);b.prototype.name=function(){return a};M(b,a,a);return b},oe=function(a,b){if(null===a)return null;if(l(a)){var c=k.ee;switch(b){case "Image":return new Y(a);
case "Feature":return a instanceof S?L("Feature",L("Collection.geometry",a)):new W(a);case "Element":if(a instanceof O)return a;if(a instanceof H)return new O(a.b,a.c,a.f);throw Error("Cannot convert "+a+" to Element.");case "Geometry":return a instanceof X?L("Collection.geometry",a):new V(a);case "FeatureCollection":case "Collection":return a instanceof S?a:new X(a);case "ImageCollection":return new Z(a);case "Filter":return new Q(a);case "Algorithm":if(p(a))return new K(a);if(q(a)){for(var c=a.length,
d=[],e=0;e<c;e++)d[e]="Object";return ef(a,d)}if(a instanceof Vd)return a;throw Error("Argument is not a function: "+a);case "String":return me(a)||a instanceof U||a instanceof H?new U(a):a;case "Dictionary":return ne(a)?a:new zf(a);case "List":return new Ef(a);case "Number":case "Float":case "Long":case "Integer":case "Short":case "Byte":return new Xe(a);default:if(b in c){d=ye(b);if(a instanceof c[b])return a;if(d)return new c[b](a);if(p(a)){if(a in c[b])return c[b][a].call();throw Error("Unknown algorithm: "+
b+"."+a);}return new c[b](a)}return a}}};B&&C("11");})();
d)return e[0];if(!(this instanceof d))return I(d,e);var d=ye(a),f=!(e[0]instanceof H),m=!1;d&&(g?f?m=!0:e[0].b!=d&&(m=!0):m=!0);if(m)H.call(this,d,qe(d,pe(d,e)));else{if(!g)throw Error("Too many arguments for ee."+a+"(): "+e);if(f)throw Error("Invalid argument for ee."+a+"(): "+e+". Must be a ComputedObject.");e=e[0];H.call(this,e.b,e.c,e.f)}};v(b,H);b.prototype.name=function(){return a};N(b,a,a);return b},oe=function(a,b){if(null===a)return null;if(l(a)){var c=k.ee;switch(b){case "Image":return new Y(a);
case "Feature":return a instanceof S?M("Feature",M("Collection.geometry",a)):new W(a);case "Element":if(a instanceof P)return a;if(a instanceof V)return new W(a);if(a instanceof H)return new P(a.b,a.c,a.f);throw Error("Cannot convert "+a+" to Element.");case "Geometry":return a instanceof X?M("Collection.geometry",a):new V(a);case "FeatureCollection":case "Collection":return a instanceof S?a:new X(a);case "ImageCollection":return new Z(a);case "Filter":return new Q(a);case "Algorithm":if(p(a))return new L(a);
if(q(a)){for(var c=a.length,d=[],e=0;e<c;e++)d[e]="Object";return ef(a,d)}if(a instanceof Vd)return a;throw Error("Argument is not a function: "+a);case "String":return me(a)||a instanceof T||a instanceof H?new T(a):a;case "Dictionary":return ne(a)?a:new zf(a);case "List":return new Ef(a);case "Number":case "Float":case "Long":case "Integer":case "Short":case "Byte":return new Xe(a);default:if(b in c){d=ye(b);if(a instanceof c[b])return a;if(d)return new c[b](a);if(p(a)){if(a in c[b])return c[b][a].call();
throw Error("Unknown algorithm: "+b+"."+a);}return new c[b](a)}return a}}};B&&C("11");})();
//@ sourceMappingURL=ee_api_js.sourcemap

File diff suppressed because it is too large Load Diff

View File

@ -9,9 +9,12 @@ goog.provide('ee.data.AlgorithmArgument');
goog.provide('ee.data.AlgorithmSignature');
goog.provide('ee.data.AlgorithmsRegistry');
goog.provide('ee.data.AssetDescription');
goog.provide('ee.data.Band');
goog.provide('ee.data.BandDescription');
goog.provide('ee.data.DownloadId');
goog.provide('ee.data.FeatureCollectionDescription');
goog.provide('ee.data.FileSource');
goog.provide('ee.data.Fileset');
goog.provide('ee.data.GMEProject');
goog.provide('ee.data.GeoJSONFeature');
goog.provide('ee.data.GeoJSONGeometry');
@ -19,6 +22,7 @@ goog.provide('ee.data.ImageCollectionDescription');
goog.provide('ee.data.ImageDescription');
goog.provide('ee.data.ImageList');
goog.provide('ee.data.ImageTaskConfig');
goog.provide('ee.data.IngestionRequest');
goog.provide('ee.data.MapId');
goog.provide('ee.data.PixelTypeDescription');
goog.provide('ee.data.ProcessingResponse');
@ -764,29 +768,26 @@ goog.exportSymbol('ee.data.startProcessing', ee.data.startProcessing);
/**
* Creates an asset import task.
* Creates an asset ingestion task.
*
* @param {string} taskId ID for the task (obtained using newTaskId).
* @param {Object} request The object that describes the import task, which
* should have these fields:
* asset_id (string) The destination asset id (e.g. users/foo/bar).
* file_name (string) The source file's Google Cloud Storage object name.
* e.g. '/gs/ee.google.com.a.appspot.com/L2FwcGhvc3Rpbmdf'
* @param {ee.data.IngestionRequest} request The object that describes the
* ingestion.
* @param {function(ee.data.ProcessingResponse, string=)=} opt_callback An
* optional callback. If not supplied, the call is made synchronously.
* @return {?ee.data.ProcessingResponse} May contain field 'note' with value
* 'ALREADY_EXISTS' if an identical task with the same ID already exists.
* Null if a callback is specified.
*/
ee.data.startImport = function(taskId, request, opt_callback) {
ee.data.startIngestion = function(taskId, request, opt_callback) {
var params = {
'id': taskId,
'request': goog.json.serialize(request)
};
return /** @type {?ee.data.ProcessingResponse} */ (ee.data.send_(
'/import', ee.data.makeRequest_(params), opt_callback));
'/ingestionrequest', ee.data.makeRequest_(params), opt_callback));
};
goog.exportSymbol('ee.data.startImport', ee.data.startImport);
goog.exportSymbol('ee.data.startIngestion', ee.data.startIngestion);
/**
@ -833,13 +834,19 @@ ee.data.send_ = function(path, params, opt_callback, opt_method) {
}
// Handle processing and dispatching a callback response.
var handleResponse = function(xhr, responseText, opt_callback) {
var handleResponse = function(
status, contentType, responseText, opt_callback) {
var response, data, errorMessage;
try {
response = goog.json.unsafeParse(responseText);
data = response['data'];
} catch (e) {
errorMessage = 'Invalid JSON: ' + responseText;
if (contentType.split(';')[0] === 'application/json' ||
contentType.split(';')[0] === 'text/json') {
try {
response = goog.json.unsafeParse(responseText);
data = response['data'];
} catch (e) {
errorMessage = 'Invalid JSON: ' + responseText;
}
} else {
errorMessage = 'Response was unexpectedly not JSON, but ' + contentType;
}
// Totally malformed, with either invalid JSON or JSON with
@ -850,9 +857,8 @@ ee.data.send_ = function(path, params, opt_callback, opt_method) {
} else if (!('data' in response)) {
errorMessage = 'Malformed response: ' + responseText;
}
} else if (xhr.status >= 300) {
errorMessage = 'HTTP ' + xhr.status + ': ' +
(responseText || xhr.statusText);
} else if (status >= 300) {
errorMessage = 'Server returned HTTP code: ' + status;
}
if (opt_callback) {
@ -873,8 +879,13 @@ ee.data.send_ = function(path, params, opt_callback, opt_method) {
goog.net.XhrIo.send(
url,
function(e) {
var responseText = e.target.getResponseText();
return handleResponse(e.target, responseText, opt_callback);
var xhrIo = e.target;
return handleResponse(
xhrIo.getStatus(),
xhrIo.getResponseHeader('Content-Type'),
xhrIo.getResponseText(),
opt_callback);
},
method,
requestData,
@ -889,7 +900,19 @@ ee.data.send_ = function(path, params, opt_callback, opt_method) {
xmlHttp.setRequestHeader(key, value);
});
xmlHttp.send(requestData);
return handleResponse(xmlHttp, xmlHttp.responseText, null);
var contentType;
try {
contentType = xmlHttp.getResponseHeader('Content-Type');
} catch (e) {
// Workaround for a non-browser XMLHttpRequest shim that doesn't implement
// getResponseHeader when synchronous.
contentType = 'application/json';
}
return handleResponse(
xmlHttp.status,
contentType,
xmlHttp.responseText,
null);
}
};
@ -959,30 +982,66 @@ ee.data.makeRequest_ = function(params) {
/**
* Mock the networking calls used in send_.
*
* TODO(user): Make the global patching done here reversible.
*
* @param {Object=} opt_calls A dictionary containing the responses to return
* for each URL, keyed to URL.
*/
ee.data.setupMockSend = function(opt_calls) {
var calls = opt_calls ? goog.object.clone(opt_calls) : {};
// If the mock is set up with a string for this URL, return that.
// If it's a function, call the function and use its return value.
// If it's an object it has fields specifying more details.
// If there's nothing set for this url, throw.
function getResponse(url, method, data) {
var response;
if (url in calls) {
response = calls[url];
} else {
throw new Error(url + ' mock response not specified');
}
if (goog.isFunction(response)) {
response = response(url, method, data);
}
if (goog.isString(response)) {
response = {
'text': response,
'status': 200,
'contentType': 'application/json; charset=utf-8'
};
}
if (!goog.isString(response.text)) {
throw new Error(url + ' mock response missing/invalid text');
}
if (!goog.isNumber(response.status)) {
throw new Error(url + ' mock response missing/invalid status');
}
if (!goog.isString(response.contentType)) {
throw new Error(url + ' mock response missing/invalid contentType');
}
return response;
}
// Mock XhrIo.send for async calls.
goog.net.XhrIo.send = function(url, callback, method, data) {
var responseData = getResponse(url, method, data);
// An anonymous class to simulate an event. Closure doesn't like this.
/** @constructor */
var fakeEvent = function() {};
var e = new fakeEvent();
e.target = {};
e.target.getResponseText = function() {
// If the mock is set up with a string for this URL, return that.
// Otherwise, assume it's a function and call it. If there's nothing
// set for this url, return an error response.
if (url in calls) {
if (goog.isString(calls[url])) {
return calls[url];
} else {
return calls[url](url, callback, method, data);
}
return responseData.text;
};
e.target.getStatus = function() {
return responseData.status;
};
e.target.getResponseHeader = function(header) {
if (header === 'Content-Type') {
return responseData.contentType;
} else {
return '{"error": {}}';
return null;
}
};
// Call the callback in a timeout to simulate asynchronous behavior.
@ -999,24 +1058,19 @@ ee.data.setupMockSend = function(opt_calls) {
this.method = method;
};
fakeXmlHttp.prototype.setRequestHeader = function() {};
fakeXmlHttp.prototype.send = function(data) {
if (this.url in calls) {
if (goog.isString(calls[this.url])) {
this.responseText = calls[this.url];
} else {
this.responseText = calls[this.url](this.url, this.method, data);
}
fakeXmlHttp.prototype.getResponseHeader = function(header) {
if (header === 'Content-Type') {
return this.contentType_ || null;
} else {
// Return the input arguments.
this.responseText = goog.json.serialize({
'data': {
'url': this.url,
'method': this.method,
'data': data
}
});
return null;
}
};
fakeXmlHttp.prototype.send = function(data) {
var responseData = getResponse(this.url, this.method, data);
this.responseText = responseData.text;
this.status = responseData.status;
this.contentType_ = responseData.contentType;
};
goog.net.XmlHttp = function() {
return /** @type {?} */ (new fakeXmlHttp());
};
@ -1365,3 +1419,55 @@ ee.data.TaskListResponse;
* }}
*/
ee.data.AssetDescription;
/**
* A request to import an asset. "name" is the destination asset ID
* (e.g. "users/yourname/assetname"). "filesets" is the list of source
* filesets for the asset.
*
* @typedef {{
* 'name': string,
* 'filesets': !Array<ee.data.Fileset>,
* 'bands': (undefined|!Array<ee.data.Band>)
* }}
*/
ee.data.IngestionRequest;
/**
* An object describing properties of a single raster band.
* @typedef {{
* 'name': string
* }}
*/
ee.data.Band;
/**
* An object describing properties of a single fileset.
* @typedef {{
* 'sources': !Array<ee.data.FileSource>
* }}
*/
ee.data.Fileset;
/**
* An object describing properties of a single raster.
*
* For requests sent directly through the API, paths should be Google Cloud
* Storage object names (e.g. 'gs://bucketname/filename'). In manifests
* uploaded through the Playground IDE, paths should be relative file
* names (e.g. 'file1.tif').
*
* Extensions are the file extensions as strings and must be in order,
* with the primary file's extension first.
*
* @typedef {{
* 'primaryPath': string,
* 'additionalPaths': (undefined|!Array<string>),
* 'fileExtensions': (undefined|!Array<string>)
* }}
*/
ee.data.FileSource;

View File

@ -15,14 +15,11 @@ goog.require('ee.Types');
/**
* Constructs a new Date.
*
* We don't autoconstruct this class because we want all objects to go
* through the server-side constructor.
* Constructs a new Date object.
*
* @param {number|String|ee.ComputedObject|Date} date The date to convert,
* one of:
* a number (number of microseconds since the epoch),
* a number (number of milliseconds since the epoch),
* an ISO Date string,
* a javascript Date
* or a ComputedObject.
@ -34,6 +31,9 @@ goog.require('ee.Types');
* @export
*/
ee.Date = function(date, opt_tz) {
// Note: We don't autoconstruct this class because we want all objects to go
// through the server-side constructor.
// Constructor safety.
if (!(this instanceof ee.Date)) {
return ee.ComputedObject.construct(ee.Date, arguments);

View File

@ -8,7 +8,7 @@ goog.addDependency('../../geo/gestalt/client/javascript/apitestcase.js', ['ee.Ap
goog.addDependency('../../geo/gestalt/client/javascript/collection.js', ['ee.Collection'], ['ee.ApiFunction', 'ee.Element', 'ee.Filter'], false);
goog.addDependency('../../geo/gestalt/client/javascript/computedobject.js', ['ee.ComputedObject'], ['ee.Encodable', 'ee.Serializer', 'ee.data'], false);
goog.addDependency('../../geo/gestalt/client/javascript/customfunction.js', ['ee.CustomFunction'], ['ee.ComputedObject', 'ee.Function', 'ee.Number', 'ee.Serializer', 'ee.String', 'ee.Types', 'goog.array', 'goog.object'], false);
goog.addDependency('../../geo/gestalt/client/javascript/data.js', ['ee.data', 'ee.data.AbstractTaskConfig', 'ee.data.AlgorithmArgument', 'ee.data.AlgorithmSignature', 'ee.data.AlgorithmsRegistry', 'ee.data.AssetDescription', 'ee.data.BandDescription', 'ee.data.DownloadId', 'ee.data.FeatureCollectionDescription', 'ee.data.GMEProject', 'ee.data.GeoJSONFeature', 'ee.data.GeoJSONGeometry', 'ee.data.ImageCollectionDescription', 'ee.data.ImageDescription', 'ee.data.ImageList', 'ee.data.ImageTaskConfig', 'ee.data.MapId', 'ee.data.PixelTypeDescription', 'ee.data.ProcessingResponse', 'ee.data.RawMapId', 'ee.data.TableTaskConfig', 'ee.data.TaskListResponse', 'ee.data.TaskStatus', 'ee.data.TaskUpdateActions', 'ee.data.ThumbnailId', 'ee.data.VideoTaskConfig'], ['goog.Uri', 'goog.array', 'goog.json', 'goog.net.XhrIo', 'goog.net.XmlHttp', 'goog.net.jsloader', 'goog.object', 'goog.string'], false);
goog.addDependency('../../geo/gestalt/client/javascript/data.js', ['ee.data', 'ee.data.AbstractTaskConfig', 'ee.data.AlgorithmArgument', 'ee.data.AlgorithmSignature', 'ee.data.AlgorithmsRegistry', 'ee.data.AssetDescription', 'ee.data.Band', 'ee.data.BandDescription', 'ee.data.DownloadId', 'ee.data.FeatureCollectionDescription', 'ee.data.FileSource', 'ee.data.Fileset', 'ee.data.GMEProject', 'ee.data.GeoJSONFeature', 'ee.data.GeoJSONGeometry', 'ee.data.ImageCollectionDescription', 'ee.data.ImageDescription', 'ee.data.ImageList', 'ee.data.ImageTaskConfig', 'ee.data.IngestionRequest', 'ee.data.MapId', 'ee.data.PixelTypeDescription', 'ee.data.ProcessingResponse', 'ee.data.RawMapId', 'ee.data.TableTaskConfig', 'ee.data.TaskListResponse', 'ee.data.TaskStatus', 'ee.data.TaskUpdateActions', 'ee.data.ThumbnailId', 'ee.data.VideoTaskConfig'], ['goog.Uri', 'goog.array', 'goog.json', 'goog.net.XhrIo', 'goog.net.XmlHttp', 'goog.net.jsloader', 'goog.object', 'goog.string'], false);
goog.addDependency('../../geo/gestalt/client/javascript/date.js', ['ee.Date'], ['ee.ApiFunction', 'ee.ComputedObject', 'ee.Types'], false);
goog.addDependency('../../geo/gestalt/client/javascript/deserializer.js', ['ee.Deserializer'], ['ee.ApiFunction', 'ee.ComputedObject', 'ee.CustomFunction', 'ee.Date', 'ee.Encodable', 'ee.Function', 'ee.Geometry', 'goog.array', 'goog.json', 'goog.object'], false);
goog.addDependency('../../geo/gestalt/client/javascript/dictionary.js', ['ee.Dictionary'], ['ee.ApiFunction', 'ee.ComputedObject', 'ee.Types'], false);

View File

@ -373,6 +373,9 @@ ee.promote_ = function(arg, klass) {
if (arg instanceof ee.Element) {
// Already an Element.
return arg;
} else if (arg instanceof ee.Geometry) {
// Geometries get promoted to Features.
return new ee.Feature(/** @type {ee.Geometry} */ (arg));
} else if (arg instanceof ee.ComputedObject) {
// Try a cast.
var co = /** @type {ee.ComputedObject} */ (arg);

View File

@ -972,11 +972,11 @@ ee.data.setDeadline = function(milliseconds) {
};
/**
* @param {string} taskId
* @param {(Object|null)} request
* @param {{bands: (Array<ee.data.Band>|undefined), filesets: Array<ee.data.Fileset>, name: string}} request
* @param {function ({note: (string|undefined), started: string}, string=): ?=} opt_callback
* @return {(ee.data.ProcessingResponse|null)}
*/
ee.data.startImport = function(taskId, request, opt_callback) {
ee.data.startIngestion = function(taskId, request, opt_callback) {
};
/**
* @param {string} taskId

View File

@ -46,7 +46,6 @@ goog.require('ee.data');
*
* @param {string=} opt_path The asset ID of an existing package.
*
* @extends {ee.Encodable}
* @constructor
* TODO(user): Add an at-export annotations once packages are ready.
*/

View File

@ -1,7 +1,7 @@
"""The EE Javascript library."""
__version__ = '0.1.47'
__version__ = '0.1.48'
# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name

View File

@ -448,11 +448,21 @@ def startImport(taskId, request):
Args:
taskId: ID for the task (obtained using newTaskId).
request: The object that describes the import task, which
should have these fields:
asset_id (string) The destination asset id (e.g. users/foo/bar).
file_name (string) The source file's Google Cloud Storage object name.
e.g. '/gs/ee.google.com.a.appspot.com/L2FwcGhvc3Rpbmdf'
request: The object that describes the import task, which can
have these fields:
name (string) The destination asset id (e.g. users/foo/bar).
filesets (array) A list of Google Cloud Storage source file paths
formatted like:
[{'sources': [
{'primaryPath': 'foo.tif', 'additionalPaths': ['foo.prj']},
{'primaryPath': 'bar.tif', 'additionalPaths': ['bar.prj'},
]}]
Where path values correspond to source files' Google Cloud Storage
object names, e.g. 'gs://bucketname/filename.tif'
bands (array) An optional list of band names formatted like:
[{'name': 'R'}, {'name': 'G'}, {'name': 'B'}]
extensions (array) An optional list of file extensions formatted like:
['tif', 'prj']. Useful if the file names in GCS lack extensions.
Returns:
A dict with optional notes about the created task.
@ -503,16 +513,31 @@ def send_(path, params, opt_method='POST', opt_raw=False):
raise ee_exception.EEException(
'Unexpected HTTP error: %s' % e.message)
if response.status != 200:
# Whether or not the response is an error, it may be JSON.
if (response['content-type'].split(';')[0] == 'application/json' and
not opt_raw):
try:
json_content = json.loads(content)
except Exception, e:
raise ee_exception.EEException('Invalid JSON: ' + content)
if 'error' in json_content:
raise ee_exception.EEException(json_content['error']['message'])
if 'data' not in content:
raise ee_exception.EEException('Malformed response: ' + content)
else:
json_content = None
if response.status >= 300:
# Note if the response is JSON and contains an error value, we raise that
# error above rather than this generic one.
raise ee_exception.EEException('Server returned HTTP code: %d' %
response.status)
# Now known not to be an error response...
if opt_raw:
return content
elif json_content is None:
raise ee_exception.EEException(
'Response was unexpectedly not JSON, but %s' % response['content-type'])
else:
content = json.loads(content)
if 'error' in content:
raise ee_exception.EEException(content['error'])
if 'data' not in content:
raise ee_exception.EEException('Missing data in response: ' + content)
return content['data']
return json_content['data']

View File

@ -0,0 +1,103 @@
import httplib2
import mock
import unittest
import ee
class DataTest(unittest.TestCase):
def testSuccess(self):
with DoStubHttp(200, 'application/json', '{"data": "bar"}'):
self.assertEqual('bar', ee.data.send_('/foo', {}))
def testNon200Success(self):
with DoStubHttp(202, 'application/json', '{"data": "bar"}'):
self.assertEqual('bar', ee.data.send_('/foo', {}))
def testJsonSyntaxError(self):
with DoStubHttp(200, 'application/json', '{"data"}'):
with self.assertRaises(ee.ee_exception.EEException) as cm:
ee.data.send_('/foo', {})
self.assertEqual('Invalid JSON: {"data"}', cm.exception.message)
def testJsonStructureError(self):
with DoStubHttp(200, 'application/json', '{}'):
with self.assertRaises(ee.ee_exception.EEException) as cm:
ee.data.send_('/foo', {})
self.assertEqual('Malformed response: {}', cm.exception.message)
def testUnexpectedStatus(self):
with DoStubHttp(418, 'text/html', '<html>'):
with self.assertRaises(ee.ee_exception.EEException) as cm:
ee.data.send_('/foo', {})
self.assertEqual('Server returned HTTP code: 418', cm.exception.message)
def testJson200Error(self):
with DoStubHttp(200, 'application/json',
'{"error": {"code": 500, "message": "bar"}}'):
with self.assertRaises(ee.ee_exception.EEException) as cm:
ee.data.send_('/foo', {})
self.assertEqual(u'bar', cm.exception.message)
def testJsonNon2xxError(self):
with DoStubHttp(400, 'application/json',
'{"error": {"code": 400, "message": "bar"}}'):
with self.assertRaises(ee.ee_exception.EEException) as cm:
ee.data.send_('/foo', {})
self.assertEqual(u'bar', cm.exception.message)
def testWrongContentType(self):
with DoStubHttp(200, 'text/html', '{"data": "bar"}'):
with self.assertRaises(ee.ee_exception.EEException) as cm:
ee.data.send_('/foo', {})
self.assertEqual(u'Response was unexpectedly not JSON, but text/html',
cm.exception.message)
def testContentTypeParameterAllowed(self):
with DoStubHttp(200, 'application/json; charset=utf-8', '{"data": ""}'):
self.assertEqual('', ee.data.send_('/foo', {}))
def testRawSuccess(self):
with DoStubHttp(200, 'image/png', 'FAKEDATA'):
self.assertEqual('FAKEDATA', ee.data.send_('/foo', {}, opt_raw=True))
def testRawError(self):
with DoStubHttp(400, 'application/json',
'{"error": {"code": 400, "message": "bar"}}'):
with self.assertRaises(ee.ee_exception.EEException) as cm:
ee.data.send_('/foo', {}, opt_raw=True)
self.assertEqual(u'Server returned HTTP code: 400', cm.exception.message)
def testRaw200Error(self):
"""Raw shouldn't be parsed, so the error-in-200 shouldn't be noticed.
(This is an edge case we do not expect to see.)
"""
with DoStubHttp(200, 'application/json',
'{"error": {"code": 400, "message": "bar"}}'):
self.assertEqual('{"error": {"code": 400, "message": "bar"}}',
ee.data.send_('/foo', {}, opt_raw=True))
def DoStubHttp(status, mime, resp_body):
"""Context manager for temporarily overriding Http."""
def Request(unused_self, unused_url, method, body, headers):
_ = method, body, headers # unused kwargs
response = httplib2.Response({
'status': status,
'content-type': mime,
})
return response, resp_body
return mock.patch('httplib2.Http.request', new=Request)
class StubResponse(object):
def __init__(self, status):
self.status = status
if __name__ == '__main__':
unittest.main()