1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="f8e688ad-bc64-4043-9456-beb49d3ffbff",t._sentryDebugIdIdentifier="sentry-dbid-f8e688ad-bc64-4043-9456-beb49d3ffbff")}catch(t){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1806],{21806:(t,e,i)=>{i.r(e),i.d(e,{HLSProvider:()=>l});var s=i(87622),n=i(98731);i(12115);class a{#t;#e;#i;#s;#n;get instance(){return this.#i}constructor(t,e){this.#i=null,this.#s=null,this.config={},this.#n=new Set,this.#t=t,this.#e=e}setup(t){let{streamType:e}=this.#e.$state,i=(0,s.peek)(e).includes("live"),a=(0,s.peek)(e).includes("ll-");this.#i=new t({lowLatencyMode:a,backBufferLength:a?4:i?8:void 0,renderTextTracksNatively:!1,...this.config});let r=this.#a.bind(this);for(let e of Object.values(t.Events))this.#i.on(e,r);for(let e of(this.#i.on(t.Events.ERROR,this.#r.bind(this)),this.#n))e(this.#i);this.#e.player.dispatch("hls-instance",{detail:this.#i}),this.#i.attachMedia(this.#t),this.#i.on(t.Events.AUDIO_TRACK_SWITCHED,this.#o.bind(this)),this.#i.on(t.Events.LEVEL_SWITCHED,this.#c.bind(this)),this.#i.on(t.Events.LEVEL_LOADED,this.#l.bind(this)),this.#i.on(t.Events.LEVEL_UPDATED,this.#h.bind(this)),this.#i.on(t.Events.NON_NATIVE_TEXT_TRACKS_FOUND,this.#d.bind(this)),this.#i.on(t.Events.CUES_PARSED,this.#u.bind(this)),this.#e.qualities[n.kW.enableAuto]=this.#b.bind(this),(0,s.listenEvent)(this.#e.qualities,"change",this.#v.bind(this)),(0,s.listenEvent)(this.#e.audioTracks,"change",this.#p.bind(this)),this.#s=(0,s.effect)(this.#f.bind(this))}#y(t,e){return new s.DOMEvent((0,s.camelToKebabCase)(t),{detail:e})}#f(){if(!this.#e.$state.live())return;let t=new n.e8(this.#E.bind(this));return t.start(),t.stop.bind(t)}#E(){this.#e.$state.liveSyncPosition.set(this.#i?.liveSyncPosition??1/0)}#a(t,e){this.#e.player?.dispatch(this.#y(t,e))}#d(t,e){let i=this.#y(t,e),s=-1;for(let t=0;t<e.tracks.length;t++){let a=e.tracks[t],r=a.subtitleTrack??a.closedCaptions,o=new n.to({id:`hls-${a.kind}-${t}`,src:r?.url,label:a.label,language:r?.lang,kind:a.kind,default:a.default});o[n.Hp.readyState]=2,o[n.Hp.onModeChange]=()=>{"showing"===o.mode?(this.#i.subtitleTrack=t,s=t):s===t&&(this.#i.subtitleTrack=-1,s=-1)},this.#e.textTracks.add(o,i)}}#u(t,e){let i=this.#i?.subtitleTrack,s=this.#e.textTracks.getById(`hls-${e.type}-${i}`);if(!s)return;let n=this.#y(t,e);for(let t of e.cues)t.positionAlign="auto",s.addCue(t,n)}#o(t,e){let i=this.#e.audioTracks[e.id];if(i){let s=this.#y(t,e);this.#e.audioTracks[n.jH.select](i,!0,s)}}#c(t,e){let i=this.#e.qualities[e.level];if(i){let s=this.#y(t,e);this.#e.qualities[n.jH.select](i,!0,s)}}#h(t,e){e.details.totalduration>0&&this.#e.$state.inferredLiveDVRWindow.set(e.details.totalduration)}#l(t,e){if(this.#e.$state.canPlay())return;let{type:i,live:a,totalduration:r,targetduration:o}=e.details,c=this.#y(t,e);this.#e.notify("stream-type-change",a?"EVENT"===i&&Number.isFinite(r)&&o>=10?"live:dvr":"live":"on-demand",c),this.#e.notify("duration-change",r,c);let l=this.#i.media;for(let t of(-1===this.#i.currentLevel&&this.#e.qualities[n.kW.setAuto](!0,c),this.#i.audioTracks)){let e={id:t.id.toString(),label:t.name,language:t.lang||"",kind:"main"};this.#e.audioTracks[n.jH.add](e,c)}for(let t of this.#i.levels){let e={id:t.id?.toString()??t.height+"p",width:t.width,height:t.height,codec:t.codecSet,bitrate:t.bitrate};this.#e.qualities[n.jH.add](e,c)}l.dispatchEvent(new s.DOMEvent("canplay",{trigger:c}))}#r(t,e){e.fatal&&("mediaError"===e.type?this.#i?.recoverMediaError():this.#g(e.error))}#g(t){this.#e.notify("error",{message:t.message,code:1,error:t})}#b(){this.#i&&(this.#i.currentLevel=-1)}#v(){let{qualities:t}=this.#e;this.#i&&!t.auto&&(this.#i[t.switch+"Level"]=t.selectedIndex,n.G_&&(this.#t.currentTime=this.#t.currentTime))}#p(){let{audioTracks:t}=this.#e;this.#i&&this.#i.audioTrack!==t.selectedIndex&&(this.#i.audioTrack=t.selectedIndex)}onInstance(t){return this.#n.add(t),()=>this.#n.delete(t)}loadSource(t){(0,s.isString)(t.src)&&this.#i?.loadSource(t.src)}destroy(){this.#i?.destroy(),this.#i=null,this.#s?.(),this.#s=null}}class r{#S;#e;#L;constructor(t,e,i){this.#S=t,this.#e=e,this.#L=i,this.#x()}async #x(){let t={onLoadStart:this.#k.bind(this),onLoaded:this.#w.bind(this),onLoadError:this.#T.bind(this)},e=await c(this.#S,t);return((0,s.isUndefined)(e)&&!(0,s.isString)(this.#S)&&(e=await o(this.#S,t)),e)?e.isSupported()?e:(this.#e.player.dis
1patch(new s.DOMEvent("hls-unsupported")),this.#e.notify("error",{message:"[vidstack] `hls.js` is not supported in this environment",code:4}),null):null}#k(){this.#e.player.dispatch(new s.DOMEvent("hls-lib-load-start"))}#w(t){this.#e.player.dispatch(new s.DOMEvent("hls-lib-loaded",{detail:t})),this.#L(t)}#T(t){let e=(0,n.rv)(t);this.#e.player.dispatch(new s.DOMEvent("hls-lib-load-error",{detail:e})),this.#e.notify("error",{message:e.message,code:4,error:e})}}async function o(t,e={}){if(!(0,s.isUndefined)(t)){if(e.onLoadStart?.(),t.prototype&&t.prototype!==Function)return e.onLoaded?.(t),t;try{let i=(await t())?.default;if(i&&i.isSupported)e.onLoaded?.(i);else throw Error("");return i}catch(t){e.onLoadError?.(t)}}}async function c(t,e={}){if((0,s.isString)(t)){e.onLoadStart?.();try{if(await (0,n.k0)(t),!(0,s.isFunction)(window.Hls))throw Error("");let i=window.Hls;return e.onLoaded?.(i),i}catch(t){e.onLoadError?.(t)}}}class l extends n.Nw{#D;#m;get ctor(){return this.#D}get instance(){return this.#m.instance}static{this.supported=(0,n.m0)()}get type(){return"hls"}get canLiveSync(){return!0}#O;get config(){return this.#m.config}set config(t){this.#m.config=t}get library(){return this.#O}set library(t){this.#O=t}preconnect(){(0,s.isString)(this.#O)&&(0,n.TB)(this.#O)}setup(){super.setup(),new r(this.#O,this.ctx,t=>{this.#D=t,this.#m.setup(t),this.ctx.notify("provider-setup",this);let e=(0,s.peek)(this.ctx.$state.source);e&&this.loadSource(e)})}async loadSource(t,e){if(!(0,s.isString)(t.src))return void this.removeSource();this.media.preload=e||"",this.appendSource(t,"application/x-mpegurl"),this.#m.loadSource(t),this.currentSrc=t}onInstance(t){let e=this.#m.instance;return e&&t(e),this.#m.onInstance(t)}destroy(){this.#m.destroy()}constructor(...t){super(...t),this.$$PROVIDER_TYPE="HLS",this.#D=null,this.#m=new a(this.video,this.ctx),this.#O="https://cdn.jsdelivr.net/npm/hls.js@^1.5.0/dist/hls.min.js"}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.