@castlabs/prestoplay 6.9.0 → 6.10.0

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 (59) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +105 -104
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +420 -417
  8. package/cjs/cl.crypto.js +10 -9
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +11 -12
  11. package/cjs/cl.freewheel.js +21 -21
  12. package/cjs/cl.hls.js +72 -71
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -31
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +273 -272
  17. package/cjs/cl.muxdata.js +14 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -71
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +68 -68
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +16 -16
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +87 -87
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +363 -359
  36. package/cl.crypto.js +9 -9
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +11 -12
  39. package/cl.freewheel.js +17 -17
  40. package/cl.hls.js +61 -61
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +26 -25
  43. package/cl.ima.js +17 -17
  44. package/cl.mse.js +235 -236
  45. package/cl.muxdata.js +12 -12
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +59 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +14 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +13 -13
  58. package/package.json +1 -1
  59. package/typings.d.ts +47 -2
package/cjs/cl.htmlcue.js CHANGED
@@ -1,35 +1,33 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var eK="CLPP Subtitle Styles",fK="Unsupported unit",gK="clpp-text-plain",hK="clpp-text-ttml",iK="clpp.htmlcue.HtmlTextDisplayer",jK="initial",kK=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},lK=function(){},mK=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},oK=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],
3
- function(c){return nK[c]});return a},qK=function(a,b){pK(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){pK(a,c)})},pK=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},rK=function(a,b){return 0===a?"0":a+b},sK=function(a,b){return 1>Math.abs(a-b)||a<b},tK=function(a,b){return a<b&&1<Math.abs(a-b)},uK=function(a,b){return a>b&&1<Math.abs(a-b)},vK=function(a,b){return 1>Math.abs(a-b)||a>b},wK=function(a,b,c,d,e,f){this.f=a;this.g=b;this.j=c;this.a=d;this.height=e;this.width=
4
- f},xK=function(a){return new wK(a.f,a.g,a.j,a.a,a.height,a.width)},yK=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"))||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 wK(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
5
- d-e)},zK=function(a,b){return b.some(function(c){return tK(a.f,c.g)&&uK(a.g,c.f)&&tK(a.j,c.a)&&uK(a.a,c.j)})},AK=function(a,b){return vK(a.j,b.j)&&sK(a.a,b.a)&&vK(a.f,b.f)&&sK(a.g,b.g)},BK=function(a,b,c){switch(c){case "+x":return tK(a.f,b.f);case "-x":return uK(a.g,b.g);case "+y":return tK(a.j,b.j);case "-y":return uK(a.a,b.a);default:throw Error("Unknown axis");}},CK=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},DK=function(a,b,c){CK.call(this,a.id,"clpp-text-cue",{});
6
- this.m=b;this.f=a;this.g=!!this.f.backgroundImage;this.D=c},FK=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 EK(a)?b:c},IK=function(a,b,c){return EK(a)&&_.K.la(c)?rK(c,_.be):(GK(a)||HK(a))&&_.K.la(b)?rK(b,"%"):jK},GK=function(a){return a.f.writingMode===_.Ne},HK=function(a){return a.f.writingMode===_.Oe},EK=function(a){return a.f.writingMode===_.ug},JK=function(a,b,c){return(GK(a)||HK(a))&&_.K.la(c)?rK(c,_.be):
7
- GK(a)&&_.K.R(c)?rK(0,_.be):EK(a)&&_.K.la(b)?rK(b,"%"):jK},KK=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.sd:return a.f.position;case "auto":case _.Bc:return a.f.position-a.f.size/2;case _.td:return a.f.position-a.f.size}return 0},LK=function(a){switch(a.f.positionAlign){case _.sd:return _.pd;case "auto":case _.Bc:return _.tg;case _.td:return _.ie}return a.f.textAlign},MK=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.pd:case _.pd:return _.sd;
8
- case _.tg:return _.Bc;case _.ie:case _.ie:return _.td}return a.f.positionAlign},NK=function(a){switch(a.f.writingMode){case _.ug:return"horizontal-tb";case _.Ne:return _.Ne;case _.Oe:return _.Oe;default:throw Error("Unknown writing mode");}},OK=function(a,b){this.m=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=yK(a.a);this.g=[]},PK=function(a,b){if(a.j)switch(b.writingMode){case _.ug:return["-y"];case _.Ne:return["+x"];case _.Oe:return["-x"]}var c=[];switch(b.writingMode){case _.ug:c=["+y","-y"];break;
9
- case _.Ne:c=["+x","-x"];break;case _.Oe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},QK=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=yK(a.m.a)},RK=function(a,b,c){CK.call(this,a,b,c);this.g=null;this.m=[]},SK=function(a,b){QK(a.g);a.m.unshift(b);for(var c=_.u(a.m),d=c.next();!d.done;d=c.next())a.g.append(d.value)},TK=function(a,b){RK.call(this,a.id,"clpp-text-cue-region",b);this.f=a},UK=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.zg)return a.viewportAnchorY/
10
- 100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(fK);},WK=function(a){this.h=new _.I("clpp.htmlcue.StyleManager");this.m=[];this.g=a.getSurface().getUniqueCssClass();this.j=[];this.a=VK(this,this.g);this.f=VK(this,this.g,!0);this.f.disabled=!0;this.h.debug("Stylesheet CLPP Subtitle Styles has been created.")},XK=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===
11
- e.trim().indexOf("."+a.g+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},YK=function(a,b){var c="."+a.g+" .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,c)},VK=function(a,b,c){var d=document.createElement(_.ve),e=d.dataset;e.name=eK;
12
- e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);ZK(a,b);a.h.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},ZK=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===eK&&a.h.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});c.observe(b,{subtree:!1,childList:!0});a.m.push(function(){return c.disconnect()})},
13
- bL=function(a){_.Qp.call(this,a);var b=this;this.h=new _.I(iK);this.l=a;this.M=$K(a);this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.g=new WK(a);this.a=new RK(null,"clpp-text-container",{});this.w=new _.mp(a.getSurface(),this.ei.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.h.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.F=new _.Wi(function(){aL(b)});
14
- this.A=new Map;this.m=null},$K=function(a){a=_.K.Ra(a.getConfiguration().htmlcue||{});_.K.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.K.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},cL=function(a,b){return a.startTime<=b&&a.endTime>b},aL=function(a,b){if((b||a.j)&&a.D){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.Xm){a.J=c;var d=dL(a,c);(c=b)||(c=a.m,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.m=d,eL(a),d)){c={color:a.getFontColor()||
15
- void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Vp(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 _.We:h="clpp-text-vtt";break;case _.Fe:h=hK;break;case _.sg:h=gK}h&&!g.classList.contains(h)&&_.un(g,h);g=yK(f.a.a);if(0===g.width||0===g.height)f.h.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{pK({fontSize:fL(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.We;var l=e.payloadType===_.Fe;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new TK(e.region,{}),f.A.set(e.region.id,g),SK(f.a,g)));e=new DK(e,f.M,c);g?SK(g,e):SK(f.a,e)}}}}}},dL=function(a,b){var c=kK(a.f,function(e){return cL(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&cL(a.f[d-1],b);)d--;for(;c+1<a.f.length&&cL(a.f[c+1],b);)c++;return{start:d,
17
- end:c}},gL=function(a){eL(a);a.J=null;a.m=null;a.f=[]},eL=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(hK);b.classList.remove(gK);a=a.a;QK(a.g);a.m=[]}},fL=function(a,b){var c=yK(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.be}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.be;d=a.getFontSizePercent();return Math.round(c*d)+_.be},hL=function(){},iL=function(){};
18
- lK.prototype.parse=function(a){a={input:a};for(var b=_.wn(_.Xc),c=[],d=b,e;null!==(e=mK(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=jL[f];h?(h=_.wn(h),(f=kL[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||lL[g.localName]&&lL[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
19
- d=g)}}else d.appendChild(document.createTextNode(oK(e)));return b};var jL={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},kL={v:"voice",lang:"lang"},lL={rt:"ruby"},nK={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};CK.prototype.init=function(){this.j=!0};CK.prototype.A=function(){return!1};_.w(DK,CK);DK.prototype.A=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
20
- DK.prototype.init=function(a){CK.prototype.init.call(this,a);if(this.g)_.un(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.m.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Fe){var c=_.wn(_.Xc);c.innerHTML=b.payload;b=c}else b.payloadType===_.We?b=(new lK).parse(b.payload):(c=_.wn(_.Xc),c.textContent=b.payload,b=c);_.un(b,this.w);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
21
- c.next();!d.done;d=c.next())_.un(b,d.value);pK({writingMode:NK(this)},b);this.a.appendChild(b);_.un(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.un(this.a,"clpp-text-wrapper__"+d.value);_.K.R(this.f.line)&&(this.f.lineInterpretation=_.vg,this.f.line=EK(this)?-1:0);c=NK(this);pK({writingMode:c,webkitWritingMode:c,direction:jK,textAlign:LK(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=KK(this,MK(this));d=JK(this,c,null);var e=IK(this,
22
- c,null),f=HK(this)&&_.K.R(null)?rK(0,_.be):jK;pK({position:"absolute",left:d,right:f,top:e,width:EK(this)?rK(this.f.size,"%"):jK,height:GK(this)||HK(this)?rK(this.f.size,"%"):jK},this.a);d=this.f;a=EK(this)?a.height:a.width;e=FK(this);if(d.lineInterpretation===_.vg)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 _.Bc:g-=f/2;break;case _.ed:g-=f}f=Math.round(g/100*a)}HK(this)&&(f=a-f-e);a=f;d=JK(this,c,a);e=HK(this)&&_.K.R(a)?
23
- rK(0,_.be):jK;pK({left:d,right:e,top:IK(this,c,a)},this.a)}qK(this.D,b)}};DK.prototype.o=function(){return _.wn(_.Xc)};OK.prototype.append=function(a){var b=a.a;b.style.visibility=_.ld;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=yK(a.a);var d=PK(this,a.f),e=FK(a),f=xK(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;BK(c,this.a,l)||AK(c,this.a)&&zK(c,this.g);){var m=c,n=e;switch(l){case "+x":m.f+=n;m.g+=n;break;case "-x":m.f-=n;m.g-=n;break;case "+y":m.j+=n;m.a+=n;break;case "-y":m.j-=n,m.a-=n}}if(this.j||AK(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
24
- l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.j,l.j))/(c.height*c.width);l>h&&(g=xK(c),h=l);c=xK(f)}c=g||f}pK({top:rK(c.j-this.a.j,_.be),bottom:rK(this.a.a-c.a,_.be),left:rK(c.f-this.a.f,_.be),right:rK(this.a.g-c.g,_.be),height:rK(c.height,_.be),width:rK(c.width,_.be)},a.a)}b.style.visibility="visible";this.g.push(yK(a.a))};_.w(RK,CK);RK.prototype.init=function(){this.g=new OK(this);this.j=!0};RK.prototype.o=function(){var a=_.wn(_.Xc);_.un(a,this.w);this.id&&(a.id=this.id);return a};_.w(TK,RK);
25
- TK.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.zg:b=b.width/100*a.width;break a;default:throw Error(fK);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.zg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(fK);d=a.height;var e=UK(this,d,a.height);pK(this.B,this.a);pK({left:rK(c,_.be),top:rK(e,_.be),width:rK(b,_.be),height:rK(d,_.be)},this.a);this.f.writingMode&&pK({display:"flex",
26
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&pK({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.un(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.zg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new DK(new _.yg(0,1,"Lorem ipsum",_.sg),{},{});c=d.a;this.a.appendChild(c);d.init(yK(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(fK);
27
- }a=UK(this,b,a.height);pK({top:rK(a,_.be),height:rK(b,_.be)},this.a);this.g=new OK(this,!0);this.j=!0};TK.prototype.getId=function(){return this.f.id};WK.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=YK(this,a);if(XK(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.h.debug("Added CSS rule "+b)}catch(c){this.h.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.h.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
- WK.prototype.destroy=function(){var a=this;return _.B(function(b){if(null==a.a)return b["return"]();a.m.forEach(function(c){return c()});a.m=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.h.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.y(b)})};_.w(bL,_.Qp);_.t=bL.prototype;
29
- _.t.append=function(a,b){if(null!=this.g&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.g.appendRule(d.value);a.sort(function(f,g){return f.startTime!==g.startTime?f.startTime-g.startTime:f.endTime-g.endTime});c=this.f.findIndex(function(f){return f.startTime>=a[0].startTime});0===c?this.f=[]:0<c&&this.f.splice(0,c);c={};d=_.u(a);for(var e=d.next();!e.done;c={yd:c.yd},e=d.next())c.yd=e.value,this.f.some(function(f){return function(g){var h=f.yd;return g.payload!==h.payload?!1:
30
- g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.yd);this.m=null;aL(this,!1)}};_.t.sb=function(){null==this.g||aL(this,!0)};_.t.destroy=function(){var a=this;return _.B(function(b){if(1==b.a){if(null==a.g)return b["return"]();gL(a);a.F.stop();return _.x(b,a.g.destroy(),2)}a.g=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.y(b)})};
31
- _.t.remove=function(a,b){if(null==this.g)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.m=null;aL(this,!0);return!0};_.t.isTextVisible=function(){return this.j};_.t.setTextVisibility=function(a){null!=this.g&&this.j!==a&&((this.j=a)?(this.F.fb(.25),this.M.enableResizeObserver&&this.w.start(),aL(this,!0)):(this.F.stop(),this.w.stop(),gL(this)))};_.t.ei=function(){aL(this,!0)};_.C(iK,bL);bL.prototype.setTextVisibility=bL.prototype.setTextVisibility;
32
- bL.prototype.isTextVisible=bL.prototype.isTextVisible;bL.prototype.remove=bL.prototype.remove;bL.prototype.destroy=bL.prototype.destroy;bL.prototype.append=bL.prototype.append;hL.prototype.ba=function(a){return!!a.enableHtmlCue&&!_.ej()};hL.prototype.create=function(a){return new bL(a)};_.w(iL,_.wo);iL.prototype.Oa=function(){_.rm("html",new hL)};iL.prototype.Ha=function(){};iL.prototype.id=function(){return _.xe};_.C("clpp.htmlcue.HtmlCueComponent",iL);};
2
+ var f=function(window){var oK="CLPP Subtitle Styles",pK="Unsupported unit",qK="clpp-text-plain",rK="clpp-text-ttml",sK="clpp.htmlcue.HtmlTextDisplayer",tK="initial",uK=function(a){return _.xg(a,{Zf:function(b,c){return b.pa(c)}})},vK=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)},wK=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},xK=function(){},yK=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},AK=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return zK[c]});return a},CK=function(a,b){BK(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){BK(a,c)})},BK=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},DK=function(a,b){return 0===a?"0":a+b},EK=function(a,b){return 1>Math.abs(a-b)||a<b},FK=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},GK=function(a,b){return a>b&&1<Math.abs(a-b)},HK=function(a,b){return 1>Math.abs(a-b)||a>b},IK=function(a,b,c,d,e,f){this.f=a;this.g=b;this.j=c;this.a=d;this.height=e;this.width=f},JK=function(a){return new IK(a.f,a.g,a.j,a.a,a.height,a.width)},KK=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 IK(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},LK=function(a,b){return b.some(function(c){return FK(a.f,c.g)&&GK(a.g,c.f)&&FK(a.j,c.a)&&GK(a.a,c.j)})},MK=function(a,b){return HK(a.j,b.j)&&EK(a.a,b.a)&&HK(a.f,b.f)&&EK(a.g,b.g)},NK=function(a,b,c){switch(c){case "+x":return FK(a.f,b.f);case "-x":return GK(a.g,b.g);case "+y":return FK(a.j,b.j);
6
+ case "-y":return GK(a.a,b.a);default:throw Error("Unknown axis");}},OK=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},PK=function(a,b,c){OK.call(this,a.id,"clpp-text-cue",{});this.m=b;this.f=a;this.g=!!this.f.backgroundImage;this.D=c},RK=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 QK(a)?b:c},UK=function(a,b,c){return QK(a)&&_.K.la(c)?DK(c,_.de):(SK(a)||TK(a))&&_.K.la(b)?DK(b,"%"):tK},SK=
7
+ function(a){return a.f.writingMode===_.Pe},TK=function(a){return a.f.writingMode===_.Qe},QK=function(a){return a.f.writingMode===_.Ag},VK=function(a,b,c){return(SK(a)||TK(a))&&_.K.la(c)?DK(c,_.de):SK(a)&&_.K.R(c)?DK(0,_.de):QK(a)&&_.K.la(b)?DK(b,"%"):tK},WK=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ud:return a.f.position;case "auto":case _.Dc:return a.f.position-a.f.size/2;case _.vd:return a.f.position-a.f.size}return 0},XK=function(a){switch(a.f.positionAlign){case _.ud:return _.rd;
8
+ case "auto":case _.Dc:return _.zg;case _.vd:return _.ke}return a.f.textAlign},YK=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.rd:case _.rd:return _.ud;case _.zg:return _.Dc;case _.ke:case _.ke:return _.vd}return a.f.positionAlign},ZK=function(a){switch(a.f.writingMode){case _.Ag:return"horizontal-tb";case _.Pe:return _.Pe;case _.Qe:return _.Qe;default:throw Error("Unknown writing mode");}},$K=function(a,b){this.m=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=KK(a.a);this.g=[]},aL=function(a,
9
+ b){if(a.j)switch(b.writingMode){case _.Ag:return["-y"];case _.Pe:return["+x"];case _.Qe:return["-x"]}var c=[];switch(b.writingMode){case _.Ag:c=["+y","-y"];break;case _.Pe:c=["+x","-x"];break;case _.Qe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},bL=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=KK(a.m.a)},cL=function(a,b,c){OK.call(this,a,b,c);this.g=null;this.m=[]},dL=function(a,b){bL(a.g);a.m.unshift(b);for(var c=_.u(a.m),d=c.next();!d.done;d=c.next())a.g.append(d.value)},
10
+ eL=function(a,b){cL.call(this,a.id,"clpp-text-cue-region",b);this.f=a},fL=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Fg)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(pK);},hL=function(a){this.h=new _.I("clpp.htmlcue.StyleManager");this.m=[];this.g=a.getSurface().getUniqueCssClass();this.j=[];this.a=gL(this,this.g);this.f=gL(this,this.g,!0);this.f.disabled=!0;this.h.debug("Stylesheet CLPP Subtitle Styles has been created.")},
11
+ iL=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.g+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},jL=function(a,b){var c="."+a.g+" .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,
12
+ c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},gL=function(a,b,c){var d=document.createElement(_.xe),e=d.dataset;e.name=oK;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);kL(a,b);a.h.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},kL=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===oK&&a.h.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.m.push(function(){return c.disconnect()})},nL=function(a){_.Vp.call(this,a);var b=this;this.h=new _.I(sK);this.l=a;this.M=lL(a);this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.g=new hL(a);this.a=new cL(null,"clpp-text-container",{});this.w=new _.rp(a.getSurface(),this.hi.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.h.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
+ this.F=new _.$i(function(){mL(b)});this.A=new Map;this.m=null},lL=function(a){a=_.K.Ua(a.getConfiguration().htmlcue||{});_.K.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.K.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},oL=function(a,b){return a.startTime<=b&&a.endTime>b},mL=function(a,b){if((b||a.j)&&a.D){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.bn){a.J=c;var d=pL(a,c);(c=b)||(c=a.m,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));
15
+ if(c&&(a.m=d,qL(a),d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.$p(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 _.Ye:h="clpp-text-vtt";break;case _.He:h=rK;break;case _.yg:h=qK}h&&!g.classList.contains(h)&&_.zn(g,h);g=KK(f.a.a);if(0===g.width||0===g.height)f.h.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{BK({fontSize:rL(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Ye;var l=e.payloadType===_.He;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new eL(e.region,{}),f.A.set(e.region.id,g),dL(f.a,g)));e=new PK(e,f.M,c);g?dL(g,e):dL(f.a,e)}}}}}},pL=function(a,b){var c=wK(a.f,function(e){return oL(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&oL(a.f[d-1],b);)d--;for(;c+1<a.f.length&&oL(a.f[c+1],b);)c++;return{start:d,
17
+ end:c}},sL=function(a){qL(a);a.J=null;a.m=null;a.f=[]},qL=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(rK);b.classList.remove(qK);a=a.a;bL(a.g);a.m=[]}},rL=function(a,b){var c=KK(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.de}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.de;d=a.getFontSizePercent();return Math.round(c*d)+_.de},tL=function(){},uL=function(){};
18
+ xK.prototype.parse=function(a){a={input:a};for(var b=_.Bn(_.Zc),c=[],d=b,e;null!==(e=yK(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=vL[f];h?(h=_.Bn(h),(f=wL[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||xL[g.localName]&&xL[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
19
+ d=g)}}else d.appendChild(document.createTextNode(AK(e)));return b};var vL={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},wL={v:"voice",lang:"lang"},xL={rt:"ruby"},zK={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};OK.prototype.init=function(){this.j=!0};OK.prototype.A=function(){return!1};_.w(PK,OK);PK.prototype.A=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
20
+ PK.prototype.init=function(a){OK.prototype.init.call(this,a);if(this.g)_.zn(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.m.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.He){var c=_.Bn(_.Zc);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ye?b=(new xK).parse(b.payload):(c=_.Bn(_.Zc),c.textContent=b.payload,b=c);_.zn(b,this.w);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
21
+ c.next();!d.done;d=c.next())_.zn(b,d.value);BK({writingMode:ZK(this)},b);this.a.appendChild(b);_.zn(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.zn(this.a,"clpp-text-wrapper__"+d.value);_.K.R(this.f.line)&&(this.f.lineInterpretation=_.Bg,this.f.line=QK(this)?-1:0);c=ZK(this);BK({writingMode:c,webkitWritingMode:c,direction:tK,textAlign:XK(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=WK(this,YK(this));d=VK(this,c,null);var e=UK(this,
22
+ c,null),f=TK(this)&&_.K.R(null)?DK(0,_.de):tK;BK({position:"absolute",left:d,right:f,top:e,width:QK(this)?DK(this.f.size,"%"):tK,height:SK(this)||TK(this)?DK(this.f.size,"%"):tK},this.a);d=this.f;a=QK(this)?a.height:a.width;e=RK(this);if(d.lineInterpretation===_.Bg)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 _.Dc:g-=f/2;break;case _.gd:g-=f}f=Math.round(g/100*a)}TK(this)&&(f=a-f-e);a=f;d=VK(this,c,a);e=TK(this)&&_.K.R(a)?
23
+ DK(0,_.de):tK;BK({left:d,right:e,top:UK(this,c,a)},this.a)}CK(this.D,b)}};PK.prototype.o=function(){return _.Bn(_.Zc)};$K.prototype.append=function(a){var b=a.a;b.style.visibility=_.nd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=KK(a.a);var d=aL(this,a.f),e=RK(a),f=JK(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;NK(c,this.a,l)||MK(c,this.a)&&LK(c,this.g);){var m=c,n=e;switch(l){case "+x":m.f+=n;m.g+=n;break;case "-x":m.f-=n;m.g-=n;break;case "+y":m.j+=n;m.a+=n;break;case "-y":m.j-=n,m.a-=n}}if(this.j||MK(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
24
+ l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.j,l.j))/(c.height*c.width);l>h&&(g=JK(c),h=l);c=JK(f)}c=g||f}BK({top:DK(c.j-this.a.j,_.de),bottom:DK(this.a.a-c.a,_.de),left:DK(c.f-this.a.f,_.de),right:DK(this.a.g-c.g,_.de),height:DK(c.height,_.de),width:DK(c.width,_.de)},a.a)}b.style.visibility="visible";this.g.push(KK(a.a))};_.w(cL,OK);cL.prototype.init=function(){this.g=new $K(this);this.j=!0};cL.prototype.o=function(){var a=_.Bn(_.Zc);_.zn(a,this.w);this.id&&(a.id=this.id);return a};_.w(eL,cL);
25
+ eL.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Fg:b=b.width/100*a.width;break a;default:throw Error(pK);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Fg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(pK);d=a.height;var e=fL(this,d,a.height);BK(this.B,this.a);BK({left:DK(c,_.de),top:DK(e,_.de),width:DK(b,_.de),height:DK(d,_.de)},this.a);this.f.writingMode&&BK({display:"flex",
26
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&BK({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.zn(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Fg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new PK(new _.Eg(0,1,"Lorem ipsum",_.yg),{},{});c=d.a;this.a.appendChild(c);d.init(KK(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(pK);
27
+ }a=fL(this,b,a.height);BK({top:DK(a,_.de),height:DK(b,_.de)},this.a);this.g=new $K(this,!0);this.j=!0};eL.prototype.getId=function(){return this.f.id};hL.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=jL(this,a);if(iL(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.h.debug("Added CSS rule "+b)}catch(c){this.h.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.h.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
+ hL.prototype.destroy=function(){var a=this;return _.B(function(b){if(null==a.a)return b["return"]();a.m.forEach(function(c){return c()});a.m=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.h.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.y(b)})};_.w(nL,_.Vp);_.t=nL.prototype;_.t.append=function(a,b){if(null!=this.g&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.g.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=vK(this.f,uK(a));this.m=null;mL(this,!1)}};_.t.sb=function(){null==this.g||mL(this,!0)};
29
+ _.t.destroy=function(){var a=this;return _.B(function(b){if(1==b.a){if(null==a.g)return b["return"]();sL(a);a.F.stop();return _.x(b,a.g.destroy(),2)}a.g=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.y(b)})};_.t.remove=function(a,b){if(null==this.g)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.m=null;mL(this,!0);return!0};_.t.isTextVisible=function(){return this.j};
30
+ _.t.setTextVisibility=function(a){null!=this.g&&this.j!==a&&((this.j=a)?(this.F.fb(.25),this.M.enableResizeObserver&&this.w.start(),mL(this,!0)):(this.F.stop(),this.w.stop(),sL(this)))};_.t.hi=function(){mL(this,!0)};_.C(sK,nL);nL.prototype.setTextVisibility=nL.prototype.setTextVisibility;nL.prototype.isTextVisible=nL.prototype.isTextVisible;nL.prototype.remove=nL.prototype.remove;nL.prototype.destroy=nL.prototype.destroy;nL.prototype.append=nL.prototype.append;tL.prototype.ba=function(a){return!!a.enableHtmlCue&&!_.kj()};tL.prototype.create=function(a){return new nL(a)};_.w(uL,_.Bo);uL.prototype.Qa=function(){_.wm("html",new tL)};uL.prototype.Ha=function(){};uL.prototype.id=function(){return _.ze};_.C("clpp.htmlcue.HtmlCueComponent",uL);};
33
31
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
34
32
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
35
33
  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 MJ="clpp.ima.AdsManagerFactory",NJ=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c},OJ=function(){},PJ=function(a){this.a=a},QJ=function(a){this.l=a;this.A=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.K.Ra(a.ima||{});this.J=_.K.va({disableCustomPlayback:!1},a);this.o=this.l.dc("ima").Lc();this.T=this.l.dc("ima").g;this.m=this.l.dc("ima").a;this.M=new _.op;this.h=new _.I("clpp.ima");this.g=this.a=null;this.f=new _.bi;this.I=!1;this.w=new _.dg;this.V=new OJ;this.B=
3
- null;this.N=this.H=this.D=this.F=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.dk.bind(this));a.on(this.m,b,this.ck.bind(this));a.on(this.l,_.gd,this.kk.bind(this))},RJ=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Tj.bind(a));c.on(b,d.LOADED,a.ii.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.lk.bind(a));c.on(b,d.STARTED,a.ki.bind(a));c.on(b,d.LOG,a.Xj.bind(a));c.on(b,
4
- d.AD_PROGRESS,a.ak.bind(a));c.on(b,d.AD_BUFFERING,a.Uj.bind(a));c.on(b,d.FIRST_QUARTILE,a.gi.bind(a));c.on(b,d.MIDPOINT,a.Yj.bind(a));c.on(b,d.THIRD_QUARTILE,a.li.bind(a));c.on(b,d.PAUSED,a.$j.bind(a));c.on(b,d.RESUMED,a.bk.bind(a));c.on(b,d.CLICK,a.fi.bind(a));c.on(b,d.SKIPPED,a.ji.bind(a));c.on(b,d.IMPRESSION,a.hi.bind(a));c.on(b,d.COMPLETE,a.Vj.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.mk.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.fk.bind(a))},SJ=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
5
- b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.sc?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===_.sc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
- [];return b},UJ=function(a){a.B=null;TJ(a,_.Tb);a.o&&a.l.getSurface().hide(a.o)},VJ=function(a){_.vn(a.A,{visibility:"visible"})},TJ=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new NJ(c,a.F,a.D)});a.l.trigger(new _.J(b,d))},WJ=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},XJ=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.ii()},ZJ=function(a){var b,c;return _.B(function(d){if(1==d.a)return a.T.initialize(),
7
- b=!!a.l.getConfiguration().muted,_.x(d,a.M.canPlay(b),2);c=d.f;if(!c&&!XJ(a))return TJ(a,_.qc),a.h.warn(_.ja),d["return"]();YJ(a);_.y(d)})},$J=function(a,b){return _.B(function(c){if(1==c.a)return a.T.initialize(),_.x(c,b.play(),2);YJ(a);_.y(c)})},YJ=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.I=!0},aK=function(){this.a=this.g=this.f=null},bK=function(){return!window.google||!google.ima||!google.ima.AdsLoader},cK=function(){},dK=function(){this.a=new _.I(MJ)};
8
- _.t=NJ.prototype;_.t.vb=function(){return"Google IMA SDK"};_.t.wb=function(){return google.ima.VERSION};_.t.Bb=function(){return 0};_.t.getId=function(){return this.a.getAdId()};_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};
9
- _.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.ic=function(){return this.f?this.f.getIsBumper():!1};_.t.Nb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Jd&&typeof b[d].clickThroughUrl===_.te});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.yb=function(){return this.a.getVastMediaWidth()};_.t.xb=function(){return this.a.getVastMediaHeight()};_.t.kb=function(){return this.a.getVastMediaBitrate()};
2
+ var f=function(window){var WJ="clpp.ima.AdsManagerFactory",XJ=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c},YJ=function(){},ZJ=function(a){this.a=a},$J=function(a){this.l=a;this.A=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.K.Ua(a.ima||{});this.J=_.K.wa({disableCustomPlayback:!1},a);this.o=this.l.dc("ima").Lc();this.T=this.l.dc("ima").g;this.m=this.l.dc("ima").a;this.M=new _.tp;this.h=new _.I("clpp.ima");this.g=this.a=null;this.f=new _.fi;this.I=!1;this.w=new _.eg;this.V=new YJ;this.B=
3
+ null;this.N=this.H=this.D=this.F=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.gk.bind(this));a.on(this.m,b,this.fk.bind(this));a.on(this.l,_.id,this.nk.bind(this))},aK=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Wj.bind(a));c.on(b,d.LOADED,a.li.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.pk.bind(a));c.on(b,d.STARTED,a.ni.bind(a));c.on(b,d.LOG,a.$j.bind(a));c.on(b,
4
+ d.AD_PROGRESS,a.dk.bind(a));c.on(b,d.AD_BUFFERING,a.Xj.bind(a));c.on(b,d.FIRST_QUARTILE,a.ji.bind(a));c.on(b,d.MIDPOINT,a.ak.bind(a));c.on(b,d.THIRD_QUARTILE,a.oi.bind(a));c.on(b,d.PAUSED,a.ck.bind(a));c.on(b,d.RESUMED,a.ek.bind(a));c.on(b,d.CLICK,a.ii.bind(a));c.on(b,d.SKIPPED,a.mi.bind(a));c.on(b,d.IMPRESSION,a.ki.bind(a));c.on(b,d.COMPLETE,a.Yj.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.qk.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.ik.bind(a))},bK=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
5
+ b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.uc?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===_.uc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
+ [];return b},dK=function(a){a.B=null;cK(a,_.Wb);a.o&&a.l.getSurface().hide(a.o)},eK=function(a){_.An(a.A,{visibility:"visible"})},cK=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new XJ(c,a.F,a.D)});a.l.trigger(new _.J(b,d))},fK=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},gK=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.mi()},iK=function(a){var b,c;return _.B(function(d){if(1==d.a)return a.T.initialize(),
7
+ b=!!a.l.getConfiguration().muted,_.x(d,a.M.canPlay(b),2);c=d.f;if(!c&&!gK(a))return cK(a,_.sc),a.h.warn(_.ja),d["return"]();hK(a);_.y(d)})},jK=function(a,b){return _.B(function(c){if(1==c.a)return a.T.initialize(),_.x(c,b.play(),2);hK(a);_.y(c)})},hK=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.I=!0},kK=function(){this.a=this.g=this.f=null},lK=function(){return!window.google||!google.ima||!google.ima.AdsLoader},mK=function(){},nK=function(){this.a=new _.I(WJ)};
8
+ _.t=XJ.prototype;_.t.vb=function(){return"Google IMA SDK"};_.t.wb=function(){return google.ima.VERSION};_.t.Bb=function(){return 0};_.t.getId=function(){return this.a.getAdId()};_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};
9
+ _.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.ic=function(){return this.f?this.f.getIsBumper():!1};_.t.Nb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ld&&typeof b[d].clickThroughUrl===_.ve});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.yb=function(){return this.a.getVastMediaWidth()};_.t.xb=function(){return this.a.getVastMediaHeight()};_.t.kb=function(){return this.a.getVastMediaBitrate()};
10
10
  _.t.$a=function(){return this.g?2:this.j?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.t.Ob=function(){return this.f?this.f.getTimeOffset():0};_.t.Pb=function(){return this.f?this.f.getAdPosition():1};_.t.Ab=function(){return this.f?this.f.getTotalAds():1};_.t.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.t.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.t.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};
