'use strict';var Zf;p("mr.IssueSeverity",{ln:"fatal",Nq:"warning",Po:"notification"});p("mr.IssueAction",{an:"dismiss",lo:"learn_more"});var $f=function(a,b,c){this.routeId=null;this.severity=b;this.isBlocking="fatal"==this.severity?!0:!1;this.title=a;this.message=null;this.defaultAction=c;this.helpPageId=this.secondaryActions=null};var ag=function(a,b){var c=this;this.b=void 0===b?null:b;this.a=new Promise(function(b,e){var d=function(a){c.b=null;e(a)};c.f=d;a(function(a){c.b=null;b(a)},d)})};ag.prototype.cancel=function(a){this.f(a);if(this.b){var b=this.b;this.b=null;setTimeout(function(){return b(a)},0)}};var bg=function(a,b,c){c=void 0===c?null:c;return new ag(function(d,e){a.a.then(function(a){if(b)try{d(b(a))}catch(g){e(g)}else d(a)},function(a){if(c)try{d(c(a))}catch(g){e(g)}else e(a)})},function(b){a.cancel(b)})};
ag.prototype.then=function(a,b){return bg(this,a,void 0===b?null:b)};var cg=function(a,b){return bg(a,null,b)},dg=function(a){return new ag(function(b){b(a)})},eg=function(a){return new ag(function(b,c){c(a)})},fg=function(a){return new ag(function(b,c){a.then(b,c)})},gg=function(a,b){var c=!1,d=null;return new ag(function(e,f){a.then(function(a){c||(d=b(a),d.a.then(e,f))},f)},function(a){d?d.cancel(a):c=!0})};var hg=function(){return null!=Ib&&-1!=Ib.indexOf("CrOS")},ig=function(){var a=Ib;if("string"!=typeof a)return!1;a=a.match(/Windows NT \d+.\d+/);if(!(a instanceof Array))return!1;a=a[0];a=a.match(/\d+.\d+/);if(!(a instanceof Array))return!1;a=a[0];return 6.2<=parseFloat(a)},jg=function(){return hg()?"ChromeOS":qc?"Windows":pc?"Mac":rc?"Linux":"Other"};var kg="undefined"!=typeof chrome&&!!chrome.networkingPrivate&&!!chrome.networkingPrivate.setWifiTDLSEnabledState&&hg(),lg=hg()||qc;var mg=function(a,b,c,d){this.b=a;this.a=b;this.f=c||null;this.g=d||null},rg=function(a,b){if("tab"==a.b)a=og(a);else if("offscreen_tab"==a.b)b=og(a),b.presentationId=a.g,a=b;else{var c={audio:!1,video:!1};a.a.shouldCaptureVideo&&(c.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:b}},qg(a,c.video.mandatory));lg&&a.a.shouldCaptureAudio&&(c.audio={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:b}});a=c}return a},og=function(a){var b={audio:a.a.shouldCaptureAudio,video:a.a.shouldCaptureVideo};
a.a.shouldCaptureVideo&&(b.videoConstraints={mandatory:{enableAutoThrottling:!0}},qg(a,b.videoConstraints.mandatory));return b},qg=function(a,b){var c=a.a.minWidth,d=a.a.minHeight;if(a.a.senderSideLetterboxing){c=a.a;if(0==c.minHeight||0==c.maxHeight?0:Math.floor(100*c.minWidth/c.minHeight)==Math.floor(100*c.maxWidth/c.maxHeight))c={width:c.minWidth,height:c.minHeight};else{for(var d=c.maxWidth,e=c.maxHeight;0!=e;)var f=d%e,d=e,e=f;e=c.maxWidth/d;d=c.maxHeight/d;if(e<c.minWidth||d<c.minHeight)if(f=
Math.max(c.minWidth/e,c.minHeight/d),e*=f,d*=f,e>c.maxWidth||d>c.maxHeight)e=c.maxWidth,d=c.maxHeight;e=Math.round(e);d=Math.round(d);c={width:e,height:d}}d=c;c=d.width;d=d.height}Object.assign(b,{minWidth:c,minHeight:d,maxWidth:a.a.maxWidth,maxHeight:a.a.maxHeight,minFrameRate:a.a.minFrameRate,maxFrameRate:a.a.maxFrameRate})};var sg=function(a){this.b=a;this.f=Date.now()},tg=function(a,b){null!=b&&(a+="_"+b);return a};sg.prototype.a=function(a){ug(tg(this.b,a),Date.now()-this.f)};var ug=function(a,b){0>b&&(w(vg,"Timing analytics event with negative time"),b=0);1E4<b&&(b=1E4);try{chrome.metricsPrivate.recordTime(a,b)}catch(c){w(vg,"Failed to record time "+b+" in "+a)}},vg=v("mr.Timing"),wg=function(a){sg.call(this,a)};ka(wg,sg);
wg.prototype.a=function(a){a=tg(this.b,a);var b=Date.now()-this.f;if(0>b)w(xg,"Timing analytics event with negative time");else{1E4>b&&(b=1E4);18E4<b&&(b=18E4);try{chrome.metricsPrivate.recordMediumTime(a,b)}catch(c){w(xg,"Failed to record time "+b+" in "+a)}}};var xg=v("mr.MediumTiming"),yg=function(a){sg.call(this,a)};ka(yg,sg);
yg.prototype.a=function(a){a=tg(this.b,a);var b=Date.now()-this.f;if(0>b)w(zg,"Timing analytics event with negative time");else{18E4>b&&(b=18E4);36E5<b&&(b=36E5);try{chrome.metricsPrivate.recordLongTime(a,b)}catch(c){w(zg,"Failed to record time "+b+" in "+a)}}};
var zg=v("mr.LongTiming"),Ag=v("mr.Analytics"),Bg=function(a){try{chrome.metricsPrivate.recordUserAction(a)}catch(b){w(Ag,"Failed to record event "+a)}},Cg=function(a,b,c){var d,e=0,f;for(f in c)e++,c[f]==b&&(d=f);if(d){c={metricName:a,type:"histogram-linear",min:1,max:e,buckets:e+1};try{chrome.metricsPrivate.recordValue(c,b)}catch(g){w(Ag,"Failed to record enum value "+d+" ("+b+") in "+a,g)}}else Ag.error("Unknown analytics value, "+b+" for histogram, "+a,Error())},Dg=function(a,b){try{if(0>b)throw Error("Invalid count for "+
a+": "+b);100<b&&w(Ag,"Small count for "+a+" exceeded limits: "+b,Error());chrome.metricsPrivate.recordSmallCount(a,b)}catch(c){w(Ag,"Failed to record small count "+a+" ("+b+")",c)}};var Eg={Cm:0,Am:1,Em:2,Bm:3,hm:4,Dm:5,Ln:6,tq:7,Um:8,jg:9},Fg=function(a,b){a=Error.call(this,a);this.message=a.message;"stack"in a&&(this.stack=a.stack);this.reason=0<=b&&9>=b?b:9};ka(Fg,Error);var Gg=function(a){this.b=a;this.a=this.Tc=null;this.j=v("mr.mirror.MirrorMediaStream")};Gg.prototype.start=function(){return"tab"==this.b.b?Hg(this):"offscreen_tab"==this.b.b?Ig(this):Jg(this)};var Hg=function(a){var b=rg(a.b);x(a.j,"Starting tab capture with constraints "+JSON.stringify(b));return new Promise(function(c,d){chrome.tabCapture.capture(b,function(b){b?(Kg(a,b),c(a)):d(Lg())});window.setTimeout(function(){d(new Fg("chrome.tabCapture.capture failed to call its callback",2))},5E3)})};
Gg.prototype.f=function(a){a&&x(this.j,function(){return"Track "+JSON.stringify(a.target)+" ended"});this.stop()};
var Lg=function(){return chrome.runtime.lastError&&chrome.runtime.lastError.message?new Fg(chrome.runtime.lastError.message,7):new Fg("empty_stream",0)},Jg=function(a){return(new Promise(function(a,c){var b=["screen","audio"];"Linux"==jg()&&b.push("window");var e=chrome.desktopCapture.chooseDesktopMedia(b,a);window.setTimeout(function(){chrome.desktopCapture.cancelChooseDesktopMedia(e);c(new Fg("timeout",1))},6E4)})).then(function(b){if(!b)throw new Fg("User cancelled capture dialog",3);var c=rg(a.b,
b);x(a.j,function(){return"Starting desktop capture with constraints "+JSON.stringify(c)});return new Promise(function(a,b){navigator.webkitGetUserMedia(c,a,function(a){var c=8;if("PermissionDeniedError"==a.name||"NotAllowedError"==a.name)c=3;b(new Fg(a.name+" "+a.constraintName+": "+a.message,c))})})}).then(function(b){if(b)Kg(a,b);else throw new Fg("empty_stream",8);return a})},Ig=function(a){var b=rg(a.b);x(a.j,function(){return"Starting offscreen tab capture with constraints "+JSON.stringify(b)});
return new Promise(function(c,d){chrome.tabCapture.captureOffscreenTab(a.b.f.toString(),b,function(b){b?(Kg(a,b),c(a)):d(Lg())})})},Kg=function(a,b){a.a=b;b.getTracks().forEach(function(b){b.onended=a.f.bind(a)})};Gg.prototype.stop=function(){this.a&&(this.a.getTracks().forEach(function(a){a.onended=null;a.stop()}),this.a=null,this.Tc&&this.Tc())};var Mg,Ng={to:0,Fm:1,Gm:2,Wm:3,Xm:4,tn:5,Mn:6,ro:7,Ho:8,Io:9,Cp:10,Zp:11,aq:12,jq:13,sq:14},Og=function(a){void 0==Mg&&(Cg("MediaRouter.Provider.WakeEvent",a,Ng),Mg=a)};var Rg=function(a){return Pg(a)||Qg(a)},Sg=function(a){if(!Ia(a,"http:")&&!Ia(a,"https:"))return!1;var b=document.createElement("a");b.href=a;return"http:"!=b.protocol&&"https:"!=b.protocol?!1:-1==b.hash.indexOf("__castAppId__")},Tg=["https://docs.google.com"],Pg=function(a){return Ia(a,"urn:x-org.chromium.media:source:tab:")||-1!=a.indexOf("0F5096E8")},Qg=function(a){return"urn:x-org.chromium.media:source:desktop"==a};var Ug=function(a){return(new Promise(function(b){chrome.tabs.get(a,b)})).then(function(b){if(!b)throw Error("No such tab "+a);return b})};var Vg=function(){},Zg=function(a){var b=Wg.get(a)||null;if(b)return Promise.resolve(b);b=Xg.get(a);b||(b=new Qc,Xg.set(a,b),Yg(a,b));return b.a},Yg=function(a,b){var c=$g.get(a)||null;if(!c)b.b(Error("No corresponding bundle for "+a));else if(!ah.has(c)){var d=bh.get(c);d||(x(ch,"Loading bundle "+c+" for module "+a),d=dh(c),bh.set(c,d));d.catch(function(a){b.b(a)})}},dh=function(a){var b=new Qc;b.a.then(function(){x(ch,"Bundle "+a+" loaded")},function(b){ch.error("Failed to load bundle "+a);throw b;
});var c=document.createElement("script");c.src=chrome.extension.getURL(a);c.setAttribute("type","text/javascript");c.async=!0;c.onload=function(){return b.resolve(void 0)};c.onerror=function(){b.b(Error("Failed to load bundle "+a))};document.head.appendChild(c);return b.a},eh=function(a,b){if(Wg.has(a))throw Error("Duplicate module "+a);Wg.set(a,b);(a=Xg.get(a))&&a.resolve(b)};Vg.prototype.handleEvent=function(a,b){for(var c=1;c<arguments.length;++c);throw Error("Not implemented");};
var $g=new Map([["mr.cast.ChannelService","background_script.js"],["mr.cast.SinkDiscoveryService","background_script.js"],["mr.mirror.cast.Service","mirroring_cast_streaming.js"],["mr.cloud.discovery.CloudSinkDiscoveryService","background_script.js"],["mr.dial.SinkDiscoveryService","background_script.js"],["mr.mirror.hangouts.HangoutsService","mirroring_hangouts.js"],["mr.mirror.hangouts.MeetingsService","mirroring_hangouts.js"],["mr.ProviderManager","background_script.js"],["mr.mirror.webrtc.WebRtcService",
"mirroring_webrtc.js"]]),ah=new Set(["background_script.js"]),ch=v("mr.Module"),Wg=new Map,Xg=new Map,bh=new Map;var fh=chrome.i18n.getMessage("545449835455981095");var gh=function(a,b){this.F=a;this.h=b||null;this.b=this.a=null;this.G=v("mr.mirror.Service."+a);this.v=n(this.K,this);this.g=!1};ka(gh,Vg);gh.prototype.Ga=function(a){this.g||(this.h=a,this.g=!0,this.ce())};gh.prototype.ce=function(){};gh.prototype.getName=function(){return this.F};
var lh=function(a,b,c,d,e,f){x(a.G,"Start mirroring on route "+b.id);return a.g?fg(hh(c,b.kb.tabId).then(function(){return ih(a)}).then(function(){var a=jh(c,d,e);return(new Gg(a)).start()}).then(function(c){if(a.b)throw c.stop(),new Fg("Cannot start multiple streams");a.b=c;c=a.l.bind(a);a.b.Tc=c;return f?f(b).a:b}).then(function(b){if(a.a)throw new Fg("Cannot start multiple sessions");if(!a.b)throw new Fg("Media stream ended before session could start.");a.a=a.be(d,b);return a.a.start(a.b.a)}).then(function(){Pg(c)&&
!chrome.tabs.onUpdated.hasListener(a.v)&&chrome.tabs.onUpdated.addListener(a.v);return a.u(b,c,d)}).then(null,function(b){kh(a,b);return a.l().then(function(){throw b;})})):eg(Error("Not initialized"))},hh=function(a,b){return Pg(a)?b?Ug(b).then(function(a){if(!a.active)throw new Fg("Tab to be mirrored is not active",7);}):Promise.reject(new Fg("BUG: Tab ID is required.")):Promise.resolve()};
gh.prototype.B=function(a,b,c,d,e){var f=this;if(!this.a)return Promise.reject(new Fg("No session to update streams on",7));if(!this.a.Wh())return Promise.reject(new Fg("Session does not support updating stream",7));var g=!1;return Promise.resolve().then(function(){var a=jh(b,c,d);return(new Gg(a)).start()}).then(function(b){f.b&&(f.b.Tc=null,f.b.stop(),f.Ed());f.b=b;b=f.l.bind(f);f.b.Tc=b;g=!0;return e?e(a).a:a}).then(function(a){if(!f.a)throw new Fg("Session ended while updating stream");if(!f.b)throw new Fg("Media stream ended before session could be updated.");
f.a.b=a;return f.a.Zh(f.b.a)}).then(this.u.bind(this,a,b,c)).then(null,function(a){kh(f,a);if(g)return f.l().then(function(){throw a;});throw a;})};
gh.prototype.u=function(a,b,c){var d=this;return new Promise(function(e,f){if(d.a)if(Pg(b))mh(d.a,a.kb.tabId).then(function(){nh(d.a);d.Ae();e(d.a.Ib())},function(a){d.G.error("Failed to obtain initial tab info.",a);f(a)});else{if(Sg(b)){var g="Capturing "+a.mediaSource;oh(d.a,g,g,null);nh(d.a);d.zf()}else oh(d.a,"Capturing Desktop","Capturing Desktop",null),nh(d.a),d.xe();ph(d,c,d.b);e(d.a.Ib())}else f(new Fg("Session gone before executing post-startup steps",7))})};
var kh=function(a,b){b.reason=null!=b.reason?b.reason:9;a.G.error("Failed to start mirroring: "+b.message+",  reason = "+b.reason+": "+b.stack);a.ze(b.reason)},ih=function(a){return a.g?a.l().then(function(b){b&&a.ye();return b}):Promise.reject("Not initialized")};
gh.prototype.l=function(){var a=this;chrome.tabs.onUpdated.removeListener(this.v);var b=this.b;this.b=null;b&&(b.Tc=null);var c=this.a;this.a=null;var d;c?d=this.Qe(c).catch(function(b){return a.G.error("Error in before-cleanup steps",b)}).then(function(){return c.stop()}).catch(function(b){return a.G.error("Error stopping session",b)}).then(function(){a.h.hf(c.Ib().id)}).catch(function(b){return a.G.error("Error in ended callbacks",b)}).then(function(){return!0}):d=Promise.resolve(!1);b&&(d=d.then(function(c){b.stop();
a.Ed();return c}));return d};gh.prototype.Qe=function(){return Promise.resolve()};gh.prototype.K=function(a,b,c){Og(14);this.a&&this.a.tabId&&this.a.tabId==a&&("complete"==b.status||b.favIconUrl&&"complete"==c.status)&&(this.a.ai(c),this.h.hh(this.a.Ib()),nh(this.a))};
var jh=function(a,b,c){if(Pg(a))return new mg("tab",b);if(Qg(a))return new mg("desktop",b);if(Sg(a)){if(!c)throw new Fg("Missing offscreen tab presentation id");return new mg("offscreen_tab",b,a,c)}throw new Fg("Source URN does not suggest a known capture type.");},ph=function(a,b,c){b.shouldCaptureAudio&&c.a&&!c.a.getAudioTracks().length&&a.h.Qc().send(new $f(fh,"notification","dismiss"))};h=gh.prototype;h.be=function(){};h.Ae=function(){};h.xe=function(){};h.zf=function(){};h.ye=function(){};
h.ze=function(){};h.Ed=function(){};h.gf=function(){return Promise.reject("Not implemented")};var qh=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/,rh=function(a,b){if(a){a=a.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),e,f=null;0<=d?(e=a[c].substring(0,d),f=a[c].substring(d+1)):e=a[c];b(e,f?decodeURIComponent(f.replace(/\+/g," ")):"")}}},sh=function(a,b,c){a=[a,"&",b];null!=c&&a.push("=",encodeURIComponent(String(c)));a[1]&&(c=a[0],b=c.indexOf("#"),0<=b&&(a.push(c.substr(b)),a[0]=c=c.substr(0,b)),b=
c.indexOf("?"),0>b?a[1]="?":b==c.length-1&&(a[1]=void 0));return a.join("")},th=/#|$/,uh=function(a,b){var c=a.search(th),d;a:{d=0;for(var e=b.length;0<=(d=a.indexOf(b,d))&&d<c;){var f=a.charCodeAt(d-1);if(38==f||63==f)if(f=a.charCodeAt(d+e),!f||61==f||38==f||35==f)break a;d+=e+1}d=-1}if(0>d)return null;e=a.indexOf("&",d);if(0>e||e>c)e=c;d+=b.length+1;return decodeURIComponent(a.substr(d,e-d).replace(/\+/g," "))},vh=function(a,b){var c=a.length-1;0<=c&&a.indexOf("/",c)==c&&(a=a.substr(0,a.length-
1));Ia(b,"/")&&(b=b.substr(1));return Va(a,"/",b)};var wh=function(a){this.b=a;this.o=!1;this.tabId=this.A=this.iconUrl=null},oh=function(a,b,c,d){a.b.description=b;a.o||a.b.offTheRecord?(a.A=null,a.iconUrl=null):(a.A=c,a.iconUrl=d)},nh=function(a){a.o||a.b.offTheRecord||a.Jh()},mh=function(a,b){a.tabId=b;return Ug(b).then(a.ai.bind(a))};h=wh.prototype;h.ai=function(a){this.o=a.incognito;var b=a.title,c;Ia(a.url,"file://")?c="Local content (Tab)":(c=a.url.match(qh)[3]||null,c=(c?decodeURI(c):c)+" (Tab)");oh(this,b,c,a.favIconUrl)};h.Ib=function(){return this.b};
h.start=function(){};h.Wh=function(){return!1};h.Zh=function(){};h.stop=function(){return Promise.resolve()};h.Jh=function(){};var Ah=function(){var a=this;this.maxWidth=1920;this.maxHeight=1080;this.minHeight=this.minWidth=180;this.senderSideLetterboxing=!1;this.minFrameRate=0;this.maxFrameRate=30;this.minVideoBitrate=300;this.maxVideoBitrate=5E3;this.audioBitrate=0;this.maxLatencyMillis=800;this.animatedLatencyMillis=this.minLatencyMillis=400;this.dscpEnabled=pc||rc||hg()||ig();this.enableLogging=!0;this.useTdls=!1;this.shouldCaptureAudio=this.shouldCaptureVideo=!0;var b=window.localStorage?window.localStorage.getItem(xh):
null;if(b)try{var c=JSON.parse(String(b));if(c instanceof Object)yh(this,c),w(v("mr.mirror.Settings"),function(){return"Initial mr.mirror.Settings overridden to: "+zh(a)});else throw Error("localStorage["+xh+"] does not parse as an Object: "+b);}catch(d){throw v("mr.mirror.Settings").error(xh+' must be of the form \'{"maxWidth":640, "maxHeight":360}\'.',d),Error("Overrides not parseable.  See ERROR log for details.");}};Ah.prototype.clone=function(){var a=new Ah;yh(a,this);return a};
var zh=function(a){return JSON.stringify(a,function(a,c){if(0==a.length||!a.endsWith("_"))return c})},yh=function(a,b){for(var c=ja(Object.keys(b)),d=c.next();!d.done;d=c.next())d=d.value,d.endsWith("_")||typeof b[d]!==typeof a[d]||(a[d]=b[d])},Bh=function(a){var b=screen.width,c=screen.height;a.maxHeight*b<a.maxWidth*c?(b=Math.min(a.maxWidth,b),b-=b%160,c=90*b/160):(c=Math.min(a.maxHeight,c),c-=c%90,b=160*c/90);if(b<Math.max(160,a.minWidth)||c<Math.max(90,a.minHeight))b=Math.max(160,a.minWidth),
c=Math.max(90,a.minHeight);a.maxWidth=b;a.maxHeight=c},xh="mr.mirror.Settings.Overrides";var Ch=function(a,b){this.type=a;this.data=b},Dh=function(a){a=JSON.parse(a);if(!a.type)throw Error("Invalid message");return new Ch(a.type,a.data)},Eh=function(a,b,c,d){this.description=a;this.settings=b||null;this.mediaConstraints=c||null;this.presentationUrl=d||null};var Hh=function(a,b){this.j=v("cv2.PeerConnection");this.F=Fh;this.a=Gh(this,b);this.l=this.a.createDataChannel(a,{reliable:!1});this.B=new Qc;this.w=!1;this.g=0;this.f=null;this.v=this.h=0;this.b=!1;this.o=this.u=this.m=this.A=this.H=pa},Ih=function(a,b){a.m=b},Jh=function(a,b){a.u=b},Kh=function(a,b){a.o=b},Lh=function(a,b){a.A=b},Mh=function(a,b){a.l.onmessage=function(a){b(a.data)}},Nh=function(a){var b={};b.iceServers=[{url:"stun:stun.l.google.com:19302"}].concat(a);return b},Gh=function(a,b){var c=
Nh(b);b=new webkitRTCPeerConnection(c);b.onicecandidate=n(a.aa,a);b.a=n(a.N,a);b.oniceconnectionstatechange=n(a.J,a);x(a.j,function(){return"Created webkitRTCPeerConnnection with config: "+JSON.stringify(c)});return b};Hh.prototype.start=function(){this.b||(this.b=!0,Oh(this))};Hh.prototype.stop=function(){x(this.j,"Stopping peer connection...");this.b&&(this.b=!1,"closed"!=this.a.signalingState&&this.a.close());this.a=null};
var Oh=function(a){x(a.j,"Sending offer to peer.");a.h=Date.now();a.a.createOffer(n(a.K,a),function(b){w(a.j,"Error creating offer.",b)},a.F);a.B.a.then(function(b){a.A(b)})};Hh.prototype.K=function(a){var b=this;x(this.j,function(){return"Setting local description: "+JSON.stringify(a)});this.a.setLocalDescription(a,function(){x(b.j,"Local description set successfully")},function(a){w(b.j,"Error setting local description.",a)})};
var Ph=function(a,b){z(a.j,function(){return"<===: "+JSON.stringify(b)});var c=new RTCSessionDescription(b);x(a.j,function(){return"Setting remote description: "+JSON.stringify(c)});a.a.setRemoteDescription(c,function(){x(a.j,"Remote description set successfully.")},function(b){w(a.j,"Error setting remote description.",b)})};
Hh.prototype.aa=function(a){var b=this;a.candidate?(this.g++,this.v=Date.now(),1==this.g?this.f=we(function(){x(b.j,"ICE candidate gathering timed out.");b.f=null;Qh(b)},5E3):this.w&&w(this.j,"Received ICE candidate after resolving session description.")):(x(this.j,"End of ICE candidates."),ug("MediaRouter.WebRtc.IceCandidateGathering.Duration.Reported",Date.now()-this.h),Qh(this),0<this.g&&ug("MediaRouter.WebRtc.IceCandidateGathering.Duration.Real",this.v-this.h))};
Hh.prototype.N=function(){"completed"==this.a.iceGatheringState&&Qh(this)};var Qh=function(a){xe(a.f);a.f=null;if(!a.w){x(a.j,"Resolving sesion description after gathering "+a.g+" ICE candidates.");var b=a.a.localDescription;a.B.resolve({type:b.type,sdp:b.sdp});a.w=!0}};
Hh.prototype.J=function(a){var b=this;if(this.a){var c=this.a.iceConnectionState;x(this.j,"New ICE connection state: "+c+".");"connected"==c?this.m("iceconnected"):"completed"==c?this.m("icecompleted"):"failed"==c?(w(this.j,function(){return"Ice connection failed: "+JSON.stringify(a)}),this.u("icefailed")):"closed"==c?this.o("iceclosed"):"disconnected"==c&&(w(this.j,"Ice connection state is bad."),this.b?(x(this.j,"Restarting ICE."),this.a.createOffer(n(this.K,this),function(a){w(b.j,"Error creating new offer.",
a)},Rh)):this.H())}};var Fh={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}},Rh={mandatory:{IceRestart:!0,OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}};pa.a=window.localStorage;
var Sh=0,Uh=function(a){return(a=window.localStorage.getItem(Th(a,!1)))?JSON.parse(a):null},Vh=function(a){return(a=window.localStorage.getItem(Th(a,!0)))?JSON.parse(a):null},Xh=function(a){if(Wh.has(a.ea()))throw Error("Duplicate instance name "+a.ea());Wh.set(a.ea(),a);a.ua()},ci=function(a){for(var b=0,c=ja(Object.keys(pa.a)),d=c.next();!d.done;d=c.next()){var d=d.value,e=d.length+window.localStorage.getItem(d).length;d.startsWith("mr.")?Sh+=e:b+=e}Yh=a;(window.localStorage.getItem("version")&&window.localStorage.getItem("version")!==
chrome.runtime.getManifest().version||Zh(a))&&$h();x(ai,"initialize: "+Sh+" chars used, "+b+" other chars");chrome.runtime.onSuspend.addListener(bi)},Yh=null,ai=v("mr.PersistentDataManager"),Wh=new Map,Th=function(a,b){return"mr."+(b?"persistent.":"temp.")+a.ea()},Zh=function(a){return!!window.localStorage.getItem("mrInstanceId")&&window.localStorage.getItem("mrInstanceId")!==a},bi=function(){x(ai,"onSuspend");di("version",chrome.runtime.getManifest().version);Yh&&di("mrInstanceId",Yh);Wh.forEach(ei)},
ei=function(a){var b=a.pa();b&&void 0!=b[0]&&di(Th(a,!1),JSON.stringify(b[0]));b&&void 0!=b[1]&&di(Th(a,!0),JSON.stringify(b[1]))},di=function(a,b){var c;c=window.localStorage.getItem(a);c=null!=c?b.length-c.length:a.length+b.length;52E5<Sh+c&&(w(ai,"Unable to write "+c+" chars"),$h());if(52E5<Sh+c)throw ai.error("Unable to write "+c+" chars after clearing temporary"),Error("Setting the value of '"+a+"' would exceed the quota, according to accounting.");try{window.localStorage.setItem(a,b)}catch(d){throw Error("Setting the value of '"+
a+"' would exceed the quota, according to the browser.");}Sh+=c},fi=function(a){a=0==a.size%2?new Blob([a,new Uint8Array([0,0])]):new Blob([a,new Uint8Array([1])]);return new Promise(function(b,c){var d=new FileReader;d.onloadend=function(){if(d.error)c(d.error);else try{for(var a=d.result,f=[],g=0,m=a.byteLength;g<m;g+=8192)f.push(String.fromCharCode.apply(null,new Uint16Array(a,g,Math.min(m-g,8192)/2)));di("mr.temp.mirror.cast.Service.eventsBlob",f.join(""));b()}catch(q){c(q)}};d.readAsArrayBuffer(a)})},
$h=function(){for(var a=ja(Object.keys(pa.a)),b=a.next();!b.done;b=a.next())b=b.value,b.startsWith("mr.temp.")&&(Sh-=b.length+window.localStorage.getItem(b).length,delete window.localStorage[b]);x(ai,"removeTemporary_: "+Sh+" chars used")};var gi="StopIteration"in na?na.StopIteration:{message:"StopIteration",stack:""},hi=function(){};hi.prototype.next=function(){throw gi;};hi.prototype.Na=function(){return this};
var ii=function(a){if(a instanceof hi)return a;if("function"==typeof a.Na)return a.Na(!1);if(ua(a)){var b=0,c=new hi;c.next=function(){for(;;){if(b>=a.length)throw gi;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");},ji=function(a,b,c){if(ua(a))try{t(a,b,c)}catch(d){if(d!==gi)throw d;}else{a=ii(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(d){if(d!==gi)throw d;}}},ki=function(a,b){a=ii(a);try{for(;!b.call(void 0,a.next(),void 0,a););}catch(c){if(c!==gi)throw c;}},li=function(a){if(ua(a))return u(a);
a=ii(a);var b=[];ji(a,function(a){b.push(a)});return b};var C=function(a,b){this.b={};this.a=[];this.g=this.f=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&&mi(this,a)};h=C.prototype;h.fa=function(){return this.f};h.P=function(){ni(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};h.La=function(){ni(this);return this.a.concat()};h.Ra=function(a){return oi(this.b,a)};
h.jd=function(a){for(var b=0;b<this.a.length;b++){var c=this.a[b];if(oi(this.b,c)&&this.b[c]==a)return!0}return!1};h.equals=function(a,b){if(this===a)return!0;if(this.f!=a.fa())return!1;b=b||pi;ni(this);for(var c,d=0;c=this.a[d];d++)if(!b(this.get(c),a.get(c)))return!1;return!0};var pi=function(a,b){return a===b};C.prototype.jb=function(){return 0==this.f};C.prototype.clear=function(){this.b={};this.g=this.f=this.a.length=0};
C.prototype.remove=function(a){return oi(this.b,a)?(delete this.b[a],this.f--,this.g++,this.a.length>2*this.f&&ni(this),!0):!1};var ni=function(a){if(a.f!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];oi(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.f!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],oi(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}};C.prototype.get=function(a,b){return oi(this.b,a)?this.b[a]:b};
C.prototype.set=function(a,b){oi(this.b,a)||(this.f++,this.a.push(a),this.g++);this.b[a]=b};var mi=function(a,b){var c;b instanceof C?(c=b.La(),b=b.P()):(c=Qb(b),b=Pb(b));for(var d=0;d<c.length;d++)a.set(c[d],b[d])};C.prototype.forEach=function(a,b){for(var c=this.La(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};C.prototype.clone=function(){return new C(this)};var qi=function(a){ni(a);for(var b={},c=0;c<a.a.length;c++){var d=a.a[c];b[d]=a.b[d]}return b};
C.prototype.Na=function(a){ni(this);var b=0,c=this.g,d=this,e=new hi;e.next=function(){if(c!=d.g)throw Error("The map has changed since the iterator was created");if(b>=d.a.length)throw gi;var e=d.a[b++];return a?e:d.b[e]};return e};var oi=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var ri=function(a){return a.fa&&"function"==typeof a.fa?a.fa():ua(a)||va(a)?a.length:Ob(a)},si=function(a){if(a.P&&"function"==typeof a.P)return a.P();if(va(a))return a.split("");if(ua(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Pb(a)},ti=function(a){if(a.La&&"function"==typeof a.La)return a.La();if(!a.P||"function"!=typeof a.P){if(ua(a)||va(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return Qb(a)}},ui=function(a){return a.jb&&"function"==typeof a.jb?a.jb():
ua(a)||va(a)?nb(a):Tb(a)},vi=function(a,b,c){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,c);else if(ua(a)||va(a))t(a,b,c);else for(var d=ti(a),e=si(a),f=e.length,g=0;g<f;g++)b.call(c,e[g],d&&d[g],a)},wi=function(a,b,c){if("function"==typeof a.map)return a.map(b,c);if(ua(a)||va(a))return fb(a,b,c);var d,e=ti(a),f=si(a),g=f.length;if(e){d={};for(var m=0;m<g;m++)d[e[m]]=b.call(c,f[m],e[m],a)}else for(d=[],m=0;m<g;m++)d[m]=b.call(c,f[m],void 0,a);return d},xi=function(a,b){if("function"==typeof a.every)return a.every(b,
void 0);if(ua(a)||va(a))return ib(a,b,void 0);for(var c=ti(a),d=si(a),e=d.length,f=0;f<e;f++)if(!b.call(void 0,d[f],c&&c[f],a))return!1;return!0};var zi=function(a){this.a=new C;a&&yi(this,a)},Ai=function(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[za]||(a[za]=++Ba)):b.substr(0,1)+a};zi.prototype.fa=function(){return this.a.fa()};zi.prototype.add=function(a){this.a.set(Ai(a),a)};var yi=function(a,b){b=si(b);for(var c=b.length,d=0;d<c;d++)a.add(b[d])};h=zi.prototype;h.removeAll=function(a){a=si(a);for(var b=a.length,c=0;c<b;c++)this.remove(a[c])};h.remove=function(a){return this.a.remove(Ai(a))};h.clear=function(){this.a.clear()};
h.jb=function(){return this.a.jb()};h.contains=function(a){return this.a.Ra(Ai(a))};h.P=function(){return this.a.P()};h.clone=function(){return new zi(this)};h.equals=function(a){return this.fa()==ri(a)&&Bi(this,a)};var Bi=function(a,b){var c=ri(b);if(a.fa()>c)return!1;!(b instanceof zi)&&5<c&&(b=new zi(b));return xi(a,function(a){var c=b;return c.contains&&"function"==typeof c.contains?c.contains(a):c.jd&&"function"==typeof c.jd?c.jd(a):ua(c)||va(c)?mb(c,a):Rb(c,a)})};zi.prototype.Na=function(){return this.a.Na(!1)};var Ci=function(a){if("undefined"==typeof a)return"undefined";if(null==a)return"NULL";var b=[],c;for(c in a)if(!xa(a[c])){var d=c+" = ";try{d+=a[c]}catch(e){d+="*** "+e+" ***"}b.push(d)}return b.join("\n")},Di=function(a){var b=[],c=[],d={},e=function(a,g){var f=g+"  ";try{if(k(a))if(null===a)b.push("NULL");else if(va(a))b.push('"'+a.replace(/\n/g,"\n"+g)+'"');else if(xa(a))b.push(String(a).replace(/\n/g,"\n"+g));else if(ya(a)){a[za]||c.push(a);var q=a[za]||(a[za]=++Ba);if(d[q])b.push("*** reference loop detected (id="+
q+") ***");else{d[q]=!0;b.push("{");for(var y in a)xa(a[y])||(b.push("\n"),b.push(f),b.push(y+" = "),e(a[y],f));b.push("\n"+g+"}");delete d[q]}}else b.push(a);else b.push("undefined")}catch(D){b.push("*** "+D+" ***")}};e(a,"");for(a=0;a<c.length;a++)Aa(c[a]);return b.join("")},Ei=function(a){var b;b=Ei;var c=Error();if(Error.captureStackTrace)Error.captureStackTrace(c,b),b=String(c.stack);else{try{throw c;}catch(e){c=e}b=(b=c.stack)?String(b):null}if(b)return b;b=[];for(var c=arguments.callee.caller,
d=0;c&&(!a||d<a);){b.push(Fi(c));b.push("()\n");try{c=c.caller}catch(e){b.push("[exception trying to get caller]\n");break}d++;if(50<=d){b.push("[...long stack...]");break}}a&&d>=a?b.push("[...reached max depth limit...]"):b.push("[end]");return b.join("")},Fi=function(a){if(Gi[a])return Gi[a];a=String(a);if(!Gi[a]){var b=/function ([^\(]+)/.exec(a);Gi[a]=b?b[1]:"[Anonymous]"}return Gi[a]},Gi={};var Hi=function(a,b,c,d,e){this.reset(a,b,c,d,e)};Hi.prototype.a=null;var Ii=0;Hi.prototype.reset=function(a,b,c,d,e){"number"==typeof e||Ii++;this.l=d||Fa();this.b=a;this.g=b;this.f=c;delete this.a};Hi.prototype.getMessage=function(){return this.g};var Ji=function(a){this.l=a;this.a=this.g=this.b=this.f=null},Ki=function(a,b){this.name=a;this.value=b};Ki.prototype.toString=function(){return this.name};var Li=new Ki("SEVERE",1E3),Mi=new Ki("WARNING",900),Ni=new Ki("INFO",800),Oi=new Ki("CONFIG",700),Pi=new Ki("FINE",500),Qi=new Ki("FINER",400),Ri=new Ki("ALL",0);Ji.prototype.getName=function(){return this.l};Ji.prototype.getChildren=function(){this.g||(this.g={});return this.g};
var Si=function(a){if(a.b)return a.b;if(a.f)return Si(a.f);ab("Root logger has no level set.");return null};Ji.prototype.log=function(a,b,c){a.value>=Si(this).value&&(xa(b)&&(b=b()),a=new Hi(a,String(b),this.l),c&&(a.a=c),Ti(this,a))};Ji.prototype.config=function(a,b){this.log(Oi,a,b)};Ji.prototype.logRecord=function(a){a.b.value>=Si(this).value&&Ti(this,a)};
var Ti=function(a,b){var c="log:"+b.getMessage();na.console&&(na.console.timeStamp?na.console.timeStamp(c):na.console.markTimeline&&na.console.markTimeline(c));for(na.msWriteProfilerMark&&na.msWriteProfilerMark(c);a;){var d=a,e=b;if(d.a)for(var f=0;c=d.a[f];f++)c(e);a=a.f}},Ui={},Vi=null,Wi=function(){Vi||(Vi=new Ji(""),Ui[""]=Vi,Vi.b=Oi)},Xi=function(a){Wi();var b;if(!(b=Ui[a])){b=new Ji(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Xi(a.substr(0,c));c.getChildren()[d]=b;b.f=c;Ui[a]=b}return b};var Yi=na.JSON.parse,Zi=na.JSON.stringify;var $i=function(a,b,c){a&&a.log(b,c,void 0)},aj=function(a,b,c){a&&a.log(Li,b,c)},E=function(a,b,c){a&&a.log(Mi,b,c)},F=function(a,b){a&&a.log(Ni,b,void 0)},bj=function(a,b){a&&a.log(Pi,b,void 0)};var cj=function(){};cj.prototype.a=null;var ej=function(a){var b;(b=a.a)||(b={},dj(a)&&(b[0]=!0,b[1]=!0),b=a.a=b);return b};var fj,gj=function(){};r(gj,cj);var hj=function(a){return(a=dj(a))?new ActiveXObject(a):new XMLHttpRequest},dj=function(a){if(!a.b&&"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.b=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.b};fj=new gj;var ij=function(a){B.call(this);this.headers=new C;this.H=a||null;this.b=!1;this.F=this.a=null;this.m=this.Z=this.A="";this.f=this.N=this.u=this.J=!1;this.g=0;this.o=null;this.h="";this.B=this.V=!1};r(ij,B);ij.prototype.j=Xi("goog.net.XhrIo");var jj=/^https?$/i,kj=["POST","PUT"],lj=[],mj=function(a,b,c,d,e){var f=new ij;lj.push(f);b&&f.listen("complete",b);Nd(f,"ready",f.ja);e&&(f.g=Math.max(0,e));f.send(a,"POST",c,d);return f};ij.prototype.ja=function(){this.Ba();tb(lj,this)};
ij.prototype.send=function(a,b,c,d){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.A+"; newUri="+a);b=b?b.toUpperCase():"GET";this.A=a;this.m="";this.Z=b;this.J=!1;this.b=!0;this.a=this.H?hj(this.H):hj(fj);this.F=this.H?ej(this.H):ej(fj);this.a.onreadystatechange=n(this.ba,this);try{bj(this.j,nj(this,"Opening Xhr")),this.N=!0,this.a.open(b,String(a),!0),this.N=!1}catch(f){bj(this.j,nj(this,"Error opening Xhr: "+f.message));oj(this,f);return}a=c||"";var e=this.headers.clone();
d&&vi(d,function(a,b){e.set(b,a)});d=kb(e.La(),pj);c=na.FormData&&a instanceof na.FormData;!mb(kj,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(a,b){this.a.setRequestHeader(b,a)},this);this.h&&(this.a.responseType=this.h);"withCredentials"in this.a&&this.a.withCredentials!==this.V&&(this.a.withCredentials=this.V);try{qj(this),0<this.g&&(this.B=rj(this.a),bj(this.j,nj(this,"Will abort after "+this.g+"ms if incomplete, xhr2 "+this.B)),this.B?(this.a.timeout=
this.g,this.a.ontimeout=n(this.ha,this)):this.o=we(this.ha,this.g,this)),bj(this.j,nj(this,"Sending request")),this.u=!0,this.a.send(a),this.u=!1}catch(f){bj(this.j,nj(this,"Send error: "+f.message)),oj(this,f)}};var rj=function(a){return ic&&Cc(9)&&l(a.timeout)&&k(a.ontimeout)},pj=function(a){return Ja("Content-Type",a)};ij.prototype.ha=function(){"undefined"!=typeof ma&&this.a&&(this.m="Timed out after "+this.g+"ms, aborting",bj(this.j,nj(this,this.m)),this.dispatchEvent("timeout"),this.abort(8))};
var oj=function(a,b){a.b=!1;a.a&&(a.f=!0,a.a.abort(),a.f=!1);a.m=b;sj(a);tj(a)},sj=function(a){a.J||(a.J=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};ij.prototype.abort=function(){this.a&&this.b&&(bj(this.j,nj(this,"Aborting")),this.b=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),tj(this))};ij.prototype.X=function(){this.a&&(this.b&&(this.b=!1,this.f=!0,this.a.abort(),this.f=!1),tj(this,!0));ij.W.X.call(this)};
ij.prototype.ba=function(){this.w||(this.N||this.u||this.f?uj(this):this.ia())};ij.prototype.ia=function(){uj(this)};
var uj=function(a){if(a.b&&"undefined"!=typeof ma)if(a.F[1]&&4==vj(a)&&2==a.Aa())bj(a.j,nj(a,"Local request error detected and ignored"));else if(a.u&&4==vj(a))we(a.ba,0,a);else if(a.dispatchEvent("readystatechange"),4==vj(a)){bj(a.j,nj(a,"Request complete"));a.b=!1;try{if(wj(a))a.dispatchEvent("complete"),a.dispatchEvent("success");else{var b;try{b=2<vj(a)?a.a.statusText:""}catch(c){bj(a.j,"Can not get status: "+c.message),b=""}a.m=b+" ["+a.Aa()+"]";sj(a)}}finally{tj(a)}}},tj=function(a,b){if(a.a){qj(a);
var c=a.a,d=a.F[0]?pa:null;a.a=null;a.F=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){aj(a.j,"Problem encountered resetting onreadystatechange: "+e.message)}}},qj=function(a){a.a&&a.B&&(a.a.ontimeout=null);l(a.o)&&(xe(a.o),a.o=null)},wj=function(a){var b=a.Aa(),c;a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break a;default:c=!1}if(!c){if(b=0===b)a=String(a.A).match(qh)[1]||null,!a&&na.self&&na.self.location&&(a=na.self.location.protocol,a=
a.substr(0,a.length-1)),b=!jj.test(a?a.toLowerCase():"");c=b}return c},vj=function(a){return a.a?a.a.readyState:0};ij.prototype.Aa=function(){try{return 2<vj(this)?this.a.status:-1}catch(a){return-1}};
var xj=function(a){try{return a.a?a.a.responseText:""}catch(b){return bj(a.j,"Can not get responseText: "+b.message),""}},yj=function(a){if(a.a)return Yi(a.a.responseText)},zj=function(a){try{if(!a.a)return null;if("response"in a.a)return a.a.response;switch(a.h){case "":case "text":return a.a.responseText;case "arraybuffer":if("mozResponseArrayBuffer"in a.a)return a.a.mozResponseArrayBuffer}aj(a.j,"Response type "+a.h+" is not supported on this browser");return null}catch(b){return bj(a.j,"Can not get response: "+
b.message),null}};ij.prototype.getResponseHeader=function(a){if(this.a&&4==vj(this))return a=this.a.getResponseHeader(a),null===a?void 0:a};var Aj=function(a){var b={};a=(a.a&&4==vj(a)?a.a.getAllResponseHeaders():"").split("\r\n");for(var c=0;c<a.length;c++)if(!La(a[c])){var d=Za(a[c],": ",2);b[d[0]]=b[d[0]]?b[d[0]]+(", "+d[1]):d[1]}return b},nj=function(a,b){return b+" ["+a.Z+" "+a.A+" "+a.Aa()+"]"};var Bj=function(){},Cj=function(a){if(!Ia(a,"urn:x-org.chromium:media:route:"))return null;var b=a.substring(31);if(!b)return null;b=Za(b,"/",2);if(3!=b.length)return null;var c=Za(b[1],"-",1);if(2!=c.length)return null;var d=new Bj;d.g=a;d.a=b[0];d.f=c[0];d.l=c[1];d.b=b[2];return d};Bj.prototype.Y=function(){return this.b};var Dj=function(a,b,c,d,e,f){this.id=a;this.sinkId=b;this.mediaSource=c;this.isLocal=d;this.description=e;this.iconUrl=f;this.allowStop=!0;this.customControllerPath=null;this.forDisplay=!0;this.offTheRecord=!1;this.Bc=d;this.isOffscreenPresentation=!1},Ej=function(a,b,c,d,e,f,g){return new Dj("urn:x-org.chromium:media:route:"+a+"/"+b+"-"+c+"/"+d,c,d,e,f,g)};var Fj=function(a){this.b=a;this.a=1E3*Math.floor(1E6*Math.random())},Gj=function(a){var b=a.a++;0==b&&(b=a.a++);return b};Fj.prototype.ea=function(){return"IdGenerator."+this.b};Fj.prototype.pa=function(){return[this.a]};Fj.prototype.ua=function(){var a=Uh(this);a&&(this.a=a)};window.navigator.userAgent.match(/Chrome\/([0-9]+)/);var Hj=function(a,b){this.type=a;this.entryPoint=b};p("castApp.frontEnd.ExtensionMessage",Hj);var Ij=function(a){return"urn:x-cast:com.google.cast."+a},Jj=Ij("tp.connection"),Kj=Ij("receiver"),Lj=Ij("remoting"),Mj=Ij("media"),Nj=Ij("webrtc"),Oj=Ij("broadcast"),Pj=Zb({vq:Jj,wq:Ij("tp.heartbeat"),Gp:Kj,Kp:Lj,so:Mj,vo:Ij("media.universalRemote.optIn"),Pq:Nj,rm:Oj});var Qj=function(a){return"available"==a||"available_rescan"==a};var Rj=function(a,b,c,d,e){this.id=a;this.friendlyName=b;this.iconType=void 0===c?"generic":c;this.description=void 0===d?null:d;this.domain=void 0===e?null:e};var Sj=function(){var a=window.crypto.getRandomValues(new Uint8Array(16));return fb(a,function(a){a=a.toString(16);return 1<a.length?a:"0"+a}).join("")},Tj=function(a){for(var b=[],c=0,d=0;d<a.length;d++){var e=a.charCodeAt(d);128>e?b[c++]=e:(2048>e?b[c++]=e>>6|192:(55296==(e&64512)&&d+1<a.length&&56320==(a.charCodeAt(d+1)&64512)?(e=65536+((e&1023)<<10)+(a.charCodeAt(++d)&1023),b[c++]=e>>18|240,b[c++]=e>>12&63|128):b[c++]=e>>12|224,b[c++]=e>>6&63|128),b[c++]=e&63|128)}return b},Uj=function(a){for(var b=
[],c=0,d=0;c<a.length;){var e=a[c++];if(128>e)b[d++]=String.fromCharCode(e);else if(191<e&&224>e){var f=a[c++];b[d++]=String.fromCharCode((e&31)<<6|f&63)}else if(239<e&&365>e){var f=a[c++],g=a[c++],m=a[c++],e=((e&7)<<18|(f&63)<<12|(g&63)<<6|m&63)-65536;b[d++]=String.fromCharCode(55296+(e>>10));b[d++]=String.fromCharCode(56320+(e&1023))}else f=a[c++],g=a[c++],b[d++]=String.fromCharCode((e&15)<<12|(f&63)<<6|g&63)}return b.join("")};var Vj=Lb("Firefox"),Wj=cc()||Lb("iPod"),Xj=Lb("iPad"),Yj=Lb("Android")&&!(bc()||Lb("Firefox")||Lb("Opera")||Lb("Silk")),Zj=bc(),ak=Lb("Safari")&&!(bc()||Lb("Coast")||Lb("Opera")||Lb("Edge")||Lb("Silk")||Lb("Android"))&&!(cc()||Lb("iPad")||Lb("iPod"));var bk=null,ck=null,dk=null,ek=kc||lc&&!ak||hc||!ak&&!ic&&"function"==typeof na.atob,gk=function(a,b){fk();b=b?dk:bk;for(var c=[],d=0;d<a.length;d+=3){var e=a[d],f=d+1<a.length,g=f?a[d+1]:0,m=d+2<a.length,q=m?a[d+2]:0,y=e>>2,e=(e&3)<<4|g>>4,g=(g&15)<<2|q>>6,q=q&63;m||(q=64,f||(g=64));c.push(b[y],b[e],b[g],b[q])}return c.join("")},ik=function(a){if(ek)return na.atob(a);var b="";hk(a,function(a){b+=String.fromCharCode(a)});return b},jk=function(a){var b=new Uint8Array(Math.ceil(3*a.length/4)),c=0;hk(a,
function(a){b[c++]=a});return b.subarray(0,c)},hk=function(a,b){function c(b){for(;d<a.length;){var c=a.charAt(d++),e=ck[c];if(null!=e)return e;if(!La(c))throw Error("Unknown base64 encoding at char: "+c);}return b}fk();for(var d=0;;){var e=c(-1),f=c(0),g=c(64),m=c(64);if(64===m&&-1===e)break;b(e<<2|f>>4);64!=g&&(b(f<<4&240|g>>2),64!=m&&b(g<<6&192|m))}},fk=function(){if(!bk){bk={};ck={};dk={};for(var a=0;65>a;a++)bk[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a),
ck[bk[a]]=a,dk[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a),62<=a&&(ck["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a)]=a)}};var kk=function(){this.b=-1};var lk=function(){this.b=64;this.a=[];this.h=[];this.m=[];this.g=[];this.g[0]=128;for(var a=1;a<this.b;++a)this.g[a]=0;this.l=this.f=0;this.reset()};r(lk,kk);lk.prototype.reset=function(){this.a[0]=1732584193;this.a[1]=4023233417;this.a[2]=2562383102;this.a[3]=271733878;this.a[4]=3285377520;this.l=this.f=0};
var mk=function(a,b,c){c||(c=0);var d=a.m;if(va(b))for(var e=0;16>e;e++)d[e]=b.charCodeAt(c)<<24|b.charCodeAt(c+1)<<16|b.charCodeAt(c+2)<<8|b.charCodeAt(c+3),c+=4;else for(e=0;16>e;e++)d[e]=b[c]<<24|b[c+1]<<16|b[c+2]<<8|b[c+3],c+=4;for(e=16;80>e;e++){var f=d[e-3]^d[e-8]^d[e-14]^d[e-16];d[e]=(f<<1|f>>>31)&4294967295}b=a.a[0];c=a.a[1];for(var g=a.a[2],m=a.a[3],q=a.a[4],y,e=0;80>e;e++)40>e?20>e?(f=m^c&(g^m),y=1518500249):(f=c^g^m,y=1859775393):60>e?(f=c&g|m&(c|g),y=2400959708):(f=c^g^m,y=3395469782),
f=(b<<5|b>>>27)+f+q+y+d[e]&4294967295,q=m,m=g,g=(c<<30|c>>>2)&4294967295,c=b,b=f;a.a[0]=a.a[0]+b&4294967295;a.a[1]=a.a[1]+c&4294967295;a.a[2]=a.a[2]+g&4294967295;a.a[3]=a.a[3]+m&4294967295;a.a[4]=a.a[4]+q&4294967295};
lk.prototype.update=function(a,b){if(null!=a){k(b)||(b=a.length);for(var c=b-this.b,d=0,e=this.h,f=this.f;d<b;){if(0==f)for(;d<=c;)mk(this,a,d),d+=this.b;if(va(a))for(;d<b;){if(e[f]=a.charCodeAt(d),++f,++d,f==this.b){mk(this,e);f=0;break}}else for(;d<b;)if(e[f]=a[d],++f,++d,f==this.b){mk(this,e);f=0;break}}this.f=f;this.l+=b}};
lk.prototype.digest=function(){var a=[],b=8*this.l;56>this.f?this.update(this.g,56-this.f):this.update(this.g,this.b-(this.f-56));for(var c=this.b-1;56<=c;c--)this.h[c]=b&255,b/=256;mk(this,this.h);for(c=b=0;5>c;c++)for(var d=24;0<=d;d-=8)a[b]=this.a[c]>>d&255,++b;return a};var ok=function(){this.h=Wa();this.b=new nk(null,null);this.a=new nk(null,null);this.l=[];this.g=this.f=0;Xh(this)},pk=function(a,b){b=b.toLowerCase();var c=new lk;c.update(b);c.update(a.h);return"r"+gk(c.digest(),!0)},qk=function(){var a=ok.S();return a.b.model?a.b:a.a.model?a.a:new nk(null,null)};ok.prototype.ea=function(){return"SinkUtils"};
ok.prototype.pa=function(){return[{recentLaunchedDevice:this.b,recentDiscoveredDevice:this.a},{receiverIdToken:this.h,fixedIpList:this.l.join(","),castControlPort:this.f,lastCloudSinkCheckTimeMillis:this.g}]};
ok.prototype.ua=function(){var a=Uh(this);a&&(this.b=a.recentLaunchedDevice||new nk(null,null),this.a=a.recentDiscoveredDevice||new nk(null,null));if(a=Vh(this))this.h=a.receiverIdToken||Wa(),this.l=a.fixedIpList&&a.fixedIpList.split(",")||[],this.f=a.castControlPort||0,this.g=a.lastCloudSinkCheckTimeMillis||0};qa(ok);var nk=function(a,b){this.model=a;this.ip=b};var rk=function(a,b){this.gb=this.Fb=this.Pb=this.ya=this.fb=null;this.Za=new Rj(pk(ok.S(),b),a);this.eb={};this.Vd={};this.Xb=!1};rk.prototype.getId=function(){return this.Za.id};rk.prototype.update=function(a){if(this.getId()!=a.getId())return!1;var b=!1;this.Za.friendlyName!=a.Za.friendlyName&&(this.Za.friendlyName=a.Za.friendlyName,b=!0);this.Pb!=a.Pb&&(this.Pb=a.Pb,b=!0);this.Fb!=a.Fb&&(this.Fb=a.Fb,b=!0);this.fb!=a.fb&&(this.fb=a.fb,b=!0);this.ya!=a.ya&&(this.ya=a.ya,b=!0);return b};
rk.prototype.Ea=function(){return this.fb};rk.prototype.ta=function(){return this.ya};var sk=function(a,b){return a.eb[b]||"unknown"},tk=function(a){var b=new rk(a.Za.friendlyName,"");b.Za.id=a.Za.id;b.fb=a.fb;b.ya=a.ya;b.Pb=a.Pb;b.Fb=a.Fb;b.gb=a.gb;b.eb=a.eb;b.Vd=a.Vd;b.Xb=a.Xb;return b};var vk=function(a,b,c,d,e,f){a=pk(ok.S(),a);this.b=new Rj(a,b,uk(d));this.gb=c||null;this.a=d||null;this.fb=e||null;this.ya=f||null;this.eb={};this.Rb=!1},wk=function(a){if(!a.gb||!a.Ea())return null;var b=new vk(a.Za.id,a.Za.friendlyName,a.gb,void 0,a.Ea(),ok.S().f||8009);b.b.id=a.Za.id;b.Rb=!0;return b};
vk.prototype.update=function(a,b,c,d){var e=!1;this.b.friendlyName!=a&&(this.b.friendlyName=a,e=!0);null!=b&&this.fb!=b&&(this.fb=b,e=!0);null!=c&&this.ya!=c&&(this.ya=c,e=!0);null!=d&&this.a!=d&&(this.a=d,e=!0);return e};var uk=function(a){return a&1?"cast":a&32?"cast_audio_group":"cast_audio"};vk.prototype.getId=function(){return this.b.id};
var xk=function(a){var b=new vk("",a.friendlyName,a.modelName,a.capabilities,a.ip,a.port);b.b.id=a.id;b.Rb=a.discoveredByDial;b.eb=a.appStatusMap;for(var c in b.eb)"unavailable"==b.eb[c]&&(b.eb[c]="unavailable_rescan");return b};vk.prototype.Ea=function(){return this.fb};vk.prototype.ta=function(){return this.ya};var yk=function(a,b){return a.eb[b]||"unknown"};var zk={ko:0,Zn:1},Ak={Kq:0,Xi:1,Hp:2},Bk={DIAL:0,po:1,qo:2,Vm:3},Ck={Wo:0,TIMEOUT:1,FAILED:2},Dk={jg:0,im:1,Nm:2,un:3,Hm:4,Go:5,Pm:6,up:7},Ek={pi:0,SUCCESS:1},Fk=function(a){Cg("MediaRouter.Cast.Session.Ended",a,Ak)},Gk=function(a){Cg("MediaRouter.Cast.Channel.ConnectResult",a,Ek)},Hk=function(a){Cg("MediaRouter.Cast.Discovery.Type",a,Bk)},Ik=function(a){Cg("MediaRouter.Cast.Session.Fail",a,Ck)};var Jk=function(a,b,c,d,e){for(var f=[],g=4;g<arguments.length;++g)f[g-4]=arguments[g];var m=this;this.l=a;this.m=b;this.h=c;this.b=d;this.g=f;this.a=!1;this.f=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];return m.Mj.apply(m,[].concat(la(b)))}};h=Jk.prototype;h.addListener=function(){this.a||(this.a=!0,this.b.addListener.apply(this.b,[].concat([this.f],la(this.g))))};h.removeListener=function(){this.a&&(this.b.removeListener(this.f),this.a=!1)};
h.De=function(a){for(var b=0;b<arguments.length;++b);return!0};h.Mj=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];var d=this;Og(this.l);if(!this.De.apply(this,[].concat(la(b))))return!1;Zg(this.h).then(function(a){return a.handleEvent.apply(a,[].concat([d.b],la(b)))});return this.Te()};h.ea=function(){return"mr.EventListener."+this.m};h.pa=function(){return[this.a]};h.ua=function(){Uh(this)&&this.addListener()};h.Te=function(){};var Kk={serviceType:"_googlecast._tcp.local"},Lk=null,Mk=function(){Lk||(Lk=new Jk(7,"CastMdnsEventListener","mr.cast.SinkDiscoveryService",chrome.mdns.onServiceList,Kk));return Lk},Nk=null,Ok=function(){Nk||(Nk=hg()?new Jk(9,"CastNetworkListChangedEventListener","mr.cast.SinkDiscoveryService",chrome.networkingPrivate.onNetworkListChanged):new Jk(8,"CastNetworksChangedEventListener","mr.cast.SinkDiscoveryService",chrome.networkingPrivate.onNetworksChanged));return Nk},Pk=null,Qk=null,Rk=function(){Pk||
(Pk=new Jk(2,"CastChannelMessageListener","mr.cast.ChannelService",chrome.cast.channel.onMessage));Qk||(Qk=new Jk(1,"CastChannelErrorListener","mr.cast.ChannelService",chrome.cast.channel.onError));return[Pk,Qk]};var Sk=function(a){return Promise.all(a.map(function(a){return a.then(function(a){return{bc:!0,value:a}},function(a){return{bc:!1,reason:a}})}))};var Tk=function(a,b){this.g=b;this.F=a;this.F.l=this.b.bind(this);this.a=new C;this.m=new C;this.f=new C;this.H=null;this.v=this.B="";this.l=null;this.K=this.w=!1;this.aa=[];this.j=v("mr.cast.SinkDiscoveryService");this.u=new Set;this.o={xc:0,Mc:0};this.h=this.A=0};ka(Tk,Vg);Tk.prototype.init=function(){Xh(this);this.w&&(Uk(this),Vk(this));eh("mr.cast.SinkDiscoveryService",this)};var Uk=function(a){x(a.j,"Start listening to network changes");Ok().addListener()};
Tk.prototype.start=function(){var a=Date.now(),b=Mk();if(b.a){if(6E4>a-this.H)return;x(this.j,"Forcing mdns discovery");chrome.mdns.forceDiscovery(pa);b=Mk();b.removeListener()}else x(this.j,"Adding mdns listener");b.addListener();this.H=a};
Tk.prototype.handleEvent=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(a==chrome.mdns.onServiceList)this.J.apply(this,[].concat(la(c)));else if(a==chrome.networkingPrivate.onNetworksChanged||a==chrome.networkingPrivate.onNetworkListChanged)Vk(this);else throw Error("Unhandled event");};
var Wk=function(a,b){if(-1==b.serviceName.indexOf("._googlecast."))return null;var c={};b.serviceData.forEach(function(a){0==a.search(/[a-z]{2}=.+/)&&(c[a.substring(0,2)]=a.substring(3))});var d=c.id;if(!d)return w(a.j,"Missing ID"),null;pk(ok.S(),d);var e=Number(b.serviceHostPort.substring(b.serviceHostPort.indexOf(":")+1));if(isNaN(e)||0>e||65535<e)return w(a.j,"Missing or invalid port"),null;var f=c.fn;if(!f||!b.ipAddress)return w(a.j,"Missing friendly name or IP address"),null;a=Number(c.ca);
return new vk(d,f,c.md||"",isNaN(a)?0:a,b.ipAddress,e)};Tk.prototype.J=function(a){var b=this;x(this.j,"Registering "+a.length+" devices");0!=this.h&&(clearTimeout(this.h),this.h=0);a=Xk(this,a).map(function(a){return Yk(b,a,!0)});Sk(a).then(function(){b.o={xc:b.a.fa(),Mc:Zk(b)};$k(b)})};
var $k=function(a){0!=a.h||36E5>Date.now()-a.A||(a.h=setTimeout(function(){var b=a.o;Dg("MediaRouter.Cast.Discovery.KnownDevicesCount",b.Mc);Dg("MediaRouter.Cast.Discovery.ConnectedDevicesCount",b.xc);a.A=Date.now();a.h=0},5E3))};Tk.prototype.Fg=function(){return this.o};
var Zk=function(a){var b=a.u.size;ji(a.a.Na(!1),function(c){a.u.has(c.getId())||b++});return b},Yk=function(a,b,c){if(a.f.Ra(b.getId()))return Promise.resolve();a.f.set(b.getId(),b);return al(a,b).then(function(d){d?(d=a.a.get(b.getId()),c&&(d?d.Rb&&Hk(3):Hk(1)),bl(a,b)):(x(a.j,"Inaccessible sink: "+b.getId()),cl(a,b.getId()));a.f.remove(b.getId())})},dl=function(a,b){return void 0!=a.aa.find(function(a){return a.ipAddress==b.ipAddress})},Xk=function(a,b){var c=[];a.u.clear();b.forEach(function(b){if(!dl(a,
b)&&(b=Wk(a,b))){var d=b.getId();a.u.add(d);if(a.f.Ra(d)){var f=a.f.get(d);if(f.Ea()==b.Ea()&&f.ta()==b.ta()){x(a.j,"Sink has pending connection "+d);return}w(a.j,"Pending sink changed ip "+d);a.f.remove(d)}if(d=a.a.get(d)){if(b=d.update(b.b.friendlyName,b.Ea(),b.ta(),b.a))d.Rb=!1;b&&el(a.g,d)}else c.push(b)}});return c},fl=function(a,b){var c=a.a.get(b.getId()),d=null,e=b.Ea(),f=b.ta();null!=e&&null!=f&&(d=a.m.get(e+":"+f));if(c&&!d){var g=b.Ea(),m=b.ta();g&&m&&a.m.remove(g+":"+m)}d&&!c&&a.a.remove(d.getId());
a.a.set(b.getId(),b);null!=e&&null!=f&&a.m.set(e+":"+f,b)},bl=function(a,b){x(a.j,"Adding sink "+b.getId());fl(a,b);a.w||(a.w=!0,Uk(a));a=a.g;a.b.onSinkAvailabilityUpdated(a,1);el(a,b);gl(a.l,b);ok.S().a=new nk(b.gb,b.Ea())},cl=function(a,b){var c=a.a.get(b);if(c){x(a.j,"Removing sink "+b);a.a.remove(b);b=c.Ea();var d=c.ta();null!=b&&null!=d&&a.m.remove(b+":"+d);a.g.K(c)}},hl=function(a){var b=a.a.P();a.a.clear();a.m.clear();b.forEach(a.g.K,a.g)},al=function(a,b){z(a.j,"Checking access to "+b.getId());
return il(a.F,b).then(function(a){if(b.Rb){var c=4;a.audioOnly||(c|=1);b.a=c;b.b.iconType=uk(b.a)}return!0},function(){return!1})},jl=function(a){x(a.j,"Pruning inactive sinks.");ji(a.a.Na(!1),function(b){a.f.set(b.getId(),b);al(a,b).then(function(c){c||cl(a,b.getId());a.f.remove(b.getId())})})};Tk.prototype.b=function(a){return this.a.get(a,null)};var kl=function(a,b){var c=[];ji(a.a.Na(!1),function(a){Qj(yk(a,b))&&c.push(a)});return c};Tk.prototype.ea=function(){return"cast.SinkDiscoveryService"};
Tk.prototype.pa=function(){var a=this,b={};ji(this.a.Na(!0),function(c){var d;d=a.a.get(c);d={id:d.getId(),ip:d.Ea(),port:d.ta(),friendlyName:d.b.friendlyName,modelName:d.gb,capabilities:d.a,discoveredByDial:d.Rb,appStatusMap:d.eb};b[c]=d});return[new ll(b,this.v,this.o),new ml(this.w,this.A)]};
Tk.prototype.ua=function(){var a=Uh(this);if(a&&3==a.version){this.v=a.networkIds;this.o=a.deviceCounts;a=a.sinkMap;this.K=0<Object.keys(a).length;for(var b in a){var c=xk(a[b]);this.b(c.getId())||fl(this,c)}jl(this)}if(b=Vh(this))this.w=b.hasSavedSinks,this.A=b.lastSinkCountMetricRecordTime||0};
var nl=function(a,b){a.K=0<Object.keys(b).length;for(var c in b){var d=xk(b[c]);a.b(d.getId())||Yk(a,d,!1)}},Vk=function(a){x(a.j,"Fetching networks state");a.l&&ei(a.l);chrome.networkingPrivate.getNetworks({networkType:"All",visible:!0,configured:!0},function(b){for(var c=[],d=0;d<b.length;d++)"Connected"==b[d].ConnectionState&&c.push(b[d].GUID);ol(a,c.sort().join(","))})},ol=function(a,b){x(a.j,function(){return"Update current network "+pl(b)});b!=a.B&&(a.l&&(Wh.delete(a.l.ea()),a.l=null),b?(a.v&&
b!=a.v?hl(a):jl(a),a.B=b,a.v=b,a.l=new ql(a,a.B)):a.B="")},pl=function(a){for(var b=0,c=0;c<a.length;c++)b+=a.charCodeAt(c);return b},ll=function(a,b,c){this.sinkMap=a;this.networkIds=b;this.deviceCounts=c;this.version=3},ml=function(a,b){this.hasSavedSinks=a;this.lastSinkCountMetricRecordTime=b},ql=function(a,b){this.a=a;this.b=b;Xh(this)};ql.prototype.ea=function(){return"cast.NetworkSink."+this.b};
ql.prototype.pa=function(){var a=this,b=null,c=this.a.pa();c&&(this.a.K||0<this.a.a.fa())&&(b=c[0]);x(this.a.j,function(){return"Saving sink data for network "+pl(a.b)});return[null,b]};ql.prototype.ua=function(){var a=this;x(this.a.j,function(){return"Restoring sink data for network "+pl(a.b)});var b=Vh(this);b&&3==b.version&&nl(this.a,b.sinkMap)};var rl={STOP_MEDIA:"STOP",MEDIA_SET_VOLUME:"SET_VOLUME",MEDIA_GET_STATUS:"GET_STATUS"};var sl=function(){this.type="GET_STATUS";this.requestId=0};var tl=function(a,b,c){this.type="APPLICATION_BROADCAST";this.requestId=0;this.appIds=a;this.namespace=b;this.message=c};var ul=function(a){this.type="LAUNCH";this.requestId=0;this.appId=a;this.language=null};var vl=function(a){this.type="STOP";this.requestId=0;this.sessionId=a||null};var wl=function(a,b){this.requestId=a;this.b=b;this.Xh=null};wl.prototype.a=function(){};var xl=function(){this.a=new C},yl=function(a,b){a.a.set(b.requestId,b);b.Xh=setTimeout(function(){a.a.remove(b.requestId);b.a()},b.b)},zl=function(a,b){var c=a.a.get(b);if(!c)return null;clearTimeout(c.Xh);a.a.remove(b);return c};var Al=function(a,b){this.b=a;this.f=b;this.a=new xl;this.g=new Fj("cast.RequestIdGenerator")};Al.prototype.init=function(){Xh(this.g)};var Cl=function(a,b,c,d){var e=Gj(a.g);b.requestId=e;b=new Qc;c=new Bl(e,b,l(c)&&0<c?c:6E5,d);yl(a.a,c);return c};
Al.prototype.sendRequest=function(a,b,c,d,e,f){var g=this;if(!Pj.hasOwnProperty(c))return Promise.reject(Error("Custom namespace is not supported"));var m=Cl(this,a,k(d)?d:3E3,e),q=m.wa;Dl(this.b,b,c,a,e||this.f,f).then(null,function(){zl(g.a,m.requestId);q.b(El)});return q.a};Al.prototype.sendMessage=function(a,b,c,d,e,f){var g=this,m=Cl(this,a,k(d)?d:3E3,e),q=m.wa;Dl(this.b,b,c,a,e||this.f,f).then(function(){zl(g.a,m.requestId);q.resolve(!0)},function(){zl(g.a,m.requestId);q.b(El)});return q.a};
var Fl=function(a,b,c){var d=new ul(b.appId);d.language=b.language?b.language:chrome.i18n.getUILanguage?chrome.i18n.getUILanguage():chrome.runtime.getManifest().default_locale;return a.sendRequest(d,c,Kj,b.requestSessionTimeout)},Gl=Error("Timeout"),El=Error("Failed to send message"),Bl=function(a,b,c,d){wl.call(this,a,c);this.wa=b;this.sourceId=d};ka(Bl,wl);Bl.prototype.a=function(){this.wa.b(Gl)};var Hl=function(a,b){this.type="cast_app";this.originId=window["castApp.eventPage.Message.OriginID"]||void 0;this.subtype=a;this.devices=b;this.logRecord=this.deviceJustSetUp=void 0};p("castApp.eventPage.Message",Hl);var Il=function(a,b,c){this.ipAddress=a;this.appId=b;this.sessionId=c};Hl.DeviceData=Il;Hl.DeviceJustSetUp=function(a,b,c,d){this.ipAddress=a;this.name=b;this.udn=c;this.modelName=d};Hl.DeviceCapabilities=function(){};
Hl.LogRecord=function(a,b,c,d){this.levelValue=a;this.msg=b;this.loggerName=c;this.time=d};var Kl=function(a,b){this.f=a;this.g=b;this.b=new C;this.a=new zi;this.l=0;this.w=new C("serviceCheck",this.Yj.bind(this),"startDeviceMonitor",this.ak.bind(this),"releaseDeviceMonitor",this.Xj.bind(this),"deviceJustSetUp",this.Uj.bind(this),"logRecord",this.Vj.bind(this));chrome.runtime.onMessage.addListener(this.m.bind(this));chrome.runtime.onMessageExternal.addListener(this.h.bind(this));Jl(this,"serviceReady")};Kl.prototype.j=v("castApp.eventPage.Service");
var Nl=function(a){if(Ll(a)){var b=new zi;ji(a.f.a.Na(!1),function(a){var c=a.Ea();b.add(c);this.b.Ra(c)||this.g.sendRequest(new sl,a,Kj)}.bind(a));var c=!1;a.b.La().forEach(function(a){b.contains(a)||(this.b.remove(a),c=!0)}.bind(a));c&&Ml(a)}},Ll=function(a){if(0===a.a.fa())return!1;var b=Fa();3E4<b-a.l&&(a.l=b,chrome.tabs.query({url:["chrome://cast/*","chrome-extension://"+chrome.runtime.id+"/cast_setup/*"]},function(a){0===a.length?(x(this.j,"No tabs found. Clearing device monitor clients."),
this.a.clear()):x(this.j,function(){return"Tab check found active tabs: "+a.map(function(a){return a.id})})}.bind(a)));b=a.a.fa();x(a.j,"Monitor client count: "+b);return 0<b};Kl.prototype.m=function(a,b,c){if("object"!==typeof a||"cast_app"!==a.type)return!1;var d=this.w.get(a.subtype);if(!d)return!1;if(!a.originId)return ab("Missing origin ID in the incoming message."),!1;try{var e=d(a,b,c);e&&c(e)}catch(f){this.j.error("Error while handling request",f)}return!1};
var Jl=function(a,b,c){var d=new Hl(b,c);z(a.j,function(){return"Sending message: "+JSON.stringify(d)});chrome.runtime.sendMessage(d)};h=Kl.prototype;h.Yj=function(){Jl(this,"serviceReady")};h.ak=function(a){this.a.contains(a.originId)?x(this.j,"Client: "+a.originId+"already registered, dispatching current device list."):(x(this.j,"Registering monitor client: "+a.originId),this.a.add(a.originId));Ml(this);Ol(this)};h.Xj=function(a){x(this.j,"Unregistering monitor client: "+a.originId);this.a.remove(a.originId)};
h.Uj=function(a){a=a.deviceJustSetUp;var b=a.udn.replace(/-/g,"").toLowerCase(),c;a.capabilities&&(c=(a.capabilities.audioOutSupported?4:0)|(a.capabilities.videoOutSupported?1:0));c=new vk(b,a.name,a.modelName,c,a.ipAddress,ok.S().f||8009);Yk(this.f,c,!0)};h.Vj=function(a){a=a.logRecord;Kc({level:Pc(a.levelValue),G:a.loggerName,time:a.time,message:a.msg})};
var Ml=function(a){var b=a.b.P();Jl(a,"devices",b)},Ol=function(a){z(a.f.j,"Executing forceDiscovery.");chrome.mdns.forceDiscovery(pa);a.f.a.P().forEach(function(a){this.g.sendRequest(new sl,a,Kj)}.bind(a))};Kl.prototype.h=function(a,b,c){switch(a.type){case "handshake":c(new Hj("handshake"));break;case "launch":b=b.tab&&l(b.tab.id)?b.tab.id:null,null===b||"setup"!==a.entryPoint&&"offers"!==a.entryPoint&&"devices"!==a.entryPoint||chrome.tabs.update(b,{url:"chrome://cast#"+a.entryPoint})}};chrome.cast.Eb={CUSTOM_CONTROLLER_SCOPED:"custom_controller_scoped",TAB_AND_ORIGIN_SCOPED:"tab_and_origin_scoped",ORIGIN_SCOPED:"origin_scoped",PAGE_SCOPED:"page_scoped"};p("chrome.cast.AutoJoinPolicy",chrome.cast.Eb);chrome.cast.Td={CREATE_SESSION:"create_session",CAST_THIS_TAB:"cast_this_tab"};p("chrome.cast.DefaultActionPolicy",chrome.cast.Td);chrome.cast.Ob={VIDEO_OUT:"video_out",AUDIO_OUT:"audio_out",VIDEO_IN:"video_in",AUDIO_IN:"audio_in",MULTIZONE_GROUP:"multizone_group"};
p("chrome.cast.Capability",chrome.cast.Ob);chrome.cast.Gb={CANCEL:"cancel",TIMEOUT:"timeout",API_NOT_INITIALIZED:"api_not_initialized",INVALID_PARAMETER:"invalid_parameter",EXTENSION_NOT_COMPATIBLE:"extension_not_compatible",EXTENSION_MISSING:"extension_missing",RECEIVER_UNAVAILABLE:"receiver_unavailable",SESSION_ERROR:"session_error",CHANNEL_ERROR:"channel_error",LOAD_MEDIA_FAILED:"load_media_failed"};p("chrome.cast.ErrorCode",chrome.cast.Gb);chrome.cast.Zi={AVAILABLE:"available",UNAVAILABLE:"unavailable"};
p("chrome.cast.ReceiverAvailability",chrome.cast.Zi);chrome.cast.gj={CHROME:"chrome",IOS:"ios",ANDROID:"android"};p("chrome.cast.SenderPlatform",chrome.cast.gj);chrome.cast.Ud={CAST:"cast",DIAL:"dial",HANGOUT:"hangout",CUSTOM:"custom"};p("chrome.cast.ReceiverType",chrome.cast.Ud);chrome.cast.li={RUNNING:"running",STOPPED:"stopped",ERROR:"error"};p("chrome.cast.DialAppState",chrome.cast.li);chrome.cast.gd={CAST:"cast",STOP:"stop"};p("chrome.cast.ReceiverAction",chrome.cast.gd);
chrome.cast.gg={CONNECTED:"connected",DISCONNECTED:"disconnected",STOPPED:"stopped"};p("chrome.cast.SessionStatus",chrome.cast.gg);chrome.cast.vj={ATTENUATION:"attenuation",FIXED:"fixed",MASTER:"master"};p("chrome.cast.VolumeControlType",chrome.cast.vj);chrome.cast.VERSION=[1,2];p("chrome.cast.VERSION",chrome.cast.VERSION);chrome.cast.Ll=!0;p("chrome.cast.usingPresentationApi",chrome.cast.Ll);chrome.cast.Error=function(a,b,c){this.code=a;this.description=b||null;this.details=c||null};p("chrome.cast.Error",chrome.cast.Error);chrome.cast.fj=function(a){this.platform=a;this.packageId=this.url=null};p("chrome.cast.SenderApplication",chrome.cast.fj);chrome.cast.Image=function(a){this.url=a;this.width=this.height=null};p("chrome.cast.Image",chrome.cast.Image);
chrome.cast.Volume=function(a,b){this.level=k(a)?a:null;this.muted=k(b)?b:null};p("chrome.cast.Volume",chrome.cast.Volume);chrome.cast.ei=function(a,b,c,d,e){this.sessionRequest=a;this.sessionListener=b;this.receiverListener=c;this.autoJoinPolicy=d||chrome.cast.Eb.TAB_AND_ORIGIN_SCOPED;this.defaultActionPolicy=e||chrome.cast.Td.CREATE_SESSION;this.customDialLaunchCallback=null;this.invisibleSender=!1;this.additionalSessionRequests=[]};p("chrome.cast.ApiConfig",chrome.cast.ei);chrome.cast.ni=function(a,b){this.appName=a;this.launchParameter=b||null};p("chrome.cast.DialRequest",chrome.cast.ni);
chrome.cast.Vf=function(a,b,c){this.receiver=a;this.appState=b;this.extraData=c||null};p("chrome.cast.DialLaunchData",chrome.cast.Vf);chrome.cast.mi=function(a,b){this.doLaunch=a;this.launchParameter=b||null};p("chrome.cast.DialLaunchResponse",chrome.cast.mi);chrome.cast.fg=function(a,b,c){this.appId=a;this.capabilities=ta(b)?b:[chrome.cast.Ob.VIDEO_OUT,chrome.cast.Ob.AUDIO_OUT];this.requestSessionTimeout=c||chrome.cast.timeout.requestSession;this.dialRequest=this.language=null};
p("chrome.cast.SessionRequest",chrome.cast.fg);
chrome.cast.Ie=function(a,b,c,d){this.label=a;a=b;Ta.test(a)&&(-1!=a.indexOf("&")&&(a=a.replace(Na,"&amp;")),-1!=a.indexOf("<")&&(a=a.replace(Oa,"&lt;")),-1!=a.indexOf(">")&&(a=a.replace(Pa,"&gt;")),-1!=a.indexOf('"')&&(a=a.replace(Qa,"&quot;")),-1!=a.indexOf("'")&&(a=a.replace(Ra,"&#39;")),-1!=a.indexOf("\x00")&&(a=a.replace(Sa,"&#0;")));this.friendlyName=a;this.capabilities=c||[];this.volume=d||null;this.receiverType=chrome.cast.Ud.CAST;this.displayStatus=this.isActiveInput=null};
p("chrome.cast.Receiver",chrome.cast.Ie);chrome.cast.aj=function(a,b){this.statusText=a;this.appImages=b;this.showStop=null};p("chrome.cast.ReceiverDisplayStatus",chrome.cast.aj);chrome.cast.ig=function(){this.requestSession=6E4;this.sendCustomMessage=this.setReceiverVolume=this.stopSession=this.leaveSession=3E3};p("chrome.cast.Timeout",chrome.cast.ig);chrome.cast.timeout=new chrome.cast.ig;p("chrome.cast.timeout",chrome.cast.timeout);chrome.cast.Pf="auto-join";chrome.cast.dg="cast-session_";chrome.cast.media.fd={PAUSE:"pause",SEEK:"seek",STREAM_VOLUME:"stream_volume",STREAM_MUTE:"stream_mute"};p("chrome.cast.media.MediaCommand",chrome.cast.media.fd);chrome.cast.media.rb={GENERIC:0,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4};p("chrome.cast.media.MetadataType",chrome.cast.media.rb);chrome.cast.media.He={IDLE:"IDLE",PLAYING:"PLAYING",PAUSED:"PAUSED",BUFFERING:"BUFFERING"};p("chrome.cast.media.PlayerState",chrome.cast.media.He);
chrome.cast.media.Je={OFF:"REPEAT_OFF",ALL:"REPEAT_ALL",SINGLE:"REPEAT_SINGLE",ALL_AND_SHUFFLE:"REPEAT_ALL_AND_SHUFFLE"};p("chrome.cast.media.RepeatMode",chrome.cast.media.Je);chrome.cast.media.bj={PLAYBACK_START:"PLAYBACK_START",PLAYBACK_PAUSE:"PLAYBACK_PAUSE"};p("chrome.cast.media.ResumeState",chrome.cast.media.bj);chrome.cast.media.hg={BUFFERED:"BUFFERED",LIVE:"LIVE",OTHER:"OTHER"};p("chrome.cast.media.StreamType",chrome.cast.media.hg);
chrome.cast.media.xi={CANCELLED:"CANCELLED",INTERRUPTED:"INTERRUPTED",FINISHED:"FINISHED",ERROR:"ERROR"};p("chrome.cast.media.IdleReason",chrome.cast.media.xi);chrome.cast.media.sj={TEXT:"TEXT",AUDIO:"AUDIO",VIDEO:"VIDEO"};p("chrome.cast.media.TrackType",chrome.cast.media.sj);chrome.cast.media.pj={SUBTITLES:"SUBTITLES",CAPTIONS:"CAPTIONS",DESCRIPTIONS:"DESCRIPTIONS",CHAPTERS:"CHAPTERS",METADATA:"METADATA"};p("chrome.cast.media.TextTrackType",chrome.cast.media.pj);
chrome.cast.media.lj={NONE:"NONE",OUTLINE:"OUTLINE",DROP_SHADOW:"DROP_SHADOW",RAISED:"RAISED",DEPRESSED:"DEPRESSED"};p("chrome.cast.media.TextTrackEdgeType",chrome.cast.media.lj);chrome.cast.media.qj={NONE:"NONE",NORMAL:"NORMAL",ROUNDED_CORNERS:"ROUNDED_CORNERS"};p("chrome.cast.media.TextTrackWindowType",chrome.cast.media.qj);
chrome.cast.media.mj={SANS_SERIF:"SANS_SERIF",MONOSPACED_SANS_SERIF:"MONOSPACED_SANS_SERIF",SERIF:"SERIF",MONOSPACED_SERIF:"MONOSPACED_SERIF",CASUAL:"CASUAL",CURSIVE:"CURSIVE",SMALL_CAPITALS:"SMALL_CAPITALS"};p("chrome.cast.media.TextTrackFontGenericFamily",chrome.cast.media.mj);chrome.cast.media.nj={NORMAL:"NORMAL",BOLD:"BOLD",BOLD_ITALIC:"BOLD_ITALIC",ITALIC:"ITALIC"};p("chrome.cast.media.TextTrackFontStyle",chrome.cast.media.nj);chrome.cast.media.ti=function(){this.customData=null};p("chrome.cast.media.GetStatusRequest",chrome.cast.media.ti);chrome.cast.media.Mi=function(){this.customData=null};p("chrome.cast.media.PauseRequest",chrome.cast.media.Mi);chrome.cast.media.Oi=function(){this.customData=null};p("chrome.cast.media.PlayRequest",chrome.cast.media.Oi);chrome.cast.media.ej=function(){this.customData=this.resumeState=this.currentTime=null};p("chrome.cast.media.SeekRequest",chrome.cast.media.ej);
chrome.cast.media.hj=function(){this.customData=null};p("chrome.cast.media.StopRequest",chrome.cast.media.hj);chrome.cast.media.wj=function(a){this.volume=a;this.customData=null};p("chrome.cast.media.VolumeRequest",chrome.cast.media.wj);chrome.cast.media.Ci=function(a){this.type="LOAD";this.requestId=0;this.sessionId=null;this.media=a;this.activeTrackIds=null;this.autoplay=!0;this.customData=this.currentTime=null};p("chrome.cast.media.LoadRequest",chrome.cast.media.Ci);
chrome.cast.media.Fp=function(a){this.type="PRECACHE";this.requestId=0;this.data=a};chrome.cast.media.oi=function(a,b){this.requestId=0;this.activeTrackIds=a||null;this.textTrackStyle=b||null};p("chrome.cast.media.EditTracksInfoRequest",chrome.cast.media.oi);chrome.cast.media.si=function(){this.metadataType=this.type=chrome.cast.media.rb.GENERIC;this.releaseDate=this.releaseYear=this.images=this.subtitle=this.title=null};p("chrome.cast.media.GenericMediaMetadata",chrome.cast.media.si);
chrome.cast.media.Fi=function(){this.metadataType=this.type=chrome.cast.media.rb.MOVIE;this.releaseDate=this.releaseYear=this.images=this.subtitle=this.studio=this.title=null};p("chrome.cast.media.MovieMediaMetadata",chrome.cast.media.Fi);chrome.cast.media.tj=function(){this.metadataType=this.type=chrome.cast.media.rb.TV_SHOW;this.originalAirdate=this.releaseYear=this.images=this.episode=this.episodeNumber=this.season=this.seasonNumber=this.episodeTitle=this.title=this.seriesTitle=null};
p("chrome.cast.media.TvShowMediaMetadata",chrome.cast.media.tj);chrome.cast.media.Gi=function(){this.metadataType=this.type=chrome.cast.media.rb.MUSIC_TRACK;this.releaseDate=this.releaseYear=this.images=this.discNumber=this.trackNumber=this.artistName=this.songName=this.composer=this.artist=this.albumArtist=this.title=this.albumName=null};p("chrome.cast.media.MusicTrackMediaMetadata",chrome.cast.media.Gi);
chrome.cast.media.Ni=function(){this.metadataType=this.type=chrome.cast.media.rb.PHOTO;this.creationDateTime=this.height=this.width=this.longitude=this.latitude=this.images=this.location=this.artist=this.title=null};p("chrome.cast.media.PhotoMediaMetadata",chrome.cast.media.Ni);chrome.cast.media.Ei=function(a,b){this.contentId=a;this.streamType=chrome.cast.media.hg.BUFFERED;this.contentType=b;this.customData=this.textTrackStyle=this.tracks=this.duration=this.metadata=null};
p("chrome.cast.media.MediaInfo",chrome.cast.media.Ei);chrome.cast.media.Qi=function(a){this.itemId=null;this.media=a;this.autoplay=!0;this.startTime=0;this.playbackDuration=null;this.preloadTime=0;this.customData=this.activeTrackIds=null};p("chrome.cast.media.QueueItem",chrome.cast.media.Qi);chrome.cast.media.ji="CC1AD845";p("chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID",chrome.cast.media.ji);chrome.cast.media.timeout={};chrome.cast.media.timeout.load=0;p("chrome.cast.media.timeout.load",chrome.cast.media.timeout.load);
chrome.cast.media.timeout.Aa=0;p("chrome.cast.media.timeout.getStatus",chrome.cast.media.timeout.Aa);chrome.cast.media.timeout.play=0;p("chrome.cast.media.timeout.play",chrome.cast.media.timeout.play);chrome.cast.media.timeout.pause=0;p("chrome.cast.media.timeout.pause",chrome.cast.media.timeout.pause);chrome.cast.media.timeout.seek=0;p("chrome.cast.media.timeout.seek",chrome.cast.media.timeout.seek);chrome.cast.media.timeout.stop=0;p("chrome.cast.media.timeout.stop",chrome.cast.media.timeout.stop);
chrome.cast.media.timeout.Yc=0;p("chrome.cast.media.timeout.setVolume",chrome.cast.media.timeout.Yc);chrome.cast.media.timeout.Ve=0;p("chrome.cast.media.timeout.editTracksInfo",chrome.cast.media.timeout.Ve);chrome.cast.media.timeout.Uk=0;p("chrome.cast.media.timeout.queue",chrome.cast.media.timeout.Uk);chrome.cast.media.rj=function(a,b){this.trackId=a;this.trackContentType=this.trackContentId=null;this.type=b;this.customData=this.subtype=this.language=this.name=null};p("chrome.cast.media.Track",chrome.cast.media.rj);
chrome.cast.media.oj=function(){this.customData=this.fontStyle=this.fontGenericFamily=this.fontFamily=this.fontScale=this.windowRoundedCornerRadius=this.windowColor=this.windowType=this.edgeColor=this.edgeType=this.backgroundColor=this.foregroundColor=null};p("chrome.cast.media.TextTrackStyle",chrome.cast.media.oj);chrome.cast.media.Si=function(a){this.type="QUEUE_LOAD";this.sessionId=this.requestId=null;this.items=a;this.startIndex=0;this.repeatMode=chrome.cast.media.Je.OFF;this.customData=null};
p("chrome.cast.media.QueueLoadRequest",chrome.cast.media.Si);chrome.cast.media.Pi=function(a){this.type="QUEUE_INSERT";this.sessionId=this.requestId=null;this.items=a;this.customData=this.insertBefore=null};p("chrome.cast.media.QueueInsertItemsRequest",chrome.cast.media.Pi);chrome.cast.media.Wi=function(a){this.type="QUEUE_UPDATE";this.sessionId=this.requestId=null;this.items=a;this.customData=null};p("chrome.cast.media.QueueUpdateItemsRequest",chrome.cast.media.Wi);
chrome.cast.media.Ri=function(){this.type="QUEUE_UPDATE";this.customData=this.jump=this.currentItemId=this.sessionId=this.requestId=null};p("chrome.cast.media.QueueJumpRequest",chrome.cast.media.Ri);chrome.cast.media.Vi=function(){this.type="QUEUE_UPDATE";this.customData=this.repeatMode=this.sessionId=this.requestId=null};p("chrome.cast.media.QueueSetPropertiesRequest",chrome.cast.media.Vi);
chrome.cast.media.Ti=function(a){this.type="QUEUE_REMOVE";this.sessionId=this.requestId=null;this.itemIds=a;this.customData=null};p("chrome.cast.media.QueueRemoveItemsRequest",chrome.cast.media.Ti);chrome.cast.media.Ui=function(a){this.type="QUEUE_REORDER";this.sessionId=this.requestId=null;this.itemIds=a;this.customData=this.insertBefore=null};p("chrome.cast.media.QueueReorderItemsRequest",chrome.cast.media.Ui);chrome.cast.media.I=function(a,b){this.sessionId=a;this.mediaSessionId=b;this.media=null;this.playbackRate=1;this.playerState=chrome.cast.media.He.IDLE;this.currentTime=0;this.supportedMediaCommands=[];this.volume=new chrome.cast.Volume;this.items=this.preloadedItemId=this.loadingItemId=this.currentItemId=this.customData=this.activeTrackIds=this.idleReason=null;this.repeatMode=chrome.cast.media.Je.OFF};p("chrome.cast.media.Media",chrome.cast.media.I);chrome.cast.media.I.prototype.Aa=function(){};
chrome.cast.media.I.prototype.getStatus=chrome.cast.media.I.prototype.Aa;chrome.cast.media.I.prototype.play=function(){};chrome.cast.media.I.prototype.play=chrome.cast.media.I.prototype.play;chrome.cast.media.I.prototype.Nk=function(){};chrome.cast.media.I.prototype.playWithContext=chrome.cast.media.I.prototype.Nk;chrome.cast.media.I.prototype.pause=function(){};chrome.cast.media.I.prototype.pause=chrome.cast.media.I.prototype.pause;chrome.cast.media.I.prototype.Mk=function(){};
chrome.cast.media.I.prototype.pauseWithContext=chrome.cast.media.I.prototype.Mk;chrome.cast.media.I.prototype.seek=function(){};chrome.cast.media.I.prototype.seek=chrome.cast.media.I.prototype.seek;chrome.cast.media.I.prototype.stop=function(){};chrome.cast.media.I.prototype.stop=chrome.cast.media.I.prototype.stop;chrome.cast.media.I.prototype.Yc=function(){};chrome.cast.media.I.prototype.setVolume=chrome.cast.media.I.prototype.Yc;chrome.cast.media.I.prototype.Ve=function(){};
chrome.cast.media.I.prototype.editTracksInfo=chrome.cast.media.I.prototype.Ve;chrome.cast.media.I.prototype.Wk=function(){};chrome.cast.media.I.prototype.queueInsertItems=chrome.cast.media.I.prototype.Wk;chrome.cast.media.I.prototype.Vk=function(){};chrome.cast.media.I.prototype.queueAppendItem=chrome.cast.media.I.prototype.Vk;chrome.cast.media.I.prototype.gl=function(){};chrome.cast.media.I.prototype.queueUpdateItems=chrome.cast.media.I.prototype.gl;chrome.cast.media.I.prototype.bl=function(){};
chrome.cast.media.I.prototype.queuePrev=chrome.cast.media.I.prototype.bl;chrome.cast.media.I.prototype.al=function(){};chrome.cast.media.I.prototype.queueNext=chrome.cast.media.I.prototype.al;chrome.cast.media.I.prototype.Xk=function(a){Pl(this,a)};chrome.cast.media.I.prototype.queueJumpToItem=chrome.cast.media.I.prototype.Xk;chrome.cast.media.I.prototype.fl=function(){};chrome.cast.media.I.prototype.queueSetRepeatMode=chrome.cast.media.I.prototype.fl;chrome.cast.media.I.prototype.dl=function(){};
chrome.cast.media.I.prototype.queueRemoveItems=chrome.cast.media.I.prototype.dl;chrome.cast.media.I.prototype.cl=function(a){Pl(this,a)};chrome.cast.media.I.prototype.queueRemoveItem=chrome.cast.media.I.prototype.cl;chrome.cast.media.I.prototype.el=function(){};chrome.cast.media.I.prototype.queueReorderItems=chrome.cast.media.I.prototype.el;chrome.cast.media.I.prototype.Zk=function(a,b,c,d){a=Pl(this,a);0>a||(0>b?d&&d(new chrome.cast.Error(chrome.cast.Gb.INVALID_PARAMETER)):a==b&&c&&c())};
chrome.cast.media.I.prototype.queueMoveItemToNewIndex=chrome.cast.media.I.prototype.Zk;chrome.cast.media.I.prototype.Hl=function(a){return-1<this.supportedMediaCommands.indexOf(a)};chrome.cast.media.I.prototype.supportsCommand=chrome.cast.media.I.prototype.Hl;chrome.cast.media.I.prototype.Oj=function(){return this.currentTime};chrome.cast.media.I.prototype.getEstimatedTime=chrome.cast.media.I.prototype.Oj;chrome.cast.media.I.prototype.Me=function(){};
chrome.cast.media.I.prototype.addUpdateListener=chrome.cast.media.I.prototype.Me;chrome.cast.media.I.prototype.Ne=function(){};chrome.cast.media.I.prototype.addUpdateListenerWithContext=chrome.cast.media.I.prototype.Ne;chrome.cast.media.I.prototype.Df=function(){};chrome.cast.media.I.prototype.removeUpdateListener=chrome.cast.media.I.prototype.Df;chrome.cast.media.I.prototype.Ef=function(){};chrome.cast.media.I.prototype.removeUpdateListenerWithContext=chrome.cast.media.I.prototype.Ef;
var Pl=function(a,b){return jb(a.items,function(a){return a.itemId==b})};var Ql=function(a,b,c){this.sessionId=a;this.namespaceName=b;this.message=c};var Rl=function(a){this.a=a;this.j=v("mr.cast.ReceiverStatusQuerier")},Sl=function(a,b){return Fe(new De(n(a.b,a,b),3500,5),2).start().then(null,function(c){x(a.j,"Failed to get receiver status from "+b.getId());throw c;})};Rl.prototype.b=function(a){x(this.j,"Query receiver status: "+a.getId());return this.a.sendRequest(new sl,a,Kj)};var Tl=function(a,b){this.type="SET_VOLUME";this.requestId=0;this.volume=a;this.expectedVolume=b||null};chrome.cast.L=function(a,b,c,d,e){this.sessionId=a;this.appId=b;this.displayName=c;this.statusText=null;this.appImages=d;this.receiver=e;this.senderApps=[];this.namespaces=[];this.media=[];this.status=chrome.cast.gg.CONNECTED;this.transportId=""};p("chrome.cast.Session",chrome.cast.L);chrome.cast.L.prototype.Cl=function(a,b,c){this.Qh(null,a,b,c)};chrome.cast.L.prototype.setReceiverVolumeLevel=chrome.cast.L.prototype.Cl;
chrome.cast.L.prototype.Qh=function(a,b,c,d){b=new Tl(new chrome.cast.Volume(b,null),this.receiver.volume);a.setReceiverVolume(this.sessionId,b,c,d)};chrome.cast.L.prototype.setReceiverVolumeLevelWithContext=chrome.cast.L.prototype.Qh;chrome.cast.L.prototype.Bl=function(a,b,c){this.Ph(0,a,b,c)};chrome.cast.L.prototype.setReceiverMuted=chrome.cast.L.prototype.Bl;
chrome.cast.L.prototype.Ph=function(a,b,c,d){a=new Tl(new chrome.cast.Volume(null,b),this.receiver.volume);null.setReceiverVolume(this.sessionId,a,c,d)};chrome.cast.L.prototype.setReceiverMutedWithContext=chrome.cast.L.prototype.Ph;chrome.cast.L.prototype.leave=function(a,b){null.leaveSession(this.sessionId,a,b)};chrome.cast.L.prototype.leave=chrome.cast.L.prototype.leave;chrome.cast.L.prototype.stop=function(){};chrome.cast.L.prototype.stop=chrome.cast.L.prototype.stop;
chrome.cast.L.prototype.El=function(){};chrome.cast.L.prototype.stopWithContext=chrome.cast.L.prototype.El;chrome.cast.L.prototype.sendMessage=function(){};chrome.cast.L.prototype.sendMessage=chrome.cast.L.prototype.sendMessage;chrome.cast.L.prototype.wl=function(){};chrome.cast.L.prototype.sendMessageWithContext=chrome.cast.L.prototype.wl;chrome.cast.L.prototype.Me=function(){};chrome.cast.L.prototype.addUpdateListener=chrome.cast.L.prototype.Me;chrome.cast.L.prototype.Ne=function(){};
chrome.cast.L.prototype.addUpdateListenerWithContext=chrome.cast.L.prototype.Ne;chrome.cast.L.prototype.Df=function(){};chrome.cast.L.prototype.removeUpdateListener=chrome.cast.L.prototype.Df;chrome.cast.L.prototype.Ef=function(){};chrome.cast.L.prototype.removeUpdateListenerWithContext=chrome.cast.L.prototype.Ef;chrome.cast.L.prototype.zj=function(){};chrome.cast.L.prototype.addMessageListener=chrome.cast.L.prototype.zj;chrome.cast.L.prototype.Aj=function(){};
chrome.cast.L.prototype.addMessageListenerWithContext=chrome.cast.L.prototype.Aj;chrome.cast.L.prototype.xj=function(){};chrome.cast.L.prototype.addMediaListener=chrome.cast.L.prototype.xj;chrome.cast.L.prototype.yj=function(){};chrome.cast.L.prototype.addMediaListenerWithContext=chrome.cast.L.prototype.yj;chrome.cast.L.prototype.nl=function(){};chrome.cast.L.prototype.removeMediaListener=chrome.cast.L.prototype.nl;chrome.cast.L.prototype.ol=function(){};
chrome.cast.L.prototype.removeMediaListenerWithContext=chrome.cast.L.prototype.ol;chrome.cast.L.prototype.pl=function(){};chrome.cast.L.prototype.removeMessageListener=chrome.cast.L.prototype.pl;chrome.cast.L.prototype.ql=function(){};chrome.cast.L.prototype.removeMessageListenerWithContext=chrome.cast.L.prototype.ql;chrome.cast.L.prototype.ek=function(a){a.sessionId=this.sessionId};chrome.cast.L.prototype.loadMedia=chrome.cast.L.prototype.ek;chrome.cast.L.prototype.Yk=function(a){a.sessionId=this.sessionId};
chrome.cast.L.prototype.queueLoad=chrome.cast.L.prototype.Yk;var Wl=function(a,b){if(!b.applications||1!=b.applications.length)return null;var c=b.applications[0];a=Ul(a);a=new chrome.cast.L(c.sessionId,c.appId,c.displayName,c.appImages,a);a.senderApps=c.senderApps;a.namespaces=c.namespaces||[];a.transportId=c.transportId;a.statusText=c.statusText;if(!a.sessionId||!(a.namespaces&&0!=a.namespaces.length||Vl(a)))return null;a.receiver.volume=b.volume;"boolean"==typeof b.isActiveInput&&(a.receiver.isActiveInput=b.isActiveInput);return a},Xl=function(a){var b=
[];if(!a)return b;a&1&&b.push(chrome.cast.Ob.VIDEO_OUT);a&2&&b.push(chrome.cast.Ob.VIDEO_IN);a&4&&b.push(chrome.cast.Ob.AUDIO_OUT);a&8&&b.push(chrome.cast.Ob.AUDIO_IN);a&32&&b.push(chrome.cast.Ob.MULTIZONE_GROUP);return b},Ul=function(a){return new chrome.cast.Ie(a.getId(),a.b.friendlyName,Xl(a.a))},Yl=function(a,b){if(a.statusText!=b.statusText)return!0;var c=a.namespaces||[],d=b.namespaces||[];if(c.length!=d.length)return!0;for(var e={index:0};e.index<c.length;e={index:e.index},e.index++)if(!d.some(function(a){return function(b){return b.name==
c[a.index].name}}(e)))return!0;return a.receiver.volume.level!==b.receiver.volume.level||a.receiver.volume.muted!==b.receiver.volume.muted?!0:!1},Zl=function(a){ta(a)?a.forEach(Zl):ya(a)&&Object.keys(a).forEach(function(b){null===a[b]?delete a[b]:(ya(a[b])||ta(a[b]))&&Zl(a[b])})},$l=function(a){return a.namespaces.some(function(a){return a.name==Mj})},am=["MultizoneLeader","MultizoneFollower"],Vl=function(a){return null!==a&&"MultizoneLeader"==a.appId},bm=function(a){return"E8C28D3C"==a||"00000000-0000-0000-0000-000000000000"==
a};var cm=function(a){this.b=a;this.j=v("mr.cast.SessionLauncher")},dm=function(a,b,c){Cg("MediaRouter.Cast.Session.Type",0,zk);return Fl(a.b,b,c).then(a.a.bind(a,c),function(a){a&&Gl==a?Ik(1):Ik(0);throw a;})};cm.prototype.a=function(a,b){z(this.j,"Got launch result from "+a.getId());if("LAUNCH_ERROR"==b.type)throw Ik(2),Error(b.reason);a=Wl(a,b.status);x(this.j,"Launched session: "+a.sessionId);return a};var em=function(a,b,c){this.type=a;this.message=b;this.sequenceNumber=k(c)?c:-1;this.timeoutMillis=0;this.clientId=""};var fm=function(a,b){this.g=a;this.a=b;this.f=[];this.b=new xl},hm=function(a,b){return(a=gm(a.a,b))?a.routeId:null};fm.prototype.listen=function(a,b){this.f[a]=b};var jm=function(a,b,c,d){z(im,"Sending to "+c);z(im,JSON.stringify(d));d.clientId=c;a=a.g;a.b.Jb(a,b,d)},km=function(a,b,c){var d=gm(a.a,b);d&&d.a?jm(a,d.routeId,b,c):a.connect(b).then(function(d){d?(d=hm(a,b))?jm(a,d,b,c):w(im,"No route for "+b):w(im,"No connected client "+b)},null)};
fm.prototype.connect=function(a){var b=gm(this.a,a);if(null!=b&&b.a)return Promise.resolve(!0);b=hm(this,a);if(!b)return w(im,"No route for client "+a),Promise.resolve(!1);if(a=this.b.a.get(b,null))return a.wa.a;a=new Qc;yl(this.b,new lm(b,a));return a.a};var im=v("mr.cast.ApiMessenger"),lm=function(a,b){wl.call(this,a,3E4);this.wa=b};ka(lm,wl);lm.prototype.a=function(){this.wa.resolve(!1)};var mm=function(a,b){this.nb=this.l=this.b="";this.ya=null;this.f=this.a="";this.g=!1;var c;a instanceof mm?(this.g=k(b)?b:a.g,nm(this,a.b),this.l=a.l,om(this,a.nb),pm(this,a.ta()),qm(this,a.a),rm(this,a.h.clone()),sm(this,a.f)):a&&(c=String(a).match(qh))?(this.g=!!b,nm(this,c[1]||"",!0),this.l=tm(c[2]||""),om(this,c[3]||"",!0),pm(this,c[4]),qm(this,c[5]||"",!0),rm(this,c[6]||"",!0),sm(this,c[7]||"",!0)):(this.g=!!b,this.h=new um(null,0,this.g))};
mm.prototype.toString=function(){var a=[],b=this.b;b&&a.push(vm(b,wm,!0),":");var c=this.nb;if(c||"file"==b)a.push("//"),(b=this.l)&&a.push(vm(b,wm,!0),"@"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.ta(),null!=c&&a.push(":",String(c));if(c=this.a)this.nb&&"/"!=c.charAt(0)&&a.push("/"),a.push(vm(c,"/"==c.charAt(0)?xm:ym,!0));(c=this.h.toString())&&a.push("?",c);(c=this.f)&&a.push("#",vm(c,zm));return a.join("")};
mm.prototype.resolve=function(a){var b=this.clone(),c=!!a.b;c?nm(b,a.b):c=!!a.l;c?b.l=a.l:c=!!a.nb;c?om(b,a.nb):c=null!=a.ya;var d=a.a;if(c)pm(b,a.ta());else if(c=!!a.a){if("/"!=d.charAt(0))if(this.nb&&!this.a)d="/"+d;else{var e=b.a.lastIndexOf("/");-1!=e&&(d=b.a.substr(0,e+1)+d)}e=d;if(".."==e||"."==e)d="";else if(-1!=e.indexOf("./")||-1!=e.indexOf("/.")){for(var d=Ia(e,"/"),e=e.split("/"),f=[],g=0;g<e.length;){var m=e[g++];"."==m?d&&g==e.length&&f.push(""):".."==m?((1<f.length||1==f.length&&""!=
f[0])&&f.pop(),d&&g==e.length&&f.push("")):(f.push(m),d=!0)}d=f.join("/")}else d=e}c?qm(b,d):c=""!==a.h.toString();c?rm(b,a.h.clone()):c=!!a.f;c&&sm(b,a.f);return b};mm.prototype.clone=function(){return new mm(this)};var nm=function(a,b,c){a.b=c?tm(b,!0):b;a.b&&(a.b=a.b.replace(/:$/,""))},om=function(a,b,c){a.nb=c?tm(b,!0):b};mm.prototype.ta=function(){return this.ya};
var pm=function(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.ya=b}else a.ya=null},qm=function(a,b,c){a.a=c?tm(b,!0):b},rm=function(a,b,c){b instanceof um?(a.h=b,Am(a.h,a.g)):(c||(b=vm(b,Bm)),a.h=new um(b,0,a.g))},sm=function(a,b,c){a.f=c?tm(b):b},tm=function(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""},vm=function(a,b,c){return va(a)?(a=encodeURI(a).replace(b,Cm),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null},Cm=function(a){a=
a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)},wm=/[#\/\?@]/g,ym=/[\#\?:]/g,xm=/[\#\?]/g,Bm=/[\#\?@]/g,zm=/#/g,um=function(a,b,c){this.b=this.a=null;this.f=a||null;this.g=!!c},Dm=function(a){a.a||(a.a=new C,a.b=0,a.f&&rh(a.f,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))},Fm=function(a){var b=ti(a);if("undefined"==typeof b)throw Error("Keys are undefined");var c=new um(null,0,void 0);a=si(a);for(var d=0;d<b.length;d++){var e=b[d],f=a[d];ta(f)?Em(c,e,f):c.add(e,
f)}return c};h=um.prototype;h.fa=function(){Dm(this);return this.b};h.add=function(a,b){Dm(this);this.f=null;a=Gm(this,a);var c=this.a.get(a);c||this.a.set(a,c=[]);c.push(b);this.b+=1;return this};h.remove=function(a){Dm(this);a=Gm(this,a);return this.a.Ra(a)?(this.f=null,this.b-=this.a.get(a).length,this.a.remove(a)):!1};h.clear=function(){this.a=this.f=null;this.b=0};h.jb=function(){Dm(this);return 0==this.b};h.Ra=function(a){Dm(this);a=Gm(this,a);return this.a.Ra(a)};
h.jd=function(a){var b=this.P();return mb(b,a)};h.La=function(){Dm(this);for(var a=this.a.P(),b=this.a.La(),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.P=function(a){Dm(this);var b=[];if(va(a))this.Ra(a)&&(b=wb(b,this.a.get(Gm(this,a))));else{a=this.a.P();for(var c=0;c<a.length;c++)b=wb(b,a[c])}return b};h.set=function(a,b){Dm(this);this.f=null;a=Gm(this,a);this.Ra(a)&&(this.b-=this.a.get(a).length);this.a.set(a,[b]);this.b+=1;return this};
h.get=function(a,b){a=a?this.P(a):[];return 0<a.length?String(a[0]):b};var Em=function(a,b,c){a.remove(b);0<c.length&&(a.f=null,a.a.set(Gm(a,b),u(c)),a.b+=c.length)};um.prototype.toString=function(){if(this.f)return this.f;if(!this.a)return"";for(var a=[],b=this.a.La(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.P(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}return this.f=a.join("&")};
um.prototype.clone=function(){var a=new um;a.f=this.f;this.a&&(a.a=this.a.clone(),a.b=this.b);return a};var Gm=function(a,b){b=String(b);a.g&&(b=b.toLowerCase());return b},Am=function(a,b){b&&!a.g&&(Dm(a),a.f=null,a.a.forEach(function(a,b){var c=b.toLowerCase();b!=c&&(this.remove(b),Em(this,c,a))},a));a.g=b};um.prototype.extend=function(a){for(var b=0;b<arguments.length;b++)vi(arguments[b],function(a,b){this.add(b,a)},this)};var Hm=function(a,b,c,d,e,f,g,m,q,y){this.l=a;this.a=b||null;this.b=c||null;this.f=d||null;this.g=k(e)?e:null;this.v=f||null;this.o=g||null;this.w=m||!1;this.m=q||null;this.h=y||null},Im=function(a,b){return(a=a.match(b+"=([^/]*)"))?a[1]:null},Km=function(a){a=a.match(/__castAppId__=([^/]*)/g);return null==a?[]:eb(fb(a,function(a){a=Im(a,"__castAppId__");if(!a)return null;a=a.match(Jm);if(!a||0==a.length)return null;var b=[];3==a.length&&a[2]&&(b=a[2].split(","));return{appId:a[1],capabilities:b}}),
function(a){return null!=a})},Lm=function(a){return Im(a,"__castClientId__")},Mm=function(a){return fb(a.l,function(a){return a.appId})},Nm=function(a){return a.b?a.b:chrome.cast.Eb.TAB_AND_ORIGIN_SCOPED};
Hm.prototype.toString=function(){var a=new mm;nm(a,"https");om(a,"google.com");qm(a,"/cast");var b=[];t(this.l,function(a){var c="__castAppId__="+a.appId;a.capabilities&&0<a.capabilities.length&&(c=c+"("+a.capabilities.join(","),c+=")");b.push(c)});this.a&&b.push("__castClientId__="+this.a);this.b&&b.push("__castAutoJoinPolicy__="+this.b);this.f&&b.push("__castDefaultActionPolicy__="+this.f);null!=this.g&&b.push("__castLaunchTimeout__="+this.g);this.v&&b.push("__dialAppName__="+this.v);this.o&&b.push("__dialPostData__="+
this.o);this.w&&b.push("__castInvisibleSender__=true");this.m&&(b.push("__castBroadcastNamespace__="+this.m),b.push("__castBroadcastId__="+Math.random()));this.h&&b.push("__castBroadcastMessage__="+encodeURIComponent(JSON.stringify(this.h)));sm(a,b.join("/"));return a.toString()};
var Pm=function(a,b){a=Mm(a);var c=Om(b);return hb(a,function(a){return mb(c,a)})},Qm=function(a){a=new mm(a);if("https"!=a.b||"google.com"!=a.nb||"/cast"!=a.a)return null;var b=a.f;a=Km(b);if(!a||0==a.length)return null;var c=Lm(b),d=Im(b,"__castAutoJoinPolicy__"),e=Im(b,"__castDefaultActionPolicy__"),f;f=Im(b,"__castLaunchTimeout__");null==f?f=null:(f=Number(f),f=!isNaN(f)&&0<=f?f:null);var g=Im(b,"__dialAppName__"),m=Im(b,"__dialPostData__"),q=Im(b,"__castInvisibleSender__"),q=null===q?null:"true"==
q,y=Im(b,"__castBroadcastNamespace__"),b=(b=Im(b,"__castBroadcastMessage__"))?JSON.parse(decodeURIComponent(b)):null;return new Hm(a,c,d,e,f,g,m,q,y,b)},Om=function(a){return(a=Qm(a))?Mm(a):null},Rm=function(a){return(a=Qm(a))?a.a:null},Jm=/(^\w+)(?:\(([\w,\ ]*)\))?$/;var Sm=function(a,b,c,d,e,f){this.f=a;this.m=b;this.l=c;this.a=d;this.h=e;this.g=f;this.b=new fm(f,c);this.u=new Rl(this.f);this.A=new cm(this.f)};Sm.prototype.init=function(){this.l.init();this.b.listen("v2_message",this.o.bind(this));this.b.listen("app_message",this.w.bind(this));this.b.listen("leave_session",this.v.bind(this))};
var Vm=function(a,b,c,d){Tm(a.a,b).slice().forEach(function(b){b!=d&&Um(a,b,c)})},Um=function(a,b,c){c.clientId=b;km(a.b,b,c)},Wm=function(a,b,c,d){c={receiver:Ul(c),action:d};Um(a,b,new em("receiver_action",c))};
Sm.prototype.o=function(a){var b=a.message,c=b.sessionId;if(c){var d=Xm(this.a,c);if(d)if(c=Ym(this.a,c))if(c=this.m.b(c))switch(b.type){case "STOP":Zm(this,a,c);break;case "LOAD":case "PAUSE":case "PLAY":case "SEEK":case "STOP_MEDIA":case "MEDIA_SET_VOLUME":case "MEDIA_GET_STATUS":case "EDIT_TRACKS_INFO":case "QUEUE_LOAD":case "QUEUE_INSERT":case "QUEUE_UPDATE":case "QUEUE_REMOVE":case "QUEUE_REORDER":case "PRECACHE":$m(this,a,c,d);break;case "SET_VOLUME":an(this,a,c);break;default:w(bn,"Unknown request")}else cn(this,
a,chrome.cast.Gb.INVALID_PARAMETER,"No receiver");else cn(this,a,chrome.cast.Gb.INVALID_PARAMETER,"No sink ID");else cn(this,a,chrome.cast.Gb.INVALID_PARAMETER,"Unknown session ID")}else cn(this,a,chrome.cast.Gb.INVALID_PARAMETER,"No session ID")};
var cn=function(a,b,c,d){c=new chrome.cast.Error(c,d);dn(a,b,c)},dn=function(a,b,c){km(a.b,b.clientId,new em("error",c,b.sequenceNumber))},Zm=function(a,b,c){var d=b.message;Bg("MediaRouter.Cast.Session.End");var e=d.sessionId,f=en(a.a,e);f&&(f.g=!0);f=function(){fn(a,e,b)};a.f.sendRequest(d,c,Kj,b.timeoutMillis,b.clientId).then(f,f)},$m=function(a,b,c,d){var e=b.message,f=e.type;f in rl&&(e.type=rl[f]);a.f.sendRequest(e,c,Mj,b.timeoutMillis,b.clientId,d.transportId).then(function(c){var e=d.sessionId;
c.sessionId=e;gn(a.a,e,hn(c.status,e));km(a.b,b.clientId,new em("v2_message",c,b.sequenceNumber))},function(c){dn(a,b,c)})},an=function(a,b,c){var d=b.message;delete d.sessionId;a.f.sendRequest(d,c,Kj,b.timeoutMillis,b.clientId).then(function(){km(a.b,b.clientId,new em("v2_message",null,b.sequenceNumber))},function(c){dn(a,b,c)})};
Sm.prototype.w=function(a){var b=this,c=a.message,d=c.sessionId;if(d){var e=Ym(this.a,d);e?(e=this.m.b(e))?(d=Xm(this.a,d),kb(d.namespaces,function(a){return a.name==c.namespaceName})?Dl(this.h,e,c.namespaceName,c.message,a.clientId,d.transportId).then(function(){km(b.b,a.clientId,new em("app_message",null,a.sequenceNumber))},function(){cn(b,a,chrome.cast.Gb.CHANNEL_ERROR,"Channel to receiver not available")}):cn(this,a,chrome.cast.Gb.INVALID_PARAMETER,"Invalid namespace")):w(bn,"No receiver from sinkId"):
w(bn,"No sinkId from sessionId")}else w(bn,"No sessionId")};
Sm.prototype.v=function(a){var b=this;x(bn,"Leave session");var c=en(this.a,a.message);if(c){var d=a.clientId,e=gm(this.l,d);if(e){var f=[],g=[],m=e.tabId,q=e.origin,y=e.autoJoinPolicy;c.b.forEach(function(a){var c=gm(b.l,a);y==chrome.cast.Eb.TAB_AND_ORIGIN_SCOPED&&m==c.tabId&&q==c.origin||y==chrome.cast.Eb.ORIGIN_SCOPED&&q==c.origin?(c.b=!0,f.push(a)):g.push(a)});km(this.b,d,new em("leave_session",null,a.sequenceNumber));f.forEach(function(a){(a=gm(b.l,a))&&jn(b.g,a.routeId,!0,!0)});c.b=g}else w(bn,
"No client record")}else w(bn,"No session")};
var kn=function(a,b,c){$l(b)&&a.f.sendRequest(new sl,c,Mj,void 0,void 0,b.transportId).catch(pa)},gl=function(a,b,c){var d=b.getId();x(bn,"Query status for "+d);Sl(a.u,b).then(function(e){ln(a,d,e);c&&(e=mn(a.a,d))&&kn(a,e,b)},pa)},nn=function(a,b){if("*"==b.destinationId)return!0;b=b.destinationId;if(b==a.h.h||null!=gm(a.l,b))return!0;x(bn,"Invalid destination "+b);return!1},sn=function(a,b,c){z(bn,function(){return"Cast message: "+JSON.stringify(c)});if(nn(a,c))if(c.namespace_==Lj||c.namespace_==
Nj)(b=on(a.a,b))&&b.a.forEach(function(b){var d=a.g,e=d.f.get(b);e&&e.Bc&&d.b.oe(d,b,c)});else{var d=JSON.parse(c.data),e=pn(a,d),e=e?e.sourceId:void 0;switch(d.type){case "RECEIVER_STATUS":ln(a,b,d);break;case "MEDIA_STATUS":qn(a,b,c,e)}}else rn(a.h,b,c.destinationId,c.sourceId,!1)},pn=function(a,b){a=zl(a.f.a,b.requestId);if(!a)return null;var c=a.wa;switch(b.type){case "LAUNCH_ERROR":case "INVALID_REQUEST":case "LOAD_CANCELLED":case "LOAD_FAILED":case "INVALID_PLAYER_STATE":delete b.requestId;
b=new chrome.cast.Error(chrome.cast.Gb.SESSION_ERROR,b.reason||b.type,b);c.b(b);break;default:c.resolve(b)}return a},tn=function(a,b,c){z(bn,function(){return"App message: "+JSON.stringify(c)});if(b=mn(a.a,b)){var d;"*"==c.destinationId?d=Tm(a.a,b.sessionId):d=[c.destinationId];var e=new Ql(b.sessionId,c.namespace_,c.data);d.forEach(function(b){km(a.b,b,new em("app_message",e))})}else w(bn,"No session for incoming app message")},hn=function(a,b){a.forEach(function(a){a.sessionId=b;var c=a.supportedMediaCommands,
e=[];c&1&&e.push(chrome.cast.media.fd.PAUSE);c&2&&e.push(chrome.cast.media.fd.SEEK);c&4&&e.push(chrome.cast.media.fd.STREAM_VOLUME);c&8&&e.push(chrome.cast.media.fd.STREAM_MUTE);a.supportedMediaCommands=e});return a},un=function(a,b){if(b=mn(a.a,b)){b=b.sessionId;var c=en(a.a,b);c&&c.g||fn(a,b)}},fn=function(a,b,c){c&&Um(a,c.clientId,c);(c=en(a.a,b))&&c.a.slice().forEach(function(b){jn(a.g,b,!0)});vn(a.a,b)},ln=function(a,b,c){z(bn,"Receiver status for "+b);var d=c.status;if(d)if(c=a.m.b(b)){var d=
Wl(c,d),e=on(a.a,b);e?d?d.sessionId==e.session.sessionId?(b=e.session,Yl(b,d)&&(z(bn,"Updating session "+d.sessionId),b.statusText=d.statusText,b.namespaces=d.namespaces,b.receiver.volume=d.receiver.volume,wn(a.g,e),Vm(a,b.sessionId,new em("update_session",b)))):(un(a,b),Fk(1),xn(a.g,null,c,null,d)):(un(a,b),Fk(1)):d&&xn(a.g,null,c,null,d)}else Bg("MediaRouter.Cast.Error.Sink.Missing.From.Discovery.Service"),w(bn,"Got message from receiver "+b+", but sink is no longer available.")},qn=function(a,
b,c,d){if(b=mn(a.a,b))if(c=JSON.parse(c.data))b=b.sessionId,c.sessionId=b,gn(a.a,b,hn(c.status,b)),Vm(a,c.sessionId,new em("v2_message",c),d)},yn=function(a,b){var c=Xl(b.a);return(b=kb(a.l,function(a){return ib(a.capabilities,function(a){return mb(c,a)})}))?b.appId:Mm(a)[0]},zn=function(a,b,c){var d=Qm(b);if(!d)return Promise.reject(Error("Invalid source "+b));var e=yn(d,c),f=new sg("MediaRouter.Cast.Session.Launch");return dm(a.A,new chrome.cast.fg(e,void 0,null==d.g?chrome.cast.timeout.requestSession:
d.g),c).then(function(a){x(bn,"Launched session "+a.sessionId+" for appId "+e);f.a("Success");return a},function(a){bn.error("Failed to session for appId "+e);f.a("Failure");throw a;})},bn=v("mr.cast.ApiHandler");var An=function(a,b){if(!chrome.runtime.lastError)return null;a=a+" failed, chrome.runtime.lastError: "+(chrome.runtime.lastError.message||"Unknown error");b&&z(b,a);return Error(a)};var Bn=function(){this.b=new C;this.f=new C;this.a=new C},Gn=function(a,b,c){c=void 0===c?!1:c;var d=b.getId(),e=b.Ea()+":"+b.ta(),f=a.b.get(d);if(f){if(a.a.get(d)==e)return z(Cn,"Using pending creation to "+d),f;x(Cn,"Device "+d+" IP changed from "+a.a.get(b.getId())+" to "+e);Dn(a,b)}b=En(a,b,c?15E3:1E4).then(function(b){Fn(a,d);Gk(1);return b},function(b){e==a.a.get(d)&&Fn(a,d);Gk(0);return Promise.reject(b)});a.b.set(d,b);a.a.set(d,e);return b},Dn=function(a,b){b=b.getId();z(Cn,"Aborting connection to device "+
b);var c=a.f.get(b);c&&c.abort();Fn(a,b)},Fn=function(a,b){a.b.remove(b);a.f.remove(b);a.a.remove(b)},En=function(a,b,c){var d=new De(function(){return Hn(b,c)},1E3,3);a.f.set(b.getId(),d);return Fe(d,1.5).start().then(null,function(a){x(Cn,"Failed to create channel to "+b.getId());return Promise.reject(a)})},Hn=function(a,b){var c=In++;x(Cn,"Connecting to (id "+c+") "+a.getId());var d=new sg("MediaRouter.Cast.Mdns.Channel.Open");return Jn(a,b).then(function(a){x(Cn,function(){return"Channel opened (id "+
c+"): "+JSON.stringify(a)});d.a("Success");return a},function(a){x(Cn,"Channel did not open (id "+c+").");d.a("Failure");return Promise.reject(a)})},Jn=function(a,b){var c={ipAddress:a.Ea(),port:a.ta(),auth:"ssl_verified",timeout:1E4,livenessTimeout:b,pingInterval:5E3,capabilities:0};x(Cn,function(){return"Opening channel to "+JSON.stringify(c)});var d=new Qc;chrome.cast.channel.open(c,function(a){a?"open"==a.readyState?d.resolve(a):(An("chrome.cast.channel.open",Cn),chrome.cast.channel.close(a,function(){An("chrome.cast.channel.close",
Cn)}),d.b(Error(a.errorState))):(a=An("chrome.cast.channel.open",Cn),d.b(a))});return d.a},Cn=v("mr.cast.ChannelFactory"),In=0;var Kn=function(a,b,c,d){return{namespace_:a,data:va(b)?b:JSON.stringify(b),sourceId:c,destinationId:d}};var Ln=function(a){this.type="CLOSE";this.reasonCode=a};var Mn=function(a){return(a=a.exec(Ib))?a[1]:""},Nn=function(){if(Vj)return Mn(/Firefox\/([0-9.]+)/);if(ic||jc||hc)return Bc;if(Zj)return cc()||Lb("iPad")||Lb("iPod")?Mn(/CriOS\/([0-9.]+)/):Mn(/Chrome\/([0-9.]+)/);if(ak&&!(cc()||Lb("iPad")||Lb("iPod")))return Mn(/Version\/([0-9.]+)/);if(Wj||Xj){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(Ib);if(a)return a[1]+"."+a[2]}else if(Yj)return(a=Mn(/Android\s+([0-9.]+)/))?a:Mn(/Version\/([0-9.]+)/);return""}();var Pn=function(a){this.type="CONNECT";this.origin={};this.userAgent=Ib;var b=this.userAgent.indexOf("(")+1,b=this.userAgent.substr(b,this.userAgent.indexOf(")",b)-1-b+1);this.senderInfo={sdkType:2,version:chrome.runtime.getManifest().version,browserVersion:Nn,platform:On(),systemVersion:b,connectionType:1};this.connType=a?0:2},On=function(){switch(jg()){case "ChromeOS":return 5;case "Windows":return 3;case "Mac":return 4;case "Linux":return 6}return 0};var Qn=function(){this.a=new C};Qn.prototype.init=function(){Xh(this)};var Rn=function(a,b,c,d,e){if(!a.a.Ra([b.channelId,c,d].join("#"))){var f=Kn(Jj,new Pn(e),c,d);chrome.cast.channel.send(b,f,a.b.bind(a));a.a.set([b.channelId,c,d].join("#"),e)}};Qn.prototype.b=function(){An("chrome.cast.channel.send",Sn)};
var Tn=function(a,b){a.a.La().forEach(function(c){c.split("#")[0]==b.channelId.toString()&&a.a.remove(c)})},Un=function(a,b,c){a.a.forEach(function(d,e){var f=e.split("#");f[0]==b.channelId.toString()&&(Rn(a,c,f[1],f[2],d),a.a.remove(e))})};Qn.prototype.ea=function(){return"cast.VirtualConnectionManager"};Qn.prototype.pa=function(){var a=qi(this.a);return[new Vn(a)]};Qn.prototype.ua=function(){var a=Uh(this);if(a)for(var b in a.a)this.a.set(b,a.a[b])};qa(Qn);
var Sn=v("mr.cast.VirtualConnectionManager"),Vn=function(a){this.a=a};var Wn=function(a,b){this.g=b;this.h=a;this.b=new C;this.a=new C;this.f=Qn.S();this.m=new Bn;this.l=null};ka(Wn,Vg);Wn.prototype.handleEvent=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];a==chrome.cast.channel.onMessage?this.v.apply(this,[].concat(la(c))):a==chrome.cast.channel.onError&&this.w.apply(this,[].concat(la(c)))};Wn.prototype.init=function(){this.f.init();Xh(this);eh("mr.cast.ChannelService",this);Rk().forEach(function(a){return a.addListener()})};
var Dl=function(a,b,c,d,e,f){var g=e||a.h,m=f||"receiver-0";return il(a,b).then(function(b){return Xn(a,b,c,d,g,m)})},Yn=function(a,b,c,d,e){il(a,b).then(function(b){return Rn(a.f,b,c,d,e)})},rn=function(a,b,c,d,e){if(b=a.b.get(b))a=a.f,a.a.Ra([b.channelId,c,d].join("#"))&&(a.a.remove([b.channelId,c,d].join("#")),c=Kn(Jj,new Ln(e?5:0),c,d),chrome.cast.channel.send(b,c,a.b.bind(a)))};
Wn.prototype.v=function(a,b){var c=this.a.get(a.channelId);if(c){var d=this.l(c);if(d){if(Pj.hasOwnProperty(b.namespace_)){var e=JSON.parse(b.data);switch(e.type){case "CLOSE":this.f.a.remove([a.channelId,b.destinationId,b.sourceId].join("#"));return;case "RPC":break;default:z(Zn,function(){return"Got message "+(e.type||e.responseType)+" "+("from "+d.getId())})}}else z(Zn,"Got message in "+b.namespace_+" from "+d.getId());$n(this.g,d,b)}else w(Zn,"Got message for unknown receiver (receiverId="+c+
").")}else w(Zn,"Got message for unknown channel (channelId="+a.channelId+").")};var ao=function(a,b){chrome.cast.channel.close(b,function(){chrome.runtime.lastError||z(Zn,"Channel close success")});var c=a.a.get(b.channelId);c&&(a.a.remove(b.channelId),a.b.remove(c))};Wn.prototype.w=function(a,b){w(Zn,function(){return"Channel error: "+JSON.stringify(a)+(b?", "+JSON.stringify(b):"")});b&&bo(b);co(this,a)};
var bo=function(a){var b;switch(a.errorState){case "unknown":b=0;break;case "authentication_error":b=1;break;case "connect_error":b=2;break;case "connect_timeout":b=6;break;case "ping_timeout":b=7;break;default:return}if(-8192<=a.nssErrorCode&&-7192>a.nssErrorCode||2==a.challengeReplyErrorType||8==a.challengeReplyErrorType||9==a.challengeReplyErrorType||11==a.challengeReplyErrorType||-200>=a.netReturnValue&&-300<a.netReturnValue||30==a.eventType||31==a.eventType||32==a.eventType)b=3;if(26==a.eventType||
-201==a.netReturnValue||-8181==a.nssErrorCode||-8162==a.nssErrorCode||-8161==a.nssErrorCode)b=4;-138==a.netReturnValue&&(b=5);if(-8182==a.nssErrorCode||10==a.eventType||12==a.eventType)b=1;w(Zn,"Channel error code: "+b);Cg("MediaRouter.Cast.Channel.Error",b,Dk)},co=function(a,b){var c=a.a.get(b.channelId);ao(a,b);if(c){var d=a.l(c);d&&il(a,d,!0).then(function(c){x(Zn,"Re-connected to receiver: "+d.getId());Un(a.f,b,c);gl(a.g.l,d,!0)},function(){x(Zn,"Failed to re-connect to receiver: "+d.getId());
Tn(a.f,b);var c=a.g.a,f=d.getId();x(c.j,"Channel error for sink "+f);cl(c,f);Fk(2)})}},il=function(a,b,c){c=void 0===c?!1:c;var d=b.getId(),e=a.b.get(d);return e&&"open"==e.readyState?Promise.resolve(e):Gn(a.m,b,c).then(function(b){if(a.a.Ra(b.channelId))return b;a.b.get(d)&&(w(Zn,"Duplicate channel to a receiver "+d),ao(a,a.b.get(d)));x(Zn,"Connected to: "+d);a.b.set(d,b);a.a.set(b.channelId,d);return b},null)},Xn=function(a,b,c,d,e,f){Rn(a.f,b,e,f,0==f.indexOf("receiver-0"));Zl(d);var g=Kn(c,d,
e,f);"object"===typeof d&&"RPC"==d.type||z(Zn,function(){return"Channel is sending message: "+JSON.stringify(g)});return new Promise(function(c,d){chrome.cast.channel.send(b,g,function(b){b?b.errorState?(d(Error("Failed to send message")),co(a,b)):c(!0):(b=An("chrome.cast.channel.send",Zn),d(b))})})};Wn.prototype.ea=function(){return"cast.ChannelService"};Wn.prototype.pa=function(){return[new eo(qi(this.b),qi(this.a))]};Wn.prototype.ua=function(){var a=Uh(this);a&&(mi(this.b,a.b),mi(this.a,a.a))};
var Zn=v("mr.cast.ChannelService"),eo=function(a,b){this.b=a;this.a=b};var fo=function(){this.requestId=0;this.type="GET_APP_AVAILABILITY";this.appId=[]};var go=function(a,b){this.g=a;this.b=b;this.f=new zi;this.a=new C};go.prototype.init=function(){Xh(this)};var ho=function(a,b){var c=a.a.get(b);c&&(c.Bf--,0<c.Bf||(ji(a.b.a.Na(!1),function(a){switch(yk(a,b)){case "available":a.eb[b]="available_rescan";break;case "unavailable":a.eb[b]="unavailable_rescan"}}),a.a.remove(b)))};h=go.prototype;
h.ah=function(a){var b=this;ji(this.a.Na(!0),function(c){var d;a:{switch(yk(a,c)){case "unknown":case "available_rescan":case "unavailable_rescan":d=!0;break a}d=!1}if(d){var e=a.getId()+":"+c;b.f.contains(e)||(b.f.add(e),d=function(){b.f.remove(e)},Fe(new De(b.Jj.bind(b,a,c),5500,3),2).start().then(b.Yh.bind(b,a,c),function(){b.j.error("Failed to get app availability response for "+a.getId()+", appId "+c+" after 3 attempts.");b.Yh(a,c,"unknown")}).then(d,d))}})};
h.Yh=function(a,b,c){c!=yk(a,b)&&(x(this.j,b+" on "+a.getId()+" is "+c),a.eb[b]=c,el(this.b.g,a))};
h.Jj=function(a,b){var c=this,d=new fo;d.appId=[b];var e=new sg("MediaRouter.Cast.App.Availability");return this.g.sendRequest(d,a,Kj,5E3).then(function(a){e.a("Success");z(c.j,function(){return"App availability response "+JSON.stringify(a)});for(var b in a.availability){if("APP_AVAILABLE"==a.availability[b])return"available";if("APP_UNAVAILABLE"==a.availability[b])return"unavailable"}return"unknown"},function(d){e.a("Failure");c.j.error("checkAppAvailability_ failed for "+a.getId()+", appId "+b);
throw d;})};h.ea=function(){return"cast.AppDiscoveryService"};h.pa=function(){return[new io(qi(this.a))]};h.ua=function(){var a=Uh(this);a&&mi(this.a,a.a)};h.j=v("mr.cast.AppDiscoveryService");var io=function(a){this.a=a};var jo=function(a,b,c){var d;d=Error.call(this);this.message=d.message;"stack"in d&&(this.stack=d.stack);this.name="RouteRequestError";this.message=b||"";if(c)this.stack=c;else if(Error.captureStackTrace)Error.captureStackTrace(this,jo);else if(b=Error().stack)this.stack=b;this.errorCode=a};ka(jo,Error);var ko=function(a,b){this.sinks=a;this.origins=b||null},lo=new ko([]);var mo=function(a,b,c,d){return Ej(c,"cast",b.getId(),a,d,"",null)};var no=function(a,b,c,d,e,f){this.routeId=a;this.clientId=b;this.appIds=c;this.autoJoinPolicy=d;this.origin=e;this.tabId=f;this.b=this.a=!1},oo=function(){this.a=[]};oo.prototype.init=function(){Xh(this)};oo.prototype.fa=function(){return this.a.length};var gm=function(a,b){return kb(a.a,function(a){return a.clientId==b})},po=function(a,b){return kb(a.a,function(a){return a.routeId==b})},qo=function(a,b){a.a=eb(a.a,function(a){return a.clientId!=b})};oo.prototype.ea=function(){return"cast.ClientRecords"};
oo.prototype.pa=function(){return[new ro(this.a)]};oo.prototype.ua=function(){var a=Uh(this);a&&(this.a=a.a)};var ro=function(a){this.a=a};var so=function(a){this.a=a},to=function(){var a=[];ok.S().l.forEach(function(b){var c="Receiver-"+b.replace(/\./g,"_"),d=ok.S().f||8009;a.push({serviceName:c+"._googlecast._tcp.local",serviceHostPort:c+":"+d,ipAddress:b,serviceData:["id=mdns:"+c,"ve=02","ca=5","st=1","fn="+c,"md=Chromecast"]})});return a};so.prototype.init=function(){var a=to(),b=this.a;b.J(a);b.aa=a};var uo=chrome.i18n.getMessage("4528089202128275824");chrome.i18n.getMessage("2810417817914017289");chrome.i18n.getMessage("3413021810593924462");chrome.i18n.getMessage("7603034707785674700");chrome.i18n.getMessage("8009014317872238527");chrome.i18n.getMessage("8636962961150071298");chrome.i18n.getMessage("1802762746589457177");var vo=function(a,b){this.b=[];this.a=[];this.sinkId=a;this.session=b;this.l=this.f=null;this.offTheRecord=this.g=!1},wo=function(){this.j=v("mr.cast.SessionRecords");this.a=[]};wo.prototype.init=function(){Xh(this)};
var vn=function(a,b){x(a.j,"Removing session "+b);a.a=eb(a.a,function(a){return a.session.sessionId!=b})},Tm=function(a,b){return(a=en(a,b))?a.b:[]},mn=function(a,b){return(a=on(a,b))?a.session:null},xo=function(a,b){return kb(a.a,function(a){return mb(a.b,b)})},yo=function(a,b){return kb(a.a,function(a){return mb(a.a,b)})},zo=function(a,b){return kb(a.a,function(a){return null!=kb(a.a,function(a){return Cj(a).a==b})})},on=function(a,b){return kb(a.a,function(a){return a.sinkId==b||a.f==b})},en=function(a,
b){return kb(a.a,function(a){return a.session.sessionId==b})},Ym=function(a,b){return(a=en(a,b))?a.sinkId:null},Xm=function(a,b){return(a=en(a,b))?a.session:null},gn=function(a,b,c){var d=Xm(a,b);d&&(a=eb(c,function(a){return a.playerState!=chrome.cast.media.He.IDLE}),a.forEach(function(a){if(!a.media){var b=kb(d.media,function(b){return b.mediaSessionId==a.mediaSessionId});b&&(a.media=b.media)}}),d.media=a)};wo.prototype.ea=function(){return"cast.SessionRecords"};wo.prototype.pa=function(){return[new Ao(this.a)]};
wo.prototype.ua=function(){var a=Uh(this);if(a)for(var b=0;b<a.a.length;b++){var c=a.a[b],d=new vo(c.sinkId,c.session);d.b=c.b;d.a=c.a;d.g=c.g;d.l=c.l;d.f=c.f;this.a.push(d)}};var Ao=function(a){this.a=a};var Bo=function(a){this.v="sender-"+Wa();this.f=new C;this.m=null;Xh(this);this.b=a;this.h=new oo;this.g=new wo;this.w=new Wn(this.v,this);this.a=new Tk(this.w,this);this.F=new so(this.a);this.u=new Al(this.w,this.v);this.A=new go(this.u,this.a);this.l=new Sm(this.u,this.a,this.h,this.g,this.w,this);this.B=new Kl(this.a,this.u);this.aa=this.a.start.bind(this.a);this.o=new Map};h=Bo.prototype;h.getName=function(){return"cast"};
h.Ga=function(){this.u.init();this.g.init();this.l.init();this.w.init();this.a.init();this.F.init();this.A.init();this.b.Af(this.aa)};h.fc=function(){var a=this.f.P(),b=[].concat(la(this.o.values())).map(function(a){return a.Cf.Ib()});return a.concat(b)};h.pd=function(a){var b=this;if(null!=Co(a))return new ko([]);var c=new zi;Do(a).forEach(function(a){kl(b.a,a).map(function(a){return a.b}).forEach(function(a){c.add(a)})});return new ko(c.P(),-1!=a.indexOf("0F5096E8")?Tg:null)};
h.startObservingMediaSinks=function(a){var b=this,c=Co(a);c?(x(this.j,"Received broadcast request "+a),ji(this.a.a.Na(!1),function(a){b.u.sendMessage(c,a,Oj).catch(function(a){b.j.error("Broadcast failed "+a.message)})})):(Do(a).forEach(function(a){var c=b.A,d=c.a.get(a);d?d.Bf++:c.a.set(a,{Bf:1});x(c.j,"Scanning sinks for app availability");ji(c.b.a.Na(!1),c.ah,c)}),this.b.ef()&&this.a.start())};h.stopObservingMediaSinks=function(a){var b=this;null!=Co(a)||Do(a).forEach(function(a){ho(b.A,a)})};
h.startObservingMediaRoutes=function(){};h.stopObservingMediaRoutes=function(){};h.wd=function(a){return(a=this.a.b(a))?a.b:null};
var Eo=function(a,b,c){a.j.error("Error launching.",c);jn(a,b.id,!1,!0,"error");c=new $f(uo,"warning","dismiss");c.routeId=b.id;a.b.Qc().send(c)},Jo=function(a,b,c,d,e,f,g,m){ok.S().b=new nk(c.gb,c.Ea());var q=mo(b,c,d,!0);q.forDisplay=!1;q.offTheRecord=e;a.f.set(q.id,q);a.b.ic(a,q);Fo(a);(e=Qm(b))&&e.a&&Go(a,e,q.id,g,m);Rg(b)||Sg(b)?(q.kb={tabId:m,sessionId:"",Be:c.Ea()||"",Ce:c.gb||""},Sg(b)&&(q.isOffscreenPresentation=!0),a.b.ff(a,q,d,function(e){return fg(Ho(a,b,c,d,f,g,m,e))}).a.then(function(){Io(a,
q)},function(b){Eo(a,q,b)})):Ho(a,b,c,d,f,g,m,q).then(null,function(b){Eo(a,q,b)});return Promise.resolve(q)},Ho=function(a,b,c,d,e,f,g,m){return zn(a.l,Ko(b,c,e),c).then(function(e){xn(a,b,c,d,e,f,g,m);return m})};
Bo.prototype.createRoute=function(a,b,c,d,e,f,g){var m=this,q=this.a.b(b);if(!q)return eg(Error("No sink with ID "+b));var y=Lm(a);if(y){setTimeout(function(){Wm(m.l,y,q,chrome.cast.gd.CAST)},0);var D=function(){return Jo(m,a,q,c,d,e,f,g)},T=gm(this.h,y);if(T)return fg(this.terminateRoute(T.routeId).then(D,D));if(f&&g&&(b=Lo(this,a,f,g,d,e,b)))return b}return fg(Jo(this,a,q,c,d,e,f,g))};
var jn=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?"closed":e;x(a.j,"Remove route "+b);var f=po(a.h,b);if(f){c=c||f.b;var g=f.clientId;x(a.j,"Remove client "+g);for(var m=a.g,q=0;q<m.a.length;q++)tb(m.a[q].b,g);qo(a.h,g)}if(g=yo(a.g,b))tb(g.a,b),Mo(a,g.a);if(m=a.f.get(b))if(m.Bc&&g&&(rn(a.w,m.sinkId,f?f.clientId:a.v,g.session.transportId,c),m.forDisplay&&f&&(a.m={Ac:f,Lh:g})),a.f.remove(b),a.b.Rc(a,m),Fo(a),d)a.b.onPresentationConnectionClosed(b,e,"Remove route");else a.b.onPresentationConnectionStateChanged(b,
"terminated")},wn=function(a,b){b.a.forEach(function(c){if(c=a.f.get(c)){var d=b.session;c.kb&&c.forDisplay?Io(a,c):(c.description=d.statusText||d.displayName,a.b.Tb(a,c))}})},No=function(a,b){hb(b,function(b){b=a.f.get(b,null);if(!b||!b.mediaSource)return!1;var c=Qm(b.mediaSource),c=c?c.w:!1;return b.isLocal&&!c})&&t(b,function(b){if(b=a.f.get(b,null))b.isLocal=!0})},Mo=function(a,b){var c=[],d=[],e=null;b.forEach(function(b){if(b=a.f.get(b)){b.forDisplay=!1;var f=Qm(b.mediaSource);f&&kb(Mm(f),bm)||
(b.Bc?(f=f?Nm(f):null,e||f==chrome.cast.Eb.CUSTOM_CONTROLLER_SCOPED||(c.push(b),e=b.sinkId)):e&&e!=b.sinkId?c.push(b):d.push(b))}});t(0<c.length?c:d,function(a){a.forDisplay=!0})},Go=function(a,b,c,d,e){var f=b.a;if(f&&!gm(a.h,f)){x(a.j,"Add client "+f);var g=Mm(b);a.h.a.push(new no(c,f,g,Nm(b),d||null,k(e)?e:null))}},Io=function(a,b){if(a=yo(a.g,b.id))a=a.session,a.statusText=b.description||a.statusText},xn=function(a,b,c,d,e,f,g,m){var q=on(a.g,c.getId());if(!q){var y=a.g,q=c.getId();x(y.j,"Adding new session: "+
q+", "+e.sessionId);var D=en(y,e.sessionId);D?(Vl(e)?(D.l=e,D.f=q):Vl(D.session)&&(D.l=D.session,D.f=D.sinkId,D.session=e,D.sinkId=q),q=D):(q=new vo(q,e),y.a.push(q))}var T=null!=b;if(!T&&bm(e.appId))return null;null==b?(D=new Hm([{appId:e.appId,capabilities:e.capabilities}]),b=D.toString()):D=Qm(b);if(y=m){if(!a.f.get(y.id))return w(a.j,"Route "+y.id+" not added"),y}else y=mo(b,c,d||e.sessionId,T),a.f.set(y.id,y);d=y.id;x(a.j,"Add route "+d);b=null;D&&(b=D.a,Go(a,D,d,f,g));mb(q.a,d)||q.a.push(d);
y.Bc&&Yn(a.w,c,b||a.v,e.transportId,!(D&&D.w));q.offTheRecord=y.offTheRecord;f=q.a;No(a,f);Mo(a,f);f=y;g=e.sessionId;d=e.appId;("0F5096E8"==d||"85CDB22F"==d)&&g&&f.kb&&(f.kb.sessionId=g);!$l(e)||null!==e&&mb(am,e.appId)||(f.customControllerPath="cast_route_details.html?"+["sessionId="+g,"appId="+d].join("&"));f.description=e.statusText||e.displayName;m?a.b.Tb(a,y):a.b.ic(a,y);Fo(a);if(m=b)mb(q.b,b)?m=!1:(q.b.push(b),m=!0);m&&(a=a.l,km(a.b,b,new em("new_session",e)),kn(a,e,c));return y};
Bo.prototype.terminateRoute=function(a){var b=this,c=this.f.get(a);if(!c)return Promise.reject(new jo(3,"Route in Cast provider not found for routeId  "+a));var d=yo(this.g,a);if(!d)return jn(this,a,!0),Promise.resolve();var e=d.session.sessionId,f=this.a.b(c.sinkId);if(!f)return fn(this.l,e),Promise.resolve();(a=po(this.h,a))&&Wm(this.l,a.clientId,f,chrome.cast.gd.STOP);Fk(0);return new Promise(function(a){var c=function(){un(b.l,f.getId());a()};b.u.sendRequest(new vl(e),f,Kj).then(c,c)})};
var Oo=function(a,b){var c=null;ki(a.f.Na(!1),function(d){if(!d.Bc)return!1;var e=a.a.b(d.sinkId);if(!e||!Pm(b,Ko(d.mediaSource,e)))return!1;c=d;return!0});if(!c||!c.mediaSource)return null;var d=Rm(c.mediaSource);if(!d)return null;var e=gm(a.h,d);return e?(d=xo(a.g,d))?{Ac:e,Lh:d}:null:null},Lo=function(a,b,c,d,e,f,g){var m=null;ki(a.f.Na(!1),function(a){var b=a.kb;return b&&null!=b.tabId&&b.tabId==d&&Pg(a.mediaSource)?(m=a,!0):!1});if(!m)return null;var q=function(){return a.createRoute(b,g||m.sinkId,
"",e,f,c,null==d?void 0:d)};return fg(a.terminateRoute(m.id).then(q,q))};h=Bo.prototype;h.connectRouteByRouteId=function(a,b,c,d,e){if(!Qm(a))return eg(Error("Unsupported presentation URL"));b=Cj(b);b=en(this.g,b.a);if(!b)return eg(Error("No matching route"));var f=this.a.b(b.sinkId);return f?(a=xn(this,a,f,c,b.session,d,e))?dg(a):eg(Error("Failed to create route")):eg(Error("No sink"))};
h.joinRoute=function(a,b,c,d,e,f){var g=Qm(a);if(!g)return eg(Error("Unsupported presentation URL"));var m;if(b==chrome.cast.Pf){a:{m=Oo(this,g);if(!m){if(!this.m||this.m.Ac.origin!=e||this.m.Ac.tabId!=f){m=null;break a}m=this.m}switch(Nm(g)){case chrome.cast.Eb.PAGE_SCOPED:m=null;break a;case chrome.cast.Eb.ORIGIN_SCOPED:if(e!=m.Ac.origin){m=null;break a}break;case chrome.cast.Eb.TAB_AND_ORIGIN_SCOPED:if(e!=m.Ac.origin||f!=m.Ac.tabId){m=null;break a}}m=en(this.g,m.Lh.session.sessionId)}if(!m&&(g.f?
g.f:chrome.cast.Td.CREATE_SESSION)!=chrome.cast.Td.CAST_THIS_TAB&&(d=Lo(this,a,e,f,c,d)))return d}else m=Po(this,b);if(!m)return eg(Error("No matching route"));if(m.offTheRecord!=c)return eg(Error("Off the record mismatch"));d=this.a.b(m.sinkId);if(!d)return eg(Error("No sink"));a=xn(this,a,d,b,m.session,e,f);a.offTheRecord=c;return dg(a)};h.detachRoute=function(a){jn(this,a,!1,!0)};
h.Gc=function(a){var b=new Ah,c=this.a.b(a);if(!c)return null;c=c.a;c&1||(b.shouldCaptureVideo=!1);c&4||(b.shouldCaptureAudio=!1);b.shouldCaptureAudio&&!b.shouldCaptureVideo&&(b.minLatencyMillis=b.maxLatencyMillis,b.animatedLatencyMillis=b.maxLatencyMillis);b.senderSideLetterboxing=!0;Bh(b);Object.freeze(b);x(this.j,function(){return"Settings for "+a+": "+zh(b)});return b.shouldCaptureAudio||b.shouldCaptureVideo?b:null};h.Fc=function(){return"cast_streaming"};
h.sendRouteMessage=function(a,b,c){var d=this,e=this.o.get(a);if(e)return"string"!==typeof b?Promise.reject("String-typed message required"):e.Cf.Ok(b);if(!c)return new Promise(function(a,c){"string"!==typeof b&&c(Error("Cannot send non-string messages via ApiHandler."));c=d.l.b;z(im,"Received: "+b);var e=JSON.parse(b),f=e.clientId;"client_connect"==e.type?(z(im,"App "+f),(e=gm(c.a,f))?(e.a=!0,(c=zl(c.b,e.routeId))&&c.wa.resolve(!0)):w(im,"Client not found "+f)):hm(c,f)?(c=c.f[e.type])&&c(e):w(im,
"No route for "+f);a()});var f=yo(this.g,a);if(!f)return Promise.reject(Error("Not managing the route "+a));var g=this.a.b(f.sinkId);if(!g)return Promise.reject(Error("Sink no longer accessible"));var m=(a=po(this.h,a))?a.clientId:this.v;return new Promise(function(a){Dl(d.w,g,c.namespace,b,m,f.session.transportId).then(a,a)})};h.sendRouteBinaryMessage=function(a,b){var c=this.o.get(a);return c?c.Cf.vl(b):Promise.reject(Error("Route "+a+" does not support sending binary data."))};
h.hd=function(a,b){var c=this.a.b(b);if(!c)return!1;a=Ko(a,c);return(a=Om(a))&&0!=a.length?hb(a,function(a){return Qj(yk(c,a))}):!1};h.yc=function(a,b,c){var d=Do(a);return d&&0!=d.length?b==chrome.cast.Pf?!0:c&&c.mediaSource?(a=Om(c.mediaSource),hb(a,function(a){return mb(d,a)})):void 0==b||Po(this,b)?!0:!1:!1};
var Ko=function(a,b,c){return Rg(a)||Sg(a)?(a={appId:0==(b.a&1)?"85CDB22F":"0F5096E8",capabilities:Xl(b.a)},(new Hm([a],void 0,void 0,void 0,c)).toString()):a},Do=function(a){var b=[];if(Rg(a)||Sg(a)){var c=jg();Qg(a)&&"ChromeOS"!=c&&"Windows"!=c||b.push("85CDB22F");b.push("0F5096E8")}else(a=Om(a))&&(b=wb(b,a));return b},Co=function(a){var b=Qm(a);if(!b)return null;a=Do(a);var c=b.m||"",b=b.h;return c&&b?new tl(a,c,JSON.stringify(b)):null},Po=function(a,b){return 0==b.indexOf(chrome.cast.dg)?en(a.g,
b.substr(chrome.cast.dg.length)):zo(a.g,b)},$n=function(a,b,c){var d=a.B;if(Ll(d)&&Pj.hasOwnProperty(c.namespace_)){var e=b.Ea();if(e){var f=JSON.parse(c.data);if("RECEIVER_STATUS"===f.type){var g=f.status&&f.status.applications&&f.status.applications[0],m=f=null;g&&(g.appId&&(f=g.appId),g.sessionId&&(m=g.sessionId));g=d.b.get(e);d.b.set(e,new Il(e,f,m));g&&g.appId===f||Ml(d)}}}a=a.l;b=b.getId();Pj.hasOwnProperty(c.namespace_)?sn(a,b,c):tn(a,b,c)};
Bo.prototype.K=function(a){if(0==this.a.a.fa())this.b.onSinkAvailabilityUpdated(this,0);var b=this.l;a=a.getId();(a=on(b.a,a))&&a.session&&fn(b,a.session.sessionId);Nl(this.B);this.b.Bb()};var el=function(a,b){a.A.ah(b);Nl(a.B);a.b.Bb()};h=Bo.prototype;h.ea=function(){return"cast.Provider"};h.pa=function(){return[new Qo(this.v,qi(this.f),this.m)]};h.ua=function(){var a=Uh(this);a&&(this.v=a.f,mi(this.f,a.b),this.m=a.a)};h.searchSinks=function(){return Fc()};h.createMediaRouteController=function(){return Fc()};
h.setMediaRouteStatusObserver=function(){};h.provideSinks=function(){};
var Fo=function(a){a.b.Vc(a.ea(),a.fc().some(function(a){return a.isLocal}))},To=function(a){var b=Ro(),c=a.Ib();if(b.o.has(c.id))throw Error("Cannot re-register for same route ID: "+c.id);x(b.j,"Registering remoter with route: "+c.id);a=new So(a);b.o.set(c.id,a);b.b.ic(b,c);Fo(b);a.a=function(a){return b.b.Jb(b,c.id,a)};return a},Uo=function(a){var b=Ro();a=a.Ib();var c=b.o.get(a.id);c&&(x(b.j,"Unregistering remoter with route: "+a.id),c.a=null,b.o.delete(a.id),b.b.Rc(b,a),Fo(b))};
Bo.prototype.j=v("mr.CastProvider");var So=function(a){this.Cf=a;this.a=null},Vo=function(a,b){a.a&&a.a(b)},Qo=function(a,b,c){this.f=a;this.b=b;this.a=c};var Wo=function(a,b){this.routeId=a;this.message=b},Xo=function(a){return"string"!=typeof a.message};var Yo=function(a,b){this.input=a;this.domain=b};var Zo=function(a){this.o=a;this.g=this.l=null},$o=function(a){if(null==a.g)if(null==a.l||Date.now()-a.l>=a.o)a.h();else{var b=Math.max(a.l+a.o-Date.now(),5);a.g=setTimeout(a.h.bind(a),b)}};Zo.prototype.h=function(){null!=this.g&&(clearTimeout(this.g),this.g=null);this.v();this.l=Date.now()};Zo.prototype.v=function(){};var ap=function(a,b){Zo.call(this,20);this.a=new Map;this.b=new Set;this.w=null;this.m=this.f=0;this.u=!1;this.B=a;this.A=b;this.j=v("mr.RouteMessageSender")};ka(ap,Zo);ap.prototype.init=function(a){this.w=a;Xh(this)};ap.prototype.stopListeningForRouteMessages=function(a){this.b.delete(a)};
ap.prototype.send=function(a,b){var c=this.a.get(a);c||(c=[],this.a.set(a,c));b=new Wo(a,b);c.push(b);50<c.length&&1==c.length%50&&w(this.j,function(){return"Message queue length is excessively large ("+c.length+") for route "+a});this.f+=Xo(b)?0:b.message.length;Xo(b)&&this.m++;bp(this);this.b.has(a)&&$o(this)};
var cp=function(a,b){if(0!=b.length){b=ja(b);for(var c=b.next();!c.done;c=b.next())c=c.value,a.f-=Xo(c)?0:c.message.length,Xo(c)&&a.m--}},bp=function(a){var b=0<a.m||a.f>a.A;b!=a.u&&(a.u=b,a.B.Vc(a.ea(),b))};ap.prototype.v=function(){if(this.w){for(var a=ja(this.b),b=a.next();!b.done;b=a.next()){var b=b.value,c=this.a.get(b);c&&0!=c.length&&(this.w(b,c),cp(this,c),this.a.set(b,[]))}bp(this)}else this.j.error("sendMessagesCallback not set. Messages not delivered.")};ap.prototype.ea=function(){return"mr.RouteMessageSender"};
ap.prototype.pa=function(){var a=[].concat(la(this.a.entries())).map(function(a){return[a[0],a[1].map(function(a){return a.message})]});return[new dp(a,Array.from(this.b),this.f)]};ap.prototype.ua=function(){var a=Uh(this);if(a){this.a=new Map;for(var b={},c=ja(a.b),d=c.next();!d.done;b={routeId:b.routeId},d=c.next())d=d.value,b.routeId=d[0],d=d[1].map(function(a){return function(b){return new Wo(a.routeId,b)}}(b)),this.a.set(b.routeId,d);this.b=new Set(a.a);this.f=a.f}};
var dp=function(a,b,c){this.b=a;this.a=b;this.f=c};var ep=function(a,b,c){kd.call(this);this.g=null!=c?n(a,c):a;this.f=b;this.b=n(this.Tj,this);this.a=[]};r(ep,kd);h=ep.prototype;h.Jc=!1;h.ud=0;h.dc=null;h.bf=function(a){this.a=arguments;this.dc||this.ud?this.Jc=!0:fp(this)};h.stop=function(){this.dc&&(xe(this.dc),this.dc=null,this.Jc=!1,this.a=[])};h.pause=function(){this.ud++};h.resume=function(){this.ud--;this.ud||!this.Jc||this.dc||(this.Jc=!1,fp(this))};h.X=function(){ep.W.X.call(this);this.stop()};
h.Tj=function(){this.dc=null;this.Jc&&!this.ud&&(this.Jc=!1,fp(this))};var fp=function(a){a.dc=we(a.b,a.f);a.g.apply(null,a.a)};var gp=function(a){this.a=a;this.j=v("mr.ExternalMessageHandler")};
gp.prototype.onMessage=function(a,b,c){var d=this;x(this.j,"Received a message from "+b.id+" type: "+a.type);var e=chrome.runtime.id;"start"==a.type?(a=a.message,this.a.searchSinks("pseudo:cloud","urn:x-org.chromium.media:source:desktop",new Yo(a.meetingName,a.domain)).then(function(a){var f="PresentationId"+b.id+hp++;d.a.createRoute("urn:x-org.chromium.media:source:desktop",a,f).then(function(a){c(new Ge(e,"route",a.id))}).catch(function(a){c(new Ge(e,"error",a))})},function(){c(new Ge(e,"error",
Error("Failed to find sink.")))})):"stop"==a.type?this.a.terminateRoute(a.message.routeId).then(function(){c(new Ge(e,"stopped"))}):(c(new Ge(e,"error",Error("Unhandled message type"))),this.j.error("Unhandled message type "+a.type))};var hp=0;var ip=function(a){if(0>=a)throw Error("invalid buffer size");this.a=[];this.b=[];this.f=a},jp=function(a,b){if(a.fa()>=a.f){if(a.jb())throw Error("Empty queue");0==a.a.length&&(a.a=a.b,a.a.reverse(),a.b=[]);a.a.pop()}a.b.push(b)};ip.prototype.fa=function(){return this.a.length+this.b.length};ip.prototype.jb=function(){return 0==this.fa()};ip.prototype.P=function(){var a=this.a.slice();a.reverse();a.push.apply(a,[].concat(la(this.b)));return a};ip.prototype.clear=function(){this.a=[];this.b=[]};var kp=function(){this.a=new ip(1E3);this.b=Date.now()};kp.prototype.init=function(){Ic=1;var a=v("browser"),b=window.onerror;window.onerror=function(c,e,f,g,m){b&&b(c,e,f,g,m);a.error("Error: "+c+" ("+e+" @ Line: "+f+")",m)};Jc.push(this.g.bind(this));var c=window.localStorage["debug.logs"];c&&(Ic=Oc(c.toUpperCase()));window.localStorage["debug.console"]&&Jc.push(this.f.bind(this))};kp.prototype.g=function(a){jp(this.a,lp(this,a,!1));a=a.Hb;a instanceof Error&&a.stack&&jp(this.a,a.stack)};
kp.prototype.f=function(a){var b=[lp(this,a,!0)];a.Hb&&b.push(a.Hb);switch(a.level){case 3:console.error.apply(console,[].concat(la(b)));break;case 2:console.warn.apply(console,[].concat(la(b)));break;case 1:console.log.apply(console,[].concat(la(b)));break;default:console.debug.apply(console,[].concat(la(b)))}};
var lp=function(a,b,c){var d=["["];if(c)d.push(("       "+((Date.now()-a.b)/1E3).toFixed(3)).slice(-7));else{a=new Date(b.time);var e=function(a){return 10>a?"0"+a:a};d.push(a.getFullYear().toString(),"-",e(a.getMonth()+1),"-",e(a.getDate())," ",e(a.getHours()),":",e(a.getMinutes()),":",e(a.getSeconds()),".",e(Math.floor(a.getMilliseconds()/10)))}d.push("][",Nc[b.level],"][",b.G,"] ",b.message);if(!c&&null!=b.Hb)if(d.push("\n"),b.Hb instanceof Error)d.push(b.Hb.message);else try{d.push(JSON.stringify(b.Hb))}catch(f){d.push(b.Hb.toString())}d.push("\n");
return d.join("")},mp=function(){var a=kp.S();return 0==a.a.fa()?"NA":a.a.P().join("")},np=function(){var a=kp.S();Xh(a)};kp.prototype.ea=function(){return"LogManager"};kp.prototype.pa=function(){return[this.a.P()]};kp.prototype.ua=function(){var a=this.a.P();this.a.clear();for(var b=ja(Uh(this)||[]),c=b.next();!c.done;c=b.next())jp(this.a,c.value);a=ja(a);for(c=a.next();!c.done;c=a.next())jp(this.a,c.value)};qa(kp);var op=function(a){this.a=a;this.j=v("mr.InternalMessageHandler")};
op.prototype.onMessage=function(a,b,c){var d=this;if("retrieve_log_data"!=a.type)c(new Ge(chrome.runtime.id,"error",Error("Unhandled message type")));else{var e={logs:mp(),device:qk()};b=[];var f=Le(e.device.ip).then(function(a){a.a&&(e.device.version=a.a)});b.push(f);var g=this.a.o;g&&(a=pp(this,g,a.source).then(function(a){a&&(e.castStreamingLogs=a)},function(){d.j.error("Log upload failed for service: "+g)}),b.push(a));b.push(qp(this,e,"mr.cast.SinkDiscoveryService","castDeviceCounts"));b.push(qp(this,
e,"mr.dial.SinkDiscoveryService","dialDeviceCounts"));Sk(b).then(function(){c(e)})}};var qp=function(a,b,c,d){return Zg(c).then(function(a){a=a.Fg();b[d]=a.Mc+"."+a.xc},function(){a.j.error("Failed to get device counts for "+d+".")})},pp=function(a,b,c){return rp(a.a,b).then(function(a){return a.gf(c)})};var sp=function(){this.a=null;this.j=v("mr.IssueSenderImpl")};sp.prototype.init=function(a){this.a=a};sp.prototype.send=function(a){if(this.a)if(this.a.onIssue)this.a.onIssue(a);else this.j.error("MediaRouterService.onIssue not defined.");else this.j.error("MediaRouterService is not set.")};var tp=function(a,b){A.call(this,"internal_message");this.routeId=a;this.message=b};ka(tp,A);var up=function(a,b,c){this.a=a;this.g=b;this.f=c;this.onMessage=function(){};c.listen("internal_message",this.b,!1,this)};up.prototype.sendMessage=function(a,b){return this.g(this.a,a,b)};up.prototype.b=function(a){if(a.routeId==this.a)this.onMessage(a.message)};up.prototype.Ba=function(){this.onMessage=function(){};this.f.v("internal_message",this.b,!1,this)};
var vp=new up("",function(){return Promise.resolve()},new B),wp=function(a){this.a=a},xp=function(a){var b=Zf,c=b.a.Xe(a);return c?new up(a,c.sendRouteMessage.bind(c),b.a.Ze()):vp};var yp=function(){this.j=v("mr.ProviderManager");this.b=[];this.a=new Map;this.m=new Map;this.g=new Set;this.h=new Set;this.u=new Map;this.f=this.o=null;this.w=!1;this.N=new B;this.V=new ep(this.yl,500,this);this.ha=new ep(this.Z,500,this);this.l=new ap(this,524288);this.F=0;this.J=new sp;this.v=new Map;this.K=-1==window.navigator.userAgent.indexOf("Windows");this.B=[];this.A=[];this.H=new op(this);this.aa=new gp(this);this.onBeforeInvokeHandler=this.nk;this.createRoute=this.createRoute;this.joinRoute=
this.joinRoute;this.connectRouteByRouteId=this.connectRouteByRouteId;this.terminateRoute=this.terminateRoute;this.startObservingMediaSinks=this.startObservingMediaSinks;this.stopObservingMediaSinks=this.stopObservingMediaSinks;this.sendRouteMessage=this.sendRouteMessage;this.sendRouteBinaryMessage=this.sendRouteBinaryMessage;this.startListeningForRouteMessages=this.startListeningForRouteMessages;this.stopListeningForRouteMessages=this.stopListeningForRouteMessages;this.startObservingMediaRoutes=this.startObservingMediaRoutes;
this.stopObservingMediaRoutes=this.stopObservingMediaRoutes;this.detachRoute=this.detachRoute;this.enableMdnsDiscovery=this.enableMdnsDiscovery;this.searchSinks=this.searchSinks;this.provideSinks=this.provideSinks;this.updateMediaSinks=this.updateMediaSinks;this.createMediaRouteController=this.createMediaRouteController;this.setMediaRouteStatusObserver=this.setMediaRouteStatusObserver};ka(yp,Vg);
yp.prototype.handleEvent=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(a==chrome.runtime.onMessage)this.H.onMessage.apply(this.H,[].concat(la(c)));else if(a==chrome.runtime.onMessageExternal)this.aa.onMessage.apply(this.aa,[].concat(la(c)));else throw Error("Unhandled event");};var rp=function(a,b){b=a.u.get(b);return Zg(b).then(function(b){b.Ga(a);return b})};
yp.prototype.Ga=function(a,b){this.u.set("webrtc","mr.mirror.webrtc.WebRtcService");this.u.set("cast_streaming","mr.mirror.cast.Service");this.u.set("hangouts","mr.mirror.hangouts.HangoutsService");this.u.set("meetings","mr.mirror.hangouts.MeetingsService");var c=new wp(this);Zf||(Zf=c);this.f=a;this.J.init(a);this.l.init(this.f.onRouteMessagesReceived.bind(this.f));b.forEach(this.ba,this);Xh(this);eh("mr.ProviderManager",this)};
yp.prototype.ba=function(a){if(zp(this,a.getName()))w(this.j,"Provider "+a.getName()+" already registered.");else try{a.Ga(),this.b.push(a),this.v.set(a.getName(),0)}catch(b){w(this.j,"Provider "+a.getName()+" failed to initialize.",b)}};
var Bp=function(a,b,c){return new Promise(function(d,e){var f=null;a.F++;Ap(a);f=window.setTimeout(function(){f=null;b.cancel(new jo(2,"timeout after "+c+" ms."))},c);b.a.then(function(b){a.F--;Ap(a);null!=f&&window.clearTimeout(f);d(b)},function(b){a.F--;Ap(a);null!=f&&window.clearTimeout(f);e(b instanceof jo?b:b instanceof Error?new jo(0,b.message,b.stack):new jo(0))})})};h=yp.prototype;h.nk=function(){Og(0)};
h.createRoute=function(a,b,c,d,e,f,g){var m=this,q=Cp(this,a,b);if(!q)return Promise.reject(new jo(7,"No provider supports createRoute with source: "+a+" and sink: "+b));f=f&&0<f?f:6E4;a=q.createRoute(a,b,c,g||!1,f,d,e);return Bp(this,a,f).then(function(a){return a},function(a){m.j.error("Error creating route.",a);throw a;})};
h.connectRouteByRouteId=function(a,b,c,d,e,f){var g=this.a.get(b);if(!g)return Promise.reject(new jo(7,"No provider supports join "+b));a=g.connectRouteByRouteId(a,b,c,d,e);return Bp(this,a,f&&0<f?f:3E4)};h.joinRoute=function(a,b,c,d,e,f){var g=Dp(this,a,b);if(!g)return Promise.reject(new jo(7,"No provider supports join "+b));e=e&&0<e?e:3E4;a=g.joinRoute(a,b,f||!1,e,c,d);return Bp(this,a,e)};
h.terminateRoute=function(a){var b=this.a.get(a);return b?Ep(this,a).then(function(){return b.terminateRoute(a)}):Promise.reject(new jo(3,"Route not found for routeId "+a))};h.startObservingMediaSinks=function(a){this.g.has(a)||(this.g.add(a),this.b.forEach(function(b){b.startObservingMediaSinks(a)}));Fp(this,a)};h.stopObservingMediaSinks=function(a){this.g.delete(a)?Gp(this,a):x(this.j,"No existing query "+a)};
var Gp=function(a,b){a.b.forEach(function(a){a.stopObservingMediaSinks(b)})},Fp=function(a,b){if("urn:x-org.chromium.media:source:tab:-1"==b)w(a.j,"No sinks for sourceUrn: "+b);else{var c=new Map,d=[];a.b.forEach(function(e){var f=e.pd(b);0<f.sinks.length&&(d=f.origins);f.sinks.forEach(function(b){c.has(b.id)?w(a.j,"Detected duplicate sink "+b.id+" from provider: "+e.getName()):c.set(b.id,b)})});Hp(a,b,Array.from(c.values()),d||[])}},Hp=function(a,b,c,d){x(a.j,"Sending "+c.length+" sinks to MR for "+
b);a.f.onSinksReceived(b,c,d)};h=yp.prototype;h.sendRouteMessage=function(a,b,c){var d=this.a.get(a);d?(a=d.sendRouteMessage(a,b,c),a=Bp(this,fg(a),3E4)):a=Promise.reject(Error("Invalid route ID "+a));return a};h.sendRouteBinaryMessage=function(a,b){var c=this.a.get(a);c?(a=c.sendRouteBinaryMessage(a,b),a=Bp(this,fg(a),3E4)):a=Promise.reject(Error("Invalid route ID "+a));return a};h.startListeningForRouteMessages=function(a){var b=this.l;b.b.has(a)||(b.b.add(a),(a=b.a.get(a))&&0<a.length&&$o(b))};
h.stopListeningForRouteMessages=function(a){this.l.stopListeningForRouteMessages(a)};h.detachRoute=function(a){var b=this.a.get(a);b?b.detachRoute(a):x(this.j,"Route "+a+" does not exist.")};h.enableMdnsDiscovery=function(){this.K=!0;this.B.forEach(function(a){a()});this.B.length=0};var Cp=function(a,b,c){return a.b.find(function(a){return a.hd(b,c)})||null},Dp=function(a,b,c){return a.b.find(function(a){return a.yc(b,c)})||null};
yp.prototype.Z=function(){var a=this;this.g.forEach(function(b){Fp(a,b)})};var Ap=function(a){a.f.setKeepAlive(0<a.F||0<a.A.length)};h=yp.prototype;h.startObservingMediaRoutes=function(a){this.h.has(a)||(this.w=!0,this.h.add(a),this.b.forEach(function(b){b.startObservingMediaRoutes(a)}));this.V.bf()};h.stopObservingMediaRoutes=function(a){this.h.delete(a)?(0==this.h.size&&(this.w=!1),this.b.forEach(function(b){b.stopObservingMediaRoutes(a)})):x(this.j,"No existing route query "+a)};
h.yl=function(){var a=this;if(this.w){var b=[];this.b.forEach(function(a){b=b.concat(a.fc())});this.h.forEach(function(c){var d=[];a.b.forEach(function(a){a.fc().forEach(function(b){!b.Bc&&a.yc(c,void 0,b)&&d.push(b.id)})});a.f.onRoutesUpdated(b,c,d)})}};h.ea=function(){return"ProviderManager"};
h.pa=function(){return[new Ip(this.b.map(function(a){return a.getName()}),Array.from(this.g),Array.from(this.h),this.w,Array.from(this.a,function(a){var b=ja(a);a=b.next().value;b=b.next().value;return[a,b.getName()]}),Array.from(this.v),this.K,this.o)]};
h.ua=function(){var a=Uh(this);if(a){this.g=new Set(a.m);this.h=new Set(a.g);this.w=a.l;for(var b=ja(a.f),c=b.next();!c.done;c=b.next()){var d=ja(c.value),c=d.next().value,d=d.next().value,d=zp(this,d);this.a.set(c,d)}this.v=new Map(a.h);this.o=a.a||null;a.b&&this.enableMdnsDiscovery()}};h.Xe=function(a){return this.a.get(a)};h.ic=function(a,b){this.a.set(b.id,a);this.Tb(a,b)};
h.Rc=function(a,b){Ep(this,b.id);this.a.delete(b.id);var c=this.l,d=b.id;c.b.delete(d);var e=c.a.get(d);e&&(c.a.delete(d),cp(c,e),bp(c));this.Tb(a,b)};h.Tb=function(){this.w&&this.V.bf()};h.hh=function(a){var b=this.a.get(a.id);b&&this.Tb(b,a)};h.Jb=function(a,b,c){this.a.has(b)?("string"===typeof c||c instanceof Uint8Array||(c=JSON.stringify(c)),this.l.send(b,c)):w(this.j,"Got route message for closed route "+b)};
h.onPresentationConnectionStateChanged=function(a,b){"terminated"==b&&this.l.h();this.f.onPresentationConnectionStateChanged(a,b)};h.onPresentationConnectionClosed=function(a,b,c){this.l.h();this.f.onPresentationConnectionClosed(a,b,c)};h.hf=function(a){this.m.delete(a);var b=this.a.get(a);b&&b.terminateRoute(a)};h.oe=function(a,b,c){this.N.dispatchEvent(new tp(b,c))};h.Bb=function(){this.ha.bf()};
h.onSinkAvailabilityUpdated=function(a,b){var c=this;if(this.v.get(a.getName())!=b){var d=Jp(this);this.v.set(a.getName(),b);a=Jp(this);d!=a&&(this.f.onSinkAvailabilityUpdated(a),0==a&&(this.g.forEach(function(a){Gp(c,a)}),this.g.clear()))}};var Jp=function(a){return Array.from(a.v.values()).reduce(function(a,c){return Math.max(a,c)},0)};yp.prototype.Ze=function(){return this.N};yp.prototype.Qc=function(){return this.J};
var Ep=function(a,b){return a.m.has(b)?rp(a,a.m.get(b)).then(function(c){a.m.delete(b);return ih(c)}):Promise.resolve(!1)};h=yp.prototype;h.ff=function(a,b,c,d){var e=this,f=a.Fc(b.sinkId);x(this.j,"Starting mirroring using service: "+f);this.m.set(b.id,f);return gg(rp(this,f),function(g){e.o=f;return cg(lh(g,b,b.mediaSource,a.Gc(b.sinkId),c,d),function(a){if(a instanceof Fg&&3==a.reason)throw new jo(8);throw a;})})};
h.Xg=function(a,b,c,d,e,f){var g=this,m=this.m.get(b.id);return m?gg(rp(this,m),function(q){g.o=m;var y=a.Gc(b.sinkId);x(q.G,"Update mirroring on route "+b.id);return q.g?fg(hh(c,e).then(q.B.bind(q,b,c,y,d,f))):eg(Error("Not initialized"))}):eg(Error("Route "+b.id+" is not mirroring"))};h.Af=function(a){this.K?a():-1==this.B.indexOf(a)&&this.B.push(a)};h.ef=function(){return this.K};h.Vc=function(a,b){var c=this.A.indexOf(a),d=0<=c;b&&!d?this.A.push(a):!b&&d&&this.A.splice(c,1);Ap(this)};
var zp=function(a,b){return a.b.find(function(a){return a.getName()==b})||null};h=yp.prototype;h.searchSinks=function(a,b,c){var d=a.startsWith("pseudo:")?a.substring(7):null;return(d=d?zp(this,d):null)?d.searchSinks(b,c).then(function(a){return a.id}):Promise.reject(Error("No provider supports "+a))};h.provideSinks=function(){};h.updateMediaSinks=function(a){this.g.has(a)||Fp(this,a)};
h.createMediaRouteController=function(a,b){var c=this.a.get(a);return c?c.createMediaRouteController(a,b):(a="createMediaRouteController: Provider not found for "+a,this.j.error(a),Promise.reject(Error(a)))};h.setMediaRouteStatusObserver=function(a,b){var c=this.a.get(a);c?c.setMediaRouteStatusObserver(a,b):this.j.error("setMediaRouteStatusObserver: Provider not found for "+a)};var Ip=function(a,b,c,d,e,f,g,m){this.m=b;this.g=c;this.l=d;this.f=e;this.h=f;this.b=g;this.a=m};var Kp=0,Lp=0,Mp=function(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/4294967296);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295<c&&(c=0,a++,4294967295<a&&(a=0)));Kp=c;Lp=a},Np=function(a){if(a.constructor===Uint8Array)return a;if(a.constructor===ArrayBuffer)return new Uint8Array(a);if(a.constructor===Array)return new Uint8Array(a);if(a.constructor===String)return jk(a);ab("Type not convertible to Uint8Array.");return new Uint8Array(0)};var Pp=function(a,b,c){this.b=null;this.m=this.w=this.a=this.g=this.l=0;this.h=!1;a&&Op(this,a,b,c)},Qp=[],Rp=function(a,b,c){if(Qp.length){var d=Qp.pop();a&&Op(d,a,b,c);return d}return new Pp(a,b,c)};Pp.prototype.clone=function(){return Rp(this.b,this.l,this.g-this.l)};Pp.prototype.clear=function(){this.b=null;this.a=this.g=this.l=0;this.h=!1};var Op=function(a,b,c,d){a.b=Np(b);a.l=k(c)?c:0;a.g=k(d)?a.l+d:a.b.length;a.a=a.l};Pp.prototype.reset=function(){this.a=this.l};
Pp.prototype.f=function(){var a,b=this.b;a=b[this.a+0];var c=a&127;if(128>a)return this.a+=1,c;a=b[this.a+1];c|=(a&127)<<7;if(128>a)return this.a+=2,c;a=b[this.a+2];c|=(a&127)<<14;if(128>a)return this.a+=3,c;a=b[this.a+3];c|=(a&127)<<21;if(128>a)return this.a+=4,c;a=b[this.a+4];c|=(a&15)<<28;if(128>a)return this.a+=5,c>>>0;this.a+=10;return c};Pp.prototype.o=Pp.prototype.f;
var Sp=function(a){a:{for(var b,c=0,d,e=0;4>e;e++)if(b=a.b[a.a++],c|=(b&127)<<7*e,128>b){a.w=c>>>0;a.m=0;break a}b=a.b[a.a++];c|=(b&127)<<28;d=0|(b&127)>>4;if(128>b)a.w=c>>>0,a.m=d>>>0;else{for(e=0;5>e;e++)if(b=a.b[a.a++],d|=(b&127)<<7*e+3,128>b){a.w=c>>>0;a.m=d>>>0;break a}ab("Failed to read varint, encoding is invalid.");a.h=!0}}b=a.w;c=a.m;if(a=c&2147483648)b=~b+1>>>0,c=~c>>>0,0==b&&(c=c+1>>>0);b=4294967296*c+b;return a?-b:b};Pp.prototype.v=function(){return this.o()};var Tp=function(a,b,c){this.a=Rp(a,b,c);this.b=this.f=-1;this.g=!1};Tp.prototype.reset=function(){this.a.reset();this.b=this.f=-1};
var Up=function(a){var b=a.a;if(b.a==b.g)return!1;(b=a.g)||(b=a.a,b=b.h||0>b.a||b.a>b.g);if(b)return ab("Decoder hit an error"),!1;var c=a.a.f(),b=c>>>3,c=c&7;if(0!=c&&5!=c&&1!=c&&2!=c&&3!=c&&4!=c)return ab("Invalid wire type"),a.g=!0,!1;a.f=b;a.b=c;return!0},Vp=function(a){switch(a.b){case 0:if(0!=a.b)ab("Invalid wire type for skipVarintField"),Vp(a);else{for(a=a.a;a.b[a.a]&128;)a.a++;a.a++}break;case 1:1!=a.b?(ab("Invalid wire type for skipFixed64Field"),Vp(a)):(a=a.a,a.a+=8);break;case 2:if(2!=
a.b)ab("Invalid wire type for skipDelimitedField"),Vp(a);else{var b=a.a.f();a=a.a;a.a+=b}break;case 5:5!=a.b?(ab("Invalid wire type for skipFixed32Field"),Vp(a)):(a=a.a,a.a+=4);break;case 3:b=[a.f];do{if(!Up(a)){ab("Unmatched start-group tag: stream EOF");a.g=!0;break}if(3==a.b)b.push(a.f);else if(4==a.b&&a.f!=b.pop()){ab("Unmatched end-group tag");a.g=!0;break}}while(0<b.length);break;default:ab("Invalid wire encoding for field.")}},Wp=function(a,b,c){var d=a.a.g,e=a.a.f(),e=a.a.a+e;a.a.g=e;c(b,
a);a.a.a=e;a.a.g=d},Xp=function(a){var b=a.a.f();a=a.a;for(var c=a.b,d=a.a,b=d+b,e=[],f="";d<b;){var g=c[d++];if(128>g)e.push(g);else if(192>g)continue;else if(224>g){var m=c[d++];e.push((g&31)<<6|m&63)}else if(240>g){var m=c[d++],q=c[d++];e.push((g&15)<<12|(m&63)<<6|q&63)}else if(248>g){var m=c[d++],q=c[d++],y=c[d++],g=(g&7)<<18|(m&63)<<12|(q&63)<<6|y&63,g=g-65536;e.push((g>>10&1023)+55296,(g&1023)+56320)}8192<=e.length&&(f+=String.fromCharCode.apply(null,e),e.length=0)}f+=String.fromCharCode.apply(null,
e);a.a=d;return f},Yp=function(a,b){for(var c=a.a.f(),c=a.a.a+c,d=[];a.a.a<c;)d.push(b.call(a.a));return d};var Zp=function(a,b){this.a=a;this.b=b},$p=function(a){return new Zp((a.a>>>1|(a.b&1)<<31)>>>0,a.b>>>1>>>0)},aq=function(a){return new Zp(a.a<<1>>>0,(a.b<<1|a.a>>>31)>>>0)};Zp.prototype.add=function(a){return new Zp((this.a+a.a&4294967295)>>>0>>>0,((this.b+a.b&4294967295)>>>0)+(4294967296<=this.a+a.a?1:0)>>>0)};var bq=function(a){var b=a&65535,c=a>>>16;a=10*b+65536*(0*b&65535)+65536*(10*c&65535);for(b=0*c+(0*b>>>16)+(10*c>>>16);4294967296<=a;)a-=4294967296,b+=1;return new Zp(a>>>0,b>>>0)};
Zp.prototype.toString=function(){for(var a="",b=this;0!=b.a||0!=b.b;){var c;c=new Zp(0,0);for(var b=new Zp(b.a,b.b),d=new Zp(10,0),e=new Zp(1,0);!(d.b&2147483648);)d=aq(d),e=aq(e);for(;0!=e.a||0!=e.b;)0>=(d.b<b.b||d.b==b.b&&d.a<b.a?-1:d.b==b.b&&d.a==b.a?0:1)&&(c=c.add(e),b=new Zp((b.a-d.a&4294967295)>>>0>>>0,((b.b-d.b&4294967295)>>>0)-(0>b.a-d.a?1:0)>>>0)),d=$p(d),e=$p(e);c=[c,b];b=c[0];a=c[1].a+a}""==a&&(a="0");return a};Zp.prototype.clone=function(){return new Zp(this.a,this.b)};var cq=function(){this.a=[]};cq.prototype.length=function(){return this.a.length};var dq=function(a){var b=a.a;a.a=[];return b},eq=function(a,b,c){for(;0<c||127<b;)a.a.push(b&127|128),b=(b>>>7|c<<25)>>>0,c>>>=7;a.a.push(b)},fq=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},gq=function(a,b){if(0<=b)fq(a,b);else{for(var c=0;9>c;c++)a.a.push(b&127|128),b>>=7;a.a.push(1)}},hq=function(a,b){a.a.push(b>>>0&255);a.a.push(b>>>8&255);a.a.push(b>>>16&255);a.a.push(b>>>24&255)};var G=function(){this.f=[];this.b=0;this.a=new cq},jq=function(a,b){iq(a,b,2);b=dq(a.a);a.f.push(b);a.b+=b.length;b.push(a.b);return b},kq=function(a,b){for(var c=b.pop(),c=a.b+a.a.length()-c;127<c;)b.push(c&127|128),c>>>=7,a.b++;b.push(c);a.b++};G.prototype.reset=function(){this.f=[];dq(this.a);this.b=0};
var H=function(a){for(var b=new Uint8Array(a.b+a.a.length()),c=a.f,d=c.length,e=0,f=0;f<d;f++){var g=c[f];b.set(g,e);e+=g.length}c=dq(a.a);b.set(c,e);a.f=[b];return b},iq=function(a,b,c){fq(a.a,8*b+c)},lq=function(a,b,c){null!=c&&(iq(a,b,0),fq(a.a,c))},I=function(a,b,c){null!=c&&null!=c&&(iq(a,b,0),gq(a.a,c))},mq=function(a,b,c){null!=c&&null!=c&&(iq(a,b,0),a=a.a,Mp(c),eq(a,Kp,Lp))},nq=function(a,b,c){null!=c&&null!=c&&(iq(a,b,0),a=a.a,Mp(c),eq(a,Kp,Lp))},oq=function(a,b,c){if(null!=c){a:{for(var d=
new Zp(0,0),e=new Zp(0,0),f=0;f<c.length;f++){if("0">c[f]||"9"<c[f]){c=null;break a}e.a=parseInt(c[f],10);var g=bq(d.a),d=bq(d.b);d.b=d.a;d.a=0;d=g.add(d).add(e)}c=d}iq(a,b,0);eq(a.a,c.a,c.b)}},pq=function(a,b,c){if(null!=c){iq(a,b,5);a=a.a;var d=c,d=(c=0>d?1:0)?-d:d;0===d?0<1/d?Kp=Lp=0:(Lp=0,Kp=2147483648):isNaN(d)?(Lp=0,Kp=2147483647):3.4028234663852886E38<d?(Lp=0,Kp=(c<<31|2139095040)>>>0):1.1754943508222875E-38>d?(d=Math.round(d/Math.pow(2,-149)),Lp=0,Kp=(c<<31|d)>>>0):(b=Math.floor(Math.log(d)/
Math.LN2),d*=Math.pow(2,-b),d=Math.round(8388608*d)&8388607,Lp=0,Kp=(c<<31|b+127<<23|d)>>>0);hq(a,Kp)}},J=function(a,b,c){null!=c&&(iq(a,b,0),a.a.a.push(c?1:0))},K=function(a,b,c){null!=c&&(iq(a,b,0),gq(a.a,c))},L=function(a,b,c){if(null!=c){b=jq(a,b);for(var d=a.a,e=0;e<c.length;e++){var f=c.charCodeAt(e);if(128>f)d.a.push(f);else if(2048>f)d.a.push(f>>6|192),d.a.push(f&63|128);else if(65536>f)if(55296<=f&&56319>=f&&e+1<c.length){var g=c.charCodeAt(e+1);56320<=g&&57343>=g&&(f=1024*(f-55296)+g-56320+
65536,d.a.push(f>>18|240),d.a.push(f>>12&63|128),d.a.push(f>>6&63|128),d.a.push(f&63|128),e++)}else d.a.push(f>>12|224),d.a.push(f>>6&63|128),d.a.push(f&63|128)}kq(a,b)}},qq=function(a,b,c){null!=c&&(c=Np(c),iq(a,b,2),fq(a.a,c.length),b=dq(a.a),a.f.push(b),a.f.push(c),a.b+=b.length+c.length)},M=function(a,b,c,d){null!=c&&(b=jq(a,b),d(c,a),kq(a,b))},rq=function(a,b,c){if(null!=c)for(var d=0;d<c.length;d++){var e=a,f=c[d];null!=f&&(iq(e,b,0),gq(e.a,f))}},sq=function(a,b,c){if(null!=c)for(var d=0;d<
c.length;d++)lq(a,b,c[d])},tq=function(a,b,c){if(null!=c)for(var d=0;d<c.length;d++){var e=a,f=c[d];null!=f&&(iq(e,b,5),hq(e.a,f))}},uq=function(a,b,c){if(null!=c)for(var d=0;d<c.length;d++)K(a,b,c[d])},vq=function(a,b,c){if(null!=c)for(var d=0;d<c.length;d++)L(a,b,c[d])},N=function(a,b,c,d){if(null!=c)for(var e=0;e<c.length;e++){var f=jq(a,b);d(c[e],a);kq(a,f)}},wq=function(a,b,c,d){if(null!=c)for(var e=0;e<c.length;e++)iq(a,b,3),d(c[e],a),iq(a,b,4)},xq=function(a,b,c){if(null!=c&&c.length){b=jq(a,
b);for(var d=0;d<c.length;d++)gq(a.a,c[d]);kq(a,b)}};var O=function(){},yq="function"==typeof Uint8Array;O.prototype.Pj=function(){return this.Wg};
var P=function(a,b,c,d,e){a.a=null;b||(b=c?[c]:[]);a.Wg=c?String(c):void 0;a.w=0===c?-1:0;a.f=b;a:{if(a.f.length&&(b=a.f.length-1,(c=a.f[b])&&"object"==typeof c&&!ta(c)&&!(yq&&c instanceof Uint8Array))){a.m=b-a.w;a.b=c;break a}-1<d?(a.m=d,a.b=null):a.m=Number.MAX_VALUE}a.A={};if(e)for(d=0;d<e.length;d++)b=e[d],b<a.m?(b+=a.w,a.f[b]=a.f[b]||zq):a.b[b]=a.b[b]||zq},zq=Object.freeze?Object.freeze([]):[],Cq=function(a,b){var c=Aq,d=Bq.prototype.u,e;for(e in c){var f=c[e],g=f.Zq;if(!f.sg)throw Error("Message extension present that was generated without binary serialization support");
var m=d.call(a,g);if(null!=m)if(g.Ug())if(f.Ej)f.sg.call(b,g.yg,m,f.Ej);else throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");else f.sg.call(b,g.yg,m)}},Q=function(a,b){if(b<a.m){b+=a.w;var c=a.f[b];return c===zq?a.f[b]=[]:c}c=a.b[b];return c===zq?a.b[b]=[]:c},Dq=function(a,b){a=Q(a,b);return null==a?a:+a},R=function(a,b,c){a=Q(a,b);return null==a?c:a},S=function(a,b,c){b<a.m?a.f[b+a.w]=c:a.b[b]=c},U=function(a,
b,c,d){a.a||(a.a={});if(!a.a[c]){var e=Q(a,c);if(d||e)a.a[c]=new b(e)}return a.a[c]},V=function(a,b,c){Eq(a,b,c);b=a.a[c];b==zq&&(b=a.a[c]=[]);return b},Eq=function(a,b,c){a.a||(a.a={});if(!a.a[c]){for(var d=Q(a,c),e=[],f=0;f<d.length;f++)e[f]=new b(d[f]);a.a[c]=e}},W=function(a,b,c){a.a||(a.a={});var d=c?Fq(c):c;a.a[b]=c;S(a,b,d)},Gq=function(a,b,c){a.a||(a.a={});c=c||[];for(var d=[],e=0;e<c.length;e++)d[e]=Fq(c[e]);a.a[b]=c;S(a,b,d)},Hq=function(a,b,c,d){Eq(a,d,b);var e=a.a[b];e||(e=a.a[b]=[]);
c=c?c:new d;a=Q(a,b);e.push(c);a.push(Fq(c))},Iq=function(a){if(a.a)for(var b in a.a){var c=a.a[b];if(ta(c))for(var d=0;d<c.length;d++)c[d]&&Fq(c[d]);else c&&Fq(c)}},Fq=function(a){Iq(a);return a.f};O.prototype.la=yq?function(){var a=Uint8Array.prototype.toJSON;Uint8Array.prototype.toJSON=function(){return gk(this)};try{var b=JSON.stringify(Fq(this),Jq)}finally{Uint8Array.prototype.toJSON=a}return b}:function(){return JSON.stringify(Fq(this),Jq)};
var Jq=function(a,b){if(l(b)){if(isNaN(b))return"NaN";if(Infinity===b)return"Infinity";if(-Infinity===b)return"-Infinity"}return b},Lq=function(a){var b=Kq[a[0]];if(!b)throw Error("Unknown JsPb message type: "+a[0]);return new b(a)};O.prototype.toString=function(){Iq(this);return this.f.toString()};
O.prototype.u=function(a){if(this.b){this.a||(this.a={});var b=a.yg;if(a.b){if(a.Ug())return this.a[b]||(this.a[b]=fb(this.b[b]||[],function(b){return new a.a(b)})),this.a[b]}else if(a.Ug())return!this.a[b]&&this.b[b]&&(this.a[b]=new a.a(this.b[b])),this.a[b];return this.b[b]}};
var Nq=function(a,b){a=a||{};b=b||{};var c={},d;for(d in a)c[d]=0;for(d in b)c[d]=0;for(d in c)if(!Mq(a[d],b[d]))return!1;return!0},Mq=function(a,b){if(a==b)return!0;if(!ya(a)||!ya(b)||a.constructor!=b.constructor)return!1;if(yq&&a.constructor===Uint8Array){if(a.length!=b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!=b[c])return!1;return!0}if(a.constructor===Array){for(var d=void 0,e=void 0,f=Math.max(a.length,b.length),c=0;c<f;c++){var g=a[c],m=b[c];g&&g.constructor==Object&&(d=g,g=void 0);
m&&m.constructor==Object&&(e=m,m=void 0);if(!Mq(g,m))return!1}return d||e?(d=d||{},e=e||{},Nq(d,e)):!0}if(a.constructor===Object)return Nq(a,b);throw Error("Invalid type in JSPB array");};O.prototype.clone=function(){return Oq(this)};
var Oq=function(a){return new a.constructor(Pq(Fq(a)))},Pq=function(a){var b;if(ta(a)){for(var c=Array(a.length),d=0;d<a.length;d++)null!=(b=a[d])&&(c[d]="object"==typeof b?Pq(b):b);return c}if(yq&&a instanceof Uint8Array)return new Uint8Array(a);c={};for(d in a)null!=(b=a[d])&&(c[d]="object"==typeof b?Pq(b):b);return c},Qq=function(a,b){Kq[a]=b;b.messageId=a},Kq={};var Rq=!kc&&!ic||ic&&9<=Number(Dc)||kc&&Cc("1.9.1");ic&&Cc("9");var Sq=function(a,b){this.width=a;this.height=b};h=Sq.prototype;h.clone=function(){return new Sq(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.Cj=function(){return this.width*this.height};h.jb=function(){return!this.Cj()};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var Tq={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"},Uq=function(a){a=a.document;a="CSS1Compat"==a.compatMode?a.documentElement:a.body;return new Sq(a.clientWidth,a.clientHeight)},Vq=function(a){return a?a.parentWindow||a.defaultView:window},Wq=function(a,b){if("textContent"in a)a.textContent=b;else if(3==a.nodeType)a.data=
b;else if(a.firstChild&&3==a.firstChild.nodeType){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else{for(var c;c=a.firstChild;)a.removeChild(c);a.appendChild((9==a.nodeType?a:a.ownerDocument||a.document).createTextNode(String(b)))}},Xq=function(a){this.a=a||na.document||document};
Xq.prototype.setProperties=function(a,b){Mb(b,function(b,d){b&&b.ec&&(b=b.Ic());"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:Tq.hasOwnProperty(d)?a.setAttribute(Tq[d],b):Ia(d,"aria-")||Ia(d,"data-")?a.setAttribute(d,b):a[d]=b})};Xq.prototype.getChildren=function(a){return Rq&&void 0!=a.children?a.children:eb(a.childNodes,function(a){return 1==a.nodeType})};Xq.prototype.isElement=function(a){return ya(a)&&1==a.nodeType};
Xq.prototype.contains=function(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a};/*
 Portions of this code are from MochiKit, received by
 The Closure Authors under the MIT license. All other code is Copyright
 2005-2009 The Closure Authors. All Rights Reserved.
*/
var Yq=function(a,b){this.w=[];this.K=a;this.B=b||null;this.l=this.f=!1;this.g=void 0;this.u=this.F=this.o=!1;this.v=0;this.b=null;this.m=0};Yq.prototype.cancel=function(a){if(this.f)this.g instanceof Yq&&this.g.cancel();else{if(this.b){var b=this.b;delete this.b;a?b.cancel(a):(b.m--,0>=b.m&&b.cancel())}this.K?this.K.call(this.B,this):this.u=!0;this.f||this.a(new Zq)}};Yq.prototype.A=function(a,b){this.o=!1;$q(this,a,b)};
var $q=function(a,b,c){a.f=!0;a.g=c;a.l=!b;ar(a)},cr=function(a){if(a.f){if(!a.u)throw new br;a.u=!1}};Yq.prototype.callback=function(a){cr(this);$q(this,!0,a)};Yq.prototype.a=function(a){cr(this);$q(this,!1,a)};var er=function(a,b,c){return dr(a,b,null,c)},fr=function(a,b){return dr(a,null,b,void 0)},hr=function(a){var b=gr();return dr(b,a,a,void 0)},dr=function(a,b,c,d){a.w.push([b,c,d]);a.f&&ar(a);return a};
Yq.prototype.then=function(a,b,c){var d,e,f=new Yd(function(a,b){d=a;e=b});dr(this,d,function(a){a instanceof Zq?f.cancel():e(a)});return f.then(a,b,c)};Ud(Yq);var ir=function(a,b){b instanceof Yq?er(a,n(b.h,b)):er(a,function(){return b})};Yq.prototype.h=function(a){var b=new Yq;dr(this,b.callback,b.a,b);a&&(b.b=this,this.m++);return b};
var jr=function(a){return hb(a.w,function(a){return xa(a[1])})},ar=function(a){if(a.v&&a.f&&jr(a)){var b=a.v,c=kr[b];c&&(na.clearTimeout(c.xa),delete kr[b]);a.v=0}a.b&&(a.b.m--,delete a.b);for(var b=a.g,d=c=!1;a.w.length&&!a.o;){var e=a.w.shift(),f=e[0],g=e[1],e=e[2];if(f=a.l?g:f)try{var m=f.call(e||a.B,b);k(m)&&(a.l=a.l&&(m==b||m instanceof Error),a.g=b=m);if(Vd(b)||"function"===typeof na.Promise&&b instanceof na.Promise)d=!0,a.o=!0}catch(q){b=q,a.l=!0,jr(a)||(c=!0)}}a.g=b;d&&(m=n(a.A,a,!0),d=n(a.A,
a,!1),b instanceof Yq?(dr(b,m,d),b.F=!0):b.then(m,d));c&&(b=new lr(b),kr[b.xa]=b,a.v=b.xa)},or=function(){var a=new Yq;a.callback(new nr(200,""));return a},pr=function(a){var b=new Yq;b.a(a);return b},br=function(){Ga.call(this)};r(br,Ga);br.prototype.message="Deferred has already fired";br.prototype.name="AlreadyCalledError";var Zq=function(){Ga.call(this)};r(Zq,Ga);Zq.prototype.message="Deferred was canceled";Zq.prototype.name="CanceledError";
var lr=function(a){this.xa=na.setTimeout(n(this.b,this),0);this.a=a};lr.prototype.b=function(){delete kr[this.xa];throw this.a;};var kr={};var qr=function(a){this.b=0;this.f=a||100;this.a=[]};h=qr.prototype;h.add=function(a){var b=this.a[this.b];this.a[this.b]=a;this.b=(this.b+1)%this.f;return b};h.get=function(a){a=rr(this,a);return this.a[a]};h.set=function(a,b){a=rr(this,a);this.a[a]=b};h.fa=function(){return this.a.length};h.jb=function(){return 0==this.a.length};h.clear=function(){this.b=this.a.length=0};h.P=function(){for(var a=this.fa(),b=this.fa(),c=[],a=this.fa()-a;a<b;a++)c.push(this.get(a));return c};
h.La=function(){for(var a=[],b=this.fa(),c=0;c<b;c++)a[c]=c;return a};h.Ra=function(a){return a<this.fa()};h.jd=function(a){for(var b=this.fa(),c=0;c<b;c++)if(this.get(c)==a)return!0;return!1};var rr=function(a,b){if(b>=a.a.length)throw Error("Out of bounds exception");return a.a.length<a.f?b:(a.b+Number(b))%a.f};var sr=function(a,b,c){if(c)for(var d=0;d<c.length;d++);this.f=a;this.a=b||null;this.b=c||[]};sr.prototype.toString=function(){return this.f};var tr=function(a){kd.call(this);this.m=a;this.f={}};r(tr,kd);var ur=[];tr.prototype.listen=function(a,b,c,d){return vr(this,a,b,c,d)};var vr=function(a,b,c,d,e,f){ta(c)||(c&&(ur[0]=c.toString()),c=ur);for(var g=0;g<c.length;g++){var m=Fd(b,c[g],d||a.handleEvent,e||!1,f||a.m||a);if(!m)break;a.f[m.key]=m}return a},xr=function(a,b,c){wr(a,b,"playing",c,void 0)},wr=function(a,b,c,d,e,f){if(ta(c))for(var g=0;g<c.length;g++)wr(a,b,c[g],d,e,f);else(b=Md(b,c,d||a.handleEvent,e,f||a.m||a))&&(a.f[b.key]=b)};
tr.prototype.v=function(a,b,c,d,e){if(ta(b))for(var f=0;f<b.length;f++)this.v(a,b[f],c,d,e);else c=c||this.handleEvent,e=e||this.m||this,c=Gd(c),d=!!d,b=td(a)?Bd(a.sb,String(b),c,d,e):a?(a=Id(a))?Bd(a,b,c,d,e):null:null,b&&(Pd(b),delete this.f[b.key]);return this};tr.prototype.removeAll=function(){Mb(this.f,function(a,b){this.f.hasOwnProperty(b)&&Pd(a)},this);this.f={}};tr.prototype.X=function(){tr.W.X.call(this);this.removeAll()};
tr.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};var yr=function(a){P(this,a,0,-1,null)};r(yr,O);yr.prototype.s=function(){var a=new G;zr(this,a);return H(a)};var zr=function(a,b){var c;c=U(a,Ar,1);null!=c&&M(b,1,c,Br);c=U(a,Cr,2);null!=c&&M(b,2,c,Dr);c=U(a,Cr,3);null!=c&&M(b,3,c,Dr);c=U(a,Er,4);null!=c&&M(b,4,c,Fr)},Ar=function(a){P(this,a,0,-1,null)};r(Ar,O);Ar.prototype.s=function(){var a=new G;Br(this,a);return H(a)};var Br=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&K(b,2,c)},Cr=function(a){P(this,a,0,-1,null)};r(Cr,O);
Cr.prototype.s=function(){var a=new G;Dr(this,a);return H(a)};
var Dr=function(a,b){var c;c=Q(a,1);null!=c&&I(b,1,c);c=Q(a,2);null!=c&&I(b,2,c);c=Q(a,3);if(null!=c&&(a=c,null!=a)){iq(b,3,1);b=b.a;var d=a,d=(a=0>d?1:0)?-d:d;0===d?(Lp=0<1/d?0:2147483648,Kp=0):isNaN(d)?(Lp=2147483647,Kp=4294967295):1.7976931348623157E308<d?(Lp=(a<<31|2146435072)>>>0,Kp=0):2.2250738585072014E-308>d?(d/=Math.pow(2,-1074),Lp=(a<<31|d/4294967296)>>>0,Kp=d>>>0):(c=Math.floor(Math.log(d)/Math.LN2),1024==c&&(c=1023),d*=Math.pow(2,-c),Lp=(a<<31|c+1023<<20|1048576*d&1048575)>>>0,Kp=4503599627370496*
d>>>0);hq(b,Kp);hq(b,Lp)}},Er=function(a){P(this,a,0,-1,null)};r(Er,O);Er.prototype.s=function(){var a=new G;Fr(this,a);return H(a)};var Fr=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&mq(b,3,c);c=Q(a,4);null!=c&&mq(b,4,c)};var Bq=function(a){P(this,a,0,1,null)};r(Bq,O);Bq.prototype.s=function(){var a=new G;Cq(this,a);return H(a)};var Gr=function(a,b){Cq(a,b)},Aq={};var Ir=function(a){P(this,a,0,-1,Hr)};r(Ir,O);var Hr=[14];Ir.prototype.s=function(){var a=new G;Jr(this,a);return H(a)};
var Jr=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&K(b,4,c);c=Q(a,10);null!=c&&L(b,10,c);c=Q(a,5);null!=c&&L(b,5,c);c=U(a,Kr,6);null!=c&&M(b,6,c,Lr);c=Q(a,7);null!=c&&K(b,7,c);c=U(a,Mr,8);null!=c&&M(b,8,c,Nr);c=U(a,Or,9);null!=c&&M(b,9,c,Pr);c=U(a,Qr,11);null!=c&&M(b,11,c,Rr);c=a.ie();null!=c&&M(b,12,c,Sr);c=Q(a,13);null!=c&&K(b,13,c);c=Q(a,14);0<c.length&&vq(b,14,c)},Mr=function(a){P(this,a,0,-1,null)};r(Mr,O);
Mr.prototype.s=function(){var a=new G;Nr(this,a);return H(a)};var Nr=function(a,b){var c;c=Q(a,1);null!=c&&mq(b,1,c);c=U(a,Tr,2);null!=c&&M(b,2,c,Ur);c=Q(a,3);null!=c&&L(b,3,c);c=U(a,Vr,4);null!=c&&M(b,4,c,Wr);c=U(a,Xr,5);null!=c&&M(b,5,c,Yr);c=U(a,Zr,6);null!=c&&M(b,6,c,$r);c=U(a,Bq,7);null!=c&&M(b,7,c,Gr)},Tr=function(a){P(this,a,0,-1,null)};r(Tr,O);Tr.prototype.s=function(){var a=new G;Ur(this,a);return H(a)};
var Ur=function(a,b){var c;c=Q(a,1);null!=c&&mq(b,1,c);c=Q(a,2);null!=c&&mq(b,2,c)},Kr=function(a){P(this,a,0,-1,null)};r(Kr,O);Kr.prototype.s=function(){var a=new G;Lr(this,a);return H(a)};var Lr=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&K(b,2,c)},Vr=function(a){P(this,a,0,-1,null)};r(Vr,O);Vr.prototype.s=function(){var a=new G;Wr(this,a);return H(a)};var Wr=function(a,b){a=Q(a,1);null!=a&&L(b,1,a)},Xr=function(a){P(this,a,0,-1,null)};r(Xr,O);
Xr.prototype.s=function(){var a=new G;Yr(this,a);return H(a)};var Yr=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&mq(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&L(b,4,c)};Xr.prototype.getTitle=function(){return Q(this,3)};Xr.prototype.setTitle=function(a){S(this,3,a)};var Or=function(a){P(this,a,0,-1,as)};r(Or,O);var as=[5];Or.prototype.s=function(){var a=new G;Pr(this,a);return H(a)};
var Pr=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&J(b,3,c);c=Q(a,4);null!=c&&K(b,4,c);c=Q(a,5);0<c.length&&vq(b,5,c)},Zr=function(a){P(this,a,0,-1,null)};r(Zr,O);Zr.prototype.s=function(){var a=new G;$r(this,a);return H(a)};var $r=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c)};Zr.prototype.Aa=function(){return R(this,1,0)};var Qr=function(a){P(this,a,0,-1,null)};r(Qr,O);
Qr.prototype.s=function(){var a=new G;Rr(this,a);return H(a)};var Rr=function(a,b){var c;c=Q(a,3);null!=c&&K(b,3,c);c=Q(a,4);null!=c&&mq(b,4,c);c=Q(a,5);null!=c&&J(b,5,c)};Qr.prototype.getCurrentState=function(){return Q(this,3)};var bs=function(a){P(this,a,0,-1,null)};r(bs,O);bs.prototype.s=function(){var a=new G;Sr(this,a);return H(a)};var Sr=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&K(b,2,c)};Ir.prototype.T=function(){return Q(this,1)};
Ir.prototype.R=function(a){S(this,1,a)};Ir.prototype.ie=function(){return U(this,bs,12)};var cs=function(a){P(this,a,0,-1,null)};r(cs,O);cs.prototype.s=function(){var a=new G;ds(this,a);return H(a)};var ds=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&nq(b,2,c);c=Q(a,3);null!=c&&nq(b,3,c);c=Q(a,4);null!=c&&nq(b,4,c)};cs.prototype.ub=function(){return Q(this,4)};var es=function(a){P(this,a,0,-1,null)};r(es,O);es.prototype.s=function(){var a=new G;fs(this,a);return H(a)};var fs=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&L(b,4,c)};var gs=function(a){P(this,a,0,-1,null)};r(gs,O);gs.prototype.s=function(){var a=new G;hs(this,a);return H(a)};var hs=function(a,b){a=Q(a,1);null!=a&&mq(b,1,a)};var is=function(a){P(this,a,0,-1,null)};r(is,O);is.prototype.s=function(){var a=new G;js(this,a);return H(a)};var js=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&K(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&mq(b,4,c);c=Q(a,5);null!=c&&L(b,5,c);c=Q(a,6);null!=c&&L(b,6,c);c=Q(a,7);null!=c&&I(b,7,c)};is.prototype.ub=function(){return Q(this,4)};var ks=function(a){P(this,a,0,-1,null)};r(ks,O);ks.prototype.s=function(){var a=new G;ls(this,a);return H(a)};var ls=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&K(b,2,c);c=Q(a,3);null!=c&&K(b,3,c)};ks.prototype.getDevice=function(){return Q(this,1)};var ms=function(a){P(this,a,0,-1,null)};r(ms,O);ms.prototype.s=function(){var a=new G;ns(this,a);return H(a)};var ns=function(a,b){var c;c=U(a,is,1);null!=c&&M(b,1,c,js);c=U(a,es,2);null!=c&&M(b,2,c,fs);c=U(a,gs,3);null!=c&&M(b,3,c,hs);c=Q(a,4);null!=c&&L(b,4,c);c=Q(a,5);null!=c&&J(b,5,c);c=Q(a,6);null!=c&&null!=c&&lq(b,6,c);c=U(a,ks,7);null!=c&&M(b,7,c,ls);c=Q(a,8);null!=c&&L(b,8,c);c=U(a,cs,9);null!=c&&M(b,9,c,ds)};ms.prototype.Xc=function(a){S(this,4,a)};var X=function(a){P(this,a,0,-1,null)};r(X,O);X.prototype.s=function(){var a=new G;Y(this,a);return H(a)};var Y=function(a,b){var c;c=Q(a,1);null!=c&&mq(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=U(a,os,3);null!=c&&M(b,3,c,ps)},os=function(a){P(this,a,0,-1,null)};r(os,O);os.prototype.s=function(){var a=new G;ps(this,a);return H(a)};var ps=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&mq(b,2,c)};X.prototype.ub=function(){return Q(this,1)};var qs=function(a){P(this,a,0,-1,null)};r(qs,O);qs.prototype.s=function(){var a=new G;rs(this,a);return H(a)};var rs=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&nq(b,2,c)};var ss=function(a){P(this,a,0,-1,null)};r(ss,O);ss.prototype.s=function(){var a=new G;ts(this,a);return H(a)};var ts=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&oq(b,4,c);c=Q(a,10);null!=c&&L(b,10,c);c=Q(a,11);null!=c&&I(b,11,c);c=Q(a,5);null!=c&&nq(b,5,c);c=Q(a,6);null!=c&&nq(b,6,c);c=Q(a,7);null!=c&&L(b,7,c);c=Q(a,8);null!=c&&L(b,8,c);c=U(a,qs,9);null!=c&&M(b,9,c,rs)};ss.prototype.Aa=function(){return Q(this,1)};var us=function(a){P(this,a,0,-1,null)};r(us,O);us.prototype.s=function(){var a=new G;vs(this,a);return H(a)};var vs=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c)};us.prototype.T=function(){return Q(this,1)};us.prototype.R=function(a){S(this,1,a)};var xs=function(a){P(this,a,0,-1,ws)};r(xs,O);var ws=[2,3];xs.prototype.s=function(){var a=new G;ys(this,a);return H(a)};var ys=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=a.sa();0<c.length&&N(b,2,c,Jr);c=a.Ia();0<c.length&&N(b,3,c,vs);c=a.Fa();null!=c&&M(b,4,c,vs)};h=xs.prototype;h.C=function(){return U(this,X,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,Ir,2)};h.Ia=function(){return V(this,us,3)};h.Fa=function(){return U(this,us,4)};var As=function(a){P(this,a,0,-1,zs)};r(As,O);var zs=[10];As.prototype.s=function(){var a=new G;Bs(this,a);return H(a)};var Bs=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&mq(b,2,c);c=Q(a,4);null!=c&&K(b,4,c);c=Q(a,5);null!=c&&mq(b,5,c);c=Q(a,6);null!=c&&mq(b,6,c);c=Q(a,7);null!=c&&mq(b,7,c);c=Q(a,8);null!=c&&L(b,8,c);c=Q(a,9);null!=c&&L(b,9,c);c=V(a,Cs,10);0<c.length&&N(b,10,c,Ds);c=Q(a,11);null!=c&&L(b,11,c)},Cs=function(a){P(this,a,0,-1,null)};r(Cs,O);
Cs.prototype.s=function(){var a=new G;Ds(this,a);return H(a)};var Ds=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&pq(b,2,c)};As.prototype.T=function(){return Q(this,1)};As.prototype.R=function(a){S(this,1,a)};var Es=function(a){P(this,a,0,-1,null)};r(Es,O);Es.prototype.s=function(){var a=new G;Fs(this,a);return H(a)};var Fs=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&mq(b,2,c)};Es.prototype.T=function(){return Q(this,1)};Es.prototype.R=function(a){S(this,1,a)};var Hs=function(a){P(this,a,0,-1,Gs)};r(Hs,O);var Gs=[2,3];Hs.prototype.s=function(){var a=new G;Is(this,a);return H(a)};var Is=function(a,b){var c;c=a.sa();0<c.length&&N(b,2,c,Bs);c=a.Ia();0<c.length&&N(b,3,c,Fs)};Hs.prototype.sa=function(){return V(this,As,2)};Hs.prototype.Ia=function(){return V(this,Es,3)};var Js=function(a){P(this,a,0,-1,null)};r(Js,O);Js.prototype.s=function(){var a=new G;Ks(this,a);return H(a)};var Ks=function(a,b){var c;c=Q(a,1);null!=c&&J(b,1,c);c=Q(a,2);null!=c&&L(b,2,c)};var Ls=function(a){P(this,a,0,-1,null)};r(Ls,O);Ls.prototype.s=function(){var a=new G;Ms(this,a);return H(a)};var Ms=function(a,b){var c;c=Q(a,1);null!=c&&J(b,1,c);c=Q(a,2);null!=c&&K(b,2,c)};var Ns=function(a){P(this,a,0,-1,null)};r(Ns,O);Ns.prototype.s=function(){var a=new G;Os(this,a);return H(a)};var Os=function(a,b){a=Q(a,1);null!=a&&L(b,1,a)};Ns.prototype.getId=function(){return Q(this,1)};var Ps=function(a){P(this,a,0,-1,null)};r(Ps,O);Ps.prototype.s=function(){var a=new G;Qs(this,a);return H(a)};var Qs=function(a,b){var c;c=Q(a,1);null!=c&&J(b,1,c);c=Q(a,2);null!=c&&nq(b,2,c)};var Rs=function(a){P(this,a,0,-1,null)};r(Rs,O);Rs.prototype.s=function(){var a=new G;Ss(this,a);return H(a)};var Ss=function(a,b){a=U(a,Ps,1);null!=a&&M(b,1,a,Qs)};var Ts=function(a){P(this,a,0,-1,null)};r(Ts,O);Ts.prototype.s=function(){var a=new G;Us(this,a);return H(a)};var Us=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=U(a,Rs,4);null!=c&&M(b,4,c,Ss);c=Q(a,3);null!=c&&oq(b,3,c);c=Q(a,5);null!=c&&nq(b,5,c);c=U(a,Ls,6);null!=c&&M(b,6,c,Ms);c=Q(a,2);null!=c&&qq(b,2,c);c=Q(a,7);null!=c&&L(b,7,c);c=Q(a,8);null!=c&&L(b,8,c)};var Ws=function(a){P(this,a,0,-1,Vs)};r(Ws,O);var Vs=[6];Ws.prototype.s=function(){var a=new G;Xs(this,a);return H(a)};var Xs=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&K(b,3,c);c=Q(a,4);null!=c&&L(b,4,c);c=Q(a,5);null!=c&&L(b,5,c);c=Q(a,6);0<c.length&&vq(b,6,c);c=Q(a,7);null!=c&&L(b,7,c);c=Q(a,8);null!=c&&K(b,8,c);c=Q(a,9);null!=c&&L(b,9,c);c=Q(a,10);null!=c&&L(b,10,c);c=Q(a,11);null!=c&&K(b,11,c)};h=Ws.prototype;h.T=function(){return Q(this,1)};
h.R=function(a){S(this,1,a)};h.getTitle=function(){return Q(this,9)};h.setTitle=function(a){S(this,9,a)};h.Ff=function(a){S(this,10,a)};var Ys=function(a){P(this,a,0,-1,null)};r(Ys,O);Ys.prototype.s=function(){var a=new G;Zs(this,a);return H(a)};var Zs=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c)};Ys.prototype.T=function(){return Q(this,1)};Ys.prototype.R=function(a){S(this,1,a)};var at=function(a){P(this,a,0,-1,$s)};r(at,O);var $s=[2,3];at.prototype.s=function(){var a=new G;bt(this,a);return H(a)};var bt=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=a.sa();0<c.length&&N(b,2,c,Xs);c=a.Ia();0<c.length&&N(b,3,c,Zs);c=a.Fa();null!=c&&M(b,4,c,Zs)};h=at.prototype;h.C=function(){return U(this,X,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,Ws,2)};h.Ia=function(){return V(this,Ys,3)};h.Fa=function(){return U(this,Ys,4)};var dt=function(a){P(this,a,0,-1,ct)};r(dt,O);var ct=[1];dt.prototype.s=function(){var a=new G;et(this,a);return H(a)};var et=function(a,b){a=V(a,ft,1);0<a.length&&N(b,1,a,gt)},ft=function(a){P(this,a,0,-1,null)};r(ft,O);ft.prototype.s=function(){var a=new G;gt(this,a);return H(a)};var gt=function(a,b){a=Q(a,1);null!=a&&K(b,1,a)};var ht=function(a){P(this,a,0,-1,null)};r(ht,O);ht.prototype.s=function(){var a=new G;it(this,a);return H(a)};var it=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c)};ht.prototype.getService=function(){return Q(this,1)};var jt=function(a){P(this,a,0,-1,null)};r(jt,O);jt.prototype.s=function(){var a=new G;kt(this,a);return H(a)};var kt=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c)};var mt=function(a){P(this,a,0,-1,lt)};r(mt,O);var lt=[15,26];mt.prototype.s=function(){var a=new G;nt(this,a);return H(a)};
var nt=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&K(b,2,c);c=U(a,ht,3);null!=c&&M(b,3,c,it);c=Q(a,4);null!=c&&J(b,4,c);c=Q(a,6);null!=c&&mq(b,6,c);c=Q(a,7);null!=c&&mq(b,7,c);c=Q(a,8);null!=c&&L(b,8,c);c=U(a,Ns,9);null!=c&&M(b,9,c,Os);c=Q(a,10);null!=c&&J(b,10,c);c=Q(a,11);null!=c&&mq(b,11,c);c=Q(a,12);null!=c&&mq(b,12,c);c=Q(a,13);null!=c&&L(b,13,c);c=Q(a,14);null!=c&&K(b,14,c);c=Q(a,15);0<c.length&&vq(b,15,c);c=Q(a,16);null!=c&&J(b,16,c);c=Q(a,24);null!=c&&K(b,24,c);c=a.td();
null!=c&&M(b,17,c,kt);c=Q(a,18);null!=c&&J(b,18,c);c=Q(a,25);null!=c&&K(b,25,c);c=U(a,Js,19);null!=c&&M(b,19,c,Ks);c=Q(a,21);null!=c&&K(b,21,c);c=Q(a,22);null!=c&&K(b,22,c);c=Q(a,23);null!=c&&K(b,23,c);c=Q(a,26);0<c.length&&uq(b,26,c);c=Q(a,27);null!=c&&L(b,27,c);c=Q(a,28);null!=c&&L(b,28,c);c=Q(a,29);null!=c&&L(b,29,c);c=Q(a,30);null!=c&&L(b,30,c)};h=mt.prototype;h.T=function(){return Q(this,1)};h.R=function(a){S(this,1,a)};h.U=function(){return Q(this,14)};h.Ma=function(a){S(this,14,a)};
h.td=function(){return U(this,jt,17)};var ot=function(a){P(this,a,0,-1,null)};r(ot,O);ot.prototype.s=function(){var a=new G;pt(this,a);return H(a)};var pt=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=Q(a,2);null!=c&&mq(b,2,c);c=Q(a,3);null!=c&&L(b,3,c)};ot.prototype.C=function(){return U(this,X,1)};ot.prototype.D=function(a){W(this,1,a)};ot.prototype.O=function(){this.D(void 0)};var rt=function(a){P(this,a,0,-1,qt)};r(rt,O);var qt=[20,8,19,26];rt.prototype.s=function(){var a=new G;st(this,a);return H(a)};
var st=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&L(b,4,c);c=Q(a,5);null!=c&&L(b,5,c);c=Q(a,6);null!=c&&J(b,6,c);c=Q(a,7);null!=c&&J(b,7,c);c=V(a,tt,20);0<c.length&&N(b,20,c,ut);c=Q(a,8);0<c.length&&vq(b,8,c);c=Q(a,9);null!=c&&J(b,9,c);c=Q(a,10);null!=c&&L(b,10,c);c=Q(a,11);null!=c&&L(b,11,c);c=Q(a,12);null!=c&&K(b,12,c);c=Q(a,13);null!=c&&K(b,13,c);c=Q(a,14);null!=c&&K(b,14,c);c=Q(a,17);null!=c&&K(b,17,c);c=Q(a,18);null!=
c&&J(b,18,c);c=Q(a,19);0<c.length&&uq(b,19,c);c=Q(a,21);null!=c&&J(b,21,c);c=U(a,yr,22);null!=c&&M(b,22,c,zr);c=Q(a,23);null!=c&&mq(b,23,c);c=Q(a,24);null!=c&&K(b,24,c);c=Q(a,25);null!=c&&L(b,25,c);c=Q(a,26);0<c.length&&vq(b,26,c)},tt=function(a){P(this,a,0,-1,null)};r(tt,O);tt.prototype.s=function(){var a=new G;ut(this,a);return H(a)};var ut=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&K(b,2,c)};h=rt.prototype;h.T=function(){return Q(this,1)};h.R=function(a){S(this,1,a)};
h.M=function(){return Q(this,2)};h.ma=function(a){S(this,2,a)};h.ge=function(){return R(this,18,!1)};var vt=function(a){P(this,a,0,-1,null)};r(vt,O);vt.prototype.s=function(){var a=new G;wt(this,a);return H(a)};var wt=function(a,b){var c;c=Q(a,1);null!=c&&null!=c&&lq(b,1,c);c=Q(a,2);null!=c&&null!=c&&lq(b,2,c);c=Q(a,3);null!=c&&null!=c&&lq(b,3,c)};var yt=function(a){P(this,a,0,-1,xt)};r(yt,O);var xt=[8];yt.prototype.s=function(){var a=new G;zt(this,a);return H(a)};var zt=function(a,b){var c;c=Q(a,1);null!=c&&I(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&K(b,3,c);c=Q(a,4);null!=c&&I(b,4,c);c=Q(a,5);null!=c&&I(b,5,c);c=Q(a,6);null!=c&&I(b,6,c);c=Q(a,7);null!=c&&I(b,7,c);c=V(a,At,8);0<c.length&&N(b,8,c,Bt)},At=function(a){P(this,a,0,-1,null)};r(At,O);At.prototype.s=function(){var a=new G;Bt(this,a);return H(a)};
var Bt=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c)};yt.prototype.getName=function(){return Q(this,2)};var Ct=function(a,b){S(a,2,b)};yt.prototype.U=function(){return Q(this,3)};yt.prototype.Ma=function(a){S(this,3,a)};var Dt=function(a,b){Gq(a,8,b)};var Et=function(a){P(this,a,0,-1,null)};r(Et,O);Et.prototype.s=function(){var a=new G;Ft(this,a);return H(a)};var Ft=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&I(b,4,c)};var Gt=function(a){P(this,a,0,-1,null)};r(Gt,O);Gt.prototype.s=function(){var a=new G;Ht(this,a);return H(a)};var Ht=function(a,b){var c;c=Q(a,1);null!=c&&I(b,1,c);c=Q(a,2);null!=c&&I(b,2,c);c=Q(a,3);null!=c&&I(b,3,c)};Gt.prototype.l=function(a){S(this,1,a)};Gt.prototype.h=function(a){S(this,2,a)};var Jt=function(a){P(this,a,0,-1,It)};r(Jt,O);var It=[5];Jt.prototype.s=function(){var a=new G;Kt(this,a);return H(a)};var Kt=function(a,b){var c;c=Q(a,1);null!=c&&J(b,1,c);c=Q(a,2);null!=c&&J(b,2,c);c=U(a,Gt,3);null!=c&&M(b,3,c,Ht);c=Q(a,4);null!=c&&null!=c&&lq(b,4,c);c=Q(a,5);0<c.length&&rq(b,5,c)};var Lt=function(a){P(this,a,0,-1,null)};r(Lt,O);Lt.prototype.s=function(){var a=new G;Mt(this,a);return H(a)};var Mt=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=U(a,Jt,2);null!=c&&M(b,2,c,Kt)};Lt.prototype.U=function(){return Q(this,1)};Lt.prototype.Ma=function(a){S(this,1,a)};var Nt=function(a){P(this,a,0,-1,null)};r(Nt,O);Nt.prototype.s=function(){var a=new G;Ot(this,a);return H(a)};var Ot=function(a,b){var c;c=Q(a,1);null!=c&&I(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&K(b,3,c)};Nt.prototype.getId=function(){return Q(this,1)};Nt.prototype.U=function(){return Q(this,3)};Nt.prototype.Ma=function(a){S(this,3,a)};var Pt=function(a){P(this,a,0,-1,null)};r(Pt,O);Pt.prototype.s=function(){var a=new G;Qt(this,a);return H(a)};var Qt=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&K(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&I(b,4,c);c=Q(a,5);null!=c&&K(b,5,c);c=Q(a,6);null!=c&&I(b,6,c);c=Q(a,7);null!=c&&L(b,7,c);c=Q(a,8);null!=c&&I(b,8,c);c=Q(a,9);null!=c&&K(b,9,c)};Pt.prototype.ta=function(){return Q(this,4)};Pt.prototype.U=function(){return Q(this,9)};
Pt.prototype.Ma=function(a){S(this,9,a)};var St=function(a){P(this,a,0,-1,Rt)};r(St,O);var Rt=[3,6];St.prototype.s=function(){var a=new G;Tt(this,a);return H(a)};var Tt=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=U(a,Ut,2);null!=c&&M(b,2,c,Vt);c=Q(a,3);0<c.length&&vq(b,3,c);c=Q(a,4);null!=c&&L(b,4,c);c=Q(a,5);null!=c&&L(b,5,c);c=V(a,Pt,6);0<c.length&&N(b,6,c,Qt)},Ut=function(a){P(this,a,0,-1,null)};r(Ut,O);Ut.prototype.s=function(){var a=new G;Vt(this,a);return H(a)};
var Vt=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c)};var Xt=function(a){P(this,a,0,-1,Wt)};r(Xt,O);var Wt=[3,4,5,6];Xt.prototype.s=function(){var a=new G;Yt(this,a);return H(a)};var Yt=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=U(a,St,2);null!=c&&M(b,2,c,Tt);c=V(a,yt,3);0<c.length&&N(b,3,c,zt);c=V(a,Et,4);0<c.length&&N(b,4,c,Ft);c=V(a,Nt,5);0<c.length&&N(b,5,c,Ot);c=V(a,Lt,6);0<c.length&&N(b,6,c,Mt);c=U(a,vt,7);null!=c&&M(b,7,c,wt);c=Q(a,8);null!=c&&L(b,8,c)};Xt.prototype.U=function(){return R(this,1,4)};Xt.prototype.Ma=function(a){S(this,1,a)};var $t=function(a){P(this,a,0,-1,Zt)};r($t,O);var Zt=[1];$t.prototype.s=function(){var a=new G;au(this,a);return H(a)};var au=function(a,b){var c;c=Q(a,1);0<c.length&&vq(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c)};var bu=function(a){P(this,a,0,-1,null)};r(bu,O);bu.prototype.s=function(){var a=new G;cu(this,a);return H(a)};var cu=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&K(b,2,c);c=Q(a,3);null!=c&&I(b,3,c);c=Q(a,4);null!=c&&L(b,4,c);c=Q(a,5);null!=c&&K(b,5,c)};bu.prototype.getChannelId=function(){return Q(this,1)};bu.prototype.Sb=function(){return Q(this,4)};var eu=function(a){P(this,a,0,-1,du)};r(eu,O);var du=[3,4,5,6,8,10];eu.prototype.s=function(){var a=new G;fu(this,a);return H(a)};var fu=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=V(a,Xt,3);0<c.length&&N(b,3,c,Yt);c=V(a,Xt,4);0<c.length&&N(b,4,c,Yt);c=V(a,bu,5);0<c.length&&N(b,5,c,cu);c=Q(a,6);0<c.length&&vq(b,6,c);c=Q(a,7);null!=c&&K(b,7,c);c=V(a,$t,8);0<c.length&&N(b,8,c,au);c=Q(a,9);null!=c&&J(b,9,c);c=Q(a,10);0<c.length&&sq(b,10,c)};eu.prototype.g=function(){return Q(this,1)};
eu.prototype.na=function(a){S(this,1,a)};var gu=function(a,b){Gq(a,3,b)},hu=function(a,b){S(a,6,b||[])};var iu=function(a){P(this,a,0,-1,null)};r(iu,O);iu.prototype.s=function(){var a=new G;ju(this,a);return H(a)};var ju=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&K(b,4,c);c=U(a,ku,5);null!=c&&M(b,5,c,lu);c=U(a,mu,6);null!=c&&M(b,6,c,nu);c=U(a,ou,7);null!=c&&M(b,7,c,pu);c=U(a,qu,8);null!=c&&M(b,8,c,ru)},ku=function(a){P(this,a,0,-1,null)};r(ku,O);ku.prototype.s=function(){var a=new G;lu(this,a);return H(a)};
var lu=function(a,b){var c;c=Q(a,1);null!=c&&J(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&pq(b,3,c)};ku.prototype.cc=function(){return Q(this,1)};var mu=function(a){P(this,a,0,-1,null)};r(mu,O);mu.prototype.s=function(){var a=new G;nu(this,a);return H(a)};var nu=function(a,b){a=Q(a,1);null!=a&&L(b,1,a)},ou=function(a){P(this,a,0,-1,su)};r(ou,O);var su=[3];ou.prototype.s=function(){var a=new G;pu(this,a);return H(a)};
var pu=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=U(a,Gt,2);null!=c&&M(b,2,c,Ht);c=V(a,tu,3);0<c.length&&N(b,3,c,uu)},tu=function(a){P(this,a,0,-1,null)};r(tu,O);tu.prototype.s=function(){var a=new G;uu(this,a);return H(a)};var uu=function(a,b){var c;c=Q(a,1);null!=c&&pq(b,1,c);c=Q(a,2);null!=c&&pq(b,2,c);c=Q(a,3);null!=c&&pq(b,3,c);c=Q(a,4);null!=c&&pq(b,4,c)};tu.prototype.h=function(a){S(this,3,a)};tu.prototype.l=function(a){S(this,4,a)};var qu=function(a){P(this,a,0,-1,null)};r(qu,O);
qu.prototype.s=function(){var a=new G;ru(this,a);return H(a)};var ru=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&pq(b,2,c)};h=iu.prototype;h.T=function(){return Q(this,1)};h.R=function(a){S(this,1,a)};h.M=function(){return Q(this,2)};h.ma=function(a){S(this,2,a)};h.ga=function(){return Q(this,3)};h.nf=function(a){S(this,3,a)};h.U=function(){return Q(this,4)};h.Ma=function(a){S(this,4,a)};h.Id=function(a){W(this,5,a)};var vu=function(a){P(this,a,0,-1,null)};r(vu,O);vu.prototype.s=function(){var a=new G;wu(this,a);return H(a)};var wu=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&K(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&L(b,4,c);c=Q(a,5);null!=c&&L(b,5,c);c=Q(a,6);null!=c&&L(b,6,c);c=Q(a,7);null!=c&&L(b,7,c);c=U(a,xu,8);null!=c&&M(b,8,c,yu);c=U(a,Jt,9);null!=c&&M(b,9,c,Kt);c=U(a,zu,10);null!=c&&M(b,10,c,Au);c=Q(a,11);null!=c&&J(b,11,c)},xu=function(a){P(this,a,0,-1,Bu)};r(xu,O);
var Bu=[1,2,3];xu.prototype.s=function(){var a=new G;yu(this,a);return H(a)};var yu=function(a,b){var c;c=Q(a,1);0<c.length&&sq(b,1,c);c=V(a,Cu,2);0<c.length&&N(b,2,c,Du);c=Q(a,3);0<c.length&&vq(b,3,c)},Cu=function(a){P(this,a,0,-1,Eu)};r(Cu,O);var Eu=[2];Cu.prototype.s=function(){var a=new G;Du(this,a);return H(a)};var Du=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);0<c.length&&sq(b,2,c)},zu=function(a){P(this,a,0,-1,null)};r(zu,O);zu.prototype.s=function(){var a=new G;Au(this,a);return H(a)};
var Au=function(a,b){a=Q(a,1);null!=a&&J(b,1,a)};zu.prototype.cc=function(){return Q(this,1)};h=vu.prototype;h.Sk=function(){return Q(this,1)};h.rf=function(a){S(this,1,a)};h.U=function(){return Q(this,2)};h.Ma=function(a){S(this,2,a)};h.Tk=function(){return Q(this,3)};h.na=function(a){S(this,3,a)};h.Qa=function(){return Q(this,4)};h.sf=function(a){S(this,4,a)};h.T=function(){return Q(this,5)};h.R=function(a){S(this,5,a)};h.M=function(){return Q(this,6)};h.ma=function(a){S(this,6,a)};
h.ga=function(){return Q(this,7)};h.Id=function(a){W(this,10,a)};var Gu=function(a){P(this,a,0,-1,Fu)};r(Gu,O);var Fu=[1];Gu.prototype.s=function(){var a=new G;Hu(this,a);return H(a)};var Hu=function(a,b){a=Q(a,1);0<a.length&&vq(b,1,a)};var Iu=function(a){P(this,a,0,-1,null)};r(Iu,O);Iu.prototype.s=function(){var a=new G;Ju(this,a);return H(a)};var Ju=function(a,b){a=U(a,Gu,1);null!=a&&M(b,1,a,Hu)};var Ku=function(a){P(this,a,0,-1,null)};r(Ku,O);Ku.prototype.s=function(){var a=new G;Lu(this,a);return H(a)};var Lu=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c)};Ku.prototype.T=function(){return Q(this,1)};Ku.prototype.R=function(a){S(this,1,a)};Ku.prototype.M=function(){return Q(this,2)};Ku.prototype.ma=function(a){S(this,2,a)};var Nu=function(a){P(this,a,0,-1,Mu)};r(Nu,O);var Mu=[2,3];Nu.prototype.s=function(){var a=new G;Ou(this,a);return H(a)};var Ou=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=a.sa();0<c.length&&N(b,2,c,st);c=a.Ia();0<c.length&&N(b,3,c,Lu);c=Q(a,4);null!=c&&K(b,4,c);c=a.Fa();null!=c&&M(b,5,c,Lu);c=Q(a,6);null!=c&&K(b,6,c)};h=Nu.prototype;h.C=function(){return U(this,X,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,rt,2)};
h.Ia=function(){return V(this,Ku,3)};h.Fa=function(){return U(this,Ku,5)};var Pu=function(a){P(this,a,0,-1,null)};r(Pu,O);Pu.prototype.s=function(){var a=new G;Qu(this,a);return H(a)};var Qu=function(a,b){a=Q(a,1);null!=a&&K(b,1,a)};var Ru=function(a){P(this,a,0,-1,null)};r(Ru,O);Ru.prototype.s=function(){var a=new G;Su(this,a);return H(a)};var Su=function(a,b){var c;c=Q(a,1);null!=c&&K(b,1,c);c=Q(a,2);null!=c&&I(b,2,c)};var Uu=function(a){P(this,a,0,-1,Tu)};r(Uu,O);var Tu=[3];Uu.prototype.s=function(){var a=new G;Vu(this,a);return H(a)};var Vu=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);0<c.length&&vq(b,3,c);c=Q(a,9);null!=c&&mq(b,9,c);c=Q(a,4);null!=c&&K(b,4,c);c=U(a,dt,5);null!=c&&M(b,5,c,et);c=U(a,Ru,7);null!=c&&M(b,7,c,Su);c=U(a,Pu,8);null!=c&&M(b,8,c,Qu);c=Q(a,6);null!=c&&J(b,6,c)};Uu.prototype.T=function(){return Q(this,1)};Uu.prototype.R=function(a){S(this,1,a)};var Xu=function(a){P(this,a,0,-1,Wu)};r(Xu,O);var Wu=[2];Xu.prototype.s=function(){var a=new G;Yu(this,a);return H(a)};var Yu=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=a.sa();0<c.length&&N(b,2,c,Vu)};Xu.prototype.C=function(){return U(this,X,1)};Xu.prototype.D=function(a){W(this,1,a)};Xu.prototype.O=function(){this.D(void 0)};Xu.prototype.sa=function(){return V(this,Uu,2)};var Zu=function(a){P(this,a,0,-1,null)};r(Zu,O);Zu.prototype.s=function(){var a=new G;$u(this,a);return H(a)};var $u=function(a,b){a=Q(a,1);null!=a&&L(b,1,a)};Zu.prototype.T=function(){return Q(this,1)};Zu.prototype.R=function(a){S(this,1,a)};var bv=function(a){P(this,a,0,-1,av)};r(bv,O);var av=[2,3];bv.prototype.s=function(){var a=new G;cv(this,a);return H(a)};var cv=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=a.sa();0<c.length&&N(b,2,c,nt);c=a.Ia();0<c.length&&N(b,3,c,$u);c=a.Fa();null!=c&&M(b,4,c,$u)};h=bv.prototype;h.C=function(){return U(this,X,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,mt,2)};h.Ia=function(){return V(this,Zu,3)};h.Fa=function(){return U(this,Zu,4)};var dv=function(a){P(this,a,0,-1,null)};r(dv,O);dv.prototype.s=function(){var a=new G;ev(this,a);return H(a)};var ev=function(a,b){a=Q(a,1);null!=a&&L(b,1,a)};dv.prototype.g=function(){return Q(this,1)};dv.prototype.na=function(a){S(this,1,a)};var gv=function(a){P(this,a,0,-1,fv)};r(gv,O);var fv=[2,3];gv.prototype.s=function(){var a=new G;hv(this,a);return H(a)};var hv=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=a.sa();0<c.length&&N(b,2,c,fu);c=a.Ia();0<c.length&&N(b,3,c,ev);c=a.Fa();null!=c&&M(b,4,c,ev)};h=gv.prototype;h.C=function(){return U(this,X,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,eu,2)};h.Ia=function(){return V(this,dv,3)};h.Fa=function(){return U(this,dv,4)};var iv=function(a){P(this,a,0,-1,null)};r(iv,O);iv.prototype.s=function(){var a=new G;jv(this,a);return H(a)};var jv=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c)};h=iv.prototype;h.T=function(){return Q(this,1)};h.R=function(a){S(this,1,a)};h.M=function(){return Q(this,2)};h.ma=function(a){S(this,2,a)};h.ga=function(){return Q(this,3)};h.Pk=function(a){S(this,3,a)};var lv=function(a){P(this,a,0,-1,kv)};r(lv,O);var kv=[2,3];lv.prototype.s=function(){var a=new G;mv(this,a);return H(a)};var mv=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=a.sa();0<c.length&&N(b,2,c,ju);c=a.Ia();0<c.length&&N(b,3,c,jv);c=a.Fa();null!=c&&M(b,4,c,jv)};h=lv.prototype;h.C=function(){return U(this,X,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,iu,2)};h.Ia=function(){return V(this,iv,3)};h.Fa=function(){return U(this,iv,4)};var nv=function(a){P(this,a,0,-1,null)};r(nv,O);nv.prototype.s=function(){var a=new G;ov(this,a);return H(a)};var ov=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&L(b,3,c);c=Q(a,4);null!=c&&K(b,4,c)};h=nv.prototype;h.T=function(){return Q(this,1)};h.R=function(a){S(this,1,a)};h.qf=function(){return Q(this,2)};h.na=function(a){S(this,2,a)};h.Qa=function(){return Q(this,3)};h.Rk=function(a){S(this,3,a)};h.pf=function(){return Q(this,4)};
h.Qk=function(a){S(this,4,a)};var qv=function(a){P(this,a,0,-1,pv)};r(qv,O);var pv=[2,3];qv.prototype.s=function(){var a=new G;rv(this,a);return H(a)};var rv=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Y);c=a.sa();0<c.length&&N(b,2,c,wu);c=a.Ia();0<c.length&&N(b,3,c,ov);c=a.Fa();null!=c&&M(b,4,c,ov)};h=qv.prototype;h.C=function(){return U(this,X,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,vu,2)};h.Ia=function(){return V(this,nv,3)};h.Fa=function(){return U(this,nv,4)};var tv=function(a){P(this,a,0,-1,sv)};r(tv,O);
var sv=[7,13,16,17,18],vv=function(a){a=new Tp(a);var b=new tv;return uv(b,a)},uv=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);a.g(c);break;case 2:c=Xp(b);S(a,2,c);break;case 3:c=Xp(b);S(a,3,c);break;case 4:c=Sp(b.a);S(a,4,c);break;case 5:c=!!b.a.f();S(a,5,c);break;case 6:c=Xp(b);S(a,6,c);break;case 7:c=Xp(b);Q(a,7).push(c);break;case 8:c=!!b.a.f();S(a,8,c);break;case 9:c=!!b.a.f();S(a,9,c);break;case 10:c=Xp(b);S(a,10,c);break;case 11:c=Sp(b.a);S(a,11,c);break;case 12:c=new wv;
Wp(b,c,xv);yv(a,c);break;case 13:c=Yp(b,b.a.v);S(a,13,c||[]);break;case 14:c=new zv;Wp(b,c,Av);W(a,14,c);break;case 15:c=!!b.a.f();S(a,15,c);break;case 16:c=new Bv;Wp(b,c,Cv);Hq(a,16,c,Bv);break;case 17:c=new Dv;Wp(b,c,Ev);Hq(a,17,c,Dv);break;case 18:c=Yp(b,b.a.v);S(a,18,c||[]);break;default:Vp(b)}return a};tv.prototype.s=function(){var a=new G;Fv(this,a);return H(a)};
var Fv=function(a,b){var c;c=a.ob();0<c.length&&L(b,1,c);c=R(a,2,"");0<c.length&&L(b,2,c);c=R(a,3,"");0<c.length&&L(b,3,c);c=R(a,4,0);0!==c&&K(b,4,c);(c=a.ge())&&J(b,5,c);c=R(a,6,"");0<c.length&&L(b,6,c);c=Q(a,7);0<c.length&&vq(b,7,c);(c=R(a,8,!1))&&J(b,8,c);(c=R(a,9,!1))&&J(b,9,c);c=R(a,10,"");0<c.length&&L(b,10,c);c=R(a,11,0);0!==c&&K(b,11,c);c=U(a,wv,12);null!=c&&M(b,12,c,Gv);c=Q(a,13);0<c.length&&xq(b,13,c);c=U(a,zv,14);null!=c&&M(b,14,c,Hv);(c=R(a,15,!1))&&J(b,15,c);c=V(a,Bv,16);0<c.length&&
N(b,16,c,Iv);c=V(a,Dv,17);0<c.length&&N(b,17,c,Jv);c=Q(a,18);0<c.length&&xq(b,18,c)},wv=function(a){P(this,a,0,-1,null)};r(wv,O);var xv=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);S(a,1,c);break;default:Vp(b)}return a};wv.prototype.s=function(){var a=new G;Gv(this,a);return H(a)};var Gv=function(a,b){a=R(a,1,"");0<a.length&&L(b,1,a)},zv=function(a){P(this,a,0,-1,null)};r(zv,O);var Av=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);S(a,1,c);break;default:Vp(b)}return a};
zv.prototype.s=function(){var a=new G;Hv(this,a);return H(a)};var Hv=function(a,b){a=R(a,1,"");0<a.length&&L(b,1,a)},Bv=function(a){P(this,a,0,-1,null)};r(Bv,O);var Cv=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);S(a,1,c);break;case 2:c=Sp(b.a);S(a,2,c);break;default:Vp(b)}return a};Bv.prototype.s=function(){var a=new G;Iv(this,a);return H(a)};var Iv=function(a,b){var c;c=a.yb();0<c.length&&L(b,1,c);c=R(a,2,0);0!==c&&K(b,2,c)};Bv.prototype.yb=function(){return R(this,1,"")};
var Dv=function(a){P(this,a,0,-1,null)};r(Dv,O);var Ev=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);S(a,1,c);break;case 2:c=Sp(b.a);S(a,2,c);break;default:Vp(b)}return a};Dv.prototype.s=function(){var a=new G;Jv(this,a);return H(a)};var Jv=function(a,b){var c;c=a.yb();0<c.length&&L(b,1,c);c=R(a,2,0);0!==c&&K(b,2,c)};Dv.prototype.yb=function(){return R(this,1,"")};tv.prototype.ob=function(){return R(this,1,"")};tv.prototype.g=function(a){S(this,1,a)};
tv.prototype.ge=function(){return R(this,5,!1)};var Kv=function(a,b){S(a,7,b||[])},yv=function(a,b){W(a,12,b)};var Lv=function(a){P(this,a,0,-1,null)};r(Lv,O);Lv.prototype.s=function(){var a=new G;Mv(this,a);return H(a)};var Mv=function(a,b){a=a.ub();0!==a&&mq(b,1,a)};Lv.prototype.ub=function(){return R(this,1,0)};var Ov=function(a){P(this,a,0,-1,Nv)};r(Ov,O);var Nv=[2,3];Ov.prototype.s=function(){var a=new G;Pv(this,a);return H(a)};var Pv=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Mv);c=a.sa();0<c.length&&N(b,2,c,Fv);c=a.Ia();0<c.length&&vq(b,3,c);c=a.Fa();0<c.length&&L(b,4,c)};h=Ov.prototype;h.C=function(){return U(this,Lv,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,tv,2)};h.Ia=function(){return Q(this,3)};h.Fa=function(){return R(this,4,"")};var Qv=function(a){P(this,a,0,-1,null)};r(Qv,O);Qv.prototype.s=function(){var a=new G;Rv(this,a);return H(a)};var Rv=function(a,b){var c;c=R(a,1,0);0!==c&&mq(b,1,c);c=R(a,2,0);0!==c&&I(b,2,c)};var Sv=function(a){P(this,a,0,-1,null)};r(Sv,O);Sv.prototype.s=function(){var a=new G;Tv(this,a);return H(a)};var Tv=function(a,b){var c;c=R(a,1,"");0<c.length&&L(b,1,c);c=R(a,2,"");0<c.length&&L(b,2,c);c=R(a,3,0);0!==c&&mq(b,3,c);c=U(a,Qv,4);null!=c&&M(b,4,c,Rv);c=U(a,Uv,5);null!=c&&M(b,5,c,Vv)},Uv=function(a){P(this,a,0,-1,null)};r(Uv,O);Uv.prototype.s=function(){var a=new G;Vv(this,a);return H(a)};var Vv=function(a,b){var c;c=R(a,1,"");0<c.length&&L(b,1,c);(c=R(a,2,!1))&&J(b,2,c)};var Xv=function(a){P(this,a,0,-1,Wv)};r(Xv,O);var Wv=[2];Xv.prototype.s=function(){var a=new G;Yv(this,a);return H(a)};var Yv=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Mv);c=a.sa();0<c.length&&N(b,2,c,Tv);c=a.Fa();0<c.length&&L(b,3,c)};h=Xv.prototype;h.C=function(){return U(this,Lv,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,Sv,2)};h.Fa=function(){return R(this,3,"")};var $v=function(a){P(this,a,0,-1,Zv)};r($v,O);var Zv=[10];$v.prototype.s=function(){var a=new G;aw(this,a);return H(a)};var aw=function(a,b){var c;c=a.yb();0<c.length&&L(b,1,c);c=a.getTitle();0<c.length&&L(b,2,c);c=R(a,4,0);0!==c&&K(b,4,c);c=R(a,5,0);0!==c&&K(b,5,c);c=U(a,Qv,7);null!=c&&M(b,7,c,Rv);c=U(a,Qv,8);null!=c&&M(b,8,c,Rv);c=R(a,9,"");0<c.length&&L(b,9,c);c=Q(a,10);0<c.length&&xq(b,10,c);c=R(a,11,"");0<c.length&&L(b,11,c);c=U(a,bw,12);null!=c&&M(b,12,c,cw)},dw=function(a){P(this,a,0,-1,null)};
r(dw,O);dw.prototype.s=function(){var a=new G;ew(this,a);return H(a)};var ew=function(a,b){var c;c=R(a,1,0);0!==c&&K(b,1,c);c=a.getDeviceId();0<c.length&&L(b,2,c)};dw.prototype.getDeviceId=function(){return R(this,2,"")};var bw=function(a){P(this,a,0,-1,fw)};r(bw,O);var fw=[1];bw.prototype.s=function(){var a=new G;cw(this,a);return H(a)};var cw=function(a,b){a=V(a,dw,1);0<a.length&&N(b,1,a,ew)};$v.prototype.yb=function(){return R(this,1,"")};$v.prototype.getTitle=function(){return R(this,2,"")};
$v.prototype.setTitle=function(a){S(this,2,a)};var hw=function(a){P(this,a,0,-1,gw)};r(hw,O);var gw=[2,3];hw.prototype.s=function(){var a=new G;iw(this,a);return H(a)};var iw=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Mv);c=a.sa();0<c.length&&N(b,2,c,aw);c=a.Ia();0<c.length&&vq(b,3,c);c=a.Fa();0<c.length&&L(b,4,c)};h=hw.prototype;h.C=function(){return U(this,Lv,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,$v,2)};h.Ia=function(){return Q(this,3)};h.Fa=function(){return R(this,4,"")};var kw=function(a){P(this,a,0,-1,jw)};r(kw,O);var jw=[5],rw=function(a){a=new Tp(a);for(var b=new kw;Up(a)&&4!=a.b;)switch(a.f){case 1:var c=Xp(a);b.l(c);break;case 2:c=Xp(a);S(b,2,c);break;case 3:c=Xp(a);S(b,3,c);break;case 4:c=Sp(a.a);S(b,4,c);break;case 5:c=new lw;Wp(a,c,mw);Hq(b,5,c,lw);break;case 8:c=new nw;Wp(a,c,ow);W(b,8,c);break;case 6:c=new pw;Wp(a,c,qw);W(b,6,c);break;case 7:c=Xp(a);S(b,7,c);break;default:Vp(a)}return b};kw.prototype.s=function(){var a=new G;sw(this,a);return H(a)};
var sw=function(a,b){var c;c=a.g();0<c.length&&L(b,1,c);c=R(a,2,"");0<c.length&&L(b,2,c);c=R(a,3,"");0<c.length&&L(b,3,c);c=R(a,4,0);0!==c&&K(b,4,c);c=V(a,lw,5);0<c.length&&N(b,5,c,tw);c=U(a,nw,8);null!=c&&M(b,8,c,uw);c=U(a,pw,6);null!=c&&M(b,6,c,vw);c=R(a,7,"");0<c.length&&L(b,7,c)},lw=function(a){P(this,a,0,-1,null)};r(lw,O);
var mw=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);S(a,1,c);break;case 2:c=Xp(b);S(a,2,c);break;case 3:c=Xp(b);S(a,3,c);break;case 4:c=Xp(b);a.Xc(c);break;default:Vp(b)}return a};lw.prototype.s=function(){var a=new G;tw(this,a);return H(a)};var tw=function(a,b){var c;c=R(a,1,"");0<c.length&&L(b,1,c);c=R(a,2,"");0<c.length&&L(b,2,c);c=R(a,3,"");0<c.length&&L(b,3,c);c=R(a,4,"");0<c.length&&L(b,4,c)};lw.prototype.Xc=function(a){S(this,4,a)};var nw=function(a){P(this,a,0,-1,null)};
r(nw,O);var ow=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);S(a,1,c);break;default:Vp(b)}return a};nw.prototype.s=function(){var a=new G;uw(this,a);return H(a)};var uw=function(a,b){a=R(a,1,"");0<a.length&&L(b,1,a)},ww=function(a){P(this,a,0,-1,null)};r(ww,O);var xw=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);S(a,1,c);break;case 2:c=Xp(b);S(a,2,c);break;default:Vp(b)}return a};ww.prototype.s=function(){var a=new G;yw(this,a);return H(a)};
var yw=function(a,b){var c;c=R(a,1,"");0<c.length&&L(b,1,c);c=R(a,2,"");0<c.length&&L(b,2,c)},zw=function(a){P(this,a,0,-1,null)};r(zw,O);var Aw=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Sp(b.a);S(a,1,c);break;case 2:c=Xp(b);S(a,2,c);break;case 3:c=Xp(b);S(a,3,c);break;default:Vp(b)}return a};zw.prototype.s=function(){var a=new G;Bw(this,a);return H(a)};var Bw=function(a,b){var c;c=a.ie();0!==c&&K(b,1,c);c=a.yb();0<c.length&&L(b,2,c);c=R(a,3,"");0<c.length&&L(b,3,c)};
zw.prototype.ie=function(){return R(this,1,0)};zw.prototype.yb=function(){return R(this,2,"")};var pw=function(a){P(this,a,0,-1,null)};r(pw,O);var qw=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=new ww;Wp(b,c,xw);W(a,1,c);break;case 2:c=new zw;Wp(b,c,Aw);W(a,2,c);break;case 3:c=Xp(b);S(a,3,c);break;case 4:c=Xp(b);S(a,4,c);break;case 5:c=Xp(b);S(a,5,c);break;default:Vp(b)}return a};pw.prototype.s=function(){var a=new G;vw(this,a);return H(a)};
var vw=function(a,b){var c;c=a.td();null!=c&&M(b,1,c,yw);c=U(a,zw,2);null!=c&&M(b,2,c,Bw);c=R(a,3,"");0<c.length&&L(b,3,c);c=R(a,4,"");0<c.length&&L(b,4,c);c=R(a,5,"");0<c.length&&L(b,5,c)};pw.prototype.td=function(){return U(this,ww,1)};kw.prototype.g=function(){return R(this,1,"")};kw.prototype.l=function(a){S(this,1,a)};var Dw=function(a){P(this,a,0,-1,Cw)};r(Dw,O);var Cw=[2];Dw.prototype.s=function(){var a=new G;Ew(this,a);return H(a)};var Ew=function(a,b){var c;c=a.C();null!=c&&M(b,1,c,Mv);c=a.sa();0<c.length&&N(b,2,c,sw);c=a.Fa();0<c.length&&L(b,3,c)};h=Dw.prototype;h.C=function(){return U(this,Lv,1)};h.D=function(a){W(this,1,a)};h.O=function(){this.D(void 0)};h.sa=function(){return V(this,kw,2)};h.Fa=function(){return R(this,3,"")};var Fw=function(a){P(this,a,0,-1,null)};r(Fw,O);Fw.prototype.s=function(){var a=new G;Gw(this,a);return H(a)};var Gw=function(a,b){var c;c=a.g();null!=c&&M(b,1,c,Pv);c=a.v();null!=c&&M(b,2,c,Ew);c=a.h();null!=c&&M(b,3,c,iw);c=a.l();null!=c&&M(b,4,c,Yv)};Fw.prototype.g=function(){return U(this,Ov,1)};Fw.prototype.v=function(){return U(this,Dw,2)};Fw.prototype.h=function(){return U(this,hw,3)};Fw.prototype.l=function(){return U(this,Xv,4)};var Hw=function(a){P(this,a,0,-1,null)};r(Hw,O);Hw.prototype.s=function(){var a=new G;Iw(this,a);return H(a)};var Iw=function(a,b){var c;c=a.Hg();null!=c&&M(b,1,c,Ou);c=a.Kg();null!=c&&M(b,2,c,hv);c=a.Mg();null!=c&&M(b,3,c,rv);c=a.Cg();null!=c&&M(b,4,c,pt);c=a.Lg();null!=c&&M(b,5,c,mv);c=a.Gg();null!=c&&M(b,7,c,ys);c=a.Ig();null!=c&&M(b,8,c,cv);c=a.Eg();null!=c&&M(b,9,c,bt);c=a.Og();null!=c&&M(b,10,c,Yu);c=a.Dg();null!=c&&M(b,11,c,Is);c=a.Ng();null!=c&&M(b,13,c,Gw)};h=Hw.prototype;
h.Hg=function(){return U(this,Nu,1)};h.Kg=function(){return U(this,gv,2)};h.Mg=function(){return U(this,qv,3)};h.Cg=function(){return U(this,ot,4)};h.Lg=function(){return U(this,lv,5)};h.Gg=function(){return U(this,xs,7)};h.Ig=function(){return U(this,bv,8)};h.Eg=function(){return U(this,at,9)};h.Og=function(){return U(this,Xu,10)};h.Dg=function(){return U(this,Hs,11)};h.Ng=function(){return U(this,Fw,13)};var Jw=function(a){P(this,a,0,-1,null)};r(Jw,O);Jw.prototype.s=function(){var a=new G;Kw(this,a);return H(a)};var Kw=function(a,b){var c;c=U(a,Ts,1);null!=c&&M(b,1,c,Us);c=U(a,Hw,2);null!=c&&M(b,2,c,Iw);c=U(a,Iu,3);null!=c&&M(b,3,c,Ju)};var Mw=function(a){P(this,a,"hcbu",-1,Lw)};r(Mw,O);var Lw=[1];Mw.prototype.s=function(){var a=new G,b;b=V(this,Jw,1);0<b.length&&N(a,1,b,Kw);return H(a)};Qq("hcbu",Mw);var Nw=function(){},Ow=function(a,b){a.W||r(a,Nw);b.Qb=a;do b=b.W&&b.W.constructor;while(b&&!b.Qb);if(b&&b.Qb!==a.W.constructor)throw Error("delegate base must derive from superclass delegate base");},Pw=function(a,b,c){if(!a.W){for(var d in a.prototype)if(a.prototype.hasOwnProperty(d))throw Error("delegate registered after defining methods. you should extend your delegate base explicitly immediately after defining your delegate class");r(a,b)}c=c||0;a.wg=c;if(b.hb){b=b.hb;d=0;for(var e=b.length-
1;d<=e;){var f=d+e>>1;c>b[f].wg?e=f-1:d=f+1}d<b.length&&b[d].wg==c&&++d;b.splice(d,0,a)}else b.hb=[a]},Sw=function(a){var b=a.Qb,c=function(a){c.W.constructor.call(this,a);var b=this.hb.length;this.a=[];for(var d=0;d<b;++d)this.hb[d].Vq||(this.a[d]=new this.hb[d](a))};r(c,b);for(var d=[];a;){if(b=a.Qb){b.hb&&yb(d,b.hb);var e=b.prototype,f;for(f in e)if(e.hasOwnProperty(f)&&xa(e[f])&&e[f]!==b){var g=!!e[f].Uq,m=Qw(f,e,d,g);(g=Rw(f,e,m,g))&&(c.prototype[f]=g)}}a=a.W&&a.W.constructor}c.prototype.hb=
d;return c},Qw=function(a,b,c,d){for(var e=[],f=0;f<c.length&&(c[f].prototype[a]===b[a]||(e.push(f),!d));++f);return e},Rw=function(a,b,c,d){var e;c.length?d?e=function(b){var d=this.a[c[0]];return d?d[a].apply(this.a[c[0]],arguments):this.hb[c[0]].prototype[a].apply(this,arguments)}:b[a].Hj?e=function(b){var d;a:{d=Array.prototype.slice.call(arguments,0);for(var e=0;e<c.length;++e){var f=this.a[c[e]];if(f=f?f[a].apply(f,d):this.hb[c[e]].prototype[a].apply(this,d)){d=f;break a}}d=!1}return d}:b[a].ug?
e=function(b){var d;a:{d=Array.prototype.slice.call(arguments,0);for(var e=0;e<c.length;++e){var f=this.a[c[e]],f=f?f[a].apply(f,d):this.hb[c[e]].prototype[a].apply(this,d);if(null!=f){d=f;break a}}d=void 0}return d}:b[a].ik?e=function(b){for(var d=Array.prototype.slice.call(arguments,0),e=0;e<c.length;++e){var f=this.a[c[e]];f?f[a].apply(f,d):this.hb[c[e]].prototype[a].apply(this,d)}}:e=function(b){for(var d=Array.prototype.slice.call(arguments,0),e=[],f=0;f<c.length;++f){var y=this.a[c[f]];e.push(y?
y[a].apply(y,d):this.hb[c[f]].prototype[a].apply(this,d))}return e}:d||b[a].Hj||b[a].ug||b[a].ik?e=null:e=Tw;return e},Tw=function(){return[]};Nw.prototype.We=function(a){if(this.a)for(var b=0;b<this.a.length;++b)if(this.a[b]instanceof a)return this.a[b];return null};var Uw=function(){var a=function(){};a.ug=!0;return a};var Vw=new sr("pVbxBc"),Ww=new sr("n73qwf");var Xw=function(a){P(this,a,0,-1,null)};r(Xw,O);Xw.prototype.s=function(){var a=new G;Yw(this,a);return H(a)};var Yw=function(a,b){var c;c=Q(a,1);null!=c&&I(b,1,c);c=Q(a,2);null!=c&&I(b,2,c);c=Q(a,3);null!=c&&I(b,3,c);c=Q(a,4);null!=c&&I(b,4,c);c=Q(a,5);null!=c&&I(b,5,c);c=Q(a,6);null!=c&&I(b,6,c);c=Q(a,7);null!=c&&I(b,7,c);c=Q(a,8);null!=c&&I(b,8,c);c=Q(a,9);null!=c&&I(b,9,c);c=Q(a,11);null!=c&&J(b,11,c);c=Q(a,12);null!=c&&I(b,12,c);c=Q(a,13);null!=c&&I(b,13,c)};var $w=function(a){P(this,a,0,-1,Zw)};r($w,O);var Zw=[3];$w.prototype.s=function(){var a=new G;ax(this,a);return H(a)};var ax=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=V(a,bx,3);0<c.length&&N(b,3,c,cx)},bx=function(a){P(this,a,0,-1,null)};r(bx,O);bx.prototype.s=function(){var a=new G;cx(this,a);return H(a)};
var cx=function(a,b){var c;c=Q(a,1);null!=c&&L(b,1,c);c=Q(a,2);null!=c&&L(b,2,c);c=Q(a,3);null!=c&&I(b,3,c);c=Q(a,4);null!=c&&I(b,4,c);c=Q(a,5);null!=c&&I(b,5,c)};bx.prototype.getName=function(){return Q(this,2)};var ex=function(a){P(this,a,"hc:cc",-1,dx)};r(ex,O);var dx=[14,15];
ex.prototype.s=function(){var a=new G,b;b=Q(this,1);null!=b&&K(a,1,b);b=Q(this,2);null!=b&&L(a,2,b);b=Q(this,3);null!=b&&L(a,3,b);b=Q(this,4);null!=b&&L(a,4,b);b=Q(this,5);null!=b&&K(a,5,b);b=Q(this,6);null!=b&&L(a,6,b);b=Q(this,7);null!=b&&L(a,7,b);b=Q(this,8);null!=b&&J(a,8,b);b=Q(this,9);null!=b&&pq(a,9,b);b=Q(this,10);null!=b&&L(a,10,b);b=Q(this,11);null!=b&&L(a,11,b);b=Q(this,12);null!=b&&L(a,12,b);b=U(this,Xw,13);null!=b&&M(a,13,b,Yw);b=Q(this,14);0<b.length&&vq(a,14,b);b=Q(this,15);0<b.length&&
vq(a,15,b);b=Q(this,16);null!=b&&J(a,16,b);b=U(this,$w,17);null!=b&&M(a,17,b,ax);b=Q(this,18);null!=b&&J(a,18,b);b=U(this,fx,19);null!=b&&M(a,19,b,gx);b=Q(this,20);null!=b&&I(a,20,b);return H(a)};var fx=function(a){P(this,a,0,-1,null)};r(fx,O);fx.prototype.s=function(){var a=new G;gx(this,a);return H(a)};var gx=function(a,b){var c;c=Q(a,1);null!=c&&I(b,1,c);c=Q(a,2);null!=c&&I(b,2,c);c=Q(a,3);null!=c&&I(b,3,c)};Qq("hc:cc",ex);var hx=function(a,b){S(a,4,b)};ex.prototype.l=function(a){S(this,6,a)};var jx=function(a){if(!a.ka){var b;for(b=a.constructor;b&&!b.Qb;)b=b.W&&b.W.constructor;b.Qb.xg||(b.Qb.xg=Sw(b));b=new b.Qb.xg(a);a.ka=b;a.We||(a.We=ix)}},ix=function(a){return this.ka.We(a)};var kx={uj:0,ii:1,TIMEOUT:2,ERROR:3,jo:4,xm:5,jg:6,pn:7,Km:8,fi:9,Om:10,Mp:11,uq:12,vp:13,am:14,mn:15,Pn:16,Hq:17,fm:18,Nn:19,bq:20,Fo:21,Lm:22,jn:23,Vo:24,hq:25,fq:26,Ii:27,Sn:28,Eq:29,Lp:30,Ko:31,um:32,nm:33,Fq:34,rp:35,Oq:36,Iq:37,Jn:38,In:39,Kn:40,Lq:41,wp:42,cn:43,kn:44,Jq:45,km:46,No:47,pp:48,Lo:49,qp:50,jp:51,lp:52,kp:53,np:54,mp:55,iq:56,nn:57,Qq:58,mo:59,ao:60,lm:61,em:62,Im:63,fo:64,Cn:65,An:66,Un:67,Dn:68,mm:69,sn:70,sm:71,Mo:72,Sm:73,cq:74,vm:102,Ep:104};var lx=function(a){var b=new ks;S(b,2,a);S(b,1,sc&&mc?2:sc?3:tc?4:uc?5:1);S(b,3,1);return b};var mx=function(a,b,c){this.a=a;this.b=b;this.f=c};var nx=function(a){for(var b="",c=0,d=!1,e=null,f=0;f<a.length;f++){var g=a[f];if(d)"\\"==e?g=null:'"'==g&&(d=!1);else if('"'==g)d=!0;else if(","==e&&","==g|"]"==g||"["==e&&","==g)b=b+a.substring(c,f)+"null",c=f;e=g}b+=a.substring(c);return JSON.parse(b)};var ox=function(a,b,c,d){this.status=a;this.f=b;this.a=c;this.response=d};ox.prototype.toString=function(){var a="["+this.status+"/"+this.f;null!=this.a&&(a+="/"+this.a);null!=this.response&&(a+=": ",a=ua(this.response)?a+wi(this.response,this.b,this).join("; "):a+this.b(this.response));return a+"]"};
ox.prototype.b=function(a){if(null!=a.error){var b=a.error;a=b.message+" "+b.code;b=b.data||b.errors;null!=b&&(b=wi(b,function(a){var b=a.domain+" - "+a.reason;null!=a.debugInfo&&(b+=" = "+Za(a.debugInfo,"\n",4).slice(0,3).join(" - "));return b}),ui(b)||(a+=": "+b.join(", ")));return a}return"Unknown"};var px=function(a,b,c,d){this.g=a;this.l=b;this.b=this.f=a;this.h=c||0;this.m=d||2};px.prototype.a=0;px.prototype.reset=function(){this.b=this.f=this.g;this.a=0};var qx=function(a){a.b=Math.min(a.l,a.b*a.m);a.f=Math.min(a.l,a.b+(a.h?Math.round(a.h*(Math.random()-.5)*2*a.b):0));a.a++};var sx=function(){this.A=new rx;this.h=new px(1E3,36E4);this.g=6E4;this.m=!1;this.u=[]};h=sx.prototype;h.toString=function(){return"<# "+this.a+" to "+(this.l||"")+" for "+this.w+">"};h.Xc=function(a){this.H=a;return this};h.Rh=function(a){this.l=a;return this};h.Dh=function(a){this.w=a;return this};h.Oh=function(a){this.aa=a;return this};h.Sh=function(a){this.o=a;return this};h.Ff=function(a){this.B=a;return this};h.Gf=function(a){this.b=a;return this};h.Th=function(a){this.f=a;return this};
h.je=function(){return this.A};h.Dl=function(a){this.v=a;return this};h.Al=function(a){this.g=a;return this};var tx=function(a){var b=a.h.f,b=Math.round(.5*b)+Math.floor(Math.random()*b);qx(a.h);return Math.min(b+0,36E4)};sx.prototype.cancel=function(){this.m=!0;this.Gf("c")};var rx=function(){};rx.prototype.Mh=function(a){this.a=a;return this};rx.prototype.Nh=function(a){this.b=a;return this};rx.prototype.callback=function(a){this.a(a)};var ux=new sr("FwiOSb");var vx=function(a,b){B.call(this);this.a=b;this.j=Xi("realtime.network.ApiaryClient");a.load(n(this.kk,this),n(this.lk,this));this.g=0;this.f=new C;this.b=new C;F(this.j,"Created apiary client")};r(vx,B);var wx=function(a,b,c,d){var e="\r\n\r\n--"+d+"\r\n";d="\r\n\r\n--"+d+"--\r\n";var f=e+"Content-Type: "+a+"\r\n\r\n"+(b&&!va(b)?b.la():b);t(c,function(a){f+=e+"Content-Type: "+a.type+"\r\nContent-transfer-encoding: "+a.a+"\r\n\r\n"+a.data+"\r\n\r\n"});return f+=d};h=vx.prototype;h.Dd=null;
h.kk=function(a){this.Dd=a;this.dispatchEvent("a");F(this.j,"Apiary client loaded")};h.lk=function(){this.w||(this.Dd=null,F(this.j,"Apiary client unloaded"))};h.X=function(){var a=this.f.La();t(a,xe);a=this.b.La();t(a,xe)};
h.request=function(a){if(!this.w&&!a.m)if(null!=this.Dd){var b=this.g++;a.a=b;this.a&&this.a.onRequest(a);var b=a.B,c=null!=a.F?a.F:{},d=null!=a.o?a.o:{},e=null!=a.K?a.K:"application/json";if(null!=a.f?a.f:1)d.alt="protojson",e="application/json+protobuf",null!=b&&(b=JSON.parse(b.la()));var f=a.u;if(0<f.length){c["MIME-Version"]="1.0";var g="END_OF_PART_"+Wa();c["Content-Type"]='multipart/related; boundary="'+g+'"';b=wx(e,b,f,g)}else null!=b&&(c["Content-Type"]=e);c["Accept-Language"]=a.H||"en";b=
{method:a.aa,path:a.w,params:d,headers:c,body:b};La(Ua(a.l||""))||(b.root=a.l||"");F(this.j,"Sending request "+a);try{var m=this.Dd.client.request(b);a.Gf("p");null!=a.g&&this.b.set(a.a,we(n(this.tl,this,a),a.g||void 0));m.execute(n(this.ll,this,a))}catch(q){aj(this.j,"Failed to enqueue request "+Zi(b),q),xx(this,a,new ox("fatal","request_queuing",null,null),null,0)}}else E(this.j,"Request when client is not ready!")};
h.tl=function(a){E(this.j,"Request timed out: "+a);xx(this,a,new ox("retry","deadline_exceeded",null,null),null,0)};
h.ll=function(a,b,c){if(this.w||"p"!=a.b)yx(this,a);else{var d=null,e="ok",f;yx(this,a);var g=null,m=null;try{var q=Yi(c),y=q.gapiRequest.data.body,g=q.gapiRequest.data.headers,d=nx(y)}catch(D){E(this.j,"Failed to parse the response for request "+a+": "+c,D),f="response_decoding",e="retry"}null!=b&&null!=b.error&&(m=b.error.code,E(this.j,"Request failed: "+a+": "+b.error.code+" - "+b.error.message),f="network_or_frontend",e="retry",400==b.error.code?(f="bad_request",e="fatal"):401==b.error.code?(f=
"unauthorized",e="fatal"):402==b.error.code?(f="payment_required",e="fatal"):403==b.error.code&&(f="forbidden",e="fatal"));"ok"==e&&null!=d.error&&(E(this.j,"Server returned an error for request "+a+": "+d.error.code+' "'+d.error.message+'": '+d.error.Xq[0].ac),f="backend",e="retry");"ok"==e&&((b=null!=a.f?a.f:!0)&&!ua(d)||!b&&!ya(d))&&(E(this.j,"Apiary returned bad response type for request "+a+": expected "+(b?"Array":"Object")+", received "+ra(d)),f="response_format",e="retry");if("ok"==e&&(a.Gf("o"),
a.je().callback(d),"o"!=a.b))switch(f="response_callback",a.b){case "r":E(this.j,"Error processing response for request "+a+": should retry.");e="retry";break;case "d":E(this.j,"Fatal error processing response for request "+a);e="fatal";break;default:aj(this.j,"Unexpected response state from processing the response for "+a+": "+a.b)}if("ok"==e)F(this.j,"Response processed successfully for request "+a),this.a&&this.a.b(a,d);else{b=0;if(null!=g&&null!=g["Retry-After"])try{b=1E3*parseInt(g["Retry-After"],
10),b=Math.min(Math.max(b,0),72E5)}catch(D){}xx(this,a,new ox(e,f,m,d),c,b)}}c=this.b.get(a.a);null!=c&&(this.b.remove(a.a),xe(c))};var yx=function(a,b){var c=a.f.get(b.a);null!=c&&(a.f.remove(b.a),xe(c))},xx=function(a,b,c,d,e){a.w||"p"!=b.b&&"r"!=b.b||(a.a&&a.a.onError(b,c,d),d=null!=b.v?b.v:0,"retry"==c.status&&0<d?(F(a.j,"Scheduling retry for request "+b),a.f.set(b.a,we(n(a.request,a,b),Math.max(tx(b),e)))):(b.cancel(),b.je().b(c)))};var zx=function(a,b,c,d,e){B.call(this);this.g=b;this.h=c;this.m=e||"https://clients6.google.com";this.f=d;this.a=a;this.u=Vb();null!=this.a.Dd?this.u.resolve():Nd(this.a,"a",function(){this.u.resolve()},!1,this)};r(zx,B);zx.prototype.request=function(a,b,c,d,e,f,g){this.u.a.then(function(){var m=(new sx).Rh(this.m).Dh("/"+this.g+"/"+this.h+"/"+a).Oh(b).Sh(c).Th(!k(g)||g).Ff(d),q=Vb();q.a.then(e,f||pa);m.je().Mh(n(q.resolve,q)).Nh(n(q.b,q));this.a.request(m)},null,this)};
zx.prototype.b=function(a,b,c,d,e){var f=La(Ua(this.f))?{}:{key:this.f};a=(new sx).Rh(this.m).Dh("/"+this.g+"/"+this.h+"/"+a).Oh("POST").Sh(f).Th(!0).Ff(b);null!=c&&a.Al(c);null!=d&&a.Dl(d);var g=Vb();a.je().Mh(n(function(a){var b=null;try{b=0<a.length?Lq(a):null}catch(T){a=new ox("fatal","response_decoding",null,a);g.b(a);return}var c=b,d=0;c&&xa(c.getResponseHeader)&&(c=c.getResponseHeader())&&xa(c.Aa)&&(d=c.Aa());1==d?g.resolve(b):(a=new ox("fatal","backend",null,a),g.b(a))},this)).Nh(n(g.b,g));
this.u.a.then(n(this.a.request,this.a,a));return g.a};var Ax=function(){this.a=null},Bx=function(a,b){if(!a.a||Q(a.a,2)<Q(b,2))a.a=Oq(b)},Cx=function(a){return a.a?Q(a.a,2)+";"+Q(a.a,1):null};var Dx=function(a,b,c){a=sh(a,encodeURIComponent("$ct"),c);if(null==navigator.sendBeacon||!navigator.sendBeacon(a,b)){c=a;var d="POST",e=b;a=sh(a,encodeURIComponent("$httpMethod"),"POST");a=sh(a,encodeURIComponent("$req"),b);2048>a.length&&(c=a,d="GET",e=null);try{var f=hj(fj);f.open(d,c,!1);f.send(e)}catch(g){b=Xi("realtime.network.Beacon"),aj(b,"Cannot fallback from sendBeacon",g)}}};var Ex=function(a,b,c,d,e,f){zx.call(this,a,b,c,d,e);this.o=f||new Ax};r(Ex,zx);Ex.prototype.b=function(a,b,c,d,e,f){f||Fx(this,b);return Ex.W.b.call(this,a,b,c,d,e).then(this.A,null,this)};var Fx=function(a,b){if(b&&a.o.a&&xa(b.C)&&xa(b.D)){var c=b.C()||new X;W(c,3,a.o.a);b.D(c)}};Ex.prototype.A=function(a){xa(a.getResponseHeader)&&1==a.getResponseHeader().Aa()&&Gx(this,a);return a};var Gx=function(a,b){(b=(b=xa(b.C)&&b.C()||null)&&U(b,os,3))&&Bx(a.o,b)};var Hx=function(){B.call(this);this.j=Xi("realtime.pushnotifications.Dispatcher")};r(Hx,B);
var Ix=[{Va:Hw.prototype.Kg,eventType:"j"},{Va:Hw.prototype.Mg,eventType:"l"},{Va:Hw.prototype.Ig,eventType:"g"},{Va:Hw.prototype.Hg,eventType:"h"},{Va:Hw.prototype.Lg,eventType:"k"},{Va:Hw.prototype.Cg,eventType:"c"},{Va:Hw.prototype.Gg,eventType:"d"},{Va:Hw.prototype.Dg,eventType:"e"},{Va:Hw.prototype.Og,eventType:"r"},{Va:Hw.prototype.Eg,eventType:"f"},{Va:Hw.prototype.Ng,eventType:"m"}],Jx=[{Va:Fw.prototype.g,eventType:"n"},{Va:Fw.prototype.l,eventType:"o"},{Va:Fw.prototype.h,eventType:"p"},{Va:Fw.prototype.v,
eventType:"q"}];Hx.prototype.a=function(a){var b=U(a,Hw,2),c,d;if(null!=b)for(a=0;a<Ix.length;a++){if(d=Ix[a].Va.call(b),null!=d)if("m"==Ix[a].eventType)for(var e=d,f=Jx,g=0;g<Ix.length;g++){if(d=f[g].Va.call(e),null!=d){c=f[g].eventType;break}}else{c=Ix[a].eventType;break}}else b=U(a,Iu,3),null!=b&&(d=U(b,Gu,1),null!=d&&(c="i"));null!=d?(F(this.j,"Received notification of type "+c+"."),this.dispatchEvent(new Kx(c,d))):E(this.j,"A batch notification is empty.")};
var Kx=function(a,b){A.call(this,a);this.notification=b};r(Kx,A);var Mx=function(a,b){ex.call(this,b);a instanceof Ex?(b=a,a=new zx(a.a,a.g,a.h,a.f,a.m)):a instanceof zx?b=new Ex(a.a,a.g,a.h,a.f,a.m,new Ax):a=b=a;this.g=b;this.o=a;this.h=new Lx;this.v=new Hx;null==Q(this,1)&&S(this,1,32);a=Q(this,2)||"rmjs";S(this,2,a);a=Q(this,3)||"Unknown";S(this,3,a);hx(this,Q(this,4)||"0.0");null==Q(this,5)&&S(this,5,0);this.l(Q(this,6)||Q(this,2)+Wa().toUpperCase());a=Q(this,7)||Q(this,6)+"@fake.com";S(this,7,a);null==Dq(this,9)&&S(this,9,.01);a=Q(this,10)||null;S(this,10,
a);a=Q(this,11)||"https://clients2.google.com/cr/report";S(this,11,a);a=Q(this,12)||null;S(this,12,a);a=U(this,Xw,13)||new Xw;W(this,13,a);null==Q(this,8)&&S(this,8,!1);null==Q(this,16)&&S(this,16,!1);a=Q(this,14)||[];S(this,14,a||[]);a=U(this,$w,17)||new $w;W(this,17,a);a=Q(this,18)||null;S(this,18,a)};r(Mx,ex);var Nx=new sr("CgjDUd");Mx.prototype.register=function(a){Ox(a,Nx,this);return this};Mx.prototype.l=function(a,b){b=b?Wa().toUpperCase():"";Mx.W.l.call(this,a+b)};
var Px=function(a){var b=new is,c=Q(a,1);S(b,1,c);var c=new es,d=Q(a,6);S(c,1,d);d=new ms;W(d,1,b);W(d,2,c);d.Xc("en");a=lx(Q(a,5));W(d,7,a);return d},Lx=function(){};Lx.prototype.a=pa;var Qx=function(a,b,c,d,e,f,g,m){this.a=null;this.o=!1;this.v=Vb();this.b=[];this.m=a?encodeURIComponent(String(a)):null;this.u=null;!d&&b&&(this.u=b);this.K=c||null;this.f=!d;this.g=null!=e?e:null;this.h=f||null;this.F=!!g;this.A=m||null};r(Qx,kd);var Rx;var Sx=Oe("https://apis.google.com/js/client.js");Sx instanceof Ne&&Sx.constructor===Ne&&Sx.b===Me?Rx=Sx.a:(ab("expected object of type Const, got '"+Sx+"'"),Rx="type_error:Const");var Tx=new bf;Tx.a=Rx;
Qx.prototype.init=function(){var a=n(function(a){this.a=a;var b=oa("client.request",a),c=oa("auth",a);b&&c?this.B():a.load("client",n(this.B,this))},this),b=Ux("gapi");b?a(b.gapi):Vx(this,a);return this.v.a};
var Ux=function(a){for(var b=window,c=oa(a,b);!c&&b!=window.top&&Wx(b.parent,a);)b=b.parent,c=oa(a,b);return c?b:null},Wx=function(a,b){try{return!!a&&null!=a.location.href&&ec(a,b)}catch(c){return!1}},Vx=function(a,b){var c=Ux("gapi_onload");if(c){var d=c.gapi_onload;c.gapi_onload=function(){d();b(c.gapi)}}else{window.gapi_onload=function(){b(window.gapi)};var e=document.createElement("script");e.src=cf(Tx);a.A&&Wq(e,Zi(a.A));document.getElementsByTagName("head")[0].appendChild(e)}};
Qx.prototype.B=function(){for(var a=0;a<this.b.length;a++)this.b[a].wa.resolve(Xx(this,this.b[a].sl));this.o=!0;this.v.resolve(this.a)};Qx.prototype.sendRequest=function(a){if(this.o)return Xx(this,a);var b=Vb();this.b.push({sl:a,wa:b});return b.a};
var Xx=function(a,b){var c,d,e,f=oa("config.get",a.a);a.f||(c=f("googleapis.config/auth/useFirstPartyAuth"),d=f("googleapis.config/auth/useOriginToken"));null!=a.g&&(e=f("client/cors"));try{var g=oa("config.update",a.a);a.f||(g("googleapis.config/auth/useFirstPartyAuth",!1),g("googleapis.config/auth/useOriginToken",!1));null!=a.g&&g("client/cors",a.g);var m=oa("client.request",a.a),q=Yx(a);b.headers&&ac(q,b.headers);var y={headers:q,root:a.K,path:b.path,method:b.method,body:b.body},D=b.params||{};
a.m&&!a.h?ac(D,{key:a.m}):a.h&&ac(D,{key:null});Tb(D)||(y.params=D);var T=be(m(y));b.callback&&T.then(function(a){b.callback.apply(null,[a.result,a])},function(a){b.callback.apply(null,[a.result,a])});return T}finally{g=oa("config.update",a.a),a.f||(g("googleapis.config/auth/useFirstPartyAuth",c),g("googleapis.config/auth/useOriginToken",d)),null!=a.g&&g("client/cors",e)}},Yx=function(a){if(a.f){if(a.h)return{Authorization:"Bearer "+a.h};var b=oa("auth.getAuthHeaderValueForFirstParty",a.a);return{Authorization:a.F?
b([]):b(),"X-Goog-AuthUser":a.u}}return{}};var Zx=function(a,b){this.data=a;this.cd=b};Zx.prototype.toString=function(){return"[op. result, version: "+this.cd+", resource count: "+this.data.length+"]"};var $x=function(){B.call(this)};r($x,B);var ay=function(a){this.a=a};ay.prototype.af=Wc;var by=function(a,b){this.b=a;this.a=b};var cy=function(a,b,c,d,e,f,g,m,q,y,D){this.a=a;this.w=u(b);this.v=u(c);this.K=u(d);this.m=wb(b,d);this.F=wb(c,e);this.b=f;this.o=u(g);this.u=u(m);this.A=u(q);this.h=wb(g,q);this.B=wb(m,y);this.l=D||Xc};cy.prototype.f=function(a){var b;if(a instanceof this.a)b=this.w;else if(a instanceof this.b)b=this.o;else return ab("Passed in object did not match resource or identifier type"),[];return fb(b,function(b){return b.call(a)})};
var dy=function(a,b){if(b instanceof a.a)a=a.K;else if(b instanceof a.b)a=a.A;else return ab("Passed in object did not match resource or identifier type"),[];return fb(a,function(a){return a.call(b)})};cy.prototype.g=function(a){var b;if(a instanceof this.a)b=this.m;else if(a instanceof this.b)b=this.h;else return ab("Passed in object did not match resource or identifier type"),[];return fb(b,function(b){return b.call(a)})};
cy.prototype.mb=function(a,b){var c=this.F;a.length!=c.length&&(b?a=wb(a,b):c=this.v);var d=new this.a;t(a,function(a,b){c[b].call(d,a)},this);return d};
var ey=function(a,b){var c=a.B;b.length!=c.length&&(c=a.u);var d=new a.b;t(b,function(a,b){c[b].call(d,a)},a);return d},fy=function(a,b){if(b instanceof a.a)a=a.m;else if(b instanceof a.b)a=a.h;else return ab("Passed in object did not match resource or identifier type"),!1;return!hb(a,function(a){return null==a.call(b)})},hy=function(a,b,c){b=gy(a,b,a.g);a=gy(a,c,a.g);return Gb(b,a)},gy=function(a,b,c){return b instanceof Array?b:c.call(a,b)};var iy=function(){B.call(this)};r(iy,B);qa(iy);var ky=function(a,b,c,d,e,f,g){B.call(this);this.b=d;this.F=e;this.g=ey(this.b,c);this.xa=++jy;this.G=Xi("realtime.collections.Collection."+this.xa);this.B=e.a;this.Xa=g||null;this.ja=f&&f.b||null;this.Ja=e.af();this.Ya=f&&f.a||null;this.Sa=new tr(this);this.l(this.Sa);this.data={};this.Pa=0;this.Da=[];this.Ca={};this.a=-2;this.m=!0;this.o=Vb();this.state="la";this.config=Oq(b);iy.S();this.H={};this.Ua=Wc};r(ky,B);var ly=new C(10,67);ky.prototype.Z=function(a){return new my(a.cd,a.data,[],"ha")};
var ny=function(a,b){return new my(b.cd,[],a,"ha")},jy=0,oy=0,py=function(a){"la"==a.state&&(a.state="ja",a.ja&&a.Sa.listen(a.ja,a.Ya,a.lh))};ky.prototype.start=function(a){a&&(this.g=Oq(a));"la"==this.state&&py(this);if("ja"!=this.state)return null;this.state="ka";qy(this);F(this.G,"Collection started: "+this.toString()+", "+this.xb());return null};
ky.prototype.stop=function(){if("ka"==this.state||"ja"==this.state)this.flush(),this.qa(),this.state="la",F(this.G,"Collection stopped: "+this.toString()+": "+this.xb())};var qy=function(a){a.m&&a.o&&(F(a.G,"Initial data available: "+a.toString()),a.o.resolve(a.Da),a.o=null)};ky.prototype.qa=function(){this.ja&&this.Sa.v(this.ja,this.Ya,this.lh)};
ky.prototype.mb=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];if(0==b.length)return this.b.mb(this.b.f(this.g));if(b[0]instanceof this.b.a)return this.b.mb(this.b.g(b[0]));b=Array.prototype.concat.apply(Array.prototype,b);return this.b.mb(this.b.f(this.g),b)};ky.prototype.ab=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];return this.Ca[ry(this,Array.prototype.concat.apply(Array.prototype,b))]||null};var sy=function(a){return"ka"==a.state&&!0};
ky.prototype.X=function(){this.flush();this.stop();null!=this.o&&(E(this.G,"Never any data: "+this.toString()),this.o.a.cancel(),this.o=null);ky.W.X.call(this)};ky.prototype.get=function(){return this.Da};ky.prototype.flush=function(){var a;do ty(this),a=this.u();while(0<a)};var ty=function(a){Mb(a.H,function(a){for(;a&&1<=a.length&&a[0].a;)a.shift()})},uy=function(a){return fb(Pb(a.data),function(a){return a.la()})};
ky.prototype.add=function(a,b){ry(this,a);if(vy(this,a)&&this.Ja)return b=wy(this,"na",a),id(this.u,this),b;a=this.F.Lb([a]);return xy(this,a,n(this.Z,this),b)};ky.prototype.modify=function(a,b){ry(this,a);if(vy(this,a)&&this.Ja)return b=wy(this,"oa",a),id(this.u,this),b;a=this.F.Mb([a]);return xy(this,a,n(this.Z,this),b)};ky.prototype.remove=function(a,b,c){var d=this.za(a);return vy(this,a)&&null==c&&this.Ja?(a=wy(this,"pa",d,b),id(this.u,this),a):xy(this,yy(this,[d],b),Ea(ny,[d]),c)};
var wy=function(a,b,c,d){var e=a.za(c).toString(),f=a.H[e]||[];a.H[e]=f;var g=null,e=f.length;if(1<=e&&!f[e-1].a)if(e=f[e-1],"na"==b){if("na"==e.type||"oa"==e.type)g=e.wa,f.pop(),zy(a,"k")}else if("oa"==b&&("na"==e.type||"oa"==e.type)){f=e.resource;b=JSON.parse(f.la());c=JSON.parse(c.la());for(d=0;d<c.length;d++)null!=c[d]&&!Mq(b[d],c[d])&&(b[d]=c[d]);c=new f.constructor(b);e.resource=c;zy(a,"j");return e.wa.a}a=new Ay(b,c,g,d);f.push(a);return a.wa.a};
ky.prototype.u=function(){var a=0,b={};Mb(this.H,function(c){if(c&&1<=c.length&&(c=c[0],!c.a)){c.a=!0;if("pa"==c.type&&c.b){var d=[c.resource];By(this,yy(this,d,c.b),Ea(ny,d),[c.wa],d)}else d=b[c.type]||[],d.push(c),b[c.type]=d;a++}},this);Mb(b,function(a,b){if(1<=a.length){var c=[],d=[];t(a,function(a){c.push(a.resource);d.push(a.wa)});switch(b){case "na":By(this,this.F.Lb(c),n(this.Z,this),d,c);break;case "oa":By(this,this.F.Mb(c),n(this.Z,this),d,c);break;case "pa":By(this,yy(this,c),Ea(ny,c),
d,c);break;default:ab("A request with type "+b+" was put in the queue.")}}},this);return a};var By=function(a,b,c,d,e){null==b&&t(d,function(a){a.b("Operation not available")});b.te(R(a.config,7,0));b.ue(R(a.config,8,6E4),R(a.config,13,6E4));e=fb(e,a.za,a);var f=b.se();f.then(n(a.Ag,a,e),n(a.Ag,a,e));me(f.then(n(a.ih,a,b,c,d,e)),n(a.jh,a,b,d));a.B.execute(b)};ky.prototype.zd=function(){return ce("Resync not supported")};ky.prototype.Lc=function(){return!0};
var yy=function(a,b,c){return a.F.Ub(fb(b,a.N,a),c)},vy=function(a,b){return b instanceof Cy?fy(a.b,a.N(b)):fy(a.b,b)},Dy=function(a,b){b=ey(a.b,a.b.g(b));return new Cy(a.b,b)},Ey=function(a,b){var c=a.b;b=a.N(b);a=gy(c,a.g,c.f);c=gy(c,b,c.f);return Gb(a,c)},xy=function(a,b,c,d){if(null==b)return ce("Operation not available");var e=Vb();d=null!=d?d:R(a.config,7,0);b.te(d);d=b.Ec()||R(a.config,8,6E4);var f=b.he()||Math.max(d,R(a.config,13,6E4)||0);b.ue(d,f);null!=e&&me(b.se().then(n(a.ih,a,b,c,[e],
null)),n(a.jh,a,b,[e]));F(a.G,"Executing operation: "+b);a.B.execute(b);return e.a};h=ky.prototype;
h.ih=function(a,b,c,d,e){F(this.G,"Operation executed: "+a+", result:"+e);zy(this,"h");null!=b&&(this.Lc(e.cd)?(a=b(e))?this.mf(a):F(this.G,"Operation resulted in no update"):sy(this)&&ab("Result of an operation must have a valid version number, if the collection is active."));!d||null==e.data||1>=e.data.length?c[0].resolve(e.data):t(c,function(a,b){var c=d[b];b=eb(e.data,function(a){return this.za(a).equals(c)},this);0==b.length&&aj(this.G,"Result data is empty after filtering for target resource id "+
c);a.resolve(b)},this)};h.jh=function(a,b,c){var d="Operation failed: "+c;aj(this.G,d,c instanceof Error?c:Error(d));zy(this,"g",new Fy(0,a.Ye(),c));t(b,function(a){a.b(c)});c.response&&c.response.getResponseHeader&&(a=c.response.getResponseHeader().Aa(),(b=ly.get(a))&&Gy(this,b,"Collection apiary operation failed with response code "+a+" triggering endcause "+b));return c};
h.Ag=function(a){var b=!1;t(a,function(a){var c=this.H[a.toString()];c&&1<=c.length?(c.shift(),b=b||1<=c.length):aj(this.G,"A writing request with resource id "+a+" completed but it is not in the request queue.")},this);b&&this.u()};h.lh=function(a){"ka"!=this.state&&"ja"!=this.state||this.lf(a)};
h.lf=function(a){var b=this.Pg(a);F(this.G,"Received push notification, version: "+b+", checking if any updates apply to this collection "+this.toString());var c=Hy(this,a);a=Iy(this,a);c.length||a.length?(F(this.G,"Notification applies to this collection: version: "+b+", add/modify: "+c.length+", remove:"+a.length),b=new my(b,c,a,"ga"),bj(this.G,"Created partial update for notification: "+b),$i(this.G,Qi,"Add/modify: ["+b.b.join("|")+"], remove: ["+b.f.join("|")+"]"),zy(this,"l"),this.mf(b)):F(this.G,
"Notification does not apply to this collection, ignoring.")};h.Pg=function(){return-2};
var Hy=function(a,b){var c=[];t(b.notification.sa(),function(a){var b=this.b;a=a instanceof b.a?a:new b.a(JSON.parse(a.la()));fy(this.b,a)?Ey(this,Dy(this,a))&&c.push(a):zy(this,"F","Pushed modified: "+a.la())},a);return c},Iy=function(a,b){if(!b.notification.Ia)return[];var c=[];t(b.notification.Ia(),function(a){var b=this.b.l(a);fy(this.b,b)?(a=Dy(this,b),Ey(this,a)&&c.push(a)):zy(this,"F","Pushed deleted: "+a.la())},a);return c};
ky.prototype.mf=function(a){bj(this.G,"Begin processing update: "+a);a instanceof my&&(bj(this.G,"Applying partial update: "+a),Jy(this,a));bj(this.G,"Finish processing update: "+a+": "+this.xb())};ky.prototype.xb=function(){return"state: "+this.state+", local version: "+this.a+", snapshot size: "+this.Pa};
var Jy=function(a,b){bj(a.G,"Processing partial update: "+b);$i(a.G,Qi,"Add/modify: ["+b.b.join("|")+"], remove: ["+b.f.join("|")+"]");t(b.b,function(a){fy(this.b,a)?this.data[ry(this,a)]=Oq(a):zy(this,"F","Partial update: "+a.la())},a);var c=[];t(b.f,function(a){var b=ry(this,a);this.data[b]?delete this.data[b]:c.push(a)},a);0<c.length&&zy(a,"G","Resources not found: "+Zi(c));Ky(a)},Ky=function(a){var b={},c={};Mb(a.data,function(a,d){this.Ua(a)&&(b[d]=a,c[d]=a)},a);var d=[],e=[];Mb(a.Ca,function(a,
f){var g=b[f];g?(delete c[f],a==g||a&&g&&a instanceof g.constructor&&Mq(Fq(a),Fq(g))||e.push(g)):d.push(a)});var f=Pb(c);a.Ca=b;a.Da=Pb(b);a.Pa=Ob(a.data);if(0<e.length||0<f.length||0<d.length)F(a.G,"Obtained update of the filtered view : modified: "+e.length+", added: "+f.length+", removed:"+d.length),$i(a.G,Qi,"Modified: ["+e.join("|")+"], added: ["+f.join("|")+"], removed: ["+d.join("|")+"]"),a.dispatchEvent(new Ly(e,f,d))},My=function(a,b){a.Ua=b;Ky(a)},zy=function(a,b,c){null!=a.Xa&&a.Xa.a(b,
c)};ky.prototype.za=function(a){return null==a||a instanceof Cy?a:Dy(this,a)};var ry=function(a,b){var c;ta(b)?c=b:c=b instanceof Cy?dy(a.b,b.a):dy(a.b,b);return Zi(c)},Ny=function(a){this.a=a;this.id=++oy},my=function(a,b,c,d){Ny.call(this,a);this.g=d;this.b=b;this.f=c};r(my,Ny);my.prototype.toString=function(){return"[Partial update id: "+this.id+", version: "+this.a+", add/modify: "+this.b.length+", remove: "+this.f.length+", type: "+this.g+"]"};
var Gy=function(a,b,c){"ma"!=a.state&&(a.qa(),a.state="ma",aj(a.G,"Collection failed: "+a.toString()+": "+a.xb(),Error(c)),a.dispatchEvent(new Oy(b,c)))},Ay=function(a,b,c,d){this.type=a;this.resource=b;this.wa=c||Vb();this.b=d||null;this.a=!1};ky.prototype.N=function(a){return a.a};var Cy=function(a,b){this.b=a;this.a=b};Cy.prototype.equals=function(a){return hy(this.b,this.a,a.a)};Cy.prototype.toString=function(){return this.a.la()};
var Ly=function(a,b,c){A.call(this,"w");this.b=b;this.a=a;this.removed=c};r(Ly,A);var Oy=function(a,b){A.call(this,"y");this.a=a;this.reason=b};r(Oy,A);var Fy=function(a,b,c){Di(c);this.request=b;this.de=c};r(Fy,Error);var Py=function(a,b){this.namespace_=a;this.b=b;this.constructor.mg||(this.constructor.mg={});this.constructor.mg[this.toString()]=this};Py.prototype.la=function(){return this.toString()};Py.prototype.toString=function(){this.a||(this.a=this.namespace_.a+":"+this.b);return this.a};var Qy=function(a,b){Py.call(this,a,b)};r(Qy,Py);var Ry=function(a){this.a=a};new Ry("lib");var Sy=function(a){var b={},c={},d=[],e=[],f=function(a){if(!c[a]){var e=a instanceof sr?a.b:[];c[a]=u(e);t(e,function(c){b[c]=b[c]||[];b[c].push(a)});e.length||d.push(a);t(e,f)}};for(t(a,f);d.length;){var g=d.shift();e.push(g);b[g]&&t(b[g],function(a){tb(c[a],g);c[a].length||d.push(a)})}var m={},q=[];t(e,function(a){a instanceof sr&&(a=a.a,null==a||m[a]||(m[a]=!0,q.push(a)))});return{services:e,fk:q}};var Vy=function(a){kd.call(this);this.id=Ty++;this.V=[];this.g={};this.v={};this.o={};this.a={};this.b={};this.H={};this.h=a?a.h:new B;this.Z=!a;this.f=null;a?(this.f=a,this.o=a.o,this.a=a.a,this.v=a.v,this.b=a.b):Fa();a=Uy(this);this!=a&&(a.m?a.m.push(this):a.m=[this])};r(Vy,kd);var Ty=1,Wy=.05>Math.random(),Uy=function(a){for(;a.f;)a=a.f;return a};Vy.prototype.get=function(a){var b=Xy(this,a);null==b&&this.ba&&(b={BOGUS:"Service "+a+" was not registered"});if(null==b)throw new Yy(a);return b};
var Zy=function(a,b){return!(!a.g[b]&&!a.o[b])},Xy=function(a,b){for(var c=a;c;c=c.f){if(c.w)throw Error("AppContext is disposed.");if(c.g[b])return c.g[b][0];if(c.H[b])break}if(c=a.o[b]){c=c(a);if(null==c)throw Error("Factory method for service "+b+" returned null or undefined.");Ox(a,b,c);return c}return null},az=function(a,b,c){return $y(a,[b],c)[b]},$y=function(a,b,c){var d=!c;c={};for(var e=[],f=[],g={},m={},q=Xy(a,Vw),y=0;y<b.length;y++){var D=b[y],T=Xy(a,D);if(T){var ea=new Yq;c[D]=ea;T.Pe&&
(ir(ea,T.Pe()),er(ea,Ea(function(a){return a},T)));ea.callback(T)}else if(a.b[D])ea=a.b[D].h(),er(ea,n(a.A,a,D)),c[D]=ea;else{var wa;D instanceof sr?wa=Sy([D]).fk:(T=a.v[D])&&(wa=[T]);!d||wa&&wa.length?(wa&&(q&&D instanceof sr&&q.jr()&&(Wy&&(ea=q.kr(bz),m[D]=ea),q.er(D)),e.push.apply(e,wa),g[D]=bb(wa)),f.push(D)):(ea=new Yq,c[D]=ea,ea.a(new Yy(D)))}}if(d){if(e.length){a.u&&a.u.push("loaded("+f+","+e+")\n"+Ei());for(y=0;y<f.length;y++)a.h.dispatchEvent(new cz("A"));b=dz(a).J(e);for(y=0;y<f.length;y++)D=
f[y],T=g[D],ea=b[T].h(),c[D]=ea,m[D]&&er(ea,function(){q.br(m[D])}),ez(a,ea,D,T)}}else for(y=0;y<f.length;y++)D=f[y],T=e[y],ea=new Yq(n(a.J,a,D)),c[D]=ea,(b=a.a[D])||(a.a[D]=b=[]),T&&fz(a,ea,D,T),er(ea,n(a.B,a,D,T)),b.push({ra:a,d:ea});return c},fz=function(a,b,c,d){er(b,function(){this.u&&this.u.push("loaded("+c+","+d+")\n"+Ei());return dz(this).load(d)},a);fr(b,n(a.K,a,c,d))},ez=function(a,b,c,d){er(b,function(){this.h.dispatchEvent(new cz("B"))},a);fr(b,n(a.K,a,c,d));er(b,n(a.B,a,c,d))};
Vy.prototype.B=function(a,b){var c=Xy(this,a);if(null==c){if(this.b[a]){var d=this.b[a].h();er(d,n(this.B,this,a,b));return d}throw new gz(a,b,"Module loaded but service or factory not registered with app contexts.");}return c.Pe?(d=new Yq,ir(d,c.Pe()),d.callback(c),er(d,n(this.A,this,a)),d):this.A(a)};Vy.prototype.A=function(a){this.b[a]&&delete this.b[a];return this.get(a)};Vy.prototype.K=function(a,b,c){return c instanceof Zq?c:new hz(a,b,c)};
var Ox=function(a,b,c){if(a.w)nd(c);else{a.V.push(b);a.g[b]=[c,!0];c=iz(a,a,b);for(var d=0;d<c.length;d++)c[d].callback(null);delete a.v[b]}},iz=function(a,b,c){var d=[],e=a.a[c];e&&(db(e,function(a){var c;a:{for(c=a.ra;c;){if(c==b){c=!0;break a}c=c.f}c=!1}c&&(d.push(a.d),tb(e,a))}),0==e.length&&delete a.a[c]);return d},jz=function(a,b){a.a&&vi(a.a,function(a,d,e){db(a,function(c){c.ra==b&&tb(a,c)});0==a.length&&delete e[d]})};
Vy.prototype.J=function(a,b){var c=this.a&&this.a[a];if(c){for(var d=0;d<c.length;++d)if(c[d].ra==this&&c[d].d==b){sb(c,d);break}0==c.length&&delete this.a[a]}};Vy.prototype.X=function(){if(Uy(this)==this){var a=this.m;if(a)for(;a.length;)a[0].Ba()}else for(var a=Uy(this).m,b=0;b<a.length;b++)if(a[b]==this){a.splice(b,1);break}for(var c in this.g)a=this.g[c],a[1]&&a[0].Ba&&a[0].Ba();this.g=null;this.Z&&this.h.Ba();jz(this,this);this.a=null;nd(this.N);this.H=this.N=null;Vy.W.X.call(this)};
var dz=function(a){return a.F?a.F:a.f?dz(a.f):null},Yy=function(a){Ga.call(this);this.id=a;this.message='Service for "'+a+'" is not registered'};r(Yy,Ga);var hz=function(a,b,c){Ga.call(this);this.message='Module "'+b+'" failed to load when requesting the service "'+a+'" [cause: '+c+"]";this.stack=c.stack+"\nWRAPPED BY:\n"+this.stack};r(hz,Ga);var gz=function(a,b,c){Ga.call(this);this.message='Configuration error when loading the module "'+b+'" for the service "'+a+'": '+c};r(gz,Ga);
var cz=function(a){A.call(this,a)};r(cz,A);var kz=new Ry("fva"),bz=new Qy(kz,1);var lz=function(){jx(this)};qa(lz);var mz=function(a,b,c,d,e){return a.ka.h(b,c,d,e)},nz=function(){};r(nz,Nw);Ow(nz,lz);nz.prototype.b=Uw();nz.prototype.h=Uw();nz.prototype.g=Uw();nz.prototype.f=Uw();var oz=function(a,b,c){kd.call(this);this.o=null!=c?n(a,c):a;this.v=b;this.m=n(this.Sj,this);this.b=!1;this.f=0;this.g=this.a=null;this.h=[]};r(oz,kd);h=oz.prototype;h.Rj=function(a){this.h=arguments;this.b=!1;this.a?this.g=Fa()+this.v:this.a=we(this.m,this.v)};h.stop=function(){this.a&&(xe(this.a),this.a=null);this.g=null;this.b=!1;this.h=[]};h.pause=function(){++this.f};h.resume=function(){this.f&&(--this.f,!this.f&&this.b&&(this.b=!1,this.o.apply(null,this.h)))};h.X=function(){this.stop();oz.W.X.call(this)};
h.Sj=function(){this.g?(this.a=we(this.m,this.g-Fa()),this.g=null):(this.a=null,this.f?this.b=!0:(this.b=!1,this.o.apply(null,this.h)))};var pz=function(a,b,c,d,e,f,g){ky.call(this,0,b,c,d,e,f,g);this.Ka=e;this.a=-1;this.m=!1;this.ba=-1;this.f=[];this.ia=this.V=this.oa=this.ha=null;this.A=!1;this.Wa=0;this.J=null;this.h=new px(R(this.config,2,1E3),R(this.config,3,6E4));this.Oa=new oz(this.og,0,this)};r(pz,ky);pz.prototype.start=function(a){pz.W.start.call(this,a);if("ka"!=this.state)return null;this.Sa.listen(this.B,"s",this.eh);qz(this,!0);F(this.G,"Starting initial resync.");return rz(this,"ta",!0)};
pz.prototype.qa=function(){pz.W.qa.call(this);this.Sa.v(this.B,"s",this.eh);xe(this.ia);this.ia=null;this.h.reset();xe(this.oa);this.oa=null;xe(this.V);this.J=this.V=null;this.m=!1};pz.prototype.query=function(a,b){return xy(this,this.Ka.Nb(this.N(a)),null,b)};pz.prototype.search=function(a){return xy(this,this.Ka.Vb(Oq(this.g)),null,a)};
var tz=function(a,b){"sa"!=b&&0==a.h.a&&a.B.dispatchEvent("s");bj(a.G,"Starting sync. Type: "+b);var c="ua"==b||"va"==b,d=a.Ka.Vb(Oq(a.g)),e=-2;R(a.config,11,!1)&&(9E4>Fa()-a.Wa?(e=a.a,d.Hf(e)):a.Wa=Fa());d=xy(a,d,function(a){return e!=a.cd?new sz(a.cd,a.data,b):null});me(d.then(n(a.Kk,a,c)),n(a.Jk,a,c));a.ha=d;me(a.ha,pa);return d};h=pz.prototype;h.Lc=function(a){return 0<=a};h.eh=function(){rz(this,"sa",!0)};h.zd=function(){return null!=rz(this,"wa",!0)||this.ha?this.ha:ce("Collection not yet started, so cannot resync.")};
h.lf=function(a){var b=!1,c=a.notification.Fa();null!=c&&""!=c&&(b=this.b.l(c),b=Dy(this,b),b=Ey(this,b));b?this.zd():pz.W.lf.call(this,a)};h.Pg=function(a){var b;xa(a.notification.C)&&null!=a.notification.C()&&(b=a.notification.C().ub());return b};
h.mf=function(a){bj(this.G,"Begin processing update: "+a);var b=a.a==this.ba;this.ba=Math.max(this.ba,a.a);qz(this,!1);if(a instanceof sz)uz(this,a);else{vz(this,a.b,a.f);if(this.Lc(this.a)&&a.a<=this.a){"ga"==a.g&&zy(this,"n");var c=!1;b&&(zy(this,"o"),c=!0);100<this.a-a.a&&(zy(this,"p"),c=!0);c&&rz(this,"xa",!0);zy(this,"m");bj(this.G,"Ignoring update "+a+" below or equal to local version ("+this.a+")");return}b=kb(this.f,function(b){return b.a<=a.a},this);if(null!=b&&a.a==b.a){zy(this,"m");E(this.G,
"Duplicate update received, ignoring it.");return}bj(this.G,"Queuing partial update: "+a);rb(this.f,a,b)}a instanceof sz?this.og():this.Oa.Rj();bj(this.G,"Finish processing update: "+a+": "+this.xb())};
var vz=function(a,b,c){a.Lc(a.a)||(bj(a.G,"Dispatch early notification: "),a.dispatchEvent(new wz(b,c)))},rz=function(a,b,c){if(!sy(a)||a.A)return null;a.h.reset();var d=null;a.A=!0;c?d=tz(a,b):xz(a);return d},yz=function(a){a.A&&(F(a.G,"Ending resync"),a.A=!1,a.dispatchEvent("z"))},xz=function(a){var b=a.h.f;zy(a,"s");F(a.G,"Scheduling resync timer, backoff count: "+a.h.a+", backoff: "+b);a.ia=we(a.Ik,b,a)};h=pz.prototype;
h.Ik=function(){F(this.G,"Resync timer triggered, "+this.xb());this.ia=null;sy(this)?(zy(this,"t"),tz(this,"xa")):yz(this)};
h.Kk=function(a){F(this.G,(a?"Poll":"Resync")+" operation executed, "+this.xb());zz(this,!1);if(this.m||!sy(this))yz(this);else{a=!1;var b=R(this.config,5,4);this.h.a>=b?(zy(this,"r"),F(this.G,"Hard sync threshold reached ("+b+"), doing a hard resync"),a=!0):this.f.length>R(this.config,4,64)&&(zy(this,"q"),bj(this.G,"Number of queued updates is larger than the max ("+R(this.config,4,64)+"), clearing the queue"),a=!0);a?(ob(this.f),this.h.reset(),tz(this,"ya")):(qx(this.h),xz(this))}};
h.Jk=function(a,b){var c=(a?"Poll":"Resync")+" error: "+b;aj(this.G,c,b instanceof Error?b:Error(c));zy(this,a?"E":"u");zz(this,!0);sy(this)?(qx(this.h),xz(this)):yz(this)};h.xb=function(){return pz.W.xb.call(this)+", is synced: "+this.m+", is resyncing: "+this.A+", queue size: "+this.f.length+", highest observed server version: "+this.ba+(0<this.f.length?", smallest queued version: "+bb(this.f).a+", largest queued version: "+this.f[0].a:"")};
h.og=function(){this.Oa.stop();if(0!=this.f.length&&this.Lc(this.a)){bj(this.G,"Trying to apply any queued updates, "+this.xb());for(var a=0;0<this.f.length&&bb(this.f).a<=this.a;){var b=this.f.pop();bj(this.G,"Tossing queued update "+b+" below or equal to local version ("+this.a+")");a++}0<a&&bj(this.G,"Tossed "+a+" queued old updates below or equal to local version ("+this.a+")");for(a=0;0<this.f.length;)if(b=bb(this.f),b.a==this.a)this.f.pop(),a++;else if(b.a==this.a+1)this.a=b.a,Jy(this,b),this.f.pop(),
a++;else{bj(this.G,"Unable to incrementally apply next queued update,  lowest queue update version: "+b.a+", local version:"+this.a+", remaining queue length: "+this.f.length);break}bj(this.G,"Applied "+a+" queued updates")}(this.m=0==this.f.length&&this.Lc(this.a))?qy(this):rz(this,"xa",!1)};h.nh=function(a){sy(this)&&(zy(this,"v"),F(this.G,"Executing poll sync operation"),rz(this,a,!0),qz(this,!0))};
var qz=function(a,b){if(sy(a)){F(a.G,"Scheduling next poll for "+R(a.config,1,3E4)/1E3+" seconds from now");xe(a.oa);a.oa=we(Ea(a.nh,"ua"),R(a.config,1,3E4),a);var c=R(a.config,9,9E4);null!=c||(c=9E4);b&&0<c&&(xe(a.V),a.V=we(Ea(a.nh,"va"),c,a))}},zz=function(a,b){if(b)if(null!=a.J){b=Fa()-a.J;var c="Sync operations failing for a period of "+b/1E3+" seconds (limit configured to: "+R(a.config,6,3E5)/1E3+" seconds).";E(a.G,c);b>=R(a.config,6,3E5)&&Gy(a,22,c)}else a.J=Fa(),E(a.G,"Sync operation failed, we will continue retrying for up to "+
R(a.config,6,3E5)/1E3+" seconds before shutting down...");else a.J=null},uz=function(a,b){bj(a.G,"Processing full update: "+b);$i(a.G,Qi,"Snapshot: ["+b.data.join("|")+"]");if(a.a>=b.a&&100>a.a-b.a){var c=[];a.a==b.a&&(t(b.data,function(a){var b=this.data[ry(this,a)]||null;b==a||b instanceof a.constructor&&Az(JSON.parse(b.la()),JSON.parse(a.la()))||c.push({local:b&&b.la(),server:a.la()})},a),Mb(a.data,function(a,d){null!=kb(b.data,function(a){return ry(this,a)==d},this)||c.push({local:a.la(),server:null})},
a));if(0!=c.length)E(a.G,"Reapplying update with version that's the same, update: "+b.a+", local: "+a.a+", type: "+b.b),zy(a,"D",c);else{zy(a,"A");switch(b.b){case "xa":zy(a,"B");break;case "ua":zy(a,"C")}bj(a.G,"Ignoring update with version not newer than local version, update: "+b.a+", local: "+a.a+", type: "+b.b);return}}a.a>b.a&&100<a.a-b.a&&zy(a,"p",""+(a.a-b.a));zy(a,"w");switch(b.b){case "ua":zy(a,"y");break;case "xa":zy(a,"x");break;case "ya":zy(a,"z")}var d=eb(b.data,function(a){if(fy(this.b,
a))return!0;zy(this,"F","Full update: "+a.la());return!1},a),e=[],f={};t(b.data,function(a){f[ry(this,a)]=!0},a);Mb(a.data,function(a,b){f[b]||e.push(Dy(this,a))},a);bj(a.G,"Applying full update as partial and advancing version from "+a.a+" to "+b.a);a.a=b.a;Jy(a,new my(b.a,d,e,"ia"))},Az=function(a,b){var c=ta(a),d=ta(b);if(c&&d){var c={},e;for(e in a)a.hasOwnProperty(e)&&(c[e]=0);for(e in b)b.hasOwnProperty(e)&&(c[e]=0);for(e in c)if(!Az(a[e],b[e]))return!1;return!0}return a==b||null==a&&d&&0==
b.length||null==b&&c&&0==a.length},sz=function(a,b,c){Ny.call(this,a);this.data=b;this.b=c};r(sz,Ny);sz.prototype.toString=function(){return"[Full update id: "+this.id+", version: "+this.a+", resource count: "+this.data.length+", sync type: "+this.b+"]"};var wz=function(a,b){A.call(this,"x");this.a=a;this.removed=b};r(wz,A);var Bz=function(a){this.a=a};r(Bz,ay);var Cz=function(a,b,c){var d=this;this.b=a;this.a={};Mb(b,function(a,b){return d.a[b.toLowerCase()]=a});this.sc=c};Cz.prototype.Dc=function(){return Xb(this.a)};var Dz=function(a,b,c){Cz.call(this,a,b,c)};ka(Dz,Cz);var Fz=function(a,b,c,d,e){kd.call(this);this.o=a;this.b=b;this.B=e||{};this.m=c;this.A=d;this.u=-1;this.v=Vb();this.a=!1;this.g=0;this.h=this.f=void 0;this.xa=++Ez};r(Fz,kd);var Ez=0;h=Fz.prototype;h.Hf=function(a){this.u=a};h.Hc=function(){return this.v};h.se=function(){return this.v.a};h.ke=function(){return this.a};h.te=function(a){this.g=a};h.Ad=function(){return this.g};h.ue=function(a,b){k(b)&&(b=Math.max(a,b));this.f=a;this.h=b};h.Ec=function(){return this.f};h.he=function(){return this.h};
h.Ye=function(){return this.m.la()};h.toString=function(){return"[Operation id: "+this.xa+": service: "+this.o+", call: "+this.b+", version: "+this.u+"]"};var Gz=function(){Ga.call(this)};r(Gz,Ga);Gz.prototype.message="Operation has already been executed.";Gz.prototype.name="AlreadyExecutedError";var Hz=function(a){P(this,a,0,-1,null)};r(Hz,O);var Iz=function(a,b){for(;Up(b)&&4!=b.b;)switch(b.f){case 1:var c=Xp(b);S(a,1,c);break;case 2:var c=b,d=c.a.f();c=c.a;if(0>d||c.a+d>c.b.length)c.h=!0,ab("Invalid byte length!"),c=new Uint8Array(0);else{var e=c.b.subarray(c.a,c.a+d);c.a+=d;c=e}S(a,2,c);break;default:Vp(b)}return a};Hz.prototype.s=function(){var a=new G;Jz(this,a);return H(a)};
var Jz=function(a,b){var c;c=R(a,1,"");0<c.length&&L(b,1,c);a=R(a,2,"");null==a||a instanceof Uint8Array?c=a:va(a)?c=jk(a):(ab("Cannot coerce to Uint8Array: "+ra(a)),c=null);0<c.length&&qq(b,2,c)};var Lz=function(a){P(this,a,0,-1,Kz)};r(Lz,O);var Kz=[3],Mz=function(a){a=new Tp(a);for(var b=new Lz;Up(a)&&4!=a.b;)switch(a.f){case 1:var c=a.a.o();S(b,1,c);break;case 2:c=Xp(a);S(b,2,c);break;case 3:c=new Hz;Wp(a,c,Iz);Hq(b,3,c,Hz);break;default:Vp(a)}return b};Lz.prototype.s=function(){var a=new G,b;b=R(this,1,0);0!==b&&I(a,1,b);b=this.getMessage();0<b.length&&L(a,2,b);b=V(this,Hz,3);0<b.length&&N(a,3,b,Jz);return H(a)};Lz.prototype.getMessage=function(){return R(this,2,"")};var Nz=function(a,b,c,d,e){d=void 0===d?null:d;e=void 0===e?null:e;var f=c instanceof Lz;Cz.call(this,a,b,f?null:c);this.f=f?c:null;this.l=e;this.g=d};ka(Nz,Cz);Nz.prototype.getMessage=function(){return this.l};var Oz=function(a){return new Nz(a.b,a.Dc(),(a instanceof Nz?a.f:null)||a.sc,null,"validation failed")};var Qz=function(a,b,c,d,e){var f=this;this.l=a;this.g=b;this.b=c;this.a={};Mb(d,function(a,b){return Pz(f,b,a)});this.f=null;this.f=e?e.clone():null};Qz.prototype.getContext=function(){return this.l};Qz.prototype.Dc=function(){return Xb(this.a)};var Pz=function(a,b,c){b=b.toLowerCase();null==c?delete a.a[b]:a.a[b]=c};Qz.prototype.clone=function(){return new Qz(this.l,this.g,this.b,this.a,this.f)};var Rz=function(a){return{a:a}};var Sz=function(){},Wz=function(a,b,c){var d=b.getContext();Pz(b,"Content-Type","application/x-protobuf");Pz(b,"X-Goog-Api-Key",Tz(d)||null);Pz(b,"X-Goog-Encode-Response-If-Executable","base64");var e=Uz(d)+("/$rpc/"+b.g+"/"+b.b),f=null,g=b.f;g&&(f=g.s.call(g));var g=Vb(),m=new ij;m.listen("complete",a.a.bind(a,g,c));Nd(m,"ready",m.Ba);Vz(d)&&(m.g=Math.max(0,Vz(d)));m.V=!0;m.h="arraybuffer";m.send(e,"POST",f,b.Dc());me(g.a,function(a){a instanceof Xd&&m.abort()});return g.a};
Sz.prototype.a=function(a,b,c){try{var d=c.target,e=d.Aa(),f=Aj(d),g=zj(d),m=new Uint8Array(g&&g||null);m&&Nb(f,function(a,b){return"BASE64"==a.toUpperCase()&&"X-GOOG-SAFETY-ENCODING"==b.toUpperCase()})&&(m=jk(Uj(m)));if(wj(d))try{a.resolve(new Dz(e,f,b?b(m):null))}catch(q){a.resolve(new Nz(10002,f,null,q,"Failed to decode response"))}else try{a.resolve(new Nz(e,f,Mz(m)))}catch(q){a.resolve(new Nz(e,f,null,q,"Failed to decode status"))}}catch(q){a.resolve(new Nz(10005,{},null,q,"Failure in XHR result processing"))}};var Xz=new Sz,Yz=function(a){this.a=void 0===a?null:a;this.v=this.b=this.f=this.l=this.w=null;this.h=[];this.g=[];this.m=[]},fA=function(a){var b=new Yz;b.setApiKey(Tz(a));b.l=Uz(a);b.f=Vz(a);b.b=Zz(a);b.v=$z(a);t(aA(a),function(a){return bA(b,a)});t(cA(a),function(a){b.g.push(a)});t(dA(a),function(a){return eA(b,a)});return b},Uz=function(a){return null!=a.l?a.l:a.a?Uz(a.a):""};Yz.prototype.setApiKey=function(a){this.w=a};
var Tz=function(a){return null!=a.w?a.w:a.a?Tz(a.a):""},Vz=function(a){return null!=a.f?a.f:a.a?Vz(a.a):6E4},gA=function(a,b){a.b=b},Zz=function(a){return null!=a.b?a.b:a.a?Zz(a.a):0},$z=function(a){return a.v?a.v:a.a?$z(a.a):Xz},bA=function(a,b){a.h.push(b)},aA=function(a){return a.a?a.h.concat(aA(a.a)):a.h.concat()},cA=function(a){return a.a?a.g.concat(cA(a.a)):a.g.concat()},eA=function(a,b){a.m.push(b)},dA=function(a){return a.a?a.m.concat(dA(a.a)):a.m.concat()};var jA=function(){var a=this;this.a=new qr(100);this.b={onRequest:function(b,c,d){a.a.add({name:c.b,initReq:hA(b),req:hA(c),resp:iA(d)})}}},kA=function(a,b,c){b=void 0===b?"":b;c=void 0===c?100:c;b=b.toLowerCase();a=a.a.P().filter(function(a){return-1!=a.name.toLowerCase().indexOf(b)});return a.slice(-Math.min(a.length,c))},mA=function(a){var b=lA();eA(a,b.b)},lA=function(){nA||(nA=new jA);return nA},nA=null,oA=function(a){if(a){if(a.la)return Yi(a.la());if(ua(a))return fb(a,function(a){return oA(a)})}return a},
hA=function(a){return{name:a.g+"/"+a.b,body:Zi(oA(a.f)),head:a.Dc()}},iA=function(a){var b={code:a.b,body:Zi(oA(a.sc)),head:a.Dc()};a instanceof Nz&&(b.status=Zi(oA(a.f)),b.ex=a.g,b.msg=a.getMessage());return b};p("grpc_lookup",function(a){return kA(lA(),a,1)[0]});p("grpc_dump",function(a,b){return kA(lA(),a,b)});var rA=function(a,b){var c=this;this.l=new px(1E3,36E4);this.a=a.getContext();this.h=a;this.w=b;this.b=Vb();this.m=0;this.f=this.g=!1;pA(this.b.a,function(){c.f=!0});qA(this)},qA=function(a){sA(a).then(function(b){2==b.bd&&a.m<Zz(a.a)?tA(a):uA(a,b)})},tA=function(a){a.m++;var b=ye(a.l.f).then(function(){return qA(a)});qx(a.l);pA(a.b.a,function(){return b.cancel()})},uA=function(a,b){a.g||(0==b.bd?a.b.resolve(b.response):(b.response instanceof Dz&&(b.response=Oz(b.response)),a.b.b(b.response)),a.g=
!0,t(dA(a.a),function(c){return id(function(){return c.onRequest(a.h.clone(),b.request,b.response)})}))},sA=function(a){var b=Vb().a;pA(a.b.a,function(){return b.cancel()});var c=a.h.clone(),d=!1,e=[],f=vA(a,b,c),g=f.then(function(c){return d?new Nz(20002,{},null):wA(a,b,c)}),m=ge([f,g]).then(function(c){return d?1:xA(a,b,c[0],c[1])},function(){return 3});e.push(he([f,g,m]).then(function(a){return a[0].bc?a[1].bc?a[2].bc?{request:a[0].value,response:a[1].value,bd:a[2].value}:{request:a[0].value,response:new Nz(10006,
a[1].value.Dc(),a[1].value.sc,a[2].reason),bd:3}:{request:a[0].value,response:new Nz(10005,{},null,a[1].reason),bd:3}:{request:c.clone(),response:new Nz(10004,{},null,a[0].reason),bd:3}}));f=Vz(a.a);if(0<f){var q=ye(f).then(function(){d=!0;return{request:c.clone(),response:new Nz(10001,{},null,null,"Client timed out"),bd:2}});pA(b,function(){return q.cancel()});e.push(q)}e=fe(e);le(e,function(){return b.cancel()});return e},vA=function(a,b,c){if(a.f)return ce(new Xd);var d=fb(aA(a.a),function(a){try{return a.a(c)||
be()}catch(f){return ce(f)}});pA(b,function(){return t(d,function(a){return a.cancel()})});return ge(d).then(function(){return c.clone()})},wA=function(a,b,c){if(a.f)return ce(new Xd);var d=Wz($z(a.a),c,a.w);pA(b,function(){return d.cancel()});return d},xA=function(a,b,c,d){if(a.f)return ce(new Xd);var e=fb(cA(a.a),function(a){return a.a(c,d)});pA(b,function(){return t(e,function(a){return a.cancel()})});return ge(e).then(function(a){return gb(a,function(a,b){return Math.max(a,b)},d instanceof Dz?
0:1)})},pA=function(a,b){me(a,function(a){a instanceof Xd&&b()})};var yA=function(a,b){Yz.call(this,void 0===b?null:b);this.o=a};ka(yA,Yz);var zA=function(a,b,c,d,e){d=void 0===d?null:d;e=void 0===e?{}:e;a=new Qz(fA(a),a.o,b,e,c);return(new rA(a,d)).b.a};var AA=new Set([502,504,500,503]),BA=new Set([0,-1]),CA=Rz(function(a,b){return be(AA.has(b.b)?2:0)}),DA=Rz(function(a,b){return be(BA.has(b.b)?2:0)});var EA=["ResolveMeetingSpace","CreateMeetingSpace"],HA=function(a){a=void 0===a?new Ax:a;this.g=vh("https://meetings.clients6.google.com","/v1/${path}");this.b=FA(this);this.l=GA(this,this.b);this.a=a;this.f=null},IA=function(a,b){return(void 0===b?0:b)?a.b:a.l},JA=function(a,b,c){Dx(a.g.replace("${path}",b),Zi(c),"application/json")},FA=function(a){var b=new Yz;b.setApiKey("");b.l="https://meetings.clients6.google.com";b.b=2;b.f=2E4;b.g.push(CA);b.g.push(DA);eA(b,{onRequest:function(b,d,e){if(d=
e.a["x-goog-meeting-token"]||null)if(b=a.a,d){d=d.split(";");var c=Number(d[0]);if(!isNaN(c)){var g=new os;S(g,2,c);S(g,1,d[1]);Bx(b,g)}}if(e=e.a["x-goog-meeting-debugid"]||null)a.f=e}});bA(b,{a:function(){}});mA(b);return b},GA=function(a,b){b=new Yz(b);bA(b,{a:function(b){null!=(b.a["x-goog-meeting-token"]||null)||mb(EA,b.b)||Pz(b,"X-Goog-Meeting-Token",Cx(a.a))}});return b};var KA=function(a){B.call(this);this.j=Xi("realtime.collections.oneplatform.OperationExecutor");this.u=az(a,ux)};ka(KA,$x);KA.prototype.execute=function(a,b){if(a.ke())throw new Gz;LA(this,a,b)};
var LA=function(a,b,c){c=void 0===c?null:c;F(a.j,"Making request for operation: "+b);l(c)||(c=b.Ec());a.u.then(function(d){d=new yA(b.o,IA(d,void 0));l(c)&&(d.f=c);gA(d,b.Ad());me(zA(d,b.b,b.m,b.A,b.B).then(function(a){var c=parseInt(a.a.etag||null,10);a=new Zx(a.sc,isNaN(c)?-1:c);b.a=!0;b.Hc().resolve(a)}),function(c){return MA(a,b,c)})},function(c){return MA(a,b,c)})},MA=function(a,b,c){b.a=!0;aj(a.j,"OnePlatform operation failed for "+(b+": "+(ya(c)?Ci(c):c)));b.Hc().b(c)};var NA=function(a){tv.call(this,a);this.l=this.h=null};r(NA,tv);var OA=/^(spaces\/[a-zA-Z0-9_-]+)\//,PA=function(a){return(a=OA.exec(a))?a[1]:null};NA.prototype.v=function(){return PA(this.ob())||this.h};NA.prototype.o=function(a){this.h=a};var QA=function(a){P(this,a,0,-1,null)};r(QA,O);QA.prototype.s=function(){var a=new G,b;b=Q(this,1);null!=b&&L(a,1,b);return H(a)};QA.prototype.g=function(){return Q(this,1)};QA.prototype.l=function(a){S(this,1,a)};var RA=function(a){P(this,a,0,-1,null)};r(RA,O);h=RA.prototype;h.s=function(){var a=new G,b;b=Q(this,1);null!=b&&L(a,1,b);b=Q(this,2);null!=b&&L(a,2,b);return H(a)};h.ph=function(){return Q(this,1)};h.rh=function(a){S(this,1,a)};h.ob=function(){return Q(this,2)};
h.qh=function(a){S(this,2,a)};var SA=function(a){if(va(a)){var b=PA(a),c=new RA;c.rh(b);c.qh(a);return c}return a};var TA=function(a){if(va(a)){var b=new QA;b.l(a);return b}return a};var UA=function(a){P(this,a,0,-1,null)};r(UA,O);UA.prototype.s=function(){var a=new G,b;b=R(this,1,"");0<b.length&&L(a,1,b);b=U(this,tv,2);null!=b&&M(a,2,b,Fv);return H(a)};var VA=function(a,b){S(a,1,b)};var WA=function(a){P(this,a,0,-1,null)};r(WA,O);WA.prototype.s=function(){var a=new G,b;b=this.getDeviceId();0<b.length&&L(a,1,b);return H(a)};WA.prototype.getDeviceId=function(){return R(this,1,"")};var XA=function(a){P(this,a,0,-1,null)};r(XA,O);XA.prototype.s=function(){var a=new G,b;b=R(this,1,"");0<b.length&&L(a,1,b);return H(a)};var YA=function(a,b){S(a,1,b)};var $A=function(a){P(this,a,0,-1,ZA)};r($A,O);var ZA=[1];$A.prototype.s=function(){var a=new G,b;b=V(this,tv,1);0<b.length&&N(a,1,b,Fv);return H(a)};var aB=function(a){P(this,a,0,-1,null)};r(aB,O);aB.prototype.s=function(){var a=new G,b;b=U(this,tv,1);null!=b&&M(a,1,b,Fv);return H(a)};var bB=function(a){this.a=a};r(bB,Bz);h=bB.prototype;h.af=Vc;h.Lb=function(a){var b=a[0].l,c={};b&&(c["X-Goog-Meeting-Botguardid"]=b);b=new UA;VA(b,a[0].v());W(b,2,a[0]);return new Fz("google.rtc.meetings.v1.MeetingDeviceService","CreateMeetingDevice",b,function(a){return cB([vv(a)])},c)};h.Mb=function(a){var b=a[0].l,c={};b&&(c["X-Goog-Meeting-Botguardid"]=b);b=new aB;W(b,1,a[0]);return new Fz("google.rtc.meetings.v1.MeetingDeviceService","UpdateMeetingDevice",b,function(a){return cB([vv(a)])},c)};
h.Ub=function(){throw Error("Invalid Operation: Meeting Device Remove");};h.Nb=function(a){var b=new WA;a=a.ob();S(b,1,a);return new Fz("google.rtc.meetings.v1.MeetingDeviceService","GetMeetingDevice",b,vv)};h.Vb=function(a){var b=new XA;YA(b,a.ph());return new Fz("google.rtc.meetings.v1.MeetingDeviceService","ListMeetingDevices",b,function(a){var b=cB;a=new Tp(a);for(var c=new $A;Up(a)&&4!=a.b;)switch(a.f){case 1:var f=new tv;Wp(a,f,uv);Hq(c,1,f,tv);break;default:Vp(a)}return b(V(c,tv,1))})};
var cB=function(a){return fb(a,function(a){return new NA(JSON.parse(a.la()))})};var dB=function(a){P(this,a,0,-1,null)};r(dB,O);dB.prototype.s=function(){var a=new G;eB(this,a);return H(a)};var eB=function(a,b){a=R(a,1,"");0<a.length&&L(b,1,a)};var fB=function(a){P(this,a,0,-1,null)};r(fB,O);fB.prototype.s=function(){var a=new G,b;b=U(this,kw,1);null!=b&&M(a,1,b,sw);b=U(this,dB,3);null!=b&&M(a,3,b,eB);return H(a)};var gB=function(a){P(this,a,0,-1,null)};r(gB,O);gB.prototype.s=function(){var a=new G,b;b=R(this,1,"");0<b.length&&L(a,1,b);return H(a)};var hB=function(a,b){S(a,1,b)};var iB=function(a){P(this,a,0,-1,null)};r(iB,O);iB.prototype.s=function(){var a=new G,b;b=U(this,kw,1);null!=b&&M(a,1,b,sw);return H(a)};var jB=function(a){this.a=a};r(jB,Bz);h=jB.prototype;h.af=Vc;h.Lb=function(a){var b=new fB;W(b,1,a[0]);return new Fz("google.rtc.meetings.v1.MeetingSpaceService","CreateMeetingSpace",b,function(a){return[rw(a)]})};h.Mb=function(a){var b=new iB;W(b,1,a[0]);return new Fz("google.rtc.meetings.v1.MeetingSpaceService","UpdateMeetingSpace",b,function(a){return[rw(a)]})};h.Ub=function(){throw Error("Invalid Operation: Meeting Space Remove");};
h.Nb=function(a){var b=new gB;hB(b,a.g());return new Fz("google.rtc.meetings.v1.MeetingSpaceService","GetMeetingSpace",b,function(a){return[rw(a)]})};h.Vb=function(a){return this.Nb(a)};var kB=function(a,b,c,d,e,f){var g=lz.S();e=new e(mz(g,a,b,void 0,!0));f=new by(g.ka.g(a,b),f);return new pz(0,g.ka.b(a,b),c,d,e,f,g.ka.f(a,b))};var lB=function(a){P(this,a,0,-1,null)};r(lB,O);lB.prototype.s=function(){var a=new G,b;b=R(this,1,"");0<b.length&&L(a,1,b);b=R(this,2,"");0<b.length&&L(a,2,b);b=U(this,dB,3);null!=b&&M(a,3,b,eB);return H(a)};var nB=function(a,b,c,d){return mz(lz.S(),a,b,void 0,!0).u.then(function(a){return mB(a,c,d)})},mB=function(a,b,c){b=oB(b);return pB(a,b,c).then(function(a){return a.sc})},pB=function(a,b,c){var d={};c&&(d["X-Goog-Meeting-Botguardid"]=c);return zA(new yA("google.rtc.meetings.v1.MeetingSpaceService",IA(a,void 0)),"ResolveMeetingSpace",b,rw,d)},oB=function(a){var b=new lB;S(b,1,a);return b};var qB=function(a,b){this.a=a;this.b=b},rB=new qB("https://www.googleapis.com/clouddevices/v1","AIzaSyAOZM8ZYeov685QMjXT3sC7XNizfrTEKjA"),sB=new qB("https://www.googleapis.com/calendar/v3",""),tB=new qB("https://www.googleapis.com/hangouts/v1",""),uB=new qB("https://networktraversal.googleapis.com/v1alpha","AIzaSyAOZM8ZYeov685QMjXT3sC7XNizfrTEKjA");var vB=function(a,b,c,d,e,f){c=void 0===c?null:c;a||null==c&&(c="default");this.Tg=a;this.xa=b;this.nb=c;this.Nc=void 0===d?null:d;this.wb=void 0===e?null:e;this.rc=void 0===f?null:f};vB.prototype.b=function(){var a="";this.wb?a=this.wb:this.Nc&&(a=this.Nc);return a};vB.prototype.vb=function(){return this.Tg};vB.prototype.getId=function(){return this.xa};vB.prototype.merge=function(a){!this.rc&&a.rc&&(this.rc=a.rc);!this.wb&&a.wb&&(this.wb=a.wb);this.wb&&a.wb&&this.rc&&(this.wb=a.wb)};var wB=function(a,b){this.b=a;this.f=b;this.j=v("mr.cloud.calendar.CalendarService")},AB=function(a){return xB(a,a.f.a).then(function(b){x(a.j,yB(b.length)+" events discovered before filtering.");return zB(a,b)},function(b){w(a.j,"Error getting Hangouts from calendar.",b);return[]})},yB=function(a){return 20<a?"20+":a.toString()},xB=function(a,b){var c=Date.now();return BB(a,b,new Date(c),new Date(c+9E5)).then(function(b){return b.filter(a.a)})};
wB.prototype.a=function(a){return!(!a.start||!a.end||a.start.date||a.end.date||!a.start.dateTime||!a.end.dateTime)};
var BB=function(a,b,c,d){b=CB(sB.a,["calendars",b,"events"],{timeMin:c.toJSON(),timeMax:d.toJSON(),singleEvents:!0});z(a.j,"Retrieving Hangouts from Calendar: "+b);return DB(a.b,b,"GET").then(function(a){return a.items?a.items:[]})},zB=function(a,b){var c=[];b.filter(function(a){return a.hangoutLink}).forEach(function(b){var d=new mm(b.hangoutLink);if("meet.google.com"==d.nb)c.push(new vB(!0,d.a.substring(1),void 0,void 0,b.summary));else if(d=d.a.substring(12).split("/"),2==d.length){var f=ja(d),
d=f.next().value,f=f.next().value,g,m;-1!=d.indexOf(".")&&(g=f,m=d);c.push(new vB(!1,f+"@"+d,m,g,b.summary,void 0))}else w(a.j,"Invalid hangout link from calendar event: "+b.hangoutLink)});x(a.j,yB(c.length)+" events discovered with Hangout links.");return c};var EB=function(a){this.a=a;this.id=a.id;this.j=v("mr.cloud.devices.CloudDevice")};EB.prototype.isAvailable=function(){if(this.getState().appStatus){var a="online"==this.a.connectionStatus,b="available"==this.getState().appStatus,c=FB(this,864E5);z(this.j,"Device id: "+this.id+", availability: GCM connected "+a+", app Available: "+b+", checked in: "+c);return a&&b&&c}a=FB(this,9E5);x(this.j,"Availability for legacy receiver app: "+a);return a};
var FB=function(a,b){a=a.a.lastUpdateTimeMs?Number(a.a.lastUpdateTimeMs):null;return!!(a&&a>Date.now()-b)};EB.prototype.b=function(){return this.getState().settings.receiverName};EB.prototype.getId=function(){return this.id};EB.prototype.getState=function(){return this.a.state._cloudCast};var GB=function(a){this.email=a;this.imageUrl=null},HB=function(a){this.type=a},IB=function(a,b,c){this.type="__cloud_webrtc_session_message__";this.sessionDescription=a;this.user=null!=b?b:null;this.flungUrl=null!=c?c:null};ka(IB,HB);
var JB=function(a,b,c){this.name=a;this.parameters=b;this.minimalRole=null!=c?c:"user"},KB={_settings:{type:"string"},_presentationRequest:{type:"string"},_optMediaConstraints:{type:"string"},_webrtcMessage:{type:"string"},_user:{type:"string"}},LB=new JB("_knockingStartWebrtcSession",KB,"viewer"),MB=new JB("_startWebrtcSession",KB),NB=new JB("_stopSession",{},"viewer");var OB=function(a){this.h=a;this.b=this.f=this.a=null;this.l=this.g=!1;this.j=v("mr.cloud.devices.CloudDevicesService");Xh(this)};OB.prototype.getDevice=function(a){a=CB(rB.a,["devices",a]);return DB(this.h,a,"GET").then(function(a){return new EB(a)})};
var PB=function(a,b){var c=CB(rB.a,["devices"],b);return DB(a.h,c,"GET").then(function(c){var d=(c.devices||[]).filter(function(a){return null!=a.commandDefs&&null!=a.commandDefs._cloudCast}).map(function(a){return new EB(a)});if(c=c.nextPageToken){var f=Xb(b);f.token=c;return PB(a,f).then(function(a){return d.concat(a)})}return d})};OB.prototype.ea=function(){return"CloudDevicesService"};OB.prototype.pa=function(){return[new QB(this.a,this.b,this.f)]};
OB.prototype.ua=function(){var a=Uh(this);a&&(this.a=a.dk,this.b=a.gcmRegistrationId,this.f=a.ck)};
var RB=function(a){return new Promise(function(b,c){a.g?c(Error("Registering...")):(a.g=!0,a.b&&a.f&&a.f+864E5>=Date.now()?(a.g=!1,b(a.b)):chrome.gcm.register(["919648714761"],function(d){a.g=!1;d?(z(a.j,"Got GCM ID: "+d),a.b=d,a.f=Date.now(),a.a=null,b(d)):(w(a.j,"Error: "+chrome.runtime.lastError.message),a.b=null,a.f=null,a.a=null,c(Error(chrome.runtime.lastError.message)))}))})},SB=function(a,b){if(a.l)Promise.resolve();else if(a.l=!0,b&&(!a.a||a.a+864E5<Date.now())){b={filters:["myDevices"],
gcmRegistrationId:b,gcmSenderId:"919648714761",expirationTimeMs:864E5};var c=CB(rB.a,["subscriptions","subscribe"],{});DB(a.h,c,"POST",b).then(function(){z(a.j,"Subscribed on: "+Date.now());a.a=Date.now();a.l=!1;return Promise.resolve()},function(b){a.l=!1;throw b;})}else Promise.resolve()},QB=function(a,b,c){this.dk=a;this.gcmRegistrationId=b;this.ck=c};var TB={ACCEPTED:0,Tm:1,TIMEOUT:2},UB={SUCCESS:0,pi:1},VB={uj:0,Xi:1,Rq:2,Hn:3,Gn:4,Co:5,TIMEOUT:6,Ap:7},WB={En:0,oq:1},XB={hp:0,oo:1,USER:2,zn:3},YB=function(a){Cg("MediaRouter.Cloud.Knock.Result",a,TB)},ZB=function(a){Cg("MediaRouter.Cloud.Session.Start",a,UB)},$B=function(a){Cg("MediaRouter.Cloud.Session.Type",a,WB)},aC=function(a){Cg("MediaRouter.Cloud.Device.UserRole",a,XB)};var bC=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];for(var d=a,c=ja(c),e=c.next();!e.done;e=c.next()){if(void 0==d||"object"!=typeof d)return;d=d[e.value]}return d};var cC=function(){Jk.call(this,5,"cloud.GcmEventListener","mr.cloud.discovery.CloudSinkDiscoveryService",chrome.gcm.onMessage);this.j=v("mr.CloudGcmEventListener")};ka(cC,Jk);cC.prototype.De=function(a){a=bC(a,"data","notification");if(!a)return this.j.error("Notification json not found"),!1;try{var b=JSON.parse(a);return!!b&&Array.isArray(b.events)&&0<b.events.length}catch(c){return this.j.error("Invalid json: "+a),!1}};var eC=function(){dC||(dC=new cC);return dC},dC=null;var fC=function(a,b,c,d,e,f,g){var m=pk(ok.S(),a);this.va=new Rj(m,b,f,g,e);this.deviceId=a;this.a=c;this.model=d},gC=function(a,b,c,d,e){fC.call(this,a,b,["cloud"],"Chrome Streaming Receiver",d);this.Le=c;this.isAvailable=e};ka(gC,fC);var hC=function(a){var b=a.nb,c;a.Nc&&a.b()!=a.Nc&&(c=a.Nc);fC.call(this,a.getId(),a.b(),["mesi"],"Hangout",b,a.vb()?"meeting":"hangout",c);this.vb=a.vb();this.qc=a.rc||""};ka(hC,fC);var iC=function(a,b,c){this.h=a;this.g=b;this.a=new Map;this.f=new Map;this.b=null;this.l=c};iC.prototype.Sc=function(){var a=this.b+this.l;if(null==this.b||a<Date.now())this.b=Date.now(),jC(this);return Array.from(this.a.values())};iC.prototype.gc=function(a){return this.a.get(a)||null};
var jC=function(a){a.h().then(function(b){kC(a,b)})},kC=function(a,b){var c=new Map(a.a),d=new Map,e=new Map,f=[],g=[];b.forEach(function(a){var b=a.va.id;d.set(b,a);e.set(b,a.deviceId);c.has(b)?c.has(b)&&JSON.stringify(c.get(b))!=JSON.stringify(a)&&g.push(a.va):f.push(a.va);c.delete(b)});b=[].concat(la(c.values())).map(function(a){return a.va});a.f.clear();a.f=e;a.a.clear();a.a=d;lC(a,f,g,b)},lC=function(a,b,c,d){0<b.length&&a.g.jf(b);0<c.length&&a.g.Zg(c);0<d.length&&a.g.ne(d)},nC=function(a){for(var b=
{},c=ja(a.a.entries()),d=c.next();!d.done;d=c.next()){var e=ja(d.value),d=e.next().value,e=e.next().value;b[d]=e}c={};d=ja(a.f.entries());for(e=d.next();!e.done;e=d.next()){var f=ja(e.value),e=f.next().value,f=f.next().value;c[e]=f}return new mC(b,c,a.b)},oC=function(a,b){for(var c in b.sinks){var d=b.sinks[c],e=null;"Hangout"==d.model?e=new hC(new vB(d.vb,d.deviceId,d.va.domain,d.va.description,d.va.friendlyName,d.qc)):"Chrome Streaming Receiver"==d.model&&(e=new gC(d.deviceId,d.va.friendlyName,
d.Le,d.va.domain,d.isAvailable));a.a.set(c,e)}for(c in b.a)a.f.set(c,b.a[c]);b.b&&(a.b=b.b)},mC=function(a,b,c){this.sinks=a;this.a=b;this.b=c};var pC=function(a){this.a=a;this.j=v("mr.cloud.messaging.GcmMessageHandler")};pC.prototype.onMessage=function(a){var b=this;a=JSON.parse(a.data.notification);var c=ok.S();a.events.forEach(function(a){if(a.deviceId){var d=pk(c,a.deviceId);switch(a.type){case "deviceCreated":qC(b,a);break;case "deviceUpdated":rC(b,a,d);break;case "deviceDeleted":sC(b.a,{sinkId:d});break;default:z(b.j,function(){return"[unhandled event] "+JSON.stringify(a)})}}else b.j.error("Device ID not provided")})};
var qC=function(a,b){var c=bC(b,"statePatch","_cloudCast","settings","receiverName");"string"!=typeof c?a.j.error("Receiver name not a string: "+c):(b=new gC(b.deviceId,c,"owner","default",!0),a=a.a,a.a.a.set(b.va.id,b),a.a.b=Date.now(),a.f.jf([b.va]))},rC=function(a,b,c){b=bC(b,"statePatch","_cloudCast","appStatus");if("string"!=typeof b)a.j.error("App status not a string: "+b);else if(a=a.a,b="available"==b,c=a.a.gc(c))c.isAvailable=b,a.a.b=Date.now(),a.f.Zg([c.va])};var tC=function(a,b){this.b=a;this.f=b;this.a=new iC(this.gk.bind(this),b,2E4);this.g=new pC(this);eC().addListener();Xh(this);eh("mr.cloud.discovery.CloudSinkDiscoveryService",this)};ka(tC,Vg);h=tC.prototype;h.Sc=function(){var a=this;RB(this.b).then(function(b){SB(a.b,b)},function(){});return this.a.Sc().filter(function(a){return a.isAvailable})};h.gc=function(a){return this.a.gc(a)};
h.handleEvent=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(a==chrome.gcm.onMessage)this.g.onMessage.apply(this.g,[].concat(la(c)));else throw Error("Unhandled event: expected chrome.gcm.onMessage");};
h.gk=function(){return PB(this.b,{descriptionSubstring:"Chrome Streaming Receiver"}).then(function(a){return a.map(function(a){Bg("MediaRouter.Cloud.CloudReceiver.Sink.Discovered");var b=a.isAvailable()&&!(a.a.invitations&&0!=a.a.invitations.length);return new gC(a.getId(),a.b(),a.a.personalizedInfo.maxRole,"default",b)})})};h.ea=function(){return"CloudSinkDiscoveryService"};h.pa=function(){return[{cache:nC(this.a)}]};h.ua=function(){var a=Uh(this);a&&oC(this.a,a.cache)};
var sC=function(a,b){if(b=a.a.gc(b.sinkId))a.a.a.delete(b.va.id),a.a.b=Date.now(),a.f.ne([b.va])};var wC=function(a,b,c,d){if(!uC){Wi();var e=Vi;e.b=Ri;var f=vC;e.a||(e.a=[]);e.a.push(f);uC=!0}this.f=a;this.g=b;this.h=d;this.a=new iC(this.l.bind(this),c,2E4);this.b=new Map;Xh(this)},vC=function(a){Kc({G:a.f,level:Pc(a.b.value),time:a.l,message:a.getMessage(),Hb:a.a})};wC.prototype.Sc=function(){return this.a.Sc()};wC.prototype.gc=function(a){return this.a.gc(a)};
wC.prototype.l=function(){var a=this;x(this.j,"Fetching hangouts");return Sk([xC(this.g),AB(this.f)]).then(function(b){var c=Array.from(a.b.values());b.forEach(function(b){b.bc?c=c.concat(b.value):a.j.error("Error discovering Hangouts",b.reason)});var d=c.reduce(function(a,b){var c=a[b.getId()];c?c.merge(b):c=b;a[c.getId()]=c;return a},{});return Object.keys(d).map(function(a){a=d[a];Bg("MediaRouter.Cloud.Hangout.Sink.Discovered");return new hC(a)})})};
var zC=function(a,b){return Promise.resolve(mB(a.h,b.input).then(function(b){return yC(a,R(b,2,""))},function(){return b.input.match(/^#/)?Promise.reject("Failed to resolve meeting alias."):yC(a,b.input,b.domain)}))},yC=function(a,b,c){c=c||void 0;var d=!c;b=new vB(d,d?b:b+"@"+c,c,b,void 0,void 0);a.b.set(b.getId(),b);b=new hC(b);a.a.a.set(b.va.id,b);return b.va};wC.prototype.ea=function(){return"HangoutSinkDiscoveryService"};
wC.prototype.pa=function(){for(var a={},b=ja(this.b.entries()),c=b.next();!c.done;c=b.next()){var d=ja(c.value),c=d.next().value,d=d.next().value;a[c]=d}return[{cache:nC(this.a),manualHangouts:a}]};wC.prototype.ua=function(){var a=Uh(this);if(a){oC(this.a,a.cache);for(var b in a.manualHangouts){var c=a.manualHangouts[b];this.b.set(b,new vB(c.Tg,c.xa,c.nb,c.Nc,c.wb,c.rc))}}};wC.prototype.j=v("mr.cloud.discovery.HangoutSinkDiscoveryService");var uC=!1;var AC=function(a){this.a=a},CB=function(a,b,c){var d="";b.forEach(function(a){d+="/"+encodeURIComponent(a)});a=new mm(a+d);c&&(c=Fm(c),rm(a,c));return a},DB=function(a,b,c,d){return a.a.getAuthToken().then(function(e){var f=BC(e);return CC(f,b,c,d).catch(function(f){if("INVALID_ACCESS_ERROR"==f)return DC(a,e,b,c,d);throw f;})})},DC=function(a,b,c,d,e){return EC(b).then(function(){return DB(a,c,d,e)})},CC=function(a,b,c,d){return new Promise(function(e,f){var g=FC(b,c,function(a){a&&!a.error?e(a):
a&&401==a.error.code?f("INVALID_ACCESS_ERROR"):f(a&&a.error?a.error.errors?a.error.errors[0]:a:Error(a))},d);a.sendRequest(g)})},BC=function(a){a=new Qx(void 0,void 0,void 0,!1,!1,a);a.init();return a},FC=function(a,b,c,d){a={callback:c,method:b,path:a.toString()};d&&(a.body=d);return a};var IC=function(){this.b=!1;this.a=null;this.f=!1;this.j=v("mr.cloud.identity.IdentityService");Xh(this);GC(this);HC(this)},JC=function(a){return a.a?a.a.substr(a.a.indexOf("@")+1):""};IC.prototype.getAuthToken=function(){return chrome.identity?new Promise(function(a,b){chrome.identity.getAuthToken({interactive:!1},function(c){chrome.runtime.lastError?b(Error("Unable to get user auth token: "+chrome.runtime.lastError.message)):null==c?b(Error("User is not logged in (no token found)")):a(c)})}):Promise.reject(Error("chrome.identity permission required for auth."))};
var EC=function(a){return new Promise(function(b){chrome.identity.removeCachedAuthToken({token:a},function(){b()})})},HC=function(a){a.getAuthToken().then(function(b){chrome.identity.getProfileUserInfo(function(c){a.b=!!c.email||!!c.id;a.a=c.email||null;b&&!a.b&&(a.f=!0)})},function(b){z(a.j,"Unable to set sign in and email.",b)})},GC=function(a){chrome.identity.onSignInChanged.addListener(function(b,c){Og(6);a.b=c;x(a.j,"Signed in change: "+a.b);a.b?HC(a):(a.a=null,a.f=!1)})},KC=function(a){return a.getAuthToken().then(function(b){var c=
window.gapi;if(!c)return a.j.error("gapi not loaded."),!1;x(a.j,"Setting gapi auth token");c.auth.setToken({access_token:b});return!0})};IC.prototype.ea=function(){return"IdentityService"};IC.prototype.pa=function(){return[null,{signedIn:this.b,userEmail:this.a,kioskAuth:this.f}]};IC.prototype.ua=function(){var a=Vh(this);a&&(a.signedIn&&(this.b=a.signedIn),a.userEmail&&(this.a=a.userEmail),a.kioskAuth&&(this.f=a.kioskAuth))};var LC="cloudview.test@gmail.com castouts.qa.nohangouts@gmail.com castouts.qa@gmail.com castouts-qa.com castouts-test.com google.com youtube.com nest.com waze.com netflix.com twitter.com yahoo.com salesforce.com whirlpool.com nytimes.com kohls.com squareup.com ivci.com".split(" ");var MC={Qf:{1E3:{other:"0K"},1E4:{other:"00K"},1E5:{other:"000K"},1E6:{other:"0M"},1E7:{other:"00M"},1E8:{other:"000M"},1E9:{other:"0B"},1E10:{other:"00B"},1E11:{other:"000B"},1E12:{other:"0T"},1E13:{other:"00T"},1E14:{other:"000T"}},gi:{1E3:{other:"0 thousand"},1E4:{other:"00 thousand"},1E5:{other:"000 thousand"},1E6:{other:"0 million"},1E7:{other:"00 million"},1E8:{other:"000 million"},1E9:{other:"0 billion"},1E10:{other:"00 billion"},1E11:{other:"000 billion"},1E12:{other:"0 trillion"},1E13:{other:"00 trillion"},
1E14:{other:"000 trillion"}}},NC=MC,NC=MC;var OC={AED:[2,"dh","\u062f.\u0625.","DH"],ALL:[0,"Lek","Lek"],AUD:[2,"$","AU$"],BDT:[2,"\u09f3","Tk"],BGN:[2,"lev","lev"],BRL:[2,"R$","R$"],CAD:[2,"$","C$"],CDF:[2,"FrCD","CDF"],CHF:[2,"CHF","CHF"],CLP:[0,"$","CL$"],CNY:[2,"\u00a5","RMB\u00a5"],COP:[32,"$","COL$"],CRC:[0,"\u20a1","CR\u20a1"],CZK:[50,"K\u010d","K\u010d"],DKK:[50,"kr.","kr."],DOP:[2,"RD$","RD$"],EGP:[2,"\u00a3","LE"],ETB:[2,"Birr","Birr"],EUR:[2,"\u20ac","\u20ac"],GBP:[2,"\u00a3","GB\u00a3"],HKD:[2,"$","HK$"],HRK:[2,"kn","kn"],HUF:[34,
"Ft","Ft"],IDR:[0,"Rp","Rp"],ILS:[34,"\u20aa","IL\u20aa"],INR:[2,"\u20b9","Rs"],IRR:[0,"Rial","IRR"],ISK:[0,"kr","kr"],JMD:[2,"$","JA$"],JPY:[0,"\u00a5","JP\u00a5"],KRW:[0,"\u20a9","KR\u20a9"],LKR:[2,"Rs","SLRs"],LTL:[2,"Lt","Lt"],MNT:[0,"\u20ae","MN\u20ae"],MVR:[2,"Rf","MVR"],MXN:[2,"$","Mex$"],MYR:[2,"RM","RM"],NOK:[50,"kr","NOkr"],PAB:[2,"B/.","B/."],PEN:[2,"S/.","S/."],PHP:[2,"\u20b1","PHP"],PKR:[0,"Rs","PKRs."],PLN:[50,"z\u0142","z\u0142"],RON:[2,"RON","RON"],RSD:[0,"din","RSD"],RUB:[50,"\u20bd",
"RUB"],SAR:[2,"Rial","Rial"],SEK:[50,"kr","kr"],SGD:[2,"$","S$"],THB:[2,"\u0e3f","THB"],TRY:[2,"TL","YTL"],TWD:[2,"NT$","NT$"],TZS:[0,"TSh","TSh"],UAH:[2,"\u0433\u0440\u043d.","UAH"],USD:[2,"$","US$"],UYU:[2,"$","$U"],VND:[48,"\u20ab","VN\u20ab"],YER:[0,"Rial","Rial"],ZAR:[2,"R","ZAR"]};var PC={Sf:".",Ee:",",bg:"%",Ke:"0",Li:"+",Di:"-",Wf:"E",cg:"\u2030",Fe:"\u221e",Hi:"NaN",Rf:"#,##0.###",cj:"#E0",Ki:"#,##0%",hi:"\u00a4#,##0.00",ki:"USD"},QC=PC,QC=PC;var TC=function(a,b,c){this.u=b||QC.ki;this.N=c||0;this.B=40;this.b=1;this.aa=0;this.h=3;this.K=this.f=0;this.J=!1;this.A=this.w="";this.g="-";this.v="";this.a=1;this.m=!1;this.l=[];this.F=this.H=!1;this.o=0;if("number"==typeof a)switch(a){case 1:RC(this,QC.Rf);break;case 2:RC(this,QC.cj);break;case 3:RC(this,QC.Ki);break;case 4:a=QC.hi;b=["0"];c=OC[this.u][0]&7;if(0<c){b.push(".");for(var d=0;d<c;d++)b.push("0")}a=a.replace(/0.00/g,b.join(""));RC(this,a);break;case 5:SC(this,1);break;case 6:SC(this,
2);break;default:throw Error("Unsupported pattern type.");}else RC(this,a)},RC=function(a,b){b.replace(/ /g,"\u00a0");var c=[0];a.w=UC(a,b,c);for(var d=c[0],e=-1,f=0,g=0,m=0,q=-1,y=b.length,D=!0;c[0]<y&&D;c[0]++)switch(b.charAt(c[0])){case "#":0<g?m++:f++;0<=q&&0>e&&q++;break;case "0":if(0<m)throw Error('Unexpected "0" in pattern "'+b+'"');g++;0<=q&&0>e&&q++;break;case ",":0<q&&a.l.push(q);q=0;break;case ".":if(0<=e)throw Error('Multiple decimal separators in pattern "'+b+'"');e=f+g+m;break;case "E":if(a.F)throw Error('Multiple exponential symbols in pattern "'+
b+'"');a.F=!0;a.K=0;c[0]+1<y&&"+"==b.charAt(c[0]+1)&&(c[0]++,a.J=!0);for(;c[0]+1<y&&"0"==b.charAt(c[0]+1);)c[0]++,a.K++;if(1>f+g||1>a.K)throw Error('Malformed exponential pattern "'+b+'"');D=!1;break;default:c[0]--,D=!1}0==g&&0<f&&0<=e&&(g=e,0==g&&g++,m=f-g,f=g-1,g=1);if(0>e&&0<m||0<=e&&(e<f||e>f+g)||0==q)throw Error('Malformed pattern "'+b+'"');m=f+g+m;a.h=0<=e?m-e:0;0<=e&&(a.f=f+g-e,0>a.f&&(a.f=0));a.b=(0<=e?e:m)-f;a.F&&(a.B=f+a.b,0==a.h&&0==a.b&&(a.b=1));a.l.push(Math.max(0,q));a.H=0==e||e==m;
d=c[0]-d;a.A=UC(a,b,c);c[0]<b.length&&";"==b.charAt(c[0])?(c[0]++,1!=a.a&&(a.m=!0),a.g=UC(a,b,c),c[0]+=d,a.v=UC(a,b,c)):(a.g+=a.w,a.v+=a.A)},SC=function(a,b){a.o=b;RC(a,QC.Rf);a.f=0;a.h=2;if(0<a.f)throw Error("Can't combine significant digits and minimum fraction digits");a.aa=2};
TC.prototype.parse=function(a,b){b=b||[0];if(0!=this.o)throw Error("Parsing of compact numbers is unimplemented");var c;a=a.replace(/ /g,"\u00a0");var d=a.indexOf(this.w,b[0])==b[0],e=a.indexOf(this.g,b[0])==b[0];d&&e&&(this.w.length>this.g.length?e=!1:this.w.length<this.g.length&&(d=!1));d?b[0]+=this.w.length:e&&(b[0]+=this.g.length);if(a.indexOf(QC.Fe,b[0])==b[0])b[0]+=QC.Fe.length,c=Infinity;else{c=a;var f=!1,g=!1,m=!1,q=1,y=QC.Sf,D=QC.Ee,T=QC.Wf;if(0!=this.o)throw Error("Parsing of compact style numbers is not implemented");
for(var ea="";b[0]<c.length;b[0]++){var wa=c.charAt(b[0]),ud=VC(wa);if(0<=ud&&9>=ud)ea+=ud,m=!0;else if(wa==y.charAt(0)){if(f||g)break;ea+=".";f=!0}else if(wa==D.charAt(0)&&("\u00a0"!=D.charAt(0)||b[0]+1<c.length&&0<=VC(c.charAt(b[0]+1)))){if(f||g)break}else if(wa==T.charAt(0)){if(g)break;ea+="E";g=!0}else if("+"==wa||"-"==wa)ea+=wa;else if(1==this.a&&wa==QC.bg.charAt(0)){if(1!=q)break;q=100;if(m){b[0]++;break}}else if(1==this.a&&wa==QC.cg.charAt(0)){if(1!=q)break;q=1E3;if(m){b[0]++;break}}else break}1!=
this.a&&(q=this.a);c=parseFloat(ea)/q}if(d){if(a.indexOf(this.A,b[0])!=b[0])return NaN;b[0]+=this.A.length}else if(e){if(a.indexOf(this.v,b[0])!=b[0])return NaN;b[0]+=this.v.length}return e?-c:c};
TC.prototype.format=function(a){if(isNaN(a))return QC.Hi;var b=[],c;c=a;if(0==this.o)c=WC;else{c=Math.abs(c);var d=XC(this,1>=c?0:YC(c)).Ue;c=XC(this,d+YC(ZC(this,c/Math.pow(10,d)).Sg))}a/=Math.pow(10,c.Ue);b.push(c.prefix);d=0>a||0==a&&0>1/a;b.push(d?this.g:this.w);if(isFinite(a))if(a=a*(d?-1:1)*this.a,this.F){var e=a;if(0==e)$C(this,e,this.b,b),aD(this,0,b);else{a=Math.floor(Math.log(e)/Math.log(10)+2E-15);var f=Math.pow(10,a);isFinite(f)&&0!==f?e/=f:(f=Math.pow(10,Math.floor(a/2)),e=e/f/f,1==a%
2&&(e=0<a?e/10:10*e));f=this.b;if(1<this.B&&this.B>this.b){for(;0!=a%this.B;)e*=10,a--;f=1}else 1>this.b?(a++,e/=10):(a-=this.b-1,e*=Math.pow(10,this.b-1));$C(this,e,f,b);aD(this,a,b)}}else $C(this,a,this.b,b);else b.push(QC.Fe);b.push(d?this.v:this.A);b.push(c.Vh);return b.join("")};
var ZC=function(a,b){var c=Math.pow(10,a.h),d;if(0>=a.aa)d=Math.round(b*c);else{d=b*c;var e=a.h;d&&(a=a.aa-YC(d)-1,a<-e?(e=Math.pow(10,e),d=Math.round(d/e)*e):(e=Math.pow(10,a),d=Math.round(d*e)/e));d=Math.round(d)}isFinite(d)?(b=Math.floor(d/c),c=Math.floor(d-b*c)):c=0;return{Sg:b,Nj:c}},$C=function(a,b,c,d){if(a.f>a.h)throw Error("Min value must be less than max value");d||(d=[]);b=ZC(a,b);var e=Math.pow(10,a.h),f=b.Sg,g=b.Nj,m=0<a.f||0<g||!1;b=a.f;m&&(b=a.f);for(var q="",y=f;1E20<y;)q="0"+q,y=
Math.round(y/10);var q=y+q,D=QC.Sf,y=QC.Ke.charCodeAt(0),T=q.length,ea=0;if(0<f||0<c){for(f=T;f<c;f++)d.push(String.fromCharCode(y));if(2<=a.l.length)for(c=1;c<a.l.length;c++)ea+=a.l[c];c=T-ea;if(0<c)for(var f=a.l,ea=T=0,wa,ud=QC.Ee,pg=q.length,Se=0;Se<pg;Se++){if(d.push(String.fromCharCode(y+1*Number(q.charAt(Se)))),1<pg-Se)if(wa=f[ea],Se<c){var cS=c-Se;(1===wa||0<wa&&1===cS%wa)&&d.push(ud)}else ea<f.length&&(Se===c?ea+=1:wa===Se-c-T+1&&(d.push(ud),T+=wa,ea+=1))}else{c=q;q=a.l;f=QC.Ee;wa=c.length;
ud=[];for(T=q.length-1;0<=T&&0<wa;T--){ea=q[T];for(pg=0;pg<ea&&0<=wa-pg-1;pg++)ud.push(String.fromCharCode(y+1*Number(c.charAt(wa-pg-1))));wa-=ea;0<wa&&ud.push(f)}d.push.apply(d,ud.reverse())}}else m||d.push(String.fromCharCode(y));(a.H||m)&&d.push(D);a=""+(g+e);for(e=a.length;"0"==a.charAt(e-1)&&e>b+1;)e--;for(f=1;f<e;f++)d.push(String.fromCharCode(y+1*Number(a.charAt(f))))},aD=function(a,b,c){c.push(QC.Wf);0>b?(b=-b,c.push(QC.Di)):a.J&&c.push(QC.Li);b=""+b;for(var d=QC.Ke,e=b.length;e<a.K;e++)c.push(d);
c.push(b)},VC=function(a){a=a.charCodeAt(0);if(48<=a&&58>a)return a-48;var b=QC.Ke.charCodeAt(0);return b<=a&&a<b+10?a-b:-1},UC=function(a,b,c){for(var d="",e=!1,f=b.length;c[0]<f;c[0]++){var g=b.charAt(c[0]);if("'"==g)c[0]+1<f&&"'"==b.charAt(c[0]+1)?(c[0]++,d+="'"):e=!e;else if(e)d+=g;else switch(g){case "#":case "0":case ",":case ".":case ";":return d;case "\u00a4":if(c[0]+1<f&&"\u00a4"==b.charAt(c[0]+1))c[0]++,d+=a.u;else switch(a.N){case 0:d+=OC[a.u][1];break;case 2:var g=a.u,m=OC[g],d=d+(g==
m[1]?g:g+" "+m[1]);break;case 1:d+=OC[a.u][2]}break;case "%":if(!a.m&&1!=a.a)throw Error("Too many percent/permill");if(a.m&&100!=a.a)throw Error("Inconsistent use of percent/permill characters");a.a=100;a.m=!1;d+=QC.bg;break;case "\u2030":if(!a.m&&1!=a.a)throw Error("Too many percent/permill");if(a.m&&1E3!=a.a)throw Error("Inconsistent use of percent/permill characters");a.a=1E3;a.m=!1;d+=QC.cg;break;default:d+=g}}return d},WC={prefix:"",Vh:"",Ue:0},XC=function(a,b){a=1==a.o?NC.Qf:NC.gi;null==a&&
(a=NC.Qf);if(3>b)return WC;b=Math.min(14,b);var c=a[Math.pow(10,b)];for(--b;!c&&3<=b;)c=a[Math.pow(10,b)],b--;if(!c)return WC;a=c.other;return a&&"0"!=a?(a=/([^0]*)(0+)(.*)/.exec(a))?{prefix:a[1],Vh:a[3],Ue:b+1-(a[2].length-1)}:WC:WC},YC=function(a){if(!isFinite(a))return 0<a?a:0;for(var b=0;1<=(a/=10);)b++;return b};var bD=function(a){return 1==a%10&&11!=a%100?"one":2==a%10&&12!=a%100?"two":3==a%10&&13!=a%100?"few":"other"},cD=bD,cD=bD;var dD=function(a,b){if(void 0===b){b=a+"";var c=b.indexOf(".");b=Math.min(-1==c?0:b.length-c-1,3)}return 1==(a|0)&&0==b?"one":"other"},eD=dD,eD=dD;var iD=function(a){this.g=a;this.b=this.a=this.l=null;a=QC;var b=NC;if(fD!==a||gD!==b)fD=a,gD=b,hD=new TC(1);this.h=hD},fD=null,gD=null,hD=null,jD=/'([{}#].*?)'/g,kD=/''/g;iD.prototype.format=function(a){if(this.g){this.l=[];var b=lD(this,this.g);this.b=mD(this,b);this.g=null}if(this.b&&0!=this.b.length)for(this.a=u(this.l),b=[],nD(this,this.b,a,!1,b),a=b.join("");0<this.a.length;)a=a.replace(this.f(this.a),this.a.pop());else a="";return a};
var nD=function(a,b,c,d,e){for(var f=0;f<b.length;f++)switch(b[f].type){case 4:e.push(b[f].value);break;case 3:var g=b[f].value,m=a,q=e,y=c[g];k(y)?(m.a.push(y),q.push(m.f(m.a))):q.push("Undefined parameter - "+g);break;case 2:g=b[f].value;m=e;q=g.Xd;k(c[q])?(q=g[c[q]],k(q)||(q=g.other),nD(a,q,c,d,m)):m.push("Undefined parameter - "+q);break;case 0:g=b[f].value;oD(a,g,c,eD,d,e);break;case 1:g=b[f].value;oD(a,g,c,cD,d,e);break;default:ab("Unrecognized block type: "+b[f].type)}},oD=function(a,b,c,d,
e,f){var g=b.Xd,m=b.pg,q=+c[g];isNaN(q)?f.push("Undefined or invalid parameter - "+g):(m=q-m,g=b[c[g]],k(g)||(d=a.h.V?d(m,a.h.V()):d(m),g=b[d],k(g)||(g=b.other)),b=[],nD(a,g,c,e,b),c=b.join(""),e?f.push(c):(a=a.h.format(m),f.push(c.replace(/#/g,a))))},lD=function(a,b){var c=a.l,d=n(a.f,a);b=b.replace(kD,function(){c.push("'");return d(c)});return b=b.replace(jD,function(a,b){c.push(b);return d(c)})},pD=function(a){var b=0,c=[],d=[],e=/[{}]/g;e.lastIndex=0;for(var f;f=e.exec(a);){var g=f.index;"}"==
f[0]?(c.pop(),0==c.length&&(f={type:1},f.value=a.substring(b,g),d.push(f),b=g+1)):(0==c.length&&(b=a.substring(b,g),""!=b&&d.push({type:0,value:b}),b=g+1),c.push("{"))}b=a.substring(b);""!=b&&d.push({type:0,value:b});return d},qD=/^\s*(\w+)\s*,\s*plural\s*,(?:\s*offset:(\d+))?/,rD=/^\s*(\w+)\s*,\s*selectordinal\s*,/,sD=/^\s*(\w+)\s*,\s*select\s*,/,mD=function(a,b){var c=[];b=pD(b);for(var d=0;d<b.length;d++){var e={};if(0==b[d].type)e.type=4,e.value=b[d].value;else if(1==b[d].type){var f=b[d].value;
switch(qD.test(f)?0:rD.test(f)?1:sD.test(f)?2:/^\s*\w+\s*/.test(f)?3:5){case 2:e.type=2;e.value=tD(a,b[d].value);break;case 0:e.type=0;e.value=uD(a,b[d].value);break;case 1:e.type=1;e.value=vD(a,b[d].value);break;case 3:e.type=3;e.value=b[d].value;break;default:ab("Unknown block type for pattern: "+b[d].value)}}else ab("Unknown part of the pattern.");c.push(e)}return c},tD=function(a,b){var c="";b=b.replace(sD,function(a,b){c=b;return""});var d={};d.Xd=c;b=pD(b);for(var e=0;e<b.length;){var f=b[e].value;
e++;if(1==b[e].type)var g=mD(a,b[e].value);else ab("Expected block type.");d[f.replace(/\s/g,"")]=g;e++}return d},uD=function(a,b){var c="",d=0;b=b.replace(qD,function(a,b,e){c=b;e&&(d=parseInt(e,10));return""});var e={};e.Xd=c;e.pg=d;b=pD(b);for(var f=0;f<b.length;){var g=b[f].value;f++;if(1==b[f].type)var m=mD(a,b[f].value);else ab("Expected block type.");e[g.replace(/\s*(?:=)?(\w+)\s*/,"$1")]=m;f++}return e},vD=function(a,b){var c="";b=b.replace(rD,function(a,b){c=b;return""});var d={};d.Xd=c;
d.pg=0;b=pD(b);for(var e=0;e<b.length;){var f=b[e].value;e++;if(1==b[e].type)var g=mD(a,b[e].value);else ab("Expected block type.");d[f.replace(/\s*(?:=)?(\w+)\s*/,"$1")]=g;e++}return d};iD.prototype.f=function(a){return"\ufddf_"+(a.length-1).toString(10)+"_"};var wD=chrome.i18n.getMessage("1522140683318860351"),xD=chrome.i18n.getMessage("4246483347873264186"),yD=chrome.i18n.getMessage("5991427458288444010"),zD=chrome.i18n.getMessage("6063910461797960050"),AD=chrome.i18n.getMessage("7735695102441495789"),BD=chrome.i18n.getMessage("4575332923598659024"),CD=chrome.i18n.getMessage("2297080986956220930"),DD=new iD(CD);var ED=function(a){this.a=a;this.j=v("mr.cloud.mesi.MesiService")},xC=function(a){var b=tB.a;.1>Math.random()&&(b=b.replace("v1","v1_preprod"));b=CB(b,["hangouts","search"]);x(a.j,"Retrieving Hangouts from MESI: "+b);return DB(a.a,b,"POST",FD).then(function(a){var b=[];a.result&&(b=a.result.map(function(a){var b=a.hangout,c=b.meeting_room_name,d;b.meeting_domain?d=b.meeting_domain:"BUSINESS"==b.type&&b.company_title&&(d=b.company_title.toLowerCase());var e=DD.format({ORGANIZER:"",PARTICIPANTS:0});
if((a=a.participant)&&0<a.length)var y=a[0].display_name,e=a.reduce(function(a,b){a.add(b.user_id);"ORGANIZER"==b.role&&(y=b.display_name);return a},new Set),e=DD.format({ORGANIZER:y,PARTICIPANTS:e.size});return c&&d?new vB(!1,c+"@"+d,d,c,e,b.hangout_id):new vB(!1,b.hangout_id,d,c,e,b.hangout_id)}));return b})},FD={request_header:{client_version:{client_id:"39"}},search_sources:["0"]};var GD=function(a,b,c){this.state=a;this.type=null!=b?b:null;this.a=null!=c?c:null},HD=function(a){this.a=a},KD=function(a,b,c,d){return ID(a,LB,b,c,d,35E3).then(function(b){return JD(a,b)})},MD=function(a,b,c,d){return ID(a,MB,b,c,d,23E3).then(function(a){var b=a.state;return"done"==b?(a=LD(a),new GD(b,a.type,new IB(a.sessionDescription))):new GD(b)})},ID=function(a,b,c,d,e,f){var g={_webrtcMessage:JSON.stringify(d.presentationUrl?new IB(d.description,null,d.presentationUrl):new IB(d.description))};
d.settings&&(g._settings=zh(d.settings));d.mediaConstraints&&(g._optMediaConstraints=JSON.stringify(d.mediaConstraints));e&&(g._user=JSON.stringify(e));return ND(a,c,b,g,f)},JD=function(a,b){var c=b.state;switch(c){case "done":return Promise.resolve(OD(b));case "queued":case "inProgress":return PD(a,b).then(function(b){return JD(a,b)});default:return Promise.resolve(new GD(c))}},PD=function(a,b){return new Promise(function(c){var d=setInterval(function(){QD(a,b.id).then(function(a){"queued"!=a.state&&
"inProgress"!=a.state&&(clearInterval(d),c(a))})},2E3)})},OD=function(a){a=LD(a);return"__cloud_webrtc_session_message__"==a.type?new GD("done","knocking_cloud_webrtc_session_message",new IB(a.sessionDescription)):new GD("done",a.type)},ND=function(a,b,c,d,e){b={deviceId:b,name:"_cloudCast."+c.name,parameters:d,expirationTimeoutMs:e||1E4};c={};e&&(c.responseAwaitMs=Math.min(e+5E3,25E3));e=CB(rB.a,["commands"],c);return DB(a.a,e,"POST",b)},LD=function(a){return a.results&&a.results.results?JSON.parse(a.results.results):
null},QD=function(a,b){b=CB(rB.a,["commands",b]);return DB(a.a,b,"GET")};HD.$inject=["gapiService"];var RD=function(a,b,c,d){this.b=a;this.f=b;this.g=c;this.a=d},UD=function(a,b,c,d){return SD(a,b,d).then(function(b){var d;a:if(d=c.id,"done"!=b.state)d=Promise.reject(Error("Offer not executed by receiver. State: "+b.state));else{switch(b.type){case "__cloud_webrtc_session_message__":b=new Ch("ANSWER",b.a.sessionDescription);a.a.lb(b,d);break;case "knocking_cloud_webrtc_session_message":YB(0);b=new Ch("KNOCK_ANSWER",b.a.sessionDescription);a.a.lb(b,d);break;case "knock_denied":YB(1);TD(a,xD,d);break;
case "knock_timeout":YB(2);TD(a,yD,d);break;default:d=Promise.reject(Error("Invalid message type: "+b.type));break a}d=Promise.resolve()}return d})},WD=function(a,b){return VD(a.g).then(function(c){a.a.lb(new Ch("TURN_CREDENTIALS",{credentials:c}),b.id)})},SD=function(a,b,c){var d=c.deviceId,e=a.f.a,e=e?new GB(e):void 0;b=b.data;switch(c.Le){case "owner":aC(0);break;case "manager":aC(1);break;case "user":aC(2);break;case "viewer":aC(3)}return"viewer"==c.Le?KD(a.b,d,b,e):MD(a.b,d,b,e)},TD=function(a,
b,c){b=new $f(b,"warning","dismiss");b.isBlocking=!0;a.a.Yg().send(b);a.a.lb(new Ch("STOP"),c)};var XD=function(a,b){this.b=a;this.a=b},YD=function(a,b,c,d){switch(b.type){case "REFRESH_AUTH":var e=d.vb,f=d.deviceId,g=d.qc;return KC(a.b).then(function(){a.a.lb(new Ch("AUTH_READY",{vb:e,Ta:f,qc:g}),c.id)});case "LOCAL_PRESENT":return a.a.lb(new Ch("AUTH_READY",{vb:d.vb,Ta:d.deviceId,qc:d.qc,Zb:!b.data.local}),c.id),Promise.resolve();case "STATUS_REQUEST":return a.a.lb(b,c.id),Promise.resolve();case "STATUS_RESPONSE":return a.a.lb(b,c.id,!0),b.data.routeDescription||a.a.lb(b,c.id),Promise.resolve();
case "HANGOUT_INACTIVE":return a.a.vc(c,4,new $f(AD,"warning","dismiss"));case "HANGOUT_INVALID":return a.a.vc(c,3,new $f(BD,"warning","dismiss"));default:return Promise.reject(Error("Unknown type: "+b.type))}};var ZD=function(a,b,c){this.b=a;this.f=b;this.a=c},$D=function(a,b,c,d,e){return new Promise(function(f){switch(b){case "cloud":case "mesi":break;default:throw Error("Unrecognized channel type");}if(!c.type)throw Error("Message has no type");switch(c.type){case "STOP":f(a.a.vc(d,1,null));return;case "SESSION_START_SUCCESS":ZB(0);break;case "SESSION_END":break;case "SESSION_FAILURE":ZB(1);f(a.a.vc(d,2,new $f(wD,"warning","dismiss")));return;case "__webrtc_stats__":break;case "PRESENTATION_CONNECTION_MESSAGE":a.a.lb(c.data,
d.id,!0);break;case "OFFER":f(UD(a.b,c,d,e));return;case "GET_TURN_CREDENTIALS":f(WD(a.b,d));return;case "REFRESH_AUTH":case "LOCAL_PRESENT":case "MUTE":case "STATUS_REQUEST":case "STATUS_RESPONSE":case "HANGOUT_INACTIVE":case "HANGOUT_INVALID":f(YD(a.f,c,d,e));return;case "new_session":a.a.lb(c,d.id,!0);break;case "remove_session":a.a.lb(c,d.id,!0);a.a.terminateRoute(d.id);break;default:throw Error("Unknown type: "+c.type);}f()})};var aE=function(){var a=this;this.j=v("mr.cloud.settings.SettingsService");this.a=null;chrome.settingsPrivate.onPrefsChanged.addListener(function(b){Og(13);if(a.a){b=ja(b);for(var c=b.next();!c.done;c=b.next())if(c=c.value,"media_router.cloudservices.enabled"==c.key){a.a.call(null,c.value);break}}})},bE=function(a,b){a.a=b},cE=function(a){var b=a.j;chrome.storage.sync.set({"mr.cloud.cloudEnabled":!0},function(){chrome.runtime.lastError&&w(b,"Error setting cloud setting: "+JSON.stringify(chrome.runtime.lastError))})},
eE=function(a){return dE().catch(function(){return dE().catch(function(b){w(a.j,"Error retrieving cloud on setting.",b);return!1})})},dE=function(){return fE("mr.cloud.cloudEnabled").then(function(a){return!!a["mr.cloud.cloudEnabled"]})},fE=function(a){return new Promise(function(b,c){chrome.storage.sync.get(a,function(a){chrome.runtime.lastError?c(chrome.runtime.lastError):b(a)})})},hE=function(a){return gE().catch(function(){return gE().catch(function(b){w(a.j,"Error retrieving cloud enabled setting.",
b);return!1})})},gE=function(){return iE().then(function(a){return!!a.value})},iE=function(){return new Promise(function(a,b){chrome.settingsPrivate.getPref("media_router.cloudservices.enabled",function(c){chrome.runtime.lastError?b(chrome.runtime.lastError):a(c)})})},jE=function(a){var b=a.j;chrome.storage.sync.set({"mr.cloud.notifiedHangouts":!0},function(){chrome.runtime.lastError&&w(b,"Error setting notified Hangout privacy.",chrome.runtime.lastError)})},lE=function(a){return kE().catch(function(){return kE().catch(function(b){w(a.j,
"Error retrieving hangouts notified setting.",b);return!1})})},kE=function(){return fE("mr.cloud.notifiedHangouts").then(function(a){return!!a["mr.cloud.notifiedHangouts"]})};var mE=function(){this.j=v("mr.cloud.CredentialService")},VD=function(a){var b=new Qc,c=uB.a+"/iceconfig?key="+uB.b;x(a.j,"Requesting TURN credentials from "+c);var d=mj(c,function(){wj(d)?(x(a.j,"Got TURN credentials: "+xj(d)),b.resolve(nE(a,yj(d)))):b.resolve(oE(a))},void 0,{"Content-Type":"application/json"});return b.a},nE=function(a,b){try{var c=[];b.iceServers.forEach(function(a){a.urls.forEach(function(b){0==b.indexOf("turn:")&&c.push({url:b,credential:a.credential,username:a.username})})});
return c}catch(d){return a.j.error("Error parsing TURN credentials.",d),[]}},oE=function(a){a.j.error("XHR failed fetching TURN credentials.",null);return[]};var pE=function(a){return{a:function(b){return a().then(function(a){return Pz(b,"Authorization","Bearer "+a)})}}};var qE=function(){this.v=this.a=this.F=this.K=this.B=this.A=this.w=this.u=this.h=this.f=this.m=this.l=this.g=this.o=this.b=null},tE=function(a){null==a.a&&(a.a=new HA(rE(a)),bA(IA(a.a,!0),pE(function(){return be(sE(a).getAuthToken())})));return a.a},rE=function(a){null==a.v&&(a.v=new Ax);return a.v},sE=function(a){null==a.b&&(a.b=new IC);return a.b},uE=function(a){null==a.o&&(a.o=new AC(sE(a)));return a.o},vE=function(a){null==a.u&&(a.u=new HD(uE(a)));return a.u};qa(qE);
