@castlabs/prestoplay 6.8.0 → 6.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +66 -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 +111 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +414 -411
  8. package/cjs/cl.crypto.js +10 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +36 -37
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +73 -67
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -31
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +275 -274
  17. package/cjs/cl.muxdata.js +14 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +70 -70
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +70 -70
  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 +27 -27
  35. package/cl.core.js +366 -362
  36. package/cl.crypto.js +9 -9
  37. package/cl.dash.js +66 -66
  38. package/cl.externs.js +36 -37
  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 +26 -25
  43. package/cl.ima.js +17 -17
  44. package/cl.mse.js +238 -239
  45. package/cl.muxdata.js +12 -12
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +59 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +14 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -15
  58. package/package.json +1 -1
  59. package/typings.d.ts +74 -2
package/cl.htmlcue.js CHANGED
@@ -1,25 +1,26 @@
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 iJ="Unsupported unit",jJ="clpp-text-plain",kJ="clpp-text-ttml",lJ="clpp.htmlcue.HtmlTextDisplayer",mJ="initial",nJ=function(a){return _.bg(a,{ze:(b,c)=>b.bd(c)})},oJ=function(a,b){if(0===b.length)return a;let c=a;a=a.findIndex(d=>d.startTime>=b[0].startTime);0<=a&&(c=c.slice(0,a));return c.concat(b)},pJ=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},qJ=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);
2
+ b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},sJ=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>rJ[c]);return a},uJ=function(a,b){tJ(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{tJ(a,c)})},tJ=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},vJ=function(a,b){return 0===a?"0":a+b},wJ=function(a,b){return 1>Math.abs(a-b)||a<b},xJ=function(a,b){return a<b&&1<Math.abs(a-b)},yJ=function(a,b){return a>b&&1<Math.abs(a-b)},zJ=
3
+ function(a,b){return 1>Math.abs(a-b)||a>b},BJ=function(a){const b=a.getBoundingClientRect();var c=getComputedStyle(a,null);const d=parseFloat(c.getPropertyValue("border-left-width"))||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 AJ(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
+ d-e)},CJ=function(a){return new AJ(a.f,a.g,a.h,a.a,a.height,a.width)},DJ=function(a,b){return b.some(c=>xJ(a.f,c.g)&&yJ(a.g,c.f)&&xJ(a.h,c.a)&&yJ(a.a,c.h))},EJ=function(a,b){return zJ(a.h,b.h)&&wJ(a.a,b.a)&&zJ(a.f,b.f)&&wJ(a.g,b.g)},FJ=function(a,b,c){switch(c){case "+x":return xJ(a.f,b.f);case "-x":return yJ(a.g,b.g);case "+y":return xJ(a.h,b.h);case "-y":return yJ(a.a,b.a);default:throw Error("Unknown axis");}},GJ=function(a){return a.f.writingMode===_.to},HJ=function(a){var b=a.a.childNodes[0],
5
+ c=a.a.getBoundingClientRect();const d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return GJ(a)?b:c},IJ=function(a){switch(a.f.writingMode){case _.to:return"horizontal-tb";case _.He:return _.He;case _.Ie:return _.Ie;default:throw Error("Unknown writing mode");}},JJ=function(a){switch(a.f.positionAlign){case _.nd:return _.id;case "auto":case _.vc:return _.so;case _.od:return _.fe}return a.f.textAlign},KJ=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===_.r)switch(b){case _.nd:return a.f.position;
6
+ case "auto":case _.vc:return a.f.position-a.f.size/2;case _.od:return a.f.position-a.f.size}return 0},LJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.id:case _.id:return _.nd;case _.so:return _.vc;case _.fe:case _.fe:return _.od}return a.f.positionAlign},OJ=function(a,b,c){return(MJ(a)||NJ(a))&&_.rf(c)?vJ(c,_.Zd):MJ(a)&&_.B(c)?vJ(0,_.Zd):GJ(a)&&_.rf(b)?vJ(b,"%"):mJ},PJ=function(a,b,c){return GJ(a)&&_.rf(c)?vJ(c,_.Zd):(MJ(a)||NJ(a))&&_.rf(b)?vJ(b,"%"):mJ},NJ=function(a){return a.f.writingMode===
7
+ _.Ie},MJ=function(a){return a.f.writingMode===_.He},QJ=function(a,b){if(a.h)switch(b.writingMode){case _.to:return["-y"];case _.He:return["+x"];case _.Ie:return["-x"]}a=[];switch(b.writingMode){case _.to:a=["+y","-y"];break;case _.He:a=["+x","-x"];break;case _.Ie:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},RJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=BJ(a.j.a)},SJ=function(a,b){RJ(a.g);a.j.unshift(b);for(const c of a.j)a.g.append(c)},TJ=function(a,
8
+ b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.Ao)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(iJ);},VJ=function(a,b,c,d){const e=document.createElement(_.re),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);UJ(a,c,b);a.f.debug(`Created HTML style element #${b}.`);return e.sheet},WJ=function(a,b){a=`.${a.j} .clpp-text-container`;const c=`${a} .clpp-text-cue`;return b=b.replace(/::cue\((#[^)]+)\)/g,
9
+ `${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,a)},XJ=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},YJ=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);
10
+ a.m=[]}},UJ=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!")})})});d.observe(b,{subtree:!1,childList:!0});a.o.push(()=>d.disconnect())},ZJ=function(a){a=_.lf(a.getConfiguration().htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},eK=function(a,b){if((b||a.j)&&
11
+ a.C){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.Nl)if(a.I=c,c=$J(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,aK(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.jo(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 _.Pe:g="clpp-text-vtt";break;case _.ze:g=kJ;break;case _.ro:g=
12
+ jJ}g&&!f.classList.contains(g)&&_.hm(f,g);f=BJ(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.");else{tJ({fontSize:bK(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.Pe;var h=d.payloadType===_.ze;d.region&&(g||h||d.backgroundImage)&&(c.A.has(d.region.id)?f=c.A.get(d.region.id):(f=new cK(d.region,{}),c.A.set(d.region.id,f),SJ(c.a,f)));
13
+ d=new dK(d,c.K,e);f?SJ(f,d):SJ(c.a,d)}}}}},fK=function(a){aK(a);a.I=null;a.m=null;a.f=[]},gK=function(a,b){return a.startTime<=b&&a.endTime>b},$J=function(a,b){var c=pJ(a.f,d=>gK(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&gK(a.f[d-1],b);)d--;for(;c+1<a.f.length&&gK(a.f[c+1],b);)c++;return{start:d,end:c}}},aK=function(a){a.A.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(kJ);b.classList.remove(jJ);a=a.a;RJ(a.g);
14
+ a.j=[]}},bK=function(a,b){const c=BJ(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*a)}px`},kK=class{parse(a){a={input:a};const b=_.jm(_.Rc),c=[];let d=b;for(var e;null!==(e=qJ(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=
15
+ e[1];var g=e[3];var h=hK[f];h?(h=_.jm(h),(f=iK[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||jK[g.localName]&&jK[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),d=g)}}else d.appendChild(document.createTextNode(sJ(e)));return b}},hK={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},iK={v:"voice",lang:"lang"},jK={rt:"ruby"},rJ={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f",
16
+ "\x26nbsp;":"\u00a0"};var AJ=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 lK=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 dK=class extends lK{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)_.hm(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===_.ze){var c=_.jm(_.Rc);c.innerHTML=b.payload;b=c}else b.payloadType===
17
+ _.Pe?b=(new kK).parse(b.payload):(c=_.jm(_.Rc),c.textContent=b.payload,b=c);_.hm(b,this.o);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.hm(b,d);tJ({writingMode:IJ(this)},b);var d=b;this.a.appendChild(d);_.hm(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.hm(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.uo,this.f.line=GJ(this)?-1:0);e=IJ(this);tJ({writingMode:e,webkitWritingMode:e,direction:mJ,textAlign:JJ(this)},this.a);if(!this.f.region||
18
+ !this.f.region.displayAlign){e=KJ(this,LJ(this));tJ({position:"absolute",left:OJ(this,e,null),right:NJ(this)&&_.B(null)?vJ(0,_.Zd):mJ,top:PJ(this,e,null),width:GJ(this)?vJ(this.f.size,"%"):mJ,height:MJ(this)||NJ(this)?vJ(this.f.size,"%"):mJ},this.a);b=this.f;a=GJ(this)?a.height:a.width;c=HJ(this);if(b.lineInterpretation===_.uo){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 _.vc:g-=f/2;break;case _.Zc:g-=f}f=Math.round(g/
19
+ 100*a)}NJ(this)&&(f=a-f-c);a=f;tJ({left:OJ(this,e,a),right:NJ(this)&&_.B(a)?vJ(0,_.Zd):mJ,top:PJ(this,e,a)},this.a)}uJ(this.B,d)}}m(){return _.jm(_.Rc)}};var mK=class{constructor(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=BJ(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.ed;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=BJ(a.a);var d=QJ(this,a.f),e=HJ(a);const g=CJ(c);let h=null,k=0;for(const l of d){for(;FJ(c,this.a,l)||EJ(c,this.a)&&DJ(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||EJ(c,this.a))break a;
20
+ 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=CJ(c),k=d);c=CJ(g)}c=h||g}tJ({top:vJ(c.h-this.a.h,_.Zd),bottom:vJ(this.a.a-c.a,_.Zd),left:vJ(c.f-this.a.f,_.Zd),right:vJ(this.a.g-c.g,_.Zd),height:vJ(c.height,_.Zd),width:vJ(c.width,_.Zd)},a.a)}b.style.visibility="visible";this.g.push(BJ(a.a))}};var nK=class extends lK{constructor(a,b,c){super(a,b,c);this.g=null;this.j=[]}init(){this.g=new mK(this);this.h=!0}m(){const a=_.jm(_.Rc);_.hm(a,this.o);this.id&&(a.id=this.id);return a}};var cK=class extends nK{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 _.Ao:b=b.width/100*a.width;break a;default:throw Error(iJ);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ao)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(iJ);d=a.height;const e=TJ(this,d,a.height);tJ(this.A,this.a);tJ({left:vJ(c,_.Zd),top:vJ(e,_.Zd),width:vJ(b,
21
+ _.Zd),height:vJ(d,_.Zd)},this.a);this.f.writingMode&&tJ({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&tJ({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.hm(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.Ao:f=f.height/100*a.height;break a;case 2:f=f.height;c=new dK(new _.xo(0,1,"Lorem ipsum",_.ro),{},{});b=c.a;this.a.appendChild(b);c.init(BJ(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
+ b=c;f*=b;break a;default:throw Error(iJ);}a=TJ(this,f,a.height);tJ({top:vJ(a,_.Zd),height:vJ(f,_.Zd)},this.a);this.g=new mK(this,!0);this.h=!0}getId(){return this.f.id}};var oK=class{constructor(a,b){this.f=new _.Q("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.m=[];this.a=VJ(this,this.h,this.j);this.g=VJ(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=WJ(this,a);if(XJ(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 `+
23
+ `because it's not safe: ${b}`)}}destroy(){const a=this;return _.y(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],YJ(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 pK=class extends _.cq{constructor(a){super(a);this.M=new _.Q(lJ);this.l=a;this.K=ZJ(a);this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new oK(a,"CLPP Subtitle Styles");this.a=new nK(null,"clpp-text-container",{});this.w=new _.Yp(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=
24
+ new _.ci(()=>{eK(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);this.f=oJ(this.f,nJ(a));this.m=null;eK(this,!1)}}g(){null==this.h||eK(this,!0)}destroy(){const a=this;return _.y(function*(){null!=a.h&&(fK(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=
25
+ this.f.filter(c=>c.startTime<a||c.endTime>=b);this.m=null;eK(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(),eK(this,!0)):(this.F.stop(),this.w.stop(),fK(this)))}V(){eK(this,!0)}};_.z(lJ,pK);pK.prototype.setTextVisibility=pK.prototype.setTextVisibility;pK.prototype.isTextVisible=pK.prototype.isTextVisible;pK.prototype.remove=pK.prototype.remove;pK.prototype.destroy=pK.prototype.destroy;
26
+ pK.prototype.append=pK.prototype.append;var qK=class{ea(a){return!!a.enableHtmlCue&&!_.si()}create(a){return new pK(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Fp{f(){_.rl("html",new qK)}a(){}id(){return _.se}});};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 SI="clpp.ima.AdsManagerFactory",TI=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===_.jc?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
+ _.jc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},UI=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.gi()},VI=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.Na.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))},WI=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},XI=function(a,
4
+ b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.C,a.B)});a.l.trigger(new _.F(b,d))},YI=function(a){a.A=null;XI(a,_.Kb);a.m&&a.l.getSurface().hide(a.m)},ZI=function(a){_.im(a.w,{visibility:"visible"})},aJ=function(a){return _.y(function*(){a.M.initialize();const b=!!a.l.getConfiguration().muted;(yield a.J.canPlay(b))||UI(a)?$I(a):(XI(a,_.fc),a.N.warn(_.ia))})},bJ=function(a,b){return _.y(function*(){a.M.initialize();yield b.play();$I(a)})},$I=function(a){a.a.init(a.w.offsetWidth,a.w.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.G=!0},cJ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=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]===_.Dd&&typeof b[d].clickThroughUrl===_.pe);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()}};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.ub;X.prototype.getPositionInSequence=X.prototype.Jb;
8
+ X.prototype.getPodTimeOffset=X.prototype.Ib;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Sa;X.prototype.getMediaBitrate=X.prototype.gb;X.prototype.getMediaHeight=X.prototype.rb;X.prototype.getMediaWidth=X.prototype.sb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Hb;X.prototype.isBumper=X.prototype.$b;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getDuration=X.prototype.getDuration;
9
+ X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.vb;X.prototype.getAdManagerVersion=X.prototype.qb;X.prototype.getAdManagerName=X.prototype.pb;var dJ=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 eJ=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)}};eJ.prototype.hasPostroll=eJ.prototype.hb;eJ.prototype.hasPreroll=eJ.prototype.Kb;eJ.prototype.getCuePoints=eJ.prototype.getCuePoints;var fJ=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.lf(a.ima||{});this.H=a=_.kf({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 _.$p;this.N=new _.Q("clpp.ima");this.g=this.a=null;this.f=new _.Sk;this.G=!1;this.o=new _.po;this.ga=new dJ;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,_.$c,this.oc.bind(this))}}Sb(a){this.a=a.getAdsManager(this.w,TI(this));this.a.isCustomPlaybackUsed()&&!UI(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 _.Yp(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 eJ(a),this.l.trigger(new _.F(_.Nb,
11
+ {adsTimeline:this.h})),VI(this));this.f.resolve()}Rb(a){WI(this,a.getError());this.f.resolve()}pc(a){const b=this;return _.y(function*(){b.F=!0;UI(b)||(yield b.l.pause(),_.im(b.w,{visibility:_.ed}));XI(b,_.wb,a);b.g.start()})}ma(){const a=this;return _.y(function*(){if(UI(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()?XI(this,_.Db,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();
12
+ XI(this,_.Jb,a);this.l.getSurface().show(this.m)}Za(a){a=a.getAdData();WI(this,a?a.adError:null);YI(this)}Db(a){XI(this,_.Gb,a)}Na(a){XI(this,_.yb,a)}T(a){XI(this,_.Bb,a)}$a(a){XI(this,_.Eb,a)}ba(a){XI(this,_.Lb,a)}ab(a){XI(this,_.Fb,a)}Qb(a){XI(this,_.Hb,a)}R(a){this.pause();XI(this,_.zb,a)}Y(a){XI(this,_.Ib,a);YI(this)}V(a){XI(this,_.Cb,a)}Ya(a){XI(this,_.Ab,a);YI(this)}qc(){const a=this;return _.y(function*(){a.C=!0;if(UI(a)&&null!==a.I){var b=a.l;b.a&&b.a.addDelegate(b);yield _.an(a.l);a.B||(yield a.l.seek(a.I))}else{if(!a.F)return a.l.play();
13
+ ZI(a)}a.F=!1;a.g&&a.g.stop();a.B||(yield a.l.play());XI(a,_.xb)})}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!==_.pe)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 aJ(b):yield bJ(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)}),_.Of(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(()=>{ZI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};fJ.prototype.getPosition=fJ.prototype.getPosition;
16
+ fJ.prototype.setVolume=fJ.prototype.setVolume;fJ.prototype.getVolume=fJ.prototype.getVolume;fJ.prototype.skip=fJ.prototype.skip;fJ.prototype.pause=fJ.prototype.pause;fJ.prototype.resume=fJ.prototype.resume;var gJ=class extends _.fq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(cJ())return a.onError(new _.H(1,9,1E4));this.f=_.gm(_.Rc,{"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)}Lf(){return this.a}Jf(){return this.g}rc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",gJ);gJ.prototype.getAdContainer=gJ.prototype.rc;gJ.prototype.getAdDisplayContainer=gJ.prototype.Jf;gJ.prototype.getAdsLoader=gJ.prototype.Lf;gJ.Id="ima";gJ.isSdkMissing=cJ;_.Nm(new class{create(){return new gJ}});var hJ=class{constructor(){this.a=new _.Q(SI)}name(){return SI}ea(a,b){return a.namespace()===_.Bc?!1:cJ()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new fJ(a)}};hJ.prototype.create=hJ.prototype.create;hJ.prototype.isSupported=hJ.prototype.ea;hJ.prototype.name=hJ.prototype.name;_.dm(new hJ);};f.call(g, window);