@castlabs/prestoplay 6.18.0 → 6.19.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 (64) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +115 -114
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +578 -576
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +77 -75
  10. package/cjs/cl.externs.js +174 -292
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +70 -71
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +312 -311
  17. package/cjs/cl.muxdata.js +15 -15
  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.sessions.js +16 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +29 -28
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +13 -13
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +18 -18
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +90 -89
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +475 -474
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +71 -70
  40. package/cl.externs.js +171 -293
  41. package/cl.freewheel.js +19 -19
  42. package/cl.hls.js +74 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +26 -26
  45. package/cl.ima.js +17 -17
  46. package/cl.mse.js +276 -274
  47. package/cl.muxdata.js +13 -13
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +11 -11
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +57 -57
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +8 -8
  59. package/cl.vr.js +14 -14
  60. package/cl.vtt.js +12 -12
  61. package/cl.youbora.js +15 -15
  62. package/clpp.styles.css +14 -0
  63. package/package.json +1 -1
  64. package/typings.d.ts +379 -384
package/cjs/cl.htmlcue.js CHANGED
@@ -1,33 +1,33 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var NR="CLPP Subtitle Styles",OR="Unsupported unit",PR="clpp-text-plain",QR="clpp-text-ttml",RR="clpp.htmlcue.HtmlTextDisplayer",SR="initial",TR=function(a){return _.qi(a,{Zg:function(b,c){return b.la(c)}})},UR=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)},VR=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},WR=function(){},YR=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},$R=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return ZR[c]});return a},bS=function(a,b){aS(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){aS(a,c)})},aS=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},cS=function(a,b){return 0===a?"0":a+b},dS=function(a,b){return 1>Math.abs(a-b)||a<b},eS=function(a,b){return a<b&&
4
- 1<Math.abs(a-b)},fS=function(a,b){return a>b&&1<Math.abs(a-b)},gS=function(a,b){return 1>Math.abs(a-b)||a>b},hS=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},iS=function(a){return new hS(a.left,a.f,a.top,a.a,a.height,a.width)},jS=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 hS(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},kS=function(a,b){return b.some(function(c){return eS(a.left,c.f)&&fS(a.f,c.left)&&eS(a.top,c.a)&&fS(a.a,c.top)})},lS=function(a,b){return gS(a.top,b.top)&&dS(a.a,b.a)&&gS(a.left,b.left)&&dS(a.f,b.f)},mS=function(a,b,c){switch(c){case "+x":return eS(a.left,b.left);case "-x":return fS(a.f,b.f);
6
- case "+y":return eS(a.top,b.top);case "-y":return fS(a.a,b.a);default:throw Error("Unknown axis");}},nS=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},oS=function(a,b,c){nS.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},qS=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 pS(a)?b:c},tS=function(a,b,c){return pS(a)&&_.M.sa(c)?cS(c,_.Pf):(rS(a)||
7
- sS(a))&&_.M.sa(b)?cS(b,"%"):SR},rS=function(a){return a.f.writingMode===_.Jg},sS=function(a){return a.f.writingMode===_.Kg},pS=function(a){return a.f.writingMode===_.ti},uS=function(a,b,c){return(rS(a)||sS(a))&&_.M.sa(c)?cS(c,_.Pf):rS(a)&&_.M.S(c)?cS(0,_.Pf):pS(a)&&_.M.sa(b)?cS(b,"%"):SR},vS=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Ie:return a.f.position;case "auto":case _.wd:return a.f.position-a.f.size/2;case _.Je:return a.f.position-a.f.size}return 0},
8
- wS=function(a){switch(a.f.positionAlign){case _.Ie:return _.Fe;case "auto":case _.wd:return _.si;case _.Je:return _.Wf}return a.f.textAlign},xS=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Fe:case _.Fe:return _.Ie;case _.si:return _.wd;case _.Wf:case _.Wf:return _.Je}return a.f.positionAlign},yS=function(a){switch(a.f.writingMode){case _.ti:return"horizontal-tb";case _.Jg:return _.Jg;case _.Kg:return _.Kg;default:throw Error("Unknown writing mode");}},zS=function(a,b){this.l=a;this.f=
9
- a.a;this.j=void 0===b?!1:b;this.a=jS(a.a);this.h=[]},AS=function(a,b){if(a.j)switch(b.writingMode){case _.ti:return["-y"];case _.Jg:return["+x"];case _.Kg:return["-x"]}var c=[];switch(b.writingMode){case _.ti:c=["+y","-y"];break;case _.Jg:c=["+x","-x"];break;case _.Kg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},BS=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=jS(a.l.a)},CS=function(a,b,c){nS.call(this,a,b,c);this.h=null;this.l=[]},DS=function(a,b){BS(a.h);
10
- a.l.unshift(b);for(var c=_.w(a.l),d=c.next();!d.done;d=c.next())a.h.append(d.value)},ES=function(a,b){CS.call(this,a.id,"clpp-text-cue-region",b);this.f=a},FS=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.yi)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(OR);},HS=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=GS(this,this.h);this.f=GS(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},
11
- IS=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.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},JS=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,
12
- c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},GS=function(a,b,c){var d=document.createElement(_.og),e=d.dataset;e.name=NR;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);KS(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},KS=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===NR&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
- c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},NS=function(a){_.wu.call(this,a);var b=this;this.g=new _.K(RR);this.m=a;this.L=LS(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new HS(a.getSurface().getUniqueCssClass());this.a=new CS(null,"clpp-text-container",{});this.w=new _.Jt(a.getSurface(),this.Ej.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
- this.G=new _.Zk(function(){MS(b)});this.A=new Map;this.l=null},LS=function(a){a=_.M.Oa(a.htmlcue||{});_.M.S(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.M.S(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},OS=function(a,b){return a.startTime<=b&&a.endTime>b},MS=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Bp){a.J=c;var d=PS(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,QS(a),
15
- d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Bu(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.w(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 _.Rg:h="clpp-text-vtt";break;case _.wg:h=QR;break;case _.ri:h=PR}h&&!g.classList.contains(h)&&_.Zp(g,h);g=jS(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
- else{aS({fontSize:RS(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Rg;var l=e.payloadType===_.wg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new ES(e.region,{}),f.A.set(e.region.id,g),DS(f.a,g)));e=new oS(e,f.L,c);g?DS(g,e):DS(f.a,e)}}}}}},PS=function(a,b){var c=VR(a.f,function(e){return OS(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&OS(a.f[d-1],b);)d--;for(;c+1<a.f.length&&OS(a.f[c+1],b);)c++;return{start:d,
17
- end:c}},SS=function(a){QS(a);a.J=null;a.l=null;a.f=[]},QS=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(QR);b.classList.remove(PR);a=a.a;BS(a.h);a.l=[]}},RS=function(a,b){var c=jS(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Pf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Pf;d=a.getFontSizePercent();return Math.round(c*d)+_.Pf},TS=function(){},US=function(){};
18
- WR.prototype.parse=function(a){a={input:a};for(var b=_.aq(_.be),c=[],d=b,e;null!==(e=YR(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=VS[f];h?(h=_.aq(h),(f=WS[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||XS[g.localName]&&XS[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($R(e)));return b};var VS={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},WS={v:"voice",lang:"lang"},XS={rt:"ruby"},ZR={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};nS.prototype.init=function(){this.j=!0};nS.prototype.A=function(){return!1};_.x(oS,nS);oS.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
20
- oS.prototype.init=function(a){nS.prototype.init.call(this,a);if(this.h)_.Zp(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.wg){var c=_.aq(_.be);c.innerHTML=b.payload;b=c}else b.payloadType===_.Rg?b=(new WR).parse(b.payload):(c=_.aq(_.be),c.textContent=b.payload,b=c);_.Zp(b,this.w);this.id&&(b.id=this.id);c=_.w(this.f.cssClassList);for(var d=
21
- c.next();!d.done;d=c.next())_.Zp(b,d.value);aS({writingMode:yS(this)},b);this.a.appendChild(b);_.Zp(this.a,"clpp-text-wrapper");c=_.w(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Zp(this.a,"clpp-text-wrapper__"+d.value);_.M.S(this.f.line)&&(this.f.lineInterpretation=_.ui,this.f.line=pS(this)?-1:0);c=yS(this);aS({writingMode:c,webkitWritingMode:c,direction:SR,textAlign:wS(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=vS(this,xS(this));d=uS(this,c,null);var e=tS(this,
22
- c,null),f=sS(this)&&_.M.S(null)?cS(0,_.Pf):SR;aS({position:"absolute",left:d,right:f,top:e,width:pS(this)?cS(this.f.size,"%"):SR,height:rS(this)||sS(this)?cS(this.f.size,"%"):SR},this.a);d=this.f;a=pS(this)?a.height:a.width;e=qS(this);if(d.lineInterpretation===_.ui)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 _.wd:g-=f/2;break;case _.re:g-=f}f=Math.round(g/100*a)}sS(this)&&(f=a-f-e);a=f;d=uS(this,c,a);e=sS(this)&&_.M.S(a)?
23
- cS(0,_.Pf):SR;aS({left:d,right:e,top:tS(this,c,a)},this.a)}bS(this.D,b)}};oS.prototype.o=function(){return _.aq(_.be)};zS.prototype.append=function(a){var b=a.a;b.style.visibility=_.ye;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=jS(a.a);var d=AS(this,a.f),e=qS(a),f=iS(c),g=null,h=0;d=_.w(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;mS(c,this.a,l)||lS(c,this.a)&&kS(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||lS(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
24
- l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>h&&(g=iS(c),h=l);c=iS(f)}c=g||f}aS({top:cS(c.top-this.a.top,_.Pf),bottom:cS(this.a.a-c.a,_.Pf),left:cS(c.left-this.a.left,_.Pf),right:cS(this.a.f-c.f,_.Pf),height:cS(c.height,_.Pf),width:cS(c.width,_.Pf)},a.a)}b.style.visibility="visible";this.h.push(jS(a.a))};_.x(CS,nS);CS.prototype.init=function(){this.h=new zS(this);this.j=!0};CS.prototype.o=function(){var a=_.aq(_.be);_.Zp(a,this.w);this.id&&(a.id=this.id);return a};_.x(ES,CS);
25
- ES.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.yi:b=b.width/100*a.width;break a;default:throw Error(OR);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.yi)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(OR);d=a.height;var e=FS(this,d,a.height);aS(this.B,this.a);aS({left:cS(c,_.Pf),top:cS(e,_.Pf),width:cS(b,_.Pf),height:cS(d,_.Pf)},this.a);this.f.writingMode&&aS({display:"flex",
26
- "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&aS({"justify-content":this.f.displayAlign},this.a);b=_.w(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Zp(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.yi:b=b.height/100*a.height;break a;case 2:b=b.height;d=new oS(new _.xi(0,1,"Lorem ipsum",_.ri),{},{});c=d.a;this.a.appendChild(c);d.init(jS(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(OR);
27
- }a=FS(this,b,a.height);aS({top:cS(a,_.Pf),height:cS(b,_.Pf)},this.a);this.h=new zS(this,!0);this.j=!0};ES.prototype.getId=function(){return this.f.id};HS.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=JS(this,a);if(IS(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
- HS.prototype.destroy=function(){var a=this;return _.I(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.B(b)})};_.x(NS,_.wu);_.t=NS.prototype;_.t.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.w(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=UR(this.f,TR(a));this.l=null;MS(this,!1)}};_.t.zb=function(){null==this.h||MS(this,!0)};
29
- _.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();SS(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.B(b)})};_.t.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;MS(this,!0);return!0};_.t.isTextVisible=function(){return this.j};
30
- _.t.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.mb(.25),this.L.enableResizeObserver&&this.w.start(),MS(this,!0)):(this.G.stop(),this.w.stop(),SS(this)))};_.t.Fd=function(){return this.f};_.t.Ej=function(){MS(this,!0)};_.J(RR,NS);NS.prototype.setTextVisibility=NS.prototype.setTextVisibility;NS.prototype.isTextVisible=NS.prototype.isTextVisible;NS.prototype.remove=NS.prototype.remove;NS.prototype.destroy=NS.prototype.destroy;NS.prototype.append=NS.prototype.append;TS.prototype.isSupported=function(a){return!!a.enableHtmlCue&&!_.il()};TS.prototype.create=function(a){return new NS(a)};_.x(US,_.Ts);US.prototype.f=function(){_.ap(_.ze,new TS)};US.prototype.a=function(){_.Zo.has(_.ze)&&(_.Zo["delete"](_.ze),_.$o.info("Removed factory: 'html'"))};US.prototype.id=function(){return _.qg};_.J("clpp.htmlcue.HtmlCueComponent",US);};
2
+ var f=function(window){var WR="CLPP Subtitle Styles",YR="Unsupported unit",ZR="clpp-text-plain",$R="clpp-text-ttml",aS="clpp.htmlcue.HtmlTextDisplayer",bS="initial",cS=function(a){return _.li(a,{hh:function(b,c){return b.la(c)}})},dS=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)},eS=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},fS=function(){},gS=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},iS=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return hS[c]});return a},kS=function(a,b){jS(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){jS(a,c)})},jS=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},lS=function(a,b){return 0===a?"0":a+b},mS=function(a,b){return 1>Math.abs(a-b)||a<b},nS=function(a,b){return a<b&&
4
+ 1<Math.abs(a-b)},oS=function(a,b){return a>b&&1<Math.abs(a-b)},pS=function(a,b){return 1>Math.abs(a-b)||a>b},qS=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},rS=function(a){return new qS(a.left,a.f,a.top,a.a,a.height,a.width)},sS=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 qS(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},tS=function(a,b){return b.some(function(c){return nS(a.left,c.f)&&oS(a.f,c.left)&&nS(a.top,c.a)&&oS(a.a,c.top)})},uS=function(a,b){return pS(a.top,b.top)&&mS(a.a,b.a)&&pS(a.left,b.left)&&mS(a.f,b.f)},vS=function(a,b,c){switch(c){case "+x":return nS(a.left,b.left);case "-x":return oS(a.f,b.f);
6
+ case "+y":return nS(a.top,b.top);case "-y":return oS(a.a,b.a);default:throw Error("Unknown axis");}},wS=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},xS=function(a,b,c){wS.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c},zS=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 yS(a)?b:c},CS=function(a,b,c){return yS(a)&&_.M.ra(c)?lS(c,_.If):(AS(a)||
7
+ BS(a))&&_.M.ra(b)?lS(b,"%"):bS},AS=function(a){return a.f.writingMode===_.Dg},BS=function(a){return a.f.writingMode===_.Fg},yS=function(a){return a.f.writingMode===_.pi},DS=function(a,b,c){return(AS(a)||BS(a))&&_.M.ra(c)?lS(c,_.If):AS(a)&&_.M.R(c)?lS(0,_.If):yS(a)&&_.M.ra(b)?lS(b,"%"):bS},ES=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Be:return a.f.position;case "auto":case _.td:return a.f.position-a.f.size/2;case _.Ce:return a.f.position-a.f.size}return 0},
8
+ FS=function(a){switch(a.f.positionAlign){case _.Be:return _.ye;case "auto":case _.td:return _.oi;case _.Ce:return _.Pf}return a.f.textAlign},GS=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ye:case _.ye:return _.Be;case _.oi:return _.td;case _.Pf:case _.Pf:return _.Ce}return a.f.positionAlign},HS=function(a){switch(a.f.writingMode){case _.pi:return"horizontal-tb";case _.Dg:return _.Dg;case _.Fg:return _.Fg;default:throw Error("Unknown writing mode");}},IS=function(a,b){this.l=a;this.f=
9
+ a.a;this.j=void 0===b?!1:b;this.a=sS(a.a);this.h=[]},JS=function(a,b){if(a.j)switch(b.writingMode){case _.pi:return["-y"];case _.Dg:return["+x"];case _.Fg:return["-x"]}var c=[];switch(b.writingMode){case _.pi:c=["+y","-y"];break;case _.Dg:c=["+x","-x"];break;case _.Fg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},KS=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=sS(a.l.a)},LS=function(a,b,c){wS.call(this,a,b,c);this.h=null;this.l=[]},MS=function(a,b){KS(a.h);
10
+ a.l.unshift(b);for(var c=_.w(a.l),d=c.next();!d.done;d=c.next())a.h.append(d.value)},NS=function(a,b){LS.call(this,a.id,"clpp-text-cue-region",b);this.f=a},OS=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.ui)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(YR);},QS=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=PS(this,this.h);this.f=PS(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},
11
+ RS=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.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},SS=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,
12
+ c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},PS=function(a,b,c){var d=document.createElement(_.hg),e=d.dataset;e.name=WR;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);TS(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},TS=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===WR&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
13
+ c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},WS=function(a){_.su.call(this,a);var b=this;this.g=new _.K(aS);this.m=a;this.L=US(a.getConfiguration());this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new QS(a.getSurface().getUniqueCssClass());this.a=new LS(null,"clpp-text-container",{});this.w=new _.Kt(a.getSurface(),this.Qj.bind(this));this.J=null;this.C?(this.C.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
14
+ this.G=new _.Vk(function(){VS(b)});this.A=new Map;this.l=null},US=function(a){a=_.M.$a(a.htmlcue||{});_.M.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.M.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},XS=function(a,b){return a.startTime<=b&&a.endTime>b},VS=function(a,b){if((b||a.j)&&a.C){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.xp){a.J=c;var d=YS(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,ZS(a),
15
+ d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.xu(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.w(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 _.Mg:h="clpp-text-vtt";break;case _.qg:h=$R;break;case _.ni:h=ZR}h&&!g.classList.contains(h)&&_.Yp(g,h);g=sS(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
16
+ else{jS({fontSize:$S(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Mg;var l=e.payloadType===_.qg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new NS(e.region,{}),f.A.set(e.region.id,g),MS(f.a,g)));e=new xS(e,f.L,c);g?MS(g,e):MS(f.a,e)}}}}}},YS=function(a,b){var c=eS(a.f,function(e){return XS(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&XS(a.f[d-1],b);)d--;for(;c+1<a.f.length&&XS(a.f[c+1],b);)c++;return{start:d,
17
+ end:c}},aT=function(a){ZS(a);a.J=null;a.l=null;a.f=[]},ZS=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove($R);b.classList.remove(ZR);a=a.a;KS(a.h);a.l=[]}},$S=function(a,b){var c=sS(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.If}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.If;d=a.getFontSizePercent();return Math.round(c*d)+_.If},bT=function(){},cT=function(){};
18
+ fS.prototype.parse=function(a){a={input:a};for(var b=_.$p(_.Wd),c=[],d=b,e;null!==(e=gS(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=dT[f];h?(h=_.$p(h),(f=eT[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||fT[g.localName]&&fT[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(iS(e)));return b};var dT={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},eT={v:"voice",lang:"lang"},fT={rt:"ruby"},hS={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};wS.prototype.init=function(){this.j=!0};wS.prototype.A=function(){return!1};_.x(xS,wS);xS.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
20
+ xS.prototype.init=function(a){wS.prototype.init.call(this,a);if(this.h)_.Yp(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.qg){var c=_.$p(_.Wd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Mg?b=(new fS).parse(b.payload):(c=_.$p(_.Wd),c.textContent=b.payload,b=c);_.Yp(b,this.w);this.id&&(b.id=this.id);c=_.w(this.f.cssClassList);for(var d=
21
+ c.next();!d.done;d=c.next())_.Yp(b,d.value);jS({writingMode:HS(this)},b);this.a.appendChild(b);_.Yp(this.a,"clpp-text-wrapper");c=_.w(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Yp(this.a,"clpp-text-wrapper__"+d.value);_.M.R(this.f.line)&&(this.f.lineInterpretation=_.qi,this.f.line=yS(this)?-1:0);c=HS(this);jS({writingMode:c,webkitWritingMode:c,direction:bS,textAlign:FS(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=ES(this,GS(this));d=DS(this,c,null);var e=CS(this,
22
+ c,null),f=BS(this)&&_.M.R(null)?lS(0,_.If):bS;jS({position:"absolute",left:d,right:f,top:e,width:yS(this)?lS(this.f.size,"%"):bS,height:AS(this)||BS(this)?lS(this.f.size,"%"):bS},this.a);d=this.f;a=yS(this)?a.height:a.width;e=zS(this);if(d.lineInterpretation===_.qi)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 _.td:g-=f/2;break;case _.le:g-=f}f=Math.round(g/100*a)}BS(this)&&(f=a-f-e);a=f;d=DS(this,c,a);e=BS(this)&&_.M.R(a)?
23
+ lS(0,_.If):bS;jS({left:d,right:e,top:CS(this,c,a)},this.a)}kS(this.C,b)}};xS.prototype.o=function(){return _.$p(_.Wd)};IS.prototype.append=function(a){var b=a.a;b.style.visibility=_.te;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=sS(a.a);var d=JS(this,a.f),e=zS(a),f=rS(c),g=null,h=0;d=_.w(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;vS(c,this.a,l)||uS(c,this.a)&&tS(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||uS(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
24
+ l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>h&&(g=rS(c),h=l);c=rS(f)}c=g||f}jS({top:lS(c.top-this.a.top,_.If),bottom:lS(this.a.a-c.a,_.If),left:lS(c.left-this.a.left,_.If),right:lS(this.a.f-c.f,_.If),height:lS(c.height,_.If),width:lS(c.width,_.If)},a.a)}b.style.visibility="visible";this.h.push(sS(a.a))};_.x(LS,wS);LS.prototype.init=function(){this.h=new IS(this);this.j=!0};LS.prototype.o=function(){var a=_.$p(_.Wd);_.Yp(a,this.w);this.id&&(a.id=this.id);return a};_.x(NS,LS);
25
+ NS.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.ui:b=b.width/100*a.width;break a;default:throw Error(YR);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.ui)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(YR);d=a.height;var e=OS(this,d,a.height);jS(this.B,this.a);jS({left:lS(c,_.If),top:lS(e,_.If),width:lS(b,_.If),height:lS(d,_.If)},this.a);this.f.writingMode&&jS({display:"flex",
26
+ "flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&jS({"justify-content":this.f.displayAlign},this.a);b=_.w(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Yp(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.ui:b=b.height/100*a.height;break a;case 2:b=b.height;d=new xS(new _.ti(0,1,"Lorem ipsum",_.ni),{},{});c=d.a;this.a.appendChild(c);d.init(sS(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(YR);
27
+ }a=OS(this,b,a.height);jS({top:lS(a,_.If),height:lS(b,_.If)},this.a);this.h=new IS(this,!0);this.j=!0};NS.prototype.getId=function(){return this.f.id};QS.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=SS(this,a);if(RS(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
28
+ QS.prototype.destroy=function(){var a=this;return _.I(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.A(b)})};_.x(WS,_.su);_.u=WS.prototype;_.u.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.w(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=dS(this.f,cS(a));this.l=null;VS(this,!1)}};_.u.Mb=function(){null==this.h||VS(this,!0)};
29
+ _.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();aT(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.C.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.A(b)})};_.u.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;VS(this,!0);return!0};_.u.isTextVisible=function(){return this.j};
30
+ _.u.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.xb(.25),this.L.enableResizeObserver&&this.w.start(),VS(this,!0)):(this.G.stop(),this.w.stop(),aT(this)))};_.u.Qj=function(){VS(this,!0)};_.J(aS,WS);WS.prototype.setTextVisibility=WS.prototype.setTextVisibility;WS.prototype.isTextVisible=WS.prototype.isTextVisible;WS.prototype.remove=WS.prototype.remove;WS.prototype.destroy=WS.prototype.destroy;WS.prototype.append=WS.prototype.append;bT.prototype.a=function(a){return!!a.enableHtmlCue&&!_.el()};bT.prototype.create=function(a){return new WS(a)};_.x(cT,_.Us);cT.prototype.f=function(){_.Xo(_.ue,new bT)};cT.prototype.a=function(){_.Vo.has(_.ue)&&(_.Vo["delete"](_.ue),_.Wo.info("Removed factory: 'html'"))};cT.prototype.id=function(){return _.jg};_.J("clpp.htmlcue.HtmlCueComponent",cT);};
31
31
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
32
32
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
33
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 uR="clpp.ima.AdsManagerFactory",vR=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},wR=function(){},xR=function(a){this.a=a},yR=function(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.M.Oa(a.ima||{});this.J=_.M.pa({disableCustomPlayback:!1},a);this.o=this.m.rc("ima").Xc();this.R=this.m.rc("ima").h;this.l=this.m.rc("ima").a;this.L=new _.Lt;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.Rj;this.I=!1;this.w=new _.Xh;this.V=new wR;this.B=
3
- null;this.N=this.H=this.D=this.G=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Vl.bind(this));a.on(this.l,b,this.Ul.bind(this));a.on(this.m,_.se,this.bm.bind(this))},zR=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Kl.bind(a));c.on(b,d.LOADED,a.Ij.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.cm.bind(a));c.on(b,d.STARTED,a.Kj.bind(a));c.on(b,d.LOG,a.Ol.bind(a));c.on(b,
4
- d.AD_PROGRESS,a.Sl.bind(a));c.on(b,d.AD_BUFFERING,a.Ll.bind(a));c.on(b,d.FIRST_QUARTILE,a.Gj.bind(a));c.on(b,d.MIDPOINT,a.Pl.bind(a));c.on(b,d.THIRD_QUARTILE,a.Lj.bind(a));c.on(b,d.PAUSED,a.Rl.bind(a));c.on(b,d.RESUMED,a.Tl.bind(a));c.on(b,d.CLICK,a.Fj.bind(a));c.on(b,d.SKIPPED,a.Jj.bind(a));c.on(b,d.IMPRESSION,a.Hj.bind(a));c.on(b,d.COMPLETE,a.Ml.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.dm.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Xl.bind(a))},AR=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===_.md?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===_.md&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
- [];return b},CR=function(a){a.B=null;BR(a,_.Nc);a.o&&a.m.getSurface().hide(a.o)},DR=function(a){_.$p(a.A,{visibility:"visible"})},BR=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new vR(c,a.G,a.D)});a.m.trigger(new _.L(b,d))},ER=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},FR=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Yj()},HR=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.R.initialize(),
7
- b=!!a.m.getConfiguration().muted,_.y(d,a.L.canPlay(b),2);c=d.f;if(!c&&!FR(a))return BR(a,_.kd),a.g.warn(_.oa),d["return"]();GR(a);_.B(d)})},IR=function(a,b){return _.I(function(c){if(1==c.a)return a.R.initialize(),_.y(c,b.play(),2);GR(a);_.B(c)})},GR=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.I=!0},JR=function(){this.a=this.h=this.f=null},KR=function(){return!window.google||!google.ima||!google.ima.AdsLoader},LR=function(){},MR=function(){this.dd=
8
- new _.K(uR)};_.t=vR.prototype;_.t.Cb=function(){return"Google IMA SDK"};_.t.Db=function(){return google.ima.VERSION};_.t.Jb=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()};
9
- _.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.vc=function(){return this.f?this.f.getIsBumper():!1};_.t.Wb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.$e&&typeof b[d].clickThroughUrl===_.mg});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.Gb=function(){return this.a.getVastMediaWidth()};_.t.Fb=function(){return this.a.getVastMediaHeight()};
10
- _.t.qb=function(){return this.a.getVastMediaBitrate()};_.t.gb=function(){return this.h?2:this.j?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.t.Xb=function(){return this.f?this.f.getTimeOffset():0};_.t.Yb=function(){return this.f?this.f.getAdPosition():1};_.t.Ib=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
- vR.prototype.getWrapperCreativeIds=vR.prototype.getWrapperCreativeIds;vR.prototype.getWrapperAdSystems=vR.prototype.getWrapperAdSystems;vR.prototype.getWrapperAdIds=vR.prototype.getWrapperAdIds;vR.prototype.getSequenceLength=vR.prototype.Ib;vR.prototype.getPositionInSequence=vR.prototype.Yb;vR.prototype.getPodTimeOffset=vR.prototype.Xb;vR.prototype.getPodIndex=vR.prototype.getPodIndex;vR.prototype.getPodType=vR.prototype.gb;vR.prototype.getMediaBitrate=vR.prototype.qb;
12
- vR.prototype.getMediaHeight=vR.prototype.Fb;vR.prototype.getMediaWidth=vR.prototype.Gb;vR.prototype.getMediaUrl=vR.prototype.getMediaUrl;vR.prototype.getClickThroughUrl=vR.prototype.Wb;vR.prototype.isBumper=vR.prototype.vc;vR.prototype.getSkipTimeOffset=vR.prototype.getSkipTimeOffset;vR.prototype.getDuration=vR.prototype.getDuration;vR.prototype.getTitle=vR.prototype.getTitle;vR.prototype.getAdvertiserName=vR.prototype.getAdvertiserName;vR.prototype.getAdSystem=vR.prototype.getAdSystem;
13
- vR.prototype.getApiFramework=vR.prototype.getApiFramework;vR.prototype.getCreativeId=vR.prototype.getCreativeId;vR.prototype.getId=vR.prototype.getId;vR.prototype.getTechnology=vR.prototype.Jb;vR.prototype.getAdManagerVersion=vR.prototype.Db;vR.prototype.getAdManagerName=vR.prototype.Cb;wR.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}};xR.prototype.getCuePoints=function(){return this.a};xR.prototype.Zb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};xR.prototype.sb=function(){return 0<=this.a.indexOf(-1)};xR.prototype.hasPostroll=xR.prototype.sb;xR.prototype.hasPreroll=xR.prototype.Zb;xR.prototype.getCuePoints=xR.prototype.getCuePoints;_.t=yR.prototype;
14
- _.t.Vl=function(a){var b=this;this.a=a.getAdsManager(this.A,AR(this));this.a.isCustomPlaybackUsed()&&!FR(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.dispose()):(this.h=new _.Jt(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new xR(a),this.m.trigger(new _.L(_.Qc,{adsTimeline:this.j})),zR(this));this.f.resolve()};
15
- _.t.Ul=function(a){ER(this,a.getError());this.f.resolve()};_.t.cm=function(a){var b=this;return _.I(function(c){switch(c.a){case 1:return b.H=!0,FR(b)?(b.K=b.m.getPosition(),_.y(c,b.m.detach(),5)):_.y(c,b.m.pause(),4);case 4:_.$p(b.A,{visibility:_.ye});c.F(3);break;case 5:var d=b.m;d.a&&d.a.stopForwardingEventsTo(d);case 3:BR(b,_.zc,a),b.h.start(),_.B(c)}})};_.t.Kl=function(){var a=this;return _.I(function(b){a.a.start();_.B(b)})};
16
- _.t.Ij=function(a){a.getAd().isLinear()?BR(this,_.Gc,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))};_.t.Kj=function(a){this.B=a.getAd().getDuration();BR(this,_.Mc,a);this.m.getSurface().show(this.o)};_.t.Ol=function(a){a=a.getAdData();ER(this,a?a.adError:null);CR(this)};_.t.Sl=function(a){BR(this,_.Jc,a)};_.t.Ll=function(a){BR(this,_.Bc,a)};_.t.Gj=function(a){BR(this,_.Ec,a)};_.t.Pl=function(a){BR(this,_.Hc,a)};_.t.Lj=function(a){BR(this,_.Oc,a)};_.t.Rl=function(a){BR(this,_.Ic,a)};
17
- _.t.Tl=function(a){BR(this,_.Kc,a)};_.t.Fj=function(a){this.pause();BR(this,_.Cc,a)};_.t.Jj=function(a){BR(this,_.Lc,a);CR(this)};_.t.Hj=function(a){BR(this,_.Fc,a)};_.t.Ml=function(a){BR(this,_.Dc,a);CR(this)};
18
- _.t.dm=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.G=!0;if(!FR(a)||null===a.K){if(!a.H)return b["return"](a.m.play());DR(a);b.F(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.y(b,_.Zq(a.m),3);case 3:if(a.D){b.F(2);break}return _.y(b,a.m.seek(a.K),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.D){b.F(6);break}return _.y(b,a.m.play(),6);case 6:BR(a,_.Ac),_.B(b)}})};_.t.Xl=function(){this.N=!0};_.t.bm=function(){this.D=!0;this.l.contentComplete()};
19
- _.t.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.J;try{if(typeof c.adTagUrl!==_.mg)throw new _.N(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.L.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.L.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(f);
20
- return g["return"](a.f)})};_.t.start=function(a){var b=this;return _.I(function(c){return b.a&&b.j&&!b.I?b.j.Zb()?_.y(c,HR(b),0):_.y(c,IR(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)};
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.sb()&&!a.N?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.m.getSurface().hide(a.o)}),_.Yh(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.l.contentComplete()})).then(function(){DR(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};yR.prototype.getPosition=yR.prototype.getPosition;
23
- yR.prototype.setVolume=yR.prototype.setVolume;yR.prototype.getVolume=yR.prototype.getVolume;yR.prototype.skip=yR.prototype.skip;yR.prototype.pause=yR.prototype.pause;yR.prototype.resume=yR.prototype.resume;_.x(JR,_.Gu);_.t=JR.prototype;_.t.onPlayerCreated=function(a){if(KR())return a.onError(new _.N(1,9,1E4));this.f=_.Yp(_.be,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.wa);this.a.getSettings().setPlayerVersion(_.ja);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
- _.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.Nk=function(){return this.a};_.t.Lk=function(){return this.h};_.t.Xc=function(){return this.f};_.t.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",JR);JR.prototype.getAdContainer=JR.prototype.Xc;JR.prototype.getAdDisplayContainer=JR.prototype.Lk;JR.prototype.getAdsLoader=JR.prototype.Nk;JR.Id="ima";
25
- JR.isSdkMissing=KR;LR.prototype.create=function(){return new JR};_.br(new LR);MR.prototype.name=function(){return uR};MR.prototype.isSupported=function(a,b){return a.namespace()===_.Hd?!1:KR()?(this.dd.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};MR.prototype.create=function(a){return new yR(a)};MR.prototype.create=MR.prototype.create;MR.prototype.isSupported=MR.prototype.isSupported;MR.prototype.name=MR.prototype.name;_.Vp(new MR);};
2
+ var f=function(window){var DR="clpp.ima.AdsManagerFactory",ER=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},FR=function(){},GR=function(a){this.a=a},HR=function(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.M.$a(a.ima||{});this.J=_.M.sa({disableCustomPlayback:!1},a);this.o=this.m.uc("ima").bd();this.P=this.m.uc("ima").h;this.l=this.m.uc("ima").a;this.L=new _.Mt;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.Oj;this.I=!1;this.w=new _.Sh;this.V=new FR;this.B=
3
+ null;this.N=this.H=this.C=this.G=!1;this.K=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.am.bind(this));a.on(this.l,b,this.$l.bind(this));a.on(this.m,_.me,this.hm.bind(this))},IR=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Ql.bind(a));c.on(b,d.LOADED,a.Uj.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.im.bind(a));c.on(b,d.STARTED,a.Wj.bind(a));c.on(b,d.LOG,a.Ul.bind(a));c.on(b,
4
+ d.AD_PROGRESS,a.Yl.bind(a));c.on(b,d.AD_BUFFERING,a.Rl.bind(a));c.on(b,d.FIRST_QUARTILE,a.Sj.bind(a));c.on(b,d.MIDPOINT,a.Vl.bind(a));c.on(b,d.THIRD_QUARTILE,a.Xj.bind(a));c.on(b,d.PAUSED,a.Xl.bind(a));c.on(b,d.RESUMED,a.Zl.bind(a));c.on(b,d.CLICK,a.Rj.bind(a));c.on(b,d.SKIPPED,a.Vj.bind(a));c.on(b,d.IMPRESSION,a.Tj.bind(a));c.on(b,d.COMPLETE,a.Sl.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.jm.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.cm.bind(a))},JR=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===_.jd?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===_.jd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
6
+ [];return b},LR=function(a){a.B=null;KR(a,_.Kc);a.o&&a.m.getSurface().hide(a.o)},MR=function(a){_.Zp(a.A,{visibility:"visible"})},KR=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new ER(c,a.G,a.C)});a.m.trigger(new _.L(b,d))},NR=function(a,b){var c=b?a.V.create(b.getErrorCode()):null;a.m.onError(new _.N(1,9,10003,{errorType:c},b))},OR=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Uj()},QR=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.P.initialize(),
7
+ b=!!a.m.getConfiguration().muted,_.y(d,a.L.canPlay(b),2);c=d.f;if(!c&&!OR(a))return KR(a,_.hd),a.g.warn(_.ma),d["return"]();PR(a);_.A(d)})},RR=function(a,b){return _.I(function(c){if(1==c.a)return a.P.initialize(),_.y(c,b.play(),2);PR(a);_.A(c)})},PR=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.I=!0},SR=function(){this.a=this.h=this.f=null},TR=function(){return!window.google||!google.ima||!google.ima.AdsLoader},UR=function(){},VR=function(){this.hd=
8
+ new _.K(DR)};_.u=ER.prototype;_.u.jb=function(){return"Google IMA SDK"};_.u.kb=function(){return google.ima.VERSION};_.u.qb=function(){return 0};_.u.getId=function(){return this.a.getAdId()};_.u.getCreativeId=function(){return this.a.getCreativeId()};_.u.getApiFramework=function(){return this.a.getApiFramework()};_.u.getAdSystem=function(){return this.a.getAdSystem()};_.u.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.u.getTitle=function(){return this.a.getTitle()};
9
+ _.u.getDuration=function(){return this.a.getDuration()};_.u.getPosition=function(){return 0};_.u.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.u.Sb=function(){return this.f?this.f.getIsBumper():!1};_.u.yb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ue&&typeof b[d].clickThroughUrl===_.fg});c&&(a=b[c].clickThroughUrl);return a};_.u.getMediaUrl=function(){return this.a.getMediaUrl()};_.u.ob=function(){return this.a.getVastMediaWidth()};
10
+ _.u.nb=function(){return this.a.getVastMediaHeight()};_.u.ab=function(){return this.a.getVastMediaBitrate()};_.u.Ua=function(){return this.h?2:this.j?1:0};_.u.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.u.Cb=function(){return this.f?this.f.getTimeOffset():0};_.u.Db=function(){return this.f?this.f.getAdPosition():1};_.u.pb=function(){return this.f?this.f.getTotalAds():1};_.u.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.u.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};
11
+ _.u.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};ER.prototype.getWrapperCreativeIds=ER.prototype.getWrapperCreativeIds;ER.prototype.getWrapperAdSystems=ER.prototype.getWrapperAdSystems;ER.prototype.getWrapperAdIds=ER.prototype.getWrapperAdIds;ER.prototype.getSequenceLength=ER.prototype.pb;ER.prototype.getPositionInSequence=ER.prototype.Db;ER.prototype.getPodTimeOffset=ER.prototype.Cb;ER.prototype.getPodIndex=ER.prototype.getPodIndex;ER.prototype.getPodType=ER.prototype.Ua;
12
+ ER.prototype.getMediaBitrate=ER.prototype.ab;ER.prototype.getMediaHeight=ER.prototype.nb;ER.prototype.getMediaWidth=ER.prototype.ob;ER.prototype.getMediaUrl=ER.prototype.getMediaUrl;ER.prototype.getClickThroughUrl=ER.prototype.yb;ER.prototype.isBumper=ER.prototype.Sb;ER.prototype.getSkipTimeOffset=ER.prototype.getSkipTimeOffset;ER.prototype.getPosition=ER.prototype.getPosition;ER.prototype.getDuration=ER.prototype.getDuration;ER.prototype.getTitle=ER.prototype.getTitle;
13
+ ER.prototype.getAdvertiserName=ER.prototype.getAdvertiserName;ER.prototype.getAdSystem=ER.prototype.getAdSystem;ER.prototype.getApiFramework=ER.prototype.getApiFramework;ER.prototype.getCreativeId=ER.prototype.getCreativeId;ER.prototype.getId=ER.prototype.getId;ER.prototype.getTechnology=ER.prototype.qb;ER.prototype.getAdManagerVersion=ER.prototype.kb;ER.prototype.getAdManagerName=ER.prototype.jb;FR.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}};GR.prototype.getCuePoints=function(){return this.a};GR.prototype.Fb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};GR.prototype.Eb=function(){return 0<=this.a.indexOf(-1)};GR.prototype.hasPostroll=GR.prototype.Eb;GR.prototype.hasPreroll=GR.prototype.Fb;GR.prototype.getCuePoints=GR.prototype.getCuePoints;_.u=HR.prototype;
14
+ _.u.am=function(a){var b=this;this.a=a.getAdsManager(this.A,JR(this));this.a.isCustomPlaybackUsed()&&!OR(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.N(1,9,10002)),this.pc()):(this.h=new _.Kt(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new GR(a),this.m.trigger(new _.L(_.Nc,{adsTimeline:this.j})),IR(this));this.f.resolve()};
15
+ _.u.$l=function(a){NR(this,a.getError());this.f.resolve()};_.u.im=function(a){var b=this;return _.I(function(c){switch(c.a){case 1:return b.H=!0,OR(b)?(b.K=b.m.getPosition(),_.y(c,b.m.detach(),5)):_.y(c,b.m.pause(),4);case 4:_.Zp(b.A,{visibility:_.te});c.F(3);break;case 5:var d=b.m;d.a&&d.a.stopForwardingEventsTo(d);case 3:KR(b,_.uc,a),b.h.start(),_.A(c)}})};_.u.Ql=function(){var a=this;return _.I(function(b){a.a.start();_.A(b)})};
16
+ _.u.Uj=function(a){a.getAd().isLinear()?KR(this,_.Dc,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))};_.u.Wj=function(a){this.B=a.getAd().getDuration();KR(this,_.Jc,a);this.m.getSurface().show(this.o)};_.u.Ul=function(a){a=a.getAdData();NR(this,a?a.adError:null);LR(this)};_.u.Yl=function(a){KR(this,_.Gc,a)};_.u.Rl=function(a){KR(this,_.wc,a)};_.u.Sj=function(a){KR(this,_.zc,a)};_.u.Vl=function(a){KR(this,_.Ec,a)};_.u.Xj=function(a){KR(this,_.Lc,a)};_.u.Xl=function(a){KR(this,_.Fc,a)};
17
+ _.u.Zl=function(a){KR(this,_.Hc,a)};_.u.Rj=function(a){this.pause();KR(this,_.xc,a)};_.u.Vj=function(a){KR(this,_.Ic,a);LR(this)};_.u.Tj=function(a){KR(this,_.Cc,a)};_.u.Sl=function(a){KR(this,_.yc,a);LR(this)};
18
+ _.u.jm=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.G=!0;if(!OR(a)||null===a.K){if(!a.H)return b["return"](a.m.play());MR(a);b.F(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.y(b,_.ns(a.m),3);case 3:if(a.C){b.F(2);break}return _.y(b,a.m.seek(a.K),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.C){b.F(6);break}return _.y(b,a.m.play(),6);case 6:KR(a,_.vc),_.A(b)}})};_.u.cm=function(){this.N=!0};_.u.hm=function(){this.C=!0;this.l.contentComplete()};
19
+ _.u.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.J;try{if(typeof c.adTagUrl!==_.fg)throw new _.N(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.L.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.L.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(f);
20
+ return g["return"](a.f)})};_.u.start=function(a){var b=this;return _.I(function(c){return b.a&&b.j&&!b.I?b.j.Fb()?_.y(c,QR(b),0):_.y(c,RR(b,a),0):_.y(c,a.play(),0)})};_.u.Vc=function(){};_.u.Rc=function(){return!0};_.u.resume=function(){this.a&&this.a.resume()};_.u.pause=function(){this.a&&this.a.pause()};_.u.skip=function(){this.a&&this.a.skip()};_.u.getVolume=function(){return this.a?this.a.getVolume():1};_.u.setVolume=function(a){this.a&&this.a.setVolume(a)};
21
+ _.u.getPosition=function(){if(!this.a||null===this.B)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.B-a};
22
+ _.u.pc=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.Eb()&&!a.N?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.m.getSurface().hide(a.o)}),_.Th(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.l.contentComplete()})).then(function(){MR(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};HR.prototype.getPosition=HR.prototype.getPosition;
23
+ HR.prototype.setVolume=HR.prototype.setVolume;HR.prototype.getVolume=HR.prototype.getVolume;HR.prototype.skip=HR.prototype.skip;HR.prototype.pause=HR.prototype.pause;HR.prototype.resume=HR.prototype.resume;_.x(SR,_.Cu);_.u=SR.prototype;_.u.onPlayerCreated=function(a){if(TR())return a.onError(new _.N(1,9,1E4));this.f=_.Xp(_.Wd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.va);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
24
+ _.u.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.u.Xk=function(){return this.a};_.u.Vk=function(){return this.h};_.u.bd=function(){return this.f};_.u.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",SR);SR.prototype.getAdContainer=SR.prototype.bd;SR.prototype.getAdDisplayContainer=SR.prototype.Vk;SR.prototype.getAdsLoader=SR.prototype.Xk;SR.Id="ima";
25
+ SR.isSdkMissing=TR;UR.prototype.create=function(){return new SR};_.qs(new UR);VR.prototype.name=function(){return DR};VR.prototype.a=function(a,b){return a.namespace()===_.Bd?!1:TR()?(this.hd.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};VR.prototype.create=function(a){return new HR(a)};_.Rp(new VR);};
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));}