var h=this,p=function(a,b){var c=a.split("."),d=h;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},q=function(a,b){function c(){}c.prototype=b.prototype;a.o=b.prototype;a.prototype=new c;a.m=function(a,c,g){for(var k=Array(arguments.length-2),f=2;f<arguments.length;f++)k[f-2]=arguments[f];return b.prototype[c].apply(a,k)}};var r=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};q(r,Error);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")},t=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},u=function(a,b){return a<b?-1:a>b?1:0};var v=function(a,b){b.unshift(a);r.call(this,aa.apply(null,b));b.shift()};q(v,r);var w=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 v(""+d,e||[]);}};var ba=Array.prototype.forEach?function(a,b,c){w(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e="string"==typeof a?a.split(""):a,g=0;g<d;g++)g in e&&b.call(c,e[g],g,a)};var x;a:{var y=h.navigator;if(y){var z=y.userAgent;if(z){x=z;break a}}x=""}var A=function(a){return-1!=x.indexOf(a)};var da=function(a,b){var c=ca;Object.prototype.hasOwnProperty.call(c,a)||(c[a]=b(a))};var ea=A("Opera"),B=A("Trident")||A("MSIE"),fa=A("Edge"),C=A("Gecko")&&!(-1!=x.toLowerCase().indexOf("webkit")&&!A("Edge"))&&!(A("Trident")||A("MSIE"))&&!A("Edge"),D=-1!=x.toLowerCase().indexOf("webkit")&&!A("Edge"),ga=D&&A("Mobile"),E=function(){var a=h.document;return a?a.documentMode:void 0},F;
a:{var G="",H=function(){var a=x;if(C)return/rv\:([^\);]+)(\)|;)/.exec(a);if(fa)return/Edge\/([\d\.]+)/.exec(a);if(B)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(D)return/WebKit\/(\S+)/.exec(a);if(ea)return/(?:Version)[ \/]?(\S+)/.exec(a)}();H&&(G=H?H[1]:"");if(B){var I=E();if(null!=I&&I>parseFloat(G)){F=String(I);break a}}F=G}
var J=F,ca={},K=function(a){da(a,function(){for(var b=0,c=t(String(J)).split("."),d=t(String(a)).split("."),e=Math.max(c.length,d.length),g=0;0==b&&g<e;g++){var k=c[g]||"",f=d[g]||"";do{k=/(\d*)(\D*)(.*)/.exec(k)||["","","",""];f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];if(0==k[0].length&&0==f[0].length)break;b=u(0==k[1].length?0:parseInt(k[1],10),0==f[1].length?0:parseInt(f[1],10))||u(0==k[2].length,0==f[2].length)||u(k[2],f[2]);k=k[3];f=f[3]}while(0==b)}return 0<=b})},L=h.document,ha=L&&B?E()||("CSS1Compat"==
L.compatMode?parseInt(J,10):5):void 0;var M;if(!(M=!C&&!B)){var N;if(N=B)N=9<=Number(ha);M=N}M||C&&K("1.9.1");B&&K("9");var ia=A("Safari")&&!((A("Chrome")||A("CriOS"))&&!A("Edge")||A("Coast")||A("Opera")||A("Edge")||A("Silk")||A("Android"))&&!(A("iPhone")&&!A("iPod")&&!A("iPad")||A("iPad")||A("iPod"));var P=function(a){var b=window;if(ga&&ia&&b){b.focus();var c=0,d=null,d=b.setInterval(function(){a.closed||5==c?(b.clearInterval(d),O(a)):(a.close(),c++)},150)}else a.close(),O(a)},O=function(a){if(!a.closed&&a.document&&a.document.body)if(a=a.document.body,w(null!=a,"goog.dom.setTextContent expects a non-null value for node"),"textContent"in a)a.textContent="Please close this window.";else if(3==a.nodeType)a.data="Please close this window.";else if(a.firstChild&&3==a.firstChild.nodeType){for(;a.lastChild!=
a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data="Please close this window."}else{for(var b;b=a.firstChild;)a.removeChild(b);w(a,"Node cannot be null or undefined.");a.appendChild((9==a.nodeType?a:a.ownerDocument||a.document).createTextNode("Please close this window."))}};var ja=function(a){if(!a)return"";a=a.split("#")[0].split("?")[0];a=a.toLowerCase();0==a.indexOf("//")&&(a=window.location.protocol+a);/^[\w\-]*:\/\//.test(a)||(a=window.location.href);var b=a.substring(a.indexOf("://")+3),c=b.indexOf("/");-1!=c&&(b=b.substring(0,c));a=a.substring(0,a.indexOf("://"));if("http"!==a&&"https"!==a&&"chrome-extension"!==a&&"file"!==a&&"android-app"!==a)throw Error("Invalid URI scheme in origin");var c="",d=b.indexOf(":");if(-1!=d){var e=b.substring(d+1),b=b.substring(0,
d);if("http"===a&&"80"!==e||"https"===a&&"443"!==e)c=":"+e}return a+"://"+b+c};var ka=function(){function a(){e[0]=1732584193;e[1]=4023233417;e[2]=2562383102;e[3]=271733878;e[4]=3285377520;n=m=0}function b(a){for(var b=k,c=0;64>c;c+=4)b[c/4]=a[c]<<24|a[c+1]<<16|a[c+2]<<8|a[c+3];for(c=16;80>c;c++)a=b[c-3]^b[c-8]^b[c-14]^b[c-16],b[c]=(a<<1|a>>>31)&4294967295;a=e[0];for(var d=e[1],g=e[2],f=e[3],m=e[4],l,n,c=0;80>c;c++)40>c?20>c?(l=f^d&(g^f),n=1518500249):(l=d^g^f,n=1859775393):60>c?(l=d&g|f&(d|g),n=2400959708):(l=d^g^f,n=3395469782),l=((a<<5|a>>>27)&4294967295)+l+m+n+b[c]&4294967295,
m=f,f=g,g=(d<<30|d>>>2)&4294967295,d=a,a=l;e[0]=e[0]+a&4294967295;e[1]=e[1]+d&4294967295;e[2]=e[2]+g&4294967295;e[3]=e[3]+f&4294967295;e[4]=e[4]+m&4294967295}function c(a,c){if("string"===typeof a){a=unescape(encodeURIComponent(a));for(var e=[],d=0,f=a.length;d<f;++d)e.push(a.charCodeAt(d));a=e}c||(c=a.length);e=0;if(0==m)for(;e+64<c;)b(a.slice(e,e+64)),e+=64,n+=64;for(;e<c;)if(g[m++]=a[e++],n++,64==m)for(m=0,b(g);e+64<c;)b(a.slice(e,e+64)),e+=64,n+=64}function d(){var a=[],d=8*n;56>m?c(f,56-m):c(f,
64-(m-56));for(var k=63;56<=k;k--)g[k]=d&255,d>>>=8;b(g);for(k=d=0;5>k;k++)for(var l=24;0<=l;l-=8)a[d++]=e[k]>>l&255;return a}for(var e=[],g=[],k=[],f=[128],l=1;64>l;++l)f[l]=0;var m,n;a();return{reset:a,update:c,digest:d,digestString:function(){for(var a=d(),c="",b=0;b<a.length;b++)c+="0123456789ABCDEF".charAt(Math.floor(a[b]/16))+"0123456789ABCDEF".charAt(a[b]%16);return c}}};var la=function(a,b,c){var d=[],d=[b,a];ba(c,function(a){d.push(a)});return Q(d.join(" "))},Q=function(a){var b=ka();b.update(a);return b.digestString().toLowerCase()};var R=function(a){var b=a||[];a=[];for(var c=0,d=b.length;c<d;++c){var e=String(b[c]||"");e&&a.push(e)}if(2>a.length)return null;b=a[0];c=gadgets.rpc.getOrigin(a[1]);if(c!==a[1])return null;a=a.slice(2);return(a=(c&&b?["session_state",la(ja(c),b,a||[])].join(" "):null)||"")&&a.substr(14)||null},ma=function(a,b,c){this.i=String(a||"");this.f=String(b||"");this.a=String(c||"");this.b={};this.j=this.l=this.g=this.h="";this.c=null};
ma.prototype.evaluate=function(){var a={},b="";try{b=String(document.cookie||"")}catch(k){}for(var b=b.split("; ").join(";").split(";"),c=0,d=b.length;c<d;++c){var e=b[c],g=e.indexOf("=");-1!=g?a[e.substr(0,g)]=e.substr(g+1):a[e]=null}this.b=a;if(this.b.SID)if(this.f=this.f.split(".")[0].split("@")[0],this.g=String(this.b[0==this.i.indexOf("https://")?"SAPISID":"APISID"]||""))if(a=0==gadgets.rpc.getOrigin(String(window.location.href)).indexOf("https://")?"SAPISID":"APISID",this.h=String(this.b[a]||
"")){b=String(this.b.LSOLH||"").split(":");c=b.length;if(1==c||4==c)this.l=b[0];if(3==c||4==c)a=String(b[c-3]||""),b=String(b[c-1]||""),c=this.h,a?(d=[a],c&&d.push(c),c=Q(d.join(" ")).substr(0,4)):c=null,c===b&&(this.j=a);this.a&&(a=this.a.indexOf("."),-1!=a&&(a=this.a.substr(0,a)||"",this.a=a+"."+R([this.g,this.i,this.f,this.l,this.j,a]).substr(0,4)));a=R([this.g,this.i,this.f,this.a]);this.a&&(a=a+"."+this.a);this.c=a}else this.c="";else this.c=""};
var na=function(a,b,c){a=new ma(a,b,c);a.evaluate();return a},S=function(a,b,c){c=c||oa(this);var d=null;if(a){a=String(a);var e=a.indexOf(".");-1!=e&&(d=a.substr(e+1))}b=na(c,b,d).c;if(null==a||""==a)a=b==a;else if(null==b||b.length!=a.length)a=!1;else{d=c=0;for(e=a.length;d<e;++d)c|=a.charCodeAt(d)^b.charCodeAt(d);a=0==c}return a},T=function(a,b,c){c=c||oa(this);c=na(c);if(String(a)!=c.c)throw Error("Unauthorized request");b=String(b);a=parseInt(b,10);String(a)==b&&0<=a?(b=c.j)?(b=b.split("|"),
a=b.length<=a?null:b[a]||null):a=null:a=null;return a},oa=function(a){a=String(a.origin||"");if(!a)throw Error("RPC has no origin.");return a};p("checkSessionState",S);p("getVersionInfo",T);var U,V,W,X,Y,Z,pa=window,qa=(window.location.href||pa.location.href).match(/.*(\?|#|&)usegapi=([^&#]+)/)||[];
"1"===decodeURIComponent(qa[qa.length-1]||"")?(W=function(a,b,c,d,e,g){U.send(b,e,d,g||gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)},X=function(a,b){U.register(a,b,gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)},Y=function(a){var b=/^(?:https?:\/\/)?[0-9.\-A-Za-z]+(?::\d+)?/.exec(a),b=gapi.iframes.makeWhiteListIframesFilter([b?b[0]:null]);W("..","oauth2callback",gadgets.rpc.getAuthToken(".."),void 0,a,b)},V=function(){ra()},Z=function(){W("..","oauth2relayReady",gadgets.rpc.getAuthToken(".."));X("check_session_state",
sa);X("get_versioninfo",ta)}):(W=function(a,b,c,d,e){gadgets.rpc.call(a,b+":"+c,d,e)},X=function(a,b){gadgets.rpc.register(a,b)},Y=function(a){gadgets.rpc.getTargetOrigin("..")==gadgets.rpc.getOrigin(a)&&W("..","oauth2callback",gadgets.rpc.getAuthToken(".."),void 0,a)},V=function(){Z()},Z=function(){W("..","oauth2relayReady",gadgets.rpc.getAuthToken(".."));X("check_session_state",S);X("get_versioninfo",T)});
var ra=function(){var a=Z;window.gapi.load("gapi.iframes",function(){U=gapi.iframes.getContext().getParentIframe();a()})},ua=function(a){window.setTimeout(function(){Y(a)},1)},sa=function(a){var b,c;a&&(b=a.session_state,c=a.client_id);return S(b,c,U.getOrigin())},ta=function(a){return T(a.xapisidHash,a.sessionIndex,U.getOrigin())},va=!1,wa=!1,xa=function(){wa=!0;va&&V()};p("oauth2callback",ua);
p("oauth2verify",function(a,b){var c=window.open("javascript:void(0);",a),d;if(c&&!c.closed&&(d=c.oauth2callbackUrl))return window.timeoutMap=window.timeoutMap||{},window.realSetTimeout=window.realSetTimeout||window.setTimeout,window.setTimeout=function(a,b){try{var d=a,f=!1,l;a=function(){if(!f){f=!0;try{window.timeoutMap[String(l)]=void 0,delete window.timeoutMap[String(l)]}catch(a){}return d.call(this)}};var m=c.setTimeout(a,b);l=window.realSetTimeout(a,b);window.timeoutMap[String(l)]=m;return l}catch(n){}return window.realSetTimeout(a,
b)},window.realClearTimeout=window.realClearTimeout||window.clearTimeout,window.clearTimeout=function(a){try{var b=window.timeoutMap[String(a)];b&&c.clearTimeout(b)}catch(d){}try{window.timeoutMap[String(a)]=void 0,delete window.timeoutMap[String(a)]}catch(d){}window.realClearTimeout(a)},ua(String(d)),"keep_open"!=b&&P(c),!0;c&&!c.closed&&P(c);return!1});p("init",function(){va=!0;wa&&V()});window.addEventListener?window.addEventListener("load",xa,!1):window.attachEvent("onload",xa);
