/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
var k=this||self,u=function(a,b){a=a.split(".");var c=k;a[0]in c||typeof c.execScript=="undefined"||c.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)a.length||b===void 0?c=c[e]&&c[e]!==Object.prototype[e]?c[e]:c[e]={}:c[e]=b},x=function(a,b){function c(){}c.prototype=b.prototype;a.B=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.A=function(e,d,h){for(var p=Array(arguments.length-2),m=2;m<arguments.length;m++)p[m-2]=arguments[m];return b.prototype[d].apply(e,p)}};function y(a,b){if(Error.captureStackTrace)Error.captureStackTrace(this,y);else{var c=Error().stack;c&&(this.stack=c)}a&&(this.message=String(a));b!==void 0&&(this.cause=b)}x(y,Error);y.prototype.name="CustomError";function z(a,b){a=a.split("%s");for(var c="",e=a.length-1,d=0;d<e;d++)c+=a[d]+(d<b.length?b[d]:"%s");y.call(this,c+a[e])}x(z,y);z.prototype.name="AssertionError";var A=function(a,b,c){if(!a){var e="Assertion failed";if(b){e+=": "+b;var d=Array.prototype.slice.call(arguments,2)}throw new z(""+e,d||[]);}return a};var B=Array.prototype.forEach?function(a,b){A(a.length!=null);Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,e=typeof a==="string"?a.split(""):a,d=0;d<c;d++)d in e&&b.call(void 0,e[d],d,a)};/*

 Copyright Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
var D={};var E=function(a){if(D!==D)throw Error("Bad secret");this.v=a};E.prototype.toString=function(){return this.v};new E("about:blank");new E("about:invalid#zClosurez");var aa=[],ba=function(a){console.warn("A URL with content '"+a+"' was sanitized away.")};aa.indexOf(ba)===-1&&aa.push(ba);var F,G;a:{for(var ca=["CLOSURE_FLAGS"],H=k,J=0;J<ca.length;J++)if(H=H[ca[J]],H==null){G=null;break a}G=H}var da=G&&G[610401301];F=da!=null?da:!1;function ea(){var a=k.navigator;return a&&(a=a.userAgent)?a:""}var K,fa=k.navigator;K=fa?fa.userAgentData||null:null;function L(a){return F?K?K.brands.some(function(b){return(b=b.brand)&&b.indexOf(a)!=-1}):!1:!1}function M(a){return ea().indexOf(a)!=-1};function N(){return F?!!K&&K.brands.length>0:!1}function O(){return N()?L("Chromium"):(M("Chrome")||M("CriOS"))&&!(N()?0:M("Edge"))||M("Silk")};var ha=ea().toLowerCase().indexOf("webkit")!=-1&&!M("Edge")&&M("Mobile");!M("Android")||O();O();var ia=M("Safari")&&!(O()||(N()?0:M("Coast"))||(N()?0:M("Opera"))||(N()?0:M("Edge"))||(N()?L("Microsoft Edge"):M("Edg/"))||(N()?L("Opera"):M("OPR"))||M("Firefox")||M("FxiOS")||M("Silk")||M("Android"))&&!(M("iPhone")&&!M("iPod")&&!M("iPad")||M("iPad")||M("iPod"));var la=function(a){var b=window;ha&&ia&&b?(b.focus(),ja(b,a,0)):(a.close(),ka(a))},ja=function(a,b,c){a.setTimeout(function(){b.closed||c==5?ka(b):(b.close(),c++,ja(a,b,c))},1E3)},ka=function(a){if(!a.closed&&a.document&&a.document.body)if(a=a.document.body,A(a!=null,"goog.dom.setTextContent expects a non-null value for node"),"textContent"in a)a.textContent="Please close this window.";else if(a.nodeType==3)a.data="Please close this window.";else if(a.firstChild&&a.firstChild.nodeType==3){for(;a.lastChild!=
a.firstChild;)a.removeChild(A(a.lastChild));a.firstChild.data="Please close this window."}else{for(var b;b=a.firstChild;)a.removeChild(b);A(a,"Node cannot be null or undefined.");a.appendChild((a.nodeType==9?a:a.ownerDocument||a.document).createTextNode("Please close this window."))}};var ma=function(a){if(!a)return"";if(/^about:(?:blank|srcdoc)$/.test(a))return window.origin||"";a.indexOf("blob:")===0&&(a=a.substring(5));a=a.split("#")[0].split("?")[0];a=a.toLowerCase();a.indexOf("//")==0&&(a=window.location.protocol+a);/^[\w\-]*:\/\//.test(a)||(a=window.location.href);var b=a.substring(a.indexOf("://")+3),c=b.indexOf("/");c!=-1&&(b=b.substring(0,c));c=a.substring(0,a.indexOf("://"));if(!c)throw Error("URI is missing protocol: "+a);if(c!=="http"&&c!=="https"&&c!=="chrome-extension"&&
c!=="moz-extension"&&c!=="file"&&c!=="android-app"&&c!=="chrome-search"&&c!=="chrome-untrusted"&&c!=="chrome"&&c!=="app"&&c!=="devtools")throw Error("Invalid URI scheme in origin: "+c);a="";var e=b.indexOf(":");if(e!=-1){var d=b.substring(e+1);b=b.substring(0,e);if(c==="http"&&d!=="80"||c==="https"&&d!=="443")a=":"+d}return c+"://"+b+a};function na(){function a(){d[0]=1732584193;d[1]=4023233417;d[2]=2562383102;d[3]=271733878;d[4]=3285377520;v=q=0}function b(g){for(var l=p,f=0;f<64;f+=4)l[f/4]=g[f]<<24|g[f+1]<<16|g[f+2]<<8|g[f+3];for(f=16;f<80;f++)g=l[f-3]^l[f-8]^l[f-14]^l[f-16],l[f]=(g<<1|g>>>31)&4294967295;g=d[0];var n=d[1],r=d[2],t=d[3],S=d[4];for(f=0;f<80;f++){if(f<40)if(f<20){var w=t^n&(r^t);var I=1518500249}else w=n^r^t,I=1859775393;else f<60?(w=n&r|t&(n|r),I=2400959708):(w=n^r^t,I=3395469782);w=((g<<5|g>>>27)&4294967295)+w+
S+I+l[f]&4294967295;S=t;t=r;r=(n<<30|n>>>2)&4294967295;n=g;g=w}d[0]=d[0]+g&4294967295;d[1]=d[1]+n&4294967295;d[2]=d[2]+r&4294967295;d[3]=d[3]+t&4294967295;d[4]=d[4]+S&4294967295}function c(g,l){if(typeof g==="string"){g=unescape(encodeURIComponent(g));for(var f=[],n=0,r=g.length;n<r;++n)f.push(g.charCodeAt(n));g=f}l||(l=g.length);f=0;if(q==0)for(;f+64<l;)b(g.slice(f,f+64)),f+=64,v+=64;for(;f<l;)if(h[q++]=g[f++],v++,q==64)for(q=0,b(h);f+64<l;)b(g.slice(f,f+64)),f+=64,v+=64}function e(){var g=[],l=
v*8;q<56?c(m,56-q):c(m,64-(q-56));for(var f=63;f>=56;f--)h[f]=l&255,l>>>=8;b(h);for(f=l=0;f<5;f++)for(var n=24;n>=0;n-=8)g[l++]=d[f]>>n&255;return g}for(var d=[],h=[],p=[],m=[128],C=1;C<64;++C)m[C]=0;var q,v;a();return{reset:a,update:c,digest:e,digestString:function(){for(var g=e(),l="",f=0;f<g.length;f++)l+="0123456789ABCDEF".charAt(Math.floor(g[f]/16))+"0123456789ABCDEF".charAt(g[f]%16);return l}}};var oa=function(a,b,c){var e=[];if((Array.isArray(null)?2:1)==1)return e=[b,a],B(c,function(m){e.push(m)}),P(e.join(" "));var d=[],h=[];B(null,function(m){h.push(m.key);d.push(m.value)});var p=Math.floor((new Date).getTime()/1E3);e=d.length==0?[p,b,a]:[d.join(":"),p,b,a];B(c,function(m){e.push(m)});a=P(e.join(" "));p=[p,a];h.length==0||p.push(h.join(""));return p.join("_")},P=function(a){var b=na();b.update(a);return b.digestString().toLowerCase()};var pa=function(a){var b=a||[];a=[];for(var c=0,e=b.length;c<e;++c){var d=String(b[c]||"");d&&a.push(d)}if(a.length<2)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",oa(ma(c),b,a||[])].join(" "):null)||"")&&a.substr(14)||null},Q=function(a,b,c){this.o=String(a||"");this.j=String(b||"");this.h=String(c||"");this.g={};this.s=this.u=this.l=this.m="";this.i=null};
Q.prototype.evaluate=function(){var a={},b="";try{b=String(document.cookie||"")}catch(p){}b=b.split("; ").join(";").split(";");for(var c=0,e=b.length;c<e;++c){var d=b[c],h=d.indexOf("=");h!=-1?a[d.substr(0,h)]=d.substr(h+1):a[d]=null}this.g=a;if(this.g.SAPISID||this.g.APISID||this.g["__Secure-3PAPISID"])if(this.j=this.j.split(".")[0].split("@")[0],this.l=qa(this,this.o))if(a=gadgets.rpc.getOrigin(String(window.location.href)),this.m=qa(this,a)){b=String(this.g.LSOLH||"").split(":");c=b.length;if(c==
1||c==4)this.u=b[0];if(c==3||c==4)a=String(b[c-3]||""),b=String(b[c-1]||""),c=this.m,a?(e=[a],c&&e.push(c),c=P(e.join(" ")).substr(0,4)):c=null,c===b&&(this.s=a);this.h&&(a=this.h.indexOf("."),a!=-1&&(a=this.h.substr(0,a)||"",this.h=a+"."+pa([this.l,this.o,this.j,this.u,this.s,a]).substr(0,4)));a=pa([this.l,this.o,this.j,this.h]);this.h&&(a=a+"."+this.h);this.i=a}else this.i="";else this.i=""};
var qa=function(a,b){(b=String(a.g[b.indexOf("https://")==0?"SAPISID":"APISID"]||""))||(b=String(a.g["__Secure-3PAPISID"]||""));return b};Q.prototype.getVersionInfo=function(a){var b=parseInt(a,10);if(String(b)!=a||!(b>=0))return null;a=this.s;if(!a)return null;a=a.split("|");return a.length<=b?null:a[b]||null};
var ra=function(a,b,c){a=new Q(a,b,c);a.evaluate();return a},R=function(a,b,c){c=c||sa(this);var e=null;if(a){a=String(a);var d=a.indexOf(".");d!=-1&&(e=a.substr(d+1))}b=ra(c,b,e).i;if(a==null||a=="")a=b==a;else if(b==null||b.length!=a.length)a=!1;else{e=c=0;for(d=a.length;e<d;++e)c|=a.charCodeAt(e)^b.charCodeAt(e);a=c==0}return a},T=function(a,b,c){c=c||sa(this);c=ra(c);if(String(a)!=c.i)throw Error("Unauthorized request");return c.getVersionInfo(String(b))},sa=function(a){a=String(a.origin||"");
if(!a)throw Error("RPC has no origin.");return a};u("checkSessionState",R);u("getVersionInfo",T);var U,V,W,X,Y,Z,ta=window,ua=(window.location.href||ta.location.href).match(RegExp(".*(\\?|#|&)usegapi=([^&#]+)"))||[];
"1"===decodeURIComponent(ua[ua.length-1]||"")?(W=function(a,b,c,e,d,h){U.send(b,d,e,h||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(){va()},Z=function(){W("..","oauth2relayReady",gadgets.rpc.getAuthToken(".."));X("check_session_state",
wa);X("get_versioninfo",xa)}):(W=function(a,b,c,e,d){gadgets.rpc.call(a,b+":"+c,e,d)},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",R);X("get_versioninfo",T)});
var va=function(){var a=Z;window.gapi.load("gapi.iframes",function(){U=gapi.iframes.getContext().getParentIframe();a()})},ya=function(a){window.setTimeout(function(){Y(a)},1)},wa=function(a){if(a){var b=a.session_state;var c=a.client_id}return R(b,c,U.getOrigin())},xa=function(a){return T(a.xapisidHash,a.sessionIndex,U.getOrigin())},za=!1,Aa=!1,Ba=function(){Aa=!0;za&&V()};u("oauth2callback",ya);
u("oauth2verify",function(a,b){var c=window.open("about:blank",a),e;if(c&&!c.closed&&(e=c.oauth2callbackUrl))return window.timeoutMap=window.timeoutMap||{},window.realSetTimeout=window.realSetTimeout||window.setTimeout,window.setTimeout=function(d,h){try{var p=d,m=!1;d=function(){if(!m){m=!0;try{window.timeoutMap[String(q)]=void 0,delete window.timeoutMap[String(q)]}catch(v){}return p.call(this)}};var C=c.setTimeout(d,h);var q=window.realSetTimeout(d,h);window.timeoutMap[String(q)]=C;return q}catch(v){}return window.realSetTimeout(d,
h)},window.realClearTimeout=window.realClearTimeout||window.clearTimeout,window.clearTimeout=function(d){try{var h=window.timeoutMap[String(d)];h&&c.clearTimeout(h)}catch(p){}try{window.timeoutMap[String(d)]=void 0,delete window.timeoutMap[String(d)]}catch(p){}window.realClearTimeout(d)},ya(String(e)),"keep_open"!=b&&la(c),!0;c&&!c.closed&&la(c);return!1});u("init",function(){za=!0;Aa&&V()});window.addEventListener?window.addEventListener("load",Ba,!1):window.attachEvent("onload",Ba);
