@castlabs/prestoplay 6.3.0 → 6.4.1

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 (58) hide show
  1. package/CHANGELOG.md +70 -1
  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 +108 -107
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +426 -398
  8. package/cjs/cl.crypto.js +10 -10
  9. package/cjs/cl.dash.js +72 -69
  10. package/cjs/cl.externs.js +79 -155
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +47 -44
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -32
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +259 -254
  17. package/cjs/cl.muxdata.js +12 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +69 -69
  22. package/cjs/cl.thumbnails.js +24 -23
  23. package/cjs/cl.tizen.js +70 -70
  24. package/cjs/cl.ttml.js +27 -26
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +18 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -19
  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 +88 -87
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +365 -348
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -63
  38. package/cl.externs.js +74 -154
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +39 -37
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +233 -222
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +10 -10
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -21
  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 +16 -15
  58. package/package.json +4 -2
package/cjs/cl.htmlcue.js CHANGED
@@ -1,36 +1,35 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var xH="Stylesheet ",yH="Unsupported unit",zH="clpp-text-plain",AH="clpp-text-ttml",BH="clpp.htmlcue.HtmlTextDisplayer",CH="initial",DH=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},EH=function(){},FH=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},HH=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return GH[c]});
3
- return a},IH=function(a,b){for(var c in a)b.style[c]=a[c]},JH=function(a,b){return 0===a?"0":a+b},KH=function(a,b){return 1>Math.abs(a-b)||a<b},LH=function(a,b){return a<b&&1<Math.abs(a-b)},MH=function(a,b){return a>b&&1<Math.abs(a-b)},NH=function(a,b){return 1>Math.abs(a-b)||a>b},OH=function(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=f},PH=function(a){return new OH(a.f,a.g,a.h,a.a,a.height,a.width)},QH=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,
4
- 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 OH(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},RH=function(a,b){return b.some(function(c){return LH(a.f,c.g)&&MH(a.g,c.f)&&LH(a.h,c.a)&&MH(a.a,c.h)})},SH=function(a,
5
- b){return NH(a.h,b.h)&&KH(a.a,b.a)&&NH(a.f,b.f)&&KH(a.g,b.g)},TH=function(a,b,c){switch(c){case "+x":return LH(a.f,b.f);case "-x":return MH(a.g,b.g);case "+y":return LH(a.h,b.h);case "-y":return MH(a.a,b.a);default:throw Error("Unknown axis");}},UH=function(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1},VH=function(a,b,c){UH.call(this,a.id,"clpp-text-cue",c);this.j=b;this.f=a;this.g=!!this.f.backgroundImage},XH=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();
6
- b=c.height/d.length;c=c.width/d.length;return WH(a)?b:c},$H=function(a,b,c){return WH(a)&&_.J.la(c)?JH(c,_.Ud):(YH(a)||ZH(a))&&_.J.la(b)?JH(b,"%"):CH},YH=function(a){return a.f.writingMode===_.Ge},ZH=function(a){return a.f.writingMode===_.He},WH=function(a){return a.f.writingMode===_.og},aI=function(a,b,c){return(YH(a)||ZH(a))&&_.J.la(c)?JH(c,_.Ud):YH(a)&&_.J.R(c)?JH(0,_.Ud):WH(a)&&_.J.la(b)?JH(b,"%"):CH},bI=function(a,b){if(typeof a.f.position===_.h&&typeof a.f.size===_.h)switch(b){case _.jd:return a.f.position;
7
- case "auto":case _.sc:return a.f.position-a.f.size/2;case _.kd:return a.f.position-a.f.size}return 0},cI=function(a){switch(a.f.positionAlign){case _.jd:return _.gd;case "auto":case _.sc:return _.ng;case _.kd:return _.ae}return a.f.textAlign},dI=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.gd:case _.gd:return _.jd;case _.ng:return _.sc;case _.ae:case _.ae:return _.kd}return a.f.positionAlign},eI=function(a){switch(a.f.writingMode){case _.og:return"horizontal-tb";case _.Ge:return _.Ge;
8
- case _.He:return _.He;default:throw Error("Unknown writing mode");}},fI=function(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=QH(a.a);this.g=[]},gI=function(a,b){if(a.h)switch(b.writingMode){case _.og:return["-y"];case _.Ge:return["+x"];case _.He:return["-x"]}var c=[];switch(b.writingMode){case _.og:c=["+y","-y"];break;case _.Ge:c=["+x","-x"];break;case _.He:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},hI=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);
9
- a.a=QH(a.j.a)},iI=function(a,b,c){UH.call(this,a,b,c);this.g=null;this.j=[]},jI=function(a,b){hI(a.g);a.j.unshift(b);for(var c=_.u(a.j),d=c.next();!d.done;d=c.next())a.g.append(d.value)},kI=function(a,b){iI.call(this,a.id,"clpp-text-cue-region",b);this.f=a},lI=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.tg)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(yH);},oI=function(a,b){this.f=new _.G("clpp.htmlcue.StyleManager");
10
- this.w=[];this.m=a.getSurface().getContainer();this.j="clpp-video-"+mI++;this.h=b;this.o=[];this.a=nI(this,this.h);this.g=nI(this,this.h+"-sandbox");this.g.disabled=!0;this.m&&_.Lm(this.m,this.j);this.f.debug(xH+this.h+" has been created.")},pI=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.o=[]}},qI=function(a,b){var c=!1;try{a.g.insertRule(b,0);var d=a.g.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+
11
- a.j+" ")}))}catch(e){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},rI=function(a,b){var c="."+a.j+" .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)},nI=function(a,b){var c=document.createElement(_.oe);c.title=b;var d=document.head;d.appendChild(c);
12
- sI(a,d,b);a.f.debug('Created HTML style element style[title\x3d"'+b+'"]');return c.sheet},sI=function(a,b,c){var d=new MutationObserver(function(e){e.forEach(function(f){f.removedNodes.forEach(function(g){g.title===c&&a.f.error('PRESTOplay HTML style element style[title\x3d"'+c+'"] has been unexpectedly removed! Some styles will not work!')})})});d.observe(b,{subtree:!1,childList:!0});a.w.push(function(){return d.disconnect()})},vI=function(a){_.hp.call(this,a);var b=this;this.N=new _.G(BH);this.l=
13
- a;this.L=tI(a);this.h=!1;this.f=[];this.w=a.getSurface().getContainer();this.g=new oI(a,"CLPP Subtitle Styles");this.j=new oI(a,"CLPP Custom Subtitle Styles");this.a=new iI(null,"clpp-text-container",{});this.o=new _.Do(a.getSurface(),this.$g.bind(this));this.J=null;this.w?(this.w.appendChild(this.a.a),this.a.init(null)):this.N.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.D=new _.qh(function(){uI(b)});
14
- this.A=new Map;this.m=null},tI=function(a){a=_.J.Ha(a.getConfiguration().htmlcue||{});_.J.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.J.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},wI=function(a,b){return a.startTime<=b&&a.endTime>b},uI=function(a,b){if((b||a.h)&&a.w){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.km){a.J=c;c=xI(a,c);var d;(d=b)||(d=a.m,d=!(null===d&&null===c||null!==d&&null!==c&&d.start===c.start&&d.end===c.end));if(d&&(a.m=c,yI(a),a.j&&(d="::cue {",
15
- a.getFontColor()&&(d+="color: "+a.getFontColor()+";"),a.getBackgroundColor()&&(d+="background-color: "+a.getBackgroundColor()+";"),a.getFontFamily()&&(d+="font-family: "+a.getFontFamily()+";"),a.getEdgeType()!==_.gp&&(d+="text-shadow: "+_.mp(a)+";"),d+="}",pI(a.j),a.j.appendRule(d)),null!==c)){c=a.f.slice(c.start,c.end+1);c=_.u(c);for(var e=c.next();!e.done;e=c.next()){d=a;e=e.value;var f=d.a.a,g=null;switch(e.payloadType){case _.Pe:g="clpp-text-vtt";break;case _.ye:g=AH;break;case _.mg:g=zH}g&&!f.classList.contains(g)&&
16
- _.Lm(f,g);f=QH(d.a.a);if(0===f.width||0===f.height)d.N.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.");else{IH({fontSize:zI(d,e.containerRows)},d.a.a);f=null;g=e.payloadType===_.Pe;var k=e.payloadType===_.ye;e.region&&(g||k||e.backgroundImage)&&(d.A.has(e.region.id)?f=d.A.get(e.region.id):(f=new kI(e.region,{}),d.A.set(e.region.id,f),jI(d.a,f)));e=new VH(e,d.L,{});f?jI(f,e):jI(d.a,
17
- e)}}}}}},xI=function(a,b){var c=DH(a.f,function(e){return wI(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&wI(a.f[d-1],b);)d--;for(;c+1<a.f.length&&wI(a.f[c+1],b);)c++;return{start:d,end:c}},AI=function(a){yI(a);a.J=null;a.m=null;a.f=[]},yI=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(AH);b.classList.remove(zH);a=a.a;hI(a.g);a.j=[]}},zI=function(a,b){var c=QH(a.a.a).height;if(null!==a.I)return a.getFontSize();
18
- if(null!==a.C){var d=a.getFontSizePercent();return Math.round(c*d)+_.Ud}if(typeof b===_.h&&0<b)return Math.round(c/b)+_.Ud;d=a.getFontSizePercent();return Math.round(c*d)+_.Ud},BI=function(){},CI=function(){};
19
- EH.prototype.parse=function(a){a={input:a};for(var b=_.Nm(_.Oc),c=[],d=b,e;null!==(e=FH(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 k=DI[f];k?(k=_.Nm(k),(f=EI[f])&&g&&k.setAttribute(f,g.trim()),g=k):g=null;!g||FI[g.localName]&&FI[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(HH(e)));return b};var DI={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},EI={v:"voice",lang:"lang"},FI={rt:"ruby"},GH={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};UH.prototype.init=function(){this.h=!0};UH.prototype.w=function(){return!1};_.v(VH,UH);VH.prototype.w=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
21
- VH.prototype.init=function(a){UH.prototype.init.call(this,a);if(this.g)_.Lm(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else{var b=this.f;if(b.payloadType===_.ye){var c=_.Nm(_.Oc);c.innerHTML=b.payload;b=c}else b.payloadType===_.Pe?b=(new EH).parse(b.payload):(c=_.Nm(_.Oc),c.textContent=b.payload,b=c);_.Lm(b,this.o);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=c.next();!d.done;d=
22
- c.next())_.Lm(b,d.value);IH({writingMode:eI(this)},b);this.a.appendChild(b);_.Lm(this.a,"clpp-text-wrapper");b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Lm(this.a,"clpp-text-wrapper__"+c.value);_.J.R(this.f.line)&&(this.f.lineInterpretation=_.pg,this.f.line=WH(this)?-1:0);b=eI(this);IH({writingMode:b,webkitWritingMode:b,direction:CH,textAlign:cI(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){b=bI(this,dI(this));c=aI(this,b,null);d=$H(this,b,null);var e=ZH(this)&&
23
- _.J.R(null)?JH(0,_.Ud):CH;IH({position:"absolute",left:c,right:e,top:d,width:WH(this)?JH(this.f.size,"%"):CH,height:YH(this)||ZH(this)?JH(this.f.size,"%"):CH},this.a);c=this.f;a=WH(this)?a.height:a.width;d=XH(this);if(c.lineInterpretation===_.pg)e=d*Math.round(c.line),Math.abs(e)>a&&(e=d*(0>c.line?0:-1)),0>e&&(e+=a);else{e=d/a*100;var f=c.line;switch(c.lineAlign){case _.sc:f-=e/2;break;case _.Xc:f-=e}e=Math.round(f/100*a)}ZH(this)&&(e=a-e-d);a=e;c=aI(this,b,a);d=ZH(this)&&_.J.R(a)?JH(0,_.Ud):CH;IH({left:c,
24
- right:d,top:$H(this,b,a)},this.a)}}};VH.prototype.m=function(){return _.Nm(_.Oc)};fI.prototype.append=function(a){var b=a.a;b.style.visibility=_.cd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=QH(a.a);var d=gI(this,a.f),e=XH(a),f=PH(c),g=null,k=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;TH(c,this.a,l)||SH(c,this.a)&&RH(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.h+=n;m.a+=n;break;case "-y":m.h-=n,m.a-=n}}if(this.h||SH(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
25
- l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.h,l.h))/(c.height*c.width);l>k&&(g=PH(c),k=l);c=PH(f)}c=g||f}IH({top:JH(c.h-this.a.h,_.Ud),bottom:JH(this.a.a-c.a,_.Ud),left:JH(c.f-this.a.f,_.Ud),right:JH(this.a.g-c.g,_.Ud),height:JH(c.height,_.Ud),width:JH(c.width,_.Ud)},a.a)}b.style.visibility="visible";this.g.push(QH(a.a))};_.v(iI,UH);iI.prototype.init=function(){this.g=new fI(this);this.h=!0};iI.prototype.m=function(){var a=_.Nm(_.Oc);_.Lm(a,this.o);this.id&&(a.id=this.id);return a};_.v(kI,iI);
26
- kI.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.tg:b=b.width/100*a.width;break a;default:throw Error(yH);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.tg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(yH);d=a.height;var e=lI(this,d,a.height);IH(this.A,this.a);IH({left:JH(c,_.Ud),top:JH(e,_.Ud),width:JH(b,_.Ud),height:JH(d,_.Ud)},this.a);this.f.writingMode&&IH({display:"flex",
27
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&IH({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Lm(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.tg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new VH(new _.sg(0,1,"Lorem ipsum",_.mg),{},{});c=d.a;this.a.appendChild(c);d.init(QH(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(yH);
28
- }a=lI(this,b,a.height);IH({top:JH(a,_.Ud),height:JH(b,_.Ud)},this.a);this.g=new fI(this,!0);this.h=!0};kI.prototype.ba=function(){return this.f.id};oI.prototype.appendRule=function(a){if(null!=this.a&&!this.o.some(function(c){return c===a})){var b=rI(this,a);if(qI(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.f.debug("Added CSS rule "+b)}catch(c){this.f.error("An error occurred when adding a CSS rule: "+b)}this.o.push(a)}else this.f.warn(xH+this.h+" ignoring the CSS rule because it's not safe: "+b)}};
29
- oI.prototype.destroy=function(){var a=this;return _.A(function(b){if(null==a.a)return b["return"]();a.w.forEach(function(c){return c()});a.w=[];pI(a);document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.g.ownerNode);a.a=null;a.g=null;a.m&&a.m.classList.remove(a.j);a.f.debug(xH+a.h+" has been destroyed.");_.z(b)})};var mI=0;_.v(vI,_.hp);_.t=vI.prototype;
30
- _.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={ed:c.ed},e=d.next())c.ed=e.value,this.f.some(function(f){return function(g){var k=f.ed;return g.payload!==k.payload?!1:
31
- g.startTime!==k.startTime?!1:g.endTime!==k.endTime?!1:!0}}(c))||this.f.push(c.ed);this.m=null;uI(this,!1)}};_.t.lb=function(){null==this.g||uI(this,!0)};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a){if(null==a.g)return b["return"]();AI(a);a.D.stop();return _.w(b,a.g.destroy(),2)}if(3!=b.a)return a.g=null,_.w(b,a.j.destroy(),3);a.j=null;a.w.removeChild(a.a.a);a.a=null;a.o.stop();a.o=null;a.h=!1;_.z(b)})};
32
- _.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;uI(this,!0);return!0};_.t.isTextVisible=function(){return this.h};_.t.setTextVisibility=function(a){null!=this.g&&this.h!==a&&((this.h=a)?(this.D.Ya(.25),this.L.enableResizeObserver&&this.o.start(),uI(this,!0)):(this.D.stop(),this.o.stop(),AI(this)))};_.t.$g=function(){uI(this,!0)};_.B(BH,vI);vI.prototype.setTextVisibility=vI.prototype.setTextVisibility;
33
- vI.prototype.isTextVisible=vI.prototype.isTextVisible;vI.prototype.remove=vI.prototype.remove;vI.prototype.destroy=vI.prototype.destroy;vI.prototype.append=vI.prototype.append;BI.prototype.W=function(a){return!!a.enableHtmlCue&&!_.yi()};BI.prototype.create=function(a){return new vI(a)};BI.prototype.create=BI.prototype.create;BI.prototype.isSupported=BI.prototype.W;_.v(CI,_.Kn);CI.prototype.Da=function(){_.Jl("html",new BI)};CI.prototype.va=function(){};CI.prototype.id=function(){return _.qe};_.B("clpp.htmlcue.HtmlCueComponent",CI);};
2
+ var f=function(window){var II="CLPP Subtitle Styles",JI="Unsupported unit",KI="clpp-text-plain",LI="clpp-text-ttml",MI="clpp.htmlcue.HtmlTextDisplayer",NI="initial",OI=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},PI=function(){},QI=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},SI=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],
3
+ function(c){return RI[c]});return a},UI=function(a,b){TI(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){TI(a,c)})},TI=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},VI=function(a,b){return 0===a?"0":a+b},WI=function(a,b){return 1>Math.abs(a-b)||a<b},XI=function(a,b){return a<b&&1<Math.abs(a-b)},YI=function(a,b){return a>b&&1<Math.abs(a-b)},ZI=function(a,b){return 1>Math.abs(a-b)||a>b},$I=function(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=
4
+ f},aJ=function(a){return new $I(a.f,a.g,a.h,a.a,a.height,a.width)},bJ=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 $I(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
5
+ d-e)},cJ=function(a,b){return b.some(function(c){return XI(a.f,c.g)&&YI(a.g,c.f)&&XI(a.h,c.a)&&YI(a.a,c.h)})},dJ=function(a,b){return ZI(a.h,b.h)&&WI(a.a,b.a)&&ZI(a.f,b.f)&&WI(a.g,b.g)},eJ=function(a,b,c){switch(c){case "+x":return XI(a.f,b.f);case "-x":return YI(a.g,b.g);case "+y":return XI(a.h,b.h);case "-y":return YI(a.a,b.a);default:throw Error("Unknown axis");}},fJ=function(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1},gJ=function(a,b,c){fJ.call(this,a.id,"clpp-text-cue",{});
6
+ this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c},iJ=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 hJ(a)?b:c},lJ=function(a,b,c){return hJ(a)&&_.J.pa(c)?VI(c,_.ae):(jJ(a)||kJ(a))&&_.J.pa(b)?VI(b,"%"):NI},jJ=function(a){return a.f.writingMode===_.Ne},kJ=function(a){return a.f.writingMode===_.Oe},hJ=function(a){return a.f.writingMode===_.tg},mJ=function(a,b,c){return(jJ(a)||kJ(a))&&_.J.pa(c)?VI(c,_.ae):
7
+ jJ(a)&&_.J.R(c)?VI(0,_.ae):hJ(a)&&_.J.pa(b)?VI(b,"%"):NI},nJ=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.rd:return a.f.position;case "auto":case _.Ac:return a.f.position-a.f.size/2;case _.sd:return a.f.position-a.f.size}return 0},oJ=function(a){switch(a.f.positionAlign){case _.rd:return _.od;case "auto":case _.Ac:return _.sg;case _.sd:return _.he}return a.f.textAlign},pJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.od:case _.od:return _.rd;
8
+ case _.sg:return _.Ac;case _.he:case _.he:return _.sd}return a.f.positionAlign},qJ=function(a){switch(a.f.writingMode){case _.tg:return"horizontal-tb";case _.Ne:return _.Ne;case _.Oe:return _.Oe;default:throw Error("Unknown writing mode");}},rJ=function(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=bJ(a.a);this.g=[]},sJ=function(a,b){if(a.h)switch(b.writingMode){case _.tg:return["-y"];case _.Ne:return["+x"];case _.Oe:return["-x"]}var c=[];switch(b.writingMode){case _.tg:c=["+y","-y"];break;
9
+ case _.Ne:c=["+x","-x"];break;case _.Oe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},tJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=bJ(a.j.a)},uJ=function(a,b,c){fJ.call(this,a,b,c);this.g=null;this.j=[]},vJ=function(a,b){tJ(a.g);a.j.unshift(b);for(var c=_.u(a.j),d=c.next();!d.done;d=c.next())a.g.append(d.value)},wJ=function(a,b){uJ.call(this,a.id,"clpp-text-cue-region",b);this.f=a},xJ=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.yg)return a.viewportAnchorY/
10
+ 100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(JI);},zJ=function(a){this.f=new _.H("clpp.htmlcue.StyleManager");this.m=[];this.h=a.getSurface().getUniqueCssClass();this.j=[];this.a=yJ(this,this.h);this.g=yJ(this,this.h,!0);this.g.disabled=!0;this.f.debug("Stylesheet CLPP Subtitle Styles has been created.")},AJ=function(a,b){var c=!1;try{a.g.insertRule(b,0);var d=a.g.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===
11
+ e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},BJ=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,c)},yJ=function(a,b,c){var d=document.createElement(_.ve),e=d.dataset;e.name=II;
12
+ e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);CJ(a,b);a.f.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},CJ=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===II&&a.f.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
+ FJ=function(a){_.Tp.call(this,a);var b=this;this.L=new _.H(MI);this.l=a;this.K=DJ(a);this.h=!1;this.f=[];this.B=a.getSurface().getContainer();this.g=new zJ(a);this.a=new uJ(null,"clpp-text-container",{});this.o=new _.pp(a.getSurface(),this.lh.bind(this));this.I=null;this.B?(this.B.appendChild(this.a.a),this.a.init(null)):this.L.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.C=new _.Li(function(){EJ(b)});
14
+ this.w=new Map;this.j=null},DJ=function(a){a=_.J.Ma(a.getConfiguration().htmlcue||{});_.J.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.J.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},GJ=function(a,b){return a.startTime<=b&&a.endTime>b},EJ=function(a,b){if((b||a.h)&&a.B){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.bn){a.I=c;var d=HJ(a,c);(c=b)||(c=a.j,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.j=d,IJ(a),d)){c={color:a.getFontColor()||
15
+ void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Yp(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=LI;break;case _.rg:h=KI}h&&!g.classList.contains(h)&&_.yn(g,h);g=bJ(f.a.a);if(0===g.width||0===g.height)f.L.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{TI({fontSize:JJ(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.We;var l=e.payloadType===_.Fe;e.region&&(h||l||e.backgroundImage)&&(f.w.has(e.region.id)?g=f.w.get(e.region.id):(g=new wJ(e.region,{}),f.w.set(e.region.id,g),vJ(f.a,g)));e=new gJ(e,f.K,c);g?vJ(g,e):vJ(f.a,e)}}}}}},HJ=function(a,b){var c=OI(a.f,function(e){return GJ(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&GJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&GJ(a.f[c+1],b);)c++;return{start:d,
17
+ end:c}},KJ=function(a){IJ(a);a.I=null;a.j=null;a.f=[]},IJ=function(a){a.w.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(LI);b.classList.remove(KI);a=a.a;tJ(a.g);a.j=[]}},JJ=function(a,b){var c=bJ(a.a.a).height;if(null!==a.G)return a.getFontSize();if(null!==a.A){var d=a.getFontSizePercent();return Math.round(c*d)+_.ae}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.ae;d=a.getFontSizePercent();return Math.round(c*d)+_.ae},LJ=function(){},MJ=function(){};
18
+ PI.prototype.parse=function(a){a={input:a};for(var b=_.An(_.Vc),c=[],d=b,e;null!==(e=QI(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=NJ[f];h?(h=_.An(h),(f=OJ[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||PJ[g.localName]&&PJ[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(SI(e)));return b};var NJ={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},OJ={v:"voice",lang:"lang"},PJ={rt:"ruby"},RI={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};fJ.prototype.init=function(){this.h=!0};fJ.prototype.w=function(){return!1};_.v(gJ,fJ);gJ.prototype.w=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
20
+ gJ.prototype.init=function(a){fJ.prototype.init.call(this,a);if(this.g)_.yn(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Fe){var c=_.An(_.Vc);c.innerHTML=b.payload;b=c}else b.payloadType===_.We?b=(new PI).parse(b.payload):(c=_.An(_.Vc),c.textContent=b.payload,b=c);_.yn(b,this.o);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
21
+ c.next();!d.done;d=c.next())_.yn(b,d.value);TI({writingMode:qJ(this)},b);this.a.appendChild(b);_.yn(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.yn(this.a,"clpp-text-wrapper__"+d.value);_.J.R(this.f.line)&&(this.f.lineInterpretation=_.ug,this.f.line=hJ(this)?-1:0);c=qJ(this);TI({writingMode:c,webkitWritingMode:c,direction:NI,textAlign:oJ(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=nJ(this,pJ(this));d=mJ(this,c,null);var e=lJ(this,
22
+ c,null),f=kJ(this)&&_.J.R(null)?VI(0,_.ae):NI;TI({position:"absolute",left:d,right:f,top:e,width:hJ(this)?VI(this.f.size,"%"):NI,height:jJ(this)||kJ(this)?VI(this.f.size,"%"):NI},this.a);d=this.f;a=hJ(this)?a.height:a.width;e=iJ(this);if(d.lineInterpretation===_.ug)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 _.Ac:g-=f/2;break;case _.dd:g-=f}f=Math.round(g/100*a)}kJ(this)&&(f=a-f-e);a=f;d=mJ(this,c,a);e=kJ(this)&&_.J.R(a)?
23
+ VI(0,_.ae):NI;TI({left:d,right:e,top:lJ(this,c,a)},this.a)}UI(this.B,b)}};gJ.prototype.m=function(){return _.An(_.Vc)};rJ.prototype.append=function(a){var b=a.a;b.style.visibility=_.jd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=bJ(a.a);var d=sJ(this,a.f),e=iJ(a),f=aJ(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;eJ(c,this.a,l)||dJ(c,this.a)&&cJ(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.h+=n;m.a+=n;break;case "-y":m.h-=n,m.a-=n}}if(this.h||dJ(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.h,l.h))/(c.height*c.width);l>h&&(g=aJ(c),h=l);c=aJ(f)}c=g||f}TI({top:VI(c.h-this.a.h,_.ae),bottom:VI(this.a.a-c.a,_.ae),left:VI(c.f-this.a.f,_.ae),right:VI(this.a.g-c.g,_.ae),height:VI(c.height,_.ae),width:VI(c.width,_.ae)},a.a)}b.style.visibility="visible";this.g.push(bJ(a.a))};_.v(uJ,fJ);uJ.prototype.init=function(){this.g=new rJ(this);this.h=!0};uJ.prototype.m=function(){var a=_.An(_.Vc);_.yn(a,this.o);this.id&&(a.id=this.id);return a};_.v(wJ,uJ);
25
+ wJ.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.yg:b=b.width/100*a.width;break a;default:throw Error(JI);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.yg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(JI);d=a.height;var e=xJ(this,d,a.height);TI(this.A,this.a);TI({left:VI(c,_.ae),top:VI(e,_.ae),width:VI(b,_.ae),height:VI(d,_.ae)},this.a);this.f.writingMode&&TI({display:"flex",
26
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&TI({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.yn(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.yg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new gJ(new _.xg(0,1,"Lorem ipsum",_.rg),{},{});c=d.a;this.a.appendChild(c);d.init(bJ(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(JI);
27
+ }a=xJ(this,b,a.height);TI({top:VI(a,_.ae),height:VI(b,_.ae)},this.a);this.g=new rJ(this,!0);this.h=!0};wJ.prototype.getId=function(){return this.f.id};zJ.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=BJ(this,a);if(AJ(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.f.debug("Added CSS rule "+b)}catch(c){this.f.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.f.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
+ zJ.prototype.destroy=function(){var a=this;return _.A(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.g.ownerNode);a.a=null;a.g=null;a.f.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.z(b)})};_.v(FJ,_.Tp);_.t=FJ.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={md:c.md},e=d.next())c.md=e.value,this.f.some(function(f){return function(g){var h=f.md;return g.payload!==h.payload?!1:
30
+ g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.md);this.j=null;EJ(this,!1)}};_.t.ob=function(){null==this.g||EJ(this,!0)};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a){if(null==a.g)return b["return"]();KJ(a);a.C.stop();return _.y(b,a.g.destroy(),2)}a.g=null;a.B.removeChild(a.a.a);a.a=null;a.o.stop();a.o=null;a.h=!1;_.z(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.j=null;EJ(this,!0);return!0};_.t.isTextVisible=function(){return this.h};_.t.setTextVisibility=function(a){null!=this.g&&this.h!==a&&((this.h=a)?(this.C.ab(.25),this.K.enableResizeObserver&&this.o.start(),EJ(this,!0)):(this.C.stop(),this.o.stop(),KJ(this)))};_.t.lh=function(){EJ(this,!0)};_.B(MI,FJ);FJ.prototype.setTextVisibility=FJ.prototype.setTextVisibility;
32
+ FJ.prototype.isTextVisible=FJ.prototype.isTextVisible;FJ.prototype.remove=FJ.prototype.remove;FJ.prototype.destroy=FJ.prototype.destroy;FJ.prototype.append=FJ.prototype.append;LJ.prototype.aa=function(a){return!!a.enableHtmlCue&&!_.Vi()};LJ.prototype.create=function(a){return new FJ(a)};_.v(MJ,_.zo);MJ.prototype.Ja=function(){_.wm("html",new LJ)};MJ.prototype.Ca=function(){};MJ.prototype.id=function(){return _.xe};_.B("clpp.htmlcue.HtmlCueComponent",MJ);};
34
33
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
35
34
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
36
35
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.ima.js CHANGED
@@ -1,27 +1,27 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var fH="clpp.ima.AdsManagerFactory",gH=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},hH=function(){},iH=function(a){this.a=a},jH=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.J.Ha(a.ima||{});this.m=this.l.Yb("ima").Bc();this.J=this.l.Yb("ima").g;this.o=this.l.Yb("ima").a;this.G=new _.Fo;this.N=new _.G("clpp.ima");this.h=this.a=null;this.f=new _.Qh;this.D=!1;this.w=new _.Wf;this.T=new hH;this.A=null;this.I=this.C=this.L=this.B=!1;this.g=
3
- null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.wi.bind(this));a.on(this.o,b,this.vi.bind(this));a.one(this.j,_.Yc,this.Di.bind(this))},kH=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.eh.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Ei.bind(a));c.on(b,d.STARTED,a.gh.bind(a));c.on(b,d.LOG,a.mi.bind(a));c.on(b,d.AD_PROGRESS,a.ri.bind(a));c.on(b,d.AD_BUFFERING,a.ji.bind(a));c.on(b,d.FIRST_QUARTILE,
4
- a.bh.bind(a));c.on(b,d.MIDPOINT,a.ni.bind(a));c.on(b,d.THIRD_QUARTILE,a.hh.bind(a));c.on(b,d.PAUSED,a.pi.bind(a));c.on(b,d.RESUMED,a.si.bind(a));c.on(b,d.CLICK,a.ah.bind(a));c.on(b,d.SKIPPED,a.fh.bind(a));c.on(b,d.IMPRESSION,a.dh.bind(a));c.on(b,d.COMPLETE,a.ki.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Fi.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.yi.bind(a))},lH=function(a){a=a.K;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.h&&(b.bitrate=
5
- a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.jc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.h&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.jc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},nH=function(a){a.A=null;mH(a,_.Kb);a.m&&a.l.getSurface().hide(a.m)},oH=
6
- function(a){_.Mm(a.j,{visibility:"visible"})},mH=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new gH(c,a.B,a.L)});a.l.trigger(new _.I(b,d))},pH=function(a,b){var c=b?a.T.create(b.getErrorCode()):null;a.l.onError(new _.K(1,9,10003,{errorType:c},b))},rH=function(a){var b,c;return _.A(function(d){if(1==d.a)return a.J.initialize(),b=!!a.l.getConfiguration().muted,_.w(d,a.G.canPlay(b),2);c=d.f;if(!c)return mH(a,_.gc),a.N.warn(_.ka),d["return"]();qH(a);_.z(d)})},sH=function(a,b){return _.A(function(c){if(1==
7
- c.a)return a.J.initialize(),_.w(c,b.play(),2);qH(a);_.z(c)})},qH=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},tH=function(){this.a=this.g=this.f=null},uH=function(){return!window.google||!google.ima||!google.ima.AdsLoader},vH=function(){},wH=function(){this.a=new _.G(fH)};_.t=gH.prototype;_.t.ob=function(){return"Google IMA SDK"};_.t.pb=function(){return google.ima.VERSION};_.t.ub=function(){return 0};_.t.ba=function(){return this.a.getAdId()};
8
- _.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()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.bc=function(){return this.f?this.f.getIsBumper():!1};
9
- _.t.Hb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.me});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.rb=function(){return this.a.getVastMediaWidth()};_.t.qb=function(){return this.a.getVastMediaHeight()};_.t.bb=function(){return this.a.getVastMediaBitrate()};_.t.Ra=function(){return this.g?2:this.h?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
10
- _.t.Ib=function(){return this.f?this.f.getTimeOffset():0};_.t.Jb=function(){return this.f?this.f.getAdPosition():1};_.t.tb=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()};gH.prototype.getWrapperCreativeIds=gH.prototype.getWrapperCreativeIds;gH.prototype.getWrapperAdSystems=gH.prototype.getWrapperAdSystems;
11
- gH.prototype.getWrapperAdIds=gH.prototype.getWrapperAdIds;gH.prototype.getSequenceLength=gH.prototype.tb;gH.prototype.getPositionInSequence=gH.prototype.Jb;gH.prototype.getPodTimeOffset=gH.prototype.Ib;gH.prototype.getPodIndex=gH.prototype.getPodIndex;gH.prototype.getPodType=gH.prototype.Ra;gH.prototype.getMediaBitrate=gH.prototype.bb;gH.prototype.getMediaHeight=gH.prototype.qb;gH.prototype.getMediaWidth=gH.prototype.rb;gH.prototype.getMediaUrl=gH.prototype.getMediaUrl;
12
- gH.prototype.getClickThroughUrl=gH.prototype.Hb;gH.prototype.isBumper=gH.prototype.bc;gH.prototype.getSkipTimeOffset=gH.prototype.getSkipTimeOffset;gH.prototype.getDuration=gH.prototype.getDuration;gH.prototype.getTitle=gH.prototype.getTitle;gH.prototype.getAdvertiserName=gH.prototype.getAdvertiserName;gH.prototype.getAdSystem=gH.prototype.getAdSystem;gH.prototype.getApiFramework=gH.prototype.getApiFramework;gH.prototype.getCreativeId=gH.prototype.getCreativeId;gH.prototype.getId=gH.prototype.ba;
13
- gH.prototype.getTechnology=gH.prototype.ub;gH.prototype.getAdManagerVersion=gH.prototype.pb;gH.prototype.getAdManagerName=gH.prototype.ob;hH.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}};iH.prototype.getCuePoints=function(){return this.a};iH.prototype.Kb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};iH.prototype.cb=function(){return 0<=this.a.indexOf(-1)};iH.prototype.hasPostroll=iH.prototype.cb;iH.prototype.hasPreroll=iH.prototype.Kb;iH.prototype.getCuePoints=iH.prototype.getCuePoints;_.t=jH.prototype;
14
- _.t.wi=function(a){var b=this;this.a=a.getAdsManager(this.j,lH(this));this.a.isCustomPlaybackUsed()?(this.N.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.K(1,9,10002)),this.dispose()):(this.h=new _.Do(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.g=new iH(a),this.l.trigger(new _.I(_.Nb,{adsTimeline:this.g})),kH(this));this.f.resolve()};
15
- _.t.vi=function(a){pH(this,a.getError());this.f.resolve()};_.t.Ei=function(a){var b=this;return _.A(function(c){if(1==c.a)return b.C=!0,_.w(c,b.l.pause(),2);_.Mm(b.j,{visibility:_.cd});mH(b,_.wb,a);b.h.start();_.z(c)})};_.t.eh=function(a){a.getAd().isLinear()?mH(this,_.Db,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.gh=function(a){this.A=a.getAd().getDuration();mH(this,_.Jb,a);this.l.getSurface().show(this.m)};_.t.mi=function(a){a=a.getAdData();pH(this,a?a.adError:null);nH(this)};
16
- _.t.ri=function(a){mH(this,_.Gb,a)};_.t.ji=function(a){mH(this,_.yb,a)};_.t.bh=function(a){mH(this,_.Bb,a)};_.t.ni=function(a){mH(this,_.Eb,a)};_.t.hh=function(a){mH(this,_.Lb,a)};_.t.pi=function(a){mH(this,_.Fb,a)};_.t.si=function(a){mH(this,_.Hb,a)};_.t.ah=function(a){this.pause();mH(this,_.zb,a)};_.t.fh=function(a){mH(this,_.Ib,a);nH(this)};_.t.dh=function(a){mH(this,_.Cb,a)};_.t.ki=function(a){mH(this,_.Ab,a);nH(this)};
17
- _.t.Fi=function(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();mH(this,_.xb);oH(this)};_.t.yi=function(){this.I=!0};_.t.Di=function(){this.L=!0;this.o.contentComplete()};
18
- _.t.load=function(){var a=this,b,c,d,e,f;return _.A(function(g){if(1==g.a){b=a.l;c=a.K;try{if(typeof c.adTagUrl!==_.me)throw new _.K(1,9,10001,{missingKeys:"adTagUrl"});}catch(k){return b.onError(k),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.w(g,a.G.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.w(g,a.G.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.requestAds(f);return g["return"](a.f)})};
19
- _.t.start=function(a){var b=this;return _.A(function(c){return b.a&&b.g&&!b.D?b.g.Kb()?_.w(c,rH(b),0):_.w(c,sH(b,a),0):_.w(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)};
2
+ var f=function(window){var qI="clpp.ima.AdsManagerFactory",rI=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},sI=function(){},tI=function(a){this.a=a},uI=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.J.Ma(a.ima||{});this.m=this.l.$b("ima").Dc();this.J=this.l.$b("ima").g;this.o=this.l.$b("ima").a;this.G=new _.rp;this.O=new _.H("clpp.ima");this.h=this.a=null;this.f=new _.Mh;this.D=!1;this.w=new _.cg;this.S=new sI;this.A=null;this.I=this.C=this.L=this.B=!1;this.g=
3
+ null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Oi.bind(this));a.on(this.o,b,this.Ni.bind(this));a.one(this.j,_.ed,this.Vi.bind(this))},vI=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.ph.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Wi.bind(a));c.on(b,d.STARTED,a.rh.bind(a));c.on(b,d.LOG,a.Hi.bind(a));c.on(b,d.AD_PROGRESS,a.Li.bind(a));c.on(b,d.AD_BUFFERING,a.Ei.bind(a));c.on(b,d.FIRST_QUARTILE,
4
+ a.nh.bind(a));c.on(b,d.MIDPOINT,a.Ii.bind(a));c.on(b,d.THIRD_QUARTILE,a.sh.bind(a));c.on(b,d.PAUSED,a.Ki.bind(a));c.on(b,d.RESUMED,a.Mi.bind(a));c.on(b,d.CLICK,a.mh.bind(a));c.on(b,d.SKIPPED,a.qh.bind(a));c.on(b,d.IMPRESSION,a.oh.bind(a));c.on(b,d.COMPLETE,a.Fi.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Xi.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Qi.bind(a))},wI=function(a){a=a.K;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=
5
+ a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.rc?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===_.rc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},yI=function(a){a.A=null;xI(a,_.Tb);a.m&&a.l.getSurface().hide(a.m)},zI=
6
+ function(a){_.zn(a.j,{visibility:"visible"})},xI=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new rI(c,a.B,a.L)});a.l.trigger(new _.I(b,d))},AI=function(a,b){var c=b?a.S.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},CI=function(a){var b,c;return _.A(function(d){if(1==d.a)return a.J.initialize(),b=!!a.l.getConfiguration().muted,_.y(d,a.G.canPlay(b),2);c=d.f;if(!c)return xI(a,_.pc),a.O.warn(_.ma),d["return"]();BI(a);_.z(d)})},DI=function(a,b){return _.A(function(c){if(1==
7
+ c.a)return a.J.initialize(),_.y(c,b.play(),2);BI(a);_.z(c)})},BI=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},EI=function(){this.a=this.g=this.f=null},FI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},GI=function(){},HI=function(){this.a=new _.H(qI)};_.t=rI.prototype;_.t.sb=function(){return"Google IMA SDK"};_.t.tb=function(){return google.ima.VERSION};_.t.yb=function(){return 0};_.t.getId=function(){return this.a.getAdId()};
8
+ _.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()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.dc=function(){return this.f?this.f.getIsBumper():!1};
9
+ _.t.Ib=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Id&&typeof b[d].clickThroughUrl===_.te});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.vb=function(){return this.a.getVastMediaWidth()};_.t.ub=function(){return this.a.getVastMediaHeight()};_.t.gb=function(){return this.a.getVastMediaBitrate()};_.t.Ua=function(){return this.g?2:this.h?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
10
+ _.t.Jb=function(){return this.f?this.f.getTimeOffset():0};_.t.Kb=function(){return this.f?this.f.getAdPosition():1};_.t.xb=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()};rI.prototype.getWrapperCreativeIds=rI.prototype.getWrapperCreativeIds;rI.prototype.getWrapperAdSystems=rI.prototype.getWrapperAdSystems;
11
+ rI.prototype.getWrapperAdIds=rI.prototype.getWrapperAdIds;rI.prototype.getSequenceLength=rI.prototype.xb;rI.prototype.getPositionInSequence=rI.prototype.Kb;rI.prototype.getPodTimeOffset=rI.prototype.Jb;rI.prototype.getPodIndex=rI.prototype.getPodIndex;rI.prototype.getPodType=rI.prototype.Ua;rI.prototype.getMediaBitrate=rI.prototype.gb;rI.prototype.getMediaHeight=rI.prototype.ub;rI.prototype.getMediaWidth=rI.prototype.vb;rI.prototype.getMediaUrl=rI.prototype.getMediaUrl;
12
+ rI.prototype.getClickThroughUrl=rI.prototype.Ib;rI.prototype.isBumper=rI.prototype.dc;rI.prototype.getSkipTimeOffset=rI.prototype.getSkipTimeOffset;rI.prototype.getDuration=rI.prototype.getDuration;rI.prototype.getTitle=rI.prototype.getTitle;rI.prototype.getAdvertiserName=rI.prototype.getAdvertiserName;rI.prototype.getAdSystem=rI.prototype.getAdSystem;rI.prototype.getApiFramework=rI.prototype.getApiFramework;rI.prototype.getCreativeId=rI.prototype.getCreativeId;rI.prototype.getId=rI.prototype.getId;
13
+ rI.prototype.getTechnology=rI.prototype.yb;rI.prototype.getAdManagerVersion=rI.prototype.tb;rI.prototype.getAdManagerName=rI.prototype.sb;sI.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}};tI.prototype.getCuePoints=function(){return this.a};tI.prototype.Lb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};tI.prototype.hb=function(){return 0<=this.a.indexOf(-1)};tI.prototype.hasPostroll=tI.prototype.hb;tI.prototype.hasPreroll=tI.prototype.Lb;tI.prototype.getCuePoints=tI.prototype.getCuePoints;_.t=uI.prototype;
14
+ _.t.Oi=function(a){var b=this;this.a=a.getAdsManager(this.j,wI(this));this.a.isCustomPlaybackUsed()?(this.O.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.L(1,9,10002)),this.dispose()):(this.h=new _.pp(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.g=new tI(a),this.l.trigger(new _.I(_.Wb,{adsTimeline:this.g})),vI(this));this.f.resolve()};
15
+ _.t.Ni=function(a){AI(this,a.getError());this.f.resolve()};_.t.Wi=function(a){var b=this;return _.A(function(c){if(1==c.a)return b.C=!0,_.y(c,b.l.pause(),2);_.zn(b.j,{visibility:_.jd});xI(b,_.Fb,a);b.h.start();_.z(c)})};_.t.ph=function(a){a.getAd().isLinear()?xI(this,_.Mb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.rh=function(a){this.A=a.getAd().getDuration();xI(this,_.Sb,a);this.l.getSurface().show(this.m)};_.t.Hi=function(a){a=a.getAdData();AI(this,a?a.adError:null);yI(this)};
16
+ _.t.Li=function(a){xI(this,_.Pb,a)};_.t.Ei=function(a){xI(this,_.Hb,a)};_.t.nh=function(a){xI(this,_.Kb,a)};_.t.Ii=function(a){xI(this,_.Nb,a)};_.t.sh=function(a){xI(this,_.Ub,a)};_.t.Ki=function(a){xI(this,_.Ob,a)};_.t.Mi=function(a){xI(this,_.Qb,a)};_.t.mh=function(a){this.pause();xI(this,_.Ib,a)};_.t.qh=function(a){xI(this,_.Rb,a);yI(this)};_.t.oh=function(a){xI(this,_.Lb,a)};_.t.Fi=function(a){xI(this,_.Jb,a);yI(this)};
17
+ _.t.Xi=function(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();xI(this,_.Gb);zI(this)};_.t.Qi=function(){this.I=!0};_.t.Vi=function(){this.L=!0;this.o.contentComplete()};
18
+ _.t.load=function(){var a=this,b,c,d,e,f;return _.A(function(g){if(1==g.a){b=a.l;c=a.K;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?_.y(g,a.G.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.G.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.requestAds(f);return g["return"](a.f)})};
19
+ _.t.start=function(a){var b=this;return _.A(function(c){return b.a&&b.g&&!b.D?b.g.Lb()?_.y(c,CI(b),0):_.y(c,DI(b,a),0):_.y(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)};
20
20
  _.t.getPosition=function(){if(!this.a||null===this.A)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.A-a};
21
- _.t.dispose=function(){var a=this;return(new Promise(function(b){a.D&&a.g&&a.g.cb()&&!a.I?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.m&&a.l.getSurface().hide(a.m)}),_.Xf(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.o.contentComplete()})).then(function(){oH(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};jH.prototype.getPosition=jH.prototype.getPosition;
22
- jH.prototype.setVolume=jH.prototype.setVolume;jH.prototype.getVolume=jH.prototype.getVolume;jH.prototype.skip=jH.prototype.skip;jH.prototype.pause=jH.prototype.pause;jH.prototype.resume=jH.prototype.resume;_.v(tH,_.rp);_.t=tH.prototype;_.t.onPlayerCreated=function(a){if(uH())return a.onError(new _.K(1,9,1E4));this.f=_.Km(_.Oc,{"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)};
23
- _.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.Th=function(){return this.a};_.t.Rh=function(){return this.g};_.t.Bc=function(){return this.f};_.t.id=function(){return"ima"};_.B("clpp.ima.ImaPlugin",tH);tH.prototype.getAdContainer=tH.prototype.Bc;tH.prototype.getAdDisplayContainer=tH.prototype.Rh;tH.prototype.getAdsLoader=tH.prototype.Th;tH.Id="ima";
24
- tH.isSdkMissing=uH;vH.prototype.create=function(){return new tH};_.Fn(new vH);wH.prototype.name=function(){return fH};wH.prototype.W=function(a,b){return a.namespace()===_.yc?!1:uH()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};wH.prototype.create=function(a){return new jH(a)};wH.prototype.create=wH.prototype.create;wH.prototype.isSupported=wH.prototype.W;wH.prototype.name=wH.prototype.name;_.Hm(new wH);};
21
+ _.t.dispose=function(){var a=this;return(new Promise(function(b){a.D&&a.g&&a.g.hb()&&!a.I?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.m&&a.l.getSurface().hide(a.m)}),_.dg(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.o.contentComplete()})).then(function(){zI(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};uI.prototype.getPosition=uI.prototype.getPosition;
22
+ uI.prototype.setVolume=uI.prototype.setVolume;uI.prototype.getVolume=uI.prototype.getVolume;uI.prototype.skip=uI.prototype.skip;uI.prototype.pause=uI.prototype.pause;uI.prototype.resume=uI.prototype.resume;_.v(EI,_.cq);_.t=EI.prototype;_.t.onPlayerCreated=function(a){if(FI())return a.onError(new _.L(1,9,1E4));this.f=_.xn(_.Vc,{"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(_.ta);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
23
+ _.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.ei=function(){return this.a};_.t.ci=function(){return this.g};_.t.Dc=function(){return this.f};_.t.id=function(){return"ima"};_.B("clpp.ima.ImaPlugin",EI);EI.prototype.getAdContainer=EI.prototype.Dc;EI.prototype.getAdDisplayContainer=EI.prototype.ci;EI.prototype.getAdsLoader=EI.prototype.ei;EI.Id="ima";
24
+ EI.isSdkMissing=FI;GI.prototype.create=function(){return new EI};_.uo(new GI);HI.prototype.name=function(){return qI};HI.prototype.aa=function(a,b){return a.namespace()===_.Fc?!1:FI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};HI.prototype.create=function(a){return new uI(a)};HI.prototype.create=HI.prototype.create;HI.prototype.isSupported=HI.prototype.aa;HI.prototype.name=HI.prototype.name;_.un(new HI);};
25
25
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
26
26
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
27
27
  else{_=this.clpp._;(f.call(g,this));}