@castlabs/prestoplay 6.4.0 → 6.5.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 (58) hide show
  1. package/CHANGELOG.md +57 -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 +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +421 -402
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +54 -133
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +47 -49
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -32
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +258 -255
  17. package/cjs/cl.muxdata.js +12 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +69 -69
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -20
  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 +363 -351
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +49 -132
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +40 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +230 -231
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +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 +15 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -16
  58. package/package.json +8 -2
package/cl.freewheel.js CHANGED
@@ -1,19 +1,19 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var bI="clpp-freewheel",cI="clpp.freewheel.AdsManagerFactory",dI="freewheel",eI=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},fI=function(a){const b=[];typeof a.networkId!==_.p&&b.push("networkId");typeof a.serverUrl!==_.je&&b.push("serverUrl");typeof a.profileId!==_.je&&b.push("profileId");typeof a.videoAssetId!==_.je&&typeof a.videoAssetId!==_.p&&b.push("videoAssetId");
2
- if(b.length)throw new _.G(1,9,12001,{missingKeys:b.join(", ")});},gI=function(){return _.w(function*(){var a=new _.xp;let b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE;const c=yield a.canPlay(!1);a=yield a.canPlay(!0);c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:a&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return b})},hI=function(a){a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.H.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.J.bind(a));a.g.on(a.a,
3
- tv.freewheel.SDK.EVENT_SLOT_ENDED,a.I.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.F.bind(a));a.g.on(a.l,_.re,a.D.bind(a));a.g.on(a.l,_.ge,a.C.bind(a))},kI=function(a){return _.w(function*(){a.A.length?(iI(a),a.f=a.A.shift(),a.f.play()):(jI(a),yield a.l.a.play())})},jI=function(a){const b=a.l.Rb(dI).lc();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},iI=function(a){const b=a.l.Rb(dI).lc();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),a.a.registerVideoDisplayBase(bI),
4
- a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},lI=function(a){a.w.length?(iI(a),a.f=a.w.shift(),a.f.play()):jI(a)},mI=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new W(a.a,c,d)});a.l.trigger(new _.C(b,d))},nI=class extends _.Ep{constructor(){super();this.f=this.a=null}onPlayerCreated(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.El(_.Jc,{id:bI}),this.f=_.El(_.v,{"class":_.rc}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,
5
- !0),a.getSurface().hide(this.a);else a.onError(new _.G(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)}id(){return dI}lc(){return this.a}jf(){return this.f}};_.y("clpp.freewheel.FreeWheelPlugin",nI);nI.prototype.getAdVideo=nI.prototype.jf;nI.prototype.getAdContainer=nI.prototype.lc;nI.Id=dI;nI.AD_CONTAINER_ID=bI;_.km(new class{create(){return new nI}});var W=class{constructor(a,b,c){this.g=a;this.f=b;this.a=c}mb(){return"FreeWheel AdManager SDK"}nb(){return tv.freewheel.SDK.version}sb(){return 0}getId(){return this.a?this.a.getAdId():""}getCreativeId(){const a=(this.a||{})._creativeId;return typeof a===_.je?a:""}getApiFramework(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a?this.a.getActiveCreativeRendition().getDuration():
6
- 0}getSkipTimeOffset(){return 0}Vb(){return!1}Bb(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""}getMediaUrl(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""}pb(){return this.a?this.a.getActiveCreativeRendition().getWidth():0}ob(){return this.a?this.a.getActiveCreativeRendition().getHeight():0}cb(){return 0}Oa(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;
7
- case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.Oa()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1}Cb(){switch(this.Oa()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}}Db(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1}rb(){return this.f.getAdCount()}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}};
8
- W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.rb;W.prototype.getPositionInSequence=W.prototype.Db;W.prototype.getPodTimeOffset=W.prototype.Cb;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Oa;W.prototype.getMediaBitrate=W.prototype.cb;W.prototype.getMediaHeight=W.prototype.ob;
9
- W.prototype.getMediaWidth=W.prototype.pb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.Bb;W.prototype.isBumper=W.prototype.Vb;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getDuration=W.prototype.getDuration;W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;
10
- W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.sb;W.prototype.getAdManagerVersion=W.prototype.nb;W.prototype.getAdManagerName=W.prototype.mb;var oI=class{constructor(a){this.a=a}getCuePoints(){return this.a.getTemporalSlots().map(a=>{switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})}Eb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length}eb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length}};
11
- oI.prototype.hasPostroll=oI.prototype.eb;oI.prototype.hasPreroll=oI.prototype.Eb;oI.prototype.getCuePoints=oI.prototype.getCuePoints;var pI=class{constructor(a){this.B=new _.N("clpp.freewheel.AdsManager");this.l=a;this.g=new _.Nn;this.o=new tv.freewheel.SDK.AdManager;this.f=this.a=null;this.A=[];this.m=[];this.w=[];this.j=new _.mk;this.h=null}load(){const a=this;return _.w(function*(){const b=a.l.getConfiguration().freewheel||{};try{fI(b)}catch(d){return a.l.onError(d),a.j.resolve(),a.j}a.o.setNetwork(b.networkId);a.o.setServer(b.serverUrl);a.a=a.o.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.je&&typeof b.siteSectionId!==
12
- _.p||a.a.setSiteSection(b.siteSectionId);const c=yield gI();a.a.setVideoAsset(b.videoAssetId,a.l.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(const d of b.pods)a.a.addTemporalSlot(d.id,eI(d.type),d.position,d.slotProfile,d.cuepointSequence,d.maxDuration,d.minDuration,d.acceptContentType);b.keyValues&&typeof b.keyValues===_.xd&&Object.keys(b.keyValues).forEach(d=>a.a.addKeyValue(d,b.keyValues[d]));a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);
13
- if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);hI(a);a.a.submitRequest();return a.j})}start(){const a=this;return _.w(function*(){yield kI(a)})}resume(){this.f&&this.f.resume()}pause(){this.f&&this.f.pause()}skip(){this.f&&this.f.skipCurrentAd()}getVolume(){return this.a?this.a.getAdVolume():1}setVolume(a){this.a&&this.a.setAdVolume(a)}getPosition(){return this.f?this.f.getPlayheadTime():-1}dispose(){const a=this;return _.w(function*(){a.g.release();
14
- a.h&&(a.h.stop(),a.h=null);jI(a);a.a&&(a.a.dispose(),a.a=null)})}H(a){if(a.success)this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.m=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.w=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.l.trigger(new _.C(_.Hb,{adsTimeline:new oI(this.a)})),this.h=new _.vp(this.l.getSurface(),(b,c)=>this.a.resize(b,c),this.l.Rb(dI).f);else this.l.onError(new _.G(1,
15
- 9,10003,{errorType:0},void 0));this.j.resolve()}J(a){mI(this,_.qb,a);this.h.start()}I(a){this.f=null;a=a.slot;mI(this,_.rb);this.h.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:kI(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:jI(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:lI(this)}}F(a){const b=a.subType;this.B.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:mI(this,_.Db,a);mI(this,
16
- _.wb,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:mI(this,_.Eb,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:mI(this,_.vb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:mI(this,_.yb,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:mI(this,_.Fb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:mI(this,_.ub,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:mI(this,_.tb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:mI(this,_.zb,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:mI(this,
17
- _.Bb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:mI(this,_.Cb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:mI(this,_.sb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:mI(this,_.Ab,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.l.onError(new _.G(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}}D(){if(!this.f){var a=this.l.getPosition();if(this.f=this.m.find(b=>
18
- .5>Math.abs(a-b.getTimePosition()))||null){const b=this.m.findIndex(c=>c===this.f);this.m.splice(b,1);this.l.pause();iI(this);this.f.play()}}}C(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.ll:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.kl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.$k:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);lI(this);break;case _.il:case _.hl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}}};
19
- pI.prototype.getPosition=pI.prototype.getPosition;pI.prototype.setVolume=pI.prototype.setVolume;pI.prototype.getVolume=pI.prototype.getVolume;pI.prototype.skip=pI.prototype.skip;pI.prototype.pause=pI.prototype.pause;pI.prototype.resume=pI.prototype.resume;pI.prototype.start=pI.prototype.start;var qI=class{constructor(){this.a=new _.N(cI)}name(){return cI}Y(a,b){return a.namespace()===_.tc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)}create(a){return new pI(a)}};qI.prototype.create=qI.prototype.create;qI.prototype.isSupported=qI.prototype.Y;qI.prototype.name=qI.prototype.name;_.Bl(new qI);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var xI="clpp-freewheel",yI="clpp.freewheel.AdsManagerFactory",zI="freewheel",AI=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},BI=function(a){const b=[];typeof a.networkId!==_.p&&b.push("networkId");typeof a.serverUrl!==_.me&&b.push("serverUrl");typeof a.profileId!==_.me&&b.push("profileId");typeof a.videoAssetId!==_.me&&typeof a.videoAssetId!==_.p&&b.push("videoAssetId");
2
+ if(b.length)throw new _.H(1,9,12001,{missingKeys:b.join(", ")});},CI=function(){return _.w(function*(){var a=new _.Xp;let b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE;const c=yield a.canPlay(!1);a=yield a.canPlay(!0);c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:a&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return b})},DI=function(a){a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.I.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.K.bind(a));a.g.on(a.a,
3
+ tv.freewheel.SDK.EVENT_SLOT_ENDED,a.J.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.G.bind(a));a.g.on(a.l,_.ue,a.F.bind(a));a.g.on(a.l,_.je,a.C.bind(a))},GI=function(a){return _.w(function*(){a.A.length?(EI(a),a.f=a.A.shift(),a.f.play()):(FI(a),yield a.l.a.play())})},FI=function(a){const b=a.l.Vb(zI).nc();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},EI=function(a){const b=a.l.Vb(zI).nc();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),a.a.registerVideoDisplayBase(xI),
4
+ a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},HI=function(a){a.w.length?(EI(a),a.f=a.w.shift(),a.f.play()):FI(a)},II=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new W(a.a,c,d)});a.l.trigger(new _.C(b,d))},JI=class extends _.bq{constructor(){super();this.f=this.a=null}onPlayerCreated(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.gm(_.Nc,{id:xI}),this.f=_.gm(_.v,{"class":_.vc}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,
5
+ !0),a.getSurface().hide(this.a);else a.onError(new _.H(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)}id(){return zI}nc(){return this.a}qf(){return this.f}};_.x("clpp.freewheel.FreeWheelPlugin",JI);JI.prototype.getAdVideo=JI.prototype.qf;JI.prototype.getAdContainer=JI.prototype.nc;JI.Id=zI;JI.AD_CONTAINER_ID=xI;_.Nm(new class{create(){return new JI}});var W=class{constructor(a,b,c){this.g=a;this.f=b;this.a=c}nb(){return"FreeWheel AdManager SDK"}ob(){return tv.freewheel.SDK.version}tb(){return 0}getId(){return this.a?this.a.getAdId():""}getCreativeId(){const a=(this.a||{})._creativeId;return typeof a===_.me?a:""}getApiFramework(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a?this.a.getActiveCreativeRendition().getDuration():
6
+ 0}getSkipTimeOffset(){return 0}Zb(){return!1}Eb(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""}getMediaUrl(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""}qb(){return this.a?this.a.getActiveCreativeRendition().getWidth():0}pb(){return this.a?this.a.getActiveCreativeRendition().getHeight():0}eb(){return 0}Pa(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;
7
+ case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.Pa()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1}Fb(){switch(this.Pa()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}}Gb(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1}sb(){return this.f.getAdCount()}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}};
8
+ 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.Gb;W.prototype.getPodTimeOffset=W.prototype.Fb;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Pa;W.prototype.getMediaBitrate=W.prototype.eb;W.prototype.getMediaHeight=W.prototype.pb;
9
+ W.prototype.getMediaWidth=W.prototype.qb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.Eb;W.prototype.isBumper=W.prototype.Zb;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getDuration=W.prototype.getDuration;W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;
10
+ 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 KI=class{constructor(a){this.a=a}getCuePoints(){return this.a.getTemporalSlots().map(a=>{switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})}Hb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length}fb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length}};
11
+ KI.prototype.hasPostroll=KI.prototype.fb;KI.prototype.hasPreroll=KI.prototype.Hb;KI.prototype.getCuePoints=KI.prototype.getCuePoints;var LI=class{constructor(a){this.B=new _.O("clpp.freewheel.AdsManager");this.l=a;this.g=new _.po;this.o=new tv.freewheel.SDK.AdManager;this.f=this.a=null;this.A=[];this.m=[];this.w=[];this.j=new _.Sk;this.h=null}load(){const a=this;return _.w(function*(){const b=a.l.getConfiguration().freewheel||{};try{BI(b)}catch(d){return a.l.onError(d),a.j.resolve(),a.j}a.o.setNetwork(b.networkId);a.o.setServer(b.serverUrl);a.a=a.o.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.me&&typeof b.siteSectionId!==
12
+ _.p||a.a.setSiteSection(b.siteSectionId);const c=yield CI();a.a.setVideoAsset(b.videoAssetId,a.l.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(const d of b.pods)a.a.addTemporalSlot(d.id,AI(d.type),d.position,d.slotProfile,d.cuepointSequence,d.maxDuration,d.minDuration,d.acceptContentType);b.keyValues&&typeof b.keyValues===_.Bd&&Object.keys(b.keyValues).forEach(d=>a.a.addKeyValue(d,b.keyValues[d]));a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);
13
+ if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);DI(a);a.a.submitRequest();return a.j})}start(){const a=this;return _.w(function*(){yield GI(a)})}resume(){this.f&&this.f.resume()}pause(){this.f&&this.f.pause()}skip(){this.f&&this.f.skipCurrentAd()}getVolume(){return this.a?this.a.getAdVolume():1}setVolume(a){this.a&&this.a.setAdVolume(a)}getPosition(){return this.f?this.f.getPlayheadTime():-1}dispose(){const a=this;return _.w(function*(){a.g.release();
14
+ a.h&&(a.h.stop(),a.h=null);FI(a);a.a&&(a.a.dispose(),a.a=null)})}I(a){if(a.success)this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.m=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.w=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.l.trigger(new _.C(_.Lb,{adsTimeline:new KI(this.a)})),this.h=new _.Vp(this.l.getSurface(),(b,c)=>this.a.resize(b,c),this.l.Vb(zI).f);else this.l.onError(new _.H(1,
15
+ 9,10003,{errorType:0},void 0));this.j.resolve()}K(a){II(this,_.ub,a);this.h.start()}J(a){this.f=null;a=a.slot;II(this,_.vb);this.h.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:GI(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:FI(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:HI(this)}}G(a){const b=a.subType;this.B.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:II(this,_.Hb,a);II(this,
16
+ _.Ab,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:II(this,_.Ib,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:II(this,_.zb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:II(this,_.Cb,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:II(this,_.Jb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:II(this,_.yb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:II(this,_.xb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:II(this,_.Db,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:II(this,
17
+ _.Fb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:II(this,_.Gb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:II(this,_.wb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:II(this,_.Eb,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.l.onError(new _.H(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}}F(){if(!this.f){var a=this.l.getPosition();if(this.f=this.m.find(b=>
18
+ .5>Math.abs(a-b.getTimePosition()))||null){const b=this.m.findIndex(c=>c===this.f);this.m.splice(b,1);this.l.pause();EI(this);this.f.play()}}}C(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Nl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Ml:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Cl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);HI(this);break;case _.Kl:case _.Jl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}}};
19
+ LI.prototype.getPosition=LI.prototype.getPosition;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;LI.prototype.start=LI.prototype.start;var MI=class{constructor(){this.a=new _.O(yI)}name(){return yI}ba(a,b){return a.namespace()===_.xc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)}create(a){return new LI(a)}};MI.prototype.create=MI.prototype.create;MI.prototype.isSupported=MI.prototype.ba;MI.prototype.name=MI.prototype.name;_.dm(new MI);};f.call(g, window);
package/cl.hls.js CHANGED
@@ -1,40 +1,40 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var cz="BANDWIDTH",dz="CLOSED-CAPTIONS",ez="EXT-X-BYTERANGE",fz="EXT-X-DISCONTINUITY",gz="EXT-X-DISCONTINUITY-SEQUENCE",hz="EXT-X-ENDLIST",iz="EXT-X-MEDIA-SEQUENCE",jz="EXT-X-PART-INF",kz="EXT-X-PLAYLIST-TYPE",lz="EXT-X-PRELOAD-HINT",mz="EXT-X-SERVER-CONTROL",nz="EXT-X-STREAM-INF",oz="EXT-X-TARGETDURATION",pz="EXTINF",qz="GROUP-ID",rz="Guessing audio-only",sz="SAMPLE-AES-CTR",tz="SUBTITLES",uz="URI",vz="application/vnd.apple.mpegurl",wz=function(a){if(1>a.a)throw _.Mi();--a.a},xz=function(a,
2
- b=0){return b+10<=a.length&&73===a[b]&&68===a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},yz=function(a,b,c){return(a=a.getAttribute(b))?a.value:c||null},zz=function(a,b){a=a.getAttribute(b);if(!a)throw new _.G(_.F,4,4023,b);return a.value},Az=function(a,b){return a.filter(c=>c.name==b)},Bz=function(a,b){return a.filter(c=>zz(c,"TYPE")===b)},Cz=function(a,b){a=Az(a,b);return a.length?a[0]:null},Dz=function(a,b){return _.au([a],[b])[0]},Gz=function(a,
3
- b){var c;a=a.a++;var d=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!d)throw new _.G(_.F,4,4016,{invalidTag:b});b=d[1];var e=d[2];d=[];if(e){e=new _.tp(e);var f;(f=_.Xm(e,/^([^,=]+)(?:,|$)/g))&&(c=f[1]);const g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;for(;f=_.Xm(e,g);)d.push(new Ez(f[1],f[2]||f[3]))}return c=new Fz(a,b,d,c)},Kz=function(a,b,c,d){const e=[];let f=[],g=[];c.forEach(h=>{/^(#EXT)/.test(h)?(h=Gz(a,h),Hz.includes(h.name)?d.push(h):Iz.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===
4
- lz&&"PART"===yz(h,"TYPE")&&g.push(h):f.push(h)):/^#(?!EXT)/m.test(h)||(h=Dz(b,h.trim()),e.push(new Jz(h,f,g)),f=[],g=[])});g.length&&e.push(new Jz(null,f,g));return e},Nz=function(a,b,c){b=_.pg(b);b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();const d=b.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(d[0]))throw new _.G(_.F,4,4015);b=0;let e=!0;for(var f of d)if(f=f.trim(),!f.length||/^#(?!EXT)/m.test(f)||e)e=!1;else{var g=Gz(a,f);--a.a;if(Hz.includes(g.name)){b=1;break}else g.name==nz&&(e=!0)}f=[];
5
- e=!0;for(var h of _.Pt(d)){let {Tc:k,item:l,next:m}=h;l=l.trim();if(!l.length||/^#(?!EXT)/m.test(l)||e)e=!1;else{g=Gz(a,l);if(Lz.includes(g.name)){if(1!=b)throw new _.G(_.F,4,4017);h=d.splice(k,d.length-k);a=Kz(a,c,h,f);return new Mz(c,b,f,a)}f.push(g);g.name==nz&&(g.attributes.push(new Ez(uz,m)),e=!0)}}return new Mz(c,b,f)},Oz=function(a){var b=zz(a,"METHOD");const c=["SAMPLE-AES",sz];if(!c.includes(b))return _.Ff("PlayReady in HLS is only supported with [",c.join(", "),"], not",b),null;a=zz(a,uz);
6
- b=_.zn(a);a=null;b=_.K(b.data);try{a=_.It(_.Uj(b))}catch(d){a=b}return _.bu(_.Cc,[{initDataType:_.nc,initData:a}],"")},Pz=function(a){_.w(function*(){a.a.debug(_.lt);if(a.j)try{yield a.update(),a.A.ba(a.W)}catch(b){a.j&&(a.j.onError(b),1===b.severity&&a.A.ba(.1))}})},Rz=function(a,b){b=_.Hg([b],a.g.attemptParameters);b.type=1;return Qz(a,b)},Xz=function(a,b){return _.w(function*(){var c=Nz(a.N,b,a.B);if(1===c.type){a.H.set(a.B,c);c=(new _.mh(c.a[0].a)).pa.split(".").pop();var d=Sz.audio[c],e="";Sz.video[c]?
7
- e="avc1.42E01E":d&&(e="mp4a.40.2");{c=a.N;d=a.B;e=a.g.hlsDefaultCodecs||e;var f=[];const h=[];h.push(new Ez(cz,"0"));h.push(new Ez(uz,d));e.length&&h.push(new Ez(_.la,e));f.push(new Fz(c.a++,nz,h));c=new Mz(d,0,f)}}c=yield Tz(a,c.ra);if(!a.j)throw new _.G(_.F,7,7001);a.j.filterAllPeriods([c]);e=Infinity;d=0;f=Infinity;for(var g of a.f.values())e=Math.min(e,g.Bd),d=Math.max(d,g.Bd),g.stream.type!=_.r&&(f=Math.min(f,g.duration));a.m!=Uz?(a.h=new _.Ry(0,a.T,!1),_.nu(a.h,1)):a.h=new _.Ry(null,0,!0);Vz(a);
8
- if(a.m!=Uz){a.W=a.F;a.m===Wz&&(g=Math.max(f,a.h.Kd),isNaN(a.g.availabilityWindowOverride)||(g=a.g.availabilityWindowOverride),a.h.Yb=g);for(g=0;95443.7176888889<=d;)g+=95443.7176888889,d-=95443.7176888889;if(g){a.a.debug("Offsetting live streams by",g,"to compensate for rollover");for(const h of a.f.values())95443.7176888889>h.Bd?(a.a.debug("Offset applied to",h.stream.type),h.segmentIndex.offset(g)):a.a.debug("Offset NOT applied to",h.stream.type)}}else{a.h.Jb(f);a.h.offset(-e);for(const h of a.f.values())h.segmentIndex.offset(-e),
9
- _.Au(h.segmentIndex,f)}a.J={presentationTimeline:a.h,periods:[c],offlineSessionIds:[],minBufferTime:0}})},$z=function(a,b){return _.w(function*(){var c=new _.mh(b.Re);if(a.g.hlsLowLatency){var d=c.a;if(b.Ve){var e=b.segmentIndex;if(e=e.a[e.a.length-1]){const h=e.a,k=h.length-1;e={xf:e.position,Df:h&&0<h.length?k:null}}else e=null;const {xf:f,Df:g}=e;null!==f&&(d.add("_HLS_msn",f),null!==g&&d.add("_HLS_part",g))}e=d;_.xh(e);e.g&&_.ph(c,d)}c=yield Rz(a,c.toString());c=Nz(a.N,c.data,c.uri);if(1!=c.type)throw new _.G(_.F,
10
- 4,4017);d=b.stream;d=yield Yz(a,b.Zc,c,d.type,d.mimeType,d.codecs,d.keyInfo||null,b.$e);b.segmentIndex.replace(d);d=d[d.length-1];Cz(c.ra,hz)&&(Zz(a,Uz),a.h.Jb(d.endTime))})},Yz=function(a,b,c,d,e,f,g,h){return _.w(function*(){var k=c.a;const l=aA(c,g);var m=(m=Cz(c.ra,iz))?Number(m.value):0;null===a.R&&(a.R=yield bA(a,b,l,k[0],m,g,e,f,d));const n=a.R;a.a.debug("First segment",k[0].a.split("/").pop(),"starts at",n);var q=Cz(c.ra,gz);let t=q?Number(q.value):0;h.has(t)||h.set(t,m);if(!q)for(;h.has(t+
11
- 1)&&h.get(t+1)<m;)t++;q=a.K.get(t)||0;const u=[];for(const E of _.Pt(k)){var x=E.Tc;k=E.item;{var A=u[u.length-1];const D=0==x?n:A.endTime;x=m+x;Cz(k.ra,fz)&&(t++,h.set(t,x),q=yield cA(a,t,b,l,k,x,g,e,f,D,d));A=dA(a,A,k,x,D,q,g,d,c.f);k=Cz(k.ra,pz);A&&(a.g.hlsLowLatency||k)&&u.push(A)}}a.V.push(u);Vz(a);return u})},Zz=function(a,b){a.m=b;if(a.h){b=a.h;var c=a.m==Uz;b.j=c;b.m=c}a.m!=Uz||a.A.stop()},Tz=function(a,b){return _.w(function*(){var c=Az(b,"EXT-X-MEDIA"),d=Az(b,nz),e=Az(b,"EXT-X-IMAGE-STREAM-INF");
12
- for(var f of d){var g=yz(f,"AUDIO"),h=yz(f,"VIDEO"),k=yz(f,tz);const l=eA(a,f);if(k){const m=fA(_.r,l);a.o.set(k,m);k=l.indexOf(m);-1<k&&l.splice(k,1)}g&&(k=gA(_.Vb,l),a.o.set(g,k));h&&(g=gA(_.v,l),a.o.set(h,g))}yield hA(a,c);f=Bz(c,dz);for(const l of f)f=iA(l),h=zz(l,qz),g=zz(l,"INSTREAM-ID"),a.M.get(h)||a.M.set(h,new Map),a.M.get(h).set(g,f);d=yield jA(a,d);c=yield kA(a,c);e=yield lA(a,e);return{startTime:0,variants:d,textStreams:c,thumbStreams:e}})},hA=function(a,b){return _.w(function*(){b=b.filter(d=>
13
- {const e=yz(d,uz)||"";return yz(d,"TYPE")!==tz&&""!==e});b.length&&(yield mA(a,b[0]));const c=b.slice(1).map(d=>mA(a,d));yield Promise.all(c)})},jA=function(a,b){return _.w(function*(){var c=f=>_.w(function*(){const g=yz(f,"FRAME-RATE"),h=Number(zz(f,cz));var k=yz(f,"RESOLUTION");const [l,m]=k?k.split("x"):[null,null];return(k=yield nA(a,f,k,g))?oA(a,k.audio,k.video,h,l,m,g):[]});let d=0;var e=Infinity;for(let f=0;f<b.length;++f){const g=Number(zz(b[f],cz));g<e&&(e=g,d=f)}e=b.splice(d,1).pop();e=
14
- yield c(e);c=b.map(c);c=yield Promise.all(c);c.splice(d,0,e);return c.reduce(_.Zt,[]).filter(_.Qk)})},kA=function(a,b){return _.w(function*(){var c=Bz(b,tz),d=c.map(f=>_.w(function*(){try{return(yield mA(a,f)).stream}catch(g){throw g;}}));d=yield Promise.all(d);for(const f of c){var e=zz(f,qz);if(c=a.o.get(e))if(e=a.w.get(e))for(const g of e)g.stream.codecs=c}return d.filter(f=>f)})},lA=function(a,b){return _.w(function*(){const c=b.map(d=>_.w(function*(){return(yield pA(a,d)).stream}));return(yield Promise.all(c)).filter(d=>
15
- d)})},eA=function(a,b){var c=yz(b,_.la,a.g.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/);b=new Set;const d=[];for(const e of c)c=_.Vt(e)[0],b.has(c)?a.a.debug("Ignoring duplicate codec"):(d.push(e),b.add(c));return d},fA=function(a,b){const c=qA[a];for(let d=0;d<c.length;d++)for(let e=0;e<b.length;e++)if(c[d].test(b[e].trim()))return b[e].trim();return a==_.r?"":null},gA=function(a,b){if(1==b.length)return b[0];a=fA(a,b);if(null!=a)return a;throw new _.G(_.F,4,4025,{codecList:b});},
16
- mA=function(a,b){return _.w(function*(){const c=zz(b,qz);var d="";let e=zz(b,"TYPE").toLowerCase();e==_.Bt&&(e=_.r);e!==_.r&&c&&a.o.has(c)&&(d=a.o.get(c));const f=zz(b,uz);if(a.f.has(f))return a.f.get(f);const g=iA(b),h=yz(b,"NAME"),k=b.getAttribute("DEFAULT"),l=b.getAttribute("AUTOSELECT"),m=yz(b,"CHANNELS");d=yield rA(a,f,d,e,g,!!k&&!!l,h,e==_.Vb?m?parseInt(m.split("/")[0],10):null:null,null);if(null==d)return null;a.w.has(c)?a.w.get(c).push(d):a.w.set(c,[d]);if(a.f.has(f))return a.f.get(f);a.f.set(f,
17
- d);return d})},pA=function(a,b){return _.w(function*(){const c=zz(b,uz);if(a.f.has(c))return a.f.get(c);var d=yz(b,_.la)||"jpg",e=iA(b);const f=yz(b,"NAME");d=yield rA(a,c,d,_.Yc,e,!1,f,null,null);if(null===d)return null;if(a.f.has(c))return a.f.get(c);if(e=yz(b,cz))d.stream.bandwidth=Number(e);a.f.set(c,d);return d})},nA=function(a,b,c,d){return _.w(function*(){let e=eA(a,b);var f=yz(b,"AUDIO"),g=yz(b,"VIDEO"),h=f||g;h=h&&a.w.has(h)?a.w.get(h):[];f={audio:f?h:[],video:g?h:[]};a.a.debug("Guessing stream type for",
18
- b.toString());g=!1;const k=zz(b,uz),l=f.audio.find(q=>q.Zc===k);var m=fA(_.v,e);m=c||d||m;1!==e.length||m?!h.length&&1<e.length?(a.a.debug("Guessing multiplexed audio+video"),h=_.v,e=[e.join(",")]):f.audio.length&&l?(a.a.debug(rz),h=_.Vb,g=!0):f.video.length?(a.a.debug(rz),h=_.Vb):(a.a.debug("Guessing video-only"),h=_.v):(h=_.Vb,a.a.debug(rz));let n;g||(n=yield sA(a,b,e,h));if(n)f[n.stream.type]=[n];else if(null===n)return a.a.debug("streamInfo is null"),null;tA(f);return f})},oA=function(a,b,c,d,
19
- e,f,g){c.forEach(l=>{if(l=l.stream)l.width=Number(e)||void 0,l.height=Number(f)||void 0,l.frameRate=Number(g)||void 0});b.length||(b=[null]);c.length||(c=[null]);const h=[];for(const l of b)for(const m of c){var k=l?l.stream:null;const n=m?m.stream:null,q=l?l.drmInfos:null,t=m?m.drmInfos:null;b=(m?m.Zc:"")+" - "+(l?l.Zc:"");let u;if(k&&n)if(q.length&&t.length?0<_.Yt(q,t).length:1)u=_.Yt(q,t);else{a.a.warn("Incompatible DRM info in HLS variant. Skipping.");continue}else k?u=q:n&&(u=t);a.$.has(b)?
20
- a.a.debug("Skipping variant which only differs in text streams."):(k=uA(a,k,n,d,u),h.push(k),a.$.add(b))}return h},sA=function(a,b,c,d){return _.w(function*(){const e=zz(b,uz);if(a.f.has(e))return a.f.get(e);var f=yz(b,dz),g=null;d==_.v&&f&&"NONE"!=f&&(g=a.M.get(f));f=gA(d,c);g=yield rA(a,e,f,d,_.ue,!1,null,null,g);if(null==g)return null;if(a.f.has(e))return a.f.get(e);a.f.set(e,g);return g})},tA=function(a){for(const b of a.audio.concat(a.video))a=b.stream.codecs.split(","),a=a.filter(c=>"mp4a.40.34"!=
21
- c),b.stream.codecs=a.join(",")},uA=function(a,b,c,d,e){return{id:a.aa++,language:b?b.language:_.ue,primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}},iA=function(a){a=yz(a,"LANGUAGE")||_.ue;return _.Rg(a)},rA=function(a,b,c,d,e,f,g,h,k){return _.w(function*(){let l=Dz(a.B,b);var m=null;if(a.m==Uz&&a.H.has(l)){var n=a.H.get(l);a.H.delete(l)}else{var q=yield Rz(a,l);l=q.uri;n=Nz(a.N,q.data,l)}if(1!=n.type)throw new _.G(_.F,4,
22
- 4017);vA(a,n);q=yield wA(a,d,c,n);const t=[];n.a.forEach(bd=>{bd=Az(bd.ra,"EXT-X-KEY");t.push.apply(t,bd)});let u=!1;const x=[];let A=null;for(var E of t){var D=zz(E,"METHOD"),T=yz(E,"KEYFORMAT","identity");"NONE"!=D&&("AES-128"==D?(m=yz(E,"IV",""),m={method:"AES-128",url:Dz(a.B,zz(E,uz)),iv:m?_.vi((m||"0x").slice(2)):null},a.I=!0):(u=!0,(D=(D=xA[T])?D(E,q):null)?(D.keyIds.length&&(A=D.keyIds[0]),x.push(D)):a.a.warn("Unsupported HLS KEYFORMAT",T)))}if(u&&!x.length&&!a.I)throw new _.G(_.F,4,4026);
23
- E=new Map;var ia=yield Yz(a,b,n,d,q,c,m,E);T=ia[0].startTime;D=ia[ia.length-1].endTime;const tf=D-T;ia=new _.Sy(ia);const uf=a.g.hlsLowLatency?_.Qw:_.st,vf=aA(n,m);let Pa=void 0;d==_.r&&(Pa=_.At);n=(n=Cz(n.ra,mz))?"YES"===yz(n,"CAN-BLOCK-RELOAD"):!1;return{stream:{id:a.aa++,originalId:g,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:ia.f.bind(ia),getSegmentReference:ia.get.bind(ia),adjustSegmentDurations:ia.g.bind(ia),getDuration:ia.getDuration.bind(ia),segmentIndex:ia,segmentLookupStrategy:uf,
24
- initSegmentReference:vf,mimeType:q,codecs:c,kind:Pa,encrypted:u,keyId:A,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:h,closedCaptions:k,keyInfo:m},segmentIndex:ia,drmInfos:x,Zc:b,Re:l,Bd:T,kg:D,duration:tf,$e:E,Ve:n}})},vA=function(a,b){var c=Cz(b.ra,kz),d=Cz(b.ra,hz);d=c&&"VOD"==c.value||d;c=c&&"EVENT"==c.value&&!d;c=!d&&!c;if(d)Zz(a,Uz);else{c?Zz(a,Wz):Zz(a,yA);d=Cz(b.ra,oz);if(!d)throw new _.G(_.F,
25
- 4,4024,{missingTag:oz});d=Number(d.value);c=Cz(b.ra,jz);a.g.hlsLowLatency&&c?(d=Number(zz(c,"PART-TARGET")),a.F=Math.min(d,a.F),a.D=Math.max(d,a.D),b=Cz(b.ra,mz),a.T=b?Number(zz(b,"PART-HOLD-BACK")):0):(a.D=Math.max(d,a.D),a.F=Math.min(d,a.F),a.T=3*a.D)}},wA=function(a,b,c,d){return _.w(function*(){var e=d.a[0].a;const f=(new _.mh(e)).pa.split(".").pop(),g=Sz[b][f];if(g)return g;if(b==_.r)return c&&"vtt"!=c?_.Ob:_.pe;e=_.Hg([e],a.g.attemptParameters);e.method="HEAD";e.type=2;e=(yield Qz(a,e)).headers["content-type"];
26
- if(!e)throw new _.G(_.F,4,4021,f);return e.split(";")[0]})},aA=function(a,b){var c=Az(a.ra,"EXT-X-MAP");if(!c.length)return null;if(1<c.length)throw new _.G(_.F,4,4020);c=c[0];var d=zz(c,uz);const e=Dz(a.f,d);a=0;d=null;if(c=yz(c,"BYTERANGE"))a=c.split("@"),c=Number(a[0]),a=Number(a[1]),d=a+c-1;return new _.Qy(()=>[e],a,d,b)},Vz=function(a){a.h&&(a.V.forEach(b=>{_.mu(a.h,b,0)}),a.V=[])},zA=function(a,b){var c=0;let d=null;b&&(c=b.split("@"),b=Number(c[0]),c=c[1]?Number(c[1]):a.Ba+1,d=c+b-1);return[c,
27
- d]},AA=function(a,b,c,d,e,f,g){const h=[];for(const n of _.Pt(b.f)){b=n.Tc;const q=n.item;{var k=0==b?a:h[h.length-1],l=0==b?d:k.endTime,m=Number(yz(q,"DURATION"));m=l+m;const t=yz(q,"BYTERANGE"),[u,x]=zA(k,t);k=yz(q,uz);const A=(k=Dz(g,k))?[k]:[];l=new _.vu(c,l,m,()=>A,u,x,e,f,!1,null,null,null,null);if("YES"===yz(q,"INDEPENDENT")||0===b)l.g=!0;h.push(l)}}return h},dA=function(a,b,c,d,e,f,g,h,k){var l=c.ra,m=c.a;const n=m?[m]:[];m=Cz(l,pz);(g=g?Object.assign({},g):null)&&!g.iv&&(g.iv=_.yi(new Uint8Array(12),
28
- new Uint8Array([d>>24&255,d>>16&255,d>>8&255,d&255])));var q=null,t=null,u=null;h===_.Yc&&(t=Cz(l,"EXT-X-TILES"),q="1x1",t&&(q=yz(t,"LAYOUT")||"1x1",u=(u=yz(t,"DURATION"))?Number(u):null),[q,t]=q.split("x").map(x=>parseInt(x,10)));if(0===c.f.length&&!m)throw new _.G(_.F,4,4024,{missingTag:pz});h=null;if(0<c.f.length)if(a.g.hlsLowLatency)h=AA(b,c,d,e,f,g,k);else return null;c=a=0;k=null;m?(a=e+Number(m.value.split(",")[0]),l=Cz(l,ez),[c,k]=zA(b,l?l.value:null)):a=h[h.length-1].endTime;return new _.vu(d,
29
- e,a,()=>n,c,k,f,g,!1,null,q,t,u,h)},bA=function(a,b,c,d,e,f,g,h,k,l){return _.w(function*(){var m=dA(a,null,d,e,0,0,f,k,"");if(!m)return 0;if(a.J&&!l){var n=a.f.get(b).segmentIndex.get(m.position);if(n)return a.a.debug("Found segment start time in previous manifest"),n.startTime;a.a.debug("Unable to find segment start time in previous manifest!")}a.a.debug("Fetching segment to find start time");if("audio/mpeg"==g)return 0;if(g==_.Wb)return m=yield BA(a,m),n=_.K(m.data),xz(n)?CA(n):DA(a,m.data);if(g==
30
- _.Fe||g==_.Zb)return m=[BA(a,m)],c&&m.push(BA(a,c)),m=yield Promise.all(m),EA(a,m[0].data,(m[1]||m[0]).data);if(g==_.Ee)return m=yield BA(a,m),DA(a,m.data);if(g===_.Yb||g===_.Xb||!MediaSource.isTypeSupported(`${g.split("/")[0]||""}/mp4;codecs="${h}"`))return 0;throw new _.G(_.F,4,4030);})},cA=function(a,b,c,d,e,f,g,h,k,l,m){return _.w(function*(){let n;a.K.has(b)?n=a.K.get(b):(n=(yield bA(a,c,d,e,f,g,h,k,m,!0))-l,a.a.debug("Discontinuity segment offset",n),a.K.set(b,n));return n})},Qz=function(a,
31
- b){if(!a.C)throw new _.G(_.F,7,7001);b=a.j.networkingEngine.fetch(b);_.lh(a.C,b);return b.P},BA=function(a,b){return _.w(function*(){const c=b.f(),d=_.ku(b.Ea(),b.Ka,b.Ka+2048-1,a.g.attemptParameters);d.type=2;const e=_.ku(b.Ea(),b.Ka,b.Ba,a.g.attemptParameters);e.type=2;c&&(e.keyInfo=c);try{return yield Qz(a,a.I?e:d)}catch(f){if(7001==f.code||a.I)throw f;a.a.warn("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",
32
- d.uris[0]);return yield Qz(a,e)}})},CA=function(a){function b(h,k,l){let m="";for(;k<l;k++)m+="%"+("00"+h[k].toString(16)).slice(-2);return m}function c(h){return h[0]<<21|h[1]<<14|h[2]<<7|h[3]}function d(){throw new _.G(_.F,4,4030);}xz(a)||d();let e=10;a[5]&64&&(e=e+4+c(a.subarray(10,14)));do{var f=c(a.subarray(e+4,e+8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(let h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===
33
- unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}xz(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},DA=function(a,b){function c(){e.seek(f+188);g=_.Ni(e);71!=g&&(e.seek(f+192),g=_.Ni(e));71!=g&&(e.seek(f+204),g=_.Ni(e));71!=g&&d();wz(e)}function d(){throw new _.G(_.F,4,4030);}const e=new _.Nj(new DataView(b),!1);let f=0,g=0;f=FA(e);0>f&&(a.a.error("Unable to find sync byte in TS after scanning"),d());for(;;){f=
34
- e.getPosition();g=_.Ni(e);71!=g&&d();a=_.Oi(e);if(8191===(a&8191)){c();continue}if(!(a&16384)){c();continue}a=(_.Ni(e)&48)>>4;0!=a&&2!=a||d();3==a&&(a=_.Ni(e),e.skip(a));if(1!=_.M(e)>>8){c();continue}e.skip(3);a=_.Ni(e)>>6;0!=a&&1!=a||d();0==_.Ni(e)&&d();a=_.Ni(e);b=_.Oi(e);const h=_.Oi(e);return(1073741824*((a&14)>>1)+((b&65534)<<14|(h&65534)>>1))/9E4}},EA=function(a,b,c){let d=0;(new _.ej).L(_.rd,_.Vi).L(_.se,_.Vi).L(_.md,_.Vi).X("mdhd",g=>{g.G.skip(0==g.version?8:16);d=_.M(g.G);g.Pa.stop()}).parse(c,
35
- !0);if(!d)throw a.a.error("Unable to find timescale in init segment!"),new _.G(_.F,4,4030);let e=0,f=!1;(new _.ej).L("moof",_.Vi).L("traf",_.Vi).X("tfdt",g=>{e=(0==g.version?_.M(g.G):_.Ri(g.G))/d;f=!0;g.Pa.stop()}).parse(b,!0);if(!f)throw new _.G(_.F,4,4030);return e},FA=function(a){for(;a.getPosition()<a.va()-1;){const b=a.getPosition();if(71===_.Ni(a))return wz(a),b}return-1},Mz=class{constructor(a,b,c,d){this.f=a;this.type=b;this.ra=c;this.a=d||null}},Fz=class{constructor(a,b,c,d=null){this.id=
36
- a;this.name=b;this.attributes=c;this.value=d}toString(){function a(d){return d.name+"\x3d"+(isNaN(Number(d.value))?'"'+d.value+'"':d.value)}let b="#"+this.name;const c=this.attributes?this.attributes.map(a):[];this.value&&c.unshift(this.value);0<c.length&&(b+=":"+c.join(","));return b}getAttribute(a){const b=this.attributes.filter(c=>c.name==a);return b.length?b[0]:null}},Ez=class{constructor(a,b){this.name=a;this.value=b}},Jz=class{constructor(a,b,c=[]){this.ra=b;this.a=a;this.f=c}};var GA=class{constructor(){this.a=0}},Hz=[oz,iz,gz,kz,"EXT-X-MAP","EXT-X-I-FRAMES-ONLY",hz,mz,jz],Lz=[pz,ez,fz,"EXT-X-PROGRAM-DATE-TIME","EXT-X-KEY","EXT-X-DATERANGE"],Iz=["EXT-X-PART",lz];var HA=class{constructor(){this.g=this.j=null;this.aa=1;this.T=0;this.w=new Map;this.$=new Set;this.f=new Map;this.h=null;this.B="";this.N=new GA;this.W=0;this.S=new Map;this.A=new _.Dh(()=>{Pz(this)});this.m=Uz;this.J=null;this.D=0;this.F=Infinity;this.C=new _.ko;this.V=[];this.M=new Map;this.I=!1;this.o=new Map;this.R=null;this.a=new _.N("clpp.hls.HlsParser");this.H=new Map;this.K=new Map}configure(a){this.g=a}setCurrentVariant(a){const b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.S.clear();
37
- for(const c of this.f.keys()){const d=this.f.get(c);!d.stream||d.stream.id!==b&&d.stream.id!==a||this.S.set(c,d)}}start(a,b){const c=this;return _.w(function*(){c.j=b;var d=yield Rz(c,a);c.B=d.uri;yield Xz(c,d.data);d=c.W;0<d&&c.A.ba(d);return c.J})}stop(){this.A&&(this.A.stop(),this.A=null);const a=[];this.C&&(a.push(this.C.destroy()),this.C=null);this.g=this.j=null;this.$.clear();this.f.clear();this.H.clear();this.J=null;this.w.clear();this.o.clear();return Promise.all(a)}update(){const a=this;
38
- return _.w(function*(){if(a.m!=Uz){var b=[];a.R=null;var c=Array.from(a.f.values()),d=Array.from(a.S.values());c=a.g.hlsLowLatency&&0<d.length?d:c;yield $z(a,c[0]);for(d=1;d<c.length;d++)b.push($z(a,c[d]));yield Promise.all(b)}})}onExpirationUpdated(){}},qA={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},Sz={audio:{mp4:_.Zb,m4s:_.Zb,m4i:_.Zb,m4a:_.Zb,cmfa:_.Zb,ts:_.Ee,aac:_.Wb,ec3:_.Yb,ac3:_.Xb},video:{mp4:_.Fe,
39
- m4s:_.Fe,m4i:_.Fe,m4v:_.Fe,cmfv:_.Fe,ts:_.Ee},text:{mp4:_.Ob,m4s:_.Ob,m4i:_.Ob,cmft:_.Ob,vtt:_.pe,ttml:_.Rb},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},xA={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Ee)throw new _.G(_.F,4,4041);return _.bu(_.Bc,[{initDataType:_.ce,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":Oz,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":Oz,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=
40
- zz(a,"METHOD");const c=["SAMPLE-AES",sz];if(!c.includes(b))return _.Ff("Widevine in HLS is only supported with [",c.join(", "),"], not",b),null;b=zz(a,uz);b=_.zn(b);b=_.K(b.data);b=_.bu(_.Dc,[{initDataType:_.nc,initData:b}],"");if(a=yz(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},Uz="VOD",yA="EVENT",Wz="LIVE";_.y("clpp.hls.HlsComponent",class extends _.bp{constructor(){super()}f(){_.cn.m3u8=HA;_.an[_.Tb]=HA;_.an[vz]=HA}a(){_.Du("m3u8");_.Eu(_.Tb);_.Eu(vz)}id(){return"hls"}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Ez="CLOSED-CAPTIONS",Fz="EXT-X-BYTERANGE",Gz="EXT-X-DISCONTINUITY",Hz="EXT-X-DISCONTINUITY-SEQUENCE",Iz="EXT-X-ENDLIST",Jz="EXT-X-MEDIA-SEQUENCE",Kz="EXT-X-PART-INF",Lz="EXT-X-PLAYLIST-TYPE",Mz="EXT-X-PRELOAD-HINT",Nz="EXT-X-SERVER-CONTROL",Oz="EXT-X-STREAM-INF",Pz="EXT-X-TARGETDURATION",Qz="EXTINF",Rz="GROUP-ID",Sz="Guessing audio-only",Tz="SAMPLE-AES-CTR",Uz="SUBTITLES",Vz="application/vnd.apple.mpegurl",Wz=function(a,b){a=a.getAttribute(b);if(!a)throw new _.H(_.F,4,4023,b);return a.value},
2
+ Xz=function(a){if(1>a.a)throw _.sj();--a.a},Yz=function(a,b){return a.filter(c=>c.name==b)},Zz=function(a,b){return a.filter(c=>Wz(c,"TYPE")===b)},$z=function(a,b){a=Yz(a,b);return a.length?a[0]:null},aA=function(a,b){return _.ou([a],[b])[0]},bA=function(a,b){return _.Tg(a.a++,b)},fA=function(a,b,c,d){const e=[];let f=[],g=[];c.forEach(h=>{/^(#EXT)/.test(h)?(h=bA(a,h),cA.includes(h.name)?d.push(h):dA.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===Mz&&"PART"===_.ng(h,"TYPE")&&g.push(h):
3
+ f.push(h)):/^#(?!EXT)/m.test(h)||(h=aA(b,h.trim()),e.push(new eA(h,f,g)),f=[],g=[])});g.length&&e.push(new eA(null,f,g));return e},iA=function(a,b,c){b=_.Ag(b);b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();const d=b.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(d[0]))throw new _.H(_.F,4,4015);b=0;let e=!0;for(var f of d)if(f=f.trim(),!f.length||/^#(?!EXT)/m.test(f)||e)e=!1;else{var g=bA(a,f);--a.a;if(cA.includes(g.name)){b=1;break}else g.name==Oz&&(e=!0)}f=[];e=!0;for(var h of _.qu(d)){let {Wc:k,
4
+ item:l,next:m}=h;l=l.trim();if(!l.length||/^#(?!EXT)/m.test(l)||e)e=!1;else{g=bA(a,l);if(gA.includes(g.name)){if(1!=b)throw new _.H(_.F,4,4017);h=d.splice(k,d.length-k);a=fA(a,c,h,f);return new hA(c,b,f,a)}f.push(g);g.name==Oz&&(g.attributes.push(new _.Pg(_.lb,m)),e=!0)}}return new hA(c,b,f)},jA=function(a,b=0){return b+10<=a.length&&73===a[b]&&68===a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},kA=function(a){var b=Wz(a,"METHOD");const c=["SAMPLE-AES",
5
+ Tz];if(!c.includes(b))return _.Jf("PlayReady in HLS is only supported with [",c.join(", "),"], not",b),null;a=Wz(a,_.lb);b=_.ao(a);a=null;b=_.G(b.data);try{a=_.fu(_.xk(b))}catch(d){a=b}return _.pu(_.Gc,[{initDataType:_.qc,initData:a}],"")},mA=function(a,b){b=_.Yg([b],a.g.attemptParameters);b.type=1;return lA(a,b)},sA=function(a,b){return _.w(function*(){var c=iA(a.M,b,a.A);if(1===c.type){a.G.set(a.A,c);c=(new _.ag(c.a[0].a)).pa.split(".").pop();var d=nA.audio[c],e="";nA.video[c]?e="avc1.42E01E":d&&
6
+ (e="mp4a.40.2");{c=a.M;d=a.A;e=a.g.hlsDefaultCodecs||e;var f=[];const h=[];h.push(new _.Pg(_.ja,"0"));h.push(new _.Pg(_.lb,d));e.length&&h.push(new _.Pg(_.la,e));f.push(new _.Sg(c.a++,Oz,h));c=new hA(d,0,f)}}c=yield oA(a,c.ta);if(!a.D)throw new _.H(_.F,7,7001);a.D.filterAllPeriods([c]);e=Infinity;d=0;f=Infinity;for(var g of a.f.values())e=Math.min(e,g.Fd),d=Math.max(d,g.Fd),g.stream.type!=_.r&&(f=Math.min(f,g.duration));a.j!=pA?(a.h=new _.tz(0,a.T,!1),_.Mu(a.h,1)):a.h=new _.tz(null,0,!0);qA(a);if(a.j!=
7
+ pA){a.W=a.F;a.j===rA&&(g=Math.max(f,a.h.Od),isNaN(a.g.availabilityWindowOverride)||(g=a.g.availabilityWindowOverride),a.h.ac=g);for(g=0;95443.7176888889<=d;)g+=95443.7176888889,d-=95443.7176888889;if(g){a.a.debug("Offsetting live streams by",g,"to compensate for rollover");for(const h of a.f.values())95443.7176888889>h.Fd?(a.a.debug("Offset applied to",h.stream.type),h.segmentIndex.offset(g)):a.a.debug("Offset NOT applied to",h.stream.type)}}else{a.h.Mb(f);a.h.offset(-e);for(const h of a.f.values())h.segmentIndex.offset(-e),
8
+ _.Zu(h.segmentIndex,f)}a.J={presentationTimeline:a.h,periods:[c],offlineSessionIds:[],minBufferTime:0}})},vA=function(a,b){return _.w(function*(){var c=new _.ag(b.Ve);if(a.g.hlsLowLatency){var d=c.a;if(b.af){var e=b.segmentIndex;if(e=e.a[e.a.length-1]){const h=e.a,k=h.length-1;e={Df:e.position,Jf:h&&0<h.length?k:null}}else e=null;const {Df:f,Jf:g}=e;null!==f&&(d.add("_HLS_msn",f),null!==g&&d.add("_HLS_part",g))}e=d;_.lg(e);e.g&&_.dg(c,d)}c=yield mA(a,c.toString());c=iA(a.M,c.data,c.uri);if(1!=c.type)throw new _.H(_.F,
9
+ 4,4017);d=b.stream;d=yield tA(a,b.cd,c,d.type,d.mimeType,d.codecs,d.keyInfo||null,b.ff);b.segmentIndex.replace(d);d=d[d.length-1];$z(c.ta,Iz)&&(uA(a,pA),a.h.Mb(d.endTime))})},tA=function(a,b,c,d,e,f,g,h){return _.w(function*(){var k=c.a;const l=wA(c,g);var m=(m=$z(c.ta,Jz))?Number(m.value):0;null===a.O&&(a.O=yield xA(a,b,l,k[0],m,g,e,f,d));const n=a.O;a.a.debug("First segment",k[0].a.split("/").pop(),"starts at",n);var q=$z(c.ta,Hz);let t=q?Number(q.value):0;h.has(t)||h.set(t,m);if(!q)for(;h.has(t+
10
+ 1)&&h.get(t+1)<m;)t++;q=a.K.get(t)||0;const u=[];for(const E of _.qu(k)){var y=E.Wc;k=E.item;{var A=u[u.length-1];const D=0==y?n:A.endTime;y=m+y;$z(k.ta,Gz)&&(t++,h.set(t,y),q=yield yA(a,t,b,l,k,y,g,e,f,D,d));A=zA(a,A,k,y,D,q,g,d,c.f);k=$z(k.ta,Qz);A&&(a.g.hlsLowLatency||k)&&u.push(A)}}a.V.push(u);qA(a);return u})},uA=function(a,b){a.j=b;if(a.h){b=a.h;var c=a.j==pA;b.j=c;b.m=c}a.j!=pA||a.w.stop()},oA=function(a,b){return _.w(function*(){var c=Yz(b,"EXT-X-MEDIA"),d=Yz(b,Oz),e=Yz(b,"EXT-X-IMAGE-STREAM-INF");
11
+ for(var f of d){var g=_.ng(f,"AUDIO"),h=_.ng(f,"VIDEO"),k=_.ng(f,Uz);const l=AA(a,f);if(k){const m=_.Ch(_.r,l);a.m.set(k,m);k=l.indexOf(m);-1<k&&l.splice(k,1)}g&&(k=BA(_.Yb,l),a.m.set(g,k));h&&(g=BA(_.v,l),a.m.set(h,g))}yield CA(a,c);f=Zz(c,Ez);for(const l of f)f=DA(l),h=Wz(l,Rz),g=Wz(l,"INSTREAM-ID"),a.L.get(h)||a.L.set(h,new Map),a.L.get(h).set(g,f);d=yield EA(a,d);c=yield FA(a,c);e=yield GA(a,e);return{startTime:0,variants:d,textStreams:c,thumbStreams:e}})},CA=function(a,b){return _.w(function*(){b=
12
+ b.filter(d=>{const e=_.ng(d,_.lb)||"";return _.ng(d,"TYPE")!==Uz&&""!==e});b.length&&(yield HA(a,b[0]));const c=b.slice(1).map(d=>HA(a,d));yield Promise.all(c)})},EA=function(a,b){return _.w(function*(){var c=f=>_.w(function*(){const g=_.ng(f,"FRAME-RATE"),h=Number(Wz(f,_.ja));var k=_.ng(f,_.Za);const [l,m]=k?k.split("x"):[null,null];return(k=yield IA(a,f,k,g))?JA(a,k.audio,k.video,h,l,m,g):[]});let d=0;var e=Infinity;for(let f=0;f<b.length;++f){const g=Number(Wz(b[f],_.ja));g<e&&(e=g,d=f)}e=b.splice(d,
13
+ 1).pop();e=yield c(e);c=b.map(c);c=yield Promise.all(c);c.splice(d,0,e);return c.reduce(_.mu,[]).filter(_.$f)})},FA=function(a,b){return _.w(function*(){var c=Zz(b,Uz),d=c.map(f=>_.w(function*(){try{return(yield HA(a,f)).stream}catch(g){throw g;}}));d=yield Promise.all(d);for(const f of c){var e=Wz(f,Rz);if(c=a.m.get(e))if(e=a.o.get(e))for(const g of e)g.stream.codecs=c}return d.filter(f=>f)})},GA=function(a,b){return _.w(function*(){const c=b.map(d=>_.w(function*(){return(yield KA(a,d)).stream}));
14
+ return(yield Promise.all(c)).filter(d=>d)})},AA=function(a,b){var c=_.ng(b,_.la,a.g.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/);b=new Set;const d=[];for(const e of c)c=_.xu(e)[0],b.has(c)?a.a.debug("Ignoring duplicate codec"):(d.push(e),b.add(c));return d},BA=function(a,b){if(1==b.length)return b[0];a=_.Ch(a,b);if(null!=a)return a;throw new _.H(_.F,4,4025,{codecList:b});},HA=function(a,b){return _.w(function*(){const c=Wz(b,Rz);var d="";let e=Wz(b,"TYPE").toLowerCase();e==_.Zt&&(e=
15
+ _.r);e!==_.r&&c&&a.m.has(c)&&(d=a.m.get(c));const f=Wz(b,_.lb);if(a.f.has(f))return a.f.get(f);const g=DA(b),h=_.ng(b,"NAME"),k=b.getAttribute("DEFAULT"),l=b.getAttribute("AUTOSELECT"),m=_.ng(b,"CHANNELS");d=yield LA(a,f,d,e,g,!!k&&!!l,h,e==_.Yb?m?parseInt(m.split("/")[0],10):null:null,null);if(null==d)return null;a.o.has(c)?a.o.get(c).push(d):a.o.set(c,[d]);if(a.f.has(f))return a.f.get(f);a.f.set(f,d);return d})},KA=function(a,b){return _.w(function*(){const c=Wz(b,_.lb);if(a.f.has(c))return a.f.get(c);
16
+ var d=_.ng(b,_.la)||"jpg",e=DA(b);const f=_.ng(b,"NAME");d=yield LA(a,c,d,_.bd,e,!1,f,null,null);if(null===d)return null;if(a.f.has(c))return a.f.get(c);if(e=_.ng(b,_.ja))d.stream.bandwidth=Number(e);a.f.set(c,d);return d})},IA=function(a,b,c,d){return _.w(function*(){let e=AA(a,b);var f=_.ng(b,"AUDIO"),g=_.ng(b,"VIDEO"),h=f||g;h=h&&a.o.has(h)?a.o.get(h):[];f={audio:f?h:[],video:g?h:[]};a.a.debug("Guessing stream type for",b.toString());g=!1;const k=Wz(b,_.lb),l=f.audio.find(q=>q.cd===k);var m=_.Ch(_.v,
17
+ e);m=c||d||m;1!==e.length||m?!h.length&&1<e.length?(a.a.debug("Guessing multiplexed audio+video"),h=_.v,e=[e.join(",")]):f.audio.length&&l?(a.a.debug(Sz),h=_.Yb,g=!0):f.video.length?(a.a.debug(Sz),h=_.Yb):(a.a.debug("Guessing video-only"),h=_.v):(h=_.Yb,a.a.debug(Sz));let n;g||(n=yield MA(a,b,e,h));if(n)f[n.stream.type]=[n];else if(null===n)return a.a.debug("streamInfo is null"),null;NA(f);return f})},JA=function(a,b,c,d,e,f,g){c.forEach(l=>{if(l=l.stream)l.width=Number(e)||void 0,l.height=Number(f)||
18
+ void 0,l.frameRate=Number(g)||void 0});b.length||(b=[null]);c.length||(c=[null]);const h=[];for(const l of b)for(const m of c){var k=l?l.stream:null;const n=m?m.stream:null,q=l?l.drmInfos:null,t=m?m.drmInfos:null;b=(m?m.cd:"")+" - "+(l?l.cd:"");let u;if(k&&n)if(q.length&&t.length?0<_.zu(q,t).length:1)u=_.zu(q,t);else{a.a.warn("Incompatible DRM info in HLS variant. Skipping.");continue}else k?u=q:n&&(u=t);a.X.has(b)?a.a.debug("Skipping variant which only differs in text streams."):(k=OA(a,k,n,d,u),
19
+ h.push(k),a.X.add(b))}return h},MA=function(a,b,c,d){return _.w(function*(){const e=Wz(b,_.lb);if(a.f.has(e))return a.f.get(e);var f=_.ng(b,Ez),g=null;d==_.v&&f&&"NONE"!=f&&(g=a.L.get(f));f=BA(d,c);g=yield LA(a,e,f,d,_.xe,!1,null,null,g);if(null==g)return null;if(a.f.has(e))return a.f.get(e);a.f.set(e,g);return g})},NA=function(a){for(const b of a.audio.concat(a.video))a=b.stream.codecs.split(","),a=a.filter(c=>"mp4a.40.34"!=c),b.stream.codecs=a.join(",")},OA=function(a,b,c,d,e){return{id:a.$++,language:b?
20
+ b.language:_.xe,primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}},DA=function(a){a=_.ng(a,"LANGUAGE")||_.xe;return _.Kh(a)},LA=function(a,b,c,d,e,f,g,h,k){return _.w(function*(){let l=aA(a.A,b);var m=null;if(a.j==pA&&a.G.has(l)){var n=a.G.get(l);a.G.delete(l)}else{var q=yield mA(a,l);l=q.uri;n=iA(a.M,q.data,l)}if(1!=n.type)throw new _.H(_.F,4,4017);PA(a,n);q=yield QA(a,d,c,n);const t=[];n.a.forEach(fd=>{fd=Yz(fd.ta,"EXT-X-KEY");
21
+ t.push.apply(t,fd)});let u=!1;const y=[];let A=null;for(var E of t){var D=Wz(E,"METHOD"),ma=_.ng(E,"KEYFORMAT","identity");"NONE"!=D&&("AES-128"==D?(m=_.ng(E,"IV",""),m={method:"AES-128",url:aA(a.A,Wz(E,_.lb)),iv:m?_.bj((m||"0x").slice(2)):null},a.I=!0):(u=!0,(D=(D=RA[ma])?D(E,q):null)?(D.keyIds.length&&(A=D.keyIds[0]),y.push(D)):a.a.warn("Unsupported HLS KEYFORMAT",ma)))}if(u&&!y.length&&!a.I)throw new _.H(_.F,4,4026);E=new Map;var na=yield tA(a,b,n,d,q,c,m,E);ma=na[0].startTime;D=na[na.length-1].endTime;
22
+ const uf=D-ma;na=new _.uz(na);const vf=a.g.hlsLowLatency?_.rx:_.Qt,wf=wA(n,m);let Ra=void 0;d==_.r&&(Ra=_.Yt);n=(n=$z(n.ta,Nz))?"YES"===_.ng(n,"CAN-BLOCK-RELOAD"):!1;return{stream:{id:a.$++,originalId:g,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:na.f.bind(na),getSegmentReference:na.get.bind(na),adjustSegmentDurations:na.g.bind(na),getDuration:na.getDuration.bind(na),segmentIndex:na,segmentLookupStrategy:vf,initSegmentReference:wf,mimeType:q,codecs:c,kind:Ra,encrypted:u,keyId:A,
23
+ language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:h,closedCaptions:k,keyInfo:m},segmentIndex:na,drmInfos:y,cd:b,Ve:l,Fd:ma,qg:D,duration:uf,ff:E,af:n}})},PA=function(a,b){var c=$z(b.ta,Lz),d=$z(b.ta,Iz);d=c&&"VOD"==c.value||d;c=c&&"EVENT"==c.value&&!d;c=!d&&!c;if(d)uA(a,pA);else{c?uA(a,rA):uA(a,SA);d=$z(b.ta,Pz);if(!d)throw new _.H(_.F,4,4024,{missingTag:Pz});d=Number(d.value);c=$z(b.ta,
24
+ Kz);a.g.hlsLowLatency&&c?(d=Number(Wz(c,"PART-TARGET")),a.F=Math.min(d,a.F),a.C=Math.max(d,a.C),b=$z(b.ta,Nz),a.T=b?Number(Wz(b,"PART-HOLD-BACK")):0):(a.C=Math.max(d,a.C),a.F=Math.min(d,a.F),a.T=3*a.C)}},QA=function(a,b,c,d){return _.w(function*(){var e=d.a[0].a;const f=(new _.ag(e)).pa.split(".").pop(),g=nA[b][f];if(g)return g;if(b==_.r)return c&&"vtt"!=c?_.Sb:_.se;e=_.Yg([e],a.g.attemptParameters);e.method="HEAD";e.type=2;e=(yield lA(a,e)).headers["content-type"];if(!e)throw new _.H(_.F,4,4021,
25
+ f);return e.split(";")[0]})},wA=function(a,b){var c=Yz(a.ta,"EXT-X-MAP");if(!c.length)return null;if(1<c.length)throw new _.H(_.F,4,4020);c=c[0];var d=Wz(c,_.lb);const e=aA(a.f,d);a=0;d=null;if(c=_.ng(c,"BYTERANGE"))a=c.split("@"),c=Number(a[0]),a=Number(a[1]),d=a+c-1;return new _.sz(()=>[e],a,d,b)},qA=function(a){a.h&&(a.V.forEach(b=>{_.Lu(a.h,b,0)}),a.V=[])},TA=function(a,b){var c=0;let d=null;b&&(c=b.split("@"),b=Number(c[0]),c=c[1]?Number(c[1]):a.Ba+1,d=c+b-1);return[c,d]},UA=function(a,b,c,d,
26
+ e,f,g){const h=[];for(const n of _.qu(b.f)){b=n.Wc;const q=n.item;{var k=0==b?a:h[h.length-1],l=0==b?d:k.endTime,m=Number(_.ng(q,"DURATION"));m=l+m;const t=_.ng(q,"BYTERANGE"),[u,y]=TA(k,t);k=_.ng(q,_.lb);const A=(k=aA(g,k))?[k]:[];l=new _.Uu(c,l,m,()=>A,u,y,e,f,!1,null,null,null,null);if("YES"===_.ng(q,"INDEPENDENT")||0===b)l.g=!0;h.push(l)}}return h},zA=function(a,b,c,d,e,f,g,h,k){var l=c.ta,m=c.a;const n=m?[m]:[];m=$z(l,Qz);(g=g?Object.assign({},g):null)&&!g.iv&&(g.iv=_.ej(new Uint8Array(12),new Uint8Array([d>>
27
+ 24&255,d>>16&255,d>>8&255,d&255])));var q=null,t=null,u=null;h===_.bd&&(t=$z(l,"EXT-X-TILES"),q="1x1",t&&(q=_.ng(t,"LAYOUT")||"1x1",u=(u=_.ng(t,"DURATION"))?Number(u):null),[q,t]=q.split("x").map(y=>parseInt(y,10)));if(0===c.f.length&&!m)throw new _.H(_.F,4,4024,{missingTag:Qz});h=null;if(0<c.f.length)if(a.g.hlsLowLatency)h=UA(b,c,d,e,f,g,k);else return null;c=a=0;k=null;m?(a=e+Number(m.value.split(",")[0]),l=$z(l,Fz),[c,k]=TA(b,l?l.value:null)):a=h[h.length-1].endTime;return new _.Uu(d,e,a,()=>n,
28
+ c,k,f,g,!1,null,q,t,u,h)},xA=function(a,b,c,d,e,f,g,h,k,l){return _.w(function*(){var m=zA(a,null,d,e,0,0,f,k,"");if(!m)return 0;if(a.J&&!l){var n=a.f.get(b).segmentIndex.get(m.position);if(n)return a.a.debug("Found segment start time in previous manifest"),n.startTime;a.a.debug("Unable to find segment start time in previous manifest!")}a.a.debug("Fetching segment to find start time");if("audio/mpeg"==g)return 0;if(g==_.Zb)return m=yield VA(a,m),n=_.G(m.data),jA(n)?WA(n):XA(a,m.data);if(g==_.Ie||
29
+ g==_.bc)return m=[VA(a,m)],c&&m.push(VA(a,c)),m=yield Promise.all(m),YA(a,m[0].data,(m[1]||m[0]).data);if(g==_.He)return m=yield VA(a,m),XA(a,m.data);if(g===_.ac||g===_.$b||!MediaSource.isTypeSupported(`${g.split("/")[0]||""}/mp4;codecs="${h}"`))return 0;throw new _.H(_.F,4,4030);})},yA=function(a,b,c,d,e,f,g,h,k,l,m){return _.w(function*(){let n;a.K.has(b)?n=a.K.get(b):(n=(yield xA(a,c,d,e,f,g,h,k,m,!0))-l,a.a.debug("Discontinuity segment offset",n),a.K.set(b,n));return n})},lA=function(a,b){if(!a.B)throw new _.H(_.F,
30
+ 7,7001);b=a.D.networkingEngine.fetch(b);_.eh(a.B,b);return b.R},VA=function(a,b){return _.w(function*(){const c=b.f(),d=_.Iu(b.Ea(),b.La,b.La+2048-1,a.g.attemptParameters);d.type=2;const e=_.Iu(b.Ea(),b.La,b.Ba,a.g.attemptParameters);e.type=2;c&&(e.keyInfo=c);try{return yield lA(a,a.I?e:d)}catch(f){if(7001==f.code||a.I)throw f;a.a.warn("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",
31
+ d.uris[0]);return yield lA(a,e)}})},WA=function(a){function b(h,k,l){let m="";for(;k<l;k++)m+="%"+("00"+h[k].toString(16)).slice(-2);return m}function c(h){return h[0]<<21|h[1]<<14|h[2]<<7|h[3]}function d(){throw new _.H(_.F,4,4030);}jA(a)||d();let e=10;a[5]&64&&(e=e+4+c(a.subarray(10,14)));do{var f=c(a.subarray(e+4,e+8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(let h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===
32
+ unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}jA(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},XA=function(a,b){function c(){e.seek(f+188);g=_.tj(e);71!=g&&(e.seek(f+192),g=_.tj(e));71!=g&&(e.seek(f+204),g=_.tj(e));71!=g&&d();Xz(e)}function d(){throw new _.H(_.F,4,4030);}const e=new _.qk(new DataView(b),!1);let f=0,g=0;f=ZA(e);0>f&&(a.a.error("Unable to find sync byte in TS after scanning"),d());for(;;){f=
33
+ e.getPosition();g=_.tj(e);71!=g&&d();a=_.uj(e);if(8191===(a&8191)){c();continue}if(!(a&16384)){c();continue}a=(_.tj(e)&48)>>4;0!=a&&2!=a||d();3==a&&(a=_.tj(e),e.skip(a));if(1!=_.M(e)>>8){c();continue}e.skip(3);a=_.tj(e)>>6;0!=a&&1!=a||d();0==_.tj(e)&&d();a=_.tj(e);b=_.uj(e);const h=_.uj(e);return(1073741824*((a&14)>>1)+((b&65534)<<14|(h&65534)>>1))/9E4}},YA=function(a,b,c){let d=0;(new _.Hj).N(_.wd,_.N).N(_.ve,_.N).N(_.rd,_.N).Y("mdhd",g=>{g.H.skip(0==g.version?8:16);d=_.M(g.H);g.Qa.stop()}).parse(c,
34
+ !0);if(!d)throw a.a.error("Unable to find timescale in init segment!"),new _.H(_.F,4,4030);let e=0,f=!1;(new _.Hj).N("moof",_.N).N("traf",_.N).Y("tfdt",g=>{e=(0==g.version?_.M(g.H):_.xj(g.H))/d;f=!0;g.Qa.stop()}).parse(b,!0);if(!f)throw new _.H(_.F,4,4030);return e},ZA=function(a){for(;a.getPosition()<a.wa()-1;){const b=a.getPosition();if(71===_.tj(a))return Xz(a),b}return-1},hA=class{constructor(a,b,c,d){this.f=a;this.type=b;this.ta=c;this.a=d||null}},eA=class{constructor(a,b,c=[]){this.ta=b;this.a=
35
+ a;this.f=c}},cA=[Pz,Jz,Hz,Lz,"EXT-X-MAP","EXT-X-I-FRAMES-ONLY",Iz,Nz,Kz],gA=[Qz,Fz,Gz,"EXT-X-PROGRAM-DATE-TIME","EXT-X-KEY","EXT-X-DATERANGE"],dA=["EXT-X-PART",Mz],$A=class{constructor(){this.a=0}},aB=class{constructor(){this.g=this.D=null;this.$=1;this.T=0;this.o=new Map;this.X=new Set;this.f=new Map;this.h=null;this.A="";this.M=new $A;this.W=0;this.S=new Map;this.w=new _.Qh(()=>{this.wb()});this.j=pA;this.J=null;this.C=0;this.F=Infinity;this.B=new _.Mo;this.V=[];this.L=new Map;this.I=!1;this.m=
36
+ new Map;this.O=null;this.a=new _.O("clpp.hls.HlsParser");this.G=new Map;this.K=new Map}configure(a){this.g=a}setCurrentVariant(a){const b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.S.clear();for(const c of this.f.keys()){const d=this.f.get(c);!d.stream||d.stream.id!==b&&d.stream.id!==a||this.S.set(c,d)}}start(a,b){const c=this;return _.w(function*(){c.D=b;var d=yield mA(c,a);c.A=d.uri;yield sA(c,d.data);d=c.W;0<d&&c.w.aa(d);return c.J})}stop(){this.w&&(this.w.stop(),this.w=null);const a=
37
+ [];this.B&&(a.push(this.B.destroy()),this.B=null);this.g=this.D=null;this.X.clear();this.f.clear();this.G.clear();this.J=null;this.o.clear();this.m.clear();return Promise.all(a)}update(){const a=this;return _.w(function*(){if(a.j!=pA){var b=[];a.O=null;var c=Array.from(a.f.values()),d=Array.from(a.S.values());c=a.g.hlsLowLatency&&0<d.length?d:c;yield vA(a,c[0]);for(d=1;d<c.length;d++)b.push(vA(a,c[d]));yield Promise.all(b)}})}onExpirationUpdated(){}wb(){const a=this;return _.w(function*(){a.a.debug(_.Jt);
38
+ if(a.D)try{yield a.update(),a.w.aa(a.W)}catch(b){a.D&&(a.D.onError(b),1===b.severity&&a.w.aa(.1))}})}},nA={audio:{mp4:_.bc,m4s:_.bc,m4i:_.bc,m4a:_.bc,cmfa:_.bc,ts:_.He,aac:_.Zb,ec3:_.ac,ac3:_.$b},video:{mp4:_.Ie,m4s:_.Ie,m4i:_.Ie,m4v:_.Ie,cmfv:_.Ie,ts:_.He},text:{mp4:_.Sb,m4s:_.Sb,m4i:_.Sb,cmft:_.Sb,vtt:_.se,ttml:_.Vb},image:{jpg:_.cd,jpeg:_.cd,png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}},RA={"com.apple.streamingkeydelivery":function(a,b){if(b===_.He)throw new _.H(_.F,
39
+ 4,4041);return _.pu(_.Fc,[{initDataType:_.ge,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":kA,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":kA,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=Wz(a,"METHOD");const c=["SAMPLE-AES",Tz];if(!c.includes(b))return _.Jf("Widevine in HLS is only supported with [",c.join(", "),"], not",b),null;b=Wz(a,_.lb);b=_.ao(b);b=_.G(b.data);b=_.pu(_.Hc,[{initDataType:_.qc,initData:b}],"");if(a=_.ng(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];
40
+ return b}},pA="VOD",SA="EVENT",rA="LIVE";_.x("clpp.hls.HlsComponent",class extends _.Ep{constructor(){super()}f(){_.Fn.m3u8=aB;_.Dn[_.wi]=aB;_.Dn[Vz]=aB}a(){_.bv("m3u8");_.cv(_.wi);_.cv(Vz)}id(){return"hls"}});};f.call(g, window);
package/cl.hlssmpte.js CHANGED
@@ -1,5 +1,5 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var TH=function(a){a.a.one(a.l,_.id,()=>SH(a))},SH=function(a){const b=a.l.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Gb,d=>UH(a,d));var c=Array.from(b.textTracks);c.filter(d=>d.kind===_.od).forEach(d=>{UH(a,{track:d})});!VH(c)&&a.m&&(a.f.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),WH(a,b))}else a.f.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");
2
- else a.f.warn("A video element is not available. Skipping.")},UH=function(a,b){b=b.track;b.kind===_.od&&(a.f.info("The metadata track has been added."),b.mode=_.Xc,a.a.on(b,_.Gc,c=>XH(a,c)))},VH=function(a){return a.some(b=>b.kind===_.od)},WH=function(a,b){const c=a.l.getTrackManager(),d=c.ia(),e=c.getAudioTracks().find(g=>g!==d);if(e){var f=()=>c.na(d);a.a.on(b.textTracks,_.Gb,g=>{g.track.kind===_.od&&(a.a.off(b.textTracks,_.Gb,f),c.na(d))});c.na(e)}else a.f.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},
3
- XH=function(a,b){const c=YH(a);c&&Array.from(b.target.activeCues||[]).forEach(d=>{if(d!==a.g&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new ZH(d);if(e.f===c&&null!==e.a){a.g=d;d=a.h.parseMedia(_.tg(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});const f=a.l.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},YH=function(a){return(a=a.l.getTrackManager().ja())&&a.language&&a.language.toLowerCase()},
4
- ZH=class{constructor(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.z(a)){a:{var b=a.info;if(_.kf(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=a=_.kf(a)?a:null}}};var $H=class{constructor(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.Nn;this.h=(a=_.Bn[_.Rb]||null)?new a(this.l.getConfiguration()):null;this.f=new _.N("clpp.hlssmpte.ImageCueHandler");this.g=null;TH(this)}destroy(){this.a.release();this.g=null;return Promise.resolve()}};var aI=class extends _.Ep{constructor(){super();this.a=null;this.f=!1}onPlayerCreated(){}onContentWillLoad(a){if(this.f=_.Rh()){var b=a.getConfiguration();b=_.ff(b.hlssmpte||{});typeof b.patchMetadataTrack!==_.cc&&(b.patchMetadataTrack=!1);_.lf(b.timestampOffset)||(b.timestampOffset=0);this.a=new $H(a,b.patchMetadataTrack,b.timestampOffset)}}onPlayerWillDestroy(){const a=this;return _.w(function*(){a.a&&(yield a.a.destroy(),a.a=null)})}id(){return"hlssmpte"}};_.y("clpp.hlssmpte.HlsSmptePlugin",aI);
5
- aI.Id="hlssmpte";_.km(new class{create(){return new aI}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var oI=function(a){a.a.one(a.l,_.nd,()=>nI(a))},nI=function(a){const b=a.l.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Kb,d=>pI(a,d));var c=Array.from(b.textTracks);c.filter(d=>d.kind===_.td).forEach(d=>{pI(a,{track:d})});!qI(c)&&a.m&&(a.f.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),rI(a,b))}else a.f.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");
2
+ else a.f.warn("A video element is not available. Skipping.")},pI=function(a,b){b=b.track;b.kind===_.td&&(a.f.info("The metadata track has been added."),b.mode=_.ad,a.a.on(b,_.Kc,c=>sI(a,c)))},qI=function(a){return a.some(b=>b.kind===_.td)},rI=function(a,b){const c=a.l.getTrackManager(),d=c.ka(),e=c.getAudioTracks().find(g=>g!==d);if(e){var f=()=>c.qa(d);a.a.on(b.textTracks,_.Kb,g=>{g.track.kind===_.td&&(a.a.off(b.textTracks,_.Kb,f),c.qa(d))});c.qa(e)}else a.f.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},
3
+ sI=function(a,b){const c=tI(a);c&&Array.from(b.target.activeCues||[]).forEach(d=>{if(d!==a.g&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new uI(d);if(e.f===c&&null!==e.a){a.g=d;d=a.h.parseMedia(_.Eg(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});const f=a.l.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},tI=function(a){return(a=a.l.getTrackManager().la())&&a.language&&a.language.toLowerCase()},
4
+ uI=class{constructor(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.z(a)){a:{var b=a.info;if(_.of(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=a=_.of(a)?a:null}}};var vI=class{constructor(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.po;this.h=(a=_.co[_.Vb]||null)?new a(this.l.getConfiguration()):null;this.f=new _.O("clpp.hlssmpte.ImageCueHandler");this.g=null;oI(this)}destroy(){this.a.release();this.g=null;return Promise.resolve()}};var wI=class extends _.bq{constructor(){super();this.a=null;this.f=!1}onPlayerCreated(){}onContentWillLoad(a){if(this.f=_.di()){var b=a.getConfiguration();b=_.jf(b.hlssmpte||{});typeof b.patchMetadataTrack!==_.fc&&(b.patchMetadataTrack=!1);_.pf(b.timestampOffset)||(b.timestampOffset=0);this.a=new vI(a,b.patchMetadataTrack,b.timestampOffset)}}onPlayerWillDestroy(){const a=this;return _.w(function*(){a.a&&(yield a.a.destroy(),a.a=null)})}id(){return"hlssmpte"}};_.x("clpp.hlssmpte.HlsSmptePlugin",wI);
5
+ wI.Id="hlssmpte";_.Nm(new class{create(){return new wI}});};f.call(g, window);
package/cl.htmlcue.js CHANGED
@@ -1,25 +1,25 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var MG="Unsupported unit",NG="clpp-text-plain",OG="clpp-text-ttml",PG="clpp.htmlcue.HtmlTextDisplayer",QG="initial",RG=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},SG=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},UG=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>TG[c]);return a},VG=
2
- function(a,b){for(const c in a)b.style[c]=a[c]},WG=function(a,b){return 0===a?"0":a+b},XG=function(a,b){return 1>Math.abs(a-b)||a<b},YG=function(a,b){return a<b&&1<Math.abs(a-b)},ZG=function(a,b){return a>b&&1<Math.abs(a-b)},$G=function(a,b){return 1>Math.abs(a-b)||a>b},bH=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"))||
3
- 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 aH(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},cH=function(a){return new aH(a.f,a.g,a.h,a.a,a.height,a.width)},dH=function(a,b){return b.some(c=>YG(a.f,c.g)&&ZG(a.g,c.f)&&YG(a.h,c.a)&&ZG(a.a,c.h))},eH=function(a,b){return $G(a.h,b.h)&&XG(a.a,b.a)&&$G(a.f,b.f)&&XG(a.g,b.g)},fH=function(a,b,c){switch(c){case "+x":return YG(a.f,b.f);case "-x":return ZG(a.g,
4
- b.g);case "+y":return YG(a.h,b.h);case "-y":return ZG(a.a,b.a);default:throw Error("Unknown axis");}},gH=function(a){return a.f.writingMode===_.Rn},hH=function(a){switch(a.f.writingMode){case _.Rn:return"horizontal-tb";case _.Be:return _.Be;case _.De:return _.De;default:throw Error("Unknown writing mode");}},iH=function(a){switch(a.f.positionAlign){case _.gd:return _.ad;case "auto":case _.oc:return _.Qn;case _.hd:return _.Zd}return a.f.textAlign},jH=function(a,b){if(typeof a.f.position===_.p&&typeof a.f.size===
5
- _.p)switch(b){case _.gd:return a.f.position;case "auto":case _.oc:return a.f.position-a.f.size/2;case _.hd:return a.f.position-a.f.size}return 0},kH=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.ad:case _.ad:return _.gd;case _.Qn:return _.oc;case _.Zd:case _.Zd:return _.hd}return a.f.positionAlign},nH=function(a,b,c){return(lH(a)||mH(a))&&_.lf(c)?WG(c,_.Sd):lH(a)&&_.z(c)?WG(0,_.Sd):gH(a)&&_.lf(b)?WG(b,"%"):QG},oH=function(a,b,c){return gH(a)&&_.lf(c)?WG(c,_.Sd):(lH(a)||mH(a))&&_.lf(b)?
6
- WG(b,"%"):QG},pH=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 gH(a)?b:c},mH=function(a){return a.f.writingMode===_.De},lH=function(a){return a.f.writingMode===_.Be},qH=function(a,b){if(a.h)switch(b.writingMode){case _.Rn:return["-y"];case _.Be:return["+x"];case _.De:return["-x"]}a=[];switch(b.writingMode){case _.Rn:a=["+y","-y"];break;case _.Be:a=["+x","-x"];break;case _.De:a=["-x","+x"]}0>b.line&&(a=a.reverse());
7
- return a},rH=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=bH(a.j.a)},sH=function(a,b){rH(a.g);a.j.unshift(b);for(const c of a.j)a.g.append(c)},tH=function(a,b,c){a=a.f;const d=a.viewportAnchorUnits;if(d===_.Yn)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(MG);},vH=function(a,b,c,d){const e=document.createElement(_.le),f=e.dataset;f.name=b;f.for=c;d&&(f.name=`${b} (sandbox)`,f.sandbox=!0);
8
- c=document.head;c.appendChild(e);uH(a,c,b);a.f.debug(`Created HTML style element #${b}.`);return e.sheet},wH=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,a)},xH=function(a,b){let c=!1;try{a.g.insertRule(b,0);const d=
9
- 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},yH=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.m=[]}},uH=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,
10
- childList:!0});a.o.push(()=>d.disconnect())},zH=function(a){a=_.ff(a.getConfiguration().htmlcue||{});_.z(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.z(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},FH=function(a,b){if((b||a.j)&&a.D){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.ll)if(a.J=c,c=AH(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,BH(a),a.m&&(b="::cue {",a.getFontColor()&&(b+=`color: ${a.getFontColor()};`),
11
- a.getBackgroundColor()&&(b+=`background-color: ${a.getBackgroundColor()};`),a.getFontFamily()&&(b+=`font-family: ${a.getFontFamily()};`),a.getEdgeType()!==_.yp&&(b+=`text-shadow: ${_.Hn(a)};`),b+="}",yH(a.m),a.m.appendRule(b)),null!==c)){c=a.f.slice(c.start,c.end+1);for(const g of c){c=a;b=g;var d=c.a.a,e=null;switch(b.payloadType){case _.Ke:e="clpp-text-vtt";break;case _.te:e=OG;break;case _.Pn:e=NG}e&&!d.classList.contains(e)&&_.Fl(d,e);d=bH(c.a.a);if(0===d.width||0===d.height)c.N.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
12
- else{VG({fontSize:CH(c,b.containerRows)},c.a.a);d=null;e=b.payloadType===_.Ke;var f=b.payloadType===_.te;b.region&&(e||f||b.backgroundImage)&&(c.A.has(b.region.id)?d=c.A.get(b.region.id):(d=new DH(b.region,{}),c.A.set(b.region.id,d),sH(c.a,d)));b=new EH(b,c.M,{});d?sH(d,b):sH(c.a,b)}}}}},GH=function(a){BH(a);a.J=null;a.o=null;a.f=[]},HH=function(a,b){return a.startTime<=b&&a.endTime>b},AH=function(a,b){var c=RG(a.f,d=>HH(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&&HH(a.f[d-1],b);)d--;for(;c+1<a.f.length&&HH(a.f[c+1],b);)c++;return{start:d,end:c}}},BH=function(a){a.A.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(OG);b.classList.remove(NG);a=a.a;rH(a.g);a.j=[]}},CH=function(a,b){const c=bH(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===_.p&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*
14
- a)}px`},LH=class{parse(a){a={input:a};const b=_.Hl(_.Jc),c=[];let d=b;for(var e;null!==(e=SG(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=IH[f];h?(h=_.Hl(h),(f=JH[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||KH[g.localName]&&KH[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(UG(e)));return b}},IH={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},JH={v:"voice",lang:"lang"},KH={rt:"ruby"},TG={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var aH=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 MH=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 EH=class extends MH{constructor(a,b,c){super(a.id,"clpp-text-cue",c);this.j=b;this.f=a;this.g=!!this.f.backgroundImage}w(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)}init(a){super.init(a);if(this.g)_.Fl(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage=`url("${this.f.backgroundImage}")`,this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else{var b=this.f;if(b.payloadType===_.te){var c=_.Hl(_.Jc);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ke?b=(new LH).parse(b.payload):
16
- (c=_.Hl(_.Jc),c.textContent=b.payload,b=c);_.Fl(b,this.o);this.id&&(b.id=this.id);for(d of this.f.cssClassList)_.Fl(b,d);VG({writingMode:hH(this)},b);var d=b;this.a.appendChild(d);_.Fl(this.a,"clpp-text-wrapper");for(var e of this.f.cssClassList)_.Fl(this.a,`clpp-text-wrapper__${e}`);_.z(this.f.line)&&(this.f.lineInterpretation=_.Sn,this.f.line=gH(this)?-1:0);e=hH(this);VG({writingMode:e,webkitWritingMode:e,direction:QG,textAlign:iH(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){e=
17
- jH(this,kH(this));VG({position:"absolute",left:nH(this,e,null),right:mH(this)&&_.z(null)?WG(0,_.Sd):QG,top:oH(this,e,null),width:gH(this)?WG(this.f.size,"%"):QG,height:lH(this)||mH(this)?WG(this.f.size,"%"):QG},this.a);d=this.f;a=gH(this)?a.height:a.width;b=pH(this);if(d.lineInterpretation===_.Sn)c=b*Math.round(d.line),Math.abs(c)>a&&(c=b*(0>d.line?0:-1)),0>c&&(c+=a);else{c=b/a*100;let f=d.line;switch(d.lineAlign){case _.oc:f-=c/2;break;case _.Rc:f-=c}c=Math.round(f/100*a)}mH(this)&&(c=a-c-b);a=c;
18
- VG({left:nH(this,e,a),right:mH(this)&&_.z(a)?WG(0,_.Sd):QG,top:oH(this,e,a)},this.a)}}}m(){return _.Hl(_.Jc)}};var NH=class{constructor(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=bH(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.Xc;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=bH(a.a);var d=qH(this,a.f),e=pH(a);const g=cH(c);let h=null,k=0;for(const l of d){for(;fH(c,this.a,l)||eH(c,this.a)&&dH(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||eH(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=cH(c),k=d);c=cH(g)}c=h||g}VG({top:WG(c.h-this.a.h,_.Sd),bottom:WG(this.a.a-c.a,_.Sd),left:WG(c.f-this.a.f,_.Sd),right:WG(this.a.g-c.g,_.Sd),height:WG(c.height,_.Sd),width:WG(c.width,_.Sd)},a.a)}b.style.visibility="visible";this.g.push(bH(a.a))}};var OH=class extends MH{constructor(a,b,c){super(a,b,c);this.g=null;this.j=[]}init(){this.g=new NH(this);this.h=!0}m(){const a=_.Hl(_.Jc);_.Fl(a,this.o);this.id&&(a.id=this.id);return a}};var DH=class extends OH{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 _.Yn:b=b.width/100*a.width;break a;default:throw Error(MG);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Yn)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(MG);d=a.height;const e=tH(this,d,a.height);VG(this.A,this.a);VG({left:WG(c,_.Sd),top:WG(e,_.Sd),width:WG(b,
20
- _.Sd),height:WG(d,_.Sd)},this.a);this.f.writingMode&&VG({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&VG({"justify-content":this.f.displayAlign},this.a);for(var f of this.f.cssClassList)_.Fl(this.a,f);a:switch(f=this.f,f.heightUnits){case 0:f=f.height;break a;case _.Yn:f=f.height/100*a.height;break a;case 2:f=f.height;c=new EH(new _.Vn(0,1,"Lorem ipsum",_.Pn),{},{});b=c.a;this.a.appendChild(b);c.init(bH(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
21
- b=c;f*=b;break a;default:throw Error(MG);}a=tH(this,f,a.height);VG({top:WG(a,_.Sd),height:WG(f,_.Sd)},this.a);this.g=new NH(this,!0);this.h=!0}getId(){return this.f.id}};var PH=class{constructor(a,b){this.f=new _.N("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.m=[];this.a=vH(this,this.h,this.j);this.g=vH(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=wH(this,a);if(xH(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 _.w(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],yH(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 QH=class extends _.Ap{constructor(a){super(a);this.N=new _.N(PG);this.l=a;this.M=zH(a);this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new PH(a,"CLPP Subtitle Styles");this.m=new PH(a,"CLPP Custom Subtitle Styles");this.a=new OH(null,"clpp-text-container",{});this.w=new _.vp(a.getSurface(),this.V.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.N.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
23
- this.F=new _.Dh(()=>{FH(this)});this.A=new Map;this.o=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.o=null;FH(this,!1)}}g(){null==this.h||FH(this,!0)}destroy(){const a=
24
- this;return _.w(function*(){null!=a.h&&(GH(a),a.F.stop(),yield a.h.destroy(),a.h=null,yield a.m.destroy(),a.m=null,a.D.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.o=null;FH(this,!0);return!0}isTextVisible(){return this.j}setTextVisibility(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.F.Ua(.25),this.M.enableResizeObserver&&this.w.start(),FH(this,!0)):(this.F.stop(),this.w.stop(),GH(this)))}V(){FH(this,
25
- !0)}};_.y(PG,QH);QH.prototype.setTextVisibility=QH.prototype.setTextVisibility;QH.prototype.isTextVisible=QH.prototype.isTextVisible;QH.prototype.remove=QH.prototype.remove;QH.prototype.destroy=QH.prototype.destroy;QH.prototype.append=QH.prototype.append;var RH=class{Y(a){return!!a.enableHtmlCue&&!_.Th()}create(a){return new QH(a)}};RH.prototype.create=RH.prototype.create;RH.prototype.isSupported=RH.prototype.Y;_.y("clpp.htmlcue.HtmlCueComponent",class extends _.bp{f(){_.Ok("html",new RH)}a(){}id(){return _.me}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var gH="Unsupported unit",hH="clpp-text-plain",iH="clpp-text-ttml",jH="clpp.htmlcue.HtmlTextDisplayer",kH="initial",lH=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},mH=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},oH=function(a){let b=null;for(;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],c=>nH[c]);return a},qH=
2
+ function(a,b){pH(a,b);Array.from(b.getElementsByTagName("*")).forEach(c=>{pH(a,c)})},pH=function(a,b){for(const c in a)null!=a[c]&&(b.style[c]=a[c])},rH=function(a,b){return 0===a?"0":a+b},sH=function(a,b){return 1>Math.abs(a-b)||a<b},tH=function(a,b){return a<b&&1<Math.abs(a-b)},uH=function(a,b){return a>b&&1<Math.abs(a-b)},vH=function(a,b){return 1>Math.abs(a-b)||a>b},xH=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 wH(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},yH=function(a){return new wH(a.f,a.g,a.h,a.a,a.height,a.width)},zH=function(a,b){return b.some(c=>tH(a.f,c.g)&&uH(a.g,c.f)&&tH(a.h,c.a)&&uH(a.a,c.h))},AH=function(a,b){return vH(a.h,
4
+ b.h)&&sH(a.a,b.a)&&vH(a.f,b.f)&&sH(a.g,b.g)},BH=function(a,b,c){switch(c){case "+x":return tH(a.f,b.f);case "-x":return uH(a.g,b.g);case "+y":return tH(a.h,b.h);case "-y":return uH(a.a,b.a);default:throw Error("Unknown axis");}},CH=function(a){return a.f.writingMode===_.to},DH=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 CH(a)?b:c},EH=function(a){switch(a.f.writingMode){case _.to:return"horizontal-tb";case _.Ee:return _.Ee;
5
+ case _.Ge:return _.Ge;default:throw Error("Unknown writing mode");}},FH=function(a){switch(a.f.positionAlign){case _.ld:return _.gd;case "auto":case _.rc:return _.so;case _.md:return _.ce}return a.f.textAlign},GH=function(a,b){if(typeof a.f.position===_.p&&typeof a.f.size===_.p)switch(b){case _.ld:return a.f.position;case "auto":case _.rc:return a.f.position-a.f.size/2;case _.md:return a.f.position-a.f.size}return 0},HH=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.gd:case _.gd:return _.ld;
6
+ case _.so:return _.rc;case _.ce:case _.ce:return _.md}return a.f.positionAlign},KH=function(a,b,c){return(IH(a)||JH(a))&&_.pf(c)?rH(c,_.Wd):IH(a)&&_.z(c)?rH(0,_.Wd):CH(a)&&_.pf(b)?rH(b,"%"):kH},LH=function(a,b,c){return CH(a)&&_.pf(c)?rH(c,_.Wd):(IH(a)||JH(a))&&_.pf(b)?rH(b,"%"):kH},JH=function(a){return a.f.writingMode===_.Ge},IH=function(a){return a.f.writingMode===_.Ee},MH=function(a,b){if(a.h)switch(b.writingMode){case _.to:return["-y"];case _.Ee:return["+x"];case _.Ge:return["-x"]}a=[];switch(b.writingMode){case _.to:a=
7
+ ["+y","-y"];break;case _.Ee:a=["+x","-x"];break;case _.Ge:a=["-x","+x"]}0>b.line&&(a=a.reverse());return a},NH=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=xH(a.j.a)},OH=function(a,b){NH(a.g);a.j.unshift(b);for(const c of a.j)a.g.append(c)},PH=function(a,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(gH);},RH=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);QH(a,c,b);a.f.debug(`Created HTML style element #${b}.`);return e.sheet},SH=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)},TH=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},UH=function(a){if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.m=[]}},QH=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())},VH=function(a){a=_.jf(a.getConfiguration().htmlcue||{});_.z(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.z(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},aI=function(a,b){if((b||a.j)&&a.C){var c=a.l.getPosition();if(b||a.J!==c&&a.l.getState()===_.Nl)if(a.J=c,c=WH(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,XH(a),c)){b={color:a.getFontColor()||void 0,
11
+ 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 _.Ne:g="clpp-text-vtt";break;case _.we:g=iH;break;case _.ro:g=hH}g&&!f.classList.contains(g)&&_.hm(f,g);f=xH(c.a.a);if(0===f.width||0===f.height)c.M.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
12
+ else{pH({fontSize:YH(c,d.containerRows)},c.a.a);f=null;g=d.payloadType===_.Ne;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 ZH(d.region,{}),c.A.set(d.region.id,f),OH(c.a,f)));d=new $H(d,c.L,e);f?OH(f,d):OH(c.a,d)}}}}},bI=function(a){XH(a);a.J=null;a.m=null;a.f=[]},cI=function(a,b){return a.startTime<=b&&a.endTime>b},WH=function(a,b){var c=lH(a.f,d=>cI(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&&cI(a.f[d-1],b);)d--;for(;c+1<a.f.length&&cI(a.f[c+1],b);)c++;return{start:d,end:c}}},XH=function(a){a.A.clear();if(a.a){const b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(iH);b.classList.remove(hH);a=a.a;NH(a.g);a.j=[]}},YH=function(a,b){const c=xH(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B)return a=a.getFontSizePercent(),`${Math.round(c*a)}px`;if(typeof b===_.p&&0<b)return`${Math.round(c/b)}px`;a=a.getFontSizePercent();return`${Math.round(c*
14
+ a)}px`},gI=class{parse(a){a={input:a};const b=_.jm(_.Nc),c=[];let d=b;for(var e;null!==(e=mH(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=dI[f];h?(h=_.jm(h),(f=eI[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||fI[g.localName]&&fI[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),
15
+ d.appendChild(g),d=g)}}else d.appendChild(document.createTextNode(oH(e)));return b}},dI={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},eI={v:"voice",lang:"lang"},fI={rt:"ruby"},nH={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};var wH=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 hI=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 $H=class extends hI{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===_.we){var c=_.jm(_.Nc);c.innerHTML=b.payload;b=c}else b.payloadType===
16
+ _.Ne?b=(new gI).parse(b.payload):(c=_.jm(_.Nc),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);pH({writingMode:EH(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}`);_.z(this.f.line)&&(this.f.lineInterpretation=_.uo,this.f.line=CH(this)?-1:0);e=EH(this);pH({writingMode:e,webkitWritingMode:e,direction:kH,textAlign:FH(this)},this.a);if(!this.f.region||
17
+ !this.f.region.displayAlign){e=GH(this,HH(this));pH({position:"absolute",left:KH(this,e,null),right:JH(this)&&_.z(null)?rH(0,_.Wd):kH,top:LH(this,e,null),width:CH(this)?rH(this.f.size,"%"):kH,height:IH(this)||JH(this)?rH(this.f.size,"%"):kH},this.a);b=this.f;a=CH(this)?a.height:a.width;c=DH(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 _.rc:g-=f/2;break;case _.Vc:g-=f}f=Math.round(g/
18
+ 100*a)}JH(this)&&(f=a-f-c);a=f;pH({left:KH(this,e,a),right:JH(this)&&_.z(a)?rH(0,_.Wd):kH,top:LH(this,e,a)},this.a)}qH(this.B,d)}}m(){return _.jm(_.Nc)}};var iI=class{constructor(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=xH(a.a);this.g=[]}append(a){const b=a.a;b.style.visibility=_.ad;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=xH(a.a);var d=MH(this,a.f),e=DH(a);const g=yH(c);let h=null,k=0;for(const l of d){for(;BH(c,this.a,l)||AH(c,this.a)&&zH(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||AH(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=yH(c),k=d);c=yH(g)}c=h||g}pH({top:rH(c.h-this.a.h,_.Wd),bottom:rH(this.a.a-c.a,_.Wd),left:rH(c.f-this.a.f,_.Wd),right:rH(this.a.g-c.g,_.Wd),height:rH(c.height,_.Wd),width:rH(c.width,_.Wd)},a.a)}b.style.visibility="visible";this.g.push(xH(a.a))}};var jI=class extends hI{constructor(a,b,c){super(a,b,c);this.g=null;this.j=[]}init(){this.g=new iI(this);this.h=!0}m(){const a=_.jm(_.Nc);_.hm(a,this.o);this.id&&(a.id=this.id);return a}};var ZH=class extends jI{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(gH);}}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(gH);d=a.height;const e=PH(this,d,a.height);pH(this.A,this.a);pH({left:rH(c,_.Wd),top:rH(e,_.Wd),width:rH(b,
20
+ _.Wd),height:rH(d,_.Wd)},this.a);this.f.writingMode&&pH({display:"flex","flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&pH({"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 $H(new _.xo(0,1,"Lorem ipsum",_.ro),{},{});b=c.a;this.a.appendChild(b);c.init(xH(this.a));c=b.getBoundingClientRect().height;this.a.removeChild(b);
21
+ b=c;f*=b;break a;default:throw Error(gH);}a=PH(this,f,a.height);pH({top:rH(a,_.Wd),height:rH(f,_.Wd)},this.a);this.g=new iI(this,!0);this.h=!0}getId(){return this.f.id}};var kI=class{constructor(a,b){this.f=new _.O("clpp.htmlcue.StyleManager");this.o=[];this.j=a.getSurface().getUniqueCssClass();this.h=b;this.m=[];this.a=RH(this,this.h,this.j);this.g=RH(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=SH(this,a);if(TH(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 _.w(function*(){null!=a.a&&(a.o.forEach(b=>b()),a.o=[],UH(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 lI=class extends _.Zp{constructor(a){super(a);this.M=new _.O(jH);this.l=a;this.L=VH(a);this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new kI(a,"CLPP Subtitle Styles");this.a=new jI(null,"clpp-text-container",{});this.w=new _.Vp(a.getSurface(),this.V.bind(this));this.J=null;this.C?(this.C.appendChild(this.a.a),this.a.init(null)):this.M.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.F=
23
+ new _.Qh(()=>{aI(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;aI(this,!1)}}g(){null==this.h||aI(this,!0)}destroy(){const a=
24
+ this;return _.w(function*(){null!=a.h&&(bI(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;aI(this,!0);return!0}isTextVisible(){return this.j}setTextVisibility(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.F.Va(.25),this.L.enableResizeObserver&&this.w.start(),aI(this,!0)):(this.F.stop(),this.w.stop(),bI(this)))}V(){aI(this,!0)}};_.x(jH,lI);
25
+ lI.prototype.setTextVisibility=lI.prototype.setTextVisibility;lI.prototype.isTextVisible=lI.prototype.isTextVisible;lI.prototype.remove=lI.prototype.remove;lI.prototype.destroy=lI.prototype.destroy;lI.prototype.append=lI.prototype.append;var mI=class{ba(a){return!!a.enableHtmlCue&&!_.fi()}create(a){return new lI(a)}};_.x("clpp.htmlcue.HtmlCueComponent",class extends _.Ep{f(){_.rl("html",new mI)}a(){}id(){return _.pe}});};f.call(g, window);