@castlabs/prestoplay 6.25.2-beta.7 → 6.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +105 -105
  6. package/cjs/cl.conviva.js +31 -31
  7. package/cjs/cl.core.js +329 -329
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +88 -88
  10. package/cjs/cl.externs.js +31 -31
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +77 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +291 -289
  18. package/cjs/cl.muxdata.js +9 -9
  19. package/cjs/cl.persistent.js +10 -10
  20. package/cjs/cl.playlist.js +4 -4
  21. package/cjs/cl.sessions.js +8 -8
  22. package/cjs/cl.simid.js +4 -4
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +11 -11
  25. package/cjs/cl.tizen.js +69 -69
  26. package/cjs/cl.ttml.js +3 -3
  27. package/cjs/cl.verimatrix.js +2 -2
  28. package/cjs/cl.vimond.js +8 -8
  29. package/cjs/cl.vr.js +7 -7
  30. package/cjs/cl.vtt.js +2 -2
  31. package/cjs/cl.yospace.js +2 -2
  32. package/cjs/cl.youbora.js +17 -17
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +5 -5
  36. package/cl.cast.js +84 -84
  37. package/cl.conviva.js +26 -26
  38. package/cl.core.js +178 -178
  39. package/cl.crypto.js +8 -8
  40. package/cl.dash.js +82 -82
  41. package/cl.externs.js +31 -31
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +80 -80
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +17 -18
  47. package/cl.mediatailor.js +3 -3
  48. package/cl.mse.js +243 -243
  49. package/cl.muxdata.js +6 -6
  50. package/cl.persistent.js +2 -2
  51. package/cl.playlist.js +4 -4
  52. package/cl.sessions.js +2 -2
  53. package/cl.simid.js +1 -1
  54. package/cl.smooth.js +60 -60
  55. package/cl.thumbnails.js +9 -9
  56. package/cl.tizen.js +54 -54
  57. package/cl.ttml.js +2 -2
  58. package/cl.verimatrix.js +1 -1
  59. package/cl.vimond.js +3 -3
  60. package/cl.vr.js +2 -2
  61. package/cl.vtt.js +2 -2
  62. package/cl.yospace.js +2 -2
  63. package/cl.youbora.js +12 -12
  64. package/package.json +1 -1
  65. package/typings.d.ts +9 -0
