hls-parser
Advanced tools
Comparing version 0.6.4 to 0.7.0
/*! For license information please see hls-parser.min.js.LICENSE.txt */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.HLS=e():t.HLS=e()}(self,(function(){return t={851:(t,e,n)=>{var a=n(771),r=a.getOptions,i=a.setOptions,o=n(463),s=n(367),c=n(890);t.exports={parse:o,stringify:s,types:c,getOptions:r,setOptions:i}},463:(t,e,n)=>{function a(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=i(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,r=function(){};return{s:r,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var s=n(771),c=n(890),u=c.Rendition,l=c.Variant,T=c.SessionData,E=c.Key,f=c.MediaInitializationSection,h=c.DateRange,I=c.SpliceInfo,A=c.MasterPlaylist,p=c.MediaPlaylist,d=c.Segment,S=c.PartialSegment,N=c.RenditionReport;function y(t){return s.trim(t,'"')}function X(t){var e=s.splitAt(t,",");return{duration:s.toNumber(e[0]),title:decodeURIComponent(escape(e[1]))}}function v(t){var e=s.splitAt(t,"@");return{length:s.toNumber(e[0]),offset:e[1]?s.toNumber(e[1]):-1}}function R(t,e){e.IV&&t.compatibleVersion<2&&(t.compatibleVersion=2),(e.KEYFORMAT||e.KEYFORMATVERSIONS)&&t.compatibleVersion<5&&(t.compatibleVersion=5)}function m(t){var e=s.splitByCommaWithPreservingQuotes(t),n={};return e.forEach((function(t){var e,a,i=r(s.splitAt(t,"="),2),o=i[0],c=i[1],u=y(c);switch(o){case"URI":n[o]=u;break;case"START-DATE":case"END-DATE":n[o]=new Date(u);break;case"IV":n[o]=(e=u,16!==(a=s.hexToByteSequence(e)).length&&s.INVALIDPLAYLIST("IV must be a 128-bit unsigned integer"),a);break;case"BYTERANGE":n[o]=v(u);break;case"RESOLUTION":n[o]=function(t){var e=s.splitAt(t,"x");return{width:s.toNumber(e[0]),height:s.toNumber(e[1])}}(u);break;case"END-ON-NEXT":case"DEFAULT":case"AUTOSELECT":case"FORCED":case"PRECISE":case"CAN-BLOCK-RELOAD":case"INDEPENDENT":case"GAP":n[o]="YES"===u;break;case"DURATION":case"PLANNED-DURATION":case"BANDWIDTH":case"AVERAGE-BANDWIDTH":case"FRAME-RATE":case"TIME-OFFSET":case"CAN-SKIP-UNTIL":case"HOLD-BACK":case"PART-HOLD-BACK":case"PART-TARGET":case"BYTERANGE-START":case"BYTERANGE-LENGTH":case"LAST-MSN":case"LAST-PART":case"SKIPPED-SEGMENTS":n[o]=s.toNumber(u);break;default:o.startsWith("SCTE35-")?n[o]=s.hexToByteSequence(u):o.startsWith("X-")?n[o]=function(t){return t.startsWith('"')?y(t):t.startsWith("0x")||t.startsWith("0X")?s.hexToByteSequence(t):s.toNumber(t)}(c):n[o]=u}})),n}function D(){s.INVALIDPLAYLIST("The file contains both media and master playlist tags.")}function L(t,e,n){var r,i=(r=e.attributes,new u({type:r.TYPE,uri:r.URI,groupId:r["GROUP-ID"],language:r.LANGUAGE,assocLanguage:r["ASSOC-LANGUAGE"],name:r.NAME,isDefault:r.DEFAULT,autoselect:r.AUTOSELECT,forced:r.FORCED,instreamId:r["INSTREAM-ID"],characteristics:r.CHARACTERISTICS,channels:r.CHANNELS})),o=t[s.camelify(n)],c=function(t,e){var n,r=!1,i=a(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.name===e.name)return"All EXT-X-MEDIA tags in the same Group MUST have different NAME attributes.";o.isDefault&&(r=!0)}}catch(t){i.e(t)}finally{i.f()}return r&&e.isDefault?"EXT-X-MEDIA A Group MUST NOT have more than one member with a DEFAULT attribute of YES.":""}(o,i);c&&s.INVALIDPLAYLIST(c),o.push(i),i.isDefault&&(t.currentRenditions[s.camelify(n)]=o.length-1)}function g(t,e,n,r,i){var o,c=new l({uri:n,bandwidth:e.BANDWIDTH,averageBandwidth:e["AVERAGE-BANDWIDTH"],codecs:e.CODECS,resolution:e.RESOLUTION,frameRate:e["FRAME-RATE"],hdcpLevel:e["HDCP-LEVEL"]}),u=a(t);try{for(u.s();!(o=u.n()).done;){var T=o.value;if("EXT-X-MEDIA"===T.name){var E=T.attributes,f=E.TYPE;if(f&&E["GROUP-ID"]||s.INVALIDPLAYLIST("EXT-X-MEDIA TYPE attribute is REQUIRED."),e[f]===E["GROUP-ID"]&&(L(c,T,f),"CLOSED-CAPTIONS"===f)){var h,I=a(c.closedCaptions);try{for(I.s();!(h=I.n()).done;){var A=h.value.instreamId;if(A&&A.startsWith("SERVICE")&&i.compatibleVersion<7){i.compatibleVersion=7;break}}}catch(t){I.e(t)}finally{I.f()}}}}}catch(t){u.e(t)}finally{u.f()}return function(t,e,n){["AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(a){"CLOSED-CAPTIONS"===a&&"NONE"===t[a]?(n.isClosedCaptionsNone=!0,e.closedCaptions=[]):t[a]&&!e[s.camelify(a)].find((function(e){return e.groupId===t[a]}))&&s.INVALIDPLAYLIST("".concat(a," attribute MUST match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag whose TYPE attribute is ").concat(a,"."))}))}(e,c,i),c.isIFrameOnly=r,c}function O(t,e){if(t.method!==e.method)return!1;if(t.uri!==e.uri)return!1;if(t.iv){if(!e.iv)return!1;if(t.iv.length!==e.iv.length)return!1;for(var n=0;n<t.iv.length;n++)if(t.iv[n]!==e.iv[n])return!1}else if(e.iv)return!1;return t.format===e.format&&t.formatVersion===e.formatVersion}function P(t,e,n,a,r,i,o){for(var c=new d({uri:e,mediaSequenceNumber:r,discontinuitySequence:i}),u=!1,l=!1,T=function(e){var n=t[e],a=n.name,r=n.value,i=n.attributes;if("EXTINF"===a)!Number.isInteger(r.duration)&&o.compatibleVersion<3&&(o.compatibleVersion=3),Math.round(r.duration)>o.targetDuration&&s.INVALIDPLAYLIST("EXTINF duration, when rounded to the nearest integer, MUST be less than or equal to the target duration"),c.duration=r.duration,c.title=r.title;else if("EXT-X-BYTERANGE"===a)o.compatibleVersion<4&&(o.compatibleVersion=4),c.byterange=r;else if("EXT-X-DISCONTINUITY"===a)c.parts.length>0&&s.INVALIDPLAYLIST("EXT-X-DISCONTINUITY must appear before the first EXT-X-PART tag of the Parent Segment."),c.discontinuity=!0;else if("EXT-X-KEY"===a)c.parts.length>0&&s.INVALIDPLAYLIST("EXT-X-KEY must appear before the first EXT-X-PART tag of the Parent Segment."),R(o,i),c.key=new E({method:i.METHOD,uri:i.URI,iv:i.IV,format:i.KEYFORMAT,formatVersion:i.KEYFORMATVERSIONS});else if("EXT-X-MAP"===a)c.parts.length>0&&s.INVALIDPLAYLIST("EXT-X-MAP must appear before the first EXT-X-PART tag of the Parent Segment."),o.compatibleVersion<5&&(o.compatibleVersion=5),o.hasMap=!0,c.map=new f({uri:i.URI,byterange:i.BYTERANGE});else if("EXT-X-PROGRAM-DATE-TIME"===a)c.programDateTime=r;else if("EXT-X-DATERANGE"===a){var T={};Object.keys(i).forEach((function(t){(t.startsWith("SCTE35-")||t.startsWith("X-"))&&(T[t]=i[t])})),c.dateRange=new h({id:i.ID,classId:i.CLASS,start:i["START-DATE"],end:i["END-DATE"],duration:i.DURATION,plannedDuration:i["PLANNED-DURATION"],endOnNext:i["END-ON-NEXT"],attributes:T})}else if("EXT-X-CUE-OUT"===a)c.markers.push(new I({type:"OUT",duration:r}));else if("EXT-X-CUE-IN"===a)c.markers.push(new I({type:"IN"}));else if("EXT-X-CUE-OUT-CONT"===a||"EXT-X-CUE"===a||"EXT-OATCLS-SCTE35"===a||"EXT-X-ASSET"===a||"EXT-X-SCTE35"===a)c.markers.push(new I({type:"RAW",tagName:a,value:r}));else if("EXT-X-PRELOAD-HINT"!==a||i.TYPE)if("EXT-X-PRELOAD-HINT"===a&&"PART"===i.TYPE&&l)s.INVALIDPLAYLIST("Servers should not add more than one EXT-X-PRELOAD-HINT tag with the same TYPE attribute to a Playlist.");else if("EXT-X-PART"!==a&&"EXT-X-PRELOAD-HINT"!==a||i.URI){if("EXT-X-PRELOAD-HINT"===a&&"MAP"===i.TYPE)u&&s.INVALIDPLAYLIST("Servers should not add more than one EXT-X-PRELOAD-HINT tag with the same TYPE attribute to a Playlist."),u=!0,o.hasMap=!0,c.map=new f({hint:!0,uri:i.URI,byterange:{length:i["BYTERANGE-LENGTH"],offset:i["BYTERANGE-START"]||0}});else if("EXT-X-PART"===a||"EXT-X-PRELOAD-HINT"===a&&"PART"===i.TYPE){"EXT-X-PART"!==a||i.DURATION||s.INVALIDPLAYLIST("EXT-X-PART: DURATION attribute is mandatory"),"EXT-X-PRELOAD-HINT"===a&&(l=!0);var A=new S({hint:"EXT-X-PRELOAD-HINT"===a,uri:i.URI,byterange:"EXT-X-PART"===a?i.BYTERANGE:{length:i["BYTERANGE-LENGTH"],offset:i["BYTERANGE-START"]||0},duration:i.DURATION,independent:i.INDEPENDENT,gap:i.GAP});c.parts.push(A)}}else s.INVALIDPLAYLIST("EXT-X-PART / EXT-X-PRELOAD-HINT: URI attribute is mandatory");else s.INVALIDPLAYLIST("EXT-X-PRELOAD-HINT: TYPE attribute is mandatory")},A=n;A<=a;A++)T(A);return c}function b(t,e){var n,i=new p,o=-1,c=0,u=!1,l=0,T=null,E=null,f=!1,h=a(t.entries());try{for(h.s();!(n=h.n()).done;){var I=r(n.value,2),A=I[0],d=I[1],S=d.name,y=d.value,X=d.attributes;if("Segment"!==d.category){if("EXT-X-VERSION"===S)void 0===i.version?i.version=y:s.INVALIDPLAYLIST("A Playlist file MUST NOT contain more than one EXT-X-VERSION tag.");else if("EXT-X-TARGETDURATION"===S)i.targetDuration=e.targetDuration=y;else if("EXT-X-MEDIA-SEQUENCE"===S)i.segments.length>0&&s.INVALIDPLAYLIST("The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media Segment in the Playlist."),i.mediaSequenceBase=c=y;else if("EXT-X-DISCONTINUITY-SEQUENCE"===S)i.segments.length>0&&s.INVALIDPLAYLIST("The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first Media Segment in the Playlist."),u&&s.INVALIDPLAYLIST("The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT-X-DISCONTINUITY tag."),i.discontinuitySequenceBase=l=y;else if("EXT-X-ENDLIST"===S)i.endlist=!0;else if("EXT-X-PLAYLIST-TYPE"===S)i.playlistType=y;else if("EXT-X-I-FRAMES-ONLY"===S)e.compatibleVersion<4&&(e.compatibleVersion=4),i.isIFrame=!0;else if("EXT-X-INDEPENDENT-SEGMENTS"===S)i.independentSegments&&s.INVALIDPLAYLIST("EXT-X-INDEPENDENT-SEGMENTS tag MUST NOT appear more than once in a Playlist"),i.independentSegments=!0;else if("EXT-X-START"===S)i.start&&s.INVALIDPLAYLIST("EXT-X-START tag MUST NOT appear more than once in a Playlist"),"number"!=typeof X["TIME-OFFSET"]&&s.INVALIDPLAYLIST("EXT-X-START: TIME-OFFSET attribute is REQUIRED"),i.start={offset:X["TIME-OFFSET"],precise:X.PRECISE||!1};else if("EXT-X-SERVER-CONTROL"===S)X["CAN-BLOCK-RELOAD"]||s.INVALIDPLAYLIST("EXT-X-SERVER-CONTROL: CAN-BLOCK-RELOAD=YES is mandatory for Low-Latency HLS"),i.lowLatencyCompatibility={canBlockReload:X["CAN-BLOCK-RELOAD"],canSkipUntil:X["CAN-SKIP-UNTIL"],holdBack:X["HOLD-BACK"],partHoldBack:X["PART-HOLD-BACK"]};else if("EXT-X-PART-INF"===S)X["PART-TARGET"]||s.INVALIDPLAYLIST("EXT-X-PART-INF: PART-TARGET attribute is mandatory"),i.partTargetDuration=X["PART-TARGET"];else if("EXT-X-RENDITION-REPORT"===S)X.URI||s.INVALIDPLAYLIST("EXT-X-RENDITION-REPORT: URI attribute is mandatory"),0===X.URI.search(/^[a-z]+:/)&&s.INVALIDPLAYLIST("EXT-X-RENDITION-REPORT: URI must be relative to the playlist uri"),i.renditionReports.push(new N({uri:X.URI,lastMSN:X["LAST-MSN"],lastPart:X["LAST-PART"]}));else if("EXT-X-SKIP"===S)X["SKIPPED-SEGMENTS"]||s.INVALIDPLAYLIST("EXT-X-SKIP: SKIPPED-SEGMENTS attribute is mandatory"),e.compatibleVersion<9&&(e.compatibleVersion=9),i.skip=X["SKIPPED-SEGMENTS"],c+=i.skip;else if("string"==typeof d){-1===o&&s.INVALIDPLAYLIST("A URI line is not preceded by any segment tags"),i.targetDuration||s.INVALIDPLAYLIST("The EXT-X-TARGETDURATION tag is REQUIRED");var v=P(t,d,o,A-1,c++,l,e);if(v){var R=r(C(i,v,l,T,E),3);l=R[0],T=R[1],E=R[2],!f&&v.parts.length>0&&(f=!0)}o=-1}}else-1===o&&(o=A),"EXT-X-DISCONTINUITY"===S&&(u=!0)}}catch(t){h.e(t)}finally{h.f()}if(-1!==o){var m=P(t,"",o,t.length-1,c++,l,e);if(m){var D=m.parts;D.length>0&&!i.endlist&&!D[D.length-1].hint&&s.INVALIDPLAYLIST("If the Playlist contains EXT-X-PART tags and does not contain an EXT-X-ENDLIST tag, the Playlist must contain an EXT-X-PRELOAD-HINT tag with a TYPE=PART attribute"),C(i,m,T,E),!f&&m.parts.length>0&&(f=!0)}}return function(t){for(var e=new Map,n=new Map,r=!1,i=!1,o=t.length-1;o>=0;o--){var c=t[o],u=c.programDateTime,l=c.dateRange;if(u&&(i=!0),l&&l.start){r=!0,l.endOnNext&&(l.end||l.duration)&&s.INVALIDPLAYLIST("An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT contain DURATION or END-DATE attributes.");var T=l.start.getTime(),E=l.duration||0;l.end&&l.duration&&T+1e3*E!==l.end.getTime()&&s.INVALIDPLAYLIST("END-DATE MUST be equal to the value of the START-DATE attribute plus the value of the DURATION"),l.endOnNext&&(l.end=e.get(l.classId)),e.set(l.classId,l.start);var f=l.end?l.end.getTime():l.start.getTime()+1e3*(l.duration||0),h=n.get(l.classId);if(h){var I,A=a(h);try{for(A.s();!(I=A.n()).done;){var p=I.value;(p.start<=T&&p.end>T||p.start>=T&&p.start<f)&&s.INVALIDPLAYLIST("DATERANGE tags with the same CLASS should not overlap")}}catch(t){A.e(t)}finally{A.f()}h.push({start:T,end:f})}else n.set(l.classId,[{start:T,end:f}])}}r&&!i&&s.INVALIDPLAYLIST("If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain at least one EXT-X-PROGRAM-DATE-TIME tag.")}(i.segments),i.lowLatencyCompatibility&&function(t,e){var n=t.lowLatencyCompatibility,i=t.targetDuration,o=t.partTargetDuration,c=t.segments,u=t.renditionReports,l=n.canSkipUntil,T=n.holdBack,E=n.partHoldBack;if(l<6*i&&s.INVALIDPLAYLIST("The Skip Boundary must be at least six times the EXT-X-TARGETDURATION."),T<3*i&&s.INVALIDPLAYLIST("HOLD-BACK must be at least three times the EXT-X-TARGETDURATION."),e){void 0===o&&s.INVALIDPLAYLIST("EXT-X-PART-INF is required if a Playlist contains one or more EXT-X-PART tags"),void 0===E&&s.INVALIDPLAYLIST("EXT-X-PART: PART-HOLD-BACK attribute is mandatory"),E<o&&s.INVALIDPLAYLIST("PART-HOLD-BACK must be at least PART-TARGET");var f,h=a(c.entries());try{for(h.s();!(f=h.n()).done;){var I=r(f.value,2),A=I[0],p=I[1].parts;p.length>0&&A<c.length-3&&s.INVALIDPLAYLIST("Remove EXT-X-PART tags from the Playlist after they are greater than three target durations from the end of the Playlist.");var d,S=a(p.entries());try{for(S.s();!(d=S.n()).done;){var N=r(d.value,2),y=N[0],X=N[1].duration;void 0!==X&&(X>o&&s.INVALIDPLAYLIST("PART-TARGET is the maximum duration of any Partial Segment"),y<p.length-1&&X<.85*o&&s.INVALIDPLAYLIST("All Partial Segments except the last part of a segment must have a duration of at least 85% of PART-TARGET"))}}catch(t){S.e(t)}finally{S.f()}}}catch(t){h.e(t)}finally{h.f()}}var v,R=a(u);try{for(R.s();!(v=R.n()).done;){var m=v.value,D=c[c.length-1];m.lastMSN||(m.lastMSN=D.mediaSequenceNumber),!m.lastPart&&D.parts.length>0&&(m.lastPart=D.parts.length-1)}}catch(t){R.e(t)}finally{R.f()}}(i,f),i}function C(t,e,n,a,r){var i=e.discontinuity,o=e.key,c=e.map,u=e.byterange,l=e.uri;if(i&&(e.discontinuitySequence=n+1),o||(e.key=a),c||(e.map=r),u&&-1===u.offset){var T=t.segments;if(T.length>0){var E=T[T.length-1];E.byterange&&E.uri===l?u.offset=E.byterange.offset+E.byterange.length:s.INVALIDPLAYLIST("If offset of EXT-X-BYTERANGE is not present, a previous Media Segment MUST be a sub-range of the same media resource")}else s.INVALIDPLAYLIST("If offset of EXT-X-BYTERANGE is not present, a previous Media Segment MUST appear in the Playlist file")}return t.segments.push(e),[e.discontinuitySequence,e.key,e.map]}function M(t,e){var n=r(function(t){var e=t.indexOf(":");return-1===e?[t.slice(1).trim(),null]:[t.slice(1,e).trim(),t.slice(e+1).trim()]}(t),2),a=n[0],i=n[1],o=function(t){switch(t){case"EXTM3U":case"EXT-X-VERSION":return"Basic";case"EXTINF":case"EXT-X-BYTERANGE":case"EXT-X-DISCONTINUITY":case"EXT-X-KEY":case"EXT-X-MAP":case"EXT-X-PROGRAM-DATE-TIME":case"EXT-X-DATERANGE":case"EXT-X-CUE-OUT":case"EXT-X-CUE-IN":case"EXT-X-CUE-OUT-CONT":case"EXT-X-CUE":case"EXT-OATCLS-SCTE35":case"EXT-X-ASSET":case"EXT-X-SCTE35":case"EXT-X-PART":case"EXT-X-PRELOAD-HINT":return"Segment";case"EXT-X-TARGETDURATION":case"EXT-X-MEDIA-SEQUENCE":case"EXT-X-DISCONTINUITY-SEQUENCE":case"EXT-X-ENDLIST":case"EXT-X-PLAYLIST-TYPE":case"EXT-X-I-FRAMES-ONLY":case"EXT-X-SERVER-CONTROL":case"EXT-X-PART-INF":case"EXT-X-RENDITION-REPORT":case"EXT-X-SKIP":return"MediaPlaylist";case"EXT-X-MEDIA":case"EXT-X-STREAM-INF":case"EXT-X-I-FRAME-STREAM-INF":case"EXT-X-SESSION-DATA":case"EXT-X-SESSION-KEY":return"MasterPlaylist";case"EXT-X-INDEPENDENT-SEGMENTS":case"EXT-X-START":return"MediaorMasterPlaylist";default:return"Unknown"}}(a);if(function(t,e){if("Segment"===t||"MediaPlaylist"===t)return void 0===e.isMasterPlaylist?void(e.isMasterPlaylist=!1):void(e.isMasterPlaylist&&D());if("MasterPlaylist"===t){if(void 0===e.isMasterPlaylist)return void(e.isMasterPlaylist=!0);!1===e.isMasterPlaylist&&D()}}(o,e),"Unknown"===o)return null;"MediaPlaylist"===o&&"EXT-X-RENDITION-REPORT"!==a&&(e.hash[a]&&s.INVALIDPLAYLIST("There MUST NOT be more than one Media Playlist tag of each type in any Media Playlist"),e.hash[a]=!0);var c=r(function(t,e){switch(t){case"EXTM3U":case"EXT-X-DISCONTINUITY":case"EXT-X-ENDLIST":case"EXT-X-I-FRAMES-ONLY":case"EXT-X-INDEPENDENT-SEGMENTS":case"EXT-X-CUE-IN":return[null,null];case"EXT-X-VERSION":case"EXT-X-TARGETDURATION":case"EXT-X-MEDIA-SEQUENCE":case"EXT-X-DISCONTINUITY-SEQUENCE":case"EXT-X-CUE-OUT":return[s.toNumber(e),null];case"EXT-X-KEY":case"EXT-X-MAP":case"EXT-X-DATERANGE":case"EXT-X-MEDIA":case"EXT-X-STREAM-INF":case"EXT-X-I-FRAME-STREAM-INF":case"EXT-X-SESSION-DATA":case"EXT-X-SESSION-KEY":case"EXT-X-START":case"EXT-X-SERVER-CONTROL":case"EXT-X-PART-INF":case"EXT-X-PART":case"EXT-X-PRELOAD-HINT":case"EXT-X-RENDITION-REPORT":case"EXT-X-SKIP":return[null,m(e)];case"EXTINF":return[X(e),null];case"EXT-X-BYTERANGE":return[v(e),null];case"EXT-X-PROGRAM-DATE-TIME":return[new Date(e),null];case"EXT-X-PLAYLIST-TYPE":default:return[e,null]}}(a,i),2);return{name:a,category:o,value:c[0],attributes:c[1]}}function U(t,e){var n;return e.isMasterPlaylist?n=function(t,e){var n,i=new A,o=a(t.entries());try{for(o.s();!(n=o.n()).done;){var c=r(n.value,2),u=c[0],l=c[1],f=l.name,h=l.value,I=l.attributes;if("EXT-X-VERSION"===f)i.version=h;else if("EXT-X-STREAM-INF"===f){var p=t[u+1];("string"!=typeof p||p.startsWith("#EXT"))&&s.INVALIDPLAYLIST("EXT-X-STREAM-INF must be followed by a URI line");var d=g(t,I,p,!1,e);d&&i.variants.push(d)}else if("EXT-X-I-FRAME-STREAM-INF"===f){var S=g(t,I,I.URI,!0,e);S&&i.variants.push(S)}else"EXT-X-SESSION-DATA"===f?function(){var t=new T({id:I["DATA-ID"],value:I.VALUE,uri:I.URI,language:I.LANGUAGE});i.sessionDataList.find((function(e){return e.id===t.id&&e.language===t.language}))&&s.INVALIDPLAYLIST("A Playlist MUST NOT contain more than one EXT-X-SESSION-DATA tag with the same DATA-ID attribute and the same LANGUAGE attribute."),i.sessionDataList.push(t)}():"EXT-X-SESSION-KEY"===f?function(){"NONE"===I.METHOD&&s.INVALIDPLAYLIST("EXT-X-SESSION-KEY: The value of the METHOD attribute MUST NOT be NONE");var t=new E({method:I.METHOD,uri:I.URI,iv:I.IV,format:I.KEYFORMAT,formatVersion:I.KEYFORMATVERSIONS});i.sessionKeyList.find((function(e){return O(e,t)}))&&s.INVALIDPLAYLIST("A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS attribute values."),R(e,I),i.sessionKeyList.push(t)}():"EXT-X-INDEPENDENT-SEGMENTS"===f?(i.independentSegments&&s.INVALIDPLAYLIST("EXT-X-INDEPENDENT-SEGMENTS tag MUST NOT appear more than once in a Playlist"),i.independentSegments=!0):"EXT-X-START"===f&&(i.start&&s.INVALIDPLAYLIST("EXT-X-START tag MUST NOT appear more than once in a Playlist"),"number"!=typeof I["TIME-OFFSET"]&&s.INVALIDPLAYLIST("EXT-X-START: TIME-OFFSET attribute is REQUIRED"),i.start={offset:I["TIME-OFFSET"],precise:I.PRECISE||!1})}}catch(t){o.e(t)}finally{o.f()}if(e.isClosedCaptionsNone){var N,y=a(i.variants);try{for(y.s();!(N=y.n()).done;)N.value.closedCaptions.length>0&&s.INVALIDPLAYLIST("If there is a variant with CLOSED-CAPTIONS attribute of NONE, all EXT-X-STREAM-INF tags MUST have this attribute with a value of NONE")}catch(t){y.e(t)}finally{y.f()}}return i}(t,e):!(n=b(t,e)).isIFrame&&e.hasMap&&e.compatibleVersion<6&&(e.compatibleVersion=6),e.compatibleVersion>1&&(!n.version||n.version<e.compatibleVersion)&&s.INVALIDPLAYLIST("EXT-X-VERSION needs to be ".concat(e.compatibleVersion," or higher.")),n}t.exports=function(t){var e={version:void 0,isMasterPlaylist:void 0,hasMap:!1,targetDuration:0,compatibleVersion:1,isClosedCaptionsNone:!1,hash:{}},n=U(function(t,e){var n=[];return t.split("\n").forEach((function(t){var a=t.trim();if(a)if(a.startsWith("#")){if(a.startsWith("#EXT")){var r=M(a,e);return void(r&&n.push(r))}}else n.push(a)})),0!==n.length&&"EXTM3U"===n[0].name||s.INVALIDPLAYLIST("The EXTM3U tag MUST be the first line."),n}(t,e),e);return n.source=t,n}},367:(t,e,n)=>{function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=i(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,r=function(){};return{s:r,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function u(t,e,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var a=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=I(t)););return t}(t,e);if(a){var r=Object.getOwnPropertyDescriptor(a,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function l(t,e){return!e||"object"!==s(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function T(t){var e="function"==typeof Map?new Map:void 0;return(T=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return E(t,arguments,I(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h(a,t)})(t)}function E(t,e,n){return(E=f()?Reflect.construct:function(t,e,n){var a=[null];a.push.apply(a,e);var r=new(Function.bind.apply(t,a));return n&&h(r,n.prototype),r}).apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function I(t){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var A=n(771),p=["#EXTINF","#EXT-X-BYTERANGE","#EXT-X-DISCONTINUITY","#EXT-X-STREAM-INF","#EXT-X-CUE-OUT","#EXT-X-CUE-IN","#EXT-X-KEY","#EXT-X-MAP"],d=["#EXT-X-MEDIA"],S=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(s,t);var e,n,a,r,i,o=(e=s,n=f(),function(){var t,a=I(e);if(n){var r=I(this).constructor;t=Reflect.construct(a,arguments,r)}else t=a.apply(this,arguments);return l(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this)).baseUri=t,e}return a=s,(r=[{key:"push",value:function(){for(var t=this,e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];for(var r=function(){var e=o[i];if(!e.startsWith("#"))return u(I(s.prototype),"push",t).call(t,e),"continue";if(p.some((function(t){return e.startsWith(t)})))return u(I(s.prototype),"push",t).call(t,e),"continue";if(t.includes(e)){if(d.some((function(t){return e.startsWith(t)})))return"continue";A.INVALIDPLAYLIST("Redundant item (".concat(e,")"))}u(I(s.prototype),"push",t).call(t,e)},i=0,o=n;i<o.length;i++)r()}}])&&c(a.prototype,r),i&&c(a,i),s}(T(Array));function N(t,e){var n=1e3;e&&(n=Math.pow(10,e));var a=Math.round(t*n)/n;return e?a.toFixed(e):a}function y(t){var e=t.toString(10),n=e.indexOf(".");return-1===n?0:e.length-n-1}function X(t){var e=['DATA-ID="'.concat(t.id,'"')];return t.language&&e.push('LANGUAGE="'.concat(t.language,'"')),t.value?e.push('VALUE="'.concat(t.value,'"')):t.uri&&e.push('URI="'.concat(t.uri,'"')),"#EXT-X-SESSION-DATA:".concat(e.join(","))}function v(t,e){var n=e?"#EXT-X-SESSION-KEY":"#EXT-X-KEY",a=["METHOD=".concat(t.method)];return t.uri&&a.push('URI="'.concat(t.uri,'"')),t.iv&&(16!==t.iv.length&&A.INVALIDPLAYLIST("IV must be a 128-bit unsigned integer"),a.push("IV=".concat(A.byteSequenceToHex(t.iv)))),t.format&&a.push('KEYFORMAT="'.concat(t.format,'"')),t.formatVersion&&a.push('KEYFORMATVERSIONS="'.concat(t.formatVersion,'"')),"".concat(n,":").concat(a.join(","))}function R(t,e){var n=e.isIFrameOnly?"#EXT-X-I-FRAME-STREAM-INF":"#EXT-X-STREAM-INF",a=["BANDWIDTH=".concat(e.bandwidth)];if(e.averageBandwidth&&a.push("AVERAGE-BANDWIDTH=".concat(e.averageBandwidth)),e.isIFrameOnly&&a.push('URI="'.concat(e.uri,'"')),e.codecs&&a.push('CODECS="'.concat(e.codecs,'"')),e.resolution&&a.push("RESOLUTION=".concat(e.resolution.width,"x").concat(e.resolution.height)),e.frameRate&&a.push("FRAME-RATE=".concat(N(e.frameRate,3))),e.hdcpLevel&&a.push("HDCP-LEVEL=".concat(e.hdcpLevel)),e.audio.length>0){a.push('AUDIO="'.concat(e.audio[0].groupId,'"'));var i,o=r(e.audio);try{for(o.s();!(i=o.n()).done;){var s=i.value;t.push(m(s))}}catch(t){o.e(t)}finally{o.f()}}if(e.video.length>0){a.push('VIDEO="'.concat(e.video[0].groupId,'"'));var c,u=r(e.video);try{for(u.s();!(c=u.n()).done;){var l=c.value;t.push(m(l))}}catch(t){u.e(t)}finally{u.f()}}if(e.subtitles.length>0){a.push('SUBTITLES="'.concat(e.subtitles[0].groupId,'"'));var T,E=r(e.subtitles);try{for(E.s();!(T=E.n()).done;){var f=T.value;t.push(m(f))}}catch(t){E.e(t)}finally{E.f()}}if(A.getOptions().allowClosedCaptionsNone&&0===e.closedCaptions.length)a.push("CLOSED-CAPTIONS=NONE");else if(e.closedCaptions.length>0){a.push('CLOSED-CAPTIONS="'.concat(e.closedCaptions[0].groupId,'"'));var h,I=r(e.closedCaptions);try{for(I.s();!(h=I.n()).done;){var p=h.value;t.push(m(p))}}catch(t){I.e(t)}finally{I.f()}}t.push("".concat(n,":").concat(a.join(","))),e.isIFrameOnly||t.push("".concat(e.uri))}function m(t){var e=["TYPE=".concat(t.type),'GROUP-ID="'.concat(t.groupId,'"'),'NAME="'.concat(t.name,'"')];return void 0!==t.isDefault&&e.push("DEFAULT=".concat(t.isDefault?"YES":"NO")),void 0!==t.autoselect&&e.push("AUTOSELECT=".concat(t.autoselect?"YES":"NO")),void 0!==t.forced&&e.push("FORCED=".concat(t.forced?"YES":"NO")),t.language&&e.push('LANGUAGE="'.concat(t.language,'"')),t.assocLanguage&&e.push('ASSOC-LANGUAGE="'.concat(t.assocLanguage,'"')),t.instreamId&&e.push('INSTREAM-ID="'.concat(t.instreamId,'"')),t.characteristics&&e.push('CHARACTERISTICS="'.concat(t.characteristics,'"')),t.channels&&e.push('CHANNELS="'.concat(t.channels,'"')),t.uri&&e.push('URI="'.concat(t.uri,'"')),"#EXT-X-MEDIA:".concat(e.join(","))}function D(t,e,n,a){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=!1;if(e.byterange&&t.push("#EXT-X-BYTERANGE:".concat(g(e.byterange))),e.discontinuity&&t.push("#EXT-X-DISCONTINUITY"),e.key){var o=v(e.key);o!==n&&(t.push(o),n=o)}if(e.map){var s=L(e.map);s!==a&&(t.push(s),a=s)}if(e.programDateTime&&t.push("#EXT-X-PROGRAM-DATE-TIME:".concat(A.formatDate(e.programDateTime))),e.dateRange&&t.push(O(e.dateRange)),e.markers.length>0&&P(t,e.markers),e.parts.length>0&&(i=b(t,e.parts)),i)return[n,a];var c=r<3?Math.round(e.duration):N(e.duration,y(e.duration));return t.push("#EXTINF:".concat(c,",").concat(unescape(encodeURIComponent(e.title||"")))),Array.prototype.push.call(t,"".concat(e.uri)),[n,a]}function L(t){var e=['URI="'.concat(t.uri,'"')];return t.byterange&&e.push('BYTERANGE="'.concat(g(t.byterange),'"')),"#EXT-X-MAP:".concat(e.join(","))}function g(t){var e=t.offset,n=t.length;return"".concat(n,"@").concat(e)}function O(t){var e=['ID="'.concat(t.id,'"')];return t.start&&e.push('START-DATE="'.concat(A.formatDate(t.start),'"')),t.end&&e.push('END-DATE="'.concat(t.end,'"')),t.duration&&e.push("DURATION=".concat(t.duration)),t.plannedDuration&&e.push("PLANNED-DURATION=".concat(t.plannedDuration)),t.classId&&e.push('CLASS="'.concat(t.classId,'"')),t.endOnNext&&e.push("END-ON-NEXT=YES"),Object.keys(t.attributes).forEach((function(n){n.startsWith("X-")?"number"==typeof t.attributes[n]?e.push("".concat(n,"=").concat(t.attributes[n])):e.push("".concat(n,'="').concat(t.attributes[n],'"')):n.startsWith("SCTE35-")&&e.push("".concat(n,"=").concat(A.byteSequenceToHex(t.attributes[n])))})),"#EXT-X-DATERANGE:".concat(e.join(","))}function P(t,e){var n,a=r(e);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("OUT"===i.type)t.push("#EXT-X-CUE-OUT:".concat(i.duration));else if("IN"===i.type)t.push("#EXT-X-CUE-IN");else if("RAW"===i.type){var o=i.value?":".concat(i.value):"";t.push("#".concat(i.tagName).concat(o))}}}catch(t){a.e(t)}finally{a.f()}}function b(t,e){var n,a=!1,i=r(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.hint){var s=[];if(s.push("TYPE=PART"),s.push('URI="'.concat(o.uri,'"')),o.byterange){var c=o.byterange,u=c.offset,l=c.length;s.push("BYTERANGE-START=".concat(u)),l&&s.push("BYTERANGE-LENGTH=".concat(l))}t.push("#EXT-X-PRELOAD-HINT:".concat(s.join(","))),a=!0}else{var T=[];T.push("DURATION=".concat(o.duration)),T.push('URI="'.concat(o.uri,'"')),o.byterange&&T.push("BYTERANGE=".concat(g(o.byterange))),o.independent&&T.push("INDEPENDENT=YES"),o.gap&&T.push("GAP=YES"),t.push("#EXT-X-PART:".concat(T.join(",")))}}}catch(t){i.e(t)}finally{i.f()}return a}t.exports=function(t){A.PARAMCHECK(t),A.ASSERT("Not a playlist","playlist"===t.type);var e=new S(t.uri);return e.push("#EXTM3U"),t.version&&e.push("#EXT-X-VERSION:".concat(t.version)),t.independentSegments&&e.push("#EXT-X-INDEPENDENT-SEGMENTS"),t.start&&e.push("#EXT-X-START:TIME-OFFSET=".concat(N(t.start.offset)).concat(t.start.precise?",PRECISE=YES":"")),t.isMasterPlaylist?function(t,e){var n,a=r(e.sessionDataList);try{for(a.s();!(n=a.n()).done;){var i=n.value;t.push(X(i))}}catch(t){a.e(t)}finally{a.f()}var o,s=r(e.sessionKeyList);try{for(s.s();!(o=s.n()).done;){var c=o.value;t.push(v(c,!0))}}catch(t){s.e(t)}finally{s.f()}var u,l=r(e.variants);try{for(l.s();!(u=l.n()).done;)R(t,u.value)}catch(t){l.e(t)}finally{l.f()}}(e,t):function(t,e){var n="",i="";if(e.targetDuration&&t.push("#EXT-X-TARGETDURATION:".concat(e.targetDuration)),e.lowLatencyCompatibility){var o=e.lowLatencyCompatibility,s=o.canBlockReload,c=o.canSkipUntil,u=o.holdBack,l=o.partHoldBack,T=[];T.push("CAN-BLOCK-RELOAD=".concat(s?"YES":"NO")),void 0!==c&&T.push("CAN-SKIP-UNTIL=".concat(c)),void 0!==u&&T.push("HOLD-BACK=".concat(u)),void 0!==l&&T.push("PART-HOLD-BACK=".concat(l)),t.push("#EXT-X-SERVER-CONTROL:".concat(T.join(",")))}e.partTargetDuration&&t.push("#EXT-X-PART-INF:PART-TARGET=".concat(e.partTargetDuration)),e.mediaSequenceBase&&t.push("#EXT-X-MEDIA-SEQUENCE:".concat(e.mediaSequenceBase)),e.discontinuitySequenceBase&&t.push("#EXT-X-DISCONTINUITY-SEQUENCE:".concat(e.discontinuitySequenceBase)),e.playlistType&&t.push("#EXT-X-PLAYLIST-TYPE:".concat(e.playlistType)),e.isIFrame&&t.push("#EXT-X-I-FRAMES-ONLY"),e.skip>0&&t.push("#EXT-X-SKIP:SKIPPED-SEGMENTS=".concat(e.skip));var E,f=r(e.segments);try{for(f.s();!(E=f.n()).done;){var h=a(D(t,E.value,n,i,e.version),2);n=h[0],i=h[1]}}catch(t){f.e(t)}finally{f.f()}e.endlist&&t.push("#EXT-X-ENDLIST");var I,A=r(e.renditionReports);try{for(A.s();!(I=A.n()).done;){var p=I.value,d=[];d.push('URI="'.concat(p.uri,'"')),d.push("LAST-MSN=".concat(p.lastMSN)),void 0!==p.lastPart&&d.push("LAST-PART=".concat(p.lastPart)),t.push("#EXT-X-RENDITION-REPORT:".concat(d.join(",")))}}catch(t){A.e(t)}finally{A.f()}}(e,t),e.join("\n")}},890:(t,e,n)=>{function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=c(t);if(e){var r=c(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return s(this,n)}}function s(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=n(771),T=function t(e){u(this,t),l.PARAMCHECK(e),this.type=e},E=function(t){r(n,t);var e=o(n);function n(t){var a,r=t.isMasterPlaylist,i=t.uri,o=t.version,s=t.independentSegments,c=void 0!==s&&s,T=t.start,E=t.source;return u(this,n),a=e.call(this,"playlist"),l.PARAMCHECK(r),a.isMasterPlaylist=r,a.uri=i,a.version=o,a.independentSegments=c,a.start=T,a.source=E,a}return n}(T),f=function(t){r(n,t);var e=o(n);function n(){var t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,n),a.isMasterPlaylist=!0,t=e.call(this,a);var r=a.variants,i=void 0===r?[]:r,o=a.currentVariant,s=a.sessionDataList,c=void 0===s?[]:s,l=a.sessionKeyList,T=void 0===l?[]:l;return t.variants=i,t.currentVariant=o,t.sessionDataList=c,t.sessionKeyList=T,t}return n}(E),h=function(t){r(n,t);var e=o(n);function n(){var t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,n),a.isMasterPlaylist=!1,t=e.call(this,a);var r=a.targetDuration,i=a.mediaSequenceBase,o=void 0===i?0:i,s=a.discontinuitySequenceBase,c=void 0===s?0:s,l=a.endlist,T=void 0!==l&&l,E=a.playlistType,f=a.isIFrame,h=a.segments,I=void 0===h?[]:h,A=a.lowLatencyCompatibility,p=a.partTargetDuration,d=a.renditionReports,S=void 0===d?[]:d,N=a.skip,y=void 0===N?0:N,X=a.hash;return t.targetDuration=r,t.mediaSequenceBase=o,t.discontinuitySequenceBase=c,t.endlist=T,t.playlistType=E,t.isIFrame=f,t.segments=I,t.lowLatencyCompatibility=A,t.partTargetDuration=p,t.renditionReports=S,t.skip=y,t.hash=X,t}return n}(E),I=function(t){r(n,t);var e=o(n);function n(t){var a,r=t.uri,i=t.mimeType,o=t.data,s=t.duration,c=t.title,l=t.byterange,T=t.discontinuity,E=t.mediaSequenceNumber,f=void 0===E?0:E,h=t.discontinuitySequence,I=void 0===h?0:h,A=t.key,p=t.map,d=t.programDateTime,S=t.dateRange,N=t.markers,y=void 0===N?[]:N,X=t.parts,v=void 0===X?[]:X;return u(this,n),(a=e.call(this,"segment")).uri=r,a.mimeType=i,a.data=o,a.duration=s,a.title=c,a.byterange=l,a.discontinuity=T,a.mediaSequenceNumber=f,a.discontinuitySequence=I,a.key=A,a.map=p,a.programDateTime=d,a.dateRange=S,a.markers=y,a.parts=v,a}return n}(T),A=function(t){r(n,t);var e=o(n);function n(t){var a,r=t.hint,i=void 0!==r&&r,o=t.uri,s=t.duration,c=t.independent,T=t.byterange,E=t.gap;return u(this,n),a=e.call(this,"part"),l.PARAMCHECK(o),a.hint=i,a.uri=o,a.duration=s,a.independent=c,a.duration=s,a.byterange=T,a.gap=E,a}return n}(T);t.exports={Rendition:function t(e){var n=e.type,a=e.uri,r=e.groupId,i=e.language,o=e.assocLanguage,s=e.name,c=e.isDefault,T=e.autoselect,E=e.forced,f=e.instreamId,h=e.characteristics,I=e.channels;u(this,t),l.PARAMCHECK(n,r,s),l.CONDITIONALASSERT(["SUBTITLES"===n,a],["CLOSED-CAPTIONS"===n,f],["CLOSED-CAPTIONS"===n,!a],[E,"SUBTITLES"===n]),this.type=n,this.uri=a,this.groupId=r,this.language=i,this.assocLanguage=o,this.name=s,this.isDefault=c,this.autoselect=T,this.forced=E,this.instreamId=f,this.characteristics=h,this.channels=I},Variant:function t(e){var n=e.uri,a=e.isIFrameOnly,r=void 0!==a&&a,i=e.bandwidth,o=e.averageBandwidth,s=e.codecs,c=e.resolution,T=e.frameRate,E=e.hdcpLevel,f=e.audio,h=void 0===f?[]:f,I=e.video,A=void 0===I?[]:I,p=e.subtitles,d=void 0===p?[]:p,S=e.closedCaptions,N=void 0===S?[]:S,y=e.currentRenditions,X=void 0===y?{audio:0,video:0,subtitles:0,closedCaptions:0}:y;u(this,t),l.PARAMCHECK(n,i),this.uri=n,this.isIFrameOnly=r,this.bandwidth=i,this.averageBandwidth=o,this.codecs=s,this.resolution=c,this.frameRate=T,this.hdcpLevel=E,this.audio=h,this.video=A,this.subtitles=d,this.closedCaptions=N,this.currentRenditions=X},SessionData:function t(e){var n=e.id,a=e.value,r=e.uri,i=e.language;u(this,t),l.PARAMCHECK(n,a||r),l.ASSERT("SessionData cannot have both value and uri, shoud be either.",!(a&&r)),this.id=n,this.value=a,this.uri=r,this.language=i},Key:function t(e){var n=e.method,a=e.uri,r=e.iv,i=e.format,o=e.formatVersion;u(this,t),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK(["NONE"!==n,a]),l.CONDITIONALASSERT(["NONE"===n,!(a||r||i||o)]),this.method=n,this.uri=a,this.iv=r,this.format=i,this.formatVersion=o},MediaInitializationSection:function t(e){var n=e.hint,a=void 0!==n&&n,r=e.uri,i=e.mimeType,o=e.byterange;u(this,t),l.PARAMCHECK(r),this.hint=a,this.uri=r,this.mimeType=i,this.byterange=o},DateRange:function t(e){var n=e.id,a=e.classId,r=e.start,i=e.end,o=e.duration,s=e.plannedDuration,c=e.endOnNext,T=e.attributes,E=void 0===T?{}:T;u(this,t),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK([!0===c,a]),l.CONDITIONALASSERT([i,r],[i,r<=i],[o,o>=0],[s,s>=0]),this.id=n,this.classId=a,this.start=r,this.end=i,this.duration=o,this.plannedDuration=s,this.endOnNext=c,this.attributes=E},SpliceInfo:function t(e){var n=e.type,a=e.duration,r=e.tagName,i=e.value;u(this,t),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK(["OUT"===n,a]),l.CONDITIONALPARAMCHECK(["RAW"===n,r]),this.type=n,this.duration=a,this.tagName=r,this.value=i},Playlist:E,MasterPlaylist:f,MediaPlaylist:h,Segment:I,PartialSegment:A,RenditionReport:function t(e){var n=e.uri,a=e.lastMSN,r=e.lastPart;u(this,t),l.PARAMCHECK(n),this.uri=n,this.lastMSN=a,this.lastPart=r}}},771:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}function a(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var i={};function o(t){if(!i.strictMode)return console.error(t.message);throw t}function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if("number"==typeof t)return t;var n=10===e?Number.parseFloat(t,e):Number.parseInt(t,e);return Number.isNaN(n)?0:n}t.exports={THROW:o,ASSERT:function(t){for(var a=arguments.length,r=new Array(a>1?a-1:0),i=1;i<a;i++)r[i-1]=arguments[i];var s,c=n(r.entries());try{for(c.s();!(s=c.n()).done;){var u=e(s.value,2),l=u[0],T=u[1];T||o(new Error("".concat(t," : Failed at [").concat(l,"]")))}}catch(t){c.e(t)}finally{c.f()}},CONDITIONALASSERT:function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];var i,s=n(a.entries());try{for(s.s();!(i=s.n()).done;){var c=e(i.value,2),u=c[0],l=e(c[1],2),T=l[0],E=l[1];T&&(E||o(new Error("Conditional Assert : Failed at [".concat(u,"]"))))}}catch(t){s.e(t)}finally{s.f()}},PARAMCHECK:function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];var i,s=n(a.entries());try{for(s.s();!(i=s.n()).done;){var c=e(i.value,2),u=c[0],l=c[1];void 0===l&&o(new Error("Param Check : Failed at [".concat(u,"]")))}}catch(t){s.e(t)}finally{s.f()}},CONDITIONALPARAMCHECK:function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];var i,s=n(a.entries());try{for(s.s();!(i=s.n()).done;){var c=e(i.value,2),u=c[0],l=e(c[1],2),T=l[0],E=l[1];T&&void 0===E&&o(new Error("Conditional Param Check : Failed at [".concat(u,"]")))}}catch(t){s.e(t)}finally{s.f()}},INVALIDPLAYLIST:function(t){o(new Error("Invalid Playlist : ".concat(t)))},toNumber:s,hexToByteSequence:function(t){(t.startsWith("0x")||t.startsWith("0X"))&&(t=t.slice(2));for(var e=[],n=0;n<t.length;n+=2)e.push(s(t.slice(n,n+2),16));return Buffer.from(e)},byteSequenceToHex:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length;n<=e&&o(new Error("end must be larger than start : start=".concat(e,", end=").concat(n)));for(var a=[],r=e;r<n;r++)a.push("0".concat((255&t[r]).toString(16).toUpperCase()).slice(-2));return"0x".concat(a.join(""))},tryCatch:function(t,e){try{return t()}catch(t){return e(t)}},splitAt:function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=-1,r=0,i=0;r<t.length;r++)if(t[r]===e){if(i++===n)return[t.slice(0,r),t.slice(r+1)];a=r}return-1!==a?[t.slice(0,a),t.slice(a+1)]:[t]},trim:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return t?(t=t.trim()," "===e||(t.startsWith(e)&&(t=t.slice(1)),t.endsWith(e)&&(t=t.slice(0,-1))),t):t},splitByCommaWithPreservingQuotes:function(t){for(var e=[],n=!0,a=0,r=[],i=0;i<t.length;i++){var o=t[i];n&&","===o?(e.push(t.slice(a,i).trim()),a=i+1):'"'!==o&&"'"!==o||(n?(r.push(o),n=!1):o===r[r.length-1]?(r.pop(),n=!0):r.push(o))}return e.push(t.slice(a).trim()),e},camelify:function(t){var e,a=[],r=!1,i=n(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;"-"!==o&&"_"!==o?r?(a.push(o.toUpperCase()),r=!1):a.push(o.toLowerCase()):r=!0}}catch(t){i.e(t)}finally{i.f()}return a.join("")},formatDate:function(t){var e=t.getUTCFullYear(),n=("0"+(t.getUTCMonth()+1)).slice(-2),a=("0"+t.getUTCDate()).slice(-2),r=("0"+t.getUTCHours()).slice(-2),i=("0"+t.getUTCMinutes()).slice(-2),o=("0"+t.getUTCSeconds()).slice(-2),s=("00"+t.getUTCMilliseconds()).slice(-3);return"".concat(e,"-").concat(n,"-").concat(a,"T").concat(r,":").concat(i,":").concat(o,".").concat(s,"Z")},hasOwnProp:function(t,e){return Object.hasOwnProperty.call(t,e)},setOptions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i=Object.assign(i,t)},getOptions:function(){return Object.assign({},i)}}}},e={},function n(a){if(e[a])return e[a].exports;var r=e[a]={exports:{}};return t[a](r,r.exports,n),r.exports}(851);var t,e})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.HLS=e():t.HLS=e()}(self,(function(){return t={851:(t,e,n)=>{var a=n(771),r=a.getOptions,i=a.setOptions,o=n(463),s=n(367),c=n(890);t.exports={parse:o,stringify:s,types:c,getOptions:r,setOptions:i}},463:(t,e,n)=>{function a(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=i(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,r=function(){};return{s:r,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var s=n(771),c=n(890),u=c.Rendition,l=c.Variant,T=c.SessionData,E=c.Key,f=c.MediaInitializationSection,h=c.DateRange,I=c.SpliceInfo,A=c.MasterPlaylist,p=c.MediaPlaylist,d=c.Segment,S=c.PartialSegment,N=c.RenditionReport;function y(t){return s.trim(t,'"')}function X(t){var e=s.splitAt(t,",");return{duration:s.toNumber(e[0]),title:decodeURIComponent(escape(e[1]))}}function v(t){var e=s.splitAt(t,"@");return{length:s.toNumber(e[0]),offset:e[1]?s.toNumber(e[1]):-1}}function R(t,e){e.IV&&t.compatibleVersion<2&&(t.compatibleVersion=2),(e.KEYFORMAT||e.KEYFORMATVERSIONS)&&t.compatibleVersion<5&&(t.compatibleVersion=5)}function m(t){var e=s.splitByCommaWithPreservingQuotes(t),n={};return e.forEach((function(t){var e,a,i=r(s.splitAt(t,"="),2),o=i[0],c=i[1],u=y(c);switch(o){case"URI":n[o]=u;break;case"START-DATE":case"END-DATE":n[o]=new Date(u);break;case"IV":n[o]=(e=u,16!==(a=s.hexToByteSequence(e)).length&&s.INVALIDPLAYLIST("IV must be a 128-bit unsigned integer"),a);break;case"BYTERANGE":n[o]=v(u);break;case"RESOLUTION":n[o]=function(t){var e=s.splitAt(t,"x");return{width:s.toNumber(e[0]),height:s.toNumber(e[1])}}(u);break;case"END-ON-NEXT":case"DEFAULT":case"AUTOSELECT":case"FORCED":case"PRECISE":case"CAN-BLOCK-RELOAD":case"INDEPENDENT":case"GAP":n[o]="YES"===u;break;case"DURATION":case"PLANNED-DURATION":case"BANDWIDTH":case"AVERAGE-BANDWIDTH":case"FRAME-RATE":case"TIME-OFFSET":case"CAN-SKIP-UNTIL":case"HOLD-BACK":case"PART-HOLD-BACK":case"PART-TARGET":case"BYTERANGE-START":case"BYTERANGE-LENGTH":case"LAST-MSN":case"LAST-PART":case"SKIPPED-SEGMENTS":n[o]=s.toNumber(u);break;default:o.startsWith("SCTE35-")?n[o]=s.hexToByteSequence(u):o.startsWith("X-")?n[o]=function(t){return t.startsWith('"')?y(t):t.startsWith("0x")||t.startsWith("0X")?s.hexToByteSequence(t):s.toNumber(t)}(c):n[o]=u}})),n}function D(){s.INVALIDPLAYLIST("The file contains both media and master playlist tags.")}function L(t,e,n){var r,i=(r=e.attributes,new u({type:r.TYPE,uri:r.URI,groupId:r["GROUP-ID"],language:r.LANGUAGE,assocLanguage:r["ASSOC-LANGUAGE"],name:r.NAME,isDefault:r.DEFAULT,autoselect:r.AUTOSELECT,forced:r.FORCED,instreamId:r["INSTREAM-ID"],characteristics:r.CHARACTERISTICS,channels:r.CHANNELS})),o=t[s.camelify(n)],c=function(t,e){var n,r=!1,i=a(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.name===e.name)return"All EXT-X-MEDIA tags in the same Group MUST have different NAME attributes.";o.isDefault&&(r=!0)}}catch(t){i.e(t)}finally{i.f()}return r&&e.isDefault?"EXT-X-MEDIA A Group MUST NOT have more than one member with a DEFAULT attribute of YES.":""}(o,i);c&&s.INVALIDPLAYLIST(c),o.push(i),i.isDefault&&(t.currentRenditions[s.camelify(n)]=o.length-1)}function g(t,e,n,r,i){var o,c=new l({uri:n,bandwidth:e.BANDWIDTH,averageBandwidth:e["AVERAGE-BANDWIDTH"],codecs:e.CODECS,resolution:e.RESOLUTION,frameRate:e["FRAME-RATE"],hdcpLevel:e["HDCP-LEVEL"]}),u=a(t);try{for(u.s();!(o=u.n()).done;){var T=o.value;if("EXT-X-MEDIA"===T.name){var E=T.attributes,f=E.TYPE;if(f&&E["GROUP-ID"]||s.INVALIDPLAYLIST("EXT-X-MEDIA TYPE attribute is REQUIRED."),e[f]===E["GROUP-ID"]&&(L(c,T,f),"CLOSED-CAPTIONS"===f)){var h,I=a(c.closedCaptions);try{for(I.s();!(h=I.n()).done;){var A=h.value.instreamId;if(A&&A.startsWith("SERVICE")&&i.compatibleVersion<7){i.compatibleVersion=7;break}}}catch(t){I.e(t)}finally{I.f()}}}}}catch(t){u.e(t)}finally{u.f()}return function(t,e,n){["AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(a){"CLOSED-CAPTIONS"===a&&"NONE"===t[a]?(n.isClosedCaptionsNone=!0,e.closedCaptions=[]):t[a]&&!e[s.camelify(a)].find((function(e){return e.groupId===t[a]}))&&s.INVALIDPLAYLIST("".concat(a," attribute MUST match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag whose TYPE attribute is ").concat(a,"."))}))}(e,c,i),c.isIFrameOnly=r,c}function O(t,e){if(t.method!==e.method)return!1;if(t.uri!==e.uri)return!1;if(t.iv){if(!e.iv)return!1;if(t.iv.length!==e.iv.length)return!1;for(var n=0;n<t.iv.length;n++)if(t.iv[n]!==e.iv[n])return!1}else if(e.iv)return!1;return t.format===e.format&&t.formatVersion===e.formatVersion}function P(t,e,n,a,r,i,o){for(var c=new d({uri:e,mediaSequenceNumber:r,discontinuitySequence:i}),u=!1,l=!1,T=function(e){var n=t[e],a=n.name,r=n.value,i=n.attributes;if("EXTINF"===a)!Number.isInteger(r.duration)&&o.compatibleVersion<3&&(o.compatibleVersion=3),Math.round(r.duration)>o.targetDuration&&s.INVALIDPLAYLIST("EXTINF duration, when rounded to the nearest integer, MUST be less than or equal to the target duration"),c.duration=r.duration,c.title=r.title;else if("EXT-X-BYTERANGE"===a)o.compatibleVersion<4&&(o.compatibleVersion=4),c.byterange=r;else if("EXT-X-DISCONTINUITY"===a)c.parts.length>0&&s.INVALIDPLAYLIST("EXT-X-DISCONTINUITY must appear before the first EXT-X-PART tag of the Parent Segment."),c.discontinuity=!0;else if("EXT-X-KEY"===a)c.parts.length>0&&s.INVALIDPLAYLIST("EXT-X-KEY must appear before the first EXT-X-PART tag of the Parent Segment."),R(o,i),c.key=new E({method:i.METHOD,uri:i.URI,iv:i.IV,format:i.KEYFORMAT,formatVersion:i.KEYFORMATVERSIONS});else if("EXT-X-MAP"===a)c.parts.length>0&&s.INVALIDPLAYLIST("EXT-X-MAP must appear before the first EXT-X-PART tag of the Parent Segment."),o.compatibleVersion<5&&(o.compatibleVersion=5),o.hasMap=!0,c.map=new f({uri:i.URI,byterange:i.BYTERANGE});else if("EXT-X-PROGRAM-DATE-TIME"===a)c.programDateTime=r;else if("EXT-X-DATERANGE"===a){var T={};Object.keys(i).forEach((function(t){(t.startsWith("SCTE35-")||t.startsWith("X-"))&&(T[t]=i[t])})),c.dateRange=new h({id:i.ID,classId:i.CLASS,start:i["START-DATE"],end:i["END-DATE"],duration:i.DURATION,plannedDuration:i["PLANNED-DURATION"],endOnNext:i["END-ON-NEXT"],attributes:T})}else if("EXT-X-CUE-OUT"===a)c.markers.push(new I({type:"OUT",duration:r}));else if("EXT-X-CUE-IN"===a)c.markers.push(new I({type:"IN"}));else if("EXT-X-CUE-OUT-CONT"===a||"EXT-X-CUE"===a||"EXT-OATCLS-SCTE35"===a||"EXT-X-ASSET"===a||"EXT-X-SCTE35"===a)c.markers.push(new I({type:"RAW",tagName:a,value:r}));else if("EXT-X-PRELOAD-HINT"!==a||i.TYPE)if("EXT-X-PRELOAD-HINT"===a&&"PART"===i.TYPE&&l)s.INVALIDPLAYLIST("Servers should not add more than one EXT-X-PRELOAD-HINT tag with the same TYPE attribute to a Playlist.");else if("EXT-X-PART"!==a&&"EXT-X-PRELOAD-HINT"!==a||i.URI){if("EXT-X-PRELOAD-HINT"===a&&"MAP"===i.TYPE)u&&s.INVALIDPLAYLIST("Servers should not add more than one EXT-X-PRELOAD-HINT tag with the same TYPE attribute to a Playlist."),u=!0,o.hasMap=!0,c.map=new f({hint:!0,uri:i.URI,byterange:{length:i["BYTERANGE-LENGTH"],offset:i["BYTERANGE-START"]||0}});else if("EXT-X-PART"===a||"EXT-X-PRELOAD-HINT"===a&&"PART"===i.TYPE){"EXT-X-PART"!==a||i.DURATION||s.INVALIDPLAYLIST("EXT-X-PART: DURATION attribute is mandatory"),"EXT-X-PRELOAD-HINT"===a&&(l=!0);var A=new S({hint:"EXT-X-PRELOAD-HINT"===a,uri:i.URI,byterange:"EXT-X-PART"===a?i.BYTERANGE:{length:i["BYTERANGE-LENGTH"],offset:i["BYTERANGE-START"]||0},duration:i.DURATION,independent:i.INDEPENDENT,gap:i.GAP});c.parts.push(A)}}else s.INVALIDPLAYLIST("EXT-X-PART / EXT-X-PRELOAD-HINT: URI attribute is mandatory");else s.INVALIDPLAYLIST("EXT-X-PRELOAD-HINT: TYPE attribute is mandatory")},A=n;A<=a;A++)T(A);return c}function b(t,e){var n,i=new p,o=-1,c=0,u=!1,l=0,T=null,E=null,f=!1,h=a(t.entries());try{for(h.s();!(n=h.n()).done;){var I=r(n.value,2),A=I[0],d=I[1],S=d.name,y=d.value,X=d.attributes;if("Segment"!==d.category){if("EXT-X-VERSION"===S)void 0===i.version?i.version=y:s.INVALIDPLAYLIST("A Playlist file MUST NOT contain more than one EXT-X-VERSION tag.");else if("EXT-X-TARGETDURATION"===S)i.targetDuration=e.targetDuration=y;else if("EXT-X-MEDIA-SEQUENCE"===S)i.segments.length>0&&s.INVALIDPLAYLIST("The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media Segment in the Playlist."),i.mediaSequenceBase=c=y;else if("EXT-X-DISCONTINUITY-SEQUENCE"===S)i.segments.length>0&&s.INVALIDPLAYLIST("The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first Media Segment in the Playlist."),u&&s.INVALIDPLAYLIST("The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT-X-DISCONTINUITY tag."),i.discontinuitySequenceBase=l=y;else if("EXT-X-ENDLIST"===S)i.endlist=!0;else if("EXT-X-PLAYLIST-TYPE"===S)i.playlistType=y;else if("EXT-X-I-FRAMES-ONLY"===S)e.compatibleVersion<4&&(e.compatibleVersion=4),i.isIFrame=!0;else if("EXT-X-INDEPENDENT-SEGMENTS"===S)i.independentSegments&&s.INVALIDPLAYLIST("EXT-X-INDEPENDENT-SEGMENTS tag MUST NOT appear more than once in a Playlist"),i.independentSegments=!0;else if("EXT-X-START"===S)i.start&&s.INVALIDPLAYLIST("EXT-X-START tag MUST NOT appear more than once in a Playlist"),"number"!=typeof X["TIME-OFFSET"]&&s.INVALIDPLAYLIST("EXT-X-START: TIME-OFFSET attribute is REQUIRED"),i.start={offset:X["TIME-OFFSET"],precise:X.PRECISE||!1};else if("EXT-X-SERVER-CONTROL"===S)X["CAN-BLOCK-RELOAD"]||s.INVALIDPLAYLIST("EXT-X-SERVER-CONTROL: CAN-BLOCK-RELOAD=YES is mandatory for Low-Latency HLS"),i.lowLatencyCompatibility={canBlockReload:X["CAN-BLOCK-RELOAD"],canSkipUntil:X["CAN-SKIP-UNTIL"],holdBack:X["HOLD-BACK"],partHoldBack:X["PART-HOLD-BACK"]};else if("EXT-X-PART-INF"===S)X["PART-TARGET"]||s.INVALIDPLAYLIST("EXT-X-PART-INF: PART-TARGET attribute is mandatory"),i.partTargetDuration=X["PART-TARGET"];else if("EXT-X-RENDITION-REPORT"===S)X.URI||s.INVALIDPLAYLIST("EXT-X-RENDITION-REPORT: URI attribute is mandatory"),0===X.URI.search(/^[a-z]+:/)&&s.INVALIDPLAYLIST("EXT-X-RENDITION-REPORT: URI must be relative to the playlist uri"),i.renditionReports.push(new N({uri:X.URI,lastMSN:X["LAST-MSN"],lastPart:X["LAST-PART"]}));else if("EXT-X-SKIP"===S)X["SKIPPED-SEGMENTS"]||s.INVALIDPLAYLIST("EXT-X-SKIP: SKIPPED-SEGMENTS attribute is mandatory"),e.compatibleVersion<9&&(e.compatibleVersion=9),i.skip=X["SKIPPED-SEGMENTS"],c+=i.skip;else if("string"==typeof d){-1===o&&s.INVALIDPLAYLIST("A URI line is not preceded by any segment tags"),i.targetDuration||s.INVALIDPLAYLIST("The EXT-X-TARGETDURATION tag is REQUIRED");var v=P(t,d,o,A-1,c++,l,e);if(v){var R=r(C(i,v,l,T,E),3);l=R[0],T=R[1],E=R[2],!f&&v.parts.length>0&&(f=!0)}o=-1}}else-1===o&&(o=A),"EXT-X-DISCONTINUITY"===S&&(u=!0)}}catch(t){h.e(t)}finally{h.f()}if(-1!==o){var m=P(t,"",o,t.length-1,c++,l,e);if(m){var D=m.parts;D.length>0&&!i.endlist&&!D[D.length-1].hint&&s.INVALIDPLAYLIST("If the Playlist contains EXT-X-PART tags and does not contain an EXT-X-ENDLIST tag, the Playlist must contain an EXT-X-PRELOAD-HINT tag with a TYPE=PART attribute"),C(i,m,T,E),!f&&m.parts.length>0&&(f=!0)}}return function(t){for(var e=new Map,n=new Map,r=!1,i=!1,o=t.length-1;o>=0;o--){var c=t[o],u=c.programDateTime,l=c.dateRange;if(u&&(i=!0),l&&l.start){r=!0,l.endOnNext&&(l.end||l.duration)&&s.INVALIDPLAYLIST("An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT contain DURATION or END-DATE attributes.");var T=l.start.getTime(),E=l.duration||0;l.end&&l.duration&&T+1e3*E!==l.end.getTime()&&s.INVALIDPLAYLIST("END-DATE MUST be equal to the value of the START-DATE attribute plus the value of the DURATION"),l.endOnNext&&(l.end=e.get(l.classId)),e.set(l.classId,l.start);var f=l.end?l.end.getTime():l.start.getTime()+1e3*(l.duration||0),h=n.get(l.classId);if(h){var I,A=a(h);try{for(A.s();!(I=A.n()).done;){var p=I.value;(p.start<=T&&p.end>T||p.start>=T&&p.start<f)&&s.INVALIDPLAYLIST("DATERANGE tags with the same CLASS should not overlap")}}catch(t){A.e(t)}finally{A.f()}h.push({start:T,end:f})}else n.set(l.classId,[{start:T,end:f}])}}r&&!i&&s.INVALIDPLAYLIST("If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain at least one EXT-X-PROGRAM-DATE-TIME tag.")}(i.segments),i.lowLatencyCompatibility&&function(t,e){var n=t.lowLatencyCompatibility,i=t.targetDuration,o=t.partTargetDuration,c=t.segments,u=t.renditionReports,l=n.canSkipUntil,T=n.holdBack,E=n.partHoldBack;if(l<6*i&&s.INVALIDPLAYLIST("The Skip Boundary must be at least six times the EXT-X-TARGETDURATION."),T<3*i&&s.INVALIDPLAYLIST("HOLD-BACK must be at least three times the EXT-X-TARGETDURATION."),e){void 0===o&&s.INVALIDPLAYLIST("EXT-X-PART-INF is required if a Playlist contains one or more EXT-X-PART tags"),void 0===E&&s.INVALIDPLAYLIST("EXT-X-PART: PART-HOLD-BACK attribute is mandatory"),E<o&&s.INVALIDPLAYLIST("PART-HOLD-BACK must be at least PART-TARGET");var f,h=a(c.entries());try{for(h.s();!(f=h.n()).done;){var I=r(f.value,2),A=I[0],p=I[1].parts;p.length>0&&A<c.length-3&&s.INVALIDPLAYLIST("Remove EXT-X-PART tags from the Playlist after they are greater than three target durations from the end of the Playlist.");var d,S=a(p.entries());try{for(S.s();!(d=S.n()).done;){var N=r(d.value,2),y=N[0],X=N[1].duration;void 0!==X&&(X>o&&s.INVALIDPLAYLIST("PART-TARGET is the maximum duration of any Partial Segment"),y<p.length-1&&X<.85*o&&s.INVALIDPLAYLIST("All Partial Segments except the last part of a segment must have a duration of at least 85% of PART-TARGET"))}}catch(t){S.e(t)}finally{S.f()}}}catch(t){h.e(t)}finally{h.f()}}var v,R=a(u);try{for(R.s();!(v=R.n()).done;){var m=v.value,D=c[c.length-1];m.lastMSN||(m.lastMSN=D.mediaSequenceNumber),!m.lastPart&&D.parts.length>0&&(m.lastPart=D.parts.length-1)}}catch(t){R.e(t)}finally{R.f()}}(i,f),i}function C(t,e,n,a,r){var i=e.discontinuity,o=e.key,c=e.map,u=e.byterange,l=e.uri;if(i&&(e.discontinuitySequence=n+1),o||(e.key=a),c||(e.map=r),u&&-1===u.offset){var T=t.segments;if(T.length>0){var E=T[T.length-1];E.byterange&&E.uri===l?u.offset=E.byterange.offset+E.byterange.length:s.INVALIDPLAYLIST("If offset of EXT-X-BYTERANGE is not present, a previous Media Segment MUST be a sub-range of the same media resource")}else s.INVALIDPLAYLIST("If offset of EXT-X-BYTERANGE is not present, a previous Media Segment MUST appear in the Playlist file")}return t.segments.push(e),[e.discontinuitySequence,e.key,e.map]}function M(t,e){var n=r(function(t){var e=t.indexOf(":");return-1===e?[t.slice(1).trim(),null]:[t.slice(1,e).trim(),t.slice(e+1).trim()]}(t),2),a=n[0],i=n[1],o=function(t){switch(t){case"EXTM3U":case"EXT-X-VERSION":return"Basic";case"EXTINF":case"EXT-X-BYTERANGE":case"EXT-X-DISCONTINUITY":case"EXT-X-KEY":case"EXT-X-MAP":case"EXT-X-PROGRAM-DATE-TIME":case"EXT-X-DATERANGE":case"EXT-X-CUE-OUT":case"EXT-X-CUE-IN":case"EXT-X-CUE-OUT-CONT":case"EXT-X-CUE":case"EXT-OATCLS-SCTE35":case"EXT-X-ASSET":case"EXT-X-SCTE35":case"EXT-X-PART":case"EXT-X-PRELOAD-HINT":return"Segment";case"EXT-X-TARGETDURATION":case"EXT-X-MEDIA-SEQUENCE":case"EXT-X-DISCONTINUITY-SEQUENCE":case"EXT-X-ENDLIST":case"EXT-X-PLAYLIST-TYPE":case"EXT-X-I-FRAMES-ONLY":case"EXT-X-SERVER-CONTROL":case"EXT-X-PART-INF":case"EXT-X-RENDITION-REPORT":case"EXT-X-SKIP":return"MediaPlaylist";case"EXT-X-MEDIA":case"EXT-X-STREAM-INF":case"EXT-X-I-FRAME-STREAM-INF":case"EXT-X-SESSION-DATA":case"EXT-X-SESSION-KEY":return"MasterPlaylist";case"EXT-X-INDEPENDENT-SEGMENTS":case"EXT-X-START":return"MediaorMasterPlaylist";default:return"Unknown"}}(a);if(function(t,e){if("Segment"===t||"MediaPlaylist"===t)return void 0===e.isMasterPlaylist?void(e.isMasterPlaylist=!1):void(e.isMasterPlaylist&&D());if("MasterPlaylist"===t){if(void 0===e.isMasterPlaylist)return void(e.isMasterPlaylist=!0);!1===e.isMasterPlaylist&&D()}}(o,e),"Unknown"===o)return null;"MediaPlaylist"===o&&"EXT-X-RENDITION-REPORT"!==a&&(e.hash[a]&&s.INVALIDPLAYLIST("There MUST NOT be more than one Media Playlist tag of each type in any Media Playlist"),e.hash[a]=!0);var c=r(function(t,e){switch(t){case"EXTM3U":case"EXT-X-DISCONTINUITY":case"EXT-X-ENDLIST":case"EXT-X-I-FRAMES-ONLY":case"EXT-X-INDEPENDENT-SEGMENTS":case"EXT-X-CUE-IN":return[null,null];case"EXT-X-VERSION":case"EXT-X-TARGETDURATION":case"EXT-X-MEDIA-SEQUENCE":case"EXT-X-DISCONTINUITY-SEQUENCE":case"EXT-X-CUE-OUT":return[s.toNumber(e),null];case"EXT-X-KEY":case"EXT-X-MAP":case"EXT-X-DATERANGE":case"EXT-X-MEDIA":case"EXT-X-STREAM-INF":case"EXT-X-I-FRAME-STREAM-INF":case"EXT-X-SESSION-DATA":case"EXT-X-SESSION-KEY":case"EXT-X-START":case"EXT-X-SERVER-CONTROL":case"EXT-X-PART-INF":case"EXT-X-PART":case"EXT-X-PRELOAD-HINT":case"EXT-X-RENDITION-REPORT":case"EXT-X-SKIP":return[null,m(e)];case"EXTINF":return[X(e),null];case"EXT-X-BYTERANGE":return[v(e),null];case"EXT-X-PROGRAM-DATE-TIME":return[new Date(e),null];case"EXT-X-PLAYLIST-TYPE":default:return[e,null]}}(a,i),2);return{name:a,category:o,value:c[0],attributes:c[1]}}function U(t,e){var n;return e.isMasterPlaylist?n=function(t,e){var n,i=new A,o=a(t.entries());try{for(o.s();!(n=o.n()).done;){var c=r(n.value,2),u=c[0],l=c[1],f=l.name,h=l.value,I=l.attributes;if("EXT-X-VERSION"===f)i.version=h;else if("EXT-X-STREAM-INF"===f){var p=t[u+1];("string"!=typeof p||p.startsWith("#EXT"))&&s.INVALIDPLAYLIST("EXT-X-STREAM-INF must be followed by a URI line");var d=g(t,I,p,!1,e);d&&i.variants.push(d)}else if("EXT-X-I-FRAME-STREAM-INF"===f){var S=g(t,I,I.URI,!0,e);S&&i.variants.push(S)}else"EXT-X-SESSION-DATA"===f?function(){var t=new T({id:I["DATA-ID"],value:I.VALUE,uri:I.URI,language:I.LANGUAGE});i.sessionDataList.find((function(e){return e.id===t.id&&e.language===t.language}))&&s.INVALIDPLAYLIST("A Playlist MUST NOT contain more than one EXT-X-SESSION-DATA tag with the same DATA-ID attribute and the same LANGUAGE attribute."),i.sessionDataList.push(t)}():"EXT-X-SESSION-KEY"===f?function(){"NONE"===I.METHOD&&s.INVALIDPLAYLIST("EXT-X-SESSION-KEY: The value of the METHOD attribute MUST NOT be NONE");var t=new E({method:I.METHOD,uri:I.URI,iv:I.IV,format:I.KEYFORMAT,formatVersion:I.KEYFORMATVERSIONS});i.sessionKeyList.find((function(e){return O(e,t)}))&&s.INVALIDPLAYLIST("A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS attribute values."),R(e,I),i.sessionKeyList.push(t)}():"EXT-X-INDEPENDENT-SEGMENTS"===f?(i.independentSegments&&s.INVALIDPLAYLIST("EXT-X-INDEPENDENT-SEGMENTS tag MUST NOT appear more than once in a Playlist"),i.independentSegments=!0):"EXT-X-START"===f&&(i.start&&s.INVALIDPLAYLIST("EXT-X-START tag MUST NOT appear more than once in a Playlist"),"number"!=typeof I["TIME-OFFSET"]&&s.INVALIDPLAYLIST("EXT-X-START: TIME-OFFSET attribute is REQUIRED"),i.start={offset:I["TIME-OFFSET"],precise:I.PRECISE||!1})}}catch(t){o.e(t)}finally{o.f()}if(e.isClosedCaptionsNone){var N,y=a(i.variants);try{for(y.s();!(N=y.n()).done;)N.value.closedCaptions.length>0&&s.INVALIDPLAYLIST("If there is a variant with CLOSED-CAPTIONS attribute of NONE, all EXT-X-STREAM-INF tags MUST have this attribute with a value of NONE")}catch(t){y.e(t)}finally{y.f()}}return i}(t,e):!(n=b(t,e)).isIFrame&&e.hasMap&&e.compatibleVersion<6&&(e.compatibleVersion=6),e.compatibleVersion>1&&(!n.version||n.version<e.compatibleVersion)&&s.INVALIDPLAYLIST("EXT-X-VERSION needs to be ".concat(e.compatibleVersion," or higher.")),n}t.exports=function(t){var e={version:void 0,isMasterPlaylist:void 0,hasMap:!1,targetDuration:0,compatibleVersion:1,isClosedCaptionsNone:!1,hash:{}},n=U(function(t,e){var n=[];return t.split("\n").forEach((function(t){var a=t.trim();if(a)if(a.startsWith("#")){if(a.startsWith("#EXT")){var r=M(a,e);return void(r&&n.push(r))}}else n.push(a)})),0!==n.length&&"EXTM3U"===n[0].name||s.INVALIDPLAYLIST("The EXTM3U tag MUST be the first line."),n}(t,e),e);return n.source=t,n}},367:(t,e,n)=>{function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,r=function(){};return{s:r,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw i}}}}function o(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function c(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function u(t,e,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var a=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=I(t)););return t}(t,e);if(a){var r=Object.getOwnPropertyDescriptor(a,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function l(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function T(t){var e="function"==typeof Map?new Map:void 0;return(T=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return E(t,arguments,I(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),h(a,t)})(t)}function E(t,e,n){return(E=f()?Reflect.construct:function(t,e,n){var a=[null];a.push.apply(a,e);var r=new(Function.bind.apply(t,a));return n&&h(r,n.prototype),r}).apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function I(t){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var A=n(771),p=["#EXTINF","#EXT-X-BYTERANGE","#EXT-X-DISCONTINUITY","#EXT-X-STREAM-INF","#EXT-X-CUE-OUT","#EXT-X-CUE-IN","#EXT-X-KEY","#EXT-X-MAP"],d=["#EXT-X-MEDIA"],S=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(s,t);var e,n,a,r,i,o=(e=s,n=f(),function(){var t,a=I(e);if(n){var r=I(this).constructor;t=Reflect.construct(a,arguments,r)}else t=a.apply(this,arguments);return l(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this)).baseUri=t,e}return a=s,(r=[{key:"push",value:function(){for(var t=this,e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];for(var r=function(){var e=o[i];if(!e.startsWith("#"))return u(I(s.prototype),"push",t).call(t,e),"continue";if(p.some((function(t){return e.startsWith(t)})))return u(I(s.prototype),"push",t).call(t,e),"continue";if(t.includes(e)){if(d.some((function(t){return e.startsWith(t)})))return"continue";A.INVALIDPLAYLIST("Redundant item (".concat(e,")"))}u(I(s.prototype),"push",t).call(t,e)},i=0,o=n;i<o.length;i++)r()}}])&&c(a.prototype,r),i&&c(a,i),s}(T(Array));function N(t,e){var n=1e3;e&&(n=Math.pow(10,e));var a=Math.round(t*n)/n;return e?a.toFixed(e):a}function y(t){var e=t.toString(10),n=e.indexOf(".");return-1===n?0:e.length-n-1}function X(t){var e=['DATA-ID="'.concat(t.id,'"')];return t.language&&e.push('LANGUAGE="'.concat(t.language,'"')),t.value?e.push('VALUE="'.concat(t.value,'"')):t.uri&&e.push('URI="'.concat(t.uri,'"')),"#EXT-X-SESSION-DATA:".concat(e.join(","))}function v(t,e){var n=e?"#EXT-X-SESSION-KEY":"#EXT-X-KEY",a=["METHOD=".concat(t.method)];return t.uri&&a.push('URI="'.concat(t.uri,'"')),t.iv&&(16!==t.iv.length&&A.INVALIDPLAYLIST("IV must be a 128-bit unsigned integer"),a.push("IV=".concat(A.byteSequenceToHex(t.iv)))),t.format&&a.push('KEYFORMAT="'.concat(t.format,'"')),t.formatVersion&&a.push('KEYFORMATVERSIONS="'.concat(t.formatVersion,'"')),"".concat(n,":").concat(a.join(","))}function R(t,e){var n=e.isIFrameOnly?"#EXT-X-I-FRAME-STREAM-INF":"#EXT-X-STREAM-INF",a=["BANDWIDTH=".concat(e.bandwidth)];if(e.averageBandwidth&&a.push("AVERAGE-BANDWIDTH=".concat(e.averageBandwidth)),e.isIFrameOnly&&a.push('URI="'.concat(e.uri,'"')),e.codecs&&a.push('CODECS="'.concat(e.codecs,'"')),e.resolution&&a.push("RESOLUTION=".concat(e.resolution.width,"x").concat(e.resolution.height)),e.frameRate&&a.push("FRAME-RATE=".concat(N(e.frameRate,3))),e.hdcpLevel&&a.push("HDCP-LEVEL=".concat(e.hdcpLevel)),e.audio.length>0){a.push('AUDIO="'.concat(e.audio[0].groupId,'"'));var r,o=i(e.audio);try{for(o.s();!(r=o.n()).done;){var s=r.value;t.push(m(s))}}catch(t){o.e(t)}finally{o.f()}}if(e.video.length>0){a.push('VIDEO="'.concat(e.video[0].groupId,'"'));var c,u=i(e.video);try{for(u.s();!(c=u.n()).done;){var l=c.value;t.push(m(l))}}catch(t){u.e(t)}finally{u.f()}}if(e.subtitles.length>0){a.push('SUBTITLES="'.concat(e.subtitles[0].groupId,'"'));var T,E=i(e.subtitles);try{for(E.s();!(T=E.n()).done;){var f=T.value;t.push(m(f))}}catch(t){E.e(t)}finally{E.f()}}if(A.getOptions().allowClosedCaptionsNone&&0===e.closedCaptions.length)a.push("CLOSED-CAPTIONS=NONE");else if(e.closedCaptions.length>0){a.push('CLOSED-CAPTIONS="'.concat(e.closedCaptions[0].groupId,'"'));var h,I=i(e.closedCaptions);try{for(I.s();!(h=I.n()).done;){var p=h.value;t.push(m(p))}}catch(t){I.e(t)}finally{I.f()}}t.push("".concat(n,":").concat(a.join(","))),e.isIFrameOnly||t.push("".concat(e.uri))}function m(t){var e=["TYPE=".concat(t.type),'GROUP-ID="'.concat(t.groupId,'"'),'NAME="'.concat(t.name,'"')];return void 0!==t.isDefault&&e.push("DEFAULT=".concat(t.isDefault?"YES":"NO")),void 0!==t.autoselect&&e.push("AUTOSELECT=".concat(t.autoselect?"YES":"NO")),void 0!==t.forced&&e.push("FORCED=".concat(t.forced?"YES":"NO")),t.language&&e.push('LANGUAGE="'.concat(t.language,'"')),t.assocLanguage&&e.push('ASSOC-LANGUAGE="'.concat(t.assocLanguage,'"')),t.instreamId&&e.push('INSTREAM-ID="'.concat(t.instreamId,'"')),t.characteristics&&e.push('CHARACTERISTICS="'.concat(t.characteristics,'"')),t.channels&&e.push('CHANNELS="'.concat(t.channels,'"')),t.uri&&e.push('URI="'.concat(t.uri,'"')),"#EXT-X-MEDIA:".concat(e.join(","))}function D(t,e,n,a){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=!1;if(e.byterange&&t.push("#EXT-X-BYTERANGE:".concat(g(e.byterange))),e.discontinuity&&t.push("#EXT-X-DISCONTINUITY"),e.key){var o=v(e.key);o!==n&&(t.push(o),n=o)}if(e.map){var s=L(e.map);s!==a&&(t.push(s),a=s)}if(e.programDateTime&&t.push("#EXT-X-PROGRAM-DATE-TIME:".concat(A.formatDate(e.programDateTime))),e.dateRange&&t.push(O(e.dateRange)),e.markers.length>0&&P(t,e.markers),e.parts.length>0&&(i=b(t,e.parts)),i)return[n,a];var c=r<3?Math.round(e.duration):N(e.duration,y(e.duration));return t.push("#EXTINF:".concat(c,",").concat(unescape(encodeURIComponent(e.title||"")))),Array.prototype.push.call(t,"".concat(e.uri)),[n,a]}function L(t){var e=['URI="'.concat(t.uri,'"')];return t.byterange&&e.push('BYTERANGE="'.concat(g(t.byterange),'"')),"#EXT-X-MAP:".concat(e.join(","))}function g(t){var e=t.offset,n=t.length;return"".concat(n,"@").concat(e)}function O(t){var e=['ID="'.concat(t.id,'"')];return t.start&&e.push('START-DATE="'.concat(A.formatDate(t.start),'"')),t.end&&e.push('END-DATE="'.concat(t.end,'"')),t.duration&&e.push("DURATION=".concat(t.duration)),t.plannedDuration&&e.push("PLANNED-DURATION=".concat(t.plannedDuration)),t.classId&&e.push('CLASS="'.concat(t.classId,'"')),t.endOnNext&&e.push("END-ON-NEXT=YES"),Object.keys(t.attributes).forEach((function(n){n.startsWith("X-")?"number"==typeof t.attributes[n]?e.push("".concat(n,"=").concat(t.attributes[n])):e.push("".concat(n,'="').concat(t.attributes[n],'"')):n.startsWith("SCTE35-")&&e.push("".concat(n,"=").concat(A.byteSequenceToHex(t.attributes[n])))})),"#EXT-X-DATERANGE:".concat(e.join(","))}function P(t,e){var n,a=i(e);try{for(a.s();!(n=a.n()).done;){var r=n.value;if("OUT"===r.type)t.push("#EXT-X-CUE-OUT:".concat(r.duration));else if("IN"===r.type)t.push("#EXT-X-CUE-IN");else if("RAW"===r.type){var o=r.value?":".concat(r.value):"";t.push("#".concat(r.tagName).concat(o))}}}catch(t){a.e(t)}finally{a.f()}}function b(t,e){var n,a=!1,r=i(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.hint){var s=[];if(s.push("TYPE=PART"),s.push('URI="'.concat(o.uri,'"')),o.byterange){var c=o.byterange,u=c.offset,l=c.length;s.push("BYTERANGE-START=".concat(u)),l&&s.push("BYTERANGE-LENGTH=".concat(l))}t.push("#EXT-X-PRELOAD-HINT:".concat(s.join(","))),a=!0}else{var T=[];T.push("DURATION=".concat(o.duration)),T.push('URI="'.concat(o.uri,'"')),o.byterange&&T.push("BYTERANGE=".concat(g(o.byterange))),o.independent&&T.push("INDEPENDENT=YES"),o.gap&&T.push("GAP=YES"),t.push("#EXT-X-PART:".concat(T.join(",")))}}}catch(t){r.e(t)}finally{r.f()}return a}t.exports=function(t){A.PARAMCHECK(t),A.ASSERT("Not a playlist","playlist"===t.type);var e=new S(t.uri);return e.push("#EXTM3U"),t.version&&e.push("#EXT-X-VERSION:".concat(t.version)),t.independentSegments&&e.push("#EXT-X-INDEPENDENT-SEGMENTS"),t.start&&e.push("#EXT-X-START:TIME-OFFSET=".concat(N(t.start.offset)).concat(t.start.precise?",PRECISE=YES":"")),t.isMasterPlaylist?function(t,e){var n,a=i(e.sessionDataList);try{for(a.s();!(n=a.n()).done;){var r=n.value;t.push(X(r))}}catch(t){a.e(t)}finally{a.f()}var o,s=i(e.sessionKeyList);try{for(s.s();!(o=s.n()).done;){var c=o.value;t.push(v(c,!0))}}catch(t){s.e(t)}finally{s.f()}var u,l=i(e.variants);try{for(l.s();!(u=l.n()).done;)R(t,u.value)}catch(t){l.e(t)}finally{l.f()}}(e,t):function(t,e){var n="",a="";if(e.targetDuration&&t.push("#EXT-X-TARGETDURATION:".concat(e.targetDuration)),e.lowLatencyCompatibility){var o=e.lowLatencyCompatibility,s=o.canBlockReload,c=o.canSkipUntil,u=o.holdBack,l=o.partHoldBack,T=[];T.push("CAN-BLOCK-RELOAD=".concat(s?"YES":"NO")),void 0!==c&&T.push("CAN-SKIP-UNTIL=".concat(c)),void 0!==u&&T.push("HOLD-BACK=".concat(u)),void 0!==l&&T.push("PART-HOLD-BACK=".concat(l)),t.push("#EXT-X-SERVER-CONTROL:".concat(T.join(",")))}e.partTargetDuration&&t.push("#EXT-X-PART-INF:PART-TARGET=".concat(e.partTargetDuration)),e.mediaSequenceBase&&t.push("#EXT-X-MEDIA-SEQUENCE:".concat(e.mediaSequenceBase)),e.discontinuitySequenceBase&&t.push("#EXT-X-DISCONTINUITY-SEQUENCE:".concat(e.discontinuitySequenceBase)),e.playlistType&&t.push("#EXT-X-PLAYLIST-TYPE:".concat(e.playlistType)),e.isIFrame&&t.push("#EXT-X-I-FRAMES-ONLY"),e.skip>0&&t.push("#EXT-X-SKIP:SKIPPED-SEGMENTS=".concat(e.skip));var E,f=i(e.segments);try{for(f.s();!(E=f.n()).done;){var h=r(D(t,E.value,n,a,e.version),2);n=h[0],a=h[1]}}catch(t){f.e(t)}finally{f.f()}e.endlist&&t.push("#EXT-X-ENDLIST");var I,A=i(e.renditionReports);try{for(A.s();!(I=A.n()).done;){var p=I.value,d=[];d.push('URI="'.concat(p.uri,'"')),d.push("LAST-MSN=".concat(p.lastMSN)),void 0!==p.lastPart&&d.push("LAST-PART=".concat(p.lastPart)),t.push("#EXT-X-RENDITION-REPORT:".concat(d.join(",")))}}catch(t){A.e(t)}finally{A.f()}}(e,t),e.join("\n")}},890:(t,e,n)=>{function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=c(t);if(e){var r=c(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return s(this,n)}}function s(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=n(771),T=function t(e){u(this,t),l.PARAMCHECK(e),this.type=e},E=function(t){r(n,t);var e=o(n);function n(t){var a,r=t.isMasterPlaylist,i=t.uri,o=t.version,s=t.independentSegments,c=void 0!==s&&s,T=t.start,E=t.source;return u(this,n),a=e.call(this,"playlist"),l.PARAMCHECK(r),a.isMasterPlaylist=r,a.uri=i,a.version=o,a.independentSegments=c,a.start=T,a.source=E,a}return n}(T),f=function(t){r(n,t);var e=o(n);function n(){var t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,n),a.isMasterPlaylist=!0,t=e.call(this,a);var r=a.variants,i=void 0===r?[]:r,o=a.currentVariant,s=a.sessionDataList,c=void 0===s?[]:s,l=a.sessionKeyList,T=void 0===l?[]:l;return t.variants=i,t.currentVariant=o,t.sessionDataList=c,t.sessionKeyList=T,t}return n}(E),h=function(t){r(n,t);var e=o(n);function n(){var t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,n),a.isMasterPlaylist=!1,t=e.call(this,a);var r=a.targetDuration,i=a.mediaSequenceBase,o=void 0===i?0:i,s=a.discontinuitySequenceBase,c=void 0===s?0:s,l=a.endlist,T=void 0!==l&&l,E=a.playlistType,f=a.isIFrame,h=a.segments,I=void 0===h?[]:h,A=a.lowLatencyCompatibility,p=a.partTargetDuration,d=a.renditionReports,S=void 0===d?[]:d,N=a.skip,y=void 0===N?0:N,X=a.hash;return t.targetDuration=r,t.mediaSequenceBase=o,t.discontinuitySequenceBase=c,t.endlist=T,t.playlistType=E,t.isIFrame=f,t.segments=I,t.lowLatencyCompatibility=A,t.partTargetDuration=p,t.renditionReports=S,t.skip=y,t.hash=X,t}return n}(E),I=function(t){r(n,t);var e=o(n);function n(t){var a,r=t.uri,i=t.mimeType,o=t.data,s=t.duration,c=t.title,l=t.byterange,T=t.discontinuity,E=t.mediaSequenceNumber,f=void 0===E?0:E,h=t.discontinuitySequence,I=void 0===h?0:h,A=t.key,p=t.map,d=t.programDateTime,S=t.dateRange,N=t.markers,y=void 0===N?[]:N,X=t.parts,v=void 0===X?[]:X;return u(this,n),(a=e.call(this,"segment")).uri=r,a.mimeType=i,a.data=o,a.duration=s,a.title=c,a.byterange=l,a.discontinuity=T,a.mediaSequenceNumber=f,a.discontinuitySequence=I,a.key=A,a.map=p,a.programDateTime=d,a.dateRange=S,a.markers=y,a.parts=v,a}return n}(T),A=function(t){r(n,t);var e=o(n);function n(t){var a,r=t.hint,i=void 0!==r&&r,o=t.uri,s=t.duration,c=t.independent,T=t.byterange,E=t.gap;return u(this,n),a=e.call(this,"part"),l.PARAMCHECK(o),a.hint=i,a.uri=o,a.duration=s,a.independent=c,a.duration=s,a.byterange=T,a.gap=E,a}return n}(T);t.exports={Rendition:function t(e){var n=e.type,a=e.uri,r=e.groupId,i=e.language,o=e.assocLanguage,s=e.name,c=e.isDefault,T=e.autoselect,E=e.forced,f=e.instreamId,h=e.characteristics,I=e.channels;u(this,t),l.PARAMCHECK(n,r,s),l.CONDITIONALASSERT(["SUBTITLES"===n,a],["CLOSED-CAPTIONS"===n,f],["CLOSED-CAPTIONS"===n,!a],[E,"SUBTITLES"===n]),this.type=n,this.uri=a,this.groupId=r,this.language=i,this.assocLanguage=o,this.name=s,this.isDefault=c,this.autoselect=T,this.forced=E,this.instreamId=f,this.characteristics=h,this.channels=I},Variant:function t(e){var n=e.uri,a=e.isIFrameOnly,r=void 0!==a&&a,i=e.bandwidth,o=e.averageBandwidth,s=e.codecs,c=e.resolution,T=e.frameRate,E=e.hdcpLevel,f=e.audio,h=void 0===f?[]:f,I=e.video,A=void 0===I?[]:I,p=e.subtitles,d=void 0===p?[]:p,S=e.closedCaptions,N=void 0===S?[]:S,y=e.currentRenditions,X=void 0===y?{audio:0,video:0,subtitles:0,closedCaptions:0}:y;u(this,t),l.PARAMCHECK(n,i),this.uri=n,this.isIFrameOnly=r,this.bandwidth=i,this.averageBandwidth=o,this.codecs=s,this.resolution=c,this.frameRate=T,this.hdcpLevel=E,this.audio=h,this.video=A,this.subtitles=d,this.closedCaptions=N,this.currentRenditions=X},SessionData:function t(e){var n=e.id,a=e.value,r=e.uri,i=e.language;u(this,t),l.PARAMCHECK(n,a||r),l.ASSERT("SessionData cannot have both value and uri, shoud be either.",!(a&&r)),this.id=n,this.value=a,this.uri=r,this.language=i},Key:function t(e){var n=e.method,a=e.uri,r=e.iv,i=e.format,o=e.formatVersion;u(this,t),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK(["NONE"!==n,a]),l.CONDITIONALASSERT(["NONE"===n,!(a||r||i||o)]),this.method=n,this.uri=a,this.iv=r,this.format=i,this.formatVersion=o},MediaInitializationSection:function t(e){var n=e.hint,a=void 0!==n&&n,r=e.uri,i=e.mimeType,o=e.byterange;u(this,t),l.PARAMCHECK(r),this.hint=a,this.uri=r,this.mimeType=i,this.byterange=o},DateRange:function t(e){var n=e.id,a=e.classId,r=e.start,i=e.end,o=e.duration,s=e.plannedDuration,c=e.endOnNext,T=e.attributes,E=void 0===T?{}:T;u(this,t),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK([!0===c,a]),l.CONDITIONALASSERT([i,r],[i,r<=i],[o,o>=0],[s,s>=0]),this.id=n,this.classId=a,this.start=r,this.end=i,this.duration=o,this.plannedDuration=s,this.endOnNext=c,this.attributes=E},SpliceInfo:function t(e){var n=e.type,a=e.duration,r=e.tagName,i=e.value;u(this,t),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK(["OUT"===n,a]),l.CONDITIONALPARAMCHECK(["RAW"===n,r]),this.type=n,this.duration=a,this.tagName=r,this.value=i},Playlist:E,MasterPlaylist:f,MediaPlaylist:h,Segment:I,PartialSegment:A,RenditionReport:function t(e){var n=e.uri,a=e.lastMSN,r=e.lastPart;u(this,t),l.PARAMCHECK(n),this.uri=n,this.lastMSN=a,this.lastPart=r}}},771:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}function a(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var i={};function o(t){if(i.strictMode)throw t;i.silent||console.error(t.message)}function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if("number"==typeof t)return t;var n=10===e?Number.parseFloat(t,e):Number.parseInt(t,e);return Number.isNaN(n)?0:n}t.exports={THROW:o,ASSERT:function(t){for(var a=arguments.length,r=new Array(a>1?a-1:0),i=1;i<a;i++)r[i-1]=arguments[i];var s,c=n(r.entries());try{for(c.s();!(s=c.n()).done;){var u=e(s.value,2),l=u[0],T=u[1];T||o(new Error("".concat(t," : Failed at [").concat(l,"]")))}}catch(t){c.e(t)}finally{c.f()}},CONDITIONALASSERT:function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];var i,s=n(a.entries());try{for(s.s();!(i=s.n()).done;){var c=e(i.value,2),u=c[0],l=e(c[1],2),T=l[0],E=l[1];T&&(E||o(new Error("Conditional Assert : Failed at [".concat(u,"]"))))}}catch(t){s.e(t)}finally{s.f()}},PARAMCHECK:function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];var i,s=n(a.entries());try{for(s.s();!(i=s.n()).done;){var c=e(i.value,2),u=c[0],l=c[1];void 0===l&&o(new Error("Param Check : Failed at [".concat(u,"]")))}}catch(t){s.e(t)}finally{s.f()}},CONDITIONALPARAMCHECK:function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];var i,s=n(a.entries());try{for(s.s();!(i=s.n()).done;){var c=e(i.value,2),u=c[0],l=e(c[1],2),T=l[0],E=l[1];T&&void 0===E&&o(new Error("Conditional Param Check : Failed at [".concat(u,"]")))}}catch(t){s.e(t)}finally{s.f()}},INVALIDPLAYLIST:function(t){o(new Error("Invalid Playlist : ".concat(t)))},toNumber:s,hexToByteSequence:function(t){(t.startsWith("0x")||t.startsWith("0X"))&&(t=t.slice(2));for(var e=[],n=0;n<t.length;n+=2)e.push(s(t.slice(n,n+2),16));return Buffer.from(e)},byteSequenceToHex:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length;n<=e&&o(new Error("end must be larger than start : start=".concat(e,", end=").concat(n)));for(var a=[],r=e;r<n;r++)a.push("0".concat((255&t[r]).toString(16).toUpperCase()).slice(-2));return"0x".concat(a.join(""))},tryCatch:function(t,e){try{return t()}catch(t){return e(t)}},splitAt:function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=-1,r=0,i=0;r<t.length;r++)if(t[r]===e){if(i++===n)return[t.slice(0,r),t.slice(r+1)];a=r}return-1!==a?[t.slice(0,a),t.slice(a+1)]:[t]},trim:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return t?(t=t.trim()," "===e||(t.startsWith(e)&&(t=t.slice(1)),t.endsWith(e)&&(t=t.slice(0,-1))),t):t},splitByCommaWithPreservingQuotes:function(t){for(var e=[],n=!0,a=0,r=[],i=0;i<t.length;i++){var o=t[i];n&&","===o?(e.push(t.slice(a,i).trim()),a=i+1):'"'!==o&&"'"!==o||(n?(r.push(o),n=!1):o===r[r.length-1]?(r.pop(),n=!0):r.push(o))}return e.push(t.slice(a).trim()),e},camelify:function(t){var e,a=[],r=!1,i=n(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;"-"!==o&&"_"!==o?r?(a.push(o.toUpperCase()),r=!1):a.push(o.toLowerCase()):r=!0}}catch(t){i.e(t)}finally{i.f()}return a.join("")},formatDate:function(t){var e=t.getUTCFullYear(),n=("0"+(t.getUTCMonth()+1)).slice(-2),a=("0"+t.getUTCDate()).slice(-2),r=("0"+t.getUTCHours()).slice(-2),i=("0"+t.getUTCMinutes()).slice(-2),o=("0"+t.getUTCSeconds()).slice(-2),s=("00"+t.getUTCMilliseconds()).slice(-3);return"".concat(e,"-").concat(n,"-").concat(a,"T").concat(r,":").concat(i,":").concat(o,".").concat(s,"Z")},hasOwnProp:function(t,e){return Object.hasOwnProperty.call(t,e)},setOptions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i=Object.assign(i,t)},getOptions:function(){return Object.assign({},i)}}}},e={},function n(a){if(e[a])return e[a].exports;var r=e[a]={exports:{}};return t[a](r,r.exports,n),r.exports}(851);var t,e})); | ||
//# sourceMappingURL=hls-parser.min.js.map |
{ | ||
"name": "hls-parser", | ||
"version": "0.6.4", | ||
"version": "0.7.0", | ||
"description": "A simple library to read/write HLS playlists", | ||
@@ -33,12 +33,13 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.12.3", | ||
"@babel/preset-env": "^7.12.1", | ||
"ava": "^3.13.0", | ||
"babel-loader": "^8.1.0", | ||
"@babel/core": "^7.12.10", | ||
"@babel/preset-env": "^7.12.11", | ||
"ava": "^3.14.0", | ||
"babel-loader": "^8.2.2", | ||
"coveralls": "^3.1.0", | ||
"nyc": "^15.1.0", | ||
"terser-webpack-plugin": "^5.0.0", | ||
"webpack": "^5.1.3", | ||
"webpack-cli": "^4.1.0", | ||
"xo": "^0.34.1" | ||
"rewire": "^5.0.0", | ||
"terser-webpack-plugin": "^5.0.3", | ||
"webpack": "^5.11.1", | ||
"webpack-cli": "^4.3.0", | ||
"xo": "^0.36.1" | ||
}, | ||
@@ -45,0 +46,0 @@ "xo": { |
@@ -91,2 +91,3 @@ [![Build Status](https://travis-ci.org/kuu/hls-parser.svg?branch=master)](https://travis-ci.org/kuu/hls-parser) | ||
| `allowClosedCaptionsNone` | boolean | false | If true, `CLOSED-CAPTIONS` attribute on the `EXT-X-STREAM-INF` tag will be set to the enumerated-string value NONE when there are no closed-captions. See [CLOSED-CAPTIONS](https://tools.ietf.org/html/rfc8216#section-4.3.4.2) | | ||
| `silent` | boolean | false | If true, `console.error` will be suppressed.| | ||
@@ -93,0 +94,0 @@ ### `HLS.getOptions()` |
@@ -5,3 +5,6 @@ let options = {}; | ||
if (!options.strictMode) { | ||
return console.error(err.message); | ||
if (!options.silent) { | ||
console.error(err.message); | ||
} | ||
return; | ||
} | ||
@@ -8,0 +11,0 @@ throw err; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
259
516287
11
4323