Simon Ilyushchenko 4224ee4bff v0.1.19
2014-02-19 16:09:39 -08:00

120 lines
62 KiB
JavaScript

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