mirror of
https://github.com/google/earthengine-api.git
synced 2025-12-08 19:26:12 +00:00
126 lines
65 KiB
JavaScript
126 lines
65 KiB
JavaScript
(function() {var h,aa=aa||{},k=this,m=function(a){return void 0!==a},ba=function(){},ca=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=
|
|
typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},n=function(a){return"array"==ca(a)},da=function(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length},p=function(a){return"string"==typeof a},q=function(a){return"number"==typeof a},r=function(a){return"function"==ca(a)},s=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},ea=function(a,b,
|
|
c){return a.call.apply(a.bind,arguments)},fa=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},t=function(a,b,c){t=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa;return t.apply(null,arguments)},ga=Date.now||function(){return+new Date},
|
|
v=function(a,b){var c=a.split("."),d=k;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&m(b)?d[e]=b:d=d[e]?d[e]:d[e]={}},w=function(a,b){function c(){}c.prototype=b.prototype;a.n=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Bb=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};
|
|
Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return t.apply(null,c)}return t(this,a)};var ha=function(a,b){for(var c in a)b.call(void 0,a[c],c,a)},ja=function(a){var b=ia,c={},d;for(d in b)a.call(void 0,b[d],d,b)&&(c[d]=b[d]);return c},ka=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d},la=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},ma=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},na=function(a,b){b in a&&delete a[b]},x=function(a){var b={},c;for(c in a)b[c]=a[c];return b},oa=function(a){var b=ca(a);if("object"==b||"array"==b){if(a.H)return a.H();
|
|
var b="array"==b?[]:{},c;for(c in a)b[c]=oa(a[c]);return b}return a},pa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),qa=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 f=0;f<pa.length;f++)c=pa[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var sa=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);},ua=function(a){this.$=a};ua.prototype.h=function(a){var b=[];va(this,a,b);return b.join("")};
|
|
var va=function(a,b,c){switch(typeof b){case "string":wa(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="",f=0;f<d;f++)c.push(e),e=b[f],va(a,a.$?a.$.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),wa(f,
|
|
c),c.push(":"),va(a,a.$?a.$.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}},xa={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},ya=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,wa=function(a,b){b.push('"',a.replace(ya,function(a){if(a in xa)return xa[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return xa[a]=
|
|
e+b.toString(16)}),'"')};var za=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,za);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};w(za,Error);za.prototype.name="CustomError";var Aa=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")},Ha=function(a){if(!Ba.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(Ca,"&"));-1!=a.indexOf("<")&&(a=a.replace(Da,"<"));-1!=a.indexOf(">")&&(a=a.replace(Ea,">"));-1!=a.indexOf('"')&&(a=a.replace(Fa,"""));-1!=a.indexOf("'")&&(a=a.replace(Ga,"'"));return a},Ca=/&/g,Da=/</g,Ea=/>/g,Fa=/"/g,Ga=/'/g,Ba=/[&<>"']/,Ia=function(a,
|
|
b){return a<b?-1:a>b?1:0};var Ja=function(a,b){b.unshift(a);za.call(this,Aa.apply(null,b));b.shift()};w(Ja,za);Ja.prototype.name="AssertionError";var Ka=function(a,b,c){if(!a){var d="Assertion failed";if(b)var d=d+(": "+b),e=Array.prototype.slice.call(arguments,2);throw new Ja(""+d,e||[]);}return a},La=function(a,b){throw new Ja("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};var y=Array.prototype,Ma=y.indexOf?function(a,b,c){Ka(null!=a.length);return y.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},Na=y.forEach?function(a,b,c){Ka(null!=a.length);y.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Oa=y.map?function(a,b,c){Ka(null!=a.length);return y.map.call(a,b,c)}:
|
|
function(a,b,c){for(var d=a.length,e=Array(d),f=p(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e},Qa=function(a){var b;t:{b=Pa;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]},Ra=function(a,b){var c=Ma(a,b),d;if(d=0<=c)Ka(null!=a.length),y.splice.call(a,c,1);return d},Sa=function(a){return y.concat.apply(y,arguments)},Ta=function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],
|
|
e;if(n(d)||(e=da(d))&&Object.prototype.hasOwnProperty.call(d,"callee"))a.push.apply(a,d);else if(e)for(var f=a.length,g=d.length,l=0;l<g;l++)a[f+l]=d[l];else a.push(d)}},Ua=function(a,b,c){Ka(null!=a.length);return 2>=arguments.length?y.slice.call(a,b):y.slice.call(a,b,c)};var Va=function(){};Va.prototype.ra=!1;Va.prototype.Ia=function(){this.ra||(this.ra=!0,this.C())};Va.prototype.C=function(){if(this.Ja)for(;this.Ja.length;)this.Ja.shift()()};var Wa=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.Z=!1;this.Pa=!0};Wa.prototype.C=function(){};Wa.prototype.Ia=function(){};var Xa;t:{var Ya=k.navigator;if(Ya){var Za=Ya.userAgent;if(Za){Xa=Za;break t}}Xa=""}var $a=function(a){return-1!=Xa.indexOf(a)};var ab=$a("Opera")||$a("OPR"),z=$a("Trident")||$a("MSIE"),bb=$a("Gecko")&&-1==Xa.toLowerCase().indexOf("webkit")&&!($a("Trident")||$a("MSIE")),cb=-1!=Xa.toLowerCase().indexOf("webkit"),db=function(){var a=k.document;return a?a.documentMode:void 0},eb=function(){var a="",b;if(ab&&k.opera)return a=k.opera.version,r(a)?a():a;bb?b=/rv\:([^\);]+)(\)|;)/:z?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:cb&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(Xa))?a[1]:"");return z&&(b=db(),b>parseFloat(a))?String(b):a}(),fb={},B=
|
|
function(a){var b;if(!(b=fb[a])){b=0;for(var c=String(eb).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",l=d[f]||"",u=RegExp("(\\d*)(\\D*)","g"),E=RegExp("(\\d*)(\\D*)","g");do{var A=u.exec(g)||["","",""],ra=E.exec(l)||["","",""];if(0==A[0].length&&0==ra[0].length)break;b=Ia(0==A[1].length?0:parseInt(A[1],10),0==ra[1].length?0:parseInt(ra[1],10))||Ia(0==A[2].length,0==ra[2].length)||
|
|
Ia(A[2],ra[2])}while(0==b)}b=fb[a]=0<=b}return b},gb=k.document,hb=gb&&z?db()||("CSS1Compat"==gb.compatMode?parseInt(eb,10):5):void 0;z&&B("9");!cb||B("528");bb&&B("1.9b")||z&&B("8")||ab&&B("9.5")||cb&&B("528");bb&&!B("8")||z&&B("9");var ib="closure_listenable_"+(1E6*Math.random()|0),jb=0;var kb=function(a,b,c,d,e){this.la=a;this.Ua=null;this.src=b;this.type=c;this.ya=!!d;this.ka=e;this.key=++jb;this.ma=this.na=!1},lb=function(a){a.ma=!0;a.la=null;a.Ua=null;a.src=null;a.ka=null};var mb=function(a){this.src=a;this.m={};this.oa=0};mb.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.m[f];a||(a=this.m[f]=[],this.oa++);var g;t:{for(g=0;g<a.length;++g){var l=a[g];if(!l.ma&&l.la==b&&l.ya==!!d&&l.ka==e)break t}g=-1}-1<g?(b=a[g],c||(b.na=!1)):(b=new kb(b,this.src,f,!!d,e),b.na=c,a.push(b));return b};mb.prototype.Ta=function(){var a=0,b;for(b in this.m){for(var c=this.m[b],d=0;d<c.length;d++)++a,lb(c[d]);delete this.m[b];this.oa--}};var nb=function(){this.A=new mb(this);this.Xa=this};w(nb,Va);nb.prototype[ib]=!0;h=nb.prototype;h.qa=null;
|
|
h.dispatchEvent=function(a){ob(this);var b,c=this.qa;if(c){b=[];for(var d=1;c;c=c.qa)b.push(c),Ka(1E3>++d,"infinite loop")}c=this.Xa;d=a.type||a;if(p(a))a=new Wa(a,c);else if(a instanceof Wa)a.target=a.target||c;else{var e=a;a=new Wa(d,c);qa(a,e)}var e=!0,f;if(b)for(var g=b.length-1;!a.Z&&0<=g;g--)f=a.currentTarget=b[g],e=pb(f,d,!0,a)&&e;a.Z||(f=a.currentTarget=c,e=pb(f,d,!0,a)&&e,a.Z||(e=pb(f,d,!1,a)&&e));if(b)for(g=0;!a.Z&&g<b.length;g++)f=a.currentTarget=b[g],e=pb(f,d,!1,a)&&e;return e};
|
|
h.C=function(){nb.n.C.call(this);this.A&&this.A.Ta();this.qa=null};h.Za=function(a){ob(this);this.A.add("complete",a,!1,void 0,void 0)};h.$a=function(a){this.A.add("ready",a,!0,void 0,void 0)};
|
|
var pb=function(a,b,c,d){b=a.A.m[String(b)];if(!b)return!0;var e=b.length;if(0<e){for(var f=Array(e),g=0;g<e;g++)f[g]=b[g];b=f}else b=[];e=!0;for(f=0;f<b.length;++f){var l=b[f];if(l&&!l.ma&&l.ya==c){var g=l.la,u=l.ka||l.src;if(l.na){var E=a.A,A=l.type;A in E.m&&Ra(E.m[A],l)&&(lb(l),0==E.m[A].length&&(delete E.m[A],E.oa--))}e=!1!==g.call(u,d)&&e}}return e&&!1!=d.Pa},ob=function(a){Ka(a.A,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};var qb="StopIteration"in k?k.StopIteration:Error("StopIteration"),rb=function(){};rb.prototype.next=function(){throw qb;};rb.prototype.hb=function(){return this};var sb=function(a,b){this.u={};this.i=[];this.pa=this.l=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.Ra(a)};sb.prototype.p=function(){tb(this);for(var a=[],b=0;b<this.i.length;b++)a.push(this.u[this.i[b]]);return a};sb.prototype.t=function(){tb(this);return this.i.concat()};sb.prototype.W=function(a){return Object.prototype.hasOwnProperty.call(this.u,a)};
|
|
var tb=function(a){if(a.l!=a.i.length){for(var b=0,c=0;b<a.i.length;){var d=a.i[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.i[c++]=d);b++}a.i.length=c}if(a.l!=a.i.length){for(var e={},c=b=0;b<a.i.length;)d=a.i[b],Object.prototype.hasOwnProperty.call(e,d)||(a.i[c++]=d,e[d]=1),b++;a.i.length=c}};h=sb.prototype;h.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b};
|
|
h.set=function(a,b){Object.prototype.hasOwnProperty.call(this.u,a)||(this.l++,this.i.push(a),this.pa++);this.u[a]=b};h.Ra=function(a){var b;a instanceof sb?(b=a.t(),a=a.p()):(b=ma(a),a=la(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.forEach=function(a,b){for(var c=this.t(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.H=function(){return new sb(this)};
|
|
h.hb=function(a){tb(this);var b=0,c=this.i,d=this.u,e=this.pa,f=this,g=new rb;g.next=function(){for(;;){if(e!=f.pa)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw qb;var g=c[b++];return a?g:d[g]}};return g};var ub=function(a){if("function"==typeof a.p)return a.p();if(p(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return la(a)},vb=function(a,b){if("function"==typeof a.forEach)a.forEach(b,void 0);else if(da(a)||p(a))Na(a,b,void 0);else{var c;if("function"==typeof a.t)c=a.t();else if("function"!=typeof a.p)if(da(a)||p(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=ma(a);else c=void 0;for(var d=ub(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],
|
|
a)}};var xb=function(a){var b;b||(b=wb(a||arguments.callee.caller,[]));return b},wb=function(a,b){var c=[];if(0<=Ma(b,a))c.push("[...circular reference...]");else if(a&&50>b.length){c.push(yb(a)+"(");for(var d=a.arguments,e=0;d&&e<d.length;e++){0<e&&c.push(", ");var f;f=d[e];switch(typeof f){case "object":f=f?"object":"null";break;case "string":break;case "number":f=String(f);break;case "boolean":f=f?"true":"false";break;case "function":f=(f=yb(f))?f:"[fn]";break;default:f=typeof f}40<f.length&&(f=f.substr(0,
|
|
40)+"...");c.push(f)}b.push(a);c.push(")\n");try{c.push(wb(a.caller,b))}catch(g){c.push("[exception trying to get caller]\n")}}else a?c.push("[...long stack...]"):c.push("[end]");return c.join("")},yb=function(a){if(zb[a])return zb[a];a=String(a);if(!zb[a]){var b=/function ([^\(]+)/.exec(a);zb[a]=b?b[1]:"[Anonymous]"}return zb[a]},zb={};var Ab=function(a,b,c,d,e){this.reset(a,b,c,d,e)};Ab.prototype.Ca=null;Ab.prototype.Ba=null;var Bb=0;Ab.prototype.reset=function(a,b,c,d,e){"number"==typeof e||Bb++;d||ga();this.N=a;this.Wa=b;delete this.Ca;delete this.Ba};Ab.prototype.Fa=function(a){this.N=a};var Cb=function(a){this.Sa=a;this.Aa=this.sa=this.N=this.Y=null},Db=function(a,b){this.name=a;this.value=b};Db.prototype.toString=function(){return this.name};var Eb=new Db("SEVERE",1E3),Fb=new Db("CONFIG",700),Gb=new Db("FINE",500);Cb.prototype.getParent=function(){return this.Y};Cb.prototype.bb=function(){this.sa||(this.sa={});return this.sa};Cb.prototype.Fa=function(a){this.N=a};var Hb=function(a){if(a.N)return a.N;if(a.Y)return Hb(a.Y);La("Root logger has no level set.");return null};
|
|
Cb.prototype.log=function(a,b,c){if(a.value>=Hb(this).value)for(r(b)&&(b=b()),a=this.Da(a,b,c,Cb.prototype.log),b="log:"+a.Wa,k.console&&(k.console.timeStamp?k.console.timeStamp(b):k.console.markTimeline&&k.console.markTimeline(b)),k.msWriteProfilerMark&&k.msWriteProfilerMark(b),b=this;b;){c=b;var d=a;if(c.Aa)for(var e=0,f=void 0;f=c.Aa[e];e++)f(d);b=b.getParent()}};
|
|
Cb.prototype.Da=function(a,b,c,d){a=new Ab(a,String(b),this.Sa);if(c){a.Ca=c;var e;d=d||Cb.prototype.Da;try{var f;var g;e:{b=["window","location","href"];for(var l=k,u;u=b.shift();)if(null!=l[u])l=l[u];else{g=null;break e}g=l}if(p(c))f={message:c,name:"Unknown error",lineNumber:"Not available",fileName:g,stack:"Not available"};else{var E,A;u=!1;try{E=c.lineNumber||c.line||"Not available"}catch(ra){E="Not available",u=!0}try{A=c.fileName||c.filename||c.sourceURL||k.$googDebugFname||g}catch(ta){A="Not available",
|
|
u=!0}f=!u&&c.lineNumber&&c.fileName&&c.stack&&c.message&&c.name?c:{message:c.message||"Not available",name:c.name||"UnknownError",lineNumber:E,fileName:A,stack:c.stack||"Not available"}}e="Message: "+Ha(f.message)+'\nUrl: <a href="view-source:'+f.fileName+'" target="_new">'+f.fileName+"</a>\nLine: "+f.lineNumber+"\n\nBrowser stack:\n"+Ha(f.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+Ha(xb(d)+"-> ")}catch(fe){e="Exception trying to expose exception! You win, we lose. "+fe}a.Ba=e}return a};
|
|
var Ib={},Jb=null,Kb=function(a){Jb||(Jb=new Cb(""),Ib[""]=Jb,Jb.Fa(Fb));var b;if(!(b=Ib[a])){b=new Cb(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Kb(a.substr(0,c));c.bb()[d]=b;b.Y=c;Ib[a]=b}return b};var C=function(a,b){a&&a.log(Gb,b,void 0)};var Lb=function(a,b,c){if(r(a))c&&(a=t(a,c));else if(a&&"function"==typeof a.handleEvent)a=t(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:k.setTimeout(a,b||0)};var Mb=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),Nb=cb,Ob=function(a,b){if(Nb){Nb=!1;var c=k.location;if(c){var d=c.href;if(d&&(d=(d=Ob(3,d))&&decodeURIComponent(d))&&d!=c.hostname)throw Nb=!0,Error();}}return b.match(Mb)[a]||null};var Pb=function(){};Pb.prototype.Ha=null;Pb.prototype.J=function(){var a;(a=this.Ha)||(a={},Qb(this)&&(a[0]=!0,a[1]=!0),a=this.Ha=a);return a};var Rb=function(a,b){this.gb=a;this.fb=b};w(Rb,Pb);Rb.prototype.ca=function(){return this.gb()};Rb.prototype.J=function(){return this.fb()};var D=function(){return D.Ea.ca()};D.eb=!1;D.J=function(){return D.Ea.J()};D.Gb=function(a,b){D.Ka(new Rb(Ka(a),Ka(b)))};D.Ka=function(a){D.Ea=a};var Sb=function(){};w(Sb,Pb);Sb.prototype.ca=function(){var a=Qb(this);return a?new ActiveXObject(a):new XMLHttpRequest};
|
|
var Qb=function(a){if(D.eb)return"";if(!a.Ga&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.Ga=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.Ga};D.Ka(new Sb);var F=function(a){nb.call(this);this.headers=new sb;this.T=a||null;this.s=!1;this.P=this.a=null;this.I=this.ua=this.Q="";this.w=this.aa=this.O=this.ba=!1;this.B=0;this.R=null;this.va="";this.S=this.Ma=!1};w(F,nb);var Tb=F.prototype,Ub=Kb("goog.net.XhrIo");Tb.k=Ub;var Vb=/^https?$/i,Wb=["POST","PUT"],Xb=[],Zb=function(a,b,c,d){var e=Yb,f=new F;Xb.push(f);b&&f.Za(b);f.$a(f.Ya);e&&(f.B=Math.max(0,e));f.send(a,c,d,{"Content-Type":"application/x-www-form-urlencoded"})};
|
|
F.prototype.Ya=function(){this.Ia();Ra(Xb,this)};
|
|
F.prototype.send=function(a,b,c,d){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.Q+"; newUri="+a);b=b?b.toUpperCase():"GET";this.Q=a;this.I="";this.ua=b;this.ba=!1;this.s=!0;this.a=this.T?this.T.ca():D();this.P=this.T?this.T.J():D.J();this.a.onreadystatechange=t(this.wa,this);try{C(this.k,$b(this,"Opening Xhr")),this.aa=!0,this.a.open(b,String(a),!0),this.aa=!1}catch(e){C(this.k,$b(this,"Error opening Xhr: "+e.message));ac(this,e);return}a=c||"";var f=this.headers.H();
|
|
d&&vb(d,function(a,b){f.set(b,a)});d=Qa(f.t());c=k.FormData&&a instanceof k.FormData;!(0<=Ma(Wb,b))||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");f.forEach(function(a,b){this.a.setRequestHeader(b,a)},this);this.va&&(this.a.responseType=this.va);"withCredentials"in this.a&&(this.a.withCredentials=this.Ma);try{bc(this),0<this.B&&(this.S=cc(this.a),C(this.k,$b(this,"Will abort after "+this.B+"ms if incomplete, xhr2 "+this.S)),this.S?(this.a.timeout=this.B,this.a.ontimeout=
|
|
t(this.xa,this)):this.R=Lb(this.xa,this.B,this)),C(this.k,$b(this,"Sending request")),this.O=!0,this.a.send(a),this.O=!1}catch(g){C(this.k,$b(this,"Send error: "+g.message)),ac(this,g)}};var cc=function(a){return z&&B(9)&&q(a.timeout)&&m(a.ontimeout)},Pa=function(a){return"content-type"==a.toLowerCase()};F.prototype.xa=function(){"undefined"!=typeof aa&&this.a&&(this.I="Timed out after "+this.B+"ms, aborting",C(this.k,$b(this,this.I)),this.dispatchEvent("timeout"),this.abort(8))};
|
|
var ac=function(a,b){a.s=!1;a.a&&(a.w=!0,a.a.abort(),a.w=!1);a.I=b;dc(a);ec(a)},dc=function(a){a.ba||(a.ba=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};F.prototype.abort=function(){this.a&&this.s&&(C(this.k,$b(this,"Aborting")),this.s=!1,this.w=!0,this.a.abort(),this.w=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),ec(this))};F.prototype.C=function(){this.a&&(this.s&&(this.s=!1,this.w=!0,this.a.abort(),this.w=!1),ec(this,!0));F.n.C.call(this)};
|
|
F.prototype.wa=function(){this.ra||(this.aa||this.O||this.w?fc(this):this.Va())};F.prototype.Va=function(){fc(this)};
|
|
var fc=function(a){if(a.s&&"undefined"!=typeof aa)if(a.P[1]&&4==gc(a)&&2==a.getStatus())C(a.k,$b(a,"Local request error detected and ignored"));else if(a.O&&4==gc(a))Lb(a.wa,0,a);else if(a.dispatchEvent("readystatechange"),4==gc(a)){C(a.k,$b(a,"Request complete"));a.s=!1;try{var b=a.getStatus(),c,d;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:d=!0;break t;default:d=!1}if(!(c=d)){var e;if(e=0===b){var f=Ob(1,String(a.Q));if(!f&&self.location)var g=self.location.protocol,
|
|
f=g.substr(0,g.length-1);e=!Vb.test(f?f.toLowerCase():"")}c=e}if(c)a.dispatchEvent("complete"),a.dispatchEvent("success");else{var l;try{l=2<gc(a)?a.a.statusText:""}catch(u){C(a.k,"Can not get status: "+u.message),l=""}a.I=l+" ["+a.getStatus()+"]";dc(a)}}finally{ec(a)}}},ec=function(a,b){if(a.a){bc(a);var c=a.a,d=a.P[0]?ba:null;a.a=null;a.P=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(c=a.k)&&c.log(Eb,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}},
|
|
bc=function(a){a.a&&a.S&&(a.a.ontimeout=null);q(a.R)&&(k.clearTimeout(a.R),a.R=null)},gc=function(a){return a.a?a.a.readyState:0};F.prototype.getStatus=function(){try{return 2<gc(this)?this.a.status:-1}catch(a){return-1}};var $b=function(a,b){return b+" ["+a.ua+" "+a.Q+" "+a.getStatus()+"]"};var hc=function(a,b,c){this.o=a||null;this.ab=!!c},jc=function(a){if(!a.g&&(a.g=new sb,a.l=0,a.o))for(var b=a.o.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null,f=null;0<=d?(e=b[c].substring(0,d),f=b[c].substring(d+1)):e=b[c];e=decodeURIComponent(e.replace(/\+/g," "));e=ic(a,e);a.add(e,f?decodeURIComponent(f.replace(/\+/g," ")):"")}};h=hc.prototype;h.g=null;h.l=null;h.add=function(a,b){jc(this);this.o=null;a=ic(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.l++;return this};
|
|
h.W=function(a){jc(this);a=ic(this,a);return this.g.W(a)};h.t=function(){jc(this);for(var a=this.g.p(),b=this.g.t(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};h.p=function(a){jc(this);var b=[];if(p(a))this.W(a)&&(b=Sa(b,this.g.get(ic(this,a))));else{a=this.g.p();for(var c=0;c<a.length;c++)b=Sa(b,a[c])}return b};h.set=function(a,b){jc(this);this.o=null;a=ic(this,a);this.W(a)&&(this.l-=this.g.get(a).length);this.g.set(a,[b]);this.l++;return this};
|
|
h.get=function(a,b){var c=a?this.p(a):[];return 0<c.length?String(c[0]):b};h.toString=function(){if(this.o)return this.o;if(!this.g)return"";for(var a=[],b=this.g.t(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.p(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}return this.o=a.join("&")};h.H=function(){var a=new hc;a.o=this.o;this.g&&(a.g=this.g.H(),a.l=this.l);return a};
|
|
var ic=function(a,b){var c=String(b);a.ab&&(c=c.toLowerCase());return c};var kc=null,lc=null,mc=!1,Yb=0,nc={Cb:"CANCEL",Fb:"UPDATE"},oc=function(a,b){null!=a?kc=a:mc||(kc="/api");null!=b?lc=b:mc||(lc="https://earthengine.googleapis.com");mc=!0};v("ee.data.setDeadline",function(a){Yb=a});v("ee.data.getApiBaseUrl",function(){return kc});v("ee.data.getTileBaseUrl",function(){return lc});v("ee.data.getInfo",function(a,b){k.console&&k.console.error&&k.console.error("ee.data.getInfo is DEPRECATED. Use ee.data.getValue() instead.");return G("/info",(new hc).add("id",a),b)});
|
|
v("ee.data.getList",function(a,b){var c=H(a);return G("/list",c,b)});var pc=function(a,b){a=x(a);a.json_format="v2";return G("/mapid",H(a),b)};v("ee.data.getMapId",pc);v("ee.data.getTileUrl",function(a,b,c,d){var e=Math.pow(2,d);b%=e;0>b&&(b+=e);return[lc,"map",a.mapid,d,b,c].join("/")+"?token="+a.token});var qc=function(a,b){a=x(a);a.json_format="v2";return G("/value",H(a),b)};v("ee.data.getValue",qc);
|
|
var rc=function(a,b){a=x(a);a.json_format="v2";n(a.size)&&(a.size=a.size.join("x"));var c=H(a).add("getid","1");return G("/thumb",c,b)};v("ee.data.getThumbId",rc);var sc=function(a){return lc+"/api/thumb?thumbid="+a.thumbid+"&token="+a.token};v("ee.data.makeThumbUrl",sc);var tc=function(a,b){a=x(a);a.json_format="v2";return G("/download",H(a),b)};v("ee.data.getDownloadId",tc);var uc=function(a){return lc+"/api/download?docid="+a.docid+"&token="+a.token};v("ee.data.makeDownloadUrl",uc);
|
|
var vc=function(a,b){a=x(a);a.json_format="v2";return G("/table",H(a),b)};v("ee.data.getTableDownloadId",vc);var wc=function(a){return lc+"/api/table?docid="+a.docid+"&token="+a.token};v("ee.data.makeTableDownloadUrl",wc);v("ee.data.createAsset",function(a,b,c,d){a={value:a,json_format:"v2"};void 0!==b&&(a.id=b);a.force=c||!1;return G("/create",H(a),d)});v("ee.data.createFolder",function(a,b,c){return G("/createfolder",H({id:a,force:b||!1}),c)});
|
|
v("ee.data.newTaskId",function(a,b){var c={};q(a)&&(c.count=a);return G("/newtaskid",H(c),b)});v("ee.data.getTaskStatus",function(a,b){if(p(a))a=[a];else if(!n(a))throw Error("Invalid task_id: expected a string or an array of strings.");return G("/taskstatus?q="+a.join(),null,b,"GET")});v("ee.data.getTaskList",function(a){return G("/tasklist",null,a,"GET")});v("ee.data.cancelTask",function(a,b){return xc(a,"CANCEL",b)});
|
|
var xc=function(a,b,c){if(p(a))a=[a];else if(!n(a))throw Error("Invalid task_id: expected a string or an array of strings.");var d;t:{for(d in nc)if(nc[d]==b){d=!0;break t}d=!1}if(!d)throw Error("Invalid action: "+b);return G("/updatetask",H({id:a,action:b}),c,"POST")};v("ee.data.updateTask",xc);v("ee.data.prepareValue",function(a,b,c){b=x(b);b.tid=a;return G("/prepare",H(b),c)});v("ee.data.startProcessing",function(a,b,c){b=x(b);b.id=a;return G("/processingrequest",H(b),c)});
|
|
var G=function(a,b,c,d){function e(a,b){var c=!1;try{var d=sa(a),e=d.data}catch(f){c=!0}var ta=void 0;c||!("data"in d||"error"in d)?ta="Malformed response: "+a:"error"in d&&(ta=d.error.message);if(b)b(e,ta);else{if(!ta)return e;throw Error(ta);}}oc();d=d||"POST";a=kc+a;b=b?b.toString():"";if(c)Zb(a,function(a){var b;a=a.target;try{b=a.a?a.a.responseText:""}catch(d){C(a.k,"Can not get responseText: "+d.message),b=""}return e(b,c)},d,b);else{var f=D();f.open(d,a,!1);f.setRequestHeader("Content-Type",
|
|
"application/x-www-form-urlencoded");f.send(b);return e(f.responseText,null)}},H=function(a){var b=new hc,c;for(c in a)b.set(c,a[c]);return b};var yc=function(){};var zc=function(){this.q=-1};var Ac=function(){this.q=-1;this.q=64;this.e=Array(4);this.Qa=Array(this.q);this.X=this.M=0;this.reset()};w(Ac,zc);Ac.prototype.reset=function(){this.e[0]=1732584193;this.e[1]=4023233417;this.e[2]=2562383102;this.e[3]=271733878;this.X=this.M=0};
|
|
var Bc=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.e[0];c=a.e[1];var e=a.e[2],f=a.e[3],g=0,g=b+(f^c&(e^f))+d[0]+3614090360&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[1]+3905402710&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[2]+606105819&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&
|
|
(f^b))+d[3]+3250441966&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[4]+4118548399&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[5]+1200080426&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[6]+2821735955&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[7]+4249261313&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[8]+1770035416&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[9]+2336552879&4294967295;f=b+(g<<12&4294967295|g>>>20);g=
|
|
e+(c^f&(b^c))+d[10]+4294925233&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[11]+2304563134&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[12]+1804603682&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[13]+4254626195&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[14]+2792965006&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[15]+1236535329&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(e^f&(c^e))+d[1]+4129170786&4294967295;b=c+(g<<5&4294967295|
|
|
g>>>27);g=f+(c^e&(b^c))+d[6]+3225465664&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[11]+643717713&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[0]+3921069994&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(e^f&(c^e))+d[5]+3593408605&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[10]+38016083&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[15]+3634488961&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[4]+3889429448&4294967295;c=e+(g<<20&4294967295|
|
|
g>>>12);g=b+(e^f&(c^e))+d[9]+568446438&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[14]+3275163606&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[3]+4107603335&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[8]+1163531501&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(e^f&(c^e))+d[13]+2850285829&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[2]+4243563512&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[7]+1735328473&4294967295;e=f+(g<<14&4294967295|
|
|
g>>>18);g=c+(f^b&(e^f))+d[12]+2368359562&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(c^e^f)+d[5]+4294588738&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[8]+2272392833&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[11]+1839030562&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[14]+4259657740&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[1]+2763975236&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[4]+1272893353&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^
|
|
b^c)+d[7]+4139469664&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[10]+3200236656&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[13]+681279174&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[0]+3936430074&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[3]+3572445317&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[6]+76029189&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[9]+3654602809&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[12]+3873151461&4294967295;
|
|
f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[15]+530742520&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[2]+3299628645&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(e^(c|~f))+d[0]+4096336452&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[7]+1126891415&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[14]+2878612391&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[5]+4237533241&4294967295;c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[12]+1700485571&4294967295;b=c+
|
|
(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[3]+2399980690&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[10]+4293915773&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[1]+2240044497&4294967295;c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[8]+1873313359&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[15]+4264355552&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[6]+2734768916&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[13]+1309151649&4294967295;
|
|
c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[4]+4149444226&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[11]+3174756917&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[2]+718787259&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[9]+3951481745&4294967295;a.e[0]=a.e[0]+b&4294967295;a.e[1]=a.e[1]+(e+(g<<21&4294967295|g>>>11))&4294967295;a.e[2]=a.e[2]+e&4294967295;a.e[3]=a.e[3]+f&4294967295};
|
|
Ac.prototype.update=function(a,b){m(b)||(b=a.length);for(var c=b-this.q,d=this.Qa,e=this.M,f=0;f<b;){if(0==e)for(;f<=c;)Bc(this,a,f),f+=this.q;if(p(a))for(;f<b;){if(d[e++]=a.charCodeAt(f++),e==this.q){Bc(this,d);e=0;break}}else for(;f<b;)if(d[e++]=a[f++],e==this.q){Bc(this,d);e=0;break}}this.M=e;this.X+=b};
|
|
var Dc=function(){var a=Cc,b=Array((56>a.M?a.q:2*a.q)-a.M);b[0]=128;for(var c=1;c<b.length-8;++c)b[c]=0;for(var d=8*a.X,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.e[c]>>>e&255;return b};var Ec=function(a){this.U="__ee_hash__";this.ia=!1!==a;this.F=[];this.D={};this.ja=[]};v("ee.Serializer",Ec);var Fc=new ua,Cc=new Ac,Hc=function(a){return Gc(new Ec(!0),a)};v("ee.Serializer.encode",Hc);var Ic=function(a){return Fc.h(Hc(a))};v("ee.Serializer.toJSON",Ic);var Jc=function(a){a=Gc(new Ec(!1),a);return"JSON"in k?k.JSON.stringify(a,null," "):Fc.h(a)};v("ee.Serializer.toReadableJSON",Jc);
|
|
var Gc=function(a,b){var c=a.V(b);a.ia&&(c=s(c)&&"ValueRef"==c.type&&1==a.F.length?a.F[0][1]:{type:"CompoundValue",scope:a.F,value:c},a.F=[],Na(a.ja,t(function(a){delete a[this.U]},a)),a.ja=[],a.D={});return c};
|
|
Ec.prototype.V=function(a){if(!m(a))throw Error("Can't encode an undefined value.");var b,c=s(a)?a[this.U]:null;if(this.ia&&null!=c&&this.D[c])return{type:"ValueRef",value:this.D[c]};if(null===a||"boolean"==typeof a||q(a)||p(a))return a;if(s(a)&&"function"==typeof a.getFullYear)return{type:"Invocation",functionName:"Date",arguments:{value:Math.floor(a.getTime())}};if(a instanceof yc){if(b=a.f(t(this.V,this)),!(n(b)||s(b)&&"ArgumentRef"!=b.type))return b}else if(n(a))b=Oa(a,function(a){return this.V(a)},
|
|
this);else if(s(a)&&!r(a))b=ka(a,function(a){if(!r(a))return this.V(a)},this),na(b,this.U),b={type:"Dictionary",value:b};else throw Error("Can't encode object: "+a);if(this.ia){Cc.reset();Cc.update(Fc.h(b));var c=Dc().toString(),d;this.D[c]?d=this.D[c]:(d=String(this.F.length),this.F.push([d,b]),this.D[c]=d);a[this.U]=c;this.ja.push(a);return{type:"ValueRef",value:d}}return b};var I=function(a,b,c){if(!(this instanceof I))return J(I,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.d=c||null};w(I,yc);v("ee.ComputedObject",I);I.prototype.j=function(a){return qc({json:this.h()},a)};v("ee.ComputedObject.prototype.getInfo",I.prototype.j);
|
|
I.prototype.f=function(a){if(null===this.b&&null===this.c)return{type:"ArgumentRef",value:this.d};var b={},c;for(c in this.c)m(this.c[c])&&(b[c]=a(this.c[c]));b={type:"Invocation",arguments:b};a=a(this.b);b[p(a)?"functionName":"function"]=a;return b};I.prototype.h=function(){return Ic(this)};v("ee.ComputedObject.prototype.serialize",I.prototype.h);I.prototype.toString=function(){return"ee."+this.name()+"("+Jc(this)+")"};v("ee.ComputedObject.prototype.toString",I.prototype.toString);
|
|
I.prototype.name=function(){return"ComputedObject"};var Kc=function(a,b){if(b instanceof a.constructor)return b;var c=function(){};c.prototype=a.constructor.prototype;c=new c;c.b=b.b;c.c=b.c;c.d=b.d;return c},J=function(a,b){function c(){return a.apply(this,b)}c.prototype=a.prototype;return new c};var K=function(){if(!(this instanceof K))return new K};w(K,yc);v("ee.Function",K);var Lc=function(a){return a};K.prototype.call=function(a){return this.apply(Mc(this,Array.prototype.slice.call(arguments,0)))};v("ee.Function.prototype.call",K.prototype.call);K.prototype.apply=function(a){a=new I(this,Nc(this,a));return Lc(a,this.r().returns)};v("ee.Function.prototype.apply",K.prototype.apply);
|
|
var Nc=function(a,b){for(var c=a.r().args,d={},e={},f=0;f<c.length;f++){var g=c[f].name;if(g in b&&m(b[g]))d[g]=Lc(b[g],c[f].type);else if(!c[f].optional)throw Error("Required argument ("+g+") missing to function: "+a);e[g]=!0}var c=[],l;for(l in b)e[l]||c.push(l);if(0<c.length)throw Error("Unrecognized arguments ("+c+") to function: "+a);return d},Mc=function(a,b){var c=a.r().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};
|
|
K.prototype.toString=function(a,b){var c=this.r(),d=[];d.push(a||c.name);d.push("(");d.push(Oa(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 f=c.args[e];d.push(f.name);d.push(" (");d.push(f.type);f.optional&&d.push(", optional");d.push("): ");f.description?d.push(f.description):
|
|
d.push("Undocumented.")}}return d.join("")};K.prototype.h=function(){return Ic(this)};var Oc={},Pc=function(a){return a in Oc?Oc[a]:null};v("ee.Types.nameToClass",Pc);var Qc=function(a){return a.prototype instanceof I?a.prototype.name.call(null):a==Number?"Number":a==String?"String":a==Array?"Array":a==Date?"Date":"Object"};v("ee.Types.classToName",Qc);
|
|
var Rc=function(a,b){if(b==a)return!0;switch(a){case "Element":case "EEObject":return"EEObject"==b||"Element"==b||"Image"==b||"Feature"==b||"Collection"==b||"ImageCollection"==b||"FeatureCollection"==b;case "FeatureCollection":case "Collection":return"Collection"==b||"ImageCollection"==b||"FeatureCollection"==b;case "Object":return!0;default:return!1}},Sc=function(a){return q(a)||a instanceof I&&"Number"==a.name()},Tc=function(a){return p(a)||a instanceof I&&"String"==a.name()},Uc=function(a){return s(a)&&
|
|
!r(a)?(a=Object.getPrototypeOf(a),null!==a&&null===Object.getPrototypeOf(a)):!1};var L=function(a,b){if(!m(b))return Vc(a);if(!(this instanceof L))return J(L,arguments);this.G=oa(b);this.G.name=a};w(L,K);v("ee.ApiFunction",L);var M=function(a,b){return K.prototype.call.apply(Vc(a),Array.prototype.slice.call(arguments,1))};v("ee.ApiFunction._call",M);var Wc=function(a,b){return Vc(a).apply(b)};v("ee.ApiFunction._apply",Wc);L.prototype.f=function(){return this.G.name};L.prototype.r=function(){return this.G};
|
|
var ia=null,Xc={},Zc=function(){Yc();return ka(ia,function(a){return a.r()})},$c=function(){Yc();return ja(function(a,b){return!Xc[b]})},Vc=function(a){var b=ad(a);if(!b)throw Error("Unknown built-in function name: "+a);return b};v("ee.ApiFunction.lookup",Vc);
|
|
var ad=function(a){Yc();return ia[a]||null},Yc=function(a,b){if(ia)a&&a();else{var c=function(c,e){e?b&&b(Error(e)):(ia=ka(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?G("/algorithms",null,c,"GET"):c(G("/algorithms",null,void 0,"GET"))}},N=function(a,b,c,d){Yc();var e=d||"";ha(ia,function(d,g){var l=g.split(".");if(2==l.length&&l[0]==b){var u=e+l[1],E=d.r();Xc[g]=!0;var A=!1;E.args.length&&
|
|
(l=E.args[0].type,A="Object"!=l&&Rc(l,c));l=A?a.prototype:a;u in l&&(u+="_",E.hidden=!0);l[u]=function(a){var b=Array.prototype.slice.call(arguments,0),c=!1;if(1==b.length&&Uc(b[0])){var e=E.args;A&&(e=e.slice(1));e.length&&(c=!((1==e.length||e[1].optional)&&"Dictionary"==e[0].type))}if(c){if(b=x(b[0]),A){c=E.args[0].name;if(c in b)throw Error("Named args for "+u+" can't contain keyword "+c);b[c]=this}}else b=Mc(d,A?[this].concat(b):b);return d.apply(b)};l[u].toString=t(d.toString,d,u,A);l[u].signature=
|
|
E}})},O=function(a){var b=function(a){for(var b in a)r(a[b])&&a[b].signature&&delete a[b]};b(a);b(a.prototype)};var P=function(a){if(!(this instanceof P))return J(P,arguments);if(a instanceof P)return a;bd();if(q(a))I.call(this,null,null),this.ga=a;else if(a instanceof I)I.call(this,a.b,a.c,a.d),this.ga=null;else throw Error("Invalid argument specified for ee.Number(): "+a);};w(P,I);v("ee.Number",P);var cd=!1,bd=function(){cd||(N(P,"Number","Number"),cd=!0)};P.prototype.f=function(a){return q(this.ga)?this.ga:P.n.f.call(this,a)};P.prototype.name=function(){return"Number"};var Q=function(a){if(!(this instanceof Q))return J(Q,arguments);if(a instanceof Q)return a;dd();if(p(a))I.call(this,null,null),this.ha=a;else if(a instanceof I)I.call(this,a.b,a.c,a.d),this.ha=null;else throw Error("Invalid argument specified for ee.String(): "+a);};w(Q,I);v("ee.String",Q);var ed=!1,dd=function(){ed||(N(Q,"String","String"),ed=!0)};Q.prototype.f=function(a){return p(this.ha)?this.ha:Q.n.f.call(this,a)};Q.prototype.name=function(){return"String"};var fd=function(a,b){if(!(this instanceof fd))return J(fd,arguments);for(var c=[],d=a.args,e=0;e<d.length;e++){var f=d[e];c.push(gd(Pc(f.type),f.name))}this.G=hd(a,c,b);this.cb=b.apply(null,c)};w(fd,K);v("ee.CustomFunction",fd);fd.prototype.f=function(a){return{type:"Function",argumentNames:Oa(this.G.args,function(a){return a.name}),body:a(this.cb)}};fd.prototype.r=function(){return this.G};
|
|
var gd=function(a,b){a=a||Object;if(!(a.prototype instanceof I))if(a&&a!=Object)if(a==String)a=Q;else if(a==Number)a=P;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=I;var c=function(){};c.prototype=a.prototype;c=new c;c.b=null;c.c=null;c.d=b;return c},hd=function(a,b,c){for(var d=[],e=0;e<b.length;e++)null===b[e].d&&d.push(e);if(0==d.length)return a;var f=function(a){var b=0;s(a)&&!r(a)&&("Function"==a.type&&b++,ha(a,function(a){b+=
|
|
f(a)}));return b},e=Hc(c.apply(null,b));c="_MAPPING_VAR_"+f(e)+"_";for(e=0;e<d.length;e++){var g=d[e],l=c+e;b[g].d=l;a.args[g].name=l}return a};var R=function(a,b,c){I.call(this,a,b,c);id()};w(R,I);v("ee.Element",R);var jd=!1,id=function(){jd||(N(R,"Element","Element"),jd=!0)};R.prototype.name=function(){return"Element"};
|
|
R.prototype.set=function(a){var b=this;if(1>=arguments.length){var c=arguments[0];if(!s(c))throw Error("When Element.set() is passed one argument, it must be a dictionary.");var d;if(d=Uc(c)){t:{d=ma(c);var e=["properties"];if(da(d)&&da(e)&&d.length==e.length){for(var f=d.length,g=0;g<f;g++)if(d[g]!==e[g]){d=!1;break t}d=!0}else d=!1}d=d&&Uc(c.properties)}d&&(c=c.properties);try{for(var l in c)var u=c[l],b=M("Element.set",b,l,u)}catch(E){b=M("Feature.set",b,c)}}else{if(0!=arguments.length%2)throw Error("When Element.set() is passed multiple arguments, there must be an even number of them.");
|
|
try{for(d=0;d<arguments.length;d+=2)l=arguments[d],u=arguments[d+1],b=M("Element.set",b,l,u)}catch(A){c={};for(d=0;d<arguments.length;d+=2)l=arguments[d],u=arguments[d+1],c[l]=u;b=M("Feature.set",b,c)}}return Kc(this,b)};v("ee.Element.prototype.set",R.prototype.set);var S=function(a){if(!(this instanceof S))return J(S,arguments);if(a instanceof S)return a;kd();if(n(a)){if(0==a.length)throw Error("Empty list specified for ee.Filter().");if(1==a.length)return new S(a[0]);I.call(this,new L("Filter.and"),{filters:a});this.L=a}else if(a instanceof I)I.call(this,a.b,a.c,a.d),this.L=[a];else{if(m(a))throw Error("Invalid argument specified for ee.Filter(): "+a);I.call(this,null,null);this.L=[]}};w(S,I);v("ee.Filter",S);
|
|
var ld=!1,kd=function(){ld||(N(S,"Filter","Filter"),ld=!0)},md={equals:"equals",less_than:"lessThan",greater_than:"greaterThan",contains:"stringContains",starts_with:"stringStartsWith",ends_with:"stringEndsWith"};S.prototype.length=function(){return this.L.length};S.prototype.length=S.prototype.length;var T=function(a,b){var c=a.L.slice(0);b instanceof S?Ta(c,b.L):b instanceof Array?Ta(c,b):c.push(b);return new S(c)};S.prototype.v=function(){return M("Filter.not",this)};S.prototype.not=S.prototype.v;
|
|
var nd=function(a,b,c){b=b.toLowerCase();var d=!1;0==b.lastIndexOf("not_",0)&&(d=!0,b=b.substring(4));if(!(b in md))throw Error("Unknown filtering operator: "+b);a=M("Filter."+md[b],a,c);return d?a.v():a};S.metadata=nd;var od=function(a,b){return M("Filter.equals",a,b)};S.eq=od;var pd=function(a,b){return od(a,b).v()};S.neq=pd;var qd=function(a,b){return M("Filter.lessThan",a,b)};S.lt=qd;var rd=function(a,b){return qd(a,b).v()};S.gte=rd;var sd=function(a,b){return M("Filter.greaterThan",a,b)};
|
|
S.gt=sd;var td=function(a,b){return sd(a,b).v()};S.lte=td;var ud=function(a,b){return M("Filter.stringContains",a,b)};S.contains=ud;var vd=function(a,b){return ud(a,b).v()};S.not_contains=vd;var wd=function(a,b){return M("Filter.stringStartsWith",a,b)};S.starts_with=wd;var xd=function(a,b){return wd(a,b).v()};S.not_starts_with=xd;var yd=function(a,b){return M("Filter.stringEndsWith",a,b)};S.ends_with=yd;var zd=function(a,b){return yd(a,b).v()};S.not_ends_with=zd;
|
|
var Ad=function(a){return M("Filter.and",Array.prototype.slice.call(arguments))};S.and=Ad;S.or=function(a){return M("Filter.or",Array.prototype.slice.call(arguments))};var Bd=function(a,b){var c=M("DateRange",a,b);return Wc("Filter.dateRangeContains",{leftValue:c,rightField:"system:time_start"})};S.date=Bd;var Cd=function(a,b,c,d){return Wc("Filter.listContains",{leftField:c,rightValue:d,rightField:a,leftValue:b})};S.inList=Cd;
|
|
var Dd=function(a,b){return Wc("Filter.intersects",{leftField:".all",rightValue:M("Feature",a),maxError:b})};S.bounds=Dd;S.prototype.lb=function(){return T(this,od.apply(null,[].slice.call(arguments)))};S.prototype.eq=S.prototype.lb;S.prototype.wb=function(){return T(this,pd.apply(null,[].slice.call(arguments)))};S.prototype.neq=S.prototype.wb;S.prototype.ub=function(){return T(this,qd.apply(null,[].slice.call(arguments)))};S.prototype.lt=S.prototype.ub;
|
|
S.prototype.sb=function(){return T(this,rd.apply(null,[].slice.call(arguments)))};S.prototype.gte=S.prototype.sb;S.prototype.rb=function(){return T(this,sd.apply(null,[].slice.call(arguments)))};S.prototype.gt=S.prototype.rb;S.prototype.vb=function(){return T(this,td.apply(null,[].slice.call(arguments)))};S.prototype.lte=S.prototype.vb;S.prototype.contains=function(){return T(this,ud.apply(null,[].slice.call(arguments)))};S.prototype.contains=S.prototype.contains;
|
|
S.prototype.xb=function(){return T(this,vd.apply(null,[].slice.call(arguments)))};S.prototype.not_contains=S.prototype.xb;S.prototype.Ab=function(){return T(this,wd.apply(null,[].slice.call(arguments)))};S.prototype.starts_with=S.prototype.Ab;S.prototype.zb=function(){return T(this,xd.apply(null,[].slice.call(arguments)))};S.prototype.not_starts_with=S.prototype.zb;S.prototype.kb=function(){return T(this,yd.apply(null,[].slice.call(arguments)))};S.prototype.ends_with=S.prototype.kb;
|
|
S.prototype.yb=function(){return T(this,zd.apply(null,[].slice.call(arguments)))};S.prototype.not_ends_with=S.prototype.yb;S.prototype.ib=function(){return T(this,Ad.apply(null,[].slice.call(arguments)))};S.prototype.and=S.prototype.ib;S.prototype.jb=function(){return T(this,Bd.apply(null,[].slice.call(arguments)))};S.prototype.date=S.prototype.jb;S.prototype.tb=function(){return T(this,Cd.apply(null,[].slice.call(arguments)))};S.prototype.inList=S.prototype.tb;
|
|
S.prototype.bounds=function(){return T(this,Dd.apply(null,[].slice.call(arguments)))};S.prototype.bounds=S.prototype.bounds;S.prototype.name=function(){return"Filter"};var U=function(a,b,c){R.call(this,a,b,c);Ed()};w(U,R);v("ee.Collection",U);var Fd=!1,Ed=function(){Fd||(N(U,"Collection","Collection"),N(U,"AggregateFeatureCollection","Collection","aggregate_"),Fd=!0)};U.prototype.filter=function(a){if(!a)throw Error("Empty filters.");return Kc(this,M("Collection.filter",this,a))};v("ee.Collection.prototype.filter",U.prototype.filter);U.prototype.pb=function(a,b,c){return this.filter(nd(a,b,c))};v("ee.Collection.prototype.filterMetadata",U.prototype.pb);
|
|
U.prototype.nb=function(a){return this.filter(Dd(a))};v("ee.Collection.prototype.filterBounds",U.prototype.nb);U.prototype.ob=function(a,b){return this.filter(Bd(a,b))};v("ee.Collection.prototype.filterDate",U.prototype.ob);U.prototype.limit=function(a,b,c){return Kc(this,M("Collection.limit",this,a,b,c))};v("ee.Collection.prototype.limit",U.prototype.limit);U.prototype.sort=function(a,b){return Kc(this,M("Collection.limit",this,void 0,a,b))};v("ee.Collection.prototype.sort",U.prototype.sort);
|
|
U.prototype.name=function(){return"Collection"};var Gd=function(a,b,c){if(!r(c))throw Error("Can't map non-callable object: "+c);b={name:"",returns:"Object",args:[{name:null,type:Qc(b)}]};return Kc(a,Wc("Collection.map",{collection:a,baseAlgorithm:new fd(b,c)}))};U.prototype.map=function(a){return Gd(this,I,a)};v("ee.Collection.prototype.map",U.prototype.map);var Hd=function(a,b){if(!(this instanceof Hd))return J(Hd,arguments);if(a instanceof Hd)return a;Id();var c=new L("Date"),d={},e=null;if(Tc(a)){if(d.value=a,b)if(Tc(b))d.timeZone=b;else throw Error("Invalid argument specified for ee.Date(..., opt_tz): "+b);}else if(Sc(a))d.value=a;else if(s(a)&&"function"==typeof a.getFullYear)d.value=Math.floor(a.getTime());else if(a instanceof I)a.b!=c?d.value=a:(c=a.b,d=a.c,e=a.d);else throw Error("Invalid argument specified for ee.Date(): "+a);I.call(this,c,d,
|
|
e)};w(Hd,I);v("ee.Date",Hd);var Jd=!1,Id=function(){Jd||(N(Hd,"Date","Date"),Jd=!0)};Hd.prototype.name=function(){return"Date"};var V=function(a,b,c){if(!(this instanceof V))return J(V,arguments);Kd();var d=null!=b||null!=c;if(a instanceof I&&!(a instanceof V&&a.K)){if(d)throw Error("Setting the CRS or geodesic on a computed Geometry is not suported. Use Geometry.transform().");I.call(this,a.b,a.c,a.d)}else{a instanceof V&&(a=a.f());if(3<arguments.length)throw Error("The Geometry constructor takes at most 3 arguments ("+arguments.length+" given)");if(!Ld(a))throw Error("Invalid GeoJSON geometry: "+JSON.stringify(a));I.call(this,
|
|
null,null);this.K=a.type;this.Na=a.coordinates||null;this.Oa=a.geometries||null;if(null!=b)this.ea=b;else if("crs"in a)if(s(a.crs)&&"name"==a.crs.type&&s(a.crs.properties)&&p(a.crs.properties.name))this.ea=a.crs.properties.name;else throw Error("Invalid CRS declaration in GeoJSON: "+(new ua).h(a.crs));this.da=c;!m(c)&&"geodesic"in a&&(this.da=Boolean(a.geodesic))}};w(V,I);v("ee.Geometry",V);
|
|
var Md=!1,Kd=function(){Md||(N(V,"Geometry","Geometry"),Md=!0)},Nd=function(a,b){if(!(this instanceof Nd))return Od(Nd,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]})};w(Nd,V);V.Point=Nd;
|
|
var Pd=function(a){if(!(this instanceof Pd))return Od(Pd,arguments);V.call(this,{type:"MultiPoint",coordinates:Qd(a,2,arguments)})};w(Pd,V);V.MultiPoint=Pd;var Rd=function(a,b,c,d){if(!(this instanceof Rd))return J(Rd,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]]]})};w(Rd,V);V.Rectangle=Rd;
|
|
var Sd=function(a){if(!(this instanceof Sd))return Od(Sd,arguments);V.call(this,{type:"LineString",coordinates:Qd(a,2,arguments)})};w(Sd,V);V.LineString=Sd;var Td=function(a){if(!(this instanceof Td))return Od(Td,arguments);V.call(this,{type:"LinearRing",coordinates:Qd(a,2,arguments)})};w(Td,V);V.LinearRing=Td;var Ud=function(a){if(!(this instanceof Ud))return Od(Ud,arguments);V.call(this,{type:"MultiLineString",coordinates:Qd(a,3,arguments)})};w(Ud,V);V.MultiLineString=Ud;
|
|
var Vd=function(a){if(!(this instanceof Vd))return Od(Vd,arguments);V.call(this,{type:"Polygon",coordinates:Qd(a,3,arguments)})};w(Vd,V);V.Polygon=Vd;var Wd=function(a){if(!(this instanceof Wd))return Od(Wd,arguments);V.call(this,{type:"MultiPolygon",coordinates:Qd(a,4,arguments)})};w(Wd,V);V.MultiPolygon=Wd;
|
|
V.prototype.f=function(a){if(!this.K){if(!a)throw Error("Must specify an encode function when encoding a computed geometry.");return I.prototype.f.call(this,a)}a={type:this.K};"GeometryCollection"==this.K?a.geometries=this.Oa:a.coordinates=this.Na;null!=this.ea&&(a.crs={type:"name",properties:{name:this.ea}});null!=this.da&&(a.geodesic=this.da);return a};V.prototype.za=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return this.f()};
|
|
V.prototype.toGeoJSON=V.prototype.za;V.prototype.La=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return(new ua).h(this.za())};V.prototype.toGeoJSONString=V.prototype.La;V.prototype.type=function(){if(this.b)throw Error("Can't get the type of a computed Geometry to GeoJSON. Use getInfo() instead.");return this.K};V.prototype.type=V.prototype.type;V.prototype.h=function(){return Ic(this)};V.prototype.serialize=V.prototype.h;
|
|
V.prototype.toString=function(){return"ee.Geometry("+this.La()+")"};
|
|
var Ld=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(!Ld(b[a]))return!1;return!0}a=Xd(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},Xd=function(a){if(!n(a))return-1;if(n(a[0])){for(var b=Xd(a[0]),c=1;c<a.length;c++)if(Xd(a[c])!=b)return-1;return b+1}for(c=0;c<a.length;c++)if(!q(a[c]))return-1;return 0==
|
|
a.length%2?1:-1},Qd=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(Xd(a)!=b)throw Error("Invalid geometry");return a},Od=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"};v("ee.Deserializer",function(){});v("ee.Deserializer.fromJSON",function(a){return Yd(sa(a))});var Yd=function(a){var b={};if(s(a)&&"CompoundValue"==a.type){for(var c=a.scope,d=0;d<c.length;d++){var e=c[d][0],f=c[d][1];if(e in b)throw Error('Duplicate scope key "'+e+'" in scope #'+d+".");b[e]=Zd(f,b)}a=a.value}return Zd(a,b)};v("ee.Deserializer.decode",Yd);
|
|
var Zd=function(a,b){if(null===a||q(a)||"boolean"==typeof a||p(a))return a;if(n(a))return Oa(a,function(a){return Zd(a,b)});if(!s(a)||r(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 gd(Object,c);case "Date":c=a.value;if(!q(c))throw Error("Invalid date value: "+c);return new Hd(c/1E3);case "Bytes":return c=new yc,
|
|
c.f=function(){return a},c;case "Invocation":var c="functionName"in a?Vc(a.functionName):Zd(a["function"],b),d=ka(a.arguments,function(a){return Zd(a,b)});if(c instanceof K)return c.apply(d);if(c instanceof I)return new I(c,d);throw Error("Invalid function value: "+a["function"]);case "Dictionary":return ka(a.value,function(a){return Zd(a,b)});case "Function":var e=Zd(a.body,b),c={name:"",args:Oa(a.argumentNames,function(a){return{name:a,type:"Object",optional:!1}}),returns:"Object"};return new fd(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 W=function(a,b){if(!(this instanceof W))return J(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)");$d();if(a instanceof V||null===a)R.call(this,new L("Feature"),{geometry:a,metadata:b||null});else if(a instanceof I)R.call(this,a.b,a.c,a.d);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=x(c);c["system:index"]=a.id}R.call(this,new L("Feature"),{geometry:new V(a.geometry),metadata:c})}else R.call(this,new L("Feature"),{geometry:new V(a),metadata:b||null})};w(W,R);v("ee.Feature",W);var ae=!1,$d=function(){ae||(N(W,"Feature","Feature"),ae=!0)};W.prototype.j=function(a){return W.n.j.call(this,a)};W.prototype.getInfo=W.prototype.j;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 Nd.apply(null,arguments)};W.MultiPoint=function(a){return Pd.apply(null,arguments)};W.Rectangle=function(a,b,c,d){return new Rd(a,b,c,d)};W.LineString=function(a){return Sd.apply(null,arguments)};W.LinearRing=function(a){return Td.apply(null,arguments)};W.MultiLine=function(a){return Ud.apply(null,arguments)};W.Polygon=function(a){return Vd.apply(null,arguments)};W.MultiPolygon=function(a){return Wd.apply(null,arguments)};
|
|
W.prototype.name=function(){return"Feature"};var X=function(a){if(!(this instanceof X))return J(X,arguments);if(a instanceof X)return a;be();if(n(a))I.call(this,null,null),this.fa=a;else if(a instanceof I)I.call(this,a.b,a.c,a.d),this.fa=null;else throw Error("Invalid argument specified for ee.List(): "+a);};w(X,I);v("ee.List",X);var ce=!1,be=function(){ce||(N(X,"List","List"),ce=!0)};X.prototype.f=function(a){return n(this.fa)?Oa(this.fa,function(b){return a(b)}):X.n.f.call(this,a)};X.prototype.name=function(){return"List"};
|
|
X.prototype.map=function(a){if(!r(a))throw Error("Can't map non-callable object: "+a);return Kc(this,Wc("List.map",{list:this,baseAlgorithm:new fd({name:"",returns:"Object",args:[{name:null,type:"Object"}]},a)}))};X.prototype.map=X.prototype.map;var Y=function(a,b){if(!(this instanceof Y))return J(Y,arguments);if(a instanceof Y)return a;if(2<arguments.length)throw Error("The FeatureCollection constructor takes at most 2 arguments ("+arguments.length+" given)");de();a instanceof V&&(a=new W(a));a instanceof W&&(a=[a]);if(Sc(a)||Tc(a)){var c={tableId:a};b&&(c.geometryColumn=b);U.call(this,new L("Collection.loadTable"),c)}else if(n(a))U.call(this,new L("Collection"),{features:Oa(a,function(a){return new W(a)})});else if(a instanceof X)U.call(this,
|
|
new L("Collection"),{features:a});else if(a instanceof I)U.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to a FeatureCollection: "+a);};w(Y,U);v("ee.FeatureCollection",Y);var ge=!1,de=function(){ge||(N(Y,"FeatureCollection","FeatureCollection"),ge=!0)};Y.prototype.getMap=function(a,b){var c=Wc("Collection.draw",{collection:this,color:(a||{}).color||"000000"});if(b)c.getMap(null,b);else return c.getMap()};Y.prototype.getMap=Y.prototype.getMap;
|
|
Y.prototype.j=function(a){return Y.n.j.call(this,a)};Y.prototype.getInfo=Y.prototype.j;Y.prototype.ta=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)vc(e,function(a,b){a?d(wc(a)):d(null,b)});else return wc(vc(e))};Y.prototype.getDownloadURL=Y.prototype.ta;Y.prototype.map=function(a){return Gd(this,W,a)};Y.prototype.name=function(){return"FeatureCollection"};var Z=function(a){if(!(this instanceof Z))return J(Z,arguments);if(a instanceof Z)return a;he();var b=arguments.length;if(0==b||1==b&&!m(a))R.call(this,new L("Image.mask"),{image:new Z(0),mask:new Z(0)});else if(1==b)if(Sc(a))R.call(this,new L("Image.constant"),{value:a});else if(Tc(a))R.call(this,new L("Image.load"),{id:a});else{if(n(a))return ie(Oa(a,function(a){return new Z(a)}));if(a instanceof I)"Array"==a.name()?R.call(this,new L("Image.constant"),{value:a}):R.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to an Image: "+
|
|
a);}else if(2==b){var b=arguments[0],c=arguments[1];if(Tc(b)&&Sc(c))R.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)");};w(Z,R);v("ee.Image",Z);var je=!1,he=function(){je||(N(Z,"Image","Image"),N(Z,"Window","Image","focal_"),je=!0)};Z.prototype.j=function(a){return Z.n.j.call(this,a)};Z.prototype.getInfo=Z.prototype.j;
|
|
Z.prototype.getMap=function(a,b){var c=a?x(a):{};c.image=this.h();if(b)pc(c,t(function(a,c){a&&(a.image=this);b(a,c)},this));else return c=pc(c),c.image=this,c};Z.prototype.getMap=Z.prototype.getMap;Z.prototype.ta=function(a,b){var c=a?x(a):{};c.image=this.h();if(b)tc(c,function(a,c){a?b(uc(a)):b(null,c)});else return uc(tc(c))};Z.prototype.getDownloadURL=Z.prototype.ta;Z.prototype.qb=function(a){a=a?x(a):{};a.image=this.h();return sc(rc(a))};Z.prototype.getThumbURL=Z.prototype.qb;
|
|
Z.rgb=function(a,b,c){return ie([a,b,c],["vis-red","vis-green","vis-blue"])};Z.cat=function(a){return ie(Array.prototype.slice.call(arguments),null)};var ie=function(a,b){if(0==a.length)throw Error("Can't combine 0 images.");for(var c=new Z(a[0]),d=1;d<a.length;d++)c=M("Image.addBands",c,a[d]);b&&(c=c.select([".*"],b));return c};
|
|
Z.prototype.select=function(a,b){var c={input:this,bandSelectors:a};if(Tc(a)||Sc(a)){a=Array.prototype.slice.call(arguments);for(var d=0;d<a.length;d++)if(!(Tc(a[d])||Sc(a[d])||a[d]instanceof I))throw Error("Illegal argument to select(): "+a[d]);c.bandSelectors=a}else b&&(c.newNames=b);return Wc("Image.select",c)};Z.prototype.select=Z.prototype.select;
|
|
Z.prototype.mb=function(a,b){var c=M("Image.parseExpression",a,"DEFAULT_EXPRESSION_IMAGE"),d=["DEFAULT_EXPRESSION_IMAGE"],e={DEFAULT_EXPRESSION_IMAGE:this};if(b)for(var f in b)d.push(f),e[f]=new Z(b[f]);f=new K;f.f=function(a){return c.f(a)};f.r=function(){return{name:"",args:Oa(d,function(a){return{name:a,type:"Image",optional:!1}},this),returns:"Image"}};return f.apply(e)};Z.prototype.expression=Z.prototype.mb;Z.prototype.clip=function(a){try{a=new V(a)}catch(b){}return M("Image.clip",this,a)};
|
|
Z.prototype.clip=Z.prototype.clip;Z.prototype.name=function(){return"Image"};var $=function(a){if(!(this instanceof $))return J($,arguments);if(a instanceof $)return a;if(1!=arguments.length)throw Error("The ImageCollection constructor takes exactly 1 argument ("+arguments.length+" given)");ke();a instanceof Z&&(a=[a]);if(Tc(a))U.call(this,new L("ImageCollection.load"),{id:a});else if(n(a))U.call(this,new L("ImageCollection.fromImages"),{images:Oa(a,function(a){return new Z(a)})});else if(a instanceof I)U.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to an ImageCollection: "+
|
|
a);};w($,U);v("ee.ImageCollection",$);var le=!1,ke=function(){le||(N($,"ImageCollection","ImageCollection"),N($,"reduce","ImageCollection"),le=!0)};$.prototype.getMap=function(a,b){var c=M("ImageCollection.mosaic",this);if(b)c.getMap(a,b);else return c.getMap(a)};$.prototype.getMap=$.prototype.getMap;$.prototype.j=function(a){return $.n.j.call(this,a)};$.prototype.getInfo=$.prototype.j;$.prototype.map=function(a){return Gd(this,Z,a)};
|
|
$.prototype.select=function(a,b){var c=arguments;return this.map(function(a){return a.select.apply(a,c)})};$.prototype.select=$.prototype.select;$.prototype.name=function(){return"ImageCollection"};v("ee.initialize",function(a,b,c,d){if("ready"!=me||a||b){var e=null!=c;if(d)if(e)ne.push(d);else throw Error("Can't pass an error callback without a success callback.");if("loading"==me&&e)oe.push(c);else if(me="loading",oc(a,b),e)oe.push(c),Yc(pe,qe);else try{Yc(),pe()}catch(f){throw qe(f),f;}}else c&&c()});
|
|
v("ee.reset",function(){me="not_ready";lc=kc=null;mc=!1;ia=null;Xc={};O(Hd);Jd=!1;O(R);jd=!1;O(Z);je=!1;O(W);ae=!1;O(U);Fd=!1;O($);le=!1;O(Y);ge=!1;O(S);ld=!1;O(V);Md=!1;O(X);ce=!1;O(P);cd=!1;O(Q);ed=!1;for(var a=k.ee,b=0;b<re.length;b++){var c=re[b];O(a[c]);delete a[c]}re=[];Oc=a;var a=se,d;for(d in a)delete a[d]});v("ee.InitState",{Db:"not_ready",LOADING:"loading",Eb:"ready"});v("ee.InitState.NOT_READY","not_ready");v("ee.InitState.LOADING","loading");v("ee.InitState.READY","ready");
|
|
var me="not_ready",oe=[],ne=[];v("ee.TILE_SIZE",256);var re=[],se={};v("ee.Algorithms",se);v("ee.call",function(a,b){p(a)&&(a=new L(a));return K.prototype.call.apply(a,Array.prototype.slice.call(arguments,1))});v("ee.apply",function(a,b){p(a)&&(a=new L(a));return a.apply(b)});
|
|
var pe=function(){if("loading"==me){try{Id();id();he();$d();Ed();ke();de();kd();Kd();be();bd();dd();var a=Zc(),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 f=k.ee,g;for(g in b)g in c&&!(g in f)&&(f[g]=te(g),re.push(g),a[g]?(f[g].signature=a[g],f[g].signature.isConstructor=!0,Xc[g]=!0):f[g].signature={});Oc=f;ue()}catch(l){qe(l);return}me="ready";for(ne=[];0<oe.length;)oe.shift()()}},qe=function(a){if("loading"==me)for(me=
|
|
"not_ready",oe=[];0<ne.length;)ne.shift()(a)},ue=function(){ha($c(),function(a,b){var c=a.r();if(!c.hidden){var d=b.split("."),e=se;for(e.signature={};1<d.length;){var f=d[0];f in e||(e[f]={signature:{}});e=e[f];d=Ua(d,1)}f=t(a.call,a);f.signature=c;f.toString=t(a.toString,a);e[d[0]]=f}})},te=function(a){var b=function(b){var d=k.ee[a],e=Array.prototype.slice.call(arguments),f=1==e.length;if(f&&e[0]instanceof d)return e[0];if(!(this instanceof d))return J(d,e);var d=ad(a),g=!(e[0]instanceof I),l=
|
|
!1;d&&(f?g?l=!0:e[0].b!=d&&(l=!0):l=!0);if(l)I.call(this,d,Nc(d,Mc(d,e)));else{if(!f)throw Error("Too many arguments for ee."+a+"(): "+e);if(g)throw Error("Invalid argument for ee."+a+"(): "+e+". Must be a ComputedObject.");e=e[0];I.call(this,e.b,e.c,e.d)}};w(b,I);b.prototype.name=function(){return a};N(b,a,a);return b},Lc=function(a,b){if(null===a)return null;if(m(a)){var c=k.ee;switch(b){case "Image":return new Z(a);case "Feature":return a instanceof U?M("Feature",M("Collection.geometry",a)):new W(a);
|
|
case "Element":case "EEObject":if(a instanceof R)return a;if(a instanceof I)return new R(a.b,a.c,a.d);throw Error("Cannot convert "+a+" to Element.");case "Geometry":return a instanceof Y?M("Collection.geometry",a):new V(a);case "FeatureCollection":case "Collection":return a instanceof U?a:new Y(a);case "ImageCollection":return new $(a);case "Filter":return new S(a);case "Algorithm":return p(a)?new L(a):a;case "Dictionary":return b in c?a instanceof c[b]?a:a instanceof I?new c[b](a):a:a;case "String":return Tc(a)||
|
|
a instanceof Q||a instanceof I?new Q(a):a;case "List":return new X(a);case "Number":case "Float":case "Long":case "Integer":case "Short":case "Byte":return new P(a);default:if(b in c){var d=ad(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}}};!bb&&!z||z&&z&&9<=hb||bb&&B("1.9.1");z&&B("9");z&&B("11");})();
|
|
//@ sourceMappingURL=ee_api_js.sourcemap
|