'use strict';ab("mr.TestProvider");var Tx,ox,Ux=ab("mr.Init"),Vx=function(a){void 0!==a.use_views_dialog&&B(Ux,"Using the "+(a.use_views_dialog?"Views (Harmony)":"WebUI")+" dialog.");void 0!==a.enable_cast_sink_query&&B(Ux,"Native Cast MRP is "+(a.enable_cast_sink_query?"disabled":"enabled")+".");void 0!==a.use_mirroring_service&&B(Ux,"Native Mirroring Service is "+(a.use_mirroring_service?"enabled":"disabled")+".")};wr().init();Tx=new pb("MediaRouter.Provider.WakeDuration");ox=new Ex;
var Wx=(new Promise(function(a,b){switch(window.location.host){case "enhhojjnijigcajfphajepfemndkmdlo":a();break;case "pkedcjkdefgpdelpbcmbmeomcjbeemfm":chrome.management.get("enhhojjnijigcajfphajepfemndkmdlo",function(c){chrome.runtime.lastError||!c.enabled?a():b(Error("Dev extension is enabled"))});break;default:b(Error("Unknown extension id"))}})).then(function(){return chrome.mojoPrivate&&chrome.mojoPrivate.requireAsync?new Promise(function(a){chrome.mojoPrivate.requireAsync("media_router_bindings").then(function(b){mojo=b.getMojoExports&&
b.getMojoExports();b.start().then(function(c){a({mrService:b,mrInstanceId:c.instance_id||c,mrConfig:c.config})})})}):Promise.reject(Error("No mojo service loaded"))}).then(function(a){if(!a.mrService)throw Error("Failed to get MR service");var b=a.mrInstanceId;if(!b)throw Error("Failed to get MR instance ID.");B(Ux,"MR instance ID: "+b);Vx(a.mrConfig);var c=a.mrService;if(!ox)throw Error("providerManager not initialized.");c.setHandlers(ox);fm(b)&&(Tx.g="MediaRouter.Provider.FirstWakeDuration");chrome.runtime.onSuspend.addListener(Tx.end.bind(Tx));
jm(b);zr();b=nx(!!a.mrConfig.enable_cast_sink_query);window.addEventListener("unhandledrejection",function(d){d=d.reason;d.stack||(d=Error(d));Ux.error("Unhandled promise rejection.",d)});Hx(c,b,a.mrConfig)}).then(void 0,function(a){Ux.J(a.message);throw a;});[].concat(q([mx(),jx()].concat(q(Fp()),q([Bw()])))).forEach(function(a){dm(a)});mx().addListener();jx().addListener();chrome.runtime.onStartup.addListener(function(){});Wx.then(void 0,function(){return window.close()});
