@castlabs/prestoplay 6.14.0 → 6.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +528 -520
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +50 -56
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -68
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -30
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +264 -274
  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.simid.js +15 -15
  22. package/cjs/cl.smooth.js +71 -71
  23. package/cjs/cl.thumbnails.js +26 -26
  24. package/cjs/cl.tizen.js +70 -70
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +12 -12
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +19 -19
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +88 -88
  35. package/cl.conviva.js +27 -27
  36. package/cl.core.js +440 -433
  37. package/cl.crypto.js +8 -8
  38. package/cl.dash.js +68 -68
  39. package/cl.externs.js +50 -56
  40. package/cl.freewheel.js +19 -19
  41. package/cl.hls.js +71 -69
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +26 -26
  44. package/cl.ima.js +17 -17
  45. package/cl.mse.js +236 -240
  46. package/cl.muxdata.js +13 -13
  47. package/cl.onboard.js +4 -4
  48. package/cl.persistent.js +11 -11
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +13 -13
  51. package/cl.smooth.js +59 -59
  52. package/cl.thumbnails.js +19 -19
  53. package/cl.tizen.js +57 -57
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +8 -8
  57. package/cl.vr.js +15 -15
  58. package/cl.vtt.js +12 -12
  59. package/cl.youbora.js +15 -15
  60. package/clpp.styles.css +2 -0
  61. package/package.json +1 -1
  62. package/typings.d.ts +40 -33
