@castlabs/prestoplay 6.8.0 → 6.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +109 -109
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +407 -407
  8. package/cjs/cl.crypto.js +8 -8
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +25 -25
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +72 -67
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -31
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +272 -272
  17. package/cjs/cl.muxdata.js +15 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -71
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +19 -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 -88
  34. package/cl.conviva.js +26 -26
  35. package/cl.core.js +259 -259
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +25 -25
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +61 -58
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +17 -17
  44. package/cl.mse.js +199 -199
  45. package/cl.muxdata.js +11 -11
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +16 -16
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +7 -7
  55. package/cl.vr.js +14 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +14 -14
  58. package/package.json +1 -1
  59. package/typings.d.ts +27 -0
package/cl.htmlcue.js CHANGED
@@ -1,25 +1,25 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var OI="Unsupported unit",PI="clpp-text-plain",QI="clpp-text-ttml",RI="clpp.htmlcue.HtmlTextDisplayer",SI="initial",TI=function(a,b){let c=0,d=a.length-1;for(;c<=d;){const e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},UI=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},WI=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>VI[c]);return a},YI=
2
- function(a,b){XI(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{XI(a,c)})},XI=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},ZI=function(a,b){return 0===a?"0":a+b},$I=function(a,b){return 1>Math.abs(a-b)||a<b},aJ=function(a,b){return a<b&&1<Math.abs(a-b)},bJ=function(a,b){return a>b&&1<Math.abs(a-b)},cJ=function(a,b){return 1>Math.abs(a-b)||a>b},eJ=function(a){const b=a.getBoundingClientRect();var c=getComputedStyle(a,null);const d=parseFloat(c.getPropertyValue("border-left-width"))||
3
- 0,e=parseFloat(c.getPropertyValue("border-right-width"))||0;var f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;const g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new dJ(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},fJ=function(a){return new dJ(a.f,a.g,a.h,a.a,a.height,a.width)},gJ=function(a,b){return b.some(c=>aJ(a.f,c.g)&&bJ(a.g,c.f)&&aJ(a.h,c.a)&&bJ(a.a,c.h))},hJ=function(a,b){return cJ(a.h,
4
- b.h)&&$I(a.a,b.a)&&cJ(a.f,b.f)&&$I(a.g,b.g)},iJ=function(a,b,c){switch(c){case "+x":return aJ(a.f,b.f);case "-x":return bJ(a.g,b.g);case "+y":return aJ(a.h,b.h);case "-y":return bJ(a.a,b.a);default:throw Error("Unknown axis");}},jJ=function(a){return a.f.writingMode===_.no},kJ=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect();const d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return jJ(a)?b:c},lJ=function(a){switch(a.f.writingMode){case _.no:return"horizontal-tb";case _.Ee:return _.Ee;
5
- case _.Fe:return _.Fe;default:throw Error("Unknown writing mode");}},mJ=function(a){switch(a.f.positionAlign){case _.ld:return _.hd;case "auto":case _.tc:return _.mo;case _.md:return _.ce}return a.f.textAlign},nJ=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===_.r)switch(b){case _.ld:return a.f.position;case "auto":case _.tc:return a.f.position-a.f.size/2;case _.md:return a.f.position-a.f.size}return 0},oJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.hd:case _.hd:return _.ld;
6
- case _.mo:return _.tc;case _.ce:case _.ce:return _.md}return a.f.positionAlign},rJ=function(a,b,c){return(pJ(a)||qJ(a))&&_.qf(c)?ZI(c,_.Wd):pJ(a)&&_.B(c)?ZI(0,_.Wd):jJ(a)&&_.qf(b)?ZI(b,"%"):SI},sJ=function(a,b,c){return jJ(a)&&_.qf(c)?ZI(c,_.Wd):(pJ(a)||qJ(a))&&_.qf(b)?ZI(b,"%"):SI},qJ=function(a){return a.f.writingMode===_.Fe},pJ=function(a){return a.f.writingMode===_.Ee},tJ=function(a,b){if(a.h)switch(b.writingMode){case _.no:return["-y"];case _.Ee:return["+x"];case _.Fe:return["-x"]}a=[];switch(b.writingMode){case _.no:a=
7
- ["+y","-y"];break;case _.Ee:a=["+x","-x"];break;case _.Fe:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},uJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=eJ(a.j.a)},vJ=function(a,b){uJ(a.g);a.j.unshift(b);for(const c of a.j)a.g.append(c)},wJ=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.uo)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(OI);},yJ=function(a,b,c,d){const e=document.createElement(_.oe),
8
- f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);xJ(a,c,b);a.f.debug(`Created HTML style element #${b}.`);return e.sheet},zJ=function(a,b){a=`.${a.j} .clpp-text-container`;const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,`${a} $1`).replace(/::cue\(([^)]+)\)/g,`${c} $1`).replace(/::cue-region\(([^)]+)\)/g,`${a} $1 .clpp-text-cue`).replace(/::cue/g,c).replace(/::cue-region/g,`${a} .clpp-text-cue-region .clpp-text-cue`).replace(/::ttml/g,
9
- a)},AJ=function(a,b){let c=!1;try{a.g.insertRule(b,0);const d=a.g.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},BJ=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.m=[]}},xJ=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.f.error(`PRESTOplay HTML style element #${c} has `+"been unexpectedly removed! Some styles will not work!")})})});
10
- d.observe(b,{subtree:!1,childList:!0});a.o.push(()=>d.disconnect())},CJ=function(a){a=_.kf(a.getConfiguration().htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},IJ=function(a,b){if((b||a.j)&&a.C){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.Hl)if(a.I=c,c=DJ(a,c),b||(b=a.m,b=!(null===b&&null===c||null!==b&&null!==c&&b.start===c.start&&b.end===c.end)),b&&(a.m=c,EJ(a),c)){b={color:a.getFontColor()||void 0,
11
- backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.co(a)||void 0};c=a.f.slice(c.start,c.end+1);for(const k of c){c=a;var d=k,e=b,f=c.a.a,g=null;switch(d.payloadType){case _.Oe:g="clpp-text-vtt";break;case _.we:g=QI;break;case _.lo:g=PI}g&&!f.classList.contains(g)&&_.bm(f,g);f=eJ(c.a.a);if(0===f.width||0===f.height)c.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.");
12
- else{XI({fontSize:FJ(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.Oe;var h=d.payloadType===_.we;d.region&&(g||h||d.backgroundImage)&&(c.A.has(d.region.id)?f=c.A.get(d.region.id):(f=new GJ(d.region,{}),c.A.set(d.region.id,f),vJ(c.a,f)));d=new HJ(d,c.K,e);f?vJ(f,d):vJ(c.a,d)}}}}},JJ=function(a){EJ(a);a.I=null;a.m=null;a.f=[]},KJ=function(a,b){return a.startTime<=b&&a.endTime>b},DJ=function(a,b){var c=TI(a.f,d=>KJ(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=
13
- c;for(;0<=d-1&&KJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&KJ(a.f[c+1],b);)c++;return{start:d,end:c}}},EJ=function(a){a.A.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(QI);b.classList.remove(PI);a=a.a;uJ(a.g);a.j=[]}},FJ=function(a,b){const c=eJ(a.a.a).height;if(null!==a.H)return a.getFontSize();if(null!==a.B)return a=a.getFontSizePercent(),`${Math.round(c*a)}px`;if(typeof b===_.r&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*
14
- a)}px`},OJ=class{parse(a){a={input:a};const b=_.dm(_.Qc),c=[];let d=b;for(var e;null!==(e=UI(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=LJ[f];h?(h=_.dm(h),(f=MJ[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||NJ[g.localName]&&NJ[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),
15
- d.appendChild(g),d=g)}}else d.appendChild(document.createTextNode(WI(e)));return b}},LJ={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},MJ={v:"voice",lang:"lang"},NJ={rt:"ruby"},VI={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var dJ=class{constructor(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=f}};var PJ=class{constructor(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1}init(){this.h=!0}w(){return!1}};var HJ=class extends PJ{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c}w(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.g)_.bm(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===_.we){var c=_.dm(_.Qc);c.innerHTML=b.payload;b=c}else b.payloadType===
16
- _.Oe?b=(new OJ).parse(b.payload):(c=_.dm(_.Qc),c.textContent=b.payload,b=c);_.bm(b,this.o);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.bm(b,d);XI({writingMode:lJ(this)},b);var d=b;this.a.appendChild(d);_.bm(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.bm(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.oo,this.f.line=jJ(this)?-1:0);e=lJ(this);XI({writingMode:e,webkitWritingMode:e,direction:SI,textAlign:mJ(this)},this.a);if(!this.f.region||
17
- !this.f.region.displayAlign){e=nJ(this,oJ(this));XI({position:"absolute",left:rJ(this,e,null),right:qJ(this)&&_.B(null)?ZI(0,_.Wd):SI,top:sJ(this,e,null),width:jJ(this)?ZI(this.f.size,"%"):SI,height:pJ(this)||qJ(this)?ZI(this.f.size,"%"):SI},this.a);b=this.f;a=jJ(this)?a.height:a.width;c=kJ(this);if(b.lineInterpretation===_.oo){var f=c*Math.round(b.line);Math.abs(f)>a&&(f=c*(0>b.line?0:-1));0>f&&(f+=a)}else{f=c/a*100;let g=b.line;switch(b.lineAlign){case _.tc:g-=f/2;break;case _.Yc:g-=f}f=Math.round(g/
18
- 100*a)}qJ(this)&&(f=a-f-c);a=f;XI({left:rJ(this,e,a),right:qJ(this)&&_.B(a)?ZI(0,_.Wd):SI,top:sJ(this,e,a)},this.a)}YI(this.B,d)}}m(){return _.dm(_.Qc)}};var QJ=class{constructor(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=eJ(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.dd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=eJ(a.a);var d=tJ(this,a.f),e=kJ(a);const g=fJ(c);let h=null,k=0;for(const l of d){for(;iJ(c,this.a,l)||hJ(c,this.a)&&gJ(c,this.g);){d=c;var f=e;switch(l){case "+x":d.f+=f;d.g+=f;break;case "-x":d.f-=f;d.g-=f;break;case "+y":d.h+=f;d.a+=f;break;case "-y":d.h-=f,d.a-=f}}if(this.h||hJ(c,this.a))break a;
19
- d=this.a;d=Math.max(0,Math.min(c.g,d.g)-Math.max(c.f,d.f))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.h,d.h))/(c.height*c.width);d>k&&(h=fJ(c),k=d);c=fJ(g)}c=h||g}XI({top:ZI(c.h-this.a.h,_.Wd),bottom:ZI(this.a.a-c.a,_.Wd),left:ZI(c.f-this.a.f,_.Wd),right:ZI(this.a.g-c.g,_.Wd),height:ZI(c.height,_.Wd),width:ZI(c.width,_.Wd)},a.a)}b.style.visibility="visible";this.g.push(eJ(a.a))}};var RJ=class extends PJ{constructor(a,b,c){super(a,b,c);this.g=null;this.j=[]}init(){this.g=new QJ(this);this.h=!0}m(){const a=_.dm(_.Qc);_.bm(a,this.o);this.id&&(a.id=this.id);return a}};var GJ=class extends RJ{constructor(a,b){super(a.id,"clpp-text-cue-region",b);this.f=a}init(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.uo:b=b.width/100*a.width;break a;default:throw Error(OI);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.uo)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(OI);d=a.height;const e=wJ(this,d,a.height);XI(this.A,this.a);XI({left:ZI(c,_.Wd),top:ZI(e,_.Wd),width:ZI(b,
20
- _.Wd),height:ZI(d,_.Wd)},this.a);this.f.writingMode&&XI({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&XI({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.bm(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.uo:f=f.height/100*a.height;break a;case 2:f=f.height;c=new HJ(new _.ro(0,1,"Lorem ipsum",_.lo),{},{});b=c.a;this.a.appendChild(b);c.init(eJ(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
21
- b=c;f*=b;break a;default:throw Error(OI);}a=wJ(this,f,a.height);XI({top:ZI(a,_.Wd),height:ZI(f,_.Wd)},this.a);this.g=new QJ(this,!0);this.h=!0}getId(){return this.f.id}};var SJ=class{constructor(a,b){this.f=new _.P("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.m=[];this.a=yJ(this,this.h,this.j);this.g=yJ(this,this.h,this.j,!0);this.g.disabled=!0;this.f.debug(`Stylesheet ${this.h} has been created.`)}appendRule(a){if(null!=this.a&&!this.m.some(b=>b===a)){const b=zJ(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.m.push(a)}else this.f.warn(`Stylesheet ${this.h} ignoring the CSS rule `+
22
- `because it's not safe: ${b}`)}}destroy(){const a=this;return _.y(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],BJ(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.g.ownerNode),a.a=null,a.g=null,a.f.debug(`Stylesheet ${a.h} has been destroyed.`))})}};var TJ=class extends _.Yp{constructor(a){super(a);this.L=new _.P(RI);this.l=a;this.K=CJ(a);this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new SJ(a,"CLPP Subtitle Styles");this.a=new RJ(null,"clpp-text-container",{});this.w=new _.Tp(a.getSurface(),this.U.bind(this));this.I=null;this.C?(this.C.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.F=
23
- new _.Yh(()=>{IJ(this)});this.A=new Map;this.m=null}append(a,b){if(null!=this.h&&0!==a.length){for(const c of b)this.h.appendRule(c);a.sort((c,d)=>c.startTime!==d.startTime?c.startTime-d.startTime:c.endTime-d.endTime);b=this.f.findIndex(c=>c.startTime>=a[0].startTime);0===b?this.f=[]:0<b&&this.f.splice(0,b);for(const c of a)this.f.some(d=>d.payload!==c.payload?!1:d.startTime!==c.startTime?!1:d.endTime!==c.endTime?!1:!0)||this.f.push(c);this.m=null;IJ(this,!1)}}g(){null==this.h||IJ(this,!0)}destroy(){const a=
24
- this;return _.y(function*(){null!=a.h&&(JJ(a),a.F.stop(),yield a.h.destroy(),a.h=null,a.C.removeChild(a.a.a),a.a=null,a.w.stop(),a.w=null,a.j=!1)})}remove(a,b){if(null==this.h)return!1;this.f=this.f.filter(c=>c.startTime<a||c.endTime>=b);this.m=null;IJ(this,!0);return!0}isTextVisible(){return this.j}setTextVisibility(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.F.Va(.25),this.K.enableResizeObserver&&this.w.start(),IJ(this,!0)):(this.F.stop(),this.w.stop(),JJ(this)))}U(){IJ(this,!0)}};_.A(RI,TJ);
25
- TJ.prototype.setTextVisibility=TJ.prototype.setTextVisibility;TJ.prototype.isTextVisible=TJ.prototype.isTextVisible;TJ.prototype.remove=TJ.prototype.remove;TJ.prototype.destroy=TJ.prototype.destroy;TJ.prototype.append=TJ.prototype.append;var UJ=class{da(a){return!!a.enableHtmlCue&&!_.ni()}create(a){return new TJ(a)}};_.A("clpp.htmlcue.HtmlCueComponent",class extends _.Ap{f(){_.ll("html",new UJ)}a(){}id(){return _.pe}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var cJ="Unsupported unit",dJ="clpp-text-plain",eJ="clpp-text-ttml",fJ="clpp.htmlcue.HtmlTextDisplayer",gJ="initial",hJ=function(a,b){let c=0,d=a.length-1;for(;c<=d;){const e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},iJ=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},kJ=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>jJ[c]);return a},mJ=
2
+ function(a,b){lJ(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{lJ(a,c)})},lJ=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},nJ=function(a,b){return 0===a?"0":a+b},oJ=function(a,b){return 1>Math.abs(a-b)||a<b},pJ=function(a,b){return a<b&&1<Math.abs(a-b)},qJ=function(a,b){return a>b&&1<Math.abs(a-b)},rJ=function(a,b){return 1>Math.abs(a-b)||a>b},tJ=function(a){const b=a.getBoundingClientRect();var c=getComputedStyle(a,null);const d=parseFloat(c.getPropertyValue("border-left-width"))||
3
+ 0,e=parseFloat(c.getPropertyValue("border-right-width"))||0;var f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;const g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new sJ(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},uJ=function(a){return new sJ(a.f,a.g,a.h,a.a,a.height,a.width)},vJ=function(a,b){return b.some(c=>pJ(a.f,c.g)&&qJ(a.g,c.f)&&pJ(a.h,c.a)&&qJ(a.a,c.h))},wJ=function(a,b){return rJ(a.h,
4
+ b.h)&&oJ(a.a,b.a)&&rJ(a.f,b.f)&&oJ(a.g,b.g)},xJ=function(a,b,c){switch(c){case "+x":return pJ(a.f,b.f);case "-x":return qJ(a.g,b.g);case "+y":return pJ(a.h,b.h);case "-y":return qJ(a.a,b.a);default:throw Error("Unknown axis");}},yJ=function(a){return a.f.writingMode===_.no},zJ=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect();const d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return yJ(a)?b:c},AJ=function(a){switch(a.f.writingMode){case _.no:return"horizontal-tb";case _.Ee:return _.Ee;
5
+ case _.Fe:return _.Fe;default:throw Error("Unknown writing mode");}},BJ=function(a){switch(a.f.positionAlign){case _.ld:return _.fd;case "auto":case _.sc:return _.mo;case _.md:return _.ce}return a.f.textAlign},CJ=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===_.r)switch(b){case _.ld:return a.f.position;case "auto":case _.sc:return a.f.position-a.f.size/2;case _.md:return a.f.position-a.f.size}return 0},DJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.fd:case _.fd:return _.ld;
6
+ case _.mo:return _.sc;case _.ce:case _.ce:return _.md}return a.f.positionAlign},GJ=function(a,b,c){return(EJ(a)||FJ(a))&&_.qf(c)?nJ(c,_.Wd):EJ(a)&&_.C(c)?nJ(0,_.Wd):yJ(a)&&_.qf(b)?nJ(b,"%"):gJ},HJ=function(a,b,c){return yJ(a)&&_.qf(c)?nJ(c,_.Wd):(EJ(a)||FJ(a))&&_.qf(b)?nJ(b,"%"):gJ},FJ=function(a){return a.f.writingMode===_.Fe},EJ=function(a){return a.f.writingMode===_.Ee},IJ=function(a,b){if(a.h)switch(b.writingMode){case _.no:return["-y"];case _.Ee:return["+x"];case _.Fe:return["-x"]}a=[];switch(b.writingMode){case _.no:a=
7
+ ["+y","-y"];break;case _.Ee:a=["+x","-x"];break;case _.Fe:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},JJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=tJ(a.j.a)},KJ=function(a,b){JJ(a.g);a.j.unshift(b);for(const c of a.j)a.g.append(c)},LJ=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.uo)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(cJ);},NJ=function(a,b,c,d){const e=document.createElement(_.oe),
8
+ f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);MJ(a,c,b);a.f.debug(`Created HTML style element #${b}.`);return e.sheet},OJ=function(a,b){a=`.${a.j} .clpp-text-container`;const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,`${a} $1`).replace(/::cue\(([^)]+)\)/g,`${c} $1`).replace(/::cue-region\(([^)]+)\)/g,`${a} $1 .clpp-text-cue`).replace(/::cue/g,c).replace(/::cue-region/g,`${a} .clpp-text-cue-region .clpp-text-cue`).replace(/::ttml/g,
9
+ a)},PJ=function(a,b){let c=!1;try{a.g.insertRule(b,0);const d=a.g.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},QJ=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.m=[]}},MJ=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.f.error(`PRESTOplay HTML style element #${c} has `+"been unexpectedly removed! Some styles will not work!")})})});
10
+ d.observe(b,{subtree:!1,childList:!0});a.o.push(()=>d.disconnect())},RJ=function(a){a=_.kf(a.getConfiguration().htmlcue||{});_.C(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.C(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},XJ=function(a,b){if((b||a.j)&&a.C){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.Hl)if(a.I=c,c=SJ(a,c),b||(b=a.m,b=!(null===b&&null===c||null!==b&&null!==c&&b.start===c.start&&b.end===c.end)),b&&(a.m=c,TJ(a),c)){b={color:a.getFontColor()||void 0,
11
+ backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.co(a)||void 0};c=a.f.slice(c.start,c.end+1);for(const k of c){c=a;var d=k,e=b,f=c.a.a,g=null;switch(d.payloadType){case _.Oe:g="clpp-text-vtt";break;case _.we:g=eJ;break;case _.lo:g=dJ}g&&!f.classList.contains(g)&&_.bm(f,g);f=tJ(c.a.a);if(0===f.width||0===f.height)c.M.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.");
12
+ else{lJ({fontSize:UJ(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.Oe;var h=d.payloadType===_.we;d.region&&(g||h||d.backgroundImage)&&(c.A.has(d.region.id)?f=c.A.get(d.region.id):(f=new VJ(d.region,{}),c.A.set(d.region.id,f),KJ(c.a,f)));d=new WJ(d,c.K,e);f?KJ(f,d):KJ(c.a,d)}}}}},YJ=function(a){TJ(a);a.I=null;a.m=null;a.f=[]},ZJ=function(a,b){return a.startTime<=b&&a.endTime>b},SJ=function(a,b){var c=hJ(a.f,d=>ZJ(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=
13
+ c;for(;0<=d-1&&ZJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&ZJ(a.f[c+1],b);)c++;return{start:d,end:c}}},TJ=function(a){a.A.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(eJ);b.classList.remove(dJ);a=a.a;JJ(a.g);a.j=[]}},UJ=function(a,b){const c=tJ(a.a.a).height;if(null!==a.H)return a.getFontSize();if(null!==a.B)return a=a.getFontSizePercent(),`${Math.round(c*a)}px`;if(typeof b===_.r&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*
14
+ a)}px`},cK=class{parse(a){a={input:a};const b=_.dm(_.Oc),c=[];let d=b;for(var e;null!==(e=iJ(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=$J[f];h?(h=_.dm(h),(f=aK[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||bK[g.localName]&&bK[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),
15
+ d.appendChild(g),d=g)}}else d.appendChild(document.createTextNode(kJ(e)));return b}},$J={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},aK={v:"voice",lang:"lang"},bK={rt:"ruby"},jJ={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var sJ=class{constructor(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=f}};var dK=class{constructor(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1}init(){this.h=!0}w(){return!1}};var WJ=class extends dK{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c}w(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.g)_.bm(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===_.we){var c=_.dm(_.Oc);c.innerHTML=b.payload;b=c}else b.payloadType===
16
+ _.Oe?b=(new cK).parse(b.payload):(c=_.dm(_.Oc),c.textContent=b.payload,b=c);_.bm(b,this.o);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.bm(b,d);lJ({writingMode:AJ(this)},b);var d=b;this.a.appendChild(d);_.bm(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.bm(this.a,`clpp-text-wrapper__${e}`);_.C(this.f.line)&&(this.f.lineInterpretation=_.oo,this.f.line=yJ(this)?-1:0);e=AJ(this);lJ({writingMode:e,webkitWritingMode:e,direction:gJ,textAlign:BJ(this)},this.a);if(!this.f.region||
17
+ !this.f.region.displayAlign){e=CJ(this,DJ(this));lJ({position:"absolute",left:GJ(this,e,null),right:FJ(this)&&_.C(null)?nJ(0,_.Wd):gJ,top:HJ(this,e,null),width:yJ(this)?nJ(this.f.size,"%"):gJ,height:EJ(this)||FJ(this)?nJ(this.f.size,"%"):gJ},this.a);b=this.f;a=yJ(this)?a.height:a.width;c=zJ(this);if(b.lineInterpretation===_.oo){var f=c*Math.round(b.line);Math.abs(f)>a&&(f=c*(0>b.line?0:-1));0>f&&(f+=a)}else{f=c/a*100;let g=b.line;switch(b.lineAlign){case _.sc:g-=f/2;break;case _.Wc:g-=f}f=Math.round(g/
18
+ 100*a)}FJ(this)&&(f=a-f-c);a=f;lJ({left:GJ(this,e,a),right:FJ(this)&&_.C(a)?nJ(0,_.Wd):gJ,top:HJ(this,e,a)},this.a)}mJ(this.B,d)}}m(){return _.dm(_.Oc)}};var eK=class{constructor(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=tJ(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.bd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=tJ(a.a);var d=IJ(this,a.f),e=zJ(a);const g=uJ(c);let h=null,k=0;for(const l of d){for(;xJ(c,this.a,l)||wJ(c,this.a)&&vJ(c,this.g);){d=c;var f=e;switch(l){case "+x":d.f+=f;d.g+=f;break;case "-x":d.f-=f;d.g-=f;break;case "+y":d.h+=f;d.a+=f;break;case "-y":d.h-=f,d.a-=f}}if(this.h||wJ(c,this.a))break a;
19
+ d=this.a;d=Math.max(0,Math.min(c.g,d.g)-Math.max(c.f,d.f))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.h,d.h))/(c.height*c.width);d>k&&(h=uJ(c),k=d);c=uJ(g)}c=h||g}lJ({top:nJ(c.h-this.a.h,_.Wd),bottom:nJ(this.a.a-c.a,_.Wd),left:nJ(c.f-this.a.f,_.Wd),right:nJ(this.a.g-c.g,_.Wd),height:nJ(c.height,_.Wd),width:nJ(c.width,_.Wd)},a.a)}b.style.visibility="visible";this.g.push(tJ(a.a))}};var fK=class extends dK{constructor(a,b,c){super(a,b,c);this.g=null;this.j=[]}init(){this.g=new eK(this);this.h=!0}m(){const a=_.dm(_.Oc);_.bm(a,this.o);this.id&&(a.id=this.id);return a}};var VJ=class extends fK{constructor(a,b){super(a.id,"clpp-text-cue-region",b);this.f=a}init(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.uo:b=b.width/100*a.width;break a;default:throw Error(cJ);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.uo)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(cJ);d=a.height;const e=LJ(this,d,a.height);lJ(this.A,this.a);lJ({left:nJ(c,_.Wd),top:nJ(e,_.Wd),width:nJ(b,
20
+ _.Wd),height:nJ(d,_.Wd)},this.a);this.f.writingMode&&lJ({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&lJ({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.bm(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.uo:f=f.height/100*a.height;break a;case 2:f=f.height;c=new WJ(new _.ro(0,1,"Lorem ipsum",_.lo),{},{});b=c.a;this.a.appendChild(b);c.init(tJ(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
21
+ b=c;f*=b;break a;default:throw Error(cJ);}a=LJ(this,f,a.height);lJ({top:nJ(a,_.Wd),height:nJ(f,_.Wd)},this.a);this.g=new eK(this,!0);this.h=!0}getId(){return this.f.id}};var gK=class{constructor(a,b){this.f=new _.O("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.m=[];this.a=NJ(this,this.h,this.j);this.g=NJ(this,this.h,this.j,!0);this.g.disabled=!0;this.f.debug(`Stylesheet ${this.h} has been created.`)}appendRule(a){if(null!=this.a&&!this.m.some(b=>b===a)){const b=OJ(this,a);if(PJ(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.m.push(a)}else this.f.warn(`Stylesheet ${this.h} ignoring the CSS rule `+
22
+ `because it's not safe: ${b}`)}}destroy(){const a=this;return _.y(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],QJ(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.g.ownerNode),a.a=null,a.g=null,a.f.debug(`Stylesheet ${a.h} has been destroyed.`))})}};var hK=class extends _.Xp{constructor(a){super(a);this.M=new _.O(fJ);this.l=a;this.K=RJ(a);this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new gK(a,"CLPP Subtitle Styles");this.a=new fK(null,"clpp-text-container",{});this.w=new _.Sp(a.getSurface(),this.V.bind(this));this.I=null;this.C?(this.C.appendChild(this.a.a),this.a.init(null)):this.M.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.F=
23
+ new _.Yh(()=>{XJ(this)});this.A=new Map;this.m=null}append(a,b){if(null!=this.h&&0!==a.length){for(const c of b)this.h.appendRule(c);a.sort((c,d)=>c.startTime!==d.startTime?c.startTime-d.startTime:c.endTime-d.endTime);b=this.f.findIndex(c=>c.startTime>=a[0].startTime);0===b?this.f=[]:0<b&&this.f.splice(0,b);for(const c of a)this.f.some(d=>d.payload!==c.payload?!1:d.startTime!==c.startTime?!1:d.endTime!==c.endTime?!1:!0)||this.f.push(c);this.m=null;XJ(this,!1)}}g(){null==this.h||XJ(this,!0)}destroy(){const a=
24
+ this;return _.y(function*(){null!=a.h&&(YJ(a),a.F.stop(),yield a.h.destroy(),a.h=null,a.C.removeChild(a.a.a),a.a=null,a.w.stop(),a.w=null,a.j=!1)})}remove(a,b){if(null==this.h)return!1;this.f=this.f.filter(c=>c.startTime<a||c.endTime>=b);this.m=null;XJ(this,!0);return!0}isTextVisible(){return this.j}setTextVisibility(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.F.Xa(.25),this.K.enableResizeObserver&&this.w.start(),XJ(this,!0)):(this.F.stop(),this.w.stop(),YJ(this)))}V(){XJ(this,!0)}};_.z(fJ,hK);
25
+ hK.prototype.setTextVisibility=hK.prototype.setTextVisibility;hK.prototype.isTextVisible=hK.prototype.isTextVisible;hK.prototype.remove=hK.prototype.remove;hK.prototype.destroy=hK.prototype.destroy;hK.prototype.append=hK.prototype.append;var iK=class{ea(a){return!!a.enableHtmlCue&&!_.ni()}create(a){return new hK(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.zp{f(){_.ll("html",new iK)}a(){}id(){return _.pe}});};f.call(g, window);
package/cl.ima.js CHANGED
@@ -1,17 +1,17 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var xI="clpp.ima.AdsManagerFactory",yI=function(a){a=a.H;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.hc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.r&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.r&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
- _.hc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},zI=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.bi()},AI=function(a){const b=a.a,c=a.o,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ma.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.oc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.Xa.bind(a));c.on(b,d.AD_PROGRESS,a.Bb.bind(a));c.on(b,d.AD_BUFFERING,a.Ka.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Ya.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.Za.bind(a));c.on(b,d.RESUMED,a.Ob.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Y.bind(a));c.on(b,d.IMPRESSION,a.U.bind(a));c.on(b,d.COMPLETE,a.Wa.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.pc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.jc.bind(a))},BI=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},CI=function(a,
4
- b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new W(c,a.C,a.B)});a.l.trigger(new _.F(b,d))},DI=function(a){a.A=null;CI(a,_.Kb);a.m&&a.l.getSurface().hide(a.m)},EI=function(a){_.cm(a.w,{visibility:"visible"})},GI=function(a){return _.y(function*(){a.L.initialize();const b=!!a.l.getConfiguration().muted;(yield a.J.canPlay(b))||zI(a)?FI(a):(CI(a,_.fc),a.N.warn(_.ia))})},HI=function(a,b){return _.y(function*(){a.L.initialize();yield b.play();FI(a)})},FI=function(a){a.a.init(a.w.offsetWidth,a.w.offsetHeight,
5
- google.ima.ViewMode.NORMAL);a.G=!0},II=function(){return!window.google||!google.ima||!google.ima.AdsLoader},W=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}nb(){return"Google IMA SDK"}ob(){return google.ima.VERSION}tb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}Yb(){return this.f?
6
- this.f.getIsBumper():!1}Fb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.me);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}qb(){return this.a.getVastMediaWidth()}pb(){return this.a.getVastMediaHeight()}eb(){return this.a.getVastMediaBitrate()}Qa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Gb(){return this.f?this.f.getTimeOffset():0}Hb(){return this.f?this.f.getAdPosition():
7
- 1}sb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.sb;W.prototype.getPositionInSequence=W.prototype.Hb;
8
- W.prototype.getPodTimeOffset=W.prototype.Gb;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Qa;W.prototype.getMediaBitrate=W.prototype.eb;W.prototype.getMediaHeight=W.prototype.pb;W.prototype.getMediaWidth=W.prototype.qb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.Fb;W.prototype.isBumper=W.prototype.Yb;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getDuration=W.prototype.getDuration;
9
- W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.tb;W.prototype.getAdManagerVersion=W.prototype.ob;W.prototype.getAdManagerName=W.prototype.nb;var JI=class{create(a){const 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}}};var KI=class{constructor(a){this.a=a}getCuePoints(){return this.a}Ib(){return 0<=this.a.indexOf(0)||0===this.a.length}fb(){return 0<=this.a.indexOf(-1)}};KI.prototype.hasPostroll=KI.prototype.fb;KI.prototype.hasPreroll=KI.prototype.Ib;KI.prototype.getCuePoints=KI.prototype.getCuePoints;var LI=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.kf(a.ima||{});this.H=a=_.jf({disableCustomPlayback:!1},a);this.m=this.l.Ub("ima").qc();this.L=this.l.Ub("ima").g;this.j=this.l.Ub("ima").a;this.J=new _.Vp;this.N=new _.P("clpp.ima");this.g=this.a=null;this.f=new _.Mk;this.G=!1;this.o=new _.jo;this.ga=new JI;this.A=null;this.K=this.F=this.B=this.C=!1;this.I=this.h=null;{a=this.o;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
- this.Qb.bind(this));a.on(this.j,b,this.Pb.bind(this));a.on(this.l,_.Zc,this.nc.bind(this))}}Qb(a){this.a=a.getAdsManager(this.w,yI(this));this.a.isCustomPlaybackUsed()&&!zI(this)?(this.N.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.Tp(this.l.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.h=new KI(a),this.l.trigger(new _.F(_.Nb,
11
- {adsTimeline:this.h})),AI(this));this.f.resolve()}Pb(a){BI(this,a.getError());this.f.resolve()}oc(a){const b=this;return _.y(function*(){b.F=!0;zI(b)||(yield b.l.pause(),_.cm(b.w,{visibility:_.dd}));CI(b,_.wb,a);b.g.start()})}ma(){const a=this;return _.y(function*(){if(zI(a)){a.I=a.l.getPosition();yield a.l.detach();var b=a.l;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?CI(this,_.Db,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();
12
- CI(this,_.Jb,a);this.l.getSurface().show(this.m)}Xa(a){a=a.getAdData();BI(this,a?a.adError:null);DI(this)}Bb(a){CI(this,_.Gb,a)}Ka(a){CI(this,_.yb,a)}S(a){CI(this,_.Bb,a)}Ya(a){CI(this,_.Eb,a)}ba(a){CI(this,_.Lb,a)}Za(a){CI(this,_.Fb,a)}Ob(a){CI(this,_.Hb,a)}R(a){this.pause();CI(this,_.zb,a)}Y(a){CI(this,_.Ib,a);DI(this)}U(a){CI(this,_.Cb,a)}Wa(a){CI(this,_.Ab,a);DI(this)}pc(){const a=this;return _.y(function*(){a.C=!0;if(zI(a)&&null!==a.I){var b=a.l;b.a&&b.a.addDelegate(b);yield _.Vm(a.l);a.B||(yield a.l.seek(a.I))}else{if(!a.F)return a.l.play();
13
- EI(a)}a.F=!1;a.g&&a.g.stop();a.B||(yield a.l.play());CI(a,_.xb)})}jc(){this.K=!0}nc(){this.B=!0;this.j.contentComplete()}load(){const a=this;return _.y(function*(){var b=a.l;const c=a.H;try{if(typeof c.adTagUrl!==_.me)throw new _.H(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.J.canPlay(!1);const d=yield a.J.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
14
- a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(e);return a.f})}start(a){const b=this;return _.y(function*(){b.a&&b.h&&!b.G?b.h.Ib()?yield GI(b):yield HI(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>
15
- {this.G&&this.h&&this.h.fb()&&!this.K?(this.o.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Nf(this.o,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.j.contentComplete()})).then(()=>{EI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};LI.prototype.getPosition=LI.prototype.getPosition;
16
- LI.prototype.setVolume=LI.prototype.setVolume;LI.prototype.getVolume=LI.prototype.getVolume;LI.prototype.skip=LI.prototype.skip;LI.prototype.pause=LI.prototype.pause;LI.prototype.resume=LI.prototype.resume;var MI=class extends _.aq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(II())return a.onError(new _.H(1,9,1E4));this.f=_.am(_.Qc,{"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(_.ma);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
- (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}Cf(){return this.a}Af(){return this.g}qc(){return this.f}id(){return"ima"}};_.A("clpp.ima.ImaPlugin",MI);MI.prototype.getAdContainer=MI.prototype.qc;MI.prototype.getAdDisplayContainer=MI.prototype.Af;MI.prototype.getAdsLoader=MI.prototype.Cf;MI.Id="ima";MI.isSdkMissing=II;_.Hm(new class{create(){return new MI}});var NI=class{constructor(){this.a=new _.P(xI)}name(){return xI}da(a,b){return a.namespace()===_.zc?!1:II()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new LI(a)}};NI.prototype.create=NI.prototype.create;NI.prototype.isSupported=NI.prototype.da;NI.prototype.name=NI.prototype.name;_.Yl(new NI);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var MI="clpp.ima.AdsManagerFactory",NI=function(a){a=a.H;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.fc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.r&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.r&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
2
+ _.fc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},OI=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.bi()},PI=function(a){const b=a.a,c=a.o,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ma.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.pc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.Za.bind(a));c.on(b,d.AD_PROGRESS,a.Db.bind(a));c.on(b,d.AD_BUFFERING,a.La.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.$a.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.ab.bind(a));c.on(b,d.RESUMED,a.Qb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Y.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.Ya.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.qc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.kc.bind(a))},QI=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},RI=function(a,
4
+ b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new W(c,a.C,a.B)});a.l.trigger(new _.F(b,d))},SI=function(a){a.A=null;RI(a,_.Ib);a.m&&a.l.getSurface().hide(a.m)},TI=function(a){_.cm(a.w,{visibility:"visible"})},VI=function(a){return _.y(function*(){a.M.initialize();const b=!!a.l.getConfiguration().muted;(yield a.J.canPlay(b))||OI(a)?UI(a):(RI(a,_.dc),a.N.warn(_.ia))})},WI=function(a,b){return _.y(function*(){a.M.initialize();yield b.play();UI(a)})},UI=function(a){a.a.init(a.w.offsetWidth,a.w.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.G=!0},XI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},W=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}pb(){return"Google IMA SDK"}qb(){return google.ima.VERSION}vb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}$b(){return this.f?
6
+ this.f.getIsBumper():!1}Hb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.me);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}sb(){return this.a.getVastMediaWidth()}rb(){return this.a.getVastMediaHeight()}gb(){return this.a.getVastMediaBitrate()}Sa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Ib(){return this.f?this.f.getTimeOffset():0}Jb(){return this.f?this.f.getAdPosition():
7
+ 1}ub(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.ub;W.prototype.getPositionInSequence=W.prototype.Jb;
8
+ W.prototype.getPodTimeOffset=W.prototype.Ib;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Sa;W.prototype.getMediaBitrate=W.prototype.gb;W.prototype.getMediaHeight=W.prototype.rb;W.prototype.getMediaWidth=W.prototype.sb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.Hb;W.prototype.isBumper=W.prototype.$b;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getDuration=W.prototype.getDuration;
9
+ W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.vb;W.prototype.getAdManagerVersion=W.prototype.qb;W.prototype.getAdManagerName=W.prototype.pb;var YI=class{create(a){const 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}}};var ZI=class{constructor(a){this.a=a}getCuePoints(){return this.a}Kb(){return 0<=this.a.indexOf(0)||0===this.a.length}hb(){return 0<=this.a.indexOf(-1)}};ZI.prototype.hasPostroll=ZI.prototype.hb;ZI.prototype.hasPreroll=ZI.prototype.Kb;ZI.prototype.getCuePoints=ZI.prototype.getCuePoints;var $I=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.kf(a.ima||{});this.H=a=_.jf({disableCustomPlayback:!1},a);this.m=this.l.Wb("ima").rc();this.M=this.l.Wb("ima").g;this.j=this.l.Wb("ima").a;this.J=new _.Up;this.N=new _.O("clpp.ima");this.g=this.a=null;this.f=new _.Mk;this.G=!1;this.o=new _.jo;this.ga=new YI;this.A=null;this.K=this.F=this.B=this.C=!1;this.I=this.h=null;{a=this.o;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
+ this.Sb.bind(this));a.on(this.j,b,this.Rb.bind(this));a.on(this.l,_.Xc,this.oc.bind(this))}}Sb(a){this.a=a.getAdsManager(this.w,NI(this));this.a.isCustomPlaybackUsed()&&!OI(this)?(this.N.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.Sp(this.l.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.h=new ZI(a),this.l.trigger(new _.F(_.Lb,
11
+ {adsTimeline:this.h})),PI(this));this.f.resolve()}Rb(a){QI(this,a.getError());this.f.resolve()}pc(a){const b=this;return _.y(function*(){b.F=!0;OI(b)||(yield b.l.pause(),_.cm(b.w,{visibility:_.bd}));RI(b,_.ub,a);b.g.start()})}ma(){const a=this;return _.y(function*(){if(OI(a)){a.I=a.l.getPosition();yield a.l.detach();var b=a.l;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?RI(this,_.Bb,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();
12
+ RI(this,_.Hb,a);this.l.getSurface().show(this.m)}Za(a){a=a.getAdData();QI(this,a?a.adError:null);SI(this)}Db(a){RI(this,_.Eb,a)}La(a){RI(this,_.wb,a)}T(a){RI(this,_.zb,a)}$a(a){RI(this,_.Cb,a)}ba(a){RI(this,_.Jb,a)}ab(a){RI(this,_.Db,a)}Qb(a){RI(this,_.Fb,a)}R(a){this.pause();RI(this,_.xb,a)}Y(a){RI(this,_.Gb,a);SI(this)}V(a){RI(this,_.Ab,a)}Ya(a){RI(this,_.yb,a);SI(this)}qc(){const a=this;return _.y(function*(){a.C=!0;if(OI(a)&&null!==a.I){var b=a.l;b.a&&b.a.addDelegate(b);yield _.Vm(a.l);a.B||(yield a.l.seek(a.I))}else{if(!a.F)return a.l.play();
13
+ TI(a)}a.F=!1;a.g&&a.g.stop();a.B||(yield a.l.play());RI(a,_.vb)})}kc(){this.K=!0}oc(){this.B=!0;this.j.contentComplete()}load(){const a=this;return _.y(function*(){var b=a.l;const c=a.H;try{if(typeof c.adTagUrl!==_.me)throw new _.H(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.J.canPlay(!1);const d=yield a.J.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
14
+ a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(e);return a.f})}start(a){const b=this;return _.y(function*(){b.a&&b.h&&!b.G?b.h.Kb()?yield VI(b):yield WI(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>
15
+ {this.G&&this.h&&this.h.hb()&&!this.K?(this.o.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Nf(this.o,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.j.contentComplete()})).then(()=>{TI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};$I.prototype.getPosition=$I.prototype.getPosition;
16
+ $I.prototype.setVolume=$I.prototype.setVolume;$I.prototype.getVolume=$I.prototype.getVolume;$I.prototype.skip=$I.prototype.skip;$I.prototype.pause=$I.prototype.pause;$I.prototype.resume=$I.prototype.resume;var aJ=class extends _.$p{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(XI())return a.onError(new _.H(1,9,1E4));this.f=_.am(_.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(_.ma);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
+ (this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}Hf(){return this.a}Ff(){return this.g}rc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",aJ);aJ.prototype.getAdContainer=aJ.prototype.rc;aJ.prototype.getAdDisplayContainer=aJ.prototype.Ff;aJ.prototype.getAdsLoader=aJ.prototype.Hf;aJ.Id="ima";aJ.isSdkMissing=XI;_.Hm(new class{create(){return new aJ}});var bJ=class{constructor(){this.a=new _.O(MI)}name(){return MI}ea(a,b){return a.namespace()===_.yc?!1:XI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new $I(a)}};bJ.prototype.create=bJ.prototype.create;bJ.prototype.isSupported=bJ.prototype.ea;bJ.prototype.name=bJ.prototype.name;_.Yl(new bJ);};f.call(g, window);