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