package/cl.htmlcue.js CHANGED
@@ -1,26 +1,26 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var PM="Unsupported unit",QM="clpp-text-plain",RM="clpp-text-ttml",SM="clpp.htmlcue.HtmlTextDisplayer",TM="initial",UM=function(a){return _.ih(a,{Oe:(b,c)=>b.md(c)})},VM=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)},WM=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},XM=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},ZM=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>YM[c]);return a},aN=function(a,b){$M(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{$M(a,c)})},$M=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},bN=function(a,b){return 0===a?"0":a+b},cN=function(a,b){return 1>Math.abs(a-b)||a<b},dN=function(a,b){return a<b&&1<Math.abs(a-b)},eN=function(a,b){return a>b&&1<Math.abs(a-b)},fN=
3
- function(a,b){return 1>Math.abs(a-b)||a>b},hN=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 gN(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
- d-e)},iN=function(a){return new gN(a.left,a.f,a.top,a.a,a.height,a.width)},jN=function(a,b){return b.some(c=>dN(a.left,c.f)&&eN(a.f,c.left)&&dN(a.top,c.a)&&eN(a.a,c.top))},kN=function(a,b){return fN(a.top,b.top)&&cN(a.a,b.a)&&fN(a.left,b.left)&&cN(a.f,b.f)},lN=function(a,b,c){switch(c){case "+x":return dN(a.left,b.left);case "-x":return eN(a.f,b.f);case "+y":return dN(a.top,b.top);case "-y":return eN(a.a,b.a);default:throw Error("Unknown axis");}},mN=function(a){return a.f.writingMode===_.mr},nN=
5
- 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 mN(a)?b:c},oN=function(a){switch(a.f.writingMode){case _.mr:return"horizontal-tb";case _.Nf:return _.Nf;case _.Of:return _.Of;default:throw Error("Unknown writing mode");}},pN=function(a){switch(a.f.positionAlign){case _.ee:return _.Zd;case "auto":case _.Tc:return _.lr;case _.fe:return _.jf}return a.f.textAlign},qN=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===
6
- _.r)switch(b){case _.ee:return a.f.position;case "auto":case _.Tc:return a.f.position-a.f.size/2;case _.fe:return a.f.position-a.f.size}return 0},rN=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Zd:case _.Zd:return _.ee;case _.lr:return _.Tc;case _.jf:case _.jf:return _.fe}return a.f.positionAlign},uN=function(a,b,c){return(sN(a)||tN(a))&&_.Cg(c)?bN(c,_.bf):sN(a)&&_.B(c)?bN(0,_.bf):mN(a)&&_.Cg(b)?bN(b,"%"):TM},vN=function(a,b,c){return mN(a)&&_.Cg(c)?bN(c,_.bf):(sN(a)||tN(a))&&_.Cg(b)?
7
- bN(b,"%"):TM},tN=function(a){return a.f.writingMode===_.Of},sN=function(a){return a.f.writingMode===_.Nf},wN=function(a,b){if(a.j)switch(b.writingMode){case _.mr:return["-y"];case _.Nf:return["+x"];case _.Of:return["-x"]}a=[];switch(b.writingMode){case _.mr:a=["+y","-y"];break;case _.Nf:a=["+x","-x"];break;case _.Of:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},xN=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=hN(a.l.a)},yN=function(a,b){xN(a.h);a.l.unshift(b);
8
- for(const c of a.l)a.h.append(c)},zN=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.tr)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(PM);},BN=function(a,b,c,d){const e=document.createElement(_.xf),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);AN(a,c,b);a.g.debug(`Created HTML style element #${b}.`);return e.sheet},CN=function(a,b){a=`.${a.j} .clpp-text-container`;
9
- 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,a)},DN=function(a,b){let c=!1;try{a.f.insertRule(b,0);const d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.f.cssRules.length&&a.f.deleteRule(0);
10
- return c},EN=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}},AN=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.g.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())},FN=function(a){a=_.vg(a.getConfiguration().htmlcue||{});_.B(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.B(a.enableResizeObserver)&&
11
- (a.enableResizeObserver=!0);return a},LN=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.rn)if(a.J=c,c=GN(a,c),b||(b=a.o,b=!(null===b&&null===c||null!==b&&null!==c&&b.start===c.start&&b.end===c.end)),b&&(a.o=c,HN(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.cr(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 _.$f:g=
12
- "clpp-text-vtt";break;case _.Ef:g=RM;break;case _.kr:g=QM}g&&!f.classList.contains(g)&&_.Mn(f,g);f=hN(c.a.a);if(0===f.width||0===f.height)c.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");else{$M({fontSize:IN(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.$f;var h=d.payloadType===_.Ef;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=
13
- new JN(d.region,{}),c.B.set(d.region.id,f),yN(c.a,f)));d=new KN(d,c.M,e);f?yN(f,d):yN(c.a,d)}}}}},MN=function(a){HN(a);a.J=null;a.o=null;a.f=[]},NN=function(a,b){return a.startTime<=b&&a.endTime>b},GN=function(a,b){var c=WM(a.f,d=>NN(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&NN(a.f[d-1],b);)d--;for(;c+1<a.f.length&&NN(a.f[c+1],b);)c++;return{start:d,end:c}}},HN=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(RM);
14
- b.classList.remove(QM);a=a.a;xN(a.h);a.l=[]}},IN=function(a,b){const c=hN(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.C)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`},RN=class{parse(a){a={input:a};const b=_.On(_.zd),c=[];let d=b;for(var e;null!==(e=XM(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);
15
- else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=ON[f];h?(h=_.On(h),(f=PN[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||QN[g.localName]&&QN[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(ZM(e)));return b}},ON={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},PN={v:"voice",lang:"lang"},QN={rt:"ruby"},YM={"\x26amp;":"\x26",
16
- "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var gN=class{constructor(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f}};var SN=class{constructor(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1}init(){this.j=!0}A(){return!1}};var KN=class extends SN{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c}A(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.h)_.Mn(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage=`url("${this.f.backgroundImage}")`,this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Ef){var c=_.On(_.zd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
- _.$f?b=(new RN).parse(b.payload):(c=_.On(_.zd),c.textContent=b.payload,b=c);_.Mn(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.Mn(b,d);$M({writingMode:oN(this)},b);var d=b;this.a.appendChild(d);_.Mn(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.Mn(this.a,`clpp-text-wrapper__${e}`);_.B(this.f.line)&&(this.f.lineInterpretation=_.nr,this.f.line=mN(this)?-1:0);e=oN(this);$M({writingMode:e,webkitWritingMode:e,direction:TM,textAlign:pN(this)},this.a);if(!this.f.region||
18
- !this.f.region.displayAlign){e=qN(this,rN(this));$M({position:"absolute",left:uN(this,e,null),right:tN(this)&&_.B(null)?bN(0,_.bf):TM,top:vN(this,e,null),width:mN(this)?bN(this.f.size,"%"):TM,height:sN(this)||tN(this)?bN(this.f.size,"%"):TM},this.a);b=this.f;a=mN(this)?a.height:a.width;c=nN(this);if(b.lineInterpretation===_.nr){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 _.Ld:g-=f}f=Math.round(g/
19
- 100*a)}tN(this)&&(f=a-f-c);a=f;$M({left:uN(this,e,a),right:tN(this)&&_.B(a)?bN(0,_.bf):TM,top:vN(this,e,a)},this.a)}aN(this.C,d)}}o(){return _.On(_.zd)}};var TN=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=hN(a.a);this.h=[]}append(a){const b=a.a;b.style.visibility=_.Sd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=hN(a.a);var d=wN(this,a.f),e=nN(a);const g=iN(c);let h=null,k=0;for(const l of d){for(;lN(c,this.a,l)||kN(c,this.a)&&jN(c,this.h);){d=c;var f=e;switch(l){case "+x":d.left+=f;d.f+=f;break;case "-x":d.left-=f;d.f-=f;break;case "+y":d.top+=f;d.a+=f;break;case "-y":d.top-=f,d.a-=f}}if(this.j||kN(c,this.a))break a;
20
- d=this.a;d=Math.max(0,Math.min(c.f,d.f)-Math.max(c.left,d.left))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.top,d.top))/(c.height*c.width);d>k&&(h=iN(c),k=d);c=iN(g)}c=h||g}$M({top:bN(c.top-this.a.top,_.bf),bottom:bN(this.a.a-c.a,_.bf),left:bN(c.left-this.a.left,_.bf),right:bN(this.a.f-c.f,_.bf),height:bN(c.height,_.bf),width:bN(c.width,_.bf)},a.a)}b.style.visibility="visible";this.h.push(hN(a.a))}};var UN=class extends SN{constructor(a,b,c){super(a,b,c);this.h=null;this.l=[]}init(){this.h=new TN(this);this.j=!0}o(){const a=_.On(_.zd);_.Mn(a,this.w);this.id&&(a.id=this.id);return a}};var JN=class extends UN{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 _.tr:b=b.width/100*a.width;break a;default:throw Error(PM);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.tr)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(PM);d=a.height;const e=zN(this,d,a.height);$M(this.B,this.a);$M({left:bN(c,_.bf),top:bN(e,_.bf),width:bN(b,
21
- _.bf),height:bN(d,_.bf)},this.a);this.f.writingMode&&$M({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&$M({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.Mn(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.tr:f=f.height/100*a.height;break a;case 2:f=f.height;c=new KN(new _.qr(0,1,"Lorem ipsum",_.kr),{},{});b=c.a;this.a.appendChild(b);c.init(hN(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
- b=c;f*=b;break a;default:throw Error(PM);}a=zN(this,f,a.height);$M({top:bN(a,_.bf),height:bN(f,_.bf)},this.a);this.h=new TN(this,!0);this.j=!0}getId(){return this.f.id}};var VN=class{constructor(a,b){this.g=new _.R("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.l=[];this.a=BN(this,this.h,this.j);this.f=BN(this,this.h,this.j,!0);this.f.disabled=!0;this.g.debug(`Stylesheet ${this.h} has been created.`)}appendRule(a){if(null!=this.a&&!this.l.some(b=>b===a)){const b=CN(this,a);if(DN(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug(`Added CSS rule ${b}`)}catch(c){this.g.error(`An error occurred when adding a CSS rule: ${b}`)}this.l.push(a)}else this.g.warn(`Stylesheet ${this.h} ignoring the CSS rule `+
23
- `because it's not safe: ${b}`)}}destroy(){const a=this;return _.x(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],EN(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.f.ownerNode),a.a=null,a.f=null,a.g.debug(`Stylesheet ${a.h} has been destroyed.`))})}};var WN=class extends _.ht{constructor(a){super(a);this.g=new _.R(SM);this.m=a;this.M=FN(a);this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new VN(a,"CLPP Subtitle Styles");this.a=new UN(null,"clpp-text-container",{});this.A=new _.at(a.getSurface(),this.V.bind(this));this.J=null;this.F?(this.F.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.G=
24
- new _.mj(()=>{LN(this)});this.B=new Map;this.o=null}append(a,b){if(null!=this.j&&0!==a.length){for(const c of b)this.j.appendRule(c);a.sort((c,d)=>c.startTime!==d.startTime?c.startTime-d.startTime:c.endTime-d.endTime);this.f=VM(this.f,UM(a));this.o=null;LN(this,!1)}}h(){null==this.j||LN(this,!0)}destroy(){const a=this;return _.x(function*(){null!=a.j&&(MN(a),a.G.stop(),yield a.j.destroy(),a.j=null,a.F.removeChild(a.a.a),a.a=null,a.A.stop(),a.A=null,a.l=!1)})}remove(a,b){if(null==this.j)return!1;this.f=
25
- this.f.filter(c=>c.startTime<a||c.endTime>=b);this.o=null;LN(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.bb(.25),this.M.enableResizeObserver&&this.A.start(),LN(this,!0)):(this.G.stop(),this.A.stop(),MN(this)))}Oc(){return this.f}V(){LN(this,!0)}};_.z(SM,WN);WN.prototype.setTextVisibility=WN.prototype.setTextVisibility;WN.prototype.isTextVisible=WN.prototype.isTextVisible;WN.prototype.remove=WN.prototype.remove;
26
- WN.prototype.destroy=WN.prototype.destroy;WN.prototype.append=WN.prototype.append;var XN=class{da(a){return!!a.enableHtmlCue&&!_.Cj()}create(a){return new WN(a)}};_.z("clpp.htmlcue.HtmlCueComponent",class extends _.Ks{f(){_.Vm(_.Td,new XN)}a(){_.Tm.has(_.Td)&&(_.Tm.delete(_.Td),_.Um.info("Removed factory: 'html'"))}id(){return _.yf}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var mN="Unsupported unit",nN="clpp-text-plain",oN="clpp-text-ttml",pN="clpp.htmlcue.HtmlTextDisplayer",qN="initial",rN=function(a){return _.lh(a,{Me:(b,c)=>b.md(c)})},sN=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)},tN=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},uN=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},wN=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>vN[c]);return a},yN=function(a,b){xN(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{xN(a,c)})},xN=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},zN=function(a,b){return 0===a?"0":a+b},AN=function(a,b){return 1>Math.abs(a-b)||a<b},BN=function(a,b){return a<b&&1<Math.abs(a-b)},CN=function(a,b){return a>b&&1<Math.abs(a-b)},DN=
3
+ function(a,b){return 1>Math.abs(a-b)||a>b},FN=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 EN(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
4
+ d-e)},GN=function(a){return new EN(a.left,a.f,a.top,a.a,a.height,a.width)},HN=function(a,b){return b.some(c=>BN(a.left,c.f)&&CN(a.f,c.left)&&BN(a.top,c.a)&&CN(a.a,c.top))},IN=function(a,b){return DN(a.top,b.top)&&AN(a.a,b.a)&&DN(a.left,b.left)&&AN(a.f,b.f)},JN=function(a,b,c){switch(c){case "+x":return BN(a.left,b.left);case "-x":return CN(a.f,b.f);case "+y":return BN(a.top,b.top);case "-y":return CN(a.a,b.a);default:throw Error("Unknown axis");}},KN=function(a){return a.f.writingMode===_.Ir},LN=
5
+ 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 KN(a)?b:c},MN=function(a){switch(a.f.writingMode){case _.Ir:return"horizontal-tb";case _.Vf:return _.Vf;case _.Wf:return _.Wf;default:throw Error("Unknown writing mode");}},NN=function(a){switch(a.f.positionAlign){case _.he:return _.ee;case "auto":case _.Vc:return _.Hr;case _.ie:return _.mf}return a.f.textAlign},ON=function(a,b){if(typeof a.f.position===_.r&&typeof a.f.size===
6
+ _.r)switch(b){case _.he:return a.f.position;case "auto":case _.Vc:return a.f.position-a.f.size/2;case _.ie:return a.f.position-a.f.size}return 0},PN=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ee:case _.ee:return _.he;case _.Hr:return _.Vc;case _.mf:case _.mf:return _.ie}return a.f.positionAlign},SN=function(a,b,c){return(QN(a)||RN(a))&&_.Fg(c)?zN(c,_.ef):QN(a)&&_.z(c)?zN(0,_.ef):KN(a)&&_.Fg(b)?zN(b,"%"):qN},TN=function(a,b,c){return KN(a)&&_.Fg(c)?zN(c,_.ef):(QN(a)||RN(a))&&_.Fg(b)?
7
+ zN(b,"%"):qN},RN=function(a){return a.f.writingMode===_.Wf},QN=function(a){return a.f.writingMode===_.Vf},UN=function(a,b){if(a.j)switch(b.writingMode){case _.Ir:return["-y"];case _.Vf:return["+x"];case _.Wf:return["-x"]}a=[];switch(b.writingMode){case _.Ir:a=["+y","-y"];break;case _.Vf:a=["+x","-x"];break;case _.Wf:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},VN=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=FN(a.l.a)},WN=function(a,b){VN(a.g);a.l.unshift(b);
8
+ for(const c of a.l)a.g.append(c)},XN=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.Pr)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(mN);},ZN=function(a,b,c,d){const e=document.createElement(_.Af),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);c=document.head;c.appendChild(e);YN(a,c,b);a.h.debug(`Created HTML style element #${b}.`);return e.sheet},$N=function(a,b){a=`.${a.j} .clpp-text-container`;
9
+ 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,a)},aO=function(a,b){let c=!1;try{a.f.insertRule(b,0);const d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(e=>0===e.trim().indexOf(`.${a.j} `)))}catch(d){}0<a.f.cssRules.length&&a.f.deleteRule(0);
10
+ return c},bO=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}},YN=function(a,b,c){const d=new MutationObserver(e=>{e.forEach(f=>{f.removedNodes.forEach(g=>{g.id===c&&a.h.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())},cO=function(a){a=_.yg(a.htmlcue||{});_.z(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.z(a.enableResizeObserver)&&(a.enableResizeObserver=
11
+ !0);return a},iO=function(a,b){if((b||a.l)&&a.F){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Fn)if(a.J=c,c=dO(a,c),b||(b=a.o,b=!(null===b&&null===c||null!==b&&null!==c&&b.start===c.start&&b.end===c.end)),b&&(a.o=c,eO(a),c)){b={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.yr(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 _.cg:g="clpp-text-vtt";
12
+ break;case _.Hf:g=oN;break;case _.Gr:g=nN}g&&!f.classList.contains(g)&&_.ao(f,g);f=FN(c.a.a);if(0===f.width||0===f.height)c.h.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");else{xN({fontSize:fO(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.cg;var h=d.payloadType===_.Hf;d.region&&(g||h||d.backgroundImage)&&(c.B.has(d.region.id)?f=c.B.get(d.region.id):(f=new gO(d.region,
13
+ {}),c.B.set(d.region.id,f),WN(c.a,f)));d=new hO(d,c.M,e);f?WN(f,d):WN(c.a,d)}}}}},jO=function(a){eO(a);a.J=null;a.o=null;a.f=[]},kO=function(a,b){return a.startTime<=b&&a.endTime>b},dO=function(a,b){var c=tN(a.f,d=>kO(d,b)?0:b!==d.startTime?b-d.startTime:b-d.endTime);if(-1===c)return null;{let d=c;for(;0<=d-1&&kO(a.f[d-1],b);)d--;for(;c+1<a.f.length&&kO(a.f[c+1],b);)c++;return{start:d,end:c}}},eO=function(a){a.B.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(oN);
14
+ b.classList.remove(nN);a=a.a;VN(a.g);a.l=[]}},fO=function(a,b){const c=FN(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.C)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`},oO=class{parse(a){a={input:a};const b=_.co(_.Bd),c=[];let d=b;for(var e;null!==(e=uN(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);
15
+ else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=lO[f];h?(h=_.co(h),(f=mO[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||nO[g.localName]&&nO[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(wN(e)));return b}},lO={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},mO={v:"voice",lang:"lang"},nO={rt:"ruby"},vN={"\x26amp;":"\x26",
16
+ "\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var EN=class{constructor(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f}};var pO=class{constructor(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1}init(){this.j=!0}A(){return!1}};var hO=class extends pO{constructor(a,b,c){super(a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.g=!!this.f.backgroundImage;this.C=c}A(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.g)_.ao(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage=`url("${this.f.backgroundImage}")`,this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Hf){var c=_.co(_.Bd);c.innerHTML=b.payload;b=c}else b.payloadType===
17
+ _.cg?b=(new oO).parse(b.payload):(c=_.co(_.Bd),c.textContent=b.payload,b=c);_.ao(b,this.w);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.ao(b,d);xN({writingMode:MN(this)},b);var d=b;this.a.appendChild(d);_.ao(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.ao(this.a,`clpp-text-wrapper__${e}`);_.z(this.f.line)&&(this.f.lineInterpretation=_.Jr,this.f.line=KN(this)?-1:0);e=MN(this);xN({writingMode:e,webkitWritingMode:e,direction:qN,textAlign:NN(this)},this.a);if(!this.f.region||
18
+ !this.f.region.displayAlign){e=ON(this,PN(this));xN({position:"absolute",left:SN(this,e,null),right:RN(this)&&_.z(null)?zN(0,_.ef):qN,top:TN(this,e,null),width:KN(this)?zN(this.f.size,"%"):qN,height:QN(this)||RN(this)?zN(this.f.size,"%"):qN},this.a);b=this.f;a=KN(this)?a.height:a.width;c=LN(this);if(b.lineInterpretation===_.Jr){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 _.Od:g-=f}f=Math.round(g/
19
+ 100*a)}RN(this)&&(f=a-f-c);a=f;xN({left:SN(this,e,a),right:RN(this)&&_.z(a)?zN(0,_.ef):qN,top:TN(this,e,a)},this.a)}yN(this.C,d)}}o(){return _.co(_.Bd)}};var qO=class{constructor(a,b){this.l=a;this.f=a.a;this.j=void 0===b?!1:b;this.a=FN(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.Vd;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=FN(a.a);var d=UN(this,a.f),e=LN(a);const g=GN(c);let h=null,k=0;for(const l of d){for(;JN(c,this.a,l)||IN(c,this.a)&&HN(c,this.g);){d=c;var f=e;switch(l){case "+x":d.left+=f;d.f+=f;break;case "-x":d.left-=f;d.f-=f;break;case "+y":d.top+=f;d.a+=f;break;case "-y":d.top-=f,d.a-=f}}if(this.j||IN(c,this.a))break a;
20
+ d=this.a;d=Math.max(0,Math.min(c.f,d.f)-Math.max(c.left,d.left))*Math.max(0,Math.min(c.a,d.a)-Math.max(c.top,d.top))/(c.height*c.width);d>k&&(h=GN(c),k=d);c=GN(g)}c=h||g}xN({top:zN(c.top-this.a.top,_.ef),bottom:zN(this.a.a-c.a,_.ef),left:zN(c.left-this.a.left,_.ef),right:zN(this.a.f-c.f,_.ef),height:zN(c.height,_.ef),width:zN(c.width,_.ef)},a.a)}b.style.visibility="visible";this.g.push(FN(a.a))}};var rO=class extends pO{constructor(a,b,c){super(a,b,c);this.g=null;this.l=[]}init(){this.g=new qO(this);this.j=!0}o(){const a=_.co(_.Bd);_.ao(a,this.w);this.id&&(a.id=this.id);return a}};var gO=class extends rO{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 _.Pr:b=b.width/100*a.width;break a;default:throw Error(mN);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Pr)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(mN);d=a.height;const e=XN(this,d,a.height);xN(this.B,this.a);xN({left:zN(c,_.ef),top:zN(e,_.ef),width:zN(b,
21
+ _.ef),height:zN(d,_.ef)},this.a);this.f.writingMode&&xN({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&xN({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.ao(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.Pr:f=f.height/100*a.height;break a;case 2:f=f.height;c=new hO(new _.Mr(0,1,"Lorem ipsum",_.Gr),{},{});b=c.a;this.a.appendChild(b);c.init(FN(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
22
+ b=c;f*=b;break a;default:throw Error(mN);}a=XN(this,f,a.height);xN({top:zN(a,_.ef),height:zN(f,_.ef)},this.a);this.g=new qO(this,!0);this.j=!0}getId(){return this.f.id}};var sO=class{constructor(a,b){this.h=new _.R("clpp.htmlcue.StyleManager");this.o=[];this.j=a;this.g=b;this.l=[];this.a=ZN(this,this.g,this.j);this.f=ZN(this,this.g,this.j,!0);this.f.disabled=!0;this.h.debug(`Stylesheet ${this.g} has been created.`)}appendRule(a){if(null!=this.a&&!this.l.some(b=>b===a)){const b=$N(this,a);if(aO(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.h.debug(`Added CSS rule ${b}`)}catch(c){this.h.error(`An error occurred when adding a CSS rule: ${b}`)}this.l.push(a)}else this.h.warn(`Stylesheet ${this.g} ignoring the CSS rule `+
23
+ `because it's not safe: ${b}`)}}destroy(){const a=this;return _.w(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],bO(a),document.head.removeChild(a.a.ownerNode),document.head.removeChild(a.f.ownerNode),a.a=null,a.f=null,a.h.debug(`Stylesheet ${a.g} has been destroyed.`))})}};var tO=class extends _.Ft{constructor(a){super(a);this.h=new _.R(pN);this.m=a;this.M=cO(a.getConfiguration());this.l=!1;this.f=[];this.F=a.getSurface().getContainer();this.j=new sO(a.getSurface().getUniqueCssClass(),"CLPP Subtitle Styles");this.a=new rO(null,"clpp-text-container",{});this.A=new _.yt(a.getSurface(),this.V.bind(this));this.J=null;this.F?(this.F.appendChild(this.a.a),this.a.init(null)):this.h.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
24
+ this.G=new _.zj(()=>{iO(this)});this.B=new Map;this.o=null}append(a,b){if(null!=this.j&&0!==a.length){for(const c of b)this.j.appendRule(c);a.sort((c,d)=>c.startTime!==d.startTime?c.startTime-d.startTime:c.endTime-d.endTime);this.f=sN(this.f,rN(a));this.o=null;iO(this,!1)}}g(){null==this.j||iO(this,!0)}destroy(){const a=this;return _.w(function*(){null!=a.j&&(jO(a),a.G.stop(),yield a.j.destroy(),a.j=null,a.F.removeChild(a.a.a),a.a=null,a.A.stop(),a.A=null,a.l=!1)})}remove(a,b){if(null==this.j)return!1;
25
+ this.f=this.f.filter(c=>c.startTime<a||c.endTime>=b);this.o=null;iO(this,!0);return!0}isTextVisible(){return this.l}setTextVisibility(a){null!=this.j&&this.l!==a&&((this.l=a)?(this.G.bb(.25),this.M.enableResizeObserver&&this.A.start(),iO(this,!0)):(this.G.stop(),this.A.stop(),jO(this)))}Oc(){return this.f}V(){iO(this,!0)}};_.x(pN,tO);tO.prototype.setTextVisibility=tO.prototype.setTextVisibility;tO.prototype.isTextVisible=tO.prototype.isTextVisible;tO.prototype.remove=tO.prototype.remove;
26
+ tO.prototype.destroy=tO.prototype.destroy;tO.prototype.append=tO.prototype.append;var uO=class{isSupported(a){return!!a.enableHtmlCue&&!_.Pj()}create(a){return new tO(a)}};_.x("clpp.htmlcue.HtmlCueComponent",class extends _.ht{f(){_.jn(_.Wd,new uO)}a(){_.gn.has(_.Wd)&&(_.gn.delete(_.Wd),_.hn.info("Removed factory: 'html'"))}id(){return _.Bf}});};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 yM="clpp.ima.AdsManagerFactory",zM=function(a){a=a.I;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Kc?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
- _.Kc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},AM=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.qj()},BM=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.la.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.uc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.eb.bind(a));c.on(b,d.AD_PROGRESS,a.Gb.bind(a));c.on(b,d.AD_BUFFERING,a.Oa.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.fb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.gb.bind(a));c.on(b,d.RESUMED,a.Tb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Z.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.cb.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.vc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Wb.bind(a))},CM=function(a,b){const c=b?a.ea.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},DM=function(a,
4
- b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.C)});a.m.trigger(new _.F(b,d))},EM=function(a){a.B=null;DM(a,_.kc);a.o&&a.m.getSurface().hide(a.o)},FM=function(a){_.Nn(a.A,{visibility:"visible"})},HM=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||AM(a)?GM(a):(DM(a,_.Ic),a.g.warn(_.ja))})},IM=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();GM(a)})},GM=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
- google.ima.ViewMode.NORMAL);a.H=!0},JM=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c}rb(){return"Google IMA SDK"}sb(){return google.ima.VERSION}yb(){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()}fc(){return this.f?
6
- this.f.getIsBumper():!1}Jb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.ve&&typeof b[d].clickThroughUrl===_.vf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}vb(){return this.a.getVastMediaWidth()}ub(){return this.a.getVastMediaHeight()}kb(){return this.a.getVastMediaBitrate()}Wa(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Kb(){return this.f?this.f.getTimeOffset():0}Lb(){return this.f?this.f.getAdPosition():
7
- 1}xb(){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.xb;X.prototype.getPositionInSequence=X.prototype.Lb;
8
- X.prototype.getPodTimeOffset=X.prototype.Kb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Wa;X.prototype.getMediaBitrate=X.prototype.kb;X.prototype.getMediaHeight=X.prototype.ub;X.prototype.getMediaWidth=X.prototype.vb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Jb;X.prototype.isBumper=X.prototype.fc;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.yb;X.prototype.getAdManagerVersion=X.prototype.sb;X.prototype.getAdManagerName=X.prototype.rb;var KM=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 LM=class{constructor(a){this.a=a}getCuePoints(){return this.a}Mb(){return 0<=this.a.indexOf(0)||0===this.a.length}lb(){return 0<=this.a.indexOf(-1)}};LM.prototype.hasPostroll=LM.prototype.lb;LM.prototype.hasPreroll=LM.prototype.Mb;LM.prototype.getCuePoints=LM.prototype.getCuePoints;var MM=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.vg(a.ima||{});this.I=a=_.ug({disableCustomPlayback:!1},a);this.o=this.m.bc("ima").wc();this.N=this.m.bc("ima").h;this.l=this.m.bc("ima").a;this.K=new _.ct;this.g=new _.R("clpp.ima");this.h=this.a=null;this.f=new _.wm;this.H=!1;this.w=new _.ir;this.ea=new KM;this.B=null;this.M=this.G=this.C=this.F=!1;this.J=this.j=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
- this.Vb.bind(this));a.on(this.l,b,this.Ub.bind(this));a.on(this.m,_.Md,this.Yb.bind(this))}}Vb(a){this.a=a.getAdsManager(this.A,zM(this));this.a.isCustomPlaybackUsed()&&!AM(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.h=new _.at(this.m.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new LM(a),this.m.trigger(new _.F(_.nc,
11
- {adsTimeline:this.j})),BM(this));this.f.resolve()}Ub(a){CM(this,a.getError());this.f.resolve()}uc(a){const b=this;return _.x(function*(){b.G=!0;AM(b)||(yield b.m.pause(),_.Nn(b.A,{visibility:_.Sd}));DM(b,_.Wb,a);b.h.start()})}la(){const a=this;return _.x(function*(){if(AM(a)){a.J=a.m.getPosition();yield a.m.detach();var b=a.m;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?DM(this,_.dc,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}aa(a){this.B=a.getAd().getDuration();
12
- DM(this,_.jc,a);this.m.getSurface().show(this.o)}eb(a){a=a.getAdData();CM(this,a?a.adError:null);EM(this)}Gb(a){DM(this,_.gc,a)}Oa(a){DM(this,_.Zb,a)}T(a){DM(this,_.bc,a)}fb(a){DM(this,_.ec,a)}ba(a){DM(this,_.lc,a)}gb(a){DM(this,_.fc,a)}Tb(a){DM(this,_.hc,a)}R(a){this.pause();DM(this,_.$b,a)}Z(a){DM(this,_.ic,a);EM(this)}V(a){DM(this,_.cc,a)}cb(a){DM(this,_.ac,a);EM(this)}vc(){const a=this;return _.x(function*(){a.F=!0;if(AM(a)&&null!==a.J){var b=a.m;b.a&&b.a.addDelegate(b);yield _.Go(a.m);a.C||(yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();
13
- FM(a)}a.G=!1;a.h&&a.h.stop();a.C||(yield a.m.play());DM(a,_.Xb)})}Wb(){this.M=!0}Yb(){this.C=!0;this.l.contentComplete()}load(){const a=this;return _.x(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.vf)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.K.canPlay(!1);const d=yield a.K.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
14
- a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(e);return a.f})}start(a){const b=this;return _.x(function*(){b.a&&b.j&&!b.H?b.j.Mb()?yield HM(b):yield IM(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.B)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.B-a}dispose(){return(new Promise(a=>
15
- {this.H&&this.j&&this.j.lb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.Vg(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.l.contentComplete()})).then(()=>{FM(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};MM.prototype.getPosition=MM.prototype.getPosition;
16
- MM.prototype.setVolume=MM.prototype.setVolume;MM.prototype.getVolume=MM.prototype.getVolume;MM.prototype.skip=MM.prototype.skip;MM.prototype.pause=MM.prototype.pause;MM.prototype.resume=MM.prototype.resume;var NM=class extends _.kt{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(JM())return a.onError(new _.H(1,9,1E4));this.f=_.Ln(_.zd,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.pa);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
17
- (this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}mg(){return this.a}kg(){return this.h}wc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",NM);NM.prototype.getAdContainer=NM.prototype.wc;NM.prototype.getAdDisplayContainer=NM.prototype.kg;NM.prototype.getAdsLoader=NM.prototype.mg;NM.Id="ima";NM.isSdkMissing=JM;_.so(new class{create(){return new NM}});var OM=class{constructor(){this.a=new _.R(yM)}name(){return yM}da(a,b){return a.namespace()===_.dd?!1:JM()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new MM(a)}};OM.prototype.create=OM.prototype.create;OM.prototype.isSupported=OM.prototype.da;OM.prototype.name=OM.prototype.name;_.In(new OM);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var WM="clpp.ima.AdsManagerFactory",XM=function(a){a=a.I;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Mc?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
+ _.Mc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},YM=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Dj()},ZM=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.oa.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.uc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.eb.bind(a));c.on(b,d.AD_PROGRESS,a.Tb.bind(a));c.on(b,d.AD_BUFFERING,a.Oa.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.U.bind(a));c.on(b,d.MIDPOINT,a.fb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.qb.bind(a));c.on(b,d.RESUMED,a.Sb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Z.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.cb.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.vc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Wb.bind(a))},$M=function(a,b){const c=b?a.fa.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},aN=function(a,
4
+ b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.C)});a.m.trigger(new _.C(b,d))},bN=function(a){a.B=null;aN(a,_.lc);a.o&&a.m.getSurface().hide(a.o)},cN=function(a){_.bo(a.A,{visibility:"visible"})},eN=function(a){return _.w(function*(){a.O.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||YM(a)?dN(a):(aN(a,_.Kc),a.h.warn(_.ja))})},fN=function(a,b){return _.w(function*(){a.O.initialize();yield b.play();dN(a)})},dN=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.H=!0},gN=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.g=c}sb(){return"Google IMA SDK"}tb(){return google.ima.VERSION}zb(){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()}dc(){return this.f?
6
+ this.f.getIsBumper():!1}Ib(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.ye&&typeof b[d].clickThroughUrl===_.yf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}wb(){return this.a.getVastMediaWidth()}vb(){return this.a.getVastMediaHeight()}jb(){return this.a.getVastMediaBitrate()}Wa(){return this.g?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Jb(){return this.f?this.f.getTimeOffset():0}Kb(){return this.f?this.f.getAdPosition():
7
+ 1}yb(){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.yb;X.prototype.getPositionInSequence=X.prototype.Kb;
8
+ X.prototype.getPodTimeOffset=X.prototype.Jb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Wa;X.prototype.getMediaBitrate=X.prototype.jb;X.prototype.getMediaHeight=X.prototype.vb;X.prototype.getMediaWidth=X.prototype.wb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Ib;X.prototype.isBumper=X.prototype.dc;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.zb;X.prototype.getAdManagerVersion=X.prototype.tb;X.prototype.getAdManagerName=X.prototype.sb;var hN=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 iN=class{constructor(a){this.a=a}getCuePoints(){return this.a}Lb(){return 0<=this.a.indexOf(0)||0===this.a.length}kb(){return 0<=this.a.indexOf(-1)}};iN.prototype.hasPostroll=iN.prototype.kb;iN.prototype.hasPreroll=iN.prototype.Lb;iN.prototype.getCuePoints=iN.prototype.getCuePoints;var jN=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.yg(a.ima||{});this.I=a=_.xg({disableCustomPlayback:!1},a);this.o=this.m.$b("ima").wc();this.O=this.m.$b("ima").g;this.l=this.m.$b("ima").a;this.K=new _.At;this.h=new _.R("clpp.ima");this.g=this.a=null;this.f=new _.Km;this.H=!1;this.w=new _.Er;this.fa=new hN;this.B=null;this.M=this.G=this.C=this.F=!1;this.J=this.j=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
+ this.Vb.bind(this));a.on(this.l,b,this.Ub.bind(this));a.on(this.m,_.Pd,this.qc.bind(this))}}Vb(a){this.a=a.getAdsManager(this.A,XM(this));this.a.isCustomPlaybackUsed()&&!YM(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.yt(this.m.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new iN(a),this.m.trigger(new _.C(_.oc,
11
+ {adsTimeline:this.j})),ZM(this));this.f.resolve()}Ub(a){$M(this,a.getError());this.f.resolve()}uc(a){const b=this;return _.w(function*(){b.G=!0;YM(b)||(yield b.m.pause(),_.bo(b.A,{visibility:_.Vd}));aN(b,_.Xb,a);b.g.start()})}oa(){const a=this;return _.w(function*(){if(YM(a)){a.J=a.m.getPosition();yield a.m.detach();var b=a.m;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?aN(this,_.ec,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}aa(a){this.B=a.getAd().getDuration();
12
+ aN(this,_.kc,a);this.m.getSurface().show(this.o)}eb(a){a=a.getAdData();$M(this,a?a.adError:null);bN(this)}Tb(a){aN(this,_.hc,a)}Oa(a){aN(this,_.$b,a)}U(a){aN(this,_.cc,a)}fb(a){aN(this,_.fc,a)}ba(a){aN(this,_.mc,a)}qb(a){aN(this,_.gc,a)}Sb(a){aN(this,_.ic,a)}R(a){this.pause();aN(this,_.ac,a)}Z(a){aN(this,_.jc,a);bN(this)}V(a){aN(this,_.dc,a)}cb(a){aN(this,_.bc,a);bN(this)}vc(){const a=this;return _.w(function*(){a.F=!0;if(YM(a)&&null!==a.J){var b=a.m;b.a&&b.a.addDelegate(b);yield _.Uo(a.m);a.C||(yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();
13
+ cN(a)}a.G=!1;a.g&&a.g.stop();a.C||(yield a.m.play());aN(a,_.Zb)})}Wb(){this.M=!0}qc(){this.C=!0;this.l.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.yf)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.K.canPlay(!1);const d=yield a.K.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
14
+ a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(e);return a.f})}start(a){const b=this;return _.w(function*(){b.a&&b.j&&!b.H?b.j.Lb()?yield eN(b):yield fN(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.B)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.B-a}dispose(){return(new Promise(a=>
15
+ {this.H&&this.j&&this.j.kb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.Yg(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.l.contentComplete()})).then(()=>{cN(this);this.w.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};jN.prototype.getPosition=jN.prototype.getPosition;
16
+ jN.prototype.setVolume=jN.prototype.setVolume;jN.prototype.getVolume=jN.prototype.getVolume;jN.prototype.skip=jN.prototype.skip;jN.prototype.pause=jN.prototype.pause;jN.prototype.resume=jN.prototype.resume;var kN=class extends _.It{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(gN())return a.onError(new _.H(1,9,1E4));this.f=_.$n(_.Bd,{"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(_.pa);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)}kg(){return this.a}ig(){return this.g}wc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",kN);kN.prototype.getAdContainer=kN.prototype.wc;kN.prototype.getAdDisplayContainer=kN.prototype.ig;kN.prototype.getAdsLoader=kN.prototype.kg;kN.Id="ima";kN.isSdkMissing=gN;_.Ho(new class{create(){return new kN}});var lN=class{constructor(){this.a=new _.R(WM)}name(){return WM}isSupported(a,b){return a.namespace()===_.fd?!1:gN()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new jN(a)}};lN.prototype.create=lN.prototype.create;lN.prototype.isSupported=lN.prototype.isSupported;lN.prototype.name=lN.prototype.name;_.Xn(new lN);};f.call(g, window);