(function(){var g={}; var _ = _ || {}
var f=function(window){var LT=function(){this.g=new _.J("clpp.mediatailor.MediaTailorPlugin")},MT=function(a,b,c){var d,e,f,g,h;return _.H(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.sb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.x(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;h={aj:_.Qk(f,b),Cp:g?_.Qk(g,b):null};a.g.info("Media Tailor session initialized.\n  - manifest URI: "+h.aj);return l["return"](h)})},NT=function(){};_.w(LT,_.bw);
LT.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.H(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.C(g,2);return _.x(g,MT(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.K("mt-session-started")),b.url=e.aj,_.uh(g,0);f=_.E(g);c.g.error("Failed to start session",f);throw new _.N(_.O,9,7003,"Media Tailor session failed to initialize.");})};LT.prototype.id=function(){return"mediatailor"};
NT.prototype.create=function(){return new LT};_.Yt(new NT);};
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
else{_=this.clpp._;(f.call(g,this));}
})();