11
- NJ.prototype.getWrapperCreativeIds=NJ.prototype.getWrapperCreativeIds;NJ.prototype.getWrapperAdSystems=NJ.prototype.getWrapperAdSystems;NJ.prototype.getWrapperAdIds=NJ.prototype.getWrapperAdIds;NJ.prototype.getSequenceLength=NJ.prototype.Ab;NJ.prototype.getPositionInSequence=NJ.prototype.Pb;NJ.prototype.getPodTimeOffset=NJ.prototype.Ob;NJ.prototype.getPodIndex=NJ.prototype.getPodIndex;NJ.prototype.getPodType=NJ.prototype.$a;NJ.prototype.getMediaBitrate=NJ.prototype.kb;
12
- NJ.prototype.getMediaHeight=NJ.prototype.xb;NJ.prototype.getMediaWidth=NJ.prototype.yb;NJ.prototype.getMediaUrl=NJ.prototype.getMediaUrl;NJ.prototype.getClickThroughUrl=NJ.prototype.Nb;NJ.prototype.isBumper=NJ.prototype.ic;NJ.prototype.getSkipTimeOffset=NJ.prototype.getSkipTimeOffset;NJ.prototype.getDuration=NJ.prototype.getDuration;NJ.prototype.getTitle=NJ.prototype.getTitle;NJ.prototype.getAdvertiserName=NJ.prototype.getAdvertiserName;NJ.prototype.getAdSystem=NJ.prototype.getAdSystem;
13
- NJ.prototype.getApiFramework=NJ.prototype.getApiFramework;NJ.prototype.getCreativeId=NJ.prototype.getCreativeId;NJ.prototype.getId=NJ.prototype.getId;NJ.prototype.getTechnology=NJ.prototype.Bb;NJ.prototype.getAdManagerVersion=NJ.prototype.wb;NJ.prototype.getAdManagerName=NJ.prototype.vb;OJ.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}};PJ.prototype.getCuePoints=function(){return this.a};PJ.prototype.Qb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};PJ.prototype.lb=function(){return 0<=this.a.indexOf(-1)};PJ.prototype.hasPostroll=PJ.prototype.lb;PJ.prototype.hasPreroll=PJ.prototype.Qb;PJ.prototype.getCuePoints=PJ.prototype.getCuePoints;_.t=QJ.prototype;
14
- _.t.dk=function(a){var b=this;this.a=a.getAdsManager(this.A,SJ(this));this.a.isCustomPlaybackUsed()&&!XJ(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.L(1,9,10002)),this.dispose()):(this.g=new _.mp(this.l.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new PJ(a),this.l.trigger(new _.J(_.Wb,{adsTimeline:this.j})),RJ(this));this.f.resolve()};
15
- _.t.ck=function(a){WJ(this,a.getError());this.f.resolve()};_.t.lk=function(a){var b=this;return _.B(function(c){if(1==c.a)return b.H=!0,XJ(b)?c.G(2):_.x(c,b.l.pause(),3);2!=c.a&&_.vn(b.A,{visibility:_.ld});TJ(b,_.Fb,a);b.g.start();_.y(c)})};_.t.Tj=function(){var a=this;return _.B(function(b){if(1==b.a){if(!XJ(a))return b.G(2);a.K=a.l.getPosition();return _.x(b,a.l.detach(),3)}if(2!=b.a){var c=a.l;c.a&&c.a.removeDelegate(c)}a.a.start();_.y(b)})};
16
- _.t.ii=function(a){a.getAd().isLinear()?TJ(this,_.Mb,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.l.play()))};_.t.ki=function(a){this.B=a.getAd().getDuration();TJ(this,_.Sb,a);this.l.getSurface().show(this.o)};_.t.Xj=function(a){a=a.getAdData();WJ(this,a?a.adError:null);UJ(this)};_.t.ak=function(a){TJ(this,_.Pb,a)};_.t.Uj=function(a){TJ(this,_.Hb,a)};_.t.gi=function(a){TJ(this,_.Kb,a)};_.t.Yj=function(a){TJ(this,_.Nb,a)};_.t.li=function(a){TJ(this,_.Ub,a)};_.t.$j=function(a){TJ(this,_.Ob,a)};
17
- _.t.bk=function(a){TJ(this,_.Qb,a)};_.t.fi=function(a){this.pause();TJ(this,_.Ib,a)};_.t.ji=function(a){TJ(this,_.Rb,a);UJ(this)};_.t.hi=function(a){TJ(this,_.Lb,a)};_.t.Vj=function(a){TJ(this,_.Jb,a);UJ(this)};
18
- _.t.mk=function(){var a=this;return _.B(function(b){switch(b.a){case 1:a.F=!0;if(!XJ(a)||null===a.K){if(!a.H)return b["return"](a.l.play());VJ(a);b.G(2);break}var c=a.l;c.a&&c.a.addDelegate(c);return _.x(b,_.no(a.l),3);case 3:if(a.D){b.G(2);break}return _.x(b,a.l.seek(a.K),2);case 2:a.H=!1;a.g&&a.g.stop();if(a.D){b.G(6);break}return _.x(b,a.l.play(),6);case 6:TJ(a,_.Gb),_.y(b)}})};_.t.fk=function(){this.N=!0};_.t.kk=function(){this.D=!0;this.m.contentComplete()};
19
- _.t.load=function(){var a=this,b,c,d,e,f;return _.B(function(g){if(1==g.a){b=a.l;c=a.J;try{if(typeof c.adTagUrl!==_.te)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.M.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.M.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.m.getSettings().setAutoPlayAdBreaks(!1);a.m.requestAds(f);
20
- return g["return"](a.f)})};_.t.start=function(a){var b=this;return _.B(function(c){return b.a&&b.j&&!b.I?b.j.Qb()?_.x(c,ZJ(b),0):_.x(c,$J(b,a),0):_.x(c,a.play(),0)})};_.t.resume=function(){this.a&&this.a.resume()};_.t.pause=function(){this.a&&this.a.pause()};_.t.skip=function(){this.a&&this.a.skip()};_.t.getVolume=function(){return this.a?this.a.getVolume():1};_.t.setVolume=function(a){this.a&&this.a.setVolume(a)};
11
+ XJ.prototype.getWrapperCreativeIds=XJ.prototype.getWrapperCreativeIds;XJ.prototype.getWrapperAdSystems=XJ.prototype.getWrapperAdSystems;XJ.prototype.getWrapperAdIds=XJ.prototype.getWrapperAdIds;XJ.prototype.getSequenceLength=XJ.prototype.Ab;XJ.prototype.getPositionInSequence=XJ.prototype.Pb;XJ.prototype.getPodTimeOffset=XJ.prototype.Ob;XJ.prototype.getPodIndex=XJ.prototype.getPodIndex;XJ.prototype.getPodType=XJ.prototype.$a;XJ.prototype.getMediaBitrate=XJ.prototype.kb;
12
+ XJ.prototype.getMediaHeight=XJ.prototype.xb;XJ.prototype.getMediaWidth=XJ.prototype.yb;XJ.prototype.getMediaUrl=XJ.prototype.getMediaUrl;XJ.prototype.getClickThroughUrl=XJ.prototype.Nb;XJ.prototype.isBumper=XJ.prototype.ic;XJ.prototype.getSkipTimeOffset=XJ.prototype.getSkipTimeOffset;XJ.prototype.getDuration=XJ.prototype.getDuration;XJ.prototype.getTitle=XJ.prototype.getTitle;XJ.prototype.getAdvertiserName=XJ.prototype.getAdvertiserName;XJ.prototype.getAdSystem=XJ.prototype.getAdSystem;
13
+ XJ.prototype.getApiFramework=XJ.prototype.getApiFramework;XJ.prototype.getCreativeId=XJ.prototype.getCreativeId;XJ.prototype.getId=XJ.prototype.getId;XJ.prototype.getTechnology=XJ.prototype.Bb;XJ.prototype.getAdManagerVersion=XJ.prototype.wb;XJ.prototype.getAdManagerName=XJ.prototype.vb;YJ.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}};ZJ.prototype.getCuePoints=function(){return this.a};ZJ.prototype.Qb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};ZJ.prototype.lb=function(){return 0<=this.a.indexOf(-1)};ZJ.prototype.hasPostroll=ZJ.prototype.lb;ZJ.prototype.hasPreroll=ZJ.prototype.Qb;ZJ.prototype.getCuePoints=ZJ.prototype.getCuePoints;_.t=$J.prototype;
14
+ _.t.gk=function(a){var b=this;this.a=a.getAdsManager(this.A,bK(this));this.a.isCustomPlaybackUsed()&&!gK(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.L(1,9,10002)),this.dispose()):(this.g=new _.rp(this.l.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new ZJ(a),this.l.trigger(new _.J(_.Zb,{adsTimeline:this.j})),aK(this));this.f.resolve()};
15
+ _.t.fk=function(a){fK(this,a.getError());this.f.resolve()};_.t.pk=function(a){var b=this;return _.B(function(c){if(1==c.a)return b.H=!0,gK(b)?c.G(2):_.x(c,b.l.pause(),3);2!=c.a&&_.An(b.A,{visibility:_.nd});cK(b,_.Fb,a);b.g.start();_.y(c)})};_.t.Wj=function(){var a=this;return _.B(function(b){if(1==b.a){if(!gK(a))return b.G(2);a.K=a.l.getPosition();return _.x(b,a.l.detach(),3)}if(2!=b.a){var c=a.l;c.a&&c.a.removeDelegate(c)}a.a.start();_.y(b)})};
16
+ _.t.li=function(a){a.getAd().isLinear()?cK(this,_.Ob,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.l.play()))};_.t.ni=function(a){this.B=a.getAd().getDuration();cK(this,_.Vb,a);this.l.getSurface().show(this.o)};_.t.$j=function(a){a=a.getAdData();fK(this,a?a.adError:null);dK(this)};_.t.dk=function(a){cK(this,_.Sb,a)};_.t.Xj=function(a){cK(this,_.Ib,a)};_.t.ji=function(a){cK(this,_.Lb,a)};_.t.ak=function(a){cK(this,_.Pb,a)};_.t.oi=function(a){cK(this,_.Xb,a)};_.t.ck=function(a){cK(this,_.Qb,a)};
17
+ _.t.ek=function(a){cK(this,_.Tb,a)};_.t.ii=function(a){this.pause();cK(this,_.Jb,a)};_.t.mi=function(a){cK(this,_.Ub,a);dK(this)};_.t.ki=function(a){cK(this,_.Nb,a)};_.t.Yj=function(a){cK(this,_.Kb,a);dK(this)};
18
+ _.t.qk=function(){var a=this;return _.B(function(b){switch(b.a){case 1:a.F=!0;if(!gK(a)||null===a.K){if(!a.H)return b["return"](a.l.play());eK(a);b.G(2);break}var c=a.l;c.a&&c.a.addDelegate(c);return _.x(b,_.so(a.l),3);case 3:if(a.D){b.G(2);break}return _.x(b,a.l.seek(a.K),2);case 2:a.H=!1;a.g&&a.g.stop();if(a.D){b.G(6);break}return _.x(b,a.l.play(),6);case 6:cK(a,_.Hb),_.y(b)}})};_.t.ik=function(){this.N=!0};_.t.nk=function(){this.D=!0;this.m.contentComplete()};
19
+ _.t.load=function(){var a=this,b,c,d,e,f;return _.B(function(g){if(1==g.a){b=a.l;c=a.J;try{if(typeof c.adTagUrl!==_.ve)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.M.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.M.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.m.getSettings().setAutoPlayAdBreaks(!1);a.m.requestAds(f);
20
+ return g["return"](a.f)})};_.t.start=function(a){var b=this;return _.B(function(c){return b.a&&b.j&&!b.I?b.j.Qb()?_.x(c,iK(b),0):_.x(c,jK(b,a),0):_.x(c,a.play(),0)})};_.t.resume=function(){this.a&&this.a.resume()};_.t.pause=function(){this.a&&this.a.pause()};_.t.skip=function(){this.a&&this.a.skip()};_.t.getVolume=function(){return this.a?this.a.getVolume():1};_.t.setVolume=function(a){this.a&&this.a.setVolume(a)};
21
21
  _.t.getPosition=function(){if(!this.a||null===this.B)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.B-a};
22
- _.t.dispose=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.lb()&&!a.N?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.l.getSurface().hide(a.o)}),_.eg(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.m.contentComplete()})).then(function(){VJ(a);a.w.release();a.g&&(a.g.stop(),a.g=null);a.a&&(a.a.destroy(),a.a=null)})};QJ.prototype.getPosition=QJ.prototype.getPosition;
23
- QJ.prototype.setVolume=QJ.prototype.setVolume;QJ.prototype.getVolume=QJ.prototype.getVolume;QJ.prototype.skip=QJ.prototype.skip;QJ.prototype.pause=QJ.prototype.pause;QJ.prototype.resume=QJ.prototype.resume;_.w(aK,_.$p);_.t=aK.prototype;_.t.onPlayerCreated=function(a){if(bK())return a.onError(new _.L(1,9,1E4));this.f=_.tn(_.Xc,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.oa);this.a.getSettings().setPlayerVersion(_.ea);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
- _.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.hj=function(){return this.a};_.t.fj=function(){return this.g};_.t.Lc=function(){return this.f};_.t.id=function(){return"ima"};_.C("clpp.ima.ImaPlugin",aK);aK.prototype.getAdContainer=aK.prototype.Lc;aK.prototype.getAdDisplayContainer=aK.prototype.fj;aK.prototype.getAdsLoader=aK.prototype.hj;aK.Id="ima";
25
- aK.isSdkMissing=bK;cK.prototype.create=function(){return new aK};_.qo(new cK);dK.prototype.name=function(){return MJ};dK.prototype.ba=function(a,b){return a.namespace()===_.Hc?!1:bK()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};dK.prototype.create=function(a){return new QJ(a)};dK.prototype.create=dK.prototype.create;dK.prototype.isSupported=dK.prototype.ba;dK.prototype.name=dK.prototype.name;_.qn(new dK);};
22
+ _.t.dispose=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.lb()&&!a.N?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.l.getSurface().hide(a.o)}),_.fg(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.m.contentComplete()})).then(function(){eK(a);a.w.release();a.g&&(a.g.stop(),a.g=null);a.a&&(a.a.destroy(),a.a=null)})};$J.prototype.getPosition=$J.prototype.getPosition;
23
+ $J.prototype.setVolume=$J.prototype.setVolume;$J.prototype.getVolume=$J.prototype.getVolume;$J.prototype.skip=$J.prototype.skip;$J.prototype.pause=$J.prototype.pause;$J.prototype.resume=$J.prototype.resume;_.w(kK,_.eq);_.t=kK.prototype;_.t.onPlayerCreated=function(a){if(lK())return a.onError(new _.L(1,9,1E4));this.f=_.yn(_.Zc,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.qa);this.a.getSettings().setPlayerVersion(_.ea);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
+ _.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.kj=function(){return this.a};_.t.ij=function(){return this.g};_.t.Lc=function(){return this.f};_.t.id=function(){return"ima"};_.C("clpp.ima.ImaPlugin",kK);kK.prototype.getAdContainer=kK.prototype.Lc;kK.prototype.getAdDisplayContainer=kK.prototype.ij;kK.prototype.getAdsLoader=kK.prototype.kj;kK.Id="ima";
25
+ kK.isSdkMissing=lK;mK.prototype.create=function(){return new kK};_.vo(new mK);nK.prototype.name=function(){return WJ};nK.prototype.ba=function(a,b){return a.namespace()===_.Jc?!1:lK()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};nK.prototype.create=function(a){return new $J(a)};nK.prototype.create=nK.prototype.create;nK.prototype.isSupported=nK.prototype.ba;nK.prototype.name=nK.prototype.name;_.vn(new nK);};
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));}