package/cjs/cl.htmlcue.js CHANGED
@@ -1,34 +1,34 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var hU="CLPP Subtitle Styles",iU="Unsupported unit",jU="clpp-text-plain",kU="clpp-text-ttml",lU="clpp.htmlcue.HtmlTextDisplayer",mU="initial",nU=function(a){return _.Ki(a,{Fh:function(b,c){return b.pa(c)}})},oU=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},pU=function(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},qU=function(){},rU=function(a){if(!a.input)return null;
3
- var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},tU=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return sU[c]});return a},vU=function(a,b){uU(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){uU(a,c)})},uU=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},wU=function(a,b){return 0===a?"0":a+b},xU=function(a,b){return 1>Math.abs(a-b)||a<b},yU=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},zU=function(a,b){return a>b&&1<Math.abs(a-b)},AU=function(a,b){return 1>Math.abs(a-b)||a>b},BU=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},CU=function(a){return new BU(a.left,a.f,a.top,a.a,a.height,a.width)},DU=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
5
- 0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new BU(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},EU=function(a,b){return b.some(function(c){return yU(a.left,c.f)&&zU(a.f,c.left)&&yU(a.top,c.a)&&zU(a.a,c.top)})},FU=function(a,b){return AU(a.top,b.top)&&xU(a.a,b.a)&&AU(a.left,b.left)&&xU(a.f,b.f)},GU=function(a,b,c){switch(c){case "+x":return yU(a.left,b.left);case "-x":return zU(a.f,b.f);
6
- case "+y":return yU(a.top,b.top);case "-y":return zU(a.a,b.a);default:throw Error("Unknown axis");}},HU=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},IU=function(a,b,c){HU.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c},KU=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return JU(a)?b:c},NU=function(a,b,c){return JU(a)&&_.L.wa(c)?wU(c,_.Hf):(LU(a)||
7
- MU(a))&&_.L.wa(b)?wU(b,"%"):mU},LU=function(a){return a.f.writingMode===_.Gg},MU=function(a){return a.f.writingMode===_.Hg},JU=function(a){return a.f.writingMode===_.Oi},OU=function(a,b,c){return(LU(a)||MU(a))&&_.L.wa(c)?wU(c,_.Hf):LU(a)&&_.L.R(c)?wU(0,_.Hf):JU(a)&&_.L.wa(b)?wU(b,"%"):mU},PU=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ye:return a.f.position;case "auto":case _.id:return a.f.position-a.f.size/2;case _.ze:return a.f.position-a.f.size}return 0},
8
- QU=function(a){switch(a.f.positionAlign){case _.ye:return _.ve;case "auto":case _.id:return _.Ni;case _.ze:return _.Of}return a.f.textAlign},RU=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ag:case _.ve:return _.ye;case _.Ni:return _.id;case _.ge:case _.Of:return _.ze}return a.f.positionAlign},SU=function(a){switch(a.f.writingMode){case _.Oi:return"horizontal-tb";case _.Gg:return _.Gg;case _.Hg:return _.Hg;default:throw Error("Unknown writing mode");}},TU=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=DU(a.a);this.h=[]},UU=function(a,b){if(a.j)switch(b.writingMode){case _.Oi:return["-y"];case _.Gg:return["+x"];case _.Hg:return["-x"]}var c=[];switch(b.writingMode){case _.Oi:c=["+y","-y"];break;case _.Gg:c=["+x","-x"];break;case _.Hg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},VU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=DU(a.l.a)},WU=function(a,b,c){HU.call(this,a,b,c);this.h=null;this.l=[]},XU=function(a,b){WU.call(this,
10
- a.id,"clpp-text-cue-region",b);this.f=a},YU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Ti)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(iU);},$U=function(a){this.g=new _.J("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=ZU(this,this.h);this.f=ZU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},aV=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
11
- a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},bV=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,
12
- c)},ZU=function(a,b,c){var d=document.createElement(_.gg),e=d.dataset;e.name=hU;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);cV(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},cV=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===hU&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
- c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},fV=function(a){_.Dv.call(this,a);var b=this;this.g=new _.J(lU);this.m=a;this.L=dV(a.getConfiguration());this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new $U(a.getSurface().getUniqueCssClass());this.a=new WU(null,"clpp-text-container",{});this.w=new _.Vu(a.getSurface(),this.yk.bind(this));this.J=null;this.C?(this.C.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
- this.G=new _.Xh(function(){eV(b)});this.A=new Map;this.l=null},dV=function(a){a=_.L.kb(a.htmlcue||{});_.L.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.L.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},gV=function(a,b){return a.startTime<=b&&a.endTime>b},eV=function(a,b){if((b||a.j)&&a.C){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Hq){a.J=c;var d=hV(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,iV(a),
15
- d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Xv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.u(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.Qg:h="clpp-text-vtt";break;case _.ug:h=kU;break;case _.Mi:h=jU}h&&!g.classList.contains(h)&&_.fr(g,h);g=DU(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
- else{uU({fontSize:jV(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Qg;var l=e.payloadType===_.ug;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new XU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new IU(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},hV=function(a,b){var c=pU(a.f,function(e){return gV(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&gV(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
- gV(a.f[c+1],b);)c++;return{start:d,end:c}},kV=function(a){iV(a);a.J=null;a.l=null;a.f=[]},iV=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(kU);b.classList.remove(jU);a=a.a;VU(a.h);a.l=[]}},jV=function(a,b){var c=DU(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Hf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Hf;d=a.getFontSizePercent();return Math.round(c*d)+_.Hf},lV=function(){},
18
- mV=function(){};
19
- qU.prototype.parse=function(a){a={input:a};for(var b=_.hr(_.Qd),c=[],d=b,e;null!==(e=rU(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=nV[f];h?(h=_.hr(h),(f=oV[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||pV[g.localName]&&pV[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
- d=g)}}else d.appendChild(document.createTextNode(tU(e)));return b};var nV={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},oV={v:"voice",lang:"lang"},pV={rt:"ruby"},sU={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};HU.prototype.init=function(){this.j=!0};HU.prototype.A=function(){return!1};_.w(IU,HU);IU.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
- IU.prototype.init=function(a){HU.prototype.init.call(this,a);if(this.h)_.fr(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.ug){var c=_.hr(_.Qd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Qg?b=(new qU).parse(b.payload):(c=_.hr(_.Qd),c.textContent=b.payload,b=c);_.fr(b,this.w);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
22
- c.next();!d.done;d=c.next())_.fr(b,d.value);uU({writingMode:SU(this)},b);this.a.appendChild(b);_.fr(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.fr(this.a,"clpp-text-wrapper__"+d.value);_.L.R(this.f.line)&&(this.f.lineInterpretation=_.Pi,this.f.line=JU(this)?-1:0);c=SU(this);uU({writingMode:c,webkitWritingMode:c,direction:mU,textAlign:QU(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=PU(this,RU(this));d=OU(this,c,null);var e=NU(this,
23
- c,null),f=MU(this)&&_.L.R(null)?wU(0,_.Hf):mU;uU({position:"absolute",left:d,right:f,top:e,width:JU(this)?wU(this.f.size,"%"):mU,height:LU(this)||MU(this)?wU(this.f.size,"%"):mU},this.a);d=this.f;a=JU(this)?a.height:a.width;e=KU(this);if(d.lineInterpretation===_.Pi)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.id:g-=f/2;break;case _.ge:g-=f}f=Math.round(g/100*a)}MU(this)&&(f=a-f-e);a=f;d=OU(this,c,a);e=MU(this)&&_.L.R(a)?
24
- wU(0,_.Hf):mU;uU({left:d,right:e,top:NU(this,c,a)},this.a)}vU(this.C,b)}};IU.prototype.o=function(){return _.hr(_.Qd)};TU.prototype.append=function(a){var b=a.a;b.style.visibility=_.qe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=DU(a.a);var d=UU(this,a.f),e=KU(a),f=CU(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;GU(c,this.a,l)||FU(c,this.a)&&EU(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||FU(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
25
- l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>h&&(g=CU(c),h=l);c=CU(f)}c=g||f}uU({top:wU(c.top-this.a.top,_.Hf),bottom:wU(this.a.a-c.a,_.Hf),left:wU(c.left-this.a.left,_.Hf),right:wU(this.a.f-c.f,_.Hf),height:wU(c.height,_.Hf),width:wU(c.width,_.Hf)},a.a)}b.style.visibility="visible";this.h.push(DU(a.a))};_.w(WU,HU);WU.prototype.init=function(){this.h=new TU(this);this.j=!0};WU.prototype.o=function(){var a=_.hr(_.Qd);_.fr(a,this.w);this.id&&(a.id=this.id);return a};WU.prototype.appendChild=function(a){VU(this.h);this.l.unshift(a);a=_.u(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(XU,WU);
26
- XU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Ti:b=b.width/100*a.width;break a;default:throw Error(iU);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ti)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(iU);d=a.height;var e=YU(this,d,a.height);uU(this.B,this.a);uU({left:wU(c,_.Hf),top:wU(e,_.Hf),width:wU(b,_.Hf),height:wU(d,_.Hf)},this.a);this.f.writingMode&&uU({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&uU({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.fr(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Ti:b=b.height/100*a.height;break a;case 2:b=b.height;d=new IU(new _.Si(0,1,"Lorem ipsum",_.Mi),{},{});c=d.a;this.a.appendChild(c);d.init(DU(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(iU);
28
- }a=YU(this,b,a.height);uU({top:wU(a,_.Hf),height:wU(b,_.Hf)},this.a);this.h=new TU(this,!0);this.j=!0};XU.prototype.getId=function(){return this.f.id};$U.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=bV(this,a);if(aV(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
29
- $U.prototype.destroy=function(){var a=this;return _.H(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.y(b)})};_.w(fV,_.Dv);_.r=fV.prototype;_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=oU(this.f,nU(a));this.l=null;eV(this,!1)}};_.r.Vb=function(){null==this.h||eV(this,!0)};
30
- _.r.destroy=function(){var a=this;return _.H(function(b){if(1==b.a){if(null==a.h)return b["return"]();kV(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.C.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.y(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;eV(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
31
- _.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Ib(.25),this.L.enableResizeObserver&&this.w.start(),eV(this,!0)):(this.G.stop(),this.w.stop(),kV(this)))};_.r.yk=function(){eV(this,!0)};_.I(lU,fV);fV.prototype.setTextVisibility=fV.prototype.setTextVisibility;fV.prototype.isTextVisible=fV.prototype.isTextVisible;fV.prototype.remove=fV.prototype.remove;fV.prototype.destroy=fV.prototype.destroy;fV.prototype.append=fV.prototype.append;lV.prototype.a=function(a){return!!a.enableHtmlCue&&!_.zl()};lV.prototype.create=function(a){return new fV(a)};_.w(mV,_.Bu);mV.prototype.f=function(){_.jq(_.re,new lV)};mV.prototype.a=function(){_.hq.has(_.re)&&(_.hq["delete"](_.re),_.iq.info("Removed factory: 'html'"))};mV.prototype.id=function(){return _.ig};_.I("clpp.htmlcue.HtmlCueComponent",mV);};
2
+ var f=function(window){var iU="CLPP Subtitle Styles",jU="Unsupported unit",kU="clpp-text-plain",lU="clpp-text-ttml",mU="clpp.htmlcue.HtmlTextDisplayer",nU="initial",oU=function(a){return _.Ki(a,{Ih:function(b,c){return b.pa(c)}})},pU=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},qU=function(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},rU=function(){},sU=function(a){if(!a.input)return null;
3
+ var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},uU=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return tU[c]});return a},wU=function(a,b){vU(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){vU(a,c)})},vU=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},xU=function(a,b){return 0===a?"0":a+b},yU=function(a,b){return 1>Math.abs(a-b)||a<b},zU=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},AU=function(a,b){return a>b&&1<Math.abs(a-b)},BU=function(a,b){return 1>Math.abs(a-b)||a>b},CU=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},DU=function(a){return new CU(a.left,a.f,a.top,a.a,a.height,a.width)},EU=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
5
+ 0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new CU(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},FU=function(a,b){return b.some(function(c){return zU(a.left,c.f)&&AU(a.f,c.left)&&zU(a.top,c.a)&&AU(a.a,c.top)})},GU=function(a,b){return BU(a.top,b.top)&&yU(a.a,b.a)&&BU(a.left,b.left)&&yU(a.f,b.f)},HU=function(a,b,c){switch(c){case "+x":return zU(a.left,b.left);case "-x":return AU(a.f,b.f);
6
+ case "+y":return zU(a.top,b.top);case "-y":return AU(a.a,b.a);default:throw Error("Unknown axis");}},IU=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},JU=function(a,b,c){IU.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c},LU=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return KU(a)?b:c},OU=function(a,b,c){return KU(a)&&_.L.wa(c)?xU(c,_.Hf):(MU(a)||
7
+ NU(a))&&_.L.wa(b)?xU(b,"%"):nU},MU=function(a){return a.f.writingMode===_.Gg},NU=function(a){return a.f.writingMode===_.Hg},KU=function(a){return a.f.writingMode===_.Oi},PU=function(a,b,c){return(MU(a)||NU(a))&&_.L.wa(c)?xU(c,_.Hf):MU(a)&&_.L.R(c)?xU(0,_.Hf):KU(a)&&_.L.wa(b)?xU(b,"%"):nU},QU=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ye:return a.f.position;case "auto":case _.id:return a.f.position-a.f.size/2;case _.ze:return a.f.position-a.f.size}return 0},
8
+ RU=function(a){switch(a.f.positionAlign){case _.ye:return _.ve;case "auto":case _.id:return _.Ni;case _.ze:return _.Of}return a.f.textAlign},SU=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ag:case _.ve:return _.ye;case _.Ni:return _.id;case _.ge:case _.Of:return _.ze}return a.f.positionAlign},TU=function(a){switch(a.f.writingMode){case _.Oi:return"horizontal-tb";case _.Gg:return _.Gg;case _.Hg:return _.Hg;default:throw Error("Unknown writing mode");}},UU=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=EU(a.a);this.h=[]},VU=function(a,b){if(a.j)switch(b.writingMode){case _.Oi:return["-y"];case _.Gg:return["+x"];case _.Hg:return["-x"]}var c=[];switch(b.writingMode){case _.Oi:c=["+y","-y"];break;case _.Gg:c=["+x","-x"];break;case _.Hg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},WU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=EU(a.l.a)},XU=function(a,b,c){IU.call(this,a,b,c);this.h=null;this.l=[]},YU=function(a,b){XU.call(this,
10
+ a.id,"clpp-text-cue-region",b);this.f=a},ZU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Ti)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(jU);},aV=function(a){this.g=new _.J("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=$U(this,this.h);this.f=$U(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},bV=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
11
+ a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},cV=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,
12
+ c)},$U=function(a,b,c){var d=document.createElement(_.gg),e=d.dataset;e.name=iU;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);dV(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},dV=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===iU&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
+ c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},gV=function(a){_.Dv.call(this,a);var b=this;this.g=new _.J(mU);this.m=a;this.L=eV(a.getConfiguration());this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new aV(a.getSurface().getUniqueCssClass());this.a=new XU(null,"clpp-text-container",{});this.w=new _.Vu(a.getSurface(),this.Ak.bind(this));this.J=null;this.C?(this.C.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
+ this.G=new _.Xh(function(){fV(b)});this.A=new Map;this.l=null},eV=function(a){a=_.L.kb(a.htmlcue||{});_.L.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.L.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},hV=function(a,b){return a.startTime<=b&&a.endTime>b},fV=function(a,b){if((b||a.j)&&a.C){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Hq){a.J=c;var d=iV(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,jV(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Xv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.u(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.Qg:h="clpp-text-vtt";break;case _.ug:h=lU;break;case _.Mi:h=kU}h&&!g.classList.contains(h)&&_.fr(g,h);g=EU(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
+ else{vU({fontSize:kV(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Qg;var l=e.payloadType===_.ug;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new YU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new JU(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},iV=function(a,b){var c=qU(a.f,function(e){return hV(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&hV(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
17
+ hV(a.f[c+1],b);)c++;return{start:d,end:c}},lV=function(a){jV(a);a.J=null;a.l=null;a.f=[]},jV=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(lU);b.classList.remove(kU);a=a.a;WU(a.h);a.l=[]}},kV=function(a,b){var c=EU(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Hf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Hf;d=a.getFontSizePercent();return Math.round(c*d)+_.Hf},mV=function(){},
18
+ nV=function(){};
19
+ rU.prototype.parse=function(a){a={input:a};for(var b=_.hr(_.Qd),c=[],d=b,e;null!==(e=sU(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=oV[f];h?(h=_.hr(h),(f=pV[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||qV[g.localName]&&qV[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
20
+ d=g)}}else d.appendChild(document.createTextNode(uU(e)));return b};var oV={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},pV={v:"voice",lang:"lang"},qV={rt:"ruby"},tU={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};IU.prototype.init=function(){this.j=!0};IU.prototype.A=function(){return!1};_.w(JU,IU);JU.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
21
+ JU.prototype.init=function(a){IU.prototype.init.call(this,a);if(this.h)_.fr(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.ug){var c=_.hr(_.Qd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Qg?b=(new rU).parse(b.payload):(c=_.hr(_.Qd),c.textContent=b.payload,b=c);_.fr(b,this.w);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
22
+ c.next();!d.done;d=c.next())_.fr(b,d.value);vU({writingMode:TU(this)},b);this.a.appendChild(b);_.fr(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.fr(this.a,"clpp-text-wrapper__"+d.value);_.L.R(this.f.line)&&(this.f.lineInterpretation=_.Pi,this.f.line=KU(this)?-1:0);c=TU(this);vU({writingMode:c,webkitWritingMode:c,direction:nU,textAlign:RU(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=QU(this,SU(this));d=PU(this,c,null);var e=OU(this,
23
+ c,null),f=NU(this)&&_.L.R(null)?xU(0,_.Hf):nU;vU({position:"absolute",left:d,right:f,top:e,width:KU(this)?xU(this.f.size,"%"):nU,height:MU(this)||NU(this)?xU(this.f.size,"%"):nU},this.a);d=this.f;a=KU(this)?a.height:a.width;e=LU(this);if(d.lineInterpretation===_.Pi)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.id:g-=f/2;break;case _.ge:g-=f}f=Math.round(g/100*a)}NU(this)&&(f=a-f-e);a=f;d=PU(this,c,a);e=NU(this)&&_.L.R(a)?
24
+ xU(0,_.Hf):nU;vU({left:d,right:e,top:OU(this,c,a)},this.a)}wU(this.C,b)}};JU.prototype.o=function(){return _.hr(_.Qd)};UU.prototype.append=function(a){var b=a.a;b.style.visibility=_.qe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=EU(a.a);var d=VU(this,a.f),e=LU(a),f=DU(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;HU(c,this.a,l)||GU(c,this.a)&&FU(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||GU(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
25
+ l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>h&&(g=DU(c),h=l);c=DU(f)}c=g||f}vU({top:xU(c.top-this.a.top,_.Hf),bottom:xU(this.a.a-c.a,_.Hf),left:xU(c.left-this.a.left,_.Hf),right:xU(this.a.f-c.f,_.Hf),height:xU(c.height,_.Hf),width:xU(c.width,_.Hf)},a.a)}b.style.visibility="visible";this.h.push(EU(a.a))};_.w(XU,IU);XU.prototype.init=function(){this.h=new UU(this);this.j=!0};XU.prototype.o=function(){var a=_.hr(_.Qd);_.fr(a,this.w);this.id&&(a.id=this.id);return a};XU.prototype.appendChild=function(a){WU(this.h);this.l.unshift(a);a=_.u(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(YU,XU);
26
+ YU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Ti:b=b.width/100*a.width;break a;default:throw Error(jU);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ti)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(jU);d=a.height;var e=ZU(this,d,a.height);vU(this.B,this.a);vU({left:xU(c,_.Hf),top:xU(e,_.Hf),width:xU(b,_.Hf),height:xU(d,_.Hf)},this.a);this.f.writingMode&&vU({display:"flex",
27
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&vU({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.fr(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Ti:b=b.height/100*a.height;break a;case 2:b=b.height;d=new JU(new _.Si(0,1,"Lorem ipsum",_.Mi),{},{});c=d.a;this.a.appendChild(c);d.init(EU(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(jU);
28
+ }a=ZU(this,b,a.height);vU({top:xU(a,_.Hf),height:xU(b,_.Hf)},this.a);this.h=new UU(this,!0);this.j=!0};YU.prototype.getId=function(){return this.f.id};aV.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=cV(this,a);if(bV(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
29
+ aV.prototype.destroy=function(){var a=this;return _.H(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.y(b)})};_.w(gV,_.Dv);_.r=gV.prototype;_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=pU(this.f,oU(a));this.l=null;fV(this,!1)}};_.r.Wb=function(){null==this.h||fV(this,!0)};
30
+ _.r.destroy=function(){var a=this;return _.H(function(b){if(1==b.a){if(null==a.h)return b["return"]();lV(a);a.G.stop();return _.x(b,a.h.destroy(),2)}a.h=null;a.C.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.y(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;fV(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
31
+ _.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Jb(.25),this.L.enableResizeObserver&&this.w.start(),fV(this,!0)):(this.G.stop(),this.w.stop(),lV(this)))};_.r.Ak=function(){fV(this,!0)};_.I(mU,gV);gV.prototype.setTextVisibility=gV.prototype.setTextVisibility;gV.prototype.isTextVisible=gV.prototype.isTextVisible;gV.prototype.remove=gV.prototype.remove;gV.prototype.destroy=gV.prototype.destroy;gV.prototype.append=gV.prototype.append;mV.prototype.a=function(a){return!!a.enableHtmlCue&&!_.zl()};mV.prototype.create=function(a){return new gV(a)};_.w(nV,_.Bu);nV.prototype.f=function(){_.jq(_.re,new mV)};nV.prototype.a=function(){_.hq.has(_.re)&&(_.hq["delete"](_.re),_.iq.info("Removed factory: 'html'"))};nV.prototype.id=function(){return _.ig};_.I("clpp.htmlcue.HtmlCueComponent",nV);};
32
32
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
33
33
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
34
34
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,28 +1,28 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var LT="clpp.ima.AdsManagerFactory",MT=function(a,b){return new Promise(function(c){if(a.readyState===HTMLMediaElement.HAVE_NOTHING&&0===a.networkState)c();else b.one(a,"emptied",c)})},NT=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},OT=function(){},PT=function(a){this.a=a},QT=function(a){var b=a.ge("ima");if(!b)throw Error("IMA plugin not created.");var c=b.sd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
3
- this.m=a;this.f=e;a=this.m.getConfiguration();a=_.L.kb(a.ima||{});this.I=_.L.ta({disableCustomPlayback:!1},a);this.L=c;this.N=d;this.o=b;this.J=new _.Xu;this.g=new _.J("clpp.ima");this.j=this.a=null;this.h=new _.kk;this.K=!1;this.l=new _.gi;this.P=new OT;this.w=null;this.H=this.B=this.C=!1;this.G=this.A=null;c=this.l;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Sm.bind(this));c.on(this.o,d,this.Rm.bind(this));c.on(this.m,_.he,this.Ym.bind(this))},
4
- RT=function(a){var b=a.a,c=a.l,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Im.bind(a));c.on(b,d.LOADED,a.Ck.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Zm.bind(a));c.on(b,d.STARTED,a.Fk.bind(a));c.on(b,d.LOG,a.Mm.bind(a));c.on(b,d.AD_PROGRESS,a.Dk.bind(a));c.on(b,d.AD_BUFFERING,a.Jm.bind(a));c.on(b,d.FIRST_QUARTILE,a.Ak.bind(a));c.on(b,d.MIDPOINT,a.Nm.bind(a));c.on(b,d.THIRD_QUARTILE,a.Gk.bind(a));c.on(b,d.PAUSED,a.Pm.bind(a));c.on(b,d.RESUMED,a.Qm.bind(a));c.on(b,d.CLICK,a.zk.bind(a));c.on(b,
5
- d.SKIPPED,a.Ek.bind(a));c.on(b,d.IMPRESSION,a.Bk.bind(a));c.on(b,d.COMPLETE,a.Km.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.$m.bind(a))},ST=function(a){a=a.I;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Zc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===
6
- _.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.Zc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},UT=function(a){a.w=null;TT(a,_.zc);a.m.getSurface().hide(a.L)},VT=function(a){return _.H(function(b){if(1==b.a)return _.x(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.y(b)})},WT=function(a){return _.H(function(b){return _.x(b,MT(a.f,a.l),0)})},XT=function(a){return _.H(function(b){return b["return"](new Promise(function(c){a.l.on(a.f,
7
- _.Df,function(){a.m.getState()===_.Gq&&c()})}))})},YT=function(a){_.gr(a.f,{visibility:"visible"})},TT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new NT(c,a.C,a.B)});a.m.trigger(new _.K(b,d))},ZT=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},$T=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()},bU=function(a){var b,c;return _.H(function(d){if(1==d.a)return a.N.initialize(),b=!!a.m.getConfiguration().muted,
8
- _.x(d,a.J.canPlay(b),2);if(3!=d.a)return c=d.f,c||$T(a)?$T(a)?_.x(d,VT(a),3):d.F(3):(TT(a,_.Xc),a.g.warn(_.oa),d["return"]());aU(a);_.y(d)})},cU=function(a,b){return _.H(function(c){if(1==c.a)return a.N.initialize(),_.x(c,b.play(),2);aU(a);_.y(c)})},aU=function(a){a.a.init(a.f.offsetWidth,a.f.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},dU=function(){this.a=this.h=this.f=null},eU=function(){return!window.google||!google.ima||!google.ima.AdsLoader},fU=function(){},gU=function(){this.Ca=
9
- new _.J(LT)};_.r=NT.prototype;_.r.wb=function(){return"Google IMA SDK"};_.r.xb=function(){return google.ima.VERSION};_.r.Bb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.ac=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};
10
- _.r.getDuration=function(){return this.a.getDuration()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.ec=function(){return this.f?this.f.getIsBumper():!1};_.r.yb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Re&&typeof b[d].clickThroughUrl===_.eg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.ob=function(){return this.a.getVastMediaWidth()};
11
- _.r.nb=function(){return this.a.getVastMediaHeight()};_.r.Ua=function(){return this.a.getVastMediaBitrate()};_.r.Va=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Nb=function(){return this.f?this.f.getTimeOffset():0};_.r.Ab=function(){return this.f?this.f.getAdPosition():1};_.r.pb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};
12
- _.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.dc=function(){return null};NT.prototype.getVideoElement=NT.prototype.dc;NT.prototype.getWrapperCreativeIds=NT.prototype.getWrapperCreativeIds;NT.prototype.getWrapperAdSystems=NT.prototype.getWrapperAdSystems;NT.prototype.canSeek=NT.prototype.canSeek;NT.prototype.getWrapperAdIds=NT.prototype.getWrapperAdIds;NT.prototype.getSequenceLength=NT.prototype.pb;
13
- NT.prototype.getPositionInSequence=NT.prototype.Ab;NT.prototype.getPodTimeOffset=NT.prototype.Nb;NT.prototype.getPodIndex=NT.prototype.getPodIndex;NT.prototype.getPodType=NT.prototype.Va;NT.prototype.getMediaBitrate=NT.prototype.Ua;NT.prototype.getMediaHeight=NT.prototype.nb;NT.prototype.getMediaWidth=NT.prototype.ob;NT.prototype.getMediaUrl=NT.prototype.getMediaUrl;NT.prototype.getClickThroughUrl=NT.prototype.yb;NT.prototype.isBumper=NT.prototype.ec;NT.prototype.getSkipTimeOffset=NT.prototype.getSkipTimeOffset;
14
- NT.prototype.getPosition=NT.prototype.getPosition;NT.prototype.getDuration=NT.prototype.getDuration;NT.prototype.getTitle=NT.prototype.getTitle;NT.prototype.getAdvertiserName=NT.prototype.getAdvertiserName;NT.prototype.getAdSystem=NT.prototype.getAdSystem;NT.prototype.getApiFramework=NT.prototype.getApiFramework;NT.prototype.getSourceId=NT.prototype.ac;NT.prototype.getCreativeId=NT.prototype.getCreativeId;NT.prototype.getId=NT.prototype.getId;NT.prototype.getTechnology=NT.prototype.Bb;
15
- NT.prototype.getAdManagerVersion=NT.prototype.xb;NT.prototype.getAdManagerName=NT.prototype.wb;OT.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};PT.prototype.getCuePoints=function(){return this.a};PT.prototype.Qb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};PT.prototype.Pb=function(){return 0<=this.a.indexOf(-1)};PT.prototype.hasPostroll=PT.prototype.Pb;PT.prototype.hasPreroll=PT.prototype.Qb;PT.prototype.getCuePoints=PT.prototype.getCuePoints;_.r=QT.prototype;
16
- _.r.Sm=function(a){var b=this;this.a=a.getAdsManager(this.f,ST(this));this.a.isCustomPlaybackUsed()&&!$T(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.Cc()):(this.j=new _.Vu(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.A=new PT(a),this.m.trigger(new _.K(_.Cc,{adsTimeline:this.A})),RT(this));this.h.resolve()};
17
- _.r.Rm=function(a){ZT(this,a.getError());this.h.resolve()};_.r.Zm=function(a){var b=this;return _.H(function(c){if(1==c.a)return b.H=!0,$T(b)?(b.G=b.m.getPosition(),_.x(c,VT(b),3)):_.x(c,b.m.pause(),4);if(3!=c.a)return _.gr(b.f,{visibility:_.qe}),c.F(3);TT(b,_.hc,a);b.j.start();_.y(c)})};_.r.Im=function(){var a=this;return _.H(function(b){if(1==b.a)return $T(a)?_.x(b,MT(a.f,a.l),2):b.F(2);a.a.start();_.y(b)})};
18
- _.r.Ck=function(a){a.getAd().isLinear()?TT(this,_.rc,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.m.play()))};_.r.Fk=function(a){this.w=a.getAd().getDuration();TT(this,_.yc,a);this.m.getSurface().show(this.L)};_.r.Mm=function(a){a=a.getAdData();ZT(this,a?a.adError:null);UT(this)};_.r.Dk=function(a){TT(this,_.uc,a)};_.r.Jm=function(a){TT(this,_.jc,a)};_.r.Ak=function(a){TT(this,_.mc,a)};_.r.Nm=function(a){TT(this,_.sc,a)};_.r.Gk=function(a){TT(this,_.Ac,a)};_.r.Pm=function(a){TT(this,_.tc,a)};
19
- _.r.Qm=function(a){TT(this,_.vc,a)};_.r.zk=function(a){this.pause();TT(this,_.kc,a)};_.r.Ek=function(a){TT(this,_.wc,a);UT(this)};_.r.Bk=function(a){TT(this,_.qc,a)};_.r.Km=function(a){TT(this,_.lc,a);UT(this)};
20
- _.r.$m=function(){var a=this;return _.H(function(b){switch(b.a){case 1:a.C=!0;if(!$T(a)||null===a.G){if(!a.H)return b["return"](a.m.play());YT(a);b.F(2);break}return _.x(b,WT(a),3);case 3:return _.x(b,_.Ut(a.m),4);case 4:if(a.B||!a.G){b.F(2);break}return _.x(b,XT(a),6);case 6:return _.x(b,a.m.seek(a.G),2);case 2:a.H=!1;a.j&&a.j.stop();if(a.B){b.F(8);break}return _.x(b,a.m.play(),8);case 8:TT(a,_.ic),_.y(b)}})};_.r.Ym=function(){this.B=!0;this.o.contentComplete()};
21
- _.r.load=function(){var a=this,b,c,d,e,f;return _.H(function(g){if(1==g.a){b=a.m;c=a.I;try{if(typeof c.adTagUrl!==_.eg)throw new _.N(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.h.resolve(),g["return"](a.h)}return c.adTagUrl?_.x(g,a.J.canPlay(!1),2):(a.h.resolve(),g["return"](a.h))}if(3!=g.a)return d=g.f,_.x(g,a.J.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.getSettings().setAutoPlayAdBreaks(!1);a.o.requestAds(f);
22
- return g["return"](a.h)})};_.r.start=function(a){var b=this;return _.H(function(c){return b.a&&b.A&&!b.K?b.A.Qb()?_.x(c,bU(b),0):_.x(c,cU(b,a),0):_.x(c,a.play(),0)})};_.r.jd=function(){};_.r.fd=function(){return!0};_.r.resume=function(){this.a&&this.a.resume()};_.r.pause=function(){this.a&&this.a.pause()};_.r.skip=function(){this.a&&this.a.skip()};_.r.getVolume=function(){return this.a?this.a.getVolume():1};_.r.setVolume=function(a){this.a&&this.a.setVolume(a)};
23
- _.r.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};_.r.Cc=function(){this.a&&(this.a.destroy(),this.a=null);YT(this);this.l.release();this.j&&(this.j.stop(),this.j=null);return Promise.resolve()};QT.prototype.getPosition=QT.prototype.getPosition;QT.prototype.setVolume=QT.prototype.setVolume;QT.prototype.getVolume=QT.prototype.getVolume;QT.prototype.skip=QT.prototype.skip;QT.prototype.pause=QT.prototype.pause;QT.prototype.resume=QT.prototype.resume;_.w(dU,_.bw);_.r=dU.prototype;_.r.onPlayerCreated=function(a){if(eU())return a.onError(new _.N(1,9,1E4));this.f=_.er(_.Qd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.xa);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
- _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.Il=function(){return this.a};_.r.Gl=function(){return this.h};_.r.sd=function(){return this.f};_.r.id=function(){return"ima"};_.I("clpp.ima.ImaPlugin",dU);dU.prototype.getAdContainer=dU.prototype.sd;dU.prototype.getAdDisplayContainer=dU.prototype.Gl;dU.prototype.getAdsLoader=dU.prototype.Il;dU.Id="ima";
25
- dU.isSdkMissing=eU;fU.prototype.create=function(){return new dU};_.Yt(new fU);gU.prototype.name=function(){return LT};gU.prototype.a=function(a,b){return a.namespace()===_.sd?!1:eU()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};gU.prototype.create=function(a){return new QT(a)};_.$q(new gU);};
2
+ var f=function(window){var OT="clpp.ima.AdsManagerFactory",PT=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},QT=function(){},RT=function(a){this.a=a},ST=function(a){var b=a.he("ima");if(!b)throw Error("IMA plugin not created.");var c=b.td(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");this.m=a;this.l=e;a=this.m.getConfiguration();a=_.L.kb(a.ima||{});this.I=_.L.ta({disableCustomPlayback:!1},a);this.L=
3
+ c;this.N=d;this.j=b;this.J=new _.Xu;this.g=new _.J("clpp.ima");this.h=this.a=null;this.f=new _.kk;this.K=!1;this.C=new _.gi;this.P=new QT;this.o=null;this.H=this.A=this.B=!1;this.G=this.w=null;c=this.C;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Xm.bind(this));c.on(this.j,d,this.Wm.bind(this));c.on(this.m,_.he,this.cn.bind(this))},TT=function(a){var b=a.a,c=a.C,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Nm.bind(a));c.on(b,
4
+ d.LOADED,a.Ek.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.dn.bind(a));c.on(b,d.STARTED,a.Hk.bind(a));c.on(b,d.LOG,a.Rm.bind(a));c.on(b,d.AD_PROGRESS,a.Fk.bind(a));c.on(b,d.AD_BUFFERING,a.Om.bind(a));c.on(b,d.FIRST_QUARTILE,a.Ck.bind(a));c.on(b,d.MIDPOINT,a.Sm.bind(a));c.on(b,d.THIRD_QUARTILE,a.Ik.bind(a));c.on(b,d.PAUSED,a.Um.bind(a));c.on(b,d.RESUMED,a.Vm.bind(a));c.on(b,d.CLICK,a.Bk.bind(a));c.on(b,d.SKIPPED,a.Gk.bind(a));c.on(b,d.IMPRESSION,a.Dk.bind(a));c.on(b,d.COMPLETE,a.Pm.bind(a));c.on(b,
5
+ d.CONTENT_RESUME_REQUESTED,a.en.bind(a))},UT=function(a){a=a.I;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Zc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
6
+ _.Zc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},WT=function(a){a.o=null;VT(a,_.zc);a.m.getSurface().hide(a.L)},XT=function(a){return _.H(function(b){if(1==b.a)return _.x(b,a.m.detach(),2);var c=a.m;c.a&&c.a.stopForwardingEventsTo(c);_.y(b)})},YT=function(a){return _.H(function(b){return b["return"](new Promise(function(c){a.C.on(a.m,_.bg,function(){a.m.getState()===_.Gq&&c()})}))})},ZT=function(a){_.gr(a.l,{visibility:"visible"})},
7
+ VT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new PT(c,a.B,a.A)});a.m.trigger(new _.K(b,d))},$T=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},aU=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.qk()||_.rk()},cU=function(a){var b,c;return _.H(function(d){if(1==d.a)return a.N.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.J.canPlay(b),2);if(3!=d.a)return c=d.f,c||aU(a)?aU(a)?_.x(d,XT(a),3):d.D(3):
8
+ (VT(a,_.Xc),a.g.warn(_.oa),d["return"]());bU(a);_.y(d)})},dU=function(a,b){return _.H(function(c){if(1==c.a)return a.N.initialize(),_.x(c,b.play(),2);bU(a);_.y(c)})},bU=function(a){a.a.init(a.l.offsetWidth,a.l.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},eU=function(){this.a=this.h=this.f=null},fU=function(){return!window.google||!google.ima||!google.ima.AdsLoader},gU=function(){},hU=function(){this.Ca=new _.J(OT)};_.r=PT.prototype;_.r.xb=function(){return"Google IMA SDK"};
9
+ _.r.yb=function(){return google.ima.VERSION};_.r.Cb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.bc=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};_.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};_.r.getDuration=function(){return this.a.getDuration()};
10
+ _.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.fc=function(){return this.f?this.f.getIsBumper():!1};_.r.zb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Re&&typeof b[d].clickThroughUrl===_.eg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.ob=function(){return this.a.getVastMediaWidth()};_.r.nb=function(){return this.a.getVastMediaHeight()};
11
+ _.r.Ua=function(){return this.a.getVastMediaBitrate()};_.r.Va=function(){return this.h?2:this.j?1:0};_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.Ob=function(){return this.f?this.f.getTimeOffset():0};_.r.Bb=function(){return this.f?this.f.getAdPosition():1};_.r.pb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};
12
+ _.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.ec=function(){return null};PT.prototype.getVideoElement=PT.prototype.ec;PT.prototype.getWrapperCreativeIds=PT.prototype.getWrapperCreativeIds;PT.prototype.getWrapperAdSystems=PT.prototype.getWrapperAdSystems;PT.prototype.canSeek=PT.prototype.canSeek;PT.prototype.getWrapperAdIds=PT.prototype.getWrapperAdIds;PT.prototype.getSequenceLength=PT.prototype.pb;PT.prototype.getPositionInSequence=PT.prototype.Bb;
13
+ PT.prototype.getPodTimeOffset=PT.prototype.Ob;PT.prototype.getPodIndex=PT.prototype.getPodIndex;PT.prototype.getPodType=PT.prototype.Va;PT.prototype.getMediaBitrate=PT.prototype.Ua;PT.prototype.getMediaHeight=PT.prototype.nb;PT.prototype.getMediaWidth=PT.prototype.ob;PT.prototype.getMediaUrl=PT.prototype.getMediaUrl;PT.prototype.getClickThroughUrl=PT.prototype.zb;PT.prototype.isBumper=PT.prototype.fc;PT.prototype.getSkipTimeOffset=PT.prototype.getSkipTimeOffset;PT.prototype.getPosition=PT.prototype.getPosition;
14
+ PT.prototype.getDuration=PT.prototype.getDuration;PT.prototype.getTitle=PT.prototype.getTitle;PT.prototype.getAdvertiserName=PT.prototype.getAdvertiserName;PT.prototype.getAdSystem=PT.prototype.getAdSystem;PT.prototype.getApiFramework=PT.prototype.getApiFramework;PT.prototype.getSourceId=PT.prototype.bc;PT.prototype.getCreativeId=PT.prototype.getCreativeId;PT.prototype.getId=PT.prototype.getId;PT.prototype.getTechnology=PT.prototype.Cb;PT.prototype.getAdManagerVersion=PT.prototype.yb;
15
+ PT.prototype.getAdManagerName=PT.prototype.xb;QT.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};RT.prototype.getCuePoints=function(){return this.a};RT.prototype.Rb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};RT.prototype.Qb=function(){return 0<=this.a.indexOf(-1)};RT.prototype.hasPostroll=RT.prototype.Qb;RT.prototype.hasPreroll=RT.prototype.Rb;RT.prototype.getCuePoints=RT.prototype.getCuePoints;_.r=ST.prototype;
16
+ _.r.Xm=function(a){var b=this;this.a=a.getAdsManager(this.l,UT(this));this.a.isCustomPlaybackUsed()&&!aU(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.Dc()):(this.h=new _.Vu(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.w=new RT(a),this.m.trigger(new _.K(_.Cc,{adsTimeline:this.w})),TT(this));this.f.resolve()};
17
+ _.r.Wm=function(a){$T(this,a.getError());this.f.resolve()};_.r.dn=function(a){var b=this;return _.H(function(c){if(1==c.a)return b.H=!0,aU(b)?(b.G=b.m.getPosition(),_.x(c,XT(b),3)):_.x(c,b.m.pause(),4);if(3!=c.a)return _.gr(b.l,{visibility:_.qe}),c.D(3);VT(b,_.hc,a);b.h.start();_.y(c)})};_.r.Nm=function(){var a=this;return _.H(function(b){a.a.start();_.y(b)})};_.r.Ek=function(a){a.getAd().isLinear()?VT(this,_.rc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};
18
+ _.r.Hk=function(a){this.o=a.getAd().getDuration();VT(this,_.xc,a);this.m.getSurface().show(this.L)};_.r.Rm=function(a){a=a.getAdData();$T(this,a?a.adError:null);WT(this)};_.r.Fk=function(a){VT(this,_.uc,a)};_.r.Om=function(a){VT(this,_.jc,a)};_.r.Ck=function(a){VT(this,_.mc,a)};_.r.Sm=function(a){VT(this,_.sc,a)};_.r.Ik=function(a){VT(this,_.Ac,a)};_.r.Um=function(a){VT(this,_.tc,a)};_.r.Vm=function(a){VT(this,_.vc,a)};_.r.Bk=function(a){this.pause();VT(this,_.kc,a)};
19
+ _.r.Gk=function(a){VT(this,_.wc,a);WT(this)};_.r.Dk=function(a){VT(this,_.qc,a)};_.r.Pm=function(a){VT(this,_.lc,a);WT(this)};
20
+ _.r.en=function(){var a=this;return _.H(function(b){switch(b.a){case 1:a.B=!0;if(!aU(a)||null===a.G){if(!a.H)return b["return"](a.m.play());ZT(a);b.D(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.x(b,_.Ut(a.m),3);case 3:if(a.A||!a.G){b.D(2);break}return _.x(b,YT(a),5);case 5:return _.x(b,a.m.seek(a.G),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.A){b.D(7);break}return _.x(b,a.m.play(),7);case 7:VT(a,_.ic),_.y(b)}})};_.r.cn=function(){this.A=!0;this.j.contentComplete()};
21
+ _.r.load=function(){var a=this,b,c,d,e,f;return _.H(function(g){if(1==g.a){b=a.m;c=a.I;try{if(typeof c.adTagUrl!==_.eg)throw new _.N(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.J.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(f);
22
+ return g["return"](a.f)})};_.r.start=function(a){var b=this;return _.H(function(c){return b.a&&b.w&&!b.K?b.w.Rb()?_.x(c,cU(b),0):_.x(c,dU(b,a),0):_.x(c,a.play(),0)})};_.r.kd=function(){};_.r.gd=function(){return!0};_.r.resume=function(){this.a&&this.a.resume()};_.r.pause=function(){this.a&&this.a.pause()};_.r.skip=function(){this.a&&this.a.skip()};_.r.getVolume=function(){return this.a?this.a.getVolume():1};_.r.setVolume=function(a){this.a&&this.a.setVolume(a)};
23
+ _.r.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.r.Dc=function(){this.a&&(this.a.destroy(),this.a=null);ZT(this);this.C.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};ST.prototype.getPosition=ST.prototype.getPosition;ST.prototype.setVolume=ST.prototype.setVolume;ST.prototype.getVolume=ST.prototype.getVolume;ST.prototype.skip=ST.prototype.skip;ST.prototype.pause=ST.prototype.pause;ST.prototype.resume=ST.prototype.resume;_.w(eU,_.bw);_.r=eU.prototype;_.r.onPlayerCreated=function(a){if(fU())return a.onError(new _.N(1,9,1E4));this.f=_.er(_.Qd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.xa);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
+ _.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.Nl=function(){return this.a};_.r.Ll=function(){return this.h};_.r.td=function(){return this.f};_.r.id=function(){return"ima"};_.I("clpp.ima.ImaPlugin",eU);eU.prototype.getAdContainer=eU.prototype.td;eU.prototype.getAdDisplayContainer=eU.prototype.Ll;eU.prototype.getAdsLoader=eU.prototype.Nl;eU.Id="ima";
25
+ eU.isSdkMissing=fU;gU.prototype.create=function(){return new eU};_.Yt(new gU);hU.prototype.name=function(){return OT};hU.prototype.a=function(a,b){return a.namespace()===_.sd?!1:fU()?(this.Ca.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};hU.prototype.create=function(a){return new ST(a)};_.$q(new hU);};
26
26
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
27
27
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
28
28
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var IT=function(){this.g=new _.J("clpp.mediatailor.MediaTailorPlugin")},JT=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={Yi:_.Qk(f,b),yp:g?_.Qk(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+h.Yi);return l["return"](h)})},KT=function(){};_.w(IT,_.bw);
3
- IT.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,JT(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.K("mt-session-started")),b.url=e.Yi,_.uh(g,0);f=_.D(g);c.g.error("Failed to start session",f);throw new _.N(_.O,9,7003,"Media Tailor session failed to initialize.");})};IT.prototype.id=function(){return"mediatailor"};
4
- KT.prototype.create=function(){return new IT};_.Yt(new KT);};
2
+ 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);
3
+ 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"};
4
+ NT.prototype.create=function(){return new LT};_.Yt(new NT);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}