(function(){var g={}; var _ = _ || {}
var f=function(window){var nP="\x3cms:pro/\x3e lacks content",oP="BaseURL",pP="Channel parsing failure! Ignoring scheme and value",qP="ContentProtection",rP="EssentialProperty",sP="Failed to parse UTCTiming tags.",tP="Location",uP="Missing \x3cms:pro/\x3e node in ContentProtection element",vP="No UTCTiming elements found.",wP="SegmentBase does not contain sufficient segment information:",xP="SegmentList does not contain sufficient segment information:",yP="SegmentTemplate does not contain sufficient segment information:",
zP="SegmentTimeline",AP='The last "S" element cannot have a negative repeat',BP="duration",CP="http://dashif.org/guidelines/trickmode",DP="http://www.w3.org/1999/xlink",EP='ignoring the last "S" element.',FP='ignoring the remaining "S" elements.',GP="parse.xml",HP="presentationTimeOffset",IP="schemeIdUri",JP="static",KP="timescale",LP="urn:microsoft:playready",MP="urn:mpeg:cenc:2013",NP="urn:mpeg:dash:utc:http-head:2014",OP="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",PP="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",
QP=function(a,b,c){try{var d=a(b);if(d&&d.S&&d.abort)return c.resolve(d.S),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){})["catch"](function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}},RP=function(a,b,c){function d(){e.reject(new _.N(_.O,7,7001));return a.abort()}var e=new _.kk;a.S.then(function(f){a.a?e.reject(new _.N(_.O,7,7001)):b?d=QP(b,f,e):e.resolve(f)},function(f){c?d=QP(c,f,e):e.reject(f)});return new _.lk(e,
function(){return d()})},SP=function(a,b){a.H=Math.max(a.H,b);a.g.debug("notifyAvailabilityTimeOffset: maxAvailabilityTimeOffset\x3d"+a.H)},TP=function(a,b){return a.reduce(function(c,d,e){return d["catch"](c.bind(null,e))}.bind(null,b),Promise.reject())},UP=function(a){return new _.lk(Promise.reject(a),function(){return Promise.resolve()})},VP=function(a){return new _.lk(Promise.all(a.map(function(b){return b.S})),function(){return Promise.all(a.map(function(b){return b.abort()}))})},WP=function(a){var b=
void 0===b?1024:b;if(!(a instanceof Uint8Array))return"";if(typeof b!==_.k||0>=b)b=1024;return(a.byteLength>b?a.subarray(0,b):a).toString()},XP=function(a){return 1>=a?0:Math.floor(Math.random()*a)},YP=function(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:Math.floor(a/1E3)},ZP=function(a){if(!a)return null;var b=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!b)return _.Jh("Invalid duration string:",
a),null;a=31536E3*Number(b[1]||null)+2592E3*Number(b[2]||null)+86400*Number(b[3]||null)+3600*Number(b[4]||null)+60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null},$P=function(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null},aQ=function(a){a=Number(a);return 0===a%1?a:null},bQ=function(a){a=Number(a);return 0===a%1&&0<a?a:null},cQ=function(a){a=Number(a);return 0===a%1&&0<=a?a:
null},dQ=function(a){var b;a=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(a)?null:a},eQ=function(a){return a?"true"===a.toLowerCase():!1},fQ=function(a,b,c,d,e){var f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(g,h,l,m){if("$$"===g)return"$";var n=f[h];if(null==n)return _.Jh("URL template does not have an available substitution ","for identifier",'"'+h+'":',a),
g;"RepresentationID"===h&&l&&(_.Jh("URL template should not contain a width specifier for identifier",'"RepresentationID":',a),l=void 0);"Time"===h&&(n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":g=n.toString();break;case "o":g=n.toString(8);break;case "x":g=n.toString(16);break;case "X":g=n.toString(16).toUpperCase();break;default:g=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-g.length)+1).join("0")+g})},iQ=function(a,b){var c=gQ(a,b,KP),d=1;c&&(d=bQ(c)||
1);c=gQ(a,b,BP);(c=bQ(c||""))&&(c/=d);var e=Number(gQ(a,b,HP))||0,f=e/d||0;a.xm&&null!=a.te&&a.te!==f&&(_.Jh("The stream is non-compliant with the DASH spec. The value of `presentationTimeOffset` has changed during the transition from dynamic to static manifest, which is not allowed. The last value will be ignored. (Period ID: "+(a.Na.id+", Representation ID: ")+(a.O.id+")")),e=a.te*d,f=a.te);var g=gQ(a,b,"startNumber"),h=cQ(g||"");if(null==g||null==h)h=1;g=gQ(a,b,"endNumber");g=null!==g?cQ(g||""):
null;var l=hQ(a,b,zP),m=null;if(l){m=d;var n=e,p=a.Ga.duration||Infinity,q=_.To;l=q.$(l,"S");for(var t=[],v=0,z=0;z<l.length;++z){var A=l[z],D=q.W(A,"t",cQ),G=q.W(A,"d",cQ),B=q.W(A,"r",aQ);null!=D&&(D-=n);if(!G){_.Jh('"S" element must have a duration:',FP,A);break}D=null!=D?D:v;B=B||0;if(0>B)if(z+1<l.length){B=q.W(l[z+1],"t",cQ);if(null==B){_.Jh('An "S" element cannot have a negative repeat','if the next "S" element does not have a valid start time:',FP,A);break}else if(D>=B){_.Jh('An "S" element cannot have a negative repeat if its start ',
'time exceeds the next "S" element\'s start time:',FP,A);break}B=Math.ceil((B-D)/G)-1}else{if(Infinity===p){_.Jh(AP,"if the Period has an infinite duration:",EP,A);break}else if(D/m>=p){_.Jh(AP,"if its start time exceeds the Period's duration:",EP,A);break}B=Math.ceil((p*m-D)/G)-1}0<t.length&&D!==v&&(Math.abs((D-v)/m)>=_.nw&&_.Jh("SegmentTimeline contains a large gap/overlap:","the content may have errors in it.",A),t[t.length-1].end=D/m);for(A=0;A<=B;++A)v=D+G,t.push({start:D/m,end:v/m,Ho:D}),D=
v}m=t}n=gQ(a,b,"availabilityTimeOffset");p=Number(n||"");p=isNaN(p)?null:p;if(null==n||null==p)p=0;return{timescale:d,Oa:c,Sc:h,fg:g,Vb:f,Wg:e,timeline:m,Tf:p}},gQ=function(a,b,c){return[b(a.O),b(a.ya),b(a.Na)].filter(_.aj).map(function(d){return d.getAttribute(c)}).reduce(function(d,e){return d||e})},hQ=function(a,b,c){return[b(a.O),b(a.ya),b(a.Na)].filter(_.aj).map(function(d){return _.To.Ka(d,c)}).reduce(function(d,e){return d||e})},kQ=function(a,b,c,d,e,f){var g=_.To,h=g.getAttributeNS(a,DP,"href"),
l=g.getAttributeNS(a,DP,"actuate")||"onRequest";g.Af(a,DP);if(5<=f)return UP(new _.N(_.O,4,4028));if("onLoad"!==l)return UP(new _.N(_.O,4,4027));var m=_.JD([d],[h]);d=_.ck(m,b);d.type=1;return RP(e.fetch(d),function(n){n=_.Q.ea(n.data);n=g.we(n,a.tagName);if(!n)return UP(new _.N(_.O,4,4001,{uri:h}));g.zf(a);g.kf(n,a);g.jf(n,a);return jQ(a,b,c,m[0],e,f+1)})},jQ=function(a,b,c,d,e,f){f=void 0===f?0:f;var g=_.To;if(g.getAttributeNS(a,DP,"href"))return g=kQ(a,b,c,d,e,f),c&&(g=RP(g,void 0,function(){return jQ(a,
b,c,d,e,f)})),g;var h=[],l=g.Ze(a);l=_.u(l);for(var m=l.next();!m.done;m=l.next())m=m.value,"urn:mpeg:dash:resolve-to-zero:2013"===g.getAttributeNS(m,DP,"href")?g.removeChild(a,m):m.tagName!==zP&&h.push(jQ(m,b,c,d,e,f));return RP(VP(h),function(){return a})},lQ=function(a,b,c){var d=a.Ga.duration,e=a.Ga.vi;if(!a.eg)return e=new _.PE(b),_.lE(e,d),e;var f=a.Na;var g=a.O;f=f&&f.id&&g&&g.id?f.id+","+g.id:null;if(!a.zi||null==c[f])return a=new _.PE(b),e||_.lE(a,d),c[f]=a;c=c[f];e||_.lE(new _.PE(b),d);
c.ta(b);_.RE(c,_.DE(a.presentationTimeline)-a.Ga.start);return c},mQ=function(a,b){var c=a.presentationTimeline,d=_.gh(b.a).concat();c.l||0===d.length||(c.J=Math.floor(Math.max(c.J||0,d[d.length-1].endTime+a.Ga.start)));a.zi||_.AE(a.presentationTimeline,_.gh(b.a).concat(),a.Ga.start)},nQ=function(a){return""===a.id?a.schemeIdUri+":"+a.startTime+":"+a.endTime:a.id},pQ=function(a,b,c,d){var e,f=(new _.pn).aa("sidx",function(h){e=oQ(b,d,c,h)});a&&f.parse(a);if(e)return e;f=b+"-"+(b+a.byteLength-1);var g=
c[0];a=_.Oj(a);_.Ph('Invalid box type. Expected "sidx", but received:',a,"from:",g,"byte range:",f);throw new _.N(_.O,3,3004,{url:g,gp:f,size:a.byteLength,Ap:WP(a)});},oQ=function(a,b,c,d){var e=[];d.reader.skip(4);var f=_.kn(d.reader);if(0===f)throw _.Ph("Invalid timescale."),new _.N(_.O,3,3005);if(0===d.version){var g=_.kn(d.reader);var h=_.kn(d.reader)}else g=_.mn(d.reader),h=_.mn(d.reader);d.reader.skip(2);var l=_.jn(d.reader);a=a+d.size+h;for(h=0;h<l;h++){var m=_.kn(d.reader),n=(m&2147483648)>>>
31;m&=2147483647;var p=_.kn(d.reader);d.reader.skip(4);if(1===n)throw _.Ph("Hierarchical SIDXs are not supported."),new _.N(_.O,3,3006);e.push(new _.zj(e.length,g/f-b,(g+p)/f-b,function(){return c},a,a+m-1,b));g+=p;a+=m}d.parser.stop();return e},qQ=function(a){this.f=a;this.a=new _.en(a,!1)},uQ=function(a){var b=rQ(a);if(7<b.length)throw new _.N(_.O,3,3002);for(var c=0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=rQ(a);a:{d=_.u(sQ);for(var e=d.next();!e.done;e=d.next())if(_.Qm(c,new Uint8Array(e.value))){d=
!0;break a}d=!1}if(d)c=a.f.byteLength-a.a.getPosition();else{if(8===c.length&&c[1]&224)throw new _.N(_.O,3,3001);d=c[0]&(1<<8-c.length)-1;for(e=1;e<c.length;e++)d=256*d+c[e];c=d}c=a.a.getPosition()+c<=a.f.byteLength?c:a.f.byteLength-a.a.getPosition();d=new DataView(a.f.buffer,a.f.byteOffset+a.a.getPosition(),c);a.a.skip(c);return new tQ(b,d)},rQ=function(a){var b=_.hn(a.a),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new _.N(_.O,3,3002);var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=_.hn(a.a);
return d},tQ=function(a,b){this.id=a;this.a=b},vQ=function(a){if(8<a.a.byteLength)throw new _.N(_.O,3,3002);if(8===a.a.byteLength&&a.a.getUint8(0)&224)throw new _.N(_.O,3,3001);for(var b=0,c=0;c<a.a.byteLength;c++){var d=a.a.getUint8(c);b=256*b+d}return b},wQ=function(){},yQ=function(a,b,c,d,e,f){function g(){return e}var h=[];a=new qQ(a.a);for(var l=null,m=null;_.fn(a.a);){var n=uQ(a);if(187===n.id){var p=xQ(n);p&&(n=c*p.Io,p=b+p.ao,null!=l&&h.push(new _.zj(h.length,l-f,n-f,g,m,p-1,f)),l=n,m=p)}}null!=
l&&h.push(new _.zj(h.length,l-f,d-f,g,m,null,f));return h},xQ=function(a){var b=new qQ(a.a);a=uQ(b);if(179!==a.id)throw _.Jh("Not a CueTime element."),new _.N(_.O,3,3013);a=vQ(a);b=uQ(b);if(183!==b.id)throw _.Jh("Not a CueTrackPositions element."),new _.N(_.O,3,3012);b=new qQ(b.a);for(var c=0;_.fn(b.a);){var d=uQ(b);if(241===d.id){c=vQ(d);break}}return{Io:a,ao:c}},zQ=function(a,b){var c=hQ(a,b,"Initialization");if(!c)return null;var d=a.O.ka,e=c.getAttribute("sourceURL")||void 0;e&&(d=_.JD(a.O.ka,
[e]));var f=0,g=null;if(c=_.To.W(c,"range",$P))f=c.start,g=c.end;return new _.LD(function(){return d},f,g,null,null,e,a.O.Qa)},CQ=function(a,b){var c=Number(gQ(a,AQ,HP))||0,d=gQ(a,AQ,KP),e=1;d&&(e=bQ(d)||1);c=c/e||0;d=zQ(a,AQ);e=a.O.mimeType.split("/")[1];if(a.O.contentType!==_.pj&&"mp4"!==e&&"webm"!==e)throw _.Ph("SegmentBase specifies an unsupported container type.",a.O),new _.N(_.O,4,4006);if("webm"===e&&!d)throw _.Ph(wP,"the SegmentBase uses a WebM container,","but does not contain an Initialization element.",
a.O),new _.N(_.O,4,4005);var f=hQ(a,AQ,"RepresentationIndex"),g=gQ(a,AQ,"indexRange"),h=a.O.ka;g=$P(g||"");if(f){var l=f.getAttribute("sourceURL");l&&(h=_.JD(a.O.ka,[l]));g=_.To.W(f,"range",$P,g)}if(!g)throw _.Ph(wP,"the SegmentBase does not contain @indexRange","or a RepresentationIndex element.",a.O),new _.N(_.O,4,4002);a.presentationTimeline.B=null;e=BQ(a,b,d,h,g.start,g.end,e,c);return{createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,
adjustSegmentDurations:e.adjustSegmentDurations,getDuration:e.getDuration,initSegmentReference:d,getLastSegmentEndTime:e.getLastSegmentEndTime,Ha:c}},BQ=function(a,b,c,d,e,f,g,h){var l=a.presentationTimeline,m=!a.eg||!a.Ga.vi,n=a.Ga.start,p=a.Ga.duration,q=b,t=null;return{createSegmentIndex:function(v){var z,A,D,G,B,F;return _.H(function(M){if(1==M.a)return z=[q(d,e,f,v),"webm"===g?q(c.cb(),c.Da,c.oa,v):null],q=null,_.x(M,Promise.all(z),2);A=M.f;D=A[0];G=A[1]||null;B=null;"mp4"===g?B=pQ(D,e,d,h):
(F=new wQ,B=F.parse(D,G,d,h));_.AE(l,B,n);t=new _.PE(B);m&&_.lE(t,p);return M["return"](A)})},findSegmentPosition:function(v){return t.ld(v)},getSegmentReference:function(v){return t.get(v)},adjustSegmentDurations:function(v,z){return t.Nd(v,z)},getDuration:function(){return null!=p?p:t.getDuration()},getLastSegmentEndTime:function(){return p}}},AQ=function(a){return a.Be},JQ=function(a,b,c,d){var e=DQ(a),f=EQ(a);FQ(a,f);var g=null;if(f.pe)a.presentationTimeline.B=null,g=GQ(a,b,e,f);else if(f.Oa)d||
(a.presentationTimeline.B=null,SP(a.presentationTimeline,f.Tf),_.BE(a.presentationTimeline,f.Oa),_.yE(a.presentationTimeline,a.Ga.start)),g=HQ(a,f);else{b=IQ(a,f);var h=lQ(a,b,c);mQ(a,h);g={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:h.ld.bind(h),getSegmentReference:h.get.bind(h),adjustSegmentDurations:h.Nd.bind(h),getDuration:h.getDuration.bind(h),getLastSegmentEndTime:function(){return _.QE(h)}}}return{createSegmentIndex:g.createSegmentIndex,findSegmentPosition:g.findSegmentPosition,
getSegmentReference:g.getSegmentReference,adjustSegmentDurations:g.adjustSegmentDurations,getDuration:g.getDuration,initSegmentReference:e,getLastSegmentEndTime:g.getLastSegmentEndTime,Ha:f.Vb}},KQ=function(a){return a.wc},EQ=function(a){var b=iQ(a,KQ),c=gQ(a,KQ,"media");a=gQ(a,KQ,"index");return{Oa:b.Oa,timescale:b.timescale,Sc:b.Sc,fg:b.fg,Vb:b.Vb,Wg:b.Wg,timeline:b.timeline,qg:c,pe:a,Tf:b.Tf}},FQ=function(a,b){var c=b.pe?1:0;c+=b.timeline?1:0;c+=b.Oa?1:0;if(0===c)throw _.Ph("SegmentTemplate does not contain any segment information:",
"the SegmentTemplate must contain either an index URL template","a SegmentTimeline, or a segment duration.",a.O),new _.N(_.O,4,4002);1!==c&&(_.Jh("SegmentTemplate contains multiple segment information sources:","the SegmentTemplate should only contain an index URL template,","a SegmentTimeline or a segment duration.",a.O),b.pe?(_.Nh("Using the index URL template by default."),b.timeline=null):_.Nh("Using the SegmentTimeline by default."),b.Oa=null);if(!b.pe&&!b.qg)throw _.Ph(yP,"the SegmentTemplate's media URL template is missing.",
a.O),new _.N(_.O,4,4002);},GQ=function(a,b,c,d){var e=a.O.mimeType.split("/")[1];if("mp4"!==e&&"webm"!==e)throw _.Ph("SegmentTemplate specifies an unsupported container type.",a.O),new _.N(_.O,4,4006);if("webm"===e&&!c)throw _.Ph(yP,"the SegmentTemplate uses a WebM container,","but does not contain an initialization URL template.",a.O),new _.N(_.O,4,4005);var f=fQ(d.pe,a.O.id,null,a.bandwidth||null,null);f=_.JD(a.O.ka,[f]);return BQ(a,b,c,f,0,null,e,d.Vb)},HQ=function(a,b){var c=b.qg,d=a.Ga.duration,
e=b.Oa,f=b.Sc,g=b.fg,h=b.timescale,l=a.bandwidth||null,m=a.O.id,n=a.O.ka,p=a.O.Qa;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(q){return 0>q||d&&q>=d?null:Math.floor(q/e)},getSegmentReference:function(q){var t=q+f;if(null!==g&&t>g)return null;var v=q*e,z=v+e;d&&(z=Math.min(z,d));if(0>z||d&&v>=d)return null;var A=fQ(c,m,t,l,v*h);return new _.zj(q,v,z,function(){return _.JD(n,[A])},0,null,b.Vb,null,null,null,null,null,null,null,null,A,p)},adjustSegmentDurations:function(){},
getDuration:function(){return d},getLastSegmentEndTime:function(){return d}}},IQ=function(a,b){var c=b.qg,d=b.timeline;if(0===d.length)return[];for(var e=[],f={},g=0;g<d.length;f={Kf:f.Kf,Me:f.Me},g++){var h=g+b.Sc,l=d[g].Ho+b.Wg,m=a.O.id,n=a.bandwidth||null;f.Kf=a.O.ka;f.Me=fQ(c,m,h,n,l);e.push(new _.zj(h,d[g].start,d[g].end,function(p){return function(){return _.JD(p.Kf,[p.Me])}}(f),0,null,b.Vb,null,null,null,null,null,null,null,null,f.Me,a.O.Qa))}return e},DQ=function(a){var b=gQ(a,KQ,"initialization");
if(!b)return null;var c=a.O.ka,d=fQ(b,a.O.id,null,a.bandwidth||null,null);return new _.LD(function(){return _.JD(c,[d])},0,null,null,null,d,a.O.Qa)},PQ=function(a,b){var c=zQ(a,LQ),d=MQ(a);NQ(a,d);var e=OQ(a.Ga.duration,d.Sc,a.O.ka,a.O.Qa,d),f=lQ(a,e,b);mQ(a,f);return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:f.ld.bind(f),getSegmentReference:f.get.bind(f),adjustSegmentDurations:f.Nd.bind(f),getDuration:f.getDuration.bind(f),initSegmentReference:c,getLastSegmentEndTime:function(){return _.QE(f)},
Ha:d.Vb}},LQ=function(a){return a.vc},MQ=function(a){var b=QQ(a);a=iQ(a,LQ);var c=a.Sc;0===c&&(_.Jh("SegmentList@startNumber must be \x3e 0"),c=1);var d=0;a.Oa?d=a.Oa*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{Oa:a.Oa,startTime:d,Sc:c,Vb:a.Vb,timeline:a.timeline,Oc:b}},NQ=function(a,b){if(!b.Oa&&!b.timeline&&1<b.Oc.length)throw _.Jh(xP,"the SegmentList specifies multiple segments,","but does not specify a segment duration or timeline.",a.O),new _.N(_.O,4,4002);if(!b.Oa&&
!a.Ga.duration&&!b.timeline&&1===b.Oc.length)throw _.Jh(xP,"the SegmentList specifies one segment,","but does not specify a segment duration, period duration,","or timeline.",a.O),new _.N(_.O,4,4002);if(b.timeline&&0===b.timeline.length)throw _.Jh(xP,"the SegmentList has an empty timeline.",a.O),new _.N(_.O,4,4002);},OQ=function(a,b,c,d,e){var f=e.Oc.length;e.timeline&&e.timeline.length!==e.Oc.length&&(f=Math.min(e.timeline.length,e.Oc.length),_.Jh("The number of items in the segment timeline and the number of",
"segment URLs do not match, truncating",e.Oc.length,"to",f));for(var g=[],h=e.startTime,l={},m=0;m<f;l={Of:l.Of},m++){var n=e.Oc[m];l.Of=_.JD(c,[n.Bi]);var p=void 0;p=null!=e.Oa?h+e.Oa:e.timeline?e.timeline[m].end:h+a;g.push(new _.zj(m+b,h,p,function(q){return function(){return q.Of}}(l),n.start,n.end,e.Vb,null,null,null,null,null,null,null,null,n.Bi,d));h=p}return g},QQ=function(a){return[a.O.vc,a.ya.vc,a.Na.vc].filter(_.aj).map(function(b){return _.To.$(b,"SegmentURL")}).reduce(function(b,c){return 0<
b.length?b:c}).map(function(b){b.getAttribute("indexRange")&&!a.kg&&(a.kg=!0,_.Jh("We do not support the SegmentURL@indexRange attribute on SegmentList.  We only use the SegmentList@duration attribute or SegmentTimeline, which must be accurate."));var c=b.getAttribute("media");b=_.To.W(b,"mediaRange",$P,{start:0,end:null});return{Bi:c,start:b.start,end:b.end}})},RQ=function(a,b){this.g=a;this.f=b;this.a={clockSyncUri:void 0}},TQ=function(a,b,c,d){var e,f;return _.H(function(g){switch(g.a){case 1:return e=
_.To.$(b,"UTCTiming"),_.C(g,2),_.x(g,SQ(a,c,e),4);case 4:f=g.f;d.I=f;a.g.info("Clock synchronized. The difference between server and client clock was "+(f+" ms."));_.uh(g,3);break;case 2:_.E(g),a.g.warn("Failed to synchronize clocks. This content may not play on clients with bad clocks!");case 3:return g["return"](d)}})},SQ=function(a,b,c){c=c.map(function(e){return{scheme:e.getAttribute(IP),value:e.getAttribute(_.Dg)}});var d=a.a.clockSyncUri;!c.length&&d&&(a.g.info("No UTCTiming elements found, falling back on clockSyncUri from config to synchronize clocks."),
c.push({scheme:NP,value:d}));return 0===c.length?(a.g.warn(vP),Promise.reject(Error(vP))):TP(c,function(e){var f=e.scheme;e=e.value;switch(f){case NP:case "urn:mpeg:dash:utc:http-head:2012":return UQ(a,b,e,"HEAD");case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return UQ(a,b,e,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":var g=Date.parse(e);return isNaN(g)?
(a.g.warn("Invalid date for scheme "+f+", value: "+e),Promise.reject()):Promise.resolve(g-Date.now());case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return a.g.warn("NTP UTCTiming scheme is not supported"),Promise.reject();default:return a.g.warn("Unrecognized scheme in UTCTiming element",f),Promise.reject()}})["catch"](function(){a.g.warn(sP);return Promise.reject(Error(sP))})},UQ=function(a,b,c,d){var e,f,g,h;return _.H(function(l){if(1==
l.a)return e=_.JD(b,[c]),_.x(l,a.f(e,d),2);f=l.f;if("HEAD"===d){if(!f.headers||!f.headers.date)throw a.g.warn("UTC timing response is missing","expected date header"),Error("Date HTTP header missing.");g=f.headers.date}else g=_.Q.ea(f.data);h=Date.parse(g);if(isNaN(h))throw a.g.warn("Unable to parse date from UTC timing response"),Error("Date value invalid.");return l["return"](h-Date.now())})},WQ=function(a,b){return a.find(function(c){return VQ.get(c.jc)===b})},YQ=function(a){var b=_.To,c=b.ac(a.node,
LP,"pro");if(!c)return XQ.warn(uP,a),null;c=b.ra(c);if(!c)return XQ.warn(nP,a),null;a=_.Nm(c);a=_.Yo(a);a=_.Qo(a.a);return{keyId:null,jc:PP,node:b.md(),init:[{initData:_.wD(a),initDataType:_.hd,keyId:null}]}},ZQ=function(a,b){b=void 0===b?"4.0.0.0":b;var c=_.To,d=c.ac(a.node,MP,"pssh");if(!d)return null;d=c.ra(d);if(!d)return null;d=_.Nm(d);d=_.Ro(d);return d?(d=_.xD(b,d.a))?{keyId:null,jc:OP,node:c.md(),init:[{initData:_.wD(d),initDataType:_.hd,keyId:null}]}:null:(_.Jh("Unable to parse WV PSSH data. Can not create PR data!"),
null)},$Q=function(a,b){var c=_.To,d=c.ac(a.node,LP,"pro");if(!d)return _.Jh(uP,a),null;d=c.ra(d);if(!d)return _.Jh(nP,a),null;d=_.Nm(d);d=_.Yo(d);return d.version!==b&&(_.Oh("Parsing from "+d.version+" to "+b+"."),d=_.yD(d,b))?{keyId:null,jc:OP,node:c.md(),init:[{initData:_.wD(d),initDataType:_.hd,keyId:null}]}:null},cR=function(a,b,c,d){var e=aR(a),f=null;a=[];var g=[],h=WQ(e,_.Gd),l=WQ(e,_.Ed);if(l&&d){var m=$Q(l,d);m&&(e[e.indexOf(l)]=m)}l&&!h&&(m=YQ(l))&&e.push(m);h&&!l&&(d=ZQ(h,d||void 0))&&
e.push(d);d=new Set(e.map(function(n){return n.keyId}));d["delete"](null);if(1<d.size)throw new _.N(_.O,4,4010);b||(g=e.filter(function(n){return"urn:mpeg:dash:mp4protection:2011"===n.jc?(f=n.init||f,!1):!0}),g.length&&(a=bR(f,g,c),0===a.length&&(a=[_.KD(_.Qe,f,c)])));if(e.length&&(b||!g.length))for(a=[],b=_.u(VQ.values()),e=b.next();!e.done;e=b.next())e=e.value,e!==_.$e&&a.push(_.KD(e,f,c));if(c=Array.from(d)[0]||null)for(b=_.u(a),e=b.next();!e.done;e=b.next())for(e=_.u(e.value.initData),g=e.next();!g.done;g=
e.next())g.value.keyId=c;return{Yd:c,lp:f,drmInfos:a,Uh:!0}},dR=function(a,b,c,d,e){var f=cR(a,c,d,e);if(b.Uh){a=1===b.drmInfos.length&&!b.drmInfos[0].keySystem;c=0===f.drmInfos.length;if(0===b.drmInfos.length||a&&!c)b.drmInfos=f.drmInfos;b.Yd=f.Yd||b.Yd;b.Uh=!1}else if(0<f.drmInfos.length&&(b.drmInfos=b.drmInfos.filter(function(g){return f.drmInfos.some(function(h){return h.keySystem===g.keySystem})}),0===b.drmInfos.length))throw new _.N(_.O,4,4008);return f.Yd||b.Yd},eR=function(a){var b=_.To;a=
b.Fc(a.node,"https://dashif.org/CPS","Laurl").map(function(c){return b.ra(c)}).filter(Boolean);return 0===a.length?null:1===a.length?a[0]:a[XP(a.length)]},bR=function(a,b,c){var d=[];b=_.u(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value,g=VQ.get(f.jc);if(g){e=_.KD(g,f.init||a,c);if(g=fR.get(g))(f=g(f))?(e.licenseServerUri=f.licenseUrl,e.licenseServerUriOrigin=f.origin):e.licenseServerUri="";d.push(e)}}return d},aR=function(a){var b=[];a=_.u(a);for(var c=a.next();!c.done;c=a.next())(c=gR(c.value))&&
b.push(c);return b},gR=function(a){var b=_.To,c=a.getAttribute(IP),d=b.getAttributeNS(a,MP,"default_KID"),e=b.Fc(a,MP,"pssh").map(b.ra),f=b.ac(a,LP,"pro");if(!c)return _.Ph("Missing required schemeIdUri attribute on","ContentProtection element",a),null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new _.N(_.O,4,4009);var g=[];try{if(g=e.map(function(n){return{initDataType:_.hd,initData:_.Nm(n),keyId:null}}),0===g.length&&f&&b.ra(f))try{var h=b.ra(f),l=_.Nm(h),
m=_.Yo(l);g.push({initDataType:_.hd,initData:_.wD(m),keyId:null})}catch(n){_.Jh("Unable to parse ms:pro payload",n),g=[]}}catch(n){throw new _.N(_.O,4,4007);}return{node:a,jc:c,keyId:d,init:0<g.length?g:null}},hR=function(){var a=this;this.F=this.a=null;this.o=[];this.f=null;this.H=[];this.h=1;this.I={};this.l=0;this.J=new _.nE(5);this.B=new _.Xh(function(){a.hc()});this.A=new _.nk;this.j=new Map;this.g=new _.J("clpp.dash.DashParser");this.C=null;this.K=new RQ(this.g,function(b,c){var d=_.ck(b,a.a.attemptParameters);
d.type=5;d.method=c;d=a.F.networkingEngine.fetch(d);_.ok(a.A,d);return d.S});this.G=new Map;this.L=!1;this.w=null},jR=function(a){var b,c,d,e,f,g,h,l,m,n,p,q;return _.H(function(t){switch(t.a){case 1:b=a.w?_.DF(a.w,tP):null;var v=[];b&&(v=_.yF(b,""));0===v.length&&(v=a.o);c=v;d=_.ck(c,a.a.attemptParameters);d.type=1;e=a.F.networkingEngine;f=Date.now();g=e.fetch(d);_.ok(a.A,g);return _.x(t,g.S,2);case 2:h=t.f;if(!a.F)return t["return"](0);b||h.uri&&!a.o.includes(h.uri)&&a.o.unshift(h.uri);l=null!=
a.f;return _.x(t,iR(a,h.data,h.uri),3);case 3:m=t.f;if(!m.manifest.contentSteering){t.D(4);break}n=a;return _.x(t,a.F.onContentSteeringInfoFound(m.manifest.contentSteering),5);case 5:n.w=t.f;case 4:if(a.w&&b){0!==h.request.uriIndex&&_.EF(a.w,b.ka[0].serviceLocationId);var z=h.request;v=h.timeMs;var A=h.data.byteLength;v&&A&&(z=_.CF(a.w,b.ka[z.uriIndex].serviceLocationId),_.vF(z.Uf,v,A),z.ze=!0)}p=Date.now();q=(p-f)/1E3;_.oE(a.J,1,q);if(l&&a.F.onUpdate)a.F.onUpdate(m.manifest);if(m.Fo){if(a.F.onTurnedStatic)a.F.onTurnedStatic();
a.F.onEvent(new _.K(_.Oe))}return t["return"](q)}})},iR=function(a,b,c){var d,e,f,g,h;return _.H(function(l){if(1==l.a){d=_.Q.ea(b);_.$o(GP);e=_.To.we(d,"MPD");_.$o("parse.xml.end");_.bp(GP,GP,"parse.xml.end");if(!e)throw new _.N(_.O,4,4001,c);f=a.a.xlinkFailGracefully;g=jQ(e,a.a.attemptParameters,f,c,a.F.networkingEngine);_.ok(a.A,g);return _.x(l,g.S,2)}h=l.f;return l["return"](kR(a,h,c))})},lR=function(a,b,c){if(a.length){c=c||"__clpp_baseUriCollection_\n        "+b.length;var d=[];a.forEach(function(e){var f=
e.getAttribute("serviceLocation");e=_.To.ra(e);f&&e&&d.push({serviceLocationId:f,uri:e,params:{}})});if(d.length)return a=new _.xF(c,d),b.push(a),a}return null},kR=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,t,v,z,A,D,G,B,F,M,R,ka;return _.H(function(U){if(1==U.a){d=_.To;e=[];f=[c];g=d.$(b,tP);h=g.map(d.ra).filter(_.aj);0<h.length&&(l=_.JD(f,h),f=a.o=l,lR(g,e,tP));m=d.$(b,oP);n=m.map(d.ra);p=_.JD(f,n);lR(m,e,oP);q=b.getAttribute("type")||JP;a.l=d.W(b,"minimumUpdatePeriod",ZP,-1);q===JP&&0<=a.l&&(a.g.warn("Invalid manifest - a static manifest should not contain the `minimumUpdatePeriod` attribute. The attribute will be ignored."),
a.l=-1,a.B.stop());t=d.W(b,"maxSegmentDuration",ZP);if(v=q===JP&&"dynamic"===a.C)a.g.info("MPD dynamic to static transition."),q="dynamic";z=q===JP;A="dynamic"===q;if(a.f)var qa=a.f.presentationTimeline;else{var Ba=_.To;qa=a.a.timeline||{};var Ca=Ba.W(b,"suggestedPresentationDelay",ZP),Da=Ba.W(b,"minBufferTime",ZP,0);Ca=null!=a.a.suggestedPresentationDelay?a.a.suggestedPresentationDelay:a.a.lowLatencyMode?0:null!=Ca?Ca:3*Da;Ba=Ba.W(b,"availabilityStartTime",YP);qa=new _.tE(qa,Ba,Ca,z,!!a.a.autoCorrectDrift,
!!a.a.lowLatencyMode);qa=z?qa:TQ(a.K,b,p,qa)}return _.x(U,qa,2)}D=U.f;qa=_.To.W(b,"timeShiftBufferDepth",ZP);G=A&&a.a.availabilityWindowOverride&&!isNaN(a.a.availabilityWindowOverride)?a.a.availabilityWindowOverride:null===qa?Infinity:qa;D.A=G;if(!a.F)throw new _.N(_.O,7,7001);B={eg:A,zi:null!=a.f,presentationTimeline:D,Na:null,Ga:null,ya:null,O:null,bandwidth:0,kg:!1,xm:v,xc:null,te:null};F=mR(a,B,p,e,b);M=F.duration;R=F.periods;v&&(nR(R,B),D.C=!0);if(z||!v&&!F.Oh)D.f=M||Infinity;if(2===a.a.timeline.version){qa=
M;Ba=R[0].startTime;if(null==qa||Infinity===qa)qa=oR(R);_.sE(D.a,Ba,Ba+qa)}_.BE(D,t||1);D.isLive();if(!a.f){a.f={presentationTimeline:D,periods:R,minBufferTime:0,cues:[]};a:{Ca=_.To;if(Da=Ca.Ka(b,"ContentSteering"))if(qa=Da.getAttribute("defaultServiceLocation")||"",Ba=Ca.ra(Da)){Ca=Ca.W(Da,"queryBeforeStart",eQ,!1);qa={manifestType:_.Ic,contentSteeringServerUri:Ba,defaultServiceLocation:qa,queryBeforeStart:Ca||!1,baseUriCollections:[]};break a}qa=null}if(ka=qa)a.f.contentSteering=ka,a.f.contentSteering.baseUriCollections=
e}a.f.cues=F.cues;a.C=q;return U["return"]({manifest:a.f,Fo:v})})},oR=function(a){return a.map(function(b){return b.variants[0].video||b.variants[0].audio}).reduce(function(b,c){return c?c.getDuration():0+b},0)},mR=function(a,b,c,d,e){var f=_.To,g=f.W(e,"mediaPresentationDuration",ZP),h=a.f?a.f.periods[a.f.periods.length-1]||null:null,l=[],m=[],n=0;e=f.$(e,"Period");for(var p=0;p<e.length;p++){var q=e[p];n=f.W(q,_.ag,ZP,n);var t=f.W(q,BP,ZP),v=null;if(p!==e.length-1){var z=f.W(e[p+1],_.ag,ZP);null!=
z&&(v=z-n)}else null!=g&&(v=g-n);z=_.nw;v&&t&&Math.abs(v-t)>z&&a.g.warn("There is a gap/overlap between Periods",q);null==v&&(v=t);q=pR(a,b,c,d,{start:n,duration:v,node:q,vi:null==v||p===e.length-1});t=q.Na;m.push(t);l=l.concat(q.cues);a.H.includes(t.id)||(a.H.push(t.id),a.f&&(a.F.filterNewPeriod(t),a.f.periods.push(t)));if(null==v){p!==e.length-1&&a.g.warn("Skipping Period",p+1,"and any subsequent Periods:","Period",p+1,"does not have a valid start time.",m[p+1]);n=null;break}n+=v}null==a.f&&a.F.filterAllPeriods(m);
h&&(b=m.find(function(A){return A.id===h.id}))&&(h.endTime=b.endTime);l=qR(a,l);return null!=g?(n!==g&&a.g.warn("@mediaPresentationDuration does not match the total duration of ","all Periods."),{periods:m,duration:g,Oh:!1,cues:l}):{periods:m,duration:n,Oh:!0,cues:l}},qR=function(a,b){var c=new Set(b.map(nQ));a.j.forEach(function(d,e){c.has(e)||a.j["delete"](e)});b.forEach(function(d){var e=nQ(d);a.j.has(e)||a.j.set(e,d)});return Array.from(a.j.values())},pR=function(a,b,c,d,e){var f=_.To;b.Na=rR(a,
e.node,null,c,d);b.Ga=e;c=b.Na.id||"__clpp_period_"+e.start;b.Na.id||(a.g.info("No Period ID given for Period with start time "+e.start+(",  Assigning a default: "+c+".")),b.Na.id=c);d=f.$(e.node,"EventStream").flatMap(function(t){return sR(a,e.start,e.duration,t)});var g=f.$(e.node,_.la).map(function(t){return tR(a,b,t)}).filter(_.aj);if(b.eg){f=[];for(var h=_.u(g),l=h.next();!l.done;l=h.next()){l=_.u(l.value.fo);for(var m=l.next();!m.done;m=l.next())f.push(m.value)}if(f.length!==(new Set(f)).size)throw new _.N(_.O,
4,4018);}f=g.filter(function(t){return!t.Ug});h=g.filter(function(t){return t.Ug});h=_.u(h);for(l=h.next();!l.done;l=h.next()){m=l.value;m.streams.forEach(function(t){t.trickPlay=!0});l=m.streams[0];m=m.Ug;for(var n=_.u(f),p=n.next();!p.done;p=n.next())if(p=p.value,m.includes(p.id)){p=_.u(p.streams);for(var q=p.next();!q.done;q=p.next())q.value.trickModeVideo=l}}h=uR(g,_.Jg);l=uR(f,_.Pc);if(!h.length&&!l.length)throw new _.N(_.O,4,4004);l.length||(l=[null]);h.length||(h=[null]);g=[];l=_.u(l);for(m=
l.next();!m.done;m=l.next())for(m=m.value,n=_.u(h),p=n.next();!p.done;p=n.next())vR(a,m,p.value,g);l=_.gh(uR(f,_.pj)).concat(_.gh(uR(f,_.hg)));h=[];l=_.u(l);for(m=l.next();!m.done;m=l.next())h.push.apply(h,m.value.streams);m=uR(f,_.se);l=[];m=_.u(m);for(n=m.next();!n.done;n=m.next())l.push.apply(l,n.value.streams);f=wR(e,f);return{Na:{id:c,configurationId:a.F.configurationId,startTime:e.start,endTime:f,textStreams:h,thumbStreams:l,variants:g},cues:d}},wR=function(a,b){if(null!==a.duration)return a.start+
a.duration;if(0<b.length){var c=b.filter(function(d){return 0<d.streams.length}).map(function(d){return d.streams}).flat().filter(function(d){return d.getLastSegmentEndTime}).map(function(d){return d.getLastSegmentEndTime()});return 0<c.length?a.start+Math.min.apply(Math,_.gh(c)):null}return null},uR=function(a,b){return a.filter(function(c){return c.contentType===b})},vR=function(a,b,c,d){var e;if(b||c)if(b&&c){if(_.fq(b.drmInfos,c.drmInfos)){var f=_.eq(b.drmInfos,c.drmInfos),g=_.u(b.streams);for(e=
g.next();!e.done;e=g.next()){var h=e.value,l=_.u(c.streams);for(e=l.next();!e.done;e=l.next()){var m=e.value;e=(m.bandwidth||0)+(h.bandwidth||0);e={id:a.h++,language:b.language,primary:b.pg||c.pg,audio:h,video:m,bandwidth:e,drmInfos:f,allowedByApplication:!0,allowedByKeySystem:!0};d.push(e)}}}}else for(f=b||c,g=_.u(f.streams),e=g.next();!e.done;e=g.next())h=e.value,e=h.bandwidth||0,e={id:a.h++,language:f.language||_.wg,primary:f.pg,audio:b?h:null,video:c?h:null,bandwidth:e,drmInfos:f.drmInfos,allowedByApplication:!0,
allowedByKeySystem:!0},d.push(e)},tR=function(a,b,c){var d=_.To;b.ya=rR(a,c,b.Na,null,null);var e=!1,f=d.$(c,"Role"),g=f.map(function(F){return F.getAttribute(_.Dg)}).filter(_.aj),h=null,l=d.$(c,"Label").map(d.ra).filter(_.aj);l&&0<l.length&&(h=l[l.length-1]);var m=void 0;(l=b.ya.contentType===_.pj)&&(m=_.hg);f=_.u(f);for(var n=f.next();!n.done;n=f.next()){n=n.value;var p=n.getAttribute(IP);if(null==p||"urn:mpeg:dash:role:2011"===p||"urn:mpeg:dash:role"===p)switch(n=n.getAttribute(_.Dg),n){case _.Fe:e=
!0;break;case _.dd:case _.hg:m=n;break;case "forced-subtitle":case "forced_subtitle":case _.ke:m=_.ke}}n=d.$(c,rP);f=null;n=_.u(n);for(var q=n.next();!q.done;q=n.next()){q=q.value;p=q.getAttribute(IP)||"";q=q.getAttribute(_.Dg);if(p!==CP&&!xR.includes(p)||void 0===q)return null;p===CP&&(0===q.length&&(f=null),f=q.split(" "))}n=d.$(c,"Accessibility");var t=new Map;p=_.u(n);for(q=p.next();!q.done;q=p.next()){var v=q.value;q=v.getAttribute(IP);if("urn:scte:dash:cc:cea-608:2015"===q||"urn:scte:dash:cc:cea-708:2015"===
q)if(q=1,v=v.getAttribute(_.Dg),null!=v){v=_.u(v.split(";"));for(var z=v.next();!z.done;z=v.next()){var A=z.value,D=z=void 0;A.includes("\x3d")?(A=A.split("\x3d"),z=A[0].startsWith("CC")?A[0]:"CC"+A[0],D=A[1].split(",")[0].split(":").pop()):(z="CC"+q,q+=2,D=A);t.set(z,_.Cj(D))}}else t.set("CC1",_.wg)}p=d.$(c,qP);var G=cR(p,a.a.ignoreDrmInfo,b.Na.id,a.a.playreadyVersion||null),B=c.getAttribute("lang")||_.wg;p=_.Cj(B);null==h&&(h=c.getAttribute("label"));d=d.$(c,_.Cb);c=d.map(function(F){return yR(a,
b,G,m,B,h||"",e,g,t,F)}).filter(_.aj);if(0===c.length){if(l)return null;throw new _.N(_.O,4,4003);}if(!b.ya.contentType||b.ya.contentType===_.Gc)for(b.ya.contentType=zR(c[0].mimeType,c[0].codecs),l=_.u(c),q=l.next();!q.done;q=l.next())q.value.type=b.ya.contentType;l=_.u(c);for(q=l.next();!q.done;q=l.next())for(q=q.value,v=_.u(G.drmInfos),z=v.next();!z.done;z=v.next())z=z.value,q.keyId&&!z.keyIds.includes(q.keyId)&&z.keyIds.push(q.keyId);c=AR(c,b.ya.contentType,n);l=d.map(function(F){return F.getAttribute("id")}).filter(_.aj);
return{id:b.ya.id||"__fake__"+a.h++,contentType:b.ya.contentType,language:p,originalLanguage:B,pg:e,streams:c,drmInfos:G.drmInfos,Ug:f,fo:l}},AR=function(a,b,c){var d=b===_.hg?_.pj:b;b=c.map(function(f){return{scheme:f.getAttribute(IP)||"",id:f.getAttribute("id")||void 0,value:f.getAttribute(_.Dg)||"",protocol:"DASH",type:d}});c=_.u(a);for(var e=c.next();!e.done;e=c.next())e.value.accessibility=b;return a},yR=function(a,b,c,d,e,f,g,h,l,m){var n=_.To,p=_.Cj(e);b.O=rR(a,m,b.ya,null,null);if(!BR(a,b.O))return a.g.warn("Skipping Representation",
b.O),null;b.xc=b.Na.id+" "+b.O.id;b.te=a.G.get(b.xc);b.bandwidth=n.W(m,"bandwidth",bQ)||0;var q=CR(a,b);if(!q)return null;a.G.set(b.xc,q.Ha);var t=n.$(m,qP);a=dR(t,c,a.a.ignoreDrmInfo,b.Na.id,a.a.playreadyVersion||null);t=!1;n.$(m,"SupplementalProperty").some(function(A){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===A.getAttribute(IP)&&"JOC"===A.getAttribute(_.Dg)})&&(b.O.mimeType="audio/eac3-joc",t=!0);var v=void 0;if(b.O.contentType===_.se){var z=(m=n.Ka(m,rP))&&m.getAttribute(IP);DR.includes(z||
"")&&(m=_.Hj(m.getAttribute(_.Dg)||""))&&(q.horizontalTiles=m.ke,q.verticalTiles=m.Fe,b.ya.wc&&(z=n.W(b.ya.wc,BP,cQ)||0,n=n.W(b.ya.wc,KP,cQ)||1,(n=z/n)&&(v=n/m.Bo)))}return{id:_.hL++,originalId:b.O.id,createSegmentIndex:q.createSegmentIndex,findSegmentPosition:q.findSegmentPosition,getSegmentReference:q.getSegmentReference,initSegmentReference:q.initSegmentReference,adjustSegmentDurations:q.adjustSegmentDurations,getLastSegmentEndTime:q.getLastSegmentEndTime,getDuration:q.getDuration,segmentLookupStrategy:_.hD,
mimeType:b.O.mimeType,codecs:b.O.codecs,frameRate:b.O.frameRate,bandwidth:b.bandwidth,width:b.O.width,height:b.O.height,kind:d,encrypted:0<c.drmInfos.length,keyId:a,language:p,originalLanguage:e,label:f,type:b.ya.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.O.emsgSchemeIdUris,roles:h,channelsCount:b.O.rg,spatialAudio:t,closedCaptions:l,horizontalTiles:q.horizontalTiles,verticalTiles:q.verticalTiles,durationPerTile:v}},CR=function(a,b){var c=a.a.attemptParameters,d=b.O.contentType;
d=d===_.pj||d===_.Gc;try{var e=function(h,l,m,n){var p,q;return _.H(function(t){if(1==t.a)return p=_.qE(h,l,m,c),p.type=2,_.x(t,n.fetch(p),2);q=t.f;return t["return"](q.data)})};if(b.O.Be)return CQ(b,e);if(b.O.vc)return PQ(b,a.I);if(b.O.wc)return JQ(b,e,a.I,!!a.f);var f=b.O.ka,g=b.Ga.duration||0;d=function(){return g};return{createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(h){return 0<=h&&h<g?1:null},getSegmentReference:function(h){return 1!==h?null:new _.zj(1,
0,g,function(){return f},0,null,0,null,null,null,null,null,null,null,null,"",b.O.Qa)},adjustSegmentDurations:function(){},getDuration:d,getLastSegmentEndTime:d,verticalTiles:void 0,horizontalTiles:void 0,initSegmentReference:null,Ha:0}}catch(h){if(d&&4002===h.code)return a.g.debug("Ignoring DASH_NO_SEGMENT_INFO error in a text stream",h),null;throw h;}},ER=function(a,b){0>a.l||a.B.ga(Math.max(3,a.l-b,_.pE(a.J)))},rR=function(a,b,c,d,e){var f=_.To;c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],
frameRate:void 0,rg:null,Qa:e?e.find(function(t){return t.id===oP})||null:null};d=d||c.ka;var g=f.$(b,oP),h=g.map(f.ra);e=e?lR(g,e,b.getAttribute("id")||void 0):null;g=b.getAttribute("contentType")||c.contentType;var l=b.getAttribute(_.Ke)||c.mimeType,m=b.getAttribute(_.zd)||c.codecs,n=f.W(b,"frameRate",dQ)||c.frameRate,p=FR(f.$(b,"InbandEventStream"),c.emsgSchemeIdUris),q=f.$(b,"AudioChannelConfiguration");a=GR(a,q)||c.rg;g||(g=zR(l,m));return{ka:_.JD(d,h),Qa:e||c.Qa,Be:f.Ka(b,"SegmentBase")||c.Be,
vc:f.Ka(b,"SegmentList")||c.vc,wc:f.Ka(b,"SegmentTemplate")||c.wc,width:f.W(b,_.Yg,cQ)||c.width,height:f.W(b,_.pe,cQ)||c.height,contentType:g,mimeType:l,codecs:m,frameRate:n,emsgSchemeIdUris:p,id:b.getAttribute("id")||"",rg:a}},FR=function(a,b){for(var c=b.slice(),d=_.u(a),e=d.next();!e.done;e=d.next())(e=e.value.getAttribute(IP))&&!c.includes(e)&&c.push(e);return c},GR=function(a,b){for(var c=_.u(b),d=c.next();!d.done;d=c.next()){var e=d.value;if(d=e.getAttribute(IP))if(e=e.getAttribute(_.Dg))switch(d){case "urn:mpeg:dash:outputChannelPositionList:2012":return e.trim().split(/ +/).length;
case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":var f=parseInt(e,10);if(!f){a.g.warn(pP,d,e);continue}return f;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":f=parseInt(e,16);if(!f){a.g.warn(pP,d,e);continue}for(c=0;f;)f&1&&++c,f>>=1;return c;default:a.g.warn("Unrecognized audio channel scheme:",d,e)}}return null},BR=function(a,b){var c=b.Be?1:0;c+=b.vc?1:0;c+=
b.wc?1:0;if(0===c){if(b.contentType===_.pj||b.contentType===_.Gc)return!0;a.g.warn("Representation does not contain a segment information source:","the Representation must contain one of SegmentBase, SegmentList,",'SegmentTemplate, or explicitly indicate that it is "text".',b);return!1}1!==c&&(a.g.warn("Representation contains multiple segment information sources:","the Representation should only contain one of SegmentBase,","SegmentList, or SegmentTemplate.",b),b.Be?(a.g.info("Using SegmentBase by default."),
b.vc=null):a.g.info("Using SegmentList by default."),b.wc=null);return!0},sR=function(a,b,c,d){var e=_.To,f=d.getAttribute(IP)||"",g=d.getAttribute(_.Dg)||"",h=e.W(d,KP,cQ)||1,l=e.W(d,HP,cQ)||0,m=[],n={};d=_.u(e.$(d,"Event"));for(var p=d.next();!p.done;n={Yc:n.Yc},p=d.next()){p=p.value;var q=e.W(p,"presentationTime",cQ)||0,t=e.W(p,BP,cQ)||0;q=b+q/h-l/h;t=q+t/h;null!=c&&(q=Math.min(q,b+c),t=Math.min(t,b+c));var v=_.xg;f.startsWith(_.zg)?v=_.Ci:"urn:mpeg:dash:event:callback:2015"===f&&(v=_.Pe);n.Yc=
{configurationId:a.F.configurationId,schemeIdUri:f,value:g,startTime:q,endTime:t,id:p.getAttribute("id")||"",type:v,eventElement:e.De(p)};n.Yc.type===_.Pe&&(n.Yc.rf=function(z){return function(){var A=z.Yc;A.eventElement&&(A=A.eventElement.getAttribute("messageData")||"")&&A.startsWith("http")&&(A=_.ck(A),A.type=_.bk,a.F.networkingEngine.fetch(A))}}(n));m.push(n.Yc)}return m},zR=function(a,b){return _.PF(_.ol(a,b))?_.pj:a.split("/")[0]},HR=function(a){var b=new Set;a.forEach(function(c){c.variants.forEach(function(d){d.audio&&
b.add(d.audio);d.video&&b.add(d.video)})});return Array.from(b)},nR=function(a,b){var c=HR(a).filter(function(d){return d.getLastSegmentEndTime}).map(function(d){return d.getLastSegmentEndTime()});0<c.length&&(c=Math.min.apply(Math,_.gh(c)),_.zE(b.presentationTimeline,c+b.Ga.start))},IR=function(){};_.Go.prototype.De=_.tD(20,function(a){return a});
_.ZD.prototype.De=_.tD(19,function(a){var b=this,c=Array.from(a.a.entries()).map(function(e){e=_.u(e);var f=e.next().value;return"xmlns:"+e.next().value+'\x3d"'+f+'"'}).join(" "),d=(new DOMParser).parseFromString('\x3c?xml version\x3d"1.0"?\x3e\x3c'+a.tagName+" "+(c+"/\x3e"),_.lg).childNodes[0];Object.keys(a.attributes).forEach(function(e){d.setAttribute(e,a.attributes[e])});a.childNodes.forEach(function(e){e.tagName===_.da?d.textContent+=e.textContent:d.appendChild(b.De(e))});return d});
_.Go.prototype.Af=_.tD(18,function(a,b){Array.from(a.attributes).forEach(function(c){c.namespaceURI===b&&a.removeAttributeNS(c.namespaceURI,c.localName)})});_.ZD.prototype.Af=_.tD(17,function(a,b){var c=a.a.get(b);if(c){var d=c+":";Object.keys(a.attributes).forEach(function(e){e.startsWith(d)&&delete a.attributes[e]})}});_.Go.prototype.jf=_.tD(16,function(a,b){for(var c=_.u(a.attributes),d=c.next();!d.done;d=c.next())d=d.value,b.setAttributeNS(d.namespaceURI,d.nodeName,d.value)});
_.ZD.prototype.jf=_.tD(15,function(a,b){Object.keys(a.attributes).forEach(function(c){b.attributes[c]=a.attributes[c]})});_.Go.prototype.kf=_.tD(14,function(a,b){Array.from(a.childNodes).forEach(function(c){a.removeChild(c);b.appendChild(c)})});_.ZD.prototype.kf=_.tD(13,function(a,b){b.childNodes.push.apply(b.childNodes,_.gh(a.childNodes));a.childNodes=[]});_.Go.prototype.zf=_.tD(12,function(a){Array.from(a.childNodes).forEach(function(b){a.removeChild(b)})});
_.ZD.prototype.zf=_.tD(11,function(a){a.childNodes=[]});_.Go.prototype.md=_.tD(10,function(){return document.createElement("null")});_.ZD.prototype.md=_.tD(9,function(){return new _.WD("NULL",null,{},[],null,new Map)});_.Go.prototype.Ze=_.tD(8,function(a){return Array.from(a.childNodes).filter(function(b){return b instanceof Element})});_.ZD.prototype.Ze=_.tD(7,function(a){return a.childNodes});
_.Go.prototype.W=_.tD(6,function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e});_.ZD.prototype.W=_.tD(5,function(a,b,c,d){d=void 0===d?null:d;var e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e});_.Go.prototype.Fc=_.tD(4,function(a,b,c){return Array.from(a.childNodes).filter(function(d){return d instanceof Element&&d.localName===c&&d.namespaceURI===b})});
_.ZD.prototype.Fc=_.tD(3,function(a,b,c){b=a.a.get(b);if(!b)return[];var d=b+":"+c;return a.childNodes.filter(function(e){return e.tagName===d})});_.Go.prototype.ac=_.tD(2,function(a,b,c){a=this.Fc(a,b,c);return 1!==a.length?null:a[0]});_.ZD.prototype.ac=_.tD(1,function(a,b,c){a=this.Fc(a,b,c);return 1!==a.length?null:a[0]});var DR=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],xR=["urn:mpeg:mpegB:cicp:ColourPrimaries","urn:mpeg:mpegB:cicp:MatrixCoefficients","urn:mpeg:mpegB:cicp:TransferCharacteristics"];var sQ=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];wQ.prototype.parse=function(a,b,c,d){b=new qQ(new DataView(b));if(440786851!==uQ(b).id)throw _.Ph("Not an EBML element."),new _.N(_.O,3,3008);var e=uQ(b);if(408125543!==e.id)throw _.Ph("Not a Segment element."),new _.N(_.O,3,3009);b=e.a.byteOffset;e=new qQ(e.a);for(var f=null;_.fn(e.a);){var g=uQ(e);if(357149030===g.id){f=g;break}}if(!f)throw _.Ph("Not an Info element."),new _.N(_.O,3,3010);f=new qQ(f.a);g=1E6;for(e=null;_.fn(f.a);){var h=uQ(f);if(2807729===h.id)g=vQ(h);else if(17545===h.id)if(4===
h.a.byteLength)e=h.a.getFloat32(0);else if(8===h.a.byteLength)e=h.a.getFloat64(0);else throw new _.N(_.O,3,3003);}if(null==e)throw new _.N(_.O,3,3011);f=g/1E9;e*=f;a=uQ(new qQ(new DataView(a)));if(475249515!==a.id)throw _.Ph("Not a Cues element."),new _.N(_.O,3,3007);return yQ(a,b,f,e,c,d)};var VQ=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",_.$e).set(PP,_.Gd).set(OP,_.Ed).set("urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95",_.Ed).set("urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2",_.Cd).set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb",_.Bd),fR=(new Map).set(_.Gd,function(a){var b=eR(a);if(b)return{licenseUrl:b,origin:_.gD};if(a=_.To.ac(a.node,"urn:microsoft","laurl"))if(a=a.getAttribute("licenseUrl"))return{licenseUrl:a,origin:"ms:laurl"};return null}).set(_.Ed,function(a){var b=
_.To,c=eR(a);if(c)return{licenseUrl:c,origin:_.gD};a=b.ac(a.node,LP,"pro");if(!a)return null;b=b.ra(a);if(!b)return null;b=_.Nm(b);return(b=_.Yo(b).h)?{licenseUrl:b,origin:"mspr:pro"}:null}),XQ=new _.J("clpp.dash.ContentProtection");_.r=hR.prototype;_.r.configure=function(a){this.a=a;this.K.a={clockSyncUri:a.clockSyncUri}};_.r.start=function(a,b){var c=this,d;return _.H(function(e){if(1==e.a)return c.o=[a],c.F=b,_.x(e,jR(c),2);d=e.f;c.F&&ER(c,d);if(!c.F)throw new _.N(_.O,7,7001);return e["return"](c.f)})};_.r.requestStop=function(){this.L=!0};_.r.stop=function(){this.a=this.F=null;this.o=[];this.f=null;this.H=[];this.I={};this.C=null;this.l=-1;this.B.stop();this.G.clear();this.j.clear();return this.A.destroy()};
_.r.update=function(){var a=this;jR(this)["catch"](function(b){if(a.F&&b)a.F.onError(b)})};_.r.setCurrentVariant=function(){};_.r.hc=function(){var a=this,b,c,d;return _.H(function(e){switch(e.a){case 1:return a.g.debug(_.ZC),b=0,_.C(e,2),_.x(e,jR(a),4);case 4:b=e.f;_.uh(e,3);break;case 2:if(c=_.E(e),a.F&&c.a&&(a.F.onError(c),d=c,d.severity===_.O))return e["return"]();case 3:if(!a.F)return e["return"]();if(!a.L){e.D(5);break}return _.x(e,a.stop(),6);case 6:return e["return"]();case 5:ER(a,b),_.y(e)}})};
_.r.loadVariant=function(a){return _.H(function(b){return b["return"](a)})};_.r.loadTextStream=function(a,b){var c=this,d,e;return _.H(function(f){(e=c.f.periods.find(function(g){return g.id===b}))&&(d=e.textStreams.find(function(g){return g.id===a})||null);if(!d)throw new _.Zi(_.PC+a);return f["return"](d)})};_.w(IR,_.Bu);IR.prototype.f=function(){_.dv.mpd=hR;_.bv[_.Ic]=hR};IR.prototype.a=function(){_.sF("mpd");_.tF(_.Ic)};IR.prototype.id=function(){return"dash"};_.I("clpp.dash.DashComponent",IR);};
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
else{_=this.clpp._;(f.call(g,this));}
})();