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